pict 1.0.379 → 1.0.381

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.
package/dist/pict.js CHANGED
@@ -771,7 +771,7 @@ generateUUIDv4(){let tmpBuffer=new Array(16);var tmpRandomBytes=this.randomByteG
771
771
  tmpRandomBytes[6]=tmpRandomBytes[6]&0x0f|0x40;tmpRandomBytes[8]=tmpRandomBytes[8]&0x3f|0x80;return this.bytesToUUID(tmpRandomBytes);}// Simple random UUID generation
772
772
  generateRandom(){let tmpUUID='';for(let i=0;i<this._UUIDLength;i++){tmpUUID+=this._UUIDRandomDictionary.charAt(Math.floor(Math.random()*(this._UUIDRandomDictionary.length-1)));}return tmpUUID;}// Adapted from node-uuid (https://github.com/kelektiv/node-uuid)
773
773
  getUUID(){if(this._UUIDModeRandom){return this.generateRandom();}else{return this.generateUUIDv4();}}}// This is for backwards compatibility
774
- function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports.new=autoConstruct;},{"../package.json":64,"./Fable-UUID-Random.js":65,"fable-serviceproviderbase":59}],67:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.75","description":"A service dependency injection, configuration and logging library.","main":"source/Fable.js","scripts":{"start":"node source/Fable.js","coverage":"npx quack coverage","test":"npx quack test","build":"npx quack build","prepublishOnly":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t fable-image:local","docker-dev-run":"docker run -it -d --name fable-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" fable-image:local","docker-dev-shell":"docker exec -it fable-dev /bin/bash","tests":"npx quack test -g"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"browser":{"./source/service/Fable-Service-EnvironmentData.js":"./source/service/Fable-Service-EnvironmentData-Web.js","./source/service/Fable-Service-FilePersistence.js":"./source/service/Fable-Service-FilePersistence-Web.js"},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable.git"},"keywords":["entity","behavior"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable/issues"},"homepage":"https://github.com/stevenvelozo/fable","devDependencies":{"pict-docuserve":"^1.3.2","quackage":"^1.2.3"},"dependencies":{"async.eachlimit":"^0.5.2","async.waterfall":"^0.5.2","big.js":"^7.0.1","cachetrax":"^1.0.6","cookie":"^1.1.1","data-arithmatic":"^1.0.7","dayjs":"^1.11.19","fable-log":"^3.0.18","fable-serviceproviderbase":"^3.0.19","fable-settings":"^3.0.16","fable-uuid":"^3.0.14","manyfest":"^1.0.49","simple-get":"^4.0.1"}};},{}],68:[function(require,module,exports){/**
774
+ function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports.new=autoConstruct;},{"../package.json":64,"./Fable-UUID-Random.js":65,"fable-serviceproviderbase":59}],67:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.76","description":"A service dependency injection, configuration and logging library.","main":"source/Fable.js","scripts":{"start":"node source/Fable.js","coverage":"npx quack coverage","test":"npx quack test","build":"npx quack build","prepublishOnly":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t fable-image:local","docker-dev-run":"docker run -it -d --name fable-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" fable-image:local","docker-dev-shell":"docker exec -it fable-dev /bin/bash","tests":"npx quack test -g"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"browser":{"./source/service/Fable-Service-EnvironmentData.js":"./source/service/Fable-Service-EnvironmentData-Web.js","./source/service/Fable-Service-FilePersistence.js":"./source/service/Fable-Service-FilePersistence-Web.js"},"repository":{"type":"git","url":"https://github.com/fable-retold/fable.git"},"keywords":["entity","behavior"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/fable-retold/fable/issues"},"homepage":"https://github.com/fable-retold/fable","devDependencies":{"pict-docuserve":"^1.4.19","quackage":"^1.3.0"},"dependencies":{"async.eachlimit":"^0.5.2","async.waterfall":"^0.5.2","big.js":"^7.0.1","cachetrax":"^1.0.6","cookie":"^1.1.1","data-arithmatic":"^1.0.7","dayjs":"^1.11.19","fable-log":"^3.0.18","fable-serviceproviderbase":"^3.0.19","fable-settings":"^3.0.16","fable-uuid":"^3.0.14","manyfest":"^1.0.49","simple-get":"^4.0.1"}};},{}],68:[function(require,module,exports){/**
775
775
  * Fable Application Services Support Library
776
776
  * @author <steven@velozo.com>
777
777
  */// Pre-init services
@@ -805,7 +805,7 @@ this.serviceTypes.push(pServiceType);}// Using the static member of the class is
805
805
  if(typeof pServiceClass=='function'&&pServiceClass.isFableService){// Add the class to the list of classes
806
806
  this.serviceClasses[pServiceType]=pServiceClass;}else{// Add the base class to the list of classes
807
807
  this.log.error(`Attempted to add service type [${pServiceType}] with an invalid class. Using base service class, which will not crash but won't provide meaningful services.`);this.serviceClasses[pServiceType]=libFableServiceBase;}return this.serviceClasses[pServiceType];}addServiceTypeIfNotExists(pServiceType,pServiceClass){if(!(pServiceType in this.servicesMap)){return this.addServiceType(pServiceType,pServiceClass);}else{return this.serviceClasses[pServiceType];}}// This is for the services that are meant to run mostly single-instance so need a default at initialization
808
- addAndInstantiateServiceType(pServiceType,pServiceClass){this.addServiceType(pServiceType,pServiceClass);return this.instantiateServiceProvider(pServiceType,{},`${pServiceType}-Default`);}addAndInstantiateServiceTypeIfNotExists(pServiceType,pServiceClass){this.addServiceTypeIfNotExists(pServiceType,pServiceClass);if(!(pServiceType in this.servicesMap)||!(pServiceType in this.fable)){return this.instantiateServiceProvider(pServiceType,{},`${pServiceType}-Default`);}else{return this[pServiceType];}}addAndInstantiateSingletonService(pServiceType,pOptions,pServiceClass){this.addServiceTypeIfNotExists(pServiceType,pServiceClass);if(!(pServiceType in this.servicesMap)||!(pServiceType in this.fable)){return this.instantiateServiceProvider(pServiceType,{},`${pServiceType}-Default`);}else{return this[pServiceType];}}// Some services expect to be overloaded / customized class.
808
+ addAndInstantiateServiceType(pServiceType,pServiceClass){this.addServiceType(pServiceType,pServiceClass);return this.instantiateServiceProvider(pServiceType,{},`${pServiceType}-Default`);}addAndInstantiateServiceTypeIfNotExists(pServiceType,pServiceClass){this.addServiceTypeIfNotExists(pServiceType,pServiceClass);if(!(pServiceType in this.servicesMap)||!(pServiceType in this.fable)){return this.instantiateServiceProvider(pServiceType,{},`${pServiceType}-Default`);}else{return this[pServiceType];}}addAndInstantiateSingletonService(pServiceType,pOptions,pServiceClass){this.addServiceTypeIfNotExists(pServiceType,pServiceClass);if(!(pServiceType in this.servicesMap)||!(pServiceType in this.fable)){return this.instantiateServiceProvider(pServiceType,pOptions,`${pServiceType}-Default`);}else{return this[pServiceType];}}// Some services expect to be overloaded / customized class.
809
809
  instantiateServiceProviderFromPrototype(pServiceType,pOptions,pCustomServiceHash,pServicePrototype){// Instantiate the service
810
810
  let tmpService=new pServicePrototype(this,pOptions,pCustomServiceHash);if(this.extraServiceInitialization){tmpService=this.extraServiceInitialization(tmpService);}// Add the service to the service map
811
811
  this.servicesMap[pServiceType][tmpService.Hash]=tmpService;// If this is the first service of this type, make it the default
@@ -1618,7 +1618,7 @@ tmpCurrentTokenType='Value';tmpCurrentToken+=tmpCharacter;// continue;
1618
1618
  // tmpResults.ExpressionParserLog.push(`ExpressionParser.tokenize found an unknown character code ${tmpCharCode} character ${tmpCharacter} in the expression: ${pExpression} at index ${i}`);
1619
1619
  // this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);
1620
1620
  }if(tmpCurrentTokenType&&tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}tmpResults.OriginalRawTokens=Array.from(tmpResults.RawTokens);// Potentially mutate the tokens based on directives in the tokenized expression
1621
- this.TokenizerDirectiveMutation.parseDirectives(tmpResults);return tmpResults.RawTokens;}}module.exports=ExpressionTokenizer;},{"./Fable-Service-ExpressionParser-Base.js":77}],80:[function(require,module,exports){module.exports={"sqrt":{"Name":"Square Root","Address":"fable.Math.sqrtPrecise"},"percent":{"Name":"Compute Percent (in IS over OF format)","Address":"fable.Math.percentagePrecise"},"compare":{"Name":"Compare","Address":"fable.Math.comparePrecise"},"abs":{"Name":"Absolute Value","Address":"fable.Math.absPrecise"},"floor":{"Name":"Floor Value","Address":"fable.Math.floorPrecise"},"ceil":{"Name":"Ceiling Value","Address":"fable.Math.ceilPrecise"},"rad":{"Name":"Degrees to Radians","Address":"fable.Math.radPrecise"},"pi":{"Name":"Pi","Address":"fable.Math.piPrecise"},"euler":{"Name":"Euler","Address":"fable.Math.eulerPrecise"},"log":{"Name":"Logarithm","Address":"fable.Math.logPrecise"},"exp":{"Name":"Eulers Number to the Power Of N","Address":"fable.Math.expPrecise"},"sin":{"Name":"Sine","Address":"fable.Math.sin"},"cos":{"Name":"Cosine","Address":"fable.Math.cos"},"tan":{"Name":"Tangent","Address":"fable.Math.tan"},"count":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"countset":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"sortset":{"Name":"Sort Set","Address":"fable.Math.sortSetPrecise"},"bucketset":{"Name":"Bucket Set","Address":"fable.Math.bucketSetPrecise"},"sorthistogram":{"Name":"Sort Histogram","Address":"fable.Math.sortHistogramPrecise"},"sorthistogrambykeys":{"Name":"Sort Histogram by Keys","Address":"fable.Math.sortHistogramByKeys"},"max":{"Name":"Maximum","Address":"fable.Math.maxPrecise"},"min":{"Name":"Minimum","Address":"fable.Math.minPrecise"},"sum":{"Name":"Sum","Address":"fable.Math.sumPrecise"},"avg":{"Name":"Average","Address":"fable.Math.averagePrecise"},"mean":{"Name":"Mean","Address":"fable.Math.meanPrecise"},"median":{"Name":"Median","Address":"fable.Math.medianPrecise"},"mode":{"Name":"Mode","Address":"fable.Math.modePrecise"},"var":{"Name":"Variance (Sample)","Address":"fable.Math.variancePrecise"},"vara":{"Name":"Variance (Sample)","Address":"fable.Math.variancePrecise"},"varp":{"Name":"Variance (Population)","Address":"fable.Math.populationVariancePrecise"},"stdev":{"Name":"Standard Deviation (Sample)","Address":"fable.Math.standardDeviationPrecise"},"stdeva":{"Name":"Standard Deviation (Sample)","Address":"fable.Math.standardDeviationPrecise"},"stdevp":{"Name":"Standard Deviation (Population)","Address":"fable.Math.populationStandardDeviationPrecise"},"round":{"Name":"Round","Address":"fable.Math.roundPrecise"},"tofixed":{"Name":"To Fixed","Address":"fable.Math.toFixedPrecise"},"cumulativesummation":{"Name":"Sum each value in a Histogram or Value Map cumulatively, creating or setting a property with the result on each row","Address":"fable.Math.cumulativeSummation"},"subtractingsummation":{"Name":"Subtract each subsequent value in a Histogram or Value Map cumulatively (by default from the first row), creating or setting a property with the result on each row.","Address":"fable.Math.subtractingSummation"},"iterativeseries":{"Name":"Perform an Iterative Series of Mathematical Operations on Set Elements","Address":"fable.Math.iterativeSeries"},"countsetelements":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.countSetElements"},"getvalue":{"Name":"Get Value from Application State or Services (AppData, etc.)","Address":"fable.Utility.getInternalValueByHash","AddressParameterIndices":[0]},"setvalue":{"Name":"Set Value to Application State or Services (AppData, etc.)","Address":"fable.Utility.setInternalValueByHash","AddressParameterIndices":[0]},"objectkeystoarray":{"Name":"Get Array of an Object's keys","Address":"fable.Utility.objectKeysToArray"},"objectvaluestoarray":{"Name":"Get Array of an Object's values","Address":"fable.Utility.objectValuesToArray"},"generatearrayofobjectsfromsets":{"Name":"Generate Array of Objects from Sets","Address":"fable.Utility.generateArrayOfObjectsFromSets"},"objectvaluessortbyexternalobjectarray":{"Name":"Get Array of an Object's values sorted by an external array","Address":"fable.Utility.objectValuesSortByExternalArray"},"setkeystoarray":{"Name":"Get Array of an Object's keys","Address":"fable.Utility.objectKeysToArray"},"setvaluestoarray":{"Name":"Get Array of an Object's values","Address":"fable.Utility.objectValuesToArray"},"histogramkeystoarray":{"Name":"Get Array of an Object's keys","Address":"fable.Utility.objectKeysToArray"},"histogramvaluestoarray":{"Name":"Get Array of an Object's values","Address":"fable.Utility.objectValuesToArray"},"createarrayfromabsolutevalues":{"Name":"Create Array from Absolute Values","Address":"fable.Utility.createArrayFromAbsoluteValues"},"flatten":{"Name":"flatten an array of values","Address":"fable.Utility.flattenArrayOfSolverInputs"},"findfirstvaluebyexactmatch":{"Name":"find + map on array of objects","Address":"fable.Utility.findFirstValueByExactMatchInternal","AddressParameterIndices":[0,1,3]},"findfirstvaluebystringincludes":{"Name":"find + map on array of objects","Address":"fable.Utility.findFirstValueByStringIncludesInternal","AddressParameterIndices":[0,1,3]},"match":{"Name":"Implementation of sheets MATCH() function","Address":"fable.Utility.findIndexInternal","AddressParameterIndices":[1]},"resolvehtmlentities":{"Name":"resolve HTML entities","Address":"fable.DataFormat.resolveHtmlEntities"},"concat":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsInternal"},"concatraw":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsRawInternal"},"arrayconcat":{"Name":"concatenate two or more arrays generating a single output array","Address":"fable.Utility.concatenateArrays"},"join":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsInternal"},"joinraw":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsRawInternal"},"if":{"Name":"perform a conditional operator on two values, and choose one of two outcomes based on the result","Address":"fable.Logic.checkIf"},"when":{"Name":"perform a 'truthy' check on one value, and return one of two outcomes based on the result","Address":"fable.Logic.when"},"ternary":{"Name":"numeric-aware ternary selection (used by ? :: operator desugaring)","Address":"fable.Logic.ternary"},"entryinset":{"Name":"Entry in Set","Address":"fable.Math.entryInSet"},"smallestinset":{"Name":"Smallest in Set","Address":"fable.Math.smallestInSet"},"largestinset":{"Name":"Largest in Set","Address":"fable.Math.largestInSet"},"aggregationhistogram":{"Name":"Generate a Histogram by Exact Value Aggregation","Address":"fable.Math.histogramAggregationByExactValueFromInternalState"},"aggregationhistogrambyobject":{"Name":"Generate a Histogram by Exact Value Aggregation from Object Property","Address":"fable.Math.histogramAggregationByExactValue"},"distributionhistogram":{"Name":"Generate a Histogram Based on Value Distribution","Address":"fable.Math.histogramDistributionByExactValueFromInternalState"},"distributionhistogrambyobject":{"Name":"Generate a Histogram Based on Value Distribution from Object Property","Address":"fable.Math.histogramDistributionByExactValue"},"setconcatenate":{"Name":"Set Concatenate","Address":"fable.Math.setConcatenate"},"getvaluearray":{"Name":"Get Value Array from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueArrayByHashParametersFromInternal","AddressParameterIndices":[0,1,2,3,4,5,6,7,8,9]},"getvalueobject":{"Name":"Get Value Object from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueObjectByHashParametersFromInternal","AddressParameterIndices":[0,1,2,3,4,5,6,7,8,9]},"cleanvaluearray":{"Name":"Clean Value Array","Address":"fable.Math.cleanValueArray"},"cleanvalueobject":{"Name":"Clean Value Object","Address":"fable.Math.cleanValueObject"},"polynomialregression":{"Name":"Perform an nth degree Polynomial Regression on a Set of X and Y Values","Address":"fable.Math.polynomialRegression"},"randominteger":{"Name":"Random Integer","Address":"fable.DataGeneration.randomInteger"},"randomintegerbetween":{"Name":"Random Integer Between Two Numbers","Address":"fable.DataGeneration.randomIntegerBetween"},"randomintegerupto":{"Name":"Random Integer","Address":"fable.DataGeneration.randomIntegerUpTo"},"randomfloat":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloat"},"randomfloatbetween":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatBetween"},"randomfloatupto":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatUpTo"},"datemilliseconddifference":{"Name":"Date Difference in Milliseconds","Address":"fable.Dates.dateMillisecondDifference"},"dateseconddifference":{"Name":"Date Difference in Seconds","Address":"fable.Dates.dateSecondDifference"},"dateminutedifference":{"Name":"Date Difference in Minutes","Address":"fable.Dates.dateMinuteDifference"},"datehourdifference":{"Name":"Date Difference in Hours","Address":"fable.Dates.dateHourDifference"},"datedaydifference":{"Name":"Date Difference in Days","Address":"fable.Dates.dateDayDifference"},"dateweekdifference":{"Name":"Date Difference in Weeks","Address":"fable.Dates.dateWeekDifference"},"datemonthdifference":{"Name":"Date Difference in Months","Address":"fable.Dates.dateMonthDifference"},"dateyeardifference":{"Name":"Date Difference in Years","Address":"fable.Dates.dateYearDifference"},"datemathadd":{"Name":"Date Math Add","Address":"fable.Dates.dateMath"},"dateaddmilliseconds":{"Name":"Date Add Milliseconds","Address":"fable.Dates.dateAddMilliseconds"},"dateaddseconds":{"Name":"Date Add Seconds","Address":"fable.Dates.dateAddSeconds"},"dateaddminutes":{"Name":"Date Add Minutes","Address":"fable.Dates.dateAddMinutes"},"dateaddhours":{"Name":"Date Add Hours","Address":"fable.Dates.dateAddHours"},"dateadddays":{"Name":"Date Add Days","Address":"fable.Dates.dateAddDays"},"dateaddweeks":{"Name":"Date Add Weeks","Address":"fable.Dates.dateAddWeeks"},"dateaddmonths":{"Name":"Date Add Months","Address":"fable.Dates.dateAddMonths"},"dateaddyears":{"Name":"Date Add Years","Address":"fable.Dates.dateAddYears"},"datefromparts":{"Name":"Date From Parts","Address":"fable.Dates.dateFromParts"},"slice":{"Name":"Slice Array","Address":"fable.Utility.slice"},"createvalueobjectbyhashes":{"Name":"Create Value Object by Hashes","Address":"fable.Utility.createValueObjectByHashes","AddressParameterIndices":[0,1,2,3,4,5,6,7,8,9]},"slope":{"Name":"Slope of Linear Regression Line (Excel SLOPE equivalent)","Address":"fable.Math.slopePrecise"},"intercept":{"Name":"Y-Intercept of Linear Regression Line (Excel INTERCEPT equivalent)","Address":"fable.Math.interceptPrecise"},"leastsquares":{"Name":"Perform a Least Squares Regression on a Set of Independent Variable Vectors and a Dependent Variable Vector","Address":"fable.Math.leastSquares"},"linest":{"Name":"Perform a Least Squares Regression on a Set of Independent Variable Vectors and a Dependent Variable Vector","Address":"fable.Math.leastSquares"},"matrixtranspose":{"Name":"Transpose a Matrix","Address":"fable.Math.matrixTranspose"},"matrixmultiply":{"Name":"Multiply Two Matrices","Address":"fable.Math.matrixMultiply"},"matrixvectormultiply":{"Name":"Multiply a Matrix by a Vector","Address":"fable.Math.matrixVectorMultiply"},"matrixinverse":{"Name":"Inverse a Matrix","Address":"fable.Math.matrixInverse"},"gaussianelimination":{"Name":"Solve a System of Linear Equations using Gaussian Elimination","Address":"fable.Math.gaussianElimination"},"predict":{"Name":"Predict Y Values from X Values using a Regression Model","Address":"fable.Math.predictFromRegressionModel"},"stringcountsegments":{"Name":"Count Segments in a String","Address":"fable.DataFormat.stringCountSegments"},"stringgetsegments":{"Name":"Get Segments from a String","Address":"fable.DataFormat.stringGetSegments"},"bezierpoint":{"Name":"Evaluate a Point on a Cubic Bezier Curve at Parameter t","Address":"fable.Math.bezierPoint"},"beziercurvefit":{"Name":"Fit a Cubic Bezier Curve to a Set of Data Points","Address":"fable.Math.bezierCurveFit"},"generateguid":{"Name":"Generate a GUID string","Address":"fable.getUUID"}};},{}],81:[function(require,module,exports){const libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');class ExpressionParserLinter extends libExpressionParserOperationBase{constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);this.serviceType='ExpressionParser-Linter';}lintTokenizedExpression(pTokenizedExpression,pResultObject){let tmpResults=typeof pResultObject==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.LinterResults=[];// Guard against bad data being passed in
1621
+ this.TokenizerDirectiveMutation.parseDirectives(tmpResults);return tmpResults.RawTokens;}}module.exports=ExpressionTokenizer;},{"./Fable-Service-ExpressionParser-Base.js":77}],80:[function(require,module,exports){module.exports={"sqrt":{"Name":"Square Root","Address":"fable.Math.sqrtPrecise"},"percent":{"Name":"Compute Percent (in IS over OF format)","Address":"fable.Math.percentagePrecise"},"compare":{"Name":"Compare","Address":"fable.Math.comparePrecise"},"abs":{"Name":"Absolute Value","Address":"fable.Math.absPrecise"},"floor":{"Name":"Floor Value","Address":"fable.Math.floorPrecise"},"ceil":{"Name":"Ceiling Value","Address":"fable.Math.ceilPrecise"},"rad":{"Name":"Degrees to Radians","Address":"fable.Math.radPrecise"},"pi":{"Name":"Pi","Address":"fable.Math.piPrecise"},"euler":{"Name":"Euler","Address":"fable.Math.eulerPrecise"},"log":{"Name":"Logarithm","Address":"fable.Math.logPrecise"},"exp":{"Name":"Eulers Number to the Power Of N","Address":"fable.Math.expPrecise"},"sin":{"Name":"Sine","Address":"fable.Math.sin"},"cos":{"Name":"Cosine","Address":"fable.Math.cos"},"tan":{"Name":"Tangent","Address":"fable.Math.tan"},"count":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"countset":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"sortset":{"Name":"Sort Set","Address":"fable.Math.sortSetPrecise"},"bucketset":{"Name":"Bucket Set","Address":"fable.Math.bucketSetPrecise"},"sorthistogram":{"Name":"Sort Histogram","Address":"fable.Math.sortHistogramPrecise"},"sorthistogrambykeys":{"Name":"Sort Histogram by Keys","Address":"fable.Math.sortHistogramByKeys"},"max":{"Name":"Maximum","Address":"fable.Math.maxPrecise"},"min":{"Name":"Minimum","Address":"fable.Math.minPrecise"},"sum":{"Name":"Sum","Address":"fable.Math.sumPrecise"},"avg":{"Name":"Average","Address":"fable.Math.averagePrecise"},"mean":{"Name":"Mean","Address":"fable.Math.meanPrecise"},"median":{"Name":"Median","Address":"fable.Math.medianPrecise"},"mode":{"Name":"Mode","Address":"fable.Math.modePrecise"},"var":{"Name":"Variance (Sample)","Address":"fable.Math.variancePrecise"},"vara":{"Name":"Variance (Sample)","Address":"fable.Math.variancePrecise"},"varp":{"Name":"Variance (Population)","Address":"fable.Math.populationVariancePrecise"},"stdev":{"Name":"Standard Deviation (Sample)","Address":"fable.Math.standardDeviationPrecise"},"stdeva":{"Name":"Standard Deviation (Sample)","Address":"fable.Math.standardDeviationPrecise"},"stdevp":{"Name":"Standard Deviation (Population)","Address":"fable.Math.populationStandardDeviationPrecise"},"round":{"Name":"Round","Address":"fable.Math.roundPrecise"},"tofixed":{"Name":"To Fixed","Address":"fable.Math.toFixedPrecise"},"cumulativesummation":{"Name":"Sum each value in a Histogram or Value Map cumulatively, creating or setting a property with the result on each row","Address":"fable.Math.cumulativeSummation"},"subtractingsummation":{"Name":"Subtract each subsequent value in a Histogram or Value Map cumulatively (by default from the first row), creating or setting a property with the result on each row.","Address":"fable.Math.subtractingSummation"},"iterativeseries":{"Name":"Perform an Iterative Series of Mathematical Operations on Set Elements","Address":"fable.Math.iterativeSeries"},"countsetelements":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.countSetElements"},"getvalue":{"Name":"Get Value from Application State or Services (AppData, etc.)","Address":"fable.Utility.getInternalValueByHash","AddressParameterIndices":[0]},"setvalue":{"Name":"Set Value to Application State or Services (AppData, etc.)","Address":"fable.Utility.setInternalValueByHash","AddressParameterIndices":[0]},"objectkeystoarray":{"Name":"Get Array of an Object's keys","Address":"fable.Utility.objectKeysToArray"},"objectvaluestoarray":{"Name":"Get Array of an Object's values","Address":"fable.Utility.objectValuesToArray"},"generatearrayofobjectsfromsets":{"Name":"Generate Array of Objects from Sets","Address":"fable.Utility.generateArrayOfObjectsFromSets"},"objectvaluessortbyexternalobjectarray":{"Name":"Get Array of an Object's values sorted by an external array","Address":"fable.Utility.objectValuesSortByExternalArray"},"setkeystoarray":{"Name":"Get Array of an Object's keys","Address":"fable.Utility.objectKeysToArray"},"setvaluestoarray":{"Name":"Get Array of an Object's values","Address":"fable.Utility.objectValuesToArray"},"histogramkeystoarray":{"Name":"Get Array of an Object's keys","Address":"fable.Utility.objectKeysToArray"},"histogramvaluestoarray":{"Name":"Get Array of an Object's values","Address":"fable.Utility.objectValuesToArray"},"createarrayfromabsolutevalues":{"Name":"Create Array from Absolute Values","Address":"fable.Utility.createArrayFromAbsoluteValues"},"flatten":{"Name":"flatten an array of values","Address":"fable.Utility.flattenArrayOfSolverInputs"},"findfirstvaluebyexactmatch":{"Name":"find + map on array of objects","Address":"fable.Utility.findFirstValueByExactMatchInternal","AddressParameterIndices":[0,1,3]},"findfirstvaluebystringincludes":{"Name":"find + map on array of objects","Address":"fable.Utility.findFirstValueByStringIncludesInternal","AddressParameterIndices":[0,1,3]},"match":{"Name":"Implementation of sheets MATCH() function","Address":"fable.Utility.findIndexInternal","AddressParameterIndices":[1]},"resolvehtmlentities":{"Name":"resolve HTML entities","Address":"fable.DataFormat.resolveHtmlEntities"},"concat":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsInternal"},"concatraw":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsRawInternal"},"arrayconcat":{"Name":"concatenate two or more arrays generating a single output array","Address":"fable.Utility.concatenateArrays"},"join":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsInternal"},"joinraw":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsRawInternal"},"if":{"Name":"perform a conditional operator on two values, and choose one of two outcomes based on the result","Address":"fable.Logic.checkIf"},"when":{"Name":"perform a 'truthy' check on one value, and return one of two outcomes based on the result","Address":"fable.Logic.when"},"ternary":{"Name":"numeric-aware ternary selection (used by ? :: operator desugaring)","Address":"fable.Logic.ternary"},"entryinset":{"Name":"Entry in Set","Address":"fable.Math.entryInSet"},"smallestinset":{"Name":"Smallest in Set","Address":"fable.Math.smallestInSet"},"largestinset":{"Name":"Largest in Set","Address":"fable.Math.largestInSet"},"aggregationhistogram":{"Name":"Generate a Histogram by Exact Value Aggregation","Address":"fable.Math.histogramAggregationByExactValueFromInternalState"},"aggregationhistogrambyobject":{"Name":"Generate a Histogram by Exact Value Aggregation from Object Property","Address":"fable.Math.histogramAggregationByExactValue"},"distributionhistogram":{"Name":"Generate a Histogram Based on Value Distribution","Address":"fable.Math.histogramDistributionByExactValueFromInternalState"},"distributionhistogrambyobject":{"Name":"Generate a Histogram Based on Value Distribution from Object Property","Address":"fable.Math.histogramDistributionByExactValue"},"setconcatenate":{"Name":"Set Concatenate","Address":"fable.Math.setConcatenate"},"getvaluearray":{"Name":"Get Value Array from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueArrayByHashParametersFromInternal","AddressParameterIndices":[0,1,2,3,4,5,6,7,8,9]},"getvalueobject":{"Name":"Get Value Object from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueObjectByHashParametersFromInternal","AddressParameterIndices":[0,1,2,3,4,5,6,7,8,9]},"cleanvaluearray":{"Name":"Clean Value Array","Address":"fable.Math.cleanValueArray"},"cleanvalueobject":{"Name":"Clean Value Object","Address":"fable.Math.cleanValueObject"},"polynomialregression":{"Name":"Perform an nth degree Polynomial Regression on a Set of X and Y Values","Address":"fable.Math.polynomialRegression"},"randominteger":{"Name":"Random Integer","Address":"fable.DataGeneration.randomInteger"},"randomintegerbetween":{"Name":"Random Integer Between Two Numbers","Address":"fable.DataGeneration.randomIntegerBetween"},"randomintegerupto":{"Name":"Random Integer","Address":"fable.DataGeneration.randomIntegerUpTo"},"randomfloat":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloat"},"randomfloatbetween":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatBetween"},"randomfloatupto":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatUpTo"},"datemilliseconddifference":{"Name":"Date Difference in Milliseconds","Address":"fable.Dates.dateMillisecondDifference"},"dateseconddifference":{"Name":"Date Difference in Seconds","Address":"fable.Dates.dateSecondDifference"},"dateminutedifference":{"Name":"Date Difference in Minutes","Address":"fable.Dates.dateMinuteDifference"},"datehourdifference":{"Name":"Date Difference in Hours","Address":"fable.Dates.dateHourDifference"},"datedaydifference":{"Name":"Date Difference in Days","Address":"fable.Dates.dateDayDifference"},"dateweekdifference":{"Name":"Date Difference in Weeks","Address":"fable.Dates.dateWeekDifference"},"datemonthdifference":{"Name":"Date Difference in Months","Address":"fable.Dates.dateMonthDifference"},"dateyeardifference":{"Name":"Date Difference in Years","Address":"fable.Dates.dateYearDifference"},"datemathadd":{"Name":"Date Math Add","Address":"fable.Dates.dateMath"},"dateaddmilliseconds":{"Name":"Date Add Milliseconds","Address":"fable.Dates.dateAddMilliseconds"},"dateaddseconds":{"Name":"Date Add Seconds","Address":"fable.Dates.dateAddSeconds"},"dateaddminutes":{"Name":"Date Add Minutes","Address":"fable.Dates.dateAddMinutes"},"dateaddhours":{"Name":"Date Add Hours","Address":"fable.Dates.dateAddHours"},"dateadddays":{"Name":"Date Add Days","Address":"fable.Dates.dateAddDays"},"dateaddweeks":{"Name":"Date Add Weeks","Address":"fable.Dates.dateAddWeeks"},"dateaddmonths":{"Name":"Date Add Months","Address":"fable.Dates.dateAddMonths"},"dateaddyears":{"Name":"Date Add Years","Address":"fable.Dates.dateAddYears"},"datefromparts":{"Name":"Date From Parts","Address":"fable.Dates.dateFromParts"},"slice":{"Name":"Slice Array","Address":"fable.Utility.slice"},"createvalueobjectbyhashes":{"Name":"Create Value Object by Hashes","Address":"fable.Utility.createValueObjectByHashes","AddressParameterIndices":[0,1,2,3,4,5,6,7,8,9]},"slope":{"Name":"Slope of Linear Regression Line (Excel SLOPE equivalent)","Address":"fable.Math.slopePrecise"},"intercept":{"Name":"Y-Intercept of Linear Regression Line (Excel INTERCEPT equivalent)","Address":"fable.Math.interceptPrecise"},"leastsquares":{"Name":"Perform a Least Squares Regression on a Set of Independent Variable Vectors and a Dependent Variable Vector","Address":"fable.Math.leastSquares"},"linest":{"Name":"Perform a Least Squares Regression on a Set of Independent Variable Vectors and a Dependent Variable Vector","Address":"fable.Math.leastSquares"},"matrixtranspose":{"Name":"Transpose a Matrix","Address":"fable.Math.matrixTranspose"},"matrixmultiply":{"Name":"Multiply Two Matrices","Address":"fable.Math.matrixMultiply"},"matrixvectormultiply":{"Name":"Multiply a Matrix by a Vector","Address":"fable.Math.matrixVectorMultiply"},"matrixinverse":{"Name":"Inverse a Matrix","Address":"fable.Math.matrixInverse"},"gaussianelimination":{"Name":"Solve a System of Linear Equations using Gaussian Elimination","Address":"fable.Math.gaussianElimination"},"predict":{"Name":"Predict Y Values from X Values using a Regression Model","Address":"fable.Math.predictFromRegressionModel"},"stringcountsegments":{"Name":"Count Segments in a String","Address":"fable.DataFormat.stringCountSegments"},"stringgetsegments":{"Name":"Get Segments from a String","Address":"fable.DataFormat.stringGetSegments"},"bezierpoint":{"Name":"Evaluate a Point on a Cubic Bezier Curve at Parameter t","Address":"fable.Math.bezierPoint"},"beziercurvefit":{"Name":"Fit a Cubic Bezier Curve to a Set of Data Points","Address":"fable.Math.bezierCurveFit"},"generateguid":{"Name":"Generate a GUID string","Address":"fable.getUUID"},"isnumeric":{"Name":"Is Numeric (1/0; trims strings, empty/text are not numeric)","Address":"fable.Math.isNumeric"},"tonumber":{"Name":"To Number (with fallback for non-numeric values)","Address":"fable.Math.toNumber"}};},{}],81:[function(require,module,exports){const libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');class ExpressionParserLinter extends libExpressionParserOperationBase{constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);this.serviceType='ExpressionParser-Linter';}lintTokenizedExpression(pTokenizedExpression,pResultObject){let tmpResults=typeof pResultObject==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.LinterResults=[];// Guard against bad data being passed in
1622
1622
  if(!Array.isArray(pTokenizedExpression)){tmpResults.ExpressionParserLog.push(`ERROR: ExpressionParser.lintTokenizedExpression was passed a non-array tokenized expression.`);tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return pTokenizedExpression;}if(pTokenizedExpression.length<1){tmpResults.ExpressionParserLog.push(`ERROR: ExpressionParser.lintTokenizedExpression was passed an empty tokenized expression.`);tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return pTokenizedExpression;}// 1. Check for balanced parenthesis
1623
1623
  let tmpParenthesisDepth=0;// If it is in a state address, we don't care about the parenthesis
1624
1624
  // State addresses are between squiggly brackets
@@ -1966,6 +1966,34 @@ tmpResult=Math.pow(tmpLeftValue,Number(pRightValue));}return tmpResult.toString(
1966
1966
  * @param {number|string} pValue - The number to calculate the absolute value of.
1967
1967
  * @returns {string} The absolute value of the input number as a string.
1968
1968
  */absPrecise(pValue){let tmpValue=isNaN(pValue)?0:pValue;let tmpLeftArbitraryValue=new this.bigNumber(tmpValue);let tmpResult=tmpLeftArbitraryValue.abs();return tmpResult.toString();}/**
1969
+ * Tests whether a value is a numeric decimal string (after trimming).
1970
+ * Empty strings, whitespace, non-numeric text, null and undefined are NOT
1971
+ * numeric; '0' IS. Returns the strings '1' / '0' so the result composes
1972
+ * with the expression grammar's comparison-style truth values.
1973
+ *
1974
+ * Validity is tested with a decimal grammar (sign, digits, optional
1975
+ * fraction, optional exponent) rather than a float round-trip, so
1976
+ * arbitrary-precision values — long mantissas, integers past 2^53,
1977
+ * exponents beyond float range — classify correctly for the string-based
1978
+ * precise math this service does.
1979
+ *
1980
+ * @param {*} pValue - The value to test.
1981
+ * @returns {string} '1' when numeric, '0' otherwise.
1982
+ */isNumeric(pValue){if(pValue===null||pValue===undefined){return'0';}const tmpString=String(pValue).trim();if(tmpString===''){return'0';}return /^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/.test(tmpString)?'1':'0';}/**
1983
+ * Validates a value as numeric, with an explicit fallback for anything
1984
+ * that is not (empty strings, text placeholders, null). The numeric
1985
+ * counterpart to isNumeric — together they express "skip or zero-fill
1986
+ * dirty readings while still counting real zeroes".
1987
+ *
1988
+ * PRECISION CONTRACT: when the value IS numeric, the original (trimmed)
1989
+ * string is returned VERBATIM — never round-tripped through a float — so
1990
+ * arbitrary-precision values flow into the precise math untouched
1991
+ * ('1.500' stays '1.500'; 25-digit mantissas keep every digit).
1992
+ *
1993
+ * @param {*} pValue - The value to validate.
1994
+ * @param {number|string} [pFallback=0] - Returned when pValue is not numeric.
1995
+ * @returns {string} The original numeric string (or the fallback) as a string.
1996
+ */toNumber(pValue,pFallback){if(this.isNumeric(pValue)==='0'){return pFallback===undefined||pFallback===null?'0':String(pFallback);}return String(pValue).trim();}/**
1969
1997
  * Calculates the floor of a number precisely.
1970
1998
  *
1971
1999
  * @param {string|number} pValue - The number to calculate the floor value of.
@@ -6106,7 +6134,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
6106
6134
  // presumably different callback function.
6107
6135
  // This makes sure that own properties are retained, so that
6108
6136
  // decorations and such are not lost along the way.
6109
- module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],191:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],192:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.379","description":"Pict browser library.","main":"source/Pict.js","scripts":{"start":"node source/Pict.js","test":"npx quack test","tests":"npx quack test -g","coverage":"npx quack coverage","build":"npx quack build","prepublishOnly":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-image:local","docker-dev-run":"docker run -it -d --name pict-dev -p 37447:8080 -p 19506:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-image:local","docker-dev-shell":"docker exec -it pict-dev /bin/bash","lint":"eslint source/**/*.js test/**/*.js","types":"tsc -p ."},"files":["source/","dist/","types/"],"types":"types/source/Pict.d.ts","mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"git+https://stevenvelozo@github.com/stevenvelozo/pict.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/fable-retold/pict/issues"},"homepage":"https://github.com/fable-retold/pict#readme","devDependencies":{"@eslint/js":"^9.39.1","@types/jquery":"^3.5.33","@types/sinon":"^17.0.4","eslint":"^9.39.1","globals":"^16.5.0","pict-docuserve":"^1.4.19","quackage":"^1.3.0","sinon":"^20.0.0","typescript":"^5.9.3"},"dependencies":{"cachetrax":"^1.0.6","fable":"^3.1.75","pict-application":"^1.0.34","pict-provider":"^1.0.13","pict-template":"^1.0.15","pict-view":"^1.0.68"}};},{}],193:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
6137
+ module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],191:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],192:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.381","description":"Pict browser library.","main":"source/Pict.js","scripts":{"start":"node source/Pict.js","test":"npx quack test","tests":"npx quack test -g","coverage":"npx quack coverage","build":"npx quack build","prepublishOnly":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-image:local","docker-dev-run":"docker run -it -d --name pict-dev -p 37447:8080 -p 19506:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-image:local","docker-dev-shell":"docker exec -it pict-dev /bin/bash","lint":"eslint source/**/*.js test/**/*.js","types":"tsc -p ."},"files":["source/","dist/","types/"],"types":"types/source/Pict.d.ts","mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"git+https://stevenvelozo@github.com/stevenvelozo/pict.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/fable-retold/pict/issues"},"homepage":"https://github.com/fable-retold/pict#readme","devDependencies":{"@eslint/js":"^9.39.1","@types/jquery":"^3.5.33","@types/sinon":"^17.0.4","eslint":"^9.39.1","globals":"^16.5.0","pict-docuserve":"^1.4.19","quackage":"^1.3.0","sinon":"^20.0.0","typescript":"^5.9.3"},"dependencies":{"cachetrax":"^1.0.6","fable":"^3.1.76","pict-application":"^1.0.34","pict-provider":"^1.0.13","pict-template":"^1.0.15","pict-view":"^1.0.68"}};},{}],193:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
6110
6138
  /* global Pict, _Pict: writeable *//**
6111
6139
  * Simple function to load a pict Application
6112
6140
  *
@@ -7242,7 +7270,11 @@ case'ExternalJoinMatch':case'ExternalJoinStringMatch':case'ExternalJoinDateMatch
7242
7270
  */if(!tmpFilterByColumns){tmpFilterByColumns=tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name']);}for(const tmpField of tmpFilterByColumns){for(const tmpValue of tmpValuesArray){const tmpFilter={Index:-1,Entity:tmpFilterConfig.ExternalFilterByTable,Instruction:'FBVOR',Field:tmpField};if(tmpFilterConfig.ExactMatch||typeof tmpFilterConfig.ExactMatch==='undefined'&&(tmpFilterConfig.Type=='ExternalJoinNumericMatch'||tmpFilterConfig.Type=='ExternalJoinDateMatch'||tmpFilterConfig.Type=='ExternalJoinSelectedValue'||tmpFilterConfig.Type=='ExternalJoinSelectedValueList')){//TODO: optimize this to use in-list, but requires restructuring of this code
7243
7271
  tmpFilter.Operator='EQ';tmpFilter.Value=tmpValue;}else{tmpFilter.Operator='LK';tmpFilter.Value=`%25${tmpValue}%25`;//FIXME: point of URI encoding needs to be addressed
7244
7272
  }tmpFilterResult.Filters.push(tmpFilter);}}if(!tmpFilterConfig.JoinTable){this.log.error(`${tmpFilterConfig.Type} filter missing JoinTable, cannot filter join table.`,{FilterConfig:tmpFilterConfig});break;}if(!tmpFilterConfig.JoinTableExternalConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinTableExternalConnectionColumn, cannot filter join table [${tmpFilterConfig.JoinTable}].`);break;}if(tmpFilterResult.Filters.length>0){tmpFilterResult.Filters.push({Index:0,Fulcrum:true,Entity:tmpFilterConfig.JoinTable,Instruction:'FBL',Field:tmpFilterConfig.JoinTableExternalConnectionColumn,Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.ExternalFilterByTableConnectionColumn||tmpFilterConfig.JoinTableExternalConnectionColumn}^Record.State[Step-1]~}`});if(tmpFilterConfig.PolyJoinRemoteType){tmpFilterResult.Filters.push({Index:0,Fulcrum:true,Entity:tmpFilterConfig.JoinTable,Instruction:'FBV',Field:tmpFilterConfig.PolyJoinRemoteColumn||'RemoteType',Operator:'EQ',ValueTemplate:tmpFilterConfig.PolyJoinRemoteType});}if(!tmpFilterConfig.CoreConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing CoreConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}tmpFilterResult.JoinConfig={CoreEntity:pFilterState.Entity,Instruction:'FBLOR',Fields:[tmpFilterConfig.CoreConnectionColumn],Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.JoinTableCoreConnectionColumn}^Record.State[Step0]~}`};}break;case'ExternalJoinStringRange':case'ExternalJoinNumericRange':case'ExternalJoinDateRange':case'ExternalJoinRange':if(!tmpFilterConfig.Values||tmpFilterConfig.Values.Start==null&&tmpFilterConfig.Values.End==null){break;}// do not honor '0' for dates
7245
- if(tmpFilterConfig.Type=='ExternalJoinDateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}for(const tmpField of tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name'])){const hasStartValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='ExternalJoinDateRange'||tmpFilterConfig.Values.Start!='0');const hasEndValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='ExternalJoinDateRange'||tmpFilterConfig.Values.End!='0');if(hasStartValue){tmpFilterResult.Filters.push({Index:-1,Entity:tmpFilterConfig.ExternalFilterByTable,Instruction:'FBVOR',OpenParen:true,OpenParenOr:true,CloseParen:!hasEndValue,Field:tmpField,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(hasEndValue){tmpFilterResult.Filters.push({Index:-1,Entity:tmpFilterConfig.ExternalFilterByTable,Instruction:'FBV',OpenParen:!hasStartValue,OpenParenOr:!hasStartValue,CloseParen:true,Field:tmpField,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}if(!tmpFilterConfig.JoinTable){this.log.error(`${tmpFilterConfig.Type} filter missing JoinTable, cannot filter join table.`,{FilterConfig:tmpFilterConfig});break;}if(!tmpFilterConfig.JoinTableExternalConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinTableExternalConnectionColumn, cannot filter join table [${tmpFilterConfig.JoinTable}].`);break;}if(tmpFilterResult.Filters.length>0){tmpFilterResult.Filters.push({Index:0,Fulcrum:true,Entity:tmpFilterConfig.JoinTable,Instruction:'FBL',Field:tmpFilterConfig.JoinTableExternalConnectionColumn,Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.ExternalFilterByTableConnectionColumn||tmpFilterConfig.JoinTableExternalConnectionColumn}^Record.State[Step-1]~}`});if(tmpFilterConfig.PolyJoinRemoteType){tmpFilterResult.Filters.push({Index:0,Fulcrum:true,Entity:tmpFilterConfig.JoinTable,Instruction:'FBV',Field:tmpFilterConfig.PolyJoinRemoteColumn||'RemoteType',Operator:'EQ',ValueTemplate:tmpFilterConfig.PolyJoinRemoteType});}if(!tmpFilterConfig.CoreConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing CoreConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}if(!tmpFilterConfig.JoinTableCoreConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinTableCoreConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}tmpFilterResult.JoinConfig={CoreEntity:pFilterState.Entity,Instruction:'FBLOR',Fields:[tmpFilterConfig.CoreConnectionColumn],Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.JoinTableCoreConnectionColumn}^Record.State[Step0]~}`};}break;case'StringRange':case'DateRange':case'NumericRange':case'Range':if(!tmpFilterConfig.Values||tmpFilterConfig.Values.Start==null&&tmpFilterConfig.Values.End==null){break;}// do not honor '0' for dates
7273
+ if(tmpFilterConfig.Type=='ExternalJoinDateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}for(const tmpField of tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name'])){const hasStartValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='ExternalJoinDateRange'||tmpFilterConfig.Values.Start!='0');const hasEndValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='ExternalJoinDateRange'||tmpFilterConfig.Values.End!='0');if(hasStartValue){// Range is `(Start <= field <= End)` both bounds AND'd; per-
7274
+ // group serializer wraps the stanzas in a single paren group,
7275
+ // so no OpenParen needed here. See the matching note in the
7276
+ // core Range case below.
7277
+ tmpFilterResult.Filters.push({Index:-1,Entity:tmpFilterConfig.ExternalFilterByTable,Instruction:'FBV',CloseParen:false,Field:tmpField,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(hasEndValue){tmpFilterResult.Filters.push({Index:-1,Entity:tmpFilterConfig.ExternalFilterByTable,Instruction:'FBV',CloseParen:false,Field:tmpField,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}if(!tmpFilterConfig.JoinTable){this.log.error(`${tmpFilterConfig.Type} filter missing JoinTable, cannot filter join table.`,{FilterConfig:tmpFilterConfig});break;}if(!tmpFilterConfig.JoinTableExternalConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinTableExternalConnectionColumn, cannot filter join table [${tmpFilterConfig.JoinTable}].`);break;}if(tmpFilterResult.Filters.length>0){tmpFilterResult.Filters.push({Index:0,Fulcrum:true,Entity:tmpFilterConfig.JoinTable,Instruction:'FBL',Field:tmpFilterConfig.JoinTableExternalConnectionColumn,Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.ExternalFilterByTableConnectionColumn||tmpFilterConfig.JoinTableExternalConnectionColumn}^Record.State[Step-1]~}`});if(tmpFilterConfig.PolyJoinRemoteType){tmpFilterResult.Filters.push({Index:0,Fulcrum:true,Entity:tmpFilterConfig.JoinTable,Instruction:'FBV',Field:tmpFilterConfig.PolyJoinRemoteColumn||'RemoteType',Operator:'EQ',ValueTemplate:tmpFilterConfig.PolyJoinRemoteType});}if(!tmpFilterConfig.CoreConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing CoreConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}if(!tmpFilterConfig.JoinTableCoreConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinTableCoreConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}tmpFilterResult.JoinConfig={CoreEntity:pFilterState.Entity,Instruction:'FBLOR',Fields:[tmpFilterConfig.CoreConnectionColumn],Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.JoinTableCoreConnectionColumn}^Record.State[Step0]~}`};}break;case'StringRange':case'DateRange':case'NumericRange':case'Range':if(!tmpFilterConfig.Values||tmpFilterConfig.Values.Start==null&&tmpFilterConfig.Values.End==null){break;}// do not honor '0' for dates
7246
7278
  if(tmpFilterConfig.Type=='DateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}/*
7247
7279
  "Values":
7248
7280
  {
@@ -7250,14 +7282,20 @@ if(tmpFilterConfig.Type=='DateRange'){if((!tmpFilterConfig.Values.Start||tmpFilt
7250
7282
  "End": "2024-01-01T00:00:00Z"
7251
7283
  },
7252
7284
  "FilterByColumn": "CreateDate",
7253
- */for(const tmpField of tmpFilterConfig.FilterByColumns||(tmpFilterConfig.FilterByColumn?[tmpFilterConfig.FilterByColumn]:['Name'])){const hasStartValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='DateRange'||tmpFilterConfig.Values.Start!='0');const hasEndValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='DateRange'||tmpFilterConfig.Values.End!='0');if(hasStartValue){tmpFilterResult.Filters.push({Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBVOR',Field:tmpField,OpenParen:true,OpenParenOr:true,CloseParen:!hasEndValue,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(hasEndValue){tmpFilterResult.Filters.push({Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBV',OpenParen:!hasStartValue,OpenParenOr:!hasStartValue,CloseParen:true,Field:tmpField,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}break;case'StringMatch':case'DateMatch':case'NumericMatch':case'Match':/*
7285
+ */for(const tmpField of tmpFilterConfig.FilterByColumns||(tmpFilterConfig.FilterByColumn?[tmpFilterConfig.FilterByColumn]:['Name'])){const hasStartValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='DateRange'||tmpFilterConfig.Values.Start!='0');const hasEndValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='DateRange'||tmpFilterConfig.Values.End!='0');if(hasStartValue){// Range is `(Start <= field <= End)` — both bounds AND'd. No
7286
+ // OpenParen here; the per-group serializer already wraps the
7287
+ // stanzas in one paren group, and meadow-endpoints' filter
7288
+ // parser rejects further nesting (`FOP(FOP(...))` 404s on the
7289
+ // /1.0/PrivateDataLake/* routes).
7290
+ tmpFilterResult.Filters.push({Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBV',Field:tmpField,CloseParen:false,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(hasEndValue){tmpFilterResult.Filters.push({Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBV',CloseParen:false,Field:tmpField,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}break;case'StringMatch':case'DateMatch':case'NumericMatch':case'Match':/*
7254
7291
  "Values": [ "John", "Jane" ],
7255
7292
  "FilterByColumn": "Name",
7256
7293
  "ExactMatch": false,
7257
7294
  */for(const tmpField of tmpFilterConfig.FilterByColumns||(tmpFilterConfig.FilterByColumn?[tmpFilterConfig.FilterByColumn]:['Name'])){for(const tmpValue of tmpValuesArray){const tmpFilter={Index:0,CoreEntity:true,Entity:pFilterState.Entity,Instruction:'FBVOR',Field:tmpField};// don't use like for numbers
7258
7295
  if(tmpFilterConfig.ExactMatch||typeof tmpFilterConfig.ExactMatch==='undefined'&&(tmpFilterConfig.Type=='NumericMatch'||tmpFilterConfig.Type=='DateMatch')){tmpFilter.Operator='EQ';tmpFilter.Value=tmpValue;}else{tmpFilter.Operator='LK';tmpFilter.Value=`%25${tmpValue}%25`;//FIXME: figure out a cleaner way to do URL encoding for these - probably, should be downstream, but isn't currently
7259
7296
  }tmpFilterResult.Filters.push(tmpFilter);}}break;case'InternalJoinStringRange':case'InternalJoinNumericRange':case'InternalJoinDateRange':case'InternalJoinRange':if(!tmpFilterConfig.Values||tmpFilterConfig.Values.Start==null&&tmpFilterConfig.Values.End==null){break;}// do not honor '0' for dates
7260
- if(tmpFilterConfig.Type=='InternalJoinDateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}for(const tmpField of tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name'])){const hasStartValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='InternalJoinDateRange'||tmpFilterConfig.Values.Start!='0');const hasEndValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='InternalJoinDateRange'||tmpFilterConfig.Values.End!='0');if(hasStartValue){tmpFilterResult.Filters.push({Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'FBVOR',Field:tmpField,OpenParen:true,OpenParenOr:true,CloseParen:!hasEndValue,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(hasEndValue){tmpFilterResult.Filters.push({Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'FBV',OpenParen:!hasStartValue,OpenParenOr:!hasStartValue,CloseParen:true,Field:tmpField,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}if(tmpFilterResult.Filters.length>0){if(!tmpFilterConfig.JoinInternalConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinInternalConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}tmpFilterResult.JoinConfig={Instruction:'FBLOR',CoreEntity:pFilterState.Entity,Fields:[tmpFilterConfig.JoinInternalConnectionColumn],Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.JoinExternalConnectionColumn}^Record.State[Step0]~}`};}break;case'InternalJoinSelectedValue':case'InternalJoinSelectedValueList':tmpFilterByColumns=[tmpFilterConfig.ExternalFilterTableLookupColumn||`ID${tmpFilterConfig.RemoteTable}`];// fall through
7297
+ if(tmpFilterConfig.Type=='InternalJoinDateRange'){if((!tmpFilterConfig.Values.Start||tmpFilterConfig.Values.Start=='0')&&(!tmpFilterConfig.Values.End||tmpFilterConfig.Values.End=='0')){break;}}for(const tmpField of tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name'])){const hasStartValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.Start&&(tmpFilterConfig.Type!='InternalJoinDateRange'||tmpFilterConfig.Values.Start!='0');const hasEndValue=tmpFilterConfig.Values&&tmpFilterConfig.Values.End&&(tmpFilterConfig.Type!='InternalJoinDateRange'||tmpFilterConfig.Values.End!='0');if(hasStartValue){// Range bounds AND'd within the per-group paren wrap.
7298
+ tmpFilterResult.Filters.push({Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'FBV',Field:tmpField,CloseParen:false,Operator:tmpFilterConfig.StartExclusive?'GT':'GE',Value:tmpFilterConfig.Values.Start});}if(hasEndValue){tmpFilterResult.Filters.push({Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'FBV',CloseParen:false,Field:tmpField,Operator:tmpFilterConfig.EndExclusive?'LT':'LE',Value:tmpFilterConfig.Values.End});}}if(tmpFilterResult.Filters.length>0){if(!tmpFilterConfig.JoinInternalConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinInternalConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}tmpFilterResult.JoinConfig={Instruction:'FBLOR',CoreEntity:pFilterState.Entity,Fields:[tmpFilterConfig.JoinInternalConnectionColumn],Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.JoinExternalConnectionColumn}^Record.State[Step0]~}`};}break;case'InternalJoinSelectedValue':case'InternalJoinSelectedValueList':tmpFilterByColumns=[tmpFilterConfig.ExternalFilterTableLookupColumn||`ID${tmpFilterConfig.RemoteTable}`];// fall through
7261
7299
  case'InternalJoinMatch':case'InternalJoinStringMatch':case'InternalJoinDateMatch':case'InternalJoinNumericMatch':/*
7262
7300
  "Values": [ "Bob" ],
7263
7301
  "RemoteTable": "User",
@@ -7265,7 +7303,12 @@ case'InternalJoinMatch':case'InternalJoinStringMatch':case'InternalJoinDateMatch
7265
7303
  "JoinExternalConnectionColumn": "IDUser",
7266
7304
  "JoinInternalConnectionColumn": "CreatingIDUser",
7267
7305
  */if(!tmpFilterByColumns){tmpFilterByColumns=tmpFilterConfig.ExternalFilterByColumns||(tmpFilterConfig.ExternalFilterByColumn?[tmpFilterConfig.ExternalFilterByColumn]:['Name']);}for(const tmpField of tmpFilterByColumns){for(const tmpValue of tmpValuesArray){const tmpFilter={Index:0,Entity:tmpFilterConfig.RemoteTable,Instruction:'FBVOR',Field:tmpField};if(tmpFilterConfig.ExactMatch||typeof tmpFilterConfig.ExactMatch==='undefined'&&(tmpFilterConfig.Type=='InternalJoinNumericMatch'||tmpFilterConfig.Type=='InternalJoinDateMatch'||tmpFilterConfig.Type=='InternalJoinSelectedValue'||tmpFilterConfig.Type=='InternalJoinSelectedValueList')){//TODO: optimize this to use in-list, but requires restructuring of this code
7268
- tmpFilter.Operator='EQ';tmpFilter.Value=tmpValue;}else{tmpFilter.Operator='LK';tmpFilter.Value=`%25${tmpValue}%25`;}tmpFilterResult.Filters.push(tmpFilter);}}if(tmpFilterResult.Filters.length>0){if(!tmpFilterConfig.JoinInternalConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinInternalConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}tmpFilterResult.JoinConfig={Instruction:'FBLOR',CoreEntity:pFilterState.Entity,Fields:[tmpFilterConfig.JoinInternalConnectionColumn],Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.JoinExternalConnectionColumn}^Record.State[Step0]~}`};}break;case'RawFilter':if(!tmpFilterConfig.Value){this.log.warn(`RawFilter configuration missing Value, not adding filter.`,{FilterConfig:tmpFilterConfig});break;}pFilterState.UserFilters.push(tmpFilterConfig.Value);break;default:this.log.warn(`Unknown filter type ${tmpFilterConfig.Type} in filter configuration.`,{FilterConfig:tmpFilterConfig});}if(tmpFilterResult.Filters.length>0){if(tmpFilterConfig.GUIDGroup){if(groupedFilterStates[tmpFilterConfig.GUIDGroup]){groupedFilterStates[tmpFilterConfig.GUIDGroup].PreparedFilters.push(tmpFilterResult);}else{groupedFilterStates[tmpFilterConfig.GUIDGroup]={PreparedFilters:[tmpFilterResult],Junction:'AND',Ordinal:0};}}else{tmpResult.push(tmpFilterResult);}}}const sortSet=arr=>{for(let x=0;x<arr.length;x++){arr[x].Ordinal=arr[x].Ordinal||0;}return arr.sort((a,b)=>{if(a.Ordinal>b.Ordinal){return 1;}else if(b.Ordinal>a.Ordinal){return-1;}return 0;});};const spreadGroupings=arr=>{const outputSet=[];for(const group of arr){if(group.PreparedFilters){group.PreparedFilters[0].GroupOpen=true;group.PreparedFilters[0].GroupJunction=group.Junction;group.PreparedFilters[group.PreparedFilters.length-1].GroupClose=true;for(let x=0;x<group.PreparedFilters.length;x++){outputSet.push(group.PreparedFilters[x]);}}else{outputSet.push(group);}}return outputSet;};for(let g of Object.keys(groupedFilterStates)){var _groupedFilterStates$;if((_groupedFilterStates$=groupedFilterStates[g].PreparedFilters)!==null&&_groupedFilterStates$!==void 0&&_groupedFilterStates$.length){groupedFilterStates[g].PreparedFilters=sortSet(groupedFilterStates[g].PreparedFilters);}tmpResult.push(groupedFilterStates[g]);}tmpResult=spreadGroupings(sortSet(tmpResult));pFilterState.PreparedFilters=tmpResult;}/**
7306
+ tmpFilter.Operator='EQ';tmpFilter.Value=tmpValue;}else{tmpFilter.Operator='LK';tmpFilter.Value=`%25${tmpValue}%25`;}tmpFilterResult.Filters.push(tmpFilter);}}if(tmpFilterResult.Filters.length>0){if(!tmpFilterConfig.JoinInternalConnectionColumn){this.log.error(`${tmpFilterConfig.Type} filter missing JoinInternalConnectionColumn, cannot filter core table [${pFilterState.Entity}].`);break;}tmpFilterResult.JoinConfig={Instruction:'FBLOR',CoreEntity:pFilterState.Entity,Fields:[tmpFilterConfig.JoinInternalConnectionColumn],Operator:'INN',ValueTemplate:`{~PJU:,^${tmpFilterConfig.JoinExternalConnectionColumn}^Record.State[Step0]~}`};}break;case'RawFilter':if(!tmpFilterConfig.Value){this.log.warn(`RawFilter configuration missing Value, not adding filter.`,{FilterConfig:tmpFilterConfig});break;}pFilterState.UserFilters.push(tmpFilterConfig.Value);break;default:this.log.warn(`Unknown filter type ${tmpFilterConfig.Type} in filter configuration.`,{FilterConfig:tmpFilterConfig});}// Per-clause URLPrefix knob: the remote-table resolution requests (the join lookup
7307
+ // against RemoteTable) otherwise inherit the recordset entity provider's URLPrefix.
7308
+ // When a clause's remote entity lives at a different API root than the recordset
7309
+ // (e.g. a lake-backed recordset joining to a main-API entity), set URLPrefix on the
7310
+ // clause to resolve the join there. The core-entity (recordset) request is unaffected.
7311
+ if(tmpFilterConfig.URLPrefix){for(const tmpRemoteResolutionFilter of tmpFilterResult.Filters){tmpRemoteResolutionFilter.URLPrefix=tmpFilterConfig.URLPrefix;}}if(tmpFilterResult.Filters.length>0){if(tmpFilterConfig.GUIDGroup){if(groupedFilterStates[tmpFilterConfig.GUIDGroup]){groupedFilterStates[tmpFilterConfig.GUIDGroup].PreparedFilters.push(tmpFilterResult);}else{groupedFilterStates[tmpFilterConfig.GUIDGroup]={PreparedFilters:[tmpFilterResult],Junction:'AND',Ordinal:0};}}else{tmpResult.push(tmpFilterResult);}}}const sortSet=arr=>{for(let x=0;x<arr.length;x++){arr[x].Ordinal=arr[x].Ordinal||0;}return arr.sort((a,b)=>{if(a.Ordinal>b.Ordinal){return 1;}else if(b.Ordinal>a.Ordinal){return-1;}return 0;});};const spreadGroupings=arr=>{const outputSet=[];for(const group of arr){if(group.PreparedFilters){group.PreparedFilters[0].GroupOpen=true;group.PreparedFilters[0].GroupJunction=group.Junction;group.PreparedFilters[group.PreparedFilters.length-1].GroupClose=true;for(let x=0;x<group.PreparedFilters.length;x++){outputSet.push(group.PreparedFilters[x]);}}else{outputSet.push(group);}}return outputSet;};for(let g of Object.keys(groupedFilterStates)){var _groupedFilterStates$;if((_groupedFilterStates$=groupedFilterStates[g].PreparedFilters)!==null&&_groupedFilterStates$!==void 0&&_groupedFilterStates$.length){groupedFilterStates[g].PreparedFilters=sortSet(groupedFilterStates[g].PreparedFilters);}tmpResult.push(groupedFilterStates[g]);}tmpResult=spreadGroupings(sortSet(tmpResult));pFilterState.PreparedFilters=tmpResult;}/**
7269
7312
  * @param {FilterState} pFilterState
7270
7313
  */linkPreparedFilters(pFilterState){const tmpGroupedStanzas=[];for(const tmpPreparedFilter of pFilterState.PreparedFilters||[]){if(tmpPreparedFilter.JoinConfig){const tmpSubGroup=tmpPreparedFilter.Filters;const tmpJoinConfig=tmpPreparedFilter.JoinConfig;for(const tmpField of tmpJoinConfig.Fields||[]){const tmpStanza={Index:1,CoreEntity:true,Entity:tmpPreparedFilter.JoinConfig.CoreEntity,Instruction:tmpPreparedFilter.JoinConfig.Instruction||'FBVOR',Field:tmpField,Operator:tmpJoinConfig.Operator,Value:tmpJoinConfig.Value,ValueTemplate:tmpJoinConfig.ValueTemplate};tmpSubGroup.push(tmpStanza);}tmpGroupedStanzas.push(tmpSubGroup);}else{tmpGroupedStanzas.push(tmpPreparedFilter.Filters);}}return tmpGroupedStanzas;}/**
7271
7314
  * Generate a computed index for each filter in the meadow filter stanzas such that the overall address space is non-overlapping and stable.
@@ -7276,7 +7319,15 @@ tmpFilter.Operator='EQ';tmpFilter.Value=tmpValue;}else{tmpFilter.Operator='LK';t
7276
7319
  */compileMeadowFilterStanzas(pFilterState){const tmpBundleConfig=[];//TODO: mathematically solve the number line
7277
7320
  // planned synthesized syntax for running on the server
7278
7321
  // FBV-3_Author~Name~LK~%25Ann%25~FBL-2_BookAuthorJoin~IDAuthor~INN~{~PJU:,^State[Step-3]^IDAuthor~}~FBV-1~User~NameFirst~LK~%25Bob%25~FBVOR-1~User~NameLast~LK~%25Bob%25~FBV~CreateDate~GT~2023-01-01T00:00:00Z~FBV~CreateDate~LT~2024-01-01T00:00:00Z~FBL~IDBook~INN~{~PJU:,^State[Step-2]^IDBook~}
7279
- if(!pFilterState.Filter){pFilterState.Filter=`${pFilterState.Entity||'Unknown'}-${this.pict.getUUID()}`;}tmpBundleConfig.push({Type:'SetStateAddress',StateAddress:`Bundle[${pFilterState.Filter}]`});const tmpGroupedFilters={};const tmpGroupedFilterKeys=[];const tmpGroupedCoreFilters=[];const tmpGroupedCoreFilterKeys=[];let tmpCoreEntity;const tmpCoreFilterStrings=[];for(const tmpFilterGroup of pFilterState.PreparedFilters){for(const tmpFilter of tmpFilterGroup.Filters){if(tmpFilter.CoreEntity){tmpCoreEntity=tmpFilter.Entity;const tmpFilterGUID=`${tmpFilterGroup.GUID}-${tmpFilter.ComputedIndex}`;if(!tmpGroupedCoreFilterKeys.find(v=>v==tmpFilterGUID)){tmpGroupedCoreFilterKeys.push(tmpFilterGUID);}if(!tmpGroupedCoreFilters[tmpFilterGUID]){tmpGroupedCoreFilters[tmpFilterGUID]={Stanzas:[],ComputedIndex:tmpFilter.ComputedIndex,Entity:tmpFilter.Entity,Junction:tmpFilterGroup.Junction||'AND',GroupOpen:tmpFilterGroup.GroupOpen||false,GroupJunction:tmpFilterGroup.GroupJunction||'AND',GroupClose:tmpFilterGroup.GroupClose||false};}tmpGroupedCoreFilters[tmpFilterGUID].Stanzas.push(this._compileSimpleFilterToString(tmpFilter));}else{const tmpFilterGroupGUID=`${tmpFilterGroup.GUID}-${tmpFilter.ComputedIndex}`;if(!tmpGroupedFilterKeys.find(v=>v==tmpFilterGroupGUID)){tmpGroupedFilterKeys.push(tmpFilterGroupGUID);}if(!tmpGroupedFilters[tmpFilterGroupGUID]){tmpGroupedFilters[tmpFilterGroupGUID]={Stanzas:[],ComputedIndex:tmpFilter.ComputedIndex,Entity:tmpFilter.Entity};}tmpGroupedFilters[tmpFilterGroupGUID].Stanzas.push(this._compileSimpleFilterToString(tmpFilter));}}for(const tmpFilterGroupKey of tmpGroupedFilterKeys){tmpGroupedFilters[tmpFilterGroupKey].Stanzas=tmpGroupedFilters[tmpFilterGroupKey].Stanzas.filter(f=>f.length>0);if(tmpGroupedFilters[tmpFilterGroupKey].Stanzas.length>0){tmpBundleConfig.push({Type:'MeadowEntity',AllRecords:true,Entity:tmpGroupedFilters[tmpFilterGroupKey].Entity,Filter:tmpGroupedFilters[tmpFilterGroupKey].Stanzas.join('~'),Destination:`State[Step${tmpGroupedFilters[tmpFilterGroupKey].ComputedIndex}]`});}}}for(const tmpCoreFilterKey of tmpGroupedCoreFilterKeys){tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas=tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas.filter(f=>f.length>0);if(tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas.length>0){let stringConstruct='';if(tmpGroupedCoreFilters[tmpCoreFilterKey].GroupOpen){stringConstruct+=tmpGroupedCoreFilters[tmpCoreFilterKey].GroupJunction=='OR'?'FOPOR~0~(~0~':'FOP~0~(~0~';}stringConstruct+=[tmpGroupedCoreFilters[tmpCoreFilterKey].Junction=='OR'?'FOPOR~0~(~0':'FOP~0~(~0',...tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas,'FCP~0~)~0'].join('~');if(tmpGroupedCoreFilters[tmpCoreFilterKey].GroupClose){stringConstruct+='~FCP~0~)~0';}tmpCoreFilterStrings.push(stringConstruct);}}if(!tmpCoreEntity){tmpCoreEntity=pFilterState.Entity;}const tmpCoreLoadStep={Type:pFilterState.Mode==='Count'?'MeadowEntityCount':'MeadowEntity',Entity:tmpCoreEntity,Filter:tmpCoreFilterStrings.join('~'),AllRecords:typeof pFilterState.PageSize==='undefined',RecordStartCursor:pFilterState.RecordOffset,Postfix:pFilterState.Postfix||'',Scope:pFilterState.Scope||'',Projection:pFilterState.Projection,PageSize:pFilterState.PageSize,Destination:pFilterState.ResultDestinationAddress};if(pFilterState.UserFilters.length>0){let tmpAllSorts='';let tmpFilter='';for(const tmpUserFilter of pFilterState.UserFilters){let tmpSorts;let tmpSanitizedUserFilter=tmpUserFilter;if(pFilterState.Mode==='Count'){tmpSanitizedUserFilter=this._sanitizeFilterForCount(tmpUserFilter);}else{var _this$_extractSortsFr=this._extractSortsFromFilter(tmpUserFilter);var _this$_extractSortsFr2=_slicedToArray(_this$_extractSortsFr,2);tmpSanitizedUserFilter=_this$_extractSortsFr2[0];tmpSorts=_this$_extractSortsFr2[1];if(tmpSorts){if(tmpAllSorts.length>0){tmpAllSorts+='~';}tmpAllSorts+=tmpSorts;}if(!tmpSanitizedUserFilter){continue;}}if(!tmpSanitizedUserFilter){continue;}if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+='FOP~0~(~0~';tmpFilter+=tmpSanitizedUserFilter;tmpFilter+='~FCP~0~)~0';}if(tmpCoreLoadStep.Filter){if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+='FOP~0~(~0~';tmpFilter+=tmpCoreLoadStep.Filter;tmpFilter+='~FCP~0~)~0';}if(tmpAllSorts){if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+=tmpAllSorts;}tmpCoreLoadStep.Filter=tmpFilter;}tmpBundleConfig.push(tmpCoreLoadStep);pFilterState.BundleConfig=tmpBundleConfig;}/**
7322
+ if(!pFilterState.Filter){pFilterState.Filter=`${pFilterState.Entity||'Unknown'}-${this.pict.getUUID()}`;}tmpBundleConfig.push({Type:'SetStateAddress',StateAddress:`Bundle[${pFilterState.Filter}]`});const tmpGroupedFilters={};const tmpGroupedFilterKeys=[];const tmpGroupedCoreFilters=[];const tmpGroupedCoreFilterKeys=[];let tmpCoreEntity;const tmpCoreFilterStrings=[];for(const tmpFilterGroup of pFilterState.PreparedFilters){for(const tmpFilter of tmpFilterGroup.Filters){if(tmpFilter.CoreEntity){tmpCoreEntity=tmpFilter.Entity;const tmpFilterGUID=`${tmpFilterGroup.GUID}-${tmpFilter.ComputedIndex}`;if(!tmpGroupedCoreFilterKeys.find(v=>v==tmpFilterGUID)){tmpGroupedCoreFilterKeys.push(tmpFilterGUID);}if(!tmpGroupedCoreFilters[tmpFilterGUID]){tmpGroupedCoreFilters[tmpFilterGUID]={Stanzas:[],ComputedIndex:tmpFilter.ComputedIndex,Entity:tmpFilter.Entity,Junction:tmpFilterGroup.Junction||'AND',GroupOpen:tmpFilterGroup.GroupOpen||false,GroupJunction:tmpFilterGroup.GroupJunction||'AND',GroupClose:tmpFilterGroup.GroupClose||false};}tmpGroupedCoreFilters[tmpFilterGUID].Stanzas.push(this._compileSimpleFilterToString(tmpFilter));}else{const tmpFilterGroupGUID=`${tmpFilterGroup.GUID}-${tmpFilter.ComputedIndex}`;if(!tmpGroupedFilterKeys.find(v=>v==tmpFilterGroupGUID)){tmpGroupedFilterKeys.push(tmpFilterGroupGUID);}if(!tmpGroupedFilters[tmpFilterGroupGUID]){tmpGroupedFilters[tmpFilterGroupGUID]={Stanzas:[],ComputedIndex:tmpFilter.ComputedIndex,Entity:tmpFilter.Entity,URLPrefix:tmpFilter.URLPrefix};}tmpGroupedFilters[tmpFilterGroupGUID].Stanzas.push(this._compileSimpleFilterToString(tmpFilter));}}for(const tmpFilterGroupKey of tmpGroupedFilterKeys){tmpGroupedFilters[tmpFilterGroupKey].Stanzas=tmpGroupedFilters[tmpFilterGroupKey].Stanzas.filter(f=>f.length>0);if(tmpGroupedFilters[tmpFilterGroupKey].Stanzas.length>0){tmpBundleConfig.push({Type:'MeadowEntity',AllRecords:true,Entity:tmpGroupedFilters[tmpFilterGroupKey].Entity,URLPrefix:tmpGroupedFilters[tmpFilterGroupKey].URLPrefix,Filter:tmpGroupedFilters[tmpFilterGroupKey].Stanzas.join('~'),Destination:`State[Step${tmpGroupedFilters[tmpFilterGroupKey].ComputedIndex}]`});}}}for(const tmpCoreFilterKey of tmpGroupedCoreFilterKeys){tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas=tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas.filter(f=>f.length>0);if(tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas.length>0){let stringConstruct='';if(tmpGroupedCoreFilters[tmpCoreFilterKey].GroupOpen){stringConstruct+=tmpGroupedCoreFilters[tmpCoreFilterKey].GroupJunction=='OR'?'FOPOR~0~(~0~':'FOP~0~(~0~';}stringConstruct+=[tmpGroupedCoreFilters[tmpCoreFilterKey].Junction=='OR'?'FOPOR~0~(~0':'FOP~0~(~0',...tmpGroupedCoreFilters[tmpCoreFilterKey].Stanzas,'FCP~0~)~0'].join('~');if(tmpGroupedCoreFilters[tmpCoreFilterKey].GroupClose){stringConstruct+='~FCP~0~)~0';}tmpCoreFilterStrings.push(stringConstruct);}}if(!tmpCoreEntity){tmpCoreEntity=pFilterState.Entity;}const tmpCoreLoadStep={Type:pFilterState.Mode==='Count'?'MeadowEntityCount':'MeadowEntity',Entity:tmpCoreEntity,Filter:tmpCoreFilterStrings.join('~'),AllRecords:typeof pFilterState.PageSize==='undefined',RecordStartCursor:pFilterState.RecordOffset,Postfix:pFilterState.Postfix||'',Scope:pFilterState.Scope||'',Projection:pFilterState.Projection,PageSize:pFilterState.PageSize,Destination:pFilterState.ResultDestinationAddress};if(pFilterState.UserFilters.length>0){let tmpAllSorts='';let tmpFilter='';for(const tmpUserFilter of pFilterState.UserFilters){let tmpSorts;let tmpSanitizedUserFilter=tmpUserFilter;if(pFilterState.Mode==='Count'){tmpSanitizedUserFilter=this._sanitizeFilterForCount(tmpUserFilter);}else{var _this$_extractSortsFr=this._extractSortsFromFilter(tmpUserFilter);var _this$_extractSortsFr2=_slicedToArray(_this$_extractSortsFr,2);tmpSanitizedUserFilter=_this$_extractSortsFr2[0];tmpSorts=_this$_extractSortsFr2[1];if(tmpSorts){if(tmpAllSorts.length>0){tmpAllSorts+='~';}tmpAllSorts+=tmpSorts;}if(!tmpSanitizedUserFilter){continue;}}if(!tmpSanitizedUserFilter){continue;}if(tmpFilter.length>0){tmpFilter+='~';}// The user-filter and core-filter strings already carry their
7323
+ // own paren grouping from the per-group serializer above (the
7324
+ // `FOP(stanzas)` wrap at line 822). Wrapping a SECOND time here
7325
+ // produces `FOP(FOP(...))` which meadow-endpoints'
7326
+ // MeadowEndpoints dialect (used by the lake's
7327
+ // /PrivateDataLake/* routes) treats as malformed — the route
7328
+ // 404s instead of filtering. The right shape is one paren per
7329
+ // logical group, concatenated flat at the top level.
7330
+ tmpFilter+=tmpSanitizedUserFilter;}if(tmpCoreLoadStep.Filter){if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+=tmpCoreLoadStep.Filter;}if(tmpAllSorts){if(tmpFilter.length>0){tmpFilter+='~';}tmpFilter+=tmpAllSorts;}tmpCoreLoadStep.Filter=tmpFilter;}tmpBundleConfig.push(tmpCoreLoadStep);pFilterState.BundleConfig=tmpBundleConfig;}/**
7280
7331
  * @param {string} pFilter
7281
7332
  *
7282
7333
  * @return {string}