pict 1.0.194 → 1.0.196

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.
@@ -1387,7 +1387,7 @@ var tmpResult=tmpDegreesArbitraryValue.times(Math.PI).div(180);return tmpResult.
1387
1387
  * Precedent Meta-Templating
1388
1388
  * @author Steven Velozo <steven@velozo.com>
1389
1389
  * @description Process text stream trie and postfix tree, parsing out meta-template expression functions.
1390
- */var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase7){function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this29;_classCallCheck2(this,FableServiceMetaTemplate);_this29=_callSuper(this,FableServiceMetaTemplate,[pFable,pOptions,pServiceHash]);_this29.serviceType='MetaTemplate';_this29.WordTree=new libWordTree();_this29.StringParser=new libStringParser(_this29.fable);_this29.ParseTree=_this29.WordTree.ParseTree;return _this29;}_inherits(FableServiceMetaTemplate,_libFableServiceBase7);return _createClass2(FableServiceMetaTemplate,[{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,pParser,pParserContext){return this.WordTree.addPattern(pPatternStart,pPatternEnd,pParser,pParserContext);}},{key:"addPatternAsync",value:function addPatternAsync(pPatternStart,pPatternEnd,pParserPromise,pParserContext){return this.WordTree.addPatternAsync(pPatternStart,pPatternEnd,pParserPromise,pParserContext);}},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext){return this.WordTree.addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext);}/**
1390
+ */var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase7){function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this29;_classCallCheck2(this,FableServiceMetaTemplate);_this29=_callSuper(this,FableServiceMetaTemplate,[pFable,pOptions,pServiceHash]);_this29.serviceType='MetaTemplate';_this29.WordTree=new libWordTree();_this29.StringParser=new libStringParser(_this29.fable);_this29.ParseTree=_this29.WordTree.ParseTree;return _this29;}_inherits(FableServiceMetaTemplate,_libFableServiceBase7);return _createClass2(FableServiceMetaTemplate,[{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,pParser,pParserContext){return this.WordTree.addPattern(pPatternStart,pPatternEnd,pParser,pParserContext);}},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext){return this.WordTree.addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext);}/**
1391
1391
  * Parse a string with the existing parse tree
1392
1392
  * @method parseString
1393
1393
  * @param {string} pString - The string to parse
@@ -1432,22 +1432,21 @@ if(pParserState.PatternMatch){// If the pattern is still matching the start and
1432
1432
  if(!pParserState.StartPatternMatchComplete&&pCharacter in pParserState.Pattern){pParserState.Pattern=pParserState.Pattern[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else if(pParserState.EndPatternMatchBegan){if(pCharacter in pParserState.Pattern.PatternEnd){// This leaf has a PatternEnd tree, so we will wait until that end is met.
1433
1433
  pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// Flush the output buffer.
1434
1434
  this.appendOutputBuffer(pCharacter,pParserState);// If this last character is the end of the pattern, parse it.
1435
- if('Parse'in pParserState.Pattern&&(!pParserState.Pattern.isAsync||pParserState.Pattern.isBoth)){// Run the function
1436
- var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}return this.resetOutputBuffer(pParserState);}else{this.fable.log.info("MetaTemplate: The pattern ".concat(pParserState.Pattern.PatternStartString," is asynchronous and cannot be used in a synchronous parser."));return this.resetOutputBuffer(pParserState);}}else if(pCharacter in pParserState.PatternStartNode.PatternEnd){// We broke out of the end -- see if this is a new start of the end.
1435
+ // Run the function
1436
+ var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}return this.resetOutputBuffer(pParserState);}else if(pCharacter in pParserState.PatternStartNode.PatternEnd){// We broke out of the end -- see if this is a new start of the end.
1437
1437
  pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{pParserState.EndPatternMatchBegan=false;this.appendOutputBuffer(pCharacter,pParserState);}}else if('PatternEnd'in pParserState.Pattern){if(!pParserState.StartPatternMatchComplete){pParserState.StartPatternMatchComplete=true;pParserState.PatternStartNode=pParserState.Pattern;}this.appendOutputBuffer(pCharacter,pParserState);if(pCharacter in pParserState.Pattern.PatternEnd){// This is the first character of the end pattern.
1438
1438
  pParserState.EndPatternMatchBegan=true;// This leaf has a PatternEnd tree, so we will wait until that end is met.
1439
1439
  pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// If this last character is the end of the pattern, parse it.
1440
- if('Parse'in pParserState.Pattern){if(pParserState.Pattern.isAsync&&!pParserState.Pattern.isBoth){this.fable.log.info("MetaTemplate: The pattern ".concat(pParserState.Pattern.PatternStartString," is asynchronous and cannot be used in a synchronous parser."));this.resetOutputBuffer(pParserState);}else{// Run the t*mplate function
1441
- var _tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(_tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}return this.resetOutputBuffer(pParserState);}}}}else{// We are in a pattern start but didn't match one; reset and start trying again from this character.
1440
+ if('Parse'in pParserState.Pattern){// Run the t*mplate function
1441
+ var _tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(_tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}return this.resetOutputBuffer(pParserState);}}}else{// We are in a pattern start but didn't match one; reset and start trying again from this character.
1442
1442
  this.resetOutputBuffer(pParserState);}}// If we aren't in a pattern match or pattern, and this isn't the start of a new pattern (RAW mode)....
1443
1443
  if(!pParserState.PatternMatch){// This may be the start of a new pattern....
1444
1444
  if(pCharacter in pParserState.ParseTree){// ... assign the root node as the matched node.
1445
1445
  this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserState);pParserState.Pattern=pParserState.ParseTree[pCharacter];pParserState.PatternMatch=true;return true;}else{this.appendOutputBuffer(pCharacter,pParserState);}}return false;}},{key:"executePatternAsync",value:function executePatternAsync(pParserState,pData,fCallback,pDataContext){var _this30=this;// ... this is the end of a pattern, cut off the end tag and parse it.
1446
1446
  // Trim the start and end tags off the output buffer now
1447
- if(pParserState.Pattern.isAsync&&!pParserState.Pattern.isBoth){// Run the function
1448
- var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){return pParserState.Pattern.Parse.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this30.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this30.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{return pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this30.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this30.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else if(pParserState.Pattern.isAsync&&pParserState.Pattern.isBoth){// Run the function when both async and non async were provided with the pattern
1449
- var _tmpFunctionContext2='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext2){return pParserState.Pattern.ParseAsync.call(_tmpFunctionContext2,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this30.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this30.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this30.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this30.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else{// Run the t*mplate function
1450
- var _tmpFunctionContext3='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext3){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(_tmpFunctionContext3,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}this.resetOutputBuffer(pParserState);return fCallback();}}/**
1447
+ if(pParserState.Pattern.isAsync){// Run the function
1448
+ var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){return pParserState.Pattern.ParseAsync.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this30.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this30.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this30.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this30.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else{// Run the t*mplate function
1449
+ var _tmpFunctionContext2='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext2){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(_tmpFunctionContext2,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}this.resetOutputBuffer(pParserState);return fCallback();}}/**
1451
1450
  * Parse a character in the buffer.
1452
1451
  * @method parseCharacterAsync
1453
1452
  * @param {string} pCharacter - The character to append
@@ -1503,28 +1502,23 @@ _this31.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserSta
1503
1502
  * @param {string} pPattern - The string to add to the tree
1504
1503
  * @returns {Object} The resulting leaf node that was added (or found)
1505
1504
  * @private
1506
- */},{key:"addEndChild",value:function addEndChild(pTree,pPattern){if(!('PatternEnd'in pTree)){pTree.PatternEnd={};}pTree.PatternEnd[pPattern]={};return pTree.PatternEnd[pPattern];}/** Add a Pattern to the Parse Tree
1507
- * @method addPattern
1505
+ */},{key:"addEndChild",value:function addEndChild(pTree,pPattern){if(!('PatternEnd'in pTree)){pTree.PatternEnd={};}pTree.PatternEnd[pPattern]={};return pTree.PatternEnd[pPattern];}/** Add a Pattern to the Parse Tree with both function parameter types
1506
+ * @method addPatternAll
1508
1507
  * @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
1509
1508
  * @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
1510
1509
  * @param {function} fParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
1511
- * @return {bool} True if adding the pattern was successful
1512
- */},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){if(pPatternStart.length<1){return false;}if(typeof pPatternEnd==='string'&&pPatternEnd.length<1){return false;}var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
1513
- for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!('PatternEnd'in tmpLeaf)){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i16=0;_i16<tmpPatternEnd.length;_i16++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i16],_i16);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(){return fParser;}:function(pData){return pData;};// A "this" for every object
1514
- if(pParserContext){tmpLeaf.ParserContext=pParserContext;}return tmpLeaf;}/** Add a Pattern to the Parse Tree
1515
- * @method addPatternAsync
1516
- * @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
1517
- * @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
1518
1510
  * @param {function} fParserAsync - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
1519
- * @return {bool} True if adding the pattern was successful
1520
- */},{key:"addPatternAsync",value:function addPatternAsync(pPatternStart,pPatternEnd,fParserAsync,pParserContext){var tmpLeaf=this.addPattern(pPatternStart,pPatternEnd,fParserAsync,pParserContext);if(tmpLeaf){tmpLeaf.isAsync=true;}}/** Add a Pattern to the Parse Tree
1521
- * @method addPatternBoth
1511
+ * @param {Object} pParserContext - The context to pass to the parser function
1512
+ * @return {Object} The leaf parser from the tree
1513
+ */},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,fParser,fParserAsync,pParserContext){if(pPatternStart.length<1){return false;}if(typeof pPatternEnd==='string'&&pPatternEnd.length<1){return false;}var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
1514
+ for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!('PatternEnd'in tmpLeaf)){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i16=0;_i16<tmpPatternEnd.length;_i16++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i16],_i16);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(pHash,pData){return fParser;}:function(pHash,pData){return pHash;};tmpLeaf.ParseAsync=typeof fParserAsync==='function'?fParserAsync:typeof fParserAsync==='string'?function(pHash,pData,fCallback){return fCallback(null,fParserAsync);}:function(pHash,pData,fCallback){return fCallback(null,tmpLeaf.Parse(pHash,pData));};// A "this" for every object
1515
+ if(pParserContext){tmpLeaf.ParserContext=pParserContext;}tmpLeaf.isAsync=true;return tmpLeaf;}/** Add a Pattern to the Parse Tree with both function parameter types
1516
+ * @method addPatternAll
1522
1517
  * @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
1523
1518
  * @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
1524
1519
  * @param {function} fParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
1525
- * @return {bool} True if adding the pattern was successful
1526
- */},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,fParser,fParserAsync,pParserContext){var tmpLeaf=this.addPattern(pPatternStart,pPatternEnd,fParser,pParserContext);if(tmpLeaf){tmpLeaf.isAsync=true;tmpLeaf.isBoth=true;// When a leaf has both async and non-async versions of the functions, we store the async in fParserAsync.
1527
- tmpLeaf.ParseAsync=fParserAsync;}}}]);}();module.exports=WordTree;},{}],79:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":0},"Steps":[],"Errors":[],"Log":[]};},{}],80:[function(require,module,exports){var _require4=require('big.js'),PE=_require4.PE;var libFableServiceBase=require('fable-serviceproviderbase');var _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));var FableOperation=/*#__PURE__*/function(_libFableServiceBase8){function FableOperation(pFable,pOptions,pServiceHash){var _this32;_classCallCheck2(this,FableOperation);_this32=_callSuper(this,FableOperation,[pFable,pOptions,pServiceHash]);// Timestamps will just be the long ints
1520
+ * @param {Object} pParserContext - The context to pass to the parser function
1521
+ */},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}]);}();module.exports=WordTree;},{}],79:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":0},"Steps":[],"Errors":[],"Log":[]};},{}],80:[function(require,module,exports){var _require4=require('big.js'),PE=_require4.PE;var libFableServiceBase=require('fable-serviceproviderbase');var _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));var FableOperation=/*#__PURE__*/function(_libFableServiceBase8){function FableOperation(pFable,pOptions,pServiceHash){var _this32;_classCallCheck2(this,FableOperation);_this32=_callSuper(this,FableOperation,[pFable,pOptions,pServiceHash]);// Timestamps will just be the long ints
1528
1522
  _this32.timeStamps={};_this32.serviceType='PhasedOperation';_this32.state=JSON.parse(_OperationStatePrototypeString);_this32.stepMap={};_this32.stepFunctions={};// Match the service instantiation to the operation.
1529
1523
  _this32.state.Metadata.Hash=_this32.Hash;_this32.state.Metadata.UUID=_this32.UUID;_this32.state.Metadata.Name=typeof _this32.options.Name=='string'?_this32.options.Name:"Unnamed Operation ".concat(_this32.state.Metadata.UUID);_this32.name=_this32.state.Metadata.Name;_this32.progressTrackerSet=_this32.fable.instantiateServiceProviderWithoutRegistration('ProgressTrackerSet');_this32.state.OverallProgressTracker=_this32.progressTrackerSet.createProgressTracker("Overall-".concat(_this32.state.Metadata.UUID));// This is here to use the pass-through logging functions in the operation itself.
1530
1524
  _this32.log=_this32;return _this32;}_inherits(FableOperation,_libFableServiceBase8);return _createClass2(FableOperation,[{key:"execute",value:function execute(fExecutionCompleteCallback){var _this33=this;// TODO: Should the same operation be allowed to execute more than one time?
@@ -4519,7 +4513,7 @@ if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not reso
4519
4513
  return this.pict.parseTemplateSetByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateHash,tmpData,null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateValueSetRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateValueSetRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash=false;var tmpAddressOfData=false;// This is a 3 part hash with the map address and the key address both
4520
4514
  var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this.log.trace("PICT TemplateFromMap [fTemplateRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return fCallback(null,'');}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfData=tmpTemplateHashPart[1];// No TemplateFromMap hash
4521
4515
  if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
4522
- tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i]});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var _i51=0;_i51<tmpValueKeys.length;_i51++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i51]]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
4516
+ tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var _i51=0;_i51<tmpValueKeys.length;_i51++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i51]],Key:tmpData[tmpValueKeys[_i51]]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
4523
4517
  // The async portion of this is a mind bender because of how entry can happen dynamically from templates
4524
4518
  return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateValueSet;},{"../Pict-Template.js":167}],178:[function(require,module,exports){var libPictTemplate=require('../../Pict-Template.js');var PictTemplateProviderRandomNumber=/*#__PURE__*/function(_libPictTemplate8){/**
4525
4519
  * @param {Object} pFable - The Fable Framework instance