PageSourceSearch

https://vanovice.cz/js/combined-widgets-v2-tinymce.min.js?version=3b2edde27cadacc86851ec02d25bd6d4b691a81b

js vanovice.cz collected 2026-10-02 22:50:41 UTC 1,594,619 bytes, 204 lines download raw bytes

vendor: 8,943 bytes, lines 1-14
1/*! Files for widgets */
2/*! jQuery UI - v1.12.1 - 2022-02-09
3* http://jqueryui.com
4* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/dialog.js, widgets/mouse.js, widgets/slider.js, widgets/tabs.js
5* Copyright jQuery Foundation and other contributors; Licensed MIT */
6!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}((function(e){e.ui=e.ui||{};e.ui.version="1.12.1";
7/*!
8 * jQuery UI Widget 1.12.1
9 * http://jqueryui.com
10 *
11 * Copyright jQuery Foundation and other contributors
12 * Released under the MIT license.
13 * http://jquery.org/license
14 */var t,n=0,i=Array.prototype.slice;e.cleanData=(t=e.cleanData,function(n){var i,o,r;for(r=0;null!=(o=n[r]);r++)try{(i=e._data(o,"events"))&&i.remove&&e(o).triggerHandler("remove")}catch(e){}t(n)}),e.widget=function(t,n,i){var o,r,s,a={},l=t.split(".")[0],c=l+"-"+(t=t.split(".")[1]);return i||(i=n,n=e.Widget),e.isArray(i)&&(i=e.extend.apply(null,[{}].concat(i))),e.expr[":"][c.toLowerCase()]=function(t){return!!e.data(t,c)},e[l]=e[l]||{},o=e[l][t],r=e[l][t]=function(e,t){if(!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},e.extend(r,o,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),(s=new n).options=e.widget.extend({},s.options),e.each(i,(function(t,i){e.isFunction(i)?a[t]=function(){function e(){return n.prototype[t].apply(this,arguments)}function o(e){return n.prototype[t].apply(this,e)}return function(){var t,n=this._super,r=this._superApply;return this._super=e,this._superApply=o,t=i.apply(this,arguments),this._super=n,this._superApply=r,t}}():a[t]=i})),r.prototype=e.widget.extend(s,{widgetEventPrefix:o&&s.widgetEventPrefix||t},a,{constructor:r,namespace:l,widgetName:t,widgetFullName:c}),o?(e.each(o._childConstructors,(function(t,n){var i=n.prototype;e.widget(i.namespace+"."+i.widgetName,r,n._proto)})),delete o._childConstructors):n._childConstructors.push(r),e.widget.bridge(t,r),r},e.widget.extend=function(t){for(var n,o,r=i.call(arguments,1),s=0,a=r.length;s<a;s++)for(n in r[s])o=r[s][n],r[s].hasOwnProperty(n)&&void 0!==o&&(e.isPlainObject(o)?t[n]=e.isPlainObject(t[n])?e.widget.extend({},t[n],o):e.widget.extend({},o):t[n]=o);return t},e.widget.bridge=function(t,n){var o=n.prototype.widgetFullName||t;e.fn[t]=function(r){var s="string"==typeof r,a=i.call(arguments,1),l=this;return s?this.length||"instance"!==r?this.each((function(){var n,i=e.data(this,o);return"instance"===r?(l=i,!1):i?e.isFunction(i[r])&&"_"!==r.charAt(0)?(n=i[r].apply(i,a))!==i&&void 0!==n?(l=n&&n.jquery?l.pushStack(n.get()):n,!1):void 0:e.error("no such method '"+r+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+r+"'")})):l=void 0:(a.length&&(r=e.widget.extend.apply(null,[r].concat(a))),this.each((function(){var t=e.data(this,o);t?(t.option(r||{}),t._init&&t._init()):e.data(this,o,new n(r,this))}))),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,n){t._removeClass(n,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var i,o,r,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},i=t.split("."),t=i.shift(),i.length){for(o=s[t]=e.widget.extend({},this.options[t]),r=0;r<i.length-1;r++)o[i[r]]=o[i[r]]||{},o=o[i[r]];if(t=i.pop(),1===arguments.length)return void 0===o[t]?null:o[t];o[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=n}return this._setOptions(s),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var n,i,o;for(n in t)o=this.classesElementLookup[n],t[n]!==this.options.classes[n]&&o&&o.length&&(i=e(o.get()),this._removeClass(o,n),i.addClass(this._classes({element:i,keys:n,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var n=[],i=this;function o(o,r){var s,a;for(a=0;a<o.length;a++)s=i.classesElementLookup[o[a]]||e(),s=t.add?e(e.unique(s.get().concat(t.element.get()))):e(s.not(t.element).get()),i.classesElementLookup[o[a]]=s,n.push(o[a]),r&&t.classes[o[a]]&&n.push(t.classes[o[a]])}return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&o(t.keys.match(/\S+/g)||[],!0),t.extra&&o(t.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(t){var n=this;e.each(n.classesElementLookup,(function(i,o){-1!==e.inArray(t.target,o)&&(n.classesElementLookup[i]=e(o.not(t.target).get()))}))},_removeClass:function(e,t,n){return this._toggleClass(e,t,n,!1)},_addClass:function(e,t,n){return this._toggleClass(e,t,n,!0)},_toggleClass:function(e,t,n,i){i="boolean"==typeof i?i:n;var o="string"==typeof e||null===e,r={extra:o?t:n,keys:o?e:t,element:o?this.element:e,add:i};return r.element.toggleClass(this._classes(r),i),this},_on:function(t,n,i){var o,r=this;"boolean"!=typeof t&&(i=n,n=t,t=!1),i?(n=o=e(n),this.bindings=this.bindings.add(n)):(i=n,n=this.element,o=this.widget()),e.each(i,(function(i,s){function a(){if(t||!0!==r.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof s?r[s]:s).apply(r,arguments)}"string"!=typeof s&&(a.guid=s.guid=s.guid||a.guid||e.guid++);var l=i.match(/^([\w:-]*)\s*(.*)$/),c=l[1]+r.eventNamespace,d=l[2];d?o.on(c,d,a):n.on(c,a)}))},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(n).off(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){var n=this;return setTimeout((function(){return("string"==typeof e?n[e]:e).apply(n,arguments)}),t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,n,i){var o,r,s=this.options[t];if(i=i||{},(n=e.Event(n)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],r=n.originalEvent)for(o in r)o in n||(n[o]=r[o]);return this.element.trigger(n,i),!(e.isFunction(s)&&!1===s.apply(this.element[0],[n].concat(i))||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},(function(t,n){e.Widget.prototype["_"+t]=function(i,o,r){var s;"string"==typeof o&&(o={effect:o});var a=o?!0===o||"number"==typeof o?n:o.effect||n:t;"number"==typeof(o=o||{})&&(o={duration:o}),s=!e.isEmptyObject(o),o.complete=r,o.delay&&i.delay(o.delay),s&&e.effects&&e.effects.effect[a]?i[t](o):a!==t&&i[a]?i[a](o.duration,o.easing,r):i.queue((function(n){e(this)[t](),r&&r.call(i[0]),n()}))}}));e.widget;
vendor: 4,298 bytes, lines 15-24
15/*!
16 * jQuery UI Position 1.12.1
17 * http://jqueryui.com
18 *
19 * Copyright jQuery Foundation and other contributors
20 * Released under the MIT license.
21 * http://jquery.org/license
22 *
23 * http://api.jqueryui.com/position/
24 */!function(){var t,n=Math.max,i=Math.abs,o=/left|center|right/,r=/top|center|bottom/,s=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,l=/%$/,c=e.fn.position;function d(e,t,n){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?n/100:1)]}function h(t,n){return parseInt(e.css(t,n),10)||0}function u(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.position={scrollbarWidth:function(){if(void 0!==t)return t;var n,i,o=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=o.children()[0];return e("body").append(o),n=r.offsetWidth,o.css("overflow","scroll"),n===(i=r.offsetWidth)&&(i=o[0].clientWidth),o.remove(),t=n-i},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),o="scroll"===n||"auto"===n&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:o?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),i=e.isWindow(n[0]),o=!!n[0]&&9===n[0].nodeType;return{element:n,isWindow:i,isDocument:o,offset:!i&&!o?e(t).offset():{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var l,p,f,m,g,v,b=e(t.of),y=e.position.getWithinInfo(t.within),x=e.position.getScrollInfo(y),w=(t.collision||"flip").split(" "),_={};return v=u(b),b[0].preventDefault&&(t.at="left top"),p=v.width,f=v.height,m=v.offset,g=e.extend({},m),e.each(["my","at"],(function(){var e,n,i=(t[this]||"").split(" ");1===i.length&&(i=o.test(i[0])?i.concat(["center"]):r.test(i[0])?["center"].concat(i):["center","center"]),i[0]=o.test(i[0])?i[0]:"center",i[1]=r.test(i[1])?i[1]:"center",e=s.exec(i[0]),n=s.exec(i[1]),_[this]=[e?e[0]:0,n?n[0]:0],t[this]=[a.exec(i[0])[0],a.exec(i[1])[0]]})),1===w.length&&(w[1]=w[0]),"right"===t.at[0]?g.left+=p:"center"===t.at[0]&&(g.left+=p/2),"bottom"===t.at[1]?g.top+=f:"center"===t.at[1]&&(g.top+=f/2),l=d(_.at,p,f),g.left+=l[0],g.top+=l[1],this.each((function(){var o,r,s=e(this),a=s.outerWidth(),c=s.outerHeight(),u=h(this,"marginLeft"),v=h(this,"marginTop"),k=a+u+h(this,"marginRight")+x.width,C=c+v+h(this,"marginBottom")+x.height,S=e.extend({},g),T=d(_.my,s.outerWidth(),s.outerHeight());"right"===t.my[0]?S.left-=a:"center"===t.my[0]&&(S.left-=a/2),"bottom"===t.my[1]?S.top-=c:"center"===t.my[1]&&(S.top-=c/2),S.left+=T[0],S.top+=T[1],o={marginLeft:u,marginTop:v},e.each(["left","top"],(function(n,i){e.ui.position[w[n]]&&e.ui.position[w[n]][i](S,{targetWidth:p,targetHeight:f,elemWidth:a,elemHeight:c,collisionPosition:o,collisionWidth:k,collisionHeight:C,offset:[l[0]+T[0],l[1]+T[1]],my:t.my,at:t.at,within:y,elem:s})})),t.using&&(r=function(e){var o=m.left-S.left,r=o+p-a,l=m.top-S.top,d=l+f-c,h={target:{element:b,left:m.left,top:m.top,width:p,height:f},element:{element:s,left:S.left,top:S.top,width:a,height:c},horizontal:r<0?"left":o>0?"right":"center",vertical:d<0?"top":l>0?"bottom":"middle"};p<a&&i(o+r)<p&&(h.horizontal="center"),f<c&&i(l+d)<f&&(h.vertical="middle"),n(i(o),i(r))>n(i(l),i(d))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),s.offset(e.extend(S,{using:r}))}))},e.ui.position={fit:{left:function(e,t){var i,o=t.within,r=o.isWindow?o.scrollLeft:o.offset.left,s=o.width,a=e.left-t.collisionPosition.marginLeft,l=r-a,c=a+t.collisionWidth-s-r;t.collisionWidth>s?l>0&&c<=0?(i=e.left+l+t.collisionWidth-s-r,e.left+=l-i):e.left=c>0&&l<=0?r:l>c?r+s-t.collisionWidth:r:l>0?e.left+=l:c>0?e.left-=c:e.left=n(e.left-a,e.left)},top:function(e,t){var i,o=t.within,r=o.isWindow?o.scrollTop:o.offset.top,s=t.
24within.height,a=e.top-t.collisionPosition.marginTop,l=r-a,c=a+t.collisionHeight-s-r;t.collisionHeight>s?l>0&&c<=0?(i=e.top+l+t.collisionHeight-s-r,e.top+=l-i):e.top=c>0&&l<=0?r:l>c?r+s-t.collisionHeight:r:l>0?e.top+=l:c>0?e.top-=c:e.top=n(e.top-a,e.top)}},flip:{left:function(e,t){var n,o,r=t.within,s=r.offset.left+r.scrollLeft,a=r.width,l=r.isWindow?r.scrollLeft:r.offset.left,c=e.left-t.collisionPosition.marginLeft,d=c-l,h=c+t.collisionWidth-a-l,u="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];d<0?((n=e.left+u+p+f+t.collisionWidth-a-s)<0||n<i(d))&&(e.left+=u+p+f):h>0&&((o=e.left-t.collisionPosition.marginLeft+u+p+f-l)>0||i(o)<h)&&(e.left+=u+p+f)},top:function(e,t){var n,o,r=t.within,s=r.offset.top+r.scrollTop,a=r.height,l=r.isWindow?r.scrollTop:r.offset.top,c=e.top-t.collisionPosition.marginTop,d=c-l,h=c+t.collisionHeight-a-l,u="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,p="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,f=-2*t.offset[1];d<0?((o=e.top+u+p+f+t.collisionHeight-a-s)<0||o<i(d))&&(e.top+=u+p+f):h>0&&((n=e.top-t.collisionPosition.marginTop+u+p+f-l)>0||i(n)<h)&&(e.top+=u+p+f)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}();var o;
25/*!
26 * jQuery UI :data 1.12.1
27 * http://jqueryui.com
28 *
29 * Copyright jQuery Foundation and other contributors
30 * Released under the MIT license.
31 * http://jquery.org/license
32 */e.ui.position,e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo((function(t){return function(n){return!!e.data(n,t)}})):function(t,n,i){return!!e.data(t,i[3])}}),e.fn.extend({disableSelection:(o="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(o+".ui-disableSelection",(function(e){e.preventDefault()}))}),enableSelection:function(){return this.off(".ui-disableSelection")}});
33/*!
34 * jQuery UI Focusable 1.12.1
35 * http://jqueryui.com
36 *
37 * Copyright jQuery Foundation and other contributors
38 * Released under the MIT license.
39 * http://jquery.org/license
40 */
41e.ui.focusable=function(t,n){var i,o,r,s,a,l=t.nodeName.toLowerCase();return"area"===l?(o=(i=t.parentNode).name,!(!t.href||!o||"map"!==i.nodeName.toLowerCase())&&((r=e("img[usemap='#"+o+"']")).length>0&&r.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(l)?(s=!t.disabled)&&(a=e(t).closest("fieldset")[0])&&(s=!a.disabled):s="a"===l&&t.href||n,s&&e(t).is(":visible")&&function(e){var t=e.css("visibility");for(;"inherit"===t;)t=(e=e.parent()).css("visibility");return"hidden"!==t}(e(t)))},e.extend(e.expr[":"],{focusable:function(t){return e.ui.focusable(t,null!=e.attr(t,"tabindex"))}});e.ui.focusable,e.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):e(this[0].form)},e.ui.formResetMixin={_formResetHandler:function(){var t=e(this);setTimeout((function(){var n=t.data("ui-form-reset-instances");e.each(n,(function(){this.refresh()}))}))},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var e=this.form.data("ui-form-reset-instances")||[];e.length||this.form.on("reset.ui-form-reset",this._formResetHandler),e.push(this),this.form.data("ui-form-reset-instances",e)}},_unbindFormResetHandler:function(){if(this.form.length){var t=this.form.data("ui-form-reset-instances");t.splice(e.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}};
42/*!
43 * jQuery UI Support for jQuery core 1.7.x 1.12.1
44 * http://jqueryui.com
45 *
46 * Copyright jQuery Foundation and other contributors
47 * Released under the MIT license.
48 * http://jquery.org/license
49 *
50 */
51"1.7"===e.fn.jquery.substring(0,3)&&(e.each(["Width","Height"],(function(t,n){var i="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),r={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};function s(t,n,o,r){return e.each(i,(function(){n-=parseFloat(e.css(t,"padding"+this))||0,o&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),r&&(n-=parseFloat(e.css(t,"margin"+this))||0)})),n}e.fn["inner"+n]=function(t){return void 0===t?r["inner"+n].call(this):this.each((function(){e(this).css(o,s(this,t)+"px")}))},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?r["outer"+n].call(this,t):this.each((function(){e(this).css(o,s(this,t,!0,i)+"px")}))}})),e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))});
52/*!
vendor: 4,903 bytes, lines 53-60
53 * jQuery UI Keycode 1.12.1
54 * http://jqueryui.com
55 *
56 * Copyright jQuery Foundation and other contributors
57 * Released under the MIT license.
58 * http://jquery.org/license
59 */
60e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.ui.escapeSelector=(r=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,function(e){return e.replace(r,"\\$1")}),e.fn.labels=function(){var t,n,i,o,r;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(o=this.eq(0).parents("label"),(i=this.attr("id"))&&(r=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),n="label[for='"+e.ui.escapeSelector(i)+"']",o=o.add(r.find(n).addBack(n))),this.pushStack(o))},e.fn.scrollParent=function(t){var n=this.css("position"),i="absolute"===n,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter((function(){var t=e(this);return(!i||"static"!==t.css("position"))&&o.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))})).eq(0);return"fixed"!==n&&r.length?r:e(this[0].ownerDocument||document)},e.extend(e.expr[":"],{tabbable:function(t){var n=e.attr(t,"tabindex"),i=null!=n;return(!i||n>=0)&&e.ui.focusable(t,i)}}),e.fn.extend({uniqueId:(s=0,function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++s)}))}),removeUniqueId:function(){return this.each((function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")}))}}),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var r,s,a=!1;e(document).on("mouseup",(function(){a=!1}));e.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,(function(e){return t._mouseDown(e)})).on("click."+this.widgetName,(function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!a){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,i=1===t.which,o=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&e(t.target).closest(this.options.cancel).length;return!(i&&!o&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){n.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),a=!0,!0))}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,a=!1,t.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.ui.plugin={add:function(t,n,i){var o,r=e.ui[t].prototype;for(o in i)r.plugins[o]=r.plugins[o]||[],r.plugins[o].push([n,i[o]])},call:function(e,t,n,i){var o,r=e.plugins[t];if(r&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(o=0;o<r.length;
vendor: 6,476 bytes, lines 60-69
60o++)e.options[r[o][0]]&&r[o][1].apply(e.element,n)}},e.ui.safeActiveElement=function(e){var t;try{t=e.activeElement}catch(n){t=e.body}return t||(t=e.body),t.nodeName||(t=e.body),t},e.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&e(t).trigger("blur")};
61/*!
62 * jQuery UI Draggable 1.12.1
63 * http://jqueryui.com
64 *
65 * Copyright jQuery Foundation and other contributors
66 * Released under the MIT license.
67 * http://jquery.org/license
68 */
69e.widget("ui.draggable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var n=this.options;return!(this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===n.iframeFix?"iframe":n.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map((function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]}))},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var n=e.ui.safeActiveElement(this.document[0]);e(t.target).closest(n).length||e.ui.safeBlur(n)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter((function(){return"fixed"===e(this).css("position")})).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,n){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!n){var i=this._uiHash();if(!1===this._trigger("drag",t,i))return this._mouseUp(new e.Event("mouseup",t)),!1;this.position=i.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=this,i=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(i=e.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),(function(){!1!==n._trigger("stop",t)&&n._clear()})):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new e.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!e(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var n=this.options,i=e.isFunction(n.helper),o=i?e(n.helper.apply(this.element[0],[t])):"clone"===n.helper?this.element.clone().removeAttr("id"):this.element;return o.parents("body").length||o.appendTo("parent"===n.appendTo?this.element[0].parentNode:n.appendTo),i&&o[0]===this.element[0]&&this._setPositionRelative(),o[0]===this.element[0]||/(fixed|absolute)/.test(o.css("position"))||o.css("position","absolute"),o},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRo
vendor: 40,485 bytes, lines 69-85
69otNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,i,o=this.options,r=this.document[0];this.relativeContainer=null,o.containment?"window"!==o.containment?"document"!==o.containment?o.containment.constructor!==Array?("parent"===o.containment&&(o.containment=this.helper[0].parentNode),(i=(n=e(o.containment))[0])&&(t=/(scroll|auto)/.test(n.css("overflow")),this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=n)):this.containment=o.containment:this.containment=[0,0,e(r).width()-this.helperProportions.width-this.margins.left,(e(r).height()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.offset.scroll.top:i?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.offset.scroll.left:i?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,i,o,r,s=this.options,a=this._isRootNode(this.scrollParent[0]),l=e.pageX,c=e.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(i=this.relativeContainer.offset(),n=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):n=this.containment,e.pageX-this.offset.click.left<n[0]&&(l=n[0]+this.offset.click.left),e.pageY-this.offset.click.top<n[1]&&(c=n[1]+this.offset.click.top),e.pageX-this.offset.click.left>n[2]&&(l=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(c=n[3]+this.offset.click.top)),s.grid&&(o=s.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,c=n?o-this.offset.click.top>=n[1]||o-this.offset.click.top>n[3]?o:o-this.offset.click.top>=n[1]?o-s.grid[1]:o+s.grid[1]:o,r=s.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,l=n?r-this.offset.click.left>=n[0]||r-this.offset.click.left>n[2]?r:r-this.offset.click.left>=n[0]?r-s.grid[0]:r+s.grid[0]:r),"y"===s.axis&&(l=this.originalPageX),"x"===s.axis&&(c=this.originalPageY)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,n,i){return i=i||this._uiHash(),e.ui.plugin.call(this,t,[n,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,n,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n,i){var o=e.extend({},n,{item:i.element});i.sortables=[],e(i.options.connectToSortable).each((function(){var n=e(this).sortable("instance");n&&!n.options.disabled&&(i.sortables.push(n),n.refreshPositions(),n._trigger("activate",t,o))}))},stop:function(t,n,i){var o=e.extend({},n,{item:i.element});i.cancelHelperRemoval=!1,e.each(i.sortables,(function(){var e=this;e.isOver?(e.isOver=0,i.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,o))}))},drag:function(t,n,i){e.each(i.sortables,(function(){var o=!1,r=this;r.positionAbs=i.positionAbs,r.helperProportions=i.helperProportions,r.offset.click=i.offset.click,r._intersectsWith(r.containerCache)&&(o=!0,e.each(i.sortables,(function(){return this.positionAbs=i.positionAbs,this.helperProportions=i.helperProportions,this.offset.click=i.offset.click,this!==r&&this._intersectsWith(this.containerCache)&&e.contains(r.element[0],this.element[0])&&(o=!1),o}))),o?(r.isOver||(r.isOver=1,i._parent=n.helper.parent(),r.currentItem=n.helper.appendTo(r.element).data("ui-sortable-item",!0),r.options._helper=r.options.helper,r.options.helper=function(){return n.helper[0]},t.target=r.currentItem[0],r._mouseCapture(t,!0),r._mouseStart(t,!0,!0),r.offset.click.top=i.offset.click.top,r.offset.click.left=i.offset.click.left,r.offset.parent.left-=i.offset.parent.left-r.offset.parent.left,r.offset.parent.top-=i.offset.parent.top-r.offset.parent.top,i._trigger("toSortable",t),i.dropped=r.element,e.each(i.sortables,(function(){this.refreshPositions()})),i.currentItem=i.element,r.fromOutside=i),r.currentItem&&(r._mouseDrag(t),n.position=r.position)):r.isOver&&(r.isOver=0,r.cancelHelperRemoval=!0,r.options._revert=r.options.revert,r.options.revert=!1,r._trigger("out",t,r._uiHash(r)),r._mouseStop(t,!0),r.options.revert=r.options._revert,r.options.helper=r.options._helper,r.placeholder&&r.placeholder.remove(),n.helper.appendTo(i._parent),i._refreshOffsets(t),n.position=i._generatePosition(t,!0),i._trigger("fromSortable",t),i.dropped=!1,e.each(i.sortables,(function(){this.refreshPositions()})))}))}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n,i){var o=e("body"),r=i.options;o.css("cursor")&&(r._cursor=o.css("cursor")),o.css("cursor",r.cursor)},stop:function(t,n,i){var o=i.options;o._cursor&&e("body").css("cursor",o._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n,i){var o=e(n.helper),r=i.options;o.css("opacity")&&(r._opacity=o.css("opacity")),o.css("opacity",r.opacity)},stop:function(t,n,i){var o=i.options;o._opacity&&e(n.helper).css("opacity",o._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&"HTML"!==n.scrollParentNotHidden[0].tagName&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(t,n,i){var o=i.options,r=!1,s=i.scrollParentNotHidden[0],a=i.document[0];s!==a&&"HTML"!==s.tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+s.offsetHeight-t.pageY<o.scrollSensitivity?s.scrollTop=r=s.scrollTop+o.scrollSpeed:t.pageY-i.overflowOffset.top<o.scrollSensitivity&&(s.scrollTop=r=s.scrollTop-o.scrollSpeed)),o.axis&&"y"===o.axis||(i.overflowOffset.left+s.offsetWidth-t.pageX<o.scrollSensitivity?s.scrollLeft=r=s.scrollLeft+o.scrollSpeed:t.pageX-i.overflowOffset.left<o.scrollSensitivity&&(s.scrollLeft=r=s.scrollLeft-o.scrollSpeed))):(o.axis&&"x"===o.axis||(t.pageY-e(a).scrollTop()<o.scrollSensitivity?r=e(a).scrollTop(e(a).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(a).scrollTop())<o.scrollSensitivity&&(r=e(a).scrollTop(e(a).scrollTop()+o.scrollSpeed))),o.axis&&"y"===o.axis||(t.pageX-e(a).scrollLeft()<o.scrollSensitivity?r=e(a).scrollLeft(e(a).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(a).scrollLeft())<o.scrollSensitivity&&(r=e(a).scrollLeft(e(a).scrollLeft()+o.scrollSpeed)))),!1!==r&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n,i){var o=i.options;i.snapElements=[],e(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each((function(){var t=e(this),n=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})}))},drag:function(t,n,i){var o,r,s,a,l,c,d,h,u,p,f=i.options,m=f.snapTolerance,g=n.offset.left,v=g+i.helperProportions.width,b=n.offset.top,y=b+i.helperProportions.height;for(u=i.snapElements.length-1;u>=0;u--)c=(l=i.snapElements[u].left-i.margins.left)+i.snapElements[u].width,h=(d=i.snapElements[u].top-i.margins.top)+i.snapElements[u].height,v<l-m||g>c+m||y<d-m||b>h+m||!e.contains(i.snapElements[u].item.ownerDocument,i.snapElements[u].item)?(i.snapElements[u].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,e.extend(i._uiHash(),{snapItem:i.snapElements[u].item})),i.snapElements[u].snapping=!1):("inner"!==f.snapMode&&(o=Math.abs(d-y)<=m,r=Math.abs(h-b)<=m,s=Math.abs(l-v)<=m,a=Math.abs(c-g)<=m,o&&(n.position.top=i._convertPositionTo("relative",{top:d-i.helperProportions.height,left:0}).top),r&&(n.position.top=i._convertPositionTo("relative",{top:h,left:0}).top),s&&(n.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left),a&&(n.position.left=i._convertPositionTo("relative",{top:0,left:c}).left)),p=o||r||s||a,"outer"!==f.snapMode&&(o=Math.abs(d-b)<=m,r=Math.abs(h-y)<=m,s=Math.abs(l-g)<=m,a=Math.abs(c-v)<=m,o&&(n.position.top=i._convertPositionTo("relative",{top:d,left:0}).top),r&&(n.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top),s&&(n.position.left=i._convertPositionTo("relative",{top:0,left:l}).left),a&&(n.position.left=i._convertPositionTo("relative",{top:0,left:c-i.helperProportions.width}).left)),!i.snapElements[u].snapping&&(o||r||s||a||p)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,e.extend(i._uiHash(),{snapItem:i.snapElements[u].item})),i.snapElements[u].snapping=o||r||s||a||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,n,i){var o,r=i.options,s=e.makeArray(e(r.stack)).sort((function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)}));s.length&&(o=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each((function(t){e(this).css("zIndex",o+t)})),this.css("zIndex",o+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n,i){var o=e(n.helper),r=i.options;o.css("zIndex")&&(r._zIndex=o.css("zIndex")),o.css("zIndex",r.zIndex)},stop:function(t,n,i){var o=i.options;o._zIndex&&e(n.helper).css("zIndex",o._zIndex)}});e.ui.draggable;
70/*!
71 * jQuery UI Droppable 1.12.1
72 * http://jqueryui.com
73 *
74 * Copyright jQuery Foundation and other contributors
75 * Released under the MIT license.
76 * http://jquery.org/license
77 */e.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,n=this.options,i=n.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions=function(){if(!arguments.length)return t||(t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});t=arguments[0]},this._addToManager(n.scope),n.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;t<e.length;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,n){if("accept"===t)this.accept=e.isFunction(n)?n:function(e){return e.is(n)};else if("scope"===t){var i=e.ui.ddmanager.droppables[this.options.scope];this._splice(i),this._addToManager(n)}this._super(t,n)},_activate:function(t){var n=e.ui.ddmanager.current;this._addActiveClass(),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this._removeActiveClass(),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var i=n||e.ui.ddmanager.current,o=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each((function(){var n=e(this).droppable("instance");if(n.options.greedy&&!n.options.disabled&&n.options.scope===i.options.scope&&n.accept.call(n.element[0],i.currentItem||i.element)&&l(i,e.extend(n,{offset:n.element.offset()}),n.options.tolerance,t))return o=!0,!1})),!o&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(i)),this.element)))},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var l=e.ui.intersect=function(){function e(e,t,n){return e>=t&&e<t+n}return function(t,n,i,o){if(!n.offset)return!1;var r=(t.positionAbs||t.position.absolute).left+t.margins.left,s=(t.positionAbs||t.position.absolute).top+t.margins.top,a=r+t.helperProportions.width,l=s+t.helperProportions.height,c=n.offset.left,d=n.offset.top,h=c+n.proportions().width,u=d+n.proportions().height;switch(i){case"fit":return c<=r&&a<=h&&d<=s&&l<=u;case"intersect":return c<r+t.helperProportions.width/2&&a-t.helperProportions.width/2<h&&d<s+t.helperProportions.height/2&&l-t.helperProportions.height/2<u;case"pointer":return e(o.pageY,d,n.proportions().height)&&e(o.pageX,c,n.proportions().width);case"touch":return(s>=d&&s<=u||l>=d&&l<=u||s<d&&l>u)&&(r>=c&&r<=h||a>=c&&a<=h||r<c&&a>h);default:return!1}}}();e.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,n){var i,o,r=e.ui.ddmanager.droppables[t.options.scope]||[],s=n?n.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(i=0;i<r.length;i++)if(!(r[i].options.disabled||t&&!r[i].accept.call(r[i].element[0],t.currentItem||t.element))){for(o=0;o<a.length;o++)if(a[o]===r[i].element[0]){r[i].proportions().height=0;continue e}r[i].visible="none"!==r[i].element.css("display"),r[i].visible&&("mousedown"===s&&r[i]._activate.call(r[i],n),r[i].offset=r[i].element.offset(),r[i].proportions({width:r[i].element[0].offsetWidth,height:r[i].element[0].offsetHeight}))}},drop:function(t,n){var i=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),(function(){this.options&&(!this.options.disabled&&this.visible&&l(t,this,this.options.tolerance,n)&&(i=this._drop.call(this,n)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,n)))})),i},dragStart:function(t,n){t.element.parentsUntil("body").on("scroll.droppable",(function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}))},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],(function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var i,o,r,s=l(t,this,this.options.tolerance,n),a=!s&&this.isover?"isout":s&&!this.isover?"isover":null;a&&(this.options.greedy&&(o=this.options.scope,(r=this.element.parents(":data(ui-droppable)").filter((function(){return e(this).droppable("instance").options.scope===o}))).length&&((i=e(r[0]).droppable("instance")).greedyChild="isover"===a)),i&&"isover"===a&&(i.isover=!1,i.isout=!0,i._out.call(i,n)),this[a]=!0,this["isout"===a?"isover":"isout"]=!1,this["isover"===a?"_over":"_out"].call(this,n),i&&"isout"===a&&(i.isout=!1,i.isover=!0,i._over.call(i,n)))}}))},dragStop:function(t,n){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}},!1!==e.uiBackCompat&&e.widget("ui.droppable",e.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});e.ui.droppable;
78/*!
79 * jQuery UI Resizable 1.12.1
80 * http://jqueryui.com
81 *
82 * Copyright jQuery Foundation and other contributors
83 * Released under the MIT license.
84 * http://jquery.org/license
85 */e.widget("ui.resizable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseFloat(e)||0},_isNumber:function(e){return!isNaN(parseFloat(e))},_hasScroll:function(t,n){if("hidden"===e(t).css("overflow"))return!1;var i,o=n&&"left"===n?"scrollLeft":"scrollTop";return t[o]>0||(t[o]=1,i=t[o]>0,t[o]=0,i)},_create:function(){var t,n=this.options,i=this;this._addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),n.autoHide&&e(this.element).on("mouseenter",(function(){n.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())})).on("mouseleave",(function(){n.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,n=function(t){e(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(n(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),n(this.originalElement),this},_setOption:function(e,t){switch(this._super(e,t),e){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var t,n,i,o,r,s=this.options,a=this;if(this.handles=s.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},n=0;n<i.length;n++)o="ui-resizable-"+(t=e.trim(i[n])),r=e("<div>"),this._addClass(r,"ui-resizable-handle "+o),r.css({zIndex:s.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(r);this._renderAxis=function(t){var n,i,o,r;for(n in t=t||this.element,this.handles)this.handles[n].constructor===String?this.handles[n]=this.element.children(this.handles[n]).first().show():(this.handles[n].jquery||this.handles[n].nodeType)&&(this.handles[n]=e(this.handles[n]),this._on(this.handles[n],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=e(this.handles[n],this.element),r=/sw|ne|nw|se|n|s/.test(n)?i.outerHeight():i.outerWidth(),o=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),t.css(o,r),this._proportionallyResize()),this._handles=this._handles.add(this.handles[n])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",(function(){a.resizing||(this.className&&(r=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=r&&r[1]?r[1]:"se")})),s.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var n,i,o=!1;for(n in this.handles)((i=e(this.handles[n])[0])===t.target||e.contains(i,t.target))&&(o=!0);return!this.options.disabled&&o},_mouseStart:function(t){var n,i,o,r=this.options,s=this.element;return this.resizing=!0,this._renderProxy(),n=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),r.containment&&(n+=e(r.containment).scrollLeft()||0,i+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalPosition={left:n,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===o?this.axis+"-resize":o),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var n,i,o=this.originalMousePosition,r=this.axis,s=t.pageX-o.left||0,a=t.pageY-o.top||0,l=this._change[r];return this._updatePrevProperties(),!!l&&(n=l.apply(this,[t,s,a]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(n=this._updateRatio(n,t)),n=this._respectSize(n,t),this._updateCache(n),this._propagate("resize",t),i=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(i)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1)},_mouseStop:function(t){this.resizing=!1;var n,i,o,r,s,a,l,c=this.options,d=this;return this._helper&&(o=(i=(n=this._proportionallyResizeElements).length&&/textarea/i.test(n[0].nodeName))&&this._hasScroll(n[0],"left")?0:d.sizeDiff.height,r=i?0:d.sizeDiff.width,s={width:d.helper.width()-r,height:d.helper.height()-o},a=parseFloat(d.element.css("left"))+(d.position.left-d.originalPosition.left)||null,l=parseFloat(d.element.css("top"))+(d.position.top-d.originalPosition.top)||null,c.animate||this.element.css(e.extend(s,{top:l,left:a})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,n,i,o,r,s=this.options;r={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0},(this._aspectRatio||e)&&(t=r.minHeight*this.aspectRatio,i=r.minWidth/this.aspectRatio,n=r.maxHeight*this.aspectRatio,o=r.maxWidth/this.aspectRatio,t>r.minWidth&&(r.minWidth=t),i>r.minHeight&&(r.minHeight=i),n<r.maxWidth&&(r.maxWidth=n),o<r.maxHeight&&(r.maxHeight=o)),this._vBoundaries=r},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,i=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===i&&(e.left=t.left+(n.width-e.width),e.top=null),"nw"===i&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,i=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,o=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,r=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,s=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,c=/sw|nw|w/.test(n),d=/nw|ne|n/.test(n);return r&&(e.width=t.minWidth),s&&(e.height=t.minHeight),i&&(e.width=t.maxWidth),o&&(e.height=t.maxHeight),r&&c&&(e.left=a-t.minWidth),i&&c&&(e.left=a-t.maxWidth),s&&d&&(e.top=l-t.minHeight),o&&d&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,n=[],i=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],o=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];t<4;t++)n[t]=parseFloat(i[t])||0,n[t]+=parseFloat(o[t])||0;return{height:n[0]+n[2],width:n[1]+n[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,n=this.helper||this.element;t<this._proportionallyResizeElements.length;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:n.height()-this.outerDimensions.height||0,width:n.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var n=this.originalSize;return{left:this.originalPosition.left+t,width:n.width-t}},n:function(e,t,n){var i=this.originalSize;return{top:this.originalPosition.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,i){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,i]))},sw:function(t,n,i){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,i]))},ne:function(t,n,i){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,i]))},nw:function(t,n,i){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,i]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),"resize"!==t&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var n=e(this).resizable("instance"),i=n.options,o=n._proportionallyResizeElements,r=o.length&&/textarea/i.test(o[0].nodeName),s=r&&n._hasScroll(o[0],"left")?0:n.sizeDiff.height,a=r?0:n.sizeDiff.width,l={width:n.size.width-a,height:n.size.height-s},c=parseFloat(n.element.css("left"))+(n.position.left-n.originalPosition.left)||null,d=parseFloat(n.element.css("top"))+(n.position.top-n.originalPosition.top)||null;n.element.animate(e.extend(l,d&&c?{top:d,left:c}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var i={width:parseFloat(n.element.css("width")),height:parseFloat(n.element.css("height")),top:parseFloat(n.element.css("top")),left:parseFloat(n.element.css("left"))};o&&o.length&&e(o[0]).css({width:i.width,height:i.height}),n._updateCache(i),n._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,n,i,o,r,s,a,l=e(this).resizable("instance"),c=l.options,d=l.element,h=c.containment,u=h instanceof e?h.get(0):/parent/.test(h)?d.parent().get(0):h;u&&(l.containerElement=e(u),/document/.test(h)||h===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(u),n=[],e(["Top","Right","Left","Bottom"]).each((function(e,i){n[e]=l._num(t.css("padding"+i))})),l.containerOffset=t.offset(),l.containerPosition=t.position(),l.containerSize={height:t.innerHeight()-n[3],width:t.innerWidth()-n[1]},i=l.containerOffset,o=l.containerSize.height,r=l.containerSize.width,s=l._hasScroll(u,"left")?u.scrollWidth:r,a=l._hasScroll(u)?u.scrollHeight:o,l.parentData={element:u,left:i.left,top:i.top,width:s,height:a}))},resize:function(t){var n,i,o,r,s=e(this).resizable("instance"),a=s.options,l=s.containerOffset,c=s.position,d=s._aspectRatio||t.shiftKey,h={top:0,left:0},u=s.containerElement,p=!0;u[0]!==document&&/static/.test(u.css("position"))&&(h=l),c.left<(s._helper?l.left:0)&&(s.size.width=s.size.width+(s._helper?s.position.left-l.left:s.position.left-h.left),d&&(s.size.height=s.size.width/s.aspectRatio,p=!1),s.position.left=a.helper?l.left:0),c.top<(s._helper?l.top:0)&&(s.size.height=s.size.height+(s._helper?s.position.top-l.top:s.position.top),d&&(s.size.width=s.size.height*s.aspectRatio,p=!1),s.position.top=s._helper?l.top:0),o=s.containerElement.get(0)===s.element.parent().get(0),r=/relative|absolute/.test(s.containerElement.css("position")),o&&r?(s.offset.left=s.parentData.left+s.position.left,s.offset.top=s.parentData.top+s.position.top):(s.offset.left=s.element.offset().left,s.offset.top=s.element.offset().top),n=Math.abs(s.sizeDiff.width+(s._helper?s.offset.left-h.left:s.offset.left-l.left)),i=Math.abs(s.sizeDiff.height+(s._helper?s.offset.top-h.top:s.offset.top-l.top)),n+s.size.width>=s.parentData.width&&(s.size.width=s.parentData.width-n,d&&(s.size.height=s.size.width/s.aspectRatio,p=!1)),i+s.size.height>=s.parentData.height&&(s.size.height=s.parentData.height-i,d&&(s.size.width=s.size.height*s.aspectRatio,p=!1)),p||(s.position.left=s.prevPosition.left,s.position.top=s.prevPosition.top,s.size.width=s.prevSize.width,s.size.height=s.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),n=t.options,i=t.containerOffset,o=t.containerPosition,r=t.containerElement,s=e(t.helper),a=s.offset(),l=s.outerWidth()-t.sizeDiff.width,c=s.outerHeight()-t.sizeDiff.height;t._helper&&!n.animate&&/relative/.test(r.css("position"))&&e(this).css({left:a.left-o.left-i.left,width:l,height:c}),t._helper&&!n.animate&&/static/.test(r.css("position"))&&e(this).css({left:a.left-o.left-i.left,width:l,height:c})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance").options;e(t.alsoResize).each((function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})}))},resize:function(t,n){var i=e(this).resizable("instance"),o=i.options,r=i.originalSize,s=i.originalPosition,a={height:i.size.height-r.height||0,width:i.size.width-r.width||0,top:i.position.top-s.top||0,left:i.position.left-s.left||0};e(o.alsoResize).each((function(){var t=e(this),i=e(this).data("ui-resizable-alsoresize"),o={},r=t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,(function(e,t){var n=(i[t]||0)+(a[t]||0);n&&n>=0&&(o[t]=n||null)})),t.css(o)}))},stop:function(){e(this).removeData("ui-resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),n=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==e.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,n=e(this).resizable("instance"),i=n.options,o=n.size,r=n.originalSize,s=n.originalPosition,a=n.axis,l="number"==typeof i.grid?[i.grid,i.grid]:i.grid,c=l[0]||1,d=l[1]||1,h=Math.round((o.width-r.width)/c)*c,u=Math.round((o.height-r.height)/d)*d,p=r.width+h,f=r.height+u,m=i.maxWidth&&i.maxWidth<p,g=i.maxHeight&&i.maxHeight<f,v=i.minWidth&&i.minWidth>p,b=i.minHeight&&i.minHeight>f;i.grid=l,v&&(p+=c),b&&(f+=d),m&&(p-=c),g&&(f-=d),/^(se|s|e)$/.test(a)?(n.size.width=p,n.size.height=f):/^(ne)$/.test(a)?(n.size.width=p,n.size.height=f,n.position.top=s.top-u):/^(sw)$/.test(a)?(n.size.width=p,n.size.height=f,n.position.left=s.left-h):((f-d<=0||p-c<=0)&&(t=n._getPaddingPlusBorderDimensions(this)),f-d>0?(n.size.height=f,n.position.top=s.top-u):(f=d-t.height,n.size.height=f,n.position.top=s.top+r.height-f),p-c>0?(n.size.width=p,n.position.left=s.left-h):(p=c-t.width,n.size.width=p,n.position.left=s.left+r.width-p))}});e.ui.resizable,e.widget("ui.selectable",e.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t.elementPos=e(t.element[0]).offset(),t.selectees=e(t.options.filter,t.element[0]),t._addClass(t.selectees,"ui-selectee"),t.selectees.each((function(){var n=e(this),i=n.offset(),o={left:i.left-t.elementPos.left,top:i.top-t.elementPos.top};e.data(this,"selectable-item",{element:this,$element:n,left:o.left,top:o.top,right:o.left+n.outerWidth(),bottom:o.top+n.outerHeight(),startselected:!1,selected:n.hasClass("ui-selected"),selecting:n.hasClass("ui-selecting"),unselecting:n.hasClass("ui-unselecting")})}))},this.refresh(),this._mouseInit(),this.helper=e("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(t){var n=this,i=this.options;this.opos=[t.pageX,t.pageY],this.elementPos=e(this.element[0]).offset(),this.options.disabled||(this.selectees=e(i.filter,this.element[0]),this._trigger("start",t),e(i.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),i.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each((function(){var i=e.data(this,"selectable-item");i.startselected=!0,t.metaKey||t.ctrlKey||(n._removeClass(i.$element,"ui-selected"),i.selected=!1,n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",t,{unselecting:i.element}))})),e(t.target).parents().addBack().each((function(){var i,o=e.data(this,"selectable-item");if(o)return i=!t.metaKey&&!t.ctrlKey||!o.$element.hasClass("ui-selected"),n._removeClass(o.$element,i?"ui-unselecting":"ui-selected")._addClass(o.$element,i?"ui-selecting":"ui-unselecting"),o.unselecting=!i,o.selecting=i,o.selected=i,i?n._trigger("selecting",t,{selecting:o.element}):n._trigger("unselecting",t,{unselecting:o.element}),!1})))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var n,i=this,o=this.options,r=this.opos[0],s=this.opos[1],a=t.pageX,l=t.pageY;return r>a&&(n=a,a=r,r=n),s>l&&(n=l,l=s,s=n),this.helper.css({left:r,top:s,width:a-r,height:l-s}),this.selectees.each((function(){var n=e.data(this,"selectable-item"),c=!1,d={};n&&n.element!==i.element[0]&&(d.left=n.left+i.elementPos.left,d.right=n.right+i.elementPos.left,d.top=n.top+i.elementPos.top,d.bottom=n.bottom+i.elementPos.top,"touch"===o.tolerance?c=!(d.left>a||d.right<r||d.top>l||d.bottom<s):"fit"===o.tolerance&&(c=d.left>r&&d.right<a&&d.top>s&&d.bottom<l),c?(n.selected&&(i._removeClass(n.$element,"ui-selected"),n.selected=!1),n.unselecting&&(i._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1),n.selecting||(i._addClass(n.$element,"ui-selecting"),n.selecting=!0,i._trigger("selecting",t,{selecting:n.element}))):(n.selecting&&((t.metaKey||t.ctrlKey)&&n.startselected?(i._removeClass(n.$element,"ui-selecting"),n.selecting=!1,i._addClass(n.$element,"ui-selected"),n.selected=!0):(i._removeClass(n.$element,"ui-selecting"),n.selecting=!1,n.startselected&&(i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0),i._trigger("unselecting",t,{unselecting:n.element}))),n.selected&&(t.metaKey||t.ctrlKey||n.startselected||(i._removeClass(n.$element,"ui-selected"),n.selected=!1,i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",t,{unselecting:n.element})))))}
vendor: 7,117 bytes, line 85
85)),!1}},_mouseStop:function(t){var n=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each((function(){var i=e.data(this,"selectable-item");n._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1,i.startselected=!1,n._trigger("unselected",t,{unselected:i.element})})),e(".ui-selecting",this.element[0]).each((function(){var i=e.data(this,"selectable-item");n._removeClass(i.$element,"ui-selecting")._addClass(i.$element,"ui-selected"),i.selecting=!1,i.selected=!0,i.startselected=!0,n._trigger("selected",t,{selected:i.element})})),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,n){return e>=t&&e<t+n},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),e.each(this.items,(function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")}))},_destroy:function(){this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,n){var i=null,o=!1,r=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),e(t.target).parents().each((function(){if(e.data(this,r.widgetName+"-item")===r)return i=e(this),!1})),e.data(t.target,r.widgetName+"-item")===r&&(i=e(t.target)),!!i&&(!(this.options.handle&&!n&&(e(this.options.handle,i).find("*").addBack().each((function(){this===t.target&&(o=!0)})),!o))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,n,i){var o,r,s=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),s.containment&&this._setContainment(),s.cursor&&"auto"!==s.cursor&&(r=this.document.find("body"),this.storedCursor=r.css("cursor"),r.css("cursor",s.cursor),this.storedStylesheet=e("<style>*{ cursor: "+s.cursor+" !important; }</style>").appendTo(r)),s.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",s.opacity)),s.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",s.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(o=this.containers.length-1;o>=0;o--)this.containers[o]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var n,i,o,r,s=this.options,a=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-this.overflowOffset.top<s.scrollSensitivity&&(this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-s.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-this.overflowOffset.left<s.scrollSensitivity&&(this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-s.scrollSpeed)):(t.pageY-this.document.scrollTop()<s.scrollSensitivity?a=this.document.scrollTop(this.document.scrollTop()-s.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<s.scrollSensitivity&&(a=this.document.scrollTop(this.document.scrollTop()+s.scrollSpeed)),t.pageX-this.document.scrollLeft()<s.scrollSensitivity?a=this.document.scrollLeft(this.document.scrollLeft()-s.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<s.scrollSensitivity&&(a=this.document.scrollLeft(this.document.scrollLeft()+s.scrollSpeed))),!1!==a&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),n=this.items.length-1;n>=0;n--)if(o=(i=this.items[n]).item[0],(r=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(o===this.currentItem[0]||this.placeholder[1===r?"next":"prev"]()[0]===o||e.contains(this.placeholder[0],o)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],o))){if(this.direction=1===r?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var i=this,o=this.placeholder.offset(),r=this.options.axis,s={};
vendor: 4,183 bytes, line 85
85r&&"x"!==r||(s.left=o.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),r&&"y"!==r||(s.top=o.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(s,parseInt(this.options.revert,10)||500,(function(){i._clear(t)}))}else this._clear(t,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new e.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e(n).each((function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&i.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))})),!i.length&&t.key&&i.push(t.key+"="),i.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},n.each((function(){i.push(e(t.item||this).attr(t.attribute||"id")||"")})),i},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,i=this.positionAbs.top,o=i+this.helperProportions.height,r=e.left,s=r+e.width,a=e.top,l=a+e.height,c=this.offset.click.top,d=this.offset.click.left,h="x"===this.options.axis||i+c>a&&i+c<l,u="y"===this.options.axis||t+d>r&&t+d<s,p=h&&u;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:r<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<s&&a<i+this.helperProportions.height/2&&o-this.helperProportions.height/2<l},_intersectsWithPointer:function(e){var t,n,i="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),o="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width);return!(!i||!o)&&(t=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection(),this.floating?"right"===n||"down"===t?2:1:t&&("down"===t?2:1))},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),i=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&n||"left"===o&&!n:i&&("down"===i&&t||"up"===i&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(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(t){var n,i,o,r,s=[],a=[],l=this._connectWith();if(l&&t)for(n=l.length-1;n>=0;n--)for(i=(o=e(l[n],this.document[0])).length-1;i>=0;i--)(r=e.data(o[i],this.widgetFullName))&&r!==this&&!r.options.disabled&&a.push([e.isFunction(r.options.items)?r.options.items.call(r.element):e(r.options.items,r.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),r]);function c(){s.push(this)}
vendor: 2,931 bytes, line 85
85for(a.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=a.length-1;n>=0;n--)a[n][0].each(c);return e(s)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,(function(e){for(var n=0;n<t.length;n++)if(t[n]===e.item[0])return!1;return!0}))},_refreshItems:function(t){this.items=[],this.containers=[this];var n,i,o,r,s,a,l,c,d=this.items,h=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(n=u.length-1;n>=0;n--)for(i=(o=e(u[n],this.document[0])).length-1;i>=0;i--)(r=e.data(o[i],this.widgetFullName))&&r!==this&&!r.options.disabled&&(h.push([e.isFunction(r.options.items)?r.options.items.call(r.element[0],t,{item:this.currentItem}):e(r.options.items,r.element),r]),this.containers.push(r));for(n=h.length-1;n>=0;n--)for(s=h[n][1],i=0,c=(a=h[n][0]).length;i<c;i++)(l=e(a[i])).data(this.widgetName+"-item",s),d.push({item:l,instance:s,width:0,height:0,left:0,top:0})},refreshPositions:function(t){var n,i,o,r;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),n=this.items.length-1;n>=0;n--)(i=this.items[n]).instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(o=this.options.toleranceElement?e(this.options.toleranceElement,i.item):i.item,t||(i.width=o.outerWidth(),i.height=o.outerHeight()),r=o.offset(),i.left=r.left,i.top=r.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)r=this.containers[n].element.offset(),this.containers[n].containerCache.left=r.left,this.containers[n].containerCache.top=r.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(t){var n,i=(t=t||this).options;i.placeholder&&i.placeholder.constructor!==String||(n=i.placeholder,i.placeholder={element:function(){var i=t.currentItem[0].nodeName.toLowerCase(),o=e("<"+i+">",t.document[0]);return t._addClass(o,"ui-sortable-placeholder",n||t.currentItem[0].className)._removeClass(o,"ui-sortable-helper"),"tbody"===i?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(o)):"tr"===i?t._createTrPlaceholder(t.currentItem,o):"img"===i&&o.attr("src",t.currentItem.attr("src")),n||o.css("visibility","hidden"),o},update:function(e,o){n&&!i.forcePlaceholderSize||(o.height()||o.height(t.currentItem.innerHe
vendor: 12,747 bytes, lines 85-93
85ight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(i.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),i.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,n){var i=this;t.children().each((function(){e("<td>&#160;</td>",i.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}))},_contactContainers:function(t){var n,i,o,r,s,a,l,c,d,h,u=null,p=null;for(n=this.containers.length-1;n>=0;n--)if(!e.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(u&&e.contains(this.containers[n].element[0],u.element[0]))continue;u=this.containers[n],p=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0);if(u)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(o=1e4,r=null,s=(d=u.floating||this._isFloating(this.currentItem))?"left":"top",a=d?"width":"height",h=d?"pageX":"pageY",i=this.items.length-1;i>=0;i--)e.contains(this.containers[p].element[0],this.items[i].item[0])&&this.items[i].item[0]!==this.currentItem[0]&&(l=this.items[i].item.offset()[s],c=!1,t[h]-l>this.items[i][a]/2&&(c=!0),Math.abs(t[h]-l)<o&&(o=Math.abs(t[h]-l),r=this.items[i],this.direction=c?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return void(this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1));r?this._rearrange(t,r,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var n=this.options,i=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;return i.parents("body").length||e("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0]),i[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),i[0].style.width&&!n.forceHelperSize||i.width(this.currentItem.width()),i[0].style.height&&!n.forceHelperSize||i.height(this.currentItem.height()),i},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,i,o=this.options;"parent"===o.containment&&(o.containment=this.helper[0].parentNode),"document"!==o.containment&&"window"!==o.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===o.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===o.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(o.containment)||(t=e(o.containment)[0],n=e(o.containment).offset(),i="hidden"!==e(t).css("overflow"),this.containment=[n.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,n.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,n){n||(n=this.position);var i="absolute"===t?1:-1,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(o[0].tagName);return{top:n.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop())*i,left:n.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())*i}},_generatePosition:function(t){var n,i,o=this.options,r=t.pageX,s=t.pageY,a="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(a[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(r=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(r=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),o.grid&&(n=this.originalPageY+Math.round((s-this.originalPageY)/o.grid[1])*o.grid[1],s=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-o.grid[1]:n+o.grid[1]:n,i=this.originalPageX+Math.round((r-this.originalPageX)/o.grid[0])*o.grid[0],r=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-o.grid[0]:i+o.grid[0]:i)),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(e,t,n,i){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay((function(){o===this.counter&&this.refreshPositions(!i)}))},_clear:function(e,t){this.reverting=!1;var n,i=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)"auto"!==this._storedCSS[n]&&"static"!==this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(e,t,n){return function(i){n._trigger(e,i,t._uiHash(t))}}for(this.fromOutside&&!t&&i.push((function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))})),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||i.push((function(e){this._trigger("update",e,this._uiHash())})),this!==this.currentContainer&&(t||(i.push((function(e){this._trigger("remove",e,this._uiHash())})),i.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)t||i.push(o("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(i.push(o("out",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||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),!t){for(n=0;n<i.length;n++)i[n].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===e.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}});
86/*!
87 * jQuery UI Selectable 1.12.1
88 * http://jqueryui.com
89 *
90 * Copyright jQuery Foundation and other contributors
91 * Released under the MIT license.
92 * http://jquery.org/license
93 */var c=/ui-corner-([a-z]){2,6}/g;e.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var t=this,n=[];e.each(this.options.items,(function(i,o){var r,s={};if(o)return"controlgroupLabel"===i?((r=t.element.find(o)).each((function(){var t=e(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")})),t._addClass(r,null,"ui-widget ui-widget-content ui-state-default"),void(n=n.concat(r.get()))):void(e.fn[i]&&(s=t["_"+i+"Options"]?t["_"+i+"Options"]("middle"):{classes:{}},t.element.find(o).each((function(){var o=e(this),r=o[i]("instance"),a=e.widget.extend({},s);if("button"!==i||!o.parent(".ui-spinner").length){r||(r=o[i]()[i]("instance")),r&&(a.classes=t._resolveClassesValues(a.classes,r)),o[i](a);var l=o[i]("widget");e.data(l[0],"ui-controlgroup-data",r||o[i]("instance")),n.push(l[0])}}))))}
vendor: 4,332 bytes, lines 93-102
93)),this.childWidgets=e(e.unique(n)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(t){this.childWidgets.each((function(){var n=e(this).data("ui-controlgroup-data");n&&n[t]&&n[t]()}))},_updateCornerClass:function(e,t){var n=this._buildSimpleOptions(t,"label").classes.label;this._removeClass(e,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(e,null,n)},_buildSimpleOptions:function(e,t){var n="vertical"===this.options.direction,i={classes:{}};return i.classes[t]={middle:"",first:"ui-corner-"+(n?"top":"left"),last:"ui-corner-"+(n?"bottom":"right"),only:"ui-corner-all"}[e],i},_spinnerOptions:function(e){var t=this._buildSimpleOptions(e,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(e){return this._buildSimpleOptions(e,"ui-button")},_checkboxradioOptions:function(e){return this._buildSimpleOptions(e,"ui-checkboxradio-label")},_selectmenuOptions:function(e){var t="vertical"===this.options.direction;return{width:!!t&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(t?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(t?"top":"left")},last:{"ui-selectmenu-button-open":t?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(t?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[e]}},_resolveClassesValues:function(t,n){var i={};return e.each(t,(function(o){var r=n.options.classes[o]||"";r=e.trim(r.replace(c,"")),i[o]=(r+" "+t[o]).replace(/\s+/g," ")})),i},_setOption:function(e,t){"direction"===e&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(e,t),"disabled"!==e?this.refresh():this._callChildMethod(t?"disable":"enable")},refresh:function(){var t,n=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),t=this.childWidgets,this.options.onlyVisible&&(t=t.filter(":visible")),t.length&&(e.each(["first","last"],(function(e,i){var o=t[i]().data("ui-controlgroup-data");if(o&&n["_"+o.widgetName+"Options"]){var r=n["_"+o.widgetName+"Options"](1===t.length?"only":i);r.classes=n._resolveClassesValues(r.classes,o),o.element[o.widgetName](r)}else n._updateCornerClass(t[i](),i)})),this._callChildMethod("refresh"))}});
94/*!
95 * jQuery UI Checkboxradio 1.12.1
96 * http://jqueryui.com
97 *
98 * Copyright jQuery Foundation and other contributors
99 * Released under the MIT license.
100 * http://jquery.org/license
101 */
102e.widget("ui.checkboxradio",[e.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,n,i=this,o=this._super()||{};return this._readType(),n=this.element.labels(),this.label=e(n[n.length-1]),this.label.length||e.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each((function(){i.originalLabel+=3===this.nodeType?e(this).text():this.outerHTML})),this.originalLabel&&(o.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(o.disabled=t),o},_create:function(){var e=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),e&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();
vendor: 1,432 bytes, line 102
102this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||e.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,n="input[name='"+e.ui.escapeSelector(t)+"']";return t?(this.form.length?e(this.form[0].elements).filter(n):e(n).filter((function(){return 0===e(this).form().length}))).not(this.element):e([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each((function(){var t=e(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")}))},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(e,t){if("label"!==e||t){if(this._super(e,t),"disabled"===e)return this._toggleClass(this.label,null,"ui-state-disabled",t),void(this.element[0].disabled=t);this.refresh()}},_updateIcon:function(t){var n="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=e("<span>"),this.iconSpace=e("<span> </span>
vendor: 3,083 bytes, lines 102-110
102"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(n+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):n+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",n),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var e=this.label.contents().not(this.element[0]);this.icon&&(e=e.not(this.icon[0])),this.iconSpace&&(e=e.not(this.iconSpace[0])),e.remove(),this.label.append(this.options.label)},refresh:function(){var e=this.element[0].checked,t=this.element[0].disabled;this._updateIcon(e),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),null!==this.options.label&&this._updateLabel(),t!==this.options.disabled&&this._setOptions({disabled:t})}}]);e.ui.checkboxradio;
103/*!
104 * jQuery UI Button 1.12.1
105 * http://jqueryui.com
106 *
107 * Copyright jQuery Foundation and other contributors
108 * Released under the MIT license.
109 * http://jquery.org/license
110 */e.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var e,t=this._super()||{};return this.isInput=this.element.is("input"),null!=(e=this.element[0].disabled)&&(t.disabled=e),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(t.label=this.originalLabel),t},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===e.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,n){var i="iconPosition"!==t,o=i?this.options.iconPosition:n,r="top"===o||"bottom"===o;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=e("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,n),this._attachIcon(o),r?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconS
vendor: 9,278 bytes, lines 110-118
110pace||(this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(o))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(e){this.icon[/^(?:end|bottom)/.test(e)?"before":"after"](this.iconSpace)},_attachIcon:function(e){this.element[/^(?:end|bottom)/.test(e)?"append":"prepend"](this.icon)},_setOptions:function(e){var t=void 0===e.showLabel?this.options.showLabel:e.showLabel,n=void 0===e.icon?this.options.icon:e.icon;t||n||(e.showLabel=!0),this._super(e)},_setOption:function(e,t){"icon"===e&&(t?this._updateIcon(e,t):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===e&&this._updateIcon(e,t),"showLabel"===e&&(this._toggleClass("ui-button-icon-only",null,!t),this._updateTooltip()),"label"===e&&(this.isInput?this.element.val(t):(this.element.html(t),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(e,t),"disabled"===e&&(this._toggleClass(null,"ui-state-disabled",t),this.element[0].disabled=t,t&&this.element.blur())},refresh:function(){var e=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOptions({disabled:e}),this._updateTooltip()}}),!1!==e.uiBackCompat&&(e.widget("ui.button",e.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(e,t){"text"!==e?("showLabel"===e&&(this.options.text=t),"icon"===e&&(this.options.icons.primary=t),"icons"===e&&(t.primary?(this._super("icon",t.primary),this._super("iconPosition","beginning")):t.secondary&&(this._super("icon",t.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",t)}}),e.fn.button=function(t){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?t.apply(this,arguments):(e.ui.checkboxradio||e.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(e.fn.button),e.fn.buttonset=function(){return e.ui.controlgroup||e.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});e.ui.button;
111/*!
112 * jQuery UI Dialog 1.12.1
113 * http://jqueryui.com
114 *
115 * Copyright jQuery Foundation and other contributors
116 * Released under the MIT license.
117 * http://jquery.org/license
118 */e.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(e=t.parent.children().eq(t.index)).length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var n=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||e.ui.safeBlur(e.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,(function(){n._trigger("close",t)})))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,n){var i=!1,o=this.uiDialog.siblings(".ui-front:visible").map((function(){return+e(this).css("z-index")})).get(),r=Math.max.apply(null,o);return r>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",r+1),i=!0),i&&!n&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=e(e.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,(function(){t._focusTabbable(),t._trigger("focus")})),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).trigger("focus")},_keepFocus:function(t){function n(){var t=e.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||e.contains(this.uiDialog[0],t)||this._focusTabbable()}t.preventDefault(),n.call(this),this._delay(n)},_createWrapper:function(){this.uiDialog=e("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var n=this.uiDialog.find(":tabbable"),i=n.filter(":first"),o=n.filter(":last");t.target!==o[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay((function(){o.trigger("focus")})),t.preventDefault()):(this._delay((function(){i.trigger("focus")})),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:e("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prepe
vendor: 23,584 bytes, lines 118-135
118ndTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title?e.text(this.options.title):e.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var t=this,n=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(n)||e.isArray(n)&&!n.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(e.each(n,(function(n,i){var o,r;i=e.isFunction(i)?{click:i,text:n}:i,i=e.extend({type:"button"},i),o=i.click,r={icon:i.icon,iconPosition:i.iconPosition,showLabel:i.showLabel,icons:i.icons,text:i.text},delete i.click,delete i.icon,delete i.iconPosition,delete i.showLabel,delete i.icons,"boolean"==typeof i.text&&delete i.text,e("<button></button>",i).button(r).appendTo(t.uiButtonSet).on("click",(function(){o.apply(t.element[0],arguments)}))})),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var t=this,n=this.options;function i(e){return{position:e.position,offset:e.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,o){t._addClass(e(this),"ui-dialog-dragging"),t._blockFrames(),t._trigger("dragStart",n,i(o))},drag:function(e,n){t._trigger("drag",e,i(n))},stop:function(o,r){var s=r.offset.left-t.document.scrollLeft(),a=r.offset.top-t.document.scrollTop();n.position={my:"left top",at:"left"+(s>=0?"+":"")+s+" top"+(a>=0?"+":"")+a,of:t.window},t._removeClass(e(this),"ui-dialog-dragging"),t._unblockFrames(),t._trigger("dragStop",o,i(r))}})},_makeResizable:function(){var t=this,n=this.options,i=n.resizable,o=this.uiDialog.css("position"),r="string"==typeof i?i:"n,e,s,w,se,sw,ne,nw";function s(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:r,start:function(n,i){t._addClass(e(this),"ui-dialog-resizing"),t._blockFrames(),t._trigger("resizeStart",n,s(i))},resize:function(e,n){t._trigger("resize",e,s(n))},stop:function(i,o){var r=t.uiDialog.offset(),a=r.left-t.document.scrollLeft(),l=r.top-t.document.scrollTop();n.height=t.uiDialog.height(),n.width=t.uiDialog.width(),n.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" top"+(l>=0?"+":"")+l,of:t.window},t._removeClass(e(this),"ui-dialog-resizing"),t._unblockFrames(),t._trigger("resizeStop",i,s(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),n=e.inArray(this,t);-1!==n&&t.splice(n,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var n=this,i=!1,o={};e.each(t,(function(e,t){n._setOption(e,t),e in n.sizeRelatedOptions&&(i=!0),e in n.resizableRelatedOptions&&(o[e]=t)})),i&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,n){var i,o,r=this.uiDialog;"disabled"!==t&&(this._super(t,n),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:e("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=r.is(":data(ui-draggable)"))&&!n&&r.draggable("destroy"),!i&&n&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((o=r.is(":data(ui-resizable)"))&&!n&&r.resizable("destroy"),o&&"string"==typeof n&&r.resizable("option","handles",n),o||!1===n||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,n,i=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),i.minWidth>i.width&&(i.width=i.minWidth),e=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),t=Math.max(0,i.minHeight-e),n="number"==typeof i.maxHeight?Math.max(0,i.maxHeight-e):"none","auto"===i.height?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,i.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map((function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]}))},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!e(t.target).closest(".ui-dialog").length||!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay((function(){t=!1})),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!1!==e.uiBackCompat&&e.widget("ui.dialog",e.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(e,t){"dialogClass"===e&&this.uiDialog.removeClass(this.options.dialogClass).addClass(t),this._superApply(arguments)}});var d;
119/*!
120 * jQuery UI Slider 1.12.1
121 * http://jqueryui.com
122 *
123 * Copyright jQuery Foundation and other contributors
124 * Released under the MIT license.
125 * http://jquery.org/license
126 */e.ui.dialog,e.widget("ui.slider",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,n,i=this.options,o=this.element.find(".ui-slider-handle"),r=[];for(n=i.values&&i.values.length||1,o.length>n&&(o.slice(n).remove(),o=o.slice(0,n)),t=o.length;t<n;t++)r.push("<span tabindex='0'></span>");this.handles=o.add(e(r.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each((function(t){e(this).data("ui-slider-handle-index",t).attr("tabIndex",0)}))},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=e("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var n,i,o,r,s,a,l,c=this,d=this.options;return!d.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(n),o=this._valueMax()-this._valueMin()+1,this.handles.each((function(t){var n=Math.abs(i-c.values(t));(o>n||o===n&&(t===c._lastChangedValue||c.values(t)===d.min))&&(o=n,r=e(this),s=t)})),!1!==this._start(t,s)&&(this._mouseSliding=!0,this._handleIndex=s,this._addClass(r,null,"ui-state-active"),r.trigger("focus"),a=r.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-a.left-r.width()/2,top:t.pageY-a.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,s,i),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,i,o,r;return"horizontal"===this.orientation?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),(i=n/t)>1&&(i=1),i<0&&(i=0),"vertical"===this.orientation&&(i=1-i),o=this._valueMax()-this._valueMin(),r=this._valueMin()+i*o,this._trimAlignValue(r)},_uiHash:function(e,t,n){var i={handle:this.handles[e],handleIndex:e,value:void 0!==t?t:this.value()};return this._hasMultipleValues()&&(i.value=void 0!==t?t:this.values(e),i.values=n||this.values()),i},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(e,t){return this._trigger("start",e,this._uiHash(t))},_slide:function(e,t,n){var i,o=this.value(),r=this.values();this._hasMultipleValues()&&(i=this.values(t?0:1),o=this.values(t),2===this.options.values.length&&!0===this.options.range&&(n=0===t?Math.min(i,n):Math.max(i,n)),r[t]=n),n!==o&&!1!==this._trigger("slide",e,this._uiHash(t,n,r))&&(this._hasMultipleValues()?this.values(t,n):this.value(n))},_stop:function(e,t){this._trigger("stop",e,this._uiHash(t))},_change:function(e,t){this._keySliding||this._mouseSliding||(this._lastChangedValue=t,this._trigger("change",e,this._uiHash(t)))},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),void this._change(null,0)):this._value()},values:function(t,n){var i,o,r;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,o=arguments[0],r=0;r<i.length;r+=1)i[r]=this._trimAlignValue(o[r]),this._change(null,r);this._refreshValue()},_setOption:function(t,n){var i,o=0;switch("range"===t&&!0===this.options.range&&("min"===n?(this.options.value=this._values(0),this.options.values=null):"max"===n&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(o=this.options.values.length),this._super(t,n),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(n),this.handles.css("horizontal"===n?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=o-1;i>=0;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(e){this._super(e),this._toggleClass(null,"ui-state-disabled",!!e)},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,n,i;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(n=this.options.values.slice(),i=0;i<n.length;i+=1)n[i]=this._trimAlignValue(n[i]);return n}return[]},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,i=e-n;return 2*Math.abs(n)>=t&&(i+=n>0?t:-t),parseFloat(i.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),n=this.options.step;(e=Math.round((e-t)/n)*n+t)>this.options.max&&(e-=n),this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return-1===n?0:t.length-n-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(e){"vertical"===e&&this.range.css({width:"",left:""}),"horizontal"===e&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var t,n,i,o,r,s=this.options.range,a=this.options,l=this,c=!this._animateOff&&a.animate,d={};this._hasMultipleValues()?this.handles.each((function(i){n=(l.values(i)-l._valueMin())/(l._valueMax()-l._valueMin())*100,d["horizontal"===l.orientation?"left":"bottom"]=n+"%",e(this).stop(1,1)[c?"animate":"css"](d,a.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===i&&l.range.stop(1,1)[c?"animate":"css"]({left:n+"%"},a.animate),1===i&&l.range[c?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:a.animate})):(0===i&&l.range.stop(1,1)[c?"animate":"css"]({bottom:n+"%"},a.animate),1===i&&l.range[c?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:a.animate}))),t=n})):(i=this.value(),o=this._valueMin(),r=this._valueMax(),n=r!==o?(i-o)/(r-o)*100:0,d["horizontal"===this.orientation?"left":"bottom"]=n+"%",this.handle.stop(1,1)[c?"animate":"css"](d,a.animate),"min"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({width:n+"%"},a.animate),"max"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({width:100-n+"%"},a.animate),"min"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({height:n+"%"},a.animate),"max"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({height:100-n+"%"},a.animate))},_handleEvents:{keydown:function(t){var n,i,o,r=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(e(t.target),null,"ui-state-active"),!1===this._start(t,r)))return}switch(o=this.options.step,n=i=this._hasMultipleValues()?this.values(r):this.value(),t.keyCode){case e.ui.keyCode.HOME:i=this._valueMin();break;case e.ui.keyCode.END:i=this._valueMax();break;case e.ui.keyCode.PAGE_UP:i=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(n===this._valueMax())return;i=this._trimAlignValue(n+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(n===this._valueMin())return;i=this._trimAlignValue(n-o)}this._slide(t,r,i)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),this._removeClass(e(t.target),null,"ui-state-active"))}}});
127/*!
128 * jQuery UI Tabs 1.12.1
129 * http://jqueryui.com
130 *
131 * Copyright jQuery Foundation and other contributors
132 * Released under the MIT license.
133 * http://jquery.org/license
134 */
135e.widget("ui.tabs",{version:"1.12.1",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:(d=/#.*$/,function(e){var t,n;t=e.href.replace(d,""),n=location.href.replace(d,"");try{t=decodeURIComponent(t)}catch(e){}try{n=decodeURIComponent(n)}catch(e){}return e.hash.length>1&&t===n}),_create:function(){var t=this,n=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,n.collapsible),this._processTabs(),n.active=this._initialActive(),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),(function(e){return t.tabs.index(e)})))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(n.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_initialActive:function(){var t=this.options.active,n=this.options.collapsible,i=location.hash.substring(1);return null===t&&(i&&this.tabs.each((function(n,o){if(e(o).attr("aria-controls")===i)return t=n,!1})),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==t&&-1!==t||(t=!!this.tabs.length&&0)),!1!==t&&-1===(t=this.tabs.index(this.tabs.eq(t)))&&(t=!n&&0),!n&&!1===t&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(e.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(n),o=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:i++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:o=!1,i--;break;case e.ui.keyCode.END:i=this.anchors.length-1;break;case e.ui.keyCode.HOME:i=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,o),t.ctrlKey||t.metaKey||(n.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay((function(){this.option("active",i)}),this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,n){var i=this.tabs.length-1;for(;-1!==e.inArray((t>i&&(t=0),t<0&&(t=i),t),this.options.disabled);)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).trigger("focus"),e},_setOption:function(e,t){"active"!==e?(this._super(e,t),"collapsible"===e&&(this._toggleClass("ui-tabs-collapsible",null,t),t||!1!==this.options.active||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t)):this._activate(t)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),(function(e){return n.index(e)})),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),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 t=this,n=this.tabs,i=this.anchors,o=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(t){e(this).is(".ui-state-disabled")&&t.preventDefault()})).on("focus"+this.eventNamespace,".ui-tabs-anchor",(function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()})),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 e("a",this)[0]})).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=e(),this.anchors.each((function(n,i){var o,r,s,a=e(i).uniqueId().attr("id"),l=e(i).closest("li"),c=l.attr("aria-controls");t._isLocal(i)?(s=(o=i.hash).substring(1),r=t.element.find(t._sanitizeSelector(o))):(o="#"+(s=l.attr("aria-controls")||e({}).uniqueId()[0].id),(r=t.element.find(o)).length||(r=t._createPanel(s)).insertAfter(t.panels[n-1]||t.tablist),r.attr("aria-live","polite")),r.length&&(t.panels=t.panels.add(r)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":s,"aria-labelledby":a}),r.attr("aria-labelledby",a)})),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),n&&(this._off(n.not(this.tabs)
135),this._off(i.not(this.anchors)),this._off(o.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var n,i,o;for(e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),o=0;i=this.tabs[o];o++)n=e(i),!0===t||-1!==e.inArray(o,t)?(n.attr("aria-disabled","true"),this._addClass(n,null,"ui-state-disabled")):(n.removeAttr("aria-disabled"),this._removeClass(n,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var n={};t&&e.each(t.split(" "),(function(e,t){n[t]="_eventHandler"})),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,i=this.element.parent();"fill"===t?(n=i.height(),n-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each((function(){var t=e(this),i=t.css("position");"absolute"!==i&&"fixed"!==i&&(n-=t.outerHeight(!0))})),this.element.children().not(this.panels).each((function(){n-=e(this).outerHeight(!0)})),this.panels.each((function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))})).css("overflow","auto")):"auto"===t&&(n=0,this.panels.each((function(){n=Math.max(n,e(this).height("").height())})).height(n))},_eventHandler:function(t){var n=this.options,i=this.active,o=e(t.currentTarget).closest("li"),r=o[0]===i[0],s=r&&n.collapsible,a=s?e():this._getPanelForTab(o),l=i.length?this._getPanelForTab(i):e(),c={oldTab:i,oldPanel:l,newTab:s?e():o,newPanel:a};t.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||r&&!n.collapsible||!1===this._trigger("beforeActivate",t,c)||(n.active=!s&&this.tabs.index(o),this.active=r?e():o,this.xhr&&this.xhr.abort(),l.length||a.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(o),t),this._toggle(t,c))},_toggle:function(t,n){var i=this,o=n.newPanel,r=n.oldPanel;function s(){i.running=!1,i._trigger("activate",t,n)}function a(){i._addClass(n.newTab.closest("li"),"ui-tabs-active","ui-state-active"),o.length&&i.options.show?i._show(o,i.options.show,s):(o.show(),s())}this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,(function(){i._removeClass(n.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()})):(this._removeClass(n.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),a()),r.attr("aria-hidden","true"),n.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?n.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter((function(){return 0===e(this).attr("tabIndex")})).attr("tabIndex",-1),o.attr("aria-hidden","false"),n.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var n,i=this._findActive(t);i[0]!==this.active[0]&&(i.length||(i=this.active),n=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop}))},_findActive:function(t){return!1===t?e():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+e.ui.escapeSelector(t)+"']"))),t},_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(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")})),this.tabs.each((function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")})),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var n=this.options.disabled;!1!==n&&(void 0===t?n=!1:(t=this._getIndex(t),n=e.isArray(n)?e.map(n,(function(e){return e!==t?e:null})):e.map(this.tabs,(function(e,n){return n!==t?n:null}))),this._setOptionDisabled(n))},disable:function(t){var n=this.options.disabled;if(!0!==n){if(void 0===t)n=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,n))return;n=e.isArray(n)?e.merge([t],n).sort():[t]}this._setOptionDisabled(n)}},load:function(t,n){t=this._getIndex(t);var i=this,o=this.tabs.eq(t),r=o.find(".ui-tabs-anchor"),s=this._getPanelForTab(o),a={tab:o,panel:s},l=function(e,t){"abort"===t&&i.panels.stop(!1,!0),i._removeClass(o,"ui-tabs-loading"),s.removeAttr("aria-busy"),e===i.xhr&&delete i.xhr};this._isLocal(r[0])||(this.xhr=e.ajax(this._ajaxSettings(r,n,a)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(o,"ui-tabs-loading"),s.attr("aria-busy","true"),this.xhr.done((function(e,t,o){setTimeout((function(){s.html(e),i._trigger("load",n,a),l(o,t)}),1)})).fail((function(e,t){setTimeout((function(){l(e,t)}),1)}))))},_ajaxSettings:function(t,n,i){var o=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,r){return o._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:r},i))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),!1!==e.uiBackCompat&&e.widget("ui.tabs",e.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});e.ui.tabs})),function(e){"use strict";var t=function(e,n){var i=/[^\w\-\.:]/.test(e)?new Function(t.arg+",tmpl","var _e=tmpl.encode"+t.helper+",_s='"+e.replace(t.regexp,t.func)+"';return _s;"):t.cache[e]=t.cache[e]||t(t.load(e));return n?i(n,t):function(e){return i(e,t)}};t.cache={},t.load=function(e){return document.getElementById(e).innerHTML},t.regexp=/([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,t.func=function(e,t,n,i,o,r){return t?{"\n":"\\n","\r":"\\r","\t":"\\t"," ":" "}[t]||"\\"+t:n?"="===n?"'+_e("+i+")+'":"'+("+i+"==null?'':"+i+")+'":o?"';":r?"_s+='":void 0},t.encReg=/[<>&"'\x00]/g,t.encMap={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#39;"},t.encode=function(e){return(null==e?"":""+e).replace(t.encReg,(function(e){return t.encMap[e]||""}))},t.arg="o",t.helper=",print=function(s,e){_s+=e?(s==null?'':s):_e(s);},include=function(s,d){_s+=tmpl(s,d);}","function"==typeof define&&define.amd?define((function(){return t})):e.tmpl=t}(this),function(e){"use strict";var t=function(e,n,i){var o,r,s=document.createElement("img");if(s.onerror=n,s.onload=function(){!r||i&&i.noRevoke||t.revokeObjectURL(r),n&&n(t.scale(s,i))},t.isInstanceOf("Blob",e)||t.isInstanceOf("File",e))o=r=t.createObjectURL(e),s._type=e.type;else{if("string"!=typeof e)return!1;o=e,i&&i.crossOrigin&&(s.crossOrigin=i.crossOrigin)}return o?(s.src=o,s):t.readFile(e,(function(e){var t=e.target;t&&t.result?s.src=t.result:n&&n(e)}))},n=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;t.isInstanceOf=function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},t.transformCoordinates=function(){},t.getTransformedOptions=function(e,t){var n,i,o,r,s=t.aspectRatio;if(!s)return t;for(i in n={},t)t.hasOwnProperty(i)&&(n[i]=t[i]);
135return n.crop=!0,(o=e.naturalWidth||e.width)/(r=e.naturalHeight||e.height)>s?(n.maxWidth=r*s,n.maxHeight=r):(n.maxWidth=o,n.maxHeight=o/s),n},t.renderImageToCanvas=function(e,t,n,i,o,r,s,a,l,c){return e.getContext("2d").drawImage(t,n,i,o,r,s,a,l,c),e},t.hasCanvasOption=function(e){return e.canvas||e.crop||e.aspectRatio},t.scale=function(e,n){n=n||{};var i,o,r,s,a,l,c,d,h,u=document.createElement("canvas"),p=e.getContext||t.hasCanvasOption(n)&&u.getContext,f=e.naturalWidth||e.width,m=e.naturalHeight||e.height,g=f,v=m,b=function(){var e=Math.max((r||g)/g,(s||v)/v);e>1&&(g*=e,v*=e)},y=function(){var e=Math.min((i||g)/g,(o||v)/v);1>e&&(g*=e,v*=e)};return p&&(c=(n=t.getTransformedOptions(e,n)).left||0,d=n.top||0,n.sourceWidth?(a=n.sourceWidth,void 0!==n.right&&void 0===n.left&&(c=f-a-n.right)):a=f-c-(n.right||0),n.sourceHeight?(l=n.sourceHeight,void 0!==n.bottom&&void 0===n.top&&(d=m-l-n.bottom)):l=m-d-(n.bottom||0),g=a,v=l),i=n.maxWidth,o=n.maxHeight,r=n.minWidth,s=n.minHeight,p&&i&&o&&n.crop?(g=i,v=o,0>(h=a/l-i/o)?(l=o*a/i,void 0===n.top&&void 0===n.bottom&&(d=(m-l)/2)):h>0&&(a=i*l/o,void 0===n.left&&void 0===n.right&&(c=(f-a)/2))):((n.contain||n.cover)&&(r=i=i||r,s=o=o||s),n.cover?(y(),b()):(b(),y())),p?(u.width=g,u.height=v,t.transformCoordinates(u,n),t.renderImageToCanvas(u,e,c,d,a,l,0,0,g,v)):(e.width=g,e.height=v,e)},t.createObjectURL=function(e){return!!n&&n.createObjectURL(e)},t.revokeObjectURL=function(e){return!!n&&n.revokeObjectURL(e)},t.readFile=function(e,t,n){if(window.FileReader){var i=new FileReader;if(i.onload=i.onerror=t,i[n=n||"readAsDataURL"])return i[n](e),i}return!1},"function"==typeof define&&define.amd?define((function(){return t})):e.loadImage=t}(window),function(e){"use strict";"function"==typeof define&&define.amd?define(["load-image"],e):e(window.loadImage)}((function(e){"use strict";if(window.navigator&&window.navigator.platform&&/iP(hone|od|ad)/.test(window.navigator.platform)){var t=e.renderImageToCanvas;e.detectSubsampling=function(e){var t,n;return e.width*e.height>1048576&&((t=document.createElement("canvas")).width=t.height=1,(n=t.getContext("2d")).drawImage(e,1-e.width,0),0===n.getImageData(0,0,1,1).data[3])},e.detectVerticalSquash=function(e,t){var n,i,o,r,s=e.naturalHeight||e.height,a=document.createElement("canvas"),l=a.getContext("2d");for(t&&(s/=2),a.width=1,a.height=s,l.drawImage(e,0,0),n=l.getImageData(0,0,1,s).data,i=0,o=s,r=s;r>i;)0===n[4*(r-1)+3]?o=r:i=r,r=o+i>>1;return r/s||1},e.renderImageToCanvas=function(n,i,o,r,s,a,l,c,d,h){if("image/jpeg"===i._type){var u,p,f,m,g=n.getContext("2d"),v=document.createElement("canvas"),b=1024,y=v.getContext("2d");if(v.width=b,v.height=b,g.save(),(u=e.detectSubsampling(i))&&(o/=2,r/=2,s/=2,a/=2),p=e.detectVerticalSquash(i,u),u||1!==p){for(r*=p,d=Math.ceil(b*d/s),h=Math.ceil(b*h/a/p),c=0,m=0;a>m;){for(l=0,f=0;s>f;)y.clearRect(0,0,b,b),y.drawImage(i,o,r,s,a,-f,-m,s,a),g.drawImage(v,0,0,b,b,l,c,d,h),f+=b,l+=d;m+=b,c+=h}return g.restore(),n}}return t(n,i,o,r,s,a,l,c,d,h)}}})),function(e){"use strict";"function"==typeof define&&define.amd?define(["load-image"],e):e(window.loadImage)}((function(e){"use strict";var t=e.hasCanvasOption,n=e.transformCoordinates,i=e.getTransformedOptions;e.hasCanvasOption=function(n){return t.call(e,n)||n.orientation},e.transformCoordinates=function(t,i){n.call(e,t,i);var o=t.getContext("2d"),r=t.width,s=t.height,a=i.orientation;if(a&&!(a>8))switch(a>4&&(t.width=s,t.height=r),a){case 2:o.translate(r,0),o.scale(-1,1);break;case 3:o.translate(r,s),o.rotate(Math.PI);break;case 4:o.translate(0,s),o.scale(1,-1);break;case 5:o.rotate(.5*Math.PI),o.scale(1,-1);break;case 6:o.rotate(.5*Math.PI),o.translate(0,-s);break;case 7:o.rotate(.5*Math.PI),o.translate(r,-s),o.scale(-1,1);break;case 8:o.rotate(-.5*Math.PI),o.translate(-r,0)}},e.getTransformedOptions=function(t,n){var o,r,s=i.call(e,t,n),a=s.orientation;if(!a||a>8||1===a)return s;for(r in o={},s)s.hasOwnProperty(r)&&(o[r]=s[r]);switch(s.orientation){case 2:o.left=s.right,o.right=s.left;break;case 3:o.left=s.right,o.top=s.bottom,o.right=s.left,o.bottom=s.top;break;case 4:o.top=s.bottom,o.bottom=s.top;break;case 5:o.left=s.top,o.top=s.left,o.right=s.bottom,o.bottom=s.right;break;case 6:o.left=s.top,o.top=s.right,o.right=s.bottom,o.bottom=s.left;break;case 7:o.left=s.bottom,o.top=s.right,o.right=s.top,o.bottom=s.left;break;case 8:o.left=s.bottom,o.top=s.left,o.right=s.top,o.bottom=s.right}return s.orientation>4&&(o.maxWidth=s.maxHeight,o.maxHeight=s.maxWidth,o.minWidth=s.minHeight,o.minHeight=s.minWidth,o.sourceWidth=s.sourceHeight,o.sourceHeight=s.sourceWidth),o}}
135)),function(e){"use strict";"function"==typeof define&&define.amd?define(["load-image"],e):e(window.loadImage)}((function(e){"use strict";var t=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);e.blobSlice=t&&function(){var e=this.slice||this.webkitSlice||this.mozSlice;return e.apply(this,arguments)},e.metaDataParsers={jpeg:{65505:[]}},e.parseMetaData=function(t,n,i){var o=this,r=(i=i||{}).maxMetaDataSize||262144,s={};(!(window.DataView&&t&&t.size>=12&&"image/jpeg"===t.type&&e.blobSlice)||!e.readFile(e.blobSlice.call(t,0,r),(function(t){if(t.target.error)return console.log(t.target.error),void n(s);var r,a,l,c,d=t.target.result,h=new DataView(d),u=2,p=h.byteLength-4,f=u;if(65496===h.getUint16(0)){for(;p>u&&((r=h.getUint16(u))>=65504&&65519>=r||65534===r);){if(u+(a=h.getUint16(u+2)+2)>h.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(l=e.metaDataParsers.jpeg[r])for(c=0;c<l.length;c+=1)l[c].call(o,h,u,a,s,i);f=u+=a}!i.disableImageHead&&f>6&&(s.imageHead=d.slice?d.slice(0,f):new Uint8Array(d).subarray(0,f))}else console.log("Invalid JPEG file: Missing JPEG marker.");n(s)}),"readAsArrayBuffer"))&&n(s)}})),function(e){"use strict";"function"==typeof define&&define.amd?define(["load-image","load-image-meta"],e):e(window.loadImage)}((function(e){"use strict";e.ExifMap=function(){return this},e.ExifMap.prototype.map={Orientation:274},e.ExifMap.prototype.get=function(e){return this[e]||this[this.map[e]]},e.getExifThumbnail=function(e,t,n){var i,o,r;if(n&&!(t+n>e.byteLength)){for(i=[],o=0;n>o;o+=1)r=e.getUint8(t+o),i.push((16>r?"0":"")+r.toString(16));return"data:image/jpeg,%"+i.join("%")}console.log("Invalid Exif data: Invalid thumbnail data.")},e.exifTagTypes={1:{getValue:function(e,t){return e.getUint8(t)},size:1},2:{getValue:function(e,t){return String.fromCharCode(e.getUint8(t))},size:1,ascii:!0},3:{getValue:function(e,t,n){return e.getUint16(t,n)},size:2},4:{getValue:function(e,t,n){return e.getUint32(t,n)},size:4},5:{getValue:function(e,t,n){return e.getUint32(t,n)/e.getUint32(t+4,n)},size:8},9:{getValue:function(e,t,n){return e.getInt32(t,n)},size:4},10:{getValue:function(e,t,n){return e.getInt32(t,n)/e.getInt32(t+4,n)},size:8}},e.exifTagTypes[7]=e.exifTagTypes[1],e.getExifValue=function(t,n,i,o,r,s){var a,l,c,d,h,u,p=e.exifTagTypes[o];if(p){if(!((l=(a=p.size*r)>4?n+t.getUint32(i+8,s):i+8)+a>t.byteLength)){if(1===r)return p.getValue(t,l,s);for(c=[],d=0;r>d;d+=1)c[d]=p.getValue(t,l+d*p.size,s);if(p.ascii){for(h="",d=0;d<c.length&&"\0"!==(u=c[d]);d+=1)h+=u;return h}return c}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")},e.parseExifTag=function(t,n,i,o,r){var s=t.getUint16(i,o);r.exif[s]=e.getExifValue(t,n,i,t.getUint16(i+2,o),t.getUint32(i+4,o),o)},e.parseExifTags=function(e,t,n,i,o){var r,s,a;if(n+6>e.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(!((s=n+2+12*(r=e.getUint16(n,i)))+4>e.byteLength)){for(a=0;r>a;a+=1)this.parseExifTag(e,t,n+2+12*a,i,o);return e.getUint32(s,i)}console.log("Invalid Exif data: Invalid directory size.")}},e.parseExifData=function(t,n,i,o,r){if(!r.disableExif){var s,a,l,c=n+10;if(1165519206===t.getUint32(n+4)){if(c+8>t.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==t.getUint16(n+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(t.getUint16(c)){case 18761:s=!0;break;case 19789:s=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==t.getUint16(c+2,s))return void console.log("Invalid Exif data: Missing TIFF marker.");a=t.getUint32(c+4,s),o.exif=new e.ExifMap,(a=e.parseExifTags(t,c,c+a,s,o))&&!r.disableExifThumbnail&&(l={exif:{}},a=e.parseExifTags(t,c,c+a,s,l),l.exif[513]&&(o.exif.Thumbnail=e.getExifThumbnail(t,c+l.exif[513],l.exif[514]))),o.exif[34665]&&!r.disableExifSub&&e.parseExifTags(t,c,c+o.exif[34665],s,o),o.exif[34853]&&!r.disableExifGps&&e.parseExifTags(t,c,c+o.exif[34853],s,o)}}},e.metaDataParsers.jpeg[65505].push(e.parseExifData)})),function(e){"use strict";"function"==typeof define&&define.amd?define(["load-image","load-image-exif"],e):e(window.loadImage)}((function(e){"use strict";e.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",3
13506:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"E
135xposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},e.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}
135,Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},e.ExifMap.prototype.getText=function(e){var t=this.get(e);switch(e){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[e][t];case"ExifVersion":case"FlashpixVersion":return String.fromCharCode(t[0],t[1],t[2],t[3]);case"ComponentsConfiguration":return this.stringValues[e][t[0]]+this.stringValues[e][t[1]]+this.stringValues[e][t[2]]+this.stringValues[e][t[3]];case"GPSVersionID":return t[0]+"."+t[1]+"."+t[2]+"."+t[3]}return String(t)},function(e){var t,n=e.tags,i=e.map;for(t in n)n.hasOwnProperty(t)&&(i[n[t]]=t)}(e.ExifMap.prototype),e.ExifMap.prototype.getAll=function(){var e,t,n={};for(e in this)this.hasOwnProperty(e)&&((t=this.tags[e])&&(n[t]=this.getText(t)));return n}})),function(e){"use strict";var t=e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype,n=e.Blob&&function(){try{return Boolean(new Blob)}catch(e){return!1}}(),i=n&&e.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(e){return!1}}(),o=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||e.MSBlobBuilder,r=(n||o)&&e.atob&&e.ArrayBuffer&&e.Uint8Array&&function(e){var t,r,s,a,l,c;for(t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):decodeURIComponent(e.split(",")[1]),r=new ArrayBuffer(t.length),s=new Uint8Array(r),a=0;a<t.length;a+=1)s[a]=t.charCodeAt(a);return l=e.split(",")[0].split(":")[1].split(";")[0],n?new Blob([i?s:r],{type:l}):((c=new o).append(r),c.getBlob(l))};e.HTMLCanvasElement&&!t.toBlob&&(t.mozGetAsFile?t.toBlob=function(e,n,i){e(i&&t.toDataURL&&r?r(this.toDataURL(n,i)):this.mozGetAsFile("blob",n))}:t.toDataURL&&r&&(t.toBlob=function(e,t,n){e(r(this.toDataURL(t,n)))})),"function"==typeof define&&define.amd?define((function(){return r})):e.dataURLtoBlob=r}(window),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=0;e.ajaxTransport("iframe",(function(n){if(n.async){var i,o,r,s=n.initialIframeSrc||"javascript:false;";return{send:function(a,l){(i=e('<form style="display:none;"></form>')).attr("accept-charset",n.formAcceptCharset),r=/\?/.test(n.url)?"&":"?","DELETE"===n.type?(n.url=n.url+r+"_method=DELETE",n.type="POST"):"PUT"===n.type?(n.url=n.url+r+"_method=PUT",n.type="POST"):"PATCH"===n.type&&(n.url=n.url+r+"_method=PATCH",n.type="POST"),o=e('<iframe src="'+s+'" name="iframe-transport-'+(t+=1)+'"></iframe>').bind("load",(function(){var t,r=e.isArray(n.paramName)?n.paramName:[n.paramName];o.unbind("load").bind("load",(function(){var t;try{if(!(t=o.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('<iframe src="'+s+'"></iframe>').appendTo(i),window.setTimeout((function(){i.remove()}),0)})),i.prop("target",o.prop("name")).prop("action",n.url).prop("method",n.type),n.formData&&e.each(n.formData,(function(t,n){e('<input type="hidden"/>').prop("name",n.name).val(n.value).appendTo(i)})),n.fileInput&&n.fileInput.length&&"POST"===n.type&&(t=n.fileInput.clone(),n.fileInput.after((function(e){return t[e]})),n.paramName&&n.fileInput.each((function(t){e(this).prop("name",r[t]||n.paramName)})),i.append(n.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),n.fileInput.removeAttr("form")),i.submit(),t&&t.length&&n.fileInput.each((function(n,i){var o=e(t[n]);e(i).prop("name",o.prop("name")).attr("form",o.attr("form")),o.replaceWith(i)}))})),i.append(o).appendTo(document.body)},abort:function(){o&&o.unbind("load").prop("src",s),i&&i.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&e.parseJSON(e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var n=t&&t[0];return n&&e.isXMLDoc(n)?n:e.parseXML(n.XMLDocument&&n.XMLDocument.xml||e(n.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery.ui.widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}((function(e){"use strict";function t(t){var n="dragover"===t;return function(i){i.dataTransfer=i.originalEvent&&i.originalEvent.dataTransfer;var o=i.dataTransfer;o&&-1!==e.inArray("Files",o.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:i}))&&(i.preventDefault(),n&&(o.dropEffect="copy"))}}e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('<input type="file">').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,n){return t=this.messages[t]||t.toString(),n&&e.each(n,(function(e,n){t=t.replace("{"+e+"}",n)})),t},formData:function(e){return e.serializeArray()},add:function(t,n){if(t.isDefaultPrevented())return!1;(n.autoUpload||!1!==n.autoUpload&&e(this).fileupload("option","autoUpload"))&&n.process().done((function(){n.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){var e=this.slice||this.webkitSlice||this.mozSlice;return e.apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,n){var i=e-this.timestamp;return(!this.bitrate||!n||i>n)&&(this.bitrate=(t-this.loaded)*(1e3/i)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var n;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(n=[],e.each(t.formData,(function(e,t){n.push({name:e,value:t})})),n):[]},_getTotal:function(t){var n=0;return e.each(t,(function(e,t){n+=t.size||1})),n},_initProgressObject:function(t){var n={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,n):t._progress=n},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)e._response.hasOwnProperty(t)&&delete e._response[t];else e._response={}},_onProgress:function(t,n){if(t.lengthComputable){var i,o=Date.now?Date.now():(new Date).getTime();if(n._time&&n.progressInterval&&o-n._time<n.progressInterval&&t.loaded!==t.total)return;n._time=o,i=Math.floor(t.loaded/t.total*(n.chunkSize||n._progress.total))+(n.uploadedBytes||0),this._progress.loaded+=i-n._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(o,this._progress.loaded,n.bitrateInterval),n._progress.loaded=n.loaded=i,n._progress.bitrate=n.bitrate=n._bitrateTimer.getBitrate(o,i,n.bitrateInterval),this._trigger("progress",e.Event("progress",{delegatedEvent:t}),n),this._trigger("progressall",e.Event("progressall",{delegatedEvent:t}),this._progress)}},_initProgressListener:function(t){var n=this,i=t.xhr?t.xhr():e.ajaxSettings.xhr();i.upload&&(e(i.upload).bind("progress",(function(e){var i=e.originalEvent;e.lengthComputable=i.lengthComputable,e.loaded=i.loaded,e.total=i.total,n._onProgress(e,t)})),t.xhr=function(){return i})},_isInstanceOf:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},_initXHRData:function(t){var n,i=this,o=t.files[0],r=t.multipart||!e.support.xhrFileUpload,s="array"===e.type(t.paramName)?t.paramName[0]:t.paramName;t.headers=e.extend({},t.headers),t.contentRange&&(t.headers["Content-Range"]=t.contentRange),r&&!t.blob&&this._isInstanceOf("File",o)||(t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(o.name)+'"'),r?e.support.xhrFormDataFileUpload&&(t.postMessage?(n=this._getFormData(t),t.blob?n.push({name:s,value:t.blob}):e.each(t.files,(function(i,o){n.push({name:"array"===e.type(t.paramName)&&t.paramName[i]||s,value:o})}))):(i._isInstanceOf("FormData",t.formData)?n=t.formData:(n=new FormData,e.each(this._getFormData(t),(function(e,t){n.append(t.name,t.value)}))),t.blob?n.append(s,t.blob,o.name):e.each(t.files,(function(o,r){(i._isInstanceOf("File",r)||i._isInstanceOf("Blob",r))&&n.append("array"===e.type(t.paramName)&&t.paramName[o]||s,r,r.uploadName||r.name)}
135))),t.data=n):(t.contentType=o.type||"application/octet-stream",t.data=t.blob||o),t.blob=null},_initIframeSettings:function(t){var n=e("<a></a>").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&n&&n!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var n=e(t.fileInput),i=t.paramName;return i?e.isArray(i)||(i=[i]):(i=[],n.each((function(){for(var t=e(this),n=t.prop("name")||"files[]",o=(t.prop("files")||[1]).length;o;)i.push(n),o-=1})),i.length||(i=[n.prop("name")||"files[]"])),i},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var n=e.extend({},this.options,t);return this._initFormSettings(n),this._initDataSettings(n),n},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,n,i){var o=e.Deferred(),r=o.promise();return n=n||this.options.context||r,!0===t?o.resolveWith(n,i):!1===t&&o.rejectWith(n,i),r.abort=o.promise,this._enhancePromise(r)},_addConvenienceMethods:function(t,n){var i=this,o=function(t){return e.Deferred().resolveWith(i,t).promise()};n.process=function(t,r){return(t||r)&&(n._processQueue=this._processQueue=(this._processQueue||o([this])).pipe((function(){return n.errorThrown?e.Deferred().rejectWith(i,[n]).promise():o(arguments)})).pipe(t,r)),this._processQueue||o([this])},n.submit=function(){return"pending"!==this.state()&&(n.jqXHR=this.jqXHR=!1!==i._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&i._onSend(t,this)),this.jqXHR||i._getXHRPromise()},n.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",i._trigger("fail",null,this),i._getXHRPromise(!1))},n.state=function(){return this.jqXHR?i._getDeferredState(this.jqXHR):this._processQueue?i._getDeferredState(this._processQueue):void 0},n.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===i._getDeferredState(this._processQueue)},n.progress=function(){return this._progress},n.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),n=t&&t.split("-"),i=n&&n.length>1&&parseInt(n[1],10);return i&&i+1},_chunkedUpload:function(t,n){t.uploadedBytes=t.uploadedBytes||0;var i,o,r=this,s=t.files[0],a=s.size,l=t.uploadedBytes,c=t.maxChunkSize||a,d=this._blobSlice,h=e.Deferred(),u=h.promise();return!(!(this._isXHRUpload(t)&&d&&(l||c<a))||t.data)&&(!!n||(l>=a?(s.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",s.error])):(o=function(){var n=e.extend({},t),u=n._progress.loaded;n.blob=d.call(s,l,l+c,s.type),n.chunkSize=n.blob.size,n.contentRange="bytes "+l+"-"+(l+n.chunkSize-1)+"/"+a,r._initXHRData(n),r._initProgressListener(n),i=(!1!==r._trigger("chunksend",null,n)&&e.ajax(n)||r._getXHRPromise(!1,n.context)).done((function(i,s,c){l=r._getUploadedBytes(c)||l+n.chunkSize,u+n.chunkSize-n._progress.loaded&&r._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-n.uploadedBytes,total:l-n.uploadedBytes}),n),t.uploadedBytes=n.uploadedBytes=l,n.result=i,n.textStatus=s,n.jqXHR=c,r._trigger("chunkdone",null,n),r._trigger("chunkalways",null,n),l<a?o():h.resolveWith(n.context,[i,s,c])})).fail((function(e,t,i){n.jqXHR=e,n.textStatus=t,n.errorThrown=i,r._trigger("chunkfail",null,n),r._trigger("chunkalways",null,n),h.rejectWith(n.context,[e,t,i])}))},this._enhancePromise(u),u.abort=function(){return i.abort()},o(),u)))},_beforeSend:function(e,t){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0),this._initResponseObject(t),this._initProgressObject(t),t._progress.loaded=t.loaded=t.uploadedBytes||0,t._progress.total=t.total=this._getTotal(t.files)||1,t._progress.bitrate=t.bitrate=0,this._active+=1,this._progress.loaded+=t.loaded,this._progress.total+=t.total},_onDone:function(t,n,i,o){var r=o._progress.total,s=o._response;o._progress.loaded<r&&this._onProgress(e.Event("progress",{lengthComputable:!0,loaded:r,total:r}),o),s.result=o.result=t,s.textStatus=o.textStatus=n,s.jqXHR=o.jqXHR=i,this._trigger("done",null,o)},_onFail:function(e,t,n,i){var o=i._response;i.recalculateProgress&&(this._progress.loaded-=i._progress.loaded,this._progress.total-=i._progress.total),o.jqXHR=i.jqXHR=e,o.textStatus=i.textStatus=t,o.errorThrown=i.errorThrown=n,this._trigger("fail",null,i)},_onAlways:function(e,t,n,i){this._trigger("always",null,i)},_onSend:function(t,n){n.submit||this._addConvenienceMethods(t,n);var i,o,r,s,a=this,l=a._getAJAXSettings(n),c=function(){return a._sending+=1,l._bitrateTimer=new a._BitrateTimer,i=i||((o||!1===a._trigger("send",e.Event("send",{delegatedEvent:t}),l))&&a._getXHRPromise(!1,l.context,o)||a._chunkedUpload(l)||e.ajax(l)).done((function(e,t,n){a._onDone(e,t,n,l)})).fail((function(e,t,n){a._onFail(e,t,n,l)})).always((function(e,t,n){if(a._onAlways(e,t,n,l),a._sending-=1,a._active-=1,l.limitConcurrentUploads&&l.limitConcurrentUploads>a._sending)for(var i=a._slots.shift();i;){if("pending"===a._getDeferredState(i)){i.resolve();break}i=a._slots.shift()}0===a._active&&a._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(r=e.Deferred(),this._slots.push(r),s=r.pipe(c)):(this._sequence=this._sequence.pipe(c,c),s=this._sequence),s.abort=function(){return o=[void 0,"abort","abort"],i?i.abort():(r&&r.rejectWith(l.context,o),c())},this._enhancePromise(s)):c()},_onAdd:function(t,n){var i,o,r,s,a=this,l=!0,c=e.extend({},this.options,n),d=n.files,h=d.length,u=c.limitMultiFileUploads,p=c.limitMultiFileUploadSize,f=c.limitMultiFileUploadSizeOverhead,m=0,g=this._getParamName(c),v=0;if(!h)return!1;if(p&&void 0===d[0].size&&(p=void 0),(c.singleFileUploads||u||p)&&this._isXHRUpload(c))if(c.singleFileUploads||p||!u)if(!c.singleFileUploads&&p)for(r=[],i=[],s=0;s<h;s+=1)m+=d[s].size+f,(s+1===h||m+d[s+1].size+f>p||u&&s+1-v>=u)&&(r.push(d.slice(v,s+1)),(o=g.slice(v,s+1)).length||(o=g),i.push(o),v=s+1,m=0);else i=g;else for(r=[],i=[],s=0;s<h;s+=u)r.push(d.slice(s,s+u)),(o=g.slice(s,s+u)).length||(o=g),i.push(o);else r=[d],i=[g];return n.originalFiles=d,e.each(r||d,(function(o,s){var c=e.extend({},n);return c.files=r?s:[s],c.paramName=i[o],a._initResponseObject(c),a._initProgressObject(c),a._addConvenienceMethods(t,c),l=a._trigger("add",e.Event("add",{delegatedEvent:t}),c)})),l},_replaceFileInput:function(t){var n=t.fileInput,i=n.clone(!0),o=n.is(document.activeElement);t.fileInputClone=i,e("<form></form>").append(i)[0].reset(),n.after(i).detach(),o&&i.focus(),e.cleanData(n.unbind("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===n[0]?i[0]:t})),n[0]===this.element[0]&&(this.element=i)},_handleFileTreeEntry:function(t,n){var i,o=this,r=e.Deferred(),s=function(e){e&&!e.entry&&(e.entry=t),r.resolve([e])},a=function(){i.readEntries((function(e){e.length?(l=l.concat(e),a()):function(e){o._handleFileTreeEntries(e,n+t.name+"/").done((function(e){r.resolve(e)})).fail(s)}(l)}),s)},l=[];return n=n||"",t.isFile?t._file?(t._file.relativePath=n,r.resolve(t._file)):t.file((function(e){e.relativePath=n,r.resolve(e)}),s):t.isDirectory?(i=t.createReader(),a()):r.resolve([]),r.promise()},_handleFileTreeEntries:function(t,n){var i=this;return e.when.apply(e,e.map(t,(function(e){return i._handleFileTreeEntry(e,n)}))).pipe((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var n=(t=t||{}).items;return n&&n.length&&(n[0].webkitGetAsEntry||n[0].getAsEntry)?this._handleFileTreeEntries(e.map(n,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var n,i,o=(t=e(t)).prop("webkitEntries")||t.prop("entr
135ies");if(o&&o.length)return this._handleFileTreeEntries(o);if((n=e.makeArray(t.prop("files"))).length)void 0===n[0].name&&n[0].fileName&&e.each(n,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(i=t.prop("value")))return e.Deferred().resolve([]).promise();n=[{name:i.replace(/^.*\\/,"")}]}return e.Deferred().resolve(n).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).pipe((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var n=this,i={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(i.fileInput).always((function(o){i.files=o,n.options.replaceFileInput&&n._replaceFileInput(i),!1!==n._trigger("change",e.Event("change",{delegatedEvent:t}),i)&&n._onAdd(t,i)}))},_onPaste:function(t){var n=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,i={files:[]};n&&n.length&&(e.each(n,(function(e,t){var n=t.getAsFile&&t.getAsFile();n&&i.files.push(n)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),i)&&this._onAdd(t,i))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var n=this,i=t.dataTransfer,o={};i&&i.files&&i.files.length&&(t.preventDefault(),this._getDroppedFiles(i).always((function(i){o.files=i,!1!==n._trigger("drop",e.Event("drop",{delegatedEvent:t}),o)&&n._onAdd(t,o)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_setOption:function(t,n){var i=-1!==e.inArray(t,this._specialOptions);i&&this._destroyEventHandlers(),this._super(t,n),i&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),n=t.pop();return t.shift(),new RegExp(t.join("/"),n)},_isRegExpOption:function(t,n){return"url"!==t&&"string"===e.type(n)&&/^\/.*\/[igm]{0,3}$/.test(n)},_initDataAttributes:function(){var t=this,n=this.options,i=this.element.data();e.each(this.element[0].attributes,(function(e,o){var r,s=o.name.toLowerCase();/^data-/.test(s)&&(s=s.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),r=i[s],t._isRegExpOption(s,r)&&(r=t._getRegExp(r)),n[s]=r)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var n=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,n._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var n,i,o=this,r=e.Deferred(),s=r.promise();return s.abort=function(){return i=!0,n?n.abort():(r.reject(null,"abort","abort"),s)},this._getFileInputFiles(t.fileInput).always((function(e){i||(e.length?(t.files=e,(n=o._onSend(null,t)).then((function(e,t,n){r.resolve(e,t,n)}),(function(e,t,n){r.reject(e,t,n)}))):r.reject())})),this._enhancePromise(s)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=e.blueimp.fileupload.prototype.options.add;e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{processQueue:[],add:function(n,i){var o=e(this);i.process((function(){return o.fileupload("process",i)})),t.call(this,n,i)}},processActions:{},_processFile:function(t,n){var i=this,o=e.Deferred().resolveWith(i,[t]).promise();return this._trigger("process",null,t),e.each(t.processQueue,(function(t,r){var s=function(t){return n.errorThrown?e.Deferred().rejectWith(i,[n]).promise():i.processActions[r.action].call(i,t,r)};o=o.pipe(s,r.always&&s)})),o.done((function(){i._trigger("processdone",null,t),i._trigger("processalways",null,t)})).fail((function(){i._trigger("processfail",null,t),i._trigger("processalways",null,t)})),o},_transformProcessQueue:function(t){var n=[];e.each(t.processQueue,(function(){var i={},o=this.action,r=!0===this.prefix?o:this.prefix;e.each(this,(function(n,o){"string"===e.type(o)&&"@"===o.charAt(0)?i[n]=t[o.slice(1)||(r?r+n.charAt(0).toUpperCase()+n.slice(1):n)]:i[n]=o})),n.push(i)})),t.processQueue=n},processing:function(){return this._processing},process:function(t){var n=this,i=e.extend({},this.options,t);return i.processQueue&&i.processQueue.length&&(this._transformProcessQueue(i),0===this._processing&&this._trigger("processstart"),e.each(t.files,(function(o){var r=o?e.extend({},i):i,s=function(){return t.errorThrown?e.Deferred().rejectWith(n,[t]).promise():n._processFile(r,t)};r.index=o,n._processing+=1,n._processingQueue=n._processingQueue.pipe(s,s).always((function(){n._processing-=1,0===n._processing&&n._trigger("processstop")}))}
135))),this._processingQueue},_create:function(){this._super(),this._processing=0,this._processingQueue=e.Deferred().resolveWith(this).promise()}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","load-image","load-image-meta","load-image-exif","load-image-ios","canvas-to-blob","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery"),require("load-image")):e(window.jQuery,window.loadImage)}((function(e,t){"use strict";e.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadImageMetaData",disableImageHead:"@",disableExif:"@",disableExifThumbnail:"@",disableExifSub:"@",disableExifGps:"@",disabled:"@disableImageMetaDataLoad"},{action:"loadImage",prefix:!0,fileTypes:"@",maxFileSize:"@",noRevoke:"@",disabled:"@disableImageLoad"},{action:"resizeImage",prefix:"image",maxWidth:"@",maxHeight:"@",minWidth:"@",minHeight:"@",crop:"@",orientation:"@",forceResize:"@",disabled:"@disableImageResize"},{action:"saveImage",quality:"@imageQuality",type:"@imageType",disabled:"@disableImageResize"},{action:"saveImageMetaData",disabled:"@disableImageMetaDataSave"},{action:"resizeImage",prefix:"preview",maxWidth:"@",maxHeight:"@",minWidth:"@",minHeight:"@",crop:"@",orientation:"@",thumbnail:"@",canvas:"@",disabled:"@disableImagePreview"},{action:"setImage",name:"@imagePreviewName",disabled:"@disableImagePreview"},{action:"deleteImageReferences",disabled:"@disableImageReferencesDeletion"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png|svg\+xml)$/,loadImageMaxFileSize:1e7,imageMaxWidth:1920,imageMaxHeight:1080,imageOrientation:!1,imageCrop:!1,disableImageResize:!0,previewMaxWidth:80,previewMaxHeight:80,previewOrientation:!0,previewThumbnail:!0,previewCrop:!1,previewCanvas:!0},processActions:{loadImage:function(n,i){if(i.disabled)return n;var o=this,r=n.files[n.index],s=e.Deferred();return"number"===e.type(i.maxFileSize)&&r.size>i.maxFileSize||i.fileTypes&&!i.fileTypes.test(r.type)||!t(r,(function(e){e.src&&(n.img=e),s.resolveWith(o,[n])}),i)?n:s.promise()},resizeImage:function(n,i){if(i.disabled||!n.canvas&&!n.img)return n;i=e.extend({canvas:!0},i);var o,r=this,s=e.Deferred(),a=i.canvas&&n.canvas||n.img,l=function(e){e&&(e.width!==a.width||e.height!==a.height||i.forceResize)&&(n[e.getContext?"canvas":"img"]=e),n.preview=e,s.resolveWith(r,[n])};if(n.exif){if(!0===i.orientation&&(i.orientation=n.exif.get("Orientation")),i.thumbnail&&(o=n.exif.get("Thumbnail")))return t(o,l,i),s.promise();n.orientation?delete i.orientation:n.orientation=i.orientation}return a?(l(t.scale(a,i)),s.promise()):n},saveImage:function(t,n){if(!t.canvas||n.disabled)return t;var i=this,o=t.files[t.index],r=e.Deferred();return t.canvas.toBlob?(t.canvas.toBlob((function(e){e.name||(o.type===e.type?e.name=o.name:o.name&&(e.name=o.name.replace(/\.\w+$/,"."+e.type.substr(6)))),o.type!==e.type&&delete t.imageHead,t.files[t.index]=e,r.resolveWith(i,[t])}),n.type||o.type,n.quality),r.promise()):t},loadImageMetaData:function(n,i){if(i.disabled)return n;var o=this,r=e.Deferred();return t.parseMetaData(n.files[n.index],(function(t){e.extend(n,t),r.resolveWith(o,[n])}),i),r.promise()},saveImageMetaData:function(e,t){if(!(e.imageHead&&e.canvas&&e.canvas.toBlob)||t.disabled)return e;var n=e.files[e.index],i=new Blob([e.imageHead,this._blobSlice.call(n,20)],{type:n.type});return i.name=n.name,e.files[e.index]=i,e},setImage:function(e,t){return e.preview&&!t.disabled&&(e.files[e.index][t.name||"preview"]=e.preview),e},deleteImageReferences:function(e,t){return t.disabled||(delete e.img,delete e.canvas,delete e.preview,delete e.imageHead),e}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery"),require("load-image")):e(window.jQuery,window.loadImage)}((function(e,t){"use strict";e.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadAudio",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableAudioPreview"},{action:"setAudio",name:"@audioPreviewName",disabled:"@disableAudioPreview"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{loadAudioFileTypes:/^audio\/.*$/},_audioElement:document.createElement("audio"),processActions:{loadAudio:function(n,i){if
135(i.disabled)return n;var o,r,s=n.files[n.index];return this._audioElement.canPlayType&&this._audioElement.canPlayType(s.type)&&("number"!==e.type(i.maxFileSize)||s.size<=i.maxFileSize)&&(!i.fileTypes||i.fileTypes.test(s.type))&&(o=t.createObjectURL(s))?((r=this._audioElement.cloneNode(!1)).src=o,r.controls=!0,n.audio=r,n):n},setAudio:function(e,t){return e.audio&&!t.disabled&&(e.files[e.index][t.name||"preview"]=e.audio),e}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery"),require("load-image")):e(window.jQuery,window.loadImage)}((function(e,t){"use strict";e.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadVideo",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableVideoPreview"},{action:"setVideo",name:"@videoPreviewName",disabled:"@disableVideoPreview"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{loadVideoFileTypes:/^video\/.*$/},_videoElement:document.createElement("video"),processActions:{loadVideo:function(n,i){if(i.disabled)return n;var o,r,s=n.files[n.index];return this._videoElement.canPlayType&&this._videoElement.canPlayType(s.type)&&("number"!==e.type(i.maxFileSize)||s.size<=i.maxFileSize)&&(!i.fileTypes||i.fileTypes.test(s.type))&&(o=t.createObjectURL(s))?((r=this._videoElement.cloneNode(!1)).src=o,r.controls=!0,n.video=r,n):n},setVideo:function(e,t){return e.video&&!t.disabled&&(e.files[e.index][t.name||"preview"]=e.video),e}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";e.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{getNumberOfFiles:e.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(t,n){if(n.disabled)return t;var i,o=e.Deferred(),r=this.options,s=t.files[t.index];return(n.minFileSize||n.maxFileSize)&&(i=s.size),"number"===e.type(n.maxNumberOfFiles)&&(r.getNumberOfFiles()||0)+t.files.length>n.maxNumberOfFiles?s.error=r.i18n("maxNumberOfFiles"):!n.acceptFileTypes||n.acceptFileTypes.test(s.type)||n.acceptFileTypes.test(s.name)?i>n.maxFileSize?s.error=r.i18n("maxFileSize"):"number"===e.type(i)&&i<n.minFileSize?s.error=r.i18n("minFileSize"):delete s.error:s.error=r.i18n("acceptFileTypes"),s.error||t.files.error?(t.files.error=!0,o.rejectWith(this,[t])):o.resolveWith(this,[t]),o.promise()}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","tmpl","./jquery.fileupload-image","./jquery.fileupload-audio","./jquery.fileupload-video","./jquery.fileupload-validate"],e):"object"==typeof exports?e(require("jquery"),require("tmpl")):e(window.jQuery,window.tmpl)}((function(e,t){"use strict";e.blueimp.fileupload.prototype._specialOptions.push("filesContainer","uploadTemplateId","downloadTemplateId"),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{autoUpload:!1,uploadTemplateId:"template-upload",downloadTemplateId:"template-download",filesContainer:void 0,prependFiles:!1,dataType:"json",messages:{unknownError:"Unknown error"},getNumberOfFiles:function(){return this.filesContainer.children().not(".processing").length},getFilesFromResponse:function(t){return t.result&&e.isArray(t.result.files)?t.result.files:[]},add:function(t,n){if(t.isDefaultPrevented())return!1;var i=e(this),o=i.data("blueimp-fileupload")||i.data("fileupload"),r=o.options;n.context=o._renderUpload(n.files).data("data",n).addClass("processing"),r.filesContainer[r.prependFiles?"prepend":"append"](n.context),o._forceReflow(n.context),o._transition(n.context),n.process((function(){return i.fileupload("process",n)})).always((function(){n.context.each((function(t){e(this).find(".size").text(o._formatFileSize(n.files[t].size))})).removeClass("processing"),o._renderPreviews(n)})).done((function(){n.context.find(".start").prop("disabled",!1),!1!==o._trigger("added",t,n)&&(r.autoUpload||n.autoUpload)&&!1!==n.autoUpload&&n.submit()})).fail((function(){n.files.error&&n.context.each((function(t){var i=n.files[t].error;i&&e(this).find(".error").text(i)}))}))},send:function(t,n){if(t.isDefaultPrevented())return!1;var i=e(this).data("blueimp-fileupload")||e(this).data("fileupload");return n.context&&n.dataType&&"iframe"===n.dataType.substr(0,6)&&n.context.find(".progress").addClass(!e.support.transition&&"progress-animated").attr("aria-valuenow",100).children().first().css("width","100%"),i._trigger("sent",t,n)},done:function(t,n){if(t.isDefaultPrevented())return!1;var i,o,r=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),s=(n.getFilesFromResponse||r.options.getFilesFromResponse)(n);n.context?n.context.each((function(a){var l=s[a]||{error:"Empty file upload result"};o=r._addFinishedDeferreds(),r._transition(e(this)).done((function(){var s=e(this);i=r._renderDownload([l]).replaceAll(s),r._forceReflow(i),r._transition(i).done((function(){n.context=e(this),r._trigger("completed",t,n),r._trigger("finished",t,n),o.resolve()}))}))})):(i=r._renderDownload(s)[r.options.prependFiles?"prependTo":"appendTo"](r.options.filesContainer),r._forceReflow(i),o=r._addFinishedDeferreds(),r._transition(i).done((function(){n.context=e(this),r._trigger("completed",t,n),r._trigger("finished",t,n),o.resolve()})))},fail:function(t,n){if(t.isDefaultPrevented())return!1;var i,o,r=e(this).data("blueimp-fileupload")||e(this).data("fileupload");n.context?n.context.each((function(s){if("abort"!==n.errorThrown){var a=n.files[s];a.error=a.error||n.errorThrown||n.i18n("unknownError"),o=r._addFinishedDeferreds(),r._transition(e(this)).done((function(){var s=e(this);i=r._renderDownload([a]).replaceAll(s),r._forceReflow(i),r._transition(i).done((function(){n.context=e(this),r._trigger("failed",t,n),r._trigger("finished",t,n),o.resolve()}))}))}else o=r._addFinishedDeferreds(),r._transition(e(this)).done((function(){e(this).remove(),r._trigger("failed",t,n),r._trigger("finished",t,n),o.resolve()}))})):"abort"!==n.errorThrown?(n.context=r._renderUpload(n.files)[r.options.prependFiles?"prependTo":"appendTo"](r.options.filesContainer).data("data",n),r._forceReflow(n.context),o=r._addFinishedDeferreds(),r._transition(n.context).done((function(){n.context=e(this),r._trigger("failed",t,n),r._trigger("finished",t,n),o.resolve()}))):(r._trigger("failed",t,n),r._trigger("finished",t,n),r._addFinishedDeferreds().resolve())},progress:function(t,n){if(t.isDefaultPrevented())return!1;var i=Math.floor(n.loaded/n.total*100);n.context&&n.context.each((function(){e(this).find(".progress").attr("aria-valuenow",i).children().first().css("width",i+"%")}))},progressall:function(t,n){if(t.isDefaultPrevented())return!1;var i=e(this),o=Math.floor(n.loaded/n.total*100),r=i.find(".fileupload-progress"),s=r.find(".progress-extended");s.length&&s.html((i.data("blueimp-fileupload")||i.data("fileupload"))._renderExtendedProgress(n)),r.find(".progress").attr("aria-valuenow",o).children().first().css("width",o+"%")},start:function(t){if(t.isDefaultPrevented())return!1;var n=e(this).data("blueimp-fileupload")||e(this).data("fileupload");n._resetFinishedDeferreds(),n._transition(e(this).find(".fileupload-progress")).done((function(){n._trigger("started",t)}))},stop:function(t){if(t.isDefaultPrevented())return!1;var n=e(this).data("blueimp-fileupload")||e(this).data("fileupload");if(void 0!==n){var i=n._addFinishedDeferreds();
135e.when.apply(e,n._getFinishedDeferreds()).done((function(){n._trigger("stopped",t)})),n._transition(e(this).find(".fileupload-progress")).done((function(){e(this).find(".progress").attr("aria-valuenow","0").children().first().css("width","0%"),e(this).find(".progress-extended").html("&nbsp;"),i.resolve()}))}},processstart:function(t){if(t.isDefaultPrevented())return!1;e(this).addClass("fileupload-processing")},processstop:function(t){if(t.isDefaultPrevented())return!1;e(this).removeClass("fileupload-processing")},destroy:function(t,n){if(t.isDefaultPrevented())return!1;var i=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),o=function(){i._transition(n.context).done((function(){e(this).remove(),i._trigger("destroyed",t,n)}))};n.url?(n.dataType=n.dataType||i.options.dataType,e.ajax(n).done(o).fail((function(){i._trigger("destroyfailed",t,n)}))):o()}},_resetFinishedDeferreds:function(){this._finishedUploads=[]},_addFinishedDeferreds:function(t){return t||(t=e.Deferred()),this._finishedUploads.push(t),t},_getFinishedDeferreds:function(){return this._finishedUploads},_enableDragToDesktop:function(){var t=e(this),n=t.prop("href"),i=t.prop("download"),o="application/octet-stream";t.bind("dragstart",(function(e){try{e.originalEvent.dataTransfer.setData("DownloadURL",[o,i,n].join(":"))}catch(e){}}))},_formatFileSize:function(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"},_formatBitrate:function(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" Gbit/s":e>=1e6?(e/1e6).toFixed(2)+" Mbit/s":e>=1e3?(e/1e3).toFixed(2)+" kbit/s":e.toFixed(2)+" bit/s"},_formatTime:function(e){var t=new Date(1e3*e),n=Math.floor(e/86400);return(n=n?n+"d ":"")+("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)},_formatPercentage:function(e){return(100*e).toFixed(2)+" %"},_renderExtendedProgress:function(e){return this._formatBitrate(e.bitrate)+" | "+this._formatTime(8*(e.total-e.loaded)/e.bitrate)+" | "+this._formatPercentage(e.loaded/e.total)+" | "+this._formatFileSize(e.loaded)+" / "+this._formatFileSize(e.total)},_renderTemplate:function(t,n){if(!t)return e();var i=t({files:n,formatFileSize:this._formatFileSize,options:this.options});return i instanceof e?i:e(this.options.templatesContainer).html(i).children()},_renderPreviews:function(t){t.context.find(".preview").each((function(n,i){e(i).html(t.files[n].preview)}))},_renderUpload:function(e){return this._renderTemplate(this.options.uploadTemplate,e)},_renderDownload:function(e){return this._renderTemplate(this.options.downloadTemplate,e).find("a[download]").each(this._enableDragToDesktop).end()},_startHandler:function(t){t.preventDefault();var n=e(t.currentTarget),i=n.closest(".template-upload").data("data");n.prop("disabled",!0),i&&i.submit&&i.submit()},_cancelHandler:function(t){t.preventDefault();var n=e(t.currentTarget).closest(".template-upload,.template-download"),i=n.data("data")||{};i.context=i.context||n,i.abort?i.abort():(i.errorThrown="abort",this._trigger("fail",t,i))},_deleteHandler:function(t){t.preventDefault();var n=e(t.currentTarget);this._trigger("destroy",t,e.extend({context:n.closest(".template-download"),type:"DELETE"},n.data()))},_forceReflow:function(t){return e.support.transition&&t.length&&t[0].offsetWidth},_transition:function(t){var n=e.Deferred();return e.support.transition&&t.hasClass("fade")&&t.is(":visible")?t.bind(e.support.transition.end,(function(i){i.target===t[0]&&(t.unbind(e.support.transition.end),n.resolveWith(t))})).toggleClass("in"):(t.toggleClass("in"),n.resolveWith(t)),n},_initButtonBarEventHandlers:function(){var t=this.element.find(".fileupload-buttonbar"),n=this.options.filesContainer;this._on(t.find(".start"),{click:function(e){e.preventDefault(),n.find(".start").click()}}),this._on(t.find(".cancel"),{click:function(e){e.preventDefault(),n.find(".cancel").click()}}),this._on(t.find(".delete"),{click:function(e){e.preventDefault(),n.find(".toggle:checked").closest(".template-download").find(".delete").click(),t.find(".toggle").prop("checked",!1)}}),this._on(t.find(".toggle"),{change:function(t){n.find(".toggle").prop("checked",e(t.currentTarget).is(":checked"))}})},_destroyButtonBarEventHandlers:function(){this._off(this.element.find(".fileupload-buttonbar").find(".start, .cancel, .delete"),"click"),this._off(this.element.find(".fileupload-buttonbar .toggle"),"change.")},_initEventHandlers:function(){this._super(),this._on(this.options.filesContainer,{"click .start":this._startHandler,"click .cancel":this._cancelHandler,"click .delete":this._deleteHandler}),this._initButtonBarEventHandlers()},_destroyEventHandlers:function(){this._destroyButtonBarEventHandlers(),this._off(this.options.filesContainer,"click"),this._super()},_enableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!1).parent().removeClass("disabled")},_disableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!0).parent().addClass("disabled")},_initTemplates:function(){var e=this.options;e.templatesContainer=this.document[0].createElement(e.filesContainer.prop("nodeName")),t&&(e.uploadTemplateId&&(e.uploadTemplate=t
135(e.uploadTemplateId)),e.downloadTemplateId&&(e.downloadTemplate=t(e.downloadTemplateId)))},_initFilesContainer:function(){var t=this.options;void 0===t.filesContainer?t.filesContainer=this.element.find(".files"):t.filesContainer instanceof e||(t.filesContainer=e(t.filesContainer))},_initSpecialOptions:function(){this._super(),this._initFilesContainer(),this._initTemplates()},_create:function(){this._super(),this._resetFinishedDeferreds(),e.support.fileInput||this._disableFileInputButton()},enable:function(){var e=!1;this.options.disabled&&(e=!0),this._super(),e&&(this.element.find("input, button").prop("disabled",!1),this._enableFileInputButton())},disable:function(){this.options.disabled||(this.element.find("input, button").prop("disabled",!0),this._disableFileInputButton()),this._super()}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload-ui"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";e.widget("blueimp.fileuploadForm",e.blueimp.fileupload,{options:{add:function(t,n){if(t.isDefaultPrevented())return!1;var i=e(this),o=i.data("blueimp-fileupload")||i.data("fileupload"),r=o.options;1===r.maxNumberOfFiles&&r.filesContainer.find(".cancel").click(),n.context=o._renderUpload(n.files).data("data",n).addClass("processing"),r.filesContainer[r.prependFiles?"prepend":"append"](n.context),o._forceReflow(n.context),o._transition(n.context),n.process((function(){return i.fileupload("process",n)})).always((function(){n.context.each((function(t){e(this).find(".size").text(o._formatFileSize(n.files[t].size))})).removeClass("processing"),o._renderPreviews(n)})).done((function(){n.context.find(".start").prop("disabled",!1),!1!==o._trigger("added",t,n)&&(r.autoUpload||n.autoUpload)&&!1!==n.autoUpload&&n.submit()})).fail((function(){n.files.error&&n.context.each((function(t){var i=n.files[t].error;i&&e(this).find(".error").text(i)}))}))},done:function(t,n){if(t.isDefaultPrevented())return!1;var i,o,r=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),s=(n.getFilesFromResponse||r.options.getFilesFromResponse)(n);if(n.result.redirect)return r._trigger("completed",t,n),r._trigger("finished",t,n),!1;n.context?n.context.each((function(a){var l=s[a]||{error:"Empty file upload result"};o=r._addFinishedDeferreds(),r._transition(e(this)).done((function(){var s=e(this);i=r._renderDownload([l]).replaceAll(s),r._forceReflow(i),r._transition(i).done((function(){n.context=e(this),r._trigger("completed",t,n),r._trigger("finished",t,n),o.resolve()}))}))})):n.result.redirect||(i=r._renderDownload(s)[r.options.prependFiles?"prependTo":"appendTo"](r.options.filesContainer),r._forceReflow(i),o=r._addFinishedDeferreds(),r._transition(i).done((function(){n.context=e(this),r._trigger("completed",t,n),r._trigger("finished",t,n),o.resolve()})))}},_create:function(){this.element.data("blueimp-fileupload",this.element.data("blueimp-fileuploadForm")),this._super()},_showPreviewHandler:function(t){t.preventDefault(),e(t.currentTarget).closest(".template-upload").each((function(){var t=e(this).data("data").files[0],n=URL.createObjectURL(t);e.magnificPopup.open({items:{src:n},type:["image/gif","image/jpeg","image/png"].includes(t.type)?"image":"iframe",image:{titleSrc:t.name},verticalFit:!0},0)}))},_sendFormHandler:function(t){t.preventDefault();var n,i=e(t.currentTarget).closest("form").data("blueimp-fileuploadForm")||e(t.currentTarget).closest("form").data("fileuploadForm");if(i.options.filesContainer.find(".template-upload").each((function(){var t=e(this).data("data");n||t.files.error?t.files.error||(n.files=n.files.concat(t.files),n.originalFiles=n.originalFiles.concat(t.orifinalFiles)):n=t})),n&&n.submit){if(!Nette.validateForm(e(t.currentTarget).closest("form")[0]))return t&&t.stopPropagation?t.stopPropagation():window.event&&(event.cancelBubble=!0),!1;i.options.submittedBy={name:e(t.currentTarget).attr("name"),value:e(t.currentTarget).val()||""},e(t.currentTarget).closest("form").find("[data-submit-disable]").addClass("disabled"),e(t.currentTarget).closest("form").find("[data-submit-disable]").attr("disabled",!0),n.submit()}else e.nette.ajax({},t.currentTarget,t)},_getFormData:function(t){var n;return"function"===e.type(t.formData)?((n=t.formData(t.form)).push(t.submittedBy),n):e.isArray(t.formData)?((n=t.formData.push(t.submittedBy)).push(t.submittedBy),n):"object"===e.type(t.formData)?(n=[],e.each(t.formData,(function(e,t){n.push({name:e,value:t})})),n.push(t.submittedBy),n):[]},_destroyButtonBarEventHandlers:function(){this._super(),this._off(this.element.find(".fileupload-buttonbar").find(".send"),"click")},_initEventHandlers:function(){this._super(),this._on(this.element.find(".fileupload-buttonbar"),{"click .send":this._sendFormHandler}),this._on(this.options.filesContainer,{"click .show":this._showPreviewHandler})}})})),function(e,t){e.nette.ext("upload",{init:function(){if(void 0!==e.fn.fileupload){e
135(document).bind("dragover",(function(t){var n=e(".dropzone"),i=window.dropZoneTimeout;i?clearTimeout(i):n.addClass("in");var o=!1,r=t.target;do{if(r===n[0]){o=!0;break}r=r.parentNode}while(null!=r);o?n.addClass("hover"):n.removeClass("hover"),window.dropZoneTimeout=setTimeout((function(){window.dropZoneTimeout=null,n.removeClass("in hover")}),100)}));var t=this;e(".ajax-upload").each((function(e,n){t.initUpload(n)})),e(".ajax-upload-form").each((function(n,i){e(i).find(".fileinput-button").length&&t.initUploadForm(i)})),this.ext("snippets").after((function(n){n.find(".ajax-upload").each((function(e,n){t.initUpload(n)})),n.find(".ajax-upload-form").each((function(n,i){e(i).find(".fileinput-button").length&&t.initUploadForm(i)})),n.closest(".ajax-upload-form").each((function(n,i){(e(i).data("blueimp-fileupload")||e(i).data("fileupload"))&&e(i).fileuploadForm("destroy"),t.initUploadForm(i)}))}))}}},{initUpload:function(t){var n=this;e(t).fileupload({dropZone:e(t).find(".dropzone"),global:!1,disableImageResize:/Android(?!.*Chrome)|Opera/.test(window.navigator.userAgent),messages:{maxNumberOfFiles:e(t).data("maxNumberOfFilesMessage"),acceptFileTypes:e(t).data("acceptFileTypesMessage"),maxFileSize:e(t).data("maxFileSizeMessage")},finished:function(t,i){e(t.target).find("[data-submit-disable]").removeClass("disabled"),e(t.target).find("[data-submit-disable]").attr("disabled",!1),n.success(i.result),e.nette.load()}})},initUploadForm:function(t){var n=this;e(t).fileuploadForm({dropZone:e(t).find(".dropzone"),global:!1,disableImageResize:/Android(?!.*Chrome)|Opera/.test(window.navigator.userAgent),messages:{maxNumberOfFiles:e(t).data("maxNumberOfFilesMessage"),acceptFileTypes:e(t).data("acceptFileTypesMessage"),maxFileSize:e(t).data("maxFileSizeMessage")},finished:function(t,i){e(t.target).find("[data-submit-disable]").removeClass("disabled"),e(t.target).find("[data-submit-disable]").attr("disabled",!1),n.success(i.result),e.nette.load()}})},addSnippet:function(e,t,n){void 0===n||e.find("> *").length<n?e.append(t):n<=0?e.prepend(t):e.find("> *:eq("+(n-1)+")").after(t)},success:function(t){if(t){if(t.redirect)return window.location.href=t.redirect,!1;var n=e.nette.ext("snippets");t.hideModal&&e("[id$=modalWindow] .modal.display").modal("hide");var i=this.ext("leaflet-map");if(t.mapObjectsFilter&&i&&(sourceUrl=e(i.mapSelector).data("sourceUrl"))&&i.loadGeoJSON(sourceUrl),t.block)var o=n.getElement(t.block);if(t.snippets){var r=[];for(var s in t.snippets){var a=n.getElement(s);if(a.get(0))r.push(a.get(0)),n.updateSnippet(a,t.snippets[s]);else{if(!o)continue;a=e("<div/>",{class:"widget-container",html:t.snippets[s],id:s}),this.addSnippet(o,a,t.position),r.push(a.get(0)),n.afterQueue.fire(a)}}e(r).promise().done((function(){n.completeQueue.fire()}))}}}})}(jQuery),function(e){var t,n={className:"autosizejs",id:"autosizejs",append:"\n",callback:!1,resizeDelay:10,placeholder:!0},i=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","whiteSpace"],o=e('<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>').data("autosize",!0)[0];o.style.lineHeight="99px","99px"===e(o).css("lineHeight")&&i.push("lineHeight"),o.style.lineHeight="",e.fn.autosize=function(r){return this.length?(r=e.extend({},n,r||{}),o.parentNode!==document.body&&e(document.body).append(o),this.each((function(){function n(){var t,n=!!window.getComputedStyle&&window.getComputedStyle(u,null);n?((0===(t=u.getBoundingClientRect().width)||"number"!=typeof t)&&(t=parseInt(n.width,10)),e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],(function(e,i){t-=parseInt(n[i],10)}))):t=p.width(),o.style.width=Math.max(t,0)+"px"}function s(){var s={};if(t=u,o.className=r.className,o.id=r.id,c=parseInt(p.css("maxHeight"),10),e.each(i,(function(e,t){s[t]=p.css(t)})),e(o).css(s).attr("wrap",p.attr("wrap")),n(),window.chrome){var a=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=a}}function a(){var e,i;t!==u?s():n(),o.value=!u.value&&r.placeholder?p.attr("placeholder")||"":u.value,o.value+=r.append||"",o.style.overflowY=u.style.overflowY,i=parseInt(u.style.height,10),o.scrollTop=0,o.scrollTop=9e4,e=o.scrollTop,c&&e>c?(u.style.overflowY="scroll",e=c):(u.style.overflowY="hidden",d>e&&(e=d)),i!==(e+=f)&&(u.style.height=e+"px",o.className=o.className,m&&r.callback.call(u,u),p.trigger("autosize.resized"))}function l(){clearTimeout(h),h=setTimeout((function(){var e=p.width();e!==v&&(v=e,a())}),parseInt(r.resizeDelay,10))}var c,d,h,u=this,p=e(u),f=0,m=e.isFunction(r.callback),g={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},v=p.width(),b=p.css("resize");p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(f=p.outerHeight()-p.height()),d=Math.max(parseInt(p.css("minHeight"),10)-f||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",
vendor: 4,241 bytes, line 135
135wordWrap:"break-word"}),"vertical"===b?p.css("resize","none"):"both"===b&&p.css("resize","horizontal"),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",a):p.on("propertychange.autosize",(function(){"value"===event.propertyName&&a()})):p.on("input.autosize",a),!1!==r.resizeDelay&&e(window).on("resize.autosize",l),p.on("autosize.resize",a),p.on("autosize.resizeIncludeStyle",(function(){t=null,a()})),p.on("autosize.destroy",(function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(g).removeData("autosize")})),a())}))):this}}(jQuery||$),function(){"use strict";var e=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},t=function(e){return{eq:e}},n=t((function(e,t){return e===t})),i=function(e){return t((function(t,n){if(t.length!==n.length)return!1;for(var i=t.length,o=0;o<i;o++)if(!e.eq(t[o],n[o]))return!1;return!0}))},o=function(e){return t((function(o,r){var s=Object.keys(o),a=Object.keys(r);if(!function(e,n){return function(e,n){return t((function(t,i){return e.eq(n(t),n(i))}))}(i(e),(function(e){return function(e,t){return Array.prototype.slice.call(e).sort(undefined)}(e)}))}(n).eq(s,a))return!1;for(var l=s.length,c=0;c<l;c++){var d=s[c];if(!e.eq(o[d],r[d]))return!1}return!0}))},r=t((function(t,n){if(t===n)return!0;var s=e(t);return s===e(n)&&(function(e){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(s)?t===n:"array"===s?i(r).eq(t,n):"object"===s&&o(r).eq(t,n))}));const s=Object.getPrototypeOf,a=(e,t,n)=>{var i;return!!n(e,t.prototype)||(null===(i=e.constructor)||void 0===i?void 0:i.name)===t.name},l=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&a(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,c=e=>t=>typeof t===e,d=e=>t=>e===t,h=(e,t)=>p(e)&&a(e,t,((e,t)=>s(e)===t)),u=l("string"),p=l("object"),f=e=>h(e,Object),m=l("array"),g=d(null),v=c("boolean"),b=d(void 0),y=e=>null==e,x=e=>!y(e),w=c("function"),_=c("number"),k=(e,t)=>{if(m(e)){for(let n=0,i=e.length;n<i;++n)if(!t(e[n]))return!1;return!0}return!1},C=()=>{},S=(e,t)=>(...n)=>e(t.apply(null,n)),T=(e,t)=>n=>e(t(n)),E=e=>()=>e,A=e=>e,O=(e,t)=>e===t;function D(e,...t){return(...n)=>{const i=t.concat(n);return e.apply(null,i)}}const I=e=>t=>!e(t),P=e=>()=>{throw new Error(e)},M=e=>e(),R=e=>{e()},z=E(!1),N=E(!0);class F{constructor(e,t){this.tag=e,this.value=t}static some(e){return new F(!0,e)}static none(){return F.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?F.some(e(this.value)):F.none()}bind(e){return this.tag?e(this.value):F.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:F.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return x(e)?F.some(e):F.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}F.singletonNone=new F(!1);const L=Array.prototype.slice,j=Array.prototype.indexOf,B=Array.prototype.push,H=(e,t)=>j.call(e,t),U=(e,t)=>H(e,t)>-1,$=(e,t)=>{for(let n=0,i=e.length;n<i;n++)if(t(e[n],n))return!0;return!1},q=(e,t)=>{const n=e.length,i=new Array(n);for(let o=0;o<n;o++){const n=e[o];i[o]=t(n,o)}return i},W=(e,t)=>{for(let n=0,i=e.length;n<i;n++)t(e[n],n)},V=(e,t)=>{for(let n=e.length-1;n>=0;n--)t(e[n],n)},K=(e,t)=>{const n=[],i=[];for(let o=0,r=e.length;o<r;o++){const r=e[o];(t(r,o)?n:i).push(r)}return{pass:n,fail:i}},G=(e,t)=>{const n=[];for(let i=0,o=e.length;i<o;i++){const o=e[i];t(o,i)&&n.push(o)}return n},X=(e,t,n)=>(V(e,((e,i)=>{n=t(n,e,i)}
vendor: 10,360 bytes, line 135
135)),n),Y=(e,t,n)=>(W(e,((e,i)=>{n=t(n,e,i)})),n),Q=(e,t,n)=>{for(let i=0,o=e.length;i<o;i++){const o=e[i];if(t(o,i))return F.some(o);if(n(o,i))break}return F.none()},J=(e,t)=>Q(e,t,z),Z=(e,t)=>{for(let n=0,i=e.length;n<i;n++)if(t(e[n],n))return F.some(n);return F.none()},ee=e=>{const t=[];for(let n=0,i=e.length;n<i;++n){if(!m(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);B.apply(t,e[n])}return t},te=(e,t)=>ee(q(e,t)),ne=(e,t)=>{for(let n=0,i=e.length;n<i;++n)if(!0!==t(e[n],n))return!1;return!0},ie=e=>{const t=L.call(e,0);return t.reverse(),t},oe=(e,t)=>G(e,(e=>!U(t,e))),re=(e,t)=>{const n={};for(let i=0,o=e.length;i<o;i++){const o=e[i];n[String(o)]=t(o,i)}return n},se=(e,t)=>{const n=L.call(e,0);return n.sort(t),n},ae=(e,t)=>t>=0&&t<e.length?F.some(e[t]):F.none(),le=e=>ae(e,0),ce=e=>ae(e,e.length-1),de=w(Array.from)?Array.from:e=>L.call(e),he=(e,t)=>{for(let n=0;n<e.length;n++){const i=t(e[n],n);if(i.isSome())return i}return F.none()},ue=(e,t)=>{const n=[],i=w(t)?e=>$(n,(n=>t(n,e))):e=>U(n,e);for(let t=0,o=e.length;t<o;t++){const o=e[t];i(o)||n.push(o)}return n},pe=Object.keys,fe=Object.hasOwnProperty,me=(e,t)=>{const n=pe(e);for(let i=0,o=n.length;i<o;i++){const o=n[i];t(e[o],o)}},ge=(e,t)=>ve(e,((e,n)=>({k:n,v:t(e,n)}))),ve=(e,t)=>{const n={};return me(e,((e,i)=>{const o=t(e,i);n[o.k]=o.v})),n},be=e=>(t,n)=>{e[n]=t},ye=(e,t,n,i)=>{me(e,((e,o)=>{(t(e,o)?n:i)(e,o)}))},xe=(e,t)=>{const n={};return ye(e,t,be(n),C),n},we=(e,t)=>{const n=[];return me(e,((e,i)=>{n.push(t(e,i))})),n},_e=e=>we(e,A),ke=(e,t)=>Ce(e,t)?F.from(e[t]):F.none(),Ce=(e,t)=>fe.call(e,t),Se=(e,t)=>Ce(e,t)&&void 0!==e[t]&&null!==e[t],Te=e=>{if(!m(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],n={};return W(e,((i,o)=>{const r=pe(i);if(1!==r.length)throw new Error("one and only one name per case");const s=r[0],a=i[s];if(void 0!==n[s])throw new Error("duplicate key detected:"+s);if("cata"===s)throw new Error("cannot have a case named cata (sorry)");if(!m(a))throw new Error("case arguments must be an array");t.push(s),n[s]=(...n)=>{const i=n.length;if(i!==a.length)throw new Error("Wrong number of arguments to case "+s+". Expected "+a.length+" ("+a+"), got "+i);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[o].apply(null,n)},match:e=>{const i=pe(e);if(t.length!==i.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+i.join(","));if(!ne(t,(e=>U(i,e))))throw new Error("Not all branches were specified when using match. Specified: "+i.join(", ")+"\nRequired: "+t.join(", "));return e[s].apply(null,n)},log:e=>{console.log(e,{constructors:t,constructor:s,params:n})}}}})),n},Ee=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},Ae=e=>{const t=t=>t(e),n=E(e),i=()=>o,o={tag:!0,inner:e,fold:(t,n)=>n(e),isValue:N,isError:z,map:t=>De.value(t(e)),mapError:i,bind:t,exists:t,forall:t,getOr:n,or:i,getOrThunk:n,orThunk:i,getOrDie:n,each:t=>{t(e)},toOptional:()=>F.some(e)};return o},Oe=e=>{const t=()=>n,n={tag:!1,inner:e,fold:(t,n)=>t(e),isValue:z,isError:N,map:t,mapError:t=>De.error(t(e)),bind:t,exists:z,forall:N,getOr:A,or:A,getOrThunk:M,orThunk:M,getOrDie:P(String(e)),each:C,toOptional:F.none};return n},De={value:Ae,error:Oe,fromOption:(e,t)=>e.fold((()=>Oe(t)),Ae)},Ie="undefined"!=typeof window?window:Function("return this;")(),Pe=()=>window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295;let Me=0;const Re=e=>{const t=(new Date).getTime(),n=Math.floor(1e9*Pe());return Me++,e+"_"+n+Me+String(t)},ze=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const n={};for(let i=0;i<t.length;i++){const o=t[i];for(const t in o)Ce(o,t)&&(n[t]=e(n[t],o[t]))}return n},Ne=ze(((e,t)=>f(e)&&f(t)?Ne(e,t):t)),Fe=ze(((e,t)=>t)),Le=(e,t,n=O)=>e.exists((e=>n(e,t))),je=(e,t,n=O)=>Be(e,t,n).getOr(e.isNone()&&t.isNone()),Be=(e,t,n)=>e.isSome()&&t.isSome()?F.some(n(e.getOrDie(),t.getOrDie())):F.none(),He=(e,t)=>e?F.some(t):F.none(),Ue=(e,t)=>((e,t)=>{let n=null!=t?t:Ie;for(let t=0;t<e.length&&null!=n;++t)n=n[e[t]];return n})(e.split("."),t);Te([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const $e=e=>{const t=Ee(F.none()),n=()=>t.get().each((e=>clearInterval(e)));return{clear:()=>{n(),t.set(F.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:i=>{n(),t.set(F.some(setInterval(i,e)))}}},qe=()=>{const e=(e=>{const t=Ee(F.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(F.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(F.some(e))}}})(C);return{...e,on:t=>e.get().each(t)}},We=(e,t,n)=>""===t||e.length>=t.length&&e.substr(n,n+t.length)===t,Ve=(e,t)=>Ge(e,t)?((e,t)=>e.substring(t))(e,t.length):e,Ke=(e,t,n=0,i)=>{const o=e.indexOf(t,n);return-1!==o&&(!!b(i)||o+t.length<=i)},Ge=(e,t)=>We(e,t,0),Xe=(e,t)=>We(e,t,e.length-t.length),Ye=e=>t=>t.replace(e,""),Qe=Ye(/^\s+|\s+$/g),Je=Ye(/^\s+/g),Ze=Ye(/\s+$/g),et=e=>e.length>0,tt=e=>!et(e),nt=(e,t=10)=>{const n=parseInt(e,t);return isNaN(n)?F.none():F.some(n)},it=(e,t)=>{let n=null;return{cancel:()=>{g(n)||(clearTimeout(n),n=null)},throttle:(...i)=>{g(n)&&(n=setTimeout((()=>{n=null,e.apply(null,i)}),t))}}},ot=(e,t)=>{let n=null;const i=()=>{g(n)||(clearTimeout(n),n=null)};return{cancel:i,throttle:(...o)=>{i(),n=setTimeout((()=>{n=null,e.apply(null,o)}),t)}}},rt=e=>{let t,n=!1;return(...i)=>(n||(n=!0,t=e.apply(null,i)),t)},st="\ufeff",at=" ",lt=e=>e===st,ct=e=>{const t={};return W(e,(e=>{t[e]={}})),pe(t)},dt=e=>void 0!==e.length,ht=Array.isArray,ut=(e,t,n)=>{if(!e)return!1;if(n=n||e,dt(e)){for(let i=0,o=e.length;i<o;i++)if(!1===t.call(n,e[i],i,e))return!1}else for(const i in e)if(Ce(e,i)&&!1===t.call(n,e[i],i,e))return!1;return!0},pt=(e,t)=>{const n=[];return ut(e,((i,o)=>{n.push(t(i,o,e))})),n},ft=(e,t)=>{const n=[];return ut(e,((i,o)=>{t&&!t(i,o,e)||n.push(i)})),n},mt=(e,t,n,i)=>{let o=b(n)?e[0]:n;for(let n=0;n<e.length;n++)o=t.call(i,o,e[n],n);return o},gt=(e,t,n)=>{for(let i=0,o=e.length;i<o;i++)if(t.call(n,e[i],i,e))return i;return-1},vt=e=>e[e.length-1],bt=()=>yt(0,0),yt=(e,t)=>({major:e,minor:t}),xt={nu:yt,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?bt():((e,t)=>{const n=((e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.test(t))return i}})(e,t);if(!n)return{major:0,minor:0};const i=e=>Number(t.replace(n,"$"+e));return yt(i(1),i(2))})(e,n)},unknown:bt},wt=(e,t)=>{const n=String(t).toLowerCase();return J(e,(e=>e.search(n)))},_t=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,kt=e=>t=>Ke(t,e),Ct=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Ke(e,"edge/")&&Ke(e,"chrome")&&Ke(e,"safari")&&Ke(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,_t],search:e=>Ke(e,"chrome")&&!Ke(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Ke(e,"msie")||Ke(e,"trident")},{name:"Opera",versionRegexes:[_t,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:kt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:kt("firefox")},{name:"Safari",versionRegexes:[_t,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Ke(e,"safari")||Ke(e,"mobile/"))&&Ke(e,"applewebkit")}],St=[{name:"Windows",search:kt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Ke(e,"iphone")||Ke(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:kt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:kt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:kt("linux"),versionRegexes:[]},{name:"Solaris",search:kt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:kt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:kt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Tt={browsers:E(Ct),oses:E(St)},Et="Edge",At="Chromium",Ot="Opera",Dt="Firefox",It="Safari",Pt=e=>{const t=e.current,n=e.version,i=e=>()=>t===e;return{current:t,version:n,isEdge:i(Et),isChromium:i(At),isIE:i("IE"),isOpera:i(Ot),isFirefox:i(Dt),isSafari:i(It)}},Mt=()=>Pt({current:void 0,version:xt.unknown()}),Rt=Pt,zt=(E(Et),E(At),E("IE"),E(Ot),E(Dt),E(It),"Windows"),Nt="Android",Ft="Linux",Lt="macOS",jt="Solaris",Bt="FreeBSD",Ht="ChromeOS",Ut=e=>{const t=e.current,n=e.version,i=e=>()=>t===e;return{current:t,version:n,isWindows:i(zt),isiOS:i("iOS"),isAndroid:i(Nt),isMacOS:i(Lt),isLinux:i(Ft),isSolaris:i(jt),isFreeBSD:i(Bt),isChromeOS:i(Ht)}},$t=()=>Ut({current:void 0,version:xt.unknown()}),qt=Ut,Wt=(E(zt),E("iOS"),E(Nt),E(Ft),E(Lt),E(jt),E(Bt),E(Ht),e=>window.matchMedia(e).matches);let Vt=rt((()=>((e,t,n)=>{const i=Tt.browsers(),o=Tt.oses(),r=t.bind((e=>((e,t)=>he(t.brands,(t=>{const n=t.brand.toLowerCase();return J(e,(e=>{var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:xt.nu(parseInt(t.version,10),0)})))})))(i,e))).orThunk((()=>((e,t)=>wt(e,t).map((e=>{const n=xt.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(i,e))).fold(Mt,Rt),s=((e,t)=>wt(e,t).map((e=>{const n=xt.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(o,e).fold($t,qt);return{browser:r,os:s,deviceType:((e,t,n,i)=>{const o=e.isiOS()&&!0===/ipad/i.test(n),r=e.isiOS()&&!o,s=e.isiOS()||e.isAndroid(),a=s||i("(pointer:coarse)"),l=o||!r&&s&&i("(min-device-width:768px)"),c=r||s&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),h=!c&&!l&&!d;return{isiPad:E(o),isiPhone:E(r),isTablet:E(l),isPhone:E(c),isTouch:E(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:E(d),isDesktop:E(h)}})(s,r,e,n)}})(window.navigator.userAgent,F.from(window.navigator.userAgentData),Wt)));const Kt=()=>Vt(),Gt=Object.getPrototypeOf,Xt=window.navigator.userAgent,Yt=Kt(),Qt=Yt.browser,Jt=Yt.os,Zt=Yt.deviceType,en=-1!==Xt.indexOf("Windows Phone"),tn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:Qt.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!Qt.isIE(),windowsPhone:en,browser:{current:Qt.current,ver
vendor: 8,974 bytes, line 135
135sion:Qt.version,isChromium:Qt.isChromium,isEdge:Qt.isEdge,isFirefox:Qt.isFirefox,isIE:Qt.isIE,isOpera:Qt.isOpera,isSafari:Qt.isSafari},os:{current:Jt.current,version:Jt.version,isAndroid:Jt.isAndroid,isChromeOS:Jt.isChromeOS,isFreeBSD:Jt.isFreeBSD,isiOS:Jt.isiOS,isLinux:Jt.isLinux,isMacOS:Jt.isMacOS,isSolaris:Jt.isSolaris,isWindows:Jt.isWindows},deviceType:{isDesktop:Zt.isDesktop,isiPad:Zt.isiPad,isiPhone:Zt.isiPhone,isPhone:Zt.isPhone,isTablet:Zt.isTablet,isTouch:Zt.isTouch,isWebView:Zt.isWebView}},nn=/^\s*|\s*$/g,on=e=>y(e)?"":(""+e).replace(nn,""),rn=function(e,t,n,i){i=i||this,e&&(n&&(e=e[n]),ut(e,((e,o)=>!1!==t.call(i,e,o,n)&&(rn(e,t,n,i),!0))))},sn={trim:on,isArray:ht,is:(e,t)=>t?!("array"!==t||!ht(e))||typeof e===t:void 0!==e,toArray:e=>{if(ht(e))return e;{const t=[];for(let n=0,i=e.length;n<i;n++)t[n]=e[n];return t}},makeMap:(e,t,n={})=>{const i=u(e)?e.split(t||","):e||[];let o=i.length;for(;o--;)n[i[o]]={};return n},each:ut,map:pt,grep:ft,inArray:(e,t)=>{if(e)for(let n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},hasOwn:Ce,extend:(e,...t)=>{for(let n=0;n<t.length;n++){const i=t[n];for(const t in i)if(Ce(i,t)){const n=i[t];void 0!==n&&(e[t]=n)}}return e},walk:rn,resolve:(e,t=window)=>{const n=e.split(".");for(let e=0,i=n.length;e<i&&(t=t[n[e]]);e++);return t},explode:(e,t)=>m(e)?e:""===e?[]:pt(e.split(t||","),on),_addCacheSuffix:e=>{const t=tn.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},an=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},ln=(e,t)=>{const n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return an(n.childNodes[0])},cn=(e,t)=>{const n=(t||document).createElement(e);return an(n)},dn=(e,t)=>{const n=(t||document).createTextNode(e);return an(n)},hn=an,un=(e,t,n)=>{const i=e.document.createRange();var o;return o=i,t.fold((e=>{o.setStartBefore(e.dom)}),((e,t)=>{o.setStart(e.dom,t)}),(e=>{o.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,n)=>{e.setEnd(t.dom,n)}),(t=>{e.setEndAfter(t.dom)}))})(i,n),i},pn=(e,t,n,i,o)=>{const r=e.document.createRange();return r.setStart(t.dom,n),r.setEnd(i.dom,o),r},fn=Te([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),mn=(e,t,n)=>t(hn(n.startContainer),n.startOffset,hn(n.endContainer),n.endOffset);fn.ltr,fn.rtl;const gn=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},vn=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,bn=(e,t)=>e.dom===t.dom,yn=(e,t)=>{const n=e.dom,i=t.dom;return n!==i&&n.contains(i)},xn=(e,t)=>{const n=[],i=e=>(n.push(e),t(e));let o=t(e);do{o=o.bind(i)}while(o.isSome());return n},wn=e=>e.dom.nodeName.toLowerCase(),_n=e=>e.dom.nodeType,kn=e=>t=>_n(t)===e,Cn=e=>Sn(e)&&(e=>{const t=Ue("ownerDocument.defaultView",e);return p(e)&&((e=>((e,t)=>{const n=((e,t)=>Ue("HTMLElement",t))(0,t);if(null==n)throw new Error(e+" not available on this browser");return n})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Gt(e).constructor.name))})(e.dom),Sn=kn(1),Tn=kn(3),En=kn(9),An=kn(11),On=e=>t=>Sn(t)&&wn(t)===e,Dn=e=>hn(e.dom.ownerDocument),In=e=>En(e)?e:Dn(e),Pn=e=>hn(In(e).dom.defaultView),Mn=e=>F.from(e.dom.parentNode).map(hn),Rn=e=>F.from(e.dom.parentElement).map(hn),zn=(e,t)=>{const n=w(t)?t:z;let i=e.dom;const o=[];for(;null!==i.parentNode&&void 0!==i.parentNode;){const e=i.parentNode,t=hn(e);if(o.push(t),!0===n(t))break;i=e}return o},Nn=e=>F.from(e.dom.previousSibling).map(hn),Fn=e=>F.from(e.dom.nextSibling).map(hn),Ln=e=>ie(xn(e,Nn)),jn=e=>xn(e,Fn),Bn=e=>q(e.dom.childNodes,hn),Hn=(e,t)=>{const n=e.dom.childNodes;return F.from(n[t]).map(hn)},Un=e=>Hn(e,0),$n=e=>Hn(e,e.dom.childNodes.length-1),qn=e=>e.dom.childNodes.length,Wn=e=>An(e)&&x(e.dom.host),Vn=e=>hn(e.dom.getRootNode()),Kn=e=>Wn(e)?e:(e=>{const t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return hn(t)})(In(e)),Gn=e=>hn(e.dom.host),Xn=e=>{if(x(e.target)){const t=hn(e.target);if(Sn(t)&&Yn(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return le(t)}}return F.from(e.target)},Yn=e=>x(e.dom.shadowRoot),Qn=(e,t,n,i)=>{e.dom.removeEventListener(t,n,i)},Jn=N,Zn=()=>hn(document),ei=(e,t=!1)=>e.dom.focus({preventScroll:t}),ti=e=>{const t=Vn(e).dom;return e.dom===t.activeElement},ni=(e=Zn())=>F.from(e.dom.activeElement).map(hn),ii=(e,t)=>{Mn(e).each((n=>{n.dom.insertBefore(t.dom,e.dom)}))},oi=(e,t)=>{Fn(e).fold((()=>{Mn(e).each((e=>{si(e,t)}))}),(e=>{ii(e,t)}))},ri=(e,t)=>{Un(e).fold((()=>{si(e,t)}),(n=>{e.dom.insertBefore(t.dom,n.dom)}))},si=(e,t)=>{e.dom.appendChild(t.dom)},ai=(e,t)=>{ii(e,t),si(t,e)},li=(e,t)=>{W(t,(t=>{si(e,t)}))},ci=(e,t,n)=>{if(!(u(n)||v(n)||_(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},di=(e,t,n)=>{ci(e.dom,t,n)},hi=(e,t)=>{const n=e.dom;me(t,((e,t)=>{ci(n,t,e)}))},ui=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},pi=(e,t)=>F.from(ui(e,t)),fi=(e,t)=>{const n=e.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},mi=(e,t)=>{e.dom.removeAttribute(t)},gi=e=>Y(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),vi=e=>{e.dom.textContent="",W(Bn(e),(e=>{bi(e)}))},bi=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},yi=e=>{const t=Bn(e);var n,i;t.length>0&&(n=e,W(i=t,((e,t)=>{const o=0===t?n:i[t-1];oi(o,e)}))),bi(e)},xi=(e,t)=>hn(e.dom.cloneNode(t)),wi=e=>xi(e,!1),_i=e=>xi(e,!0),ki=e=>q(e,hn),Ci=e=>e.dom.innerHTML,Si=(e,t)=>{const n=Dn(e).dom,i=hn(n.createDocumentFragment()),o=((e,t)=>{const n=(t||document).createElement("div");return n.innerHTML=e,Bn(hn(n))})(t,n);li(i,o),vi(e),si(e,i)},Ti=e=>void 0!==e.style&&w(e.style.getPropertyValue),Ei=e=>{const t=Tn(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return(e=>{const t=Vn(e);return Wn(t)?F.some(t):F.none()})(hn(t)).fold((()=>n.body.contains(t)),T(Ei,Gn))},Ai=(e,t,n)=>{if(!u(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);Ti(e)&&e.style.setProperty(t,n)},Oi=(e,t,n)=>{const i=e.dom;Ai(i,t,n)},Di=(e,t)=>{const n=e.dom;me(t,((e,t)=>{Ai(n,t,e)}))},Ii=(e,t)=>{const n=e.dom,i=window.getComputedStyle(n).getPropertyValue(t);return""!==i||Ei(e)?i:Pi(n,t)},Pi=(e,t)=>Ti(e)?e.style.getPropertyValue(t):"",Mi=(e,t)=>{const n=e.dom,i=Pi(n,t);return F.from(i).filter((e=>e.length>0))},Ri=e=>{const t={},n=e.dom;if(Ti(n))for(let e=0;e<n.style.length;e++){const i=n.style.item(e);t[i]=n.style[i]}return t},zi=(e,t)=>{((e,t)=>{Ti(e)&&e.style.removeProperty(t)})(e.dom,t),Le(pi(e,"style").map(Qe),"")&&mi(e,"style")},Ni=(e=>{const t=t=>{const n=(e=>{const t=e.dom;return Ei(e)?t.getBoundingClientRect().height:t.offsetHeight})(t);if(n<=0||null===n){const n=Ii(t,e);return parseFloat(n)||0}return n},n=(e,t)=>Y(t,((t,n)=>{const i=Ii(e,n),o=void 0===i?0:parseInt(i,10);return isNaN(o)?t:t+o}),0);return{set:(t,n)=>{if(!_(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);const i=t.dom;Ti(i)&&(i.style[e]=n+"px")},get:t,getOuter:t,aggregate:n,max:(e,t,i)=>{const o=n(e,i);return t>o?t-o:0}}})("height"),Fi=(e,t)=>({left:e,top:t,translate:(n,i)=>Fi(e+n,t+i)}),Li=Fi,ji=(e,t)=>void 0!==e?e:void 0!==t?t:0,Bi=e=>{const t=e.dom,n=t.ownerDocument.body;return n===t?Li(n.offsetLeft,n.offsetTop):Ei(e)?(e=>{const t=e.getBoundingClientRect();return Li(t.left,t.top)})(t):Li(0,0)},Hi=e=>{const t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,i=t.body.scrollTop||t.documentElement.scrollTop;return Li(n,i)},Ui=(e,t,n)=>{const i=(void 0!==n?n.dom:document).defaultView;i&&i.scrollTo(e,t)},$i=(e,t)=>{Kt().browser.isSafari()&&w(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)},qi=(e,t)=>{const n=(t||document).createDocumentFragment();return W(e,(e=>{n.appendChild(e.dom)})),hn(n)},Wi=(e=>{const t=t=>e(t)?F.from(t.dom.nodeValue):F.none();return{get:n=>{if(!e(n))throw new Error("Can only get text value of a text node");return t(n).getOr("")},getOption:t,set:(t,n)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=n}}})(Tn),Vi=e=>Wi.get(e),Ki=(e,t)=>Wi.set(e,t),Gi=(e,t)=>{const n=ui(e,t);return void 0===n||""===n?[]:n.split(" ")};var Xi=(e,t,n,i,o)=>e(n,i)?F.some(n):w(o)&&o(n)?F.none():t(n,i,o);const Yi=(e,t,n)=>{let i=e.dom;const o=w(n)?n:z;for(;i.parentNode;){i=i.parentNode;const e=hn(i);if(t(e))return F.some(e);
vendor: 13,546 bytes, line 135
135if(o(e))break}return F.none()},Qi=(e,t,n)=>Xi(((e,t)=>t(e)),Yi,e,t,n),Ji=(e,t)=>{const n=e=>{for(let i=0;i<e.childNodes.length;i++){const o=hn(e.childNodes[i]);if(t(o))return F.some(o);const r=n(e.childNodes[i]);if(r.isSome())return r}return F.none()};return n(e.dom)},Zi=(e,t,n)=>Yi(e,(e=>gn(e,t)),n),eo=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return vn(n)?F.none():F.from(n.querySelector(e)).map(hn)})(t,e),to=(e,t,n)=>Xi(((e,t)=>gn(e,t)),Zi,e,t,n),no=e=>void 0!==e.dom.classList,io=e=>Gi(e,"class"),oo=(e,t)=>((e,t,n)=>{const i=Gi(e,t).concat([n]);return di(e,t,i.join(" ")),!0})(e,"class",t),ro=(e,t)=>((e,t,n)=>{const i=G(Gi(e,t),(e=>e!==n));return i.length>0?di(e,t,i.join(" ")):mi(e,t),!1})(e,"class",t),so=(e,t)=>{no(e)?e.dom.classList.add(t):oo(e,t)},ao=e=>{0===(no(e)?e.dom.classList:io(e)).length&&mi(e,"class")},lo=(e,t)=>{no(e)?e.dom.classList.remove(t):ro(e,t),ao(e)},co=(e,t)=>no(e)&&e.dom.classList.contains(t),ho=(e,t=!1)=>{return Ei(e)?e.dom.isContentEditable:(n=e,to(n,"[contenteditable]")).fold(E(t),(e=>"true"===uo(e)));var n},uo=e=>e.dom.contentEditable,po=(e,t)=>{e.dom.contentEditable=t?"true":"false"},fo=(e,t)=>{let n=[];return W(Bn(e),(e=>{t(e)&&(n=n.concat([e])),n=n.concat(fo(e,t))})),n},mo=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return vn(n)?[]:q(n.querySelectorAll(e),hn)})(t,e),go=(e,t,n)=>Yi(e,t,n).isSome(),vo=(e,t)=>Ji(e,t).isSome(),bo=e=>w(e)?e:z,yo=(e,t,n)=>{const i=t(e),o=bo(n);return i.orThunk((()=>o(e)?F.none():((e,t,n)=>{let i=e.dom;const o=bo(n);for(;i.parentNode;){i=i.parentNode;const e=hn(i),n=t(e);if(n.isSome())return n;if(o(e))break}return F.none()})(e,t,o)))},xo=["img","br"],wo=e=>{return(t=e,Wi.getOption(t)).filter((e=>0!==e.trim().length||e.indexOf(at)>-1)).isSome()||U(xo,wn(e))||(e=>Cn(e)&&"false"===ui(e,"contenteditable"))(e);var t},_o=(e,t,n,i)=>({start:e,soffset:t,finish:n,foffset:i}),ko=Te([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Co={before:ko.before,on:ko.on,after:ko.after,cata:(e,t,n,i)=>e.fold(t,n,i),getStart:e=>e.fold(A,A,A)},So=Te([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),To={domRange:So.domRange,relative:So.relative,exact:So.exact,exactFromRange:e=>So.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>hn(e.startContainer),relative:(e,t)=>Co.getStart(e),exact:(e,t,n,i)=>e}))(e);return Pn(t)},range:_o},Eo=(e,t)=>{const n=wn(e);return"input"===n?Co.after(e):U(["br","img"],n)?0===t?Co.before(e):Co.after(e):Co.on(e,t)},Ao=(e,t)=>{const n=e.fold(Co.before,Eo,Co.after),i=t.fold(Co.before,Eo,Co.after);return To.relative(n,i)},Oo=(e,t,n,i)=>{const o=Eo(e,t),r=Eo(n,i);return To.relative(o,r)},Do=(e,t,n,i)=>({x:e,y:t,width:n,height:i,right:e+n,bottom:t+i}),Io=e=>{const t=void 0===e?window:e,n=t.document,i=Hi(hn(n));return(e=>{const t=void 0===e?window:e;return Kt().browser.isFirefox()?F.none():F.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return Do(i.left,i.top,n,o)}),(e=>Do(Math.max(e.pageLeft,i.left),Math.max(e.pageTop,i.top),e.width,e.height)))};class Po{constructor(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node}prev(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node}prev2(e){return this.node=this.findPreviousNode(this.node,e),this.node}findSibling(e,t,n,i){if(e){if(!i&&e[t])return e[t];if(e!==this.rootNode){let t=e[n];if(t)return t;for(let i=e.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(t=i[n],t)return t}}}findPreviousNode(e,t){if(e){const n=e.previousSibling;if(this.rootNode&&n===this.rootNode)return;if(n){if(!t)for(let e=n.lastChild;e;e=e.lastChild)if(!e.lastChild)return e;return n}const i=e.parentNode;if(i&&i!==this.rootNode)return i}}}const Mo=/^[ \t\r\n]*$/,Ro=e=>Mo.test(e),zo=e=>"\n"===e||"\r"===e,No=(e,t=4,n=!0,i=!0)=>{const o=((e,t)=>t<=0?"":new Array(t+1).join(" "))(0,t),r=e.replace(/\t/g,o);return Y(r,((e,t)=>(e=>-1!==" \f\t\v".indexOf(e))(t)||t===at?e.pcIsSpace||""===e.str&&n||e.str.length===r.length-1&&i||((e,t)=>t<e.length&&t>=0&&zo(e[t]))(r,e.str.length+1)?{pcIsSpace:!1,str:e.str+at}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:zo(t),str:e.str+t}),{pcIsSpace:!1,str:""}).str},Fo=e=>t=>!!t&&t.nodeType===e,Lo=e=>!!e&&!Object.getPrototypeOf(e),jo=Fo(1),Bo=e=>jo(e)&&Cn(hn(e)),Ho=e=>{const t=e.toLowerCase();return e=>x(e)&&e.nodeName.toLowerCase()===t},Uo=e=>{const t=e.map((e=>e.toLowerCase()));return e=>{if(e&&e.nodeName){const n=e.nodeName.toLowerCase();return U(t,n)}return!1}},$o=(e,t)=>{const n=t.toLowerCase().split(" ");return t=>{if(jo(t)){const i=t.ownerDocument.defaultView;if(i)for(let o=0;o<n.length;o++){const r=i.getComputedStyle(t,null);if((r?r.getPropertyValue(e):null)===n[o])return!0}}return!1}},qo=e=>jo(e)&&e.hasAttribute("data-mce-bogus"),Wo=e=>jo(e)&&"TABLE"===e.tagName,Vo=e=>t=>{if(Bo(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},Ko=Uo(["textarea","input"]),Go=Fo(3),Xo=Fo(4),Yo=Fo(7),Qo=Fo(8),Jo=Fo(9),Zo=Fo(11),er=Ho("br"),tr=Ho("img"),nr=Ho("a"),ir=Vo("true"),or=Vo("false"),rr=e=>Bo(e)&&e.isContentEditable&&x(e.parentElement)&&!e.parentElement.isContentEditable,sr=Uo(["td","th"]),ar=Uo(["td","th","caption"]),lr=Uo(["video","audio","object","embed"]),cr=Ho("li"),dr=Ho("details"),hr=Ho("summary"),ur={skipBogus:!0,includeZwsp:!1,checkRootAsContent:!1},pr=(e,t,n,i)=>w(i.isContent)&&i.isContent(t)||((e,t)=>jo(e)&&Ce(t.getNonEmptyElements(),e.nodeName))(t,e)||(e=>jo(e)&&e.hasAttribute("data-mce-bookmark"))(t)||(e=>jo(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id")))(t)||((e,t,n,i)=>Go(e)&&!((e,t,n)=>Ro(e.data)&&!((e,t,n)=>{const i=hn(t),o=hn(e),r=n.getWhitespaceElements();return go(o,(e=>Ce(r,wn(e))),D(bn,i))})(e,t,n))(e,t,n)&&(!i.includeZwsp||!(e=>{for(const t of e)if(!lt(t))return!1;return!0})(e.data)))(t,n,e,i)||or(t)||ir(t)&&(e=>Rn(hn(e)).exists((e=>!ho(e))))(t),fr=(e,t,n)=>{const i={...ur,...n};if(i.checkRootAsContent&&pr(e,t,t,i))return!1;let o=t.firstChild,r=0;if(!o)return!0;const s=new Po(o,t);do{if(i.skipBogus&&jo(o)){const e=o.getAttribute("data-mce-bogus");if(e){o=s.next("all"===e);continue}}if(Qo(o))o=s.next(!0);else if(er(o))r++,o=s.next();else{if(pr(e,o,t,i))return!1;o=s.next()}}while(o);return r<=1},mr=(e,t,n)=>fr(e,t.dom,{checkRootAsContent:!0,...n}),gr=(e,t,n)=>pr(e,t,t,{includeZwsp:ur.includeZwsp,...n}),vr=e=>{const t=e.toLowerCase();return"svg"===t?"svg":"math"===t?"math":"html"},br=e=>"html"!==vr(e),yr=e=>br(e.nodeName),xr=e=>vr(e.nodeName),wr=["svg","math"],_r="data-mce-block",kr=e=>q((e=>G(pe(e),(e=>!/[A-Z]/.test(e))))(e),(e=>{const t=CSS.escape(e);return`${t}:`+q(wr,(e=>`not(${e} ${t})`)).join(":")})).join(","),Cr=(e,t)=>x(t.querySelector(e))?(t.setAttribute(_r,"true"),"inline-boundary"===t.getAttribute("data-mce-selected")&&t.removeAttribute("data-mce-selected"),!0):(t.removeAttribute(_r),!1),Sr=(e,t)=>{const n=kr(e.getTransparentElements()),i=kr(e.getBlockElements());return G(t.querySelectorAll(n),(e=>Cr(i,e)))},Tr=(e,t,n)=>{var i;const o=n?"lastChild":"firstChild";for(let n=t[o];n;n=n[o])if(fr(e,n,{checkRootAsContent:!0}))return void(null===(i=n.parentNode)||void 0===i||i.removeChild(n))},Er=(e,t)=>{const n=Sr(e,t);((e,t,n)=>{const i=e.getBlockElements(),o=hn(t),r=e=>wn(e)in i,s=e=>bn(e,o);W(ki(n),(t=>{Yi(t,r,s).each((n=>{const i=(t=>G(Bn(t),(t=>r(t)&&!e.isValidChild(wn(n),wn(t)))))(t);if(i.length>0){const t=Rn(n);W(i,(t=>{Yi(t,r,s).each((n=>{((e,t,n)=>{const i=document.createRange(),o=t.parentNode;if(o){i.setStartBefore(t),i.setEndBefore(n);const r=i.extractContents();Tr(e,r,!0),i.setStartAfter(n),i.setEndAfter(t);const s=i.extractContents();Tr(e,s,!1),fr(e,r,{checkRootAsContent:!0})||o.insertBefore(r,t),fr(e,n,{checkRootAsContent:!0})||o.insertBefore(n,t),fr(e,s,{checkRootAsContent:!0})||o.insertBefore(s,t),o.removeChild(t)}})(e,n.dom,t.dom)}))})),t.each((t=>Sr(e,t.dom)))}}))}))})(e,t,n),((e,t,n)=>{W([...n,...Pr(e,t)?[t]:[]],(t=>W(mo(hn(t),t.nodeName.toLowerCase()),(t=>{Mr(e,t.dom)&&yi(t)}))))})(e,t,n)},Ar=(e,t)=>{if(Ir(e,t)){const n=kr(e.getBlockElements());Cr(n,t)}},Or=e=>e.hasAttribute(_r),Dr=(e,t)=>Ce(e.getTransparentElements(),t),Ir=(e,t)=>jo(t)&&Dr(e,t.nodeName),Pr=(e,t)=>Ir(e,t)&&Or(t),Mr=(e,t)=>Ir(e,t)&&!Or(t),Rr=(e,t)=>1===t.type&&Dr(e,t.name)&&u(t.attr(_r)),zr=Kt().browser,Nr=e=>J(e,Sn),Fr=(e,t)=>e.children&&U(e.children,t),Lr=(e,t={})=>{let n=0;const i={},o=hn(e),r=In(o),s=e=>{si(Kn(o),e)},a=e=>{const t=Kn(o);eo(t,"#"+e).each(bi)},l=e=>ke(i,e).getOrThunk((()=>({id:"mce-u"+n++,passed:[],failed:[],count:0}))),c=e=>new Promise(((n,o)=>{let a;const c=sn._addCacheSuffix(e),d=l(c);i[c]=d,d.count++;const h=(e,t)=>{W(e,R),d.status=t,d.passed=[],d.failed=[],a&&(a.onload=null,a.onerror=null,a=null)},u=()=>h(d.passed,2),p=()=>h(d.failed,3);if(n&&d.passed.push(n),o&&d.failed.push(o),1===d.status)return;if(2===d.status)return void u();if(3===d.status)return void p();d.status=1;const f=cn("link",r.dom);hi(f,{rel:"stylesheet",type:"text/css",id:d.id}),t.contentCssCors&&di(f,"crossOrigin","anonymous"),t.referrerPolicy&&di(f,"referrerpolicy",t.referrerPolicy),a=f.dom,a.onload=u,a.onerror=p,s(f),di(f,"href",c)})),d=e=>{const t=sn._addCacheSuffix(e);ke(i,t).each((e=>{0==--e.count&&(delete i[t],a(e.id))}))};return{load:c,loadRawCss:(e,t)=>{const n=l(e);i[e]=n,n.count++;const o=cn("style",r.dom);hi(o,{rel:"stylesheet",type:"text/css",id:n.id,"data-mce-key":e}),o.dom.innerHTML=t,s(o)},loadAll:e=>Promise.allSettled(q(e,(e=>c(e).then(E(e))))).then((e=>{const t=K(e,(e=>"fulfilled"===e.status));return t.fail.length>0?Promise.reject(q(t.fail,(e=>e.reason))):q(t.pass,(e=>e.value))})),unload:d,unloadRawCss:e=>{ke(i,e).each((t=>{0==--t.count&&(delete i[e],a(t.id))}))},unloadAll:e=>{W(e,(e=>{d(e)}))},_setReferrerPolicy:e=>{t.referrerPolicy=e},_setContentCssCors:e=>{t.contentCssCors=e}}},jr=(()=>{const e=new WeakMap;return{forElement:(t,n)=>{const i=Vn(t).dom;return F.from(e.get(i)).getOrThunk((()=>{const t=Lr(i,n);return e.set(i,t),t}))}}})(),Br=(e,t)=>x(e)&&(gr(t,e)||t.isInline(e.nodeName.toLowerCase())),Hr=e=>(e=>"span"===e.nodeName.toLowerCase())(e)&&"bookmark"===e.getAttribute("data-mce-type"),Ur=(e,t,n,i)=>{var o;const r=i||t;if(jo(t)&&Hr(t))return t;const s=t.childNodes;for(let t=s.length-1;t>=0;t--)Ur(e,s[t],n,r);if(jo(t)){const e=t.childNodes;1===e.length&&Hr(e[0])&&(null===(o=t.parentNode)||void 0===o||o.insertBefore(e[0],t))}return(e=>Zo(e)||Jo(e))(t)||gr(n,t)||(e=>!!jo(e)&&e.childNodes.length>0)(t)||((e,t,n)=>Go(e)&&e.data.length>0&&((e,t,n)=>{const i=new Po(e,t).prev(!1),o=new Po(e,t).next(!1),r=b(i)||Br(i,n),s=b(o)||Br(o,n);return r&&s})(e,t,n))(t,r,n)||e.remove(t),t},$r=sn.makeMap,qr=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wr=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Vr=/[<>&\"\']/g,Kr=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Gr={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},Xr={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},Yr={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},Qr=(e,t)=>{const n={};if(e){const i=e.split(",");t=t||10;for(let e=0;e<i.length;e+=2){const o=String.fromCharCode(parseInt(i[e],t));if(!Xr[o]){const t="&"+i[e+1]+";";n[o]=t,n[t]=o}}return n}},Jr=Qr("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8
135k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),Zr=(e,t)=>e.replace(t?qr:Wr,(e=>Xr[e]||e)),es=(e,t)=>e.replace(t?qr:Wr,(e=>e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":Xr[e]||"&#"+e.charCodeAt(0)+";")),ts=(e,t,n)=>{const i=n||Jr;return e.replace(t?qr:Wr,(e=>Xr[e]||i[e]||e))},ns={encodeRaw:Zr,encodeAllRaw:e=>(""+e).replace(Vr,(e=>Xr[e]||e)),encodeNumeric:es,encodeNamed:ts,getEncodeFunc:(e,t)=>{const n=Qr(t)||Jr,i=$r(e.replace(/\+/g,","));return i.named&&i.numeric?(e,t)=>e.replace(t?qr:Wr,(e=>void 0!==Xr[e]?Xr[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";")):i.named?t?(e,t)=>ts(e,t,n):ts:i.numeric?es:Zr},decode:e=>e.replace(Kr,((e,t)=>t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Gr[t]||String.fromCharCode(t):Yr[e]||Jr[e]||(e=>{const t=cn("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e})(e)))},is=(e,t)=>(e=sn.trim(e))?e.split(t||" "):[],os=e=>new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$"),rs=e=>Object.freeze(["id","accesskey","class","dir","lang","style","tabindex","title","role",..."html4"!==e?["contenteditable","contextmenu","draggable","dropzone","hidden","spellcheck","translate","itemprop","itemscope","itemtype"]:[],..."html5-strict"!==e?["xml:lang"]:[]]),ss=e=>{let t,n;t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(t+=" article aside details dialog figure main header footer hgroup section nav a ins del canvas map",n+=" audio canvas command data datalist mark meter output picture progress time wbr video ruby bdi keygen svg"),"html5-strict"!==e&&(n=[n,"acronym applet basefont big font strike tt"].join(" "),t=[t,"center dir isindex noframes"].join(" "));const i=[t,n].join(" ");return{blockContent:t,phrasingContent:n,flowContent:i}},as=e=>{const{blockContent:t,phrasingContent:n,flowContent:i}=ss(e),o=e=>Object.freeze(e.split(" "));return Object.freeze({blockContent:o(t),phrasingContent:o(n),flowContent:o(i)})},ls={html4:rt((()=>as("html4"))),html5:rt((()=>as("html5"))),"html5-strict":rt((()=>as("html5-strict")))},cs=(e,t)=>{const{blockContent:n,phrasingContent:i,flowContent:o}=ls[e]();return"blocks"===t?F.some(n):"phrasing"===t?F.some(i):"flow"===t?F.some(o):F.none()},ds=e=>F.from(/^(@?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)$/.exec(e)).map((e=>({preset:"@"===e[1],name:e[2]}))),hs={},us=sn.makeMap,ps=sn.each,fs=sn.extend,ms=sn.explode,gs=(e,t={})=>{const n=us(e," ",us(e.toUpperCase()," "));return fs(n,t)},vs=e=>gs("td th li dt dd figcaption caption details summary",e.getTextBlockElements()),bs=(e,t)=>{if(e){const n={};return u(e)&&(e={"*":e}),ps(e,((e,i)=>{n[i]=n[i.toUpperCase()]="map"===t?us(e,/[, ]/):ms(e,/[, ]/)})),n}},ys=(e={})=>{var t;const n={},i={};let o=[];const r={},s={},a=(t,n,i)=>{const o=e[t];if(o)return us(o,/[, ]/,us(o.toUpperCase(),/[, ]/));{let e=hs[t];return e||(e=gs(n,i),hs[t]=e),e}},l=null!==(t=e.schema)&&void 0!==t?t:"html5",c=(e=>{const t=rs(e),{phrasingContent:n,flowContent:i}=ss(e),o={},r=(e,t,n)=>{o[e]={attributes:re(t,E({})),attributesOrder:t,children:re(n,E({}))}},s=(e,n="",i="")=>{const o=is(i),s=is(e);let a=s.length;const l=[...t,...is(n)];for(;a--;)r(s[a],l.slice(),o)},a=(e,t)=>{const n=is(e),i=is(t);let r=n.length;for(;r--;){const e=o[n[r]];for(let t=0,n=i.length;t<n;t++)e.attributes[i[t]]={},e.attributesOrder.push(i[t])}};return"html5-strict"!==e&&(W(is("acronym applet basefont big font strike tt"),(e=>{s(e,"",n)})),W(is("center dir isindex noframes"),(e=>{s(e,"",i)}))),s("html","manifest","head body"),s("head","","base command link meta noscript script style title"),s("title hr noscript br"),s("base","href target"),s("link","href rel media hreflang type sizes hreflang"),s("meta","name http-equiv content charset"),s("style","media type scoped"),s("script","src async defer type charset"),s("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",i),s("dd div","",i),s("address dt caption","","html4"===e?n:i),s("h1 h2 h3 h4 h5 h6 pre p abbr co
135de var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",n),s("blockquote","cite",i),s("ol","reversed start type","li"),s("ul","","li"),s("li","value",i),s("dl","","dt dd"),s("a","href target rel media hreflang type","html4"===e?n:i),s("q","cite",n),s("ins del","cite datetime",i),s("img","src sizes srcset alt usemap ismap width height"),s("iframe","src name width height",i),s("embed","src type width height"),s("object","data type typemustmatch name usemap form width height",[i,"param"].join(" ")),s("param","name value"),s("map","name",[i,"area"].join(" ")),s("area","alt coords shape href target rel media hreflang type"),s("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),s("colgroup","span","col"),s("col","span"),s("tbody thead tfoot","","tr"),s("tr","","td th"),s("td","colspan rowspan headers",i),s("th","colspan rowspan headers scope abbr",i),s("form","accept-charset action autocomplete enctype method name novalidate target",i),s("fieldset","disabled form name",[i,"legend"].join(" ")),s("label","form for",n),s("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),s("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?i:n),s("select","disabled form multiple name required size","option optgroup"),s("optgroup","disabled label","option"),s("option","disabled label selected value"),s("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),s("menu","type label",[i,"li"].join(" ")),s("noscript","",i),"html4"!==e&&(s("wbr"),s("ruby","",[n,"rt rp"].join(" ")),s("figcaption","",i),s("mark rt rp bdi","",n),s("summary","",[n,"h1 h2 h3 h4 h5 h6"].join(" ")),s("canvas","width height",i),s("data","value",n),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[i,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[i,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[n,"option"].join(" ")),s("article section nav aside main header footer","",i),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[i,"figcaption"].join(" ")),s("time","datetime",n),s("dialog","open",i),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",n),s("progress","value max",n),s("meter","value min max low high optimum",n),s("details","open",[i,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name"),r("svg","id tabindex lang xml:space class style x y width height viewBox preserveAspectRatio zoomAndPan transform".split(" "),[])),"html5-strict"!==e&&(a("script","language xml:space"),a("style","xml:space"),a("object","declare classid code codebase codetype archive standby align border hspace vspace"),a("embed","align name hspace vspace"),a("param","valuetype type"),a("a","charset name rev shape coords"),a("br","clear"),a("applet","codebase archive code object alt name width height align hspace vspace"),a("img","name longdesc align border hspace vspace"),a("iframe","longdesc frameborder marginwidth marginheight scrolling align"),a("font basefont","size color face"),a("input","usemap align"),a("select"),a("textarea"),a("h1 h2 h3 h4 h5 h6 div p legend caption","align"),a("ul","type compact"),a("li","type"),a("ol dl menu dir","compact"),a("pre","width xml:space"),a("hr","align noshade size width"),a("isindex","prompt"),a("table","summary width frame rules cellspacing cellpadding align bgcolor"),a("col","width align char charoff valign"),a("colgroup","width align char charoff valign"),a("thead","align char charoff valign"),a("tr","align char charoff valign bgcolor"),a("th","axis align char charoff valign nowrap bgcolor width height"),a("form","accept"),a("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),a("tfoot","align char charoff valign"),a("tbody","align char charoff valign"),a("area","nohref"),a("body","background bgcolor text link vlink alink")),"html4"!==e&&(a("input button select textarea","autofocus"),a("input textarea","placeholder"),a("a","download"),a("link script img","crossorigin"),a("img","loading"),a("iframe","sandbox seamless allow allowfullscreen loading referrerpolicy")),"html4"!==e&&W([o.video,o.audio],(e=>{delete e.children.audio,delete e.children.video})),W(is("a form meter progress dfn"),(e=>{o[e]&&delete o[e].children[e]})),delete o.caption.children.table,delete o.script,o})(l);!1===e.verify_html&&(e.valid_elements="*[*]");const d=bs(e.valid_styles),h=bs(e.invalid_styles,"map"),f=bs(e.valid_classes,"map"),g=a("whitespace_elements","pre script noscript style textarea video audio iframe object c
135ode"),b=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),y=a("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),x=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),w="td th iframe video audio object script code",_=a("non_empty_elements",w+" pre svg textarea summary",y),k=a("move_caret_before_on_enter_elements",w+" table",y),C="h1 h2 h3 h4 h5 h6",S=a("text_block_elements",C+" p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),T=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary html body multicol listing",S),A=a("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),O=a("transparent_elements","a ins del canvas map"),D=a("wrap_block_elements","pre "+C);ps("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),(e=>{s[e]=new RegExp("</"+e+"[^>]*>","gi")}));const I=e=>{const t=F.from(n["@"]),i=/[*?+]/;W(((e,t)=>{const n=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return te(is(t,","),(t=>{const i=n.exec(t);if(i){const t=i[1],n=i[2],o=i[3],r=i[4],s=i[5],a={attributes:{},attributesOrder:[]};if(e.each((e=>((e,t)=>{me(e.attributes,((e,n)=>{t.attributes[n]=e})),t.attributesOrder.push(...e.attributesOrder)}
vendor: 11,389 bytes, line 135
135)(e,a))),"#"===t?a.paddEmpty=!0:"-"===t&&(a.removeEmpty=!0),"!"===r&&(a.removeEmptyAttrs=!0),s&&((e,t)=>{const n=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,i=/[*?+]/,{attributes:o,attributesOrder:r}=t;W(is(e,"|"),(e=>{const s=n.exec(e);if(s){const e={},n=s[1],a=s[2].replace(/[\\:]:/g,":"),l=s[3],c=s[4];if("!"===n&&(t.attributesRequired=t.attributesRequired||[],t.attributesRequired.push(a),e.required=!0),"-"===n)return delete o[a],void r.splice(sn.inArray(r,a),1);if(l&&("="===l?(t.attributesDefault=t.attributesDefault||[],t.attributesDefault.push({name:a,value:c}),e.defaultValue=c):"~"===l?(t.attributesForced=t.attributesForced||[],t.attributesForced.push({name:a,value:c}),e.forcedValue=c):"<"===l&&(e.validValues=sn.makeMap(c,"?"))),i.test(a)){const n=e;t.attributePatterns=t.attributePatterns||[],n.pattern=os(a),t.attributePatterns.push(n)}else o[a]||r.push(a),o[a]=e}}))})(s,a),o&&(a.outputName=n),"@"===n){if(!e.isNone())return[];e=F.some(a)}return[o?{name:n,element:a,aliasName:o}:{name:n,element:a}]}return[]}))})(t,null!=e?e:""),(({name:e,element:t,aliasName:r})=>{if(r&&(n[r]=t),i.test(e)){const n=t;n.pattern=os(e),o.push(n)}else n[e]=t}))},P=e=>{o=[],W(pe(n),(e=>{delete n[e]})),I(e)},M=(e,t)=>{var o,s;delete hs.text_block_elements,delete hs.block_elements;const a=!!t.extends&&!ie(t.extends),c=t.extends;if(i[e]=c?i[c]:{},r[e]=null!=c?c:e,_[e.toUpperCase()]={},_[e]={},a||(T[e.toUpperCase()]={},T[e]={}),c&&!n[e]&&n[c]){const t=(e=>{const t=e=>m(e)?q(e,t):(e=>p(e)&&e.source&&"[object RegExp]"===Object.prototype.toString.call(e))(e)?new RegExp(e.source,e.flags):p(e)?ge(e,t):e;return t(e)})(n[c]);delete t.removeEmptyAttrs,delete t.removeEmpty,n[e]=t}else n[e]={attributesOrder:[],attributes:{}};if(m(t.attributes)){const i=e=>{r.attributesOrder.push(e),r.attributes[e]={}},r=null!==(o=n[e])&&void 0!==o?o:{};delete r.attributesDefault,delete r.attributesForced,delete r.attributePatterns,delete r.attributesRequired,r.attributesOrder=[],r.attributes={},W(t.attributes,(e=>{const t=rs(l);ds(e).each((({preset:e,name:n})=>{e?"global"===n&&W(t,i):i(n)}))})),n[e]=r}if(v(t.padEmpty)){const i=null!==(s=n[e])&&void 0!==s?s:{};i.paddEmpty=t.padEmpty,n[e]=i}if(m(t.children)){const n={},o=e=>{n[e]={}},r=e=>{cs(l,e).each((e=>{W(e,o)}))};W(t.children,(e=>{ds(e).each((({preset:e,name:t})=>{e?r(t):o(t)}))})),i[e]=n}c&&me(i,((t,n)=>{t[c]&&(i[n]=t=fs({},i[n]),t[e]=t[c])}))},R=e=>{p(e)?me(e,((e,t)=>M(t,e))):u(e)&&(e=>{W((e=>{const t=/^(~)?(.+)$/;return te(is(e,","),(e=>{const n=t.exec(e);return n?[{cloneName:"~"===n[1]?"span":"div",name:n[2]}]:[]}))})(null!=e?e:""),(({name:e,cloneName:t})=>{M(e,{extends:t})}))})(e)},z=e=>{W((e=>{const t=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return te(is(e,","),(e=>{const n=t.exec(e);if(n){const e=n[1];return[{operation:e?(e=>"-"===e?"remove":"add")(e):"replace",name:n[2],validChildren:te(is(n[3],"|"),(e=>ds(e).toArray()))}]}return[]}))})(null!=e?e:""),(({operation:e,name:t,validChildren:n})=>{const o="replace"===e?{"#comment":{}}:i[t],r=t=>{"remove"===e?delete o[t]:o[t]={}};W(n,(({preset:e,name:t})=>{e?(e=>{cs(l,e).each((e=>{W(e,r)}))})(t):r(t)})),i[t]=o}))},N=e=>{const t=n[e];if(t)return t;let i=o.length;for(;i--;){const t=o[i];if(t.pattern.test(e))return t}},L=E(d),j=E(h),B=E(f),H=E(x),U=E(T),$=E(S),V=E(A),K=E(Object.seal(y)),G=E(b),X=E(_),Y=E(k),Q=E(g),J=E(O),Z=E(D),ee=E(Object.seal(s)),ne=(e,t)=>{const n=N(e);if(n){if(!t)return!0;{if(n.attributes[t])return!0;const e=n.attributePatterns;if(e){let n=e.length;for(;n--;)if(e[n].pattern.test(t))return!0}}}return!1},ie=e=>Ce(U(),e),oe=e=>!Ge(e,"#")&&ne(e)&&!ie(e),se=E(r);return e.valid_elements?(P(e.valid_elements),ps(c,((e,t)=>{i[t]=e.children}))):(ps(c,((e,t)=>{n[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},i[t]=e.children})),ps(is("strong/b em/i"),(e=>{const t=is(e,"/");n[t[1]].outputName=t[0]})),ps(A,((t,i)=>{n[i]&&(e.padd_empty_block_inline_children&&(n[i].paddInEmptyBlock=!0),n[i].removeEmpty=!0)})),ps(is("ol ul blockquote a table tbody"),(e=>{n[e]&&(n[e].removeEmpty=!0)})),ps(is("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),(e=>{n[e]&&(n[e].paddEmpty=!0)})),ps(is("span"),(e=>{n[e].removeEmptyAttrs=!0}))),delete n.svg,R(e.custom_elements),z(e.valid_children),I(e.extended_valid_elements),z("+ol[ul|ol],+ul[ul|ol]"),ps({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},((e,t)=>{n[t]&&(n[t].parentsRequired=is(e))})),e.invalid_elements&&ps(ms(e.invalid_elements),(e=>{n[e]&&delete n[e]})),N("span")||I("span[!data-mce-type|*]"),{type:l,children:i,elements:n,getValidStyles:L,getValidClasses:B,getBlockElements:U,getInvalidStyles:j,getVoidElements:K,getTextBlockElements:$,getTextInlineElements:V,getBoolAttrs:H,getElementRule:N,getSelfClosingElements:G,getNonEmptyElements:X,getMoveCaretBeforeOnEnterElements:Y,getWhitespaceElements:Q,getTransparentElements:J,getSpecialElements:ee,isValidChild:(e,t)=>{const n=i[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:ne,isBlock:ie,isInline:oe,isWrapper:e=>Ce(Z(),e)||oe(e),getCustomElements:se,addValidElements:I,setValidElements:P,addCustomElements:R,addValidChildren:z}},xs=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},ws=e=>(e=>{return{value:(t=e,Ve(t,"#").toUpperCase())};var t})(xs(e.red)+xs(e.green)+xs(e.blue)),_s=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,ks=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,Cs=(e,t,n,i)=>((e,t,n,i)=>({red:e,green:t,blue:n,alpha:i}))(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseFloat(i)),Ss=e=>{const t=_s.exec(e);if(null!==t)return F.some(Cs(t[1],t[2],t[3],"1"));const n=ks.exec(e);return null!==n?F.some(Cs(n[1],n[2],n[3],n[4])):F.none()},Ts=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,Es=e=>Ss(e).map(ws).map((e=>"#"+e.value)).getOr(e),As=(e={},t)=>{const n=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,i=/\s*([^:]+):\s*([^;]+);?/g,o=/\s+$/,r={};let s,a;t&&(s=t.getValidStyles(),a=t.getInvalidStyles());const l="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(let e=0;e<l.length;e++)r[l[e]]="\ufeff"+e,r["\ufeff"+e]=l[e];const c={parse:t=>{const s={};let a=!1;const l=e.url_converter,d=e.url_converter_scope||c,h=(e,t,n)=>{const i=s[e+"-top"+t];if(!i)return;const o=s[e+"-right"+t];if(!o)return;const r=s[e+"-bottom"+t];if(!r)return;const a=s[e+"-left"+t];if(!a)return;const l=[i,o,r,a];let c=l.length-1;for(;c--&&l[c]===l[c+1];);c>-1&&n||(s[e+t]=-1===c?l[0]:l.join(" "),delete s[e+"-top"+t],delete s[e+"-right"+t],delete s[e+"-bottom"+t],delete s[e+"-left"+t])},u=e=>{const t=s[e];if(!t)return;const n=t.indexOf(",")>-1?[t]:t.split(" ");let i=n.length;for(;i--;)if(n[i]!==n[0])return!1;return s[e]=n[0],!0},p=e=>(a=!0,r[e]),f=(e,t)=>(a&&(e=e.replace(/\uFEFF[0-9]/g,(e=>r[e]))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e),m=e=>String.fromCharCode(parseInt(e.slice(1),16)),g=e=>e.replace(/\\[0-9a-f]+/gi,m),v=(t,n,i,o,r,s)=>{if(r=r||s)return"'"+(r=f(r)).replace(/\'/g,"\\'")+"'";if(n=f(n||i||o||""),!e.allow_script_urls){const t=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(t))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(t))return""}return l&&(n=l.call(d,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){let r;for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,p).replace(/\"[^\"]+\"|\'[^\']+\'/g,(e=>e.replace(/[;:]/g,p)));r=i.exec(t);){i.lastIndex=r.index+r[0].length;let t=r[1].replace(o,"").toLowerCase(),l=r[2].replace(o,"");if(t&&l){if(t=g(t),l=g(l),-1!==t.indexOf("\ufeff")||-1!==t.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===t||/expression\s*\(|\/\*|\*\//.test(l)))continue;"font-weight"===t&&"700"===l?l="bold":"color"!==t&&"background-color"!==t||(l=l.toLowerCase()),"rgb"==(w=l,_s.test(w)?"rgb":ks.test(w)?"rgba":"other")&&Ss(l).each((e=>{l=Es(Ts(e)).toLowerCase()})),l=l.replace(n,v),s[t]=a?f(l,!0):l}}h("border","",!0),h("border","-width"),h("border","-color"),h("border","-style"),h("padding",""),h("margin",""),y="border-style",x="border-color",u(b="border-width")&&u(y)&&u(x)&&(s.border=s[b]+" "+s[y]+" "+s[x],delete s[b],delete s[y],delete s[x]),"medium none"===s.border&&delete s.border,"none"===s["border-image"]&&delete s["border-image"]}var b,y,x,w;return s},serialize:(e,t)=>{let n="";const i=(t,i)=>{const o=i[t];if(o)for(let t=0,i=o.length;t<i;t++){const i=o[t],r=e[i];r&&(n+=(n.length>0?" ":"")+i+": "+r+";")}};return t&&s?(i("*",s),i(t,s)):me(e,((e,i)=>{e&&((e,t)=>{if(!a||!t)return!0;let n=a["*"];return!(n&&n[e]||(n=a[t],n&&n[e]))})(i,t)&&(n+=(n.length>0?" ":"")+i+": "+e+";")})),n}};return c},Os={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Ds=(e,t)=>{const n=null!=t?t:{};for(const t in e)Ce(Os,t)||(n[t]=e[t]);return x(e.composedPath)&&(n.composedPath=()=>e.composedPath()),x(e.getModifierState)&&(n.getModifierState=t=>e.getModifierState(t)),x(e.getTargetRanges)&&(n.getTargetRanges=()=>e.getTargetRanges()),n},Is=(e,t,n,i)=>{var o;const r=Ds(t,i);return r.type=e,y(r.target)&&(r.target=null!==(o=r.srcElement)&&void 0!==o?o:n),(e=>y(e.preventDefault)||(e=>e instanceof Event||w(e.initEvent))(e))(t)&&(r.preventDefault=()=>{r.defaultPrevented=!0,r.isDefaultPrevented=N,w(t.preventDefault)&&t.preventDefault()},r.stopPropagation=()=>{r.cancelBubble=!0,r.isPropagationStopped=N,w(t.stopPropagation)&&t.stopPropagation()},r.stopImmediatePropagation=()=>{r.isImmediatePropagationStopped=N,r.stopPropagation()},(e=>e.isDefaultPrevented===N||e.isDefaultPrevented===z)(r)||(r.isDefaultPrevented=!0===r.defaultPrevented?N:z,r.isPropagationStopped=!0===r.cancelBubble?N:z,r.isImmediatePropagationStopped=z)),r},Ps=/^(?:mouse|contextmenu)|click/,Ms=(e,t,n,i)=>{e.addEventListener(t,n,i||!1)},Rs=(e,t,n,i)=>{e.removeEventListener(t,n,i||!1)},zs=(e,t)=>{const n=Is(e.type,e,document,t);if((e=>x(e)&&Ps.test(e.type))(e)&&b(e.pageX)&&!b(e.clientX)){const t=n.target.ownerDocument||document,i=t.documentElement,o=t.body,r=n;r.pageX=e.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),r.pageY=e.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)}return n},Ns=(e,t,n)=>{const i=e.document,o={type:"ready"};if(n.domLoaded)return void t(o);const r=()=>{Rs(e,"DOMContentLoaded",r),Rs(e,"load",r),n.domLoaded||(n.domLoaded=!0,t(o)),e=null};"complete"===i.readyState||"interactive"===i.readyState&&i.body?r():Ms(e,"DOMContentLoaded",r),n.domLoaded||Ms(e,"load",r)};class Fs{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(e,t,n,i){const o=this;let r;const s=window,a=e=>{o.executeHandlers(zs(e||s.event),l)};if(!e||Go(e)||Qo(e))return n;let l;e[o.expando]?l=e[o.expando]:(l=o.count++,e[o.expando]=l,o.events[l]={}),i=i||e;const c=t.split(" ");let d=c.length;for(;d--;){let t=c[d],h=a,u=!1,p=!1;"DOMContentLoaded"===t&&(t="ready"),o.domLoaded&&"ready"===t&&"complete"===e.readyState?n.call(i,zs({type:t}
vendor: 12,453 bytes, line 135
135)):(o.hasFocusIn||"focusin"!==t&&"focusout"!==t||(u=!0,p="focusin"===t?"focus":"blur",h=e=>{const t=zs(e||s.event);t.type="focus"===t.type?"focusin":"focusout",o.executeHandlers(t,l)}),r=o.events[l][t],r?"ready"===t&&o.domLoaded?n(zs({type:t})):r.push({func:n,scope:i}):(o.events[l][t]=r=[{func:n,scope:i}],r.fakeName=p,r.capture=u,r.nativeHandler=h,"ready"===t?Ns(e,h,o):Ms(e,p||t,h,u)))}return e=r=null,n}unbind(e,t,n){if(!e||Go(e)||Qo(e))return this;const i=e[this.expando];if(i){let o=this.events[i];if(t){const i=t.split(" ");let r=i.length;for(;r--;){const t=i[r],s=o[t];if(s){if(n){let e=s.length;for(;e--;)if(s[e].func===n){const n=s.nativeHandler,i=s.fakeName,r=s.capture,a=s.slice(0,e).concat(s.slice(e+1));a.nativeHandler=n,a.fakeName=i,a.capture=r,o[t]=a}}n&&0!==s.length||(delete o[t],Rs(e,s.fakeName||t,s.nativeHandler,s.capture))}}}else me(o,((t,n)=>{Rs(e,t.fakeName||n,t.nativeHandler,t.capture)})),o={};for(const e in o)if(Ce(o,e))return this;delete this.events[i];try{delete e[this.expando]}catch(t){e[this.expando]=null}}return this}fire(e,t,n){return this.dispatch(e,t,n)}dispatch(e,t,n){if(!e||Go(e)||Qo(e))return this;const i=zs({type:t,target:e},n);do{const t=e[this.expando];t&&this.executeHandlers(i,t),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!i.isPropagationStopped());return this}clean(e){if(!e||Go(e)||Qo(e))return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName){this.unbind(e);const t=e.getElementsByTagName("*");let n=t.length;for(;n--;)(e=t[n])[this.expando]&&this.unbind(e)}return this}destroy(){this.events={}}cancel(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}executeHandlers(e,t){const n=this.events[t],i=n&&n[e.type];if(i)for(let t=0,n=i.length;t<n;t++){const n=i[t];if(n&&!1===n.func.call(n.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}}}Fs.Event=new Fs;const Ls=sn.each,js=sn.grep,Bs="data-mce-style",Hs=sn.makeMap("fill-opacity font-weight line-height opacity orphans widows z-index zoom"," "),Us=(e,t,n)=>{y(n)||""===n?mi(e,t):di(e,t,n)},$s=e=>e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),qs=(e,t)=>{let n=0;if(e)for(let i=e.nodeType,o=e.previousSibling;o;o=o.previousSibling){const e=o.nodeType;(!t||!Go(o)||e!==i&&o.data.length)&&(n++,i=e)}return n},Ws=(e,t)=>{const n=ui(t,"style"),i=e.serialize(e.parse(n),wn(t));Us(t,Bs,i)},Vs=(e,t,n)=>{const i=$s(t);y(n)||""===n?zi(e,i):Oi(e,i,((e,t)=>_(e)?Ce(Hs,t)?e+"":e+"px":e)(n,i))},Ks=(e,t={})=>{const n={},i=window,o={};let r=0;const s=jr.forElement(hn(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),a=[],l=t.schema?t.schema:ys({}),c=As({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),d=t.ownEvents?new Fs:Fs.Event,h=l.getBlockElements(),p=t=>t&&e&&u(t)?e.getElementById(t):t,g=e=>{const t=p(e);return x(t)?hn(t):null},v=(e,t,n="")=>{let i;const o=g(e);if(x(o)&&Sn(o)){const e=X[t];i=e&&e.get?e.get(o.dom,t):ui(o,t)}return x(i)?i:n},b=e=>{const t=p(e);return y(t)?[]:t.attributes},_=(e,n,i)=>{P(e,(e=>{if(jo(e)){const o=hn(e),r=""===i?null:i,s=ui(o,n),a=X[n];a&&a.set?a.set(o.dom,r,n):Us(o,n,r),s!==r&&t.onSetAttrib&&t.onSetAttrib({attrElm:o.dom,attrName:n,attrValue:r})}}))},k=()=>t.root_element||e.body,S=(t,n)=>((e,t,n)=>{let i=0,o=0;const r=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Ii(hn(e),"position")){const n=t.getBoundingClientRect();return i=n.left+(r.documentElement.scrollLeft||e.scrollLeft)-r.documentElement.clientLeft,o=n.top+(r.documentElement.scrollTop||e.scrollTop)-r.documentElement.clientTop,{x:i,y:o}}let s=t;for(;s&&s!==n&&s.nodeType&&!Fr(s,n);){const e=s;i+=e.offsetLeft||0,o+=e.offsetTop||0,s=e.offsetParent}for(s=t.parentNode;s&&s!==n&&s.nodeType&&!Fr(s,n);)i-=s.scrollLeft||0,o-=s.scrollTop||0,s=s.parentNode;o+=(e=>zr.isFirefox()&&"table"===wn(e)?Nr(Bn(e)).filter((e=>"caption"===wn(e))).bind((e=>Nr(jn(e)).map((t=>{const n=t.dom.offsetTop,i=e.dom.offsetTop,o=e.dom.offsetHeight;return n<=i?-o:0})))).getOr(0):0)(hn(t))}return{x:i,y:o}})(e.body,p(t),n),T=(e,t,n)=>{const i=p(e);var o;if(!y(i)&&(Bo(i)||jo(o=i)&&"http://www.w3.org/2000/svg"===o.namespaceURI))return n?Ii(hn(i),$s(t)):("float"===(t=t.replace(/-(\D)/g,((e,t)=>t.toUpperCase())))&&(t="cssFloat"),i.style?i.style[t]:void 0)},A=e=>{const t=p(e);if(!t)return{w:0,h:0};let n=T(t,"width"),i=T(t,"height");return n&&-1!==n.indexOf("px")||(n="0"),i&&-1!==i.indexOf("px")||(i="0"),{w:parseInt(n,10)||t.offsetWidth||t.clientWidth,h:parseInt(i,10)||t.offsetHeight||t.clientHeight}},O=(e,t)=>{if(!e)return!1;const n=m(e)?e:[e];return $(n,(e=>gn(hn(e),t)))},D=(e,t,n,i)=>{const o=[];let r=p(e);i=void 0===i;const s=n||("BODY"!==k().nodeName?k().parentNode:null);if(u(t))if("*"===t)t=jo;else{const e=t;t=t=>O(t,e)}for(;r&&!(r===s||y(r.nodeType)||Jo(r)||Zo(r));){if(!t||t(r)){if(!i)return[r];o.push(r)}r=r.parentNode}return i?o:null},I=(e,t,n)=>{let i=t;if(e){u(t)&&(i=e=>O(e,t));for(let t=e[n];t;t=t[n])if(w(i)&&i(t))return t}return null},P=function(e,t,n){const i=null!=n?n:this;if(m(e)){const n=[];return Ls(e,((e,o)=>{const r=p(e);r&&n.push(t.call(i,r,o))})),n}{const n=p(e);return!!n&&t.call(i,n)}},M=(e,t)=>{P(e,(e=>{me(t,((t,n)=>{_(e,n,t)}))}))},R=(e,t)=>{P(e,(e=>{const n=hn(e);Si(n,t)}))},z=(t,n,i,o,r)=>P(t,(t=>{const s=u(n)?e.createElement(n):n;return x(i)&&M(s,i),o&&(!u(o)&&o.nodeType?s.appendChild(o):u(o)&&R(s,o)),r?s:t.appendChild(s)})),N=(t,n,i)=>z(e.createElement(t),t,n,i,!0),F=ns.encodeAllRaw,L=(e,t)=>P(e,(e=>{const n=hn(e);return t&&W(Bn(n),(e=>{Tn(e)&&0===e.dom.length?bi(e):ii(n,e)})),bi(n),n.dom})),j=(e,t,n)=>{P(e,(e=>{if(jo(e)){const i=hn(e),o=t.split(" ");W(o,(e=>{x(n)?(n?so:lo)(i,e):((e,t)=>{no(e)?e.dom.classList.toggle(t):((e,t)=>{U(io(e),t)?ro(e,t):oo(e,t)})(e,t);ao(e)})(i,e)}))}}))},B=(e,t,n)=>P(t,(i=>{var o;const r=m(t)?e.cloneNode(!0):e;return n&&Ls(js(i.childNodes),(e=>{r.appendChild(e)})),null===(o=i.parentNode)||void 0===o||o.replaceChild(r,i),i})),H=()=>e.createRange(),q=(n,o,r,s)=>{if(m(n)){let e=n.length;const t=[];for(;e--;)t[e]=q(n[e],o,r,s);return t}return!t.collect||n!==e&&n!==i||a.push([n,o,r,s]),d.bind(n,o,r,s||G)},V=(t,n,o)=>{if(m(t)){let e=t.length;const i=[];for(;e--;)i[e]=V(t[e],n,o);return i}if(a.length>0&&(t===e||t===i)){let e=a.length;for(;e--;){const[i,r,s]=a[e];t!==i||n&&n!==r||o&&o!==s||d.unbind(i,r,s)}}return d.unbind(t,n,o)},K=e=>{if(e&&Bo(e)){const t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},G={doc:e,settings:t,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:s,boundEvents:a,styles:c,schema:l,events:d,isBlock:e=>u(e)?Ce(h,e):jo(e)&&(Ce(h,e.nodeName)||Pr(l,e)),root:null,clone:(e,t)=>e.cloneNode(t),getRoot:k,getViewPort:e=>{const t=Io(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:e=>{const t=p(e),n=S(t),i=A(t);return{x:n.x,y:n.y,w:i.w,h:i.h}},getSize:A,getParent:(e,t,n)=>{const i=D(e,t,n,!1);return i&&i.length>0?i[0]:null},getParents:D,get:p,getNext:(e,t)=>I(e,t,"nextSibling"),getPrev:(e,t)=>I(e,t,"previousSibling"),select:(n,i)=>{var o,r;const s=null!==(r=null!==(o=p(i))&&void 0!==o?o:t.root_element)&&void 0!==r?r:e;return w(s.querySelectorAll)?de(s.querySelectorAll(n)):[]},is:O,add:z,create:N,createHTML:(e,t,n="")=>{let i="<"+e;for(const e in t)Se(t,e)&&(i+=" "+e+'="'+F(t[e])+'"');return tt(n)&&Ce(l.getVoidElements(),e)?i+" />":i+">"+n+"</"+e+">"},createFragment:t=>{const n=e.createElement("div"),i=e.createDocumentFragment();let o;for(i.appendChild(n),t&&(n.innerHTML=t);o=n.firstChild;)i.appendChild(o);return i.removeChild(n),i},remove:L,setStyle:(e,n,i)=>{P(e,(e=>{const o=hn(e);Vs(o,n,i),t.update_styles&&Ws(c,o)}))},getStyle:T,setStyles:(e,n)=>{P(e,(e=>{const i=hn(e);me(n,((e,t)=>{Vs(i,t,e)})),t.update_styles&&Ws(c,i)}))},removeAllAttribs:e=>P(e,(e=>{const t=e.attributes;for(let n=t.length-1;n>=0;n--)e.removeAttributeNode(t.item(n))})),setAttrib:_,setAttribs:M,getAttrib:v,getPos:S,parseStyle:e=>c.parse(e),serializeStyle:(e,t)=>c.serialize(e,t),addStyle:t=>{if(G!==Ks.DOM&&e===document){if(n[t])return;n[t]=!0}let i=e.getElementById("mceDefaultStyles");if(!i){i=e.createElement("style"),i.id="mceDefaultStyles",i.type="text/css";const t=e.head;t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)}i.styleSheet?i.styleSheet.cssText+=t:i.appendChild(e.createTextNode(t))},loadCSS:e=>{e||(e=""),W(e.split(","),(e=>{o[e]=!0,s.load(e).catch(C)}))},addClass:(e,t)=>{j(e,t,!0)},removeClass:(e,t)=>{j(e,t,!1)},hasClass:(e,t)=>{const n=g(e),i=t.split(" ");return x(n)&&ne(i,(e=>co(n,e)))},toggleClass:j,show:e=>{P(e,(e=>zi(hn(e),"display")))},hide:e=>{P(e,(e=>Oi(hn(e),"display","none")))},isHidden:e=>{const t=g(e);return x(t)&&Le(Mi(t,"display"),"none")},uniqueId:e=>(e||"mce_")+r++,setHTML:R,getOuterHTML:e=>{const t=g(e);return x(t)?jo(t.dom)?t.dom.outerHTML:(e=>{const t=cn("div"),n=hn(e.dom.cloneNode(!0));return si(t,n),Ci(t)})(t):""},setOuterHTML:(e,t)=>{P(e,(e=>{jo(e)&&(e.outerHTML=t)}))},decode:ns.decode,encode:F,insertAfter:(e,t)=>{const n=p(t);return P(e,(e=>{const t=null==n?void 0:n.parentNode,i=null==n?void 0:n.nextSibling;return t&&(i?t.insertBefore(e,i):t.appendChild(e)),e}))},replace:B,rename:(e,t)=>{if(e.nodeName!==t.toUpperCase()){const n=N(t);return Ls(b(e),(t=>{_(n,t.nodeName,v(e,t.nodeName))})),B(n,e,!0),n}return e},findCommonAncestor:(e,t)=>{let n=e;for(;n;){let e=t;for(;e&&n!==e;)e=e.parentNode;if(n===e)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},run:P,getAttribs:b,isEmpty:(e,t,n)=>{if(f(t)){const i=e=>{const n=e.nodeName.toLowerCase();return Boolean(t[n])};return fr(l,e,{...n,isContent:i})}return fr(l,e,n)},createRng:H,nodeIndex:qs,split:(e,t,n)=>{let i,o,r=H();if(e&&t&&e.parentNode&&t.parentNode){const s=e.parentNode;return r.setStart(s,qs(e)),r.setEnd(t.parentNode,qs(t)),i=r.extractContents(),r=H(),r.setStart(t.parentNode,qs(t)+1),r.setEnd(s,qs(e)+1),o=r.extractContents(),s.insertBefore(Ur(G,i,l),e),n?s.insertBefore(n,e):s.insertBefore(t,e),s.insertBefore(Ur(G,o,l),e),L(e),n||t}},bind:q,unbind:V,fire:(e,t,n)=>d.dispatch(e,t,n),dispatch:(e,t,n)=>d.dispatch(e,t,n),getContentEditable:K,getContentEditableParent:e=>{const t=k();let n=null;for(let i=e;i&&i!==t&&(n=K(i),null===n);i=i.parentNode);return n},isEditable:e=>{if(x(e)){const t=jo(e)?e:e.parentElement;return x(t)&&Bo(t)&&ho(hn(t))}return!1},destroy:()=>{if(a.length>0){let e=a.length;for(;e--;){const[t,n,i]=a[e];d.unbind(t,n,i)}}me(o,((e,t)=>{s.unload(t),delete o[t]}))},isChildOf:(e,t)=>e===t||t.contains(e),dumpRng:e=>"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},X=((e,t,n)=>{const i=t.keep_values,o={set:(e,i,o)=>{const r=hn(e);w(t.url_converter)&&x(i)&&(i=t.url_converter.call(t.url_converter_scope||n(),String(i),o,e)),Us(r,"data-mce-"+o,i),Us(r,o,i)},get:(e,t)=>{const n=hn(e);return ui(n,"data-mce-"+t)||ui(n,t)}},r={style:{set:(t,n)=>{const o=hn(t);i&&Us(o,Bs,n),mi(o,"style"),u(n)&&Di(o,e.parse(n))},get:t=>{const n=hn(t),i=ui(n,Bs)||ui(n,"style");return e.serialize(e.parse(i),wn(n))}}};return i&&(r.href=r.src=o),r})(c,t,E(G));return G};Ks.DOM=Ks(document),Ks.nodeIndex=qs;const Gs=Ks.DOM;class Xs{constructor(e={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=e}_setReferrerPolicy(e){this.settings.referrerPolicy=e}loadScript(e){return new Promise(((t,n)=>{const i=Gs;let o;const r=()=>{i.remove(s),o&&(o.onerror=o.onload=o=null)},s=i.uniqueId();o=document.createElement("script"),o.id=s,o.type="text/javascript",o.src=sn._addCacheSuffix(e),this.settings.referrerPolicy&&i.setAttrib(o,"referrerpolicy",this.settings.referrerPolicy),o.onload=()=>{r(),t()},o.onerror=()=>{r(),n("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(o)}))}isDone(e){return 2===this.states[e]}markDone(e){this.states[e]=2}add(e){const t=this;return t.queue.push(e),void 0===t.states[e]&&(t.states[e]=0),new Promise(((n,i)=>{t.scriptLoadedCallbacks[e]||(t.scriptLoadedCallbacks[e]=[]),t.scriptLoadedCallbacks[e].push({resolve:n,reject:i})}))}load(e){return this.add(e)}remove(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]}loadQueue(){const e=this.queue;return this.queue=[],this.loadScripts(e)}loadScripts(e){const t=this,n=(e,n)=>{ke(t.scriptLoadedCallbacks,n).each((t=>{W(t,(t=>
vendor: 5,023 bytes, line 135
135t[e](n)))})),delete t.scriptLoadedCallbacks[n]},i=e=>{const t=G(e,(e=>"rejected"===e.status));return t.length>0?Promise.reject(te(t,(({reason:e})=>m(e)?e:[e]))):Promise.resolve()},o=e=>Promise.allSettled(q(e,(e=>2===t.states[e]?(n("resolve",e),Promise.resolve()):3===t.states[e]?(n("reject",e),Promise.reject(e)):(t.states[e]=1,t.loadScript(e).then((()=>{t.states[e]=2,n("resolve",e);const r=t.queue;return r.length>0?(t.queue=[],o(r).then(i)):Promise.resolve()}),(()=>(t.states[e]=3,n("reject",e),Promise.reject(e)))))))),r=e=>(t.loading=!0,o(e).then((e=>{t.loading=!1;const n=t.queueLoadedCallbacks.shift();return F.from(n).each(R),i(e)}))),s=ct(e);return t.loading?new Promise(((e,n)=>{t.queueLoadedCallbacks.push((()=>{r(s).then(e,n)}))})):r(s)}}Xs.ScriptLoader=new Xs;const Ys={},Qs=Ee("en"),Js=()=>ke(Ys,Qs.get()),Zs={getData:()=>ge(Ys,(e=>({...e}))),setCode:e=>{e&&Qs.set(e)},getCode:()=>Qs.get(),add:(e,t)=>{let n=Ys[e];n||(Ys[e]=n={});const i=q(pe(t),(e=>e.toLowerCase()));me(t,((e,o)=>{const r=o.toLowerCase();r!==o&&((e,t)=>{const n=e.indexOf(t);return-1!==n&&e.indexOf(t,n+1)>n})(i,r)?(Ce(t,r)||(n[r]=e),n[o]=e):n[r]=e}))},translate:e=>{const t=Js().getOr({}),n=e=>w(e)?Object.prototype.toString.call(e):i(e)?"":""+e,i=e=>""===e||null==e,o=e=>{const i=n(e);return Ce(t,i)?n(t[i]):ke(t,i.toLowerCase()).map(n).getOr(i)},r=e=>e.replace(/{context:\w+}$/,"");if(i(e))return"";if(p(s=e)&&Ce(s,"raw"))return n(e.raw);var s;if((e=>m(e)&&e.length>1)(e)){const t=e.slice(1);return r(o(e[0]).replace(/\{([0-9]+)\}/g,((e,i)=>Ce(t,i)?n(t[i]):e)))}return r(o(e))},isRtl:()=>Js().bind((e=>ke(e,"_dir"))).exists((e=>"rtl"===e)),hasCode:e=>Ce(Ys,e)},ea=()=>{const e=[],t={},n={},i=[],o=(e,t)=>{const n=G(i,(n=>n.name===e&&n.state===t));W(n,(e=>e.resolve()))},r=e=>Ce(t,e),s=(e,n)=>{const i=Zs.getCode();!i||n&&-1===(","+(n||"")+",").indexOf(","+i+",")||Xs.ScriptLoader.add(t[e]+"/langs/"+i+".js")},a=(e,t="added")=>"added"===t&&(e=>Ce(n,e))(e)||"loaded"===t&&r(e)?Promise.resolve():new Promise((n=>{i.push({name:e,state:t,resolve:n})}));return{items:e,urls:t,lookup:n,get:e=>{if(n[e])return n[e].instance},requireLangPack:(e,t)=>{!1!==ea.languageLoad&&(r(e)?s(e,t):a(e,"loaded").then((()=>s(e,t))))},add:(t,i)=>(e.push(i),n[t]={instance:i},o(t,"added"),i),remove:e=>{delete t[e],delete n[e]},createUrl:(e,t)=>u(t)?u(e)?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}:t,load:(e,i)=>{if(t[e])return Promise.resolve();let r=u(i)?i:i.prefix+i.resource+i.suffix;0!==r.indexOf("/")&&-1===r.indexOf("://")&&(r=ea.baseURL+"/"+r),t[e]=r.substring(0,r.lastIndexOf("/"));const s=()=>(o(e,"loaded"),Promise.resolve());return n[e]?s():Xs.ScriptLoader.add(r).then(s)},waitFor:a}};ea.languageLoad=!0,ea.baseURL="",ea.PluginManager=ea(),ea.ThemeManager=ea(),ea.ModelManager=ea();const ta=E("mce-annotation"),na=E("data-mce-annotation"),ia=E("data-mce-annotation-uid"),oa=E("data-mce-annotation-active"),ra=E("data-mce-annotation-classes"),sa=E("data-mce-annotation-attrs"),aa=e=>t=>bn(t,e),la=(e,t)=>{const n=e.selection.getRng(),i=hn(n.startContainer),o=hn(e.getBody()),r=t.fold((()=>"."+ta()),(e=>`[${na()}="${e}"]`)),s=Hn(i,n.startOffset).getOr(i);return to(s,r,aa(o)).bind((t=>pi(t,`${ia()}`).bind((n=>pi(t,`${na()}`).map((t=>{const i=da(e,n);return{uid:n,name:t,elements:i}}))))))},ca=(e,t)=>fi(e,"data-mce-bogus")||((e,t,n)=>Zi(e,'[data-mce-bogus="all"]',n).isSome())(e,0,aa(t)),da=(e,t)=>{const n=hn(e.getBody()),i=mo(n,`[${ia()}="${t}"]`);return G(i,(e=>!ca(e,n)))},ha=(e,t)=>{const n=hn(e.getBody()),i=mo(n,`[${na()}="${t}"]`),o={};return W(i,(e=>{if(!ca(e,n)){const t=ui(e,ia()),n=ke(o,t).getOr([]);o[t]=n.concat([e])}})),o},ua=(e,t,n=z)=>{const i=new Po(e,t),o=e=>{let t;do{t=i[e]()}while(t&&!Go(t)&&!n(t));return F.from(t).filter(Go)};return{current:()=>F.from(i.current()).filter(Go),next:()=>o("next"),prev:()=>o("prev"),prev2:()=>o("prev2")}},pa=(e,t)=>{const n=t||(t=>e.isBlock(t)||er(t)||or(t)),i=(e,t,n,o)=>{if(Go(e)){const n=o(e,t,e.data);if(-1!==n)return F.some({container:e,offset:n})}return n().bind((e=>i(e.container,e.offset,n,o)))};return{backwards:(t,o,r,s)=>{const a=ua(t,null!=s?s:e.getRoot(),n);return i(t,o,(()=>a.prev().map((e=>({container:e,offset:e.length})))),r).getOrNull()},forwards:(t,o,r,s)=>{const a=ua(t,null!=s?s:e.getRoot(),n);return i(t,o,(()=>a.next().map((e=>({container:e,offset:0})))),r).getOrNull()}}},fa=e=>{let t;return n=>(t=t||re(e,N),Ce(t,wn(n)))},ma=e=>Sn(e)&&"br"===wn(e),ga=fa(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),va=fa(["ul","ol","dl"]),ba=fa(["li","dd","dt"]),ya=fa(["thead","tbody","tfoot"]),xa=fa(["td","th"]),wa=fa(["pre","script","textarea","style"]),_a=()=>{const e=cn("br");return di(e,"data-mce-bogus","1"),e},ka=e=>{vi(e),si(e,_a())},Ca=st,Sa=lt,Ta=e=>e.replace(/\uFEFF/g,""),Ea=jo,Aa=Go,Oa=e=>(Aa(e)&&(e=e.parentNode),Ea(e)&&e.hasAttribute("data-mce-caret")),Da=e=>Aa(e)&&Sa(e.data),Ia=e=>Oa(e)||Da(e),Pa=e=>
vendor: 5,261 bytes, line 135
135e.firstChild!==e.lastChild||!er(e.firstChild),Ma=e=>{const t=e.container();return!!Go(t)&&(t.data.charAt(e.offset())===Ca||e.isAtStart()&&Da(t.previousSibling))},Ra=e=>{const t=e.container();return!!Go(t)&&(t.data.charAt(e.offset()-1)===Ca||e.isAtEnd()&&Da(t.nextSibling))},za=e=>Aa(e)&&e.data[0]===Ca,Na=e=>Aa(e)&&e.data[e.data.length-1]===Ca,Fa=e=>e&&e.hasAttribute("data-mce-caret")?((e=>{var t;const n=e.getElementsByTagName("br"),i=n[n.length-1];qo(i)&&(null===(t=i.parentNode)||void 0===t||t.removeChild(i))})(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("data-mce-style"),e.removeAttribute("_moz_abspos"),e):null,La=e=>Oa(e.startContainer),ja=Math.round,Ba=e=>e?{left:ja(e.left),top:ja(e.top),bottom:ja(e.bottom),right:ja(e.right),width:ja(e.width),height:ja(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},Ha=(e,t)=>(e=Ba(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e),Ua=(e,t,n)=>e>=0&&e<=Math.min(t.height,n.height)/2,$a=(e,t)=>{const n=Math.min(t.height/2,e.height/2);return e.bottom-n<t.top||!(e.top>t.bottom)&&Ua(t.top-e.bottom,e,t)},qa=(e,t)=>e.top>t.bottom||!(e.bottom<t.top)&&Ua(t.bottom-e.top,e,t),Wa=(e,t,n)=>{const i=Math.max(Math.min(t,e.left+e.width),e.left),o=Math.max(Math.min(n,e.top+e.height),e.top);return Math.sqrt((t-i)*(t-i)+(n-o)*(n-o))},Va=e=>{const t=e.startContainer,n=e.startOffset;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},Ka=(e,t)=>{if(jo(e)&&e.hasChildNodes()){const n=e.childNodes;return n[((e,t,n)=>Math.min(Math.max(e,0),n))(t,0,n.length-1)]}return e},Ga=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),Xa=e=>u(e)&&e.charCodeAt(0)>=768&&Ga.test(e),Ya=ir,Qa=or,Ja=er,Za=Go,el=Uo(["script","style","textarea"]),tl=Uo(["img","input","textarea","hr","iframe","video","audio","object","embed"]),nl=Uo(["table"]),il=Ia,ol=e=>!il(e)&&(Za(e)?!el(e.parentNode):tl(e)||Ja(e)||nl(e)||rl(e)),rl=e=>!(e=>jo(e)&&"true"===e.getAttribute("unselectable"))(e)&&Qa(e),sl=(e,t)=>ol(e)&&((e,t)=>{for(let n=e.parentNode;n&&n!==t;n=n.parentNode){if(rl(n))return!1;if(Ya(n))return!0}return!0})(e,t),al=jo,ll=ol,cl=$o("display","block table"),dl=$o("float","left right"),hl=((...e)=>t=>{for(let n=0;n<e.length;n++)if(!e[n](t))return!1;return!0})(al,ll,I(dl)),ul=I($o("white-space","pre pre-line pre-wrap")),pl=Go,fl=er,ml=Ks.nodeIndex,gl=(e,t)=>t<0&&jo(e)&&e.hasChildNodes()?void 0:Ka(e,t),vl=e=>e?e.createRange():Ks.DOM.createRng(),bl=e=>u(e)&&/[\r\n\t ]/.test(e),yl=e=>!!e.setStart&&!!e.setEnd,xl=e=>{const t=e.startContainer,n=e.startOffset;if(bl(e.toString())&&ul(t.parentNode)&&Go(t)){const e=t.data;if(bl(e[n-1])||bl(e[n+1]))return!0}return!1},wl=e=>0===e.left&&0===e.right&&0===e.top&&0===e.bottom,_l=e=>{var t;let n;const i=e.getClientRects();return n=i.length>0?Ba(i[0]):Ba(e.getBoundingClientRect()),!yl(e)&&fl(e)&&wl(n)?(e=>{const t=e.ownerDocument,n=vl(t),i=t.createTextNode(at),o=e.parentNode;o.insertBefore(i,e),n.setStart(i,0),n.setEnd(i,1);const r=Ba(n.getBoundingClientRect());return o.removeChild(i),r})(e):wl(n)&&yl(e)&&null!==(t=(e=>{const t=e.startContainer,n=e.endContainer,i=e.startOffset,o=e.endOffset;if(t===n&&Go(n)&&0===i&&1===o){const t=e.cloneRange();return t.setEndAfter(n),_l(t)}return null})(e))&&void 0!==t?t:n},kl=(e,t)=>{const n=Ha(e,t);return n.width=1,n.right=n.left+1,n},Cl=(e,t,n)=>{const i=()=>(n||(n=(e=>{const t=[],n=e=>{var n,i;0!==e.height&&(t.length>0&&(n=e,i=t[t.length-1],n.left===i.left&&n.top===i.top&&n.bottom===i.bottom&&n.right===i.right)||t.push(e))},i=(e,t)=>{const i=vl(e.ownerDocument);if(t<e.data.length){if(Xa(e.data[t]))return;if(Xa(e.data[t-1])&&(i.setStart(e,t),i.setEnd(e,t+1),!xl(i)))return void n(kl(_l(i),!1))}t>0&&(i.setStart(e,t-1),i.setEnd(e,t),xl(i)||n(kl(_l(i),!1))),t<e.data.length&&(i.setStart(e,t),i.setEnd(e,t+1),xl(i)||n(kl(_l(i),!0)))},o=e.container(),r=e.offset();if(pl(o))return i(o,r),t;if(al(o))if(e.isAtEnd()){const e=gl(o,r);pl(e)&&i(e,e.data.length),hl(e)&&!fl(e)&&n(kl(_l(e),!1))}else{const s=gl(o,r);if(pl(s)&&i(s,0),hl(s)&&e.isAtEnd())return n(kl(_l(s),!1)),t;const a=gl(e.container(),e.offset()-1);
vendor: 8,846 bytes, line 135
135hl(a)&&!fl(a)&&(cl(a)||cl(s)||!hl(s))&&n(kl(_l(a),!1)),hl(s)&&n(kl(_l(s),!0))}return t})(Cl(e,t))),n);return{container:E(e),offset:E(t),toRange:()=>{const n=vl(e.ownerDocument);return n.setStart(e,t),n.setEnd(e,t),n},getClientRects:i,isVisible:()=>i().length>0,isAtStart:()=>(pl(e),0===t),isAtEnd:()=>pl(e)?t>=e.data.length:t>=e.childNodes.length,isEqual:n=>n&&e===n.container()&&t===n.offset(),getNode:n=>gl(e,n?t-1:t)}};Cl.fromRangeStart=e=>Cl(e.startContainer,e.startOffset),Cl.fromRangeEnd=e=>Cl(e.endContainer,e.endOffset),Cl.after=e=>Cl(e.parentNode,ml(e)+1),Cl.before=e=>Cl(e.parentNode,ml(e)),Cl.isAbove=(e,t)=>Be(le(t.getClientRects()),ce(e.getClientRects()),$a).getOr(!1),Cl.isBelow=(e,t)=>Be(ce(t.getClientRects()),le(e.getClientRects()),qa).getOr(!1),Cl.isAtStart=e=>!!e&&e.isAtStart(),Cl.isAtEnd=e=>!!e&&e.isAtEnd(),Cl.isTextPosition=e=>!!e&&Go(e.container()),Cl.isElementPosition=e=>!Cl.isTextPosition(e);const Sl=(e,t)=>{Go(t)&&0===t.data.length&&e.remove(t)},Tl=(e,t,n)=>{Zo(n)?((e,t,n)=>{const i=F.from(n.firstChild),o=F.from(n.lastChild);t.insertNode(n),i.each((t=>Sl(e,t.previousSibling))),o.each((t=>Sl(e,t.nextSibling)))})(e,t,n):((e,t,n)=>{t.insertNode(n),Sl(e,n.previousSibling),Sl(e,n.nextSibling)})(e,t,n)},El=Go,Al=qo,Ol=Ks.nodeIndex,Dl=e=>{const t=e.parentNode;return Al(t)?Dl(t):t},Il=e=>e?mt(e.childNodes,((e,t)=>(Al(t)&&"BR"!==t.nodeName?e=e.concat(Il(t)):e.push(t),e)),[]):[],Pl=e=>t=>e===t,Ml=e=>(El(e)?"text()":e.nodeName.toLowerCase())+"["+(e=>{let t,n;t=Il(Dl(e)),n=gt(t,Pl(e),e),t=t.slice(0,n+1);const i=mt(t,((e,n,i)=>(El(n)&&El(t[i-1])&&e++,e)),0);return t=ft(t,Uo([e.nodeName])),n=gt(t,Pl(e),e),n-i})(e)+"]",Rl=(e,t)=>{let n,i=[],o=t.container(),r=t.offset();if(El(o))n=((e,t)=>{let n=e;for(;(n=n.previousSibling)&&El(n);)t+=n.data.length;return t})(o,r);else{const e=o.childNodes;r>=e.length?(n="after",r=e.length-1):n="before",o=e[r]}i.push(Ml(o));let s=((e,t)=>{const n=[];for(let i=t.parentNode;i&&i!==e;i=i.parentNode)n.push(i);return n})(e,o);return s=ft(s,I(qo)),i=i.concat(pt(s,(e=>Ml(e)))),i.reverse().join("/")+","+n},zl=(e,t)=>{if(!t)return null;const n=t.split(","),i=n[0].split("/"),o=n.length>1?n[1]:"before",r=mt(i,((e,t)=>{const n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return n?("text()"===n[1]&&(n[1]="#text"),((e,t,n)=>{let i=Il(e);return i=ft(i,((e,t)=>!El(e)||!El(i[t-1]))),i=ft(i,Uo([t])),i[n]})(e,n[1],parseInt(n[2],10))):null}),e);if(!r)return null;if(!El(r)&&r.parentNode){let e;return e="after"===o?Ol(r)+1:Ol(r),Cl(r.parentNode,e)}return((e,t)=>{let n=e,i=0;for(;El(n);){const o=n.data.length;if(t>=i&&t<=i+o){e=n,t-=i;break}if(!El(n.nextSibling)){e=n,t=o;break}i+=o,n=n.nextSibling}return El(e)&&t>e.data.length&&(t=e.data.length),Cl(e,t)})(r,parseInt(o,10))},Nl=or,Fl=(e,t,n,i,o)=>{const r=o?i.startContainer:i.endContainer;let s=o?i.startOffset:i.endOffset;const a=[],l=e.getRoot();if(Go(r))a.push(n?((e,t,n)=>{let i=e(t.data.slice(0,n)).length;for(let n=t.previousSibling;n&&Go(n);n=n.previousSibling)i+=e(n.data).length;return i})(t,r,s):s);else{let t=0;const i=r.childNodes;s>=i.length&&i.length&&(t=1,s=Math.max(0,i.length-1)),a.push(e.nodeIndex(i[s],n)+t)}for(let t=r;t&&t!==l;t=t.parentNode)a.push(e.nodeIndex(t,n));return a},Ll=(e,t,n)=>{let i=0;return sn.each(e.select(t),(e=>"all"===e.getAttribute("data-mce-bogus")?void 0:e!==n&&void i++)),i},jl=(e,t)=>{let n=t?e.startContainer:e.endContainer,i=t?e.startOffset:e.endOffset;if(jo(n)&&"TR"===n.nodeName){const o=n.childNodes;n=o[Math.min(t?i:i-1,o.length-1)],n&&(i=t?0:n.childNodes.length,t?e.setStart(n,i):e.setEnd(n,i))}},Bl=e=>(jl(e,!0),jl(e,!1),e),Hl=(e,t)=>{if(jo(e)&&(e=Ka(e,t),Nl(e)))return e;if(Ia(e)){Go(e)&&Oa(e)&&(e=e.parentNode);let t=e.previousSibling;if(Nl(t))return t;if(t=e.nextSibling,Nl(t))return t}},Ul=(e,t,n)=>{const i=n.getNode(),o=n.getRng();if("IMG"===i.nodeName||Nl(i)){const e=i.nodeName;return{name:e,index:Ll(n.dom,e,i)}}const r=(e=>Hl(e.startContainer,e.startOffset)||Hl(e.endContainer,e.endOffset))(o);if(r){const e=r.tagName;return{name:e,index:Ll(n.dom,e,r)}}return((e,t,n,i)=>{const o=t.dom,r=Fl(o,e,n,i,!0),s=t.isForward(),a=La(i)?{isFakeCaret:!0}:{};return t.isCollapsed()?{start:r,forward:s,...a}:{start:r,end:Fl(o,e,n,i,!1),forward:s,...a}})(e,n,t,o)},$l=(e,t,n)=>{const i={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",i,"&#xFEFF;"):e.create("span",i)},ql=(e,t)=>{const n=e.dom;let i=e.getRng();const o=n.uniqueId(),r=e.isCollapsed(),s=e.getNode(),a=s.nodeName,l=e.isForward();if("IMG"===a)return{name:a,index:Ll(n,a,s)};const c=Bl(i.cloneRange());if(!r){c.collapse(!1);const e=$l(n,o+"_end",t);Tl(n,c,e)}i=Bl(i),i.collapse(!0);const d=$l(n,o+"_start",t);return Tl(n,i,d),e.moveToBookmark({id:o,keep:!0,forward:l}),{id:o,forward:l}},Wl=D(Ul,A,!0),Vl=e=>"inline-command"===e.type||"inline-format"===e.type,Kl=e=>"block-command"===e.type||"block-format"===e.type,Gl=e=>{var t;const n=t=>De.error({message:t,pattern:e}),i=(t,i,o)=>{if(void 0!==e.format){let o;if(m(e.format)){if(!ne(e.format,u))return n(t+" pattern has non-string items in the `format` array");o=e.format}else{if(!u(e.format))return n(t+" pattern has non-string `format` parameter");o=[e.format]}return De.value(i(o))}return void 0!==e.cmd?u(e.cmd)?De.value(o(e.cmd,e.value)):n(t+" pattern has non-string `cmd` parameter"):n(t+" pattern is missing both `format` and `cmd` parameters")};if(!p(e))return n("Raw pattern is not an object");if(!u(e.start))return n("Raw pattern is missing `start` parameter");if(void 0!==e.end){if(!u(e.end))return n("Inline pattern has non-string `end` parameter");if(0===e.start.length&&0===e.end.length)return n("Inline pattern has empty `start` and `end` parameters");let t=e.start,o=e.end;return 0===o.length&&(o=t,t=""),i("Inline",(e=>({type:"inline-format",start:t,end:o,format:e})),((e,n)=>({type:"inline-command",start:t,end:o,cmd:e,value:n})))}if(void 0!==e.replacement)return u(e.replacement)?0===e.start.length?n("Replacement pattern has empty `start` parameter"):De.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement}):n("Replacement pattern has non-string `replacement` parameter");{const o=null!==(t=e.trigger)&&void 0!==t?t:"space";return 0===e.start.length?n("Block pattern has empty `start` parameter"):i("Block",(t=>({type:"block-format",start:e.start,format:t[0],trigger:o})),((t,n)=>({type:"block-command",start:e.start,cmd:t,value:n,trigger:o})))}},Xl=e=>G(e,Kl),Yl=e=>G(e,Vl),Ql=(e,t)=>({...e,blockPatterns:G(e.blockPatterns,(e=>((e,t)=>("block-command"===e.type||"block-format"===e.type)&&e.trigger===t)(e,t)))}),Jl=e=>{const t=(e=>{const t=[],n=[];return W(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{n.push(e)}))})),{errors:t,values:n}})(q(e,Gl));return W(t.errors,(e=>console.error(e.message,e.pattern))),t.values},Zl=(e,t,n)=>{e.dispatch(t,n)},ec=(e,t,n,i)=>{e.dispatch("FormatApply",{format:t,node:n,vars:i})},tc=(e,t,n,i)=>{e.dispatch("FormatRemove",{format:t,node:n,vars:i})},nc=(e,t)=>e.dispatch("SetContent",t),ic=(e,t)=>e.dispatch("GetContent",t),oc=(e,t)=>{e.dispatch("AutocompleterUpdateActiveRange",t)},rc=(e,t)=>e.dispatch("PastePlainTextToggle",{state:t}),sc=Kt().deviceType,ac=sc.isTouch(),lc=Ks.DOM,cc=e=>h(e,RegExp),dc=e=>t=>t.options.get(e),hc=e=>u(e)||p(e),uc=(e,t="")=>n=>{const i=u(n);if(i){if(-1!==n.indexOf("=")){const o=(e=>{const t=e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(",");return Y(t,((e,t)=>{const n=t.split("="),i=n[0],o=n.length>1?n[1]:i;return e[Qe(i)]=Qe(o),e}),{})})(n);return{value:ke(o,e.id).getOr(t),valid:i}}return{value:n,valid:i}}return{valid:!1,message:"Must be a string."}},pc=dc("iframe_attrs"),fc=dc("doctype"),mc=dc("document_base_url"),gc=dc("body_id"),vc=dc("body_class"),bc=dc("content_security_policy"),yc=dc("br_in_pre"),xc=dc("forced_root_block"),wc=dc("forced_root_block_attrs"),_c=dc("newline_behavior"),kc=dc("br_newline_selector"),Cc=dc("no_newline_selector"),Sc=dc("keep_styles"),Tc=dc("end_container_on_empty_block"),Ec=dc("automatic_uploads"),Ac=dc("images_reuse_filename"),Oc=dc("images_replace_blob_uris"),Dc=dc("icons"),Ic=dc("icons_url"),Pc=dc("images_upload_url"),Mc=dc("images_upload_base_path"),Rc=dc("images_upload_credentials"),zc=dc("images_upload_handler"),Nc=dc("content_css_cors"),Fc=dc("referrer_policy"),Lc=dc("language"),jc=dc("language_url"),Bc=dc("indent_use_margin"),Hc=dc("indentation"),Uc=dc("content_css"),$c=dc("content_style"),qc=dc("font_css"),Wc=dc("directionality"),Vc=dc("inline_boundaries_selector"),Kc=dc("object_resizing"),Gc=dc("resize_img_proportional"),Xc=dc("placeholder"),Yc=dc("event_root"),Qc=dc("service_message"),Jc=dc("theme"),Zc=dc("theme_url"),ed=dc("model"),td=dc("model_url"),nd=dc("inline_boundaries"),id=dc("formats"),od=dc("preview_styles"),rd=dc("format_empty_lines"),sd=dc("format_noneditable_selector"),ad=dc("custom_ui_selector"),ld=dc("inline"),c
vendor: 5,383 bytes, line 135
135d=dc("hidden_input"),dd=dc("submit_patch"),hd=dc("add_form_submit_trigger"),ud=dc("add_unload_trigger"),pd=dc("custom_undo_redo_levels"),fd=dc("disable_nodechange"),md=dc("readonly"),gd=dc("editable_root"),vd=dc("content_css_cors"),bd=dc("plugins"),yd=dc("external_plugins"),xd=dc("block_unsupported_drop"),wd=dc("visual"),_d=dc("visual_table_class"),kd=dc("visual_anchor_class"),Cd=dc("iframe_aria_text"),Sd=dc("setup"),Td=dc("init_instance_callback"),Ed=dc("urlconverter_callback"),Ad=dc("auto_focus"),Od=dc("browser_spellcheck"),Dd=dc("protect"),Id=dc("paste_block_drop"),Pd=dc("paste_data_images"),Md=dc("paste_preprocess"),Rd=dc("paste_postprocess"),zd=dc("newdocument_content"),Nd=dc("paste_webkit_styles"),Fd=dc("paste_remove_styles_if_webkit"),Ld=dc("paste_merge_formats"),jd=dc("smart_paste"),Bd=dc("paste_as_text"),Hd=dc("paste_tab_spaces"),Ud=dc("allow_html_data_urls"),$d=dc("text_patterns"),qd=dc("text_patterns_lookup"),Wd=dc("noneditable_class"),Vd=dc("editable_class"),Kd=dc("noneditable_regexp"),Gd=dc("preserve_cdata"),Xd=dc("highlight_on_focus"),Yd=dc("xss_sanitization"),Qd=dc("init_content_sync"),Jd=e=>sn.explode(e.options.get("images_file_types")),Zd=dc("table_tab_navigation"),eh=dc("details_initial_state"),th=dc("details_serialized_state"),nh=dc("sandbox_iframes"),ih=e=>e.options.get("sandbox_iframes_exclusions"),oh=dc("convert_unsafe_embeds"),rh=dc("license_key"),sh=dc("api_key"),ah=dc("disabled"),lh=jo,ch=Go,dh=e=>{const t=e.parentNode;t&&t.removeChild(e)},hh=e=>{const t=Ta(e);return{count:e.length-t.length,text:t}},uh=e=>{let t;for(;-1!==(t=e.data.lastIndexOf(Ca));)e.deleteData(t,1)},ph=(e,t)=>(fh(e),t),fh=e=>{lh(e)&&Ia(e)&&(Pa(e)?e.removeAttribute("data-mce-caret"):dh(e)),ch(e)&&(uh(e),0===e.data.length&&dh(e))},mh=or,gh=lr,vh=sr,bh=(e,t,n)=>{const i=Ha(t.getBoundingClientRect(),n);let o,r;if("BODY"===e.tagName){const t=e.ownerDocument.documentElement;o=e.scrollLeft||t.scrollLeft,r=e.scrollTop||t.scrollTop}else{const t=e.getBoundingClientRect();o=e.scrollLeft-t.left,r=e.scrollTop-t.top}i.left+=o,i.right+=o,i.top+=r,i.bottom+=r,i.width=1;let s=t.offsetWidth-t.clientWidth;return s>0&&(n&&(s*=-1),i.left+=s,i.right+=s),i},yh=()=>tn.browser.isFirefox(),xh=e=>mh(e)||gh(e),wh=e=>(xh(e)||Wo(e)&&yh())&&Rn(hn(e)).exists(ho),_h=ir,kh=or,Ch=lr,Sh=$o("display","block table table-cell table-row table-caption list-item"),Th=Ia,Eh=Oa,Ah=jo,Oh=Go,Dh=ol,Ih=e=>1===e,Ph=e=>-1===e,Mh=(e,t)=>{let n;for(;n=e(t);)if(!Eh(n))return n;return null},Rh=(e,t,n,i,o)=>{const r=new Po(e,i),s=kh(e)||Eh(e);let a;if(Ph(t)){if(s&&(a=Mh(r.prev.bind(r),!0),n(a)))return a;for(;a=Mh(r.prev.bind(r),o);)if(n(a))return a}if(Ih(t)){if(s&&(a=Mh(r.next.bind(r),!0),n(a)))return a;for(;a=Mh(r.next.bind(r),o);)if(n(a))return a}return null},zh=(e,t)=>{for(;e&&e!==t;){if(Sh(e))return e;e=e.parentNode}return null},Nh=(e,t,n)=>zh(e.container(),n)===zh(t.container(),n),Fh=(e,t)=>{if(!t)return F.none();const n=t.container(),i=t.offset();return Ah(n)?F.from(n.childNodes[i+e]):F.none()},Lh=(e,t)=>{var n;const i=(null!==(n=t.ownerDocument)&&void 0!==n?n:document).createRange();return e?(i.setStartBefore(t),i.setEndBefore(t)):(i.setStartAfter(t),i.setEndAfter(t)),i},jh=(e,t,n)=>zh(t,e)===zh(n,e),Bh=(e,t,n)=>{const i=e?"previousSibling":"nextSibling";let o=n;for(;o&&o!==t;){let e=o[i];if(e&&Th(e)&&(e=e[i]),kh(e)||Ch(e)){if(jh(t,e,o))return e;break}if(Dh(e))break;o=o.parentNode}return null},Hh=D(Lh,!0),Uh=D(Lh,!1),$h=(e,t,n)=>{let i;const o=D(Bh,!0,t),r=D(Bh,!1,t),s=n.startContainer,a=n.startOffset;if(Oa(s)){const e=Oh(s)?s.parentNode:s,t=e.getAttribute("data-mce-caret");if("before"===t&&(i=e.nextSibling,wh(i)))return Hh(i);if("after"===t&&(i=e.previousSibling,wh(i)))return Uh(i)}if(!n.collapsed)return n;if(Go(s)){if(Th(s)){if(1===e){if(i=r(s),i)return Hh(i);if(i=o(s),i)return Uh(i)}if(-1===e){if(i=o(s),i)return Uh(i);if(i=r(s),i)return Hh(i)}return n}if(Na(s)&&a>=s.data.length-1)return 1===e&&(i=r(s),i)?Hh(i):n;if(za(s)&&a<=1)return-1===e&&(i=o(s),i)?Uh(i):n;if(a===s.data.length)return i=r(s),i?Hh(i):n;if(0===a)return i=o(s),i?Uh(i):n}return n},qh=(e,t)=>Fh(e?0:-1,t).filter(kh),Wh=(e,t,n)=>{const i=$h(e,t,n);return-1===e?Cl.fromRangeStart(i):Cl.fromRangeEnd(i)},Vh=e=>F.from(e.getNode()).map(hn),Kh=(e,t)=>{let n=t;for(;n=e(n);)if(n.isVisible())return n;return n},Gh=(e,t)=>{const n=Nh(e,t);return!(n||!er(e.getNode()))||n},Xh=or,Yh=Go,Qh=jo,Jh=er,Zh=ol,eu=e=>tl(e)||(e=>!!rl(e)&&!Y(de(e.getElementsByTagName("*")),((e,t)=>e||Ya(t)),!1))(e),tu=sl,nu=(e,t)=>e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null,iu=(e,t)=>{if(Ih(e)){if(Zh(t.previousSibling)&&!Yh(t.previousSibling))return Cl.before(t);if(Yh(t))return Cl(t,0)}if(Ph(e)){if(Zh(t.nextSibling)&&!Yh(t.nextSibling))return Cl.after(t);if(Yh(t))return Cl(t,t.data.length)}return Ph(e)?Jh(t)?Cl.before(t):Cl.after(t):Cl.before(t)},ou=(e,t,n)=>{let i,o,r,s;if(!Qh(n)||!t)return null;if(t.isEqual(Cl.after(n))&&n.lastChild){if(s=Cl.after(n.lastChild),Ph(e)&&Zh(n.lastChild)&&Qh(n.lastChild))return Jh(n.lastChild)?Cl.before(n.lastChild):s}else s=t;const a=s.container();let l=s.offset();if(Yh(a)){if(Ph(e)&&l>0)return Cl(a,--l);if(Ih(e)&&l<a.length)return Cl(a,++l);i=a}else{if(Ph(e)&&l>0&&(o=nu(a,l-1),Zh(o)))return!eu(o)&&(r=Rh(o,e,tu,o),r)?Yh(r)?Cl(r,r.data.length):Cl.after(r):Yh(o)?Cl(o,o.data.length):Cl.before(o);if(Ih(e)&&l<a.childNodes.length&&(o=nu(a,l),Zh(o)))return Jh(o)?((e,t)=>
vendor: 4,265 bytes, line 135
135{const n=t.nextSibling;return n&&Zh(n)?Yh(n)?Cl(n,0):Cl.before(n):ou(1,Cl.after(t),e)})(n,o):!eu(o)&&(r=Rh(o,e,tu,o),r)?Yh(r)?Cl(r,0):Cl.before(r):Yh(o)?Cl(o,0):Cl.after(o);i=o||s.getNode()}if(i&&(Ih(e)&&s.isAtEnd()||Ph(e)&&s.isAtStart())&&(i=Rh(i,e,N,n,!0),tu(i,n)))return iu(e,i);o=i?Rh(i,e,tu,n):i;const c=vt(G(((e,t)=>{const n=[];let i=e;for(;i&&i!==t;)n.push(i),i=i.parentNode;return n})(a,n),Xh));return!c||o&&c.contains(o)?o?iu(e,o):null:(s=Ih(e)?Cl.after(c):Cl.before(c),s)},ru=e=>({next:t=>ou(1,t,e),prev:t=>ou(-1,t,e)}),su=e=>Cl.isTextPosition(e)?0===e.offset():ol(e.getNode()),au=e=>{if(Cl.isTextPosition(e)){const t=e.container();return e.offset()===t.data.length}return ol(e.getNode(!0))},lu=(e,t)=>!Cl.isTextPosition(e)&&!Cl.isTextPosition(t)&&e.getNode()===t.getNode(!0),cu=(e,t,n)=>{const i=ru(t);return F.from(e?i.next(n):i.prev(n))},du=(e,t,n)=>cu(e,t,n).bind((i=>Nh(n,i,t)&&((e,t,n)=>{return e?!lu(t,n)&&(i=t,!(!Cl.isTextPosition(i)&&er(i.getNode())))&&au(t)&&su(n):!lu(n,t)&&su(t)&&au(n);var i})(e,n,i)?cu(e,t,i):F.some(i))),hu=(e,t,n,i)=>du(e,t,n).bind((n=>i(n)?hu(e,t,n,i):F.some(n))),uu=(e,t)=>{const n=e?t.firstChild:t.lastChild;return Go(n)?F.some(Cl(n,e?0:n.data.length)):n?ol(n)?F.some(e?Cl.before(n):er(i=n)?Cl.before(i):Cl.after(i)):((e,t,n)=>{const i=e?Cl.before(n):Cl.after(n);return cu(e,t,i)})(e,t,n):F.none();var i},pu=D(cu,!0),fu=D(cu,!1),mu=D(uu,!0),gu=D(uu,!1),vu="_mce_caret",bu=e=>jo(e)&&e.id===vu,yu=(e,t)=>{let n=t;for(;n&&n!==e;){if(bu(n))return n;n=n.parentNode}return null},xu=e=>Ce(e,"name"),wu=e=>sn.isArray(e.start),_u=e=>!(!xu(e)&&v(e.forward))||e.forward,ku=(e,t)=>(jo(t)&&e.isBlock(t)&&!t.innerHTML&&(t.innerHTML='<br data-mce-bogus="1" />'),t),Cu=(e,t)=>gu(e).fold(z,(e=>(t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0))),Su=(e,t,n)=>!(!(e=>!e.hasChildNodes())(t)||!yu(e,t)||(((e,t)=>{var n;const i=(null!==(n=e.ownerDocument)&&void 0!==n?n:document).createTextNode(Ca);e.appendChild(i),t.setStart(i,0),t.setEnd(i,0)})(t,n),0)),Tu=(e,t,n,i)=>{const o=n[t?"start":"end"],r=e.getRoot();if(o){let e=r,n=o[0];for(let t=o.length-1;e&&t>=1;t--){const n=e.childNodes;if(Su(r,e,i))return!0;if(o[t]>n.length-1)return!!Su(r,e,i)||Cu(e,i);e=n[o[t]]}Go(e)&&(n=Math.min(o[0],e.data.length)),jo(e)&&(n=Math.min(o[0],e.childNodes.length)),t?i.setStart(e,n):i.setEnd(e,n)}return!0},Eu=e=>Go(e)&&e.data.length>0,Au=(e,t,n)=>{const i=e.get(n.id+"_"+t),o=null==i?void 0:i.parentNode,r=n.keep;if(i&&o){let s,a;if("start"===t?r?i.hasChildNodes()?(s=i.firstChild,a=1):Eu(i.nextSibling)?(s=i.nextSibling,a=0):Eu(i.previousSibling)?(s=i.previousSibling,a=i.previousSibling.data.length):(s=o,a=e.nodeIndex(i)+1):(s=o,a=e.nodeIndex(i)):r?i.hasChildNodes()?(s=i.firstChild,a=1):Eu(i.previousSibling)?(s=i.previousSibling,a=i.previousSibling.data.length):(s=o,a=e.nodeIndex(i)):(s=o,a=e.nodeIndex(i)),!r){const o=i.previousSibling,r=i.nextSibling;let l;for(sn.each(sn.grep(i.childNodes),(e=>{Go(e)&&(e.data=e.data.replace(/\uFEFF/g,""))}));l=e.get(n.id+"_"+t);)e.remove(l,!0);if(Go(r)&&Go(o)&&!tn.browser.isOpera()){const t=o.data.length;o.appendData(r.data),e.remove(r),s=o,a=t}}return F.some(Cl(s,a))}return F.none()},Ou=(e,t,n)=>((e,t,n=!1)=>2===t?Ul(Ta,n,e):3===t?(e=>{const t=e.getRng();return{start:Rl(e.dom.getRoot(),Cl.fromRangeStart(t)),end:Rl(e.dom.getRoot(),Cl.fromRangeEnd(t)),forward:e.isForward()}})(e):t?(e=>({rng:e.getRng(),forward:e.isForward()}))(e):ql(e,!1))(e,t,n),Du=(e,t)=>{((e,t)=>{const n=e.dom;if(t){if(wu(t))return((e,t)=>{const n=e.createRng();return Tu(e,!0,t,n)&&Tu(e,!1,t,n)?F.some({range:n,forward:_u(t)}):F.none()})(n,t);if((e=>u(e.start))(t))return((e,t)=>{const n=F.from(zl(e.getRoot(),t.start)),i=F.from(zl(e.getRoot(),t.end));return Be(n,i,((n,i)=>{const o=e.createRng();return o.setStart(n.container(),n.offset()),o.setEnd(i.container(),i.offset()),{range:o,forward:_u(t)}}))})(n,t);if((e=>Ce(e,"id"))(t))return((e,t)=>{const n=Au(e,"start",t),i=Au(e,"end",t);return Be(n,i.or(n),((n,i)=>{const o=e.createRng();return o.setStart(ku(e,n.container()),n.offset()),o.setEnd(ku(e,i.container()),i.offset()),{range:o,forward:_u(t)}}))})(n,t);if(xu(t))return((e,t)=>F.from(e.select(t.name)[t.index]).map((t=>{const n=e.createRng();return n.selectNode(t),{range:n,forward:!0}})))(n,t);
vendor: 8,525 bytes, line 135
135if((e=>Ce(e,"rng"))(t))return F.some({range:t.rng,forward:_u(t)})}return F.none()})(e,t).each((({range:t,forward:n})=>{e.setRng(t,n)}))},Iu=e=>jo(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type"),Pu=(at,e=>" "===e);const Mu=e=>""!==e&&-1!==" \f\n\r\t\v".indexOf(e),Ru=e=>!Mu(e)&&!Pu(e)&&!lt(e),zu=e=>{const t=[];if(e)for(let n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Nu=(e,t)=>{const n=mo(t,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:(e=>G((e=>te(e,(e=>{const t=Va(e);return t?[hn(t)]:[]})))(e),xa))(e)},Fu=e=>Nu(zu(e.selection.getSel()),hn(e.getBody())),Lu=(e,t)=>Zi(e,"table",t),ju=e=>Un(e).fold(E([e]),(t=>[e].concat(ju(t)))),Bu=e=>$n(e).fold(E([e]),(t=>"br"===wn(t)?Nn(t).map((t=>[e].concat(Bu(t)))).getOr([]):[e].concat(Bu(t)))),Hu=(e,t)=>Be((e=>{const t=e.startContainer,n=e.startOffset;return Go(t)?0===n?F.some(hn(t)):F.none():F.from(t.childNodes[n]).map(hn)})(t),(e=>{const t=e.endContainer,n=e.endOffset;return Go(t)?n===t.data.length?F.some(hn(t)):F.none():F.from(t.childNodes[n-1]).map(hn)})(t),((t,n)=>{const i=J(ju(e),D(bn,t)),o=J(Bu(e),D(bn,n));return i.isSome()&&o.isSome()})).getOr(!1),Uu=(e,t,n,i)=>{const o=n,r=new Po(n,o),s=xe(e.schema.getMoveCaretBeforeOnEnterElements(),((e,t)=>!U(["td","th","table"],t.toLowerCase())));let a=n;do{if(Go(a)&&0!==sn.trim(a.data).length)return void(i?t.setStart(a,0):t.setEnd(a,a.data.length));if(s[a.nodeName])return void(i?t.setStartBefore(a):"BR"===a.nodeName?t.setEndBefore(a):t.setEndAfter(a))}while(a=i?r.next():r.prev());"BODY"===o.nodeName&&(i?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},$u=e=>{const t=e.selection.getSel();return x(t)&&t.rangeCount>0},qu=(e,t)=>{const n=Fu(e);n.length>0?W(n,(n=>{const i=n.dom,o=e.dom.createRng();o.setStartBefore(i),o.setEndAfter(i),t(o,!0)})):t(e.selection.getRng(),!1)},Wu=(e,t,n)=>{const i=ql(e,t);n(i),e.moveToBookmark(i)},Vu=e=>_(null==e?void 0:e.nodeType),Ku=e=>jo(e)&&!Iu(e)&&!bu(e)&&!qo(e),Gu=(e,t,n)=>{const{selection:i,dom:o}=e,r=i.getNode(),s=or(r);Wu(i,!0,(()=>{t()})),s&&or(r)&&o.isChildOf(r,e.getBody())?e.selection.select(r):n(i.getStart())&&Xu(o,i)},Xu=(e,t)=>{var n,i;const o=t.getRng(),{startContainer:r,startOffset:s}=o;if(!((e,t)=>{if(Ku(t)&&!/^(TD|TH)$/.test(t.nodeName)){const n=e.getAttrib(t,"data-mce-selected"),i=parseInt(n,10);return!isNaN(i)&&i>0}return!1})(e,t.getNode())&&jo(r)){const a=r.childNodes,l=e.getRoot();let c;if(s<a.length){const t=a[s];c=new Po(t,null!==(n=e.getParent(t,e.isBlock))&&void 0!==n?n:l)}else{const t=a[a.length-1];c=new Po(t,null!==(i=e.getParent(t,e.isBlock))&&void 0!==i?i:l),c.next(!0)}for(let n=c.current();n;n=c.next()){if("false"===e.getContentEditable(n))return;if(Go(n)&&!Zu(n))return o.setStart(n,0),void t.setRng(o)}}},Yu=(e,t,n)=>{if(e){const i=t?"nextSibling":"previousSibling";for(e=n?e:e[i];e;e=e[i])if(jo(e)||!Zu(e))return e}},Qu=(e,t)=>!!e.getTextBlockElements()[t.nodeName.toLowerCase()]||Pr(e,t),Ju=(e,t,n)=>e.schema.isValidChild(t,n),Zu=(e,t=!1)=>{if(x(e)&&Go(e)){const n=t?e.data.replace(/ /g," "):e.data;return Ro(n)}return!1},ep=(e,t)=>{const n=e.dom;return Ku(t)&&"false"===n.getContentEditable(t)&&((e,t)=>{const n="[data-mce-cef-wrappable]",i=sd(e),o=tt(i)?n:`${n},${i}`;return gn(hn(t),o)})(e,t)&&0===n.select('[contenteditable="true"]',t).length},tp=(e,t)=>w(e)?e(t):(x(t)&&(e=e.replace(/%(\w+)/g,((e,n)=>t[n]||e))),e),np=(e,t)=>(t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()),ip=(e,t)=>{if(y(e))return null;{let n=String(e);return"color"!==t&&"backgroundColor"!==t||(n=Es(n)),"fontWeight"===t&&700===e&&(n="bold"),"fontFamily"===t&&(n=n.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),n}},op=(e,t,n)=>{const i=e.getStyle(t,n);return ip(i,n)},rp=(e,t)=>{let n;return e.getParent(t,(t=>!!jo(t)&&(n=e.getStyle(t,"text-decoration"),!!n&&"none"!==n))),n},sp=(e,t,n)=>e.getParents(t,n,e.getRoot()),ap=(e,t,n)=>{const i=e.formatter.get(t);return x(i)&&$(i,n)},lp=e=>Se(e,"block"),cp=e=>Se(e,"selector"),dp=e=>Se(e,"inline"),hp=e=>cp(e)&&!1!==e.expand&&!dp(e),up=e=>(e=>{const t=[];let n=e;for(;n;){if(Go(n)&&n.data!==Ca||n.childNodes.length>1)return[];jo(n)&&t.push(n),n=n.firstChild}return t})(e).length>0,pp=e=>bu(e.dom)&&up(e.dom),fp=Iu,mp=sp,gp=Zu,vp=Qu,bp=(e,t)=>{let n=t;for(;n;){if(jo(n)&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},yp=(e,t,n,i)=>{const o=t.data;if(e){for(let e=n;e>0;e--)if(i(o.charAt(e-1)))return e}else for(let e=n;e<o.length;e++)if(i(o.charAt(e)))return e;return-1},xp=(e,t,n)=>yp(e,t,n,(e=>Pu(e)||Mu(e))),wp=(e,t,n)=>yp(e,t,n,Ru),_p=(e,t,n,i,o,r)=>{let s;const a=e.getParent(n,(t=>rr(t)||e.isBlock(t))),l=x(a)?a:t,c=(t,n,i)=>{const r=pa(e),a=o?r.backwards:r.forwards;return F.from(a(t,n,((e,t)=>fp(e.parentNode)?-1:(s=e,i(o,e,t))),l))};return c(n,i,xp).bind((e=>r?c(e.container,e.offset+(o?-1:0),wp):F.some(e))).orThunk((()=>s?F.some({container:s,offset:o?0:s.length}):F.none()))},kp=(e,t,n,i,o)=>{const r=i[o];Go(i)&&tt(i.data)&&r&&(i=r);const s=mp(e,i);for(let i=0;i<s.length;i++)for(let o=0;o<t.length;o++){const r=t[o];if((!x(r.collapsed)||r.collapsed===n.collapsed)&&cp(r)&&e.is(s[i],r.selector))return s[i]}return i},Cp=(e,t,n,i)=>{var o;let r=n;const s=e.getRoot(),a=t[0];if(lp(a)&&(r=a.wrapper?null:e.getParent(n,a.block,s)),!r){const t=null!==(o=e.getParent(n,"LI,TD,TH,SUMMARY"))&&void 0!==o?o:s;r=e.getParent(Go(n)?n.parentNode:n,(t=>t!==s&&vp(e.schema,t)),t)}if(r&&lp(a)&&a.wrapper&&(r=mp(e,r,"ul,ol").reverse()[0]||r),!r)for(r=n;r&&r[i]&&!e.isBlock(r[i])&&(r=r[i],!np(r,"br")););return r||n},Sp=(e,t,n,i)=>{const o=n.parentNode;return!x(n[i])&&(!(o!==t&&!y(o)&&!e.isBlock(o))||Sp(e,t,o,i))},Tp=(e,t,n,i,o,r)=>{let s=n;const a=o?"previousSibling":"nextSibling",l=e.getRoot();if(Go(n)&&!gp(n)&&(o?i>0:i<n.data.length))return n;for(;s;){if(rr(s))return n;if(!t[0].block_expand&&e.isBlock(s))return r?s:n;for(let t=s[a];t;t=t[a]){const n=Go(t)&&!Sp(e,l,t,a);if(!fp(t)&&(!er(c=t)||!c.getAttribute("data-mce-bogus")||c.nextSibling)&&!gp(t,n))return s}if(s===l||s.parentNode===l){n=s;break}s=s.parentNode}var c;return n},Ep=e=>fp(e.parentNode)||fp(e),Ap=(e,t,n,i={})=>{const{includeTrailingSpace:o=!1,expandToBlock:r=!0}=i,s=e.getParent(t.commonAncestorContainer,(e=>rr(e))),a=x(s)?s:e.getRoot();let{startContainer:l,startOffset:c,endContainer:d,endOffset:h}=t;const u=n[0];return jo(l)&&l.hasChildNodes()&&(l=Ka(l,c),Go(l)&&(c=0)),jo(d)&&d.hasChildNodes()&&(d=Ka(d,t.collapsed?h:h-1),Go(d)&&(h=d.data.length)),l=bp(e,l),d=bp(e,d),Ep(l)&&(l=fp(l)?l:l.parentNode,l=t.collapsed?l.previousSibling||l:l.nextSibling||l,Go(l)&&(c=t.collapsed?l.length:0)),Ep(d)&&(d=fp(d)?d:d.parentNode,d=t.collapsed?d.nextSibling||d:d.previousSibling||d,Go(d)&&(h=t.collapsed?0:d.length)),t.collapsed&&(_p(e,a,l,c,!0,o).each((({container:e,offset:t})=>{l=e,c=t})),_p(e,a,d,h,!1,o).each((({container:e,offset:t})=>{d=e,h=t}))),(dp(u)||u.block_expand)&&(dp(u)&&Go(l)&&0!==c||(l=Tp(e,n,l,c,!0,r)),dp(u)&&Go(d)&&h!==d.data.length||(d=Tp(e,n,d,h,!1,r))),hp(u)&&(l=kp(e,n,t,l,"previousSibling"),d=kp(e,n,t,d,"nextSibling")),(lp(u)||cp(u))&&(l=Cp(e,n,l,"previousSibling"),d=Cp(e,n,d,"nextSibling"),lp(u)&&(e.isBlock(l)||(l=Tp(e,n,l,c,!0,r),Go(l)&&(c=0)),e.isBlock(d)||(d=Tp(e,n,d,h,!1,r),Go(d)&&(h=d.data.length)))),jo(l)&&l.parentNode&&(c=e.nodeIndex(l),l=l.parentNode),jo(d)&&d.parentNode&&(h=e.nodeIndex(d)+1,d=d.parentNode),{startContainer:l,startOffset:c,endContainer:d,endOffset:h}},Op=(e,t,n)=>{var i;const o=t.startOffset,r=Ka(t.startContainer,o),s=t.endOffset,a=Ka(t.endContainer,s-1),l=e=>{const t=e[0];Go(t)&&t===r&&o>=t.data.length&&e.splice(0,1);const n=e[e.length-1];return 0===s&&e.length>0&&n===a&&Go(n)&&e.splice(e.length-1,1),e},c=(e,t,n)=>{const i=[];for(;e&&e!==n;e=e[t])i.push(e);return i},d=(t,n)=>e.getParent(t,(e=>e.parentNode===n),n),h=(e,t,i)=>{const o=i?"nextSibling":"previousSibling";for(let r=e,s=r.parentNode;r&&r!==t;r=s){s=r.parentNode;const t=c(r===e?r:r[o],o);t.length&&(i||t.reverse(),n(l(t)))}};if(r===a)return n(l([r]));const u=null!==(i=e.findCommonAncestor(r,a))&&void 0!==i?i:e.getRoot();if(e.isChildOf(r,a))return h(r,u,!0);if(e.isChildOf(a,r))return h(a,u);const p=d(r,u)||r,f=d(a,u)||a;h(r,p,!0);const m=c(p===r?p:p.nextSibling,"nextSibling",f===a?f.nextSibling:f);m.length&&n(l(m)),h(a,f)},Dp=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]","div.mce-footnotes"],Ip=(e,t,n,i,o,r)=>{const{uid:s=t,...a}=n;so(e,ta()),di(e,`${ia()}`,s),di(e,`${na()}
135`,i);const{attributes:l={},classes:c=[]}=o(s,a);if(hi(e,l),((e,t)=>{W(t,(t=>{so(e,t)}))})(e,c),r){c.length>0&&di(e,`${ra()}`,c.join(","));const t=pe(l);t.length>0&&di(e,`${sa()}`,t.join(","))}},Pp=(e,t,n,i,o)=>{const r=cn("span",e);return Ip(r,t,n,i,o,!1),r},Mp=e=>{const t=(()=>{const e={};return{register:(t,n)=>{e[t]={name:t,settings:n}},lookup:t=>ke(e,t).map((e=>e.settings)),getNames:()=>pe(e)}})();((e,t)=>{const n=na(),i=e=>F.from(e.attr(n)).bind(t.lookup),o=e=>{var t,n;e.attr(ia(),null),e.attr(na(),null),e.attr(oa(),null);const i=F.from(e.attr(sa())).map((e=>e.split(","))).getOr([]),o=F.from(e.attr(ra())).map((e=>e.split(","))).getOr([]);W(i,(t=>e.attr(t,null)));const r=null!==(n=null===(t=e.attr("class"))||void 0===t?void 0:t.split(" "))&&void 0!==n?n:[],s=oe(r,[ta()].concat(o));e.attr("class",s.length>0?s.join(" "):null),e.attr(ra(),null),e.attr(sa(),null)};e.serializer.addTempAttr(oa()),e.serializer.addAttributeFilter(n,(e=>{for(const t of e)i(t).each((e=>{!1===e.persistent&&("span"===t.name?t.unwrap():o(t))}))}))})(e,t);const n=((e,t)=>{const n=Ee({}),i=()=>({listeners:[],previous:qe()}),o=(e,t)=>{r(e,(e=>(t(e),e)))},r=(e,t)=>{const o=n.get(),r=t(ke(o,e).getOrThunk(i));o[e]=r,n.set(o)},s=(t,n)=>{W(da(e,t),(e=>{n?di(e,oa(),"true"):mi(e,oa())}))},a=ot((()=>{const n=se(t.getNames());W(n,(t=>{r(t,(n=>{const i=n.previous.get();return la(e,F.some(t)).fold((()=>{i.each((e=>{(e=>{o(e,(t=>{W(t.listeners,(t=>t(!1,e)))}))})(t),n.previous.clear(),s(e,!1)}))}),(({uid:e,name:t,elements:r})=>{Le(i,e)||(i.each((e=>s(e,!1))),((e,t,n)=>{o(e,(i=>{W(i.listeners,(i=>i(!0,e,{uid:t,nodes:q(n,(e=>e.dom))})))}))})(t,e,r),n.previous.set(e),s(e,!0))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);return e.on("remove",(()=>{a.cancel()})),e.on("NodeChange",(()=>{a.throttle()})),{addListener:(e,t)=>{r(e,(e=>({previous:e.previous,listeners:e.listeners.concat([t])})))}}})(e,t),i=On("span"),o=e=>{W(e,(e=>{i(e)?yi(e):(e=>{lo(e,ta()),mi(e,`${ia()}`),mi(e,`${na()}`),mi(e,`${oa()}`);const t=pi(e,`${sa()}`).map((e=>e.split(","))).getOr([]),n=pi(e,`${ra()}`).map((e=>e.split(","))).getOr([]);var i;W(t,(t=>mi(e,t))),i=e,W(n,(e=>{lo(i,e)})),mi(e,`${ra()}`),mi(e,`${sa()}`)})(e)}))};return{register:(e,n)=>{t.register(e,n)},annotate:(n,i)=>{t.lookup(n).each((t=>{((e,t,n,i)=>{e.undoManager.transact((()=>{const o=e.selection,r=o.getRng(),s=Fu(e).length>0,a=Re("mce-annotation");if(r.collapsed&&!s&&((e,t)=>{const n=Ap(e.dom,t,[{inline:"span"}]);t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t)})(e,r),o.getRng().collapsed&&!s){const r=Pp(e.getDoc(),a,i,t,n.decorate);Si(r,at),o.getRng().insertNode(r.dom),o.select(r.dom)}else Wu(o,!1,(()=>{qu(e,(o=>{((e,t,n,i,o,r)=>{const s=[],a=Pp(e.getDoc(),n,r,i,o),l=qe(),c=()=>{l.clear()},d=e=>{W(e,h)},h=t=>{switch(((e,t,n,i)=>Rn(t).fold((()=>"skipping"),(o=>"br"===i||(e=>Tn(e)&&Vi(e)===Ca)(t)?"valid":(e=>Sn(e)&&co(e,ta()))(t)?"existing":bu(t.dom)?"caret":$(Dp,(e=>gn(t,e)))?"valid-block":Ju(e,n,i)&&Ju(e,wn(o),n)?"valid":"invalid-child")))(e,t,"span",wn(t))){case"invalid-child":{c();const e=Bn(t);d(e),c();break}case"valid-block":c(),Ip(t,n,r,i,o,!0);break;case"valid":{const e=l.get().getOrThunk((()=>{const e=wi(a);return s.push(e),l.set(e),e}));ai(t,e);break}}};Op(e.dom,t,(e=>{c(),(e=>{const t=q(e,hn);d(t)})(e)}))})(e,o,a,t,n.decorate,i)}))}))}))})(e,n,t,i)}))},annotationChanged:(e,t)=>{n.addListener(e,t)},remove:t=>{la(e,F.some(t)).each((({elements:t})=>{const n=e.selection.getBookmark();o(t),e.selection.moveToBookmark(n)}))},removeAll:t=>{const n=e.selection.getBookmark();me(ha(e,t),((e,t)=>{o(e)})),e.selection.moveToBookmark(n)},getAll:t=>{const n=ha(e,t);return ge(n,(e=>q(e,(e=>e.dom))))}}},Rp=e=>({getBookmark:D(Ou,e),moveToBookmark:D(Du,e)});Rp.isBookmarkNode=Iu;const zp=(e,t,n)=>!n.collapsed&&$(n.getClientRects(),(n=>((e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom)(n,e,t))),Np=(e,t)=>{const n=Tn(t)?Vi(t).length:Bn(t).length+1;return e>n?n:e<0?0:e},Fp=e=>To.range(e.start,Np(e.soffset,e.start),e.finish,Np(e.foffset,e.finish)),Lp=(e,t)=>!Lo(t.dom)&&(yn(e,t)||bn(e,t)),jp=e=>t=>Lp(e,t.start)&&Lp(e,t.finish),Bp=e=>To.range(hn(e.startContainer),e.startOffset,hn(e.endContainer),e.endOffset),Hp=e=>{const t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),F.some(t)}catch(e){return F.none()}},Up=e=>{const t=(e=>e.inline||tn.browser.isFirefox())(e)?(n=hn(e.getBody()),(e=>{const t=e.getSelection();return(t&&0!==t.rangeCount?F.from(t.getRangeAt(0)):F.none()).map(Bp)})(Pn(n).dom).filter(jp(n))):F.none();var n;e.bookmark=t.isSome()?t:e.bookmark},$p=e=>(e.bookmark?e.bookmark:F.none()).bind((t=>{return n=hn(e.getBody()),i=t,F.from(i).filter(jp(n)).map(Fp);var n,i})).bind(Hp),qp={isEditorUIElement:e=>{const t=e.className.toString();
vendor: 3,177 bytes, line 135
135return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},Wp={setEditorTimeout:(e,t,n)=>((e,t)=>(_(t)||(t=0),window.setTimeout(e,t)))((()=>{e.removed||t()}),n),setEditorInterval:(e,t,n)=>{const i=((e,t)=>(_(t)||(t=0),window.setInterval(e,t)))((()=>{e.removed?window.clearInterval(i):t()}),n);return i}},Vp=(e,t)=>e.view(t).fold(E([]),(t=>{const n=e.owner(t),i=Vp(e,n);return[t].concat(i)}));var Kp=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?F.none():F.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(hn)},owner:e=>In(e)});const Gp=e=>{const t=Zn(),n=Hi(t),i=((e,t)=>{const n=t.owner(e);return Vp(t,n)})(e,Kp),o=Bi(e),r=X(i,((e,t)=>{const n=Bi(t);return{left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return Li(r.left+o.left+n.left,r.top+o.top+n.top)};let Xp;const Yp=Ks.DOM,Qp=e=>{const t=e.classList;return void 0!==t&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body"))},Jp=(e,t)=>{const n=ad(e);return null!==Yp.getParent(t,(t=>(e=>jo(e)&&qp.isEditorUIElement(e))(t)||!!n&&e.dom.is(t,n)))},Zp=e=>{try{const t=Vn(hn(e.getElement()));return ni(t).fold((()=>document.body),(e=>e.dom))}catch(e){return document.body}},ef=(e,t)=>{const n=t.editor;(e=>{const t=it((()=>{Up(e)}),0);e.on("init",(()=>{e.inline&&((e,t)=>{const n=()=>{t.throttle()};Ks.DOM.bind(document,"mouseup",n),e.on("remove",(()=>{Ks.DOM.unbind(document,"mouseup",n)}))})(e,t),((e,t)=>{((e,t)=>{e.on("mouseup touchend",(e=>{t.throttle()}))})(e,t),e.on("keyup NodeChange AfterSetSelectionRange",(t=>{(e=>"nodechange"===e.type&&e.selectionChange)(t)||Up(e)}))})(e,t)})),e.on("remove",(()=>{t.cancel()}))})(n);const i=(e,t)=>{Xd(e)&&!0!==e.inline&&t(hn(e.getContainer()),"tox-edit-focus")};n.on("focusin",(()=>{const t=e.focusedEditor;if(Qp(Zp(n))&&i(n,so),t!==n){t&&t.dispatch("blur",{focusedEditor:n}),e.setActive(n),e.focusedEditor=n,n.dispatch("focus",{blurredEditor:t}),n.focus(!0);const i=Kt().browser;!0!==n.inline&&(i.isSafari()||i.isChromium())&&(e=>{if(!e.iframeElement)return;const t=hn(e.iframeElement),n=Gp(t),i=Io(window);(n.top<i.y||n.top>i.bottom-25)&&t.dom.scrollIntoView({block:"center"})})(n)}})),n.on("focusout",(()=>{Wp.setEditorTimeout(n,(()=>{const t=e.focusedEditor;Qp(Zp(n))&&t===n||i(n,lo),Jp(n,Zp(n))||t!==n||(n.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null)}))})),Xp||(Xp=t=>{const n=e.activeEditor;n&&Xn(t).each((t=>{const i=t;i.ownerDocument===document&&(i===document.body||Jp(n,i)||e.focusedEditor!==n||(n.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null))}))},Yp.bind(document,"focusin",Xp))},tf=(e,t)=>{e.focusedEditor===t.editor&&(e.focusedEditor=null),!e.activeEditor&&Xp&&(Yp.unbind(document,"focusin",Xp),Xp=null)},nf=(e,t)=>{((e,t)=>(e=>e.collapsed?F.from(Ka(e.startContainer,e.startOffset)).map(hn):F.none())(t).bind((t=>ya(t)?F.some(t):yn(e,t)?F.none():F.some(e))))(hn(e.getBody()),t).bind((e=>mu(e.dom))).fold((()=>{e.selection.normalize()}),(t=>e.selection.setRng(t.toRange())))},of=e=>{if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},rf=e=>e.inline?(e=>{const t=e.getBody();return t&&(n=hn(t),ti(n)||(i=n,ni(Vn(i)).filter((e=>
vendor: 4,108 bytes, line 135
135i.dom.contains(e.dom)))).isSome());var n,i})(e):(e=>x(e.iframeElement)&&ti(hn(e.iframeElement)))(e),sf=e=>rf(e)||(e=>{const t=Vn(hn(e.getElement()));return ni(t).filter((t=>!Qp(t.dom)&&Jp(e,t.dom))).isSome()})(e),af=e=>e.editorManager.setActive(e),lf={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:e=>e.shiftKey||e.ctrlKey||e.altKey||lf.metaKeyPressed(e),metaKeyPressed:e=>tn.os.isMacOS()||tn.os.isiOS()?e.metaKey:e.ctrlKey&&!e.altKey},cf="data-mce-selected",df=Math.abs,hf=Math.round,uf={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},pf=(e,t)=>{const n=t.dom,i=t.getDoc(),o=document,r=t.getBody();let s,a,l,c,d,h,u,p,f,m,g,v,b,y,w;const _=e=>x(e)&&(tr(e)||n.is(e,"figure.image")),k=e=>lr(e)||n.hasClass(e,"mce-preview-object"),C=e=>{const n=e.target;((e,t)=>{if((e=>"longpress"===e.type||0===e.type.indexOf("touch"))(e)){const n=e.touches[0];return _(e.target)&&!zp(n.clientX,n.clientY,t)}return _(e.target)&&!zp(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(n)},S=e=>n.hasClass(e,"mce-preview-object")&&x(e.firstElementChild)?[e,e.firstElementChild]:n.is(e,"figure.image")?[e.querySelector("img")]:[e],T=e=>{const i=Kc(t);return!(!i||t.mode.isReadOnly())&&"false"!==e.getAttribute("data-mce-resize")&&e!==t.getBody()&&(n.hasClass(e,"mce-preview-object")&&x(e.firstElementChild)?gn(hn(e.firstElementChild),i):gn(hn(e),i))},E=(e,i,o)=>{if(x(o)){const r=S(e);W(r,(e=>{e.style[i]||!t.schema.isValid(e.nodeName.toLowerCase(),i)?n.setStyle(e,i,o):n.setAttrib(e,i,""+o)}))}},A=(e,t,n)=>{E(e,"width",t),E(e,"height",n)},O=e=>{let i,o,d,x,C;i=e.screenX-h,o=e.screenY-u,v=i*c[2]+p,b=o*c[3]+f,v=v<5?5:v,b=b<5?5:b,d=(_(s)||k(s))&&!1!==Gc(t)?!lf.modifierPressed(e):lf.modifierPressed(e),d&&(df(i)>df(o)?(b=hf(v*m),v=hf(b/m)):(v=hf(b/m),b=hf(v*m))),A(a,v,b),x=c.startPos.x+i,C=c.startPos.y+o,x=x>0?x:0,C=C>0?C:0,n.setStyles(l,{left:x,top:C,display:"block"}),l.innerHTML=v+" &times; "+b,i=r.scrollWidth-y,o=r.scrollHeight-w,i+o!==0&&n.setStyles(l,{left:x-i,top:C-o}),g||(((e,t,n,i,o)=>{e.dispatch("ObjectResizeStart",{target:t,width:n,height:i,origin:o})})(t,s,p,f,"corner-"+c.name),g=!0)},D=()=>{const e=g;g=!1,e&&(E(s,"width",v),E(s,"height",b)),n.unbind(i,"mousemove",O),n.unbind(i,"mouseup",D),o!==i&&(n.unbind(o,"mousemove",O),n.unbind(o,"mouseup",D)),n.remove(a),n.remove(l),n.remove(d),I(s),e&&(((e,t,n,i,o)=>{e.dispatch("ObjectResized",{target:t,width:n,height:i,origin:o})})(t,s,v,b,"corner-"+c.name),n.setAttrib(s,"style",n.getAttrib(s,"style"))),t.nodeChanged()},I=e=>{N();const g=n.getPos(e,r),x=g.x,_=g.y,C=e.getBoundingClientRect(),E=C.width||C.right-C.left,I=C.height||C.bottom-C.top;s!==e&&(M(),s=e,v=b=0);const P=t.dispatch("ObjectSelected",{target:e});T(e)&&!P.isDefaultPrevented()?me(uf,((e,t)=>{let g=n.get("mceResizeHandle"+t);g&&n.remove(g),g=n.add(r,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),n.bind(g,"mousedown",(g=>{g.stopImmediatePropagation(),g.preventDefault(),(g=>{const v=S(s)[0];h=g.screenX,u=g.screenY,p=v.clientWidth,f=v.clientHeight,m=f/p,c=e,c.name=t,c.startPos={x:E*e[0]+x,y:I*e[1]+_},y=r.scrollWidth,w=r.scrollHeight,d=n.add(r,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),n.setStyles(d,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),a=((e,t)=>{if(k(t))return e.create("img",{src:tn.transparentSrc});if(Wo(t)){const n=Ge(c.name,"n")?le:ce,i=t.cloneNode(!0);return n(e.select("tr",i)).each((t=>{const n=e.select("td,th",t);e.setStyle(t,"height",null),W(n,(t=>e.setStyle(t,"height",null)))})),i}return t.cloneNode(!0)})(n,s),n.addClass(a,"mce-clonedresizable"),n.setAttrib(a,"data-mce-bogus","all"),a.contentEditable="false",n.setStyles(a,{left:x,top:_,margin:0}),A(a,E,I),a.removeAttribute(cf),r.appendChild(a),n.bind(i,"mousemove",O),n.bind(i,"mouseup",D),o!==i&&(n.bind(o,"mousemove",O),n.bind(o,"mouseup",D)),l=n.add(r,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},p+" &times; "+f)}
vendor: 4,685 bytes, line 135
135)(g)})),e.elm=g,n.setStyles(g,{left:E*e[0]+x-g.offsetWidth/2,top:I*e[1]+_-g.offsetHeight/2})})):M(!1)},P=it(I,0),M=(e=!0)=>{P.cancel(),N(),s&&e&&s.removeAttribute(cf),me(uf,((e,t)=>{const i=n.get("mceResizeHandle"+t);i&&(n.unbind(i),n.remove(i))}))},R=(e,t)=>n.isChildOf(e,t),z=i=>{if(g||t.removed||t.composing)return;const o="mousedown"===i.type?i.target:e.getNode(),s=to(hn(o),"table,img,figure.image,hr,video,span.mce-preview-object,details").map((e=>e.dom)).filter((e=>n.isEditable(e.parentElement)||"IMG"===e.nodeName&&n.isEditable(e))).getOrUndefined(),a=x(s)?n.getAttrib(s,cf,"1"):"1";if(W(n.select(`img[${cf}],hr[${cf}]`),(e=>{e.removeAttribute(cf)})),x(s)&&R(s,r)&&sf(t)){F();const t=e.getStart(!0);if(R(t,s)&&R(e.getEnd(!0),s))return n.setAttrib(s,cf,a),void P.throttle(s)}M()},N=()=>{me(uf,(e=>{e.elm&&(n.unbind(e.elm),delete e.elm)}))},F=()=>{try{t.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}};return t.on("init",(()=>{F(),t.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",z),t.on("keyup compositionend",(e=>{s&&"TABLE"===s.nodeName&&z(e)})),t.on("hide blur",M),t.on("contextmenu longpress",C,!0)})),t.on("remove",N),{isResizable:T,showResizeRect:I,hideResizeRect:M,updateResizeRect:z,destroy:()=>{P.cancel(),s=a=d=null}}},ff=(e,t,n)=>((e,t,n)=>((e,t,n)=>((e,t,n)=>e.caretPositionFromPoint?((e,t,n)=>{var i;return F.from(null===(i=e.caretPositionFromPoint)||void 0===i?void 0:i.call(e,t,n)).bind((t=>{if(null===t.offsetNode)return F.none();const n=e.createRange();return n.setStart(t.offsetNode,t.offset),n.collapse(),F.some(n)}))})(e,t,n):e.caretRangeFromPoint?((e,t,n)=>{var i;return F.from(null===(i=e.caretRangeFromPoint)||void 0===i?void 0:i.call(e,t,n))})(e,t,n):F.none())(e.document,t,n).map((e=>_o(hn(e.startContainer),e.startOffset,hn(e.endContainer),e.endOffset))))(e,t,n))(Pn(hn(n)).dom,e,t).map((e=>{const t=n.createRange();return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),t})).getOrUndefined(),mf=(e,t)=>x(e)&&x(t)&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset,gf=(e,t,n)=>null!==((e,t,n)=>{let i=e;for(;i&&i!==t;){if(n(i))return i;i=i.parentNode}return null})(e,t,n),vf=(e,t,n)=>gf(e,t,(e=>e.nodeName===n)),bf=(e,t)=>Ia(e)&&!gf(e,t,bu),yf=(e,t,n)=>{const i=t.parentNode;if(i){const o=new Po(t,e.getParent(i,e.isBlock)||e.getRoot());let r;for(;r=o[n?"prev":"next"]();)if(er(r))return!0}return!1},xf=(e,t,n,i,o)=>{const r=e.getRoot(),s=e.schema.getNonEmptyElements(),a=o.parentNode;let l,c;if(!a)return F.none();const d=e.getParent(a,e.isBlock)||r;if(i&&er(o)&&t&&e.isEmpty(d))return F.some(Cl(a,e.nodeIndex(o)));const h=new Po(o,d);for(;c=h[i?"prev":"next"]();){if("false"===e.getContentEditableParent(c)||bf(c,r))return F.none();if(Go(c)&&c.data.length>0)return vf(c,r,"A")?F.none():F.some(Cl(c,i?c.data.length:0));if(e.isBlock(c)||s[c.nodeName.toLowerCase()])return F.none();l=c}return Qo(l)?F.none():n&&l?F.some(Cl(l,0)):F.none()},wf=(e,t,n,i)=>{const o=e.getRoot();let r,s=!1,a=n?i.startContainer:i.endContainer,l=n?i.startOffset:i.endOffset;const c=jo(a)&&l===a.childNodes.length,d=e.schema.getNonEmptyElements();let h=n;if(Ia(a))return F.none();if(jo(a)&&l>a.childNodes.length-1&&(h=!1),Jo(a)&&(a=o,l=0),a===o){if(h&&(r=a.childNodes[l>0?l-1:0],r)){if(Ia(r))return F.none();if(d[r.nodeName]||Wo(r))return F.none()}if(a.hasChildNodes()){if(l=Math.min(!h&&l>0?l-1:l,a.childNodes.length-1),a=a.childNodes[l],l=Go(a)&&c?a.data.length:0,!t&&a===o.lastChild&&Wo(a))return F.none();if(((e,t)=>{let n=t;for(;n&&n!==e;){if(or(n))return!0;n=n.parentNode}return!1})(o,a)||Ia(a))return F.none();if(dr(a))return F.none();if(a.hasChildNodes()&&!Wo(a)){r=a;const t=new Po(a,o);do{if(or(r)||Ia(r)){s=!1;break}if(Go(r)&&r.data.length>0){l=h?0:r.data.length,a=r,s=!0;break}if(d[r.nodeName.toLowerCase()]&&!ar(r)){l=e.nodeIndex(r),a=r.parentNode,h||l++,s=!0;break}}while(r=h?t.next():t.prev())}}}return t&&(Go(a)&&0===l&&xf(e,c,t,!0,a).each((e=>{a=e.container(),l=e.offset(),s=!0})),jo(a)&&(r=a.childNodes[l],r||(r=a.childNodes[l-1]),!r||!er(r)||(e=>{var t;return"A"===(null===(t=e.previousSibling)||void 0===t?void 0:t.nodeName)})(r)||yf(e,r,!1)||yf(e,r,!0)||xf(e,c,t,!0,r).each((e=>{a=e.container(),l=e.offset(),s=!0})))),h&&!t&&Go(a)&&l===a.data.length&&xf(e,c,t,!1,a).each((e=>{a=e.container(),l=e.offset(),s=!0})),s&&a?F.some(Cl(a,l)):F.none()},_f=(e,t)=>{const n=t.collapsed,i=t.cloneRange(),o=Cl.fromRangeStart(t);return wf(e,n,!0,i).each((e=>{n&&Cl.isAbove(o,e)||i.setStart(e.container(),e.offset())})),n||wf(e,n,!1,i).each((e=>{i.setEnd(e.container(),e.offset())})),n&&i.collapse(!0),mf(t,i)?F.none():F.some(i)},kf=(e,t)=>
vendor: 16,597 bytes, line 135
135e.splitText(t),Cf=e=>{let t=e.startContainer,n=e.startOffset,i=e.endContainer,o=e.endOffset;if(t===i&&Go(t)){if(n>0&&n<t.data.length)if(i=kf(t,n),t=i.previousSibling,o>n){o-=n;const e=kf(i,o).previousSibling;t=i=e,o=e.data.length,n=0}else o=0}else if(Go(t)&&n>0&&n<t.data.length&&(t=kf(t,n),n=0),Go(i)&&o>0&&o<i.data.length){const e=kf(i,o).previousSibling;i=e,o=e.data.length}return{startContainer:t,startOffset:n,endContainer:i,endOffset:o}},Sf=e=>({walk:(t,n)=>Op(e,t,n),split:Cf,expand:(t,n={type:"word"})=>{if("word"===n.type){const n=Ap(e,t,[{inline:"span"}],{includeTrailingSpace:!1,expandToBlock:!1}),i=e.createRng();return i.setStart(n.startContainer,n.startOffset),i.setEnd(n.endContainer,n.endOffset),i}return t},normalize:t=>_f(e,t).fold(z,(e=>(t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0)))});Sf.compareRanges=mf,Sf.getCaretRangeFromPoint=ff,Sf.getSelectedNode=Va,Sf.getNode=Ka;const Tf=e=>"textarea"===wn(e),Ef=(e,t)=>{const n=(e=>{const t=e.dom.ownerDocument,n=t.body,i=t.defaultView,o=t.documentElement;if(n===e.dom)return Li(n.offsetLeft,n.offsetTop);const r=ji(null==i?void 0:i.pageYOffset,o.scrollTop),s=ji(null==i?void 0:i.pageXOffset,o.scrollLeft),a=ji(o.clientTop,n.clientTop),l=ji(o.clientLeft,n.clientLeft);return Bi(e).translate(s-l,r-a)})(e),i=(e=>Ni.get(e))(e);return{element:e,bottom:n.top+i,height:i,pos:n,cleanup:t}},Af=(e,t,n,i)=>{Pf(e,((o,r)=>Df(e,t,n,i)),n)},Of=(e,t,n,i,o)=>{const r={elm:i.element.dom,alignToTop:o};((e,t)=>e.dispatch("ScrollIntoView",t).isDefaultPrevented())(e,r)||(n(e,t,Hi(t).top,i,o),((e,t)=>{e.dispatch("AfterScrollIntoView",t)})(e,r))},Df=(e,t,n,i)=>{const o=hn(e.getBody()),r=hn(e.getDoc());o.dom.offsetWidth;const s=((e,t)=>{const n=((e,t)=>{const n=Bn(e);if(0===n.length||Tf(e))return{element:e,offset:t};if(t<n.length&&!Tf(n[t]))return{element:n[t],offset:0};{const i=n[n.length-1];return Tf(i)?{element:e,offset:t}:"img"===wn(i)?{element:i,offset:1}:Tn(i)?{element:i,offset:Vi(i).length}:{element:i,offset:Bn(i).length}}})(e,t),i=ln('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return ii(n.element,i),Ef(i,(()=>bi(i)))})(hn(n.startContainer),n.startOffset);Of(e,r,t,s,i),s.cleanup()},If=(e,t,n,i)=>{const o=hn(e.getDoc());Of(e,o,n,(e=>Ef(hn(e),C))(t),i)},Pf=(e,t,n)=>{const i=n.startContainer,o=n.startOffset,r=n.endContainer,s=n.endOffset;t(hn(i),hn(r));const a=e.dom.createRng();a.setStart(i,o),a.setEnd(r,s),e.selection.setRng(n)},Mf=(e,t,n,i,o)=>{const r=t.pos;if(i)Ui(r.left,Math.max(0,r.top-30),o);else{const i=r.top-n+t.height+30;Ui(-e.getBody().getBoundingClientRect().left,i,o)}},Rf=(e,t,n,i,o,r)=>{const s=i+n,a=o.pos.top,l=o.bottom,c=l-a>=i;a<n?Mf(e,o,i,!1!==r,t):a>s?Mf(e,o,i,c?!1!==r:!0===r,t):l>s&&!c&&Mf(e,o,i,!0===r,t)},zf=(e,t,n,i,o)=>{const r=Pn(t).dom.innerHeight;Rf(e,t,n,r,i,o)},Nf=(e,t,n,i,o)=>{const r=Pn(t).dom.innerHeight;Rf(e,t,n,r,i,o);const s=Gp(i.element),a=Io(window);s.top<a.y?$i(i.element,!1!==o):s.top>a.bottom&&$i(i.element,!0===o)},Ff=(e,t,n)=>Af(e,zf,t,n),Lf=(e,t,n)=>If(e,t,zf,n),jf=(e,t,n)=>Af(e,Nf,t,n),Bf=(e,t,n)=>If(e,t,Nf,n),Hf=(e,t,n)=>{(e.inline?Ff:jf)(e,t,n)},Uf=(e,t)=>t.collapsed?e.isEditable(t.startContainer):e.isEditable(t.startContainer)&&e.isEditable(t.endContainer),$f=(e,t,n,i,o)=>{const r=n?t.startContainer:t.endContainer,s=n?t.startOffset:t.endOffset;return F.from(r).map(hn).map((e=>i&&t.collapsed?e:Hn(e,o(e,s)).getOr(e))).bind((e=>Sn(e)?F.some(e):Mn(e).filter(Sn))).map((e=>e.dom)).getOr(e)},qf=(e,t,n=!1)=>$f(e,t,!0,n,((e,t)=>Math.min(qn(e),t))),Wf=(e,t,n=!1)=>$f(e,t,!1,n,((e,t)=>t>0?t-1:t)),Vf=(e,t)=>{const n=e;for(;e&&Go(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Kf=(e,t)=>q(t,(t=>{const n=e.dispatch("GetSelectionRange",{range:t});return n.range!==t?n.range:t})),Gf={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Xf=(e,t,n)=>{const i=n?"lastChild":"firstChild",o=n?"prev":"next";if(e[i])return e[i];if(e!==t){let n=e[o];if(n)return n;for(let i=e.parent;i&&i!==t;i=i.parent)if(n=i[o],n)return n}},Yf=e=>{var t;const n=null!==(t=e.value)&&void 0!==t?t:"";if(!Ro(n))return!1;const i=e.parent;return!i||"span"===i.name&&!i.attr("style")||!/^[ ]+$/.test(n)},Qf=e=>{const t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t};class Jf{static create(e,t){const n=new Jf(e,Gf[e]||1);return t&&me(t,((e,t)=>{n.attr(t,e)})),n}constructor(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}replace(e){const t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t}attr(e,t){const n=this;if(!u(e))return x(e)&&me(e,((e,t)=>{n.attr(t,e)})),n;const i=n.attributes;if(i){if(void 0!==t){if(null===t){if(e in i.map){delete i.map[e];let t=i.length;for(;t--;)if(i[t].name===e)return i.splice(t,1),n}return n}if(e in i.map){let n=i.length;for(;n--;)if(i[n].name===e){i[n].value=t;break}}else i.push({name:e,value:t});return i.map[e]=t,n}return i.map[e]}}clone(){const e=this,t=new Jf(e.name,e.type),n=e.attributes;if(n){const e=[];e.map={};for(let t=0,i=n.length;t<i;t++){const i=n[t];"id"!==i.name&&(e[e.length]={name:i.name,value:i.value},e.map[i.name]=i.value)}t.attributes=e}return t.value=e.value,t}wrap(e){const t=this;return t.parent&&(t.parent.insert(e,t),e.append(t)),t}unwrap(){const e=this;for(let t=e.firstChild;t;){const n=t.next;e.insert(t,e,!0),t=n}e.remove()}remove(){const e=this,t=e.parent,n=e.next,i=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):i&&(i.next=n),t.lastChild===e?(t.lastChild=i,i&&(i.next=null)):n&&(n.prev=i),e.parent=e.next=e.prev=null),e}append(e){const t=this;e.parent&&e.remove();const n=t.lastChild;return n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e}insert(e,t,n){e.parent&&e.remove();const i=t.parent||this;return n?(t===i.firstChild?i.firstChild=e:t.prev&&(t.prev.next=e),e.prev=t.prev,e.next=t,t.prev=e):(t===i.lastChild?i.lastChild=e:t.next&&(t.next.prev=e),e.next=t.next,e.prev=t,t.next=e),e.parent=i,e}getAll(e){const t=this,n=[];for(let i=t.firstChild;i;i=Xf(i,t))i.name===e&&n.push(i);return n}children(){const e=[];for(let t=this.firstChild;t;t=t.next)e.push(t);return e}empty(){const e=this;if(e.firstChild){const t=[];for(let n=e.firstChild;n;n=Xf(n,e))t.push(n);let n=t.length;for(;n--;){const e=t[n];e.parent=e.firstChild=e.lastChild=e.next=e.prev=null}}return e.firstChild=e.lastChild=null,e}isEmpty(e,t={},n){var i;const o=this;let r=o.firstChild;if(Qf(o))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(e[r.name])return!1;if(Qf(r))return!1}if(8===r.type)return!1;if(3===r.type&&!Yf(r))return!1;if(3===r.type&&r.parent&&t[r.parent.name]&&Ro(null!==(i=r.value)&&void 0!==i?i:""))return!1;if(n&&n(r))return!1}while(r=Xf(r,o));return!0}walk(e){return Xf(this,null,e)}}const Zf=sn.makeMap("NOSCRIPT STYLE SCRIPT XMP IFRAME NOEMBED NOFRAMES PLAINTEXT"," "),em=e=>u(e.nodeValue)&&e.nodeValue.includes(Ca),tm=e=>(0===e.length?"":`${q(e,(e=>`[${e}]`)).join(",")},`)+'[data-mce-bogus="all"]',nm=e=>document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,(e=>em(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP)),im=e=>document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>{if(em(e)){const t=e.parentNode;return t&&Ce(Zf,t.nodeName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}return NodeFilter.FILTER_SKIP})),om=e=>null!==nm(e).nextNode(),rm=e=>null!==im(e).nextNode(),sm=(e,t)=>null!==t.querySelector(tm(e)),am=(e,t)=>{W(((e,t)=>t.querySelectorAll(tm(e)))(e,t),(t=>{const n=hn(t);"all"===ui(n,"data-mce-bogus")?bi(n):W(e,(e=>{fi(n,e)&&mi(n,e)}))}))},lm=e=>{let t=e.nextNode();for(;null!==t;)t.nodeValue=null,t=e.nextNode()},cm=S(lm,nm),dm=S(lm,im),hm=(e,t)=>{const n=[{condition:D(sm,t),action:D(am,t)},{condition:om,action:cm},{condition:rm,action:dm}];let i=e,o=!1;return W(n,(({condition:t,action:n})=>{t(i)&&(o||(i=e.cloneNode(!0),o=!0),n(i))})),i},um=e=>{const t=mo(e,"[data-mce-bogus]");W(t,(e=>{"all"===ui(e,"data-mce-bogus")?bi(e):ma(e)?(ii(e,dn(st)),bi(e)):yi(e)}))},pm=e=>{const t=mo(e,"input");W(t,(e=>{mi(e,"name")}))},fm=sn.makeMap,mm=e=>{const t=[],n=(e=e||{}).indent,i=fm(e.indent_before||""),o=fm(e.indent_after||""),r=ns.getEncodeFunc(e.entity_encoding||"raw",e.entities),s="xhtml"!==e.element_format;return{start:(e,a,l)=>{if(n&&i[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}if(t.push("<",e),a)for(let e=0,n=a.length;e<n;e++){const n=a[e];t.push(" ",n.name,'="',r(n.value,!0),'"')}if(t[t.length]=!l||s?">":" />",l&&n&&o[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}},end:e=>{let i;t.push("</",e,">"),n&&o[e]&&t.length>0&&(i=t[t.length-1],i.length>0&&"\n"!==i&&t.push("\n"))},text:(e,n)=>{e.length>0&&(t[t.length]=n?e:r(e))},cdata:e=>{t.push("<![CDATA[",e,"]]>")},comment:e=>{t.push("\x3c!--",e,"--\x3e")},pi:(e,i)=>{i?t.push("<?",e," ",r(i),"?>"):t.push("<?",e,"?>"),n&&t.push("\n")},doctype:e=>{t.push("<!DOCTYPE",e,">",n?"\n":"")},reset:()=>{t.length=0},getContent:()=>t.join("").replace(/\n$/,"")}},gm=(e={},t=ys())=>{const n=mm(e);return e.validate=!("validate"in e)||e.validate,{serialize:i=>{const o=e.validate,r={3:e=>{var t;n.text(null!==(t=e.value)&&void 0!==t?t:"",e.raw)},8:e=>{var t;n.comment(null!==(t=e.value)&&void 0!==t?t:"")},7:e=>{n.pi(e.name,e.value)},10:e=>{var t;n.doctype(null!==(t=e.value)&&void 0!==t?t:"")},4:e=>{var t;n.cdata(null!==(t=e.value)&&void 0!==t?t:"")},11:e=>{let t=e;if(t=t.firstChild)do{s(t)}while(t=t.next)}};n.reset();const s=e=>{var i;const a=r[e.type];if(a)a(e);else{const r=e.name,a=r in t.getVoidElements();let l=e.attributes;if(o&&l&&l.length>1){const n=[];n.map={};const i=t.getElementRule(e.name);if(i){for(let e=0,t=i.attributesOrder.length;e<t;e++){const t=i.attributesOrder[e];if(t in l.map){const e=l.map[t];n.map[t]=e,n.push({name:t,value:e})}}for(let e=0,t=l.length;e<t;e++){const t=l[e].name;if(!(t in n.map)){const e=l.map[t];n.map[t]=e,n.push({name:t,value:e})}}l=n}}if(n.start(r,l,a),br(r))u(e.value)&&n.text(e.value,!0),n.end(r);else if(!a){let t=e.firstChild;if(t){"pre"!==r&&"textarea"!==r||3!==t.type||"\n"!==(null===(i=t.value)||void 0===i?void 0:i[0])||n.text("\n",!0);do{s(t)}while(t=t.next)}n.end(r)}}};return 1!==i.type||e.inner?3===i.type?r[3](i):r[11](i):s(i),n.getContent()}}},vm=new Set;W(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(e=>{vm.add(e)}));const bm=new Set;W(["background-color"],(e=>{bm.add(e)}));const ym=["font","text-decoration","text-emphasis"],xm=(e,t)=>pe(((e,t)=>e.parseStyle(e.getAttrib(t,"style")))(e,t)),wm=(e,t)=>$(xm(e,t),(e=>(e=>vm.has(e))(e))),_m=(e,t,n)=>F.from(n.container()).filter(Go).exists((i=>{const o=e?0:-1;return t(i.data.charAt(n.offset()+o))})),km=D(_m,!0,Mu),Cm=D(_m,!1,Mu),Sm=e=>{const t=e.container();return Go(t)&&(0===t.data.length||Sa(t.data)&&Rp.isBookmarkNode(t.parentNode))},Tm=(e,t)=>n=>Fh(e?0:-1,n).filter(t).isSome(),Em=e=>tr(e)&&"block"===Ii(hn(e),"display"),Am=e=>or(e)&&!(e=>jo(e)&&"all"===e.getAttribute("data-mce-bogus"))(e),Om=Tm(!0,Em),Dm=Tm(!1,Em),Im=Tm(!0,lr),Pm=Tm(!1,lr),Mm=Tm(!0,Wo),Rm=Tm(!1,Wo),zm=Tm(!0,Am),Nm=Tm(!1,Am),Fm=(e,t)=>((e,t,n)=>yn(t,e)?zn(e,(e=>n(e)||bn(e,t))).slice(0,-1):[])(e,t,z),Lm=(e,t)=>[e].concat(Fm(e,t)),jm=(e,t,n)=>hu(e,t,n,Sm),Bm=(e,t,n)=>J(Lm(hn(t.container()),e),(e=>t=>e.isBlock(wn(t)))(n)),Hm=(e,t,n,i)=>jm(e,t.dom,n).forall((e=>Bm(t,n,i).fold((()=>!Nh(e,n,t.dom)),(i=>!Nh(e,n,t.dom)&&yn(i,hn(e.container())))))),Um=(e,t,n,i)=>Bm(t,n,i).fold((()=>jm(e,t.dom,n).forall((e=>!Nh(e,n,t.dom)))),(t=>jm(e,t.dom,n).isNone())),$m=D(Um,!1),qm=D(Um,!0),Wm=D(Hm,!1),Vm=D(Hm,!0),Km=e=>Vh(e).exists(ma),Gm=(e,t,n,i)=>{const o=G(Lm(hn(n.container()),t),(e=>i.isBlock(wn(e)))),r=le(o).getOr(t);return cu(e,r.dom,n).filter(Km)},Xm=(e,t,n)=>Vh(t).exists(ma)||Gm(!0,e,t,n).isSome(),Ym=(e,t,n)=>(e=>F.from(e.getNode(!0)).map(hn))(t).exists(ma)||Gm(!1,e,t,n).isSome(),Qm=D(Gm,!1),Jm=D(Gm,!0),Zm=e=>Cl.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd(),eg=(e,t,n)=>{const i=G(Lm(hn(t.container()),e),(e=>n.isBlock(wn(e))));return le(i).getOr(e)},tg=(e,t,n)=>Zm(t)?Cm(t):Cm(t)||fu(eg(e,t,n).dom,t).exists(Cm),ng=(e,t,n)=>Zm(t)?km(t):km(t)||pu(eg(e,t,n).dom,t).exists(km),ig=e=>Vh(e).bind((e=>Qi(e,Sn))).exists((e=>(e=>U(["pre","pre-wrap"],e))(Ii(e,"white-space")))),og=(e,t)=>n=>{return i=new Po(n,e)[t](),x(i)&&or(i)&&Sh(i);var i},rg=(e,t,n)=>!ig(t)&&(((e,t,n)=>((e,t)=>fu(e.dom,t).isNone())(e,t)||((e,t)=>pu(e.dom,t).isNone())(e,t)||$m(e,t,n)||qm(e,t,n)||Ym(e,t,n)||Xm(e,t,n))(e,t,n)||tg(e,t,n)||ng(e,t,n)),sg=(e,t,n)=>!ig(t)&&($m(e,t,n)||Wm(e,t,n)||Ym(e,t,n)||tg(e,t,n)||((e,t)=>{const n=fu(e.dom,t).getOr(t),i=og(e.dom,"prev");return t.isAtStart()&&(i(t.container())||i(n.container()))})(e,t)),ag=(e,t,n)=>!ig(t)&&(qm(e,t,n)||Vm(e,t,n)||Xm(e,t,n)||ng(e,t,n)||((e,t)=>{const n=pu(e.dom,t).getOr(t),i=og(e.dom,"next");return t.isAtEnd()&&(i(t.container())||i(n.container()))})(e,t)),lg=(e,t,n)=>sg(e,t,n)||ag(e,(e=>{const t=e.container(),n=e.offset();return Go(t)&&n<t.data.length?Cl(t,n+1):e})(t),n),cg=(e,t)=>Pu(e.charAt(t)),dg=(e,t)=>Mu(e.charAt(t)),hg=(e,t,n,i)=>{const o=t.data,r=Cl(t,0);return n||!cg(o,0)||lg(e,r,i)?!!(n&&dg(o,0)&&sg(e,r,i))&&(t.data=at+o.slice(1),!0):(t.data=" "+o.slice(1),!0)},ug=(e,t,n,i)=>{const o=t.data,r=Cl(t,o.length-1);return n||!cg(o,o.length-1)||lg(e,r,i)?!!(n&&dg(o,o.length-1)&&ag(e,r,i))&&(t.data=o.slice(0,-1)+at,!0):(t.data=o.slice(0,-1)+" ",!0)},pg=(e,t,n,i)=>{if(0===n)return;const o=hn(e),r=Yi(o,(e=>i.isBlock(wn(e)))).getOr(o),s=e.data.slice(t,t+n),a=t+n>=e.data.length&&ag(r,Cl(e,e.data.length),i),l=0===t&&sg(r,Cl(e,0),i);e.replaceData(t,n,No(s,4,l,a))},fg=(e,t,n)=>{const i=e.data.slice(t),o=i.length-Je(i).length;pg(e,t,o,n)},mg=(e,t,n)=>{const i=e.data.slice(0,t),o=i.length-Ze(i).length;pg(e,t-o,o,n)},gg=(e,t,n,i,o=!0)=>{const r=Ze(e.data).length,s=o?e:t,a=o?t:e;return o?s.appendData(a.data):s.insertData(0,a.data),bi(hn(a)),i&&fg(s,r,n),s},vg=(e,t)=>((e,t)=>{const n=e.container(),i=e.offset();return!Cl.isTextPosition(e)&&n===t.parentNode&&i>Cl.before(t).offset()})(t,e)?Cl(t.container(),t.offset()-1):t,bg=e=>{return ol(e.previousSibling)?F.some((t=e.previousSibling,Go(t)?Cl(t,t.data.length):Cl.after(t))):e.previousSibling?gu(e.previousSibling):F.none();var t},yg=e=>{return ol(e.nextSibling)?F.some((t=e.nextSibling,Go(t)?Cl(t,0):Cl.before(t))):e.nextSibling?mu(e.nextSibling):F.none();var t},xg=(e,t,n)=>{n.fold((()=>{e.focus()}),(n=>{e.selection.setRng(n.toRange(),t)}))},wg=(e,t)=>t&&Ce(e.schema.getBlockElements(),wn(t)),_g=(e,t,n,i=!0,o=!1)=>{const r=((e,t,n)=>((e,t,n)=>e?((e,t)=>yg(t).orThunk((()=>bg(t))).orThunk((()=>((e,t)=>pu(e,Cl.after(t)).orThunk((()=>fu(e,Cl.before(t)))))(e,t))))(t,n):((e,t)=>bg(t).orThunk((()=>yg(t))).orThunk((()=>((e,t)=>F.from(t.previousSibling?t.previousSibling:t.parentNode).bind((t=>fu(e,Cl.before(t)))).orThunk((()=>pu(e,Cl.after(t)))))(e,t))))(t,n))(e,t,n).map(D(vg,n)))(t,e.getBody(),n.dom),s=Yi(n,D(wg,e),(a=e.getBody(),e=>e.dom===a));var a;const l=((e,t,n,i)=>{const o=Nn(e).filter(Tn),r=Fn(e).filter(Tn);return bi(e),(s=o,a=r,l=t,c=(e,t,o)=>{const r=e.dom,s=t.dom,a=r.data.length;return gg(r,s,n,i),o.container()===s?Cl(r,a):o},s.isSome()&&a.isSome()&&l.isSome()?F.some(c(s.getOrDie(),a.getOrDie(),l.getOrDie())):F.none()).orThunk((()=>(i&&(o.each((e=>mg(e.dom,e.dom.length,n))),r.each((e=>fg(e.dom,0,n)))),t)));var s,a,l,c})(n,r,e.schema,((e,t)=>Ce(e.schema.getTextInlineElements(),wn(t)))(e,n));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):s.bind((t=>((e,t,n)=>{if(mr(e,t)){const e=ln('<br data-mce-bogus="1">');return n?W(Bn(t),(e=>{pp(e)||bi(e)})):vi(t),si(t,e),F.some(Cl.before(e.dom))}return F.none()})(e.schema,t,o))).fold((()=>{i&&xg(e,t,l)}),(n=>{i&&xg(e,t,F.some(n))}))},kg=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Cg=(e,t)=>gn(hn(t),Vc(e))&&!Pr(e.schema,t)&&e.dom.isEditable(t),Sg=e=>{var t;return"rtl"===Ks.DOM.getStyle(e,"direction",!0)||(e=>kg.test(e))(null!==(t=e.textContent)&&void 0!==t?t:"")},Tg=(e,t,n)=>{const i=((e,t,n)=>
vendor: 3,877 bytes, line 135
135G(Ks.DOM.getParents(n.container(),"*",t),e))(e,t,n);return F.from(i[i.length-1])},Eg=(e,t)=>{const n=t.container(),i=t.offset();return e?Da(n)?Go(n.nextSibling)?Cl(n.nextSibling,0):Cl.after(n):Ma(t)?Cl(n,i+1):t:Da(n)?Go(n.previousSibling)?Cl(n.previousSibling,n.previousSibling.data.length):Cl.before(n):Ra(t)?Cl(n,i-1):t},Ag=D(Eg,!0),Og=D(Eg,!1),Dg=(e,t)=>{const n=e=>e.stopImmediatePropagation();e.on("beforeinput input",n,!0),e.getDoc().execCommand(t),e.off("beforeinput input",n)},Ig=e=>Dg(e,"Delete"),Pg=e=>Dg(e,"ForwardDelete"),Mg=e=>ga(e)||ba(e),Rg=(e,t)=>yn(e,t)?Qi(t,Mg,(e=>t=>Le(Mn(t),e,bn))(e)):F.none(),zg=(e,t=!0)=>{e.dom.isEmpty(e.getBody())&&e.setContent("",{no_selection:!t})},Ng=(e,t,n)=>Be(mu(n),gu(n),((i,o)=>{const r=Eg(!0,i),s=Eg(!1,o),a=Eg(!1,t);return e?pu(n,a).exists((e=>e.isEqual(s)&&t.isEqual(r))):fu(n,a).exists((e=>e.isEqual(r)&&t.isEqual(s)))})).getOr(!0),Fg=e=>{var t;return(8===_n(t=e)||"#comment"===wn(t)?Nn(e):$n(e)).bind(Fg).orThunk((()=>F.some(e)))},Lg=(e,t,n,i=!0)=>{var o;t.deleteContents();const r=Fg(n).getOr(n),s=hn(null!==(o=e.dom.getParent(r.dom,e.dom.isBlock))&&void 0!==o?o:n.dom);if(s.dom===e.getBody()?zg(e,i):mr(e.schema,s,{checkRootAsContent:!1})&&(ka(s),i&&e.selection.setCursorLocation(s.dom,0)),!bn(n,s)){const t=Le(Mn(s),n)?[]:Mn(a=s).map(Bn).map((e=>G(e,(e=>!bn(a,e))))).getOr([]);W(t.concat(Bn(n)),(t=>{bn(t,s)||yn(t,s)||!mr(e.schema,t)||bi(t)}))}var a},jg=e=>mo(e,"td,th"),Bg=(e,t)=>Lu(hn(e),t),Hg=(e,t)=>({start:e,end:t}),Ug=Te([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),$g=(e,t)=>to(hn(e),"td,th",t),qg=e=>!bn(e.start,e.end),Wg=(e,t)=>Lu(e.start,t).bind((n=>Lu(e.end,t).bind((e=>He(bn(n,e),n))))),Vg=e=>t=>Wg(t,e).map((e=>((e,t,n)=>({rng:e,table:t,cells:n}))(t,e,jg(e)))),Kg=(e,t,n,i)=>{if(n.collapsed||!e.forall(qg))return F.none();if(t.isSameTable){const t=e.bind(Vg(i));return F.some({start:t,end:t})}{const e=$g(n.startContainer,i),t=$g(n.endContainer,i),o=e.bind((e=>t=>Lu(t,e).bind((e=>ce(jg(e)).map((e=>Hg(t,e))))))(i)).bind(Vg(i)),r=t.bind((e=>t=>Lu(t,e).bind((e=>le(jg(e)).map((e=>Hg(e,t))))))(i)).bind(Vg(i));return F.some({start:o,end:r})}},Gg=(e,t)=>Z(e,(e=>bn(e,t))),Xg=e=>Be(Gg(e.cells,e.rng.start),Gg(e.cells,e.rng.end),((t,n)=>e.cells.slice(t,n+1))),Yg=(e,t)=>{const{startTable:n,endTable:i}=t,o=e.cloneRange();return n.each((e=>o.setStartAfter(e.dom))),i.each((e=>o.setEndBefore(e.dom))),o},Qg=e=>W(e,(e=>{mi(e,"contenteditable"),ka(e)})),Jg=(e,t,n,i)=>{const o=n.cloneRange();i?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(t.dom.lastChild)):(o.setStartBefore(t.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),nv(e,o,t,!1).each((e=>e()))},Zg=e=>{const t=Fu(e),n=hn(e.selection.getNode());sr(n.dom)&&mr(e.schema,n)?e.selection.setCursorLocation(n.dom,0):e.selection.collapse(!0),t.length>1&&$(t,(e=>bn(e,n)))&&di(n,"data-mce-selected","1")},ev=(e,t,n)=>F.some((()=>{const i=e.selection.getRng(),o=n.bind((({rng:n,isStartInTable:o})=>{const r=((e,t)=>F.from(e.dom.getParent(t,e.dom.isBlock)).map(hn))(e,o?n.endContainer:n.startContainer);n.deleteContents(),((e,t,n)=>{n.each((n=>{t?bi(n):(ka(n),e.selection.setCursorLocation(n.dom,0))}))})(e,o,r.filter(D(mr,e.schema)));const s=o?t[0]:t[t.length-1];return Jg(e,s,i,o),mr(e.schema,s)?F.none():F.some(o?t.slice(1):t.slice(0,-1))})).getOr(t);Qg(o),Zg(e)})),tv=(e,t,n,i)=>F.some((()=>{const o=e.selection.getRng(),r=t[0],s=n[n.length-1];Jg(e,r,o,!0),Jg(e,s,o,!1);const a=mr(e.schema,r)?t:t.slice(1),l=mr(e.schema,s)?n:n.slice(0,-1);Qg(a.concat(l)),i.deleteContents(),Zg(e)})),nv=(e,t,n,i=!0)=>F.some((()=>{Lg(e,t,n,i)})),iv=(e,t)=>F.some((()=>_g(e,!1,t))),ov=(e,t)=>J(Lm(t,e),xa),rv=(e,t)=>J(Lm(t,e),On("caption")),sv=(e,t)=>F.some((()=>{ka(t),e.selection.setCursorLocation(t.dom,0)})),av=(e,t)=>e?Mm(t):Rm(t),lv=(e,t)=>
vendor: 3,779 bytes, line 135
135{const n=hn(e.selection.getStart(!0)),i=Fu(e);return e.selection.isCollapsed()&&0===i.length?((e,t,n)=>{const i=hn(e.getBody());return rv(i,n).fold((()=>((e,t,n,i)=>{const o=Cl.fromRangeStart(e.selection.getRng());return ov(n,i).bind((i=>mr(e.schema,i,{checkRootAsContent:!1})?sv(e,i):((e,t,n,i,o)=>du(n,e.getBody(),o).bind((e=>ov(t,hn(e.getNode())).bind((e=>bn(e,i)?F.none():F.some(C))))))(e,n,t,i,o)))})(e,t,i,n).orThunk((()=>He(((e,t)=>{const n=Cl.fromRangeStart(e.selection.getRng());return av(t,n)||cu(t,e.getBody(),n).exists((e=>av(t,e)))})(e,t),C)))),(n=>((e,t,n,i)=>{const o=Cl.fromRangeStart(e.selection.getRng());return mr(e.schema,i)?sv(e,i):((e,t,n,i,o)=>du(n,e.getBody(),o).fold((()=>F.some(C)),(r=>((e,t,n,i)=>mu(e.dom).bind((o=>gu(e.dom).map((e=>t?n.isEqual(o)&&i.isEqual(e):n.isEqual(e)&&i.isEqual(o))))).getOr(!0))(i,n,o,r)?((e,t)=>sv(e,t))(e,i):((e,t,n)=>rv(e,hn(n.getNode())).fold((()=>F.some(C)),(e=>He(!bn(e,t),C))))(t,i,r))))(e,n,t,i,o)})(e,t,i,n)))})(e,t,n):((e,t,n)=>{const i=hn(e.getBody()),o=e.selection.getRng();return 0!==n.length?ev(e,n,F.none()):((e,t,n,i)=>rv(t,i).fold((()=>((e,t,n)=>((e,t)=>{const n=(e=>t=>bn(e,t))(e),i=((e,t)=>{const n=$g(e.startContainer,t),i=$g(e.endContainer,t);return Be(n,i,Hg)})(t,n),o=((e,t)=>{const n=Bg(e.startContainer,t),i=Bg(e.endContainer,t),o=n.isSome(),r=i.isSome(),s=Be(n,i,bn).getOr(!1);return(e=>Be(e.startTable,e.endTable,((t,n)=>{const i=vo(t,(e=>bn(e,n))),o=vo(n,(e=>bn(e,t)));return i||o?{...e,startTable:i?F.none():e.startTable,endTable:o?F.none():e.endTable,isSameTable:!1,isMultiTable:!1}:e})).getOr(e))({startTable:n,endTable:i,isStartInTable:o,isEndInTable:r,isSameTable:s,isMultiTable:!s&&o&&r})})(t,n);return((e,t,n)=>e.exists((e=>((e,t)=>!qg(e)&&Wg(e,t).exists((e=>{const t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})))(e,n)&&Hu(e.start,t))))(i,t,n)?i.map((e=>Ug.singleCellTable(t,e.start))):o.isMultiTable?((e,t,n,i)=>Kg(e,t,n,i).bind((({start:e,end:i})=>{const o=e.bind(Xg).getOr([]),r=i.bind(Xg).getOr([]);if(o.length>0&&r.length>0){const e=Yg(n,t);return F.some(Ug.multiTable(o,r,e))}return F.none()})))(i,o,t,n):((e,t,n,i)=>Kg(e,t,n,i).bind((({start:e,end:t})=>e.or(t))).bind((e=>{const{isSameTable:i}=t,o=Xg(e).getOr([]);if(i&&e.cells.length===o.length)return F.some(Ug.fullTable(e.table));if(o.length>0){if(i)return F.some(Ug.partialTable(o,F.none()));{const e=Yg(n,t);return F.some(Ug.partialTable(o,F.some({...t,rng:e})))}}return F.none()})))(i,o,t,n)})(t,n).bind((t=>t.fold(D(nv,e),D(iv,e),D(ev,e),D(tv,e)))))(e,t,n)),(t=>((e,t)=>sv(e,t))(e,t))))(e,i,o,t)})(e,n,i)},cv=(e,t)=>{let n=t;for(;n&&n!==e;){if(ir(n)||or(n))return n;n=n.parentNode}return null},dv=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],hv=sn.each,uv=e=>{const t=e.dom,n=new Set(e.serializer.getTempAttrs()),i=e=>$(dv,(t=>Ge(e,t)))||n.has(e);return{compare:(e,n)=>{if(e.nodeName!==n.nodeName||e.nodeType!==n.nodeType)return!1;const o=e=>{const n={};return hv(t.getAttribs(e),(o=>{const r=o.nodeName.toLowerCase();"style"===r||i(r)||(n[r]=t.getAttrib(e,r))})),n},r=(e,t)=>{for(const n in e)if(Ce(e,n)){const i=t[n];if(b(i))return!1;if(e[n]!==i)return!1;delete t[n]}for(const e in t)if(Ce(t,e))return!1;return!0};if(jo(e)&&jo(n)){if(!r(o(e),o(n)))return!1;if(!r(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style"))))return!1}return!Iu(e)&&!Iu(n)},isAttributeInternal:i}},pv=e=>["h1","h2","h3","h4","h5","h6"].includes(e.name),fv=(e,t,n,i)=>{const o=n.name;for(let t=0,r=e.length;t<r;t++){const r=e[t];if(r.name===o){const e=i.nodes[o];e?e.nodes.push(n):i.nodes[o]={filter:r,nodes:[n]}}}if(n.attributes)for(let e=0,o=t.length;e<o;e++){const o=t[e],r=o.name;if(r in n.attributes.map){const e=i.attributes[r];e?e.nodes.push(n):i.attributes[r]={filter:o,nodes:[n]}}}},mv=(e,t)=>
vendor: 4,805 bytes, line 135
135{const n=(e,n)=>{me(e,(e=>{const i=de(e.nodes);W(e.filter.callbacks,(o=>{for(let t=i.length-1;t>=0;t--){const o=i[t];(n?void 0!==o.attr(e.filter.name):o.name===e.filter.name)&&!y(o.parent)||i.splice(t,1)}i.length>0&&o(i,e.filter.name,t)}))}))};n(e.nodes,!1),n(e.attributes,!0)},gv=(e,t,n,i={})=>{const o=((e,t,n)=>{const i={nodes:{},attributes:{}};return n.firstChild&&(n=>{let o=n;for(;o=o.walk();)fv(e,t,o,i)})(n),i})(e,t,n);mv(o,i)},vv=(e,t,n,i)=>{if((e.pad_empty_with_br||t.insert)&&n(i)){const e=new Jf("br",1);t.insert&&e.attr("data-mce-bogus","1"),i.empty().append(e)}else i.empty().append(new Jf("#text",3)).value=at},bv=(e,t)=>{const n=null==e?void 0:e.firstChild;return x(n)&&n===e.lastChild&&n.name===t},yv=(e,t,n,i)=>i.isEmpty(t,n,(t=>((e,t)=>{const n=e.getElementRule(t.name);return!0===(null==n?void 0:n.paddEmpty)})(e,t))),xv=e=>{let t;for(let n=e;n;n=n.parent){const e=n.attr("contenteditable");if("false"===e)break;"true"===e&&(t=n)}return F.from(t)},wv=(e,t,n=e.parent)=>{if(t.getSpecialElements()[e.name])e.empty().remove();else{const i=e.children();for(const e of i)n&&!t.isValidChild(n.name,e.name)&&wv(e,t,n);e.unwrap()}},_v=(e,t,n,i=C)=>{const o=t.getTextBlockElements(),r=t.getNonEmptyElements(),s=t.getWhitespaceElements(),a=sn.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),l=new Set,c=e=>e!==n&&!a[e.name];for(let n=0;n<e.length;n++){const a=e[n];let d,h,u;if(!a.parent||l.has(a))continue;if(o[a.name]&&"li"===a.parent.name){let e=a.next;for(;e&&o[e.name];)e.name="li",l.add(e),a.parent.insert(e,a.parent),e=e.next;a.unwrap();continue}const p=[a];for(d=a.parent;d&&!t.isValidChild(d.name,a.name)&&c(d);d=d.parent)p.push(d);if(d&&p.length>1)if(kv(t,a,d))wv(a,t);else{p.reverse(),h=p[0].clone(),i(h);let e=h;for(let n=0;n<p.length-1;n++){t.isValidChild(e.name,p[n].name)&&n>0?(u=p[n].clone(),i(u),e.append(u)):u=e;for(let e=p[n].firstChild;e&&e!==p[n+1];){const t=e.next;u.append(e),e=t}e=u}yv(t,r,s,h)?d.insert(a,p[0],!0):(d.insert(h,p[0],!0),d.insert(a,h)),d=p[0],(yv(t,r,s,d)||bv(d,"br"))&&d.empty().remove()}else if(a.parent){if("li"===a.name){let e=a.prev;if(e&&("ul"===e.name||"ol"===e.name)){e.append(a);continue}if(e=a.next,e&&("ul"===e.name||"ol"===e.name)&&e.firstChild){e.insert(a,e.firstChild,!0);continue}const t=new Jf("ul",1);i(t),a.wrap(t);continue}if(t.isValidChild(a.parent.name,"div")&&t.isValidChild("div",a.name)){const e=new Jf("div",1);i(e),a.wrap(e)}else wv(a,t)}}},kv=(e,t,n=t.parent)=>!(!n||(!e.children[t.name]||e.isValidChild(n.name,t.name))&&("a"!==t.name||!(e=>{let t=e;for(;t;){if("a"===t.name)return!0;t=t.parent}return!1})(n))&&(!(e=>"summary"===e.name)(n)||!pv(t)||(null==n?void 0:n.firstChild)===t&&(null==n?void 0:n.lastChild)===t)),Cv=e=>e.collapsed?e:(e=>{const t=Cl.fromRangeStart(e),n=Cl.fromRangeEnd(e),i=e.commonAncestorContainer;return cu(!1,i,n).map((o=>!Nh(t,n,i)&&Nh(t,o,i)?((e,t,n,i)=>{const o=document.createRange();return o.setStart(e,t),o.setEnd(n,i),o})(t.container(),t.offset(),o.container(),o.offset()):e)).getOr(e)})(e),Sv=(e,t)=>{const n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Tv=(e,t)=>{const n=Cl.after(e),i=ru(t).prev(n);return i?i.toRange():null},Ev=(e,t,n,i)=>{const o=((e,t,n)=>{const i=t.serialize(n);return(e=>{var t,n;const i=e.firstChild,o=e.lastChild;return i&&"META"===i.nodeName&&(null===(t=i.parentNode)||void 0===t||t.removeChild(i)),o&&"mce_marker"===o.id&&(null===(n=o.parentNode)||void 0===n||n.removeChild(o)),e})(e.createFragment(i))})(t,e,i),r=Sv(t,n.startContainer),s=(e=>{return e.length>0&&(!(n=e[e.length-1]).firstChild||x(null==(t=n)?void 0:t.firstChild)&&t.firstChild===t.lastChild&&(e=>e.data===at||er(e))(t.firstChild))?e.slice(0,-1):e;var t,n})((a=o.firstChild,G(null!==(l=null==a?void 0:a.childNodes)&&void 0!==l?l:[],(e=>"LI"===e.nodeName))));var a,l;const c=t.getRoot(),d=e=>{const i=Cl.fromRangeStart(n),o=ru(t.getRoot()),s=1===e?o.prev(i):o.next(i),a=null==s?void 0:s.getNode();return!a||Sv(t,a)!==r};return r?d(1)?((e,t,n)=>{const i=e.parentNode;return i&&sn.each(t,(t=>{i.insertBefore(t,e)})),((e,t)=>{const n=Cl.before(e),i=ru(t).next(n);return i?i.toRange():null})(e,n)})(r,s,c):d(2)?((e,t,n,i)=>(i.insertAfter(t.reverse(),e),Tv(t[0],n)))(r,s,c,t):((e,t,n,i)=>{const o=((e,t)=>{const n=t.cloneRange(),i=t.cloneRange();return n.setStartBefore(e),i.setEndAfter(e),[n.cloneContents(),i.cloneContents()]})(e,i),r=e.parentNode;return r&&(r.insertBefore(o[0],e),sn.each(t,(t=>{r.insertBefore(t,e)})),r.insertBefore(o[1],e),r.removeChild(e)),Tv(t[t.length-1],n)})(r,s,c,n):null},Av=["pre"],Ov=sr,Dv=(e,t)=>e.startContainer===e.endContainer&&e.endOffset-e.startOffset==1&&t(e.startContainer.childNodes[e.startOffset]),Iv=(e,t,n)=>{var i,o;const r=e.selection,s=e.dom,a=e.parser,l=n.merge,c=gm({validate:!0},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">
135&#xFEFF;</span>';n.preserve_zwsp||(t=Ta(t)),-1===t.indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);let h=r.getRng();const u=h.startContainer,p=e.getBody();u===p&&r.isCollapsed()&&s.isBlock(p.firstChild)&&((e,t)=>x(t)&&!e.schema.getVoidElements()[t.nodeName])(e,p.firstChild)&&s.isEmpty(p.firstChild)&&(h=s.createRng(),h.setStart(p.firstChild,0),h.setEnd(p.firstChild,0),r.setRng(h)),r.isCollapsed()||(e=>{const t=e.dom,n=Cv(e.selection.getRng());e.selection.setRng(n);const i=t.getParent(n.startContainer,Ov);((e,t,n)=>!!x(n)&&n===e.getParent(t.endContainer,Ov)&&Hu(hn(n),t))(t,n,i)?nv(e,n,hn(i)):(e=>Dv(e,nr))(n)||(e=>Dv(e,Go))(n)?n.deleteContents():e.getDoc().execCommand("Delete",!1)})(e);const f=r.getNode(),m={context:f.nodeName.toLowerCase(),data:n.data,insert:!0},g=a.parse(t,m);if(!0===n.paste&&((e,t)=>{let n=t.firstChild,i=t.lastChild;return n&&"meta"===n.name&&(n=n.next),i&&"mce_marker"===i.attr("id")&&(i=i.prev),((e,t)=>{const n=e.getNonEmptyElements();return x(t)&&(t.isEmpty(n)||((e,t)=>e.getBlockElements()[t.name]&&(e=>x(e.firstChild)&&e.firstChild===e.lastChild)(t)&&(e=>"br"===e.name||e.value===at)(t.firstChild))(e,t))})(e,i)&&(i=null==i?void 0:i.prev),!(!n||n!==i||"ul"!==n.name&&"ol"!==n.name)})(e.schema,g)&&((e,t)=>!!Sv(e,t))(s,f))return h=Ev(c,s,r.getRng(),g),h&&r.setRng(h),t;!0===n.paste&&((e,t,n,i)=>{var o;const r=t.firstChild,s=t.lastChild,a=r===("bookmark"===s.attr("data-mce-type")?s.prev:s),l=U(Av,r.name);if(a&&l){const t="false"!==r.attr("contenteditable"),s=(null===(o=e.getParent(n,e.isBlock))||void 0===o?void 0:o.nodeName.toLowerCase())===r.name,a=F.from(cv(i,n)).forall(ir);return t&&s&&a}return!1})(s,g,f,e.getBody())&&(null===(i=g.firstChild)||void 0===i||i.unwrap()),(e=>{let t=e;for(;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")})(g);let v=g.lastChild;if(v&&"mce_marker"===v.attr("id")){const t=v;for(v=v.prev;v&&"table"!==v.name;v=v.walk(!0))if(3===v.type||!s.isBlock(v.name)){v.parent&&e.schema.isValidChild(v.parent.name,"span")&&v.parent.insert(t,v,"br"===v.name);break}}if(e._selectionOverrides.showBlockCaretContainer(f),m.invalid||((e,t,n)=>{var i;return $(n.children(),pv)&&"SUMMARY"===(null===(i=e.getParent(t,e.isBlock))||void 0===i?void 0:i.nodeName)})(s,f,g)){e.selection.setContent(d);let n,i=r.getNode();const l=e.getBody();for(Jo(i)?i=n=l:n=i;n&&n!==l;)i=n,n=n.parentNode;t=i===l?l.innerHTML:s.getOuterHTML(i);const h=a.parse(t),u=(e=>{for(let t=e;t;t=t.walk())if("mce_marker"===t.attr("id"))return F.some(t);return F.none()})(h),p=u.bind(xv).getOr(h);u.each((e=>e.replace(g)));const f=g.children(),m=null!==(o=g.parent)&&void 0!==o?o:h;g.unwrap();const v=G(f,(t=>kv(e.schema,t,m)));_v(v,e.schema,p),gv(a.getNodeFilters(),a.getAttributeFilters(),h),t=c.serialize(h),i===l?s.setHTML(l,t):s.setOuterHTML(i,t)}else t=c.serialize(g),((e,t,n)=>{var i;"all"===n.getAttribute("data-mce-bogus")?null===(i=n.parentNode)||void 0===i||i.insertBefore(e.dom.createFragment(t),n):((e,t)=>{if(e.isBlock(t)&&e.isEditable(t)){const e=t.childNodes;return 1===e.length&&er(e[0])||0===e.length}return!1})(e.dom,n)?e.dom.setHTML(n,t):e.selection.setContent(t,{no_events:!0})})(e,t,f);var b;return((e,t)=>{const n=e.schema.getTextInlineElements(),i=e.dom;if(t){const t=e.getBody(),o=uv(e),r="*[data-mce-fragment]",s=i.select(r);sn.each(s,(e=>{const s=e=>x(n[e.nodeName.toLowerCase()]),a=e=>1===e.childNodes.length;if(!wm(i,l=e)&&!((e,t)=>wm(e,t)&&$(xm(e,t),(e=>(e=>bm.has(e))(e))))(i,l)&&s(e)&&a(e)){const n=xm(i,e),l=(e,t)=>ne(e,(e=>U(t,e))),c=t=>a(e)&&i.is(t,r)&&s(t)&&(t.nodeName===e.nodeName&&l(n,xm(i,t))||c(t.children[0])),d=n=>x(n)&&n!==t&&(o.compare(e,n)||d(n.parentElement)),h=n=>x(n)&&n!==t&&i.is(n,r)&&(((e,t,n)=>{const i=xm(e,t),o=xm(e,n),r=i=>{var o,r;const s=null!==(o=e.getStyle(t,i))&&void 0!==o?o:"",a=null!==(r=e.getStyle(n,i))&&void 0!==r?r:"";return et(s)&&et(a)&&s!==a};return $(i,(e=>{const t=t=>$(t,(t=>t===e));if(!t(o)&&t(ym)){const e=G(o,(e=>$(ym,(t=>Ge(e,t)))));return $(e,r)}return r(e)}))})(i,e,n)||h(n.parentElement));(c(e.children[0])||d(e.parentElement)&&!h(e.parentElement))&&i.remove(e,!0)}var l}))}})(e,l),((e,t)=>{var n,i,o;let r;const s=e.dom,a=e.selection;if(!t)return;a.scrollIntoView(t);const l=cv(e.getBody(),t);
vendor: 4,961 bytes, line 135
135if(l&&"false"===s.getContentEditable(l))return s.remove(t),void a.select(l);let c=s.createRng();const d=t.previousSibling;if(Go(d)){c.setStart(d,null!==(i=null===(n=d.nodeValue)||void 0===n?void 0:n.length)&&void 0!==i?i:0);const e=t.nextSibling;Go(e)&&(d.appendData(e.data),null===(o=e.parentNode)||void 0===o||o.removeChild(e))}else c.setStartBefore(t),c.setEndBefore(t);const h=s.getParent(t,s.isBlock);if(s.remove(t),h&&s.isEmpty(h)){const t=Ov(h);vi(hn(h)),c.setStart(h,0),c.setEnd(h,0),t||(e=>!!e.getAttribute("data-mce-fragment"))(h)||!(r=(t=>{let n=Cl.fromRangeStart(t);return n=ru(e.getBody()).next(n),null==n?void 0:n.toRange()})(c))?s.add(h,s.create("br",t?{}:{"data-mce-bogus":"1"})):(c=r,s.remove(h))}a.setRng(c)})(e,s.get("mce_marker")),b=e.getBody(),sn.each(b.getElementsByTagName("*"),(e=>{e.removeAttribute("data-mce-fragment")})),((e,t,n)=>{F.from(e.getParent(t,"td,th")).map(hn).each((e=>((e,t)=>{$n(e).each((n=>{Nn(n).each((i=>{t.isBlock(wn(e))&&ma(n)&&t.isBlock(wn(i))&&bi(n)}))}))})(e,n)))})(s,r.getStart(),e.schema),((e,t,n)=>{const i=zn(hn(n),(e=>bn(e,hn(t))));ae(i,i.length-2).filter(Sn).fold((()=>Er(e,t)),(t=>Er(e,t.dom)))})(e.schema,e.getBody(),r.getStart()),t},Pv=e=>e instanceof Jf,Mv=(e,t,n)=>{e.dom.setHTML(e.getBody(),t),!0!==n&&(e=>{rf(e)&&mu(e.getBody()).each((t=>{const n=t.getNode(),i=Wo(n)?mu(n).getOr(t):t;e.selection.setRng(i.toRange())}))})(e)},Rv=np,zv=(e,t,n)=>{const i=e.formatter.get(n);if(i)for(let n=0;n<i.length;n++){const o=i[n];if(cp(o)&&!1===o.inherit&&e.dom.is(t,o.selector))return!0}return!1},Nv=(e,t,n,i,o)=>{const r=e.dom.getRoot();if(t===r)return!1;const s=e.dom.getParent(t,(t=>!!zv(e,t,n)||t.parentNode===r||!!jv(e,t,n,i,!0)));return!!jv(e,s,n,i,o)},Fv=(e,t,n)=>!(!dp(n)||!Rv(t,n.inline))||!(!lp(n)||!Rv(t,n.block))||!!cp(n)&&jo(t)&&e.is(t,n.selector),Lv=(e,t,n,i,o,r)=>{const s=n[i],a="attributes"===i;if(w(n.onmatch))return n.onmatch(t,n,i);if(s)if(dt(s)){for(let n=0;n<s.length;n++)if(a?e.getAttrib(t,s[n]):op(e,t,s[n]))return!0}else for(const i in s)if(Ce(s,i)){const l=a?e.getAttrib(t,i):op(e,t,i),c=tp(s[i],r),d=y(l)||tt(l);if(d&&y(c))continue;if(o&&d&&!n.exact)return!1;if((!o||n.exact)&&!Rv(l,ip(c,i)))return!1}return!0},jv=(e,t,n,i,o)=>{const r=e.formatter.get(n),s=e.dom;if(r&&jo(t))for(let n=0;n<r.length;n++){const a=r[n];if(Fv(e.dom,t,a)&&Lv(s,t,a,"attributes",o,i)&&Lv(s,t,a,"styles",o,i)){const n=a.classes;if(n)for(let o=0;o<n.length;o++)if(!e.dom.hasClass(t,tp(n[o],i)))return;return a}}},Bv=(e,t,n,i,o)=>{if(i)return Nv(e,i,t,n,o);if(i=e.selection.getNode(),Nv(e,i,t,n,o))return!0;const r=e.selection.getStart();return!(r===i||!Nv(e,r,t,n,o))},Hv=Ca,Uv=e=>{if(e){const t=new Po(e,e);for(let e=t.current();e;e=t.next())if(Go(e))return e}return null},$v=e=>{const t=cn("span");return hi(t,{id:vu,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&si(t,dn(Hv)),t},qv=(e,t,n)=>{const i=e.dom,o=e.selection;if(up(t))_g(e,!1,hn(t),n,!0);else{const e=o.getRng(),n=i.getParent(t,i.isBlock),r=e.startContainer,s=e.startOffset,a=e.endContainer,l=e.endOffset,c=(e=>{const t=Uv(e);return t&&t.data.charAt(0)===Hv&&t.deleteData(0,1),t})(t);i.remove(t,!0),r===c&&s>0&&e.setStart(c,s-1),a===c&&l>0&&e.setEnd(c,l-1),n&&i.isEmpty(n)&&ka(hn(n)),o.setRng(e)}},Wv=(e,t,n)=>{const i=e.dom,o=e.selection;if(t)qv(e,t,n);else if(!(t=yu(e.getBody(),o.getStart())))for(;t=i.get(vu);)qv(e,t,n)},Vv=(e,t)=>(e.appendChild(t),t),Kv=(e,t)=>{var n;const i=X(e,((e,t)=>Vv(e,t.cloneNode(!1))),t),o=null!==(n=i.ownerDocument)&&void 0!==n?n:document;return Vv(i,o.createTextNode(Hv))},Gv=e=>Ki(e,Vi(e).replace(new RegExp(" $")," ")),Xv=(e,t)=>{const n=()=>{null===t||e.dom.isEmpty(t)||Nn(hn(t)).each((e=>{Tn(e)?Gv(e):Ji(e,(e=>Tn(e))).each((e=>{Tn(e)&&Gv(e)}))}))};e.once("input",(t=>{t.data&&!Mu(t.data)&&(t.isComposing?e.once("compositionend",(()=>{n()})):n())}))},Yv=(e,t,n,i)=>{const s=e.dom,a=e.selection;let l=!1;const c=e.formatter.get(t);if(!c)return;const d=a.getRng(),h=d.startContainer,u=d.startOffset;let p=h;Go(h)&&(u!==h.data.length&&(l=!0),p=p.parentNode);const f=[];let g;for(;p;){if(jv(e,p,t,n,i)){g=p;break}p.nextSibling&&(l=!0),f.push(p),p=p.parentNode}if(g)if(l){const o=a.getBookmark();d.collapse(!0);let r=Ap(s,d,c,{includeTrailingSpace:!0});r=Cf(r),e.formatter.remove(t,n,r,i),a.moveToBookmark(o)}else{const l=yu(e.getBody(),g),c=x(l)?s.getParents(g.parentNode,N,l):[],d=$v(!1).dom;((e,t,n)=>{var i,o;const r=e.dom,s=r.getParent(n,D(Qu,e.schema));s&&r.isEmpty(s)?null===(i=n.parentNode)||void 0===i||i.replaceChild(t,n):((e=>{const t=mo(e,"br"),n=G((e=>{const t=[];let n=e.dom;for(;n;)t.push(hn(n)),n=n.lastChild;return t})(e).slice(-1),ma);t.length===n.length&&W(n,bi)})(hn(n)),r.isEmpty(n)?null===(o=n.parentNode)||void 0===o||o.replaceChild(t,n):r.insertAfter(t,n))})(e,d,null!=l?l:g);const h=((e,t,n,i,s,a)=>{const l=e.formatter,c=e.dom,d=G(pe(l.get()),(e=>e!==i&&!Ke(e,"removeformat"))),h=((e,t,n)=>Y(n,((n,i)=>{const o=((e,t)=>ap(e,t,(e=>{const t=e=>w(e)||e.length>1&&"%"===e.charAt(0);
vendor: 8,717 bytes, line 135
135return $(["styles","attributes"],(n=>ke(e,n).exists((e=>{const n=m(e)?e:_e(e);return $(n,t)}))))})))(e,i);return e.formatter.matchNode(t,i,{},o)?n.concat([i]):n}),[]))(e,n,d);if(G(h,(t=>!((e,t,n)=>{const i=["inline","block","selector","attributes","styles","classes"],s=e=>xe(e,((e,t)=>$(i,(e=>e===t))));return ap(e,t,(t=>{const i=s(t);return ap(e,n,(e=>{const t=s(e);return((e,t,n=r)=>o(n).eq(e,t))(i,t)}))}))})(e,t,i))).length>0){const e=n.cloneNode(!1);return c.add(t,e),l.remove(i,s,e,a),c.remove(e),F.some(e)}return F.none()})(e,d,g,t,n,i),u=Kv([...f,...h.toArray(),...c],d);l&&qv(e,l,x(l)),a.setCursorLocation(u,1),Xv(e,d),s.isEmpty(g)&&s.remove(g)}},Qv=e=>{const t=$v(!1),n=Kv(e,t.dom);return{caretContainer:t,caretPosition:Cl(n,0)}},Jv=(e,t)=>{const{caretContainer:n,caretPosition:i}=Qv(t);return ii(hn(e),n),bi(hn(e)),i},Zv=(e,t)=>{if(bu(t.dom))return!1;const n=e.schema.getTextInlineElements();return Ce(n,wn(t))&&!bu(t.dom)&&!qo(t.dom)},eb={},tb=Uo(["pre"]);(e=>{eb[e]||(eb[e]=[]),eb[e].push((e=>{if(!e.selection.getRng().collapsed){const t=e.selection.getSelectedBlocks(),n=G(G(t,tb),(e=>t=>{const n=t.previousSibling;return tb(n)&&U(e,n)})(t));W(n,(e=>{((e,t)=>{const n=hn(t),i=In(n).dom;bi(n),li(hn(e),[cn("br",i),cn("br",i),...Bn(n)])})(e.previousSibling,e)}))}}))})("pre");const nb=["fontWeight","fontStyle","color","fontSize","fontFamily"],ib=(e,t)=>{const n=e.get(t);return m(n)?J(n,(e=>dp(e)&&"span"===e.inline&&(e=>p(e.styles)&&$(pe(e.styles),(e=>U(nb,e))))(e))):F.none()},ob=(e,t)=>fu(t,Cl.fromRangeStart(e)).isNone(),rb=(e,t)=>!1===pu(t,Cl.fromRangeEnd(e)).exists((e=>!er(e.getNode())||pu(t,e).isSome())),sb=e=>t=>cr(t)&&e.isEditable(t),ab=e=>G(e.getSelectedBlocks(),sb(e.dom)),lb=sn.each,cb=e=>jo(e)&&!Iu(e)&&!bu(e)&&!qo(e),db=(e,t)=>{for(let n=e;n;n=n[t]){if(Go(n)&&et(n.data))return e;if(jo(n)&&!Iu(n))return n}return e},hb=(e,t,n)=>{const i=uv(e),o=Bo(t)&&e.dom.isEditable(t),r=Bo(n)&&e.dom.isEditable(n);if(o&&r){const o=db(t,"previousSibling"),r=db(n,"nextSibling");if(i.compare(o,r)){for(let e=o.nextSibling;e&&e!==r;){const t=e;e=e.nextSibling,o.appendChild(t)}return e.dom.remove(r),sn.each(sn.grep(r.childNodes),(e=>{o.appendChild(e)})),o}}return n},ub=(e,t,n,i)=>{var o;if(i&&!1!==t.merge_siblings){const t=null!==(o=hb(e,Yu(i),i))&&void 0!==o?o:i;hb(e,t,Yu(t,!0))}},pb=(e,t,n)=>{lb(e.childNodes,(e=>{cb(e)&&(t(e)&&n(e),e.hasChildNodes()&&pb(e,t,n))}))},fb=(e,t)=>n=>!(!n||!op(e,n,t)),mb=(e,t,n)=>i=>{e.setStyle(i,t,n),""===i.getAttribute("style")&&i.removeAttribute("style"),((e,t)=>{"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)})(e,i)},gb=Te([{keep:[]},{rename:["name"]},{removed:[]}]),vb=/^(src|href|style)$/,bb=sn.each,yb=np,xb=(e,t,n)=>e.isChildOf(t,n)&&t!==n&&!e.isBlock(n),wb=(e,t,n)=>{let i=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"];if(jo(i)){const e=i.childNodes.length-1;!n&&o&&o--,i=i.childNodes[o>e?e:o]}return Go(i)&&n&&o>=i.data.length&&(i=new Po(i,e.getBody()).next()||i),Go(i)&&!n&&0===o&&(i=new Po(i,e.getBody()).prev()||i),i},_b=(e,t)=>{const n=t?"firstChild":"lastChild",i=e[n];return(e=>/^(TR|TH|TD)$/.test(e.nodeName))(e)&&i?"TR"===e.nodeName&&i[n]||i:e},kb=(e,t,n,i)=>{var o;const r=e.create(n,i);return null===(o=t.parentNode)||void 0===o||o.insertBefore(r,t),r.appendChild(t),r},Cb=(e,t,n,i,o)=>{const r=hn(t),s=hn(e.create(i,o)),a=n?jn(r):Ln(r);return li(s,a),n?(ii(r,s),ri(s,r)):(oi(r,s),si(s,r)),s.dom},Sb=(e,t,n)=>{const i=t.parentNode;let o;const r=e.dom,s=xc(e);lp(n)&&i===r.getRoot()&&(n.list_block&&yb(t,n.list_block)||W(de(t.childNodes),(t=>{Ju(e,s,t.nodeName.toLowerCase())?o?o.appendChild(t):(o=kb(r,t,s),r.setAttribs(o,wc(e))):o=null}))),(e=>cp(e)&&dp(e)&&Le(ke(e,"mixed"),!0))(n)&&!yb(n.inline,t)||r.remove(t,!0)},Tb=(e,t,n)=>_(e)?{name:t,value:null}:{name:e,value:tp(t,n)},Eb=(e,t)=>{""===e.getAttrib(t,"style")&&(t.removeAttribute("style"),t.removeAttribute("data-mce-style"))},Ab=(e,t,n,i,o)=>{let r=!1;bb(n.styles,((s,a)=>{const{name:l,value:c}=Tb(a,s,i),d=ip(c,l);(n.remove_similar||g(c)||!jo(o)||yb(op(e,o,l),d))&&e.setStyle(t,l,""),r=!0})),r&&Eb(e,t)},Ob=(e,t,n,i,o)=>{const r=e.dom,s=uv(e),a=e.schema;if(dp(t)&&Dr(a,t.inline)&&Pr(a,i)&&i.parentElement===e.getBody())return Sb(e,i,t),gb.removed();if(!t.ceFalseOverride&&i&&"false"===r.getContentEditableParent(i))return gb.keep();if(i&&!Fv(r,i,t)&&!((e,t)=>t.links&&"A"===e.nodeName)(i,t))return gb.keep();const l=i,c=t.preserve_attributes;if(dp(t)&&"all"===t.remove&&m(c)){const e=G(r.getAttribs(l),(e=>U(c,e.name.toLowerCase())));if(r.removeAllAttribs(l),W(e,(e=>r.setAttrib(l,e.name,e.value))),e.length>0)return gb.rename("span")}if("all"!==t.remove){Ab(r,l,t,n,o),bb(t.attributes,((e,i)=>{const{name:s,value:a}=Tb(i,e,n);if(t.remove_similar||g(a)||!jo(o)||yb(r.getAttrib(o,s),a)){if("class"===s){const e=r.getAttrib(l,s);if(e){let t="";if(W(e.split(/\s+/),(e=>{/mce\-\w+/.test(e)&&(t+=(t?" ":"")+e)})),t)return void r.setAttrib(l,s,t)}}if(vb.test(s)&&l.removeAttribute("data-mce-"+s),"style"===s&&Uo(["li"])(l)&&"none"===r.getStyle(l,"list-style-type"))return l.removeAttribute(s),void r.setStyle(l,"list-style-type","none");"class"===s&&l.removeAttribute("className"),l.removeAttribute(s)}})),bb(t.classes,(e=>{e=tp(e,n),jo(o)&&!r.hasClass(o,e)||r.removeClass(l,e)}));const e=r.getAttribs(l);for(let t=0;t<e.length;t++){const n=e[t].nodeName;if(!s.isAttributeInternal(n))return gb.keep()}}return"none"!==t.remove?(Sb(e,l,t),gb.removed()):gb.keep()},Db=(e,t,n,i)=>Ob(e,t,n,i,i).fold(E(i),(t=>(e.dom.createFragment().appendChild(i),e.dom.rename(i,t))),E(null)),Ib=(e,t,n,i,o)=>{(i||e.selection.isEditable())&&((e,t,n,i,o)=>{const r=e.formatter.get(t),s=r[0],a=e.dom,l=e.selection,c=i=>{const a=((e,t,n,i,o)=>{let r;return t.parentNode&&W(sp(e.dom,t.parentNode).reverse(),(t=>{if(!r&&jo(t)&&"_start"!==t.id&&"_end"!==t.id){const s=jv(e,t,n,i,o);s&&!1!==s.split&&(r=t)}})),r})(e,i,t,n,o);return((e,t,n,i,o,r,s,a)=>{var l,c;let d,h;const u=e.dom;if(n){const r=n.parentNode;for(let n=i.parentNode;n&&n!==r;n=n.parentNode){let i=u.clone(n,!1);for(let n=0;n<t.length&&(i=Db(e,t[n],a,i),null!==i);n++);i&&(d&&i.appendChild(d),h||(h=i),d=i)}s.mixed&&u.isBlock(n)||(i=null!==(l=u.split(n,i))&&void 0!==l?l:i),d&&h&&(null===(c=o.parentNode)||void 0===c||c.insertBefore(d,o),h.appendChild(o),dp(s)&&ub(e,s,0,d))}return i})(e,r,a,i,i,0,s,n)},d=t=>$(r,(i=>Pb(e,i,n,t,t))),h=t=>{const n=de(t.childNodes),i=d(t)||$(r,(e=>Fv(a,t,e))),o=t.parentNode;if(!i&&x(o)&&hp(s)&&d(o),s.deep&&n.length)for(let e=0;e<n.length;e++)h(n[e]);W(["underline","line-through","overline"],(n=>{jo(t)&&e.dom.getStyle(t,"text-decoration")===n&&t.parentNode&&rp(a,t.parentNode)===n&&Pb(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},void 0,t)}))},u=e=>{const t=a.get(e?"_start":"_end");if(t){let n=t[e?"firstChild":"lastChild"];return(e=>Iu(e)&&jo(e)&&("_start"===e.id||"_end"===e.id))(n)&&(n=n[e?"firstChild":"lastChild"]),Go(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),a.remove(t,!0),n}return null},p=t=>{let n,i,o=Ap(a,t,r,{includeTrailingSpace:t.collapsed});if(s.split){if(o=Cf(o),n=wb(e,o,!0),i=wb(e,o),n!==i){if(n=_b(n,!0),i=_b(i,!1),xb(a,n,i)){const e=F.from(n.firstChild).getOr(n);return c(Cb(a,e,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void u(!0)}if(xb(a,i,n)){const e=F.from(i.lastChild).getOr(i);return c(Cb(a,e,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void u(!1)}n=kb(a,n,"span",{id:"_start","data-mce-type":"bookmark"}),i=kb(a,i,"span",{id:"_end","data-mce-type":"bookmark"});const e=a.createRng();e.setStartAfter(n),e.setEndBefore(i),Op(a,e,(e=>{W(e,(e=>{Iu(e)||Iu(e.parentNode)||c(e)}))})),c(n),c(i),n=u(!0),i=u()}else n=i=c(n);o.startContainer=n.parentNode?n.parentNode:n,o.startOffset=a.nodeIndex(n),o.endContainer=i.parentNode?i.parentNode:i,o.endOffset=a.nodeIndex(i)+1}Op(a,o,(e=>{W(e,h)}))};if(i){if(Vu(i)){const e=a.createRng();e.setStartBefore(i),e.setEndAfter(i),p(e)}else p(i);tc(e,t,i,n)}else l.isCollapsed()&&dp(s)&&!Fu(e).length?Yv(e,t,n,o):(Gu(e,(()=>qu(e,p)),(i=>dp(s)&&Bv(e,t,n,i))),e.nodeChanged()),((e,t,n)=>{"removeformat"===t?W(ab(e.selection),(t=>{W(nb,(n=>e.dom.setStyle(t,n,""))),Eb(e.dom,t)})):ib(e.formatter,t).each((t=>{W(ab(e.selection),(i=>Ab(e.dom,i,t,n,null)))}))})(e,t,n),tc(e,t,i,n)})(e,t,n,i,o)},Pb=(e,t,n,i,o)=>Ob(e,t,n,i,o).fold(z,(t=>(e.dom.rename(i,t),!0)),N),Mb=sn.each,Rb=sn.each,zb=(e,t,n,i)=>{if(Rb(n.styles,((n,o)=>{e.setStyle(t,o,tp(n,i))})),n.styles){const n=e.getAttrib(t,"style");n&&e.setAttrib(t,"data-mce-style",n)}},Nb=(e,t,n,i)=>{const o=e.formatter.get(t),r=o[0],s=!i&&e.selection.isCollapsed(),a=e.dom,l=e.selection,c=(e,t=r)=>{w(t.onformat)&&t.onformat(e,t,n,i),zb(a,e,t,n),Rb(t.attributes,((t,i)=>{a.setAttrib(e,i,tp(t,n))}
vendor: 12,044 bytes, line 135
135)),Rb(t.classes,(t=>{const i=tp(t,n);a.hasClass(e,i)||a.addClass(e,i)}))},d=(e,t)=>{let n=!1;return Rb(e,(e=>!(!cp(e)||("false"!==a.getContentEditable(t)||e.ceFalseOverride)&&(!x(e.collapsed)||e.collapsed===s)&&a.is(t,e.selector)&&!bu(t)&&(c(t,e),n=!0,1)))),n},h=e=>{if(u(e)){const t=a.create(e);return c(t),t}return null},p=(i,s,a)=>{const l=[];let u=!0;const p=r.inline||r.block,f=h(p);Op(i,s,(s=>{let h;const m=s=>{let g=!1,v=u,b=!1;const y=s.parentNode,w=y.nodeName.toLowerCase(),_=i.getContentEditable(s);x(_)&&(v=u,u="true"===_,g=!0,b=ep(e,s));const k=u&&!g;if(er(s)&&!((e,t,n,i)=>{if(rd(e)&&dp(t)&&n.parentNode){const t=vs(e.schema),o=((e,t)=>((e,t)=>{const n=e.dom;return n.parentNode?((e,t)=>J(e.dom.childNodes,(e=>t(hn(e)))).map(hn))(hn(n.parentNode),(n=>!bn(e,n)&&t(n))):F.none()})(e,t).isSome())(hn(n),(e=>bu(e.dom)));return Se(t,i)&&fr(e.schema,n.parentNode,{skipBogus:!1,includeZwsp:!0})&&!o}return!1})(e,r,s,w))return h=null,void(lp(r)&&i.remove(s));if((i=>(e=>lp(e)&&!0===e.wrapper)(r)&&jv(e,i,t,n))(s))h=null;else{if(((t,n,i)=>{const o=(e=>lp(e)&&!0!==e.wrapper)(r)&&Qu(e.schema,t)&&Ju(e,n,p);return i&&o})(s,w,k)){const e=i.rename(s,p);return c(e),l.push(e),void(h=null)}if(cp(r)){let e=d(o,s);if(!e&&x(y)&&hp(r)&&(e=d(o,y)),!dp(r)||e)return void(h=null)}x(f)&&((t,n,o,s)=>{const l=t.nodeName.toLowerCase(),c=Ju(e,p,l)&&Ju(e,n,p),d=!a&&Go(t)&&Sa(t.data),h=bu(t),u=!dp(r)||!i.isBlock(t);return(o||s)&&c&&!d&&!h&&u})(s,w,k,b)?(h||(h=i.clone(f,!1),y.insertBefore(h,s),l.push(h)),b&&g&&(u=v),h.appendChild(s)):(h=null,W(de(s.childNodes),m),g&&(u=v),h=null)}};W(s,m)})),!0===r.links&&W(l,(e=>{const t=e=>{"A"===e.nodeName&&c(e,r),W(de(e.childNodes),t)};t(e)})),W(l,(s=>{const a=(e=>{let t=0;return W(e.childNodes,(e=>{(e=>x(e)&&Go(e)&&0===e.length)(e)||Iu(e)||t++})),t})(s);!(l.length>1)&&i.isBlock(s)||0!==a?(dp(r)||lp(r)&&r.wrapper)&&(r.exact||1!==a||(s=(e=>J(e.childNodes,Ku).filter((e=>"false"!==i.getContentEditable(e)&&Fv(i,e,r))).map((t=>{const n=i.clone(t,!1);return c(n),i.replace(n,e,!0),i.remove(t,!0),n})).getOr(e))(s)),((e,t,n,i)=>{Mb(t,(t=>{dp(t)&&Mb(e.dom.select(t.inline,i),(i=>{cb(i)&&Pb(e,t,n,i,t.exact?i:null)})),((e,t,n)=>{if(t.clear_child_styles){const i=t.links?"*:not(a)":"*";lb(e.select(i,n),(n=>{cb(n)&&e.isEditable(n)&&lb(t.styles,((t,i)=>{e.setStyle(n,i,"")}))}))}})(e.dom,t,i)}))})(e,o,n,s),((e,t,n,i,o)=>{const r=o.parentNode;jv(e,r,n,i)&&Pb(e,t,i,o)||t.merge_with_parents&&r&&e.dom.getParent(r,(r=>!!jv(e,r,n,i)&&(Pb(e,t,i,o),!0)))})(e,r,t,n,s),((e,t,n,i)=>{if(t.styles&&t.styles.backgroundColor){const o=fb(e,"fontSize");pb(i,(t=>o(t)&&e.isEditable(t)),mb(e,"backgroundColor",tp(t.styles.backgroundColor,n)))}})(i,r,n,s),((e,t,n,i)=>{const o=t=>{if(Bo(t)&&jo(t.parentNode)&&e.isEditable(t)){const n=rp(e,t.parentNode);e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null)}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(sn.walk(i,o,"childNodes"),o(i))})(i,r,0,s),((e,t,n,i)=>{if(dp(t)&&("sub"===t.inline||"sup"===t.inline)){const n=fb(e,"fontSize");pb(i,(t=>n(t)&&e.isEditable(t)),mb(e,"fontSize",""));const o=G(e.select("sup"===t.inline?"sub":"sup",i),e.isEditable);e.remove(o,!0)}})(i,r,0,s),ub(e,r,0,s)):i.remove(s,!0)}))},f=Vu(i)?i:l.getNode();if("false"===a.getContentEditable(f)&&!ep(e,f))return d(o,i=f),void ec(e,t,i,n);if(r){if(i)if(Vu(i)){if(!d(o,i)){const e=a.createRng();e.setStartBefore(i),e.setEndAfter(i),p(a,Ap(a,e,o),!0)}}else p(a,i,!0);else s&&dp(r)&&!Fu(e).length?((e,t,n)=>{let i;const o=e.selection,r=e.formatter.get(t);if(!r)return;const s=o.getRng();let a=s.startOffset;const l=s.startContainer.nodeValue;i=yu(e.getBody(),o.getStart());const c=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(l&&a>0&&a<l.length&&c.test(l.charAt(a))&&c.test(l.charAt(a-1))){const i=o.getBookmark();s.collapse(!0);let a=Ap(e.dom,s,r);a=Cf(a),e.formatter.apply(t,n,a),o.moveToBookmark(i)}else{let r=i?Uv(i):null;i&&(null==r?void 0:r.data)===Hv||(d=e.getDoc(),h=$v(!0).dom,i=d.importNode(h,!0),r=i.firstChild,s.insertNode(i),a=1,Xv(e,i)),e.formatter.apply(t,n,i),o.setCursorLocation(r,a)}var d,h})(e,t,n):(l.setRng(Cv(l.getRng())),Gu(e,(()=>{qu(e,((e,t)=>{const n=t?e:Ap(a,e,o);p(a,n,!1)}))}),N),e.nodeChanged()),ib(e.formatter,t).each((t=>{W((e=>G((e=>{const t=e.getSelectedBlocks(),n=e.getRng();if(e.isCollapsed())return[];if(1===t.length)return ob(n,t[0])&&rb(n,t[0])?t:[];{const e=le(t).filter((e=>ob(n,e))).toArray(),i=ce(t).filter((e=>rb(n,e))).toArray(),o=t.slice(1,-1);return e.concat(o).concat(i)}})(e),sb(e.dom)))(e.selection),(e=>zb(a,e,t,n)))}));((e,t)=>{Ce(eb,e)&&W(eb[e],(e=>{e(t)}))})(t,e)}ec(e,t,i,n)},Fb=(e,t,n,i)=>{(i||e.selection.isEditable())&&Nb(e,t,n,i)},Lb=e=>Ce(e,"vars"),jb=e=>e.selection.getStart(),Bb=(e,t,n,i,o)=>Q(t,(t=>{const r=e.formatter.matchNode(t,n,null!=o?o:{},i);return!b(r)}),(t=>!!zv(e,t,n)||!i&&x(e.formatter.matchNode(t,n,o,!0)))),Hb=(e,t)=>{const n=null!=t?t:jb(e);return G(sp(e.dom,n),(e=>jo(e)&&!qo(e)))},Ub=(e,t,n)=>{const i=Hb(e,t);me(n,((n,o)=>{const r=n=>{const r=Bb(e,i,o,n.similar,Lb(n)?n.vars:void 0),s=r.isSome();if(n.state.get()!==s){n.state.set(s);const e=r.getOr(t);Lb(n)?n.callback(s,{node:e,format:o,parents:i}):W(n.callbacks,(t=>t(s,{node:e,format:o,parents:i})))}};W([n.withSimilar,n.withoutSimilar],r),W(n.withVars,r)}))},$b=sn.explode,qb=()=>{const e={};return{addFilter:(t,n)=>{W($b(t),(t=>{Ce(e,t)||(e[t]={name:t,callbacks:[]}),e[t].callbacks.push(n)}))},getFilters:()=>_e(e),removeFilter:(t,n)=>{W($b(t),(t=>{if(Ce(e,t))if(x(n)){const i=e[t],o=G(i.callbacks,(e=>e!==n));o.length>0?i.callbacks=o:delete e[t]}else delete e[t]}))}}},Wb=e=>{const[t,...n]=e.split(","),i=n.join(","),o=/data:([^/]+\/[^;]+)(;.+)?/.exec(t);if(o){const e=";base64"===o[2],t=(e=>{try{return decodeURIComponent(e)}catch(t){return e}})(i),n=e?(e=>{const t=/([a-z0-9+\/=\s]+)/i.exec(e);return t?t[1]:""})(t):t;return F.some({type:o[1],data:n,base64Encoded:e})}return F.none()},Vb=(e,t,n=!0)=>{let i=t;if(n)try{i=atob(t)}catch(e){return F.none()}const o=new Uint8Array(i.length);for(let e=0;e<o.length;e++)o[e]=i.charCodeAt(e);return F.some(new Blob([o],{type:e}))},Kb=e=>new Promise(((t,n)=>{const i=new FileReader;i.onloadend=()=>{t(i.result)},i.onerror=()=>{var e;n(null===(e=i.error)||void 0===e?void 0:e.message)},i.readAsDataURL(e)}));let Gb=0;const Xb=(e,t,n)=>Wb(e).bind((({data:e,type:i,base64Encoded:o})=>{if(t&&!o)return F.none();{const t=o?e:btoa(e);return n(t,i)}})),Yb=(e,t,n)=>{const i=e.create("blobid"+Gb++,t,n);return e.add(i),i},Qb=(e,t,n=!1)=>Xb(t,n,((t,n)=>F.from(e.getByData(t,n)).orThunk((()=>Vb(n,t).map((n=>Yb(e,n,t))))))),Jb=/^(?:(?:(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)([A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*))(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?)$/,Zb=e=>F.from(e.match(Jb)).bind((e=>ae(e,1))).map((e=>Ge(e,"www.")?e.substring(4):e)),ey=(e,t)=>{F.from(e.attr("src")).bind(Zb).forall((e=>!U(t,e)))&&e.attr("sandbox","")},ty=(e,t)=>Ge(e,`${t}/`),{entries:ny,setPrototypeOf:iy,isFrozen:oy,getPrototypeOf:ry,getOwnPropertyDescriptor:sy}=Object;let{freeze:ay,seal:ly,create:cy}=Object,{apply:dy,construct:hy}="undefined"!=typeof Reflect&&Reflect;ay||(ay=function(e){return e}),ly||(ly=function(e){return e}),dy||(dy=function(e,t,n){return e.apply(t,n)}),hy||(hy=function(e,t){return new e(...t)});const uy=Ey(Array.prototype.forEach),py=Ey(Array.prototype.lastIndexOf),fy=Ey(Array.prototype.pop),my=Ey(Array.prototype.push),gy=Ey(Array.prototype.splice),vy=Ey(String.prototype.toLowerCase),by=Ey(String.prototype.toString),yy=Ey(String.prototype.match),xy=Ey(String.prototype.replace),wy=Ey(String.prototype.indexOf),_y=Ey(String.prototype.trim),ky=Ey(Object.prototype.hasOwnProperty),Cy=Ey(RegExp.prototype.test),Sy=(Ty=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return hy(Ty,t)});var Ty;function Ey(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return dy(e,t,i)}}function Ay(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:vy;iy&&iy(e,null);let i=t.length;for(;i--;){let o=t[i];if("string"==typeof o){const e=n(o);e!==o&&(oy(t)||(t[i]=e),o=e)}e[o]=!0}return e}function Oy(e){for(let t=0;t<e.length;t++)ky(e,t)||(e[t]=null);return e}function Dy(e){const t=cy(null);for(const[n,i]of ny(e))ky(e,n)&&(Array.isArray(i)?t[n]=Oy(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=Dy(i):t[n]=i);return t}function Iy(e,t){for(;null!==e;){const n=sy(e,t);if(n){if(n.get)return Ey(n.get);if("function"==typeof n.value)return Ey(n.value)}e=ry(e)}return function(){return null}}const Py=ay(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),My=ay(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ry=ay(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),zy=ay(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ny=ay(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Fy=ay(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ly=ay(["#text"]),jy=ay(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
135spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),By=ay(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Hy=ay(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Uy=ay(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$y=ly(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qy=ly(/<%[\w\W]*|[\w\W]*%>/gm),Wy=ly(/\$\{[\w\W]*/gm),Vy=ly(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ky=ly(/^aria-[\-\w]+$/),Gy=ly(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xy=ly(/^(?:\w+script|data):/i),Yy=ly(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Qy=ly(/^html$/i),Jy=ly(/^[a-z][.\w]*(-[.\w]+)+$/i);var Zy=Object.freeze({__proto__:null,ARIA_ATTR:Ky,ATTR_WHITESPACE:Yy,CUSTOM_ELEMENT:Jy,DATA_ATTR:Vy,DOCTYPE_NAME:Qy,ERB_EXPR:qy,IS_ALLOWED_URI:Gy,IS_SCRIPT_OR_DATA:Xy,MUSTACHE_EXPR:$y,TMPLIT_EXPR:Wy});const ex=function(){return"undefined"==typeof window?null:window};var tx=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ex();const n=t=>e(t);if(n.version="3.2.4",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const o=i,r=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:d,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:p,trustedTypes:f}=t,m=c.prototype,g=Iy(m,"cloneNode"),v=Iy(m,"remove"),b=Iy(m,"nextSibling"),y=Iy(m,"childNodes"),x=Iy(m,"parentNode");if("function"==typeof a){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let w,_="";const{implementation:k,createNodeIterator:C,createDocumentFragment:S,getElementsByTagName:T}=i,{importNode:E}=o;let A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof ny&&"function"==typeof x&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:D,TMPLIT_EXPR:I,DATA_ATTR:P,ARIA_ATTR:M,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:N}=Zy;let{IS_ALLOWED_URI:F}=Zy,L=null;const j=Ay({},[...Py,...My,...Ry,...Ny,...Ly]);let B=null;const H=Ay({},[...jy,...By,...Hy,...Uy]);
vendor: 4,040 bytes, line 135
135let U=Object.seal(cy(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,q=null,W=!0,V=!0,K=!1,G=!0,X=!1,Y=!0,Q=!1,J=!1,Z=!1,ee=!1,te=!1,ne=!1,ie=!0,oe=!1,re=!0,se=!1,ae={},le=null;const ce=Ay({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const he=Ay({},["audio","video","img","source","image","track"]);let ue=null;const pe=Ay({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",me="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let ve=ge,be=!1,ye=null;const xe=Ay({},[fe,me,ge],by);let we=Ay({},["mi","mo","mn","ms","mtext"]),_e=Ay({},["annotation-xml"]);const ke=Ay({},["title","style","font","a","script"]);let Ce=null;const Se=["application/xhtml+xml","text/html"];let Te=null,Ee=null;const Ae=i.createElement("form"),Oe=function(e){return e instanceof RegExp||e instanceof Function},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ee||Ee!==e){if(e&&"object"==typeof e||(e={}),e=Dy(e),Ce=-1===Se.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Te="application/xhtml+xml"===Ce?by:vy,L=ky(e,"ALLOWED_TAGS")?Ay({},e.ALLOWED_TAGS,Te):j,B=ky(e,"ALLOWED_ATTR")?Ay({},e.ALLOWED_ATTR,Te):H,ye=ky(e,"ALLOWED_NAMESPACES")?Ay({},e.ALLOWED_NAMESPACES,by):xe,ue=ky(e,"ADD_URI_SAFE_ATTR")?Ay(Dy(pe),e.ADD_URI_SAFE_ATTR,Te):pe,de=ky(e,"ADD_DATA_URI_TAGS")?Ay(Dy(he),e.ADD_DATA_URI_TAGS,Te):he,le=ky(e,"FORBID_CONTENTS")?Ay({},e.FORBID_CONTENTS,Te):ce,$=ky(e,"FORBID_TAGS")?Ay({},e.FORBID_TAGS,Te):{},q=ky(e,"FORBID_ATTR")?Ay({},e.FORBID_ATTR,Te):{},ae=!!ky(e,"USE_PROFILES")&&e.USE_PROFILES,W=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,X=e.SAFE_FOR_TEMPLATES||!1,Y=!1!==e.SAFE_FOR_XML,Q=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,re=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,F=e.ALLOWED_URI_REGEXP||Gy,ve=e.NAMESPACE||ge,we=e.MATHML_TEXT_INTEGRATION_POINTS||we,_e=e.HTML_INTEGRATION_POINTS||_e,U=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(U.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(V=!1),te&&(ee=!0),ae&&(L=Ay({},Ly),B=[],!0===ae.html&&(Ay(L,Py),Ay(B,jy)),!0===ae.svg&&(Ay(L,My),Ay(B,By),Ay(B,Uy)),!0===ae.svgFilters&&(Ay(L,Ry),Ay(B,By),Ay(B,Uy)),!0===ae.mathMl&&(Ay(L,Ny),Ay(B,Hy),Ay(B,Uy))),e.ADD_TAGS&&(L===j&&(L=Dy(L)),Ay(L,e.ADD_TAGS,Te)),e.ADD_ATTR&&(B===H&&(B=Dy(B)),Ay(B,e.ADD_ATTR,Te)),e.ADD_URI_SAFE_ATTR&&Ay(ue,e.ADD_URI_SAFE_ATTR,Te),e.FORBID_CONTENTS&&(le===ce&&(le=Dy(le)),Ay(le,e.FORBID_CONTENTS,Te)),re&&(L["#text"]=!0),Q&&Ay(L,["html","head","body"]),L.table&&(Ay(L,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Sy('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Sy('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,_=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;
vendor: 2,222 bytes, line 135
135const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(f,r)),null!==w&&"string"==typeof _&&(_=w.createHTML(""));ay&&ay(e),Ee=e}},Ie=Ay({},[...My,...Ry,...zy]),Pe=Ay({},[...Ny,...Fy]),Me=function(e){my(n.removed,{element:e});try{x(e).removeChild(e)}catch(t){v(e)}},Re=function(e,t){try{my(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){my(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Me(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ze=function(e){let t=null,n=null;if(Z)e="<remove></remove>"+e;else{const t=yy(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Ce&&ve===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=w?w.createHTML(e):e;if(ve===ge)try{t=(new p).parseFromString(o,Ce)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(ve,"template",null);try{t.documentElement.innerHTML=be?_:o}catch(e){}}const r=t.body||t.documentElement;return e&&n&&r.insertBefore(i.createTextNode(n),r.childNodes[0]||null),ve===ge?T.call(t,Q?"html":"body")[0]:Q?t.documentElement:r},Ne=function(e){return C.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Fe=function(e){return e instanceof u&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Le=function(e){return"function"==typeof l&&e instanceof l};function je(e,t,i){uy(e,(e=>{e.call(n,t,i,Ee)}))}const Be=function(e){let t=null;if(je(A.beforeSanitizeElements,e,null),Fe(e))return Me(e),!0;const i=Te(e.nodeName);if(je(A.uponSanitizeElement,e,{tagName:i,allowedTags:L}),e.hasChildNodes()&&!Le(e.firstElementChild)&&Cy(/<[/\w]/g,e.innerHTML)&&Cy(/<[/\w]/g,e.textContent))return Me(e),!0;if(7===e.nodeType)return Me(e),!0;
vendor: 1,108 bytes, line 135
135if(Y&&8===e.nodeType&&Cy(/<[/\w]/g,e.data))return Me(e),!0;if(!L[i]||$[i]){if(!$[i]&&Ue(i)){if(U.tagNameCheck instanceof RegExp&&Cy(U.tagNameCheck,i))return!1;if(U.tagNameCheck instanceof Function&&U.tagNameCheck(i))return!1}if(re&&!le[i]){const t=x(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t)for(let i=n.length-1;i>=0;--i){const o=g(n[i],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,b(e))}}return Me(e),!0}return e instanceof c&&!function(e){let t=x(e);t&&t.tagName||(t={namespaceURI:ve,tagName:"template"});const n=vy(e.tagName),i=vy(t.tagName);return!!ye[e.namespaceURI]&&(e.namespaceURI===me?t.namespaceURI===ge?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||we[i]):Boolean(Ie[n]):e.namespaceURI===fe?t.namespaceURI===ge?"math"===n:t.namespaceURI===me?"math"===n&&_e[i]:Boolean(Pe[n]):e.namespaceURI===ge?!(t.namespaceURI===me&&!_e[i])&&!(t.namespaceURI===fe&&!we[i])&&!Pe[n]&&(ke[n]||!Ie[n]):!("application/xhtml+xml"!==Ce||!ye[e.namespaceURI]))}(e)?(Me(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!Cy(/<\/no(script|embed|frames)/i,e.innerHTML)?(X&&3===e.n
vendor: 4,777 bytes, line 135
135odeType&&(t=e.textContent,uy([O,D,I],(e=>{t=xy(t,e," ")})),e.textContent!==t&&(my(n.removed,{element:e.cloneNode()}),e.textContent=t)),je(A.afterSanitizeElements,e,null),!1):(Me(e),!0)},He=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in Ae))return!1;if(V&&!q[t]&&Cy(P,t));else if(W&&Cy(M,t));else if(!B[t]||q[t]){if(!(Ue(e)&&(U.tagNameCheck instanceof RegExp&&Cy(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&Cy(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t))||"is"===t&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&Cy(U.tagNameCheck,n)||U.tagNameCheck instanceof Function&&U.tagNameCheck(n))))return!1}else if(ue[t]);else if(Cy(F,xy(n,z,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==wy(n,"data:")||!de[e])if(K&&!Cy(R,xy(n,z,"")));else if(n)return!1;return!0},Ue=function(e){return"annotation-xml"!==e&&yy(e,N)},$e=function(e){je(A.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Fe(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let o=t.length;for(;o--;){const r=t[o],{name:s,namespaceURI:a,value:l}=r,c=Te(s);let d="value"===s?l:_y(l);const h=d;if(i.attrName=c,i.attrValue=d,i.keepAttr=!0,i.forceKeepAttr=void 0,je(A.uponSanitizeAttribute,e,i),d=i.attrValue,!oe||"id"!==c&&"name"!==c||(Re(s,e),d="user-content-"+d),Y&&Cy(/((--!?|])>)|<\/(style|title)/i,d)){Re(s,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Re(s,e);continue}if(!G&&Cy(/\/>/i,d)){Re(s,e);continue}X&&uy([O,D,I],(e=>{d=xy(d,e," ")}));const u=Te(e.nodeName);if(He(u,c,d)){if(w&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(a);else switch(f.getAttributeType(u,c)){case"TrustedHTML":d=w.createHTML(d);break;case"TrustedScriptURL":d=w.createScriptURL(d)}if(d!==h)try{a?e.setAttributeNS(a,s,d):e.setAttribute(s,d),Fe(e)?Me(e):fy(n.removed)}catch(e){}}else Re(s,e)}je(A.afterSanitizeAttributes,e,null)},qe=function e(t){let n=null;const i=Ne(t);for(je(A.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)je(A.uponSanitizeShadowNode,n,null),Be(n),$e(n),n.content instanceof s&&e(n.content);je(A.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,r=null,a=null,c=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Le(e)){if("function"!=typeof e.toString)throw Sy("toString is not a function");if("string"!=typeof(e=e.toString()))throw Sy("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||De(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=Te(e.nodeName);if(!L[t]||$[t])throw Sy("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)i=ze("\x3c!----\x3e"),r=i.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?i=r:i.appendChild(r);else{if(!ee&&!X&&!Q&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(i=ze(e),!i)return ee?null:ne?_:""}i&&Z&&Me(i.firstChild);const d=Ne(se?e:i);for(;a=d.nextNode();)Be(a),$e(a),a.content instanceof s&&qe(a.content);if(se)return e;if(ee){if(te)for(c=S.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(B.shadowroot||B.shadowrootmode)&&(c=E.call(o,c,!0)),c}let h=Q?i.outerHTML:i.innerHTML;return Q&&L["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Cy(Qy,i.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+h),X&&uy([O,D,I],(e=>{h=xy(h,e," ")})),w&&ne?w.createHTML(h):h},n.setConfig=function(){De(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){Ee=null,J=!1},n.isValidAttribute=function(e,t,n){Ee||De({});const i=Te(e),o=Te(t);return He(i,o,n)},n.addHook=function(e,t){"function"==typeof t&&my(A[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=py(A[e],t);return-1===n?void 0:gy(A[e],n,1)[0]}return fy(A[e])},n.removeHooks=function(e){A[e]=[]},n.removeAllHooks=function(){A={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();const nx=sn.each,ix=sn.trim,ox=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],rx={ftp:21,http:80,https:443,mailto:25},sx=["img","video"],ax=(e,t,n)=>{const i=(e=>{try{return decodeURIComponent(e)}catch(t){return unescape(e)}})(t).replace(/\s/g,"");return!e.allow_script_urls&&(!!/((java|vb)script|mhtml):/i.test(i)||!e.allow_html_data_urls&&(/^data:image\//i.test(i)?((e,t)=>
vendor: 4,797 bytes, line 135
135x(e)?!e:!x(t)||!U(sx,t))(e.allow_svg_data_urls,n)&&/^data:image\/svg\+xml/i.test(i):/^data:/i.test(i)))};class lx{static parseDataUri(e){let t;const n=decodeURIComponent(e).split(","),i=/data:([^;]+)/.exec(n[0]);return i&&(t=i[1]),{type:t,data:n[1]}}static isDomSafe(e,t,n={}){if(n.allow_script_urls)return!0;{const i=ns.decode(e).replace(/[\s\u0000-\u001F]+/g,"");return!ax(n,i,t)}}static getDocumentBaseUrl(e){var t;let n;return n=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?null!==(t=e.href)&&void 0!==t?t:"":e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/")),n}constructor(e,t={}){this.path="",this.directory="",e=ix(e),this.settings=t;const n=t.base_uri,i=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(i.source=e);const o=0===e.indexOf("//");if(0!==e.indexOf("/")||o||(e=(n&&n.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){const t=n?n.path:new lx(document.location.href).directory;if(""===(null==n?void 0:n.protocol))e="//mce_host"+i.toAbsPath(t,e);else{const o=/([^#?]*)([#?]?.*)/.exec(e);o&&(e=(n&&n.protocol||"http")+"://mce_host"+i.toAbsPath(t,o[1])+o[2])}}e=e.replace(/@@/g,"(mce_at)");const r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);r&&nx(ox,((e,t)=>{let n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),i[e]=n})),n&&(i.protocol||(i.protocol=n.protocol),i.userInfo||(i.userInfo=n.userInfo),i.port||"mce_host"!==i.host||(i.port=n.port),i.host&&"mce_host"!==i.host||(i.host=n.host),i.source=""),o&&(i.protocol="")}setPath(e){const t=/^(.*?)\/?(\w+)?$/.exec(e);t&&(this.path=t[0],this.directory=t[1],this.file=t[2]),this.source="",this.getURI()}toRelative(e){if("./"===e)return e;const t=new lx(e,{base_uri:this});if("mce_host"!==t.host&&this.host!==t.host&&t.host||this.port!==t.port||this.protocol!==t.protocol&&""!==t.protocol)return t.getURI();const n=this.getURI(),i=t.getURI();if(n===i||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===i)return n;let o=this.toRelPath(this.path,t.path);return t.query&&(o+="?"+t.query),t.anchor&&(o+="#"+t.anchor),o}toAbsolute(e,t){const n=new lx(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))}isSameOrigin(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;const t=this.protocol?rx[this.protocol]:null;if(t&&(this.port||t)==(e.port||t))return!0}return!1}toRelPath(e,t){let n,i,o=0,r="";const s=e.substring(0,e.lastIndexOf("/")).split("/"),a=t.split("/");if(s.length>=a.length)for(n=0,i=s.length;n<i;n++)if(n>=a.length||s[n]!==a[n]){o=n+1;break}if(s.length<a.length)for(n=0,i=a.length;n<i;n++)if(n>=s.length||s[n]!==a[n]){o=n+1;break}if(1===o)return t;for(n=0,i=s.length-(o-1);n<i;n++)r+="../";for(n=o-1,i=a.length;n<i;n++)r+=n!==o-1?"/"+a[n]:a[n];return r}toAbsPath(e,t){let n=0;const i=/\/$/.test(t)?"/":"",o=e.split("/"),r=t.split("/"),s=[];nx(o,(e=>{e&&s.push(e)}));const a=[];for(let e=r.length-1;e>=0;e--)0!==r[e].length&&"."!==r[e]&&(".."!==r[e]?n>0?n--:a.push(r[e]):n++);const l=s.length-n;let c;return c=l<=0?ie(a).join("/"):s.slice(0,l).join("/")+"/"+ie(a).join("/"),0!==c.indexOf("/")&&(c="/"+c),i&&c.lastIndexOf("/")!==c.length-1&&(c+=i),c}getURI(e=!1){let t;return this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source}}const cx=sn.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),dx="data-mce-type";let hx=0;const ux=(e,t,n,i,o)=>{var r,s,a,l;const c=t.validate,d=n.getSpecialElements();8===e.nodeType&&!t.allow_conditional_comments&&/^\[if/i.test(null!==(r=e.nodeValue)&&void 0!==r?r:"")&&(e.nodeValue=" "+e.nodeValue);const h=null!==(s=null==o?void 0:o.tagName)&&void 0!==s?s:e.nodeName.toLowerCase();if("html"!==i&&n.isValid(i))return void(x(o)&&(o.allowedTags[h]=!0));if(1!==e.nodeType||"body"===h)return;const p=hn(e),f=fi(p,dx),m=ui(p,"data-mce-bogus");if(!f&&u(m))return void("all"===m?bi(p):yi(p));const g=n.getElementRule(h);if(!c||g){if(x(o)&&(o.allowedTags[h]=!0),c&&g&&!f){if(W(null!==(a=g.attributesForced)&&void 0!==a?a:[],(e=>{di(p,e.name,"{$uid}"===e.value?"mce_"+hx++:e.value)})),W(null!==(l=g.attributesDefault)&&void 0!==l?l:[],(e=>{fi(p,e.name)||di(p,e.name,"{$uid}"===e.value?"mce_"+hx++:e.value)})),g.attributesRequired&&!$(g.attributesRequired,(e=>fi(p,e))))return void yi(p);if(g.removeEmptyAttrs&&(e=>{const t=e.dom.attributes;return null==t||0===t.length})(p))return void yi(p);
135g.outputName&&g.outputName!==h&&((e,t)=>{const n=((e,t)=>{const n=cn(t),i=gi(e);return hi(n,i),n})(e,t);oi(e,n);const i=Bn(e);li(n,i),bi(e)})(p,g.outputName)}}else Ce(d,h)?bi(p):yi(p)},px=(e,t,n,i,o,r)=>"html"!==n&&!br(i)||!(o in cx&&ax(e,r,i))&&(!e.validate||t.isValid(i,o)||Ge(o,"data-")||Ge(o,"aria-")),fx=(e,t)=>e.hasAttribute(dx)&&("id"===t||"class"===t||"style"===t),mx=(e,t)=>e in t.getBoolAttrs(),gx=(e,t,n,i)=>{const{attributes:o}=e;for(let r=o.length-1;r>=0;r--){const s=o[r],a=s.name,l=s.value;px(t,n,i,e.tagName.toLowerCase(),a,l)||fx(e,a)?mx(a,n)&&e.setAttribute(a,a):e.removeAttribute(a)}},vx=e=>t=>{const n=xr(t);if("svg"===n)(e=>{const t={IN_PLACE:!0,USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},ALLOWED_ATTR:["type","href","role","arcrole","title","show","actuate","label","from","to"].map((e=>`xlink:${e}`))};tx().sanitize(e,t)})(t);else{if("math"!==n)throw new Error("Not a namespace element");((e,t)=>{const n=tx(),i=t.allow_mathml_annotation_encodings,o=m(i)&&i.length>0;n.addHook("uponSanitizeElement",((e,n)=>{var r;const s=null!==(r=n.tagName)&&void 0!==r?r:e.nodeName.toLowerCase();((e,n)=>o&&"semantics"===n?F.some(!0):"annotation"===n?F.some(jo(e)&&(e=>{const t=e.getAttribute("encoding");return o&&u(t)&&U(i,t)})(e)):m(t.extended_mathml_elements)&&t.extended_mathml_elements.includes(n)?F.from(!0):F.none())(e,s).each((i=>{n.allowedTags[s]=i,!i&&t.sanitize&&jo(e)&&e.remove()}))})),n.addHook("uponSanitizeAttribute",((e,n)=>{m(t.extended_mathml_attributes)&&t.extended_mathml_attributes.includes(n.attrName)&&(n.forceKeepAttr=!0)})),n.sanitize(e,{IN_PLACE:!0,USE_PROFILES:{mathMl:!0}})})(t,e)}},bx=sn.makeMap,yx=sn.extend,xx=(e,t,n,i)=>{const o=e.name,r=o in n&&"title"!==o&&"textarea"!==o&&"noscript"!==o,s=t.childNodes;for(let t=0,o=s.length;t<o;t++){const o=s[t],a=new Jf(o.nodeName.toLowerCase(),o.nodeType);if(jo(o)){const e=o.attributes;for(let t=0,n=e.length;t<n;t++){const n=e[t];a.attr(n.name,n.value)}br(a.name)&&(i(o),a.value=o.innerHTML)}else Go(o)?(a.value=o.data,r&&(a.raw=!0)):(Qo(o)||Xo(o)||Yo(o))&&(a.value=o.data);br(a.name)||xx(a,o,n,i),e.append(a)}},wx=(e={},t=ys())=>{const n=qb(),i=qb(),o={validate:!0,root_name:"body",sanitize:!0,...e},r=new DOMParser,s=((e,t)=>{const n=(()=>{const e=qe(),t=()=>e.get().map(xr).getOr("html");return{track:n=>(yr(n)?e.set(n):e.get().exists((e=>!e.contains(n)))&&e.clear(),t()),current:t,reset:()=>{e.clear()}}})();if(e.sanitize){const i=((e,t,n)=>{const i=tx();return i.addHook("uponSanitizeElement",((i,o)=>{ux(i,e,t,n.track(i),o)})),i.addHook("uponSanitizeAttribute",((i,o)=>{((e,t,n,i,o)=>{const r=e.tagName.toLowerCase(),{attrName:s,attrValue:a}=o;o.keepAttr=px(t,n,i,r,s,a),o.keepAttr?(o.allowedAttributes[s]=!0,mx(s,n)&&(o.attrValue=s),t.allow_svg_data_urls&&Ge(a,"data:image/svg+xml")&&(o.forceKeepAttr=!0)):fx(e,s)&&(o.forceKeepAttr=!0)})(i,e,t,n.current(),o)})),i})(e,t,n);return{sanitizeHtmlElement:(t,o)=>{i.sanitize(t,((e,t)=>{const n={IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[],SAFE_FOR_XML:!1};return n.PARSER_MEDIA_TYPE=t,e.allow_script_urls?n.ALLOWED_URI_REGEXP=/.*/:e.allow_html_data_urls&&(n.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),n})(e,o)),i.removed=[],n.reset()},sanitizeNamespaceElement:vx(e)}}return{sanitizeHtmlElement:(i,o)=>{const r=document.createNodeIterator(i,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let s;for(;s=r.nextNode();){const i=n.track(s);ux(s,e,t,i),jo(s)&&gx(s,e,t,i)}n.reset()},sanitizeNamespaceElement:C}})(o,t),a=n.addFilter,l=n.getFilters,c=n.removeFilter,d=i.addFilter,h=i.getFilters,p=i.removeFilter,f=(e,n)=>{const i=u(n.attr(dx)),o=1===n.type&&!Ce(e,n.name)&&!Rr(t,n)&&!br(n.name);return 3===n.type||o&&!i},m={schema:t,addAttributeFilter:d,getAttributeFilters:h,removeAttributeFilter:p,addNodeFilter:a,getNodeFilters:l,removeNodeFilter:c,parse:(e,n={})=>{var i;const a=o.validate,c=null!==(i=n.context)&&void 0!==i?i:o.root_name,d=((e,n,i="html")=>{const o="xhtml"===i?"application/xhtml+xml":"text/html",a=Ce(t.getSpecialElements(),n.toLowerCase()),l=a?`<${n}>${e}</${n}>`:e,c=r.parseFromString("xhtml"===i?`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>${l}</body></html>`:/^[\s]*<head/i.test(e)||/^[\s]*<html/i.test(e)||/^[\s]*<!DOCTYPE/i.test(e)?`<html>${l}</html>`:`<body>${l}</body>`,o).body;return s.sanitizeHtmlElement(c,o),a?c.firstChild:c})(e,c,n.format);Er(t,d);const u=new Jf(c,11);xx(u,d,t.getSpecialElements(),s.sanitizeNamespaceElement),d.innerHTML="";const[p,m]=((e,t,n,i)=>{const o=n.validate,r=t.getNonEmptyElements(),s=t.getWhitespaceElements(),a=yx(bx("script,style,head,html,body,title,meta,param"),t.getBlockElements()),l=vs(t),c=/[ \t\r\n]+/g,d=/^[ \t\r\n]+/,h=/[ \t\r\n]+$/,u=e=>{let t=e.parent;for(;x(t);){if(t.name in s)return!0;t=t.parent}return!1},p=n=>n.name in a||Rr(t,n)||br(n.name)&&n.parent===e,f=(t,n)=>{const o=n?t.prev:t.next;return!x(o)&&!y(t.parent)&&p(t.parent)&&(t.parent!==e||!0===i.isRootContent)};return[e=>{var t;if(3===e.type&&!u(e)){let n=null!==(t=e.value)&&void 0!==t?t:"";n=n.replace(c," "),(((e,t)=>x(e)&&(t(e)||"br"===e.name))(e.prev,p)||f(e,!0))&&(n=n.replace(d,"")),0===n.length||" "===n&&e.prev&&8===e.prev.type&&e.next&&8===e.next.type?e.remove():e.value=n}},e=>{var a;if(1===e.type){const a=t.getElementRule(e.name);if(o&&a){const o=yv(t,r,s,e);a.paddInEmptyBlock&&o&&(e=>{let n=e;for(;x(n);){if(n.name in l)return yv(t,r,s,n);n=n.parent}return!1})(e)?vv(n,i,p,e):a.removeEmpty&&o?p(e)?e.remove():e.unwrap():a.paddEmpty&&(o||(e=>{var t;return bv(e,"#text")&&(null===(t=null==e?void 0:e.firstChild)||void 0===t?void 0:t.value)===at})(e))&&vv(n,i,p,e)}}else if(3===e.type&&!u(e)){let t=null!==(a=e.value)&&void 0!==a?a:"";(e.next&&p(e.next)||f(e,!1))&&(t=t.replace(h,"")),0===t.length?e.remove():e.value=t}}]})(u,t,o,n),g=[],v={nodes:{},attributes:{}},b=e=>fv(l(),h(),e,v);if(((e,t,n)=>{const i=[];for(let n=e,o=n;n;o=n,n=n.walk()){const r=n;W(t,(e=>e(r))),y(r.parent)&&r!==e?n=o:i.push(r)}for(let e=i.length-1;e>=0;e--){const t=i[e];W(n,(e=>e(t)))}})(u,[p,b],[m,a?e=>((e,n)=>{kv(t,e)&&n.push(e)})(e,g):C]),g.reverse(),a&&g.length>
vendor: 4,898 bytes, line 135
1350)if(n.context){const{pass:e,fail:i}=K(g,(e=>e.parent===u));_v(i,t,u,b),n.invalid=e.length>0}else _v(g,t,u,b);const w=((e,t)=>{var n;const i=null!==(n=t.forced_root_block)&&void 0!==n?n:e.forced_root_block;return!1===i?"":!0===i?"p":i})(o,n);return w&&("body"===u.name||n.isRootContent)&&((e,n)=>{const i=yx(bx("script,style,head,html,body,title,meta,param"),t.getBlockElements()),r=/^[ \t\r\n]+/,s=/[ \t\r\n]+$/;let a=e.firstChild,l=null;const c=e=>{var t,n;e&&(a=e.firstChild,a&&3===a.type&&(a.value=null===(t=a.value)||void 0===t?void 0:t.replace(r,"")),a=e.lastChild,a&&3===a.type&&(a.value=null===(n=a.value)||void 0===n?void 0:n.replace(s,"")))};if(t.isValidChild(e.name,n.toLowerCase())){for(;a;){const t=a.next;f(i,a)?(l||(l=new Jf(n,1),l.attr(o.forced_root_block_attrs),e.insert(l,a)),l.append(a)):(c(l),l=null),a=t}c(l)}})(u,w),n.invalid||mv(v,n),u}};return((e,t)=>{var n,i;const o=e.schema;e.addAttributeFilter("href",(e=>{let n=e.length;const i=e=>{const t=e?sn.trim(e):"";return/\b(noopener)\b/g.test(t)?t:(e=>e.split(" ").filter((e=>e.length>0)).concat(["noopener"]).sort().join(" "))(t)};if(!t.allow_unsafe_link_target)for(;n--;){const t=e[n];"a"===t.name&&"_blank"===t.attr("target")&&t.attr("rel",i(t.attr("rel")))}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(e=>{let t,n,i,o,r=e.length;for(;r--;)if(o=e[r],"a"===o.name&&o.firstChild&&!o.attr("href"))for(i=o.parent,t=o.lastChild;t&&i;)n=t.prev,i.insert(t,o),t=n})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(e=>{let t,n,i=e.length;for(;i--;)if(t=e[i],n=t.parent,n&&("ul"===n.name||"ol"===n.name))if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{const e=new Jf("li",1);e.attr("style","list-style-type: none"),t.wrap(e)}}));const r=o.getValidClasses();t.validate&&r&&e.addAttributeFilter("class",(e=>{var t;let n=e.length;for(;n--;){const i=e[n],o=null!==(t=i.attr("class"))&&void 0!==t?t:"",s=sn.explode(o," ");let a="";for(let e=0;e<s.length;e++){const t=s[e];let n=!1,o=r["*"];o&&o[t]&&(n=!0),o=r[i.name],!n&&o&&o[t]&&(n=!0),n&&(a&&(a+=" "),a+=t)}a.length||(a=null),i.attr("class",a)}})),((e,t)=>{const{blob_cache:n}=t;if(n){const t=e=>{const t=e.attr("src");(e=>e.attr("src")===tn.transparentSrc||x(e.attr("data-mce-placeholder")))(e)||(e=>x(e.attr("data-mce-bogus")))(e)||y(t)||Qb(n,t,!0).each((t=>{e.attr("src",t.blobUri())}))};e.addAttributeFilter("src",(e=>W(e,t)))}})(e,t);const s=null!==(n=t.sandbox_iframes)&&void 0!==n&&n,a=ue(null!==(i=t.sandbox_iframes_exclusions)&&void 0!==i?i:[]);t.convert_unsafe_embeds&&e.addNodeFilter("object,embed",(e=>W(e,(e=>{e.replace((({type:e,src:t,width:n,height:i}={},o,r)=>{const s=(e=>b(e)?"iframe":ty(e,"image")?"img":ty(e,"video")?"video":ty(e,"audio")?"audio":"iframe")(e),a=new Jf(s,1);return a.attr("audio"===s?{src:t}:{src:t,width:n,height:i}),"audio"!==s&&"video"!==s||a.attr("controls",""),"iframe"===s&&o&&ey(a,r),a})({type:e.attr("type"),src:"object"===e.name?e.attr("data"):e.attr("src"),width:e.attr("width"),height:e.attr("height")},s,a))})))),s&&e.addNodeFilter("iframe",(e=>W(e,(e=>ey(e,a)))))})(m,o),((e,t,n)=>{t.inline_styles&&((e,t,n)=>{var i;const o=As();t.convert_fonts_to_spans&&((e,t,n)=>{e.addNodeFilter("font",(e=>{W(e,(e=>{const i=t.parse(e.attr("style")),o=e.attr("color"),r=e.attr("face"),s=e.attr("size");o&&(i.color=o),r&&(i["font-family"]=r),s&&nt(s).each((e=>{i["font-size"]=n[e-1]})),e.name="span",e.attr("style",t.serialize(i)),(e=>{W(["color","face","size"],(t=>{e.attr(t,null)}))})(e)}))}))})(e,o,sn.explode(null!==(i=t.font_size_legacy_values)&&void 0!==i?i:"")),((e,t,n)=>{e.addNodeFilter("strike",(e=>{const i="html4"!==t.type;W(e,(e=>{if(i)e.name="s";else{const t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))}}))}))})(e,n,o)})(e,t,n)})(m,o,t),m},_x=(e,t,n)=>{const i=(e=>Pv(e)?gm({validate:!1}).serialize(e):e)(e),o=t(i);if(o.isDefaultPrevented())return o;if(Pv(e)){if(o.content!==i){const t=wx({validate:!1,forced_root_block:!1,...n}).parse(o.content,{context:e.name});return{...o,content:t}}return{...o,content:e}}return o},kx=e=>({sanitize:Yd(e),sandbox_iframes:nh(e),sandbox_iframes_exclusions:ih(e)}),Cx=(e,t)=>{if(t.no_events)return De.value(t);{const n=((e,t)=>e.dispatch("BeforeGetContent",t))(e,t);return n.isDefaultPrevented()?De.error(ic(e,{content:"",...n}).content):De.value(n)}},Sx=(e,t,n)=>{if(n.no_events)return t;return _x(t,(t=>ic(e,{...n,content:t})),kx(e)).content},Tx=(e,t)=>{if(t.no_events)return De.value(t);{const n=_x(t.content,(n=>((e,t)=>e.dispatch("BeforeSetContent",t))(e,{...t,content:n})),kx(e));return n.isDefaultPrevented()?(nc(e,n),De.error(void 0)):De.value(n)}},Ex=(e,t,n)=>{n.no_events||nc(e,{...n,content:t})},Ax=(e,t,n)=>({element:e,width:t,rows:n}),Ox=(e,t)=>({element:e,cells:t}),Dx=(e,t)=>({x:e,y:t}),Ix=(e,t)=>pi(e,t).bind(nt).getOr(1),Px=(e,t,n)=>{const i=e.rows;return!!(i[n]?i[n].cells:[])[t]},Mx=e=>Y(e,((e,t)=>
vendor: 1,192 bytes, line 135
135t.cells.length>e?t.cells.length:e),0),Rx=(e,t)=>{const n=e.rows;for(let e=0;e<n.length;e++){const i=n[e].cells;for(let n=0;n<i.length;n++)if(bn(i[n],t))return F.some(Dx(n,e))}return F.none()},zx=(e,t,n,i,o)=>{const r=[],s=e.rows;for(let e=n;e<=o;e++){const n=s[e].cells,o=t<i?n.slice(t,i+1):n.slice(i,t+1);r.push(Ox(s[e].element,o))}return r},Nx=e=>((e,t)=>{const n=wi(e.element),i=cn("tbody");return li(i,t),si(n,i),n})(e,(e=>q(e.rows,(e=>{const t=q(e.cells,(e=>{const t=_i(e);return mi(t,"colspan"),mi(t,"rowspan"),t})),n=wi(e.element);return li(n,t),n})))(e)),Fx=()=>qi([]),Lx=(e,t,n)=>{const i=Nu(t,e);return i.length>0?((e,t)=>((e,t)=>Zi(t,"table",D(bn,e)))(e,t[0]).bind((e=>{const n=t[0],i=t[t.length-1];return((e,t,n)=>Rx(e,t).bind((t=>Rx(e,n).map((n=>((e,t,n)=>{const i=t.x,o=t.y,r=n.x,s=n.y,a=o<s?zx(e,i,o,r,s):zx(e,i,s,r,o);return Ax(e.element,Mx(a),a)})(e,t,n))))))((e=>{const t=Ax(wi(e),0,[]);return W(mo(e,"tr"),((e,n)=>{W(mo(e,"td,th"),((i,o)=>{((e,t,n,i,o)=>{const r=Ix(o,"rowspan"),s=Ix(o,"colspan"),a=e.rows;for(let e=n;e<n+r;e++){a[e]||(a[e]=Ox(_i(i),[]));for(let i=t;i<t+s;i++)a[e].cells[i]=e===n&&i===t?o:wi(o)}})(t,((e,t,n)=>{for(;Px(e,t,n);)t++;return t})(t,o,n),n,e,i)}
vendor: 4,291 bytes, line 135
135))})),Ax(t.element,Mx(t.rows),t.rows)})(e),n,i).map((e=>qi([Nx(e)])))})).getOrThunk(Fx))(e,i):((e,t,n)=>t.length>0&&t[0].collapsed?Fx():((e,t,n)=>((e,t)=>{const n=Y(t,((e,t)=>(si(t,e),t)),e);return t.length>0?qi([n]):n})(hn(t.cloneContents()),((e,t,n)=>{const i=hn(t.commonAncestorContainer),o=Lm(i,e),r=G(o,(e=>n.isWrapper(wn(e)))),s=((e,t)=>J(e,(e=>"li"===wn(e)&&Hu(e,t))).fold(E([]),(t=>(e=>J(e,(e=>"ul"===wn(e)||"ol"===wn(e))))(e).map((e=>{const t=cn(wn(e)),n=xe(Ri(e),((e,t)=>Ge(t,"list-style")));return Di(t,n),[cn("li"),t]})).getOr([]))))(o,t),a=r.concat(s.length?s:(e=>ba(e)?Mn(e).filter(va).fold(E([]),(t=>[e,t])):va(e)?[e]:[])(i));return q(a,wi)})(e,t,n)))(e,t[0],n))(e,t,n)},jx=(e,t)=>t>=0&&t<e.length&&Mu(e.charAt(t)),Bx=e=>Ta(e.innerText),Hx=e=>jo(e)?e.outerHTML:Go(e)?ns.encodeRaw(e.data,!1):Qo(e)?"\x3c!--"+e.data+"--\x3e":"",Ux=rt((()=>document.implementation.createHTMLDocument("undo"))),$x=e=>{const t=e.serializer.getTempAttrs(),n=hm(e.getBody(),t);return(e=>null!==e.querySelector("iframe"))(n)?{type:"fragmented",fragments:G(q(de(n.childNodes),S(Ta,Hx)),(e=>e.length>0)),content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:Ta(n.innerHTML),bookmark:null,beforeBookmark:null}},qx=(e,t,n)=>{const i=n?t.beforeBookmark:t.bookmark;"fragmented"===t.type?((e,t)=>{((e,t)=>{let n=0;W(e,(e=>{0===e[0]?n++:1===e[0]?(((e,t,n)=>{const i=(e=>{let t;const n=document.createElement("div"),i=document.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)i.appendChild(t);return i})(t);if(e.hasChildNodes()&&n<e.childNodes.length){const t=e.childNodes[n];e.insertBefore(i,t)}else e.appendChild(i)})(t,e[1],n),n++):2===e[0]&&((e,t)=>{if(e.hasChildNodes()&&t<e.childNodes.length){const n=e.childNodes[t];e.removeChild(n)}})(t,n)}))})(((e,t)=>{const n=e.length+t.length+2,i=new Array(n),o=new Array(n),r=(n,i,o,s,l)=>{const c=a(n,i,o,s);if(null===c||c.start===i&&c.diag===i-s||c.end===n&&c.diag===n-o){let r=n,a=o;for(;r<i||a<s;)r<i&&a<s&&e[r]===t[a]?(l.push([0,e[r]]),++r,++a):i-n>s-o?(l.push([2,e[r]]),++r):(l.push([1,t[a]]),++a)}else{r(n,c.start,o,c.start-c.diag,l);for(let t=c.start;t<c.end;++t)l.push([0,e[t]]);r(c.end,i,c.end-c.diag,s,l)}},s=(n,i,o,r)=>{let s=n;for(;s-i<r&&s<o&&e[s]===t[s-i];)++s;return((e,t,n)=>({start:e,end:t,diag:n}))(n,s,i)},a=(n,r,a,l)=>{const c=r-n,d=l-a;if(0===c||0===d)return null;const h=c-d,u=d+c,p=(u%2==0?u:u+1)/2;let f,m,g,v,b;for(i[1+p]=n,o[1+p]=r+1,f=0;f<=p;++f){for(m=-f;m<=f;m+=2){for(g=m+p,m===-f||m!==f&&i[g-1]<i[g+1]?i[g]=i[g+1]:i[g]=i[g-1]+1,v=i[g],b=v-n+a-m;v<r&&b<l&&e[v]===t[b];)i[g]=++v,++b;if(h%2!=0&&h-f<=m&&m<=h+f&&o[g-h]<=i[g])return s(o[g-h],m+n-a,r,l)}for(m=h-f;m<=h+f;m+=2){for(g=m+p-h,m===h-f||m!==h+f&&o[g+1]<=o[g-1]?o[g]=o[g+1]-1:o[g]=o[g-1],v=o[g]-1,b=v-n+a-m;v>=n&&b>=a&&e[v]===t[b];)o[g]=v--,b--;if(h%2==0&&-f<=m&&m<=f&&o[g]<=i[g+h])return s(o[g],m+n-a,r,l)}}return null},l=[];return r(0,e.length,0,t.length,l),l})(q(de(t.childNodes),Hx),e),t)})(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!x(i)||!wu(i)||!i.isFakeCaret}),i&&(e.selection.moveToBookmark(i),e.selection.scrollIntoView())},Wx=e=>"fragmented"===e.type?e.fragments.join(""):e.content,Vx=e=>{const t=cn("body",Ux());return Si(t,Wx(e)),W(mo(t,"*[data-mce-bogus]"),yi),Ci(t)},Kx=(e,t)=>!(!e||!t)&&(!!((e,t)=>Wx(e)===Wx(t))(e,t)||((e,t)=>Vx(e)===Vx(t))(e,t)),Gx=e=>0===e.get(),Xx=(e,t,n)=>{Gx(n)&&(e.typing=t)},Yx=(e,t)=>{e.typing&&(Xx(e,!1,t),e.add())},Qx=e=>({init:{bindEvents:C},undoManager:{beforeChange:(t,n)=>((e,t,n)=>{Gx(t)&&n.set(Wl(e.selection))})(e,t,n),add:(t,n,i,o,r,s)=>((e,t,n,i,o,r,s)=>{const a=$x(e),l=sn.extend(r||{},a);if(!Gx(i)||e.removed)return null;const c=t.data[n.get()];if(e.dispatch("BeforeAddUndo",{level:l,lastLevel:c,originalEvent:s}).isDefaultPrevented())return null;if(c&&Kx(c,l))return null;t.data[n.get()]&&o.get().each((e=>{t.data[n.get()].beforeBookmark=e}));const d=pd(e);if(d&&t.data.length>d){for(let e=0;e<t.data.length-1;e++)t.data[e]=t.data[e+1];t.data.length--,n.set(t.data.length)}l.bookmark=Wl(e.selection),n.get()<t.data.length-1&&(t.data.length=n.get()+1),t.data.push(l),n.set(t.data.length-1);const h={level:l,lastLevel:c,originalEvent:s};return n.get()>0?(e.setDirty(!0),e.dispatch("AddUndo",h),e.dispatch("change",h)):e.dispatch("AddUndo",h),l}
vendor: 3,858 bytes, line 135
135)(e,t,n,i,o,r,s),undo:(t,n,i)=>((e,t,n,i)=>{let o;return t.typing&&(t.add(),t.typing=!1,Xx(t,!1,n)),i.get()>0&&(i.set(i.get()-1),o=t.data[i.get()],qx(e,o,!0),e.setDirty(!0),e.dispatch("Undo",{level:o})),o})(e,t,n,i),redo:(t,n)=>((e,t,n)=>{let i;return t.get()<n.length-1&&(t.set(t.get()+1),i=n[t.get()],qx(e,i,!1),e.setDirty(!0),e.dispatch("Redo",{level:i})),i})(e,t,n),clear:(t,n)=>((e,t,n)=>{t.data=[],n.set(0),t.typing=!1,e.dispatch("ClearUndos")})(e,t,n),reset:e=>(e=>{e.clear(),e.add()})(e),hasUndo:(t,n)=>((e,t,n)=>n.get()>0||t.typing&&t.data[0]&&!Kx($x(e),t.data[0]))(e,t,n),hasRedo:(e,t)=>((e,t)=>t.get()<e.data.length-1&&!e.typing)(e,t),transact:(e,t,n)=>((e,t,n)=>(Yx(e,t),e.beforeChange(),e.ignore(n),e.add()))(e,t,n),ignore:(e,t)=>((e,t)=>{try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}})(e,t),extra:(t,n,i,o)=>((e,t,n,i,o)=>{if(t.transact(i)){const i=t.data[n.get()].bookmark,r=t.data[n.get()-1];qx(e,r,!0),t.transact(o)&&(t.data[n.get()-1].beforeBookmark=i)}})(e,t,n,i,o)},formatter:{match:(t,n,i,o)=>Bv(e,t,n,i,o),matchAll:(t,n)=>((e,t,n)=>{const i=[],o={},r=e.selection.getStart();return e.dom.getParent(r,(r=>{for(let s=0;s<t.length;s++){const a=t[s];!o[a]&&jv(e,r,a,n)&&(o[a]=!0,i.push(a))}}),e.dom.getRoot()),i})(e,t,n),matchNode:(t,n,i,o)=>jv(e,t,n,i,o),canApply:t=>((e,t)=>{const n=e.formatter.get(t),i=e.dom;if(n&&e.selection.isEditable()){const t=e.selection.getStart(),o=sp(i,t);for(let e=n.length-1;e>=0;e--){const t=n[e];if(!cp(t))return!0;for(let e=o.length-1;e>=0;e--)if(i.is(o[e],t.selector))return!0}}return!1})(e,t),closest:t=>((e,t)=>{const n=t=>bn(t,hn(e.getBody()));return F.from(e.selection.getStart(!0)).bind((i=>yo(hn(i),(n=>he(t,(t=>((t,n)=>jv(e,t.dom,n)?F.some(n):F.none())(n,t)))),n))).getOrNull()})(e,t),apply:(t,n,i)=>Fb(e,t,n,i),remove:(t,n,i,o)=>Ib(e,t,n,i,o),toggle:(t,n,i)=>((e,t,n,i)=>{const o=e.formatter.get(t);o&&(!Bv(e,t,n,i)||"toggle"in o[0]&&!o[0].toggle?Fb(e,t,n,i):Ib(e,t,n,i))})(e,t,n,i),formatChanged:(t,n,i,o,r)=>((e,t,n,i,o,r)=>(((e,t,n,i,o,r)=>{const s=t.get();W(n.split(","),(t=>{const n=ke(s,t).getOrThunk((()=>{const e={withSimilar:{state:Ee(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Ee(!1),similar:!1,callbacks:[]},withVars:[]};return s[t]=e,e})),a=()=>{const n=Hb(e);return Bb(e,n,t,o,r).isSome()};if(b(r)){const e=o?n.withSimilar:n.withoutSimilar;e.callbacks.push(i),1===e.callbacks.length&&e.state.set(a())}else n.withVars.push({state:Ee(a()),similar:o,vars:r,callback:i})})),t.set(s)})(e,t,n,i,o,r),{unbind:()=>((e,t,n)=>{const i=e.get();W(t.split(","),(e=>ke(i,e).each((t=>{i[e]={withSimilar:{...t.withSimilar,callbacks:G(t.withSimilar.callbacks,(e=>e!==n))},withoutSimilar:{...t.withoutSimilar,callbacks:G(t.withoutSimilar.callbacks,(e=>e!==n))},withVars:G(t.withVars,(e=>e.callback!==n))}})))),e.set(i)})(t,n,i)}))(e,t,n,i,o,r)},editor:{getContent:t=>((e,t)=>F.from(e.getBody()).fold(E("tree"===t.format?new Jf("body",11):""),(n=>((e,t,n)=>{let i;return i="raw"===t.format?sn.trim(Ta(hm(n,e.serializer.getTempAttrs()).innerHTML)):"text"===t.format?((e,t)=>{const n=e.getDoc(),i=Vn(hn(e.getBody())),o=cn("div",n);di(o,"data-mce-bogus","all"),Di(o,{position:"fixed",left:"-9999999px",top:"0"}),Si(o,t.innerHTML),um(o),pm(o);const r=(e=>Wn(e)?e:hn(In(e).dom.body))(i);si(r,o);const s=Ta(o.dom.innerText);return bi(o),s})(e,n):"tree"===t.format?e.serializer.serialize(n,t):((e,t)=>{const n=xc(e),i=new RegExp(`^(<${n}[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/${n}>[\r\n]*|<br \\/>[\r\n]*)$`);return t.replace(i,"")})(e,e.serializer.serialize(n,t)),"text"!==t.format&&!wa(hn(n))&&u(i)?sn.trim(i):i})(e,t,n))))(e,t),setContent:(t,n)=>((e,t,n)=>F.from(e.getBody()).map((i=>Pv(t)?((e,t,n,i)=>{gv(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);const o=gm({validate:!1},e.schema).serialize(n),r=Ta(wa(hn(t))?o:sn.trim(o));return Mv(e,r,i.no_selection),{content:n,html:r}}
vendor: 4,145 bytes, line 135
135)(e,i,t,n):((e,t,n,i)=>{if(0===(n=Ta(n)).length||/^\s+$/.test(n)){const o='<br data-mce-bogus="1">';"TABLE"===t.nodeName?n="<tr><td>"+o+"</td></tr>":/^(UL|OL)$/.test(t.nodeName)&&(n="<li>"+o+"</li>");const r=xc(e);return e.schema.isValidChild(t.nodeName.toLowerCase(),r.toLowerCase())?(n=o,n=e.dom.createHTML(r,wc(e),n)):n||(n=o),Mv(e,n,i.no_selection),{content:n,html:n}}{"raw"!==i.format&&(n=gm({validate:!1},e.schema).serialize(e.parser.parse(n,{isRootContent:!0,insert:!0})));const o=wa(hn(t))?n:sn.trim(n);return Mv(e,o,i.no_selection),{content:o,html:o}}})(e,i,t,n))).getOr({content:t,html:Pv(n.content)?"":n.content}))(e,t,n),insertContent:(t,n)=>Iv(e,t,n),addVisual:t=>((e,t)=>{const n=e.dom,i=x(t)?t:e.getBody();W(n.select("table,a",i),(t=>{switch(t.nodeName){case"TABLE":const i=_d(e),o=n.getAttrib(t,"border");o&&"0"!==o||!e.hasVisual?n.removeClass(t,i):n.addClass(t,i);break;case"A":if(!n.getAttrib(t,"href")){const i=n.getAttrib(t,"name")||t.id,o=kd(e);i&&e.hasVisual?n.addClass(t,o):n.removeClass(t,o)}}})),e.dispatch("VisualAid",{element:t,hasVisual:e.hasVisual})})(e,t)},selection:{getContent:(t,n)=>((e,t,n={})=>{const i=((e,t)=>({...e,format:t,get:!0,selection:!0,getInner:!0}))(n,t);return Cx(e,i).fold(A,(t=>{const n=((e,t)=>{if("text"===t.format)return(e=>F.from(e.selection.getRng()).map((t=>{var n;const i=F.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),o=e.getBody(),r=(e=>e.map((e=>e.nodeName)).getOr("div").toLowerCase())(i),s=hn(t.cloneContents());um(s),pm(s);const a=e.dom.add(o,r,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},s.dom),l=Bx(a),c=Ta(null!==(n=a.textContent)&&void 0!==n?n:"");if(e.dom.remove(a),jx(c,0)||jx(c,c.length-1)){const e=i.getOr(o),t=Bx(e),n=t.indexOf(l);return-1===n?l:(jx(t,n-1)?" ":"")+l+(jx(t,n+l.length)?" ":"")}return l})).getOr(""))(e);{const n=((e,t)=>{const n=e.selection.getRng(),i=e.dom.create("body"),o=e.selection.getSel(),r=Kf(e,zu(o)),s=t.contextual?Lx(hn(e.getBody()),r,e.schema).dom:n.cloneContents();return s&&i.appendChild(s),e.selection.serializer.serialize(i,t)})(e,t);return"tree"===t.format?n:e.selection.isCollapsed()?"":n}})(e,t);return Sx(e,n,t)}))})(e,t,n)},autocompleter:{addDecoration:C,removeDecoration:C},raw:{getModel:()=>F.none()}}),Jx=e=>Ce(e.plugins,"rtc"),Zx=e=>e.rtcInstance?e.rtcInstance:Qx(e),ew=e=>{const t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},tw=e=>ew(e).init.bindEvents(),nw=e=>0===e.dom.length?(bi(e),F.none()):F.some(e),iw=(e,t,n,i,o)=>{e.bind((e=>((i?mg:fg)(e.dom,i?e.dom.length:0,o),t.filter(Tn).map((t=>((e,t,n,i,o)=>{const r=e.dom,s=t.dom,a=i?r.length:s.length;i?(gg(r,s,o,!1,!i),n.setStart(s,a)):(gg(s,r,o,!1,!i),n.setEnd(s,a))})(e,t,n,i,o)))))).orThunk((()=>((e,t)=>e.filter((e=>Rp.isBookmarkNode(e.dom))).bind(t?Fn:Nn))(t,i).or(t).filter(Tn).map((e=>((e,t,n)=>{Mn(e).each((i=>{const o=e.dom;t&&sg(i,Cl(o,0),n)?fg(o,0,n):!t&&ag(i,Cl(o,o.length),n)&&mg(o,o.length,n)}))})(e,i,o)))))},ow=(e,t,n)=>{if(Ce(e,t)){const i=G(e[t],(e=>e!==n));0===i.length?delete e[t]:e[t]=i}},rw=e=>!(!e||!e.ownerDocument)&&yn(hn(e.ownerDocument),hn(e)),sw=(e,t,n,i)=>{let o,r;const{selectorChangedWithUnbind:s}=((e,t)=>{let n,i;const o=(t,n)=>J(n,(n=>e.is(n,t))),r=t=>e.getParents(t,void 0,e.getRoot());return{selectorChangedWithUnbind:(e,s)=>(n||(n={},i={},t.on("NodeChange",(e=>{const t=e.element,s=r(t),a={};me(n,((e,t)=>{o(t,s).each((n=>{i[t]||(W(e,(e=>{e(!0,{node:n,selector:t,parents:s})})),i[t]=e),a[t]=e}))})),me(i,((e,n)=>{a[n]||(delete i[n],W(e,(e=>{e(!1,{node:t,selector:n,parents:s})})))}))}))),n[e]||(n[e]=[]),n[e].push(s),o(e,r(t.selection.getStart())).each((()=>{i[e]=n[e]})),{unbind:()=>{ow(n,e,s),ow(i,e,s)}})}})(e,i),a=(e,t)=>((e,t,n={})=>{const i=((e,t)=>({format:"html",...e,set:!0,selection:!0,content:t}))(n,t);Tx(e,i).each((t=>{const n=((e,t)=>{if("raw"!==t.format){const n=e.selection.getRng(),i=e.dom.getParent(n.commonAncestorContainer,e.dom.isBlock),o=i?{context:i.nodeName.toLowerCase()}:{},r=e.parser.parse(t.content,{forced_root_block:!1,...o,...t});return gm({validate:!1},e.schema).serialize(r)}return t.content})(e,t),i=e.selection.getRng();
vendor: 12,989 bytes, line 135
135((e,t,n)=>{const i=F.from(t.firstChild).map(hn),o=F.from(t.lastChild).map(hn);e.deleteContents(),e.insertNode(t);const r=i.bind(Nn).filter(Tn).bind(nw),s=o.bind(Fn).filter(Tn).bind(nw);iw(r,i,e,!0,n),iw(s,o,e,!1,n),e.collapse(!1)})(i,i.createContextualFragment(n),e.schema),e.selection.setRng(i),Hf(e,i),Ex(e,n,t)}))})(i,e,t),l=e=>{const t=d();t.collapse(!!e),h(t)},c=()=>t.getSelection?t.getSelection():t.document.selection,d=()=>{let n;const s=(e,t,n)=>{try{return t.compareBoundaryPoints(e,n)}catch(e){return-1}},a=t.document;if(x(i.bookmark)&&!rf(i)){const e=$p(i);if(e.isSome())return e.map((e=>Kf(i,[e])[0])).getOr(a.createRange())}try{const e=c();e&&!Lo(e.anchorNode)&&(n=e.rangeCount>0?e.getRangeAt(0):a.createRange(),n=Kf(i,[n])[0])}catch(e){}if(n||(n=a.createRange()),Jo(n.startContainer)&&n.collapsed){const t=e.getRoot();n.setStart(t,0),n.setEnd(t,0)}return o&&r&&(0===s(n.START_TO_START,n,o)&&0===s(n.END_TO_END,n,o)?n=r:(o=null,r=null)),n},h=(e,t)=>{if(!(e=>!!e&&rw(e.startContainer)&&rw(e.endContainer))(e))return;const n=c();if(e=i.dispatch("SetSelectionRange",{range:e,forward:t}).range,n){r=e;try{n.removeAllRanges(),n.addRange(e)}catch(e){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),o=n.rangeCount>0?n.getRangeAt(0):null}if(!e.collapsed&&e.startContainer===e.endContainer&&(null==n?void 0:n.setBaseAndExtent)&&e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()){const t=e.startContainer.childNodes[e.startOffset];t&&"IMG"===t.nodeName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(t,0,t,1))}i.dispatch("AfterSetSelectionRange",{range:e,forward:t})},u=()=>{const t=c(),n=null==t?void 0:t.anchorNode,i=null==t?void 0:t.focusNode;if(!t||!n||!i||Lo(n)||Lo(i))return!0;const o=e.createRng(),r=e.createRng();try{o.setStart(n,t.anchorOffset),o.collapse(!0),r.setStart(i,t.focusOffset),r.collapse(!0)}catch(e){return!0}return o.compareBoundaryPoints(o.START_TO_START,r)<=0},p={dom:e,win:t,serializer:n,editor:i,expand:(t={type:"word"})=>h(Sf(e).expand(d(),t)),collapse:l,setCursorLocation:(t,n)=>{const o=e.createRng();x(t)&&x(n)?(o.setStart(t,n),o.setEnd(t,n),h(o),l(!1)):(Uu(e,o,i.getBody(),!0),h(o))},getContent:e=>((e,t={})=>((e,t,n)=>ew(e).selection.getContent(t,n))(e,t.format?t.format:"html",t))(i,e),setContent:a,getBookmark:(e,t)=>f.getBookmark(e,t),moveToBookmark:e=>f.moveToBookmark(e),select:(t,n)=>(((e,t,n)=>F.from(t).bind((t=>F.from(t.parentNode).map((i=>{const o=e.nodeIndex(t),r=e.createRng();return r.setStart(i,o),r.setEnd(i,o+1),n&&(Uu(e,r,t,!0),Uu(e,r,t,!1)),r})))))(e,t,n).each(h),t),isCollapsed:()=>{const e=d(),t=c();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isEditable:()=>{if(i.mode.isReadOnly())return!1;const t=d(),n=i.getBody().querySelectorAll('[data-mce-selected="1"]');return n.length>0?ne(n,(t=>e.isEditable(t.parentElement))):Uf(e,t)},isForward:u,setNode:t=>(a(e.getOuterHTML(t)),t),getNode:()=>((e,t)=>{if(!t)return e;let n=t.startContainer,i=t.endContainer;const o=t.startOffset,r=t.endOffset;let s=t.commonAncestorContainer;t.collapsed||(n===i&&r-o<2&&n.hasChildNodes()&&(s=n.childNodes[o]),Go(n)&&Go(i)&&(n=n.length===o?Vf(n.nextSibling,!0):n.parentNode,i=0===r?Vf(i.previousSibling,!1):i.parentNode,n&&n===i&&(s=n)));const a=Go(s)?s.parentNode:s;return Bo(a)?a:e})(i.getBody(),d()),getSel:c,setRng:h,getRng:d,getStart:e=>qf(i.getBody(),d(),e),getEnd:e=>Wf(i.getBody(),d(),e),getSelectedBlocks:(t,n)=>((e,t,n,i)=>{const o=[],r=e.getRoot(),s=e.getParent(n||qf(r,t,t.collapsed),e.isBlock),a=e.getParent(i||Wf(r,t,t.collapsed),e.isBlock);if(s&&s!==r&&o.push(s),s&&a&&s!==a){let t;const n=new Po(s,r);for(;(t=n.next())&&t!==a;)e.isBlock(t)&&o.push(t)}return a&&s!==a&&a!==r&&o.push(a),o})(e,d(),t,n),normalize:()=>{const t=d(),n=c();if(!(zu(n).length>1)&&$u(i)){const n=_f(e,t);return n.each((e=>{h(e,u())})),n.getOr(t)}return t},selectorChanged:(e,t)=>(s(e,t),p),selectorChangedWithUnbind:s,getScrollContainer:()=>{let t,n=e.getRoot();for(;n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){t=n;break}n=n.parentNode}return t},scrollIntoView:(e,t)=>{x(e)?((e,t,n)=>{(e.inline?Lf:Bf)(e,t,n)})(i,e,t):Hf(i,d(),t)},placeCaretAt:(e,t)=>h(ff(e,t,i.getDoc())),getBoundingClientRect:()=>{const e=d();return e.collapsed?Cl.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:()=>{t=o=r=null,m.destroy()}},f=Rp(p),m=pf(p,i);return p.bookmarkManager=f,p.controlSelection=m,p},aw=(e,t,n)=>{-1===sn.inArray(t,n)&&(e.addAttributeFilter(n,((e,t)=>{let n=e.length;for(;n--;)e[n].attr(t,null)})),t.push(n))},lw=(e,t)=>{const n=((e,t)=>{const n=["data-mce-selected"],i={entity_encoding:"named",remove_trailing_brs:!0,pad_empty_with_br:!1,...e},o=t&&t.dom?t.dom:Ks.DOM,r=t&&t.schema?t.schema:ys(i),s=wx(i,r);return((e,t,n)=>{e.addAttributeFilter("data-mce-tabindex",((e,t)=>{let n=e.length;for(;n--;){const i=e[n];i.attr("tabindex",i.attr("data-mce-tabindex")),i.attr(t,null)}})),e.addAttributeFilter("src,href,style",((e,i)=>{const o="data-mce-"+i,r=t.url_converter,s=t.url_converter_scope;let a=e.length;for(;a--;){const t=e[a];let l=t.attr(o);void 0!==l?(t.attr(i,l.length>0?l:null),t.attr(o,null)):(l=t.attr(i),"style"===i?l=n.serializeStyle(n.parseStyle(l),t.name):r&&(l=r.call(s,l,i,t.name)),t.attr(i,l.length>0?l:null))}})),e.addAttributeFilter("class",(e=>{let t=e.length;for(;t--;){const n=e[t];let i=n.attr("class");i&&(i=i.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",i.length>0?i:null))}})),e.addAttributeFilter("data-mce-type",((e,t,n)=>{let i=e.length;for(;i--;){const t=e[i];"bookmark"!==t.attr("data-mce-type")||n.cleanup||(F.from(t.firstChild).exists((e=>{var t;return!Sa(null!==(t=e.value)&&void 0!==t?t:"")}))?t.unwrap():t.remove())}})),e.addNodeFilter("script,style",((e,n)=>{var i;const o=e=>e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let r=e.length;for(;r--;){const s=e[r],a=s.firstChild,l=null!==(i=null==a?void 0:a.value)&&void 0!==i?i:"";if("script"===n){const e=s.attr("type");e&&s.attr("type","mce-no/type"===e?null:e.replace(/^mce\-/,"")),"xhtml"===t.element_format&&a&&l.length>0&&(a.value="// <![CDATA[\n"+o(l)+"\n// ]]>")}else"xhtml"===t.element_format&&a&&l.length>0&&(a.value="\x3c!--\n"+o(l)+"\n--\x3e")}})),e.addNodeFilter("#comment",(e=>{let i=e.length;for(;i--;){const o=e[i],r=o.value;t.preserve_cdata&&0===(null==r?void 0:r.indexOf("[CDATA["))?(o.name="#cdata",o.type=4,o.value=n.decode(r.replace(/^\[CDATA\[|\]\]$/g,""))):0===(null==r?void 0:r.indexOf("mce:protected "))&&(o.name="#text",o.type=3,o.raw=!0,o.value=unescape(r).substr(14))}})),e.addNodeFilter("xml:namespace,input",((e,t)=>{let n=e.length;for(;n--;){const i=e[n];7===i.type?i.remove():1===i.type&&("input"!==t||i.attr("type")||i.attr("type","text"))}})),e.addAttributeFilter("data-mce-type",(t=>{W(t,(t=>{"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())}))})),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",((e,t)=>{let n=e.length;for(;n--;)e[n].attr(t,null)})),t.remove_trailing_brs&&((e,t,n)=>{t.addNodeFilter("br",((t,i,o)=>{const r=sn.extend({},n.getBlockElements()),s=n.getNonEmptyElements(),a=n.getWhitespaceElements();r.body=1;const l=e=>e.name in r||Rr(n,e);for(let i=0,c=t.length;i<c;i++){let c=t[i],d=c.parent;if(d&&l(d)&&c===d.lastChild){let t=c.prev;for(;t;){const e=t.name;if("span"!==e||"bookmark"!==t.attr("data-mce-type")){"br"===e&&(c=null);break}t=t.prev}if(c&&(c.remove(),yv(n,s,a,d))){const t=n.getElementRule(d.name);t&&(t.removeEmpty?d.remove():t.paddEmpty&&vv(e,o,l,d))}}else{let e=c;for(;d&&d.firstChild===e&&d.lastChild===e&&(e=d,!r[d.name]);)d=d.parent;if(e===d){const e=new Jf("#text",3);e.value=at,c.replace(e)}}}}))})(t,e,e.schema)})(s,i,o),{schema:r,addNodeFilter:s.addNodeFilter,addAttributeFilter:s.addAttributeFilter,serialize:(e,n={})=>{const a={format:"html",...n},l=((e,t,n)=>((e,t)=>x(e)&&e.hasEventListeners("PreProcess")&&!t.no_events)(e,n)?((e,t,n)=>{let i;const o=e.dom;let r=t.cloneNode(!0);const s=document.implementation;if(s.createHTMLDocument){const e=s.createHTMLDocument("");sn.each("BODY"===r.nodeName?r.childNodes:[r],(t=>{e.body.appendChild(e.importNode(t,!0))})),r="BODY"!==r.nodeName?e.body.firstChild:e.body,i=o.doc,o.doc=e}return((e,t)=>{e.dispatch("PreProcess",t)})(e,{...n,node:r}),i&&(o.doc=i),r})(e,t,n):t)(t,e,a),c=((e,t,n)=>{const i=Ta(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||wa(hn(t))?i:sn.trim(i)})(o,l,a),d=((e,t,n)=>{const i=n.selection?{forced_root_block:!1,...n}:n,o=e.parse(t,i);return(e=>{const t=e=>"br"===(null==e?void 0:e.name),n=e.lastChild;if(t(n)){const e=n.prev;t(e)&&(n.remove(),e.remove())}})(o),o})(s,c,a);return"tree"===a.format?d:((e,t,n,i,o)=>((e,t,n)=>!t.no_events&&e?((e,t)=>e.dispatch("PostProcess",t))(e,{...t,content:n}).content:n)(e,o,((e,t,n)=>gm(e,t).serialize(n))(t,n,i)))(t,i,r,d,a)},addRules:r.addValidElements,setRules:r.setValidElements,addTempAttr:D(aw,s,n),getTempAttrs:E(n),getNodeFilters:s.getNodeFilters,getAttributeFilters:s.getAttributeFilters,removeNodeFilter:s.removeNodeFilter,removeAttributeFilter:s.removeAttributeFilter}})(e,t);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters,removeNodeFilter:n.removeNodeFilter,removeAttributeFilter:n.removeAttributeFilter}},cw=(e,t,n={})=>{const i=((e,t)=>({format:"html",...e,set:!0,content:t}))(n,t);return Tx(e,i).map((t=>{const n=((e,t,n)=>Zx(e).editor.setContent(t,n))(e,t.content,t);return Ex(e,n.html,t),n.content})).getOr(t)},dw="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists,template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format".split(","),hw=[],uw="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,template,textcolor,rtc".split(","),pw=[{name:"export",replacedWith:"Export to PDF"}],fw=(e,t)=>{const n=G(t,(t=>Ce(e,t)));return se(n)},mw=(e,t)=>{const n=sn.makeMap(e.plugins," "),i=G(t,(e=>Ce(n,e)));return se(i)},gw=e=>J(pw,(t=>t.name===e)).fold((()=>e),(t=>t.replacedWith?`${e}, replaced by ${t.replacedWith}`:e)),vw=Ks.DOM,bw=e=>F.from(e).each((e=>e.destroy())),yw=(()=>{const e={};return{add:(t,n)=>{e[t]=n},get:t=>e[t]?e[t]:{icons:{}},has:t=>Ce(e,t)}})(),xw=ea.ModelManager,ww=(e,t)=>t.dom[e],_w=(e,t)=>parseInt(Ii(t,e),10),kw=D(ww,"clientWidth"),Cw=D(ww,"clientHeight"),Sw=D(_w,"margin-top"),Tw=D(_w,"margin-left"),Ew=e=>{const t=[],n=()=>{const t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,getArgs:e}})()},i=()=>F.from(t[0]),o=()=>{i().each((e=>{e.reposition()}))},r=e=>{Z(t,(t=>t===e)).each((e=>{t.splice(e,1)}))},s=(i,s=!0)=>e.removed||!(e=>{return(t=e.inline?e.getBody():e.getContentAreaContainer(),F.from(t).map(hn)).map(Ei).getOr(!1);var t})(e)?{}:(s&&e.dispatch("BeforeOpenNotification",{notification:i}),J(t,(e=>{return t=n().getArgs(e),o=i,!(t.type!==o.type||t.text!==o.text||t.progressBar||t.timeout||o.progressBar||o.timeout);var t,o})).getOrThunk((()=>{e.editorManager.setActive(e);const s=n().open(i,(()=>{r(s)}),(()=>sf(e)));return(e=>{t.push(e)})(s),o(),e.dispatch("OpenNotification",{notification:{...s}}),s}))),a=E(t);return(e=>{e.on("SkinLoaded",(()=>{const t=Qc(e);t&&s({text:t,type:"warning",timeout:0},!1),o()})),e.on("show ResizeEditor ResizeWindow NodeChange ToggleView FullscreenStateChanged",(()=>{requestAnimationFrame(o)})),e.on("remove",(()=>{W(t.slice(),(e=>{n().close(e)}))}
vendor: 5,354 bytes, line 135
135)),e.on("keydown",(e=>{var t;const n="f12"===(null===(t=e.key)||void 0===t?void 0:t.toLowerCase())||123===e.keyCode;e.altKey&&n&&(e.preventDefault(),i().map((e=>hn(e.getEl()))).each((e=>ei(e))))}))})(e),{open:s,close:()=>{i().each((e=>{n().close(e),r(e),o()}))},getNotifications:a}},Aw=ea.PluginManager,Ow=ea.ThemeManager,Dw=e=>{let t=[];const n=()=>{const t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,openUrl:e,alert:e,confirm:e,close:e}})()},i=(e,t)=>(...n)=>t?t.apply(e,n):void 0,o=n=>{(t=>{e.dispatch("CloseWindow",{dialog:t})})(n),t=G(t,(e=>e!==n)),0===t.length&&e.focus()},r=n=>{e.editorManager.setActive(e),Up(e),e.ui.show();const i=n();return(n=>{t.push(n),(t=>{e.dispatch("OpenWindow",{dialog:t})})(n)})(i),i};return e.on("remove",(()=>{W(t,(e=>{n().close(e)}))})),{open:(e,t)=>r((()=>n().open(e,t,o))),openUrl:e=>r((()=>n().openUrl(e,o))),alert:(e,t,o)=>{const r=n();r.alert(e,i(o||r,t))},confirm:(e,t,o)=>{const r=n();r.confirm(e,i(o||r,t))},close:()=>{F.from(t[t.length-1]).each((e=>{n().close(e),o(e)}))}}},Iw=(e,t)=>{e.notificationManager.open({type:"error",text:t})},Pw=(e,t)=>{e._skinLoaded?Iw(e,t):e.on("SkinLoaded",(()=>{Iw(e,t)}))},Mw=(e,t,n)=>{Zl(e,t,{message:n}),console.error(n)},Rw=(e,t,n)=>n?`Failed to load ${e}: ${n} from url ${t}`:`Failed to load ${e} url: ${t}`,zw=(e,...t)=>{const n=window.console;n&&(n.error?n.error(e,...t):n.log(e,...t))},Nw=(e,t,n)=>{try{e.getDoc().execCommand(t,!1,String(n))}catch(e){}},Fw=(e,t,n)=>{co(e,t)&&!n?lo(e,t):n&&so(e,t)},Lw=e=>{const t=hn(e.getBody());Fw(t,"mce-content-readonly",!0),e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),(e=>{F.from(e.selection.getNode()).each((e=>{e.removeAttribute("data-mce-selected")}))})(e)},jw=e=>{const t=hn(e.getBody());Fw(t,"mce-content-readonly",!1),e.hasEditableRoot()&&po(t,!0),((e,t)=>{Nw(e,"StyleWithCSS",t),Nw(e,"enableInlineTableEditing",t),Nw(e,"enableObjectResizing",t)})(e,!1),sf(e)&&e.focus(),(e=>{e.selection.setRng(e.selection.getRng())})(e),e.nodeChanged()},Bw=e=>ah(e),Hw="data-mce-contenteditable",Uw=(e,t)=>{const n=hn(e.getBody());t?(Lw(e),po(n,!1),W(mo(n,'*[contenteditable="true"]'),(e=>{di(e,Hw,"true"),po(e,!1)}))):(W(mo(n,`*[${Hw}="true"]`),(e=>{mi(e,Hw),po(e,!0)})),jw(e))},$w=e=>{e.parser.addAttributeFilter("contenteditable",(t=>{Bw(e)&&W(t,(e=>{e.attr(Hw,e.attr("contenteditable")),e.attr("contenteditable","false")}))})),e.serializer.addAttributeFilter(Hw,(t=>{Bw(e)&&W(t,(e=>{e.attr("contenteditable",e.attr(Hw))}))})),e.serializer.addTempAttr(Hw)},qw=["copy"],Ww=e=>"content/"+e+"/content.css",Vw=(e,t)=>{const n=e.editorManager.baseURL+"/skins/content",i=`content${e.editorManager.suffix}.css`;return q(t,(t=>(e=>tinymce.Resource.has(Ww(e)))(t)?t:(e=>/^[a-z0-9\-]+$/i.test(e))(t)&&!e.inline?`${n}/${t}/${i}`:e.documentBaseURI.toAbsolute(t)))},Kw=()=>{let e={};const t=(e,t)=>({status:e,resultUri:t}),n=t=>t in e;return{hasBlobUri:n,getResultUri:t=>{const n=e[t];return n?n.resultUri:null},isPending:t=>!!n(t)&&1===e[t].status,isUploaded:t=>!!n(t)&&2===e[t].status,markPending:n=>{e[n]=t(1,null)},markUploaded:(n,i)=>{e[n]=t(2,i)},removeFailed:t=>{delete e[t]},destroy:()=>{e={}}}};let Gw=0;const Xw=e=>()=>e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),Yw=(e,t)=>((e,t)=>{const n={},i=(e,n)=>new Promise(((i,o)=>{const r=new XMLHttpRequest;r.open("POST",t.url),r.withCredentials=t.credentials,r.upload.onprogress=e=>{n(e.loaded/e.total*100)},r.onerror=()=>{o("Image upload failed due to a XHR Transport error. Code: "+r.status)},r.onload=()=>{if(r.status<200||r.status>=300)return void o("HTTP Error: "+r.status);const e=JSON.parse(r.responseText);var n,s;e&&u(e.location)?i((n=t.basePath,s=e.location,n?n.replace(/\/$/,"")+"/"+s.replace(/^\//,""):s)):o("Invalid JSON: "+r.responseText)};const s=new FormData;s.append("file",e.blob(),e.filename()),r.send(s)})),o=w(t.handler)?t.handler:i,r=(e,t)=>({url:t,blobInfo:e,status:!0}),s=(e,t)=>({url:"",blobInfo:e,status:!1,error:t}),a=(e,t)=>{sn.each(n[e],(e=>{e(t)})),delete n[e]};return{upload:(l,c)=>t.url||o!==i?((t,i)=>(t=sn.grep(t,(t=>!e.isUploaded(t.blobUri()))),Promise.all(sn.map(t,(t=>e.isPending(t.blobUri())?(e=>{const t=e.blobUri();return new Promise((e=>{n[t]=n[t]||[],n[t].push(e)}))})(t):((t,n,i)=>(e.markPending(t.blobUri()),new Promise((o=>{let l,c;try{const d=()=>{l&&(l.close(),c=C)},h=n=>{d(),e.markUploaded(t.blobUri(),n),a(t.blobUri(),r(t,n)),o(r(t,n))},p=n=>{d(),e.removeFailed(t.blobUri()),a(t.blobUri(),s(t,n)),o(s(t,n))};c=e=>{e<0||e>100||F.from(l).orThunk((()=>F.from(i).map(M))).each((t=>{l=t,t.progressBar.value(e)}))},n(t,c).then(h,(e=>{p(u(e)?{message:e}:e)}))}catch(e){o(s(t,e))}}))))(t,o,i))))))(l,c):new Promise((e=>{e([])}))}})(t,{url:Pc(e),basePath:Mc(e),credentials:Rc(e),handler:zc(e)}),Qw=e=>{const t=(()=>{let e=[];const t=e=>{if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const t=e.id||"blobid"+Gw+++(()=>{const e=()=>Math.round(4294967295*Pe()).toString(36);return"s"+(new Date).getTime().toString(36)+e()+e()+e()})(),n=e.name||t,i=e.blob;var o;return{id:E(t),name:E(n),filename:E(e.filename||n+"."+(o=i.type,{"image/jpeg":"jpg","
135image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[o.toLowerCase()]||"dat")),blob:E(i),base64:E(e.base64),blobUri:E(e.blobUri||URL.createObjectURL(i)),uri:E(e.uri)}},n=t=>J(e,t).getOrUndefined(),i=e=>n((t=>t.id()===e));return{create:(e,n,i,o,r)=>{if(u(e))return t({id:e,name:o,filename:r,blob:n,base64:i});if(p(e))return t(e);throw new Error("Unknown input type")},add:t=>{i(t.id())||e.push(t)},get:i,getByUri:e=>n((t=>t.blobUri()===e)),getByData:(e,t)=>n((n=>n.base64()===e&&n.blob().type===t)),findFirst:n,removeByUri:t=>{e=G(e,(e=>e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)))},destroy:()=>{W(e,(e=>{URL.revokeObjectURL(e.blobUri())})),e=[]}}})();let n,i;const o=Kw(),r=[],s=t=>n=>e.selection?t(n):[],a=(e,t,n)=>{let i=0;do{i=e.indexOf(t,i),-1!==i&&(e=e.substring(0,i)+n+e.substr(i+t.length),i+=n.length-t.length+1)}while(-1!==i);return e},l=(e,t,n)=>{const i=`src="${n}"${n===tn.transparentSrc?' data-mce-placeholder="1"':""}`;return e=a(e,`src="${t}"`,i),a(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},c=(t,n)=>{W(e.undoManager.data,(e=>{"fragmented"===e.type?e.fragments=q(e.fragments,(e=>l(e,t,n))):e.content=l(e.content,t,n)}))},d=()=>(n||(n=Yw(e,o)),m().then(s((i=>{const o=q(i,(e=>e.blobInfo));return n.upload(o,Xw(e)).then(s((n=>{const o=[];let r=!1;const s=q(n,((n,s)=>{const{blobInfo:a,image:l}=i[s];let d=!1;return n.status&&Oc(e)?(n.url&&!Ke(l.src,n.url)&&(r=!0),t.removeByUri(l.src),Jx(e)||((t,n)=>{const i=e.convertURL(n,"src");var o;c(t.src,n),hi(hn(t),{src:Ac(e)?(o=n,o+(-1===o.indexOf("?")?"?":"&")+(new Date).getTime()):n,"data-mce-src":i})})(l,n.url)):n.error&&(n.error.remove&&(c(l.src,tn.transparentSrc),o.push(l),d=!0),((e,t)=>{Pw(e,Zs.translate(["Failed to upload image: {0}",t]))})(e,n.error.message)),{element:l,status:n.status,uploadUri:n.url,blobInfo:a,removed:d}}));return o.length>0&&!Jx(e)?e.undoManager.transact((()=>{W(ki(o),(n=>{const i=Mn(n);bi(n),i.each((e=>t=>{((e,t)=>e.dom.isEmpty(t.dom)&&x(e.schema.getTextBlockElements()[wn(t)]))(e,t)&&si(t,ln('<br data-mce-bogus="1" />'))})(e)),t.removeByUri(n.dom.src)}))})):r&&e.undoManager.dispatchChange(),s})))})))),h=()=>Ec(e)?d():Promise.resolve([]),f=e=>ne(r,(t=>t(e))),m=()=>(i||(i=((e,t)=>{const n={};return{findAll:(i,o=N)=>{const r=G((e=>e?de(e.getElementsByTagName("img")):[])(i),(t=>{const n=t.src;return!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&!(!n||n===tn.transparentSrc)&&(Ge(n,"blob:")?!e.isUploaded(n)&&o(t):!!Ge(n,"data:")&&o(t))})),s=q(r,(e=>{const i=e.src;if(Ce(n,i))return n[i].then((t=>u(t)?t:{image:e,blobInfo:t.blobInfo}));{const o=((e,t)=>{const n=()=>Promise.reject("Invalid data URI");if(Ge(t,"blob:")){const r=e.getByUri(t);return x(r)?Promise.resolve(r):(i=t,Ge(i,"blob:")?(e=>fetch(e).then((e=>e.ok?e.blob():Promise.reject())).catch((()=>Promise.reject({message:`Cannot convert ${e} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"}))))(i):Ge(i,"data:")?(o=i,new Promise(((e,t)=>{Wb(o).bind((({type:e,data:t,base64Encoded:n})=>Vb(e,t,n))).fold((()=>t("Invalid data URI")),e)}))):Promise.reject("Unknown URI format")).then((t=>Kb(t).then((i=>Xb(i,!1,(n=>F.some(Yb(e,t,n)))).getOrThunk(n)))))}var i,o;return Ge(t,"data:")?Qb(e,t).fold(n,(e=>Promise.resolve(e))):Promise.reject("Unknown image data format")})(t,i).then((t=>(delete n[i],{image:e,blobInfo:t}))).catch((e=>(delete n[i],e)));return n[i]=o,o}}));return Promise.all(s)}}})(o,t)),i.findAll(e.getBody(),f).then(s((t=>{const n=G(t,(t=>u(t)?(Pw(e,t),!1):"blob"!==t.uriType));return Jx(e)||W(n,(e=>{c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")})),n})))),g=n=>n.replace(/src="(blob:[^"]+)"/g,((n,i)=>{const r=o.getResultUri(i);if(r)return'src="'+r+'"';let s=t.getByUri(i);return s||(s=Y(e.editorManager.get(),((e,t)=>e||t.editorUpload&&t.editorUpload.blobCache.getByUri(i)),void 0)),s?'src="data:'+s.blob().type+";base64,"+s.base64()+'"':n}));return e.on("SetContent",(()=>{Ec(e)?h():m()})),e.on("RawSaveContent",(e=>{e.content=g(e.content)})),e.on("GetContent",(e=>{e.source_view||"raw"===e.format||"tree"===e.format||(e.content=g(e.content))})),e.on("PostRender",(()=>{e.parser.addNodeFilter("img",(e=>{W(e,(e=>{const n=e.attr("src");if(!n||t.getByUri(n))return;const i=o.getResultUri(n);i&&e.attr("src",i)}))}))})),{blobCache:t,addFilter:e=>{r.push(e)},uploadImages:d,uploadImagesAuto:h,scanForImages:m,destroy:()=>{t.destroy(),o.destroy(),i=n=null}}},Jw={remove_similar:!0,inherit:!1},Zw={selector:"td,th",...Jw},e_={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...Zw},tablecellverticalalign:{styles:{"vertical-align":"%value"},...Zw},tablecellbordercolor:{styles:{borderColor:"%value"},...Zw},tablecellclass:{classes:["%value"],...Zw},tableclass:{selector:"table",classes:["%value"],...Jw},tablecellborderstyle:{styles:{borderStyle:"%value"},...Zw},tablecellborderwidth:{styles:{borderWidth:"%value"},...Zw}},t_=E(e_),n_=sn.each,i_=Ks.DOM,o_=e=>x(e)&&p(e),r_=(e,t)=>
vendor: 11,968 bytes, line 135
135{const n=t&&t.schema||ys({}),i=e=>{const t=u(e)?{name:e,classes:[],attrs:{}}:e,n=i_.create(t.name);return((e,t)=>{t.classes.length>0&&i_.addClass(e,t.classes.join(" ")),i_.setAttribs(e,t.attrs)})(n,t),n},o=(e,t,r)=>{let s;const a=t[0],l=o_(a)?a.name:void 0,c=((e,t)=>{const i=n.getElementRule(e.nodeName.toLowerCase()),o=null==i?void 0:i.parentsRequired;return!(!o||!o.length)&&(t&&U(o,t)?t:o[0])})(e,l);if(c)l===c?(s=a,t=t.slice(1)):s=c;else if(a)s=a,t=t.slice(1);else if(!r)return e;const d=s?i(s):i_.create("div");d.appendChild(e),r&&sn.each(r,(t=>{const n=i(t);d.insertBefore(n,e)}));const h=o_(s)?s.siblings:void 0;return o(d,t,h)},r=i_.create("div");if(e.length>0){const t=e[0],n=i(t),s=o_(t)?t.siblings:void 0;r.appendChild(o(n,e.slice(1),s))}return r},s_=e=>{let t="div";const n={name:t,classes:[],attrs:{},selector:e=sn.trim(e)};return"*"!==e&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,((e,t,i,o,r)=>{switch(t){case"#":n.attrs.id=i;break;case".":n.classes.push(i);break;case":":-1!==sn.inArray("checked disabled enabled read-only required".split(" "),i)&&(n.attrs[i]=i)}if("["===o){const e=r.match(/([\w\-]+)(?:\=\"([^\"]+))?/);e&&(n.attrs[e[1]]=e[2])}return""}))),n.name=t||"div",n},a_=(e,t)=>{let n="",i=od(e);if(""===i)return"";const o=e=>u(e)?e.replace(/%(\w+)/g,""):"",r=(t,n)=>i_.getStyle(null!=n?n:e.getBody(),t,!0);if(u(t)){const n=e.formatter.get(t);if(!n)return"";t=n[0]}if("preview"in t){const e=t.preview;if(!1===e)return"";i=e||i}let s,a=t.block||t.inline||"span";const l=(c=t.selector,u(c)?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),sn.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),(e=>{const t=sn.map(e.split(/(?:~\+|~|\+)/),s_),n=t.pop();return t.length&&(n.siblings=t),n})).reverse()):[]);var c;l.length>0?(l[0].name||(l[0].name=a),a=t.selector,s=r_(l,e)):s=r_([a],e);const d=i_.select(a,s)[0]||s.firstChild;n_(t.styles,((e,t)=>{const n=o(e);n&&i_.setStyle(d,t,n)})),n_(t.attributes,((e,t)=>{const n=o(e);n&&i_.setAttrib(d,t,n)})),n_(t.classes,(e=>{const t=o(e);i_.hasClass(d,t)||i_.addClass(d,t)})),e.dispatch("PreviewFormats"),i_.setStyles(s,{position:"absolute",left:-65535}),e.getBody().appendChild(s);const h=r("fontSize"),p=/px$/.test(h)?parseInt(h,10):0;return n_(i.split(" "),(e=>{let t=r(e,d);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=r(e),"#ffffff"===Es(t).toLowerCase())||"color"===e&&"#000000"===Es(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===p)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*p+"px"}"border"===e&&t&&(n+="padding:0 2px;"),n+=e+":"+t+";"}})),e.dispatch("AfterPreviewFormats"),i_.remove(s),n},l_=e=>{const t=(e=>{const t={},n=(e,i)=>{e&&(u(e)?(m(i)||(i=[i]),W(i,(e=>{b(e.deep)&&(e.deep=!cp(e)),b(e.split)&&(e.split=!cp(e)||dp(e)),b(e.remove)&&cp(e)&&!dp(e)&&(e.remove="none"),cp(e)&&dp(e)&&(e.mixed=!0,e.block_expand=!0),u(e.classes)&&(e.classes=e.classes.split(/\s+/))})),t[e]=i):me(e,((e,t)=>{n(t,e)})))};return n((e=>{const t=e.dom,n=e.schema.type,i={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:!1,preview:!1},{selector:"img,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"},{selector:".mce-placeholder",styles:{float:"left"},ceFalseOverride:!0},{selector:"table",collapsed:!1,styles:{marginLeft:"0px",marginRight:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:".mce-placeholder",styles:{display:"block",marginLeft:"auto",marginRight:"auto"},ceFalseOverride:!0},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:!0,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{marginLeft:"auto",marginRight:"auto"},preview:!1}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"},{selector:".mce-placeholder",styles:{float:"right"},ceFalseOverride:!0},{selector:"table",collapsed:!1,styles:{marginRight:"0px",marginLeft:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"right"},preview:!1}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:!1,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const e={inline:"span",styles:{textDecoration:"line-through"},exact:!0},t={inline:"strike",remove:"all",preserve_attributes:["class","style"]},i={inline:"s",remove:"all",preserve_attributes:["class","style"]};return"html4"!==n?[i,e,t]:[e,i,t]})(),forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},samp:{inline:"samp"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(e,t,n)=>jo(e)&&e.hasAttribute("href"),onformat:(e,n,i)=>{sn.each(i,((n,i)=>{t.setAttrib(e,i,n)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":e=>{var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return sn.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd".split(/\s/),(e=>{i[e]={block:e,remove:"all"}})),i})(e)),n(t_()),n(id(e)),{get:e=>x(e)?t[e]:t,has:e=>Ce(t,e),register:n,unregister:e=>(e&&t[e]&&delete t[e],t)}})(e),n=Ee({});return(e=>{e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(let t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])})(e),(e=>{e.on("mouseup keydown",(t=>{var n;((e,t,n)=>{const i=e.selection,o=e.getBody();Wv(e,null,n),8!==t&&46!==t||!i.isCollapsed()||i.getStart().innerHTML!==Hv||Wv(e,yu(o,i.getStart()),!0),37!==t&&39!==t||Wv(e,yu(o,i.getStart()),!0)})(e,t.keyCode,(n=e.selection.getRng().endContainer,Go(n)&&Xe(n.data,at)))}))})(e),Jx(e)||((e,t)=>{e.set({}),t.on("NodeChange",(n=>{Ub(t,n.element,e.get())})),t.on("FormatApply FormatRemove",(n=>{const i=F.from(n.node).map((e=>Vu(e)?e:e.startContainer)).bind((e=>jo(e)?F.some(e):F.from(e.parentElement))).getOrThunk((()=>jb(t)));Ub(t,i,e.get())}))})(n,e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:(t,n,i)=>{((e,t,n,i)=>{ew(e).formatter.apply(t,n,i)})(e,t,n,i)},remove:(t,n,i,o)=>{((e,t,n,i,o)=>{ew(e).formatter.remove(t,n,i,o)})(e,t,n,i,o)},toggle:(t,n,i)=>{((e,t,n,i)=>{ew(e).formatter.toggle(t,n,i)})(e,t,n,i)},match:(t,n,i,o)=>((e,t,n,i,o)=>ew(e).formatter.match(t,n,i,o))(e,t,n,i,o),closest:t=>((e,t)=>ew(e).formatter.closest(t))(e,t),matchAll:(t,n)=>((e,t,n)=>ew(e).formatter.matchAll(t,n))(e,t,n),matchNode:(t,n,i,o)=>((e,t,n,i,o)=>ew(e).formatter.matchNode(t,n,i,o))(e,t,n,i,o),canApply:t=>((e,t)=>ew(e).formatter.canApply(t))(e,t),formatChanged:(t,i,o,r)=>((e,t,n,i,o,r)=>ew(e).formatter.formatChanged(t,n,i,o,r))(e,n,t,i,o,r),getCssText:D(a_,e)}},c_=e=>{switch(e.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},d_=e=>{const t=qe(),n=Ee(0),i=Ee(0),o={data:[],typing:!1,beforeChange:()=>{((e,t,n)=>{ew(e).undoManager.beforeChange(t,n)})(e,n,t)},add:(r,s)=>((e,t,n,i,o,r,s)=>ew(e).undoManager.add(t,n,i,o,r,s))(e,o,i,n,t,r,s),dispatchChange:()=>{e.setDirty(!0);const t=$x(e);t.bookmark=Wl(e.selection),e.dispatch("change",{level:t,lastLevel:ae(o.data,i.get()).getOrUndefined()})},undo:()=>((e,t,n,i)=>ew(e).undoManager.undo(t,n,i))(e,o,n,i),redo:()=>((e,t,n)=>ew(e).undoManager.redo(t,n))(e,i,o.data),clear:()=>{((e,t,n)=>{ew(e).undoManager.clear(t,n)})(e,o,i)},reset:()=>{((e,t)=>{ew(e).undoManager.reset(t)})(e,o)},hasUndo:()=>((e,t,n)=>ew(e).undoManager.hasUndo(t,n))(e,o,i),hasRedo:()=>((e,t,n)=>ew(e).undoManager.hasRedo(t,n))(e,o,i),transact:t=>((e,t,n,i)=>ew(e).undoManager.transact(t,n,i))(e,o,n,t),ignore:t=>{((e,t,n)=>{ew(e).undoManager.ignore(t,n)})(e,n,t)},extra:(t,n)=>{((e,t,n,i,o)=>{ew(e).undoManager.extra(t,n,i,o)})(e,o,i,t,n)}};return Jx(e)||((e,t,n)=>{const i=Ee(!1),o=e=>{Xx(t,!1,n),t.add({},e)};e.on("init",(()=>{t.add()})),e.on("BeforeExecCommand",(e=>{const i=e.command;c_(i)||(Yx(t,n),t.beforeChange())})),e.on("ExecCommand",(e=>{const t=e.command;c_(t)||o(e)})),e.on("ObjectResizeStart cut",(()=>{t.beforeChange()})),e.on("SaveContent ObjectResized blur",o),e.on("dragend",o),e.on("keyup",(n=>{const r=n.keyCode;if(n.isDefaultPrevented())return;const s=tn.os.isMacOS()&&"Meta"===n.key;(r>=33&&r<=36||r>=37&&r<=40||45===r||n.ctrlKey||s)&&(o(),e.nodeChanged()),46!==r&&8!==r||e.nodeChanged(),i.get()&&t.typing&&!Kx($x(e),t.data[0])&&(e.isDirty()||e.setDirty(!0),e.dispatch("TypingUndo"),i.set(!1),e.nodeChanged())})),e.on("keydown",(e=>{const r=e.keyCode;if(e.isDefaultPrevented())return;if(r>=33&&r<=36||r>=37&&r<=40||45===r)return void(t.typing&&o(e));const s=e.ctrlKey&&!e.altKey||e.metaKey;if((r<16||r>20)&&224!==r&&91!==r&&!t.typing&&!s)return t.beforeChange(),Xx(t,!0,n),t.add({},e),void i.set(!0);(tn.os.isMacOS()?e.metaKey:e.ctrlKey&&!e.altKey)&&t.beforeChange()})),e.on("mousedown",(e=>{t.typing&&o(e)})),e.on("input",(e=>{var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data||(e=>"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType)(e))&&o(e)})),e.on("AddUndo Undo Redo ClearUndos",(t=>{t.isDefaultPrevented()||e.nodeChanged()}))})(e,o,n),(e=>
vendor: 2,433 bytes, line 135
135{e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo")})(e),o},h_=[9,27,lf.HOME,lf.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,lf.DOWN,lf.UP,lf.LEFT,lf.RIGHT].concat(tn.browser.isFirefox()?[224]:[]),u_="data-mce-placeholder",p_=e=>"keydown"===e.type||"keyup"===e.type,f_=e=>{const t=e.keyCode;return t===lf.BACKSPACE||t===lf.DELETE},m_=(e,t)=>({from:e,to:t}),g_=(e,t)=>{const n=hn(e),i=hn(t.container());return Rg(n,i).map((e=>((e,t)=>({block:e,position:t}))(e,t)))},v_=(e,t)=>Qi(t,(e=>xa(e)||ir(e.dom)),(t=>bn(t,e))).filter(Sn).getOr(e),b_=(e,t)=>{const n=((e,t)=>{const n=Bn(e);return Z(n,(e=>t.isBlock(wn(e)))).fold(E(n),(e=>n.slice(0,e)))})(e,t);return W(n,bi),n},y_=(e,t,n)=>{const i=Lm(n,t);return J(i.reverse(),(t=>mr(e,t))).each(bi)},x_=(e,t,n,i,o)=>{if(mr(i,n))return ka(n),mu(n.dom);((e,t)=>0===G(Ln(t),(t=>!mr(e,t))).length)(i,o)&&mr(i,t)&&ii(o,cn("br"));const r=fu(n.dom,Cl.before(o.dom));return W(b_(t,i),(e=>{ii(o,e)})),y_(i,e,t),r},w_=(e,t,n,i)=>{if(mr(i,n)){if(mr(i,t)){const e=X((e=>{const t=(e,n)=>Un(e).fold((()=>n),(e=>((e,t)=>e.isInline(wn(t)))(i,e)?t(e,n.concat(wi(e))):n));return t(e,[])})(n),((e,t)=>(ai(e,t),t)),_a());vi(t),si(t,e)}return bi(n),mu(t.dom)}const o=gu(n.dom);return W(b_(t,i),(e=>{si(n,e)})),y_(i,e,t),o},__=(e,t)=>{uu(e,t.dom).bind((e=>F.from(e.getNode()))).map(hn).filter(ma).each(bi)},k_=(e,t,n,i)=>(__(!0,t),__(!1,n),((e,t)=>yn(t,e)?((e,t)=>{const n=Lm(t,e);return F.from(n[n.length-1])})(t,e):F.none())(t,n).fold(D(w_,e,t,n,i),D(x_,e,t,n,i))),C_=(e,t,n,i,o)=>t?k_(e,i,n,o):k_(e,n,i,o),S_=(e,t)=>{const n=hn(e.getBody());return((e,t,n,i)=>i.collapsed?((e,t,n,i)=>{const o=g_(t,Cl.fromRangeStart(i)),r=o.bind((i=>cu(n,t,i.position).bind((i=>g_(t,i).map((i=>((e,t,n,i)=>er(i.position.getNode())&&!mr(e,i.block)?uu(!1,i.block.dom).bind((e=>e.isEqual(i.position)?cu(n,t,e).bind((e=>g_(t,e))):F.some(i))).getOr(i):i)(e,t,n,i)))))));return Be(o,r,m_).filter((e=>(e=>!bn(e.from.block,e.to.block))(e)&&((e,t)=>{const n=hn(e);return bn(v_(n,t.from.block),v_(n,t.to.block))})(t,e)&&(e=>!1===or(e.from.block.dom)&&!1===or(e.to.block.dom))(e)&&(e=>{const t=e=>ga(e)||Or(e.dom)||ba(e);return t(e.from.block)&&t(e.to.block)})(e)&&(e=>!(yn(e.to.block,e.from.block)||yn(e.from.block,e.to.block)))(e)))})(e,t,n,i):F.none())(e.schema,n.dom,t,e.selection.getRng()).map((i=>()=>{C_(n,t,i.from.block,i.to.block,e.schema).each((t=>{e.selection.setRng(t.toRange())}))}))},T_=(e,t)=>
vendor: 2,347 bytes, line 135
135{const n=hn(t),i=D(bn,e);return Yi(n,xa,i).isSome()},E_=(e,t)=>e.selection.isCollapsed()?F.none():(e=>{const t=hn(e.getBody());return((e,t)=>{const n=fu(e.dom,Cl.fromRangeStart(t)).isNone(),i=pu(e.dom,Cl.fromRangeEnd(t)).isNone();return!((e,t)=>T_(e,t.startContainer)||T_(e,t.endContainer))(e,t)&&n&&i})(t,e.selection.getRng())?(e=>F.some((()=>{e.setContent(""),e.selection.setCursorLocation()})))(e):((e,t,n)=>{const i=t.getRng();return Be(Rg(e,hn(i.startContainer)),Rg(e,hn(i.endContainer)),((o,r)=>bn(o,r)?F.none():F.some((()=>{i.deleteContents(),C_(e,!0,o,r,n).each((e=>{t.setRng(e.toRange())}))})))).getOr(F.none())})(t,e.selection,e.schema)})(e),A_=(e,t,n,i,o)=>F.from(t._selectionOverrides.showCaret(e,n,i,o)),O_=(e,t)=>e.dispatch("BeforeObjectSelected",{target:t}).isDefaultPrevented()?F.none():F.some((e=>{const t=e.ownerDocument.createRange();return t.selectNode(e),t})(t)),D_=(e,t,n)=>t.collapsed?((e,t,n)=>{const i=$h(1,e.getBody(),t),o=Cl.fromRangeStart(i),r=o.getNode();if(xh(r))return A_(1,e,r,!o.isAtEnd(),!1);const s=o.getNode(!0);if(xh(s))return A_(1,e,s,!1,!1);const a=cv(e.dom.getRoot(),o.getNode());return xh(a)?A_(1,e,a,!1,n):F.none()})(e,t,n).getOr(t):t,I_=e=>zm(e)||Im(e),P_=e=>Nm(e)||Pm(e),M_=(e,t,n,i,o,r)=>{A_(i,e,r.getNode(!o),o,!0).each((n=>{if(t.collapsed){const e=t.cloneRange();o?e.setEnd(n.startContainer,n.startOffset):e.setStart(n.endContainer,n.endOffset),e.deleteContents()}else t.deleteContents();e.selection.setRng(n)})),((e,t)=>{Go(t)&&0===t.data.length&&e.remove(t)})(e.dom,n)},R_=(e,t)=>((e,t)=>{const n=e.selection.getRng();if(!Go(n.commonAncestorContainer))return F.none();const i=t?1:-1,o=ru(e.getBody()),r=D(Kh,t?o.next:o.prev),s=t?I_:P_,a=Wh(i,e.getBody(),n),l=r(a),c=l?Eg(t,l):l;if(!c||!Gh(a,c))return F.none();if(s(c))return F.some((()=>M_(e,n,a.getNode(),i,t,c)));const d=r(c);return d&&s(d)&&Gh(c,d)?F.some((()=>M_(e,n,a.getNode(),i,t,d))):F.none()})(e,t),z_=(e,t)=>{const n=e.getBody();return t?mu(n).filter(zm):gu(n).filter(Nm)},N_=e=>{const t=e.selection.getRng();return!t.collapsed&&(z_(e,!0).exists((e=>e.isEqual(Cl.fromRangeStart(t))))||z_(e,!1).exists((e=>e.isEqual(Cl.fromRangeEnd(t)))))},F_=Te([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),L_=(e,t,n,i)=>cu(t,e,n).bind((o=>{return r=o.getNode(),x(r)&&(xa(hn(r))||ba(hn(r)))||((e,t,n,i,o)=>{const r=t=>
vendor: 9,274 bytes, line 135
135o.isInline(t.nodeName.toLowerCase())&&!Nh(n,i,e);return qh(!t,n).fold((()=>qh(t,i).fold(z,r)),r)})(e,t,n,o,i)?F.none():t&&or(o.getNode())||!t&&or(o.getNode(!0))?((e,t,n,i,o)=>{const r=o.getNode(!n);return Rg(hn(t),hn(i.getNode())).map((t=>mr(e,t)?F_.remove(t.dom):F_.moveToElement(r))).orThunk((()=>F.some(F_.moveToElement(r))))})(i,e,t,n,o):t&&Nm(n)||!t&&zm(n)?F.some(F_.moveToPosition(o)):F.none();var r})),j_=(e,t)=>F.from(cv(e.getBody(),t)),B_=e=>{const t=e.dom,n=e.selection,i=cv(e.getBody(),n.getNode());if(ir(i)&&t.isBlock(i)&&t.isEmpty(i)){const e=t.create("br",{"data-mce-bogus":"1"});t.setHTML(i,""),i.appendChild(e),n.setRng(Cl.before(e).toRange())}return!0},H_=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const n=e.selection.getNode();return j_(e,n).filter(or).fold((()=>((e,t,n,i)=>{const o=$h(t?1:-1,e,n),r=Cl.fromRangeStart(o),s=hn(e);return!t&&Nm(r)?F.some(F_.remove(r.getNode(!0))):t&&zm(r)?F.some(F_.remove(r.getNode())):!t&&zm(r)&&Ym(s,r,i)?Qm(s,r,i).map((e=>F_.remove(e.getNode()))):t&&Nm(r)&&Xm(s,r,i)?Jm(s,r,i).map((e=>F_.remove(e.getNode()))):((e,t,n,i)=>((e,t)=>{const n=t.getNode(!e),i=e?"after":"before";return jo(n)&&n.getAttribute("data-mce-caret")===i})(t,n)?((e,t)=>y(t)?F.none():e&&or(t.nextSibling)?F.some(F_.moveToElement(t.nextSibling)):!e&&or(t.previousSibling)?F.some(F_.moveToElement(t.previousSibling)):F.none())(t,n.getNode(!t)).orThunk((()=>L_(e,t,n,i))):L_(e,t,n,i).bind((t=>((e,t,n)=>n.fold((e=>F.some(F_.remove(e))),(e=>F.some(F_.moveToElement(e))),(n=>Nh(t,n,e)?F.none():F.some(F_.moveToPosition(n)))))(e,n,t))))(e,t,r,i)})(e.getBody(),t,e.selection.getRng(),e.schema).map((n=>()=>n.fold(((e,t)=>n=>(e._selectionOverrides.hideFakeCaret(),_g(e,t,hn(n)),!0))(e,t),((e,t)=>n=>{const i=t?Cl.before(n):Cl.after(n);return e.selection.setRng(i.toRange()),!0})(e,t),(e=>t=>(e.selection.setRng(t.toRange()),!0))(e))))),(()=>F.some(C)))})(e,t):((e,t)=>{const n=e.selection.getNode();return or(n)&&!sr(n)?j_(e,n.parentNode).filter(or).fold((()=>F.some((()=>{var n;n=hn(e.getBody()),W(mo(n,".mce-offscreen-selection"),bi),_g(e,t,hn(e.selection.getNode())),zg(e)}))),(()=>F.some(C))):N_(e)?F.some((()=>{Lg(e,e.selection.getRng(),hn(e.getBody()))})):F.none()})(e,t),U_=e=>e.hasOwnProperty("text"),$_=e=>e.hasOwnProperty("marker"),q_=(e,t)=>{const n=(e,n)=>{if(Go(e))return{text:e,offset:n};{const i=t(),o=e.childNodes;return n<o.length?(e.insertBefore(i,o[n]),{marker:i,before:!0}):(e.appendChild(i),{marker:i,before:!1})}},i=n(e.endContainer,e.endOffset);return{start:n(e.startContainer,e.startOffset),end:i}},W_=e=>{var t,n;const{start:i,end:o}=e,r=new window.Range;return U_(i)?r.setStart(i.text,i.offset):$_(i)&&(i.before?r.setStartBefore(i.marker):r.setStartAfter(i.marker),null===(t=i.marker.parentNode)||void 0===t||t.removeChild(i.marker)),U_(o)?r.setEnd(o.text,o.offset):$_(o)&&(o.before?r.setEndBefore(o.marker):r.setEndAfter(o.marker),null===(n=o.marker.parentNode)||void 0===n||n.removeChild(o.marker)),r},V_=(e,t)=>{var n;const i=e.dom,o=i.getParent(e.selection.getStart(),i.isBlock),r=i.getParent(e.selection.getEnd(),i.isBlock),s=e.getBody();if("div"===(null===(n=null==o?void 0:o.nodeName)||void 0===n?void 0:n.toLowerCase())&&o&&r&&o===s.firstChild&&r===s.lastChild&&!i.isEmpty(s)){const n=o.cloneNode(!1),i=()=>{if(t?Pg(e):Ig(e),s.firstChild!==o){const t=q_(e.selection.getRng(),(()=>document.createElement("span")));Array.from(s.childNodes).forEach((e=>n.appendChild(e))),s.appendChild(n),e.selection.setRng(W_(t))}};return F.some(i)}return F.none()},K_=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const n=Cl.fromRangeStart(e.selection.getRng());return cu(t,e.getBody(),n).filter((e=>t?Om(e):Dm(e))).bind((e=>Fh(t?0:-1,e))).map((t=>()=>e.selection.select(t)))})(e,t):F.none(),G_=Go,X_=e=>G_(e)&&e.data[0]===Ca,Y_=e=>G_(e)&&e.data[e.data.length-1]===Ca,Q_=e=>{var t;return(null!==(t=e.ownerDocument)&&void 0!==t?t:document).createTextNode(Ca)},J_=(e,t)=>e?(e=>{var t;if(G_(e.previousSibling))return Y_(e.previousSibling)||e.previousSibling.appendData(Ca),e.previousSibling;if(G_(e))return X_(e)||e.insertData(0,Ca),e;{const n=Q_(e);return null===(t=e.parentNode)||void 0===t||t.insertBefore(n,e),n}})(t):(e=>{var t,n;if(G_(e.nextSibling))return X_(e.nextSibling)||e.nextSibling.insertData(0,Ca),e.nextSibling;if(G_(e))return Y_(e)||e.appendData(Ca),e;{const i=Q_(e);return e.nextSibling?null===(t=e.parentNode)||void 0===t||t.insertBefore(i,e.nextSibling):null===(n=e.parentNode)||void 0===n||n.appendChild(i),i}})(t),Z_=D(J_,!0),ek=D(J_,!1),tk=(e,t)=>Go(e.container())?J_(t,e.container()):J_(t,e.getNode()),nk=(e,t)=>{const n=t.get();return n&&e.container()===n&&Da(n)},ik=(e,t)=>t.fold((t=>{fh(e.get());const n=Z_(t);return e.set(n),F.some(Cl(n,n.length-1))}),(t=>mu(t).map((t=>{if(nk(t,e)){const t=e.get();return Cl(t,1)}{fh(e.get());const n=tk(t,!0);return e.set(n),Cl(n,1)}}))),(t=>gu(t).map((t=>{if(nk(t,e)){const t=e.get();return Cl(t,t.length-1)}{fh(e.get());const n=tk(t,!1);return e.set(n),Cl(n,n.length-1)}}))),(t=>{fh(e.get());const n=ek(t);return e.set(n),F.some(Cl(n,1))})),ok=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n].apply(null,t);if(i.isSome())return i}return F.none()},rk=Te([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),sk=(e,t)=>zh(t,e)||e,ak=(e,t,n)=>{const i=Ag(n),o=sk(t,i.container());return Tg(e,o,i).fold((()=>pu(o,i).bind(D(Tg,e,o)).map((e=>rk.before(e)))),F.none)},lk=(e,t)=>null===yu(e,t),ck=(e,t,n)=>Tg(e,t,n).filter(D(lk,t)),dk=(e,t,n)=>{const i=Og(n);return ck(e,t,i).bind((e=>fu(e,i).isNone()?F.some(rk.start(e)):F.none()))},hk=(e,t,n)=>{const i=Ag(n);return ck(e,t,i).bind((e=>pu(e,i).isNone()?F.some(rk.end(e)):F.none()))},uk=(e,t,n)=>{const i=Og(n),o=sk(t,i.container());return Tg(e,o,i).fold((()=>fu(o,i).bind(D(Tg,e,o)).map((e=>rk.after(e)))),F.none)},pk=e=>!Sg(mk(e)),fk=(e,t,n)=>ok([ak,dk,hk,uk],[e,t,n]).filter(pk),mk=e=>e.fold(A,A,A,A),gk=e=>e.fold(E("before"),E("start"),E("end"),E("after")),vk=e=>e.fold(rk.before,rk.before,rk.after,rk.after),bk=e=>e.fold(rk.start,rk.start,rk.end,rk.end),yk=(e,t,n,i,o,r)=>Be(Tg(t,n,i),Tg(t,n,o),((t,i)=>t!==i&&((e,t,n)=>{const i=zh(t,e),o=zh(n,e);return x(i)&&i===o})(n,t,i)?rk.after(e?t:i):r)).getOr(r),xk=(e,t)=>e.fold(N,(e=>{return i=t,!(gk(n=e)===gk(i)&&mk(n)===mk(i));var n,i})),wk=(e,t)=>e?t.fold(S(F.some,rk.start),F.none,S(F.some,rk.after),F.none):t.fold(F.none,S(F.some,rk.before),F.none,S(F.some,rk.end)),_k=(e,t,n)=>{const i=e?1:-1;return t.setRng(Cl(n.container(),n.offset()+i).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0};var kk;!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol"}(kk||(kk={}));const Ck=(e,t)=>-1===e?ie(t):t,Sk=(e,t,n)=>1===e?t.next(n):t.prev(n),Tk=(e,t,n,i)=>er(i.getNode(1===t))?kk.Br:!1===Nh(n,i)?kk.Block:kk.Wrap,Ek=(e,t,n,i)=>{const o=ru(n);let r=i;const s=[];for(;r;){const n=Sk(t,o,r);if(!n)break;if(er(n.getNode(!1)))return 1===t?{positions:Ck(t,s).concat([n]),breakType:kk.Br,breakAt:F.some(n)}:{positions:Ck(t,s),breakType:kk.Br,breakAt:F.some(n)};if(n.isVisible()){if(e(r,n)){const e=Tk(0,t,r,n);return{positions:Ck(t,s),breakType:e,breakAt:F.some(n)}}s.push(n),r=n}else r=n}return{positions:Ck(t,s),breakType:kk.Eol,breakAt:F.none()}},Ak=(e,t,n,i)=>t(n,i).breakAt.map((i=>{const o=t(n,i).positions;return-1===e?o.concat(i):[i].concat(o)})).getOr([]),Ok=(e,t)=>Y(e,((e,n)=>e.fold((()=>F.some(n)),(i=>Be(le(i.getClientRects()),le(n.getClientRects()),((e,o)=>{const r=Math.abs(t-e.left);return Math.abs(t-o.left)<=r?n:i})).or(e)))),F.none()),Dk=(e,t)=>le(t.getClientRects()).bind((t=>Ok(e,t.left))),Ik=D(Ek,Cl.isAbove,-1),Pk=D(Ek,Cl.isBelow,1),Mk=D(Ak,-1,Ik),Rk=D(Ak,1,Pk),zk=(e,t)=>Ik(e,t).breakAt.isNone(),Nk=(e,t)=>Pk(e,t).breakAt.isNone(),Fk=(e,t)=>Dk(Mk(e,t),t),Lk=(e,t)=>Dk(Rk(e,t),t),jk=or,Bk=(e,t)=>Math.abs(e.left-t),Hk=(e,t)=>Math.abs(e.right-t),Uk=(e,t)=>mt(e,((e,n)=>{const i=Math.min(Bk(e,t),Hk(e,t)),o=Math.min(Bk(n,t),Hk(n,t));return o===i&&Se(n,"node")&&jk(n.node)||o<i?n:e})),$k=e=>{const t=t=>q(t,(t=>{const n=Ba(t);return n.node=e,n}));if(jo(e))return t(e.getClientRects());if(Go(e)){const n=e.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,e.data.length),t(n.getClientRects())}return[]},qk=e=>te(e,$k);var Wk;!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down"}(Wk||(Wk={}));const Vk=(e,t,n,i,o,r)=>{let s=0;const a=[],l=i=>{let r=qk([i]);e===Wk.Up&&(r=r.reverse());for(let e=0;e<r.length;e++){const i=r[e];if(!n(i,c)){if(a.length>0&&t(i,vt(a))&&s++,i.line=s,o(i))return!0;a.push(i)}}return!1},c=vt(r.getClientRects());if(!c)return a;const d=r.getNode();return d&&(l(d),((e,t,n,i)=>{let o=i;for(;o=Rh(o,e,sl,t);)if(n(o))return})(e,i,l,d)),a},Kk=D(Vk,Wk.Up,$a,qa),Gk=D(Vk,Wk.Down,qa,$a),Xk=e=>vt(e.getClientRects()),Yk=e=>t=>((e,t)=>t.line>e)(e,t),Qk=e=>t=>((e,t)=>t.line===e)(e,t),Jk=(e,t)=>{e.selection.setRng(t),Hf(e,e.selection.getRng())},Zk=(e,t,n)=>F.some(D_(e,t,n)),eC=(e,t,n,i,o,r)=>{const s=1===t,a=ru(e.getBody()),l=D(Kh,s?a.next:a.prev),c=s?i:o;if(!n.collapsed){const i=Va(n);if(r(i))return A_(t,e,i,-1===t,!1);if(N_(e)){const e=n.cloneRange();return e.collapse(-1===t),F.from(e)}}const d=Wh(t,e.getBody(),n);if(c(d))return O_(e,d.getNode(!s));let h=l(d);const u=La(n);if(!h)return u?F.some(n):F.none();if(h=Eg(s,h),c(h))return A_(t,e,h.getNode(!s),s,!1);const p=l(h);
vendor: 4,772 bytes, line 135
135return p&&c(p)&&Gh(h,p)?A_(t,e,p.getNode(!s),s,!1):u?Zk(e,h.toRange(),!1):F.none()},tC=(e,t,n,i,o,r)=>{const s=Wh(t,e.getBody(),n),a=vt(s.getClientRects()),l=t===Wk.Down,c=e.getBody();if(!a)return F.none();if(N_(e)){const e=l?Cl.fromRangeEnd(n):Cl.fromRangeStart(n);return(l?Lk:Fk)(c,e).orThunk((()=>F.from(e))).map((e=>e.toRange()))}const d=(l?Gk:Kk)(c,Yk(1),s),h=G(d,Qk(1)),u=a.left,p=Uk(h,u);if(p&&r(p.node)){const n=Math.abs(u-p.left),i=Math.abs(u-p.right);return A_(t,e,p.node,n<i,!1)}let f;if(f=i(s)?s.getNode():o(s)?s.getNode(!0):Va(n),f){const n=((e,t,n,i)=>{const o=ru(t);let r,s,a,l;const c=[];let d=0;e===Wk.Down?(r=o.next,s=qa,a=$a,l=Cl.after(i)):(r=o.prev,s=$a,a=qa,l=Cl.before(i));const h=Xk(l);do{if(!l.isVisible())continue;const e=Xk(l);if(a(e,h))continue;c.length>0&&s(e,vt(c))&&d++;const t=Ba(e);if(t.position=l,t.line=d,n(t))return c;c.push(t)}while(l=r(l));return c})(t,c,Yk(1),f);let i=Uk(G(n,Qk(1)),u);if(i)return Zk(e,i.position.toRange(),!1);if(i=vt(G(n,Qk(0))),i)return Zk(e,i.position.toRange(),!1)}return 0===h.length?nC(e,l).filter(l?o:i).map((t=>D_(e,t.toRange(),!1))):F.none()},nC=(e,t)=>{const n=e.selection.getRng(),i=t?Cl.fromRangeEnd(n):Cl.fromRangeStart(n),o=(r=i.container(),s=e.getBody(),Yi(hn(r),(e=>_h(e.dom)),(e=>e.dom===s)).map((e=>e.dom)).getOr(s));var r,s;if(t){const e=Pk(o,i);return ce(e.positions)}{const e=Ik(o,i);return le(e.positions)}},iC=(e,t,n)=>nC(e,t).filter(n).exists((t=>(e.selection.setRng(t.toRange()),!0))),oC=(e,t)=>{const n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},rC=(e,t)=>{e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},sC=(e,t,n)=>ik(t,n).map((t=>(oC(e,t),n))),aC=(e,t,n)=>!!nd(e)&&((e,t,n)=>{const i=e.getBody(),o=((e,t,n)=>{const i=Cl.fromRangeStart(e);if(e.collapsed)return i;{const o=Cl.fromRangeEnd(e);return n?fu(t,o).getOr(o):pu(t,i).getOr(i)}})(e.selection.getRng(),i,n);return((e,t,n,i)=>{const o=Eg(e,i),r=fk(t,n,o);return fk(t,n,o).bind(D(wk,e)).orThunk((()=>((e,t,n,i,o)=>{const r=Eg(e,o);return cu(e,n,r).map(D(Eg,e)).fold((()=>i.map(vk)),(o=>fk(t,n,o).map(D(yk,e,t,n,r,o)).filter(D(xk,i)))).filter(pk)})(e,t,n,r,i)))})(n,D(Cg,e),i,o).bind((n=>sC(e,t,n)))})(e,t,n).isSome(),lC=(e,t,n)=>!!nd(t)&&((e,t)=>{const n=t.selection.getRng(),i=e?Cl.fromRangeEnd(n):Cl.fromRangeStart(n);return!!(e=>w(e.selection.getSel().modify))(t)&&(e&&Ma(i)?_k(!0,t.selection,i):!(e||!Ra(i))&&_k(!1,t.selection,i))})(e,t),cC=e=>{const t=Ee(null),n=D(Cg,e);return e.on("NodeChange",(i=>{nd(e)&&(((e,t,n)=>{const i=q(mo(hn(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(e=>e.dom)),o=G(i,e),r=G(n,e);W(oe(o,r),D(rC,!1)),W(oe(r,o),D(rC,!0))})(n,e.dom,i.parents),((e,t)=>{const n=t.get();if(e.selection.isCollapsed()&&!e.composing&&n){const i=Cl.fromRangeStart(e.selection.getRng());Cl.isTextPosition(i)&&!(e=>Ma(e)||Ra(e))(i)&&(oC(e,((e,t)=>Cl.isTextPosition(t)?((e,t)=>ch(e)&&t.container()===e?((e,t)=>{const n=hh(e.data.substr(0,t.offset())),i=hh(e.data.substr(t.offset()));return(n.text+i.text).length>0?(uh(e),Cl(e,t.offset()-n.count)):t})(e,t):ph(e,t))(e,t):((e,t)=>t.container()===e.parentNode?((e,t)=>{const n=t.container(),i=((e,t)=>{const n=H(e,t);return-1===n?F.none():F.some(n)})(de(n.childNodes),e).map((e=>e<t.offset()?Cl(n,t.offset()-1):t)).getOr(t);return fh(e),i})(e,t):ph(e,t))(e,t))(n,i)),t.set(null))}})(e,t),((e,t,n,i)=>{if(t.selection.isCollapsed()){const o=G(i,e);W(o,(i=>{const o=Cl.fromRangeStart(t.selection.getRng());fk(e,t.getBody(),o).bind((e=>sC(t,n,e)))}))}})(n,e,t,i.parents))})),t},dC=D(lC,!0),hC=D(lC,!1),uC=(e,t,n)=>{if(nd(e)){const i=nC(e,t).getOrThunk((()=>{const n=e.selection.getRng();return t?Cl.fromRangeEnd(n):Cl.fromRangeStart(n)}));return fk(D(Cg,e),e.getBody(),i).exists((t=>{const i=vk(t);return ik(n,i).exists((t=>(oC(e,t),!0)))}))}return!1},pC=(e,t)=>n=>ik(t,n).map((t=>()=>oC(e,t))),fC=(e,t,n,i)=>{const o=e.getBody(),r=D(Cg,e);e.undoManager.ignore((()=>{e.selection.setRng(((e,t)=>{const n=document.createRange();return n.setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n})(n,i)),Ig(e),fk(r,o,Cl.fromRangeStart(e.selection.getRng())).map(bk).bind(pC(e,t)).each(R)})),e.nodeChanged()},mC=(e,t,n)=>{if(e.selection.isCollapsed()&&nd(e)){const i=Cl.fromRangeStart(e.selection.getRng());return((e,t,n,i)=>{const o=((e,t)=>zh(t,e)||e)(e.getBody(),i.container()),r=D(Cg,e),s=fk(r,o,i);return s.bind((e=>n?e.fold(E(F.some(bk(e))),F.none,E(F.some(vk(e))),F.none):e.fold(F.none,E(F.some(vk(e))),F.none,E(F.some(bk(e)))))).map(pC(e,t)).getOrThunk((()=>{const a=du(n,o,i),l=a.bind((e=>fk(r,o,e)));return Be(s,l,(()=>Tg(r,o,i).bind((t=>(e=>Be(mu(e),gu(e),((t,n)=>{const i=Eg(!0,t),o=Eg(!1,n);return pu(e,i).forall((e=>e.isEqual(o)))}
vendor: 8,893 bytes, line 135
135)).getOr(!0))(t)?F.some((()=>{_g(e,n,hn(t))})):F.none())))).getOrThunk((()=>l.bind((()=>a.map((o=>()=>{n?fC(e,t,i,o):fC(e,t,o,i)}))))))}))})(e,t,n,i)}return F.none()},gC=(e,t)=>{const n=hn(e.getBody()),i=hn(e.selection.getStart()),o=Lm(i,n);return Z(o,t).fold(E(o),(e=>o.slice(0,e)))},vC=e=>1===qn(e),bC=(e,t)=>{const n=D(Zv,e);return te(t,(e=>n(e)?[e.dom]:[]))},yC=e=>{const t=(e=>gC(e,(t=>e.schema.isBlock(wn(t)))))(e);return bC(e,t)},xC=(e,t)=>{const n=e.selection.getStart(),i=((e,t)=>{const n=t.parentElement;return er(t)&&!g(n)&&e.dom.isEmpty(n)})(e,n)||pp(hn(n))?Jv(n,t):((e,t)=>{const{caretContainer:n,caretPosition:i}=Qv(t);return e.insertNode(n.dom),i})(e.selection.getRng(),t);e.selection.setRng(i.toRange())},wC=e=>Go(e.startContainer),_C=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const n=G((e=>gC(e,(t=>e.schema.isBlock(wn(t))||(e=>qn(e)>1)(t))))(e),vC);return ce(n).bind((i=>{const o=Cl.fromRangeStart(e.selection.getRng());return Ng(t,o,i.dom)&&!pp(i)?F.some((()=>((e,t,n,i)=>{const o=bC(t,i);if(0===o.length)_g(t,e,n);else{const e=Jv(n.dom,o);t.selection.setRng(e.toRange())}})(t,e,i,n))):F.none()}))})(e,t):(e=>{if((e=>{const t=e.selection.getRng();return(e=>0===e.startOffset&&wC(e))(t)&&((e,t)=>{const n=t.startContainer.parentElement;return!g(n)&&Zv(e,hn(n))})(e,t)&&(e=>(e=>(e=>{const t=e.startContainer.parentNode,n=e.endContainer.parentNode;return!g(t)&&!g(n)&&t.isEqualNode(n)})(e)&&(e=>{const t=e.endContainer;return e.endOffset===(Go(t)?t.length:t.childNodes.length)})(e))(e)||(e=>!e.endContainer.isEqualNode(e.commonAncestorContainer))(e))(t)})(e)){const t=yC(e);return F.some((()=>{Ig(e),((e,t)=>{const n=oe(t,yC(e));n.length>0&&xC(e,n)})(e,t)}))}return F.none()})(e),kC=e=>((e=>{const t=e.selection.getRng();return t.collapsed&&(wC(t)||e.dom.isEmpty(t.startContainer))&&!(e=>{return t=hn(e.selection.getStart()),n=e.schema,go(t,(e=>bu(e.dom)),(e=>n.isBlock(wn(e))));var t,n})(e)})(e)&&xC(e,[]),!0),CC=(e,t,n)=>x(n)?F.some((()=>{e._selectionOverrides.hideFakeCaret(),_g(e,t,hn(n))})):F.none(),SC=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const n=t?Im:Pm,i=Wh(t?1:-1,e.getBody(),e.selection.getRng());return n(i)?CC(e,t,i.getNode(!t)):F.from(Eg(t,i)).filter((e=>n(e)&&Gh(i,e))).bind((n=>CC(e,t,n.getNode(!t))))})(e,t):((e,t)=>{const n=e.selection.getNode();return lr(n)?CC(e,t,n):F.none()})(e,t),TC=e=>nt(null!=e?e:"").getOr(0),EC=(e,t)=>(e||"table"===wn(t)?"margin":"padding")+("rtl"===Ii(t,"direction")?"-right":"-left"),AC=e=>{const t=DC(e);return!e.mode.isReadOnly()&&(t.length>1||((e,t)=>ne(t,(t=>{const n=EC(Bc(e),t),i=Mi(t,n).map(TC).getOr(0);return"false"!==e.dom.getContentEditable(t.dom)&&i>0})))(e,t))},OC=e=>va(e)||ba(e),DC=e=>G(ki(e.selection.getSelectedBlocks()),(e=>!OC(e)&&!(e=>Mn(e).exists(OC))(e)&&Qi(e,(e=>ir(e.dom)||or(e.dom))).exists((e=>ir(e.dom))))),IC=(e,t)=>{var n,i;if(e.mode.isReadOnly())return;const{dom:o}=e,r=Hc(e),s=null!==(i=null===(n=/[a-z%]+$/i.exec(r))||void 0===n?void 0:n[0])&&void 0!==i?i:"px",a=TC(r),l=Bc(e);W(DC(e),(e=>{((e,t,n,i,o,r)=>{const s=EC(n,hn(r)),a=TC(e.getStyle(r,s));if("outdent"===t){const t=Math.max(0,a-i);e.setStyle(r,s,t?t+o:"")}else{const t=a+i+o;e.setStyle(r,s,t)}})(o,t,l,a,s,e.dom)}))},PC=e=>IC(e,"outdent"),MC=e=>{if(e.selection.isCollapsed()&&AC(e)){const t=e.dom,n=e.selection.getRng(),i=Cl.fromRangeStart(n),o=t.getParent(n.startContainer,t.isBlock);if(null!==o&&$m(hn(o),i,e.schema))return F.some((()=>PC(e)))}return F.none()},RC=(e,t,n)=>he([MC,H_,R_,(e,n)=>mC(e,t,n),S_,lv,K_,SC,E_,_C,V_],(t=>t(e,n))).filter((t=>e.selection.isEditable())),zC=e=>void 0===e.touches||1!==e.touches.length?F.none():F.some(e.touches[0]),NC=(e,t)=>Ce(e,t.nodeName),FC=(e,t)=>!!Go(t)||!!jo(t)&&!(NC(e.getBlockElements(),t)||Iu(t)||Pr(e,t)||yr(t)),LC=(e,t)=>{if(Go(t)){if(0===t.data.length)return!0;if(/^\s+$/.test(t.data))return!t.nextSibling||NC(e,t.nextSibling)||yr(t.nextSibling)}return!1},jC=e=>e.dom.create(xc(e),wc(e)),BC=(e,t,n)=>{const i=hn(jC(e)),o=_a();si(i,o),n(t,i);const r=document.createRange();return r.setStartBefore(o.dom),r.setEndBefore(o.dom),r},HC=e=>t=>-1!==(" "+t.attr("class")+" ").indexOf(e),UC=(e,t,n)=>function(i){const o=arguments,r=o[o.length-2],s=r>0?t.charAt(r-1):"";if('"'===s)return i;if(">"===s){const e=t.lastIndexOf("<",r);if(-1!==e&&-1!==t.substring(e,r).indexOf('contenteditable="false"'))return i}return'<span class="'+n+'" data-mce-content="'+e.dom.encode(o[0])+'">'+e.dom.encode("string"==typeof o[1]?o[1]:o[0])+"</span>"},$C=(e,t)=>ne(e,(e=>{const n=t.match(e);return null!==n&&n[0].length===t.length})),qC=(e,t)=>{t.hasAttribute("data-mce-caret")&&(Fa(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))},WC=(e,t)=>{const n=(e=>eo(hn(e.getBody()),"*[data-mce-caret]").map((e=>e.dom)).getOrNull())(e);if(n)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void qC(e,n)):void(Pa(n)&&(qC(e,n),e.undoManager.add()))},VC=or,KC=(e,t,n)=>{const i=ru(e.getBody()),o=D(Kh,1===t?i.next:i.prev);if(n.collapsed){const i=e.dom.getParent(n.startContainer,"PRE");if(!i)return;if(!o(Cl.fromRangeStart(n))){const n=hn((e=>{const t=e.dom.create(xc(e));return t.innerHTML='<br data-mce-bogus="1">',t})(e));1===t?oi(hn(i),n):ii(hn(i),n),e.selection.select(n.dom,!0),e.selection.collapse()}}},GC=(e,t)=>((e,t)=>{const n=t?1:-1,i=e.selection.getRng();return((e,t,n)=>eC(t,e,n,zm,Nm,VC))(n,e,i).orThunk((()=>(KC(e,n,i),F.none())))})(e,((e,t)=>{const n=t?e.getEnd(!0):e.getStart(!0);return Sg(n)?!t:t})(e.selection,t)).exists((t=>(Jk(e,t),!0))),XC=(e,t)=>((e,t)=>{const n=t?1:-1,i=e.selection.getRng();return((e,t,n)=>tC(t,e,n,(e=>zm(e)||Mm(e)),(e=>Nm(e)||Rm(e)),VC))(n,e,i).orThunk((()=>(KC(e,n,i),F.none())))})(e,t).exists((t=>(Jk(e,t),!0))),YC=(e,t)=>iC(e,t,t?Nm:zm),QC=(e,t)=>z_(e,!t).map((n=>{const i=n.toRange(),o=e.selection.getRng();return t?i.setStart(o.startContainer,o.startOffset):i.setEnd(o.endContainer,o.endOffset),i})).exists((t=>(Jk(e,t),!0))),JC=e=>U(["figcaption"],wn(e)),ZC=(e,t)=>!!e.selection.isCollapsed()&&((e,t)=>{const n=hn(e.getBody()),i=Cl.fromRangeStart(e.selection.getRng());return((e,t,n)=>{const i=D(bn,t);return Qi(hn(e.container()),(e=>n.isBlock(wn(e))),i).filter(JC)})(i,n,e.schema).exists((()=>{if(((e,t,n)=>t?Nk(e.dom,n):zk(e.dom,n))(n,t,i)){const i=BC(e,n,t?si:ri);return e.selection.setRng(i),!0}return!1}))})(e,t),eS=(e,t)=>((e,t)=>t?F.from(e.dom.getParent(e.selection.getNode(),"details")).map((t=>((e,t)=>{const n=e.selection.getRng(),i=Cl.fromRangeStart(n);return!(e.getBody().lastChild!==t||!Nk(t,i)||(e.execCommand("InsertNewBlockAfter"),0))})(e,t))).getOr(!1):F.from(e.dom.getParent(e.selection.getNode(),"summary")).bind((t=>F.from(e.dom.getParent(t,"details")).map((n=>((e,t,n)=>{const i=e.selection.getRng(),o=Cl.fromRangeStart(i);return!(e.getBody().firstChild!==t||!zk(n,o)||(e.execCommand("InsertNewBlockBefore"),0))})(e,n,t))))).getOr(!1))(e,t),tS={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},nS=(e,t)=>t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey,iS=(e,...t)=>()=>e.apply(null,t),oS=(e,t)=>J(((e,t)=>te((e=>q(e,(e=>({...tS,...e}))))(e),(e=>nS(e,t)?[e]:[])))(e,t),(e=>e.action())),rS=(e,t)=>he(((e,t)=>te((e=>q(e,(e=>({...tS,...e}))))(e),(e=>nS(e,t)?[e]:[])))(e,t),(e=>e.action())),sS=(e,t)=>{const n=t?1:-1,i=e.selection.getRng();return eC(e,n,i,Im,Pm,lr).exists((t=>(Jk(e,t),!0)))},aS=(e,t)=>{const n=t?1:-1,i=e.selection.getRng();return tC(e,n,i,Im,Pm,lr).exists((t=>(Jk(e,t),!0)))},lS=(e,t)=>iC(e,t,t?Pm:Im),cS=(e,t,n)=>te(Bn(e),(e=>gn(e,t)?n(e)?[e]:[]:cS(e,t,n))),dS=(e,t)=>to(e,"table",t),hS=Te([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),uS={...hS,none:e=>hS.none(e)},pS=(e,t,n,i,o=N)=>{const r=1===i;if(!r&&n<=0)return uS.first(e[0]);if(r&&n>=e.length-1)return uS.last(e[e.length-1]);{const r=n+i,s=e[r];return o(s)?uS.middle(t,s):pS(e,t,r,i,o)}},fS=(e,t)=>dS(e,t).bind((t=>{const n=cS(t,"th,td",N);return Z(n,(t=>bn(e,t))).map((e=>({index:e,all:n})))})),mS=Re("image"),gS=Re("event"),vS=e=>t=>{t[gS]=e},bS=vS(0),yS=vS(2),xS=vS(1),wS=Re("mode"),_S=e=>t=>{t[wS]=e},kS=(e,t)=>_S(t)(e),CS=_S(0),SS=_S(2),TS=_S(1),ES=e=>t=>{const n=t;return F.from(n[wS]).exists((t=>t===e))},AS=ES(0),OS=ES(1),DS=["none","copy","link","move"],IS=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"],PS=()=>{const e=new window.DataTransfer;let t="move",n="all";const i={get dropEffect(){return t},set dropEffect(e){U(DS,e)&&(t=e)},get effectAllowed(){return n},set effectAllowed(e){(e=>{const t=e;return F.from(t[gS]).exists((e=>0===e))})(i)&&U(IS,e)&&(n=e)},get items(){return((e,t)=>({...t,get length(){return t.length},add:(n,i)=>{if(AS(e)){if(!u(n))return t.add(n);if(!b(i))return t.add(n,i)}return null},remove:n=>{AS(e)&&t.remove(n)},clear:()=>{AS(e)&&t.clear()}}))(i,e.items)},get files(){return OS(i)?Object.freeze({length:0,item:e=>null}):e.files}
vendor: 9,000 bytes, line 135
135,get types(){return e.types},setDragImage:(t,n,o)=>{var r;AS(i)&&(r={image:t,x:n,y:o},i[mS]=r,e.setDragImage(t,n,o))},getData:t=>OS(i)?"":e.getData(t),setData:(t,n)=>{AS(i)&&e.setData(t,n)},clearData:t=>{AS(i)&&e.clearData(t)}};return CS(i),i},MS=(e,t)=>e.setData("text/html",t),RS=(e,t,n,i,o)=>{const r=mo(hn(n),"td,th,caption").map((e=>e.dom));return((e,t,n)=>Y(e,((e,i)=>e.fold((()=>F.some(i)),(e=>{const o=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-n)),r=Math.sqrt(Math.abs(i.x-t)+Math.abs(i.y-n));return F.some(r<o?i:e)}))),F.none()))(G(((e,t)=>te(t,(t=>{const n=((e,t)=>({left:e.left- -1,top:e.top- -1,right:e.right+-2,bottom:e.bottom+-2,width:e.width+-1,height:e.height+-1}))(Ba(t.getBoundingClientRect()));return[{x:n.left,y:e(n),cell:t},{x:n.right,y:e(n),cell:t}]})))(e,r),(e=>t(e,o))),i,o).map((e=>e.cell))},zS=D(RS,(e=>e.bottom),((e,t)=>e.y<t)),NS=D(RS,(e=>e.top),((e,t)=>e.y>t)),FS=(e,t,n)=>{const i=e(t,n);return(e=>e.breakType===kk.Wrap&&0===e.positions.length)(i)||!er(n.getNode())&&(e=>e.breakType===kk.Br&&1===e.positions.length)(i)?!((e,t,n)=>n.breakAt.exists((n=>e(t,n).breakAt.isSome())))(e,t,i):i.breakAt.isNone()},LS=D(FS,Ik),jS=D(FS,Pk),BS=(e,t,n,i)=>{const o=e.selection.getRng(),r=t?1:-1;return!(!yh()||!((e,t,n)=>{const i=Cl.fromRangeStart(t);return uu(!e,n).exists((e=>e.isEqual(i)))})(t,o,n)||(A_(r,e,n,!t,!1).each((t=>{Jk(e,t)})),0))},HS=(e,t,n)=>{const i=((e,t)=>{const n=t.getNode(e);return Wo(n)?F.some(n):F.none()})(!!t,n),o=!1===t;i.fold((()=>Jk(e,n.toRange())),(i=>uu(o,e.getBody()).filter((e=>e.isEqual(n))).fold((()=>Jk(e,n.toRange())),(n=>((e,t,n)=>{t.undoManager.transact((()=>{const i=e?oi:ii,o=BC(t,hn(n),i);Jk(t,o)}))})(t,e,i)))))},US=(e,t,n,i)=>{const o=e.selection.getRng(),r=Cl.fromRangeStart(o),s=e.getBody();if(!t&&LS(i,r)){const i=((e,t,n)=>((e,t)=>le(t.getClientRects()).bind((t=>zS(e,t.left,t.top))).bind((e=>{return Dk(gu(n=e).map((e=>Ik(n,e).positions.concat(e))).getOr([]),t);var n})))(t,n).orThunk((()=>le(n.getClientRects()).bind((n=>Ok(Mk(e,Cl.before(t)),n.left))))).getOr(Cl.before(t)))(s,n,r);return HS(e,t,i),!0}if(t&&jS(i,r)){const i=((e,t,n)=>((e,t)=>ce(t.getClientRects()).bind((t=>NS(e,t.left,t.top))).bind((e=>{return Dk(mu(n=e).map((e=>[e].concat(Pk(n,e).positions))).getOr([]),t);var n})))(t,n).orThunk((()=>le(n.getClientRects()).bind((n=>Ok(Rk(e,Cl.after(t)),n.left))))).getOr(Cl.after(t)))(s,n,r);return HS(e,t,i),!0}return!1},$S=(e,t,n)=>F.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((i=>F.from(e.dom.getParent(i,"table")).map((o=>n(e,t,o,i))))).getOr(!1),qS=(e,t)=>$S(e,t,BS),WS=(e,t)=>$S(e,t,US),VS=(e,t,n)=>n.fold(F.none,F.none,((e,t)=>{return(n=t,Ji(n,wo)).map((e=>(e=>(e=>{const t=To.getWin(e).dom,n=(e,n,i,o)=>pn(t,e,n,i,o),i=(e=>e.match({domRange:e=>{const t=hn(e.startContainer),n=hn(e.endContainer);return Oo(t,e.startOffset,n,e.endOffset)},relative:Ao,exact:Oo}))(e);return((e,t)=>((e,t)=>{const n=t.ltr();return n.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>fn.rtl(hn(e.endContainer),e.endOffset,hn(e.startContainer),e.startOffset))).getOrThunk((()=>mn(0,fn.ltr,n))):mn(0,fn.ltr,n)})(0,((e,t)=>t.match({domRange:e=>({ltr:E(e),rtl:F.none}),relative:(t,n)=>({ltr:rt((()=>un(e,t,n))),rtl:rt((()=>F.some(un(e,n,t))))}),exact:(t,n,i,o)=>({ltr:rt((()=>pn(e,t,n,i,o))),rtl:rt((()=>F.some(pn(e,i,o,t,n))))})}))(e,t)))(t,i).match({ltr:n,rtl:n})})(To.exact(e,0,e,0)))(e)));var n}),(n=>e.mode.isReadOnly()||!KS(n)?F.none():(e.execCommand("mceTableInsertRowAfter"),GS(e,t,n)))),KS=e=>Qi(e,On("table")).exists(ho),GS=(e,t,n)=>{return VS(e,t,(o=YS,fS(i=n,void 0).fold((()=>uS.none(i)),(e=>pS(e.all,i,e.index,1,o)))));var i,o},XS=(e,t,n)=>{return VS(e,t,(o=YS,fS(i=n,void 0).fold((()=>uS.none()),(e=>pS(e.all,i,e.index,-1,o)))));var i,o},YS=e=>ho(e)||vo(e,QS),QS=e=>Cn(e)&&ho(e),JS=(e,t)=>{const n=["table","li","dl"],i=hn(e.getBody()),o=e=>{const t=wn(e);return bn(e,i)||U(n,t)},r=e.selection.getRng();return((e,t)=>((e,t,n=z)=>n(t)?F.none():U(e,wn(t))?F.some(t):Zi(t,e.join(","),(e=>gn(e,"table")||n(e))))(["td","th"],e,t))(hn(t?r.endContainer:r.startContainer),o).map((n=>(dS(n,o).each((t=>{e.model.table.clearSelectedCells(t.dom)})),e.selection.collapse(!t),(t?GS:XS)(e,o,n).each((t=>{e.selection.setRng(t)})),!0))).getOr(!1)},ZS=(e,t)=>({container:e,offset:t}),eT=Ks.DOM,tT=e=>t=>e===t?-1:0,nT=(e,t,n)=>{if(Go(e)&&t>=0)return F.some(ZS(e,t));{const i=pa(eT);return F.from(i.backwards(e,t,tT(e),n)).map((e=>ZS(e.container,e.container.data.length)))}},iT=(e,t,n)=>{if(!Go(e))return F.none();const i=e.data;if(t>=0&&t<=i.length)return F.some(ZS(e,t));{const i=pa(eT);return F.from(i.backwards(e,t,tT(e),n)).bind((e=>{const i=e.container.data;return iT(e.container,t+i.length,n)}))}},oT=(e,t,n)=>{if(!Go(e))return F.none();const i=e.data;if(t<=i.length)return F.some(ZS(e,t));{const o=pa(eT);return F.from(o.forwards(e,t,tT(e),n)).bind((e=>oT(e.container,t-i.length,n)))}},rT=(e,t,n,i,o)=>{const r=pa(e,(e=>t=>e.isBlock(t)||U(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===e.getContentEditable(t))(e));return F.from(r.backwards(t,n,i,o))},sT=e=>""!==e&&-1!=="  \ufeff\f\n\r\t\v".indexOf(e),aT=(e,t)=>e.substring(t.length),lT=(e,t,n,i=!1)=>{if(!(o=t).collapsed||!Go(o.startContainer))return F.none();var o;const r={text:"",offset:0},s=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return rT(e,t.startContainer,t.startOffset,((e,t,o)=>(r.text=o+r.text,r.offset+=t,((e,t,n,i=!1)=>{let o;const r=n.charAt(0);for(o=t-1;o>=0;o--){const s=e.charAt(o);if(!i&&sT(s))return F.none();if(r===s&&Ke(e,n,o,t))break}return F.some(o)})(r.text,r.offset,n,i).getOr(t))),s).bind((e=>{const i=t.cloneRange();if(i.setStart(e.container,e.offset),i.setEnd(t.endContainer,t.endOffset),i.collapsed)return F.none();const o=(e=>Ta(e.toString().replace(/\u00A0/g," ")))(i);return 0!==o.lastIndexOf(n)?F.none():F.some({text:aT(o,n),range:i,trigger:n})}))},cT=e=>{if((e=>3===e.nodeType)(e))return ZS(e,e.data.length);{const t=e.childNodes;return t.length>0?cT(t[t.length-1]):ZS(e,t.length)}},dT=(e,t)=>{const n=e.childNodes;return n.length>0&&t<n.length?dT(n[t],0):n.length>0&&(e=>1===e.nodeType)(e)&&n.length===t?cT(n[n.length-1]):ZS(e,t)},hT=(e,t,n,i={})=>{var o;const r=t(),s=null!==(o=e.selection.getRng().startContainer.nodeValue)&&void 0!==o?o:"",a=G(r.lookupByTrigger(n.trigger),(t=>n.text.length>=t.minChars&&t.matches.getOrThunk((()=>(e=>t=>{const n=dT(t.startContainer,t.startOffset);return!((e,t)=>{var n;const i=null!==(n=e.getParent(t.container,e.isBlock))&&void 0!==n?n:e.getRoot();return rT(e,t.container,t.offset,((e,t)=>0===t?-1:t),i).filter((e=>{const t=e.container.data.charAt(e.offset-1);return!sT(t)})).isSome()})(e,n)})(e.dom)))(n.range,s,n.text)));if(0===a.length)return F.none();const l=Promise.all(q(a,(e=>e.fetch(n.text,e.maxResults,i).then((t=>({matchText:n.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn}))))));return F.some({lookupData:l,context:n})};var uT;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(uT||(uT={}));const pT=(e,t,n)=>e.stype===uT.Error?t(e.serror):n(e.svalue),fT=e=>({stype:uT.Value,svalue:e}),mT=e=>({stype:uT.Error,serror:e}),gT=pT,vT=e=>p(e)&&pe(e).length>100?" removed due to size":JSON.stringify(e,null,2),bT=(e,t)=>mT([{path:e,getErrorInfo:t}]),yT=e=>({extract:(t,n)=>{return o=e=>((e,t)=>bT(e,E(t)))(t,e),(i=e(n)).stype===uT.Error?o(i.serror):i;var i,o},toString:E("val")}),xT=yT(fT),wT=E(xT),_T=(e,t)=>yT((n=>{const i=typeof n;return e(n)?fT(n):mT(`Expected type: ${t} but got: ${i}`)})),kT=_T(_,"number"),CT=_T(u,"string"),ST=_T(v,"boolean"),TT=_T(w,"function"),ET=e=>{if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every((t=>ET(e[t])));default:return!1}};yT((e=>ET(e)?fT(e):mT("Expected value to be acceptable for sending via postMessage")));const AT=e=>({tag:"defaultedThunk",process:E(e)}),OT=(e,t,n)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return n(e.newKey,e.instantiator)}},DT=(e,t,n,i)=>i(ke(e,t).getOrThunk((()=>n(e)))),IT=(e,t,n,i,o)=>{const r=e=>o.extract(t.concat([i]),e),s=e=>e.fold((()=>fT(F.none())),(e=>{return n=o.extract(t.concat([i]),e),r=F.some,n.stype===uT.Value?{stype:uT.Value,svalue:r(n.svalue)}:n;var n,r}));switch(e.tag){case"required":return((e,t,n,i)=>ke(t,n).fold((()=>((e,t,n)=>bT(e,(()=>'Could not find valid *required* value for "'+t+'" in '+vT(n))))(e,n,t)),i))(t,n,i,r);case"defaultedThunk":return DT(n,i,e.process,r);case"option":return((e,t,n)=>n(ke(e,t)))(n,i,s);case"defaultedOptionThunk":return((e,t,n,i)=>i(ke(e,t).map((t=>!0===t?n(e):t))))(n,i,e.process,s);case"mergeWithThunk":return DT(n,i,E({}),(t=>{const i=Ne(e.process(n),t);return r(i)}))}},PT=e=>({extract:(t,n)=>((e,t,n)=>{const i={},o=[];for(const r of n)OT(r,((n,r,s,a)=>{const l=IT(s,e,t,n,a);gT(l,(e=>{o.push(...e)}),(e=>{i[r]=e}))}),((e,n)=>{i[e]=n(t)}));return o.length>
1350?mT(o):fT(i)})(t,n,e),toString:()=>"obj{\n"+q(e,(e=>OT(e,((e,t,n,i)=>e+" -> "+i.toString()),((e,t)=>"state("+e+")")))).join("\n")+"}"}),MT=(e,t,n)=>{return i=((e,t,n)=>((e,t)=>e.stype===uT.Error?{stype:uT.Error,serror:(e=>({input:n,errors:e}))(e.serror)}:e)(t.extract([e],n)))(e,t,n),pT(i,De.error,De.value);var i},RT=(e,t,n,i)=>({tag:"field",key:e,newKey:t,presence:n,prop:i}),zT=(e,t)=>RT(e,e,{tag:"required",process:{}},t),NT=e=>zT(e,CT),FT=e=>zT(e,TT),LT=(e,t)=>RT(e,e,{tag:"option",process:{}},t),jT=e=>LT(e,CT),BT=e=>LT(e,TT),HT=(e,t)=>RT(e,e,AT(t),wT()),UT=(e,t,n)=>RT(e,e,AT(t),n),$T=(e,t)=>UT(e,t,kT),qT=(e,t)=>UT(e,t,ST),WT=(e,t)=>UT(e,t,TT),VT=NT("type");NT("name"),NT("label"),NT("text"),NT("title"),NT("icon"),NT("url");const KT=NT("value"),GT=FT("fetch");FT("getSubmenuItems");const XT=FT("onAction");FT("onItemAction"),WT("onSetup",(()=>C)),jT("name");const YT=jT("text");jT("role");const QT=jT("icon");jT("url"),jT("tooltip"),jT("label"),jT("shortcut"),BT("select");const JT=qT("active",!1);qT("borderless",!1);const ZT=qT("enabled",!0);qT("primary",!1);const eE=HT("meta",{});WT("onAction",C),PT([UT("type","autocompleteitem",CT),JT,ZT,eE,KT,YT,QT]);const tE=PT([VT,NT("trigger"),$T("minChars",1),HT("columns",1),$T("maxResults",10),BT("matches"),GT,XT,(nE=CT,UT("highlightOn",[],(iE=nE,{extract:(e,t)=>(e=>{const t=(e=>{const t=[],n=[];return W(e,(e=>{pT(e,(e=>n.push(e)),(e=>t.push(e)))})),{values:t,errors:n}})(e);return t.errors.length>0?(n=t.errors,S(mT,ee)(n)):fT(t.values);var n})(q(t,((t,n)=>iE.extract(e.concat(["["+n+"]"]),t)))),toString:()=>"array("+iE.toString()+")"})))]);var nE,iE;const oE=e=>{const t=qe(),n=Ee(!1),i=t.isSet,o=()=>{i()&&((e=>{e.dispatch("AutocompleterEnd")})(e),n.set(!1),t.clear())},r=rt((()=>(e=>{const t=e.ui.registry.getAll().popups,n=ge(t,(e=>{return(t=e,MT("Autocompleter",tE,t)).fold((e=>{throw new Error("Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:E("... (only showing first ten failures)")}]):e;return q(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})((t=e).errors).join("\n")+"\n\nInput object: "+vT(t.input));var t}),A);var t})),i=ct(we(n,(e=>e.trigger))),o=_e(n);return{dataset:n,triggers:i,lookupByTrigger:e=>G(o,(t=>t.trigger===e))}})(e))),s=s=>{(n=>t.get().map((t=>lT(e.dom,e.selection.getRng(),t.trigger,!0).bind((t=>hT(e,r,t,n))))).getOrThunk((()=>((e,t)=>{const n=t(),i=e.selection.getRng();return((e,t,n)=>he(n.triggers,(n=>lT(e,t,n))))(e.dom,i,n).bind((n=>hT(e,t,n)))})(e,r))))(s).fold(o,(o=>{(e=>{i()||t.set({trigger:e.trigger,matchLength:e.text.length})})(o.context),o.lookupData.then((i=>{t.get().map((r=>{const s=o.context;r.trigger===s.trigger&&(t.set({...r,matchLength:s.text.length}),n.get()?(oc(e,{range:s.range}),((e,t)=>{e.dispatch("AutocompleterUpdate",t)})(e,{lookupData:i})):(n.set(!0),oc(e,{range:s.range}),((e,t)=>{e.dispatch("AutocompleterStart",t)})(e,{lookupData:i})))}))}))}))},a=()=>t.get().bind((({trigger:t})=>{const i=e.selection.getRng();return lT(e.dom,i,t,n.get()).filter((({range:e})=>((e,t)=>{const n=e.compareBoundaryPoints(window.Range.START_TO_START,t),i=e.compareBoundaryPoints(window.Range.END_TO_END,t);return n>=0&&i<=0})(i,e))).map((({range:e})=>e))}));e.addCommand("mceAutocompleterReload",((e,t)=>{const n=p(t)?t.fetchOptions:{};s(n)})),e.addCommand("mceAutocompleterClose",o),e.addCommand("mceAutocompleterRefreshActiveRange",(()=>{a().each((t=>{oc(e,{range:t})}))})),e.editorCommands.addQueryStateHandler("mceAutoCompleterInRange",(()=>a().isSome())),((e,t)=>{const n=ot(t.load,50);e.on("input",(t=>{("insertCompositionText"!==t.inputType||e.composing)&&n.throttle()})),e.on("keydown",(e=>{const i=e.which;8===i?n.throttle():27===i?(n.cancel(),t.cancelIfNecessary()):38!==i&&40!==i||n.cancel()}),!0),e.on("remove",n.cancel)})(e,{cancelIfNecessary:o,load:s})},rE=Kt().browser.isSafari(),sE=e=>ka(hn(e)),aE=(e,t)=>{var n;return 0===e.startOffset&&e.endOffset===(null===(n=t.textContent)||void 0===n?void 0:n.length)},lE=(e,t)=>F.from(e.getParent(t.container(),"details")),cE=(e,t)=>lE(e,t).isSome(),dE=(e,t)=>{const n=t.getNode();b(n)||e.selection.setCursorLocation(n,t.offset())},hE=(e,t,n)=>{const i=e.dom.getParent(t.container(),"details");if(i&&!i.open){const t=e.dom.select("summary",i)[0];t&&(n?mu(t):gu(t)).each((t=>dE(e,t)))}else dE(e,t)},uE=(e,t,n)=>{const{dom:i,selection:o}=e,r=e.getBody();if("character"===n){const n=Cl.fromRangeStart(o.getRng()),s=i.getParent(n.container(),i.isBlock),a=lE(i,n),l=s&&i.isEmpty(s),c=g(null==s?void 0:s.previousSibling),d=g(null==s?void 0:s.nextSibling);return!!(l&&(t?d:c)&&du(!t,r,n).exists((e=>cE(i,e)&&!je(a,lE(i,e)))))||du(t,r,n).fold(z,(n=>{const o=lE(i,n);if(cE(i,n)&&!je(a,o)){if(t||hE(e,n,!1),s&&l){if(t&&c)return!0;
vendor: 4,089 bytes, line 135
135if(!t&&d)return!0;hE(e,n,t),e.dom.remove(s)}return!0}return!1}))}return!1},pE=(e,t,n)=>((e,t,n)=>((e,t)=>{const n=F.from(e.getParent(t.startContainer,"details")),i=F.from(e.getParent(t.endContainer,"details"));if(n.isSome()||i.isSome()){const t=n.bind((t=>F.from(e.select("summary",t)[0])));return F.some({startSummary:t,startDetails:n,endDetails:i})}return F.none()})(e.dom,e.selection.getRng()).fold((()=>uE(e,t,n)),(i=>((e,t,n,i)=>{const o=e.selection.getRng(),r=Cl.fromRangeStart(o),s=e.getBody();return"selection"===i?((e,t)=>{const n=t.startSummary.exists((t=>t.contains(e.startContainer))),i=t.startSummary.exists((t=>t.contains(e.endContainer))),o=t.startDetails.forall((e=>t.endDetails.forall((t=>e!==t))));return(n||i)&&!(n&&i)||o})(o,t):n?((e,t)=>t.startSummary.exists((t=>((e,t)=>gu(t).exists((n=>er(n.getNode())&&fu(t,n).exists((t=>t.isEqual(e)))||n.isEqual(e))))(e,t))))(r,t)||((e,t,n)=>n.startDetails.exists((n=>pu(e,t).forall((e=>!n.contains(e.container()))))))(s,r,t):((e,t)=>t.startSummary.exists((t=>((e,t)=>mu(t).exists((t=>t.isEqual(e))))(e,t))))(r,t)||((e,t)=>t.startDetails.exists((n=>fu(n,e).forall((n=>t.startSummary.exists((t=>!t.contains(e.container())&&t.contains(n.container()))))))))(r,t)})(e,i,t,n)||uE(e,t,n))))(e,t,n)||rE&&((e,t,n)=>{const i=e.selection,o=i.getNode(),r=i.getRng(),s=Cl.fromRangeStart(r);return!!hr(o)&&("selection"===n&&aE(r,o)||Ng(t,s,o)?sE(o):e.undoManager.transact((()=>{const r=i.getSel();let{anchorNode:s,anchorOffset:a,focusNode:l,focusOffset:c}=null!=r?r:{};const d=()=>{x(s)&&x(a)&&x(l)&&x(c)&&(null==r||r.setBaseAndExtent(s,a,l,c))},h=(e,t)=>{W(e.childNodes,(e=>{Vu(e)&&t.appendChild(e)}))},u=e.dom.create("span",{"data-mce-bogus":"1"});h(o,u),o.appendChild(u),d(),"word"!==n&&"line"!==n||null==r||r.modify("extend",t?"right":"left",n),!i.isCollapsed()&&aE(i.getRng(),u)?sE(o):(e.execCommand(t?"ForwardDelete":"Delete"),s=null==r?void 0:r.anchorNode,a=null==r?void 0:r.anchorOffset,l=null==r?void 0:r.focusNode,c=null==r?void 0:r.focusOffset,h(u,o),d()),e.dom.remove(u)})),!0)})(e,t,n)?F.some(C):F.none(),fE=e=>(t,n,i={})=>{const o=t.getBody(),r={bubbles:!0,composed:!0,data:null,isComposing:!1,detail:0,view:null,target:o,currentTarget:o,eventPhase:Event.AT_TARGET,originalTarget:o,explicitOriginalTarget:o,isTrusted:!1,srcElement:o,cancelable:!1,preventDefault:C,inputType:n},s=Ds(new InputEvent(e));return t.dispatch(e,{...s,...r,...i})},mE=fE("input"),gE=fE("beforeinput"),vE=Kt(),bE=vE.os,yE=bE.isMacOS()||bE.isiOS(),xE=vE.browser.isFirefox(),wE=(e,t)=>{const n=e.dom,i=e.schema.getMoveCaretBeforeOnEnterElements();if(!t)return;if(/^(LI|DT|DD)$/.test(t.nodeName)){const e=(e=>{for(;e;){if(jo(e)||Go(e)&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}return null})(t.firstChild);e&&/^(UL|OL|DL)$/.test(e.nodeName)&&t.insertBefore(n.doc.createTextNode(at),t.firstChild)}const o=n.createRng();if(t.normalize(),t.hasChildNodes()){const e=new Po(t,t);let n,r=t;for(;n=e.current();){if(Go(n)){o.setStart(n,0),o.setEnd(n,0);break}if(i[n.nodeName.toLowerCase()]){o.setStartBefore(n),o.setEndBefore(n);break}r=n,n=e.next()}n||(o.setStart(r,0),o.setEnd(r,0))}else er(t)?t.nextSibling&&n.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),Hf(e,o)},_E=(e,t)=>{const n=e.getRoot();let i,o=t;for(;o!==n&&o&&"false"!==e.getContentEditable(o);){if("true"===e.getContentEditable(o)){i=o;break}o=o.parentNode}return o!==n?i:n},kE=e=>F.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock)),CE=e=>{e.innerHTML='<br data-mce-bogus="1">'},SE=(e,t)=>{xc(e).toLowerCase()===t.tagName.toLowerCase()&&((e,t,n)=>{const i=e.dom;F.from(n.style).map(i.parseStyle).each((e=>{const n={...Ri(hn(t)),...e};i.setStyles(t,n)}));const o=F.from(n.class).map((e=>e.split(/\s+/))),r=F.from(t.className).map((e=>G(e.split(/\s+/),(e=>""!==e))));Be(o,r,((e,n)=>{const o=G(n,(t=>!U(e,t))),r=[...e,...o];i.setAttrib(t,"class",r.join(" "))}));const s=["style","class"],a=xe(n,((e,t)=>!U(s,t)));i.setAttribs(t,a)})(e,t,wc(e))},TE=(e,t,n,i,o=!0,r,s)=>
vendor: 5,646 bytes, line 135
135{const a=e.dom,l=e.schema,c=xc(e),d=n?n.nodeName.toUpperCase():"";let h=t;const u=l.getTextInlineElements();let p;p=r||"TABLE"===d||"HR"===d?a.create(r||c,s||{}):n.cloneNode(!1);let f=p;if(o){do{if(u[h.nodeName]){if(bu(h)||Iu(h))continue;const e=h.cloneNode(!1);a.setAttrib(e,"id",""),p.hasChildNodes()?(e.appendChild(p.firstChild),p.appendChild(e)):(f=e,p.appendChild(e))}}while((h=h.parentNode)&&h!==i)}else a.setAttrib(p,"style",null),a.setAttrib(p,"class",null);return SE(e,p),CE(f),p},EE=(e,t)=>{const n=null==e?void 0:e.parentNode;return x(n)&&n.nodeName===t},AE=e=>x(e)&&/^(OL|UL|LI)$/.test(e.nodeName),OE=e=>x(e)&&/^(LI|DT|DD)$/.test(e.nodeName),DE=e=>{const t=e.parentNode;return OE(t)?t:e},IE=(e,t,n)=>{let i=e[n?"firstChild":"lastChild"];for(;i&&!jo(i);)i=i[n?"nextSibling":"previousSibling"];return i===t},PE=e=>Y(we(Ri(hn(e)),((e,t)=>`${t}: ${e};`)),((e,t)=>e+t),""),ME=(e,t)=>t&&"A"===t.nodeName&&e.isEmpty(t),RE=(e,t)=>e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t,zE=(e,t)=>x(t)&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&e.isEditable(t.parentNode)&&"false"!==e.getContentEditable(t),NE=(e,t,n)=>Go(t)?e?1===n&&t.data.charAt(n-1)===Ca?0:n:n===t.data.length-1&&t.data.charAt(n)===Ca?t.data.length:n:n,FE={insert:(e,t)=>{let n,i,o,r,s=!1;const a=e.dom,l=e.schema.getNonEmptyElements(),c=e.selection.getRng(),d=xc(e),h=hn(c.startContainer),p=Hn(h,c.startOffset),f=p.exists((e=>Cn(e)&&!ho(e))),m=c.collapsed&&f,v=(t,i)=>TE(e,n,S,C,Sc(e),t,i),b=e=>{const t=NE(e,n,i);if(Go(n)&&(e?t>0:t<n.data.length))return!1;if((n.parentNode===S||n===S)&&s&&!e)return!0;if(e&&jo(n)&&n===S.firstChild)return!0;if(RE(n,"TABLE")||RE(n,"HR"))return(e=>"BR"===e.nodeName||e.nextSibling&&"BR"===e.nextSibling.nodeName)(n)?!e:s&&!e||!s&&e;const o=new Po(n,S);let r;for(Go(n)&&(e&&0===t?o.prev():e||t!==n.data.length||o.next());r=o.current();){if(jo(r)){if(!r.getAttribute("data-mce-bogus")){const e=r.nodeName.toLowerCase();if(l[e]&&"br"!==e)return!1}}else if(Go(r)&&!Ro(r.data))return!1;e?o.prev():o.next()}return!0},w=()=>{let t;return t=/^(H[1-6]|PRE|FIGURE)$/.test(o)&&"HGROUP"!==T?v(d):v(),((e,t)=>{const n=Tc(e);return!y(t)&&(u(n)?U(sn.explode(n),t.nodeName.toLowerCase()):n)})(e,r)&&zE(a,r)&&a.isEmpty(S,void 0,{includeZwsp:!0})?t=a.split(r,S):a.insertAfter(t,S),wE(e,t),t};_f(a,c).each((e=>{c.setStart(e.startContainer,e.startOffset),c.setEnd(e.endContainer,e.endOffset)})),n=c.startContainer,i=c.startOffset;const _=!(!t||!t.shiftKey),k=!(!t||!t.ctrlKey);jo(n)&&n.hasChildNodes()&&!m&&(s=i>n.childNodes.length-1,n=n.childNodes[Math.min(i,n.childNodes.length-1)]||n,i=s&&Go(n)?n.data.length:0);const C=_E(a,n);if(!C||((e,t)=>{const n=e.dom.getParent(t,"ol,ul,dl");return null!==n&&"false"===e.dom.getContentEditableParent(n)})(e,n))return;_||(n=((e,t,n,i,o)=>{var r,s;const a=e.dom,l=null!==(r=_E(a,i))&&void 0!==r?r:a.getRoot();let c=a.getParent(i,a.isBlock);if(!c||!zE(a,c)){if(c=c||l,!c.hasChildNodes()){const i=a.create(t);return SE(e,i),c.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i}let r,d=i;for(;d&&d.parentNode!==c;)d=d.parentNode;for(;d&&!a.isBlock(d);)r=d,d=d.previousSibling;const h=null===(s=null==r?void 0:r.parentElement)||void 0===s?void 0:s.nodeName;if(r&&h&&e.schema.isValidChild(h,t.toLowerCase())){const s=r.parentNode,l=a.create(t);for(SE(e,l),s.insertBefore(l,r),d=r;d&&!a.isBlock(d);){const e=d.nextSibling;l.appendChild(d),d=e}n.setStart(i,o),n.setEnd(i,o)}}return i})(e,d,c,n,i));let S=a.getParent(n,a.isBlock)||a.getRoot();r=x(null==S?void 0:S.parentNode)?a.getParent(S.parentNode,a.isBlock):null,o=S?S.nodeName.toUpperCase():"";const T=r?r.nodeName.toUpperCase():"";if("LI"!==T||k||(S=r,r=r.parentNode,o=T),jo(r)&&((e,t,n)=>!t&&n.nodeName.toLowerCase()===xc(e)&&e.dom.isEmpty(n)&&((t,n)=>{let i=n;for(;i&&i!==t&&g(i.nextSibling);){const t=i.parentElement;if(!t||(o=t,!Ce(e.schema.getTextBlockElements(),o.nodeName.toLowerCase())))return dr(t);i=t}var o;return!1})(e.getBody(),n))(e,_,S))return((e,t,n)=>{var i,o,r;const s=t(xc(e)),a=((e,t)=>e.dom.getParent(t,dr))(e,n);a&&(e.dom.insertAfter(s,a),wE(e,s),(null!==(r=null===(o=null===(i=n.parentElement)||void 0===i?void 0:i.childNodes)||void 0===o?void 0:o.length)&&void 0!==r?r:0)>1&&e.dom.remove(n))})(e,v,S);if(/^(LI|DT|DD)$/.test(o)&&jo(r)&&a.isEmpty(S))return void((e,t,n,i,o)=>{const r=e.dom,s=e.selection.getRng(),a=n.parentNode;if(n===e.getBody()||!a)return;var l;AE(l=n)&&AE(l.parentNode)&&(o="LI");const c=OE(i)?PE(i):void 0;let d=OE(i)&&c?t(o,{style:PE(i)}):t(o);if(IE(n,i,!0)&&IE(n,i,!1))if(EE(n,"LI")){const e=DE(n);r.insertAfter(d,e),(e=>{var t;return(null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e})(n)?r.remove(e):r.remove(n)}else r.replace(d,n);else if(IE(n,i,!0))EE(n,"LI")?(r.insertAfter(d,DE(n)),d.appendChild(r.doc.createTextNode(" ")),d.appendChild(n)):a.insertBefore(d,n),r.remove(i);else if(IE(n,i,!1))r.insertAfter(d,DE(n)),r.remove(i);else{n=DE(n);const e=s.cloneRange();e.setStartAfter(i),e.setEndAfter(n);const t=e.extractContents();if("LI"===o&&(e=>e.firstChild&&"LI"===e.firstChild.nodeName)(t)){const e=G(q(d.children,hn),I(On("br")));d=t.firstChild,r.insertAfter(t,n),W(e,(e=>ri(hn(d),e))),c&&d.setAttribute("style",c)}else r.insertAfter(t,n),r.insertAfter(d,n);r.remove(i)}wE(e,d)})(e,v,r,S,d);if(!(m||S!==e.getBody()&&zE(a,S)))return;const E=S.parentNode;let A;if(m)A=v(d),p.fold((()=>{si(h,hn(A))}),(e=>{ii(e,hn(A))})),e.selection.setCursorLocation(A,0);else if(Oa(S))A=Fa(S),a.isEmpty(S)&&CE(S),SE(e,A),wE(e,A);else if(b(!1))A=w();else if(b(!0)&&E){const t=Cl.fromRangeStart(c),n=Rm(t),i=hn(S),o=Ym(i,t,e.schema)?Qm(i,t,e.schema).bind((e=>
vendor: 4,355 bytes, line 135
135F.from(e.getNode()))):F.none();A=E.insertBefore(v(),S);const r=RE(S,"HR")||n?A:o.getOr(S);wE(e,r)}else{const t=(e=>{const t=e.cloneRange();return t.setStart(e.startContainer,NE(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,NE(!1,e.endContainer,e.endOffset)),t})(c).cloneRange();t.setEndAfter(S);const n=t.extractContents();(e=>{W(fo(hn(e),Tn),(e=>{const t=e.dom;t.nodeValue=Ta(t.data)}))})(n),(e=>{let t=e;do{Go(t)&&(t.data=t.data.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)})(n),A=n.firstChild,a.insertAfter(n,S),((e,t,n)=>{var i;const o=[];if(!n)return;let r=n;for(;r=r.firstChild;){if(e.isBlock(r))return;jo(r)&&!t[r.nodeName.toLowerCase()]&&o.push(r)}let s=o.length;for(;s--;)r=o[s],(!r.hasChildNodes()||r.firstChild===r.lastChild&&""===(null===(i=r.firstChild)||void 0===i?void 0:i.nodeValue)||ME(e,r))&&e.remove(r)})(a,l,A),((e,t)=>{t.normalize();const n=t.lastChild;(!n||jo(n)&&/^(left|right)$/gi.test(e.getStyle(n,"float",!0)))&&e.add(t,"br")})(a,S),a.isEmpty(S)&&CE(S),A.normalize(),a.isEmpty(A)?(a.remove(A),w()):(SE(e,A),wE(e,A))}a.setAttrib(A,"id",""),e.dispatch("NewBlock",{newBlock:A})},fakeEventName:"insertParagraph"},LE=(e,t,n)=>{const i=e.dom.createRng();n?(i.setStartBefore(t),i.setEndBefore(t)):(i.setStartAfter(t),i.setEndAfter(t)),e.selection.setRng(i),Hf(e,i)},jE=(e,t)=>{const n=cn("br");ii(hn(t),n),e.undoManager.add()},BE=(e,t)=>{HE(e.getBody(),t)||oi(hn(t),cn("br"));const n=cn("br");oi(hn(t),n),LE(e,n.dom,!1),e.undoManager.add()},HE=(e,t)=>{return n=Cl.after(t),!!er(n.getNode())||pu(e,Cl.after(t)).map((e=>er(e.getNode()))).getOr(!1);var n},UE=e=>e&&"A"===e.nodeName&&"href"in e,$E=e=>e.fold(z,UE,UE,z),qE=(e,t)=>{t.fold(C,D(jE,e),D(BE,e),C)},WE={insert:(e,t)=>{const n=(e=>{const t=D(Cg,e),n=Cl.fromRangeStart(e.selection.getRng());return fk(t,e.getBody(),n).filter($E)})(e);n.isSome()?n.each(D(qE,e)):((e,t)=>{const n=e.selection,i=e.dom,o=n.getRng();let r,s=!1;_f(i,o).each((e=>{o.setStart(e.startContainer,e.startOffset),o.setEnd(e.endContainer,e.endOffset)}));let a=o.startOffset,l=o.startContainer;if(jo(l)&&l.hasChildNodes()){const e=a>l.childNodes.length-1;l=l.childNodes[Math.min(a,l.childNodes.length-1)]||l,a=e&&Go(l)?l.data.length:0}let c=i.getParent(l,i.isBlock);const d=c&&c.parentNode?i.getParent(c.parentNode,i.isBlock):null,h=d?d.nodeName.toUpperCase():"",u=!(!t||!t.ctrlKey);"LI"!==h||u||(c=d),Go(l)&&a>=l.data.length&&(((e,t,n)=>{const i=new Po(t,n);let o;const r=e.getNonEmptyElements();for(;o=i.next();)if(r[o.nodeName.toLowerCase()]||Go(o)&&o.length>0)return!0;return!1})(e.schema,l,c||i.getRoot())||(r=i.create("br"),o.insertNode(r),o.setStartAfter(r),o.setEndAfter(r),s=!0)),r=i.create("br"),Tl(i,o,r),LE(e,r,s),e.undoManager.add()})(e,t)},fakeEventName:"insertLineBreak"},VE=(e,t)=>kE(e).filter((e=>t.length>0&&gn(hn(e),t))).isSome(),KE=Te([{br:[]},{block:[]},{none:[]}]),GE=(e,t)=>(e=>VE(e,Cc(e)))(e),XE=e=>(t,n)=>(e=>kE(e).filter((e=>ba(hn(e)))).isSome())(t)===e,YE=(e,t)=>(n,i)=>(e=>kE(e).fold(E(""),(e=>e.nodeName.toUpperCase())))(n)===e.toUpperCase()===t,QE=e=>{const t=_E(e.dom,e.selection.getStart());return y(t)},JE=e=>YE("pre",e),ZE=e=>(t,n)=>yc(t)===e,eA=(e,t)=>(e=>VE(e,kc(e)))(e),tA=(e,t)=>t,nA=e=>{const t=xc(e),n=_E(e.dom,e.selection.getStart());return x(n)&&e.schema.isValidChild(n.nodeName,t)},iA=e=>{const t=e.selection.getRng(),n=hn(t.startContainer),i=Hn(n,t.startOffset).map((e=>Cn(e)&&!ho(e)));return t.collapsed&&i.getOr(!0)},oA=(e,t)=>(n,i)=>Y(e,((e,t)=>e&&t(n,i)),!0)?F.some(t):F.none(),rA=(e,t,n)=>{if(!t.mode.isReadOnly()){if(t.selection.isCollapsed()||(e=>{e.execCommand("delete")})(t),x(n)&&gE(t,e.fakeEventName).isDefaultPrevented())return;e.insert(t,n),x(n)&&mE(t,e.fakeEventName)}},sA=(e,t)=>{if(e.mode.isReadOnly())return;const n=()=>rA(WE,e,t),i=()=>rA(FE,e,t),o=((e,t)=>ok([oA([GE],KE.none()),oA([JE(!0),QE],KE.none()),oA([YE("summary",!0)],KE.br()),oA([JE(!0),ZE(!1),tA],KE.br()),oA([JE(!0),ZE(!1)],KE.block()),oA([JE(!0),ZE(!0),tA],KE.block()),oA([JE(!0),ZE(!0)],KE.br()),oA([XE(!0),tA],KE.br()),oA([XE(!0)],KE.block()),oA([eA],KE.br()),oA([tA],KE.br()),oA([nA],KE.block()),oA([iA],KE.block())],[e,!(!t||!t.shiftKey)]).getOr(KE.none()))(e,t);switch(_c(e)){case"linebreak":o.fold(n,n,C);break;case"block":o.fold(i,i,C);break;case"invert":o.fold(i,n,C);break;default:o.fold(n,i,C)}},aA=Kt(),lA=aA.os.isiOS()&&aA.browser.isSafari(),cA=(e,t)=>{var n;
vendor: 8,346 bytes, line 135
135t.isDefaultPrevented()||(t.preventDefault(),(n=e.undoManager).typing&&(n.typing=!1,n.add()),e.undoManager.transact((()=>{sA(e,t)})))},dA=Kt(),hA=e=>e.stopImmediatePropagation(),uA=e=>e.keyCode===lf.PAGE_UP||e.keyCode===lf.PAGE_DOWN,pA=(e,t,n)=>{n&&!e.get()?t.on("NodeChange",hA,!0):!n&&e.get()&&t.off("NodeChange",hA),e.set(n)},fA=(e,t)=>e===t||e.contains(t),mA=(e,t)=>{const n=t.container(),i=t.offset();return Go(n)?(n.insertData(i,e),F.some(Cl(n,i+e.length))):Vh(t).map((n=>{const i=dn(e);return t.isAtEnd()?oi(n,i):ii(n,i),Cl(i.dom,e.length)}))},gA=D(mA,at),vA=D(mA," "),bA=e=>t=>{e.selection.setRng(t.toRange()),e.nodeChanged()},yA=e=>{const t=Cl.fromRangeStart(e.selection.getRng()),n=hn(e.getBody());if(e.selection.isCollapsed()){const i=D(Cg,e),o=Cl.fromRangeStart(e.selection.getRng());return fk(i,e.getBody(),o).bind((e=>t=>t.fold((t=>fu(e.dom,Cl.before(t))),(e=>mu(e)),(e=>gu(e)),(t=>pu(e.dom,Cl.after(t)))))(n)).map((i=>()=>((e,t,n)=>i=>rg(e,i,n)?gA(t):vA(t))(n,t,e.schema)(i).each(bA(e))))}return F.none()},xA=e=>{return He(tn.browser.isFirefox()&&e.selection.isEditable()&&(t=e.dom,n=e.selection.getRng().startContainer,t.isEditable(t.getParent(n,"summary"))),(()=>{const t=hn(e.getBody());e.selection.isCollapsed()||e.getDoc().execCommand("Delete"),((e,t,n)=>rg(e,t,n)?gA(t):vA(t))(t,Cl.fromRangeStart(e.selection.getRng()),e.schema).each(bA(e))}));var t,n},wA=e=>Zd(e)?[{keyCode:lf.TAB,action:iS(JS,e,!0)},{keyCode:lf.TAB,shiftKey:!0,action:iS(JS,e,!1)}]:[],_A=e=>{if(e.addShortcut("Meta+P","","mcePrint"),oE(e),Jx(e))return Ee(null);{const t=cC(e);return(e=>{e.on("beforeinput",(t=>{e.selection.isEditable()&&!$(t.getTargetRanges(),(t=>!((e,t)=>!fA(e.getBody(),t.startContainer)||!fA(e.getBody(),t.endContainer)||Uf(e.dom,t))(e,t)))||t.preventDefault()}))})(e),(e=>{e.on("keyup compositionstart",D(WC,e))})(e),((e,t)=>{e.on("keydown",(n=>{n.isDefaultPrevented()||((e,t,n)=>{const i=tn.os.isMacOS()||tn.os.isiOS();oS([{keyCode:lf.RIGHT,action:iS(GC,e,!0)},{keyCode:lf.LEFT,action:iS(GC,e,!1)},{keyCode:lf.UP,action:iS(XC,e,!1)},{keyCode:lf.DOWN,action:iS(XC,e,!0)},...i?[{keyCode:lf.UP,action:iS(QC,e,!1),metaKey:!0,shiftKey:!0},{keyCode:lf.DOWN,action:iS(QC,e,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:lf.RIGHT,action:iS(qS,e,!0)},{keyCode:lf.LEFT,action:iS(qS,e,!1)},{keyCode:lf.UP,action:iS(WS,e,!1)},{keyCode:lf.DOWN,action:iS(WS,e,!0)},{keyCode:lf.UP,action:iS(WS,e,!1)},{keyCode:lf.UP,action:iS(eS,e,!1)},{keyCode:lf.DOWN,action:iS(eS,e,!0)},{keyCode:lf.RIGHT,action:iS(sS,e,!0)},{keyCode:lf.LEFT,action:iS(sS,e,!1)},{keyCode:lf.UP,action:iS(aS,e,!1)},{keyCode:lf.DOWN,action:iS(aS,e,!0)},{keyCode:lf.RIGHT,action:iS(aC,e,t,!0)},{keyCode:lf.LEFT,action:iS(aC,e,t,!1)},{keyCode:lf.RIGHT,ctrlKey:!i,altKey:i,action:iS(dC,e,t)},{keyCode:lf.LEFT,ctrlKey:!i,altKey:i,action:iS(hC,e,t)},{keyCode:lf.UP,action:iS(ZC,e,!1)},{keyCode:lf.DOWN,action:iS(ZC,e,!0)}],n).each((e=>{n.preventDefault()}))})(e,t,n)}))})(e,t),((e,t)=>{let n=!1;e.on("keydown",(i=>{n=i.keyCode===lf.BACKSPACE,i.isDefaultPrevented()||((e,t,n)=>{const i=n.keyCode===lf.BACKSPACE?"deleteContentBackward":"deleteContentForward",o=e.selection.isCollapsed(),r=o?"character":"selection",s=e=>o?e?"word":"line":"selection";rS([{keyCode:lf.BACKSPACE,action:iS(MC,e)},{keyCode:lf.BACKSPACE,action:iS(H_,e,!1)},{keyCode:lf.DELETE,action:iS(H_,e,!0)},{keyCode:lf.BACKSPACE,action:iS(R_,e,!1)},{keyCode:lf.DELETE,action:iS(R_,e,!0)},{keyCode:lf.BACKSPACE,action:iS(mC,e,t,!1)},{keyCode:lf.DELETE,action:iS(mC,e,t,!0)},{keyCode:lf.BACKSPACE,action:iS(lv,e,!1)},{keyCode:lf.DELETE,action:iS(lv,e,!0)},{keyCode:lf.BACKSPACE,action:iS(pE,e,!1,r)},{keyCode:lf.DELETE,action:iS(pE,e,!0,r)},...yE?[{keyCode:lf.BACKSPACE,altKey:!0,action:iS(pE,e,!1,s(!0))},{keyCode:lf.DELETE,altKey:!0,action:iS(pE,e,!0,s(!0))},{keyCode:lf.BACKSPACE,metaKey:!0,action:iS(pE,e,!1,s(!1))}]:[{keyCode:lf.BACKSPACE,ctrlKey:!0,action:iS(pE,e,!1,s(!0))},{keyCode:lf.DELETE,ctrlKey:!0,action:iS(pE,e,!0,s(!0))}],{keyCode:lf.BACKSPACE,action:iS(K_,e,!1)},{keyCode:lf.DELETE,action:iS(K_,e,!0)},{keyCode:lf.BACKSPACE,action:iS(SC,e,!1)},{keyCode:lf.DELETE,action:iS(SC,e,!0)},{keyCode:lf.BACKSPACE,action:iS(E_,e,!1)},{keyCode:lf.DELETE,action:iS(E_,e,!0)},{keyCode:lf.BACKSPACE,action:iS(S_,e,!1)},{keyCode:lf.DELETE,action:iS(S_,e,!0)},{keyCode:lf.BACKSPACE,action:iS(_C,e,!1)},{keyCode:lf.DELETE,action:iS(_C,e,!0)},{keyCode:lf.BACKSPACE,action:iS(V_,e,!1)},{keyCode:lf.DELETE,action:iS(V_,e,!0)}],n).filter((t=>e.selection.isEditable())).each((t=>{n.preventDefault(),gE(e,i).isDefaultPrevented()||(t(),mE(e,i))}))})(e,t,i)})),e.on("keyup",(t=>{t.isDefaultPrevented()||((e,t,n)=>{oS([{keyCode:lf.BACKSPACE,action:iS(B_,e)},{keyCode:lf.DELETE,action:iS(B_,e)},...yE?[{keyCode:lf.BACKSPACE,altKey:!0,action:iS(kC,e)},{keyCode:lf.DELETE,altKey:!0,action:iS(kC,e)},...n?[{keyCode:xE?224:91,action:iS(kC,e)}]:[]]:[{keyCode:lf.BACKSPACE,ctrlKey:!0,action:iS(kC,e)},{keyCode:lf.DELETE,ctrlKey:!0,action:iS(kC,e)}]],t)})(e,t,n),n=!1}))})(e,t),(e=>{let t=F.none();e.on("keydown",(n=>{n.keyCode===lf.ENTER&&(lA&&(e=>{if(!e.collapsed)return!1;const t=e.startContainer;if(Go(t)){const n=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/,i=t.data.charAt(e.startOffset-1);return n.test(i)}return!1})(e.selection.getRng())?(e=>{t=F.some(e.selection.getBookmark()),e.undoManager.add()})(e):cA(e,n))})),e.on("keyup",(n=>{n.keyCode===lf.ENTER&&t.each((()=>((e,n)=>{e.undoManager.undo(),t.fold(C,(t=>e.selection.moveToBookmark(t))),cA(e,n),t=F.none()})(e,n)))}))})(e),(e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||((e,t)=>{rS([{keyCode:lf.SPACEBAR,action:iS(yA,e)},{keyCode:lf.SPACEBAR,action:iS(xA,e)}],t).each((n=>{t.preventDefault(),gE(e,"insertText",{data:" "}).isDefaultPrevented()||(n(),mE(e,"insertText",{data:" "}))}))})(e,t)}))})(e),(e=>{e.on("input",(t=>{t.isComposing||(e=>{const t=hn(e.getBody());e.selection.isCollapsed()&&((e,t,n)=>{const i=t.container();if(!Go(i))return F.none();if((e=>{const t=e.container();return Go(t)&&Ke(t.data,at)})(t)){const o=hg(e,i,!1,n)||(e=>{const t=e.data,n=(e=>{const t=e.split("");return q(t,((e,n)=>Pu(e)&&n>0&&n<t.length-1&&Ru(t[n-1])&&Ru(t[n+1])?" ":e)).join("")})(t);return n!==t&&(e.data=n,!0)})(i)||ug(e,i,!1,n);return He(o,t)}if(lg(e,t,n)){const o=hg(e,i,!0,n)||ug(e,i,!0,n);return He(o,t)}return F.none()})(t,Cl.fromRangeStart(e.selection.getRng()),e.schema).each((t=>{e.selection.setRng(t.toRange())}))})(e)}))})(e),(e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||((e,t)=>{oS([...wA(e)],t).each((e=>{t.preventDefault()}))})(e,t)}))})(e),((e,t)=>{e.on("keydown",(n=>{n.isDefaultPrevented()||((e,t,n)=>{const i=tn.os.isMacOS()||tn.os.isiOS();oS([{keyCode:lf.END,action:iS(YC,e,!0)},{keyCode:lf.HOME,action:iS(YC,e,!1)},...i?[]:[{keyCode:lf.HOME,action:iS(QC,e,!1),ctrlKey:!0,shiftKey:!0},{keyCode:lf.END,action:iS(QC,e,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:lf.END,action:iS(lS,e,!0)},{keyCode:lf.HOME,action:iS(lS,e,!1)},{keyCode:lf.END,action:iS(uC,e,!0,t)},{keyCode:lf.HOME,action:iS(uC,e,!1,t)}],n).each((e=>{n.preventDefault()}))})(e,t,n)}))})(e,t),((e,t)=>{if(dA.os.isMacOS())return;const n=Ee(!1);e.on("keydown",(t=>{uA(t)&&pA(n,e,!0)})),e.on("keyup",(i=>{i.isDefaultPrevented()||((e,t,n)=>{oS([{keyCode:lf.PAGE_UP,action:iS(uC,e,!1,t)},{keyCode:lf.PAGE_DOWN,action:iS(uC,e,!0,t)}],n)})(e,t,i),uA(i)&&n.get()&&(pA(n,e,!1),e.nodeChanged())}))})(e,t),t}};class kA{constructor(e){let t;this.lastPath=[],this.editor=e;const n=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",(n=>{const i=e.selection.getRng(),o={startContainer:i.startContainer,startOffset:i.startOffset,endContainer:i.endContainer,endOffset:i.endOffset};"nodechange"!==n.type&&mf(o,t)||e.dispatch("SelectionChange"),t=o})),e.on("contextmenu",(()=>{Up(e),e.dispatch("SelectionChange")})),e.on("SelectionChange",(()=>{const t=e.selection.getStart(!0);t&&$u(e)&&!n.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})})),e.on("mouseup",(t=>{!t.isDefaultPrevented()&&$u(e)&&("IMG"===e.selection.getNode().nodeName?Wp.setEditorTimeout(e,(()=>{e.nodeChanged()})):e.nodeChanged())}))}nodeChanged(e={}){const t=this.editor,n=t.selection;let i;if(t.initialized&&n&&!fd(t)&&!ah(t)){const o=t.getBody();i=n.getStart(!0)||o,i.ownerDocument===t.getDoc()&&t.dom.isChildOf(i,o)||(i=o);const r=[];t.dom.getParent(i,(e=>
vendor: 7,991 bytes, line 135
135e===o||(r.push(e),!1))),t.dispatch("NodeChange",{...e,element:i,parents:r})}}isSameElementPath(e){let t;const n=this.editor,i=ie(n.dom.getParents(e,N,n.getBody()));if(i.length===this.lastPath.length){for(t=i.length;t>=0&&i[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=i,!0}return this.lastPath=i,!1}}const CA="x-tinymce/html",SA=E(CA),TA="\x3c!-- "+CA+" --\x3e",EA=e=>TA+e,AA=e=>-1!==e.indexOf(TA),OA="%MCEPASTEBIN%",DA=e=>e.dom.get("mcepastebin"),IA=e=>x(e)&&"mcepastebin"===e.id,PA=e=>e===OA,MA=(e,t)=>(sn.each(t,(t=>{e=h(t,RegExp)?e.replace(t,""):e.replace(t[0],t[1])})),e),RA=e=>MA(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(e,t,n)=>t||n?at:" "],/<br class="Apple-interchange-newline">/g,/<br>$/i]),zA=(e,t)=>({content:e,cancelled:t}),NA=(e,t)=>(e.insertContent(t,{merge:Ld(e),paste:!0}),!0),FA=e=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(e),LA=(e,t,n)=>!(e.selection.isCollapsed()||!FA(t))&&((e,t,n)=>(e.undoManager.extra((()=>{n(e,t)}),(()=>{e.execCommand("mceInsertLink",!1,t)})),!0))(e,t,n),jA=(e,t,n)=>!!((e,t)=>FA(t)&&$(Jd(e),(e=>Xe(t.toLowerCase(),`.${e.toLowerCase()}`))))(e,t)&&((e,t,n)=>(e.undoManager.extra((()=>{n(e,t)}),(()=>{e.insertContent('<img src="'+t+'">')})),!0))(e,t,n),BA=(()=>{let e=0;return()=>"mceclip"+e++})(),HA=e=>{const t=PS();return MS(t,e),SS(t),t},UA=(e,t,n,i,o)=>{const r=((e,t,n)=>((e,t,n)=>{const i=((e,t,n)=>e.dispatch("PastePreProcess",{content:t,internal:n}))(e,t,n),o=((e,t)=>{const n=wx({sanitize:Yd(e),sandbox_iframes:nh(e),sandbox_iframes_exclusions:ih(e),convert_unsafe_embeds:oh(e)},e.schema);n.addNodeFilter("meta",(e=>{sn.each(e,(e=>{e.remove()}))}));const i=n.parse(t,{forced_root_block:!1,isRootContent:!0});return gm({validate:!0},e.schema).serialize(i)})(e,i.content);return e.hasEventListeners("PastePostProcess")&&!i.isDefaultPrevented()?((e,t,n)=>{const i=e.dom.create("div",{style:"display:none"},t),o=((e,t,n)=>e.dispatch("PastePostProcess",{node:t,internal:n}))(e,i,n);return zA(o.node.innerHTML,o.isDefaultPrevented())})(e,o,n):zA(o,i.isDefaultPrevented())})(e,t,n))(e,t,n);if(!r.cancelled){const t=r.content,n=()=>((e,t,n)=>{n||!jd(e)?NA(e,t):((e,t)=>{sn.each([LA,jA,NA],(n=>!n(e,t,NA)))})(e,t)})(e,t,i);o?gE(e,"insertFromPaste",{dataTransfer:HA(t)}).isDefaultPrevented()||(n(),mE(e,"insertFromPaste")):n()}},$A=(e,t,n,i)=>{const o=n||AA(t);UA(e,(e=>e.replace(TA,""))(t),o,!1,i)},qA=(e,t,n)=>{const i=e.dom.encode(t).replace(/\r\n/g,"\n"),o=((e,t,n)=>{const i=e.split(/\n\n/),o=((e,t)=>{let n="<"+e;const i=we(t,((e,t)=>t+'="'+ns.encodeAllRaw(e)+'"'));return i.length&&(n+=" "+i.join(" ")),n+">"})(t,n),r="</"+t+">",s=q(i,(e=>e.split(/\n/).join("<br />")));return 1===s.length?s[0]:q(s,(e=>o+e+r)).join("")})(No(i,Hd(e)),xc(e),wc(e));UA(e,o,!1,!0,n)},WA=e=>{const t={};if(e&&e.types)for(let n=0;n<e.types.length;n++){const i=e.types[n];try{t[i]=e.getData(i)}catch(e){t[i]=""}}return t},VA=(e,t)=>t in e&&e[t].length>0,KA=e=>VA(e,"text/html")||VA(e,"text/plain"),GA=(e,t,n)=>{const i="paste"===t.type?t.clipboardData:t.dataTransfer;var o;if(Pd(e)&&i){const r=((e,t)=>{const n=t.items?te(de(t.items),(e=>"file"===e.kind?[e.getAsFile()]:[])):[],i=t.files?de(t.files):[];return G(n.length>0?n:i,(e=>{const t=Jd(e);return e=>Ge(e.type,"image/")&&$(t,(t=>(e=>{const t=e.toLowerCase(),n={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return sn.hasOwn(n,t)?"image/"+n[t]:"image/"+t})(t)===e.type))})(e))})(e,i);if(r.length>0)return t.preventDefault(),(o=r,Promise.all(q(o,(e=>Kb(e).then((t=>({file:e,uri:t}))))))).then((t=>{n&&e.selection.setRng(n),W(t,(t=>{((e,t)=>{Wb(t.uri).each((({data:n,type:i,base64Encoded:o})=>{const r=o?n:btoa(n),s=t.file,a=e.editorUpload.blobCache,l=a.getByData(r,i),c=null!=l?l:((e,t,n,i)=>{const o=BA(),r=Ac(e)&&x(n.name),s=r?((e,t)=>{const n=t.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return x(n)?e.dom.encode(n[1]):void 0})(e,n.name):o,a=r?n.name:void 0,l=t.create(o,n,i,s,a);return t.add(l),l})(e,a,s,r);$A(e,`<img src="${c.blobUri()}">`,!1,!0)}))})(e,t)}))})),!0}return!1},XA=(e,t,n,i,o)=>{let r=RA(n);const s=VA(t,SA())||AA(n),a=!s&&(e=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e))(r),l=FA(r);(PA(r)||!r.length||a&&!l)&&(i=!0),(i||l)&&(r=VA(t,"text/plain")&&a?t["text/plain"]:(e=>{const t=ys(),n=wx({},t);let i="";const o=t.getVoidElements(),r=sn.makeMap("script noscript style textarea video audio iframe object"," "),s=t.getBlockElements(),a=e=>{const n=e.name,l=e;if("br"!==n){if("wbr"!==n)if(o[n]&&(i+=" "),r[n])i+=" ";else{if(3===e.type&&(i+=e.value),!(e.name in t.getVoidElements())){let t=e.firstChild;if(t)do{a(t)}while(t=t.next)}s[n]&&l.next&&(i+="\n","p"===n&&(i+="\n"))}}else i+="\n"};return e=MA(e,[/<!\[[^\]]+\]>/g]),a(n.parse(e)),i})(r)),PA(r)||(i?qA(e,r,o):$A(e,r,s,o))},YA=(e,t,n,i)=>{((e,t,n)=>{if(!e)return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(SA(),t),!0}catch(e){return!1}})(e.clipboardData,t.html,t.text)?(e.preventDefault(),i()):n(t.html,i)},QA=e=>(t,n)=>{const{dom:i,selection:o}=e,r=i.create("div",{contenteditable:"false","data-mce-bogus":"all"}),s=i.create("div",{contenteditable:"true"},t);i.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(s),i.add(e.getBody(),r);const a=o.getRng();s.focus();const l=i.createRng();l.selectNodeContents(s),o.setRng(l),Wp.setEditorTimeout(e,(()=>{o.setRng(a),i.remove(r),n()}),0)},JA=e=>({html:EA(e.selection.getContent({contextual:!0})),text:e.selection.getContent({format:"text"})}),ZA=e=>!e.selection.isCollapsed()||(e=>!!e.dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody()))(e),eO=(e,t)=>{var n,i;return Sf.getCaretRangeFromPoint(null!==(n=t.clientX)&&void 0!==n?n:0,null!==(i=t.clientY)&&void 0!==i?i:0,e.getDoc())},tO=(e,t)=>{e.focus(),t&&e.selection.setRng(t)},nO=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,iO=e=>sn.trim(e).replace(nO,Es).toLowerCase(),oO=(e,t,n)=>{const i=Nd(e);if(n||"all"===i||!Fd(e))return t;const o=i?i.split(/[, ]/):[];if(o&&"none"!==i){const n=e.dom,i=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,((e,t,r,s)=>{const a=n.parseStyle(n.decode(r)),l={};for(let e=0;e<o.length;e++){const t=a[o[e]];let r=t,s=n.getStyle(i,o[e],!0);/color/.test(o[e])&&(r=iO(r),s=iO(s)),s!==r&&(l[o[e]]=t)}const c=n.serializeStyle(l,"span");return c?t+' style="'+c+'"'+s:t+s}))}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,((e,t,n,i)=>t+' style="'+n+'"'+i))},rO=e=>{const t=Ee(!1),n=Ee(Bd(e)?"text":"html"),i=(e=>{const t=Ee(null);return{create:()=>((e,t)=>{const{dom:n,selection:i}=e,o=e.getBody();t.set(i.getRng());const r=n.add(e.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},OA);tn.browser.isFirefox()&&n.setStyle(r,"left","rtl"===n.getStyle(o,"direction",!0)?65535:-65535),n.bind(r,"beforedeactivate focusin focusout",(e=>{e.stopPropagation()})),r.focus(),i.select(r,!0)})(e,t),remove:()=>((e,t)=>{const n=e.dom;if(DA(e)){let i;const o=t.get();for(;i=DA(e);)n.remove(i),n.unbind(i);o&&e.selection.setRng(o)}t.set(null)})(e,t),getEl:()=>DA(e),getHtml:()=>(e=>{const t=e.dom,n=(e,n)=>{e.appendChild(n),t.remove(n,!0)},[i,...o]=G(e.getBody().childNodes,IA);W(o,(e=>{n(i,e)}));const r=t.select("div[id=mcepastebin]",i);for(let e=r.length-1;e>=0;e--){const o=t.create("div");i.insertBefore(o,r[e]),n(o,r[e])}return i?i.innerHTML:""})(e),getLastRng:t.get}})(e);(e=>{(tn.browser.isChromium()||tn.browser.isSafari())&&((e,t)=>{e.on("PastePreProcess",(n=>{n.content=t(e,n.content,n.internal)}))})(e,oO)})(e),((e,t)=>{e.addCommand("mceTogglePlainTextPaste",(()=>{((e,t)=>
vendor: 8,106 bytes, line 135
135{"text"===t.get()?(t.set("html"),rc(e,!1)):(t.set("text"),rc(e,!0)),e.focus()})(e,t)})),e.addCommand("mceInsertClipboardContent",((t,n)=>{n.html&&$A(e,n.html,n.internal,!1),n.text&&qA(e,n.text,!1)}))})(e,n),(e=>{const t=t=>n=>{t(e,n)},n=Md(e);w(n)&&e.on("PastePreProcess",t(n));const i=Rd(e);w(i)&&e.on("PastePostProcess",t(i))})(e),e.addQueryStateHandler("mceTogglePlainTextPaste",(()=>"text"===n.get())),e.on("PreInit",(()=>{(e=>{e.on("cut",(e=>t=>{!t.isDefaultPrevented()&&ZA(e)&&e.selection.isEditable()&&YA(t,JA(e),QA(e),(()=>{if(tn.browser.isChromium()||tn.browser.isFirefox()){const t=e.selection.getRng();Wp.setEditorTimeout(e,(()=>{e.selection.setRng(t),e.execCommand("Delete")}),0)}else e.execCommand("Delete")}))})(e)),e.on("copy",(e=>t=>{!t.isDefaultPrevented()&&ZA(e)&&YA(t,JA(e),QA(e),C)})(e))})(e),((e,t)=>{Id(e)&&e.on("dragend dragover draggesture dragdrop drop drag",(e=>{e.preventDefault(),e.stopPropagation()})),Pd(e)||e.on("drop",(e=>{const t=e.dataTransfer;t&&(e=>$(e.files,(e=>/^image\//.test(e.type))))(t)&&e.preventDefault()})),e.on("drop",(n=>{if(n.isDefaultPrevented())return;const i=eO(e,n);if(y(i))return;const o=WA(n.dataTransfer),r=VA(o,SA());if((!KA(o)||(e=>{const t=e["text/plain"];return!!t&&0===t.indexOf("file://")})(o))&&GA(e,n,i))return;const s=o[SA()],a=s||o["text/html"]||o["text/plain"],l=((e,t,n,i)=>{const o=e.getParent(n,(e=>Pr(t,e)));if(!g(e.getParent(n,"summary")))return!0;if(o&&Ce(i,"text/html")){const e=(new DOMParser).parseFromString(i["text/html"],"text/html").body;return!g(e.querySelector(o.nodeName.toLowerCase()))}return!1})(e.dom,e.schema,i.startContainer,o),c=t.get();c&&!l||a&&(n.preventDefault(),Wp.setEditorTimeout(e,(()=>{e.undoManager.transact((()=>{(s||c&&l)&&e.execCommand("Delete"),tO(e,i);const t=RA(a);o["text/html"]?$A(e,t,r,!0):qA(e,t,!0)}))})))})),e.on("dragstart",(e=>{t.set(!0)})),e.on("dragover dragend",(n=>{Pd(e)&&!t.get()&&(n.preventDefault(),tO(e,eO(e,n))),"dragend"===n.type&&t.set(!1)})),(e=>{e.on("input",(t=>{const n=e=>g(e.querySelector("summary"));if("deleteByDrag"===t.inputType){const t=G(e.dom.select("details"),n);W(t,(t=>{er(t.firstChild)&&t.firstChild.remove();const n=e.dom.create("summary");n.appendChild(_a().dom),t.prepend(n)}))}}))})(e)})(e,t),((e,t,n)=>{((e,t,n)=>{let i;e.on("keydown",(e=>{(e=>lf.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode)(e)&&!e.isDefaultPrevented()&&(i=e.shiftKey&&86===e.keyCode)})),e.on("paste",(o=>{if(o.isDefaultPrevented()||(e=>{var t,n;return tn.os.isAndroid()&&0===(null===(n=null===(t=e.clipboardData)||void 0===t?void 0:t.items)||void 0===n?void 0:n.length)})(o))return;const r="text"===n.get()||i;i=!1;const s=WA(o.clipboardData);!KA(s)&&GA(e,o,t.getLastRng()||e.selection.getRng())||(VA(s,"text/html")?(o.preventDefault(),XA(e,s,s["text/html"],r,!0)):VA(s,"text/plain")&&VA(s,"text/uri-list")?(o.preventDefault(),XA(e,s,s["text/plain"],r,!0)):(t.create(),Wp.setEditorTimeout(e,(()=>{const n=t.getHtml();t.remove(),XA(e,s,n,r,!1)}),0)))}))})(e,t,n),(e=>{const t=e=>Ge(e,"webkit-fake-url"),n=e=>Ge(e,"data:");e.parser.addNodeFilter("img",((i,o,r)=>{if(!Pd(e)&&(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.paste)})(r))for(const o of i){const i=o.attr("src");u(i)&&!o.attr("data-mce-object")&&i!==tn.transparentSrc&&(t(i)||!Ud(e)&&n(i))&&o.remove()}}))})(e)})(e,i,n)}))},sO=er,aO=Go,lO=e=>or(e.dom),cO=e=>t=>bn(hn(e),t),dO=(e,t)=>Qi(hn(e),lO,cO(t)),hO=(e,t,n)=>{const i=new Po(e,t),o=n?i.next.bind(i):i.prev.bind(i);let r=e;for(let t=n?e:o();t&&!sO(t);t=o())ol(t)&&(r=t);return r};var uO;!function(e){e.Before="before",e.After="after"}(uO||(uO={}));const pO=(e,t)=>Math.abs(e.left-t),fO=(e,t)=>Math.abs(e.right-t),mO=(e,t,n)=>t>e.left&&t<e.right?0:Math.min(Math.abs(e.left-t),Math.abs(e.right-t)),gO=(e,t,n,i)=>{const o=e=>ol(e.node)?F.some(e):jo(e.node)?gO(de(e.node.childNodes),t,n,!1):F.none(),r=(e,r)=>{const s=se(e,((e,i)=>r(e,t,n)-r(i,t,n)));return he(s,o).map((e=>i&&!Go(e.node)&&s.length>1?((e,i,r)=>o(i).filter((i=>Math.abs(r(e,t,n)-r(i,t,n))<2&&Go(i.node))))(e,s[1],r).getOr(e):e))},[s,a]=((e,t)=>(e=>Y(e,((e,t)=>e.fold((()=>F.some(t)),(e=>{const n=Math.min(t.left,e.left),i=Math.min(t.top,e.top),o=Math.max(t.right,e.right),r=Math.max(t.bottom,e.bottom);return F.some({top:i,right:o,bottom:r,left:n,width:o-n,height:r-i})}))),F.none()))(G(e,(e=>{return(n=t)>=(i=e).top&&n<=i.bottom;var n,i}))).fold((()=>[[],e]),(t=>{const{pass:n,fail:i}=K(e,(e=>((e,t)=>{const n=((e,t)=>Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top)))(e,t)/Math.min(e.height,t.height);return((e,t)=>e.top<t.bottom&&e.bottom>t.top)(e,t)&&n>.5})(e,t)));return[n,i]})))(qk(e),n),{pass:l,fail:c}=K(a,(e=>e.top<n));return r(s,mO).orThunk((()=>r(c,Wa))).orThunk((()=>r(l,Wa)))},vO=(e,t,n)=>((e,t,n)=>{const i=hn(e),o=((e,t,n)=>F.from(e.dom.elementFromPoint(t,n)).map(an))(In(i),t,n).filter((e=>yn(i,e))).getOr(i);return((e,t,n,i)=>{const o=(t,r)=>{const s=G(t.dom.childNodes,I((e=>jo(e)&&e.classList.contains("mce-drag-container"))));return r.fold((()=>gO(s,n,i,!0)),(e=>{const t=G(s,(t=>t!==e.dom));return gO(t,n,i,!0)})).orThunk((()=>(bn(t,e)?F.none():Rn(t)).bind((e=>o(e,F.some(t))))))};return o(t,F.none())})(i,o,t,n)})(e,t,n).filter((e=>wh(e.node))).map((e=>((e,t)=>({node:e.node,position:pO(e,t)<fO(e,t)?uO.Before:uO.After}))(e,t))),bO=e=>{var t,n;const i=e.getBoundingClientRect(),o=e.ownerDocument,r=o.documentElement,s=o.defaultView;return{top:i.top+(null!==(t=null==s?void 0:s.scrollY)&&void 0!==t?t:0)-r.clientTop,left:i.left+(null!==(n=null==s?void 0:s.scrollX)&&void 0!==n?n:0)-r.clientLeft}},yO=e=>({target:e,srcElement:e}),xO=or,wO=((...e)=>t=>{for(let n=0;n<e.length;n++)if(e[n](t))return!0;return!1})(xO,ir),_O=(e,t,n,i)=>{const o=e.dom,r=t.cloneNode(!0);o.setStyles(r,{width:n,height:i}),o.setAttrib(r,"data-mce-selected",null);const s=o.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return o.setStyles(s,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:i}),o.setStyles(r,{margin:0,boxSizing:"border-box"}),s.appendChild(r),s},kO=(e,t)=>n=>()=>{const i="left"===e?n.scrollX:n.scrollY;n.scroll({[e]:i+t,behavior:"smooth"})},CO=kO("left",-32),SO=kO("left",32),TO=kO("top",-32),EO=kO("top",32),AO=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)},OO=(e,t,n,i,o)=>{"dragstart"===t&&MS(i,e.dom.getOuterHTML(n));const r=((e,t,n,i)=>{const o=((e,t)=>{const n=(e=>{const t=PS(),n=(e=>{const t=e;return F.from(t[wS])})(e);return SS(e),bS(t),t.dropEffect=e.dropEffect,t.effectAllowed=e.effectAllowed,(e=>{const t=e;return F.from(t[mS])})(e).each((e=>t.setDragImage(e.image,e.x,e.y))),W(e.types,(n=>{"Files"!==n&&t.setData(n,e.getData(n))})),W(e.files,(e=>t.items.add(e))),(e=>{const t=e;return F.from(t[gS])})(e).each((e=>{((e,t)=>{vS(t)(e)})(t,e)})),n.each((n=>{kS(e,n),kS(t,n)})),t})(e);return"dragstart"===t?(bS(n),CS(n)):"drop"===t?(yS(n),SS(n)):(xS(n),TS(n)),n})(n,e);return b(i)?((e,t,n)=>{const i=P("Function not supported on simulated event.");return{bubbles:!0,cancelBubble:!1,cancelable:!0,composed:!1,currentTarget:null,defaultPrevented:!1,eventPhase:0,isTrusted:!0,returnValue:!1,timeStamp:0,type:e,composedPath:i,initEvent:i,preventDefault:C,stopImmediatePropagation:C,stopPropagation:C,AT_TARGET:window.Event.AT_TARGET,BUBBLING_PHASE:window.Event.BUBBLING_PHASE,CAPTURING_PHASE:window.Event.CAPTURING_PHASE,NONE:window.Event.NONE,altKey:!1,button:0,buttons:0,clientX:0,clientY:0,ctrlKey:!1,layerX:0,layerY:0,metaKey:!1,movementX:0,movementY:0,offsetX:0,offsetY:0,pageX:0,pageY:0,relatedTarget:null,screenX:0,screenY:0,shiftKey:!1,x:0,y:0,detail:0,view:null,which:0,initUIEvent:i,initMouseEvent:i,getModifierState:i,dataTransfer:n,...yO(t)}})(e,t,o):((e,t,n,i)=>({...t,dataTransfer:i,type:e,...yO(n)}))(e,i,t,o)})(t,n,i,o);return e.dispatch(t,r)},DO=(e,t,n)=>{e.on((e=>{e.intervalId.clear(),e.dragging&&n.fold((()=>OO(t,"dragend",e.element,e.dataTransfer)),(n=>OO(t,"dragend",e.element,e.dataTransfer,n)))})),IO(e)},IO=e=>{e.on((e=>{e.intervalId.clear(),AO(e.ghost)})),e.clear()},PO=e=>{const t=qe(),n=Ks.DOM,i=document,o=((e,t)=>n=>
vendor: 14,523 bytes, line 135
135{if((e=>0===e.button)(n)){const i=J(t.dom.getParents(n.target),wO).getOr(null);if(x(i)&&((e,t,n)=>xO(n)&&n!==t&&e.isEditable(n.parentElement))(t.dom,t.getBody(),i)){const o=t.dom.getPos(i),r=t.getBody(),s=t.getDoc().documentElement;e.set({element:i,dataTransfer:PS(),dragging:!1,screenX:n.screenX,screenY:n.screenY,maxX:(t.inline?r.scrollWidth:s.offsetWidth)-2,maxY:(t.inline?r.scrollHeight:s.offsetHeight)-2,relX:n.pageX-o.x,relY:n.pageY-o.y,width:i.offsetWidth,height:i.offsetHeight,ghost:_O(t,i,i.offsetWidth,i.offsetHeight),intervalId:$e(100)})}}})(t,e),r=((e,t)=>{const n=it(((e,n)=>((e,t,n)=>{e._selectionOverrides.hideFakeCaret(),vO(e.getBody(),t,n).fold((()=>e.selection.placeCaretAt(t,n)),(i=>{const o=e._selectionOverrides.showCaret(1,i.node,i.position===uO.Before,!1);o?e.selection.setRng(o):e.selection.placeCaretAt(t,n)}))})(t,e,n)),0);t.on("remove",n.cancel);const i=e;return o=>e.on((e=>{const r=Math.max(Math.abs(o.screenX-e.screenX),Math.abs(o.screenY-e.screenY));if(!e.dragging&&r>10){const n=OO(t,"dragstart",e.element,e.dataTransfer,o);if(x(n.dataTransfer)&&(e.dataTransfer=n.dataTransfer),n.isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){const r=o.currentTarget===t.getDoc().documentElement,l=((e,t)=>({pageX:t.pageX-e.relX,pageY:t.pageY+5}))(e,((e,t)=>{return n=(e=>e.inline?bO(e.getBody()):{left:0,top:0})(e),i=(e=>{const t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}})(e),{pageX:(o=((e,t)=>{if(t.target.ownerDocument!==e.getDoc()){const n=bO(e.getContentAreaContainer()),i=(e=>{const t=e.getBody(),n=e.getDoc().documentElement,i={left:t.scrollLeft,top:t.scrollTop},o={left:t.scrollLeft||n.scrollLeft,top:t.scrollTop||n.scrollTop};return e.inline?i:o})(e);return{left:t.pageX-n.left+i.left,top:t.pageY-n.top+i.top}}return{left:t.pageX,top:t.pageY}})(e,t)).left-n.left+i.left,pageY:o.top-n.top+i.top};var n,i,o})(t,o));s=e.ghost,a=t.getBody(),s.parentNode!==a&&a.appendChild(s),((e,t,n,i,o,r,s,a,l,c,d,h)=>{let u=0,p=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+n>o&&(u=t.pageX+n-o),t.pageY+i>r&&(p=t.pageY+i-r),e.style.width=n-u+"px",e.style.height=i-p+"px";const f=l.clientHeight,m=l.clientWidth,g=s+l.getBoundingClientRect().top,v=a+l.getBoundingClientRect().left;d.on((e=>{e.intervalId.clear(),e.dragging&&h&&(s+8>=f?e.intervalId.set(EO(c)):s-8<=0?e.intervalId.set(TO(c)):a+8>=m?e.intervalId.set(SO(c)):a-8<=0?e.intervalId.set(CO(c)):g+16>=window.innerHeight?e.intervalId.set(EO(window)):g-16<=0?e.intervalId.set(TO(window)):v+16>=window.innerWidth?e.intervalId.set(SO(window)):v-16<=0&&e.intervalId.set(CO(window)))}))})(e.ghost,l,e.width,e.height,e.maxX,e.maxY,o.clientY,o.clientX,t.getContentAreaContainer(),t.getWin(),i,r),n.throttle(o.clientX,o.clientY)}var s,a}))})(t,e),s=((e,t)=>n=>{e.on((e=>{var i;if(e.intervalId.clear(),e.dragging){if(((e,t,n)=>!y(t)&&t!==n&&!e.dom.isChildOf(t,n)&&e.dom.isEditable(t))(t,(e=>{const t=e.getSel();if(x(t)){const e=t.getRangeAt(0).startContainer;return Go(e)?e.parentNode:e}return null})(t.selection),e.element)){const o=null!==(i=t.getDoc().elementFromPoint(n.clientX,n.clientY))&&void 0!==i?i:t.getBody();OO(t,"drop",o,e.dataTransfer,n).isDefaultPrevented()||t.undoManager.transact((()=>{((e,t)=>{const n=e.getParent(t.parentNode,e.isBlock);AO(t),n&&n!==e.getRoot()&&e.isEmpty(n)&&ka(hn(n))})(t.dom,e.element),(e=>{const t=e.getData("text/html");return""===t?F.none():F.some(t)})(e.dataTransfer).each((e=>t.insertContent(e))),t._selectionOverrides.hideFakeCaret()}))}OO(t,"dragend",t.getBody(),e.dataTransfer,n)}})),IO(e)})(t,e),a=((e,t)=>n=>DO(e,t,F.some(n)))(t,e);e.on("mousedown",o),e.on("mousemove",r),e.on("mouseup",s),n.bind(i,"mousemove",r),n.bind(i,"mouseup",a),e.on("remove",(()=>{n.unbind(i,"mousemove",r),n.unbind(i,"mouseup",a)})),e.on("keydown",(n=>{n.keyCode===lf.ESC&&DO(t,e,F.none())}))},MO=or,RO=(e,t)=>cv(e.getBody(),t),zO=e=>{const t=e.selection,n=e.dom,i=e.getBody(),o=((e,t,n,i)=>{const o=qe();let r,s;const a=xc(e),l=e.dom,c=()=>{(e=>{var t,n;const i=mo(hn(e),"*[contentEditable=false],video,audio,embed,object");for(let e=0;e<i.length;e++){const o=i[e].dom;let r=o.previousSibling;if(Na(r)){const e=r.data;1===e.length?null===(t=r.parentNode)||void 0===t||t.removeChild(r):r.deleteData(e.length-1,1)}r=o.nextSibling,za(r)&&(1===r.data.length?null===(n=r.parentNode)||void 0===n||n.removeChild(r):r.deleteData(0,1))}})(t),s&&(fh(s),s=null),o.on((e=>{l.remove(e.caret),o.clear()})),r&&(clearInterval(r),r=void 0)};return{isShowing:o.isSet,show:(e,d)=>{let h;if(c(),vh(d))return null;if(!n(d))return s=((e,t)=>{var n;const i=(null!==(n=e.ownerDocument)&&void 0!==n?n:document).createTextNode(Ca),o=e.parentNode;if(t){const t=e.previousSibling;if(Aa(t)){if(Ia(t))return t;if(Na(t))return t.splitText(t.data.length-1)}null==o||o.insertBefore(i,e)}else{const t=e.nextSibling;if(Aa(t)){if(Ia(t))return t;if(za(t))return t.splitText(1),t}e.nextSibling?null==o||o.insertBefore(i,e.nextSibling):null==o||o.appendChild(i)}return i})(d,e),h=d.ownerDocument.createRange(),xh(s.nextSibling)?(h.setStart(s,0),h.setEnd(s,0)):(h.setStart(s,1),h.setEnd(s,1)),h;{const n=((e,t,n)=>{var i;const o=(null!==(i=t.ownerDocument)&&void 0!==i?i:document).createElement(e);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(_a().dom);const r=t.parentNode;return n?null==r||r.insertBefore(o,t):t.nextSibling?null==r||r.insertBefore(o,t.nextSibling):null==r||r.appendChild(o),o})(a,d,e),c=bh(t,d,e);l.setStyle(n,"top",c.top),l.setStyle(n,"caret-color","transparent"),s=n;const u=l.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});l.setStyles(u,{...c}),l.add(t,u),o.set({caret:u,element:d,before:e}),e&&l.addClass(u,"mce-visual-caret-before"),r=window.setInterval((()=>{o.on((e=>{i()?l.toggleClass(e.caret,"mce-visual-caret-hidden"):l.addClass(e.caret,"mce-visual-caret-hidden")}))}),500),h=d.ownerDocument.createRange(),h.setStart(n,0),h.setEnd(n,0)}return h},hide:c,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{o.on((e=>{const n=bh(t,e.element,e.before);l.setStyles(e.caret,{...n})}))},destroy:()=>clearInterval(r)}})(e,i,n.isBlock,(()=>rf(e))),r="sel-"+n.uniqueId(),s="data-mce-selected";let a;const l=e=>e!==i&&(MO(e)||lr(e))&&n.isChildOf(e,i)&&n.isEditable(e.parentNode),c=(n,i,r,s=!0)=>e.dispatch("ShowCaret",{target:i,direction:n,before:r}).isDefaultPrevented()?null:(s&&t.scrollIntoView(i,-1===n),o.show(r,i)),d=e=>Ia(e)||za(e)||Na(e),h=e=>d(e.startContainer)||d(e.endContainer),u=t=>{const i=e.schema.getVoidElements(),o=n.createRng(),r=t.startContainer,s=t.startOffset,a=t.endContainer,l=t.endOffset;return Ce(i,r.nodeName.toLowerCase())?0===s?o.setStartBefore(r):o.setStartAfter(r):o.setStart(r,s),Ce(i,a.nodeName.toLowerCase())?0===l?o.setEndBefore(a):o.setEndAfter(a):o.setEnd(a,l),o},p=(o,d)=>{if(!o)return null;if(o.collapsed){if(!h(o)){const e=d?1:-1,t=Wh(e,i,o),r=t.getNode(!d);if(x(r)){if(wh(r))return c(e,r,!!d&&!t.isAtEnd(),!1);if(Da(r)&&or(r.nextSibling)){const e=n.createRng();return e.setStart(r,0),e.setEnd(r,0),e}}const s=t.getNode(d);if(x(s)){if(wh(s))return c(e,s,!d&&!t.isAtEnd(),!1);if(Da(s)&&or(s.previousSibling)){const e=n.createRng();return e.setStart(s,1),e.setEnd(s,1),e}}}return null}let u=o.startContainer,p=o.startOffset;const f=o.endOffset;if(Go(u)&&0===p&&MO(u.parentNode)&&(u=u.parentNode,p=n.nodeIndex(u),u=u.parentNode),!jo(u))return null;if(f===p+1&&u===o.endContainer){const i=u.childNodes[p];if(l(i))return(i=>{const o=i.cloneNode(!0),l=e.dispatch("ObjectSelected",{target:i,targetClone:o});if(l.isDefaultPrevented())return null;const c=((i,o)=>{const s=hn(e.getBody()),a=e.getDoc(),l=eo(s,"#"+r).getOrThunk((()=>{const e=ln('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',a);return di(e,"id",r),si(s,e),e})),c=n.createRng();vi(l),li(l,[dn(at,a),hn(o),dn(at,a)]),c.setStart(l.dom.firstChild,1),c.setEnd(l.dom.lastChild,0),Di(l,{top:n.getPos(i,e.getBody()).y+"px"}),ei(l);const d=t.getSel();return d&&(d.removeAllRanges(),d.addRange(c)),c})(i,l.targetClone),d=hn(i);return W(mo(hn(e.getBody()),`*[${s}]`),(e=>{bn(d,e)||mi(e,s)})),n.getAttrib(i,s)||i.setAttribute(s,"1"),a=i,m(),c})(i)}return null},f=()=>{a&&a.removeAttribute(s),eo(hn(e.getBody()),"#"+r).each(bi),a=null},m=()=>{o.hide()};return Jx(e)||(e.on("click",(t=>{n.isEditable(t.target)||(t.preventDefault(),e.focus())})),e.on("blur NewBlock",f),e.on("ResizeWindow FullscreenStateChanged",o.reposition),e.on("tap",(t=>{const n=t.target,i=RO(e,n);MO(i)?(t.preventDefault(),O_(e,i).each(p)):l(n)&&O_(e,n).each(p)}),!0),e.on("mousedown",(o=>{const r=o.target;if(r!==i&&"HTML"!==r.nodeName&&!n.isChildOf(r,i))return;if(!((e,t,n)=>{const i=hn(e.getBody()),o=e.inline?i:hn(In(i).dom.documentElement),r=((e,t,n,i)=>{const o=(e=>e.dom.getBoundingClientRect())(t);return{x:n-(e?o.left+t.dom.clientLeft+Tw(t):0),y:i-(e?o.top+t.dom.clientTop+Sw(t):0)}})(e.inline,o,t,n);return((e,t,n)=>{const i=kw(e),o=Cw(e);return t>=0&&n>=0&&t<=i&&n<=o})(o,r.x,r.y)})(e,o.clientX,o.clientY))return;f(),m();const s=RO(e,r);MO(s)?(o.preventDefault(),O_(e,s).each(p)):vO(i,o.clientX,o.clientY).each((n=>{var i;o.preventDefault(),(i=c(1,n.node,n.position===uO.Before,!1))&&t.setRng(i),Bo(s)?s.focus():e.getBody().focus()}))})),e.on("keypress",(e=>{lf.modifierPressed(e)||MO(t.getNode())&&e.preventDefault()})),e.on("GetSelectionRange",(e=>{let t=e.range;if(a){if(!a.parentNode)return void(a=null);t=t.cloneRange(),t.selectNode(a),e.range=t}})),e.on("focusin",(t=>{if(o.isShowing()&&e.getBody().contains(t.target)&&t.target!==e.getBody()&&!e.dom.isEditable(t.target.parentNode)){o.hide(),t.target.contains(e.selection.getNode())||(e.selection.select(t.target,!0),e.selection.collapse(!0));const n=p(e.selection.getRng(),!0);n&&e.selection.setRng(n)}})),e.on("SetSelectionRange",(e=>{e.range=u(e.range);const t=p(e.range,e.forward);t&&(e.range=t)})),e.on("AfterSetSelectionRange",(e=>{const t=e.range,i=t.startContainer.parentElement;var o;h(t)||jo(o=i)&&"mcepastebin"===o.id||m(),(e=>x(e)&&n.hasClass(e,"mce-offscreen-selection"))(i)||f()})),(e=>{PO(e),xd(e)&&(e=>{const t=t=>{if(!t.isDefaultPrevented()){const n=t.dataTransfer;n&&(U(n.types,"Files")||n.files.length>0)&&(t.preventDefault(),"drop"===t.type&&Pw(e,"Dropped file type is not supported"))}},n=n=>{Jp(e,n.target)&&t(n)},i=()=>{const i=Ks.DOM,o=e.dom,r=document,s=e.inline?e.getBody():e.getDoc(),a=["drop","dragover"];W(a,(e=>{i.bind(r,e,n),o.bind(s,e,t)})),e.on("remove",(()=>{W(a,(e=>{i.unbind(r,e,n),o.unbind(s,e,t)}))}))};e.on("init",(()=>{Wp.setEditorTimeout(e,i,0)}))})(e)})(e),(e=>{const t=it((()=>{if(!e.removed&&e.getBody().contains(document.activeElement)){const t=e.selection.getRng();if(t.collapsed){const n=D_(e,t,!1);e.selection.setRng(n)}}}),0);e.on("focus",(()=>{t.throttle()})),e.on("blur",(()=>{t.cancel()}))})(e),(e=>{e.on("init",(()=>{e.on("focusin",(t=>{const n=t.target;if(lr(n)){const t=cv(e.getBody(),n),i=or(t)?t:n;e.selection.getNode()!==i&&O_(e,i).each((t=>e.selection.setRng(t)))}}))}))})(e)),{showCaret:c,showBlockCaretContainer:e=>{e.hasAttribute("data-mce-caret")&&(Fa(e),t.scrollIntoView(e))},hideFakeCaret:m,destroy:()=>{o.destroy(),a=null}}},NO=(e,t)=>{let n=t;for(let t=e.previousSibling;Go(t);t=t.previousSibling)n+=t.data.length;return n},FO=(e,t,n,i,o)=>{if(Go(n)&&(i<0||i>n.data.length))return[];const r=o&&Go(n)?[NO(n,i)]:[i];let s=n;for(;s!==t&&s.parentNode;)r.push(e.nodeIndex(s,o)),s=s.parentNode;return s===t?r.reverse():[]},LO=(e,t,n,i,o,r,s=!1)=>({start:FO(e,t,n,i,s),end:FO(e,t,o,r,s)}),jO=(e,t)=>{const n=t.slice(),i=n.pop();return _(i)?Y(n,((e,t)=>e.bind((e=>F.from(e.childNodes[t])))),F.some(e)).bind((e=>Go(e)&&(i<0||i>e.data.length)?F.none():F.some({node:e,offset:i}))):F.none()},BO=(e,t)=>jO(e,t.start).bind((({node:n,offset:i})=>jO(e,t.end).map((({node:e,offset:t})=>{const o=document.createRange();return o.setStart(n,i),o.setEnd(e,t),o})))),HO=(e,t,n)=>{if(t&&e.isEmpty(t)&&!n(t)){const i=t.parentNode;e.remove(t,Go(t.firstChild)&&Ro(t.firstChild.data)),HO(e,i,n)}},UO=(e,t,n,i=!0)=>{const o=t.startContainer.parentNode,r=t.endContainer.parentNode;t.deleteContents(),i&&!n(t.startContainer)&&(Go(t.startContainer)&&0===t.startContainer.data.length&&e.remove(t.startContainer),Go(t.endContainer)&&0===t.endContainer.data.length&&e.remove(t.endContainer),HO(e,o,n),o!==r&&HO(e,r,n))},$O=(e,t)=>F.from(e.dom.getParent(t.startContainer,e.dom.isBlock)),qO=(e,t,n)=>{const i=e.dynamicPatternsLookup({text:n,block:t});return{...e,blockPatterns:Xl(i).concat(e.blockPatterns),inlinePatterns:Yl(i).concat(e.inlinePatterns)}},WO=(e,t,n,i)=>{const o=e.createRng();return o.setStart(t,0),o.setEnd(n,i),o.toString()},VO=(e,t)=>e.create("span",{"data-mce-type":"bookmark",id:t}),KO=(e,t)=>{const n=e.createRng();return n.setStartAfter(t.start),n.setEndBefore(t.end),n},GO=(e,t,n)=>{const i=BO(e.getRoot(),n).getOrDie("Unable to resolve path range"),o=i.startContainer,r=i.endContainer,s=0===i.endOffset?r:r.splitText(i.endOffset),a=0===i.startOffset?o:o.splitText(i.startOffset),l=a.parentNode;return{prefix:t,end:s.parentNode.insertBefore(VO(e,t+"-end"),s),start:l.insertBefore(VO(e,t+"-start"),a)}},XO=(e,t,n)=>{HO(e,e.get(t.prefix+"-end"),n),HO(e,e.get(t.prefix+"-start"),n)},YO=e=>0===e.start.length,QO=(e,t,n,i)=>{const o=t.start;var r;return rT(e,i.container,i.offset,(r=o,(e,t)=>{const n=e.data.substring(0,t),i=n.lastIndexOf(r.charAt(r.length-1)),o=n.lastIndexOf(r);return-1!==o?o+r.length:-1!==i?i+1:-1}),n).bind((i=>{var r,s;const a=null!==(s=null===(r=n.textContent)||void 0===r?void 0:r.indexOf(o))&&void 0!==s?s:-1;if(-1!==a&&i.offset>=a+o.length){const t=e.createRng();return t.setStart(i.container,i.offset-o.length),t.setEnd(i.container,i.offset),F.some(t)}{const r=i.offset-o.length;return iT(i.container,r,n).map((t=>{const n=e.createRng();return n.setStart(t.container,t.offset),n.setEnd(i.container,i.offset),n})).filter((e=>e.toString()===o)).orThunk((()=>QO(e,t,n,ZS(i.container,0))))}}))},JO=(e,t,n,i)=>{const o=e.dom,r=o.getRoot(),s=n.pattern,a=n.position.container,l=n.position.offset;return iT(a,l-n.pattern.end.length,t).bind((c=>{const d=LO(o,r,c.container,c.offset,a,l,i);if(YO(s))return F.some({matches:[{pattern:s,startRng:d,endRng:d}],position:c});{const a=ZO(e,n.remainingPatterns,c.container,c.offset,t,i),l=a.getOr({matches:[],position:c}),h=l.position;return((e,t,n,i,o,r=!1)=>
vendor: 8,687 bytes, line 135
135{if(0===t.start.length&&!r){const t=e.createRng();return t.setStart(n,i),t.setEnd(n,i),F.some(t)}return nT(n,i,o).bind((n=>QO(e,t,o,n).bind((e=>{var t;if(r){if(e.endContainer===n.container&&e.endOffset===n.offset)return F.none();if(0===n.offset&&(null===(t=e.endContainer.textContent)||void 0===t?void 0:t.length)===e.endOffset)return F.none()}return F.some(e)}))))})(o,s,h.container,h.offset,t,a.isNone()).map((e=>{const t=((e,t,n,i=!1)=>LO(e,t,n.startContainer,n.startOffset,n.endContainer,n.endOffset,i))(o,r,e,i);return{matches:l.matches.concat([{pattern:s,startRng:t,endRng:d}]),position:ZS(e.startContainer,e.startOffset)}}))}}))},ZO=(e,t,n,i,o,r)=>{const s=e.dom;return nT(n,i,s.getRoot()).bind((a=>{const l=WO(s,o,n,i);for(let s=0;s<t.length;s++){const c=t[s];if(!Xe(l,c.end))continue;const d=t.slice();d.splice(s,1);const h=JO(e,o,{pattern:c,remainingPatterns:d,position:a},r);if(h.isNone()&&i>0)return ZO(e,t,n,i-1,o,r);if(h.isSome())return h}return F.none()}))},eD=(e,t,n)=>{e.selection.setRng(n),"inline-format"===t.type?W(t.format,(t=>{e.formatter.apply(t)})):e.execCommand(t.cmd,!1,t.value)},tD=(e,t,n,i,o,r)=>{var s;return((e,t)=>{const n=ne(e,(e=>$(t,(t=>e.pattern.start===t.pattern.start&&e.pattern.end===t.pattern.end))));return e.length===t.length?n?e:t:e.length>t.length?e:t})(ZO(e,o.inlinePatterns,n,i,t,r).fold((()=>[]),(e=>e.matches)),ZO(e,(s=o.inlinePatterns,se(s,((e,t)=>t.end.length-e.end.length))),n,i,t,r).fold((()=>[]),(e=>e.matches)))},nD=(e,t)=>{if(0===t.length)return;const n=e.dom,i=e.selection.getBookmark(),o=((e,t)=>{const n=Re("mce_textpattern"),i=X(t,((t,i)=>{const o=GO(e,n+`_end${t.length}`,i.endRng);return t.concat([{...i,endMarker:o}])}),[]);return X(i,((t,o)=>{const r=i.length-t.length-1,s=YO(o.pattern)?o.endMarker:GO(e,n+`_start${r}`,o.startRng);return t.concat([{...o,startMarker:s}])}),[])})(n,t);W(o,(t=>{const i=n.getParent(t.startMarker.start,n.isBlock),o=e=>e===i;YO(t.pattern)?((e,t,n,i)=>{const o=KO(e.dom,n);UO(e.dom,o,i),eD(e,t,o)})(e,t.pattern,t.endMarker,o):((e,t,n,i,o)=>{const r=e.dom,s=KO(r,i),a=KO(r,n);UO(r,a,o),UO(r,s,o);const l={prefix:n.prefix,start:n.end,end:i.start},c=KO(r,l);eD(e,t,c)})(e,t.pattern,t.startMarker,t.endMarker,o),XO(n,t.endMarker,o),XO(n,t.startMarker,o)})),e.selection.moveToBookmark(i)},iD=(e,t,n)=>((e,t,n)=>{if(Go(e)&&0>=e.length)return F.some(ZS(e,0));{const t=pa(eT);return F.from(t.forwards(e,0,tT(e),n)).map((e=>ZS(e.container,0)))}})(t,0,t).map((i=>{const o=i.container;return oT(o,n.start.length,t).each((n=>{const i=e.createRng();i.setStart(o,0),i.setEnd(n.container,n.offset),UO(e,i,(e=>e===t))})),o})),oD=e=>(t,n)=>{const i=t.dom,o=n.pattern,r=BO(i.getRoot(),n.range).getOrDie("Unable to resolve path range");return $O(t,r).each((n=>{"block-format"===o.type?((e,t)=>{const n=t.get(e);return m(n)&&le(n).exists((e=>Ce(e,"block")))})(o.format,t.formatter)&&t.undoManager.transact((()=>{e(t.dom,n,o),t.formatter.apply(o.format)})):"block-command"===o.type&&t.undoManager.transact((()=>{e(t.dom,n,o),t.execCommand(o.cmd,!1,o.value)}))})),!0},rD=e=>(t,n)=>{const i=(e=>se(e,((e,t)=>t.start.length-e.start.length)))(t),o=n.replace(at," ");return J(i,(t=>e(t,n,o)))},sD=(e,t)=>(n,i,o,r,s)=>{var a;void 0===s&&(s=null!==(a=i.textContent)&&void 0!==a?a:"");const l=n.dom,c=xc(n);return l.is(i,c)?e(o.blockPatterns,s).map((e=>t&&sn.trim(s).length===e.start.length?[]:[{pattern:e,range:LO(l,l.getRoot(),i,0,i,0,r)}])).getOr([]):[]},aD=oD(((e,t,n)=>{iD(e,t,n).each((e=>{const t=hn(e),n=Vi(t);/^\s[^\s]/.test(n)&&Ki(t,n.slice(1))}))})),lD=sD(rD(((e,t,n)=>0===t.indexOf(e.start)||0===n.indexOf(e.start))),!0),cD=oD(iD),dD=sD(rD(((e,t,n)=>t===e.start||n===e.start)),!1),hD=(e,t,n)=>{for(let i=0;i<e.length;i++)if(n(e[i],t))return!0;return!1},uD=Ks.DOM,pD=e=>e.inline?e.getElement().nodeName.toLowerCase():void 0,fD=e=>xe(e,(e=>!1===b(e))),mD=e=>{const t=e.options.get,n=e.editorUpload.blobCache;return fD({allow_conditional_comments:t("allow_conditional_comments"),allow_html_data_urls:t("allow_html_data_urls"),allow_svg_data_urls:t("allow_svg_data_urls"),allow_html_in_named_anchor:t("allow_html_in_named_anchor"),allow_script_urls:t("allow_script_urls"),allow_mathml_annotation_encodings:t("allow_mathml_annotation_encodings"),allow_unsafe_link_target:t("allow_unsafe_link_target"),convert_unsafe_embeds:t("convert_unsafe_embeds"),convert_fonts_to_spans:t("convert_fonts_to_spans"),extended_mathml_attributes:t("extended_mathml_attributes"),extended_mathml_elements:t("extended_mathml_elements"),fix_list_elements:t("fix_list_elements"),font_size_legacy_values:t("font_size_legacy_values"),forced_root_block:t("forced_root_block"),forced_root_block_attrs:t("forced_root_block_attrs"),preserve_cdata:t("preserve_cdata"),inline_styles:t("inline_styles"),root_name:pD(e),sandbox_iframes:t("sandbox_iframes"),sandbox_iframes_exclusions:ih(e),sanitize:t("xss_sanitization"),validate:!0,blob_cache:n,document:e.getDoc()})},gD=e=>{const t=e.options.get;return fD({custom_elements:t("custom_elements"),extended_valid_elements:t("extended_valid_elements"),invalid_elements:t("invalid_elements"),invalid_styles:t("invalid_styles"),schema:t("schema"),valid_children:t("valid_children"),valid_classes:t("valid_classes"),valid_elements:t("valid_elements"),valid_styles:t("valid_styles"),verify_html:t("verify_html"),padd_empty_block_inline_children:t("format_empty_lines")})},vD=e=>e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader,bD=e=>{const t=vD(e),n=qc(e),i=e.contentCSS,o=()=>{t.unloadAll(i),e.inline||e.ui.styleSheetLoader.unloadAll(n)},r=()=>{e.removed?o():e.on("remove",o)};if(e.contentStyles.length>0){let t="";sn.each(e.contentStyles,(e=>{t+=e+"\r\n"})),e.dom.addStyle(t)}const s=Promise.all(((e,t,n)=>{const{pass:i,fail:o}=K(t,(e=>tinymce.Resource.has(Ww(e)))),r=[...i.map((t=>{const n=tinymce.Resource.get(Ww(t));return u(n)?Promise.resolve(vD(e).loadRawCss(t,n)):Promise.resolve()})),vD(e).loadAll(o)];return e.inline?r:r.concat([e.ui.styleSheetLoader.loadAll(n)])})(e,i,n)).then(r).catch(r),a=$c(e);return a&&((e,t)=>{const n=hn(e.getBody()),i=Kn(Vn(n)),o=cn("style");di(o,"type","text/css"),si(o,dn(t)),si(i,o),e.on("remove",(()=>{bi(o)}))})(e,a),s},yD=e=>{!0!==e.removed&&((e=>{Jx(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"})})(e),(e=>{e.bindPendingEventDelegates(),e.initialized=!0,(e=>{e.dispatch("Init")})(e),e.focus(!0),(e=>{const t=e.dom.getRoot();e.inline||$u(e)&&e.selection.getStart(!0)!==t||mu(t).each((t=>{const n=t.getNode(),i=Wo(n)?mu(n).getOr(t):t;e.selection.setRng(i.toRange())}))})(e),e.nodeChanged({initial:!0});const t=Td(e);w(t)&&t.call(e,e),(e=>{const t=Ad(e);t&&Wp.setEditorTimeout(e,(()=>{let n;n=!0===t?e:e.editorManager.get(t),n&&!n.destroyed&&(n.focus(),n.selection.scrollIntoView())}),100)})(e),Bw(e)&&Uw(e,!0)})(e))},xD=e=>{const t=e.getElement();let n=e.getDoc();e.inline&&(uD.addClass(t,"mce-content-body"),e.contentDocument=n=document,e.contentWindow=window,e.bodyElement=t,e.contentAreaContainer=t);const i=e.getBody();i.disabled=!0,e.readonly=md(e),e._editableRoot=gd(e),!ah(e)&&e.hasEditableRoot()&&(e.inline&&"static"===uD.getStyle(i,"position",!0)&&(i.style.position="relative"),i.contentEditable="true"),i.disabled=!1,e.editorUpload=Qw(e),e.schema=ys(gD(e)),e.dom=Ks(n,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,update_styles:!0,root_element:e.inline?e.getBody():null,collect:e.inline,schema:e.schema,contentCssCors:Nc(e),referrerPolicy:Fc(e),onSetAttrib:t=>{e.dispatch("SetAttrib",t)}}),e.parser=(e=>{const t=wx(mD(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",((t,n)=>{const i=e.dom,o="data-mce-"+n;let r=t.length;for(;r--;){const s=t[r];let a=s.attr(n);if(a&&!s.attr(o)){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===n?(a=i.serializeStyle(i.parseStyle(a),s.name),a.length||(a=null),s.attr(o,a),s.attr(n,a)):"tabindex"===n?(s.attr(o,a),s.attr(n,null)):s.attr(o,e.convertURL(a,n,s.name))}}})),t.addNodeFilter("script",(e=>{let t=e.length;for(;t--;){const n=e[t],i=n.attr("type")||"no/type";0!==i.indexOf("mce-")&&n.attr("type","mce-"+i)}})),Gd(e)&&t.addNodeFilter("#cdata",(t=>{var n;let i=t.length;for(;i--;){const o=t[i];o.type=8,o.name="#comment",o.value="[CDATA["+e.dom.encode(null!==(n=o.value)&&void 0!==n?n:"")+"]]"}})),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(t=>{let n=t.length;const i=e.schema.getNonEmptyElements();for(;n--;){const e=t[n];e.isEmpty(i)&&0===e.getAll("br").length&&e.append(new Jf("br",1))}})),t})(e),e.serializer=lw((e=>{const t=e.options.get;return{...mD(e),...gD(e),...fD({remove_trailing_brs:t("remove_trailing_brs"),pad_empty_with_br:t("pad_empty_with_br"),url_converter:t("url_converter"),url_converter_scope:t("url_c
135onverter_scope"),element_format:t("element_format"),entities:t("entities"),entity_encoding:t("entity_encoding"),indent:t("indent"),indent_after:t("indent_after"),indent_before:t("indent_before")})}})(e),e),e.selection=sw(e.dom,e.getWin(),e.serializer,e),e.annotator=Mp(e),e.formatter=l_(e),e.undoManager=d_(e),e._nodeChangeDispatcher=new kA(e),e._selectionOverrides=zO(e),(e=>{const t=qe(),n=Ee(!1),i=ot((t=>{e.dispatch("longpress",{...t,type:"longpress"}),n.set(!0)}),400);e.on("touchstart",(e=>{zC(e).each((o=>{i.cancel();const r={x:o.clientX,y:o.clientY,target:e.target};i.throttle(e),n.set(!1),t.set(r)}))}),!0),e.on("touchmove",(o=>{i.cancel(),zC(o).each((i=>{t.on((o=>{((e,t)=>{const n=Math.abs(e.clientX-t.x),i=Math.abs(e.clientY-t.y);return n>5||i>5})(i,o)&&(t.clear(),n.set(!1),e.dispatch("longpresscancel"))}))}))}),!0),e.on("touchend touchcancel",(o=>{i.cancel(),"touchcancel"!==o.type&&t.get().filter((e=>e.target.isEqualNode(o.target))).each((()=>{n.get()?o.preventDefault():e.dispatch("tap",{...o,type:"tap"})}))}),!0)})(e),(e=>{(e=>{e.on("click",(t=>{e.dom.getParent(t.target,"details")&&t.preventDefault()}))})(e),(e=>{e.parser.addNodeFilter("details",(t=>{const n=eh(e);W(t,(e=>{"expanded"===n?e.attr("open","open"):"collapsed"===n&&e.attr("open",null)}))})),e.serializer.addNodeFilter("details",(t=>{const n=th(e);W(t,(e=>{"expanded"===n?e.attr("open","open"):"collapsed"===n&&e.attr("open",null)}))}))})(e)})(e),(e=>{const t="contenteditable",n=" "+sn.trim(Vd(e))+" ",i=" "+sn.trim(Wd(e))+" ",o=HC(n),r=HC(i),s=Kd(e);s.length>0&&e.on("BeforeSetContent",(t=>{((e,t,n)=>{let i=t.length,o=n.content;if("raw"!==n.format){for(;i--;)o=o.replace(t[i],UC(e,o,Wd(e)));n.content=o}})(e,s,t)})),e.parser.addAttributeFilter("class",(e=>{let n=e.length;for(;n--;){const i=e[n];o(i)?i.attr(t,"true"):r(i)&&i.attr(t,"false")}})),e.serializer.addAttributeFilter(t,(e=>{let n=e.length;for(;n--;){const i=e[n];if(!o(i)&&!r(i))continue;const a=i.attr("data-mce-content");s.length>0&&a?$C(s,a)?(i.name="#text",i.type=3,i.raw=!0,i.value=a):i.remove():i.attr(t,null)}}))})(e),Jx(e)||((e=>{e.on("mousedown",(t=>{t.detail>=3&&(t.preventDefault(),(e=>{const t=((e,t,n)=>{const i=Cl.fromRangeStart(e).getNode(),o=((e,t,n)=>Qi(hn(e),(e=>(e=>ir(e.dom))(e)||n.isBlock(wn(e))),cO(t)).getOr(hn(t)).dom)(i,t,n),r=hO(i,o,!1),s=hO(i,o,!0),a=document.createRange();return dO(r,o).fold((()=>{aO(r)?a.setStart(r,0):a.setStartBefore(r)}),(e=>a.setStartBefore(e.dom))),dO(s,o).fold((()=>{aO(s)?a.setEnd(s,s.data.length):a.setEndAfter(s)}),(e=>a.setEndAfter(e.dom))),a})(e.selection.getRng(),e.getBody(),e.schema);e.selection.setRng(Cv(t))})(e))}))})(e),(e=>{(e=>{const t=[",",".",";",":","!","?"],n=[32],i=()=>{return t=$d(e).filter((t=>"inline-command"!==t.type&&"block-command"!==t.type||e.queryCommandSupported(t.cmd))),n=qd(e),{inlinePatterns:Yl(t),blockPatterns:Xl(t),dynamicPatternsLookup:n};var t,n},o=()=>(e=>e.options.isSet("text_patterns_lookup"))(e);e.on("keydown",(t=>{if(13===t.keyCode&&!lf.modifierPressed(t)&&e.selection.isCollapsed()&&e.selection.isEditable()){const n=Ql(i(),"enter");(n.inlinePatterns.length>0||n.blockPatterns.length>0||o())&&((e,t)=>((e,t)=>{const n=e.selection.getRng();return $O(e,n).map((i=>{var o;const r=Math.max(0,n.startOffset),s=qO(t,i,null!==(o=i.textContent)&&void 0!==o?o:"");return{inlineMatches:tD(e,i,n.startContainer,r,s,!0),blockMatches:lD(e,i,s,!0)}})).filter((({inlineMatches:e,blockMatches:t})=>t.length>0||e.length>0))})(e,t).fold(z,(({inlineMatches:t,blockMatches:n})=>(e.undoManager.add(),e.undoManager.extra((()=>{e.execCommand("mceInsertNewLine")}),(()=>{(e=>{e.insertContent(Ca,{preserve_zwsp:!0})})(e),nD(e,t),((e,t)=>{if(0===t.length)return;const n=e.selection.getBookmark();W(t,(t=>aD(e,t))),e.selection.moveToBookmark(n)})(e,n);const i=e.selection.getRng(),o=nT(i.startContainer,i.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),o.each((t=>{const n=t.container;n.data.charAt(t.offset-1)===st&&(n.deleteData(t.offset-1,1),HO(e.dom,n.parentNode,(t=>t===e.dom.getRoot())))}))})),!0))))(e,n)&&t.preventDefault()}}),!0),e.on("keydown",(t=>{if(32===t.keyCode&&e.selection.isCollapsed()&&e.selection.isEditable()){const n=Ql(i(),"space");(n.blockPatterns.length>0||o())&&((e,t)=>((e,t)=>{const n=e.selection.getRng();return $O(e,n).map((i=>{const o=Math.max(0,n.startOffset),r=WO(e.dom,i,n.startContainer,o),s=qO(t,i,r);return dD(e,i,s,!1,r)})).filter((e=>e.length>0))})(e,t).fold(z,(t=>
vendor: 12,264 bytes, line 135
135(e.undoManager.transact((()=>{((e,t)=>{W(t,(t=>cD(e,t)))})(e,t)})),!0))))(e,n)&&t.preventDefault()}}),!0);const r=()=>{if(e.selection.isCollapsed()&&e.selection.isEditable()){const t=Ql(i(),"space");(t.inlinePatterns.length>0||o())&&((e,t)=>{const n=e.selection.getRng();$O(e,n).map((i=>{const o=Math.max(0,n.startOffset-1),r=WO(e.dom,i,n.startContainer,o),s=qO(t,i,r),a=tD(e,i,n.startContainer,o,s,!1);a.length>0&&e.undoManager.transact((()=>{nD(e,a)}))}))})(e,t)}};e.on("keyup",(e=>{hD(n,e,((e,t)=>e===t.keyCode&&!lf.modifierPressed(t)))&&r()})),e.on("keypress",(n=>{hD(t,n,((e,t)=>e.charCodeAt(0)===t.charCode))&&Wp.setEditorTimeout(e,r)}))})(e)})(e));const o=_A(e);((e,t)=>{e.addCommand("delete",(()=>{((e,t)=>{RC(e,t,!1).fold((()=>{e.selection.isEditable()&&(Ig(e),zg(e))}),R)})(e,t)})),e.addCommand("forwardDelete",(()=>{((e,t)=>{RC(e,t,!0).fold((()=>{e.selection.isEditable()&&Pg(e)}),R)})(e,t)}))})(e,o),(e=>{e.on("NodeChange",(()=>(e=>{const t=e.dom,n=e.selection,i=e.schema,o=i.getBlockElements(),r=n.getStart(),s=e.getBody();let a,l,c=null;const d=xc(e);if(!r||!jo(r))return;const h=s.nodeName.toLowerCase();if(!i.isValidChild(h,d.toLowerCase())||((e,t,n)=>$(Fm(hn(n),hn(t)),(t=>NC(e,t.dom))))(o,s,r))return;if(s.firstChild===s.lastChild&&er(s.firstChild))return a=jC(e),a.appendChild(_a().dom),s.replaceChild(a,s.firstChild),e.selection.setCursorLocation(a,0),void e.nodeChanged();let u=s.firstChild;for(;u;)if(jo(u)&&Ar(i,u),FC(i,u)){if(LC(o,u)){l=u,u=u.nextSibling,t.remove(l);continue}if(!a){if(!c&&e.hasFocus()&&(c=q_(e.selection.getRng(),(()=>document.createElement("span")))),!u.parentNode){u=null;break}a=jC(e),s.insertBefore(a,u)}l=u,u=u.nextSibling,a.appendChild(l)}else a=null,u=u.nextSibling;c&&(e.selection.setRng(W_(c)),e.nodeChanged())})(e)))})(e),(e=>{var t;const n=e.dom,i=xc(e),o=null!==(t=Xc(e))&&void 0!==t?t:"",r=(t,s)=>{if((e=>{if(p_(e)){const t=e.keyCode;return!f_(e)&&(lf.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||U(h_,t))}return!1})(t))return;const a=e.getBody(),l=!(e=>p_(e)&&!(f_(e)||"keyup"===e.type&&229===e.keyCode))(t)&&((e,t,n)=>{if(e.isEmpty(t,void 0,{skipBogus:!1,includeZwsp:!0})){const i=t.firstElementChild;return!i||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&n===i.nodeName.toLowerCase()}return!1})(n,a,i);(""!==n.getAttrib(a,u_)!==l||s)&&(n.setAttrib(a,u_,l?o:null),((e,t)=>{e.dispatch("PlaceholderToggle",{state:t})})(e,l),e.on(l?"keydown":"keyup",r),e.off(l?"keyup":"keydown",r))};et(o)&&e.on("init",(t=>{r(t,!0),e.on("change SetContent ExecCommand",r),e.on("paste",(t=>Wp.setEditorTimeout(e,(()=>r(t)))))}))})(e),rO(e);const r=(e=>{const t=e;return(e=>ke(e.plugins,"rtc").bind((e=>F.from(e.setup))))(e).fold((()=>(t.rtcInstance=Qx(e),F.none())),(e=>(t.rtcInstance=(()=>{const e=E(null),t=E("");return{init:{bindEvents:C},undoManager:{beforeChange:C,add:e,undo:e,redo:e,clear:C,reset:C,hasUndo:z,hasRedo:z,transact:e,ignore:C,extra:C},formatter:{match:z,matchAll:E([]),matchNode:E(void 0),canApply:z,closest:t,apply:C,remove:C,toggle:C,formatChanged:E({unbind:C})},editor:{getContent:t,setContent:E({content:"",html:""}),insertContent:E(""),addVisual:C},selection:{getContent:t},autocompleter:{addDecoration:C,removeDecoration:C},raw:{getModel:E(F.none())}}})(),F.some((()=>e().then((e=>(t.rtcInstance=(e=>{const t=e=>p(e)?e:{},{init:n,undoManager:i,formatter:o,editor:r,selection:s,autocompleter:a,raw:l}=e;return{init:{bindEvents:n.bindEvents},undoManager:{beforeChange:i.beforeChange,add:i.add,undo:i.undo,redo:i.redo,clear:i.clear,reset:i.reset,hasUndo:i.hasUndo,hasRedo:i.hasRedo,transact:(e,t,n)=>i.transact(n),ignore:(e,t)=>i.ignore(t),extra:(e,t,n,o)=>i.extra(n,o)},formatter:{match:(e,n,i,r)=>o.match(e,t(n),r),matchAll:o.matchAll,matchNode:o.matchNode,canApply:e=>o.canApply(e),closest:e=>o.closest(e),apply:(e,n,i)=>o.apply(e,t(n)),remove:(e,n,i,r)=>o.remove(e,t(n)),toggle:(e,n,i)=>o.toggle(e,t(n)),formatChanged:(e,t,n,i,r)=>o.formatChanged(t,n,i,r)},editor:{getContent:e=>r.getContent(e),setContent:(e,t)=>({content:r.setContent(e,t),html:""}),insertContent:(e,t)=>(r.insertContent(e),""),addVisual:r.addVisual},selection:{getContent:(e,t)=>s.getContent(t)},autocompleter:{addDecoration:a.addDecoration,removeDecoration:a.removeDecoration},raw:{getModel:()=>F.some(l.getRawModel())}}})(e),e.rtc.isRemote))))))))})(e);(e=>{const t=e.getDoc(),n=e.getBody();(e=>{e.dispatch("PreInit")})(e),Od(e)||(t.body.spellcheck=!1,uD.setAttrib(n,"spellcheck","false")),e.quirks=(e=>{const t=sn.each,n=lf.BACKSPACE,i=lf.DELETE,o=e.dom,r=e.selection,s=e.parser,a=tn.browser,l=a.isFirefox(),c=a.isChromium()||a.isSafari(),d=tn.deviceType.isiPhone()||tn.deviceType.isiPad(),h=tn.os.isMacOS()||tn.os.isiOS(),u=(t,n)=>{try{e.getDoc().execCommand(t,!1,String(n))}catch(e){}},p=e=>e.isDefaultPrevented(),f=()=>{e.shortcuts.add("meta+a",null,"SelectAll")},m=()=>{e.inline||o.bind(e.getDoc(),"mousedown mouseup",(t=>{let n;if(t.target===e.getDoc().documentElement)if(n=r.getRng(),e.getBody().focus(),"mousedown"===t.type){if(Ia(n.startContainer))return;r.placeCaretAt(t.clientX,t.clientY)}else r.setRng(n)}))},g=()=>{Range.prototype.getClientRects||e.on("mousedown",(t=>{if(!p(t)&&"HTML"===t.target.nodeName){const t=e.getBody();t.blur(),Wp.setEditorTimeout(e,(()=>{t.focus()}))}}))},v=()=>{const t=kd(e);e.on("click",(n=>{const i=n.target;/^(IMG|HR)$/.test(i.nodeName)&&o.isEditable(i)&&(n.preventDefault(),e.selection.select(i),e.nodeChanged()),"A"===i.nodeName&&o.hasClass(i,t)&&0===i.childNodes.length&&o.isEditable(i.parentNode)&&(n.preventDefault(),r.select(i))}))},b=()=>{e.on("keydown",(e=>{if(!p(e)&&e.keyCode===n&&r.isCollapsed()&&0===r.getRng().startOffset){const t=r.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}return!0}))},y=()=>{md(e)||e.on("BeforeExecCommand mousedown",(()=>{u("StyleWithCSS",!1),u("enableInlineTableEditing",!1),Kc(e)||u("enableObjectResizing",!1)}))},x=()=>{e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},w=()=>{e.inline||e.on("keydown",(()=>{document.activeElement===document.body&&e.getWin().focus()}))},_=()=>{e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(t=>{let n;"HTML"===t.target.nodeName&&(n=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(n),e.selection.normalize(),e.nodeChanged())})))},k=()=>{h&&e.on("keydown",(t=>{!lf.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))}))},S=()=>{e.on("click",(e=>{let t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},T=()=>{e.on("init",(()=>{e.dom.bind(e.getBody(),"submit",(e=>{e.preventDefault()}))}))},E=C;return Jx(e)?(c&&(m(),v(),T(),f(),d&&(w(),_(),S())),l&&(g(),y(),x(),k())):(e.on("keydown",(t=>{if(p(t)||t.keyCode!==lf.BACKSPACE)return;let n=r.getRng();const i=n.startContainer,s=n.startOffset,a=o.getRoot();let l=i;if(n.collapsed&&0===s){for(;l.parentNode&&l.parentNode.firstChild===l&&l.parentNode!==a;)l=l.parentNode;"BLOCKQUOTE"===l.nodeName&&(e.formatter.toggle("blockquote",void 0,l),n=o.createRng(),n.setStart(i,0),n.setEnd(i,0),r.setRng(n))}})),(()=>{const t=e=>{const t=o.create("body"),n=e.cloneContents();return t.appendChild(n),r.serializer.serialize(t,{format:"html"})};e.on("keydown",(r=>{const s=r.keyCode;if(!p(r)&&(s===i||s===n)&&e.selection.isEditable()){const n=e.selection.isCollapsed(),i=e.getBody();if(n&&!fr(e.schema,i))return;if(!n&&!(n=>{const i=t(n),r=o.createRng();return r.selectNode(e.getBody()),i===t(r)})(e.selection.getRng()))return;r.preventDefault(),e.setContent(""),i.firstChild&&o.isBlock(i.firstChild)?e.selection.setCursorLocation(i.firstChild,0):e.selection.setCursorLocation(i,0),e.nodeChanged()}}))})(),tn.windowsPhone||e.on("keyup focusin mouseup",(t=>{lf.modifierPressed(t)||(e=>{const t=e.getBody(),n=e.selection.getRng();return n.startContainer===n.endContainer&&n.startContainer===t&&0===n.startOffset&&n.endOffset===t.childNodes.length})(e)||r.normalize()}),!0),c&&(m(),v(),e.on("init",(()=>{u("DefaultParagraphSeparator",xc(e))})),T(),b(),s.addNodeFilter("br",(e=>{let t=e.length;for(;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()})),d?(w(),_(),S()):f()),l&&(e.on("mousedown",(t=>{Be(F.from(t.clientX),F.from(t.clientY),((n,i)=>{const o=e.getDoc().caretPositionFromPoint(n,i);if(o&&"IMG"===(r=o.offsetNode).nodeName&&e.dom.isEditable(r)){const n=o.offsetNode.getBoundingClientRect();t.preventDefault(),e.hasFocus()||e.focus(),e.selection.select(o.offsetNode),t.clientX<n.left||t.clientY<n.top?e.selection.collapse(!0):(t.clientX>n.right||t.clientY>n.bottom)&&e.selection.collapse(!1)}var r}))})),e.on("keydown",(t=>{if(!p(t)&&t.keyCode===n){if(!e.getBody().getElementsByTagName("hr").length)return;if(r.isCollapsed()&&0===r.getRng().startOffset){const e=r.getNode(),n=e.previousSibling;if("HR"===e.nodeName)return o.remove(e),void t.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(o.remove(n),t.preventDefault())}}})),g(),(()=>{const n=()=>{const n=o.getAttribs(r.getStart().cloneNode(!1));return()=>{const i=r.getStart();i!==e.getBody()&&(o.setAttrib(i,"style",null),t(n,(e=>{i.setAttributeNode(e.cloneNode(!0))})))}},i=()=>!r.isCollapsed()&&o.getParent(r.getStart(),o.isBlock)!==o.getParent(r.getEnd(),o.isBlock);e.on("keypress",(t=>{let o;return!(!(p(t)||8!==t.keyCode&&46!==t.keyCode)&&i()&&(o=n(),e.getDoc().execCommand("delete",!1),o(),t.preventDefault(),1))})),o.bind(e.getDoc(),"cut",(t=>{if(!p(t)&&i()){const t=n();Wp.setEditorTimeout(e,(()=>{t()}))}}))})(),y(),e.on("SetContent ExecCommand",(e=>{"setcontent"!==e.type&&"mceInsertLink"!==e.command||t(o.select("a:not([data-mce-block])"),(e=>{var t;let n=e.parentNode;const i=o.getRoot();if((null==n?void 0:n.lastChild)===e){for(;n&&!o.isBlock(n);){if((null===(t=n.parentNode)||void 0===t?void 0:t.lastChild)!==n||n===i)return;n=n.parentNode}o.add(n,"br",{"data-mce-bogus":1})}}))})),x(),k(),b())),{refreshContentEditable:E,isHidden:()=>{if(!l||e.removed)return!1;const t=e.selection.getSel();return!t||!t.rangeCount||0===t.rangeCount}}})(e),(e=>{e.dispatch("PostRender")})(e);const i=Wc(e);void 0!==i&&(n.dir=i);const o=Dd(e);o&&e.on("BeforeSetContent",(e=>{sn.each(o,(t=>{e.content=e.content.replace(t,(e=>"\x3c!--mce:protected "+escape(e)+"--\x3e"))}))})),e.on("SetContent",(()=>{e.addVisual(e.getBody())})),e.on("compositionstart compositionend",(t=>{e.composing="compositionstart"===t.type}))})(e),(e=>{const t=rh(e);var n;u(sh(e))||!b(t)&&"INVALID"!=((e=>"gpl"===e.toLowerCase())(n=t)||(e=>e.length>=64&&e.length<=255)(n)?"VALID":"INVALID")||console.warn("TinyMCE is running in evaluation mode. Provide a valid license key or add license_key: 'gpl' to the init config to agree to the open source license terms. Read more at https://www.tiny.cloud/license-key/")})(e),r.fold((()=>{const t=(e=>{let t=!1;const n=setTimeout((()=>{t||e.setProgressState(!0)}),500);return()=>{clearTimeout(n),t=!0,e.setProgressState(!1)}})(e);bD(e).then((()=>{yD(e),t()}))}),(t=>{e.setProgressState(!0),bD(e).then((()=>{t().then((t=>{e.setProgressState(!1),yD(e),tw(e)}),(t=>{e.notificationManager.open({type:"error",text:String(t)}),yD(e),tw(e)}))}))}))},wD=Ks.DOM,_D=Ks.DOM,kD=(e,t)=>({editorContainer:e,iframeContainer:t,api:{}}),CD=e=>{const t=e.getElement();return e.inline?kD(null):(e=>{const t=_D.create("div");return _D.insertAfter(t,e),kD(t,t)})(t)},SD=async e=>{e.dispatch("ScriptsLoaded"),(e=>{const t=sn.trim(Dc(e)),n=e.ui.registry.getAll().icons,i={...yw.get("default").icons,...yw.get(t).icons};me(i,((t,i)=>{Ce(n,i)||e.ui.registry.addIcon(i,t)}))})(e),(e=>{const t=Jc(e);if(u(t)){const n=Ow.get(t);e.theme=n(e,Ow.urls[t])||{},w(e.theme.init)&&e.theme.init(e,Ow.urls[t]||e.documentBaseUrl.replace(/\/$/,""))}else e.theme={}})(e),(e=>{const t=ed(e),n=xw.get(t);e.model=n(e,xw.urls[t])})(e),(e=>{const t=[];W(bd(e),(n=>{((e,t,n)=>{const i=Aw.get(n),o=Aw.urls[n]||e.documentBaseUrl.replace(/\/$/,"");if(n=sn.trim(n),i&&-1===sn.inArray(t,n)){if(e.plugins[n])return;try{const r=i(e,o)||{};e.plugins[n]=r,w(r.init)&&(r.init(e,o),t.push(n))}
vendor: 4,867 bytes, line 135
135catch(t){((e,t,n)=>{const i=Zs.translate(["Failed to initialize plugin: {0}",t]);Zl(e,"PluginLoadError",{message:i}),zw(i,n),Pw(e,i)})(e,n,t)}}})(e,t,(e=>e.replace(/^\-/,""))(n))}))})(e);const t=await(e=>{const t=e.getElement();return e.orgDisplay=t.style.display,u(Jc(e))?(e=>{const t=e.theme.renderUI;return t?t():CD(e)})(e):w(Jc(e))?(e=>{const t=e.getElement(),n=Jc(e)(e,t);return n.editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||e.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||e.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:t.offsetHeight,n})(e):CD(e)})(e);((e,t)=>{const n={show:F.from(t.show).getOr(C),hide:F.from(t.hide).getOr(C),isEnabled:F.from(t.isEnabled).getOr(N),setEnabled:n=>{n&&("readonly"===e.mode.get()||Bw(e))||F.from(t.setEnabled).each((e=>e(n)))}};e.ui={...e.ui,...n}})(e,F.from(t.api).getOr({})),e.editorContainer=t.editorContainer,(e=>{e.contentCSS=e.contentCSS.concat((e=>Vw(e,Uc(e)))(e),(e=>Vw(e,qc(e)))(e))})(e),e.inline?xD(e):((e,t)=>{((e,t)=>{const n=tn.browser.isFirefox()?Cd(e):"Rich Text Area",i=e.translate(n),o=pi(hn(e.getElement()),"tabindex").bind(nt),r=((e,t,n,i)=>{const o=cn("iframe");return i.each((e=>di(o,"tabindex",e))),hi(o,n),hi(o,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),so(o,"tox-edit-area__iframe"),o})(e.id,i,pc(e),o).dom;r.onload=()=>{r.onload=null,e.dispatch("load")},e.contentAreaContainer=t.iframeContainer,e.iframeElement=r,e.iframeHTML=(e=>{let t=fc(e)+"<html><head>";mc(e)!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const n=gc(e),i=vc(e),o=e.translate(Cd(e));return bc(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+bc(e)+'" />'),t+=`</head><body id="${n}" class="mce-content-body ${i}" data-id="${e.id}" aria-label="${o}"><br></body></html>`,t})(e),wD.add(t.iframeContainer,r)})(e,t),t.editorContainer&&(t.editorContainer.style.display=e.orgDisplay,e.hidden=wD.isHidden(t.editorContainer)),e.getElement().style.display="none",wD.setAttrib(e.id,"aria-hidden","true"),e.getElement().style.visibility=e.orgVisibility,(e=>{const t=e.iframeElement,n=()=>{e.contentDocument=t.contentDocument,xD(e)};if(Qd(e)||tn.browser.isFirefox()){const t=e.getDoc();t.open(),t.write(e.iframeHTML),t.close(),n()}else{const i=((e,t,n,i)=>((e,t,n,i,o)=>{const r=((e,t)=>n=>{e(n)&&t((e=>{const t=hn(Xn(e).getOr(e.target)),n=()=>e.stopPropagation(),i=()=>e.preventDefault(),o=S(i,n);return((e,t,n,i,o,r,s)=>({target:e,x:t,y:n,stop:i,prevent:o,kill:r,raw:s}))(t,e.clientX,e.clientY,n,i,o,e)})(n))})(n,i);return e.dom.addEventListener(t,r,!1),{unbind:D(Qn,e,t,r,!1)}})(e,t,n,i))(hn(t),"load",Jn,(()=>{i.unbind(),n()}));t.srcdoc=e.iframeHTML}})(e)})(e,{editorContainer:t.editorContainer,iframeContainer:t.iframeContainer})},TD=Ks.DOM,ED=e=>"-"===e.charAt(0),AD=(e,t,n)=>F.from(t).filter((e=>et(e)&&!yw.has(e))).map((t=>({url:`${e.editorManager.baseURL}/icons/${t}/icons${n}.js`,name:F.some(t)}))),OD=Kt().deviceType,DD=OD.isPhone(),ID=OD.isTablet(),PD=e=>{if(y(e))return[];{const t=m(e)?e:e.split(/[ ,]/),n=q(t,Qe);return G(n,et)}},MD=(e,t)=>Ce(e.sections(),t),RD=(e,t)=>({table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:ke(e,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1,...t?{menubar:!1}:{}}),zD=(e,t)=>{var n;const i=null!==(n=t.external_plugins)&&void 0!==n?n:{};return e&&e.external_plugins?sn.extend({},e.external_plugins,i):i},ND=(e,t,n,i,o)=>{var r;const s=e?{mobile:RD(null!==(r=o.mobile)&&void 0!==r?r:{},t)}:{},a=((e,t)=>{const n=(t=>{const n={},i={};return ye(t,((t,n)=>U(e,n)),be(n),be(i)),{t:n,f:i}})(t);return i=n.t,o=n.f,{sections:E(i),options:E(o)};var i,o})(["mobile"],Ne(s,o)),l=sn.extend(n,i,a.options(),((e,t)=>e&&MD(t,"mobile"))(e,a)?((e,t,n={})=>{const i=e.sections(),o=ke(i,t).getOr({});return sn.extend({},n,o)})(a,"mobile"):{},{external_plugins:zD(i,a.options())});return((e,t,n,i)=>{const o=PD(n.forced_plugins),r=PD(i.plugins),s=((e,t)=>MD(e,t)?e.sections()[t]:{})(t,"mobile"),a=((e,t)=>[...PD(e),...PD(t)])(o,((e,t,n,i)=>e&&MD(t,"mobile")?i:n)(e,t,r,s.plugins?PD(s.plugins):r));return sn.extend(i,{forced_plugins:o,plugins:a})})(e,a,i,l)},FD=(e,t)=>{const n=e.selection,i=e.dom;return/^ | $/.test(t)?((e,t,n,i)=>{const o=hn(e.getRoot());return n=sg(o,Cl.fromRangeStart(t),i)?n.replace(/^ /,"&nbsp;"):n.replace(/^&nbsp;/," "),ag(o,Cl.fromRangeEnd(t),i)?n.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):n.replace(/&nbsp;(<br( \/)?>)?$/," ")})(i,n.getRng(),t,e.schema):t},LD=(e,t)=>{if(e.selection.isEditable()){const{content:n,details:i}=(e=>{if("string"!=typeof e){const t=sn.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}return{content:e,details:{}}})(t);Tx(e,{...i,content:FD(e,n),format:"html",set:!1,selection:!0}
vendor: 8,426 bytes, line 135
135).each((t=>{const n=((e,t,n)=>Zx(e).editor.insertContent(t,n))(e,t.content,i);Ex(e,n,t),e.addVisual()}))}},jD={"font-size":"size","font-family":"face"},BD=On("font"),HD=e=>(t,n)=>F.from(n).map(hn).filter(Sn).bind((n=>((e,t,n)=>yo(hn(n),(t=>(t=>Mi(t,e).orThunk((()=>BD(t)?ke(jD,e).bind((e=>pi(t,e))):F.none())))(t)),(e=>bn(hn(t),e))))(e,t,n.dom).or(((e,t)=>F.from(Ks.DOM.getStyle(t,e,!0)))(e,n.dom)))).getOr(""),UD=HD("font-size"),$D=S((e=>e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")),HD("font-family")),qD=e=>mu(e.getBody()).bind((e=>{const t=e.container();return F.from(Go(t)?t.parentNode:t)})),WD=(e,t)=>((e,t)=>(e=>F.from(e.selection.getRng()).bind((t=>{const n=e.getBody();return t.startContainer===n&&0===t.startOffset?F.none():F.from(e.selection.getStart(!0))})))(e).orThunk(D(qD,e)).map(hn).filter(Sn).bind(t))(e,T(F.some,t)),VD=(e,t)=>{if(/^[0-9.]+$/.test(t)){const n=parseInt(t,10);if(n>=1&&n<=7){const i=(e=>sn.explode(e.options.get("font_size_style_values")))(e),o=(e=>sn.explode(e.options.get("font_size_classes")))(e);return o.length>0?o[n-1]||t:i[n-1]||t}return t}return t},KD=e=>{const t=e.split(/\s*,\s*/);return q(t,(e=>-1===e.indexOf(" ")||Ge(e,'"')||Ge(e,"'")?e:`'${e}'`)).join(",")},GD=(e,t)=>{if(e.mode.isReadOnly())return;const n=e.dom,i=e.selection.getRng(),o=t?e.selection.getStart():e.selection.getEnd(),r=t?i.startContainer:i.endContainer,s=_E(n,r);if(!s||!s.isContentEditable)return;const a=t?ii:oi,l=xc(e);((e,t,n,i)=>{const o=e.dom,r=e=>o.isBlock(e)&&e.parentElement===n,s=r(t)?t:o.getParent(i,r,n);return F.from(s).map(hn)})(e,o,s,r).each((t=>{const n=TE(e,r,t.dom,s,!1,l);a(t,hn(n)),e.selection.setCursorLocation(n,0),e.dispatch("NewBlock",{newBlock:n}),mE(e,"insertParagraph")}))},XD=e=>{(e=>{(e=>{const t=t=>()=>{W("left,center,right,justify".split(","),(n=>{t!==n&&e.formatter.remove("align"+n)})),"none"!==t&&(t=>{e.formatter.toggle(t,void 0),e.nodeChanged()})("align"+t)};e.editorCommands.addCommands({JustifyLeft:t("left"),JustifyCenter:t("center"),JustifyRight:t("right"),JustifyFull:t("justify"),JustifyNone:t("none")})})(e),(e=>{const t=t=>()=>{const n=e.selection,i=n.isCollapsed()?[e.dom.getParent(n.getNode(),e.dom.isBlock)]:n.getSelectedBlocks();return $(i,(n=>x(e.formatter.matchNode(n,t))))};e.editorCommands.addCommands({JustifyLeft:t("alignleft"),JustifyCenter:t("aligncenter"),JustifyRight:t("alignright"),JustifyFull:t("alignjustify")},"state")})(e)})(e),(e=>{e.editorCommands.addCommands({"Cut,Copy,Paste":t=>{const n=e.getDoc();let i;try{n.execCommand(t)}catch(e){i=!0}if("paste"!==t||n.queryCommandEnabled(t)||(i=!0),i||!n.queryCommandSupported(t)){let t=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");(tn.os.isMacOS()||tn.os.isiOS())&&(t=t.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:t,type:"error"})}}})})(e),(e=>{e.editorCommands.addCommands({mceAddUndoLevel:()=>{e.undoManager.add()},mceEndUndoLevel:()=>{e.undoManager.add()},Undo:()=>{e.undoManager.undo()},Redo:()=>{e.undoManager.redo()}})})(e),(e=>{e.editorCommands.addCommands({mceSelectNodeDepth:(t,n,i)=>{let o=0;e.dom.getParent(e.selection.getNode(),(t=>!jo(t)||o++!==i||(e.selection.select(t),!1)),e.getBody())},mceSelectNode:(t,n,i)=>{e.selection.select(i)},selectAll:()=>{const t=e.dom.getParent(e.selection.getStart(),ir);if(t){const n=e.dom.createRng();n.selectNodeContents(t),e.selection.setRng(n)}}})})(e),(e=>{e.editorCommands.addCommands({mceCleanup:()=>{const t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},insertImage:(t,n,i)=>{LD(e,e.dom.createHTML("img",{src:i}))},insertHorizontalRule:()=>{e.execCommand("mceInsertContent",!1,"<hr>")},insertText:(t,n,i)=>{LD(e,e.dom.encode(i))},insertHTML:(t,n,i)=>{LD(e,i)},mceInsertContent:(t,n,i)=>{LD(e,i)},mceSetContent:(t,n,i)=>{e.setContent(i)},mceReplaceContent:(t,n,i)=>{e.execCommand("mceInsertContent",!1,i.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceNewDocument:()=>{e.setContent(zd(e))}})})(e),(e=>{const t=(t,n,i)=>{if(e.mode.isReadOnly())return;const o=u(i)?{href:i}:i,r=e.dom.getParent(e.selection.getNode(),"a");p(o)&&u(o.href)&&(o.href=o.href.replace(/ /g,"%20"),r&&o.href||e.formatter.remove("link"),o.href&&e.formatter.apply("link",o,r))};e.editorCommands.addCommands({unlink:()=>{if(e.selection.isEditable()){if(e.selection.isCollapsed()){const t=e.dom.getParent(e.selection.getStart(),"a");return void(t&&e.dom.remove(t,!0))}e.formatter.remove("link")}},mceInsertLink:t,createLink:t})})(e),(e=>{e.editorCommands.addCommands({Indent:()=>{(e=>{IC(e,"indent")})(e)},Outdent:()=>{PC(e)}}),e.editorCommands.addCommands({Outdent:()=>AC(e)},"state")})(e),(e=>{e.editorCommands.addCommands({InsertNewBlockBefore:()=>{(e=>{GD(e,!0)})(e)},InsertNewBlockAfter:()=>{(e=>{GD(e,!1)})(e)}})})(e),(e=>{e.editorCommands.addCommands({insertParagraph:()=>{rA(FE,e)},mceInsertNewLine:(t,n,i)=>{sA(e,i)},InsertLineBreak:(t,n,i)=>{rA(WE,e)}})})(e),(e=>{(e=>{const t=(t,n)=>{e.formatter.toggle(t,n),e.nodeChanged()};e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>{t(e)},"ForeColor,HiliteColor":(e,n,i)=>{t(e,{value:i})},BackColor:(e,n,i)=>{t("hilitecolor",{value:i})},FontName:(t,n,i)=>{((e,t)=>{const n=VD(e,t);e.formatter.toggle("fontname",{value:KD(n)}),e.nodeChanged()})(e,i)},FontSize:(t,n,i)=>{((e,t)=>{e.formatter.toggle("fontsize",{value:VD(e,t)}),e.nodeChanged()})(e,i)},LineHeight:(t,n,i)=>{((e,t)=>{e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged()})(e,i)},Lang:(e,n,i)=>{var o;t(e,{value:i.code,customValue:null!==(o=i.customCode)&&void 0!==o?o:null})},RemoveFormat:t=>{e.formatter.remove(t)},mceBlockQuote:()=>{t("blockquote")},FormatBlock:(e,n,i)=>{t(u(i)?i:"p")},mceToggleFormat:(e,n,i)=>{t(i)}})})(e),(e=>{const t=t=>e.formatter.match(t);e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>t(e),mceBlockQuote:()=>t("blockquote")},"state"),e.editorCommands.addQueryValueHandler("FontName",(()=>(e=>WD(e,(t=>$D(e.getBody(),t.dom))).getOr(""))(e))),e.editorCommands.addQueryValueHandler("FontSize",(()=>(e=>WD(e,(t=>UD(e.getBody(),t.dom))).getOr(""))(e))),e.editorCommands.addQueryValueHandler("LineHeight",(()=>(e=>WD(e,(t=>{const n=hn(e.getBody());return yo(t,(e=>Mi(e,"line-height")),D(bn,n)).getOrThunk((()=>{const e=parseFloat(Ii(t,"line-height")),n=parseFloat(Ii(t,"font-size"));return String(e/n)}))})).getOr(""))(e)))})(e)})(e),(e=>{e.editorCommands.addCommands({mceRemoveNode:(t,n,i)=>{const o=null!=i?i:e.selection.getNode();if(o!==e.getBody()){const t=e.selection.getBookmark();e.dom.remove(o,!0),e.selection.moveToBookmark(t)}},mcePrint:()=>{e.getWin().print()},mceFocus:(t,n,i)=>{((e,t)=>{e.removed||(t?af(e):(e=>{const t=e.selection,n=e.getBody();let i=t.getRng();e.quirks.refreshContentEditable();const o=e=>{$p(e).each((t=>{e.selection.setRng(t),i=t}))};!rf(e)&&e.hasEditableRoot()&&o(e);const r=((e,t)=>e.dom.getParent(t,(t=>"true"===e.dom.getContentEditable(t))))(e,t.getNode());if(r&&e.dom.isChildOf(r,n))return((e,t)=>null!==e.dom.getParent(t,(t=>"false"===e.dom.getContentEditable(t))))(e,r)||of(n),of(r),e.hasEditableRoot()||o(e),nf(e,i),void af(e);e.inline||(tn.browser.isOpera()||of(n),e.getWin().focus()),(tn.browser.isFirefox()||e.inline)&&(of(n),nf(e,i)),af(e)})(e))})(e,!0===i)},mceToggleVisualAid:()=>{e.hasVisual=!e.hasVisual,e.addVisual()}})})(e)},YD=["toggleview"],QD=e=>U(YD,e.toLowerCase());class JD{constructor(e){this.commands={state:{},exec:{},value:{}},this.editor=e}execCommand(e,t=!1,n,i){const o=this.editor,r=e.toLowerCase(),s=null==i?void 0:i.skip_focus;if(o.removed)return!1;if("mcefocus"!==r&&(/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(r)||s?(e=>{$p(e).each((t=>e.selection.setRng(t)))})(o):o.focus()),o.dispatch("BeforeExecCommand",{command:e,ui:t,value:n}).isDefaultPrevented())return!1;const a=this.commands.exec[r];return!!w(a)&&(a(r,t,n),o.dispatch("ExecCommand",{command:e,ui:t,value:n}),!0)}queryCommandState(e){if(!QD(e)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const t=e.toLowerCase(),n=this.commands.state[t];return!!w(n)&&n(t)}queryCommandValue(e){if(!QD(e)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const t=e.toLowerCase(),n=this.commands.value[t];return w(n)?n(t):""}addCommands(e,t="exec"){const n=this.commands;me(e,((e,i)=>{W(i.toLowerCase().split(","),(i=>{n[t][i]=e}))}))}
vendor: 4,580 bytes, line 135
135addCommand(e,t,n){const i=e.toLowerCase();this.commands.exec[i]=(e,i,o)=>t.call(null!=n?n:this.editor,i,o)}queryCommandSupported(e){const t=e.toLowerCase();return!!this.commands.exec[t]}addQueryStateHandler(e,t,n){this.commands.state[e.toLowerCase()]=()=>t.call(null!=n?n:this.editor)}addQueryValueHandler(e,t,n){this.commands.value[e.toLowerCase()]=()=>t.call(null!=n?n:this.editor)}}const ZD=sn.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class eI{static isNative(e){return!!ZD[e.toLowerCase()]}constructor(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||z}fire(e,t){return this.dispatch(e,t)}dispatch(e,t){const n=e.toLowerCase(),i=Is(n,null!=t?t:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(i);const o=this.bindings[n];if(o)for(let e=0,t=o.length;e<t;e++){const t=o[e];if(!t.removed){if(t.once&&this.off(n,t.func),i.isImmediatePropagationStopped())return i;if(!1===t.func.call(this.scope,i))return i.preventDefault(),i}}return i}on(e,t,n,i){if(!1===t&&(t=z),t){const o={func:t,removed:!1};i&&sn.extend(o,i);const r=e.toLowerCase().split(" ");let s=r.length;for(;s--;){const e=r[s];let t=this.bindings[e];t||(t=[],this.toggleEvent(e,!0)),t=n?[o,...t]:[...t,o],this.bindings[e]=t}}return this}off(e,t){if(e){const n=e.toLowerCase().split(" ");let i=n.length;for(;i--;){const o=n[i];let r=this.bindings[o];if(!o)return me(this.bindings,((e,t)=>{this.toggleEvent(t,!1),delete this.bindings[t]})),this;if(r){if(t){const e=K(r,(e=>e.func===t));r=e.fail,this.bindings[o]=r,W(e.pass,(e=>{e.removed=!0}))}else r.length=0;r.length||(this.toggleEvent(e,!1),delete this.bindings[o])}}}else me(this.bindings,((e,t)=>{this.toggleEvent(t,!1)})),this.bindings={};return this}once(e,t,n){return this.on(e,t,n,{once:!0})}has(e){e=e.toLowerCase();const t=this.bindings[e];return!(!t||0===t.length)}}const tI=e=>(e._eventDispatcher||(e._eventDispatcher=new eI({scope:e,toggleEvent:(t,n)=>{eI.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,n)}})),e._eventDispatcher),nI={fire(e,t,n){return console.warn('The "fire" event api has been deprecated and will be removed in TinyMCE 9. Use "dispatch" instead.',(new Error).stack),this.dispatch(e,t,n)},dispatch(e,t,n){const i=this;if(i.removed&&"remove"!==e&&"detach"!==e)return Is(e.toLowerCase(),null!=t?t:{},i);const o=tI(i).dispatch(e,t);if(!1!==n&&i.parent){let t=i.parent();for(;t&&!o.isPropagationStopped();)t.dispatch(e,o,!1),t=t.parent?t.parent():void 0}return o},on(e,t,n){return tI(this).on(e,t,n)},off(e,t){return tI(this).off(e,t)},once(e,t){return tI(this).once(e,t)},hasEventListeners(e){return tI(this).has(e)}},iI=Ks.DOM;let oI;const rI=(e,t)=>{if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^(?:mouse|touch|click|contextmenu|drop|dragover|dragend)/.test(t))return e.getDoc().documentElement;const n=Yc(e);return n?(e.eventRoot||(e.eventRoot=iI.select(n)[0]),e.eventRoot):e.getBody()},sI=(e,t,n)=>{(e=>!e.hidden&&!Bw(e))(e)?e.dispatch(t,n):Bw(e)&&((e,t)=>{if((e=>"click"===e.type)(t)&&!lf.metaKeyPressed(t)){const n=hn(t.target);((e,t)=>to(t,"a",(t=>bn(t,hn(e.getBody())))).bind((e=>pi(e,"href"))))(e,n).each((n=>{if(t.preventDefault(),/^#/.test(n)){const t=e.dom.select(`${n},[name="${Ve(n,"#")}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else window.open(n,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")}))}else(e=>U(qw,e.type))(t)&&e.dispatch(t.type,t)})(e,n)},aI=(e,t)=>{if(e.delegates||(e.delegates={}),e.delegates[t]||e.removed)return;const n=rI(e,t);if(Yc(e)){if(oI||(oI={},e.editorManager.on("removeEditor",(()=>{e.editorManager.activeEditor||oI&&(me(oI,((t,n)=>{e.dom.unbind(rI(e,n))})),oI=null)}))),oI[t])return;const i=n=>{const i=n.target,o=e.editorManager.get();let r=o.length;for(;r--;){const e=o[r].getBody();(e===i||iI.isChildOf(i,e))&&sI(o[r],t,n)}};oI[t]=i,iI.bind(n,t,i)}else{const i=n=>{sI(e,t,n)};iI.bind(n,t,i),e.delegates[t]=i}},lI={...nI,bindPendingEventDelegates(){const e=this;sn.each(e._pendingNativeEvents,(t=>{aI(e,t)}))},toggleNativeEvent(e,t){const n=this;"focus"!==e&&"blur"!==e&&(n.removed||(t?n.initialized?aI(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pe
vendor: 9,316 bytes, line 135
135ndingNativeEvents=[e]:n.initialized&&n.delegates&&(n.dom.unbind(rI(n,e),e,n.delegates[e]),delete n.delegates[e])))},unbindAllNativeEvents(){const e=this,t=e.getBody(),n=e.dom;e.delegates&&(me(e.delegates,((t,n)=>{e.dom.unbind(rI(e,n),n,t)})),delete e.delegates),!e.inline&&t&&n&&(t.onload=null,n.unbind(e.getWin()),n.unbind(e.getDoc())),n&&(n.unbind(t),n.unbind(e.getContainer()))}},cI=e=>u(e)?{value:e.split(/[ ,]/),valid:!0}:k(e,u)?{value:e,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},dI=(e,t)=>e+(tt(t.message)?"":`. ${t.message}`),hI=e=>e.valid,uI=(e,t,n="")=>{const i=t(e);return v(i)?i?{value:e,valid:!0}:{valid:!1,message:n}:i},pI=e=>e.readonly,fI=["design","readonly"],mI=(e,t,n,i)=>{const o=n[t.get()],r=n[i];try{r.activate()}catch(e){return void console.error(`problem while activating editor mode ${i}:`,e)}o.deactivate(),o.editorReadOnly!==r.editorReadOnly&&((e,t)=>{const n=hn(e.getBody());t?(e.readonly=!0,e.hasEditableRoot()&&(n.dom.contentEditable="true"),Lw(e)):(e.readonly=!1,jw(e))})(e,r.editorReadOnly),t.set(i),((e,t)=>{e.dispatch("SwitchMode",{mode:t})})(e,i)},gI=sn.each,vI=sn.explode,bI={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},yI=sn.makeMap("alt,ctrl,shift,meta,access"),xI=e=>{const t={},n=tn.os.isMacOS()||tn.os.isiOS();gI(vI(e.toLowerCase(),"+"),(e=>{(e=>e in yI)(e)?t[e]=!0:/^[0-9]{2,}$/.test(e)?t.keyCode=parseInt(e,10):(t.charCode=e.charCodeAt(0),t.keyCode=bI[e]||e.toUpperCase().charCodeAt(0))}));const i=[t.keyCode];let o;for(o in yI)t[o]?i.push(o):t[o]=!1;return t.id=i.join(","),t.access&&(t.alt=!0,n?t.ctrl=!0:t.shift=!0),t.meta&&(n?t.meta=!0:(t.ctrl=!0,t.meta=!1)),t};class wI{constructor(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;const t=this;e.on("keyup keypress keydown",(e=>{!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(gI(t.shortcuts,(n=>{t.matchShortcut(e,n)&&(t.pendingPatterns=n.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(n))})),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()))}))}add(e,t,n,i){const o=this,r=o.normalizeCommandFunc(n);return gI(vI(sn.trim(e)),(e=>{const n=o.createShortcut(e,t,r,i);o.shortcuts[n.id]=n})),!0}remove(e){const t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)}normalizeCommandFunc(e){const t=this,n=e;return"string"==typeof n?()=>{t.editor.execCommand(n,!1,null)}:sn.isArray(n)?()=>{t.editor.execCommand(n[0],n[1],n[2])}:n}createShortcut(e,t,n,i){const o=sn.map(vI(e,">"),xI);return o[o.length-1]=sn.extend(o[o.length-1],{func:n,scope:i||this.editor}),sn.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})}hasModifier(e){return e.altKey||e.ctrlKey||e.metaKey}isFunctionKey(e){return"keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123}matchShortcut(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)}executeShortcutAction(e){return e.func?e.func.call(e.scope):null}}const _I=()=>{const e=(()=>{const e={},t={},n={},i={},o={},r={},s={},a={},l={},c=(e,t)=>(n,i)=>{e[n.toLowerCase()]={...i,type:t}};return{addButton:c(e,"button"),addGroupToolbarButton:c(e,"grouptoolbarbutton"),addToggleButton:c(e,"togglebutton"),addMenuButton:c(e,"menubutton"),addSplitButton:c(e,"splitbutton"),addMenuItem:c(t,"menuitem"),addNestedMenuItem:c(t,"nestedmenuitem"),addToggleMenuItem:c(t,"togglemenuitem"),addAutocompleter:c(n,"autocompleter"),addContextMenu:c(o,"contextmenu"),addContextToolbar:c(r,"contexttoolbar"),addContextForm:(d=r,(e,t)=>{d[e.toLowerCase()]={type:"contextform",...t}}),addSidebar:c(a,"sidebar"),addView:c(l,"views"),addIcon:(e,t)=>i[e.toLowerCase()]=t,addContext:(e,t)=>s[e.toLowerCase()]=t,getAll:()=>({buttons:e,menuItems:t,icons:i,popups:n,contextMenus:o,contextToolbars:r,sidebars:a,views:l,contexts:s})};var d})();return{addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,addView:e.addView,addContext:e.addContext,getAll:e.getAll}},kI=Ks.DOM,CI=sn.extend,SI=sn.each;class TI{constructor(e,t,n){this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.composing=!1,this.destroyed=!1,this.hasHiddenInput=!1,this.iframeElement=null,this.initialized=!1,this.readonly=!1,this.removed=!1,this.startContent="",this._pendingNativeEvents=[],this._skinLoaded=!1,this._editableRoot=!0,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,CI(this,lI);const i=this;this.id=e,this.hidden=!1;const o=((e,t)=>{const n=Fe(t);return ND(DD||ID,DD,n,e,n)})(n.defaultOptions,t);this.options=((e,t,n=t)=>{const i={},o={},r=(e,t,n)=>{const i=uI(t,n);return hI(i)?(o[e]=i.value,!0):(console.warn(dI(`Invalid value passed for the ${e} option`,i)),!1)},s=e=>Ce(i,e);return{register:(e,n)=>{const s=(e=>u(e.processor))(n)?(e=>{const t=(()=>{switch(e){case"array":return m;case"boolean":return v;case"function":return w;case"number":return _;case"object":return p;case"string":return u;case"string[]":return cI;case"object[]":return e=>k(e,p);case"regexp":return e=>h(e,RegExp);default:return N}})();return n=>uI(n,t,`The value must be a ${e}.`)})(n.processor):n.processor,a=((e,t,n)=>{if(!b(t)){const i=uI(t,n);if(hI(i))return i.value;console.error(dI(`Invalid default value passed for the "${e}" option`,i))}})(e,n.default,s);i[e]={...n,default:a,processor:s},ke(o,e).orThunk((()=>ke(t,e))).each((t=>r(e,t,s)))},isRegistered:s,get:e=>ke(o,e).orThunk((()=>ke(i,e).map((e=>e.default)))).getOrUndefined(),set:(e,t)=>{if(s(e)){const n=i[e];return n.immutable?(console.error(`"${e}" is an immutable option and cannot be updated`),!1):r(e,t,n.processor)}return console.warn(`"${e}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:e=>{const t=s(e);return t&&delete o[e],t},isSet:e=>Ce(o,e),debug:()=>{try{console.log(JSON.parse(JSON.stringify(n,((e,t)=>v(t)||_(t)||u(t)||g(t)||m(t)||f(t)?t:Object.prototype.toString.call(t)))))}catch(e){console.error(e)}}}})(0,o,t),(e=>{const t=e.options.register;t("id",{processor:"string",default:e.id}),t("selector",{processor:"string"}),t("target",{processor:"object"}),t("suffix",{processor:"string"}),t("cache_suffix",{processor:"string"}),t("base_url",{processor:"string"}),t("referrer_policy",{processor:"string",default:""}),t("language_load",{processor:"boolean",default:!0}),t("inline",{processor:"boolean",default:!1}),t("iframe_attrs",{processor:"object",default:{}}),t("doctype",{processor:"string",default:"<!DOCTYPE html>"}),t("document_base_url",{processor:"string",default:e.documentBaseUrl}),t("body_id",{processor:uc(e,"tinymce"),default:"tinymce"}),t("body_class",{processor:uc(e),default:""}),t("content_security_policy",{processor:"string",default:""}),t("br_in_pre",{processor:"boolean",default:!0}),t("forced_root_block",{processor:e=>{const t=u(e)&&et(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),t("forced_root_block_attrs",{processor:"object",default:{}}),t("newline_behavior",{processor:e=>{const t=U(["block","linebreak","invert","default"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),t("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),t("no_newline_selector",{processor:"string",default:""}),t("keep_styles",{processor:"boolean",default:!0}),t("end_container_on_empty_block",{processor:e=>v(e)||u(e)?{valid:!0,value:e}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),t("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),t("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),t("font_size_classes",{processor:"string",default:""}),t("automatic_uploads",{processor:"boolean",default:!0}),t("images_reuse_filename",{processor:"boolean",default:!1}),t("images_replace_blob_uris",{processor:"boolean",default:!0}),t("icons",{processor:"string",default:""}),t("icons_url",{processor:"string",default:""}),t("images_upload_url",{processor:"string",default:""}),t("images_upload_base_path",{processor:"string",default:""}),t("images_upload_credentials",{processor:"boolean",default:!1}),t("images_upload_handler",{processor:"function"}),t("language",{processor:"string",default:"en"}),t("language_url",{processor:"string",default:""}),t("entity_encoding",{processor:"string",default:"named"}),t("indent",{processor:"boolean",default:!0}),t("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,f
135igure,figcaption,option,optgroup,datalist"}),t("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_use_margin",{processor:"boolean",default:!1}),t("indentation",{processor:"string",default:"40px"}),t("content_css",{processor:e=>{const t=!1===e||u(e)||k(e,u);return t?u(e)?{value:q(e.split(","),Qe),valid:t}:m(e)?{value:e,valid:t}:!1===e?{value:[],valid:t}:{value:e,valid:t}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:ld(e)?[]:["default"]}),t("content_style",{processor:"string"}),t("content_css_cors",{processor:"boolean",default:!1}),t("font_css",{processor:e=>{const t=u(e)||k(e,u);return t?{value:m(e)?e:q(e.split(","),Qe),valid:t}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),t("extended_mathml_attributes",{processor:"string[]"}),t("extended_mathml_elements",{processor:"string[]"}),t("inline_boundaries",{processor:"boolean",default:!0}),t("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),t("object_resizing",{processor:e=>{const t=v(e)||u(e);return t?!1===e||sc.isiPhone()||sc.isiPad()?{value:"",valid:t}:{value:!0===e?"table,img,figure.image,div,video,iframe":e,valid:t}:{valid:!1,message:"Must be boolean or a string"}},default:!ac}),t("resize_img_proportional",{processor:"boolean",default:!0}),t("event_root",{processor:"string"}),t("service_message",{processor:"string"}),t("onboarding",{processor:"boolean",default:!0}),t("tiny_cloud_entry_url",{processor:"string"}),t("theme",{processor:e=>!1===e||u(e)||w(e),default:"silver"}),t("theme_url",{processor:"string"}),t("formats",{processor:"object"}),t("format_empty_lines",{processor:"boolean",default:!1}),t("format_noneditable_selector",{processor:"string",default:""}),t("preview_styles",{processor:e=>{const t=!1===e||u(e);return t?{value:!1===e?"":e,valid:t}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),t("custom_ui_selector",{processor:"string",default:""}),t("hidden_input",{processor:"boolean",default:!0}),t("submit_patch",{processor:"boolean",default:!0}),t("encoding",{processor:"string"}),t("add_form_submit_trigger",{processor:"boolean",default:!0}),t("add_unload_trigger",{processor:"boolean",default:!0}),t("custom_undo_redo_levels",{processor:"number",default:0}),t("disable_nodechange",{processor:"boolean",default:!1}),t("disabled",{processor:t=>v(t)?(e.initialized&&ah(e)!==t&&Promise.resolve().then((()=>{((e,t)=>
vendor: 10,898 bytes, line 135
135{e.dispatch("DisabledStateChange",{state:t})})(e,t)})),{valid:!0,value:t}):{valid:!1,message:"The value must be a boolean."},default:!1}),t("readonly",{processor:"boolean",default:!1}),t("editable_root",{processor:"boolean",default:!0}),t("plugins",{processor:"string[]",default:[]}),t("external_plugins",{processor:"object"}),t("forced_plugins",{processor:"string[]"}),t("model",{processor:"string",default:e.hasPlugin("rtc")?"plugin":"dom"}),t("model_url",{processor:"string"}),t("block_unsupported_drop",{processor:"boolean",default:!0}),t("visual",{processor:"boolean",default:!0}),t("visual_table_class",{processor:"string",default:"mce-item-table"}),t("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),t("iframe_aria_text",{processor:"string",default:"Rich Text Area".concat(e.hasPlugin("help")?". Press ALT-0 for help.":"")}),t("setup",{processor:"function"}),t("init_instance_callback",{processor:"function"}),t("url_converter",{processor:"function",default:e.convertURL}),t("url_converter_scope",{processor:"object",default:e}),t("urlconverter_callback",{processor:"function"}),t("allow_conditional_comments",{processor:"boolean",default:!1}),t("allow_html_data_urls",{processor:"boolean",default:!1}),t("allow_svg_data_urls",{processor:"boolean"}),t("allow_html_in_named_anchor",{processor:"boolean",default:!1}),t("allow_script_urls",{processor:"boolean",default:!1}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("allow_mathml_annotation_encodings",{processor:e=>{const t=k(e,u);return t?{value:e,valid:t}:{valid:!1,message:"Must be an array of strings."}},default:[]}),t("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),t("fix_list_elements",{processor:"boolean",default:!1}),t("preserve_cdata",{processor:"boolean",default:!1}),t("remove_trailing_brs",{processor:"boolean",default:!0}),t("pad_empty_with_br",{processor:"boolean",default:!1}),t("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),t("element_format",{processor:"string",default:"html"}),t("entities",{processor:"string"}),t("schema",{processor:"string",default:"html5"}),t("convert_urls",{processor:"boolean",default:!0}),t("relative_urls",{processor:"boolean",default:!0}),t("remove_script_host",{processor:"boolean",default:!0}),t("custom_elements",{processor:hc}),t("extended_valid_elements",{processor:"string"}),t("invalid_elements",{processor:"string"}),t("invalid_styles",{processor:hc}),t("valid_children",{processor:"string"}),t("valid_classes",{processor:hc}),t("valid_elements",{processor:"string"}),t("valid_styles",{processor:hc}),t("verify_html",{processor:"boolean",default:!0}),t("auto_focus",{processor:e=>u(e)||!0===e}),t("browser_spellcheck",{processor:"boolean",default:!1}),t("protect",{processor:"array"}),t("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),t("deprecation_warnings",{processor:"boolean",default:!0}),t("a11y_advanced_options",{processor:"boolean",default:!1}),t("api_key",{processor:"string"}),t("license_key",{processor:"string"}),t("paste_block_drop",{processor:"boolean",default:!1}),t("paste_data_images",{processor:"boolean",default:!0}),t("paste_preprocess",{processor:"function"}),t("paste_postprocess",{processor:"function"}),t("paste_webkit_styles",{processor:"string",default:"none"}),t("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),t("paste_merge_formats",{processor:"boolean",default:!0}),t("smart_paste",{processor:"boolean",default:!0}),t("paste_as_text",{processor:"boolean",default:!1}),t("paste_tab_spaces",{processor:"number",default:4}),t("text_patterns",{processor:e=>k(e,p)||!1===e?{value:Jl(!1===e?[]:e),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1",trigger:"space"},{start:"##",format:"h2",trigger:"space"},{start:"###",format:"h3",trigger:"space"},{start:"####",format:"h4",trigger:"space"},{start:"#####",format:"h5",trigger:"space"},{start:"######",format:"h6",trigger:"space"},{start:"1.",cmd:"InsertOrderedList",trigger:"space"},{start:"*",cmd:"InsertUnorderedList",trigger:"space"},{start:"-",cmd:"InsertUnorderedList",trigger:"space"},{start:">",cmd:"mceBlockQuote",trigger:"space"},{start:"---",cmd:"InsertHorizontalRule",trigger:"space"}]}),t("text_patterns_lookup",{processor:e=>{return w(e)?{value:(t=e,e=>{const n=t(e);return Jl(n)}),valid:!0}:{valid:!1,message:"Must be a single function"};var t},default:e=>[]}),t("noneditable_class",{processor:"string",default:"mceNonEditable"}),t("editable_class",{processor:"string",default:"mceEditable"}),t("noneditable_regexp",{processor:e=>k(e,cc)?{value:e,valid:!0}:cc(e)?{value:[e],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),t("table_tab_navigation",{processor:"boolean",default:!0}),t("highlight_on_focus",{processor:"boolean",default:!0}),t("xss_sanitization",{processor:"boolean",default:!0}),t("details_initial_state",{processor:e=>{const t=U(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),t("details_serialized_state",{processor:e=>{const t=U(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),t("init_content_sync",{processor:"boolean",default:!1}),t("newdocument_content",{processor:"string",default:""}),t("sandbox_iframes",{processor:"boolean",default:!0}),t("sandbox_iframes_exclusions",{processor:"string[]",default:["youtube.com","youtu.be","vimeo.com","player.vimeo.com","dailymotion.com","embed.music.apple.com","open.spotify.com","giphy.com","dai.ly","codepen.io"]}),t("convert_unsafe_embeds",{processor:"boolean",default:!0}),e.on("ScriptsLoaded",(()=>{t("directionality",{processor:"string",default:Zs.isRtl()?"rtl":void 0}),t("placeholder",{processor:"string",default:lc.getAttrib(e.getElement(),"placeholder")})}))})(i);const r=this.options.get;r("deprecation_warnings")&&((e,t)=>{((e,t)=>{const n=(e=>{const t=fw(e,dw),n=e.forced_root_block;return!1!==n&&""!==n||t.push("forced_root_block (false only)"),se(t)})(e),i=(e=>mw(e,uw))(t),o=i.length>0,r=n.length>0,s="mobile"===t.theme;if(o||r||s){const e="\n- ",t=s?`\n\nThemes:${e}mobile`:"",a=o?`\n\nPlugins:${e}${i.join(e)}`:"",l=r?`\n\nOptions:${e}${n.join(e)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 7.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/7/migration-from-6x/ for more information."+t+a+l)}})(e,t),((e,t)=>{const n=(e=>fw(e,hw))(e),i=(e=>mw(e,pw.map((e=>e.name))))(t),o=i.length>0,r=n.length>0;if(o||r){const e="\n- ",t=o?`\n\nPlugins:${e}${i.map(gw).join(e)}`:"",s=r?`\n\nOptions:${e}${n.join(e)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+t+s)}})(e,t)})(t,o);const s=r("suffix");s&&(n.suffix=s),this.suffix=n.suffix;const a=r("base_url");a&&n._setBaseUrl(a),this.baseUri=n.baseURI;const l=Fc(i);l&&(Xs.ScriptLoader._setReferrerPolicy(l),Ks.DOM.styleSheetLoader._setReferrerPolicy(l));const c=vd(i);x(c)&&Ks.DOM.styleSheetLoader._setContentCssCors(c),ea.languageLoad=r("language_load"),ea.baseURL=n.baseURL,this.setDirty(!1),this.documentBaseURI=new lx(mc(i),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=ld(i),this.hasVisual=wd(i),this.shortcuts=new wI(this),this.editorCommands=new JD(this),XD(this);const d=r("cache_suffix");d&&(tn.cacheSuffix=d.replace(/^[\?\&]+/,"")),this.ui={registry:_I(),styleSheetLoader:void 0,show:C,hide:C,setEnabled:C,isEnabled:N},this.mode=(e=>{const t=Ee("design"),n=Ee({design:{activate:C,deactivate:C,editorReadOnly:!1},readonly:{activate:C,deactivate:C,editorReadOnly:!0}});return(e=>{const t=t=>{pI(e)&&(e=>$(e,(e=>"characterData"===e.type||"childList"===e.type)))(t)&&(e=>{const t=e.undoManager.add();x(t)&&(e.undoManager.undo(),e.undoManager.reset())})(e)},n=new MutationObserver(t);e.on("beforeinput paste cut dragend dragover draggesture dragdrop drop drag",(t=>{pI(e)&&t.preventDefault()})),e.on("BeforeExecCommand",(t=>{"Undo"!==t.command&&"Redo"!==t.command||!pI(e)||t.preventDefault()})),e.on("compositionstart",(()=>{pI(e)&&n.observe(e.getBody(),{characterData:!0,childList:!0,subtree:!0})})),e.on("compositionend",(()=>{if(pI(e)){const e=n.takeRecords();t(e)}n.disconnect()}))})(e),(e=>{(e=>{e.serializer?$w(e):e.on("PreInit",(()=>{$w(e)}))})(e),(e=>{e.on("ShowCaret ObjectSelected",(t=>{Bw(e)&&t.preventDefault()})),e.on("DisabledStateChange",(t=>{t.isDefaultPrevented()||Uw(e,t.state)}))})(e)})(e),{isReadOnly:()=>pI(e),set:i=>((e,t,n,i)=>{if(!(i===n.get()||e.initialized&&Bw(e))){if(!Ce(t,i))throw new Error(`Editor mode '${i}' is invalid`);e.initialized?mI(e,n,t,i):e.on("init",(()=>mI(e,n,t,i)))}})(e,n.get(),t,i),get:()=>t.get(),register:(e,t)=>{n.set(((e,t,n)=>{if(U(fI,t))throw new Error(`Cannot override default mode ${t}`);return{...e,[t]:{...n,deactivate:()=>{try{n.deactivate()}catch(e){console.error(`problem while deactivating editor mode ${t}:`,e)}}}}})(n.get(),e,t))}}})(i),n.dispatch("SetupEditor",{editor:this});const y=Sd(i);w(y)&&y.call(i,i)}render(){(e=>{const t=e.id;Zs.setCode(Lc(e));const n=()=>{TD.unbind(window,"ready",n),e.render()};if(!Fs.Event.domLoaded)return void TD.bind(window,"ready",n);if(!e.getElement())return;const i=hn(e.getElement()),o=gi(i);e.on("remove",(()=>{V(i.dom.attributes,(e=>mi(i,e.name))),hi(i,o)})),e.ui.styleSheetLoader=((e,t)=>jr.forElement(e,{contentCssCors:vd(t),referrerPolicy:Fc(t)}))(i,e),ld(e)?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");const r=e.getElement().form||TD.getParent(t,"form");r&&(e.formElement=r,cd(e)&&!Ko(e.getElement())&&(TD.insertAfter(TD.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=t=>{e.dispatch(t.type,t)},TD.bind(r,"submit reset",e.formEventDelegate),e.on("reset",(()=>{e.resetContent()})),!dd(e)||r.submit.nodeType||r.submit.length||r._mceOldSubmit||(r._mceOldSubmit=r.submit,r.submit=()=>(e.editorManager.triggerSave(),e.setDirty(!1),r._mceOldSubmit(r)))),e.windowManager=Dw(e),e.notificationManager=Ew(e),(e=>"xml"===e.options.get("encoding"))(e)&&e.on("GetContent",(e=>{e.save&&(e.content=TD.encode(e.content))})),hd(e)&&e.on("submit",(()=>{e.initialized&&e.save()})),ud(e)&&(e._beforeUnload=()=>{!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1})},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),((e,t)=>{const n=Xs.ScriptLoader,i=()=>{!e.removed&&(e=>{const t=Jc(e);return!u(t)||x(Ow.get(t))})(e)&&(e=>{const t=ed(e);return x(xw.get(t))})(e)&&SD(e)};((e,t)=>
vendor: 4,359 bytes, line 135
135{const n=Jc(e);if(u(n)&&!ED(n)&&!Ce(Ow.urls,n)){const i=Zc(e),o=i?e.documentBaseURI.toAbsolute(i):`themes/${n}/theme${t}.js`;Ow.load(n,o).catch((()=>{((e,t,n)=>{Mw(e,"ThemeLoadError",Rw("theme",t,n))})(e,o,n)}))}})(e,t),((e,t)=>{const n=ed(e);if("plugin"!==n&&!Ce(xw.urls,n)){const i=td(e),o=u(i)?e.documentBaseURI.toAbsolute(i):`models/${n}/model${t}.js`;xw.load(n,o).catch((()=>{((e,t,n)=>{Mw(e,"ModelLoadError",Rw("model",t,n))})(e,o,n)}))}})(e,t),((e,t)=>{const n=Lc(t),i=jc(t);if(!Zs.hasCode(n)&&"en"!==n){const o=et(i)?i:`${t.editorManager.baseURL}/langs/${n}.js`;e.add(o).catch((()=>{((e,t,n)=>{Mw(e,"LanguageLoadError",Rw("language",t,n))})(t,o,n)}))}})(n,e),((e,t,n)=>{const i=AD(t,"default",n),o=(e=>F.from(Ic(e)).filter(et).map((e=>({url:e,name:F.none()}))))(t).orThunk((()=>AD(t,Dc(t),"")));W((e=>{const t=[],n=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(n);return t})([i,o]),(n=>{e.add(n.url).catch((()=>{((e,t,n)=>{Mw(e,"IconsLoadError",Rw("icons",t,n))})(t,n.url,n.name.getOrUndefined())}))}))})(n,e,t),((e,t)=>{const n=(t,n)=>{Aw.load(t,n).catch((()=>{((e,t,n)=>{Mw(e,"PluginLoadError",Rw("plugin",t,n))})(e,n,t)}))};me(yd(e),((t,i)=>{n(i,t),e.options.set("plugins",bd(e).concat(i))})),W(bd(e),(e=>{!(e=sn.trim(e))||Aw.urls[e]||ED(e)||n(e,`plugins/${e}/plugin${t}.js`)}))})(e,t),n.loadQueue().then(i,i)})(e,e.suffix)})(this)}focus(e){this.execCommand("mceFocus",!1,e)}hasFocus(){return rf(this)}translate(e){return Zs.translate(e)}getParam(e,t,n){const i=this.options;return i.isRegistered(e)||(x(n)?i.register(e,{processor:n,default:t}):i.register(e,{processor:N,default:t})),i.isSet(e)||b(t)?i.get(e):t}hasPlugin(e,t){return!(!U(bd(this),e)||t&&void 0===Aw.get(e))}nodeChanged(e){this._nodeChangeDispatcher.nodeChanged(e)}addCommand(e,t,n){this.editorCommands.addCommand(e,t,n)}addQueryStateHandler(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)}addQueryValueHandler(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)}addShortcut(e,t,n,i){this.shortcuts.add(e,t,n,i)}execCommand(e,t,n,i){return this.editorCommands.execCommand(e,t,n,i)}queryCommandState(e){return this.editorCommands.queryCommandState(e)}queryCommandValue(e){return this.editorCommands.queryCommandValue(e)}queryCommandSupported(e){return this.editorCommands.queryCommandSupported(e)}show(){const e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable="true":(kI.show(e.getContainer()),kI.hide(e.id)),e.load(),e.dispatch("show"))}hide(){const e=this;e.hidden||(e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(kI.hide(e.getContainer()),kI.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(e,t){this.dispatch("ProgressState",{state:e,time:t})}load(e={}){const t=this,n=t.getElement();if(t.removed)return"";if(n){const i={...e,load:!0},o=Ko(n)?n.value:n.innerHTML,r=t.setContent(o,i);return i.no_events||t.dispatch("LoadContent",{...i,element:n}),r}return""}save(e={}){const t=this;let n=t.getElement();if(!n||!t.initialized||t.removed)return"";const i={...e,save:!0,element:n};let o=t.getContent(i);const r={...i,content:o};if(r.no_events||t.dispatch("SaveContent",r),"raw"===r.format&&t.dispatch("RawSaveContent",r),o=r.content,Ko(n))n.value=o;else{!e.is_removing&&t.inline||(n.innerHTML=o);const i=kI.getParent(t.id,"form");i&&SI(i.elements,(e=>e.name!==t.id||(e.value=o,!1)))}return r.element=i.element=n=null,!1!==r.set_dirty&&t.setDirty(!1),o}setContent(e,t){return cw(this,e,t)}getContent(e){return((e,t={})=>{const n=((e,t)=>({...e,format:t,get:!0,getInner:!0}))(t,t.format?t.format:"html");return Cx(e,n).fold(A,(t=>{const n=((e,t)=>Zx(e).editor.getContent(t))(e,t);return Sx(e,n,t)}))})(this,e)}insertContent(e,t){t&&(e=CI({content:e},t)),this.execCommand("mceInsertContent",!1,e)}resetContent(e){void 0===e?cw(this,this.startContent,{format:"raw"}):cw(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(e){const t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.dispatch("dirty")}getContainer(){const e=this;return e.container||(e.container=e.editorContainer||kI.get(e.id+"_parent")),e.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=kI.get(this.id
vendor: 1,649 bytes, line 135
135)),this.targetElm}getWin(){const e=this;if(!e.contentWindow){const t=e.iframeElement;t&&(e.contentWindow=t.contentWindow)}return e.contentWindow}getDoc(){const e=this;if(!e.contentDocument){const t=e.getWin();t&&(e.contentDocument=t.document)}return e.contentDocument}getBody(){var e,t;const n=this.getDoc();return null!==(t=null!==(e=this.bodyElement)&&void 0!==e?e:null==n?void 0:n.body)&&void 0!==t?t:null}convertURL(e,t,n){const i=this,o=i.options.get,r=Ed(i);if(w(r))return r.call(i,e,n,!0,t);if(!o("convert_urls")||"link"===n||p(n)&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length)return e;const s=new lx(e);return"http"!==s.protocol&&"https"!==s.protocol&&""!==s.protocol?e:o("relative_urls")?i.documentBaseURI.toRelative(e):e=i.documentBaseURI.toAbsolute(e,o("remove_script_host"))}addVisual(e){((e,t)=>{((e,t)=>{ew(e).editor.addVisual(t)})(this,t)})(0,e)}setEditableRoot(e){((e,t)=>{e._editableRoot!==t&&(e._editableRoot=t,Bw(e)||(e.getBody().contentEditable=String(e.hasEditableRoot()),e.nodeChanged()),((e,t)=>{e.dispatch("EditableRootStateChange",{state:t})})(e,t))})(this,e)}hasEditableRoot(){return this._editableRoot}remove(){(e=>{if(!e.removed){const{_selectionOverrides:t,editorUpload:n}=e,i=e.getBody(),o=e.getElement();i&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&x(null==o?void 0:o.nextSibling)&&vw.remove(o.nextSibling),(e=>{e.dispatch("remove")})(e),e.editorManager.remove(e),!e.inline&&i&&(e=>{vw.setStyle(e.id,"display",e.orgDisplay)})(e),(e=>{e.dispatch("detach")})(e),vw.remove(e.getContainer()),bw(t),bw(n),e.destroy()}})(this)}destroy(e){((e,t)=>{const{selection:n,dom:i}
vendor: 9,452 bytes, lines 135-144
135=e;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),bw(n),bw(i)),(e=>{const t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,delete t._mceOldSubmit),vw.unbind(t,"submit reset",e.formEventDelegate))})(e),(e=>{const t=e;t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null;const n=e.selection;if(n){const e=n.dom;t.selection=n.win=n.dom=e.doc=null}})(e),e.destroyed=!0):e.remove())})(this,e)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const EI=Ks.DOM,AI=sn.each;let OI,DI=!1,II=[];const PI=e=>{const t=e.type;AI(NI.get(),(n=>{switch(t){case"scroll":n.dispatch("ScrollWindow",e);break;case"resize":n.dispatch("ResizeWindow",e)}}))},MI=e=>{if(e!==DI){const t=Ks.DOM;e?(t.bind(window,"resize",PI),t.bind(window,"scroll",PI)):(t.unbind(window,"resize",PI),t.unbind(window,"scroll",PI)),DI=e}},RI=e=>{const t=II;return II=G(II,(t=>e!==t)),NI.activeEditor===e&&(NI.activeEditor=II.length>0?II[0]:null),NI.focusedEditor===e&&(NI.focusedEditor=null),t.length!==II.length},zI="CSS1Compat"!==document.compatMode,NI={...nI,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"7",minorVersion:"9.1",releaseDate:"2025-05-29",i18n:Zs,activeEditor:null,focusedEditor:null,setup(){const e=this;let t="",n="",i=lx.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(i)&&(i=i.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(i)||(i+="/"));const o=window.tinymce||window.tinyMCEPreInit;if(o)t=o.base||o.baseURL,n=o.suffix;else{const e=document.getElementsByTagName("script");for(let i=0;i<e.length;i++){const o=e[i].src||"";if(""===o)continue;const r=o.substring(o.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(o)){-1!==r.indexOf(".min")&&(n=".min"),t=o.substring(0,o.lastIndexOf("/"));break}}if(!t&&document.currentScript){const e=document.currentScript.src;-1!==e.indexOf(".min")&&(n=".min"),t=e.substring(0,e.lastIndexOf("/"))}}var r;e.baseURL=new lx(i).toAbsolute(t),e.documentBaseURL=i,e.baseURI=new lx(e.baseURL),e.suffix=n,(r=e).on("AddEditor",D(ef,r)),r.on("RemoveEditor",D(tf,r))},overrideDefaults(e){const t=e.base_url;t&&this._setBaseUrl(t);const n=e.suffix;n&&(this.suffix=n),this.defaultOptions=e;const i=e.plugin_base_urls;void 0!==i&&me(i,((e,t)=>{ea.PluginManager.urls[t]=e}))},init(e){const t=this;let n;const i=sn.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," ");let o=e=>{n=e};const r=()=>{let n=0;const s=[];let a;EI.unbind(window,"ready",r),(()=>{const n=e.onpageload;n&&n.apply(t,[])})(),a=ue((e=>tn.browser.isIE()||tn.browser.isEdge()?(zw("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/7/support/#supportedwebbrowsers"),[]):zI?(zw("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):u(e.selector)?EI.select(e.selector):x(e.target)?[e.target]:[])(e)),sn.each(a,(e=>{var n;(n=t.get(e.id))&&n.initialized&&!(n.getContainer()||n.getBody()).parentNode&&(RI(n),n.unbindAllNativeEvents(),n.destroy(!0),n.removed=!0)})),a=sn.grep(a,(e=>!t.get(e.id))),0===a.length?o([]):AI(a,(r=>{((e,t)=>e.inline&&t.tagName.toLowerCase()in i)(e,r)?zw("Could not initialize inline editor on invalid inline target element",r):((e,i,r)=>{const l=new TI(e,i,t);s.push(l),l.on("init",(()=>{++n===a.length&&o(s)})),l.targetElm=l.targetElm||r,l.render()})((e=>{let t=e.id;return t||(t=ke(e,"name").filter((e=>!EI.get(e))).getOrThunk(EI.uniqueId),e.setAttribute("id",t)),t})(r),e,r)}))};return EI.bind(window,"ready",r),new Promise((e=>{n?e(n):o=t=>{e(t)}}))},get(e){return 0===arguments.length?II.slice(0):u(e)?J(II,(t=>t.id===e)).getOr(null):_(e)&&II[e]?II[e]:null},add(e){const t=this,n=t.get(e.id);return n===e||(null===n&&II.push(e),MI(!0),t.activeEditor=e,t.dispatch("AddEditor",{editor:e}),OI||(OI=e=>{const n=t.dispatch("BeforeUnload");if(n.returnValue)return e.preventDefault(),e.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",OI))),e},createEditor(e,t){return this.add(new TI(e,t,this))},remove(e){const t=this;let n;if(e){if(!u(e))return n=e,g(t.get(n.id))?null:(RI(n)&&t.dispatch("RemoveEditor",{editor:n}),0===II.length&&window.removeEventListener("beforeunload",OI),n.remove(),MI(II.length>0),n);AI(EI.select(e),(e=>{n=t.get(e.id),n&&t.remove(n)}))}else for(let e=II.length-1;e>=0;e--)t.remove(II[e])},execCommand(e,t,n){var i;const o=this,r=p(n)?null!==(i=n.id)&&void 0!==i?i:n.index:n;switch(e){case"mceAddEditor":if(!o.get(r)){const e=n.options;new TI(r,e,o).render()}return!0;case"mceRemoveEditor":{const e=o.get(r);return e&&e.remove(),!0}case"mceToggleEditor":{const e=o.get(r);return e?(e.isHidden()?e.show():e.hide(),!0):(o.execCommand("mceAddEditor",!1,n),!0)}}return!!o.activeEditor&&o.activeEditor.execCommand(e,t,n)},triggerSave:()=>{AI(II,(e=>{e.save()}))},addI18n:(e,t)=>{Zs.add(e,t)},translate:e=>Zs.translate(e),setActive(e){const t=this.activeEditor;this.activeEditor!==e&&(t&&t.dispatch("deactivate",{relatedTarget:e}),e.dispatch("activate",{relatedTarget:t})),this.activeEditor=e},_setBaseUrl(e){this.baseURL=new lx(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new lx(this.baseURL)}};NI.setup();const FI=(()=>{const e=qe();return{FakeClipboardItem:e=>({items:e,types:pe(e),getType:t=>ke(e,t).getOrUndefined()}),write:t=>{e.set(t)},read:()=>e.get().getOrUndefined(),clear:e.clear}})(),LI=Math.min,jI=Math.max,BI=Math.round,HI=(e,t,n)=>{let i=t.x,o=t.y;const r=e.w,s=e.h,a=t.w,l=t.h,c=(n||"").split("");return"b"===c[0]&&(o+=l),"r"===c[1]&&(i+=a),"c"===c[0]&&(o+=BI(l/2)),"c"===c[1]&&(i+=BI(a/2)),"b"===c[3]&&(o-=s),"r"===c[4]&&(i-=r),"c"===c[3]&&(o-=BI(s/2)),"c"===c[4]&&(i-=BI(r/2)),UI(i,o,r,s)},UI=(e,t,n,i)=>({x:e,y:t,w:n,h:i}),$I={inflate:(e,t,n)=>UI(e.x-t,e.y-n,e.w+2*t,e.h+2*n),relativePosition:HI,findBestRelativePosition:(e,t,n,i)=>{for(let o=0;o<i.length;o++){const r=HI(e,t,i[o]);if(r.x>=n.x&&r.x+r.w<=n.w+n.x&&r.y>=n.y&&r.y+r.h<=n.h+n.y)return i[o]}return null},intersect:(e,t)=>{const n=jI(e.x,t.x),i=jI(e.y,t.y),o=LI(e.x+e.w,t.x+t.w),r=LI(e.y+e.h,t.y+t.h);return o-n<0||r-i<0?null:UI(n,i,o-n,r-i)},clamp:(e,t,n)=>{let i=e.x,o=e.y,r=e.x+e.w,s=e.y+e.h;const a=t.x+t.w,l=t.y+t.h,c=jI(0,t.x-i),d=jI(0,t.y-o),h=jI(0,r-a),u=jI(0,s-l);return i+=c,o+=d,n&&(r+=c,s+=d,i-=h,o-=u),r-=h,s-=u,UI(i,o,r-i,s-o)},create:UI,fromClientRect:e=>UI(e.left,e.top,e.width,e.height)},qI=(()=>{const e={},t={},n={};return{load:(n,i)=>{const o=`Script at URL "${i}" failed to load`,r=`Script at URL "${i}" did not call \`tinymce.Resource.add('${n}', data)\` within 1 second`;if(void 0!==e[n])return e[n];{const s=new Promise(((e,s)=>{const a=((e,t,n=1e3)=>{let i=!1,o=null;const r=e=>(...t)=>{i||(i=!0,null!==o&&(window.clearTimeout(o),o=null),e.apply(null,t))},s=r(e),a=r(t);return{start:(...e)=>{i||null!==o||(o=window.setTimeout((()=>a.apply(null,e)),n))},resolve:s,reject:a}})(e,s);t[n]=a.resolve,Xs.ScriptLoader.loadScript(i).then((()=>a.start(r)),(()=>a.reject(o)))}));return e[n]=s,s}},add:(i,o)=>{void 0!==t[i]&&(t[i](o),delete t[i]),e[i]=Promise.resolve(o),n[i]=o},has:e=>e in n,get:e=>n[e],unload:t=>{delete e[t],delete n[t]}}})();let WI;try{const e="__storage_test__";WI=window.localStorage,WI.setItem(e,e),WI.removeItem(e)}catch(e){WI=(()=>{let e={},t=[];const n={getItem:t=>e[t]||null,setItem:(n,i)=>{t.push(n),e[n]=String(i)},key:e=>t[e],removeItem:n=>{t=t.filter((e=>e===n)),delete e[n]},clear:()=>{t=[],e={}},length:0};return Object.defineProperty(n,"length",{get:()=>t.length,configurable:!1,enumerable:!1}),n})()}const VI={geom:{Rect:$I},util:{Delay:Wp,Tools:sn,VK:lf,URI:lx,EventDispatcher:eI,Observable:nI,I18n:Zs,LocalStorage:WI,ImageUploader:e=>{const t=Kw(),n=Yw(e,t);return{upload:(t,i=!0)=>n.upload(t,i?Xw(e):void 0)}}},dom:{EventUtils:Fs,TreeWalker:Po,TextSeeker:pa,DOMUtils:Ks,ScriptLoader:Xs,RangeUtils:Sf,Serializer:lw,StyleSheetLoader:Lr,ControlSelection:pf,BookmarkManager:Rp,Selection:sw,Event:Fs.Event},html:{Styles:As,Entities:ns,Node:Jf,Schema:ys,DomParser:wx,Writer:mm,Serializer:gm},Env:tn,AddOnManager:ea,Annotator:Mp,Formatter:l_,UndoManager:d_,EditorCommands:JD,WindowManager:Dw,NotificationManager:Ew,EditorObservable:lI,Shortcuts:wI,Editor:TI,FocusManager:qp,EditorManager:NI,DOM:Ks.DOM,ScriptLoader:Xs.ScriptLoader,PluginManager:Aw,ThemeManager:Ow,ModelManager:xw,IconManager:yw,Resource:qI,FakeClipboard:FI,trim:sn.trim,isArray:sn.isArray,is:sn.is,toArray:sn.toArray,makeMap:sn.makeMap,each:sn.each,map:sn.map,grep:sn.grep,inArray:sn.inArray,extend:sn.extend,walk:sn.walk,resolve:sn.resolve,explode:sn.explode,_addCacheSuffix:sn._addCacheSuffix},KI=sn.extend(NI,VI);(e=>{window.tinymce=e,window.tinyMCE=e})(KI),(e=>{if("object"==typeof module)try{module.exports=e}catch(e){}})(KI)}(),
136/*!
137 * elFinder - file manager for web
138 * Version 2.1.67 (2.1-src Nightly: 9b8438d7b) (2026-04-27)
139 * http://elfinder.org
140 * 
141 * Copyright 2009-2026, Studio 42
142 * Licensed under a 3-clauses BSD license
143 */
144function(e,t){if("function"==typeof define&&define.amd)define(["jquery","jquery-ui"],t);
144else if("undefined"!=typeof exports){var n,i;try{n=require("jquery"),i=require("jquery-ui")}catch(e){}module.exports=t(n,i)}else t(e.jQuery,e.jQuery.ui,!0)}(this,(function(e,t,n){var i,o,r,s,a,l,c,d,h=function(t,n,i){var o,r,s,a,l,c,d,u,p,f,m,g,v,b,y,x,w,_,k,C,S,T,E,A,O=this,D=[],I=["button","tooltip"],P=e(t),M=e.extend(!0,{},e._data(P.get(0),"events")),R=e("<div></div>").append(P.contents()).attr("class",P.attr("class")||"").attr("style",P.attr("style")||""),z=P.attr("id")||P.attr("id","elfauto"+e(".elfinder").length).attr("id"),N="elfinder-"+z,F="mousedown."+N,L="keydown."+N,j="keypress."+N,B="keyup."+N,H=!1,U=!1,$="",q={path:"",url:"",tmbUrl:"",disabled:[],separator:"/",archives:[],extract:[],copyOverwrite:!0,uploadOverwrite:!0,uploadMaxSize:0,jpgQuality:100,tmbCrop:!1,tmbReqCustomData:!1,tmb:!1},W={},V={},K={},G={},X=[],Y={},Q={},J=[],Z={},ee=[],te=[],ne=new O.command(O),ie="auto",oe=400,re=null,se="sounds/",ae="",le=!1,ce=e(document.createElement("audio")).hide().appendTo("body")[0],de=0,he="",ue=null,pe=function(t){var n,i,o,r,s,a,l,c={},d={};O.api>=2.1?(O.commandMap=t.options.uiCmdMap&&Object.keys(t.options.uiCmdMap).length?t.options.uiCmdMap:{},he!==JSON.stringify(O.commandMap)&&(he=JSON.stringify(O.commandMap))):O.options.sync=0,t.init?(V={},G={}):(s=$,n="elfinder-subtree-loaded "+O.res("class","navexpand"),O.res("class","navcollapse"),i=Object.keys(V),o=function(e){if(!V[e])return!0;var t="directory"===V[e].mime,i=V[e].phash;!(!t||c[i]||!d[i]&&O.navHash2Elm(V[e].hash).is(":hidden")&&O.navHash2Elm(i).next(".elfinder-navbar-subtree").children().length>100)||!t&&i===$||Z[e]?t&&(d[i]=!0):(t&&!c[i]&&(c[i]=!0,O.navHash2Elm(i).removeClass(n).next(".elfinder-navbar-subtree").empty()),ge(V[e]))},r=function(){i.length&&(ue&&ue._abort(),ue=O.asyncJob(o,i,{interval:20,numPerOnce:100}).done((function(){var t=O.storage("hide")||{items:{}};Object.keys(K).length&&e.each(K,(function(e){t.items[e]||delete K[e]}))})))},O.trigger("filesgc").one("filesgc",(function(){i=[]})),O.one("opendone",(function(){s!==$&&(P.data("lazycnt")?O.one("lazydone",r):r())}))),O.sorters={},$=t.cwd.hash,fe(t.files),V[$]?(l=O.diff([t.cwd],!0)).changed.length&&(fe(l.changed,"change"),O.change({changed:l.changed})):fe([t.cwd]),t.changed&&t.changed.length&&fe(t.changed,"change"),a=JSON.stringify(O.sorters),ae!==a&&(O.trigger("sorterupdate"),ae=a),O.lastDir($),O.autoSync()},fe=function(t,n){n=n||"files";var i,o,r,s,a,l=["sizeInfo","encoding"],c={name:!0,perm:!0,date:!0,size:!0,kind:!0},d=!O.sorters._checked&&"files"===n,h=t.length,u=function(t){var n=t||{},i=[];e.each(O.sortRules,(function(e){(c[e]||void 0!==n[e]||"mode"===e&&void 0!==n.perm)&&i.push(e)})),O.sorters=O.arrayFlip(i,!0),O.sorters._checked=!0},p={},f=O.storage("hide")||{},m=f.items||{};for(o=0;o<h;o++)if(i=Object.assign({},t[o]),a=!(f.show||!m[i.hash]),i.name&&i.hash&&i.mime){if(a||(d&&i.phash===$&&(u(i),d=!1),!i.phash||"add"!==n&&("change"!==n||V[i.hash]&&i.size===V[i.hash])||(s=O.parents(i.phash))&&e.each(s,(function(){p[this]=!0}))),V[i.hash]){for(r=0;r<l.length;r++)V[i.hash][l[r]]&&!i[l[r]]&&(i[l[r]]=V[i.hash][l[r]]);i.sizeInfo&&!i.size&&(i.size=i.sizeInfo.size),ge(V[i.hash],!0)}m[i.hash]&&(K[i.hash]=i),a?(h--,t.splice(o--,1)):(V[i.hash]=i,"directory"!==i.mime||G[i.hash]||(G[i.hash]={}),i.phash&&(G[i.phash]||(G[i.phash]={}),G[i.phash][i.hash]=!0))}e.each(Object.keys(p),(function(){var e=V[this];e&&e.sizeInfo&&delete e.sizeInfo})),d&&u()},me=function(t){var n,i=t.length,o={},r=function(t){var i=V[t];i&&("directory"===i.mime&&(o[t]&&delete O.roots[o[t]],e.each(O.leafRoots,(function(n,i){var o,r;-1!==(o=e.inArray(t,i))&&(1===i.length?((r=Object.assign({},V[n]))&&r._realStats&&(e.each(r._realStats,(function(e,t){r[e]=t})),me(V[n]._realStats),O.change({changed:[r]})),delete O.leafRoots[n]):O.leafRoots[n].splice(o,1))}
144)),O.searchStatus.state<2&&e.each(V,(function(e,n){n.phash==t&&r(e)}))),i.phash&&(n=O.parents(i.phash))&&e.each(n,(function(){s[this]=!0})),ge(V[t]))},s={};for(e.each(O.roots,(function(e,t){o[t]=e}));i--;)r(t[i]);e.each(Object.keys(s),(function(){var e=V[this];e&&e.sizeInfo&&delete e.sizeInfo}))},ge=function(e,t){var n=e.hash,i=e.phash;i&&G[i]&&delete G[i][n],t||(G[n]&&delete G[n],O.optionsByHashes[n]&&delete O.optionsByHashes[n]),delete V[n]},ve=0,be=[],ye=null,xe=null,we=function(t){var n,i=t.keyCode,o=!(!t.ctrlKey&&!t.metaKey),r="mousedown"===t.type;!r&&(O.keyState.keyCode=i),O.keyState.ctrlKey=o,O.keyState.shiftKey=t.shiftKey,O.keyState.metaKey=t.metaKey,O.keyState.altKey=t.altKey,r||("keyup"!==t.type?H&&(e.each(Q,(function(e,n){n.type==t.type&&n.keyCode==i&&n.shiftKey==t.shiftKey&&n.ctrlKey==o&&n.altKey==t.altKey&&(t.preventDefault(),t.stopPropagation(),n.callback(t,O),O.debug("shortcut-exec",e+" : "+n.description))})),i!=e.ui.keyCode.TAB||e(t.target).is(":input")||t.preventDefault(),"keydown"===t.type&&i==e.ui.keyCode.ESCAPE&&(P.find(".ui-widget:visible").length||O.clipboard().length&&O.clipboard([]),e.ui.ddmanager&&(n=e.ui.ddmanager.current)&&n.helper&&n.cancel(),O.toHide(P.find(".ui-widget.elfinder-button-menu.elfinder-frontmost:visible")),O.trigger("keydownEsc",t))):O.keyState.keyCode=null)},_e=new Date,ke=window.parent!==window,Ce=function(){var t,n;if(ke)try{(n=e("iframe",window.parent.document)).length&&e.each(n,(function(n,i){if(i.contentWindow===window)return t=e(i),!1}))}catch(e){}return t}();n||(n={}),O.UA.Mobile&&e(window).on("orientationchange."+N,(function(){var e=(screen&&screen.orientation&&screen.orientation.angle||window.orientation||0)+0;-90===e&&(e=270),O.UA.Angle=e,O.UA.Rotated=e%180!=0})).trigger("orientationchange."+N),n.bootCallback&&"function"==typeof n.bootCallback&&(u=i,p=n.bootCallback,i=function(e,t){u&&"function"==typeof u&&u.call(this,e,t),p.call(this,e,t)}),delete n.bootCallback,this.api=null,this.newAPI=!1,this.oldAPI=!1,this.netDrivers=[],this.baseUrl="",this.i18nBaseUrl="",this.workerBaseUrl="",this.cssloaded=!1,this.theme=null,this.mimesCanMakeEmpty={},this.bootCallback,this.reloadCallback,this.id=z,this.storage=function(){try{return"localStorage"in window&&null!==window.localStorage?(O.UA.Safari&&(window.localStorage.setItem("elfstoragecheck",1),window.localStorage.removeItem("elfstoragecheck")),O.localStorage):O.cookie}catch(e){return O.cookie}}(),this.pauseUnloadCheck=function(e,t){if(void 0===e)return le;le=!!e,e&&!t&&requestAnimationFrame((function(){le=!1}))},this.options=Object.assign({},this._options),n.uiOptions&&n.uiOptions.toolbar&&Array.isArray(n.uiOptions.toolbar)&&e.isPlainObject(n.uiOptions.toolbar[n.uiOptions.toolbar.length-1])&&(O.options.uiOptions.toolbarExtra=Object.assign(O.options.uiOptions.toolbarExtra||{},n.uiOptions.toolbar.pop())),(f=function(t,n){e.isPlainObject(t)&&e.each(t,(function(t,i){e.isPlainObject(i)?(n[t]||(n[t]={}),f(i,n[t])):n[t]=i}))})(n,O.options),this.options.uiOptions.toolbar.push(this.options.uiOptions.toolbarExtra),delete this.options.uiOptions.toolbarExtra,this.toUnbindEvents={},this.bind=function(e,t,n){var i,o;if(t&&("function"==typeof t||"function"==typeof t.done))for(o=(e=(""+e).toLowerCase().replace(/^\s+|\s+$/g,"").split(/\s+/)).length,i=0;i<o;i++)void 0===Y[e[i]]&&(Y[e[i]]=[]),Y[e[i]][n?"unshift":"push"](t);return this},this.unbind=function(t,n){var i,o,r,s;for(o=(t=(""+t).toLowerCase().split(/\s+/)).length,i=0;i<o;i++)(r=Y[t[i]])&&(s=e.inArray(n,r))>-1&&r.splice(s,1);return n=null,this},this.trigger=function(t,n,i){var o,r,s,a,l=t.toLowerCase(),c="object"==typeof n,d=Y[l]||[],h=[];if(this.debug("event-"+l,n),c&&void 0!==i||(i=!0),r=d.length){for(a=e.Event(l),n&&(n._getEvent=function(){return a}),i&&(a.data=n),o=0;o<r;o++)if(d[o])if(d[o].done)h.push(d[o].done);else{if(d[o].length&&!i){if(void 0===s)try{s=JSON.stringify(n)}catch(e){s=!1}a.data=s?JSON.parse(s):n}try{if(!1===d[o].call(a,a,this)||a.isDefaultPrevented()){this.debug("event-stoped",a.type);break}}catch(e){window.console&&window.console.log&&window.console.log(e)}}if(r=h.length)for(o=0;o<r;o++)try{if(!1===h[o].call(a,a,this)||a.isDefaultPrevented()){this.debug("event-stoped",a.type+"(done)");break}}catch(e){window.console&&window.console.log&&window.console.log(e)}this.toUnbindEvents[l]&&this.toUnbindEvents[l].length&&(e.each(this.toUnbindEvents[l],(function(e,t){O.unbind(t.type,t.callback)})),delete this.toUnbindEvents[l])}return this},this.getListeners=function(e){return e?Y[e.toLowerCase()]:Y},this.baseUrl=function(){var t,n,i;return O.options.baseUrl?O.options.baseUrl:(i="",t=null,e("head > script").each((function(){if(this.src&&this.src.match(/js\/elfinder(?:-[a-z0-9_-]+)?\.(?:min|full)\.js(?:$|\?)/i))return t=e(this),!1})),t&&((i=t.attr("src").replace(/js\/[^\/]+$/,"")).match(/^(https?\/\/|\/)/)||(n=e("head > base[href]").attr("href"))&&(i=n.replace(/\/$/,"")+"/"+i)),""!==i?O.options.baseUrl=i:(O.options.baseUrl||(O.options.baseUrl="./"),i=O.options.baseUrl),i)}(),this.i18nBaseUrl=(this.options.i18nBaseUrl||this.baseUrl+"js/i18n").replace(/\/$/,"")+"/",this.workerBaseUrl=(this.options.workerBaseUrl||this.baseUrl+"js/worker").replace(/\/$/,"")+"/",this.options.maxErrorDialogs=Math.max(1,parseInt(this.options.maxErrorDialogs||5)),q.dispInlineRegex=this.options.dispInlineRegex,this.options.cssAutoLoad&&(m=O.baseUrl,g=e('head > link[href$="css/elfinder.min.css"],link[href$="css/elfinder.full.css"]:first').length,v=function(){P.data("cssautoloadHide")&&(P.data("cssautoloadHide").remove(),P.removeData("cssautoloadHide"))},b=function(){O.cssloaded||(v(),O.cssloaded=!0,O.trigger("cssloaded"))},g||(O.cssloaded=null),Array.isArray(O.options.cssAutoLoad)&&(O.options.themes.default?!0===O.cssloaded?O.loadCss(O.options.cssAutoLoad):O.bind("cssloaded",(function(){O.loadCss(O.options.cssAutoLoad)}
144)):(O.options.themes=Object.assign({default:{name:"default",cssurls:O.options.cssAutoLoad}},O.options.themes),O.options.theme||(O.options.theme="default"))),null===O.cssloaded&&(P.addClass("elfinder").data("cssautoloadHide",e("<style>.elfinder{visibility:hidden;overflow:hidden}</style>")),e("head").append(P.data("cssautoloadHide")),O.options.themes.default||(O.options.themes=Object.assign({default:{name:"default",cssurls:"css/theme.css",author:"elFinder Project",license:"3-clauses BSD"}},O.options.themes),O.options.theme||(O.options.theme="default")),requestAnimationFrame((function(){"hidden"===P.css("visibility")?O.loadCss([m+"css/elfinder.min.css"],{dfd:e.Deferred().done((function(){b()})).fail((function(){v(),O.cssloaded||(O.cssloaded=!1,O.bind("init",(function(){O.cssloaded||O.error(["errRead","CSS (elfinder.min)"])})))}))}):b()})))),x=O.options.themes,(w=Object.keys(x||{})).length&&(x[y=O.storage("theme")||O.options.theme]||(y=w[0]),O.cssloaded?O.changeTheme(y):O.bind("cssloaded",(function(){O.changeTheme(y)}))),this.optionProperties={icon:void 0,csscls:void 0,tmbUrl:void 0,uiCmdMap:{},netkey:void 0,disabled:[]},ke||this.options.enableAlways||2!==e("body").children().length||(this.options.enableAlways=!0),!0===this.options.debug?this.options.debug="all":Array.isArray(this.options.debug)?(_={},e.each(O.options.debug,(function(){_[this]=!0})),O.options.debug=_):this.options.debug=!1,this.noConflicts={},this.noConflict=function(){e.each(I,(function(t,n){e.fn[n]&&"function"==typeof e.fn[n].noConflict&&(O.noConflicts[n]=e.fn[n].noConflict())}))},this.noConflict(),this.isCORS=!1,function(){if(void 0!==O.options.cors&&null!==O.options.cors)O.isCORS=!!O.options.cors;else{var t,i=document.createElement("a"),o=window.location.protocol,r=function(e){return"https:"===(e=e&&":"!==e?e:o)?/\:443$/:/\:80$/},s=window.location.host.replace(r(o),"");i.href=n.url,n.urlUpload&&n.urlUpload!==n.url&&((t=document.createElement("a")).href=n.urlUpload),(s!==i.host.replace(r(i.protocol),"")||":"!==i.protocol&&""!==i.protocol&&o!==i.protocol||t&&(s!==t.host.replace(r(t.protocol),"")||":"!==t.protocol&&""!==t.protocol&&o!==t.protocol))&&(O.isCORS=!0)}O.isCORS&&(e.isPlainObject(O.options.customHeaders)||(O.options.customHeaders={}),e.isPlainObject(O.options.xhrFields)||(O.options.xhrFields={}),O.options.requestType="post",O.options.customHeaders["X-Requested-With"]="XMLHttpRequest",O.options.xhrFields.withCredentials=!0)}(),this.requestType=/^(get|post)$/i.test(this.options.requestType)?this.options.requestType.toLowerCase():"get",s=Math.max(parseInt(this.options.requestMaxConn),1),this.optsCustomData=e.isPlainObject(this.options.customData)?this.options.customData:{},this.customData=Object.assign({},this.optsCustomData),this.prevCustomData=null,this.customHeaders=e.isPlainObject(this.options.customHeaders)?this.options.customHeaders:{},this.csrfHeaderName="X-elFinder-CSRF",this.csrfResponseKey="csrf",this.csrfReloadKey="csrfReload",this.setCsrfToken=function(e){"string"==typeof e&&e?O.customHeaders[O.csrfHeaderName]=e:delete O.customHeaders[O.csrfHeaderName]},this.isCsrfReloadResponse=function(e,t){return!(!e||403!==e.status||e._csrfRefresh||!t||!t[O.csrfReloadKey])},this.refreshCsrfToken=function(){var e=O.cwd(),t=e&&e.hash||O.lastDir("")||O.startDir();return xe&&"pending"===xe.state()?xe:xe=O.request({data:{cmd:"open",target:t,init:1,tree:1},preventDefault:!0,preventFail:!0,_csrfRefresh:!0}).always((function(){xe=null}))},this.handleCsrfReload=function(e,t){return!!O.isCsrfReloadResponse(e,t)&&(O.refreshCsrfToken(),!0)},this.xhrFields=e.isPlainObject(this.options.xhrFields)?this.options.xhrFields:{},this.replaceXhrSend=function(){d||(d=XMLHttpRequest.prototype.send),XMLHttpRequest.prototype.send=function(){var t=this;return O.customHeaders&&e.each(O.customHeaders,(function(e){t.setRequestHeader(e,this)})),O.xhrFields&&e.each(O.xhrFields,(function(e){e in t&&(t[e]=this)})),d.apply(this,arguments)}},this.restoreXhrSend=function(){d&&(XMLHttpRequest.prototype.send=d)},this.abortCmdsOnOpen=this.options.abortCmdsOnOpen||["tmb","parents"],this.navPrefix="nav"+(h.prototype.uniqueid?h.prototype.uniqueid:"")+"-",this.cwdPrefix=h.prototype.uniqueid?"cwd"+h.prototype.uniqueid+"-":"",++h.prototype.uniqueid,this.uploadURL=n.urlUpload||n.url,this.namespace=N,this.today=new Date(_e.getFullYear(),_e.getMonth(),_e.getDate()).getTime()/1e3,this.yesterday=this.today-86400,a=this.options.UTCDate?"UTC":"",this.getHours="get"+a+"Hours",this.getMinutes="get"+a+"Minutes",this.get
144Seconds="get"+a+"Seconds",this.getDate="get"+a+"Date",this.getDay="get"+a+"Day",this.getMonth="get"+a+"Month",this.getFullYear="get"+a+"FullYear",this.zIndex,this.searchStatus={state:0,query:"",target:"",mime:"",mixed:!1,ininc:!1},this.lang=this.storage("lang")||this.options.lang,"jp"===this.lang&&(this.lang=this.options.lang="ja"),this.viewType=this.storage("view")||this.options.defaultView||"icons",this.sortType=this.storage("sortType")||this.options.sortType||"name",this.sortOrder=this.storage("sortOrder")||this.options.sortOrder||"asc",this.sortStickFolders=this.storage("sortStickFolders"),null===this.sortStickFolders?this.sortStickFolders=!!this.options.sortStickFolders:this.sortStickFolders=!!this.sortStickFolders,this.sortAlsoTreeview=this.storage("sortAlsoTreeview"),null===this.sortAlsoTreeview||null===this.options.sortAlsoTreeview?this.sortAlsoTreeview=!!this.options.sortAlsoTreeview:this.sortAlsoTreeview=!!this.sortAlsoTreeview,this.sortRules=e.extend(!0,{},this._sortRules,this.options.sortRules),e.each(this.sortRules,(function(e,t){"function"!=typeof t&&delete O.sortRules[e]})),this.compare=this.compare.bind(this),this.notifyDelay=this.options.notifyDelay>0?parseInt(this.options.notifyDelay):500,this.draggingUiHelper=null,this.droppable={greedy:!0,tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-navbar-dir,.elfinder-cwd-file,.elfinder-cwd-filename",hoverClass:this.res("class","adroppable"),classes:{"ui-droppable-hover":this.res("class","adroppable")},autoDisable:!0,drop:function(t,n){var i,o,r,s=e(this),a=e.grep(n.helper.data("files")||[],(function(e){return!!e})),l=[],c=[],d=[],h=n.helper.hasClass("elfinder-drag-helper-plus"),u="class";if(void 0===t.button||n.helper.data("namespace")!==N||!O.insideWorkzone(t.pageX,t.pageY))return!1;for(o=s.hasClass(O.res(u,"cwdfile"))?O.cwdId2Hash(s.attr("id")):s.hasClass(O.res(u,"navdir"))?O.navId2Hash(s.attr("id")):$,i=a.length;i--;)(r=a[i])!=o&&V[r].phash!=o?l.push(r):(h&&r!==o&&V[o].write?c:d).push(r);if(d.length)return!1;n.helper.data("droped",!0),c.length&&(n.helper.hide(),O.exec("duplicate",c,{_userAction:!0})),l.length&&(n.helper.hide(),O.clipboard(l,!h),O.exec("paste",o,{_userAction:!0},o).always((function(){O.clipboard([]),O.trigger("unlockfiles",{files:a})})),O.trigger("drop",{files:a}))}},this.enabled=function(){return H&&this.visible()},this.visible=function(){return P[0].elfinder&&P.is(":visible")},this.isRoot=function(e){return!(!e.isroot&&e.phash)},this.root=function(t,n){var i,o;if(t=t||$,!n&&(e.each(O.roots,(function(e,n){if(0===t.indexOf(e))return i=n,!1})),i))return i;for(i=V[t];i&&i.phash&&(n||!i.isroot);)i=V[i.phash];if(i)return i.hash;for(;o in V&&V.hasOwnProperty(o);)if("directory"===(i=V[o]).mime&&!i.phash&&i.read)return i.hash;return""},this.cwd=function(){return V[$]||{}},this.option=function(t,n){var i,o;return n=n||$,O.optionsByHashes[n]&&void 0!==O.optionsByHashes[n][t]?O.optionsByHashes[n][t]:!O.hasVolOptions||$===n||(o=O.file(n))&&o.phash===$?W[t]||"":(i="",e.each(O.volOptions,(function(e,o){if(0===n.indexOf(e))return i=o[t]||"",!1})),i)},this.getDisabledCmds=function(t,n){var i={hidden:!0};return Array.isArray(t)||(t=[t]),e.each(t,(function(e,t){var n=O.option("disabledFlip",t);n&&Object.assign(i,n)})),n?i:Object.keys(i)},this.file=function(e,t){return e?V[e]||(t?K[e]:void 0):void 0},this.files=function(t){var n={};return t?G[t]?(e.each(G[t],(function(e){V[e]?n[e]=V[e]:delete G[t][e]})),Object.assign({},n)):{}:Object.assign({},V)},this.parents=function(e){for(var t,n=[];e&&(t=this.file(e));)n.unshift(t.hash),e=t.phash;return n},this.path2array=function(e,t){for(var n,i=[];e;){if(!(n=V[e])||!n.hash){i=[];break}i.unshift(t&&n.i18?n.i18:n.name),e=n.isroot?null:n.phash}return i},this.path=function(t,n,i){var o=V[t]&&V[t].path?V[t].path:this.path2array(t,n).join(W.separator);if(i&&V[t]){i=Object.assign({notify:{type:"parents",cnt:1,hideCnt:!0}},i);var r,s=e.Deferred(),a=i.notify,l=!1,c=function(){O.request({data:{cmd:"parents",target:V[t].phash},notify:a,preventFail:!0}).done(d).fail((function(){s.reject()}))},d=function(){O.one("parentsdone",(function(){""===(o=O.path(t,n))&&l?(l=!1,c()):(a&&(clearTimeout(r),a.cnt=-parseInt(a.cnt||0),O.notify(a)),s.resolve(o))}
144))};return o?s.resolve(o):(O.ui.tree?(a&&(r=setTimeout((function(){O.notify(a)}),O.notifyDelay)),l=!0,d(!0)):c(),s)}return o},this.url=function(t,n){var i,o=V[t],r=n||{},s=r.async||!1,a=r.temporary||!1,l=r.onetime&&O.option("onetimeUrl",t)||!1,c=r.absurl||!1,d=s||l?e.Deferred():null,h=function(e){return e&&c&&(e=O.convAbsUrl(e)),e},u=function(n){if(n)return h(n);if(o.url)return h(o.url);if(void 0===i&&(i=p()),i)return h(i+e.map(O.path2array(t),(function(e){return encodeURIComponent(e)})).slice(1).join("/"));var r=Object.assign({},O.customData,{cmd:"file",target:o.hash});return O.oldAPI&&(r.cmd="open",r.current=o.phash),h(O.options.url+(-1===O.options.url.indexOf("?")?"?":"&")+e.param(r,!0))},p=function(){return O.option("url",!O.isRoot(o)&&o.phash||o.hash)};if(!o||!o.read)return s?d.resolve(""):"";if(!l||o.url&&"1"!=o.url||(i=p()))if("1"==o.url||a&&!o.url&&!(i=p()))this.request({data:{cmd:"url",target:t,options:{temporary:a?1:0}},preventDefault:!0,options:{async:s},notify:s?{type:a?"file":"url",cnt:1,hideCnt:!0}:{},progressBar:r.progressBar}).done((function(e){o.url=e.url||""})).fail((function(){o.url=""})).always((function(){var e;if(o.url&&a&&(e=o.url,o.url="1"),!s)return u(e);d.resolve(u(e))}));else{if(!s)return u();d.resolve(u())}else s=!0,this.request({data:{cmd:"url",target:t,options:{onetime:1}},preventDefault:!0,options:{async:s},notify:{type:"file",cnt:1,hideCnt:!0},progressBar:r.progressBar}).done((function(e){d.resolve(h(e.url||""))})).fail((function(){d.resolve("")}));return s?d:void 0},this.forExternalUrl=function(e,t){var n={async:!0,absurl:!0};return n[O.option("onetimeUrl",e)?"onetime":"temporary"]=!0,O.url(e,Object.assign({},t,n))},this.openUrl=function(t,n,i,o){var r=V[t],s="",a=(o||{}).onetimeSize||5242880;return r&&r.read?n&&"sameorigin"!==n||(r.url?1!=r.url&&(s=r.url):W.url&&0===r.hash.indexOf(O.cwd().volumeid)&&(s=W.url+e.map(this.path2array(t),(function(e){return encodeURIComponent(e)})).slice(1).join("/")),n&&!this.isSameOrigin(s)||!s)?i&&this.hasParrotHeaders()?(o?delete o.onetimeSize:o={},!o.onetime&&!o.temporary&&r.size>a&&(r.mime.match(/^video|audio/)?o.temporary=!0:o.onetime=!0),o.onetime||o.temporary?this.url(r.hash,Object.assign({async:!0},o)).done((function(e){i(e)})).fail((function(){i("")})):this.getContents(t,"blob",o).done((function(e){s=(window.URL||window.webkitURL).createObjectURL(e),i(s)})).fail((function(){i("")}))):(s=(s=this.options.url)+(-1===s.indexOf("?")?"?":"&")+(this.oldAPI?"cmd=open&current="+r.phash:"cmd=file")+"&target="+r.hash+"&_t="+(r.ts||parseInt(+new Date/1e3)),!0===n&&(s+="&download=1"),e.each(this.customData,(function(e,t){s+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)})),i?void i(s):s):(s+=(s.match(/\?/)?"&":"?")+"_".repeat((s.match(/[\?&](_+)t=/g)||["&t="]).sort().shift().match(/[\?&](_*)t=/)[1].length+1)+"t="+(r.ts||parseInt(+new Date/1e3)),i?void i(s):s):""},this.tmb=function(t){var n,i,o="elfinder-cwd-bgurl",r="",s={},a=0;return!(!e.isPlainObject(t)||(O.searchStatus.state&&0!==t.hash.indexOf(O.cwd().volumeid)?(n=O.option("tmbUrl",t.hash),i=O.option("tmbCrop",t.hash)):(n=W.tmbUrl,i=W.tmbCrop),i&&(o+=" elfinder-cwd-bgurl-crop"),"self"===n&&0===t.mime.indexOf("image/")?(r=O.openUrl(t.hash),o+=" elfinder-cwd-bgself"):(O.oldAPI||n)&&t&&t.tmb&&1!=t.tmb?r=n+t.tmb:O.newAPI&&t&&t.tmb&&1!=t.tmb&&(r=t.tmb),!r))&&("self"!==n&&(t.ts&&(s._t=t.ts),W.tmbReqCustomData&&Object.keys(this.customData).length&&(s=Object.assign(s,this.customData)),Object.keys(s).length&&(r+=r.match(/\?/)?"&":"?",e.each(s,(function(e,t){r+=(0==a++?"":"&")+encodeURIComponent(e)+"="+encodeURIComponent(t)})))),{url:r,className:o})},this.selected=function(){return X.slice(0)},this.selectedFiles=function(){return e.map(X,(function(e){return V[e]?Object.assign({},V[e]):null}))},this.fileByName=function(e,t){var n;for(n in V)if(V.hasOwnProperty(n)&&V[n].phash==t&&V[n].name==e)return V[n]},this.validResponse=function(e,t){return t.error||this.rules[this.rules[e]?e:"defaults"](t)},this.returnBytes=function(e){var t;return isNaN(e)?(e||(e=""),t=(e=e.replace(/b$/i,"")).charAt(e.length-1).toLowerCase(),e=e.replace(/[tgmk]$/i,""),"t"==t?e=1024*e*1024*1024*1024:"g"==t?e=1024*e*1024*1024:"m"==t?e=1024*e*1024:"k"==t&&(e*=1024),e=isNaN(e)?0:parseInt(e)):(e=parseInt(e))<1&&(e=0),e},this.request=function(t){var n,i,o,r,a=this,l=this.options,c=e.Deferred(),d=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),h=Object.assign({},a.customData,{mimes:l.onlyMimes},t.data||t),u=h.cmd,p="binary"===(t.options||{}).dataType,f=!t.asNotOpen&&"open"===u,m=1===h.tree,g=!(p||t.preventDefault||t.preventFail),v=!(p||t.preventDefault||t.preventDone),b=t.progressVal||20,y=null,x=!1,w=t.progressBar?{}:t.notify?Object.assign({progress:b*t.notify.cnt},t.notify):{},_=!!t.cancel,k=p||!!t.raw,C=t.syncOnFail,S=!!t.lazy,T=t.prepare,E=t.navigate,A=(t.options||{}).cache,O=Object.assign({url:l.url,async:!0,type:this.requestType,dataType:"json",cache:a.api>=2.1029,data:h,headers:this.customHeaders,xhrFields:this.xhrFields,progress:function(e){var n=e.loaded/e.total*100;
144if(y&&clearTimeout(y),t.progressBar)try{t.progressBar.width(n+"%")}catch(e){}else x&&w.type&&(n*=w.cnt,b<n&&(a.notify({type:w.type,progress:n-b,cnt:0,hideCnt:w.hideCnt}),b=n));if(t.progress)try{t.progress(e)}catch(e){}}},t.options||{}),D=function(t){t.warning&&a.error(t.warning),f?pe(t):a.updateCache(t),a.lazy((function(){t.removed&&t.removed.length&&a.remove(t),t.added&&t.added.length&&a.add(t),t.changed&&t.changed.length&&a.change(t)})).then((function(){return a.lazy((function(){a.trigger(u,t,!1)}))})).then((function(){return a.lazy((function(){a.trigger(u+"done")}))})).then((function(){t.toasts&&Array.isArray(t.toasts)&&e.each(t.toasts,(function(){this.msg&&a.toast(this)})),t.sync&&a.sync()}))},I=function(e,t){var n,i,o=a.options.debug;switch(t){case"abort":n=e.quiet?"":["errConnect","errAbort"];break;case"timeout":n=["errConnect","errTimeout"];break;case"parsererror":n=["errResponse","errDataNotJSON"],e.responseText&&(!$||o&&("all"===o||o["backend-error"]))&&n.push(e.responseText);break;default:if(e.responseText)try{i=JSON.parse(e.responseText),e._elfinderResponse=i,i&&i.error&&(n=i.error)}catch(e){}if(!n)if(403==e.status)n=["errConnect","errAccess","HTTP error "+e.status];else if(404==e.status)n=["errConnect","errNotFound","HTTP error "+e.status];else if(e.status>=500)n=["errResponse","errServerError","HTTP error "+e.status];else{if(414==e.status&&"get"===O.type)return O.type="post",a.abortXHR(e),void(c.xhr=e=a.transport.send(O).fail(n).done(P));n=e.quiet?"":["errConnect","HTTP error "+e.status]}}a.trigger(u+"done"),c.reject({error:n},e,t)},P=function(t){if(a.currentReqCmd=u,t.debug&&a.responseDebug(t),a.setCustomHeaderByXhr(i),k)return a.abortXHR(i),t&&t.debug&&a.debug("backend-debug",t),c.resolve(t);if(!t)return c.reject({error:["errResponse","errDataEmpty"]},i,t);if(!e.isPlainObject(t))return c.reject({error:["errResponse","errDataNotJSON"]},i,t);if(f&&h.init&&Object.prototype.hasOwnProperty.call(t,a.csrfResponseKey)&&a.setCsrfToken(t[a.csrfResponseKey]),t.error)return f&&e.each(a.leafRoots,(function(t,n){a.leafRoots[t]=e.grep(n,(function(e){return e!==h.target}))})),c.reject({error:t.error},i,t);var n=function(){var n,o=function(n){a.leafRoots[h.target]&&t[n]&&e.each(a.leafRoots[h.target],(function(e,i){var o;(o=a.file(i))&&t[n].push(o)}))},r=function(){a.textMimes={},e.each(a.res("mimes","text"),(function(){a.textMimes[this.toLowerCase()]=!0}))};if(f&&!m?o("files"):"tree"===u&&o("tree"),t=a.normalize(t),!a.validResponse(u,t))return c.reject({error:t.norError||"errResponse"},i,t);f&&(a.api||(a.api=t.api||1,"2.0"==a.api&&void 0!==t.options.uploadMaxSize&&(a.api="2.1"),a.newAPI=a.api>=2,a.oldAPI=!a.newAPI),t.textMimes&&Array.isArray(t.textMimes)&&(a.resources.mimes.text=t.textMimes,r()),!a.textMimes&&r(),t.options&&(W=Object.assign({},q,t.options)),t.netDrivers&&(a.netDrivers=t.netDrivers),t.maxTargets&&(a.maxTargets=t.maxTargets),h.init&&(a.uplMaxSize=a.returnBytes(t.uplMaxSize),a.uplMaxFile=t.uplMaxFile?Math.min(parseInt(t.uplMaxFile),50):20)),"function"==typeof T&&T(t),E&&(n=E.target||"added",t[n]&&t[n].length&&a.one(u+"done",(function(){var i=t[n],o=a.findCwdNodes(i),r=function(){var t=a.cwd().hash;return e.map(i,(function(e){return e.phash&&t===e.phash?e.hash:null}))},s=r(),l=function(t){var n,i,o,l=void 0,c=t.action?t.action.data:void 0;return(c||s.length)&&t.action&&(i=t.action.msg)&&(n=t.action.cmd)&&(!t.action.cwdNot||t.action.cwdNot!==a.cwd().hash)&&(o=t.action.done,c=t.action.data,l=e("
144<div></div>").append(e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"><span class="ui-button-text">'+a.i18n(i)+"</span></button>").on("mouseenter mouseleave",(function(t){e(this).toggleClass("ui-state-hover","mouseenter"==t.type)})).on("click",(function(){a.exec(n,c||s,{_userAction:!0,_currentType:"toast",_currentNode:e(this)}),o&&a.one(n+"done",(function(){"function"==typeof o?o():"select"===o&&a.trigger("selectfiles",{files:r()})}))})))),delete t.action,t.extNode=l,t};E.toast||(E.toast={}),!E.noselect&&a.trigger("selectfiles",{files:a.searchStatus.state>1?e.map(i,(function(e){return e.hash})):s}),o.length?(E.noscroll||(o.first().trigger("scrolltoview",{blink:!1}),a.resources.blink(o,"lookme")),e.isPlainObject(E.toast.incwd)&&a.toast(l(E.toast.incwd))):e.isPlainObject(E.toast.inbuffer)&&a.toast(l(E.toast.inbuffer))}))),c.resolve(t),t.debug&&a.debug("backend-debug",t)};a.abortXHR(i),S?a.lazy(n):n()},M=function(e){i&&"pending"===i.state()&&(a.abortXHR(i,{quiet:!0,abort:!0}),(!e||"unload"!==e.type&&"destroy"!==e.type)&&a.autoSync())},R=function(e){if(a.trigger(u+"done"),"autosync"==e.type){if("stop"!=e.data.action)return}else if(!("unload"==e.type||"destroy"==e.type||"openxhrabort"==e.type||e.data.added&&e.data.added.length))return;M(e)},z=function(n){var s=function(){C=!1,c.reject()};if(n&&"cmd"===n)return u;if(f){if(ye&&"pending"===ye.state()){if(ye._target===h.target)return c.reject("openabort");ye.xhr?ye.xhr.queueAbort():ye.reject("openabort")}(ye=c)._target=h.target}if(c.always((function(){delete O.headers["X-elFinderReqid"],f&&(ye=null)})).fail((function(t,n,i){var o,s;f&&"openabort"===t&&(t="",C=!1),o={cmd:u,err:t,xhr:n,rc:i},0===t&&be.length&&(be=e.grep(be,(function(e){return e("cmd")!==u}))),a.trigger("requestError",o),(o._getEvent&&o._getEvent().isDefaultPrevented()||n&&a.handleCsrfReload(n,n._elfinderResponse))&&(g=!1,C=!1,t&&(t.error="")),M(),f&&(r=a.file(h.target))&&r.volumeid&&a.isRoot(r)&&delete a.volumeExpires[r.volumeid],a.trigger(u+"fail",i),(s="object"==typeof t?t.error:t)&&(g?a.error(s):a.debug("error",a.i18n(s))),C&&a.sync()})),!u)return C=!1,c.reject({error:"errCmdReq"});if(a.maxTargets&&h.targets&&h.targets.length>a.maxTargets)return C=!1,c.reject({error:["errMaxTargets",a.maxTargets]});if(v&&c.done(D),f){for(;o=ee.pop();)o.queueAbort();if($!==h.target)for(;o=te.pop();)o.queueAbort()}return-1!==e.inArray(u,(a.cmdsToAdd+" autosync").split(" "))&&("autosync"!==u&&(a.autoSync("stop"),c.always((function(){a.autoSync()}))),a.trigger("openxhrabort")),delete O.preventFail,a.api>=2.1029&&(A?O.headers["X-elFinderReqid"]=d:Object.assign(O.data,{reqid:d})),c.syncOnFail=function(e){C=!!e},ve++,c.xhr=i=a.transport.send(O).always((function(){O._xhr&&void 0!==O._xhr.responseURL&&(i.responseURL=O._xhr.responseURL||""),--ve,be.length&&be.shift()()})).fail(I).done(P),i._csrfRefresh=!!t._csrfRefresh,a.api>=2.1029&&(i._requestId=d),f||h.compare&&"info"===u?(i.queueAbort=s,ee.unshift(i),h.compare&&a.bind(a.cmdsToAdd+" autosync openxhrabort",R),c.always((function(){var t=e.inArray(i,ee);h.compare&&a.unbind(a.cmdsToAdd+" autosync openxhrabort",R),-1!==t&&ee.splice(t,1)}))):-1!==e.inArray(u,a.abortCmdsOnOpen)&&(i.queueAbort=s,te.unshift(i),c.always((function(){var t=e.inArray(i,te);-1!==t&&te.splice(t,1)}))),a.bind("unload destroy",R),c.always((function(){a.unbind("unload destroy",R)})),c},N=function(){return w.type&&w.cnt&&(_&&(w.cancel=c,t.eachCancel&&(w.id=+new Date)),n=setTimeout((function(){y=setTimeout(F,1e3),a.notify(w),x=!0,c.always((function(){w.cnt=-(parseInt(w.cnt)||0),a.notify(w),x=!1}))}),a.notifyDelay),c.always((function(){clearTimeout(n)}))),ve<s?z():(f?be.unshift(z):be.push(z),c)},F=function(){var e;x&&y&&(e=1*w.cnt,y=null,a.notify({type:w.type,progress:e,cnt:0,hideCnt:w.hideCnt}),(b+=e)/w.cnt<80&&(y=setTimeout(F,500)))},L={opts:t,result:!0};return a.api||h.init?(a.trigger("request."+u,L,!0),L.result?"object"==typeof L.result&&L.result.promise?(L.result.done(N).fail((function(){a.trigger(u+"done"),c.reject()})),c):N():(a.trigger(u+"done"),c.reject())):(C=!1,c.reject())},this.cache=function(e,t){Array.isArray(e)||(e=[e]),fe(e,t)},this.updateCache=function(t){e.isPlainObject(t)&&(t.files&&t.files.length&&fe(t.files,"files"),t.tree&&t.tree.length&&fe(t.tree,"tree"),t.removed&&t.removed.length&&me(t.removed),t.added&&t.added.length&&fe(t.added,"add"),t.changed&&t.changed.length&&fe(t.changed,"change"))},this.diff=function(t,n,i){var o={},r=[],s=[],a=[],l=null;return e.each(t,(function(e,t){o[t.hash]=t})),i&&i.length&&(l={},e.each(i,(function(){l[this]=!0}))),e.each(V,(function(e,t){o[e]||n&&t.phash!==n||s.push(e)})),e.each(o,(function(t,n){var i,o=V[t],s={};o?(e.each(Object.keys(o),(function(){s[this]=!0})),e.each(n,(function(e){if(delete s[e],!(l&&l[e]||n[e]===o[e]))return a.push(n),s={},!1})),0!==(i=Object.keys(s).length)&&(l&&e.each(s,(function(e){l[e]&&--i})),0!==i&&a.push(n))):r.push(n)})),e.each(s,(function(t,n){var i=V[n],r=i.phash;r&&"directory"==i.mime&&-1===e.inArray(r,s)&&o[r]&&!function(e){for(var t=a.length;t--;)if(a[t].hash==e)return!0}(r)&&a.push(o[r])})),{added:r,removed:s,changed:a}},this.syncStopper=!1,this.sync=function(t,n){if(this.syncStopper)return e.Deferred().reject();this.syncStopper=!0,this.autoSync("stop");var i,o,r,s,a,l=this,c=(r="",s=0,a=0,t&&n&&e.each(V,(function(e,n){
144n.phash&&n.phash===t&&(++s,a=Math.max(a,n.ts)),r=s+":"+a})),r),d=e.Deferred().always((function(){!o&&l.trigger("sync")})),h=!t&&this.ui.tree?1:0,u=[this.request({data:{cmd:"open",reload:1,target:$,tree:h,compare:c},preventDefault:!0})];return!t&&l.api>=2&&($!==this.root()&&u.push(this.request({data:{cmd:"parents",target:$},preventDefault:!0})),e.each(function(){for(var e,t=[],n=l.file(l.root($)),i=n?n.volumeid:null,o=l.cwd().phash;o;)(e=l.file(o))?(0!==o.indexOf(i)&&(t.push({target:o,cmd:"tree"}),l.isRoot(e)||t.push({target:o,cmd:"parents"}),i=(n=l.file(l.root(o)))?n.volumeid:null),o=e.phash):o=null;return t}(),(function(e,t){u.push(l.request({data:{cmd:t.cmd,target:t.target},preventDefault:!0}))}))),e.when.apply(e,u).fail((function(t,i){o=i&&200!=i.status,n&&-1===e.inArray("errOpen",t)?d.reject(t&&0!=i.status?t:void 0):(d.reject(t),l.parseError(t)&&l.request({data:{cmd:"open",target:l.lastDir("")||l.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}}))})).done((function(n){var o,r,s;if(n.cwd.compare&&c===n.cwd.compare)return d.reject();if(o={tree:[]},(r=arguments.length)>1)for(s=1;s<r;s++)arguments[s].tree&&arguments[s].tree.length&&o.tree.push.apply(o.tree,arguments[s].tree);if(l.api<2.1&&(o.tree||(o.tree=[]),o.tree.push(n.cwd)),n=l.normalize(n),!l.validResponse("open",n))return d.reject(n.norError||"errResponse");if(o=l.normalize(o),!l.validResponse("tree",o))return d.reject(o.norError||"errResponse");h&&o&&o.tree&&(i=e.map(e.grep(n.files,(function(e){return e.isroot})),(function(e){return e.hash})),o.tree=e.grep(o.tree,(function(e){return!e.isroot||i.indexOf(e.hash)>=0})));var a=l.diff(n.files.concat(o&&o.tree?o.tree:[]),t);return a.added.push(n.cwd),l.updateCache(a),a.removed.length&&l.remove(a),a.added.length&&l.add(a),a.changed.length&&l.change(a),d.resolve(a)})).always((function(){l.syncStopper=!1,l.autoSync()})),d},this.upload=function(e){return this.transport.upload(e,this)},this.shortcut=function(t){var n,i,o,r,s;if(this.options.allowShortcuts&&t.pattern&&"function"==typeof t.callback)for(n=t.pattern.toUpperCase().split(/\s+/),r=0;r<n.length;r++)(o=1==(o=(s=(i=n[r]).split("+")).pop()).length?o>0?o:o.charCodeAt(0):o>0?o:e.ui.keyCode[o])&&!Q[i]&&(Q[i]={keyCode:o,altKey:-1!=e.inArray("ALT",s),ctrlKey:-1!=e.inArray("CTRL",s),shiftKey:-1!=e.inArray("SHIFT",s),type:t.type||"ke
144ydown",callback:t.callback,description:t.description,pattern:i});return this},this.shortcuts=function(){var t=[];return e.each(Q,(function(e,n){t.push([n.pattern,O.i18n(n.description)])})),t},this.clipboard=function(t,n){var i=function(){return e.map(J,(function(e){return e.hash}))};return void 0!==t&&(J.length&&this.trigger("unlockfiles",{files:i()}),Z={},J=e.map(t||[],(function(e){var t=V[e];return t?(Z[e]=!0,{hash:e,phash:t.phash,name:t.name,mime:t.mime,read:t.read,locked:t.locked,cut:!!n}):null})),this.trigger("changeclipboard",{clipboard:J.slice(0,J.length)}),n&&this.trigger("lockfiles",{files:i()})),J.slice(0,J.length)},this.isCommandEnabled=function(e,t){var n,i,o=O.cwd().volumeid||"";return!t&&O.searchStatus.state>1&&O.selected().length&&(t=O.selected()[0]),n=!t||o&&0===t.indexOf(o)?W.disabledFlip:O.option("disabledFlip",t),!!(i=this._commands[e])&&(i.alwaysEnabled||!n[e])},this.exec=function(t,n,i,o){var r,s;return!o&&this.commandMap[t]&&"hidden"!==this.commandMap[t]&&(t=this.commandMap[t]),"open"===t&&((this.searchStatus.state||this.searchStatus.ininc)&&this.trigger("searchend",{noupdate:!0}),this.autoSync("stop")),!o&&n&&(Array.isArray(n)?n.length&&(o=n[0]):o=n),"object"===(s=typeof(r=this._commands[t]&&this.isCommandEnabled(t,o)?this._commands[t].exec(n,i):e.Deferred().reject("errUnknownCmd")))&&r.promise||(O.debug("warning",'"cmd.exec()" should be returned "$.Deferred" but cmd "'+t+'" returned "'+s+'"'),r=e.Deferred().resolve()),this.trigger("exec",{dfrd:r,cmd:t,files:n,opts:i,dstHash:o}),r},this.dialog=function(t,n){var i=e("<div></div>").append(t).appendTo(P).elfinderdialog(n,O),o=i.closest(".ui-dialog"),r=function(){!i.data("draged")&&i.is(":visible")&&i.elfinderdialog("posInit")};return o.length&&(O.bind("resize",r),o.on("remove",(function(){O.unbind("resize",r)}))),i},this.toast=function(t){return e('<div class="ui-front"></div>').appendTo(this.ui.toast).elfindertoast(t||{},this)},this.getUI=function(t){return t?this.ui[t]||e():P},this.getCommand=function(e){return void 0===e?this._commands:this._commands[e]},this.resize=function(t,n){var i,o=!P.hasClass("ui-resizable"),r=P.data("resizeSize")||{w:0,h:0},s={};re&&re.data("resizeTm")&&clearTimeout(re.data("resizeTm")),O.options.noResizeBySelf||("string"==typeof n&&(i=n.match(/^([0-9.]+)%$/))&&(re&&re.length||(re=e(window)),re.data("marginToMyNode")||re.data("marginToMyNode",function(){for(var e=P.outerHeight(!0)-P.innerHeight(),t=P;t.get(0)!==re.get(0)&&(e+=(t=t.parent()).outerHeight(!0)-t.innerHeight(),t.parent().length););return e}()),re.data("fitToBaseFunc")||re.data("fitToBaseFunc",(function(e){var t=re.data("resizeTm");e.preventDefault(),e.stopPropagation(),t&&cancelAnimationFrame(t),P.hasClass("elfinder-fullscreen")||O.UA.Mobile&&re.data("rotated")===O.UA.Rotated||(re.data("rotated",O.UA.Rotated),re.data("resizeTm",requestAnimationFrame((function(){O.restoreSize()}))))})),void 0===re.data("rotated")&&re.data("rotated",O.UA.Rotated),n=re.height()*(i[1]/100)-re.data("marginToMyNode"),re.off("resize."+O.namespace,re.data("fitToBaseFunc")),o&&re.on("resize."+O.namespace,re.data("fitToBaseFunc"))),P.css({width:t,height:parseInt(n)})),s.w=Math.round(P.width()),s.h=Math.round(P.height()),P.data("resizeSize",s),s.w===r.w&&s.h===r.h||(P.trigger("resize"),this.trigger("resize",{width:s.w,height:s.h}))},this.restoreSize=function(){this.resize(ie,oe)},this.show=function(){P.show(),this.enable().trigger("show")},this.hide=function(){this.options.enableAlways&&(U=H,H=!1),this.disable(),this.trigger("hide"),P.hide()},this.lazy=function(t,n,i){var o=function(e){var t,n=P.data("lazycnt");e?(t=!P.data("lazyrepaint")&&i.repaint,n?P.data("lazycnt",++n):P.data("lazycnt",1).addClass("elfinder-processing"),t&&P.data("lazyrepaint",!0).css("display")):n&&n>1?P.data("lazycnt",--n):(t=P.data("lazyrepaint"),P.data("lazycnt",0).removeData("lazyrepaint").removeClass("elfinder-processing"),t&&P.css("display"),O.trigger("lazydone"))},r=e.Deferred(),s=function(){r.resolve(t.call(r)),o(!1)};return n=n||0,i=i||{},o(!0),n?setTimeout(s,n):requestAnimationFrame(s),r},this.destroy=function(){P&&P[0].elfinder&&(P.hasClass("elfinder-fullscreen")&&O.toggleFullscreen(P),this.options.syncStart=!1,this.autoSync("forcestop"),this.trigger("destroy").disable(),J=[],X=[],Y={},Q={},e(window).off("."+N),e(document).off("."+N),O.trigger=function(){},e(ce).remove(),P.off().removeData().empty().append(R.contents()).attr("class",R.attr("class")).attr("style",R.attr("style")),delete P[0].elfinder,e.each(M,(function(t,n){e.each(n,(function(e,t){P.on(t.type+(t.namespace?"."+t.namespace:""),t.selector,t.handler)}))})))},this.autoSync=function(t){var n;if(O.options.sync>=1e3){if(r&&(clearTimeout(r),r=null,O.trigger("autosync",{action:"stop"})),"stop"===t?++de:de=Math.max(0,--de),de||"forcestop"===t||!O.options.syncStart)return;(n=function(t){var i;W.syncMinMs&&(t||r)&&(t&&O.trigger("autosync",{action:"start"}),i=Math.max(O.options.sync,W.syncMinMs),r&&clearTimeout(r),r=setTimeout((function(){var t,o=!0,s=$;
144W.syncChkAsTs&&V[s]&&(t=V[s].ts)?O.request({data:{cmd:"info",targets:[s],compare:t,reload:1},preventDefault:!0}).done((function(e){var i;o=!0,e.compare&&(i=e.compare)==t&&(o=!1),o?O.sync(s).always((function(){i&&(V[s].ts=i),n()})):n()})).fail((function(t,o){var s=O.parseError(t);s&&0!=o.status?(O.error(s),Array.isArray(s)&&-1!==e.inArray("errOpen",s)&&O.request({data:{cmd:"open",target:O.lastDir("")||O.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}})):r=setTimeout((function(){n()}),i)})):O.sync($,!0).always((function(){n()}))}),i))})(!0)}},this.insideWorkzone=function(e,t,n){var i=this.getUI("workzone").data("rectangle");return n=n||1,!(e<i.left+n||e>i.left+i.width+n||t<i.top+n||t>i.top+i.height+n)},this.toFront=function(t){var n=P.children(".ui-front").removeClass("elfinder-frontmost"),i=n.last();n.css("z-index",""),e(t).addClass("ui-front elfinder-frontmost").css("z-index",i.css("z-index")+1)},this.toHide=function(t,n){var i,o=e(t);!n&&o.hide(),o.hasClass("elfinder-frontmost")&&(o.removeClass("elfinder-frontmost"),(i=P.children(".ui-front:visible:not(.elfinder-frontmost)").last()).length&&requestAnimationFrame((function(){P.children(".elfinder-frontmost:visible").length||(O.toFront(i),i.trigger("frontmost"))})))},this.getMaximizeCss=function(){return{width:"100%",height:"100%",margin:0,top:0,left:0,display:"block",position:"fixed",zIndex:Math.max(O.zIndex?O.zIndex+1:0,1e3),maxWidth:"",maxHeight:""}},function(){ke&&O.UA.Fullscreen&&(O.UA.Fullscreen=!1,Ce&&void 0!==Ce.attr("allowfullscreen")&&(O.UA.Fullscreen=!0));var t,n,i,o,r="elfinder-fullscreen",s="elfinder-fullscreen-native",a=function(){var t=0,n=0;e.each(P.children(".ui-dialog,.ui-draggable"),(function(i,o){var r=e(o),s=r.position();s.top<0&&(r.css("top",t),t+=20),s.left<0&&(r.css("left",n),n+=20)}))},l=function(){var i=O.storage("useFullscreen");o=O.UA.Fullscreen&&(i?i>0:"screen"===O.options.commandsOptions.fullscreen.mode)?{fullElm:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||null},exitFull:function(){return document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():void 0},toFull:function(e){return e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():!!e.msRequestFullscreen&&e.msRequestFullscreen()}}:{fullElm:function(){var e;return P.hasClass(r)?P.get(0):(e=P.find("."+r)).length?e.get(0):null},exitFull:function(){var i;e(window).off("resize."+N,d),void 0!==n&&e("body").css("overflow",n),n=void 0,t&&(i=t.elm,c(i),e(i).trigger("resize",{fullscreen:"off"})),e(window).trigger("resize")},toFull:function(t){return n=e("body").css("overflow")||"",e("body").css("overflow","hidden"),e(t).css(O.getMaximizeCss()).addClass(r).trigger("resize",{fullscreen:"on"}),a(),e(window).on("resize."+N,d).trigger("resize"),!0}}},c=function(n){t&&t.elm==n&&(e(n).removeClass(r+" "+s).attr("style",t.style),t=null)},d=function(t){var n;t.target===window&&(i&&cancelAnimationFrame(i),i=requestAnimationFrame((function(){(n=o.fullElm())&&e(n).trigger("resize",{fullscreen:"on"})})))};l(),e(document).on("fullscreenchange."+N+" webkitfullscreenchange."+N+" mozfullscreenchange."+N+" MSFullscreenChange."+N,(function(n){if(O.UA.Fullscreen){var l=o.fullElm(),h=e(window);i&&cancelAnimationFrame(i),null===l?(h.off("resize."+N,d),t&&(l=t.elm,c(l),e(l).trigger("resize",{fullscreen:"off"}))):(e(l).addClass(r+" "+s).attr("style","width:100%; height:100%; margin:0; padding:0;").trigger("resize",{fullscreen:"on"}),h.on("resize."+N,d),a()),h.trigger("resize")}})),O.toggleFullscreen=function(n,i){var r,s=e(n).get(0);if(r=o.fullElm()){if(r==s){if(!0===i)return r}else if(!1===i)return r;return o.exitFull(),null}return!1===i?null:(l(),t={elm:s,style:e(s).attr("style")},!1!==o.toFull(s)?s:(t=null,null))}}(),C="elfinder-maximized",S=function(e){if(e.target===window&&e.data&&e.data.elm){var t=e.data.elm;k&&cancelAnimationFrame(k),k=requestAnimationFrame((function(){t.trigger("resize",{maximize:"on"})}))}},O.toggleMaximize=function(t,n){var i=e(t);if(i.hasClass(C)){if(!0===n)return;!function(t){e(window).off("resize."+N,S),e("body").css("overflow",t.data("bodyOvf")),t.removeClass(C).attr("style",t.data("orgStyle")).removeData("bodyOvf").removeData("orgStyle"),t.trigger("resize",{maximize:"off"})}(i)}else{if(!1===n)return;!function(t){t.data("bodyOvf",e("body").css("overflow")||"").data("orgStyle",t.attr("style")).addClass(C).css(O.getMaximizeCss()),e("body").css("overflow","hidden"),e(window).on("resize."+N,{elm:t},S),t.trigger("resize",{maximize:"on"})}(i)}},Object.assign(e.ui.keyCode,{F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,DIG0:48,DIG1:49,DIG2:50,DIG3:51,DIG4:52,DIG5:53,DIG6:54,DIG7:55,DIG8:56,DIG9:57,NUM0:96,NUM1:97,NUM2:98,NUM3:99,NUM4:100,NUM5:101,NUM6:102,NUM7:103,NUM8:104,NUM9:105,CONTEXTMENU:93,DOT:190}),this.dragUpload=!1,this.xhrUpload=("undefined"!=typeof XMLHttpRequestUpload||"undefined"!=typeof XMLHttpRequestEventTarget)&&"undefined"!=typeof File&&"undefined"!=typeof FormData,this.transport={},"object"==typeof this.options.transport&&(this.transport=this.options.transport,"function"==typeof this.transport.init&&this.transport.init(this)),"function"!=typeof this.transport.send&&
144(this.transport.send=function(t){return O.UA.IE||(t._xhr=new XMLHttpRequest,t.xhr=function(){return t.progress&&t._xhr.addEventListener("progress",t.progress),t._xhr}),e.ajax(t)}),"iframe"==this.transport.upload?this.transport.upload=this.uploads.iframe.bind(this):"function"==typeof this.transport.upload?this.dragUpload=!!this.options.dragUploadAllow:this.xhrUpload&&this.options.dragUploadAllow?(this.transport.upload=this.uploads.xhr.bind(this),this.dragUpload=!0):this.transport.upload=this.uploads.iframe.bind(this),this.decodeRawString=function(e){return function(e){var t,n,i,o,r=String.fromCharCode;for(t=0,n=e.length,o="";i=e[t],t<n;t++)o+=i<=127?r(i):i<=223&&i>=194?r((31&i)<<6|63&e[++t]):i<=239&&i>=224?r((15&i)<<12|(63&e[++t])<<6|63&e[++t]):i<=247&&i>=240?r(55296|((7&i)<<8|(63&e[++t])<<2|e[++t]>>>4&3)-64,56320|(15&e[t++])<<6|63&e[t]):r(65533);return o}(function(e){var t,n,i,o=[];for("string"==typeof e&&(e=function(e){var t,n,i;for(t=0,n=e.length,i=[];t<n;t++)i.push(e.charCodeAt(t));return i}(e)),t=0,n=e.length;i=e[t],t<n;t++)i>=55296&&i<=56319?o.push(64+(1023&i)<<10|1023&e[++t]):o.push(i);return o}(e))},this.getContents=function(t,n,i){var o,r,s=this,a=e.Deferred(),l=n||"arraybuffer";return a.fail((function(){r&&"pending"===r.state()&&r.reject()})),o=s.openUrl(t),s.isSameOrigin(o)||(o=s.openUrl(t,!0)),r=s.request(Object.assign({data:{cmd:"get"},options:{url:o,type:"get",cache:!0,dataType:"binary",responseType:l,processData:!1},notify:{type:"file",cnt:1,hideCnt:!0},cancel:!0},i||{})).fail((function(){a.reject()})).done((function(e){a.resolve(e)})),a},this.getBinaryByUrl=function(t,n,i){var o,r=e.Deferred();return r.fail((function(){o&&"pending"===o.state()&&o.reject()})),o=this.request(Object.assign({data:{cmd:"get"},options:Object.assign({type:"get",cache:!0,dataType:"binary",responseType:"blob",processData:!1},t)},i||{})).fail((function(){r.reject()})).done((function(e){n&&n(e),r.resolve(e)})),r},this.getMimetype=function(e,t){var n,i,r=t;return(i=(e+"").match(/\.([^.]+)$/))&&(n=i[1])&&(o||(o=O.arrayFlip(O.mimeTypes)),(r=o[n.toLowerCase()])||(r=t)),r},O.hashCheckers=[],function(t){var n={};window.Worker&&window.ArrayBuffer&&(t.options.cdns.sparkmd5&&(n.SparkMD5=!0,t.hashCheckers.push("md5")),t.options.cdns.jssha&&(n.jsSHA=!0,t.hashCheckers=t.hashCheckers.concat(["sha1","sha224","sha256","sha384","sha512","sha3-224","sha3-256","sha3-384","sha3-512","shake128","shake256"]))),t.getContentsHashes=function(i,o,r,s){var a,l=e.Deferred(),c=t.arrayFlip(o||["md5"],!0),d=[],h={},u=r||{shake128len:256,shake256len:512};return l.fail((function(){a&&a.reject()})),Object.keys(n).length?a=t.getContents(i,"arraybuffer",s).done((function(o){c.md5&&n.SparkMD5&&d.push(function(){var r=e.Deferred();try{var s=t.getWorker();r.fail((function(){s&&s.terminate()})),s.onmessage=function(e){var n;(s&&s.terminate(),e.data.hash)?(h.md5=e.data.hash,(n=t.file(i))&&(n.md5=h.md5)):e.data.error&&(h.md5=e.data.error);l.notify(h),r.resolve()},s.onerror=function(e){r.reject()},s.postMessage({scripts:[t.options.cdns.sparkmd5,t.getWorkerUrl("calcfilehash.js")],data:{type:"md5",bin:o}}),l.fail((function(){r.reject()}))}catch(e){r.reject(),delete n.SparkMD5}return r}()),n.jsSHA&&e.each(["1","224","256","384","512","3-224","3-256","3-384","3-512","ke128","ke256"],(function(r,s){c["sha"+s]&&d.push(function(){var r=e.Deferred();try{var a=t.getWorker();r.fail((function(){a&&a.terminate()})),a.onmessage=function(e){var n;(a&&a.terminate(),e.data.hash)?(h["sha"+s]=e.data.hash,(n=t.file(i))&&(n["sha"+s]=h["sha"+s])):e.data.error&&(h["sha"+s]=e.data.error);l.notify(h),r.resolve()},a.onerror=function(e){r.reject()},a.postMessage({scripts:[t.options.cdns.jssha,t.getWorkerUrl("calcfilehash.js")],data:{type:s,bin:o,hashOpts:u}}),l.fail((function(){r.reject()}))}catch(e){r.reject(),delete n.jsSHA}return r}())})),d.length?e.when.apply(null,d).always((function(){l.resolve(h)})):l.reject()})).fail((function(){l.reject()})):l.reject(),l}}(this),this.parseError=function(t){var n=t;return e.isPlainObject(n)&&(n=n.error),n},this.error=function(){var e,t=arguments[0],n=arguments[1]||null;return 1==arguments.length&&"function"==typeof t?O.bind("error",t):!0!==(e=this.parseError(t))&&e?O.trigger("error",{error:e,opts:n}
144):this},e.each(["enable","disable","load","open","reload","select","add","remove","change","dblclick","getfile","lockfiles","unlockfiles","selectfiles","unselectfiles","dragstart","dragstop","search","searchend","viewchange"],(function(t,n){O[n]=function(){var t=arguments[0];return 1==arguments.length&&"function"==typeof t?O.bind(n,t):O.trigger(n,e.isPlainObject(t)?t:{})}})),this.enable((function(){!H&&O.api&&O.visible()&&O.ui.overlay.is(":hidden")&&!P.children(".elfinder-dialog."+O.res("class","editing")+":visible").length&&(H=!0,document.activeElement&&document.activeElement.blur(),P.removeClass("elfinder-disabled"))})).disable((function(){U=H,H=!1,P.addClass("elfinder-disabled")})).open((function(){X=[]})).select((function(t){var n=0,i=[];X=e.grep(t.data.selected||t.data.value||[],(function(e){return i.length||O.maxTargets&&++n>O.maxTargets?(i.push(e),!1):!!V[e]})),i.length&&(O.trigger("unselectfiles",{files:i,inselect:!0}),O.toast({mode:"warning",msg:O.i18n(["errMaxTargets",O.maxTargets])}))})).error((function(t){var n,i,o={cssClass:"elfinder-dialog-error",title:O.i18n("error"),resizable:!1,destroyOnClose:!0,buttons:{}},r=O.getUI();r.children(".elfinder-dialog-error").length<O.options.maxErrorDialogs?(o.buttons[O.i18n(O.i18n("btnClose"))]=function(){e(this).elfinderdialog("close")},t.data.opts&&e.isPlainObject(t.data.opts)&&Object.assign(o,t.data.opts),O.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-error"></span>'+O.i18n(t.data.error),o)):(i=(n=r.children(".elfinder-dialog-error:last").children(".ui-dialog-content:first")).children(".elfinder-error-counter")).length?i.data("cnt",parseInt(i.data("cnt"))+1).html(O.i18n(["moreErrors",i.data("cnt")])):(i=e('<span class="elfinder-error-counter">'+O.i18n(["moreErrors",1])+"</span>").data("cnt",1),n.append("<br/>",i))})).bind("tmb",(function(t){e.each(t.data.images||[],(function(e,t){V[e]&&(V[e].tmb=t)}))})).bind("searchstart",(function(e){Object.assign(O.searchStatus,e.data),O.searchStatus.state=1})).bind("search",(function(e){O.searchStatus.state=2})).bind("searchend",(function(){O.searchStatus.state=0,O.searchStatus.ininc=!1,O.searchStatus.mixed=!1})).bind("canMakeEmptyFile",(function(t){var n=t.data,i={};n&&Array.isArray(n.mimes)&&(n.unshift||(i=O.mimesCanMakeEmpty),e.each(n.mimes,(function(){i[this]||(i[this]=O.mimeTypes[this])})),n.unshift&&(O.mimesCanMakeEmpty=Object.assign(i,O.mimesCanMakeEmpty)))})).bind("themechange",(function(){requestAnimationFrame((function(){O.trigger("uiresize")}))})),!0===this.options.sound&&this.bind("playsound",(function(t){var n=ce.canPlayType&&ce.canPlayType('audio/wav; codecs="1"'),i=t.data&&t.data.soundFile;n&&i&&""!=n&&"no"!=n&&e(ce).html('<source src="'+se+i+'" type="audio/wav">')[0].play()})),e.each(this.options.handlers,(function(e,t){O.bind(e,t)})),this.history=new this.history(this),this.roots={},this.leafRoots={},this.volumeExpires={},this._commands={},Array.isArray(this.options.commands)||(this.options.commands=[]),-1!==e.inArray("*",this.options.commands)&&(this.options.commands=Object.keys(this.commands)),this.commandMap={},this.volOptions={},this.hasVolOptions=!1,this.trashes={},this.optionsByHashes={},this.uiAutoHide=[],this.one("open",(function(){O.uiAutoHide.length&&setTimeout((function(){O.trigger("uiautohide")}),500)})),this.bind("uiautohide",(function(){O.uiAutoHide.length&&O.uiAutoHide.shift()()})),this.options.width&&(ie=this.options.width),this.options.height&&(oe=this.options.height),this.options.heightBase&&(re=e(this.options.heightBase)),se=this.options.soundPath?this.options.soundPath.replace(/\/+$/,"")+"/":this.baseUrl+se,this.options.parrotHeaders&&Array.isArray(this.options.parrotHeaders)&&this.options.parrotHeaders.length?(this.parrotHeaders=this.options.parrotHeaders,e.each(this.parrotHeaders,(function(e,t){var n=O.sessionStorage("core-ph:"+t);n&&(O.customHeaders[t]=n)}))):this.parrotHeaders=[],O.one("opendone",(function(){var t;e(document).on("click."+N,(function(t){H&&!O.options.enableAlways&&!e(t.target).closest(P).length&&O.disable()})).on(L+" "+j+" "+B+" "+F,we),O.options.useBrowserHistory&&e(window).on("popstate."+N,(function(t){var n,i,o=t.originalEvent.state||{},r=!!o.thash,s=P.find(".elfinder-frontmost:visible"),a=P.find(".elfinder-navbar-dir,.elfinder-cwd-filename").find("input,textarea");r||(o={thash:O.cwd().hash},e("html,body").animate({scrollTop:P.offset().top})),s.length||a.length?(history.pushState(o,null,location.pathname+location.search+"#elf_"+o.thash),s.length?s.hasClass(O.res("class","preventback"))||(s.hasClass("elfinder-contextmenu")?e(document).trigger(e.Event("keydown",{keyCode:e.ui.keyCode.ESCAPE,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1})):s.hasClass("elfinder-dialog")?s.elfinderdialog("close"):s.trigger("close")):a.trigger(e.Event("keydown",{keyCode:e.ui.keyCode.ESCAPE,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))):r?!e.isEmptyObject(O.files())&&O.request({data:{cmd:"open",target:o.thash,onhistory:1},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0}):(n=function(){i.trigger("click")},O.one("open",n,!0),i=O.toast({msg:O.i18n("pressAgainToExit"),onHidden:function(){O.unbind("open",n),history.pushState(o,null,location.pathname+location.search+"#elf_"+o.thash)}}))})),e(window).on("resize."+N,(function(e){e.target===this&&(t&&cancelAnimationFrame(t),t=requestAnimationFrame((function(){var e=P.data("resizeSize")||{w:0,h:0},t={w:Math.round(P.width()),h:Math.round(P.height())};P.data("resizeSize",t),t.w===e.w&&t.h===e.h||(P.trigger("resize"),O.trigger("resize",{width:t.w,height:t.h}))}
144)))})).on("beforeunload."+N,(function(t){var n,i;if(!O.pauseUnloadCheck()){if(P.is(":visible")&&(O.ui.notify.children().length&&-1!==e.inArray("hasNotifyDialog",O.options.windowCloseConfirm)?n=O.i18n("ntfsmth"):P.find("."+O.res("class","editing")).length&&-1!==e.inArray("editingFile",O.options.windowCloseConfirm)?n=O.i18n("editingFile"):(i=Object.keys(O.selected()).length)&&-1!==e.inArray("hasSelectedItem",O.options.windowCloseConfirm)?n=O.i18n("hasSelected",""+i):(i=Object.keys(O.clipboard()).length)&&-1!==e.inArray("hasClipboardData",O.options.windowCloseConfirm)&&(n=O.i18n("hasClipboard",""+i)),n))return t.returnValue=n,n;O.trigger("unload")}})),e(window).on("message."+N,(function(e){var t,n,i=e.originalEvent||null;if(i&&(0===O.convAbsUrl(O.options.url).indexOf(i.origin)||0===O.convAbsUrl(O.uploadURL).indexOf(i.origin)))try{try{if("string"!=typeof i.data)return;if("io.studio-42.github"!==(t=JSON.parse(i.data)).type)return;n=t.data||null}catch(e){return}n&&(n.error?(t.bind&&O.trigger(t.bind+"fail",n),O.error(n.error)):(n.warning&&O.error(n.warning),O.updateCache(n),n.removed&&n.removed.length&&O.remove(n),n.added&&n.added.length&&O.add(n),n.changed&&n.changed.length&&O.change(n),t.bind&&(O.trigger(t.bind,n),O.trigger(t.bind+"done")),n.sync&&O.sync()))}catch(e){O.sync()}})),O.options.enableAlways?(e(window).on("focus."+N,(function(e){e.target===this&&O.enable()})),ke&&e(window.top).on("focus."+N,(function(){!O.enable()||Ce&&!Ce.is(":visible")||requestAnimationFrame((function(){e(window).trigger("focus")}))}))):ke&&e(window).on("blur."+N,(function(e){H&&e.target===this&&O.disable()})),ke&&P.on("click",(function(t){e(window).trigger("focus")})),O.options.enableByMouseOver&&P.on("mouseenter touchstart",(function(t){ke&&e(window).trigger("focus"),!O.enabled()&&O.enable()})),e(window).on("visibilitychange."+N,(function(e){var t=document.hidden||document.webkitHidden||document.msHidden;O.options.syncStart&&O.autoSync(t?"stop":void 0)}))})),P[0].elfinder=this,D.push((T=O.lang,E=O.i18nBaseUrl+"elfinder."+T+".js",A=e.Deferred().done((function(){O.i18[T]&&(O.lang=T),O.trigger("i18load"),l="en"===O.lang?O.i18.en:e.extend(!0,{},O.i18.en,O.i18[O.lang])})),O.i18[T]?A.resolve():(O.lang="en",O.hasRequire?require([E],(function(){A.resolve()}),(function(){A.resolve()})):O.loadScript([E],(function(){A.resolve()}),{loadType:"tag",error:function(){A.resolve()}})),A)),c=function(){var t,n,i,o,r,s,a,c,d,h,u,p,f,m,g,v,b,y,x,w;return O.messages=l.messages,e.fn.selectable&&e.fn.draggable&&e.fn.droppable&&e.fn.resizable&&e.fn.button&&e.fn.slider?P.length?O.options.url?(t=Object.assign({name:O.i18n("name"),perm:O.i18n("perms"),date:O.i18n("modify"),size:O.i18n("size"),kind:O.i18n("kind"),modestr:O.i18n("mode"),modeoct:O.i18n("mode"),modeboth:O.i18n("mode")},O.options.uiOptions.cwd.listView.columnsCustomName),O.getColumnName=function(e){var n=t[e]||O.i18n(e);return"function"==typeof n?n():n},O.direction=l.direction,O.dateFormat=O.options.dateFormat||l.dateFormat,O.fancyFormat=O.options.fancyDateFormat||l.fancyDateFormat,O.nonameDateFormat=(O.options.nonameDateFormat||l.nonameDateFormat).replace(/[\/\\]/g,"_"),O.cssClass="ui-helper-reset ui-helper-clearfix ui-widget ui-widget-content ui-corner-all elfinder elfinder-"+("rtl"==O.direction?"rtl":"ltr")+(O.UA.Touch?" elfinder-touch"+(O.options.resizable?" touch-punch":""):"")+(O.UA.Mobile?" elfinder-mobile":"")+(O.UA.iOS?" elfinder-ios":"")+" "+O.options.cssClass,P.addClass(O.cssClass).on(F,(function(){!H&&O.enable()})),a=L+"draggable keyup."+N+"draggable",O.draggable={appendTo:P,addClasses:!1,distance:4,revert:!0,refreshPositions:!1,cursor:"crosshair",cursorAt:{left:50,top:47},scroll:!1,start:function(t,a){var l,c,d=a.helper,h=e.grep(d.data("files")||[],(function(e){return!!e&&(Z[e]=!0,!0)})),u=!1;for(s=P.attr("style"),P.width(P.width()).height(P.height()),n="ltr"===O.direction,i=O.getUI("workzone").data("rectangle"),o=i.top+i.height,r=o-O.getUI("navdock").outerHeight(!0),O.draggingUiHelper=d,l=h.length;l--;)if(c=h[l],V[c].locked){u=!0,d.data("locked",!0);break}!u&&O.trigger("lockfiles",{files:h}),d.data("autoScrTm",setInterval((function(){d.data("autoScr")&&O.autoScroll[d.data("autoScr")](d.data("autoScrVal"))}),50))},drag:function(t,s){var a,l,c,d=s.helper;((l=i.top>t.pageY)||r<t.pageY)&&(a=i.cwdEdge>t.pageX?(n?"navbar":"cwd")+(l?"Up":"Down"):(n?"cwd":"navbar")+(l?"Up":"Down"),l||("cwd"===a.substr(0,3)?o<t.pageY?c=o:a=null:c=r),a&&(d.data("autoScr",a),d.data("autoScrVal",Math.pow(l?i.top-t.pageY:t.pageY-c,1.3)))),a||d.data("autoScr")&&d.data("refreshPositions",1).data("autoScr",null),d.data("refreshPositions")&&e(this).elfUiWidgetInstance("draggable")&&(d.data("refreshPositions")>0?(e(this).draggable("option",{refreshPositions:!0,elfRefresh:!0}),d.data("refreshPositions",-1)):(e(this).draggable("option",{refreshPositions:!1,elfRefresh:!1}),d.data("refreshPositions",null)))},stop:function(t,n){var i,o=n.helper;e(document).off(a),e(this).elfUiWidgetInstance("draggable")&&e(this).draggable("option",{refreshPositions:!1}),O.draggingUiHelper=null,O.trigger("focus").trigger("dragstop"),o.data("droped")||(i=e.grep(o.data("files")||[],(function(e){return!!e})),O.trigger("unlockfiles",{files:i}),O.trigger("selectfiles",{files:O.selected()})),O.enable(),P.attr("style",s),o.data("autoScrTm")&&clearInterval(o.data("autoScrTm"))},helper:function(t,n){var i,o,r,s=this.id?e(this):e(this).parents("[id]:first"),l=e('<div class="elfinder-drag-helper"><span class="elfinder-drag-helper-icon-status"></span></div>'),c=function(t){var n,i=t.mime,o=O.tmb(t);return n='<div class="elfinder-cwd-icon elfinder-cwd-icon-drag '+O.mime2class(i)+' ui-corner-all"></div>',o?n=e(n).addClass(o.className).css("background-image","url('"+o.url+"')").get(0).outerHTML:t.icon&&(n=e(n).css(O.getIconStyle(t,!0)).get(0).outerHTML),t.csscls&&
144(n='<div class="'+t.csscls+'">'+n+"</div>"),n};return O.draggingUiHelper&&O.draggingUiHelper.stop(!0,!0),O.trigger("dragstart",{target:s[0],originalEvent:t},!0),i=s.hasClass(O.res("class","cwdfile"))?O.selected():[O.navId2Hash(s.attr("id"))],l.append(c(V[i[0]])).data("files",i).data("locked",!1).data("droped",!1).data("namespace",N).data("dropover",0),(o=i.length)>1&&l.append(c(V[i[o-1]])+'<span class="elfinder-drag-num">'+o+"</span>"),e(document).on(a,(function(e){if(O._commands.copy){var t=e.shiftKey||e.ctrlKey||e.metaKey;r!==t&&(r=t,l.is(":visible")&&l.data("dropover")&&!l.data("droped")&&(l.toggleClass("elfinder-drag-helper-plus",!!l.data("locked")||r),O.trigger(r?"unlockfiles":"lockfiles",{files:i,helper:l})))}})),l}},O.commands.getfile&&("function"==typeof O.options.getFileCallback?(O.bind("dblclick",(function(e){e.preventDefault(),O.exec("getfile").fail((function(){O.exec("open",e.data&&e.data.file?[e.data.file]:void 0)}))})),O.shortcut({pattern:"enter",description:O.i18n("cmdgetfile"),callback:function(){O.exec("getfile").fail((function(){O.exec("mac"==O.OS?"rename":"open")}))}}).shortcut({pattern:"ctrl+enter",description:O.i18n("mac"==O.OS?"cmdrename":"cmdopen"),callback:function(){O.exec("mac"==O.OS?"rename":"open")}})):O.options.getFileCallback=null),e.each(O.commands,(function(t,n){var i,o,r=Object.assign({},n.prototype);if("function"==typeof n&&!O._commands[t]&&(n.prototype.forceLoad||-1!==e.inArray(t,O.options.commands))){if(i=n.prototype.extendsCmd||""){if("function"!=typeof O.commands[i])return!0;n.prototype=Object.assign({},ne,new O.commands[i],n.prototype)}else n.prototype=Object.assign({},ne,n.prototype);O._commands[t]=new n,n.prototype=r,o=O.options.commandsOptions[t]||{},i&&O.options.commandsOptions[i]&&(o=e.extend(!0,{},O.options.commandsOptions[i],o)),O._commands[t].setup(t,o),O._commands[t].linkedCmds.length&&e.each(O._commands[t].linkedCmds,(function(e,t){var n=O.commands[t];"function"!=typeof n||O._commands[t]||(n.prototype=ne,O._commands[t]=new n,O._commands[t].setup(t,O.options.commandsOptions[t]||{}))}))}})),O.ui={workzone:e("<div></div>").appendTo(P).elfinderworkzone(O),navbar:e("<div></div>").appendTo(P).elfindernavbar(O,O.options.uiOptions.navbar||{}),navdock:e("<div></div>").appendTo(P).elfindernavdock(O,O.options.uiOptions.navdock||{}),contextmenu:e("<div></div>").appendTo(P).elfindercontextmenu(O),overlay:e("<div></div>").appendTo(P).elfinderoverlay({show:function(){O.disable()},hide:function(){U&&O.enable()}}),cwd:e("<div></div>").appendTo(P).elfindercwd(O,O.options.uiOptions.cwd||{}),notify:O.dialog("",{cssClass:"elfinder-dialog-notify"+(O.options.notifyDialog.canClose?"":" elfinder-titlebar-button-hide"),position:O.options.notifyDialog.position,absolute:!0,resizable:!1,autoOpen:!1,allowMinimize:!0,closeOnEscape:!!O.options.notifyDialog.canClose,title:"&nbsp;",width:O.options.notifyDialog.width?parseInt(O.options.notifyDialog.width):null,minHeight:null,minimize:function(){O.ui.notify.trigger("minimize")}}),statusbar:e('<div class="ui-widget-header ui-helper-clearfix ui-corner-bottom elfinder-statusbar"></div>').hide().appendTo(P),toast:e('<div class="elfinder-toast"></div>').appendTo(P),bottomtray:e('<div class="elfinder-bottomtray">').appendTo(P),progressbar:e('<div class="elfinder-ui-progressbar">').appendTo(P)},O.trigger("uiready"),e.each(O.options.ui||[],(function(t,n){var i="elfinder"+n,o=O.options.uiOptions[n]||{};!O.ui[n]&&e.fn[i]&&(O.ui[n]=e("<"+(o.tag||"div")+"/>").appendTo(P),O.ui[n][i](O,o))})),O.ui.progressbar.appendTo(O.ui.workzone),O.ui.notify.prev(".ui-dialog-titlebar").append('<div class="elfinder-ui-progressbar"></div>'),O.resize(ie,oe),O.options.resizable&&(P.resizable({resize:function(e,t){O.resize(t.size.width,t.size.height)},handles:"se",minWidth:300,minHeight:200}),O.UA.Touch&&P.addClass("touch-punch")),function(){var e=O.getUI("navbar"),t=O.getUI("cwd").parent();O.autoScroll={navbarUp:function(t){e.scrollTop(Math.max(0,e.scrollTop()-t))},navbarDown:function(t){e.scrollTop(e.scrollTop()+t)},cwdUp:function(e){t.scrollTop(Math.max(0,t.scrollTop()-e))},cwdDown:function(e){t.scrollTop(t.scrollTop()+e)}}}(),O.UA.Touch&&(v=O.getUI("navbar"),b=O.getUI("toolbar"),y="touchmove.stopscroll",x=function(e){var t=(e.originalEvent.touches||[{}])[0].pageY||null;(!d||t<d)&&(e.preventDefault(),m&&clearTimeout(m))},w=function(e){e.preventDefault(),m&&clearTimeout(m)},v=v.children().length?v:null,b=b.length?b:null,P.on("touchstart touchmove touchend",(function(e){if("touchend"===e.type)return c=!1,d=!1,void(m=setTimeout((function(){P.off(y)}),100));var t,n,i,o,r=e.originalEvent.touches||[{}],s=r[0].pageX||null,a=r[0].pageY||null,l="ltr"===O.direction;null===s||null===a||"touchstart"===e.type&&r.length>1||("touchstart"===e.type?(h=P.offset(),u=P.width(),v&&(c=!1,v.is(":hidden")?(g||(g=Math.max(50,u/10)),(l?s-h.left:u+h.left-s)<g&&(c=s)):e.originalEvent._preventSwipeX||(p=v.width(),(l?s<h.left+p:s>h.left+u-p)?(g=Math.max(50,u/10),c=s):c=!1)),b&&(d=!1,e.originalEvent._preventSwipeY||(f=b.height(),a-h.top<(b.is(":hidden")?50:f+30)&&(d=a,P.on(y,b.is(":hidden")?w:x))))):(v&&!1!==c&&(t=(l?c>s:c<s)?"navhide":"navshow",n=Math.abs(c-s),("navhide"===t&&n>.6*p||n>("navhide"===t?p/3:45)&&("navshow"===t||(l?s<h.left+20:s>h.left+u-20)))&&(O.getUI("navbar").trigger(t,{handleW:g}),c=!1)),b&&!1!==d&&(i=b.offset().top,Math.abs(d-a)>Math.min(45,f/3)&&("slideDown"==(o=d>a?"slideUp":"slideDown")||i+20>a)&&(b.is("slideDown"===o?":hidden":":visible")&&b.stop(!0,!0).trigger("toggle",{duration:100,handleH:50}),d=!1))))}))),O.dragUpload&&function(){var t,n,i=function(t){return"TEXTAREA"!==t.target.nodeName&&"INPUT"!==t.target.nodeName&&0===e(t.target).closest("div.ui-dialog-content").length},o="native-drag-enter",r="native-drag-disable",s="class",a=O.res(s,"navdir"),l=(O.res(s,"droppable"),O.res(s,"adroppable"),O.res(s,"navarrow"),O.res(s,"adroppable")),c=O.getUI("workzone"),d="ltr"===O.direction,h=function(){n&&cancelAnimationFrame(n),n=null};P.on("dragenter",(function(e){h(),i(e)&&(e.preventDefault(),e.stopPropagation(),t=c.data("rectangle"))})).on("dragleave",(function(e){h(),i(e)&&(e.preventDefault(),e.stopPropagation())})).on("dragover",(function(e){var o;i(e)?(e.preventDefault(),e.stopPropagation(),e.originalEvent.dataTransfer.dropEffect="none",n||(n=requestAnimationFrame((function(){var i,r=t.top+t.height,s=r-O.getUI("navdock").outerHeight(!0);((o=e.pageY<t.top)||e.pageY>s)&&(i=t.cwdEdge>e.pageX?(d?"navbar":"cwd")+(o?"Up":"Down"):(d?"cwd":"navbar")+(o?"Up":"Down"),o||"cwd"===i.substr(0,3)&&(r<e.pageY?s=r:i=""),i&&O.autoScroll[i](Math.pow(o?t.top-e.pageY:e.pageY-s,1.3))),n=null})))):h()})).on("drop",(function(e){h(),i(e)&&(e.stopPropagation(),e.preventDefault())})),P.on("dragenter",".native-droppable",(function(t){if(t.originalEvent.dataTransfer){var n,i=e(t.currentTarget),s=null;if(!(t.currentTarget.id||null)){s=O.cwd(),i.data(r,!1);try{e.each(t.originalEvent.dataTransfer.types,(function(e,t){"elfinderfrom:"===t.substr(0,13)&&(n=t.substr(13).toLowerCase())}))}catch(t){}}s&&(!s.write||n&&n===(window.location.href+s.hash).toLowerCase())?i.data(r,!0):(t.preventDefault(),t.stopPropagation(),i.data(o,!0),i.addClass(l))}})).on("dragleave",".native-droppable",(function(t){if(t.originalEvent.dataTransfer){var n=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),n.data(o)?n.data(o,!1):n.removeClass(l)}})).on("dragover",".native-droppable",(function(t){if(t.originalEvent.dataTransfer){var n=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),t.originalEvent.dataTransfer.dropEffect=n.data(r)?"none":"copy",n.data(o,!1)}})).on("drop",".native-droppable",(function(t){if(t.originalEvent&&t.originalEvent.dataTransfer){var n,i=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),i.removeClass(l),n=t.currentTarget.id?i.hasClass(a)?O.n
144avId2Hash(t.currentTarget.id):O.cwdId2Hash(t.currentTarget.id):O.cwd().hash,t.originalEvent._target=n,O.exec("upload",{dropEvt:t.originalEvent,target:n},void 0,n)}}))}(),!1===O.cssloaded&&(O.cssloaded=!0,O.trigger("cssloaded")),O.zIndexCalc(),void O.trigger("init").request({data:{cmd:"open",target:O.startDir(),init:1,tree:1},preventDone:!0,notify:{type:"open",cnt:1,hideCnt:!0},freeze:!0}).fail((function(){O.trigger("fail").disable().lastDir(""),Y={},Q={},e(document).add(P).off("."+N),O.trigger=function(){}})).done((function(t){var n=function(e){var t=O.file(O.trashes[e]);O.options.debug;t&&t.volumeid&&delete O.volOptions[t.volumeid].trashHash,O.trashes[e]=!1,O.debug("backend-error",'Trash hash "'+e+'" was not found or not writable.')},i={};O.options.rawStringDecoder&&O.registRawStringDecoder(O.options.rawStringDecoder),O.zIndexCalc(),O.load().debug("api",O.api),P.trigger("resize"),pe(t),O.trigger("open",t,!1),O.trigger("opendone"),ke&&O.options.enableAlways&&e(window).trigger("focus"),e.each(O.trashes,(function(e){var t=O.file(e);t?"directory"===t.mime&&t.write||n(e):i[e]=!0})),Object.keys(i).length&&O.request({data:{cmd:"info",targets:Object.keys(i)},preventDefault:!0}).done((function(t){t&&t.files&&e.each(t.files,(function(e,t){"directory"===t.mime&&t.write&&delete i[t.hash]}))})).always((function(){e.each(i,n)})),O[O.options.enableAlways?"enable":"disable"]()}))):alert(O.i18n("errURL")):alert(O.i18n("errNode")):alert(O.i18n("errJqui"))},i&&"function"==typeof i&&(O.bootCallback=i,i.call(P.get(0),O,{dfrdsBeforeBootup:D})),e.when.apply(null,D).done((function(){c()})).fail((function(e){O.error(e)}))};return(void 0===(n=n||!1)||n)&&(window.elFinder=h),h.prototype={uniqueid:0,res:function(e,t){return this.resources[e]&&this.resources[e][t]},OS:-1!==navigator.userAgent.indexOf("Mac")?"mac":-1!==navigator.userAgent.indexOf("Win")?"win":"other",UA:(r=!document.unqueID&&!window.opera&&!window.sidebar&&"localStorage"in window&&"WebkitAppearance"in document.documentElement.style,s=r&&window.chrome,{ltIE6:void 0===window.addEventListener&&void 0===document.documentElement.style.maxHeight,ltIE7:void 0===window.addEventListener&&void 0===document.querySelectorAll,ltIE8:void 0===window.addEventListener&&void 0===document.getElementsByClassName,ltIE9:document.uniqueID&&document.documentMode<=9,ltIE10:document.uniqueID&&document.documentMode<=10,gtIE11:document.uniqueID&&document.documentMode>=11,IE:document.uniqueID,Firefox:window.sidebar,Opera:window.opera,Webkit:r,Chrome:s,Edge:!(!s||!window.msCredentials),Safari:r&&!window.chrome,Mobile:void 0!==window.orientation,Touch:void 0!==window.ontouchstart,iOS:navigator.platform.match(/^iP(?:[ao]d|hone)/),Mac:navigator.platform.match(/^Mac/),Fullscreen:void 0!==(document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen),Angle:0,Rotated:!1,CSS:(i=document.createElement("a").style,o=document.createElement("p").style,i.cssText="position:sticky;position:-webkit-sticky;width:-webkit-max-content;width:-moz-max-content;width:-ms-max-content;width:max-content;",{positionSticky:-1!==i.position.indexOf("sticky"),widthMaxContent:-1!==i.width.indexOf("max-content"),flex:void 0!==o.flex})}),cookieEnabled:window.navigator.cookieEnabled,hasRequire:"function"==typeof define&&define.amd,currentReqCmd:"",keyState:{},i18:{en:{translator:"",language:"English",direction:"ltr",dateFormat:"d.m.Y H:i",fancyDateFormat:"$1 H:i",nonameDateFormat:"ymd-His",messages:{}},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["msJan","msFeb","msMar","msApr","msMay","msJun","msJul","msAug","msSep","msOct","msNov","msDec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},kinds:{unknown:"Unknown",directory:"Folder",group:"Selects",symlink:"Alias","symlink-broken":"AliasBroken","application/x-empty":"TextPlain","application/postscript":"Postscript","application/vnd.ms-office":"MsOffice","application/msword":"MsWord","application/vnd.ms-word":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"MsWord","application/vnd.ms-word.document.macroEnabled.12":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"MsWord","application/vnd.ms-word.template.macroEnabled.12":"MsWord","application/vnd.ms-excel":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"MsExcel","application/vnd.ms-excel.sheet.macroEnabled.12":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"MsExcel","application/vnd.ms-excel.template.macroEnabled.12":"MsExcel","application/vnd.ms-excel.sheet.binary.macroEnabled.12":"MsExcel","application/vnd.ms-excel.addin.macroEnabled.12":"MsExcel","application/vnd.ms-powerpoint":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.presentation":"MsPP","application/vnd.ms-powerpoint.presentation.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"MsPP","application/vnd.ms-powerpoint.slideshow.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.template":"MsPP","application/vnd.ms-powerpoint.template.macroEnabled.12":"MsPP","application/vnd.ms-powerpoint.addin.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slide":"MsPP","application/vnd.ms-powerpoint.slide.macroEnabled.12":"MsPP","application/pdf":"PDF","application/xml":"XML","application/vnd.oasis.opendocument.text":"OO","a
144pplication/vnd.oasis.opendocument.text-template":"OO","application/vnd.oasis.opendocument.text-web":"OO","application/vnd.oasis.opendocument.text-master":"OO","application/vnd.oasis.opendocument.graphics":"OO","application/vnd.oasis.opendocument.graphics-template":"OO","application/vnd.oasis.opendocument.presentation":"OO","application/vnd.oasis.opendocument.presentation-template":"OO","application/vnd.oasis.opendocument.spreadsheet":"OO","application/vnd.oasis.opendocument.spreadsheet-template":"OO","application/vnd.oasis.opendocument.chart":"OO","application/vnd.oasis.opendocument.formula":"OO","application/vnd.oasis.opendocument.database":"OO","application/vnd.oasis.opendocument.image":"OO","application/vnd.openofficeorg.extension":"OO","application/x-shockwave-flash":"AppFlash","application/flash-video":"Flash video","application/x-bittorrent":"Torrent","application/javascript":"JS","application/rtf":"RTF","application/rtfd":"RTF","application/x-font-ttf":"TTF","application/x-font-otf":"OTF","application/x-rpm":"RPM","application/x-web-config":"TextPlain","application/xhtml+xml":"HTML","application/docbook+xml":"DOCBOOK","application/x-awk":"AWK","application/x-gzip":"GZIP","application/x-bzip2":"BZIP","application/x-xz":"XZ","application/zip":"ZIP","application/x-zip":"ZIP","application/x-rar":"RAR","application/x-tar":"TAR","application/x-7z-compressed":"7z","application/x-jar":"JAR","text/plain":"TextPlain","text/x-php":"PHP","text/html":"HTML","text/javascript":"JS","text/css":"CSS","text/rtf":"RTF","text/rtfd":"RTF","text/x-c":"C","text/x-csrc":"C","text/x-chdr":"CHeader","text/x-c++":"CPP","text/x-c++src":"CPP","text/x-c++hdr":"CPPHeader","text/x-shellscript":"Shell","application/x-csh":"Shell","text/x-python":"Python","text/x-java":"Java","text/x-java-source":"Java","text/x-ruby":"Ruby","text/x-perl":"Perl","text/x-sql":"SQL","text/xml":"XML","text/x-comma-separated-values":"CSV","text/x-markdown":"Markdown","image/x-ms-bmp":"BMP","image/jpeg":"JPEG","image/gif":"GIF","image/png":"PNG","image/tiff":"TIFF","image/x-targa":"TGA","image/vnd.adobe.photoshop":"PSD","image/xbm":"XBITMAP","image/pxm":"PXM","image/webp":"WEBP","application/vnd.ms-fontobject":"EOT","font/sfnt":"SFNT","application/font-sfnt":"SFNT","font/ttf":"TTF","font/opentype":"OTF","font/otf":"OTF","application/x-font-opentype":"OTF","font/woff":"WOFF","application/font-woff":"WOFF","font/woff2":"WOFF2","application/font-woff2":"WOFF2","audio/mpeg":"AudioMPEG","audio/midi":"AudioMIDI","audio/ogg":"AudioOGG","audio/mp4":"AudioMPEG4","audio/x-m4a":"AudioMPEG4","audio/wav":"AudioWAV","audio/x-mp3-playlist":"AudioPlaylist","video/x-dv":"VideoDV","video/mp4":"VideoMPEG4","video/mpeg":"VideoMPEG","video/x-msvideo":"VideoAVI","video/quicktime":"VideoMOV","video/x-ms-wmv":"VideoWM","video/x-flv":"VideoFlash","video/x-matroska":"VideoMKV","video/ogg":"VideoOGG"},mimeTypes:{},rules:{defaults:function(e){return!(!e||e.added&&!Array.isArray(e.added)||e.removed&&!Array.isArray(e.removed)||e.changed&&!Array.isArray(e.changed))},open:function(t){return t&&t.cwd&&t.files&&e.isPlainObject(t.cwd)&&Array.isArray(t.files)},tree:function(e){return e&&e.tree&&Array.isArray(e.tree)},parents:function(e){return e&&e.tree&&Array.isArray(e.tree)},tmb:function(t){return t&&t.images&&(e.isPlainObject(t.images)||Array.isArray(t.images))},upload:function(t){return t&&(e.isPlainObject(t.added)||Array.isArray(t.added))},search:function(e){return e&&e.files&&Array.isArray(e.files)}},commands:{},cmdsToAdd:"archive duplicate extract mkdir mkfile paste rm upload",parseUploadData:function(t){var n,i=this;if(!t.trim())return{error:["errResponse","errDataEmpty"]};try{n=JSON.parse(t)}catch(e){return{error:["errResponse","errDataNotJSON"]}}return n=i.normalize(n),i.validResponse("upload",n)?(n.removed=e.merge(n.removed||[],e.map(n.added||[],(function(e){return i.file(e.hash)?e.hash:null}))),n):{error:n.norError||["errResponse"]}},iframeCnt:0,uploads:{xhrUploading:!1,failSyncTm:null,chunkfailReq:{},checkExists:function(t,n,i,o){var r,s=e.Deferred(),a=[],l={},c=function(){for(var e=t.length;--e>-1;)t[e]._remove=!0},d=function(){s.resolve(a,l)};return i.api>=2.1&&"object"==typeof t[0]?function(){var s=[],h=[],u=n!==i.cwd().hash?i.path(n,!0)+i.option("separator",n):"",p=function(e){var n=e==h.length-1,r={cssClass:"elfinder-confirm-upload",title:i.i18n("cmdupload"),text:["errExists",u+h[e].name,"confirmRepl"],all:!n,accept:{label:"btnYes",callback:function(t){n||t?d():p(++e)}},reject:{label:"btnNo",callback:function(i){var o;if(i)for(o=h.length;e<o--;)t[h[o].i]._remove=!0;else t[h[e].i]._remove=!0;n||i?d():p(++e)}},cancel:{label:"btnCancel",callback:function(){c(),d()}},buttons:[{label:"btnBackup",cssClass:"elfinder-confirm-btn-backup",callback:function(t){var i;if(t)for(i=h.length;e<i--;)a.push(h[i].name);else a.push(h[e].name);n||t?d():p(++e)}}]};o||r.buttons.push({label:"btnRename"+(n?"":"All"),cssClass:"elfinder-confirm-btn-rename",callback:function(){a=null,d()}}),i.iframeCnt>0&&delete r.reject,i.confirm(r)};i.file(n).read?(r=e.map(t,(function(e,t){return!e.name||i.UA.iOS&&"image.jpg"===e.name?null:{i:t,name:e.name}})),i.request({data:{cmd:"ls",target:n,intersect:e.map(r,(function(e){return e.name}))},notify:{type:"preupload",cnt:1,hideCnt:!0},preventDefault:!0}).done((function(t){var o,a;t&&(t.error?c():i.options.overwriteUploadConfirm&&i.option("uploadOverwrite",n)&&t.list&&(Array.isArray(t.list)?s=t.list||[]:(o=[],s=e.map(t.list,(function(e){return"string"==typeof e?e:(o=o.concat(e),!1)})),o.length&&(s=s.concat(o)),l=t.list),(h=e.grep(r,(function(t){return-1!==e.inArray(t.name,s)}))).length&&s.length&&n==i.cwd().hash&&(a=e.map(i.files(n),(function(e){return e.name})),e.grep(s,(function(t){return-1===e.inArray(t,a)})).length&&i.sync()))),h.length>0?p(0):d()})).fail((function(e){c(),d(),e&&i.error(e)}))):d()}():d(),s},checkFile:function(t,n,i){if(t.checked||"files"==t.type)return t.files;if("data"==t.type){var o,r,s=e.Deferred(),a=e.Deferred(),l=[],c=[],d=0,h=[],u=!1,p=function(e){var t,i=n.options.folderUploadExclude[n.OS]||null,o=e.length,r=function(){--d<1&&"pending"===a.state()&&a.resolve()},s=function(e){i&&e.name.match(i)||(c.push(t.fullPath||""),l.push(e)),r()},f=function(e){var t=[],n=function(){e.readEntries((function(e){if(u||!e.length){for(var i=0;i<t.length;i++){if(u){a.reject();break}p([t[i]])}r()}else t=t.concat((o=e,Array.prototype.slice.call(o||[],0))),n();var o}),r)};n()};d++;for(var m=0;m<o;m++){if(u){a.reject();break}(t=e[m])&&(t instanceof File?s(t):t.isFile?(d++,t.file(s,r)):t.isDirectory&&n.api>=2.1&&(d++,h.push(t.fullPath),f(t.createReader())))}return r(),a};return o=e.map(t.files.items,(function(e){return"file"===e.kind?(e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry())||e.getAsFile():null})),e.each(o,(function(e,t){if(t.isDirectory)return r=!0,!1})),o.length>0?(n.uploads.checkExists(o,i,n,r).done((function(r,a){var d=[];
144n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",i)&&(null===r&&(t.overwrite=0,r=[]),o=e.grep(o,(function(t){var o,s,l,c;return t.isDirectory&&r.length&&-1!==(o=e.inArray(t.name,r))&&(r.splice(o,1),s=n.uniqueName(t.name+n.options.backupSuffix,null,""),e.each(a,(function(e,n){if(t.name==n)return l=e,!1})),l||(l=n.fileByName(t.name,i).hash),n.lockfiles({files:[l]}),c=n.request({data:{cmd:"rename",target:l,name:s},notify:{type:"rename",cnt:1}}).fail((function(){t._remove=!0,n.sync()})).always((function(){n.unlockfiles({files:[l]})})),d.push(c)),!t._remove}))),e.when.apply(e,d).done((function(){var e,t,i=+new Date;o.length>0?(t=n.escape(o[0].name),o.length>1&&(t+=" ... "+o.length+n.i18n("items")),e=setTimeout((function(){n.notify({type:"readdir",id:i,cnt:1,hideCnt:!0,msg:n.i18n("ntfreaddir")+" ("+t+")",cancel:function(){u=!0}})}),n.options.notifyDelay),p(o).done((function(){e&&clearTimeout(e),n.notify({type:"readdir",id:i,cnt:-1}),u?s.reject():s.resolve([l,c,r,a,h])})).fail((function(){s.reject()}))):s.reject()}))})),s.promise()):s.reject()}var f=[],m=[],g=t.files[0];if("html"==t.type){var v,b=e("<html></html>").append(e.parseHTML(g.replace(/ src=/gi," _elfsrc=")));e("img[_elfsrc]",b).each((function(){var n,i,o=e(this),r=o.closest("a");r&&r.attr("href")&&r.attr("href").match(/\.(?:jpe?g|gif|bmp|png)/i)&&(i=r.attr("href")),(n=o.attr("_elfsrc"))&&(i?(-1==e.inArray(i,f)&&f.push(i),-1==e.inArray(n,m)&&m.push(n)):-1==e.inArray(n,f)&&f.push(n)),1===f.length&&f[0].match(/^data:image\/png/)&&(t.clipdata=!0)})),(v=e("a[href]",b)).each((function(){var t,n;(t=e(this).text())&&(n=function(e){var t=document.createElement("a");return t.href=e,t}(e(this).attr("href"))).href&&n.href.match(/^(?:ht|f)tp/i)&&(1===v.length||!n.pathname.match(/(?:\.html?|\/[^\/.]*)$/i)||t.trim().match(/\.[a-z0-9-]{1,10}$/i))&&-1==e.inArray(n.href,f)&&-1==e.inArray(n.href,m)&&f.push(n.href)}))}else{var y,x,w;for(y=/((?:ht|f)tps?:\/\/[-_.!~*\'()a-z0-9;/?:\@&=+\$,%#\*\[\]]+)/gi;x=y.exec(g);)w=x[1].replace(/&amp;/g,"&"),-1==e.inArray(w,f)&&f.push(w)}return f},xhr:function(t,n){var i=n||this,o=i.getUI(),r=new XMLHttpRequest,s=null,a=null,l=null,c=t.checked,d=t.isDataType||"data"==t.type,h=t.target||i.cwd().hash,u=t.dropEvt||null,p=t.extraData||null,f=-1!=i.option("uploadMaxConn",h),m=Math.min(5,Math.max(1,i.option("uploadMaxConn",h))),g=0,v=function(t){var n=e.Deferred();return t.promise?t.always((function(e){n.resolve(Array.isArray(e)&&e.length?d?e[0][0]:e[0]:{})})):n.resolve(t.length?d?t[0][0]:t[0]:{}),n},b=e.Deferred().fail((function(e){var t,o=i.parseError(e);"userabort"===o&&(t=!0,o=void 0),x&&(i.uploads.xhrUploading||t)?v(x).done((function(e){t||N(o,e),e._cid?i.uploads.chunkfailReq[e._cid]||(i.uploads.chunkfailReq[e._cid]=!0,setTimeout((function(){n.request({data:{cmd:"upload",target:h,chunk:e._chunk,cid:e._cid,upload:["chunkfail"],mimes:"chunkfail"},options:{type:"post",url:i.uploadURL},preventDefault:!0}).always((function(){delete i.uploads.chunkfailReq[e._chunk]}))}),1e3)):(i.uploads.failSyncTm&&clearTimeout(i.uploads.failSyncTm),i.uploads.failSyncTm=setTimeout((function(){i.sync(h)}),1e3))})):N(o),!t&&i.sync(),i.uploads.xhrUploading=!1,x=null})).done((function(t){i.uploads.xhrUploading=!1,x=null,t&&(i.currentReqCmd="upload",t.warning&&N(t.warning),i.updateCache(t),t.removed&&t.removed.length&&i.remove(t),t.added&&t.added.length&&i.add(t),t.changed&&t.changed.length&&i.change(t),i.trigger("upload",t,!1),i.trigger("uploaddone"),t.toasts&&Array.isArray(t.toasts)&&e.each(t.toasts,(function(){this.msg&&i.toast(this)})),t.sync&&i.sync(),t.debug&&(i.responseDebug(t),n.debug("backend-debug",t)))})).always((function(){i.abortXHR(r),o.off("uploadabort",P),e(window).off("unload",P),s&&clearTimeout(s),a&&clearTimeout(a),l&&clearTimeout(l),c&&!t.multiupload&&I()&&i.notify({type:"upload",cnt:-w,progress:0,size:0}),a&&O&&i.notify({type:"chunkmerge",cnt:-w}),H&&E.children(".elfinder-notify-chunkmerge").length&&i.notify({type:"chunkmerge",cnt:-1})})),y=new FormData,x=t.input?t.input.files:i.uploads.checkFile(t,i,h),w=t.checked&&d?x[0].length:x.length,_=!1,k=0,C=0,S=0,T=!1,E=i.ui.notify,A=!0,O=!1,D=!1,I=function(){return!T&&(U=E.children(".elfinder-notify-upload")).length&&(T=!0),T},P=function(e,t){D=!0,i.abortXHR(r,{quiet:!0,abort:!0}),b.reject(t),I()&&i.notify({type:"upload",cnt:-1*U.data("cnt"),progress:0,size:0})},M=function(e,t){U.children(".elfinder-notify-cancel")[e?"show":"hide"](),A=e},R=function(e){return e||(e=S),setTimeout((function(){T=!0,i.notify({type:"upload",cnt:w,progress:k-C,size:e,cancel:function(){o.trigger("uploadabort","userabort")}}
144),U=E.children(".elfinder-notify-upload"),C=k,t.multiupload?A&&M(!0):M(A&&k<e)}),i.options.notifyDelay)},z=function(){T&&b.notifyWith(U,[{cnt:U.data("cnt"),progress:U.data("progress"),total:U.data("total")}])},N=function(e,t,n){e&&i.trigger("xhruploadfail",{error:e,file:t}),n?e&&(L<i.options.maxErrorDialogs&&(Array.isArray(e)?F=F.concat(e):F.push(e)),L++):e?i.error(e):(F.length&&(L>=i.options.maxErrorDialogs&&(F=F.concat("moreErrors",L-i.options.maxErrorDialogs)),i.error(F)),F=[],L=0)},F=[],L=0,j=t.renames||null,B=t.hashes||null,H=!1,U=e();if(o.one("uploadabort",P),e(window).one("unload."+n.namespace,P),!H&&(C=k),!d&&!w)return b.reject(["errUploadNoFiles"]);r.addEventListener("error",(function(){0==r.status?D?b.reject():!d&&t.files&&e.grep(t.files,(function(e){return!e.type&&e.size===(i.UA.Safari?1802:0)})).length?b.reject(["errAbort","errFolderUpload"]):t.input&&e.grep(t.input.files,(function(e){return!e.type&&e.size===(i.UA.Safari?1802:0)})).length?b.reject(["errUploadNoFiles"]):g++<=30?(I()&&C&&i.notify({type:"upload",cnt:0,progress:0,size:C}),i.abortXHR(r,{quiet:!0}),C=k=0,setTimeout((function(){var e;D||(r.open("POST",i.uploadURL,!0),i.api>=2.1029&&(e=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),"function"==typeof y.delete&&y.delete("reqid"),y.append("reqid",e),r._requestId=e),r.send(y))}),1e4)):o.trigger("uploadabort",["errAbort","errTimeout"]):o.trigger("uploadabort","errConnect")}),!1),r.addEventListener("load",(function(e){var n,a,c=r.status,h=0,u="";if(i.setCustomHeaderByXhr(r),c>=400?u=c>500?"errResponse":["errResponse","errServerError"]:r.responseText||(u=["errResponse","errDataEmpty"]),u&&(o.trigger("uploadabort"),v(x||{}).done((function(e){return b.reject(e._cid?null:u)}))),k=S,I()&&(h=k-C)&&(i.notify({type:"upload",cnt:0,progress:h,size:0}),z()),(n=i.parseUploadData(r.responseText))._chunkmerged){y=new FormData;var p=[{_chunkmerged:n._chunkmerged,_name:n._name,_mtime:n._mtime}];return H=!0,o.off("uploadabort",P),l=setTimeout((function(){i.notify({type:"chunkmerge",cnt:1})}),i.options.notifyDelay),void(d?W(p,x[1]):W(p))}n._multiupload=!!t.multiupload,n.error?(a={cmd:"upload",err:n,xhr:r,rc:r.status},i.trigger("uploadfail",n),i.trigger("requestError",a),(a._getEvent&&a._getEvent().isDefaultPrevented()||i.handleCsrfReload(r,n))&&(n.error=""),n._chunkfailure||n._multiupload?(D=!0,i.uploads.xhrUploading=!1,s&&clearTimeout(s),U.length?(i.notify({type:"upload",cnt:-w,progress:0,size:0}),b.reject(n)):b.reject()):b.reject(n)):b.resolve(n)}),!1),r.upload.addEventListener("loadstart",(function(e){!H&&e.lengthComputable&&(k=e.loaded,g&&(k=0),S=e.total,k||(k=parseInt(.05*S)),I()&&(i.notify({type:"upload",cnt:0,progress:k-C,size:t.multiupload?0:S}),C=k,z()))}),!1),r.upload.addEventListener("progress",(function(e){var n;e.lengthComputable&&!H&&r.readyState<2&&(k=e.loaded,!t.checked&&k>0&&!s&&(s=R(r._totalSize-k)),S||(S=e.total,k||(k=parseInt(.05*S))),n=k-C,I()&&n/e.total>=.05&&(i.notify({type:"upload",cnt:0,progress:n,size:0}),C=k,z()),!O&&k>=S&&!_&&(O=!0,a=setTimeout((function(){i.notify({type:"chunkmerge",cnt:w})}),i.options.notifyDelay)),A&&!t.multiupload&&k>=S&&I()&&M(!1))}),!1);var $,q,W=function(o,a){var l,g,v,x,k,C,S,T,E,O,P,z,L,H,U,$=0,q=1,W=[],V=0,K=w,G=0,X=[],Y=(new Date).getTime().toString().substr(-9),Q=Math.min((n.uplMaxSize?n.uplMaxSize:2097152)-8190,n.options.uploadMaxChunkSize),J=!f&&"",Z=function(o,r){var a,l,c,p=[],f=0;if(!D){for(;o.length&&p.length<r;)p.push(o.shift());if(f=p.length){l=f;for(var m=0;m<f&&!D;m++)a=d?p[m][0][0]._cid||null:p[m][0]._cid||null,c=!(!c&&!a),H[a]?L--:n.exec("upload",{type:t.type,isDataType:d,files:p[m],checked:!0,target:h,dropEvt:u,renames:j,hashes:B,multiupload:!0,overwrite:0===t.overwrite?0:void 0,clipdata:t.clipdata},void 0,h).fail((function(e){e&&"No such command"===e&&(D=!0,n.error(["errUpload","errPerm"])),a&&(H[a]=!0)})).always((function(t){t&&t.added&&(P=e.merge(P,t.added)),L<=++z&&(n.trigger("multiupload",{added:P}),s&&clearTimeout(s),I()&&i.notify({type:"upload",cnt:-w,progress:0,size:0})),o.length?Z(o,1):(--l<=1&&A&&M(!1),b.resolve())}))}}(p.length<1||D)&&(D?(s&&clearTimeout(s),a&&(H[a]=!0),b.reject()):(b.resolve(),i.uploads.xhrUploading=!1))},ee=function(){i.uploads.xhrUploading?setTimeout(ee,100):(i.uploads.xhrUploading=!0,Z(W,m))};if(!c&&(d||"files"==t.type)){for((l=n.option("uploadMaxSize",h))||(l=0),k=0;k<o.length;k++){try{g=(E=o[k]).size,!1===J&&(J="",i.api>=2.1&&("slice"in E?J="slice":"mozSlice"in E?J="mozSlice":"webkitSlice"in E&&(J="webkitSlice")))}catch(e){w--,K--;continue}if(l&&g>
144l||!J&&n.uplMaxSize&&g>n.uplMaxSize)N(["errUploadFile",E.name,"errUploadFileSize"],E,!0),w--,K--;else if(!E.type||i.uploadMimeCheck(E.type,h))if(J&&g>Q){for(C=0,S=Q,T=-1,K=Math.floor((g-1)/Q),v=E.lastModified?Math.round(E.lastModified/1e3):0,x=t.clipdata?n.date(n.nonameDateFormat)+".png":E.name,G+=g,X[Y]=0;C<g;)(O=E[J](C,S))._chunk=x+"."+ ++T+"_"+K+".part",O._cid=Y,O._range=C+","+O.size+","+g,O._mtime=v,X[Y]++,$&&V++,void 0===W[V]&&(W[V]=[],d&&(W[V][0]=[],W[V][1]=[])),$=Q,q=1,d?(W[V][0].push(O),W[V][1].push(a[k])):W[V].push(O),S=(C=S)+Q;null==O?(N(["errUploadFile",E.name,"errUploadFileSize"],E,!0),w--,K--):(K+=T,$=0,q=1,V++)}else(n.uplMaxSize&&$+g>n.uplMaxSize||q>n.uplMaxFile)&&($=0,q=1,V++),void 0===W[V]&&(W[V]=[],d&&(W[V][0]=[],W[V][1]=[])),d?(W[V][0].push(E),W[V][1].push(a[k])):W[V].push(E),$+=g,G+=g,q++;else N(["errUploadFile",E.name,"errUploadMime","("+E.type+")"],E,!0),w--,K--}if(F.length&&N(),0==W.length)return t.checked=!0,!1;if(W.length>1)return s=R(G),P=[],z=0,L=W.length,H=[],ee(),!0;d?(o=W[0][0],a=W[0][1]):o=W[0]}return c||(n.UA.Safari&&t.files?r._totalSize=G:s=R(G)),c=!0,o.length||b.reject(["errUploadNoFiles"]),r.open("POST",i.uploadURL,!0),n.customHeaders&&e.each(n.customHeaders,(function(e){r.setRequestHeader(e,this)})),n.xhrFields&&e.each(n.xhrFields,(function(e){e in r&&(r[e]=this)})),i.api>=2.1029&&(U=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),y.append("reqid",U),r._requestId=U),y.append("cmd","upload"),y.append(i.newAPI?"target":"current",h),j&&j.length&&(e.each(j,(function(e,t){y.append("renames[]",t)})),y.append("suffix",n.options.backupSuffix)),B&&e.each(B,(function(e,t){y.append("hashes["+e+"]",t)})),e.each(i.customData,(function(e,t){y.append(e,t)})),e.each(i.options.onlyMimes,(function(e,t){y.append("mimes[]",t)})),e.each(o,(function(e,i){var o;i._chunkmerged?(y.append("chunk",i._chunkmerged),y.append("upload[]",i._name),y.append("mtime[]",i._mtime),t.clipdata&&y.append("overwrite",0),_=!0):(i._chunkfail?(y.append("upload[]","chunkfail"),y.append("mimes","chunkfail")):(t.clipdata?i._chunk||(t.overwrite=0,o=n.date(n.nonameDateFormat)+".png"):i.name&&(o=i.name,n.UA.iOS&&(o.match(/^image\.jpe?g$/i)?(t.overwrite=0,o=n.date(n.nonameDateFormat)+".jpg"):o.match(/^capturedvideo\.mov$/i)&&(t.overwrite=0,o=n.date(n.nonameDateFormat)+".mov")),o=(i.webkitRelativePath||i.relativePath||i._relativePath||"").replace(/[^\/]+$/,"")+o),o?y.append("upload[]",i,o):y.append("upload[]",i)),i._chunk?(y.append("chunk",i._chunk),y.append("cid",i._cid),y.append("range",i._range),y.append("mtime[]",i._mtime),_=!0):y.append("mtime[]",i.lastModified?Math.round(i.lastModified/1e3):0))})),d&&e.each(a,(function(e,t){y.append("upload_path[]",t)})),0===t.overwrite&&y.append("overwrite",0),u&&y.append("dropWith",parseInt((u.altKey?"1":"0")+(u.ctrlKey?"1":"0")+(u.metaKey?"1":"0")+(u.shiftKey?"1":"0"),2)),p&&e.each(p,(function(e,t){y.append(e,t)})),r.send(y),!0};if(d)c?W(x[0],x[1]):x.done((function(t){if(j=[],w=t[0].length){if(t[4]&&t[4].length)return void n.request({data:{cmd:"mkdir",target:h,dirs:t[4]},notify:{type:"mkdir",cnt:t[4].length},preventFail:!0}).fail((function(e){"errCmdParams"===(e=e||["errUnknown"])[0]?m=1:(m=0,b.reject(e))})).done((function(n){var i=!1;n.hashes||(n.hashes={}),t[1]=e.map(t[1],(function(e,o){return t[0][o]._relativePath=e.replace(/^\//,""),""===(e=e.replace(/\/[^\/]*$/,""))?h:n.hashes[e]?n.hashes[e]:(i=!0,t[0][o]._remove=!0,null)})),i&&(t[0]=e.grep(t[0],(function(e){return!e._remove})))})).always((function(e){m&&(j=t[2],B=t[3],W(t[0],t[1]))}));t[1]=e.map(t[1],(function(){return h})),j=t[2],B=t[3],W(t[0],t[1])}else b.reject(["errUploadNoFiles"])})).fail((function(){b.reject()}));else if(x.length>0)if(t.clipdata||null!=j)W(x)||b.reject();else{var V=[],K=[],G=n.options.folderUploadExclude[n.OS]||null;e.each(x,(function(t,n){var i,o,r=n.webkitRelativePath||n.relativePath||"";if(!r)return!1;G&&n.name.match(G)?(n._remove=!0,r=void 0):(r="/"+r.replace(/\/[^\/]*$/,"").replace(/^\//,""))&&-1===e.inArray(r,V)&&(V.push(r),-1!==(i=r.substr(1).indexOf("/"))&&(o=r.substr(0,i+1))&&-1===e.inArray(o,V)&&V.unshift(o)),K.push(r)})),j=[],B={},V.length?($=e.map(V,(function(e){return-1===e.substr(1).indexOf("/")?{name:e.substr(1)}:null})),q=[],n.uploads.checkExists($,h,n,!0).done((function(t,i){var o,r,s=[];n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",h)&&(q=e.map($,(function(e){return e._remove?e.name:null})),$=e.grep($,(function(e){return!e._remove}))),q.length&&e.each(K.concat(),(function(t,n){0===e.inArray(n,q)&&(x[t]._remove=!0,K[t]=void 0)})),x=e.grep(x,(function(e){return!e._remove})),K=e.grep(K,(function(e){return void 0!==e})),$.length?(e.Deferred(),t.length?e.each(t,(function(a,l){o=n.uniqueName(l+n.options.backupSuffix,null,""),e.each(i,(function(e,n){if(t[0]==n)return r=e,!1})),r||(r=n.fileByName(t[0],h).hash),n.lockfiles({files:[r]}),s.push(n.request({data:{cmd:"rename",target:r,name:o},notify:{type:"rename",cnt:1}}).fail((function(e){b.reject(e),n.sync()})).always((function(){n.unlockfiles({files:[r]})})))})):s.push(null),e.when.apply(e,s).done((function(){n.request({data:{cmd:"mkdir",target:h,dirs:V},notify:{type:"mkdir",cnt:V.length},preventFail:!0}).fail((function(e){"errCmdParams"===(e=e||["errUnknown"])[0]?m=1:(m=0,b.reject(e))})).done((function(t){var n=!1;t.hashes||(t.hashes={}),K=e.map(K.concat(),(function(e,i){return"/"===e?h:t.hashes[e]?t.hashes[e]:(n=!0,x[i]._remove=!0,null)})),n&&(x=e.grep(x,(function(e){return!e._remove})))})).always((function(e){m&&(d=!0,W(x,K)||b.reject())}
144))}))):b.reject()}))):n.uploads.checkExists(x,h,n).done((function(i,o){n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",h)&&(B=o,null===i?t.overwrite=0:j=i,x=e.grep(x,(function(e){return!e._remove}))),(w=x.length)>0&&W(x)||b.reject()}))}else b.reject();return b},iframe:function(t,n){var i,o,r,s,a=n||this,l=!!t.input&&t.input,c=!l&&a.uploads.checkFile(t,a),d=e.Deferred().fail((function(e){e&&a.error(e)})),h="iframe-"+n.namespace+ ++a.iframeCnt,u=e('<form action="'+a.uploadURL+'" method="post" enctype="multipart/form-data" encoding="multipart/form-data" target="'+h+'" style="display:none"><input type="hidden" name="cmd" value="upload" /></form>'),p=this.UA.IE,f=function(){s&&clearTimeout(s),r&&clearTimeout(r),o&&a.notify({type:"upload",cnt:-i}),setTimeout((function(){p&&e('<iframe src="javascript:false;"></iframe>').appendTo(u),u.remove(),m.remove()}),100)},m=e('<iframe src="'+(p?"javascript:false;":"about:blank")+'" name="'+h+'" style="position:absolute;left:-1000px;top:-1000px" ></iframe>').on("load",(function(){m.off("load").on("load",(function(){f(),d.resolve()})),r=setTimeout((function(){o=!0,a.notify({type:"upload",cnt:i})}),a.options.notifyDelay),a.options.iframeTimeout>0&&(s=setTimeout((function(){f(),d.reject(["errConnect","errTimeout"])}),a.options.iframeTimeout)),u.submit()})),g=t.target||a.cwd().hash,v=[],b=[],y=[],x={};if(c&&c.length)e.each(c,(function(e,t){u.append('<input type="hidden" name="upload[]" value="'+t+'"/>')})),i=1;else{if(!(l&&e(l).is(":file")&&e(l).val()))return d.reject();n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",g)&&(v=l.files?l.files:[{name:e(l).val().replace(/^(?:.+[\\\/])?([^\\\/]+)$/,"$1")}],b.push(a.uploads.checkExists(v,g,a).done((function(n,o){x=o,null===n?t.overwrite=0:(y=n,(i=e.grep(v,(function(e){return!e._remove})).length)!=v.length&&(i=0))})))),i=l.files?l.files.length:1,u.append(l)}return e.when.apply(e,b).done((function(){if(i<1)return d.reject();u.append('<input type="hidden" name="'+(a.newAPI?"target":"current")+'" value="'+g+'"/>').append('<input type="hidden" name="html" value="1"/>').append('<input type="hidden" name="node" value="'+a.id+'"/>').append(e(l).attr("name","upload[]")),y.length>0&&(e.each(y,(function(e,t){u.append('<input type="hidden" name="renames[]" value="'+a.escape(t)+'"/>')})),u.append('<input type="hidden" name="suffix" value="'+n.options.backupSuffix+'"/>')),x&&e.each(y,(function(e,t){u.append('<input type="hidden" name="['+e+']" value="'+a.escape(t)+'"/>')})),0===t.overwrite&&u.append('<input type="hidden" name="overwrite" value="0"/>'),e.each(a.options.onlyMimes||[],(function(e,t){u.append('<input type="hidden" name="mimes[]" value="'+a.escape(t)+'"/>')})),e.each(a.customData,(function(e,t){u.append('<input type="hidden" name="'+e+'" value="'+a.escape(t)+'"/>')})),u.appendTo("body"),m.appendTo("body")})),d}},one:function(e,t,n){var i=this,o=e.toLowerCase(),r=function(e,n){return i.toUnbindEvents[o]||(i.toUnbindEvents[o]=[]),i.toUnbindEvents[o].push({type:o,callback:r}),(t.done?t.done:t).apply(this,arguments)};return t.done&&(r={done:r}),this.bind(o,r,n)},localStorage:function(t,n){var i,o,r,s,a,l=window.localStorage,c="elfinder-"+(t||"")+this.id,d=window.location.pathname+"-elfinder-",h=this.id,u=[];if(void 0===t)return s=d.length,a=-1*h.length,e.each(l,(function(e){e.substr(0,s)===d&&e.substr(a)===h&&u.push(e)})),e.each(u,(function(e,t){l.removeItem(t)})),!0;if(t=d+t+h,null===n)return l.removeItem(t);if(void 0===n&&!(i=l.getItem(t))&&(o=l.getItem(c))&&(n=o,l.removeItem(c)),void 0!==n){"string"!==(r=typeof n)&&"number"!==r&&(n=JSON.stringify(n));try{l.setItem(t,n)}catch(e){try{l.clear(),l.setItem(t,n)}catch(e){this.debug("error",e.toString())}}i=l.getItem(t)}if(i&&("{"===i.substr(0,1)||"["===i.substr(0,1)))try{return JSON.parse(i)}catch(e){}return i},sessionStorage:function(e,t){var n,i,o;try{n=window.sessionStorage}catch(e){}if(n){if(null===t)return n.removeItem(e);if(void 0!==t){"string"!==(o=typeof t)&&"number"!==o&&(t=JSON.stringify(t));try{n.setItem(e,t)}catch(i){try{n.clear(),n.setItem(e,t)}catch(e){this.debug("error",e.toString())}}}if((i=n.getItem(e))&&("{"===i.substr(0,1)||"["===i.substr(0,1)))try{return JSON.parse(i)}catch(e){}return i}},cookie:function(e,t){var n,i,o,r,s,a;if(e="elfinder-"+e+this.id,void 0===t){if(this.cookieEnabled&&document.cookie&&""!=document.cookie)for(o=document.cookie.split(";"),e+="=",r=0;r<o.length;r++)if(o[r]=o[r].trim(),o[r].substring(0,e.length)==e){if("{"===(s=decodeURIComponent(o[r].substring(e.length))).substr(0,1)||"["===s.substr(0,1))try{return JSON.parse(s)}catch(e){}return s}return null}if(!this.cookieEnabled)return"";if(i=Object.assign({},this.options.cookie),null===t?(t="",i.expires=-1):"string"!==(a=typeof t)&&"number"!==a&&(t=JSON.stringify(t)),"number"==typeof i.expires&&((n=new Date).setTime(n.getTime()+864e5*i.expires),i.expires=n),document.cookie=e+"="+encodeURIComponent(t)+"; expires="+i.expires.toUTCString()+(i.path?"; path="+i.path:"")+(i.domain?"; domain="+i.domain:"")+(i.secure?"; secure":"")+(i.samesite?"; samesite="+i.samesite:""),t&&("{"===t.substr(0,1)||"["===t.substr(0,1)))try{return JSON.parse(t)}catch(e){}return t},startDir:function(){var e=window.location.hash;return e&&e.match(/^#elf_/)?e.replace(/^#elf_/,""):this.options.startPathHash?this.options.startPathHash:this.lastDir()},lastDir:function(e){return this.options.rememberLastDir?this.storage("lastdir",e):""},_node:e("<span></c.length;>"),escape:function(e){return this._node.text(e).html().replace(/"/g,"&quot;").replace(/'/g,"&#039;")},normalize:function(t){var n,i,o,r,s,a,l,c=this,d=function(){var e,t;return(t=c.options.fileFilter)&&("function"==typeof t?e=function(e){return t.call(c,e)}:t instanceof RegExp&&(e=function(e){return t.test(e.name)}
144)),e||null}(),h=function(t){var n=function(e){var t=typeof e;return"object"===t&&Array.isArray(e)&&(t="array"),t};return e.each(c.optionProperties,(function(e,i){void 0!==i&&t[e]&&n(t[e])!==n(i)&&(t[e]=i)})),t.disabled?(t.disabledFlip=c.arrayFlip(t.disabled,!0),e.each(c.options.disabledCmdsRels,(function(n,i){var o,r;(t.disabledFlip[n]||(o=n.match(/^([^&]+)&([^=]+)=(.*)$/))&&t.disabledFlip[o[1]]&&t[o[2]]==o[3])&&(r=!0),r&&e.each(i,(function(e,n){t.disabledFlip[n]||(t.disabledFlip[n]=!0,t.disabled.push(n))}))}))):t.disabledFlip={},t},u=function(t,s,a){var l,u,p,m,g,v,b=!s||t,y=!!s&&null;if(t&&t.hash&&t.name&&t.mime){if("application/x-empty"===t.mime&&(t.mime="text/plain"),(p=c.isRoot(t))&&!t.volumeid&&c.debug("warning","The volume root statuses requires `volumeid` property."),p||"directory"===t.mime){if(t.phash){if(t.phash===t.hash)return f=f.concat(['Parent folder of "$1" is itself.',t.name]),y;if(p&&t.volumeid&&0===t.phash.indexOf(t.volumeid))return f=f.concat(['Parent folder of "$1" is inner itself.',t.name]),y}t.volumeid&&(l=t.volumeid,p&&(t.phash&&(c.leafRoots[t.phash]?-1===e.inArray(t.hash,c.leafRoots[t.phash])&&c.leafRoots[t.phash].push(t.hash):c.leafRoots[t.phash]=[t.hash]),c.hasVolOptions=!0,c.volOptions[l]||(c.volOptions[l]={dispInlineRegex:c.options.dispInlineRegex}),u=c.volOptions[l],t.options&&Object.assign(u,t.options),t.disabled&&(u.disabled=t.disabled,u.disabledFlip=c.arrayFlip(t.disabled,!0)),t.tmbUrl&&(u.tmbUrl=t.tmbUrl),u.url&&"/"!==u.url.substr(-1)&&(u.url+="/"),(g=u).uiCmdMap&&(e.isPlainObject(g.uiCmdMap)&&Object.keys(g.uiCmdMap).length?(g.disabledFlip||(g.disabledFlip={}),v=g.disabledFlip,e.each(g.uiCmdMap,(function(e,t){"hidden"!==t||v[e]||(g.disabled.push(e),g.disabledFlip[e]=!0)}))):delete g.uiCmdMap),u.trashHash&&(!1===c.trashes[u.trashHash]?delete u.trashHash:c.trashes[u.trashHash]=t.hash),e.each(c.optionProperties,(function(e){u[e]&&(t[e]=u[e])})),"cwd"!==a&&(c.roots[l]=t.hash),t.expires&&(c.volumeExpires[l]=t.expires)),r!==l&&(r=l,o=c.option("i18nFolderName",l))),p&&!t.i18&&(n="volume_"+t.name,i=c.i18n(!1,n),n!==i&&(t.i18=i)),o&&!t.i18&&(n="folder_"+t.name,i=c.i18n(!1,n),n!==i&&(t.i18=i)),p&&!1!==c.options.enableRootRename&&(m=c.storage("rootNames"))&&(m[t.hash]&&(t._name=t.name,t._i18=t.i18,t.name=m[t.hash]=m[t.hash],delete t.i18),c.storage("rootNames",m)),c.trashes[t.hash]&&(t.locked=!0)}else{if(d)try{if(!d(t))return y}catch(e){c.debug(e)}0==t.size&&(t.mime=c.getMimetype(t.name,t.mime))}return t.options&&(c.optionsByHashes[t.hash]=h(t.options)),delete t.options,b}return y},p=function(n,i){e.each(n,(function(n,o){var r,s;c.leafRoots[o.hash]&&c.applyLeafRootStats(o),"change"!==i&&o.phash&&c.isRoot(o)&&(r=c.file(o.phash))&&(c.applyLeafRootStats(r),t.changed?(e.each(t.changed,(function(e,n){if(n.hash===r.hash)return t.changed[e]=r,s=!0,!1})),s||t.changed.push(r)):t.changed=[r])}))},f=[];if(t.customData&&(!c.prevCustomData||JSON.stringify(t.customData)!==JSON.stringify(c.prevCustomData))){c.prevCustomData=t.customData;try{s=JSON.parse(t.customData),e.isPlainObject(s)&&(c.prevCustomData=s,e.each(Object.keys(s),(function(e,t){null===s[t]&&(delete s[t],delete c.optsCustomData[t])})),c.customData=Object.assign({},c.optsCustomData,s))}catch(e){}}return t.options&&h(t.options),t.cwd&&(t.cwd.volumeid&&t.options&&Object.keys(t.options).length&&c.isRoot(t.cwd)&&(c.hasVolOptions=!0,c.volOptions[t.cwd.volumeid]=t.options),t.cwd=u(t.cwd,!0,"cwd")),t.files&&(t.files=e.grep(t.files,u)),t.tree&&(t.tree=e.grep(t.tree,u)),t.added&&(t.added=e.grep(t.added,u)),t.changed&&(t.changed=e.grep(t.changed,u)),t.removed&&t.removed.length&&2===c.searchStatus.state&&(t.removed=t.removed.concat((a=t.removed,l=[],e.each(c.files(),(function(t,n){e.each(c.parents(t),(function(n,i){if(-1!==e.inArray(i,a)&&-1===e.inArray(t,a))return l.push(t),!1}))})),l))),t.api&&(t.init=!0),Object.keys(c.leafRoots).length&&(t.files&&p(t.files),t.tree&&p(t.tree),t.added&&p(t.added),t.changed&&p(t.changed,"change")),t.cwd&&t.cwd.options&&t.options&&Object.assign(t.options,h(t.cwd.options)),t.options&&t.options.url&&"/"!==t.options.url.substr(-1)&&(t.options.url+="/"),f.length&&(t.norError=["errResponse"].concat(f)),t},setSort:function(e,t,n,i){this.storage("sortType",this.sortType=this.sortRules[e]?e:"name"),this.storage("sortOrder",this.sortOrder=/asc|desc/.test(t)?t:"asc"),this.storage("sortStickFolders",(this.sortStickFolders=!!n)?1:""),this.storage("sortAlsoTreeview",(this.sortAlsoTreeview=!!i)?1:""),this.trigger("sortchange")},_sortRules:{name:function(e,t){return h.prototype.naturalCompare(e.i18||e.name,t.i18||t.name)}
144,size:function(e,t){var n=parseInt(e.size)||0,i=parseInt(t.size)||0;return n===i?0:n>i?1:-1},kind:function(e,t){return h.prototype.naturalCompare(e.mime,t.mime)},date:function(e,t){var n=e.ts||e.date||0,i=t.ts||t.date||0;return n===i?0:n>i?1:-1},perm:function(e,t){var n=function(e){return(e.write?2:0)+(e.read?1:0)},i=n(e),o=n(t);return i===o?0:i>o?1:-1},mode:function(e,t){var n=e.mode||e.perm||"",i=t.mode||t.perm||"";return h.prototype.naturalCompare(n,i)},owner:function(e,t){var n=e.owner||"",i=t.owner||"";return h.prototype.naturalCompare(n,i)},group:function(e,t){var n=e.group||"",i=t.group||"";return h.prototype.naturalCompare(n,i)}},sorters:{},naturalCompare:function(e,t){var n=h.prototype.naturalCompare;return void 0===n.loc&&(n.loc=navigator.userLanguage||navigator.browserLanguage||navigator.language||"en-US"),void 0===n.sort&&("11".localeCompare("2",n.loc,{numeric:!0})>0?window.Intl&&window.Intl.Collator?n.sort=new Intl.Collator(n.loc,{numeric:!0}).compare:n.sort=function(e,t){return e.localeCompare(t,n.loc,{numeric:!0})}:(n.sort=function(e,t){var i,o,r=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,s=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,d=/^[\x01\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/,h=function(e){return n.sort.insensitive&&(""+e).toLowerCase()||""+e},u=h(e).replace(s,"").replace(/^_/,"�")||"",p=h(t).replace(s,"").replace(/^_/,"�")||"",f=u.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=p.replace(r,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),g=parseInt(u.match(l))||1!=f.length&&u.match(a)&&Date.parse(u),v=parseInt(p.match(l))||g&&p.match(a)&&Date.parse(p)||null,b=0;if(v){if(g<v)return-1;if(g>v)return 1}for(var y=0,x=Math.max(f.length,m.length);y<x;y++){if(i=!(f[y]||"").match(c)&&parseFloat(f[y])||f[y]||0,o=!(m[y]||"").match(c)&&parseFloat(m[y])||m[y]||0,isNaN(i)!==isNaN(o)){if(isNaN(i)&&("string"!=typeof i||!i.match(d)))return 1;if("string"!=typeof o||!o.match(d))return-1}if(0===parseInt(i,10)&&(i=0),0===parseInt(o,10)&&(o=0),typeof i!=typeof o&&(i+="",o+=""),n.sort.insensitive&&"string"==typeof i&&"string"==typeof o&&0!==(b=i.localeCompare(o,n.loc)))return b;if(i<o)return-1;if(i>o)return 1}return 0},n.sort.insensitive=!0)),n.sort(e,t)},compare:function(e,t){var n,i=this,o=i.sortType,r="asc"==i.sortOrder,s=i.sortStickFolders,a=i.sortRules,l=a[o],c="directory"==e.mime,d="directory"==t.mime;if(s){if(c&&!d)return-1;if(!c&&d)return 1}return n=r?l(e,t):l(t,e),"name"!==o&&0===n?n=r?a.name(e,t):a.name(t,e):n},sortFiles:function(e){return e.sort(this.compare)},notify:function(t){var n,i,o,r=this,s=t.type,a=t.id?"elfinder-notify-"+t.id:"",l=this.i18n(void 0!==t.msg?t.msg:this.messages["ntf"+s]?"ntf"+s:"ntfsmth"),c=this.arrayFlip(this.options.notifyDialog.hiddens||[]),d=this.ui.notify,h=d.closest(".ui-dialog"),u=d.children(".elfinder-notify-"+s+(a?"."+a:"")),p=u.children("div.elfinder-notify-cancel").children("button"),f='<div class="elfinder-notify elfinder-notify-{type}'+(a?" "+a:"")+'"><span class="elfinder-dialog-icon elfinder-dialog-icon-{type}"></span><span class="elfinder-notify-msg">{msg}</span> <span class="elfinder-notify-cnt"></span><div class="elfinder-notify-progressbar"><div class="elfinder-notify-progress"></div></div><div class="elfinder-notify-cancel"></div></div>',m=t.cnt+0,g=void 0!==t.size?parseInt(t.size):null,v=void 0!==t.progress&&t.progress>=0?t.progress:null,b=t.fakeinterval||200,y=t.cancel,x=function(){var t=u.find(".elfinder-notify-progress"),n=function(){u.remove(),d.children(h.data("minimized")?void 0:":visible").length||(h.data("minimized")?h.data("minimized").hide():d.elfinderdialog("close")),_()};u._esc&&e(document).off("keydown",u._esc),u.data("cur")<100?t.animate({width:"100%"},50,(function(){requestAnimationFrame((function(){n()}))})):n()},w=function(e){var t;u.length&&(t=u.data("cur")+1)<=98&&(u.find(".elfinder-notify-progress").width(t+"%"),u.data("cur",t),_(),setTimeout((function(){w(e*=1.05)}),e))},_=function(){var t,n=0,i=0,o=d.children(".elfinder-notify");o.length?(o.each((function(){n++,i+=Math.min(e(this).data("cur"),100)})),t=n?Math.floor(i/(100*n)*100)+"%":0,r.ui.progressbar.width(t),h.data("minimized")&&(h.data("minimized").title(t),h.data("minimized").dialog().children(".ui-dialog-titlebar").children(".elfinder-ui-progressbar").width(t))):(r.ui.progressbar.width(0),h.data("minimized")&&h.data("minimized").hide())};return s?(u.length?void 0!==t.msg&&u.children("span.elfinder-notify-msg").html(l):(u=e(f.replace(/\{type\}/g,s).replace(/\{msg\}/g,l)),c[s]?u.hide():d.on("minimize",(function(e){h.data("minimized")&&_()})),u.appendTo(d).data("cnt",0),null!=v?u.data({progress:0,total:0,cur:0}):(u.data({cur:0}),w(b)),y&&(p=e('<span class="elfinder-notify-button ui-icon ui-icon-close" title="'+this.i18n("btnCancel")+'"></span>').on("mouseenter mouseleave",(function(t){e(this).toggleClass("ui-state-hover","mouseenter"
144===t.type)})),u.children("div.elfinder-notify-cancel").append(p)),d.trigger("resize")),(n=m+parseInt(u.data("cnt")))>0?(y&&p.length&&("function"==typeof y||"object"==typeof y&&y.promise)&&(u._esc=function(t){"keydown"==t.type&&t.keyCode!=e.ui.keyCode.ESCAPE||(t.preventDefault(),t.stopPropagation(),x(),y.promise?y.reject(0):y(t))},p.on("click",(function(e){u._esc(e)})),e(document).on("keydown."+this.namespace,u._esc)),!t.hideCnt&&u.children(".elfinder-notify-cnt").text("("+n+")"),m>0&&d.is(":hidden")&&!c[s]&&(h.data("minimized")?h.data("minimized").show():d.elfinderdialog("open",this).height("auto")),u.data("cnt",n),null!=v&&(i=u.data("total"))>=0&&(o=u.data("progress"))>=0&&(i+=null!=g?g:m,o+=v,null==g&&m<0&&(o+=100*m),u.data({progress:o,total:i}),null!=g&&(o*=100,i=Math.max(1,i)),v=Math.min(parseInt(o/i),100),u.find(".elfinder-notify-progress").animate({width:(v<100?v:100)+"%"},20,(function(){u.data("cur",v),_()})))):x(),this):this},confirm:function(t){var n,i,o=this,r=!1,s={cssClass:"elfinder-dialog-confirm",modal:!0,resizable:!1,title:this.i18n(t.title||"confirmReq"),buttons:{},close:function(){!r&&t.cancel.callback(),e(this).elfinderdialog("destroy")}},a=this.i18n("apllyAll");return t.cssClass&&(s.cssClass+=" "+t.cssClass),s.buttons[this.i18n(t.accept.label)]=function(){t.accept.callback(!(!n||!n.prop("checked"))),r=!0,e(this).elfinderdialog("close")},s.buttons[this.i18n(t.accept.label)]._cssClass="elfinder-confirm-accept",t.reject&&(s.buttons[this.i18n(t.reject.label)]=function(){t.reject.callback(!(!n||!n.prop("checked"))),r=!0,e(this).elfinderdialog("close")},s.buttons[this.i18n(t.reject.label)]._cssClass="elfinder-confirm-reject"),t.buttons&&t.buttons.length>0&&(i=1,e.each(t.buttons,(function(t,a){s.buttons[o.i18n(a.label)]=function(){a.callback(!(!n||!n.prop("checked"))),r=!0,e(this).elfinderdialog("close")},s.buttons[o.i18n(a.label)]._cssClass="elfinder-confirm-extbtn"+i++,a.cssClass&&(s.buttons[o.i18n(a.label)]._cssClass+=" "+a.cssClass)}))),s.buttons[this.i18n(t.cancel.label)]=function(){e(this).elfinderdialog("close")},s.buttons[this.i18n(t.cancel.label)]._cssClass="elfinder-confirm-cancel",t.all&&(s.create=function(){var t=e('<div class="elfinder-dialog-confirm-applyall"></div>');n=e('<input type="checkbox" />'),e(this).next().find(".ui-dialog-buttonset").prepend(t.append(e("<label>"+a+"</label>").prepend(n)))}),t.optionsCallback&&"function"==typeof t.optionsCallback&&t.optionsCallback(s),this.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-confirm"></span>'+this.i18n(t.text),s)},uniqueName:function(e,t,n){var i,o,r=0,s="";if(e=this.i18n(!1,e),t=t||this.cwd().hash,n=void 0===n?" ":n,(i=e.match(/^(.+)(\.[^.]+)$/))&&(s=i[2],e=i[1]),o=e+s,!this.fileByName(o,t))return o;for(;r<1e4;)if(o=e+n+ ++r+s,!this.fileByName(o,t))return o;return e+Math.random()+s},i18n:function(){var t,n,i,o,r,s=this,a=this.messages,l=[],c=[],d=function(e){var t;return 0===e.indexOf("#")&&(t=s.file(e.substr(1)))?t.name:e},h=0;for(arguments.length&&!1===arguments[0]&&(o=function(e){return e},h=1),t=h;t<arguments.length;t++)if(i=arguments[t],Array.isArray(i))for(n=0;n<i.length;n++)i[n]instanceof jQuery?l.push(i[n]):void 0!==i[n]&&l.push(d(""+i[n]));else i instanceof jQuery?l.push(i[n]):void 0!==i&&l.push(d(""+i));for(t=0;t<l.length;t++)-1===e.inArray(t,c)&&("string"==typeof(i=l[t])?(r=!(!a[i]||!i.match(/^err/)),i=(i=a[i]||(o?o(i):s.escape(i))).replace(/\$(\d+)/g,(function(e,n){var i;return(n=t+parseInt(n))>0&&l[n]&&c.push(n),i=o?o(l[n]):s.escape(l[n]),r&&(i='<span class="elfinder-err-var elfinder-err-var'+n+'">'+i+"</span>"),i}))):i=i.get(0).outerHTML,l[t]=i);return e.grep(l,(function(t,n){return-1===e.inArray(n,c)}
144)).join("<br>")},getIconStyle:function(t,n){var i=this,o="",r={},s=0;return t.icon&&(o='style="',e.each({background:"url('{url}') 0 0 no-repeat","background-size":"contain"},(function(e,a){0==s++&&(a=a.replace("{url}",i.escape(t.icon))),n?r[e]=a:o+=e+":"+a+";"})),o+='"'),n?r:o},mime2class:function(e){var t="elfinder-cwd-icon-",n=e.toLowerCase(),i=this.textMimes[n];return n=n.split("/"),i?n[0]+=" "+t+"text":n[1]&&n[1].match(/\+xml$/)&&(n[0]+=" "+t+"xml"),t+n[0]+(n[1]?" "+t+n[1].replace(/(\.|\+)/g,"-"):"")},mime2kind:function(e){var t,n="object"==typeof e,i=n?e.mime:e;return n&&e.alias&&"symlink-broken"!=i?t="Alias":this.kinds[i]?t=!n||"directory"!==i||e.phash&&!e.isroot?this.kinds[i]:"Root":this.mimeTypes[i]&&(t=this.mimeTypes[i].toUpperCase(),this.messages["kind"+t]||(t=null)),t||(t=0===i.indexOf("text")?"Text":0===i.indexOf("image")?"Image":0===i.indexOf("audio")?"Audio":0===i.indexOf("video")?"Video":0===i.indexOf("application")?"App":0===i.indexOf("font")?"Font":i),this.messages["kind"+t]?this.i18n("kind"+t):i},mimeIsText:function(e){return!!(this.textMimes[e.toLowerCase()]||0===e.indexOf("text/")&&"rtf"!==e.substr(5,3)||e.match(/^application\/.+\+xml$/))},date:function(e,t){var n,i,o,r,s,a,l,c,d=this;return t||(t=new Date),s=t[d.getHours](),a=s>12?s-12:s,l=t[d.getMinutes](),c=t[d.getSeconds](),n=t[d.getDate](),i=t[d.getDay](),o=t[d.getMonth]()+1,r=t[d.getFullYear](),e.replace(/[a-z]/gi,(function(e){switch(e){case"d":return n>9?n:"0"+n;case"j":return n;case"D":return d.i18n(d.i18.daysShort[i]);case"l":return d.i18n(d.i18.days[i]);case"m":return o>9?o:"0"+o;case"n":return o;case"M":return d.i18n(d.i18.monthsShort[o-1]);case"F":return d.i18n(d.i18.months[o-1]);case"Y":return r;case"y":return(""+r).substr(2);case"H":return s>9?s:"0"+s;case"G":return s;case"g":return a;case"h":return a>9?a:"0"+a;case"a":return s>=12?"pm":"am";case"A":return s>=12?"PM":"AM";case"i":return l>9?l:"0"+l;case"s":return c>9?c:"0"+c}return e}))},formatDate:function(e,t){var n,i,o,r=this,s=t||e.ts;r.i18;return r.options.clientFormatDate&&s>0?(n=new Date(1e3*s),i=s>=this.yesterday?this.fancyFormat:this.dateFormat,o=r.date(i,n),s>=this.yesterday?o.replace("$1",this.i18n(s>=this.today?"Today":"Yesterday")):o):e.date?e.date.replace(/([a-z]+)\s/i,(function(e,t){return r.i18n(t)+" "})):r.i18n("dateUnknown")},toLocaleString:function(e){var t=new Number(e);return t?t.toLocaleString?t.toLocaleString():String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"):e},perms2class:function(e){var t="";return e.read||e.write?e.read?e.write||(t="elfinder-ro"):t="elfinder-wo":t="elfinder-na",e.type&&(t+=" elfinder-"+this.escape(e.type)),t},formatPermissions:function(e){var t=[];return e.read&&t.push(this.i18n("read")),e.write&&t.push(this.i18n("write")),t.length?t.join(" "+this.i18n("and")+" "):this.i18n("noaccess")},formatSize:function(e){var t=1,n="b";return"unknown"==e?this.i18n("unknown"):(e>1073741824?(t=1073741824,n="GB"):e>1048576?(t=1048576,n="MB"):e>1024&&(t=1024,n="KB"),((e/=t)>0?t>=1048576?e.toFixed(2):Math.round(e):0)+" "+n)},formatFileMode:function(e,t){var n,i,o,r,s,a,l,c;if(t||(t=this.options.fileModeStyle.toLowerCase()),(e=e.trim()).match(/[rwxs-]{9}$/i)){if(l=e=e.substr(-9),"string"==t)return l;for(c="",o=0,n=0;n<7;n+=3)r=0,(i=e.substr(n,3)).match(/[r]/i)&&(r+=4),i.match(/[w]/i)&&(r+=2),i.match(/[xs]/i)&&(i.match(/[xs]/)&&(r+=1),i.match(/[s]/i)&&(0==n?o+=4:3==n&&(o+=2))),c+=r.toString(8);o&&(c=o.toString(8)+c)}else{if(c=(e=parseInt(e,8))?e.toString(8):"",!e||"octal"==t)return c;for(o=0,(i=e.toString(8)).length>3&&(i=i.substr(-4),o=parseInt(i.substr(0,1),8),i=i.substr(1)),1==(1&o),a=2==(2&o),s=4==(4&o),l="",n=0;n<3;n++)4==(4&parseInt(i.substr(n,1),8))?l+="r":l+="-",2==(2&parseInt(i.substr(n,1),8))?l+="w":l+="-",1==(1&parseInt(i.substr(n,1),8))?l+=0==n&&s||1==n&&a?"s":"x":l+="-"}return"both"==t?l+" ("+c+")":"string"==t?l:c},registRawStringDecoder:function(e){"function"==typeof e&&(this.decodeRawString=this.options.rawStringDecoder=e)},uploadMimeCheck:function(t,n){n=n||this.cwd().hash;var i,o,r=!0,s=this.option("uploadMime",n),a=function(n){var i=!1;return"string"==typeof n&&"all"===n.toLowerCase()?i=!0:Array.isArray(n)&&n.length&&e.each(n,(function(e,n){if("all"===(n=n.toLowerCase())||0===t.indexOf(n))return i=!0,!1})),i};return t&&e.isPlainObject(s)&&(t=t.toLowerCase(),i=a(s.allow),o=a(s.deny),"allow"===s.firstOrder?(r=!1,o||!0!==i||(r=!0)):(r=!0,!0!==o||i||(r=!1))),r},sequence:function(e){var t=e.length,n=function(t,i){return++i,e[i]?n(t.then(e[i]),i):t};return t>1?n(e[0](),0):e[0]()},reloadContents:function(t){var n,i=e.Deferred();try{n=e('<iframe width="1" height="1" scrolling="no" frameborder="no" style="position:absolute; top:-1px; left:-1px" crossorigin="use-credentials">').attr("src",t).one("load",(function(){var n=e(this);try{this.contentDocument.location.reload(!0),n.one("load",(function(){n.remove(),i.resolve()}))}catch(e){n.attr("src","").attr("src",t).one("load",(function(){n.remove(),i.resolve()}))}})).appendTo("body")}catch(e){n&&n.remove(),i.reject()}return i},makeNetmountOptionOauth:function(t,n,i,o){var r,s="boolean"==typeof o?o:null,a=Object.assign({noOffline:!1,root:"root",pathI18n:"folderId",folders:!0},null===s?o||{}:{noOffline:s}),l=function(n,o,s){var d,h=this,u=Object.keys(e.isPlainObject(s)?s:{}).length;o.next().remove(),u&&(d=e('<select class="ui-corner-all elfinder-tabstop" style="max-width:200
144px;">').append(e(e.map(s,(function(e,t){return'<option value="'+n.escape((t+"").trim())+'">'+n.escape(e)+"</option>"})).join(""))).on("change click",(function(o){var s,d=e(this),u=d.val();h.inputs.path.val(u),!a.folders||"change"!==o.type&&d.data("current")===u||(d.next().remove(),d.data("current",u),u!=a.root&&(s=c(),r&&"pending"===r.state()&&n.abortXHR(r,{quiet:!0,abort:!0}),d.after(s),r=n.request({data:{cmd:"netmount",protocol:t,host:i,user:"init",path:u,pass:"folders"},preventDefault:!0}).done((function(e){l.call(h,n,d,e.folders)})).always((function(){n.abortXHR(r,{quiet:!0}),s.remove()})).xhr))})),o.after(e("<div></div>").append(d)).closest(".ui-dialog").trigger("tabstopsInit"),d.trigger("focus"))},c=function(){return e('<div class="elfinder-netmount-spinner"></div>').append('<span class="elfinder-spinner"></span>')};return{vars:{},name:n,inputs:{offline:e('<input type="checkbox"/>').on("change",(function(){e(this).parents("table.elfinder-netmount-tb").find("select:first").trigger("change","reset")})),host:e('<span><span class="elfinder-spinner"></span></span><input type="hidden"/>'),path:e('<input type="text" value="'+a.root+'"/>'),user:e('<input type="hidden"/>'),pass:e('<input type="hidden"/>'),mnt2res:e('<input type="hidden"/>')},select:function(n,o,r){var s=this.inputs,l=s.offline,c=e(s.host[0]),d=r||null;this.vars.mbtn=s.host.closest(".ui-dialog").children(".ui-dialog-buttonpane:first").find("button.elfinder-btncnt-0"),c.data("inrequest")||!c.find("span.elfinder-spinner").length&&"reset"!==d&&("winfocus"!==d||c.siblings("span.elfinder-button-icon-reload").length)?(l.closest("tr")[a.noOffline||s.user.val()?"hide":"show"](),c.data("funcexpup")&&c.data("funcexpup")()):(1===l.parent().children().length&&(s.path.parent().prev().html(n.i18n(a.pathI18n)),l.attr("title",n.i18n("offlineAccess")),l.uniqueId().after(e("<label></label>").attr("for",l.attr("id")).html(" "+n.i18n("offlineAccess")))),c.data("inrequest",!0).empty().addClass("elfinder-spinner").parent().find("span.elfinder-button-icon").remove(),n.request({data:{cmd:"netmount",protocol:t,host:i,user:"init",options:{id:n.id,offline:l.prop("checked")?1:0,pass:s.host[1].value}},preventDefault:!0}).done((function(e){c.removeClass("elfinder-spinner").html(e.body.replace(/\{msg:([^}]+)\}/g,(function(e,t){return n.i18n(t,i)})))})),a.noOffline&&l.closest("tr").hide()),this.vars.mbtn[e(s.host[1]).val()?"show":"hide"]()},done:function(n,o){var r,s=this.inputs,c=this.protocol,d=e(s.host[0]),h=e(s.host[1]),u="&nbsp;",p=this.vars,f=function(){p.oauthW&&!document.hasFocus()&&--p.chkCnt&&(c.trigger("change","winfocus"),p.tm=setTimeout(f,3e3))};if(a.noOffline&&s.offline.closest("tr").hide(),"makebtn"==o.mode)d.removeClass("elfinder-spinner").removeData("expires").removeData("funcexpup"),r=s.host.find("input").on("mouseenter mouseleave",(function(){e(this).toggleClass("ui-state-hover")})),o.url&&r.on("click",(function(){p.tm&&clearTimeout(p.tm),p.oauthW=window.open(o.url),(n.UA.iOS||n.UA.Mac)&&n.isCORS&&!p.chkdone&&(p.chkCnt=60,p.tm=setTimeout(f,5e3))})),h.val(""),s.path.val(a.root).next().remove(),s.user.val(""),s.pass.val(""),!a.noOffline&&s.offline.closest("tr").show(),p.mbtn.hide();else if("folders"==o.mode)o.folders&&l.call(this,n,s.path.nextAll(":last"),o.folders);else{if(p.oauthW&&(p.tm&&clearTimeout(p.tm),p.oauthW.close(),delete p.oauthW,p.chkdone=!0),o.expires&&(u="()",d.data("expires",o.expires)),d.html(i+u).removeClass("elfinder-spinner"),o.expires&&(d.data("funcexpup",(function(){var e=Math.floor((d.data("expires")-+new Date/1e3)/60);e<3?d.parent().children(".elfinder-button-icon-reload").click():(d.text(d.text().replace(/\(.*\)/,"("+n.i18n(["minsLeft",e])+")")),setTimeout((function(){d.is(":visible")&&d.data("funcexpup")()}),6e4))})),d.data("funcexpup")()),o.reset)return void c.trigger("change","reset");d.parent().append(e('<span class="elfinder-button-icon elfinder-button-icon-reload" title="'+n.i18n("reAuth")+'">').on("click",(function(){h.val("reauth"),c.trigger("change","reset")}))),h.val(t),p.mbtn.show(),o.folders&&l.call(this,n,s.path,o.folders),o.mnt2res&&s.mnt2res.val("1"),s.user.val("done"),s.pass.val("done"),s.offline.closest("tr").hide()}d.removeData("inrequest")},fail:function(t,n){e(this.inputs.host[0]).removeData("inrequest"),this.protocol.trigger("change","reset")},integrateInfo:a.integrate}},findCwdNodes:function(t,n){var i=this,o=(this.getUI("cwd"),this.cwd().hash),r=e();return n=n||{},e.each(t,(function(e,t){if((t.phash===o||i.searchStatus.state>1)&&(r=r.add(i.cwdHash2Elm(t.hash)),n.firstOnly))return!1})),r},convAbsUrl:function(e){if(e.match(/^http/i))return e;if("//"===e.substr(0,2))return window.location.protocol+e;var t,n=window.location.protocol+"//"+window.location.host,i=/[^\/]+\/\.\.\//;for(t=(t="/"===e.substr(0,1)?n+e:n+window.location.pathname.replace(/\/[^\/]+$/,"/")+e).replace("/./","/");i.test(t);)t=t.replace(i,"");return t},isSameOrigin:function(e){var t;if(e=this.convAbsUrl(e),location.origin&&window.URL)try{return t=new 
144URL(e),location.origin===t.origin}catch(e){}return(t=document.createElement("a")).href=e,location.protocol===t.protocol&&location.host===t.host&&location.port&&t.port},navHash2Id:function(e){return this.navPrefix+e},navId2Hash:function(e){return"string"==typeof e&&e.substr(this.navPrefix.length)},cwdHash2Id:function(e){return this.cwdPrefix+e},cwdId2Hash:function(e){return"string"==typeof e&&e.substr(this.cwdPrefix.length)},navHash2Elm:function(t){return e(document.getElementById(this.navHash2Id(t)))},cwdHash2Elm:function(t){return e(document.getElementById(this.cwdHash2Id(t)))},isInWindow:function(e,t){var n,i;return!!(n=e.get(0))&&(!(!t&&null===n.offsetParent)&&(i=n.getBoundingClientRect(),!!document.elementFromPoint(i.left,i.top)))},zIndexCalc:function(){var t=this,n=this.getUI(),i=n.css("z-index");i&&"auto"!==i&&"inherit"!==i?t.zIndex=i:n.parents().each((function(n,i){var o=e(i).css("z-index");if("auto"!==o&&"inherit"!==o&&(o=parseInt(o)))return t.zIndex=o,!1}))},loadScript:function(t,n,i,o){var r,s,a={dataType:"script",cache:!0},l={},c={};return(i=i||{}).tryRequire&&this.hasRequire?require(t,n,i.error):(r=function(){var t,r,s;e.each(c,(function(e,t){if("success"!==t&&"notmodified"!==t)return s=!0,!1})),s?i.error&&"function"==typeof i.error&&i.error({loadResults:c}):"function"==typeof n&&(o&&void 0===o.obj[o.name]?(t=o.timeout?o.timeout/10:1,r=setInterval((function(){(--t<0||void 0!==o.obj[o.name])&&(clearInterval(r),n())}),10)):n())},"tag"===i.loadType?(e("head > script").each((function(){l[this.src]=this})),s=t.length,e.each(t,(function(t,n){var o,a=!1;l[n]?(c[t]=l[n]._error||"success",--s<1&&r()):((o=document.createElement("script")).charset=i.charset||"UTF-8",e("head").append(o),o.onload=o.onreadystatechange=function(){a||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(a=!0,c[t]="success",--s<1&&r())},o.onerror=function(e){c[t]=o._error=e&&e.type?e.type:"error",--s<1&&r()},o.src=n)}))):(i=e.isPlainObject(i)?Object.assign(a,i):a,s=0,function n(o,a){void 0!==o&&(c[s++]=a),t.length?e.ajax(Object.assign({},i,{url:t.shift(),success:n,error:n})):r()}())),this},loadCss:function(t,n){var i,o,r=this;return"string"==typeof t&&(t=[t]),n&&(n.className&&(i=n.className),n.dfd&&n.dfd.promise&&(o=[])),e.each(t,(function(t,n){var s;n=r.convAbsUrl(n).replace(/^https?:/i,""),o&&(o[t]=e.Deferred()),e('head > link[href="'+r.escape(n)+'"]').length?o&&o[t].resolve():((s=document.createElement("link")).type="text/css",s.rel="stylesheet",s.href=n,i&&(s.className=i),o&&(s.onload=function(){o[t].resolve()},s.onerror=function(){o[t].reject()}),e("head").append(s))})),o&&e.when.apply(null,o).done((function(){n.dfd.resolve()})).fail((function(){n.dfd.reject()})),this},asyncJob:function(t,n,i){var o,r,s=e.Deferred(),a=!1,l=Object.assign({interval:0,numPerOnce:1},i||{}),c=[],d=[],h=[];return s._abort=function(e){r&&clearTimeout(r),d=[],a=!0,"pending"===s.state()&&s[e?"resolve":"reject"](c)},s.fail((function(){s._abort()})).always((function(){s._abort=function(){}})),"function"==typeof t&&Array.isArray(n)?(d=n.concat(),o=function(){var e,n,i;if(!a){for(n=(h=d.splice(0,l.numPerOnce)).length,e=0;e<n&&!a;e++)null!==(i=t(h[e]))&&c.push(i);a||(d.length?r=setTimeout(o,l.interval):s.resolve(c))}},d.length?r=setTimeout(o,0):s.resolve(c)):s.reject(),s},getSize:function(t){var n,i,o=this,r=[],s=t.length,a=e.Deferred().fail((function(){e.each(r,(function(e,t){t&&(t.syncOnFail&&t.syncOnFail(!1),t.reject())}))}));return o.autoSync("stop"),(n=e.Deferred(),i=Object.keys(o.leafRoots).length,i>0?e.each(o.leafRoots,(function(t){(function(t){var n=e.Deferred(),i=o.file(t),r=i?i.phash:t;return r&&!o.file(r)?o.request({data:{cmd:"parents",target:r},preventFail:!0}).done((function(){o.one("parentsdone",(function(){n.resolve()}))})).fail((function(){n.resolve()})):n.resolve(),n})(t).done((function(){--i<1&&n.resolve()}))})):n.resolve(),n).done((function(){var n=[],i={},l=[],c=[],d={};e.each(t,(function(){n.push.apply(n,function(t){var n=[];return"directory"===t.mime&&e.each(o.leafRoots,(function(e,i){var r;if(e===t.hash)n.push.apply(n,i);else for(r=(o.file(e)||{}).phash;r;)r===t.hash&&n.push.apply(n,i),r=(o.file(r)||{}).phash})),n}(o.file(this)))})),t.push.apply(t,n),e.each(t,(function(){var t=o.root(this),n=o.file(this);n&&(n.sizeInfo||"directory"!==n.mime)?c.push(e.Deferred().resolve(n.sizeInfo?n.sizeInfo:{size:n.size,dirCnt:0,fileCnt:1})):i[t]?i[t].push(this.toString()):i[t]=[this.toString()]})),e.each(i,(function(){var e=l.length;1===this.length&&(d[e]=this[0]),l.push(o.request({data:{cmd:"size",targets:this},preventDefault:!0}))})),r.push.apply(r,l),l.push.apply(l,c),e.when.apply(e,l).fail((function(){a.reject()})).done((function(){var t,n,i=function(t,n){var i;(i=o.file(t))&&(i.sizeInfo={isCache:!0},e.each(["size","dirCnt","fileCnt"],(function(){i.sizeInfo[this]=n[this]||0}
144)),i.size=parseInt(i.sizeInfo.size),f.push(i))},r=0,l=0,c=0,h=arguments.length,u=[],p="",f=[];for(t=0;t<h;t++)null,(n=arguments[t]).isCache||(d[t]&&o.file(d[t])?i(d[t],n):n.sizes&&e.isPlainObject(n.sizes)&&e.each(n.sizes,(function(e,t){i(e,t)}))),r+=parseInt(n.size),!1!==l&&(void 0===n.fileCnt?l=!1:l+=parseInt(n.fileCnt||0)),!1!==c&&(void 0===n.dirCnt?c=!1:c+=parseInt(n.dirCnt||0));f.length&&o.change({changed:f}),!1!==c&&u.push(o.i18n("folders")+": "+(c-(s>1?0:1))),!1!==l&&u.push(o.i18n("files")+": "+l),u.length&&(p="<br>"+u.join(", ")),a.resolve({size:r,fileCnt:l,dirCnt:c,formated:(r>=0?o.formatSize(r):o.i18n("unknown"))+p})})),o.autoSync()})),a},wkObjUrl:null,getWorker:function(e){var t;try{this.wkObjUrl||(this.wkObjUrl=(window.URL||window.webkitURL).createObjectURL(new Blob([function(){self.onmessage=function(e){var t=e.data;try{if(self.data=t.data,t.scripts)for(var n=0;n<t.scripts.length;n++)importScripts(t.scripts[n]);self.postMessage(self.res)}catch(e){self.postMessage({error:e.toString()})}}}.toString().replace(/\s+/g," ").replace(/ *([^\w]) */g,"$1").replace(/^function\b.+?\{|\}$/g,"")],{type:"text/javascript"}))),t=new Worker(this.wkObjUrl,e)}catch(e){this.debug("error",e.toString())}return t},getWorkerUrl:function(e){return this.convAbsUrl(this.workerBaseUrl+e)},getTheme:function(t){var n,i,o=this,r=e.Deferred(),s=function(t,n){return n||(n=o.convAbsUrl(o.baseUrl)),Array.isArray(t)?e.map(t,(function(e){return s(e,n)})):t.match(/^(?:http|\/\/)/i)?t:n+t.replace(/^(?:\.\/|\/)/,"")};return t&&(n=o.options.themes[t])?"string"==typeof n?(url=s(n),(i=url.match(/^(.+\/)[^/]+\.json$/i))?e.getJSON(url).done((function(e){(n=e).id=t,n.cssurls&&(n.cssurls=s(n.cssurls,i[1])),n.image&&(n.image=s(n.image,i[1])),r.resolve(n)})).fail((function(){r.reject()})):r.resolve({id:t,name:t,cssurls:[url]})):e.isPlainObject(n)&&n.cssurls?(n.id=t,n.cssurls=s(n.cssurls),Array.isArray(n.cssurls)||(n.cssurls=[n.cssurls]),n.name||(n.name=t),r.resolve(n)):r.reject():r.reject(),r},changeTheme:function(t){var n=this;return t&&(!n.options.themes[t]||n.theme&&n.theme.id===t?"default"===t&&n.theme&&"default"!==n.theme.id&&(e("head>link.elfinder-theme-ext").remove(),n.theme=null,n.trigger&&n.trigger("themechange")):n.getTheme(t).done((function(t){t.cssurls&&(e("head>link.elfinder-theme-ext").remove(),n.loadCss(t.cssurls,{className:"elfinder-theme-ext",dfd:e.Deferred().done((function(){n.theme=t,n.trigger&&n.trigger("themechange")}))}))}))),this},applyLeafRootStats:function(t,n){var i=this,o=n?t:i.file(t.hash)||t,r=o.ts,s=!1;return!n&&t._realStats||(t._realStats={locked:t.locked||0,dirs:t.dirs||0,ts:t.ts}),t.locked=1,o.locked||(s=!0),t.dirs=1,o.dirs||(s=!0),e.each(i.leafRoots[t.hash],(function(){var e=i.file(this);e&&e.ts&&(t.ts||0)<e.ts&&(t.ts=e.ts)})),r!==t.ts&&(s=!0),s},abortXHR:function(e,t){var n=t||{};e&&(n.quiet&&(e.quiet=!0),n.abort&&e._requestId&&this.request({data:{cmd:"abort",id:e._requestId},preventDefault:!0}),e.abort(),e=void 0)},setCustomHeaderByXhr:function(t){var n=this;t.getResponseHeader&&n.parrotHeaders&&n.parrotHeaders.length&&e.each(n.parrotHeaders,(function(e,i){var o=t.getResponseHeader(i);o?(n.customHeaders[i]=o,n.sessionStorage("core-ph:"+i,o)):"string"==typeof o&&(delete n.customHeaders[i],n.sessionStorage("core-ph:"+i,null))}))},hasParrotHeaders:function(){var e=!1,t=this.parrotHeaders;if(Object.keys(this.customHeaders).length)for(var n=0;n<t.length;n++)if(this.customHeaders[t[n]]){e=!0;break}return e},getRequestId:function(){return(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16)},arrayFlip:function(e,t){var n,i={},o=Array.isArray(e);for(n in e)(o||e.hasOwnProperty(n))&&(i[e[n]]=t||n);return i},splitFileExtention:function(e){var t;return(t=e.match(/^(.+?)?\.((?:tar\.(?:gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(?:gz|bz2)|[a-z0-9]{1,10})$/i))?(void 0===t[1]&&(t[1]=""),[t[1],t[2]]):[e,""]},sliceArrayBuffer:function(e,t){for(var n=[],i=0;i*t<e.byteLength;)n.push(e.slice(i*t,(i+1)*t)),i++;return n},arrayBufferToBase64:function(e){if(!window.btoa)return"";var t=new Uint8Array(e),n=Array.prototype.slice.call(t).map((function(e){return String.fromCharCode(e)}));return window.btoa(n.join(""))},log:function(e){return window.console&&window.console.log&&window.console.log(e),this},debug:function(t,n){var i,o,r=this,s=this.options.debug,a=this.options.toastBackendWarn;return"backend-error"===t?(!this.cwd().hash||s&&("all"===s||s["backend-error"]))&&(n=Array.isArray(n)?n:[n],this.error(n)):"backend-warning"===t?(o=!0,a&&(i=e.isPlainObject(a)?a:{},e.each(Array.isArray(n)?n:[n],(function(e,t){r.toast(Object.assign({mode:"warning",msg:t},i))})))):"backend-debug"===t&&this.trigger("backenddebug",n),(o||s&&("all"===s||s[t]))&&window.console&&window.console.log&&window.console.log("elfinder debug: ["+t+"] ["+this.id+"]",n),this},responseDebug:function(e){var t,n=e.debug;n&&((t=this.options.debug)&&"all"===t||(t||(t=this.options.debug={}),t["backend-error"]=!0,t.warning=!0),n.mountErrors&&("string"==typeof n.mountErrors||Array.isArray(n.mountErrors)&&n.mou
144ntErrors.length)&&this.debug("backend-error",n.mountErrors),n.backendErrors&&("string"==typeof n.backendErrors||Array.isArray(n.backendErrors)&&n.backendErrors.length)&&this.debug("backend-warning",n.backendErrors))},time:function(e){window.console&&window.console.time&&window.console.time(e)},timeEnd:function(e){window.console&&window.console.timeEnd&&window.console.timeEnd(e)}},Object.keys||(Object.keys=(a=Object.prototype.hasOwnProperty,l=!{toString:null}.propertyIsEnumerable("toString"),d=(c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on non-object");var t=[];for(var n in e)a.call(e,n)&&t.push(n);if(l)for(var i=0;i<d;i++)a.call(e,c[i])&&t.push(c[i]);return t})),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),Object.assign||(Object.assign=function(){return jQuery.extend.apply(null,arguments)}),String.prototype.repeat||(String.prototype.repeat=function(e){"use strict";if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if((e=+e)!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return"";if(t.length*e>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var n="",i=0;i<e;i++)n+=t;return n}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),function(){try{return void Array.apply(null,{})}catch(e){}var e=Object.prototype.toString,t=Function.prototype.apply,n=
145/*@cc_on @if (@_jscript_version <= 5.8)
146			function () {
147				var a = [], i = this.length;
148				while (i-- > 0) a[i] = this[i];
149				return a;
150			}@else@*/
151Array.prototype.slice;Function.prototype.apply=function(i,o){return t.call(this,i,"[object Array]"===e.call(o)?o:n.call(o))}}(),Array.from||(Array.from=function(e){return 1===e.length?[e[0]]:Array.apply(null,e)}),window.cancelAnimationFrame||function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[n]+"CancelAnimationFrame"]||window[t[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,n){var i=(new Date).getTime(),o=Math.max(0,16-(i-e)),r=window.setTimeout((function(){t(i+o)}),o);return e=i+o,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}(),h.prototype.version="2.1.67 (2.1-src Nightly: 9b8438d7b)",function(){if(e.ui&&e.ui.ddmanager){var t=e.ui.ddmanager.prepareOffsets;e.ui.ddmanager.prepareOffsets=function(n,i){var o=function(e){if(e.is(":hidden"))return!0;var t=e[0].getBoundingClientRect();return!document.elementFromPoint(t.left,t.top)&&!document.elementFromPoint(t.left+t.width,t.top+t.height)};if("mousedown"===i.type||n.options.elfRefresh){var r,s,a=e.ui.ddmanager.droppables[n.options.scope]||[],l=a.length;for(r=0;r<l;r++)(s=a[r]).options.autoDisable&&(!s.options.disabled||s.options.autoDisable>1)&&(s.options.disabled=o(s.element),s.options.autoDisable=s.options.disabled?2:1)}return t(n,i)}}}(),window.jQuery.ajaxTransport("+binary",(function(e,t,n){var i;if(window.FormData&&(e.dataType&&"binary"==e.dataType||e.data&&(window.ArrayBuffer&&e.data instanceof ArrayBuffer||window.Blob&&e.data instanceof Blob)))return{send:function(t,n){var o,r=e.responseType||"blob",s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)s[o]=e.xhrFields[o];for(o in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||t["X-Requested-With"]||(t["X-Requested-With"]="XMLHttpRequest"),t)s.setRequestHeader(o,t[o]);i=function(t){return function(){if(i)if(i=s.onload=s.onerror=s.onabort=s.ontimeout=null,"abort"===t)s.abort();else if("error"===t)n(s.status,s.statusText);else{var o={};o[e.dataType]=s.response,n(s.status,s.statusText,o,s.getAllResponseHeaders())}}},s.onload=i(),s.onabort=s.onerror=s.ontimeout=i("error"),i=i("abort");try{s.responseType=r,s.send(e.data||null)}catch(e){if(i)throw e}},abort:function(){i&&i()}}})),
152/*!
153 * jQuery UI Touch Punch 0.2.3
154 *
155 * Copyright 2011–2014, Dave Furfero
156 * Dual licensed under the MIT or GPL Version 2 licenses.
157 *
158 * Depends:
159 *	jquery.ui.widget.js
160 *	jquery.ui.mouse.js
161 */
162function(e){if(e.support.touch="ontouchend"in document,e.support.touch){var t,n,i,o=e.ui.mouse.prototype,r=o._mouseInit,s=o._mouseDestroy;o._touchStart=function(e){!t&&this._mouseCapture(e.originalEvent.changedTouches[0])&&(n=e.originalEvent.changedTouches[0].screenX.toFixed(0),i=e.originalEvent.changedTouches[0].screenY.toFixed(0),t=!0,this._touchMoved=!1,a(e,"mouseover"),a(e,"mousemove"),a(e,"mousedown"))},o._touchMove=function(e){if(t){var o=e.originalEvent.changedTouches[0].screenX.toFixed(0),r=e.originalEvent.changedTouches[0].screenY.toFixed(0);Math.abs(n-o)<=4&&Math.abs(i-r)<=4||(this._touchMoved=!0,a(e,"mousemove"))}},o._touchEnd=function(e){t&&(a(e,"mouseup"),a(e,"mouseout"),this._touchMoved||a(e,"click"),t=!1,this._touchMoved=!1)},o._mouseInit=function(){var e=this;e.element.hasClass("touch-punch")&&(e._touchPunchHandlers=e._touchPunchHandlers||{touchstart:e._touchStart.bind(e),touchmove:e._touchMove.bind(e),touchend:e._touchEnd.bind(e)},e.element.on(e._touchPunchHandlers)),r.call(e)},o._mouseDestroy=function(){var e=this;e.element.hasClass("touch-punch")&&e._touchPunchHandlers&&e.element.off(e._touchPunchHandlers),s.call(e)}}function a(t,n){if(!(t.originalEvent.touches.length>1)){e(t.currentTarget).hasClass("touch-punch-keep-default")||t.preventDefault();var i=t.originalEvent.changedTouches[0],o=document.createEvent("MouseEvents");o.initMouseEvent(n,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(o)}}}(jQuery),e.fn.elfinder=function(t,n){return"instance"===t?this.getElFinder():this.each((function(){var i,o="string"==typeof t?t:"",r="function"==typeof n?n:void 0,s=this.elfinder;
162if(s)switch(o){case"close":case"hide":s.hide();break;case"open":case"show":s.show();break;case"destroy":s.destroy();break;case"reload":case"restart":s&&(i=e.extend(!0,s.options,e.isPlainObject(n)?n:{}),r=s.bootCallback,s.reloadCallback&&"function"==typeof s.reloadCallback?s.reloadCallback(i,r):(s.destroy(),new h(this,i,r)))}else e.isPlainObject(t)&&new h(this,t,r)}))},e.fn.getElFinder=function(){var e;return this.each((function(){if(this.elfinder)return e=this.elfinder,!1})),e},e.fn.elfUiWidgetInstance=function(e){try{return this[e]("instance")}catch(n){var t=this.data("ui-"+e);return t&&"object"==typeof t&&t.widgetFullName==="ui-"+e?t:null}},e.fn.scrollRight||e.fn.extend({scrollRight:function(e){var t=this.get(0);return void 0===e?Math.max(0,t.scrollWidth-(t.scrollLeft+t.clientWidth)):this.scrollLeft(t.scrollWidth-t.clientWidth-e)}}),e.fn.scrollBottom||e.fn.extend({scrollBottom:function(e){var t=this.get(0);return void 0===e?Math.max(0,t.scrollHeight-(t.scrollTop+t.clientHeight)):this.scrollTop(t.scrollHeight-t.clientHeight-e)}}),h.prototype.mimeTypes={"application/x-executable":"exe","application/x-jar":"jar","application/x-rpm":"rpm","application/x-gzip":"gz","application/x-bzip2":"tbz","application/x-rar":"rar","text/x-php":"php","text/javascript":"js","application/rtfd":"rtfd","text/x-python":"py","text/x-ruby":"rb","text/x-shellscript":"sh","text/x-perl":"pl","text/xml":"xml","text/x-csrc":"c","text/x-chdr":"h","text/x-c++src":"cpp","text/x-c++hdr":"hpp","text/x-markdown":"md","text/x-yaml":"yml","image/x-ms-bmp":"bmp","image/x-targa":"tga","image/xbm":"xbm","image/pxm":"pxm","audio/wav":"wav","video/x-dv":"dv","video/x-ms-wmv":"wm","video/ogg":"ogm","video/mp2t":"m2ts","application/x-mpegurl":"m3u8","application/dash+xml":"mpd","application/andrew-inset":"ez","application/applixware":"aw","application/atom+xml":"atom","application/atomcat+xml":"atomcat","application/atomsvc+xml":"atomsvc","application/ccxml+xml":"ccxml","application/cdmi-capability":"cdmia","application/cdmi-container":"cdmic","application/cdmi-domain":"cdmid","application/cdmi-object":"cdmio","application/cdmi-queue":"cdmiq","application/cu-seeme":"cu","application/davmount+xml":"davmount","application/docbook+xml":"dbk","application/dssc+der":"dssc","application/dssc+xml":"xdssc","application/ecmascript":"ecma","application/emma+xml":"emma","application/epub+zip":"epub","application/exi":"exi","application/font-tdpfr":"pfr","application/gml+xml":"gml","application/gpx+xml":"gpx","application/gxf":"gxf","application/hyperstudio":"stk","application/inkml+xml":"ink","application/ipfix":"ipfix","application/java-serialized-object":"ser","application/java-vm":"class","application/json":"json","application/jsonml+json":"jsonml","application/lost+xml":"lostxml","application/mac-binhex40":"hqx","application/mac-compactpro":"cpt","application/mads+xml":"mads","application/marc":"mrc","application/marcxml+xml":"mrcx","application/mathematica":"ma","application/mathml+xml":"mathml","application/mbox":"mbox","application/mediaservercontrol+xml":"mscml","application/metalink+xml":"metalink","application/metalink4+xml":"meta4","application/mets+xml":"mets","application/mods+xml":"mods","application/mp21":"m21","application/mp4":"mp4s","application/msword":"doc","application/mxf":"mxf","application/octet-stream":"bin","application/oda":"oda","application/oebps-package+xml":"opf","application/ogg":"ogx","application/omdoc+xml":"omdoc","application/onenote":"onetoc","application/oxps":"oxps","application/patch-ops-error+xml":"xer","application/pdf":"pdf","application/pgp-encrypted":"pgp","application/pgp-signature":"asc","application/pics-rules":"prf","application/pkcs10":"p10","application/pkcs7-mime":"p7m","application/pkcs7-signature":"p7s","application/pkcs8":"p8","application/pkix-attr-cert":"ac","application/pkix-cert":"cer","application/pkix-crl":"crl","application/pkix-pkipath":"pkipath","application/pkixcmp":"pki","application/pls+xml":"pls","application/postscript":"ai","application/prs.cww":"cww","application/pskc+xml":"pskcxml","application/rdf+xml":"rdf","application/reginfo+xml":"rif","application/relax-ng-compact-syntax":"rnc","application/resource-lists+xml":"rl","application/resource-lists-diff+xml":"rld","application/rls-services+xml":"rs","application/rpki-ghostbusters":"gbr","application/rpki-manifest":"mft","application/rpki-roa":"roa","application/rsd+xml":"rsd","application/rss+xml":"rss","application/rtf":"rtf","application/sbml+xml":"sbml","application/scvp-cv-request":"scq","application/scvp-cv-response":"scs","application/scvp-vp-request":"spq","application/scvp-vp-response":"spp","application/sdp":"sdp","application/set-payment-initiation":"setpay","application/set-registration-initiation":"setreg","a
162pplication/shf+xml":"shf","application/smil+xml":"smi","application/sparql-query":"rq","application/sparql-results+xml":"srx","application/srgs":"gram","application/srgs+xml":"grxml","application/sru+xml":"sru","application/ssdl+xml":"ssdl","application/ssml+xml":"ssml","application/tei+xml":"tei","application/thraud+xml":"tfi","application/timestamped-data":"tsd","application/vnd.3gpp.pic-bw-large":"plb","application/vnd.3gpp.pic-bw-small":"psb","application/vnd.3gpp.pic-bw-var":"pvb","application/vnd.3gpp2.tcap":"tcap","application/vnd.3m.post-it-notes":"pwn","application/vnd.accpac.simply.aso":"aso","application/vnd.accpac.simply.imp":"imp","application/vnd.acucobol":"acu","application/vnd.acucorp":"atc","application/vnd.adobe.air-application-installer-package+zip":"air","application/vnd.adobe.formscentral.fcdt":"fcdt","application/vnd.adobe.fxp":"fxp","application/vnd.adobe.xdp+xml":"xdp","application/vnd.adobe.xfdf":"xfdf","application/vnd.ahead.space":"ahead","application/vnd.airzip.filesecure.azf":"azf","application/vnd.airzip.filesecure.azs":"azs","application/vnd.amazon.ebook":"azw","application/vnd.americandynamics.acc":"acc","application/vnd.amiga.ami":"ami","application/vnd.android.package-archive":"apk","application/vnd.anser-web-certificate-issue-initiation":"cii","application/vnd.anser-web-funds-transfer-initiation":"fti","application/vnd.antix.game-component":"atx","application/vnd.apple.installer+xml":"mpkg","application/vnd.aristanetworks.swi":"swi","application/vnd.astraea-software.iota":"iota","application/vnd.audiograph":"aep","application/vnd.blueice.multipass":"mpm","application/vnd.bmi":"bmi","application/vnd.businessobjects":"rep","application/vnd.chemdraw+xml":"cdxml","application/vnd.chipnuts.karaoke-mmd":"mmd","application/vnd.cinderella":"cdy","application/vnd.claymore":"cla","application/vnd.cloanto.rp9":"rp9","application/vnd.clonk.c4group":"c4g","application/vnd.cluetrust.cartomobile-config":"c11amc","application/vnd.cluetrust.cartomobile-config-pkg":"c11amz","application/vnd.commonspace":"csp","application/vnd.contact.cmsg":"cdbcmsg","application/vnd.cosmocaller":"cmc","application/vnd.crick.clicker":"clkx","application/vnd.crick.clicker.keyboard":"clkk","application/vnd.crick.clicker.palette":"clkp","application/vnd.crick.clicker.template":"clkt","application/vnd.crick.clicker.wordbank":"clkw","application/vnd.criticaltools.wbs+xml":"wbs","application/vnd.ctc-posml":"pml","application/vnd.cups-ppd":"ppd","application/vnd.curl.car":"car","application/vnd.curl.pcurl":"pcurl","application/vnd.dart":"dart","application/vnd.data-vision.rdz":"rdz","application/vnd.dece.data":"uvf","application/vnd.dece.ttml+xml":"uvt","application/vnd.dece.unspecified":"uvx","application/vnd.dece.zip":"uvz","application/vnd.denovo.fcselayout-link":"fe_launch","application/vnd.dna":"dna","application/vnd.dolby.mlp":"mlp","application/vnd.dpgraph":"dpg","application/vnd.dreamfactory":"dfac","application/vnd.ds-keypoint":"kpxx","application/vnd.dvb.ait":"ait","application/vnd.dvb.service":"svc","application/vnd.dynageo":"geo","application/vnd.ecowin.chart":"mag","application/vnd.enliven":"nml","application/vnd.epson.esf":"esf","application/vnd.epson.msf":"msf","application/vnd.epson.quickanime":"qam","application/vnd.epson.salt":"slt","application/vnd.epson.ssf":"ssf","application/vnd.eszigno3+xml":"es3","application/vnd.ezpix-album":"ez2","application/vnd.ezpix-package":"ez3","application/vnd.fdf":"fdf","application/vnd.fdsn.mseed":"mseed","application/vnd.fdsn.seed":"seed","application/vnd.flographit":"gph","application/vnd.fluxtime.clip":"ftc","application/vnd.framemaker":"fm","application/vnd.frogans.fnc":"fnc","application/vnd.frogans.ltf":"ltf","application/vnd.fsc.weblaunch":"fsc","application/vnd.fujitsu.oasys":"oas","application/vnd.fujitsu.oasys2":"oa2","application/vnd.fujitsu.oasys3":"oa3","application/vnd.fujitsu.oasysgp":"fg5","application/vnd.fujitsu.oasysprs":"bh2","application/vnd.fujixerox.ddd":"ddd","application/vnd.fujixerox.docuworks":"xdw","application/vnd.fujixerox.docuworks.binder":"xbd","application/vnd.fuzzysheet":"fzs","application/vnd.genomatix.tuxedo":"txd","application/vnd.geogebra.file":"ggb","application/vnd.geogebra.slides":"ggs","application/vnd.geogebra.tool":"ggt","application/vnd.geometry-explorer":"gex","application/vnd.geonext":"gxt","application/vnd.geoplan":"g2w","application/vnd.geospace":"g3w","application/vnd.gmx":"gmx","application/vnd.google-earth.kml+xml":"kml","application/vnd.google-earth.kmz":"kmz","application/vnd.grafeq":"gqf","application/vnd.groove-account":"gac","application/vnd.groove-help":"ghf","application/vnd.groove-identity-message":"gim","application/vnd.groove-injector":"grv","application/vnd.groove-tool-message":"gtm","application/vnd.groove-tool-template":"tpl","application/vnd.groove-vcard":"vcg","application/vnd.hal+xml":"hal","application/vnd.handheld-entertainment+xml":"zmm","application/vnd.hbci":"hbci","application/vnd.hhe.lesson-player":"les","application/vnd.hp-hpgl":"hpgl","application/vnd.hp-hpid":"hpid","application/vnd.hp-hps":"hps","application/vnd.hp-jlyt":"jlt","application/vnd.hp-pcl":"pcl","application/vnd.hp-pclxl":"pclxl","application/vnd.hydrostatix.sof-data":"sfd-hdstx","application/vnd.ibm.minipay":"mpy","application/vnd.ibm.modcap":"afp","application/vnd.ibm.rights-management":"irm","application/vnd.ibm.secure-container":"sc","application/vnd.iccprofile":"icc","application/vnd.igloader":"igl","application/vnd.immervision-ivp":"ivp","application/vnd.immervision-ivu":"ivu","application/vnd.insors.igm":"igm","application/vnd.intercon.formnet":"xpw","application/vnd.intergeo":"i2g","application/vnd.intu.qbo":"qbo","application/vnd.intu.qfx":"qfx","application/vnd.ipunplugged.rcprofile":"rcprofile","application/vnd.irepository.package+xml":"irp","application/vnd.is-xpr":"xpr","application/vnd.isac.fcs":"fcs","application/vnd.jam":"jam","application/vnd.jcp.javame.midlet-rms":"rms","application/vnd.jisp":"jisp","application/vnd.joost.joda-archive":"joda","application/vnd.kahootz":"ktz","a
162pplication/vnd.kde.karbon":"karbon","application/vnd.kde.kchart":"chrt","application/vnd.kde.kformula":"kfo","application/vnd.kde.kivio":"flw","application/vnd.kde.kontour":"kon","application/vnd.kde.kpresenter":"kpr","application/vnd.kde.kspread":"ksp","application/vnd.kde.kword":"kwd","application/vnd.kenameaapp":"htke","application/vnd.kidspiration":"kia","application/vnd.kinar":"kne","application/vnd.koan":"skp","application/vnd.kodak-descriptor":"sse","application/vnd.las.las+xml":"lasxml","application/vnd.llamagraphics.life-balance.desktop":"lbd","application/vnd.llamagraphics.life-balance.exchange+xml":"lbe","application/vnd.lotus-1-2-3":"123","application/vnd.lotus-approach":"apr","application/vnd.lotus-freelance":"pre","application/vnd.lotus-notes":"nsf","application/vnd.lotus-organizer":"org","application/vnd.lotus-screencam":"scm","application/vnd.lotus-wordpro":"lwp","application/vnd.macports.portpkg":"portpkg","application/vnd.mcd":"mcd","application/vnd.medcalcdata":"mc1","application/vnd.mediastation.cdkey":"cdkey","application/vnd.mfer":"mwf","application/vnd.mfmp":"mfm","application/vnd.micrografx.flo":"flo","application/vnd.micrografx.igx":"igx","application/vnd.mif":"mif","application/vnd.mobius.daf":"daf","application/vnd.mobius.dis":"dis","application/vnd.mobius.mbk":"mbk","application/vnd.mobius.mqy":"mqy","application/vnd.mobius.msl":"msl","application/vnd.mobius.plc":"plc","application/vnd.mobius.txf":"txf","application/vnd.mophun.application":"mpn","application/vnd.mophun.certificate":"mpc","application/vnd.mozilla.xul+xml":"xul","application/vnd.ms-artgalry":"cil","application/vnd.ms-cab-compressed":"cab","application/vnd.ms-excel":"xls","application/vnd.ms-excel.addin.macroenabled.12":"xlam","application/vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","application/vnd.ms-excel.sheet.macroenabled.12":"xlsm","application/vnd.ms-excel.template.macroenabled.12":"xltm","application/vnd.ms-fontobject":"eot","application/vnd.ms-htmlhelp":"chm","application/vnd.ms-ims":"ims","application/vnd.ms-lrm":"lrm","application/vnd.ms-officetheme":"thmx","application/vnd.ms-pki.seccat":"cat","application/vnd.ms-pki.stl":"stl","application/vnd.ms-powerpoint":"ppt","application/vnd.ms-powerpoint.addin.macroenabled.12":"ppam","application/vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","application/vnd.ms-powerpoint.slide.macroenabled.12":"sldm","application/vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","application/vnd.ms-powerpoint.template.macroenabled.12":"potm","application/vnd.ms-project":"mpp","application/vnd.ms-word.document.macroenabled.12":"docm","application/vnd.ms-word.template.macroenabled.12":"dotm","application/vnd.ms-works":"wps","application/vnd.ms-wpl":"wpl","application/vnd.ms-xpsdocument":"xps","application/vnd.mseq":"mseq","application/vnd.musician":"mus","application/vnd.muvee.style":"msty","application/vnd.mynfc":"taglet","application/vnd.neurolanguage.nlu":"nlu","application/vnd.nitf":"ntf","application/vnd.noblenet-directory":"nnd","application/vnd.noblenet-sealer":"nns","application/vnd.noblenet-web":"nnw","application/vnd.nokia.n-gage.data":"ngdat","application/vnd.nokia.n-gage.symbian.install":"n-gage","application/vnd.nokia.radio-preset":"rpst","application/vnd.nokia.radio-presets":"rpss","application/vnd.novadigm.edm":"edm","application/vnd.novadigm.edx":"edx","application/vnd.novadigm.ext":"ext","application/vnd.oasis.opendocument.chart":"odc","application/vnd.oasis.opendocument.chart-template":"otc","application/vnd.oasis.opendocument.database":"odb","application/vnd.oasis.opendocument.formula":"odf","application/vnd.oasis.opendocument.formula-template":"odft","application/vnd.oasis.opendocument.graphics":"odg","application/vnd.oasis.opendocument.graphics-template":"otg","application/vnd.oasis.opendocument.image":"odi","application/vnd.oasis.opendocument.image-template":"oti","application/vnd.oasis.opendocument.presentation":"odp","application/vnd.oasis.opendocument.presentation-template":"otp","application/vnd.oasis.opendocument.spreadsheet":"ods","application/vnd.oasis.opendocument.spreadsheet-template":"ots","application/vnd.oasis.opendocument.text":"odt","application/vnd.oasis.opendocument.text-master":"odm","application/vnd.oasis.opendocument.text-template":"ott","application/vnd.oasis.opendocument.text-web":"oth","application/vnd.olpc-sugar":"xo","application/vnd.oma.dd2+xml":"dd2","application/vnd.openofficeorg.extension":"oxt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.openxmlformats-officedocument.presentationml.slide":"sldx","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","application/vnd.openxmlformats-officedocument.presentationml.template":"potx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","application/vnd.osgeo.mapguide.package":"mgp","application/vnd.osgi.dp":"dp","application/vnd.osgi.subsystem":"esa","application/vnd.palm":"pdb","application/vnd.pawaafile":"paw","application/vnd.pg.format":"str","application/vnd.pg.osasli":"ei6","application/vnd.picsel":"efif","application/vnd.pmi.widget":"wg","application/vnd.pocketlearn":"plf","application/vnd.powerbuilder6":"pbd","application/vnd.previewsystems.box":"box","application/vnd.proteus.magazine":"mgz","application/vnd.publishare-delta-tree":"qps","application/vnd.pvi.ptid1":"ptid","application/vnd.quark.quarkxpress":"qxd","application/vnd.realvnc.bed":"bed","application/vnd.recordare.musicxml":"mxl","application/vnd.recordare.musicxml+xml":"musicxml","application/vnd.rig.cryptonote":"cryptonote","application/vnd.rim.cod":"cod","application/vnd.rn-realmedia":"rm","application/vnd.rn-realmedia-vbr":"rmvb","application/vnd.route66.link66+xml":"link66","application/vnd.sailingtracker.track":"st","application/vnd.seemail":"see","application/vnd.sema":"sema","application/vnd.semd":"semd","application/vnd.semf":"semf","application/vnd.shana.informed.formdata":"ifm","application/vnd.shana.informed.formtemplate":"itp","application/vnd.shana.informed.interchange":"iif","application/vnd.shana.informed.package":"ipk","application/vnd.simtech-mindmapper":"twd","application/vnd.smaf":"mmf","application/vnd.smart.teacher":"teacher","application/vnd.solent.sdkm+xml":"sdkm","application/vnd.spotfire.dxp":"dxp","application/vnd.spotfire.sfs":"sfs","application/vnd.sqlite3":"sqlite","application/vnd.stardivision.calc":"sdc","application/vnd.stardivision.draw":"sda","application/vnd.stardivision.impress":"sdd","application/vnd.stardivision.math":"smf","application/vnd.stardivision.writer":"sdw","application/vnd.stardivision.writer-global":"sgl","application/vnd.stepmania.package":"smzip","application/vnd.stepmania.stepchart":"sm","application/vnd.sun.xml.calc":"sxc","application/vnd.sun.xml.calc.template":"stc","application/vnd.sun.xml.draw":"sxd","application/vnd.sun.xml.draw.template":"std","application/vnd.sun.xml.impress":"sxi","application/vnd.sun.xml.impress.template":"sti","application/vnd.sun.xml.math":"sxm","application/vnd.sun.xml.writer":"sxw","application/vnd.sun.xml.writer.global":"sxg","application/vnd.sun.xml.writer.template":"stw","application/vnd.sus-calendar":"sus","application/vnd.svd":"svd","application/vnd.symbian.install":"sis","application/vnd.syncml+xml":"xsm","application/vnd.syncml.dm+wbxml":"bdm","application/vnd.syncml.dm+xml":"xdm","application/vnd.tao.intent-module-archive":"tao","application/vnd.tcpdump.pcap":"pcap","application/vnd.tmobile-livetv":"tmo","application/vnd.trid.tpt":"tpt","application/vnd.triscape.mxs":"mxs","application/vnd.trueapp":"tra","application/vnd.ufdl":"ufd","application/vnd.uiq.theme":"utz","application/vnd.umajin":"umj","application/vnd.unity":"unityweb","application/vnd.uoml+xml":"uoml","application/vnd.vcx":"vcx","application/vnd.visio":"vsd","application/vnd.visionary":"vis","application/vnd.vsf":"vsf","application/vnd.wap.wbxml":"wbxml","application/vnd.wap.wmlc":"wmlc","application/vnd.wap.wmlscriptc":"wmlsc","application/vnd.webturbo":"wtb","application/vnd.wolfram.player":"nbp","application/vnd.wordperfect":"wpd","application/vnd.wqd":"wqd","application/vnd.wt.stf":"stf","application/vnd.xara":"xar","application/vnd.xfdl":"xfdl","application/vnd.yamaha.hv-dic":"hvd","application/vnd.yamaha.hv-script":"hvs","application/vnd.yamaha.hv-voice":"hvp","application/vnd.yamaha.openscoreformat":"osf","application/vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","application/vnd.yamaha.smaf-audio":"saf","application/vnd.yamaha.smaf-phrase":"spf","application/vnd.yellowriver-custom-menu":"cmp","application/vnd.zul":"zir","application/vnd.zzazz.deck+xml":"zaz","application/voicexml+xml":"vxml","application/wasm":"wasm","application/widget":"wgt","application/winhlp":"hlp","application/wsdl+xml":"wsdl","application/wspolicy+xml":"wspolicy","application/x-7z-compressed":"7z","application/x-abiword":"abw","application/x-ace-compressed":"ace","application/x-apple-diskimage":"dmg","application/x-authorware-bin":"aab","application/x-authorware-map":"aam","application/x-authorware-seg":"aas","application/x-bcpio":"bcpio","application/x-bittorrent":"torrent","application/x-blorb":"blb","a
162pplication/x-bzip":"bz","application/x-cbr":"cbr","application/x-cdlink":"vcd","application/x-cfs-compressed":"cfs","application/x-chat":"chat","application/x-chess-pgn":"pgn","application/x-conference":"nsc","application/x-cpio":"cpio","application/x-csh":"csh","application/x-debian-package":"deb","application/x-dgc-compressed":"dgc","application/x-director":"dir","application/x-doom":"wad","application/x-dtbncx+xml":"ncx","application/x-dtbook+xml":"dtb","application/x-dtbresource+xml":"res","application/x-dvi":"dvi","application/x-envoy":"evy","application/x-eva":"eva","application/x-font-bdf":"bdf","application/x-font-ghostscript":"gsf","application/x-font-linux-psf":"psf","application/x-font-pcf":"pcf","application/x-font-snf":"snf","application/x-font-type1":"pfa","application/x-freearc":"arc","application/x-futuresplash":"spl","application/x-gca-compressed":"gca","application/x-glulx":"ulx","application/x-gnumeric":"gnumeric","application/x-gramps-xml":"gramps","application/x-gtar":"gtar","application/x-hdf":"hdf","application/x-install-instructions":"install","application/x-iso9660-image":"iso","application/x-java-jnlp-file":"jnlp","application/x-latex":"latex","application/x-lzh-compressed":"lzh","application/x-mie":"mie","application/x-mobipocket-ebook":"prc","application/x-ms-application":"application","application/x-ms-shortcut":"lnk","application/x-ms-wmd":"wmd","application/x-ms-wmz":"wmz","application/x-ms-xbap":"xbap","application/x-msaccess":"mdb","application/x-msbinder":"obd","application/x-mscardfile":"crd","application/x-msclip":"clp","application/x-msdownload":"dll","application/x-msmediaview":"mvb","application/x-msmetafile":"wmf","application/x-msmoney":"mny","application/x-mspublisher":"pub","application/x-msschedule":"scd","application/x-msterminal":"trm","application/x-mswrite":"wri","application/x-netcdf":"nc","application/x-nzb":"nzb","application/x-pkcs12":"p12","application/x-pkcs7-certificates":"p7b","application/x-pkcs7-certreqresp":"p7r","application/x-research-info-systems":"ris","application/x-shar":"shar","application/x-shockwave-flash":"swf","application/x-silverlight-app":"xap","application/x-sql":"sql","application/x-stuffit":"sit","application/x-stuffitx":"sitx","application/x-subrip":"srt","application/x-sv4cpio":"sv4cpio","application/x-sv4crc":"sv4crc","application/x-t3vm-image":"t3","application/x-tads":"gam","application/x-tar":"tar","application/x-tcl":"tcl","application/x-tex":"tex","application/x-tex-tfm":"tfm","application/x-texinfo":"texinfo","application/x-tgif":"obj","application/x-ustar":"ustar","application/x-wais-source":"src","application/x-x509-ca-cert":"der","application/x-xfig":"fig","application/x-xliff+xml":"xlf","application/x-xpinstall":"xpi","application/x-xz":"xz","application/x-zmachine":"z1","application/xaml+xml":"xaml","application/xcap-diff+xml":"xdf","application/xenc+xml":"xenc","application/xhtml+xml":"xhtml","application/xml":"xsl","application/xml-dtd":"dtd","application/xop+xml":"xop","application/xproc+xml":"xpl","a
162pplication/xslt+xml":"xslt","application/xspf+xml":"xspf","application/xv+xml":"mxml","application/yang":"yang","application/yin+xml":"yin","application/zip":"zip","audio/adpcm":"adp","audio/basic":"au","audio/midi":"mid","audio/mp4":"m4a","audio/mpeg":"mpga","audio/ogg":"oga","audio/s3m":"s3m","audio/silk":"sil","audio/vnd.dece.audio":"uva","audio/vnd.digital-winds":"eol","audio/vnd.dra":"dra","audio/vnd.dts":"dts","audio/vnd.dts.hd":"dtshd","audio/vnd.lucent.voice":"lvp","audio/vnd.ms-playready.media.pya":"pya","audio/vnd.nuera.ecelp4800":"ecelp4800","audio/vnd.nuera.ecelp7470":"ecelp7470","audio/vnd.nuera.ecelp9600":"ecelp9600","audio/vnd.rip":"rip","audio/webm":"weba","audio/x-aac":"aac","audio/x-aiff":"aif","audio/x-caf":"caf","audio/x-flac":"flac","audio/x-matroska":"mka","audio/x-mpegurl":"m3u","audio/x-ms-wax":"wax","audio/x-ms-wma":"wma","audio/x-pn-realaudio":"ram","audio/x-pn-realaudio-plugin":"rmp","audio/xm":"xm","chemical/x-cdx":"cdx","chemical/x-cif":"cif","chemical/x-cmdf":"cmdf","chemical/x-cml":"cml","chemical/x-csml":"csml","chemical/x-xyz":"xyz","font/collection":"ttc","font/otf":"otf","font/ttf":"ttf","font/woff":"woff","font/woff2":"woff2","image/avif":"avif","image/cgm":"cgm","image/g3fax":"g3","image/gif":"gif","image/heic":"heic","image/heic-sequence":"heics","image/heif":"heif","image/heif-sequence":"heifs","image/ief":"ief","image/jpeg":"jpeg","image/jxl":"jxl","image/ktx":"ktx","image/png":"png","image/prs.btif":"btif","image/sgi":"sgi","image/svg+xml":"svg","image/tiff":"tiff","image/vnd.adobe.photoshop":"psd","image/vnd.dece.graphic":"uvi","image/vnd.djvu":"djvu","image/vnd.dvb.subtitle":"sub","image/vnd.dwg":"dwg","image/vnd.dxf":"dxf","image/vnd.fastbidsheet":"fbs","image/vnd.fpx":"fpx","image/vnd.fst":"fst","image/vnd.fujixerox.edmics-mmr":"mmr","image/vnd.fujixerox.edmics-rlc":"rlc","image/vnd.ms-modi":"mdi","image/vnd.ms-photo":"wdp","image/vnd.net-fpx":"npx","image/vnd.wap.wbmp":"wbmp","image/vnd.xiff":"xif","image/webp":"webp","image/x-3ds":"3ds","image/x-cmu-raster":"ras","image/x-cmx":"cmx","image/x-freehand":"fh","image/x-icon":"ico","image/x-mrsid-image":"sid","image/x-pcx":"pcx","image/x-pict":"pic","image/x-portable-anymap":"pnm","image/x-portable-bitmap":"pbm","image/x-portable-graymap":"pgm","image/x-portable-pixmap":"ppm","image/x-rgb":"rgb","image/x-xpixmap":"xpm","image/x-xwindowdump":"xwd","message/rfc822":"eml","model/iges":"igs","model/mesh":"msh","model/vnd.collada+xml":"dae","model/vnd.dwf":"dwf","model/vnd.gdl":"gdl","model/vnd.gtw":"gtw","model/vnd.vtu":"vtu","model/vrml":"wrl","model/x3d+binary":"x3db","model/x3d+vrml":"x3dv","model/x3d+xml":"x3d","text/cache-manifest":"appcache","text/calendar":"ics","text/css":"css","text/csv":"csv","text/html":"html","text/n3":"n3","text/plain":"txt","text/prs.lines.tag":"dsc","text/richtext":"rtx","text/sgml":"sgml","text/tab-separated-values":"tsv","text/troff":"t","text/turtle":"ttl","text/uri-l
162ist":"uri","text/vcard":"vcard","text/vnd.curl":"curl","text/vnd.curl.dcurl":"dcurl","text/vnd.curl.mcurl":"mcurl","text/vnd.curl.scurl":"scurl","text/vnd.fly":"fly","text/vnd.fmi.flexstor":"flx","text/vnd.graphviz":"gv","text/vnd.in3d.3dml":"3dml","text/vnd.in3d.spot":"spot","text/vnd.sun.j2me.app-descriptor":"jad","text/vnd.wap.wml":"wml","text/vnd.wap.wmlscript":"wmls","text/x-asm":"s","text/x-c":"cc","text/x-fortran":"f","text/x-java-source":"java","text/x-nfo":"nfo","text/x-opml":"opml","text/x-pascal":"p","text/x-setext":"etx","text/x-sfv":"sfv","text/x-uuencode":"uu","text/x-vcalendar":"vcs","text/x-vcard":"vcf","video/3gpp":"3gp","video/3gpp2":"3g2","video/h261":"h261","video/h263":"h263","video/h264":"h264","video/jpeg":"jpgv","video/jpm":"jpm","video/mj2":"mj2","video/mp4":"mp4","video/mpeg":"mpeg","video/quicktime":"qt","video/vnd.dece.hd":"uvh","video/vnd.dece.mobile":"uvm","video/vnd.dece.pd":"uvp","video/vnd.dece.sd":"uvs","video/vnd.dece.video":"uvv","video/vnd.dvb.file":"dvb","video/vnd.fvt":"fvt","video/vnd.mpegurl":"mxu","video/vnd.ms-playready.media.pyv":"pyv","video/vnd.uvvu.mp4":"uvu","video/vnd.vivo":"viv","video/webm":"webm","video/x-f4v":"f4v","video/x-fli":"fli","video/x-flv":"flv","video/x-m4v":"m4v","video/x-matroska":"mkv","video/x-mng":"mng","video/x-ms-asf":"asf","video/x-ms-vob":"vob","video/x-ms-wmx":"wmx","video/x-ms-wvx":"wvx","video/x-msvideo":"avi","video/x-sgi-movie":"movie","video/x-smv":"smv","x-conference/x-cooltalk":"ice","text/x-sql":"sql","image/x-pixlr-data":"pxd","image/x-adobe-dng":"dng","image/x-sketch":"sketch","image/x-xcf":"xcf","audio/amr":"amr","image/vnd-ms.dds":"dds","application/plt":"plt","application/sat":"sat","application/step":"step","text/x-httpd-cgi":"cgi","text/x-asap":"asp","text/x-jsp":"jsp"},h.prototype._options={cdns:{ace:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2",codemirror:"https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7",ckeditor:"https://cdnjs.cloudflare.com/ajax/libs/ckeditor/4.22.1",ckeditor5:"https://cdn.ckeditor.com/ckeditor5/40.2.0",tinymce:"https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.2",simplemde:"https://cdnjs.cloudflare.com/ajax/libs/simplemde/1.11.2",fabric:"https://cdnjs.cloudflare.com/ajax/libs/fabric.js/5.3.1",fabric16:"https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.6.7",tui:"https://uicdn.toast.com",hls:"https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.4.14/hls.min.js",dash:"https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.7.3/dash.all.min.js",flv:"https://cdnjs.cloudflare.com/ajax/libs/flv.js/1.6.2/flv.min.js",videojs:"https://cdnjs.cloudflare.com/ajax/libs/video.js/8.8.0",prettify:"https://cdn.jsdelivr.net/gh/google/code-prettify@e006587b4a893f0281e9dc9a53001c7ed584d4e7/loader/run_prettify.js",psd:"https://cdnjs.cloudflare.com/ajax/libs/psd.js/3.4.0/psd.min.js",rar:"https://cdn.jsdelivr.net/gh/nao-pon/rar.js@6cef13ec66dd67992fc7f3ea22f132d770ebaf8b/rar.min.js",zlibUnzip:"https://cdn.jsdelivr.net/gh/imaya/[email protected]/bin/unzip.min.js",zlibGunzip:"https://cdn.jsdelivr.net/gh/imaya/[email protected]/bin/gunzip.min.js",bzip2:"https://cdn.jsdelivr.net/gh/nao-pon/[email protected]/bzip2.js",marked:"https://cdnjs.cloudflare.com/ajax/libs/marked/11.1.0/marked.min.js",sparkmd5:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js",jssha:"https://cdnjs.cloudflare.com/ajax/libs/jsSHA/3.3.1/sha.min.js",amr:"https://cdn.jsdelivr.net/gh/yxl/opencore-amr-js@dcf3d2b5f384a1d9ded2a54e4c137a81747b222b/js/amrnb.js",tiff:"https://cdn.jsdelivr.net/gh/seikichi/tiff.js@545ede3ee46b5a5bc5f06d65954e775aa2a64017/tiff.min.js"},url:"",requestType:"get",cors:null,parrotHeaders:[],requestMaxConn:3,transport:{},urlUpload:"",dragUploadAllow:"auto",overwriteUploadConfirm:!0,uploadMaxChunkSize:10485760,folderUploadExclude:{win:/^(?:desktop\.ini|thumbs\.db)$/i,mac:/^\.ds_store$/i},iframeTimeout:0,customData:{},handlers:{},customHeaders:{},xhrFields:{},lang:"en",baseUrl:"",i18nBaseUrl:"",workerBaseUrl:"",cssAutoLoad:!0,themes:{},theme:null,maxErrorDialogs:5,cssClass:"",commands:["*"],commandsOptions:{getfile:{onlyURL:!1,multiple:!1,folders:!1,oncomplete:"",onerror:"",getPath:!0,getImgSize:!1}
162,open:{method:"post",into:"window",selectAction:"open"},opennew:{url:"",useOriginQuery:!0},upload:{ui:"button"},download:{maxRequests:10,minFilesZipdl:2},quicklook:{autoplay:!0,width:450,height:300,mediaControlsList:"",pdfToolbar:!0,textInitialLines:100,prettifyMaxLines:300,contain:!1,docked:0,dockHeight:"auto",dockAutoplay:!1,googleMapsApiKey:"",googleMapsOpts:{maps:{},kml:{suppressInfoWindows:!1,preserveViewport:!1}},viewerjs:{url:"",mimes:["application/pdf","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation"],pdfNative:!0},sharecadMimes:[],googleDocsMimes:[],officeOnlineMimes:[],getDimThreshold:"200K",unzipMaxSize:"50M",mimeRegexNotEmptyCheck:/^application\/vnd\.google-apps\./},edit:{dialogWidth:void 0,dialogHeight:void 0,mimes:[],mkfileHideMimes:[],makeTextMimes:["text/plain","text/css","text/html"],useStoredEditor:!1,editorMaximized:!1,editors:[],encodings:["Big5","Big5-HKSCS","Cp437","Cp737","Cp775","Cp850","Cp852","Cp855","Cp857","Cp858","Cp862","Cp866","Cp874","EUC-CN","EUC-JP","EUC-KR","GB18030","ISO-2022-CN","ISO-2022-JP","ISO-2022-KR","ISO-8859-1","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-13","ISO-8859-15","KOI8-R","KOI8-U","Shift-JIS","Windows-1250","Windows-1251","Windows-1252","Windows-1253","Windows-1254","Windows-1257"],extraOptions:{uploadOpts:{},tuiImgEditOpts:{iconsPath:void 0,theme:{}},pixo:{apikey:""},managerUrl:null,ckeditor:{},ckeditor5:{mode:"decoupled-document"},tinymce:{},onlineConvert:{maxSize:100,showLink:!0}}},fullscreen:{mode:"screen"},search:{incsearch:{enable:!0,minlen:1,wait:500},searchTypes:{SearchMime:{name:"btnMime",title:"searchMime",incsearch:"mime"}}},info:{nullUrlDirLinkSelf:!0,hideItems:[],showHashMaxsize:104857600,showHashAlgorisms:["md5","sha256"],showHashOpts:{shake128len:256,shake256len:512},custom:{}},mkdir:{intoNewFolderToolbtn:!1},resize:{grid8px:"disable",presetSize:[[320,240],[400,400],[640,480],[800,600]],getDimThreshold:204800,dimSubImgSize:307200},rm:{quickTrash:!0,infoCheckWait:10,toTrashMaxItems:1e3},paste:{moveConfirm:!1},help:{view:["about","shortcuts","help","integrations","debug"],helpSource:""},preference:{width:600,height:400,categories:null,prefs:null,langs:null,selectActions:["open","edit/download","resize/edit/download","download","quicklook"]}},disabledCmdsRels:{get:["edit"],rm:["cut","empty"],"file&url=":["download","zipdl"]},bootCallback:null,getFileCallback:null,defaultView:"icons",startPathHash:"",sound:!0,ui:["toolbar","places","tree","path","stat"],uiOptions:{toolbar:[["home","back","forward","up","reload"],["netmount"],["mkdir","mkfile","upload"],["open","download","getfile"],["undo","redo"],["copy","cut","paste","rm","empty","hide"],["duplicate","rename","edit","resize","chmod"],["selectall","selectnone","selectinvert"],["quicklook","info"],["extract","archive"],["search"],["view","sort"],["preference","help"],["fullscreen"]],toolbarExtra:{displayTextLabel:!1,labelExcludeUA:["Mobile"],autoHideUA:["Mobile"],defaultHides:["home","reload"],showPreferenceButton:"none",preferenceInContextmenu:!0},tree:{attrTitle:!0,openRootOnLoad:!0,openCwdOnOpen:!0,syncTree:!0,subTreeMax:100,subdirsMaxConn:2,subdirsAtOnce:5,durations:{slideUpDown:"fast",autoScroll:"fast"}},navbar:{minWidth:150,maxWidth:500,autoHideUA:[]},navdock:{disabled:!1,initMaxHeight:"50%",maxHeight:"90%"},cwd:{oldSchool:!1,showSelectCheckboxUA:["Touch"],metakeyDragout:!0,listView:{columns:["perm","date","size","kind"],columnsCustomName:{},fixedHeader:!0},iconsView:{size:0,sizeMax:3,sizeNames:{0:"viewSmall",1:"viewMedium",2:"viewLarge",3:"viewExtraLarge"}}},path:{toWorkzoneWithoutNavbar:!0},dialog:{focusOnMouseOver:!0},toast:{animate:{showMethod:"fadeIn",showDuration:300,showEasing:"swing",timeOut:3e3,hideMethod:"fadeOut",hideDuration:1500,hideEasing:"swing"}}},dispInlineRegex:"^(?:(?:image|video|audio)|application/(?:x-mpegURL|dash+xml)|(?:text/plain|application/pdf)$)",onlyMimes:[],sortRules:{},sortType:"name",sortOrder:"asc",sortStickFolders:!0,sortAlsoTreeview:!1,clientFormatDate:!0,UTCDate:!1,dateFormat:"",fancyDateFormat:"",fileModeStyle:"both",width:"auto",height:400,noResizeBySelf:!1,heightBase:null,resizable:!0,notifyDelay:500,notifyDialog:{position:{},width:null,canClose:!1,hiddens:["open"]},dialogContained:!1,allowShortcuts:!0,rememberLastDir:!0,reloadClearHistory:!1,useBrowserHistory:!0,show
162Files:50,showThreshold:50,validName:!1,fileFilter:!1,backupSuffix:"~",sync:0,syncStart:!0,loadTmbs:5,cookie:{expires:30,domain:"",path:"/",secure:!1,samesite:"lax"},contextmenu:{navbar:["open","opennew","download","|","upload","mkdir","|","copy","cut","paste","duplicate","|","rm","empty","hide","|","rename","|","archive","|","places","info","chmod","netunmount"],cwd:["undo","redo","|","back","up","reload","|","upload","mkdir","mkfile","paste","|","empty","hide","|","view","sort","selectall","colwidth","|","places","info","chmod","netunmount","|","fullscreen","|","preference"],files:["getfile","|","open","opennew","download","opendir","quicklook","|","upload","mkdir","|","copy","cut","paste","duplicate","|","rm","empty","hide","|","rename","edit","resize","|","archive","extract","|","selectall","selectinvert","|","places","info","chmod","netunmount"]},enableAlways:!1,enableByMouseOver:!0,windowCloseConfirm:["hasNotifyDialog","editingFile"],rawStringDecoder:"object"==typeof Encoding&&"function"==typeof Encoding.convert?function(e){return Encoding.convert(e,{to:"UNICODE",type:"string"})}:null,debug:["error","warning","event-destroy"],toastBackendWarn:!0,enableRootRename:!0},h.prototype._options.commandsOptions.netmount={ftp:{name:"FTP",inputs:{host:e('<input type="text"/>'),port:e('<input type="number" placeholder="21" class="elfinder-input-optional"/>'),path:e('<input type="text" value="/"/>'),user:e('<input type="text"/>'),pass:e('<input type="password" autocomplete="new-password"/>'),FTPS:e('<input type="checkbox" value="1" title="File Transfer Protocol over SSL/TLS"/>'),encoding:e('<input type="text" placeholder="Optional" class="elfinder-input-optional"/>'),locale:e('<input type="text" placeholder="Optional" class="elfinder-input-optional"/>')}},dropbox2:h.prototype.makeNetmountOptionOauth("dropbox2","Dropbox","Dropbox",{noOffline:!0,root:"/",pathI18n:"path",integrate:{title:"Dropbox.com",link:"https://www.dropbox.com"}}),googledrive:h.prototype.makeNetmountOptionOauth("googledrive","Google Drive","Google",{integrate:{title:"Google Drive",link:"https://www.google.com/drive/"}}),onedrive:h.prototype.makeNetmountOptionOauth("onedrive","One Drive","OneDrive",{integrate:{title:"Microsoft OneDrive",link:"https://onedrive.live.com"}}),box:h.prototype.makeNetmountOptionOauth("box","Box","Box",{noOffline:!0,integrate:{title:"Box.com",link:"https://www.box.com"}})},h.prototype.history=function(t){var n,i=this,o=!0,r=[],s=function(){r=[t.cwd().hash],n=0,o=!0},a=t.options.useBrowserHistory&&window.history&&window.history.pushState?window.history:null,l=function(a){return a&&i.canForward()||!a&&i.canBack()?(o=!1,t.exec("open",r[a?++n:--n]).fail(s)):e.Deferred().reject()},c=function(e){!a||a.state&&a.state.thash===e||a.pushState({thash:e},null,location.pathname+location.search+(e?"#elf_"+e:""))};this.canBack=function(){return n>0},this.canForward=function(){return n<r.length-1},this.back=l,this.forward=function(){return l(!0)},t.bind("init",(function(){a&&!a.state&&c(t.startDir())})).open((function(){var e=r.length,i=t.cwd().hash;o&&(n>=0&&e>n+1&&r.splice(n+1),r[r.length-1]!=i&&r.push(i),n=r.length-1),o=!0,c(i)})).reload(t.options.reloadClearHistory&&s)},h.prototype.command=function(t){this.fm=t,this.name="",this.dialogClass="",this.className="",this.title="",this.linkedCmds=[],this.state=-1,this.alwaysEnabled=!1,this.noChangeDirOnRemovedCwd=!1,this._disabled=!1,this.disableOnSearch=!1,this.updateOnSelect=!0,this.syncTitleOnChange=!1,this.keepContextmenu=!1,this._handlers={enable:function(){this.update(void 0,this.value)},disable:function(){this.update(-1,this.value)},"open reload load sync":function(){this._disabled=!(this.alwaysEnabled||this.fm.isCommandEnabled(this.name)),this.update(void 0,this.value),this.change()}},this.handlers={},this.shortcuts=[],this.options={ui:"button"},this.listeners=[],this.setup=function(t,n){var i,o,r,s=this,a=this.fm,l=function(t){var n=t.callback||function(e){a.exec(s.name,void 0,{_userAction:!0,_currentType:"shortcut"})};t.callback=function(t){var i,o={};s.enabled()&&(a.searchStatus.state<2?i=a.isCommandEnabled(s.name):(e.each(a.selected(),(function(t,n){a.optionsByHashes[n]?o[n]=!0:e.each(a.volOptions,(function(e){if(!o[e]&&0===n.indexOf(e))return o[e]=!0,!1}))})),e.each(o,(function(e){if(!(i=a.isCommandEnabled(s.name,e)))return!1}))),i&&(s.event=t,n.call(s),delete s.event))}};for(this.name=t,this.title=a.messages["cmd"+t]?a.i18n("cmd"+t):this.extendsCmd&&a.messages["cmd"+this.extendsCmd]?a.i18n("cmd"+this.extendsCmd):t,this.options=Object.assign({},this.options,n),this.listeners=[],this.dialogClass="elfinder-dialog-"+t,n.shortcuts&&("function"==typeof n.shortcuts?r=n.shortcuts(this.fm,this.shortcuts):Array.isArray(n.shortcuts)&&(r=n.shortcuts),this.shortcuts=r||[]),this.updateOnSelect&&(this._handlers.select=function(){this.update(void 0,this.value)}),e.each(Object.assign({},s._handlers,s.handlers),(function(e,t){a.bind(e,t.bind(s))})),i=0;i<this.shortcuts.length;i++)l(o=this.shortcuts[i]),!o.description&&(o.description=this.title),a.shortcut(o);this.disableOnSearch&&a.bind("search searchend",(function(){s._disabled="search"===this.type||!(this.alwaysEnabled||a.isCommandEnabled(t)),s.update(void 0,s.value)})),this.init()},this.init=function(){},this.exec=function(t,n){return e.Deferred().reject()},this.getUndo=function(e,t){return!1},this.disabled=function(){return this.state<0},this.enabled=function(){return this.state>-1},this.active=function(){return this.state>0},this.getstate=function(){return-1},this.update=function(e,t){var n=this.state,i=this.value;this._disabled&&0===this.fm.searchStatus?this.state=-1:this.state=void 0!==e?e:this.getstate(),this.value=t,n==this.state&&i==this.value||this.change()},this.change=function(e){var t,n;if("function"==typeof e)this.listeners.push(e);else for(n=0;n<this.listeners.length;n++){t=this.listeners[n];try{t(this.state,this.value)}catch(e){this.fm.debug("error",e)}}return this},this.hashes=function(n){return n?e.grep(Array.isArray(n)?n:[n],(function(e){return!!t.file(e)})):t.selected()},this.files=function(t){var n=this.fm;return t?e.map(Array.isArray(t)?t:[t],(function(e){return n.file(e)||null})):n.selectedFiles()},this.fmDialog=function(e,t){return t.cssClass?t.cssClass+=" "+this.dialogClass:t.cssClass=this.dialogClass,this.fm.dialog(e,t)}},h.prototype.resources={class:{hover:"ui-state-hover",active:"ui-state-active",disabled:"ui-state-disabled",draggable:"ui-draggable",droppable:"ui-droppable",adroppable:"elfinder-droppable-active",cwdfile:"elfinder-cwd-file",cwd:"elfinder-cwd",tree:"elfinder-tree",treeroot:"elfinder-navbar-root",navdir:"elfinder-navbar-dir",navdirwrap:"elfinder-navbar-dir-wrapper",navarrow:"elfinder-navbar-arrow",navsubtree:"elfinder-navbar-subtree",navcollapse:"elfinder-navbar-collapsed",navexpand:"elfinder-navbar-expanded",treedir:"elfinder-tree-dir",placedir:"elfinder-place-dir",searchbtn:"elfinder-button-search",editing:"elfinder-to-editing",preventback:"elfinder-prevent-back",tabstab:"ui-state-default ui-tabs-tab ui-corner-top ui-tab",tabsactive:"ui-tabs-active ui-state-active"},tpl:{perms:'<span class="elfinder-perms"></span>',lock:'<span class="elfinder-lock"></span>',symlink:'<span class="elfinder-symlink"></span>',navicon:'<span class="elfinder-nav-icon"></span>',navspinner:'<span class="elfinder-spinner elfinder-navbar-spinner"></span>',navdir:'<div class="elfinder-navbar-wrapper{root}"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}"{title}><span class="elfinder-navbar-arrow"></span><span class="elfinder-navbar-icon" {style}></span>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree" style="display:none"></div></div>',placedir:'<div class="elfinder-navbar-wrapper"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}"{title}><span class="elfinder-navbar-arrow"></span><span class="elfinder-navbar-icon" {style}></span>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree" style="display:none"></div></div>'}
162,mimes:{text:["application/dash+xml","application/docbook+xml","application/javascript","application/json","application/plt","application/sat","application/sql","application/step","application/vnd.hp-hpgl","application/x-awk","application/x-config","application/x-csh","application/x-empty","application/x-mpegurl","application/x-perl","application/x-php","application/x-web-config","application/xhtml+xml","application/xml","audio/x-mp3-playlist","image/cgm","image/svg+xml","image/vnd.dxf","model/iges"]},mixin:{make:function(){var t,n,i,o,r,s,a,l,c,d,h=this,u=this.fm,p=this.name,f=this.requestCmd||p,m=u.getUI("workzone"),g=this.origin&&"navbar"===this.origin?"tree":"cwd",v="tree"===g,b=v?"navHash2Elm":"cwdHash2Elm",y=!v&&"list"!=u.storage("view"),x=u.selected(),w=this.move||!1,_=m.hasClass("elfinder-cwd-wrapper-empty"),k=function(){requestAnimationFrame((function(){z&&z.trigger("blur")}))},C=function(){P.is(":hidden")||P.elfinderoverlay("hide").off("click close",R),n&&(i.removeClass("ui-front").css("position","").off("unselect."+u.namespace,k),y?n&&n.css("max-height",""):v||i.css("width","").parent("td").css("overflow",""))},S=e.Deferred().fail((function(e){s&&r.attr("class",s),_&&m.addClass("elfinder-cwd-wrapper-empty"),x&&(w&&u.trigger("unlockfiles",{files:x}),u.clipboard([]),u.trigger("selectfiles",{files:x})),e&&u.error(e)})).always((function(){C(),M(),u.enable().unbind("open",L).trigger("resMixinMake")})),T="tmp_"+parseInt(1e5*Math.random()),E=this.data&&this.data.target?this.data.target:v?u.file(x[0]).hash:u.cwd().hash,A=new Date,O={hash:T,phash:E,name:u.uniqueName(this.prefix,E),mime:this.mime,read:!0,write:!0,date:"Today "+A.getHours()+":"+A.getMinutes(),move:w},D=(u.getUI(g).trigger("create."+u.namespace,O),this.data||{}),I=u[b](T),P=u.getUI("overlay"),M=function(){I&&I.length&&(z.off(),I.hide(),u.unselectfiles({files:[T]}).unbind("resize",F),requestAnimationFrame((function(){v?I.closest(".elfinder-navbar-wrapper").remove():I.remove()})))},R=function(e){P.is(":hidden")||i.css("z-index",""),j||(M(),S.reject(),e&&(e.stopPropagation(),e.preventDefault()))},z=e(y?"<textarea></textarea>":'<input type="text"/>').on("keyup text",(function(){y?(this.style.height="1px",this.style.height=this.scrollHeight+"px"):t&&(this.style.width=t+"px",this.scrollWidth>t&&(this.style.width=this.scrollWidth+10+"px"))})).on("keydown",(function(t){t.stopImmediatePropagation(),t.keyCode==e.ui.keyCode.ESCAPE?S.reject():t.keyCode==e.ui.keyCode.ENTER&&(t.preventDefault(),z.trigger("blur"))})).on("mousedown click dblclick",(function(e){e.stopPropagation(),"dblclick"===e.type&&e.preventDefault()})).on("blur",(function(){var t,n=z.val().trim(),r=z.parent(),s=!0;if(P.is(":hidden")||i.css("z-index",""),""===n)return R();if(!j&&r.length){if(u.options.validName&&u.options.validName.test)try{s=u.options.validName.test(n)}catch(e){s=!1}if(!n||"."===n||".."===n||!s)return j=!0,u.error("directory"===O.mime?"errInvDirname":"errInvName",{modal:!0,close:function(){setTimeout(N,120)}}),!1;if(u.fileByName(n,E))return j=!0,u.error(["errExists",n],{modal:!0,close:function(){setTimeout(N,120)}}),!1;t=x&&w?u.exec("cut",x):null,e.when(t).done((function(){var t={},i={};C(),z.hide().before(e("<span>").text(n)),u.lockfiles({files:[T]}),u.request({data:Object.assign({cmd:f,name:n,target:E},D||{}),notify:{type:f,cnt:1},preventFail:!0,syncOnFail:!0,navigate:{toast:t}}).fail((function(t){u.unlockfiles({files:[T]}),j=!0,z.show().prev().remove(),u.error(t,{modal:!0,close:function(){Array.isArray(t)&&-1!==e.inArray("errUploadMime",t)?S.notify("errUploadMime").reject():setTimeout(N,120)}})})).done((function(n){if(n&&n.added&&n.added[0]){var r,s=n.added[0],a=s.hash,l=(u[b](a),{directory:{cmd:"open",msg:"cmdopendir"},text:{cmd:"edit",msg:"cmdedit"},default:{cmd:"open",msg:"cmdopen"}});x&&w&&u.one(f+"done",(function(){u.exec("paste",a)})),w||(u.mimeIsText(s.mime)&&!u.mimesCanMakeEmpty[s.mime]&&u.mimeTypes[s.mime]&&(u.trigger("canMakeEmptyFile",{mimes:[s.mime],unshift:!0}),(r={})[s.mime]=u.mimeTypes[s.mime],u.storage("mkfileTextMimes",Object.assign(r,u.storage("mkfileTextMimes")||{}))),Object.assign(i,o||l[s.mime]||l[s.mime.split("/")[0]]||l[u.mimesCanMakeEmpty[s.mime]||-1!==e.inArray(s.mime,u.resources.mimes.text)?"text":"none"]||l.default),Object.assign(t,i.cmd?{incwd:{msg:u.i18n(["complete",u.i18n("cmd"+p)]),action:i},inbuffer:{msg:u.i18n(["complete",u.i18n("cmd"+p)]),action:i}}:{inbuffer:{msg:u.i18n(["complete",u.i18n("cmd"+p)])}}))}S.resolve(n)}))})).fail((function(){S.reject()}))}})).on("dragenter dragleave dragover drop",(function(e){e.stopPropagation()})),N=function(){var e=u.splitFileExtention(z.val())[0];j||!u.UA.Mobile||u.UA.iOS||(P.on("click close",R).elfinderoverlay("show"),i.css("z-index",P.css("z-index")+1)),j=!1,!u.enabled()&&u.enable(),z.trigger("focus").trigger("select"),z[0].setSelectionRange&&z[0].setSelectionRange(0,e.length)},F=function(){I.trigger("scrolltoview",{blink:!1})},L=function(){S&&"pending"===S.state()&&S.reject()},j=!1;return u.isCommandEnabled(f,E)&&I.length?(e.isPlainObject(h.nextAction)&&(o=Object.assign({},h.nextAction)),v?(r=u[b](E),a=u.res("class","navcollapse"),l=u.res("class","navexpand"),c=u.res("class","navarrow"),d=u.res("class","navsubtree"),I.closest("."+d
162).show(),r.hasClass(a)||(s=r.attr("class"),r.addClass(a+" "+l+" elfinder-subtree-loaded")),r.is("."+a+":not(."+l+")")&&r.children("."+c).trigger("click").data("dfrd").done((function(){z.val()===O.name&&z.val(u.uniqueName(h.prefix,E)).trigger("select").trigger("focus")})),n=I.contents().filter((function(){return 3==this.nodeType&&e(this).parent().attr("id")===u.navHash2Id(O.hash)})),i=n.parent(),n.replaceWith(z.val(O.name))):(_&&m.removeClass("elfinder-cwd-wrapper-empty"),n=I.find(".elfinder-cwd-filename"),i=n.parent(),y?n.css("max-height","none"):(t=i.width(),i.width(t-15).parent("td").css("overflow","visible")),n.empty().append(z.val(O.name))),i.addClass("ui-front").css("position","relative").on("unselect."+u.namespace,k),u.bind("resize",F).one("open",L),z.trigger("keyup"),N(),S):S.reject()}},blink:function(e,t){var n,i={slowonce:function(){e.hide().delay(250).fadeIn(750).delay(500).fadeOut(3500)},lookme:function(){e.show().fadeOut(500).fadeIn(750)}};n=i[t=t||"slowonce"]||i.lookme,e.stop(!0,!0),n()}},e.fn.dialogelfinder=function(t,n){var i,o,r="elfinderPosition",s="elfinderDestroyOnClose";if(e.isPlainObject(t))this.not(".elfinder").each((function(){t.handlers=t.handlers||{};var i,o=e(this),a=(e(document),e('<div class="ui-widget-header dialogelfinder-drag ui-corner-top">'+(t.title||"Files")+"</div>")),l=(e('<a href="#" class="dialogelfinder-drag-close ui-corner-all"><span class="ui-icon ui-icon-closethick"> </span></a>').appendTo(a).on("click",(function(e){e.preventDefault(),o.dialogelfinder("close")})),t.handlers.init);t.handlers.init=function(e,t){o.prepend(a),l&&l(e,t)},(i=o.addClass("elfinder dialogelfinder touch-punch").css("position","absolute").hide().appendTo("body").draggable({handle:".dialogelfinder-drag",containment:"window",stop:function(){o.trigger("resize"),i.trigger("resize")}}).elfinder(t,n).elfinder("instance")).reloadCallback=function(e,t){i.destroy(),e.handlers.init=l,o.dialogelfinder(e,t).dialogelfinder("open")},o.width(parseInt(o.width())||840).data(s,!!t.destroyOnClose).find(".elfinder-toolbar").removeClass("ui-corner-top"),t.position&&o.data(r,t.position),!1!==t.autoOpen&&e(this).dialogelfinder("open")}));else if("open"===t)o=(i=e(this)).data(r)||{top:parseInt(e(document).scrollTop()+(e(window).height()<i.height()?2:(e(window).height()-i.height())/2)),left:parseInt(e(document).scrollLeft()+(e(window).width()<i.width()?2:(e(window).width()-i.width())/2))},i.is(":hidden")&&(i.addClass("ui-front").css(o).show().trigger("resize"),setTimeout((function(){i.trigger("resize").trigger("mousedown")}),200));else if("close"===t)(i=e(this).removeClass("ui-front")).is(":visible")&&(i.data(s)?i.elfinder("destroy").remove():i.elfinder("close"));else if("instance"===t)return e(this).getElFinder();return this},"function"==typeof h&&h.prototype.i18&&(h.prototype.i18.en={translator:"Troex Nevelin &lt;[email protected]&gt;, Naoki Sawada &lt;[email protected]&gt;",language:"English",direction:"ltr",dateFormat:"M d, Y h:i A",fancyDateFormat:"$1 h:i A",nonameDateFormat:"ymd-His",messages:{error:"Error",errUnknown:"Unknown error.",errUnknownCmd:"Unknown command.",errJqui:"Invalid jQuery UI configuration. Selectable, draggable and droppable components must be included.",errNode:"elFinder requires DOM Element to be created.",errURL:"Invalid elFinder configuration! URL option is not set.",errAccess:"Access denied.",errConnect:"Unable to connect to backend.",errAbort:"Connection aborted.",errTimeout:"Connection timeout.",errNotFound:"Backend not found.",errResponse:"Invalid backend response.",errConf:"Invalid backend configuration.",errJSON:"PHP JSON module not installed.",errNoVolumes:"Readable volumes not available.",errCmdParams:'Invalid parameters for command "$1".',errDataNotJSON:"Data is not JSON.",errDataEmpty:"Data is empty.",errCmdReq:"Backend request requires command name.",errOpen:'Unable to open "$1".',errNotFolder:"Object is not a folder.",errNotFile:"Object is not a file.",errRead:'Unable to read "$1".',errWrite:'Unable to write into "$1".',errPerm:"Permission denied.",errLocked:'"$1" is locked and can not be renamed, moved or removed.',errExists:'Item named "$1" already exists.',errInvName:"Invalid file name.",errInvDirname:"Invalid folder name.",errFolderNotFound:"Folder not found.",errFileNotFound:"File not found.",errTrgFolderNotFound:'Target folder "$1" not found.',errPopup:"Browser prevented opening popup window. To o
162pen file enable it in browser options.",errMkdir:'Unable to create folder "$1".',errMkfile:'Unable to create file "$1".',errRename:'Unable to rename "$1".',errCopyFrom:'Copying files from volume "$1" not allowed.',errCopyTo:'Copying files to volume "$1" not allowed.',errMkOutLink:"Unable to create a link to outside the volume root.",errUpload:"Upload error.",errUploadFile:'Unable to upload "$1".',errUploadNoFiles:"No files found for upload.",errUploadTotalSize:"Data exceeds the maximum allowed size.",errUploadFileSize:"File exceeds maximum allowed size.",errUploadMime:"File type not allowed.",errUploadTransfer:'"$1" transfer error.',errUploadTemp:"Unable to make temporary file for upload.",errNotReplace:'Object "$1" already exists at this location and can not be replaced by object with another type.',errReplace:'Unable to replace "$1".',errSave:'Unable to save "$1".',errCopy:'Unable to copy "$1".',errMove:'Unable to move "$1".',errCopyInItself:'Unable to copy "$1" into itself.',errRm:'Unable to remove "$1".',errTrash:"Unable into trash.",errRmSrc:"Unable remove source file(s).",errExtract:'Unable to extract files from "$1".',errArchive:"Unable to create archive.",errArcType:"Unsupported archive type.",errNoArchive:"File is not archive or has unsupported archive type.",errCmdNoSupport:"Backend does not support this command.",errReplByChild:'The folder "$1" can\'t be replaced by an item it contains.',errArcSymlinks:"For security reason denied to unpack archives contains symlinks or files with not allowed names.",errArcMaxSize:"Archive files exceeds maximum allowed size.",errResize:'Unable to resize "$1".',errResizeDegree:"Invalid rotate degree.",errResizeRotate:"Unable to rotate image.",errResizeSize:"Invalid image size.",errResizeNoChange:"Image size not changed.",errUsupportType:"Unsupported file type.",errNotUTF8Content:'File "$1" is not in UTF-8 and cannot be edited.',errNetMount:'Unable to mount "$1".',errNetMountNoDriver:"Unsupported protocol.",errNetMountFailed:"Mount failed.",errNetMountHostReq:"Host required.",errSessionExpires:"Your session has expired due to inactivity.",errCreatingTempDir:'Unable to create temporary directory: "$1"',errFtpDownloadFile:'Unable to download file from FTP: "$1"',errFtpUploadFile:'Unable to upload file to FTP: "$1"',errFtpMkdir:'Unable to create remote directory on FTP: "$1"',errArchiveExec:'Error while archiving files: "$1"',errExtractExec:'Error while extracting files: "$1"',errNetUnMount:"Unable to unmount.",errConvUTF8:"Not convertible to UTF-8",errFolderUpload:"Try the modern browser, If you'd like to upload the folder.",errSearchTimeout:'Timed out while searching "$1". Search result is partial.',errReauthRequire:"Re-authorization is required.",errMaxTargets:"Max number of selectable items is $1.",errRestore:"Unable to restore from the trash. Can't identify the restore destination.",errEditorNotFound:"Editor not found to this file type.",errServerError:"Error occurred on the server side.",errEmpty:'Unable to empty folder "$1".',moreErrors:"There are $1 more errors.",errMaxMkdirs:"You can create up to $1 folders at one time.",cmdarchive:"Create archive",cmdback:"Back",cmdcopy:"Copy",cmdcut:"Cut",cmddownload:"Download",cmdduplicate:"Duplicate",cmdedit:"Edit file",cmdextract:"Extract files from archive",cmdforward:"Forward",cmdgetfile:"Select files",cmdhelp:"About this software",cmdhome:"Root",cmdinfo:"Get info",cmdmkdir:"New folder",cmdmkdirin:"Into New Folder",cmdmkfile:"New file",cmdopen:"Open",cmdpaste:"Paste",cmdquicklook:"Preview",cmdreload:"Reload",cmdrename:"Rename",cmdrm:"Delete",cmdtrash:"Into trash",cmdrestore:"Restore",cmdsearch:"Find files",cmdup:"Go to parent folder",cmdupload:"Upload files",cmdview:"View",cmdresize:"Resize & Rotate",cmdsort:"Sort",cmdnetmount:"Mount network volume",cmdnetunmount:"Unmount",cmdplaces:"To Places",cmdchmod:"Change mode",cmdopendir:"Open a folder",cmdcolwidth:"Reset column width",cmdfullscreen:"Full Screen",cmdmove:"Move",cmdempty:"Empty the folder",cmdundo:"Undo",cmdredo:"Redo",cmdpreference:"Preferences",cmdselectall:"Select all",cmdselectnone:"Select none",cmdselectinvert:"Invert selection",cmdopennew:"Open in new window",cmdhide:"Hide (Preference)",btnClose:"Close",btnSave:"Save",btnRm:"Remove",btnApply:"Apply",btnCancel:"Cancel",btnNo:"No",btnYes:"Yes",btnDiscard:"Discard changes",btnMount:"Mount",btnApprove:"Goto $1 & approve",btnUnmount:"Unmount",btnConv:"Convert",btnCwd:"Here",btnVolume:"Volume",btnAll:"All",btnMime:"MIME Type",btnFileName:"Filename",btnSaveClose:"Save & Close",btnBackup:"Backup",btnRename:"Rename",btnRenameAll:"Rename(All)",btnPrevious:"Prev ($1/$2)",btnNext:"Next ($1/$2)",btnSaveAs:"Save As",ntfopen:"Open folder",ntffile:"Open file",ntfreload:"Reload folder content",ntfmkdir:"Creating folder",ntfmkfile:"Creating files",ntfrm:"Delete items",ntfcopy:"Copy items",ntfmove:"Move items",ntfprepare:"Checking existing items",ntfrename:"Rename files",ntfupload:"Uploading files",ntfdownload:"Downloading files",ntfsave:"Save files",ntfarchive:"Creating archive",ntfextract:"Extracting files from archive",ntfsearch:"Searching files",ntfresize:"Resizing images",ntfsmth:"Doing something",ntfloadimg:"Loading image",ntfnetmount:"Mounting network volume",ntfnetunmount:"Unmounting network volume",ntfdim:"Acquiring image dimension",ntfreaddir:"Reading folder infomation",ntfurl:"Getting URL of link",ntfchmod:"Changing file mode",ntfpreupload:"Verifying upload file name",ntfzipdl:"Creating a file for download",ntfparents:"Getting path infomation",ntfchunkmerge:"Processing the uploaded file",ntftrash:"Doing throw in the trash",ntfrestore:"Doing restore from the trash",ntfchkdir:"Checking destination folder",ntfundo:"Undoing previous operation",ntfredo:"Redoing previous undone",ntfchkcontent:"Checking contents",volume_Trash:"Tras
162h",dateUnknown:"unknown",Today:"Today",Yesterday:"Yesterday",msJan:"Jan",msFeb:"Feb",msMar:"Mar",msApr:"Apr",msMay:"May",msJun:"Jun",msJul:"Jul",msAug:"Aug",msSep:"Sep",msOct:"Oct",msNov:"Nov",msDec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",Sun:"Sun",Mon:"Mon",Tue:"Tue",Wed:"Wed",Thu:"Thu",Fri:"Fri",Sat:"Sat",sortname:"by name",sortkind:"by kind",sortsize:"by size",sortdate:"by date",sortFoldersFirst:"Folders first",sortperm:"by permission",sortmode:"by mode",sortowner:"by owner",sortgroup:"by group",sortAlsoTreeview:"Also Treeview","untitled file.txt":"NewFile.txt","untitled folder":"NewFolder",Archive:"NewArchive","untitled file":"NewFile.$1",extentionfile:"$1: File",extentiontype:"$1: $2",confirmReq:"Confirmation required",confirmRm:"Are you sure you want to permanently remove items?<br/>This cannot be undone!",confirmRepl:"Replace old file with new one? (If it contains folders, it will be merged. To backup and replace, select Backup.)",confirmRest:"Replace existing item with the item in trash?",confirmConvUTF8:"Not in UTF-8<br/>Convert to UTF-8?<br/>Contents become UTF-8 by saving after conversion.",confirmNonUTF8:"Character encoding of this file couldn't be detected. It need to temporarily convert to UTF-8 for editting.<br/>Please select character encoding of this file.",confirmNotSave:"It has been modified.<br/>Losing work if you do not save changes.",confirmTrash:"Are you sure you want to move items to trash bin?",confirmMove:'Are you sure you want to move items to "$1"?',apllyAll:"Apply to all",name:"Name",size:"Size",perms:"Permissions",modify:"Modified",kind:"Kind",read:"read",write:"write",noaccess:"no access",and:"and",unknown:"unknown",selectall:"Select all items",selectfiles:"Select item(s)",selectffile:"Select first item",selectlfile:"Select last item",viewlist:"List view",viewicons:"Icons view",viewSmall:"Small icons",viewMedium:"Medium icons",viewLarge:"Large icons",viewExtraLarge:"Extra large icons",places:"Places",calc:"Calculate",path:"Path",aliasfor:"Alias for",locked:"Locked",dim:"Dimensions",files:"Files",folders:"Folders",items:"Items",yes:"yes",no:"no",link:"Link",searcresult:"Search results",selected:"selected items",about:"About",shortcuts:"Shortcuts",help:"Help",webfm:"Web file manager",ver:"Version",protocolver:"protocol version",homepage:"Project home",docs:"Documentation",github:"Fork us on GitHub",twitter:"Follow us on Twitter",facebook:"Join us on Facebook",team:"Team",chiefdev:"chief developer",developer:"developer",contributor:"contributor",maintainer:"maintainer",translator:"translator",icons:"Icons",dontforget:"and don't forget to take your towel",shortcutsof:"Shortcuts disabled",dropFiles:"Drop files here",or:"or",selectForUpload:"Select files",moveFiles:"Move items",copyFiles:"
162Copy items",restoreFiles:"Restore items",rmFromPlaces:"Remove from places",aspectRatio:"Aspect ratio",scale:"Scale",width:"Width",height:"Height",resize:"Resize",crop:"Crop",rotate:"Rotate","rotate-cw":"Rotate 90 degrees CW","rotate-ccw":"Rotate 90 degrees CCW",degree:"°",netMountDialogTitle:"Mount network volume",protocol:"Protocol",host:"Host",port:"Port",user:"User",pass:"Password",confirmUnmount:"Are you sure to unmount $1?",dropFilesBrowser:"Drop or Paste files from browser",dropPasteFiles:"Drop files, Paste URLs or images(clipboard) here",encoding:"Encoding",locale:"Locale",searchTarget:"Target: $1",searchMime:"Search by input MIME Type",owner:"Owner",group:"Group",other:"Other",execute:"Execute",perm:"Permission",mode:"Mode",emptyFolder:"Folder is empty",emptyFolderDrop:"Folder is empty\\A Drop to add items",emptyFolderLTap:"Folder is empty\\A Long tap to add items",quality:"Quality",autoSync:"Auto sync",moveUp:"Move up",getLink:"Get URL link",selectedItems:"Selected items ($1)",folderId:"Folder ID",offlineAccess:"Allow offline access",reAuth:"To re-authenticate",nowLoading:"Now loading...",openMulti:"Open multiple files",openMultiConfirm:"You are trying to open the $1 files. Are you sure you want to open in browser?",emptySearch:"Search results is empty in search target.",editingFile:"It is editing a file.",hasSelected:"You have selected $1 items.",hasClipboard:"You have $1 items in the clipboard.",incSearchOnly:"Incremental search is only from the current view.",reinstate:"Reinstate",complete:"$1 complete",contextmenu:"Context menu",pageTurning:"Page turning",volumeRoots:"Volume roots",reset:"Reset",bgcolor:"Background color",colorPicker:"Color picker","8pxgrid":"8px Grid",enabled:"Enabled",disabled:"Disabled",emptyIncSearch:"Search results is empty in current view.\\A Press [Enter] to expand search target.",emptyLetSearch:"First letter search results is empty in current view.",textLabel:"Text label",minsLeft:"$1 mins left",openAsEncoding:"Reopen with selected encoding",saveAsEncoding:"Save with the selected encoding",selectFolder:"Select folder",firstLetterSearch:"First letter search",presets:"Presets",tooManyToTrash:"It's too many items so it can't into trash.",TextArea:"TextArea",folderToEmpty:'Empty the folder "$1".',filderIsEmpty:'There are no items in a folder "$1".',preference:"Preference",language:"Language",clearBrowserData:"Initialize the settings saved in this browser",toolbarPref:"Toolbar settings",charsLeft:"... $1 chars left.",linesLeft:"... $1 lines left.",sum:"Sum",roughFileSize:"Rough file size",autoFocusDialog:"Focus on the element of dialog with mouseover",select:"Select",selectAction:"Action when select file",useStoredEditor:"Open with the editor used last time",selectinvert:"Invert selection",renameMultiple:"Are you sure you want to rename $1 selected items like $2?<br/>This cannot be undone!",batchRename:"Batch rename",plusNumber:"+ Number",asPrefix:"Add prefix",asSuffix:"Add suffix",changeExtention:"Change extention",columnPref:"Columns settings (List view)",reflectOnImmediate:"All changes will reflect immediately to the archive.",reflectOnUnmount:"Any changes will not reflect until un-mount this volume.",unmountChildren:"The following volume(s) mounted on this volume also unmounted. Are you sure to unmount it?",selectionInfo:"Selection Info",hashChecker:"Algorithms to show the file hash",infoItems:"Info Items (Selection Info Panel)",pressAgainToExit:"Press again to exit.",toolbar:"Toolbar",workspace:"Work Space",dialog:"Dialog",all:"All",iconSize:"Icon Size (Icons view)",editorMaximized:"Open the maximized editor window",editorConvNoApi:"Because conversion by API is not currently available, please convert on the website.",editorConvNeedUpload:"After conversion, you must be upload with the item URL or a downloaded file to save the converted file.",convertOn:"Convert on the site of $1",integrations:"Integrations",integrationWith:"This elFinder has the following external services integrated. Please check the terms of use, privacy policy, etc. before using it.",showHidden:"Show hidden items",hideHidden:"Hide hidden items",toggleHidden:"Show/Hide hidden items",makefileTypes:'File types to enable with "New file"',typeOfTextfile:"Type of the Text file",add:"Add",theme:"Theme",default:"Default",description:"Description",website:"Website",author:"Author",email:"Email",license:"License",exp
162ortToSave:"This item can't be saved. To avoid losing the edits you need to export to your PC.",dblclickToSelect:"Double click on the file to select it.",useFullscreen:"Use fullscreen mode",kindUnknown:"Unknown",kindRoot:"Volume Root",kindFolder:"Folder",kindSelects:"Selections",kindAlias:"Alias",kindAliasBroken:"Broken alias",kindApp:"Application",kindPostscript:"Postscript document",kindMsOffice:"Microsoft Office document",kindMsWord:"Microsoft Word document",kindMsExcel:"Microsoft Excel document",kindMsPP:"Microsoft Powerpoint presentation",kindOO:"Open Office document",kindAppFlash:"Flash application",kindPDF:"Portable Document Format (PDF)",kindTorrent:"Bittorrent file",kind7z:"7z archive",kindTAR:"TAR archive",kindGZIP:"GZIP archive",kindBZIP:"BZIP archive",kindXZ:"XZ archive",kindZIP:"ZIP archive",kindRAR:"RAR archive",kindJAR:"Java JAR file",kindTTF:"True Type font",kindOTF:"Open Type font",kindRPM:"RPM package",kindFont:"Font",kindSFNT:"SFNT font",kindEOT:"Embedded Open Type font",kindWOFF:"Web Open Font Format",kindWOFF2:"Web Open Font Format 2",kindText:"Text document",kindTextPlain:"Plain text",kindPHP:"PHP source",kindCSS:"Cascading style sheet",kindHTML:"HTML document",kindJS:"Javascript source",kindRTF:"Rich Text Format",kindC:"C source",kindCHeader:"C header source",kindCPP:"C++ source",kindCPPHeader:"C++ header source",kindShell:"Unix shell script",kindPython:"Python source",kindJava:"Java source",kindRuby:"Ruby source",kindPerl:"Perl script",kindSQL:"SQL source",kindXML:"XML document",kindAWK:"AWK source",kindCSV:"Comma separated values",kindDOCBOOK:"Docbook XML document",kindMarkdown:"Markdown text",kindImage:"Image",kindBMP:"BMP image",kindJPEG:"JPEG image",kindGIF:"GIF Image",kindPNG:"PNG Image",kindTIFF:"TIFF image",kindTGA:"TGA image",kindPSD:"Adobe Photoshop image",kindXBITMAP:"X bitmap image",kindPXM:"Pixelmator image",kindWEBP:"WEBP image",kindSVG:"SVG image",kindAudio:"Audio media",kindAudioMPEG:"MPEG audio",kindAudioMPEG4:"MPEG-4 audio",kindAudioMIDI:"MIDI audio",kindAudioOGG:"Ogg Vorbis audio",kindAudioWAV:"WAV audio",AudioPlaylist:"MP3 playlist",kindVideo:"Video media",kindVideoDV:"DV movie",kindVideoMPEG:"MPEG movie",kindVideoMPEG4:"MPEG-4 movie",kindVideoAVI:"AVI movie",kindVideoMOV:"Quick Time movie",kindVideoWM:"Windows Media movie",kindVideoFlash:"Flash movie",kindVideoMKV:"Matroska movie",kindVideoOGG:"Ogg movie"}}),e.fn.elfinderbutton=function(t){return this.each((function(){var n,i,o="class",r=t.fm,s=r.res(o,"disabled"),a=r.res(o,"active"),l=r.res(o,"hover"),c="elfinder-button-menu-item",d=e('<span class="elfinder-button-text">'+t.title+"</span>"),h=t.className?t.className:t.name,u=e(this).addClass("ui-state-default elfinder-button").attr("title",t.title).append('<span class="elfinder-button-icon elfinder-button-icon-'+h+'"></span>',d).on("mouseenter mouseleave",(function(e){!u.hasClass(s)&&u["mouseleave"==e.type?"removeClass":"addClass"](l)})).on("click",(function(e){u.hasClass(s)||(n&&t.variants.length>=1?(n.is(":hidden")&&r.getUI().click(),e.stopPropagation(),n.css(f()).slideToggle({duration:100,done:function(e){r[n.is(":visible")?"toFront":"toHide"](n)}})):r.exec(t.name,m(),{_userAction:!0,_currentType:"toolbar",_currentNode:u}))})),p=function(){r.toHide(n)},f=function(){var e=r.getUI(),t=e.offset(),n=u.offset();return{top:n.top-t.top,left:n.left-t.left,maxHeight:e.height()-40}},m=function(){var e=r.selected();return e.length||(e=r.cwd()?[r.cwd().hash]:void 0),e};d.hide(),t.button=u,Array.isArray(t.variants)&&(u.addClass("elfinder-menubutton"),n=e('<div class="ui-front ui-widget ui-widget-content elfinder-button-menu elfinder-button-'+h+'-menu ui-corner-all"></div>').hide().appendTo(r.getUI()).on("mouseenter mouseleave","."+c,(function(){e(this).toggleClass(l)})).on("click","."+c,(function(i){var o=e(this).data("value");i.preventDefault(),i.stopPropagation(),u.removeClass(l),r.toHide(n),void 0===o&&(o={}),"object"==typeof o&&(o._userAction=!0),r.exec(t.name,m(),o)})).on("close",p),r.bind("disable select",p).getUI().on("click",p),t.change((function(){n.html(""),e.each(t.variants,(function(i,o){n.append(e('<div class="'+c+'">'+o[1]+"</div>").data("value",o[0]).addClass(o[0]==t.value?"elfinder-button-menu-item-selected":""))}))}))),t.change((function(){var e;i&&cancelAnimationFrame(i),i=requestAnimationFrame((function(){t.disabled()?u.removeClass(a+" "+l).addClass(s):(u.removeClass(s),u[t.active()?"addClass":"removeClass"](a)),t.syncTitleOnChange&&(e=t.className?t.className:t.name,h!==e&&(u.children(".elfinder-button-icon").removeClass("elfinder-button-icon-"
162+h).addClass("elfinder-button-icon-"+e),n&&n.removeClass("elfinder-button-"+h+"-menu").addClass("elfinder-button-"+e+"-menu"),h=e),d.html(t.title),u.attr("title",t.title))}))})).change()}))},e.fn.elfindercontextmenu=function(t){return this.each((function(){e(this);var n,i,o,r,s,a,l,c="elfinder-contextmenu-item",d="elfinder-contextsubmenu-item",h="elfinder-contextmenu-extra-icon",u=t.res("class","hover"),p={distance:8,start:function(){f.data("drag",!0).data("touching")&&f.find("."+u).removeClass(u)},stop:function(){f.data("draged",!0).removeData("drag")}},f=e(this).addClass("touch-punch ui-helper-reset ui-front ui-widget ui-state-default ui-corner-all elfinder-contextmenu elfinder-contextmenu-"+t.direction).hide().on("touchstart",(function(e){f.data("touching",!0).children().removeClass(u)})).on("touchend",(function(e){f.removeData("touching")})).on("mouseenter mouseleave","."+c,(function(t){e(this).toggleClass(u,!("mouseenter"!==t.type&&(f.data("draged")||!f.data("submenuKeep")))),f.data("draged")&&f.data("submenuKeep")&&f.find(".elfinder-contextmenu-sub:visible").parent().addClass(u)})).on("mouseenter mouseleave","."+h,(function(t){e(this).parent().toggleClass(u,"mouseleave"===t.type)})).on("mouseenter mouseleave","."+c+",."+d,(function(t){var n,i=function(t,n){e.each(n?s:o,(function(e,i){if(t[0]===i)return(n?s:o)._cur=e,n?a=t:r=t,!1}))};if(t.originalEvent){var l=e(this),c=function(){r&&!r.children("div.elfinder-contextmenu-sub:visible").length&&r.removeClass(u)};"mouseenter"===t.type?l.hasClass(d)?(a&&a.removeClass(u),r&&(s=r.find("div."+d)),i(l,!0)):(c(),i(l)):l.hasClass(d)?(a=null,s=null):(c(),n=r,setTimeout((function(){n===r&&(r=null)}),250))}})).on("contextmenu",(function(){return!1})).on("mouseup",(function(){setTimeout((function(){f.removeData("draged")}),100)})).draggable(p),m="ltr"===t.direction,g=m?"left":"right",v=Object.assign({},t.options.contextmenu),b='<div class="'+c+'{className}"><span class="elfinder-button-icon {icon} elfinder-contextmenu-icon"{style}></span><span>{label}</span></div>',y=function(n,i,o,r){var s,a,l="",c="",d="";return r&&(r.className&&(l=" "+r.className),r.iconClass&&(d=r.iconClass,i=""),r.iconImg&&(a=(s=r.iconImg.split(/ +/))[1]&&s[2]?t.escape(s[1]+"px "+s[2]+"px"):"",c=" style=\"background:url('"+t.escape(s[0])+"') "+(a||"0 0")+" no-repeat;"+(a?"":"posbackground-size:contain;")+'"')),e(b.replace("{icon}
162",i?"elfinder-button-icon-"+i:d||"").replace("{label}",n).replace("{style}",c).replace("{className}",l)).on("click",(function(e){e.stopPropagation(),e.preventDefault(),o()}))},x=function(n){var i=n.keyCode,l=e.ui.keyCode.ESCAPE,c=e.ui.keyCode.ENTER,h=e.ui.keyCode.LEFT,p=e.ui.keyCode.RIGHT,f=e.ui.keyCode.UP,m=e.ui.keyCode.DOWN,g="ltr"===t.direction?p:h,v=g===p?h:p;-1!==e.inArray(i,[l,c,h,p,f,m])&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),i==l||i===v?r&&s&&a?(a.trigger("mouseleave").trigger("submenuclose"),r.addClass(u),s=null,a=null):i==l&&_():i==f||i==m?s?(a&&a.trigger("mouseleave"),i==m&&(!a||s.length<=++s._cur)?s._cur=0:i==f&&(!a||--s._cur<0)&&(s._cur=s.length-1),a=s.eq(s._cur).trigger("mouseenter")):(s=null,r&&r.trigger("mouseleave"),i==m&&(!r||o.length<=++o._cur)?o._cur=0:i==f&&(!r||--o._cur<0)&&(o._cur=o.length-1),r=o.eq(o._cur).addClass(u)):!r||i!=c&&i!==g||(r.hasClass("elfinder-contextmenu-group")?a?i==c&&a.click():(r.trigger("mouseenter"),(s=r.find("div."+d))._cur=0,a=s.first().addClass(u)):i==c&&r.click()))},w=function(o,c,d){var h,u,p=f.outerWidth(),m=f.outerHeight(),v=n.attr("style"),b=n.offset(),y=n.width(),k=n.height(),C=t.UA.Mobile?40:2,S=t.UA.Mobile?20:2;o-=b?b.left:0,c-=b?b.top:0,d=Object.assign(d||{},{top:Math.max(0,c+S+m<k?c+S:c-(c+m-k)),left:Math.max(0,o<p+C||o+C+p<y?o+C:o-C-p),opacity:"1"});l=!0,t.autoSync("stop"),n.width(y),f.stop().removeAttr("style").css(d),t.toFront(f),f.show(),n.attr("style",v),d[g]=parseInt(f.width()),f.find(".elfinder-contextmenu-sub").css(d),t.UA.iOS&&e("div.elfinder div.overflow-scrolling-touch").css("-webkit-overflow-scrolling","auto"),r=null,s=null,a=null,e(document).on("keydown."+t.namespace,x),(h=e._data(document).events)&&h.keydown&&h.keydown.unshift(h.keydown.pop()),t.UA.Mobile&&(u="touchstart.contextmenuAutoToggle",f.data("hideTm")&&clearTimeout(f.data("hideTm")),f.is(":visible")&&f.on("touchstart",(function(e){e.originalEvent.touches.length>1||(f.stop(),t.toFront(f),f.data("hideTm")&&clearTimeout(f.data("hideTm")))})).data("hideTm",setTimeout((function(){f.is(":visible")&&(i.find(".elfinder-cwd-file").off(u),i.find(".elfinder-cwd-file.ui-selected").one(u,(function(t){if(!(t.originalEvent.touches.length>1)){var n=e(t.target);if(f.first().length&&!n.is("input:checkbox")&&!n.hasClass("elfinder-cwd-select"))return t.stopPropagation(),w(t.originalEvent.touches[0].pageX,t.originalEvent.touches[0].pageY),i.data("longtap",!0),void n.one("touchend",(function(){setTimeout((function(){i.removeData("longtap")}),80)}));i.find(".elfinder-cwd-file").off(u)}})).one("unselect."+t.namespace,(function(){i.find(".elfinder-cwd-file").off(u)})),f.fadeOut({duration:300,fail:function(){f.css("opacity","1").show()},done:function(){t.toHide(f)}}))}),4500))),requestAnimationFrame((function(){t.getUI().one("click."+t.namespace,_)}))},_=function(){if(t.getUI().off("click."+t.namespace,_),e(document).off("keydown."+t.namespace,x),k=C=null,f.is(":visible")||f.children().length){t.toHide(f.removeAttr("style").empty().removeData("submenuKeep"));try{f.draggable("instance")||f.draggable(p)}catch(e){f.hasClass("ui-draggable")||f.draggable(p)}f.data("prevNode")&&(f.data("prevNode").after(f),f.removeData("prevNode")),t.trigger("closecontextmenu"),t.UA.iOS&&e("div.elfinder div.overflow-scrolling-touch").css("-webkit-overflow-scrolling","touch")}l&&t.searchStatus.state<1&&!t.searchStatus.ininc&&t.autoSync(),l=!1},k=null,C=null;t.one("load",(function(){n=t.getUI(),i=t.getUI("cwd"),t.bind("contextmenu",(function(r){var s,a,l,p,g,b,x,S,T,E,A=r.data,O={};A.type&&"files"!==A.type&&i.trigger("unselectall"),_(),A.type&&A.targets?(t.trigger("contextmenucreate",A),l=A.type,p=A.targets,x=!1,S=!1,T=[],E="cwd"===l,k=l,C=p,(b=t.option("uiCmdMap",E?void 0:p[0]))||(b={}),E||(T=t.getDisabledCmds(p)),(g=t.selected().length)>1&&f.append('<div class="ui-corner-top ui-widget-header elfinder-contextmenu-header"><span>'+t.i18n("selectedItems",""+g)+"</span></div>"),o=e(),e.each(v[l]||[],(function(i,r){var s,a,g,v,w,k;if("|"!==r){if(b[r]?(a=b[r],g=!0):a=r,!(s=t.getCommand(a))||E||t.searchStatus.state&&s.disableOnSearch||(s.__disabled=s._disabled,s._disabled=!(s.alwaysEnabled||t._commands[a]&&!(-1!==e.inArray(r,T)||g&&T[a])),e.each(s.linkedCmds,(function(e,n){var i;(i=t.getCommand(n))&&(i.__disabled=i._disabled,i._disabled=!(i.alwaysEnabled||t._commands[n]&&!T[n]))}))),s&&!s._disabled&&-1!=s.getstate(p)){if(s.variants){if(!s.variants.length)return;v=y(s.title,s.className?s.className:s.name,(function(){}),s.contextmenuOpts),w=e('<div class="ui-front ui-corner-all elfinder-contextmenu-sub"></div>').hide().css("max-height",t.getUI().height()-30).appendTo(v.append('<span class="elfinder-contextmenu-arrow"></span>')),k=function(e){if(e){var i=n.attr("style");n.width(n.width()),w.css({top:"-1000px",left:"auto",right:"auto"});var o,r,s=v.offset(),a=s.left,l=s.top,c=v.outerWidth(),d=w.outerWidth(!0),h=w.outerHeight(!0),u=n.offset(),p=u.left+n.width(),g=u.top+n.height(),b=m,y=c;m?(r=a+c+d-p)>10&&(a>d-5?(y-=5,b=!1):t.UA.Mobile||(y=c-r)):(r=d-a)>0&&(a+c+d-15<p?(y-=5,b=!0):t.UA.Mobile||(y=c-r)),o=(r=l+5+h-g)>0&&l<g?5-r:r>0?30-h:5,f.find(".elfinder-contextmenu-sub:visible").hide(),w.css({top:o,left:b?y:"auto",right:b?"auto":y,overflowY:"auto"}).show(),n.attr("style",i)}else w.hide()},v.addClass("elfinder-contextmenu-group").on("mouseleave",".elfinder-contextmenu-sub",(function(e){f.data("draged")||f.removeData("submenuKeep")})).on("submenuclose",".elfinder-contextmenu-sub",(function(e){k(!1)})).on("click","."+d,(function(n){var i,o;n.stopPropagation(),f.data("draged")||(o=e(this),s.keepContextmenu?(o.removeClass(u),v.addClass(u)):f.hide(),void 0===(i=o.data("exec"))&&(i={}),"object"==typeof i&&(i._userAction=!0,i._currentType=l,i._currentNode=o),!s.keepContextmenu&&_(),t.exec(s.name,p,i))})).on("touchend",(function(e){f.data("drag")||(k(!0),f.data("submenuKeep",!0))})).on("mouseenter mouseleave",(function(t){f.data("touching")||(v.data("timer")&&(clearTimeout(v.data("timer")),v.removeData("timer")),e(t.target).closest(".elfinder-contextmenu-sub",f).length||("mouseleave"===t.type?f.data("submenuKeep")||v.data("timer",setTimeout((function(){v.removeData("timer"),k(!1)}),250)):v.data("timer",setTimeout((function(){v.removeData("timer"),k(!0)}),o.find("div.elfinder-contextmenu-sub:visible").length?250:0))))})),e.each(s.variants,(function(t,n){var i,o,r,s="|"===n?'<div class="elfinder-contextmenu-separator"></div>':e('<div class="'+c+" "+d+'"><span>'+n[1]+"</span></div>").data("exec",n[0]);void 0!==n[2]&&(i=e("<span></span>").addClass("elfinder-button-icon elfinder-contextmenu-icon"),/\//.test(n[2])?i.css((r=(o=n[2].split(/ +/))[1]&&o[2]?o[1]+"px "+o[2]+"px":"",{backgroundImage:'url("'+o[0]+'")',backgroundRepeat:"no-repeat",backgroundPosition:r||"",backgroundSize:r?"":"contain"}
162)):i.addClass("elfinder-button-icon-"+n[2]),s.prepend(i).addClass(d+"-icon")),w.append(s)}))}else v=y(s.title,s.className?s.className:s.name,(function(){f.data("draged")||(!s.keepContextmenu&&_(),t.exec(s.name,p,{_userAction:!0,_currentType:l,_currentNode:v}))}),s.contextmenuOpts),s.extra&&s.extra.node?(e('<span class="elfinder-button-icon elfinder-button-icon-'+(s.extra.icon||"")+" "+h+'"></span>').append(s.extra.node).appendTo(v),e(s.extra.node).trigger("ready",{targets:p})):v.remove("."+h);s.extendsCmd&&v.children("span.elfinder-button-icon").addClass("elfinder-button-icon-"+s.extendsCmd),S&&f.append('<div class="elfinder-contextmenu-separator"></div>'),f.append(v),x=!0,S=!1}s&&void 0!==s.__disabled&&(s._disabled=s.__disabled,delete s.__disabled,e.each(s.linkedCmds,(function(e,n){var i;(i=t.getCommand(n))&&(i._disabled=i.__disabled,delete i.__disabled)})))}else x&&(S=!0)})),o=f.children("div."+c),t.trigger("contextmenucreatedone",A)):A.raw&&(a=A.raw,k="raw",e.each(a,(function(e,t){var n;"|"===t?f.append('<div class="elfinder-contextmenu-separator"></div>'):t.label&&"function"==typeof t.callback&&(n=y(t.label,t.icon,(function(){f.data("draged")||(!t.remain&&_(),t.callback())}),t.options||null),f.append(n))})),o=f.children("div."+c)),f.children().length&&((s=A.prevNode||null)&&(f.data("prevNode",f.prev()),s.after(f)),A.fitHeight&&(O={maxHeight:Math.min(t.getUI().height(),e(window).height()),overflowY:"auto"},f.draggable("destroy").removeClass("ui-draggable")),w(A.x,A.y,O),A.opened&&"function"==typeof A.opened&&A.opened.call(f))})).one("destroy",(function(){f.remove()})).bind("disable",_).bind("select",(function(e){"files"===k&&(!e.data||e.data.selected.toString()!==C.toString())&&_()}))})).shortcut({pattern:"mac"===t.OS?"ctrl+m":"contextmenu shift+f10",description:"contextmenu",callback:function(n){n.stopPropagation(),n.preventDefault(),e(document).one("contextmenu."+t.namespace,(function(e){e.preventDefault(),e.stopPropagation()}));var i,o,r,s,a=t.selected();a.length?(i="files",o=a,s=t.cwdHash2Elm(a[0])):(i="cwd",o=[t.cwd().hash],r=t.getUI("workzone").offset()),s&&s.length||(s=t.getUI("workzone")),(r=s.offset()).top+=s.height()/2,r.left+=s.width()/2,t.trigger("contextmenu",{type:i,targets:o,x:r.left,y:r.top})}})}))},e.fn.elfindercwd=function(t,n){return this.not(".elfinder-cwd").each((function(){var i,o,r,s,a,l,c,d=t.UA.Mobile,h="list"==t.viewType,u="select."+t.namespace,p="unselect."+t.namespace,f="disable."+t.namespace,m="enable."+t.namespace,g="class",v=t.res(g,"cwdfile"),b="."+v,y="ui-selected",x=t.res(g,"disabled"),w=t.res(g,"draggable"),_=t.res(g,"droppable"),k=t.res(g,"hover"),C=t.res(g,"active"),S=t.res(g,"adroppable"),T=v+"-tmp",E="elfinder-cwd-selectchk",A=t.options.loadTmbs>0?t.options.loadTmbs:5,O="",D={},I=[],P=[],M=void 0,R=[],z="",N=function(){return'<tr id="{id}" class="'+v+' {permsclass} {dirclass}" title="{tooltip}"{css}><td class="elfinder-col-name"><div class="elfinder-cwd-file-wrapper"><span class="elfinder-cwd-icon {mime}"{style}></span>{marker}<span class="elfinder-cwd-filename">{name}</span></div>'+F+"</td>"+function(){for(var e="",t=0;t<R.length;t++)e+='<td class="elfinder-col-'+R[t]+'">{'+R[t]+"}</td>";return e}()+"</tr>"},F=e.map(n.showSelectCheckboxUA,(function(e){return!(!t.UA[e]&&!e.match(/^all$/i))||null})).length?'<div class="elfinder-cwd-select"><input type="checkbox" class="'+E+'"></div>':"",L=!1,j=null,B={icon:'<div id="{id}" class="'+v+' {permsclass} {dirclass} ui-corner-all" title="{tooltip}"><div class="elfinder-cwd-file-wrapper ui-corner-all"><div class="elfinder-cwd-icon {mime} ui-corner-all" unselectable="on"{style}></div>{marker}</div><div class="elfinder-cwd-filename" title="{nametitle}">{name}</div>'+F+"</div>",row:""},H=t.res("tpl","perms"),U=t.res("tpl","lock"),$=t.res("tpl","symlink"),q={id:function(e){return t.cwdHash2Id(e.hash)},name:function(e){var n=t.escape(e.i18||e.name);return!h&&(n=n.replace(/([_.])/g,"&#8203;$1")),n},nametitle:function(e){return t.escape(e.i18||e.name)},permsclass:function(e){return t.perms2class(e)},perm:function(e){return t.formatPermissions(e)},dirclass:function(e){var i="directory"==e.mime?"directory":"";
162return e.isroot&&(i+=" isroot"),e.csscls&&(i+=" "+t.escape(e.csscls)),n.getClass&&(i+=" "+n.getClass(e)),i},style:function(e){return e.icon?t.getIconStyle(e):""},mime:function(e){var n=t.mime2class(e.mime);return e.icon&&(n+=" elfinder-cwd-bgurl"),n},size:function(e){return"directory"!==e.mime||e.size?t.formatSize(e.size):"-"},date:function(e){return t.formatDate(e)},kind:function(e){return t.mime2kind(e)},mode:function(e){return e.perm?t.formatFileMode(e.perm):""},modestr:function(e){return e.perm?t.formatFileMode(e.perm,"string"):""},modeoct:function(e){return e.perm?t.formatFileMode(e.perm,"octal"):""},modeboth:function(e){return e.perm?t.formatFileMode(e.perm,"both"):""},marker:function(e){return(e.alias||"symlink-broken"==e.mime?$:"")+(e.read&&e.write?"":H)+(e.locked?U:"")},tooltip:function(e){var n=t.formatDate(e)+(e.size>0?" ("+t.formatSize(e.size)+")":""),i="";return i=O&&e.path?t.escape(e.path.replace(/\/[^\/]*$/,"")):e.tooltip?t.escape(e.tooltip).replace(/\r/g,"&#13;"):"",h&&(i+=(i?"&#13;":"")+t.escape(e.i18||e.name)),i?i+"&#13;"+n:n}},W={},V=function(n){return n.mime&&"directory"!==n.mime&&!W[n.mime]&&function(n,i){var r,s,a;if(n&&!W[n]&&(void 0===o&&(e("#elfinderAddBadgeStyle"+t.namespace).length&&e("#elfinderAddBadgeStyle"+t.namespace).remove(),o=e('<style id="addBadgeStyle'+t.namespace+'"></style>').insertBefore(e("head").children(":first")).get(0).sheet||null),o)){if(a=(n=n.toLowerCase()).split("/"),s=t.escape(t.mimeTypes[n]||(i.replace(/.bac?k$/i,"").match(/\.([^.]+)$/)||["",""])[1])){r=".elfinder-cwd-icon-"+a[0].replace(/(\.|\+)/g,"-"),void 0!==a[1]&&(r+=".elfinder-cwd-icon-"+a[1].replace(/(\.|\+)/g,"-"));try{o.insertRule(r+':before{content:"'+s.toLowerCase()+'"}',0)}catch(e){}}W[n]=!0}}(n.mime,n.name),B[h?"row":"icon"].replace(/\{([a-z0-9_]+)\}/g,(function(e,i){return q[i]?q[i](n,t):n[i]?n[i]:""}))},K=e(),G=!1,X={},Y=function(e){t.cwdHash2Elm(e).trigger(u)},Q=!1,J=function(){t.cwd().hash;F&&Me.find("input").prop("checked",!0),t.lazy((function(){var n;t.maxTargets&&(M||P).length>t.maxTargets?(Z({notrigger:!0}),n=(n=e.map(M||P,(function(e){return t.file(e)||null}))).slice(0,t.maxTargets),X={},e.each(n,(function(e,n){X[n.hash]=!0,t.cwdHash2Elm(n.hash).trigger(u)})),t.toast({mode:"warning",msg:t.i18n(["errMaxTargets",t.maxTargets])})):(De.find("[id]:not(.ui-selected):not(.elfinder-cwd-parent)").trigger(u),X=t.arrayFlip(M||P,!0)),te(),F&&Me.data("pending",!1)}),0,{repaint:!0})},Z=function(e){var t=e||{};F&&Me.find("input").prop("checked",!1),Object.keys(X).length&&(G=!1,X={},De.find("[id].ui-selected").trigger(p),F&&De.find("input:checkbox."+E).prop("checked",!1)),!t.notrigger&&te(),F&&Me.data("pending",!1),De.removeClass("elfinder-cwd-allselected")},ee=void 0,te=function(){var e=Object.keys(X),n={selected:e,origin:"cwd"};he&&(e.length>1||e[0]!==t.cwdId2Hash(he.attr("id")))&&he.hasClass(y)&&he.trigger(p),Q=e.length&&e.length===(M||P).length&&(!t.maxTargets||e.length<=t.maxTargets),F&&(Me.find("input").prop("checked",Q),De[Q?"addClass":"removeClass"]("elfinder-cwd-allselected")),Q?n.selectall=!0:e.length||(n.unselectall=!0),t.trigger("select",n)},ne=function(e,n){if(e.length){var i=e.position().top,o=e.outerHeight(!0),r=Ie.scrollTop(),s=Ie.get(0).clientHeight,a=fe?fe.outerHeight(!0):0;i+a+o>r+s?Ie.scrollTop(parseInt(i+a+o-s)):i<r&&Ie.scrollTop(i),h&&Ie.scrollLeft(0),n&&t.resources.blink(e,"lookme")}},ie=[],oe={},re=function(e){for(var t=ie.length;t--;)if(ie[t].hash==e)return t;return-1},se="elfscrstop",ae=!1,le={disabled:!0,filter:"[id]:first",stop:te,delay:250,appendTo:"body",autoRefresh:!1,selected:function(t,n){e(n.selected).trigger(u)},unselected:function(t,n){e(n.unselected).trigger(p)}},ce={},de=function(o,r){if(oe.renderd){var s=(h?De.find("tbody:first"):De).children("[id]"+(n.oldSchool?":not(.elfinder-cwd-parent)":"")+":first");if(s.length){var a,l,c,d,u,p,f,m,g=De.data("selectable"),y=(c=Ie.offset(),d=Ie.width(),u=e(window),p=s.width()/2,f=Math.min(c.left-u.scrollLeft()+("ltr"===t.direction?p:d-p),c.left+d-10),m=c.top-u.scrollTop()+10+(h?i:0),{left:Math.max(0,Math.round(f)),top:Math.max(0,Math.round(m))}),x=o?s:e(document.elementFromPoint(y.left,y.top)),w={},_={},k=Math.ceil((oe.hpi?Math.ceil(Ne.data("rectangle").height/oe.hpi*1.5):ue)/5),C=function(){var e,n,i;for(i=0;i<5&&((e=x.attr("id"))&&(oe.getTmbs=[],n=t.cwdId2Hash(e),ce[n]=e,oe.attachTmbs[n]&&(_[n]=oe.attachTmbs[n]),g&&(w[e]=!0)),(x=x.next()).length);i++);},S=function(){var e;De.data("selectable")&&(Object.assign(w,X),(e=Object.keys(w)).length&&(le.filter="#"+e.join(", #"),De.selectable("enable").selectable("option",{filter:le.filter}).selectable("refresh"))),Object.keys(_).length&&(oe.getTmbs=[],xe(_))},T=function(){x.hasClass(v)||(x=x.closest(b))};if(ce={},g&&De.selectable("option","disabled"),x.length&&(x.hasClass(v)||x.closest(b).length||((l=t.getUI().find(".ui-dialog:visible,.ui-widget:visible")).length?(l.hide(),x=e(document.elementFromPoint(y.left,y.top)),l.show()):l=null),T(),x.length||(l&&l.hide(),x=e(document.elementFromPoint(y.left,y.top+5)),l&&l.show(),T())),x.length){if(x.attr("id"))if(o){for(var E=0;E<k&&(C(),x.length);E++);S()}else oe.repaintJob&&"pending"===oe.repaintJob.state()&&oe.repaintJob.reject(),a=new Array(k),oe.repaintJob=t.asyncJob((function(){C(),x.length||(S(),oe.repaintJob&&"pending"===oe.repaintJob.state()&&oe.repaintJob.reject())}),a).done(S)}else o&&oe.renderd&&(r=r||0)<10&&requestAnimationFrame((function(){de(o,++r)}))}}},he=null,ue=t.options.showFiles,pe=function(){if(!(oe.rendering||oe.renderd&&!ie.length)){var i,o,r=h?De.children("table").children("tbody"):De,s=!!e.htmlPrefilter,a=e(s?document.createDocumentFragment():"<div></div>"),l=function(n){var i,o,l,c=n||null,p=[],f=!1,m={},g="self"===t.option("tmbUrl"),v=!oe.renderd;i=ie.splice(0,ue+(c||0)/(oe.hpi||1)),oe.renderd+=i.length,ie.length||(Pe.hide(),Ie.off(se,pe)),o=[],p=e.map(i,(function(e){return e.hash&&e.name?("directory"==e.mime&&(f=!0),(e.tmb&&(1!=e.tmb||e.size>0)||g&&0===e.mime.indexOf("image/"))&&(m[e.hash]=e.tmb||"self"),D[e.hash]&&o.push(e.hash),V(e)):null})),a.empty().append(p.join("")),f&&!d&&ye(a),l=[],Object.keys(X).length&&a.find("[id]:not(.ui-selected):not(.elfinder-cwd-parent)").each((function(){X[t.cwdI
162d2Hash(this.id)]&&l.push(e(this))})),r.append(s?a:a.children()),l.length&&(e.each(l,(function(e,t){t.trigger(u)})),te()),o.length&&t.trigger("lockfiles",{files:o}),!oe.hpi&&Ce(r,i.length),h&&(De.find("thead").show(),ge({fitWidth:!j})),Object.keys(m).length&&Object.assign(oe.attachTmbs,m),v&&(d||De.data("selectable")||De.selectable(le).data("selectable",!0)),!ae&&Ie.trigger(se)};oe.renderd||(oe.rendering=!0,Ie.scrollTop(0),i=t.cwd().phash,l(),n.oldSchool&&(i&&!O?function(n){var i=t.cwd().phash,o=t.file(i)||null,r=function(n){n&&(he=e(V(e.extend(!0,{},n,{name:"..",i18:"..",mime:"directory"}))).addClass("elfinder-cwd-parent").on("dblclick",(function(){t.trigger("select",{selected:[i]}).exec("open",i)})),(h?he.children("td:first"):he).children(".elfinder-cwd-select").remove(),t.cwdHash2Elm(i).length?t.cwdHash2Elm(i).replaceWith(he):(h?De.find("tbody"):De).prepend(he),t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1))};o?r(o):(r({hash:i,read:!0,write:!0}),t.getUI("tree").length?t.one("parents",(function(){r(t.file(i)||null),Ie.trigger(se)})):t.request({data:{cmd:"parents",target:t.cwd().hash},preventFail:!0}).done((function(e){r(t.file(i)||null),Ie.trigger(se)})))}():he=e()),h&&(j&&ve(),ge({fitWidth:!0})),oe.itemH=(h?r.find("tr:first"):r.find("[id]:first")).outerHeight(!0),t.trigger("cwdrender"),oe.rendering=!1,de(!0)),!oe.rendering&&ie.length?(o=Ie.height()+Ie.scrollTop()+t.options.showThreshold+oe.row-oe.renderd*oe.hpi)>0?(oe.rendering=!0,t.lazy((function(){l(o),oe.rendering=!1}))):!t.enabled()&&ze():ze()}},fe=null,me=t.UA.CSS.positionSticky&&t.UA.CSS.widthMaxContent,ge=function(o){if(i=0,n.listView.fixedHeader){var r,s,a,l,c,d,h,u,p,f,m,g,v,b=function(){var e,n;n="ltr"===t.direction?"left":"right",e=-1*("ltr"===t.direction?Ie.scrollLeft():a.outerWidth(!0)-Ie.width()-Ie.scrollLeft()),s.css(n)!==e&&s.css(n,e)},y=o||{};if((u=(c=De.find("tbody")).children("tr:first")).length&&u.is(":visible")){if(a=c.parent(),fe?h=(l=e("#"+t.namespace+"-cwd-thead")).children("tr:first"):(v=!0,c.addClass("elfinder-cwd-fixheader"),d=(h=(l=De.find("thead").attr("id",t.namespace+"-cwd-thead")).children("tr:first")).outerHeight(!0),De.css("margin-top",d-parseInt(a.css("padding-top"))),me?(fe=e('<div class="elfinder-table-header-sticky"></div>').addClass(De.attr("class")).append(e("<table></table>").append(l)),De.after(fe),Ie.on("resize.fixheader",(function(e){e.stopPropagation(),ge({fitWidth:!0})}))):(s=e("<div></div>").addClass(De.attr("class")).append(e("<table></table>").append(l)),fe=e("<div></div>").addClass(Ie.attr("class")+" elfinder-cwd-fixheader").removeClass("ui-droppable native-droppable").css(Ie.position()).css({height:d,width:De.outerWidth()}).append(s),"rtl"===t.direction&&fe.css("left",Ie.data("width")-Ie.width()+"px"),b(),Ie.after(fe).on("scroll.fixheader resize.fixheader",(function(e){b(),"resize"===e.type&&(e.stopPropagation(),fe.css(Ie.position()),Ie.data("width",Ie.css("overflow","hidden").width()),Ie.css("overflow","auto"),ge())})))),v||y.fitWidth||Math.abs(u.outerWidth()-h.outerWidth())>2){r=R.length+1;for(var x=0;x<r&&(p=h.children("td:eq("+x+")"),f=u.children("td:eq("+x+")"),m=p.width(),g=f.width(),void 0===p.data("delta")&&p.data("delta",p.outerWidth()-m-(f.outerWidth()-g)),g-=p.data("delta"),v||y.fitWidth||m!==g);x++)p.css("width",g+"px")}me||(fe.data("widthTimer")&&cancelAnimationFrame(fe.data("widthTimer")),fe.data("widthTimer",requestAnimationFrame((function(){fe&&(fe.css("width",Fe.width()+"px"),"rtl"===t.direction&&fe.css("left",Ie.data("width")-Ie.width()+"px"))})))),i=l.height()}}},ve=function(){if(h&&j){var t="elfinder-cwd-colwidth",n=De.find("tr[id]:first");n.hasClass(t)||(De.find("tr."+t).removeClass(t).find("td").css("width",""),n.addClass(t),De.find("table:first").css("table-layout","fixed"),e.each(e.merge(["name"],R),(function(e,t){var i=j[t]||n.find("td.elfinder-col-"+t).width();n.find("td.elfinder-col-"+t).width(i)})))}},be=Object.assign({},t.droppable,{over:function(n,i){var o,r,s,a=e(this),l=i.helper,c=t._commands.copy&&(n.shiftKey||n.ctrlKey||n.metaKey);n.stopPropagation(),l.data("dropover",l.data("dropover")+1),a.data("dropover",!0),l.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"),l.data("namespace")===t.namespace&&t.insideWorkzone(n.pageX,n.pageY)?(a.hasClass(t.res(g,"cwdfile"))?(o=t.cwdId2Hash(a.attr("id")),a.data("dropover",o)):(o=t.cwd().hash,t.cwd().write&&a.data("dropover",o)),s=t.file(l.data("files")[0]).phash===o,a.data("dropover")===o?e.each(l.data("files"),(function(e,t){if(t===o||s&&!c&&!l.hasClass("elfinder-drag-helper-plus"))return a.removeClass(S),!1})):a.removeClass(S),l.data("locked")||s?r="elfinder-drag-helper-plus":(r="elfinder-drag-helper-move",c&&(r+=" elfinder-drag-helper-plus")),a.hasClass(S)&&l.addClass(r),requestAnimationFrame((function(){a.hasClass(S)&&l.addClass(r)}))):a.removeClass(S)},out:function(t,n){var i=n.helper;t.stopPropagation(),i.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(i.data("dropover")-1,0)),e(this).removeData("dropover").removeClass(S)},deactivate:function(){e(this).removeData("dropover").removeClass(S)},drop:function(e,n){Z({notrigger:!0}),t.droppable.drop.call(this,e,n)}}),ye=function(n){var i=(n=n||(h?De.find("tbody"):De)).children(".directory:not(."+_+",.elfinder-na,.elfinder-ro)");t.isCommandEnabled("paste")&&i.droppable(be),t.isCommandEnabled("upload")&&i.addClass("native-droppable"),n.children(".isroot").each((function(n,i){var o=e(i),r=t.cwdId2Hash(i.id);t.isCommandEnabled("paste",r)?o.hasClass(_+",elfinder-na,elfinder-ro")||o.droppable(be):o.hasClass(_)&&o.droppable("destroy"),t.isCommandEnabled("upload",r)?o.hasClass("native-droppable,elfinder-na,elfinder-ro")||o.addClass("native-droppable"):o.hasClass("native-droppable")&&o.removeClass("native-droppable")}))},xe=function(n,i){e.isPlainObject(n)&&Object.keys(n).length&&(Object.assign(oe.attachTmbs,n),e.each(n,(function(n,o){var r,s,a=t.cwdHash2Elm(n);a.length&&("1"!=o?((r=t.file(n)).tmb!==o&&(r.tmb=o),s=t.tmb(r),i?a.find(".elfinder-cwd-icon").addClass(s.className).css("background-image","url('"+s.url+"')"):function(t,n){e("<img/>").on("load",(function(){t.find(".elfinder-cwd-icon").addClass(n.className).css("background-image","url('"+n.url+"')")})).attr("src",n.url)}(a,s),delete oe.attachTmbs[n]):i?we([n]):oe.tmbLoading[n]||oe.getTmbs.push(n))})),i||!oe.getTmbs.length||Object.keys(oe.tmbLoading).length||we())},we=function(n){var i=[],o=!1;t.oldAPI?t.request({data:{cmd:"tmb",current:t.cwd().hash},preventFail:!0}).done((function(e){e.images&&Object.keys(e.images).length&&xe(e.images),e.tmb&&we()})):(n?(o=!0,i=n.splice(0,A)):i=oe.getTmbs.splice(0,A),i.length&&(o||ce[i[
1620]]||ce[i[i.length-1]])&&(e.each(i,(function(e,t){oe.tmbLoading[t]=!0})),t.request({data:{cmd:"tmb",targets:i},preventFail:!0}).done((function(t){var r,s=[];t.images&&((r=Object.keys(t.images).length)?(r<i.length&&e.each(i,(function(e,n){t.images[n]||s.push(n)})),xe(t.images,o)):s=i,s.length&&e.each(s,(function(e,t){delete oe.attachTmbs[t]}))),o&&n.length&&we(n)})).always((function(){oe.tmbLoading={},!o&&oe.getTmbs.length&&we()}))))},_e=function(n,i){var o,r,s,a,l,c,u=h?De.find("tbody"):De,p=n.length,f={},m=function(e){for(var n,i=De.find("[id]:first");i.length;){if(n=t.file(t.cwdId2Hash(i.attr("id"))),!i.hasClass("elfinder-cwd-parent")&&n&&t.compare(e,n)<0)return i;i=i.next("[id]")}},g=function(e){var n,i=ie.length;for(n=0;n<i;n++)if(t.compare(e,ie[n])<0)return n;return i||-1},v=!!e.htmlPrefilter,b=e(v?document.createDocumentFragment():"<div></div>");if(p>ue)Oe(),X=t.arrayFlip(e.map(n,(function(e){return e.hash})),!0),te();else{for(p&&Ne.removeClass("elfinder-cwd-wrapper-empty"),c="self"===t.option("tmbUrl");p--;)r=(o=n[p]).hash,t.cwdHash2Elm(r).length||((s=m(o))&&!s.length&&(s=null),!s&&(l=g(o))>=0?ie.splice(l,0,o):(b.empty().append(V(o)),"directory"===o.mime&&!d&&ye(b),a=v?b:b.children(),s?s.before(a):u.append(a),++oe.renderd),t.cwdHash2Elm(r).length&&(o.tmb&&(1!=o.tmb||o.size>0)||c&&0===o.mime.indexOf("image/"))&&(f[r]=o.tmb||"self"));h&&(ve(),ge({fitWidth:!j})),Ce(u),Object.keys(f).length&&(Object.assign(oe.attachTmbs,f),ie.length<1&&we())}},ke=function(n){var i,o,r,s,a=n.length,l=t.searchStatus.state>1,c=t.getCommand(t.currentReqCmd)||{};if(!t.cwd().hash&&!c.noChangeDirOnRemovedCwd)return e.each(I.reverse(),(function(e,n){if(t.file(n))return s=!0,t.one(t.currentReqCmd+"done",(function(){!t.cwd().hash&&t.exec("open",n)})),!1})),void(!s&&!t.cwd().hash&&t.exec("open",t.roots[Object.keys(t.roots)[0]]));for(;a--;){if(i=n[a],(o=t.cwdHash2Elm(i)).length)try{o.remove(),--oe.renderd}catch(e){t.debug("error",e)}else-1!==(r=re(i))&&ie.splice(r,1);X[i]&&delete X[i],l&&-1!==(r=e.inArray(i,P))&&P.splice(r,1)}l&&t.trigger("cwdhasheschange",P),h&&(ve(),ge({fitWidth:!j}))},Ce=function(e,n){var i,o=e||(h?De.find("tbody"):De),r=Be[t.viewType],s=1;ie.length>0&&(oe.hpi?h||(s=Math.floor(o.width()/r.width)):(!function(e){var t;e.height||(t=(h?De.find("tbody"):De).find(h?"tr:first":"[id]:first"),e.height=t.outerHeight(!0),h||(e.width=t.outerWidth(!0)))}(r),h?oe.row=oe.hpi=r.height:(s=Math.floor(o.width()/r.width),oe.row=r.height,oe.hpi=oe.row/s)),i=Math.ceil((ie.length+(n||0))/s),h&&fe&&++i,Pe.css({top:oe.row*i+"px"}).show())},Se=function(e){e.preventDefault(),void 0===De.data("longtap")?t.trigger("contextmenu",{type:"cwd",targets:[t.cwd().hash],x:e.pageX,y:e.pageY}):e.stopPropagation()},Te=function(e){e.originalEvent.touches.length>1||(!1!==De.data("longtap")&&(Ie.data("touching",{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}),De.data("tmlongtap",setTimeout((function(){De.data("longtap",!0),t.trigger("contextmenu",{type:"cwd",targets:[t.cwd().hash],x:Ie.data("touching").x,y:Ie.data("touching").y})}),500))),De.data("longtap",null))},Ee=function(e){"touchmove"===e.type?(!Ie.data("touching")||Math.abs(Ie.data("touching").x-e.originalEvent.touches[0].pageX)+Math.abs(Ie.data("touching").y-e.originalEvent.touches[0].pageY)>4)&&Ie.data("touching",null):setTimeout((function(){De.removeData("longtap")}),80),clearTimeout(De.data("tmlongtap"))},Ae=function(e){De.data("longtap")&&(e.preventDefault(),e.stopPropagation())},Oe=function(){t.lazy((function(){var n;Ne.append(Me).removeClass("elfinder-cwd-wrapper-empty elfinder-search-result elfinder-incsearch-result elfinder-letsearch-result"),(t.searchStatus.state>1||t.searchStatus.ininc)&&Ne.addClass("elfinder-search-result"+(t.searchStatus.ininc?" elfinder-"+("/"===O.substr(0,1)?"let":"inc")+"search-result":"")),oe.attachThumbJob&&oe.attachThumbJob._abort(),De.data("selectable")&&De.selectable("disable").selectable("destroy").removeData("selectable"),t.trigger("cwdinit"),K=e();try{De.empty()}catch(e){De.html("")}fe&&(Ie.off("scroll.fixheader resize.fixheader"),fe.remove(),fe=null),De.removeClass("elfinder-cwd-view-icons elfinder-cwd-view-list").addClass("elfinder-cwd-view-"+(h?"list":"icons")).attr("style","").css("height","auto"),Pe.hide(),Ie[h?"addClass":"removeClass"]("elfinder-cwd-wrapper-list")._padding=parseInt(Ie.css("padding-top"))+parseInt(Ie.css("padding-bottom")),t.UA.iOS&&Ie.removeClass("overflow-scrolling-touch").addClass("overflow-scrolling-touch"),h&&(De.html("<table><thead></thead><tbody></tbody></table>"),n=e('<tr class="ui-state-default"><td class="elfinder-cwd-view-th-name">'+t.getColumnName("name")+"</td>"+function(){for(var e="",n="",i=0;i<R.length;i++)e=t.getColumnName(R[i]),n+='<td class="elfinder-cwd-view-th-'+R[i]+' sortable-item">'+e+"</td>";return n}()+"</tr>"),De.find("thead").hide().append(n).find("td:first").append(Me),e.fn.sortable&&n.addClass("touch-punch touch-punch-keep-default").sortable({axis:"x",distance:8,items:">
162 .sortable-item",start:function(t,n){e(n.item[0]).data("dragging",!0),n.placeholder.width(n.helper.removeClass("ui-state-hover").width()).removeClass("ui-state-active").addClass("ui-state-hover").css("visibility","visible")},update:function(n,i){var o,r,s=e(i.item[0]).attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","");R=e.map(e(this).children(),(function(t){var n=e(t).attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","");return r||(s===n?r=!0:o=n),"name"===n?null:n})),B.row=N(),t.storage("cwdCols",R),o=".elfinder-col-"+o+":first",s=".elfinder-col-"+s+":first",t.lazy((function(){De.find("tbody tr").each((function(){var t=e(this);t.children(o).after(t.children(s))}))}))},stop:function(t,n){setTimeout((function(){e(n.item[0]).removeData("dragging")}),100)}}),n.find("td").addClass("touch-punch").resizable({handles:"ltr"===t.direction?"e":"w",start:function(t,n){var i=De.find("td.elfinder-col-"+n.element.attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","")+":first");n.element.data("dragging",!0).data("resizeTarget",i).data("targetWidth",i.width()),L=!0,"fixed"!==De.find("table").css("table-layout")&&(De.find("tbody tr:first td").each((function(){e(this).width(e(this).width())})),De.find("table").css("table-layout","fixed"))},resize:function(e,t){t.element.data("resizeTarget").width(t.element.data("targetWidth")-(t.originalSize.width-t.size.width))},stop:function(n,i){L=!1,ge({fitWidth:!0}),j={},De.find("tbody tr:first td").each((function(){var t=e(this).attr("class").split(" ")[0].replace("elfinder-col-","");j[t]=e(this).width()})),t.storage("cwdColWidth",j),setTimeout((function(){i.element.removeData("dragging")}),100)}}).find(".ui-resizable-handle").addClass("ui-icon ui-icon-grip-dotted-vertical")),ie=e.map(M||P,(function(e){return t.file(e)||null})),ie=t.sortFiles(ie),M?M=e.map(ie,(function(e){return e.hash})):P=e.map(ie,(function(e){return e.hash})),oe={renderd:0,attachTmbs:{},getTmbs:[],tmbLoading:{},lazyOpts:{tm:0}},Ne[ie.length<1?"addClass":"removeClass"]("elfinder-cwd-wrapper-empty"),Ie.off(se,pe).on(se,pe).trigger(se),t.cwd().write?(Ie[t.isCommandEnabled("upload")?"addClass":"removeClass"]("native-droppable"),Ie.droppable(t.isCommandEnabled("paste")?"enable":"disable")):Ie.removeClass("native-droppable").droppable("disable").removeClass("ui-state-disabled")}))},De=e(this).addClass("ui-helper-clearfix elfinder-cwd").attr("unselectable","on").on("click."+t.namespace,b,(function(n){var i,o,r,s,a,l=this.id?e(this):e(this).parents("[id]:first"),c=e(n.target);if(F&&(c.is("input:checkbox."+E)||c.hasClass("elfinder-cwd-select")))return n.stopPropagation(),n.preventDefault(),l.trigger(l.hasClass(y)?p:u),te(),void requestAnimationFrame((function(){c.prop("checked",l.hasClass(y))}));if(De.data("longtap")||c.hasClass("elfinder-cwd-nonselect"))n.stopPropagation();else{if(z||(z=l.attr("id"),setTimeout((function(){z=""}),500)),n.shiftKey&&(i=l.prevAll(ee||".ui-selected:first"),o=l.nextAll(ee||".ui-selected:first"),r=i.length,s=o.length),n.shiftKey&&(r||s))a=(a=r?l.prevUntil("#"+i.attr("id")):l.nextUntil("#"+o.attr("id"))).add(l),r||(a=e(a.get().reverse())),a.trigger(u);else if(n.ctrlKey||n.metaKey)l.trigger(l.hasClass(y)?p:u);else{if(Ie.data("touching")&&l.hasClass(y))return Ie.data("touching",null),void t.dblclick({file:t.cwdId2Hash(this.id)});Z({notrigger:!0}),l.trigger(u)}te()}})).on("dblclick."+t.namespace,b,(function(n){if(z){var i=t.cwdId2Hash(z);n.stopPropagation(),this.id!==z&&(e(this).trigger(p),e("#"+z).trigger(u),te()),t.dblclick({file:i})}})).on("touchstart."+t.namespace,b,(function(n){if(!(n.originalEvent.touches.length>1)){var i=this.id?e(this):e(this).parents("[id]:first"),o=e(n.target),r=n.target.nodeName;if("INPUT"===r&&"text"===n.target.type||"TEXTAREA"===r||o.hasClass("elfinder-cwd-nonselect"))n.stopPropagation();else{if(i.find("input:text,textarea").length)return n.stopPropagation(),void n.preventDefault();Ie.data("touching",{x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY}),F&&(o.is("input:checkbox."+E)||o.hasClass("elfinder-cwd-select"))||(i.prevAll(".ui-selected:first").length+i.nextAll(".ui-selected:first").length,De.data("longtap",null),(Object.keys(X).length||h&&"TD"!==n.target.nodeName||!h&&this!==n.target)&&(De.data("longtap",!1),i.addClass(k),i.data("tmlongtap",setTimeout((function(){De.data("longtap",!0),i.trigger(u),te(),t.trigger("contextmenu",{type:"files",targets:t.selected(),x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY})}),500))))}}})).on("touchmove."+t.namespace+" touchend."+t.namespace,b,(function(n){var i,o=e(n.target);
162F&&(o.is("input:checkbox."+E)||o.hasClass("elfinder-cwd-select"))||("INPUT"!=n.target.nodeName&&"TEXTAREA"!=n.target.nodeName?(i=this.id?e(this):e(this).parents("[id]:first"),clearTimeout(i.data("tmlongtap")),"touchmove"===n.type?(Ie.data("touching",null),i.removeClass(k)):(Ie.data("touching")&&!De.data("longtap")&&i.hasClass(y)&&(n.preventDefault(),Ie.data("touching",null),t.dblclick({file:t.cwdId2Hash(this.id)})),setTimeout((function(){De.removeData("longtap")}),80))):n.stopPropagation())})).on("mouseenter."+t.namespace,b,(function(i){if(!ae){var o=e(this),r=null;if(!(d||o.data("dragRegisted")||o.hasClass(T)||o.hasClass(w)||o.hasClass(x))){if(o.data("dragRegisted",!0),!t.isCommandEnabled("copy",t.searchStatus.state>1||o.hasClass("isroot")?t.cwdId2Hash(o.attr("id")):void 0)&&!t.isCommandEnabled("cut",t.searchStatus.state>1||o.hasClass("isroot")?t.cwdId2Hash(o.attr("id")):void 0))return;o.on("mousedown",(function(i){var r=n.metakeyDragout&&!t.UA.IE&&(i.shiftKey||i.altKey),s=!1;r&&De.data("selectable")&&(De.selectable("disable").selectable("destroy").removeData("selectable"),requestAnimationFrame((function(){De.selectable(le).selectable("option",{disabled:!1}).selectable("refresh").data("selectable",!0)}))),o.removeClass("ui-state-disabled"),r?o.draggable("option","disabled",!0).attr("draggable","true"):(o.hasClass(y)||(s=h?e(i.target).closest("span,tr").is("tr"):e(i.target).hasClass("elfinder-cwd-file")),s?o.draggable("option","disabled",!0).removeClass("ui-state-disabled"):o.draggable("option","disabled",!1).removeAttr("draggable").draggable("option","cursorAt",{left:50-parseInt(e(i.currentTarget).css("margin-left")),top:47}))})).on("dragstart",(function(n){var i=n.dataTransfer||n.originalEvent.dataTransfer||null;if(r=null,i&&!t.UA.IE){var o,s=this.id?e(this):e(this).parents("[id]:first"),a=e("<span>"),l="",c=null,d=null,h=[],p=function(n){var i,o=n.mime,r=t.tmb(n);return i='<div class="elfinder-cwd-icon elfinder-cwd-icon-drag '+t.mime2class(o)+' ui-corner-all"></div>',r&&(i=e(i).addClass(r.className).css("background-image","url('"+r.url+"')").get(0).outerHTML),i},f=[];if(s.trigger(u),te(),e.each(X,(function(n){var i=t.file(n),o=i.url;if(i&&"directory"!==i.mime){if(o){if("1"==o)return f.push(n),!0}else o=t.url(i.hash);o&&(o=t.convAbsUrl(o),h.push(n),e("<a>").attr("href",o).text(o).appendTo(a),l+=o+"\n",c||(c=i.mime+":"+i.name+":"+o),d||(d=o+"\n"+i.name))}})),f.length)return e.each(f,(function(e,n){var i=t.file(n);i.url="",t.request({data:{cmd:"url",target:n},notify:{type:"url",cnt:1},preventDefault:!0}).always((function(e){i.url=e.url?e.url:"1"}))})),!1;if(!l)return!1;i.setDragImage&&(r=e('<div class="elfinder-drag-helper html5-native"></div>').append(p(t.file(h[0]))).appendTo(e(document.body)),(o=h.length)>1&&r.append(p(t.file(h[o-1]))+'<span class="elfinder-drag-num">'+o+"</span>"),i.setDragImage(r.get(0),50,47)),i.effectAllowed="copyLink",i.setData("DownloadURL",c),i.setData("text/x-moz-url",d),i.setData("text/uri-list",l),i.setData("text/plain",l),i.setData("text/html",a.html()),i.setData("elfinderfrom",window.location.href+t.cwd().hash),i.setData("elfinderfrom:"+i.getData("elfinderfrom"),"")}})).on("dragend",(function(e){Z({notrigger:!0}),r&&r.remove()})).draggable(t.draggable)}}})).on(u,b,(function(n){var i=e(this),o=t.cwdId2Hash(i.attr("id"));G||i.hasClass(x)||(ee="#"+this.id,i.addClass(y).children().addClass(k).find("input:checkbox."+E).prop("checked",!0),X[o]||(X[o]=!0),K=De.find("[id].ui-selected:last").next())})).on(p,b,(function(n){var i=e(this),o=t.cwdId2Hash(i.attr("id"));G||(i.removeClass(y).children().removeClass(k).find("input:checkbox."+E).prop("checked",!1),De.hasClass("elfinder-cwd-allselected")&&(F&&Me.children("input").prop("checked",!1),De.removeClass("elfinder-cwd-allselected")),X[o]&&delete X[o])})).on(f,b,(function(){var t=e(this).removeClass(k+" "+y).addClass(x),n=t.children(),i=h?t:n.find("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");n.removeClass(k+" "+y),t.hasClass(_)&&t.droppable("disable"),i.hasClass(w)&&i.draggable("disable")})).on(m,b,(function(){var t=e(this).removeClass(x),n=h?t:t.children("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");t.hasClass(_)&&t.droppable("enable"),n.hasClass(w)&&n.draggable("enable")})).on("scrolltoview",b,(function(t,n){ne(e(this),!n||void 0===n.blink||n.blink)})).on("mouseenter."+t.namespace+" mouseleave."+t.namespace,b,(function(n){"mouseenter"
162===n.type&&(ae||t.UA.Mobile)||(t.trigger("hover",{hash:t.cwdId2Hash(e(this).attr("id")),type:n.type}),e(this).toggleClass(k,"mouseenter"==n.type))})).on("mouseenter."+t.namespace+" mouseleave."+t.namespace,".elfinder-cwd-file-wrapper,.elfinder-cwd-filename",(function(t){"mouseenter"===t.type&&ae||e(this).closest(b).children(".elfinder-cwd-file-wrapper,.elfinder-cwd-filename").toggleClass(C,"mouseenter"==t.type)})).on("contextmenu."+t.namespace,(function(n){var i=e(n.target).closest(b);(i.get(0)!==n.target||X[t.cwdId2Hash(i.get(0).id)])&&(i.find("input:text,textarea").length?n.stopPropagation():i.length&&("TD"!=n.target.nodeName||X[t.cwdId2Hash(i.get(0).id)])&&(n.stopPropagation(),n.preventDefault(),i.hasClass(x)||Ie.data("touching")||(i.hasClass(y)||(Z({notrigger:!0}),i.trigger(u),te()),t.trigger("contextmenu",{type:"files",targets:t.selected(),x:n.pageX,y:n.pageY}))))})).on("click."+t.namespace,(function(e){e.target!==this||De.data("longtap")||!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&Z()})).on("create."+t.namespace,(function(n,i){var o=h?De.find("tbody"):De,r=o.find(".elfinder-cwd-parent"),s=i.move||!1,a=e(V(i)).addClass(T),l=t.selected();l.length?s&&t.trigger("lockfiles",{files:l}):Z(),r.length?r.after(a):o.prepend(a),ve(),Ie.scrollTop(0).scrollLeft(0)})).on("unselectall",Z).on("selectfile",(function(e,n){t.cwdHash2Elm(n).trigger(u),te()})).on("colwidth",(function(){h&&(De.find("table").css("table-layout","").find("td").css("width",""),ge({fitWidth:!0}),t.storage("cwdColWidth",j=null))})).on("iconpref",(function(e,t){De.removeClass((function(e,t){return(t.match(/\belfinder-cwd-size\S+/g)||[]).join(" ")})),a=t&&parseInt(t.size)||0,h||(a>0&&De.addClass("elfinder-cwd-size"+a),oe.renderd&&requestAnimationFrame((function(){Be.icons={},oe.hpi=null,Ce(De,oe.renderd),de()})))})).on("onwheel"in document?"wheel":"mousewheel",(function(e){var i,o;!h&&(e.ctrlKey&&!e.metaKey||!e.ctrlKey&&e.metaKey)&&(e.stopPropagation(),e.preventDefault(),void 0!==(i=De.data("wheelTm"))?(clearTimeout(i),De.data("wheelTm",setTimeout((function(){De.removeData("wheelTm")}),200))):(De.data("wheelTm",!1),o=a||0,(e.originalEvent.deltaY?e.originalEvent.deltaY:-e.originalEvent.wheelDelta)>0?a>0&&(o=a-1):a<n.iconsView.sizeMax&&(o=a+1),o!==a&&(t.storage("iconsize",o),De.trigger("iconpref",{size:o}))))})),Ie=e('<div class="elfinder-cwd-wrapper"></div>').droppable(Object.assign({},be,{autoDisable:!1})).on("contextmenu."+t.namespace,Se).on("touchstart."+t.namespace,Te).on("touchmove."+t.namespace+" touchend."+t.namespace,Ee).on("click."+t.namespace,Ae).on("scroll."+t.namespace,(function(){ae||(De.data("selectable")&&De.selectable("disable"),Ie.trigger("elfscrstart")),ae=!0,oe.scrtm&&cancelAnimationFrame(oe.scrtm),oe.scrtm&&Math.abs((oe.scrolltop||0)-(oe.scrolltop=this.scrollTop||e(this).scrollTop()))<5&&(oe.scrtm=0,Ie.trigger(se)),oe.scrtm=requestAnimationFrame((function(){oe.scrtm=0,Ie.trigger(se)}))})).on(se,(function(){ae=!1,de()})),Pe=e("<div>&nbsp;</div>").css({position:"absolute",width:"1px",height:"1px"}).hide(),Me=F?e('<div class="elfinder-cwd-selectall"><input type="checkbox"/></div>').attr("title",t.i18n("selectall")).on("click",(function(t){if(t.stopPropagation(),t.preventDefault(),e(this).data("pending"))return!1;Me.data("pending",!0),De.hasClass("elfinder-cwd-allselected")?(Me.find("input").prop("checked",!1),requestAnimationFrame((function(){Z()}))):J()})):e(),Re=null,ze=function(t){var n=function(){if(void 0!==oe.renderd){var t=0;Ie.siblings("div.elfinder-panel:visible").each((function(){t+=e(this).outerHeight(!0)})),Ie.height(Ne.height()-t-Ie._padding)}};t&&n(),Re&&cancelAnimationFrame(Re),Re=requestAnimationFrame((function(){var e;!t&&n(),De.css("height","auto"),e=Ie[0].clientHeight-parseInt(Ie.css("padding-top"))-parseInt(Ie.css("padding-bottom"))-parseInt(De.css("margin-top")),De.outerHeight(!0)<e&&De.height(e)})),h&&!L&&(t?Ie.trigger("resize.fixheader"):ge()),de()},Ne=e(this).parent().on("resize",ze).children(".elfinder-workzone").append(Ie.append(this).append(Pe)),Fe=e('<div class="elfinder-cwd-message-board"></div>').insertAfter(De),Le=e('<div class="elfinder-cwd-expires" ></div>'),je=function(){var e,n,i;r&&clearTimeout(r),l&&t.volumeExpires[l]&&(i=(n=t.volumeExpires[l]-+new Date/1e3)%60+.1,e=Math.floor(n/60),Le.html(t.i18n(["minsLeft",e])).show(),e&&(r=setTimeout(je,1e3*i)))},Be={icons:{},list:{}};t.UA.ltIE10||Fe.append(e('<div class="elfinder-cwd-trash" ></div>').html(t.i18n("volume_Trash"))).append(Le),q=Object.assign(q,n.replacement||{});try{j=t.storage("cwdColWidth")?t.storage("cwdColWidth"):null}catch(e){j=null}t.bind("columnpref",(function(i){var o=i.data||{};(R=t.storage("cwdCols"))?(R=e.grep(R,(function(e){return-1!==n.listView.columns.indexOf(e)})),n.listView.columns.length>R.length&&e.each(n.listView.columns,(function(e,t){-1===R.indexOf(t)&&R.push(t)}))):R=n.listView.columns;var r=t.storage("columnhides")||null;r&&Object.keys(r).length&&(R=e.grep(R,(function(e){return!r[e]}))),B.row=N(),h&&o.repaint&&Oe()})).trigger("columnpref"),d&&e("body").on("touchstart touchmove touchend",(function(e){})),F&&De.addClass("elfinder-has-checkbox"),e(window).on("scroll."+t.namespace,(function(){c&&cancelAnimationFrame(c),c=requestAnimationFrame((function(){Ie.trigger(se)}))})),e(document).on("keydown."+t.namespace,(function(n){n.keyCode==e.ui.keyCode.ESCAPE&&(t.getUI().find(".ui-widget:visible").length||Z())})),t.one("init",(function(){var i,o,r,a,l=document.createElement("style"),c=0;document.head&&(document.head.appendChild(l),(i=l.sheet).insertRule('.elfinder-cwd-wrapper-empty .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder")+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty .native-droppable .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder"+(d?"LTap":"Drop"))+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty .ui-droppable-disabled .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder")+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptySearch")+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-incsearch-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyIncSearch")+'" }',c++),i.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-letsearch-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyLetSearch")+'" }',c++)),(a=t.storage("iconsize")||n.iconsView.size||0)&&(a=Math.min(a,n.iconsView.sizeMax),De.trigger("iconpref",{size:a})),d||(t.one("open",(function(){i&&t.zIndex&&i.insertRule(".ui-selectable-helper{z-index:"+t.zIndex+";}",c++)})),r=e('<div style="position:absolute"></div>'),(o=t.getUI()).on("resize",(function(e,t){var n;e.preventDefault(),e.stopPropagation(),t&&t.fullscreen&&(n=o.offset(),"on"===t.fullscreen?(r.css({top:-1*n.top,left
162:-1*n.left}).appendTo(o),le.appendTo=r):(r.detach(),le.appendTo="body"),De.data("selectable")&&De.selectable("option",{appendTo:le.appendTo}))}))),s=t.getUI("tree").length})).bind("enable",(function(){ze()})).bind("request.open",(function(){oe.getTmbs=[]})).one("open",(function(){t.maxTargets&&(A=Math.min(t.maxTargets,A))})).bind("open add remove searchend",(function(){var n,i=t.cwd().hash,o=this.type;if(("open"===o||"searchend"===o||t.searchStatus.state<2)&&(P=e.map(t.files(i),(function(e){return e.hash})),t.trigger("cwdhasheschange",P)),"open"===o){var r=i&&(!t.file(i)||s)?s?(n=e.Deferred(),t.one("treesync",(function(e){e.data.always((function(){n.resolve()}))})),n):t.request({data:{cmd:"parents",target:t.cwd().hash},preventFail:!0}):null,a=t.cwd();a.volumeid!==l&&(Le.empty().hide(),l&&Ie.removeClass("elfinder-cwd-wrapper-"+l),l=a.volumeid,je(),Ie.addClass("elfinder-cwd-wrapper-"+l)),e.when(r).done((function(){var n;I=t.parents(a.hash),Ie[(n=!1,e.each(I,(function(e,i){if(t.trashes[i])return n=!0,!1})),n?"addClass":"removeClass")]("elfinder-cwd-wrapper-trash")})),M=void 0,Z({notrigger:!0}),Oe()}})).bind("search",(function(n){P=e.map(n.data.files,(function(e){return e.hash})),t.trigger("cwdhasheschange",P),M=void 0,t.searchStatus.ininc=!1,Oe(),t.autoSync("stop")})).bind("searchend",(function(e){(O||M)&&(O="",M?t.trigger("incsearchend",e.data):e.data&&e.data.noupdate||Oe()),t.autoSync()})).bind("searchstart",(function(e){Z(),O=e.data.query})).bind("incsearchstart",(function(n){var i=n.data.query||"",o=n.data.type||"SearchName",r=t.options.commandsOptions.search.searchTypes||{};
162(r[o]&&r[o].incsearch||"SearchName"===o)&&(X={},t.lazy((function(){var n,s,a="";if(O=i,i){if("/"===i.substr(0,1)&&(i=i.substr(1),a="^"),n=new RegExp(a+i.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"),"SearchName"===o)M=e.grep(P,(function(e){var i=t.file(e);return!(!i||!(i.name.match(n)||i.i18&&i.i18.match(n)))}));else if("string"==typeof(s=r[o].incsearch))M=e.grep(P,(function(e){var i=t.file(e);return!!(i&&i[s]&&(i[s]+"").match(n))}));else if("function"==typeof s)try{M=e.grep(s({val:i,regex:n},P,t),(function(e){return!!t.file(e)}))}catch(e){M=[]}t.trigger("incsearch",{hashes:M,query:i}).searchStatus.ininc=!0,Oe(),t.autoSync("stop")}else t.trigger("incsearchend")})))})).bind("incsearchend",(function(e){O="",t.searchStatus.ininc=!1,M=void 0,e.data&&e.data.noupdate||Oe(),t.autoSync()})).bind("sortchange",(function(){var e=Ie.scrollLeft(),n=De.hasClass("elfinder-cwd-allselected");Oe(),t.one("cwdrender",(function(){Ie.scrollLeft(e),n&&(X=t.arrayFlip(M||P,!0)),(n||Object.keys(X).length)&&te()}))})).bind("viewchange",(function(){var e="list"!=t.viewType,n=De.hasClass("elfinder-cwd-allselected");e!=h&&(h=e,t.viewType=h?"list":"icons",a&&t.one("cwdinit",(function(){De.trigger("iconpref",{size:a})})),Oe(),ze(),n&&(De.addClass("elfinder-cwd-allselected"),Me.find("input").prop("checked",!0)),Object.keys(X).length&&te())})).bind("wzresize",(function(){var e,n=h?De.find("tbody"):De;ze(!0),oe.hpi&&Ce(n,n.find("[id]").length),e=De.offset(),Ne.data("rectangle",Object.assign({width:Ne.width(),height:Ne.height(),cwdEdge:"ltr"===t.direction?e.left:e.left+De.width()},Ne.offset())),oe.itemH=(h?n.find("tr:first"):n.find("[id]:first")).outerHeight(!0)})).bind("changeclipboard",(function(t){D={},t.data&&t.data.clipboard&&t.data.clipboard.length&&e.each(t.data.clipboard,(function(e,t){t.cut&&(D[t.hash]=!0)}))})).bind("resMixinMake",(function(){ve()})).bind("tmbreload",(function(t){var n={},i=t.data&&t.data.files?t.data.files:null;e.each(i,(function(e,t){t.tmb&&"1"!=t.tmb&&(n[t.hash]=t.tmb)})),Object.keys(n).length&&xe(n,!0)})).add((function(n){var i=O?new RegExp(O.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"):null,o=t.searchStatus.mime,r=t.searchStatus.state>1,s=r&&t.searchStatus.target?t.searchStatus.target:t.cwd().hash,a=t.path(s),l=e.grep(n.data.added||[],(function(n){return!!function(n){var l,c;return!(l=n.phash===s)&&r&&(c=n.path||t.path(n.hash),!(l=a&&0===c.indexOf(a))&&t.searchStatus.mixed&&(l=!!e.grep(t.searchStatus.mixed,(function(e){return 0===n.hash.indexOf(e)})).length)),l&&r&&(l=o?0===n.mime.indexOf(o):!!(n.name.match(i)||n.i18&&n.i18.match(i))),l}(n)}));_e(l),2===t.searchStatus.state&&(e.each(l,(function(t,n){-1===e.inArray(n.hash,P)&&P.push(n.hash)})),t.trigger("cwdhasheschange",P)),h&&ze(),Ie.trigger(se)})).change((function(n){var i,o=t.cwd().hash,r=t.selected();O?e.each(n.data.changed||[],(function(n,o){t.cwdHash2Elm(o.hash).length&&(ke([o.hash]),_e([o]),-1!==e.inArray(o.hash,r)&&Y(o.hash),i=!0)})):e.each(e.grep(n.data.changed||[],(function(e){return e.phash==o})),(function(n,o){t.cwdHash2Elm(o.hash).length&&(ke([o.hash]),_e([o]),-1!==e.inArray(o.hash,r)&&Y(o.hash),i=!0)})),i&&(t.trigger("cwdhasheschange",P),h&&ze(),Ie.trigger(se)),te()})).remove((function(e){var t=h?De.find("tbody"):De;ke(e.data.removed||[]),te(),ie.length<1&&t.children(b+(n.oldSchool?":not(.elfinder-cwd-parent)":"")).length<1?(Ne.addClass("elfinder-cwd-wrapper-empty"),F&&Me.find("input").prop("checked",!1),Pe.hide(),Ie.off(se,pe),ze()):(Ce(t),Ie.trigger(se))})).dragstart((function(t){var n=e(t.data.target),i=t.data.originalEvent;n.hasClass(v)&&(n.hasClass(y)||(!(i.ctrlKey||i.metaKey||i.shiftKey)&&Z({notrigger:!0}),n.trigger(u),te())),De.removeClass(x).data("selectable")&&De.selectable("disable"),G=!0})).dragstop((function(){De.data("selectable")&&De.selectable("enable"),G=!1})).bind("lockfiles unlockfiles selectfiles unselectfiles",(function(n){var i,o,r,s={lockfiles:f,unlockfiles:m,selectfiles:u,unselectfiles:p}[n.type],a=n.data.files||[],l=a.length,c=n.data.helper||e();if(l>0&&(i=t.parents(a[0])),s!==u&&s!==p||(r=s===u,e.each(a,(function(e,t){var n=De.hasClass("elfinder-cwd-allselected");X[t]?(n&&(F&&Me.children("input").prop("checked",!1),De.removeClass("elfinder-cwd-allselected"),n=!1),!r&&delete X[t]):r&&(X[t]=!0)}))),!c.data("locked")){for(;l--;)try{t.cwdHash2Elm(a[l]).trigger(s)}catch(n){}!n.data.inselect&&te()}Ie.data("dropover")&&-1!==i.indexOf(Ie.data("dropover"))&&(o="lockfiles"!==n.type,c.toggleClass("elfinder-drag-helper-plus",o),Ie.toggleClass(S,o))})).bind("mkdir mkfile duplicate upload rename archive extract paste multiupload",(function(n){if("upload"!=n.type||!n.data._multiupload){var i=t.cwd().hash;Z({notrigger:!0}),e.each((n.data.added||[]).concat(n.data.changed||[]),(function(e,t){t&&t.phash==i&&Y(t.hash)})),te()}})).shortcut({pattern:"ctrl+a",description:"selectall",callback:J}).shortcut({pattern:"ctrl+shift+i",description:"selectinvert",callback:function(){var n={};Q?Z():Object.keys(X).length?(e.each(M||P,(function(e,i){var o=t.cwdHash2Elm(i);X[i]?o.length&&o.trigger(p):(n[i]=!0,o.length&&o.trigger(u))})),X=n,te()):J()}}).shortcut({pattern:"left right up down shift+left shift+right shift+up shift+down",description:"selectfiles",type:"keydown",callback:function(t){!function(t,n){var i,o,r,s,a,l=e.ui.keyCode,c=t==l.LEFT||t==l.UP,d=De.find("[id].ui-selected");function f(e,t){return e[t+"All"]("[id]:not(."+x+"):not(.elfinder-cwd-parent):first")}if(d.length)if((r=f(i=d.filter(c?":first":":last"),c?"prev":"next")).length)if(h||t==l.LEFT||t==l.RIGHT)o=r;else if(s=i.position().top,a=i.position().left,o=i,c){do{o=o.prev("[id]")}while(o.length&&!(o.position().top<s&&o.position().left<=a));o.hasClass(x)&&(o=f(o,"next"))}else{do{o=o.next("[id]")}while(o.length&&!(o.position().top>s&&o.position().left>=a));o.hasClass(x)&&(o=f(o,"prev")),o.length||(r=De.find("[id]:not(."+x+"):last")).position().top>s&&(o=r)}else o=i;else o=K.length?c?K.prev():K:De.find("[id]:not(."+x+"):not(.elfinder-cwd-parent):"+(c?"last":"first"));o&&o.length&&!o.hasClass("elfinder-cwd-parent")&&(i&&n?o=i.add(i[c?"prevUntil":"nextUntil"]("#"+o.attr("id"))).add(o):d.trigger(p),o.trigger(u),ne(o.filter(c?":first":":last")),te())}(t.keyCode,t.shiftKey)}}).shortcut({pattern:"home",description:"selectffile",callback:function(e){Z({notrigger:!0}),ne(De.find("[id]:first").trigger(u)),te()}}).shortcut({pattern:"end",description:"selectlfile",callback:function(e){Z({notrigger:!0}),ne(De.find("[id]:last").trigger(u)),te()}}).shortcut({pattern:"page_up",description:"pageTurning",callback:function(e){oe.itemH&&Ie.scrollTop(Math.round(Ie.scrollTop()-Math.floor((Ie.height()+(h?-1*oe.itemH:16))/oe.itemH)*oe.itemH))}}
162).shortcut({pattern:"page_down",description:"pageTurning",callback:function(e){oe.itemH&&Ie.scrollTop(Math.round(Ie.scrollTop()+Math.floor((Ie.height()+(h?-1*oe.itemH:16))/oe.itemH)*oe.itemH))}})})),this},e.fn.elfinderdialog=function(t,n){var i,o,r,s,a,l=-1!=window.navigator.platform.indexOf("Win"),c={},d={enabled:!1,width:!1,height:!1,defaultSize:null},h=function(t){var i,o;d.enabled&&(o=n.options.dialogContained?s:e(window),i={maxWidth:d.width?o.width()-c.width:null,maxHeight:d.height?o.height()-c.height:null},Object.assign(a,i),t.css(i).trigger("resize"),t.data("hasResizable")&&(t.resizable("option","maxWidth")<i.maxWidth||t.resizable("option","maxHeight")<i.maxHeight)&&t.resizable("option",i))},u=function(e){var t=e.data;o&&cancelAnimationFrame(o),o=requestAnimationFrame((function(){d.enabled&&h(t)}))},p=function(){var e=s.children(".elfinder-dialog."+n.res("class","editing")+":visible");n[e.length?"disable":"enable"]()};return n&&n.ui?s=n.getUI():(s=this.closest(".elfinder"),n||(n=s.elfinder("instance"))),"string"==typeof t?((r=this.closest(".ui-dialog")).length&&("open"===t?"none"===r.css("display")&&(r.trigger("posinit").show().trigger("open").hide(),r.fadeIn(120,(function(){n.trigger("dialogopened",{dialog:r})}))):"close"===t||"destroy"===t?(r.stop(!0),(r.is(":visible")||s.is(":hidden"))&&(r.trigger("close"),n.trigger("dialogclosed",{dialog:r})),"destroy"===t?(r.remove(),n.trigger("dialogremoved",{dialog:r})):r.data("minimized")&&r.data("minimized").close()):"toTop"===t?(r.trigger("totop"),n.trigger("dialogtotoped",{dialog:r})):"posInit"===t?(r.trigger("posinit"),n.trigger("dialogposinited",{dialog:r})):"tabstopsInit"===t?(r.trigger("tabstopsInit"),n.trigger("dialogtabstopsinited",{dialog:r})):"checkEditing"===t&&p()),this):((t=Object.assign({},e.fn.elfinderdialog.defaults,t)).allowMinimize&&"auto"===t.allowMinimize&&(t.allowMinimize=!!this.find("textarea,input").length),t.openMaximized=t.allowMinimize&&t.openMaximized,t.headerBtnPos&&"auto"===t.headerBtnPos&&(t.headerBtnPos=l?"right":"left"),t.headerBtnOrder&&"auto"===t.headerBtnOrder&&(t.headerBtnOrder=l?"close:maximize:minimize":"close:minimize:maximize"),t.modal&&t.allowMinimize&&(t.allowMinimize=!1),n.options.dialogContained?d.width=d.height=d.enabled=!0:(d.width="window"===t.maxWidth,d.height="window"===t.maxHeight,(d.width||d.height)&&(d.enabled=!0)),i=n.arrayFlip(t.propagationEvents,!0),this.filter(":not(.ui-dialog-content)").each((function(){var o,r,f=e(this).addClass("ui-dialog-content ui-widget-content"),m="elfinder-dialog-active",g="elfinder-dialog",v="elfinder-dialog-notify",b="ui-state-hover",y="elfinder-tabstop",x="elfinder-focus",w="elfinder-dialog-modal",_=parseInt(1e6*Math.random()),k=e('<div class="ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-clearfix"><span class="elfinder-dialog-title">'+t.title+"</span></div>"),C=e('<div class="ui-dialog-buttonset"></div>'),S=e('<div class=" ui-helper-clearfix ui-dialog-buttonpane ui-widget-content"></div>').append(C),T=0,E=0,A=e(),O=e('<div style="width:100%;height:100%;position:absolute;top:0px;left:0px;"></div>').hide(),D=function(){(A=R.find("."+y)).length&&(A.attr("tabindex","-1"),A.filter("."+x).length||C.children("."+y+":"+(l?"first":"last")).addClass(x))},I=function(t){var n=A.filter(":visible:enabled"),i=t?null:n.filter(".elfinder-focus:first");return i&&i.length||(i=n.first()),t&&e.each(n,(function(e,o){if(o===t&&n[e+1])return i=n.eq(e+1),!1})),i},P=function(t){var n=A.filter(":visible:enabled"),i=n.last();return e.each(n,(function(e,o){if(o===t&&n[e-1])return i=n.eq(e-1),!1})),i},M={close:function(){k.prepend(e('<span class="ui-widget-header ui-dialog-titlebar-close ui-corner-all elfinder-titlebar-button"><span class="ui-icon ui-icon-closethick"></span></span>').on("mousedown touchstart",(function(e){e.preventDefault(),e.stopPropagation(),"function"!=typeof t.headerBtnCloseAction?f.elfinderdialog("close"):t.headerBtnCloseAction(e)})))},maximize:function(){t.allowMaximize&&(R.on("resize",(function(e,t){var n,i;if(e.preventDefault(),e.stopPropagation(),t&&t.maximize){if(i=k.find(".elfinder-titlebar-full"),n="on"===t.maximize,i.children("span.ui-icon").toggleClass("ui-icon-plusthick",!n).toggleClass("ui-icon-arrowreturnthick-1-s",n),n){try{R.hasClass("ui-draggable")&&R.draggable("disable"),R.hasClass("ui-resizable")&&R.resizable("disable")}catch(e){}f.css("width","100%").css("height",R.height()-R.children(".ui-dialog-titlebar").outerHeight(!0)-S.outerHeight(!0))}else{f.attr("style",i.data("style")),i.removeData("style"),z();try{R.hasClass("ui-draggable")&&R.draggable("enable"),R.hasClass("ui-resizable")&&R.resizable("enable")}catch(e){}}R.trigger("resize",{init:!0})}})),k.prepend(e('<span class="ui-widget-header ui-corner-all elfinder-titlebar-button elfinder-titlebar-full"><span class="ui-icon ui-icon-plusthick"></span></span>').on("mousedown touchstart",(function(i){var o=e(this);i.preventDefault(),i.stopPropagation(),R.hasClass("elfinder-maximized")||void 0!==o.data("style")||(f.height(f.height()),o.data("style",f.attr("style")||"")),n.toggleMaximize(R),"function"==typeof t.maximize&&t.maximize.call(f[0])}))))},minimize:function(){var i,o,r;t.allowMinimize&&(i=e('<span class="ui-widget-header ui-corner-all elfinder-titlebar-button elfinder-titlebar-minimize"><span class="ui-icon ui-icon-minusthick"></span></span>').on("mousedown touchstart",(function(i){var s=e(this),a=n.getUI("bottomtray"),l={width:70,height:24},c=e("<div></div>").css(l).addClass(R.get(0).className+" elfinder-dialog-minimized"),d=function(){o.remove(),R.removeData("minimized").show(),f.elfinderdialog("close")},h={};i.preventDefault(),i.stopPropagation(),R.data("minimized")?(R.removeData("minimized").before(o.css(Object.assign({position:"absolute"},o.offset()))),n.toFront(o),o.animate(Object.assign({width:R.width(),height:R.height()},r),(function(){R.show(),n.toFront(R),o.remove(),z(),p(),R.trigger("resize",{init:!0}),"function"==typeof t.minimize&&t.minimize.call(f[0])}))):(r=R.data("minimized",{dialog:function(){return o},show:function(){o.show()},hide:function(){o.hide()},close:d,title:function(e){o.children(".ui-dialog-titlebar").children(".elfinder-dialog-title").text(e)}}).position(),o=R.clone().on("mousedown",(function(){s.trigger("mousedown")})).removeClass("ui-draggable ui-resizable elfinder-frontmost elfinder-maximized"),a.append(c),Object.assign(h,c.offset(),l),c.remove(),o.height(R.height()).children(".ui-dialog-content:first").empty(),n.toHide(R.before(o)),o.children(".ui-dialog-content:first,.ui-dialog-buttonpane,.ui-resizable-handle").remove(),o.find(".elfinder-titlebar-minimize,.elfinder-titlebar-full").remove(),o.find(".ui-dialog-titlebar-close").on("mousedown",(function(e){e.stopPropagation(),e.preventDefault(),d()})),o.animate(h,(function(){o.attr("style","").css({maxWidth:R.width()}).addClass("elfinder-dialog-minimized").appendTo(a),p(),"function"==typeof t.minimize&&t.minimize.call(f[0])})))})),k.on("dblclick",(function(t){e(this).children(".elfinder-titlebar-minimize").trigger("mousedown")})).prepend(i),R.on("togleminimize",(function(){i.trigger("mousedown")})))}},R=e('<div class="ui-front ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable std42-dialog touch-punch '+g+" "+t.cssClass+'"></div>').hide().append(f).appendTo(s).draggable({containment:n.options.dialogContained?s:null,handle:".ui-dialog-titlebar",start:function(){O.show()},drag:function(e,t){var i=t.offset.top,o=t.offset.left;
162i<0&&(t.position.top=t.position.top-i),o<0&&(t.position.left=t.position.left-o),n.options.dialogContained&&(t.position.top<0&&(t.position.top=0),t.position.left<0&&(t.position.left=0))},stop:function(e,n){O.hide(),R.css({height:t.height}),f.data("draged",!0)}}).css({width:t.width,height:t.height,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}).on("touchstart touchmove touchend click dblclick mouseup mouseenter mouseleave mouseout mouseover mousemove",(function(e){!i[e.type]&&e.stopPropagation()})).on("mousedown",(function(t){!i[t.type]&&t.stopPropagation(),requestAnimationFrame((function(){R.is(":visible")&&!R.hasClass("elfinder-frontmost")&&((r=e(":focus")).length||(r=void 0),R.trigger("totop"))}))})).on("open",(function(){R.data("margin-y",f.outerHeight(!0)-f.height()),d.enabled&&(t.height&&"auto"!==t.height&&R.trigger("resize",{init:!0}),d.defaultSize||(d.defaultSize={width:f.width(),height:f.height()}),h(R),R.trigger("resize").trigger("posinit"),s.on("resize."+n.namespace,R,u)),R.hasClass(v)||s.children("."+g+":visible:not(."+v+")").each((function(){var t=e(this),n=parseInt(t.css("top")),i=parseInt(t.css("left")),o=parseInt(R.css("top")),r=parseInt(R.css("left")),s=Math.abs(n-o)<10,a=Math.abs(i-r)<10;t[0]!=R[0]&&(s||a)&&R.css({top:s?n+10:o,left:a?i+10:r})})),R.data("modal")&&(R.addClass(w),n.getUI("overlay").elfinderoverlay("show")),R.trigger("totop"),t.openMaximized&&n.toggleMaximize(R),n.trigger("dialogopen",{dialog:R}),"function"==typeof t.open&&t.open.bind(f[0])(),t.closeOnEscape&&e(document).on("keydown."+_,(function(t){t.keyCode==e.ui.keyCode.ESCAPE&&R.hasClass("elfinder-frontmost")&&f.elfinderdialog("close")})),R.hasClass(n.res("class","editing"))&&p()})).on("close",(function(i){var o;t.beforeclose&&"function"==typeof t.beforeclose?(o=t.beforeclose())&&o.promise||(o=o?e.Deferred().resolve():e.Deferred().reject()):o=e.Deferred().resolve(),o.done((function(){d.enabled&&s.off("resize."+n.namespace,u),t.closeOnEscape&&e(document).off("keyup."+_),t.allowMaximize&&n.toggleMaximize(R,!1),n.toHide(R),R.data("modal")&&n.getUI("overlay").elfinderoverlay("hide"),"function"==typeof t.close&&t.close.bind(f[0])(),t.destroyOnClose&&R.parent().length&&R.hide().remove(),s.children("."+g+":visible"),R.hasClass(n.res("class","editing"))&&p()}))})).on("totop frontmost",(function(){var e=n.storage("autoFocusDialog");R.data("focusOnMouseOver",e?e>0:n.options.uiOptions.dialog.focusOnMouseOver),R.data("minimized")&&k.children(".elfinder-titlebar-minimize").trigger("mousedown"),!R.data("modal")&&n.getUI("overlay").is(":visible")?n.getUI("overlay").before(R):n.toFront(R),s.children("."+g+":not(."+w+")").removeClass(m),R.addClass(m),!n.UA.Mobile&&(r||I()).trigger("focus"),r=void 0})).on("posinit",(function(){var i,o,r,l,c,d,h,u=t.position;if(!R.hasClass("elfinder-maximized")){if(!u&&!R.data("resizing")){if(h=s.hasClass("elfinder-fullscreen")||n.options.enableAlways,R.css(h?{maxWidth:"100%",maxHeight:"100%",overflow:"auto"}:a),n.UA.Mobile&&!h&&R.data("rotated")===n.UA.Rotated)return;R.data("rotated",n.UA.Rotated),c=e(window),i=s.offset(),(l={width:R.outerWidth(!0),height:R.outerHeight(!0)}).right=i.left+l.width,l.bottom=i.top+l.height,(d={scrLeft:c.scrollLeft(),scrTop:c.scrollTop(),width:c.width(),height:c.height()}).right=d.scrLeft+d.width,d.bottom=d.scrTop+d.height,n.options.dialogContained||h?(o=0,r=0):(o=-1*i.top+d.scrTop,r=-1*i.left+d.scrLeft),u={top:l.height>
162=d.height?o:Math.max(o,parseInt((s.height()-l.height)/2-42)),left:l.width>=d.width?r:Math.max(r,parseInt((s.width()-l.width)/2))},l.right+u.left>d.right&&(u.left=Math.max(r,d.right-l.right)),l.bottom+u.top>d.bottom&&(u.top=Math.max(o,d.bottom-l.bottom))}t.absolute&&(u.position="absolute"),u&&R.css(u)}})).on("resize",(function(n,i){var o,r,s,a,l=0,c=i&&i.init;i&&(i.minimize||i.maxmize)||R.data("minimized")||(n.stopPropagation(),n.preventDefault(),R.children(".ui-widget-header,.ui-dialog-buttonpane").each((function(){l+=e(this).outerHeight(!0)})),(a="auto"===t.height)&&f.css({"max-height":"",height:"auto"}),c||!d.enabled||n.originalEvent||R.hasClass("elfinder-maximized")?o=R.height()-l-R.data("margin-y"):(o=R.height(),r=R.css("min-height")||o,s=R.css("max-height")||o,r=r.match(/%/)?Math.floor(parseInt(r)/100*R.parent().height()):parseInt(r),s=s.match(/%/)?Math.floor(parseInt(s)/100*R.parent().height()):parseInt(s),o=Math.min(a?R.height():d.defaultSize.height,Math.max(s,r)-l-R.data("margin-y"))),f.css(a?"max-height":"height",o),c||(z(),r=o<(r=f.height())?r+l+R.data("margin-y"):t.minHeight,R.css("min-height",r),R.data("hasResizable")&&R.resizable("option",{minHeight:r}),"function"==typeof t.resize&&t.resize.bind(f[0])(n,i)))})).on("tabstopsInit",D).on("focus","."+y,(function(){e(this).addClass(b).parent("label").addClass(b),this.id&&e(this).parent().find("label[for="+this.id+"]").addClass(b)})).on("click","select."+y,(function(){var t=e(this);t.data("keepFocus")?t.removeData("keepFocus"):t.data("keepFocus",!0)})).on("blur","."+y,(function(){e(this).removeClass(b).removeData("keepFocus").parent("label").removeClass(b),this.id&&e(this).parent().find("label[for="+this.id+"]").removeClass(b)})).on("mouseenter mouseleave","."+y+",label",(function(n){var i,o=e(this);("LABEL"!==this.nodeName||o.children("."+y).length||(i=o.attr("for"))&&e("#"+i).hasClass(y))&&(t.btnHoverFocus&&R.data("focusOnMouseOver")?"mouseenter"!==n.type||e(":focus").data("keepFocus")||o.trigger("focus"):o.toggleClass(b,"mouseenter"==n.type))})).on("keydown","."+y,(function(t){var n,i,o=e(this);if(o.is(":focus")){if(n=t.keyCode===e.ui.keyCode.ESCAPE,t.keyCode===e.ui.keyCode.ENTER?(t.preventDefault(),o.trigger("click")):t.keyCode===e.ui.keyCode.TAB&&t.shiftKey||t.keyCode===e.ui.keyCode.LEFT||t.keyCode==e.ui.keyCode.UP?i="prev":t.keyCode!==e.ui.keyCode.TAB&&t.keyCode!=e.ui.keyCode.RIGHT&&t.keyCode!=e.ui.keyCode.DOWN||(i="next"),i&&(o.is("textarea")&&!t.ctrlKey&&!t.metaKey||o.is("select,span.ui-slider-handle")&&t.keyCode!==e.ui.keyCode.TAB||o.is("input:not(:checkbox,:radio)")&&!t.ctrlKey&&!t.metaKey&&t.keyCode===e.ui.keyCode["prev"===i?"LEFT":"RIGHT"]))return void t.stopPropagation();n?o.is("input:not(:checkbox,:radio),textarea")&&""!==o.val()&&(o.val(""),t.stopPropagation()):t.stopPropagation(),i&&(t.preventDefault(),("prev"===i?P:I)(this).trigger("focus"))}})).data({modal:t.modal}),z=function(){var e,t=n.getUI();t.hasClass("elfinder-fullscreen")&&(e=R.position(),R.css("top",Math.max(Math.min(Math.max(e.top,0),t.height()-100),0)),R.css("left",Math.max(Math.min(Math.max(e.left,0),t.width()-200),0)))};R.prepend(k),e.each(t.headerBtnOrder.split(":").reverse(),(function(e,t){M[t]&&M[t]()})),l&&k.children(".elfinder-titlebar-button").addClass("elfinder-titlebar-button-right"),e.each(t.buttons,(function(t,n){var i=e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only elfinder-btncnt-'+E+++" "+y+'"><span class="ui-button-text">'+t+"</span></button>").on("click",n.bind(f[0]));n._cssClass&&i.addClass(n._cssClass),l?C.append(i):C.prepend(i)})),C.children().length&&(R.append(S),R.show(),S.find("button").each((function(t,n){T+=e(n).outerWidth(!0)})),R.hide(),T+=20,R.width()<T&&R.width(T)),R.append(O),d.enabled&&(c.width=R.outerWidth(!0)-R.width()+(R.outerWidth()-R.width())/2,c.height=R.outerHeight(!0)-R.height()+(R.outerHeight()-R.height())/2),n.options.dialogContained&&(o={maxWidth:s.width()-c.width,maxHeight:s.height()-c.height},t.maxWidth=t.maxWidth?Math.min(o.maxWidth,t.maxWidth):o.maxWidth,t.maxHeight=t.maxHeight?Math.min(o.maxHeight,t.maxHeight):o.maxHeight,R.css(o)),a={maxWidth:R.css("max-width"),maxHeight:R.css("max-height"),overflow:R.css("overflow")},t.resizable&&R.resizable({minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,start:function(){O.show(),!0!==R.data("resizing")&&R.data("resizing")&&clearTimeout(R.data("resizing")),R.data("resizing",!0)},stop:function(e,t){O.hide(),R.data("resizing",setTimeout((function(){R.data("resizing",!1)}),200)),d.enabled&&(d.defaultSize={width:f.width(),height:f.height()})}}).data("hasResizable",!0),t.optimizeNumber&&R.find("input[type=number]").each((function(){e(this).attr("inputmode","numeric"),e(this).attr("pattern","[0-9]*")})),D(),"function"==typeof t.create&&t.create.bind(this)(),t.autoOpen&&(t.open?requestAnimationFrame((function(){f.elfinderdialog("open")})):f.elfinderdialog("open")),t.resize&&n.bind("themechange",(function(){setTimeout((function(){R.data("margin-y",f.outerHeight(!0)-f.height()),R.trigger("resize",{init:!0})}),300)}))})),this)},e.fn.elfinderdialog.defaults={cssClass:"",title:"",modal:!1,resizable:!0,autoOpen:!0,closeOnEscape:!0,destroyOnClose:!1,buttons:{},btnHoverFocus:!0,position:null,absolute:!1,width:320,height:"auto",minWidth:200,minHeight:70,maxWidth:null,maxHeight:null,allowMinimize:"auto",allowMaximize:!1,openMaximized:!1,headerBtnPos:"auto",headerBtnOrder:"auto",headerBtnCloseAction:null,optimizeNumber:!0,propagationEvents:["mousemove","mouseup"]},e.fn.elfinderfullscreenbutton=function(t){return this.each((function(){var n,i=e(this).elfinderbutton(t).children(".elfinder-button-icon");t.change((function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame((function(){var e=t.value;i.addClass("elfinder-button-icon-fullscreen").toggleClass("elfinder-button-icon-unfullscreen",e),t.className=e?"unfullscreen":""}))}))}))},e.fn.elfindernavbar=function(t,n){return this.not(".elfinder-navbar").each((function(){var i,o,r,s,a,l,c,d=e(this).hide().addClass("ui-state-default elfinder-navbar"),h=d.css("overflow","hidden").parent().children(".elfinder-workzone").append(d),u="ltr"==t.direction,p=function(){var e=t.getUI("cwd"),n=t.getUI("workzone"),i=n.data("rectangle"),o=e.offset();n.data("rectangle",Object.assign(i,{cwdEdge:"ltr"===t.direction?o.left:o.left+e.width()}))},f=function(){d.css("overflow","hidden"),i=Math.round(d.outerHeight()-d.height()),o=Math.round(c.outerWidth()-c.innerWidth()),d.css("overflow","auto")};t.one("init",(function(){c=t.getUI("navdock");var e=function(){f(),t.bind("wzresize",(function(){var e=0;c.width(d.outerWidth()-o),c.children().length>1&&(e=c.outerHeight(!0)),d.height(h.height()-e-i)})).trigger("wzresize")};t.cssloaded?e():t.one("cssloaded",e)})).one("opendone",(function(){r&&r.trigger("resize"),d.css("overflow","auto")})).bind("themechange",f),t.UA.Touch&&(void 0===(a=t.storage("autoHide")||{}).navbar&&(a.navbar=n.autoHideUA&&n.autoHideUA.length>0&&e.grep(n.autoHideUA,(function(e){return!!t.UA[e]})).length,t.storage("autoHide",a)),a.navbar&&t.one("init",(function(){d.children().length&&t.uiAutoHide.pu
162sh((function(){d.stop(!0,!0).trigger("navhide",{duration:"slow",init:!0})}))})),t.bind("load",(function(){d.children().length&&"none"!==(s=e('<div class="elfinder-navbar-swipe-handle"></div>').hide().appendTo(h)).css("pointer-events")&&(s.remove(),s=null)})),d.on("navshow navhide",(function(e,n){var i="navshow"===e.type?"show":"hide",o=n&&n.duration?n.duration:"fast",r=n&&n.handleW?n.handleW:Math.max(50,t.getUI().width()/10);d.stop(!0,!0)[i]({duration:o,step:function(){t.trigger("wzresize")},complete:function(){s&&("show"===i?s.stop(!0,!0).hide():(s.width(r||""),t.resources.blink(s,"slowonce"))),t.trigger("navbar"+i),n.init&&t.trigger("uiautohide"),p()}}),a.navbar="show"!==i,t.storage("autoHide",Object.assign(t.storage("autoHide"),{navbar:a.navbar}))})).on("touchstart",(function(n){e(this)["scroll"+("ltr"===t.direction?"Right":"Left")]()>5&&(n.originalEvent._preventSwipeX=!0)}))),t.UA.Mobile||(r=d.resizable({handles:u?"e":"w",minWidth:n.minWidth||150,maxWidth:n.maxWidth||500,resize:function(){t.trigger("wzresize")},stop:function(e,n){t.storage("navbarWidth",n.size.width),p()}}).on("resize scroll",(function(n){var i=e(this),o=i.data("posinit");n.preventDefault(),n.stopPropagation(),u||"resize"!==n.type||d.css("left",0),o&&cancelAnimationFrame(o),i.data("posinit",requestAnimationFrame((function(){var e=t.UA.Opera&&d.scrollLeft()?20:2;r.css("top",0).css({top:parseInt(d.scrollTop())+"px",left:u?"auto":-1*parseInt(d.scrollRight()-e),right:u?-1*parseInt(d.scrollLeft()-e):"auto"}),"resize"===n.type&&t.getUI("cwd").trigger("resize")})))})).children(".ui-resizable-handle").addClass("ui-front")),(l=t.storage("navbarWidth"))?d.width(l):t.UA.Mobile&&t.one(t.cssloaded?"init":"cssloaded",(function(){var n=function(){l=d.parent().width()/2,d.data("defWidth")>l?d.width(l):d.width(d.data("defWidth")),d.data("width",d.width()),t.trigger("wzresize")};d.data("defWidth",d.width()),e(window).on("resize."+t.namespace,n),n()}))})),this},e.fn.elfindernavdock=function(t,n){return this.not(".elfinder-navdock").each((function(){var i,o,r=e(this).hide().addClass("ui-state-default elfinder-navdock touch-punch"),s=(r.parent().children(".elfinder-workzone").append(r),function(n,i){var o,s=n-(i||r.height()),a=Object.keys(l).length,c=a?s/a:0;s&&(o=r.css("overflow"),r.css("overflow","hidden"),r.height(n),e.each(l,(function(e,n){
162n.height(n.height()+c).trigger("resize."+t.namespace)})),t.trigger("wzresize"),r.css("overflow",o))}),a=e('<div class="ui-front ui-resizable-handle ui-resizable-n"></div>').appendTo(r),l={},c=(parseInt(n.initMaxHeight)||50)/100,d=(parseInt(n.maxHeight)||90)/100;r.data("addNode",(function(e,n){var h,u,p=t.getUI("workzone").height(),f=p*c;return n=Object.assign({first:!1,sizeSync:!0,init:!1},n),e.attr("id")||e.attr("id",t.namespace+"-navdock-"+ +new Date),n.sizeSync&&(l[e.attr("id")]=e),h=r.height()+e.outerHeight(!0),n.first?a.after(e):r.append(e),o=!0,r.resizable("enable").height(h).show(),t.trigger("wzresize"),n.init&&(u=t.storage("navdockHeight"),i=h=u||(h>f?f:h)),s(Math.min(h,p*d)),r})).data("removeNode",(function(n,i){var s=e("#"+n);return delete l[n],r.height(r.height()-e("#"+n).outerHeight(!0)),i?"detach"===i?s=s.detach():i.append(s):s.remove(),r.children().length<=1&&(o=!1,r.resizable("disable").height(0).hide()),t.trigger("wzresize"),s})),n.disabled||t.one("init",(function(){var e;t.getUI("navbar").children().not(".ui-resizable-handle").length&&(r.data("dockEnabled",!0),r.resizable({maxHeight:t.getUI("workzone").height()*d,handles:{n:a},start:function(n,i){e=r.css("overflow"),r.css("overflow","hidden"),t.trigger("navdockresizestart",{event:n,ui:i},!0)},resize:function(e,n){r.css("top",""),t.trigger("wzresize",{inNavdockResize:!0})},stop:function(n,o){t.trigger("navdockresizestop",{event:n,ui:o},!0),r.css("top",""),i=o.size.height,t.storage("navdockHeight",i),s(i,o.originalSize.height),r.css("overflow",e)}}),t.bind("wzresize",(function(e){var n,o;r.is(":visible")&&(n=t.getUI("workzone").height()*d,e.data&&e.data.inNavdockResize||(o=r.height(),n<i?Math.abs(o-n)>1&&s(n):Math.abs(o-i)>1&&s(i)),r.resizable("option","maxHeight",n))})).bind("themechange",(function(){var e=Math.round(r.height());requestAnimationFrame((function(){var t=Math.round(r.height()),n=e-t;0!==n&&s(r.height(),t-n)}))}))),t.bind("navbarshow navbarhide",(function(e){r[o&&"navbarshow"===e.type?"show":"hide"]()}))}))})),this},e.fn.elfinderoverlay=function(t){var n,i,o,r,s=this.parent().elfinder("instance");return this.filter(":not(.elfinder-overlay)").each((function(){t=Object.assign({},t),e(this).addClass("ui-front ui-widget-overlay elfinder-overlay").hide().on("mousedown",(function(e){e.preventDefault(),e.stopPropagation()})).data({cnt:0,show:"function"==typeof t.show?t.show:function(){},hide:"function"==typeof t.hide?t.hide:function(){}})})),"show"==t&&(i=(n=this.eq(0)).data("cnt")+1,o=n.data("show"),s.toFront(n),n.data("cnt",i),n.is(":hidden")&&(n.show(),o())),"hide"==t&&(i=(n=this.eq(0)).data("cnt")-1,r=n.data("hide"),n.data("cnt",i),i<=0&&(n.hide(),r())),this},e.fn.elfinderpanel=function(t){return this.each((function(){var n=e(this).addClass("elfinder-panel ui-state-default ui-corner-all"),i="margin-"+("ltr"==t.direction?"left":"right");t.one("load",(function(e){var o=t.getUI("navbar");n.css(i,parseInt(o.outerWidth(!0))),o.on("resize",(function(e){e.preventDefault(),e.stopPropagation(),n.is(":visible")&&n.css(i,parseInt(o.outerWidth(!0)))}))}))}))},e.fn.elfinderpath=function(t,n){return this.each((function(){var i,o,r="",s="",a=[],l="statusbar",c=t.res("class","hover"),d="path"+(h.prototype.uniqueid?h.prototype.uniqueid:"")+"-",u=e('<div class="ui-widget-header ui-helper-clearfix elfinder-workzone-path"></div>'),p=e(this).addClass("elfinder-path").html("&nbsp;").on("mousedown","span.elfinder-path-dir",(function(n){var i=e(this).attr("id").substr(d.length);n.preventDefault(),i!=t.cwd().hash&&(e(this).addClass(c),r?t.exec("search",r,{target:i,mime:a.join(" ")}):t.trigger("select",{selected:[i]}).exec("open",i))})).prependTo(t.getUI("statusbar").show()),f=e('<div class="elfinder-path-roots"></div>').on("click",(function(n){n.stopPropagation(),n.preventDefault();var i=e.map(t.roots,(function(e){return t.file(e)})),o=[];
162e.each(i,(function(e,n){n.phash||t.root(t.cwd().hash,!0)===n.hash||o.push({label:t.escape(n.i18||n.name),icon:"home",callback:function(){t.exec("open",n.hash)},options:{iconClass:n.csscls||"",iconImg:n.icon||""}})})),t.trigger("contextmenu",{raw:o,x:n.pageX,y:n.pageY})})).append('<span class="elfinder-button-icon elfinder-button-icon-menu" ></span>').appendTo(u),m=function(n){var i=[],o=[];return e.each(t.parents(n),(function(e,r){var s=n===r?"elfinder-path-dir elfinder-path-cwd":"elfinder-path-dir",a=t.file(r),l=t.escape(a.i18||a.name);o.push(l),i.push('<span id="'+d+r+'" class="'+s+'" title="'+o.join(t.option("separator"))+'">'+l+"</span>")})),i.join('<span class="elfinder-path-other">'+t.option("separator")+"</span>")},g=function(){var n;p.children("span.elfinder-path-dir").attr("style",""),n="ltr"===t.direction?e("#"+d+t.cwd().hash).prevAll("span.elfinder-path-dir:first"):e(),p.scrollLeft(n.length?n.position().left:0)},v=function(){if(!t.UA.CSS.flex){var n,i,o=p.children("span.elfinder-path-dir"),r=o.length;"workzone"===l||r<2?o.attr("style",""):(p.width(p.css("max-width")),o.css({maxWidth:100/r+"%",display:"inline-block"}),n=p.width()-9,p.children("span.elfinder-path-other").each((function(){n-=e(this).width()})),i=[],o.each((function(t){var o=e(this).width();n-=o,o<this.scrollWidth&&i.push(t)})),p.width(""),i.length?(n>0&&(n/=i.length,e.each(i,(function(t,i){var r=e(o[i]);r.css("max-width",r.width()+n)}))),o.last().attr("style","")):o.attr("style",""))}};t.one("init",(function(){i=t.getUI("tree").length,o=t.getUI("stat").length,!i&&n.toWorkzoneWithoutNavbar&&(u.append(p).insertBefore(t.getUI("workzone")),l="workzone",t.bind("open",g).one("opendone",(function(){t.getUI().trigger("resize")})))})).bind("open searchend parents",(function(){r="",s="",a=[],p.html(m(t.cwd().hash)),Object.keys(t.roots).length>1?(p.css("margin",""),f.show()):(p.css("margin",0),f.hide()),!o&&v()})).bind("searchstart",(function(e){e.data&&(r=e.data.query||"",s=e.data.target||"",a=e.data.mimes||[])})).bind("search",(function(e){var n="";n=s?m(s):t.i18n("btnAll"),p.html('<span class="elfinder-path-other">'+t.i18n("searcresult")+": </span>"+n),v()})).bind("navbarshow navbarhide",(function(){var e=t.getUI("workzone");"navbarshow"===this.type?(t.unbind("open",g),p.prependTo(t.getUI("statusbar")),u.detach(),l="statusbar"):(u.append(p).insertBefore(e),l="workzone",g(),t.bind("open",g)),t.trigger("uiresize")})).bind("resize uistatchange",v)}))},e.fn.elfinderplaces=function(t,n){return this.each((function(){var i={},o="class",r=t.res(o,"navdir"),s=t.res(o,"navcollapse"),a=t.res(o,"navexpand"),l=t.res(o,"hover"),c=t.res(o,"treeroot"),d=t.res(o,"adroppable"),h=t.res("tpl","placedir"),u=t.res("tpl","perms"),p=e(t.res("tpl","navspinner")),f=n.suffix?n.suffix:"",m="places"+f,g=null,v=function(e){return e.substr(6)},b=function(e){return"place-"+e},y=function(t){return e(document.getElementById(b(t)))},x=function(){var n=[],o={};(n=e.map(O.children().find("[id]"),(function(e){return v(e.id)}))).length?e.each(n.reverse(),(function(e,t){o[t]=i[t]})):o=null,t.storage(m,o)},w=function(){var o,r;m="places"+(n.suffix?n.suffix:""),i={},"string"==typeof(o=t.storage(m))?(o=e.grep(o.split(","),(function(e){return!!e})),e.each(o,(function(e,t){var n=t.split("#");i[n[0]]=n[1]?n[1]:n[0]}))):e.isPlainObject(o)&&(i=o),t.trigger("placesload",{dirs:i,storageKey:m},!0),(r=Object.keys(i)).length&&(A.prepend(p),t.request({data:{cmd:"info",targets:r},preventDefault:!0}).done((function(n){var o={};n.files&&n.files.length&&t.cache(n.files),e.each(n.files,(function(e,t){var n=t.hash;o[n]=t})),e.each(i,(function(e,t){k(o[e]||Object.assign({notfound:!0},t))})),t.storage("placesState")>0&&A.trigger("click")})).always((function(){p.remove()})))},_=function(n,i){return e(h.replace(/\{id\}/,b(n?n.hash:i)).replace(/\{name\}/,t.escape(n?n.i18||n.name:i)).replace(/\{cssclass\}/,n?t.perms2class(n)+(n.notfound?" elfinder-na":"")+(n.csscls?" "+n.csscls:""):"").replace(/\{permissions\}/,!n||n.read&&n.write&&!n.notfound?"":u).replace(/\{title\}/,n?' title="'+t.escape(t.path(n.hash,!0)||n.i18||n.name)+'"':"").replace(/\{symlink\}/,"").replace(/\{style\}/,n&&n.icon?t.getIconStyle(n):""))},k=function(e){var n,o;return"directory"===e.mime&&(o=e.hash,t.files().hasOwnProperty(o)||t.trigger("tree",{tree:[e]}),n=_(e,o),i[o]=e,O.prepend(n),A.addClass(s),T.toggle(O.children().length>1),!0)},C=function(e){var t,n,o=null;return i[e]&&(delete i[e],(t=y(e)).length&&(o=t.text(),t.parent().remove(),n=O.children().length,T.toggle(n>1),n||(A.removeClass(s),D.removeClass(a),O.slideToggle(!1)))),o},S=function(e,t){var n=e.hash,o=y(t||n),r=_(e,n);return o.length>0&&(o.parent().replaceWith(r),i[n]=e,!0)},T=e('<span class="elfinder-button-icon elfinder-button-icon-sort elfinder-places-root-icon" title="'+t.i18n("cmdsort")+'"></span>').hide().on("click",(function(n){n.stopPropagation(),O.empty(),e.each(i,(function(n,i){var o=t.file(n)||i,s=_(o,n),a=null;if(o||s.hide(),O.children().length&&(e.each(O.children(),(function(){var t=e(this);if((o.i18||o.name).localeCompare(t.children("."+r).text())<0)return a=!s.insertBefore(t)})),null!==a))return!0;!y(n).length&&O.append(s)})),x()})),E=_({hash:"root-"+t.namespace,name:t.i18n(n.name,"places"),read:!0,write:!0}),A=E.children("."+r).addClass(c).on("click",(function(e){e.stopPropagation(),A.hasClass(s)&&(D.toggleClass(a),O.slideToggle(),t.storage("placesState",D.hasClass(a)?1:0))})).append(T),O=E.children("."+t.res(o,"navsubtree")),D=e(this).addClass(t.res(o,"tree")+" elfinder-places ui-corner-all").hide().append(E).appendTo(t.getUI("navbar")).on("mouseenter mouseleave","."+r,(function(t){e(this).toggleClass("ui-state-hover","mouseenter"
162==t.type)})).on("click","."+r,(function(n){var i=e(this);i.data("longtap")?n.stopPropagation():!i.hasClass("elfinder-na")&&t.exec("open",i.attr("id").substr(6))})).on("contextmenu","."+r+":not(."+c+")",(function(n){var i=e(this),o=i.attr("id").substr(6);n.preventDefault(),t.trigger("contextmenu",{raw:[{label:t.i18n("moveUp"),icon:"up",remain:!0,callback:function(){!function(e){var n=y(e),i=n.parent(),o=i.prev("div"),r="ui-state-hover",s=t.getUI("contextmenu");g&&clearTimeout(g),o.length&&(s.find(":first").data("placesHash",e),n.addClass(r),i.insertBefore(o),o=i.prev("div"),g=setTimeout((function(){n.removeClass(r),s.find(":first").data("placesHash")===e&&s.hide().empty()}),1500)),o.length||(n.removeClass(r),s.hide().empty())}(o),x()}},"|",{label:t.i18n("rmFromPlaces"),icon:"rm",callback:function(){C(o),x()}}],x:n.pageX,y:n.pageY}),i.addClass("ui-state-hover"),t.getUI("contextmenu").children().on("mouseenter",(function(){i.addClass("ui-state-hover")})),t.bind("closecontextmenu",(function(){i.removeClass("ui-state-hover")}))})).droppable({tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-tree-dir,.elfinder-cwd-file",hoverClass:t.res("class","adroppable"),classes:{"ui-droppable-hover":t.res("class","adroppable")},over:function(n,o){var r=o.helper,s=e.grep(r.data("files"),(function(e){return"directory"===t.file(e).mime&&!i[e]}));n.stopPropagation(),r.data("dropover",r.data("dropover")+1),t.insideWorkzone(n.pageX,n.pageY)&&(s.length>0?(r.addClass("elfinder-drag-helper-plus"),t.trigger("unlockfiles",{files:r.data("files"),helper:r})):e(this).removeClass(d))},out:function(t,n){var i=n.helper;t.stopPropagation(),i.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(i.data("dropover")-1,0)),e(this).removeData("dropover").removeClass(d)},drop:function(n,o){var r=o.helper,s=!0;e.each(r.data("files"),(function(e,n){var o=t.file(n);o&&"directory"==o.mime&&!i[o.hash]?k(o):s=!1})),x(),s&&r.hide()}}).on("touchstart","."+r+":not(."+c+")",(function(n){if(!(n.originalEvent.touches.length>1))var i=e(this).attr("id").substr(6),o=e(this).addClass(l).data("longtap",null).data("tmlongtap",setTimeout((function(){o.data("longtap",!0),t.trigger("contextmenu",{raw:[{label:t.i18n("rmFromPlaces"),icon:"rm",callback:function(){C(i),x()}}],x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY})}),500))})).on("touchmove touchend","."+r+":not(."+c+")",(function(t){clearTimeout(e(this).data("tmlongtap")),"touchmove"==t.type&&e(this).removeClass(l)}));e.fn.sortable&&O.addClass("touch-punch").sortable({appendTo:t.getUI(),revert:!1,helper:function(n){var i=e(n.target).parent();return i.children().removeClass("ui-state-hover"),e('<div class="ui-widget elfinder-place-drag elfinder-'+t.direction+'"></div>').append(e('<div class="elfinder-navbar"></div>').show().append(i.clone()))},stop:function(t,n){var i=e(n.item[0]),o=D.offset().top,r=D.offset().left,s=D.width(),a=D.height(),l=t.pageX,c=t.pageY;l>r&&l<r+s&&c>o&&c<c+a||(C(v(i.children(":first").attr("id"))),x())},update:function(e,t){x()}}),e(this).on("regist",(function(t,n){var o=!1;e.each(n,(function(e,t){t&&"directory"==t.mime&&!i[t.hash]&&k(t)&&(o=!0)})),o&&x()})),t.one("load",(function(){t.oldAPI||(D.show().parent().show(),w(),t.change((function(t){var n=!1;e.each(t.data.changed,(function(e,t){i[t.hash]&&("directory"!==t.mime?C(t.hash)&&(n=!0):S(t)&&(n=!0))})),n&&x()})).bind("rename",(function(t){var n=!1;t.data.removed&&e.each(t.data.removed,(function(e,i){t.data.added[e]&&S(t.data.added[e],i)&&(n=!0)})),n&&x()})).bind("rm paste",(function(t){var n=[],i=!1;t.data.removed&&e.each(t.data.removed,(function(e,t){var i=C(t);i&&n.push(i)})),n.length&&(i=!0),t.data.added&&n.length&&e.each(t.data.added,(function(t,i){1!==e.inArray(i.name,n)&&"directory"==i.mime&&k(i)})),i&&x()})).bind("sync netmount",(function(){var o,r=this,l=n.suffix?n.suffix:"";if("sync"===r.type&&f!==l)return f=l,O.empty(),A.removeClass(s),D.removeClass(a),O.slideToggle(!1),void w();(o=Object.keys(i)).length&&(A.prepend(p),t.request({data:{cmd:"info",targets:o},preventDefault:!0}).done((function(n){var o={},s=!1,a=t.cwd().hash;e.each(n.files||[],(function(e,n){var i=n.hash;o[i]=n,t.files().hasOwnProperty(n.hash)||t.updateCache({tree:[n]})})),e.each(i,(function(e,t){Boolean(t.notfound)===Boolean(o[e])?t.phash===a&&"netmount"!==r.type||o[e]&&"directory"!==o[e].mime?C(e)&&(s=!0):S(o[e]||Object.assign({notfound:!0},t))&&(s=!0):o[e]&&o[e].phash!=a&&S(o[e])})),s&&x()})).always((function(){p.remove()})))})))}))}))},e.fn.elfindersearchbutton=function(t){return this.each((function(){var n,i,o,r,s=!1,a=t.fm,l=(a.res("class","disabled"),t.options.incsearch||{enable:!1}),c=t.options.searchTypes,d=function(e){return a.namespace+a.escape(e)},h=a.getUI("toolbar"),u=a.res("class","searchbtn"),p=e(this).hide().addClass("ui-widget-content elfinder-button "+u).on("click",(function(e){e.stopPropagation()})),f=function(){v.data("inctm")&&clearTimeout(v.data("inctm"));var n=v.val().trim(),o=!e("#"+d("SearchFromAll")).prop("checked"),r=e("#"+d("SearchMime")).prop("checked"),l="";o&&(o=e("#"+d("SearchFromVol")).prop("checked")?a.root(a.cwd().hash):a.cwd().hash),r&&(r=n,n="."),i&&(l=i.children("input:checked").val()),n?(v.trigger("focus"),t.exec(n,o,r,l).done((function(){s=!0})).fail((function(){m()}))):a.trigger("searchend")},m=function(){v.data("inctm")&&clearTimeout(v.data("inctm")),v.val("").trigger("blur"),(s||g)&&(s=!1,g="",a.lazy((function(){a.trigger("searchend")})))},g="",v=e('<input type="text" size="42"/>').on("focus",(function(){var e,t;!p.hasClass("ui-state-active")&&a.getUI().click(),r=!0,g="",p.addClass("ui-state-active"),a.trigger("uiresize"),n&&n.css((e=a.getUI(),t=e.offset(),{top:p.offset().top-t.top,maxHeight:e.height()-40}
162)).slideDown((function(){p.addClass("ui-state-active"),a.toFront(n)}))})).on("blur",(function(){r=!1,n?n.data("infocus")?n.data("infocus",!1):n.slideUp((function(){p.removeClass("ui-state-active"),a.trigger("uiresize"),a.toHide(n)})):p.removeClass("ui-state-active")})).appendTo(p).on("keypress",(function(e){e.stopPropagation()})).on("keydown",(function(t){t.stopPropagation(),t.keyCode===e.ui.keyCode.ENTER?f():t.keyCode===e.ui.keyCode.ESCAPE&&(t.preventDefault(),m())}));l.enable&&(l.minlen=l.minlen||2,l.wait=l.wait||500,v.attr("title",a.i18n("incSearchOnly")).on("compositionstart",(function(){v.data("composing",!0)})).on("compositionend",(function(){v.removeData("composing"),v.trigger("input")})).on("input",(function(){v.data("composing")||(v.data("inctm")&&clearTimeout(v.data("inctm")),v.data("inctm",setTimeout((function(){var e=v.val();(0===e.length||e.length>=l.minlen)&&(g!==e&&a.trigger("incsearchstart",{query:e,type:i?i.children("input:checked").val():"searchName"}),g=e,""===e&&a.searchStatus.state>1&&a.searchStatus.query&&v.val(a.searchStatus.query).trigger("select"))}),l.wait)))})),a.UA.ltIE8&&v.on("keydown",(function(e){229===e.keyCode&&(v.data("imetm")&&clearTimeout(v.data("imetm")),v.data("composing",!0),v.data("imetm",setTimeout((function(){v.removeData("composing")}),100)))})).on("keyup",(function(t){v.data("imetm")&&clearTimeout(v.data("imetm")),v.data("composing")?t.keyCode===e.ui.keyCode.ENTER&&v.trigger("compositionend"):v.trigger("input")}))),e('<span class="ui-icon ui-icon-search" title="'+t.title+'"></span>').appendTo(p).on("mousedown",(function(e){e.stopPropagation(),e.preventDefault(),p.hasClass("ui-state-active")?f():v.trigger("focus")})),e('<span class="ui-icon ui-icon-close"></span>').appendTo(p).on("mousedown",(function(e){e.stopPropagation(),e.preventDefault(),""!==v.val()||p.hasClass("ui-state-active")?m():v.trigger("focus")})),a.bind("toolbarload",(function(){var e=p.parent();if(e.length&&(h.prepend(p.show()),e.remove(),a.UA.ltIE7)){var t=p.children("ltr"==a.direction?".ui-icon-close":".ui-icon-search");t.css({right:"",left:parseInt(p.width())-t.outerWidth(!0)})}})),a.one("init",(function(){a.getUI("cwd").on("touchstart click",(function(){r&&v.trigger("blur")}))})).one("open",(function(){(n=a.api<2.1?null:e('<div class="ui-front ui-widget ui-widget-content elfinder-button-menu elfinder-button-search-menu ui-corner-all"></div>').append(e('<div class="buttonset"></div>').append(e('<input id="'+d("SearchFromCwd")+'" name="serchfrom" type="radio" checked="checked"/><label for="'+d("SearchFromCwd")+'">'+a.i18n("btnCwd")+"</label>"),e('<input id="'+d("SearchFromVol")+'" name="serchfrom" type="radio"/><label for="'+d("SearchFromVol")+'">'+a.i18n("btnVolume")+"</label>"),e('<input id="'+d("SearchFromAll")+'" name="serchfrom" type="radio"/><label for="'+d("SearchFromAll")+'">'+a.i18n("btnAll")+"</label>")),e('<div class="buttonset elfinder-search-type"></div>').append(e('<input id="'+d("SearchName")+'" name="serchcol" type="radio" checked="checked" value="SearchName"/><label for="'+d("SearchName")+'">'+a.i18n("btnFileName")+"</label>"))).hide().appendTo(a.getUI()))&&(c&&(i=n.find(".elfinder-search-type"),e.each(t.options.searchTypes,(function(t,n){i.append(e('<input id="'+d(t)+'" name="serchcol" type="radio" value="'+a.escape(t)+'"/><label for="'+d(t)+'">'+a.i18n(n.name)+"</label>"))}))),n.find("div.buttonset").controlgroup(),e("#"+d("SearchFromAll")).next("label").attr("title",a.i18n("searchTarget",a.i18n("btnAll"))),c&&e.each(c,(function(t,n){n.title&&e("#"+d(t)).next("label").attr("title",a.i18n(n.title))})),n.on("mousedown","div.buttonset",(function(e){e.stopPropagation(),n.data("infocus",!0)})).on("click","input",(function(e){e.stopPropagation(),v.val().trim()?f():v.trigger("focus")})).on("close",(function(){v.trigger("blur")})))})).bind("searchend",(function(){v.val("")})).bind("open parents",(function(){var t=[],n=a.file(a.root(a.cwd().hash));n&&(e.each(a.parents(a.cwd().hash),(function(e,n){t.push(a.file(n).name)})),e("#"+d("SearchFromCwd")).next("label").attr("title",a.i18n("searchTarget",t.join(a.option("separator")))
162),e("#"+d("SearchFromVol")).next("label").attr("title",a.i18n("searchTarget",n.name)))})).bind("open",(function(){g&&m()})).bind("cwdinit",(function(){o=!1})).bind("cwdrender",(function(){o=!0})).bind("keydownEsc",(function(){g&&"/"===g.substr(0,1)&&(g="",v.val(""),a.trigger("searchend"))})).shortcut({pattern:"ctrl+f f3",description:t.title,callback:function(){v.trigger("select").trigger("focus")}}).shortcut({pattern:"a b c d e f g h i j k l m n o p q r s t u v w x y z dig0 dig1 dig2 dig3 dig4 dig5 dig6 dig7 dig8 dig9 num0 num1 num2 num3 num4 num5 num6 num7 num8 num9",description:a.i18n("firstLetterSearch"),callback:function(t){if(o){var n,i=t.originalEvent.keyCode,r=function(){var t=a.selected(),n=e.ui.keyCode[!t.length||a.cwdHash2Elm(t[0]).next("[id]").length?"RIGHT":"HOME"];e(document).trigger(e.Event("keydown",{keyCode:n,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))};i>=96&&i<=105&&(i-=48),n="/"+String.fromCharCode(i),g!==n?(v.val(n),g=n,a.trigger("incsearchstart",{query:n}).one("cwdrender",r)):r()}}})}))},e.fn.elfindersortbutton=function(t){return this.each((function(){var n,i=t.fm,o=t.name,r="class",s=i.res(r,"disabled"),a=i.res(r,"hover"),l="elfinder-button-menu-item",c=l+"-selected",d=c+"-asc",h=c+"-desc",u=e('<span class="elfinder-button-text">'+t.title+"</span>"),p=e(this).addClass("ui-state-default elfinder-button elfinder-menubutton elfiner-button-"+o).attr("title",t.title).append('<span class="elfinder-button-icon elfinder-button-icon-'+o+'"></span>',u).on("mouseenter mouseleave",(function(e){!p.hasClass(s)&&p.toggleClass(a,"mouseenter"===e.type)})).on("click",(function(e){p.hasClass(s)||(e.stopPropagation(),m.is(":hidden")&&i.getUI().click(),m.css(v()).slideToggle({duration:100,done:function(e){i[m.is(":visible")?"toFront":"toHide"](m)}}))})),f=function(){i.toHide(m)},m=e('<div class="ui-front ui-widget ui-widget-content elfinder-button-menu elfinder-button-sort-menu ui-corner-all"></div>').hide().appendTo(i.getUI()).on("mouseenter mouseleave","."+l,(function(t){e(this).toggleClass(a,"mouseenter"===t.type)})).on("click",(function(e){e.preventDefault(),e.stopPropagation()})).on("close",f),g=function(){m.children("[rel]").removeClass(c+" "+d+" "+h).filter('[rel="'+i.sortType+'"]').addClass(c+" "+("asc"==i.sortOrder?d:h)),m.children(".elfinder-sort-stick").toggleClass(c,i.sortStickFolders),m.children(".elfinder-sort-tree").toggleClass(c,i.sortAlsoTreeview)},v=function(){var e=i.getUI().offset(),t=p.offset();return{top:t.top-e.top,left:t.left-e.left}};u.hide(),e.each(i.sortRules,(function(t,n){m.append(e('<div class="'+l+'" rel="'+t+'"><span class="ui-icon ui-icon-arrowthick-1-n"></span><span class="ui-icon ui-icon-arrowthick-1-s"></span>'+i.i18n("sort"+t)+"</div>").data("type",t))})),m.children().on("click",(function(n){t.exec([],e(this).removeClass(a).attr("rel"))})),e('<div class="'+l+" "+l+'-separated elfinder-sort-ext elfinder-sort-stick"><span class="ui-icon ui-icon-check"></span>'+i.i18n("sortFoldersFirst")+"</div>").appendTo(m).on("click",(function(){t.exec([],"stick")})),i.one("init",(function(){i.ui.tree&&null!==i.options.sortAlsoTreeview&&e('<div class="'+l+" "+l+'-separated elfinder-sort-ext elfinder-sort-tree"><span class="ui-icon ui-icon-check"></span>'+i.i18n("sortAlsoTreeview")+"</div>").appendTo(m).on("click",(function(){t.exec([],"tree")}))})).bind("disable select",f).bind("sortchange",g).getUI().on("click",f),m.children().length>1?t.change((function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame((function(){p.toggleClass(s,t.disabled()),g()}))})).change():p.addClass(s)}))},e.fn.elfinderstat=function(t){return this.each((function(){var n=e(this).addClass("elfinder-stat-size"),i=e('<div class="elfinder-stat-selected"></div>').on("click","a",(function(n){var i=e(this).data("hash");n.preventDefault(),t.exec("opendir",[i])})),o=t.i18n("items"),r=t.i18n("selected"),s=t.i18n("size"),a=function(e){n.find("span.elfinder-stat-incsearch").html(e?e.hashes.length+" / ":""),n.attr("title",n.text()),t.trigger("uistatchange")},l=function(n){var o,a,l=0,c=0,d=[];1===n.length?(a=n[0],l=a.size,2===t.searchStatus.state&&(o=t.escape(a.path?a.path.replace(/\/[^\/]*$/,""):".."),d.push('<a href="#elf_'+a.phash+'" data-hash="'+a.hash+'" title="'+o+'">'+o+"</a>")),d.push(t.escape(a.i18||a.name)),i.html(d.join("/")+(l>0?", "+t.formatSize(l):""))):n.length?(e.each(n,(function(e,t){c++,l+=parseInt(t.size)||0})),i.html(c?r+": "+c+", "+s+": "+t.formatSize(l):"&nbsp;")):i.html(""),i.attr("title",i.text()),t.trigger("uistatchange")};t.getUI("statusbar").prepend(n).append(i).show(),t.UA.Mobile&&e.fn.tooltip&&t.getUI("statusbar").tooltip({classes:{"ui-tooltip":"elfinder-ui-tooltip ui-widget-shadow"},tooltipClass:"elfinder-ui-tooltip ui-widget-shadow",track:!0}),t.bind("cwdhasheschange",(function(i){var r,s,a,l,c,d;r=e.map(i.data,(function(e){return t.file(e)})),s=0,a=0,l=t.cwd(),c=!0,d=!0,(l.sizeInfo||l.size)&&(a=l.size,c=!1),e.each(r,(function(e,t){s++,c&&(a+=parseInt(t.size)||0,!0!==d||"directory"!==t.mime||t.sizeInfo||(d=!1))})),n.html(o+': <span class="elfinder-stat-incsearch"></span>'+s+',&nbsp;<span class="elfinder-stat-size'+(d?" elfinder-stat-size-recursive":"")+'">'+t.i18n(d?"sum":"size")+": "+t.formatSize(a)+"</span>").attr("title",n.text()),t.trigger("uistatchange")})).change((function(i){var o=i.data.changed||[],r=t.cwd().hash;e.each(o,(function(){if(this.hash===r)return this.size&&(n.children(".elfinder-stat-size").addClass("elfinder-stat-size-recursive").html(t.i18n("sum")+": "+t.formatSize(this.size)),n.attr("title",n.text())),!1}))})).select((function(){l(t.selectedFiles())})).bind("open",(function(){l([])})).bind("incsearch",(function(e){a(e.data)})).bind("incsearchend",(function(){a()}))}))},e.fn.elfindertoast=function(t,n){var i=Object.assign({mode:"success",msg:"",showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1500,hideEasing:"swing",onHidden:void 0,timeOut:3e3,extNode:void 0,button:void 0,width:void 0},e.isPlainObject(n.options.uiOptions.toast.defaults)?n.options.uiOptions.toast.defaults:{});return this.each((function(){t=Object.assign({},i,t||{});var o,r=e(this),s=function(e){r.stop(),n.toFront(r),r[t.showMethod]({duration:t.showDuration,easing:t.showEasing,complete:function(){t.onShown&&t.onShown(),!e&&t.timeOut&&(o=setTimeout(a,t.timeOut))}})},a=function(){r[t.hideMethod]({duration:t.hideDuration,easing:t.hideE
162asing,complete:function(){t.onHidden&&t.onHidden(),r.remove()}})};r.on("click",(function(e){e.stopPropagation(),e.preventDefault(),o&&clearTimeout(o),t.onHidden&&t.onHidden(),r.stop().remove()})).on("mouseenter mouseleave",(function(e){t.timeOut&&(o&&clearTimeout(o),o=null,"mouseenter"===e.type?s(!0):o=setTimeout(a,t.timeOut))})).hide().addClass("toast-"+t.mode).append(e('<div class="elfinder-toast-msg"></div>').html(t.msg.replace(/%([a-zA-Z0-9]+)%/g,(function(e,t){return n.i18n(t)})))),t.extNode&&r.append(t.extNode),t.button&&r.append(e('<button class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"></button>').append(e('<span class="ui-button-text"></span>').text(n.i18n(t.button.text))).on("mouseenter mouseleave",(function(t){e(this).toggleClass("ui-state-hover","mouseenter"==t.type)})).on("click",t.button.click||function(){})),t.width&&r.css("max-width",t.width),s()}))},e.fn.elfindertoolbar=function(t,n){return this.not(".elfinder-toolbar").each((function(){var i,o,r,s,a,l,c,d,h,u=t._commands,p=e(this).addClass("ui-helper-clearfix ui-widget-header elfinder-toolbar"),f={displayTextLabel:!1,labelExcludeUA:["Mobile"],autoHideUA:["Mobile"],showPreferenceButton:"none"},m=function(n){var l,c;for(e.each(g,(function(e,t){t.detach()})),p.empty(),i=v.length;i--;)if(v[i]){for(s=e('<div class="ui-widget-content ui-corner-all elfinder-buttonset"></div>'),o=v[i].length;o--;)l=v[i][o],n&&n[l]||!(r=u[l])||(a="elfinder"+r.options.ui,!g[l]&&e.fn[a]&&(g[l]=e("<div></div>")[a](r)),g[l]&&(g[l].children(".elfinder-button-text")[d?"show":"hide"](),s.prepend(g[l])));s.children().length&&p.prepend(s),s.children(":gt(0)").before('<span class="ui-widget-content elfinder-toolbar-button-separator"></span>')}(c=u.preference)&&("always"===f.showPreferenceButton||!p.children().length&&"auto"===f.showPreferenceButton)&&(s=e('<div class="ui-widget-content ui-corner-all elfinder-buttonset"></div>'),l="preference",a="elfinder"+r.options.ui,g[l]=e("<div></div>")[a](c),g[l].children(".elfinder-button-text")[d?"show":"hide"](),s.prepend(g[l]),p.append(s)),!p.data("swipeClose")&&p.children().length?p.show():p.hide(),x=p[0].clientHeight,t.trigger("toolbarload").trigger("uiresize")},g={},v=function(t){return e.grep(t,(function(t){return!e.isPlainObject(t)||(f=Object.assign(f,t),!1)}))}(n||[]),b=null,y="",x=0,w=[];f.showPreferenceButton=f.showPreferenceButton.toLowerCase(),"none"!==f.displayTextLabel&&(d=null===(d=t.storage("toolbarTextLabel"))?f.displayTextLabel&&(!f.labelExcludeUA||!f.labelExcludeUA.length||!e.grep(f.labelExcludeUA,(function(e){return!!t.UA[e]})).length):1==d,w.push({label:t.i18n("textLabel"),icon:"text",callback:function(){d=!d,p.css("height","").find(".elfinder-button-text")[d?"show":"hide"](),t.trigger("uiresize").storage("toolbarTextLabel",d?"1":"0")}})),f.preferenceInContextmenu&&u.preference&&w.push({label:t.i18n("toolbarPref"),icon:"preference",callback:function(){t.exec("preference",void 0,{tab:"toolbar"})}}),w.length&&p.on("contextmenu",(function(e){e.stopPropagation(),e.preventDefault(),t.trigger("contextmenu",{raw:w,x:e.pageX,y:e.pageY})})).on("touchstart",(function(e){e.originalEvent.touches.length>1||(p.data("tmlongtap")&&clearTimeout(p.data("tmlongtap")),p.removeData("longtap").data("longtap",{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}).data("tmlongtap",setTimeout((function(){p.removeData("longtapTm").trigger({type:"contextmenu",pageX:p.data("longtap").x,pageY:p.data("longtap").y}).data("longtap",{longtap:!0})}),500)))})).on("touchmove touchend",(function(e){p.data("tmlongtap")&&(("touchend"===e.type||Math.abs(p.data("longtap").x-e.originalEvent.touches[0].pageX)+Math.abs(p.data("longtap").y-e.originalEvent.touches[0].pageY)>4)&&clearTimeout(p.data("tmlongtap")),p.removeData("longtapTm"))})).on("click",(function(e){p.data("longtap")&&p.data("longtap").longtap&&(e.stopImmediatePropagation(),e.preventDefault())})).on("touchend click",".elfinder-button",(function(e){p.data("longtap")&&p.data("longtap").longtap&&(e.stopImmediatePropagation(),e.preventDefault())}
162)),p.prev().length&&p.parent().prepend(this),m(),t.bind("open sync select toolbarpref",(function(){var n,i,o,r=Object.assign({},t.option("disabledFlip")),s=t.storage("toolbarhides");if(!s&&Array.isArray(f.defaultHides)&&(s={},e.each(f.defaultHides,(function(){s[this]=!0})),t.storage("toolbarhides",s)),"select"===this.type){if(t.searchStatus.state<2)return;(i=t.selected()).length&&(r=t.getDisabledCmds(i,!0))}e.each(s,(function(e){r[e]||(r[e]=!0)})),Object.keys(t.commandMap).length&&e.each(t.commandMap,(function(e,t){"hidden"===t&&(r[e]=!0)})),o=Object.keys(r),b&&b.toString()===o.sort().toString()||(m(o.length?r:null),n=!0),b=o.sort(),(n||y!==JSON.stringify(t.commandMap))&&(y=JSON.stringify(t.commandMap),n||e.each(e("div.elfinder-button"),(function(){var t=e(this).data("origin");t&&e(this).after(t).detach()})),Object.keys(t.commandMap).length&&e.each(t.commandMap,(function(n,i){var o,r=t._commands[i],s=r?"elfinder"+r.options.ui:null;s&&e.fn[s]&&(o=g[n])&&(!g[i]&&e.fn[s]&&(g[i]=e("<div></div>")[s](r),g[i]&&(g[i].children(".elfinder-button-text")[d?"show":"hide"](),r.extendsCmd&&g[i].children("span.elfinder-button-icon").addClass("elfinder-button-icon-"
162+r.extendsCmd))),g[i]&&(o.after(g[i]),g[i].data("origin",o.detach())))})))})).bind("resize",(function(e){h&&cancelAnimationFrame(h),h=requestAnimationFrame((function(){var e=p[0].clientHeight;x!==e&&(x=e,t.trigger("uiresize"))}))})),t.UA.Touch&&(void 0===(c=t.storage("autoHide")||{}).toolbar&&(c.toolbar=f.autoHideUA&&f.autoHideUA.length>0&&e.grep(f.autoHideUA,(function(e){return!!t.UA[e]})).length,t.storage("autoHide",c)),c.toolbar&&t.one("init",(function(){t.uiAutoHide.push((function(){p.stop(!0,!0).trigger("toggle",{duration:500,init:!0})}))})),t.bind("load",(function(){"none"!==(l=e('<div class="elfinder-toolbar-swipe-handle"></div>').hide().appendTo(t.getUI())).css("pointer-events")&&(l.remove(),l=null)})),p.on("toggle",(function(e,n){var i=t.getUI("workzone"),o=p.is(":hidden"),r=i.height(),s=p.height(),a=p.outerHeight(!0)-s,d=Object.assign({step:function(e){i.height(r+(o?-1*(e+a):s-e)),t.trigger("resize")},always:function(){requestAnimationFrame((function(){p.css("height",""),t.trigger("uiresize"),l&&(o?l.stop(!0,!0).hide():(l.height(n.handleH?n.handleH:""),t.resources.blink(l,"slowonce"))),o&&p.scrollTop("0px"),n.init&&t.trigger("uiautohide")}))}},n);p.data("swipeClose",!o).stop(!0,!0).animate({height:"toggle"},d),c.toolbar=!o,t.storage("autoHide",Object.assign(t.storage("autoHide"),{toolbar:c.toolbar}))})).on("touchstart",(function(e){p.scrollBottom()>5&&(e.originalEvent._preventSwipeY=!0)})))})),this},e.fn.elfindertree=function(t,n){var i=t.res("class","tree");return this.not("."+i).each((function(){var o,r,s,a,l="class",c=t.UA.Mobile,d=t.res(l,"treeroot"),h=n.openRootOnLoad,u=n.openCwdOnOpen,p=u||n.syncTree,f=t.res(l,"navsubtree"),m=t.res(l,"treedir"),g="span."+m,v=t.res(l,"navcollapse"),b=t.res(l,"navexpand"),y="elfinder-subtree-loaded",x="elfinder-subtree-chksubdir",w=t.res(l,"navarrow"),_=t.res(l,"active"),k=t.res(l,"adroppable"),C=t.res(l,"hover"),S=t.res(l,"disabled"),T=t.res(l,"draggable"),E=t.res(l,"droppable"),A="elfinder-navbar-wrapper-root",O="elfinder-navbar-wrapper-pastable",D="elfinder-navbar-wrapper-uploadable",I=function(e){var t=ae.offset().left;return t<=e&&e<=t+ae.width()},P={},M=[],R=function(n){var i=[];if(e.each(n,(function(e,n){P[n]&&i.push(t.navId2Hash(n)),delete P[n]})),i.length)return t.request({data:{cmd:"subdirs",targets:i,preventDefault:!0}}).done((function(n){n&&n.subdirs&&e.each(n.subdirs,(function(e,n){var i=t.navHash2Elm(e);i.removeClass(x),i[n?"addClass":"removeClass"](v)}))}))},z=null,N=function(){var n=Object.keys(P);n.length&&(z&&z._abort(),o&&clearTimeout(o),M=[],z=t.asyncJob((function(n){return t.isInWindow(e("#"+n))?n:null}),n,{numPerOnce:200}).done((function(e){e.length&&(M=e,L())})))},F=0,L=function(){var e,i=n.subdirsMaxConn-F,r=t.maxTargets?Math.min(t.maxTargets,n.subdirsAtOnce):n.subdirsAtOnce;if(o&&cancelAnimationFrame(o),M.length)if(i>0)for(e=0;e<i;e++)M.length&&(F++,R(M.splice(0,r)).always((function(){F--,L()})));else o=requestAnimationFrame((function(){M.length&&L()}))},j=t.droppable.drop,B=e.extend(!0,{},t.droppable,{over:function(n,i){var o,r,s=e(this),a=i.helper,l=C+" "+k;if(n.stopPropagation(),a.data("dropover",a.data("dropover")+1),s.data("dropover",!0),i.helper.data("namespace")!==t.namespace||!t.insideWorkzone(n.pageX,n.pageY))return s.removeClass(l),void a.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus");I(n.clientX)?(a.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"),s.addClass(C),s.is("."+v+":not(."+b+")")&&s.data("expandTimer",setTimeout((function(){s.is("."+v+"."+C)&&s.children("."+w).trigger("click")}),500)),s.is(".elfinder-ro,.elfinder-na")?s.removeClass(k):(o=t.navId2Hash(s.attr("id")),s.data("dropover",o),e.each(i.helper.data("files"),(function(e,n){if(n===o||t.file(n).phash===o&&!i.helper.hasClass("elfinder-drag-helper-plus"))return s.removeClass(l),!1})),a.data("locked")?r="elfinder-drag-helper-plus":(r="elfinder-drag-helper-move",t._commands.copy&&(n.shiftKey||n.ctrlKey||n.metaKey)&&(r+=" elfinder-drag-helper-plus")),s.hasClass(k)&&a.addClass(r),requestAnimationFrame((function(){s.hasClass(k)&&a.addClass(r)})))):s.removeClass(l)},out:function(t,n){var i=e(this),o=n.helper;t.stopPropagation(),I(t.clientX)&&o.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"),o.data("dropover",Math.max(o.data("dropover")-1,0)),i.data("expandTimer")&&clearTimeout(i.data("expandTimer")),i.removeData("dropover").removeClass(C+" "+k)},deactivate:function(){e(this).removeData("dropover").removeClass(C+" "+k)},drop:function(e,t){I(e.clientX)&&j.call(this,e,t)}}),H=e(t.res("tpl","navspinner")),U=t.res("tpl","navdir"),$=t.res("tpl","perms"),q=(t.res("tpl","lock"),t.res("tpl","symlink")),W={},V={id:function(e){return t.navHash2Id(e.hash)},name:function(e){return t.escape(e.i18||e.name)},cssclass:function(e){var i=(e.phash&&!e.isroot?"":d)+" "+m+" "+t.perms2class(e);return e.dirs&&!e.link&&(i+=" "+v)&&-1==e.dirs&&(i+=" "+x),n.getClass&&(i+=" "+n.getClass(e)),e.csscls&&
162(i+=" "+t.escape(e.csscls)),i},title:function(e){return n.attrTitle?' title="'+t.escape(t.path(e.hash,!0)||e.i18||e.name)+'"':""},root:function(t){var n="";return!t.phash||t.isroot?(n+=" "+A,!t.disabled||t.disabled.length<1?n+=" "+O+" "+D:(-1===e.inArray("paste",t.disabled)&&(n+=" "+O),-1===e.inArray("upload",t.disabled)&&(n+=" "+D)),n):""},permissions:function(e){return e.read&&e.write?"":$},symlink:function(e){return e.alias?q:""},style:function(e){return e.icon?t.getIconStyle(e):""}},K=function(e){return U.replace(/(?:\{([a-z]+)\})/gi,(function(t,n){var i=V[n]?V[n](e):e[n]||"";return"id"===n&&-1==e.dirs&&(P[i]=i),i}))},G=function(n,i){return e.map(n||[],(function(e){return"directory"!==e.mime||i&&!t.navHash2Elm(e.hash).length?null:e}))},X=function(e){return e?t.navHash2Elm(e).next("."+f):re},Y=function(e,n){for(var i,o=e.children(":first");o.length;){if(t.file(t.navId2Hash(o.children("[id]").attr("id"))),(i=t.file(t.navId2Hash(o.children("[id]").attr("id"))))&&J(n,i)<0)return o;o=o.next()}return e.children("button.elfinder-navbar-pager-next")},Q=function(i){for(var o,r,s,a,l,d,h,u=i.length,p=[],f=u,m=e(),g={},v=t.cwd(),b=function(i,o,r,s){var a={},l=0,d=t.newAPI?Math.min(1e4,Math.max(10,n.subTreeMax)):1e4,h=function(){a={},e.each(o,(function(e,t){a[t.hash]=e}))},u=function(t,n){var r,s;(t.stopPropagation(),n.select)?m(p(n.select)):n.change?"prepare"===(s=n.change)?e.each(o,(function(e,t){t.node&&i.append(t.node.hide())})):"done"===s&&e.each(o,(function(e,t){t.node&&t.node.detach().show()})):(n.removed&&n.removed.length&&(o=e.grep(o,(function(e){return-1===n.removed.indexOf(e.hash)||(!r&&(r=!0),!1)}))),n.added&&n.added.length&&(o=o.concat(e.grep(n.added,(function(e){return void 0===a[e.hash]&&(!r&&(r=!0),!0)})))),r&&(o.sort(J),h(),m(l)))},p=function(e){if(void 0!==a[e])return Math.floor(a[e]/d)*d},f=t.navId2Hash(i.prev("[id]").attr("id")),m=function(n,r){var s,a,b,y,x,w,_,k=[],C={};delete W[f],l=n,i.off("update."+t.namespace,u),o.length>d&&(i.on("update."+t.namespace,u),void 0===n&&(0,h(),void 0===(n=p(v.hash))&&(n=0)),b=o.slice(n,n+d),W[f]=i,y=n?Math.max(-1,n-d):-1,x=n+d>=o.length?0:n+d,s=Math.ceil(o.length/d),a=Math.ceil(n/d)),e.each(b||o,(function(e,t){k.push(K(t)),t.node&&(C[t.hash]=t.node)})),w=y>-1?e('<button class="elfinder-navbar-pager elfinder-navbar-pager-prev"></button>').text(t.i18n("btnPrevious",a,s)).button({icons:{primary:"ui-icon-caret-1-n"}}).on("click",(function(e){e.preventDefault(),e.stopPropagation(),m(y,"up")})):e(),_=x?e('<button class="elfinder-navbar-pager elfinder-navbar-pager-next"></button>').text(t.i18n("btnNext",a+2,s)).button({icons:{primary:"ui-icon-caret-1-s"}}).on("click",(function(e){e.preventDefault(),e.stopPropagation(),m(x,"down")})):e(),g(),i.empty()[b?"addClass":"removeClass"]("elfinder-navbar-hasmore").append(w,k.join(""),_),e.each(C,(function(e,n){t.navHash2Elm(e).parent().replaceWith(n)})),r&&Z(t.navHash2Id(b["up"===r?b.length-1:0].hash)),!c&&t.lazy((function(){ie(null,i)}))},g=function(){e.each(i.children(".elfinder-navbar-wrapper"),(function(n,i){var r,s,l=e(i),c=l.children("[id]:first");c.hasClass(y)&&(r=t.navId2Hash(c.attr("id")))&&void 0!==(s=a[r])&&(o[s].node=l.detach())}))};m()},x={},w=[],_={};f--;)g[(o=i[f]).hash]||t.navHash2Elm(o.hash).length||(g[o.hash]=!0,(r=X(o.phash)).length?(void 0===_[h=o.phash||"treeroot"]&&(_[h]=r.children(":last")),a=!_[h].length,o.phash&&(a||r.hasClass("elfinder-navbar-hasmore")||(s=Y(r,o)).length)?a?(x[o.phash]||(x[o.phash]=[]),x[o.phash].push(o)):s?(d=K(o),s.before(d),!c&&(m=m.add(d))):w.push(o):(d=K(o),a?r.prepend(d):_[h].after(d),o.phash&&!o.isroot||(l=t.navHash2Elm(o.hash).parent()),!c&&ie(null,l))):p.push(o));Object.keys(x).length&&e.each(x,(function(e,t){var n=X(e);t.sort(J),b(n,t)})),w.length&&r.trigger("update."+t.namespace,{added:w}),p.length&&p.length<u?Q(p):!c&&m.length&&t.lazy((function(){ie(m)}))},J=function(e,n){if(t.sortAlsoTreeview){var i,o="asc"==t.sortOrder,r=t.sortType,s=t.sortRules;return i=o?s[t.sortType](e,n):s[t.sortType](n,e),"name"!==r&&0===i?i=o?s.name(e,n):s.name(n,e):i}return t.sortRules.name(e,n)},Z=function(i){var o,s,a,l,c,d,h=e.Deferred();return r&&clearTimeout(r),r=setTimeout((function(){(o=e(document.getElementById(i||t.navHash2Id(t.cwd().hash)))).length?((u?o:o.parent()).parents(".elfinder-navbar-wrapper").children("."+y).addClass(b).next("."+f).show(),s=re.parent().stop(!1,!0),a=s.offset().top,l=s.height(),c=a+l-o.outerHeight(),(d=o.offset().top)<a||d>c?s.animate({scrollTop:s.scrollTop()+d-a-l/3},{duration:n.durations.autoScroll,complete:function(){h.resolve()}}):h.resolve()):h.reject()}),100),h},ee=function(e){var n,i,o,r=e||t.cwd(),s=r.hash?[r.hash]:[];for(i=t.root(r.hash),o=t.file(i);o&&(n=o.phash)&&(s.unshift(n),i=t.root(n),o=t.file(i),!t.navHash2Elm(o.hash).hasClass(y)););return s},te=function(e){var n=e||t.cwd(),i=n.hash,o=t.navHash2Elm(i);if(!o.length){for(;n&&n.phash;)W[n.phash]&&!t.navHash2Elm(n.hash).length&&W[n.phash].trigger("update."+t.namespace,{select:n.hash}),n=t.file(n.phash);o=t.navHash2Elm(i)}return o},ne=function(n,i){var o,r,a,l,c,d,u,f,x=t.cwd(),k=x.hash,C=void 0===i?p:i,S=function(i,r){var s,a=function(){h&&o&&(X(o.hash).show().prev(g).addClass(b),h=!1),C?Z().done(N):N()};
162i&&e.each(i,(function(e,n){n&&Q(n),te(t.file(e)),n&&oe(n,y)})),n&&(t.api<2.1&&n.push(x),Q(n)),(s=te()).hasClass(_)||(re.find(g+"."+_).removeClass(_),s.addClass(_)),s.parents(".elfinder-navbar-wrapper").children("."+m).addClass(y),i?t.lazy(a).done((function(){r.resolve()})):(a(),r.resolve())},T=function(e){o&&(r.remove(),o.addClass(v+(e?"":" "+y)))},E=e.Deferred();return t.navHash2Elm(k).length?S(void 0,E):(s=!0,(u=e.Deferred(),f=ee(a),(l=e.map(f,(function(e){var n,i,o=t.file(e),r=!!o&&t.isRoot(o),s=t.navHash2Elm(e),a=function(e,n){var i,o,r=n||1;return(o=!!(i=t.file(e))&&i.phash)&&r>1?a(o,--r):o},l=function(){var i=a(e);for(n=i;i&&!t.navHash2Elm(i).hasClass(y);)n=i,i=a(i);return i||(n=void 0,i=t.root(e)),i}();return s.hasClass(y)||!r&&o&&t.navHash2Elm(o.phash).hasClass(y)?null:(r||l===a(e)||l===a(e,2)?(n=void 0,i="tree",r||(e=a(e))):i="parents",c||(c="tree"===i?e:l),function(e,n,i){var o={cmd:e,target:n};return i&&(o.until=i),t.request({data:o,preventFail:!0})}(i,e,n))}))).length?(te(t.file(c)),d=t.navHash2Id(c),C&&Z(d),o=e("#"+d),r=e(t.res("tpl","navspinner")).insertBefore(o.children("."+w)),o.removeClass(v),e.when.apply(e,l).done((function(){var e,t,n,i={};if((t=arguments.length)>0)for(n=0;n<t;n++)e=arguments[n].tree||[],i[f[n]]=Object.assign([],G(e));u.resolve(i)})).fail((function(){u.reject()})),u):u.resolve()).done((function(e){S(e,E),T()})).fail((function(){T(!0),E.reject()})).always((function(){s=!1}))),t.trigger("treesync",E),E},ie=function(n,i){n||(i&&!i.closest("div."+A).hasClass(D)||(i||re.find("div."+D)).find(g+":not(.elfinder-ro,.elfinder-na)").addClass("native-droppable"),n=!i||i.closest("div."+A).hasClass(O)?(i||re.find("div."+O)).find(g+":not(."+E+")"):e(),i&&i.children("div."+A).each((function(){ie(null,e(this))}))),n.length&&t.asyncJob((function(t){e(t).droppable(B)}),e.makeArray(n),{interval:20,numPerOnce:100})},oe=function(n,i){var o=i==y?"."+v+":not(."+y+")":":not(."+v+")";e.each(n,(function(n,r){t.navHash2Elm(r.phash).filter(o).filter((function(){return e.grep(e(this).next("."+f).children(),(function(t){return!e(t).children().hasClass(d)})).length>0})).addClass(i)}))},re=e(this).addClass(i).on("mouseenter mouseleave",g,(function(i){var o="mouseenter"===i.type;if(!o||!se){var r,s,a=e(this);a.hasClass(k+" "+S)||(c||!o||a.data("dragRegisted")||a.hasClass(d+" "+T+" elfinder-na elfinder-wo")||(a.data("dragRegisted",!0),t.isCommandEnabled("copy",r=t.navId2Hash(a.attr("id")))&&a.draggable(t.draggable)),a.toggleClass(C,o)),o&&n.attrTitle&&((s=t.file(r||t.navId2Hash(a.attr("id")))).isroot||a.attr("title")!==(s.i18||s.name)||a.attr("title",t.path(r,!0)))}})).on("dragenter",g,(function(t){if(t.originalEvent.dataTransfer){var n=e(this);n.addClass(C),n.is("."+v+":not(."+b+")")&&n.data("expandTimer",setTimeout((function(){n.is("."+v+"."+C)&&n.children("."+w).trigger("click")}),500))}})).on("dragleave",g,(function(t){if(t.originalEvent.dataTransfer){var n=e(this);n.data("expandTimer")&&clearTimeout(n.data("expandTimer")),n.removeClass(C)}})).on("click",g,(function(n){var i=e(this),o=t.navId2Hash(i.attr("id"));t.file(o);if(i.data("longtap"))return i.removeData("longtap"),void n.stopPropagation();i.hasClass(_)||(re.find(g+"."+_).removeClass(_),i.addClass(_)),o==t.cwd().hash||i.hasClass(S)?(i.hasClass(v)&&i.children("."+w).trigger("click"),t.select({selected:[o],origin:"navbar"})):t.exec("open",o).done((function(){t.one("opendone",(function(){t.select({selected:[o],origin:"navbar"})}))}))})).on("touchstart",g,(function(n){if(!(n.originalEvent.touches.length>1)){var i,o=n.originalEvent;"INPUT"!==n.target.nodeName?i=e(this).addClass(C).removeData("longtap").data("tmlongtap",setTimeout((function(e){i.data("longtap",!0),t.trigger("contextmenu",{type:"navbar",targets:[t.navId2Hash(i.attr("id"))],x:o.touches[0].pageX,y:o.touches[0].pageY})}),500)):n.stopPropagation()}})).on("touchmove touchend",g,(function(t){"INPUT"!==t.target.nodeName?(clearTimeout(e(this).data("tmlongtap")),e(this).removeData("tmlongtap"),"touchmove"==t.type&&e(this).removeClass(C)):t.stopPropagation()})).on("click",g+"."+v+" ."+w,(function(i){var o=e(this),r=o.parent(g),s=r.next("."+f),a=e.Deferred();i.stopPropagation(),r.hasClass(y)?(r.toggleClass(b),t.lazy((function(){(r.hasClass(b)?s.children().length+s.find("div.elfinder-navbar-subtree[style*=block]").children().length:s.find("div:visible").length)>30?(s.toggle(),t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1),N()):s.stop(!0,!0)[r.hasClass(b)?"slideDown":"slideUp"](n.durations.slideUpDown,(function(){t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1),N()}))})).always((function(){a.resolve()}))):(H.insertBefore(o),r.removeClass(v),t.request({cmd:"tree",target:t.navId2Hash(r.attr("id"))}).done((function(e){Q(Object.assign([],G(e.tree))),s.children().length&&(r.addClass(v+" "+b),s.children().length>30?(s.show(),t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1),N()):s.stop(!0,!0).slideDown(n.durations.slideUpDown,(function(){t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1),N()})))})).always((function(e){H.remove(),r.addClass(y),t.one("treedone",(function(){a.resolve()}))}))),o.data("dfrd",a)})).on("contextmenu",g,(function(n){n.stopPropagation();var i=e(this);i.find("input:text").length||(n.preventDefault(),i.data("tmlongtap")||t.trigger("contextmenu",{type:"navbar",targets:[t.navId2Hash(e(this).attr("id"))],x:n.pageX,y:n.pageY}),i.addClass("ui-state-hover"),t.getUI("contextmenu").children().on("mouseenter",(function(){i.addClass("ui-state-hover")})),t.bind("closecontextmenu",(function(){i.removeClass("ui-state-hover")})))}
162)).on("scrolltoview",g,(function(n,i){var o=e(this);Z(o.attr("id")).done((function(){i&&"undefined"!==i.blink&&!i.blink||t.resources.blink(o,"lookme")}))})).on("create."+t.namespace,(function(n,i){var o=X(i.phash),r=i.move||!1,s=e(K(i)).addClass("elfinder-navbar-wrapper-tmp"),a=t.selected();r&&a.length&&t.trigger("lockfiles",{files:a}),o.prepend(s)})),se=!1,ae=t.getUI("navbar").append(re).show().on("scroll",(function(){se=!0,a&&cancelAnimationFrame(a),a=requestAnimationFrame((function(){se=!1,N()}))})),le=t.sortAlsoTreeview;t.open((function(e){var n=e.data,i=G(n.files),o=t.getUI("contextmenu");n.init&&re.empty(),t.UA.iOS&&ae.removeClass("overflow-scrolling-touch").addClass("overflow-scrolling-touch"),i.length?t.lazy((function(){o.data("cmdMaps")||o.data("cmdMaps",{}),Q(i),oe(i,y),ne(i)})):ne()})).add((function(e){var t=G(e.data.added);t.length&&(Q(t),oe(t,v))})).change((function(n){if(!s){var i,o,r,a,l,d,h,u,p,m,v,x,w=G(n.data.changed,!0),_=w.length,k=_;e();for(e.each(W,(function(e,n){n.trigger("update."+t.namespace,{change:"prepare"})}));k--;)if(o=(i=w[k]).phash,(r=t.navHash2Elm(i.hash)).length){if(v=r.parent(),o){if(l=r.closest("."+f),d=X(o),h=r.parent().next(),u=Y(d,i),!d.length)continue;d[0]===l[0]&&h.get(0)===u.get(0)||(u.length?u.before(v):d.append(v))}p=r.hasClass(b),m=r.hasClass(y),a=e(K(i)),r.replaceWith(a.children(g)),!c&&ie(null,v),i.dirs&&(p||m)&&(r=t.navHash2Elm(i.hash))&&r.next("."+f).children().length&&(p&&r.addClass(b),m&&r.addClass(y)),x|=-1==i.dirs}
162x&&N(),e.each(W,(function(e,n){n.trigger("update."+t.namespace,{change:"done"})})),_&&ne(void 0,!1)}})).remove((function(n){var i,o,r,s=n.data.removed,a=s.length;for(e.each(W,(function(e,n){n.trigger("update."+t.namespace,{removed:s}),n.trigger("update."+t.namespace,{change:"prepare"})}));a--;)(i=t.navHash2Elm(s[a])).length&&(r=!0,o=i.closest("."+f),i.parent().detach(),o.children().length||o.hide().prev(g).removeClass(v+" "+b+" "+y));r&&t.getUI("navbar").children(".ui-resizable-handle").trigger("resize"),e.each(W,(function(e,n){n.trigger("update."+t.namespace,{change:"done"})}))})).bind("lockfiles unlockfiles",(function(n){var i="lockfiles"==n.type,o=!!n.data.helper&&n.data.helper.data("locked"),r=i&&!o?"disable":"enable",s=e.grep(n.data.files||[],(function(e){var n=t.file(e);return!(!n||"directory"!=n.mime)}));e.each(s,(function(e,n){var s=t.navHash2Elm(n);s.length&&!o&&(s.hasClass(T)&&s.draggable(r),s.hasClass(E)&&s.droppable(r),s[i?"addClass":"removeClass"](S))}))})).bind("sortchange",(function(){if(t.sortAlsoTreeview||le!==t.sortAlsoTreeview){var n,i=[],o={},r={},s="",a=!1;t.lazy((function(){n=G(t.files()),le=t.sortAlsoTreeview,re.empty(),Q(e.map(t.roots,(function(e){var n=t.file(e);return n&&!n.phash?n:null}))),Object.keys(W).length?((i=ee()).length>1?(e.each(i,(function(e,n){var i=t.file(t.root(n)).volumeid;0===e&&(s=i),r[i]=n,o[n]=[]})),e.each(n,(function(e,t){if(!t.volumeid)return a=!0,!1;o[r[t.volumeid]||r[s]].push(t)}))):a=!0,a?e.each(i,(function(e,i){Q(n),te(t.file(i)),oe(n,y)})):e.each(o,(function(e,n){Q(n),te(t.file(e)),oe(n,y)}))):(Q(n),te(),oe(n,y)),ne()}),100)}}))})),this},e.fn.elfinderuploadbutton=function(t){return this.each((function(){var n,i=t.fm,o=e(this).elfinderbutton(t).off("click"),r=e("<form></form>").appendTo(o),s=e('<input type="file" multiple="true" title="'+t.fm.i18n("selectForUpload")+'"/>').on("change",(function(){var t=e(this);t.val()&&(i.exec("upload",{input:t.remove()[0]},void 0,i.cwd().hash),s.clone(!0).appendTo(r))})).on("dragover",(function(e){e.originalEvent.dataTransfer.dropEffect="copy"}));r.append(s.clone(!0)),t.change((function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame((function(){var e=t.disabled();r.is("visible")?!e&&r.hide():e&&r.show()}))})).change()}))},e.fn.elfinderviewbutton=function(t){return this.each((function(){var n,i=e(this).elfinderbutton(t),o=i.children(".elfinder-button-icon"),r=i.children(".elfinder-button-text");t.change((function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame((function(){var e="icons"==t.value;o.toggleClass("elfinder-button-icon-view-list",e),t.className=e?"view-list":"",t.title=t.fm.i18n(e?"viewlist":"viewicons"),i.attr("title",t.title),r.html(t.title)}))}))}))},e.fn.elfinderworkzone=function(t){var n="elfinder-workzone";return this.not("."+n).each((function(){var i,o=e(this).addClass(n),r=Math.round(o.height()),s=o.parent(),a=function(){i=o.outerHeight(!0)-o.height()},l=function(a){var l=s.height()-i,c=s.attr("style"),d=Math.round(o.height());a&&(a.preventDefault(),a.stopPropagation()),s.css("overflow","hidden").children(":visible:not(."+n+")").each((function(){var t=e(this);"absolute"!=t.css("position")&&"fixed"!=t.css("position")&&(l-=t.outerHeight(!0))})),s.attr("style",c||""),l=Math.max(0,Math.round(l)),r===l&&d===l||(r=Math.round(o.height()),o.height(l),t.trigger("wzresize"))};a(),s.on("resize."+t.namespace,l),t.one("cssloaded",(function(){i=o.outerHeight(!0)-o.height(),l()})).bind("uiresize",l).bind("themechange",a)})),this},h.prototype.commands.archive=function(){var t,n=this,i=n.fm,o=[];this.variants=[],this.disableOnSearch=!1,this.nextAction={},i.bind("open reload",(function(){n.variants=[],e.each(o=i.option("archivers").create||[],(function(e,t){n.variants.push([t,i.mime2kind(t)])})),n.change()})),this.getstate=function(n){var r,s,a,l=this.files(n),c=l.length,d=c&&!i.isRoot(l[0])&&(i.file(l[0].phash)||{}).write;return d&&i.searchStatus.state>1&&(d=c===(s=l,a=!0,e.grep(s,(function(e){return a=!(!a||!e.read||0!==e.hash.indexOf(r))}))).length)&&(r=i.cwd().volumeid),d&&!this._disabled&&o.length&&(c||t&&"pending"==t.state())?0:-1},this.exec=function(r,s){var a,l=this.files(r),c=l.length,d=s||o[0],h=i.file(l[0].phash)||null,u=["errArchive","errPerm","errCreatingTempDir","errFtpDownloadFile","errFtpUploadFile","errFtpMkdir","errArchiveExec","errExtractExec","errRm"];if(t=e.Deferred().fail((function(e){e&&i.error(e)})),!c||!o.length||-1===e.inArray(d,o))return t.reject();if(!h.write)return t.reject(u);for(a=0;a<c;a++)if(!l[a].read)return t.reject(u);return n.mime=d,n.prefix=(c>1?"Archive":l[0].name)+(i.option("archivers").createext?"."+i.option("archivers").createext[d]:""),n.data={targets:n.hashes(r),type:d},i.cwd().hash!==h.hash?i.exec("open",h.hash).done((function(){i.one("cwdrender",(function(){i.selectfiles({files:r}),t=i.res("mixin","make").bind(n)()}))})):(i.selectfiles({files:r}),t=i.res("mixin","make").bind(n)()),t}},(h.prototype.commands.back=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+left backspace"}],this.getstate=function(){return this.fm.history.canBack()?0:-1},this.exec=function(){return this.fm.history.back()}}).prototype={forceLoad:!0},h.prototype.commands.chmod=function(){this.updateOnSelect=!1;var t=this.fm,n={0:"owner",1:"group",2:"other"},i={read:t.i18n("read"),write:t.i18n("write"),execute:t.i18n("execute"),perm:t.i18n("perm"),kind:t.i18n("kind"),files:t.i18n("files")},o=function(e){return!isNaN(parseInt(e,8))&&parseInt(e,8)<=511||e.match(/^([r-][w-][x-]){3}$/i)};this.tpl={main:'<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"></span>{title}</div>{dataTable}',itemTitle:'<strong>{name}</strong><span id="elfinder-info-kind">{kind}</span>',groupTitle:"<strong>{items}: {num}</strong>",dataTable:'<table id="{id}-table-perm"><tr><td>{0}</td><td>{1}</td><td>{2}</td></tr></table><div class="">'+i.perm+': <input class="elfinder-tabstop elfinder-focus" id="{id}-perm" type="text" size="4" maxlength="3" value="{value}"></div>',fieldset:'<fieldset id="{id}-fieldset-{level}"><legend>{f_title}{name}</legend>
162<input type="checkbox" value="4" class="elfinder-tabstop" id="{id}-read-{level}-perm"{checked-r}> <label for="{id}-read-{level}-perm">'+i.read+'</label><br><input type="checkbox" value="6" class="elfinder-tabstop" id="{id}-write-{level}-perm"{checked-w}> <label for="{id}-write-{level}-perm">'+i.write+'</label><br><input type="checkbox" value="5" class="elfinder-tabstop" id="{id}-execute-{level}-perm"{checked-x}> <label for="{id}-execute-{level}-perm">'+i.execute+"</label><br>"},this.shortcuts=[{}],this.getstate=function(e){var t=this.fm;return 0==(e=e||t.selected()).length&&(e=[t.cwd().hash]),this.checkstate(this.files(e))?0:-1},this.checkstate=function(t){var n,i=t.length;return!(!i||i!==(n=!0,e.grep(t,(function(e){return n=!(!(n&&e.isowner&&e.perm&&o(e.perm))||1!=i&&"directory"==e.mime)}))).length)},this.exec=function(t){var r=this.hashes(t),s=this.files(r);s.length||(r=[this.fm.cwd().hash],s=this.files(r));var a,l,c=this.fm,d=e.Deferred().always((function(){c.enable()})),h=this.tpl,u=s.length,p=s[0],f=c.namespace+"-perm-"+p.hash,m=h.main,g=' checked="checked"',v=function(){var t,n=e("#"+f+"-perm").val().trim();if(!o(n))return!1;w.elfinderdialog("close"),t={cmd:"chmod",targets:r,mode:n},c.request({data:t,notify:{type:"chmod",cnt:u}}).fail((function(e){d.reject(e)})).done((function(n){n.changed&&n.changed.length&&(n.undo={cmd:"chmod",callback:function(){var t=[];return e.each(_,(function(e,n){t.push(c.request({data:{cmd:"chmod",targets:n,mode:e},notify:{type:"undo",cnt:n.length}}))})),e.when.apply(null,t)}},n.redo={cmd:"chmod",callback:function(){return c.request({data:t,notify:{type:"redo",cnt:r.length}})}}),d.resolve(n)}))},b=function(){for(var t,i="",o=0;o<3;o++)t=0,e("#"+f+"-read-"+n[o]+"-perm").is(":checked")&&(t|=4),e("#"+f+"-write-"+n[o]+"-perm").is(":checked")&&(t|=2),e("#"+f+"-execute-"+n[o]+"-perm").is(":checked")&&(t|=1),i+=t.toString(8);e("#"+f+"-perm").val(i)},y=function(e){if(isNaN(parseInt(e,8))){for(var t=e.split(""),n=[],i=0,o=t.length;i<o;i++)0===i||3===i||6===i?t[i].match(/[r]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0):1===i||4===i||7===i?t[i].match(/[w]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0):t[i].match(/[x]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0);n.splice(3,0,","),n.splice(7,0,",");for(var r=n.join("").split(","),s=[],a=0,l=r.length;a<l;a++){var c=parseInt(r[a],2).toString(8);s.push(c)}e=s.join("")}else e=parseInt(e,8).toString(8);return e},x={title:this.title,width:"auto",buttons:function(){var e={};return e[c.i18n("btnApply")]=v,e[c.i18n("btnCancel")]=function(){w.elfinderdialog("close")},e}(),close:function(){e(this).elfinderdialog("destroy")}},w=c.getUI().find("#"+f),_={},k="";return w.length?(w.elfinderdialog("toTop"),e.Deferred().resolve()):(m=m.replace("{class}",u>1?"elfinder-cwd-icon-group":c.mime2class(p.mime)),u>1?a=h.groupTitle.replace("{items}",c.i18n("items")).replace("{num}",u):(a=h.itemTitle.replace("{name}",p.name).replace("{kind}",c.mime2kind(p)),k=c.tmb(p)),l=function(e,t){for(var o,r,s,a="",l=h.dataTable,d=0;d<3;d++)a+=(o=parseInt(e.slice(d,d+1),8)).toString(8),r=h.fieldset.replace("{f_title}",c.i18n(n[d])).replace("{name}",(s=t[n[d]],s?":"+s:"")).replace(/\{level\}/g,n[d]),l=l.replace("{"+d+"}",r).replace("{checked-r}",4==(4&o)?g:"").replace("{checked-w}",2==(2&o)?g:"").replace("{checked-x}",1==(1&o)?g:"");return l=l.replace("{value}",a).replace("{valueCaption}",i.perm)}(function(e){for(var t,n,i,o="777",r="",s=e.length,a=0;a<s;a++){t=y(e[a].perm),_[t]||(_[t]=[]),_[t].push(e[a].hash),r="";for(var l=0;l<3;l++)n=parseInt(t.slice(l,l+1),8),i=parseInt(o.slice(l,l+1),8),4!=(4&n)&&4==(4&i)&&(i-=4),2!=(2&n)&&2==(2&i)&&(i-=2),1!=(1&n)&&1==(1&i)&&(i-=1),r+=i.toString(8);o=r}return o}(s),1==s.length?s[0]:{}),m=m.replace("{title}",a).replace("{dataTable}",l).replace(/{id}/g,f),(w=this.fmDialog(m,x)).attr("id",f),k&&e("<img/>").on("load",(function(){w.find(".elfinder-cwd-icon").addClass(k.className).css("background-image","url('"+k.url+"')")})).attr("src",k.url),e("#"+f+"-table-perm :checkbox").on("click",(function(){b()})),e("#"+f+"-perm").on("keydown",(function(t){if(t.keyCode==e.ui.keyCode.ENTER)return t.stopPropagation(),void v()}
162)).on("focus",(function(t){e(this).trigger("select")})).on("keyup",(function(t){3==e(this).val().length&&(e(this).trigger("select"),function(t){for(var i,o=0;o<3;o++)i=parseInt(t.slice(o,o+1),8),e("#"+f+"-read-"+n[o]+"-perm").prop("checked",!1),e("#"+f+"-write-"+n[o]+"-perm").prop("checked",!1),e("#"+f+"-execute-"+n[o]+"-perm").prop("checked",!1),4==(4&i)&&e("#"+f+"-read-"+n[o]+"-perm").prop("checked",!0),2==(2&i)&&e("#"+f+"-write-"+n[o]+"-perm").prop("checked",!0),1==(1&i)&&e("#"+f+"-execute-"+n[o]+"-perm").prop("checked",!0);b()}(e(this).val()))})),d)}},h.prototype.commands.colwidth=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.getstate=function(){return"fixed"===this.fm.getUI("cwd").find("table").css("table-layout")?0:-1},this.exec=function(){return this.fm.getUI("cwd").trigger("colwidth"),e.Deferred().resolve()}},h.prototype.commands.copy=function(){this.shortcuts=[{pattern:"ctrl+c ctrl+insert"}],this.getstate=function(t){var n,i,o=this.files(t),r=o.length;return r&&(n=o,i=!0,e.grep(n,(function(e){return i=!(!i||!e.read)}))).length==r?0:-1},this.exec=function(t){var n=this.fm,i=e.Deferred().fail((function(e){n.error(e)}));return e.each(this.files(t),(function(e,t){if(!t.read)return!i.reject(["errCopy",t.name,"errPerm"])})),"rejected"==i.state()?i:i.resolve(n.clipboard(this.hashes(t)))}},h.prototype.commands.cut=function(){var t=this.fm;this.shortcuts=[{pattern:"ctrl+x shift+insert"}],this.getstate=function(n){var i,o,r=this.files(n),s=r.length;return s&&(i=r,o=!0,e.grep(i,(function(e){return o=!(!o||!e.read||e.locked||t.isRoot(e))}))).length==s?0:-1},this.exec=function(n){var i=e.Deferred().fail((function(e){t.error(e)}));return e.each(this.files(n),(function(e,n){return!n.read||n.locked||t.isRoot(n)?!i.reject(["errCopy",n.name,"errPerm"]):n.locked?!i.reject(["errLocked",n.name]):void 0})),"rejected"==i.state()?i:i.resolve(t.clipboard(this.hashes(n),!0))}},h.prototype.commands.zipdl=function(){},h.prototype.commands.download=function(){var t=this,n=this.fm,i=null,o=!1,r=!1,s=!1,a=window.location.pathname||"/",l=function(s,a){var l,c;if(null!==i&&(n.searchStatus.state>1?r=n.searchStatus.mixed:n.leafRoots[n.cwd().hash]&&(l=n.cwd().volumeid,e.each(s,(function(e,t){if(0!==t.indexOf(l))return r=!0,!1}))),o=n.isCommandEnabled("zipdl",s[0])),r){if(c=i?"zipdl":"download",!(s=e.grep(s,(function(e){var t=n.file(e),o=!(!t||!i&&"directory"===t.mime||!n.isCommandEnabled(c,e));return t&&a&&!o&&n.cwdHash2Elm(t.hash).trigger("unselect"),o}))).length)return[]}else if(!n.isCommandEnabled("download",s[0]))return[];return e.grep(t.files(s),(function(e){var t=!(!e.read||!o&&"directory"==e.mime);return a&&!t&&n.cwdHash2Elm(e.hash).trigger("unselect"),t}))};this.linkedCmds=["zipdl"],this.shortcuts=[{pattern:"shift+enter"}],this.getstate=function(e){var t=this.hashes(e),i=t.length,r=this.options.maxRequests||10;return i<1?-1:(i=l(t).length)&&(o||i<=r&&(!n.UA.IE&&!n.UA.Mobile||1==i))?0:-1},n.bind("contextmenu",(function(n){var i,o,r,s=t.fm,a=null,l=function(t){var n=t.url||s.url(t.hash);return{icon:"link",node:e("<a></a>").attr({href:n,target:"_blank",title:s.i18n("link")}).text(t.name).on("mousedown click touchstart touchmove touchend contextmenu",(function(e){e.stopPropagation()})).on("dragstart",(function(n){var i,o,r,l,c=n.dataTransfer||n.originalEvent.dataTransfer||null;if(a=null,c){c.effectAllowed="copyLink",c.setDragImage&&(a=e('<div class="elfinder-drag-helper html5-native">').append((i=t,r=i.mime,l=s.tmb(i),o='<div class="elfinder-cwd-icon '+s.mime2class(r)+' ui-corner-all"></div>',l&&(o=e(o).addClass(l.className).css("background-image","url('"+l.url+"')").get(0).outerHTML),o)).appendTo(e(document.body)),c.setDragImage(a.get(0),50,47)),s.UA.IE||(c.setData("elfinderfrom",window.location.href+t.phash),c.setData("elfinderfrom:"+c.getData("elfinderfrom"),""))}})).on("dragend",(function(e){a&&a.remove()}))}};(t.extra=null,n.data)&&(1===(i=n.data.targets||[]).length&&(o=s.file(i[0]))&&"directory"!==o.mime&&("1"!=o.url?t.extra=l(o):(t.extra={icon:"link",node:e("<a></a>").attr({href:"#",title:s.i18n("getLink"),draggable:"false"}).text(o.name).on("click touchstart",(function(e){if(!("touchstart"===e.type&&e.originalEvent.touches.length>1)){var t=r.parent();e.stopPropagation(),e.preventDefault(),t.removeClass("ui-state-disabled").addClass("elfinder-button-icon-spinner"),s.request({data:{cmd:"url",target:o.hash},preventDefault:!0}).always((function(e){(t.removeClass("elfinder-button-icon-spinner"),e.url)?(s.file(o.hash).url=e.url,r.replaceWith(l(o).node)):t.addClass("ui-state-disabled")}))}}))},(r=t.extra.node).ready((function(){requestAnimationFrame((function(){r.parent().addClass("ui-state-disabled").css("pointer-events","auto")}))})))))})).one("open",(function(){n.api>=2.1012&&(i=n.getCommand("zipdl")),s=n.cookieEnabled&&n.api>2.1038&&!n.isCORS})),this.exec=function(n){var i,c,d,h,u,p,f,m,g,v=this.hashes(n),b=this.fm,y=(b.options.url,l(v,!0)),x=e.Deferred(),w="",_={},k=!1,C=function(e){var t;"function"==typeof MouseEvent?t=new MouseEvent("click"):(t=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,
162!1,!1,0,null),b.pauseUnloadCheck(!0),e.dispatchEvent(t)},S=function(e){var t="elfdl"+e;2===document.cookie.split(t+"=").length?(p&&clearTimeout(p),document.cookie=t+"=; path="+a+"; max-age=0",T()):setTimeout((function(){S(e)}),200)},T=function(){b.ui.notify.children(".elfinder-notify-download").length&&b.notify({type:"download",cnt:-1})},E=[];if(!y.length)return x.reject();if(u=e.grep(y,(function(e){return"directory"!==e.mime})).length,d=e("<a>").hide().appendTo("body"),h="string"==typeof d.get(0).download,o&&(u!==y.length||u>=(this.options.minFilesZipdl||1)))return d.remove(),k=!h&&b.UA.Mobile,r?(_={},e.each(y,(function(e,t){var n=t.hash.split("_",2);_[n[0]]?_[n[0]].push(t.hash):_[n[0]]=[t.hash]})),!k&&b.UA.Mobile&&Object.keys(_).length>1&&(k=!0)):_=[e.map(y,(function(e){return e.hash}))],x=b.sequence(e.map(_,(function(n){return function(n){return function(){var i,o,r,s=e.Deferred(),a=b.file(b.root(n[0])),l=1===n.length,d=a?a.i18||a.name:null;return l?(i=b.file(n[0]))&&(o=i.i18||i.name):(e.each(n,(function(){var e=b.file(this);if(!e||r&&r!==e.phash)return r=null,!1;r=e.phash})),r&&(i=b.file(r))&&(o=(i.i18||i.name)+"-"+n.length)),o&&(d=o),d&&(d=" ("+d+")"),b.request({data:{cmd:"zipdl",targets:n},notify:{type:"zipdl",cnt:1,hideCnt:!0,msg:b.i18n("ntfzipdl")+d},cancel:!0,eachCancel:!0,preventDefault:!0}).done((function(i){var r,a,l,d,u,p,f={},m="dlw"+ +new Date,g=function(n){l=e("<a></a>").attr("href",n).attr("download",b.escape(o)).on("click",(function(){s.resolve(),a&&a.elfinderdialog("destroy")})),k?(l.attr("target","_blank").append('<span class="elfinder-button-icon elfinder-button-icon-download"></span>'+b.escape(o)),f[b.i18n("btnCancel")]=function(){a.elfinderdialog("destroy")},a=t.fmDialog(l,{title:b.i18n("link"),buttons:f,width:"200px",destroyOnClose:!0,close:function(){"resolved"!==s.state()&&s.resolve()}})):(C(l.hide().appendTo("body").get(0)),l.remove())};i.error?(b.error(i.error),s.resolve()):i.zipdl&&(r=i.zipdl,o?(p=b.splitFileExtention(r.name||""),o+=p[1]?"."+p[1]:".zip"):o=r.name,h||k?(c=b.o
162ptions.url+(-1===b.options.url.indexOf("?")?"?":"&")+"cmd=zipdl&download=1",e.each([n[0],r.file,o,r.mime],(function(e,t){c+="&targets%5B%5D="+encodeURIComponent(t)})),e.each(b.customData,(function(e,t){c+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)})),c+="&"+encodeURIComponent(o),b.hasParrotHeaders()?b.getBinaryByUrl({url:c},(function(e){e instanceof Blob?(c=(window.URL||window.webkitURL).createObjectURL(e),g(c)):b.error(["errUploadTransfer",b.i18n("kindZIP")])})):g(c)):(d=e('<form action="'+b.options.url+'" method="post" target="'+m+'" style="display:none"></form>').append('<input type="hidden" name="cmd" value="zipdl"/>').append('<input type="hidden" name="download" value="1"/>'),e.each([n[0],r.file,o,r.mime],(function(e,t){d.append('<input type="hidden" name="targets[]" value="'+b.escape(t)+'"/>')})),e.each(b.customData,(function(e,t){d.append('<input type="hidden" name="'+e+'" value="'+b.escape(t)+'"/>')})),d.attr("target",m).appendTo("body"),u=e('<iframe style="display:none" name="'+m+'">').appendTo("body").ready((function(){d.submit().remove(),s.resolve(),setTimeout((function(){u.remove()}),2e4)}))))})).fail((function(e){e&&b.error(e),s.resolve()})),s.promise()}}(n)}))).always((function(){b.trigger("download",{files:y})}));for(E=[],m=e.Deferred().done((function(t){for(i=0;i<t.length;i++)c=t[i],s&&c.substr(0,b.options.url.length)===b.options.url&&(f=b.getRequestId(),E.push(f),c+="&cpath="+a+"&reqid="+f,p=setTimeout((function(){b.notify({type:"download",cnt:1,cancel:b.UA.IE||b.UA.Edge?void 0:function(){E.length&&e.each(E,(function(){b.request({data:{cmd:"abort",id:this},preventDefault:!0})})),E=[]}})}),b.notifyDelay),S(f)),h?C(d.attr("href",c).attr("download",b.escape(y[i].name)).get(0)):b.UA.Mobile?setTimeout((function(){window.open(c)||(b.error("errPopup"),p&&cleaerTimeout(p),T())}),100):w+='<iframe class="downloader" id="downloader-'+y[i].hash+'" style="display:none" src="'+c+'"></iframe>';d.remove(),e(w).appendTo("body").ready((function(){setTimeout((function(){e(w).each((function(){e("#"+e(this).attr("id")).remove()}))}),2e4+1e4*i)})),b.trigger("download",{files:y}),x.resolve()})),u=y.length,g=[],i=0;i<y.length;i++)b.openUrl(y[i].hash,!0,(function(e){e&&g.push(e),--u<1&&m.resolve(g)}));return x}},h.prototype.commands.duplicate=function(){var t=this.fm;this.getstate=function(n){var i,o,r=this.files(n),s=r.length;return s&&t.cwd().write&&(i=r,o=!0,e.grep(i,(function(e){return o=!(!o||!e.read||e.phash!==t.cwd().hash||t.isRoot(e))}))).length==s?0:-1},this.exec=function(t){var n=this.fm,i=this.files(t),o=i.length,r=e.Deferred().fail((function(e){e&&n.error(e)}));return o?(e.each(i,(function(e,t){if(!t.read||!n.file(t.phash).write)return!r.reject(["errCopy",t.name,"errPerm"])})),"rejected"==r.state()?r:n.request({data:{cmd:"duplicate",targets:this.hashes(t)},notify:{type:"copy",cnt:o},navigate:{toast:{inbuffer:{msg:n.i18n(["complete",n.i18n("cmdduplicate")])}}}})):r.reject()}},h.prototype.commands.edit=function(){var t,n=this,i=this.fm,o=i.res("class","editing"),r=[],s=[],a=!1,l=function(t){var o,r=e('<select class="ui-corner-all"></select>');return t&&e.each(t,(function(e,t){o=i.escape(t.value),r.append('<option value="'+o+'">'+(t.caption?i.escape(t.caption):o)+"</option>")})),e.each(n.options.encodings,(function(e,t){r.append('<option value="'+t+'">'+t+"</option>")})),r},c=function(){if(n.options.dialogHeight){var t,o,r=i.options.dialogContained?i.getUI():e(window);return o="string"==typeof n.options.dialogHeight&&(t=n.options.dialogHeight.match(/(\d+)%/))?parseInt(r.height()*(t[1]/100)):parseInt(n.options.dialogHeight||r.height()),Math.min(o,r.height())}},d=function(t){var o,l,c,d=t.length;return d>1&&(o=t[0].mime,l=t[0].name.replace(/^.*(\.[^.]+)$/,"$1")),e.grep(t,(function(t){var h;return!c&&"directory"!==t.mime&&((h=t.read&&(a||i.mimeIsText(t.mime)||-1!==e.inArray(t.mime,1===d?r:s))&&(!n.onlyMimes.length||-1!==e.inArray(t.mime,n.onlyMimes))&&(1===d||t.mime===o&&t.name.substr(-1*l.length)===l)&&!!i.uploadMimeCheck(t.mime,t.phash)&&m(t,d)&&Object.keys(p).length)||(c=!0),h)}))},h=function(e){var t,n=i.file(e);i.request({cmd:"info",targets:[e],preventDefault:!0}).done((function(e){var o;e&&e.files&&e.files.length&&(t=e.files[0],n.ts==t.ts&&n.size==t.size||(o={changed:[t]},i.updateCache(o),i.change(o)))}))},u=function(t,r,s){var a,d,p,f=t.hash,m=(i.options,e.Deferred()),g="edit-"+i.namespace+"-"+t.hash,v=i.getUI().find("#"+g),y=r||0,x=!1;if(v.length)return v.elfinderdialog("toTop"),m.resolve();if(!(t.read&&(t.write||s.info&&s.info.converter)))return d=["errOpen",t.name,"errPerm"],m.reject(d);if(s&&s.info){if("function"==typeof s.info.edit)return(p=s.info.edit.call(i,t,s)).promise?p.done((function(){m.resolve()})).fail((function(e){m.reject(e)})):p?m.resolve():m.reject(),m;x=s.info.preventGet||s.info.noContent,s.info.urlAsContent||x?(a=e.Deferred(),s.info.urlAsContent?i.url(f,{async:!0,onetime:!0,temporary:!0}).done((function(e){a.resolve({content:e})})):a.resolve({})):(y&&(t.encoding=y,i.cache(t,"change")),a=i.request({data:{cmd:"get",target:f,conv:y,_t:t.ts}
162,options:{type:"get",cache:!0},notify:{type:"file",cnt:1},preventDefault:!0})),a.done((function(r){var a,d,p;r.doconv?i.confirm({title:n.title,text:"unknown"===r.doconv?"confirmNonUTF8":"confirmConvUTF8",accept:{label:"btnConv",callback:function(){m=u(t,a.val(),s)}},cancel:{label:"btnCancel",callback:function(){m.reject()}},optionsCallback:function(t){t.create=function(){var t=e('<div class="elfinder-dialog-confirm-encoding"></div>'),n={value:r.doconv};"unknown"===r.doconv&&(n.caption="-"),a=l([n]),e(this).next().find(".ui-dialog-buttonset").prepend(t.append(e("<label>"+i.i18n("encoding")+" </label>").append(a)))}}}):(!x&&i.mimeIsText(t.mime)&&(d=new RegExp("^(data:"+t.mime.replace(/([.+])/g,"\\$1")+";base64,)","i"),s.info.dataScheme?window.btoa&&!r.content.match(d)&&(r.content="data:"+t.mime+";base64,"+btoa(r.content)):window.atob&&(p=r.content.match(d))&&(r.content=atob(r.content.substr(p[1].length)))),function(t,r,s,a,d,p){var f,m,g,v,y,x,w,_,k,C=e.Deferred(),S=!1,T=function(){return!!S||(i.toast({mode:"warning",msg:i.i18n("nowLoading")}),!1)},E=function(){p&&Array.isArray(p)&&e.each(p,(function(){this.msg&&i.toast(this)}))},A=function(){var t,n,o,r=v?v.val():void 0,s=e.Deferred().fail((function(e){g.show().find("button.elfinder-btncnt-0,button.elfinder-btncnt-1").hide()}));return T()?(f.editor&&(f.editor.save(f[0],f.editor.instance),(t=f.editor.confObj).info&&(t.info.schemeContent||t.info.arrayBufferContent)&&(r="scheme")),n=z(),N(n),n.promise?(o=setTimeout((function(){i.notify({type:"chkcontent",cnt:1,hideCnt:!0,cancel:function(){n.reject()}})}),100),n.always((function(){o&&clearTimeout(o),i.notify({type:"chkcontent",cnt:-1})})).done((function(e){C.notifyWith(f,[r,f.data("hash"),m,s])})).fail((function(e){s.reject(e)}))):C.notifyWith(f,[r,f.data("hash"),m,s]),s):s.resolve()},O=function(){T()&&A().fail((function(e){e&&i.error(e)}))},D=function(){if(n.options.confirmUnsavedBeforeClose){var t=function(){var e;C.resolve(),f.editor&&(f.editor.close(f[0],f.editor.instance),(e=f.editor.confObj).info&&e.info.syncInterval&&h(r.hash)),f.elfinderdialog("destroy")},o=void 0!==j.name,s=o?{label:"btnSaveAs",callback:function(){requestAnimationFrame(P)}}:{label:"btnSaveClose",callback:function(){A().done((function(){t()}))}};M().done((function(r){var a=["confirmNotSave"],l={label:"btnDiscard",callback:function(){t()}};r?("string"==typeof r&&a.unshift(r),i.confirm({title:n.title,text:a,accept:s,cancel:{label:"btnCancel",callback:e.n
162oop},buttons:o?[l]:[{label:"btnSaveAs",callback:function(){f.elfinderdialog("destroy"),requestAnimationFrame(P)}},l]})):t()}))}else f.elfinderdialog("close")},I=function(){T()&&(g.hide(),A().done((function(){S=!1,g.show(),D()})).fail((function(e){g.show(),e&&i.error(e)})))},P=function(){if(T()){var t=m,s=r.phash,a=function(e){h.addClass(o).fadeIn((function(){e&&i.error(e)})),m=t,i.disable()},l=function(){n.mime=j.mime||r.mime,n.prefix=(j.name||r.name).replace(/ \d+(\.[^.]+)?$/,"$1"),n.requestCmd="mkfile",n.nextAction={},n.data={target:s},i.res("mixin","make").bind(n)().done((function(e){var t;e.added&&e.added.length?(t=f.data("hash"),f.data("hash",e.added[0].hash),A().done((function(){S=!1,g.show(),D(),h.fadeIn()})).fail((function(){i.exec("rm",[e.added[0].hash],{forceRm:!0,quiet:!0}),f.data("hash",t),g.find("button.elfinder-btncnt-2").hide(),a()}))):a()})).progress((function(e){e&&"errUploadMime"===e&&f.trigger("saveAsFail")})).fail(a).always((function(){delete n.mime,delete n.prefix,delete n.nextAction,delete n.data})),i.trigger("unselectfiles",{files:[r.hash]})},c=null,d=null,h=i.getUI().children("."+n.dialogClass+":visible");g.is(":hidden")&&(h=h.add(g)),h.removeClass(o).fadeOut(),i.enable(),i.searchStatus.state<2&&s!==i.cwd().hash?c=i.exec("open",[s],{thash:s}):i.file(s)||(d=i.request({cmd:"info",targets:[s]})),e.when([c,d]).done((function(){d?i.one("infodone",(function(){i.file(s)?l():a("errFolderNotFound")})):c?i.one("cwdrender",l):l()})).fail(a)}},M=function(){var t,n,o=e.Deferred();return S?(f.editor&&f.editor.save(f[0],f.editor.instance),(t=z())&&t.promise?(n=setTimeout((function(){i.notify({type:"chkcontent",cnt:1,hideCnt:!0,cancel:function(){t.reject()}})}),100),t.always((function(){n&&clearTimeout(n),i.notify({type:"chkcontent",cnt:-1})})).done((function(e){o.resolve(m!==e)})).fail((function(e){o.resolve(e||void 0!==m)}))):o.resolve(m!==t),o):o.resolve(!1)},R={title:i.escape(r.name),width:(k=i.options.dialogContained?i.getUI():e(window),_="string"==typeof n.options.dialogWidth&&(w=n.options.dialogWidth.match(/(\d+)%/))?parseInt(k.width()*(w[1]/100)):parseInt(n.options.dialogWidth||650),Math.min(_,k.width())),height:c(),buttons:{},cssClass:o,maxWidth:"window",maxHeight:"window",allowMinimize:!0,allowMaximize:!0,openMaximized:b()||d&&d.info&&d.info.openMaximized,btnHoverFocus:!1,closeOnEscape:!1,propagationEvents:["mousemove","mouseup","click"],minimize:function(){var e;f.editor&&g.closest(".ui-dialog").is(":hidden")&&(e=f.editor.confObj).info&&e.info.syncInterval&&h(r.hash)},headerBtnCloseAction:n.options.confirmUnsavedBeforeClose?function(){D()}:void 0,close:function(){if(!n.options.confirmUnsavedBeforeClose){var e=function(){var e;C.resolve(),f.editor&&(f.editor.close(f[0],f.editor.instance),(e=f.editor.confObj).info&&e.info.syncInterval&&h(r.hash)),f.elfinderdialog("destroy")},t=void 0!==j.name,o=t?{label:"btnSaveAs",callback:function(){requestAnimationFrame(P)}}:{label:"btnSaveClose",callback:function(){A().done((function(){e()}))}};M().done((function(r){var s=["confirmNotSave"];r?("string"==typeof r&&s.unshift(r),i.confirm({title:n.title,text:s,accept:o,cancel:{label:"btnClose",callback:e},buttons:t?null:[{label:"btnSaveAs",callback:function(){requestAnimationFrame(P)}}]})):e()}))}},open:function(){var e,n,o;if(f.initEditArea.call(f,t,r,s,i),f.editor){if((e=f.editor.load(f[0])||null)&&e.done)e.always((function(){S=!0})).done((function(e){f.editor.instance=e,f.editor.focus(f[0],f.editor.instance),N(z()),requestAnimationFrame((function(){g.trigger("resize")}))})).fail((function(e){e&&i.error(e),f.elfinderdialog("destroy")})).always(E);else{if(S=!0,e&&("string"==typeof e||Array.isArray(e)))return i.error(e),void f.elfinderdialog("destroy");f.editor.instance=e,f.editor.focus(f[0],f.editor.instance),N(z()),requestAnimationFrame((function(){g.trigger("resize")})),E()}(n=f.editor.confObj).info&&n.info.syncInterval&&(o=parseInt(n.info.syncInterval))&&setTimeout((function(){F(o)}),o)}else S=!0,N(z())},resize:function(e,t){f.editor&&f.editor.resize(f[0],f.editor.instance,e,t||{})}},z=function(){var t=f.getContent.call(f,f[0]);return void 0!==t&&!1!==t&&null!==t||(t=e.Deferred().reject()),t},N=function(e){e&&e.promise?e.done((function(e){m=e}
162)):m=e},F=function(e){g.is(":visible")&&(h(r.hash),setTimeout((function(){F(e)}),e))},L=function(){v&&M().done((function(e){e?v.attr("title",i.i18n("saveAsEncoding")).addClass("elfinder-edit-changed"):v.attr("title",i.i18n("openAsEncoding")).removeClass("elfinder-edit-changed")}))},j={};if(d&&(d.html&&(f=e(d.html)),y={init:d.init||null,load:d.load,getContent:d.getContent||null,save:d.save,beforeclose:"function"==typeof d.beforeclose?d.beforeclose:void 0,close:"function"==typeof d.close?d.close:function(){},focus:"function"==typeof d.focus?d.focus:function(){},resize:"function"==typeof d.resize?d.resize:function(){},instance:null,doSave:O,doCancel:D,doClose:I,file:r,fm:i,confObj:d,trigger:function(e,t){i.trigger("editEditor"+e,Object.assign({},d.info||{},t))}}),!f){if(!i.mimeIsText(r.mime))return C.reject("errEditorNotFound");f=e('<textarea class="elfinder-file-edit" rows="20" id="'+t+'-ta"></textarea>').on("input propertychange",L),d&&d.info&&!d.info.useTextAreaEvent||f.on("keydown",(function(t){var n,i,o=t.keyCode;t.stopPropagation(),o==e.ui.keyCode.TAB&&(t.preventDefault(),this.setSelectionRange&&(n=this.value,i=this.selectionStart,this.value=n.substr(0,i)+"\t"+n.substr(this.selectionEnd),i+=1,this.setSelectionRange(i,i))),(t.ctrlKey||t.metaKey)&&(o!="Q".charCodeAt(0)&&o!="W".charCodeAt(0)||(t.preventDefault(),D()),o=="S".charCodeAt(0)&&(t.preventDefault(),O()))})).on("mouseenter",(function(){this.focus()})),f.initEditArea=function(e,t,n){f.hide().val(n),this._setupSelEncoding(n)}}return f._setupSelEncoding=function(t){var n=a&&"unknown"!==a?[{value:a}]:[],o=e("<select></select>").hide(),s=function(t){t&&o.appendTo(v.parent()),o.empty().append(e("<option></option>").text(v.val())),v.width(o.width())};""!==t&&a&&"UTF-8"===a||n.push({value:"UTF-8"}),v=l(n).on("touchstart",(function(e){e.stopPropagation()})).on("change",(function(){M().done((function(e){e||""===z()||(D(),u(r,v.val(),d).fail((function(e){e&&i.error(e)})))})),s()})).on("mouseover",L),f.parent().next().prepend(e('<div class="ui-dialog-buttonset elfinder-edit-extras"></div>').append(v)),s(!0)},f.data("hash",r.hash),y&&(f.editor=y,"function"==typeof y.beforeclose&&(R.beforeclose=function(){return y.beforeclose(f[0],y.instance)}),"function"==typeof y.init&&(f.initEditArea=y.init),"function"==typeof y.getContent&&(f.getContent=y.getContent)),f.initEditArea||(f.initEditArea=function(){}),f.getContent||(f.getContent=function(){return f.val().replace(/\s+$/,"")}),d&&d.info&&d.info.preventGet||(R.buttons[i.i18n("btnSave")]=O,R.buttons[i.i18n("btnSaveClose")]=I,R.buttons[i.i18n("btnSaveAs")]=P,R.buttons[i.i18n("btnCancel")]=D),d&&"function"==typeof d.prepare&&d.prepare(f,R,r),g=n.fmDialog(f,R).attr("id",t).on("keydown keyup keypress",(function(e){e.stopPropagation()})).css({overflow:"hidden",minHeight:"7em"}).addClass("elfinder-edit-editor").closest(".ui-dialog").on("changeType",(function(t,n){if(n.extention&&n.mime){n.extention,n.mime;var o=e(this).children(".ui-dialog-buttonpane").children(".ui-dialog-buttonset");o.children(".elfinder-btncnt-0,.elfinder-btncnt-1").hide(),j.name=i.splitFileExtention(r.name)[0]+"."+n.extention,j.mime=n.mime,n.keepEditor||o.children(".elfinder-btncnt-2").trigger("click")}})),x=(i.options.dialogContained?i.getUI():e(window)).width(),g.width()>x&&g.width(x),C.promise()}(g,t,r.content,r.encoding,s,r.toasts).done((function(e){m.resolve(e)})).progress((function(e,t,n,o){var r=this;t&&(f=t),i.request({options:{type:"post"},data:{cmd:"put",target:f,encoding:e||n.encoding,content:n},notify:{type:"save",cnt:1},syncOnFail:!0,preventFail:!0,navigate:{target:"changed",toast:{inbuffer:{msg:i.i18n(["complete",i.i18n("btnSave")])}}}}).fail((function(e){m.reject(e),o.reject()})).done((function(e){requestAnimationFrame((function(){r.trigger("focus"),r.editor&&r.editor.focus(r[0],r.editor.instance)})),o.resolve()}))})).fail((function(e){m.reject(e)})))})).fail((function(e){var n=i.parseError(e);n=Array.isArray(n)?n[0]:n,t.encoding&&(t.encoding="",i.cache(t,"change")),"errConvUTF8"!==n&&i.sync(),m.reject(e)}))}return m.promise()},p={}
162,f={info:{id:"textarea",name:"TextArea",useTextAreaEvent:!0},load:function(t){this.trigger("Prepare",{node:t,editorObj:void 0,instance:void 0,opts:{}}),t.setSelectionRange&&t.setSelectionRange(0,0),e(t).trigger("focus").show()},save:function(){}},m=function(o,r){var s=n.options.editors||[],a=i.cwd().write;return t=i.storage("storedEditors")||{},p={},s.length||(s=[f]),e.each(s,(function(t,n){var s;(1===r||!n.info.single)&&(n.info&&n.info.converter?a:o.write)&&(o.size>0||!n.info.converter&&!1!==n.info.canMakeEmpty&&i.mimesCanMakeEmpty[o.mime])&&(!n.info.maxSize||o.size<=n.info.maxSize)&&function(t,n){if(n){if("*"===n[0]||-1!==e.inArray(t,n))return!0;var o,r;for(r=n.length,o=0;o<r;o++)if(0===t.indexOf(n[o]))return!0;return!1}return i.mimeIsText(t)}(o.mime,n.mimes||null)&&function(e,t){if(!t||!t.length)return!0;var n,i,o=e.replace(/^.+\.([^.]+)|(.+)$/,"$1$2").toLowerCase();for(i=t.length,n=0;n<i;n++)if(o===t[n].toLowerCase())return!0;return!1}(o.name,n.exts||null)&&"function"==typeof n.load&&"function"==typeof n.save&&(s=n.info.name?n.info.name:"Editor "+t,n.id=n.info.id?n.info.id:"editor"+t,n.name=s,n.i18n=i.i18n(s),p[n.id]=n)})),!!Object.keys(p).length},g=function(n,o){n&&o&&(e.isPlainObject(t)||(t={}),t[n]=o.id,i.storage("storedEditors",t),i.trigger("selectfiles",{files:i.selected()}))},v=function(){var e=i.storage("useStoredEditor");return e?e>0:n.options.useStoredEditor},b=function(){var e=i.storage("editorMaximized");return e?e>0:n.options.editorMaximized},y=function(t,n){var o=[];return e.each(p,(function(e,r){o.push({label:i.escape(r.i18n),icon:r.info&&r.info.icon?r.info.icon:"edit",options:{iconImg:r.info&&r.info.iconImg?i.baseUrl+r.info.iconImg:void 0},callback:function(){g(t[0].mime,r),n&&n.call(r)}})})),o},x=function(e){var n=t[e];return n&&Object.keys(p).length?p[function(e){return e.toLowerCase().replace(/ +/g,"")}(n)]:void 0};this.getEncSelect=l,this.shortcuts=[{pattern:"ctrl+e"}],this.init=function(){var t,n,i=this,o=this.fm,l=this.options,c=[];this.onlyMimes=this.options.mimes||[],o.one("open",(function(){l.editors&&Array.isArray(l.editors)&&(o.trigger("canMakeEmptyFile",{mimes:Object.keys(o.storage("mkfileTextMimes")||{}).concat(l.makeTextMimes||["text/plain"])}),e.each(l.editors,(function(e,t){t.info&&t.info.cmdCheck&&c.push(t.info.cmdCheck)})),c.length?o.api>=2.103?n=o.request({data:{cmd:"editor",name:c,method:"enabled"},preventDefault:!0}).done((function(e){t=e})).fail((function(){t={}})):(t={},n=e.Deferred().resolve()):n=e.Deferred().resolve(),n.always((function(){t&&(l.editors=e.grep(l.editors,(function(e){return!e.info||!e.info.cmdCheck||!!t[e.info.cmdCheck]}))),e.each(l.editors,(function(e,t){t.setup&&"function"==typeof t.setup&&t.setup.call(t,l,o),t.disabled||(t.mimes&&Array.isArray(t.mimes)&&(r=r.concat(t.mimes),t.info&&t.info.single||(s=s.concat(t.mimes))),!a&&t.mimes&&"*"===t.mimes[0]&&(a=!0),t.info||(t.info={}),t.info.integrate&&o.trigger("helpIntegration",Object.assign({cmd:"edit"},t.info.integrate)),t.info.canMakeEmpty&&o.trigger("canMakeEmptyFile",{mimes:Array.isArray(t.info.canMakeEmpty)?t.info.canMakeEmpty:t.mimes}))})),r=(e.uniqueSort||e.unique)(r),s=(e.uniqueSort||e.unique)(s),l.editors=e.grep(l.editors,(function(e){return!e.disabled}))})))})).bind("select",(function(){p=null})).bind("contextmenucreate",(function(t){var n,r,s=function(e){var t=i.title;o.one("contextmenucreatedone",(function(){i.title=t})),i.title=o.escape(e.i18n),e.info&&e.info.iconImg&&(i.contextmenuOpts={iconImg:o.baseUrl+e.info.iconImg}),delete i.variants};i.contextmenuOpts=void 0,"files"===t.data.type&&i.enabled()&&(n=o.file(t.data.targets[0]),m(n,t.data.targets.length)&&(Object.keys(p).length>1?v()&&(r=x(n.mime))?(s(r),i.extra={icon:"menu",node:e("<span></span>").attr({title:o.i18n("select")}).on("click touchstart",(function(t){if(!("touchstart"===t.type&&t.originalEvent.touches.length>1)){var n=e(this);t.stopPropagation(),t.preventDefault(),o.trigger("contextmenu",{raw:y(o.selectedFiles(),(function(){var e=o.selected();o.exec("edit",e,{editor:this}),o.trigger("selectfiles",{files:e})})),x:n.offset().left,y:n.offset().top})}}))}):(delete i.extra,i.variants=[],e.each(p,(function(e,t){i.variants.push([{editor:t},t.i18n,t.info&&t.info.iconImg?o.baseUrl+t.info.iconImg:"edit"])}))):(s(p[Object.keys(p)[0]]),delete i.extra)))})).bind("canMakeEmptyFile",(function(t){if(t.data&&t.data.resetTexts){var n=o.arrayFlip(i.options.makeTextMimes||["text/plain"]),r=i.getMkfileHides();e.each(o.storage("mkfileTextMimes")||{},(function(e,t){n[e]||(delete o.mimesCanMakeEmpty[e],delete r[e])})),o.storage("mkfileTextMimes",null),Object.keys(r).length?o.storage("mkfileHides",r):o.storage("mkfileHides",null)}}))},this.getstate=function(e){var t=this.files(e),n=t.length;return n&&d(t).length==n?0:-1},this.exec=function(t,n){var i,o,r=this.fm,s=d(this.files(t)),a=e.map(s,(function(e){return e.hash})),l=[],c=n&&n.editor?n.editor:null,h=e(n&&n._currentNode?n._currentNode:r.cwdHash2Elm(a[0])),f=e.Deferred();return null===p&&m(s[0],a.length),h.length||(h=r.getUI("cwd")),(
162o=e.Deferred(),!c&&Object.keys(p).length>1?v()&&(c=x(s[0].mime))?o.resolve(c):(r.trigger("contextmenu",{raw:y(s,(function(){o.resolve(this)})),x:h.offset().left,y:h.offset().top+22,opened:function(){r.one("closecontextmenu",(function(){requestAnimationFrame((function(){"pending"===o.state()&&o.reject()}))}))}}),r.trigger("selectfiles",{files:a}),o):(Object.keys(p).length>1&&c&&g(s[0].mime,c),o.resolve(c||(Object.keys(p).length?p[Object.keys(p)[0]]:null)))).done((function(t){for(;i=s.shift();)l.push(u(i,i.encoding||void 0,t).fail((function(e){e&&r.error(e)})));l.length?e.when.apply(null,l).done((function(){f.resolve()})).fail((function(){f.reject()})):f.reject()})).fail((function(){f.reject()})),f},this.getMkfileHides=function(){return i.storage("mkfileHides")||i.arrayFlip(n.options.mkfileHideMimes||[])}},h.prototype.commands.empty=function(){var t,n,i=function(e){var i=t.files(e);return i.length||(i=[n.cwd()]),i};this.linkedCmds=["rm"],this.init=function(){t=this,n=this.fm},this.getstate=function(t){var n,o,r,s=i(t);return n=s.length,(o=s,r=!0,e.grep(o,(function(e){return r=!!(r&&e.read&&e.write&&"directory"===e.mime)}))).length==n?0:-1},this.exec=function(t){var o=i(t),r=o.length,s=e.Deferred().done((function(){var t={changed:{}};n.toast({msg:n.i18n(['"'+a.join('", ')+'"',"complete",n.i18n("cmdempty")])}),e.each(o,(function(e,n){t.changed[n.hash]=n})),n.change(t)})).always((function(){var t=n.cwd().hash;n.trigger("selectfiles",{files:e.map(o,(function(e){return t===e.phash?e.hash:null}))})})),a=[],l=function(e){"number"==typeof e?(a.push(o[e].name),delete o[e].dirs):e&&n.error(e),--r<1&&s[a.length?"resolve":"reject"]()};return e.each(o,(function(t,i){var o;return i.write&&"directory"===i.mime?n.isCommandEnabled("rm",i.hash)?(o=setTimeout((function(){n.notify({type:"search",cnt:1,hideCnt:!(r>1)})}),n.notifyDelay),void n.request({data:{cmd:"open",target:i.hash},preventDefault:!0,asNotOpen:!0}).done((function(s){var a=[];o&&clearTimeout(o),n.ui.notify.children(".elfinder-notify-search").length&&n.notify({type:"search",cnt:-1,hideCnt:!(r>1)}),s&&s.files&&s.files.length?s.files.length>n.maxTargets?l(["errEmpty",i.name,"errMaxTargets",n.maxTargets]):(n.updateCache(s),e.each(s.files,(function(e,t){if(!t.write||t.locked)return l(["errEmpty",i.name,"errRm",t.name,"errPerm"]),a=[],!1;a.push(t.hash)})),a.length&&n.exec("rm",a,{_userAction:!0,addTexts:[n.i18n("folderToEmpty",i.name)]}).fail((function(e){n.trigger("unselectfiles",{files:n.selected()}),l(n.parseError(e)||"")})).done((function(){l(t)}))):(n.toast({mode:"warning",msg:n.i18n("filderIsEmpty",i.name)}),l(""))})).fail((function(e){l(n.parseError(e)||"")}))):(l(["errCmdNoSupport",'"rm"']),null):(l(["errEmpty",i.name,"errPerm"]),null)})),s}},h.prototype.commands.extract=function(){var t=this,n=t.fm,i=[];this.variants=[],this.disableOnSearch=!0,n.bind("open reload",(function(){i=n.option("archivers").extract||[],n.api>2?t.variants=[[{makedir:!0},n.i18n("cmdmkdir")],[{},n.i18n("btnCwd")]]:t.variants=[[{},n.i18n("btnCwd")]],t.change()})),this.getstate=function(t){var o,r,s,a,l=this.files(t),c=l.length;return c&&(s=l,a=!0,e.grep(s,(function(t){return a=!(!a||!t.read||-1===e.inArray(t.mime,i))}))).length==c?n.searchStatus.state>0?(o=this.fm.cwd().hash,e.each(l,(function(e,t){return r=t.phash===o})),r?0:-1):this.fm.cwd().write?0:-1:-1},this.exec=function(t,o){var r,s,a,l=this.files(t),c=e.Deferred(),d=l.length,h=o&&o.makedir?1:0,u=!1,p=!1,f=0,m=n.files(l[0].phash),g=[],v={};e.each(m,(function(e,t){v[t.name]=t,g.push(t.name)}));var b=function(e){switch(e){case"overwrite_all":u=!0;break;case"omit_all":p=!0}},y=function(t){t.read&&n.file(t.phash).write?-1===e.inArray(t.mime,i)?(s=["errExtract",t.name,"errNoArchive"],n.error(s),c.reject(s)):n.request({data:{cmd:"extract",target:t.hash,makedir:h},notify:{type:"extract",cnt:1},syncOnFail:!0,navigate:{toast:h?{incwd:{msg:n.i18n(["complete",n.i18n("cmdextract")]),action:{cmd:"open",msg:"cmdopen"}},inbuffer:{msg:n.i18n(["complete",n.i18n("cmdextract")]),action:{cmd:"open",msg:"cmdopen"}}}:{inbuffer:{msg:n.i18n(["complete",n.i18n("cmdextract")])}}}}).fail((function(e){"rejected"!=c.state()&&c.reject(e)})).done((function(){})):(s=["errExtract",t.name,"errPerm"],n.error(s),c.reject(s))},x=function(t,i){var o=t[i],s=n.splitFileExtention(o.name)[0],l=e.inArray(s,g)>=0,m=function(){i+1<d?x(t,i+1):c.resolve()};!h&&l&&"directory"!=v[s].mime?n.confirm({title:n.i18n("ntfextract"),text:["errExists",s,"confirmRepl"],accept:{label:"btnYes",callback:function(e){if(b(a=e?"overwrite_all":"overwrite"),u||p){if(u){for(r=i;r<d;r++)y(t[r]);c.resolve()}}else"overwrite"==a&&y(o),i+1<d?x(t,i+1):c.resolve()}},reject:{label:"btnNo",callback:function(e){b(a=e?"omit_all":"omit"),!u&&!p&&i+1<d?x(t,i+1):p&&c.resolve()}},cancel:{label:"btnCancel",callback:function(){c.resolve()}},all:i+1<d}):h?(y(o),m()):0==f?n.confirm({title:n.i18n("cmdextract"),text:[n.i18n("cmdextract")+' "'+o.name+'"',"confirmRepl"],accept:{label:"btnYes",callback:function(e){e&&(f=1),y(o),m()}},reject:{label:"btnNo",callback:function(e){e&&(f=-1),m()}},cancel:{label:"btnCancel",callback:function(){c.resolve()}},all:i+1<d}):(f>0&&y(o),m())};return this.enabled()&&d&&i.length?(d>0&&x(l,0),c):c.reject()}},(h.prototype.commands.forward=function(){this.alwaysEnabled=!0,this.updateOnSelect=!0,this.shortcuts=[{pattern:"ctrl+right"}],this.getstate=function(){return this.fm.history.canForward()?0:-1},this.exec=function(){return this.fm.history.forward()}}).prototype={forceLoad:!0},h.prototype.commands.fullscreen=function(){var t=this,n=this.fm,i=function(e,i){var o;e.preventDefault(),e.stopPropagation(),i&&i.fullscreen&&(o="on"===i.fullscreen,t.update(void 0,o),t.title=n.i18n(o?"reinstate":"cmdfullscreen"))};this.alwaysEnabled=!0,this.updateOnSelect=!1,this.syncTitleOnChange=!0,this.value=!1,this.options={ui:"fullscreenbutton"},this.getstate=function(){return 0},this.exec=function(){var i=n.getUI().get(0),o=i===n.toggleFullscreen(i);return t.title=n.i18n(o?"reinstate":"cmdfullscreen"),t.update(void 0,o),e.Deferred().resolve()},n.bind("init",(function(){n.getUI().off("resize."+n.namespace,i).on("resize."+n.namespace,i)}))},(h.prototype.commands.getfile=function(){var t=this,n=this.fm;this.alwaysEnabled=!0,this.callback=n.options.getFileCallback,this._disabled="function"==typeof this.callback,this.getstate=function(n){var i,o,r,s=this.files(n),a=s.length;
162return this.callback&&a&&(i=s,o=t.options,r=!0,i=e.grep(i,(function(e){return r=!(!r||"directory"==e.mime&&!o.folders||!e.read)})),o.multiple||1==i.length?i:[]).length==a?0:-1},this.exec=function(n){var i,o,r,s=this.fm,a=this.options,l=this.files(n),c=l.length,d=s.option("url"),h=s.option("tmbUrl"),u=e.Deferred().done((function(e){var n,i=function(){"close"==a.oncomplete?s.hide():"destroy"==a.oncomplete&&s.destroy()},o=function(e){"close"==a.onerror?s.hide():"destroy"==a.onerror?s.destroy():e&&s.error(e)};s.trigger("getfile",{files:e});try{n=t.callback(e,s)}catch(e){return void o(["Error in `getFileCallback`.",e.message])}"object"==typeof n&&"function"==typeof n.done?n.done(i).fail(o):i()})),p=function(t){return a.onlyURL?a.multiple?e.map(l,(function(e){return e.url})):l[0].url:a.multiple?l:l[0]},f=[];for(i=0;i<c;i++){if("directory"==(o=l[i]).mime&&!a.folders)return u.reject();o.baseUrl=d,"1"==o.url?f.push(s.request({data:{cmd:"url",target:o.hash},notify:{type:"url",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){e.url&&(s.file(this.hash).url=this.url=e.url)}.bind(o))):o.url=s.url(o.hash),a.onlyURL||(a.getPath&&(o.path=s.path(o.hash),""===o.path&&o.phash&&function(){var t=e.Deferred();f.push(t),s.path(o.hash,!1,{}).done((function(e){o.path=e})).fail((function(){o.path=""})).always((function(){t.resolve()}))}()),o.tmb&&1!=o.tmb&&(o.tmb=h+o.tmb),o.width||o.height||(o.dim?(r=o.dim.split("x"),o.width=r[0],o.height=r[1]):a.getImgSize&&-1!==o.mime.indexOf("image")&&f.push(s.request({data:{cmd:"dim",target:o.hash},notify:{type:"dim",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){if(e.dim){var t=e.dim.split("x"),n=s.file(this.hash);n.width=this.width=t[0],n.height=this.height=t[1]}}.bind(o)))))}return f.length?(e.when.apply(null,f).always((function(){u.resolve(p())})),u):u.resolve(p())}}).prototype={forceLoad:!0},(h.prototype.commands.help=function(){var t,n,i,o,r,s,a=this.fm,l=this,c='<div class="elfinder-help-link"> <a href="{url}" target="_blank">{link}</a></div>',d='<div class="elfinder-help-team"><div>{author}</div>{work}</div>',h=/\{url\}/,u=/\{link\}/,p=/\{author\}/,f=/\{work\}/,m="replace",g="ui-priority-primary",v="ui-priority-secondary",b="elfinder-help-license",y='<li class="'+a.res("class","tabstab")+' elfinder-help-tab-{id}"><a href="#'+a.namespace+'-help-{id}" class="ui-tabs-anchor">{title}</a></li>',x=['<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-help">','<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-top">'],w='<div class="elfinder-help-separator"></div>',_=e("base").length?a.escape(document.location.href.replace(/#.*$/,"")):"",k=a.res("class","tabsactive"),C=function(){return a.theme&&a.theme.author?d[m]("elfinder-help-team","elfinder-help-team elfinder-help-term-theme")[m](p,a.i18n(a.theme.author)+(a.theme.email?" &lt;"+a.theme.email+"&gt;":""))[m](f,a.i18n("theme")+" ("+a.i18n(a.theme.name)+")"):'<div class="elfinder-help-team elfinder-help-term-theme" style="display:none"></div>'},S=!1,T=!1,E="";this.alwaysEnabled=!0,this.updateOnSelect=!1,this.state=-1,this.shortcuts=[{pattern:"f1",description:this.title}],a.bind("load",(function(){var A,O,D,I,P,M,R,z=l.options.view||["about","shortcuts","help","integrations","debug"];-1!==(A=e.inArray("preference",z))&&z.splice(A,1),e.fn.tabs||-1!==(A=e.inArray(z,"debug"))&&z.splice(A,1),e.each(z,(function(e,t){x.push(y[m](/\{id\}/g,t)[m](/\{title\}/,a.i18n(t)))})),x.push("</ul>"),-1!==e.inArray("about",z)&&(x.push('<div id="'+a.namespace+'-help-about" class="ui-tabs-panel ui-widget-content ui-corner-bottom"><div class="elfinder-help-logo"></div>'),x.push("<h3>elFinder</h3>"),x.push('<div class="'+g+'">'+a.i18n("webfm")+"</div>"),x.push('<div class="'+v+'">'+a.i18n("ver")+": "+a.version+"</div>"),x.push('<div class="'+v+'">'+a.i18n("protocolver")+': <span class="apiver"></span></div>'),x.push('<div class="'+v+'">jQuery/jQuery UI: '+e().jquery+"/"+e.ui.version+"</div>"),x.push(w),x.push(c[m](h,"https://studio-42.github.io/elFinder/")[m](u,a.i18n("homepage"))),x.push(c[m](h,"https://github.com/Studio-42/elFinder/wiki")[m](u,a.i18n("docs"))),x.push(c[m](h,"https://github.com/Studio-42/elFinder")[m](u,a.i18n("github"))),x.push(w),x.push('<div class="'+g+'">'+a.i18n("team")+"</div>"),x.push(d[m](p,'Dmitry "dio" Levashov &lt;[email protected]&gt;')[m](f,a.i18n("chiefdev"))),x.push(d[m](p,"Naoki Sawada (nao-pon)&lt;[email protected]&gt;")[m](f,a.i18n("developer"))),x.push(d[m](p,"Troex Nevelin &lt;[email protected]&gt;")[m](f,a.i18n("maintainer"))),x.push(d[m](p,"Alexey Sukhotin &lt;[email protected]&gt;")[m](f,a.i18n("contributor"))),a.i18[a.lang].translator&&e.each(a.i18[a.lang].translator.split(", "),(function(){x.push(d[m](p,this.trim())[m](f,a.i18n("translator")+" ("+a.i18[a.lang].language+")"))})),x.push(C()),x.push(w),x.push('<div class="'+b+'">'+a.i18n("icons")+': Pixelmixer, <a href="http://p.yusukekamiyamane.com" target="_blank">Fugue</a>, <a href="https://icons8.com" target="_blank">Icons8</a></div>'),x.push(w),x.push('<div class="'+b+'">Licence: 3-clauses BSD Licence</div>'),x.push('<div class="'+b+'">Copyright © 2009-2024, Studio 42 / nao-pon</div>'),x.push('<div class="'+b+'">„ …'+a.i18n("dontforget")+" ”</div>"),x.push("</div>")),-1!==e.inArray("shortcuts",z)&&(R=a.shortcuts(),x.push('<div id="'+a.namespace+'-help-shortcuts" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),R.length?(x.push('<div class="ui-widget-content elfinder-help-shortcuts">'),e.each(R,(function(e,t){x.push('<div class="elfinder-help-shortcut"><div class="elfinder-help-shortcut-pattern">{pattern}</div> {descrip}</div>'.replace(/\{pattern\}/,t[0]).replace(/\{descrip\}/,t[1]))})),x.push("</div>")):x.push('<div class="elfinder-help-disabled">'+a.i18n("shortcutsof")+"</div>"),x.push("</div>")),-1!==e.inArray("help",z)&&(O=a.i18nBaseUrl+"help/%s.html.js",x.push('<div id="'+a.namespace+'-help-help" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),x.push('<a href="https://github.com/Studio-42/elFinder/wiki" target="_blank" class="elfinder-dont-panic"><span>DON\'T PANIC</span></a>'),x.push("</div>")),-1!==e.inArray("integrations",z)&&(S=!0,x.push('<div id="'+a.namespace+'-help-integrations" class="ui-tabs-panel ui-widget-content ui-corner-bottom"></div>')),-1!==e.inArray("debug",z)&&(T=!0,x.push('<div id="'+a.namespace+'-help-debug" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),x.push('<div class="ui-widget-content elfinder-help-debug"><ul></ul></div>'),x.push("</div>")),x.push("</div>"),(E=e(x.join(""))).find(".ui-tabs-nav li").on("mouseenter mouseleave",(function(t){e(this).toggleClass("ui-state-hover","mouseenter"
162===t.type)})).on("focus blur","a",(function(t){e(t.delegateTarget).toggleClass("ui-state-focus","focusin"===t.type)})).children().on("click",(function(t){var n=e(this);t.preventDefault(),t.stopPropagation(),n.parent().addClass(k).siblings().removeClass(k),E.children(".ui-tabs-panel").hide().filter(n.attr("href")).show()})).filter(":first").trigger("click"),S&&(n=E.find(".elfinder-help-tab-integrations").hide(),i=E.find("#"+a.namespace+"-help-integrations").hide().append(e('<div class="elfinder-help-integrations-desc"></div>').html(a.i18n("integrationWith"))),a.bind("helpIntegration",(function(t){var o,r,s,l,c=i.children("ul:first");t.data&&(e.isPlainObject(t.data)?((o=Object.assign({link:"",title:"",banner:""},t.data)).title||o.link)&&(o.title||(o.title=o.link),r=o.link?e("<a></a>").attr("href",o.link).attr("target","_blank").text(o.title):e("<span></span>").text(o.title),o.banner&&(r=e("<span></span>").append(e("<img/>").attr(o.banner),r))):(r=e(t.data)).filter("a").each((function(){var t=e(this);t.attr("target")||t.attr("target","_blank")})),r&&(n.show(),c.length||(c=e('<ul class="elfinder-help-integrations"></ul>').appendTo(i)),o&&o.cmd?(l="elfinder-help-integration-"+o.cmd,(s=c.find("ul."+l)).length||(s=e('<ul class="'+l+'"></ul>'),c.append(e("<li></li>").append(e("<span></span>").html(a.i18n("cmd"+o.cmd))).append(s))),r=s.append(e("<li></li>").append(r))):c.append(e("<li></li>").append(r))))})).bind("themechange",(function(){E.find("div.elfinder-help-term-theme").replaceWith(C())}))),T&&(o=E.find(".elfinder-help-tab-debug").hide(),r=E.find("#"+a.namespace+"-help-debug").children("div:first"),s=r.children("ul:first").on("click",(function(e){e.preventDefault(),e.stopPropagation()})),l.debug={},a.bind("backenddebug",(function(n){var i,o,c,d,h,u,p,f;T&&n.data&&n.data.debug&&(l.debug={options:n.data.options,debug:Object.assign({cmd:a.currentReqCmd},n.data.debug)},l.dialog&&(p=function(t,n){return e.each(n,(function(n,i){t.append(e("<dt></dt>").text(n)),void 0===i?t.append(e("<dd></dd>").append(e("<span></span>").text("undfined"))):"object"!=typeof i||i?"object"==typeof i&&(e.isPlainObject(i)||i.length)?t.append(e("<dd></dd>").append(p(e("<dl></dl>"),i))):t.append(e("<dd></dd>").append(e("<span></span>").text(i&&"object"==typeof i?"[]":i||'""'))):t.append(e("<dd></dd>").append(e("<span></span>").text("null")))})),t},f=s.children("li").length,(l.debug.options||l.debug.debug)&&(f>=5&&(h=s.children("li:last"),(u=r.children("div:last")).is(":hidden")?(h.remove(),u.remove()):(h.prev().remove(),u.prev().remove())),c=a.namespace+"-help-debug-"+ +new Date,i=e("<li></li>").html('<a href="'+_+"#"+c+'">'+l.debug.debug.cmd+"</a>").prependTo(s),o=e('<div id="'+c+'"></div>').data("debug",l.debug),i.on("click.debugrender",(function(){var t=o.data("debug");o.removeData("debug"),t&&(o.hide(),t.debug&&(d=e("<fieldset>").append(e("<legend></legend>").text("debug"),p(e("<dl></dl>"),t.debug)),o.append(d)),t.options&&(d=e("<fieldset>").append(e("<legend></legend>").text("options"),p(e("<dl></dl>"),t.options)),o.append(d)),o.show()),i.off("click.debugrender")})),s.after(o),t&&r.tabs("refresh"))))}))),E.find("#"+a.namespace+"-help-about").find(".apiver").text(a.api),l.dialog=l.fmDialog(E,{title:l.title,width:530,maxWidth:"window",maxHeight:"window",autoOpen:!1,destroyOnClose:!1,close:function(){T&&(o.hide(),r.tabs("destroy")),t=!1}}).on("click",(function(e){e.stopPropagation()})).css({overflow:"hidden"}),D=l.dialog.children(".ui-tabs"),I=D.children(".ui-tabs-nav:first"),P=D.children(".ui-tabs-panel"),M=l.dialog.outerHeight(!0)-l.dialog.height(),l.dialog.closest(".ui-dialog").on("resize",(function(){P.height(l.dialog.height()-M-I.outerHeight(!0)-20)})),O&&l.dialog.one("initContents",(function(){e.ajax({url:l.options.helpSource?l.options.helpSource:O.replace("%s",a.lang),dataType:"html"}).done((function(t){e("#"+a.namespace+"-help-help").html(t)})).fail((function(){e.ajax({url:O.replace("%s","en"),dataType:"html"}).done((function(t){e("#"+a.namespace+"-help-help").html(t)}))}))})),l.state=0,a.trigger("helpBuilded",l.dialog)})).one("open",(function(){var e=!1;a.one("backenddebug",(function(){e=!0})).one("opendone",(function(){requestAnimationFrame((function(){!e&&T&&(T=!1,o.hide(),r.hide(),s.hide())}))}))})),this.getstate=function(){return 0},this.exec=function(n,i){var a=i?i.tab:void 0;return T&&(r.tabs(),s.find("a:first").trigger("click"),o.show(),t=!0),this.dialog.trigger("initContents").elfinderdialog("open").find((a?".elfinder-help-tab-"+a:".ui-tabs-nav li")+" a:first").trigger("click"),e.Deferred().resolve()}}).prototype={forceLoad:!0},h.prototype.commands.hidden=function(){this.hidden=!0,this.updateOnSelect=!1,this.getstate=function(){return-1}},h.prototype.commands.hide=function(){var t,n,i,o,r=this,s={};this.syncTitleOnChange=!0,this.shortcuts=[{pattern:"ctrl+shift+dot",description:this.fm.i18n("toggleHidden")}],this.init=function(){var e=this.fm;t=e.storage("hide")||{items:{}},n=Object.keys(t.items).length,this.title=e.i18n(t.show?"hideHidden":"showHidden"),r.update(void 0,r.title)},this.fm.bind("select contextmenucreate closecontextmenu",(function(e,s){var a=(e.data?e.data.selected||e.data.targets:null)||s.selected();"select"===e.type&&e.data?o=e.data.origin:"contextmenucreate"===e.type&&(i=e.data.type),!a.length||("contextmenucreate"!==e.type&&"navbar"!==o||"cwd"===i)&&a[0]===s.cwd().hash?r.title=s.i18n(t.show?"hideHidden":"showHidden"):r.title=s.i18n("cmdhide"),"closecontextmenu"!==e.type?r.update("cwd"===i?n?0:-1:void 0,r.title):(i="",requestAnimationFrame((function(){r.update(void 0,r.title)})))})),this.getstate=function(e){return this.fm.cookieEnabled&&"cwd"!==i&&(e||this.fm.selected()).length||n?0:-1},this.exec=function(i,a){var l,c,d=this.fm,h=e.Deferred().done((function(){d.trigger("hide",{items:p,opts:a})})).fail((function(e){d.error(e)})),u=a||{},p=u.targets?u.targets:i||d.selected(),f=[];if(t=d.storage("hide")||{},e.isPlainObject(t)||(t={}),e.isPlainObject(t.items)||(t.items={}),("shortcut"===a._currentType||!p.length||"navbar"!==a._currentType&&"navbar"!==o&&p[0]===d.cwd().hash)&&(t.show?u.hide=!0:Object.keys(t.items).length&&(u.show=!0)),u.reset&&(u.show=!0,n=0),u.show||u.hide){if(u.show?t.show=!0:delete t.show,u.show)return d.storage("hide",u.reset?null:t),r.title=d.i18n("hideHidden"),r.update(u.reset?-1:void 0,r.title),e.each(t.items,(function(e){var t=d.file(e,!0);t&&(d.searchStatus.state||!t.phash||d.file(t.phash))&&f.push(t)})),f.length&&(d.updateCache({added:f}),d.add({added:f})),u.reset&&(t={items:{}}),h.resolve();p=Object.keys(t.items)}return p.length&&(e.each(p,(function(e,n){var i;t.items[n]||((i=d.file(n))&&(s[n]=i.i18||i.name),t.items[n]=s[n]?s[n]:n)})),n=Object.keys(t.items).length,l=this.files(p),d.storage("hide",t),d.remove({removed:p}),t.show&&this.exec(void 0,{hide:!0}),u.hide||((c={}).undo={cmd:"hide",callback:function(){var t=d.storage("hide");t&&(e.each(p,(function(e,n){delete t.items[n]})),n=Object.keys(t.items).length,d.storage("hide",t),d.trigger("hide",{items:p,opts:{}}),r.update(n?0:-1)),d.updateCache({added:l}),d.add({added:l})}},c.redo={cmd:"hide",callback:function(){return d.exec("hide",void 0,{targets:p})}})),"rejected"==h.state()?h:h.resolve(c)}},(h.prototype.commands.home=function(){this.title="Home",this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+home ctrl+shift+up",description:"Home"}],this.getstate=function(){var e=this.fm.root(),t=this.fm.cwd().hash;return e&&t&&e!=t?0:-1},this.exec=function(){return this.fm.exec("open",this.fm.root())}}).prototype={forceLoad:!0},(h.prototype.commands.info=function(){var t=this.fm,n="elfinder-spinner",i={calc:t.i18n("c
162alc"),size:t.i18n("size"),unknown:t.i18n("unknown"),path:t.i18n("path"),aliasfor:t.i18n("aliasfor"),modify:t.i18n("modify"),perms:t.i18n("perms"),locked:t.i18n("locked"),dim:t.i18n("dim"),kind:t.i18n("kind"),files:t.i18n("files"),folders:t.i18n("folders"),roots:t.i18n("volumeRoots"),items:t.i18n("items"),yes:t.i18n("yes"),no:t.i18n("no"),link:t.i18n("link"),owner:t.i18n("owner"),group:t.i18n("group"),perm:t.i18n("perm"),getlink:t.i18n("getLink")},o=function(e,t){return t?e.replace(/\u200B/g,""):e.replace(/(\/|\\)/g,"$1​")};this.items=["size","aliasfor","path","link","dim","modify","perms","locked","owner","group","perm"],this.options.custom&&Object.keys(this.options.custom).length&&e.each(this.options.custom,(function(e,t){t.label&&this.items.push(t.label)})),this.tpl={main:'<div class="ui-helper-clearfix elfinder-info-title {dirclass}"><span class="elfinder-cwd-icon {class} ui-corner-all"{style}></span>{title}</div><table class="elfinder-info-tb">{content}</table>',itemTitle:'<strong>{name}</strong><span class="elfinder-info-kind">{kind}</span>',groupTitle:"<strong>{items}: {num}</strong>",row:'<tr><td class="elfinder-info-label">{label} : </td><td class="{class}">{value}</td></tr>',spinner:'<span>{text}</span> <span class="'+n+" "+n+'-{name}"></span>'},this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+i"}],this.init=function(){e.each(i,(function(e,n){i[e]=t.i18n(n)}))},this.getstate=function(){return 0},this.exec=function(t){var r=this.files(t);r.length||(r=this.files([this.fm.cwd().hash]));var s,a,l,c,d,h,u,p,f,m=this.fm,g=this.options,v=this.tpl,b=v.row,y=r.length,x=[],w=v.main,_="{label}",k="{value}",C=[],S=null,T={title:m.i18n("selectionInfo"),width:"auto",close:function(){e(this).elfinderdialog("destroy"),S&&"pending"===S.state()&&S.reject(),e.grep(C,(function(e){e&&"pending"===e.state()&&e.reject()}))}},E=[],A=function(e,t,i){D.find("."+n+"-"+t).parent().html(e).addClass(i||"")},O=m.namespace+"-info-"+e.map(r,(function(e){return e.hash})).join("-"),D=m.getUI().find("#"+O),I=[],P="",M="elfinder-font-mono elfinder-info-hash",R=[],z=m.ui.notify;if(z.is(":hidden")&&z.children(".elfinder-notify").length&&z.elfinderdialog("open").height("auto"),!y)return e.Deferred().reject();if(D.length)return D.elfinderdialog("toTop"),e.Deferred().resolve();if(p=m.storage("infohides")||m.arrayFlip(g.hideItems,!0),1===y){if((l=r[0]).icon&&(P=" "+m.getIconStyle(l)),w=w.replace("{dirclass}",l.csscls?m.escape(l.csscls):"").replace("{class}",m.mime2class(l.mime)).replace("{style}",P),c=v.itemTitle.replace("{name}",m.escape(l.i18||l.name)).replace("{kind}",'<span title="'+m.escape(l.mime)+'">'+m.mime2kind(l)+"</span>"),a=m.tmb(l),l.read?"directory"!=l.mime||l.alias?s=m.formatSize(l.size):(s=v.spinner.replace("{text}",i.calc).replace("{name}","size"),E.push(l.hash)):s=i.unknown,!p.size&&x.push(b.replace(_,i.size).replace(k,s)),!p.aleasfor&&l.alias&&x.push(b.replace(_,i.aliasfor).replace(k,l.alias)),p.path||((u=m.path(l.hash,!0))?x.push(b.replace(_,i.path).replace(k,o(m.escape(u))).replace("{class}","elfinder-info-path")):(x.push(b.replace(_,i.path).replace(k,v.spinner.replace("{text}",i.calc).replace("{name}","path")).replace("{class}","elfinder-info-path")),C.push(m.path(l.hash,!0,{notify:null}).fail((function(){A(i.unknown,"path")})).done((function(e){A(o(e),"path")}))))),!p.link&&l.read){var N,F=m.escape(l.name);if("1"==l.url)x.push(b.replace(_,i.link).replace(k,'<button class="elfinder-info-button '+n+'-url">'+i.getlink+"</button>"));else{if(l.url)N=l.url;else if("directory"===l.mime)if(g.nullUrlDirLinkSelf&&null===l.url){var L=window.location;N=L.pathname+L.search+"#elf_"+l.hash}else""!==l.url&&m.option("url",!m.isRoot(l)&&l.phash||l.hash)&&(N=m.url(l.hash));else N=m.url(l.hash);N&&x.push(b.replace(_,i.link).replace(k,'<a href="'+N+'" target="_blank">'+F+"</a>"))}}p.dim||(l.dim?x.push(b.replace(_,i.dim).replace(k,l.dim)):-1!==l.mime.indexOf("image")&&(l.width&&l.height?x.push(b.replace(_,i.dim).replace(k,l.width+"x"+l.height)):l.size&&"0"!==l.size&&(x.push(b.replace(_,i.dim).replace(k,v.spinner.replace("{text}",i.calc).replace("{name}","dim"))),C.push(m.request({data:{cmd:"dim",target:l.hash},preventDefault:!0}).fail((function(){A(i.unknown,"dim")})).done((function(e){if(A(e.dim||i.unknown,"dim"),e.dim){var t=e.dim.split("x"),n=m.file(l.hash);n.width=t[0],n.height=t[1]}})))))),!p.modify&&x.push(b.replace(_,i.modify).replace(k,m.formatDate(l))),!p.perms&&x.push(b.replace(_,i.perms).replace(k,m.formatPermissions(l))),!p.locked&&x.push(b.replace(_,i.locked).replace(k,l.locked?i.yes:i.no)),!p.owner&&l.owner&&x.push(b.replace(_,i.owner).replace(k,l.owner)),!p.group&&l.group&&x.push(b.replace(_,i.group).replace(k,l.group)),!p.perm&&l.perm&&x.push(b.replace(_,i.perm).replace(k,m.formatFileMode(l.perm))),window.ArrayBuffer&&(m.options.cdns.sparkmd5||m.options.cdns.jssha)&&"directory"!==l.mime&&l.size>0&&(!g.showHashMaxsize||l.size<=g.showHashMaxsize)&&(R=[],e.each(m.storage("hashchekcer")||g.showHashAlgorisms,(function(e,t){l[t]?x.push(b.replace(_,m.i18n(t)).replace(k,l[t]).replace("{class}",M)):(x.push(b.replace(_,m.i18n(t)).replace(k,v.spinner.replace("{text}",i.calc).replace("{name}",t))),R.push(t))})),R.length&&(f=e('<div class="elfinder-quicklook-info-progress"></div>'),C.push(m.getContentsHashes(l.hash,R,g.showHashOpts,{progressBar:f}).progress((function(t){e.each(R,(function(e,n){t[n]&&A(t[n],n,M)}))})).always((function(){e.each(R,(function(e,t){A(i.unknown,t)}))}))))),g.custom&&e.each(g.custom,(function(t,n){p[n.label]||n.mimes&&!e.grep(n.mimes,(function(e){return l.mime===e||0===l.mime.indexOf(e+"/")})).length||n.hashRegex&&!l.hash.match(n.hashRegex)||(x.push(b.replace(_,m.i18n(n.label)).replace(k,n.tpl.replace("{id}",O))),n.action&&"function"==typeof n.action&&I.push(n.action))}))}else w=w.replace("{class}","elfinder-cwd-icon-group"),c=v.groupTitle.replace("{items}",i.items).replace("{num}",y),(d=e.grep(r,(function(e){return"directory"==e.mime})).length)?(d-=h=e.grep(r,(function(e){return!("directory"!==e.mime||e.ph
162ash&&!e.isroot)})).length,x.push(b.replace(_,i.kind).replace(k,h===y||d===y?i[h?"roots":"folders"]:e.map({roots:h,folders:d,files:y-h-d},(function(e,t){return e?i[t]+" "+e:null})).join(", "))),!p.size&&x.push(b.replace(_,i.size).replace(k,v.spinner.replace("{text}",i.calc).replace("{name}","size"))),E=e.map(r,(function(e){return e.hash}))):(s=0,e.each(r,(function(e,t){var n=parseInt(t.size);n>=0&&s>=0?s+=n:s="unknown"})),x.push(b.replace(_,i.kind).replace(k,i.files)),!p.size&&x.push(b.replace(_,i.size).replace(k,m.formatSize(s))));return w=w.replace("{title}",c).replace("{content}",x.join("").replace(/{class}/g,"")),(D=this.fmDialog(w,T)).attr("id",O).one("mousedown",".elfinder-info-path",(function(){e(this).html(o(e(this).html(),!0))})),R.length&&f.appendTo(D.find("."+n+"-"+R[0]).parent()),m.UA.Mobile&&e.fn.tooltip&&D.children(".ui-dialog-content .elfinder-info-title").tooltip({classes:{"ui-tooltip":"elfinder-ui-tooltip ui-widget-shadow"},tooltipClass:"elfinder-ui-tooltip ui-widget-shadow",track:!0}),l&&"1"==l.url&&D.on("click","."+n+"-url",(function(){e(this).parent().html(v.spinner.replace("{text}",m.i18n("ntfurl")).replace("{name}","url")),m.request({data:{cmd:"url",target:l.hash},preventDefault:!0}).fail((function(){A(F,"url")})).done((function(e){e.url?(A('<a href="'+e.url+'" target="_blank">'+F+"</a>"||F,"url"),m.file(l.hash).url=e.url):A(F,"url")}))})),a&&e("<img/>").on("load",(function(){D.find(".elfinder-cwd-icon").addClass(a.className).css("background-image","url('"+a.url+"')")})).attr("src",a.url),E.length&&(S=m.getSize(E).done((function(e){A(e.formated,"size")})).fail((function(){A(i.unknown,"size")}))),I.length&&e.each(I,(function(e,t){try{t(l,m,D)}catch(e){m.debug("error",e)}})),e.Deferred().resolve()}}).prototype={forceLoad:!0},h.prototype.commands.mkdir=function(){var t,n=this.fm,i=this;this.value="",this.disableOnSearch=!0,this.updateOnSelect=!1,this.syncTitleOnChange=!0,this.mime="directory",this.prefix="untitled folder",this.exec=function(e,o){var r;return e&&e.length&&o&&o._currentType&&"navbar"===o._currentType?(this.origin=o._currentType,this.data={target:e[0]}):(r=n.cwd().hash===e[0],this.origin=t&&!r?t:"cwd",delete this.data),e||this.options.intoNewFolderToolbtn||n.getUI("cwd").trigger("unselectall"),this.move=this.value===n.i18n("cmdmkdirin"),n.res("mixin","make").bind(i)()},this.shortcuts=[{pattern:"ctrl+shift+n"}],this.init=function(){this.options.intoNewFolderToolbtn&&(this.syncTitleOnChange=!0)},n.bind("select contextmenucreate closecontextmenu",(function(e){var o=(e.data?e.data.selected||e.data.targets:null)||n.selected();i.className="mkdir",t=e.data&&o.length&&(e.data.origin||e.data.type)||"",i.options.intoNewFolderToolbtn||""!==t||(t="cwd"),o.length&&"navbar"!==t&&"cwd"!==t&&n.cwd().hash!==o[0]?(i.title=n.i18n("cmdmkdirin"),i.className+=" elfinder-button-icon-mkdirin"):i.title=n.i18n("cmdmkdir"),"closecontextmenu"!==e.type?i.update(void 0,i.title):requestAnimationFrame((function(){i.update(void 0,i.title)}))})),this.getstate=function(i){var o,r,s=n.cwd(),a="navbar"===t||i&&i[0]!==s.hash?this.files(i||n.selected()):[],l=a.length;return"navbar"===t?l&&a[0].write&&a[0].read?0:-1:!s.write||l&&(o=a,r=!0,e.grep(o,(function(e){return r=!(!r||!e.read||e.locked)}))).length!=l?-1:0}},h.prototype.commands.mkfile=function(){var t=this;this.disableOnSearch=!0,this.updateOnSelect=!1,this.mime="text/plain",this.prefix="untitled file.txt",this.variants=[],this.getTypeName=function(e,n){var i,o=t.fm;return i=(i=o.messages["kind"+o.kinds[e]])?o.i18n(["extentiontype",n.toUpperCase(),i]):o.i18n(["extentionfile",n.toUpperCase()])},this.fm.bind("open reload canMakeEmptyFile",(function(){var n=t.fm,i=n.getCommand("edit").getMkfileHides();t.variants=[],n.mimesCanMakeEmpty&&e.each(n.mimesCanMakeEmpty,(function(e,o){o&&!i[e]&&n.uploadMimeCheck(e)&&t.variants.push([e,t.getTypeName(e,o)])})),t.change()})),this.getstate=function(){return this.fm.cwd().write?0:-1},this.exec=function(n,i){var o,r,s=t.fm;if(o=s.mimesCanMakeEmpty[i]){if(s.uploadMimeCheck(i))return this.mime=i,this.prefix=s.i18n(["untitled file",o]),s.res("mixin","make").bind(t)();r=["errMkfile",t.getTypeName(i,o)]}return e.Deferred().reject(r)}},h.prototype.commands.netmount=function(){var t,n=this,i=!1;this.alwaysEnabled=!0,this.updateOnSelect=!1,this.drivers=[],this.handlers={load:function(){var t=n.fm;t.cookieEnabled&&t.one("open",(function(){n.drivers=t.netDrivers,n.drivers.length&&e.each(n.drivers,(function(){var e=n.options[this];e&&(i=!0,e.integrateInfo&&t.trigger("helpIntegration",Object.assign({cmd:"netmount"},e.integrateInfo)))}))}))}},this.getstate=function(){return i?0:-1},this.exec=function(){var i,o,r,s,a,l,c,d,h=n.fm,u=e.Deferred(),p=n.options;return n.dialog?n.dialog.elfinderdialog("open"):n.dialog=(r=function(){s.protocol.trigger("change","winfocus")},s={protocol:e("<select></select>").on("change",(function(e,n){var o=this.value;t.find(".elfinder-netmount-tr").hide(),t.find(".elfinder-netmount-tr-"+o).show(),i&&i.children(".ui-dialog-buttonpane:first").find("button").show(),"function"==typeof p[o].select&&p[o].select(h,e,n)})).addClass("ui-corner-all")},a={title:h.i18n("netMountDialogTitle"),resizable:!0,modal:!0,destroyOnClose:!1,open:function(){e(window).on("focus."+h.namespace,r),s.protocol.trigger("change")}
162,close:function(){"pending"==u.state()&&u.reject(),e(window).off("focus."+h.namespace,r)},buttons:{}},l=function(){var i,o=s.protocol.val(),r={cmd:"netmount",protocol:o},a=p[o];if(e.each(t.find("input.elfinder-netmount-inputs-"+o),(function(t,n){var i,o;(o=e(n)).is(":radio,:checkbox")?o.is(":checked")&&(i=o.val().trim()):i=o.val().trim(),i&&(r[n.name]=i)})),!r.host)return h.trigger("error",{error:"errNetMountHostReq",opts:{modal:!0}});r.mnt2res&&(i=!0),h.request({data:r,notify:{type:"netmount",cnt:1,hideCnt:!0}}).done((function(e){var t;e.added&&e.added.length&&(i&&s.protocol.trigger("change","reset"),e.added[0].phash&&(t=h.file(e.added[0].phash))&&(t.dirs||(t.dirs=1,h.change({changed:[t]}))),h.one("netmountdone",(function(){h.exec("open",e.added[0].hash)}))),u.resolve()})).fail((function(e){a.fail&&"function"==typeof a.fail&&a.fail(h,h.parseError(e)),u.reject(e)})),n.dialog.elfinderdialog("close")},c=e('<form autocomplete="off"></form>').on("keydown","input",(function(t){var n,i=!0;t.keyCode===e.ui.keyCode.ENTER&&(e.each(c.find("input:visible:not(.elfinder-input-optional)"),(function(){if(""===e(this).val())return i=!1,n=e(this),!1})),i?l():n.trigger("focus"))})),d=e("<div></div>"),t=e('<table class="elfinder-info-tb elfinder-netmount-tb"></table>').append(e("<tr></tr>").append(e("<td>"+h.i18n("protocol")+"</td>")).append(e("<td></td>").append(s.protocol))),e.each(n.drivers,(function(n,i){p[i]&&(s.protocol.append('<option value="'+i+'">'+h.i18n(p[i].name||i)+"</option>"),e.each(p[i].inputs,(function(n,o){o.attr("name",n),"hidden"!=o.attr("type")?(o.addClass("ui-corner-all elfinder-netmount-inputs-"+i),t.append(e("<tr></tr>").addClass("elfinder-netmount-tr elfinder-netmount-tr-"+i).append(e("<td>"+h.i18n(n)+"</td>")).append(e("<td></td>").append(o)))):(o.addClass("elfinder-netmount-inputs-"+i),d.append(o))})),p[i].protocol=s.protocol)})),t.append(d),t.find(".elfinder-netmount-tr").hide(),t.find(".elfinder-netmount-tr-"+n.drivers[0]).show(),a.buttons[h.i18n("btnMount")]=l,a.buttons[h.i18n("btnCancel")]=function(){n.dialog.elfinderdialog("close")},t.find("select,input").addClass("elfinder-tabstop"),o=n.fmDialog(c.append(t),a).ready((function(){s.protocol.trigger("change"),o.elfinderdialog("posInit")})),i=o.closest(".ui-dialog"),o),u.promise()},n.fm.bind("netmount",(function(e){var i=e.data||null,o=n.options,r=function(){o[i.protocol]&&"function"==typeof o[i.protocol].done&&(o[i.protocol].done(n.fm,i),t.find("select,input").addClass("elfinder-tabstop"),n.dialog.elfinderdialog("tabstopsInit"))};i&&i.protocol&&(i.mode&&"redirect"===i.mode?n.fm.request({data:{cmd:"netmount",protocol:i.protocol,host:i.host,user:"init",pass:"return",options:i.options},preventDefault:!0}).done((function(e){i=JSON.parse(e.body),r()})):r())}))},h.prototype.commands.netunmount=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.drivers=[],this.handlers={load:function(){this.drivers=this.fm.netDrivers}},this.getstate=function(e){var t,n=this.fm;return e&&this.drivers.length&&!this._disabled&&(t=n.file(e[0]))&&t.netkey?0:-1},this.exec=function(t){var n=this,i=this.fm,o=e.Deferred().fail((function(e){e&&i.error(e)})),r=i.file(t[0]);return this._disabled?o.reject():("pending"==o.state()&&i.confirm({title:n.title,text:i.i18n("confirmUnmount",r.name),accept:{label:"btnUnmount",callback:function(){var t,s=r.hash,a=function(t){var n,o=[];return i.leafRoots&&(n=[],e.each(i.leafRoots,(function(o,r){var s,a=i.parents(o);-1!==(s=e.inArray(t,a))&&(s=a.length-s,e.each(r,(function(e,t){n.push({i:s,hash:t})})))})),n.length&&(n.sort((function(e,t){return e.i<t.i})),e.each(n,(function(e,t){o.push(t.hash)})))),o}(s),l=[],c=[],d=function(){e.when(l).done((function(){i.request({data:{cmd:"netmount",protocol:"netunmount",host:r.netkey,user:s,pass:"dum"},notify:{type:"netunmount",cnt:1,hideCnt:!0},preventFail:!0}).fail((function(e){o.reject(e)})).done((function(e){r.volumeid&&delete i.volumeExpires[r.volumeid],o.resolve()}))})).fail((function(e){c.length&&i.remove({removed:c}),o.reject(e)}))};a.length?i.confirm({title:n.title,text:(t=["unmountChildren"],e.each(a,(function(e,n){t.push([i.file(n).name])})),t),accept:{label:"btnUnmount",callback:function(){e.each(a,(function(e,t){var n=i.file(t);n.netkey&&l.push(i.request({data:{cmd:"netmount",protocol:"netunmount",host:n.netkey,user:n.hash,pass:"dum"},notify:{type:"netunmount",cnt:1,hideCnt:!0},preventDefault:!0}).done((function(e){e.removed&&(n.volumeid&&delete i.volumeExpires[n.volumeid],c=c.concat(e.removed))})))})),d()}},cancel:{label:"btnCancel",callback:function(){o.reject()}}}):(l=null,d())}},cancel:{label:"btnCancel",callback:function(){o.reject()}}}),o)}},(h.prototype.commands.open=function(){var t=this.fm,n=this;this.alwaysEnabled=!0,this.noChangeDirOnRemovedCwd=!0,this._handlers={dblclick:function(e){var i=e.data&&e.data.file?[e.data.file]:void 0;0===n.getstate(i)&&(e.preventDefault(),t.exec("open",i))},"select enable disable reload":function(e){this.update("disable"==e.type?-1:void 0)}},this.shortcuts=[{pattern:"ctrl+down numpad_enter"+("mac"!=t.OS&&" enter")}],this.getstate=function(n){var i=this.files(n),o=i.length;
162return 1==o?i[0].read?0:-1:o&&!t.UA.Mobile&&e.grep(i,(function(e){return!("directory"==e.mime||!e.read)})).length==o?0:-1},this.exec=function(n,i){var o,r,s,a,l,c,d,h,u,p,f,m,g=e.Deferred().fail((function(e){e&&t.error(e)})),v=this.files(n),b=v.length,y="object"==typeof i&&i.thash,x=this.options,w=x.into||"window";if(!b&&!y)return g.reject();if(y||1==b&&(o=v[0])&&"directory"==o.mime)return y||!o||o.read?t.keyState.ctrlKey&&(t.keyState.shiftKey||"function"!=typeof t.options.getFileCallback)&&t.getCommand("opennew")?t.exec("opennew",[y||o.hash]):t.request({data:{cmd:"open",target:y||o.hash},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0,lazy:!1}):g.reject(["errOpen",o.name,"errPerm"]);if(v=e.grep(v,(function(e){return"directory"!=e.mime})),b!=v.length)return g.reject();var _=function(){var i,f,m=function(n){var h=e('<a rel="noopener">').hide().appendTo(e("body"));if(t.UA.Mobile||!p){if(u)p?h.attr("target","_blank"):h.attr("download",o.name),h.attr("href",n).get(0).click();else if(!(i=window.open(n)))return g.reject("errPopup")}else{if(!("string"==typeof x.method&&"get"===x.method.toLowerCase())&&0===n.indexOf(t.options.url)&&t.customData&&Object.keys(t.customData).length&&!o.mime.match(/^(?:video|audio)/)&&(n=""),"window"===w?(a=c=Math.round(2*screen.availWidth/3),l=d=Math.round(2*screen.availHeight/3),parseInt(o.width)&&parseInt(o.height)?(a=parseInt(o.width),l=parseInt(o.height)):o.dim&&(r=o.dim.split("x"),a=parseInt(r[0]),l=parseInt(r[1])),c>=a&&d>=l?(c=a,d=l):a-c>l-d?d=Math.round(l*(c/a)):c=Math.round(a*(d/l)),s="width="+c+",height="+d,i=window.open(n,f,s+",top=50,left=50,scrollbars=yes,resizable=yes,titlebar=no")):("tabs"===w&&(f=o.hash),i=window.open("about:blank",f)),!i)return g.reject("errPopup");if(""===n){var m=document.createElement("form");m.action=t.options.url,m.method="POST",m.target=f,m.style.display="none";var v=Object.assign({},t.customData,{cmd:"file",target:o.hash,_t:o.ts||parseInt(+new Date/1e3)});e.each(v,(function(e,t){var n=document.createElement("input");n.name=e,n.value=t,m.appendChild(n)})),document.body.appendChild(m),m.submit()}else"window"!==w&&(i.location=n);e(i).trigger("focus")}h.remove()};try{h=new RegExp(t.option("dispInlineRegex"),"i")}catch(e){h=!1}for(u="string"==typeof e("<a>").get(0).download,b=v.length;b--;){if(f="elf_open_window",!(o=v[b]).read)return g.reject(["errOpen",o.name,"errPerm"]);p=h&&o.mime.match(h),t.openUrl(o.hash,!p,m)}return g.resolve(n)};if(b>1)t.confirm({title:"openMulti",text:["openMultiConfirm",b+""],accept:{label:"cmdopen",callback:function(){_()}},cancel:{label:"btnCancel",callback:function(){g.reject()}},buttons:t.getCommand("zipdl")&&t.isCommandEnabled("zipdl",t.cwd().hash)?[{label:"cmddownload",callback:function(){t.exec("download",n),g.reject()}}]:[]});else{if((f=t.storage("selectAction")||x.selectAction)&&(e.each(f.split("/"),(function(){var e=this.valueOf();if("open"!==e&&(m=t.getCommand(e))&&m.enabled())return!1;m=null})),m))return t.exec(m.name);_()}return g}}).prototype={forceLoad:!0},h.prototype.commands.opendir=function(){this.alwaysEnabled=!0,this.getstate=function(){return 1!==this.fm.selected().length?-1:this.fm.getUI("workzone").hasClass("elfinder-search-result")?0:-1},this.exec=function(t){var n,i=this.fm,o=e.Deferred(),r=this.files(t);return r.length&&r[0].phash?(n=r[0].phash,i.trigger("searchend",{noupdate:!0}),i.request({data:{cmd:"open",target:n},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!1}),o):o.reject()}},h.prototype.commands.opennew=function(){var t=this.fm;this.shortcuts=[{pattern:("function"==typeof t.options.getFileCallback?"shift+":"")+"ctrl+enter"}],this.getstate=function(e){var t=this.files(e);return 1===t.length&&"directory"===t[0].mime&&t[0].read?0:-1},this.exec=function(t){var n,i,o,r,s=e.Deferred(),a=this.files(t),l=a.length,c=this.options;return 1===l&&(n=a[0])&&"directory"===n.mime?(i=window.location,o=c.url?c.url:i.pathname,c.useOriginQuery&&(o.match(/\?/)?i.search&&(o+="&"+i.search.substr(1)):o+=i.search),o+="#elf_"+n.hash,r=window.open(o,"_blank"),setTimeout((function(){r.focus()}),1e3),s.resolve()):s.reject()}},h.prototype.commands.paste=function(){this.updateOnSelect=!1,this.handlers={changeclipboard:function(){this.update()}},this.shortcuts=[{pattern:"ctrl+v shift+insert"}],this.getstate=function(e){if(this._disabled)return-1;if(e){if(Array.isArray(e)){if(1!=e.length)return-1;e=this.fm.file(e[0])}}else e=this.fm.cwd();return this.fm.clipboard().length&&"directory"==e.mime&&e.write?0:-1},this.exec=function(t,n){var i,o,r,s=this,a=s.fm,l=n||{},c=t?this.files(t)[0]:a.cwd(),d=a.clipboard(),h=d.length,u=!!h&&d[0].cut,p=l._cmd?l._cmd:u?"move":"copy",f="err"+p.charAt(0).toUpperCase()+p.substr(1),m=[],g=[],v=e.Deferred().fail((function(e){e&&a.error(e)})).always((function(){a.unlockfiles({files:e.map(d,(function(e){return e.hash}))})}));return h&&c&&"directory"==c.mime?c.write?(i=a.parents(c.hash),e.each(d,(function(t,n){return n.read?u&&n.locked?!v.reject(["errLocked",n.name]):-1!==e.inArray(n.hash,i)?!v.reject(["errCopyInItself",n.name]):n.mime&&"directory"!==n.mime&&!a.uploadMimeCheck(n.mime,c.hash)?!v.reject([f,n.name,"errUploadMime"]):((o=a.parents(n.hash)).pop(),-1!==e.inArray(c.hash,o)&&e.grep(o,(function(e){var t=a.file(e);return t.phash==c.hash&&t.name==n.name})).length?!v.reject(["errReplByChild",n.name]):void(n.phash==c.hash?g.push(n.hash):m.push({hash:n.hash,phash:n.phash,name:n.name}))):!v.reject([f,n.name,"errPerm"])})),"rejected"===v.state()||(r=e.Deferred(),u&&s.options.moveConfirm?a.confirm({title:"moveFiles",text:a.i18n("confirmMove",c.i18||c.name),accept:{label:"btnYes",callback:function(){r.resolve()}},cancel:{label:"btnCancel",callback:function(){r.reject()}}}):r.resolve(),r.done((function(){e.when(function(t){return t.length&&a._commands.duplicate?a.exec("duplicate",t):e.Deferred().resolve()}(g),function(t){var n,i=e.Deferred(),o=[],r={},d=function(t,n){for(var i=[],o=t.length;o--;)-1!==e.inArray(t[o].name,n)&&i.unshift(o);return i},h=function(e){var n=o[e],r=t[n],s=e==o.length-1;r&&a.confirm({title:a.i18n(p+"Files"),text:["errExists",r.name,"restore"===p?"confirmRest":"confirmRepl"],all:!s,accept:{label:"btnYes",callback:function(n){s||n?m(t):h(++e)}},reject:{label:"btnNo",callback:function(n){var i;if(n)for(i=o.length;e<i--;)t[o[i]].remove=!0;else t[o[e]].remove=!0;s||n?m(t):h(++e)}},cancel:{label:"btnCancel",callback:function(){i.resolve()}},buttons:[{label:"btnBackup",callback:function(n){var i;if(n)for(i=o.length;e<i--;)t[o[i]].rename=!0;else t[o[e]].rename=!0;s||n?m(t):h(++e)}}]})},f=function(n){var i,s={};n&&(Array.isArray(n)?n.length&&("string"==typeof n[0]?o=d(t,n):(e.each(n,(function(e,t){s[t.name]=t.hash})),o=d(t,e.map(s,(function(e,t){return t}))),e.each(t,(function(e,t){s[t.name]&&(r[s[t.name]]=t.name)})))):(i=[],o=e.map(n,(function(e){return"string"==typeof e?e:(i=i.concat(e),!1)}
162)),i.length&&(o=o.concat(i)),o=d(t,o),r=n)),o.length?h(0):m(t)},m=function(t){var n,o,s=[],d=e.grep(t,(function(e){return e.rename&&s.push(e.name),!e.remove})),h=d.length;if(!h)return i.resolve();n=e.map(d,(function(e){return e.hash})),o={cmd:"paste",dst:c.hash,targets:n,cut:u?1:0,renames:s,hashes:r,suffix:a.options.backupSuffix},a.api<2.1&&(o.src=d[0].phash),a.request({data:o,notify:{type:p,cnt:h},cancel:!0,navigate:{toast:l.noToast?{}:{inbuffer:{msg:a.i18n(["complete",a.i18n("cmd"+p)]),action:{cmd:"open",msg:"cmdopendir",data:[c.hash],done:"select",cwdNot:c.hash}}}}}).done((function(t){var n={},r=t.added&&t.added.length?t.added:null;u&&r&&(e.each(d,(function(t,i){var o,s,a=i.phash,l=(o=i.name,e.each(r,(function(e,t){if(t.name===o)return s=t.hash,!1})),s);l&&(n[a]?n[a].push(l):n[a]=[l])})),Object.keys(n).length&&(t.undo={cmd:"move",callback:function(){var t=[];return e.each(n,(function(e,n){t.push(a.request({data:{cmd:"paste",dst:e,targets:n,cut:1},notify:{type:"undo",cnt:n.length}}))})),e.when.apply(null,t)}},t.redo={cmd:"move",callback:function(){return a.request({data:o,notify:{type:"redo",cnt:h}})}})),i.resolve(t)})).fail((function(e){i.reject(),0===e&&a.sync()})).always((function(){a.unlockfiles({files:d})}))};return a.isCommandEnabled(s.name,c.hash)&&t.length?(a.oldAPI?m(t):a.option("copyOverwrite",c.hash)?(n=e.map(t,(function(e){return e.name})),c.hash==a.cwd().hash?f(e.map(a.files(),(function(e){return e.phash==c.hash?{hash:e.hash,name:e.name}:null}))):a.request({data:{cmd:"ls",target:c.hash,intersect:n},notify:{type:"prepare",cnt:1,hideCnt:!0},preventFail:!0}).always((function(e){f(e.list)}))):m(t),i):i.resolve()}(m)).done((function(e,t){v.resolve(t&&t.undo?t:void 0)})).fail((function(){v.reject()})).always((function(){u&&a.clipboard([])}))})).fail((function(){v.reject()}))),v):v.reject([f,d[0].name,"errPerm"]):v.reject()}},h.prototype.commands.places=function(){var t=this,n=this.fm,i=null;this.getstate=function(n){var o,r,s=this.hashes(n),a=s.length;return i&&a&&a==(o=s,r=!0,e.grep(t.files(o),(function(e){return r=!(!r||"directory"!=e.mime)}))).length?0:-1},this.exec=function(t){var n=this.files(t);return i.trigger("regist",[n]),e.Deferred().resolve()},n.one("load",(function(){i=n.ui.places}))},h.prototype.commands.preference=function(){var t,n,i=this,o=this.fm,r="replace",s='<li class="'+o.res("class","tabstab")+' elfinder-preference-tab-{id}"><a href="#'+o.namespace+'-preference-{id}" id="'+o.namespace+'-preference-tab-{id}" class="ui-tabs-anchor {class}">{title}</a></li>',a=e('<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-preference">'),l=e('<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-top">'),c=e('<div class="elfinder-preference-tabs ui-tabs-panel ui-widget-content ui-corner-bottom"></div>'),d=(e("base").length&&document.location.href.replace(/#.*$/,""),function(t){e("#"+o.namespace+"-preference-tab-"+t).trigger("mouseover").trigger("click"),n=t}),h=o.res("class","tabsactive");this.shortcuts=[{pattern:"ctrl+comma",description:this.title}],this.alwaysEnabled=!0,this.getstate=function(){return 0},this.exec=function(u,p){var f,m,g,v,b,y,x,w,_,k,C,S,T,E,A,O,D;return!t&&(O=i.options.categories||{language:["language"],theme:["theme"],toolbar:["toolbarPref"],workspace:["iconSize","columnPref","selectAction","makefileTypes","useStoredEditor","editorMaximized","useFullscreen","showHidden"],dialog:["autoFocusDialog"],selectionInfo:["infoItems","hashChecker"],reset:["clearBrowserData"],all:!0},D=i.options.prefs||["language","theme","toolbarPref","iconSize","columnPref","selectAction","makefileTypes","useStoredEditor","editorMaximized","useFullscreen","showHidden","infoItems","hashChecker","autoFocusDialog","clearBrowserData"],o.cookieEnabled||delete O.language,D=o.arrayFlip(D,!0),o.options.getFileCallback&&delete D.selectAction,o.UA.Fullscreen||delete D.useFullscreen,D.language&&(D.language=(f=e("<select></select>").on("change",(function(){var t=e(this).val();o.storage("lang",t),e("#"+o.id).elfinder("reload")})),m=[],g=i.options.langs||{ar:"العربية",bg:"Български",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",el:"Ελληνικά",en:"English",es:"Español",fa:"فارسی",fo:"Føroyskt",fr:"Français",fr_CA:"Français (Canada)",he:"עברית",hr:"Hrvatski",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"日本語",ko:"한국어",nl:"Nederlands",
162no:"Norsk",pl:"Polski",pt_BR:"Português",ro:"Română",ru:"Pусский",si:"සිංහල",sk:"Slovenčina",sl:"Slovenščina",sr:"Srpski",sv:"Svenska",tr:"Türkçe",ug_CN:"ئۇيغۇرچە",uk:"Український",vi:"Tiếng Việt",zh_CN:"简体中文",zh_TW:"正體中文"},o.cookieEnabled?(e.each(g,(function(e,t){m.push('<option value="'+e+'">'+t+"</option>")})),f.append(m.join("")).val(o.lang)):e())),D.theme&&(D.theme=function(){var t=o.options.themes?Object.keys(o.options.themes).length:0;if(0===t||1===t&&o.options.themes.default)return null;var n=e("<select></select>").on("change",(function(){var t=e(this).val();o.changeTheme(t).storage("theme",t)})),i={image:'<img class="elfinder-preference-theme elfinder-preference-theme-image" src="$2" />',link:'<a href="$1" target="_blank" title="$3">$2</a>',data:'<dt>$1</dt><dd><span class="elfinder-preference-theme elfinder-preference-theme-$0">$2</span></dd>'},r=["image","description","author","email","license"],s=e('<button class="ui-button ui-corner-all ui-widget elfinder-preference-theme-default"></button>').text(o.i18n("default")).on("click",(function(e){n.val("default").trigger("change")})),a=e('<div class="elfinder-reference-hide-taball"></div>').on("click","button",(function(){var t=e(this).data("themeid");n.val(t).trigger("change")}));return o.options.themes.default||n.append('<option value="default">'+o.i18n("default")+"</option>"),e.each(o.options.themes,(function(t,s){var l,c=e('<option class="elfinder-theme-option-'+t+'" value="'+t+'">'+o.i18n(t)+"</option>"),d=e('<fieldset class="ui-widget ui-widget-content ui-corner-all elfinder-theme-list-'+t+'"><legend>'+o.i18n(t)+'</legend><div><span class="elfinder-spinner"></span></div></fieldset>');n.append(c),a.append(d),l=setTimeout((function(){d.find("span.elfinder-spinner").replaceWith(o.i18n(["errRead",t]))}),1e4),o.getTheme(t).always((function(){l&&clearTimeout(l)})).done((function(s){var a,l=e(),h=e("<dl></dl>");a=s.link?i.link.replace(/\$1/g,s.link).replace(/\$3/g,o.i18n("website")):"$2",s.name&&c.html(o.i18n(s.name)),d.children("legend").html(a.replace(/\$2/g,o.i18n(s.name)||t)),e.each(r,(function(r,a){var l,c=i[a]||i.data;s[a]&&(l=c.replace(/\$0/g,o.escape(a)).replace(/\$1/g,o.i18n(a)).replace(/\$2/g,o.i18n(s[a])),"image"===a&&s.link&&(l=e(l).on("click",(function(){n.val(t).trigger("change")})).attr("title",o.i18n("select"))),h.append(l))})),l=(l=l.add(h)).add(e('<div class="elfinder-preference-theme-btn"></div>').append(e('<button class="ui-button ui-corner-all ui-widget"></button>').data("themeid",t).html(o.i18n("select")))),d.find("span.elfinder-spinner").replaceWith(l)})).fail((function(){d.find("span.elfinder-spinner").replaceWith(o.i18n(["errRead",t]))}))})),e("<div></div>").append(n.val(o.theme&&o.theme.id?o.theme.id:"default"),s,a)}()),D.toolbarPref&&(D.toolbarPref=(v=e.map(o.options.uiOptions.toolbar,(function(e){return Array.isArray(e)?e:null})),b=[],y=o.storage("toolbarhides")||{},e.each(v,(function(){var e=this,t=o.i18n("cmd"+e);t==="cmd"+e&&(t=o.i18n(e)),b.push('<span class="elfinder-preference-toolbar-item"><label><input type="checkbox" value="'+e+'" '+(y[e]?"":"checked")+"/>"+t+"</label></span>")})),e(b.join(" ")).on("change","input",(function(){var t=e(this).val(),n=e(this).is(":checked");n||y[t]?n&&y[t]&&delete y[t]:y[t]=!0,o.storage("toolbarhides",y),o.trigger("toolbarpref")})))),D.iconSize&&(D.iconSize=(x=o.options.uiOptions.cwd.iconsView.sizeMax||3,w=o.storage("iconsize")||o.options.uiOptions.cwd.iconsView.size||0,_=e('<div class="touch-punch"></div>').slider({classes:{"ui-slider-handle":"elfinder-tabstop"},value:w,max:x,slide:function(e,t){o.getUI("cwd").trigger("iconpref",{size:t.value})},change:function(e,t){o.storage("iconsize",t.value)}}),o.getUI("cwd").on("iconpref",(function(e,t){_.slider("option","value",t.size)})),_)),D.columnPref&&(D.columnPref=function(){var t=o.options.uiOptions.cwd.listView.columns,n=[],i=o.storage("columnhides")||{};return e.each(t,(function(){var e=this,t=o.getColumnName(e);n.push('<span class="elfinder-preference-column-item"><label><input type="checkbox" value="'+e+'" '+(i[e]?"":"checked")+"/>"+t+"</label></span>")})),e(n.join(" ")).on("change","input",(function(){var t=e(this).val(),n=e(this).is(":checked");n||i[t]?n&&i[t]&&delete i[t]:i[t]=!0,o.storage("columnhides",i),o.trigger("columnpref",{repaint:!0})}
162))}()),D.selectAction&&(D.selectAction=function(){var t=e("<select></select>").on("change",(function(){var t=e(this).val();o.storage("selectAction","default"===t?null:t)})),n=[],r=i.options.selectActions,s=o.getCommand("open").options.selectAction||"open";return-1===e.inArray(s,r)&&r.unshift(s),e.each(r,(function(t,i){var r=e.map(i.split("/"),(function(e){var t=o.i18n("cmd"+e);return t==="cmd"+e&&(t=o.i18n(e)),t}));n.push('<option value="'+i+'">'+r.join("/")+"</option>")})),t.append(n.join("")).val(o.storage("selectAction")||s)}()),D.makefileTypes&&(D.makefileTypes=function(){var t=o.getCommand("edit").getMkfileHides(),n=function(){var n=[];return t=o.getCommand("edit").getMkfileHides(),e.each(o.mimesCanMakeEmpty,(function(e,i){var r=o.getCommand("mkfile").getTypeName(e,i);n.push('<span class="elfinder-preference-column-item" title="'+o.escape(r)+'"><label><input type="checkbox" value="'+e+'" '+(t[e]?"":"checked")+"/>"+i+"</label></span>")})),n.join(" ")},i=e("<div></div>").on("change","input",(function(){var n=e(this).val(),i=e(this).is(":checked");i||t[n]?i&&t[n]&&delete t[n]:t[n]=!0,o.storage("mkfileHides",t),o.trigger("canMakeEmptyFile")})).append(n()),r=e("<div></div>").append(e('<input type="text" placeholder="'+o.i18n("typeOfTextfile")+'"/>').on("keydown",(function(t){t.keyCode===e.ui.keyCode.ENTER&&e(this).next().trigger("click")})),e('<button class="ui-button"></button>').html(o.i18n("add")).on("click",(function(){var t,n=e(this).prev(),i=n.val(),r=o.getUI("toast"),s=function(){return r.appendTo(n.closest(".ui-dialog")),o.toast({msg:o.i18n("errUsupportType"),mode:"warning",onHidden:function(){1===r.children().length&&r.appendTo(o.getUI())}}),n.trigger("focus"),!1};if(!i.match(/\//)){if(!(i=o.arrayFlip(o.mimeTypes)[i]))return s();n.val(i)}if(!o.mimeIsText(i)||!o.mimeTypes[i])return s();o.trigger("canMakeEmptyFile",{mimes:[i],unshift:!0}),(t={})[i]=o.mimeTypes[i],o.storage("mkfileTextMimes",Object.assign(t,o.storage("mkfileTextMimes")||{})),n.val(""),r.appendTo(n.closest(".ui-dialog")),o.toast({msg:o.i18n(["complete",i+" ("+t[i]+")"]),onHidden:function(){1===r.children().length&&r.appendTo(o.getUI())}})})),e('<button class="ui-button"></button>').html(o.i18n("reset")).on("click",(function(){o.one("canMakeEmptyFile",{done:function(){i.empty().append(n())}}),o.trigger("canMakeEmptyFile",{resetTexts:!0})})));return o.bind("canMakeEmptyFile",{done:function(e){e.data&&e.data.mimes&&e.data.mimes.length&&i.empty().append(n())}}),e("<div></div>").append(i,r)}()),D.useStoredEditor&&(D.useStoredEditor=e('<input type="checkbox"/>').prop("checked",(k=o.storage("useStoredEditor"),k?k>0:o.options.commandsOptions.edit.useStoredEditor)).on("change",(function(t){o.storage("useStoredEditor",e(this).is(":checked")?1:-1)}))),D.editorMaximized&&(D.editorMaximized=e('<input type="checkbox"/>').prop("checked",function(){var e=o.storage("editorMaximized");return e?e>0:o.options.commandsOptions.edit.editorMaximized}()).on("change",(function(t){o.storage("editorMaximized",e(this).is(":checked")?1:-1)}))),D.useFullscreen&&(D.useFullscreen=e('<input type="checkbox"/>').prop("checked",function(){var e=o.storage("useFullscreen");return e?e>0:"screen"===o.options.commandsOptions.fullscreen.mode}()).on("change",(function(t){o.storage("useFullscreen",e(this).is(":checked")?1:-1)}))),D.showHidden&&(S=function(){var t,n=o.storage("hide"),i=[];n&&n.items&&e.each(n.items,(function(e,t){i.push(o.escape(t))})),A.prop("disabled",!i.length)[i.length?"removeClass":"addClass"]("ui-state-disabled"),t=i.length?i.join("\n"):"",D.showHidden.attr("title",t),C&&D.showHidden.tooltip("option","content",t.replace(/\n/g,"<br>")).tooltip("close")},T=e('<input type="checkbox"/>').prop("checked",function(){var e=o.storage("hide");return e&&e.show}()).on("change",(function(t){var n={};n[e(this).is(":checked")?"show":"hide"]=!0,o.exec("hide",void 0,n)})),E=e('<button class="ui-button ui-corner-all ui-widget"></button>').append(o.i18n("reset")).on("click",(function(){o.exec("hide",void 0,{reset:!0}),e(this).parent().find("input:first").prop("checked",!1),S()})),A=e().add(T).add(E),D.showHidden=e("<div></div>").append(T,E),o.bind("hide",(function(e){var t=e.data;t.opts&&(t.opts.show||t.opts.hide)||S()})),o.UA.Mobile&&e.fn.tooltip&&(C=!0,D.showHidden.tooltip({classes:{"ui-tooltip":"elfinder-ui-tooltip ui-widget-shadow"},tooltipClass:"elfinder-ui-tooltip ui-widget-shadow",track:!0}).css("user-select","none"),E.css("user-select","none")),S()),D.infoItems&&(D.infoItems=function(){var t=o.getCommand("info").items,n=[],i=o.storage("infohides")||o.arrayFlip(o.options.commandsOptions.info.hideItems,!0);return e.each(t,(function(){var e=this,t=o.i18n(e);n.push('<span class="elfinder-preference-info-item"><label><input type="checkbox" value="'+e+'" '+(i[e]?"":"checked")+"/>"+t+"</label></span>")})),e(n.join(" ")).on("change","input",(function(){var t=e(this).val(),n=e(this).is(":checked");n||i[t]?n&&i[t]&&delete i[t]:i[t]=!0,o.storage("infohides",i),o.trigger("infopref",{repaint:!0})}
162))}()),D.hashChecker&&o.hashCheckers.length&&(D.hashChecker=function(){var t=[],n=o.arrayFlip(o.storage("hashchekcer")||o.options.commandsOptions.info.showHashAlgorisms,!0);return e.each(o.hashCheckers,(function(){var e=this,i=o.i18n(e);t.push('<span class="elfinder-preference-hashchecker-item"><label><input type="checkbox" value="'+e+'" '+(n[e]?"checked":"")+"/>"+i+"</label></span>")})),e(t.join(" ")).on("change","input",(function(){var t=e(this).val();e(this).is(":checked")?n[t]=!0:n[t]&&delete n[t],o.storage("hashchekcer",e.grep(o.hashCheckers,(function(e){return n[e]})))}))}()),D.autoFocusDialog&&(D.autoFocusDialog=e('<input type="checkbox"/>').prop("checked",function(){var e=o.storage("autoFocusDialog");return e?e>0:o.options.uiOptions.dialog.focusOnMouseOver}()).on("change",(function(t){o.storage("autoFocusDialog",e(this).is(":checked")?1:-1)}))),D.clearBrowserData&&(D.clearBrowserData=e("<button></button>").text(o.i18n("reset")).button().on("click",(function(t){t.preventDefault(),o.storage(),e("#"+o.id).elfinder("reload")}))),e.each(O,(function(t,i){var a,d;!0===i?d=1:i&&(a=e(),e.each(i,(function(t,n){var i,r,s,l="";(i=D[n])&&(d=2,r=o.i18n(n),(s=e(i).filter('input[type="checkbox"]')).length||(s=e(i).find('input[type="checkbox"]')),1===s.length?(s.attr("id")||s.attr("id","elfinder-preference-"+n+"-checkbox"),r='<label for="'+s.attr("id")+'">'+r+"</label>"):s.length>1&&(l=" elfinder-preference-checkboxes"),a=a.add(e('<dt class="elfinder-preference-'+n+l+'">'+r+"</dt>")).add(e('<dd class="elfinder-preference-'+n+l+'"></dd>').append(i)))}))),d&&(l.append(s[r](/\{id\}/g,t)[r](/\{title\}/,o.i18n(t))[r](/\{class\}/,n===t?"elfinder-focus":"")),2===d&&c.append(e('<div id="'+o.namespace+"-preference-"+t+'" class="elfinder-preference-content"></div>').hide().append(e("<dl></dl>").append(a))))})),l.on("click","a",(function(t){var n=e(t.target),i=n.attr("href");t.preventDefault(),t.stopPropagation(),l.children().removeClass(h),n.removeClass("ui-state-hover").parent().addClass(h),i.match(/all$/)?c.addClass("elfinder-preference-taball").children().show():(c.removeClass("elfinder-preference-taball").children().hide(),e(i).show())})).on("focus blur","a",(function(t){e(this).parent().toggleClass("ui-state-focus","focusin"===t.type)})).on("mouseenter mouseleave","li",(function(t){e(this).toggleClass("ui-state-hover","mouseenter"===t.type)})),c.find("a,input,select,button").addClass("elfinder-tabstop"),a.append(l,c),(t=i.fmDialog(a,{title:i.title,width:i.options.width||600,height:i.options.height||400,maxWidth:"window",maxHeight:"window",autoOpen:!1,destroyOnClose:!1,allowMinimize:!1,open:function(){n&&d(n),n=null},resize:function(){c.height(t.height()-l.outerHeight(!0)-(c.outerHeight(!0)-c.height())-5)}}).on("click",(function(e){e.stopPropagation()})).css({overflow:"hidden"})).closest(".ui-dialog").css({overflow:"hidden"}).addClass("elfinder-bg-translucent"),n="all"),p&&(p.tab?d(p.tab):"cwd"===p._currentType&&d("workspace")),t.elfinderdialog("open"),e.Deferred().resolve()}},(h.prototype.commands.quicklook=function(){var t,n,i,o,r,s,a,l,c,d,h=this,u=h.fm,p=0,f=Element.update?"quicklookupdate":"update",m="elfinder-quicklook-navbar-icon",g="elfinder-quicklook-fullscreen",v="elfinder-quicklook-info-wrapper",b=function(t){e(document).trigger(e.Event("keydown",{keyCode:t,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))},y=function(e){var t,n=u.getUI().offset(),i=(t=e.find(".elfinder-cwd-file-wrapper")).length?t:e,o=i.offset()||{top:0,left:0};return{opacity:0,width:i.width(),height:i.height()-30,top:o.top-n.top,left:o.left-n.left}},x={},w=function(e,t){var n=t||e.substr(0,e.indexOf("/")),i=x[n]?x[n]:x[n]=document.createElement(n),o=!1;try{o=i.canPlayType&&i.canPlayType(e)}catch(e){}return!(!o||""===o||"no"==o)},_=-1!=window.navigator.platform.indexOf("Win"),k=!1,C=!1,S=!1,T=null,E=e.ui.keyCode.LEFT,A=e.ui.keyCode.RIGHT,O="mousemove touchstart "+("onwheel"in document?"wheel":"onmousewheel"in document?"mousewheel":"DOMMouseScroll"),D=e('<span class="elfinder-dialog-title elfinder-quicklook-title"></span>'),I=e("<div></div>"),P=e('<div class="elfinder-quicklook-info"></div>'),M=e('<div class="ui-front elfinder-quicklook-cover"></div>'),R=e('<div class="'+m+" "+m+'-fullscreen"></div>').on("click touchstart",(function(t){if(!S){var n=h.window,i=n.hasClass(g),r=e(window),s=function(){h.preview.trigger("changesize")};t.stopPropagation(),t.preventDefault(),i?(q="",N(),n.toggleClass(g).css(n.data("position")),r.trigger(h.resize).off(h.resize,s),B.off("mouseenter mouseleave"),M.off(O)):(n.toggleClass(g).data("position",{left:n.css("left"),top:n.css("top"),width:n.width(),height:n.height(),display:"block"}).removeAttr("style"),e(window).on(h.resize,s).trigger(h.resize),M.on(O,(function(e){C||("mousemove"!==e.type&&"touchstart"!==e.type||(N(),T=setTimeout((function(){(u.UA.Mobile||B.parent().find(".elfinder-quicklook-navbar:hover").length<1)&&B.fadeOut("slow",(function(){M.show()}))}),3e3)),M.is(":visible")&&(F(),M.data("tm",setTimeout((function(){M.show()}),3e3))))})).show().trigger("mousemove"),B.on("mouseenter mouseleave",(function(e){C||("mouseenter"
162===e.type?N():M.trigger("mousemove"))}))),u.zIndex&&n.css("z-index",u.zIndex+1),u.UA.Mobile?B.attr("style",q):B.attr("style",q).draggable(i?"destroy":{start:function(){C=!0,S=!0,M.show(),N()},stop:function(){C=!1,q=h.navbar.attr("style"),requestAnimationFrame((function(){S=!1}))}}),e(this).toggleClass(m+"-fullscreen-off");var a=n;o.is(".ui-resizable")&&(a=a.add(o)),a.resizable(i?"enable":"disable").removeClass("ui-state-disabled"),n.trigger("viewchange")}})),z=function(){h.update(void 0,function(){var t,n=h.fm,i=n.selectedFiles(),o=i.length;h.docked();return o||(o=1,i=[n.cwd()]),1===o?i[0]:(t=0,e.each(i,(function(e,n){var i=parseInt(n.ts);t>=0?i>t&&(t=i):t="unknown"})),{hash:i[0].hash+"/"+ +new Date,name:n.i18n("items")+": "+o,mime:"group",size:$,ts:t,files:e.map(i,(function(e){return e.hash})),getSize:!0})}())},N=function(){h.window.hasClass(g)&&(T&&clearTimeout(T),T=null,B.stop(!0,!0).css("display","block"),F())},F=function(){M.data("tm")&&clearTimeout(M.data("tm")),M.removeData("tm"),M.hide()},L=e('<div class="'+m+" "+m+'-prev"></div>').on("click touchstart",(function(e){return!S&&b(E),!1})),j=e('<div class="'+m+" "+m+'-next"></div>').on("click touchstart",(function(e){return!S&&b(A),!1})),B=e('<div class="elfinder-quicklook-navbar"></div>').append(L).append(R).append(j).append('<div class="elfinder-quicklook-navbar-separator"></div>').append(e('<div class="'+m+" "+m+'-close"></div>').on("click touchstart",(function(e){return!S&&h.window.trigger("close"),!1}))),H=e('<span class="ui-front ui-icon elfinder-icon-close ui-icon-closethick"></span>').on("mousedown",(function(e){e.stopPropagation(),h.window.trigger("close")})),U=e('<span class="ui-front ui-icon elfinder-icon-minimize ui-icon-minusthick"></span>').on("mousedown",(function(e){e.stopPropagation(),h.docked()?h.window.trigger("navdockout"):h.window.trigger("navdockin")})),$='<span class="elfinder-spinner-text">'+u.i18n("calc")+'</span><span class="elfinder-spinner"></span>',q="",W=!0;this.flags={},this.cover=M,this.evUpdate=f,(this.navbar=B)._show=N,this.resize="resize."+u.namespace,this.info=e("<div></div>").addClass(v).append(I).append(P),this.autoPlay=function(){return!!h.opened()&&!!h.options[h.docked()?"dockAutoplay":"autoplay"]},this.preview=e('<div class="elfinder-quicklook-preview ui-helper-clearfix"></div>').on("change",(function(){N(),B.attr("style",q),h.docked()&&B.hide(),h.preview.attr("style","").removeClass("elfinder-overflow-auto"),h.info.attr("style","").hide(),h.cover.removeClass("elfinder-quicklook-coverbg"),I.removeAttr("class").attr("style",""),P.html("")})).on(f,(function(t){h.preview;var n,i,o,s=t.file,a='<div class="elfinder-quicklook-info-data">{value}</div>',c=[];s&&!Object.keys(s).length&&(s=u.cwd()),s&&l&&"pending"===l.state()&&l._hash!==s.hash&&l.reject(),s&&(t.forceUpdate||h.window.data("hash")!==s.hash)?(o=h.window.css("overflow","hidden"),i=u.escape(s.i18||s.name),!s.read&&t.stopImmediatePropagation(),h.window.data("hash",s.hash),h.preview.off("changesize").trigger("change").children().remove(),D.html(i),L.css("visibility",""),j.css("visibility",""),s.hash===u.cwdId2Hash(r.find("[id]:not(.elfinder-cwd-parent):first").attr("id"))&&L.css("visibility","hidden"),s.hash===u.cwdId2Hash(r.find("[id]:last").attr("id"))&&j.css("visibility","hidden"),"directory"===s.mime?c=[s.hash]:"group"===s.mime&&s.getSize&&(c=s.files),P.html(a.replace(/\{value\}/,i)+a.replace(/\{value\}/,u.mime2kind(s))+a.replace(/\{value\}/,c.length?$:u.formatSize(s.size))+a.replace(/\{value\}/,u.i18n("modify")+": "+u.formatDate(s))),c.length&&((l=u.getSize(c).done((function(e){P.find("span.elfinder-spinner").parent().html(e.formated)})).fail((function(){P.find("span.elfinder-spinner").parent().html(u.i18n("unknown"))})).always((function(){l=null})))._hash=s.hash),I.addClass("elfinder-cwd-icon ui-corner-all "+u.mime2class(s.mime)),s.icon&&I.css(u.getIconStyle(s,!0)),h.info.attr("class",v),s.csscls&&h.info.addClass(s.csscls),s.read&&(n=u.tmb(s))&&e("<img/>").hide().appendTo(h.preview).on("load",(function(){I.addClass(n.className).css("background-image","url('"+n.url+"')"),e(this).remove()})).attr("src",n.url),h.info.delay(100).fadeIn(10),h.window.hasClass(g)&&M.trigger("mousemove"),o.css("overflow","")):t.stopImmediatePropagation()})),this.window=e('<div class="ui-front ui-helper-reset ui-widget elfinder-quicklook touch-punch" style="position:absolute"></div>').hide().addClass(u.UA.Touch?"elfinder-touch":"").on("click",(function(e){var t=this;e.stopPropagation(),2===p&&requestAnimationFrame((function(){2===p&&u.toFront(t)}))}
162)).append(e('<div class="ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-clearfix elfinder-quicklook-titlebar"></div>').append(e('<span class="ui-widget-header ui-dialog-titlebar-close ui-corner-all elfinder-titlebar-button elfinder-quicklook-titlebar-icon'+(_?" elfinder-titlebar-button-right":"")+'"></span>').append(H,U),D),this.preview,h.info.hide(),M.hide(),B).draggable({handle:"div.elfinder-quicklook-titlebar"}).on("open",(function(i,o){var r=h.window,a=h.value,l=u.getUI("cwd"),d=function(e){p=e,h.update(1,h.value),h.change(),r.trigger("resize."+u.namespace)};W||0!==p?4===p&&(u.getUI("navdock").data("addNode")(c),d(3),h.preview.trigger("changesize"),u.storage("previewDocked","1"),0===u.getUI("navdock").width()&&r.trigger("navdockout")):(a&&a.hash!==s&&(l=u.cwdHash2Elm(a.hash.split("/",2)[0])),q="",B.attr("style",""),p=1,l.trigger("scrolltoview"),F(),r.css(o||y(l)).show().animate(function(){var i=h.options.contain||u.options.dialogContained,o=i?u.getUI():e(window),r=u.getUI().offset(),s=Math.min(t,o.width()-10),a=Math.min(n,o.height()-80);return{opacity:1,width:s,height:a,top:parseInt((o.height()-a-60)/2+(i?0:o.scrollTop()-r.top)),left
162:parseInt((o.width()-s)/2+(i?0:o.scrollLeft()-r.left))}}(),550,(function(){d(2),N()})),u.toFront(r))})).on("close",(function(e,t){var n,i=h.window,o=h.preview.trigger("change"),s=(h.value,(i.data("hash")||"").split("/",2)[0]),a=function(e,n){p=e,n&&u.toHide(i),o.children().remove(),h.update(0,h.value),i.data("hash",""),t&&t.resolve()};h.opened()&&(l&&"pending"===l.state()&&l.reject(),h.docked()?(c=u.getUI("navdock").data("removeNode")(h.window.attr("id"),"detach"),a(4),u.storage("previewDocked","2")):(p=1,i.hasClass(g)&&R.click(),s&&(n=r.find("#"+s)).length?i.animate(y(n),500,(function(){o.off("changesize"),a(0,!0)})):a(0,!0)))})).on("navdockin",(function(e,t){var n=h.window,o=u.getUI("navdock"),r=a||o.width(),s=t||{};W&&(s.init=!0),p=3,i=n.attr("style"),n.toggleClass("ui-front").removeClass("ui-widget").draggable("disable").resizable("disable").removeAttr("style").css({width:"100%",height:r,boxSizing:"border-box",paddingBottom:0,zIndex:"unset"}),B.hide(),U.toggleClass("ui-icon-plusthick ui-icon-minusthick elfinder-icon-full elfinder-icon-minimize"),u.toHide(n,!0),o.data("addNode")(n,s),h.preview.trigger("changesize"),u.storage("previewDocked","1")})).on("navdockout",(function(t){var n=h.window,o=u.getUI("navdock"),r=(e.Deferred(),y(h.preview));a=n.outerHeight(),o.data("removeNode")(n.attr("id"),u.getUI()),n.toggleClass("ui-front").addClass("ui-widget").draggable("enable").resizable("enable").attr("style",i),U.toggleClass("ui-icon-plusthick ui-icon-minusthick elfinder-icon-full elfinder-icon-minimize"),p=0,n.trigger("open",r),u.storage("previewDocked","0")})).on("resize."+u.namespace,(function(){h.preview.trigger("changesize")})),this.alwaysEnabled=!0,this.value=null,this.handlers={select:function(e,t){d&&cancelAnimationFrame(d),e.data&&e.data.selected&&e.data.selected.length?h.opened()&&z():d=requestAnimationFrame((function(){h.opened()&&z()}))},error:function(){h.window.is(":visible")&&h.window.trigger("close")},"searchshow searchhide":function(){this.opened()&&this.window.trigger("close")},navbarshow:function(){requestAnimationFrame((function(){h.docked()&&h.preview.trigger("changesize")}))},destroy:function(){h.window.remove()}},this.shortcuts=[{pattern:"space"}],this.support={audio:{ogg:w("audio/ogg;"),webm:w("audio/webm;"),mp3:w("audio/mpeg;"),wav:w("audio/wav;"),m4a:w("audio/mp4;")||w("audio/x-m4a;")||w("audio/aac;"),flac:w("audio/flac;"),amr:w("audio/amr;")},video:{ogg:w("video/ogg;"),webm:w("video/webm;"),mp4:w("video/mp4;"),mkv:w("video/x-matroska;")||w("video/webm;"),"3gp":w("video/3gpp;")||w("video/mp4;"),m3u8:w("application/x-mpegURL","video")||w("application/vnd.apple.mpegURL","video"),mpd:w("application/dash+xml","video")}},x={},this.closed=function(){return 0==p||4==p},this.opened=function(){return 2==p||3==p},this.docked=function(){return 3==p},this.addIntegration=function(e){requestAnimationFrame((function(){u.trigger("helpIntegration",Object.assign({cmd:"quicklook"},e))}))},this.init=function(){var i,l=this.options,c=this.window,d=this.preview;t=l.width>0?parseInt(l.width):450,n=l.height>0?parseInt(l.height):300,"auto"!==l.dockHeight&&((a=parseInt(l.dockHeight))||(a=void 0)),u.one("load",(function(){!(k=u.getUI("navdock").data("dockEnabled"))&&U.hide(),o=u.getUI(),r=u.getUI("cwd"),u.zIndex&&c.css("z-index",u.zIndex+1),c.appendTo(o),e(document).on("keydown."+u.namespace,(function(t){t.keyCode==e.ui.keyCode.ESCAPE&&h.opened()&&!h.docked()&&c.hasClass("elfinder-frontmost")&&c.trigger("close")})),c.resizable({handles:"se",minWidth:350,minHeight:120,resize:function(){d.trigger("changesize")}}),h.change((function(){h.opened()&&h.value&&(h.value.tmb&&1==h.value.tmb&&(h.value=Object.assign({},u.file(h.value.hash))),d.trigger(e.Event(f,{file:h.value})))})),d.on(f,(function(e){var t,n,o;if(t=e.file){if(n=t.hash,o=u.searchStatus.mixed&&u.searchStatus.state>1,"directory"!==t.mime)if(parseInt(t.size)||t.mime.match(l.mimeRegexNotEmptyCheck)){if(h.dispInlineRegex=i,o||u.optionsByHashes[n])try{h.dispInlineRegex=new RegExp(u.option("dispInlineRegex",n),"i")}catch(e){try{h.dispInlineRegex=new RegExp(u.isRoot(t)?u.options.dispInlineRegex:u.option("dispInlineRegex",t.phash),"i")}catch(e){h.dispInlineRegex=/^$/}}}else e.stopImmediatePropagation();else h.dispInlineRegex=/^$/;h.info.show()}else e.stopImmediatePropagation()})),e.each(u.commands.quicklook.plugins||[],(function(e,t){"function"==typeof t&&new t(h)}))})).one("open",(function(){var e,t=Number(u.storage("previewDocked")||l.docked);k&&t>=1&&(e=h.window,h.exec(),e.trigger("navdockin",{init:!0}),2===t?e.trigger("close"):(h.update(void 0,u.cwd()),h.change())),W=!1})).bind("open",(function(){s=u.cwd().hash,h.value=u.cwd();try{i=new RegExp(u.option("dispInlineRegex"),"i")}catch(e){i=/^$/}})).bind("change",(function(t){t.data&&t.data.changed&&h.opened()&&e.each(t.data.changed,(function(){if(h.window.data("hash")===this.hash)return h.window.data("hash",null),h.preview.trigger(f),!1}))})).bind("navdockresizestart navdockresizestop",(function(e){M["navdockresizestart"===e.type?"show":"hide"]()}))},this.getstate=function(){return h.opened()?1:0},this.exec=function(){return h.closed()&&z(),h.enabled()&&h.window.trigger(h.opened()?"close"
162:"open"),e.Deferred().resolve()},this.hideinfo=function(){this.info.stop(!0,!0).hide()}}).prototype={forceLoad:!0},h.prototype.commands.quicklook.plugins=[function(t){var n,i,o=["image/jpeg","image/png","image/gif","image/svg+xml","image/x-ms-bmp"],r=t.fm.returnBytes(t.options.getDimThreshold||0),s=t.preview;(n=new Image).onload=n.onerror=function(){2==n.height&&o.push("image/webp")},n.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA",e.each(navigator.mimeTypes,(function(t,n){var i=n.type;0===i.indexOf("image/")&&e.inArray(i,o)&&o.push(i)})),s.on(t.evUpdate,(function(n){var a,l,c,d,h=t.fm,u=n.file,p=!1,f=null,m=function(e){var t=h.file(u.hash);t.width=e[0],t.height=e[1]},g=function(){var e,t,n,i,o;f&&f.state&&"pending"===f.state()&&f.reject(),p||(p=!0,e=a.get(0),(t=u.width&&u.height?{w:u.width,h:u.height}:e.naturalWidth?null:{w:a.width(),h:a.height()})&&a.removeAttr("width").removeAttr("height"),n=u.width||e.naturalWidth||e.width||a.width(),i=u.height||e.naturalHeight||e.height||a.height(),u.width&&u.height||m([n,i]),t&&a.width(t.w).height(t.h),o=(n/i).toFixed(2),s.on("changesize",(function(){var e,t,n=parseInt(s.width()),i=parseInt(s.height());o<(n/i).toFixed(2)?(t=i,e=Math.floor(t*o)):(e=n,t=Math.floor(e/o)),a.width(e).height(t).css("margin-top",t<i?Math.floor((i-t)/2):0)})).trigger("changesize"),a.fadeIn(100))};i||(i=h.arrayFlip(o)),i[u.mime]&&t.dispInlineRegex.test(u.mime)&&(n.stopImmediatePropagation(),l=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+h.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),c=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(l),a=e("<img/>").hide().appendTo(s).on("load",(function(){l.remove(),t.hideinfo(),g()})).on("error",(function(){l.remove()})),d=h.openUrl(u.hash,!1,(function(e){a.attr("src",e)}),{progressBar:c}),s.one("change",(function(){d&&d.state&&"pending"===d.state()&&d.reject()})),u.width&&u.height?g():u.size>r&&(f=h.request({data:{cmd:"dim",target:u.hash},preventDefault:!0}).done((function(e){if(e.dim){var t=e.dim.split("x");u.width=t[0],u.height=t[1],m(t),g()}}))))}))},function(t){var n=t.fm,i=t.preview;window.Worker&&window.Uint8Array&&i.on(t.evUpdate,(function(o){var r,s,a,l,c,d=o.file,h=function(e){l&&l.terminate(),r.remove(),n.debug("error",e)};"image/tiff"===d.mime&&(o.stopImmediatePropagation(),r=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),s=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(r),i.one("change",(function(){l&&l.terminate(),r.remove()})),c=n.getContents(d.hash,"arraybuffer",{progressBar:s}).done((function(o){if(o){a=e("<div></div>").css({width:"100%",height:"100%"}).hide().appendTo(i);try{(l=n.getWorker()).onmessage=function(o){var s,c,h,u,p,f,m=o.data;l&&l.terminate(),c=(s=document.createElement("canvas")).getContext("2d"),s.width=m.width,s.height=m.height,(h=c.createImageData(m.width,m.height)).data.set(new Uint8Array(m.image)),c.putImageData(h,0,0),a.append(s).show(),r.remove(),u=(m.width/m.height).toFixed(2),i.on("changesize",(function(){var t,n,o=parseInt(i.width()),r=parseInt(i.height());u<(o/r).toFixed(2)?(n=r,t=Math.floor(n*u)):(t=o,n=Math.floor(t/u)),e(s).width(t).height(n).css("margin-top",n<r?Math.floor((r-n)/2):0)})).trigger("changesize"),d.width&&d.height||(p=[m.width,m.height],(f=n.file(d.hash)).width=p[0],f.height=p[1]),t.hideinfo()},l.onerror=h,l.postMessage({scripts:[n.options.cdns.tiff,n.getWorkerUrl("quicklook.tiff.js")],data:{data:o}})}catch(e){h(e)}}else h()})),i.one("change",(function(){c&&c.state&&"pending"===c.state()&&c.reject()})))}))},function(t){var n,i=t.fm,o=i.arrayFlip(["image/vnd.adobe.photoshop","image/x-photoshop"]),r=t.preview,s=function(e,o,s){try{i.replaceXhrSend(),n.fromURL(e).then((function(e){var n;o.attr("src",e.image.toBase64()),requestAnimationFrame((function(){n=(o.width()/o.height()).toFixed(2),r.on("changesize",(function(){var e,t,i=parseInt(r.width()),s=parseInt(r.height());n<(i/s).toFixed(2)?(t=s,e=Math.floor(t*n)):(e=i,t=Math.floor(e/n)),o.width(e).height(t).css("margin-top",t<s?Math.floor((s-t)/2):0)})).trigger("changesize"),s.remove(),t.hideinfo(),o.fadeIn(100)}))}),(function(){s.remove(),o.remove()})),i.restoreXhrSend()}catch(e){i.restoreXhrSend(),s.remove(),o.remove()}};r.on(t.evUpdate,(function(a){var l,c,d,h,u,p,f=a.file;o[f.mime]&&i.options.cdns.psd&&!i.UA.ltIE10&&t.dispInlineRegex.test(f.mime)&&(a.stopImmediatePropagation(),c=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+i.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),d=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(c),p=i.openUrl(f.hash,"sameorigin",(function(t){t&&(l=e("<img/>").hide().appendTo(r),n?s(t,l,c):(h=window.define,u=window.require,window.require=null,window.define=null,i.loadScript([i.options.cdns.psd],(function(){n=require("psd"),h?window.define=h:delete window.define,u?window.require=u:delete window.require,s(t,l,c)}))))}),{progressBar:d}),r.one("change",(function(){p&&p.state&&"pending"===p.state()&&p.reject()})))}))},function(t){var n=t.fm,i=n.arrayFlip(["text/html","application/xhtml+xml"]),o=t.preview;o.on(t.evUpdate,(function(r){var s,a,l,c=r.file;i[c.mime]&&t.dispInlineRegex.test(c.mime)&&(!t.options.getSizeMax||c.size<=t.options.getSizeMax)&&(r.stopImmediatePropagation(),a=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),l=e('<div class="elfinder-quicklook-info-progress"></div>
162').appendTo(a),o.one("change",(function(){"pending"==s.state()&&s.reject()})).addClass("elfinder-overflow-auto"),s=n.request({data:{cmd:"get",target:c.hash,conv:1,_t:c.ts},options:{type:"get",cache:!0},preventDefault:!0,progressBar:l}).done((function(n){t.hideinfo();var i=e('<iframe class="elfinder-quicklook-preview-html"></iframe>').appendTo(o)[0].contentWindow.document;i.open(),i.write(n.content),i.close()})).always((function(){a.remove()})))}))},function(t){var n=t.fm,i=n.arrayFlip(["text/x-markdown"]),o=t.preview,r=null,s=function(n,i){t.hideinfo();var s=e('<iframe class="elfinder-quicklook-preview-html"></iframe>').appendTo(o)[0].contentWindow.document;s.open(),s.write((r.parse||r)(n.content)),s.close(),i.remove()},a=function(e){r=!1,e.remove()};o.on(t.evUpdate,(function(l){var c,d,h,u=l.file;i[u.mime]&&n.options.cdns.marked&&!1!==r&&t.dispInlineRegex.test(u.mime)&&(!t.options.getSizeMax||u.size<=t.options.getSizeMax)&&(l.stopImmediatePropagation(),d=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),h=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(d),o.one("change",(function(){"pending"==c.state()&&c.reject()})).addClass("elfinder-overflow-auto"),c=n.request({data:{cmd:"get",target:u.hash,conv:1,_t:u.ts},options:{type:"get",cache:!0},preventDefault:!0,progressBar:h}).done((function(e){r||window.marked?(r||(r=window.marked),s(e,d)):n.loadScript([n.options.cdns.marked],(function(t){r=t||window.marked||!1,delete window.marked,r?s(e,d):a(d)}),{tryRequire:!0,error:function(){a(d)}})})).fail((function(){a(d)})))}))},function(t){if(t.options.viewerjs){var n=t.fm,i=t.preview,o=t.options.viewerjs,r=o.url?n.arrayFlip(o.mimes||[]):[],s=t.window,a=t.navbar,l=function(){a.css("bottom",s.hasClass("elfinder-quicklook-fullscreen")?"30px":"")};o.url&&i.on("update",(function(a){var c,d,h,u,p=a.file;!r[p.mime]||"application/pdf"===p.mime&&o.pdfNative&&t.flags.pdfNative||(a.stopImmediatePropagation(),d=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),h=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(d),u=n.openUrl(p.hash,"sameorigin",(function(n){n&&(c=e('<iframe class="elfinder-quicklook-preview-iframe"></iframe>').css("background-color","transparent").on("load",(function(){t.hideinfo(),d.remove(),c.css("background-color","#fff")})).on("error",(function(){d.remove(),c.remove()})).appendTo(i).attr("src",o.url+"#"+n),s.on("viewchange.viewerjs",l),l(),i.one("change",(function(){s.off("viewchange.viewerjs"),d.remove(),c.off("load").remove()})))}),{progressBar:h}),i.one("change",(function(){u&&u.state&&"pending"===u.state()&&u.reject()})))}))}},function(t){var n=t.fm,i="application/pdf",o=t.preview,r=!1,s="";n.UA.Safari&&"mac"===n.OS&&!n.UA.iOS||n.UA.IE||n.UA.Firefox?r=!0:e.each(navigator.plugins,(function(t,n){e.each(n,(function(e,t){if(t.type===i)return!(r=!0)}))})),t.flags.pdfNative=r,r&&(void 0===t.options.pdfToolbar||t.options.pdfToolbar||(s="#toolbar=0"),o.on(t.evUpdate,(function(a){var l,c=a.file;r&&c.mime===i&&t.dispInlineRegex.test(c.mime)&&(a.stopImmediatePropagation(),l=n.openUrl(c.hash,!1,(function(i){i&&(t.hideinfo(),t.cover.addClass("elfinder-quicklook-coverbg"),e('<object class="elfinder-quicklook-preview-pdf" data="'+i+s+'" type="application/pdf" ></object>').on("error",(function(e){r=!1,t.update(void 0,n.cwd()),t.update(void 0,c)})).appendTo(o))})),o.one("change",(function(){l&&l.state&&"pending"===l.state()&&l.reject()})))})))},function(t){var n=t.fm,i="application/x-shockwave-flash",o=t.preview,r=!1;e.each(navigator.plugins,(function(t,n){e.each(n,(function(e,t){if(t.type===i)return!(r=!0)}))})),r&&o.on(t.evUpdate,(function(r){var s,a=r.file;a.mime===i&&t.dispInlineRegex.test(a.mime)&&(r.stopImmediatePropagation(),s=n.openUrl(a.hash,!1,(function(n){n&&(t.hideinfo(),e('<embed class="elfinder-quicklook-preview-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+n+'" qual
162ity="high" type="application/x-shockwave-flash" wmode="transparent" />').appendTo(o))})),o.one("change",(function(){s&&s.state&&"pending"===s.state()&&s.reject()})))}))},function(t){var n,i,o,r,s,a,l=t.fm,c=t.preview,d={"audio/mpeg":"mp3","audio/mpeg3":"mp3","audio/mp3":"mp3","audio/x-mpeg3":"mp3","audio/x-mp3":"mp3","audio/x-wav":"wav","audio/wav":"wav","audio/x-m4a":"m4a","audio/aac":"m4a","audio/mp4":"m4a","audio/x-mp4":"m4a","audio/ogg":"ogg","audio/webm":"webm","audio/flac":"flac","audio/x-flac":"flac","audio/amr":"amr"},h=t.window,u=t.navbar,p="string"==typeof t.options.mediaControlsList&&t.options.mediaControlsList?' controlsList="'+l.escape(t.options.mediaControlsList)+'"':"",f=function(){u.css("bottom",h.hasClass("elfinder-quicklook-fullscreen")?"50px":"")},m=function(t,i){return e('<audio class="elfinder-quicklook-preview-audio ui-front" controls'+p+' preload="auto" autobuffer><source src="'+t+'" ></source></audio>').on("change",(function(e){e.stopPropagation()})).on("error",(function(e){n&&n.data("hash")===i&&v()})).data("hash",i).appendTo(c)},g=function(e){var t,i=n.data("hash");r&&(t=e.play()),t&&t.catch&&t.catch((function(t){e.paused||n&&n.data("hash")===i&&v()}))},v=function(){if(n&&n.parent().length){var e=n[0],t=n.children("source").attr("src");h.off("viewchange.audio");try{e.pause(),n.empty(),t.match(/^blob:/)&&URL.revokeObjectURL(t),e.src="",e.load()}catch(e){}n.remove(),n=null}};c.on(t.evUpdate,(function(u){var p,v,b,y,x,w,_=u.file,k=d[_.mime];d[_.mime]&&t.dispInlineRegex.test(_.mime)&&((p=t.support.audio[k])||"amr"===k)&&(r=t.autoPlay(),i=_.hash,p?(u.stopImmediatePropagation(),s=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+l.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),a=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(s),v=l.openUrl(i,!1,(function(e){s.remove(),e?(n=m(e,i),g(n[0]),h.on("viewchange.audio",f),f()):n.remove()}),{progressBar:a}),c.one("change",(function(){v&&v.state&&"pending"===v.state()&&v.reject()}))):l.options.cdns.amr&&"amr"===k&&!1!==o&&(u.stopImmediatePropagation(),s=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+l.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),a=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(s),n=m("",i),(b=_.hash,x=e.Deferred(),w=e.Deferred().done((function(){var e;e=l.getContents(b,"arraybuffer",{progressBar:a}).done((function(e){try{var t=o.toWAV(new Uint8Array(e));t?x.resolve(URL.createObjectURL(new Blob([t],{type:"audio/x-wav"}))):x.reject()}catch(e){x.reject()}})).fail((function(){x.reject()})),c.one("change",(function(){e&&e.state&&"pending"===e.state()&&e.reject()}))})).fail((function(){o=!1,x.reject()})),window.TextEncoder&&window.URL&&URL.createObjectURL&&void 0===o?(y=window.AMR,delete window.AMR,l.loadScript([l.options.cdns.amr],(function(){o=!!window.AMR&&window.AMR,window.AMR=y,w[o?"resolve":"reject"]()}),{error:function(){w.reject()}})):w[o?"resolve":"reject"](),x).done((function(e){if(s.remove(),i===_.hash){var t=n[0];try{n.children("source").attr("src",e),t.pause(),t.load(),g(t),h.on("viewchange.audio",f),f()}catch(t){URL.revokeObjectURL(e),n.remove()}}else URL.revokeObjectURL(e)})).fail((function(){n.remove()}))))})).one("change",v)},function(t){var n,i,o,r,s,a,l,c,d,h,u=t.fm,p=t.preview,f={"video/mp4":"mp4","video/x-m4v":"mp4","video/quicktime":"mp4","video/mpeg":"mpeg","video/ogg":"ogg","application/ogg":"ogg","video/webm":"webm","video/x-matroska":"mkv","video/3gpp":"3gp","application/vnd.apple.mpegurl":"m3u8","application/x-mpegurl":"m3u8","application/dash+xml":"mpd","video/x-flv":"flv","video/x-msvideo":"avi"},m=t.window,g=t.navbar,v="string"==typeof t.options.mediaControlsList&&t.options.mediaControlsList?' controlsList="'+u.escape(t.options.mediaControlsList)+'"':"",b=function(){u.UA.iOS?m.hasClass("elfinder-quicklook-fullscreen")?(p.css("height","-webkit-calc(100% - 50px)"),g._show()):p.css("height",""):g.css("bottom",m.hasClass("elfinder-quicklook-fullscreen")?"50px":"")},y=function(i,o){var s,a=function(e){l>1&&(c&&clearTimeout(c),c=setTimeout((function(){!s&&S(!0)}),800))},l=0,d="";r=null,(o=o||{}).cssClass&&(d=" "+o.cssClass),t.hideinfo(),(n=e('<video class="elfinder-quicklook-preview-video'+d+'" controls'+v+' preload="auto" autobuffer playsinline></video>').on("change",(function(e){e.stopPropagation()})).on("timeupdate progress",a).on("canplay",(function(){s=!0})).data("hash",i.hash))[0].addEventListener("error",(function(e){o.src&&u.convAbsUrl(o.src)===u.convAbsUrl(e.target.src)&&(++l,a())}),!0),o.src&&n.append('<source src="'+o.src+'" type="'+i.mime+'"></source><source src="'+o.src+'"></source>'),n.appendTo(p),m.on("viewchange.video",b),b()},x=function(e){var t,o;o=u.openUrl(e.hash,!1,(function(o){d.remove(),o&&(y(e),(t=new i).loadSource(o),t.attachMedia(n[0]),l&&t.on(i.Events.MANIFEST_PARSED,(function(){C(n[0])})))}),{progressBar:h}),p.one("change",(function(){o&&o.state&&"pending"===o.state()&&o.reject()}))},w=function(e){var t;t=u.openUrl(e.hash,!1,(function(t){var i;d.remove(),t&&(y(e),(i=(r=window.dashjs.MediaPlayer().create()).getDebug()).setLogLevel?i.setLogLevel(dashjs.Debug.LOG_LEVEL_FATAL):i.setLogToBrowserConsole&&i.setLogToBrowserConsole(!1),r.initialize(n[0],t,l),r.on("error",(function(e){
162S(!0)})))}),{progressBar:h}),p.one("change",(function(){t&&t.state&&"pending"===t.state()&&t.reject()}))},_=function(e){var t;s.isSupported()?(t=u.openUrl(e.hash,!1,(function(t){if(d.remove(),t){var i=s.createPlayer({type:"flv",url:t});y(e),i.on(s.Events.ERROR,(function(){i.destroy(),S(!0)})),i.attachMediaElement(n[0]),i.load(),C(i)}}),{progressBar:h}),p.one("change",(function(){t&&t.state&&"pending"===t.state()&&t.reject()}))):s=!1},k=function(e){var t;t=u.openUrl(e.hash,!1,(function(t){d.remove(),t&&(y(e,{src:t,cssClass:"video-js"}),n[0].src=t,a(n[0],{autoplay:!0}))}),{progressBar:h}),p.one("change",(function(){t&&t.state&&"pending"===t.state()&&t.reject()}))},C=function(e){var t,i=n.data("hash");l&&(t=e.play()),t&&t.catch&&t.catch((function(t){e.paused||n&&n.data("hash")===i&&S(!0)}))},S=function(e){if(c&&clearTimeout(c),n&&n.parent().length){var i=n[0];m.off("viewchange.video"),r&&r.reset();try{i.pause(),n.empty(),i.src="",i.load()}catch(e){}n.remove(),n=null}e&&t.info.show()};p.on(t.evUpdate,(function(r){var c,m,g=r.file,v=g.mime.toLowerCase(),b=f[v];f[v]&&t.dispInlineRegex.test(g.mime)&&(l=t.autoPlay(),d=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+u.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>'),h=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(d),t.support.video[b]&&("m3u8"!==b||u.UA.Safari)?(r.stopImmediatePropagation(),d.appendTo(t.info.find(".elfinder-quicklook-info")),m=u.openUrl(g.hash,!1,(function(e){d.remove(),e&&(y(g,{src:e}),C(n[0]))}),{progressBar:h}),p.one("change",(function(){m&&m.state&&"pending"===m.state()&&m.reject()}))):!1!==i&&u.options.cdns.hls&&"m3u8"===b?(r.stopImmediatePropagation(),d.appendTo(t.info.find(".elfinder-quicklook-info")),i?x(g):(c=window.Hls,delete window.Hls,u.loadScript([u.options.cdns.hls],(function(e){i=e||window.Hls||!1,window.Hls=c,i&&x(g)}),{tryRequire:!0,error:function(){i=!1}}))):!1!==o&&u.options.cdns.dash&&"mpd"===b?(r.stopImmediatePropagation(),d.appendTo(t.info.find(".elfinder-quicklook-info")),o?w(g):u.loadScript([u.options.cdns.dash],(function(){(o=!!window.dashjs)&&w(g)}),{tryRequire:!0,error:function(){o=!1}})):!1!==s&&u.options.cdns.flv&&"flv"===b?(r.stopImmediatePropagation(),d.appendTo(t.info.find(".elfinder-quicklook-info")),s?_(g):(c=window.flvjs,delete window.flvjs,u.loadScript([u.options.cdns.flv],(function(e){s=e||window.flvjs||!1,window.flvjs=c,s&&_(g)}),{tryRequire:!0,error:function(){s=!1}}))):u.options.cdns.videojs&&(r.stopImmediatePropagation(),d.appendTo(t.info.find(".elfinder-quicklook-info")),a?k(g):u.loadScript([u.options.cdns.videojs+"/video.min.js"],(function(e){(a=e||window.videojs||!1)&&k(g)}),{tryRequire:!0,error:function(){a=!1}}).loadCss([u.options.cdns.videojs+"/video-js.min.css"])))})).one("change",S)},function(t){var n,i=t.preview,o=[],r=t.window,s=t.navbar;e.each(navigator.plugins,(function(t,n){e.each(n,(function(e,t){(0===t.type.indexOf("audio/")||0===t.type.indexOf("video/"))&&o.push(t.type)}))})),o=t.fm.arrayFlip(o),i.on(t.evUpdate,(function(a){var l,c,d,h,u=a.file,p=u.mime,f=function(){s.css("bottom",r.hasClass("elfinder-quicklook-fullscreen")?"50px":"")};o[u.mime]&&t.dispInlineRegex.test(u.mime)&&(a.stopImmediatePropagation(),d=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+fm.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),h=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(d),c=t.fm.openUrl(u.hash,!1,(function(o){d.remove(),o&&((l=0===p.indexOf("video/"))&&t.hideinfo(),n=e('<embed src="'+o+'" type="'+p+'" class="elfinder-quicklook-preview-'+(l?"video":"audio")+'"/>').appendTo(i),r.on("viewchange.embed",f),f())}),{progressBar:h}),i.one("change",(function(){c&&c.state&&"pending"===c.state()&&c.reject()})))})).one("change",(function(){n&&n.parent().length&&(r.off("viewchange.embed"),n.remove(),n=null)}))},function(t){var n=t.fm,i=n.arrayFlip(["application/zip","application/x-gzip","application/x-tar","application/x-bzip2"]),o=t.preview,r=n.returnBytes(t.options.unzipMaxSize||0),s=!(!n.options.cdns.zlibUnzip||!n.options.cdns.zlibGunzip),a=!!n.options.cdns.bzip2;window.Worker&&window.Uint8Array&&window.DataView&&o.on(t.evUpdate,(function(l){var c=l.file,d="application/x-tar"===c.mime,h="application/x-bzip2"===c.mime,u="application/zip"===c.mime||"application/x-gzip"===c.mime;if(i[c.mime]&&(!r||c.size<=r)&&(d||h&&a||u&&s)){var p,f,m,g,v=function(i){var r,s,a=0;i&&i.length&&((i=e.map(i,(function(e){return n.decodeRawString(e)}))).sort(),s=n.escape(i.join("\n").replace(/\{formatSize\((\d+)\)\}/g,(function(e,t){return a+=parseInt(t),n.formatSize(t)}))),r="<strong>"+n.escape(c.mime)+"</strong> ("+n.formatSize(c.size)+" / "+n.formatSize(a)+")<hr/>",e('<div class="elfinder-quicklook-preview-archive-wrapper">'+r+'<pre class="elfinder-quicklook-preview-text">'+s+"</pre></div>").on("touchstart",(function(t){e(this)["scroll"+("ltr"===n.direction?"Right":"Left")]()>5&&(t.originalEvent._preventSwipeX=!0)})).appendTo(o),t.hideinfo()),m.remove()};l.stopImmediatePropagation(),m=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+n.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),g=e('<div class="elfinder-quicklook-info-progress"></div>
162').appendTo(m),o.one("change",(function(){"pending"===p.state()&&p.reject(),f&&f.terminate(),m.remove()})),p=n.getContents(c.hash,"arraybuffer",{progressBar:g}).fail((function(){m.remove()})).done((function(e){var t=function(e){f&&f.terminate(),m.remove(),u?s=!1:h&&(a=!1),n.debug("error",e)};try{(f=n.getWorker()).onmessage=function(e){f&&f.terminate(),m.remove(),!e.data||e.data.error?new Error(e.data&&e.data.error?e.data.error:""):v(e.data.files)},f.onerror=t,"application/x-tar"===c.mime?f.postMessage({scripts:[n.getWorkerUrl("quicklook.unzip.js")],data:{type:"tar",bin:e}}):"application/zip"===c.mime?f.postMessage({scripts:[n.options.cdns.zlibUnzip,n.getWorkerUrl("quicklook.unzip.js")],data:{type:"zip",bin:e}}):"application/x-gzip"===c.mime?f.postMessage({scripts:[n.options.cdns.zlibGunzip,n.getWorkerUrl("quicklook.unzip.js")],data:{type:"gzip",bin:e}}):"application/x-bzip2"===c.mime&&f.postMessage({scripts:[n.options.cdns.bzip2,n.getWorkerUrl("quicklook.unzip.js")],data:{type:"bzip2",bin:e}})}catch(e){t(e)}}))}}))},function(t){var n,i=t.fm,o=i.arrayFlip(["application/x-rar"]),r=t.preview;window.DataView&&r.on(t.evUpdate,(function(s){var a=s.file;if(o[a.mime]&&i.options.cdns.rar&&!1!==n){var l,c,d,h,u,p,f=function(o){if(h)l.remove();else try{d=n({file:o,type:2,xhrHeaders:i.customHeaders,xhrFields:i.xhrFields},(function(n){l.remove();var o,s=[];h||n?n&&i.debug("error",n):(e.each(d.entries,(function(){s.push(this.path+(this.size?" ("+i.formatSize(this.size)+")":""))})),s.length&&((s=e.map(s,(function(e){return i.decodeRawString(e)}))).sort(),o="<strong>"+i.escape(a.mime)+"</strong> ("+i.formatSize(a.size)+")<hr/>",e('<div class="elfinder-quicklook-preview-archive-wrapper">'+o+'<pre class="elfinder-quicklook-preview-text">'+i.escape(s.join("\n"))+"</pre></div>").on("touchstart",(function(t){e(this)["scroll"+("ltr"===i.direction?"Right":"Left")]()>5&&(t.originalEvent._preventSwipeX=!0)})).appendTo(r),t.hideinfo()))}))}catch(e){l.remove()}},m=function(){n=!1,l.remove()};s.stopImmediatePropagation(),l=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+i.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),c=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(l),r.one("change",(function(){d&&(d.abort=!0),l.remove(),h=!0})),p=i.openUrl(a.hash,"sameorigin",(function(e){e&&(n?f(e):(window.RarArchive&&(u=window.RarArchive,delete window.RarArchive),i.loadScript([i.options.cdns.rar],(function(){i.hasRequire?require(["rar"],(function(t){n=t,f(e)}),m):(n=window.RarArchive)?(u?window.RarArchive=u:delete window.RarArchive,f(e)):m()}),{tryRequire:!0,error:m})))}),{progressBar:c,temporary:!0}),r.one("change",(function(){p&&p.state&&"pending"===p.state()&&p.reject()}))}}))},function(t){var n,i=t.fm,o=i.arrayFlip(t.options.sharecadMimes||[]),r=t.preview;t.window;t.options.sharecadMimes.length&&t.addIntegration({title:"ShareCAD.org CAD and 3D-Models viewer",link:"https://sharecad.org/DWGOnlinePlugin"}),r.on(t.evUpdate,(function(s){var a=s.file;if(o[a.mime.toLowerCase()]&&i.option("onetimeUrl",a.hash)){var l,c,d;t.window;s.stopImmediatePropagation(),"1"==a.url&&(r.hide(),e('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+i.i18n("getLink")+"</button></div>").appendTo(t.info.find(".elfinder-quicklook-info")).on("click",(function(){var n=e(this);n.html('<span class="elfinder-spinner">'),i.request({data:{cmd:"url",target:a.hash},preventDefault:!0,progressBar:c}).always((function(){n.html("")})).done((function(e){var n=i.file(a.hash);a.url=n.url=e.url||"",a.url&&r.trigger({type:t.evUpdate,file:a,forceUpdate:!0})}))}))),""!==a.url&&"1"!=a.url&&(r.one("change",(function(){l.remove(),n.off("load").remove(),n=null})).addClass("elfinder-overflow-auto"),l=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+i.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),c=e('<div class="elfinder-quicklook-info-progress"></div>
162').appendTo(l),d=i.convAbsUrl(i.url(a.hash)),n=e('<iframe class="elfinder-quicklook-preview-iframe" scrolling="no"></iframe>').css("background-color","transparent").appendTo(r).on("load",(function(){t.hideinfo(),l.remove(),t.preview.after(t.info),e(this).css("background-color","#fff").show()})).on("error",(function(){l.remove(),t.preview.after(t.info)})).attr("src","//sharecad.org/cadframe/load?url="+encodeURIComponent(d)),t.info.after(t.preview))}}))},function(t){var n,i,o,r,s,a=t.fm,l={"application/vnd.google-earth.kml+xml":!0,"application/vnd.google-earth.kmz":!0},c=t.preview;t.options.googleMapsApiKey&&(t.addIntegration({title:"Google Maps",link:"https://www.google.com/intl/"+a.lang.replace("_","-")+"/help/terms_maps.html"}),n=window.google&&google.maps,i=function(e,i,o){var s=t.options.googleMapsOpts.maps;a.forExternalUrl(e.hash,{progressBar:o}).done((function(e){if(e)try{new n.KmlLayer(e,Object.assign({map:new n.Map(i.get(0),s)},t.options.googleMapsOpts.kml)),t.hideinfo()}catch(e){r()}else r()}))},o=window.gm_authFailure,r=function(){s=null},s="https://maps.googleapis.com/maps/api/js?key="+t.options.googleMapsApiKey,window.gm_authFailure=function(){r(),o&&o()},c.on(t.evUpdate,(function(o){var r=o.file;if(s&&l[r.mime.toLowerCase()]){t.window;var d,h,u,p="1"==r.url&&!a.option("onetimeUrl",r.hash);o.stopImmediatePropagation(),d=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+a.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),h=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(d),p&&(c.hide(),e('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+a.i18n("getLink")+"</button></div>").appendTo(t.info.find(".elfinder-quicklook-info")).on("click",(function(){var n=e(this);n.html('<span class="elfinder-spinner">'),a.request({data:{cmd:"url",target:r.hash},preventDefault:!0,progressBar:h}).always((function(){d.remove(),n.html("")})).done((function(e){var n=a.file(r.hash);r.url=n.url=e.url||"",r.url&&c.trigger({type:t.evUpdate,file:r,forceUpdate:!0})}))}))),""===r.url||p||(u=e('<div style="width:100%;height:100%;"></div>').appendTo(c),c.one("change",(function(){u.remove(),u=null})),n?i(r,u,h):a.loadScript([s],(function(){(n=window.google&&google.maps)&&i(r,u,h)})))}})))},function(t){var n,i,o=t.fm,r=Object.assign(o.arrayFlip(t.options.googleDocsMimes||[],"g"),o.arrayFlip(t.options.officeOnlineMimes||[],"m")),s=t.preview,a=(t.window,t.navbar),l={g:"docs.google.com/gview?embedded=true&url=",m:"view.officeapps.live.com/op/embed.aspx?wdStartOn=0&src="},c={g:"56px",m:"24px"},d={xls:5242880,xlsb:5242880,xlsx:5242880,xlsm:5242880,other:10485760};t.options.googleDocsMimes.length&&(i=!0,t.addIntegration({title:"Google Docs Viewer",link:"https://docs.google.com/"})),t.options.officeOnlineMimes.length&&(i=!0,t.addIntegration({title:"MS Online Doc Viewer",link:"https://products.office.com/office-online/view-office-documents-online"})),i&&s.on(t.evUpdate,(function(i){var h,u,p=i.file;if(p.size<=26214400&&(h=r[p.mime])){var f,m,g,v=t.window,b=function(){a.css("bottom",v.hasClass("elfinder-quicklook-fullscreen")?c[h]:"")},y=o.mimeTypes[p.mime],x="1"==p.url&&!o.option("onetimeUrl",p.hash);"m"===h&&(d[y]&&p.size>d[y]||p.size>d.other)&&(h="g"),x&&(s.hide(),e('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+o.i18n("getLink")+"</button></div>").appendTo(t.info.find(".elfinder-quicklook-info")).on("click",(function(){var n=e(this);n.html('<span class="elfinder-spinner">'),o.request({data:{cmd:"url",target:p.hash},preventDefault:!0}).always((function(){n.html("")})).done((function(e){var n=o.file(p.hash);p.url=n.url=e.url||"",p.url&&s.trigger({type:t.evUpdate,file:p,forceUpdate:!0})}))}))),""===p.url||x||(i.stopImmediatePropagation(),s.one("change",(function(){u&&u.status&&"pending"===u.status()&&u.reject(),v.off("viewchange.googledocs"),f.remove(),n.off("load").remove(),n=null})).addClass("elfinder-overflow-auto"),f=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+o.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),m=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(f),n=e('<iframe class="elfinder-quicklook-preview-iframe"></iframe>').css("background-color","transparent").appendTo(s),u=o.forExternalUrl(p.hash,{progressBar:m}).done((function(i){var o=function(){try{!n||n.attr("src")&&!n.get(0).contentWindow.document||(n.attr("src","https://"+l[h]+encodeURIComponent(i)),g=setTimeout(o,2e3))}catch(e){}};i?(p.ts&&(i+=(i.match(/\?/)?"&":"?")+"_t="+p.ts),n.on("load",(function(){g&&clearTimeout(g),t.hideinfo(),f.remove(),t.preview.after(t.info),e(this).css("background-color","#fff").show()})).on("error",(function(){g&&clearTimeout(g),f.remove(),t.preview.after(t.info)})),o()):(f.remove(),n.remove())}
162)),v.on("viewchange.googledocs",b),b(),t.info.after(t.preview))}}))},function(t){"use strict";var n,i,o=t.fm,r=t.preview,s=parseInt(t.options.textInitialLines)||150,a=parseInt(t.options.prettifyMaxLines)||500,l=function(){c=function(){return!1},i&&(window.PR=i),n=!1},c=function(e){o.options.cdns.prettify?(c=function(e){return setTimeout((function(){h(e)}),100),"pending"},window.PR&&(i=window.PR),o.loadScript([o.options.cdns.prettify+(o.options.cdns.prettify.match(/\?/)?"&":"?")+"autorun=false"],(function(t){"object"==typeof(n=t||window.PR)?(c=function(){return!0},i?window.PR=i:delete window.PR,d(e)):l()}),{tryRequire:!0,error:l})):l()},d=function(e){e&&!e.hasClass("prettyprinted")&&(e.css("cursor","wait"),requestAnimationFrame((function(){n.prettyPrint&&n.prettyPrint(null,e.get(0)),e.css("cursor","")})))},h=function(e){!0===c(e)&&d(e)};r.on(t.evUpdate,(function(i){var l,c,d,u,p=i.file;p.mime;o.mimeIsText(p.mime)&&(!t.options.getSizeMax||p.size<=t.options.getSizeMax)&&!1!==n&&(i.stopImmediatePropagation(),c=e('<div class="elfinder-quicklook-info-data"><span class="elfinder-spinner-text">'+o.i18n("nowLoading")+'</span><span class="elfinder-spinner"></span></div>').appendTo(t.info.find(".elfinder-quicklook-info")),d=e('<div class="elfinder-quicklook-info-progress"></div>').appendTo(c),r.one("change",(function(){"pending"==l.state()&&l.reject(),u&&u.remove()})),l=o.request({data:{cmd:"get",target:p.hash,conv:p.encoding||1,_t:p.ts},options:{type:"get",cache:!0},preventDefault:!0,progressBar:d}).done((function(n){var i,l,c,d,u,f=new RegExp("^(data:"+p.mime.replace(/([.+])/g,"\\$1")+";base64,)","i"),m=n.content;"string"==typeof m&&(t.hideinfo(),window.atob&&(u=m.match(f))&&(m=atob(m.substr(u[1].length))),(l=(d=m.match(/([^\r\n]{1,100}[\r\n]*)/g)).length-s)>10?i=d.splice(0,s).join(""):l=0,c=e('<div class="elfinder-quicklook-preview-text-wrapper"><pre class="elfinder-quicklook-preview-text prettyprint"></pre></div>'),l&&c.append(e('<div class="elfinder-quicklook-preview-charsleft"><hr/><span>'+o.i18n("linesLeft",o.toLocaleString(l))+"</span></div>").on("click",(function(){var t=c.scrollTop();e(this).remove(),c.children("pre").removeClass("prettyprinted").text(m).scrollTop(t),d.length<=a&&h(c)}))),c.children("pre").text(i||m),c.on("touchstart",(function(t){e(this)["scroll"+("ltr"===o.direction?"Right":"Left")]()>5&&(t.originalEvent._preventSwipeX=!0)})).appendTo(r),n.toasts&&Array.isArray(n.toasts)&&e.each(n.toasts,(function(){this.msg&&o.toast(this)})),h(c))})).always((function(n){var i,s,a;(i=o.getCommand("edit"))&&(a=[],n&&n.encoding&&a.push({value:n.encoding}),a.push({value:"UTF-8"}),(s=i.getEncSelect(a)).on("change",(function(){p.encoding=s.val(),o.cache(p,"change"),r.trigger({type:t.evUpdate,file:p,forceUpdate:!0})})),u=e('<div class="elfinder-quicklook-encoding"></div>').append(s),t.window.append(u)),c.remove()})))}))}],(h.prototype.commands.reload=function(){"use strict";var t=this,n=!1;this.alwaysEnabled=!0,this.updateOnSelect=!0,this.shortcuts=[{pattern:"ctrl+shift+r f5"}],this.getstate=function(){return 0},this.init=function(){this.fm.bind("search searchend",(function(){n="search"==this.type}))},this.fm.bind("contextmenu",(function(){var n=t.fm;n.options.sync>=1e3&&(t.extra={icon:"accept",node:e("<span></span>").attr({title:n.i18n("autoSync")}).on("click touchstart",(function(t){"touchstart"===t.type&&t.originalEvent.touches.length>1||(t.stopPropagation(),t.preventDefault(),e(this).parent().toggleClass("ui-state-disabled",n.options.syncStart).parent().removeClass("ui-state-hover"),n.options.syncStart=!n.options.syncStart,n.autoSync(n.options.syncStart?null:"stop"))})).on("ready",(function(){e(this).parent().toggleClass("ui-state-disabled",!n.options.syncStart).css("pointer-events","auto")}))})})),this.exec=function(){var t=this.fm;if(!n){var i=t.sync(),o=setTimeout((function(){t.notify({type:"reload",cnt:1,hideCnt:!0}),i.always((function(){t.notify({type:"reload",cnt:-1})}))}),t.notifyDelay);return i.always((function(){clearTimeout(o),t.trigger("reload")}))}e("div.elfinder-toolbar > div."+t.res("class","searchbtn")+" > span.ui-icon-search").click()}}).prototype={forceLoad:!0},h.prototype.commands.rename=function(){"use strict";!1!==this.fm.options.enableRootRename&&(this.alwaysEnabled=!0),this.syncTitleOnChange=!0;var t=this,n=t.fm,i=!1!==n.options.enableRootRename,o=function(t,o,r,s){var a,l=o?[r.hash].concat(o):[r.hash],c=l.length,d={};if(n.lockfiles({files:l}
162),n.isRoot(r)&&!r.netkey&&i){if((a=n.storage("rootNames"))||(a={}),""===s){if(!a[r.hash])return t&&t.reject(),void n.unlockfiles({files:l}).trigger("selectfiles",{files:l});r.name=r._name,r.i18=r._i18,delete a[r.hash],delete r._name,delete r._i18}else void 0===r._name&&(r._name=r.name,r._i18=r.i18),r.name=a[r.hash]=s,delete r.i18;return n.storage("rootNames",a),d={changed:[r]},n.updateCache(d),n.change(d),t&&t.resolve(d),void n.unlockfiles({files:l}).trigger("selectfiles",{files:l})}d={cmd:"rename",name:s,target:r.hash},c>1&&(d.targets=o,s.match(/\*/)&&(d.q=s)),n.request({data:d,notify:{type:"rename",cnt:c},navigate:{}}).fail((function(e){var i=n.parseError(e);t&&t.reject(),i&&Array.isArray(i)&&"errRename"===i[0]||n.sync()})).done((function(i){var o;i.added&&i.added.length&&1===c&&(i.undo={cmd:"rename",callback:function(){return n.request({data:{cmd:"rename",target:i.added[0].hash,name:r.name},notify:{type:"undo",cnt:1}})}},i.redo={cmd:"rename",callback:function(){return n.request({data:{cmd:"rename",target:r.hash,name:s},notify:{type:"rename",cnt:1}})}}),t&&t.resolve(i),(o=n.cwd().hash)&&o!==r.hash||n.exec("open",e.map(i.added,(function(e){return"directory"===e.mime?e.hash:null}))[0])})).always((function(){n.unlockfiles({files:l}).trigger("selectfiles",{files:l})}))},r=function(e,t){var i,o,r,s=t||n.selected(),a=n.splitFileExtention(e),l=n.file(s[0]),c=n.file(s[1]);return i=a[1]?"."+a[1]:"",a[1]&&"*"===a[0]?(o='"'+n.splitFileExtention(l.name)[0]+i+'", ',o+='"'+n.splitFileExtention(c.name)[0]+i+'"'):a[0].length>1&&("*"===a[0].substr(-1)?(o='"'+(r=a[0].substr(0,a[0].length-1))+l.name+'", ',o+='"'+r+c.name+'"'):"*"===a[0].substr(0,1)&&(r=a[0].substr(1),o='"'+n.splitFileExtention(l.name)[0]+r+i+'", ',o+='"'+n.splitFileExtention(c.name)[0]+r+i+'"')),o||(o='"'+a[0]+"1"+i+'", "'+a[0]+"2"+i+'"'),s.length>2&&(o+=" ..."),o},s=function(){var i,s=n.selected(),a='<input name="type" type="radio" class="elfinder-tabstop">',l=function(t,i){return e('<label class="elfinder-rename-batch-checks">'+n.i18n(i)+"</label>").prepend(t)},c=e('<input type="text" class="ui-corner-all elfinder-tabstop">'),d=e(a),h=e(a),u=e(a),p=e(a),f=e("<div></div>").append(l(d,"plusNumber"),l(h,"asPrefix"),l(u,"asSuffix"),l(p,"changeExtention")),m=e('<div class="elfinder-rename-batch-preview"></div>'),g=e('<div class="elfinder-rename-batch"></div>').append(e('<div class="elfinder-rename-batch-name"></div>').append(c),e('<div class="elfinder-rename-batch-type"></div>').append(f),m),v={title:n.i18n("batchRename"),modal:!0,destroyOnClose:!0,width:Math.min(380,n.getUI().width()-20),buttons:{},open:function(){c.on("input",y).trigger("focus")}},b=function(){var e=c.val(),t=n.splitFileExtention(n.file(s[0]).name)[1];return(""!==e||d.is(":checked"))&&(h.is(":checked")?e+="*":u.is(":checked")?e="*"+e+"."+t:p.is(":checked")?e="*."+e:t&&(e+="."+t)),e},y=function(){var e=b();""!==e?m.html(n.i18n(["renameMultiple",s.length,r(e)])):m.empty()},x=f.find("input:radio").on("change",y);v.buttons[n.i18n("btnApply")]=function(){var e,t,r=b();""!==r&&(i.elfinderdialog("close"),t=s,e=n.file(t.shift()),o(void 0,t,e,r))},v.buttons[n.i18n("btnCancel")]=function(){i.elfinderdialog("close")},e.fn.checkboxradio?x.checkboxradio({create:function(e,t){this===d.get(0)&&d.prop("checked",!0).change()}}):f.buttonset({create:function(e,t){d.prop("checked",!0).change()}}),i=t.fmDialog(g,v)};this.noChangeDirOnRemovedCwd=!0,this.shortcuts=[{pattern:"f2"+("mac"==n.OS?" enter":"")},{pattern:"shift+f2",description:"batchRename",callback:function(){n.selected().length>1&&s()}}],this.getstate=function(o){var r,a,l,c,d,h,u=this.files(o),p=u.length;return p?(p>1&&u[0].phash&&(r=u[0].phash,a=n.splitFileExtention(u[0].name)[1].toLowerCase(),l=u[0].mime),1===p&&(h=n.isRoot(u[0])),d=1===p&&(i&&n.cookieEnabled&&h||!u[0].locked)||n.api>2.103&&p===e.grep(u,(function(e){return!(c||e.locked||e.phash!==r||n.isRoot(e)||l!==e.mime&&a!==n.splitFileExtention(e.name)[1].toLowerCase())||(c&&(c=!0),!1)})).length?0:-1,!h&&0===d&&n.option("disabledFlip",u[0].hash).rename&&(d=-1),-1!==d&&p>1?t.extra={icon:"preference",node:e("<span></span>").attr({title:n.i18n("batchRename")}).on("click touchstart",(function(e){"touchstart"===e.type&&e.originalEvent.touches.length>1||(e.stopPropagation(),e.preventDefault(),n.getUI().trigger("click"),s())}))}:delete t.extra,d):-1},this.exec=function(t,s){n.getUI("cwd");var a,l=t||!!n.selected().length&&n.selected()||[n.cwd().hash],c=l.length,d=n.file(l.shift()),h=".elfinder-cwd-filename",u=s||{},p=n.cwd().hash==d.hash,f="files"!==("navbar"===u._currentType||"files"===u._currentType?u._currentType:p?"navbar":"files"),m=n[f?"navHash2Elm":"cwdHash2Elm"](d.hash),g=!f&&"list"!=n.storage("view"),v=function(){requestAnimationFrame((function(){w&&w.trigger("blur")}))},b=function(){S.is(":hidden")||S.elfinderoverlay("hide").off("click close",T),C.removeClass("ui-front").css("position","").off("unselect."+n.namespace,v),g?k&&k.css("max-height",""):f||C.css("width","").parent("td").css("overflow","")},y=e.Deferred().fail((function(e){var t=w.parent(),i=n.escape(d.i18||d.name);w.off(),g&&(i=i.replace(/([_.])/g,"&#8203;$1")),requestAnimationFrame((function(){f?w.replaceWith(i):t.length?(w.remove(),t.html(i)):m.find(h).html(i)})),e&&n.error(e)})).always((function(){b(),n.unbind("resize",E),n.enable()})),x=function(e){var t=w.val().trim(),i=(n.splitFileExtention(t),!0),s=function(){w.off(),b(),f?w.replaceWith(n.escape(t)):k.html(n.escape(t)),o(y,l,d,t)};if(S.is(":hidden")||C.css("z-index",""),""===t){if(!n.isRoot(d))return T();f?w.replaceWith(n.escape(d.name)):k.html(n.escape(d.name))}if(!A&&C.length){if(w.off("blur"),1===c&&t===d.name)return y.reject();if(n.options.validName&&n.options.validName.test)try{i=n.options.validName.test(t)}catch(e){i=!1}if("."===t||".."===t||!i)return A=!0,n.error("directory"===d.mime?"errInvDirname":"errInvName",{modal:!0,close:function(){setTimeout(_,120)}}),!1;if(1===c&&n.fileByName(t,d.phash))return A=!0,n.error(["errExists",t],{modal:!0,close:function(){setTimeout(_,120)}}),!1;1===c?s():(n.confirm({title:"cmdrename",text:["renameMultiple",c,r(t,[d.hash].concat(l))],accept:{label:"btnYes",callback:s},cancel:{label:"btnCancel",callback:function(){setTimeout((function(){A=!0,_()}),120)}}}),setTimeout((function(){n.trigger("unselectfiles",{files:n.selected()}).trigger("selectfiles",{files:[d.hash].concat(l)})}),120))}},w=e(g?"<textarea></textarea>":'<input type="text"/>').on("keyup text",(function(){g?(this.style.height="1px",this.style.height=this.scrollHeight+"px"):a&&(this.style.width=a+"px",this.scrollWidth>a&&(this.style.width=this.scrollWidth+10+"px"))})).on("keydown",(function(t){t.stopImmediatePropagation(),t.keyCode==e.ui.keyCode.ESCAPE?y.reject():t.keyCode==e.ui.keyCode.ENTER&&(t.preventDefault(),w.trigger("blur"))})).on("mousedown click dblclick",(function(e){e.stopPropagation(),"dblclick"===e.type&&e.preventDefault()})).on("blur",x).on("dragenter dragleave dragover drop",(function(e){e.stopPropagation()})),_=function(){var e=n.splitFileExtention(w.val())[0];A||!n.UA.Mobile||n.UA.iOS||(S.on("click close",T).elfinderoverlay("show"),C.css("z-index",S.css("z-index")+1)),!n.enabled()&&n.enable(),A&&(A=!1,w.on("blur",x)),w.trigger("focus").trigger("select"),w[0].setSelectionRange&&w[0].setSelectionRange(0,e.length)},k=f?m.contents().filter((function(){return 3==this.nodeType&&e(this).parent().attr("id")===n.navHash2Id(d.hash)}
162)):m.find(h),C=k.parent(),S=n.getUI("overlay"),T=function(e){S.is(":hidden")||C.css("z-index",""),A||(y.reject(),e&&(e.stopPropagation(),e.preventDefault()))},E=function(){m.trigger("scrolltoview",{blink:!1})},A=!1;return C.addClass("ui-front").css("position","relative").on("unselect."+n.namespace,v),n.bind("resize",E),f?k.replaceWith(w.val(d.name)):(g?k.css("max-height","none"):f||(a=C.width(),C.width(a-15).parent("td").css("overflow","visible")),k.empty().append(w.val(d.name))),c>1&&n.api<=2.103?y.reject():d&&k.length?!d.locked||n.isRoot(d)&&i?(n.one("select",(function(){w.parent().length&&d&&-1===e.inArray(d.hash,n.selected())&&w.trigger("blur")})),w.trigger("keyup"),_(),y):y.reject(["errLocked",d.name]):y.reject("errCmdParams",this.title)},n.bind("select contextmenucreate closecontextmenu",(function(e){var i,o=(e.data?e.data.selected||e.data.targets:null)||n.selected();o&&1===o.length&&(i=n.file(o[0]))&&n.isRoot(i)?t.title=n.i18n("kindAlias")+" ("+n.i18n("preference")+")":t.title=n.i18n("cmdrename"),"closecontextmenu"!==e.type?t.update(void 0,t.title):requestAnimationFrame((function(){t.update(void 0,t.title)}))})).remove((function(t){var i;t.data&&t.data.removed&&(i=n.storage("rootNames"))&&(e.each(t.data.removed,(function(e,t){i[t]&&delete i[t]})),n.storage("rootNames",i))}))},h.prototype.commands.resize=function(){"use strict";var t=this.fm,n=0;this.updateOnSelect=!1,this.getstate=function(){var e=t.selectedFiles();return 1==e.length&&e[0].read&&e[0].write&&-1!==e[0].mime.indexOf("image/")?0:-1},this.resizeRequest=function(n,i,o){var r,s=i||t.file(n.target);s&&s.tmb;return t.isCommandEnabled("resize",n.target)&&(!s||s&&s.read&&s.write&&-1!==s.mime.indexOf("image/"))?t.request({data:Object.assign(n,{cmd:"resize"}),notify:{type:"resize",cnt:1}}).fail((function(e){o&&o.reject(e)})).done((function(){n.quality&&t.storage("jpgQuality",n.quality===t.option("jpgQuality")?null:n.quality),o&&o.resolve()})):(r=s?-1===s.mime.indexOf("image/")?["errResize",s.name,"errUsupportType"]:["errResize",s.name,"errPerm"]:["errResize",n.target,"errPerm"],o?o.reject(r):t.error(r),e.Deferred().reject(r))},this.exec=function(i){var o,r,s,a,l=this,c=this.files(i),d=e.Deferred(),h=t.api>1,u=this.options,p=t.getUI(),f=e().controlgroup?"controlgroup":"buttonset",m=void 0===u.grid8px||"disable"!==u.grid8px,g=Array.isArray(u.presetSize)?u.presetSize:[],v="elfinder-dialog-active",b=t.res("class","editing"),y=function(i,o,r){var c,y,x,w,_,k,C,S="image/jpeg"===i.mime,T=e('<div class="elfinder-resize-container"></div>'),E='<input type="number" class="ui-corner-all"/>',A='<div class="elfinder-resize-row"></div>',O='<div class="elfinder-resize-label"></div>',D=null,I=!1,P=function(){I=!0},M=function(){I&&(I=!1,R.trigger("change"))},R=e('<div class="elfinder-resize-control"></div>').on("focus","input[type=text],input[type=number]",(function(){e(this).trigger("select")})).on("change",(function(){D&&cancelAnimationFrame(D),D=requestAnimationFrame((function(){var n,i,o,r,s,l,c,d,h,u,p,f;nt&&!I&&(o=nt.data("canvas"))&&(n=R.children("div.elfinder-resize-control-panel:visible"),(i=n.find("input.elfinder-resize-quality")).is(":visible")&&(r=nt.data("ctx"),s=nt.get(0),n.hasClass("elfinder-resize-uiresize")?(d=o.width=G.val(),h=o.height=X.val(),r.drawImage(s,0,0,d,h)):n.hasClass("elfinder-resize-uicrop")?(l=Y.val(),c=Q.val(),d=J.val(),h=Z.val(),o.width=d,o.height=h,r.drawImage(s,l,c,d,h,0,0,d,h)):(u=te.val(),p=te.val()*Math.PI/180,f=function(t,n,i){var o=[{x:t/2,y:n/2},{x:-t/2,y:n/2},{x:-t/2,y:-n/2},{x:t/2,y:-n/2}],r=[],s={x:Number.MAX_VALUE,y:Number.MAX_VALUE},a={x:Number.MIN_VALUE,y:Number.MIN_VALUE};return e.each(o,(function(e,t){r.push({x:t.x*Math.cos(i)-t.y*Math.sin(i),y:t.x*Math.sin(i)+t.y*Math.cos(i)})})),e.each(r,(function(e,t){s.x=Math.min(s.x,t.x),s.y=Math.min(s.y,t.y),a.x=Math.max(a.x,t.x),a.y=Math.max(a.y,t.y)})),{width:a.x-s.x,height:a.y-s.y}}(fe,me,p),d=o.width=f.width,h=o.height=f.height,r.save(),u%90!=0&&(r.fillStyle=de.val()||"#FFF",r.fillRect(0,0,d,h)),r.translate(d/2,h/2),r.rotate(p),r.drawImage(s,-s.width/2,-s.height/2,fe,me),r.restore()),o.toBlob((function(e){e&&(a=e.size,i.next("span").text(" ("+t.formatSize(e.size)+")"))}),"image/jpeg",Math.max(Math.min(i.val(),100),1)/100)))}))})).on("mouseup","input",(function(t){e(t.target).trigger("change")})),z=e('<div class="elfinder-resize-preview"></div>').on("touchmove",(function(t){e(t.target).hasClass("touch-punch")&&(t.stopPropagation(),t.preventDefault())})),N=e('<div class="elfinder-resize-loading">'+t.i18n("ntfloadimg")+"</div>"),F=e('<div class="elfinder-resize-handle touch-punch"></div>'),L=e('<div class="elfinder-resize-handle touch-punch"></div>'),j=e('<div class="elfinder-resize-uiresize elfinder-resize-control-panel"></div>'),B=e('<div class="elfinder-resize-uicrop elfinder-resize-control-panel"></div>
162'),H=e('<div class="elfinder-resize-rotate elfinder-resize-control-panel"></div>'),U=e("<button></button>").attr("title",t.i18n("rotate-cw")).append(e('<span class="elfinder-button-icon elfinder-button-icon-rotate-l"></span>')),$=e("<button></button>").attr("title",t.i18n("rotate-ccw")).append(e('<span class="elfinder-button-icon elfinder-button-icon-rotate-r"></span>')),q=e("<span ></span>"),W=e('<button class="elfinder-resize-reset">').text(t.i18n("reset")).on("click",(function(){He()})).button({icons:{primary:"ui-icon-arrowrefresh-1-n"},text:!1}),V=e('<div class="elfinder-resize-type"></div>').append('<input type="radio" name="type" id="'+o+'-resize" value="resize" checked="checked" /><label for="'+o+'-resize">'+t.i18n("resize")+"</label>",'<input class="api2" type="radio" name="type" id="'+o+'-crop" value="crop" /><label class="api2" for="'+o+'-crop">'+t.i18n("crop")+"</label>",'<input class="api2" type="radio" name="type" id="'+o+'-rotate" value="rotate" /><label class="api2" for="'+o+'-rotate">'+t.i18n("rotate")+"</label>"),K="resize",G=e(E).on("change",(function(){var e=Be(parseInt(G.val())),t=Be(ge?e/ue:parseInt(X.val()));e>0&&t>0&&(Ue.updateView(e,t),G.val(e),X.val(t))})).addClass("elfinder-focus"),X=e(E).on("change",(function(){var e=Be(parseInt(X.val())),t=Be(ge?e*ue:parseInt(G.val()));t>0&&e>0&&(Ue.updateView(t,e),G.val(t),X.val(e))})),Y=e(E).on("change",(function(){$e.updateView()})),Q=e(E).on("change",(function(){$e.updateView()})),J=e(E).on("change",(function(){$e.updateView("w")})),Z=e(E).on("change",(function(){$e.updateView("h")})),ee=S&&h?e(E).val(t.storage("jpgQuality")>0?t.storage("jpgQuality"):t.option("jpgQuality")).addClass("elfinder-resize-quality").attr("min","1").attr("max","100").attr("title","1 - 100").on("blur",(function(){var e=Math.min(100,Math.max(1,parseInt(this.value)));R.find("input.elfinder-resize-quality").val(e)})):null,te=e('<input type="number" class="ui-corner-all" maxlength="3" value="0" />').on("change",(function(){qe.update()})),ne=e('<div class="elfinder-resize-rotate-slider touch-punch"></div>').slider({min:0,max:360,value:te.val(),animate:!0,start:P,stop:M,change:function(e,t){t.value!=ne.slider("value")&&qe.update(t.value)},slide:function(e,t){qe.update(t.value,!1)}}).find(".ui-slider-handle").addClass("elfinder-tabstop").off("keydown").on("keydown",(function(t){t.keyCode!=e.ui.keyCode.LEFT&&t.keyCode!=e.ui.keyCode.RIGHT||(t.stopPropagation(),t.preventDefault(),qe.update(Number(te.val())+(t.keyCode==e.ui.keyCode.RIGHT?1:-1),!1))})).end(),ie={},oe=function(e){var t,n,i,o;try{t=ie[Math.round(e.offsetX)][Math.round(e.offsetY)]}catch(e){}t&&(n=t[0],i=t[1],o=t[2],t[3],t[4],t[5],se(n,i,o,"click"===e.type))},re=function(t){se(e(this).css("backgroundColor"),"","","click"===t.type)},se=function(t,n,i,o){var r,s,a;"string"==typeof t&&(n="",t&&(r=e("<span>").css("backgroundColor",t).css("backgroundColor"))&&(s=r.match(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i))&&(t=Number(s[1]),n=Number(s[2]),i=Number(s[3]))),a=""===n?t:"#"+ae(t,n,i),de.val(a).css({backgroundColor:a,backgroundImage:"none",color:t+n+i<384?"#fff":"#000"}),z.css("backgroundColor",a),o&&(je.off(".picker").removeClass("elfinder-resize-picking"),he.off(".picker").removeClass("elfinder-resize-picking"))},ae=function(t,n,i){return e.map([t,n,i],(function(e){return("0"+parseInt(e).toString(16)).slice(-2)})).join("")},le=e("<button>").text(t.i18n("colorPicker")).on("click",(function(){je.on("mousemove.picker click.picker",oe).addClass("elfinder-resize-picking"),he.on("mousemove.picker click.picker","span",re).addClass("elfinder-resize-picking")})).button({icons:{primary:"ui-icon-pin-s"},text:!1}),ce=e("<button>").text(t.i18n("reset")).on("click",(function(){se("","","",!0)})).button({icons:{primary:"ui-icon-arrowrefresh-1-n"},text:!1}),de=e('<input class="ui-corner-all elfinder-resize-bg" type="text">').on("focus",(function(){e(this).attr("style","")})).on("blur",(function(){se(e(this).val())})),he=e('<div class="elfinder-resize-pallet">').on("click","span",(function(){se(e(this).css("backgroundColor"))})),ue=1,pe=1,fe=0,me=0,ge=!0,ve=!1,be=0,ye=0,xe=0,we=0,_e=0,ke=!!S&&m,Ce=e("<button>").html(t.i18n("aspectRatio")).on("click",(function(){ge=!ge,Ce.button("option",{icons:{primary:ge?"ui-icon-locked":"ui-icon-unlocked"}}),Ue.fixHeight(),F.resizable("option","aspectRatio",ge).data("uiResizable")._aspectRatio=ge})).button({icons:{primary:ge?"ui-icon-locked":"ui-icon-unlocked"},text:!1}),Se=e("<button>").html(t.i18n("aspectRatio")).on("click",(function(){ve=!ve,Se.button("option",{icons:{primary:ve?"ui-icon-locked":"ui-icon-unlocked"}}),L.resizable("option","aspectRatio",ve).data("uiResizable")._aspectRatio=ve})).button({icons:{primary:ve?"ui-icon-locked":"ui-icon-unlocked"},text:!1}),Te=e("<button>").html(t.i18n(ke?"enabled":"disabled")).toggleClass("ui-state-active",ke).on("click",(function(){ke=!ke,Te.html(t.i18n(ke?"enabled":"disabled")).toggleClass("ui-state-active",ke),Ee()})).button(),Ee=function(){var t=ke?8:1;e.each([G,X,J,Z,Y,Q],(function(){this.attr("step",t)}
162)),ke&&(G.val(Be(G.val())),X.val(Be(X.val())),J.val(Be(J.val())),Z.val(Be(Z.val())),Y.val(Be(Y.val())),Q.val(Be(Q.val())),j.is(":visible")?Ue.updateView(G.val(),X.val()):B.is(":visible")&&$e.updateView())},Ae=function(){var n,o=function(){de.parent().hide(),he.hide()};n=Math.min(be,ye)/Math.sqrt(Math.pow(fe,2)+Math.pow(me,2)),xe=Math.ceil(fe*n),we=Math.ceil(me*n),je.width(xe).height(we).css("margin-top",(ye-we)/2+"px").css("margin-left",(be-xe)/2+"px"),je.is(":visible")&&de.is(":visible")&&("image/png"!==i.mime?(z.css("backgroundColor",de.val()),c=e("<img>"),t.isCORS&&c.attr("crossorigin","use-credentials"),c.on("load",(function(){y&&y.width!==xe&&De()})).on("error",o).attr("src",tt)):o())},Oe=function(){Ue.updateView(fe,me),Ae(),Ne.width(ze.width()).height(ze.height()),Fe.width(ze.width()).height(ze.height()),$e.updateView(),it()},De=function(){if(x){var t,n,i,o,r,s,a,l,d,h,u,p,f,m,g,v,b,w,_={},k=[],C=function(e,t,n){var i,o=Math.max(Math.max(e,t),n),r=Math.min(Math.min(e,t),n);return o===r?i=0:e===o?i=((t-n)/(o-r)*60+360)%360:t===o?i=(n-e)/(o-r)*60+120:n===o&&(i=(e-t)/(o-r)*60+240),[i,(o-r)/o,(.3*e+.59*t+.11*n)/255,"hsl"]},S=function(e){return 8*Math.round(e/8)};e:try{n=y.width=je.width(),i=y.height=je.height(),p=n/fe,x.scale(p,p),x.drawImage(c.get(0),0,0),u=x.getImageData(0,0,n,i).data,f=.1*n,m=.9*n,g=.1*i,v=.9*i;for(var T=0;T<i-1;T++)for(var E=0;E<n-1;E++){if(o=u[t=4*E+T*n*4],r=u[t+1],s=u[t+2],255!==u[t+3]){de.parent().hide(),he.hide();break e}d=C(o,r,s),h=Math.round(d[0]),a=Math.round(100*d[1]),l=Math.round(100*d[2]),ie[E]||(ie[E]={}),ie[E][T]=[o,r,s,h,a,l],(E<f||E>m)&&(T<g||T>v)&&(_[b=S(o)+","+S(r)+","+S(s)]?++_[b]:_[b]=1)}he.children(":first").length||(w=1,e.each(_,(function(e,t){k.push({c:e,v:t})})),e.each(k.sort((function(e,t){return e.v>t.v?-1:1})),(function(){if(this.v<2||w>10)return!1;he.append(e('<span style="width:20px;height:20px;display:inline-block;background-color:rgb('+this.c+');">')),++w})))}catch(e){le.hide(),he.hide()}}},Ie=null,Pe=!1,Me=function(e){var n=t.file(i.hash);n.width=e[0],n.height=e[1]},Re=function(){var o,r,s;Pe||(Pe=!0,Ie&&Ie.state&&"pending"===Ie.state()&&Ie.reject(),t.api>=2.103?0===n&&t.request({data:{cmd:"resize",target:i.hash,degree:0,mode:"rotate"},preventDefault:!0}).done((function(e){1===(n=e.losslessRotate?1:-1)&&te.val()%90==0&&H.children("div.elfinder-resize-quality").hide()})).fail((function(){n=-1})):n=-1,o=ze.get(0),(r=i.width&&i.height?{w:i.width,h:i.height}:o.naturalWidth?null:{w:ze.width(),h:ze.height()})&&ze.removeAttr("width").removeAttr("height"),fe=i.width||o.naturalWidth||o.width||ze.width(),me=i.height||o.naturalHeight||o.height||ze.height(),i.width&&i.height||Me([fe,me]),r&&ze.width(r.w).height(r.h),w.show(),(s=me/fe)<1&&z.height()>z.width()*s&&z.height(z.width()*s),z.height()>ze.height()+20&&z.height(ze.height()+20),ye=z.height()-(F.outerHeight()-F.height()),N.remove(),ue=fe/me,F.append(ze.show()).show(),G.val(fe),X.val(me),function(){try{y=document.createElement("canvas"),x=y.getContext("2d")}catch(e){le.hide(),he.hide()}}(),rt.on("click","span.elfinder-resize-preset",(function(){var t=e(this),n=t.data("s")[0],i=t.data("s")[1],o=fe/me;t.data("s",[i,n]).text(i+"x"+n),fe>n||me>i?fe<=n?n=Be(i*o):me<=i||fe-n>me-i?i=Be(n/o):n=Be(i*o):(n=fe,i=me),G.val(n),X.val(i),Ue.updateView(n,i),it()})),st.on("click","span.elfinder-resize-preset",(function(){var t=e(this),n=t.data("s")[0],i=t.data("s")[1],o=Y.val(),r=Q.val();t.data("s",[i,n]).text(i+"x"+n),fe>=n&&me>=i&&(fe-n-o<0&&(o=fe-n),me-i-r<0&&(r=me-i),Y.val(o),Q.val(r),J.val(n),Z.val(i),$e.updateView(),it())})),st.children("span.elfinder-resize-preset").each((function(){var t=e(this),n=t.data("s")[0],i=t.data("s")[1];t[fe>=n&&me>=i?"show":"hide"]()})),Oe(),V[f]("enable"),R.find("input,select").prop("disabled",!1).filter(":text").on("keydown",(function(n){var i;if(n.keyCode==e.ui.keyCode.ENTER)return n.stopPropagation(),n.preventDefault(),i={title:e("input:checked",V).val(),text:"confirmReq",accept:{label:"btnApply",callback:function(){Xe()}},cancel:{label:"btnCancel",callback:function(){e(this).trigger("focus")}}},at&&(i.buttons=[{label:"btnSaveAs",callback:function(){requestAnimationFrame(Ye)}}]),void t.confirm(i)})).on("keyup",(function(){var t=e(this);t.hasClass("elfinder-resize-bg")||requestAnimationFrame((function(){t.val(t.val().replace(/[^0-9]/g,""))}))})).filter(":first"),Ee(),!t.UA.Mobile&&G.trigger("focus"),We())},ze=e("<img/>").on("load",Re).on("error",(function(){N.html(t.i18n("ntfsmth")).css("background","transparent")})),Ne=e("<div></div>"),Fe=e("<img/>"),Le=e("<div></div>"),je=e('<img class="elfinder-resize-imgrotate" />'),Be=function(e,t){return e=ke?8*Math.round(e/8):Math.round(e),e=
162Math.max(0,e),t&&e>t&&(e=ke?8*Math.floor(t/8):t),e},He=function(){G.val(fe),X.val(me),Ue.updateView(fe,me),Y.val(0),Q.val(0),J.val(fe),Z.val(me),$e.updateView(),it()},Ue={update:function(){G.val(Be(ze.width()/pe)),X.val(Be(ze.height()/pe)),it()},updateView:function(e,t){e>be||t>ye?e/be>t/ye?(pe=be/e,ze.width(be).height(Be(t*pe))):(pe=ye/t,ze.height(ye).width(Be(e*pe))):ze.width(Be(e)).height(Be(t)),pe=ze.width()/e,q.text("1 : "+(1/pe).toFixed(2)),Ue.updateHandle()},updateHandle:function(){F.width(ze.width()).height(ze.height())},fixHeight:function(){var e,t;ge&&(e=G.val(),t=Be(e/ue),Ue.updateView(e,t),X.val(t))}},$e={update:function(e){Y.val(Be((L.data("x")||L.position().left)/pe,fe)),Q.val(Be((L.data("y")||L.position().top)/pe,me)),"xy"!==e&&(J.val(Be((L.data("w")||L.width())/pe,fe-Y.val())),Z.val(Be((L.data("h")||L.height())/pe,me-Q.val()))),it()},updateView:function(e){var t,n,i,o,r;Y.val(Be(Y.val(),fe-(ke?8:1))),Q.val(Be(Q.val(),me-(ke?8:1))),J.val(Be(J.val(),fe-Y.val())),Z.val(Be(Z.val(),me-Q.val())),ve&&(t=Le.width()/Le.height(),"w"===e?Z.val(Be(parseInt(J.val())/t)):"h"===e&&J.val(Be(parseInt(Z.val())*t))),n=Math.round(parseInt(Y.val())*pe),i=Math.round(parseInt(Q.val())*pe),"xy"!==e?(o=Math.round(parseInt(J.val())*pe),r=Math.round(parseInt(Z.val())*pe)):(o=L.data("w"),r=L.data("h")),L.data({x:n,y:i,w:o,h:r}).width(o).height(r).css({left:n,top:i}),Le.width(o).height(r)},resize_update:function(e,t){L.data({x:t.position.left,y:t.position.top,w:t.size.width,h:t.size.height}),$e.update(),$e.updateView()},drag_update:function(e,t){L.data({x:t.position.left,y:t.position.top}),$e.update("xy")}},qe={mouseStartAngle:0,imageStartAngle:0,imageBeingRotated:!1,setQuality:function(){H.children("div.elfinder-resize-quality")[n>0&&te.val()%90==0?"hide":"show"]()},update:function(e,n){void 0===e&&(_e=e=parseInt(te.val())),void 0===n&&(n=!0),!n||t.UA.Opera||t.UA.ltIE8?je.rotate(e):je.animate({rotate:e+(t.UA.Chrome?"":"deg")}),(e%=360)<0&&(e+=360),te.val(parseInt(e)),ne.slider("value",te.val()),qe.setQuality()},execute:function(e){if(qe.imageBeingRotated){var t=qe.getCenter(je),n=e.originalEvent.touches?e.originalEvent.touches[0]:e,i=n.pageX-t[0],o=n.pageY-t[1],r=Math.atan2(o,i)-qe.mouseStartAngle+qe.imageStartAngle;return r=Math.round(180*parseFloat(r)/Math.PI),e.shiftKey&&(r=15*Math.round((r+6)/15)),je.rotate(r),(r%=360)<0&&(r+=360),te.val(r),ne.slider("value",te.val()),qe.setQuality(),!1}},start:function(t){if(!je.hasClass("elfinder-resize-picking")){P(),qe.imageBeingRotated=!0;var n=qe.getCenter(je),i=t.originalEvent.touches?t.originalEvent.touches[0]:t,o=i.pageX-n[0],r=i.pageY-n[1];return qe.mouseStartAngle=Math.atan2(r,o),qe.imageStartAngle=parseFloat(je.rotate())*Math.PI/180,e(document).on("mousemove",qe.execute),je.on("touchmove",qe.execute),!1}},stop:function(t){if(qe.imageBeingRotated)return e(document).off("mousemove",qe.execute),je.off("touchmove",qe.execute),requestAnimationFrame((function(){qe.imageBeingRotated=!1})),M(),!1},getCenter:function(e){var t=je.rotate();je.rotate(0);var n=je.offset(),i=n.left+je.width()/2,o=n.top+je.height()/2;return je.rotate(t),Array(i,o)}},We=function(e){e?(F.filter(":ui-resizable").resizable("destroy"),F.hide()):(F.show(),F.resizable({alsoResize:ze,aspectRatio:ge,resize:Ue.update,start:P,stop:function(e){Ue.fixHeight,Ue.updateView(G.val(),X.val()),M()}}),ot())},Ve=function(e){e?(L.filter(":ui-resizable").resizable("destroy").filter(":ui-draggable").draggable("destroy"),Ne.hide()):(Ne.show(),L.resizable({containment:Ne,aspectRatio:ve,resize:$e.resize_update,start:P,stop:M,handles:"all"}).draggable({handle:Le,containment:Fe,drag:$e.drag_update,start:P,stop:function(){$e.updateView("xy"),M()}}),ot(),$e.update())},Ke=function(e){e?je.hide():(je.show(),ot())},Ge=function(){var e,n,i,o,r,l,c="";if("resize"==K)e=parseInt(G.val())||0,n=parseInt(X.val())||0;else if("crop"==K)e=parseInt(J.val())||0,n=parseInt(Z.val())||0,i=parseInt(Y.val())||0,o=parseInt(Q.val())||0;else if("rotate"==K){if(e=fe,n=me,(r=parseInt(te.val())||0)<0||r>360)return t.error("Invalid rotate degree"),!1;if(0==r||360==r)return t.error("errResizeNoChange"),!1;c=de.val()}if(l=ee?parseInt(ee.val()):0,"rotate"!=K){if(e<=0||n<=0)return t.error("Invalid image size"),!1;
162if(e==fe&&n==me&&parseInt(s/1e3)===parseInt(a/1e3))return t.error("errResizeNoChange"),!1}return{w:e,h:n,x:i,y:o,d:r,q:l,b:c}},Xe=function(){var e;(e=Ge())&&(T.elfinderdialog("close"),l.resizeRequest({target:i.hash,width:e.w,height:e.h,x:e.x,y:e.y,degree:e.d,quality:e.q,bg:e.b,mode:K},i,d))},Ye=function(){var n,o=function(){n.addClass(b).fadeIn((function(){_.addClass(v)})),t.disable()},r=function(){l.mime=i.mime,l.prefix=i.name.replace(/ \d+(\.[^.]+)?$/,"$1"),l.requestCmd="mkfile",l.nextAction={},l.data={target:i.phash},t.res("mixin","make").bind(l)().done((function(r){var s,a;r.added&&r.added.length?(s=r.added[0].hash,a=t.api<2.1032?t.url(i.hash,{async:!0,temporary:!0}):null,e.when(a).done((function(e){t.request({options:{type:"post"},data:{cmd:"put",target:s,encoding:a?"scheme":"hash",content:a?t.convAbsUrl(e):i.hash},notify:{type:"copy",cnt:1},syncOnFail:!0}).fail(o).done((function(e){e=t.normalize(e),t.updateCache(e),i=t.file(s),e.changed&&e.changed.length&&t.change(e),_.show().find(".elfinder-dialog-title").html(t.escape(i.name)),Xe(),n.fadeIn()}))})).fail(o)):o()})).fail(o).always((function(){delete l.mime,delete l.prefix,delete l.nextAction,delete l.data})),t.trigger("unselectfiles",{files:[i.hash]})},s=null;Ge()&&(n=p.children("."+l.dialogClass+":visible").removeClass(b).fadeOut(),_.removeClass(v),t.enable(),t.searchStatus.state<2&&i.phash!==t.cwd().hash&&(s=t.exec("open",[i.phash],{thash:i.phash})),e.when([s]).done((function(){s?t.one("cwdrender",r):r()})).fail(o))},Qe={},Je="elfinder-resize-handle-hline",Ze="elfinder-resize-handle-vline",et="elfinder-resize-handle-point",tt=r,nt=ee?e("<img>").attr("crossorigin",t.isCORS?"use-credentials":"").attr("src",tt).on("load",(function(){try{var e=document.createElement("canvas");nt.data("canvas",e).data("ctx",e.getContext("2d")),it()}catch(e){nt.removeData("canvas").removeData("ctx")}})):null,it=function(){R.find("input.elfinder-resize-quality:visible").trigger("change")},ot=function(n){if(!_.hasClass("elfinder-dialog-minimized")&&!_.is(":hidden")){rt.hide(),st.hide();var i,o,r,s=t.options.dialogContained?p:e(window),a=s.height(),l=s.width(),c="auto",d=!0;_.width(Math.min(650,l-30)),z.attr("style",""),fe&&me&&(be=z.width()-(F.outerWidth()-F.width()),ye=z.height()-(F.outerHeight()-F.height()),Ue.updateView(fe,me)),o=T.find("div.elfinder-resize-control").width(),(r=z.width())>(i=T.width()-20)?(z.width(i),d=!1):i-r<o&&(l>a?z.width(i-o-20):(z.css({float:"none",marginLeft:"auto",marginRight:"auto"}),d=!1)),d&&(c=o),be=z.width()-(F.outerWidth()-F.width()),p.hasClass("elfinder-fullscreen")?_.height()>a&&(a-=2,z.height(a-_.height()+z.height()),_.css("top",0-p.offset().top)):(a-=30,z.height()>a&&z.height(a)),ye=z.height()-(F.outerHeight()-F.height()),fe&&me&&Oe(),ze.height()&&z.height()>ze.height()+20&&(z.height(ze.height()+20),ye=z.height()-(F.outerHeight()-F.height()),Ae()),rt.css("width",c).show(),st.css("width",c).show(),st.children("span.elfinder-resize-preset:visible").length||st.hide(),T.elfinderdialog("posInit")}},rt=(C=e('<fieldset class="elfinder-resize-preset-container">').append(e("<legend>").html(t.i18n("presets"))).css("box-sizing","border-box").hide(),e.each(g,(function(t,n){2===n.length&&(k=!0,C.append(e('<span class="elfinder-resize-preset"></span>').data("s",n).text(n[0]+"x"+n[1]).button()))})),k?C:e()),st=rt.clone(!0),at=t.uploadMimeCheck(i.mime,i.phash);s=a=i.size,j.append(e(A).append(e(O).text(t.i18n("width")),G),e(A).append(e(O).text(t.i18n("height")),X,e('<div class="elfinder-resize-whctrls">').append(Ce,W)),ee?e(A).append(e(O).text(t.i18n("quality")),ee,e("<span></span>")):e(),S?e(A).append(e(O).text(t.i18n("8pxgrid")).addClass("elfinder-resize-grid8"),Te):e(),e(A).append(e(O).text(t.i18n("scale")),q),e(A).append(rt)),h&&(B.append(e(A).append(e(O).text("X"),Y),e(A).append(e(O).text("Y")).append(Q),e(A).append(e(O).text(t.i18n("width")),J),e(A).append(e(O).text(t.i18n("height")),Z,e('<div class="elfinder-resize-whctrls">').append(Se,W.clone(!0))),ee?e(A).append(e(O).text(t.i18n("quality")),ee.clone(!0),e("<span></span>")):e(),S?e(A).append(e(O).text(t.i18n("8pxgrid")).addClass("elfinder-resize-grid8")):e(),e(A).append(st)),H.append(e(A).addClass("elfinder-resize-degree").append(e(O).text(t.i18n("rotate")),te,e("<span></span>").text(t.i18n("degree")),e("<div></div>").append(U,$)[f]()),e(A).css("height","20px").append(ne),ee?e(A)[n<1?"show":"hide"]().addClass("elfinder-resize-quality").append(e(O).text(t.i18n("quality")),ee.clone(!0),e("<span></span>")):e(),e(A).append(e(O).text(t.i18n("bgcolor")),de,le,ce),e(A).css("height","20px").append(he)),U.on("click",(function(){_e-=90,qe.update(_e)})),$.on("click",(function(){_e+=90,qe.update(_e)}))),T.append(V).on("resize",(function(e){e.stopPropagation()})),h?R.append(j,B.hide(),H.hide()):R.append(j),F.append('<div class="'+Je+" "+Je+'-top"></div>','<div class="'+Je+" "+Je+'-bottom"></div>','<div class="'+Ze+" "+Ze+'-left"></div>','<div class="'+Ze+" "+Ze+'-right"></div>','<div class="'+et+" "+et+'-e"></div>','<div class="'+et+" "+et+'-se"></div>','<div class="'+et+" "+et+'-s"></div>'),z.append(N).append(F.hide()).append(ze.hide()),h&&(L.css("position","absolute").append('<div class="'+Je+" "+Je+'-top"></div>','<div class="'+Je+" "+Je+'-bottom"></div>','<div class="'+Ze+" "+Ze+'-left"></div>','<div class="'+Ze+" "+Ze+'-right"></div>','<div class="'+et+" "+et+'-n"></div>','<div class="'+et+" "+et+'-e"></div>','<div class="'+et+" "+et+'-s"></div>','<div class="'+et+" "+et+'-w"></div>','<div class="'+et+" "+et+'-ne"></div>','<div class="'+et+" "+et+'-se"></div>','<div class="'+et+" "+et+'-sw"></div>','<div class="'+et+" "+et+'-nw"></div>'),z.append(Ne.css("position","absolute").hide().append(Fe,L.append(Le))),z.append(je.hide())),z.css("overflow","hidden"),T.append(z,R),Qe[t.i18n("btnApply")]=Xe,at&&(Qe[t.i18n("btnSaveAs")]=function(){requestAnimationFrame(Ye)}),Qe[t.i18n("btnCancel")]=function(){T.elfinderdialog("close")},T.find("input,button").addClass("elfinder-tabstop"),_=l.fmDialog(T,{title:t.escape(i.name),width:6
16250,resizable:!1,buttons:Qe,open:function(){var e=function(e){Ie=t.request({data:{cmd:"dim",target:i.hash,substitute:o?400:""},preventDefault:!0}).done((function(e){if(!e.url&&n)T.elfinderdialog("close"),t.error(["errOpen",i.name]);else if(e.dim){var o=e.dim.split("x");return i.width=o[0],i.height=o[1],Me(o),e.url&&(ze.attr("src",e.url),Fe.attr("src",e.url),je.attr("src",e.url)),Re()}}))},n=!{"image/jpeg":!0,"image/png":!0,"image/gif":!0}[i.mime],o=!(!t.option("substituteImg",i.hash)||!(n||i.size>u.dimSubImgSize)),s=!(!i.width||!i.height);if(w=_.find(".ui-dialog-titlebar .elfinder-titlebar-minimize").hide(),t.bind("resize",ot),ze.attr("src",r).one("error.dimreq",(function(){e()})),Fe.attr("src",r),je.attr("src",r),h&&(je.on("mousedown touchstart",qe.start).on("touchend",qe.stop),_.on("mouseup",qe.stop)),s&&!o)return Re();if(i.size>(u.getDimThreshold||0))ze.off("error.dimreq"),e();else if(s)return Re()},close:function(){h&&(je.off("mousedown touchstart",qe.start).off("touchend",qe.stop),e(document).off("mouseup",qe.stop)),t.unbind("resize",ot),e(this).elfinderdialog("destroy")},resize:function(e,t){t&&"off"===t.minimize&&ot()}}).attr("id",o).closest(".ui-dialog").addClass(b),V[f]()[f]("disable").find("input").on("change",(function(){K=e(this).val(),He(),We(!0),Ve(!0),Ke(!0),"resize"==K?(j.show(),H.hide(),B.hide(),We(),S&&Te.insertAfter(j.find(".elfinder-resize-grid8"))):"crop"==K?(H.hide(),j.hide(),B.show(),Ve(),S&&Te.insertAfter(B.find(".elfinder-resize-grid8"))):"rotate"==K&&(j.hide(),B.hide(),H.show(),Ke())})),t.UA.ltIE8&&e(".elfinder-dialog").css("filter",""),Le.css({opacity:.2,"background-color":"#fff",position:"absolute"}),L.css("cursor","move"),L.find(".elfinder-resize-handle-point").css({"background-color":"#fff",opacity:.5,"border-color":"#000"}),h||V.find(".api2").remove(),R.find("input,select").prop("disabled",!0),R.find("input.elfinder-resize-quality").next("span").addClass("elfinder-resize-jpgsize").attr("title",t.i18n("roughFileSize"))};return c.length&&-1!==c[0].mime.indexOf("image/")?(o="resize-"+t.namespace+"-"+c[0].hash,(r=p.find("#"+o)).length?(r.elfinderdialog("toTop"),d.resolve()):(t.openUrl(c[0].hash,"sameorigin",(function(e){y(c[0],o,e)})),d)):d.reject()}},function(e){var t=function(e,t){var n=0;for(n in t)if(void 0!==e[t[n]])return t[n];return e[t[n]]="",t[n]};if(e.cssHooks.rotate={get:function(t,n,i){return e(t).rotate()},set:function(t,n){return e(t).rotate(n),n}},e.cssHooks.transform={get:function(e,n,i){var o=t(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[o]},set:function(e,n){var i=t(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[i]=n,n}},e.fn.rotate=function(e){var t;return void 0===e?window.opera?(t=this.css("transform").match(/rotate\((.*?)\)/))&&t[1]?Math.round(180*parseFloat(t[1])/Math.PI):0:(t=this.css("transform").match(/rotate\((.*?)\)/))&&t[1]?parseInt(t[1]):0:(this.css("transform",this.css("transform").replace(/none|rotate\(.*?\)/,"")+"rotate("+parseInt(e)+"deg)"),this)},e.fx.step.rotate=function(t){0==t.state&&(t.start=e(t.elem).rotate(),t.now=t.start),e(t.elem).rotate(t.now)},void 0===window.addEventListener&&void 0===document.getElementsByClassName){var n=function(e){if("static"==e.currentStyle.position){var t=function(e){for(var t=e,n=t.offsetLeft,i=t.offsetTop;t.offsetParent&&((t=t.offsetParent)==document.body||"static"==t.currentStyle.position);)t!=document.body&&t!=document.documentElement&&(n-=t.scrollLeft,i-=t.scrollTop),n+=t.offsetLeft,i+=t.offsetTop;return{x:n,y:i}}(e);e.style.position="absolute",e.style.left=t.x+"px",e.style.top=t.y+"px"}},i=e.cssHooks.transform.set;e.cssHooks.transform.set=function(e,t){return i.apply(this,[e,t]),function(e,t){var i,o=1,r=1,s=1,a=1;if(void 0!==e.style.msTransform)return!0;n(e);var l=(i=t.match(/rotate\((.*?)\)/))&&i[1]?parseInt(i[1]):0;(l%=360)<0&&(l=360+l);var c=l*Math.PI/180,d=Math.cos(c),h=Math.sin(c);o*=d,r*=-h,s*=h,a*=d,e.style.filter=(e.style.filter||"").replace(/progid:DXImageTransform\.Microsoft\.Matrix\([^)]*\)/,"")+"progid:DXImageTransform.Microsoft.Matrix(M11="+o+",M12="+r+",M21="+s+",M22="+a+",FilterType='bilinear',sizingMethod='auto expand')";var u=parseInt(e.style.width||e.width||0),p=parseInt(e.style.height||e.height||0);c=l*Math.PI/180;var f=Math.abs(Math.cos(c)),m=Math.abs(Math.sin(c)),g=(u-(u*f+p*m))/2,v=(p-(u*m+p*f))/2;e.style.marginLeft=Math.floor(g)+"px",e.style.marginTop=Math.floor(v)+"px"}(e,t),t}}}(jQuery),(h.prototype.commands.restore=function(){"use strict";var t=this,n=this.fm,i=0,o=function(t){var r,s=e.Deferred(),a=[],l=[],c=[],d=[];return s._xhrReject=function(){e.each(c,(function(){this&&this.reject&&this.reject()})),r&&r._xhrReject()},e.each(t,(function(e,t){"directory"===t.mime?a.push(t):l.push(t)})),a.length?(e.each(a,(function(e,t){c.push(n.request({data:{cmd:"open",target:t.hash},preventDefault:!0,asNotOpen:!0})),d[e]=t.hash})),e.when.apply(e,c).fail((function(){s.reject()})).done((function(){var t=[];
162e.each(arguments,(function(e,n){n.files&&(n.files.length?t=t.concat(n.files):t.push({hash:"fakefile_"+i++,phash:d[e],mime:"fakefile",name:"fakefile",ts:0}))})),n.cache(t),r=o(t).done((function(e){l=l.concat(e),s.resolve(l)}))}))):s.resolve(l),s};this.restore=function(t,r,s,a){var l,c,d,h={},u=[],p=!1,f=a||{},m=+new Date;n.lockfiles({files:s}),l=e.map(r,(function(e){return"directory"===e.mime?e.hash:null})),t.done((function(){l&&n.exec("rm",l,{forceRm:!0,quiet:!0})})).always((function(){n.unlockfiles({files:s})})),c=setTimeout((function(){n.notify({type:"search",id:m,cnt:1,hideCnt:!0,cancel:function(){d&&d._xhrReject(),t.reject()}})}),n.notifyDelay),i=0,d=o(r).always((function(){c&&clearTimeout(c),n.notify({type:"search",id:m,cnt:-1,hideCnt:!0})})).fail((function(){t.reject("errRestore","errFileNotFound")})).done((function(i){var o=["errRestore","errFolderNotFound"],r="";i.length?(e.each(i,(function(t,i){for(var o,s,a,l=i.phash;l;){if(s=n.trashes[l]){if(!h[s]){if(p)return u.push(i.hash),null;h[s]={},p=!0}""===(a=(a=n.path(i.hash).substr(n.path(l).length).replace(/\\/g,"/")).replace(/\/[^\/]+?$/,""))&&(a="/"),h[s][a]||(h[s][a]=[]),"fakefile"===i.mime?n.updateCache({removed:[i.hash]}):h[s][a].push(i.hash),(!r||r.length>a.length)&&(r=a);break}(o=n.file(l))?l=o.phash:(l=!1,e.each(n.trashes,(function(e){var t=n.file(e),o=n.path(e);if((!t.volumeid||0===i.hash.indexOf(t.volumeid))&&0===n.path(i.hash).indexOf(o))return l=e,!1})))}})),p?e.each(h,(function(i,a){var l=Object.keys(a),c=l.length;n.request({data:{cmd:"mkdir",target:i,dirs:l},notify:{type:"chkdir",cnt:c},preventFail:!0}).fail((function(e){t.reject(e),n.unlockfiles({files:s})})).done((function(i){var s;(s=i.hashes)?n.getCommand("paste")?n.one("mkdirdone",(function(){var i=!1;e.each(a,(function(e,a){s[e]&&(a.length?n.file(s[e])?(n.clipboard(a,!0),n.exec("paste",[s[e]],{_cmd:"restore",noToast:f.noToast||e!==r}).done((function(e){e&&(e.error||e.warning)&&(i=!0)})).fail((function(){i=!0})).always((function(){--c<1&&(t[i?"reject":"resolve"](),u.length&&n.exec("restore",u))}))):t.reject(o):--c<1&&(t.resolve(),u.length&&n.exec("restore",u)))}))})):t.reject(["errRestore","errCmdNoSupport","(paste)"]):t.reject(o)}))})):t.reject(o)):(t.reject("errFileNotFound"),l&&n.exec("rm",l,{forceRm:!0,quiet:!0}))}))},this.linkedCmds=["copy","paste","mkdir","rm"],this.updateOnSelect=!1,this.init=function(){t=this,n=this.fm},this.getstate=function(t,i){return(t=t||n.selected()).length&&e.grep(t,(function(e){var t=n.file(e);return!(!t||t.locked||n.isRoot(t))})).length==t.length?0:-1},this.exec=function(i,o){var r=e.Deferred().fail((function(e){e&&n.error(e)})),s=t.files(i);return s.length?(e.each(s,(function(e,t){return n.isRoot(t)?!r.reject(["errRestore",t.name]):t.locked?!r.reject(["errLocked",t.name]):void 0})),"pending"===r.state()&&this.restore(r,s,i,o),r):r.reject()}}).prototype={forceLoad:!0},h.prototype.commands.rm=function(){"use strict";var t=this,n=this.fm,i='<div class="ui-helper-clearfix elfinder-rm-title"><span class="elfinder-cwd-icon {class} ui-corner-all"></span>{title}<div class="elfinder-rm-desc">{desc}</div></div>',o=function(e,t,i){var o=i?{}:{type:"rm",cnt:t.length};n.request({data:{cmd:"rm",targets:t},notify:o,preventFail:!0}).fail((function(t){e.reject(t)})).done((function(t){(t.error||t.warning)&&(t.sync=!0),e.resolve(t)})).always((function(){n.unlockfiles({files:t})}))},r=function(t){var i,o=null;return t&&t.length&&(t.length>1&&2===n.searchStatus.state?(i=n.file(n.root(t[0])).volumeid,e.grep(t,(function(e){return 0!==e.indexOf(i)})).length||(o=n.option("trashHash",t[0]))):o=n.option("trashHash",t[0])),o},s=!1;this.confirm=function(r,a,l,c,d){var h,u,p,f,m,g,v=a.length,b=n.cwd().hash,y=[],x=n.i18n("calc")+'<span class="elfinder-spinner"></span>';v>1?(f=0,e.each(l,(function(e,t){if(!t.size||"unknown"==t.size||"directory"===t.mime)return f="unknown",!1;var n=parseInt(t.size);n>=0&&f>=0&&(f+=n)})),s="unknown"===f,y.push(n.i18n("size")+": "+(s?x:n.formatSize(f))),u=[e(i.replace("{class}","elfinder-cwd-icon-group").replace("{title}","<strong>"+n.i18n("items")+": "+v+"</strong>").replace("{desc}",y.join("<br>")))]):(m=l[0],p=n.tmb(m),s="directory"===m.mime,y.push(n.i18n("size")+": "+(s?x:n.formatSize(m.size))),y.push(n.i18n("modify")+": "+n.formatDate(m)),g=n.escape(m.i18||m.name).replace(/([_.])/g,"&#8203;$1"),u=[e(i.replace("{class}",n.mime2class(m.mime)).replace("{title}","<strong>"+g+"</strong>").replace("{desc}",y.join("<br>")))]),d&&(u=u.concat(d)),u.push(c?"confirmTrash":"confirmRm"),h=n.confirm({title:t.title,text:u,accept:{label:"btnRm",callback:function(){c?t.toTrash(r,a,c):o(r,a)}},cancel:{label:"btnCancel",callback:function(){n.unlockfiles({files:a}),1===a.length&&n.file(a[0]).phash!==b?n.select({selected:a}):n.selectfiles({files:a}),r.reject()}}}),p&&e("<img/>").on("load",(function(){h.find(".elfinder-cwd-icon").addClass(p.className).css("background-image","url('"+p.url+"')")}
162)).attr("src",p.url),s&&(s=n.getSize(e.map(l,(function(e){return"directory"===e.mime?e.hash:null}))).done((function(e){h.find("span.elfinder-spinner").parent().html(n.i18n("size")+": "+e.formated)})).fail((function(){h.find("span.elfinder-spinner").parent().html(n.i18n("size")+": "+n.i18n("unknown"))})).always((function(){s=!1})))},this.toTrash=function(i,o,r){var s,a,l,c={},d=o.length,h=t.options.toTrashMaxItems,u=[],p=e.Deferred();d>h?t.confirm(i,o,t.files(o),null,[n.i18n("tooManyToTrash")]):(e.each(o,(function(e,t){var i=n.file(t),o=n.path(t).replace(/\\/g,"/").match(/^[^\/]+?(\/(?:[^\/]+?\/)*)[^\/]+?$/);i&&(o&&(o[1]=o[1].replace(/(^\/.*?)\/?$/,"$1"),c[o[1]]||(c[o[1]]=[]),c[o[1]].push(t)),"directory"===i.mime&&u.push(t))})),u.length?(s=n.request({data:{cmd:"size",targets:u},notify:{type:"readdir",cnt:1,hideCnt:!0},preventDefault:!0}).done((function(e){var t=0;e.fileCnt&&(t+=parseInt(e.fileCnt)),e.dirCnt&&(t+=parseInt(e.dirCnt)),p[t>h?"reject":"resolve"]()})).fail((function(){p.reject()})),setTimeout((function(){var e=s&&s.xhr?s.xhr:null;e&&"pending"==e.state()&&(s.syncOnFail(!1),s.reject(),p.reject())}),1e3*t.options.infoCheckWait)):p.resolve(),p.done((function(){a=Object.keys(c),(l=a.length)?n.request({data:{cmd:"mkdir",target:r,dirs:a},notify:{type:"chkdir",cnt:l},preventFail:!0}).fail((function(e){i.reject(e),n.unlockfiles({files:o})})).done((function(t){var r,s,a,d,h=["errTrash"],u={},p=function(){return n.ui.notify.children(".elfinder-notify-trash").length};(r=t.hashes)?(a=1/l*100,d=1===l?100:5,s=setTimeout((function(){n.notify({type:"trash",cnt:1,hideCnt:!0,progress:d})}),n.notifyDelay),e.each(c,(function(t,c){var f;n.file(c[0]).phash;r[t]&&(f={cmd:"paste",dst:r[t],targets:c,cut:1},n.request({data:f,preventDefault:!0}).fail((function(e){e&&(h=h.concat(e))})).done((function(t){t=n.normalize(t),n.updateCache(t),function(t,i,r){var s,a,l,c;e.each(t,(function(e,t){Array.isArray(t)&&(u[e]?u[e]=u[e].concat(t):u[e]=t)})),t.sync&&(u.sync=1),t.added&&t.added.length&&(s=function(){var i=[],o=e.map(t.added,(function(e){return"directory"===e.mime?e.hash:null}));return e.each(t.added,(function(t,n){-1===e.inArray(n.phash,o)&&i.push(n.hash)})),n.exec("restore",i,{noToast:!0})},l=function(){return n.request({data:r,notify:{type:"redo",cnt:o.length}})},u.undo?(a=u.undo,u.undo=function(){s(),a()}):u.undo=s,u.redo?(c=u.redo,u.redo=function(){l(),c()}):u.redo=l)}(t,0,f),t.warning&&(h=h.concat(t.warning),delete t.warning),t.removed&&t.removed.length&&n.remove(t),t.added&&t.added.length&&n.add(t),t.changed&&t.changed.length&&n.change(t),n.trigger("paste",t),n.trigger("pastedone"),t.sync&&n.sync()})).always((function(){var t=[],r=2;p()?n.notify({type:"trash",cnt:0,hideCnt:!0,progress:a}):d+=a,--l<1&&(s&&clearTimeout(s),p()&&n.notify({type:"trash",cnt:-1}),n.unlockfiles({files:o}),Object.keys(u).length?(h.length>1&&((u.removed||u.removed.length)&&(t=e.grep(o,(function(t){return-1===e.inArray(t,u.removed)}))),t.length?(h.length>r&&(r=-1===(n.messages[h[r-1]]||"").indexOf("$")?r:r+1),i.reject(),n.exec("rm",t,{addTexts:h.slice(0,r),forceRm:!0})):n.error(h)),u._noSound=!0,u.undo&&u.redo&&(u.undo={cmd:"trash",callback:u.undo},u.redo={cmd:"trash",callback:u.redo}),i.resolve(u)):i.reject(h))})))}))):(i.reject("errFolderNotFound"),n.unlockfiles({files:o}))})):(i.reject(["error","The folder hierarchy to be deleting can not be determined."]),n.unlockfiles({files:o}))})).fail((function(){t.confirm(i,o,t.files(o),null,[n.i18n("tooManyToTrash")])})))},this.remove=o,this.syncTitleOnChange=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"delete ctrl+backspace shift+delete"}],this.value="rm",this.init=function(){var i=function(i){var o;delete t.extra,t.title=n.i18n("cmd"+t.value),t.className=t.value,t.button&&t.button.children("span.elfinder-button-icon")["trash"===t.value?"addClass":"removeClass"]("elfinder-button-icon-trash"),i&&"cwd"!==i&&(t.state>-1||"navbar"===i)&&"trash"===t.value&&(t.extra={icon:"rm",node:e("<span></span>").attr({title:n.i18n("cmdrm")}).on("ready",(function(e,t){o=t.targets})).on("click touchstart",(function(e){"touchstart"===e.type&&e.originalEvent.touches.length>1||(e.stopPropagation(),e.preventDefault(),n.getUI().trigger("click"),n.exec("rm",o,{_userAction:!0,forceRm:!0}))}))})};t=this,n=this.fm,t.change((function(){i()})),n.bind("contextmenucreate",(function(e){i(e.data.type)}))},this.getstate=function(t){var i,o,r=this.hashes(t);
162return r.length&&(i=r,o=!0,e.grep(i,(function(e){var t;return o=!(!o||!(t=n.file(e))||t.locked||n.isRoot(t))}))).length==r.length?0:-1},this.exec=function(i,a){var l,c=a||{},d=e.Deferred().always((function(){s&&s.state&&"pending"===s.state()&&s.reject()})).fail((function(e){e&&n.error(e)})).done((function(e){!c.quiet&&!e._noSound&&e.removed&&e.removed.length&&n.trigger("playsound",{soundFile:"rm.wav"})})),h=t.files(i),u=h.length,p=null,f=c.addTexts?c.addTexts:null,m=c.forceRm,g=c.quiet;return u?(e.each(h,(function(e,t){return n.isRoot(t)?!d.reject(["errRm",t.name,"errPerm"]):t.locked?!d.reject(["errLocked",t.name]):void 0})),"pending"===d.state()&&(l=t.hashes(i),u=h.length,(m||t.event&&t.event.originalEvent&&t.event.originalEvent.shiftKey)&&(p="",t.title=n.i18n("cmdrm")),null===p&&(p=r(l)),n.lockfiles({files:l}),p&&t.options.quickTrash?t.toTrash(d,l,p):g?o(d,l,g):t.confirm(d,l,h,p,f)),d):d.reject()},n.bind("select contextmenucreate closecontextmenu",(function(e){var i=(e.data?e.data.selected||e.data.targets:null)||n.selected();i&&i.length&&t.update(void 0,(i?r(i):n.option("trashHash"))?"trash":"rm")}))},h.prototype.commands.search=function(){"use strict";this.title="Find files",this.options={ui:"searchbutton"},this.alwaysEnabled=!0,this.updateOnSelect=!1,this.getstate=function(){return 0},this.exec=function(t,n,i,o){var r,s,a=this.fm,l=[],c=o||"",d=a.options.onlyMimes,h=[],u=function(e){return c&&"SearchName"!==c&&"SearchMime"!==c&&(e.type=c),e};return"string"==typeof t&&t?("object"==typeof n&&(i=n.mime||"",n=n.target||""),n=n||"",i?(i=i.trim().replace(","," ").split(" "),d.length&&(i=e.map(i,(function(t){return(t=t.trim())&&(-1!==e.inArray(t,d)||e.grep(d,(function(e){return 0===t.indexOf(e)})).length)?t:null})))):i=[].concat(d),a.trigger("searchstart",u({query:t,target:n,mimes:i})),!d.length||i.length?""===n&&a.api>=2.1?(s=Object.keys(a.roots).length,e.each(a.roots,(function(e,n){l.push(a.request({data:u({cmd:"search",q:t,target:n,mimes:i}),notify:{type:"search",cnt:1,hideCnt:!(s>1)},cancel:!0,preventDone:!0}))}))):(l.push(a.request({data:u({cmd:"search",q:t,target:n,mimes:i}),notify:{type:"search",cnt:1,hideCnt:!0},cancel:!0,preventDone:!0})),""!==n&&a.api>=2.1&&Object.keys(a.leafRoots).length&&e.each(a.leafRoots,(function(o,s){for(r=o;r;)n===r&&e.each(s,(function(){var e=a.file(this);e&&e.volumeid&&h.push(e.volumeid),l.push(a.request({data:u({cmd:"search",q:t,target:this,mimes:i}),notify:{type:"search",cnt:1,hideCnt:!1},cancel:!0,preventDone:!0}))})),r=(a.file(r)||{}).phash}))):l=[e.Deferred().resolve({files:[]})],a.searchStatus.mixed=l.length>1&&h,e.when.apply(e,l).done((function(e){var t,n=arguments.length;if(e.warning&&a.error(e.warning),n>1)for(e.files=e.files||[],t=1;t<n;t++)arguments[t].warning&&a.error(arguments[t].warning),arguments[t].files&&e.files.push.apply(e.files,arguments[t].files);e.files&&e.files.length&&a.cache(e.files),a.lazy((function(){a.trigger("search",e)})).then((function(){return a.lazy((function(){a.trigger("searchdone")}))})).then((function(){e.sync&&a.sync()}))}))):(a.getUI("toolbar").find("."+a.res("class","searchbtn")+" :text").trigger("focus"),e.Deferred().reject())}},h.prototype.commands.selectall=function(){"use strict";var t=0;this.fm.bind("select",(function(e){t=e.data&&e.data.selectall?-1:0})),this.state=0,this.updateOnSelect=!1,this.getstate=function(){return t},this.exec=function(){return e(document).trigger(e.Event("keydown",{keyCode:65,ctrlKey:!0,shiftKey:!1,altKey:!1,metaKey:!1})),e.Deferred().resolve()}},h.prototype.commands.selectinvert=function(){"use strict";this.updateOnSelect=!1,this.getstate=function(){return 0},this.exec=function(){return e(document).trigger(e.Event("keydown",{keyCode:73,ctrlKey:!0,shiftKey:!0,altKey:!1,metaKey:!1})),e.Deferred().resolve()}},h.prototype.commands.selectnone=function(){"use strict";var t=this.fm,n=-1;t.bind("select",(function(e){n=e.data&&e.data.unselectall?-1:0})),this.state=-1,this.updateOnSelect=!1,this.getstate=function(){return n},this.exec=function(){return t.getUI("cwd").trigger("unselectall"),e.Deferred().resolve()}},h.prototype.commands.sort=function(){"use strict";var t=this,n=t.fm,i=function(){t.variants=[],e.each(n.sortRules,(function(e,i){if(n.sorters[e]){var o=e===n.sortType?"asc"===n.sortOrder?"n":"s":"";t.variants.push([e,(o?'<span class="ui-icon ui-icon-arrowthick-1-'+o+'"></span>':"")+"&nbsp;"+n.i18n("sort"+e)])}})),t.variants.push("|"),t.variants.push(["stick",(n.sortStickFolders?'<span class="ui-icon ui-icon-check"></span>':"")+"&nbsp;"+n.i18n("sortFoldersFirst")]),n.ui.tree&&null!==n.options.sortAlsoTreeview&&(t.variants.push("|"),t.variants.push(["tree",(n.sortAlsoTreeview?'<span class="ui-icon ui-icon-check"></span>':"")+"&nbsp;"+n.i18n("sortAlsoTreeview")])),o()},o=function(){var t,i=n.getUI("contextmenu");i.is(":visible")&&((t=i.find("span.elfinder-button-icon-sort").siblings("div.elfinder-contextmenu-sub")).find("span.ui-icon").remove(),t.children("div.elfinder-contextsubmenu-item").each((function(){var t,i=e(this).children("span"),o=i.text().trim();o===(r.stick||(r.stick=n.i18n("sortFoldersFirst")))?n.sortStickFolders&&i.prepend('<span class="ui-icon ui-icon-check"></span>'):o===(r.tree||(r.tree=n.i18n("sortAlsoTreeview")))?n.sortAlsoTreeview&&i.prepend('<span class="ui-icon ui-icon-check"></span>'):o===(r[n.sortType]||(r[n.sortType]=n.i18n("sort"+n.sortType)))&&(t="asc"===n.sortOrder?"n":"s",i.prepend('<span class="ui-icon ui-icon-arrowthick-1-'+t+'"></span>'))})))},r={};this.options={ui:"sortbutton"}
162,this.keepContextmenu=!0,n.bind("sortchange",i).bind("sorterupdate",(function(){i(),n.getUI().children(".elfinder-button-sort-menu").children(".elfinder-button-menu-item").each((function(){var t=e(this),i=t.attr("rel");t.toggle(!(i&&!n.sorters[i]))}))})).bind("cwdrender",(function(){var t=e(n.cwd).find("div.elfinder-cwd-wrapper-list table");t.length&&e.each(n.sortRules,(function(i,o){var r=t.find("thead tr td.elfinder-cwd-view-th-"+i);if(r.length){var s,a=i==n.sortType,l={type:i,order:a?"asc"==n.sortOrder?"desc":"asc":n.sortOrder};a&&(r.addClass("ui-state-active"),s="asc"==n.sortOrder?"n":"s",e('<span class="ui-icon ui-icon-triangle-1-'+s+'"></span>').appendTo(r)),e(r).on("click",(function(t){e(this).data("dragging")||(t.stopPropagation(),n.getUI("cwd").data("longtap")||n.exec("sort",[],l))})).on("mouseenter mouseleave",(function(t){e(this).toggleClass("ui-state-hover","mouseenter"===t.type)}))}}))})),this.getstate=function(){return 0},this.exec=function(t,n){var i,o=this.fm,r=e.isPlainObject(n)?n:(i={},"stick"==(n+="")?i.stick=!o.sortStickFolders:"tree"===n?i.tree=!o.sortAlsoTreeview:o.sorters[n]&&(o.sortType===n?i.order="asc"===o.sortOrder?"desc":"asc":i.type=n),i),s=Object.assign({type:o.sortType,order:o.sortOrder,stick:o.sortStickFolders,tree:o.sortAlsoTreeview},r);return o.lazy((function(){o.setSort(s.type,s.order,s.stick,s.tree),this.resolve()}))}},h.prototype.commands.undo=function(){"use strict";var t=this,n=this.fm,i=function(e){e?(t.title=n.i18n("cmdundo")+" "+n.i18n("cmd"+e.cmd),t.state=0):(t.title=n.i18n("cmdundo"),t.state=-1),t.change()},o=[];this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+z"}],this.syncTitleOnChange=!0,this.getstate=function(){return o.length?0:-1},this.setUndo=function(t,r){var s={};t&&e.isPlainObject(t)&&t.cmd&&t.callback&&(Object.assign(s,t),r?(delete r.undo,s.redo=r):n.getCommand("redo").setRedo(null),o.push(s),i(s))},this.exec=function(){var t,r,s=n.getCommand("redo"),a=e.Deferred(),l={};return o.length?((t=o.pop()).redo?(Object.assign(l,t.redo),delete t.redo):l=null,a.done((function(){l&&s.setRedo(l,t)})),i(o.length?o[o.length-1]:void 0),(r=t.callback())&&r.done?r.done((function(){a.resolve()})).fail((function(){a.reject()})):a.resolve(),o.length?this.update(0,o[o.length-1].name):this.update(-1,"")):a.reject(),a},n.bind("exec",(function(e){var n=e.data||{};n.opts&&n.opts._userAction&&n.dfrd&&n.dfrd.done&&n.dfrd.done((function(e){e&&e.undo&&e.redo&&(e.undo.redo=e.redo,t.setUndo(e.undo))}))}))},h.prototype.commands.redo=function(){"use strict";var t=this,n=this.fm,i=function(e){e&&e.callback?(t.title=n.i18n("cmdredo")+" "+n.i18n("cmd"+e.cmd),t.state=0):(t.title=n.i18n("cmdredo"),t.state=-1),t.change()},o=[];this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"shift+ctrl+z ctrl+y"}],this.syncTitleOnChange=!0,this.getstate=function(){return o.length?0:-1},this.setRedo=function(e,t){null===e?(o=[],i()):e&&e.cmd&&e.callback&&(t&&(e.undo=t),o.push(e),i(e))},this.exec=function(){var t,r,s=n.getCommand("undo"),a=e.Deferred(),l={},c={};return o.length?((t=o.pop()).undo&&(Object.assign(l,t.undo),Object.assign(c,t),delete c.undo,a.done((function(){s.setUndo(l,c)}))),i(o.length?o[o.length-1]:void 0),(r=t.callback())&&r.done?r.done((function(){a.resolve()})).fail((function(){a.reject()})):a.resolve(),a):a.reject()}},(h.prototype.commands.up=function(){"use strict";this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+up"}],this.getstate=function(){return this.fm.cwd().phash?0:-1},this.exec=function(){var t=this.fm,n=t.cwd().hash;return this.fm.cwd().phash?this.fm.exec("open",this.fm.cwd().phash).done((function(){t.one("opendone",(function(){t.selectfiles({files:[n]})}))})):e.Deferred().reject()}}).prototype={forceLoad:!0},h.prototype.commands.upload=function(){"use strict";var t=this.fm.res("class","hover");this.disableOnSearch=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+u"}],this.getstate=function(e){var t,n=this.fm,i=e||[n.cwd().hash];return this._disabled||1!=i.length||(t=n.file(i[0])),t&&"directory"==t.mime&&t.write?0:-1},this.exec=function(n){var i,o,r,s,a,l,c,d,h=this.fm,u=h.cwd().hash,p=(c=n&&n instanceof Array?n:null,(!n||n instanceof Array)&&(c||1!==(l=h.selected()).length||"directory"!==h.file(l[0]).mime?c&&1===c.length&&"directory"===h.file(c[0]).mime||(c=[u]):c=l),c),f=p?p[0]:n&&n.target?n.target:null,m=f?h.file(f):h.cwd(),g=function(t){h.upload(t).fail((function(e){x.reject(e)})).done((function(t){var n;h.getUI("cwd");if(x.resolve(t),t&&t.added&&t.added[0]&&!h.ui.notify.children(".elfinder-notify-upload").length){var i=h.findCwdNodes(t.added);i.length?i.trigger("scrolltoview"):(m.hash!==u?n=e("<div></div>").append(e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"><span class="ui-button-text">'+h.i18n("cmdopendir")+"</span></button>").on("mouseenter mouseleave",(function(t){e(this).toggleClass("ui-state-hover","mouseenter"
162==t.type)})).on("click",(function(){h.exec("open",f).done((function(){h.one("opendone",(function(){h.trigger("selectfiles",{files:e.map(t.added,(function(e){return e.hash}))})}))}))}))):h.trigger("selectfiles",{files:e.map(t.added,(function(e){return e.hash}))}),h.toast({msg:h.i18n(["complete",h.i18n("cmdupload")]),extNode:n}))}})).progress((function(){x.notifyWith(this,Array.from(arguments))}))},v=function(e){i.elfinderdialog("close"),p&&(e.target=p[0]),g(e)},b=function(){var t=m.hash,n=e.map(h.files(t),(function(e){return"directory"===e.mime&&e.write?e:null}));return n.length?e('<div class="elfinder-upload-dirselect elfinder-tabstop" title="'+h.i18n("folders")+'"></div>').on("click",(function(t){t.stopPropagation(),t.preventDefault(),n=h.sortFiles(n);var o=e(this),r=(h.cwd(),i.closest("div.ui-dialog")),s=function(e,t){return{label:h.escape(e.i18||e.name),icon:t,remain:!1,callback:function(){var t=r.children(".ui-dialog-titlebar:first").find("span.elfinder-upload-target");p=[e.hash],t.html(" - "+h.escape(e.i18||e.name)),o.trigger("focus")},options:{className:p&&p.length&&e.hash===p[0]?"ui-state-active":"",iconClass:e.csscls||"",iconImg:e.icon||""}}},a=[s(m,"opendir"),"|"];e.each(n,(function(e,t){a.push(s(t,"dir"))})),o.trigger("blur"),h.trigger("contextmenu",{raw:a,x:t.pageX||e(this).offset().left,y:t.pageY||e(this).offset().top,prevNode:r,fitHeight:!0})})).append('<span class="elfinder-button-icon elfinder-button-icon-dir" ></span>'):e()},y=function(n,i){var o=e('<input type="file" '+n+"/>").on("click",(function(){h.UA.IE&&setTimeout((function(){r.css("display","none").css("position","relative"),requestAnimationFrame((function(){r.css("display","").css("position","")}))}),100)})).on("change",(function(){v({input:o.get(0),type:"files"})})).on("dragover",(function(e){e.originalEvent.dataTransfer.dropEffect="copy"})),r=e("<form></form>").append(o).on("click",(function(e){e.stopPropagation()}));return e('<div class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only elfinder-tabstop elfinder-focus"><span class="ui-button-text">'+h.i18n(i)+"</span></div>").append(r).on("click",(function(e){e.stopPropagation(),e.preventDefault(),o.trigger("click")})).on("mouseenter mouseleave",(function(n){e(this).toggleClass(t,"mouseenter"===n.type)}))},x=e.Deferred();return o=function(t){t.stopPropagation(),t.preventDefault();var n,i,o=!1,r="",s=null,a="",l=null,c=t._target||null,d=t.dataTransfer||null,u="";if(d){d.types&&d.types.length?(-1!==(n=e.inArray("application/x-moz-file",d.types))||-1!==(n=e.inArray("Files",d.types)))&&(u="file"):d.items&&d.items.length&&d.items[0].kind&&(u=d.items[0].kind);try{if((s=d.getData("elfinderfrom"))&&(a=window.location.href+h.cwd().hash,!c&&s===a||c===a))return void x.reject()}catch(t){}if("file"===u&&(d.items[n].getAsEntry||d.items[n].webkitGetAsEntry||d.items[n].getAsFile))o=d,r="data";else if("string"!==u&&d.files&&d.files.length&&-1===e.inArray("Text",d.types))o=d.files,r="files";else{try{(l=d.getData("text/html"))&&l.match(/<(?:img|a)/i)&&(o=[l],r="html")}catch(t){}o||((l=d.getData("text"))?(o=[l],r="text"):d&&d.files&&(u="file"))}}o?g({files:o,type:r,target:c,dropEvt:t}):(i=["errUploadNoFiles"],"file"===u&&i.push("errFolderUpload"),h.error(i),x.reject())},!p&&n?(n.input||n.files?(n.type="files",g(n)):n.dropEvt&&o(n.dropEvt),x):(r=function(t){var n,i=t.originalEvent||t,o=[],r=[];if(i.clipboardData){if(i.clipboardData.items&&i.clipboardData.items.length){r=i.clipboardData.items;for(var s=0;s<r.length;s++)"file"==i.clipboardData.items[s].kind&&(n=i.clipboardData.items[s].getAsFile(),o.push(n))}else i.clipboardData.files&&i.clipboardData.files.length&&(o=i.clipboardData.files);if(o.length)return void v({files:o,type:"files",clipdata:!0})}var a=i.target||i.srcElement;requestAnimationFrame((function(){var t,n="text";a.innerHTML&&(e(a).find("img").each((function(t,n){n.src.match(/^webkit-fake-url:\/\//)&&e(n).remove()})),e(a).find("a,img").length&&(n="html"),t=a.innerHTML,a.innerHTML="",v({files:[t],type:n}))}))},i=e('<div class="elfinder-upload-dialog-wrapper"></div>').append(y("multiple","selectForUpload")),h.UA.Mobile||void 0===(d=document.createElement("input")).webkitdirectory&&void 0===d.directory||i.append(y("multiple webkitdirectory directory","selectFolder")),m.dirs&&(m.hash===u||h.navHash2Elm(m.hash).hasClass("elfinder-subtree-loaded")?b().appendTo(i):(s=e('<
162div class="elfinder-upload-dirselect" title="'+h.i18n("nowLoading")+'"></div>').append('<span class="elfinder-button-icon elfinder-button-icon-spinner" ></span>').appendTo(i),h.request({cmd:"tree",target:m.hash}).done((function(){h.one("treedone",(function(){s.replaceWith(b()),a.elfinderdialog("tabstopsInit")}))})).fail((function(){s.remove()})))),h.dragUpload?e('<div class="ui-corner-all elfinder-upload-dropbox elfinder-tabstop" contenteditable="true" data-ph="'+h.i18n("dropPasteFiles")+'"></div>').on("paste",(function(e){r(e)})).on("mousedown click",(function(){e(this).trigger("focus")})).on("focus",(function(){this.innerHTML=""})).on("mouseover",(function(){e(this).addClass(t)})).on("mouseout",(function(){e(this).removeClass(t)})).on("dragenter",(function(n){n.stopPropagation(),n.preventDefault(),e(this).addClass(t)})).on("dragleave",(function(n){n.stopPropagation(),n.preventDefault(),e(this).removeClass(t)})).on("dragover",(function(n){n.stopPropagation(),n.preventDefault(),n.originalEvent.dataTransfer.dropEffect="copy",e(this).addClass(t)})).on("drop",(function(e){i.elfinderdialog("close"),p&&(e.originalEvent._target=p[0]),o(e.originalEvent)})).prependTo(i).after('<div class="elfinder-upload-dialog-or">'+h.i18n("or")+"</div>")[0]:e('<div class="ui-corner-all elfinder-upload-dropbox" contenteditable="true">'+h.i18n("dropFilesBrowser")+"</div>").on("paste drop",(function(e){r(e)})).on("mousedown click",(function(){e(this).trigger("focus")})).on("focus",(function(){this.innerHTML=""})).on("dragenter mouseover",(function(){e(this).addClass(t)})).on("dragleave mouseout",(function(){e(this).removeClass(t)})).prependTo(i).after('<div class="elfinder-upload-dialog-or">'+h.i18n("or")+"</div>")[0],a=this.fmDialog(i,{title:this.title+'<span class="elfinder-upload-target">'+(m?" - "+h.escape(m.i18||m.name):"")+"</span>",modal:!0,resizable:!1,destroyOnClose:!0,propagationEvents:["mousemove","mouseup","click"],close:function(){var e=h.getUI("contextmenu");e.is(":visible")&&e.click()}}),x)}},h.prototype.commands.view=function(){"use strict";var t,n=this,i=this.fm;this.value=i.viewType,this.alwaysEnabled=!0,this.updateOnSelect=!1,this.options={ui:"viewbutton"},this.getstate=function(){return 0},this.extra={icon:"menu",node:e("<span></span>").attr({title:i.i18n("viewtype")}).on("click touchstart",(function(t){if(!("touchstart"===t.type&&t.originalEvent.touches.length>1)){var n=e(this);t.stopPropagation(),t.preventDefault(),i.trigger("contextmenu",{raw:getSubMenuRaw(),x:n.offset().left,y:n.offset().top})}}))},this.exec=function(){var e=this,t="list"==this.value?"icons":"list";return i.storage("view",t),i.lazy((function(){i.viewchange(),e.update(void 0,t),this.resolve()}))},i.bind("init",(function(){t=function(){var e,t=i.getUI("cwd"),o=[],r=i.options.uiOptions.cwd.iconsView.sizeNames,s=i.options.uiOptions.cwd.iconsView.sizeMax;for(e=0;e<=s;e++)o.push({label:i.i18n(r[e]||"Size-"+e+" icons"),icon:"view",callback:function(e){return function(){t.trigger("iconpref",{size:e}),i.storage("iconsize",e),"list"===n.value&&n.exec()}}(e)});return o.push("|"),o.push({label:i.i18n("viewlist"),icon:"view-list",callback:function(){"list"!==n.value&&n.exec()}}),o}()})).bind("contextmenucreate",(function(){n.extra={icon:"menu",node:e("<span></span>").attr({title:i.i18n("cmdview")}).on("click touchstart",(function(o){if(!("touchstart"===o.type&&o.originalEvent.touches.length>1)){var r,s,a=e(this);t.concat();for(r="list"===n.value?t.length-1:parseInt(i.storage("iconsize")||0),s=0;s<t.length;s++)"|"!==t[s]&&(t[s].options=s===r?{className:"ui-state-active"}:void 0);o.stopPropagation(),o.preventDefault(),i.trigger("contextmenu",{raw:t,x:a.offset().left,y:a.offset().top})}}))}}))},h})),window.tinymceElfinder=function(e){let t=$("<div/>");e.nodeId&&(t.attr("id",e.nodeId),delete e.nodeId);const n=e.uploadTargetHash||"L1_Lw";delete e.uploadTargetHash;const i=n=>{const i=tinymce.majorVersion<5?"mce-container":"tox";return new Promise(((o,r)=>{let s;const a=()=>{n?Object.keys(s.files()).length?new Promise(((e,t)=>{s.file(n)?e():s.request({cmd:"parents",target:n}).done((i=>{s.file(n)?e():t()})).fail((()=>{t()}))})).then((()=>{s.cwd().hash==n?o(s):s.exec("open",n).done((()=>{o(s)})).fail((e=>{r(s,e||"errFolderNotFound")}))}
162)).catch((e=>{r(s,e||"errFolderNotFound")})):s.one("open",(()=>{s.file(n)?o(s):r(s,"errFolderNotFound")})):o(s)};(s=t.elfinder("instance"))||(s=t.dialogelfinder(Object.assign({title:"File Manager",startPathHash:n||void 0,useBrowserHistory:!1,autoOpen:!1,width:"90%",height:"90%",commandsOptions:{getfile:{oncomplete:"close"}},bootCallback:e=>{e.getUI().css("z-index",parseInt($("body>."+i+":last").css("z-index"))+100)},getFileCallback:(e,t)=>{}},e)).elfinder("instance")),a()}))};this.browser=function(e,t,n){return i().then((t=>{let i=t.getCommand("getfile");const o=()=>{t.options.getFileCallback=i.callback=(t,i)=>{var o,r;o=i.convAbsUrl(t.url),r=t.name+" ("+i.formatSize(t.size)+")","file"==n.filetype&&e(o,{text:r,title:r}),"image"==n.filetype&&e(o,{alt:r}),"media"==n.filetype&&e(o)},t.getUI().dialogelfinder("open")};i?o():t.bind("init",(()=>{i=t.getCommand("getfile"),o()}))})),!1},this.uploadHandler=function(e,t,o){new Promise((function(t,o){i(n).then((i=>{let r=i.getUI(),s=e.blob(),a=!0;const l=e=>{var t=e.data.dialog||{};(t.hasClass("elfinder-dialog-error")||t.hasClass("elfinder-confirm-upload"))&&(r.dialogelfinder("open"),i.unbind("dialogopened",l))};s.name&&(a=void 0),i.bind("dialogopened",l).exec("upload",{files:[s],target:n,clipdata:a,dropEvt:{altKey:!0,ctrlKey:!0}},void 0,n).done((e=>{e.added&&e.added.length?i.exec("open",e.added[0].phash).done((function(){i.request({cmd:"stat",target:e.added[0].hash}).done((function(e){if(e&&e.files&&e.files[0]){var n=e.files[0],r=i.convAbsUrl(n.url);r+=(r.match(/\?/)?"&":"?")+"_t="+n.ts,t(r)}else o("File stat failed")})).fail((function(){o("Stat request failed")}))})).fail((function(){o("Failed to reload folder")})):o(i.i18n(e.error?e.error:"errUpload"))})).fail((e=>{const t=i.parseError(e);o(i.i18n(t?"userabort"===t?"errAbort":t:"errUploadNoFiles"))})).always((()=>{i.unbind("dialogopened",l),i.getUI().find(".elfinder-dialog-error:visible,.elfinder-confirm-upload:visible").length||r.dialogelfinder("close")}))})).catch(((e,t)=>{const n=e.parseError(t);o(e.i18n(n?"userabort"===n?"errAbort":n:"errUploadNoFiles"))}))})).then((e=>{t(e)})).catch((e=>{o(e)}))}},function(e){function t(e,t,n){return e>t&&e<t+n}e.widget("mjs.nestedSortable",e.extend({},e.ui.sortable.prototype,{options:{disableParentChange:!1,doNotClear:!1,expandOnHover:700,isAllowed:function(e,t,n){return!0},isTree:!1,listType:"ol",maxLevels:0,protectRoot:!1,rootID:null,rtl:!1,startCollapsed:!1,tabSize:20,branchClass:"mjs-nestedSortable-branch",collapsedClass:"mjs-nestedSortable-collapsed",disableNestingClass:"mjs-nestedSortable-no-nesting",errorClass:"mjs-nestedSortable-error",expandedClass:"mjs-nestedSortable-expanded",hoveringClass:"mjs-nestedSortable-hovering",leafClass:"mjs-nestedSortable-leaf",disabledClass:"mjs-nestedSortable-disabled"},_create:function(){if(this.element.data("ui-sortable",this.element.data("mjs-nestedSortable")),!this.element.is(this.options.listType))throw new Error("nestedSortable: Please check that the listType option is set to your actual list type");if(this.options.isTree&&this.options.expandOnHover&&(this.options.tolerance="intersect"),e.ui.sortable.prototype._create.apply(this,arguments),this.options.isTree){var t=this;e(this.items).each((function(){var e=this.item;e.children(t.options.listType).length?(e.addClass(t.options.branchClass),e.hasClass(t.options.collapsedClass)||e.hasClass(t.options.expandedClass)||(t.options.startCollapsed?e.addClass(t.options.collapsedClass):e.addClass(t.options.expandedClass))):e.addClass(t.options.leafClass)}))}},_destroy:function(){return this.element.removeData("mjs-nestedSortable").removeData("ui-sortable"),e.ui.sortable.prototype._destroy.apply(this,arguments)},_mouseDrag:function(t){var n,i,o,r,s=this.options,a=!1;this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-this.overflowOffset.top<s.scrollSensitivity&&(this.scrollParent[0].scrollTop=a=this.scrollParent[0].scrollTop-s.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-this.overflowOffset.left<s.scrollSensitivity&&(this.scrollParent[0].scrollLeft=a=this.scrollParent[0].scrollLeft-s.scrollSpeed)):(t.pageY-e(document).scrollTop()<s.scrollSensitivity?a=e(document).scrollTop(e(document).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<s.scrollSensitivity&&(a=e(document).scrollTop(e(document).scrollTop()+s.scrollSpeed)),t.pageX-e(document).scrollLeft()<s.scrollSensitivity?a=e(document).scrollLeft(e(document).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<s.scrollSensitivity&&(a=e(document).scrollLeft(e(document).scrollLeft()+s.scrollSpeed))),!1!==a&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute");var l=this.placeholder.offset().top;this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),this.hovering=this.hovering?this.hovering:null,this.mouseentered=!!this.mouseentered&&this.mouseentered;var c=this.placeholder[0].parentNode.parentNode&&e(this.placeholder[0].parentNode.parentNode).closest(".ui-sortable-mptt").length?e(this.placeholder[0].parentNode.parentNode):null,d=this._getLevel(this.placeholder),h=this._getChildLevels(this.helper),u=document.createElement(s.listType);for(this.options.dropdownClass&&(u.className=this.options.dropdownClass),n=this.items.length-1;n>=0;n--)if(i=this.items[n],o=i.item[0],(r=this._intersectsWithPointer(i))&&i.instance===this.currentContainer){if(-1!==o.className.indexOf(s.disabledClass))if(2===r){var p=this.items[n+1];if(p&&-1!==p.item[0].className.indexOf(s.disabledClass))continue}else if(1===r){var f=this.items[n-1];if(f&&-1!==f.item[0].className.indexOf(s.disabledClass))continue}if(!(o===this.currentItem[0]||this.placeholder[1===r?"next":"prev"]()[0]===o||e.contains(this.placeholder[0],o)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],o))){if(this.mouseentered||(e(o).mouseenter(),this.mouseentered=!0),s.isTree&&e(o).hasClass(s.collapsedClass)&&s.expandOnHover&&!this.hovering){e(o).addClass(s.hoveringClass);var m=this;this.hovering=window.setTimeout((function(){e(o).removeClass(s.collapsedClass).addClass(s.expandedClass),m.refreshPositions(),m._trigger("expand",t,m._uiHash())}),s.expandOnHover)}if(this.direction=1==r?"down":"up","pointer"!=this.options.tolerance&&!this._intersectsWithSides(i))break;if(e(o).mouseleave(),this.mouseentered=!1,e(o).removeClass(s.hoveringClass),this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,!s.protectRoot||this.currentItem[0].parentNode==this.element[0]&&o.parentNode!=this.element[0])s.protectRoot||this._rearrange(t,i);else if(this.currentItem[0].parentNode!=this.element[0]&&o.parentNode==this.element[0]){e(o).children(s.listType).length||(o.appendChild(u),s.isTree&&e(o).removeClass(s.leafClass).addClass(s.branchClass+" "+s.expandedClass));var g="down"===this.direction?e(o).prev().children(s.listType):e(o).children(s.listType);void 0!==g[0]&&this._rearrange(t,null,g)}else this._rearrange(t,i);this._clearEmpty(o),this._trigger("change",t,this._uiHash());break}}var v=this.placeholder[0].previousSibling?e(this.placeholder[0].previousSibling):null;if(null!=v)for(;"li"!=v[0].nodeName.toLowerCase()||-1!==v[0].className.indexOf(s.disabledClass)||v[0]==this.currentItem[0]||v[0]==this.helper[0];){if(!v[0].previousSibling){v=null;break}v=e(v[0].previousSibling)}var b=this.placeholder[0].nextSibling?e(this.placeholder[0].nextSibling):null;if(null!=b)for(;"li"!=b[0].nodeName.toLowerCase()||-1!==b[0].className.indexOf(s.disabledClass)||b[0]==this.currentItem[0]||b[0]==this.helper[0];){if(!b[0].nextSibling){b=null;break}b=e(b[0].nextSibling)}return this.beyondMaxLevels=0,null==c||null!=b||s.protectRoot&&c[0].parentNode==this.element[0]||!(s.rtl&&this.positionAbs.left+this.helper.outerWidth()>c.offset().left+c.outerWidth()||!s.rtl&&this.positionAbs.left<c.offset().left)?null==v||v.hasClass(s.disableNestingClass)||!(v.children(s.listType).length&&v.children(s.listType).is(":visible")||!v.children(s.listType).length)||s.protectRoot&&this.currentItem[0].parentNode==this.element[0]||!(s.rtl&&this.positionAbs.left+this.helper.outerWidth()<v.offset().left+v.outerWidth()-s.tabSize||!s.rtl&&this.positionAbs.left>v.offset().left+s.tabSize)?this._isAllowed(c,d,d+h):(this._isAllowed(v,d,d+h+1),v.children(s.listType).length||(v[0].appendChild(u),s.isTree&&v.removeClass(s.leafClass).addClass(s.branchClass+" "+s.expandedClass)),l&&l<=v.offset().top?v.children(s.listType).prepend(this.placeholder):v.children(s.listType)[0].appendChild(this.placeholder[0]),this._trigger("change",t,this._uiHash())):(c.after(this.placeholder[0]),s.isTree&&c.children(s.listItem).children("li:visible:not(.ui-sortable-helper)").length<1&&c.removeClass(this.options.branchClass+" "+this.options.expandedClass).addClass(this.options.leafClass),this._clearEmpty(c[0]),this._trigger("change",t,this._uiHash())),this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?e(this.domPosition.prev).after(this.placeholder):e(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",t,this._uiHash())),e("."+this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass),this.mouseentered=!1,this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,e.ui.sortable.prototype._mouseStop.apply(this,arguments);var i=e(this.domPosition.parent).parent().attr("id"),o=this.domPosition.prev?e(this.domPosition.prev).next().index():0;i==this._uiHash().item.parent().parent().attr("id")&&o==this._uiHash().item.index()||this._trigger("relocate",t,this._uiHash())},_intersectsWithSides:function(e){var n=this.options.isTree?.8:.5,i=t(this.positionAbs.top+this.offset.click.top,e.top+e.height*n,e.height),o=t(this.positionAbs.top+this.offset.click.top,e.top-e.height*n,e.height),r=t(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"==a&&r||"left"==a&&!r:s&&("down"==s&&i||"up"==s&&o)},_contactContainers:function(t){this.options.protectRoot&&this.currentItem[0].parentNode==this.element[0]||e.ui.sortable.prototype._contactContainers.apply(this,arguments)},_clear:function(t,n){e.ui.sortable.prototype._clear.apply(this,arguments);for(var i=this.items.length-1;i>=0;i--){var o=this.items[i].item[0];this._clearEmpty(o)}},serialize:function(t){var n=e.extend({},this.options,t),i=this._getItemsAsjQuery(n&&n.connected),o=[];return e(i).each((function(){var t=(e(n.item||this).attr(n.attribute||"id")||"").match(n.expression||/(.+)[-=_](.+)/),i=(e(n.item||this).parent(n.listType).parent(n.items).attr(n.attribute||"id")||"").match(n.expression||/(.+)[-=_](.+)/);t&&o.push((n.key||t[1])+"["+(n.key&&n.expression?t[1]:t[2])+"]="+(i?n.key&&n.expression?i[1]:i[2]:n.rootID))})),!o.length&&n.key&&o.push(n.key+"="),o.join("&")},toHierarchy:function(t){var n=e.extend({},this.options,t),i=(n.startDepthCount,[]);return e(this.element).children(n.items).each((function(){var e=o(this);i.push(e)})),i;function o(t){var i=(e(t).attr(n.attribute||"id")||"").match(n.expression||/(.+)[-=_](.+)/);if(i){var r={id:i[2]};return e(t).children(n.listType).children(n.items).length>0&&(r.children=[],e(t).children(n.listType).children(n.items).each((function(){var e=o(this);r.children.push(e)}))),r}}},toArray:function(t){var n=e.extend({},this.options,t),i=n.startDepthCount||0,o=[],r=1;return n.excludeRoot||(o.push({item_id:n.rootID,parent_id:null,depth:i,left:r,right:2*(e(n.items,this.element).length+1)}),r++),e(this.element).children(n.items).each((function(){r=s(this,i+1,r)})),o=o.sort((function(e,t){return e.left-t.left}));function s(t,r,a){var l,c,d=a+1;(e(t).children(n.listType).children(n.items).length>0&&(r++,e(t).children(n.listType).children(n.items).each((function(){d=s(e(this),r,d)})),r--),l=e(t).attr(n.attribute||"id").match(n.expression||/(.+)[-=_](.+)/),r===i+1)?c=n.rootID:c=e(t).parent(n.listType).parent(n.items).attr(n.attribute||"id").match(n.expression||/(.+)[-=_](.+)/)[2];return l&&o.push({item_id:l[2],parent_id:c,depth:r,left:a,right:d}),a=d+1}},_clearEmpty:function(t){var n=this.options,i=e(t).children(n.listType);!i.length||i.children().length||n.doNotClear?n.isTree&&i.length&&i.children().length&&i.is(":visible")?e(t).removeClass(n.leafClass).addClass(n.branchClass+" "+n.expandedClass):n.isTree&&i.length&&i.children().length&&!i.is(":visible")&&e(t).removeClass(n.leafClass).addClass(n.branchClass+" "+n.collapsedClass):(n.isTree&&e(t).removeClass(n.branchClass+" "+n.expandedClass).addClass(n.leafClass),i.remove())},_getLevel:function(e){var t=1;if(this.options.listType)for(var n=e.closest(this.options.listType);n&&n.length>0&&!n.is(".ui-sortable-mptt");)t++,n=n.parent().closest(this.options.listType);return t},_getChildLevels:function(t,n){var i=this,o=this.options,r=0;return n=n||0,e(t).children(o.listType).children(o.items).each((function(e,t){r=Math.max(i._getChildLevels(t,n+1),r)})),n?r+1:r},_isAllowed:function(e,t,n){var i=this.options,o=this.placeholder.closest(".ui-sortable").nestedSortable("option","maxLevels"),r=this.currentItem.parent().parent();i.disableParentChange&&(null!==e&&!r.is(e)||null===e&&r.is("li"))||!i.isAllowed(this.placeholder,e,this.currentItem)?(this.placeholder.addClass(i.errorClass),this.beyondMaxLevels=o<n&&0!=o?n-o:1):o<n&&0!=o?(this.placeholder.addClass(i.errorClass),this.beyondMaxLevels=n-o):(this.placeholder.removeClass(i.errorClass),this.beyondMaxLevels=0)}})),e.mjs.nestedSortable.prototype.options=e.extend({},e.ui.sortable.prototype.options,e.mjs.nestedSortable.prototype.options)}(jQuery),
163/*!
164 * Chart.js v3.9.1
165 * https://www.chartjs.org
166 * (c) 2022 Chart.js Contributors
167 * Released under the MIT License
168 */
169function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Chart=t()}(this,(function(){"use strict";function e(){}const t=function(){let e=0;return function(){return e++}}();function n(e){return null==e}function i(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return"[object"===t.slice(0,7)&&"Array]"===t.slice(-6)}function o(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}const r=e=>("number"==typeof e||e instanceof Number)&&isFinite(+e);function s(e,t){return r(e)?e:t}function a(e,t){return void 0===e?t:e}const l=(e,t)=>
vendor: 2,204 bytes, line 169
169"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100:e/t,c=(e,t)=>"string"==typeof e&&e.endsWith("%")?parseFloat(e)/100*t:+e;function d(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)}function h(e,t,n,r){let s,a,l;if(i(e))if(a=e.length,r)for(s=a-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;s<a;s++)t.call(n,e[s],s);else if(o(e))for(l=Object.keys(e),a=l.length,s=0;s<a;s++)t.call(n,e[l[s]],l[s])}function u(e,t){let n,i,o,r;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(o=e[n],r=t[n],o.datasetIndex!==r.datasetIndex||o.index!==r.index)return!1;return!0}function p(e){if(i(e))return e.map(p);if(o(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let o=0;for(;o<i;++o)t[n[o]]=p(e[n[o]]);return t}return e}function f(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}function m(e,t,n,i){if(!f(e))return;const r=t[e],s=n[e];o(r)&&o(s)?g(r,s,i):t[e]=p(s)}function g(e,t,n){const r=i(t)?t:[t],s=r.length;if(!o(e))return e;const a=(n=n||{}).merger||m;for(let i=0;i<s;++i){if(!o(t=r[i]))continue;const s=Object.keys(t);for(let i=0,o=s.length;i<o;++i)a(s[i],e,t,n)}return e}function v(e,t){return g(e,t,{merger:b})}function b(e,t,n){if(!f(e))return;const i=t[e],r=n[e];o(i)&&o(r)?v(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=p(r))}const y={"":e=>e,x:e=>e.x,y:e=>e.y};function x(e,t){return(y[t]||(y[t]=function(e){const t=w(e);return e=>{for(const n of t){if(""===n)break;e=e&&e[n]}return e}}(t)))(e)}function w(e){const t=e.split("."),n=[];let i="";for(const e of t)i+=e,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function _(e){return e.charAt(0).toUpperCase()+e.slice(1)}const k=e=>void 0!==e,C=e=>"function"==typeof e,S=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function T(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}const E=Math.PI,A=2*E,O=A+E,D=Number.POSITIVE_INFINITY,I=E/180,P=E/2,M=E/4,R=2*E/3,z=Math.log10,N=Math.sign;function F(e){const t=Math.round(e);e=B(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(z(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function L(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i==0&&(t.push(i),t.push(e/i));
vendor: 4,170 bytes, line 169
169return n===(0|n)&&t.push(n),t.sort(((e,t)=>e-t)).pop(),t}function j(e){return!isNaN(parseFloat(e))&&isFinite(e)}function B(e,t,n){return Math.abs(e-t)<n}function H(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function U(e,t,n){let i,o,r;for(i=0,o=e.length;i<o;i++)r=e[i][n],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function $(e){return e*(E/180)}function q(e){return e*(180/E)}function W(e){if(!r(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function V(e,t){const n=t.x-e.x,i=t.y-e.y,o=Math.sqrt(n*n+i*i);let r=Math.atan2(i,n);return r<-.5*E&&(r+=A),{angle:r,distance:o}}function K(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function G(e,t){return(e-t+O)%A-E}function X(e){return(e%A+A)%A}function Y(e,t,n,i){const o=X(e),r=X(t),s=X(n),a=X(r-o),l=X(s-o),c=X(o-r),d=X(o-s);return o===r||o===s||i&&r===s||a>l&&c<d}function Q(e,t,n){return Math.max(t,Math.min(n,e))}function J(e){return Q(e,-32768,32767)}function Z(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function ee(e,t,n){n=n||(n=>e[n]<t);let i,o=e.length-1,r=0;for(;o-r>1;)i=r+o>>1,n(i)?r=i:o=i;return{lo:r,hi:o}}const te=(e,t,n,i)=>ee(e,n,i?i=>e[i][t]<=n:i=>e[i][t]<n),ne=(e,t,n)=>ee(e,n,(i=>e[i][t]>=n));function ie(e,t,n){let i=0,o=e.length;for(;i<o&&e[i]<t;)i++;for(;o>i&&e[o-1]>n;)o--;return i>0||o<e.length?e.slice(i,o):e}const oe=["push","pop","shift","splice","unshift"];function re(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),oe.forEach((t=>{const n="_onData"+_(t),i=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){const o=i.apply(this,t);return e._chartjs.listeners.forEach((e=>{"function"==typeof e[n]&&e[n](...t)})),o}})})))}function se(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,o=i.indexOf(t);-1!==o&&i.splice(o,1),i.length>0||(oe.forEach((t=>{delete e[t]})),delete e._chartjs)}function ae(e){const t=new Set;let n,i;for(n=0,i=e.length;n<i;++n)t.add(e[n]);return t.size===i?e:Array.from(t)}const le="undefined"==typeof window?function(e){return e()}:window.requestAnimationFrame;function ce(e,t,n){const i=n||(e=>Array.prototype.slice.call(e));let o=!1,r=[];return function(...n){r=i(n),o||(o=!0,le.call(window,(()=>{o=!1,e.apply(t,r)})))}}function de(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const he=e=>"start"===e?"left":"end"===e?"right":"center",ue=(e,t,n)=>"start"===e?t:"end"===e?n:(t+n)/2,pe=(e,t,n,i)=>e===(i?"left":"right")?n:"center"===e?(t+n)/2:t;function fe(e,t,n){const i=t.length;let o=0,r=i;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:d,minDefined:h,maxDefined:u}=s.getUserBounds();h&&(o=Q(Math.min(te(a,s.axis,c).lo,n?i:te(t,l,s.getPixelForValue(c)).lo),0,i-1)),r=u?Q(Math.max(te(a,s.axis,d,!0).hi+1,n?0:te(t,l,s.getPixelForValue(d),!0).hi+1),o,i)-o:i-o}return{start:o,count:r}}function me(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=o,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,o),r}var ge=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,i){const o=t.listeners[i],r=t.duration;o.forEach((i=>i({chart:e,initial:t.initial,numSteps:r,currentStep:Math.min(n-t.start,r)})))}_refresh(){this._request||(this._running=!0,this._request=le.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(e=Date.now()){let t=0;this._charts.forEach(((n,i)=>{if(!n.running||!n.items.length)return;const o=n.items;let r,s=o.length-1,a=!1;for(;s>=0;--s)r=o[s],r._active?(r._total>n.duration&&(n.duration=r._total),r.tick(e),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,n,e,"progress")),o.length||(n.running=!1,this._notify(i,n,e,"complete"),n.initial=!1),t+=o.length})),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}
vendor: 9,686 bytes, lines 169-175
169listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce(((e,t)=>Math.max(e,t._duration)),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}};
170/*!
171 * @kurkle/color v0.2.1
172 * https://github.com/kurkle/color#readme
173 * (c) 2022 Jukka Kurkela
174 * Released under the MIT License
175 */function ve(e){return e+.5|0}const be=(e,t,n)=>Math.max(Math.min(e,n),t);function ye(e){return be(ve(2.55*e),0,255)}function xe(e){return be(ve(255*e),0,255)}function we(e){return be(ve(e/2.55)/100,0,1)}function _e(e){return be(ve(100*e),0,100)}const ke={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ce=[..."0123456789ABCDEF"],Se=e=>Ce[15&e],Te=e=>Ce[(240&e)>>4]+Ce[15&e],Ee=e=>(240&e)>>4==(15&e);function Ae(e){var t=(e=>Ee(e.r)&&Ee(e.g)&&Ee(e.b)&&Ee(e.a))(e)?Se:Te;return e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0}const Oe=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function De(e,t,n){const i=t*Math.min(n,1-n),o=(t,o=(t+e/30)%12)=>n-i*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}function Ie(e,t,n){const i=(i,o=(i+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Pe(e,t,n){const i=De(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)i[o]*=1-t-n,i[o]+=t;return i}function Me(e){const t=e.r/255,n=e.g/255,i=e.b/255,o=Math.max(t,n,i),r=Math.min(t,n,i),s=(o+r)/2;let a,l,c;return o!==r&&(c=o-r,l=s>.5?c/(2-o-r):c/(o+r),a=function(e,t,n,i,o){return e===o?(t-n)/i+(t<n?6:0):t===o?(n-e)/i+2:(e-t)/i+4}(t,n,i,c,o),a=60*a+.5),[0|a,l||0,s]}function Re(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(xe)}function ze(e,t,n){return Re(De,e,t,n)}function Ne(e){return(e%360+360)%360}function Fe(e){const t=Oe.exec(e);let n,i=255;if(!t)return;t[5]!==n&&(i=t[6]?ye(+t[5]):xe(+t[5]));const o=Ne(+t[2]),r=+t[3]/100,s=+t[4]/100;return n="hwb"===t[1]?function(e,t,n){return Re(Pe,e,t,n)}(o,r,s):"hsv"===t[1]?function(e,t,n){return Re(Ie,e,t,n)}(o,r,s):ze(o,r,s),{r:n[0],g:n[1],b:n[2],a:i}}const Le={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},je={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let Be;function He(e){Be||(Be=function(){const e={},t=Object.keys(je),n=Object.keys(Le);let i,o,r,s,a;for(i=0;i<t.length;i++){for(s=a=t[i],o=0;o<n.length;o++)r=n[o],a=a.replace(r,Le[r]);r=parseInt(je[s],16),e[a]=[r>>16&255,r>>8&255,255&r]}return e}(),Be.transparent=[0,0,0,0]);const t=Be[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}const Ue=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const $e=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,qe=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function We(e,t,n){if(e){let i=Me(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,0===t?360:1)),i=ze(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Ve(e,t){return e?Object.assign(t||{},e):e}function Ke(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=xe(e[3]))):(t=Ve(e,{r:0,g:0,b:0,a:1})).a=xe(t.a),t}function Ge(e){return"r"===e.charAt(0)?function(e){const t=Ue.exec(e);let n,i,o,r=255;if(t){if(t[7]!==n){const e=+t[7];r=t[8]?ye(e):be(255*e,0,255)}return n=+t[1],i=+t[3],o=+t[5],n=255&(t[2]?ye(n):be(n,0,255)),i=255&(t[4]?ye(i):be(i,0,255)),o=255&(t[6]?ye(o):be(o,0,255)),{r:n,g:i,b:o,a:r}}}(e):Fe(e)}class Xe{constructor(e){if(e instanceof Xe)return e;const t=typeof e;let n;var i,o,r;"object"===t?n=Ke(e):"string"===t&&(r=(i=e).length,"#"===i[0]&&(4===r||5===r?o={r:255&17*ke[i[1]],g:255&17*ke[i[2]],b:255&17*ke[i[3]],a:5===r?17*ke[i[4]]:255}:7!==r&&9!==r||(o={r:ke[i[1]]<<4|ke[i[2]],g:ke[i[3]]<<4|ke[i[4]],b:ke[i[5]]<<4|ke[i[6]],a:9===r?ke[i[7]]<<4|ke[i[8]]:255})),n=o||He(e)||Ge(e)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var e=Ve(this._rgb);return e&&(e.a=we(e.a)),e}set rgb(e){this._rgb=Ke(e)}rgbString(){return this._valid?(e=this._rgb)&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${we(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`):void 0;var e}hexString(){return this._valid?Ae(this._rgb):void 0}hslString(){return this._valid?function(e){if(!e)return;const t=Me(e),n=t[0],i=_e(t[1]),o=_e(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${o}%, ${we(e.a)})`:`hsl(${n}, ${i}%, ${o}%)`}(this._rgb):void 0}mix(e,t){if(e){const n=this.rgb,i=e.rgb;let o;const r=t===o?.5:t,s=2*r-1,a=n.a-i.a,l=((s*a==-1?s:(s+a)/(1+s*a))+1)/2;o=1-l,n.r=255&l*n.r+o*i.r+.5,n.g=255&l*n.g+o*i.g+.5,n.b=255&l*n.b+o*i.b+.5,n.a=r*n.a+(1-r)*i.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,n){const i=qe(we(e.r)),o=qe(we(e.g)),r=qe(we(e.b));return{r:xe($e(i+n*(qe(we(t.r))-i))),g:xe($e(o+n*(qe(we(t.g))-o))),b:xe($e(r+n*(qe(we(t.b))-r))),a:e.a+n*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new Xe(this.rgb)}alpha(e){return this._rgb.a=xe(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const e=this._rgb,t=ve(.3*e.r+.59*e.g+.11*e.b);return e.r=e.g=e.b=t,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return We(this._rgb,2,e),this}darken(e){return We(this._rgb,2,-e),this}saturate(e){return We(this._rgb,1,e),this}desaturate(e){return We(this._rgb,1,-e),this}rotate(e){return function(e,t){var n=Me(e);n[0]=Ne(n[0]+t),n=ze(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,e),this}}function Ye(e){return new Xe(e)}function Qe(e){if(e&&"object"==typeof e){const t=e.toString();return"[object CanvasPattern]"===t||"[object CanvasGradient]"===t}return!1}function Je(e){return Qe(e)?e:Ye(e)}function Ze(e){return Qe(e)?e:Ye(e).saturate(.5).darken(.1).hexString()}const et=Object.create(null),tt=Object.create(null);function nt(e,t){if(!t)return e;const n=t.split(".");for(let t=0,i=n.length;t<i;++t){const i=n[t];e=e[i]||(e[i]=Object.create(null))}return e}function it(e,t,n){return"string"==typeof t?g(nt(e,t),n):g(nt(e,""),t)}var ot=new class{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>Ze(t.backgroundColor),this.hoverBorderColor=(e,t)=>Ze(t.borderColor),this.hoverColor=(e,t)=>Ze(t.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={}
vendor: 15,028 bytes, line 175
175,this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return it(this,e,t)}get(e){return nt(this,e)}describe(e,t){return it(tt,e,t)}override(e,t){return it(et,e,t)}route(e,t,n,i){const r=nt(this,e),s=nt(this,n),l="_"+t;Object.defineProperties(r,{[l]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){const e=this[l],t=s[i];return o(e)?Object.assign({},t,e):a(e,t)},set(e){this[l]=e}}})}}({_scriptable:e=>!e.startsWith("on"),_indexable:e=>"events"!==e,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function rt(){return"undefined"!=typeof window&&"undefined"!=typeof document}function st(e){let t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t}function at(e,t,n){let i;return"string"==typeof e?(i=parseInt(e,10),-1!==e.indexOf("%")&&(i=i/100*t.parentNode[n])):i=e,i}const lt=e=>window.getComputedStyle(e,null);function ct(e,t){return lt(e).getPropertyValue(t)}const dt=["top","right","bottom","left"];function ht(e,t,n){const i={};n=n?"-"+n:"";for(let o=0;o<4;o++){const r=dt[o];i[r]=parseFloat(e[t+"-"+r+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function ut(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,o=lt(n),r="border-box"===o.boxSizing,s=ht(o,"padding"),a=ht(o,"border","width"),{x:l,y:c,box:d}=function(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:o,offsetY:r}=i;let s,a,l=!1;if(((e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot))(o,r,e.target))s=o,a=r;else{const e=t.getBoundingClientRect();s=i.clientX-e.left,a=i.clientY-e.top,l=!0}return{x:s,y:a,box:l}}(e,n),h=s.left+(d&&a.left),u=s.top+(d&&a.top);let{width:p,height:f}=t;return r&&(p-=s.width+a.width,f-=s.height+a.height),{x:Math.round((l-h)/p*n.width/i),y:Math.round((c-u)/f*n.height/i)}}const pt=e=>Math.round(10*e)/10;function ft(e,t,n,i){const o=lt(e),r=ht(o,"margin"),s=at(o.maxWidth,e,"clientWidth")||D,a=at(o.maxHeight,e,"clientHeight")||D,l=function(e,t,n){let i,o;if(void 0===t||void 0===n){const r=st(e);if(r){const e=r.getBoundingClientRect(),s=lt(r),a=ht(s,"border","width"),l=ht(s,"padding");t=e.width-l.width-a.width,n=e.height-l.height-a.height,i=at(s.maxWidth,r,"clientWidth"),o=at(s.maxHeight,r,"clientHeight")}else t=e.clientWidth,n=e.clientHeight}return{width:t,height:n,maxWidth:i||D,maxHeight:o||D}}(e,t,n);let{width:c,height:d}=l;if("content-box"===o.boxSizing){const e=ht(o,"border","width"),t=ht(o,"padding");c-=t.width+e.width,d-=t.height+e.height}return c=Math.max(0,c-r.width),d=Math.max(0,i?Math.floor(c/i):d-r.height),c=pt(Math.min(c,s,l.maxWidth)),d=pt(Math.min(d,a,l.maxHeight)),c&&!d&&(d=pt(c/2)),{width:c,height:d}}function mt(e,t,n){const i=t||1,o=Math.floor(e.height*i),r=Math.floor(e.width*i);e.height=o/i,e.width=r/i;const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),(e.currentDevicePixelRatio!==i||s.height!==o||s.width!==r)&&(e.currentDevicePixelRatio=i,s.height=o,s.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0)}const gt=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function vt(e,t){const n=ct(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function bt(e){return!e||n(e.size)||n(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function yt(e,t,n,i,o){let r=t[o];return r||(r=t[o]=e.measureText(o).width,n.push(o)),r>i&&(i=r),i}function xt(e,t,n,o){let r=(o=o||{}).data=o.data||{},s=o.garbageCollect=o.garbageCollect||[];o.font!==t&&(r=o.data={},s=o.garbageCollect=[],o.font=t),e.save(),e.font=t;let a=0;const l=n.length;let c,d,h,u,p;for(c=0;c<l;c++)if(u=n[c],null!=u&&!0!==i(u))a=yt(e,r,s,a,u);else if(i(u))for(d=0,h=u.length;d<h;d++)p=u[d],null==p||i(p)||(a=yt(e,r,s,a,p));e.restore();const f=s.length/2;if(f>n.length){for(c=0;c<f;c++)delete r[s[c]];s.splice(0,f)}return a}function wt(e,t,n){const i=e.currentDevicePixelRatio,o=0!==n?Math.max(n/2,.5):0;return Math.round((t-o)*i)/i+o}function _t(e,t){(t=t||e.getContext("2d")).save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function kt(e,t,n,i){Ct(e,t,n,i,null)}function Ct(e,t,n,i,o){let r,s,a,l,c,d;const h=t.pointStyle,u=t.rotation,p=t.radius;let f=(u||0)*I;if(h&&"object"==typeof h&&(r=h.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return e.save(),e.translate(n,i),e.rotate(f),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void e.restore();if(!(isNaN(p)||p<=0)){switch(e.beginPath(),h){default:o?e.ellipse(n,i,o/2,p,0,0,A):e.arc(n,i,p,0,A),e.closePath();break;case"triangle":e.moveTo(n+Math.sin(f)*p,i-Math.cos(f)*p),f+=R,e.lineTo(n+Math.sin(f)*p,i-Math.cos(f)*p),f+=R,e.lineTo(n+Math.sin(f)*p,i-Math.cos(f)*p),e.closePath();break;case"rectRounded":c=.516*p,l=p-c,s=Math.cos(f+M)*l,a=Math.sin(f+M)*l,e.arc(n-s,i-a,c,f-E,f-P),e.arc(n+a,i-s,c,f-P,f),e.arc(n+s,i+a,c,f,f+P),e.arc(n-a,i+s,c,f+P,f+E),e.closePath();break;case"rect":if(!u){l=Math.SQRT1_2*p,d=o?o/2:l,e.rect(n-d,i-l,2*d,2*l);break}f+=M;case"rectRot":s=Math.cos(f)*p,a=Math.sin(f)*p,e.moveTo(n-s,i-a),e.lineTo(n+a,i-s),e.lineTo(n+s,i+a),e.lineTo(n-a,i+s),e.closePath();break;case"crossRot":f+=M;case"cross":s=Math.cos(f)*p,a=Math.sin(f)*p,e.moveTo(n-s,i-a),e.lineTo(n+s,i+a),e.moveTo(n+a,i-s),e.lineTo(n-a,i+s);break;case"star":s=Math.cos(f)*p,a=Math.sin(f)*p,e.moveTo(n-s,i-a),e.lineTo(n+s,i+a),e.moveTo(n+a,i-s),e.lineTo(n-a,i+s),f+=M,s=Math.cos(f)*p,a=Math.sin(f)*p,e.moveTo(n-s,i-a),e.lineTo(n+s,i+a),e.moveTo(n+a,i-s),e.lineTo(n-a,i+s);break;case"line":s=o?o/2:Math.cos(f)*p,a=Math.sin(f)*p,e.moveTo(n-s,i-a),e.lineTo(n+s,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(f)*p,i+Math.sin(f)*p)}e.fill(),t.borderWidth>0&&e.stroke()}}function St(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Tt(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Et(e){e.restore()}function At(e,t,n,i,o){if(!t)return e.lineTo(n.x,n.y);if("middle"===o){const i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else"after"===o!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Ot(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Dt(e,t,o,r,s,a={}){const l=i(t)?t:[t],c=a.strokeWidth>0&&""!==a.strokeColor;let d,h;for(e.save(),e.font=s.string,function(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]);n(t.rotation)||e.rotate(t.rotation);t.color&&(e.fillStyle=t.color);t.textAlign&&(e.textAlign=t.textAlign);t.textBaseline&&(e.textBaseline=t.textBaseline)}(e,a),d=0;d<l.length;++d)h=l[d],c&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),n(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(h,o,r,a.maxWidth)),e.fillText(h,o,r,a.maxWidth),It(e,o,r,h,a),r+=s.lineHeight;e.restore()}function It(e,t,n,i,o){if(o.strikethrough||o.underline){const r=e.measureText(i),s=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=n-r.actualBoundingBoxAscent,c=n+r.actualBoundingBoxDescent,d=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,d),e.lineTo(a,d),e.stroke()}}function Pt(e,t){const{x:n,y:i,w:o,h:r,radius:s}=t;e.arc(n+s.topLeft,i+s.topLeft,s.topLeft,-P,E,!0),e.lineTo(n,i+r-s.bottomLeft),e.arc(n+s.bottomLeft,i+r-s.bottomLeft,s.bottomLeft,E,P,!0),e.lineTo(n+o-s.bottomRight,i+r),e.arc(n+o-s.bottomRight,i+r-s.bottomRight,s.bottomRight,P,0,!0),e.lineTo(n+o,i+s.topRight),e.arc(n+o-s.topRight,i+s.topRight,s.topRight,0,-P,!0),e.lineTo(n+s.topLeft,i)}function Mt(e,t=[""],n=e,i,o=(()=>e[0])){k(i)||(i=qt("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:n,_fallback:i,_getTarget:o,override:o=>Mt([o,...e],t,n,i)};return new Proxy(r,{deleteProperty:(t,n)=>(delete t[n],delete t._keys,delete e[0][n],!0),get:(n,i)=>Lt(n,i,(()=>function(e,t,n,i){let o;for(const r of t)if(o=qt(Nt(r,e),n),k(o))return Ft(e,o)?Ut(n,i,e,o):o}(i,t,e,n))),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e._scopes[0],t),getPrototypeOf:()=>Reflect.getPrototypeOf(e[0]),has:(e,t)=>Wt(e).includes(t),ownKeys:e=>Wt(e),set(e,t,n){const i=e._storage||(e._storage=o());return e[t]=i[t]=n,delete e._keys,!0}})}function Rt(e,t,n,r){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:zt(e,r),setContext:t=>Rt(e,t,n,r),override:i=>Rt(e.override(i),t,n,r)};return new Proxy(s,{deleteProperty:(t,n)=>(delete t[n],delete e[n],!0),get:(e,t,n)=>Lt(e,t,(()=>function(e,t,n){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=e;let c=r[t];C(c)&&l.isScriptable(t)&&(c=function(e,t,n,i){const{_proxy:o,_context:r,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e),t=t(r,s||i),a.delete(e),Ft(e,t)&&(t=Ut(o._scopes,o,e,t));return t}(t,c,e,n));i(c)&&c.length&&(c=function(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=n;if(k(s.index)&&i(e))t=t[s.index%t.length];else if(o(t[0])){const n=t,i=r._scopes.filter((e=>e!==n));t=[];for(const o of n){const n=Ut(i,r,e,o);t.push(Rt(n,s,a&&a[e],l))}}return t}(t,c,e,l.isIndexable));Ft(t,c)&&(c=Rt(c,s,a&&a[t],l));return c}(e,t,n))),getOwnPropertyDescriptor:(t,n)=>t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n),getPrototypeOf:()=>Reflect.getPrototypeOf(e),has:(t,n)=>Reflect.has(e,n),ownKeys:()=>Reflect.ownKeys(e),set:(t,n,i)=>(e[n]=i,delete t[n],!0)})}function zt(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:i,isScriptable:C(n)?n:()=>n,isIndexable:C(i)?i:()=>i}}const Nt=(e,t)=>e?e+_(t):t,Ft=(e,t)=>o(t)&&"adapters"!==e&&(null===Object.getPrototypeOf(t)||t.constructor===Object);function Lt(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const i=n();return e[t]=i,i}function jt(e,t,n){return C(e)?e(t,n):e}const Bt=(e,t)=>!0===e?t:"string"==typeof e?x(t,e):void 0;function Ht(e,t,n,i,o){for(const r of t){const t=Bt(n,r);if(t){e.add(t);const r=jt(t._fallback,n,o);if(k(r)&&r!==n&&r!==i)return r}else if(!1===t&&k(i)&&n!==i)return null}return!1}function Ut(e,t,n,r){const s=t._rootScopes,a=jt(t._fallback,n,r),l=[...e,...s],c=new Set;c.add(r);let d=$t(c,l,n,a||n,r);return null!==d&&((!k(a)||a===n||(d=$t(c,l,a,d,r),null!==d))&&Mt(Array.from(c),[""],s,a,(()=>function(e,t,n){const r=e._getTarget();t in r||(r[t]={});const s=r[t];if(i(s)&&o(n))return n;return s}(t,n,r))))}function $t(e,t,n,i,o){for(;n;)n=Ht(e,t,n,i,o);return n}function qt(e,t){for(const n of t){if(!n)continue;const t=n[e];if(k(t))return t}}function Wt(e){let t=e._keys;return t||(t=e._keys=function(e){const t=new Set;for(const n of e)for(const e of Object.keys(n).filter((e=>!e.startsWith("_"))))t.add(e);return Array.from(t)}(e._scopes)),t}function Vt(e,t,n,i){const{iScale:o}=e,{key:r="r"}=this._parsing,s=new Array(i);let a,l,c,d;for(a=0,l=i;a<l;++a)c=a+n,d=t[c],s[a]={r:o.parse(x(d,r),c)};return s}const Kt=Number.EPSILON||1e-14,Gt=(e,t)=>t<e.length&&!e[t].skip&&e[t],Xt=e=>"x"===e?"y":"x";function Yt(e,t,n,i){const o=e.skip?t:e,r=t,s=n.skip?t:n,a=K(r,o),l=K(s,r);let c=a/(a+l),d=l/(a+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const h=i*c,u=i*d;return{previous:{x:r.x-h*(s.x-o.x),y:r.y-h*(s.y-o.y)},next:{x:r.x+u*(s.x-o.x),y:r.y+u*(s.y-o.y)}}}function Qt(e,t="x"){const n=Xt(t),i=e.length,o=Array(i).fill(0),r=Array(i);let s,a,l,c=Gt(e,0);for(s=0;s<i;++s)if(a=l,l=c,c=Gt(e,s+1),l){if(c){const e=c[t]-l[t];o[s]=0!==e?(c[n]-l[n])/e:0}r[s]=a?c?N(o[s-1])!==N(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}!function(e,t,n){const i=e.length;let o,r,s,a,l,c=Gt(e,0);for(let d=0;d<i-1;++d)l=c,c=Gt(e,d+1),l&&c&&(B(t[d],0,Kt)?n[d]=n[d+1]=0:(o=n[d]/t[d],r=n[d+1]/t[d],a=Math.pow(o,2)+Math.pow(r,2),a<=9||(s=3/Math.sqrt(a),n[d]=o*s*t[d],n[d+1]=r*s*t[d])))}(e,o,r),function(e,t,n="x"){const i=Xt(n),o=e.length;let r,s,a,l=Gt(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=Gt(e,c+1),!a)continue;const o=a[n],d=a[i];s&&(r=(o-s[n])/3,a[`cp1${n}`]=o-r,a[`cp1${i}`]=d-r*t[c]),l&&(r=(l[n]-o)/3,a[`cp2${n}`]=o+r,a[`cp2${i}`]=d+r*t[c])}}(e,r,t)}function Jt(e,t,n){return Math.max(Math.min(e,n),t)}function Zt(e,t,n,i,o){let r,s,a,l;if(t.spanGaps&&(e=e.filter((e=>!e.skip))),"monotone"===t.cubicInterpolationMode)Qt(e,o);else{let n=i?e[e.length-1]:e[0];for(r=0,s=e.length;r<s;++r)a=e[r],l=Yt(n,a,e[Math.min(r+1,s-(i?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,n=a}t.capBezierPoints&&function(e,t){let n,i,o,r,s,a=St(e[0],t);for(n=0,i=e.length;n<i;++n)s=r,r=a,a=n<i-1&&St(e[n+1],t),r&&(o=e[n],s&&(o.cp1x=Jt(o.cp1x,t.left,t.right),o.cp1y=Jt(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=Jt(o.cp2x,t.left,t.right),o.cp2y=Jt(o.cp2y,t.top,t.bottom)))}(e,n)}const en=e=>0===e||1===e,tn=(e,t,n)=>-Math.pow(2,10*(e-=1))*Math.sin((e-t)*A/n),nn=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*A/n)+1,on={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>1-Math.cos(e*P),easeOutSine:e=>Math.sin(e*P),easeInOutSine:e=>-.5*(Math.cos(E*e)-1),easeInExpo:e=>0===e?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>en(e)?e:e<.5?.5*Math.pow(2,10*(2*e-1)):.5*(2-Math.pow(2,-10*(2*e-1))),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>en(e)?e:tn(e,.075,.3),easeOutElastic:e=>en(e)?e:nn(e,.075,.3),easeInOutElastic(e){const t=.1125;return en(e)?e:e<.5?.5*tn(2*e,t,.45):.5+.5*nn(2*e-1,t,.45)},easeInBack(e){const t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){const t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:e=>1-on.easeOutBounce(1-e),easeOutBounce(e){const t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?.5*on.easeInBounce(2*e):.5*on.easeOutBounce(2*e-1)+.5};function rn(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function sn(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:"middle"===i?n<.5?e.y:t.y:"after"===i?n<1?e.y:t.y:n>0?t.y:e.y}}function an(e,t,n,i){const o={x:e.cp2x,y:e.cp2y},r={x:t.cp1x,y:t.cp1y},s=rn(e,o,n),a=rn(o,r,n),l=rn(r,t,n),c=rn(s,a,n),d=rn(a,l,n);return rn(c,d,n)}const ln=new Map;function cn(e,t,n){return function(e,t){t=t||{};const n=e+JSON.stringify(t);let i=ln.get(n);
vendor: 4,276 bytes, line 175
175return i||(i=new Intl.NumberFormat(e,t),ln.set(n,i)),i}(t,n).format(e)}const dn=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),hn=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function un(e,t){const n=(""+e).match(dn);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e}function pn(e,t){const n={},i=o(t),r=i?Object.keys(t):t,s=o(e)?i?n=>a(e[n],e[t[n]]):t=>e[t]:()=>e;for(const e of r)n[e]=+s(e)||0;return n}function fn(e){return pn(e,{top:"y",right:"x",bottom:"y",left:"x"})}function mn(e){return pn(e,["topLeft","topRight","bottomLeft","bottomRight"])}function gn(e){const t=fn(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function vn(e,t){e=e||{},t=t||ot.font;let n=a(e.size,t.size);"string"==typeof n&&(n=parseInt(n,10));let i=a(e.style,t.style);i&&!(""+i).match(hn)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const o={family:a(e.family,t.family),lineHeight:un(a(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:a(e.weight,t.weight),string:""};return o.string=bt(o),o}function bn(e,t,n,o){let r,s,a,l=!0;for(r=0,s=e.length;r<s;++r)if(a=e[r],void 0!==a&&(void 0!==t&&"function"==typeof a&&(a=a(t),l=!1),void 0!==n&&i(a)&&(a=a[n%a.length],l=!1),void 0!==a))return o&&!l&&(o.cacheable=!1),a}function yn(e,t,n){const{min:i,max:o}=e,r=c(t,(o-i)/2),s=(e,t)=>n&&0===e?0:e+t;return{min:s(i,-Math.abs(r)),max:s(o,r)}}function xn(e,t){return Object.assign(Object.create(e),t)}function wn(e,t,n){return e?function(e,t){return{x:n=>e+e+t-n,setWidth(e){t=e},textAlign:e=>"center"===e?e:"right"===e?"left":"right",xPlus:(e,t)=>e-t,leftForLtr:(e,t)=>e-t}}(t,n):{x:e=>e,setWidth(e){},textAlign:e=>e,xPlus:(e,t)=>e+t,leftForLtr:(e,t)=>e}}function _n(e,t){let n,i;"ltr"!==t&&"rtl"!==t||(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function kn(e,t){void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Cn(e){return"angle"===e?{between:Y,compare:G,normalize:X}:{between:Z,compare:(e,t)=>e-t,normalize:e=>e}}function Sn({start:e,end:t,count:n,loop:i,style:o}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n==0,style:o}}function Tn(e,t,n){if(!n)return[e];const{property:i,start:o,end:r}=n,s=t.length,{compare:a,between:l,normalize:c}=Cn(i),{start:d,end:h,loop:u,style:p}=function(e,t,n){const{property:i,start:o,end:r}=n,{between:s,normalize:a}=Cn(i),l=t.length;let c,d,{start:h,end:u,loop:p}=e;if(p){for(h+=l,u+=l,c=0,d=l;c<d&&s(a(t[h%l][i]),o,r);++c)h--,u--;h%=l,u%=l}return u<h&&(u+=l),{start:h,end:u,loop:p,style:e.style}}(e,t,n),f=[];let m,g,v,b=!1,y=null;const x=()=>b||l(o,v,m)&&0!==a(o,v),w=()=>!b||0===a(r,m)||l(r,v,m);for(let e=d,n=d;e<=h;++e)g=t[e%s],g.skip||(m=c(g[i]),m!==v&&(b=l(m,o,r),null===y&&x()&&(y=0===a(m,o)?e:n),null!==y&&w()&&(f.push(Sn({start:y,end:e,loop:u,count:s,style:p})),y=null),n=e,v=m));return null!==y&&f.push(Sn({start:y,end:h,loop:u,count:s,style:p})),f}function En(e,t){const n=[],i=e.segments;for(let o=0;o<i.length;o++){const r=Tn(i[o],e.points,t);r.length&&n.push(...r)}return n}function An(e,t){const n=e.points,i=e.options.spanGaps,o=n.length;if(!o)return[];const r=!!e._loop,{start:s,end:a}=function(e,t,n,i){let o=0,r=t-1;if(n&&!i)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(r+=o);r>o&&e[r%t].skip;)r--;return r%=t,{start:o,end:r}}(n,o,r,i);if(!0===i)return On(e,[{start:s,end:a,loop:r}],n,t);return On(e,function(e,t,n,i){const o=e.length,r=[];let s,a=t,l=e[t];for(s=t+1;s<=n;++s){const n=e[s%o];n.skip||n.stop?l.skip||(i=!1,r.push({start:t%o,end:(s-1)%o,loop:i}),t=a=n.stop?s:null):(a=s,l.skip&&(t=s)),l=n}return null!==a&&r.push({start:t%o,end:a%o,loop:i}),r}(n,s,a<s?a+o:a,!!e._fullLoop&&0===s&&a===o-1),n,t)}function On(e,t,n,i){return i&&i.setContext&&n?function(e,t,n,i){const o=e._chart.getContext(),r=Dn(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let d=r,h=t[0].start,u=h;function p(e,t,i,o){const r=a?-1:1;if(e!==t){for(e+=l;n[e%l].skip;)e-=r;for(;n[t%l].skip;)t+=r;e%l!=t%l&&(c.push({start:e%l,end:t%l,loop:i,style:o}),d=o,h=t%l)}}for(const e of t){h=a?h:e.start;let t,r=n[h%l];for(u=h+1;u<=e.end;u++){const a=n[u%l];
vendor: 4,514 bytes, line 175
175t=Dn(i.setContext(xn(o,{type:"segment",p0:r,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:s}))),In(t,d)&&p(h,u-1,e.loop,d),r=a,d=t}h<u-1&&p(h,u-1,e.loop,d)}return c}(e,t,n,i):t}function Dn(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function In(e,t){return t&&JSON.stringify(e)!==JSON.stringify(t)}var Pn=Object.freeze({__proto__:null,easingEffects:on,isPatternOrGradient:Qe,color:Je,getHoverColor:Ze,noop:e,uid:t,isNullOrUndef:n,isArray:i,isObject:o,isFinite:r,finiteOrDefault:s,valueOrDefault:a,toPercentage:l,toDimension:c,callback:d,each:h,_elementsEqual:u,clone:p,_merger:m,merge:g,mergeIf:v,_mergerIf:b,_deprecated:function(e,t,n,i){void 0!==t&&console.warn(e+': "'+n+'" is deprecated. Please use "'+i+'" instead')},resolveObjectKey:x,_splitKey:w,_capitalize:_,defined:k,isFunction:C,setsEqual:S,_isClickEvent:T,toFontString:bt,_measureText:yt,_longestText:xt,_alignPixel:wt,clearCanvas:_t,drawPoint:kt,drawPointLegend:Ct,_isPointInArea:St,clipArea:Tt,unclipArea:Et,_steppedLineTo:At,_bezierCurveTo:Ot,renderText:Dt,addRoundedRectPath:Pt,_lookup:ee,_lookupByKey:te,_rlookupByKey:ne,_filterBetween:ie,listenArrayEvents:re,unlistenArrayEvents:se,_arrayUnique:ae,_createResolver:Mt,_attachContext:Rt,_descriptors:zt,_parseObjectDataRadialScale:Vt,splineCurve:Yt,splineCurveMonotone:Qt,_updateBezierControlPoints:Zt,_isDomSupported:rt,_getParentNode:st,getStyle:ct,getRelativePosition:ut,getMaximumSize:ft,retinaScale:mt,supportsEventListenerOptions:gt,readUsedSize:vt,fontString:function(e,t,n){return t+" "+e+"px "+n},requestAnimFrame:le,throttled:ce,debounce:de,_toLeftRightCenter:he,_alignStartEnd:ue,_textX:pe,_getStartAndCountOfVisiblePoints:fe,_scaleRangesChanged:me,_pointInLine:rn,_steppedInterpolation:sn,_bezierInterpolation:an,formatNumber:cn,toLineHeight:un,_readValueToProps:pn,toTRBL:fn,toTRBLCorners:mn,toPadding:gn,toFont:vn,resolve:bn,_addGrace:yn,createContext:xn,PI:E,TAU:A,PITAU:O,INFINITY:D,RAD_PER_DEG:I,HALF_PI:P,QUARTER_PI:M,TWO_THIRDS_PI:R,log10:z,sign:N,niceNum:F,_factorize:L,isNumber:j,almostEquals:B,almostWhole:H,_setMinAndMaxByKey:U,toRadians:$,toDegrees:q,_decimalPlaces:W,getAngleFromPoint:V,distanceBetweenPoints:K,_angleDiff:G,_normalizeAngle:X,_angleBetween:Y,_limitValue:Q,_int16Range:J,_isBetween:Z,getRtlAdapter:wn,overrideTextDirection:_n,restoreTextDirection:kn,_boundSegment:Tn,_boundSegments:En,_computeSegments:An});function Mn(e,t,n,i){const{controller:o,data:r,_sorted:s}=e,a=o._cachedMeta.iScale;if(a&&t===a.axis&&"r"!==t&&s&&r.length){const e=a._reversePixels?ne:te;if(!i)return e(r,t,n);if(o._sharedOptions){const i=r[0],o="function"==typeof i.getRange&&i.getRange(t);if(o){const i=e(r,t,n-o),s=e(r,t,n+o);return{lo:i.lo,hi:s.hi}}}}return{lo:0,hi:r.length-1}}function Rn(e,t,n,i,o){const r=e.getSortedVisibleDatasetMetas(),s=n[t];for(let e=0,n=r.length;e<n;++e){const{index:n,data:a}=r[e],{lo:l,hi:c}=Mn(r[e],t,s,o);for(let e=l;e<=c;++e){const t=a[e];t.skip||i(t,n,e)}}}function zn(e,t,n,i,o){const r=[];if(!o&&!e.isPointInArea(t))return r;return Rn(e,n,t,(function(n,s,a){(o||St(n,e.chartArea,0))&&n.inRange(t.x,t.y,i)&&r.push({element:n,datasetIndex:s,index:a})}),!0),r}function Nn(e,t,n,i,o,r){let s=[];const a=function(e){const t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,i){const o=t?Math.abs(e.x-i.x):0,r=n?Math.abs(e.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}(n);let l=Number.POSITIVE_INFINITY;return Rn(e,n,t,(function(n,c,d){const h=n.inRange(t.x,t.y,o);if(i&&!h)return;const u=n.getCenterPoint(o);if(!(!!r||e.isPointInArea(u))&&!h)return;const p=a(t,u);p<l?(s=[{element:n,datasetIndex:c,index:d}],l=p):p===l&&s.push({element:n,datasetIndex:c,index:d})})),s}function Fn(e,t,n,i,o,r){return r||e.isPointInArea(t)?"r"!==n||i?Nn(e,t,n,i,o,r):function(e,t,n,i){let o=[];return Rn(e,n,t,(function(e,n,r){const{startAngle:s,endAngle:a}=e.getProps(["startAngle","endAngle"],i),{angle:l}=V(e,{x:t.x,y:t.y});Y(l,s,a)&&o.push({element:e,datasetIndex:n,index:r})})),o}(e,t,n,o):[]}function Ln(e,t,n,i,o){const r=[],s="x"===n?"inXRange":"inYRange";let a=!1;return Rn(e,n,t,((e,i,l)=>{e[s](t[n],o)&&(r.push({element:e,datasetIndex:i,index:l}),a=a||e.inRange(t.x,t.y,o))})),i&&!a?[]:r}var jn={evaluateInteractionItems:Rn,modes:{index(e,t,n,i){const o=ut(t,e),r=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?zn(e,o,r,i,s):Fn(e,o,r,!1,i,s),l=[];
vendor: 11,385 bytes, line 175
175return a.length?(e.getSortedVisibleDatasetMetas().forEach((e=>{const t=a[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})})),l):[]},dataset(e,t,n,i){const o=ut(t,e),r=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?zn(e,o,r,i,s):Fn(e,o,r,!1,i,s);if(a.length>0){const t=a[0].datasetIndex,n=e.getDatasetMeta(t).data;a=[];for(let e=0;e<n.length;++e)a.push({element:n[e],datasetIndex:t,index:e})}return a},point:(e,t,n,i)=>zn(e,ut(t,e),n.axis||"xy",i,n.includeInvisible||!1),nearest(e,t,n,i){const o=ut(t,e),r=n.axis||"xy",s=n.includeInvisible||!1;return Fn(e,o,r,n.intersect,i,s)},x:(e,t,n,i)=>Ln(e,ut(t,e),"x",n.intersect,i),y:(e,t,n,i)=>Ln(e,ut(t,e),"y",n.intersect,i)}};const Bn=["left","top","right","bottom"];function Hn(e,t){return e.filter((e=>e.pos===t))}function Un(e,t){return e.filter((e=>-1===Bn.indexOf(e.pos)&&e.box.axis===t))}function $n(e,t){return e.sort(((e,n)=>{const i=t?n:e,o=t?e:n;return i.weight===o.weight?i.index-o.index:i.weight-o.weight}))}function qn(e,t){const n=function(e){const t={};for(const n of e){const{stack:e,pos:i,stackWeight:o}=n;if(!e||!Bn.includes(i))continue;const r=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}(e),{vBoxMaxWidth:i,hBoxMaxHeight:o}=t;let r,s,a;for(r=0,s=e.length;r<s;++r){a=e[r];const{fullSize:s}=a.box,l=n[a.stack],c=l&&a.stackWeight/l.weight;a.horizontal?(a.width=c?c*i:s&&t.availableWidth,a.height=o):(a.width=i,a.height=c?c*o:s&&t.availableHeight)}return n}function Wn(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Vn(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Kn(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!o(r)){n.size&&(e[r]-=n.size);const t=i[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?s.height:s.width),n.size=t.size/t.count,e[r]+=n.size}s.getPadding&&Vn(a,s.getPadding());const l=Math.max(0,t.outerWidth-Wn(a,e,"left","right")),c=Math.max(0,t.outerHeight-Wn(a,e,"top","bottom")),d=l!==e.w,h=c!==e.h;return e.w=l,e.h=c,n.horizontal?{same:d,other:h}:{same:h,other:d}}function Gn(e,t){const n=t.maxPadding;function i(e){const i={left:0,top:0,right:0,bottom:0};return e.forEach((e=>{i[e]=Math.max(t[e],n[e])})),i}return i(e?["left","right"]:["top","bottom"])}function Xn(e,t,n,i){const o=[];let r,s,a,l,c,d;for(r=0,s=e.length,c=0;r<s;++r){a=e[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Gn(a.horizontal,t));const{same:s,other:h}=Kn(t,n,a,i);c|=s&&o.length,d=d||h,l.fullSize||o.push(a)}return c&&Xn(o,t,n,i)||d}function Yn(e,t,n,i,o){e.top=n,e.left=t,e.right=t+i,e.bottom=n+o,e.width=i,e.height=o}function Qn(e,t,n,i){const o=n.padding;let{x:r,y:s}=t;for(const a of e){const e=a.box,l=i[a.stack]||{count:1,placed:0,weight:1},c=a.stackWeight/l.weight||1;if(a.horizontal){const i=t.w*c,r=l.size||e.height;k(l.start)&&(s=l.start),e.fullSize?Yn(e,o.left,s,n.outerWidth-o.right-o.left,r):Yn(e,t.left+l.placed,s,i,r),l.start=s,l.placed+=i,s=e.bottom}else{const i=t.h*c,s=l.size||e.width;k(l.start)&&(r=l.start),e.fullSize?Yn(e,r,o.top,s,n.outerHeight-o.bottom-o.top):Yn(e,r,t.top+l.placed,s,i),l.start=r,l.placed+=i,r=e.right}}t.x=r,t.y=s}ot.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Jn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const o=gn(e.options.layout.padding),r=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=function(e){const t=function(e){const t=[];let n,i,o,r,s,a;for(n=0,i=(e||[]).length;n<i;++n)o=e[n],({position:r,options:{stack:s,stackWeight:a=1}}=o),t.push({index:n,box:o,pos:r,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&r+s,stackWeight:a});return t}(e),n=$n(t.filter((e=>e.box.fullSize)),!0),i=$n(Hn(t,"left"),!0),o=$n(Hn(t,"right")),r=$n(Hn(t,"top"),!0),s=$n(Hn(t,"bottom")),a=Un(t,"x"),l=Un(t,"y");return{fullSize:n,leftAndTop:i.concat(r),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Hn(t,"chartArea"),vertical:i.concat(o).concat(l),horizontal:r.concat(s).concat(a)}}(e.boxes),l=a.vertical,c=a.horizontal;h(e.boxes,(e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()}));const d=l.reduce(((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1),0)||1,u=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:r,availableHeight:s,vBoxMaxWidth:r/2/d,hBoxMaxHeight:s/2}),p=Object.assign({},o);Vn(p,gn(i));const f=Object.assign({maxPadding:p,w:r,h:s,x:o.left,y:o.top},o),m=qn(l.concat(c),u);Xn(a.fullSize,f,u,m),Xn(l,f,u,m),Xn(c,f,u,m)&&Xn(l,f,u,m),function(e){const t=e.maxPadding;function n(n){const i=Math.max(t[n]-e[n],0);return e[n]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(f),Qn(a.leftAndTop,f,u,m),f.x+=f.w,f.y+=f.h,Qn(a.rightAndBottom,f,u,m),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},h(a.chartArea,(t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Zn{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,i){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,i?Math.floor(t/i):n)}}isAttached(e){return!0}updateConfig(e){}}class ei extends Zn{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ti={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ni=e=>null===e||""===e;const ii=!!gt&&{passive:!0};function oi(e,t,n){e.canvas.removeEventListener(t,n,ii)}function ri(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function si(e,t,n){const i=e.canvas,o=new MutationObserver((e=>{let t=!1;for(const n of e)t=t||ri(n.addedNodes,i),t=t&&!ri(n.removedNodes,i);t&&n()}));return o.observe(document,{childList:!0,subtree:!0}),o}function ai(e,t,n){const i=e.canvas,o=new MutationObserver((e=>{let t=!1;for(const n of e)t=t||ri(n.removedNodes,i),t=t&&!ri(n.addedNodes,i);t&&n()}));return o.observe(document,{childList:!0,subtree:!0}),o}const li=new Map;let ci=0;function di(){const e=window.devicePixelRatio;e!==ci&&(ci=e,li.forEach(((t,n)=>{n.currentDevicePixelRatio!==e&&t()})))}function hi(e,t,n){const i=e.canvas,o=i&&st(i);if(!o)return;const r=ce(((e,t)=>{const i=o.clientWidth;n(e,t),i<o.clientWidth&&n()}),window),s=new ResizeObserver((e=>{const t=e[0],n=t.contentRect.width,i=t.contentRect.height;0===n&&0===i||r(n,i)}));return s.observe(o),function(e,t){li.size||window.addEventListener("resize",di),li.set(e,t)}(e,r),s}function ui(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){li.delete(e),li.size||window.removeEventListener("resize",di)}(e)}function pi(e,t,n){const i=e.canvas,o=ce((t=>{null!==e.ctx&&n(function(e,t){const n=ti[e.type]||e.type,{x:i,y:o}=ut(e,t);return{type:n,chart:t,native:e,x:void 0!==i?i:null,y:void 0!==o?o:null}}(t,e))}),e,(e=>{const t=e[0];return[t,t.offsetX,t.offsetY]}));return function(e,t,n){e.addEventListener(t,n,ii)}(i,t,o),o}class fi extends Zn{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function(e,t){const n=e.style,i=e.getAttribute("height"),o=e.getAttribute("width");if(e.$chartjs={initial:{height:i,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ni(o)){const t=vt(e,"width");void 0!==t&&(e.width=t)}if(ni(i))if(""===e.style.height)e.height=e.width/(t||2);else{const t=vt(e,"height");void 0!==t&&(e.height=t)}}(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t.$chartjs)return!1;const i=t.$chartjs.initial;["height","width"].forEach((e=>{const o=i[e];n(o)?t.removeAttribute(e):t.setAttribute(e,o)}));const o=i.style||{};return Object.keys(o).forEach((e=>{t.style[e]=o[e]})),t.width=t.width,delete t.$chartjs,!0}addEventListener(e,t,n){this.removeEventListener(e,t);const i=e.$proxies||(e.$proxies={}),o={attach:si,detach:ai,resize:hi}[t]||pi;i[t]=o(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),i=n[t];if(!i)return;({attach:ui,detach:ui,resize:ui}[t]||oi)(e,t,i),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,i){return ft(e,t,n,i)}isAttached(e){const t=st(e);return!(!t||!t.isConnected)}}function mi(e){return!rt()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?ei:fi}var gi=Object.freeze({__proto__:null,_detectPlatform:mi,BasePlatform:Zn,BasicPlatform:ei,DomPlatform:fi});const vi="transparent",bi={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){const i=Je(e||vi),o=i.valid&&Je(t||vi);return o&&o.valid?o.mix(i,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class yi{constructor(e,t,n,i){const o=t[n];i=bn([e.to,i,o,e.from]);const r=bn([e.from,o,i]);this._active=!0,this._fn=e.fn||bi[e.type||typeof r],this._easing=on[e.easing]||on.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const i=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=bn([e.to,t,i,e.from]),this._from=bn([e.from,i,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,i=this._prop,o=this._from,r=this._loop,s=this._to;let a;if(this._active=o!==s&&(r||t<n),!this._active)return this._target[i]=s,void this._notify(!0);t<0?this._target[i]=o:(a=t/n%2,a=r&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[i]=this._fn(o,s,a))}wait(){const e=this._promises||(this._promises=[]);return new Promise(((t,n)=>{e.push({res:t,rej:n})}))}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}}ot.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const xi=Object.keys(ot.animation);ot.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>"onProgress"!==e&&"onComplete"!==e&&"fn"!==e}),ot.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ot.describe("animations",{_fallback:"animation"}),ot.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>0|e}}}});class wi{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!o(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach((n=>{const r=e[n];if(!o(r))return;const s={};for(const e of xi)s[e]=r[e];
vendor: 10,590 bytes, line 175
175(i(r.properties)&&r.properties||[n]).forEach((e=>{e!==n&&t.has(e)||t.set(e,s)}))}))}_animateOptions(e,t){const n=t.options,i=function(e,t){if(!t)return;let n=e.options;if(!n)return void(e.options=t);n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(e,n);if(!i)return[];const o=this._createAnimations(i,n);return n.$shared&&function(e,t){const n=[],i=Object.keys(t);for(let t=0;t<i.length;t++){const o=e[i[t]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}(e.options.$animations,n).then((()=>{e.options=n}),(()=>{})),o}_createAnimations(e,t){const n=this._properties,i=[],o=e.$animations||(e.$animations={}),r=Object.keys(t),s=Date.now();let a;for(a=r.length-1;a>=0;--a){const l=r[a];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(e,t));continue}const c=t[l];let d=o[l];const h=n.get(l);if(d){if(h&&d.active()){d.update(h,c,s);continue}d.cancel()}h&&h.duration?(o[l]=d=new yi(h,e,l,c),i.push(d)):e[l]=c}return i}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(ge.add(this._chart,n),!0):void 0}}function _i(e,t){const n=e&&e.options||{},i=n.reverse,o=void 0===n.min?t:0,r=void 0===n.max?t:0;return{start:i?r:o,end:i?o:r}}function ki(e,t){const n=[],i=e._getSortedDatasetMetas(t);let o,r;for(o=0,r=i.length;o<r;++o)n.push(i[o].index);return n}function Ci(e,t,n,i={}){const o=e.keys,s="single"===i.mode;let a,l,c,d;if(null!==t){for(a=0,l=o.length;a<l;++a){if(c=+o[a],c===n){if(i.all)continue;break}d=e.values[c],r(d)&&(s||0===t||N(t)===N(d))&&(t+=d)}return t}}function Si(e,t){const n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function Ti(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Ei(e,t,n,i){for(const o of t.getMatchingVisibleMetas(i).reverse()){const t=e[o.index];if(n&&t>0||!n&&t<0)return o.index}return null}function Ai(e,t){const{chart:n,_cachedMeta:i}=e,o=n._stacks||(n._stacks={}),{iScale:r,vScale:s,index:a}=i,l=r.axis,c=s.axis,d=function(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}(r,s,i),h=t.length;let u;for(let e=0;e<h;++e){const n=t[e],{[l]:r,[c]:h}=n;u=(n._stacks||(n._stacks={}))[c]=Ti(o,d,r),u[a]=h,u._top=Ei(u,s,!0,i.type),u._bottom=Ei(u,s,!1,i.type)}}function Oi(e,t){const n=e.scales;return Object.keys(n).filter((e=>n[e].axis===t)).shift()}function Di(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[i]||void 0===t[i][n])return;delete t[i][n]}}}const Ii=e=>"reset"===e||"none"===e,Pi=(e,t)=>t?e:Object.assign({},e);class Mi{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Si(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Di(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),i=(e,t,n,i)=>"x"===e?t:"r"===e?i:n,o=t.xAxisID=a(n.xAxisID,Oi(e,"x")),r=t.yAxisID=a(n.yAxisID,Oi(e,"y")),s=t.rAxisID=a(n.rAxisID,Oi(e,"r")),l=t.indexAxis,c=t.iAxisID=i(l,o,r,s),d=t.vAxisID=i(l,r,o,s);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(r),t.rScale=this.getScaleForId(s),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&se(this._data,this),e._stacked&&Di(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(o(t))this._data=function(e){const t=Object.keys(e),n=new Array(t.length);let i,o,r;for(i=0,o=t.length;i<o;++i)r=t[i],n[i]={x:r,y:e[r]};return n}(t);else if(n!==t){if(n){se(n,this);const e=this._cachedMeta;Di(e),e._parsed=[]}t&&Object.isExtensible(t)&&re(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const o=t._stacked;t._stacked=Si(t.vScale,t),t.stack!==n.stack&&(i=!0,Di(t),t.stack=n.stack),this._resyncElements(e),(i||o!==t._stacked)&&Ai(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:r}=this,{iScale:s,_stacked:a}=n,l=s.axis;let c,d,h,u=0===e&&t===r.length||n._sorted,p=e>0&&n._parsed[e-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,h=r;else{h=i(r[e])?this.parseArrayData(n,r,e,t):o(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);const s=()=>null===d[l]||p&&d[l]<p[l];for(c=0;c<t;++c)n._parsed[c+e]=d=h[c],u&&(s()&&(u=!1),p=d);n._sorted=u}a&&Ai(this,h)}parsePrimitiveData(e,t,n,i){const{iScale:o,vScale:r}=e,s=o.axis,a=r.axis,l=o.getLabels(),c=o===r,d=new Array(i);let h,u,p;for(h=0,u=i;h<u;++h)p=h+n,d[h]={[s]:c||o.parse(l[p],p),[a]:r.parse(t[p],p)};return d}parseArrayData(e,t,n,i){const{xScale:o,yScale:r}=e,s=new Array(i);let a,l,c,d;for(a=0,l=i;a<l;++a)c=a+n,d=t[c],s[a]={x:o.parse(d[0],c),y:r.parse(d[1],c)};return s}parseObjectData(e,t,n,i){const{xScale:o,yScale:r}=e,{xAxisKey:s="x",yAxisKey:a="y"}=this._parsing,l=new Array(i);let c,d,h,u;for(c=0,d=i;c<d;++c)h=c+n,u=t[h],l[c]={x:o.parse(x(u,s),h),y:r.parse(x(u,a),h)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const i=this.chart,o=this._cachedMeta,r=t[e.axis];return Ci({keys:ki(i,!0),values:t._stacks[e.axis]},r,o.index,{mode:n})}updateRangeFromParsed(e,t,n,i){const o=n[t.axis];let r=null===o?NaN:o;const s=i&&n._stacks[t.axis];i&&s&&(i.values=s,r=Ci(i,o,this._cachedMeta.index)),e.min=Math.min(e.min,r),e.max=Math.max(e.max,r)}getMinMax(e,t){const n=this._cachedMeta,i=n._parsed,o=n._sorted&&e===n.iScale,s=i.length,a=this._getOtherScale(e),l=((e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:ki(n,!0),values:null})(t,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=function(e){const{min:t,max:n,minDefined:i,maxDefined:o}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}(a);let u,p;function f(){p=i[u];const t=p[a.axis];return!r(p[e.axis])||d>t||h<t}for(u=0;u<s&&(f()||(this.updateRangeFromParsed(c,e,p,l),!o));++u);if(o)for(u=s-1;u>=0;--u)if(!f()){this.updateRangeFromParsed(c,e,p,l);break}return c}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let i,o,s;for(i=0,o=t.length;i<o;++i)s=t[i][e.axis],r(s)&&n.push(s);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,i=t.vScale,o=this.getParsed(e);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,n,i,r;return o(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r,disabled:!1===e}}(a(this.options.clip,function(e,t,n){if(!1===n)return!1;const i=_i(e,n),o=_i(t,n);return{top:o.end,right:i.end,bottom:o.start,left:i.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,i=n.data||[],o=t.chartArea,r=[],s=this._drawStart||0,a=this._drawCount||i.length-s,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,o,s,a),c=s;c<s+a;++c){const t=i[c];t.hidden||(t.active&&l?r.push(t):t.draw(e,o))}for(c=0;c<r.length;++c)r[c].draw(e,o)}getStyle(e,t){const n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const i=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];o=t.$context||(t.$context=function(e,t,n){return xn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),o.parsed=this.getParsed(e),o.raw=i.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=function(e,t){return xn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=n,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const i="active"===t,o=this._cachedDataOpts,r=e+"-"+t,s=o[r],a=this.enableOptionSharing&&k(n);if(s)return Pi(s,a);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),d=i?[`${e}Hover`,"hover",e,""]:[e,""],h=l.getOptionScopes(this.getDataset(),c),u=Object.keys(ot.elements[e]),p=l.resolveNamedOptions(h,u,(()=>this.getContext(n,i)),d);return p.$shared&&(p.$shared=a,o[r]=Object.freeze(Pi(p,a))),p}_resolveAnimations(e,t,n){const i=this.chart,o=this._cachedDataOpts,r=`animation-${t}`,s=o[r];if(s)return s;let a;if(!1!==i.options.animation){const i=this.chart.config,o=i.datasetAnimationScopeKeys(this._type,t),r=i.getOptionScopes(this.getDataset(),o);a=i.createResolver(r,this.getContext(e,n,t))}const l=new wi(i,a&&a.animations);return a&&a._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||Ii(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),i=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(t,o)||o!==i;return this.updateSharedOptions(o,t,n),{sharedOptions:o,includeOptions:r}}updateElement(e,t,n,i){Ii(i)?Object.assign(e,n):this._resolveAnimations(t,i).update(e,n)}updateSharedOptions(e,t,n){e&&!Ii(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,i){e.active=i;const o=this.getStyle(t,i);
vendor: 17,320 bytes, line 175
175this._resolveAnimations(t,n,i).update(e,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,n=this._cachedMeta.data;for(const[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];const i=n.length,o=t.length,r=Math.min(o,i);r&&this.parse(0,r),o>i?this._insertElements(i,o-i,e):o<i&&this._removeElements(o,i-o)}_insertElements(e,t,n=!0){const i=this._cachedMeta,o=i.data,r=e+t;let s;const a=e=>{for(e.length+=t,s=e.length-1;s>=r;s--)e[s]=e[s-t]};for(a(o),s=e;s<r;++s)o[s]=new this.dataElementType;this._parsing&&a(i._parsed),this.parse(e,t),n&&this.updateElements(o,e,t,"reset")}updateElements(e,t,n,i){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(e,t);n._stacked&&Di(n,i)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,i]=e;this[t](n,i)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Mi.defaults={},Mi.prototype.datasetElementType=null,Mi.prototype.dataElementType=null;class Ri{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return j(this.x)&&j(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const i={};return e.forEach((e=>{i[e]=n[e]&&n[e].active()?n[e]._to:this[e]})),i}}Ri.defaults={},Ri.defaultRoutes=void 0;const zi={values:e=>i(e)?e:""+e,numeric(e,t,n){if(0===e)return"0";const i=this.chart.options.locale;let o,r=e;if(n.length>1){const t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>1e15)&&(o="scientific"),r=function(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e));return n}(e,n)}const s=z(Math.abs(r)),a=Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),cn(e,i,l)},logarithmic(e,t,n){if(0===e)return"0";const i=e/Math.pow(10,Math.floor(z(e)));return 1===i||2===i||5===i?zi.numeric.call(this,e,t,n):""}};var Ni={formatters:zi};function Fi(e,t){const i=e.options.ticks,o=i.maxTicksLimit||function(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(i,o))}(e),r=i.major.enabled?function(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}(t):[],s=r.length,a=r[0],l=r[s-1],c=[];if(s>o)return function(e,t,n,i){let o,r=0,s=n[0];for(i=Math.ceil(i),o=0;o<e.length;o++)o===s&&(t.push(e[o]),r++,s=n[r*i])}(t,c,r,s/o),c;const d=function(e,t,n){const i=function(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}(e),o=t.length/n;if(!i)return Math.max(o,1);const r=L(i);for(let e=0,t=r.length-1;e<t;e++){const t=r[e];if(t>o)return t}return Math.max(o,1)}(r,t,o);if(s>0){let e,i;const o=s>1?Math.round((l-a)/(s-1)):null;for(Li(t,c,d,n(o)?0:a-o,a),e=0,i=s-1;e<i;e++)Li(t,c,d,r[e],r[e+1]);return Li(t,c,d,l,n(o)?t.length:l+o),c}return Li(t,c,d),c}function Li(e,t,n,i,o){const r=a(i,0),s=Math.min(a(o,e.length),e.length);let l,c,d,h=0;for(n=Math.ceil(n),o&&(l=o-i,n=l/Math.floor(l/n)),d=r;d<0;)h++,d=Math.round(r+h*n);for(c=Math.max(r,0);c<s;c++)c===d&&(t.push(e[c]),h++,d=Math.round(r+h*n))}ot.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ni.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ot.route("scale.ticks","color","","color"),ot.route("scale.grid","color","","borderColor"),ot.route("scale.grid","borderColor","","borderColor"),ot.route("scale.title","color","","color"),ot.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&"callback"!==e&&"parser"!==e,_indexable:e=>"borderDash"!==e&&"tickBorderDash"!==e}),ot.describe("scales",{_fallback:"scale"}),ot.describe("scale.ticks",{_scriptable:e=>"backdropPadding"!==e&&"callback"!==e,_indexable:e=>"backdropPadding"!==e});const ji=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n;function Bi(e,t){const n=[],i=e.length/t,o=e.length;let r=0;for(;r<o;r+=i)n.push(e[Math.floor(r)]);return n}function Hi(e,t,n){const i=e.ticks.length,o=Math.min(t,i-1),r=e._startPixel,s=e._endPixel,a=1e-6;let l,c=e.getPixelForTick(o);if(!(n&&(l=1===i?Math.max(c-r,s-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(o-1))/2,c+=o<t?l:-l,c<r-a||c>s+a)))return c}function Ui(e){return e.drawTicks?e.tickLength:0}function $i(e,t){if(!e.display)return 0;const n=vn(e.font,t),o=gn(e.padding);return(i(e.text)?e.text.length:1)*n.lineHeight+o.height}function qi(e,t,n){let i=he(e);return(n&&"right"!==t||!n&&"right"===t)&&(i=(e=>"left"===e?"right":"right"===e?"left":e)(i)),i}class Wi extends Ri{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:i}=this;return e=s(e,Number.POSITIVE_INFINITY),t=s(t,Number.NEGATIVE_INFINITY),n=s(n,Number.POSITIVE_INFINITY),i=s(i,Number.NEGATIVE_INFINITY),{min:s(e,n),max:s(t,i),minDefined:r(e),maxDefined:r(t)}}getMinMax(e){let t,{min:n,max:i,minDefined:o,maxDefined:r}=this.getUserBounds();if(o&&r)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)t=a[s].controller.getMinMax(this,e),o||(n=Math.min(n,t.min)),r||(i=Math.max(i,t.max));return n=r&&n>i?i:n,i=o&&n>i?n:i,{min:s(n,s(i,n)),max:s(i,s(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){d(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:i,grace:o,ticks:r}=this.options,s=r.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=yn(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=s<this.ticks.length;this._convertTicksToLabels(a?Bi(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=Fi(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){d(this.options.afterUpdate,[this])}beforeSetDimensions(){d(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){d(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),d(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){d(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,i,o;for(n=0,i=e.length;n<i;n++)o=e[n],o.label=d(t.callback,[o.value,n,e],this)}afterTickToLabelConversion(){d(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){d(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=this.ticks.length,i=t.minRotation||0,o=t.maxRotation;let r,s,a,l=i;if(!this._isVisible()||!t.display||i>=o||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const c=this._getLabelSizes(),d=c.widest.width,h=c.highest.height,u=Q(this.chart.width-d,0,this.maxWidth);r=e.offset?this.maxWidth/n:u/(n-1),d+6>r&&(r=u/(n-(e.offset?.5:1)),s=this.maxHeight-Ui(e.grid)-t.padding-$i(e.title,this.chart.options.font),a=Math.sqrt(d*d+h*h),l=q(Math.min(Math.asin(Q((c.highest.height+6)/r,-1,1)),Math.asin(Q(s/a,-1,1))-Math.asin(Q(h/a,-1,1)))),l=Math.max(i,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){d(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){d(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:i,grid:o}}=this,r=this._isVisible(),s=this.isHorizontal();if(r){const r=$i(i,t.options.font);if(s?(e.width=this.maxWidth,e.height=Ui(o)+r):(e.height=this.maxHeight,e.width=Ui(o)+r),n.display&&this.ticks.length){const{first:t,last:i,widest:o,highest:r}=this._getLabelSizes(),a=2*n.padding,l=$(this.labelRotation),c=Math.cos(l),d=Math.sin(l);if(s){const t=n.mirror?0:d*o.width+c*r.height;e.height=Math.min(this.maxHeight,e.height+t+a)}else{const t=n.mirror?0:c*o.width+d*r.height;e.width=Math.min(this.maxWidth,e.width+t+a)}this._calculatePadding(t,i,d,c)}}this._handleMargins(),s?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,i){const{ticks:{align:o,padding:r},position:s}=this.options,a=0!==this.labelRotation,l="top"!==s&&"x"===this.axis;if(this.isHorizontal()){const s=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?l?(d=i*e.width,h=n*t.height):(d=n*e.height,h=i*t.width):"start"===o?h=t.width:"end"===o?d=e.width:"inner"!==o&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-s+r)*this.width/(this.width-s),0),this.paddingRight=Math.max((h-c+r)*this.width/(this.width-c),0)}else{let n=t.height/2,i=e.height/2;"start"===o?(n=0,i=e.height):"end"===o&&(n=t.height,i=0),this.paddingTop=n+r,this.paddingBottom=i+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){d(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,i=e.length;t<i;t++)n(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=Bi(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length)}return e}_computeLabelSizes(e,t){const{ctx:o,_longestTextCache:r}=this,s=[],a=[];let l,c,d,u,p,f,m,g,v,b,y,x=0,w=0;for(l=0;l<t;++l){if(u=e[l].label,p=this._resolveTickFontOptions(l),o.font=f=p.string,m=r[f]=r[f]||{data:{},gc:[]},g=p.lineHeight,v=b=0,n(u)||i(u)){if(i(u))for(c=0,d=u.length;c<d;++c)y=u[c],n(y)||i(y)||(v=yt(o,m.data,m.gc,v,y),b+=g)}else v=yt(o,m.data,m.gc,v,u),b=g;s.push(v),a.push(b),x=Math.max(v,x),w=Math.max(b,w)}!function(e,t){h(e,(e=>{const n=e.gc,i=n.length/2;let o;if(i>t){for(o=0;o<i;++o)delete e.data[n[o]];n.splice(0,i)}}))}(r,t);const _=s.indexOf(x),k=a.indexOf(w),C=e=>({width:s[e]||0,height:a[e]||0});return{first:C(0),last:C(t-1),widest:C(_),highest:C(k),widths:s,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return J(this._alignToPixels?wt(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=function(e,t,n){return xn(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=xn(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const e=this.options.ticks,t=$(this.labelRotation),n=Math.abs(Math.cos(t)),i=Math.abs(Math.sin(t)),o=this._getLabelSizes(),r=e.autoSkipPadding||0,s=o?o.widest.width+r:0,a=o?o.highest.height+r:0;return this.isHorizontal()?a*n>s*i?s/n:a/i:a*i<s*n?a/n:s/i}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,i=this.options,{grid:r,position:s}=i,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=Ui(r),u=[],p=r.setContext(this.getContext()),f=p.drawBorder?p.borderWidth:0,m=f/2,g=function(e){return wt(n,e,f)};let v,b,y,x,w,_,k,C,S,T,E,A;if("top"===s)v=g(this.bottom),_=this.bottom-h,C=v-m,T=g(e.top)+m,A=e.bottom;else if("bottom"===s)v=g(this.top),T=e.top,A=g(e.bottom)-m,_=v+m,C=this.top+h;else if("left"===s)v=g(this.right),w=this.right-h,k=v-m,S=g(e.left)+m,E=e.right;else if("right"===s)v=g(this.left),S=e.left,E=g(e.right)-m,w=v+m,k=this.left+h;else if("x"===t){if("center"===s)v=g((e.top+e.bottom)/2+.5);else if(o(s)){const e=Object.keys(s)[0],t=s[e];v=g(this.chart.scales[e].getPixelForValue(t))}T=e.top,A=e.bottom,_=v+m,C=_+h}else if("y"===t){if("center"===s)v=g((e.left+e.right)/2);else if(o(s)){const e=Object.keys(s)[0],t=s[e];v=g(this.chart.scales[e].getPixelForValue(t))}w=v-m,k=w-h,S=e.left,E=e.right}const O=a(i.ticks.maxTicksLimit,d),D=Math.max(1,Math.ceil(d/O));for(b=0;b<d;b+=D){const e=r.setContext(this.getContext(b)),t=e.lineWidth,i=e.color,o=e.borderDash||[],s=e.borderDashOffset,a=e.tickWidth,d=e.tickColor,h=e.tickBorderDash||[],p=e.tickBorderDashOffset;y=Hi(this,b,l),void 0!==y&&(x=wt(n,y,t),c?w=k=S=E=x:_=C=T=A=x,u.push({tx1:w,ty1:_,tx2:k,ty2:C,x1:S,y1:T,x2:E,y2:A,width:t,color:i,borderDash:o,borderDashOffset:s,tickWidth:a,tickColor:d,tickBorderDash:h,tickBorderDashOffset:p}))}return this._ticksLength=d,this._borderValue=v,u}_computeLabelItems(e){const t=this.axis,n=this.options,{position:r,ticks:s}=n,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:h,mirror:u}
vendor: 2,863 bytes, line 175
175=s,p=Ui(n.grid),f=p+h,m=u?-h:f,g=-$(this.labelRotation),v=[];let b,y,x,w,_,k,C,S,T,E,A,O,D="middle";if("top"===r)k=this.bottom-m,C=this._getXAxisLabelAlignment();else if("bottom"===r)k=this.top+m,C=this._getXAxisLabelAlignment();else if("left"===r){const e=this._getYAxisLabelAlignment(p);C=e.textAlign,_=e.x}else if("right"===r){const e=this._getYAxisLabelAlignment(p);C=e.textAlign,_=e.x}else if("x"===t){if("center"===r)k=(e.top+e.bottom)/2+f;else if(o(r)){const e=Object.keys(r)[0],t=r[e];k=this.chart.scales[e].getPixelForValue(t)+f}C=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===r)_=(e.left+e.right)/2-f;else if(o(r)){const e=Object.keys(r)[0],t=r[e];_=this.chart.scales[e].getPixelForValue(t)}C=this._getYAxisLabelAlignment(p).textAlign}"y"===t&&("start"===c?D="top":"end"===c&&(D="bottom"));const I=this._getLabelSizes();for(b=0,y=l.length;b<y;++b){x=l[b],w=x.label;const e=s.setContext(this.getContext(b));S=this.getPixelForTick(b)+s.labelOffset,T=this._resolveTickFontOptions(b),E=T.lineHeight,A=i(w)?w.length:1;const t=A/2,n=e.color,o=e.textStrokeColor,c=e.textStrokeWidth;let h,p=C;if(a?(_=S,"inner"===C&&(p=b===y-1?this.options.reverse?"left":"right":0===b?this.options.reverse?"right":"left":"center"),O="top"===r?"near"===d||0!==g?-A*E+E/2:"center"===d?-I.highest.height/2-t*E+E:-I.highest.height+E/2:"near"===d||0!==g?E/2:"center"===d?I.highest.height/2-t*E:I.highest.height-A*E,u&&(O*=-1)):(k=S,O=(1-A)*E/2),e.showLabelBackdrop){const t=gn(e.backdropPadding),n=I.heights[b],i=I.widths[b];let o=k+O-t.top,r=_-t.left;switch(D){case"middle":o-=n/2;break;case"bottom":o-=n}switch(C){case"center":r-=i/2;break;case"right":r-=i}h={left:r,top:o,width:i+t.width,height:n+t.height,color:e.backdropColor}}v.push({rotation:g,label:w,font:T,color:n,strokeColor:o,strokeWidth:c,textOffset:O,textAlign:p,textBaseline:D,translation:[_,k],backdrop:h})}return v}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-$(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:i,padding:o}}=this.options,r=e+o,s=this._getLabelSizes().widest.width;let a,l;return"left"===t?i?(l=this.right+o,"near"===n?a="left":"center"===n?(a="center",l+=s/2):(a="right",l+=s)):(l=this.right-r,"near"===n?a="right":"center"===n?(a="center",l-=s/2):(a="left",l=this.left)):"right"===t?i?(l=this.left+o,"near"===n?a="right":"center"===n?(a="center",l-=s/2):(a="left",l-=s)):(l=this.left+r,"near"===n?a="left":"center"===n?(a="center",l+=s/2):(a="right",l=this.right)):a="right",{textAlign:a,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}
vendor: 5,514 bytes, line 175
175:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:i,width:o,height:r}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,i,o,r),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex((t=>t.value===e));if(n>=0){return t.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(e){const t=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,r;const s=(e,t,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(o=0,r=i.length;o<r;++o){const e=i[o];t.drawOnChartArea&&s({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&s({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{grid:n}}=this,i=n.setContext(this.getContext()),o=n.drawBorder?i.borderWidth:0;if(!o)return;const r=n.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let a,l,c,d;this.isHorizontal()?(a=wt(e,this.left,o)-o/2,l=wt(e,this.right,r)+r/2,c=d=s):(c=wt(e,this.top,o)-o/2,d=wt(e,this.bottom,r)+r/2,a=l=s),t.save(),t.lineWidth=i.borderWidth,t.strokeStyle=i.borderColor,t.beginPath(),t.moveTo(a,c),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,n=this._computeLabelArea();n&&Tt(t,n);const i=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,r;for(o=0,r=i.length;o<r;++o){const e=i[o],n=e.font,r=e.label;e.backdrop&&(t.fillStyle=e.backdrop.color,t.fillRect(e.backdrop.left,e.backdrop.top,e.backdrop.width,e.backdrop.height)),Dt(t,r,0,e.textOffset,n,e)}n&&Et(t)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;const s=vn(n.font),a=gn(n.padding),l=n.align;let c=s.lineHeight/2;"bottom"===t||"center"===t||o(t)?(c+=a.bottom,i(n.text)&&(c+=s.lineHeight*(n.text.length-1))):c+=a.top;const{titleX:d,titleY:h,maxWidth:u,rotation:p}=function(e,t,n,i){const{top:r,left:s,bottom:a,right:l,chart:c}=e,{chartArea:d,scales:h}=c;let u,p,f,m=0;const g=a-r,v=l-s;if(e.isHorizontal()){if(p=ue(i,s,l),o(n)){const e=Object.keys(n)[0],i=n[e];f=h[e].getPixelForValue(i)+g-t}else f="center"===n?(d.bottom+d.top)/2+g-t:ji(e,n,t);u=l-s}else{if(o(n)){const e=Object.keys(n)[0],i=n[e];p=h[e].getPixelForValue(i)-v+t}else p="center"===n?(d.left+d.right)/2-v+t:ji(e,n,t);f=ue(i,a,r),m="left"===n?-P:P}return{titleX:p,titleY:f,maxWidth:u,rotation:m}}(this,c,t,l);Dt(e,n.text,0,0,s,{color:n.color,maxWidth:u,rotation:p,textAlign:qi(l,t,r),textBaseline:"middle",translation:[d,h]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=a(e.grid&&e.grid.z,-1);return this._isVisible()&&this.draw===Wi.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let o,r;for(o=0,r=t.length;o<r;++o){const r=t[o];r[n]!==this.id||e&&r.type!==e||i.push(r)}return i}_resolveTickFontOptions(e){return vn(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Vi{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;(function(e){return"id"in e&&"defaults"in e})(t)&&(n=this.register(t));const i=this.items,o=e.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in i||(i[o]=e,function(e,t,n){const i=g(Object.create(null),[n?ot.get(n):{},ot.get(t),e.defaults]);ot.set(t,i),e.defaultRoutes&&function(e,t){Object.keys(t).forEach((n=>{const i=n.split("."),o=i.pop(),r=[e].concat(i).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");ot.route(r,o,l,a)}))}(t,e.defaultRoutes);e.descriptors&&ot.describe(t,e.descriptors)}(e,r,n),this.override&&ot.override(e.id,e.overrides)),r}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,i=this.scope;n in t&&delete t[n],i&&n in ot[i]&&(delete ot[i][n],this.override&&delete et[n])}}var Ki=new class{constructor(){this.controllers=new Vi(Mi,"datasets",!0),this.elements=new Vi(Ri,"elements"),this.plugins=new Vi(Object,"plugins"),this.scales=new Vi(Wi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}
vendor: 2,939 bytes, line 175
175removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach((t=>{const i=n||this._getRegistryForType(t);n||i.isForType(t)||i===this.plugins&&t.id?this._exec(e,i,t):h(t,(t=>{const i=n||this._getRegistryForType(t);this._exec(e,i,t)}))}))}_exec(e,t,n){const i=_(e);d(n["before"+i],[],n),t[e](n),d(n["after"+i],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const i=t.get(e);if(void 0===i)throw new Error('"'+e+'" is not a registered '+n+".");return i}};class Gi{constructor(){this._init=[]}notify(e,t,n,i){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=i?this._descriptors(e).filter(i):this._descriptors(e),r=this._notify(o,e,t,n);return"afterDestroy"===t&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),r}_notify(e,t,n,i){i=i||{};for(const o of e){const e=o.plugin;if(!1===d(e[n],[t,i,o.options],e)&&i.cancelable)return!1}return!0}invalidate(){n(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,i=a(n.options&&n.options.plugins,{}),o=function(e){const t={},n=[],i=Object.keys(Ki.plugins.items);for(let e=0;e<i.length;e++)n.push(Ki.getPlugin(i[e]));const o=e.plugins||[];for(let e=0;e<o.length;e++){const i=o[e];-1===n.indexOf(i)&&(n.push(i),t[i.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==i||t?function(e,{plugins:t,localIds:n},i,o){const r=[],s=e.getContext();for(const a of t){const t=a.id,l=Xi(i[t],o);null!==l&&r.push({plugin:a,options:Yi(e.config,{plugin:a,local:n[t]},l,s)})}return r}(e,o,i,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,i=(e,t)=>e.filter((e=>!t.some((t=>e.plugin.id===t.plugin.id))));this._notify(i(t,n),e,"stop"),this._notify(i(n,t),e,"start")}}function Xi(e,t){return t||!1!==e?!0===e?{}:e:null}function Yi(e,{plugin:t,local:n},i,o){const r=e.pluginScopeKeys(t),s=e.getOptionScopes(i,r);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Qi(e,t){const n=ot.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Ji(e,t){return"x"===e||"y"===e?e:t.axis||("top"===(n=t.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||e.charAt(0).toLowerCase();var n}function Zi(e){const t=e.options||(e.options={});t.plugins=a(t.plugins,{}),t.scales=function(e,t){const n=et[e.type]||{scales:{}},i=t.scales||{},r=Qi(e.type,t),s=Object.create(null),a=Object.create(null);
vendor: 4,362 bytes, line 175
175return Object.keys(i).forEach((e=>{const t=i[e];if(!o(t))return console.error(`Invalid scale configuration for scale: ${e}`);if(t._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const l=Ji(e,t),c=function(e,t){return e===t?"_index_":"_value_"}(l,r),d=n.scales||{};s[l]=s[l]||e,a[e]=v(Object.create(null),[{axis:l},t,d[l],d[c]])})),e.data.datasets.forEach((n=>{const o=n.type||e.type,r=n.indexAxis||Qi(o,t),l=(et[o]||{}).scales||{};Object.keys(l).forEach((e=>{const t=function(e,t){let n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}(e,r),o=n[t+"AxisID"]||s[t]||t;a[o]=a[o]||Object.create(null),v(a[o],[{axis:t},i[o],l[e]])}))})),Object.keys(a).forEach((e=>{const t=a[e];v(t,[ot.scales[t.type],ot.scale])})),a}(e,t)}function eo(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const to=new Map,no=new Set;function io(e,t){let n=to.get(e);return n||(n=t(),to.set(e,n),no.add(n)),n}const oo=(e,t,n)=>{const i=x(t,n);void 0!==i&&e.add(i)};class ro{constructor(e){this._config=function(e){return(e=e||{}).data=eo(e.data),Zi(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=eo(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Zi(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return io(e,(()=>[[`datasets.${e}`,""]]))}datasetAnimationScopeKeys(e,t){return io(`${e}.transition.${t}`,(()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]]))}datasetElementScopeKeys(e,t){return io(`${e}-${t}`,(()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]]))}pluginScopeKeys(e){const t=e.id;return io(`${this.type}-plugin-${t}`,(()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]]))}_cachedScopes(e,t){const n=this._scopeCache;let i=n.get(e);return i&&!t||(i=new Map,n.set(e,i)),i}getOptionScopes(e,t,n){const{options:i,type:o}=this,r=this._cachedScopes(e,n),s=r.get(t);if(s)return s;const a=new Set;t.forEach((t=>{e&&(a.add(e),t.forEach((t=>oo(a,e,t)))),t.forEach((e=>oo(a,i,e))),t.forEach((e=>oo(a,et[o]||{},e))),t.forEach((e=>oo(a,ot,e))),t.forEach((e=>oo(a,tt,e)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),no.has(t)&&r.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,et[t]||{},ot.datasets[t]||{},{type:t},ot,tt]}resolveNamedOptions(e,t,n,o=[""]){const r={$shared:!0},{resolver:s,subPrefixes:a}=so(this._resolverCache,e,o);let l=s;if(function(e,t){const{isScriptable:n,isIndexable:o}=zt(e);for(const r of t){const t=n(r),s=o(r),a=(s||t)&&e[r];if(t&&(C(a)||ao(a))||s&&i(a))return!0}return!1}(s,t)){r.$shared=!1;l=Rt(s,n=C(n)?n():n,this.createResolver(e,n,a))}for(const e of t)r[e]=l[e];return r}createResolver(e,t,n=[""],i){const{resolver:r}=so(this._resolverCache,e,n);return o(t)?Rt(r,t,void 0,i):r}}function so(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const o=n.join();let r=i.get(o);if(!r){r={resolver:Mt(t,n),subPrefixes:n.filter((e=>!e.toLowerCase().includes("hover")))},i.set(o,r)}return r}const ao=e=>o(e)&&Object.getOwnPropertyNames(e).reduce(((t,n)=>t||C(e[n])),!1);const lo=["top","bottom","left","right","chartArea"];function co(e,t){return"top"===e||"bottom"===e||-1===lo.indexOf(e)&&"x"===t}function ho(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function uo(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),d(n&&n.onComplete,[e],t)}function po(e){const t=e.chart,n=t.options.animation;d(n&&n.onProgress,[e],t)}function fo(e){return rt()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const mo={},go=e=>{const t=fo(e);return Object.values(mo).filter((e=>e.canvas===t)).pop()};function vo(e,t,n){const i=Object.keys(e);for(const o of i){const i=+o;if(i>=t){const r=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=r)}}}class bo{constructor(e,n){const i=this.config=new ro(n),o=fo(e),r=go(o);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");
vendor: 4,231 bytes, line 175
175const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||mi(o)),this.platform.updateConfig(i);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;this.id=t(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Gi,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=de((e=>this.update(e)),s.resizeDelay||0),this._dataChanges=[],mo[this.id]=this,a&&l?(ge.listen(this,"complete",uo),ge.listen(this,"progress",po),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:o,_aspectRatio:r}=this;return n(e)?t&&r?r:o?i/o:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():mt(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return _t(this.canvas,this.ctx),this}stop(){return ge.stop(this),this}resize(e,t){ge.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,i=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(i,e,t,o),s=n.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,mt(this,s,!0)&&(this.notifyPlugins("resize",{size:r}),d(n.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){h(this.options.scales||{},((e,t)=>{e.id=t}))}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,i=Object.keys(n).reduce(((e,t)=>(e[t]=!1,e)),{});let o=[];t&&(o=o.concat(Object.keys(t).map((e=>{const n=t[e],i=Ji(e,n),o="r"===i,r="x"===i;return{options:n,dposition:o?"chartArea":r?"bottom":"left",dtype:o?"radialLinear":r?"category":"linear"}})))),h(o,(t=>{const o=t.options,r=o.id,s=Ji(r,o),l=a(o.type,t.dtype);void 0!==o.position&&co(o.position,s)===co(t.dposition)||(o.position=t.dposition),i[r]=!0;let c=null;if(r in n&&n[r].type===l)c=n[r];else{c=new(Ki.getScale(l))({id:r,type:l,ctx:this.ctx,chart:this}),n[c.id]=c}c.init(o,e)})),h(i,((e,t)=>{e||delete n[t]})),h(n,(e=>{Jn.configure(this,e,e.options),Jn.addBox(this,e)}))}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort(((e,t)=>e.index-t.index)),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(ho("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach(((e,n)=>{0===t.filter((t=>t===e._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=t.length;n<i;n++){const i=t[n];let o=this.getDatasetMeta(n);const r=i.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=r,o.indexAxis=i.indexAxis||Qi(r,this.options),o.order=i.order||0,o.index=n,o.label=""+i.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const t=Ki.getController(r),{datasetElementType:i,dataElementType:s}=ot.datasets[r];Object.assign(t.prototype,{dataElementType:Ki.getElement(s),datasetElementType:i&&Ki.getElement(i)}),o.controller=new t(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){h(this.data.datasets,((e,t)=>{this.getDatasetMeta(t).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;
vendor: 4,376 bytes, line 175
175t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let e=0,t=this.data.datasets.length;e<t;e++){const{controller:t}=this.getDatasetMeta(e),n=!i&&-1===o.indexOf(t);t.buildOrUpdateElements(n),r=Math.max(+t.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),i||h(o,(e=>{e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(ho("z","_idx"));const{_active:s,_lastEvent:a}=this;a?this._eventHandler(a,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){h(this.scales,(e=>{Jn.removeBox(this,e)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);S(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:o}of t){vo(e,i,"_removeElements"===n?-o:o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=t=>new Set(e.filter((e=>e[0]===t)).map(((e,t)=>t+","+e.splice(1).join(",")))),i=n(0);for(let e=1;e<t;e++)if(!S(i,n(e)))return;return Array.from(i).map((e=>e.split(","))).map((e=>({method:e[1],start:+e[2],count:+e[3]})))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Jn.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],h(this.boxes,(e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))}),this),this._layers.forEach(((e,t)=>{e._idx=t})),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,C(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),i={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",i)&&(n.controller._update(t),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(ge.has(this)?this.attached&&!ge.running(this)&&ge.start(this):(this.draw(),uo({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resize(e,t),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let i,o;for(i=0,o=t.length;i<o;++i){const o=t[i];e&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,i=!n.disabled,o=this.chartArea,r={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(i&&Tt(t,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?this.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?this.height:o.bottom+n.bottom}),e.controller.draw(),i&&Et(t),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return St(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,i){const o=jn.modes[t];return"function"==typeof o?o(this,e,n,i):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let i=n.filter((e=>e&&e._dataset===t)).pop();
vendor: 6,168 bytes, line 175
175return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=xn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const i=n?"show":"hide",o=this.getDatasetMeta(e),r=o.controller._resolveAnimations(void 0,i);k(t)?(o.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),r.update(o,{visible:n}),this.update((t=>t.datasetIndex===e?i:void 0)))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ge.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),_t(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete mo[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,n=(n,i)=>{t.addEventListener(this,n,i),e[n]=i},i=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};h(this.options.events,(e=>n(e,i)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(n,i)=>{t.addEventListener(this,n,i),e[n]=i},i=(n,i)=>{e[n]&&(t.removeEventListener(this,n,i),delete e[n])},o=(e,t)=>{this.canvas&&this.resize(e,t)};let r;const s=()=>{i("attach",s),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),n("attach",s)},t.isAttached(this.canvas)?s():r()}unbindEvents(){h(this._listeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._listeners={},h(this._responsiveListeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const i=n?"set":"remove";let o,r,s,a;for("dataset"===t&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),s=0,a=e.length;s<a;++s){r=e[s];const t=r&&this.getDatasetMeta(r.datasetIndex).controller;t&&t[i+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map((({datasetIndex:e,index:t})=>{const n=this.getDatasetMeta(e);if(!n)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[t],index:t}}));!u(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}_updateHoverStyles(e,t,n){const i=this.options.hover,o=(e,t)=>e.filter((e=>!t.some((t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)))),r=o(t,e),s=n?e:o(e,t);r.length&&this.updateHoverStyle(r,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},i=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const o=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(o||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:i=[],options:o}=this,r=t,s=this._getActiveElements(e,i,n,r),a=T(e),l=function(e,t,n,i){return n&&"mouseout"!==e.type?i?t:e:null}(e,this._lastEvent,n,a);n&&(this._lastEvent=null,d(o.onHover,[e,s,this],this),a&&d(o.onClick,[e,s,this],this));const c=!u(s,i);return(c||t)&&(this._active=s,this._updateHoverStyles(s,i,t)),this._lastEvent=l,c}_getActiveElements(e,t,n,i){if("mouseout"===e.type)return[];if(!n)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,i)}}const yo=()=>h(bo.instances,(e=>e._plugins.invalidate())),xo=!0;function wo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(bo,{defaults:{enumerable:xo,value:ot},instances:{enumerable:xo,value:mo},overrides:{enumerable:xo,value:et},registry:{enumerable:xo,value:Ki},version:{enumerable:xo,value:"3.9.1"},getChart:{enumerable:xo,value:go},register:{enumerable:xo,value:(...e)=>{Ki.add(...e),yo()}},unregister:{enumerable:xo,value:(...e)=>{Ki.remove(...e),yo()}}});class _o{constructor(e){this.options=e||{}}init(e){}formats(){return wo()}parse(e,t){return wo()}format(e,t){return wo()}add(e,t,n){return wo()}diff(e,t,n){return wo()}startOf(e,t,n){return wo()}endOf(e,t){return wo()}}_o.override=function(e){Object.assign(_o.prototype,e)};var ko={_date:_o};function Co(e){const t=e.iScale,n=function(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let t=0,o=n.length;t<o;t++)i=i.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=ae(i.sort(((e,t)=>e-t)))}return e._cache.$bar}(t,e.type);let i,o,r,s,a=t._length;const l=()=>{32767!==r&&-32768!==r&&(k(s)&&(a=Math.min(a,Math.abs(r-s)||a)),s=r)};for(i=0,o=n.length;i<o;++i)r=t.getPixelForValue(n[i]),l();for(s=void 0,i=0,o=t.ticks.length;i<o;++i)r=t.getPixelForTick(i),l();return a}function So(e,t,n,o){return i(e)?function(e,t,n,i){const o=n.parse(e[0],i),r=n.parse(e[1],i),s=Math.min(o,r),a=Math.max(o,r);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:r,min:s,max:a}}(e,t,n,o):t[n.axis]=n.parse(e,o),t}function To(e,t,n,i){const o=e.iScale,r=e.vScale,s=o.getLabels(),a=o===r,l=[];let c,d,h,u;
vendor: 8,303 bytes, line 175
175for(c=n,d=n+i;c<d;++c)u=t[c],h={},h[o.axis]=a||o.parse(s[c],c),l.push(So(u,h,r,c));return l}function Eo(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function Ao(e,t,n,i){let o=t.borderSkipped;const r={};if(!o)return void(e.borderSkipped=r);if(!0===o)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:s,end:a,reverse:l,top:c,bottom:d}=function(e){let t,n,i,o,r;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(o="end",r="start"):(o="start",r="end"),{start:n,end:i,reverse:t,top:o,bottom:r}}(e);"middle"===o&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?o=c:(n._bottom||0)===i?o=d:(r[Oo(d,s,a,l)]=!0,o=c)),r[Oo(o,s,a,l)]=!0,e.borderSkipped=r}function Oo(e,t,n,i){var o,r,s;return i?(s=n,e=Do(e=(o=e)===(r=t)?s:o===s?r:o,n,t)):e=Do(e,t,n),e}function Do(e,t,n){return"start"===e?t:"end"===e?n:e}function Io(e,{inflateAmount:t},n){e.inflateAmount="auto"===t?1===n?.33:0:t}class Po extends Mi{parsePrimitiveData(e,t,n,i){return To(e,t,n,i)}parseArrayData(e,t,n,i){return To(e,t,n,i)}parseObjectData(e,t,n,i){const{iScale:o,vScale:r}=e,{xAxisKey:s="x",yAxisKey:a="y"}=this._parsing,l="x"===o.axis?s:a,c="x"===r.axis?s:a,d=[];let h,u,p,f;for(h=n,u=n+i;h<u;++h)f=t[h],p={},p[o.axis]=o.parse(x(f,l),h),d.push(So(x(f,c),p,r,h));return d}updateRangeFromParsed(e,t,n,i){super.updateRangeFromParsed(e,t,n,i);const o=n._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:i}=t,o=this.getParsed(e),r=o._custom,s=Eo(r)?"["+r.start+", "+r.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,o){const r="reset"===o,{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:u}=this._getSharedOptions(t,o);for(let p=t;p<t+i;p++){const t=this.getParsed(p),i=r||n(t[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),f=this._calculateBarIndexPixels(p,d),m=(t._stacks||{})[a.axis],g={horizontal:c,base:i.base,enableBorderRadius:!m||Eo(t._custom)||s===m._top||s===m._bottom,x:c?i.head:f.center,y:c?f.center:i.head,height:c?f.size:Math.abs(i.size),width:c?Math.abs(i.size):f.size};u&&(g.options=h||this.resolveDataElementOptions(p,e[p].active?"active":o));const v=g.options||e[p].options;Ao(g,v,m,s),Io(g,v,d.ratio),this.updateElement(e[p],p,g,o)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,o=i.getMatchingVisibleMetas(this._type).filter((e=>e.controller.options.grouped)),r=i.options.stacked,s=[],a=e=>{const i=e.controller.getParsed(t),o=i&&i[e.vScale.axis];if(n(o)||isNaN(o))return!0};for(const n of o)if((void 0===t||!a(n))&&((!1===r||-1===s.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&s.push(n.stack),n.index===e))break;return s.length||s.push(void 0),s}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const i=this._getStacks(e,n),o=void 0!==t?i.indexOf(t):-1;return-1===o?i.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,i=[];let o,r;for(o=0,r=t.data.length;o<r;++o)i.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const s=e.barThickness;return{min:s||Co(t),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:s?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i},options:{base:o,minBarLength:r}}=this,s=o||0,a=this.getParsed(e),l=a._custom,c=Eo(l);let d,h,u=a[t.axis],p=0,f=i?this.applyStack(t,a,i):u;f!==u&&(p=f-u,f=u),c&&(u=l.barStart,f=l.barEnd-l.barStart,0!==u&&N(u)!==N(l.barEnd)&&(p=0),p+=u);const m=n(o)||c?p:o;let g=t.getPixelForValue(m);if(d=this.chart.getDataVisibility(e)?t.getPixelForValue(p+f):g,h=d-g,Math.abs(h)<r){h=function(e,t,n){return 0!==e?N(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}(h,t,s)*r,u===s&&(g-=h/2);const e=t.getPixelForDecimal(0),n=t.getPixelForDecimal(1),i=Math.min(e,n),o=Math.max(e,n);g=Math.max(Math.min(g,o),i),d=g+h}if(g===t.getPixelForValue(s)){const e=N(h)*t.getLineWidthForValue(s)/2;g+=e,h-=e}return{size:h,base:g,head:d,center:d+h/2}}_calculateBarIndexPixels(e,t){const i=t.scale,o=this.options,r=o.skipNull,s=a(o.maxBarThickness,1/0);let l,c;if(t.grouped){const i=r?this._getStackCount(e):t.stackCount,a="flex"===o.barThickness?function(e,t,n,i){const o=t.pixels,r=o[e];let s=e>0?o[e-1]:null,a=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;null===s&&(s=r-(null===a?t.end-t.start:a-r)),null===a&&(a=r+r-s);const c=r-(r-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/i,ratio:n.barPercentage,start:c}}(e,t,o,i):function(e,t,i,o){const r=i.barThickness;let s,a;return n(r)?(s=t.min*i.categoryPercentage,a=i.barPercentage):(s=r*o,a=1),{chunk:s/o,ratio:a,start:t.pixels[e]-s/2}}(e,t,o,i),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0);l=a.start+a.chunk*d+a.chunk/2,c=Math.min(s,a.chunk*a.ratio)}else l=i.getPixelForValue(this.getParsed(e)[i.axis],e),c=Math.min(s,t.min*t.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,i=n.length;let o=0;for(;o<i;++o)null!==this.getParsed(o)[t.axis]&&n[o].draw(this._ctx)}}Po.id="bar",Po.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Po.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Mo extends Mi{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,i){const o=super.parsePrimitiveData(e,t,n,i);for(let e=0;e<o.length;e++)o[e]._custom=this.resolveDataElementOptions(e+n).radius;return o}parseArrayData(e,t,n,i){const o=super.parseArrayData(e,t,n,i);for(let e=0;e<o.length;e++){const i=t[n+e];o[e]._custom=a(i[2],this.resolveDataElementOptions(e+n).radius)}return o}parseObjectData(e,t,n,i){const o=super.parseObjectData(e,t,n,i);for(let e=0;e<o.length;e++){const i=t[n+e];o[e]._custom=a(i&&i.r&&+i.r,this.resolveDataElementOptions(e+n).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:n,yScale:i}=t,o=this.getParsed(e),r=n.getLabelForValue(o.x),s=i.getLabelForValue(o.y),a=o._custom;return{label:t.label,value:"("+r+", "+s+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,i){const o="reset"===i,{iScale:r,vScale:s}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(t,i),c=r.axis,d=s.axis;for(let h=t;h<t+n;h++){const t=e[h],n=!o&&this.getParsed(h),u={},p=u[c]=o?r.getPixelForDecimal(.5):r.getPixelForValue(n[c]),f=u[d]=o?s.getBasePixel():s.getPixelForValue(n[d]);u.skip=isNaN(p)||isNaN(f),l&&(u.options=a||this.resolveDataElementOptions(h,t.active?"active":i),o&&(u.options.radius=0)),this.updateElement(t,h,u,i)}}resolveDataElementOptions(e,t){const n=this.getParsed(e);let i=super.resolveDataElementOptions(e,t);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return"active"!==t&&(i.radius=0),i.radius+=a(n&&n._custom,o),i}}Mo.id="bubble",Mo.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Mo.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class Ro extends Mi{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let r,s,a=e=>+n[e];if(o(n[e])){const{key:e="value"}=this._parsing;a=t=>+x(n[t],e)}for(r=e,s=e+t;r<s;++r)i._parsed[r]=a(r)}}_getRotation(){return $(this.options.rotation-90)}_getCircumference(){return $(this.options.circumference)}
vendor: 2,502 bytes, line 175
175_getRotationExtents(){let e=A,t=-A;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){const i=this.chart.getDatasetMeta(n).controller,o=i._getRotation(),r=i._getCircumference();e=Math.min(e,o),t=Math.max(t,o+r)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:n}=t,i=this._cachedMeta,o=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,s=Math.max((Math.min(n.width,n.height)-r)/2,0),a=Math.min(l(this.options.cutout,s),1),d=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(e,t,n){let i=1,o=1,r=0,s=0;if(t<A){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),h=Math.cos(l),u=Math.sin(l),p=(e,t,i)=>Y(e,a,l,!0)?1:Math.max(t,t*n,i,i*n),f=(e,t,i)=>Y(e,a,l,!0)?-1:Math.min(t,t*n,i,i*n),m=p(0,c,h),g=p(P,d,u),v=f(E,c,h),b=f(E+P,d,u);i=(m-v)/2,o=(g-b)/2,r=-(m+v)/2,s=-(g+b)/2}return{ratioX:i,ratioY:o,offsetX:r,offsetY:s}}(u,h,a),v=(n.width-r)/p,b=(n.height-r)/f,y=Math.max(Math.min(v,b)/2,0),x=c(this.options.radius,y),w=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*x,this.offsetY=g*x,i.total=this.calculateTotal(),this.outerRadius=x-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*d,0),this.updateElements(o,0,o.length,e)}_circumference(e,t){const n=this.options,i=this._cachedMeta,o=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===i._parsed[e]||i.data[e].hidden?0:this.calculateCircumference(i._parsed[e]*o/A)}updateElements(e,t,n,i){const o="reset"===i,r=this.chart,s=r.chartArea,a=r.options.animation,l=(s.left+s.right)/2,c=(s.top+s.bottom)/2,d=o&&a.animateScale,h=d?0:this.innerRadius,u=d?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(t,i);let m,g=this._getRotation();for(m=0;m<t;++m)g+=this._circumference(m,o);for(m=t;m<t+n;++m){const t=this._circumference(m,o),n=e[m],r={x:l+this.offsetX,y:c+this.offsetY,startAngle:g,endAngle:g+t,circumference:t,outerRadius:u,innerRadius:h};f&&(r.options=p||this.resolveDataElementOptions(m,n.active?"active":i)),g+=t,this.updateElement(n,m,r,i)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let n,i=0;for(n=0;n<t.length;n++){const o=e._parsed[n];null===o||isNaN(o)||!this.chart.getDataVisibility(n)||t[n].hidden||(i+=Math.abs(o))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?A*(Math.abs(e)/t):0}
vendor: 13,619 bytes, line 175
175getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,i=n.data.labels||[],o=cn(t._parsed[e],n.options.locale);return{label:i[e]||"",value:o}}getMaxBorderWidth(e){let t=0;const n=this.chart;let i,o,r,s,a;if(!e)for(i=0,o=n.data.datasets.length;i<o;++i)if(n.isDatasetVisible(i)){r=n.getDatasetMeta(i),e=r.data,s=r.controller;break}if(!e)return 0;for(i=0,o=e.length;i<o;++i)a=s.resolveDataElementOptions(i),"inner"!==a.borderAlign&&(t=Math.max(t,a.borderWidth||0,a.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,i=e.length;n<i;++n){const e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(a(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ro.id="doughnut",Ro.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},Ro.descriptors={_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e},Ro.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map(((t,i)=>{const o=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}}))}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(e){let t=e.label;const n=": "+e.formattedValue;return i(t)?(t=t.slice(),t[0]+=n):t+=n,t}}}}};class zo extends Mi{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:i=[],_dataset:o}=t,r=this.chart._animationsDisabled;let{start:s,count:a}=fe(t,i,r);this._drawStart=s,this._drawCount=a,me(t)&&(s=0,a=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=i;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:l},e),this.updateElements(i,s,a,e)}updateElements(e,t,i,o){const r="reset"===o,{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(t,o),u=s.axis,p=a.axis,{spanGaps:f,segment:m}=this.options,g=j(f)?f:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||"none"===o;let b=t>0&&this.getParsed(t-1);for(let f=t;f<t+i;++f){const t=e[f],i=this.getParsed(f),y=v?t:{},x=n(i[p]),w=y[u]=s.getPixelForValue(i[u],f),_=y[p]=r||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,i,l):i[p],f);y.skip=isNaN(w)||isNaN(_)||x,y.stop=f>0&&Math.abs(i[u]-b[u])>g,m&&(y.parsed=i,y.raw=c.data[f]),h&&(y.options=d||this.resolveDataElementOptions(f,t.active?"active":o)),v||this.updateElement(t,f,y,o),b=i}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,i=e.data||[];if(!i.length)return n;const o=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,o,r)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}zo.id="line",zo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},zo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class No extends Mi{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,i=n.data.labels||[],o=cn(t._parsed[e].r,n.options.locale);return{label:i[e]||"",value:o}}parseObjectData(e,t,n,i){return Vt.bind(this)(e,t,n,i)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach(((e,n)=>{const i=this.getParsed(n).r;!isNaN(i)&&this.chart.getDataVisibility(n)&&(i<t.min&&(t.min=i),i>t.max&&(t.max=i))})),t}_updateRadius(){const e=this.chart,t=e.chartArea,n=e.options,i=Math.min(t.right-t.left,t.bottom-t.top),o=Math.max(i/2,0),r=(o-Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,n,i){const o="reset"===i,r=this.chart,s=r.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,d=a.getIndexAngle(0)-.5*E;let h,u=d;const p=360/this.countVisibleElements();for(h=0;h<t;++h)u+=this._computeAngle(h,i,p);for(h=t;h<t+n;h++){const t=e[h];let n=u,f=u+this._computeAngle(h,i,p),m=r.getDataVisibility(h)?a.getDistanceFromCenterForValue(this.getParsed(h).r):0;u=f,o&&(s.animateScale&&(m=0),s.animateRotate&&(n=f=d));const g={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:n,endAngle:f,options:this.resolveDataElementOptions(h,t.active?"active":i)};this.updateElement(t,h,g,i)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach(((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++})),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?$(this.resolveDataElementOptions(e,t).angle||n):0}}No.id="polarArea",No.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},No.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n}}=e.legend.options;return t.labels.map(((t,i)=>{const o=e.getDatasetMeta(0).controller.getStyle(i);return{text:t,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(i),index:i}}))}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:e=>e.chart.data.labels[e.dataIndex]+": "+e.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Fo extends Ro{}Fo.id="pie",Fo.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Lo extends Mi{getLabelAndValue(e){const t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,i){return Vt.bind(this)(e,t,n,i)}update(e){const t=this._cachedMeta,n=t.dataset,i=t.data||[],o=t.iScale.getLabels();if(n.points=i,"resize"!==e){const t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===i.length,options:t};this.updateElement(n,void 0,r,e)}this.updateElements(i,0,i.length,e)}updateElements(e,t,n,i){const o=this._cachedMeta.rScale,r="reset"===i;for(let s=t;s<t+n;s++){const t=e[s],n=this.resolveDataElementOptions(s,t.active?"active":i),a=o.getPointPositionForValue(s,this.getParsed(s).r),l=r?o.xCenter:a.x,c=r?o.yCenter:a.y,d={x:l,y:c,angle:a.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(t,s,d,i)}}}Lo.id="radar",Lo.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Lo.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class jo extends Mi{update(e){const t=this._cachedMeta,{data:n=[]}=t,i=this.chart._animationsDisabled;let{start:o,count:r}=fe(t,n,i);if(this._drawStart=o,this._drawCount=r,me(t)&&(o=0,r=n.length),this.options.showLine){const{dataset:o,_dataset:r}=t;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!r._decimated,o.points=n;const s=this.resolveDatasetElementOptions(e);s.segment=this.options.segment,this.updateElement(o,void 0,{animated:!i,options:s},e)}this.updateElements(n,o,r,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=Ki.getElement("line")),super.addElements()}updateElements(e,t,i,o){const r="reset"===o,{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(t,o),h=this.getSharedOptions(d),u=this.includeOptions(o,h),p=s.axis,f=a.axis,{spanGaps:m,segment:g}=this.options,v=j(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||"none"===o;let y=t>0&&this.getParsed(t-1);for(let d=t;d<t+i;++d){const t=e[d],i=this.getParsed(d),m=b?t:{},x=n(i[f]),w=m[p]=s.getPixelForValue(i[p],d),_=m[f]=r||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,i,l):i[f],d);m.skip=isNaN(w)||isNaN(_)||x,m.stop=d>0&&Math.abs(i[p]-y[p])>v,g&&(m.parsed=i,m.raw=c.data[d]),u&&(m.options=h||this.resolveDataElementOptions(d,t.active?"active":o)),b||this.updateElement(t,d,m,o),y=i}this.updateSharedOptions(h,o,d)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}const n=e.dataset,i=n.options&&n.options.borderWidth||0;if(!t.length)return i;const o=t[0].size(this.resolveDataElementOptions(0)),r=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(i,o,r)/2}}jo.id="scatter",jo.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},jo.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:e=>"("+e.label+", "+e.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Bo=Object.freeze({__proto__:null,BarController:Po,BubbleController:Mo,DoughnutController:Ro,LineController:zo,PolarAreaController:No,PieController:Fo,RadarController:Lo,ScatterController:jo});function Ho(e,t,n){const{startAngle:i,pixelMargin:o,x:r,y:s,outerRadius:a,innerRadius:l}=t;let c=o/a;e.beginPath(),e.arc(r,s,a,i-c,n+c),l>o?(c=o/l,e.arc(r,s,l,n+c,i-c,!0)):e.arc(r,s,o,n+P,i-P),e.closePath(),e.clip()}function Uo(e,t,n,i){const o=pn(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const r=(n-t)/2,s=Math.min(r,i*t/2),a=e=>{const t=(n-Math.min(r,e))*i/2;return Q(e,0,Math.min(r,t))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:Q(o.innerStart,0,s),innerEnd:Q(o.innerEnd,0,s)}}function $o(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function qo(e,t,n,i,o,r){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,h=Math.max(t.outerRadius+i+n-c,0),u=d>0?d+i+n+c:0;let p=0;const f=o-l;if(i){const e=((d>0?d-i:0)+(h>0?h-i:0))/2;p=(f-(0!==e?f*e/(e+i):f))/2}const m=(f-Math.max(.001,f*h-n/E)/h)/2,g=l+m+p,v=o-m-p,{outerStart:b,outerEnd:y,innerStart:x,innerEnd:w}=Uo(t,u,h,v-g),_=h-b,k=h-y,C=g+b/_,S=v-y/k,T=u+x,A=u+w,O=g+x/T,D=v-w/A;if(e.beginPath(),r){if(e.arc(s,a,h,C,S),y>0){const t=$o(k,S,s,a);e.arc(t.x,t.y,y,S,v+P)}const t=$o(A,v,s,a);if(e.lineTo(t.x,t.y),w>0){const t=$o(A,D,s,a);e.arc(t.x,t.y,w,v+P,D+Math.PI)}if(e.arc(s,a,u,v-w/u,g+x/u,!0),x>0){const t=$o(T,O,s,a);e.arc(t.x,t.y,x,O+Math.PI,g-P)}const n=$o(_,g,s,a);if(e.lineTo(n.x,n.y),b>0){const t=$o(_,C,s,a);e.arc(t.x,t.y,b,g-P,C)}}else{e.moveTo(s,a);const t=Math.cos(C)*h+s,n=Math.sin(C)*h+a;e.lineTo(t,n);const i=Math.cos(S)*h+s,o=Math.sin(S)*h+a;e.lineTo(i,o)}e.closePath()}function Wo(e,t,n,i,o,r){const{options:s}=t,{borderWidth:a,borderJoinStyle:l}=s,c="inner"===s.borderAlign;a&&(c?(e.lineWidth=2*a,e.lineJoin=l||"round"):(e.lineWidth=a,e.lineJoin=l||"bevel"),t.fullCircles&&function(e,t,n){const{x:i,y:o,startAngle:r,pixelMargin:s,fullCircles:a}=t,l=Math.max(t.outerRadius-s,0),c=t.innerRadius+s;let d;for(n&&Ho(e,t,r+A),e.beginPath(),e.arc(i,o,c,r+A,r,!0),d=0;d<a;++d)e.stroke();for(e.beginPath(),e.arc(i,o,l,r,r+A),d=0;d<a;++d)e.stroke()}(e,t,c),c&&Ho(e,t,o),qo(e,t,n,i,o,r),e.stroke())}class Vo extends Ri{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){const i=this.getProps(["x","y"],n),{angle:o,distance:r}=V(i,{x:e,y:t}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=this.options.spacing/2,p=a(h,l-s)>=A||Y(o,s,l),f=Z(r,c+u,d+u);return p&&f}getCenterPoint(e){const{x:t,y:n,startAngle:i,endAngle:o,innerRadius:r,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:l}=this.options,c=(i+o)/2,d=(r+s+l+a)/2;return{x:t+Math.cos(c)*d,y:n+Math.sin(c)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,i=(t.offset||0)/2,o=(t.spacing||0)/2,r=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>A?Math.floor(n/A):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();let s=0;if(i){s=i/2;const t=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(t)*s,Math.sin(t)*s),this.circumference>=E&&(s=i)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=function(e,t,n,i,o){const{fullCircles:r,startAngle:s,circumference:a}=t;let l=t.endAngle;if(r){qo(e,t,n,i,s+A,o);for(let t=0;t<r;++t)e.fill();
vendor: 10,379 bytes, line 175
175isNaN(a)||(l=s+a%A,a%A==0&&(l+=A))}return qo(e,t,n,i,l,o),e.fill(),l}(e,this,s,o,r);Wo(e,this,s,o,a,r),e.restore()}}function Ko(e,t,n=t){e.lineCap=a(n.borderCapStyle,t.borderCapStyle),e.setLineDash(a(n.borderDash,t.borderDash)),e.lineDashOffset=a(n.borderDashOffset,t.borderDashOffset),e.lineJoin=a(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=a(n.borderWidth,t.borderWidth),e.strokeStyle=a(n.borderColor,t.borderColor)}function Go(e,t,n){e.lineTo(n.x,n.y)}function Xo(e,t,n={}){const i=e.length,{start:o=0,end:r=i-1}=n,{start:s,end:a}=t,l=Math.max(o,s),c=Math.min(r,a),d=o<s&&r<s||o>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!d?i+c-l:c-l}}function Yo(e,t,n,i){const{points:o,options:r}=t,{count:s,start:a,loop:l,ilen:c}=Xo(o,n,i),d=function(e){return e.stepped?At:e.tension||"monotone"===e.cubicInterpolationMode?Ot:Go}(r);let h,u,p,{move:f=!0,reverse:m}=i||{};for(h=0;h<=c;++h)u=o[(a+(m?c-h:h))%s],u.skip||(f?(e.moveTo(u.x,u.y),f=!1):d(e,p,u,m,r.stepped),p=u);return l&&(u=o[(a+(m?c:0))%s],d(e,p,u,m,r.stepped)),!!l}function Qo(e,t,n,i){const o=t.points,{count:r,start:s,ilen:a}=Xo(o,n,i),{move:l=!0,reverse:c}=i||{};let d,h,u,p,f,m,g=0,v=0;const b=e=>(s+(c?a-e:e))%r,y=()=>{p!==f&&(e.lineTo(g,f),e.lineTo(g,p),e.lineTo(g,m))};for(l&&(h=o[b(0)],e.moveTo(h.x,h.y)),d=0;d<=a;++d){if(h=o[b(d)],h.skip)continue;const t=h.x,n=h.y,i=0|t;i===u?(n<p?p=n:n>f&&(f=n),g=(v*g+t)/++v):(y(),e.lineTo(t,n),u=i,v=0,p=f=n),m=n}y()}function Jo(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!(e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n)?Qo:Yo}Vo.id="arc",Vo.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Vo.defaultRoutes={backgroundColor:"backgroundColor"};const Zo="function"==typeof Path2D;function er(e,t,n,i){Zo&&!t.options.segment?function(e,t,n,i){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,i)&&o.closePath()),Ko(e,t.options),e.stroke(o)}(e,t,n,i):function(e,t,n,i){const{segments:o,options:r}=t,s=Jo(t);for(const a of o)Ko(e,r,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}(e,t,n,i)}class tr extends Ri{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;Zt(this._points,n,e,i,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=An(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,i=e[t],o=this.points,r=En(this,{property:t,start:i,end:i});if(!r.length)return;const s=[],a=function(e){return e.stepped?sn:e.tension||"monotone"===e.cubicInterpolationMode?an:rn}(n);let l,c;for(l=0,c=r.length;l<c;++l){const{start:c,end:d}=r[l],h=o[c],u=o[d];if(h===u){s.push(h);continue}const p=a(h,u,Math.abs((i-h[t])/(u[t]-h[t])),n.stepped);p[t]=e[t],s.push(p)}return 1===s.length?s[0]:s}pathSegment(e,t,n){return Jo(this)(e,this,t,n)}path(e,t,n){const i=this.segments,o=Jo(this);let r=this._loop;t=t||0,n=n||this.points.length-t;for(const s of i)r&=o(e,this,s,{start:t,end:t+n-1});return!!r}draw(e,t,n,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),er(e,this,n,i),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function nr(e,t,n,i){const o=e.options,{[n]:r}=e.getProps([n],i);return Math.abs(t-r)<o.radius+o.hitRadius}tr.id="line",tr.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},tr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},tr.descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};class ir extends Ri{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){const i=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(e-o,2)+Math.pow(t-r,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(e,t){return nr(this,e,"x",t)}inYRange(e,t){return nr(this,e,"y",t)}getCenterPoint(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}size(e){let t=(e=e||this.options||{}).radius||0;t=Math.max(t,t&&e.hoverRadius||0);return 2*(t+(t&&e.borderWidth||0))}draw(e,t){const n=this.options;this.skip||n.radius<.1||!St(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,kt(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}function or(e,t){const{x:n,y:i,base:o,width:r,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,h;return e.horizontal?(h=s/2,a=Math.min(n,o),l=Math.max(n,o),c=i-h,d=i+h):(h=r/2,a=n-h,l=n+h,c=Math.min(i,o),d=Math.max(i,o)),{left:a,top:c,right:l,bottom:d}}function rr(e,t,n,i){return e?0:Q(t,n,i)}function sr(e){const t=or(e),n=t.right-t.left,i=t.bottom-t.top,r=function(e,t,n){const i=e.options.borderWidth,o=e.borderSkipped,r=fn(i);return{t:rr(o.top,r.top,0,n),r:rr(o.right,r.right,0,t),b:rr(o.bottom,r.bottom,0,n),l:rr(o.left,r.left,0,t)}}(e,n/2,i/2),s=function(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=mn(r),a=Math.min(t,n),l=e.borderSkipped,c=i||o(r);return{topLeft:rr(!c||l.top||l.left,s.topLeft,0,a),topRight:rr(!c||l.top||l.right,s.topRight,0,a),bottomLeft:rr(!c||l.bottom||l.left,s.bottomLeft,0,a),bottomRight:rr(!c||l.bottom||l.right,s.bottomRight,0,a)}}(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function ar(e,t,n,i){const o=null===t,r=null===n,s=e&&!(o&&r)&&or(e,i);return s&&(o||Z(t,s.left,s.right))&&(r||Z(n,s.top,s.bottom))}function lr(e,t){e.rect(t.x,t.y,t.w,t.h)}function cr(e,t,n={}){const i=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,r=(e.x+e.w!==n.x+n.w?t:0)-i,s=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+i,y:e.y+o,w:e.w+r,h:e.h+s,radius:e.radius}}ir.id="point",ir.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},ir.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class dr extends Ri{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:n,backgroundColor:i}}=this,{inner:o,outer:r}=sr(this),s=(a=r.radius).topLeft||a.topRight||a.bottomLeft||a.bottomRight?Pt:lr;var a;e.save(),r.w===o.w&&r.h===o.h||(e.beginPath(),s(e,cr(r,t,o)),e.clip(),s(e,cr(o,-t,r)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),s(e,cr(o,t)),e.fillStyle=i,e.fill(),e.restore()}inRange(e,t,n){return ar(this,e,t,n)}inXRange(e,t){return ar(this,e,null,t)}inYRange(e,t){return ar(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+i)/2:t,y:o?n:(n+i)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}dr.id="bar",dr.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},dr.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var hr=Object.freeze({__proto__:null,ArcElement:Vo,LineElement:tr,PointElement:ir,BarElement:dr});function ur(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{value:t})}}function pr(e){e.data.datasets.forEach((e=>{ur(e)}))}var fr={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,i)=>{if(!i.enabled)return void pr(e);const o=e.width;e.data.datasets.forEach(((t,r)=>{const{_data:s,indexAxis:a}=t,l=e.getDatasetMeta(r),c=s||t.data;if("y"===bn([a,e.options.indexAxis]))return;if(!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if("linear"!==d.type&&"time"!==d.type)return;if(e.options.parsing)return;let{start:h,count:u}=function(e,t){const n=t.length;let i,o=0;const{iScale:r}=e,{min:s,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(o=Q(te(t,r.axis,s).lo,0,n-1)),i=c?Q(te(t,r.axis,a).hi+1,o,n)-o:n-o,{start:o,count:i}}(l,c);if(u<=(i.threshold||4*o))return void ur(t);let p;switch(n(s)&&(t._data=c,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),i.algorithm){case"lttb":p=function(e,t,n,i,o){const r=o.samples||i;if(r>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(r-2);let l=0;const c=t+n-1;let d,h,u,p,f,m=t;for(s[l++]=e[m],d=0;d<r-2;d++){let i,o=0,r=0;const c=Math.floor((d+1)*a)+1+t,g=Math.min(Math.floor((d+2)*a)+1,n)+t,v=g-c;for(i=c;i<g;i++)o+=e[i].x,r+=e[i].y;o/=v,r/=v;const b=Math.floor(d*a)+1+t,y=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:x,y:w}=e[m];for(u=p=-1,i=b;i<y;i++)p=.5*Math.abs((x-o)*(e[i].y-w)-(x-e[i].x)*(r-w)),p>u&&(u=p,h=e[i],f=i);s[l++]=h,m=f}return s[l++]=e[c],s}(c,h,u,o,i);break;case"min-max":p=function(e,t,i,o){let r,s,a,l,c,d,h,u,p,f,m=0,g=0;const v=[],b=t+i-1,y=e[t].x,x=e[b].x-y;for(r=t;r<t+i;++r){s=e[r],a=(s.x-y)/x*o,l=s.y;const t=0|a;if(t===c)l<p?(p=l,d=r):l>f&&(f=l,h=r),m=(g*m+s.x)/++g;else{const i=r-1;if(!n(d)&&!n(h)){const t=Math.min(d,h),n=Math.max(d,h);t!==u&&t!==i&&v.push({...e[t],x:m}),n!==u&&n!==i&&v.push({...e[n],x:m})}r>0&&i!==u&&v.push(e[i]),v.push(s),c=t,g=0,p=f=l,d=h=u=r}}return v}(c,h,u,o);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}t._decimated=p}))},destroy(e){pr(e)}};function mr(e,t,n,i){if(i)return;let o=t[e],r=n[e];
vendor: 9,148 bytes, line 175
175return"angle"===e&&(o=X(o),r=X(r)),{property:e,start:o,end:r}}function gr(e,t,n){for(;t>e;t--){const e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function vr(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function br(e,t){let n=[],o=!1;return i(e)?(o=!0,n=e):n=function(e,t){const{x:n=null,y:i=null}=e||{},o=t.points,r=[];return t.segments.forEach((({start:e,end:t})=>{t=gr(e,t,o);const s=o[e],a=o[t];null!==i?(r.push({x:s.x,y:i}),r.push({x:a.x,y:i})):null!==n&&(r.push({x:n,y:s.y}),r.push({x:n,y:a.y}))})),r}(e,t),n.length?new tr({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function yr(e){return e&&!1!==e.fill}function xr(e,t,n){let i=e[t].fill;const o=[t];let s;if(!n)return i;for(;!1!==i&&-1===o.indexOf(i);){if(!r(i))return i;if(s=e[i],!s)return!1;if(s.visible)return i;o.push(i),i=s.fill}return!1}function wr(e,t,n){const i=function(e){const t=e.options,n=t.fill;let i=a(n&&n.target,n);void 0===i&&(i=!!t.backgroundColor);if(!1===i||null===i)return!1;if(!0===i)return"origin";return i}(e);if(o(i))return!isNaN(i.value)&&i;let s=parseFloat(i);return r(s)&&Math.floor(s)===s?function(e,t,n,i){"-"!==e&&"+"!==e||(n=t+n);if(n===t||n<0||n>=i)return!1;return n}(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function _r(e,t,n){const i=[];for(let o=0;o<n.length;o++){const r=n[o],{first:s,last:a,point:l}=kr(r,t,"x");if(!(!l||s&&a))if(s)i.unshift(l);else if(e.push(l),!a)break}e.push(...i)}function kr(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const o=i[n],r=e.segments,s=e.points;let a=!1,l=!1;for(let e=0;e<r.length;e++){const t=r[e],i=s[t.start][n],c=s[t.end][n];if(Z(o,i,c)){a=o===i,l=o===c;break}}return{first:a,last:l,point:i}}class Cr{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){const{x:i,y:o,radius:r}=this;return t=t||{start:0,end:A},e.arc(i,o,r,t.end,t.start,!0),!n.bounds}interpolate(e){const{x:t,y:n,radius:i}=this,o=e.angle;return{x:t+Math.cos(o)*i,y:n+Math.sin(o)*i,angle:o}}}function Sr(e){const{chart:t,fill:n,line:i}=e;if(r(n))return function(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}(t,n);if("stack"===n)return function(e){const{scale:t,index:n,line:i}=e,o=[],r=i.segments,s=i.points,a=function(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let e=0;e<i.length;e++){const o=i[e];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}(t,n);a.push(br({x:null,y:t.bottom},i));for(let e=0;e<r.length;e++){const t=r[e];for(let e=t.start;e<=t.end;e++)_r(o,s[e],a)}return new tr({points:o,options:{}})}(e);if("shape"===n)return!0;const s=function(e){if((e.scale||{}).getPointPositionForValue)return function(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=function(e,t,n){let i;return i="start"===e?n:"end"===e?t.options.reverse?t.min:t.max:o(e)?e.value:t.getBaseValue(),i}(n,t,s),l=[];if(i.grid.circular){const e=t.getPointPositionForValue(0,s);return new Cr({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(a)})}for(let e=0;e<r;++e)l.push(t.getPointPositionForValue(e,a));return l}(e);return function(e){const{scale:t={},fill:n}=e,i=function(e,t){let n=null;return"start"===e?n=t.bottom:"end"===e?n=t.top:o(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(n,t);if(r(i)){const e=t.isHorizontal();return{x:e?i:null,y:e?null:i}}return null}(e)}(e);return s instanceof Cr?s:br(s,i)}function Tr(e,t,n){const i=Sr(t),{line:o,scale:r,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:d=c,below:h=c}=l||{};i&&o.points.length&&(Tt(e,n),function(e,t){const{line:n,target:i,above:o,below:r,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),"x"===l&&r!==o&&(Er(e,i,s.top),Ar(e,{line:n,target:i,color:o,scale:a,property:l}),e.restore(),e.save(),Er(e,i,s.bottom));Ar(e,{line:n,target:i,color:r,scale:a,property:l}),e.restore()}(e,{line:o,target:i,above:d,below:h,area:n,scale:r,axis:s}),Et(e))}function Er(e,t,n){const{segments:i,points:o}=t;let r=!0,s=!1;e.beginPath();for(const a of i){const{start:i,end:l}=a,c=o[i],d=o[gr(i,l,o)];r?(e.moveTo(c.x,c.y),r=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Ar(e,t){const{line:n,target:i,property:o,color:r,scale:s}=t,a=function(e,t,n){const i=e.segments,o=e.points,r=t.points,s=[];for(const e of i){let{start:i,end:a}=e;a=gr(i,a,o);const l=mr(n,o[i],o[a],e.loop);if(!t.segments){s.push({source:e,target:l,start:o[i],end:o[a]});continue}const c=En(t,l);for(const t of c){const i=mr(n,r[t.start],r[t.end],t.loop),a=Tn(e,o,i);for(const e of a)s.push({source:e,target:t,start:{[n]:vr(l,i,"start",Math.max)},end:{[n]:vr(l,i,"end",Math.min)}})}}return s}(n,i,o);for(const{source:t,target:l,start:c,end:d}of a){const{style:{backgroundColor:a=r}={}}=t,h=!0!==i;e.save(),e.fillStyle=a,Or(e,s,h&&mr(o,c,d)),e.beginPath();const u=!!n.pathSegment(e,t);let p;if(h){u?e.closePath():Dr(e,i,d,o);const t=!!i.pathSegment(e,l,{move:u,reverse:!0});p=u&&t,p||Dr(e,i,c,o)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function Or(e,t,n){const{top:i,bottom:o}=t.chart.chartArea,{property:r,start:s,end:a}=n||{};"x"===r&&(e.beginPath(),e.rect(s,i,a-s,o-i),e.clip())}function Dr(e,t,n,i){const o=t.interpolate(n,i);o&&e.lineTo(o.x,o.y)}var Ir={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,o=[];let r,s,a,l;for(s=0;s<i;++s)r=e.getDatasetMeta(s),a=r.dataset,l=null,a&&a.options&&a instanceof tr&&(l={visible:e.isDatasetVisible(s),index:s,fill:wr(a,s,i),chart:e,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,o.push(l);for(s=0;s<i;++s)l=o[s],l&&!1!==l.fill&&(l.fill=xr(o,s,n.propagate))},beforeDraw(e,t,n){const i="beforeDraw"===n.drawTime,o=e.getSortedVisibleDatasetMetas(),r=e.chartArea;for(let t=o.length-1;t>=0;--t){const n=o[t].$filler;n&&(n.line.updateControlPoints(r,n.axis),i&&n.fill&&Tr(e.ctx,n,r))}},beforeDatasetsDraw(e,t,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=e.getSortedVisibleDatasetMetas();for(let t=i.length-1;t>=0;--t){const n=i[t].$filler;yr(n)&&Tr(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;yr(i)&&"beforeDatasetDraw"===n.drawTime&&Tr(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Pr=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}};class Mr extends Ri{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=d(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter((t=>e.filter(t,this.chart.data)))),e.sort&&(t=t.sort(((t,n)=>e.sort(t,n,this.chart.data)))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,i=vn(n.font),o=i.size,r=this._computeTitleHeight(),{boxWidth:s,itemHeight:a}=Pr(n,o);let l,c;t.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(r,o,s,a)+10):(c=this.maxHeight,l=this._fitCols(r,o,s,a)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,i){const{ctx:o,maxWidth:r,options:{labels:{padding:s}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+s;let d=e;o.textAlign="left",o.textBaseline="middle";let h=-1,u=-c;return this.legendItems.forEach(((e,p)=>{const f=n+t/2+o.measureText(e.text).width;(0===p||l[l.length-1]+f+2*s>r)&&(d+=c,l[l.length-(p>0?0:1)]=0,u+=c,h++),a[p]={left:0,top:u,row:h,width:f,height:i},l[l.length-1]+=f+s})),d}_fitCols(e,t,n,i){const{ctx:o,maxHeight:r,options:{labels:{padding:s}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=r-e;let d=s,h=0,u=0,p=0,f=0;return this.legendItems.forEach(((e,r)=>{const m=n+t/2+o.measureText(e.text).width;r>0&&u+i+2*s>c&&(d+=h+s,l.push({width:h,height:u}),p+=h+s,f++,h=u=0),a[r]={left:p,top:u,col:f,width:m,height:i},h=Math.max(h,m),u+=i+s})),d+=h,l.push({width:h,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:i},rtl:o}}=this,r=wn(o,this.left,this.width);if(this.isHorizontal()){let o=0,s=ue(n,this.left+i,this.right-this.lineWidths[o]);for(const a of t)o!==a.row&&(o=a.row,s=ue(n,this.left+i,this.right-this.lineWidths[o])),a.top+=this.top+e+i,a.left
vendor: 4,222 bytes, line 175
175=r.leftForLtr(r.x(s),a.width),s+=a.width+i}else{let o=0,s=ue(n,this.top+e+i,this.bottom-this.columnSizes[o].height);for(const a of t)a.col!==o&&(o=a.col,s=ue(n,this.top+e+i,this.bottom-this.columnSizes[o].height)),a.top=s,a.left+=this.left+i,a.left=r.leftForLtr(r.x(a.left),a.width),s+=a.height+i}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;Tt(e,this),this._draw(),Et(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:i}=this,{align:o,labels:r}=e,s=ot.color,l=wn(e.rtl,this.left,this.width),c=vn(r.font),{color:d,padding:h}=r,u=c.size,p=u/2;let f;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:m,boxHeight:g,itemHeight:v}=Pr(r,u),b=this.isHorizontal(),y=this._computeTitleHeight();f=b?{x:ue(o,this.left+h,this.right-n[0]),y:this.top+h+y,line:0}:{x:this.left+h,y:ue(o,this.top+y+h,this.bottom-t[0].height),line:0},_n(this.ctx,e.textDirection);const x=v+h;this.legendItems.forEach(((w,_)=>{i.strokeStyle=w.fontColor||d,i.fillStyle=w.fontColor||d;const k=i.measureText(w.text).width,C=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),S=m+p+k;let T=f.x,E=f.y;l.setWidth(this.width),b?_>0&&T+S+h>this.right&&(E=f.y+=x,f.line++,T=f.x=ue(o,this.left+h,this.right-n[f.line])):_>0&&E+x>this.bottom&&(T=f.x=T+t[f.line].width+h,f.line++,E=f.y=ue(o,this.top+y+h,this.bottom-t[f.line].height));!function(e,t,n){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;i.save();const o=a(n.lineWidth,1);if(i.fillStyle=a(n.fillStyle,s),i.lineCap=a(n.lineCap,"butt"),i.lineDashOffset=a(n.lineDashOffset,0),i.lineJoin=a(n.lineJoin,"miter"),i.lineWidth=o,i.strokeStyle=a(n.strokeStyle,s),i.setLineDash(a(n.lineDash,[])),r.usePointStyle){const s={radius:g*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},a=l.xPlus(e,m/2);Ct(i,s,a,t+p,r.pointStyleWidth&&m)}else{const r=t+Math.max((u-g)/2,0),s=l.leftForLtr(e,m),a=mn(n.borderRadius);i.beginPath(),Object.values(a).some((e=>0!==e))?Pt(i,{x:s,y:r,w:m,h:g,radius:a}):i.rect(s,r,m,g),i.fill(),0!==o&&i.stroke()}i.restore()}(l.x(T),E,w),T=pe(C,T+m+p,b?T+S:this.right,e.rtl),function(e,t,n){Dt(i,n.text,e,t+v/2,c,{strikethrough:n.hidden,textAlign:l.textAlign(n.textAlign)})}(l.x(T),E,w),b?f.x+=S+h:f.y+=x})),kn(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=vn(t.font),i=gn(t.padding);if(!t.display)return;const o=wn(e.rtl,this.left,this.width),r=this.ctx,s=t.position,a=n.size/2,l=i.top+a;let c,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,d=ue(e.align,d,this.right-h);else{const t=this.columnSizes.reduce(((e,t)=>Math.max(e,t.height)),0);c=l+ue(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const u=ue(s,d,d+h);r.textAlign=o.textAlign(he(s)),r.textBaseline="middle",r.strokeStyle=t.color,r.fillStyle=t.color,r.font=n.string,Dt(r,t.text,u,c,n)}_computeTitleHeight(){const e=this.options.title,t=vn(e.font),n=gn(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,i,o;if(Z(e,this.left,this.right)&&Z(t,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(i=o[n],Z(e,i.left,i.left+i.width)&&Z(t,i.top,i.top+i.height))return this.legendItems[n];return null}handleEvent(e){const t=this.options;if(!function(e,t){if(("mousemove"===e||"mouseout"===e)&&(t.onHover||t.onLeave))return!0;if(t.onClick&&("click"===e||"mouseup"===e))return!0;return!1}(e.type,t))return;const n=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const r=this._hoveredItem,s=(o=n,null!==(i=r)&&null!==o&&i.datasetIndex===o.datasetIndex&&i.index===o.index);r&&!s&&d(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!s&&d(t.onHover,[e,n,this],this)}else n&&d(t.onClick,[e,n,this],this);var i,o}}var Rr={id:"legend",_element:Mr,start(e,t,n){const i=e.legend=new Mr({ctx:e.ctx,options:n,chart:e});Jn.configure(e,i,n),Jn.addBox(e,i)},stop(e){Jn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Jn.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)}
vendor: 5,049 bytes, line 175
175,defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,o=n.chart;o.isDatasetVisible(i)?(o.hide(i),t.hidden=!0):(o.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:o,color:r}}=e.legend.options;return e._getSortedDatasetMetas().map((e=>{const s=e.controller.getStyle(n?0:void 0),a=gn(s.borderWidth);return{text:t[e.index].label,fillStyle:s.backgroundColor,fontColor:r,hidden:!e.visible,lineCap:s.borderCapStyle,lineDash:s.borderDash,lineDashOffset:s.borderDashOffset,lineJoin:s.borderJoinStyle,lineWidth:(a.width+a.height)/4,strokeStyle:s.borderColor,pointStyle:i||s.pointStyle,rotation:s.rotation,textAlign:o||s.textAlign,borderRadius:0,datasetIndex:e.index}}),this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class zr extends Ri{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const o=i(n.text)?n.text.length:1;this._padding=gn(n.padding);const r=o*vn(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:i,right:o,options:r}=this,s=r.align;let a,l,c,d=0;return this.isHorizontal()?(l=ue(s,n,o),c=t+e,a=o-n):("left"===r.position?(l=n+e,c=ue(s,i,t),d=-.5*E):(l=o-e,c=ue(s,t,i),d=.5*E),a=i-t),{titleX:l,titleY:c,maxWidth:a,rotation:d}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=vn(t.font),i=n.lineHeight/2+this._padding.top,{titleX:o,titleY:r,maxWidth:s,rotation:a}=this._drawArgs(i);Dt(e,t.text,0,0,n,{color:t.color,maxWidth:s,rotation:a,textAlign:he(t.align),textBaseline:"middle",translation:[o,r]})}}var Nr={id:"title",_element:zr,start(e,t,n){!function(e,t){const n=new zr({ctx:e.ctx,options:t,chart:e});Jn.configure(e,n,t),Jn.addBox(e,n),e.titleBlock=n}(e,n)},stop(e){const t=e.titleBlock;Jn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Jn.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Fr=new WeakMap;var Lr={id:"subtitle",start(e,t,n){const i=new zr({ctx:e.ctx,options:n,chart:e});Jn.configure(e,i,n),Jn.addBox(e,i),Fr.set(e,i)},stop(e){Jn.removeBox(e,Fr.get(e)),Fr.delete(e)},beforeUpdate(e,t,n){const i=Fr.get(e);Jn.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const jr={average(e){if(!e.length)return!1;let t,n,i=0,o=0,r=0;for(t=0,n=e.length;t<n;++t){const n=e[t].element;if(n&&n.hasValue()){const e=n.tooltipPosition();i+=e.x,o+=e.y,++r}}return{x:i/r,y:o/r}},nearest(e,t){if(!e.length)return!1;let n,i,o,r=t.x,s=t.y,a=Number.POSITIVE_INFINITY;for(n=0,i=e.length;n<i;++n){const i=e[n].element;if(i&&i.hasValue()){const e=K(t,i.getCenterPoint());e<a&&(a=e,o=i)}}if(o){const e=o.tooltipPosition();r=e.x,s=e.y}return{x:r,y:s}}};function Br(e,t){return t&&(i(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Hr(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Ur(e,t){const{element:n,datasetIndex:i,index:o}=t,r=e.getDatasetMeta(i).controller,{label:s,value:a}=r.getLabelAndValue(o);return{chart:e,label:s,parsed:r.getParsed(o),raw:e.data.datasets[i].data[o],formattedValue:a,dataset:r.getDataset(),dataIndex:o,datasetIndex:i,element:n}}function $r(e,t){const n=e.chart.ctx,{body:i,footer:o,title:r}=e,{boxWidth:s,boxHeight:a}=t,l=vn(t.bodyFont),c=vn(t.titleFont),d=vn(t.footerFont),u=r.length,p=o.length,f=i.length,m=gn(t.padding);let g=m.height,v=0,b=i.reduce(((e,t)=>e+t.before.length+t.lines.length+t.after.length),0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(g+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){g+=f*(t.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}p&&(g+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let y=0;const x=function(e){v=Math.max(v,n.measureText(e).width+y)};return n.save(),n.font=c.string,h(e.title,x),n.font=l.string,h(e.beforeBody.concat(e.afterBody),x),y=t.displayColors?s+2+t.boxPadding:0,h(i,(e=>{h(e.before,x),h(e.lines,x),h(e.after,x)}
vendor: 15,109 bytes, line 175
175)),y=0,n.font=d.string,h(e.footer,x),n.restore(),v+=m.width,{width:v,height:g}}function qr(e,t,n,i){const{x:o,width:r}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return"center"===i?c=o<=(a+l)/2?"left":"right":o<=r/2?c="left":o>=s-r/2&&(c="right"),function(e,t,n,i){const{x:o,width:r}=i,s=n.caretSize+n.caretPadding;return"left"===e&&o+r+s>t.width||"right"===e&&o-r-s<0||void 0}(c,e,t,n)&&(c="center"),c}function Wr(e,t,n){const i=n.yAlign||t.yAlign||function(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||qr(e,t,n,i),yAlign:i}}function Vr(e,t,n,i){const{caretSize:o,caretPadding:r,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+r,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:p}=mn(s);let f=function(e,t){let{x:n,width:i}=e;return"right"===t?n-=i:"center"===t&&(n-=i/2),n}(t,a);const m=function(e,t,n){let{y:i,height:o}=e;return"top"===t?i+=n:i-="bottom"===t?o+n:o/2,i}(t,l,c);return"center"===l?"left"===a?f+=c:"right"===a&&(f-=c):"left"===a?f-=Math.max(d,u)+o:"right"===a&&(f+=Math.max(h,p)+o),{x:Q(f,0,i.width-t.width),y:Q(m,0,i.height-t.height)}}function Kr(e,t,n){const i=gn(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-i.right:e.x+i.left}function Gr(e){return Br([],Hr(e))}function Xr(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}class Yr extends Ri{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&t.options.animation&&n.animations,o=new wi(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=(e=this.chart.getContext(),t=this,n=this._tooltipItems,xn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})));var e,t,n}getTitle(e,t){const{callbacks:n}=t,i=n.beforeTitle.apply(this,[e]),o=n.title.apply(this,[e]),r=n.afterTitle.apply(this,[e]);let s=[];return s=Br(s,Hr(i)),s=Br(s,Hr(o)),s=Br(s,Hr(r)),s}getBeforeBody(e,t){return Gr(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:n}=t,i=[];return h(e,(e=>{const t={before:[],lines:[],after:[]},o=Xr(n,e);Br(t.before,Hr(o.beforeLabel.call(this,e))),Br(t.lines,o.label.call(this,e)),Br(t.after,Hr(o.afterLabel.call(this,e))),i.push(t)})),i}getAfterBody(e,t){return Gr(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:n}=t,i=n.beforeFooter.apply(this,[e]),o=n.footer.apply(this,[e]),r=n.afterFooter.apply(this,[e]);let s=[];return s=Br(s,Hr(i)),s=Br(s,Hr(o)),s=Br(s,Hr(r)),s}_createItems(e){const t=this._active,n=this.chart.data,i=[],o=[],r=[];let s,a,l=[];for(s=0,a=t.length;s<a;++s)l.push(Ur(this.chart,t[s]));return e.filter&&(l=l.filter(((t,i,o)=>e.filter(t,i,o,n)))),e.itemSort&&(l=l.sort(((t,i)=>e.itemSort(t,i,n)))),h(l,(t=>{const n=Xr(e.callbacks,t);i.push(n.labelColor.call(this,t)),o.push(n.labelPointStyle.call(this,t)),r.push(n.labelTextColor.call(this,t))})),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),i=this._active;let o,r=[];if(i.length){const e=jr[n.position].call(this,i,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const t=this._size=$r(this,n),s=Object.assign({},e,t),a=Wr(this.chart,n,s),l=Vr(n,s,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,o={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,i){const o=this.getCaretPosition(e,n,i);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,n){const{xAlign:i,yAlign:o}=this,{caretSize:r,cornerRadius:s}=n,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:d}=mn(s),{x:h,y:u}=e,{width:p,height:f}=t;let m,g,v,b,y,x;return"center"===o?(y=u+f/2,"left"===i?(m=h,g=m-r,b=y+r,x=y-r):(m=h+p,g=m+r,b=y-r,x=y+r),v=m):(g="left"===i?h+Math.max(a,c)+r:"right"===i?h+p-Math.max(l,d)-r:this.caretX,"top"===o?(b=u,y=b-r,m=g-r,v=g+r):(b=u+f,y=b+r,m=g+r,v=g-r),x=b),{x1:m,x2:g,x3:v,y1:b,y2:y,y3:x}}drawTitle(e,t,n){const i=this.title,o=i.length;let r,s,a;if(o){const l=wn(n.rtl,this.x,this.width);for(e.x=Kr(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",r=vn(n.titleFont),s=n.titleSpacing,t.fillStyle=n.titleColor,t.font=r.string,a=0;a<o;++a)t.fillText(i[a],l.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+s,a+1===o&&(e.y+=n.titleMarginBottom-s)}}_drawColorBox(e,t,n,i,r){const s=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c,boxPadding:d}=r,h=vn(r.bodyFont),u=Kr(this,"left",r),p=i.x(u),f=l<h.lineHeight?(h.lineHeight-l)/2:0,m=t.y+f;if(r.usePointStyle){const t={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=i.leftForLtr(p,c)+c/2,o=m+l/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,kt(e,t,n,o),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,kt(e,t,n,o)}else{e.lineWidth=o(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const t=i.leftForLtr(p,c-d),n=i.leftForLtr(i.xPlus(p,1),c-d-2),a=mn(s.borderRadius);Object.values(a).some((e=>0!==e))?(e.beginPath(),e.fillStyle=r.multiKeyBackground,Pt(e,{x:t,y:m,w:c,h:l,radius:a}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),Pt(e,{x:n,y:m+1,w:c-2,h:l-2,radius:a}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(t,m,c,l),e.strokeRect(t,m,c,l),e.fillStyle=s.backgroundColor,e.fillRect(n,m+1,c-2,l-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:i}=this,{bodySpacing:o,bodyAlign:r,displayColors:s,boxHeight:a,boxWidth:l,boxPadding:c}=n,d=vn(n.bodyFont);let u=d.lineHeight,p=0;const f=wn(n.rtl,this.x,this.width),m=function(n){t.fillText(n,f.x(e.x+p),e.y+u/2),e.y+=u+o},g=f.textAlign(r);let v,b,y,x,w,_,k;for(t.textAlign=r,t.textBaseline="middle",t.font=d.string,e.x=Kr(this,g,n),t.fillStyle=n.bodyColor,h(this.beforeBody,m),p=s&&"right"!==g?"center"===r?l/2+c:l+2+c:0,x=0,_=i.length;x<_;++x){for(v=i[x],b=this.labelTextColors[x],t.fillStyle=b,h(v.before,m),y=v.lines,s&&y.length&&(this._drawColorBox(t,e,x,f,n),u=Math.max(d.lineHeight,a)),w=0,k=y.length;w<k;++w)m(y[w]),u=d.lineHeight;h(v.after,m)}p=0,u=d.lineHeight,h(this.afterBody,m),e.y-=o}drawFooter(e,t,n){const i=this.footer,o=i.length;let r,s;if(o){const a=wn(n.rtl,this.x,this.width);for(e.x=Kr(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=a.textAlign(n.footerAlign),t.textBaseline="middle",r=vn(n.footerFont),t.fillStyle=n.footerColor,t.font=r.string,s=0;s<o;++s)t.fillText(i[s],a.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+n.footerSpacing}}drawBackground(e,t,n,i){const{xAlign:o,yAlign:r}=this,{x:s,y:a}=e,{width:l,height:c}=n,{topLeft:d,topRight:h,bottomLeft:u,bottomRight:p}=mn(i.cornerRadius);t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.beginPath(),t.moveTo(s+d,a),"top"===r&&this.drawCaret(e,t,n,i),t.lineTo(s+l-h,a),t.quadraticCurveTo(s+l,a,s+l,a+h),"center"===r&&"right"===o&&this.drawCaret(e,t,n,i),t.lineTo(s+l,a+c-p),t.quadraticCurveTo(s+l,a+c,s+l-p,a+c),"bottom"===r&&this.drawCaret(e,t,n,i),t.lineTo(s+u,a+c),t.quadraticCurveTo(s,a+c,s,a+c-u),"center"===r&&"left"===o&&this.drawCaret(e,t,n,i),t.lineTo(s,a+d),t.quadraticCurveTo(s,a,s+d,a),t.closePath(),t.fill(),i.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,i=n&&n.x,o=n&&n.y;if(i||o){const n=jr[e.position].call(this,this._active,this._eventPosition);if(!n)return;const r=this._size=$r(this,e),s=Object.assign({},n,this._size),a=Wr(t,e,s),l=Vr(e,s,a,t);i._to===l.x&&o._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=r.width,this.height=r.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=gn(t.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&s&&(e.save(),e.globalAlpha=n,this.drawBackground(o,e,i,t),_n(e,t.textDirection),o.y+=r.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),kn(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,i=e.map((({datasetIndex:e,index:t})=>{const n=this.chart.getDatasetMeta(e);if(!n)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[t],index:t}})),o=!u(n,i),r=this._positionChanged(i,t);(o||r)&&(this._active=i,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],r=this._getActiveElements(e,o,t,n),s=this._positionChanged(r,e),a=t||!u(r,o)||s;return a&&(this._active=r,(i.enabled||i.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,n,i){const o=this.options;if("mouseout"===e.type)return[];if(!i)return t;const r=this.chart.getElementsAtEventForMode(e,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(e,t){const{caretX:n,caretY:i,options:o}=this,r=jr[o.position].call(this,e,t);return!1!==r&&(n!==r.x||i!==r.y)}}Yr.positioners=jr;var Qr={id:"tooltip",_element:Yr,positioners:jr,afterInit(e,t,n){n&&(e.tooltip=new Yr({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",n))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:e,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:e,beforeBody:e,beforeLabel:e,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const i=e.formattedValue;return n(i)||(t+=i),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:e,afterBody:e,beforeFooter:e,footer:e,afterFooter:e}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Jr=Object.freeze({__proto__:null,Decimation:fr,Filler:Ir,Legend:Rr,SubTitle:Lr,Title:Nr,Tooltip:Qr});function Zr(e,t,n,i){const o=e.indexOf(t);if(-1===o)return((e,t,n,i)=>("string"==typeof t?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n))(e,t,n,i);return o!==e.lastIndexOf(t)?n:o}class es extends Wi{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:n,label:i}of t)e[n]===i&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(n(e))return null;const i=this.getLabels();return((e,t)=>null===e?null:Q(Math.round(e),0,t))(t=isFinite(t)&&i[t]===e?t:Zr(i,e,a(t,e),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,i=[];let o=this.getLabels();o=0===e&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)i.push({value:n});return i}getLabelForValue(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function ts(e,t,{horizontal:n,minRotation:i}){const o=$(i),r=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/r,s)}es.id="category",es.defaults={ticks:{callback:es.prototype.getLabelForValue}};
vendor: 4,451 bytes, line 175
175class ns extends Wi{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return n(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:o}=this;const r=e=>i=t?i:e,s=e=>o=n?o:e;if(e){const e=N(i),t=N(o);e<0&&t<0?s(0):e>0&&t>0&&r(0)}if(i===o){let t=1;(o>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(t=Math.abs(.05*o)),s(o+t),e||r(i-t)}this.min=i,this.max=o}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:n,stepSize:i}=e;return i?(t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const o=function(e,t){const i=[],{bounds:o,step:r,min:s,max:a,precision:l,count:c,maxTicks:d,maxDigits:h,includeBounds:u}=e,p=r||1,f=d-1,{min:m,max:g}=t,v=!n(s),b=!n(a),y=!n(c),x=(g-m)/(h+1);let w,_,k,C,S=F((g-m)/f/p)*p;if(S<1e-14&&!v&&!b)return[{value:m},{value:g}];C=Math.ceil(g/S)-Math.floor(m/S),C>f&&(S=F(C*S/f/p)*p),n(l)||(w=Math.pow(10,l),S=Math.ceil(S*w)/w),"ticks"===o?(_=Math.floor(m/S)*S,k=Math.ceil(g/S)*S):(_=m,k=g),v&&b&&r&&H((a-s)/r,S/1e3)?(C=Math.round(Math.min((a-s)/S,d)),S=(a-s)/C,_=s,k=a):y?(_=v?s:_,k=b?a:k,C=c-1,S=(k-_)/C):(C=(k-_)/S,C=B(C,Math.round(C),S/1e3)?Math.round(C):Math.ceil(C));const T=Math.max(W(S),W(_));w=Math.pow(10,n(l)?T:l),_=Math.round(_*w)/w,k=Math.round(k*w)/w;let E=0;for(v&&(u&&_!==s?(i.push({value:s}),_<s&&E++,B(Math.round((_+E*S)*w)/w,s,ts(s,x,e))&&E++):_<s&&E++);E<C;++E)i.push({value:Math.round((_+E*S)*w)/w});return b&&u&&k!==a?i.length&&B(i[i.length-1].value,a,ts(a,x,e))?i[i.length-1].value=a:i.push({value:a}):b&&k!==a||i.push({value:k}),i}({maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&U(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const i=(n-t)/Math.max(e.length-1,1)/2;t-=i,n+=i}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return cn(e,this.chart.options.locale,this.options.ticks.format)}}class is extends ns{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=r(e)?e:0,this.max=r(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=$(this.options.ticks.minRotation),i=(e?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/i))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}function os(e){return 1===e/Math.pow(10,Math.floor(z(e)))}is.id="linear",is.defaults={ticks:{callback:Ni.formatters.numeric}};class rs extends Wi{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const n=ns.prototype.parse.apply(this,[e,t]);if(0!==n)return r(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=r(e)?Math.max(0,e):null,this.max=r(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,i=this.max;const o=t=>n=e?n:t,r=e=>i=t?i:e,s=(e,t)=>Math.pow(10,Math.floor(z(e))+t);n===i&&(n<=0?(o(1),r(10)):(o(s(n,-1)),r(s(i,1)))),n<=0&&o(s(i,-1)),i<=0&&r(s(n,1)),this._zero&&this.min!==this._suggestedMin&&n===s(this.min,0)&&o(s(n,-1)),this.min=n,this.max=i}buildTicks(){const e=this.options,t=function(e,t){const n=Math.floor(z(t.max)),i=Math.ceil(t.max/Math.pow(10,n)),o=[];let r=s(e.min,Math.pow(10,Math.floor(z(t.min)))),a=Math.floor(z(r)),l=Math.floor(r/Math.pow(10,a)),c=a<0?Math.pow(10,Math.abs(a)
175):1;do{o.push({value:r,major:os(r)}),++l,10===l&&(l=1,++a,c=a>=0?1:c),r=Math.round(l*Math.pow(10,a)*c)/c}while(a<n||a===n&&l<i);const d=s(e.max,r);return o.push({value:d,major:os(r)}),o}({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&U(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":cn(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=z(e),this._valueRange=z(this.max)-z(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(z(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function ss(e){const t=e.ticks;if(t.display&&e.display){const e=gn(t.backdropPadding);return a(t.font&&t.font.size,ot.font.size)+e.height}return 0}function as(e,t,n,i,o){return e===i||e===o?{start:t-n/2,end:t+n/2}:e<i||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function ls(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),o=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,l=a.centerPointLabels?E/s:0;for(let u=0;u<s;u++){const s=a.setContext(e.getPointLabelContext(u));r[u]=s.padding;const p=e.getPointPosition(u,e.drawingArea+r[u],l),f=vn(s.font),m=(c=e.ctx,d=f,h=i(h=e._pointLabels[u])?h:[h],{w:xt(c,d.string,h),h:h.length*d.lineHeight});o[u]=m;const g=X(e.getIndexAngle(u)+l),v=Math.round(q(g));cs(n,t,g,as(v,p.x,m.w,0,180),as(v,p.y,m.h,90,270))}var c,d,h;e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=function(e,t,n){const i=[],o=e._pointLabels.length,r=e.options,s=ss(r)/2,a=e.drawingArea,l=r.pointLabels.centerPointLabels?E/o:0;for(let r=0;r<o;r++){const o=e.getPointPosition(r,a+s+n[r],l),c=Math.round(q(X(o.angle+P))),d=t[r],h=us(o.y,d.h,c),u=ds(c),p=hs(o.x,d.w,u);i.push({x:o.x,y:h,textAlign:u,left:p,top:h,right:p+d.w,bottom:h+d.h})}return i}(e,o,r)}function cs(e,t,n,i,o){const r=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,e.l=Math.min(e.l,t.l-a)):i.end>
vendor: 4,134 bytes, line 175
175t.r&&(a=(i.end-t.r)/r,e.r=Math.max(e.r,t.r+a)),o.start<t.t?(l=(t.t-o.start)/s,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function ds(e){return 0===e||180===e?"center":e<180?"left":"right"}function hs(e,t,n){return"right"===n?e-=t:"center"===n&&(e-=t/2),e}function us(e,t,n){return 90===n||270===n?e-=t/2:(n>270||n<90)&&(e-=t),e}function ps(e,t,n,i){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,A);else{let n=e.getPointPosition(0,t);o.moveTo(n.x,n.y);for(let r=1;r<i;r++)n=e.getPointPosition(r,t),o.lineTo(n.x,n.y)}}rs.id="logarithmic",rs.defaults={ticks:{callback:Ni.formatters.logarithmic,major:{enabled:!0}}};class fs extends ns{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=gn(ss(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=r(e)&&!isNaN(e)?e:0,this.max=r(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ss(this.options))}generateTickLabels(e){ns.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map(((e,t)=>{const n=d(this.options.pointLabels.callback,[e,t],this);return n||0===n?n:""})).filter(((e,t)=>this.chart.getDataVisibility(t)))}fit(){const e=this.options;e.display&&e.pointLabels.display?ls(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,i){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,i))}getIndexAngle(e){return X(e*(A/(this._pointLabels.length||1))+$(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(n(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(n(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const n=t[e];return function(e,t,n){return xn(e,{label:n,index:t,type:"pointLabel"})}(this.getContext(),e,n)}}getPointPosition(e,t,n=0){const i=this.getIndexAngle(e)-P+n;return{x:Math.cos(i)*t+this.xCenter,y:Math.sin(i)*t+this.yCenter,angle:i}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:n,right:i,bottom:o}=this._pointLabelItems[e];return{left:t,top:n,right:i,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),ps(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:o}=t,r=this._pointLabels.length;let s,a,l;if(t.pointLabels.display&&function(e,t){const{ctx:i,options:{pointLabels:o}}=e;for(let r=t-1;r>=0;r--){const t=o.setContext(e.getPointLabelContext(r)),s=vn(t.font),{x:a,y:l,textAlign:c,left:d,top:h,right:u,bottom:p}=e._pointLabelItems[r],{backdropColor:f}=t;if(!n(f)){const e=mn(t.borderRadius),n=gn(t.backdropPadding);i.fillStyle=f;const o=d-n.left,r=h-n.top,s=u-d+n.width,a=p-h+n.height;Object.values(e).some((e=>0!==e))?(i.beginPath(),Pt(i,{x:o,y:r,w:s,h:a,radius:e}),i.fill()):i.fillRect(o,r,s,a)}Dt(i,e._pointLabels[r],a,l+s.lineHeight/2,s,{color:t.color,textAlign:c,textBaseline:"middle"})}}(this,r),o.display&&this.ticks.forEach(((e,t)=>{if(0!==t){a=this.getDistanceFromCenterForValue(e.value);!function(e,t,n,i){const o=e.ctx,r=t.circular,{color:s,lineWidth:a}=t;!r&&!i||!s||!a||n<0||(o.save(),o.strokeStyle=s,o.lineWidth=a,o.setLineDash(t.borderDash),o.lineDashOffset=t.borderDashOffset,o.beginPath(),ps(e,n,r,i),o.closePath(),o.stroke(),o.restore(
vendor: 4,464 bytes, line 175
175))}(this,o.setContext(this.getContext(t-1)),a,r)}})),i.display){for(e.save(),s=r-1;s>=0;s--){const n=i.setContext(this.getPointLabelContext(s)),{color:o,lineWidth:r}=n;r&&o&&(e.lineWidth=r,e.strokeStyle=o,e.setLineDash(n.borderDash),e.lineDashOffset=n.borderDashOffset,a=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),l=this.getPointPosition(s,a),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let o,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(i),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach(((i,s)=>{if(0===s&&!t.reverse)return;const a=n.setContext(this.getContext(s)),l=vn(a.font);if(o=this.getDistanceFromCenterForValue(this.ticks[s].value),a.showLabelBackdrop){e.font=l.string,r=e.measureText(i.label).width,e.fillStyle=a.backdropColor;const t=gn(a.backdropPadding);e.fillRect(-r/2-t.left,-o-l.size/2-t.top,r+t.width,l.size+t.height)}Dt(e,i.label,0,-o,l,{color:a.color})})),e.restore()}drawTitle(){}}fs.id="radialLinear",fs.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ni.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}},fs.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},fs.descriptors={angleLines:{_fallback:"grid"}};const ms={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},gs=Object.keys(ms);function vs(e,t){return e-t}function bs(e,t){if(n(t))return null;const i=e._adapter,{parser:o,round:s,isoWeekday:a}=e._parseOpts;let l=t;return"function"==typeof o&&(l=o(l)),r(l)||(l="string"==typeof o?i.parse(l,o):i.parse(l)),null===l?null:(s&&(l="week"!==s||!j(a)&&!0!==a?i.startOf(l,s):i.startOf(l,"isoWeek",a)),+l)}function ys(e,t,n,i){const o=gs.length;for(let r=gs.indexOf(e);r<o-1;++r){const e=ms[gs[r]],o=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(o*e.size))<=i)return gs[r]}return gs[o-1]}function xs(e,t,n){if(n){if(n.length){const{lo:i,hi:o}=ee(n,t);e[n[i]>=t?n[i]:n[o]]=!0}}else e[t]=!0}function ws(e,t,n){const i=[],o={},r=t.length;let s,a;for(s=0;s<r;++s)a=t[s],o[a]=s,i.push({value:a,major:!1});return 0!==r&&n?function(e,t,n,i){const o=e._adapter,r=+o.startOf(t[0].value,i),s=t[t.length-1].value;let a,l;for(a=r;a<=s;a=+o.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}(e,i,o,n):i}class _s extends Wi{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t){const n=e.time||(e.time={}),i=this._adapter=new ko._date(e.adapters.date);i.init(t),v(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:bs(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:i,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(e){s||isNaN(e.min)||(i=Math.min(i,e.min)),a||isNaN(e.max)||(o=Math.max(o,e.max))}s&&a||(l(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||l(this.getMinMax(!1))),i=r(i)&&!isNaN(i)?i:+t.startOf(Date.now(),n),o=r(o)&&!isNaN(o)?o:+t.endOf(Date.now(),n)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,r=ie(i,o,this.max);return this._unit=t.unit||(n.autoSkip?ys(t.minUnit,this.min,this.max,this._getLabelCapacity(o)
vendor: 5,037 bytes, line 175
175):function(e,t,n,i,o){for(let r=gs.length-1;r>=gs.indexOf(n);r--){const n=gs[r];if(ms[n].common&&e._adapter.diff(o,i,n)>=t-1)return n}return gs[n?gs.indexOf(n):0]}(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(let t=gs.indexOf(e)+1,n=gs.length;t<n;++t)if(ms[gs[t]].common)return gs[t]}(this._unit):void 0,this.initOffsets(i),e.reverse&&r.reverse(),ws(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((e=>+e.value)))}initOffsets(e){let t,n,i=0,o=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),i=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,n=this.getDecimalForValue(e[e.length-1]),o=1===e.length?n:(n-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;i=Q(i,0,r),o=Q(o,0,r),this._offsets={start:i,end:o,factor:1/(i+1+o)}}_generate(){const e=this._adapter,t=this.min,n=this.max,i=this.options,o=i.time,r=o.unit||ys(o.minUnit,t,n,this._getLabelCapacity(t)),s=a(o.stepSize,1),l="week"===r&&o.isoWeekday,c=j(l)||!0===l,d={};let h,u,p=t;if(c&&(p=+e.startOf(p,"isoWeek",l)),p=+e.startOf(p,c?"day":r),e.diff(n,t,r)>1e5*s)throw new Error(t+" and "+n+" are too far apart with stepSize of "+s+" "+r);const f="data"===i.ticks.source&&this.getDataTimestamps();for(h=p,u=0;h<n;h=+e.add(h,s,r),u++)xs(d,h,f);return h!==n&&"ticks"!==i.bounds&&1!==u||xs(d,h,f),Object.keys(d).sort(((e,t)=>e-t)).map((e=>+e))}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}_tickFormatFunction(e,t,n,i){const o=this.options,r=o.time.displayFormats,s=this._unit,a=this._majorUnit,l=s&&r[s],c=a&&r[a],h=n[t],u=a&&c&&h&&h.major,p=this._adapter.format(e,i||(u?c:l)),f=o.ticks.callback;return f?d(f,[p,t,n],this):p}generateTickLabels(e){let t,n,i;for(t=0,n=e.length;t<n;++t)i=e[t],i.label=this._tickFormatFunction(i.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,i=$(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(i),r=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:n*o+s*r,h:n*r+s*o}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,i=n[t.unit]||n.millisecond,o=this._tickFormatFunction(e,0,ws(this,[e],this._majorUnit),i),r=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return s>0?s:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(e=0,t=i.length;e<t;++e)n=n.concat(i[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const i=this.getLabels();for(t=0,n=i.length;t<n;++t)e.push(bs(this,i[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ae(e.sort(vs))}}function ks(e,t,n){let i,o,r,s,a=0,l=e.length-1;n?(t>=e[a].pos&&t<=e[l].pos&&({lo:a,hi:l}=te(e,"pos",t)),({pos:i,time:r}=e[a]),({pos:o,time:s}=e[l])):(t>=e[a].time&&t<=e[l].time&&({lo:a,hi:l}=te(e,"time",t)),({time:i,pos:r}=e[a]),({time:o,pos:s}=e[l]));const c=o-i;return c?r+(s-r)*(t-i)/c:r}_s.id="time",_s.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class Cs extends _s{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=ks(t,this.min),this._tableRange=ks(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,i=[],o=[];let r,s,a,l,c;for(r=0,s=e.length;r<s;++r)l=e[r],l>=t&&l<=n&&i.push(l);if(i.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(r=0,s=i.length;r<s;++r)c=i[r+1],a=i[r-1],l=i[r],Math.round((c+a)/2)!==l&&o.push({time:l,pos:r/(s-1)});return o}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(ks(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return ks(this._table,n*this._tableRange+this._minPos,!0)}}Cs.id="timeseries",Cs.defaults=_s.defaults;var Ss=Object.freeze({__proto__:null,CategoryScale:es,LinearScale:is,LogarithmicScale:rs,RadialLinearScale:fs,TimeScale:_s,TimeSeriesScale:Cs});
vendor: 13,590 bytes, lines 175-182
175return bo.register(Bo,Ss,hr,Jr),bo.helpers={...Pn},bo._adapters=ko,bo.Animation=yi,bo.Animations=wi,bo.animator=ge,bo.controllers=Ki.controllers.items,bo.DatasetController=Mi,bo.Element=Ri,bo.elements=hr,bo.Interaction=jn,bo.layouts=Jn,bo.platforms=gi,bo.Scale=Wi,bo.Ticks=Ni,Object.assign(bo,Bo,Ss,hr,Jr,gi),bo.Chart=bo,"undefined"!=typeof window&&(window.Chart=bo),bo})),
176/*!
177 * chartjs-plugin-datalabels v2.1.0
178 * https://chartjs-plugin-datalabels.netlify.app
179 * (c) 2017-2022 chartjs-plugin-datalabels contributors
180 * Released under the MIT license
181 */
182function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("chart.js/helpers"),require("chart.js")):"function"==typeof define&&define.amd?define(["chart.js/helpers","chart.js"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).ChartDataLabels=t(e.Chart.helpers,e.Chart)}(this,(function(e,t){"use strict";var n=function(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),i=function(t){var n,i=[];for(t=[].concat(t);t.length;)"string"==typeof(n=t.pop())?i.unshift.apply(i,n.split("\n")):Array.isArray(n)?t.push.apply(t,n):e.isNullOrUndef(t)||i.unshift(""+n);return i},o=function(e,t,n){var i,o=[].concat(t),r=o.length,s=e.font,a=0;for(e.font=n.string,i=0;i<r;++i)a=Math.max(e.measureText(o[i]).width,a);return e.font=s,{height:r*n.lineHeight,width:a}},r=function(e,t,n){return Math.max(e,Math.min(t,n))},s=function(e,t){var n,i,o,r,s=e.slice(),a=[];for(n=0,o=t.length;n<o;++n)r=t[n],-1===(i=s.indexOf(r))?a.push([r,1]):s.splice(i,1);for(n=0,o=s.length;n<o;++n)a.push([s[n],-1]);return a};function a(e,t){var n=t.x,i=t.y;if(null===n)return{x:0,y:-1};if(null===i)return{x:1,y:0};var o=e.x-n,r=e.y-i,s=Math.sqrt(o*o+r*r);return{x:s?o/s:0,y:s?r/s:-1}}function l(e,t,n){var i=0;return e<n.left?i|=1:e>n.right&&(i|=2),t<n.top?i|=8:t>n.bottom&&(i|=4),i}function c(e,t){var n,i,o=t.anchor,r=e;return t.clamp&&(r=function(e,t){for(var n,i,o,r=e.x0,s=e.y0,a=e.x1,c=e.y1,d=l(r,s,t),h=l(a,c,t);d|h&&!(d&h);)8&(n=d||h)?(i=r+(a-r)*(t.top-s)/(c-s),o=t.top):4&n?(i=r+(a-r)*(t.bottom-s)/(c-s),o=t.bottom):2&n?(o=s+(c-s)*(t.right-r)/(a-r),i=t.right):1&n&&(o=s+(c-s)*(t.left-r)/(a-r),i=t.left),n===d?d=l(r=i,s=o,t):h=l(a=i,c=o,t);return{x0:r,x1:a,y0:s,y1:c}}(r,t.area)),"start"===o?(n=r.x0,i=r.y0):"end"===o?(n=r.x1,i=r.y1):(n=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),function(e,t,n,i,o){switch(o){case"center":n=i=0;break;case"bottom":n=0,i=1;break;case"right":n=1,i=0;break;case"left":n=-1,i=0;break;case"top":n=0,i=-1;break;case"start":n=-n,i=-i;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),i=Math.sin(o)}return{x:e,y:t,vx:n,vy:i}}(n,i,e.vx,e.vy,t.align)}var d=function(e,t){var n=(e.startAngle+e.endAngle)/2,i=Math.cos(n),o=Math.sin(n),r=e.innerRadius,s=e.outerRadius;return c({x0:e.x+i*r,y0:e.y+o*r,x1:e.x+i*s,y1:e.y+o*s,vx:i,vy:o},t)},h=function(e,t){var n=a(e,t.origin),i=n.x*e.options.radius,o=n.y*e.options.radius;return c({x0:e.x-i,y0:e.y-o,x1:e.x+i,y1:e.y+o,vx:n.x,vy:n.y},t)},u=function(e,t){var n=a(e,t.origin),i=e.x,o=e.y,r=0,s=0;return e.horizontal?(i=Math.min(e.x,e.base),r=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),c({x0:i,y0:o+s,x1:i+r,y1:o,vx:n.x,vy:n.y},t)},p=function(e,t){var n=a(e,t.origin);return c({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)},f=function(e){return Math.round(e*n)/n};function m(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(void 0!==n.xCenter&&void 0!==n.yCenter)return{x:n.xCenter,y:n.yCenter};var i=n.getBasePixel();return e.horizontal?{x:i,y:null}:{x:null,y:i}}function g(e,t,n){var i=n.backgroundColor,o=n.borderColor,r=n.borderWidth;(i||o&&r)&&(e.beginPath(),function(e,t,n,i,o,r){var s=Math.PI/2;if(r){var a=Math.min(r,o/2,i/2),l=t+a,c=n+a,d=t+i-a,h=n+o-a;e.moveTo(t,c),l<d&&c<h?(e.arc(l,c,a,-Math.PI,-s),e.arc(d,c,a,-s,0),e.arc(d,h,a,0,s),e.arc(l,h,a,s,Math.PI)):l<d?(e.moveTo(l,n),e.arc(d,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<h?(e.arc(l,c,a,-Math.PI,0),e.arc(l,h,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,i,o)}(e,f(t.x)+r/2,f(t.y)+r/2,f(t.w)-r,f(t.h)-r,n.borderRadius),e.closePath(),i&&(e.fillStyle=i,e.fill()),o&&r&&(e.strokeStyle=o,e.lineWidth=r,e.lineJoin="miter",e.stroke()))}function v(e,t,n){var i=e.shadowBlur,o=n.stroked,r=f(n.x),s=f(n.y),a=f(n.w);o&&e.strokeText(t,r,s,a),n.filled&&(i&&o&&(e.shadowBlur=0),e.fillText(t,r,s,a),i&&o&&(e.shadowBlur=i))}var b=function(e,t,n,i){var o=this;o._config=e,o._index=i,o._model=null,o._rects=null,o._ctx=t,o._el=n};e.merge(b.prototype,{_modelize:function(n,i,r,s){var a,l=this,c=l._index,f=e.toFont(e.resolve([r.font,{}],s,c)),g=e.resolve([r.color,t.defaults.color],s,c);return{align:e.resolve([r.align,"center"],s,c),anchor:e.resolve([r.anchor,"center"],s,c),area:s.chart.chartArea,backgroundColor:e.resolve([r.backgroundColor,null],s,c),borderColor:e.resolve([r.borderColor,null],s,c),borderRadius:e.resolve([r.borderRadius,0],s,c),borderWidth:e.resolve([r.borderWidth,0],s,c),clamp:e.resolve([r.clamp,!1],s,c),clip:e.resolve([r.clip,!1],s,c),color:g,display:n,font:f,lines:i,offset:e.resolve([r.offset,4],s,c),opacity:e.resolve([r.opacity,1],s,c),origin:m(l._el,s),padding:e.toPadding(e.resolve([r.padding,4],s,c)),positioner:(a=l._el,a instanceof t.ArcElement?d:a instanceof t.PointElement?h:a instanceof t.BarElement?u:p),rotation:e.resolve([r.rotation,0],s,c)*(Math.PI/180),size:o(l._ctx,i,f),textAlign:e.resolve([r.textAlign,"start"],s,c),textShadowBlur:e.resolve([r.textShadowBlur,0],s,c),textShadowColor:e.resolve([r.textShadowColor,g],s,c),textStrokeColor:e.resolve([r.textStrokeColor,g],s,c),textStrokeWidth:e.resolve([r.textStrokeWidth,0],s,c)}},update:function(t){var n,o,r,s=this,a=null,l=null,c=s._index,d=s._config,h=e.resolve([d.display,!0],t,c);h&&(n=t.dataset.data[c],o=e.valueOrDefault(e.callback(d.formatter,[n,t]),n),(r=e.isNullOrUndef(o)?[]:i(o)).length&&(l=function(e){var t=e.borderWidth||0,n=e.padding,i=e.size.height,o=e.size.width,r=-o/2,s=-i/2;return{frame:{x:r-n.left-t,y:s-n.top-t,w:o+n.width+2*t,h:i+n.height+2*t},text:{x:r,y:s,w:o,h:i}}}(a=s._modelize(h,r,d,t)))),s._model=a,s._rects=l},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n,i=e.ctx,o=this._model,s=this._rects;this.visible()&&(i.save(),o.clip&&(n=o.area,i.beginPath(),i.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),i.clip()),i.globalAlpha=r(0,o.opacity,1),i.translate(f(t.x),f(t.y)),i.rotate(o.rotation),g(i,s.frame,o),function(e,t,n,i){var o,r=i.textAlign,s=i.color,a=!!s,l=i.font,c=t.length,d=i.textStrokeColor,h=i.textStrokeWidth,u=d&&h;if(c&&(a||u))for(n=function(e,t,n){var i=n.lineHeight,o=e.w,r=e.x;return"center"===t?r+=o/2:"end"!==t&&"right"!==t||(r+=o),{h:i,w:o,x:r,y:e.y+i/2}}(n,r,l),e.font=l.string,e.textAlign=r,e.textBaseline="middle",e.shadowBlur=i.textShadowBlur,e.shadowColor=i.textShadowColor,a&&(e.fillStyle=s),u&&(e.lineJoin="round",e.lineWidth=h,e.strokeStyle=d),o=0,c=t.length;o<c;++o)v(e,t[o],{stroked:u,filled:a,w:n.w,x:n.x,y:n.y+n.h*o})}(i,o.lines,s.text,o),i.restore())}});var y=Number.MIN_SAFE_INTEGER||-9007199254740991,x=Number.MAX_SAFE_INTEGER||9007199254740991;function w(e,t,n){var i=Math.cos(n),o=Math.sin(n),r=t.x,s=t.y;return{x:r+i*(e.x-r)-o*(e.y-s),y:s+o*(e.x-r)+i*(e.y-s)}}function _(e,t){var n,i,o,r,s,a=x,l=y,c=t.origin;for(n=0;n<e.length;++n)o=(i=e[n]).x-c.x,r=i.y-c.y,s=t.vx*o+t.vy*r,a=Math.min(a,s),l=Math.max(l,s);return{min:a,max:l}}function k(e,t){var n=t.x-e.x,i=t.y-e.y,o=Math.sqrt(n*n+i*i);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var C=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function S(e,t,n){var i=t.positioner(e,t),o=i.vx,r=i.vy;if(!o&&!r)return{x:i.x,y:i.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),d=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),h=1/Math.max(Math.abs(o),Math.abs(r));return c*=o*h,d*=r*h,c+=t.offset*o,d+=t.offset*r,{x:i.x+c,y:i.y+d}}e.merge(C.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=t._rect;return!((e=w(e,t.center(),-t._rotation)).x<n.x-1||e.y<n.y-1||e.x>n.x+n.w+2||e.y>n.y+n.h+2)},intersects:function(e){var t,n,i,o=this._points(),r=e._points(),s=[k(o[0],o[1]),k(o[0],o[3])];for(this._rotation!==e._rotation&&s.push(k(r[0],r[1]),k(r[0],r[3])),t=0;t<s.length;++t)if(n=_(o,s[t]),i=_(r,s[t]),n.max<i.min||i.max<n.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,i=e.center();return[w({x:t.x,y:t.y},i,n),w({x:t.x+t.w,y:t.y},i,n),w({x:t.x+t.w,y:t.y+t.h},i,n),w({x:t.x,y:t.y+t.h},i,n)]}});var T={prepare:function(e){var t,n,i,o,r,s=[];for(t=0,i=e.length;t<i;++t)for(n=0,o=e[t].length;n<o;++n)r=e[t][n],s.push(r),r.$layout={_box:new C,_hidable:!1,_visible:!0,_set:t,_idx:r._index};return s.sort((function(e,t){var n=e.$layout,i=t.$layout;return n._idx===i._idx?i._set-n._set:i._idx-n._idx})),this.update(s),s},update:function(e){var t,n,i,o,r,s=!1;for(t=0,n=e.length;t<n;++t)o=(i=e[t]).model(),(r=i.$layout)._hidable=o&&"auto"===o.display,r._visible=i.visible(),s|=r._hidable;s&&function(e){var t,n,i,o,r,s,a;for(t=0,n=e.length;t<n;++t)(o=(i=e[t]).$layout)._visible&&(a=new Proxy(i._el,{get:(e,t)=>e.getProps([t],!0)[t]}),r=i.geometry(),s=S(a,i.model(),r),o._box.update(s,r,i.rotation()));(function(e,t){var n,i,o,r;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,i=n-1;i>=0&&o._visible;--i)(r=e[i].$layout)._visible&&o._box.intersects(r._box)&&t(o,r)})(e,(function(e,t){var n=e._hidable,i=t._hidable;n&&i||i?t._visible=!1:n&&(e._visible=!1)}))}(e)},lookup:function(e,t){var n,i;for(n=e.length-1;n>=0;--n)if((i=e[n].$layout)&&i._visible&&i._box.contains(t))return e[n];return null},draw:function(e,t){var n,i,o,r,s,a;for(n=0,i=t.length;n<i;++n)(r=(o=t[n]).$layout)._visible&&(s=o.geometry(),a=S(o._el,o.model(),s),r._box.update(a,s,o.rotation()),o.draw(e,a))}},E="$default";function A(t,n,i,o){if(n){var r,s=i.$context,a=i.$groups;n[a._set]&&(r=n[a._set][a._key])&&!0===e.callback(r,[s,o])&&(t.$datalabels._dirty=!0,i.update(s))}}function O(e,t){var n,i,o=e.$datalabels,r=o._listeners;if(r.enter||r.leave){if("mousemove"===t.type)i=T.lookup(o._labels,t);else if("mouseout"!==t.type)return;n=o._hovered,o._hovered=i,function(e,t,n,i,o){var r,s;(n||i)&&(n?i?n!==i&&(s=r=!0):s=!0:r=!0,s&&A(e,t.leave,n,o),r&&A(e,t.enter,i,o))}(e,r,n,i,t)}}return{id:"datalabels",defaults:{align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:function(t){if(e.isNullOrUndef(t))return null;var n,i,o,r=t;if(e.isObject(t))if(e.isNullOrUndef(t.label))if(e.isNullOrUndef(t.r))for(r="",o=0,i=(n=Object.keys(t)).length;o<i;++o)r+=(0!==o?", ":"")+n[o]+": "+t[n[o]];else r=t.r;else r=t.label;return""+r},labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},beforeInit:function(e){e.$datalabels={_actives:[]}},beforeUpdate:function(e){var t=e.$datalabels;t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(t,n,i){var o,r,s,a,l,c,d,h,u=n.index,p=t.$datalabels,f=p._datasets[u]=[],m=t.isDatasetVisible(u),g=t.data.datasets[u],v=function(t,n){var i,o,r,s=t.datalabels,a=[];return!1===s?null:(!0===s&&(s={}),n=e.merge({},[n,s]),o=n.labels||{},r=Object.keys(o),delete n.labels,r.length?r.forEach((function(t){o[t]&&a.push(e.merge({},[n,o[t],{_key:t}]))})):a.push(n),i=a.reduce((function(t,n){return e.each(n.listeners||{},(function(e,i){t[i]=t[i]||{},t[i][n._key||E]=e})),delete n.listeners,t}),{}),{labels:a,listeners:i})}(g,i),y=n.meta.data||[],x=t.ctx;for(x.save(),o=0,s=y.length;o<s;++o)if((d=y[o]).$datalabels=[],m&&d&&t.getDataVisibility(o)&&!d.skip)for(r=0,a=v.labels.length;r<a;++r)c=(l=v.labels[r])._key,(h=new b(l,x,d,o)).$groups={_set:u,_key:c||E},h.$context={active:!1,chart:t,dataIndex:o,dataset:g,datasetIndex:u},h.update(h.$context),d.$datalabels.push(h),f.push(h);x.restore(),e.merge(p._listeners,v.listeners,{merger:function(e,t,i){t[e]=t[e]||{},t[e][n.index]=i[e],p._listened=!0}})},afterUpdate:function(e){e.$datalabels._labels=T.prepare(e.$datalabels._datasets)},afterDatasetsDraw:function(e){T.draw(e,e.$datalabels._labels)},beforeEvent:function(e,t){if(e.$datalabels._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":O(e,n);break;case"click":!function(e,t){var n=e.$datalabels,i=n._listeners.click,o=i&&T.lookup(n._labels,t);o&&A(e,i,o,t)}(e,n)}}},afterEvent:function(e){var t,n,i,o,r,a,l,c=e.$datalabels,d=c._actives,h=c._actives=e.getActiveElements(),u=s(d,h);for(t=0,n=u.length;t<n;++t)if((r=u[t])[1])for(i=0,o=(l=r[0].element.$datalabels||[]).length;i<o;++i)(a=l[i]).$context.active=1===r[1],a.update(a.$context);(c._dirty||u.length)&&(T.update(c._labels),e.render()),delete c._dirty}}})),function(e){e.fn.dependentSelectBox=function(t,n){var i=function(){};"function"==typeof t&&(i=t,t=null),"function"==typeof n&&(i=n);var o=this;return o.timeout=[],o.settings=e.extend({suggestTimeout:350,dataLinkName:"dependentselectbox",dataParentsName:"dependentselectboxParents"}
182,t),this.getSignalLink=function(t){var n=t.data(o.settings.dataLinkName),i=t.data(o.settings.dataParentsName);return void 0!==n&&(e.each(i,(function(t,i){var o=e("#"+i);if(o.length>0){var r;if("checkbox"===o.prop("type"))r=o.prop("checked")?1:0;else if(!(r=e(o).val()))return;r instanceof Array?e.each(r,(function(e,i){n+="&"+t+"[]="+i})):n+="&"+t+"="+r}})),n)},this.process=function(t,n,r){var s=o.getSignalLink(r);if(0==s)return!1;e.ajax(s,{async:!1,success:function(t){var n=t.dependentselectbox;if(void 0!==n){var i=e("#"+n.id);i.empty(),!1!==n.prompt&&void 0!==n.prompt&&e("<option>").attr("value","").text(n.prompt).appendTo(i),Object.keys(n.items).length>0?(!0===n.disabledWhenEmpty&&i.prop("disabled",!1),e.each(n.items,(function(t,o){if("object"==typeof o.value){var r=e("<optgroup>").attr("label",o.key);e.each(o.value,(function(t,i){var o=e("<option>").attr("value",t).text(i.value);null!==n.value&&t==n.value&&o.attr("selected",!0),r.append(o)})),r.appendTo(i)}else{var s=e("<option>").attr("value",o.key).text(o.value);"attributes"in o&&e.each(o.attributes,(function(e,t){s.attr(e,t)})),null!==n.value&&o.key==n.value&&s.attr("selected",!0),s.appendTo(i)}}))):n.disabledWhenEmpty&&i.prop("disabled",!0),i.change()}},complete:i})},this.onChange=function(e,t,n){o.process(e,t,n)},this.onKeyup=function(e,t,n){var i=n.attr("id");null!=o.timeout[i]&&0!=o.timeout[i]&&clearTimeout(o.timeout[i]),o.timeout[i]=setTimeout((function(){o.process(e,t,n)}),o.settings.suggestTimeout)},this.each((function(){var t=e(this),n=e(t).data(o.settings.dataParentsName);e.each(n,(function(n,i){var r=e("#"+i);r.length>0&&("text"===r.prop("type")||"textarea"===r.prop("nodeName").toLowerCase()?e(r).on("keyup",(function(n){o.onKeyup(n,e(this),t)})):e(r).on("change",(function(n){o.onChange(n,e(this),t)})))}))}))}}(jQuery),function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],(function(e){return t(e)})):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,(function(e){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],i=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function r(t,r){var s=t.nodeName.toLowerCase();if(-1!==e.inArray(s,r))return-1===e.inArray(s,n)||Boolean(t.nodeValue.match(i)||t.nodeValue.match(o));for(var a=e(r).filter((function(e,t){return t instanceof RegExp})),l=0,c=a.length;l<c;l++)if(s.match(a[l]))return!0;return!1}function s(e,t,n){if(n&&"function"==typeof n)return n(e);for(var i=Object.keys(t),o=0,s=e.length;o<s;o++)for(var a=e[o].querySelectorAll("*"),l=0,c=a.length;l<c;l++){var d=a[l],h=d.nodeName.toLowerCase();if(-1!==i.indexOf(h))for(var u=[].slice.call(d.attributes),p=[].concat(t["*"]||[],t[h]||[]),f=0,m=u.length;f<m;f++){var g=u[f];r(g,p)||d.removeAttribute(g.nodeName)}else d.parentNode.removeChild(d)}}"classList"in document.createElement("_")||function(t){if("Element"in t){var n="classList",i="prototype",o=t.Element[i],r=Object,s=function(){var t=e(this);return{add:function(e){return e=Array.prototype.slice.call(arguments).join(" "),t.addClass(e)},remove:function(e){return e=Array.prototype.slice.call(arguments).join(" "),t.removeClass(e)},toggle:function(e,n){return t.toggleClass(e,n)},contains:function(e){return t.hasClass(e)}}};if(r.defineProperty){var a={get:s,enumerable:!0,configurable:!0};try{r.defineProperty(o,n,a)}catch(t){void 0!==t.number&&-2146823252!==t.number||(a.enumerable=!1,r.defineProperty(o,n,a))}}else r[i].__defineGetter__&&o.__defineGetter__(n,s)}}(window);var a,l,c=document.createElement("_");if(c.classList.add("c1","c2"),!c.classList.contains("c2")){var d=DOMTokenList.prototype.add,h=DOMTokenList.prototype.remove;DOMTokenList.prototype.add=function(){Array.prototype.forEach.call(arguments,d.bind(this))},DOMTokenList.prototype.remove=function(){Array.prototype.forEach.call(arguments,h.bind(this))}}if(c.classList.toggle("c3",!1),c.classList.contains("c3")){var u=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:u.call(this,e)}}function p(e){if(null==this)throw new TypeError;var t=String(this);if(e&&"[object RegExp]"==l.call(e))throw new TypeError;var n=t.length,i=String(e),o=i.length,r=1<arguments.length?arguments[1]:void 0,s=r?Number(r):0;s!=s&&(s=0);var a=Math.min(Math.max(s,0),n);if(n<o+a)return!1;for(var c=-1;++c<o;)if(t.charCodeAt(a+c)!=i.charCodeAt(c))return!1;return!0}function f(e,t){var n,i=e.selectedOptions,o=[];if(t){for(var r=0,s=i.length;r<s;r++)(n=i[r]).disabled||"OPTGROUP"===n.parentNode.tagName&&n.parentNode.disabled||o.push(n);return o}return i}function m(e,t){for(var n,i=[],o=t||e.selectedOptions,r=0,s=o.length;r<s;r++)(n=o[r]).disabled||"OPTGROUP"===n.parentNode.tagName&&n.parentNode.disabled||i.push(n.value);return e.multiple?i:i.length?i[0]:null}c=null,String.prototype.startsWith||(a=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(e){}return n}(),l={}.toString,a?a(String.prototype,"startsWith",{value:p,configurable:!0,writable:!0}):String.prototype.startsWith=p),Object.keys||(Object.keys=function(e,t,n){for(t in n=[],e)n.hasOwnProperty.call(e,t)&&n.push(t);return n}),HTMLSelectElement&&!HTMLSelectElement.prototype.hasOwnProperty("selectedOptions")&&Object.defineProperty(HTMLSelectElement.prototype,"selectedOptions",{get:function(){return this.querySelectorAll(":checked")}});var g={useDefault:!1,_set:e.valHooks.select.set};e.valHooks.select.set=function(t,n){return n&&!g.useDefault&&e(t).data("selected",!0),g._set.apply(this,arguments)};var v=null,b=function(){try{return new Event("change"),!0}catch(e){return!1}}();function y(e,t,n,i){for(var o=["display","subtext","tokens"],r=!1,s=0;s<o.length;s++){var a=o[s],l=e[a];if(l&&(l=l.toString(),"display"===a&&(l=l.replace(/<[^>]+>/g,"")),i&&(l=S(l)),l=l.toUpperCase(),r="contains"===n?0<=l.indexOf(t):l.startsWith(t)))break}return r}function x(e){return parseInt(e,10)||0}e.fn.triggerNative=function(e){var t,n=this[0];n.dispatchEvent?(b?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),n.dispatchEvent(t)):n.fireEvent?((t=document.createEventObject()).eventType=e,n.fireEvent("on"+e,t)):this.trigger(e)};var w=
vendor: 1,721 bytes, line 182
182{"À":"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"}
vendor: 35,390 bytes, line 182
182,_=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,k=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function C(e){return w[e]}function S(e){return(e=e.toString())&&e.replace(_,C).replace(k,"")}var T,E,A,O,D=(T={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},E="(?:"+Object.keys(T).join("|")+")",A=RegExp(E),O=RegExp(E,"g"),function(e){return e=null==e?"":""+e,A.test(e)?e.replace(O,I):e});function I(e){return T[e]}var P={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},M={success:!1,major:"3"};try{M.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),M.major=M.full[0],M.success=!0}catch(e){}var R=0,z=".bs.select",N={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},F={MENU:"."+N.MENU},L={span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};L.a.setAttribute("role","option"),"4"===M.major&&(L.a.className="dropdown-item"),L.subtext.className="text-muted",L.text=L.span.cloneNode(!1),L.text.className="text",L.checkMark=L.span.cloneNode(!1);var j=new RegExp("38|40"),B=new RegExp("^9$|27"),H={li:function(e,t,n){var i=L.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?i.appendChild(e):i.innerHTML=e),void 0!==t&&""!==t&&(i.className=t),null!=n&&i.classList.add("optgroup-"+n),i},a:function(e,t,n){var i=L.a.cloneNode(!0);return e&&(11===e.nodeType?i.appendChild(e):i.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&i.classList.add.apply(i.classList,t.split(" ")),n&&i.setAttribute("style",n),i},text:function(e,t){var n,i,o=L.text.cloneNode(!1);if(e.content)o.innerHTML=e.content;else{if(o.textContent=e.text,e.icon){var r=L.whitespace.cloneNode(!1);(i=(!0===t?L.i:L.span).cloneNode(!1)).className=this.options.iconBase+" "+e.icon,L.fragment.appendChild(i),L.fragment.appendChild(r)}e.subtext&&((n=L.subtext.cloneNode(!1)).textContent=e.subtext,o.appendChild(n))}if(!0===t)for(;0<o.childNodes.length;)L.fragment.appendChild(o.childNodes[0]);else L.fragment.appendChild(o);return L.fragment},label:function(e){var t,n,i=L.text.cloneNode(!1);if(i.innerHTML=e.display,e.icon){var o=L.whitespace.cloneNode(!1);(n=L.span.cloneNode(!1)).className=this.options.iconBase+" "+e.icon,L.fragment.appendChild(n),L.fragment.appendChild(o)}return e.subtext&&((t=L.subtext.cloneNode(!1)).textContent=e.subtext,i.appendChild(t)),L.fragment.appendChild(i),L.fragment}},U=function(t,n){var i=this;g.useDefault||(e.valHooks.select.set=g._set,g.useDefault=!0),this.$element=e(t),this.$newElement=null,this.$button=null,this.$menu=null,this.options=n,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){i.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var o=this.options.windowPadding;"number"==typeof o&&(this.options.windowPadding=[o,o,o,o]),this.val=U.prototype.val,this.render=U.prototype.render,this.refresh=U.prototype.refresh,this.setStyle=U.prototype.setStyle,this.selectAll=U.prototype.selectAll,this.deselectAll=U.prototype.deselectAll,this.destroy=U.prototype.destroy,this.remove=U.prototype.remove,this.show=U.prototype.show,this.hide=U.prototype.hide,this.init()};function $(n){var i,o=arguments,r=n;if([].shift.apply(o),!M.success){try{M.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(n){U.BootstrapVersion?M.full=U.BootstrapVersion.split(" ")[0].split("."):(M.full=[M.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",n))}M.major=M.full[0],M.success=!0}if("4"===M.major){var s=[];U.DEFAULTS.style===N.BUTTONCLASS&&s.push({name:"style",className:"BUTTONCLASS"}),U.DEFAULTS.iconBase===N.ICONBASE&&s.push({name:"iconBase",className:"ICONBASE"}),U.DEFAULTS.tickIcon===N.TICKICON&&s.push({name:"tickIcon",className:"TICKICON"}),N.DIVIDER="dropdown-divider",N.SHOW="show",N.BUTTONCLASS="btn-light",N.POPOVERHEADER="popover-header",N.ICONBASE="",N.TICKICON="bs-ok-default";for(var a=0;a<s.length;a++)n=s[a],U.DEFAULTS[n.name]=N[n.className]}var l=this.each((function(){var n=e(this);if(n.is("select")){var s=n.data("selectpicker"),a="object"==typeof r&&r;if(s){if(a)for(var l in a)a.hasOwnProperty(l)&&(s.options[l]=a[l])}else{var c=n.data();for(var d in c)c.hasOwnProperty(d)&&-1!==e.inArray(d,t)&&delete c[d];var h=e.extend({},U.DEFAULTS,e.fn.selectpicker.defaults||{},c,a);h.template=e.extend({},U.DEFAULTS.template,e.fn.selectpicker.defaults?e.fn.selectpicker.defaults.template:{},c.template,a.template),n.data("selectpicker",s=new U(this,h))}"string"==typeof r&&(i=s[r]instanceof Function?s[r].apply(s,o):s.options[r])}}));return void 0!==i?i:l}U.VERSION="1.13.14",U.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(e,t){return 1==e?"{0} item selected":"{0} items selected"},maxOptionsText:function(e,t){return[1==e?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==t?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:N.BUTTONCLASS,size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:N.ICONBASE,tickIcon:N.TICKICON,showTick:!1,template:{caret:'<span class="caret"></span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}},U.prototype={constructor:U,init:function(){var e=this,t=this.$element.attr("id");R++,this.selectId="bs-select-"+R,this.$element[0].classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$element[0].classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(F.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element[0].classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(N.MENURIGHT),void 0!==t&&this.$button.attr("data-id",t),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide"+z,(function(){if(e.isVirtual()){var t=e.$menuInner[0],n=t.firstChild.cloneNode(!1);t.replaceChild(n,t.firstChild),t.scrollTop=0}})),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(t){e.$element.trigger("hide"+z,t)},"hidden.bs.dropdown":function(t){e.$element.trigger("hidden"+z,t)},"show.bs.dropdown":function(t){e.$element.trigger("show"+z,t)},"shown.bs.dropdown":function(t){e.$element.trigger("shown"+z,t)}}),e.$element[0].hasAttribute("required")&&this.$element.on("invalid"+z,(function(){e.$button[0].classList.add("bs-invalid"),e.$element.on("shown"+z+".invalid",(function(){e.$element.val(e.$element.val()).off("shown"+z+".invalid")})).on("rendered"+z,(function(){this.validity.valid&&e.$button[0].classList.remove("bs-invalid"),e.$element.off("rendered"+z)})),e.$button.on("blur"+z,(function(){e.$element.trigger("focus").trigger("blur"),e.$button.off("blur"+z)}))})),setTimeout((function(){e.buildList(),e.$element.trigger("loaded"+z)}))},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",n=this.multiple?' aria-multiselectable="true"':"",i="",o=this.autofocus?" autofocus":"";M.major<4&&this.$element.parent().hasClass("input-group")&&(i=" input-group-btn");var r,s="",a="",l="",c="";return this.options.header&&(s='<div class="'+N.POPOVERHEADER+'"><button type="button" class="close" aria-hidden="true">&times;</button>'+this.options.header+"</div>"),this.options.liveSearch&&(a='<div class="bs-searchbox"><input type="search" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+D(this.options.liveSearchPlaceholder)+'"')+' role="combobox" aria-label="Search" aria-controls="'+this.selectId+'" aria-autocomplete="list"></div>'),this.multiple&&this.options.actionsBox&&(l='<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn '+N.BUTTONCLASS+'">'+this.options.selectAllText+'</button><button type="button" class="actions-btn bs-deselect-all btn '+N.BUTTONCLASS+'">'+this.options.deselectAllText+"</button></div></div>"),this.multiple&&this.options.doneButton&&(c='<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm '+N.BUTTONCLASS+'">'+this.options.doneButtonText+"</button></div></div>"),r='<div class="dropdown bootstrap-select'+t+i+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" '+("static"===this.options.display?'data-display="static"':"")+'data-toggle="dropdown"'+o+' role="combobox" aria-owns="'+this.selectId+'" aria-haspopup="listbox" aria-expanded="false"><div class="filter-option"><div class="filter-option-inner"><div class="filter-option-inner-inner"></div></div> </div>'+("4"===M.major?"":'<span class="bs-caret">'+this.options.template.caret+"</span>")+'</button><div class="'+N.MENU+" "+("4"===M.major?"":N.SHOW)+'">'+s+a+l+'<div class="inner '+N.SHOW+'" role="listbox" id="'+this.selectId+'" tabindex="-1" '+n+'><ul class="'+N.MENU+" inner "+("4"===M.major?N.SHOW:"")+'" role="presentation"></ul></div>'+c+"</div></div>",e(r)},setPositionData:function(){this.selectpicker.view.canHighlight=[];for(var e=this.selectpicker.view.size=0;e<this.selectpicker.current.data.length;e++){var t=this.selectpicker.current.data[e],n=!0;"divider"===t.type?(n=!1,t.height=this.sizeInfo.dividerHeight):"optgroup-label"===t.type?(n=!1,t.height=this.sizeInfo.dropdownHeaderHeight):t.height=this.sizeInfo.liHeight,t.disabled&&(n=!1),this.selectpicker.view.canHighlight.push(n),n&&(this.selectpicker.view.size++,t.posinset=this.selectpicker.view.size),t.position=(0===e?0:this.selectpicker.current.data[e-1].position)+t.height}},isVirtual:function(){return!1!==this.options.virtualScroll&&this.selectpicker.main.elements.length>=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(t,n,i){var o,r,a=this,l=0,c=[];if(this.selectpicker.isSearching=t,this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),n)if(i)l=this.$menuInner[0].scrollTop;else if(!a.multiple){var d=a.$element[0],h=(d.options[d.selectedIndex]||{}).liIndex;if("number"==typeof h&&!1!==a.options.size){var u=a.selectpicker.main.data[h],p=u&&u.position;p&&(l=p-(a.sizeInfo.menuInnerHeight+a.sizeInfo.liHeight)/2)}}function f(e,n){var i,l,d,h,u,p,f,m,g=a.selectpicker.current.elements.length,v=[],b=!0,y=a.isVirtual();a.selectpicker.view.scrollTop=e,i=Math.ceil(a.sizeInfo.menuInnerHeight/a.sizeInfo.liHeight*1.5),l=Math.round(g/i)||1;for(var x=0;x<l;x++){var w=(x+1)*i;if(x===l-1&&(w=g),v[x]=[x*i+(x?1:0),w],!g)break;void 0===u&&e-1<=a.selectpicker.current.data[w-1].position-a.sizeInfo.menuInnerHeight&&(u=x)}if(void 0===u&&(u=0),p=[a.selectpicker.view.position0,a.selectpicker.view.position1],d=Math.max(0,u-1),h=Math.min(l-1,u+1),a.selectpicker.view.position0=!1===y?0:Math.max(0,v[d][0])||0,a.selectpicker.view.position1=!1===y?g:Math.min(g,v[h][1])||0,f=p[0]!==a.selectpicker.view.position0||p[1]!==a.selectpicker.view.position1,void 0!==a.activeIndex&&(r=a.selectpicker.main.elements[a.prevActiveIndex],c=a.selectpicker.main.elements[a.activeIndex],o=a.selectpicker.main.elements[a.selectedIndex],n&&(a.activeIndex!==a.selectedIndex&&a.defocusItem(c),a.activeIndex=void 0),a.activeIndex&&a.activeIndex!==a.selectedIndex&&a.defocusItem(o)),void 0!==a.prevActiveIndex&&a.prevActiveIndex!==a.activeIndex&&a.prevActiveIndex!==a.selectedIndex&&a.defocusItem(r),(n||f)&&(m=a.selectpicker.view.visibleElements?a.selectpicker.view.visibleElements.slice():[],a.selectpicker.view.visibleElements=!1===y?a.selectpicker.current.elements:a.selectpicker.current.elements.slice(a.selectpicker.view.position0,a.selectpicker.view.position1),a.setOptionStatus(),(t||!1===y&&n)&&(b=!function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))}(m,a.selectpicker.view.visibleElements)),(n||!0===y)&&b)){var _,k,C=a.$menuInner[0],S=document.createDocumentFragment(),T=C.firstChild.cloneNode(!1),E=a.selectpicker.view.visibleElements,A=[];C.replaceChild(T,C.firstChild),x=0;for(var O=E.length;x<O;x++){var D,I,P=E[x];a.options.sanitize&&(D=P.lastChild)&&(I=a.selectpicker.current.data[x+a.selectpicker.view.position0])&&I.content&&!I.sanitized&&(A.push(D),I.sanitized=!0),S.appendChild(P)}if(a.options.sanitize&&A.length&&s(A,a.options.whiteList,a.options.sanitizeFn),!0===y?(_=0===a.selectpicker.view.position0?0:a.selectpicker.current.data[a.selectpicker.view.position0-1].position,k=a.selectpicker.view.position1>g-1?0:a.selectpicker.current.data[g-1].position-a.selectpicker.current.data[a.selectpicker.view.position1-1].position,C.firstChild.style.marginTop=_+"px",C.firstChild.style.marginBottom=k+"px"):(C.firstChild.style.marginTop=0,C.firstChild.style.marginBottom=0),C.firstChild.appendChild(S),!0===y&&a.sizeInfo.hasScrollBar){var M=C.firstChild.offsetWidth;if(n&&M<a.sizeInfo.menuInnerInnerWidth&&a.sizeInfo.totalMenuWidth>a.sizeInfo.selectWidth)C.firstChild.style.minWidth=a.sizeInfo.menuInnerInnerWidth+"px";else if(M>a.sizeInfo.menuInnerInnerWidth){a.$menu[0].style.minWidth=0;var R=C.firstChild.offsetWidth;R>a.sizeInfo.menuInnerInnerWidth&&(a.sizeInfo.menuInnerInnerWidth=R,C.firstChild.style.minWidth=a.sizeInfo.menuInnerInnerWidth+"px"),a.$menu[0].style.minWidth=""}}}if(a.prevActiveIndex=a.activeIndex,a.options.liveSearch){if(t&&n){var z,N=0;a.selectpicker.view.canHighlight[N]||(N=1+a.selectpicker.view.canHighlight.slice(1).indexOf(!0)),z=a.selectpicker.view.visibleElements[N],a.defocusItem(a.selectpicker.view.currentActive),a.activeIndex=(a.selectpicker.current.data[N]||{}).index,a.focusItem(z)}}else a.$menuInner.trigger("focus")}f(l,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(e,t){a.noScroll||f(this.scrollTop,t),a.noScroll=!1})),e(window).off("resize"+z+"."+this.selectId+".createView").on("resize"+z+"."+this.selectId+".createView",(function(){a.$newElement.hasClass(N.SHOW)&&f(a.$menuInner[0].scrollTop)}))},focusItem:function(e,t,n){if(e){t=t||this.selectpicker.main.data[this.activeIndex];var i=e.firstChild;i&&(i.setAttribute("aria-setsize",this.selectpicker.view.size),i.setAttribute("aria-posinset",t.posinset),!0!==n&&(this.focusedParent.setAttribute("aria-activedescendant",i.id),e.classList.add("active"),i.classList.add("active")))}},defocusItem:function(e){e&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"))},setPlaceholder:function(){var t=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),t=!0;var n=this.$element[0],i=!1,o=!this.selectpicker.view.titleOption.parentNode;o&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",i=void 0===e(n.options[n.selectedIndex]).attr("selected")&&void 0===this.$element.data("selected")),!o&&0===this.selectpicker.view.titleOption.index||n.insertBefore(this.selectpicker.view.titleOption,n.firstChild),i&&(n.selectedIndex=0)}return t},buildData:function(){var e=':not([hidden]):not([data-hidden="true"])',t=[],n=0,i=this.setPlaceholder()?1:0;this.options.hideDisabled&&(e+=":not(:disabled)");var o=this.$element[0].querySelectorAll("select > *"+e);function r(e){var n=t[t.length-1];n&&"divider"===n.type&&(n.optID||e.optID)||((e=e||{}).type="divider",t.push(e))}function s(e,n){if((n=n||{}).divider="true"===e.getAttribute("data-divider"),n.divider)r({optID:n.optID});else{var i=t.length,o=e.style.cssText,s=o?D(o):"",a=(e.className||"")+(n.optgroupClass||"");n.optID&&(a="opt "+a),n.optionClass=a.trim(),n.inlineStyle=s,n.text=e.textContent,n.content=e.getAttribute("data-content"),n.tokens=e.getAttribute("data-tokens"),n.subtext=e.getAttribute("data-subtext"),n.icon=e.getAttribute("data-icon"),e.liIndex=i,n.display=n.content||n.text,n.type="option",n.index=i,n.option=e,n.selected=!!e.selected,n.disabled=n.disabled||!!e.disabled,t.push(n)}}function a(i,o){var a=o[i],l=o[i-1],c=o[i+1],d=a.querySelectorAll("option"+e);if(d.length){var h,u,p={display:D(a.label),subtext:a.getAttribute("data-subtext"),icon:a.getAttribute("data-icon"),type:"optgroup-label",optgroupClass:" "+(a.className||"")};n++,l&&r({optID:n}),p.optID=n,t.push(p);for(var f=0,m=d.length;f<m;f++){var g=d[f];0===f&&(u=(h=t.length-1)+m),s(g,{headerIndex:h,lastIndex:u,optID:p.optID,optgroupClass:p.optgroupClass,disabled:a.disabled})}c&&r({optID:n})}}for(var l=o.length;i<l;i++){var c=o[i];"OPTGROUP"!==c.tagName?s(c,{}):a(i,o)}this.selectpicker.main.data=this.selectpicker.current.data=t},buildList:function(){var e=this,t=this.selectpicker.main.data,n=[],i=0;function o(t){var o,r=0;switch(t.type){case"divider":o=H.li(!1,N.DIVIDER,t.optID?t.optID+"div":void 0);break;case"option":(o=H.li(H.a(H.text.call(e,t),t.optionClass,t.inlineStyle),"",t.optID)).firstChild&&(o.firstChild.id=e.selectId+"-"+t.index);break;case"optgroup-label":o=H.li(H.label.call(e,t),"dropdown-header"+t.optgroupClass,t.optID)}n.push(o),t.display&&(r+=t.display.length),t.subtext&&(r+=t.subtext.length),t.icon&&(r+=1),i<r&&(i=r,e.selectpicker.view.widestOption=n[n.length-1])}!e.options.showTick&&!e.multiple||L.checkMark.parentNode||(L.checkMark.className=this.options.iconBase+" "+e.options.tickIcon+" check-mark",L.a.appendChild(L.checkMark));for(var r=t.length,s=0;s<r;s++)o(t[s]);this.selectpicker.main.elements=this.selectpicker.current.elements=n},findLis:function(){return this.$menuInner.find(".inner > li")},render:function(){var e,t=this,n=this.$element[0],i=this.setPlaceholder()&&0===n.selectedIndex,o=f(n,this.options.hideDisabled),r=o.length,a=this.$button[0],l=a.querySelector(".filter-option-inner-inner"),c=document.createTextNode(this.options.multipleSeparator),d=L.fragment.cloneNode(!1),h=!1;if(a.classList.toggle("bs-placeholder",t.multiple?!r:!m(n,o)),this.tabIndex(),"static"===this.options.selectedTextFormat)d=H.text.call(this,{text:this.options.title},!0);else if(!1===(this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&1<r&&(1<(e=this.options.selectedTextFormat.split(">")).length&&r>e[1]||1===e.length&&2<=r))){if(!i){for(var u=0;u<r&&u<50;u++){var p=o[u],g=this.selectpicker.main.data[p.liIndex],v={};this.multiple&&0<u&&d.appendChild(c.cloneNode(!1)),p.title?v.text=p.title:g&&(g.content&&t.options.showContent?(v.content=g.content.toString(),h=!0):(t.options.showIcon&&(v.icon=g.icon),t.options.showSubtext&&!t.multiple&&g.subtext&&(v.subtext=" "+g.subtext),v.text=p.textContent.trim())),d.appendChild(H.text.call(this,v,!0))}49<r&&d.appendChild(document.createTextNode("..."))}}else{var b=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(b+=":not(:disabled)");var y=this.$element[0].querySelectorAll("select > option"+b+", optgroup"+b+" option"+b).length,x="function"==typeof this.options.countSelectedText?this.options.countSelectedText(r,y):this.options.countSelectedText;d=H.text.call(this,{text:x.replace("{0}",r.toString()).replace("{1}",y.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),d.childNodes.length||(d=H.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),a.title=d.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&h&&s([d],t.options.whiteList,t.options.sanitizeFn),l.innerHTML="",l.appendChild(d),M.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var w=a.querySelector(".filter-expand"),_=l.cloneNode(!0);_.className="filter-expand",w?a.replaceChild(_,w):a.appendChild(_)}this.$element.trigger("rendered"+z)},setStyle:function(e,t){var n,i=this.$button[0],o=this.$newElement[0],r=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),M.major<4&&(o.classList.add("bs3"),o.parentNode.classList.contains("input-group")&&(o.previousElementSibling||o.nextElementSibling)&&(o.previousElementSibling||o.nextElementSibling).classList.contains("input-group-addon")&&o.classList.add("bs3-has-addon")),n=e?e.trim():r,"add"==t?n&&i.classList.add.apply(i.classList,n.split(" ")):"remove"==t?n&&i.classList.remove.apply(i.classList,n.split(" ")):(r&&i.classList.remove.apply(i.classList,r.split(" ")),n&&i.classList.add.apply(i.classList,n.split(" ")))},liHeight:function(t){if(t||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var n=document.createElement("div"),i=document.createElement("div"),o=document.createElement("div"),r=document.createElement("ul"),s=document.createElement("li"),a=document.createElement("li"),l=document.createElement("li"),c=document.createElement("a"),d=document.createElement("span"),h=this.options.header&&0<this.$menu.find("."+N.POPOVERHEADER).length?this.$menu.find("."+N.POPOVERHEADER)[0].cloneNode(!0):null,u=this.options.liveSearch?document.createElement("div"):null,p=this.options.actionsBox&&this.multiple&&0<this.$menu.find(".bs-actionsbox").length?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,f=this.options.doneButton&&this.multiple&&0<this.$menu.find(".bs-donebutton").length?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,m=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,d.className="text",c.className="dropdown-item "+(m?m.className:""),n.className=this.$menu[0].parentNode.className+" "+N.SHOW,n.style.width=0,"auto"===this.options.width&&(i.style.minWidth=0),i.className=N.MENU+" "+N.SHOW,o.className="inner "+N.SHOW,r.className=N.MENU+" inner "+("4"===M.major?N.SHOW:""),s.className=N.DIVIDER,a.className="dropdown-header",d.appendChild(document.createTextNode("​")),c.appendChild(d),l.appendChild(c),a.appendChild(d.cloneNode(!0)),this.selectpicker.view.widestOption&&r.appendChild(this.selectpicker.view.widestOption.cloneNode(!0)),r.appendChild(l),r.appendChild(s),r.appendChild(a),h&&i.appendChild(h),u){var g=document.createElement("input");u.className="bs-searchbox",g.className="form-control",u.appendChild(g),i.appendChild(u)}p&&i.appendChild(p),o.appendChild(r),i.appendChild(o),f&&i.appendChild(f),n.appendChild(i),document.body.appendChild(n);var v,b=l.offsetHeight,y=a?a.offsetHeight:0,w=h?h.offsetHeight:0,_=u?u.offsetHeight:0,k=p?p.offsetHeight:0,C=f?f.offsetHeight:0,S=e(s).outerHeight(!0),T=!!window.getComputedStyle&&window.getComputedStyle(i),E=i.offsetWidth,A=T?null:e(i),O={vert:x(T?T.paddingTop:A.css("paddingTop"))+x(T?T.paddingBottom:A.css("paddingBottom"))+x(T?T.borderTopWidth:A.css("borderTopWidth"))+x(T?T.borderBottomWidth:A.css("borderBottomWidth")),horiz:x(T?T.paddingLeft:A.css("paddingLeft"))+x(T?T.paddingRight:A.css("paddingRight"))+x(T?T.borderLeftWidth:A.css("borderLeftWidth"))+x(T?T.borderRightWidth:A.css("borderRightWidth"))},D={vert:O.vert+x(T?T.marginTop:A.css("marginTop"))+x(T?T.marginBottom:A.css("marginBottom"))+2,horiz:O.horiz+x(T?T.marginLeft:A.css("marginLeft"))+x(T?T.marginRight:A.css("marginRight"))+2};o.style.overflowY="scroll",v=i.offsetWidth-E,document.body.removeChild(n),this.sizeInfo.liHeight=b,this.sizeInfo.dropdownHeaderHeight=y,this.sizeInfo.headerHeight=w,this.sizeInfo.searchHeight=_,this.sizeInfo.actionsHeight=k,this.sizeInfo.doneButtonHeight=C,this.sizeInfo.dividerHeight=S,this.sizeInfo.menuPadding=O,this.sizeInfo.menuExtras=D,this.sizeInfo.menuWidth=E,this.sizeInfo.menuInnerInnerWidth=E-O.horiz,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth,this.sizeInfo.scrollBarWidth=v,this.sizeInfo.selectHeight=this.$newElement[0].offsetHeight,this.setPositionData()}},getSelectPosition:function(){var t,n=e(window),i=this.$newElement.offset(),o=e(this.options.container);this.options.container&&o.length&&!o.is("body")?((t=o.offset()).top+=parseInt(o.css("borderTopWidth")),t.left+=parseInt(o.css("borderLeftWidth"))):t={top:0,left:0};var r=this.options.windowPadding;this.sizeInfo.selectOffsetTop=i.top-t.top-n.scrollTop(),this.sizeInfo.selectOffsetBot=n.height()-this.sizeInfo.selectOffsetTop-this.sizeInfo.selectHeight-t.top-r[2],this.sizeInfo.selectOffsetLeft=i.left-t.left-n.scrollLeft(),this.sizeInfo.selectOffsetRight=n.width()-this.sizeInfo.selectOffsetLeft-this.sizeInfo.selectWidth-t.left-r[1],this.sizeInfo.selectOffsetTop-=r[0],this.sizeInfo.selectOffsetLeft-=r[3]},setMenuSize:function(e){this.getSelectPosition();var t,n,i,o,r,s,a,l,c=this.sizeInfo.selectWidth,d=this.sizeInfo.liHeight,h=this.sizeInfo.headerHeight,u=this.sizeInfo.searchHeight,p=this.sizeInfo.actionsHeight,f=this.sizeInfo.doneButtonHeight,m=this.sizeInfo.dividerHeight,g=this.sizeInfo.menuPadding,v=0;if(this.options.dropupAuto&&(a=d*this.selectpicker.current.elements.length+g.vert,l=this.sizeInfo.selectOffsetTop-this.sizeInfo.selectOffsetBot>this.sizeInfo.menuExtras.vert&&a+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(l=this.selectpicker.dropup),this.$newElement.toggleClass(N.DROPUP,l),this.selectpicker.dropup=l),"auto"===this.options.size)o=3<this.selectpicker.current.elements.length?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,n=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,i=o+h+u+p+f,s=Math.max(o-g.vert,0),this.$newElement.hasClass(N.DROPUP)&&(n=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),t=(r=n)-h-u-p-f-g.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var b=0;b<this.options.size;b++)"divider"===this.selectpicker.current.data[b].type&&v++;t=(n=d*this.options.size+v*m+g.vert)-g.vert,r=n+h+u+p+f,i=s=""}this.$menu.css({"max-height":r+"px",overflow:"hidden","min-height":i+"px"}),this.$menuInner.css({"max-height":t+"px","overflow-y":"auto","min-height":s+"px"}),this.sizeInfo.menuInnerHeight=Math.max(t,1),this.selectpicker.current.data.length&&this.selectpicker.current.data[this.selectpicker.current.data.length-1].position>this.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(N.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRight<this.sizeInfo.totalMenuWidth-c),this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(t){if(this.liHeight(t),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var n=this,i=e(window);this.setMenuSize(),this.options.liveSearch&&this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",(function(){return n.setMenuSize()})),"auto"===this.options.size?i.off("resize"+z+"."+this.selectId+".setMenuSize scroll"+z+"."+this.selectId+".setMenuSize").on("resize"+z+"."+this.selectId+".setMenuSize scroll"+z+"."+this.selectId+".setMenuSize",(function(){return n.setMenuSize()})):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&i.off("resize"+z+"."+this.selectId+".setMenuSize scroll"+z+"."+this.selectId+".setMenuSize")}this.createView(!1,!0,t)},setWidth:function(){var e=this;"auto"===this.options.width?requestAnimationFrame((function(){e.$menu.css("min-width","0"),e.$element.on("loaded"+z,(function(){e.liHeight(),e.setMenuSize();var t=e.$newElement.clone().appendTo("body"),n=t.css("width","auto").children("button").outerWidth();t.remove(),e.sizeInfo.selectWidth=Math.max(e.sizeInfo.totalMenuWidth,n),e.$newElement.css("width",e.sizeInfo.selectWidth+"px")}))})):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){function t(t){var a={},l=r.options.display||!!e.fn.dropdown.Constructor.Default&&e.fn.dropdown.Constructor.Default.display;r.$bsContainer.addClass(t.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(N.DROPUP,t.hasClass(N.DROPUP)),n=t.offset(),s.is("body")?i={top:0,left:0}:((i=s.offset()).top+=parseInt(s.css("borderTopWidth"))-s.scrollTop(),i.left+=parseInt(s.css("borderLeftWidth"))-s.scrollLeft()),o=t.hasClass(N.DROPUP)?0:t[0].offsetHeight,(M.major<4||"static"===l)&&(a.top=n.top-i.top+o,a.left=n.left-i.left),a.width=t[0].offsetWidth,r.$bsContainer.css(a)}this.$bsContainer=e('<div class="bs-container" />');var n,i,o,r=this,s=e(this.options.container);this.$button.on("click.bs.dropdown.data-api",(function(){r.isDisabled()||(t(r.$newElement),r.$bsContainer.appendTo(r.options.container).toggleClass(N.SHOW,!r.$button.hasClass(N.SHOW)).append(r.$menu))})),e(window).off("resize"+z+"."+this.selectId+" scroll"+z+"."+this.selectId).on("resize"+z+"."+this.selectId+" scroll"+z+"."+this.selectId,(function(){r.$newElement.hasClass(N.SHOW)&&t(r.$newElement)})),this.$element.on("hide"+z,(function(){r.$menu.data("height",r.$menu.height()),r.$bsContainer.detach()}))},setOptionStatus:function(e){var t=this;if(t.noScroll=!1,t.selectpicker.view.visibleElements&&t.selectpicker.view.visibleElements.length)for(var n=0;n<t.selectpicker.view.visibleElements.length;n++){var i=t.selectpicker.current.data[n+t.selectpicker.view.position0],o=i.option;o&&(!0!==e&&t.setDisabled(i.index,i.disabled),t.setSelected(i.index,o.selected))}},setSelected:function(e,t){var n,i,o=this.selectpicker.main.elements[e],r=this.selectpicker.main.data[e],s=void 0!==this.activeIndex,a=this.activeIndex===e||t&&!this.multiple&&!s;r.selected=t,i=o.firstChild,t&&(this.selectedIndex=e),o.classList.toggle("selected",t),a?(this.focusItem(o,r),this.selectpicker.view.currentActive=o,this.activeIndex=e):this.defocusItem(o),i&&(i.classList.toggle("selected",t),t?i.setAttribute("aria-selected",!0):this.multiple?i.setAttribute("aria-selected",!1):i.removeAttribute("aria-selected")),a||s||!t||void 0===this.prevActiveIndex||(n=this.selectpicker.main.elements[this.prevActiveIndex],this.defocusItem(n))},setDisabled:function(e,t){var n,i=this.selectpicker.main.elements[e];this.selectpicker.main.data[e].disabled=t,n=i.firstChild,i.classList.toggle(N.DISABLED,t),n&&("4"===M.major&&n.classList.toggle(N.DISABLED,t),t?(n.setAttribute("aria-disabled",t),n.setAttribute("tabindex",-1)):(n.removeAttribute("aria-disabled"),n.setAttribute("tabindex",0)))},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){this.isDisabled()?(this.$newElement[0].classList.add(N.DISABLED),this.$button.addClass(N.DISABLED).attr("tabindex",-1).attr("aria-disabled",!0)):(this.$button[0].classList.contains(N.DISABLED)&&(this.$newElement[0].classList.remove(N.DISABLED),this.$button.removeClass(N.DISABLED).attr("aria-disabled",!1)),-1!=this.$button.attr("tabindex")||this.$element.data("tabindex")||this.$button.removeAttr("tabindex"))},tabIndex:function(){this.$element.data("tabindex")!==this.$element.attr("tabindex")&&-98!==this.$element.attr("tabindex")&&"-98"!==this.$element.attr("tabindex")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex"))),this.$element.attr("tabindex",-98)},clickListener:function(){var t=this,n=e(document);function i(){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$menuInner.trigger("focus")}function o(){t.dropdown&&t.dropdown._popper&&t.dropdown._popper.state.isCreated?i():requestAnimationFrame(o)}n.data("spaceSelect",!1),this.$button.on("keyup",(function(e){/(32)/.test(e.keyCode.toString(10))&&n.data("spaceSelect")&&(e.preventDefault(),n.data("spaceSelect",!1))})),this.$newElement.on("show.bs.dropdown",(function(){3<M.major&&!t.dropdown&&(t.dropdown=t.$button.data("bs.dropdown"),t.dropdown._menu=t.$menu[0])})),this.$button.on("click.bs.dropdown.data-api",(function(){t.$newElement.hasClass(N.SHOW)||t.setSize()})),this.$element.on("shown"+z,(function(){t.$menuInner[0].scrollTop!==t.selectpicker.view.scrollTop&&(t.$menuInner[0].scrollTop=t.selectpicker.view.scrollTop),3<M.major?requestAnimationFrame(o):i()})),this.$menuInner.on("mouseenter","li a",(function(e){var n=this.parentElement,i=t.isVirtual()?t.selectpicker.view.position0:0,o=Array.prototype.indexOf.call(n.parentElement.children,n),r=t.selectpicker.current.data[o+i];t.focusItem(n,r,!0)})),this.$menuInner.on("click","li a",(function(n,i){var o=e(this),r=t.$element[0],s=t.isVirtual()?t.selectpicker.view.position0:0,a=t.selectpicker.current.data[o.parent().index()+s],l=a.index,c=m(r),d=r.selectedIndex,h=r.options[d],u=!0;if(t.multiple&&1!==t.options.maxOptions&&n.stopPropagation(),n.preventDefault(),!t.isDisabled()&&!o.parent().hasClass(N.DISABLED)){var p=a.option,g=e(p),b=p.selected,y=g.parent("optgroup"),x=y.find("option"),w=t.options.maxOptions,_=y.data("maxOptions")||!1;if(l===t.activeIndex&&(i=!0),i||(t.prevActiveIndex=t.activeIndex,t.activeIndex=void 0),t.multiple){if(p.selected=!b,t.setSelected(l,!b),o.trigger("blur"),!1!==w||!1!==_){var k=w<f(r).length,C=_<y.find("option:selected").length;
182if(w&&k||_&&C)if(w&&1==w)r.selectedIndex=-1,p.selected=!0,t.setOptionStatus(!0);else if(_&&1==_){for(var S=0;S<x.length;S++){var T=x[S];T.selected=!1,t.setSelected(T.liIndex,!1)}p.selected=!0,t.setSelected(l,!0)}else{var E="string"==typeof t.options.maxOptionsText?[t.options.maxOptionsText,t.options.maxOptionsText]:t.options.maxOptionsText,A="function"==typeof E?E(w,_):E,O=A[0].replace("{n}",w),D=A[1].replace("{n}",_),I=e('<div class="notify"></div>');A[2]&&(O=O.replace("{var}",A[2][1<w?0:1]),D=D.replace("{var}",A[2][1<_?0:1])),p.selected=!1,t.$menu.append(I),w&&k&&(I.append(e("<div>"+O+"</div>")),u=!1,t.$element.trigger("maxReached"+z)),_&&C&&(I.append(e("<div>"+D+"</div>")),u=!1,t.$element.trigger("maxReachedGrp"+z)),setTimeout((function(){t.setSelected(l,!1)}),10),I[0].classList.add("fadeOut"),setTimeout((function(){I.remove()}),1050)}}}else h&&(h.selected=!1),p.selected=!0,t.setSelected(l,!0);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.trigger("focus"):t.options.liveSearch&&t.$searchbox.trigger("focus"),u&&(!t.multiple&&d===r.selectedIndex||(v=[p.index,g.prop("selected"),c],t.$element.triggerNative("change")))}})),this.$menu.on("click","li."+N.DISABLED+" a, ."+N.POPOVERHEADER+", ."+N.POPOVERHEADER+" :not(.close)",(function(n){n.currentTarget==this&&(n.preventDefault(),n.stopPropagation(),t.options.liveSearch&&!e(n.target).hasClass("close")?t.$searchbox.trigger("focus"):t.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(e){e.preventDefault(),e.stopPropagation(),t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus")})),this.$menu.on("click","."+N.POPOVERHEADER+" .close",(function(){t.$button.trigger("click")})),this.$searchbox.on("click",(function(e){e.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(n){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus"),n.preventDefault(),n.stopPropagation(),e(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()})),this.$element.on("change"+z,(function(){t.render(),t.$element.trigger("changed"+z,v),v=null})).on("focus"+z,(function(){t.options.mobile||t.$button.trigger("focus")}))},liveSearchListener:function(){var e=this,t=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",(function(){e.$searchbox.val()&&e.$searchbox.val("")}
182)),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(e){e.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){var n=e.$searchbox.val();if(e.selectpicker.search.elements=[],e.selectpicker.search.data=[],n){var i=[],o=n.toUpperCase(),r={},s=[],a=e._searchStyle(),l=e.options.liveSearchNormalize;l&&(o=S(o));for(var c=0;c<e.selectpicker.main.data.length;c++){var d=e.selectpicker.main.data[c];r[c]||(r[c]=y(d,o,a,l)),r[c]&&void 0!==d.headerIndex&&-1===s.indexOf(d.headerIndex)&&(0<d.headerIndex&&(r[d.headerIndex-1]=!0,s.push(d.headerIndex-1)),r[d.headerIndex]=!0,s.push(d.headerIndex),r[d.lastIndex+1]=!0),r[c]&&"optgroup-label"!==d.type&&s.push(c)}c=0;for(var h=s.length;c<h;c++){var u=s[c],p=s[c-1],f=(d=e.selectpicker.main.data[u],e.selectpicker.main.data[p]);("divider"!==d.type||"divider"===d.type&&f&&"divider"!==f.type&&h-1!==c)&&(e.selectpicker.search.data.push(d),i.push(e.selectpicker.main.elements[u]))}e.activeIndex=void 0,e.noScroll=!0,e.$menuInner.scrollTop(0),e.selectpicker.search.elements=i,e.createView(!0),i.length||(t.className="no-results",t.innerHTML=e.options.noneResultsText.replace("{0}",'"'+D(n)+'"'),e.$menuInner[0].firstChild.appendChild(t))}else e.$menuInner.scrollTop(0),e.createView(!1)}))},_searchStyle:function(){return this.options.liveSearchStyle||"contains"},val:function(e){var t=this.$element[0];if(void 0===e)return this.$element.val();var n=m(t);if(v=[null,null,n],this.$element.val(e).trigger("changed"+z,v),this.$newElement.hasClass(N.SHOW))if(this.multiple)this.setOptionStatus(!0);else{var i=(t.options[t.selectedIndex]||{}).liIndex;"number"==typeof i&&(this.setSelected(this.selectedIndex,!1),this.setSelected(i,!0))}return this.render(),v=null,this.$element},changeAll:function(e){if(this.multiple){void 0===e&&(e=!0);var t=this.$element[0],n=0,i=0,o=m(t);t.classList.add("bs-select-hidden");for(var r=0,s=this.selectpicker.current.data,a=s.length;r<a;r++){var l=s[r],c=l.option;c&&!l.disabled&&"divider"!==l.type&&(l.selected&&n++,!0===(c.selected=e)&&i++)}t.classList.remove("bs-select-hidden"),n!==i&&(this.setOptionStatus(),v=[null,null,o],this.$element.triggerNative("change"))}},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(e){(e=e||window.event)&&e.stopPropagation(),this.$button.trigger("click.bs.dropdown.data-api")},keydown:function(t){var n,i,o,r,s,a=e(this),l=a.hasClass("dropdown-toggle"),c=(l?a.closest(".dropdown"):a.closest(F.MENU)).data("this"),d=c.findLis(),h=!1,u=9===t.which&&!l&&!c.options.selectOnTab,p=j.test(t.which)||u,f=c.$menuInner[0].scrollTop,m=!0===c.isVirtual()?c.selectpicker.view.position0:0;if(!(112<=t.which&&t.which<=123))if(!(i=c.$newElement.hasClass(N.SHOW))&&(p||48<=t.which&&t.which<=57||96<=t.which&&t.which<=105||65<=t.which&&t.which<=90)&&(c.$button.trigger("click.bs.dropdown.data-api"),c.options.liveSearch))c.$searchbox.trigger("focus");else{if(27===t.which&&i&&(t.preventDefault(),c.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),p){if(!d.length)return;-1!==(n=(o=c.selectpicker.main.elements[c.activeIndex])?Array.prototype.indexOf.call(o.parentElement.children,o):-1)&&c.defocusItem(o),38===t.which?(-1!==n&&n--,n+m<0&&(n+=d.length),c.selectpicker.view.canHighlight[n+m]||-1==(n=c.selectpicker.view.canHighlight.slice(0,n+m).lastIndexOf(!0)-m)&&(n=d.length-1)):40!==t.which&&!u||(++n+m>=c.selectpicker.view.canHighlight.length&&(n=0),c.selectpicker.view.canHighlight[n+m]||(n=n+1+c.selectpicker.view.canHighlight.slice(n+m+1).indexOf(!0))),t.preventDefault();var g=m+n;38===t.which?0===m&&n===d.length-1?(c.$menuInner[0].scrollTop=c.$menuInner[0].scrollHeight,g=c.selectpicker.current.elements.length-1):h=(s=(r=c.selectpicker.current.data[g]).position-r.height)<f:40!==t.which&&!u||(0===n?g=c.$menuInner[0].scrollTop=0:h=f<(s=(r=c.selectpicker.current.data[g]).position-c.sizeInfo.menuInnerHeight)),o=c.selectpicker.current.elements[g],c.activeIndex=c.selectpicker.current.data[g].index,c.focusItem(o),c.selectpicker.view.currentActive=o,h&&(c.$menuInner[0].scrollTop=s),c.options.liveSearch?c.$searchbox.trigger("focus"):a.trigger("focus")}else if(!a.is("input")&&!B.test(t.which)||32===t.which&&c.selectpicker.keydown.keyHistory){var v,b,x=[];t.preventDefault(),c.selectpicker.keydown.keyHistory+=P[t.which],c.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel),c.selectpicker.keydown.resetKeyHistory.cancel=c.selectpicker.keydown.resetKeyHistory.start(),b=c.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(b)&&(b=b.charAt(0));for(var w=0;w<c.selectpicker.current.data.length;w++){var _=c.selectpicker.current.data[w];y(_,b,"startsWith",!0)&&c.selectpicker.view.canHighlight[w]&&x.push(_.index)}if(x.length){var k=0;d.removeClass("active").find("a").removeClass("active"),1===b.length&&(-1===(k=x.indexOf(c.activeIndex))||k===x.length-1?k=0:k++),v=x[k],h=0<f-(r=c.selectpicker.main.data[v]).position?(s=r.position-r.height,!0):(s=r.position-c.sizeInfo.menuInnerHeight,r.position>f+c.sizeInfo.menuInnerHeight),o=c.selectpicker.main.elements[v],c.activeIndex=x[k],c.focusItem(o),o&&o.firstChild.focus(),h&&(c.$menuInner[0].scrollTop=s),a.trigger("focus")}}i&&(32===t.which&&!c.selectpicker.keydown.keyHistory||13===t.which||9===t.which&&c.options.selectOnTab)&&(32!==t.which&&t.preventDefault(),c.options.liveSearch&&32===t.which||(c.$menuInner.find(".active a").trigger("click",!0),a.trigger("focus"),c.options.liveSearch||(t.preventDefault(),e(document).data("spaceSelect",!0))))}},mobile:function(){this.$element[0].classList.add("mobile-device")},refresh:function(){var t=e.extend({},this.options,this.$element.data());this.options=t,this.checkDisabled(),this.setStyle(),this.render(),this.buildData(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+z)},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off(z).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),e(window).off(z+"."+this.selectId)}};var q=e.fn.selectpicker;e.fn.selectpicker=$,e.fn.selectpicker.Constructor=U,e.fn.selectpicker.noConflict=function(){return e.fn.selectpicker=q,this};var W=e.fn.dropdown.Constructor._dataApiKeydownHandler||e.fn.dropdown.Constructor.prototype.keydown;e(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",':not(.bootstrap-select) > [data-toggle="dropdown"]',W).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",W).on("keydown"+z,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',U.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(e){e.stopPropagation()})),e(window).on("load"+z+".data-api",(function(){e(".selectpicker").each((function(){var t=e(this);$.call(t,t.data())}))}))}(e)}));var myDefaultWhiteList=$.fn.selectpicker.Constructor.DEFAULTS.whiteList;
183/*
184 * @license
185 *
186 * Multiselect v2.5.6
187 * http://crlcu.github.io/multiselect/
188 *
189 * Copyright (c) 2016-2020 Adrian Crisan
190 * Licensed under the MIT license (https://github.com/crlcu/multiselect/blob/master/LICENSE)
191 */
192if(myDefaultWhiteList.svg=["xmlns","viewbox"],myDefaultWhiteList.defs=[],myDefaultWhiteList.style=[],myDefaultWhiteList.g=["data-name"],myDefaultWhiteList.path=["d","transform"],myDefaultWhiteList.polygon=["points"],myDefaultWhiteList.rect=["x","y","width","height","transform"],myDefaultWhiteList.circle=["cx","cy","r"],myDefaultWhiteList.lineargradient=["x1","y1","x2","y2","gradienttransform","gradientunits","xlink:href"],myDefaultWhiteList.radialgradient=["cx","cy","r","offset","gradienttransform","gradientunits","style"],myDefaultWhiteList.stop=["offset","stop-color"],myDefaultWhiteList.ellipse=["cx","cy","rx","ry"],"undefined"==typeof jQuery)throw new Error("multiselect requires jQuery");!function(e){"use strict";var t=jQuery.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<7)throw new Error("multiselect requires jQuery version 1.7 or higher")}(),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}((function(e){"use strict";var t=function(e){function t(t,n){var i=t.prop("id");if(this.$left=t,this.$right=e(n.right).length?e(n.right):e("#"+i+"_to"),this.actions={$leftAll:e(n.leftAll).length?e(n.leftAll):e("#"+i+"_leftAll"),$rightAll:e(n.rightAll).length?e(n.rightAll):e("#"+i+"_rightAll"),$leftSelected:e(n.leftSelected).length?e(n.leftSelected):e("#"+i+"_leftSelected"),$rightSelected:e(n.rightSelected).length?e(n.rightSelected):e("#"+i+"_rightSelected"),$undo:e(n.undo).length?e(n.undo):e("#"+i+"_undo"),$redo:e(n.redo).length?e(n.redo):e("#"+i+"_redo"),$moveUp:e(n.moveUp).length?e(n.moveUp):e("#"+i+"_move_up"),$moveDown:e(n.moveDown).length?e(n.moveDown):e("#"+i+"_move_down")},delete n.leftAll,delete n.leftSelected,delete n.right,delete n.rightAll,delete n.rightSelected,delete n.und
192o,delete n.redo,delete n.moveUp,delete n.moveDown,this.options={keepRenderingSort:n.keepRenderingSort,submitAllLeft:void 0===n.submitAllLeft||n.submitAllLeft,submitAllRight:void 0===n.submitAllRight||n.submitAllRight,search:n.search,ignoreDisabled:void 0!==n.ignoreDisabled&&n.ignoreDisabled,matchOptgroupBy:void 0!==n.matchOptgroupBy?n.matchOptgroupBy:"label"},delete n.keepRenderingSort,n.submitAllLeft,n.submitAllRight,n.search,n.ignoreDisabled,n.matchOptgroupBy,this.callbacks=n,"function"==typeof this.callbacks.sort){var o=this.callbacks.sort;this.callbacks.sort={left:o,right:o}}this.init()}return t.prototype={init:function(){var t=this;t.undoStack=[],t.redoStack=[],t.options.keepRenderingSort&&(t.skipInitSort=!0,!1!==t.callbacks.sort&&(t.callbacks.sort={left:function(t,n){return e(t).data("position")>e(n).data("position")?1:-1},right:function(t,n){return e(t).data("position")>e(n).data("position")?1:-1}}),t.$left.attachIndex(),t.$right.each((function(t,n){e(n).attachIndex()}))),"function"==typeof t.callbacks.startUp&&t.callbacks.startUp(t.$left,t.$right),t.skipInitSort||("function"==typeof t.callbacks.sort.left&&t.$left.mSort(t.callbacks.sort.left),"function"==typeof t.callbacks.sort.right&&t.$right.each((function(n,i){e(i).mSort(t.callbacks.sort.right)}))),t.options.search&&t.options.search.left&&(t.options.search.$left=e(t.options.search.left),t.$left.before(t.options.search.$left)),t.options.search&&t.options.search.right&&(t.options.search.$right=e(t.options.search.right),t.$right.before(e(t.options.search.$right))),t.events(),"function"==typeof t.callbacks.afterInit&&t.callbacks.afterInit()},events:function(){var t=this;t.options.search&&t.options.search.$left&&t.options.search.$left.on("keyup",(function(e){if(t.callbacks.fireSearch(this.value))t.$left.find('option:search("'+this.value+'")').mShow(),t.$left.find('option:not(:search("'+this.value+'"))').mHide(),t.$left.find("option").closest("optgroup").mHide(),t.$left.find("option:not(.hidden)").parent("optgroup").mShow();else t.$left.find("option, optgroup").mShow()})),t.options.search&&t.options.search.$right&&t.options.search.$right.on("keyup",(function(e){if(t.callbacks.fireSearch(this.value))t.$right.find('option:search("'+this.value+'")').mShow(),t.$right.find('option:not(:search("'+this.value+'"))').mHide(),t.$right.find("option").closest("optgroup").mHide(),t.$right.find("option:not(.hidden)").parent("optgroup").mShow();else t.$right.find("option, optgroup").mShow()})),t.$right.closest("form").on("submit",(function(e){t.options.search&&(t.options.search.$left&&t.options.search.$left.val("").trigger("keyup"),t.options.search.$right&&t.options.search.$right.val("").trigger("keyup")),t.$left.find("option").prop("selected",t.options.submitAllLeft),t.$right.find("option").prop("selected",t.options.submitAllRight)})),t.$left.on("dblclick","option",(function(e){e.preventDefault();var n=t.$left.find("option:selected:not(.hidden)");n.length&&t.moveToRight(n,e)})),t.$left.on("click","optgroup",(function(t){"OPTGROUP"==e(t.target).prop("tagName")&&e(this).children().prop("selected",!0)})),t.$left.on("keypress",(function(e){if(13===e.keyCode){e.preventDefault();var n=t.$left.find("option:selected:not(.hidden)");n.length&&t.moveToRight(n,e)}})),t.$right.on("dblclick","option",(function(e){e.preventDefault();var n=t.$right.find("option:selected:not(.hidden)");n.length&&t.moveToLeft(n,e)})),t.$right.on("click","optgroup",(function(t){"OPTGROUP"==e(t.target).prop("tagName")&&e(this).children().prop("selected",!0)})),t.$right.on("keydown",(function(e){if(8===e.keyCode||46===e.keyCode){e.preventDefault();var n=t.$right.find("option:selected:not(.hidden)");n.length&&t.moveToLeft(n,e)}})),(navigator.userAgent.match(/MSIE/i)||navigator.userAgent.indexOf("Trident/")>0||navigator.userAgent.indexOf("Edge/")>0)&&(t.$left.dblclick((function(e){t.actions.$rightSelected.trigger("click")})),t.$right.dblclick((function(e){t.actions.$leftSelected.trigger("click")}))),t.actions.$rightSelected.on("click",(function(n){n.preventDefault();var i=t.$left.find("option:selected:not(.hidden)");i.length&&t.moveToRight(i,n),e(this).blur()})),t.actions.$leftSelected.on("click",(function(n){n.preventDefault();var i=t.$right.find("option:selected:not(.hidden)");i.length&&t.moveToLeft(i,n),e(this).blur()})),t.actions.$rightAll.on("click",(function(n){n.preventDefault();var i=t.$left.children(":not(span):not(.hidden)");i.length&&t.moveToRight(i,n),e(this).blur()})),t.actions.$leftAll.on("click",(function(n){n.preventDefault();var i=t.$right.children(":not(span):not(.hidden)");i.length&&t.moveToLeft(i,n),e(this).blur()})),t.actions.$undo.on("click",(function(e){e.preventDefault(),t.undo(e)})),t.actions.$redo.on("click",(function(e){e.preventDefault(),t.redo(e)})),t.actions.$moveUp.on("click",(function(n){n.preventDefault();var i=t.$right.find(":selected:not(span):not(.hidden)");i.length&&t.moveUp(i,n),e(this).blur()})),t.actions.$moveDown.on("click",(function(n){n.preventDefault();var i=t.$right.find(":selected:not(span):not(.hidden)");i.length&&t.moveDown(i,n),e(this).blur()}))},moveToRight:function(e,t,n,i){var o=this;return o.$right.triggerHandler("optionchange"),"function"==typeof o.callbacks.moveToRight?o.callbacks.moveToRight(o,e,t,n,i):!("function"==typeof o.callbacks.beforeMoveToRight&&!n&&!o.callbacks.beforeMoveToRight(o.$left,o.$right,e))&&(o.moveFromAtoB(o.$left,o.$right,e,t,n,i),i||(o.undoStack.push(["right",e]),o.redoStack=[]),"function"!=typeof o.callbacks.sort.right||n||o.doNotSortRight||o.$right.mSort(o.callbacks.sort.right),"function"!=typeof o.callbacks.afterMoveToRight||n||o.callbacks.afterMoveToRight(o.$left,o.$right,e),o)},moveToLeft:function(e,t,n,i){var o=this;return o.$right.triggerHandler("optionchange"),"function"==typeof o.callbacks.moveToLeft?o.callbacks.moveToLeft(o,e,t,n,i):!("function"==typeof o.callbacks.beforeMoveToLeft&&!n&&!o.callbacks.beforeMoveToLeft(o.$left,o.$right,e))&&(o.moveFromAtoB(o.$right,o.$left,e,t,n,i),i||(o.undoStack.push(["left",e]),o.redoStack=[]),"function"!=typeof o.callbacks.sort.left||n||o.$left.mSort(o.callbacks.sort.left),"function"!=typeof o.callbacks.afterMoveToLeft||n||o.callbacks.afterMoveToLeft(o.$left,o.$right,e),o)},moveFromAtoB:function(t,n,i,o,r,s){var a=this;
192return"function"==typeof a.callbacks.moveFromAtoB?a.callbacks.moveFromAtoB(a,t,n,i,o,r,s):(i.each((function(t,i){var o=e(i);if(a.options.ignoreDisabled&&o.is(":disabled"))return!0;if(o.is("optgroup")||o.parent().is("optgroup")){var r=o.is("optgroup")?o:o.parent(),s="optgroup["+a.options.matchOptgroupBy+'="'+r.prop(a.options.matchOptgroupBy)+'"]',l=n.find(s);if(l.length||((l=r.clone(!0)).empty(),n.move(l)),o.is("optgroup")){var c="";a.options.ignoreDisabled&&(c=":not(:disabled)"),l.move(o.find("option"+c))}else l.move(o);r.removeIfEmpty()}else n.move(o)})),a)},moveUp:function(e){var t=this;if("function"==typeof t.callbacks.beforeMoveUp&&!t.callbacks.beforeMoveUp(e))return!1;e.first().prev().before(e),"function"==typeof t.callbacks.afterMoveUp&&t.callbacks.afterMoveUp(e)},moveDown:function(e){var t=this;if("function"==typeof t.callbacks.beforeMoveDown&&!t.callbacks.beforeMoveDown(e))return!1;e.last().next().after(e),"function"==typeof t.callbacks.afterMoveDown&&t.callbacks.afterMoveDown(e)},undo:function(e){var t=this,n=t.undoStack.pop();if(n)switch(t.redoStack.push(n),n[0]){case"left":t.moveToRight(n[1],e,!1,!0);break;case"right":t.moveToLeft(n[1],e,!1,!0)}},redo:function(e){var t=this,n=t.redoStack.pop();if(n)switch(t.undoStack.push(n),n[0]){case"left":t.moveToLeft(n[1],e,!1,!0);break;case"right":t.moveToRight(n[1],e,!1,!0)}}},t}(e);e.multiselect={defaults:{startUp:function(t,n){n.find("option").each((function(n,i){if("OPTGROUP"==e(i).parent().prop("tagName")){var o='optgroup[label="'+e(i).parent().attr("label")+'"]';t.find(o+' option[value="'+i.value+'"]').each((function(e,t){t.remove()})),t.find(o).removeIfEmpty()}else{t.find('option[value="'+i.value+'"]').remove()}}))},afterInit:function(){return!0},beforeMoveToRight:function(e,t,n){return!0},afterMoveToRight:function(e,t,n){},beforeMoveToLeft:function(e,t,n){return!0},afterMoveToLeft:function(e,t,n){},beforeMoveUp:function(e){return!0},afterMoveUp:function(e){},beforeMoveDown:function(e){return!0},afterMoveDown:function(e){},sort:function(e,t){return"NA"==e.innerHTML?1:"NA"==t.innerHTML?-1:e.innerHTML>t.innerHTML?1:-1},fireSearch:function(e){return e.length>1}}};var n=window.navigator.userAgent,i=n.indexOf("MSIE ")+n.indexOf("Trident/")+n.indexOf("Edge/")>-3,o=n.toLowerCase().indexOf("safari")>-1,r=n.toLowerCase().indexOf("firefox")>-1;e.fn.multiselect=function(n){return this.each((function(){var i=e(this),o=i.data("crlcu.multiselect"),r=e.extend({},e.multiselect.defaults,i.data(),"object"==typeof n&&n);o||i.data("crlcu.multiselect",o=new t(i,r))}))},e.fn.move=function(e){return this.append(e).find("option").prop("selected",!1),this},e.fn.removeIfEmpty=function(){return this.children().length||this.remove(),this},e.fn.mShow=function(){return this.removeClass("hidden").show(),(i||o)&&this.each((function(t,n){e(n).parent().is("span")&&e(n).parent().replaceWith(n),e(n).show()})),r&&this.prop("disabled",!1),this},e.fn.mHide=function(){return this.addClass("hidden").hide(),(i||o)&&this.each((function(t,n){e(n).parent().is("span")||e(n).wrap("<span>").hide()})),r&&this.prop("disabled",!0),this},e.fn.mSort=function(t){return this.children().sort(t).appendTo(this),this.find("optgroup").each((function(n,i){e(i).children().sort(t).appendTo(i)})),this},e.fn.attachIndex=function(){this.children().each((function(t,n){var i=e(n);i.is("optgroup")&&i.children().each((function(t,n){e(n).data("position",t)})),i.data("position",t)}))},e.expr[":"].search=function(t,n,i){var o=new RegExp(i[3].replace(/([^a-zA-Z0-9])/g,"\\$1"),"i");return e(t).text().match(o)}})),$.nette.ext("nested-mptt",{init:function(){if(void 0!==$.fn.nestedSortable){var e,t=this;$(this.nestedSelector).each((function(e,n){$(this).data("mpttMaxLevel")&&(t.nestedOptions.maxLevels=$(this).data("mpttMaxLevel")),$(this).data("mpttIsTree")&&(t.nestedOptions.isTree=$(this).data("mpttIsTree")),$(this).data("mpttStartCollapsed")&&(t.nestedOptions.startCollapsed=$(this).data("mpttStartCollapsed")),$(this).data("mpttDropdownClass")&&(t.nestedOptions.dropdownClass=$(this).data("mpttDropdownClass")),$(this).nestedSortable(t.nestedOptions),$(this).find("li").attrchange((function(e){"class"==e&&$(this).hasClass(t.nestedOptions.expandedClass)&&$(this).parent().find("li").not(this).removeClass(t.nestedOptions.expandedClass)}))})),(e=this.ext("snippets"))&&e.after((function(e){e.is(t.nestedSelector)&&(e.data("mpttMaxLevel")&&(t.nestedOptions.maxLevels=e.data("mpttMaxLevel")),e.data("mpttIsTree")&&(t.nestedOptions.isTree=e.data("mpttIsTree")),e.data("mpttStartCollapsed")&&(t.nestedOptions.startCollapsed=e.data("mpttStartCollapsed")),e.data("mpttDropdownClass")&&(t.nestedOptions.dropdownClass=e.data("mpttDropdownClass")),e.nestedSortable(t.nestedOptions),e.find("li").attrchange((function(e){"class"==e&&$(this).hasClass(t.nestedOptions.expandedClass)&&$(this).parent().find("li").not(this).removeClass(t.nestedOptions.expandedClass)})))}))}}},{nestedSelector:".mptt",nestedOptions:{listType:"ul",handle:".handle",items:"li:not(.menu)",toleranceElement:"> div",disableNestingClass:"no-nesting",errorClass:"ui-sortable-placeholder-error",placeholder:"ui-sortable-placeholder",expandedClass:"open",collapsedClass:"collpased",branchClass:"dropdown",leafClass:null,forcePlaceholderSize:!0,opacity:.8,revert:!0,maxLevels:1,expandOnHover:500,helper:function(e,t){return $(this).data("mpttIsTree")&&!$(this).hasClass("navmenu-nav")&&t.css({height:"25px",width:"50px"}),t},stop:function(e,t){$(this).data("mpttIsTree")&&t.item.css({height:"",width:""})},update:function(e,t){var n=$(this).nestedSortable("toArray",{startDepthCount:0}),i=$(this).data("mpttUpdate");$.nette.ajax({prepare:function(e){e.type="POST",e.url=i,e.dataType="json",e.data={tree:JSON.stringify(n)}},off:["scrollTo"],beforeSend:function(e,t){t.nette.ui.outerHTML=t.nette.ui.outerHTML}},this,e)}}}),function(e,t){e.nette.ext("summernote-wysiwyg-editorx",{init:function(){var t=new tinymceElfinder({baseUrl:"/assets/vendor/elfinder/",url:"/elfinder/api",uploadTargetHash:"l1_lw",nodeId:"elfinder",uiOptions:{toolbarExtra:{displayTextLabel:"none",preferenceInContextmenu:!1}}}),n=[{class:"btn",css:{display:"inline-block","margin-bottom":"0px",padding:"6px 12px","border-radius":"4px",border:"1px solid"}},{class:"btn-default",css:{color:"#333","background-color":"#fff","border-color":"#ccc"}},{class:"btn-primary",css:{color:"#fff","background-color":"#2d8fce","border-color":"#2880b9"}},{class:"btn-success",css:{color:"#fff","background-color":"#33b55e","border-color":"#2da154"}},{class:"btn-danger",css:{color:"#fff","background-color":"#a82526","border-color":"#8b1f
1921f"}},{class:"btn-warning",css:{color:"#fff","background-color":"#edc01c","border-color":"#deb212"}},{class:"btn-info",css:{color:"#fff","background-color":"#3d4b5e","border-color":"#333f4f"}}];e(".email-template-list").children().each((function(){e(".template-dropdown").append('<li><a class="dropdown-item email-editor-add-template"  data-template-id="'+e(this).attr("id")+'" >'+e(this).attr("template-name")+" </a> </li>")})),e("#email-editor-modal-launcher").click((function(){o(),e("#email-editor").find(e(".btn")).each((function(){e(this).removeAttr("style")})),r()})),e(".email-editor-save").click((function(){o();var t=e("#email-template-saved"),i=e(".email-editor-wrapper");t.children().empty();var s=i.clone(!0),a="";s.each((function(){for(int in n)e(this).find("."+n[int].class).each((function(){e(this).css(n[int].css)}));a+=e(this).html()})),t.val(a.trim()),r()})),e(".email-editor-move-up-template").click((function(){var t=e(this).parent().parent().prev();e(this).parent().parent().insertBefore(t),e(this).parent().empty()})),e(".email-editor-move-down-template").click((function(){var t=e(this).parent().parent().next();e(this).parent().parent().insertAfter(t),e(this).parent().empty()})),e(".email-editor-remove-template").click((function(){e("#toolbar-safe-holder").append(e(".modal-toolbar-holder")),e(this).parent().parent().remove()}));function i(t){t.on("OpenWindow",(function(t){e(".modal-toolbar").css("transform","")})),t.on("CloseWindow",(function(t){e(".modal-toolbar").css("transform","translateY(-100%)"),e(".email-editor-wrapper").find("img").css("max-width","100%"),e(".email-editor-wrapper").find("img").css("height","auto"),e(".email-editor-wrapper").find("img").css("object-fit","contain")}))}function o(){tinymce.remove(".tinymce-heading"),tinymce.remove(".tinymce-body"),tinymce.remove(".tinymce-image"),e("[id*='mce_']").length&&e("[id*='mce_']").removeAttr("id")}function r(){var n=document.querySelector(".email-editor-wrapper").dataset.lang;e(".email-editor-wrapper").find(".tinymce-heading").each((function(){tinymce.init({target:e(this)[0],inline:!0,menubar:!1,language:n,fixed_toolbar_container:".modal-toolbar",plugins:["lists","autolink"],toolbar:"undo redo | bold italic underline",init_instance_callback:i})})),e(".email-editor-wrapper").find(".tinymce-image").each((function(){tinymce.init({target:e(this)[0],inline:!0,menubar:!1,language:n,image_dimensions:!1,object_resizing:!1,fixed_toolbar_container:".modal-toolbar",plugins:["image"],toolbar:"undo redo | remove image",valid_elements:"img[*]",relative_urls:!1,convert_urls:!1,base_url:"/assets/vendor/tinymce/",file_picker_callback:t.browser,init_instance_callback:i})})),e(".email-editor-wrapper").find(".tinymce-body").each((function(){tinymce.init({target:e(this)[0],inline:!0,menubar:!1,language:n,image_dimensions:!1,object_resizing:!1,fixed_toolbar_container:".modal-toolbar",plugins:["link","image","lists"],toolbar:["undo redo | bold italic underline | alignleft aligncenter alignright al
192ignfull | link | bullist numlist"],target_list:!1,link_class_list:[{title:tinymce.translate("None2"),value:""},{title:tinymce.translate("Default"),value:"btn btn-default"},{title:tinymce.translate("Primary"),value:"btn btn-primary"},{title:tinymce.translate("Success"),value:"btn btn-success"},{title:tinymce.translate("Danger"),value:"btn btn-danger"},{title:tinymce.translate("Warning"),value:"btn btn-warning"},{title:tinymce.translate("Info"),value:"btn btn-info"}],base_url:"/assets/vendor/tinymce/",file_picker_callback:t.browser,init_instance_callback:i})}))}e(".email-hover-wrapper").hover((function(){e(this).find(".email-template-btn-group").remove(),e(this).append('<span class="email-template-btn-group" style="position:absolute; right:5px; top: 5px; z-index: 9999"></span>');var t=e(".email-editor-remove-template").clone(!0,!0),n=e(".email-editor-move-up-template").clone(!0,!0),i=e(".email-editor-move-down-template").clone(!0,!0);e(this).children(".email-template-btn-group").append(t),e(this).prev(".email-hover-wrapper").length&&e(this).children(".email-template-btn-group").append(n),e(this).next(".email-hover-wrapper").length&&e(this).children(".email-template-btn-group").append(i)}),(function(){e(this).find(".email-template-btn-group").remove()})),e("[class*='tinymce-']").click((function(){e(".modal-toolbar-holder").insertBefore(e(this))})),e(document).on("focusin",(function(t){e(t.target).closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length&&t.stopImmediatePropagation()})),e(".email-editor-add-template").click((function(){o();var t=e("#"+this.dataset.templateId).clone(!0,!0);t.removeAttr("id"),e(".email-editor-wrapper").append(t),r()}))}})}(jQuery),function(e,t){e.nette.ext("summernote-wysiwyg-editor",{init:function(){var t=this,n=this.ext("snippets");e(".editable-content").click((function(){t.initWidgetEditor(this)})),n.after((function(n){n.find(".editable-content").each((function(n){e(this).click((function(){t.initWidgetEditor(this)}))}))})),e(".summernote-lite").each((function(e){t.initLiteEditor(this)})),n.after((function(e){e.find(".summernote-lite").each((function(e){t.initLiteEditor(this)}))})),n.before((function(e){e.find(".summernote-lite").each((function(e){t.removeLiteEditor(this)}))})),e(".summernote").each((function(){t.initBaseEditor(this)})),n.after((function(e){e.find(".summernote").each((function(e){t.initBaseEditor(this)}))})),n.before((function(e){e.find(".summernote").each((function(e){t.removeBaseEditor(this)}))}))}},{initWidgetEditor:function(e){let t=e.dataset.viewCode,n=`#${e.parentElement.id} .editable-content`,i="advlist autolink autoresize link image media lists charmap print preview table template",o=["undo redo | blocks | removeformat | bold italic underline hr | numlist bullist | alignleft aligncenter alignright al
192ignjustify | link image media table","save close"];"undefined"!=typeof editorTemplates&&(o[0]+=" template"),"undefined"!=typeof styleFormats&&(o[0]+=" styleselect"),t&&(i+=" code",o[0]+=" | code"),this.initEditor(n,i,o,!1,!1,!0,!1,!0)},initBaseEditor:function(e){let t=`#${e.id}.summernote`;this.initEditor(t,"advlist autolink link image lists table",["undo redo | blocks | removeformat | styleselect | bold italic underline hr | numlist bullist | alignleft aligncenter alignright | link image table"],!0,!0,!1,!1,!0)},removeBaseEditor:function(e){tinymce.remove(`#${e.id}.summernote`)},initLiteEditor:function(e){let t;if(t="TEXTAREA"===e.nodeName?e:e.querySelector("textarea"),!t)return;let n=e.dataset.viewCode,i=e.dataset.disableContextMenu,o=`#${t.id}`,r=e.dataset.allowedTags;r=r&&r.trim()?r:"*[*]";let s="advlist autolink link lists preview",a=["undo redo | removeformat | bold italic underline hr | numlist bullist | link"];n&&(s+=" code",a[0]+="| code"),this.initEditor(o,s,a,!0,!0,!1,i,!0,r)},removeLiteEditor:function(e){let t;t="TEXTAREA"===e.nodeName?e:e.querySelector("textarea"),t&&tinymce.remove(`#${t.id}`)},stripHtmlAttributes:function(e){var t=e.match(/(<\/?[\S][^>]*>)/gi);return null===t||t.forEach((function(t){e=e.replace(t,t.replace(/(data-.+?=".*?")|(data-.+?='.*?')|(data-[a-zA-Z0-9-]+)|(class=".*?")|(class='.*?')|(aria-.+?=".*?")|(aria-.+?='.*?')|(aria-[a-zA-Z0-9-]+)/g,""))})),e},initEditor:function(e,n,i,o=!1,r=!0,s=!1,a=!1,l=!1,c="*[*]"){let d=this,h=document.querySelector(e).dataset;var u=null;r||(u=new tinymceElfinder({baseUrl:"/assets/vendor/elfinder/",url:"/elfinder/api",uploadTargetHash:"l1_lw",nodeId:"elfinder",lang:h.lang,contextmenu:{navbar:["open","opennew","download","|","upload","mkdir","|","copy","cut","paste","duplicate","|","rm","empty","hide","|","rename","|","archive","|","places","info","chmod","netunmount"],cwd:["undo","redo","|","back","up","reload","|","upload","mkdir","mkfile","paste","|","empty","hide","|","view","sort","selectall","colwidth","|","places","info","chmod","netunmount"],files:["getfile","|","open","opennew","download","opendir","quicklook","|","upload","mkdir","|","copy","cut","paste","duplicate","|","rm","empty","hide","|","rename","edit","resize","|","archive","extract","|","selectall","selectinvert","|","places","info","chmod","netunmount"]},uiOptions:{toolbarExtra:{displayTextLabel:"none",preferenceInContextmenu:!1}}}));var p=["/assets/tinymce/skins/ui/oxide/content.min.css","/styles/tinymce/editor.css?v=1.0.0"];"undefined"!=typeof editorStyles&&p.push(editorStyles),"undefined"==typeof objectResizing&&(objectResizing=!0),c=c&&c.trim()?c:"*[*]",tinymce.init({selector:e,file_picker_callback:r?null:u.browser,base_url:"/assets/tinymce",suffix:".min",relative_urls:!1,language:h.lang,menubar:!1,initialized:o,plugins:n,toolbar:i,block_formats:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5",branding:!1,valid_styles:{"*":"",p:"text-align,color",h1:"text-align,color",h2:"text-align,color",h3:"text-align,color",h4:"text-align,color",h5:"text-align,color",h6:"text-align,color",span:"text-decoration,text-align,color",ul:"list-style-type",ol:"list-style-type",td:"text-align,width,height",th:"text-align,width,height",img:"float,margin,margin-left,margin-right,margin-top,margin-bottom",col:"width",tr:"height"},valid_elements:c,paste_preprocess:function(e,t){l&&(t.content=d.stripHtmlAttributes(t.content))},tableclass:"table",tablecaption:!1,table_advtab:!1,table_cell_advtab:!1,table_row_advtab:!1,remove_script_host:!1,convert_urls:!0,entity_encoding:"raw",content_css:p,contextmenu:!a&&"link linkchecker image imagetools table spellchecker configurepermanentpen copy cut paste pastetext",table_default_attributes:"undefined"==typeof disableTabeDefaultAttributes?{class:"table table-bordered"}:{},object_resizing:objectResizing,table_sizing_mode:"responsive",extended_valid_elements:"span[class|style]",style_formats:"undefined"!=typeof styleFormats?styleFormats:[],table_class_list:[{title:tinymce.translate("None2"),value:""},{title:tinymce.translate("TableBasic"),value:"table"},{title:tinymce.translate("Bordered"),value:"table table-bordered"},{title:tinymce.translate("Bordered-striped"),value:"table table-bordered table-striped"},{title:tinymce.translate("Striped"),value:"table table-striped"}],table_appearance_options:!1,body_class:"wysiwyg-editor-element"+(document.body.classList.contains("dark-layout")?" dark-layout":""),language_url:`/assets/tinymce/langs/${h.lang}.js?v=1.0.2`,toolbar_sticky:!o,image_dimensions:!1,image_class_list:[{title:tinymce.translate("None"),value:""},{title:tinymce.translate("Responsive"),menu:[{title:tinymce.translate("ResponsiveStandard"),value:"img-responsive"},{title:tinymce.translate("ResponsiveRounded"),value:"img-responsive img-rounded"},{title:tinymce.translate("ResponsiveCircle"),value:"img-responsive img-circle"}
192,{title:tinymce.translate("ResponsiveThumbnail"),value:"img-responsive img-thumbnail"}]},{title:tinymce.translate("Nonresponsive"),menu:[{title:tinymce.translate("Rounded"),value:"img-rounded"},{title:tinymce.translate("Circle"),value:"img-circle"},{title:tinymce.translate("Thumbnail"),value:"img-thumbnail"}]}],link_class_list:r?null:[{title:tinymce.translate("None2"),value:""},{title:tinymce.translate("Default"),menu:[{title:tinymce.translate("Default"),value:"btn btn-default"},{title:tinymce.translate("DefaultLg"),value:"btn btn-default btn-lg"},{title:tinymce.translate("DefaultBlock"),value:"btn btn-default btn-block"},{title:tinymce.translate("DefaultLgBlock"),value:"btn btn-default btn-lg btn-block"}]},{title:tinymce.translate("Primary"),menu:[{title:tinymce.translate("Primary"),value:"btn btn-primary"},{title:tinymce.translate("PrimaryLg"),value:"btn btn-primary btn-lg"},{title:tinymce.translate("PrimaryBlock"),value:"btn btn-primary btn-block"},{title:tinymce.translate("PrimaryLgBlock"),value:"btn btn-primary btn-lg btn-block"}]},{title:tinymce.translate("Success"),menu:[{title:tinymce.translate("Success"),value:"btn btn-success"},{title:tinymce.translate("SuccessLg"),value:"btn btn-success btn-lg"},{title:tinymce.translate("SuccessBlock"),value:"btn btn-success btn-block"},{title:tinymce.translate("SuccessLgBlock"),value:"btn btn-success btn-lg btn-block"}]},{title:tinymce.translate("Danger"),menu:[{title:tinymce.translate("Danger"),value:"btn btn-danger"},{title:tinymce.translate("DangerLg"),value:"btn btn-danger btn-lg"},{title:tinymce.translate("DangerBlock"),value:"btn btn-danger btn-block"},{title:tinymce.translate("DangerLgBlock"),value:"btn btn-danger btn-lg btn-block"}]},{title:tinymce.translate("Warning"),menu:[{title:tinymce.translate("Warning"),value:"btn btn-warning"},{title:tinymce.translate("WarningLg"),value:"btn btn-warning btn-lg"},{title:tinymce.translate("WarningBlock"),value:"btn btn-warning btn-block"},{title:tinymce.translate("WarningLgBlock"),value:"btn btn-warning btn-lg btn-block"}]},{title:tinymce.translate("Info"),menu:[{title:tinymce.translate("Info"),value:"btn btn-info"},{title:tinymce.translate("InfoLg"),value:"btn btn-info btn-lg"},{title:tinymce.translate("InfoBlock"),value:"btn btn-info btn-block"},{title:tinymce.translate("InfoLgBlock"),value:"btn btn-info btn-lg btn-block"}],value:"btn btn-info"}],media_alt_source:!1,image_advtab:!0,media_poster:!1,templates:"undefined"!=typeof editorTemplates?editorTemplates:[],setup:function(e){e.ui.registry.addButton("save",{text:tinymce.translate("Save"),icon:"save",onAction:function(){e.save(),d.saveContent(e,!0),e.remove()}}),e.ui.registry.addButton("close",{text:tinymce.translate("Close"),icon:"close",onAction:function(){e.resetContent(),e.remove(),window.onbeforeunload=function(e){}}})},init_instance_callback:function(e){if(h.toggleKeyup!==t){let t;editorElement=this.targetElm,e.on("keyup",(function(n){clearTimeout(t),t=setTimeout((()=>{e.save(),setTimeout((function(){editorElement.dispatchEvent(new Event("keyup"))}),50)}),50)}))}if(e.on("OpenWindow",(function(e){if("function"!=typeof e.dialog.getData)return;let t=e.dialog.getData();void 0!==t.src&&void 0!==t.classes&&""===t.src.value&&(t.classes="img-responsive",e.dialog.setData(t))})),h.blur!==t&&(e.on("blur",(function(t){e.save(),d.saveContent(e,!0),e.remove()})),document.querySelector(".css-path"))){let t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",document.querySelector(".css-path").innerText),e.iframeElement.contentWindow.document.head.append(t)}h.submitKeydown!==t&&e.on("keydown",(function(t){e.save(),e.targetElm.dispatchEvent(new Event("keydown"))})),e.on("change",(function(t){e.save(),s&&(window.onbeforeunload=function(e){return tinymce.translate("Leave page")})}))}})},saveContent:function(t,n){var i=this,o=e(t.targetElm);t.save();var r=t.getContent({format:"html"}),s=jQuery.Event("click",{pageX:o.parents(".widget").offset().left,pageY:o.parents(".widget").offset().top});e.nette.ajax({timeout:1e4,type:"post",url:o.data("process"),data:{text:r,column:o.data("c
192olumn"),sendSnippet:!0},success:function(e){!n&&e.textMessage&&i.showLabel(e.textMessage,o),window.onbeforeunload=function(){}}},o,s)}})}(jQuery),function(e,t){e.nette.ext("block-item-sortable",{load:function(){e.ui.sortable&&e(".block-item").sortable({revert:!0,placeholder:"ui-sortable-placeholder",cursor:"move",handle:".handle-item",update:function(t,n){var i=e(this).sortable("serialize");e.post(e(this).data("updateLink"),i)}})}},{})}(jQuery),function(e,t){e.nette.ext("item-sortable",{load:function(){e.ui.sortable&&e(".block-order").sortable({revert:!0,placeholder:"ui-sortable-placeholder",cursor:"move",handle:".handle",update:function(t,n){e(this).sortable("serialize");var i=0;e(this).find("[data-order]").each((function(){e(this).val(i),i++}))}})}},{})}(jQuery),function(e,t){e.nette.ext("widgets-sortable",{load:function(){if(e.ui.sortable){var t=this.ext("widgets");e(".block").sortable({revert:!0,placeholder:"ui-sortable-placeholder",connectWith:".block",cursor:"move",handle:".handle",update:function(n,i){if(e(i.item).hasClass("new-widget")){var o=i.item.offset(),r=i.item.data("widget"),s=e(this).data("addLink"),a=e(this).data("blockId"),l=e(this).find("> *").index(i.item),c=jQuery.Event("click",{pageX:o.left,pageY:o.top});i.href=s+"&widgetType="+r+"&block="+a+"&position="+l,t.add(c,i),i.item.removeClass("btn ui-draggable"),i.item.addClass("ui-sortable-placeholder new-widget"),i.item.css("height",""),i.item.css("width",""),i.item.css("display","block")}else{var d=e(this).sortable("serialize");e.post(e(this).data("updateLink"),d)}}})}}},{})}(jQuery),function(e,t){e.nette.ext("widgets",{init:function(){var t=this.ext("snippets"),n=this;e(".add-widget").click((function(e){n.add(e,this)})),e(".remove-widget").click((function(e){n.remove(e,this)})),e(".move-widget-up").click((function(e){n.moveUp(e,this)})),e(".move-widget-down").click((function(e){n.moveDown(e,this)})),t.after((function(e){e.find(".remove-widget").click((function(e){n.remove(e,this)})),e.find(".add-widget").click((function(e){n.add(e,this)})),e.find(".move-widget-up").click((function(e){n.moveUp(e,this)})),e.find(".move-widget-down").click((function(e){n.moveDown(e,this)}))}))},load:function(){e.ui.draggable&&e(".new-widget").draggable({connectToSortable:'.block:not([class*="hide"])',helper:"clone",revert:"invalid",appendTo:"body"})}},{add:function(t,n){var i=this.ext("snippets");e.nette.ajax({off:["snippets"],addSnippet:function(e,t,n){void 0===n||e.find("> *").length<n?e.append(t):n<=0?e.prepend(t):e.find("> *:eq("+(n-1)+")").after(t)},success:function(t){if(e(".ui-sortable-placeholder").remove(),t.block)var n=i.getElement(t.block);if(t.snippets){var o=[];for(var r in t.snippets){var s=i.getElement(r);if(!s.get(0)||t.err)if(s.get(0))o.push(s.get(0)),i.updateSnippet(s,t.snippets[r]);else{if(!n)continue;s=e("<div/>",{class:"widget-container",html:t.snippets[r],id:r}),this.addSnippet(n,s,t.position),o.push(s.get(0)),i.afterQueue.fire(s)}}e(o).promise().done((function(){i.completeQueue.fire()}))}}},n,t)},remove:function(t,n){e.nette.ajax({success:function(n){n.removed&&e(t.target).closest(".widget-container").remove()}},n,t)},moveUp:function(t,n){let i=e(n).closest(".widget-container");if(i.prev().length){i.prev().before(i);var o=e(n).closest(".block").sortable("serialize");e.post(e(n).closest(".block").data("updateLink"),o)}},moveDown:function(t,n){let i=e(n).closest(".widget-container");if(i.next().length){i.next().after(i);var o=e(n).closest(".block").sortable("serialize");e.post(e(n).closest(".block").data("updateLink"),o)}}})}(jQuery),function(e,t){e.nette.ext("widgets-items-sortable",{load:function(){e.ui.sortable&&e(".gallery").sortable({helper:"clone",revert:"invalid",forcePlaceholderSize:!0,placeholder:"ui-sortable-placeholder",cursor:"move",handle:".handle-item",create:function(t,n){if(!e(t.target).is("ul")&&!e(t.target).is("tbody")){var i=e(t.target).find('[class^="col-"]:not(.ui-sortable-helper)');i.length&&(e(this).sortable("option","placeholderWidth",i.width()),e(this).sortable("option","placeholderHeight",i.height()),e(this).sortable("option","placeholder","ui-sortable-placeholder item"))}},activate:function(t,n){if(!n.item.is("tr")&&!n.item.is("li")){var i=e(this).sortable("option","placeholderWidth"),o=e(this).sortable("option","placeholderHeight");i&&n.placeholder.width(parseFloat(i)-3),o&&n.placeholder.height(parseFloat(o)-5)}},start:function(t,n){n.item.removeClass("item");var i=3;e(this).parents(".row.in").length&&(i=2),e(this).find(".item").each((function(t,n){t%i==0?e(this).css({clear:"left"}):e(this).css({clear:""})}))},change:function(t,n){var i=3;e(this).parents(".row.in").length&&(i=2),e(this).find(".item").each((function(t,n){t%i==0?e(this).css({clear:"left"}):e(this).css({clear:""})}))},stop:function(t,n){n.item.addClass("item"),e(this).find(".item").css({clear:""})},update:function(t,n){var i=e(this).sortable("serialize");e.post(e(this).data("updateLink"),i)}})}},{})}(jQuery),function(e,t){e.nette.ext("items-description",{load:function(){var t;e(".gallery .item textarea,.gallery .item input").keydown((function(n){var i=e(this);clearTimeout(t),t=setTimeout((function(){e.post(i.parents(".gallery").data("updateItemLink"),{text:i.val(),id:i.data("id"),lang:i.data("lang")})}),400)}))}},{})}(jQuery),function(e,t){e.nette.ext("remove-block-ajax",{success:function(t){t.removeBlockId&&e("#"+t.removeBlockId).remove()}},{})}(jQuery),function(e,t){e.nette.ext("charts",{init:function(){var t=this,n=this.ext("snippets");e("[data-chart]").each((function(){var n=e(this);"bar"===n.data("chart")?t.initializeBarChart(n):"horizontalBar"===n.data("chart")?t.initializeHorizontalBarChart(n):"percentage"===n.data("type")?t.initializePercentagePieChart(n):"line"===n.data("chart")?t.initializeLineChart(n):t.initializeChart(n)})),n.after((function(n){n.find("[data-chart]").each((function(){var n=e(this);"bar"===n.data("chart")?t.initializeBarChart(n):"horizontalBar"===n.data("chart")?t.initializeHorizontalBarChart(n):"percentage"===n.data("type")?t.initializePercentagePieChart(n):t.initializeChart(n)}))}))}}
192,{pluginBarBackground:{id:"customCanvasBackgroundColor",beforeDraw:(e,t,n)=>{const{ctx:i}=e;i.save(),i.globalCompositeOperation="destination-over",i.fillStyle=n.color||"#99ffff",i.fillRect(0,0,e.width,e.height),i.restore()}},initializeBarChart:function(t){var n=e('<a href="#" class="btn btn-sm btn-default hidden-print hidden" download="'+t.attr("data-name")+'.png"><i class="icon icon-cloud-download"></i></a>');t.parent().append(n);var i=new Chart(t,{type:"bar",data:{labels:JSON.parse(t.attr("data-labels")),datasets:JSON.parse(t.attr("data-datasets"))},plugins:[ChartDataLabels,this.pluginBarBackground],options:{legend:{display:!t.attr("hide-legend")},plugins:{customCanvasBackgroundColor:{color:"white"}},responsive:!0,scales:{x:{},y:{suggestedMax:t.attr("data-yaxes-max")?t.attr("data-yaxes-max"):null,suggestedMin:t.attr("data-yaxes-min")?parseInt(t.attr("data-yaxes-min")):0,beginAtZero:!0,ticks:{stepSize:t.attr("data-step-size")?t.attr("data-step-size"):null}}},animation:{onComplete:function(){i&&t.attr("data-download")&&(n.attr("href",i.toBase64Image()),n.removeClass("hidden"))}}}})},initializeLineChart:function(t){var n=e('<a href="#" class="btn btn-sm btn-default hidden-print hidden" download="'+t.attr("data-name")+'.png"><i class="icon icon-cloud-download"></i></a>');t.parent().append(n);var i=new Chart(t,{type:"line",data:{labels:JSON.parse(t.attr("data-labels")),datasets:JSON.parse(t.attr("data-datasets"))}
192,plugins:[ChartDataLabels,this.pluginBarBackground],options:{legend:{display:!t.attr("hide-legend")},plugins:{customCanvasBackgroundColor:{color:"white"}},responsive:!0,scales:{x:{},y:{suggestedMax:t.attr("data-yaxes-max")?t.attr("data-yaxes-max"):null,suggestedMin:t.attr("data-yaxes-min")?parseInt(t.attr("data-yaxes-min")):0,beginAtZero:!0,ticks:{stepSize:t.attr("data-step-size")?t.attr("data-step-size"):null}}},animation:{onComplete:function(){i&&t.attr("data-download")&&(n.attr("href",i.toBase64Image()),n.removeClass("hidden"))}}}})},initializeChart:function(e){new Chart(e,{type:e.data("chart"),data:{labels:JSON.parse(e.attr("data-labels")),datasets:JSON.parse(e.attr("data-datasets"))},plugins:[ChartDataLabels],options:{legend:{position:e.attr("legend-position")?e.attr("legend-position"):"top"}}})},initializePercentagePieChart:function(t){var n=e('<a href="#" class="btn btn-sm btn-default hidden-print hidden" download="'+t.attr("data-name")+'.png"><i class="icon icon-cloud-download"></i></a>');t.parent().append(n);var i=new Chart(t,{type:t.data("chart"),data:{labels:JSON.parse(t.attr("data-labels")),datasets:JSON.parse(t.attr("data-datasets"))}
192,plugins:[ChartDataLabels,this.pluginBarBackground],options:{responsive:!0,aspectRatio:2,title:{display:!1},animation:{animateScale:!0,animateRotate:!0,onComplete:function(){i&&t.attr("data-download")&&(n.attr("href",i.toBase64Image()),n.removeClass("hidden"))}},plugins:{customCanvasBackgroundColor:{color:"white"},legend:{position:"bottom"},tooltip:{callbacks:{label:function(e){var t=e.dataset,n=t.data.reduce((function(e,t){return e+t})),i=t.data[e.dataIndex];return Math.floor(i/n*100+.5)+"%"}}}}}})},initializeHorizontalBarChart:function(t){var n=e('<a href="#" class="btn btn-sm btn-default hidden-print hidden" download="'+t.attr("data-name")+'.png"><i class="icon icon-cloud-download"></i></a>');t.parent().append(n);var i=new Chart(t,{type:"bar",data:{labels:JSON.parse(t.attr("data-labels")),datasets:JSON.parse(t.attr("data-datasets"))},plugins:[ChartDataLabels,this.pluginBarBackground],options:{indexAxis:"y",responsive:!0,plugins:{customCanvasBackgroundColor:{color:"white"}},animation:{onComplete:function(){i&&t.attr("data-download")&&(n.attr("href",i.toBase64Image()),n.removeClass("hidden"))}}}})}})}(jQuery),function(e,t){e.nette.ext("two-side-multiselect",{init:function(){var t,n=this;e(".two-side-multiselect").each((function(){n.initMultiselect(e(this))})),(t=this.ext("snippets"))&&t.after((function(t){t.find(".two-side-multiselect").each((function(){n.initMultiselect(e(this))}))}))}},{initMultiselect:function(t){t.multiselect({submitAllLeft:!1,rightAll:t.data("rightAll"),rightSelected:t.data("rightSelected"),leftAll:t.data("leftAll"),leftSelected:t.data("leftSelected"),search:{left:t.data("leftSearch")?'<input type="text" name="q" class="row-one-bottom form-control" placeholder="'+t.data("leftSearch")+'..." />':null,right:t.data("rightSearch")?'<input type="text" name="q" class="row-one-bottom form-control" placeholder="'+t.data("rightSearch")+'..." />':null},fireSearch:function(e){return e.length>2},moveFromAtoB:function(n,i,o,r,s,a,l){let c=o.data("optionsPrefix");return r.each((function(t,i){if(c&&!i.value.startsWith(c))return!0;var r=e(i);if(n.options.ignoreDisabled&&r.is(":disabled"))return!0;if(r.is("optgroup")||r.parent().is("optgroup")){var s=r.is("optgroup")?r:r.parent(),a="optgroup["+n.options.matchOptgroupBy+'="'+s.prop(n.options.matchOptgroupBy)+'"]',l=o.find(a);if(l.length||((l=s.clone(!0)).empty(),o.move(l)),r.is("optgroup")){var d="";n.options.ignoreDisabled&&(d=":not(:disabled)"),l.move(r.find("option"+d))}else l.move(r);s.removeIfEmpty()}else o.move(r)})),t.triggerHandler("change"),n}})}})}(jQuery);var Happy,dataGridRegisterAjaxCall,dataGridLoad,dataGridSubmitForm,bind=function(e,t){return function(){return e.apply(t,arguments)}};if(Happy=function(){function e(){this.checkCheckboxState=bind(this.checkCheckboxState,this),this.checkCheckboxStateOnChange=bind(this.checkCheckboxStateOnChange,this),this.checkCheckboxStateOnClick=bind(this.checkCheckboxStateOnClick,this),this.radioOnChange=bind(this.radioOnChange,this),this.colors=["primary","success","info","warning","danger","white","gray"],this.templates={radio:'<div class="happy-radio"><b></b></div>',checkbox:'<div class="happy-checkbox"> <svg viewBox="0 0 30 30"> <rect class="mark-storke" x="15" y="3" rx="1" ry="1" width="10" height="4"/> <rect class="mark-storke" x="-7" y="21" rx="1" ry="1" width="19" height="4"/> </svg> </div>',text:"",textarea:""}}return e.prototype.colorify=function(e,t,n){return e.classList.contains(n)&&t.classList.add(n),e.classList.contains(n+"-border")?t.classList.add(n+"-border"):void 0},e.prototype.thicknessify=function(e,t){return e.classList.contains("thin")?t.classList.add("thin"):void 0},e.prototype.setNames=function(e,t){var n;return t.setAttribute("data-name",e.getAttribute("name")),!1!==(n=e.getAttribute("value"))&&null!==n?t.setAttribute("data-value",e.getAttribute("value")):void 0},e.prototype.init=function(){return this.initRadio(),this.initCheckbox()},e.prototype.removeBySelector=function(e){var t,n,i,o,r;for(r=[],i=0,o=(n=document.querySelectorAll(e)).length;o>i;i++)t=n[i],r.push(t.parentNode.removeChild(t));return r},e.prototype.reset=function(){return this.removeBySelector(".happy-radio"),this.removeBySelector(".happy-checkbox"),this.init()},e.prototype.initRadio=function(){var e,t,n,i,o,r,s,a,l,c;for(c=[],n=0,s=(o=document.querySelectorAll("input[type=radio].happy")).length;s>n;n++){for((i=o[n]).insertAdjacentHTML("afterend",this.templates.radio),t=i.nextElementSibling,r=0,a=(l=this.colors).length;a>r;r++)e=l[r],this.colorify(i,t,e),this.setNames(i,t);this.thicknessify(i,t),this.checkRadioState(i),c.push(document.addEventListener("change",this.radioOnChange))}return c},e.prototype.radioOnChange=function(e){var t,n,i,o,r;if((r=e.target).classList.contains("happy")){for(o='.happy-radio[data-name="'+r.getAttribute("name")+'"]',n=0,i=(t=document.querySelectorAll(
192o)).length;i>n;n++)t[n].classList.remove("active");return this.checkRadioState(r)}},e.prototype.checkRadioState=function(e){var t,n;return e.checked&&(n='.happy-radio[data-name="'+e.getAttribute("name")+'"][data-value='+e.getAttribute("value")+"]",t=document.querySelector(n))?t.classList.add("active"):void 0},e.prototype.initCheckbox=function(){var e,t,n,i,o,r,s,a,l,c;for(c=[],n=0,s=(o=document.querySelectorAll("input[type=checkbox].happy")).length;s>n;n++){for((i=o[n]).insertAdjacentHTML("afterend",this.templates.checkbox),t=i.nextElementSibling,r=0,a=(l=this.colors).length;a>r;r++)e=l[r],this.colorify(i,t,e),this.setNames(i,t);this.thicknessify(i,t),this.checkCheckboxState(i),document.addEventListener("click",this.checkCheckboxStateOnClick),c.push(document.addEventListener("change",this.checkCheckboxStateOnChange))}return c},e.prototype.checkCheckboxStateOnClick=function(e){var t,n,i,o;return(n="svg"===e.target.tagName?e.target.parentNode:"rect"===e.target.tagName?e.target.parentNode.parentNode:e.target)&&n.classList.contains("happy-checkbox")?(e.preventDefault(),o='input[type=checkbox][name="'+n.getAttribute("data-name")+'"]',(i=document.querySelector(o))?(n.classList.contains("active")?(i.checked=!1,n.classList.remove("active")):(i.checked=!0,n.classList.add("active")),t=new Event("change",{bubbles:!0}),i.dispatchEvent(t)):void 0):void 0},e.prototype.checkCheckboxStateOnChange=function(e){var t;return e.target.classList.contains("happy")?(t=e.target,this.checkCheckboxState(t)):void 0},e.prototype.checkCheckboxState=function(e){var t,n;return n='.happy-checkbox[data-name="'+e.getAttribute("name")+'"]',(t=document.querySelector(n))?e.checked?t.classList.add("active"):t.classList.remove("active"):void 0},e}(),document.addEventListener("DOMContentLoaded",(function(){return window.happy=new Happy,window.happy.init()})),"undefined"!=typeof naja){var isNaja2=function(){return naja&&naja.VERSION&&naja.VERSION>=2},najaEventParams=function(e){return isNaja2()?e.detail:e},najaRequest=function(e){return isNaja2()?e.detail.request:e.xhr};dataGridRegisterExtension=function(e,t){var n=t.init,i=t.success,o=t.before,r=t.complete,s=t.interaction,a=function(e,t){return this.name=t,this.initialize=function(e){n&&e.addEventListener("init",(function(e){n(najaEventParams(e).defaultOptions)})),i&&e.addEventListener("success",(function(e){var t=isNaja2()?e.detail.payload:e.response;i(t,najaEventParams(e).options)}));var t=e;isNaja2()&&(t=t.uiHandler),t.addEventListener("interaction",(function(e){isNaja2()?e.detail.options.nette={el:$(e.detail.element)}:e.options.nette={el:$(e.element)},s&&(s(najaEventParams(e).options)||e.preventDefault())})),o&&e.addEventListener("before",(function(e){o(najaRequest(e),najaEventParams(e).options)||e.preventDefault()})),r&&e.addEventListener("complete",(function(e){r(najaRequest(e),najaEventParams(e).options)}))},isNaja2()||this.initialize(e),this};isNaja2()?naja.registerExtension(new a(null,e)):naja.registerExtension(a,e)},dataGridRegisterAjaxCall=function(e){var t=e.type||"GET",n=e.data||null;naja.makeRequest(t,e.url,n,{}).then(e.success).catch(e.error)},dataGridLoad=function(){naja.load()},dataGridSubmitForm=function(e){return naja.uiHandler.submitForm(e.get(0))}}else{if(!$.nette)throw new Error("Include Naja.js or nette.ajax for datagrids to work!");dataGridRegisterExtension=function(e,t){$.nette.ext(e,t)},dataGridRegisterAjaxCall=function(e){$.nette.ajax(e)},dataGridLoad=function(){$.nette.load()},dataGridSubmitForm=function(e){return e.submit()}}var datagridFitlerMultiSelect,datagridGroupActionMultiSelect,datagridShiftGroupSelection,datagridSortable,datagridSortableTree,getEventDomPath,dataGridRegisterExtension,indexOf=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1};if($(document).on("click","[data-datagrid-confirm]:not(.ajax)",(function(e){if(!confirm($(e.target).closest("a").attr("data-datagrid-confirm")))return e.stopPropagation(),e.preventDefault()})),"undefined"!=typeof naja?dataGridRegisterExtension("datagrid.confirm",{interaction:function(e){var t;return!e.nette||!(t=e.nette.el.data("datagrid-confirm"))||confirm(t)}}):dataGridRegisterExtension("datagrid.confirm",{before:function(e,t){var n;return!t.nette||!(n=t.nette.el.data("datagrid-confirm"))||confirm(n)}}),$(document).on("change","select[data-autosubmit-per-page]",(function(){var e;return 0===(e=$(this).parent().find("input[type=submit]")).length&&(e=$(this).parent().find("button[type=submit]")),e.click()})).on("change","select[data-autosubmit]",(function(){return dataGridSubmitForm($(this).closest("form").first())}
192)).on("change","input[data-autosubmit][data-autosubmit-change]",(function(e){var t;return e.which||e.keyCode||0,clearTimeout(window.datagrid_autosubmit_timer),t=$(this),window.datagrid_autosubmit_timer=setTimeout((function(){return dataGridSubmitForm(t.closest("form").first())}),200)})).on("keyup","input[data-autosubmit]",(function(e){var t,n;if(13===(n=e.which||e.keyCode||0)||!(n>=9&&n<=40||n>=112&&n<=123))return clearTimeout(window.datagrid_autosubmit_timer),t=$(this),window.datagrid_autosubmit_timer=setTimeout((function(){return dataGridSubmitForm(t.closest("form").first())}),200)})).on("keydown",".datagrid-inline-edit input",(function(e){if(13===(e.which||e.keyCode||0))return e.stopPropagation(),e.preventDefault(),$(this).closest("tr").find('.col-action-inline-edit [name="inline_edit[submit]"]').click()})),$(document).on("keydown","input[data-datagrid-manualsubmit]",(function(e){if(13===(e.which||e.keyCode||0))return e.stopPropagation(),e.preventDefault(),dataGridSubmitForm($(this).closest("form").first())})),getEventDomPath=function(e){var t,n;if(indexOf.call(e,n)>=0)return e.path;for(n=[],t=e.target;t!==document.body&&null!==t;)n.push(t),t=t.parentNode;return n},(datagridShiftGroupSelection=function(){var e;return e=null,document.addEventListener("click",(function(t){var n,i,o,r,s,a,l,c,d,h,u,p,f,m,g,v,b;for(s=0,h=(f=getEventDomPath(t)).length;s<h;s++)if(o=f[s],$(o).is(".col-checkbox")&&e&&t.shiftKey){if(i=$(o).closest("tr"),n=(d=e.closest("tr")).closest("tbody").find("tr").toArray(),i.index()>d.index()?b=n.slice(d.index(),i.index()):i.index()<d.index()&&(b=n.slice(i.index()+1,d.index())),!b)return;for(l=0,u=b.length;l<u;l++)v=b[l],(a=$(v).find(".col-checkbox input[type=checkbox]")[0])&&(a.checked=!0,window.navigator.userAgent.indexOf("MSIE ")?(r=document.createEvent("Event")).initEvent("change",!0,!0):r=new Event("change",{bubbles:!0}),a.dispatchEvent(r))}for(g=[],c=0,p=(m=getEventDomPath(t)).length;c<p;c++)o=m[c],$(o).is(".col-checkbox")?g.push(e=$(o)):g.push(void 0);return g}))})(),document.addEventListener("change",(function(e){var t,n,i,o,r,s,a,l,c,d,h,u;if((r=e.target.getAttribute("data-check"))&&(n=document.querySelectorAll("input[data-check-all-"+r+"]:checked"),h=document.querySelector(".datagrid-"+r+' select[name="group_action[group_action]"]'),t=document.querySelectorAll(".datagrid-"+r+' .row-group-actions *[type="submit"]'),i=document.querySelector(".datagrid-"+r+" .datagrid-selected-rows-count"),n.length?(t&&t.forEach((function(e){e.disabled=!1})),h&&(h.disabled=!1),u=document.querySelectorAll("input[data-check-all-"+r+"]").length,i&&(i.innerHTML=n.length+"/"+u)):(t&&t.forEach((function(e){e.disabled=!0})),h&&(h.disabled=!0,h.value=""),i&&(i.innerHTML="")),window.navigator.userAgent.indexOf("MSIE ")?(o=document.createEvent("Event")).initEvent("change",!0,!0):o=new Event("change",{bubbles:!0}),h&&h.dispatchEvent(o)),r=e.target.getAttribute("data-check-all")){for(d=[],s=0,c=(l=document.querySelectorAll("input[type=checkbox][data-check-all-"+r+"]")).length;s<c;s++)(a=l[s]).checked=e.target.checked,window.navigator.userAgent.indexOf("MSIE ")?(o=document.createEvent("Event")).initEvent("change",!0,!0):o=new Event("change",{bubbles:!0}),d.push(a.dispatchEvent(o));return d}})),window.datagridSerializeUrl=function(e,t){var n=[];for(var i in e)if(e.hasOwnProperty(i)){var o=t?t+"["+i+"]":i,r=e[i];if(null!==r&&""!==r)if("object"==typeof r){var s=window.datagridSerializeUrl(r,o);s&&n.push(s)}else n.push(encodeURIComponent(o)+"="+encodeURIComponent(r))}return n.join("&")},datagridSortable=function(){if(void 0!==$.fn.sortable)return $(".datagrid [data-sortable]").sortable({handle:".handle-sort",items:"tr",axis:"y",update:function(e,t){var n,i,o,r,s,a,l;return o=(a=t.item.closest("tr[data-id]")).data("id"),s=null,r=null,a.prev().length&&(s=a.prev().data("id")),a.next().length&&(r=a.next().data("id")),l=$(this).data("sortable-url"),(i={})[((n=a.closest(".datagrid").find("tbody").attr("data-sortable-parent-path"))+"-item_id").replace(/^-/,"")]=o,null!==s&&(i[(n+"-prev_id").replace(/^-/,"")]=s),null!==r&&(i[(n+"-next_id").replace(/^-/,"")]=r),dataGridRegisterAjaxCall({type:"GET",url:l,data:i,error:function(e,t,n){return alert(e.statusText)}})},helper:function(e,t){return t.children().each((function(){return $(this).width($(this).width())})),t}}
192)},$((function(){return datagridSortable()})),void 0===datagridSortableTree&&(datagridSortableTree=function(){if(void 0!==$(".datagrid-tree-item-children").sortable)return $(".datagrid-tree-item-children").sortable({handle:".handle-sort",items:".datagrid-tree-item:not(.datagrid-tree-header)",toleranceElement:"> .datagrid-tree-item-content",connectWith:".datagrid-tree-item-children",update:function(e,t){var n,i,o,r,s,a,l,c,d;if($(".toggle-tree-to-delete").remove(),o=(c=t.item.closest(".datagrid-tree-item[data-id]")).data("id"),l=null,r=null,a=null,c.prev().length&&(l=c.prev().data("id")),c.next().length&&(r=c.next().data("id")),(s=c.parent().closest(".datagrid-tree-item")).length&&(s.find(".datagrid-tree-item-children").first().css({display:"block"}),s.addClass("has-children"),a=s.data("id")),d=$(this).data("sortable-url"))return s.find("[data-toggle-tree]").first().removeClass("hidden"),(i={})[((n=c.closest(".datagrid-tree").attr("data-sortable-parent-path"))+"-item_id").replace(/^-/,"")]=o,null!==l&&(i[(n+"-prev_id").replace(/^-/,"")]=l),null!==r&&(i[(n+"-next_id").replace(/^-/,"")]=r),i[(n+"-parent_id").replace(/^-/,"")]=a,dataGridRegisterAjaxCall({type:"GET",url:d,data:i,error:function(e,t,n){if("abort"!==n)return alert(e.statusText)}})},stop:function(e,t){return $(".toggle-tree-to-delete").removeClass("toggle-tree-to-delete")},start:function(e,t){var n;if((n=t.item.parent().closest(".datagrid-tree-item")).length&&2===n.find(".datagrid-tree-item").length)return n.find("[data-toggle-tree]").addClass("toggle-tree-to-delete")}})}),$((function(){return datagridSortableTree()})),dataGridRegisterExtension("datagrid.happy",{success:function(){var e,t,n,i,o,r,s,a,l,c,d;for(window.happy&&window.happy.reset(),d=[],r=0,l=(o=$(".datagrid")).length;r<l;r++){for(t="",a=0,c=(n=o[r].classList).length;a<c;a++)t=t+"."+n[a];1===(e=document.querySelectorAll(t+" input[data-check]:checked")).length&&"toggle-all"===e[0].getAttribute("name")&&(s=document.querySelector(t+" input[name=toggle-all]"))?(s.checked=!1,window.navigator.userAgent.indexOf("MSIE ")?(i=document.createEvent("Event")).initEvent("change",!0,!0):i=new Event("change",{bubbles:!0}),d.push(s.dispatchEvent(i))):d.push(void 0)}return d}}),dataGridRegisterExtension("datagrid.sortable",{success:function(){return datagridSortable()}}),dataGridRegisterExtension("datagrid.forms",{success:function(){return $(".datagrid").find("form").each((function(){return window.Nette.initForm(this)}))}}),dataGridRegisterExtension("datagrid.url",{success:function(e){var t,n,i,o;if(e._datagrid_url&&window.history.replaceState&&(t=window.location.protocol+"//"+window.location.host,n=window.location.pathname,o=(i=window.datagridSerializeUrl(e.state).replace(/&+$/gm,""))?t+n+"?"+i.replace(/\&*$/,""):t+n,o+=window.location.hash,window.location.href!==o))return window.history.replaceState({path:o},"",o)}}),dataGridRegisterExtension("datagrid.sort",{success:function(e){var t,n,i,o;if(e._datagrid_sort){for(n in o=[],i=e._datagrid_sort)t=i[n],o.push($("#datagrid-sort-"+n).attr("href",t));return o}}}),dataGridRegisterExtension("datargid.item_detail",{before:function(e,t){var n,i,o;return!t.nette||!t.nette.el.attr("data-toggle-detail")||(n=t.nette.el.attr("data-toggle-detail"),o=t.nette.el.attr("data-toggle-detail-grid-fullname"),(i=$(".item-detail-"+o+"-id-"+n)).hasClass("loaded")?i.find(".item-detail-content").length?(i.hasClass("toggled")?i.find(".item-detail-content").slideToggle("fast",(function(){return i.toggleClass("toggled")})):(i.toggleClass("toggled"),i.find(".item-detail-content").slideToggle("fast")),!1):(i.removeClass("toggled"),!0):i.addClass("loaded"))},success:function(e){var t,n,i;if(e._datagrid_toggle_detail&&e._datagrid_name)return t=e._datagrid_toggle_detail,i=e._datagrid_name,(n=$(".item-detail-"+i+"-id-"+t)).toggleClass("toggled"),n.find(".item-detail-content").slideToggle("fast")}}),dataGridRegisterExtension("datagrid.tree",{before:function(e,t){var n;return!(t.nette&&t.nette.el.attr("data-toggle-tree")&&(t.nette.el.toggleClass("toggle-rotate"),(n=t.nette.el.closest(".datagrid-tree-item").find(".datagrid-tree-item-children").first()).hasClass("loaded")))||(n.slideToggle("fast"),!1)},success:function(e){var t,n,i,o,r,s,a;if(e._datagrid_tree){for(o in i=e._datagrid_tree,(t=$('.datagrid-tree-item[data-id="'+i+'"]').find(".datagrid-tree-item-children").first()).addClass("loaded"),r=e.snippets)s=r[o],n=$(s),(a=$('<div class="datagrid-tree-item" id="'+o+'">')).attr("data-id",n.attr("data-id")),a.append(n),n.data("has-children")&&a.addClass("has-children"),t.append(a);t.addClass("loaded"),t.slideToggle("fast"),dataGridLoad()}return datagridSortableTree()}}),$(document).on("click","[data-datagrid-editable-url]",(function(e){var t,n,i,o,r,s,a,l,c,d;if(o=$(this),"a"!==e.target.tagName.toLowerCase()&&!o.hasClass("datagrid-inline-edit")&&!o.hasClass("editing")){for(t in o.addClass("editing"),r=o.html().trim().replace("<br>","\n"),d=o.attr("data-datagrid-editable-value")?o.data("datagrid-editable-value"):r,o.data("originalValue",r),o.data("valueToEdit",d),"textarea"===o.data("datagrid-editable-type")?(l=$("<textarea>"+d+"</textarea>"),a=parseInt(o.css("padding").replace(/[^-\d\.]/g,""),10),s=(o.outerHeight()-2*a)/Math.round(parseFloat(o.css("line-height"))),l.attr("rows",Math.round(s))):"select"===o.data("datagrid-editable-type")?(l=$(o.data("datagrid-editable-element"))).find("option[value='"+d+"']").prop("selected",!0):(l=$('<input type="'+o.data("datagrid-editable-type")+'">')).val(d),i=o.data("datagrid-editable-attrs"))n=i[t],l.attr(t,n);return o.removeClass("edited"),o.html(l),c=function(e,t){var n;return(n=t.val())!==e.data("valueToEdit")?dataGridRegisterAjaxCall({url:e.data("datagrid-editable-url"),data:{value:n},type:"POST",success:function(t){return"select"===e.data("datagrid-editable-type")?e.html(l.find("option[value='"+n+"']").html()):(t._datagrid_editable_new_value&&(n=t._datagrid_editable_new_value),e.html(n)),e.addClass("edited")},error:function(){return e.html(e.data("originalValue")),e.addClass("edited-error")}}):e.html(e.data("originalValue")),setTimeout((function(){return e.removeClass("editing")}),1200)},o.find("input,textarea,select").focus().on("blur",(function(){return c(o,$(this))})).on("keydown",(function(e){return"textarea"!==o.data("datagrid-editable-type")&&13===e.which?(e.stopPropagation(),e.preventDefault(),c(o,$(this))):27===e.which?(e.stopPropagation(),e.preventDefault(),o.removeClass("editing"),o.html(o.data("originalValue"))):void 0})),o.find("select").on("change",(function(){return c(o,$(this))}))}})),dataGridRegisterExtension("datagrid.after_inline_edit",{success:function(e){var t=$(".datagrid-"+e._datagrid_name);return e._datagrid_inline_edited?(t.find("tr[data-id="+e._datagrid_inline_edited+"] > td").addClass("edited"),t.find(".datagrid-inline-edit-trigger").removeClass("hidden")):e._datagrid_inline_edit_cancel?t.find(".datagrid-inline-edit-trigger").removeClass("hidden"):void 0}}),$(document).on("mouseup","[data-datagrid-cancel-inline-add]",(function(e){if(1===(e.which||e.keyCode||0))return e.stopPropagation(),e.preventDefault(),$(".datagrid-row-inline-add").addClass("datagrid-row-inline-add-hidden")})),dataGridRegisterExtension("datagrid-toggle-inline-add",{success:function(e){var t=$(".datagrid-"+e._datagrid_name);if(e._datagrid_inline_adding){var n=t.find(".datagrid-row-inline-add");n.hasClass("datagrid-row-inline-add-hidden")&&n.removeClass("datagrid-row-inline-add-hidden"),n.find("input:not([readonly]),textarea:not([readonly])").first().focus()}}}
192),datagridFitlerMultiSelect=function(){var e=$(".selectpicker").first();if($.fn.selectpicker)return $.fn.selectpicker.defaults={countSelectedText:e.data("i18n-selected"),iconBase:"",tickIcon:e.data("selected-icon-check"),styleBase:""}},$((function(){return datagridFitlerMultiSelect()})),datagridGroupActionMultiSelect=function(){if($.fn.selectpicker)return $("[data-datagrid-multiselect-id]").each((function(){var e;if($(this).hasClass("selectpicker"))return $(this).removeAttr("id"),e=$(this).data("datagrid-multiselect-id"),$(this).on("loaded.bs.select",(function(e){return $(this).parent().attr("style","display:none;"),$(this).parent().find(".hidden").removeClass("hidden").addClass("btn-default btn-secondary")})),$(this).on("rendered.bs.select",(function(t){return $(this).parent().attr("id",e)}))}))},$((function(){return datagridGroupActionMultiSelect()})),dataGridRegisterExtension("datagrid.fitlerMultiSelect",{success:function(){if(datagridFitlerMultiSelect(),$.fn.selectpicker)return $(".selectpicker").selectpicker({iconBase:"fa"})}}),dataGridRegisterExtension("datagrid.groupActionMultiSelect",{success:function(){return datagridGroupActionMultiSelect()}}),dataGridRegisterExtension("datagrid.inline-editing",{success:function(e){if(e._datagrid_inline_editing)return $(".datagrid-"+e._datagrid_name).find(".datagrid-inline-edit-trigger").addClass("hidden")}}),dataGridRegisterExtension("datagrid.redraw-item",{success:function(e){if(e._datagrid_redraw_item_class)return $("tr[data-id="+e._datagrid_redraw_item_id+"]").attr("class",e._datagrid_redraw_item_class)}}),dataGridRegisterExtension("datagrid.reset-filter-by-column",{success:function(e){var t,n,i,o,r,s;if(e._datagrid_name&&((t=$(".datagrid-"+e._datagrid_name)).find("[data-datagrid-reset-filter-by-column]").addClass("hidden"),e.non_empty_filters&&e.non_empty_filters.length)){for(i=0,r=(s=e.non_empty_filters).length;i<r;i++)o=s[i],t.find("[data-datagrid-reset-filter-by-column="+o+"]").removeClass("hidden");return n=t.find(".reset-filter").attr("href"),t.find("[data-datagrid-reset-filter-by-column]").each((function(){var t;return o=$(this).attr("data-datagrid-reset-filter-by-column"),t=n.replace("do="+e._datagrid_name+"-resetFilter","do="+e._datagrid_name+"-resetColumnFilter"),t+="&"+e._datagrid_name+"-key="+o,$(this).attr("href",t)}))}}}),"undefined"!=typeof naja){isNaja2=function(){return naja&&naja.VERSION&&naja.VERSION>=2},najaEventParams=function(e){return isNaja2()?e.detail:e},najaRequest=function(e){return isNaja2()?e.detail.request:e.xhr};dataGridRegisterExtension=function(e,t){var n=t.init,i=t.success,o=t.before,r=t.complete,s=function(e,t){return this.name=t,this.initialize=function(e){n&&e.addEventListener("init",(function(e){n(najaEventParams(e).defaultOptions)})),i&&e.addEventListener("success",(function(e){var t=isNaja2()?e.detail.payload:e.response;i(t,najaEventParams(e).options)})),o&&e.addEventListener("before",(function(e){o(najaRequest(e),najaEventParams(e).options)})),r&&e.addEventListener("complete",(function(e){r(najaRequest(e),najaEventParams(e).options)}))},isNaja2()||this.initialize(e),this};isNaja2()?naja.registerExtension(new s(null,e)):naja.registerExtension(s,e)}}else $.nette&&(dataGridRegisterExtension=function(e,t){$.nette.ext(e,t)});dataGridRegisterExtension("ublaboo-spinners",{before:function(e,t){var n,i,o,r;if(t.nette){if(n=t.nette.el,o=$('<div class="ublaboo-spinner ublaboo-spinner-small"><i></i><i></i><i></i><i></i></div>'),n.is('.datagrid [name="group_action[submit]"]'))return n.after(o);if(n.is(".datagrid a")&&n.data("toggle-detail")){if(i=t.nette.el.attr("data-toggle-detail"),r=t.nette.el.attr("data-toggle-detail-grid-fullname"),!$(".item-detail-"+r+"-id-"+i).hasClass("loaded"))return n.addClass("ublaboo-spinner-icon")}else{if(n.is(".datagrid .col-pagination a"))return n.closest(".row-grid-bottom").find(".col-per-page").prepend(o);if(n.is(".datagrid .datagrid-per-page-submit"))return n.closest(".row-grid-bottom").find(".col-per-page").prepend(o);if(n.is(".datagrid .reset-filter"))return n.closest(".row-grid-bottom").find(".col-per-page").prepend(o)}}},complete:function(){return $(".ublaboo-spinner").remove(),$(".ublaboo-spinner-icon").removeClass("ublaboo-spinner-icon")}}),
193/*!
194 * typeahead.js 1.3.1
195 * https://github.com/corejavascript/typeahead.js
196 * Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT
197 */
198function(e,t){"function"==typeof define&&define.amd?define(["jquery"],(function(e){return t(e)})):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,(function(e){var t=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(e){return!e||/^\s*$/.test(e)},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(e){return void 0===e},isElement:function(e){return!(!e||1!==e.nodeType)},isJQuery:function(t){return t instanceof e},toStr:function(e){return t.isUndefined(e)||null===e?"":e+""},bind:e.proxy,each:function(t,n){e.each(t,(function(e,t){return n(t,e)}))},map:e.map,filter:e.grep,every:function(t,n){var i=!0;return t?(e.each(t,(function(e,o){if(!(i=n.call(null,o,e,t)))return!1})),!!i):i},some:function(t,n){var i=!1;return t?(e.each(t,(function(e,o){if(i=n.call(null,o,e,t))return!1})),!!i):i},mixin:e.extend,identity:function(e){return e},clone:function(t){return e.extend(!0,{},t)},getIdGenerator:function(){var e=0;return function(){return e++}},templatify:function(t){return e.isFunction(t)?t:function(){return String(t)}},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var i,o;return function(){var r,s,a=this,l=arguments;return r=function(){i=null,n||(o=e.apply(a,l))},s=n&&!i,clearTimeout(i),i=setTimeout(r,t),s&&(o=e.apply(a,l)),o}},throttle:function(e,t){var n,i,o,r,s,a;return s=0,a=function(){s=new Date,o=null,r=e.apply(n,i)},function(){var l=new Date,c=t-(l-s);return n=this,i=arguments,c<=0?(clearTimeout(o),o=null,s=l,r=e.apply(n,i)):o||(o=setTimeout(a,c)),r}},stringify:function(e){return t.isString(e)?e:JSON.stringify(e)},guid:function(){function e(e){var t=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+t.substr(0,4)+"-"+t.substr(4,4):t}return"tt-"+e()+e(!0)+e(!0)+e()},noop:function(){}}}(),n=function(){"use strict";var e={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-
198open",cursor:"tt-cursor",highlight:"tt-highlight"};return function(r){var s,a;return a=t.mixin({},e,r),{css:(s={css:o(),classes:a,html:n(a),selectors:i(a)}).css,html:s.html,classes:s.classes,selectors:s.selectors,mixin:function(e){t.mixin(e,s)}}};function n(e){return{wrapper:'<span class="'+e.wrapper+'"></span>',menu:'<div role="listbox" class="'+e.menu+'"></div>'}}function i(e){var n={};return t.each(e,(function(e,t){n[t]="."+e})),n}function o(){var e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),e}}(),i=function(){"use strict";var n;function i(t){t&&t.el||e.error("EventBus initialized without el"),this.$el=e(t.el)}return"typeahead:",n={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},t.mixin(i.prototype,{_trigger:function(t,n){var i=e.Event("typeahead:"+t);return this.$el.trigger.call(this.$el,i,n||[]),i},before:function(e){var t;return t=[].slice.call(arguments,1),this._trigger("before"+e,t).isDefaultPrevented()},trigger:function(e){var t;this._trigger(e,[].slice.call(arguments,1)),(t=n[e])&&this._trigger(t,[].slice.call(arguments,1))}}),i}(),o=function(){"use strict";var e=/\s+/,t=function(){var e;e=window.setImmediate?function(e){setImmediate((function(){e()}))}:function(e){setTimeout((function(){e()}),0)};return e}();return{onSync:function(e,t,i){return n.call(this,"sync",e,t,i)},onAsync:function(e,t,i){return n.call(this,"async",e,t,i)},off:function(t){var n;if(!this._callbacks)return this;t=t.split(e);for(;n=t.shift();)delete this._callbacks[n];return this},trigger:function(n){var o,r,s,a,l;if(!this._callbacks)return this;n=n.split(e),s=[].slice.call(arguments,1);for(;(o=n.shift())&&(r=this._callbacks[o]);)a=i(r.sync,this,[o].concat(s)),l=i(r.async,this,[o].concat(s)),a()&&t(l);return this}};function n(t,n,i,o){var r;if(!i)return this;for(n=n.split(e),i=o?function(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}(i,o):i,this._callbacks=this._callbacks||{};r=n.shift();)this._callbacks[r]=this._callbacks[r]||{sync:[],async:[]},this._callbacks[r][t].push(i);return this}function i(e,t,n){return function(){for(var i,o=0,r=e.length;!i&&o<r;o+=1)i=!1===e[o].apply(t,n);return!i}}}(),r=function(e){"use strict";var n={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1,diacriticInsensitive:!1},i={A:"[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]",B:"[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]",C:"[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]",D:"[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]",E:"[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]",F:"[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]",G:"[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]",H:"[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]",I:"[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]",J:"[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]",K:"[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]",L:"[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]",M:"[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]",N:"[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]",O:"[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]",P:"[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]",Q:"[Qqℚ⒬Ⓠⓠ㏃Qq]",R:"[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]",S:"[SsŚ-šſȘșˢṠ
198-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]",T:"[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]",U:"[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]",V:"[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]",W:"[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]",X:"[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]",Y:"[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]",Z:"[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]"};return function(i){var r;(i=t.mixin({},n,i)).node&&i.pattern&&(i.pattern=t.isArray(i.pattern)?i.pattern:[i.pattern],r=function(e,n,i,r){for(var s,a=[],l=0,c=e.length;l<c;l++){var d=t.escapeRegExChars(e[l]);r&&(d=d.replace(/\S/g,o)),a.push(d)}return s=i?"\\b("+a.join("|")+")\\b":"("+a.join("|")+")",n?new RegExp(s):new RegExp(s,"i")}(i.pattern,i.caseSensitive,i.wordsOnly,i.diacriticInsensitive),function e(t,n){for(var i,o=0;o<t.childNodes.length;o++)3===(i=t.childNodes[o]).nodeType?o+=n(i)?1:0:e(i,n)}(i.node,(function(t){var n,o,s;(n=r.exec(t.data))&&(s=e.createElement(i.tagName),i.className&&(s.className=i.className),(o=t.splitText(n.index)).splitText(n[0].length),s.appendChild(o.cloneNode(!0)),t.parentNode.replaceChild(s,o));return!!n})))};function o(e){return i[e.toUpperCase()]||e}}(window.document),s=function(){"use strict";var n;function i(n,i){var o,r;(n=n||{}).input||e.error("input is missing"),i.mixin(this),this.$hint=e(n.hint),this.$input=e(n.input),this.$menu=e(n.menu),o=this.$input.attr("id")||t.guid(),this.$menu.attr("id",o+"_listbox"),this.$hint.attr({"aria-hidden":!0}),this.$input.attr({"aria-owns":o+"_listbox",role:"combobox","aria-autocomplete":"list","aria-expanded":!1}),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=(r=this.$input,e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:r.css("font-family"),fontSize:r.css("font-size"),fontStyle:r.css("font-style"),fontVariant:r.css("font-variant"),fontWeight:r.css("font-weight"),wordSpacing:r.css("word-spacing"),letterSpacing:r.css("letter-spacing"),textIndent:r.css("text-indent"),textRendering:r.css("text-rendering"),textTransform:r.css("text-transform")}).insertAfter(r)),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),this.onSync("cursorchange",this._updateDescendent)}return n={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},i.normalizeQuery=function(e){return t.toStr(e).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(i.prototype,o,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(e){var t=n[e.which||e.keyCode];this._managePreventDefault(t,e),t&&this._shouldTrigger(t,e)&&this.trigger(t+"Keyed",e)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(e,t){var n;switch(e){case"up":case"down":n=!r(t);break;default:n=!1}n&&t.preventDefault()},_shouldTrigger:function(e,t){var n;switch(e){case"tab":n=!r(t);break;default:n=!0}return n},_checkLanguageDirection:function(){var e=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==e&&(this.dir=e,this.$hint.attr("dir",e),this.trigger("langDirChanged",e))},_setQuery:function(e,t){var n,o,r,s;r=e,s=this.query,o=!!(n=i.normalizeQuery(r)===i.normalizeQuery(s))&&this.query.length!==e.length,this.query=e,t||n?!t&&o&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},_updateDescendent:function(e,t){this.$input.attr("aria-activedescendant",t)},bind:function(){var e,i,o,r,s=this;return e=t.bind(this._onBlur,this),i=t.bind(this._onFocus,this),o=t.bind(this._onKeydown,this),r=t.bind(this._onInput,this),this.$input.on("blur.tt",e).on("focus.tt",i).on("keydown.tt",o),!t.isMsie()||t.isMsie()>9?this.$input.on("input.tt",r):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",(function(e){n[e.which||e.keyCode]||t.defer(t.bind(s._onInput,s,e))})),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(e,t){this.setInputValue(e),this._setQuery(e,t)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(e){this.$input.val(e),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(e){this.$hint.val(e)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var e,t,n;n=(e=this.getInputValue())!==(t=this.getHint())&&0===t.indexOf(e),!(""!==e&&n&&!this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var e,n,i;return e=this.$input.val().length,n=this.$input[0].selectionStart,t.isNumber(n)?n===e:!document.selection||((i=document.selection.createRange()).moveStart("character",-e),e===i.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input
198=this.$overflowHelper=e("<div>")},setAriaExpanded:function(e){this.$input.attr("aria-expanded",e)}}),i;function r(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}}(),a=function(){"use strict";var n,i;function s(n,o){var r;(n=n||{}).templates=n.templates||{},n.templates.notFound=n.templates.notFound||n.templates.empty,n.source||e.error("missing source"),n.node||e.error("missing node"),n.name&&(r=n.name,!/^[_a-zA-Z0-9-]+$/.test(r))&&e.error("invalid dataset name: "+n.name),o.mixin(this),this.highlight=!!n.highlight,this.name=t.toStr(n.name||i()),this.limit=n.limit||5,this.displayFn=function(e){return e=e||t.stringify,t.isFunction(e)?e:n;function n(t){return t[e]}}(n.display||n.displayKey),this.templates=function(n,i){return{notFound:n.notFound&&t.templatify(n.notFound),pending:n.pending&&t.templatify(n.pending),header:n.header&&t.templatify(n.header),footer:n.footer&&t.templatify(n.footer),suggestion:n.suggestion?o:r};function o(i){var o=n.suggestion;return e(o(i)).attr("id",t.guid())}function r(n){return e('<div role="option">').attr("id",t.guid()).text(i(n))}}(n.templates,this.displayFn),this.source=n.source.__ttAdapter?n.source.__ttAdapter():n.source,this.async=t.isUndefined(n.async)?this.source.length>2:!!n.async,this._resetLastSuggestion(),this.$el=e(n.node).attr("role","presentation").addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}return n={dataset:"tt-selectable-dataset",val:"tt-selectable-display",obj:"tt-selectable-object"},i=t.getIdGenerator(),s.extractData=function(t){var i=e(t);return i.data(n.obj)?{dataset:i.data(n.dataset)||"",val:i.data(n.val)||"",obj:i.data(n.obj)||null}:null},t.mixin(s.prototype,o,{_overwrite:function(e,t){(t=t||[]).length?this._renderSuggestions(e,t):this.async&&this.templates.pending?this._renderPending(e):!this.async&&this.templates.notFound?this._renderNotFound(e):this._empty(),this.trigger("rendered",t,!1,this.name)},_append:function(e,t){(t=t||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(e,t):t.length?this._renderSuggestions(e,t):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(e),this.trigger("rendered",t,!0,this.name)},_renderSuggestions:function(e,t){var n;n=this._getSuggestionsFragment(e,t),this.$lastSuggestion=n.children().last(),this.$el.html(n).prepend(this._getHeader(e,t)).append(this._getFooter(e,t))},_appendSuggestions:function(e,t){var n,i;i=(n=this._getSuggestionsFragment(e,t)).children().last(),this.$lastSuggestion.after(n),this.$lastSuggestion=i},_renderPending:function(e){var t=this.templates.pending;this._resetLastSuggestion(),t&&this.$el.html(t({query:e,dataset:this.name}))},_renderNotFound:function(e){var t=this.templates.notFound;this._resetLastSuggestion(),t&&this.$el.html(t({query:e,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(i,o){var s,a=this;return s=document.createDocumentFragment(),t.each(o,(function(t){var o,r;r=a._injectQuery(i,t),o=e(a.templates.suggestion(r)).data(n.dataset,a.name).data(n.obj,t).data(n.val,a.displayFn(t)).addClass(a.classes.suggestion+" "+a.classes.selectable),s.appendChild(o[0])})),this.highlight&&r({className:this.classes.highlight,node:s,pattern:i}),e(s)},_getFooter:function(e,t){return this.templates.footer?this.templates.footer({query:e,suggestions:t,dataset:this.name}):null},_getHeader:function(e,t){return this.templates.header?this.templates.header({query:e,suggestions:t,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=e()},_injectQuery:function(e,n){return t.isObject(n)?t.mixin({_query:e},n):n},update:function(t){var n=this,i=!1,o=!1,r=0;function s(e){o||(o=!0,e=(e||[]).slice(0,n.limit),r=e.length,n._overwrite(t,e),r<n.limit&&n.async&&n.trigger("asyncRequested",t,n.name))}this.cancel(),this.cancel=function(){i=!0,n.cancel=e.noop,n.async&&n.trigger("asyncCanceled",t,n.name)},this.source(t,s,(function(o){if(o=o||[],!i&&r<n.limit){n.cancel=e.noop;var s=Math.abs(r-n.limit);r+=s,n._append(t,o.slice(0,s)),n.async&&n.trigger("asyncReceived",t,n.name)}})),!o&&s([])},cancel:e.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")}
198,destroy:function(){this.$el=e("<div>")}}),s}(),l=function(){"use strict";function n(n,i){var o=this;(n=n||{}).node||e.error("node is required"),i.mixin(this),this.$node=e(n.node),this.query=null,this.datasets=t.map(n.datasets,(function(t){var n=o.$node.find(t.node).first();return t.node=n.length?n:e("<div>").appendTo(o.$node),new a(t,i)}))}return t.mixin(n.prototype,o,{_onSelectableClick:function(t){this.trigger("selectableClicked",e(t.currentTarget))},_onRendered:function(e,t,n,i){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",t,n,i)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return t.every(this.datasets,t.bind((function(e){var t=e.isEmpty();return this.$node.attr("aria-expanded",!t),t}),this))},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var e=this.getActiveSelectable();e&&e.removeClass(this.classes.cursor)},_ensureVisible:function(e){var t,n,i,o;n=(t=e.position().top)+e.outerHeight(!0),i=this.$node.scrollTop(),o=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),t<0?this.$node.scrollTop(i+t):o<n&&this.$node.scrollTop(i+(n-o))},bind:function(){var n,i=this;return n=t.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,n),this.$node.on("mouseover",this.selectors.selectable,(function(){i.setCursor(e(this))})),this.$node.on("mouseleave",(function(){i._removeCursor()})),t.each(this.datasets,(function(e){e.onSync("asyncRequested",i._propagate,i).onSync("asyncCanceled",i._propagate,i).onSync("asyncReceived",i._propagate,i).onSync("rendered",i._onRendered,i).onSync("cleared",i._onCleared,i)})),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.scrollTop(0),this.$node.addClass(this.classes.open)},close:function(){this.$node.attr("aria-expanded",!1),this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(e){this.$node.attr("dir",e)},selectableRelativeToCursor:function(e){var t,n,i;return n=this.getActiveSelectable(),t=this._getSelectables(),-1===(i=(i=((i=(n?t.index(n):-1)+e)+1)%(t.length+1)-1)<-1?t.length-1:i)?null:t.eq(i)},setCursor:function(e){this._removeCursor(),(e=e&&e.first())&&(e.addClass(this.classes.cursor),this._ensureVisible(e))},getSelectableData:function(e){return e&&e.length?a.extractData(e):null},getActiveSelectable:function(){var e=this._getSelectables().filter(this.selectors.cursor).first();return e.length?e:null},getTopSelectable:function(){var e=this._getSelectables().first();return e.length?e:null},update:function(e){var n=e!==this.query;return n&&(this.query=e,t.each(this.datasets,(function(t){t.update(e)}))),n},empty:function(){t.each(this.datasets,(function(e){e.clear()})),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){this.$node.off(".tt"),this.$node=e("<div>"),t.each(this.datasets,(function(e){e.destroy()}))}}),n}(),c=function(){"use strict";function n(n){this.$el=e("<span></span>",{role:"status","aria-live":"polite"}).css({position:"absolute",padding:"0",border:"0",height:"1px",width:"1px","margin-bottom":"-1px","margin-right":"-1px",overflow:"hidden",clip:"rect(0 0 0 0)","white-space":"nowrap"}),n.$input.after(this.$el),t.each(n.menu.datasets,t.bind((function(e){e.onSync&&(e.onSync("rendered",t.bind(this.update,this)),e.onSync("cleared",t.bind(this.cleared,this)))}),this))}return t.mixin(n.prototype,{update:function(e,t){var n,i=t.length;n=1===i?{result:"result",is:"is"}:{result:"results",is:"are"},this.$el.text(i+" "+n.result+" "+n.is+" available, use up and down arrow keys to navigate.")},cleared:function(){this.$el.text("")}}),n}(),d=function(){"use strict";var e=l.prototype;function n(){l.apply(this,[].slice.call(arguments,0))}return t.mixin(n.prototype,l.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),e.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),e.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),e._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),e._onCleared.apply(this,[].slice.call(arguments,0))}
vendor: 15,739 bytes, lines 198-204
198,setLanguageDirection:function(t){return this.$node.css("ltr"===t?this.css.ltr:this.css.rtl),e.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),n}(),h=function(){"use strict";function n(n,o){var r,s,a,l,c,d,h,u,p,f,m;(n=n||{}).input||e.error("missing input"),n.menu||e.error("missing menu"),n.eventBus||e.error("missing event bus"),o.mixin(this),this.eventBus=n.eventBus,this.minLength=t.isNumber(n.minLength)?n.minLength:1,this.input=n.input,this.menu=n.menu,this.enabled=!0,this.autoselect=!!n.autoselect,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),r=i(this,"activate","open","_onFocused"),s=i(this,"deactivate","_onBlurred"),a=i(this,"isActive","isOpen","_onEnterKeyed"),l=i(this,"isActive","isOpen","_onTabKeyed"),c=i(this,"isActive","_onEscKeyed"),d=i(this,"isActive","open","_onUpKeyed"),h=i(this,"isActive","open","_onDownKeyed"),u=i(this,"isActive","isOpen","_onLeftKeyed"),p=i(this,"isActive","isOpen","_onRightKeyed"),f=i(this,"_openIfActive","_onQueryChanged"),m=i(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",r,this).onSync("blurred",s,this).onSync("enterKeyed",a,this).onSync("tabKeyed",l,this).onSync("escKeyed",c,this).onSync("upKeyed",d,this).onSync("downKeyed",h,this).onSync("leftKeyed",u,this).onSync("rightKeyed",p,this).onSync("queryChanged",f,this).onSync("whitespaceChanged",m,this).onSync("langDirChanged",this._onLangDirChanged,this)}return t.mixin(n.prototype,{_hacks:function(){var n,i;n=this.input.$input||e("<div>"),i=this.menu.$node||e("<div>"),n.on("blur.tt",(function(e){var o,r,s;o=document.activeElement,r=i.is(o),s=i.has(o).length>0,t.isMsie()&&(r||s)&&(e.preventDefault(),e.stopImmediatePropagation(),t.defer((function(){n.focus()})))})),i.on("mousedown.tt",(function(e){e.preventDefault()}))},_onSelectableClicked:function(e,t){this.select(t)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(e,t,n,i){if(this._updateHint(),this.autoselect){var o=this.selectors.cursor.substr(1);this.menu.$node.find(this.selectors.suggestion).first().addClass(o)}this.eventBus.trigger("render",t,n,i)},_onAsyncRequested:function(e,t,n){this.eventBus.trigger("asyncrequest",n,t)},_onAsyncCanceled:function(e,t,n){this.eventBus.trigger("asynccancel",n,t)},_onAsyncReceived:function(e,t,n){this.eventBus.trigger("asyncreceive",n,t)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(e,t){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&(t.preventDefault(),t.stopPropagation()):this.autoselect&&this.select(this.menu.getTopSelectable())&&(t.preventDefault(),t.stopPropagation())},_onTabKeyed:function(e,t){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&t.preventDefault():this.autoselect&&(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&t.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onQueryChanged:function(e,t){this._minLengthMet(t)?this.menu.update(t):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(e,t){this.dir!==t&&(this.dir=t,this.menu.setLanguageDirection(t))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(e){return(e=t.isString(e)?e:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var e,n,i,o,r,a;e=this.menu.getTopSelectable(),n=this.menu.getSelectableData(e),i=this.input.getInputValue(),!n||t.isBlankString(i)||this.input.hasOverflow()?this.input.clearHint():(o=s.normalizeQuery(i),r=t.escapeRegExChars(o),(a=new RegExp("^(?:"+r+")(.+$)","i").exec(n.val))&&this.input.setHint(i+a[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.input.setAriaExpanded(!0),this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.input.setAriaExpanded(!1),this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(e){this.input.setQuery(t.toStr(e))},getVal:function(){return this.input.getQuery()},select:function(e){var t=this.menu.getSelectableData(e);return!(!t||this.eventBus.before("select",t.obj,t.dataset))&&(this.input.setQuery(t.val,!0),this.eventBus.trigger("select",t.obj,t.dataset),this.close(),!0)},autocomplete:function(e){var t,n;return t=this.input.getQuery(),!(!((n=this.menu.getSelectableData(e))&&t!==n.val)||this.eventBus.before("autocomplete",n.obj,n.dataset))&&(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj,n.dataset),!0)},moveCursor:function(e){var t,n,i,o,r,s;return t=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(e),o=(i=this.menu.getSelectableData(n))?i.obj:null,r=i?i.dataset:null,s=n?n.attr("id"):null,this.input.trigger("cursorchange",s),!(this._minLengthMet()&&this.menu.update(t))&&!this.eventBus.before("cursorchange",o,r)&&(this.menu.setCursor(n),i?"string"==typeof i.val&&this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",o,r),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),n;function i(e){var n=[].slice.call(arguments,1);return function(){var i=[].slice.call(arguments);t.each(n,(function(t){return e[t].apply(e,i)}))}}}();!function(){"use strict";var o,r,a;function u(t,n){t.each((function(){var t,i=e(this);(t=i.data(r.typeahead))&&n(t,i)}))}function p(e,t){return e.clone().addClass(t.classes.hint).removeData().css(t.css.hint).css((n=e,{backgroundAttachment:n.css("background-attachment"),backgroundClip:n.css("background-clip"),backgroundColor:n.css("background-color"),backgroundImage:n.css("background-image"),backgroundOrigin:n.css("background-origin"),backgroundPosition:n.css("background-position"),backgroundRepeat:n.css("background-repeat"),backgroundSize:n.css("background-size")})).prop({readonly:!0,required:!1}).removeAttr("id name placeholder").removeClass("required").attr({spellcheck:"false",tabindex:-1});var n}function f(e,t){e.data(r.attrs,{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")}),e.addClass(t.classes.input).attr({spellcheck:!1});try{!e.attr("dir")&&e.attr("dir","auto")}catch(e){}return e}function m(n){var i;return(i=t.isJQuery(n)||t.isElement(n)?e(n).first():[]).length?i:null}o=e.fn.typeahead,r={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},a={initialize:function(o,a){var u;return a=t.isArray(a)?a:[].slice.call(arguments,1),u=n((o=o||{}).classNames),this.each(g);function g(){var n,g,v,b,y,x,w,_,k,C,S;t.each(a,(function(e){e.highlight=!!o.highlight})),n=e(this),g=e(u.html.wrapper),v=m(o.hint),b=m(o.menu),y=!1!==o.hint&&!v,x=!1!==o.menu&&!b,y&&(v=p(n,u)),x&&(b=e(u.html.menu).css(u.css.menu)),v&&v.val(""),n=f(n,u),(y||x)&&(g.css(u.css.wrapper),n.css(y?u.css.input:u.css.inputWithNoHint),n.wrap(g).parent().prepend(y?v:null).append(x?b:null)),S=x?d:l,w=new i({el:n}),_=new s({hint:v,input:n,menu:b},u),k=new S({node:b,datasets:a},u),new c({$input:n,menu:k}),C=new h({input:_,menu:k,eventBus:w,minLength:o.minLength,autoselect:o.autoselect},u),n.data(r.www,u),n.data(r.typeahead,C)}},isEnabled:function(){var e;return u(this.first(),(function(t){e=t.isEnabled()})),e},enable:function(){return u(this,(function(e){e.enable()})),this},disable:function(){return u(this,(function(e){e.disable()})),this},isActive:function(){var e;return u(this.first(),(function(t){e=t.isActive()})),e},activate:function(){return u(this,(function(e){e.activate()})),this},deactivate:function(){return u(this,(function(e){e.deactivate()})),this},isOpen:function(){var e;return u(this.first(),(function(t){e=t.isOpen()})),e},open:function(){return u(this,(function(e){e.open()})),this},close:function(){return u(this,(function(e){e.close()})),this},select:function(t){var n=!1,i=e(t);return u(this.first(),(function(e){n=e.select(i)})),n},autocomplete:function(t){var n=!1,i=e(t);return u(this.first(),(function(e){n=e.autocomplete(i)})),n},moveCursor:function(e){var t=!1;return u(this.first(),(function(n){t=n.moveCursor(e)})),t},val:function(e){var n;return arguments.length?(u(this,(function(n){n.setVal(t.toStr(e))})),this):(u(this.first(),(function(e){n=e.getVal()})),n)},destroy:function(){return u(this,(function(e,n){!function(e){var n,i;n=e.data(r.www),i=e.parent().filter(n.selectors.wrapper),t.each(e.data(r.attrs),(function(n,i){t.isUndefined(n)?e.removeAttr(i):e.attr(i,n)})),e.removeData(r.typeahead).removeData(r.www).removeData(r.attr).removeClass(n.classes.input),i.length&&(e.detach().insertAfter(i),i.remove())}(n),e.destroy()})),this}},e.fn.typeahead=function(e){return a[e]?a[e].apply(this,[].slice.call(arguments,1)):a.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=o,this}}()})),
199/*!
200 * typeahead.js 1.3.1
201 * https://github.com/corejavascript/typeahead.js
202 * Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT
203 */
204function(e,t){"function"==typeof define&&define.amd?define(["jquery"],(function(n){return e.Bloodhound=t(n)})):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):e.Bloodhound=t(e.jQuery)}(this,(function(e){var t=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(e){return!e||/^\s*$/.test(e)},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(e){return void 0===e},isElement:function(e){return!(!e||1!==e.nodeType)},isJQuery:function(t){return t instanceof e},toStr:function(e){return t.isUndefined(e)||null===e?"":e+""},bind:e.proxy,each:function(t,n){e.each(t,(function(e,t){return n(t,e)}))},map:e.map,filter:e.grep,every:function(t,n){var i=!0;return t?(e.each(t,(function(e,o){if(!(i=n.call(null,o,e,t)))return!1})),!!i):i},some:function(t,n){var i=!1;return t?(e.each(t,(function(e,o){if(i=n.call(null,o,e,t))return!1})),!!i):i},mixin:e.extend,identity:function(e){return e},clone:function(t){return e.extend(!0,{},t)},getIdGenerator:function(){var e=0;return function(){return e++}},templatify:function(t){return e.isFunction(t)?t:function(){return String(t)}},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var i,o;return function(){var r,s,a=this,l=arguments;return r=function(){i=null,n||(o=e.apply(a,l))},s=n&&!i,clearTimeout(i),i=setTimeout(r,t),s&&(o=e.apply(a,l)),o}},throttle:function(e,t){var n,i,o,r,s,a;return s=0,a=function(){s=new Date,o=null,r=e.apply(n,i)},function(){var l=new Date,c=t-(l-s);return n=this,i=arguments,c<=0?(clearTimeout(o),o=null,s=l,r=e.apply(n,i)):o||(o=setTimeout(a,c)),r}},stringify:function(e){return t.isString(e)?e:JSON.stringify(e)},guid:function(){function e(e){var t=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+t.substr(0,4)+"-"+t.substr(4,4):t}return"tt-"+e()+e(!0)+e(!0)+e()},noop:function(){}}}(),n="1.3.1",i=function(){"use strict";return{nonword:n,whitespace:e,ngram:i,obj:{nonword:o(n),whitespace:o(e),ngram:o(i)}};function e(e){return(e=t.toStr(e))?e.split(/\s+/):[]}function n(e){return(e=t.toStr(e))?e.split(/\W+/):[]}function i(e){e=t.toStr(e);var n=[],i="";return t.each(e.split(""),(function(e){e.match(/\s+/)?i="":(n.push(i+e),i+=e)})),n}function o(e){return function(n){return n=t.isArray(n)?n:[].slice.call(arguments,0),function(i){var o=[];return t.each(n,(function(n){o=o.concat(e(t.toStr(i[n])))})),o}}}}(),o=function(){"use strict";function n(n){this.maxSize=t.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=e.noop)}function i(){this.head=this.tail=null}function o(e,t){this.key=e,this.val=t,this.prev=this.next=null}return t.mixin(n.prototype,{set:function(e,t){var n,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(n=this.hash[e])?(n.val=t,this.list.moveToFront(n)):(n=new o(e,t),this.list.add(n),this.hash[e]=n,this.size++)},get:function(e){var t=this.hash[e];if(t)return this.list.moveToFront(t),t.val},reset:function(){this.size=0,this.hash={},this.list=new i}}),t.mixin(i.prototype,{add:function(e){this.head&&(e.next=this.head,this.head.prev=e),this.head=e,this.tail=this.tail||e},remove:function(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev},moveToFront:function(e){this.remove(e),this.add(e)}}),n}(),r=function(){"use strict";var n;try{(n=window.localStorage).setItem("~~~","!"),n.removeItem("~~~")}catch(e){n=null}function i(e,i){this.prefix=["__",e,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix)),this.ls=i||n,!this.ls&&this._noop()}return t.mixin(i.prototype,{_prefix:function(e){return this.prefix+e},_ttlKey:function(e){return this._prefix(e)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=t.noop},_safeSet:function(e,t){try{this.ls.setItem(e,t)}catch(e){"QuotaExceededError"===e.name&&(this.clear(),this._noop())}},get:function(e){return this.isExpired(e)&&this.remove(e),s(this.ls.getItem(this._prefix(e)))},set:function(e,n,i){return t.isNumber(i)?this._safeSet(this._ttlKey(e),r(o()+i)):this.ls.removeItem(this._ttlKey(e)),this._safeSet(this._prefix(e),r(n))},remove:function(e){return this.ls.removeItem(this._ttlKey(e)),this.ls.removeItem(this._prefix(e)),this},clear:function(){var e,t=function(e){var t,i,o=[],r=n.length;for(t=0;t<r;t++)(i=n.key(t)).match(e)&&o.push(i.replace(e,""));return o}(this.keyMatcher);for(e=t.length;e--;)this.remove(t[e]);return this},isExpired:function(e){var n=s(this.ls.getItem(this._ttlKey(e)));return!!(t.isNumber(n)&&o()>n)}}),i;function o(){return(new Date).getTime()}function r(e){return JSON.stringify(t.isUndefined(e)?null:e)}function s(t){return e.parseJSON(t)}}(),s=function(){"use strict";var n=0,i={},r=new o(10);function s(e){e=e||{},this.maxPendingRequests=e.maxPendingRequests||6,this.cancelled=!1,this.lastReq=null,this._send=e.transport,this._get=e.limiter?e.limiter(this._get):this._get,this._cache=!1===e.cache?new o(0):r}
204return s.setMaxPendingRequests=function(e){this.maxPendingRequests=e},s.resetCache=function(){r.reset()},t.mixin(s.prototype,{_fingerprint:function(t){return(t=t||{}).url+t.type+e.param(t.data||{})},_get:function(e,t){var o,r,s=this;function a(e){t(null,e),s._cache.set(o,e)}function l(){t(!0)}function c(){n--,delete i[o],s.onDeckRequestArgs&&(s._get.apply(s,s.onDeckRequestArgs),s.onDeckRequestArgs=null)}o=this._fingerprint(e),this.cancelled||o!==this.lastReq||((r=i[o])?r.done(a).fail(l):n<this.maxPendingRequests?(n++,i[o]=this._send(e).done(a).fail(l).always(c)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(n,i){var o,r;i=i||e.noop,n=t.isString(n)?{url:n}:n||{},r=this._fingerprint(n),this.cancelled=!1,this.lastReq=r,(o=this._cache.get(r))?i(null,o):this._get(n,i)},cancel:function(){this.cancelled=!0}}),s}(),a=window.SearchIndex=function(){"use strict";function n(n){(n=n||{}).datumTokenizer&&n.queryTokenizer||e.error("datumTokenizer and queryTokenizer are both required"),this.identify=n.identify||t.stringify,this.datumTokenizer=n.datumTokenizer,this.queryTokenizer=n.queryTokenizer,this.matchAnyQueryToken=n.matchAnyQueryToken,this.reset()}return t.mixin(n.prototype,{bootstrap:function(e){this.datums=e.datums,this.trie=e.trie},add:function(e){var n=this;e=t.isArray(e)?e:[e],t.each(e,(function(e){var r,s;n.datums[r=n.identify(e)]=e,s=i(n.datumTokenizer(e)),t.each(s,(function(e){var t,i,s;for(t=n.trie,i=e.split("");s=i.shift();)(t=t.c[s]||(t.c[s]=o())).i.push(r)}))}))},get:function(e){var n=this;return t.map(e,(function(e){return n.datums[e]}))},search:function(e){var n,o,r=this;return n=i(this.queryTokenizer(e)),t.each(n,(function(e){var t,n,i,s;if(o&&0===o.length&&!r.matchAnyQueryToken)return!1;for(t=r.trie,n=e.split("");t&&(i=n.shift());)t=t.c[i];if(t&&0===n.length)s=t.i.slice(0),o=o?function(e,t){var n=0,i=0,o=[];e=e.sort(),t=t.sort();var r=e.length,s=t.length;for(;n<r&&i<s;)e[n]<t[i]?n++:(e[n]>t[i]||(o.push(e[n]),n++),i++);return o}(o,s):s;else if(!r.matchAnyQueryToken)return o=[],!1})),o?t.map(function(e){for(var t={},n=[],i=0,o=e.length;i<o;i++)t[e[i]]||(t[e[i]]=!0,n.push(e[i]));return n}(o),(function(e){return r.datums[e]})):[]},all:function(){var e=[];for(var t in this.datums)e.push(this.datums[t]);return e},reset:function(){this.datums={},this.trie=o()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n;function i(e){return e=t.filter(e,(function(e){return!!e})),e=t.map(e,(function(e){return e.toLowerCase()}))}function o(){var e={i:[],c:{}};return e}}(),l=function(){"use strict";var e;function n(e){this.url=e.url,this.ttl=e.ttl,this.cache=e.cache,this.prepare=e.prepare,this.transform=e.transform,this.transport=e.transport,this.thumbprint=e.thumbprint,this.storage=new r(e.cacheKey)}return e={data:"data",protocol:"protocol",thumbprint:"thumbprint"},t.mixin(n.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(t){this.cache&&(this.storage.set(e.data,t,this.ttl),this.storage.set(e.protocol,location.protocol,this.ttl),this.storage.set(e.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var t,n={};return this.cache?(n.data=this.storage.get(e.data),n.protocol=this.storage.get(e.protocol),n.thumbprint=this.storage.get(e.thumbprint),t=n.thumbprint!==this.thumbprint||n.protocol!==location.protocol,n.data&&!t?n.data:null):null},fromNetwork:function(e){var t,n=this;e&&(t=this.prepare(this._settings()),this.transport(t).fail((function(){e(!0)})).done((function(t){e(null,n.transform(t))})))},clear:function(){return this.storage.clear(),this}}),n}(),c=function(){"use strict";function e(e){this.url=e.url,this.prepare=e.prepare,this.transform=e.transform,this.indexResponse=e.indexResponse,this.transport=new s({cache:e.cache,limiter:e.limiter,transport:e.transport,maxPendingRequests:e.maxPendingRequests})}return t.mixin(e.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(e,t){var n,i=this;if(t)return e=e||"",n=this.prepare(e,this._settings()),this.transport.get(n,(function(e,n){t(e?[]:i.transform(n))}))},cancelLastRequest:function(){this.transport.cancel()}}),e}(),d=function(){"use strict";return function(o){var r,s;return r={initialize:!0,identify:t.stringify,datumTokenizer:null,queryTokenizer:null,matchAnyQueryToken:!1,sufficient:5,indexRemote:!1,sorter:null,local:[],prefetch:null,remote:null},!(o=t.mixin(r,o||{})).datumTokenizer&&e.error("datumTokenizer is required"),!o.queryTokenizer&&e.error("queryTokenizer is required"),s=o.sorter,o.sorter=s?function(e){return e.sort(s)}:t.identity,o.local=t.isFunction(o.local)?o.local():o.local,o.prefetch=function(o){var r;if(!o)return null;return r={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:t.identity,transform:t.i
204dentity,transport:null},o=t.isString(o)?{url:o}:o,!(o=t.mixin(r,o)).url&&e.error("prefetch requires url to be set"),o.transform=o.filter||o.transform,o.cacheKey=o.cacheKey||o.url,o.thumbprint=n+o.thumbprint,o.transport=o.transport?i(o.transport):e.ajax,o}(o.prefetch),o.remote=function(n){var o;if(!n)return;return o={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:t.identity,transport:null},n=t.isString(n)?{url:n}:n,!(n=t.mixin(o,n)).url&&e.error("remote requires url to be set"),n.transform=n.filter||n.transform,n.prepare=function(e){var t,n,i;if(t=e.prepare,n=e.replace,i=e.wildcard,t)return t;t=n?o:e.wildcard?r:s;return t;function o(e,t){return t.url=n(t.url,e),t}function r(e,t){return t.url=t.url.replace(i,encodeURIComponent(e)),t}function s(e,t){return t}}(n),n.limiter=function(e){var n,i,o;n=e.limiter,i=e.rateLimitBy,o=e.rateLimitWait,n||(n=/^throttle$/i.test(i)?s(o):r(o));return n;function r(e){return function(n){return t.debounce(n,e)}}function s(e){return function(n){return t.throttle(n,e)}}}(n),n.transport=n.transport?i(n.transport):e.ajax,delete n.replace,delete n.wildcard,delete n.rateLimitBy,delete n.rateLimitWait,n}(o.remote),o};function i(n){return function(i){var o=e.Deferred();return n(i,(function(e){t.defer((function(){o.resolve(e)}))}),(function(e){t.defer((function(){o.reject(e)}))})),o}}}();return function(){"use strict";var n;function o(e){e=d(e),this.sorter=e.sorter,this.identify=e.identify,this.sufficient=e.sufficient,this.indexRemote=e.indexRemote,this.local=e.local,this.remote=e.remote?new c(e.remote):null,this.prefetch=e.prefetch?new l(e.prefetch):null,this.index=new a({identify:this.identify,datumTokenizer:e.datumTokenizer,queryTokenizer:e.queryTokenizer}),!1!==e.initialize&&this.initialize()}return n=window&&window.Bloodhound,o.noConflict=function(){return window&&(window.Bloodhound=n),o}
204,o.tokenizers=i,t.mixin(o.prototype,{__ttAdapter:function(){var e=this;return this.remote?function(t,n,i){return e.search(t,n,i)}:function(t,n){return e.search(t,n)}},_loadPrefetch:function(){var t,n,i=this;return t=e.Deferred(),this.prefetch?(n=this.prefetch.fromCache())?(this.index.bootstrap(n),t.resolve()):this.prefetch.fromNetwork((function(e,n){if(e)return t.reject();i.add(n),i.prefetch.store(i.index.serialize()),t.resolve()})):t.resolve(),t.promise()},_initialize:function(){var e=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done((function(){e.add(e.local)})),this.initPromise},initialize:function(e){return!this.initPromise||e?this._initialize():this.initPromise},add:function(e){return this.index.add(e),this},get:function(e){return e=t.isArray(e)?e:[].slice.call(arguments),this.index.get(e)},search:function(e,n,i){var o,r=this;return n=n||t.noop,i=i||t.noop,o=this.sorter(this.index.search(e)),n(this.remote?o.slice():o),this.remote&&o.length<this.sufficient?this.remote.get(e,(function(e){var n=[];t.each(e,(function(e){!t.some(o,(function(t){return r.identify(e)===r.identify(t)}))&&n.push(e)})),r.indexRemote&&r.add(n),i(n)})):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return s.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),o}()}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.