vue-guspread
Version:
Guspread is a Simple Spreadsheet Component for Vue.js
7 lines • 90.1 kB
JavaScript
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-guspread"]=e():t["vue-guspread"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s="fb15")}({"00ee":function(t,e,r){var n=r("b622"),i=n("toStringTag"),o={};o[i]="z",t.exports="[object z]"===String(o)},"0366":function(t,e,r){var n=r("1c0b");t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}},"057f":function(t,e,r){var n=r("fc6a"),i=r("241c").f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return i(t)}catch(e){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?a(t):i(n(t))}},"06cf":function(t,e,r){var n=r("83ab"),i=r("d1e7"),o=r("5c6c"),s=r("fc6a"),a=r("c04e"),c=r("5135"),u=r("0cfb"),l=Object.getOwnPropertyDescriptor;e.f=n?l:function(t,e){if(t=s(t),e=a(e,!0),u)try{return l(t,e)}catch(r){}if(c(t,e))return o(!i.f.call(t,e),t[e])}},"0cfb":function(t,e,r){var n=r("83ab"),i=r("d039"),o=r("cc12");t.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"159b":function(t,e,r){var n=r("da84"),i=r("fdbc"),o=r("17c2"),s=r("9112");for(var a in i){var c=n[a],u=c&&c.prototype;if(u&&u.forEach!==o)try{s(u,"forEach",o)}catch(l){u.forEach=o}}},"17c2":function(t,e,r){"use strict";var n=r("b727").forEach,i=r("a640"),o=r("ae40"),s=i("forEach"),a=o("forEach");t.exports=s&&a?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},"19aa":function(t,e){t.exports=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}},"1be4":function(t,e,r){var n=r("d066");t.exports=n("document","documentElement")},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(t,e,r){var n=r("b622"),i=n("iterator"),o=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){o=!0}};a[i]=function(){return this},Array.from(a,(function(){throw 2}))}catch(c){}t.exports=function(t,e){if(!e&&!o)return!1;var r=!1;try{var n={};n[i]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(c){}return r}},"1cdc":function(t,e,r){var n=r("342f");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(n)},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"1dde":function(t,e,r){var n=r("d039"),i=r("b622"),o=r("2d00"),s=i("species");t.exports=function(t){return o>=51||!n((function(){var e=[],r=e.constructor={};return r[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},2266:function(t,e,r){var n=r("825a"),i=r("e95a"),o=r("50c4"),s=r("0366"),a=r("35a1"),c=r("9bdd"),u=function(t,e){this.stopped=t,this.result=e},l=t.exports=function(t,e,r,l,f){var h,d,p,v,m,y,g,b=s(e,r,l?2:1);if(f)h=t;else{if(d=a(t),"function"!=typeof d)throw TypeError("Target is not iterable");if(i(d)){for(p=0,v=o(t.length);v>p;p++)if(m=l?b(n(g=t[p])[0],g[1]):b(t[p]),m&&m instanceof u)return m;return new u(!1)}h=d.call(t)}y=h.next;while(!(g=y.call(h)).done)if(m=c(h,b,g.value,l),"object"==typeof m&&m&&m instanceof u)return m;return new u(!1)};l.stop=function(t){return new u(!0,t)}},"23cb":function(t,e,r){var n=r("a691"),i=Math.max,o=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):o(r,e)}},"23e7":function(t,e,r){var n=r("da84"),i=r("06cf").f,o=r("9112"),s=r("6eeb"),a=r("ce4e"),c=r("e893"),u=r("94ca");t.exports=function(t,e){var r,l,f,h,d,p,v=t.target,m=t.global,y=t.stat;if(l=m?n:y?n[v]||a(v,{}):(n[v]||{}).prototype,l)for(f in e){if(d=e[f],t.noTargetGet?(p=i(l,f),h=p&&p.value):h=l[f],r=u(m?f:v+(y?".":"#")+f,t.forced),!r&&void 0!==h){if(typeof d===typeof h)continue;c(d,h)}(t.sham||h&&h.sham)&&o(d,"sham",!0),s(l,f,d,t)}}},"241c":function(t,e,r){var n=r("ca84"),i=r("7839"),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},"25f0":function(t,e,r){"use strict";var n=r("6eeb"),i=r("825a"),o=r("d039"),s=r("ad6d"),a="toString",c=RegExp.prototype,u=c[a],l=o((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),f=u.name!=a;(l||f)&&n(RegExp.prototype,a,(function(){var t=i(this),e=String(t.source),r=t.flags,n=String(void 0===r&&t instanceof RegExp&&!("flags"in c)?s.call(t):r);return"/"+e+"/"+n}),{unsafe:!0})},2626:function(t,e,r){"use strict";var n=r("d066"),i=r("9bf2"),o=r("b622"),s=r("83ab"),a=o("species");t.exports=function(t){var e=n(t),r=i.f;s&&e&&!e[a]&&r(e,a,{configurable:!0,get:function(){return this}})}},"2cf4":function(t,e,r){var n,i,o,s=r("da84"),a=r("d039"),c=r("c6b6"),u=r("0366"),l=r("1be4"),f=r("cc12"),h=r("1cdc"),d=s.location,p=s.setImmediate,v=s.clearImmediate,m=s.process,y=s.MessageChannel,g=s.Dispatch,b=0,w={},x="onreadystatechange",_=function(t){if(w.hasOwnProperty(t)){var e=w[t];delete w[t],e()}},S=function(t){return function(){_(t)}},C=function(t){_(t.data)},E=function(t){s.postMessage(t+"",d.protocol+"//"+d.host)};p&&v||(p=function(t){var e=[],r=1;while(arguments.length>r)e.push(arguments[r++]);return w[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},n(b),b},v=function(t){delete w[t]},"process"==c(m)?n=function(t){m.nextTick(S(t))}:g&&g.now?n=function(t){g.now(S(t))}:y&&!h?(i=new y,o=i.port2,i.port1.onmessage=C,n=u(o.postMessage,o,1)):!s.addEventListener||"function"!=typeof postMessage||s.importScripts||a(E)?n=x in f("script")?function(t){l.appendChild(f("script"))[x]=function(){l.removeChild(this),_(t)}}:function(t){setTimeout(S(t),0)}:(n=E,s.addEventListener("message",C,!1))),t.exports={set:p,clear:v}},"2d00":function(t,e,r){var n,i,o=r("da84"),s=r("342f"),a=o.process,c=a&&a.versions,u=c&&c.v8;u?(n=u.split("."),i=n[0]+n[1]):s&&(n=s.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/),n&&(i=n[1]))),t.exports=i&&+i},"342f":function(t,e,r){var n=r("d066");t.exports=n("navigator","userAgent")||""},"35a1":function(t,e,r){var n=r("f5df"),i=r("3f8c"),o=r("b622"),s=o("iterator");t.exports=function(t){if(void 0!=t)return t[s]||t["@@iterator"]||i[n(t)]}},"35ba":function(t,e,r){},"369b":function(t,e,r){var n,i,o;
/* @license
Papa Parse
v5.1.1
https://github.com/mholt/PapaParse
License: MIT
*/!function(r,s){i=[],n=s,o="function"===typeof n?n.apply(e,i):n,void 0===o||(t.exports=o)}(0,(function t(){"use strict";var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},r=!e.document&&!!e.postMessage,n=r&&/blob:/i.test((e.location||{}).protocol),i={},o=0,s={parse:function(r,n){var a=(n=n||{}).dynamicTyping||!1;if(x(a)&&(n.dynamicTypingFunction=a,a={}),n.dynamicTyping=a,n.transform=!!x(n.transform)&&n.transform,n.worker&&s.WORKERS_SUPPORTED){var c=function(){if(!s.WORKERS_SUPPORTED)return!1;var r,n,a=(r=e.URL||e.webkitURL||null,n=t.toString(),s.BLOB_URL||(s.BLOB_URL=r.createObjectURL(new Blob(["(",n,")();"],{type:"text/javascript"})))),c=new e.Worker(a);return c.onmessage=m,c.id=o++,i[c.id]=c}();return c.userStep=n.step,c.userChunk=n.chunk,c.userComplete=n.complete,c.userError=n.error,n.step=x(n.step),n.chunk=x(n.chunk),n.complete=x(n.complete),n.error=x(n.error),delete n.worker,void c.postMessage({input:r,config:n,workerId:c.id})}var d=null;return s.NODE_STREAM_INPUT,"string"==typeof r?d=n.download?new u(n):new f(n):!0===r.readable&&x(r.read)&&x(r.on)?d=new h(n):(e.File&&r instanceof File||r instanceof Object)&&(d=new l(n)),d.stream(r)},unparse:function(t,e){var r=!1,n=!0,i=",",o="\r\n",a='"',c=a+a,u=!1,l=null;!function(){if("object"==typeof e){if("string"!=typeof e.delimiter||s.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(i=e.delimiter),("boolean"==typeof e.quotes||"function"==typeof e.quotes||Array.isArray(e.quotes))&&(r=e.quotes),"boolean"!=typeof e.skipEmptyLines&&"string"!=typeof e.skipEmptyLines||(u=e.skipEmptyLines),"string"==typeof e.newline&&(o=e.newline),"string"==typeof e.quoteChar&&(a=e.quoteChar),"boolean"==typeof e.header&&(n=e.header),Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");l=e.columns}void 0!==e.escapeChar&&(c=e.escapeChar+a)}}();var f=new RegExp(p(a),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return d(null,t,u);if("object"==typeof t[0])return d(l||h(t[0]),t,u)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:h(t.data[0])),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),d(t.fields||[],t.data||[],u);throw new Error("Unable to serialize unrecognized input");function h(t){if("object"!=typeof t)return[];var e=[];for(var r in t)e.push(r);return e}function d(t,e,r){var s="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var a=Array.isArray(t)&&0<t.length,c=!Array.isArray(e[0]);if(a&&n){for(var u=0;u<t.length;u++)0<u&&(s+=i),s+=v(t[u],u);0<e.length&&(s+=o)}for(var l=0;l<e.length;l++){var f=a?t.length:e[l].length,h=!1,d=a?0===Object.keys(e[l]).length:0===e[l].length;if(r&&!a&&(h="greedy"===r?""===e[l].join("").trim():1===e[l].length&&0===e[l][0].length),"greedy"===r&&a){for(var p=[],m=0;m<f;m++){var y=c?t[m]:m;p.push(e[l][y])}h=""===p.join("").trim()}if(!h){for(var g=0;g<f;g++){0<g&&!d&&(s+=i);var b=a&&c?t[g]:g;s+=v(e[l][b],g)}l<e.length-1&&(!r||0<f&&!d)&&(s+=o)}}return s}function v(t,e){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);var n=t.toString().replace(f,c),o="boolean"==typeof r&&r||"function"==typeof r&&r(t,e)||Array.isArray(r)&&r[e]||function(t,e){for(var r=0;r<e.length;r++)if(-1<t.indexOf(e[r]))return!0;return!1}(n,s.BAD_DELIMITERS)||-1<n.indexOf(i)||" "===n.charAt(0)||" "===n.charAt(n.length-1);return o?a+n+a:n}}};if(s.RECORD_SEP=String.fromCharCode(30),s.UNIT_SEP=String.fromCharCode(31),s.BYTE_ORDER_MARK="\ufeff",s.BAD_DELIMITERS=["\r","\n",'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!r&&!!e.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=v,s.ParserHandle=d,s.NetworkStreamer=u,s.FileStreamer=l,s.StringStreamer=f,s.ReadableStreamStreamer=h,e.jQuery){var a=e.jQuery;a.fn.parse=function(t){var r=t.config||{},n=[];return this.each((function(t){if("INPUT"!==a(this).prop("tagName").toUpperCase()||"file"!==a(this).attr("type").toLowerCase()||!e.FileReader||!this.files||0===this.files.length)return!0;for(var i=0;i<this.files.length;i++)n.push({file:this.files[i],inputElem:this,instanceConfig:a.extend({},r)})})),i(),this;function i(){if(0!==n.length){var e,r,i,c,u=n[0];if(x(t.before)){var l=t.before(u.file,u.inputElem);if("object"==typeof l){if("abort"===l.action)return e="AbortError",r=u.file,i=u.inputElem,c=l.reason,void(x(t.error)&&t.error({name:e},r,i,c));if("skip"===l.action)return void o();"object"==typeof l.config&&(u.instanceConfig=a.extend(u.instanceConfig,l.config))}else if("skip"===l)return void o()}var f=u.instanceConfig.complete;u.instanceConfig.complete=function(t){x(f)&&f(t,u.file,u.inputElem),o()},s.parse(u.file,u.instanceConfig)}else x(t.complete)&&t.complete()}function o(){n.splice(0,1),i()}}}function c(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=b(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null),this._handle=new d(e),(this._handle.streamer=this)._config=e}.call(this,t),this.parseChunk=function(t,r){if(this.isFirstChunk&&x(this._config.beforeFirstChunk)){var i=this._config.beforeFirstChunk(t);void 0!==i&&(t=i)}this.isFirstChunk=!1,this._halted=!1;var o=this._partialLine+t;this._partialLine="";var a=this._handle.parse(o,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var c=a.meta.cursor;this._finished||(this._partialLine=o.substring(c-this._baseIndex),this._baseIndex=c),a&&a.data&&(this._rowCount+=a.data.length);var u=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(n)e.postMessage({results:a,workerId:s.WORKER_ID,finished:u});else if(x(this._config.chunk)&&!r){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!u||!x(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),u||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(t){x(this._config.error)?this._config.error(t):n&&this._config.error&&e.postMessage({workerId:s.WORKER_ID,error:t,finished:!1})}}function u(t){var e;(t=t||{}).chunkSize||(t.chunkSize=s.RemoteChunkSize),c.call(this,t),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),r||(e.onload=w(this._chunkLoaded,this),e.onerror=w(this._chunkError,this)),e.open("GET",this._input,!r),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var n in t)e.setRequestHeader(n,t[n])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+i)}try{e.send()}catch(t){this._chunkError(t.message)}r&&0===e.status&&this._chunkError()}},this._chunkLoaded=function(){4===e.readyState&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:e.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(t){var e=t.getResponseHeader("Content-Range");return null===e?-1:parseInt(e.substring(e.lastIndexOf("/")+1))}(e),this.parseChunk(e.responseText)))},this._chunkError=function(t){var r=e.statusText||t;this._sendError(new Error(r))}}function l(t){var e,r;(t=t||{}).chunkSize||(t.chunkSize=s.LocalChunkSize),c.call(this,t);var n="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,r=t.slice||t.webkitSlice||t.mozSlice,n?((e=new FileReader).onload=w(this._chunkLoaded,this),e.onerror=w(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var i=Math.min(this._start+this._config.chunkSize,this._input.size);t=r.call(t,this._start,i)}var o=e.readAsText(t,this._config.encoding);n||this._chunkLoaded({target:{result:o}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(e.error)}}function f(t){var e;c.call(this,t=t||{}),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t,r=this._config.chunkSize;return r?(t=e.substring(0,r),e=e.substring(r)):(t=e,e=""),this._finished=!e,this.parseChunk(t)}}}function h(t){c.call(this,t=t||{});var e=[],r=!0,n=!1;this.pause=function(){c.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){c.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&1===e.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):r=!0},this._streamData=w((function(t){try{e.push("string"==typeof t?t:t.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(t){this._streamError(t)}}),this),this._streamError=w((function(t){this._streamCleanUp(),this._sendError(t)}),this),this._streamEnd=w((function(){this._streamCleanUp(),n=!0,this._streamData("")}),this),this._streamCleanUp=w((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function d(t){var e,r,n,i=Math.pow(2,53),o=-i,a=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,c=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,u=this,l=0,f=0,h=!1,d=!1,m=[],y={data:[],errors:[],meta:{}};if(x(t.step)){var g=t.step;t.step=function(e){if(y=e,S())_();else{if(_(),0===y.data.length)return;l+=e.data.length,t.preview&&l>t.preview?r.abort():(y.data=y.data[0],g(y,u))}}}function w(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function _(){if(y&&n&&(E("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines)for(var e=0;e<y.data.length;e++)w(y.data[e])&&y.data.splice(e--,1);return S()&&function(){if(y)if(Array.isArray(y.data[0])){for(var e=0;S()&&e<y.data.length;e++)y.data[e].forEach(r);y.data.splice(0,1)}else y.data.forEach(r);function r(e){x(t.transformHeader)&&(e=t.transformHeader(e)),m.push(e)}}(),function(){if(!y||!t.header&&!t.dynamicTyping&&!t.transform)return y;function e(e,r){var n,i=t.header?{}:[];for(n=0;n<e.length;n++){var o=n,s=e[n];t.header&&(o=n>=m.length?"__parsed_extra":m[n]),t.transform&&(s=t.transform(s,o)),s=C(o,s),"__parsed_extra"===o?(i[o]=i[o]||[],i[o].push(s)):i[o]=s}return t.header&&(n>m.length?E("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+n,f+r):n<m.length&&E("FieldMismatch","TooFewFields","Too few fields: expected "+m.length+" fields but parsed "+n,f+r)),i}var r=1;return!y.data.length||Array.isArray(y.data[0])?(y.data=y.data.map(e),r=y.data.length):y.data=e(y.data,0),t.header&&y.meta&&(y.meta.fields=m),f+=r,y}()}function S(){return t.header&&0===m.length}function C(e,r){return n=e,t.dynamicTypingFunction&&void 0===t.dynamicTyping[n]&&(t.dynamicTyping[n]=t.dynamicTypingFunction(n)),!0===(t.dynamicTyping[n]||t.dynamicTyping)?"true"===r||"TRUE"===r||"false"!==r&&"FALSE"!==r&&(function(t){if(a.test(t)){var e=parseFloat(t);if(o<e&&e<i)return!0}return!1}(r)?parseFloat(r):c.test(r)?new Date(r):""===r?null:r):r;var n}function E(t,e,r,n){var i={type:t,code:e,message:r};void 0!==n&&(i.row=n),y.errors.push(i)}this.parse=function(i,o,a){var c=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substring(0,1048576);var r=new RegExp(p(e)+"([^]*?)"+p(e),"gm"),n=(t=t.replace(r,"")).split("\r"),i=t.split("\n"),o=1<i.length&&i[0].length<n[0].length;if(1===n.length||o)return"\n";for(var s=0,a=0;a<n.length;a++)"\n"===n[a][0]&&s++;return s>=n.length/2?"\r\n":"\r"}(i,c)),n=!1,t.delimiter)x(t.delimiter)&&(t.delimiter=t.delimiter(i),y.meta.delimiter=t.delimiter);else{var u=function(e,r,n,i,o){var a,c,u,l;o=o||[",","\t","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var f=0;f<o.length;f++){var h=o[f],d=0,p=0,m=0;u=void 0;for(var y=new v({comments:i,delimiter:h,newline:r,preview:10}).parse(e),g=0;g<y.data.length;g++)if(n&&w(y.data[g]))m++;else{var b=y.data[g].length;p+=b,void 0!==u?0<b&&(d+=Math.abs(b-u),u=b):u=b}0<y.data.length&&(p/=y.data.length-m),(void 0===c||d<=c)&&(void 0===l||l<p)&&1.99<p&&(c=d,a=h,l=p)}return{successful:!!(t.delimiter=a),bestDelimiter:a}}(i,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);u.successful?t.delimiter=u.bestDelimiter:(n=!0,t.delimiter=s.DefaultDelimiter),y.meta.delimiter=t.delimiter}var l=b(t);return t.preview&&t.header&&l.preview++,e=i,r=new v(l),y=r.parse(e,o,a),_(),h?{meta:{paused:!0}}:y||{meta:{paused:!1}}},this.paused=function(){return h},this.pause=function(){h=!0,r.abort(),e=x(t.chunk)?"":e.substring(r.getCharIndex())},this.resume=function(){u.streamer._halted?(h=!1,u.streamer.parseChunk(e,!0)):setTimeout(this.resume,3)},this.aborted=function(){return d},this.abort=function(){d=!0,r.abort(),y.meta.aborted=!0,x(t.complete)&&t.complete(y),e=""}}function p(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(t){var e,r=(t=t||{}).delimiter,n=t.newline,i=t.comments,o=t.step,a=t.preview,c=t.fastMode,u=e=void 0===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(u=t.escapeChar),("string"!=typeof r||-1<s.BAD_DELIMITERS.indexOf(r))&&(r=","),i===r)throw new Error("Comment character same as delimiter");!0===i?i="#":("string"!=typeof i||-1<s.BAD_DELIMITERS.indexOf(i))&&(i=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var l=0,f=!1;this.parse=function(t,s,h){if("string"!=typeof t)throw new Error("Input must be a string");var d=t.length,v=r.length,m=n.length,y=i.length,g=x(o),b=[],w=[],_=[],S=l=0;if(!t)return D();if(c||!1!==c&&-1===t.indexOf(e)){for(var C=t.split(n),E=0;E<C.length;E++){if(_=C[E],l+=_.length,E!==C.length-1)l+=n.length;else if(h)return D();if(!i||_.substring(0,y)!==i){if(g){if(b=[],M(_.split(r)),N(),f)return D()}else M(_.split(r));if(a&&a<=E)return b=b.slice(0,a),D(!0)}}return D()}for(var k=t.indexOf(r,l),O=t.indexOf(n,l),R=new RegExp(p(u)+p(e),"g"),j=t.indexOf(e,l);;)if(t[l]!==e)if(i&&0===_.length&&t.substring(l,l+y)===i){if(-1===O)return D();l=O+m,O=t.indexOf(n,l),k=t.indexOf(r,l)}else{if(-1!==k&&(k<O||-1===O)){if(!(k<j)){_.push(t.substring(l,k)),l=k+v,k=t.indexOf(r,l);continue}var A=K(k,j,O);if(A&&void 0!==A.nextDelim){k=A.nextDelim,j=A.quoteSearch,_.push(t.substring(l,k)),l=k+v,k=t.indexOf(r,l);continue}}if(-1===O)break;if(_.push(t.substring(l,O)),P(O+m),g&&(N(),f))return D();if(a&&b.length>=a)return D(!0)}else for(j=l,l++;;){if(-1===(j=t.indexOf(e,j+1)))return h||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:b.length,index:l}),I();if(j===d-1)return I(t.substring(l,j).replace(R,e));if(e!==u||t[j+1]!==u){if(e===u||0===j||t[j-1]!==u){-1!==k&&k<j+1&&(k=t.indexOf(r,j+1)),-1!==O&&O<j+1&&(O=t.indexOf(n,j+1));var T=F(-1===O?k:Math.min(k,O));if(t[j+1+T]===r){_.push(t.substring(l,j).replace(R,e)),t[l=j+1+T+v]!==e&&(j=t.indexOf(e,l)),k=t.indexOf(r,l),O=t.indexOf(n,l);break}var L=F(O);if(t.substring(j+1+L,j+1+L+m)===n){if(_.push(t.substring(l,j).replace(R,e)),P(j+1+L+m),k=t.indexOf(r,l),j=t.indexOf(e,l),g&&(N(),f))return D();if(a&&b.length>=a)return D(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:b.length,index:l}),j++}}else j++}return I();function M(t){b.push(t),S=l}function F(e){var r=0;if(-1!==e){var n=t.substring(j+1,e);n&&""===n.trim()&&(r=n.length)}return r}function I(e){return h||(void 0===e&&(e=t.substring(l)),_.push(e),l=d,M(_),g&&N()),D()}function P(e){l=e,M(_),_=[],O=t.indexOf(n,l)}function D(t){return{data:b,errors:w,meta:{delimiter:r,linebreak:n,aborted:f,truncated:!!t,cursor:S+(s||0)}}}function N(){o(D()),b=[],w=[]}function K(n,i,o){var s={nextDelim:void 0,quoteSearch:void 0},a=t.indexOf(e,i+1);if(i<n&&n<a&&(a<o||-1===o)){var c=t.indexOf(r,a);if(-1===c)return s;a<c&&(a=t.indexOf(e,a+1)),s=K(c,a,o)}else s={nextDelim:n,quoteSearch:i};return s}},this.abort=function(){f=!0},this.getCharIndex=function(){return l}}function m(t){var e=t.data,r=i[e.workerId],n=!1;if(e.error)r.userError(e.error,e.file);else if(e.results&&e.results.data){var o={abort:function(){n=!0,y(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:g,resume:g};if(x(r.userStep)){for(var s=0;s<e.results.data.length&&(r.userStep({data:e.results.data[s],errors:e.results.errors,meta:e.results.meta},o),!n);s++);delete e.results}else x(r.userChunk)&&(r.userChunk(e.results,o,e.file),delete e.results)}e.finished&&!n&&y(e.workerId,e.results)}function y(t,e){var r=i[t];x(r.userComplete)&&r.userComplete(e),r.terminate(),delete i[t]}function g(){throw new Error("Not implemented.")}function b(t){if("object"!=typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var r in t)e[r]=b(t[r]);return e}function w(t,e){return function(){t.apply(e,arguments)}}function x(t){return"function"==typeof t}return n&&(e.onmessage=function(t){var r=t.data;if(void 0===s.WORKER_ID&&r&&(s.WORKER_ID=r.workerId),"string"==typeof r.input)e.postMessage({workerId:s.WORKER_ID,results:s.parse(r.input,r.config),finished:!0});else if(e.File&&r.input instanceof File||r.input instanceof Object){var n=s.parse(r.input,r.config);n&&e.postMessage({workerId:s.WORKER_ID,results:n,finished:!0})}}),(u.prototype=Object.create(c.prototype)).constructor=u,(l.prototype=Object.create(c.prototype)).constructor=l,(f.prototype=Object.create(f.prototype)).constructor=f,(h.prototype=Object.create(c.prototype)).constructor=h,s}))},"37e8":function(t,e,r){var n=r("83ab"),i=r("9bf2"),o=r("825a"),s=r("df75");t.exports=n?Object.defineProperties:function(t,e){o(t);var r,n=s(e),a=n.length,c=0;while(a>c)i.f(t,r=n[c++],e[r]);return t}},"3bbe":function(t,e,r){var n=r("861d");t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"3c1f":function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{ref:"app",staticClass:"app-wrapper",style:"--brand-color:"+t.color},[r("div",{staticClass:"guspread-container",attrs:{"data-selectedallcol":t.isSelectedAllCol,"data-selectedallrow":t.isSelectedAllRow,"data-selectedall":t.isSelectedAll},on:{wheel:t.scrolled}},[r("div",{staticClass:"guspread-table-root",style:"width:"+(t.rootRect.w-1)+"px;height:"+(t.rootRect.h-1)+"px;",attrs:{"data-selectleft":t.cursors.active&&0==t.cursors.c1,"data-selectabove":t.cursors.active&&0==t.cursors.r1},on:{click:t.clickedHeaderRoot}}),r("table",{staticClass:"guspread-table guspread-table-header-row",style:"top:0;left:"+t.rootRect.w+"px;transform:translateX(-"+t.offsetWorld.x+"px);"},[r("thead",[r("tr",[t._l(t.visibleWorldCol,(function(e,n){return[r("th",{key:"hd-"+e,staticStyle:{height:"26px"},attrs:{"data-selectleft":t.cursors.active&&t.cursors.c1-1==e,"data-select":t.cursors.active&&t.cursors.c1<=e&&t.cursors.c2>=e},on:{mousedown:[function(r){return r.ctrlKey||r.shiftKey||r.altKey||r.metaKey?null:t.clickedHeaderCell(e)},function(r){return r.shiftKey?r.ctrlKey||r.altKey||r.metaKey?null:(r.stopPropagation(),t.clickedHeaderCellWithShift(e)):null}],mouseenter:function(r){t.enteredMouse({r:t.itemCount-1,c:e})},mouseup:function(e){return t.handleMouseUp()}}},[t.thisField[n]&&t.thisField[n].hasOwnProperty(t.labelKey)?[t._t("field",[t._v(t._s(t.thisField[n][t.labelKey]))],{field:t.thisField[n]})]:t._e()],2)]}))],2)])]),r("table",{staticClass:"guspread-table guspread-table-header-col",style:"left:0;top:"+t.rootRect.h+"px;transform:translateY(-"+t.offsetWorld.y+"px);"},[r("tbody",[t._l(t.visibleWorldRow,(function(e){return[r("tr",{key:"hcttr"+e},[r("th",{staticStyle:{height:"27px",width:"49px"},attrs:{"data-selectabove":t.cursors.active&&t.cursors.r1-1==e,"data-select":t.cursors.active&&t.cursors.r1<=e&&t.cursors.r2>=e},on:{mousedown:[function(r){return r.ctrlKey||r.shiftKey||r.altKey||r.metaKey?null:t.clickedHeaderRow(e)},function(r){return r.shiftKey?r.ctrlKey||r.altKey||r.metaKey?null:(r.stopPropagation(),t.clickedHeaderRowWithShift(e)):null}],mouseenter:function(r){t.enteredMouse({r:e,c:t.fieldCount-1})},mouseup:function(e){return t.handleMouseUp()}}},[t._v(t._s(e+1))])])]}))],2)]),r("table",{staticClass:"guspread-table guspread-table-body",style:"top:"+t.rootRect.h+"px;left:"+t.rootRect.w+"px;transform:translate(-"+t.offsetWorld.x+"px,-"+t.offsetWorld.y+"px);"},[r("tbody",[t._l(t.visibleWorldRow,(function(e){return[r("v-guspread-tr",{key:"tbttr"+e,attrs:{item:t.value[e],cursors:t.cursors,thisField:t.thisField,visibleWorldCol:t.visibleWorldCol,cellClass:t.cellClass,rowClass:t.rowClass,cellReadonly:t.cellReadonly,nameKey:t.nameKey,row:e},on:{thmdown:function(r){return t.clickedHeaderRow(e)},thmdownshift:function(r){return t.clickedHeaderRowWithShift(e)},thmenter:function(r){t.enteredMouse({r:e,c:t.fieldCount-1})},thmup:function(e){return t.handleMouseUp()},trmdown:t.clickedDownCell,trmdownshift:t.clickedDownCellWithShift,trdblc:t.dblclickedCell,trmenter:t.enteredMouse,trmup:function(e){return t.handleMouseUp()}},scopedSlots:t._u([{key:"cell",fn:function(e){var r=e.field,n=e.row,i=e.col,o=e.item,s=e.value;return[t._t("cell",[t._v(t._s(s))],{field:r,row:n,col:i,item:o,value:s})]}}],null,!0)})]}))],2)]),t.cursors.active?r("div",{class:"cursor "+t.cs.class,style:"padding:0;transform: translate("+t.cursors.x+"px, "+t.cursors.y+"px);width:"+(t.cursors.w+1)+"px;height:"+(t.cursors.h+1)+"px;top:-1px;left:-1px",attrs:{"data-multi":t.cursors.multi,"data-editmode":t.isEditMode}},[t.isEditMode&&t.cursors.active?r("div",{ref:"form",staticClass:"form-container"},[r("form",{on:{submit:t.submitted}},[t._t("input",[r("input",{directives:[{name:"model",rawName:"v-model.lazy",value:t.selectedRow[t.selectedField[t.nameKey]],expression:"selectedRow[selectedField[nameKey]]",modifiers:{lazy:!0}}],attrs:{type:"text"},domProps:{value:t.selectedRow[t.selectedField[t.nameKey]]},on:{change:function(e){return t.$set(t.selectedRow,t.selectedField[t.nameKey],e.target.value)}}})],{field:t.selectedField,item:t.selectedRow})],2)]):t._e()]):t._e(),t.copyCursors.active?r("div",{staticClass:"copy-cursor",style:"padding:0;transform: translate("+t.copyCursors.x+"px, "+t.copyCursors.y+"px);width:"+(t.copyCursors.w+1)+"px;height:"+(t.copyCursors.h+1)+"px;top:-1px;left:-1px"}):t._e(),t.showMinimap?r("v-guspread-mini-map",{staticClass:"guspread-minimap",attrs:{wholeWorld:t.wholeWorld,world:t.world},on:{scrollbox:t.scrolledBox}}):t._e()],1)])},i=[];r("4de4"),r("4160"),r("c975"),r("e260"),r("d81d"),r("fb6a"),r("cca6"),r("b64b"),r("d3b7"),r("159b"),r("ddb0");function o(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}r("a4d3"),r("e01a"),r("d28b"),r("a630"),r("25f0"),r("3ca3");function s(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function c(t){return o(t)||s(t)||a()}r("96cf"),r("e6cf");function u(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(u){return void r(u)}a.done?e(c):Promise.resolve(c).then(n,i)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(t){u(o,n,i,s,a,"next",t)}function a(t){u(o,n,i,s,a,"throw",t)}s(void 0)}))}}var f=r("369b"),h=r.n(f),d=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("tr",{class:t.thisClass},[t._l(t.visibleWorldCol,(function(e,n){return[r("v-guspread-td",{key:"row-"+t.row+"-column-"+e,attrs:{cellClass:t.cellClass,cellReadonly:t.cellReadonly,field:t.thisField[n],item:t.item,row:t.row,col:e,nameKey:t.nameKey},on:{trmdown:function(r){return t.$emit("trmdown",{r:t.row,c:e})},trmdownshift:function(r){return t.$emit("trmdownshift",{r:t.row,c:e})},trdblc:function(r){return t.$emit("trdblc",{r:t.row,c:e})},trmenter:function(r){return t.$emit("trmenter",{r:t.row,c:e})},trmup:function(e){return t.$emit("trmup")}},scopedSlots:t._u([{key:"cell",fn:function(e){var r=e.field,n=e.row,i=e.col,o=e.item,s=e.value;return[t._t("cell",null,{field:r,row:n,col:i,item:o,value:s})]}}],null,!0)})]}))],2)},p=[],v=(r("a15b"),r("a9e3"),function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("td",{class:t.extraCellClass,attrs:{"data-readonly":t.dataReadOnly},on:{mousedown:[function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.$emit("trmdown")},function(e){return e.shiftKey?e.ctrlKey||e.altKey||e.metaKey?null:(e.stopPropagation(),t.$emit("trmdownshift")):null}],dblclick:function(e){return e.stopPropagation(),t.$emit("trdblc")},mouseenter:function(e){return t.$emit("trmenter")},mouseup:function(e){return t.$emit("trmup")}}},[t._t("cell",null,{field:t.field,row:t.row,col:t.col,item:t.item,value:t.value})],2)}),m=[],y={props:{item:{type:Object,default:{}},nameKey:{type:String,default:{}},field:{type:Object,default:{}},row:{type:Number,default:0},col:{type:Number,default:0},cellClass:{type:Function,default:null},cellReadonly:{type:Function,default:null}},computed:{value:function(){var t=this.field,e=this.item,r=this.nameKey;return t&&r&&t.hasOwnProperty(r)&&e&&e.hasOwnProperty(t[r])?e[t[r]]:null},dataReadOnly:function(){return!!(this.cellReadonly&&this.field&&this.item)&&this.cellReadonly({field:this.field,item:this.item,row:this.row,col:this.col,value:this.value})},extraCellClass:function(){return this.cellClass&&this.field&&this.item?this.cellClass({field:this.field,item:this.item,row:this.row,col:this.col,value:this.value}).join(" "):""}}},g=y;function b(t,e,r,n,i,o,s,a){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=r,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=c):i&&(c=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:u}}var w=b(g,v,m,!1,null,null,null),x=w.exports,_={components:{VGuspreadTd:x},props:{item:{type:Object,default:{}},cursors:{type:Object,default:{}},nameKey:{type:String,default:{}},thisField:{type:Array,default:[]},visibleWorldCol:{type:Array,default:[]},row:{type:Number,default:0},cellClass:{type:Function,default:null},cellReadonly:{type:Function,default:null},rowClass:{type:Function,default:null}},computed:{thisClass:function(){var t=this.rowClass;return t?t({item:this.item,row:this.row}).join(" "):""}}},S=_,C=b(S,d,p,!1,null,null,null),E=C.exports,k=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.show?r("div",{staticClass:"guspread-minimap"},[r("div",{ref:"minimap",staticClass:"guspread-minimap-background",style:"width:"+t.map.w+"px;height:"+t.map.h+"px;cursor: "+(t.dragging?"grabbing":"grab")+";",on:{mousedown:t.mDown,mouseup:t.mDone,mousemove:t.mMove,mouseenter:function(e){t.active=!0},mouseleave:function(e){t.active=!1}}}),r("div",{ref:"box",staticClass:"guspread-minimap-box",style:t.boxStyle})]):t._e()},O=[],R=(r("99af"),!1),j={props:{showing:{type:Object,default:null},wholeWorld:{type:Object,default:null},world:{type:Object,default:null}},data:function(){return{active:!1,dragging:!1,box:{w:100,h:75,x:0,y:0},start:{x:0,y:0}}},methods:{mDown:function(t){var e=t.clientX,r=t.clientY;this.dragging=!0;var n=e-this.box.x,i=r-this.box.y;this.$set(this,"start",{x:n,y:i})},mDone:function(){this.dragging=!1},moveBox:function(t){var e=this,r=t.x,n=t.y;R||(R=!0,window.requestAnimationFrame((function(){e.box.x=r,e.box.y=n,R=!1})))},mMove:function(t){var e=t.clientX,r=t.clientY;if(this.dragging&&e>=0&&r>=0){var n=this.map,i=this.box,o=e-this.start.x,s=r-this.start.y,a=o<0?0:o>n.w-i.w?n.w-i.w:o,c=s<0?0:s>n.h-i.h?n.h-i.h:s;this.moveBox({x:a,y:c})}}},computed:{boxStyle:function(){return"width:".concat(this.box.w,"px;height:").concat(this.box.h,"px;right:").concat(11+this.map.w-this.box.w,"px;bottom:").concat(11+this.map.h-this.box.h,"px;transform: translate(").concat(this.box.x,"px,").concat(this.box.y,"px);")},show:function(){var t=this.map,e=this.box;return!(!t||!e)&&(t.w>e.w||t.h>e.h)},map:function(){var t=this.wholeWorld,e=this.world;if(t&&e){var r=t.w>e.w?250:this.box.w,n=t.h>e.h?220:this.box.h;return{w:r,h:n}}return{w:0,h:0}}},watch:{box:{handler:function(t){var e=t.x,r=t.y;if(this.dragging){var n=this.map,i=this.box,o=this.wholeWorld,s=this.world,a=n.w>i.w?(o.w-s.w)*e/(n.w-i.w):0,c=n.h>i.h?(o.h-s.h)*r/(n.h-i.h):0;a>=0&&c>=0&&this.$emit("scrollbox",{x:Math.round(a),y:Math.round(c)})}},deep:!0},active:function(t){if(t&&!this.dragging){var e=this.world,r=this.map,n=this.wholeWorld,i=this.box;if(r&&r.w>0&&r.h>0){var o=r.w>i.w?(r.w-i.w)*e.x1/(n.w-e.w):0,s=r.h>i.h?(r.h-i.h)*e.y1/(n.h-e.h):0;this.moveBox({x:o,y:s})}}}}},A=j,T=(r("da80"),b(A,k,O,!1,null,"524a52ce",null)),L=T.exports,M=400,F={w:150,h:27},I=!1,P={x:0,y:0,w:0,h:0,mx:0,my:0},D=function(t){var e={};return Object.keys(t).forEach((function(r){Object.defineProperty(e,r,{configurable:!1,value:t[r]})})),e},N={components:{VGuspreadTr:E,VGuspreadMiniMap:L},props:{value:{type:Array,default:[]},fields:{type:Array,default:[]},color:{type:String,default:"#41b883"},hideMinimap:{type:Boolean,default:!1},nameKey:{type:String,default:"name"},labelKey:{type:String,default:"label"},options:{type:Object,default:null},cellClass:{type:Function,default:null},rowClass:{type:Function,default:null},cellReadonly:{type:Function,default:null}},data:function(){return{active:!1,widths:[],isEditMode:!1,isSelecting:!1,s:{a:{r:null,c:null},b:{r:null,c:null}},c:null,world:null,cs:{class:"",delayTimeout:null},scrolling:!1,delayTimeout:null,optimizedFields:[],optimizedItems:[]}},methods:{moveNext:function(t){var e=this;return l(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.isEditMode=!1,r.next=3,e.$nextTick(t);case 3:e.scrollCursorIntoView();case 4:case"end":return r.stop()}}),r)})))()},clicked:function(t){this.$refs.app.contains(t.target)||(this.active=!1)},clickedHeaderCellWithShift:function(t){var e=this.itemCount-1;this.s.b={r:e,c:t}},clickedHeaderCell:function(t){this.active=!0,this.isSelecting=!0;var e=this.itemCount-1;this.s.a={r:0,c:t},this.s.b={r:e,c:t}},clickedHeaderRowWithShift:function(t){var e=this.fieldCount-1;this.s.b={r:t,c:e}},clickedHeaderRow:function(t){this.active=!0,this.isSelecting=!0;var e=this.fieldCount-1;this.s.a={r:t,c:0},this.s.b={r:t,c:e}},clickedHeaderRoot:function(){this.active=!0;var t=this.itemCount-1,e=this.fieldCount-1;this.s.a={r:0,c:0},this.s.b={r:t,c:e}},enteredMouse:function(t){var e=t.r,r=t.c;this.isSelecting&&(this.s.b.r==e&&this.s.b.c==r||(this.s.b={r:e,c:r}))},handleMouseUp:function(){this.isSelecting=!1},scrollCursorIntoView:function(){var t=this.cursors,e=this.world,r=e.x1,n=e.y1,i=e.h,o=e.w,s=t.x-50,a=t.y-27,c=t.x+t.w,u=t.y+t.h;if(!(0<=s&&c<=o&&0<=a&&u<=i)){var l=r,f=n;0>s?l+=s:c>o&&(l+=c-o),0>a?f+=a:u>i&&(f+=u-i),this.scrolledBox({x:l,y:f})}},onKeyDown:function(t){this.active&&!this.isEditMode&&("ArrowUp"==t.key?(t.preventDefault(),this.moveCursorUp(t.shiftKey)):"ArrowRight"==t.key?(t.preventDefault(),this.moveCursorRight(t.shiftKey)):"ArrowDown"==t.key?(t.preventDefault(),this.moveCursorDown(t.shiftKey)):"ArrowLeft"==t.key?(t.preventDefault(),this.moveCursorLeft(t.shiftKey)):"Enter"==t.key?null!=this.s.a.r&&null!=this.s.a.c&&(t.preventDefault(),this.changeToEditmode(this.s.a.r,this.s.a.c)):"Backspace"==t.key?this.doDel():"c"==t.key&&(t.metaKey||t.ctrlKey)?this.doCopy():"v"==t.key&&(t.metaKey||t.ctrlKey)&&this.doPaste())},doDel:function(){var t=this.selectedArea;if(null!=t)for(var e=this.value,r=this.optimizedFields,n=this.nameKey,i=t.r;i<t.r+t.h;i++)for(var o=t.c;o<t.c+t.w;o++){var s=!!this.cellReadonly&&this.cellReadonly({field:r[o],item:e[i],row:i,col:o,value:e[i][r[o][n]]});s||this.$set(this.value[i],r[o][n],null)}},doCopy:function(){var t=this;if(this.cursors&&this.cursors.active){var e=Object.assign({},this.cursors);this.$set(this,"c",e),navigator.permissions.query({name:"clipboard-write"}).then((function(r){if("granted"==r.state||"prompt"==r.state){var n=e.r1,i=e.r2,o=e.c1,s=e.c2,a=t.optimizedFields.filter((function(t,e){return e>=o&&e<=s})).map((function(e){return e[t.nameKey]})),c=t.value.filter((function(t,e){return e>=n&&e<=i})).map((function(t){return Object.keys(t).filter((function(t){return a.indexOf(t)>=0})).map((function(e){return t[e]}))}));navigator.clipboard.writeText(h.a.unparse(c,{dynamicTyping:!0,delimiter:"\t"}))}}))}},doPaste:function(){var t=this;this.$set(this,"c",null),navigator.permissions.query({name:"clipboard-read"}).then((function(e){var r=e.state;"granted"!=r&&"prompt"!=r||navigator.clipboard.readText().then((function(e){var r=h.a.parse(e,{dynamicTyping:!0,delimiter:"\t"}),n=r.data,i=t.selectedArea;n&&n.length>0&&null!=i&&t.doReplaceData(i,n)}))}))},doReplaceData:function(t,e){for(var r=t.w,n=t.h,i=e.length,o=e[0].length,s=this.itemCount-1,a=this.fieldCount-1,c=t.r-1+(i>n?i:n),u=t.c-1+(o>r?o:r),l=this.optimizedFields,f=this.nameKey,h=this.value,d=this.cellReadonly,p=this.itemCount,v=this.fieldCount,m=t.r;m<p;m++){if(m>=t.r+i&&m>=t.r+n)break;for(var y=t.c;y<v;y++){if(y>=t.c+o&&y>=t.c+r)break;var g=(m-t.r)%i,b=(y-t.c)%o,w=e[g][b],x=!!d&&d({field:l[y],item:h[m],row:m,col:y,value:h[m][l[y][f]]});x||this.$set(h[m],l[y][f],w)}}var _=c>s?s:c,S=u>a?a:u;this.s.b={r:_,c:S}},submitted:function(t){t.preventDefault(),this.moveCursorDown()},moveCursorUp:function(t){var e=this;this.moveNext((function(){var r=t?e.s.b:e.s.a,n=r.r,i=r.c;n>=0&&(n--,n<0&&(n=0),t||(e.s.a={r:n,c:i}),e.s.b={r:n,c:i})}))},moveCursorLeft:function(t){var e=this;this.moveNext((function(){var r=t?e.s.b:e.s.a,n=r.r,i=r.c;i>=0&&(i--,i<0&&(i=0),t||(e.s.a={r:n,c:i}),e.s.b={r:n,c:i})}))},moveCursorDown:function(t){var e=this;this.moveNext((function(){var r=t?e.s.b:e.s.a,n=r.r,i=r.c;n<=e.itemCount-1&&(n++,n>e.itemCount-1&&(n=e.itemCount-1),t||(e.s.a={r:n,c:i}),e.s.b={r:n,c:i})}))},moveCursorRight:function(t){var e=this;this.moveNext((function(){var r=t?e.s.b:e.s.a,n=r.r,i=r.c;i<=e.fieldCount-1&&(i++,i>e.fieldCount-1&&(i=e.fieldCount-1),t||(e.s.a={r:n,c:i}),e.s.b={r:n,c:i})}))},shakeCursor:function(){var t=this;window.clearTimeout(this.cs.delayTimeout),this.cs.class="cursor-shake",this.cs.delayTimeout=window.setTimeout((function(){t.cs.class=""}),M)},dblclickedCell:function(t){var e=t.r,r=t.c;this.changeToEditmode(e,r)},changeToEditmode:function(t,e){var r=!!this.cellReadonly&&this.cellReadonly({field:this.optimizedFields[e],item:this.value[t],row:t,col:e,value:this.value[t][this.optimizedFields[e][this.nameKey]]});r?this.shakeCursor():this.isEditMode=!0},getPositions:function(t,e){var r=50+e*F.w,n=F.h+t*F.h,i=F.w,o=F.h;return{x:r,y:n,w:i,h:o}},clickedDownCellWithShift:function(t){var e=t.r,r=t.c;this.$set(this.s,"b",{r:e,c:r})},clickedDownCell:function(t){var e=this,r=t.r,n=t.c;this.active||(this.active=!0),this.isSelecting=!0,!this.isEditMode||this.s.a.r==r&&this.s.a.c==n?(this.$set(this.s,"a",{r:r,c:n}),this.$set(this.s,"b",{r:null,c:null})):this.moveNext((function(){e.$set(e.s,"a",{r:r,c:n}),e.$set(e.s,"b",{r:null,c:null})}))},scrolledBox:function(t){var e=this,r=t.x,n=t.y;this.isEditMode||this.calcScrolledPosition({tx:r,ty:n}),window.clearTimeout(this.delayTimeout),this.delayTimeout=window.setTimeout((function(){e.scrolling=!1,I=!1}),800)},scrolled:function(t){var e=this,r=t.deltaX,n=t.deltaY;this.isEditMode||this.calcScrolledPosition({deltaX:r,deltaY:n}),window.clearTimeout(this.delayTimeout),this.delayTimeout=window.setTimeout((function(){e.scrolling=!1,I=!1}),800)},animateFrame:function(){var t=this;window.requestAnimationFrame((function(){var e=P.x,r=P.y,n=e+P.w+1,i=r+P.h;t.world.x1=e,t.world.x2=n,t.world.y1=r,t.world.y2=i,I&&t.animateFrame()}))},calcScrolledPosition:function(t){var e=t.deltaX,r=t.deltaY,n=t.tx,i=t.ty,o=P.x,s=P.y;if(null!=e&&null!=r){var a=Math.abs(e),c=Math.abs(r);a>c?o=P.x+e:c>=a&&(s=P.y+r)}else null!=n&&null!=i&&(o=n,s=i);var u=o<0?0:o>P.mx-P.w-150?P.mx-P.w-150:o,l=s<0?0:s>P.my-P.h-27?P.my-P.h-27:s;P.x=u,P.y=l,I||(I=!0,this.scrolling=!0,this.animateFrame())},initWorld:function(){this.changeWorld(!0)},resizeWorld:function(){this.changeWorld()},changeWorld:function(t){var e=this,r=this.$refs.app;t&&(P.x=0,P.y=0);var n=r.clientWidth,i=r.clientHeight;P.w=n,P.h=i,this.itemCount>0&&(P.my=27*(this.itemCount+2)),this.fieldCount>0&&(P.mx=150*this.fieldCount+200);var o=P.x,s=o+r.clientWidth,a=P.y,c=a+r.clientHeight;this.$nextTick((function(){e.$set(e,"world",{x1:o,y1:a,x2:s,y2:c,w:n,h:i})}))},optimizeFields:function(){var t=this.fields;t&&(this.optimizedFields=t.map((function(t){return D(t)})),P.mx=150*t.length+200)},optimizeItems:function(){var t=this.value;t&&(this.optimizedItems=t.map((function(t){return D(t)}))),P.my=27*(t.length+2)}},computed:{selectedArea:function(){var t=this.s.a;if(null!=t){var e=this.s.b,r=t.r,n=t.c,i=1,o=1;return null!=e.r&&null!=e.c&&(e.r<t.r&&(r=e.r),e.c<t.c&&(n=e.c),o=Math.abs(t.r-e.r)+1,i=Math.abs(t.c-e.c)+1),{r:r,c:n,w:i,h:o}}return null},wholeWorld:function(){var t=this.itemCount,e=this.fieldCount;if(t&&e){var r=F.h*(t+1),n=F.w*e+50;return{w:n,h:r}}return null},rootRect:function(){return{w:50,h:F.h}},showMinimap:function(){return!this.hideMinimap&&this.world&&!(this.cursors.active&&this.cursors.multi)&&!this.isEditMode},isSelectedAll:function(){return this.isSelectedAllRow&&this.isSelectedAllCol},isSelectedAllRow:function(){if(this.cursors){var t=this.itemCount-1,e=this.cursors;return 0==e.r1&&e.r2==t}return!1},isSelectedAllCol:function(){if(this.cursors){var t=this.fieldCount-1,e=this.cursors;return 0==e.c1&&e.c2==t}return!1},visibleWorldRow:function(){var t=this;return this.worldRows&&this.itemCount>0&&this.worldRows.r2-this.worldRows.r1>0?c(Array(this.worldRows.r2-this.worldRows.r1).keys()).map((function(e){return e+t.worldRows.r1})):[]},offsetWorld:function(){var t=this.world,e={x:0,y:0};return t&&t.x1&&t.x1>0&&(e.x=t.x1%F.w),t&&t.y1&&t.y1>0&&(e.y=t.y1%F.h),e},visibleWorldCol:function(){var t=this;return this.worldCols&&this.fieldCount>0&&this.worldCols.c2-this.worldCols.c1>0?c(Array(this.worldCols.c2-this.worldCols.c1).keys()).map((function(e){return e+t.worldCols.c1})):[]},thisField:function(){return this.visibleWorldCol.length>0?this.optimizedFields.slice(this.worldCols.c1,this.worldCols.c2):[]},invisibleWorldPrependCol:function(){if(this.worldCols&&this.worldCols.c1>0){var t=F.w*this.worldCols.c1;return{w:t}}return null},worldRows:function(){if(this.world){var t=Math.floor(this.world.y1/F.h),e=Math.floor((this.world.y2-this.world.y1)/F.h),r=t+e+1,n=this.itemCount,i=t>0?t:0,o=r<n?r:n;return{r1:i,r2:o}}return{r1:0,r2:0}},worldCols:function(){if(this.world){var t=Math.floor(this.world.x1/F.w),e=Math.floor((this.world.x2-this.world.x1)/F.w),r=t>0?t:0,n=r+e+2,i=this.fieldCount,o=n<i?n:i;return{c1:r,c2:o}}return{c1:0,c2:0}},fieldCount:function(){return this.optimizedFields?this.optimizedFields.length:0},itemCount:function(){return this.optimizedItems?this.optimizedItems.length:0},copyCursors:function(){if(this.c&&null!=this.c.r1&&null!=this.c.c1&&null!=this.c.r2&&null!=this.c.c2&&this.worldRows){var t=this.c.r1,e=this.c.r2,r=this.c.c1,n=this.c.c2,i=50+(r-this.worldCols.c1)*F.w-this.offsetWorld.x,o=F.h+(t-this.worldRows.r1)*F.h-this.offsetWorld.y,s=(n-r+1)*F.w,a=(e-t+1)*F.h;return{active:!0,x:i,y:o,w:s,h:a,r1:t,r2:e,c1:r,c2:n}}return{active:!1}},cursors:function(){if(null!=this.s.a.r&&null!=this.s.a.c&&null!=this.s.b.r&&null!=this.s.b.c&&this.worldRows){var t=Math.min(this.s.a.r,this.s.b.r),e=Math.max(this.s.a.r,this.s.b.r),r=Math.min(this.s.a.c,this.s.b.c),n=Math.max(this.s.a.c,this.s.b.c),i=50+(r-this.worldCols.c1)*F.w-this.offsetWorld.x,o=F.h+(t-this.worldRows.r1)*F.h-this.offsetWorld.y,s=(n-r+1)*F.w,a=(e-t+1)*F.h,c=t!=e||r!=n;return{active:!0,multi:c,x:i,y:o,w:s,h:a,r1:t,r2:e,c1:r,c2:n}}if(null!=this.s.a.r&&null!=this.s.a.c){var u=this.s.a.r,l=this.s.a.r,f=this.s.a.c,h=this.s.a.c,d=50+(f-this.worldCols.c1)*F.w-this.offsetWorld.x,p=F.h+(u-this.worldRows.r1)*F.h-this.offsetWorld.y,v=F.w,m=F.h;return{active:!0,multi:!1,x:d,y:p,w:v,h:m,r1:u,r2:l,c1:f,c2:h}}return{active:!1}},selectedField:function(){return null!=this.s.a.c?this.optimizedFields[this.s.a.c]:null},selectedRow:function(){return null!=this.s.a.r?this.value[this.s.a.r]:null},isMultiSelect:function(){return!(!this.select.from.active||!this.select.to.active)&&(this.select.from.r!=this.select.to.r||this.select.from.c!=this.select.to.c)}},created:function(){this.widths=this.optimizedFields.map((function(){return F.w}))},mounted:function(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("click",this.clicked),window.addEventListener("resize",this.resizeWorld),this.optimizeFields(),this.optimizeItems(),this.initWorld()},beforeDestroy:function(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("click",this.clicked),window.removeEventListener("resize",this.resizeWorld)},watch:{s