UNPKG

undo-redo-vuex

Version:

A Vuex plugin for module namespaced undo and redo functionality. This plugin takes inspiration from and extends the work of [vuex-undo-redo](https://github.com/anthonygore/vuex-undo-redo).

1 lines 36.2 kB
function t(t,n){return t(n={exports:{}},n.exports),n.exports}t(function(t){var n=function(t){var n,e=Object.prototype,r=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(t,n,e,r){var o=n&&n.prototype instanceof v?n:v,i=Object.create(o.prototype),c=new k(r||[]);return i._invoke=function(t,n,e){var r=f;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return L()}for(e.method=o,e.arg=i;;){var c=e.delegate;if(c){var a=R(c,e);if(a){if(a===d)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(r===f)throw r=h,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r=p;var u=s(t,n,e);if("normal"===u.type){if(r=e.done?h:l,u.arg===d)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(r=h,e.method="throw",e.arg=u.arg)}}}(t,e,c),i}function s(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f="suspendedStart",l="suspendedYield",p="executing",h="completed",d={};function v(){}function y(){}function g(){}var m={};m[i]=function(){return this};var x=Object.getPrototypeOf,w=x&&x(x(E([])));w&&w!==e&&r.call(w,i)&&(m=w);var b=g.prototype=v.prototype=Object.create(m);function _(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function O(t){var n;this._invoke=function(e,o){function i(){return new Promise(function(n,i){!function n(e,o,i,c){var a=s(t[e],t,o);if("throw"!==a.type){var u=a.arg,f=u.value;return f&&"object"==typeof f&&r.call(f,"__await")?Promise.resolve(f.__await).then(function(t){n("next",t,i,c)},function(t){n("throw",t,i,c)}):Promise.resolve(f).then(function(t){u.value=t,i(u)},function(t){return n("throw",t,i,c)})}c(a.arg)}(e,o,n,i)})}return n=n?n.then(i,i):i()}}function R(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,R(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=s(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function S(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function j(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function E(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,c=function e(){for(;++o<t.length;)if(r.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=n,e.done=!0,e};return c.next=c}}return{next:L}}function L(){return{value:n,done:!0}}return y.prototype=b.constructor=g,g.constructor=y,g[a]=y.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===y||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},_(O.prototype),O.prototype[c]=function(){return this},t.AsyncIterator=O,t.async=function(n,e,r,o){var i=new O(u(n,e,r,o));return t.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},_(b),b[a]="Generator",b[i]=function(){return this},b.toString=function(){return"[object Generator]"},t.keys=function(t){var n=[];for(var e in t)n.push(e);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=E,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function o(r,o){return a.type="throw",a.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var c=this.tryEntries[i],a=c.completion;if("root"===c.tryLoc)return o("end");if(c.tryLoc<=this.prev){var u=r.call(c,"catchLoc"),s=r.call(c,"finallyLoc");if(u&&s){if(this.prev<c.catchLoc)return o(c.catchLoc,!0);if(this.prev<c.finallyLoc)return o(c.finallyLoc)}else if(u){if(this.prev<c.catchLoc)return o(c.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return o(c.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=n,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(c)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),d},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),j(e),d}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;j(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),d}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}});function n(t,n,e,r,o,i,c){try{var a=t[i](c),u=a.value}catch(t){return void e(t)}a.done?n(u):Promise.resolve(u).then(r,o)}function e(t){return function(){var e=this,r=arguments;return new Promise(function(o,i){var c=t.apply(e,r);function a(t){n(c,o,i,a,u,"next",t)}function u(t){n(c,o,i,a,u,"throw",t)}a(void 0)})}}function r(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function o(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},o=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.forEach(function(n){r(t,n,e[n])})}return t}function i(t){return function(t){if(Array.isArray(t)){for(var n=0,e=new Array(t.length);n<t.length;n++)e[n]=t[n];return e}}(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")}()}var c=t(function(t){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)}),a=t(function(t){var n=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)}),u=(a.version,function(t){return"object"==typeof t?null!==t:"function"==typeof t}),s=function(t){if(!u(t))throw TypeError(t+" is not an object!");return t},f=function(t){try{return!!t()}catch(t){return!0}},l=!f(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),p=c.document,h=u(p)&&u(p.createElement),d=function(t){return h?p.createElement(t):{}},v=!l&&!f(function(){return 7!=Object.defineProperty(d("div"),"a",{get:function(){return 7}}).a}),y=Object.defineProperty,g={f:l?Object.defineProperty:function(t,n,e){if(s(t),n=function(t,n){if(!u(t))return t;var e,r;if(n&&"function"==typeof(e=t.toString)&&!u(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!u(r=e.call(t)))return r;if(!n&&"function"==typeof(e=t.toString)&&!u(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}(n,!0),s(e),v)try{return y(t,n,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[n]=e.value),t}},m=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},x=l?function(t,n,e){return g.f(t,n,m(1,e))}:function(t,n,e){return t[n]=e,t},w={}.hasOwnProperty,b=function(t,n){return w.call(t,n)},_=0,O=Math.random(),R=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++_+O).toString(36))},S=t(function(t){var n=c["__core-js_shared__"]||(c["__core-js_shared__"]={});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:a.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),j=S("native-function-to-string",Function.toString),k=t(function(t){var n=R("src"),e=(""+j).split("toString");a.inspectSource=function(t){return j.call(t)},(t.exports=function(t,r,o,i){var a="function"==typeof o;a&&(b(o,"name")||x(o,"name",r)),t[r]!==o&&(a&&(b(o,n)||x(o,n,t[r]?""+t[r]:e.join(String(r)))),t===c?t[r]=o:i?t[r]?t[r]=o:x(t,r,o):(delete t[r],x(t,r,o)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[n]||j.call(this)})}),E=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},L=function(t,n,e){if(E(t),void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)}}return function(){return t.apply(n,arguments)}},P=function(t,n,e){var r,o,i,u,s=t&P.F,f=t&P.G,l=t&P.S,p=t&P.P,h=t&P.B,d=f?c:l?c[n]||(c[n]={}):(c[n]||{}).prototype,v=f?a:a[n]||(a[n]={}),y=v.prototype||(v.prototype={});for(r in f&&(e=n),e)i=((o=!s&&d&&void 0!==d[r])?d:e)[r],u=h&&o?L(i,c):p&&"function"==typeof i?L(Function.call,i):i,d&&k(d,r,i,t&P.U),v[r]!=i&&x(v,r,u),p&&y[r]!=i&&(y[r]=i)};c.core=a,P.F=1,P.G=2,P.S=4,P.P=8,P.B=16,P.W=32,P.U=64,P.R=128;var C=P,M={}.toString,A=function(t){return M.call(t).slice(8,-1)},T=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==A(t)?t.split(""):Object(t)},U=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},I=function(t){return T(U(t))},F=Math.ceil,G=Math.floor,N=function(t){return isNaN(t=+t)?0:(t>0?G:F)(t)},D=Math.min,V=function(t){return t>0?D(N(t),9007199254740991):0},B=Math.max,H=Math.min,W=function(t){return function(n,e,r){var o,i=I(n),c=V(i.length),a=function(t,n){return(t=N(t))<0?B(t+n,0):H(t,n)}(r,c);if(t&&e!=e){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((t||a in i)&&i[a]===e)return t||a||0;return!t&&-1}},z=t(function(t){var n=S("wks"),e=c.Symbol,r="function"==typeof e;(t.exports=function(t){return n[t]||(n[t]=r&&e[t]||(r?e:R)("Symbol."+t))}).store=n}),K=z("unscopables"),Y=Array.prototype;null==Y[K]&&x(Y,K,{});var $=function(t){Y[K][t]=!0},q=W(!0);C(C.P,"Array",{includes:function(t){return q(this,t,arguments.length>1?arguments[1]:void 0)}}),$("includes");var J=z("match"),Q=function(t){var n;return u(t)&&(void 0!==(n=t[J])?!!n:"RegExp"==A(t))},X=function(t,n,e){if(Q(n))throw TypeError("String#"+e+" doesn't accept regex!");return String(U(t))},Z=z("match");C(C.P+C.F*function(t){var n=/./;try{"/./"[t](n)}catch(e){try{return n[Z]=!1,!"/./"[t](n)}catch(t){}}return!0}("includes"),"String",{includes:function(t){return!!~X(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}});var tt,nt,et=z("species"),rt=function(t,n){var e,r=s(t).constructor;return void 0===r||null==(e=s(r)[et])?n:E(e)},ot=function(t){return function(n,e){var r,o,i=String(U(n)),c=N(e),a=i.length;return c<0||c>=a?t?"":void 0:(r=i.charCodeAt(c))<55296||r>56319||c+1===a||(o=i.charCodeAt(c+1))<56320||o>57343?t?i.charAt(c):r:t?i.slice(c,c+2):o-56320+(r-55296<<10)+65536}},it=ot(!0),ct=function(t,n,e){return n+(e?it(t,n).length:1)},at=z("toStringTag"),ut="Arguments"==A(function(){return arguments}()),st=function(t){var n,e,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),at))?e:ut?A(n):"Object"==(r=A(n))&&"function"==typeof n.callee?"Arguments":r},ft=RegExp.prototype.exec,lt=function(t,n){var e=t.exec;if("function"==typeof e){var r=e.call(t,n);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==st(t))throw new TypeError("RegExp#exec called on incompatible receiver");return ft.call(t,n)},pt=RegExp.prototype.exec,ht=String.prototype.replace,dt=pt,vt=(tt=/a/,nt=/b*/g,pt.call(tt,"a"),pt.call(nt,"a"),0!==tt.lastIndex||0!==nt.lastIndex),yt=void 0!==/()??/.exec("")[1];(vt||yt)&&(dt=function(t){var n,e,r,o,i=this;return yt&&(e=new RegExp("^"+i.source+"$(?!\\s)",function(){var t=s(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}.call(i))),vt&&(n=i.lastIndex),r=pt.call(i,t),vt&&r&&(i.lastIndex=i.global?r.index+r[0].length:n),yt&&r&&r.length>1&&ht.call(r[0],e,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)}),r});var gt=dt;C({target:"RegExp",proto:!0,forced:gt!==/./.exec},{exec:gt});var mt=z("species"),xt=!f(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),wt=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var e="ab".split(t);return 2===e.length&&"a"===e[0]&&"b"===e[1]}(),bt=Math.min,_t=[].push,Ot=!f(function(){RegExp(4294967295,"y")});!function(t,n,e){var r=z(t),o=!f(function(){var n={};return n[r]=function(){return 7},7!=""[t](n)}),i=o?!f(function(){var n=!1,e=/a/;return e.exec=function(){return n=!0,null},"split"===t&&(e.constructor={},e.constructor[mt]=function(){return e}),e[r](""),!n}):void 0;if(!o||!i||"replace"===t&&!xt||"split"===t&&!wt){var c=/./[r],a=e(U,r,""[t],function(t,n,e,r,i){return n.exec===gt?o&&!i?{done:!0,value:c.call(n,e,r)}:{done:!0,value:t.call(e,n,r)}:{done:!1}}),u=a[0],s=a[1];k(String.prototype,t,u),x(RegExp.prototype,r,2==n?function(t,n){return s.call(t,this,n)}:function(t){return s.call(t,this)})}}("split",2,function(t,n,e,r){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r=String(this);if(void 0===t&&0===n)return[];if(!Q(t))return e.call(r,t,n);for(var o,i,c,a=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),s=0,f=void 0===n?4294967295:n>>>0,l=new RegExp(t.source,u+"g");(o=gt.call(l,r))&&!((i=l.lastIndex)>s&&(a.push(r.slice(s,o.index)),o.length>1&&o.index<r.length&&_t.apply(a,o.slice(1)),c=o[0].length,s=i,a.length>=f));)l.lastIndex===o.index&&l.lastIndex++;return s===r.length?!c&&l.test("")||a.push(""):a.push(r.slice(s)),a.length>f?a.slice(0,f):a}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,r){var i=t(this),c=null==e?void 0:e[n];return void 0!==c?c.call(e,i,r):o.call(String(i),e,r)},function(t,n){var i=r(o,t,this,n,o!==e);if(i.done)return i.value;var c=s(t),a=String(this),u=rt(c,RegExp),f=c.unicode,l=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(Ot?"y":"g"),p=new u(Ot?c:"^(?:"+c.source+")",l),h=void 0===n?4294967295:n>>>0;if(0===h)return[];if(0===a.length)return null===lt(p,a)?[a]:[];for(var d=0,v=0,y=[];v<a.length;){p.lastIndex=Ot?v:0;var g,m=lt(p,Ot?a:a.slice(v));if(null===m||(g=bt(V(p.lastIndex+(Ot?0:v)),a.length))===d)v=ct(a,v,f);else{if(y.push(a.slice(d,v)),y.length===h)return y;for(var x=1;x<=m.length-1;x++)if(y.push(m[x]),y.length===h)return y;v=d=g}}return y.push(a.slice(d)),y}]});var Rt=function(t,n){return{value:n,done:!!t}},St={},jt=S("keys"),kt=function(t){return jt[t]||(jt[t]=R(t))},Et=W(!1),Lt=kt("IE_PROTO"),Pt="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Ct=Object.keys||function(t){return function(t,n){var e,r=I(t),o=0,i=[];for(e in r)e!=Lt&&b(r,e)&&i.push(e);for(;n.length>o;)b(r,e=n[o++])&&(~Et(i,e)||i.push(e));return i}(t,Pt)},Mt=l?Object.defineProperties:function(t,n){s(t);for(var e,r=Ct(n),o=r.length,i=0;o>i;)g.f(t,e=r[i++],n[e]);return t},At=c.document,Tt=At&&At.documentElement,Ut=kt("IE_PROTO"),It=function(){},Ft=function(){var t,n=d("iframe"),e=Pt.length;for(n.style.display="none",Tt.appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),Ft=t.F;e--;)delete Ft.prototype[Pt[e]];return Ft()},Gt=Object.create||function(t,n){var e;return null!==t?(It.prototype=s(t),e=new It,It.prototype=null,e[Ut]=t):e=Ft(),void 0===n?e:Mt(e,n)},Nt=g.f,Dt=z("toStringTag"),Vt=function(t,n,e){t&&!b(t=e?t:t.prototype,Dt)&&Nt(t,Dt,{configurable:!0,value:n})},Bt={};x(Bt,z("iterator"),function(){return this});var Ht=function(t,n,e){t.prototype=Gt(Bt,{next:m(1,e)}),Vt(t,n+" Iterator")},Wt=function(t){return Object(U(t))},zt=kt("IE_PROTO"),Kt=Object.prototype,Yt=Object.getPrototypeOf||function(t){return t=Wt(t),b(t,zt)?t[zt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Kt:null},$t=z("iterator"),qt=!([].keys&&"next"in[].keys()),Jt=function(){return this},Qt=function(t,n,e,r,o,i,c){Ht(e,n,r);var a,u,s,f=function(t){if(!qt&&t in d)return d[t];switch(t){case"keys":case"values":return function(){return new e(this,t)}}return function(){return new e(this,t)}},l=n+" Iterator",p="values"==o,h=!1,d=t.prototype,v=d[$t]||d["@@iterator"]||o&&d[o],y=v||f(o),g=o?p?f("entries"):y:void 0,m="Array"==n&&d.entries||v;if(m&&(s=Yt(m.call(new t)))!==Object.prototype&&s.next&&(Vt(s,l,!0),"function"!=typeof s[$t]&&x(s,$t,Jt)),p&&v&&"values"!==v.name&&(h=!0,y=function(){return v.call(this)}),(qt||h||!d[$t])&&x(d,$t,y),St[n]=y,St[l]=Jt,o)if(a={values:p?y:f("values"),keys:i?y:f("keys"),entries:g},c)for(u in a)u in d||k(d,u,a[u]);else C(C.P+C.F*(qt||h),n,a);return a},Xt=Qt(Array,"Array",function(t,n){this._t=I(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,Rt(1)):Rt(0,"keys"==n?e:"values"==n?t[e]:[e,t[e]])},"values");St.Arguments=St.Array,$("keys"),$("values"),$("entries");for(var Zt=z("iterator"),tn=z("toStringTag"),nn=St.Array,en={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},rn=Ct(en),on=0;on<rn.length;on++){var cn,an=rn[on],un=en[an],sn=c[an],fn=sn&&sn.prototype;if(fn&&(fn[Zt]||x(fn,Zt,nn),fn[tn]||x(fn,tn,an),St[an]=nn,un))for(cn in Xt)fn[cn]||k(fn,cn,Xt[cn],!0)}!function(t,n){var e=(a.Object||{})[t]||Object[t],r={};r[t]=n(e),C(C.S+C.F*f(function(){e(1)}),"Object",r)}("keys",function(){return function(t){return Ct(Wt(t))}});var ln=Array.isArray||function(t){return"Array"==A(t)},pn=z("species"),hn=function(t,n){return new(function(t){var n;return ln(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!ln(n.prototype)||(n=void 0),u(n)&&null===(n=n[pn])&&(n=void 0)),void 0===n?Array:n}(t))(n)},dn=function(t,n){var e=1==t,r=2==t,o=3==t,i=4==t,c=6==t,a=5==t||c,u=n||hn;return function(n,s,f){for(var l,p,h=Wt(n),d=T(h),v=L(s,f,3),y=V(d.length),g=0,m=e?u(n,y):r?u(n,0):void 0;y>g;g++)if((a||g in d)&&(p=v(l=d[g],g,h),t))if(e)m[g]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return g;case 2:m.push(l)}else if(i)return!1;return c?-1:o||i?i:m}},vn=dn(6),yn="findIndex",gn=!0;yn in[]&&Array(1)[yn](function(){gn=!1}),C(C.P+C.F*gn,"Array",{findIndex:function(t){return vn(this,t,arguments.length>1?arguments[1]:void 0)}}),$(yn);var mn,xn,wn,bn=function(t,n,e,r){try{return r?n(s(e)[0],e[1]):n(e)}catch(n){var o=t.return;throw void 0!==o&&s(o.call(t)),n}},_n=z("iterator"),On=Array.prototype,Rn=z("iterator"),Sn=a.getIteratorMethod=function(t){if(null!=t)return t[Rn]||t["@@iterator"]||St[st(t)]},jn=t(function(t){var n={},e={},r=t.exports=function(t,r,o,i,c){var a,u,f,l,p,h=c?function(){return t}:Sn(t),d=L(o,i,r?2:1),v=0;if("function"!=typeof h)throw TypeError(t+" is not iterable!");if(void 0===(p=h)||St.Array!==p&&On[_n]!==p){for(f=h.call(t);!(u=f.next()).done;)if((l=bn(f,d,u.value,r))===n||l===e)return l}else for(a=V(t.length);a>v;v++)if((l=r?d(s(u=t[v])[0],u[1]):d(t[v]))===n||l===e)return l};r.BREAK=n,r.RETURN=e}),kn=function(t,n,e){var r=void 0===e;switch(n.length){case 0:return r?t():t.call(e);case 1:return r?t(n[0]):t.call(e,n[0]);case 2:return r?t(n[0],n[1]):t.call(e,n[0],n[1]);case 3:return r?t(n[0],n[1],n[2]):t.call(e,n[0],n[1],n[2]);case 4:return r?t(n[0],n[1],n[2],n[3]):t.call(e,n[0],n[1],n[2],n[3])}return t.apply(e,n)},En=c.process,Ln=c.setImmediate,Pn=c.clearImmediate,Cn=c.MessageChannel,Mn=c.Dispatch,An=0,Tn={},Un=function(){var t=+this;if(Tn.hasOwnProperty(t)){var n=Tn[t];delete Tn[t],n()}},In=function(t){Un.call(t.data)};Ln&&Pn||(Ln=function(t){for(var n=[],e=1;arguments.length>e;)n.push(arguments[e++]);return Tn[++An]=function(){kn("function"==typeof t?t:Function(t),n)},mn(An),An},Pn=function(t){delete Tn[t]},"process"==A(En)?mn=function(t){En.nextTick(L(Un,t,1))}:Mn&&Mn.now?mn=function(t){Mn.now(L(Un,t,1))}:Cn?(wn=(xn=new Cn).port2,xn.port1.onmessage=In,mn=L(wn.postMessage,wn,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(mn=function(t){c.postMessage(t+"","*")},c.addEventListener("message",In,!1)):mn="onreadystatechange"in d("script")?function(t){Tt.appendChild(d("script")).onreadystatechange=function(){Tt.removeChild(this),Un.call(t)}}:function(t){setTimeout(L(Un,t,1),0)});var Fn={set:Ln,clear:Pn},Gn=Fn.set,Nn=c.MutationObserver||c.WebKitMutationObserver,Dn=c.process,Vn=c.Promise,Bn="process"==A(Dn);function Hn(t){var n,e;this.promise=new t(function(t,r){if(void 0!==n||void 0!==e)throw TypeError("Bad Promise constructor");n=t,e=r}),this.resolve=E(n),this.reject=E(e)}var Wn={f:function(t){return new Hn(t)}},zn=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},Kn=c.navigator,Yn=Kn&&Kn.userAgent||"",$n=z("species"),qn=z("iterator"),Jn=!1;try{var Qn=[7][qn]();Qn.return=function(){Jn=!0},Array.from(Qn,function(){throw 2})}catch(t){}var Xn,Zn,te,ne,ee=Fn.set,re=function(){var t,n,e,r=function(){var r,o;for(Bn&&(r=Dn.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?e():n=void 0,r}}n=void 0,r&&r.enter()};if(Bn)e=function(){Dn.nextTick(r)};else if(!Nn||c.navigator&&c.navigator.standalone)if(Vn&&Vn.resolve){var o=Vn.resolve(void 0);e=function(){o.then(r)}}else e=function(){Gn.call(c,r)};else{var i=!0,a=document.createTextNode("");new Nn(r).observe(a,{characterData:!0}),e=function(){a.data=i=!i}}return function(r){var o={fn:r,next:void 0};n&&(n.next=o),t||(t=o,e()),n=o}}(),oe=c.TypeError,ie=c.process,ce=ie&&ie.versions,ae=ce&&ce.v8||"",ue=c.Promise,se="process"==st(ie),fe=function(){},le=Zn=Wn.f,pe=!!function(){try{var t=ue.resolve(1),n=(t.constructor={})[z("species")]=function(t){t(fe,fe)};return(se||"function"==typeof PromiseRejectionEvent)&&t.then(fe)instanceof n&&0!==ae.indexOf("6.6")&&-1===Yn.indexOf("Chrome/66")}catch(t){}}(),he=function(t){var n;return!(!u(t)||"function"!=typeof(n=t.then))&&n},de=function(t,n){if(!t._n){t._n=!0;var e=t._c;re(function(){for(var r=t._v,o=1==t._s,i=0,c=function(n){var e,i,c,a=o?n.ok:n.fail,u=n.resolve,s=n.reject,f=n.domain;try{a?(o||(2==t._h&&ge(t),t._h=1),!0===a?e=r:(f&&f.enter(),e=a(r),f&&(f.exit(),c=!0)),e===n.promise?s(oe("Promise-chain cycle")):(i=he(e))?i.call(e,u,s):u(e)):s(r)}catch(t){f&&!c&&f.exit(),s(t)}};e.length>i;)c(e[i++]);t._c=[],t._n=!1,n&&!t._h&&ve(t)})}},ve=function(t){ee.call(c,function(){var n,e,r,o=t._v,i=ye(t);if(i&&(n=zn(function(){se?ie.emit("unhandledRejection",o,t):(e=c.onunhandledrejection)?e({promise:t,reason:o}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=se||ye(t)?2:1),t._a=void 0,i&&n.e)throw n.v})},ye=function(t){return 1!==t._h&&0===(t._a||t._c).length},ge=function(t){ee.call(c,function(){var n;se?ie.emit("rejectionHandled",t):(n=c.onrejectionhandled)&&n({promise:t,reason:t._v})})},me=function(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),de(n,!0))},xe=function(t){var n,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw oe("Promise can't be resolved itself");(n=he(t))?re(function(){var r={_w:e,_d:!1};try{n.call(t,L(xe,r,1),L(me,r,1))}catch(t){me.call(r,t)}}):(e._v=t,e._s=1,de(e,!1))}catch(t){me.call({_w:e,_d:!1},t)}}};pe||(ue=function(t){!function(t,n,e,r){if(!(t instanceof n)||void 0!==r&&r in t)throw TypeError(e+": incorrect invocation!")}(this,ue,"Promise","_h"),E(t),Xn.call(this);try{t(L(xe,this,1),L(me,this,1))}catch(t){me.call(this,t)}},(Xn=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,n,e){for(var r in n)k(t,r,n[r],e);return t}(ue.prototype,{then:function(t,n){var e=le(rt(this,ue));return e.ok="function"!=typeof t||t,e.fail="function"==typeof n&&n,e.domain=se?ie.domain:void 0,this._c.push(e),this._a&&this._a.push(e),this._s&&de(this,!1),e.promise},catch:function(t){return this.then(void 0,t)}}),te=function(){var t=new Xn;this.promise=t,this.resolve=L(xe,t,1),this.reject=L(me,t,1)},Wn.f=le=function(t){return t===ue||t===ne?new te(t):Zn(t)}),C(C.G+C.W+C.F*!pe,{Promise:ue}),Vt(ue,"Promise"),function(t){var n=c[t];l&&n&&!n[$n]&&g.f(n,$n,{configurable:!0,get:function(){return this}})}("Promise"),ne=a.Promise,C(C.S+C.F*!pe,"Promise",{reject:function(t){var n=le(this);return(0,n.reject)(t),n.promise}}),C(C.S+C.F*!pe,"Promise",{resolve:function(t){return function(t,n){if(s(t),u(n)&&n.constructor===t)return n;var e=Wn.f(t);return(0,e.resolve)(n),e.promise}(this,t)}}),C(C.S+C.F*!(pe&&function(t,n){if(!n&&!Jn)return!1;var e=!1;try{var r=[7],o=r[qn]();o.next=function(){return{done:e=!0}},r[qn]=function(){return o},t(r)}catch(t){}return e}(function(t){ue.all(t).catch(fe)})),"Promise",{all:function(t){var n=this,e=le(n),r=e.resolve,o=e.reject,i=zn(function(){var e=[],i=0,c=1;jn(t,!1,function(t){var a=i++,u=!1;e.push(void 0),c++,n.resolve(t).then(function(t){u||(u=!0,e[a]=t,--c||r(e))},o)}),--c||r(e)});return i.e&&o(i.v),e.promise},race:function(t){var n=this,e=le(n),r=e.reject,o=zn(function(){jn(t,!1,function(t){n.resolve(t).then(e.resolve,r)})});return o.e&&r(o.v),e.promise}});var we=dn(5),be=!0;"find"in[]&&Array(1).find(function(){be=!1}),C(C.P+C.F*be,"Array",{find:function(t){return we(this,t,arguments.length>1?arguments[1]:void 0)}}),$("find");var _e=function(t){return function(n){return t.find(function(t){return t.namespace===n})||{}}},Oe=function(t){return function(n){return n.filter(function(t){return!!t.action}).reduce(function(n,e){var r=e.action,o=e.payload;return n.then(function(){return t.dispatch(r,o)})},Promise.resolve())}},Re=function(t){return function(n,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=t.findIndex(function(t){return t.namespace===n});t.splice(o,1,e);var i=e.exposeUndoRedoConfig;i&&r.commit("".concat(n).concat("updateUndoRedoConfig"),e)}},Se=function(t){var n=t.paths,e=t.store;return function(t){var r=function(t){return function(n){var e=_e(t)(n);return!!e&&e.done.length>0}}(n)(t),o=function(t){return function(n){var e=_e(t)(n);return!!Object.keys(e).length&&e.undone.length>0}}(n)(t);e.commit("".concat(t).concat("updateCanUndoRedo"),{canUndo:r}),e.commit("".concat(t).concat("updateCanUndoRedo"),{canRedo:o})}},je=ot(!0);Qt(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,e=this._i;return e>=n.length?{value:void 0,done:!0}:(t=je(n,e),this._i+=t.length,{value:t,done:!1})});var ke=function(t){var n=t.paths,r=t.store;return function(){var t=e(regeneratorRuntime.mark(function t(c){var a,u,s,f,l;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=_e(n)(c),!Object.keys(a).length){t.next=15;break}return u=a.undone.reduceRight(function(t,n){var e=t.commits,r=t.undone,o=t.proceed;if(e.length)if(o){var c=e[e.length-1].payload.actionGroup;o=n.payload.actionGroup&&n.payload.actionGroup===c,e=[].concat(i(o?[n]:[]),i(e)),r=[].concat(i(o?[]:[n]),i(r))}else r=[n].concat(i(r));else e=[n],o=!!n.payload.actionGroup;return{commits:e,undone:r,proceed:o}},{commits:[],undone:[],proceed:!0}),s=u.undone,f=u.commits,a.newMutation=!1,l=f.filter(function(t){return t.type&&t.payload}).map(function(){var t=e(regeneratorRuntime.mark(function t(n){var e,o,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.type,o=n.payload,r.commit(e,Array.isArray(o)?i(o):o.constructor(o)),a=o.redoCallback,t.abrupt("return",{action:a?"".concat(c).concat(a):"",payload:o});case 4:case"end":return t.stop()}},t)}));return function(n){return t.apply(this,arguments)}}()),t.t0=Oe(r),t.next=8,Promise.all(l);case 8:return t.t1=t.sent,t.next=11,(0,t.t0)(t.t1);case 11:a.done=[].concat(i(a.done),i(f)),a.newMutation=!0,Re(n)(c,o({},a,{undone:s}),r),Se({paths:n,store:r})(c);case 15:case"end":return t.stop()}},t)}));return function(n){return t.apply(this,arguments)}}()},Ee=function(t){var n=t.paths,r=t.store;return function(){var t=e(regeneratorRuntime.mark(function t(c){var a,u,s,f,l,p,h;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=_e(n)(c),!Object.keys(a).length){t.next=19;break}return u=a.done.reduceRight(function(t,n){var e=t.commits,r=t.done,o=t.proceed;if(e.length)if(o){var c=e[e.length-1].payload.actionGroup;o=n.payload.actionGroup&&n.payload.actionGroup===c,e=[].concat(i(o?[n]:[]),i(e)),r=[].concat(i(o?[]:[n]),i(r))}else r=[n].concat(i(r));else e=[n],o=!!n.payload.actionGroup;return{done:r,commits:e,proceed:o}},{done:[],commits:[],proceed:!0}),s=u.done,f=u.commits,l=f.map(function(t){var n=t.payload;return{action:n.undoCallback?"".concat(c).concat(n.undoCallback):"",payload:n}}),t.next=6,Oe(r)(l);case 6:return p=[].concat(i(a.undone),i(f)),a.newMutation=!1,r.commit("".concat(c).concat("emptyState")),h=s.filter(function(t){return t.type&&t.payload}).map(function(){var t=e(regeneratorRuntime.mark(function t(n){var e;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r.commit(n.type,Array.isArray(n.payload)?i(n.payload):n.payload.constructor(n.payload)),e=n.payload.redoCallback,t.abrupt("return",{action:e?"".concat(c).concat(e):"",payload:n.payload});case 3:case"end":return t.stop()}},t)}));return function(n){return t.apply(this,arguments)}}()),t.t0=Oe(r),t.next=13,Promise.all(h);case 13:return t.t1=t.sent,t.next=16,(0,t.t0)(t.t1);case 16:a.newMutation=!0,Re(n)(c,o({},a,{done:s,undone:p}),r),Se({paths:n,store:r})(c);case 19:case"end":return t.stop()}},t)}));return function(n){return t.apply(this,arguments)}}()},Le=function(t){var n=t.paths,r=t.store;return function(){var t=e(regeneratorRuntime.mark(function t(e){var i,c,a,u;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=_e(n)(e),!Object.keys(i).length){t.next=12;break}return c=i.done.map(function(t){var n=t.payload;return{action:n.undoCallback?"".concat(e).concat(n.undoCallback):"",payload:n}}),t.next=5,Oe(r)(c);case 5:a=[],u=[],i.newMutation=!1,r.commit("".concat(e).concat("emptyState")),i.newMutation=!0,Re(n)(e,o({},i,{done:a,undone:u}),r),Se({paths:n,store:r})(e);case 12:case"end":return t.stop()}},t)}));return function(n){return t.apply(this,arguments)}}()},Pe=function(t){var n=t.paths,r=t.store;return function(){var t=e(regeneratorRuntime.mark(function t(e){var i,c,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=_e(n)(e),Object.keys(i).length&&(c=[],a=[],i.newMutation=!1,r.commit("".concat(e).concat("resetState")),i.newMutation=!0,Re(n)(e,o({},i,{done:c,undone:a}),r),Se({paths:n,store:r})(e));case 2:case"end":return t.stop()}},t)}));return function(n){return t.apply(this,arguments)}}()},Ce=function(){},Me=Ce,Ae=Ce,Te=Ce,Ue=Ce,Ie=Ce,Fe=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o({},t,{canUndo:!1,canRedo:!1},n?{undoRedoConfig:{}}:{})},Ge=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o({},t,{undo:Me,redo:Ae,clear:Te,reset:Ue},n?{getUndoRedoConfig:Ie}:{})},Ne=function(t){var n,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o({},t,(r(n={},"updateCanUndoRedo",function(t,n){void 0!==n.canUndo&&(t.canUndo=n.canUndo),void 0!==n.canRedo&&(t.canRedo=n.canRedo)}),r(n,"updateUndoRedoConfig",e?function(t,n){var e=n.done,r=n.undone;t.undoRedoConfig.done=i(e),t.undoRedoConfig.undone=i(r)}:Ce),n))},De=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o({},t,{state:Fe(t.state||{},n),actions:Ge(t.actions||{},n),mutations:Ne(t.mutations||{},n)})},Ve=function(t){var n=t.namespace,e=void 0===n?"":n,r=t.ignoreMutations,o=void 0===r?[]:r,i=t.exposeUndoRedoConfig;return{namespace:e,ignoreMutations:o,done:[],undone:[],newMutation:!0,exposeUndoRedoConfig:void 0!==i&&i}},Be=function(t){return t.map(function(t){var n=t.namespace,e=t.ignoreMutations,r=t.exposeUndoRedoConfig;return Ve(o({namespace:"".concat(n,"/")},e?function(t){var n=t.namespace;return{ignoreMutations:(t.ignoreMutations||[]).map(function(t){return"".concat(n,"/").concat(t)}).concat(["".concat(n,"/").concat("updateCanUndoRedo"),"".concat(n,"/").concat("updateUndoRedoConfig")])}}({namespace:n,ignoreMutations:e}):{},{exposeUndoRedoConfig:r}))})},He=function(t){return function(n){var e=_e(t)(n);return!!Object.keys(e).length&&e.undone.length>0}},We=function(t){return function(n){var e=_e(t)(n);return!!e&&e.done.length>0}};export default function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(n){var r=t.paths?Be(t.paths):[Ve({ignoreMutations:[].concat(i(t.ignoreMutations||[]),["updateCanUndoRedo","updateUndoRedoConfig"]),exposeUndoRedoConfig:t.exposeUndoRedoConfig})];n.subscribe(function(t){var e=t.type.split("/").length>1?"".concat(t.type.split("/")[0],"/"):"",i=_e(r)(e);if(Object.keys(i).length){var c=i.ignoreMutations,a=i.newMutation,u=i.done;i.exposeUndoRedoConfig;t.type!=="".concat(e).concat("emptyState")&&t.type!=="".concat(e).concat("updateCanUndoRedo")&&t.type!=="".concat(e).concat("updateUndoRedoConfig")&&-1===c.indexOf(t.type)&&t.type.includes(e)&&a&&(u.push(t),Re(r)(e,o({},i,{done:u}),n),Se({paths:r,store:n})(e))}}),n.subscribeAction(function(){var t=e(regeneratorRuntime.mark(function t(e){var o,i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:o=e.type.split("/").length>1,i=o?"".concat(e.type.split("/")[0],"/"):"",t.t0=e.type,t.next=t.t0==="".concat(i).concat("redo")?5:t.t0==="".concat(i).concat("undo")?9:t.t0==="".concat(i).concat("clear")?13:t.t0==="".concat(i).concat("reset")?16:19;break;case 5:if(!He(r)(i)){t.next=8;break}return t.next=8,ke({paths:r,store:n})(i);case 8:return t.abrupt("break",20);case 9:if(!We(r)(i)){t.next=12;break}return t.next=12,Ee({paths:r,store:n})(i);case 12:return t.abrupt("break",20);case 13:return t.next=15,Le({paths:r,store:n})(i);case 15:return t.abrupt("break",20);case 16:return t.next=18,Pe({paths:r,store:n})(i);case 18:case 19:return t.abrupt("break",20);case 20:case"end":return t.stop()}},t)}));return function(n){return t.apply(this,arguments)}}())}}export{Te as clear,Ie as getUndoRedoConfig,Ae as redo,Ue as reset,Ge as scaffoldActions,Ne as scaffoldMutations,Fe as scaffoldState,De as scaffoldStore,Me as undo};