"),i.on("blur.tt",function(t){
var o,s,r;o=document.activeElement,s=n.is(o),r=n.has(o).length>0,e.isMsie()&&(s||r)&&(t.preventDefault(),t.stopImmediatePropagation(),e.defer(function(){i.focus()}))}),n.on("mousedown.tt",function(t){t.preventDefault()})},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,i,n){this._updateHint(),this.eventBus.trigger("render",i,n,e)},_onAsyncRequested:function(t,e,i){this.eventBus.trigger("asyncrequest",i,e)},_onAsyncCanceled:function(t,e,i){this.eventBus.trigger("asynccancel",i,e)},_onAsyncReceived:function(t,e,i){this.eventBus.trigger("asyncreceive",i,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var i;(i=this.menu.getActiveSelectable())&&this.select(i)&&e.preventDefault()},_onTabKeyed:function(t,e){var i;(i=this.menu.getActiveSelectable())?this.select(i)&&e.preventDefault():(i=this.menu.getTopSelectable())&&this.autocomplete(i)&&e.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.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return t=e.isString(t)?t:this.input.getQuery()||"",t.length>=this.minLength},_updateHint:function(){var t,i,n,o,s,a,c;t=this.menu.getTopSelectable(),i=this.menu.getSelectableData(t),n=this.input.getInputValue(),!i||e.isBlankString(n)||this.input.hasOverflow()?this.input.clearHint():(o=r.normalizeQuery(n),s=e.escapeRegExChars(o),a=new RegExp("^(?:"+s+")(.+$)","i"),(c=a.exec(i.val))&&this.input.setHint(n+c[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.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(e.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj))&&(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj),this.close(),!0)},autocomplete:function(t){var e,i;return e=this.input.getQuery(),i=this.menu.getSelectableData(t),!(!(i&&e!==i.val)||this.eventBus.before("autocomplete",i.obj))&&(this.input.setQuery(i.val),this.eventBus.trigger("autocomplete",i.obj),!0)},moveCursor:function(t){var e,i,n,o;return e=this.input.getQuery(),i=this.menu.selectableRelativeToCursor(t),n=this.menu.getSelectableData(i),o=n?n.obj:null,!(this._minLengthMet()&&this.menu.update(e))&&!this.eventBus.before("cursorchange",o)&&(this.menu.setCursor(i),n?this.input.setInputValue(n.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",o),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),i}();!function(){"use strict";function o(e,i){e.each(function(){var e,n=t(this);(e=n.data(M.typeahead))&&i(e,n)})}function s(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css(p(t)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function a(t,e){t.data(M.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(t){}return t}function p(t){return{backgroundAttachment:t.css("background-attachment"),backgroundClip:t.css("background-clip"),backgroundColor:t.css("background-color"),backgroundImage:t.css("background-image"),backgroundOrigin:t.css("background-origin"),backgroundPosition:t.css("background-position"),backgroundRepeat:t.css("background-repeat"),backgroundSize:t.css("background-size")}}function u(t){var i,n;i=t.data(M.www),n=t.parent().filter(i.selectors.wrapper),e.each(t.data(M.attrs),function(i,n){e.isUndefined(i)?t.removeAttr(n):t.attr(n,i)}),t.removeData(M.typeahead).removeData(M.www).removeData(M.attr).removeClass(i.classes.input),n.length&&(t.detach().insertAfter(n),n.remove())}function h(i){var n,o;return n=e.isJQuery(i)||e.isElement(i),o=n?t(i).first():[],o.length?o:null}var f,M,m;f=t.fn.typeahead,M={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},m={initialize:function(o,p){function u(){var i,u,m,b,g,v,A,z,y,_,L;e.each(p,function(t){t.highlight=!!o.highlight}),i=t(this),u=t(f.html.wrapper),m=h(o.hint),b=h(o.menu),g=!1!==o.hint&&!m,v=!1!==o.menu&&!b,g&&(m=s(i,f)),v&&(b=t(f.html.menu).css(f.css.menu)),m&&m.val(""),i=a(i,f),(g||v)&&(u.css(f.css.wrapper),i.css(g?f.css.input:f.css.inputWithNoHint),i.wrap(u).parent().prepend(g?m:null).append(v?b:null)),L=v?l:c,A=new n({el:i}),z=new r({hint:m,input:i},f),y=new L({node:b,datasets:p},f),_=new d({input:z,menu:y,eventBus:A,minLength:o.minLength},f),i.data(M.www,f),i.data(M.typeahead,_)}var f;return p=e.isArray(p)?p:[].slice.call(arguments,1),o=o||{},f=i(o.classNames),this.each(u)},isEnabled:function(){var t;return o(this.first(),function(e){t=e.isEnabled()}),t},enable:function(){return o(this,function(t){t.enable()}),this},disable:function(){return o(this,function(t){t.disable()}),this},isActive:function(){var t;return o(this.first(),function(e){t=e.isActive()}),t},activate:function(){return o(this,function(t){t.activate()}),this},deactivate:function(){return o(this,function(t){t.deactivate()}),this},isOpen:function(){var t;return o(this.first(),function(e){t=e.isOpen()}),t},open:function(){return o(this,function(t){t.open()}),this},close:function(){return o(this,function(t){t.close()}),this},select:function(e){var i=!1,n=t(e);return o(this.first(),function(t){i=t.select(n)}),i},autocomplete:function(e){var i=!1,n=t(e);return o(this.first(),function(t){i=t.autocomplete(n)}),i},moveCursor:function(t){var e=!1;return o(this.first(),function(i){e=i.moveCursor(t)}),e},val:function(t){var e;return arguments.length?(o(this,function(e){e.setVal(t)}),this):(o(this.first(),function(t){e=t.getVal()}),e)},destroy:function(){return o(this,function(t,e){u(e),t.destroy()}),this}},t.fn.typeahead=function(t){return m[t]?m[t].apply(this,[].slice.call(arguments,1)):m.initialize.apply(this,arguments)},t.fn.typeahead.noConflict=function(){return t.fn.typeahead=f,this}}()}),function(t){"use strict";function e(e,i){this.itemsArray=[],this.$element=t(e),this.$element.hide(),this.isSelect="SELECT"===e.tagName,this.multiple=this.isSelect&&e.hasAttribute("multiple"),this.objectItems=i&&i.itemValue,this.placeholderText=e.hasAttribute("placeholder")?this.$element.attr("placeholder"):"",this.inputSize=Math.max(1,this.placeholderText.length),this.$container=t('
'),this.$input=t('
').appendTo(this.$container),this.$element.after(this.$container);var n=(this.inputSize<3?3:this.inputSize)+"em";this.$input.get(0).style.cssText="width: "+n+" !important; padding: 8px;",this.build(i)}function i(t,e){if("function"!=typeof t[e]){var i=t[e];t[e]=function(t){return t[i]}}}function n(t,e){if("function"!=typeof t[e]){var i=t[e];t[e]=function(){return i}}}function o(t){return t?c.text(t).html():""}function s(t){var e=0;if(document.selection){t.focus();var i=document.selection.createRange();i.moveStart("character",-t.value.length),e=i.text.length}else(t.selectionStart||"0"==t.selectionStart)&&(e=t.selectionStart);return e}function r(e,i){var n=!1;return t.each(i,function(t,i){if("number"==typeof i&&e.which===i)return n=!0,!1;if(e.which===i.which){var o=!i.hasOwnProperty("altKey")||e.altKey===i.altKey,s=!i.hasOwnProperty("shiftKey")||e.shiftKey===i.shiftKey,r=!i.hasOwnProperty("ctrlKey")||e.ctrlKey===i.ctrlKey;if(o&&s&&r)return n=!0,!1}}),n}var a={tagClass:function(){return"label label-info"},itemValue:function(t){return t?t.toString():t},itemText:function(t){return this.itemValue(t)},freeInput:!0,addOnBlur:!0,maxTags:void 0,maxChars:void 0,confirmKeys:[13,44],onTagExists:function(t,e){e.hide().fadeIn()},trimValue:!1,allowDuplicates:!1};e.prototype={constructor:e,add:function(e,i){var n=this;if(!(n.options.maxTags&&n.itemsArray.length>=n.options.maxTags||!1!==e&&!e)){if("string"==typeof e&&n.options.trimValue&&(e=t.trim(e)),"object"==typeof e&&!n.objectItems)throw"Can't add objects when itemValue option is not set";if(!e.toString().match(/^\s*$/)){if(n.isSelect&&!n.multiple&&n.itemsArray.length>0&&n.remove(n.itemsArray[0]),"string"==typeof e&&"INPUT"===this.$element[0].tagName){var s=e.split(",");if(s.length>1){for(var r=0;r
n.options.maxInputLength)){var p=t.Event("beforeItemAdd",{item:e,cancel:!1});if(n.$element.trigger(p),!p.cancel){n.itemsArray.push(e);var u=t(''+o(c)+'');if(u.data("item",e),n.findInputWrapper().before(u),u.after(" "),n.isSelect&&!t('option[value="'+encodeURIComponent(a)+'"]',n.$element)[0]){var h=t("");h.data("item",e),h.attr("value",a),n.$element.append(h)}i||n.pushVal(),(n.options.maxTags===n.itemsArray.length||n.items().toString().length===n.options.maxInputLength)&&n.$container.addClass("bootstrap-tagsinput-max"),n.$element.trigger(t.Event("itemAdded",{item:e}))}}}else if(n.options.onTagExists){var f=t(".tag",n.$container).filter(function(){return t(this).data("item")===d});n.options.onTagExists(e,f)}}}},remove:function(e,i){var n=this;if(n.objectItems&&(e="object"==typeof e?t.grep(n.itemsArray,function(t){return n.options.itemValue(t)==n.options.itemValue(e)}):t.grep(n.itemsArray,function(t){return n.options.itemValue(t)==e}),e=e[e.length-1]),e){var o=t.Event("beforeItemRemove",{item:e,cancel:!1});if(n.$element.trigger(o),o.cancel)return;t(".tag",n.$container).filter(function(){return t(this).data("item")===e}).remove(),t("option",n.$element).filter(function(){return t(this).data("item")===e}).remove(),-1!==t.inArray(e,n.itemsArray)&&n.itemsArray.splice(t.inArray(e,n.itemsArray),1)}i||n.pushVal(),n.options.maxTags>n.itemsArray.length&&n.$container.removeClass("bootstrap-tagsinput-max"),n.$element.trigger(t.Event("itemRemoved",{item:e}))},removeAll:function(){var e=this;for(t(".tag",e.$container).remove(),t("option",e.$element).remove();e.itemsArray.length>0;)e.itemsArray.pop();e.pushVal()},refresh:function(){var e=this;t(".tag",e.$container).each(function(){var i=t(this),n=i.data("item"),s=e.options.itemValue(n),r=e.options.itemText(n),a=e.options.tagClass(n);if(i.attr("class",null),i.addClass("tag "+o(a)),i.contents().filter(function(){return 3==this.nodeType})[0].nodeValue=o(r),e.isSelect){t("option",e.$element).filter(function(){return t(this).data("item")===n}).attr("value",s)}})},items:function(){return this.itemsArray},pushVal:function(){var e=this,i=t.map(e.items(),function(t){return e.options.itemValue(t).toString()});e.$element.val(i,!0).trigger("change")},build:function(e){var o=this;if(o.options=t.extend({},a,e),o.objectItems&&(o.options.freeInput=!1),i(o.options,"itemValue"),i(o.options,"itemText"),n(o.options,"tagClass"),o.options.typeahead){var c=o.options.typeahead||{};n(c,"source"),o.$input.typeahead(t.extend({},c,{source:function(e,i){function n(t){for(var e=[],n=0;n$1")}}))}if(o.options.typeaheadjs){var l=o.options.typeaheadjs||{};o.$input.typeahead(null,l).on("typeahead:selected",t.proxy(function(t,e){o.add(l.valueKey?e[l.valueKey]:e),o.$input.typeahead("val","")},o))}o.$container.on("click",t.proxy(function(){o.$element.attr("disabled")||o.$input.removeAttr("disabled"),o.$input.focus()},o)),o.options.addOnBlur&&o.options.freeInput&&o.$input.on("focusout",t.proxy(function(){0===t(".typeahead, .twitter-typeahead",o.$container).length&&(o.add(o.$input.val()),o.$input.val(""))},o)),o.$container.on("keydown","input",t.proxy(function(e){var i=t(e.target),n=o.findInputWrapper();if(o.$element.attr("disabled"))return void o.$input.attr("disabled","disabled");switch(e.which){case 8:if(0===s(i[0])){var r=n.prev();r&&o.remove(r.data("item"))}break;case 46:if(0===s(i[0])){var a=n.next();a&&o.remove(a.data("item"))}break;case 37:var c=n.prev();0===i.val().length&&c[0]&&(c.before(n),i.focus());break;case 39:var l=n.next();0===i.val().length&&l[0]&&(l.after(n),i.focus())}var d=i.val().length;Math.ceil(d/5),i.attr("size",Math.max(this.inputSize,i.val().length))},o)),o.$container.on("keypress","input",t.proxy(function(e){var i=t(e.target);if(o.$element.attr("disabled"))return void o.$input.attr("disabled","disabled");var n=i.val(),s=o.options.maxChars&&n.length>=o.options.maxChars;o.options.freeInput&&(r(e,o.options.confirmKeys)||s)&&(o.add(s?n.substr(0,o.options.maxChars):n),i.val(""),e.preventDefault());var a=i.val().length;Math.ceil(a/5),i.attr("size",Math.max(this.inputSize,i.val().length))},o)),o.$container.on("click","[data-role=remove]",t.proxy(function(e){o.$element.attr("disabled")||o.remove(t(e.target).closest(".tag").data("item"))},o)),o.options.itemValue===a.itemValue&&("INPUT"===o.$element[0].tagName?o.add(o.$element.val()):t("option",o.$element).each(function(){o.add(t(this).attr("value"),!0)}))},destroy:function(){var t=this;t.$container.off("keypress","input"),t.$container.off("click","[role=remove]"),t.$container.remove(),t.$element.removeData("tagsinput"),t.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var e=this.$input[0],i=this.$container[0];e&&e.parentNode!==i;)e=e.parentNode;return t(e)}},t.fn.tagsinput=function(i,n){var o=[];return this.each(function(){var s=t(this).data("tagsinput");if(s)if(i||n){if(void 0!==s[i]){var r=s[i](n);void 0!==r&&o.push(r)}}else o.push(s);else s=new e(this,i),t(this).data("tagsinput",s),o.push(s),"SELECT"===this.tagName&&t("option",t(this)).attr("selected","selected"),t(this).val(t(this).val())}),"string"==typeof i?o.length>1?o:o[0]:o},t.fn.tagsinput.Constructor=e;var c=t("");t(function(){t("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})}(window.jQuery),function(t){"use strict";"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&void 0!==module.exports?module.exports=t():window.Sortable=t()}(function(){"use strict";function t(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(t);this.el=t,this.options=e=v({},e),t[j]=this;var i={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(t.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0}};for(var n in i)!(n in e)&&(e[n]=i[n]);rt(e);for(var o in this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&J,s(t,"mousedown",this._onTapStart),s(t,"touchstart",this._onTapStart),s(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(s(t,"dragover",this),s(t,"dragenter",this)),ot.push(this._onDragOver),e.store&&this.sort(e.store.get(this))}function e(t,e){"clone"!==t.lastPullMode&&(e=!0),O&&O.state!==e&&(c(O,"display",e?"none":""),e||O.state&&(t.options.group.revertClone?(N.insertBefore(O,T),t._animate(y,O)):N.insertBefore(O,y)),O.state=e)}function i(t,e,i){if(t){i=i||Y;do{if(">*"===e&&t.parentNode===i||b(t,e))return t}while(t=n(t))}return null}function n(t){var e=t.host;return e&&e.nodeType?e:t.parentNode}function o(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.preventDefault()}function s(t,e,i){t.addEventListener(e,i,Q)}function r(t,e,i){t.removeEventListener(e,i,Q)}function a(t,e,i){if(t)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(F," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(F," ")}}function c(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return Y.defaultView&&Y.defaultView.getComputedStyle?i=Y.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function l(t,e,i){if(t){var n=t.getElementsByTagName(e),o=0,s=n.length;if(i)for(;o5||e.clientX-(n.left+n.width)>5}function M(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function m(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t&&(t=t.previousElementSibling);)"TEMPLATE"===t.nodeName.toUpperCase()||">*"!==e&&!b(t,e)||i++;return i}function b(t,e){if(t){e=e.split(".");var i=e.shift().toUpperCase(),n=new RegExp("\\s("+e.join("|")+")(?=\\s)","g");return!(""!==i&&t.nodeName.toUpperCase()!=i||e.length&&((" "+t.className+" ").match(n)||[]).length!=e.length)}return!1}function g(t,e){var i,n;return function(){void 0===i&&(i=arguments,n=this,setTimeout(function(){1===i.length?t.call(n,i[0]):t.apply(n,i),i=void 0},e))}}function v(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function A(t){return V?V(t).clone(!0)[0]:G&&G.dom?G.dom(t).cloneNode(!0):t.cloneNode(!0)}function z(t){for(var e=t.getElementsByTagName("input"),i=e.length;i--;){var n=e[i];n.checked&&nt.push(n)}}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var y,_,L,O,N,T,q,C,W,w,B,E,S,k,x,R,X,D,$,I,P={},F=/\s+/g,H=/left|right|inline/,j="Sortable"+(new Date).getTime(),U=window,Y=U.document,K=U.parseInt,V=U.jQuery||U.Zepto,G=U.Polymer,Q=!1,J=!!("draggable"in Y.createElement("div")),Z=function(t){return!navigator.userAgent.match(/Trident.*rv[ :]?11\./)&&(t=Y.createElement("x"),t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents)}(),tt=!1,et=Math.abs,it=Math.min,nt=[],ot=[],st=g(function(t,e,i){if(i&&e.scroll){var n,o,s,r,a,c,l=i[j],d=e.scrollSensitivity,p=e.scrollSpeed,u=t.clientX,h=t.clientY,f=window.innerWidth,M=window.innerHeight;if(W!==i&&(C=e.scroll,W=i,w=e.scrollFn,!0===C)){C=i;do{if(C.offsetWidth-1:o==t)}}var i={},n=t.group;n&&"object"==typeof n||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i};t.prototype={constructor:t,_onTapStart:function(t){var e,n=this,o=this.el,s=this.options,r=s.preventOnFilter,a=t.type,c=t.touches&&t.touches[0],l=(c||t).target,p=t.target.shadowRoot&&t.path[0]||l,u=s.filter;if(z(o),!y&&!("mousedown"===a&&0!==t.button||s.disabled)&&(l=i(l,s.draggable,o))&&q!==l){if(e=m(l,s.draggable),"function"==typeof u){if(u.call(this,t,l,this))return d(n,p,"filter",l,o,e),void(r&&t.preventDefault())}else if(u&&(u=u.split(",").some(function(t){if(t=i(p,t.trim(),o))return d(n,t,"filter",l,o,e),!0})))return void(r&&t.preventDefault());s.handle&&!i(p,s.handle,o)||this._prepareDragStart(t,c,l,e)}},_prepareDragStart:function(t,e,i,n){var o,r=this,c=r.el,p=r.options,h=c.ownerDocument;i&&!y&&i.parentNode===c&&(D=t,N=c,y=i,_=y.parentNode,T=y.nextSibling,q=i,R=p.group,k=n,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,y.style["will-change"]="transform",o=function(){r._disableDelayedDrag(),y.draggable=r.nativeDraggable,a(y,p.chosenClass,!0),r._triggerDragStart(t,e),d(r,N,"choose",y,N,k)},p.ignore.split(",").forEach(function(t){l(y,t.trim(),u)}),s(h,"mouseup",r._onDrop),s(h,"touchend",r._onDrop),s(h,"touchcancel",r._onDrop),s(h,"pointercancel",r._onDrop),s(h,"selectstart",r),p.delay?(s(h,"mouseup",r._disableDelayedDrag),s(h,"touchend",r._disableDelayedDrag),s(h,"touchcancel",r._disableDelayedDrag),s(h,"mousemove",r._disableDelayedDrag),s(h,"touchmove",r._disableDelayedDrag),s(h,"pointermove",r._disableDelayedDrag),r._dragStartTimer=setTimeout(o,p.delay)):o())},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),r(t,"mouseup",this._disableDelayedDrag),r(t,"touchend",this._disableDelayedDrag),r(t,"touchcancel",this._disableDelayedDrag),r(t,"mousemove",this._disableDelayedDrag),r(t,"touchmove",this._disableDelayedDrag),r(t,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(t,e){e=e||("touch"==t.pointerType?t:null),e?(D={target:y,clientX:e.clientX,clientY:e.clientY},this._onDragStart(D,"touch")):this.nativeDraggable?(s(y,"dragend",this),s(N,"dragstart",this._onDragStart)):this._onDragStart(D,!0);try{Y.selection?setTimeout(function(){Y.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(){if(N&&y){var e=this.options;a(y,e.ghostClass,!0),a(y,e.dragClass,!1),t.active=this,d(this,N,"start",y,N,k)}else this._nulling()},_emulateDragOver:function(){if($){if(this._lastX===$.clientX&&this._lastY===$.clientY)return;this._lastX=$.clientX,this._lastY=$.clientY,Z||c(L,"display","none");var t=Y.elementFromPoint($.clientX,$.clientY),e=t,i=ot.length;if(e)do{if(e[j]){for(;i--;)ot[i]({clientX:$.clientX,clientY:$.clientY,target:t,rootEl:e});break}t=e}while(e=e.parentNode);Z||c(L,"display","")}},_onTouchMove:function(e){if(D){var i=this.options,n=i.fallbackTolerance,o=i.fallbackOffset,s=e.touches?e.touches[0]:e,r=s.clientX-D.clientX+o.x,a=s.clientY-D.clientY+o.y,l=e.touches?"translate3d("+r+"px,"+a+"px,0)":"translate("+r+"px,"+a+"px)";if(!t.active){if(n&&it(et(s.clientX-this._lastX),et(s.clientY-this._lastY))y.offsetWidth,C=o.offsetHeight>y.offsetHeight,W=(z?(n.clientX-r.left)/v:(n.clientY-r.top)/A)>.5,w=o.nextElementSibling,k=!1;if(z){var x=y.offsetTop,D=o.offsetTop;k=x===D?o.previousElementSibling===y&&!q||W&&q:o.previousElementSibling===y||y.previousElementSibling===o?(n.clientY-r.top)/A>.5:D>x}else b||(k=w!==y&&!C||W&&C);var $=p(N,l,y,s,o,r,n,k);!1!==$&&(1!==$&&-1!==$||(k=1===$),tt=!0,setTimeout(h,30),e(M,m),y.contains(l)||(k&&!w?l.appendChild(y):o.parentNode.insertBefore(y,k?w:o)),_=y.parentNode,this._animate(s,y),this._animate(r,o))}}},_animate:function(t,e){var i=this.options.animation;if(i){var n=e.getBoundingClientRect();1===t.nodeType&&(t=t.getBoundingClientRect()),c(e,"transition","none"),c(e,"transform","translate3d("+(t.left-n.left)+"px,"+(t.top-n.top)+"px,0)"),e.offsetWidth,c(e,"transition","all "+i+"ms"),c(e,"transform","translate3d(0,0,0)"),clearTimeout(e.animated),e.animated=setTimeout(function(){c(e,"transition",""),c(e,"transform",""),e.animated=!1},i)}},_offUpEvents:function(){var t=this.el.ownerDocument;r(Y,"touchmove",this._onTouchMove),r(Y,"pointermove",this._onTouchMove),r(t,"mouseup",this._onDrop),r(t,"touchend",this._onDrop),r(t,"pointerup",this._onDrop),r(t,"touchcancel",this._onDrop),r(t,"pointercancel",this._onDrop),r(t,"selectstart",this)},_onDrop:function(e){var i=this.el,n=this.options;clearInterval(this._loopId),clearInterval(P.pid),clearTimeout(this._dragStartTimer),r(Y,"mousemove",this._onTouchMove),this.nativeDraggable&&(r(Y,"drop",this),r(i,"dragstart",this._onDragStart)),this._offUpEvents(),e&&(I&&(e.preventDefault(),!n.dropBubble&&e.stopPropagation()),L&&L.parentNode&&L.parentNode.removeChild(L),N!==_&&"clone"===t.active.lastPullMode||O&&O.parentNode&&O.parentNode.removeChild(O),y&&(this.nativeDraggable&&r(y,"dragend",this),u(y),y.style["will-change"]="",a(y,this.options.ghostClass,!1),a(y,this.options.chosenClass,!1),d(this,N,"unchoose",y,N,k),N!==_?(x=m(y,n.draggable))>=0&&(d(null,_,"add",y,N,k,x),d(this,N,"remove",y,N,k,x),d(null,_,"sort",y,N,k,x),d(this,N,"sort",y,N,k,x)):y.nextSibling!==T&&(x=m(y,n.draggable))>=0&&(d(this,N,"update",y,N,k,x),d(this,N,"sort",y,N,k,x)),t.active&&(null!=x&&-1!==x||(x=k),d(this,N,"end",y,N,k,x),this.save()))),this._nulling()},_nulling:function(){N=y=_=L=T=O=q=C=W=D=$=I=x=B=E=X=R=t.active=null,nt.forEach(function(t){t.checked=!0}),nt.length=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragover":case"dragenter":y&&(this._onDragOver(t),o(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,s=n.length,r=this.options;o'),this.element.appendChild(e)),n=e.getElementsByTagName("span")[0],n&&(n.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},resize:function(t){var e,i,n;return e={srcX:0,srcY:0,srcWidth:t.width,srcHeight:t.height},i=t.width/t.height,e.optWidth=this.options.thumbnailWidth,e.optHeight=this.options.thumbnailHeight,null==e.optWidth&&null==e.optHeight?(e.optWidth=e.srcWidth,e.optHeight=e.srcHeight):null==e.optWidth?e.optWidth=i*e.optHeight:null==e.optHeight&&(e.optHeight=1/i*e.optWidth),n=e.optWidth/e.optHeight,t.height