json-rules-engine-simplified 0.1.16 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,17 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONSchemaForm=t():e.JSONSchemaForm=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=3)}([function(e,t,r){"use strict";function n(e){return e.replace(/\$/g,".")}function o(e,t){var r=n(e);return(0,y.default)(r,t)}function i(e){return"object"===(void 0===e?"undefined":p(e))&&null!==e}function u(){return!1}function c(e){return Array.isArray(e)?e:[e]}function a(e){if(u())throw new ReferenceError(e);console.error(e)}function s(e,t){return t.properties[e]&&"array"===t.properties[e].type&&t.properties[e].items&&t.properties[e].items.$ref}function f(e,t){return e.startsWith("#/")?e.substr(2).split("/").reduce(function(e,t){return e[t]},t):void a("Only local references supported at this point use json-schema-deref")}function l(e,t){var r=t.properties;return r&&r[e]?"array"===r[e].type?s(e,t)?f(r[e].items.$ref,t):r[e].items:r[e]&&r[e].$ref?f(r[e].$ref,t):r[e]&&"object"===r[e].type?r[e]:void a(e+" has no $ref field ref schema extraction is impossible"):void a(e+" not defined in properties")}Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.normRef=n,t.selectRef=o,t.isObject=i,t.isDevelopment=u,t.toArray=c,t.toError=a,t.isRefArray=s,t.extractRefSchema=l;var d=r(6),y=function(e){return e&&e.__esModule?e:{default:e}}(d),m=function(e,t){return e.concat(t)};t.flatMap=function(e,t){return e.map(t).reduce(m,[])}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.OR="or",t.AND="and",t.NOT="not"},function(e,t,r){"use strict";var n,o,i,u,u,c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/**
2
- * @license predicate.js
3
- * (c) 2014-2016 Trevor Landau <landautrevor@gmail.com> @trevor_landau
4
- * predicate.js may be freely distributed under the MIT license.
5
- */
6
- !function(r){if("object"===c(t)&&void 0!==e)e.exports=r();else{o=[],n=r,void 0!==(i="function"==typeof n?n.apply(t,o):n)&&(e.exports=i)}}(function(){return function e(t,r,n){function o(c,a){if(!r[c]){if(!t[c]){var s="function"==typeof u&&u;if(!a&&s)return u(c,!0);if(i)return i(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var l=r[c]={exports:{}};t[c][0].call(l.exports,function(e){var r=t[c][1][e];return o(r||e)},l,l.exports,e,t,r,n)}return r[c].exports}for(var i="function"==typeof u&&u,c=0;c<n.length;c++)o(n[c]);return o}({1:[function(e,t,r){var n=e("./lib/utils"),o={};o.VERSION="1.0.0",[n,e("./lib/predicates"),e("./lib/chain"),e("./lib/other")].reduce(n.assign,o),t.exports=o},{"./lib/chain":2,"./lib/other":3,"./lib/predicates":4,"./lib/utils":5}],2:[function(e,t,r){function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":c(t))&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":c(t)));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e("./predicates"),s=t.exports,f=function(){function e(){i(this,e),this.lazy=[]}return u(e,[{key:"valueOf",value:function(){return this.val()}},{key:"val",value:function(){return this.lazy[this.method](function(e){return e[0].apply(null,e[1])})}}]),e}(),l=function(e){function t(){i(this,t);var e=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.method="every",e}return o(t,e),t}(f),p=function(e){function t(){i(this,t);var e=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.method="some",e}return o(t,e),t}(f);[l,p].forEach(function(e){Object.keys(a).reduce(function(e,t){return a.fn(a[t])?(e[t]=function(){return this.lazy.push([a[t],arguments]),this},e):e},e.prototype)}),s.all=s.every=function(){return new l},s.any=s.some=function(){return new p}},{"./predicates":4}],3:[function(e,t,r){var n=e("./predicates"),o=e("./utils"),i=t.exports;i.ternary=function(e,t,r){return n.bool(e)?e?t:r:n.undef(t)?o.partial(i.ternary,e):n.undef(r)?o.partial(i.ternary,e,t):i.ternary(e(t,r),t,r)};var u=Array.prototype.every,c=Array.prototype.some;i.and=function(){var e=arguments;return function(t){return u.call(e,function(e){return e(t)})}},i.or=function(){var e=arguments;return function(t){return c.call(e,function(e){return e(t)})}}},{"./predicates":4,"./utils":5}],4:[function(e,t,r){var n="function"==typeof Symbol&&"symbol"===c(Symbol.iterator)?function(e){return void 0===e?"undefined":c(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":c(e)},o=e("./utils"),i=t.exports,u=o.curry;Object.is?i.is=u(Object.is):i.is=u(function(e,t){return 0===e&&0===t?1/e==1/t:e!==e?t!==t:e===t}),i.exists=function(e){return null!=e},i.truthy=function(e){return!(!e||!i.exists(e))},i.falsey=o.complement(i.truthy),i.equal=u(function(e,t){return e===t}),i.eq=u(function(e,t){return e==t}),i.null=i.equal(null),i.undef=i.equal(void 0),i.lt=i.less=u(function(e,t){return e<t}),i.ltEq=i.le=i.lessEq=u(function(e,t){return i.equal(e,t)||i.less(e,t)}),i.gt=i.greater=u(function(e,t){return e>t}),i.gtEq=i.ge=i.greaterEq=u(function(e,t){return i.equal(e,t)||i.greater(e,t)});var a=Object.prototype.toString,s=u(function(e,t){return i.equal(e,a.call(t))});i.object=i.obj=function(e){return e===Object(e)},i.array=i.arr=Array.isArray||s("[object Array]"),i.date=s("[object Date]"),i.regex=i.regexp=i.rgx=i.RegExp=s("[object RegExp]"),i.finite=Number.isFinite||function(e){return i.number(e)&&isFinite(e)},i.nan=i.NaN=i.is(NaN),i.instance=u(function(e,t){return t instanceof e}),i.arguments=s("[object Arguments]"),i.error=i.instance(Error);var f=u(function(e,t){return i.equal(e,void 0===t?"undefined":n(t))});[["function","fn"],["string","str"],["boolean","bool"]].reduce(function(e,t){return e[t[0]]=e[t[1]]=f(t[0]),e},i),i.number=i.num=function(e){return"number"==typeof e&&i.not.NaN(e)},i.int=function(e){return i.num(e)&&i.zero(o.mod(e,1))},i.pos=function(e){return i.num(e)&&i.greater(e,0)},i.neg=function(e){return i.num(e)&&i.less(e,0)},i.zero=function(e){return i.num(e)&&i.equal(e,0)},i.even=function(e){return i.num(e)&&i.not.zero(e)&&i.zero(o.mod(e,2))},i.odd=function(e){return i.num(e)&&i.not.zero(e)&&i.not.zero(o.mod(e,2))},i.contains=i.includes=u(function(e,t){if(!i.array(e)&&!i.string(e))throw new TypeError("Expected an array or string");return!(i.string(e)&&!i.string(t))&&(i.NaN(t)?e.some(i.NaN):!!~e.indexOf(t))});var l=Object.prototype.hasOwnProperty;i.has=u(function(e,t){return l.call(e,t)}),i.empty=function(e){if(i.not.exists(e))return!0;if(i.arr(e)||i.str(e))return!e.length;if(i.obj(e)){for(var t in e)if(i.has(e,t))return!1;return!0}throw new TypeError},i.primitive=function(e){return i.string(e)||i.num(e)||i.bool(e)||i.null(e)||i.undef(e)||i.NaN(e)},i.matches=u(function(e,t){return e.test(t)}),i.not=Object.keys(i).reduce(function(e,t){return e[t]=o.complement(i[t]),e},{})},{"./utils":5}],5:[function(e,t,r){var n=t.exports,o=Array.prototype.slice,i=function(e,t){return e.toString=function(){return t.toString()},e.src=t,e},u=n.curry=function(e){return i(function(t,r){switch(arguments.length){case 0:throw new TypeError("Function called with no arguments");case 1:return i(function(r){return e(t,r)},e)}return e(t,r)},e)};n.partial=function(e){var t=o.call(arguments,1);return function(){return e.apply(null,t.concat(o.call(arguments)))}},n.complement=n.invert=function(e){return function(){var t=e.apply(null,arguments);return"function"==typeof t?n.complement(t):!t}},n.mod=u(function(e,t){return e%t}),n.assign=u(Object.assign||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e})},{}]},{},[1])(1)})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=o.default},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),i=r(15),u=function(e){return e&&e.__esModule?e:{default:e}}(i),c=r(0),a=function(e){var t=void 0!==e&&null!==e;return(0,c.isDevelopment)()&&t?((0,c.isObject)(e)||(0,c.toError)("Expected valid schema object, but got - "+e),function(t){(0,o.validatePredicates)([t.conditions],e),(0,o.validateConditionFields)([t.conditions],e)}):function(){}},s=function e(t,r){var o=this;n(this,e),this.addRule=function(e){o.validate(e),o.rules.push(e)},this.run=function(e){return Promise.resolve((0,u.default)(o.rules,e))},this.rules=[],this.validate=a(r),t&&(0,c.toArray)(t).forEach(function(e){return o.addRule(e)})};t.default=s},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return(0,h.isObject)(e)?(0,h.flatMap)(Object.keys(e),function(r){var n=e[r];if((0,h.isObject)(n)||r===v.NOT){if(r===v.OR||r===v.AND)return Array.isArray(n)?(0,h.flatMap)(n,function(e){return o(e,t)}):((0,h.toError)('"'+r+'" must be an array'),[]);var i=o(n,t);return i.push(r),i}return o(r,t)}):[e]}function i(e,t){return(0,h.flatMap)(Object.keys(e),function(r){var u=e[r];if((r=(0,h.normRef)(r))===v.OR||r===v.AND)return Array.isArray(u)?(0,h.flatMap)(u,function(e){return i(e,t)}):((0,h.toError)(r+" with "+JSON.stringify(u)+" must be an Array"),[]);if(r===v.NOT)return i(u,t);if(-1!==r.indexOf(".")){var c=r.indexOf("."),a=r.substr(0,c),s=(0,h.extractRefSchema)(a,t);if(s){return i(n({},r.substr(c+1),u),s)}return(0,h.toError)("Can't find schema for "+a),[]}if((0,h.isRefArray)(r,t)){var f=(0,h.extractRefSchema)(r,t);return f?i(u,f):[]}return t.properties[r]?o(u,t):((0,h.toError)("Can't validate "+r),[])})}function u(e,t){var r=(0,h.flatMap)(e,function(e){return i(e,t)});return r.filter(function(e,t,n){return r.indexOf(e)===t})}function c(e,t){return u(e,t).filter(function(e){return b.includes(e)||void 0===m.default[e]})}function a(e,t){var r=c(e,t);0!==r.length&&(0,h.toError)("Rule contains invalid predicates "+r)}function s(e){return Array.isArray(e)?(0,h.flatMap)(e,s):(0,h.isObject)(e)?(0,h.flatMap)(Object.keys(e),function(t){return s(e[t])}):"string"==typeof e&&e.startsWith("$")?[e.substr(1)]:[]}function f(e){return(0,h.flatMap)(Object.keys(e),function(t){var r=e[t];return t===v.OR||t===v.AND?(0,h.flatMap)(r,f):t===v.NOT?f(r):[(0,h.normRef)(t)].concat(s(r))})}function l(e){var t=(0,h.flatMap)(e,f);return t.filter(function(e){return-1===e.indexOf(".")}).filter(function(e,r,n){return t.indexOf(e)===r})}function p(e,t){return l(e).filter(function(e){return void 0===t.properties[e]})}function d(e,t){var r=p(e,t);0!==r.length&&(0,h.toError)("Rule contains invalid fields "+r)}Object.defineProperty(t,"__esModule",{value:!0}),t.predicatesFromRule=o,t.predicatesFromCondition=i,t.listAllPredicates=u,t.listInvalidPredicates=c,t.validatePredicates=a,t.fieldsFromPredicates=s,t.fieldsFromCondition=f,t.listAllFields=l,t.listInvalidFields=p,t.validateConditionFields=d;var y=r(2),m=function(e){return e&&e.__esModule?e:{default:e}}(y),h=r(0),v=r(1),b=["and","or","ternary","every","some","curry","partial","complement","mod"]},function(e,t,r){"use strict";function n(e,t){i("arguments:",{path:e,object:t});for(var r=-1,n="[object Array]"===a.call(e)?e:c(u(e)),o=n.length,s=o?t:void 0;++r<o;){if(Object(s)!==s)return;s=s[n[r]]}return i("ref:",s),"function"==typeof s?s():s}var o=r(7),i=r(9)("selectn"),u=r(13),c=r(14),a=Object.prototype.toString;e.exports=o(n)},function(e,t,r){"use strict";function n(e,t){var r=function r(){return 0===arguments.length?r:arguments.length>1?e.apply(t,arguments):o.call(e,t,arguments[0])};return r.uncurry=function(){return e},r}/*!
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONSchemaForm=t():e.JSONSchemaForm=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=5)}([function(e,t,r){"use strict";function n(e){return e.replace(/\$/g,".")}function o(e,t){var r=n(e);return(0,y.default)(r,t)}function u(e){return"object"===(void 0===e?"undefined":p(e))&&null!==e}function i(){return!1}function c(e){return Array.isArray(e)?e:[e]}function a(e){if(i())throw new ReferenceError(e);console.error(e)}function s(e,t){return t.properties[e]&&"array"===t.properties[e].type&&t.properties[e].items&&t.properties[e].items.$ref}function f(e,t){return e.startsWith("#/")?e.substr(2).split("/").reduce(function(e,t){return e[t]},t):void a("Only local references supported at this point use json-schema-deref")}function l(e,t){var r=t.properties;return r&&r[e]?"array"===r[e].type?s(e,t)?f(r[e].items.$ref,t):r[e].items:r[e]&&r[e].$ref?f(r[e].$ref,t):r[e]&&"object"===r[e].type?r[e]:void a(e+" has no $ref field ref schema extraction is impossible"):void a(e+" not defined in properties")}Object.defineProperty(t,"__esModule",{value:!0}),t.flatMap=void 0;var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.normRef=n,t.selectRef=o,t.isObject=u,t.isDevelopment=i,t.toArray=c,t.toError=a,t.isRefArray=s,t.extractRefSchema=l;var d=r(10),y=function(e){return e&&e.__esModule?e:{default:e}}(d),m=function(e,t){return e.concat(t)};t.flatMap=function(e,t){return e.map(t).reduce(m,[])}},function(e,t,r){"use strict";var n=e.exports,o=Array.prototype.slice,u=function(e,t){return e.toString=function(){return t.toString()},e.src=t,e},i=n.curry=function(e){return u(function(t,r){switch(arguments.length){case 0:throw new TypeError("Function called with no arguments");case 1:return u(function(r){return e(t,r)},e)}return e(t,r)},e)};n.partial=function(e){var t=o.call(arguments,1);return function(){return e.apply(null,t.concat(o.call(arguments)))}},n.complement=n.invert=function(e){return function(){var t=e.apply(null,arguments);return"function"==typeof t?n.complement(t):!t}},n.mod=i(function(e,t){return e%t}),n.assign=i(Object.assign||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e})},function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=r(1),u=e.exports,i=o.curry;Object.is?u.is=i(Object.is):u.is=i(function(e,t){return 0===e&&0===t?1/e==1/t:e!==e?t!==t:e===t}),u.exists=function(e){return null!=e},u.truthy=function(e){return!(!e||!u.exists(e))},u.falsey=o.complement(u.truthy),u.equal=i(function(e,t){return e===t}),u.eq=i(function(e,t){return e==t}),u.null=u.equal(null),u.undef=u.equal(void 0),u.lt=u.less=i(function(e,t){return e<t}),u.ltEq=u.le=u.lessEq=i(function(e,t){return u.equal(e,t)||u.less(e,t)}),u.gt=u.greater=i(function(e,t){return e>t}),u.gtEq=u.ge=u.greaterEq=i(function(e,t){return u.equal(e,t)||u.greater(e,t)});var c=Object.prototype.toString,a=i(function(e,t){return u.equal(e,c.call(t))});u.object=u.obj=function(e){return e===Object(e)},u.array=u.arr=Array.isArray||a("[object Array]"),u.date=a("[object Date]"),u.regex=u.regexp=u.rgx=u.RegExp=a("[object RegExp]"),u.finite=Number.isFinite||function(e){return u.number(e)&&isFinite(e)},u.nan=u.NaN=u.is(NaN),u.instance=i(function(e,t){return t instanceof e}),u.arguments=a("[object Arguments]"),u.error=u.instance(Error);var s=i(function(e,t){return u.equal(e,void 0===t?"undefined":n(t))});[["function","fn"],["string","str"],["boolean","bool"]].reduce(function(e,t){return e[t[0]]=e[t[1]]=s(t[0]),e},u),u.number=u.num=function(e){return"number"==typeof e&&u.not.NaN(e)},u.int=function(e){return u.num(e)&&u.zero(o.mod(e,1))},u.pos=function(e){return u.num(e)&&u.greater(e,0)},u.neg=function(e){return u.num(e)&&u.less(e,0)},u.zero=function(e){return u.num(e)&&u.equal(e,0)},u.even=function(e){return u.num(e)&&u.not.zero(e)&&u.zero(o.mod(e,2))},u.odd=function(e){return u.num(e)&&u.not.zero(e)&&u.not.zero(o.mod(e,2))},u.contains=u.includes=i(function(e,t){if(!u.array(e)&&!u.string(e))throw new TypeError("Expected an array or string");return!(u.string(e)&&!u.string(t))&&(u.NaN(t)?e.some(u.NaN):!!~e.indexOf(t))});var f=Object.prototype.hasOwnProperty;u.has=i(function(e,t){return f.call(e,t)}),u.empty=function(e){if(u.not.exists(e))return!0;if(u.arr(e)||u.str(e))return!e.length;if(u.obj(e)){for(var t in e)if(u.has(e,t))return!1;return!0}throw new TypeError},u.primitive=function(e){return u.string(e)||u.num(e)||u.bool(e)||u.null(e)||u.undef(e)||u.NaN(e)},u.matches=i(function(e,t){return e.test(t)}),u.not=Object.keys(u).reduce(function(e,t){return e[t]=o.complement(u[t]),e},{})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.OR="or",t.AND="and",t.NOT="not"},function(e,t,r){"use strict";var n=r(1),o={};o.VERSION="1.0.0",[n,r(2),r(8),r(9)].reduce(n.assign,o),e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),o=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=o.default},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=r(7),u=r(19),i=function(e){return e&&e.__esModule?e:{default:e}}(u),c=r(0),a=function(e){var t=void 0!==e&&null!==e;return(0,c.isDevelopment)()&&t?((0,c.isObject)(e)||(0,c.toError)("Expected valid schema object, but got - "+e),function(t){(0,o.validatePredicates)([t.conditions],e),(0,o.validateConditionFields)([t.conditions],e)}):function(){}},s=function e(t,r){var o=this;n(this,e),this.addRule=function(e){o.validate(e),o.rules.push(e)},this.run=function(e){return Promise.resolve((0,i.default)(o.rules,e))},this.rules=[],this.validate=a(r),t&&(0,c.toArray)(t).forEach(function(e){return o.addRule(e)})};t.default=s},function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return(0,h.isObject)(e)?(0,h.flatMap)(Object.keys(e),function(r){var n=e[r];if((0,h.isObject)(n)||r===v.NOT){if(r===v.OR||r===v.AND)return Array.isArray(n)?(0,h.flatMap)(n,function(e){return o(e,t)}):((0,h.toError)('"'+r+'" must be an array'),[]);var u=o(n,t);return u.push(r),u}return o(r,t)}):[e]}function u(e,t){return(0,h.flatMap)(Object.keys(e),function(r){var i=e[r];if((r=(0,h.normRef)(r))===v.OR||r===v.AND)return Array.isArray(i)?(0,h.flatMap)(i,function(e){return u(e,t)}):((0,h.toError)(r+" with "+JSON.stringify(i)+" must be an Array"),[]);if(r===v.NOT)return u(i,t);if(-1!==r.indexOf(".")){var c=r.indexOf("."),a=r.substr(0,c),s=(0,h.extractRefSchema)(a,t);if(s){return u(n({},r.substr(c+1),i),s)}return(0,h.toError)("Can't find schema for "+a),[]}if((0,h.isRefArray)(r,t)){var f=(0,h.extractRefSchema)(r,t);return f?u(i,f):[]}return t.properties[r]?o(i,t):((0,h.toError)("Can't validate "+r),[])})}function i(e,t){var r=(0,h.flatMap)(e,function(e){return u(e,t)});return r.filter(function(e,t,n){return r.indexOf(e)===t})}function c(e,t){return i(e,t).filter(function(e){return b.includes(e)||void 0===m.default[e]})}function a(e,t){var r=c(e,t);0!==r.length&&(0,h.toError)("Rule contains invalid predicates "+r)}function s(e){return Array.isArray(e)?(0,h.flatMap)(e,s):(0,h.isObject)(e)?(0,h.flatMap)(Object.keys(e),function(t){return s(e[t])}):"string"==typeof e&&e.startsWith("$")?[e.substr(1)]:[]}function f(e){return(0,h.flatMap)(Object.keys(e),function(t){var r=e[t];return t===v.OR||t===v.AND?(0,h.flatMap)(r,f):t===v.NOT?f(r):[(0,h.normRef)(t)].concat(s(r))})}function l(e){var t=(0,h.flatMap)(e,f);return t.filter(function(e){return-1===e.indexOf(".")}).filter(function(e,r,n){return t.indexOf(e)===r})}function p(e,t){return l(e).filter(function(e){return void 0===t.properties[e]})}function d(e,t){var r=p(e,t);0!==r.length&&(0,h.toError)("Rule contains invalid fields "+r)}Object.defineProperty(t,"__esModule",{value:!0}),t.predicatesFromRule=o,t.predicatesFromCondition=u,t.listAllPredicates=i,t.listInvalidPredicates=c,t.validatePredicates=a,t.fieldsFromPredicates=s,t.fieldsFromCondition=f,t.listAllFields=l,t.listInvalidFields=p,t.validateConditionFields=d;var y=r(4),m=function(e){return e&&e.__esModule?e:{default:e}}(y),h=r(0),v=r(3),b=["and","or","ternary","every","some","curry","partial","complement","mod"]},function(e,t,r){"use strict";function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(2),a=e.exports,s=function(){function e(){u(this,e),this.lazy=[]}return i(e,[{key:"valueOf",value:function(){return this.val()}},{key:"val",value:function(){return this.lazy[this.method](function(e){return e[0].apply(null,e[1])})}}]),e}(),f=function(e){function t(){u(this,t);var e=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.method="every",e}return o(t,e),t}(s),l=function(e){function t(){u(this,t);var e=n(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.method="some",e}return o(t,e),t}(s);[f,l].forEach(function(e){Object.keys(c).reduce(function(e,t){return c.fn(c[t])?(e[t]=function(){return this.lazy.push([c[t],arguments]),this},e):e},e.prototype)}),a.all=a.every=function(){return new f},a.any=a.some=function(){return new l}},function(e,t,r){"use strict";var n=r(2),o=r(1),u=e.exports;u.ternary=function(e,t,r){return n.bool(e)?e?t:r:n.undef(t)?o.partial(u.ternary,e):n.undef(r)?o.partial(u.ternary,e,t):u.ternary(e(t,r),t,r)};var i=Array.prototype.every,c=Array.prototype.some;u.and=function(){var e=arguments;return function(t){return i.call(e,function(e){return e(t)})}},u.or=function(){var e=arguments;return function(t){return c.call(e,function(e){return e(t)})}}},function(e,t,r){"use strict";function n(e,t){u("arguments:",{path:e,object:t});for(var r=-1,n="[object Array]"===a.call(e)?e:c(i(e)),o=n.length,s=o?t:void 0;++r<o;){if(Object(s)!==s)return;s=s[n[r]]}return u("ref:",s),"function"==typeof s?s():s}var o=r(11),u=r(13)("selectn"),i=r(17),c=r(18),a=Object.prototype.toString;e.exports=o(n)},function(e,t,r){"use strict";function n(e,t){var r=function r(){return 0===arguments.length?r:arguments.length>1?e.apply(t,arguments):o.call(e,t,arguments[0])};return r.uncurry=function(){return e},r}/*!
7
2
  * imports.
8
3
  */
9
- var o=Function.prototype.bind||r(8);/*!
4
+ var o=Function.prototype.bind||r(12);/*!
10
5
  * exports.
11
6
  */
12
- e.exports=n},function(e,t,r){"use strict";e.exports=function(e){var t,r=this;if(arguments.length<2)t=function(){if(this instanceof t){var n=r.apply(this,arguments);return Object(n)===n?n:this}return r.apply(e,arguments)};else{for(var n=new Array(arguments.length-1),o=1;o<arguments.length;o++)n[o-1]=arguments[o];t=function(){var o,i=n.length,u=new Array(i+arguments.length);for(o=0;o<i;o++)u[o]=n[o];for(o=0;o<arguments.length;o++)u[i+o]=arguments[o];if(this instanceof t){var c=r.apply(this,u);return Object(c)===c?c:this}return r.apply(e,u)}}return t.prototype=r.prototype,t}},function(e,t,r){"use strict";(function(n){function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))}),e.splice(i,0,n)}}function u(){return"object"===("undefined"==typeof console?"undefined":s(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function c(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function a(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=Object({NODE_ENV:"production"}).DEBUG),e}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t=e.exports=r(11),t.log=u,t.formatArgs=i,t.save=c,t.load=a,t.useColors=o,t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(a())}).call(t,r(10))},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function u(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function c(){h&&y&&(h=!1,y.length?m=y.concat(m):v=-1,m.length&&a())}function a(){if(!h){var e=i(c);h=!0;for(var t=m.length;t;){for(y=m,m=[];++v<t;)y&&y[v].run();v=-1,t=m.length}y=null,h=!1,u(e)}}function s(e,t){this.fun=e,this.array=t}function f(){}var l,p,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var y,m=[],h=!1,v=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];m.push(new s(e,t)),1!==m.length||h||i(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.prependListener=f,d.prependOnceListener=f,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,r){"use strict";function n(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}function o(e){function r(){if(r.enabled){var e=r,n=+new Date,o=n-(s||n);e.diff=o,e.prev=s,e.curr=n,s=n;for(var i=new Array(arguments.length),u=0;u<i.length;u++)i[u]=arguments[u];i[0]=t.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var c=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;c++;var o=t.formatters[n];if("function"==typeof o){var u=i[c];r=o.call(e,u),i.splice(c,1),c--}return r}),t.formatArgs.call(e,i);(r.log||t.log||console.log.bind(console)).apply(e,i)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=n(e),"function"==typeof t.init&&t.init(r),r}function i(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length,o=0;o<n;o++)r[o]&&(e=r[o].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function u(){t.enable("")}function c(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1}function a(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=o.debug=o.default=o,t.coerce=a,t.disable=u,t.enable=i,t.enabled=c,t.humanize=r(12),t.names=[],t.skips=[],t.formatters={};var s},function(e,t,r){"use strict";function n(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*p;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*f;case"minutes":case"minute":case"mins":case"min":case"m":return r*s;case"seconds":case"second":case"secs":case"sec":case"s":return r*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=f?Math.round(e/f)+"h":e>=s?Math.round(e/s)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function i(e){return u(e,l,"day")||u(e,f,"hour")||u(e,s,"minute")||u(e,a,"second")||e+" ms"}function u(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=1e3,s=60*a,f=60*s,l=24*f,p=365.25*l;e.exports=function(e,t){t=t||{};var r=void 0===e?"undefined":c(e);if("string"===r&&e.length>0)return n(e);if("number"===r&&!1===isNaN(e))return t.long?i(e):o(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";function n(e){return"[object String]"=={}.toString.call(e)?e.replace(o,".$1").replace(i,""):""}/*!
7
+ e.exports=n},function(e,t,r){"use strict";e.exports=function(e){var t,r=this;if(arguments.length<2)t=function(){if(this instanceof t){var n=r.apply(this,arguments);return Object(n)===n?n:this}return r.apply(e,arguments)};else{for(var n=new Array(arguments.length-1),o=1;o<arguments.length;o++)n[o-1]=arguments[o];t=function(){var o,u=n.length,i=new Array(u+arguments.length);for(o=0;o<u;o++)i[o]=n[o];for(o=0;o<arguments.length;o++)i[u+o]=arguments[o];if(this instanceof t){var c=r.apply(this,i);return Object(c)===c?c:this}return r.apply(e,i)}}return t.prototype=r.prototype,t}},function(e,t,r){"use strict";(function(n){function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function u(e){var r=this.useColors;if(e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff),r){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var o=0,u=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(u=o))}),e.splice(u,0,n)}}function i(){return"object"===("undefined"==typeof console?"undefined":s(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function c(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}}function a(){var e;try{e=t.storage.debug}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=Object({NODE_ENV:"production"}).DEBUG),e}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t=e.exports=r(15),t.log=i,t.formatArgs=u,t.save=c,t.load=a,t.useColors=o,t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(a())}).call(t,r(14))},function(e,t,r){"use strict";function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function u(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function c(){h&&y&&(h=!1,y.length?m=y.concat(m):v=-1,m.length&&a())}function a(){if(!h){var e=u(c);h=!0;for(var t=m.length;t;){for(y=m,m=[];++v<t;)y&&y[v].run();v=-1,t=m.length}y=null,h=!1,i(e)}}function s(e,t){this.fun=e,this.array=t}function f(){}var l,p,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var y,m=[],h=!1,v=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];m.push(new s(e,t)),1!==m.length||h||u(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=f,d.addListener=f,d.once=f,d.off=f,d.removeListener=f,d.removeAllListeners=f,d.emit=f,d.prependListener=f,d.prependOnceListener=f,d.listeners=function(e){return[]},d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,r){"use strict";function n(e){var r,n=0;for(r in e)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]}function o(e){function r(){if(r.enabled){var e=r,n=+new Date,o=n-(s||n);e.diff=o,e.prev=s,e.curr=n,s=n;for(var u=new Array(arguments.length),i=0;i<u.length;i++)u[i]=arguments[i];u[0]=t.coerce(u[0]),"string"!=typeof u[0]&&u.unshift("%O");var c=0;u[0]=u[0].replace(/%([a-zA-Z%])/g,function(r,n){if("%%"===r)return r;c++;var o=t.formatters[n];if("function"==typeof o){var i=u[c];r=o.call(e,i),u.splice(c,1),c--}return r}),t.formatArgs.call(e,u);(r.log||t.log||console.log.bind(console)).apply(e,u)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=n(e),"function"==typeof t.init&&t.init(r),r}function u(e){t.save(e),t.names=[],t.skips=[];for(var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length,o=0;o<n;o++)r[o]&&(e=r[o].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function i(){t.enable("")}function c(e){var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1}function a(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=o.debug=o.default=o,t.coerce=a,t.disable=i,t.enable=u,t.enabled=c,t.humanize=r(16),t.names=[],t.skips=[],t.formatters={};var s},function(e,t,r){"use strict";function n(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*p;case"days":case"day":case"d":return r*l;case"hours":case"hour":case"hrs":case"hr":case"h":return r*f;case"minutes":case"minute":case"mins":case"min":case"m":return r*s;case"seconds":case"second":case"secs":case"sec":case"s":return r*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=f?Math.round(e/f)+"h":e>=s?Math.round(e/s)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function u(e){return i(e,l,"day")||i(e,f,"hour")||i(e,s,"minute")||i(e,a,"second")||e+" ms"}function i(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=1e3,s=60*a,f=60*s,l=24*f,p=365.25*l;e.exports=function(e,t){t=t||{};var r=void 0===e?"undefined":c(e);if("string"===r&&e.length>0)return n(e);if("number"===r&&!1===isNaN(e))return t.long?u(e):o(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";function n(e){return"[object String]"=={}.toString.call(e)?e.replace(o,".$1").replace(u,""):""}/*!
13
8
  * exports.
14
9
  */
15
10
  e.exports=n;/*!
16
11
  * regexp patterns.
17
12
  */
18
- var o=/\[([^\[\]]+)\]/g,i=/^[.]*|[.]*$/g},function(e,t,r){"use strict";function n(e){for(var t=-1,r=i(o(e).split(".")),n=r.length,c=[];++t<n;)c.push(u(r[t]));return c}function o(e){return("[object String]"===c.call(e)?e:"").replace(/\\\./g,"￿")}function i(e){for(var t=-1,r=e.length,n=[];++t<r;)e[t]&&n.push(e[t]);return n}function u(e){return e.replace(/\uffff/g,".")}var c=Object.prototype.toString;/*!
13
+ var o=/\[([^\[\]]+)\]/g,u=/^[.]*|[.]*$/g},function(e,t,r){"use strict";function n(e){for(var t=-1,r=u(o(e).split(".")),n=r.length,c=[];++t<n;)c.push(i(r[t]));return c}function o(e){return("[object String]"===c.call(e)?e:"").replace(/\\\./g,"￿")}function u(e){for(var t=-1,r=e.length,n=[];++t<r;)e[t]&&n.push(e[t]);return n}function i(e){return e.replace(/\uffff/g,".")}var c=Object.prototype.toString;/*!
19
14
  * exports.
20
15
  */
21
- e.exports=n},function(e,t,r){"use strict";function n(e,t){return(0,o.flatMap)(e,function(e){var r=e.conditions,n=e.event;return(0,u.default)(r,t)?(0,o.toArray)(n):[]})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var o=r(0),i=r(16),u=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t,r){"use strict";function n(e,t){return Array.isArray(e)?e.map(function(e){return n(e,t)}):(0,i.isObject)(e)?Object.keys(e).reduce(function(r,o){return r[o]=n(e[o],t),r},{}):"string"==typeof e&&e.startsWith("$")?(0,i.selectRef)(e.substr(1),t):e}function o(e,t){return(0,i.isObject)(e)&&(0,i.isObject)(t)?Object.keys(e).every(function(r){var u=e[r];if(r===a.OR)return u.some(function(e){return o(e,t)});if(r===a.AND)return u.every(function(e){return o(e,t)});if(r===a.NOT)return!o(u,t);var s=(0,i.selectRef)(r,t);if(Array.isArray(s)){return s.some(function(e){return!!(0,i.isObject)(e)&&o(u,e)})||(0,c.default)(s,n(u,t))}return(0,c.default)(s,n(u,t))}):((0,i.toError)("Rule "+JSON.stringify(e)+" with "+t+" can't be processed"),!1)}Object.defineProperty(t,"__esModule",{value:!0}),t.toRelCondition=n,t.default=o;var i=r(0),u=r(17),c=function(e){return e&&e.__esModule?e:{default:e}}(u),a=r(1)},function(e,t,r){"use strict";function n(e,t){return a(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var o=r(2),i=function(e){return e&&e.__esModule?e:{default:e}}(o),u=r(0),c=r(1),a=function e(t,r){return(0,u.isObject)(r)?Object.keys(r).every(function(n){var o=r[n];return n===c.OR||n===c.AND?!!Array.isArray(o)&&(n===c.OR?o.some(function(r){return e(t,r)}):o.every(function(r){return e(t,r)})):n===c.NOT?!e(t,o):!!i.default[n]&&i.default[n](t,o)}):i.default[r](t)}}])});
16
+ e.exports=n},function(e,t,r){"use strict";function n(e,t){return(0,o.flatMap)(e,function(e){var r=e.conditions,n=e.event;return(0,i.default)(r,t)?(0,o.toArray)(n):[]})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var o=r(0),u=r(20),i=function(e){return e&&e.__esModule?e:{default:e}}(u)},function(e,t,r){"use strict";function n(e,t){return Array.isArray(e)?e.map(function(e){return n(e,t)}):(0,u.isObject)(e)?Object.keys(e).reduce(function(r,o){return r[o]=n(e[o],t),r},{}):"string"==typeof e&&e.startsWith("$")?(0,u.selectRef)(e.substr(1),t):e}function o(e,t){return(0,u.isObject)(e)&&(0,u.isObject)(t)?Object.keys(e).every(function(r){var i=e[r];if(r===a.OR)return i.some(function(e){return o(e,t)});if(r===a.AND)return i.every(function(e){return o(e,t)});if(r===a.NOT)return!o(i,t);var s=(0,u.selectRef)(r,t);if(Array.isArray(s)){return s.some(function(e){return!!(0,u.isObject)(e)&&o(i,e)})||(0,c.default)(s,n(i,t))}return(0,c.default)(s,n(i,t))}):((0,u.toError)("Rule "+JSON.stringify(e)+" with "+t+" can't be processed"),!1)}Object.defineProperty(t,"__esModule",{value:!0}),t.toRelCondition=n,t.default=o;var u=r(0),i=r(21),c=function(e){return e&&e.__esModule?e:{default:e}}(i),a=r(3)},function(e,t,r){"use strict";function n(e,t){return a(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var o=r(4),u=function(e){return e&&e.__esModule?e:{default:e}}(o),i=r(0),c=r(3),a=function e(t,r){return(0,i.isObject)(r)?Object.keys(r).every(function(n){var o=r[n];return n===c.OR||n===c.AND?!!Array.isArray(o)&&(n===c.OR?o.some(function(r){return e(t,r)}):o.every(function(r){return e(t,r)})):n===c.NOT?!e(t,o):!!u.default[n]&&u.default[n](t,o)}):u.default[r](t)}}])});
22
17
  //# sourceMappingURL=json-rules-engine-simplified.js.map