vfg-field-array
Version:
A vue-form-generator field to handle arrays
11 lines (10 loc) • 95.6 kB
JavaScript
/**
* Copyright 2017 Gwenael Pluchon
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue-form-generator"),require("lodash.foreach")):"function"==typeof define&&define.amd?define(["exports","vue-form-generator","lodash.foreach"],e):e(t["vfg-field-array"]={},t.VueFormGenerator,t.forEach)}(this,function(t,e,n){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,n=n&&n.hasOwnProperty("default")?n.default:n;"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function r(t,e){return t(e={exports:{}},e.exports),e.exports}var i=Math.ceil,a=Math.floor,l=function(t){return isNaN(t=+t)?0:(t>0?a:i)(t)},s=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t},c=r(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),u=r(function(t){var e=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=e)}),f=(u.version,function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}),d=function(t,e,n){if(f(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,o){return t.call(e,n,o)};case 3:return function(n,o,r){return t.call(e,n,o,r)}}return function(){return t.apply(e,arguments)}},h=function(t){return"object"==typeof t?null!==t:"function"==typeof t},p=function(t){if(!h(t))throw TypeError(t+" is not an object!");return t},v=function(t){try{return!!t()}catch(t){return!0}},m=!v(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),g=c.document,b=h(g)&&h(g.createElement),y=function(t){return b?g.createElement(t):{}},w=!m&&!v(function(){return 7!=Object.defineProperty(y("div"),"a",{get:function(){return 7}}).a}),_=Object.defineProperty,E={f:m?Object.defineProperty:function(t,e,n){if(p(t),e=function(t,e){if(!h(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!h(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!h(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!h(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}(e,!0),p(n),w)try{return _(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},x=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},S=m?function(t,e,n){return E.f(t,e,x(1,n))}:function(t,e,n){return t[e]=n,t},O={}.hasOwnProperty,D=function(t,e){return O.call(t,e)},C=function(t,e,n){var o,r,i,a=t&C.F,l=t&C.G,s=t&C.S,f=t&C.P,h=t&C.B,p=t&C.W,v=l?u:u[e]||(u[e]={}),m=v.prototype,g=l?c:s?c[e]:(c[e]||{}).prototype;for(o in l&&(n=e),n)(r=!a&&g&&void 0!==g[o])&&D(v,o)||(i=r?g[o]:n[o],v[o]=l&&"function"!=typeof g[o]?n[o]:h&&r?d(i,c):p&&g[o]==i?function(t){var e=function(e,n,o){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,o)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(i):f&&"function"==typeof i?d(Function.call,i):i,f&&((v.virtual||(v.virtual={}))[o]=i,t&C.R&&m&&!m[o]&&S(m,o,i)))};C.F=1,C.G=2,C.S=4,C.P=8,C.B=16,C.W=32,C.U=64,C.R=128;var T,M=C,I=S,A={},P={}.toString,j=function(t){return P.call(t).slice(8,-1)},L=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==j(t)?t.split(""):Object(t)},N=function(t){return L(s(t))},k=Math.min,B=function(t){return t>0?k(l(t),9007199254740991):0},F=Math.max,R=Math.min,U=c["__core-js_shared__"]||(c["__core-js_shared__"]={}),$=function(t){return U[t]||(U[t]={})},V=0,H=Math.random(),X=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++V+H).toString(36))},Y=$("keys"),G=function(t){return Y[t]||(Y[t]=X(t))},W=(T=!1,function(t,e,n){var o,r=N(t),i=B(r.length),a=function(t,e){return(t=l(t))<0?F(t+e,0):R(t,e)}(n,i);if(T&&e!=e){for(;i>a;)if((o=r[a++])!=o)return!0}else for(;i>a;a++)if((T||a in r)&&r[a]===e)return T||a||0;return!T&&-1}),K=G("IE_PROTO"),z="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),q=Object.keys||function(t){return function(t,e){var n,o=N(t),r=0,i=[];for(n in o)n!=K&&D(o,n)&&i.push(n);for(;e.length>r;)D(o,n=e[r++])&&(~W(i,n)||i.push(n));return i}(t,z)},J=m?Object.defineProperties:function(t,e){p(t);for(var n,o=q(e),r=o.length,i=0;r>i;)E.f(t,n=o[i++],e[n]);return t},Z=c.document,Q=Z&&Z.documentElement,tt=G("IE_PROTO"),et=function(){},nt=function(){var t,e=y("iframe"),n=z.length;for(e.style.display="none",Q.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),nt=t.F;n--;)delete nt.prototype[z[n]];return nt()},ot=Object.create||function(t,e){var n;return null!==t?(et.prototype=p(t),n=new et,et.prototype=null,n[tt]=t):n=nt(),void 0===e?n:J(n,e)},rt=r(function(t){var e=$("wks"),n=c.Symbol,o="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=o&&n[t]||(o?n:X)("Symbol."+t))}).store=e}),it=E.f,at=rt("toStringTag"),lt=function(t,e,n){t&&!D(t=n?t:t.prototype,at)&&it(t,at,{configurable:!0,value:e})},st={};S(st,rt("iterator"),function(){return this});var ct,ut=function(t,e,n){t.prototype=ot(st,{next:x(1,n)}),lt(t,e+" Iterator")},ft=function(t){return Object(s(t))},dt=G("IE_PROTO"),ht=Object.prototype,pt=Object.getPrototypeOf||function(t){return t=ft(t),D(t,dt)?t[dt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?ht:null},vt=rt("iterator"),mt=!([].keys&&"next"in[].keys()),gt=function(){return this},bt=function(t,e,n,o,r,i,a){ut(n,e,o);var l,s,c,u=function(t){if(!mt&&t in p)return p[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},f=e+" Iterator",d="values"==r,h=!1,p=t.prototype,v=p[vt]||p["@@iterator"]||r&&p[r],m=v||u(r),g=r?d?u("entries"):m:void 0,b="Array"==e&&p.entries||v;if(b&&(c=pt(b.call(new t)))!==Object.prototype&&c.next&<(c,f,!0),d&&v&&"values"!==v.name&&(h=!0,m=function(){return v.call(this)}),a&&(mt||h||!p[vt])&&S(p,vt,m),A[e]=m,A[f]=gt,r)if(l={values:d?m:u("values"),keys:i?m:u("keys"),entries:g},a)for(s in l)s in p||I(p,s,l[s]);else M(M.P+M.F*(mt||h),e,l);return l},yt=(ct=!0,function(t,e){var n,o,r=String(s(t)),i=l(e),a=r.length;return i<0||i>=a?ct?"":void 0:(n=r.charCodeAt(i))<55296||n>56319||i+1===a||(o=r.charCodeAt(i+1))<56320||o>57343?ct?r.charAt(i):n:ct?r.slice(i,i+2):o-56320+(n-55296<<10)+65536});bt(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=yt(e,n),this._i+=t.length,{value:t,done:!1})});var wt=function(t,e){return{value:e,done:!!t}};bt(Array,"Array",function(t,e){this._t=N(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,wt(1)):wt(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");A.Arguments=A.Array;for(var _t=rt("toStringTag"),Et="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),xt=0;xt<Et.length;xt++){var St=Et[xt],Ot=c[St],Dt=Ot&&Ot.prototype;Dt&&!Dt[_t]&&S(Dt,_t,St),A[St]=A.Array}var Ct,Tt,Mt,It=rt("toStringTag"),At="Arguments"==j(function(){return arguments}()),Pt=function(t){var e,n,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),It))?n:At?j(e):"Object"==(o=j(e))&&"function"==typeof e.callee?"Arguments":o},jt=function(t,e,n,o){try{return o?e(p(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&p(r.call(t)),e}},Lt=rt("iterator"),Nt=Array.prototype,kt=function(t){return void 0!==t&&(A.Array===t||Nt[Lt]===t)},Bt=rt("iterator"),Ft=u.getIteratorMethod=function(t){if(void 0!=t)return t[Bt]||t["@@iterator"]||A[Pt(t)]},Rt=r(function(t){var e={},n={},o=t.exports=function(t,o,r,i,a){var l,s,c,u,f=a?function(){return t}:Ft(t),h=d(r,i,o?2:1),v=0;if("function"!=typeof f)throw TypeError(t+" is not iterable!");if(kt(f)){for(l=B(t.length);l>v;v++)if((u=o?h(p(s=t[v])[0],s[1]):h(t[v]))===e||u===n)return u}else for(c=f.call(t);!(s=c.next()).done;)if((u=jt(c,h,s.value,o))===e||u===n)return u};o.BREAK=e,o.RETURN=n}),Ut=rt("species"),$t=function(t,e){var n,o=p(t).constructor;return void 0===o||void 0==(n=p(o)[Ut])?e:f(n)},Vt=c.process,Ht=c.setImmediate,Xt=c.clearImmediate,Yt=c.MessageChannel,Gt=c.Dispatch,Wt=0,Kt={},zt=function(){var t=+this;if(Kt.hasOwnProperty(t)){var e=Kt[t];delete Kt[t],e()}},qt=function(t){zt.call(t.data)};Ht&&Xt||(Ht=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Kt[++Wt]=function(){!function(t,e,n){var o=void 0===n;switch(e.length){case 0:return o?t():t.call(n);case 1:return o?t(e[0]):t.call(n,e[0]);case 2:return o?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}t.apply(n,e)}("function"==typeof t?t:Function(t),e)},Ct(Wt),Wt},Xt=function(t){delete Kt[t]},"process"==j(Vt)?Ct=function(t){Vt.nextTick(d(zt,t,1))}:Gt&&Gt.now?Ct=function(t){Gt.now(d(zt,t,1))}:Yt?(Mt=(Tt=new Yt).port2,Tt.port1.onmessage=qt,Ct=d(Mt.postMessage,Mt,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(Ct=function(t){c.postMessage(t+"","*")},c.addEventListener("message",qt,!1)):Ct="onreadystatechange"in y("script")?function(t){Q.appendChild(y("script")).onreadystatechange=function(){Q.removeChild(this),zt.call(t)}}:function(t){setTimeout(d(zt,t,1),0)});var Jt={set:Ht,clear:Xt},Zt=Jt.set,Qt=c.MutationObserver||c.WebKitMutationObserver,te=c.process,ee=c.Promise,ne="process"==j(te);var oe={f:function(t){return new function(t){var e,n;this.promise=new t(function(t,o){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=o}),this.resolve=f(e),this.reject=f(n)}(t)}},re=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},ie=function(t,e){if(p(t),h(e)&&e.constructor===t)return e;var n=oe.f(t);return(0,n.resolve)(e),n.promise},ae=rt("species"),le=rt("iterator"),se=!1;try{[7][le]().return=function(){se=!0}}catch(t){}var ce,ue,fe,de,he,pe,ve=function(t,e){if(!e&&!se)return!1;var n=!1;try{var o=[7],r=o[le]();r.next=function(){return{done:n=!0}},o[le]=function(){return r},t(o)}catch(t){}return n},me=Jt.set,ge=function(){var t,e,n,o=function(){var o,r;for(ne&&(o=te.domain)&&o.exit();t;){r=t.fn,t=t.next;try{r()}catch(o){throw t?n():e=void 0,o}}e=void 0,o&&o.enter()};if(ne)n=function(){te.nextTick(o)};else if(!Qt||c.navigator&&c.navigator.standalone)if(ee&&ee.resolve){var r=ee.resolve();n=function(){r.then(o)}}else n=function(){Zt.call(c,o)};else{var i=!0,a=document.createTextNode("");new Qt(o).observe(a,{characterData:!0}),n=function(){a.data=i=!i}}return function(o){var r={fn:o,next:void 0};e&&(e.next=r),t||(t=r,n()),e=r}}(),be=c.TypeError,ye=c.process,we=c.Promise,_e="process"==Pt(ye),Ee=function(){},xe=ue=oe.f,Se=!!function(){try{var t=we.resolve(1),e=(t.constructor={})[rt("species")]=function(t){t(Ee,Ee)};return(_e||"function"==typeof PromiseRejectionEvent)&&t.then(Ee)instanceof e}catch(t){}}(),Oe=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},De=function(t,e){if(!t._n){t._n=!0;var n=t._c;ge(function(){for(var o=t._v,r=1==t._s,i=0,a=function(e){var n,i,a,l=r?e.ok:e.fail,s=e.resolve,c=e.reject,u=e.domain;try{l?(r||(2==t._h&&Me(t),t._h=1),!0===l?n=o:(u&&u.enter(),n=l(o),u&&(u.exit(),a=!0)),n===e.promise?c(be("Promise-chain cycle")):(i=Oe(n))?i.call(n,s,c):s(n)):c(o)}catch(t){u&&!a&&u.exit(),c(t)}};n.length>i;)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&Ce(t)})}},Ce=function(t){me.call(c,function(){var e,n,o,r=t._v,i=Te(t);if(i&&(e=re(function(){_e?ye.emit("unhandledRejection",r,t):(n=c.onunhandledrejection)?n({promise:t,reason:r}):(o=c.console)&&o.error&&o.error("Unhandled promise rejection",r)}),t._h=_e||Te(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},Te=function(t){return 1!==t._h&&0===(t._a||t._c).length},Me=function(t){me.call(c,function(){var e;_e?ye.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},Ie=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),De(e,!0))},Ae=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw be("Promise can't be resolved itself");(e=Oe(t))?ge(function(){var o={_w:n,_d:!1};try{e.call(t,d(Ae,o,1),d(Ie,o,1))}catch(t){Ie.call(o,t)}}):(n._v=t,n._s=1,De(n,!1))}catch(t){Ie.call({_w:n,_d:!1},t)}}};Se||(we=function(t){!function(t,e,n,o){if(!(t instanceof e)||void 0!==o&&o in t)throw TypeError(n+": incorrect invocation!")}(this,we,"Promise","_h"),f(t),ce.call(this);try{t(d(Ae,this,1),d(Ie,this,1))}catch(t){Ie.call(this,t)}},(ce=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=function(t,e,n){for(var o in e)n&&t[o]?t[o]=e[o]:S(t,o,e[o]);return t}(we.prototype,{then:function(t,e){var n=xe($t(this,we));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=_e?ye.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&De(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),fe=function(){var t=new ce;this.promise=t,this.resolve=d(Ae,t,1),this.reject=d(Ie,t,1)},oe.f=xe=function(t){return t===we||t===de?new fe(t):ue(t)}),M(M.G+M.W+M.F*!Se,{Promise:we}),lt(we,"Promise"),pe="function"==typeof u[he="Promise"]?u[he]:c[he],m&&pe&&!pe[ae]&&E.f(pe,ae,{configurable:!0,get:function(){return this}}),de=u.Promise,M(M.S+M.F*!Se,"Promise",{reject:function(t){var e=xe(this);return(0,e.reject)(t),e.promise}}),M(M.S+!0*M.F,"Promise",{resolve:function(t){return ie(this===de?we:this,t)}}),M(M.S+M.F*!(Se&&ve(function(t){we.all(t).catch(Ee)})),"Promise",{all:function(t){var e=this,n=xe(e),o=n.resolve,r=n.reject,i=re(function(){var n=[],i=0,a=1;Rt(t,!1,function(t){var l=i++,s=!1;n.push(void 0),a++,e.resolve(t).then(function(t){s||(s=!0,n[l]=t,--a||o(n))},r)}),--a||o(n)});return i.e&&r(i.v),n.promise},race:function(t){var e=this,n=xe(e),o=n.reject,r=re(function(){Rt(t,!1,function(t){e.resolve(t).then(n.resolve,o)})});return r.e&&o(r.v),n.promise}}),M(M.P+M.R,"Promise",{finally:function(t){var e=$t(this,u.Promise||c.Promise),n="function"==typeof t;return this.then(n?function(n){return ie(e,t()).then(function(){return n})}:t,n?function(n){return ie(e,t()).then(function(){throw n})}:t)}}),M(M.S,"Promise",{try:function(t){var e=oe.f(this),n=re(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}});var Pe=u.Promise,je=o(r(function(t){t.exports={default:Pe,__esModule:!0}})),Le=u.JSON||(u.JSON={stringify:JSON.stringify}),Ne=function(t){return Le.stringify.apply(Le,arguments)},ke=o(r(function(t){t.exports={default:Ne,__esModule:!0}})),Be={f:Object.getOwnPropertySymbols},Fe={f:{}.propertyIsEnumerable},Re=Object.assign,Ue=!Re||v(function(){var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach(function(t){e[t]=t}),7!=Re({},t)[n]||Object.keys(Re({},e)).join("")!=o})?function(t,e){for(var n=ft(t),o=arguments.length,r=1,i=Be.f,a=Fe.f;o>r;)for(var l,s=L(arguments[r++]),c=i?q(s).concat(i(s)):q(s),u=c.length,f=0;u>f;)a.call(s,l=c[f++])&&(n[l]=s[l]);return n}:Re;M(M.S+M.F,"Object",{assign:Ue});var $e=u.Object.assign,Ve=r(function(t){t.exports={default:$e,__esModule:!0}});o(Ve);var He=o(r(function(t,e){e.__esModule=!0;var n,o=(n=Ve)&&n.__esModule?n:{default:n};e.default=o.default||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}})),Xe=function(t,e,n){e in t?E.f(t,e,x(0,n)):t[e]=n};M(M.S+M.F*!ve(function(t){}),"Array",{from:function(t){var e,n,o,r,i=ft(t),a="function"==typeof this?this:Array,l=arguments.length,s=l>1?arguments[1]:void 0,c=void 0!==s,u=0,f=Ft(i);if(c&&(s=d(s,l>2?arguments[2]:void 0,2)),void 0==f||a==Array&&kt(f))for(n=new a(e=B(i.length));e>u;u++)Xe(n,u,c?s(i[u],u):i[u]);else for(r=f.call(i),n=new a;!(o=r.next()).done;u++)Xe(n,u,c?jt(r,s,[o.value,u],!0):o.value);return n.length=u,n}});var Ye=u.Array.from,Ge=r(function(t){t.exports={default:Ye,__esModule:!0}});o(Ge);var We=o(r(function(t,e){e.__esModule=!0;var n,o=(n=Ge)&&n.__esModule?n:{default:n};e.default=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return(0,o.default)(t)}}));function Ke(t){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ze(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qe(){return(qe=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function Je(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){ze(t,e,n[e])})}return t}function Ze(t,e){if(null==t)return{};var n,o,r=function(t,e){if(null==t)return{};var n,o,r={},i=Object.keys(t);for(o=0;o<i.length;o++)n=i[o],e.indexOf(n)>=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)n=i[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Qe(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function tn(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var en=tn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),nn=tn(/Edge/i),on=tn(/firefox/i),rn=tn(/safari/i)&&!tn(/chrome/i)&&!tn(/android/i),an=tn(/iP(ad|od|hone)/i),ln=tn(/chrome/i)&&tn(/android/i),sn={capture:!1,passive:!1};function cn(t,e,n){t.addEventListener(e,n,!en&&sn)}function un(t,e,n){t.removeEventListener(e,n,!en&&sn)}function fn(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function dn(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function hn(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&fn(t,e):fn(t,e))||o&&t===n)return t;if(t===n)break}while(t=dn(t))}return null}var pn,vn=/\s+/g;function mn(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(vn," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(vn," ")}}function gn(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function bn(t,e){var n="";if("string"==typeof t)n=t;else do{var o=gn(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function yn(t,e,n){if(t){var o=t.getElementsByTagName(e),r=0,i=o.length;if(n)for(;r<i;r++)n(o[r],r);return o}return[]}function wn(){var t=document.scrollingElement;return t||document.documentElement}function _n(t,e,n,o,r){if(t.getBoundingClientRect||t===window){var i,a,l,s,c,u,f;if(t!==window&&t!==wn()?(a=(i=t.getBoundingClientRect()).top,l=i.left,s=i.bottom,c=i.right,u=i.height,f=i.width):(a=0,l=0,s=window.innerHeight,c=window.innerWidth,u=window.innerHeight,f=window.innerWidth),(e||n)&&t!==window&&(r=r||t.parentNode,!en))do{if(r&&r.getBoundingClientRect&&("none"!==gn(r,"transform")||n&&"static"!==gn(r,"position"))){var d=r.getBoundingClientRect();a-=d.top+parseInt(gn(r,"border-top-width")),l-=d.left+parseInt(gn(r,"border-left-width")),s=a+i.height,c=l+i.width;break}}while(r=r.parentNode);if(o&&t!==window){var h=bn(r||t),p=h&&h.a,v=h&&h.d;h&&(s=(a/=v)+(u/=v),c=(l/=p)+(f/=p))}return{top:a,left:l,bottom:s,right:c,width:f,height:u}}}function En(t,e,n){for(var o=Cn(t,!0),r=_n(t)[e];o;){var i=_n(o)[n];if(!("top"===n||"left"===n?r>=i:r<=i))return o;if(o===wn())break;o=Cn(o,!1)}return!1}function xn(t,e,n){for(var o=0,r=0,i=t.children;r<i.length;){if("none"!==i[r].style.display&&i[r]!==jo.ghost&&i[r]!==jo.dragged&&hn(i[r],n.draggable,t,!1)){if(o===e)return i[r];o++}r++}return null}function Sn(t,e){for(var n=t.lastElementChild;n&&(n===jo.ghost||"none"===gn(n,"display")||e&&!fn(n,e));)n=n.previousElementSibling;return n||null}function On(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===jo.clone||e&&!fn(t,e)||n++;return n}function Dn(t){var e=0,n=0,o=wn();if(t)do{var r=bn(t),i=r.a,a=r.d;e+=t.scrollLeft*i,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function Cn(t,e){if(!t||!t.getBoundingClientRect)return wn();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=gn(n);if(n.clientWidth<n.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!n.getBoundingClientRect||n===document.body)return wn();if(o||e)return n;o=!0}}}while(n=n.parentNode);return wn()}function Tn(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Mn(t,e){return function(){if(!pn){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),pn=setTimeout(function(){pn=void 0},e)}}}function In(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function An(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function Pn(t,e){gn(t,"position","absolute"),gn(t,"top",e.top),gn(t,"left",e.left),gn(t,"width",e.width),gn(t,"height",e.height)}function jn(t){gn(t,"position",""),gn(t,"top",""),gn(t,"left",""),gn(t,"width",""),gn(t,"height","")}var Ln="Sortable"+(new Date).getTime();function Nn(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(t){if("none"!==gn(t,"display")&&t!==jo.ghost){e.push({target:t,rect:_n(t)});var n=Je({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=bn(t,!0);o&&(n.top-=o.f,n.left-=o.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(e,{target:t}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof n&&n());var r=!1,i=0;e.forEach(function(t){var e=0,n=t.target,a=n.fromRect,l=_n(n),s=n.prevFromRect,c=n.prevToRect,u=t.rect,f=bn(n,!0);f&&(l.top-=f.f,l.left-=f.e),n.toRect=l,n.thisAnimationDuration&&Tn(s,l)&&!Tn(a,l)&&(u.top-l.top)/(u.left-l.left)==(a.top-l.top)/(a.left-l.left)&&(e=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,s,c,o.options)),Tn(l,a)||(n.prevFromRect=a,n.prevToRect=l,e||(e=o.options.animation),o.animate(n,u,l,e)),e&&(r=!0,i=Math.max(i,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},e),n.thisAnimationDuration=e)}),clearTimeout(t),r?t=setTimeout(function(){"function"==typeof n&&n()},i):"function"==typeof n&&n(),e=[]},animate:function(t,e,n,o){if(o){gn(t,"transition",""),gn(t,"transform","");var r=bn(this.el),i=r&&r.a,a=r&&r.d,l=(e.left-n.left)/(i||1),s=(e.top-n.top)/(a||1);t.animatingX=!!l,t.animatingY=!!s,gn(t,"transform","translate3d("+l+"px,"+s+"px,0)"),function(t){t.offsetWidth}(t),gn(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),gn(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){gn(t,"transition",""),gn(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},o)}}}}var kn=[],Bn={initializeByDefault:!0},Fn={mount:function(t){for(var e in Bn)!Bn.hasOwnProperty(e)||e in t||(t[e]=Bn[e]);kn.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var r=t+"Global";kn.forEach(function(o){e[o.pluginName]&&(e[o.pluginName][r]&&e[o.pluginName][r](Je({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](Je({sortable:e},n)))})},initializePlugins:function(t,e,n,o){for(var r in kn.forEach(function(o){var r=o.pluginName;if(t.options[r]||o.initializeByDefault){var i=new o(t,e,t.options);i.sortable=t,i.options=t.options,t[r]=i,qe(n,i.defaults)}}),t.options)if(t.options.hasOwnProperty(r)){var i=this.modifyOption(t,r,t.options[r]);void 0!==i&&(t.options[r]=i)}},getEventProperties:function(t,e){var n={};return kn.forEach(function(o){"function"==typeof o.eventProperties&&qe(n,o.eventProperties.call(e[o.pluginName],t))}),n},modifyOption:function(t,e,n){var o;return kn.forEach(function(r){t[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[e]&&(o=r.optionListeners[e].call(t[r.pluginName],n))}),o}};function Rn(t){var e=t.sortable,n=t.rootEl,o=t.name,r=t.targetEl,i=t.cloneEl,a=t.toEl,l=t.fromEl,s=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,f=t.newDraggableIndex,d=t.originalEvent,h=t.putSortable,p=t.extraEventProperties;if(e=e||n&&n[Ln]){var v,m=e.options,g="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||en||nn?(v=document.createEvent("Event")).initEvent(o,!0,!0):v=new CustomEvent(o,{bubbles:!0,cancelable:!0}),v.to=a||n,v.from=l||n,v.item=r||n,v.clone=i,v.oldIndex=s,v.newIndex=c,v.oldDraggableIndex=u,v.newDraggableIndex=f,v.originalEvent=d,v.pullMode=h?h.lastPutMode:void 0;var b=Je({},p,Fn.getEventProperties(o,e));for(var y in b)v[y]=b[y];n&&n.dispatchEvent(v),m[g]&&m[g].call(e,v)}}var Un,$n,Vn,Hn,Xn,Yn,Gn,Wn,Kn,zn,qn,Jn,Zn,Qn,to=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,r=Ze(n,["evt"]);Fn.pluginEvent.bind(jo)(t,e,Je({dragEl:Un,parentEl:$n,ghostEl:Vn,rootEl:Hn,nextEl:Xn,lastDownEl:Yn,cloneEl:Gn,cloneHidden:Wn,dragStarted:so,putSortable:Qn,activeSortable:jo.active,originalEvent:o,oldIndex:Kn,oldDraggableIndex:qn,newIndex:zn,newDraggableIndex:Jn,hideGhostForTarget:Mo,unhideGhostForTarget:Io,cloneNowHidden:function(){Wn=!0},cloneNowShown:function(){Wn=!1},dispatchSortableEvent:function(t){eo({sortable:e,name:t,originalEvent:o})}},r))};function eo(t){Rn(Je({putSortable:Qn,cloneEl:Gn,targetEl:Un,rootEl:Hn,oldIndex:Kn,oldDraggableIndex:qn,newIndex:zn,newDraggableIndex:Jn},t))}var no,oo,ro,io,ao,lo,so,co,uo,fo,ho,po=!1,vo=!1,mo=[],go=!1,bo=!1,yo=[],wo=!1,_o=[],Eo="undefined"!=typeof document,xo=an,So=nn||en?"cssFloat":"float",Oo=Eo&&!ln&&!an&&"draggable"in document.createElement("div"),Do=function(){if(Eo){if(en)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Co=function(t,e){var n=gn(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=xn(t,0,e),i=xn(t,1,e),a=r&&gn(r),l=i&&gn(i),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+_n(r).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+_n(i).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!i||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return r&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[So]||i&&"none"===n[So]&&s+c>o)?"vertical":"horizontal"},To=function(t){function e(t,n){return function(o,r,i,a){var l=o.options.group.name&&r.options.group.name&&o.options.group.name===r.options.group.name;if(null==t&&(n||l))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,r,i,a),n)(o,r,i,a);var s=(n?o:r).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var n={},o=t.group;o&&"object"==Ke(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Mo=function(){!Do&&Vn&&gn(Vn,"display","none")},Io=function(){!Do&&Vn&&gn(Vn,"display","")};Eo&&document.addEventListener("click",function(t){if(vo)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),vo=!1,!1},!0);var Ao=function(t){if(Un){t=t.touches?t.touches[0]:t;var e=(r=t.clientX,i=t.clientY,mo.some(function(t){if(!Sn(t)){var e=_n(t),n=t[Ln].options.emptyInsertThreshold,o=r>=e.left-n&&r<=e.right+n,l=i>=e.top-n&&i<=e.bottom+n;return n&&o&&l?a=t:void 0}}),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[Ln]._onDragOver(n)}}var r,i,a},Po=function(t){Un&&Un.parentNode[Ln]._isOutsideThisEl(t.target)};function jo(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=qe({},e),t[Ln]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Co(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==jo.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var o in Fn.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var r in To(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Oo,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?cn(t,"pointerdown",this._onTapStart):(cn(t,"mousedown",this._onTapStart),cn(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(cn(t,"dragover",this),cn(t,"dragenter",this)),mo.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),qe(this,Nn())}function Lo(t,e,n,o,r,i,a,l){var s,c,u=t[Ln],f=u.options.onMove;return!window.CustomEvent||en||nn?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=r||e,s.relatedRect=i||_n(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),f&&(c=f.call(u,s,a)),c}function No(t){t.draggable=!1}function ko(){wo=!1}function Bo(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Fo(t){return setTimeout(t,0)}function Ro(t){return clearTimeout(t)}jo.prototype={constructor:jo,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(co=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Un):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,r=o.preventOnFilter,i=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){_o.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&_o.push(o)}}(n),!Un&&!(/mousedown|pointerdown/.test(i)&&0!==t.button||o.disabled||s.isContentEditable||(l=hn(l,o.draggable,n,!1))&&l.animated||Yn===l)){if(Kn=On(l),qn=On(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return eo({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),to("filter",e,{evt:t}),void(r&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some(function(o){if(o=hn(s,o.trim(),n,!1))return eo({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),to("filter",e,{evt:t}),!0})))return void(r&&t.cancelable&&t.preventDefault());o.handle&&!hn(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,r=this,i=r.el,a=r.options,l=i.ownerDocument;if(n&&!Un&&n.parentNode===i){var s=_n(n);if(Hn=i,$n=(Un=n).parentNode,Xn=Un.nextSibling,Yn=n,Zn=a.group,jo.dragged=Un,no={target:Un,clientX:(e||t).clientX,clientY:(e||t).clientY},ao=no.clientX-s.left,lo=no.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Un.style["will-change"]="all",o=function(){to("delayEnded",r,{evt:t}),jo.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!on&&r.nativeDraggable&&(Un.draggable=!0),r._triggerDragStart(t,e),eo({sortable:r,name:"choose",originalEvent:t}),mn(Un,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){yn(Un,t.trim(),No)}),cn(l,"dragover",Ao),cn(l,"mousemove",Ao),cn(l,"touchmove",Ao),cn(l,"mouseup",r._onDrop),cn(l,"touchend",r._onDrop),cn(l,"touchcancel",r._onDrop),on&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Un.draggable=!0),to("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(nn||en))o();else{if(jo.eventCanceled)return void this._onDrop();cn(l,"mouseup",r._disableDelayedDrag),cn(l,"touchend",r._disableDelayedDrag),cn(l,"touchcancel",r._disableDelayedDrag),cn(l,"mousemove",r._delayedDragTouchMoveHandler),cn(l,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&cn(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Un&&No(Un),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;un(t,"mouseup",this._disableDelayedDrag),un(t,"touchend",this._disableDelayedDrag),un(t,"touchcancel",this._disableDelayedDrag),un(t,"mousemove",this._delayedDragTouchMoveHandler),un(t,"touchmove",this._delayedDragTouchMoveHandler),un(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?cn(document,"pointermove",this._onTouchMove):cn(document,e?"touchmove":"mousemove",this._onTouchMove):(cn(Un,"dragend",this),cn(Hn,"dragstart",this._onDragStart));try{document.selection?Fo(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(po=!1,Hn&&Un){to("dragStarted",this,{evt:e}),this.nativeDraggable&&cn(document,"dragover",Po);var n=this.options;!t&&mn(Un,n.dragClass,!1),mn(Un,n.ghostClass,!0),jo.active=this,t&&this._appendGhost(),eo({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(oo){this._lastX=oo.clientX,this._lastY=oo.clientY,Mo();for(var t=document.elementFromPoint(oo.clientX,oo.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(oo.clientX,oo.clientY))!==e;)e=t;if(Un.parentNode[Ln]._isOutsideThisEl(t),e)do{if(e[Ln]){if(e[Ln]._onDragOver({clientX:oo.clientX,clientY:oo.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Io()}},_onTouchMove:function(t){if(no){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,r=t.touches?t.touches[0]:t,i=Vn&&bn(Vn,!0),a=Vn&&i&&i.a,l=Vn&&i&&i.d,s=xo&&ho&&Dn(ho),c=(r.clientX-no.clientX+o.x)/(a||1)+(s?s[0]-yo[0]:0)/(a||1),u=(r.clientY-no.clientY+o.y)/(l||1)+(s?s[1]-yo[1]:0)/(l||1);if(!jo.active&&!po){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(Vn){i?(i.e+=c-(ro||0),i.f+=u-(io||0)):i={a:1,b:0,c:0,d:1,e:c,f:u};var f="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");gn(Vn,"webkitTransform",f),gn(Vn,"mozTransform",f),gn(Vn,"msTransform",f),gn(Vn,"transform",f),ro=c,io=u,oo=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Vn){var t=this.options.fallbackOnBody?document.body:Hn,e=_n(Un,!0,xo,!0,t),n=this.options;if(xo){for(ho=t;"static"===gn(ho,"position")&&"none"===gn(ho,"transform")&&ho!==document;)ho=ho.parentNode;ho!==document.body&&ho!==document.documentElement?(ho===document&&(ho=wn()),e.top+=ho.scrollTop,e.left+=ho.scrollLeft):ho=wn(),yo=Dn(ho)}mn(Vn=Un.cloneNode(!0),n.ghostClass,!1),mn(Vn,n.fallbackClass,!0),mn(Vn,n.dragClass,!0),gn(Vn,"transition",""),gn(Vn,"transform",""),gn(Vn,"box-sizing","border-box"),gn(Vn,"margin",0),gn(Vn,"top",e.top),gn(Vn,"left",e.left),gn(Vn,"width",e.width),gn(Vn,"height",e.height),gn(Vn,"opacity","0.8"),gn(Vn,"position",xo?"absolute":"fixed"),gn(Vn,"zIndex","100000"),gn(Vn,"pointerEvents","none"),jo.ghost=Vn,t.appendChild(Vn),gn(Vn,"transform-origin",ao/parseInt(Vn.style.width)*100+"% "+lo/parseInt(Vn.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,r=n.options;to("dragStart",this,{evt:t}),jo.eventCanceled?this._onDrop():(to("setupClone",this),jo.eventCanceled||((Gn=An(Un)).draggable=!1,Gn.style["will-change"]="",this._hideClone(),mn(Gn,this.options.chosenClass,!1),jo.clone=Gn),n.cloneId=Fo(function(){to("clone",n),jo.eventCanceled||(n.options.removeCloneOnHide||Hn.insertBefore(Gn,Un),n._hideClone(),eo({sortable:n,name:"clone"}))}),!e&&mn(Un,r.dragClass,!0),e?(vo=!0,n._loopId=setInterval(n._emulateDragOver,50)):(un(document,"mouseup",n._onDrop),un(document,"touchend",n._onDrop),un(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",r.setData&&r.setData.call(n,o,Un)),cn(document,"drop",n),gn(Un,"transform","translateZ(0)")),po=!0,n._dragStartId=Fo(n._dragStarted.bind(n,e,t)),cn(document,"selectstart",n),so=!0,rn&&gn(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,o,r,i=this.el,a=t.target,l=this.options,s=l.group,c=jo.active,u=Zn===s,f=l.sort,d=Qn||c,h=this,p=!1;if(!wo){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),a=hn(a,l.draggable,i,!0),T("dragOver"),jo.eventCanceled)return p;if(Un.contains(t.target)||a.animated&&a.animatingX&&a.animatingY||h._ignoreWhileAnimating===a)return I(!1);if(vo=!1,c&&!l.disabled&&(u?f||(o=!Hn.contains(Un)):Qn===this||(this.lastPutMode=Zn.checkPull(this,c,Un,t))&&s.checkPut(this,c,Un,t))){if(r="vertical"===this._getDirection(t,a),e=_n(Un),T("dragOverValid"),jo.eventCanceled)return p;if(o)return $n=Hn,M(),this._hideClone(),T("revert"),jo.eventCanceled||(Xn?Hn.insertBefore(Un,Xn):Hn.appendChild(Un)),I(!0);var v=Sn(i,l.draggable);if(!v||function(t,e,n){var o=_n(Sn(n.el,n.options.draggable));return e?t.clientX>o.right+10||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+10}(t,r,this)&&!v.animated){if(v===Un)return I(!1);if(v&&i===t.target&&(a=v),a&&(n=_n(a)),!1!==Lo(Hn,i,Un,e,a,n,t,!!a))return M(),i.appendChild(Un),$n=i,A(),I(!0)}else if(a.parentNode===i){n=_n(a);var m,g,b,y=Un.parentNode!==i,w=!function(t,e,n){var o=n?t.left:t.top,r=n?t.right:t.bottom,i=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||r===l||o+i/2===a+s/2}(Un.animated&&Un.toRect||e,a.animated&&a.toRect||n,r),_=r?"top":"left",E=En(a,"top","top")||En(Un,"top","top"),x=E?E.scrollTop:void 0;if(co!==a&&(g=n[_],go=!1,bo=!w&&l.invertSwap||y),0!==(m=function(t,e,n,o,r,i,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,f=o?n.bottom:n.right,d=!1;if(!a)if(l&&fo<c*r){if(!go&&(1===uo?s>u+c*i/2:s<f-c*i/2)&&(go=!0),go)d=!0;else if(1===uo?s<u+fo:s>f-fo)return-uo}else if(s>u+c*(1-r)/2&&s<f-c*(1-r)/2)return function(t){return On(Un)<On(t)?1:-1}(e);if((d=d||a)&&(s<u+c*i/2||s>f-c*i/2))return s>u+c/2?1:-1;return 0}(t,a,n,r,w?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,bo,co===a))){var S=On(Un);do{S-=m,b=$n.children[S]}while(b&&("none"===gn(b,"display")||b===Vn))}if(0===m||b===a)return I(!1);co=a,uo=m;var O=a.nextElementSibling,D=!1,C=Lo(Hn,i,Un,e,a,n,t,D=1===m);if(!1!==C)return 1!==C&&-1!==C||(D=1===C),wo=!0,setTimeout(ko,30),M(),D&&!O?i.appendChild(Un):a.parentNode.insertBefore(Un,D?O:a),E&&In(E,0,x-E.scrollTop),$n=Un.parentNode,void 0===g||bo||(fo=Math.abs(g-_n(a)[_])),A(),I(!0)}if(i.contains(Un))return I(!1)}return!1}function T(l,s){to(l,h,Je({evt:t,isOwner:u,axis:r?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:f,fromSortable:d,target:a,completed:I,onMove:function(n,o){return Lo(Hn,i,Un,e,n,_n(n),t,o)},changed:A},s))}function M(){T("dragOverAnimationCapture"),h.captureAnimationState(),h!==d&&d.captureAnimationState()}function I(e){return T("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(h),h!==d&&(mn(Un,Qn?Qn.options.ghostClass:c.options.ghostClass,!1),mn(Un,l.ghostClass,!0)),Qn!==h&&h!==jo.active?Qn=h:h===jo.active&&Qn&&(Qn=null),d===h&&(h._ignoreWhileAnimating=a),h.animateAll(function(){T("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(a===Un&&!Un.animated||a===i&&!a.animated)&&(co=null),l.dragoverBubble||t.rootEl||a===document||(Un.parentNode[Ln]._isOutsideThisEl(t.target),!e&&Ao(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function A(){zn=On(Un),Jn=On(Un,l.draggable),eo({sortable:h,name:"change",toEl:i,newIndex:zn,newDraggableIndex:Jn,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){un(document,"mousemove",this._onTouchMove),un(document,"touchmove",this._onTouchMove),un(document,"pointermove",this._onTouchMove),un(document,"dragover",Ao),un(document,"mousemove",Ao),un(document,"touchmove",Ao)},_offUpEvents:function(){var t=this.el.ownerDocument;un(t,"mouseup",this._onDrop),un(t,"touchend",this._onDrop),un(t,"pointerup",this._onDrop),un(t,"touchcancel",this._onDrop),un(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;zn=On(Un),Jn=On(Un,n.draggable),to("drop",this,{evt:t}),$n=Un&&Un.parentNode,zn=On(Un),Jn=On(Un,n.draggable),jo.eventCanceled?this._nulling():(po=!1,bo=!1,go=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ro(this.cloneId),Ro(this._dragStartId),this.nativeDraggable&&(un(document,"drop",this),un(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),rn&&gn(document.body,"user-select",""),gn(Un,"transform",""),t&&(so&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Vn&&Vn.parentNode&&Vn.parentNode.removeChild(Vn),(Hn===$n||Qn&&"clone"!==Qn.lastPutMode)&&Gn&&Gn.parentNode&&Gn.parentNode.removeChild(Gn),Un&&(this.nativeDraggable&&un(Un,"dragend",this),No(Un),Un.style["will-change"]="",so&&!po&&mn(Un,Qn?Qn.options.ghostClass:this.options.ghostClass,!1),mn(Un,this.options.chosenClass,!1),eo({sortable:this,name:"unchoose",toEl:$n,newIndex:null,newDraggableIndex:null,originalEvent:t}),Hn!==$n?(zn>=0&&(eo({rootEl:$n,name:"add",toEl:$n,fromEl:Hn,originalEvent:t}),eo({sortable:this,name:"remove",toEl:$n,originalEvent:t}),eo({rootEl:$n,name:"sort",toEl:$n,fromEl:Hn,originalEvent:t}),eo({sortable:this,name:"sort",toEl:$n,originalEvent:t})),Qn&&Qn.save()):zn!==Kn&&zn>=0&&(eo({sortable:this,name:"update",toEl:$n,originalEvent:t}),eo({sortable:this,name:"sort",toEl:$n,originalEvent:t})),jo.active&&(null!=zn&&-1!==zn||(zn=Kn,Jn=qn),eo({sortable:this,name:"end",toEl:$n,originalEvent:t}),this.save()))),this._nulling())},_nulling:function(){to("nulling",this),Hn=Un=$n=Vn=Xn=Gn=Yn=Wn=no=oo=so=zn=Jn=Kn=qn=co=uo=Qn=Zn=jo.dragged=jo.ghost=jo.clone=jo.active=null,_o.forEach(function(t){t.checked=!0}),_o.length=ro=io=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Un&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,r=n.length,i=this.options;o<r;o++)hn(t=n[o],i.draggable,this.el,!1)&&e.push(t.getAttribute(i.dataIdAttr)||Bo(t));return e},sort:function(t){var e={},n=this.el;this.toArray().forEach(function(t,o){var r=n.children[o];hn(r,this.options.draggable,n,!1)&&(e[t]=r)},this),t.forEach(function(t){e[t]&&(n.removeChild(e[t]),n.appendChild(e[t]))})},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return hn(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=Fn.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&To(n)},destroy:function(){to("destroy",this);var t=this.el;t[Ln]=null,un(t,"mousedown",this._onTapStart),un(t,"touchstart",this._onTapStart),un(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(un(t,"dragover",this),un(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),mo.splice(mo.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Wn){if(to("hideClone",this),jo.eventCanceled)return;gn(Gn,"display","none"),this.options.removeCloneOnHide&&Gn.parentNode&&Gn.parentNode.removeChild(Gn),Wn=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(Wn){if(to("showClone",this),jo.eventCanceled)return;Hn.contains(Un)&&!this.options.group.revertClone?Hn.insertBefore(Gn,Un):Xn?Hn.insertBefore(Gn,Xn):Hn.appendChild(Gn),this.options.group.revertClone&&this.animate(Un,Gn),gn(Gn,"display",""),Wn=!1}}else this._hideClone()}},Eo&&cn(document,"touchmove",function(t){(jo.active||po)&&t.cancelable&&t.preventDefault()}),jo.utils={on:cn,off:un,css:gn,find:yn,is:function(t,e){return!!hn(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:Mn,closest:hn,toggleClass:mn,clone:An,index:On,nextTick:Fo,cancelNextTick:Ro,detectDirection:Co,getChild:xn},jo.get=function(t){return t[Ln]},jo.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(jo.utils=Je({},jo.utils,t.utils)),Fn.mount(t)})},jo.create=function(t,e){return new jo(t,e)},jo.version="1.10.2";var Uo,$o,Vo,Ho,Xo,Yo,Go=[],Wo=!1;function Ko(){Go.forEach(function(t){clearInterval(t.pid)}),Go=[]}function zo(){clearInterval(Yo)}var qo,Jo=Mn(function(t,e,n,o){if(e.scroll){var r,i=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,l=e.scrollSensitivity,s=e.scrollSpeed,c=wn(),u=!1;$o!==n&&($o=n,Ko(),Uo=e.scroll,r=e.scrollFn,!0===Uo&&(Uo=Cn(n,!0)));var f=0,d=Uo;do{var h=d,p=_n(h),v=p.top,m=p.bottom,g=p.left,b=p.right,y=p.width,w=p.height,_=void 0,E=void 0,x=h.scrollWidth,S=h.scrollHeight,O=gn(h),D=h.scrollLeft,C=h.scrollTop;h===c?(_=y<x&&("auto"===O.overflowX||"scroll"===O.overflowX||"visible"===O.overflowX),E=w<S&&("auto"===O.overflowY||"scroll"===O.overflowY||"visible"===O.overflowY)):(_=y<x&&("auto"===O.overflowX||"scroll"===O.overflowX),E=w<S&&("auto"===O.overflowY||"