UNPKG

w-kriging

Version:
8 lines (7 loc) 21 kB
/*! * w-kriging v1.0.14 * (c) 2018-2021 yuda-lyu(semisphere) * Released under the MIT License. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("path"),require("fs"),require("process"),require("child_process")):"function"==typeof define&&define.amd?define(["path","fs","process","child_process"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-kriging"]=e(t.path,t.fs,t.process,t.child_process)}(this,(function(t,e,r,n){"use strict";var o=Array.isArray,i="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,c=i||u||Function("return this")(),a=c.Symbol,s=Object.prototype,f=s.hasOwnProperty,l=s.toString,p=a?a.toStringTag:void 0;var h=Object.prototype.toString;var y="[object Null]",d="[object Undefined]",v=a?a.toStringTag:void 0;function g(t){return null==t?void 0===t?d:y:v&&v in Object(t)?function(t){var e=f.call(t,p),r=t[p];try{t[p]=void 0;var n=!0}catch(t){}var o=l.call(t);return n&&(e?t[p]=r:delete t[p]),o}(t):function(t){return h.call(t)}(t)}function b(t){return null!=t&&"object"==typeof t}var _="[object Symbol]";function j(t){return"symbol"==typeof t||b(t)&&g(t)==_}var m=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w=/^\w*$/;function O(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var x="[object AsyncFunction]",S="[object Function]",A="[object GeneratorFunction]",$="[object Proxy]";function B(t){if(!O(t))return!1;var e=g(t);return e==S||e==A||e==x||e==$}var z,P=c["__core-js_shared__"],k=(z=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"";var F=Function.prototype.toString;var C=/^\[object .+?Constructor\]$/,T=Function.prototype,E=Object.prototype,I=T.toString,M=E.hasOwnProperty,N=RegExp("^"+I.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function U(t){return!(!O(t)||(e=t,k&&k in e))&&(B(t)?N:C).test(function(t){if(null!=t){try{return F.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e}function R(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return U(r)?r:void 0}var q=R(Object,"create");var D=Object.prototype.hasOwnProperty;var H=Object.prototype.hasOwnProperty;function L(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function V(t,e){for(var r,n,o=t.length;o--;)if((r=t[o][0])===(n=e)||r!=r&&n!=n)return o;return-1}L.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},L.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},L.prototype.get=function(t){var e=this.__data__;if(q){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return D.call(e,t)?e[t]:void 0},L.prototype.has=function(t){var e=this.__data__;return q?void 0!==e[t]:H.call(e,t)},L.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=q&&void 0===e?"__lodash_hash_undefined__":e,this};var J=Array.prototype.splice;function W(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}W.prototype.clear=function(){this.__data__=[],this.size=0},W.prototype.delete=function(t){var e=this.__data__,r=V(e,t);return!(r<0)&&(r==e.length-1?e.pop():J.call(e,r,1),--this.size,!0)},W.prototype.get=function(t){var e=this.__data__,r=V(e,t);return r<0?void 0:e[r][1]},W.prototype.has=function(t){return V(this.__data__,t)>-1},W.prototype.set=function(t,e){var r=this.__data__,n=V(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var G=R(c,"Map");function X(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Y(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Y.prototype.clear=function(){this.size=0,this.__data__={hash:new L,map:new(G||W),string:new L}},Y.prototype.delete=function(t){var e=X(this,t).delete(t);return this.size-=e?1:0,e},Y.prototype.get=function(t){return X(this,t).get(t)},Y.prototype.has=function(t){return X(this,t).has(t)},Y.prototype.set=function(t,e){var r=X(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var Z="Expected a function";function K(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Z);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u)||i,u};return r.cache=new(K.Cache||Y),r}K.Cache=Y;var Q,tt,et,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/\\(\\)?/g,ot=(Q=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(rt,(function(t,r,n,o){e.push(n?o.replace(nt,"$1"):r||t)})),e},tt=K(Q,(function(t){return 500===et.size&&et.clear(),t})),et=tt.cache,tt),it=ot;var ut=1/0,ct=a?a.prototype:void 0,at=ct?ct.toString:void 0;function st(t){if("string"==typeof t)return t;if(o(t))return function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}(t,st)+"";if(j(t))return at?at.call(t):"";var e=t+"";return"0"==e&&1/t==-ut?"-0":e}function ft(t){return null==t?"":st(t)}function lt(t,e){return o(t)?t:function(t,e){if(o(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!j(t))||w.test(t)||!m.test(t)||null!=e&&t in Object(e)}(t,e)?[t]:it(ft(t))}var pt=1/0;function ht(t){if("string"==typeof t||j(t))return t;var e=t+"";return"0"==e&&1/t==-pt?"-0":e}function yt(t,e,r){var n=null==t?void 0:function(t,e){for(var r=0,n=(e=lt(e,t)).length;null!=t&&r<n;)t=t[ht(e[r++])];return r&&r==n?t:void 0}(t,e);return void 0===n?r:n}function dt(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var vt,gt=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),u=i.length;u--;){var c=i[vt?u:++n];if(!1===e(o[c],c,o))break}return t};function bt(t){return b(t)&&"[object Arguments]"==g(t)}var _t=Object.prototype,jt=_t.hasOwnProperty,mt=_t.propertyIsEnumerable,wt=bt(function(){return arguments}())?bt:function(t){return b(t)&&jt.call(t,"callee")&&!mt.call(t,"callee")},Ot=wt;var xt="object"==typeof exports&&exports&&!exports.nodeType&&exports,St=xt&&"object"==typeof module&&module&&!module.nodeType&&module,At=St&&St.exports===xt?c.Buffer:void 0,$t=(At?At.isBuffer:void 0)||function(){return!1},Bt=9007199254740991,zt=/^(?:0|[1-9]\d*)$/;function Pt(t,e){var r=typeof t;return!!(e=null==e?Bt:e)&&("number"==r||"symbol"!=r&&zt.test(t))&&t>-1&&t%1==0&&t<e}var kt=9007199254740991;function Ft(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=kt}var Ct={};Ct["[object Float32Array]"]=Ct["[object Float64Array]"]=Ct["[object Int8Array]"]=Ct["[object Int16Array]"]=Ct["[object Int32Array]"]=Ct["[object Uint8Array]"]=Ct["[object Uint8ClampedArray]"]=Ct["[object Uint16Array]"]=Ct["[object Uint32Array]"]=!0,Ct["[object Arguments]"]=Ct["[object Array]"]=Ct["[object ArrayBuffer]"]=Ct["[object Boolean]"]=Ct["[object DataView]"]=Ct["[object Date]"]=Ct["[object Error]"]=Ct["[object Function]"]=Ct["[object Map]"]=Ct["[object Number]"]=Ct["[object Object]"]=Ct["[object RegExp]"]=Ct["[object Set]"]=Ct["[object String]"]=Ct["[object WeakMap]"]=!1;var Tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Et=Tt&&"object"==typeof module&&module&&!module.nodeType&&module,It=Et&&Et.exports===Tt&&i.process,Mt=function(){try{var t=Et&&Et.require&&Et.require("util").types;return t||It&&It.binding&&It.binding("util")}catch(t){}}(),Nt=Mt&&Mt.isTypedArray,Ut=Nt?function(t){return function(e){return t(e)}}(Nt):function(t){return b(t)&&Ft(t.length)&&!!Ct[g(t)]},Rt=Ut,qt=Object.prototype.hasOwnProperty;function Dt(t,e){var r=o(t),n=!r&&Ot(t),i=!r&&!n&&$t(t),u=!r&&!n&&!i&&Rt(t),c=r||n||i||u,a=c?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],s=a.length;for(var f in t)!e&&!qt.call(t,f)||c&&("length"==f||i&&("offset"==f||"parent"==f)||u&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||Pt(f,s))||a.push(f);return a}var Ht=Object.prototype;var Lt=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),Vt=Lt,Jt=Object.prototype.hasOwnProperty;function Wt(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||Ht))return Vt(t);var e,r,n=[];for(var o in Object(t))Jt.call(t,o)&&"constructor"!=o&&n.push(o);return n}function Gt(t){return null!=t&&Ft(t.length)&&!B(t)}function Xt(t){return Gt(t)?Dt(t):Wt(t)}var Yt=function(t,e){return function(r,n){if(null==r)return r;if(!Gt(r))return t(r,n);for(var o=r.length,i=e?o:-1,u=Object(r);(e?i--:++i<o)&&!1!==n(u[i],i,u););return r}}((function(t,e){return t&&gt(t,e,Xt)})),Zt=Yt;function Kt(t){return t}function Qt(t,e){var r;return(o(t)?dt:Zt)(t,"function"==typeof(r=e)?r:Kt)}var te=/\s/;var ee=/^\s+/;function re(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&te.test(t.charAt(e)););return e}(t)+1).replace(ee,""):t}var ne=NaN,oe=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ue=/^0o[0-7]+$/i,ce=parseInt;function ae(t){if("number"==typeof t)return t;if(j(t))return ne;if(O(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=O(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=re(t);var r=ie.test(t);return r||ue.test(t)?ce(t.slice(2),r?2:8):oe.test(t)?ne:+t}var se=1/0,fe=17976931348623157e292;function le(t){return t?(t=ae(t))===se||t===-se?(t<0?-1:1)*fe:t==t?t:0:0===t?t:0}function pe(t){var e=le(t),r=e%1;return e==e?r?e-r:e:0}function he(t){return"[object String]"===Object.prototype.toString.call(t)}function ye(t){return!(!he(t)||""===t)}function de(t){return t!=t}function ve(t){let e=!1;if(ye(t))e=!isNaN(Number(t));else if(function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)){if(de(t))return!1;e=!0}return e}function ge(t){if(!ve(t))return 0;return le(t)}function be(t){return!!ve(t)&&(t=ge(t),"number"==typeof(e=t)&&e==pe(e));var e}var _e=c.isFinite,je=Math.min;var me=function(t){var e=Math[t];return function(t,r){if(t=ae(t),(r=null==r?0:je(pe(r),292))&&_e(t)){var n=(ft(t)+"e").split("e");return+((n=(ft(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}("round"),we=me;function Oe(t){if(!ve(t))return 0;t=ge(t);let e=we(t);return"0"===String(e)?0:e}let xe="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Se=xe.length;function Ae(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32,e=[];var r;t=be(r=t)&&Oe(r)>0?Oe(t):32;for(let r=0;r<t;r++)e[r]=xe[0|Math.random()*Se];return e.join("")}var $e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Be(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ze(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var r=function t(){if(this instanceof t){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(e,r))}return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})})),r}var Pe={exports:{}};var ke,Fe={exports:{}},Ce=ze(Object.freeze({__proto__:null,default:{}}));function Te(){return ke||(ke=1,function(t,e){var r;t.exports=(r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==$e&&$e.crypto&&(r=$e.crypto),!r)try{r=Ce}catch(t){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),i={},u=i.lib={},c=u.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=u.WordArray=c.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=e?r:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var u=r[i>>>2]>>>24-i%4*8&255;e[n+i>>>2]|=u<<24-(n+i)%4*8}else for(var c=0;c<o;c+=4)e[n+c>>>2]=r[c>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(n());return new a.init(e,t)}}),s=i.enc={},f=s.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(r,e/2)}},l=s.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(r,e)}},p=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},h=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,o=n.words,i=n.sigBytes,u=this.blockSize,c=i/(4*u),s=(c=e?t.ceil(c):t.max((0|c)-this._minBufferSize,0))*u,f=t.min(4*s,i);if(s){for(var l=0;l<s;l+=u)this._doProcessBlock(o,l);r=o.splice(0,s),n.sigBytes-=f}return new a.init(r,f)},clone:function(){var t=c.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});u.Hasher=h.extend({cfg:c.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new y.HMAC.init(t,r).finalize(e)}}});var y=i.algo={};return i}(Math),r)}(Fe)),Fe.exports}!function(t,e){t.exports=Te().enc.Utf8}(Pe);var Ee=Be(Pe.exports),Ie={exports:{}};!function(t,e){var r;t.exports=(r=Te(),function(){var t=r,e=t.lib.WordArray;function n(t,r,n){for(var o=[],i=0,u=0;u<r;u++)if(u%4){var c=n[t.charCodeAt(u-1)]<<u%4*2|n[t.charCodeAt(u)]>>>6-u%4*2;o[i>>>2]|=c<<24-i%4*8,i++}return e.create(o,i)}t.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var u=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,c=0;c<4&&i+.75*c<r;c++)o.push(n.charAt(u>>>6*(3-c)&63));var a=n.charAt(64);if(a)for(;o.length%4;)o.push(a);return o.join("")},parse:function(t){var e=t.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var u=r.charAt(64);if(u){var c=t.indexOf(u);-1!==c&&(e=c)}return n(t,e,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)}(Ie);var Me=Be(Ie.exports);function Ne(t){return"[object Array]"===Object.prototype.toString.call(t)}function Ue(t){return"[object Object]"===Object.prototype.toString.call(t)}function Re(t){return!!function(t){return"[object Undefined]"===Object.prototype.toString.call(t)}(t)||(!!function(t){return"[object Null]"===Object.prototype.toString.call(t)}(t)||(!!function(t){if(Ue(t)){for(let e in t)return!1;return!0}return!1}(t)||(!!function(t){return!(!he(t)||""!==t)}(t)||(!!function(t){return!!Ne(t)&&0===t.length}(t)||!!de(t)))))}function qe(t){return!!Ne(t)&&(0!==t.length&&(1!==t.length||!Re(t[0])))}function De(t){if(Ue(t)){for(let e in t)return!0;return!1}return!1}function He(t){return function(t){let e=yt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");return!!e.existsSync(t)&&!e.lstatSync(t).isDirectory()&&!e.lstatSync(t).isSymbolicLink()}(t,{fs:e})}var Le="[object Boolean]";function Ve(t){return!0===(e=t)||!1===e||b(e)&&g(e)==Le;var e}function Je(t){let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e}function We(t){if(!be(t))return!1;return Oe(t)>=0}function Ge(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!qe(e)&&!ye(e))throw new Error("args is not an effective array or string");ye(e)&&(e=[e]);let o=yt(r,"mode");"spawn"!==o&&"exec"!==o&&"execFile"!==o&&(o="spawn");let i=yt(r,"cbStdout"),u=yt(r,"cbStderr"),c=yt(r,"codeCmd");ye(c)||(c="utf8");let a=yt(r,"useChcp");Ve(a)||(a=!1);let s=function(){let t,e,r=new Promise((function(){t=arguments[0],e=arguments[1]}));return r.resolve=t,r.reject=e,r}(),f="",l="",p=null;if("spawn"===o){let r=(y=1,ye(h=t)&&We(y)?0===(y=Oe(y))?"":h.substring(0,y):""),o=function(t,e){if(!ye(t))return"";if(!We(e))return"";if(0===(e=Oe(e)))return"";let r=t.length-e;return r<0&&(r=0),t.substring(r,r+e)}(t,1);if('"'===r||'"'===o||"'"===r||"'"===o)throw new Error("prog of spawn doens not need to add quotes");p=n.spawn(t,e,{encoding:c,shell:!1})}else if("exec"===o){let r="";a&&(r="cmd /c chcp 65001>nul &&"),p=n.exec(`${r} ${t} ${e.join(" ")} & exit`,{encoding:c})}else{if("execFile"!==o)throw new Error(`invalid mode[${o}]`);p=n.execFile(t,e,{encoding:c})}var h,y;return p.stdout.on("data",(t=>{let e=t.toString().trim();f+=e+"\n",Je(i)&&i(e)})),p.stderr.on("data",(t=>{let e=t.toString().trim();l+=e+"\n",Je(u)&&u(e)})),p.on("close",(t=>{ye(l)?s.reject(l):s.resolve(f)})),p.on("error",(t=>{s.reject(t)})),s}let Xe=t.resolve();return async function(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null;if("win32"!==r.platform)return Promise.reject("operating system is not windows");if(!qe(t))return Promise.reject("psSrc is not an array");if(!De(n)&&!qe(n))return Promise.reject("psTar is not an object or array");let u=De(n);u&&(n=[n]);let c=yt(o,"keyX");ye(c)||(c="x");let a=yt(o,"keyY");ye(a)||(a="y");let s=yt(o,"keyZ");ye(s)||(s="z");let f=yt(o,"keyV");ye(f)||(f="v");let l=t=>{let e=yt(t,c,""),r=yt(t,0,""),n=yt(t,a,""),o=yt(t,1,""),i=yt(t,s,""),u=yt(t,2,""),l=yt(t,f,""),p=yt(t,3,""),h=ve(e),y=ve(n),d=ve(i),v=ve(l);return e=h?ge(e):ve(r)?ge(r):null,n=y?ge(n):ve(o)?ge(o):null,i=d?ge(i):ve(u)?ge(u):null,l=v?ge(l):ve(p)?ge(p):null,{x:e,y:n,z:i,v:l}},p="2d";{let e=yt(t,0,{}),r=l(e);null!==r.x&&null!==r.y&&null!==r.z&&null!==r.v&&(p="3d")}let h=[];Qt(t,(t=>{let e=l(t);"2d"===p?h.push([e.x,e.y,e.z]):h.push([e.x,e.y,e.z,e.v])}));let y=[];Qt(n,(t=>{let e=l(t);"2d"===p?y.push([e.x,e.y]):y.push([e.x,e.y,e.z])}));let d=yt(o,"variogram_model","");ye(d)||(d="exponential");let v=yt(o,"nlags","");ve(v)||(v=9),v=Oe(v);let g="kriging.exe",b="";{let t=`${Xe}/src/`,e=`${Xe}/node_modules/w-kriging/src/`;if(He(`${t}${g}`))b=t;else{if(!He(`${e}${g}`))return Promise.reject("can not find folder for kriging");b=e}}let _=`${b}${g}`,m=Ae(),w=`${b}_${m}_fpIn.json`,O=`${b}_${m}_fpOut.json`,x={src:h,pred:y};e.writeFileSync(w,JSON.stringify(x),"utf8");let S={fpIn:w,fpOut:O,opt:{variogram_model:d,nlags:v}},A=function(t){if(!ye(t))return"";let e=Ee.parse(t);return Me.stringify(e)}(JSON.stringify(S));await Ge(_,A).catch((t=>{console.log("execProcess catch",t),i=t.toString()}));let $=null;try{let t=e.readFileSync(O,"utf8");$=function(t){if(!ye(t))return{};let e={};try{e=JSON.parse(t)}catch(t){e={}}return e}(t)}catch(t){}try{e.unlinkSync(w)}catch(t){}try{e.unlinkSync(O)}catch(t){}if(i)return Promise.reject(i);if(!Ne($))return Promise.reject(`output[${function(t){if(!ye(t)&&!ve(t)&&!j(t))return"";let e="";try{e=String(t)}catch(t){}try{e=t.toString()}catch(t){}return e}($)}] is not an array`);let B=[];return Qt(y,((t,e)=>{let r=yt($,e,null);"2d"===p?B.push({[c]:t[0],[a]:t[1],[s]:r}):B.push({[c]:t[0],[a]:t[1],[s]:t[2],[f]:r})})),u&&(B=B[0]),B}})); //# sourceMappingURL=w-kriging.umd.js.map