| Current Path : /home/users/unlimited/www/whatsjet-saas/Source/public/dist/js/ |
| Current File : /home/users/unlimited/www/whatsjet-saas/Source/public/dist/js/vendorlibs.js |
!function(e){"use strict";var t;"function"==typeof define&&define.amd?define(["jquery"],(function(t){return e(t,window,document)})):"object"==typeof exports?(t=require("jquery"),"undefined"==typeof window?module.exports=function(n,r){return n=n||window,r=r||t(n),e(r,n,n.document)}:module.exports=e(t,window,window.document)):window.DataTable=e(jQuery,window,document)}((function(e,t,n,r){"use strict";function i(e){var t=parseInt(e,10);return!isNaN(t)&&isFinite(e)?t:null}function o(e,t,n){var r=typeof e,i="string"==r;return"number"==r||"bigint"==r||!!T(e)||(t&&i&&(e=I(e,t)),n&&i&&(e=e.replace(y,"")),!isNaN(parseFloat(e))&&isFinite(e))}function a(e,t,n){var r;return!!T(e)||(T(r=e)||"string"==typeof r)&&!!o(e.replace(v,"").replace(/<script/i,""),t,n)||null}function s(e,t,n,i){var o=[],a=0,s=t.length;if(i!==r)for(;a<s;a++)e[t[a]][n]&&o.push(e[t[a]][n][i]);else for(;a<s;a++)o.push(e[t[a]][n]);return o}function l(e,t){var n,i=[];t===r?(t=0,n=e):(n=t,t=e);for(var o=t;o<n;o++)i.push(o);return i}function u(e){for(var t=[],n=0,r=e.length;n<r;n++)e[n]&&t.push(e[n]);return t}function c(e,t){return-1!==this.indexOf(e,t=t===r?0:t)}var d,f,p,h=function(t,n){if(h.factory(t,n))return h;if(this instanceof h)return e(t).DataTable(n);n=t,this.$=function(e,t){return this.api(!0).$(e,t)},this._=function(e,t){return this.api(!0).rows(e,t).data()},this.api=function(e){return new St(e?at(this[d.iApiIndex]):this)},this.fnAddData=function(t,n){var i=this.api(!0);t=(Array.isArray(t)&&(Array.isArray(t[0])||e.isPlainObject(t[0]))?i.rows:i.row).add(t);return n!==r&&!n||i.draw(),t.flatten().toArray()},this.fnAdjustColumnSizing=function(e){var t=this.api(!0).columns.adjust(),n=t.settings()[0],i=n.oScroll;e===r||e?t.draw(!1):""===i.sX&&""===i.sY||Be(n)},this.fnClearTable=function(e){var t=this.api(!0).clear();e!==r&&!e||t.draw()},this.fnClose=function(e){this.api(!0).row(e).child.hide()},this.fnDeleteRow=function(e,t,n){var i=this.api(!0),o=(e=i.rows(e)).settings()[0],a=o.aoData[e[0][0]];return e.remove(),t&&t.call(this,o,a),n!==r&&!n||i.draw(),a},this.fnDestroy=function(e){this.api(!0).destroy(e)},this.fnDraw=function(e){this.api(!0).draw(e)},this.fnFilter=function(e,t,n,i,o,a){var s=this.api(!0);(null===t||t===r?s:s.column(t)).search(e,n,i,a),s.draw()},this.fnGetData=function(e,t){var n,i=this.api(!0);return e!==r?(n=e.nodeName?e.nodeName.toLowerCase():"",t!==r||"td"==n||"th"==n?i.cell(e,t).data():i.row(e).data()||null):i.data().toArray()},this.fnGetNodes=function(e){var t=this.api(!0);return e!==r?t.row(e).node():t.rows().nodes().flatten().toArray()},this.fnGetPosition=function(e){var t=this.api(!0),n=e.nodeName.toUpperCase();return"TR"==n?t.row(e).index():"TD"==n||"TH"==n?[(n=t.cell(e).index()).row,n.columnVisible,n.column]:null},this.fnIsOpen=function(e){return this.api(!0).row(e).child.isShown()},this.fnOpen=function(e,t,n){return this.api(!0).row(e).child(t,n).show().child()[0]},this.fnPageChange=function(e,t){e=this.api(!0).page(e),t!==r&&!t||e.draw(!1)},this.fnSetColumnVis=function(e,t,n){e=this.api(!0).column(e).visible(t),n!==r&&!n||e.columns.adjust().draw()},this.fnSettings=function(){return at(this[d.iApiIndex])},this.fnSort=function(e){this.api(!0).order(e).draw()},this.fnSortListener=function(e,t,n){this.api(!0).order.listener(e,t,n)},this.fnUpdate=function(e,t,n,i,o){var a=this.api(!0);return(n===r||null===n?a.row(t):a.cell(t,n)).data(e),o!==r&&!o||a.columns.adjust(),i!==r&&!i||a.draw(),0},this.fnVersionCheck=d.fnVersionCheck;var i,o=this,a=n===r,s=this.length;for(i in a&&(n={}),this.oApi=this.internal=d.internal,h.ext.internal)i&&(this[i]=Wt(i));return this.each((function(){var t=1<s?ut({},n,!0):n,i=0,l=this.getAttribute("id"),u=!1,c=h.defaults,d=e(this);if("table"!=this.nodeName.toLowerCase())st(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{O(c),x(c.column),R(c,c,!0),R(c.column,c.column,!0),R(c,e.extend(t,d.data()),!0);for(var f=h.settings,p=(i=0,f.length);i<p;i++){var m=f[i];if(m.nTable==this||m.nTHead&&m.nTHead.parentNode==this||m.nTFoot&&m.nTFoot.parentNode==this){var g=(t.bRetrieve!==r?t:c).bRetrieve,v=(t.bDestroy!==r?t:c).bDestroy;if(a||g)return m.oInstance;if(v){m.oInstance.fnDestroy();break}return void st(m,0,"Cannot reinitialise DataTable",3)}if(m.sTableId==this.id){f.splice(i,1);break}}null!==l&&""!==l||(l="DataTables_Table_"+h.ext._unique++,this.id=l);var E,_,y=e.extend(!0,{},h.models.oSettings,{sDestroyWidth:d[0].style.width,sInstance:l,sTableId:l}),T=(y.nTable=this,y.oApi=o.internal,y.oInit=t,f.push(y),y.oInstance=1===o.length?o:d.dataTable(),O(t),C(t.oLanguage),t.aLengthMenu&&!t.iDisplayLength&&(t.iDisplayLength=(Array.isArray(t.aLengthMenu[0])?t.aLengthMenu[0]:t.aLengthMenu)[0]),t=ut(e.extend(!0,{},c),t),lt(y.oFeatures,t,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),lt(y,t,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]),lt(y.oScroll,t,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),lt(y.oLanguage,t,"fnInfoCallback"),dt(y,"aoDrawCallback",t.fnDrawCallback,"user"),dt(y,"aoServerParams",t.fnServerParams,"user"),dt(y,"aoStateSaveParams",t.fnStateSaveParams,"user"),dt(y,"aoStateLoadParams",t.fnStateLoadParams,"user"),dt(y,"aoStateLoaded",t.fnStateLoaded,"user"),dt(y,"aoRowCallback",t.fnRowCallback,"user"),dt(y,"aoRowCreatedCallback",t.fnCreatedRow,"user"),dt(y,"aoHeaderCallback",t.fnHeaderCallback,"user"),dt(y,"aoFooterCallback",t.fnFooterCallback,"user"),dt(y,"aoInitComplete",t.fnInitComplete,"user"),dt(y,"aoPreDrawCallback",t.fnPreDrawCallback,"user"),y.rowIdFn=K(t.rowId),L(y),y.oClasses),I=(e.extend(T,h.ext.classes,t.oClasses),d.addClass(T.sTable),y.iInitDisplayStart===r&&(y.iInitDisplayStart=t.iDisplayStart,y._iDisplayStart=t.iDisplayStart),null!==t.iDeferLoading&&(y.bDeferLoading=!0,l=Array.isArray(t.iDeferLoading),y._iRecordsDisplay=l?t.iDeferLoading[0]:t.iDeferLoading,y._iRecordsTotal=l?t.iDeferLoading[1]:t.iDeferLoading),y.oLanguage),b=(l=(e.extend(!0,I,t.oLanguage),I.sUrl?(e.ajax({dataType:"json",url:I.sUrl,success:function(t){R(c.oLanguage,t),C(t),e.extend(!0,I,t,y.oInit.oLanguage),ft(y,null,"i18n",[y]),Le(y)},error:function(){Le(y)}}),u=!0):ft(y,null,"i18n",[y]),null===t.asStripeClasses&&(y.asStripeClasses=[T.sStripeOdd,T.sStripeEven]),y.asStripeClasses),d.children("tbody").find("tr").eq(0)),w=(-1!==e.inArray(!0,e.map(l,(function(e,t){return b.hasClass(e)})))&&(e("tbody tr",this).removeClass(l.join(" ")),y.asDestroyStripes=l.slice()),[]);if(0!==(l=this.getElementsByTagName("thead")).length&&(ce(y.aoHeader,l[0]),w=de(y)),null===t.aoColumns)for(E=[],i=0,p=w.length;i<p;i++)E.push(null);else E=t.aoColumns;for(i=0,p=E.length;i<p;i++)M(y,w?w[i]:null);j(y,t.aoColumnDefs,E,(function(e,t){N(y,e,t)})),b.length&&(_=function(e,t){return null!==e.getAttribute("data-"+t)?t:null},e(b[0]).children("th, td").each((function(e,t){var n,i=y.aoColumns[e];i||st(y,0,"Incorrect column count",18),i.mData===e&&(n=_(t,"sort")||_(t,"order"),t=_(t,"filter")||_(t,"search"),null===n&&null===t||(i.mData={_:e+".display",sort:null!==n?e+".@data-"+n:r,type:null!==n?e+".@data-"+n:r,filter:null!==t?e+".@data-"+t:r},i._isArrayHost=!0,N(y,e)))})));var S=y.oFeatures;l=function(){if(t.aaSorting===r){var n=y.aaSorting;for(i=0,p=n.length;i<p;i++)n[i][1]=y.aoColumns[i].asSorting[0]}tt(y),S.bSort&&dt(y,"aoDrawCallback",(function(){var t,n;y.bSorted&&(t=Ke(y),n={},e.each(t,(function(e,t){n[t.src]=t.dir})),ft(y,null,"order",[y,t,n]),Ze(y))})),dt(y,"aoDrawCallback",(function(){(y.bSorted||"ssp"===mt(y)||S.bDeferRender)&&tt(y)}),"sc");var o,a=d.children("caption").each((function(){this._captionSide=e(this).css("caption-side")})),s=(0===(o=d.children("thead")).length&&(o=e("<thead/>").appendTo(d)),y.nTHead=o[0],d.children("tbody"));if(0===(o=0===(o=(0===s.length&&(s=e("<tbody/>").insertAfter(o)),y.nTBody=s[0],d.children("tfoot"))).length&&0<a.length&&(""!==y.oScroll.sX||""!==y.oScroll.sY)?e("<tfoot/>").appendTo(d):o).length||0===o.children().length?d.addClass(T.sNoFooter):0<o.length&&(y.nTFoot=o[0],ce(y.aoFooter,y.nTFoot)),t.aaData)for(i=0;i<t.aaData.length;i++)q(y,t.aaData[i]);else!y.bDeferLoading&&"dom"!=mt(y)||H(y,e(y.nTBody).children("tr"));y.aiDisplay=y.aiDisplayMaster.slice(),!(y.bInitialised=!0)===u&&Le(y)};dt(y,"aoDrawCallback",rt,"state_save"),t.bStateSave?(S.bStateSave=!0,it(y,0,l)):l()}})),o=null,this},m={},g=/[\r\n\u2028]/g,v=/<.*?>/g,E=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,_=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),y=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,T=function(e){return!e||!0===e||"-"===e},I=function(e,t){return m[t]||(m[t]=new RegExp(be(t),"g")),"string"==typeof e&&"."!==t?e.replace(/\./g,"").replace(m[t],"."):e},b=function(e,t,n){var i=[],o=0,a=e.length;if(n!==r)for(;o<a;o++)e[o]&&e[o][t]&&i.push(e[o][t][n]);else for(;o<a;o++)e[o]&&i.push(e[o][t]);return i},w=function(e){if(function(e){if(!(e.length<2))for(var t=e.slice().sort(),n=t[0],r=1,i=t.length;r<i;r++){if(t[r]===n)return!1;n=t[r]}return!0}(e))return e.slice();var t,n,r,i=[],o=e.length,a=0;e:for(n=0;n<o;n++){for(t=e[n],r=0;r<a;r++)if(i[r]===t)continue e;i.push(t),a++}return i},S=function(e,t){if(Array.isArray(t))for(var n=0;n<t.length;n++)S(e,t[n]);else e.push(t);return e};function D(t){var n,r,i={};e.each(t,(function(e,o){(n=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(n[1]+" ")&&(r=e.replace(n[0],n[2].toLowerCase()),i[r]=e,"o"===n[1])&&D(t[e])})),t._hungarianMap=i}function R(t,n,i){var o;t._hungarianMap||D(t),e.each(n,(function(a,s){(o=t._hungarianMap[a])===r||!i&&n[o]!==r||("o"===o.charAt(0)?(n[o]||(n[o]={}),e.extend(!0,n[o],n[a]),R(t[o],n[o],i)):n[o]=n[a])}))}function C(e){var t,n=h.defaults.oLanguage,r=n.sDecimal;r&&Nt(r),e&&(t=e.sZeroRecords,!e.sEmptyTable&&t&&"No data available in table"===n.sEmptyTable&<(e,e,"sZeroRecords","sEmptyTable"),!e.sLoadingRecords&&t&&"Loading..."===n.sLoadingRecords&<(e,e,"sZeroRecords","sLoadingRecords"),e.sInfoThousands&&(e.sThousands=e.sInfoThousands),t=e.sDecimal)&&r!==t&&Nt(t)}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),Array.prototype.includes||(Array.prototype.includes=c),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),String.prototype.includes||(String.prototype.includes=c),h.util={throttle:function(e,t){var n,i,o=t!==r?t:200;return function(){var t=this,a=+new Date,s=arguments;n&&a<n+o?(clearTimeout(i),i=setTimeout((function(){n=r,e.apply(t,s)}),o)):(n=a,e.apply(t,s))}},escapeRegex:function(e){return e.replace(_,"\\$1")},set:function(t){var n;return e.isPlainObject(t)?h.util.set(t._):null===t?function(){}:"function"==typeof t?function(e,n,r){t(e,"set",n,r)}:"string"!=typeof t||-1===t.indexOf(".")&&-1===t.indexOf("[")&&-1===t.indexOf("(")?function(e,n){e[t]=n}:(n=function(e,t,i){for(var o,a,s,l,u=$(i),c=(i=u[u.length-1],0),d=u.length-1;c<d;c++){if("__proto__"===u[c]||"constructor"===u[c])throw new Error("Cannot set prototype values");if(o=u[c].match(z),a=u[c].match(X),o){if(u[c]=u[c].replace(z,""),e[u[c]]=[],(o=u.slice()).splice(0,c+1),l=o.join("."),Array.isArray(t))for(var f=0,p=t.length;f<p;f++)n(s={},t[f],l),e[u[c]].push(s);else e[u[c]]=t;return}a&&(u[c]=u[c].replace(X,""),e=e[u[c]](t)),null!==e[u[c]]&&e[u[c]]!==r||(e[u[c]]={}),e=e[u[c]]}i.match(X)?e[i.replace(X,"")](t):e[i.replace(z,"")]=t},function(e,r){return n(e,r,t)})},get:function(t){var n,i;return e.isPlainObject(t)?(n={},e.each(t,(function(e,t){t&&(n[e]=h.util.get(t))})),function(e,t,i,o){var a=n[t]||n._;return a!==r?a(e,t,i,o):e}):null===t?function(e){return e}:"function"==typeof t?function(e,n,r,i){return t(e,n,r,i)}:"string"!=typeof t||-1===t.indexOf(".")&&-1===t.indexOf("[")&&-1===t.indexOf("(")?function(e,n){return e[t]}:(i=function(e,t,n){var o,a,s;if(""!==n)for(var l=$(n),u=0,c=l.length;u<c;u++){if(p=l[u].match(z),o=l[u].match(X),p){if(l[u]=l[u].replace(z,""),""!==l[u]&&(e=e[l[u]]),a=[],l.splice(0,u+1),s=l.join("."),Array.isArray(e))for(var d=0,f=e.length;d<f;d++)a.push(i(e[d],t,s));var p=p[0].substring(1,p[0].length-1);e=""===p?a:a.join(p);break}if(o)l[u]=l[u].replace(X,""),e=e[l[u]]();else{if(null===e||null===e[l[u]])return null;if(e===r||e[l[u]]===r)return r;e=e[l[u]]}}return e},function(e,n){return i(e,n,t)})}};var A=function(e,t,n){e[t]!==r&&(e[n]=e[t])};function O(e){A(e,"ordering","bSort"),A(e,"orderMulti","bSortMulti"),A(e,"orderClasses","bSortClasses"),A(e,"orderCellsTop","bSortCellsTop"),A(e,"order","aaSorting"),A(e,"orderFixed","aaSortingFixed"),A(e,"paging","bPaginate"),A(e,"pagingType","sPaginationType"),A(e,"pageLength","iDisplayLength"),A(e,"searching","bFilter"),"boolean"==typeof e.sScrollX&&(e.sScrollX=e.sScrollX?"100%":""),"boolean"==typeof e.scrollX&&(e.scrollX=e.scrollX?"100%":"");var t=e.aoSearchCols;if(t)for(var n=0,r=t.length;n<r;n++)t[n]&&R(h.models.oSearch,t[n])}function x(e){A(e,"orderable","bSortable"),A(e,"orderData","aDataSort"),A(e,"orderSequence","asSorting"),A(e,"orderDataType","sortDataType");var t=e.aDataSort;"number"!=typeof t||Array.isArray(t)||(e.aDataSort=[t])}function L(n){var r,i,o,a;h.__browser||(h.__browser=r={},a=(o=(i=e("<div/>").css({position:"fixed",top:0,left:-1*e(t).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(e("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(e("<div/>").css({width:"100%",height:10}))).appendTo("body")).children()).children(),r.barWidth=o[0].offsetWidth-o[0].clientWidth,r.bScrollOversize=100===a[0].offsetWidth&&100!==o[0].clientWidth,r.bScrollbarLeft=1!==Math.round(a.offset().left),r.bBounding=!!i[0].getBoundingClientRect().width,i.remove()),e.extend(n.oBrowser,h.__browser),n.oScroll.iBarWidth=h.__browser.barWidth}function P(e,t,n,i,o,a){var s,l=i,u=!1;for(n!==r&&(s=n,u=!0);l!==o;)e.hasOwnProperty(l)&&(s=u?t(s,e[l],l,e):e[l],u=!0,l+=a);return s}function M(t,r){var i=h.defaults.column,o=t.aoColumns.length;i=e.extend({},h.models.oColumn,i,{nTh:r||n.createElement("th"),sTitle:i.sTitle||(r?r.innerHTML:""),aDataSort:i.aDataSort||[o],mData:i.mData||o,idx:o});(i=(t.aoColumns.push(i),t.aoPreSearchCols))[o]=e.extend({},h.models.oSearch,i[o]),N(t,o,e(r).data())}function N(t,n,i){function o(e){return"string"==typeof e&&-1!==e.indexOf("@")}n=t.aoColumns[n];var a=t.oClasses,s=e(n.nTh),l=(!n.sWidthOrig&&(n.sWidthOrig=s.attr("width")||null,d=(s.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/))&&(n.sWidthOrig=d[1]),i!==r&&null!==i&&(x(i),R(h.defaults.column,i,!0),i.mDataProp===r||i.mData||(i.mData=i.mDataProp),i.sType&&(n._sManualType=i.sType),i.className&&!i.sClass&&(i.sClass=i.className),i.sClass&&s.addClass(i.sClass),d=n.sClass,e.extend(n,i),lt(n,i,"sWidth","sWidthOrig"),d!==n.sClass&&(n.sClass=d+" "+n.sClass),i.iDataSort!==r&&(n.aDataSort=[i.iDataSort]),lt(n,i,"aDataSort"),n.ariaTitle||(n.ariaTitle=s.attr("aria-label"))),n.mData),u=K(l),c=n.mRender?K(n.mRender):null,d=(n._bAttrSrc=e.isPlainObject(l)&&(o(l.sort)||o(l.type)||o(l.filter)),n._setter=null,n.fnGetData=function(e,t,n){var i=u(e,t,r,n);return c&&t?c(i,t,e,n):i},n.fnSetData=function(e,t,n){return Q(l)(e,t,n)},"number"==typeof l||n._isArrayHost||(t._rowReadObject=!0),t.oFeatures.bSort||(n.bSortable=!1,s.addClass(a.sSortableNone)),-1!==e.inArray("asc",n.asSorting));i=-1!==e.inArray("desc",n.asSorting);n.bSortable&&(d||i)?d&&!i?(n.sSortingClass=a.sSortableAsc,n.sSortingClassJUI=a.sSortJUIAscAllowed):!d&&i?(n.sSortingClass=a.sSortableDesc,n.sSortingClassJUI=a.sSortJUIDescAllowed):(n.sSortingClass=a.sSortable,n.sSortingClassJUI=a.sSortJUI):(n.sSortingClass=a.sSortableNone,n.sSortingClassJUI="")}function G(e){if(!1!==e.oFeatures.bAutoWidth){var t=e.aoColumns;He(e);for(var n=0,r=t.length;n<r;n++)t[n].nTh.style.width=t[n].sWidth}var i=e.oScroll;""===i.sY&&""===i.sX||Be(e),ft(e,null,"column-sizing",[e])}function F(e,t){return"number"==typeof(e=V(e,"bVisible"))[t]?e[t]:null}function k(t,n){return t=V(t,"bVisible"),-1!==(n=e.inArray(n,t))?n:null}function U(t){var n=0;return e.each(t.aoColumns,(function(t,r){r.bVisible&&"none"!==e(r.nTh).css("display")&&n++})),n}function V(t,n){var r=[];return e.map(t.aoColumns,(function(e,t){e[n]&&r.push(t)})),r}function B(e){for(var t,n,i,o,a,s,l,u=e.aoColumns,c=e.aoData,d=h.ext.type.detect,f=0,p=u.length;f<p;f++)if(l=[],!(a=u[f]).sType&&a._sManualType)a.sType=a._sManualType;else if(!a.sType){for(t=0,n=d.length;t<n;t++){for(i=0,o=c.length;i<o&&(l[i]===r&&(l[i]=W(e,i,f,"type")),(s=d[t](l[i],e))||t===d.length-1)&&("html"!==s||T(l[i]));i++);if(s){a.sType=s;break}}a.sType||(a.sType="string")}}function j(t,n,i,o){var a,s,l,u,c=t.aoColumns;if(n)for(a=n.length-1;0<=a;a--)for(var d,f=(d=n[a]).target!==r?d.target:d.targets!==r?d.targets:d.aTargets,p=0,h=(f=Array.isArray(f)?f:[f]).length;p<h;p++)if("number"==typeof f[p]&&0<=f[p]){for(;c.length<=f[p];)M(t);o(f[p],d)}else if("number"==typeof f[p]&&f[p]<0)o(c.length+f[p],d);else if("string"==typeof f[p])for(l=0,u=c.length;l<u;l++)"_all"!=f[p]&&!e(c[l].nTh).hasClass(f[p])||o(l,d);if(i)for(a=0,s=i.length;a<s;a++)o(a,i[a])}function q(t,n,i,o){for(var a=t.aoData.length,s=e.extend(!0,{},h.models.oRow,{src:i?"dom":"data",idx:a}),l=(s._aData=n,t.aoData.push(s),t.aoColumns),u=0,c=l.length;u<c;u++)l[u].sType=null;return t.aiDisplayMaster.push(a),(n=t.rowIdFn(n))!==r&&(t.aIds[n]=s),!i&&t.oFeatures.bDeferRender||re(t,a,i,o),a}function H(t,n){var r;return(n=n instanceof e?n:e(n)).map((function(e,n){return r=ne(t,n),q(t,r.data,n,r.cells)}))}function W(e,t,n,i){"search"===i?i="filter":"order"===i&&(i="sort");var o=e.iDraw,a=e.aoColumns[n],s=e.aoData[t]._aData,l=a.sDefaultContent,u=a.fnGetData(s,i,{settings:e,row:t,col:n});if(u===r)return e.iDrawError!=o&&null===l&&(st(e,0,"Requested unknown parameter "+("function"==typeof a.mData?"{function}":"'"+a.mData+"'")+" for row "+t+", column "+n,4),e.iDrawError=o),l;if(u!==s&&null!==u||null===l||i===r){if("function"==typeof u)return u.call(s)}else u=l;return null===u&&"display"===i?"":"filter"===i&&(t=h.ext.type.search)[a.sType]?t[a.sType](u):u}function Y(e,t,n,r){var i=e.aoColumns[n],o=e.aoData[t]._aData;i.fnSetData(o,r,{settings:e,row:t,col:n})}var z=/\[.*?\]$/,X=/\(\)$/;function $(t){return e.map(t.match(/(\\.|[^\.])+/g)||[""],(function(e){return e.replace(/\\\./g,".")}))}var K=h.util.get,Q=h.util.set;function Z(e){return b(e.aoData,"_aData")}function J(e){e.aoData.length=0,e.aiDisplayMaster.length=0,e.aiDisplay.length=0,e.aIds={}}function ee(e,t,n){for(var i=-1,o=0,a=e.length;o<a;o++)e[o]==t?i=o:e[o]>t&&e[o]--;-1!=i&&n===r&&e.splice(i,1)}function te(e,t,n,i){function o(n,r){for(;n.childNodes.length;)n.removeChild(n.firstChild);n.innerHTML=W(e,t,r,"display")}var a,s,l=e.aoData[t];if("dom"!==n&&(n&&"auto"!==n||"dom"!==l.src)){var u=l.anCells;if(u)if(i!==r)o(u[i],i);else for(a=0,s=u.length;a<s;a++)o(u[a],a)}else l._aData=ne(e,l,i,i===r?r:l._aData).data;l._aSortData=null,l._aFilterData=null;var c=e.aoColumns;if(i!==r)c[i].sType=null;else{for(a=0,s=c.length;a<s;a++)c[a].sType=null;ie(e,l)}}function ne(e,t,n,i){function o(e,t){var n;"string"==typeof e&&-1!==(n=e.indexOf("@"))&&(n=e.substring(n+1),Q(e)(i,t.getAttribute(n)))}function a(e){n!==r&&n!==f||(l=p[f],u=e.innerHTML.trim(),l&&l._bAttrSrc?(Q(l.mData._)(i,u),o(l.mData.sort,e),o(l.mData.type,e),o(l.mData.filter,e)):h?(l._setter||(l._setter=Q(l.mData)),l._setter(i,u)):i[f]=u),f++}var s,l,u,c=[],d=t.firstChild,f=0,p=e.aoColumns,h=e._rowReadObject;if(i=i!==r?i:h?{}:[],d)for(;d;)"TD"!=(s=d.nodeName.toUpperCase())&&"TH"!=s||(a(d),c.push(d)),d=d.nextSibling;else for(var m=0,g=(c=t.anCells).length;m<g;m++)a(c[m]);return(t=t.firstChild?t:t.nTr)&&(t=t.getAttribute("id"))&&Q(e.rowId)(i,t),{data:i,cells:c}}function re(t,r,i,o){var a,s,l,u,c,d,f=t.aoData[r],p=f._aData,h=[];if(null===f.nTr){for(a=i||n.createElement("tr"),f.nTr=a,f.anCells=h,a._DT_RowIndex=r,ie(t,f),u=0,c=t.aoColumns.length;u<c;u++)l=t.aoColumns[u],(s=(d=!i)?n.createElement(l.sCellType):o[u])||st(t,0,"Incorrect column count",18),s._DT_CellIndex={row:r,column:u},h.push(s),!d&&(!l.mRender&&l.mData===u||e.isPlainObject(l.mData)&&l.mData._===u+".display")||(s.innerHTML=W(t,r,u,"display")),l.sClass&&(s.className+=" "+l.sClass),l.bVisible&&!i?a.appendChild(s):!l.bVisible&&i&&s.parentNode.removeChild(s),l.fnCreatedCell&&l.fnCreatedCell.call(t.oInstance,s,W(t,r,u),p,r,u);ft(t,"aoRowCreatedCallback",null,[a,p,r,h])}}function ie(t,n){var r=n.nTr,i=n._aData;r&&((t=t.rowIdFn(i))&&(r.id=t),i.DT_RowClass&&(t=i.DT_RowClass.split(" "),n.__rowc=n.__rowc?w(n.__rowc.concat(t)):t,e(r).removeClass(n.__rowc.join(" ")).addClass(i.DT_RowClass)),i.DT_RowAttr&&e(r).attr(i.DT_RowAttr),i.DT_RowData)&&e(r).data(i.DT_RowData)}function oe(t){var n,r,i,o=t.nTHead,a=t.nTFoot,s=0===e("th, td",o).length,l=t.oClasses,u=t.aoColumns;for(s&&(r=e("<tr/>").appendTo(o)),d=0,f=u.length;d<f;d++)i=u[d],n=e(i.nTh).addClass(i.sClass),s&&n.appendTo(r),t.oFeatures.bSort&&(n.addClass(i.sSortingClass),!1!==i.bSortable)&&(n.attr("tabindex",t.iTabIndex).attr("aria-controls",t.sTableId),et(t,i.nTh,d)),i.sTitle!=n[0].innerHTML&&n.html(i.sTitle),ht(t,"header")(t,n,i,l);if(s&&ce(t.aoHeader,o),e(o).children("tr").children("th, td").addClass(l.sHeaderTH),e(a).children("tr").children("th, td").addClass(l.sFooterTH),null!==a)for(var c=t.aoFooter[0],d=0,f=c.length;d<f;d++)(i=u[d])?(i.nTf=c[d].cell,i.sClass&&e(i.nTf).addClass(i.sClass)):st(t,0,"Incorrect column count",18)}function ae(t,n,i){var o,a,s,l,u,c,d,f,p,h=[],m=[],g=t.aoColumns.length;if(n){for(i===r&&(i=!1),o=0,a=n.length;o<a;o++){for(h[o]=n[o].slice(),h[o].nTr=n[o].nTr,s=g-1;0<=s;s--)t.aoColumns[s].bVisible||i||h[o].splice(s,1);m.push([])}for(o=0,a=h.length;o<a;o++){if(d=h[o].nTr)for(;c=d.firstChild;)d.removeChild(c);for(s=0,l=h[o].length;s<l;s++)if(p=f=1,m[o][s]===r){for(d.appendChild(h[o][s].cell),m[o][s]=1;h[o+f]!==r&&h[o][s].cell==h[o+f][s].cell;)m[o+f][s]=1,f++;for(;h[o][s+p]!==r&&h[o][s].cell==h[o][s+p].cell;){for(u=0;u<f;u++)m[o+u][s+p]=1;p++}e(h[o][s].cell).attr("rowspan",f).attr("colspan",p)}}}}function se(t,n){i="ssp"==mt(c=t),(u=c.iInitDisplayStart)!==r&&-1!==u&&(c._iDisplayStart=!i&&u>=c.fnRecordsDisplay()?0:u,c.iInitDisplayStart=-1);var i=ft(t,"aoPreDrawCallback","preDraw",[t]);if(-1!==e.inArray(!1,i))Ue(t,!1);else{var o=[],a=0,s=t.asStripeClasses,l=s.length,u=t.oLanguage,c="ssp"==mt(t),d=t.aiDisplay,f=(i=t._iDisplayStart,t.fnDisplayEnd());if(t.bDrawing=!0,t.bDeferLoading)t.bDeferLoading=!1,t.iDraw++,Ue(t,!1);else if(c){if(!t.bDestroying&&!n)return void pe(t)}else t.iDraw++;if(0!==d.length)for(var p=c?t.aoData.length:f,h=c?0:i;h<p;h++){var m,g=d[h],v=t.aoData[g],E=(null===v.nTr&&re(t,g),v.nTr);0!==l&&(m=s[a%l],v._sRowStripe!=m)&&(e(E).removeClass(v._sRowStripe).addClass(m),v._sRowStripe=m),ft(t,"aoRowCallback",null,[E,v._aData,a,h,g]),o.push(E),a++}else n=u.sZeroRecords,1==t.iDraw&&"ajax"==mt(t)?n=u.sLoadingRecords:u.sEmptyTable&&0===t.fnRecordsTotal()&&(n=u.sEmptyTable),o[0]=e("<tr/>",{class:l?s[0]:""}).append(e("<td />",{valign:"top",colSpan:U(t),class:t.oClasses.sRowEmpty}).html(n))[0];ft(t,"aoHeaderCallback","header",[e(t.nTHead).children("tr")[0],Z(t),i,f,d]),ft(t,"aoFooterCallback","footer",[e(t.nTFoot).children("tr")[0],Z(t),i,f,d]),(c=e(t.nTBody)).children().detach(),c.append(e(o)),ft(t,"aoDrawCallback","draw",[t]),t.bSorted=!1,t.bFiltered=!1,t.bDrawing=!1}}function le(e,t){var n=(r=e.oFeatures).bSort,r=r.bFilter;n&&Qe(e),r?Ee(e,e.oPreviousSearch):e.aiDisplay=e.aiDisplayMaster.slice(),!0!==t&&(e._iDisplayStart=0),e._drawHold=t,se(e),e._drawHold=!1}function ue(t){for(var n,r,i,o,a,s,l,u=t.oClasses,c=e(t.nTable),d=(c=e("<div/>").insertBefore(c),t.oFeatures),f=e("<div/>",{id:t.sTableId+"_wrapper",class:u.sWrapper+(t.nTFoot?"":" "+u.sNoFooter)}),p=(t.nHolding=c[0],t.nTableWrapper=f[0],t.nTableReinsertBefore=t.nTable.nextSibling,t.sDom.split("")),m=0;m<p.length;m++){if(n=null,"<"==(r=p[m])){if(i=e("<div/>")[0],"'"==(o=p[m+1])||'"'==o){for(a="",s=2;p[m+s]!=o;)a+=p[m+s],s++;"H"==a?a=u.sJUIHeader:"F"==a&&(a=u.sJUIFooter),-1!=a.indexOf(".")?(l=a.split("."),i.id=l[0].substr(1,l[0].length-1),i.className=l[1]):"#"==a.charAt(0)?i.id=a.substr(1,a.length-1):i.className=a,m+=s}f.append(i),f=e(i)}else if(">"==r)f=f.parent();else if("l"==r&&d.bPaginate&&d.bLengthChange)n=Ne(t);else if("f"==r&&d.bFilter)n=ve(t);else if("r"==r&&d.bProcessing)n=ke(t);else if("t"==r)n=Ve(t);else if("i"==r&&d.bInfo)n=Ae(t);else if("p"==r&&d.bPaginate)n=Ge(t);else if(0!==h.ext.feature.length)for(var g=h.ext.feature,v=0,E=g.length;v<E;v++)if(r==g[v].cFeature){n=g[v].fnInit(t);break}n&&((l=t.aanFeatures)[r]||(l[r]=[]),l[r].push(n),f.append(n))}c.replaceWith(f),t.nHolding=null}function ce(t,n){var r,i,o,a,s,l,u,c,d,f,p=e(n).children("tr");for(t.splice(0,t.length),o=0,l=p.length;o<l;o++)t.push([]);for(o=0,l=p.length;o<l;o++)for(i=(r=p[o]).firstChild;i;){if("TD"==i.nodeName.toUpperCase()||"TH"==i.nodeName.toUpperCase())for(c=(c=+i.getAttribute("colspan"))&&0!=c&&1!=c?c:1,d=(d=+i.getAttribute("rowspan"))&&0!=d&&1!=d?d:1,u=function(e,t,n){for(var r=e[t];r[n];)n++;return n}(t,o,0),f=1==c,s=0;s<c;s++)for(a=0;a<d;a++)t[o+a][u+s]={cell:i,unique:f},t[o+a].nTr=r;i=i.nextSibling}}function de(e,t,n){var r=[];n||(n=e.aoHeader,t&&ce(n=[],t));for(var i=0,o=n.length;i<o;i++)for(var a=0,s=n[i].length;a<s;a++)!n[i][a].unique||r[a]&&e.bSortCellsTop||(r[a]=n[i][a].cell);return r}function fe(t,n,r){function i(e){var n=t.jqXHR?t.jqXHR.status:null;(null===e||"number"==typeof n&&204==n)&&ge(t,e={},[]),(n=e.error||e.sError)&&st(t,0,n),t.json=e,ft(t,null,"xhr",[t,e,t.jqXHR]),r(e)}ft(t,"aoServerParams","serverParams",[n]),n&&Array.isArray(n)&&(o={},a=/(.*?)\[\]$/,e.each(n,(function(e,t){var n=t.name.match(a);n?(n=n[0],o[n]||(o[n]=[]),o[n].push(t.value)):o[t.name]=t.value})),n=o);var o,a,s,l=t.ajax,u=t.oInstance,c=(e.isPlainObject(l)&&l.data&&(c="function"==typeof(s=l.data)?s(n,t):s,n="function"==typeof s&&c?c:e.extend(!0,n,c),delete l.data),{data:n,success:i,dataType:"json",cache:!1,type:t.sServerMethod,error:function(n,r,i){var o=ft(t,null,"xhr",[t,null,t.jqXHR]);-1===e.inArray(!0,o)&&("parsererror"==r?st(t,0,"Invalid JSON response",1):4===n.readyState&&st(t,0,"Ajax error",7)),Ue(t,!1)}});t.oAjaxData=n,ft(t,null,"preXhr",[t,n]),t.fnServerData?t.fnServerData.call(u,t.sAjaxSource,e.map(n,(function(e,t){return{name:t,value:e}})),i,t):t.sAjaxSource||"string"==typeof l?t.jqXHR=e.ajax(e.extend(c,{url:l||t.sAjaxSource})):"function"==typeof l?t.jqXHR=l.call(u,n,i,t):(t.jqXHR=e.ajax(e.extend(c,l)),l.data=s)}function pe(e){e.iDraw++,Ue(e,!0);var t=e._drawHold;fe(e,he(e),(function(n){e._drawHold=t,me(e,n),e._drawHold=!1}))}function he(t){for(var n,r,i,o=t.aoColumns,a=o.length,s=t.oFeatures,l=t.oPreviousSearch,u=t.aoPreSearchCols,c=[],d=Ke(t),f=t._iDisplayStart,p=!1!==s.bPaginate?t._iDisplayLength:-1,m=function(e,t){c.push({name:e,value:t})},g=(m("sEcho",t.iDraw),m("iColumns",a),m("sColumns",b(o,"sName").join(",")),m("iDisplayStart",f),m("iDisplayLength",p),{draw:t.iDraw,columns:[],order:[],start:f,length:p,search:{value:l.sSearch,regex:l.bRegex}}),v=0;v<a;v++)r=o[v],i=u[v],n="function"==typeof r.mData?"function":r.mData,g.columns.push({data:n,name:r.sName,searchable:r.bSearchable,orderable:r.bSortable,search:{value:i.sSearch,regex:i.bRegex}}),m("mDataProp_"+v,n),s.bFilter&&(m("sSearch_"+v,i.sSearch),m("bRegex_"+v,i.bRegex),m("bSearchable_"+v,r.bSearchable)),s.bSort&&m("bSortable_"+v,r.bSortable);return s.bFilter&&(m("sSearch",l.sSearch),m("bRegex",l.bRegex)),s.bSort&&(e.each(d,(function(e,t){g.order.push({column:t.col,dir:t.dir}),m("iSortCol_"+e,t.col),m("sSortDir_"+e,t.dir)})),m("iSortingCols",d.length)),null===(f=h.ext.legacy.ajax)?t.sAjaxSource?c:g:f?c:g}function me(e,t){function n(e,n){return t[e]!==r?t[e]:t[n]}var i=ge(e,t),o=n("sEcho","draw"),a=n("iTotalRecords","recordsTotal"),s=n("iTotalDisplayRecords","recordsFiltered");if(o!==r){if(+o<e.iDraw)return;e.iDraw=+o}i=i||[],J(e),e._iRecordsTotal=parseInt(a,10),e._iRecordsDisplay=parseInt(s,10);for(var l=0,u=i.length;l<u;l++)q(e,i[l]);e.aiDisplay=e.aiDisplayMaster.slice(),se(e,!0),e._bInitComplete||Pe(e,t),Ue(e,!1)}function ge(t,n,i){if(t=e.isPlainObject(t.ajax)&&t.ajax.dataSrc!==r?t.ajax.dataSrc:t.sAjaxDataProp,!i)return"data"===t?n.aaData||n[t]:""!==t?K(t)(n):n;Q(t)(n,i)}function ve(t){function r(e){l.f;var n=this.value||"";s.return&&"Enter"!==e.key||n!=s.sSearch&&(Ee(t,{sSearch:n,bRegex:s.bRegex,bSmart:s.bSmart,bCaseInsensitive:s.bCaseInsensitive,return:s.return}),t._iDisplayStart=0,se(t))}var i=t.oClasses,o=t.sTableId,a=t.oLanguage,s=t.oPreviousSearch,l=t.aanFeatures,u='<input type="search" class="'+i.sFilterInput+'"/>',c=(c=a.sSearch).match(/_INPUT_/)?c.replace("_INPUT_",u):c+u,d=(u=e("<div/>",{id:l.f?null:o+"_filter",class:i.sFilter}).append(e("<label/>").append(c)),i=null!==t.searchDelay?t.searchDelay:"ssp"===mt(t)?400:0,e("input",u).val(s.sSearch).attr("placeholder",a.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",i?We(r,i):r).on("mouseup.DT",(function(e){setTimeout((function(){r.call(d[0],e)}),10)})).on("keypress.DT",(function(e){if(13==e.keyCode)return!1})).attr("aria-controls",o));return e(t.nTable).on("search.dt.DT",(function(e,r){if(t===r)try{d[0]!==n.activeElement&&d.val(s.sSearch)}catch(e){}})),u[0]}function Ee(e,t,n){function i(e){a.sSearch=e.sSearch,a.bRegex=e.bRegex,a.bSmart=e.bSmart,a.bCaseInsensitive=e.bCaseInsensitive,a.return=e.return}function o(e){return e.bEscapeRegex!==r?!e.bEscapeRegex:e.bRegex}var a=e.oPreviousSearch,s=e.aoPreSearchCols;if(B(e),"ssp"!=mt(e)){Te(e,t.sSearch,n,o(t),t.bSmart,t.bCaseInsensitive),i(t);for(var l=0;l<s.length;l++)ye(e,s[l].sSearch,l,o(s[l]),s[l].bSmart,s[l].bCaseInsensitive);_e(e)}else i(t);e.bFiltered=!0,ft(e,null,"search",[e])}function _e(t){for(var n,r,i=h.ext.search,o=t.aiDisplay,a=0,s=i.length;a<s;a++){for(var l=[],u=0,c=o.length;u<c;u++)r=o[u],n=t.aoData[r],i[a](t,n._aFilterData,r,n._aData,u)&&l.push(r);o.length=0,e.merge(o,l)}}function ye(e,t,n,r,i,o){if(""!==t){for(var a,s=[],l=e.aiDisplay,u=Ie(t,r,i,o),c=0;c<l.length;c++)a=e.aoData[l[c]]._aFilterData[n],u.test(a)&&s.push(l[c]);e.aiDisplay=s}}function Te(e,t,n,r,i,o){var a,s,l,u=Ie(t,r,i,o),c=(i=e.oPreviousSearch.sSearch,o=e.aiDisplayMaster,[]);if(0!==h.ext.search.length&&(n=!0),s=De(e),t.length<=0)e.aiDisplay=o.slice();else{for((s||n||r||i.length>t.length||0!==t.indexOf(i)||e.bSorted)&&(e.aiDisplay=o.slice()),a=e.aiDisplay,l=0;l<a.length;l++)u.test(e.aoData[a[l]]._sFilterRow)&&c.push(a[l]);e.aiDisplay=c}}function Ie(t,n,r,i){return t=n?t:be(t),r&&(t="^(?=.*?"+e.map(t.match(/["\u201C][^"\u201D]+["\u201D]|[^ ]+/g)||[""],(function(e){var t;return'"'===e.charAt(0)?e=(t=e.match(/^"(.*)"$/))?t[1]:e:"“"===e.charAt(0)&&(e=(t=e.match(/^\u201C(.*)\u201D$/))?t[1]:e),e.replace('"',"")})).join(")(?=.*?")+").*$"),new RegExp(t,i?"i":"")}var be=h.util.escapeRegex,we=e("<div>")[0],Se=we.textContent!==r;function De(e){for(var t,n,r,i,o,a=e.aoColumns,s=!1,l=0,u=e.aoData.length;l<u;l++)if(!(o=e.aoData[l])._aFilterData){for(r=[],t=0,n=a.length;t<n;t++)a[t].bSearchable?"string"!=typeof(i=null===(i=W(e,l,t,"filter"))?"":i)&&i.toString&&(i=i.toString()):i="",i.indexOf&&-1!==i.indexOf("&")&&(we.innerHTML=i,i=Se?we.textContent:we.innerText),i.replace&&(i=i.replace(/[\r\n\u2028]/g,"")),r.push(i);o._aFilterData=r,o._sFilterRow=r.join(" "),s=!0}return s}function Re(e){return{search:e.sSearch,smart:e.bSmart,regex:e.bRegex,caseInsensitive:e.bCaseInsensitive}}function Ce(e){return{sSearch:e.search,bSmart:e.smart,bRegex:e.regex,bCaseInsensitive:e.caseInsensitive}}function Ae(t){var n=t.sTableId,r=t.aanFeatures.i,i=e("<div/>",{class:t.oClasses.sInfo,id:r?null:n+"_info"});return r||(t.aoDrawCallback.push({fn:Oe,sName:"information"}),i.attr("role","status").attr("aria-live","polite"),e(t.nTable).attr("aria-describedby",n+"_info")),i[0]}function Oe(t){var n,r,i,o,a,s,l=t.aanFeatures.i;0!==l.length&&(s=t.oLanguage,n=t._iDisplayStart+1,r=t.fnDisplayEnd(),i=t.fnRecordsTotal(),a=(o=t.fnRecordsDisplay())?s.sInfo:s.sInfoEmpty,o!==i&&(a+=" "+s.sInfoFiltered),a=xe(t,a+=s.sInfoPostFix),null!==(s=s.fnInfoCallback)&&(a=s.call(t.oInstance,t,n,r,i,o,a)),e(l).html(a))}function xe(e,t){var n=e.fnFormatNumber,r=e._iDisplayStart+1,i=e._iDisplayLength,o=e.fnRecordsDisplay(),a=-1===i;return t.replace(/_START_/g,n.call(e,r)).replace(/_END_/g,n.call(e,e.fnDisplayEnd())).replace(/_MAX_/g,n.call(e,e.fnRecordsTotal())).replace(/_TOTAL_/g,n.call(e,o)).replace(/_PAGE_/g,n.call(e,a?1:Math.ceil(r/i))).replace(/_PAGES_/g,n.call(e,a?1:Math.ceil(o/i)))}function Le(e){var t,n,r,i=e.iInitDisplayStart,o=e.aoColumns,a=e.oFeatures,s=e.bDeferLoading;if(e.bInitialised){for(ue(e),oe(e),ae(e,e.aoHeader),ae(e,e.aoFooter),Ue(e,!0),a.bAutoWidth&&He(e),t=0,n=o.length;t<n;t++)(r=o[t]).sWidth&&(r.nTh.style.width=$e(r.sWidth));ft(e,null,"preInit",[e]),le(e),"ssp"==(a=mt(e))&&!s||("ajax"==a?fe(e,[],(function(n){var r=ge(e,n);for(t=0;t<r.length;t++)q(e,r[t]);e.iInitDisplayStart=i,le(e),Ue(e,!1),Pe(e,n)})):(Ue(e,!1),Pe(e)))}else setTimeout((function(){Le(e)}),200)}function Pe(e,t){e._bInitComplete=!0,(t||e.oInit.aaData)&&G(e),ft(e,null,"plugin-init",[e,t]),ft(e,"aoInitComplete","init",[e,t])}function Me(e,t){t=parseInt(t,10),e._iDisplayLength=t,pt(e),ft(e,null,"length",[e,t])}function Ne(t){for(var n=t.oClasses,r=t.sTableId,i=t.aLengthMenu,o=Array.isArray(i[0]),a=o?i[0]:i,s=o?i[1]:i,l=e("<select/>",{name:r+"_length","aria-controls":r,class:n.sLengthSelect}),u=0,c=a.length;u<c;u++)l[0][u]=new Option("number"==typeof s[u]?t.fnFormatNumber(s[u]):s[u],a[u]);var d=e("<div><label/></div>").addClass(n.sLength);return t.aanFeatures.l||(d[0].id=r+"_length"),d.children().append(t.oLanguage.sLengthMenu.replace("_MENU_",l[0].outerHTML)),e("select",d).val(t._iDisplayLength).on("change.DT",(function(n){Me(t,e(this).val()),se(t)})),e(t.nTable).on("length.dt.DT",(function(n,r,i){t===r&&e("select",d).val(i)})),d[0]}function Ge(t){function n(e){se(e)}var r=t.sPaginationType,i=h.ext.pager[r],o="function"==typeof i,a=(r=e("<div/>").addClass(t.oClasses.sPaging+r)[0],t.aanFeatures);return o||i.fnInit(t,r,n),a.p||(r.id=t.sTableId+"_paginate",t.aoDrawCallback.push({fn:function(e){if(o)for(var t=e._iDisplayStart,r=e._iDisplayLength,s=e.fnRecordsDisplay(),l=-1===r,u=l?0:Math.ceil(t/r),c=l?1:Math.ceil(s/r),d=i(u,c),f=0,p=a.p.length;f<p;f++)ht(e,"pageButton")(e,a.p[f],f,d,u,c);else i.fnUpdate(e,n)},sName:"pagination"})),r}function Fe(e,t,n){var r=e._iDisplayStart,i=e._iDisplayLength,o=(0===(o=e.fnRecordsDisplay())||-1===i?r=0:"number"==typeof t?o<(r=t*i)&&(r=0):"first"==t?r=0:"previous"==t?(r=0<=i?r-i:0)<0&&(r=0):"next"==t?r+i<o&&(r+=i):"last"==t?r=Math.floor((o-1)/i)*i:st(e,0,"Unknown paging action: "+t,5),e._iDisplayStart!==r);return e._iDisplayStart=r,o?(ft(e,null,"page",[e]),n&&se(e)):ft(e,null,"page-nc",[e]),o}function ke(t){return e("<div/>",{id:t.aanFeatures.r?null:t.sTableId+"_processing",class:t.oClasses.sProcessing,role:"status"}).html(t.oLanguage.sProcessing).append("<div><div></div><div></div><div></div><div></div></div>").insertBefore(t.nTable)[0]}function Ue(t,n){t.oFeatures.bProcessing&&e(t.aanFeatures.r).css("display",n?"block":"none"),ft(t,null,"processing",[t,n])}function Ve(t){var n,r,i,o,a,s,l,u,c,d,f,p,h=e(t.nTable),m=t.oScroll;return""===m.sX&&""===m.sY?t.nTable:(n=m.sX,r=m.sY,i=t.oClasses,a=(o=h.children("caption")).length?o[0]._captionSide:null,u=e(h[0].cloneNode(!1)),s=e(h[0].cloneNode(!1)),c=function(e){return e?$e(e):null},(l=h.children("tfoot")).length||(l=null),u=e(f="<div/>",{class:i.sScrollWrapper}).append(e(f,{class:i.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:n?c(n):"100%"}).append(e(f,{class:i.sScrollHeadInner}).css({"box-sizing":"content-box",width:m.sXInner||"100%"}).append(u.removeAttr("id").css("margin-left",0).append("top"===a?o:null).append(h.children("thead"))))).append(e(f,{class:i.sScrollBody}).css({position:"relative",overflow:"auto",width:c(n)}).append(h)),l&&u.append(e(f,{class:i.sScrollFoot}).css({overflow:"hidden",border:0,width:n?c(n):"100%"}).append(e(f,{class:i.sScrollFootInner}).append(s.removeAttr("id").css("margin-left",0).append("bottom"===a?o:null).append(h.children("tfoot"))))),c=u.children(),d=c[0],f=c[1],p=l?c[2]:null,n&&e(f).on("scroll.DT",(function(e){var t=this.scrollLeft;d.scrollLeft=t,l&&(p.scrollLeft=t)})),e(f).css("max-height",r),m.bCollapse||e(f).css("height",r),t.nScrollHead=d,t.nScrollBody=f,t.nScrollFoot=p,t.aoDrawCallback.push({fn:Be,sName:"scrolling"}),u[0])}function Be(n){function i(e){(e=e.style).paddingTop="0",e.paddingBottom="0",e.borderTopWidth="0",e.borderBottomWidth="0",e.height=0}var o,a,s,l,u,c=(p=n.oScroll).sX,d=p.sXInner,f=p.sY,p=p.iBarWidth,h=e(n.nScrollHead),m=h[0].style,g=(v=h.children("div"))[0].style,v=v.children("table"),E=n.nScrollBody,_=e(E),y=E.style,T=e(n.nScrollFoot).children("div"),I=T.children("table"),w=e(n.nTHead),S=e(n.nTable),D=S[0],R=D.style,C=n.nTFoot?e(n.nTFoot):null,A=n.oBrowser,O=A.bScrollOversize,x=(b(n.aoColumns,"nTh"),[]),L=[],P=[],M=[],N=E.scrollHeight>E.clientHeight;n.scrollBarVis!==N&&n.scrollBarVis!==r?(n.scrollBarVis=N,G(n)):(n.scrollBarVis=N,S.children("thead, tfoot").remove(),C&&(N=C.clone().prependTo(S),u=C.find("tr"),a=N.find("tr"),N.find("[id]").removeAttr("id")),N=w.clone().prependTo(S),w=w.find("tr"),o=N.find("tr"),N.find("th, td").removeAttr("tabindex"),N.find("[id]").removeAttr("id"),c||(y.width="100%",h[0].style.width="100%"),e.each(de(n,N),(function(e,t){s=F(n,e),t.style.width=n.aoColumns[s].sWidth})),C&&je((function(e){e.style.width=""}),a),h=S.outerWidth(),""===c?(R.width="100%",O&&(S.find("tbody").height()>E.offsetHeight||"scroll"==_.css("overflow-y"))&&(R.width=$e(S.outerWidth()-p)),h=S.outerWidth()):""!==d&&(R.width=$e(d),h=S.outerWidth()),je(i,o),je((function(n){var r=t.getComputedStyle?t.getComputedStyle(n).width:$e(e(n).width());P.push(n.innerHTML),x.push(r)}),o),je((function(e,t){e.style.width=x[t]}),w),e(o).css("height",0),C&&(je(i,a),je((function(t){M.push(t.innerHTML),L.push($e(e(t).css("width")))}),a),je((function(e,t){e.style.width=L[t]}),u),e(a).height(0)),je((function(e,t){e.innerHTML='<div class="dataTables_sizing">'+P[t]+"</div>",e.childNodes[0].style.height="0",e.childNodes[0].style.overflow="hidden",e.style.width=x[t]}),o),C&&je((function(e,t){e.innerHTML='<div class="dataTables_sizing">'+M[t]+"</div>",e.childNodes[0].style.height="0",e.childNodes[0].style.overflow="hidden",e.style.width=L[t]}),a),Math.round(S.outerWidth())<Math.round(h)?(l=E.scrollHeight>E.offsetHeight||"scroll"==_.css("overflow-y")?h+p:h,O&&(E.scrollHeight>E.offsetHeight||"scroll"==_.css("overflow-y"))&&(R.width=$e(l-p)),""!==c&&""===d||st(n,1,"Possible column misalignment",6)):l="100%",y.width=$e(l),m.width=$e(l),C&&(n.nScrollFoot.style.width=$e(l)),f||O&&(y.height=$e(D.offsetHeight+p)),N=S.outerWidth(),v[0].style.width=$e(N),g.width=$e(N),w=S.height()>E.clientHeight||"scroll"==_.css("overflow-y"),g[u="padding"+(A.bScrollbarLeft?"Left":"Right")]=w?p+"px":"0px",C&&(I[0].style.width=$e(N),T[0].style.width=$e(N),T[0].style[u]=w?p+"px":"0px"),S.children("colgroup").insertBefore(S.children("thead")),_.trigger("scroll"),!n.bSorted&&!n.bFiltered||n._drawHold||(E.scrollTop=0))}function je(e,t,n){for(var r,i,o=0,a=0,s=t.length;a<s;){for(r=t[a].firstChild,i=n?n[a].firstChild:null;r;)1===r.nodeType&&(n?e(r,i,o):e(r,o),o++),r=r.nextSibling,i=n?i.nextSibling:null;a++}}var qe=/<.*?>/g;function He(n){var r,i,o=n.nTable,a=n.aoColumns,s=(u=n.oScroll).sY,l=u.sX,u=u.sXInner,c=a.length,d=V(n,"bVisible"),f=e("th",n.nTHead),p=o.getAttribute("width"),h=o.parentNode,m=!1,g=n.oBrowser,v=g.bScrollOversize,E=((y=o.style.width)&&-1!==y.indexOf("%")&&(p=y),Ye(b(a,"sWidthOrig"),h));for(S=0;S<d.length;S++)null!==(r=a[d[S]]).sWidth&&(r.sWidth=E[S],m=!0);if(v||!m&&!l&&!s&&c==U(n)&&c==f.length)for(S=0;S<c;S++){var _=F(n,S);null!==_&&(a[_].sWidth=$e(f.eq(S).width()))}else{var y,T=((y=e(o).clone().css("visibility","hidden").removeAttr("id")).find("tbody tr").remove(),e("<tr/>").appendTo(y.find("tbody")));for(y.find("thead, tfoot").remove(),y.append(e(n.nTHead).clone()).append(e(n.nTFoot).clone()),y.find("tfoot th, tfoot td").css("width",""),f=de(n,y.find("thead")[0]),S=0;S<d.length;S++)r=a[d[S]],f[S].style.width=null!==r.sWidthOrig&&""!==r.sWidthOrig?$e(r.sWidthOrig):"",r.sWidthOrig&&l&&e(f[S]).append(e("<div/>").css({width:r.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(n.aoData.length)for(S=0;S<d.length;S++)r=a[i=d[S]],e(ze(n,i)).clone(!1).append(r.sContentPadding).appendTo(T);e("[name]",y).removeAttr("name");for(var I=e("<div/>").css(l||s?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(y).appendTo(h),w=(l&&u?y.width(u):l?(y.css("width","auto"),y.removeAttr("width"),y.width()<h.clientWidth&&p&&y.width(h.clientWidth)):s?y.width(h.clientWidth):p&&y.width(p),0),S=0;S<d.length;S++){var D,R=(D=e(f[S])).outerWidth()-D.width();w+=D=g.bBounding?Math.ceil(f[S].getBoundingClientRect().width):D.outerWidth(),a[d[S]].sWidth=$e(D-R)}o.style.width=$e(w),I.remove()}p&&(o.style.width=$e(p)),!p&&!l||n._reszEvt||(u=function(){e(t).on("resize.DT-"+n.sInstance,We((function(){G(n)})))},v?setTimeout(u,1e3):u(),n._reszEvt=!0)}var We=h.util.throttle;function Ye(t,r){for(var i=[],o=[],a=0;a<t.length;a++)t[a]?i.push(e("<div/>").css("width",$e(t[a])).appendTo(r||n.body)):i.push(null);for(a=0;a<t.length;a++)o.push(i[a]?i[a][0].offsetWidth:null);return e(i).remove(),o}function ze(t,n){var r,i=Xe(t,n);return i<0?null:(r=t.aoData[i]).nTr?r.anCells[n]:e("<td/>").html(W(t,i,n,"display"))[0]}function Xe(e,t){for(var n,r=-1,i=-1,o=0,a=e.aoData.length;o<a;o++)(n=(n=(n=W(e,o,t,"display")+"").replace(qe,"")).replace(/ /g," ")).length>r&&(r=n.length,i=o);return i}function $e(e){return null===e?"0px":"number"==typeof e?e<0?"0px":e+"px":e.match(/\d$/)?e+"px":e}function Ke(t){function n(t){t.length&&!Array.isArray(t[0])?g.push(t):e.merge(g,t)}var i,o,a,s,l,u,c,d=[],f=t.aoColumns,p=t.aaSortingFixed,m=e.isPlainObject(p),g=[];for(Array.isArray(p)&&n(p),m&&p.pre&&n(p.pre),n(t.aaSorting),m&&p.post&&n(p.post),i=0;i<g.length;i++)for(a=(s=f[c=g[i][o=0]].aDataSort).length;o<a;o++)u=f[l=s[o]].sType||"string",g[i]._idx===r&&(g[i]._idx=e.inArray(g[i][1],f[l].asSorting)),d.push({src:c,col:l,dir:g[i][1],index:g[i]._idx,type:u,formatter:h.ext.type.order[u+"-pre"]});return d}function Qe(e){var t,n,r,i,o,a=[],s=h.ext.type.order,l=e.aoData,u=(e.aoColumns,0),c=e.aiDisplayMaster;for(B(e),t=0,n=(o=Ke(e)).length;t<n;t++)(i=o[t]).formatter&&u++,nt(e,i.col);if("ssp"!=mt(e)&&0!==o.length){for(t=0,r=c.length;t<r;t++)a[c[t]]=t;u===o.length?c.sort((function(e,t){for(var n,r,i,s,u=o.length,c=l[e]._aSortData,d=l[t]._aSortData,f=0;f<u;f++)if(0!=(i=(n=c[(s=o[f]).col])<(r=d[s.col])?-1:r<n?1:0))return"asc"===s.dir?i:-i;return(n=a[e])<(r=a[t])?-1:r<n?1:0})):c.sort((function(e,t){for(var n,r,i,u=o.length,c=l[e]._aSortData,d=l[t]._aSortData,f=0;f<u;f++)if(n=c[(i=o[f]).col],r=d[i.col],0!==(i=(s[i.type+"-"+i.dir]||s["string-"+i.dir])(n,r)))return i;return(n=a[e])<(r=a[t])?-1:r<n?1:0}))}e.bSorted=!0}function Ze(e){for(var t=e.aoColumns,n=Ke(e),r=e.oLanguage.oAria,i=0,o=t.length;i<o;i++){var a=t[i],s=a.asSorting,l=a.ariaTitle||a.sTitle.replace(/<.*?>/g,""),u=a.nTh;u.removeAttribute("aria-sort"),a=a.bSortable?l+("asc"===(0<n.length&&n[0].col==i&&(u.setAttribute("aria-sort","asc"==n[0].dir?"ascending":"descending"),s[n[0].index+1])||s[0])?r.sSortAscending:r.sSortDescending):l,u.setAttribute("aria-label",a)}}function Je(t,n,i,o){function a(t,n){var i=t._idx;return(i=i===r?e.inArray(t[1],c):i)+1<c.length?i+1:n?null:0}var s,l=t.aoColumns[n],u=t.aaSorting,c=l.asSorting;"number"==typeof u[0]&&(u=t.aaSorting=[u]),i&&t.oFeatures.bSortMulti?-1!==(l=e.inArray(n,b(u,"0")))?null===(s=null===(s=a(u[l],!0))&&1===u.length?0:s)?u.splice(l,1):(u[l][1]=c[s],u[l]._idx=s):(u.push([n,c[0],0]),u[u.length-1]._idx=0):u.length&&u[0][0]==n?(s=a(u[0]),u.length=1,u[0][1]=c[s],u[0]._idx=s):(u.length=0,u.push([n,c[0]]),u[0]._idx=0),le(t),"function"==typeof o&&o(t)}function et(e,t,n,r){var i=e.aoColumns[n];ct(t,{},(function(t){!1!==i.bSortable&&(e.oFeatures.bProcessing?(Ue(e,!0),setTimeout((function(){Je(e,n,t.shiftKey,r),"ssp"!==mt(e)&&Ue(e,!1)}),0)):Je(e,n,t.shiftKey,r))}))}function tt(t){var n,r,i,o=t.aLastSort,a=t.oClasses.sSortColumn,s=Ke(t),l=t.oFeatures;if(l.bSort&&l.bSortClasses){for(n=0,r=o.length;n<r;n++)i=o[n].src,e(b(t.aoData,"anCells",i)).removeClass(a+(n<2?n+1:3));for(n=0,r=s.length;n<r;n++)i=s[n].src,e(b(t.aoData,"anCells",i)).addClass(a+(n<2?n+1:3))}t.aLastSort=s}function nt(e,t){for(var n,r,i,o=e.aoColumns[t],a=h.ext.order[o.sSortDataType],s=(a&&(n=a.call(e.oInstance,e,t,k(e,t))),h.ext.type.order[o.sType+"-pre"]),l=0,u=e.aoData.length;l<u;l++)(r=e.aoData[l])._aSortData||(r._aSortData=[]),r._aSortData[t]&&!a||(i=a?n[l]:W(e,l,t,"sort"),r._aSortData[t]=s?s(i):i)}function rt(t){var n;t._bLoadingState||(n={time:+new Date,start:t._iDisplayStart,length:t._iDisplayLength,order:e.extend(!0,[],t.aaSorting),search:Re(t.oPreviousSearch),columns:e.map(t.aoColumns,(function(e,n){return{visible:e.bVisible,search:Re(t.aoPreSearchCols[n])}}))},t.oSavedState=n,ft(t,"aoStateSaveParams","stateSaveParams",[t,n]),t.oFeatures.bStateSave&&!t.bDestroying&&t.fnStateSaveCallback.call(t.oInstance,t,n))}function it(e,t,n){var i;if(e.oFeatures.bStateSave)return(i=e.fnStateLoadCallback.call(e.oInstance,e,(function(t){ot(e,t,n)})))!==r&&ot(e,i,n),!0;n()}function ot(t,n,i){var o,a,s=t.aoColumns,l=(t._bLoadingState=!0,t._bInitComplete?new h.Api(t):null);if(n&&n.time){var u=ft(t,"aoStateLoadParams","stateLoadParams",[t,n]);if(-1!==e.inArray(!1,u))t._bLoadingState=!1;else if(0<(u=t.iStateDuration)&&n.time<+new Date-1e3*u)t._bLoadingState=!1;else if(n.columns&&s.length!==n.columns.length)t._bLoadingState=!1;else{if(t.oLoadedState=e.extend(!0,{},n),n.length!==r&&(l?l.page.len(n.length):t._iDisplayLength=n.length),n.start!==r&&(null===l?(t._iDisplayStart=n.start,t.iInitDisplayStart=n.start):Fe(t,n.start/t._iDisplayLength)),n.order!==r&&(t.aaSorting=[],e.each(n.order,(function(e,n){t.aaSorting.push(n[0]>=s.length?[0,n[1]]:n)}))),n.search!==r&&e.extend(t.oPreviousSearch,Ce(n.search)),n.columns){for(o=0,a=n.columns.length;o<a;o++){var c=n.columns[o];c.visible!==r&&(l?l.column(o).visible(c.visible,!1):s[o].bVisible=c.visible),c.search!==r&&e.extend(t.aoPreSearchCols[o],Ce(c.search))}l&&l.columns.adjust()}t._bLoadingState=!1,ft(t,"aoStateLoaded","stateLoaded",[t,n])}}else t._bLoadingState=!1;i()}function at(t){var n=h.settings;return-1!==(t=e.inArray(t,b(n,"nTable")))?n[t]:null}function st(e,n,r,i){if(r="DataTables warning: "+(e?"table id="+e.sTableId+" - ":"")+r,i&&(r+=". For more information about this error, please see https://datatables.net/tn/"+i),n)t.console&&console.log&&console.log(r);else if(n=(n=h.ext).sErrMode||n.errMode,e&&ft(e,null,"error",[e,i,r]),"alert"==n)alert(r);else{if("throw"==n)throw new Error(r);"function"==typeof n&&n(e,i,r)}}function lt(t,n,i,o){Array.isArray(i)?e.each(i,(function(e,r){Array.isArray(r)?lt(t,n,r[0],r[1]):lt(t,n,r)})):(o===r&&(o=i),n[i]!==r&&(t[o]=n[i]))}function ut(t,n,r){var i,o;for(o in n)n.hasOwnProperty(o)&&(i=n[o],e.isPlainObject(i)?(e.isPlainObject(t[o])||(t[o]={}),e.extend(!0,t[o],i)):r&&"data"!==o&&"aaData"!==o&&Array.isArray(i)?t[o]=i.slice():t[o]=i);return t}function ct(t,n,r){e(t).on("click.DT",n,(function(n){e(t).trigger("blur"),r(n)})).on("keypress.DT",n,(function(e){13===e.which&&(e.preventDefault(),r(e))})).on("selectstart.DT",(function(){return!1}))}function dt(e,t,n,r){n&&e[t].push({fn:n,sName:r})}function ft(t,n,r,i){var o=[];return n&&(o=e.map(t[n].slice().reverse(),(function(e,n){return e.fn.apply(t.oInstance,i)}))),null!==r&&(n=e.Event(r+".dt"),(r=e(t.nTable)).trigger(n,i),0===r.parents("body").length&&e("body").trigger(n,i),o.push(n.result)),o}function pt(e){var t=e._iDisplayStart,n=e.fnDisplayEnd(),r=e._iDisplayLength;n<=t&&(t=n-r),t-=t%r,e._iDisplayStart=t=-1===r||t<0?0:t}function ht(t,n){t=t.renderer;var r=h.ext.renderer[n];return e.isPlainObject(t)&&t[n]?r[t[n]]||r._:"string"==typeof t&&r[t]||r._}function mt(e){return e.oFeatures.bServerSide?"ssp":e.ajax||e.sAjaxSource?"ajax":"dom"}function gt(t,n){var r;return Array.isArray(t)?e.map(t,(function(e){return gt(e,n)})):"number"==typeof t?[n[t]]:(r=e.map(n,(function(e,t){return e.nTable})),e(r).filter(t).map((function(t){var i=e.inArray(this,r);return n[i]})).toArray())}function vt(e,t,n){var r,i;n&&(r=new St(e)).one("draw",(function(){n(r.ajax.json())})),"ssp"==mt(e)?le(e,t):(Ue(e,!0),(i=e.jqXHR)&&4!==i.readyState&&i.abort(),fe(e,[],(function(n){J(e);for(var r=ge(e,n),i=0,o=r.length;i<o;i++)q(e,r[i]);le(e,t),Ue(e,!1)})))}function Et(e,t,n,i,o){for(var a,s,l,u,c=[],f=typeof t,p=0,h=(t=t&&"string"!=f&&"function"!=f&&t.length!==r?t:[t]).length;p<h;p++)for(l=0,u=(s=t[p]&&t[p].split&&!t[p].match(/[\[\(:]/)?t[p].split(","):[t[p]]).length;l<u;l++)(a=n("string"==typeof s[l]?s[l].trim():s[l]))&&a.length&&(c=c.concat(a));var m=d.selector[e];if(m.length)for(p=0,h=m.length;p<h;p++)c=m[p](i,o,c);return w(c)}function _t(t){return(t=t||{}).filter&&t.search===r&&(t.search=t.filter),e.extend({search:"none",order:"current",page:"all"},t)}function yt(e){for(var t=0,n=e.length;t<n;t++)if(0<e[t].length)return e[0]=e[t],e[0].length=1,e.length=1,e.context=[e.context[t]],e;return e.length=0,e}function Tt(t,n){var r=t.context;if(r.length&&t.length&&(a=r[0].aoData[t[0]])._details){(a._detailsShow=n)?(a._details.insertAfter(a.nTr),e(a.nTr).addClass("dt-hasChild")):(a._details.detach(),e(a.nTr).removeClass("dt-hasChild")),ft(r[0],null,"childRow",[n,t.row(t[0])]);var i=r[0],o=new St(i),a=(n="draw"+(a=".dt.DT_details"),t="column-sizing"+a,"destroy"+a),s=i.aoData;o.off(n+" "+t+" "+a),b(s,"_details").length>0&&(o.on(n,(function(e,t){i===t&&o.rows({page:"current"}).eq(0).each((function(e){var t=s[e];t._detailsShow&&t._details.insertAfter(t.nTr)}))})),o.on(t,(function(t,n,r,o){if(i===n)for(var a,l=U(n),u=0,c=s.length;u<c;u++)(a=s[u])._details&&a._details.each((function(){var t=e(this).children("td");1==t.length&&t.attr("colspan",l)}))})),o.on(a,(function(e,t){if(i===t)for(var n=0,r=s.length;n<r;n++)s[n]._details&&Ct(o,n)}))),Rt(r)}}function It(e,t,n,r,i){for(var o=[],a=0,s=i.length;a<s;a++)o.push(W(e,i[a],t));return o}var bt=[],wt=Array.prototype,St=function(t,n){if(!(this instanceof St))return new St(t,n);function r(t){var n,r,o,a;o=h.settings,a=e.map(o,(function(e,t){return e.nTable})),(t=t?t.nTable&&t.oApi?[t]:t.nodeName&&"table"===t.nodeName.toLowerCase()?-1!==(n=e.inArray(t,a))?[o[n]]:null:t&&"function"==typeof t.settings?t.settings().toArray():("string"==typeof t?r=e(t):t instanceof e&&(r=t),r?r.map((function(t){return-1!==(n=e.inArray(this,a))?o[n]:null})).toArray():void 0):[])&&i.push.apply(i,t)}var i=[];if(Array.isArray(t))for(var o=0,a=t.length;o<a;o++)r(t[o]);else r(t);this.context=w(i),n&&e.merge(this,n),this.selector={rows:null,cols:null,opts:null},St.extend(this,this,bt)},Dt=(h.Api=St,e.extend(St.prototype,{any:function(){return 0!==this.count()},concat:wt.concat,context:[],count:function(){return this.flatten().length},each:function(e){for(var t=0,n=this.length;t<n;t++)e.call(this,this[t],t,this);return this},eq:function(e){var t=this.context;return t.length>e?new St(t[e],this[e]):null},filter:function(e){var t=[];if(wt.filter)t=wt.filter.call(this,e,this);else for(var n=0,r=this.length;n<r;n++)e.call(this,this[n],n,this)&&t.push(this[n]);return new St(this.context,t)},flatten:function(){var e=[];return new St(this.context,e.concat.apply(e,this.toArray()))},join:wt.join,indexOf:wt.indexOf||function(e,t){for(var n=t||0,r=this.length;n<r;n++)if(this[n]===e)return n;return-1},iterator:function(e,t,n,i){var o,a,s,l,u,c,d,f,p=[],h=this.context,m=this.selector;for("string"==typeof e&&(i=n,n=t,t=e,e=!1),a=0,s=h.length;a<s;a++){var g=new St(h[a]);if("table"===t)(o=n.call(g,h[a],a))!==r&&p.push(o);else if("columns"===t||"rows"===t)(o=n.call(g,h[a],this[a],a))!==r&&p.push(o);else if("column"===t||"column-rows"===t||"row"===t||"cell"===t)for(d=this[a],"column-rows"===t&&(c=Dt(h[a],m.opts)),l=0,u=d.length;l<u;l++)f=d[l],(o="cell"===t?n.call(g,h[a],f.row,f.column,a,l):n.call(g,h[a],f,a,l,c))!==r&&p.push(o)}return p.length||i?((e=(i=new St(h,e?p.concat.apply([],p):p)).selector).rows=m.rows,e.cols=m.cols,e.opts=m.opts,i):this},lastIndexOf:wt.lastIndexOf||function(e,t){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(e){var t=[];if(wt.map)t=wt.map.call(this,e,this);else for(var n=0,r=this.length;n<r;n++)t.push(e.call(this,this[n],n));return new St(this.context,t)},pluck:function(e){var t=h.util.get(e);return this.map((function(e){return t(e)}))},pop:wt.pop,push:wt.push,reduce:wt.reduce||function(e,t){return P(this,e,t,0,this.length,1)},reduceRight:wt.reduceRight||function(e,t){return P(this,e,t,this.length-1,-1,-1)},reverse:wt.reverse,selector:null,shift:wt.shift,slice:function(){return new St(this.context,this)},sort:wt.sort,splice:wt.splice,toArray:function(){return wt.slice.call(this)},to$:function(){return e(this)},toJQuery:function(){return e(this)},unique:function(){return new St(this.context,w(this))},unshift:wt.unshift}),St.extend=function(e,t,n){if(n.length&&t&&(t instanceof St||t.__dt_wrapper))for(var r,i=0,o=n.length;i<o;i++)t[(r=n[i]).name]="function"===r.type?function(e,t,n){return function(){var r=t.apply(e,arguments);return St.extend(r,r,n.methodExt),r}}(e,r.val,r):"object"===r.type?{}:r.val,t[r.name].__dt_wrapper=!0,St.extend(e,t[r.name],r.propExt)},St.register=f=function(t,n){if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++)St.register(t[r],n);else for(var o=t.split("."),a=bt,s=0,l=o.length;s<l;s++){var u,c,d=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n].name===t)return e[n];return null}(a,c=(u=-1!==o[s].indexOf("()"))?o[s].replace("()",""):o[s]);d||a.push(d={name:c,val:{},methodExt:[],propExt:[],type:"object"}),s===l-1?(d.val=n,d.type="function"==typeof n?"function":e.isPlainObject(n)?"object":"other"):a=u?d.methodExt:d.propExt}},St.registerPlural=p=function(e,t,n){St.register(e,n),St.register(t,(function(){var e=n.apply(this,arguments);return e===this?this:e instanceof St?e.length?Array.isArray(e[0])?new St(e.context,e[0]):e[0]:r:e}))},f("tables()",(function(e){return e!==r&&null!==e?new St(gt(e,this.context)):this})),f("table()",(function(e){var t=(e=this.tables(e)).context;return t.length?new St(t[0]):e})),p("tables().nodes()","table().node()",(function(){return this.iterator("table",(function(e){return e.nTable}),1)})),p("tables().body()","table().body()",(function(){return this.iterator("table",(function(e){return e.nTBody}),1)})),p("tables().header()","table().header()",(function(){return this.iterator("table",(function(e){return e.nTHead}),1)})),p("tables().footer()","table().footer()",(function(){return this.iterator("table",(function(e){return e.nTFoot}),1)})),p("tables().containers()","table().container()",(function(){return this.iterator("table",(function(e){return e.nTableWrapper}),1)})),f("draw()",(function(e){return this.iterator("table",(function(t){"page"===e?se(t):le(t,!1===(e="string"==typeof e?"full-hold"!==e:e))}))})),f("page()",(function(e){return e===r?this.page.info().page:this.iterator("table",(function(t){Fe(t,e)}))})),f("page.info()",(function(e){var t,n,i,o,a;return 0===this.context.length?r:(n=(t=this.context[0])._iDisplayStart,i=t.oFeatures.bPaginate?t._iDisplayLength:-1,o=t.fnRecordsDisplay(),{page:(a=-1===i)?0:Math.floor(n/i),pages:a?1:Math.ceil(o/i),start:n,end:t.fnDisplayEnd(),length:i,recordsTotal:t.fnRecordsTotal(),recordsDisplay:o,serverSide:"ssp"===mt(t)})})),f("page.len()",(function(e){return e===r?0!==this.context.length?this.context[0]._iDisplayLength:r:this.iterator("table",(function(t){Me(t,e)}))})),f("ajax.json()",(function(){var e=this.context;if(0<e.length)return e[0].json})),f("ajax.params()",(function(){var e=this.context;if(0<e.length)return e[0].oAjaxData})),f("ajax.reload()",(function(e,t){return this.iterator("table",(function(n){vt(n,!1===t,e)}))})),f("ajax.url()",(function(t){var n=this.context;return t===r?0===n.length?r:(n=n[0]).ajax?e.isPlainObject(n.ajax)?n.ajax.url:n.ajax:n.sAjaxSource:this.iterator("table",(function(n){e.isPlainObject(n.ajax)?n.ajax.url=t:n.ajax=t}))})),f("ajax.url().load()",(function(e,t){return this.iterator("table",(function(n){vt(n,!1===t,e)}))})),function(t,n){var r,i=[],o=t.aiDisplay,a=t.aiDisplayMaster,s=n.search,u=n.order;n=n.page;if("ssp"==mt(t))return"removed"===s?[]:l(0,a.length);if("current"==n)for(d=t._iDisplayStart,f=t.fnDisplayEnd();d<f;d++)i.push(o[d]);else if("current"==u||"applied"==u){if("none"==s)i=a.slice();else if("applied"==s)i=o.slice();else if("removed"==s){for(var c={},d=0,f=o.length;d<f;d++)c[o[d]]=null;i=e.map(a,(function(e){return c.hasOwnProperty(e)?null:e}))}}else if("index"==u||"original"==u)for(d=0,f=t.aoData.length;d<f;d++)("none"==s||-1===(r=e.inArray(d,o))&&"removed"==s||0<=r&&"applied"==s)&&i.push(d);return i}),Rt=(f("rows()",(function(t,n){t===r?t="":e.isPlainObject(t)&&(n=t,t=""),n=_t(n);var o=this.iterator("table",(function(o){return Et("row",t,(function(t){var n=i(t),o=a.aoData;if(null!==n&&!l)return[n];if(c=c||Dt(a,l),null!==n&&-1!==e.inArray(n,c))return[n];if(null===t||t===r||""===t)return c;if("function"==typeof t)return e.map(c,(function(e){var n=o[e];return t(e,n._aData,n.nTr)?e:null}));if(t.nodeName)return n=t._DT_RowIndex,d=t._DT_CellIndex,n!==r?o[n]&&o[n].nTr===t?[n]:[]:d?o[d.row]&&o[d.row].nTr===t.parentNode?[d.row]:[]:(n=e(t).closest("*[data-dt-row]")).length?[n.data("dt-row")]:[];if("string"==typeof t&&"#"===t.charAt(0)){var d=a.aIds[t.replace(/^#/,"")];if(d!==r)return[d.idx]}return n=u(s(a.aoData,c,"nTr")),e(n).filter(t).map((function(){return this._DT_RowIndex})).toArray()}),a=o,l=n);var a,l,c}),1);return o.selector.rows=t,o.selector.opts=n,o})),f("rows().nodes()",(function(){return this.iterator("row",(function(e,t){return e.aoData[t].nTr||r}),1)})),f("rows().data()",(function(){return this.iterator(!0,"rows",(function(e,t){return s(e.aoData,t,"_aData")}),1)})),p("rows().cache()","row().cache()",(function(e){return this.iterator("row",(function(t,n){return t=t.aoData[n],"search"===e?t._aFilterData:t._aSortData}),1)})),p("rows().invalidate()","row().invalidate()",(function(e){return this.iterator("row",(function(t,n){te(t,n,e)}))})),p("rows().indexes()","row().index()",(function(){return this.iterator("row",(function(e,t){return t}),1)})),p("rows().ids()","row().id()",(function(e){for(var t=[],n=this.context,r=0,i=n.length;r<i;r++)for(var o=0,a=this[r].length;o<a;o++){var s=n[r].rowIdFn(n[r].aoData[this[r][o]]._aData);t.push((!0===e?"#":"")+s)}return new St(n,t)})),p("rows().remove()","row().remove()",(function(){var e=this;return this.iterator("row",(function(t,n,i){var o,a,s,l,u,c,d=t.aoData,f=d[n];for(d.splice(n,1),o=0,a=d.length;o<a;o++)if(c=(u=d[o]).anCells,null!==u.nTr&&(u.nTr._DT_RowIndex=o),null!==c)for(s=0,l=c.length;s<l;s++)c[s]._DT_CellIndex.row=o;ee(t.aiDisplayMaster,n),ee(t.aiDisplay,n),ee(e[i],n,!1),0<t._iRecordsDisplay&&t._iRecordsDisplay--,pt(t),(i=t.rowIdFn(f._aData))!==r&&delete t.aIds[i]})),this.iterator("table",(function(e){for(var t=0,n=e.aoData.length;t<n;t++)e.aoData[t].idx=t})),this})),f("rows.add()",(function(t){var n=this.iterator("table",(function(e){for(var n,r=[],i=0,o=t.length;i<o;i++)(n=t[i]).nodeName&&"TR"===n.nodeName.toUpperCase()?r.push(H(e,n)[0]):r.push(q(e,n));return r}),1),r=this.rows(-1);return r.pop(),e.merge(r,n),r})),f("row()",(function(e,t){return yt(this.rows(e,t))})),f("row().data()",(function(e){var t,n=this.context;return e===r?n.length&&this.length?n[0].aoData[this[0]]._aData:r:((t=n[0].aoData[this[0]])._aData=e,Array.isArray(e)&&t.nTr&&t.nTr.id&&Q(n[0].rowId)(e,t.nTr.id),te(n[0],this[0],"data"),this)})),f("row().node()",(function(){var e=this.context;return e.length&&this.length&&e[0].aoData[this[0]].nTr||null})),f("row.add()",(function(t){t instanceof e&&t.length&&(t=t[0]);var n=this.iterator("table",(function(e){return t.nodeName&&"TR"===t.nodeName.toUpperCase()?H(e,t)[0]:q(e,t)}));return this.row(n[0])})),e(n).on("plugin-init.dt",(function(t,n){var r=new St(n),i="stateSaveParams."+(a="on-plugin-init"),o="destroy. "+a,a=(r.on(i,(function(e,t,n){for(var r=t.rowIdFn,i=t.aoData,o=[],a=0;a<i.length;a++)i[a]._detailsShow&&o.push("#"+r(i[a]._aData));n.childRows=o})),r.on(o,(function(){r.off(i+" "+o)})),r.state.loaded());a&&a.childRows&&r.rows(e.map(a.childRows,(function(e){return e.replace(/:/g,"\\:")}))).every((function(){ft(n,null,"requestChild",[this])}))})),h.util.throttle((function(e){rt(e[0])}),500)),Ct=function(t,n){var i=t.context;i.length&&(n=i[0].aoData[n!==r?n:t[0]])&&n._details&&(n._details.remove(),n._detailsShow=r,n._details=r,e(n.nTr).removeClass("dt-hasChild"),Rt(i))},At="row().child",Ot=At+"()",xt=(f(Ot,(function(t,n){var i=this.context;return t===r?i.length&&this.length?i[0].aoData[this[0]]._details:r:(!0===t?this.child.show():!1===t?Ct(this):i.length&&this.length&&function(t,n,r,i){var o=[];(function n(r,i){var a;if(Array.isArray(r)||r instanceof e)for(var s=0,l=r.length;s<l;s++)n(r[s],i);else r.nodeName&&"tr"===r.nodeName.toLowerCase()?o.push(r):(a=e("<tr><td></td></tr>").addClass(i),e("td",a).addClass(i).html(r)[0].colSpan=U(t),o.push(a[0]))})(r,i),n._details&&n._details.detach(),n._details=e(o),n._detailsShow&&n._details.insertAfter(n.nTr)}(i[0],i[0].aoData[this[0]],t,n),this)})),f([At+".show()",Ot+".show()"],(function(e){return Tt(this,!0),this})),f([At+".hide()",Ot+".hide()"],(function(){return Tt(this,!1),this})),f([At+".remove()",Ot+".remove()"],(function(){return Ct(this),this})),f(At+".isShown()",(function(){var e=this.context;return e.length&&this.length&&e[0].aoData[this[0]]._detailsShow||!1})),/^([^:]+):(name|visIdx|visible)$/),Lt=(f("columns()",(function(t,n){t===r?t="":e.isPlainObject(t)&&(n=t,t=""),n=_t(n);var o=this.iterator("table",(function(r){return a=t,s=n,u=(o=r).aoColumns,c=b(u,"sName"),d=b(u,"nTh"),Et("column",a,(function(t){var n,r=i(t);if(""===t)return l(u.length);if(null!==r)return[0<=r?r:u.length+r];if("function"==typeof t)return n=Dt(o,s),e.map(u,(function(e,r){return t(r,It(o,r,0,0,n),d[r])?r:null}));var a="string"==typeof t?t.match(xt):"";if(a)switch(a[2]){case"visIdx":case"visible":var f,p=parseInt(a[1],10);return p<0?[(f=e.map(u,(function(e,t){return e.bVisible?t:null})))[f.length+p]]:[F(o,p)];case"name":return e.map(c,(function(e,t){return e===a[1]?t:null}));default:return[]}return t.nodeName&&t._DT_CellIndex?[t._DT_CellIndex.column]:(r=e(d).filter(t).map((function(){return e.inArray(this,d)})).toArray()).length||!t.nodeName?r:(r=e(t).closest("*[data-dt-column]")).length?[r.data("dt-column")]:[]}),o,s);var o,a,s,u,c,d}),1);return o.selector.cols=t,o.selector.opts=n,o})),p("columns().header()","column().header()",(function(e,t){return this.iterator("column",(function(e,t){return e.aoColumns[t].nTh}),1)})),p("columns().footer()","column().footer()",(function(e,t){return this.iterator("column",(function(e,t){return e.aoColumns[t].nTf}),1)})),p("columns().data()","column().data()",(function(){return this.iterator("column-rows",It,1)})),p("columns().dataSrc()","column().dataSrc()",(function(){return this.iterator("column",(function(e,t){return e.aoColumns[t].mData}),1)})),p("columns().cache()","column().cache()",(function(e){return this.iterator("column-rows",(function(t,n,r,i,o){return s(t.aoData,o,"search"===e?"_aFilterData":"_aSortData",n)}),1)})),p("columns().nodes()","column().nodes()",(function(){return this.iterator("column-rows",(function(e,t,n,r,i){return s(e.aoData,i,"anCells",t)}),1)})),p("columns().visible()","column().visible()",(function(t,n){var i=this,o=this.iterator("column",(function(n,i){if(t===r)return n.aoColumns[i].bVisible;var o,a,s=i,l=(i=t,n.aoColumns),u=l[s],c=n.aoData;if(i===r)u.bVisible;else if(u.bVisible!==i){if(i)for(var d=e.inArray(!0,b(l,"bVisible"),s+1),f=0,p=c.length;f<p;f++)a=c[f].nTr,o=c[f].anCells,a&&a.insertBefore(o[s],o[d]||null);else e(b(n.aoData,"anCells",s)).detach();u.bVisible=i}}));return t!==r&&this.iterator("table",(function(o){ae(o,o.aoHeader),ae(o,o.aoFooter),o.aiDisplay.length||e(o.nTBody).find("td[colspan]").attr("colspan",U(o)),rt(o),i.iterator("column",(function(e,r){ft(e,null,"column-visibility",[e,r,t,n])})),n!==r&&!n||i.columns.adjust()})),o})),p("columns().indexes()","column().index()",(function(e){return this.iterator("column",(function(t,n){return"visible"===e?k(t,n):n}),1)})),f("columns.adjust()",(function(){return this.iterator("table",(function(e){G(e)}),1)})),f("column.index()",(function(e,t){var n;if(0!==this.context.length)return n=this.context[0],"fromVisible"===e||"toData"===e?F(n,t):"fromData"===e||"toVisible"===e?k(n,t):void 0})),f("column()",(function(e,t){return yt(this.columns(e,t))})),f("cells()",(function(t,n,i){var o,a,l,c,d,f,p;return e.isPlainObject(t)&&(t.row===r?(i=t,t=null):(i=n,n=null)),e.isPlainObject(n)&&(i=n,n=null),null===n||n===r?this.iterator("table",(function(n){return o=n,n=t,a=_t(i),g=o.aoData,v=Dt(o,a),E=u(s(g,v,"anCells")),_=e(S([],E)),y=o.aoColumns.length,Et("cell",n,(function(t){var n,i="function"==typeof t;if(null===t||t===r||i){for(c=[],d=0,f=v.length;d<f;d++)for(l=v[d],p=0;p<y;p++)h={row:l,column:p},(!i||(m=g[l],t(h,W(o,l,p),m.anCells?m.anCells[p]:null)))&&c.push(h);return c}return e.isPlainObject(t)?t.column!==r&&t.row!==r&&-1!==e.inArray(t.row,v)?[t]:[]:(n=_.filter(t).map((function(e,t){return{row:t._DT_CellIndex.row,column:t._DT_CellIndex.column}})).toArray()).length||!t.nodeName?n:(m=e(t).closest("*[data-dt-row]")).length?[{row:m.data("dt-row"),column:m.data("dt-column")}]:[]}),o,a);var o,a,l,c,d,f,p,h,m,g,v,E,_,y})):(p=i?{page:i.page,order:i.order,search:i.search}:{},o=this.columns(n,p),a=this.rows(t,p),p=this.iterator("table",(function(e,t){var n=[];for(l=0,c=a[t].length;l<c;l++)for(d=0,f=o[t].length;d<f;d++)n.push({row:a[t][l],column:o[t][d]});return n}),1),p=i&&i.selected?this.cells(p,i):p,e.extend(p.selector,{cols:n,rows:t,opts:i}),p)})),p("cells().nodes()","cell().node()",(function(){return this.iterator("cell",(function(e,t,n){return(e=e.aoData[t])&&e.anCells?e.anCells[n]:r}),1)})),f("cells().data()",(function(){return this.iterator("cell",(function(e,t,n){return W(e,t,n)}),1)})),p("cells().cache()","cell().cache()",(function(e){return e="search"===e?"_aFilterData":"_aSortData",this.iterator("cell",(function(t,n,r){return t.aoData[n][e][r]}),1)})),p("cells().render()","cell().render()",(function(e){return this.iterator("cell",(function(t,n,r){return W(t,n,r,e)}),1)})),p("cells().indexes()","cell().index()",(function(){return this.iterator("cell",(function(e,t,n){return{row:t,column:n,columnVisible:k(e,n)}}),1)})),p("cells().invalidate()","cell().invalidate()",(function(e){return this.iterator("cell",(function(t,n,r){te(t,n,e,r)}))})),f("cell()",(function(e,t,n){return yt(this.cells(e,t,n))})),f("cell().data()",(function(e){var t=this.context,n=this[0];return e===r?t.length&&n.length?W(t[0],n[0].row,n[0].column):r:(Y(t[0],n[0].row,n[0].column,e),te(t[0],n[0].row,"data",n[0].column),this)})),f("order()",(function(e,t){var n=this.context;return e===r?0!==n.length?n[0].aaSorting:r:("number"==typeof e?e=[[e,t]]:e.length&&!Array.isArray(e[0])&&(e=Array.prototype.slice.call(arguments)),this.iterator("table",(function(t){t.aaSorting=e.slice()})))})),f("order.listener()",(function(e,t,n){return this.iterator("table",(function(r){et(r,e,t,n)}))})),f("order.fixed()",(function(t){var n;return t?this.iterator("table",(function(n){n.aaSortingFixed=e.extend(!0,{},t)})):(n=(n=this.context).length?n[0].aaSortingFixed:r,Array.isArray(n)?{pre:n}:n)})),f(["columns().order()","column().order()"],(function(t){var n=this;return this.iterator("table",(function(r,i){var o=[];e.each(n[i],(function(e,n){o.push([n,t])})),r.aaSorting=o}))})),f("search()",(function(t,n,i,o){var a=this.context;return t===r?0!==a.length?a[0].oPreviousSearch.sSearch:r:this.iterator("table",(function(r){r.oFeatures.bFilter&&Ee(r,e.extend({},r.oPreviousSearch,{sSearch:t+"",bRegex:null!==n&&n,bSmart:null===i||i,bCaseInsensitive:null===o||o}),1)}))})),p("columns().search()","column().search()",(function(t,n,i,o){return this.iterator("column",(function(a,s){var l=a.aoPreSearchCols;if(t===r)return l[s].sSearch;a.oFeatures.bFilter&&(e.extend(l[s],{sSearch:t+"",bRegex:null!==n&&n,bSmart:null===i||i,bCaseInsensitive:null===o||o}),Ee(a,a.oPreviousSearch,1))}))})),f("state()",(function(){return this.context.length?this.context[0].oSavedState:null})),f("state.clear()",(function(){return this.iterator("table",(function(e){e.fnStateSaveCallback.call(e.oInstance,e,{})}))})),f("state.loaded()",(function(){return this.context.length?this.context[0].oLoadedState:null})),f("state.save()",(function(){return this.iterator("table",(function(e){rt(e)}))})),h.use=function(r,i){"lib"===i||r.fn?e=r:"win"==i||r.document?n=(t=r).document:"datetime"!==i&&"DateTime"!==r.type||(h.DateTime=r)},h.factory=function(r,i){var o=!1;return r&&r.document&&(n=(t=r).document),i&&i.fn&&i.fn.jquery&&(e=i,o=!0),o},h.versionCheck=h.fnVersionCheck=function(e){for(var t,n,r=h.version.split("."),i=e.split("."),o=0,a=i.length;o<a;o++)if((t=parseInt(r[o],10)||0)!==(n=parseInt(i[o],10)||0))return n<t;return!0},h.isDataTable=h.fnIsDataTable=function(t){var n=e(t).get(0),r=!1;return t instanceof h.Api||(e.each(h.settings,(function(t,i){var o=i.nScrollHead?e("table",i.nScrollHead)[0]:null,a=i.nScrollFoot?e("table",i.nScrollFoot)[0]:null;i.nTable!==n&&o!==n&&a!==n||(r=!0)})),r)},h.tables=h.fnTables=function(t){var n=!1,r=(e.isPlainObject(t)&&(n=t.api,t=t.visible),e.map(h.settings,(function(n){if(!t||e(n.nTable).is(":visible"))return n.nTable})));return n?new St(r):r},h.camelToHungarian=R,f("$()",(function(t,n){return n=this.rows(n).nodes(),n=e(n),e([].concat(n.filter(t).toArray(),n.find(t).toArray()))})),e.each(["on","one","off"],(function(t,n){f(n+"()",(function(){var t=Array.prototype.slice.call(arguments),r=(t[0]=e.map(t[0].split(/\s/),(function(e){return e.match(/\.dt\b/)?e:e+".dt"})).join(" "),e(this.tables().nodes()));return r[n].apply(r,t),this}))})),f("clear()",(function(){return this.iterator("table",(function(e){J(e)}))})),f("settings()",(function(){return new St(this.context,this.context)})),f("init()",(function(){var e=this.context;return e.length?e[0].oInit:null})),f("data()",(function(){return this.iterator("table",(function(e){return b(e.aoData,"_aData")})).flatten()})),f("destroy()",(function(n){return n=n||!1,this.iterator("table",(function(r){var i,o=r.oClasses,a=r.nTable,s=r.nTBody,l=r.nTHead,u=r.nTFoot,c=e(a),d=(s=e(s),e(r.nTableWrapper)),f=e.map(r.aoData,(function(e){return e.nTr}));r.bDestroying=!0,ft(r,"aoDestroyCallback","destroy",[r]),n||new St(r).columns().visible(!0),d.off(".DT").find(":not(tbody *)").off(".DT"),e(t).off(".DT-"+r.sInstance),a!=l.parentNode&&(c.children("thead").detach(),c.append(l)),u&&a!=u.parentNode&&(c.children("tfoot").detach(),c.append(u)),r.aaSorting=[],r.aaSortingFixed=[],tt(r),e(f).removeClass(r.asStripeClasses.join(" ")),e("th, td",l).removeClass(o.sSortable+" "+o.sSortableAsc+" "+o.sSortableDesc+" "+o.sSortableNone),s.children().detach(),s.append(f),u=r.nTableWrapper.parentNode,c[l=n?"remove":"detach"](),d[l](),!n&&u&&(u.insertBefore(a,r.nTableReinsertBefore),c.css("width",r.sDestroyWidth).removeClass(o.sTable),i=r.asDestroyStripes.length)&&s.children().each((function(t){e(this).addClass(r.asDestroyStripes[t%i])})),f=e.inArray(r,h.settings);-1!==f&&h.settings.splice(f,1)}))})),e.each(["column","row","cell"],(function(e,t){f(t+"s().every()",(function(e){var n=this.selector.opts,i=this;return this.iterator(t,(function(o,a,s,l,u){e.call(i[t](a,"cell"===t?s:n,"cell"===t?n:r),a,s,l,u)}))}))})),f("i18n()",(function(t,n,i){var o=this.context[0];return(t=K(t)(o.oLanguage))===r&&(t=n),"string"==typeof(t=i!==r&&e.isPlainObject(t)?t[i]!==r?t[i]:t._:t)?t.replace("%d",i):t})),h.version="1.13.11",h.settings=[],h.models={},h.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0,return:!1},h.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1},h.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null},h.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(e){try{return JSON.parse((-1===e.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+e.sInstance+"_"+location.pathname))}catch(e){return{}}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(e,t){try{(-1===e.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+e.sInstance+"_"+location.pathname,JSON.stringify(t))}catch(e){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:e.extend({},h.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"},D(h.defaults),h.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null},D(h.defaults.column),h.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,jqXHR:null,json:r,oAjaxData:r,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==mt(this)?+this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==mt(this)?+this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var e=this._iDisplayLength,t=this._iDisplayStart,n=t+e,r=this.aiDisplay.length,i=this.oFeatures,o=i.bPaginate;return i.bServerSide?!1===o||-1===e?t+r:Math.min(t+e,this._iRecordsDisplay):!o||r<n||-1===e?r:n},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null},h.ext=d={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:h.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:h.version},e.extend(d,{afnFiltering:d.search,aTypes:d.type.detect,ofnSearch:d.type.search,oSort:d.type.order,afnSortData:d.order,aoFeatures:d.feature,oApi:d.internal,oStdClasses:d.classes,oPagination:d.pager}),e.extend(h.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_desc_disabled",sSortableDesc:"sorting_asc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""}),h.ext.pager);function Pt(e,t){var n=[],r=Lt.numbers_length,i=Math.floor(r/2);return t<=r?n=l(0,t):e<=i?((n=l(0,r-2)).push("ellipsis"),n.push(t-1)):((t-1-i<=e?n=l(t-(r-2),t):((n=l(e-i+2,e+i-1)).push("ellipsis"),n.push(t-1),n)).splice(0,0,"ellipsis"),n.splice(0,0,0)),n.DT_el="span",n}function Mt(e,t,n,r){var i;return 0===e||e&&"-"!==e?"number"==(i=typeof e)||"bigint"==i?e:+(e=(e=t?I(e,t):e).replace&&(n&&(e=e.replace(n,"")),r)?e.replace(r,""):e):-1/0}function Nt(t){e.each({num:function(e){return Mt(e,t)},"num-fmt":function(e){return Mt(e,t,y)},"html-num":function(e){return Mt(e,t,v)},"html-num-fmt":function(e){return Mt(e,t,v,y)}},(function(e,n){d.type.order[e+t+"-pre"]=n,e.match(/^html\-/)&&(d.type.search[e+t]=d.type.search.html)}))}function Gt(e){return"string"==typeof(e=Array.isArray(e)?e.join(","):e)?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):e}function Ft(e,n,r,i,o){return t.moment?e[n](o):t.luxon?e[r](o):i?e[i](o):e}e.extend(Lt,{simple:function(e,t){return["previous","next"]},full:function(e,t){return["first","previous","next","last"]},numbers:function(e,t){return[Pt(e,t)]},simple_numbers:function(e,t){return["previous",Pt(e,t),"next"]},full_numbers:function(e,t){return["first","previous",Pt(e,t),"next","last"]},first_last_numbers:function(e,t){return["first",Pt(e,t),"last"]},_numbers:Pt,numbers_length:7}),e.extend(!0,h.ext.renderer,{pageButton:{_:function(t,i,o,a,s,l){var u,c,d,f=t.oClasses,p=t.oLanguage.oPaginate,h=t.oLanguage.oAria.paginate||{};try{d=e(i).find(n.activeElement).data("dt-idx")}catch(i){}(function n(r,i){for(var a,d=f.sPageButtonDisabled,m=function(e){Fe(t,e.data.action,!0)},g=0,v=i.length;g<v;g++)if(a=i[g],Array.isArray(a)){var E=e("<"+(a.DT_el||"div")+"/>").appendTo(r);n(E,a)}else{var _=!1;switch(u=null,c=a){case"ellipsis":r.append('<span class="ellipsis">…</span>');break;case"first":u=p.sFirst,0===s&&(_=!0);break;case"previous":u=p.sPrevious,0===s&&(_=!0);break;case"next":u=p.sNext,0!==l&&s!==l-1||(_=!0);break;case"last":u=p.sLast,0!==l&&s!==l-1||(_=!0);break;default:u=t.fnFormatNumber(a+1),c=s===a?f.sPageButtonActive:""}null!==u&&(E=t.oInit.pagingTag||"a",_&&(c+=" "+d),ct(e("<"+E+">",{class:f.sPageButton+" "+c,"aria-controls":t.sTableId,"aria-disabled":_?"true":null,"aria-label":h[a],role:"link","aria-current":c===f.sPageButtonActive?"page":null,"data-dt-idx":a,tabindex:_?-1:t.iTabIndex,id:0===o&&"string"==typeof a?t.sTableId+"_"+a:null}).html(u).appendTo(r),{action:a},m))}})(e(i).empty(),a),d!==r&&e(i).find("[data-dt-idx="+d+"]").trigger("focus")}}}),e.extend(h.ext.type.detect,[function(e,t){return o(e,t=t.oLanguage.sDecimal)?"num"+t:null},function(e,t){var n;return(!e||e instanceof Date||E.test(e))&&(null!==(n=Date.parse(e))&&!isNaN(n)||T(e))?"date":null},function(e,t){return o(e,t=t.oLanguage.sDecimal,!0)?"num-fmt"+t:null},function(e,t){return a(e,t=t.oLanguage.sDecimal)?"html-num"+t:null},function(e,t){return a(e,t=t.oLanguage.sDecimal,!0)?"html-num-fmt"+t:null},function(e,t){return T(e)||"string"==typeof e&&-1!==e.indexOf("<")?"html":null}]),e.extend(h.ext.type.search,{html:function(e){return T(e)?e:"string"==typeof e?e.replace(g," ").replace(v,""):""},string:function(e){return T(e)||"string"!=typeof e?e:e.replace(g," ")}}),e.extend(d.type.order,{"date-pre":function(e){return e=Date.parse(e),isNaN(e)?-1/0:e},"html-pre":function(e){return T(e)?"":e.replace?e.replace(/<.*?>/g,"").toLowerCase():e+""},"string-pre":function(e){return T(e)?"":"string"==typeof e?e.toLowerCase():e.toString?e.toString():""},"string-asc":function(e,t){return e<t?-1:t<e?1:0},"string-desc":function(e,t){return e<t?1:t<e?-1:0}}),Nt(""),e.extend(!0,h.ext.renderer,{header:{_:function(t,n,r,i){e(t.nTable).on("order.dt.DT",(function(e,o,a,s){t===o&&(o=r.idx,n.removeClass(i.sSortAsc+" "+i.sSortDesc).addClass("asc"==s[o]?i.sSortAsc:"desc"==s[o]?i.sSortDesc:r.sSortingClass))}))},jqueryui:function(t,n,r,i){e("<div/>").addClass(i.sSortJUIWrapper).append(n.contents()).append(e("<span/>").addClass(i.sSortIcon+" "+r.sSortingClassJUI)).appendTo(n),e(t.nTable).on("order.dt.DT",(function(e,o,a,s){t===o&&(o=r.idx,n.removeClass(i.sSortAsc+" "+i.sSortDesc).addClass("asc"==s[o]?i.sSortAsc:"desc"==s[o]?i.sSortDesc:r.sSortingClass),n.find("span."+i.sSortIcon).removeClass(i.sSortJUIAsc+" "+i.sSortJUIDesc+" "+i.sSortJUI+" "+i.sSortJUIAscAllowed+" "+i.sSortJUIDescAllowed).addClass("asc"==s[o]?i.sSortJUIAsc:"desc"==s[o]?i.sSortJUIDesc:r.sSortingClassJUI))}))}}});var kt=!1;function Ut(e,n,r){var i;if(t.moment){if(!(i=t.moment.utc(e,n,r,!0)).isValid())return null}else if(t.luxon){if(!(i=n&&"string"==typeof e?t.luxon.DateTime.fromFormat(e,n):t.luxon.DateTime.fromISO(e)).isValid)return null;i.setLocale(r)}else n?(kt||alert("DataTables warning: Formatted date without Moment.js or Luxon - https://datatables.net/tn/17"),kt=!0):i=new Date(e);return i}function Vt(e){return function(t,n,i,o){0===arguments.length?(i="en",t=n=null):1===arguments.length?(i="en",n=t,t=null):2===arguments.length&&(i=n,n=t,t=null);var a="datetime-"+n;return h.ext.type.order[a]||(h.ext.type.detect.unshift((function(e){return e===a&&a})),h.ext.type.order[a+"-asc"]=function(e,t){return(e=e.valueOf())===(t=t.valueOf())?0:e<t?-1:1},h.ext.type.order[a+"-desc"]=function(e,t){return(e=e.valueOf())===(t=t.valueOf())?0:t<e?-1:1}),function(s,l){var u;return null!==s&&s!==r||(s="--now"===o?(u=new Date,new Date(Date.UTC(u.getFullYear(),u.getMonth(),u.getDate(),u.getHours(),u.getMinutes(),u.getSeconds()))):""),"type"===l?a:""===s?"sort"!==l?"":Ut("0000-01-01 00:00:00",null,i):(null===n||t!==n||"sort"===l||"type"===l||s instanceof Date)&&null!==(u=Ut(s,t,i))?"sort"===l?u:(s=null===n?Ft(u,"toDate","toJSDate","")[e]():Ft(u,"format","toFormat","toISOString",n),"display"===l?Gt(s):s):s}}}var Bt=",",jt=".";if(t.Intl!==r)try{for(var qt=(new Intl.NumberFormat).formatToParts(100000.1),Ht=0;Ht<qt.length;Ht++)"group"===qt[Ht].type?Bt=qt[Ht].value:"decimal"===qt[Ht].type&&(jt=qt[Ht].value)}catch(p){}function Wt(e){return function(){var t=[at(this[h.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return h.ext.internal[e].apply(this,t)}}return h.datetime=function(e,t){var n="datetime-detect-"+e;t=t||"en",h.ext.type.order[n]||(h.ext.type.detect.unshift((function(r){var i=Ut(r,e,t);return!(""!==r&&!i)&&n})),h.ext.type.order[n+"-pre"]=function(n){return Ut(n,e,t)||0})},h.render={date:Vt("toLocaleDateString"),datetime:Vt("toLocaleString"),time:Vt("toLocaleTimeString"),number:function(e,t,n,i,o){return null!==e&&e!==r||(e=Bt),null!==t&&t!==r||(t=jt),{display:function(r){if("number"!=typeof r&&"string"!=typeof r)return r;if(""===r||null===r)return r;var a=r<0?"-":"",s=parseFloat(r);return isNaN(s)?Gt(r):(s=s.toFixed(n),r=Math.abs(s),s=parseInt(r,10),r=n?t+(r-s).toFixed(n).substring(2):"",(a=0===s&&0===parseFloat(r)?"":a)+(i||"")+s.toString().replace(/\B(?=(\d{3})+(?!\d))/g,e)+r+(o||""))}}},text:function(){return{display:Gt,filter:Gt}}},e.extend(h.ext.internal,{_fnExternApiFunc:Wt,_fnBuildAjax:fe,_fnAjaxUpdate:pe,_fnAjaxParameters:he,_fnAjaxUpdateDraw:me,_fnAjaxDataSrc:ge,_fnAddColumn:M,_fnColumnOptions:N,_fnAdjustColumnSizing:G,_fnVisibleToColumnIndex:F,_fnColumnIndexToVisible:k,_fnVisbleColumns:U,_fnGetColumns:V,_fnColumnTypes:B,_fnApplyColumnDefs:j,_fnHungarianMap:D,_fnCamelToHungarian:R,_fnLanguageCompat:C,_fnBrowserDetect:L,_fnAddData:q,_fnAddTr:H,_fnNodeToDataIndex:function(e,t){return t._DT_RowIndex!==r?t._DT_RowIndex:null},_fnNodeToColumnIndex:function(t,n,r){return e.inArray(r,t.aoData[n].anCells)},_fnGetCellData:W,_fnSetCellData:Y,_fnSplitObjNotation:$,_fnGetObjectDataFn:K,_fnSetObjectDataFn:Q,_fnGetDataMaster:Z,_fnClearTable:J,_fnDeleteIndex:ee,_fnInvalidate:te,_fnGetRowElements:ne,_fnCreateTr:re,_fnBuildHead:oe,_fnDrawHead:ae,_fnDraw:se,_fnReDraw:le,_fnAddOptionsHtml:ue,_fnDetectHeader:ce,_fnGetUniqueThs:de,_fnFeatureHtmlFilter:ve,_fnFilterComplete:Ee,_fnFilterCustom:_e,_fnFilterColumn:ye,_fnFilter:Te,_fnFilterCreateSearch:Ie,_fnEscapeRegex:be,_fnFilterData:De,_fnFeatureHtmlInfo:Ae,_fnUpdateInfo:Oe,_fnInfoMacros:xe,_fnInitialise:Le,_fnInitComplete:Pe,_fnLengthChange:Me,_fnFeatureHtmlLength:Ne,_fnFeatureHtmlPaginate:Ge,_fnPageChange:Fe,_fnFeatureHtmlProcessing:ke,_fnProcessingDisplay:Ue,_fnFeatureHtmlTable:Ve,_fnScrollDraw:Be,_fnApplyToChildren:je,_fnCalculateColumnWidths:He,_fnThrottle:We,_fnConvertToWidth:Ye,_fnGetWidestNode:ze,_fnGetMaxLenString:Xe,_fnStringToCss:$e,_fnSortFlatten:Ke,_fnSort:Qe,_fnSortAria:Ze,_fnSortListener:Je,_fnSortAttachListener:et,_fnSortingClasses:tt,_fnSortData:nt,_fnSaveState:rt,_fnLoadState:it,_fnImplementState:ot,_fnSettingsFromNode:at,_fnLog:st,_fnMap:lt,_fnBindAction:ct,_fnCallbackReg:dt,_fnCallbackFire:ft,_fnLengthOverflow:pt,_fnRenderer:ht,_fnDataSource:mt,_fnRowAttributes:ie,_fnExtend:ut,_fnCalculateEnd:function(){}}),((e.fn.dataTable=h).$=e).fn.dataTableSettings=h.settings,e.fn.dataTableExt=h.ext,e.fn.DataTable=function(t){return e(this).dataTable(t).api()},e.each(h,(function(t,n){e.fn.DataTable[t]=n})),h})),function(e){var t,n;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],(function(t){return e(t,window,document)})):"object"==typeof exports?(t=require("jquery"),n=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(r,i){return r=r||window,i=i||t(r),n(r,i),e(i,0,r.document)}:(n(window,t),module.exports=e(t,window,window.document))):e(jQuery,window,document)}((function(e,t,n,r){"use strict";var i=e.fn.dataTable;return e.extend(!0,i.defaults,{dom:"<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>><'row dt-row'<'col-sm-12'tr>><'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",renderer:"bootstrap"}),e.extend(i.ext.classes,{sWrapper:"dataTables_wrapper dt-bootstrap5",sFilterInput:"form-control form-control-sm",sLengthSelect:"form-select form-select-sm",sProcessing:"dataTables_processing card",sPageButton:"paginate_button page-item"}),i.ext.renderer.pageButton.bootstrap=function(t,o,a,s,l,u){var c,d,f,p=new i.Api(t),h=t.oClasses,m=t.oLanguage.oPaginate,g=t.oLanguage.oAria.paginate||{};o=e(o);try{f=o.find(n.activeElement).data("dt-idx")}catch(o){}var v=o.children("ul.pagination");v.length?v.empty():v=o.html("<ul/>").children("ul").addClass("pagination"),function n(r,i){for(var o,s,f=function(t){t.preventDefault(),e(t.currentTarget).hasClass("disabled")||p.page()==t.data.action||p.page(t.data.action).draw("page")},v=0,E=i.length;v<E;v++)if(o=i[v],Array.isArray(o))n(r,o);else{switch(d=c="",o){case"ellipsis":c="…",d="disabled";break;case"first":c=m.sFirst,d=o+(0<l?"":" disabled");break;case"previous":c=m.sPrevious,d=o+(0<l?"":" disabled");break;case"next":c=m.sNext,d=o+(l<u-1?"":" disabled");break;case"last":c=m.sLast,d=o+(l<u-1?"":" disabled");break;default:c=o+1,d=l===o?"active":""}c&&(s=-1!==d.indexOf("disabled"),s=e("<li>",{class:h.sPageButton+" "+d,id:0===a&&"string"==typeof o?t.sTableId+"_"+o:null}).append(e("<a>",{href:s?null:"#","aria-controls":t.sTableId,"aria-disabled":s?"true":null,"aria-label":g[o],role:"link","aria-current":"active"===d?"page":null,"data-dt-idx":o,tabindex:s?-1:t.iTabIndex,class:"page-link"}).html(c)).appendTo(r),t.oApi._fnBindAction(s,{action:o},f))}}(v,s),f!==r&&o.find("[data-dt-idx="+f+"]").trigger("focus")},i})),function(e){var t,n;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],(function(t){return e(t,window,document)})):"object"==typeof exports?(t=require("jquery"),n=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(r,i){return r=r||window,i=i||t(r),n(r,i),e(i,r,r.document)}:(n(window,t),module.exports=e(t,window,window.document))):e(jQuery,window,document)}((function(e,t,n,r){"use strict";function i(t,n){if(!o.versionCheck||!o.versionCheck("1.10.10"))throw"DataTables Responsive requires DataTables 1.10.10 or newer";this.s={childNodeStore:{},columns:[],current:[],dt:new o.Api(t)},this.s.dt.settings()[0].responsive||(n&&"string"==typeof n.details?n.details={type:n.details}:n&&!1===n.details?n.details={type:!1}:n&&!0===n.details&&(n.details={type:"inline"}),this.c=e.extend(!0,{},i.defaults,o.defaults.responsive,n),(t.responsive=this)._constructor())}var o=e.fn.dataTable,a=(e.extend(i.prototype,{_constructor:function(){var n=this,r=this.s.dt,i=r.settings()[0],a=e(t).innerWidth();!1!==(i=(r.settings()[0]._responsive=this,e(t).on("resize.dtr orientationchange.dtr",o.util.throttle((function(){var r=e(t).innerWidth();r!==a&&(n._resize(),a=r)}))),i.oApi._fnCallbackReg(i,"aoRowCreatedCallback",(function(t,i,o){-1!==e.inArray(!1,n.s.current)&&e(">td, >th",t).each((function(t){t=r.column.index("toData",t),!1===n.s.current[t]&&e(this).css("display","none")}))})),r.on("destroy.dtr",(function(){r.off(".dtr"),e(r.table().body()).off(".dtr"),e(t).off("resize.dtr orientationchange.dtr"),r.cells(".dtr-control").nodes().to$().removeClass("dtr-control"),e.each(n.s.current,(function(e,t){!1===t&&n._setColumnVis(e,!0)}))})),this.c.breakpoints.sort((function(e,t){return e.width<t.width?1:e.width>t.width?-1:0})),this._classLogic(),this._resizeAuto(),this.c.details)).type&&(n._detailsInit(),r.on("column-visibility.dtr",(function(){n._timer&&clearTimeout(n._timer),n._timer=setTimeout((function(){n._timer=null,n._classLogic(),n._resizeAuto(),n._resize(!0),n._redrawChildren()}),100)})),r.on("draw.dtr",(function(){n._redrawChildren()})),e(r.table().node()).addClass("dtr-"+i.type)),r.on("column-reorder.dtr",(function(e,t,r){n._classLogic(),n._resizeAuto(),n._resize(!0)})),r.on("column-sizing.dtr",(function(){n._resizeAuto(),n._resize()})),r.on("column-calc.dt",(function(e,t){for(var r=n.s.current,i=0;i<r.length;i++){var o=t.visible.indexOf(i);!1===r[i]&&0<=o&&t.visible.splice(o,1)}})),r.on("preXhr.dtr",(function(){var e=[];r.rows().every((function(){this.child.isShown()&&e.push(this.id(!0))})),r.one("draw.dtr",(function(){n._resizeAuto(),n._resize(),r.rows(e).every((function(){n._detailsDisplay(this,!1)}))}))})),r.on("draw.dtr",(function(){n._controlClass()})).on("init.dtr",(function(t,i,o){"dt"===t.namespace&&(n._resizeAuto(),n._resize(),e.inArray(!1,n.s.current)&&r.columns.adjust())})),this._resize()},_childNodes:function(e,t,n){var r=t+"-"+n;if(this.s.childNodeStore[r])return this.s.childNodeStore[r];for(var i=[],o=e.cell(t,n).node().childNodes,a=0,s=o.length;a<s;a++)i.push(o[a]);return this.s.childNodeStore[r]=i},_childNodesRestore:function(e,t,n){var i=t+"-"+n;if(this.s.childNodeStore[i]){for(var o=e.cell(t,n).node(),a=this.s.childNodeStore[i][0].parentNode.childNodes,s=[],l=0,u=a.length;l<u;l++)s.push(a[l]);for(var c=0,d=s.length;c<d;c++)o.appendChild(s[c]);this.s.childNodeStore[i]=r}},_columnsVisiblity:function(t){for(var n=this.s.dt,r=this.s.columns,i=r.map((function(e,t){return{columnIdx:t,priority:e.priority}})).sort((function(e,t){return e.priority!==t.priority?e.priority-t.priority:e.columnIdx-t.columnIdx})),o=e.map(r,(function(r,i){return!1===n.column(i).visible()?"not-visible":(!r.auto||null!==r.minWidth)&&(!0===r.auto?"-":-1!==e.inArray(t,r.includeIn))})),a=0,s=0,l=o.length;s<l;s++)!0===o[s]&&(a+=r[s].minWidth);var u=(u=n.settings()[0].oScroll).sY||u.sX?u.iBarWidth:0,c=n.table().container().offsetWidth-u-a;for(s=0,l=o.length;s<l;s++)r[s].control&&(c-=r[s].minWidth);var d=!1;for(s=0,l=i.length;s<l;s++){var f=i[s].columnIdx;"-"===o[f]&&!r[f].control&&r[f].minWidth&&(d||c-r[f].minWidth<0?o[f]=!(d=!0):o[f]=!0,c-=r[f].minWidth)}var p=!1;for(s=0,l=r.length;s<l;s++)if(!r[s].control&&!r[s].never&&!1===o[s]){p=!0;break}for(s=0,l=r.length;s<l;s++)r[s].control&&(o[s]=p),"not-visible"===o[s]&&(o[s]=!1);return-1===e.inArray(!0,o)&&(o[0]=!0),o},_classLogic:function(){function t(e,t,r,o){var l,u,c;if(r){if("max-"===r)for(l=n._find(t).width,u=0,c=i.length;u<c;u++)i[u].width<=l&&s(e,i[u].name);else if("min-"===r)for(l=n._find(t).width,u=0,c=i.length;u<c;u++)i[u].width>=l&&s(e,i[u].name);else if("not-"===r)for(u=0,c=i.length;u<c;u++)-1===i[u].name.indexOf(o)&&s(e,i[u].name)}else a[e].includeIn.push(t)}var n=this,i=this.c.breakpoints,o=this.s.dt,a=o.columns().eq(0).map((function(e){var t=(n=this.column(e)).header().className,n=(e=o.settings()[0].aoColumns[e].responsivePriority,n.header().getAttribute("data-priority"));return e===r&&(e=n===r||null===n?1e4:+n),{className:t,includeIn:[],auto:!1,control:!1,never:!!t.match(/\b(dtr\-)?never\b/),priority:e}})),s=function(t,n){t=a[t].includeIn,-1===e.inArray(n,t)&&t.push(n)};a.each((function(n,r){for(var o=n.className.split(" "),a=!1,s=0,l=o.length;s<l;s++){var u=o[s].trim();if("all"===u||"dtr-all"===u)return a=!0,void(n.includeIn=e.map(i,(function(e){return e.name})));if("none"===u||"dtr-none"===u||n.never)return void(a=!0);if("control"===u||"dtr-control"===u)return a=!0,void(n.control=!0);e.each(i,(function(e,n){var i=n.name.split("-"),o=new RegExp("(min\\-|max\\-|not\\-)?("+i[0]+")(\\-[_a-zA-Z0-9])?");(o=u.match(o))&&(a=!0,o[2]===i[0]&&o[3]==="-"+i[1]?t(r,n.name,o[1],o[2]+o[3]):o[2]!==i[0]||o[3]||t(r,n.name,o[1],o[2]))}))}a||(n.auto=!0)})),this.s.columns=a},_controlClass:function(){var t,n,r;"inline"===this.c.details.type&&(t=this.s.dt,n=this.s.current,r=e.inArray(!0,n),t.cells(null,(function(e){return e!==r}),{page:"current"}).nodes().to$().filter(".dtr-control").removeClass("dtr-control"),t.cells(null,r,{page:"current"}).nodes().to$().addClass("dtr-control"))},_detailsDisplay:function(t,n){function r(r){e(t.node()).toggleClass("parent",!1!==r),e(s.table().node()).triggerHandler("responsive-display.dt",[s,t,r,n])}var o,a=this,s=this.s.dt,l=this.c.details;l&&!1!==l.type&&(o="string"==typeof l.renderer?i.renderer[l.renderer]():l.renderer,"boolean"==typeof(l=l.display(t,n,(function(){return o.call(a,s,t[0],a._detailsObj(t[0]))}),(function(){r(!1)})))&&r(l))},_detailsInit:function(){var t=this,n=this.s.dt,i=("inline"===(o=this.c.details).type&&(o.target="td.dtr-control, th.dtr-control"),n.on("draw.dtr",(function(){t._tabIndexes()})),t._tabIndexes(),e(n.table().body()).on("keyup.dtr","td, th",(function(t){13===t.keyCode&&e(this).data("dtr-keyboard")&&e(this).click()})),o.target),o="string"==typeof i?i:"td, th";i===r&&null===i||e(n.table().body()).on("click.dtr mousedown.dtr mouseup.dtr",o,(function(r){if(e(n.table().node()).hasClass("collapsed")&&-1!==e.inArray(e(this).closest("tr").get(0),n.rows().nodes().toArray())){if("number"==typeof i){var o=i<0?n.columns().eq(0).length+i:i;if(n.cell(this).index().column!==o)return}o=n.row(e(this).closest("tr")),"click"===r.type?t._detailsDisplay(o,!1):"mousedown"===r.type?e(this).css("outline","none"):"mouseup"===r.type&&e(this).trigger("blur").css("outline","")}}))},_detailsObj:function(t){var n=this,r=this.s.dt;return e.map(this.s.columns,(function(i,o){if(!i.never&&!i.control)return{className:(i=r.settings()[0].aoColumns[o]).sClass,columnIndex:o,data:r.cell(t,o).render(n.c.orthogonal),hidden:r.column(o).visible()&&!n.s.current[o],rowIndex:t,title:null!==i.sTitle?i.sTitle:e(r.column(o).header()).text()}}))},_find:function(e){for(var t=this.c.breakpoints,n=0,r=t.length;n<r;n++)if(t[n].name===e)return t[n]},_redrawChildren:function(){var e=this,t=this.s.dt;t.rows({page:"current"}).iterator("row",(function(n,r){e._detailsDisplay(t.row(r),!0)}))},_resize:function(n){for(var r,i=this,o=this.s.dt,a=e(t).innerWidth(),s=this.c.breakpoints,l=s[0].name,u=this.s.columns,c=this.s.current.slice(),d=s.length-1;0<=d;d--)if(a<=s[d].width){l=s[d].name;break}var f=this._columnsVisiblity(l),p=(this.s.current=f,!1);for(d=0,r=u.length;d<r;d++)if(!1===f[d]&&!u[d].never&&!u[d].control&&0==!o.column(d).visible()){p=!0;break}e(o.table().node()).toggleClass("collapsed",p);var h=!1,m=0;o.columns().eq(0).each((function(e,t){!0===f[t]&&m++,!n&&f[t]===c[t]||(h=!0,i._setColumnVis(e,f[t]))})),this._redrawChildren(),h&&(e(o.table().node()).trigger("responsive-resize.dt",[o,this.s.current]),0===o.page.info().recordsDisplay&&e("td",o.table().body()).eq(0).attr("colspan",m)),i._controlClass()},_resizeAuto:function(){var t,n,r,i,o,a=this.s.dt,s=this.s.columns,l=this;this.c.auto&&-1!==e.inArray(!0,e.map(s,(function(e){return e.auto})))&&(e.isEmptyObject(this.s.childNodeStore)||e.each(this.s.childNodeStore,(function(e){e=e.split("-"),l._childNodesRestore(a,+e[0],+e[1])})),a.table().node().offsetWidth,a.columns,t=a.table().node().cloneNode(!1),n=e(a.table().header().cloneNode(!1)).appendTo(t),i=e(a.table().body()).clone(!1,!1).empty().appendTo(t),t.style.width="auto",r=a.columns().header().filter((function(e){return a.column(e).visible()})).to$().clone(!1).css("display","table-cell").css("width","auto").css("min-width",0),e(i).append(e(a.rows({page:"current"}).nodes()).clone(!1)).find("th, td").css("display",""),(i=a.table().footer())&&(i=e(i.cloneNode(!1)).appendTo(t),o=a.columns().footer().filter((function(e){return a.column(e).visible()})).to$().clone(!1).css("display","table-cell"),e("<tr/>").append(o).appendTo(i)),e("<tr/>").append(r).appendTo(n),"inline"===this.c.details.type&&e(t).addClass("dtr-inline collapsed"),e(t).find("[name]").removeAttr("name"),e(t).css("position","relative"),(o=e("<div/>").css({width:1,height:1,overflow:"hidden",clear:"both"}).append(t)).insertBefore(a.table().node()),r.each((function(e){e=a.column.index("fromVisible",e),s[e].minWidth=this.offsetWidth||0})),o.remove())},_responsiveOnlyHidden:function(){var t=this.s.dt;return e.map(this.s.current,(function(e,n){return!1===t.column(n).visible()||e}))},_setColumnVis:function(t,n){var r=this,i=this.s.dt,o=n?"":"none";e(i.column(t).header()).css("display",o).toggleClass("dtr-hidden",!n),e(i.column(t).footer()).css("display",o).toggleClass("dtr-hidden",!n),i.column(t).nodes().to$().css("display",o).toggleClass("dtr-hidden",!n),e.isEmptyObject(this.s.childNodeStore)||i.cells(null,t).indexes().each((function(e){r._childNodesRestore(i,e.row,e.column)}))},_tabIndexes:function(){var t=this.s.dt,n=t.cells({page:"current"}).nodes().to$(),r=t.settings()[0],i=this.c.details.target;n.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]"),("number"==typeof i?t.cells(null,i,{page:"current"}).nodes().to$():e(i="td:first-child, th:first-child"===i?">td:first-child, >th:first-child":i,t.rows({page:"current"}).nodes())).attr("tabIndex",r.iTabIndex).data("dtr-keyboard",1)}}),i.defaults={breakpoints:i.breakpoints=[{name:"desktop",width:1/0},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}],auto:!0,details:{display:(i.display={childRow:function(t,n,r){return n?e(t.node()).hasClass("parent")?(t.child(r(),"child").show(),!0):void 0:t.child.isShown()?(t.child(!1),!1):(t.child(r(),"child").show(),!0)},childRowImmediate:function(e,t,n){return!t&&e.child.isShown()||!e.responsive.hasHidden()?(e.child(!1),!1):(e.child(n(),"child").show(),!0)},modal:function(t){return function(r,i,o,a){if(i){if(!(l=e("div.dtr-modal-content")).length||r.index()!==l.data("dtr-row-idx"))return null;l.empty().append(o())}else{var s=function(){l.remove(),e(n).off("keypress.dtr"),e(r.node()).removeClass("parent"),a()},l=e('<div class="dtr-modal"/>').append(e('<div class="dtr-modal-display"/>').append(e('<div class="dtr-modal-content"/>').data("dtr-row-idx",r.index()).append(o())).append(e('<div class="dtr-modal-close">×</div>').click((function(){s()})))).append(e('<div class="dtr-modal-background"/>').click((function(){s()}))).appendTo("body");e(r.node()).addClass("parent"),e(n).on("keyup.dtr",(function(e){27===e.keyCode&&(e.stopPropagation(),s())}))}return t&&t.header&&e("div.dtr-modal-content").prepend("<h2>"+t.header(r)+"</h2>"),!0}}}).childRow,renderer:(i.renderer={listHiddenNodes:function(){return function(t,n,r){var i=this,o=e('<ul data-dtr-index="'+n+'" class="dtr-details"/>'),a=!1;return e.each(r,(function(n,r){var s;r.hidden&&(s=r.className?'class="'+r.className+'"':"",e("<li "+s+' data-dtr-index="'+r.columnIndex+'" data-dt-row="'+r.rowIndex+'" data-dt-column="'+r.columnIndex+'"><span class="dtr-title">'+r.title+"</span> </li>").append(e('<span class="dtr-data"/>').append(i._childNodes(t,r.rowIndex,r.columnIndex))).appendTo(o),a=!0)})),!!a&&o}},listHidden:function(){return function(t,n,r){return r=e.map(r,(function(e){var t=e.className?'class="'+e.className+'"':"";return e.hidden?"<li "+t+' data-dtr-index="'+e.columnIndex+'" data-dt-row="'+e.rowIndex+'" data-dt-column="'+e.columnIndex+'"><span class="dtr-title">'+e.title+'</span> <span class="dtr-data">'+e.data+"</span></li>":""})).join(""),!!r&&e('<ul data-dtr-index="'+n+'" class="dtr-details"/>').append(r)}},tableAll:function(t){return t=e.extend({tableClass:""},t),function(n,r,i){return i=e.map(i,(function(e){return"<tr "+(e.className?'class="'+e.className+'"':"")+' data-dt-row="'+e.rowIndex+'" data-dt-column="'+e.columnIndex+'"><td>'+e.title+":</td> <td>"+e.data+"</td></tr>"})).join(""),e('<table class="'+t.tableClass+' dtr-details" width="100%"/>').append(i)}}}).listHidden(),target:0,type:"inline"},orthogonal:"display"},e.fn.dataTable.Api);return a.register("responsive()",(function(){return this})),a.register("responsive.index()",(function(t){return{column:(t=e(t)).data("dtr-index"),row:t.parent().data("dtr-index")}})),a.register("responsive.rebuild()",(function(){return this.iterator("table",(function(e){e._responsive&&e._responsive._classLogic()}))})),a.register("responsive.recalc()",(function(){return this.iterator("table",(function(e){e._responsive&&(e._responsive._resizeAuto(),e._responsive._resize())}))})),a.register("responsive.hasHidden()",(function(){var t=this.context[0];return!!t._responsive&&-1!==e.inArray(!1,t._responsive._responsiveOnlyHidden())})),a.registerPlural("columns().responsiveHidden()","column().responsiveHidden()",(function(){return this.iterator("column",(function(e,t){return!!e._responsive&&e._responsive._responsiveOnlyHidden()[t]}),1)})),i.version="2.5.0",e.fn.dataTable.Responsive=i,e.fn.DataTable.Responsive=i,e(n).on("preInit.dt.dtr",(function(t,n,r){"dt"===t.namespace&&(e(n.nTable).hasClass("responsive")||e(n.nTable).hasClass("dt-responsive")||n.oInit.responsive||o.defaults.responsive)&&!1!==(t=n.oInit.responsive)&&new i(n,e.isPlainObject(t)?t:{})})),o})),function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e,t,n,r;Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return o;i++}}}),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return i;i++}return-1}}),Array.from||(Array.from=(e=Object.prototype.toString,t=function(t){return"function"==typeof t||"[object Function]"===e.call(t)},n=Math.pow(2,53)-1,r=function(e){var t=function(e){var t=Number(e);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t}(e);return Math.min(Math.max(t,0),n)},function(e){var n=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i,o=arguments.length>1?arguments[1]:void 0;if(void 0!==o){if(!t(o))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(i=arguments[2])}for(var a,s=r(n.length),l=t(this)?Object(new this(s)):new Array(s),u=0;u<s;)a=n[u],l[u]=o?void 0===i?o(a,u):o.call(i,a,u):a,u+=1;return l.length=s,l})),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return!1;for(var i,o,a=0|t,s=Math.max(a>=0?a:r-Math.abs(a),0);s<r;){if((i=n[s])===(o=e)||"number"==typeof i&&"number"==typeof o&&isNaN(i)&&isNaN(o))return!0;s++}return!1}}),Array.prototype.some||(Array.prototype.some=function(e){if(null==this)throw new TypeError("Array.prototype.some called on null or undefined");if("function"!=typeof e)throw new TypeError;for(var t=Object(this),n=t.length>>>0,r=arguments.length>=2?arguments[1]:void 0,i=0;i<n;i++)if(i in t&&e.call(r,t[i],i,t))return!0;return!1}),Array.prototype.every||(Array.prototype.every=function(e,t){var n,r;if(null==this)throw new TypeError("this is null or not defined");var i=Object(this),o=i.length>>>0;if("function"!=typeof e)throw new TypeError;for(arguments.length>1&&(n=t),r=0;r<o;){var a;if(r in i&&(a=i[r],!e.call(n,a,r,i)))return!1;r++}return!0}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},writable:!0,configurable:!0}),function(){if("undefined"==typeof window||"function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}()})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).FilePondPluginImagePreview=t()}(this,(function(){"use strict";function e(e){this.wrapped=e}function t(t){var n,r;function i(n,r){try{var a=t[n](r),s=a.value,l=s instanceof e;Promise.resolve(l?s.wrapped:s).then((function(e){l?i("next",e):o(a.done?"return":"normal",e)}),(function(e){i("throw",e)}))}catch(e){o("throw",e)}}function o(e,t){switch(e){case"return":n.resolve({value:t,done:!0});break;case"throw":n.reject(t);break;default:n.resolve({value:t,done:!1})}(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise((function(o,a){var s={key:e,arg:t,resolve:o,reject:a,next:null};r?r=r.next=s:(n=r=s,i(e,t))}))},"function"!=typeof t.return&&(this.return=void 0)}function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)};var r=function(e,t){return a(e.x*t,e.y*t)},i=function(e,t){return a(e.x+t.x,e.y+t.y)},o=function(e,t,n){var r=Math.cos(t),i=Math.sin(t),o=a(e.x-n.x,e.y-n.y);return a(n.x+r*o.x-i*o.y,n.y+i*o.x+r*o.y)},a=function(){return{x:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,y:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0}},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;return"string"==typeof e?parseFloat(e)*n:"number"==typeof e?e*(r?t[r]:Math.min(t.width,t.height)):void 0},l=function(e){return null!=e},u=function(e,t){return Object.keys(t).forEach((function(n){return e.setAttribute(n,t[n])}))},c=function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg",e);return t&&u(n,t),n},d={contain:"xMidYMid meet",cover:"xMidYMid slice"},f={left:"start",center:"middle",right:"end"},p=function(e){return function(t){return c(e,{id:t.id})}},h={image:function(e){var t=c("image",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return t.onload=function(){t.setAttribute("opacity",e.opacity||1)},t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.src),t},rect:p("rect"),ellipse:p("ellipse"),text:p("text"),path:p("path"),line:function(e){var t=c("g",{id:e.id,"stroke-linecap":"round","stroke-linejoin":"round"}),n=c("line");t.appendChild(n);var r=c("path");t.appendChild(r);var i=c("path");return t.appendChild(i),t}},m={rect:function(e){return u(e,Object.assign({},e.rect,e.styles))},ellipse:function(e){var t=e.rect.x+.5*e.rect.width,n=e.rect.y+.5*e.rect.height,r=.5*e.rect.width,i=.5*e.rect.height;return u(e,Object.assign({cx:t,cy:n,rx:r,ry:i},e.styles))},image:function(e,t){u(e,Object.assign({},e.rect,e.styles,{preserveAspectRatio:d[t.fit]||"none"}))},text:function(e,t,n,r){var i=s(t.fontSize,n,r),o=t.fontFamily||"sans-serif",a=t.fontWeight||"normal",l=f[t.textAlign]||"start";u(e,Object.assign({},e.rect,e.styles,{"stroke-width":0,"font-weight":a,"font-size":i,"font-family":o,"text-anchor":l})),e.text!==t.text&&(e.text=t.text,e.textContent=t.text.length?t.text:" ")},path:function(e,t,n,r){var i;u(e,Object.assign({},e.styles,{fill:"none",d:(i=t.points.map((function(e){return{x:s(e.x,n,r,"width"),y:s(e.y,n,r,"height")}})),i.map((function(e,t){return"".concat(0===t?"M":"L"," ").concat(e.x," ").concat(e.y)})).join(" "))}))},line:function(e,t,n,l){u(e,Object.assign({},e.rect,e.styles,{fill:"none"}));var c=e.childNodes[0],d=e.childNodes[1],f=e.childNodes[2],p=e.rect,h={x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height};if(u(c,{x1:p.x,y1:p.y,x2:h.x,y2:h.y}),t.lineDecoration){d.style.display="none",f.style.display="none";var m=function(e){var t=Math.sqrt(e.x*e.x+e.y*e.y);return 0===t?{x:0,y:0}:a(e.x/t,e.y/t)}({x:h.x-p.x,y:h.y-p.y}),g=s(.05,n,l);if(-1!==t.lineDecoration.indexOf("arrow-begin")){var v=r(m,g),E=i(p,v),_=o(p,2,E),y=o(p,-2,E);u(d,{style:"display:block;",d:"M".concat(_.x,",").concat(_.y," L").concat(p.x,",").concat(p.y," L").concat(y.x,",").concat(y.y)})}if(-1!==t.lineDecoration.indexOf("arrow-end")){var T=r(m,-g),I=i(h,T),b=o(h,2,I),w=o(h,-2,I);u(f,{style:"display:block;",d:"M".concat(b.x,",").concat(b.y," L").concat(h.x,",").concat(h.y," L").concat(w.x,",").concat(w.y)})}}}},g=function(e,t,n,r,i){"path"!==t&&(e.rect=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=s(e.x,t,n,"width")||s(e.left,t,n,"width"),i=s(e.y,t,n,"height")||s(e.top,t,n,"height"),o=s(e.width,t,n,"width"),a=s(e.height,t,n,"height"),u=s(e.right,t,n,"width"),c=s(e.bottom,t,n,"height");return l(i)||(i=l(a)&&l(c)?t.height-a-c:c),l(r)||(r=l(o)&&l(u)?t.width-o-u:u),l(o)||(o=l(r)&&l(u)?t.width-r-u:0),l(a)||(a=l(i)&&l(c)?t.height-i-c:0),{x:r||0,y:i||0,width:o||0,height:a||0}}(n,r,i)),e.styles=function(e,t,n){var r=e.borderStyle||e.lineStyle||"solid",i=e.backgroundColor||e.fontColor||"transparent",o=e.borderColor||e.lineColor||"transparent",a=s(e.borderWidth||e.lineWidth,t,n);return{"stroke-linecap":e.lineCap||"round","stroke-linejoin":e.lineJoin||"round","stroke-width":a||0,"stroke-dasharray":"string"==typeof r?"":r.map((function(e){return s(e,t,n)})).join(","),stroke:o,fill:i,opacity:e.opacity||1}}(n,r,i),m[t](e,n,r,i)},v=["x","y","left","top","right","bottom","width","height"],E=function(e){var t=n(e,2),r=t[0],i=t[1],o=i.points?{}:v.reduce((function(e,t){var n;return e[t]="string"==typeof(n=i[t])&&/%/.test(n)?parseFloat(n)/100:n,e}),{});return[r,Object.assign({zIndex:0},i,o)]},_=function(e,t){return e[1].zIndex>t[1].zIndex?1:e[1].zIndex<t[1].zIndex?-1:0},y=function(e){return e.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function(e){var t=e.root,r=e.props;if(r.dirty){var i=r.crop,o=r.resize,a=r.markup,s=r.width,l=r.height,u=i.width,c=i.height;if(o){var d=o.size,f=d&&d.width,p=d&&d.height,m=o.mode,v=o.upscale;f&&!p&&(p=f),p&&!f&&(f=p);var y=u<f&&c<p;if(!y||y&&v){var T,I=f/u,b=p/c;"force"===m?(u=f,c=p):("cover"===m?T=Math.max(I,b):"contain"===m&&(T=Math.min(I,b)),u*=T,c*=T)}}var w={width:s,height:l};t.element.setAttribute("width",w.width),t.element.setAttribute("height",w.height);var S=Math.min(s/u,l/c);t.element.innerHTML="";var D=t.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");a.filter(D).map(E).sort(_).forEach((function(e){var r=n(e,2),i=r[0],o=r[1],a=function(e,t){return h[e](t)}(i,o);g(a,i,o,w,S),t.element.appendChild(a)}))}}})},T=function(e,t){return{x:e,y:t}},I=function(e,t){return T(e.x-t.x,e.y-t.y)},b=function(e,t){return Math.sqrt(function(e,t){return function(e,t){return e.x*t.x+e.y*t.y}(I(e,t),I(e,t))}(e,t))},w=function(e,t){var n=e,r=t,i=1.5707963267948966-t,o=Math.sin(1.5707963267948966),a=Math.sin(r),s=Math.sin(i),l=Math.cos(i),u=n/o;return T(l*(u*a),l*(u*s))},S=function(e,t,n,r){var i=r.x>.5?1-r.x:r.x,o=r.y>.5?1-r.y:r.y,a=2*i*e.width,s=2*o*e.height,l=function(e,t){var n=e.width,r=e.height,i=w(n,t),o=w(r,t),a=T(e.x+Math.abs(i.x),e.y-Math.abs(i.y)),s=T(e.x+e.width+Math.abs(o.y),e.y+Math.abs(o.x)),l=T(e.x-Math.abs(o.y),e.y+e.height-Math.abs(o.x));return{width:b(a,s),height:b(a,l)}}(t,n);return Math.max(l.width/a,l.height/s)},D=function(e,t){var n=e.width,r=n*t;return r>e.height&&(n=(r=e.height)/t),{x:.5*(e.width-n),y:.5*(e.height-r),width:n,height:r}},R={type:"spring",stiffness:.5,damping:.45,mass:10},C=function(e){return e.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function(e){var t=e.root,n=e.props;n.background&&(t.element.style.backgroundColor=n.background)},create:function(t){var n=t.root,r=t.props;n.ref.image=n.appendChildView(n.createChildView(function(e){return e.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:R,originY:R,scaleX:R,scaleY:R,translateX:R,translateY:R,rotateZ:R}},create:function(t){var n=t.root,r=t.props;r.width=r.image.width,r.height=r.image.height,n.ref.bitmap=n.appendChildView(n.createChildView(function(e){return e.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:function(e){var t=e.root,n=e.props;t.appendChild(n.image)}})}(e),{image:r.image}))},write:function(e){var t=e.root,n=e.props.crop.flip,r=t.ref.bitmap;r.scaleX=n.horizontal?-1:1,r.scaleY=n.vertical?-1:1}})}(e),Object.assign({},r))),n.ref.createMarkup=function(){n.ref.markup||(n.ref.markup=n.appendChildView(n.createChildView(y(e),Object.assign({},r))))},n.ref.destroyMarkup=function(){n.ref.markup&&(n.removeChildView(n.ref.markup),n.ref.markup=null)};var i=n.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");null!==i&&(n.element.dataset.transparencyIndicator="grid"===i?i:"color")},write:function(e){var t=e.root,n=e.props,r=e.shouldOptimize,i=n.crop,o=n.markup,a=n.resize,s=n.dirty,l=n.width,u=n.height;t.ref.image.crop=i;var c={x:0,y:0,width:l,height:u,center:{x:.5*l,y:.5*u}},d={width:t.ref.image.width,height:t.ref.image.height},f={x:i.center.x*d.width,y:i.center.y*d.height},p={x:c.center.x-d.width*i.center.x,y:c.center.y-d.height*i.center.y},h=2*Math.PI+i.rotation%(2*Math.PI),m=i.aspectRatio||d.height/d.width,g=void 0===i.scaleToFit||i.scaleToFit,v=S(d,D(c,m),h,g?i.center:{x:.5,y:.5}),E=i.zoom*v;o&&o.length?(t.ref.createMarkup(),t.ref.markup.width=l,t.ref.markup.height=u,t.ref.markup.resize=a,t.ref.markup.dirty=s,t.ref.markup.markup=o,t.ref.markup.crop=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.zoom,r=t.rotation,i=t.center,o=t.aspectRatio;o||(o=e.height/e.width);var a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.height/e.width,i=t,o=1,a=r;a>i&&(o=(a=i)/r);var s=Math.max(1/o,i/a),l=e.width/(n*s*o);return{width:l,height:l*t}}(e,o,n),s={x:.5*a.width,y:.5*a.height},l={x:0,y:0,width:a.width,height:a.height,center:s},u=void 0===t.scaleToFit||t.scaleToFit,c=n*S(e,D(l,o),r,u?i:{x:.5,y:.5});return{widthFloat:a.width/c,heightFloat:a.height/c,width:Math.round(a.width/c),height:Math.round(a.height/c)}}(d,i)):t.ref.markup&&t.ref.destroyMarkup();var _=t.ref.image;if(r)return _.originX=null,_.originY=null,_.translateX=null,_.translateY=null,_.rotateZ=null,_.scaleX=null,void(_.scaleY=null);_.originX=f.x,_.originY=f.y,_.translateX=p.x,_.translateY=p.y,_.rotateZ=h,_.scaleX=E,_.scaleY=E}})},A=0,O=function(){self.onmessage=function(e){createImageBitmap(e.data.message.file).then((function(t){self.postMessage({id:e.data.id,message:t},[t])}))}},x=function(){self.onmessage=function(e){for(var t=e.data.message.imageData,n=e.data.message.colorMatrix,r=t.data,i=r.length,o=n[0],a=n[1],s=n[2],l=n[3],u=n[4],c=n[5],d=n[6],f=n[7],p=n[8],h=n[9],m=n[10],g=n[11],v=n[12],E=n[13],_=n[14],y=n[15],T=n[16],I=n[17],b=n[18],w=n[19],S=0,D=0,R=0,C=0,A=0;S<i;S+=4)D=r[S]/255,R=r[S+1]/255,C=r[S+2]/255,A=r[S+3]/255,r[S]=Math.max(0,Math.min(255*(D*o+R*a+C*s+A*l+u),255)),r[S+1]=Math.max(0,Math.min(255*(D*c+R*d+C*f+A*p+h),255)),r[S+2]=Math.max(0,Math.min(255*(D*m+R*g+C*v+A*E+_),255)),r[S+3]=Math.max(0,Math.min(255*(D*y+R*T+C*I+A*b+w),255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},L={1:function(){return[1,0,0,1,0,0]},2:function(e){return[-1,0,0,1,e,0]},3:function(e,t){return[-1,0,0,-1,e,t]},4:function(e,t){return[1,0,0,-1,0,t]},5:function(){return[0,1,1,0,0,0]},6:function(e,t){return[0,1,-1,0,t,0]},7:function(e,t){return[0,-1,-1,0,t,e]},8:function(e){return[0,-1,1,0,0,e]}},P=function(e){return/^image/.test(e.type)&&!/svg/.test(e.type)},M=function(e,t){return Math.floor(Math.sqrt(e/(t/4)))},N=function(e){var t=e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:function(e){var t=e.root,n=e.props,r='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n <defs>\n <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n <stop offset=\'50%\' stop-color=\'#000000\'/>\n <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n <stop offset=\'63%\' stop-color=\'#262626\'/>\n <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n <stop offset=\'75%\' stop-color=\'#808080\'/>\n <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n <stop offset=\'88%\' stop-color=\'#dadada\'/>\n <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n </radialGradient>\n <mask id="mask-__UID__">\n <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n </mask>\n </defs>\n <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';if(document.querySelector("base")){var i=new URL(window.location.href.replace(window.location.hash,"")).href;r=r.replace(/url\(\#/g,"url("+i+"#")}A++,t.element.classList.add("filepond--image-preview-overlay-".concat(n.status)),t.element.innerHTML=r.replace(/__UID__/g,A)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),n=function(e){return e.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:R,scaleY:R,translateY:R,opacity:{type:"tween",duration:400}}},create:function(t){var n=t.root,r=t.props;n.ref.clip=n.appendChildView(n.createChildView(C(e),{id:r.id,image:r.image,crop:r.crop,markup:r.markup,resize:r.resize,dirty:r.dirty,background:r.background}))},write:function(e){var t=e.root,n=e.props,r=e.shouldOptimize,i=t.ref.clip,o=n.image,a=n.crop,s=n.markup,l=n.resize,u=n.dirty;if(i.crop=a,i.markup=s,i.resize=l,i.dirty=u,i.opacity=r?0:1,!r&&!t.rect.element.hidden){var c=o.height/o.width,d=a.aspectRatio||c,f=t.rect.inner.width,p=t.rect.inner.height,h=t.query("GET_IMAGE_PREVIEW_HEIGHT"),m=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),g=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),v=t.query("GET_PANEL_ASPECT_RATIO"),E=t.query("GET_ALLOW_MULTIPLE");v&&!E&&(h=f*v,d=v);var _=null!==h?h:Math.max(m,Math.min(f*d,g)),y=_/d;y>f&&(_=(y=f)*d),_>p&&(_=p,y=p/d),i.width=y,i.height=_}}})}(e),r=e.utils.createWorker,i=function(e,t,n){return new Promise((function(i){e.ref.imageData||(e.ref.imageData=n.getContext("2d").getImageData(0,0,n.width,n.height));var o=function(e){var t;try{t=new ImageData(e.width,e.height)}catch(n){t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t}(e.ref.imageData);if(!t||20!==t.length)return n.getContext("2d").putImageData(o,0,0),i();var a=r(x);a.post({imageData:o,colorMatrix:t},(function(e){n.getContext("2d").putImageData(e,0,0),a.terminate(),i()}),[o.data.buffer])}))},o=function(e){var t=e.root,r=e.props,i=e.image,o=r.id,a=t.query("GET_ITEM",{id:o});if(a){var s,l,u=a.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},c=t.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),d=!1;t.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(s=a.getMetadata("markup")||[],l=a.getMetadata("resize"),d=!0);var f=t.appendChildView(t.createChildView(n,{id:o,image:i,crop:u,resize:l,markup:s,dirty:d,background:c,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),t.childViews.length);t.ref.images.push(f),f.opacity=1,f.scaleX=1,f.scaleY=1,f.translateY=0,setTimeout((function(){t.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:o})}),250)}},a=function(e){var t=e.root;t.ref.overlayShadow.opacity=1,t.ref.overlayError.opacity=0,t.ref.overlaySuccess.opacity=0},s=function(e){var t=e.root;t.ref.overlayShadow.opacity=.25,t.ref.overlayError.opacity=1};return e.utils.createView({name:"image-preview-wrapper",create:function(e){var n=e.root;n.ref.images=[],n.ref.imageData=null,n.ref.imageViewBin=[],n.ref.overlayShadow=n.appendChildView(n.createChildView(t,{opacity:0,status:"idle"})),n.ref.overlaySuccess=n.appendChildView(n.createChildView(t,{opacity:0,status:"success"})),n.ref.overlayError=n.appendChildView(n.createChildView(t,{opacity:0,status:"failure"}))},styles:["height"],apis:["height"],destroy:function(e){e.root.ref.images.forEach((function(e){e.image.width=1,e.image.height=1}))},didWriteView:function(e){e.root.ref.images.forEach((function(e){e.dirty=!1}))},write:e.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:function(e){var t=e.root,n=t.ref.images[t.ref.images.length-1];n.translateY=0,n.scaleX=1,n.scaleY=1,n.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function(e){var t,n,r,i=e.root,o=e.props.id,a=i.query("GET_ITEM",o);a&&(t=URL.createObjectURL(a.file),n=function(e,t){i.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:o,width:e,height:t})},(r=new Image).onload=function(){var e=r.naturalWidth,t=r.naturalHeight;r=null,n(e,t)},r.src=t)},DID_FINISH_CALCULATE_PREVIEWSIZE:function(e){var t=e.root,n=e.props,a=n.id,s=t.query("GET_ITEM",a);if(s){var l,u,c,d=URL.createObjectURL(s.file),f=function(){var e;(e=d,new Promise((function(t,n){var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))).then(p)},p=function(e){URL.revokeObjectURL(d);var r=(s.getMetadata("exif")||{}).orientation||-1,a=e.width,l=e.height;if(a&&l){if(r>=5&&r<=8){var u=[l,a];a=u[0],l=u[1]}var c=Math.max(1,.75*window.devicePixelRatio),f=t.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*c,p=l/a,h=t.rect.element.width,m=t.rect.element.height,g=h,v=g*p;p>1?v=(g=Math.min(a,h*f))*p:g=(v=Math.min(l,m*f))/p;var E=function(e,t,n,r){t=Math.round(t),n=Math.round(n);var i=document.createElement("canvas");i.width=t,i.height=n;var o=i.getContext("2d");if(r>=5&&r<=8){var a=[n,t];t=a[0],n=a[1]}return function(e,t,n,r){-1!==r&&e.transform.apply(e,L[r](t,n))}(o,t,n,r),o.drawImage(e,0,0,t,n),i}(e,g,v,r),_=function(){var r=t.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?function(e){var t=Math.min(10/e.width,10/e.height),n=document.createElement("canvas"),r=n.getContext("2d"),i=n.width=Math.ceil(e.width*t),o=n.height=Math.ceil(e.height*t);r.drawImage(e,0,0,i,o);var a=null;try{a=r.getImageData(0,0,i,o).data}catch(e){return null}for(var s=a.length,l=0,u=0,c=0,d=0;d<s;d+=4)l+=a[d]*a[d],u+=a[d+1]*a[d+1],c+=a[d+2]*a[d+2];return{r:l=M(l,s),g:u=M(u,s),b:c=M(c,s)}}(data):null;s.setMetadata("color",r,!0),"close"in e&&e.close(),t.ref.overlayShadow.opacity=1,o({root:t,props:n,image:E})},y=s.getMetadata("filter");y?i(t,y,E).then(_):_()}};if(l=s.file,null!==(c=(u=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./))?parseInt(u[1]):null)&&c<=58||!("createImageBitmap"in window)||!P(l))f();else{var h=r(O);h.post({file:s.file},(function(e){h.terminate(),e?p(e):f()}))}}},DID_UPDATE_ITEM_METADATA:function(e){var t=e.root,n=e.props,r=e.action;if(/crop|filter|markup|resize/.test(r.change.key)&&t.ref.images.length){var a=t.query("GET_ITEM",{id:n.id});if(a)if(/filter/.test(r.change.key)){var s=t.ref.images[t.ref.images.length-1];i(t,r.change.value,s.image)}else{if(/crop|markup|resize/.test(r.change.key)){var l=a.getMetadata("crop"),u=t.ref.images[t.ref.images.length-1];if(l&&l.aspectRatio&&u.crop&&u.crop.aspectRatio&&Math.abs(l.aspectRatio-u.crop.aspectRatio)>1e-5){var c=function(e){var t=e.root,n=t.ref.images.shift();return n.opacity=0,n.translateY=-15,t.ref.imageViewBin.push(n),n}({root:t});o({root:t,props:n,image:(d=c.image,(f=f||document.createElement("canvas")).width=d.width,f.height=d.height,f.getContext("2d").drawImage(d,0,0),f)})}else!function(e){var t=e.root,n=e.props,r=t.query("GET_ITEM",{id:n.id});if(r){var i=t.ref.images[t.ref.images.length-1];i.crop=r.getMetadata("crop"),i.background=t.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),t.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(i.dirty=!0,i.resize=r.getMetadata("resize"),i.markup=r.getMetadata("markup"))}}({root:t,props:n})}var d,f}}},DID_THROW_ITEM_LOAD_ERROR:s,DID_THROW_ITEM_PROCESSING_ERROR:s,DID_THROW_ITEM_INVALID:s,DID_COMPLETE_ITEM_PROCESSING:function(e){var t=e.root;t.ref.overlayShadow.opacity=.25,t.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:a,DID_REVERT_ITEM_PROCESSING:a},(function(e){var t=e.root,n=t.ref.imageViewBin.filter((function(e){return 0===e.opacity}));t.ref.imageViewBin=t.ref.imageViewBin.filter((function(e){return e.opacity>0})),n.forEach((function(e){return function(e,t){e.removeChildView(t),t.image.width=1,t.image.height=1,t._destroy()}(t,e)})),n.length=0}))})},G=function(e){var t=e.addFilter,n=e.utils,r=n.Type,i=n.createRoute,o=n.isFile,a=N(e);return t("CREATE_VIEW",(function(e){var t=e.is,n=e.view,r=e.query;if(t("file")&&r("GET_ALLOW_IMAGE_PREVIEW")){var s=function(e){e.root.ref.shouldRescale=!0};n.registerWriter(i({DID_RESIZE_ROOT:s,DID_STOP_RESIZE:s,DID_LOAD_ITEM:function(e){var t=e.root,i=e.props.id,s=r("GET_ITEM",i);if(s&&o(s.file)&&!s.archived){var l=s.file;if(function(e){return/^image/.test(e.type)}(l)&&r("GET_IMAGE_PREVIEW_FILTER_ITEM")(s)){var u="createImageBitmap"in(window||{}),c=r("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!(!u&&c&&l.size>c)){t.ref.imagePreview=n.appendChildView(n.createChildView(a,{id:i}));var d=t.query("GET_IMAGE_PREVIEW_HEIGHT");d&&t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:s.id,height:d});var f=!u&&l.size>r("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");t.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:i},f)}}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function(e){var t=e.root,n=e.action;t.ref.imageWidth=n.width,t.ref.imageHeight=n.height,t.ref.shouldRescale=!0,t.ref.shouldDrawPreview=!0,t.dispatch("KICK")},DID_UPDATE_ITEM_METADATA:function(e){var t=e.root;"crop"===e.action.change.key&&(t.ref.shouldRescale=!0)}},(function(e){var t=e.root,n=e.props;t.ref.imagePreview&&(t.rect.element.hidden||(t.ref.shouldRescale&&(function(e,t){if(e.ref.imagePreview){var n=t.id,r=e.query("GET_ITEM",{id:n});if(r){var i=e.query("GET_PANEL_ASPECT_RATIO"),o=e.query("GET_ITEM_PANEL_ASPECT_RATIO"),a=e.query("GET_IMAGE_PREVIEW_HEIGHT");if(!(i||o||a)){var s=e.ref,l=s.imageWidth,u=s.imageHeight;if(l&&u){var c=e.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),d=e.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),f=(r.getMetadata("exif")||{}).orientation||-1;if(f>=5&&f<=8){var p=[u,l];l=p[0],u=p[1]}if(!P(r.file)||e.query("GET_IMAGE_PREVIEW_UPSCALE")){var h=2048/l;l*=h,u*=h}var m=u/l,g=(r.getMetadata("crop")||{}).aspectRatio||m,v=Math.max(c,Math.min(u,d)),E=e.rect.element.width,_=Math.min(E*g,v);e.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:r.id,height:_})}}}}}(t,n),t.ref.shouldRescale=!1),t.ref.shouldDrawPreview&&(requestAnimationFrame((function(){requestAnimationFrame((function(){t.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:n.id})}))})),t.ref.shouldDrawPreview=!1)))})))}})),{options:{allowImagePreview:[!0,r.BOOLEAN],imagePreviewFilterItem:[function(){return!0},r.FUNCTION],imagePreviewHeight:[null,r.INT],imagePreviewMinHeight:[44,r.INT],imagePreviewMaxHeight:[256,r.INT],imagePreviewMaxFileSize:[null,r.INT],imagePreviewZoomFactor:[2,r.INT],imagePreviewUpscale:[!1,r.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,r.INT],imagePreviewTransparencyIndicator:[null,r.STRING],imagePreviewCalculateAverageImageColor:[!1,r.BOOLEAN],imagePreviewMarkupShow:[!0,r.BOOLEAN],imagePreviewMarkupFilter:[function(){return!0},r.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:G})),G})),function(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).FilePondPluginMediaPreview=t()}(this,(function(){"use strict";const e=e=>/^video/.test(e.type),t=e=>/^audio/.test(e.type);class n{constructor(e,t){this.mediaEl=e,this.audioElems=t,this.onplayhead=!1,this.duration=0,this.timelineWidth=this.audioElems.timeline.offsetWidth-this.audioElems.playhead.offsetWidth,this.moveplayheadFn=this.moveplayhead.bind(this),this.registerListeners()}registerListeners(){this.mediaEl.addEventListener("timeupdate",this.timeUpdate.bind(this),!1),this.mediaEl.addEventListener("canplaythrough",(()=>this.duration=this.mediaEl.duration),!1),this.audioElems.timeline.addEventListener("click",this.timelineClicked.bind(this),!1),this.audioElems.button.addEventListener("click",this.play.bind(this)),this.audioElems.playhead.addEventListener("mousedown",this.mouseDown.bind(this),!1),window.addEventListener("mouseup",this.mouseUp.bind(this),!1)}play(){this.mediaEl.paused?this.mediaEl.play():this.mediaEl.pause(),this.audioElems.button.classList.toggle("play"),this.audioElems.button.classList.toggle("pause")}timeUpdate(){let e=this.mediaEl.currentTime/this.duration*100;this.audioElems.playhead.style.marginLeft=e+"%",this.mediaEl.currentTime===this.duration&&(this.audioElems.button.classList.toggle("play"),this.audioElems.button.classList.toggle("pause"))}moveplayhead(e){let t=e.clientX-this.getPosition(this.audioElems.timeline);t>=0&&t<=this.timelineWidth&&(this.audioElems.playhead.style.marginLeft=t+"px"),t<0&&(this.audioElems.playhead.style.marginLeft="0px"),t>this.timelineWidth&&(this.audioElems.playhead.style.marginLeft=this.timelineWidth-4+"px")}timelineClicked(e){this.moveplayhead(e),this.mediaEl.currentTime=this.duration*this.clickPercent(e)}mouseDown(){this.onplayhead=!0,window.addEventListener("mousemove",this.moveplayheadFn,!0),this.mediaEl.removeEventListener("timeupdate",this.timeUpdate.bind(this),!1)}mouseUp(e){window.removeEventListener("mousemove",this.moveplayheadFn,!0),1==this.onplayhead&&(this.moveplayhead(e),this.mediaEl.currentTime=this.duration*this.clickPercent(e),this.mediaEl.addEventListener("timeupdate",this.timeUpdate.bind(this),!1)),this.onplayhead=!1}clickPercent(e){return(e.clientX-this.getPosition(this.audioElems.timeline))/this.timelineWidth}getPosition(e){return e.getBoundingClientRect().left}}const r=r=>r.utils.createView({name:"media-preview-wrapper",create:({root:i,props:o})=>{const a=(r=>r.utils.createView({name:"media-preview",tag:"div",ignoreRect:!0,create:({root:e,props:n})=>{const{id:r}=n,i=e.query("GET_ITEM",{id:n.id});let o=t(i.file)?"audio":"video";if(e.ref.media=document.createElement(o),e.ref.media.setAttribute("controls",!0),e.element.appendChild(e.ref.media),t(i.file)){let t=document.createDocumentFragment();e.ref.audio=[],e.ref.audio.container=document.createElement("div"),e.ref.audio.button=document.createElement("span"),e.ref.audio.timeline=document.createElement("div"),e.ref.audio.playhead=document.createElement("div"),e.ref.audio.container.className="audioplayer",e.ref.audio.button.className="playpausebtn play",e.ref.audio.timeline.className="timeline",e.ref.audio.playhead.className="playhead",e.ref.audio.timeline.appendChild(e.ref.audio.playhead),e.ref.audio.container.appendChild(e.ref.audio.button),e.ref.audio.container.appendChild(e.ref.audio.timeline),t.appendChild(e.ref.audio.container),e.element.appendChild(t)}},write:r.utils.createRoute({DID_MEDIA_PREVIEW_LOAD:({root:r,props:i})=>{const{id:o}=i,a=r.query("GET_ITEM",{id:i.id});if(!a)return;let s=window.URL||window.webkitURL,l=new Blob([a.file],{type:a.file.type});r.ref.media.type=a.file.type,r.ref.media.src=a.file.mock&&a.file.url||s.createObjectURL(l),t(a.file)&&new n(r.ref.media,r.ref.audio),r.ref.media.addEventListener("loadeddata",(()=>{let t=75;if(e(a.file)){let e=r.ref.media.offsetWidth,n=r.ref.media.videoWidth/e;t=r.ref.media.videoHeight/n}r.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:t})}),!1)}})}))(r);i.ref.media=i.appendChildView(i.createChildView(a,{id:o.id}))},write:r.utils.createRoute({DID_MEDIA_PREVIEW_CONTAINER_CREATE:({root:e,props:t})=>{const{id:n}=t;e.query("GET_ITEM",n)&&e.dispatch("DID_MEDIA_PREVIEW_LOAD",{id:n})}})}),i=n=>{const{addFilter:i,utils:o}=n,{Type:a,createRoute:s}=o,l=r(n);return i("CREATE_VIEW",(n=>{const{is:r,view:i,query:o}=n;r("file")&&i.registerWriter(s({DID_LOAD_ITEM:({root:n,props:r})=>{const{id:a}=r,s=o("GET_ITEM",a),u=o("GET_ALLOW_VIDEO_PREVIEW"),c=o("GET_ALLOW_AUDIO_PREVIEW");s&&!s.archived&&(e(s.file)&&u||t(s.file)&&c)&&(n.ref.mediaPreview=i.appendChildView(i.createChildView(l,{id:a})),n.dispatch("DID_MEDIA_PREVIEW_CONTAINER_CREATE",{id:a}))}},(({root:n,props:r})=>{const{id:i}=r,a=o("GET_ITEM",i),s=n.query("GET_ALLOW_VIDEO_PREVIEW"),l=n.query("GET_ALLOW_AUDIO_PREVIEW");a&&(e(a.file)&&s||t(a.file)&&l)&&n.rect.element.hidden})))})),{options:{allowVideoPreview:[!0,a.BOOLEAN],allowAudioPreview:[!0,a.BOOLEAN]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:i})),i})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).FilePondPluginFilePoster=t()}(this,(function(){"use strict";var e={type:"spring",stiffness:.5,damping:.45,mass:10},t=function(e){return-.5*(Math.cos(Math.PI*e)-1)},n=function(e){var t=Math.min(10/e.width,10/e.height),n=document.createElement("canvas"),i=n.getContext("2d"),o=n.width=Math.ceil(e.width*t),a=n.height=Math.ceil(e.height*t);i.drawImage(e,0,0,o,a);var s=null;try{s=i.getImageData(0,0,o,a).data}catch(e){return null}for(var l=s.length,u=0,c=0,d=0,f=0;f<l;f+=4)u+=s[f]*s[f],c+=s[f+1]*s[f+1],d+=s[f+2]*s[f+2];return{r:u=r(u,l),g:c=r(c,l),b:d=r(d,l)}},r=function(e,t){return Math.floor(Math.sqrt(e/(t/4)))},i=function(e,n,r,i,o){e.width=n,e.height=r;var a=e.getContext("2d"),s=.5*n,l=a.createRadialGradient(s,r+110,r-100,s,r+110,r+100);!function(e,n){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:10,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=1-a,l=n.join(","),u=0;u<=o;u++){var c=u/o,d=a+s*c;e.addColorStop(d,"rgba(".concat(l,", ").concat(i(c)*r,")"))}}(l,i,o,void 0,8,.4),a.save(),a.translate(.5*-n,0),a.scale(2,1),a.fillStyle=l,a.fillRect(0,0,n,r),a.restore()},o="undefined"!=typeof navigator,a=o&&document.createElement("canvas"),s=o&&document.createElement("canvas"),l=o&&document.createElement("canvas"),u=[40,40,40],c=[196,78,71],d=[54,151,99];o&&(i(a,500,200,u,.85),i(s,500,200,c,1),i(l,500,200,d,1));var f=function(t){var r=t.utils.createView({name:"file-poster-overlay",tag:"canvas",ignoreRect:!0,create:function(e){var t,n,r=e.root;t=e.props.template,(n=r.element).width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),o=function(e){var t=e.root;t.ref.overlayShadow.opacity=1,t.ref.overlayError.opacity=0,t.ref.overlaySuccess.opacity=0},f=function(e){var t=e.root;t.ref.overlayShadow.opacity=.25,t.ref.overlayError.opacity=1};return t.utils.createView({name:"file-poster-wrapper",create:function(n){var o=n.root,f=n.props,p=o.query("GET_FILE_POSTER_ITEM_OVERLAY_SHADOW_COLOR"),h=o.query("GET_FILE_POSTER_ITEM_OVERLAY_ERROR_COLOR"),m=o.query("GET_FILE_POSTER_ITEM_OVERLAY_SUCCESS_COLOR");p&&p!==u&&i(a,500,200,u=p,.85),h&&h!==c&&i(s,500,200,c=h,1),m&&m!==d&&i(l,500,200,d=m,1);var g=function(t){return t.utils.createView({name:"file-poster",tag:"div",ignoreRect:!0,create:function(e){var t=e.root;t.ref.image=document.createElement("img"),t.element.appendChild(t.ref.image)},write:t.utils.createRoute({DID_FILE_POSTER_LOAD:function(e){var t=e.root,n=e.props,r=n.id,i=t.query("GET_ITEM",{id:n.id});if(i){var o=i.getMetadata("poster");t.ref.image.src=o,t.dispatch("DID_FILE_POSTER_DRAW",{id:r})}}}),mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:e,scaleY:e,opacity:{type:"tween",duration:750}}}})}(t);o.ref.image=o.appendChildView(o.createChildView(g,{id:f.id,scaleX:1.25,scaleY:1.25,opacity:0})),o.ref.overlayShadow=o.appendChildView(o.createChildView(r,{template:a,opacity:0})),o.ref.overlaySuccess=o.appendChildView(o.createChildView(r,{template:l,opacity:0})),o.ref.overlayError=o.appendChildView(o.createChildView(r,{template:s,opacity:0}))},write:t.utils.createRoute({DID_FILE_POSTER_LOAD:function(e){e.root.ref.overlayShadow.opacity=1},DID_FILE_POSTER_DRAW:function(e){var t=e.root.ref.image;t.scaleX=1,t.scaleY=1,t.opacity=1},DID_FILE_POSTER_CONTAINER_CREATE:function(e){var t=e.root,r=e.props.id,i=t.query("GET_ITEM",r);if(i){var o,a,s,l=i.getMetadata("poster"),u=function(e){var o=t.query("GET_FILE_POSTER_CALCULATE_AVERAGE_IMAGE_COLOR")?n(e):null;i.setMetadata("color",o,!0),t.dispatch("DID_FILE_POSTER_LOAD",{id:r,data:e})};o=l,a=function(e,n){var i,o;t.dispatch("DID_FILE_POSTER_CALCULATE_SIZE",{id:r,width:e,height:n}),(i=l,o=t.query("GET_FILE_POSTER_CROSS_ORIGIN_ATTRIBUTE_VALUE"),new Promise((function(e,t){var n=new Image;"string"==typeof crossOrigin&&(n.crossOrigin=o),n.onload=function(){e(n)},n.onerror=function(e){t(e)},n.src=i}))).then(u)},(s=new Image).onload=function(){var e=s.naturalWidth,t=s.naturalHeight;s=null,a(e,t)},s.src=o}},DID_THROW_ITEM_LOAD_ERROR:f,DID_THROW_ITEM_PROCESSING_ERROR:f,DID_THROW_ITEM_INVALID:f,DID_COMPLETE_ITEM_PROCESSING:function(e){var t=e.root;t.ref.overlayShadow.opacity=.25,t.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:o,DID_REVERT_ITEM_PROCESSING:o})})},p=function(e){var t=e.addFilter,n=e.utils,r=n.Type,i=n.createRoute,o=f(e);return t("CREATE_VIEW",(function(e){var t=e.is,n=e.view,r=e.query;if(t("file")&&r("GET_ALLOW_FILE_POSTER")){var a=function(e,t){var i=t.id,a=r("GET_ITEM",i);a&&a.getMetadata("poster")&&!a.archived&&e.ref.previousPoster!==a.getMetadata("poster")&&(e.ref.previousPoster=a.getMetadata("poster"),r("GET_FILE_POSTER_FILTER_ITEM")(a)&&(e.ref.filePoster&&n.removeChildView(e.ref.filePoster),e.ref.filePoster=n.appendChildView(n.createChildView(o,{id:i})),e.dispatch("DID_FILE_POSTER_CONTAINER_CREATE",{id:i})))},s=function(e){var t=e.root,n=t.query("GET_FILE_POSTER_HEIGHT");if(n)return n;var r=t.query("GET_FILE_POSTER_MIN_HEIGHT"),i=t.query("GET_FILE_POSTER_MAX_HEIGHT");if(r&&t.ref.imageHeight<r)return r;var o=t.rect.element.width*(t.ref.imageHeight/t.ref.imageWidth);return r&&o<r?r:i&&o>i?i:o};n.registerWriter(i({DID_LOAD_ITEM:function(e){var t=e.root,n=e.props;a(t,n)},DID_FILE_POSTER_CALCULATE_SIZE:function(e){var t=e.root,n=e.action;t.ref.filePoster&&(t.ref.imageWidth=n.width,t.ref.imageHeight=n.height,t.ref.shouldUpdatePanelHeight=!0,t.dispatch("KICK"))},DID_UPDATE_ITEM_METADATA:function(e){var t=e.root,n=e.props,r=e.action;/poster/.test(r.change.key)&&a(t,n)}},(function(e){var t=e.root,n=e.props;t.ref.filePoster&&(t.rect.element.hidden||t.ref.shouldUpdatePanelHeight&&(t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:n.id,height:s({root:t})}),t.ref.shouldUpdatePanelHeight=!1))})))}})),{options:{allowFilePoster:[!0,r.BOOLEAN],filePosterHeight:[null,r.INT],filePosterMinHeight:[null,r.INT],filePosterMaxHeight:[null,r.INT],filePosterFilterItem:[function(){return!0},r.FUNCTION],filePosterCalculateAverageImageColor:[!1,r.BOOLEAN],filePosterCrossOriginAttributeValue:["Anonymous",r.STRING],filePosterItemOverlayShadowColor:[null,r.ARRAY],filePosterItemOverlayErrorColor:[null,r.ARRAY],filePosterItemOverlaySuccessColor:[null,r.ARRAY]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:p})),p})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).FilePondPluginFileValidateType=t()}(this,(function(){"use strict";var e=function(e){var t=e.addFilter,n=e.utils,r=n.Type,i=n.isString,o=n.replaceInString,a=n.guesstimateMimeType,s=n.getExtensionFromFilename,l=n.getFilenameFromURL,u=function(e,t){return e.some((function(e){return/\*$/.test(e)?(n=e,(/^[^/]+/.exec(t)||[]).pop()===n.slice(0,-2)):e===t;var n}))},c=function(e,t,n){if(0===t.length)return!0;var r=function(e){var t="";if(i(e)){var n=l(e),r=s(n);r&&(t=a(r))}else t=e.type;return t}(e);return n?new Promise((function(i,o){n(e,r).then((function(e){u(t,e)?i():o()})).catch(o)})):u(t,r)};return t("SET_ATTRIBUTE_TO_OPTION_MAP",(function(e){return Object.assign(e,{accept:"acceptedFileTypes"})})),t("ALLOW_HOPPER_ITEM",(function(e,t){var n=t.query;return!n("GET_ALLOW_FILE_TYPE_VALIDATION")||c(e,n("GET_ACCEPTED_FILE_TYPES"))})),t("LOAD_FILE",(function(e,t){var n=t.query;return new Promise((function(t,r){if(n("GET_ALLOW_FILE_TYPE_VALIDATION")){var i=n("GET_ACCEPTED_FILE_TYPES"),a=n("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),s=c(e,i,a),l=function(){var e,t=i.map((e=n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(t){return null!==e[t]&&(e[t]||t)})).filter((function(e){return!1!==e})),a=t.filter((function(e,n){return t.indexOf(e)===n}));r({status:{main:n("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:o(n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:a.join(", "),allButLastType:a.slice(0,-1).join(", "),lastType:a[a.length-1]})}})};if("boolean"==typeof s)return s?t(e):l();s.then((function(){t(e)})).catch(l)}else t(e)}))})),{options:{allowFileTypeValidation:[!0,r.BOOLEAN],acceptedFileTypes:[[],r.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",r.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",r.STRING],fileValidateTypeLabelExpectedTypesMap:[{},r.OBJECT],fileValidateTypeDetectType:[null,r.FUNCTION]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:e})),e})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).FilePond={})}(this,(function(e){"use strict";var t=function(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])},n=function(e){var n={};return t(e,(function(t){!function(e,t,n){"function"!=typeof n?Object.defineProperty(e,t,Object.assign({},n)):e[t]=n}(n,t,e[t])})),n},r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null===n)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,n)},i=["svg","path"],o=function(e){return i.includes(e)},a=function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"==typeof n&&(i=n,n=null);var a=o(e)?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n&&(o(e)?r(a,"class",n):a.className=n),t(i,(function(e,t){r(a,e,t)})),a},s=function(e,t){return function(e,n){return void 0!==n?t.splice(n,0,e):t.push(e),e}},l=function(e,t){return function(n){return t.splice(t.indexOf(n),1),n.element.parentNode&&e.removeChild(n.element),n}},u="undefined"!=typeof window&&void 0!==window.document,c=function(){return u},d="children"in(c()?a("svg"):{})?function(e){return e.children.length}:function(e){return e.childNodes.length},f=function(e,t,n,r){var i=n[0]||e.left,o=n[1]||e.top,a=i+e.width,s=o+e.height*(r[1]||1),l={element:Object.assign({},e),inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:i,top:o,right:a,bottom:s}};return t.filter((function(e){return!e.isRectIgnored()})).map((function(e){return e.rect})).forEach((function(e){p(l.inner,Object.assign({},e.inner)),p(l.outer,Object.assign({},e.outer))})),h(l.inner),l.outer.bottom+=l.element.marginBottom,l.outer.right+=l.element.marginRight,h(l.outer),l},p=function(e,t){t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},h=function(e){e.width=e.right-e.left,e.height=e.bottom-e.top},m=function(e){return"number"==typeof e},g=function(e){return e<.5?2*e*e:(4-2*e)*e-1},v={spring:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiffness,r=void 0===t?.5:t,i=e.damping,o=void 0===i?.75:i,a=e.mass,s=void 0===a?10:a,l=null,u=null,c=0,d=!1,f=n({interpolate:function(e,t){if(!d){if(!m(l)||!m(u))return d=!0,void(c=0);(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001;return Math.abs(e-t)<r&&Math.abs(n)<r})(u+=c+=-(u-l)*r/s,l,c*=o)||t?(u=l,c=0,d=!0,f.onupdate(u),f.oncomplete(u)):f.onupdate(u)}},target:{set:function(e){if(m(e)&&!m(u)&&(u=e),null===l&&(l=e,u=e),u===(l=e)||void 0===l)return d=!0,c=0,f.onupdate(u),void f.oncomplete(u);d=!1},get:function(){return l}},resting:{get:function(){return d}},onupdate:function(e){},oncomplete:function(e){}});return f},tween:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.duration,o=void 0===i?500:i,a=r.easing,s=void 0===a?g:a,l=r.delay,u=void 0===l?0:l,c=null,d=!0,f=!1,p=null,h=n({interpolate:function(n,r){d||null===p||(null===c&&(c=n),n-c<u||((e=n-c-u)>=o||r?(e=1,t=f?0:1,h.onupdate(t*p),h.oncomplete(t*p),d=!0):(t=e/o,h.onupdate((e>=0?s(f?1-t:t):0)*p))))},target:{get:function(){return f?0:p},set:function(e){if(null===p)return p=e,h.onupdate(e),void h.oncomplete(e);e<p?(p=1,f=!0):(f=!1,p=e),d=!1,c=null}},resting:{get:function(){return d}},onupdate:function(e){},oncomplete:function(e){}});return h}},E=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(t=Array.isArray(t)?t:[t]).forEach((function(t){e.forEach((function(e){var i=e,o=function(){return n[e]},a=function(t){return n[e]=t};"object"==typeof e&&(i=e.key,o=e.getter||o,a=e.setter||a),t[i]&&!r||(t[i]={get:o,set:a})}))}))},_=function(e){return null!=e},y={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},T={styles:function(e){var t=e.mixinConfig,n=e.viewProps,r=e.viewInternalAPI,i=e.viewExternalAPI,o=e.view,a=Object.assign({},n),s={};E(t,[r,i],n);var l=function(){return o.rect?f(o.rect,o.childViews,[n.translateX||0,n.translateY||0],[n.scaleX||0,n.scaleY||0]):null};return r.rect={get:l},i.rect={get:l},t.forEach((function(e){n[e]=void 0===a[e]?y[e]:a[e]})),{write:function(){if(function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!0;for(var n in t)if(t[n]!==e[n])return!0;return!1}(s,n))return function(e,t){var n=t.opacity,r=t.perspective,i=t.translateX,o=t.translateY,a=t.scaleX,s=t.scaleY,l=t.rotateX,u=t.rotateY,c=t.rotateZ,d=t.originX,f=t.originY,p=t.width,h=t.height,m="",g="";(_(d)||_(f))&&(g+="transform-origin: "+(d||0)+"px "+(f||0)+"px;"),_(r)&&(m+="perspective("+r+"px) "),(_(i)||_(o))&&(m+="translate3d("+(i||0)+"px, "+(o||0)+"px, 0) "),(_(a)||_(s))&&(m+="scale3d("+(_(a)?a:1)+", "+(_(s)?s:1)+", 1) "),_(c)&&(m+="rotateZ("+c+"rad) "),_(l)&&(m+="rotateX("+l+"rad) "),_(u)&&(m+="rotateY("+u+"rad) "),m.length&&(g+="transform:"+m+";"),_(n)&&(g+="opacity:"+n+";",0===n&&(g+="visibility:hidden;"),n<1&&(g+="pointer-events:none;")),_(h)&&(g+="height:"+h+"px;"),_(p)&&(g+="width:"+p+"px;");var v=e.elementCurrentStyle||"";g.length===v.length&&g===v||(e.style.cssText=g,e.elementCurrentStyle=g)}(o.element,n),Object.assign(s,Object.assign({},n)),!0},destroy:function(){}}},listeners:function(e){e.mixinConfig,e.viewProps,e.viewInternalAPI;var t,n=e.viewExternalAPI,r=(e.viewState,e.view),i=[],o=(t=r.element,function(e,n){t.addEventListener(e,n)}),a=function(e){return function(t,n){e.removeEventListener(t,n)}}(r.element);return n.on=function(e,t){i.push({type:e,fn:t}),o(e,t)},n.off=function(e,t){i.splice(i.findIndex((function(n){return n.type===e&&n.fn===t})),1),a(e,t)},{write:function(){return!0},destroy:function(){i.forEach((function(e){a(e.type,e.fn)}))}}},animations:function(e){var n=e.mixinConfig,r=e.viewProps,i=e.viewInternalAPI,o=e.viewExternalAPI,a=Object.assign({},r),s=[];return t(n,(function(e,t){var n=function(e,t,n){var r=e[t]&&"object"==typeof e[t][n]?e[t][n]:e[t]||e,i="string"==typeof r?r:r.type,o="object"==typeof r?Object.assign({},r):{};return v[i]?v[i](o):null}(t);n&&(n.onupdate=function(t){r[e]=t},n.target=a[e],E([{key:e,setter:function(e){n.target!==e&&(n.target=e)},getter:function(){return r[e]}}],[i,o],r,!0),s.push(n))})),{write:function(e){var t=document.hidden,n=!0;return s.forEach((function(r){r.resting||(n=!1),r.interpolate(e,t)})),n},destroy:function(){}}},apis:function(e){var t=e.mixinConfig,n=e.viewProps,r=e.viewExternalAPI;E(t,r,n)}},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.layoutCalculated||(e.paddingTop=parseInt(n.paddingTop,10)||0,e.marginTop=parseInt(n.marginTop,10)||0,e.marginRight=parseInt(n.marginRight,10)||0,e.marginBottom=parseInt(n.marginBottom,10)||0,e.marginLeft=parseInt(n.marginLeft,10)||0,t.layoutCalculated=!0),e.left=t.offsetLeft||0,e.top=t.offsetTop||0,e.width=t.offsetWidth||0,e.height=t.offsetHeight||0,e.right=e.left+e.width,e.bottom=e.top+e.height,e.scrollTop=t.scrollTop,e.hidden=null===t.offsetParent,e},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.tag,r=void 0===t?"div":t,i=e.name,o=void 0===i?null:i,u=e.attributes,c=void 0===u?{}:u,p=e.read,h=void 0===p?function(){}:p,m=e.write,g=void 0===m?function(){}:m,v=e.create,E=void 0===v?function(){}:v,_=e.destroy,y=void 0===_?function(){}:_,b=e.filterFrameActionsForChild,w=void 0===b?function(e,t){return t}:b,S=e.didCreateView,D=void 0===S?function(){}:S,R=e.didWriteView,C=void 0===R?function(){}:R,A=e.ignoreRect,O=void 0!==A&&A,x=e.ignoreRectUpdate,L=void 0!==x&&x,P=e.mixins,M=void 0===P?[]:P;return function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=a(r,"filepond--"+o,c),p=window.getComputedStyle(u,null),m=I(),v=null,_=!1,b=[],S=[],R={},A={},x=[g],P=[h],N=[y],G=function(){return u},F=function(){return b.concat()},k=function(){return v||(v=f(m,b,[0,0],[1,1]))},U={element:{get:G},style:{get:function(){return p}},childViews:{get:F}},V=Object.assign({},U,{rect:{get:k},ref:{get:function(){return R}},is:function(e){return o===e},appendChild:(t=u,function(e,n){void 0!==n&&t.children[n]?t.insertBefore(e,t.children[n]):t.appendChild(e)}),createChildView:function(e){return function(t,n){return t(e,n)}}(e),linkView:function(e){return b.push(e),e},unlinkView:function(e){b.splice(b.indexOf(e),1)},appendChildView:s(0,b),removeChildView:l(u,b),registerWriter:function(e){return x.push(e)},registerReader:function(e){return P.push(e)},registerDestroyer:function(e){return N.push(e)},invalidateLayout:function(){return u.layoutCalculated=!1},dispatch:e.dispatch,query:e.query}),B={element:{get:G},childViews:{get:F},rect:{get:k},resting:{get:function(){return _}},isRectIgnored:function(){return O},_read:function(){v=null,b.forEach((function(e){return e._read()})),!(L&&m.width&&m.height)&&I(m,u,p);var e={root:q,props:i,rect:m};P.forEach((function(t){return t(e)}))},_write:function(e,t,n){var r=0===t.length;return x.forEach((function(o){!1===o({props:i,root:q,actions:t,timestamp:e,shouldOptimize:n})&&(r=!1)})),S.forEach((function(t){!1===t.write(e)&&(r=!1)})),b.filter((function(e){return!!e.element.parentNode})).forEach((function(i){i._write(e,w(i,t),n)||(r=!1)})),b.forEach((function(i,o){i.element.parentNode||(q.appendChild(i.element,o),i._read(),i._write(e,w(i,t),n),r=!1)})),_=r,C({props:i,root:q,actions:t,timestamp:e}),r},_destroy:function(){S.forEach((function(e){return e.destroy()})),N.forEach((function(e){e({root:q,props:i})})),b.forEach((function(e){return e._destroy()}))}},j=Object.assign({},U,{rect:{get:function(){return m}}});Object.keys(M).sort((function(e,t){return"styles"===e?1:"styles"===t?-1:0})).forEach((function(e){var t=T[e]({mixinConfig:M[e],viewProps:i,viewState:A,viewInternalAPI:V,viewExternalAPI:B,view:n(j)});t&&S.push(t)}));var q=n(V);E({root:q,props:i});var H=d(u);return b.forEach((function(e,t){q.appendChild(e.element,H+t)})),D(q),n(B)}},w=function(e,t){return function(n){var r=n.root,i=n.props,o=n.actions,a=void 0===o?[]:o,s=n.timestamp,l=n.shouldOptimize;a.filter((function(t){return e[t.type]})).forEach((function(t){return e[t.type]({root:r,props:i,action:t.data,timestamp:s,shouldOptimize:l})})),t&&t({root:r,props:i,actions:a,timestamp:s,shouldOptimize:l})}},S=function(e,t){return t.parentNode.insertBefore(e,t)},D=function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},R=function(e){return Array.isArray(e)},C=function(e){return null==e},A=function(e){return e.trim()},O=function(e){return""+e},x=function(e){return"boolean"==typeof e},L=function(e){return x(e)?e:"true"===e},P=function(e){return"string"==typeof e},M=function(e){return m(e)?e:P(e)?O(e).replace(/[a-z]+/gi,""):0},N=function(e){return parseInt(M(e),10)},G=function(e){return parseFloat(M(e))},F=function(e){return m(e)&&isFinite(e)&&Math.floor(e)===e},k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(F(e))return e;var n=O(e).trim();return/MB$/i.test(n)?(n=n.replace(/MB$i/,"").trim(),N(n)*t*t):/KB/i.test(n)?(n=n.replace(/KB$i/,"").trim(),N(n)*t):N(n)},U=function(e){return"function"==typeof e},V={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},B=function(e){return"object"==typeof e&&null!==e},j=function(e){return R(e)?"array":function(e){return null===e}(e)?"null":F(e)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(e)?"bytes":function(e){return B(e)&&P(e.url)&&B(e.process)&&B(e.revert)&&B(e.restore)&&B(e.fetch)}(e)?"api":typeof e},q={array:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return C(e)?[]:R(e)?e:O(e).split(t).map(A).filter((function(e){return e.length}))},boolean:L,int:function(e){return"bytes"===j(e)?k(e):N(e)},number:G,float:G,bytes:k,string:function(e){return U(e)?e:O(e)},function:function(e){return function(e){for(var t=self,n=e.split("."),r=null;r=n.shift();)if(!(t=t[r]))return null;return t}(e)},serverapi:function(e){return(r={}).url=P(n=e)?n:n.url||"",r.timeout=n.timeout?parseInt(n.timeout,10):0,r.headers=n.headers?n.headers:{},t(V,(function(e){r[e]=function(e,t,n,r,i){if(null===t)return null;if("function"==typeof t)return t;var o={url:"GET"===n||"PATCH"===n?"?"+e+"=":"",method:n,headers:i,withCredentials:!1,timeout:r,onload:null,ondata:null,onerror:null};if(P(t))return o.url=t,o;if(Object.assign(o,t),P(o.headers)){var a=o.headers.split(/:(.+)/);o.headers={header:a[0],value:a[1]}}return o.withCredentials=L(o.withCredentials),o}(e,n[e],V[e],r.timeout,r.headers)})),r.process=n.process||P(n)||n.url?r.process:null,r.remove=n.remove||null,delete r.headers,r;var n,r},object:function(e){try{return JSON.parse(e.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",'))}catch(e){return null}}},H=function(e,t,n){if(e===t)return e;var r,i=j(e);if(i!==n){var o=(r=e,q[n](r));if(i=j(o),null===o)throw'Trying to assign value with incorrect type to "'+option+'", allowed type: "'+n+'"';e=o}return e},W=function(e){var r={};return t(e,(function(t){var n,i,o,a=e[t];r[t]=(n=a[0],i=a[1],o=n,{enumerable:!0,get:function(){return o},set:function(e){o=H(e,n,i)}})})),n(r)},Y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.split(/(?=[A-Z])/).map((function(e){return e.toLowerCase()})).join(t)},z=function(e){return function(n,r,i){var o={};return t(e,(function(e){var t=Y(e,"_").toUpperCase();o["SET_"+t]=function(r){try{i.options[e]=r.value}catch(e){}n("DID_SET_"+t,{value:i.options[e]})}})),o}},X=function(e){return function(n){var r={};return t(e,(function(e){r["GET_"+Y(e,"_").toUpperCase()]=function(t){return n.options[e]}})),r}},$=function(){return Math.random().toString(36).substring(2,11)};function K(e){this.wrapped=e}function Q(e){var t,n;function r(t,n){try{var o=e[t](n),a=o.value,s=a instanceof K;Promise.resolve(s?a.wrapped:a).then((function(e){s?r("next",e):i(o.done?"return":"normal",e)}),(function(e){r("throw",e)}))}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null};n?n=n.next=s:(t=n=s,r(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function Z(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}"function"==typeof Symbol&&Symbol.asyncIterator&&(Q.prototype[Symbol.asyncIterator]=function(){return this}),Q.prototype.next=function(e){return this._invoke("next",e)},Q.prototype.throw=function(e){return this._invoke("throw",e)},Q.prototype.return=function(e){return this._invoke("return",e)};var J,ee,te=function(e,t){return e.splice(t,1)},ne=function(){var e=[],t=function(t,n){te(e,e.findIndex((function(e){return e.event===t&&(e.cb===n||!n)})))},n=function(t,n,r){e.filter((function(e){return e.event===t})).map((function(e){return e.cb})).forEach((function(e){return function(e,t){t?e():document.hidden?Promise.resolve(1).then(e):setTimeout(e,0)}((function(){return e.apply(void 0,Z(n))}),r)}))};return{fireSync:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];n(e,r,!0)},fire:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];n(e,r,!1)},on:function(t,n){e.push({event:t,cb:n})},onOnce:function(n,r){e.push({event:n,cb:function(){t(n,r),r.apply(void 0,arguments)}})},off:t}},re=function(e,t,n){Object.getOwnPropertyNames(e).filter((function(e){return!n.includes(e)})).forEach((function(n){return Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))},ie=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],oe=function(e){var t={};return re(e,t,ie),t},ae={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},se={INPUT:1,LIMBO:2,LOCAL:3},le=function(e){return/[^0-9]+/.exec(e)},ue=function(){return le(1.1.toLocaleString())[0]},ce={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},de=[],fe=function(e,t,n){return new Promise((function(r,i){var o=de.filter((function(t){return t.key===e})).map((function(e){return e.cb}));if(0!==o.length){var a=o.shift();o.reduce((function(e,t){return e.then((function(e){return t(e,n)}))}),a(t,n)).then((function(e){return r(e)})).catch((function(e){return i(e)}))}else r(t)}))},pe=function(e,t,n){return de.filter((function(t){return t.key===e})).map((function(e){return e.cb(t,n)}))},he=function(e,t){return de.push({key:e,cb:t})},me=function(){return Object.assign({},ge)},ge={id:[null,ce.STRING],name:["filepond",ce.STRING],disabled:[!1,ce.BOOLEAN],className:[null,ce.STRING],required:[!1,ce.BOOLEAN],captureMethod:[null,ce.STRING],allowSyncAcceptAttribute:[!0,ce.BOOLEAN],allowDrop:[!0,ce.BOOLEAN],allowBrowse:[!0,ce.BOOLEAN],allowPaste:[!0,ce.BOOLEAN],allowMultiple:[!1,ce.BOOLEAN],allowReplace:[!0,ce.BOOLEAN],allowRevert:[!0,ce.BOOLEAN],allowRemove:[!0,ce.BOOLEAN],allowProcess:[!0,ce.BOOLEAN],allowReorder:[!1,ce.BOOLEAN],allowDirectoriesOnly:[!1,ce.BOOLEAN],storeAsFile:[!1,ce.BOOLEAN],forceRevert:[!1,ce.BOOLEAN],maxFiles:[null,ce.INT],checkValidity:[!1,ce.BOOLEAN],itemInsertLocationFreedom:[!0,ce.BOOLEAN],itemInsertLocation:["before",ce.STRING],itemInsertInterval:[75,ce.INT],dropOnPage:[!1,ce.BOOLEAN],dropOnElement:[!0,ce.BOOLEAN],dropValidation:[!1,ce.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],ce.ARRAY],instantUpload:[!0,ce.BOOLEAN],maxParallelUploads:[2,ce.INT],allowMinimumUploadDuration:[!0,ce.BOOLEAN],chunkUploads:[!1,ce.BOOLEAN],chunkForce:[!1,ce.BOOLEAN],chunkSize:[5e6,ce.INT],chunkRetryDelays:[[500,1e3,3e3],ce.ARRAY],server:[null,ce.SERVER_API],fileSizeBase:[1e3,ce.INT],labelFileSizeBytes:["bytes",ce.STRING],labelFileSizeKilobytes:["KB",ce.STRING],labelFileSizeMegabytes:["MB",ce.STRING],labelFileSizeGigabytes:["GB",ce.STRING],labelDecimalSeparator:[ue(),ce.STRING],labelThousandsSeparator:[(J=ue(),ee=1e3.toLocaleString(),ee!==1e3.toString()?le(ee)[0]:"."===J?",":"."),ce.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',ce.STRING],labelInvalidField:["Field contains invalid files",ce.STRING],labelFileWaitingForSize:["Waiting for size",ce.STRING],labelFileSizeNotAvailable:["Size not available",ce.STRING],labelFileCountSingular:["file in list",ce.STRING],labelFileCountPlural:["files in list",ce.STRING],labelFileLoading:["Loading",ce.STRING],labelFileAdded:["Added",ce.STRING],labelFileLoadError:["Error during load",ce.STRING],labelFileRemoved:["Removed",ce.STRING],labelFileRemoveError:["Error during remove",ce.STRING],labelFileProcessing:["Uploading",ce.STRING],labelFileProcessingComplete:["Upload complete",ce.STRING],labelFileProcessingAborted:["Upload cancelled",ce.STRING],labelFileProcessingError:["Error during upload",ce.STRING],labelFileProcessingRevertError:["Error during revert",ce.STRING],labelTapToCancel:["tap to cancel",ce.STRING],labelTapToRetry:["tap to retry",ce.STRING],labelTapToUndo:["tap to undo",ce.STRING],labelButtonRemoveItem:["Remove",ce.STRING],labelButtonAbortItemLoad:["Abort",ce.STRING],labelButtonRetryItemLoad:["Retry",ce.STRING],labelButtonAbortItemProcessing:["Cancel",ce.STRING],labelButtonUndoItemProcessing:["Undo",ce.STRING],labelButtonRetryItemProcessing:["Retry",ce.STRING],labelButtonProcessItem:["Upload",ce.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',ce.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',ce.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',ce.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',ce.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',ce.STRING],oninit:[null,ce.FUNCTION],onwarning:[null,ce.FUNCTION],onerror:[null,ce.FUNCTION],onactivatefile:[null,ce.FUNCTION],oninitfile:[null,ce.FUNCTION],onaddfilestart:[null,ce.FUNCTION],onaddfileprogress:[null,ce.FUNCTION],onaddfile:[null,ce.FUNCTION],onprocessfilestart:[null,ce.FUNCTION],onprocessfileprogress:[null,ce.FUNCTION],onprocessfileabort:[null,ce.FUNCTION],onprocessfilerevert:[null,ce.FUNCTION],onprocessfile:[null,ce.FUNCTION],onprocessfiles:[null,ce.FUNCTION],onremovefile:[null,ce.FUNCTION],onpreparefile:[null,ce.FUNCTION],onupdatefiles:[null,ce.FUNCTION],onreorderfiles:[null,ce.FUNCTION],beforeDropFile:[null,ce.FUNCTION],beforeAddFile:[null,ce.FUNCTION],beforeRemoveFile:[null,ce.FUNCTION],beforePrepareFile:[null,ce.FUNCTION],stylePanelLayout:[null,ce.STRING],stylePanelAspectRatio:[null,ce.STRING],styleItemPanelAspectRatio:[null,ce.STRING],styleButtonRemoveItemPosition:["left",ce.STRING],styleButtonProcessItemPosition:["right",ce.STRING],styleLoadIndicatorPosition:["right",ce.STRING],styleProgressIndicatorPosition:["right",ce.STRING],styleButtonRemoveItemAlign:[!1,ce.BOOLEAN],files:[[],ce.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],ce.ARRAY]},ve=function(e,t){return C(t)?e[0]||null:F(t)?e[t]||null:("object"==typeof t&&(t=t.id),e.find((function(e){return e.id===t}))||null)},Ee=function(e){if(C(e))return e;if(/:/.test(e)){var t=e.split(":");return t[1]/t[0]}return parseFloat(e)},_e=function(e){return e.filter((function(e){return!e.archived}))},ye={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},Te=null,Ie=[ae.LOAD_ERROR,ae.PROCESSING_ERROR,ae.PROCESSING_REVERT_ERROR],be=[ae.LOADING,ae.PROCESSING,ae.PROCESSING_QUEUED,ae.INIT],we=[ae.PROCESSING_COMPLETE],Se=function(e){return Ie.includes(e.status)},De=function(e){return be.includes(e.status)},Re=function(e){return we.includes(e.status)},Ce=function(e){return B(e.options.server)&&(B(e.options.server.process)||U(e.options.server.process))},Ae=function(e){return{GET_STATUS:function(){var t=_e(e.items),n=ye.EMPTY,r=ye.ERROR,i=ye.BUSY,o=ye.IDLE,a=ye.READY;return 0===t.length?n:t.some(Se)?r:t.some(De)?i:t.some(Re)?a:o},GET_ITEM:function(t){return ve(e.items,t)},GET_ACTIVE_ITEM:function(t){return ve(_e(e.items),t)},GET_ACTIVE_ITEMS:function(){return _e(e.items)},GET_ITEMS:function(){return e.items},GET_ITEM_NAME:function(t){var n=ve(e.items,t);return n?n.filename:null},GET_ITEM_SIZE:function(t){var n=ve(e.items,t);return n?n.fileSize:null},GET_STYLES:function(){return Object.keys(e.options).filter((function(e){return/^style/.test(e)})).map((function(t){return{name:t,value:e.options[t]}}))},GET_PANEL_ASPECT_RATIO:function(){return/circle/.test(e.options.stylePanelLayout)?1:Ee(e.options.stylePanelAspectRatio)},GET_ITEM_PANEL_ASPECT_RATIO:function(){return e.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function(t){return _e(e.items).filter((function(e){return e.status===t}))},GET_TOTAL_ITEMS:function(){return _e(e.items).length},SHOULD_UPDATE_FILE_INPUT:function(){return e.options.storeAsFile&&function(){if(null===Te)try{var e=new DataTransfer;e.items.add(new File(["hello world"],"This_Works.txt"));var t=document.createElement("input");t.setAttribute("type","file"),t.files=e.files,Te=1===t.files.length}catch(e){Te=!1}return Te}()&&!Ce(e)},IS_ASYNC:function(){return Ce(e)},GET_FILE_SIZE_LABELS:function(e){return{labelBytes:e("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:e("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:e("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:e("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0}}}},Oe=function(e,t,n){return Math.max(Math.min(n,e),t)},xe=function(e){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(e)},Le=function(e){return(""+e).split("/").pop().split("?").shift()},Pe=function(e){return e.split(".").pop()},Me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(t+e).slice(-t.length)},Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return e.getFullYear()+"-"+Me(e.getMonth()+1,"00")+"-"+Me(e.getDate(),"00")+"_"+Me(e.getHours(),"00")+"-"+Me(e.getMinutes(),"00")+"-"+Me(e.getSeconds(),"00")},Ge=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i="string"==typeof n?e.slice(0,e.size,n):e.slice(0,e.size,e.type);return i.lastModifiedDate=new Date,e._relativePath&&(i._relativePath=e._relativePath),P(t)||(t=Ne()),t&&null===r&&Pe(t)?i.name=t:(r=r||function(e){if("string"!=typeof e)return"";var t=e.split("/").pop();return/svg/.test(t)?"svg":/zip|compressed/.test(t)?"zip":/plain/.test(t)?"txt":/msword/.test(t)?"doc":/[a-z]+/.test(t)?"jpeg"===t?"jpg":t:""}(i.type),i.name=t+(r?"."+r:"")),i},Fe=function(e,t){var n=window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(n){var r=new n;return r.append(e),r.getBlob(t)}return new Blob([e],{type:t})},ke=function(e){return(/^data:(.+);/.exec(e)||[])[1]||null},Ue=function(e){if(!/^content-disposition:/i.test(e))return null;var t=e.split(/filename=|filename\*=.+''/).splice(1).map((function(e){return e.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(e){return e.length}));return t.length?decodeURI(t[t.length-1]):null},Ve=function(e){if(/content-length:/i.test(e)){var t=e.match(/[0-9]+/)[0];return t?parseInt(t,10):null}return null},Be=function(e){return/x-content-transfer-id:/i.test(e)&&(e.split(":")[1]||"").trim()||null},je=function(e){var t={source:null,name:null,size:null},n=e.split("\n"),r=!0,i=!1,o=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var l=a.value,u=Ue(l);if(u)t.name=u;else{var c=Ve(l);if(c)t.size=c;else{var d=Be(l);d&&(t.source=d)}}}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return t},qe=function(e){var t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},n=function(n){e?(t.timestamp=Date.now(),t.request=e(n,(function(e){t.duration=Date.now()-t.timestamp,t.complete=!0,e instanceof Blob&&(e=Ge(e,e.name||Le(n))),r.fire("load",e instanceof Blob?e:e?e.body:null)}),(function(e){r.fire("error","string"==typeof e?{type:"error",code:0,body:e}:e)}),(function(e,n,i){i&&(t.size=i),t.duration=Date.now()-t.timestamp,e?(t.progress=n/i,r.fire("progress",t.progress)):t.progress=null}),(function(){r.fire("abort")}),(function(e){var n=je("string"==typeof e?e:e.headers);r.fire("meta",{size:t.size||n.size,filename:n.name,source:n.source})}))):r.fire("error",{type:"error",body:"Can't load URL",code:400})},r=Object.assign({},ne(),{setSource:function(e){return t.source=e},getProgress:function(){return t.progress},abort:function(){t.request&&t.request.abort&&t.request.abort()},load:function(){var e=t.source;r.fire("init",e),e instanceof File?r.fire("load",e):e instanceof Blob?r.fire("load",Ge(e,e.name)):xe(e)?r.fire("load",Ge(function(e){var t=ke(e);return function(e,t){for(var n=new ArrayBuffer(e.length),r=new Uint8Array(n),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return Fe(n,t)}(function(e){return atob(function(e){return e.split(",")[1].replace(/\s/g,"")}(e))}(e),t)}(e),undefined,null,undefined)):n(e)}});return r},He=function(e){return/GET|HEAD/.test(e)},We=function(e,t,n){var r={onheaders:function(){},onprogress:function(){},onload:function(){},ontimeout:function(){},onerror:function(){},onabort:function(){},abort:function(){i=!0,a.abort()}},i=!1,o=!1;n=Object.assign({method:"POST",headers:{},withCredentials:!1},n),t=encodeURI(t),He(n.method)&&e&&(t=""+t+encodeURIComponent("string"==typeof e?e:JSON.stringify(e)));var a=new XMLHttpRequest;return(He(n.method)?a:a.upload).onprogress=function(e){i||r.onprogress(e.lengthComputable,e.loaded,e.total)},a.onreadystatechange=function(){a.readyState<2||4===a.readyState&&0===a.status||o||(o=!0,r.onheaders(a))},a.onload=function(){a.status>=200&&a.status<300?r.onload(a):r.onerror(a)},a.onerror=function(){return r.onerror(a)},a.onabort=function(){i=!0,r.onabort()},a.ontimeout=function(){return r.ontimeout(a)},a.open(n.method,t,!0),F(n.timeout)&&(a.timeout=n.timeout),Object.keys(n.headers).forEach((function(e){var t=unescape(encodeURIComponent(n.headers[e]));a.setRequestHeader(e,t)})),n.responseType&&(a.responseType=n.responseType),n.withCredentials&&(a.withCredentials=!0),a.send(e),r},Ye=function(e,t,n,r){return{type:e,code:t,body:n,headers:r}},ze=function(e){return function(t){e(Ye("error",0,"Timeout",t.getAllResponseHeaders()))}},Xe=function(e){return/\?/.test(e)},$e=function(){for(var e="",t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach((function(t){e+=Xe(e)&&Xe(t)?t.replace(/\?/,"&"):t})),e},Ke=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if("function"==typeof t)return t;if(!t||!P(t.url))return null;var n=t.onload||function(e){return e},r=t.onerror||function(e){return null};return function(i,o,a,s,l,u){var c=We(i,$e(e,t.url),Object.assign({},t,{responseType:"blob"}));return c.onload=function(e){var r=e.getAllResponseHeaders(),a=je(r).name||Le(i);o(Ye("load",e.status,"HEAD"===t.method?null:Ge(n(e.response),a),r))},c.onerror=function(e){a(Ye("error",e.status,r(e.response)||e.statusText,e.getAllResponseHeaders()))},c.onheaders=function(e){u(Ye("headers",e.status,null,e.getAllResponseHeaders()))},c.ontimeout=ze(a),c.onprogress=s,c.onabort=l,c}},Qe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return"function"==typeof t?function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return t.apply(void 0,[n].concat(i,[r]))}:t&&P(t.url)?function(e,t,n,r){return function(i,o,a,s,l,u,c){if(i){var d=r.chunkUploads,f=d&&i.size>r.chunkSize,p=d&&(f||r.chunkForce);if(i instanceof Blob&&p)return function(e,t,n,r,i,o,a,s,l,u,c){for(var d=[],f=c.chunkTransferId,p=c.chunkServer,h=c.chunkSize,m=c.chunkRetryDelays,g={serverId:f,aborted:!1},v=t.ondata||function(e){return e},E=t.onload||function(e,t){return"HEAD"===t?e.getResponseHeader("Upload-Offset"):e.response},_=t.onerror||function(e){return null},y=Math.floor(r.size/h),T=0;T<=y;T++){var I=T*h,b=r.slice(I,I+h,"application/offset+octet-stream");d[T]={index:T,size:b.size,offset:I,data:b,file:r,progress:0,retries:Z(m),status:0,error:null,request:null,timeout:null}}var w,S,D,R,C=function(e){return 0===e.status||3===e.status},A=function(t){if(!g.aborted)if(t=t||d.find(C)){t.status=2,t.progress=null;var n=p.ondata||function(e){return e},i=p.onerror||function(e){return null},s=$e(e,p.url,g.serverId),u="function"==typeof p.headers?p.headers(t):Object.assign({},p.headers,{"Content-Type":"application/offset+octet-stream","Upload-Offset":t.offset,"Upload-Length":r.size,"Upload-Name":r.name}),c=t.request=We(n(t.data),s,Object.assign({},p,{headers:u}));c.onload=function(){t.status=1,t.request=null,L()},c.onprogress=function(e,n,r){t.progress=e?n:null,x()},c.onerror=function(e){t.status=3,t.request=null,t.error=i(e.response)||e.statusText,O(t)||a(Ye("error",e.status,i(e.response)||e.statusText,e.getAllResponseHeaders()))},c.ontimeout=function(e){t.status=3,t.request=null,O(t)||ze(a)(e)},c.onabort=function(){t.status=0,t.request=null,l()}}else d.every((function(e){return 1===e.status}))&&o(g.serverId)},O=function(e){return 0!==e.retries.length&&(e.status=4,clearTimeout(e.timeout),e.timeout=setTimeout((function(){A(e)}),e.retries.shift()),!0)},x=function(){var e=d.reduce((function(e,t){return null===e||null===t.progress?null:e+t.progress}),0);if(null===e)return s(!1,0,0);var t=d.reduce((function(e,t){return e+t.size}),0);s(!0,e,t)},L=function(){d.filter((function(e){return 2===e.status})).length>=1||A()};return g.serverId?(w=function(e){g.aborted||(d.filter((function(t){return t.offset<e})).forEach((function(e){e.status=1,e.progress=e.size})),L())},S=$e(e,p.url,g.serverId),D={headers:"function"==typeof t.headers?t.headers(g.serverId):Object.assign({},t.headers),method:"HEAD"},(R=We(null,S,D)).onload=function(e){return w(E(e,D.method))},R.onerror=function(e){return a(Ye("error",e.status,_(e.response)||e.statusText,e.getAllResponseHeaders()))},R.ontimeout=ze(a)):function(o){var s=new FormData;B(i)&&s.append(n,JSON.stringify(i));var l="function"==typeof t.headers?t.headers(r,i):Object.assign({},t.headers,{"Upload-Length":r.size}),u=Object.assign({},t,{headers:l}),c=We(v(s),$e(e,t.url),u);c.onload=function(e){return o(E(e,u.method))},c.onerror=function(e){return a(Ye("error",e.status,_(e.response)||e.statusText,e.getAllResponseHeaders()))},c.ontimeout=ze(a)}((function(e){g.aborted||(u(e),g.serverId=e,L())})),{abort:function(){g.aborted=!0,d.forEach((function(e){clearTimeout(e.timeout),e.request&&e.request.abort()}))}}}(e,t,n,i,o,a,s,l,u,c,r);var h=t.ondata||function(e){return e},m=t.onload||function(e){return e},g=t.onerror||function(e){return null},v="function"==typeof t.headers?t.headers(i,o)||{}:Object.assign({},t.headers),E=Object.assign({},t,{headers:v}),_=new FormData;B(o)&&_.append(n,JSON.stringify(o)),(i instanceof Blob?[{name:null,file:i}]:i).forEach((function(e){_.append(n,e.file,null===e.name?e.file.name:""+e.name+e.file.name)}));var y=We(h(_),$e(e,t.url),E);return y.onload=function(e){a(Ye("load",e.status,m(e.response),e.getAllResponseHeaders()))},y.onerror=function(e){s(Ye("error",e.status,g(e.response)||e.statusText,e.getAllResponseHeaders()))},y.ontimeout=ze(s),y.onprogress=l,y.onabort=u,y}}}(e,t,n,r):null},Ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if("function"==typeof t)return t;if(!t||!P(t.url))return function(e,t){return t()};var n=t.onload||function(e){return e},r=t.onerror||function(e){return null};return function(i,o,a){var s=We(i,e+t.url,t);return s.onload=function(e){o(Ye("load",e.status,n(e.response),e.getAllResponseHeaders()))},s.onerror=function(e){a(Ye("error",e.status,r(e.response)||e.statusText,e.getAllResponseHeaders()))},s.ontimeout=ze(a),s}},Je=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e+Math.random()*(t-e)},et=function(e){return e.substring(0,e.lastIndexOf("."))||e},tt=function(e){return!!(e instanceof File||e instanceof Blob&&e.name)},nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=$(),o={archived:!1,frozen:!1,released:!1,source:null,file:r,serverFileReference:t,transferId:null,processingAborted:!1,status:t?ae.PROCESSING_COMPLETE:ae.INIT,activeLoader:null,activeProcessor:null},a=null,s={},l=function(e){return o.status=e},u=function(e){if(!o.released&&!o.frozen){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];d.fire.apply(d,[e].concat(n))}},c=function(e,t,n){var r=e.split("."),i=r[0],o=r.pop(),a=s;r.forEach((function(e){return a=a[e]})),JSON.stringify(a[o])!==JSON.stringify(t)&&(a[o]=t,u("metadata-update",{key:i,value:s[i],silent:n}))},d=Object.assign({id:{get:function(){return i}},origin:{get:function(){return e},set:function(t){return e=t}},serverId:{get:function(){return o.serverFileReference}},transferId:{get:function(){return o.transferId}},status:{get:function(){return o.status}},filename:{get:function(){return o.file.name}},filenameWithoutExtension:{get:function(){return et(o.file.name)}},fileExtension:{get:function(){return Pe(o.file.name)}},fileType:{get:function(){return o.file.type}},fileSize:{get:function(){return o.file.size}},file:{get:function(){return o.file}},relativePath:{get:function(){return o.file._relativePath}},source:{get:function(){return o.source}},getMetadata:function(e){return function e(t){if(!B(t))return t;var n=R(t)?[]:{};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];n[r]=i&&B(i)?e(i):i}return n}(e?s[e]:s)},setMetadata:function(e,t,n){if(B(e)){var r=e;return Object.keys(r).forEach((function(e){c(e,r[e],t)})),e}return c(e,t,n),t},extend:function(e,t){return f[e]=t},abortLoad:function(){o.activeLoader?o.activeLoader.abort():(l(ae.INIT),u("load-abort"))},retryLoad:function(){o.activeLoader&&o.activeLoader.load()},requestProcessing:function(){o.processingAborted=!1,l(ae.PROCESSING_QUEUED)},abortProcessing:function(){return new Promise((function(e){if(!o.activeProcessor)return o.processingAborted=!0,l(ae.IDLE),u("process-abort"),void e();a=function(){e()},o.activeProcessor.abort()}))},load:function(t,n,r){o.source=t,d.fireSync("init"),o.file?d.fireSync("load-skip"):(o.file=function(e){var t=[e.name,e.size,e.type];return e instanceof Blob||xe(e)?t[0]=e.name||Ne():xe(e)?(t[1]=e.length,t[2]=ke(e)):P(e)&&(t[0]=Le(e),t[1]=0,t[2]="application/octet-stream"),{name:t[0],size:t[1],type:t[2]}}(t),n.on("init",(function(){u("load-init")})),n.on("meta",(function(t){o.file.size=t.size,o.file.filename=t.filename,t.source&&(e=se.LIMBO,o.serverFileReference=t.source,o.status=ae.PROCESSING_COMPLETE),u("load-meta")})),n.on("progress",(function(e){l(ae.LOADING),u("load-progress",e)})),n.on("error",(function(e){l(ae.LOAD_ERROR),u("load-request-error",e)})),n.on("abort",(function(){l(ae.INIT),u("load-abort")})),n.on("load",(function(t){o.activeLoader=null;var n=function(t){o.file=tt(t)?t:o.file,e===se.LIMBO&&o.serverFileReference?l(ae.PROCESSING_COMPLETE):l(ae.IDLE),u("load")};o.serverFileReference?n(t):r(t,n,(function(e){o.file=t,u("load-meta"),l(ae.LOAD_ERROR),u("load-file-error",e)}))})),n.setSource(t),o.activeLoader=n,n.load())},process:function e(t,n){if(o.processingAborted)o.processingAborted=!1;else if(l(ae.PROCESSING),a=null,o.file instanceof Blob){t.on("load",(function(e){o.transferId=null,o.serverFileReference=e})),t.on("transfer",(function(e){o.transferId=e})),t.on("load-perceived",(function(e){o.activeProcessor=null,o.transferId=null,o.serverFileReference=e,l(ae.PROCESSING_COMPLETE),u("process-complete",e)})),t.on("start",(function(){u("process-start")})),t.on("error",(function(e){o.activeProcessor=null,l(ae.PROCESSING_ERROR),u("process-error",e)})),t.on("abort",(function(e){o.activeProcessor=null,o.serverFileReference=e,l(ae.IDLE),u("process-abort"),a&&a()})),t.on("progress",(function(e){u("process-progress",e)}));var r=console.error;n(o.file,(function(e){o.archived||t.process(e,Object.assign({},s))}),r),o.activeProcessor=t}else d.on("load",(function(){e(t,n)}))},revert:function(e,t){return new Promise((function(n,r){var i=null!==o.serverFileReference?o.serverFileReference:o.transferId;null!==i?(e(i,(function(){o.serverFileReference=null,o.transferId=null,n()}),(function(e){t?(l(ae.PROCESSING_REVERT_ERROR),u("process-revert-error"),r(e)):n()})),l(ae.IDLE),u("process-revert")):n()}))}},ne(),{freeze:function(){return o.frozen=!0},release:function(){return o.released=!0},released:{get:function(){return o.released}},archive:function(){return o.archived=!0},archived:{get:function(){return o.archived}},setFile:function(e){return o.file=e}}),f=n(d);return f},rt=function(e,t){var n=function(e,t){return C(t)?0:P(t)?e.findIndex((function(e){return e.id===t})):-1}(e,t);if(!(n<0))return e[n]||null},it=function(e,t,n,r,i,o){var a=We(null,e,{method:"GET",responseType:"blob"});return a.onload=function(n){var r=n.getAllResponseHeaders(),i=je(r).name||Le(e);t(Ye("load",n.status,Ge(n.response,i),r))},a.onerror=function(e){n(Ye("error",e.status,e.statusText,e.getAllResponseHeaders()))},a.onheaders=function(e){o(Ye("headers",e.status,null,e.getAllResponseHeaders()))},a.ontimeout=ze(n),a.onprogress=r,a.onabort=i,a},ot=function(e){return 0===e.indexOf("//")&&(e=location.protocol+e),e.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]},at=function(e){return function(){return U(e)?e.apply(void 0,arguments):e}},st=function(e,t){clearTimeout(t.listUpdateTimeout),t.listUpdateTimeout=setTimeout((function(){e("DID_UPDATE_ITEMS",{items:_e(t.items)})}),0)},lt=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise((function(t){if(!e)return t(!0);var r=e.apply(void 0,n);return null==r?t(!0):"boolean"==typeof r?t(r):void("function"==typeof r.then&&r.then(t))}))},ut=function(e,t){e.items.sort((function(e,n){return t(oe(e),oe(n))}))},ct=function(e,t){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.query,i=n.success,o=void 0===i?function(){}:i,a=n.failure,s=void 0===a?function(){}:a,l=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,["query","success","failure"]),u=ve(e.items,r);u?t(u,o,s,l||{}):s({error:Ye("error",0,"Item not found"),file:null})}},dt=function(e,t,n){return{ABORT_ALL:function(){_e(n.items).forEach((function(e){e.freeze(),e.abortLoad(),e.abortProcessing()}))},DID_SET_FILES:function(t){var r=t.value,i=(void 0===r?[]:r).map((function(e){return{source:e.source?e.source:e,options:e.options}})),o=_e(n.items);o.forEach((function(t){i.find((function(e){return e.source===t.source||e.source===t.file}))||e("REMOVE_ITEM",{query:t,remove:!1})})),o=_e(n.items),i.forEach((function(t,n){o.find((function(e){return e.source===t.source||e.file===t.source}))||e("ADD_ITEM",Object.assign({},t,{interactionMethod:5,index:n}))}))},DID_UPDATE_ITEM_METADATA:function(r){var i=r.id,o=r.action,a=r.change;a.silent||(clearTimeout(n.itemUpdateTimeout),n.itemUpdateTimeout=setTimeout((function(){var r=rt(n.items,i);if(t("IS_ASYNC")){r.origin===se.LOCAL&&e("DID_LOAD_ITEM",{id:r.id,error:null,serverFileReference:r.source});var s,l=function(){setTimeout((function(){e("REQUEST_ITEM_PROCESSING",{query:i})}),32)};return r.status===ae.PROCESSING_COMPLETE?(s=n.options.instantUpload,void r.revert(Ze(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then(s?l:function(){}).catch((function(){}))):r.status===ae.PROCESSING?function(e){r.abortProcessing().then(e?l:function(){})}(n.options.instantUpload):void(n.options.instantUpload&&l())}fe("SHOULD_PREPARE_OUTPUT",!1,{item:r,query:t,action:o,change:a}).then((function(n){var o=t("GET_BEFORE_PREPARE_FILE");o&&(n=o(r,n)),n&&e("REQUEST_PREPARE_OUTPUT",{query:i,item:r,success:function(t){e("DID_PREPARE_OUTPUT",{id:i,file:t})}},!0)}))}),0))},MOVE_ITEM:function(e){var t=e.query,r=e.index,i=ve(n.items,t);if(i){var o=n.items.indexOf(i);o!==(r=Oe(r,0,n.items.length-1))&&n.items.splice(r,0,n.items.splice(o,1)[0])}},SORT:function(r){var i=r.compare;ut(n,i),e("DID_SORT_ITEMS",{items:t("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function(n){var r=n.items,i=n.index,o=n.interactionMethod,a=n.success,s=void 0===a?function(){}:a,l=n.failure,u=void 0===l?function(){}:l,c=i;if(-1===i||void 0===i){var d=t("GET_ITEM_INSERT_LOCATION"),f=t("GET_TOTAL_ITEMS");c="before"===d?0:f}var p=t("GET_IGNORED_FILES"),h=r.filter((function(e){return tt(e)?!p.includes(e.name.toLowerCase()):!C(e)})).map((function(t){return new Promise((function(n,r){e("ADD_ITEM",{interactionMethod:o,source:t.source||t,success:n,failure:r,index:c++,options:t.options||{}})}))}));Promise.all(h).then(s).catch(u)},ADD_ITEM:function(r){var i=r.source,o=r.index,a=void 0===o?-1:o,s=r.interactionMethod,l=r.success,u=void 0===l?function(){}:l,c=r.failure,d=void 0===c?function(){}:c,f=r.options,p=void 0===f?{}:f;if(C(i))d({error:Ye("error",0,"No source"),file:null});else if(!tt(i)||!n.options.ignoredFiles.includes(i.name.toLowerCase())){if(!function(e){var t=_e(e.items).length;if(!e.options.allowMultiple)return 0===t;var n=e.options.maxFiles;return null===n||t<n}(n)){if(n.options.allowMultiple||!n.options.allowMultiple&&!n.options.allowReplace){var h=Ye("warning",0,"Max files");return e("DID_THROW_MAX_FILES",{source:i,error:h}),void d({error:h,file:null})}var m=_e(n.items)[0];if(m.status===ae.PROCESSING_COMPLETE||m.status===ae.PROCESSING_REVERT_ERROR){var g=t("GET_FORCE_REVERT");if(m.revert(Ze(n.options.server.url,n.options.server.revert),g).then((function(){g&&e("ADD_ITEM",{source:i,index:a,interactionMethod:s,success:u,failure:d,options:p})})).catch((function(){})),g)return}e("REMOVE_ITEM",{query:m.id})}var v="local"===p.type?se.LOCAL:"limbo"===p.type?se.LIMBO:se.INPUT,E=nt(v,v===se.INPUT?null:i,p.file);Object.keys(p.metadata||{}).forEach((function(e){E.setMetadata(e,p.metadata[e])})),pe("DID_CREATE_ITEM",E,{query:t,dispatch:e});var _=t("GET_ITEM_INSERT_LOCATION");n.options.itemInsertLocationFreedom||(a="before"===_?-1:n.items.length),function(e,t,n){C(t)||(void 0===n?e.push(t):function(e,t,n){e.splice(t,0,n)}(e,n=Oe(n,0,e.length),t))}(n.items,E,a),U(_)&&i&&ut(n,_);var y=E.id;E.on("init",(function(){e("DID_INIT_ITEM",{id:y})})),E.on("load-init",(function(){e("DID_START_ITEM_LOAD",{id:y})})),E.on("load-meta",(function(){e("DID_UPDATE_ITEM_META",{id:y})})),E.on("load-progress",(function(t){e("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:y,progress:t})})),E.on("load-request-error",(function(t){var r=at(n.options.labelFileLoadError)(t);if(t.code>=400&&t.code<500)return e("DID_THROW_ITEM_INVALID",{id:y,error:t,status:{main:r,sub:t.code+" ("+t.body+")"}}),void d({error:t,file:oe(E)});e("DID_THROW_ITEM_LOAD_ERROR",{id:y,error:t,status:{main:r,sub:n.options.labelTapToRetry}})})),E.on("load-file-error",(function(t){e("DID_THROW_ITEM_INVALID",{id:y,error:t.status,status:t.status}),d({error:t.status,file:oe(E)})})),E.on("load-abort",(function(){e("REMOVE_ITEM",{query:y})})),E.on("load-skip",(function(){E.on("metadata-update",(function(t){tt(E.file)&&e("DID_UPDATE_ITEM_METADATA",{id:y,change:t})})),e("COMPLETE_LOAD_ITEM",{query:y,item:E,data:{source:i,success:u}})})),E.on("load",(function(){var r=function(r){r?(E.on("metadata-update",(function(t){e("DID_UPDATE_ITEM_METADATA",{id:y,change:t})})),fe("SHOULD_PREPARE_OUTPUT",!1,{item:E,query:t}).then((function(r){var o=t("GET_BEFORE_PREPARE_FILE");o&&(r=o(E,r));var a=function(){e("COMPLETE_LOAD_ITEM",{query:y,item:E,data:{source:i,success:u}}),st(e,n)};r?e("REQUEST_PREPARE_OUTPUT",{query:y,item:E,success:function(t){e("DID_PREPARE_OUTPUT",{id:y,file:t}),a()}},!0):a()}))):e("REMOVE_ITEM",{query:y})};fe("DID_LOAD_ITEM",E,{query:t,dispatch:e}).then((function(){lt(t("GET_BEFORE_ADD_FILE"),oe(E)).then(r)})).catch((function(t){if(!t||!t.error||!t.status)return r(!1);e("DID_THROW_ITEM_INVALID",{id:y,error:t.error,status:t.status})}))})),E.on("process-start",(function(){e("DID_START_ITEM_PROCESSING",{id:y})})),E.on("process-progress",(function(t){e("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:y,progress:t})})),E.on("process-error",(function(t){e("DID_THROW_ITEM_PROCESSING_ERROR",{id:y,error:t,status:{main:at(n.options.labelFileProcessingError)(t),sub:n.options.labelTapToRetry}})})),E.on("process-revert-error",(function(t){e("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:y,error:t,status:{main:at(n.options.labelFileProcessingRevertError)(t),sub:n.options.labelTapToRetry}})})),E.on("process-complete",(function(t){e("DID_COMPLETE_ITEM_PROCESSING",{id:y,error:null,serverFileReference:t}),e("DID_DEFINE_VALUE",{id:y,value:t})})),E.on("process-abort",(function(){e("DID_ABORT_ITEM_PROCESSING",{id:y})})),E.on("process-revert",(function(){e("DID_REVERT_ITEM_PROCESSING",{id:y}),e("DID_DEFINE_VALUE",{id:y,value:null})})),e("DID_ADD_ITEM",{id:y,index:a,interactionMethod:s}),st(e,n);var T=n.options.server||{},I=T.url,b=T.load,w=T.restore,S=T.fetch;E.load(i,qe(v===se.INPUT?P(i)&&function(e){return(e.indexOf(":")>-1||e.indexOf("//")>-1)&&ot(location.href)!==ot(e)}(i)&&S?Ke(I,S):it:Ke(I,v===se.LIMBO?w:b)),(function(e,n,r){fe("LOAD_FILE",e,{query:t}).then(n).catch(r)}))}},REQUEST_PREPARE_OUTPUT:function(e){var n=e.item,r=e.success,i=e.failure,o=void 0===i?function(){}:i,a={error:Ye("error",0,"Item not found"),file:null};if(n.archived)return o(a);fe("PREPARE_OUTPUT",n.file,{query:t,item:n}).then((function(e){fe("COMPLETE_PREPARE_OUTPUT",e,{query:t,item:n}).then((function(e){if(n.archived)return o(a);r(e)}))}))},COMPLETE_LOAD_ITEM:function(r){var i=r.item,o=r.data,a=o.success,s=o.source,l=t("GET_ITEM_INSERT_LOCATION");if(U(l)&&s&&ut(n,l),e("DID_LOAD_ITEM",{id:i.id,error:null,serverFileReference:i.origin===se.INPUT?null:s}),a(oe(i)),i.origin!==se.LOCAL)return i.origin===se.LIMBO?(e("DID_COMPLETE_ITEM_PROCESSING",{id:i.id,error:null,serverFileReference:s}),void e("DID_DEFINE_VALUE",{id:i.id,value:i.serverId||s})):void(t("IS_ASYNC")&&n.options.instantUpload&&e("REQUEST_ITEM_PROCESSING",{query:i.id}));e("DID_LOAD_LOCAL_ITEM",{id:i.id})},RETRY_ITEM_LOAD:ct(n,(function(e){e.retryLoad()})),REQUEST_ITEM_PREPARE:ct(n,(function(t,n,r){e("REQUEST_PREPARE_OUTPUT",{query:t.id,item:t,success:function(r){e("DID_PREPARE_OUTPUT",{id:t.id,file:r}),n({file:t,output:r})},failure:r},!0)})),REQUEST_ITEM_PROCESSING:ct(n,(function(r,i,o){if(r.status===ae.IDLE||r.status===ae.PROCESSING_ERROR)r.status!==ae.PROCESSING_QUEUED&&(r.requestProcessing(),e("DID_REQUEST_ITEM_PROCESSING",{id:r.id}),e("PROCESS_ITEM",{query:r,success:i,failure:o},!0));else{var a=function(){return e("REQUEST_ITEM_PROCESSING",{query:r,success:i,failure:o})},s=function(){return document.hidden?a():setTimeout(a,32)};r.status===ae.PROCESSING_COMPLETE||r.status===ae.PROCESSING_REVERT_ERROR?r.revert(Ze(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then(s).catch((function(){})):r.status===ae.PROCESSING&&r.abortProcessing().then(s)}})),PROCESS_ITEM:ct(n,(function(r,i,o){var a=t("GET_MAX_PARALLEL_UPLOADS");if(t("GET_ITEMS_BY_STATUS",ae.PROCESSING).length!==a){if(r.status!==ae.PROCESSING){var s=function t(){var r=n.processingQueue.shift();if(r){var i=r.id,o=r.success,a=r.failure,s=ve(n.items,i);s&&!s.archived?e("PROCESS_ITEM",{query:i,success:o,failure:a},!0):t()}};r.onOnce("process-complete",(function(){i(oe(r)),s();var o=n.options.server;if(n.options.instantUpload&&r.origin===se.LOCAL&&U(o.remove)){var a=function(){};r.origin=se.LIMBO,n.options.server.remove(r.source,a,a)}t("GET_ITEMS_BY_STATUS",ae.PROCESSING_COMPLETE).length===n.items.length&&e("DID_COMPLETE_ITEM_PROCESSING_ALL")})),r.onOnce("process-error",(function(e){o({error:e,file:oe(r)}),s()}));var l=n.options;r.process(function(e,t){var n={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},r=t.allowMinimumUploadDuration,i=function(){n.request&&(n.perceivedPerformanceUpdater.clear(),n.request.abort&&n.request.abort(),n.complete=!0)},o=r?function(){return n.progress?Math.min(n.progress,n.perceivedProgress):null}:function(){return n.progress||null},a=r?function(){return Math.min(n.duration,n.perceivedDuration)}:function(){return n.duration},s=Object.assign({},ne(),{process:function(t,i){var o=function(){0!==n.duration&&null!==n.progress&&s.fire("progress",s.getProgress())},a=function(){n.complete=!0,s.fire("load-perceived",n.response.body)};s.fire("start"),n.timestamp=Date.now(),n.perceivedPerformanceUpdater=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:25,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,i=null,o=Date.now();return t>0&&function a(){var s=Date.now()-o,l=Je(n,r);s+l>t&&(l=s+l-t);var u=s/t;u>=1||document.hidden?e(1):(e(u),i=setTimeout(a,l))}(),{clear:function(){clearTimeout(i)}}}((function(e){n.perceivedProgress=e,n.perceivedDuration=Date.now()-n.timestamp,o(),n.response&&1===n.perceivedProgress&&!n.complete&&a()}),r?Je(750,1500):0),n.request=e(t,i,(function(e){n.response=B(e)?e:{type:"load",code:200,body:""+e,headers:{}},n.duration=Date.now()-n.timestamp,n.progress=1,s.fire("load",n.response.body),(!r||r&&1===n.perceivedProgress)&&a()}),(function(e){n.perceivedPerformanceUpdater.clear(),s.fire("error",B(e)?e:{type:"error",code:0,body:""+e})}),(function(e,t,r){n.duration=Date.now()-n.timestamp,n.progress=e?t/r:null,o()}),(function(){n.perceivedPerformanceUpdater.clear(),s.fire("abort",n.response?n.response.body:null)}),(function(e){s.fire("transfer",e)}))},abort:i,getProgress:o,getDuration:a,reset:function(){i(),n.complete=!1,n.perceivedProgress=0,n.progress=0,n.timestamp=null,n.perceivedDuration=0,n.duration=0,n.request=null,n.response=null}});return s}(Qe(l.server.url,l.server.process,l.name,{chunkTransferId:r.transferId,chunkServer:l.server.patch,chunkUploads:l.chunkUploads,chunkForce:l.chunkForce,chunkSize:l.chunkSize,chunkRetryDelays:l.chunkRetryDelays}),{allowMinimumUploadDuration:t("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(n,i,o){fe("PREPARE_OUTPUT",n,{query:t,item:r}).then((function(t){e("DID_PREPARE_OUTPUT",{id:r.id,file:t}),i(t)})).catch(o)}))}}else n.processingQueue.push({id:r.id,success:i,failure:o})})),RETRY_ITEM_PROCESSING:ct(n,(function(t){e("REQUEST_ITEM_PROCESSING",{query:t})})),REQUEST_REMOVE_ITEM:ct(n,(function(n){lt(t("GET_BEFORE_REMOVE_FILE"),oe(n)).then((function(t){t&&e("REMOVE_ITEM",{query:n})}))})),RELEASE_ITEM:ct(n,(function(e){e.release()})),REMOVE_ITEM:ct(n,(function(r,i,o,a){var s=function(){var t=r.id;rt(n.items,t).archive(),e("DID_REMOVE_ITEM",{error:null,id:t,item:r}),st(e,n),i(oe(r))},l=n.options.server;r.origin===se.LOCAL&&l&&U(l.remove)&&!1!==a.remove?(e("DID_START_ITEM_REMOVE",{id:r.id}),l.remove(r.source,(function(){return s()}),(function(t){e("DID_THROW_ITEM_REMOVE_ERROR",{id:r.id,error:Ye("error",0,t,null),status:{main:at(n.options.labelFileRemoveError)(t),sub:n.options.labelTapToRetry}})}))):((a.revert&&r.origin!==se.LOCAL&&null!==r.serverId||n.options.chunkUploads&&r.file.size>n.options.chunkSize||n.options.chunkUploads&&n.options.chunkForce)&&r.revert(Ze(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")),s())})),ABORT_ITEM_LOAD:ct(n,(function(e){e.abortLoad()})),ABORT_ITEM_PROCESSING:ct(n,(function(t){t.serverId?e("REVERT_ITEM_PROCESSING",{id:t.id}):t.abortProcessing().then((function(){n.options.instantUpload&&e("REMOVE_ITEM",{query:t.id})}))})),REQUEST_REVERT_ITEM_PROCESSING:ct(n,(function(r){if(n.options.instantUpload){var i=function(t){t&&e("REVERT_ITEM_PROCESSING",{query:r})},o=t("GET_BEFORE_REMOVE_FILE");if(!o)return i(!0);var a=o(oe(r));return null==a?i(!0):"boolean"==typeof a?i(a):void("function"==typeof a.then&&a.then(i))}e("REVERT_ITEM_PROCESSING",{query:r})})),REVERT_ITEM_PROCESSING:ct(n,(function(r){r.revert(Ze(n.options.server.url,n.options.server.revert),t("GET_FORCE_REVERT")).then((function(){(n.options.instantUpload||function(e){return!tt(e.file)}(r))&&e("REMOVE_ITEM",{query:r.id})})).catch((function(){}))})),SET_OPTIONS:function(t){var n=t.options,r=Object.keys(n),i=ft.filter((function(e){return r.includes(e)}));[].concat(Z(i),Z(Object.keys(n).filter((function(e){return!i.includes(e)})))).forEach((function(t){e("SET_"+Y(t,"_").toUpperCase(),{value:n[t]})}))}}},ft=["server"],pt=function(e){return document.createElement(e)},ht=function(e,t){var n=e.childNodes[0];n?t!==n.nodeValue&&(n.nodeValue=t):(n=document.createTextNode(t),e.appendChild(n))},mt=function(e,t,n,r){var i=(r%360-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}},gt=b({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:function(e){var t=e.root,n=e.props;n.spin=!1,n.progress=0,n.opacity=0;var r=a("svg");t.ref.path=a("path",{"stroke-width":2,"stroke-linecap":"round"}),r.appendChild(t.ref.path),t.ref.svg=r,t.appendChild(r)},write:function(e){var t=e.root,n=e.props;if(0!==n.opacity){n.align&&(t.element.dataset.align=n.align);var i=parseInt(r(t.ref.path,"stroke-width"),10),o=.5*t.rect.element.width,a=0,s=0;n.spin?(a=0,s=.5):(a=0,s=n.progress);var l=function(e,t,n,r,i){var o=1;return i>r&&i-r<=.5&&(o=0),r>i&&r-i>=.5&&(o=0),function(e,t,n,r,i,o){var a=mt(e,t,n,i),s=mt(e,t,n,r);return["M",a.x,a.y,"A",n,n,0,o,0,s.x,s.y].join(" ")}(e,t,n,360*Math.min(.9999,r),360*Math.min(.9999,i),o)}(o,o,o-i,a,s);r(t.ref.path,"d",l),r(t.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)}},mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),vt=b({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:function(e){var t=e.root,n=e.props;t.element.innerHTML=(n.icon||"")+"<span>"+n.label+"</span>",n.isDisabled=!1},write:function(e){var t=e.root,n=e.props,i=n.isDisabled,o=t.query("GET_DISABLED")||0===n.opacity;o&&!i?(n.isDisabled=!0,r(t.element,"disabled","disabled")):!o&&i&&(n.isDisabled=!1,t.element.removeAttribute("disabled"))}}),Et=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.labelBytes,o=void 0===i?"bytes":i,a=r.labelKilobytes,s=void 0===a?"KB":a,l=r.labelMegabytes,u=void 0===l?"MB":l,c=r.labelGigabytes,d=void 0===c?"GB":c,f=n,p=n*n,h=n*n*n;return(e=Math.round(Math.abs(e)))<f?e+" "+o:e<p?Math.floor(e/f)+" "+s:e<h?_t(e/p,1,t)+" "+u:_t(e/h,2,t)+" "+d},_t=function(e,t,n){return e.toFixed(t).split(".").filter((function(e){return"0"!==e})).join(n)},yt=function(e){var t=e.root,n=e.props;ht(t.ref.fileSize,Et(t.query("GET_ITEM_SIZE",n.id),".",t.query("GET_FILE_SIZE_BASE"),t.query("GET_FILE_SIZE_LABELS",t.query))),ht(t.ref.fileName,t.query("GET_ITEM_NAME",n.id))},Tt=function(e){var t=e.root,n=e.props;F(t.query("GET_ITEM_SIZE",n.id))?yt({root:t,props:n}):ht(t.ref.fileSize,t.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},It=b({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:w({DID_LOAD_ITEM:yt,DID_UPDATE_ITEM_META:yt,DID_THROW_ITEM_LOAD_ERROR:Tt,DID_THROW_ITEM_INVALID:Tt}),didCreateView:function(e){pe("CREATE_VIEW",Object.assign({},e,{view:e}))},create:function(e){var t=e.root,n=e.props,i=pt("span");i.className="filepond--file-info-main",r(i,"aria-hidden","true"),t.appendChild(i),t.ref.fileName=i;var o=pt("span");o.className="filepond--file-info-sub",t.appendChild(o),t.ref.fileSize=o,ht(o,t.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),ht(i,t.query("GET_ITEM_NAME",n.id))},mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),bt=function(e){return Math.round(100*e)},wt=function(e){var t=e.root,n=e.action,r=null===n.progress?t.query("GET_LABEL_FILE_LOADING"):t.query("GET_LABEL_FILE_LOADING")+" "+bt(n.progress)+"%";ht(t.ref.main,r),ht(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},St=function(e){var t=e.root;ht(t.ref.main,""),ht(t.ref.sub,"")},Dt=function(e){var t=e.root,n=e.action;ht(t.ref.main,n.status.main),ht(t.ref.sub,n.status.sub)},Rt=b({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:w({DID_LOAD_ITEM:St,DID_REVERT_ITEM_PROCESSING:St,DID_REQUEST_ITEM_PROCESSING:function(e){var t=e.root;ht(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING")),ht(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},DID_ABORT_ITEM_PROCESSING:function(e){var t=e.root;ht(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING_ABORTED")),ht(t.ref.sub,t.query("GET_LABEL_TAP_TO_RETRY"))},DID_COMPLETE_ITEM_PROCESSING:function(e){var t=e.root;ht(t.ref.main,t.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),ht(t.ref.sub,t.query("GET_LABEL_TAP_TO_UNDO"))},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(e){var t=e.root,n=e.action,r=null===n.progress?t.query("GET_LABEL_FILE_PROCESSING"):t.query("GET_LABEL_FILE_PROCESSING")+" "+bt(n.progress)+"%";ht(t.ref.main,r),ht(t.ref.sub,t.query("GET_LABEL_TAP_TO_CANCEL"))},DID_UPDATE_ITEM_LOAD_PROGRESS:wt,DID_THROW_ITEM_LOAD_ERROR:Dt,DID_THROW_ITEM_INVALID:Dt,DID_THROW_ITEM_PROCESSING_ERROR:Dt,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Dt,DID_THROW_ITEM_REMOVE_ERROR:Dt}),didCreateView:function(e){pe("CREATE_VIEW",Object.assign({},e,{view:e}))},create:function(e){var t=e.root,n=pt("span");n.className="filepond--file-status-main",t.appendChild(n),t.ref.main=n;var r=pt("span");r.className="filepond--file-status-sub",t.appendChild(r),t.ref.sub=r,wt({root:t,action:{progress:null}})},mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),Ct={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}},At=[];t(Ct,(function(e){At.push(e)}));var Ot,xt=function(e){if("right"===Nt(e))return 0;var t=e.ref.buttonRemoveItem.rect.element;return t.hidden?null:t.width+t.left},Lt=function(e){return e.ref.buttonAbortItemLoad.rect.element.width},Pt=function(e){return Math.floor(e.ref.buttonRemoveItem.rect.element.height/4)},Mt=function(e){return Math.floor(e.ref.buttonRemoveItem.rect.element.left/2)},Nt=function(e){return e.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")},Gt={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:function(e){return e.query("GET_STYLE_LOAD_INDICATOR_POSITION")}},processProgressIndicator:{opacity:0,align:function(e){return e.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},Ft={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:xt},status:{translateX:xt}},kt={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},Ut={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:xt},status:{translateX:xt,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:xt},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:Nt},info:{translateX:xt},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:Nt},buttonRemoveItem:{opacity:1},info:{translateX:xt},status:{opacity:1,translateX:xt}},DID_LOAD_ITEM:Ft,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:xt},status:{translateX:xt}},DID_START_ITEM_PROCESSING:kt,DID_REQUEST_ITEM_PROCESSING:kt,DID_UPDATE_ITEM_PROCESS_PROGRESS:kt,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:xt}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:xt},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:Ft},Vt=b({create:function(e){var t=e.root;t.element.innerHTML=t.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),Bt=w({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function(e){var t=e.root,n=e.action;t.ref.buttonAbortItemProcessing.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function(e){var t=e.root,n=e.action;t.ref.buttonAbortItemLoad.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function(e){var t=e.root,n=e.action;t.ref.buttonAbortItemRemoval.label=n.value},DID_REQUEST_ITEM_PROCESSING:function(e){var t=e.root;t.ref.processProgressIndicator.spin=!0,t.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function(e){var t=e.root;t.ref.loadProgressIndicator.spin=!0,t.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function(e){var t=e.root;t.ref.processProgressIndicator.spin=!0,t.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function(e){var t=e.root,n=e.action;t.ref.loadProgressIndicator.spin=!1,t.ref.loadProgressIndicator.progress=n.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(e){var t=e.root,n=e.action;t.ref.processProgressIndicator.spin=!1,t.ref.processProgressIndicator.progress=n.progress}}),jt=b({create:function(e){var n,r=e.root,i=e.props,o=Object.keys(Ct).reduce((function(e,t){return e[t]=Object.assign({},Ct[t]),e}),{}),a=i.id,s=r.query("GET_ALLOW_REVERT"),l=r.query("GET_ALLOW_REMOVE"),u=r.query("GET_ALLOW_PROCESS"),c=r.query("GET_INSTANT_UPLOAD"),d=r.query("IS_ASYNC"),f=r.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");d?u&&!s?n=function(e){return!/RevertItemProcessing/.test(e)}:!u&&s?n=function(e){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(e)}:u||s||(n=function(e){return!/Process/.test(e)}):n=function(e){return!/Process/.test(e)};var p=n?At.filter(n):At.concat();if(c&&s&&(o.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",o.RevertItemProcessing.icon="GET_ICON_REMOVE"),d&&!s){var h=Ut.DID_COMPLETE_ITEM_PROCESSING;h.info.translateX=Mt,h.info.translateY=Pt,h.status.translateY=Pt,h.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(d&&!u&&(["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach((function(e){Ut[e].status.translateY=Pt})),Ut.DID_THROW_ITEM_PROCESSING_ERROR.status.translateX=Lt),f&&s){o.RevertItemProcessing.align="BUTTON_REMOVE_ITEM_POSITION";var m=Ut.DID_COMPLETE_ITEM_PROCESSING;m.info.translateX=xt,m.status.translateY=Pt,m.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}l||(o.RemoveItem.disabled=!0),t(o,(function(e,t){var n=r.createChildView(vt,{label:r.query(t.label),icon:r.query(t.icon),opacity:0});p.includes(e)&&r.appendChildView(n),t.disabled&&(n.element.setAttribute("disabled","disabled"),n.element.setAttribute("hidden","hidden")),n.element.dataset.align=r.query("GET_STYLE_"+t.align),n.element.classList.add(t.className),n.on("click",(function(e){e.stopPropagation(),t.disabled||r.dispatch(t.action,{query:a})})),r.ref["button"+e]=n})),r.ref.processingCompleteIndicator=r.appendChildView(r.createChildView(Vt)),r.ref.processingCompleteIndicator.element.dataset.align=r.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION"),r.ref.info=r.appendChildView(r.createChildView(It,{id:a})),r.ref.status=r.appendChildView(r.createChildView(Rt,{id:a}));var g=r.appendChildView(r.createChildView(gt,{opacity:0,align:r.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));g.element.classList.add("filepond--load-indicator"),r.ref.loadProgressIndicator=g;var v=r.appendChildView(r.createChildView(gt,{opacity:0,align:r.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));v.element.classList.add("filepond--process-indicator"),r.ref.processProgressIndicator=v,r.ref.activeStyles=[]},write:function(e){var n=e.root,r=e.actions,i=e.props;Bt({root:n,actions:r,props:i});var o=r.concat().filter((function(e){return/^DID_/.test(e.type)})).reverse().find((function(e){return Ut[e.type]}));if(o){n.ref.activeStyles=[];var a=Ut[o.type];t(Gt,(function(e,r){var i=n.ref[e];t(r,(function(t,r){var o=a[e]&&void 0!==a[e][t]?a[e][t]:r;n.ref.activeStyles.push({control:i,key:t,value:o})}))}))}n.ref.activeStyles.forEach((function(e){var t=e.control,r=e.key,i=e.value;t[r]="function"==typeof i?i(n):i}))},didCreateView:function(e){pe("CREATE_VIEW",Object.assign({},e,{view:e}))},name:"file"}),qt=b({create:function(e){var t=e.root,n=e.props;t.ref.fileName=pt("legend"),t.appendChild(t.ref.fileName),t.ref.file=t.appendChildView(t.createChildView(jt,{id:n.id})),t.ref.data=!1},ignoreRect:!0,write:w({DID_LOAD_ITEM:function(e){var t=e.root,n=e.props;ht(t.ref.fileName,t.query("GET_ITEM_NAME",n.id))}}),didCreateView:function(e){pe("CREATE_VIEW",Object.assign({},e,{view:e}))},tag:"fieldset",name:"file-wrapper"}),Ht={type:"spring",damping:.6,mass:7},Wt=b({name:"panel",read:function(e){var t=e.root;return e.props.heightCurrent=t.ref.bottom.translateY},write:function(e){var t=e.root,n=e.props;if(null!==t.ref.scalable&&n.scalable===t.ref.scalable||(t.ref.scalable=!x(n.scalable)||n.scalable,t.element.dataset.scalable=t.ref.scalable),n.height){var r=t.ref.top.rect.element,i=t.ref.bottom.rect.element,o=Math.max(r.height+i.height,n.height);t.ref.center.translateY=r.height,t.ref.center.scaleY=(o-r.height-i.height)/100,t.ref.bottom.translateY=o-i.height}},create:function(e){var t=e.root,n=e.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:Ht},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:Ht},styles:["translateY"]}}].forEach((function(e){!function(e,t,n){var r=b({name:"panel-"+t.name+" filepond--"+n,mixins:t.mixins,ignoreRectUpdate:!0}),i=e.createChildView(r,t.props);e.ref[t.name]=e.appendChildView(i)}(t,e,n.name)})),t.element.classList.add("filepond--"+n.name),t.ref.scalable=null},ignoreRect:!0,mixins:{apis:["height","heightCurrent","scalable"]}}),Yt={type:"spring",stiffness:.75,damping:.45,mass:10},zt={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"},Xt=w({DID_UPDATE_PANEL_HEIGHT:function(e){var t=e.root,n=e.action;t.height=n.height}}),$t=w({DID_GRAB_ITEM:function(e){var t=e.root;e.props.dragOrigin={x:t.translateX,y:t.translateY}},DID_DRAG_ITEM:function(e){e.root.element.dataset.dragState="drag"},DID_DROP_ITEM:function(e){var t=e.root,n=e.props;n.dragOffset=null,n.dragOrigin=null,t.element.dataset.dragState="drop"}},(function(e){var t=e.root,n=e.actions,r=e.props,i=e.shouldOptimize;"drop"===t.element.dataset.dragState&&t.scaleX<=1&&(t.element.dataset.dragState="idle");var o=n.concat().filter((function(e){return/^DID_/.test(e.type)})).reverse().find((function(e){return zt[e.type]}));o&&o.type!==r.currentState&&(r.currentState=o.type,t.element.dataset.filepondItemState=zt[r.currentState]||"");var a=t.query("GET_ITEM_PANEL_ASPECT_RATIO")||t.query("GET_PANEL_ASPECT_RATIO");a?i||(t.height=t.rect.element.width*a):(Xt({root:t,actions:n,props:r}),!t.height&&t.ref.container.rect.element.height>0&&(t.height=t.ref.container.rect.element.height)),i&&(t.ref.panel.height=null),t.ref.panel.height=t.height})),Kt=b({create:function(e){var t=e.root,n=e.props;t.ref.handleClick=function(e){return t.dispatch("DID_ACTIVATE_ITEM",{id:n.id})},t.element.id="filepond--item-"+n.id,t.element.addEventListener("click",t.ref.handleClick),t.ref.container=t.appendChildView(t.createChildView(qt,{id:n.id})),t.ref.panel=t.appendChildView(t.createChildView(Wt,{name:"item-panel"})),t.ref.panel.height=null,n.markedForRemoval=!1,t.query("GET_ALLOW_REORDER")&&(t.element.dataset.dragState="idle",t.element.addEventListener("pointerdown",(function(e){if(e.isPrimary){var r=!1,i=e.pageX,o=e.pageY;n.dragOrigin={x:t.translateX,y:t.translateY},n.dragCenter={x:e.offsetX,y:e.offsetY};var a,s,l,u=(a=t.query("GET_ACTIVE_ITEMS"),s=a.map((function(e){return e.id})),l=void 0,{setIndex:function(e){l=e},getIndex:function(){return l},getItemIndex:function(e){return s.indexOf(e.id)}});t.dispatch("DID_GRAB_ITEM",{id:n.id,dragState:u});var c=function(e){e.isPrimary&&(e.stopPropagation(),e.preventDefault(),n.dragOffset={x:e.pageX-i,y:e.pageY-o},n.dragOffset.x*n.dragOffset.x+n.dragOffset.y*n.dragOffset.y>16&&!r&&(r=!0,t.element.removeEventListener("click",t.ref.handleClick)),t.dispatch("DID_DRAG_ITEM",{id:n.id,dragState:u}))},d=function(e){e.isPrimary&&(n.dragOffset={x:e.pageX-i,y:e.pageY-o},p())},f=function(){p()},p=function(){document.removeEventListener("pointercancel",f),document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",d),t.dispatch("DID_DROP_ITEM",{id:n.id,dragState:u}),r&&setTimeout((function(){return t.element.addEventListener("click",t.ref.handleClick)}),0)};document.addEventListener("pointercancel",f),document.addEventListener("pointermove",c),document.addEventListener("pointerup",d)}})))},write:$t,destroy:function(e){var t=e.root,n=e.props;t.element.removeEventListener("click",t.ref.handleClick),t.dispatch("RELEASE_ITEM",{query:n.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:"spring",scaleY:"spring",translateX:Yt,translateY:Yt,opacity:{type:"tween",duration:150}}}}),Qt=function(e,t){return Math.max(1,Math.floor((e+1)/t))},Zt=function(e,t,n){if(n){var r=e.rect.element.width,i=t.length,o=null;if(0===i||n.top<t[0].rect.element.top)return-1;var a=t[0].rect.element,s=a.marginLeft+a.marginRight,l=a.width+s,u=Qt(r,l);if(1===u){for(var c=0;c<i;c++){var d=t[c],f=d.rect.outer.top+.5*d.rect.element.height;if(n.top<f)return c}return i}for(var p=a.marginTop+a.marginBottom,h=a.height+p,m=0;m<i;m++){var g=m%u*l,v=Math.floor(m/u)*h,E=v-a.marginTop,_=g+l,y=v+h+a.marginBottom;if(n.top<y&&n.top>E){if(n.left<_)return m;o=m!==i-1?m:null}}return null!==o?o:i}},Jt={height:0,width:0,get getHeight(){return this.height},set setHeight(e){0!==this.height&&0!==e||(this.height=e)},get getWidth(){return this.width},set setWidth(e){0!==this.width&&0!==e||(this.width=e)},setDimensions:function(e,t){0!==this.height&&0!==e||(this.height=e),0!==this.width&&0!==t||(this.width=t)}},en=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;e.dragOffset?(e.translateX=null,e.translateY=null,e.translateX=e.dragOrigin.x+e.dragOffset.x,e.translateY=e.dragOrigin.y+e.dragOffset.y,e.scaleX=1.025,e.scaleY=1.025):(e.translateX=t,e.translateY=n,Date.now()>e.spawnDate&&(0===e.opacity&&tn(e,t,n,r,i),e.scaleX=1,e.scaleY=1,e.opacity=1))},tn=function(e,t,n,r,i){5===e.interactionMethod?(e.translateX=null,e.translateX=t,e.translateY=null,e.translateY=n):2===e.interactionMethod?(e.translateX=null,e.translateX=t-20*r,e.translateY=null,e.translateY=n-10*i,e.scaleX=.8,e.scaleY=.8):3===e.interactionMethod?(e.translateY=null,e.translateY=n-30):1===e.interactionMethod&&(e.translateX=null,e.translateX=t-30,e.translateY=null)},nn=function(e){return e.rect.element.height+.5*e.rect.element.marginBottom+.5*e.rect.element.marginTop},rn=w({DID_ADD_ITEM:function(e){var t=e.root,n=e.action,r=n.id,i=n.index,o=n.interactionMethod;t.ref.addIndex=i;var a=Date.now(),s=a,l=1;if(5!==o){l=0;var u=t.query("GET_ITEM_INSERT_INTERVAL"),c=a-t.ref.lastItemSpanwDate;s=c<u?a+(u-c):a}t.ref.lastItemSpanwDate=s,t.appendChildView(t.createChildView(Kt,{spawnDate:s,id:r,opacity:l,interactionMethod:o}),i)},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action.id,r=t.childViews.find((function(e){return e.id===n}));r&&(r.scaleX=.9,r.scaleY=.9,r.opacity=0,r.markedForRemoval=!0)},DID_DRAG_ITEM:function(e){var t=e.root,n=e.action,r=n.id,i=n.dragState,o=t.query("GET_ITEM",{id:r}),a=t.childViews.find((function(e){return e.id===r})),s=t.childViews.length,l=i.getItemIndex(o);if(a){var u,c=a.dragOrigin.x+a.dragOffset.x+a.dragCenter.x,d=a.dragOrigin.y+a.dragOffset.y+a.dragCenter.y,f=nn(a),p=(u=a).rect.element.width+.5*u.rect.element.marginLeft+.5*u.rect.element.marginRight,h=Math.floor(t.rect.outer.width/p);h>s&&(h=s);var m=Math.floor(s/h+1);Jt.setHeight=f*m,Jt.setWidth=p*h;var g={y:Math.floor(d/f),x:Math.floor(c/p),getGridIndex:function(){return d>Jt.getHeight||d<0||c>Jt.getWidth||c<0?l:this.y*h+this.x},getColIndex:function(){for(var e=t.query("GET_ACTIVE_ITEMS"),n=t.childViews.filter((function(e){return e.rect.element.height})),r=e.map((function(e){return n.find((function(t){return t.id===e.id}))})),i=r.findIndex((function(e){return e===a})),o=nn(a),s=r.length,l=s,u=0,c=0,f=0,p=0;p<s;p++)if(u=nn(r[p]),d<(c=(f=c)+u)){if(i>p){if(d<f+o){l=p;break}continue}l=p;break}return l}},v=h>1?g.getGridIndex():g.getColIndex();t.dispatch("MOVE_ITEM",{query:a,index:v});var E=i.getIndex();if(void 0===E||E!==v){if(i.setIndex(v),void 0===E)return;t.dispatch("DID_REORDER_ITEMS",{items:t.query("GET_ACTIVE_ITEMS"),origin:l,target:v})}}}}),on=b({create:function(e){var t=e.root;r(t.element,"role","list"),t.ref.lastItemSpanwDate=Date.now()},write:function(e){var t=e.root,n=e.props,r=e.actions,i=e.shouldOptimize;rn({root:t,props:n,actions:r});var o=n.dragCoordinates,a=t.rect.element.width,s=t.childViews.filter((function(e){return e.rect.element.height})),l=t.query("GET_ACTIVE_ITEMS").map((function(e){return s.find((function(t){return t.id===e.id}))})).filter((function(e){return e})),u=o?Zt(t,l,o):null,c=t.ref.addIndex||null;t.ref.addIndex=null;var d=0,f=0,p=0;if(0!==l.length){var h=l[0].rect.element,m=h.marginTop+h.marginBottom,g=h.marginLeft+h.marginRight,v=h.width+g,E=h.height+m,_=Qt(a,v);if(1===_){var y=0,T=0;l.forEach((function(e,t){if(u){var n=t-u;T=-2===n?.25*-m:-1===n?.75*-m:0===n?.75*m:1===n?.25*m:0}i&&(e.translateX=null,e.translateY=null),e.markedForRemoval||en(e,0,y+T);var r=(e.rect.element.height+m)*(e.markedForRemoval?e.opacity:1);y+=r}))}else{var I=0,b=0;l.forEach((function(e,t){t===u&&(d=1),t===c&&(p+=1),e.markedForRemoval&&e.opacity<.5&&(f-=1);var n=t+p+d+f,r=n%_,o=Math.floor(n/_),a=r*v,s=o*E,l=Math.sign(a-I),h=Math.sign(s-b);I=a,b=s,e.markedForRemoval||(i&&(e.translateX=null,e.translateY=null),en(e,a,s,l,h))}))}}},tag:"ul",name:"list",didWriteView:function(e){var t=e.root;t.childViews.filter((function(e){return e.markedForRemoval&&0===e.opacity&&e.resting})).forEach((function(e){e._destroy(),t.removeChildView(e)}))},filterFrameActionsForChild:function(e,t){return t.filter((function(t){return!t.data||!t.data.id||e.id===t.data.id}))},mixins:{apis:["dragCoordinates"]}}),an=w({DID_DRAG:function(e){var t=e.root,n=e.props,r=e.action;t.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(n.dragCoordinates={left:r.position.scopeLeft-t.ref.list.rect.element.left,top:r.position.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})},DID_END_DRAG:function(e){e.props.dragCoordinates=null}}),sn=b({create:function(e){var t=e.root,n=e.props;t.ref.list=t.appendChildView(t.createChildView(on)),n.dragCoordinates=null,n.overflowing=!1},write:function(e){var t=e.root,n=e.props,r=e.actions;if(an({root:t,props:n,actions:r}),t.ref.list.dragCoordinates=n.dragCoordinates,n.overflowing&&!n.overflow&&(n.overflowing=!1,t.element.dataset.state="",t.height=null),n.overflow){var i=Math.round(n.overflow);i!==t.height&&(n.overflowing=!0,t.element.dataset.state="overflow",t.height=i)}},name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),ln=function(e,t,n){n?r(e,t,arguments.length>3&&void 0!==arguments[3]?arguments[3]:""):e.removeAttribute(t)},un=function(e){var t=e.root,n=e.action;t.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&ln(t.element,"accept",!!n.value,n.value?n.value.join(","):"")},cn=function(e){var t=e.root,n=e.action;ln(t.element,"multiple",n.value)},dn=function(e){var t=e.root,n=e.action;ln(t.element,"webkitdirectory",n.value)},fn=function(e){var t=e.root,n=t.query("GET_DISABLED"),r=t.query("GET_ALLOW_BROWSE"),i=n||!r;ln(t.element,"disabled",i)},pn=function(e){var t=e.root;e.action.value?0===t.query("GET_TOTAL_ITEMS")&&ln(t.element,"required",!0):ln(t.element,"required",!1)},hn=function(e){var t=e.root,n=e.action;ln(t.element,"capture",!!n.value,!0===n.value?"":n.value)},mn=function(e){var t=e.root,n=t.element;t.query("GET_TOTAL_ITEMS")>0?(ln(n,"required",!1),ln(n,"name",!1)):(ln(n,"name",!0,t.query("GET_NAME")),t.query("GET_CHECK_VALIDITY")&&n.setCustomValidity(""),t.query("GET_REQUIRED")&&ln(n,"required",!0))},gn=b({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:function(e){var t=e.root,n=e.props;t.element.id="filepond--browser-"+n.id,r(t.element,"name",t.query("GET_NAME")),r(t.element,"aria-controls","filepond--assistant-"+n.id),r(t.element,"aria-labelledby","filepond--drop-label-"+n.id),un({root:t,action:{value:t.query("GET_ACCEPTED_FILE_TYPES")}}),cn({root:t,action:{value:t.query("GET_ALLOW_MULTIPLE")}}),dn({root:t,action:{value:t.query("GET_ALLOW_DIRECTORIES_ONLY")}}),fn({root:t}),pn({root:t,action:{value:t.query("GET_REQUIRED")}}),hn({root:t,action:{value:t.query("GET_CAPTURE_METHOD")}}),t.ref.handleChange=function(e){if(t.element.value){var r=Array.from(t.element.files).map((function(e){return e._relativePath=e.webkitRelativePath,e}));setTimeout((function(){n.onload(r),function(e){if(e&&""!==e.value){try{e.value=""}catch(e){}if(e.value){var t=pt("form"),n=e.parentNode,r=e.nextSibling;t.appendChild(e),t.reset(),r?n.insertBefore(e,r):n.appendChild(e)}}}(t.element)}),250)}},t.element.addEventListener("change",t.ref.handleChange)},destroy:function(e){var t=e.root;t.element.removeEventListener("change",t.ref.handleChange)},write:w({DID_LOAD_ITEM:mn,DID_REMOVE_ITEM:mn,DID_THROW_ITEM_INVALID:function(e){var t=e.root;t.query("GET_CHECK_VALIDITY")&&t.element.setCustomValidity(t.query("GET_LABEL_INVALID_FIELD"))},DID_SET_DISABLED:fn,DID_SET_ALLOW_BROWSE:fn,DID_SET_ALLOW_DIRECTORIES_ONLY:dn,DID_SET_ALLOW_MULTIPLE:cn,DID_SET_ACCEPTED_FILE_TYPES:un,DID_SET_CAPTURE_METHOD:hn,DID_SET_REQUIRED:pn})}),vn=function(e,t){e.innerHTML=t;var n=e.querySelector(".filepond--label-action");return n&&r(n,"tabindex","0"),t},En=b({name:"drop-label",ignoreRect:!0,create:function(e){var t=e.root,n=e.props,i=pt("label");r(i,"for","filepond--browser-"+n.id),r(i,"id","filepond--drop-label-"+n.id),r(i,"aria-hidden","true"),t.ref.handleKeyDown=function(e){(13===e.keyCode||32===e.keyCode)&&(e.preventDefault(),t.ref.label.click())},t.ref.handleClick=function(e){e.target===i||i.contains(e.target)||t.ref.label.click()},i.addEventListener("keydown",t.ref.handleKeyDown),t.element.addEventListener("click",t.ref.handleClick),vn(i,n.caption),t.appendChild(i),t.ref.label=i},destroy:function(e){var t=e.root;t.ref.label.addEventListener("keydown",t.ref.handleKeyDown),t.element.removeEventListener("click",t.ref.handleClick)},write:w({DID_SET_LABEL_IDLE:function(e){var t=e.root,n=e.action;vn(t.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),_n=b({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),yn=w({DID_DRAG:function(e){var t=e.root,n=e.action;t.ref.blob?(t.ref.blob.translateX=n.position.scopeLeft,t.ref.blob.translateY=n.position.scopeTop,t.ref.blob.scaleX=1,t.ref.blob.scaleY=1,t.ref.blob.opacity=1):function(e){var t=e.root,n=.5*t.rect.element.width,r=.5*t.rect.element.height;t.ref.blob=t.appendChildView(t.createChildView(_n,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:r}))}({root:t})},DID_DROP:function(e){var t=e.root;t.ref.blob&&(t.ref.blob.scaleX=2.5,t.ref.blob.scaleY=2.5,t.ref.blob.opacity=0)},DID_END_DRAG:function(e){var t=e.root;t.ref.blob&&(t.ref.blob.opacity=0)}}),Tn=b({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:function(e){var t=e.root,n=e.props,r=e.actions;yn({root:t,props:n,actions:r});var i=t.ref.blob;0===r.length&&i&&0===i.opacity&&(t.removeChildView(i),t.ref.blob=null)}}),In=function(e,t){try{var n=new DataTransfer;t.forEach((function(e){e instanceof File?n.items.add(e):n.items.add(new File([e],e.name,{type:e.type}))})),e.files=n.files}catch(e){return!1}return!0},bn=function(e,t){return e.ref.fields[t]},wn=function(e){e.query("GET_ACTIVE_ITEMS").forEach((function(t){e.ref.fields[t.id]&&e.element.appendChild(e.ref.fields[t.id])}))},Sn=function(e){var t=e.root;return wn(t)},Dn=w({DID_SET_DISABLED:function(e){var t=e.root;t.element.disabled=t.query("GET_DISABLED")},DID_ADD_ITEM:function(e){var t=e.root,n=e.action,r=!(t.query("GET_ITEM",n.id).origin===se.LOCAL)&&t.query("SHOULD_UPDATE_FILE_INPUT"),i=pt("input");i.type=r?"file":"hidden",i.name=t.query("GET_NAME"),i.disabled=t.query("GET_DISABLED"),t.ref.fields[n.id]=i,wn(t)},DID_LOAD_ITEM:function(e){var t=e.root,n=e.action,r=bn(t,n.id);if(r&&(null!==n.serverFileReference&&(r.value=n.serverFileReference),t.query("SHOULD_UPDATE_FILE_INPUT"))){var i=t.query("GET_ITEM",n.id);In(r,[i.file])}},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action,r=bn(t,n.id);r&&(r.parentNode&&r.parentNode.removeChild(r),delete t.ref.fields[n.id])},DID_DEFINE_VALUE:function(e){var t=e.root,n=e.action,r=bn(t,n.id);r&&(null===n.value?r.removeAttribute("value"):"file"!=r.type&&(r.value=n.value),wn(t))},DID_PREPARE_OUTPUT:function(e){var t=e.root,n=e.action;t.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout((function(){var e=bn(t,n.id);e&&In(e,[n.file])}),0)},DID_REORDER_ITEMS:Sn,DID_SORT_ITEMS:Sn}),Rn=b({tag:"fieldset",name:"data",create:function(e){return e.root.ref.fields={}},write:Dn,ignoreRect:!0}),Cn=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],An=["css","csv","html","txt"],On={zip:"zip|compressed",epub:"application/epub+zip"},xn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=e.toLowerCase(),Cn.includes(e)?"image/"+("jpg"===e?"jpeg":"svg"===e?"svg+xml":e):An.includes(e)?"text/"+e:On[e]||""},Ln=function(e){return new Promise((function(t,n){var r=jn(e);if(r.length&&!Pn(e))return t(r);Mn(e).then(t)}))},Pn=function(e){return!!e.files&&e.files.length>0},Mn=function(e){return new Promise((function(t,n){var r=(e.items?Array.from(e.items):[]).filter((function(e){return Nn(e)})).map((function(e){return Gn(e)}));r.length?Promise.all(r).then((function(e){var n=[];e.forEach((function(e){n.push.apply(n,e)})),t(n.filter((function(e){return e})).map((function(e){return e._relativePath||(e._relativePath=e.webkitRelativePath),e})))})).catch(console.error):t(e.files?Array.from(e.files):[])}))},Nn=function(e){if(Vn(e)){var t=Bn(e);if(t)return t.isFile||t.isDirectory}return"file"===e.kind},Gn=function(e){return new Promise((function(t,n){Un(e)?Fn(Bn(e)).then(t).catch(n):t([e.getAsFile()])}))},Fn=function(e){return new Promise((function(t,n){var r=[],i=0,o=0,a=function(){0===o&&0===i&&t(r)};!function e(t){i++;var s=t.createReader();!function t(){s.readEntries((function(n){if(0===n.length)return i--,void a();n.forEach((function(t){t.isDirectory?e(t):(o++,t.file((function(e){var n=kn(e);t.fullPath&&(n._relativePath=t.fullPath),r.push(n),o--,a()})))})),t()}),n)}()}(e)}))},kn=function(e){if(e.type.length)return e;var t=e.lastModifiedDate,n=e.name,r=xn(Pe(e.name));return r.length?((e=e.slice(0,e.size,r)).name=n,e.lastModifiedDate=t,e):e},Un=function(e){return Vn(e)&&(Bn(e)||{}).isDirectory},Vn=function(e){return"webkitGetAsEntry"in e},Bn=function(e){return e.webkitGetAsEntry()},jn=function(e){var t=[];try{if((t=Hn(e)).length)return t;t=qn(e)}catch(e){}return t},qn=function(e){var t=e.getData("url");return"string"==typeof t&&t.length?[t]:[]},Hn=function(e){var t=e.getData("text/html");if("string"==typeof t&&t.length){var n=t.match(/src\s*=\s*"(.+?)"/);if(n)return[n[1]]}return[]},Wn=[],Yn=function(e){return{pageLeft:e.pageX,pageTop:e.pageY,scopeLeft:e.offsetX||e.layerX,scopeTop:e.offsetY||e.layerY}},zn=function(e){var n=[],r={dragenter:Qn,dragover:Zn,dragleave:er,drop:Jn},i={};t(r,(function(t,r){i[t]=r(e,n),e.addEventListener(t,i[t],!1)}));var o={element:e,addListener:function(a){return n.push(a),function(){n.splice(n.indexOf(a),1),0===n.length&&(Wn.splice(Wn.indexOf(o),1),t(r,(function(t){e.removeEventListener(t,i[t],!1)})))}}};return o},Xn=function(e,t){var n,r=function(e,t){return"elementFromPoint"in e||(e=document),e.elementFromPoint(t.x,t.y)}("getRootNode"in(n=t)?n.getRootNode():document,{x:e.pageX-window.pageXOffset,y:e.pageY-window.pageYOffset});return r===t||t.contains(r)},$n=null,Kn=function(e,t){try{e.dropEffect=t}catch(e){}},Qn=function(e,t){return function(e){e.preventDefault(),$n=e.target,t.forEach((function(t){var n=t.element,r=t.onenter;Xn(e,n)&&(t.state="enter",r(Yn(e)))}))}},Zn=function(e,t){return function(e){e.preventDefault();var n=e.dataTransfer;Ln(n).then((function(r){var i=!1;t.some((function(t){var o=t.filterElement,a=t.element,s=t.onenter,l=t.onexit,u=t.ondrag,c=t.allowdrop;Kn(n,"copy");var d=c(r);if(d)if(Xn(e,a)){if(i=!0,null===t.state)return t.state="enter",void s(Yn(e));if(t.state="over",o&&!d)return void Kn(n,"none");u(Yn(e))}else o&&!i&&Kn(n,"none"),t.state&&(t.state=null,l(Yn(e)));else Kn(n,"none")}))}))}},Jn=function(e,t){return function(e){e.preventDefault();var n=e.dataTransfer;Ln(n).then((function(n){t.forEach((function(t){var r=t.filterElement,i=t.element,o=t.ondrop,a=t.onexit,s=t.allowdrop;if(t.state=null,!r||Xn(e,i))return s(n)?void o(Yn(e),n):a(Yn(e))}))}))}},er=function(e,t){return function(e){$n===e.target&&t.forEach((function(t){var n=t.onexit;t.state=null,n(Yn(e))}))}},tr=function(e,t,n){e.classList.add("filepond--hopper");var r=n.catchesDropsOnPage,i=n.requiresDropOnElement,o=n.filterItems,a=void 0===o?function(e){return e}:o,s=function(e,t,n){var r=function(e){var t=Wn.find((function(t){return t.element===e}));if(t)return t;var n=zn(e);return Wn.push(n),n}(t),i={element:e,filterElement:n,state:null,ondrop:function(){},onenter:function(){},ondrag:function(){},onexit:function(){},onload:function(){},allowdrop:function(){}};return i.destroy=r.addListener(i),i}(e,r?document.documentElement:e,i),l="",u="";s.allowdrop=function(e){return t(a(e))},s.ondrop=function(e,n){var r=a(n);t(r)?(u="drag-drop",c.onload(r,e)):c.ondragend(e)},s.ondrag=function(e){c.ondrag(e)},s.onenter=function(e){u="drag-over",c.ondragstart(e)},s.onexit=function(e){u="drag-exit",c.ondragend(e)};var c={updateHopperState:function(){l!==u&&(e.dataset.hopperState=u,l=u)},onload:function(){},ondragstart:function(){},ondrag:function(){},ondragend:function(){},destroy:function(){s.destroy()}};return c},nr=!1,rr=[],ir=function(e){var t=document.activeElement;if(t&&/textarea|input/i.test(t.nodeName)){for(var n=!1,r=t;r!==document.body;){if(r.classList.contains("filepond--root")){n=!0;break}r=r.parentNode}if(!n)return}Ln(e.clipboardData).then((function(e){e.length&&rr.forEach((function(t){return t(e)}))}))},or=null,ar=null,sr=[],lr=function(e,t){e.element.textContent=t},ur=function(e,t,n){var r=e.query("GET_TOTAL_ITEMS");lr(e,n+" "+t+", "+r+" "+(1===r?e.query("GET_LABEL_FILE_COUNT_SINGULAR"):e.query("GET_LABEL_FILE_COUNT_PLURAL"))),clearTimeout(ar),ar=setTimeout((function(){!function(e){e.element.textContent=""}(e)}),1500)},cr=function(e){return e.element.parentNode.contains(document.activeElement)},dr=function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename,i=t.query("GET_LABEL_FILE_PROCESSING_ABORTED");lr(t,r+" "+i)},fr=function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename;lr(t,n.status.main+" "+r+" "+n.status.sub)},pr=b({create:function(e){var t=e.root,n=e.props;t.element.id="filepond--assistant-"+n.id,r(t.element,"role","status"),r(t.element,"aria-live","polite"),r(t.element,"aria-relevant","additions")},ignoreRect:!0,ignoreRectUpdate:!0,write:w({DID_LOAD_ITEM:function(e){var t=e.root,n=e.action;if(cr(t)){t.element.textContent="";var r=t.query("GET_ITEM",n.id);sr.push(r.filename),clearTimeout(or),or=setTimeout((function(){ur(t,sr.join(", "),t.query("GET_LABEL_FILE_ADDED")),sr.length=0}),750)}},DID_REMOVE_ITEM:function(e){var t=e.root,n=e.action;if(cr(t)){var r=n.item;ur(t,r.filename,t.query("GET_LABEL_FILE_REMOVED"))}},DID_COMPLETE_ITEM_PROCESSING:function(e){var t=e.root,n=e.action,r=t.query("GET_ITEM",n.id).filename,i=t.query("GET_LABEL_FILE_PROCESSING_COMPLETE");lr(t,r+" "+i)},DID_ABORT_ITEM_PROCESSING:dr,DID_REVERT_ITEM_PROCESSING:dr,DID_THROW_ITEM_REMOVE_ERROR:fr,DID_THROW_ITEM_LOAD_ERROR:fr,DID_THROW_ITEM_INVALID:fr,DID_THROW_ITEM_PROCESSING_ERROR:fr}),tag:"span",name:"assistant"}),hr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(new RegExp(t+".","g"),(function(e){return e.charAt(1).toUpperCase()}))},mr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Date.now(),i=null;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];clearTimeout(i);var l=Date.now()-r,u=function(){r=Date.now(),e.apply(void 0,a)};l<t?n||(i=setTimeout(u,t-l)):u()}},gr=function(e){return e.preventDefault()},vr=function(e,t){var n=e.query("GET_ALLOW_REPLACE"),r=e.query("GET_ALLOW_MULTIPLE"),i=e.query("GET_TOTAL_ITEMS"),o=e.query("GET_MAX_FILES"),a=t.length;return!r&&a>1?(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:Ye("warning",0,"Max files")}),!0):!(!r&&n||!(F(o=r?o:1)&&i+a>o)||(e.dispatch("DID_THROW_MAX_FILES",{source:t,error:Ye("warning",0,"Max files")}),0))},Er=function(e,t,n){var r=e.childViews[0];return Zt(r,t,{left:n.scopeLeft-r.rect.element.left,top:n.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},_r=function(e){var t=e.query("GET_ALLOW_DROP"),n=e.query("GET_DISABLED"),r=t&&!n;if(r&&!e.ref.hopper){var i=tr(e.element,(function(t){var n=e.query("GET_BEFORE_DROP_FILE")||function(){return!0};return!e.query("GET_DROP_VALIDATION")||t.every((function(t){return pe("ALLOW_HOPPER_ITEM",t,{query:e.query}).every((function(e){return!0===e}))&&n(t)}))}),{filterItems:function(t){var n=e.query("GET_IGNORED_FILES");return t.filter((function(e){return!tt(e)||!n.includes(e.name.toLowerCase())}))},catchesDropsOnPage:e.query("GET_DROP_ON_PAGE"),requiresDropOnElement:e.query("GET_DROP_ON_ELEMENT")});i.onload=function(t,n){var r=e.ref.list.childViews[0].childViews.filter((function(e){return e.rect.element.height})),i=e.query("GET_ACTIVE_ITEMS").map((function(e){return r.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));fe("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(vr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:Er(e.ref.list,i,n),interactionMethod:2})})),e.dispatch("DID_DROP",{position:n}),e.dispatch("DID_END_DRAG",{position:n})},i.ondragstart=function(t){e.dispatch("DID_START_DRAG",{position:t})},i.ondrag=mr((function(t){e.dispatch("DID_DRAG",{position:t})})),i.ondragend=function(t){e.dispatch("DID_END_DRAG",{position:t})},e.ref.hopper=i,e.ref.drip=e.appendChildView(e.createChildView(Tn))}else!r&&e.ref.hopper&&(e.ref.hopper.destroy(),e.ref.hopper=null,e.removeChildView(e.ref.drip))},yr=function(e,t){var n=e.query("GET_ALLOW_BROWSE"),r=e.query("GET_DISABLED"),i=n&&!r;i&&!e.ref.browser?e.ref.browser=e.appendChildView(e.createChildView(gn,Object.assign({},t,{onload:function(t){fe("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(vr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:3})}))}})),0):!i&&e.ref.browser&&(e.removeChildView(e.ref.browser),e.ref.browser=null)},Tr=function(e){var t=e.query("GET_ALLOW_PASTE"),n=e.query("GET_DISABLED"),r=t&&!n;r&&!e.ref.paster?(e.ref.paster=function(){var e=function(e){t.onload(e)},t={destroy:function(){var t;t=e,te(rr,rr.indexOf(t)),0===rr.length&&(document.removeEventListener("paste",ir),nr=!1)},onload:function(){}};return function(e){rr.includes(e)||(rr.push(e),nr||(nr=!0,document.addEventListener("paste",ir)))}(e),t}(),e.ref.paster.onload=function(t){fe("ADD_ITEMS",t,{dispatch:e.dispatch}).then((function(t){if(vr(e,t))return!1;e.dispatch("ADD_ITEMS",{items:t,index:-1,interactionMethod:4})}))}):!r&&e.ref.paster&&(e.ref.paster.destroy(),e.ref.paster=null)},Ir=w({DID_SET_ALLOW_BROWSE:function(e){var t=e.root,n=e.props;yr(t,n)},DID_SET_ALLOW_DROP:function(e){var t=e.root;_r(t)},DID_SET_ALLOW_PASTE:function(e){var t=e.root;Tr(t)},DID_SET_DISABLED:function(e){var t=e.root,n=e.props;_r(t),Tr(t),yr(t,n),t.query("GET_DISABLED")?t.element.dataset.disabled="disabled":t.element.removeAttribute("data-disabled")}}),br=b({name:"root",read:function(e){var t=e.root;t.ref.measure&&(t.ref.measureHeight=t.ref.measure.offsetHeight)},create:function(e){var t=e.root,n=e.props,r=t.query("GET_ID");r&&(t.element.id=r);var i=t.query("GET_CLASS_NAME");i&&i.split(" ").filter((function(e){return e.length})).forEach((function(e){t.element.classList.add(e)})),t.ref.label=t.appendChildView(t.createChildView(En,Object.assign({},n,{translateY:null,caption:t.query("GET_LABEL_IDLE")}))),t.ref.list=t.appendChildView(t.createChildView(sn,{translateY:null})),t.ref.panel=t.appendChildView(t.createChildView(Wt,{name:"panel-root"})),t.ref.assistant=t.appendChildView(t.createChildView(pr,Object.assign({},n))),t.ref.data=t.appendChildView(t.createChildView(Rn,Object.assign({},n))),t.ref.measure=pt("div"),t.ref.measure.style.height="100%",t.element.appendChild(t.ref.measure),t.ref.bounds=null,t.query("GET_STYLES").filter((function(e){return!C(e.value)})).map((function(e){var n=e.name,r=e.value;t.element.dataset[n]=r})),t.ref.widthPrevious=null,t.ref.widthUpdated=mr((function(){t.ref.updateHistory=[],t.dispatch("DID_RESIZE_ROOT")}),250),t.ref.previousAspectRatio=null,t.ref.updateHistory=[];var o=window.matchMedia("(pointer: fine) and (hover: hover)").matches,a="PointerEvent"in window;t.query("GET_ALLOW_REORDER")&&a&&!o&&(t.element.addEventListener("touchmove",gr,{passive:!1}),t.element.addEventListener("gesturestart",gr));var s=t.query("GET_CREDITS");if(2===s.length){var l=document.createElement("a");l.className="filepond--credits",l.setAttribute("aria-hidden","true"),l.href=s[0],l.tabindex=-1,l.target="_blank",l.rel="noopener noreferrer",l.textContent=s[1],t.element.appendChild(l),t.ref.credits=l}},write:function(e){var t=e.root,n=e.props,r=e.actions;if(Ir({root:t,props:n,actions:r}),r.filter((function(e){return/^DID_SET_STYLE_/.test(e.type)})).filter((function(e){return!C(e.data.value)})).map((function(e){var n=e.type,r=e.data,i=hr(n.substring(8).toLowerCase(),"_");t.element.dataset[i]=r.value,t.invalidateLayout()})),!t.rect.element.hidden){t.rect.element.width!==t.ref.widthPrevious&&(t.ref.widthPrevious=t.rect.element.width,t.ref.widthUpdated());var i=t.ref.bounds;i||(i=t.ref.bounds=function(e){var t=e.ref.measureHeight||null;return{cappedHeight:parseInt(e.style.maxHeight,10)||null,fixedHeight:0===t?null:t}}(t),t.element.removeChild(t.ref.measure),t.ref.measure=null);var o=t.ref,a=o.hopper,s=o.label,l=o.list,u=o.panel;a&&a.updateHopperState();var c=t.query("GET_PANEL_ASPECT_RATIO"),d=t.query("GET_ALLOW_MULTIPLE"),f=t.query("GET_TOTAL_ITEMS"),p=f===(d?t.query("GET_MAX_FILES")||1e6:1),h=r.find((function(e){return"DID_ADD_ITEM"===e.type}));if(p&&h){var m=h.data.interactionMethod;s.opacity=0,d?s.translateY=-40:1===m?s.translateX=40:s.translateY=3===m?40:30}else p||(s.opacity=1,s.translateX=0,s.translateY=0);var g=function(e){var t=e.ref.list.childViews[0].childViews[0];return t?{top:t.rect.element.marginTop,bottom:t.rect.element.marginBottom}:{top:0,bottom:0}}(t),v=function(e){var t=0,n=0,r=e.ref.list,i=r.childViews[0],o=i.childViews.filter((function(e){return e.rect.element.height})),a=e.query("GET_ACTIVE_ITEMS").map((function(e){return o.find((function(t){return t.id===e.id}))})).filter((function(e){return e}));if(0===a.length)return{visual:t,bounds:n};var s=i.rect.element.width,l=Zt(i,a,r.dragCoordinates),u=a[0].rect.element,c=u.marginTop+u.marginBottom,d=u.marginLeft+u.marginRight,f=u.width+d,p=u.height+c,h=void 0!==l&&l>=0?1:0,m=a.find((function(e){return e.markedForRemoval&&e.opacity<.45}))?-1:0,g=a.length+h+m,v=Qt(s,f);return 1===v?a.forEach((function(e){var r=e.rect.element.height+c;n+=r,t+=r*e.opacity})):(n=Math.ceil(g/v)*p,t=n),{visual:t,bounds:n}}(t),E=s.rect.element.height,_=!d||p?0:E,y=p?l.rect.element.marginTop:0,T=0===f?0:l.rect.element.marginBottom,I=_+y+v.visual+T,b=_+y+v.bounds+T;if(l.translateY=Math.max(0,_-l.rect.element.marginTop)-g.top,c){var w=t.rect.element.width,S=w*c;c!==t.ref.previousAspectRatio&&(t.ref.previousAspectRatio=c,t.ref.updateHistory=[]);var D=t.ref.updateHistory;if(D.push(w),D.length>4)for(var R=D.length,A=R-10,O=0,x=R;x>=A;x--)if(D[x]===D[x-2]&&O++,O>=2)return;u.scalable=!1,u.height=S;var L=S-_-(T-g.bottom)-(p?y:0);v.visual>L?l.overflow=L:l.overflow=null,t.height=S}else if(i.fixedHeight){u.scalable=!1;var P=i.fixedHeight-_-(T-g.bottom)-(p?y:0);v.visual>P?l.overflow=P:l.overflow=null}else if(i.cappedHeight){var M=I>=i.cappedHeight,N=Math.min(i.cappedHeight,I);u.scalable=!0,u.height=M?N:N-g.top-g.bottom;var G=N-_-(T-g.bottom)-(p?y:0);I>i.cappedHeight&&v.visual>G?l.overflow=G:l.overflow=null,t.height=Math.min(i.cappedHeight,b-g.top-g.bottom)}else{var F=f>0?g.top+g.bottom:0;u.scalable=!0,u.height=Math.max(E,I-F),t.height=Math.max(E,b-F)}t.ref.credits&&u.heightCurrent&&(t.ref.credits.style.transform="translateY("+u.heightCurrent+"px)")}},destroy:function(e){var t=e.root;t.ref.paster&&t.ref.paster.destroy(),t.ref.hopper&&t.ref.hopper.destroy(),t.element.removeEventListener("touchmove",gr),t.element.removeEventListener("gesturestart",gr)},mixins:{styles:["height"]}}),wr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=null,i=me(),o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=Object.assign({},e),i=[],o=[],a=function(e,t,n){!n||document.hidden?(c[e]&&c[e](t),i.push({type:e,data:t})):o.push({type:e,data:t})},s=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return u[e]?(t=u)[e].apply(t,r):null},l={getState:function(){return Object.assign({},r)},processActionQueue:function(){var e=[].concat(i);return i.length=0,e},processDispatchQueue:function(){var e=[].concat(o);o.length=0,e.forEach((function(e){var t=e.type,n=e.data;a(t,n)}))},dispatch:a,query:s},u={};t.forEach((function(e){u=Object.assign({},e(r),{},u)}));var c={};return n.forEach((function(e){c=Object.assign({},e(a,s,r),{},c)})),l}({items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:W(i)},[Ae,X(i)],[dt,z(i)]);o.dispatch("SET_OPTIONS",{options:e});var a=function(){document.hidden||o.dispatch("KICK")};document.addEventListener("visibilitychange",a);var s=null,l=!1,u=!1,c=null,d=null,f=function(){l||(l=!0),clearTimeout(s),s=setTimeout((function(){l=!1,c=null,d=null,u&&(u=!1,o.dispatch("DID_STOP_RESIZE"))}),500)};window.addEventListener("resize",f);var p=br(o,{id:$()}),h=!1,g=!1,v={_read:function(){l&&(d=window.innerWidth,c||(c=d),u||d===c||(o.dispatch("DID_START_RESIZE"),u=!0)),g&&h&&(h=null===p.element.offsetParent),h||(p._read(),g=p.rect.element.hidden)},_write:function(e){var t,n=o.processActionQueue().filter((function(e){return!/^SET_/.test(e.type)}));h&&!n.length||(T(n),h=p._write(e,n,u),(t=o.query("GET_ITEMS")).forEach((function(e,n){e.released&&te(t,n)})),h&&o.processDispatchQueue())}},E=function(e){return function(t){var n={type:e};if(!t)return n;if(t.hasOwnProperty("error")&&(n.error=t.error?Object.assign({},t.error):null),t.status&&(n.status=Object.assign({},t.status)),t.file&&(n.output=t.file),t.source)n.file=t.source;else if(t.item||t.id){var r=t.item?t.item:o.query("GET_ITEM",t.id);n.file=r?oe(r):null}return t.items&&(n.items=t.items.map(oe)),/progress/.test(e)&&(n.progress=t.progress),t.hasOwnProperty("origin")&&t.hasOwnProperty("target")&&(n.origin=t.origin,n.target=t.target),n}},_={DID_DESTROY:E("destroy"),DID_INIT:E("init"),DID_THROW_MAX_FILES:E("warning"),DID_INIT_ITEM:E("initfile"),DID_START_ITEM_LOAD:E("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:E("addfileprogress"),DID_LOAD_ITEM:E("addfile"),DID_THROW_ITEM_INVALID:[E("error"),E("addfile")],DID_THROW_ITEM_LOAD_ERROR:[E("error"),E("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[E("error"),E("removefile")],DID_PREPARE_OUTPUT:E("preparefile"),DID_START_ITEM_PROCESSING:E("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:E("processfileprogress"),DID_ABORT_ITEM_PROCESSING:E("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:E("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:E("processfiles"),DID_REVERT_ITEM_PROCESSING:E("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[E("error"),E("processfile")],DID_REMOVE_ITEM:E("removefile"),DID_UPDATE_ITEMS:E("updatefiles"),DID_ACTIVATE_ITEM:E("activatefile"),DID_REORDER_ITEMS:E("reorderfiles")},y=function(e){var t=Object.assign({pond:O},e);delete t.type,p.element.dispatchEvent(new CustomEvent("FilePond:"+e.type,{detail:t,bubbles:!0,cancelable:!0,composed:!0}));var n=[];e.hasOwnProperty("error")&&n.push(e.error),e.hasOwnProperty("file")&&n.push(e.file);var r=["type","error","file"];Object.keys(e).filter((function(e){return!r.includes(e)})).forEach((function(t){return n.push(e[t])})),O.fire.apply(O,[e.type].concat(n));var i=o.query("GET_ON"+e.type.toUpperCase());i&&i.apply(void 0,n)},T=function(e){e.length&&e.filter((function(e){return _[e.type]})).forEach((function(e){var t=_[e.type];(Array.isArray(t)?t:[t]).forEach((function(t){"DID_INIT_ITEM"===e.type?y(t(e.data)):setTimeout((function(){y(t(e.data))}),0)}))}))},I=function(e){return new Promise((function(t,n){o.dispatch("REQUEST_ITEM_PREPARE",{query:e,success:function(e){t(e)},failure:function(e){n(e)}})}))},b=function(e,t){var n;return"object"!=typeof e||(n=e).file&&n.id||t||(t=e,e=void 0),o.dispatch("REMOVE_ITEM",Object.assign({},t,{query:e})),null===o.query("GET_ACTIVE_ITEM",e)},w=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Promise((function(e,n){var r=[],i={};if(R(t[0]))r.push.apply(r,t[0]),Object.assign(i,t[1]||{});else{var a=t[t.length-1];"object"!=typeof a||a instanceof Blob||Object.assign(i,t.pop()),r.push.apply(r,t)}o.dispatch("ADD_ITEMS",{items:r,index:i.index,interactionMethod:1,success:e,failure:n})}))},C=function(){return o.query("GET_ACTIVE_ITEMS")},A=function(e){return new Promise((function(t,n){o.dispatch("REQUEST_ITEM_PROCESSING",{query:e,success:function(e){t(e)},failure:function(e){n(e)}})}))},O=Object.assign({},ne(),{},v,{},function(e,n){var r={};return t(n,(function(t){r[t]={get:function(){return e.getState().options[t]},set:function(n){e.dispatch("SET_"+Y(t,"_").toUpperCase(),{value:n})}}})),r}(o,i),{setOptions:function(e){return o.dispatch("SET_OPTIONS",{options:e})},addFile:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){w([{source:e,options:t}],{index:t.index}).then((function(e){return n(e&&e[0])})).catch(r)}))},addFiles:w,getFile:function(e){return o.query("GET_ACTIVE_ITEM",e)},processFile:A,prepareFile:I,removeFile:b,moveFile:function(e,t){return o.dispatch("MOVE_ITEM",{query:e,index:t})},getFiles:C,processFiles:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array.isArray(t[0])?t[0]:t;if(!r.length){var i=C().filter((function(e){return!(e.status===ae.IDLE&&e.origin===se.LOCAL)&&e.status!==ae.PROCESSING&&e.status!==ae.PROCESSING_COMPLETE&&e.status!==ae.PROCESSING_REVERT_ERROR}));return Promise.all(i.map(A))}return Promise.all(r.map(A))},removeFiles:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Array.isArray(t[0])?t[0]:t;"object"==typeof i[i.length-1]?r=i.pop():Array.isArray(t[0])&&(r=t[1]);var o=C();return i.length?i.map((function(e){return m(e)?o[e]?o[e].id:null:e})).filter((function(e){return e})).map((function(e){return b(e,r)})):Promise.all(o.map((function(e){return b(e,r)})))},prepareFiles:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Array.isArray(t[0])?t[0]:t,i=r.length?r:C();return Promise.all(i.map(I))},sort:function(e){return o.dispatch("SORT",{compare:e})},browse:function(){var e=p.element.querySelector("input[type=file]");e&&e.click()},destroy:function(){O.fire("destroy",p.element),o.dispatch("ABORT_ALL"),p._destroy(),window.removeEventListener("resize",f),document.removeEventListener("visibilitychange",a),o.dispatch("DID_DESTROY")},insertBefore:function(e){return S(p.element,e)},insertAfter:function(e){return D(p.element,e)},appendTo:function(e){return e.appendChild(p.element)},replaceElement:function(e){S(p.element,e),e.parentNode.removeChild(e),r=e},restoreElement:function(){r&&(D(r,p.element),p.element.parentNode.removeChild(p.element),r=null)},isAttachedTo:function(e){return p.element===e||r===e},element:{get:function(){return p.element}},status:{get:function(){return o.query("GET_STATUS")}}});return o.dispatch("DID_INIT"),n(O)},Sr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={};return t(me(),(function(e,t){n[e]=t[0]})),wr(Object.assign({},n,{},e))},Dr=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];t(e.attributes,(function(t){i.push(e.attributes[t])}));var o=i.filter((function(e){return e.name})).reduce((function(t,n){var i,o=r(e,n.name);return t[(i=n.name,hr(i.replace(/^data-/,"")))]=o===n.name||o,t}),{});return function e(n,r){t(r,(function(r,i){t(n,(function(e,t){var o=new RegExp(r);if(o.test(e)&&(delete n[e],!1!==i))if(P(i))n[i]=t;else{var a,s=i.group;B(i)&&!n[s]&&(n[s]={}),n[s][(a=e.replace(o,""),a.charAt(0).toLowerCase()+a.slice(1))]=t}})),i.mapping&&e(n[i.group],i.mapping)}))}(o,n),o},Rr=function(){return(arguments.length<=0?void 0:arguments[0])instanceof HTMLElement?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};pe("SET_ATTRIBUTE_TO_OPTION_MAP",n);var r=Object.assign({},t),i=Dr("FIELDSET"===e.nodeName?e.querySelector("input[type=file]"):e,n);Object.keys(i).forEach((function(e){B(i[e])?(B(r[e])||(r[e]={}),Object.assign(r[e],i[e])):r[e]=i[e]})),r.files=(t.files||[]).concat(Array.from(e.querySelectorAll("input:not([type=file])")).map((function(e){return{source:e.value,options:{type:e.dataset.type}}})));var o=Sr(r);return e.files&&Array.from(e.files).forEach((function(e){o.addFile(e)})),o.replaceElement(e),o}.apply(void 0,arguments):Sr.apply(void 0,arguments)},Cr=["fire","_read","_write"],Ar=function(e){var t={};return re(e,t,Cr),t},Or=function(e,t){return e.replace(/(?:{([a-zA-Z]+)})/g,(function(e,n){return t[n]}))},xr=function(e){var t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),n=URL.createObjectURL(t),r=new Worker(n);return{transfer:function(e,t){},post:function(e,t,n){var i=$();r.onmessage=function(e){e.data.id===i&&t(e.data.message)},r.postMessage({id:i,message:e},n)},terminate:function(){r.terminate(),URL.revokeObjectURL(n)}}},Lr=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},Pr=function(e,t){var n=e.slice(0,e.size,e.type);return n.lastModifiedDate=e.lastModifiedDate,n.name=t,n},Mr=function(e){return Pr(e,e.name)},Nr=[],Gr=function(e){var n;Nr.includes(e)||(Nr.push(e),n=e({addFilter:he,utils:{Type:ce,forin:t,isString:P,isFile:tt,toNaturalFileSize:Et,replaceInString:Or,getExtensionFromFilename:Pe,getFilenameWithoutExtension:et,guesstimateMimeType:xn,getFileFromBlob:Ge,getFilenameFromURL:Le,createRoute:w,createWorker:xr,createView:b,createItemAPI:oe,loadImage:Lr,copyFile:Mr,renameFile:Pr,createBlob:Fe,applyFilterChain:fe,text:ht,getNumericAspectRatioFromString:Ee},views:{fileActionButton:vt}}).options,Object.assign(ge,n))},Fr=(Ot=c()&&!("[object OperaMini]"===Object.prototype.toString.call(window.operamini))&&"visibilityState"in document&&"Promise"in window&&"slice"in Blob.prototype&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window&&("supports"in(window.CSS||{})||/MSIE|Trident/.test(window.navigator.userAgent)),function(){return Ot}),kr={apps:[]},Ur=function(){};if(e.Status={},e.FileStatus={},e.FileOrigin={},e.OptionTypes={},e.create=Ur,e.destroy=Ur,e.parse=Ur,e.find=Ur,e.registerPlugin=Ur,e.getOptions=Ur,e.setOptions=Ur,Fr()){!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,r="__framePainter";if(window[r])return window[r].readers.push(e),void window[r].writers.push(t);window[r]={readers:[e],writers:[t]};var i=window[r],o=1e3/n,a=null,s=null,l=null,u=null,c=function(){document.hidden?(l=function(){return window.setTimeout((function(){return d(performance.now())}),o)},u=function(){return window.clearTimeout(s)}):(l=function(){return window.requestAnimationFrame(d)},u=function(){return window.cancelAnimationFrame(s)})};document.addEventListener("visibilitychange",(function(){u&&u(),c(),d(performance.now())}));var d=function e(t){s=l(e),a||(a=t);var n=t-a;n<=o||(a=t-n%o,i.readers.forEach((function(e){return e()})),i.writers.forEach((function(e){return e(t)})))};c(),d(performance.now())}((function(){kr.apps.forEach((function(e){return e._read()}))}),(function(e){kr.apps.forEach((function(t){return t._write(e)}))}));var Vr=function t(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:Fr,create:e.create,destroy:e.destroy,parse:e.parse,find:e.find,registerPlugin:e.registerPlugin,setOptions:e.setOptions}})),document.removeEventListener("DOMContentLoaded",t)};"loading"!==document.readyState?setTimeout((function(){return Vr()}),0):document.addEventListener("DOMContentLoaded",Vr);var Br=function(){return t(me(),(function(t,n){e.OptionTypes[t]=n[1]}))};e.Status=Object.assign({},ye),e.FileOrigin=Object.assign({},se),e.FileStatus=Object.assign({},ae),e.OptionTypes={},Br(),e.create=function(){var t=Rr.apply(void 0,arguments);return t.on("destroy",e.destroy),kr.apps.push(t),Ar(t)},e.destroy=function(e){var t=kr.apps.findIndex((function(t){return t.isAttachedTo(e)}));return t>=0&&(kr.apps.splice(t,1)[0].restoreElement(),!0)},e.parse=function(t){return Array.from(t.querySelectorAll(".filepond")).filter((function(e){return!kr.apps.find((function(t){return t.isAttachedTo(e)}))})).map((function(t){return e.create(t)}))},e.find=function(e){var t=kr.apps.find((function(t){return t.isAttachedTo(e)}));return t?Ar(t):null},e.registerPlugin=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(Gr),Br()},e.getOptions=function(){var e={};return t(me(),(function(t,n){e[t]=n[0]})),e},e.setOptions=function(n){return B(n)&&(kr.apps.forEach((function(e){e.setOptions(n)})),function(e){t(e,(function(e,t){ge[e]&&(ge[e][0]=H(t,ge[e][0],ge[e][1]))}))}(n)),e.getOptions()}}e.supported=Fr,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"use strict";function n(n,r,o,s,l){function u(){b=e.devicePixelRatio>1,o=c(o),r.delay>=0&&setTimeout((function(){d(!0)}),r.delay),(r.delay<0||r.combined)&&(s.e=function(e,t){var i,o=0;return function(a,s){function l(){o=+new Date,t.call(n,a)}var u=+new Date-o;i&&clearTimeout(i),u>e||!r.enableThrottle||s?l():i=setTimeout(l,e-u)}}(r.throttle,(function(e){"resize"===e.type&&(T=I=-1),d(e.all)})),s.a=function(e){e=c(e),o.push.apply(o,e)},s.g=function(){return o=i(o).filter((function(){return!i(this).data(r.loadedName)}))},s.f=function(e){for(var t=0;t<e.length;t++){var n=o.filter((function(){return this===e[t]}));n.length&&d(!1,n)}},d(),i(r.appendScroll).on("scroll."+l+" resize."+l,s.e))}function c(e){var o=r.defaultImage,a=r.placeholder,s=r.imageBase,l=r.srcsetAttribute,u=r.loaderAttribute,c=r._f||{};e=i(e).filter((function(){var e=i(this),n=g(this);return!e.data(r.handledName)&&(e.attr(r.attribute)||e.attr(l)||e.attr(u)||c[n]!==t)})).data("plugin_"+r.name,n);for(var d=0,f=e.length;d<f;d++){var p=i(e[d]),h=g(e[d]),m=p.attr(r.imageBaseAttribute)||s;h===R&&m&&p.attr(l)&&p.attr(l,v(p.attr(l),m)),c[h]===t||p.attr(u)||p.attr(u,c[h]),h===R&&o&&!p.attr(C)?p.attr(C,o):h===R||!a||p.css(x)&&"none"!==p.css(x)||p.css(x,"url('"+a+"')")}return e}function d(e,t){if(o.length){for(var a=t||o,s=!1,l=r.imageBase||"",u=r.srcsetAttribute,c=r.handledName,d=0;d<a.length;d++)if(e||t||p(a[d])){var h=i(a[d]),m=g(a[d]),v=h.attr(r.attribute),E=h.attr(r.imageBaseAttribute)||l,_=h.attr(r.loaderAttribute);h.data(c)||r.visibleOnly&&!h.is(":visible")||!((v||h.attr(u))&&(m===R&&(E+v!==h.attr(C)||h.attr(u)!==h.attr(A))||m!==R&&E+v!==h.css(x))||_)||(s=!0,h.data(c,!0),f(h,m,E,_))}s&&(o=i(o).filter((function(){return!i(this).data(c)})))}else r.autoDestroy&&n.destroy()}function f(e,t,n,o){++y;var a=function(){_("onError",e),E(),a=i.noop};_("beforeLoad",e);var s=r.attribute,l=r.srcsetAttribute,u=r.sizesAttribute,c=r.retinaAttribute,d=r.removeAttribute,f=r.loadedName,p=e.attr(c);if(o){var h=function(){d&&e.removeAttr(r.loaderAttribute),e.data(f,!0),_(w,e),setTimeout(E,1),h=i.noop};e.off(D).one(D,a).one(S,h),_(o,e,(function(t){t?(e.off(S),h()):(e.off(D),a())}))||e.trigger(D)}else{var m=i(new Image);m.one(D,a).one(S,(function(){e.hide(),t===R?e.attr(O,m.attr(O)).attr(A,m.attr(A)).attr(C,m.attr(C)):e.css(x,"url('"+m.attr(C)+"')"),e[r.effect](r.effectTime),d&&(e.removeAttr(s+" "+l+" "+c+" "+r.imageBaseAttribute),u!==O&&e.removeAttr(u)),e.data(f,!0),_(w,e),m.remove(),E()}));var g=(b&&p?p:e.attr(s))||"";m.attr(O,e.attr(u)).attr(A,e.attr(l)).attr(C,g?n+g:null),m.complete&&m.trigger(S)}}function p(e){var t=e.getBoundingClientRect(),n=r.scrollDirection,i=r.threshold,o=m()+i>t.top&&-i<t.bottom,a=h()+i>t.left&&-i<t.right;return"vertical"===n?o:("horizontal"===n||o)&&a}function h(){return T>=0?T:T=i(e).width()}function m(){return I>=0?I:I=i(e).height()}function g(e){return e.tagName.toLowerCase()}function v(e,t){if(t){var n=e.split(",");e="";for(var r=0,i=n.length;r<i;r++)e+=t+n[r].trim()+(r!==i-1?",":"")}return e}function E(){--y,o.length||y||_("onFinishedAll")}function _(e,t,i){return!!(e=r[e])&&(e.apply(n,[].slice.call(arguments,1)),!0)}var y=0,T=-1,I=-1,b=!1,w="afterLoad",S="load",D="error",R="img",C="src",A="srcset",O="sizes",x="background-image";"event"===r.bind||a?u():i(e).on(S+"."+l,u)}function r(r,a){var s=this,l=i.extend({},s.config,a),u={},c=l.name+"-"+ ++o;return s.config=function(e,n){return n===t?l[e]:(l[e]=n,s)},s.addItems=function(e){return u.a&&u.a("string"===i.type(e)?i(e):e),s},s.getItems=function(){return u.g?u.g():{}},s.update=function(e){return u.e&&u.e({},!e),s},s.force=function(e){return u.f&&u.f("string"===i.type(e)?i(e):e),s},s.loadAll=function(){return u.e&&u.e({all:!0},!0),s},s.destroy=function(){return i(l.appendScroll).off("."+c,u.e),i(e).off("."+c),u={},t},n(s,l,r,u,c),l.chainable?r:s}var i=e.jQuery||e.Zepto,o=0,a=!1;i.fn.Lazy=i.fn.lazy=function(e){return new r(this,e)},i.Lazy=i.lazy=function(e,n,o){if(i.isFunction(n)&&(o=n,n=[]),i.isFunction(o)){e=i.isArray(e)?e:[e],n=i.isArray(n)?n:[n];for(var a=r.prototype.config,s=a._f||(a._f={}),l=0,u=e.length;l<u;l++)(a[e[l]]===t||i.isFunction(a[e[l]]))&&(a[e[l]]=o);for(var c=0,d=n.length;c<d;c++)s[n[c]]=e[0]}},r.prototype.config={name:"lazy",chainable:!0,autoDestroy:!0,bind:"load",threshold:500,visibleOnly:!1,appendScroll:e,scrollDirection:"both",imageBase:null,defaultImage:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",placeholder:null,delay:-1,combined:!1,attribute:"data-src",srcsetAttribute:"data-srcset",sizesAttribute:"data-sizes",retinaAttribute:"data-retina",loaderAttribute:"data-loader",imageBaseAttribute:"data-imagebase",removeAttribute:!0,handledName:"handled",loadedName:"loaded",effect:"show",effectTime:0,enableThrottle:!0,throttle:250,beforeLoad:t,afterLoad:t,onError:t,onFinishedAll:t},i(e).on("load",(function(){a=!0}))}(window),function(){function e(t){var n=e.modules[t];if(!n)throw new Error('failed to require "'+t+'"');return"exports"in n||"function"!=typeof n.definition||(n.client=n.component=!0,n.definition.call(this,n.exports={},n),delete n.definition),n.exports}e.loader="component",e.helper={},e.helper.semVerSort=function(e,t){for(var n=e.version.split("."),r=t.version.split("."),i=0;i<n.length;++i){var o=parseInt(n[i],10),a=parseInt(r[i],10);if(o!==a)return o>a?1:-1;var s=n[i].substr((""+o).length),l=r[i].substr((""+a).length);if(""===s&&""!==l)return 1;if(""!==s&&""===l)return-1;if(""!==s&&""!==l)return s>l?1:-1}return 0},e.latest=function(t,n){function r(e){throw new Error('failed to find latest module of "'+e+'"')}var i=/(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/;/(.*)~(.*)/.test(t)||r(t);for(var o=Object.keys(e.modules),a=[],s=[],l=0;l<o.length;l++){var u=o[l];if(new RegExp(t+"@").test(u)){var c=u.substr(t.length+1);null!=i.exec(u)?a.push({version:c,name:u}):s.push({version:c,name:u})}}if(0===a.concat(s).length&&r(t),a.length>0){var d=a.sort(e.helper.semVerSort).pop().name;return!0===n?d:e(d)}d=s.sort((function(e,t){return e.name>t.name}))[0].name;return!0===n?d:e(d)},e.modules={},e.register=function(t,n){e.modules[t]={definition:n}},e.define=function(t,n){e.modules[t]={exports:n}},e.register("abpetkov~transitionize@0.0.3",(function(e,t){function n(e,t){if(!(this instanceof n))return new n(e,t);this.element=e,this.props=t||{},this.init()}t.exports=n,n.prototype.isSafari=function(){return/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)},n.prototype.init=function(){var e=[];for(var t in this.props)e.push(t+" "+this.props[t]);this.element.style.transition=e.join(", "),this.isSafari()&&(this.element.style.webkitTransition=e.join(", "))}})),e.register("ftlabs~fastclick@v0.6.11",(function(e,t){function n(e){"use strict";var t,r=this;if(this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=10,this.layer=e,!e||!e.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return n.prototype.onClick.apply(r,arguments)},this.onMouse=function(){return n.prototype.onMouse.apply(r,arguments)},this.onTouchStart=function(){return n.prototype.onTouchStart.apply(r,arguments)},this.onTouchMove=function(){return n.prototype.onTouchMove.apply(r,arguments)},this.onTouchEnd=function(){return n.prototype.onTouchEnd.apply(r,arguments)},this.onTouchCancel=function(){return n.prototype.onTouchCancel.apply(r,arguments)},n.notNeeded(e)||(this.deviceIsAndroid&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,r){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,r):i.call(e,t,n,r)},e.addEventListener=function(t,n,r){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),r):i.call(e,t,n,r)}),"function"==typeof e.onclick&&(t=e.onclick,e.addEventListener("click",(function(e){t(e)}),!1),e.onclick=null))}n.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,n.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),n.prototype.deviceIsIOS4=n.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),n.prototype.deviceIsIOSWithBadTarget=n.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),n.prototype.needsClick=function(e){"use strict";switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(this.deviceIsIOS&&"file"===e.type||e.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(e.className)},n.prototype.needsFocus=function(e){"use strict";switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!this.deviceIsAndroid;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},n.prototype.sendClick=function(e,t){"use strict";var n,r;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),r=t.changedTouches[0],(n=document.createEvent("MouseEvents")).initMouseEvent(this.determineEventType(e),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},n.prototype.determineEventType=function(e){"use strict";return this.deviceIsAndroid&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},n.prototype.focus=function(e){"use strict";var t;this.deviceIsIOS&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},n.prototype.updateScrollParent=function(e){"use strict";var t,n;if(!(t=e.fastClickScrollParent)||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},n.prototype.getTargetElementFromEventTarget=function(e){"use strict";return e.nodeType===Node.TEXT_NODE?e.parentNode:e},n.prototype.onTouchStart=function(e){"use strict";var t,n,r;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],this.deviceIsIOS){if((r=window.getSelection()).rangeCount&&!r.isCollapsed)return!0;if(!this.deviceIsIOS4){if(n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTime<200&&e.preventDefault(),!0},n.prototype.touchHasMoved=function(e){"use strict";var t=e.changedTouches[0],n=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>n||Math.abs(t.pageY-this.touchStartY)>n},n.prototype.onTouchMove=function(e){"use strict";return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0)},n.prototype.findControl=function(e){"use strict";return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},n.prototype.onTouchEnd=function(e){"use strict";var t,n,r,i,o,a=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,this.deviceIsIOSWithBadTarget&&(o=e.changedTouches[0],(a=document.elementFromPoint(o.pageX-window.pageXOffset,o.pageY-window.pageYOffset)||a).fastClickScrollParent=this.targetElement.fastClickScrollParent),"label"===(r=a.tagName.toLowerCase())){if(t=this.findControl(a)){if(this.focus(a),this.deviceIsAndroid)return!1;a=t}}else if(this.needsFocus(a))return e.timeStamp-n>100||this.deviceIsIOS&&window.top!==window&&"input"===r?(this.targetElement=null,!1):(this.focus(a),this.deviceIsIOS4&&"select"===r||(this.targetElement=null,e.preventDefault()),!1);return!(!this.deviceIsIOS||this.deviceIsIOS4||!(i=a.fastClickScrollParent)||i.fastClickLastScrollTop===i.scrollTop)||(this.needsClick(a)||(e.preventDefault(),this.sendClick(a,e)),!1)},n.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},n.prototype.onMouse=function(e){"use strict";return!this.targetElement||(!!e.forwardedTouchEvent||(!e.cancelable||(!(!this.needsClick(this.targetElement)||this.cancelNextClick)||(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1))))},n.prototype.onClick=function(e){"use strict";var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail||((t=this.onMouse(e))||(this.targetElement=null),t)},n.prototype.destroy=function(){"use strict";var e=this.layer;this.deviceIsAndroid&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},n.notNeeded=function(e){"use strict";var t,r;if(void 0===window.ontouchstart)return!0;if(r=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n.prototype.deviceIsAndroid)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(r>31&&window.innerWidth<=window.screen.width)return!0}}return"none"===e.style.msTouchAction},n.attach=function(e){"use strict";return new n(e)},"undefined"!=typeof define&&define.amd?define((function(){"use strict";return n})):void 0!==t&&t.exports?(t.exports=n.attach,t.exports.FastClick=n):window.FastClick=n})),e.register("component~indexof@0.0.3",(function(e,t){t.exports=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}})),e.register("component~classes@1.2.1",(function(t,n){var r=e("component~indexof@0.0.3"),i=/\s+/,o=Object.prototype.toString;function a(e){if(!e)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}n.exports=function(e){return new a(e)},a.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~r(t,e)||t.push(e),this.el.className=t.join(" "),this},a.prototype.remove=function(e){if("[object RegExp]"==o.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=r(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},a.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},a.prototype.toggle=function(e,t){return this.list?(void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},a.prototype.array=function(){var e=this.el.className.replace(/^\s+|\s+$/g,"").split(i);return""===e[0]&&e.shift(),e},a.prototype.has=a.prototype.contains=function(e){return this.list?this.list.contains(e):!!~r(this.array(),e)}})),e.register("component~event@0.1.4",(function(e,t){var n=window.addEventListener?"addEventListener":"attachEvent",r=window.removeEventListener?"removeEventListener":"detachEvent",i="addEventListener"!==n?"on":"";e.bind=function(e,t,r,o){return e[n](i+t,r,o||!1),r},e.unbind=function(e,t,n,o){return e[r](i+t,n,o||!1),n}})),e.register("component~query@0.0.3",(function(e,t){function n(e,t){return t.querySelector(e)}(e=t.exports=function(e,t){return n(e,t=t||document)}).all=function(e,t){return(t=t||document).querySelectorAll(e)},e.engine=function(t){if(!t.one)throw new Error(".one callback required");if(!t.all)throw new Error(".all callback required");return n=t.one,e.all=t.all,e}})),e.register("component~matches-selector@0.1.5",(function(t,n){var r=e("component~query@0.0.3"),i=Element.prototype,o=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector;n.exports=function(e,t){if(!e||1!==e.nodeType)return!1;if(o)return o.call(e,t);for(var n=r.all(t,e.parentNode),i=0;i<n.length;++i)if(n[i]==e)return!0;return!1}})),e.register("component~closest@0.1.4",(function(t,n){var r=e("component~matches-selector@0.1.5");n.exports=function(e,t,n,i){for(e=n?{parentNode:e}:e,i=i||document;(e=e.parentNode)&&e!==document;){if(r(e,t))return e;if(e===i)return}}})),e.register("component~delegate@0.2.3",(function(t,n){var r=e("component~closest@0.1.4"),i=e("component~event@0.1.4");t.bind=function(e,t,n,o,a){return i.bind(e,n,(function(n){var i=n.target||n.srcElement;n.delegateTarget=r(i,t,!0,e),n.delegateTarget&&o.call(e,n)}),a)},t.unbind=function(e,t,n,r){i.unbind(e,t,n,r)}})),e.register("component~events@1.0.9",(function(t,n){var r=e("component~event@0.1.4"),i=e("component~delegate@0.2.3");function o(e,t){if(!(this instanceof o))return new o(e,t);if(!e)throw new Error("element required");if(!t)throw new Error("object required");this.el=e,this.obj=t,this._events={}}n.exports=o,o.prototype.sub=function(e,t,n){this._events[e]=this._events[e]||{},this._events[e][t]=n},o.prototype.bind=function(e,t){var n=function(e){var t=e.split(/ +/);return{name:t.shift(),selector:t.join(" ")}}(e),o=this.el,a=this.obj,s=n.name,l=(t=t||"on"+s,[].slice.call(arguments,2));function u(){var e=[].slice.call(arguments).concat(l);a[t].apply(a,e)}return n.selector?u=i.bind(o,n.selector,s,u):r.bind(o,s,u),this.sub(s,t,u),u},o.prototype.unbind=function(e,t){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(e);var n=this._events[e];if(n){var i=n[t];i&&r.unbind(this.el,e,i)}},o.prototype.unbindAll=function(){for(var e in this._events)this.unbindAllOf(e)},o.prototype.unbindAllOf=function(e){var t=this._events[e];if(t)for(var n in t)this.unbind(e,n)}})),e.register("switchery",(function(t,n){var r=e("abpetkov~transitionize@0.0.3"),i=e("ftlabs~fastclick@v0.6.11"),o=e("component~classes@1.2.1"),a=e("component~events@1.0.9");n.exports=l;var s={color:"#64bd63",secondaryColor:"#dfdfdf",jackColor:"#fff",jackSecondaryColor:null,className:"switchery",disabled:!1,disabledOpacity:.5,speed:"0.4s",size:"default"};function l(e,t){if(!(this instanceof l))return new l(e,t);for(var n in this.element=e,this.options=t||{},s)null==this.options[n]&&(this.options[n]=s[n]);null!=this.element&&"checkbox"==this.element.type&&this.init(),!0===this.isDisabled()&&this.disable()}l.prototype.hide=function(){this.element.style.display="none"},l.prototype.show=function(){var e=this.create();this.insertAfter(this.element,e)},l.prototype.create=function(){return this.switcher=document.createElement("span"),this.jack=document.createElement("small"),this.switcher.appendChild(this.jack),this.switcher.className=this.options.className,this.events=a(this.switcher,this),this.switcher},l.prototype.insertAfter=function(e,t){e.parentNode.insertBefore(t,e.nextSibling)},l.prototype.setPosition=function(e){var t=this.isChecked(),n=this.switcher,r=this.jack;e&&t?t=!1:e&&!t&&(t=!0),!0===t?(this.element.checked=!0,window.getComputedStyle?r.style.left=parseInt(window.getComputedStyle(n).width)-parseInt(window.getComputedStyle(r).width)+"px":r.style.left=parseInt(n.currentStyle.width)-parseInt(r.currentStyle.width)+"px",this.options.color&&this.colorize(),this.setSpeed()):(r.style.left=0,this.element.checked=!1,this.switcher.style.boxShadow="inset 0 0 0 0 "+this.options.secondaryColor,this.switcher.style.borderColor=this.options.secondaryColor,this.switcher.style.backgroundColor=this.options.secondaryColor!==s.secondaryColor?this.options.secondaryColor:"#fff",this.jack.style.backgroundColor=this.options.jackSecondaryColor!==this.options.jackColor?this.options.jackSecondaryColor:this.options.jackColor,this.setSpeed())},l.prototype.setSpeed=function(){var e={},t={"background-color":this.options.speed,left:this.options.speed.replace(/[a-z]/,"")/2+"s"};e=this.isChecked()?{border:this.options.speed,"box-shadow":this.options.speed,"background-color":3*this.options.speed.replace(/[a-z]/,"")+"s"}:{border:this.options.speed,"box-shadow":this.options.speed},r(this.switcher,e),r(this.jack,t)},l.prototype.setSize=function(){switch(this.options.size){case"small":o(this.switcher).add("switchery-small");break;case"large":o(this.switcher).add("switchery-large");break;default:o(this.switcher).add("switchery-default")}},l.prototype.colorize=function(){var e=this.switcher.offsetHeight/2;this.switcher.style.backgroundColor=this.options.color,this.switcher.style.borderColor=this.options.color,this.switcher.style.boxShadow="inset 0 0 0 "+e+"px "+this.options.color,this.jack.style.backgroundColor=this.options.jackColor},l.prototype.handleOnchange=function(e){if(document.dispatchEvent){var t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!0),this.element.dispatchEvent(t)}else this.element.fireEvent("onchange")},l.prototype.handleChange=function(){var e=this,t=this.element;t.addEventListener?t.addEventListener("change",(function(){e.setPosition()})):t.attachEvent("onchange",(function(){e.setPosition()}))},l.prototype.handleClick=function(){var e=this.switcher;i(e),this.events.bind("click","bindClick")},l.prototype.bindClick=function(){var e="label"!==this.element.parentNode.tagName.toLowerCase();this.setPosition(e),this.handleOnchange(this.element.checked)},l.prototype.markAsSwitched=function(){this.element.setAttribute("data-switchery",!0)},l.prototype.markedAsSwitched=function(){return this.element.getAttribute("data-switchery")},l.prototype.init=function(){this.hide(),this.show(),this.setSize(),this.setPosition(),this.markAsSwitched(),this.handleChange(),this.handleClick()},l.prototype.isChecked=function(){return this.element.checked},l.prototype.isDisabled=function(){return this.options.disabled||this.element.disabled||this.element.readOnly},l.prototype.destroy=function(){this.events.unbind()},l.prototype.enable=function(){this.options.disabled&&(this.options.disabled&&(this.options.disabled=!1),this.element.disabled&&(this.element.disabled=!1),this.element.readOnly&&(this.element.readOnly=!1),this.switcher.style.opacity=1,this.events.bind("click","bindClick"))},l.prototype.disable=function(){this.options.disabled||(this.options.disabled||(this.options.disabled=!0),this.element.disabled||(this.element.disabled=!0),this.element.readOnly||(this.element.readOnly=!0),this.switcher.style.opacity=this.options.disabledOpacity,this.destroy())}})),"object"==typeof exports?module.exports=e("switchery"):"function"==typeof define&&define.amd?define("Switchery",[],(function(){return e("switchery")})):(this||window).Switchery=e("switchery")}(),function(e){if("function"==typeof define&&define.amd)define(["jquery"],e);else if("object"==typeof module&&module.exports){var t=require("jquery");module.exports=e(t)}else e(jQuery)}((function(e){if(void 0===e)throw new Error("jQuery.textcomplete requires jQuery");return function(e){"use strict";var t=1;e.fn.textcomplete=function(n,r){var i=Array.prototype.slice.call(arguments);return this.each((function(){var o=e(this),a=o.data("textComplete");if(a||(r||(r={}),r._oid=t++,a=new e.fn.textcomplete.Completer(this,r),o.data("textComplete",a)),"string"==typeof n){if(!a)return;i.shift(),a[n].apply(a,i),"destroy"===n&&o.removeData("textComplete")}else e.each(n,(function(t){e.each(["header","footer","placement","maxCount"],(function(e){t[e]&&(a.option[e]=t[e],function(e){console.warn&&console.warn(e)}(e+"as a strategy param is deprecated. Use option."),delete t[e])}))})),a.register(e.fn.textcomplete.Strategy.parse(n,{el:this,$el:o}))}))}}(e),function(e){"use strict";function t(n,o){if(this.$el=e(n),this.id="textcomplete"+r++,this.strategies=[],this.views=[],this.option=e.extend({},t.defaults,o),!(this.$el.is("input[type=text]")||this.$el.is("input[type=search]")||this.$el.is("textarea")||n.isContentEditable||"true"==n.contentEditable))throw new Error("textcomplete must be called on a Textarea or a ContentEditable.");if(n===n.ownerDocument.activeElement)this.initialize();else{var a=this;this.$el.one("focus."+this.id,(function(){a.initialize()})),this.option.adapter&&"CKEditor"!=this.option.adapter||"undefined"==typeof CKEDITOR||!this.$el.is("textarea")||CKEDITOR.on("instanceReady",(function(t){-1==e.inArray(t.editor.id,i)&&(i.push(t.editor.id),t.editor.on("focus",(function(n){a.$el=e(t.editor.editable().$),a.option.adapter||(a.option.adapter=e.fn.textcomplete.CKEditor),a.option.ckeditor_instance=t.editor,a.initialize()})))}))}}var n=function(e){return"[object String]"===Object.prototype.toString.call(e)},r=0,i=[];t.defaults={appendTo:"body",className:"",dropdownClassName:"dropdown-menu textcomplete-dropdown",maxCount:10,zIndex:"100",rightEdgeOffset:30},e.extend(t.prototype,{id:null,option:null,strategies:null,adapter:null,dropdown:null,$el:null,$iframe:null,initialize:function(){var t,n,r=this.$el.get(0);if(this.$el.prop("ownerDocument")!==document&&window.frames.length)for(var i=0;i<window.frames.length;i++)if(this.$el.prop("ownerDocument")===window.frames[i].document){this.$iframe=e(window.frames[i].frameElement);break}this.dropdown=new e.fn.textcomplete.Dropdown(r,this,this.option),this.option.adapter?t=this.option.adapter:(n=this.$el.is("textarea")||this.$el.is("input[type=text]")||this.$el.is("input[type=search]")?"number"==typeof r.selectionEnd?"Textarea":"IETextarea":"ContentEditable",t=e.fn.textcomplete[n]),this.adapter=new t(r,this,this.option)},destroy:function(){this.$el.off("."+this.id),this.adapter&&this.adapter.destroy(),this.dropdown&&this.dropdown.destroy(),this.$el=this.adapter=this.dropdown=null},deactivate:function(){this.dropdown&&this.dropdown.deactivate()},trigger:function(e,t){this.dropdown||this.initialize(),null!=e||(e=this.adapter.getTextFromHeadToCaret());var n=this._extractSearchQuery(e);if(n.length){var r=n[1];if(t&&this._term===r&&""!==r)return;this._term=r,this._search.apply(this,n)}else this._term=null,this.dropdown.deactivate()},fire:function(e){var t=Array.prototype.slice.call(arguments,1);return this.$el.trigger(e,t),this},register:function(e){Array.prototype.push.apply(this.strategies,e)},select:function(e,t,n){this._term=null,this.adapter.select(e,t,n),this.fire("change").fire("textComplete:select",e,t),this.adapter.focus()},_clearAtNext:!0,_term:null,_extractSearchQuery:function(t){for(var r=0;r<this.strategies.length;r++){var i=this.strategies[r],o=i.context(t);if(o||""===o){var a=e.isFunction(i.match)?i.match(t):i.match;n(o)&&(t=o);var s=t.match(a);if(s)return[i,s[i.index],s]}}return[]},_search:function(e){var t,n;return function(){var r=Array.prototype.slice.call(arguments);if(t)n=r;else{t=!0;var i=this;r.unshift((function r(){if(n){var o=n;n=void 0,o.unshift(r),e.apply(i,o)}else t=!1})),e.apply(this,r)}}}((function(e,t,n,r){var i=this;t.search(n,(function(r,o){i.dropdown.shown||i.dropdown.activate(),i._clearAtNext&&(i.dropdown.clear(),i._clearAtNext=!1),i.dropdown.setPosition(i.adapter.getCaretPosition()),i.dropdown.render(i._zip(r,t,n)),o||(e(),i._clearAtNext=!0)}),r)})),_zip:function(t,n,r){return e.map(t,(function(e){return{value:e,strategy:n,term:r}}))}}),e.fn.textcomplete.Completer=t}(e),function(e){"use strict";function t(n,r,o){this.$el=t.createElement(o),this.completer=r,this.id=r.id+"dropdown",this._data=[],this.$inputEl=e(n),this.option=o,o.listPosition&&(this.setPosition=o.listPosition),o.height&&this.$el.height(o.height);var a=this;e.each(["maxCount","placement","footer","header","noResultsMessage","className"],(function(e,t){null!=o[t]&&(a[t]=o[t])})),this._bindEvents(n),i[this.id]=this}var n=e(window),r=function(e,t){var n,r,i=t.strategy.idProperty;for(n=0;n<e.length;n++)if((r=e[n]).strategy===t.strategy)if(i){if(r.value[i]===t.value[i])return!0}else if(r.value===t.value)return!0;return!1},i={};e(document).on("click",(function(t){var n=t.originalEvent&&t.originalEvent.keepTextCompleteDropdown;e.each(i,(function(e,t){e!==n&&t.deactivate()}))}));var o={SKIP_DEFAULT:0,KEY_UP:1,KEY_DOWN:2,KEY_ENTER:3,KEY_PAGEUP:4,KEY_PAGEDOWN:5,KEY_ESCAPE:6};e.extend(t,{createElement:function(t){var n=t.appendTo;return n instanceof e||(n=e(n)),e("<ul></ul>").addClass(t.dropdownClassName).attr("id","textcomplete-dropdown-"+t._oid).css({display:"none",left:0,position:"absolute",zIndex:t.zIndex}).appendTo(n)}}),e.extend(t.prototype,{$el:null,$inputEl:null,completer:null,footer:null,header:null,id:null,maxCount:null,placement:"",shown:!1,data:[],className:"",destroy:function(){this.deactivate(),this.$el.off("."+this.id),this.$inputEl.off("."+this.id),this.clear(),this.$el.remove(),this.$el=this.$inputEl=this.completer=null,delete i[this.id]},render:function(t){var n=this._buildContents(t),r=e.map(t,(function(e){return e.value}));if(t.length){var i=t[0].strategy;i.id?this.$el.attr("data-strategy",i.id):this.$el.removeAttr("data-strategy"),this._renderHeader(r),this._renderFooter(r),n&&(this._renderContents(n),this._fitToBottom(),this._fitToRight(),this._activateIndexedItem()),this._setScroll()}else this.noResultsMessage?this._renderNoResultsMessage(r):this.shown&&this.deactivate()},setPosition:function(t){var r="absolute";return this.$inputEl.add(this.$inputEl.parents()).each((function(){return"absolute"!==e(this).css("position")&&("fixed"===e(this).css("position")?(t.top-=n.scrollTop(),t.left-=n.scrollLeft(),r="fixed",!1):void 0)})),this.$el.css(this._applyPlacement(t)),this.$el.css({position:r}),this},clear:function(){this.$el.html(""),this.data=[],this._index=0,this._$header=this._$footer=this._$noResultsMessage=null},activate:function(){return this.shown||(this.clear(),this.$el.show(),this.className&&this.$el.addClass(this.className),this.completer.fire("textComplete:show"),this.shown=!0),this},deactivate:function(){return this.shown&&(this.$el.hide(),this.className&&this.$el.removeClass(this.className),this.completer.fire("textComplete:hide"),this.shown=!1),this},isUp:function(e){return 38===e.keyCode||e.ctrlKey&&80===e.keyCode},isDown:function(e){return 40===e.keyCode||e.ctrlKey&&78===e.keyCode},isEnter:function(e){return!(e.ctrlKey||e.altKey||e.metaKey||e.shiftKey)&&(13===e.keyCode||9===e.keyCode||!0===this.option.completeOnSpace&&32===e.keyCode)},isPageup:function(e){return 33===e.keyCode},isPagedown:function(e){return 34===e.keyCode},isEscape:function(e){return 27===e.keyCode},_data:null,_index:null,_$header:null,_$noResultsMessage:null,_$footer:null,_bindEvents:function(){this.$el.on("mousedown."+this.id,".textcomplete-item",e.proxy(this._onClick,this)),this.$el.on("touchstart."+this.id,".textcomplete-item",e.proxy(this._onClick,this)),this.$el.on("mouseover."+this.id,".textcomplete-item",e.proxy(this._onMouseover,this)),this.$inputEl.on("keydown."+this.id,e.proxy(this._onKeydown,this))},_onClick:function(t){var n=e(t.target);t.preventDefault(),t.originalEvent.keepTextCompleteDropdown=this.id,n.hasClass("textcomplete-item")||(n=n.closest(".textcomplete-item"));var r=this.data[parseInt(n.data("index"),10)];this.completer.select(r.value,r.strategy,t);var i=this;setTimeout((function(){i.deactivate(),"touchstart"===t.type&&i.$inputEl.focus()}),0)},_onMouseover:function(t){var n=e(t.target);t.preventDefault(),n.hasClass("textcomplete-item")||(n=n.closest(".textcomplete-item")),this._index=parseInt(n.data("index"),10),this._activateIndexedItem()},_onKeydown:function(t){var n;if(this.shown)switch(e.isFunction(this.option.onKeydown)&&(n=this.option.onKeydown(t,o)),null==n&&(n=this._defaultKeydown(t)),n){case o.KEY_UP:t.preventDefault(),this._up();break;case o.KEY_DOWN:t.preventDefault(),this._down();break;case o.KEY_ENTER:t.preventDefault(),this._enter(t);break;case o.KEY_PAGEUP:t.preventDefault(),this._pageup();break;case o.KEY_PAGEDOWN:t.preventDefault(),this._pagedown();break;case o.KEY_ESCAPE:t.preventDefault(),this.deactivate()}},_defaultKeydown:function(e){return this.isUp(e)?o.KEY_UP:this.isDown(e)?o.KEY_DOWN:this.isEnter(e)?o.KEY_ENTER:this.isPageup(e)?o.KEY_PAGEUP:this.isPagedown(e)?o.KEY_PAGEDOWN:this.isEscape(e)?o.KEY_ESCAPE:void 0},_up:function(){0===this._index?this._index=this.data.length-1:this._index-=1,this._activateIndexedItem(),this._setScroll()},_down:function(){this._index===this.data.length-1?this._index=0:this._index+=1,this._activateIndexedItem(),this._setScroll()},_enter:function(e){var t=this.data[parseInt(this._getActiveElement().data("index"),10)];this.completer.select(t.value,t.strategy,e),this.deactivate()},_pageup:function(){var t=0,n=this._getActiveElement().position().top-this.$el.innerHeight();this.$el.children().each((function(r){return e(this).position().top+e(this).outerHeight()>n?(t=r,!1):void 0})),this._index=t,this._activateIndexedItem(),this._setScroll()},_pagedown:function(){var t=this.data.length-1,n=this._getActiveElement().position().top+this.$el.innerHeight();this.$el.children().each((function(r){return e(this).position().top>n?(t=r,!1):void 0})),this._index=t,this._activateIndexedItem(),this._setScroll()},_activateIndexedItem:function(){this.$el.find(".textcomplete-item.active").removeClass("active"),this._getActiveElement().addClass("active")},_getActiveElement:function(){return this.$el.children(".textcomplete-item:nth("+this._index+")")},_setScroll:function(){var e=this._getActiveElement(),t=e.position().top,n=e.outerHeight(),r=this.$el.innerHeight(),i=this.$el.scrollTop();0===this._index||this._index==this.data.length-1||0>t?this.$el.scrollTop(t+i):t+n>r&&this.$el.scrollTop(t+n+i-r)},_buildContents:function(e){var t,n,i,o="";for(n=0;n<e.length&&this.data.length!==this.maxCount;n++)t=e[n],r(this.data,t)||(i=this.data.length,this.data.push(t),o+='<li class="textcomplete-item" data-index="'+i+'"><a>',o+=t.strategy.template(t.value,t.term),o+="</a></li>");return o},_renderHeader:function(t){if(this.header){this._$header||(this._$header=e('<li class="textcomplete-header"></li>').prependTo(this.$el));var n=e.isFunction(this.header)?this.header(t):this.header;this._$header.html(n)}},_renderFooter:function(t){if(this.footer){this._$footer||(this._$footer=e('<li class="textcomplete-footer"></li>').appendTo(this.$el));var n=e.isFunction(this.footer)?this.footer(t):this.footer;this._$footer.html(n)}},_renderNoResultsMessage:function(t){if(this.noResultsMessage){this._$noResultsMessage||(this._$noResultsMessage=e('<li class="textcomplete-no-results-message"></li>').appendTo(this.$el));var n=e.isFunction(this.noResultsMessage)?this.noResultsMessage(t):this.noResultsMessage;this._$noResultsMessage.html(n)}},_renderContents:function(e){this._$footer?this._$footer.before(e):this.$el.append(e)},_fitToBottom:function(){var e=n.scrollTop()+n.height(),t=this.$el.height();this.$el.position().top+t>e&&(this.completer.$iframe||this.$el.offset({top:e-t}))},_fitToRight:function(){for(var e,t=this.option.rightEdgeOffset,r=this.$el.offset().left,i=this.$el.width(),o=n.width()-t;r+i>o&&(this.$el.offset({left:r-t}),!((e=this.$el.offset().left)>=r));)r=e},_applyPlacement:function(e){return-1!==this.placement.indexOf("top")?e={top:"auto",bottom:this.$el.parent().height()-e.top+e.lineHeight,left:e.left}:(e.bottom="auto",delete e.lineHeight),-1!==this.placement.indexOf("absleft")?e.left=0:-1!==this.placement.indexOf("absright")&&(e.right=0,e.left="auto"),e}}),e.fn.textcomplete.Dropdown=t,e.extend(e.fn.textcomplete,o)}(e),function(e){"use strict";function t(t){e.extend(this,t),this.cache&&(this.search=n(this.search))}var n=function(e){var t={};return function(n,r){t[n]?r(t[n]):e.call(this,n,(function(e){t[n]=(t[n]||[]).concat(e),r.apply(null,arguments)}))}};t.parse=function(n,r){return e.map(n,(function(e){var n=new t(e);return n.el=r.el,n.$el=r.$el,n}))},e.extend(t.prototype,{match:null,replace:null,search:null,id:null,cache:!1,context:function(){return!0},index:2,template:function(e){return e},idProperty:null}),e.fn.textcomplete.Strategy=t}(e),function(e){"use strict";function t(){}var n=Date.now||function(){return(new Date).getTime()},r=function(e,t){var r,i,o,a,s,l=function(){var u=n()-a;t>u?r=setTimeout(l,t-u):(r=null,s=e.apply(o,i),o=i=null)};return function(){return o=this,i=arguments,a=n(),r||(r=setTimeout(l,t)),s}};e.extend(t.prototype,{id:null,completer:null,el:null,$el:null,option:null,initialize:function(t,n,i){this.el=t,this.$el=e(t),this.id=n.id+this.constructor.name,this.completer=n,this.option=i,this.option.debounce&&(this._onKeyup=r(this._onKeyup,this.option.debounce)),this._bindEvents()},destroy:function(){this.$el.off("."+this.id),this.$el=this.el=this.completer=null},select:function(){throw new Error("Not implemented")},getCaretPosition:function(){var t=this._getCaretRelativePosition(),n=this.$el.offset(),r=this.option.appendTo;if(r){r instanceof e||(r=e(r));var i=r.offsetParent().offset();n.top-=i.top,n.left-=i.left}return t.top+=n.top,t.left+=n.left,t},focus:function(){this.$el.focus()},_bindEvents:function(){this.$el.on("keyup."+this.id,e.proxy(this._onKeyup,this))},_onKeyup:function(e){this._skipSearch(e)||this.completer.trigger(this.getTextFromHeadToCaret(),!0)},_skipSearch:function(e){switch(e.keyCode){case 9:case 13:case 16:case 17:case 18:case 33:case 34:case 40:case 38:case 27:return!0}if(e.ctrlKey)switch(e.keyCode){case 78:case 80:return!0}}}),e.fn.textcomplete.Adapter=t}(e),function(e){"use strict";function t(e,t,n){this.initialize(e,t,n)}e.extend(t.prototype,e.fn.textcomplete.Adapter.prototype,{select:function(t,n,r){var i,o=this.getTextFromHeadToCaret(),a=this.el.value.substring(this.el.selectionEnd),s=n.replace(t,r);void 0!==s&&(e.isArray(s)&&(a=s[1]+a,s=s[0]),i=e.isFunction(n.match)?n.match(o):n.match,o=o.replace(i,s),this.$el.val(o+a),this.el.selectionStart=this.el.selectionEnd=o.length)},getTextFromHeadToCaret:function(){return this.el.value.substring(0,this.el.selectionEnd)},_getCaretRelativePosition:function(){var t=e.fn.textcomplete.getCaretCoordinates(this.el,this.el.selectionStart);return{top:t.top+this._calculateLineHeight()-this.$el.scrollTop(),left:t.left-this.$el.scrollLeft(),lineHeight:this._calculateLineHeight()}},_calculateLineHeight:function(){var e=parseInt(this.$el.css("line-height"),10);if(isNaN(e)){var t=this.el.parentNode,n=document.createElement(this.el.nodeName),r=this.el.style;n.setAttribute("style","margin:0px;padding:0px;font-family:"+r.fontFamily+";font-size:"+r.fontSize),n.innerHTML="test",t.appendChild(n),e=n.clientHeight,t.removeChild(n)}return e}}),e.fn.textcomplete.Textarea=t}(e),function(e){"use strict";function t(t,r,i){this.initialize(t,r,i),e("<span>"+n+"</span>").css({position:"absolute",top:-9999,left:-9999}).insertBefore(t)}var n="吶";e.extend(t.prototype,e.fn.textcomplete.Textarea.prototype,{select:function(t,n,r){var i,o=this.getTextFromHeadToCaret(),a=this.el.value.substring(o.length),s=n.replace(t,r);if(void 0!==s){e.isArray(s)&&(a=s[1]+a,s=s[0]),i=e.isFunction(n.match)?n.match(o):n.match,o=o.replace(i,s),this.$el.val(o+a),this.el.focus();var l=this.el.createTextRange();l.collapse(!0),l.moveEnd("character",o.length),l.moveStart("character",o.length),l.select()}},getTextFromHeadToCaret:function(){this.el.focus();var e=document.selection.createRange();e.moveStart("character",-this.el.value.length);var t=e.text.split(n);return 1===t.length?t[0]:t[1]}}),e.fn.textcomplete.IETextarea=t}(e),function(e){"use strict";function t(e,t,n){this.initialize(e,t,n)}e.extend(t.prototype,e.fn.textcomplete.Adapter.prototype,{select:function(t,n,r){var i=this.getTextFromHeadToCaret(),o=this.el.ownerDocument.getSelection(),a=o.getRangeAt(0),s=a.cloneRange();s.selectNodeContents(a.startContainer);var l,u=s.toString().substring(a.startOffset),c=n.replace(t,r);if(void 0!==c){e.isArray(c)&&(u=c[1]+u,c=c[0]),l=e.isFunction(n.match)?n.match(i):n.match,i=i.replace(l,c).replace(/ $/," "),a.selectNodeContents(a.startContainer),a.deleteContents();var d=this.el.ownerDocument.createElement("div");d.innerHTML=i;var f=this.el.ownerDocument.createElement("div");f.innerHTML=u;for(var p,h,m=this.el.ownerDocument.createDocumentFragment();p=d.firstChild;)h=m.appendChild(p);for(;p=f.firstChild;)m.appendChild(p);a.insertNode(m),a.setStartAfter(h),a.collapse(!0),o.removeAllRanges(),o.addRange(a)}},_getCaretRelativePosition:function(){var t=this.el.ownerDocument.getSelection().getRangeAt(0).cloneRange(),n=t.endContainer.parentNode,r=this.el.ownerDocument.createElement("span");t.insertNode(r),t.selectNodeContents(r),t.deleteContents(),setTimeout((function(){n.normalize()}),0);var i=e(r),o=i.offset();if(o.left-=this.$el.offset().left,o.top+=i.height()-this.$el.offset().top,o.lineHeight=i.height(),this.completer.$iframe){var a=this.completer.$iframe.offset();o.top+=a.top,o.left+=a.left,o.top-=e(this.completer.$iframe[0].contentWindow.document).scrollTop()}return i.remove(),o},getTextFromHeadToCaret:function(){var e=this.el.ownerDocument.getSelection().getRangeAt(0),t=e.cloneRange();return t.selectNodeContents(e.startContainer),t.toString().substring(0,e.startOffset)}}),e.fn.textcomplete.ContentEditable=t}(e),function(e){"use strict";function t(e,t,n){this.initialize(e,t,n)}e.extend(t.prototype,e.fn.textcomplete.ContentEditable.prototype,{_bindEvents:function(){var t=this;this.option.ckeditor_instance.on("key",(function(e){var n=e.data;return t._onKeyup(n),(!t.completer.dropdown.shown||!t._skipSearch(n))&&void 0}),null,null,1),this.$el.on("keyup."+this.id,e.proxy(this._onKeyup,this))}}),e.fn.textcomplete.CKEditor=t}(e),function(e){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,r=n&&null!=window.mozInnerScreenX;e.fn.textcomplete.getCaretCoordinates=function(e,i,o){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var a=o&&o.debug||!1;if(a){var s=document.querySelector("#input-textarea-caret-position-mirror-div");s&&s.parentNode.removeChild(s)}var l=document.createElement("div");l.id="input-textarea-caret-position-mirror-div",document.body.appendChild(l);var u=l.style,c=window.getComputedStyle?getComputedStyle(e):e.currentStyle;u.whiteSpace="pre-wrap","INPUT"!==e.nodeName&&(u.wordWrap="break-word"),u.position="absolute",a||(u.visibility="hidden"),t.forEach((function(e){u[e]=c[e]})),r?e.scrollHeight>parseInt(c.height)&&(u.overflowY="scroll"):u.overflow="hidden",l.textContent=e.value.substring(0,i),"INPUT"===e.nodeName&&(l.textContent=l.textContent.replace(/\s/g," "));var d=document.createElement("span");d.textContent=e.value.substring(i)||".",l.appendChild(d);var f={top:d.offsetTop+parseInt(c.borderTopWidth),left:d.offsetLeft+parseInt(c.borderLeftWidth)};return a?d.style.backgroundColor="#aaa":document.body.removeChild(l),f}}(e),e}));