pict 1.0.369 → 1.0.371
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 +427 -271
- package/dist/pict.js.map +1 -1
- package/dist/pict.min.js +2 -2
- package/dist/pict.min.js.map +1 -1
- package/package.json +3 -3
- package/source/Pict-Meadow-EntityProvider.js +126 -0
- package/source/Pict.js +9 -0
- package/source/templates/Pict-Template-AddressedTemplate.js +156 -0
- package/source/templates/Pict-Template-Function.js +118 -0
- package/source/templates/Pict-Template-InlineTemplate.js +111 -0
- package/types/source/Pict-Meadow-EntityProvider.d.ts +11 -0
- package/types/source/Pict-Meadow-EntityProvider.d.ts.map +1 -1
- package/types/source/Pict.d.ts +11 -0
- package/types/source/Pict.d.ts.map +1 -1
- package/types/source/providers/Pict-Icons-Base.d.ts +73 -0
- package/types/source/providers/Pict-Icons-Base.d.ts.map +1 -0
- package/types/source/providers/Provider-Icon.d.ts +70 -0
- package/types/source/providers/Provider-Icon.d.ts.map +1 -0
- package/types/source/templates/Pict-Template-AddressedTemplate.d.ts +32 -0
- package/types/source/templates/Pict-Template-AddressedTemplate.d.ts.map +1 -0
- package/types/source/templates/Pict-Template-Function.d.ts +36 -0
- package/types/source/templates/Pict-Template-Function.d.ts.map +1 -0
- package/types/source/templates/Pict-Template-Icon.d.ts +36 -0
- package/types/source/templates/Pict-Template-Icon.d.ts.map +1 -0
- package/types/source/templates/Pict-Template-InlineTemplate.d.ts +29 -0
- package/types/source/templates/Pict-Template-InlineTemplate.d.ts.map +1 -0
- package/dist/indoctrinate_content_staging/Indoctrinate-Catalog-AppData.json +0 -13103
package/dist/pict.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";function _defineProperty2(e,r,t){return(r=_toPropertyKey2(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey2(t){var i=_toPrimitive2(t,"string");return"symbol"==typeof i?i:i+"";}function _toPrimitive2(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f();}else if(typeof define==="function"&&define.amd){define([],f);}else{var g;if(typeof window!=="undefined"){g=window;}else if(typeof global!=="undefined"){g=global;}else if(typeof self!=="undefined"){g=self;}else{g=this;}g.Pict=f();}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a;}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r);},p,p.exports,r,e,n,t);}return n[i].exports;}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o;}return r;}()({1:[function(require,module,exports){'use strict';var eachOfLimit=require('async.util.eachoflimit');var withoutIndex=require('async.util.withoutindex');module.exports=function eachLimit(arr,limit,iterator,cb){return eachOfLimit(limit)(arr,withoutIndex(iterator),cb);};},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(require,module,exports){'use strict';module.exports=function(tasks){function makeCallback(index){function fn(){if(tasks.length){tasks[index].apply(null,arguments);}return fn.next();}fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null;};return fn;}return makeCallback(0);};},{}],3:[function(require,module,exports){var once=require('async.util.once');var noop=require('async.util.noop');var onlyOnce=require('async.util.onlyonce');var keyIterator=require('async.util.keyiterator');module.exports=function eachOfLimit(limit){return function(obj,iterator,cb){cb=once(cb||noop);obj=obj||[];var nextKey=keyIterator(obj);if(limit<=0){return cb(null);}var done=false;var running=0;var errored=false;(function replenish(){if(done&&running<=0){return cb(null);}while(running<limit&&!errored){var key=nextKey();if(key===null){done=true;if(running<=0){cb(null);}return;}running+=1;iterator(obj[key],key,onlyOnce(function(err){running-=1;if(err){cb(err);errored=true;}else{replenish();}}));}})();};};},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(require,module,exports){'use strict';var setImmediate=require('async.util.setimmediate');var restParam=require('async.util.restparam');module.exports=function(fn){return restParam(function(args){var callback=args.pop();args.push(function(){var innerArgs=arguments;if(sync){setImmediate(function(){callback.apply(null,innerArgs);});}else{callback.apply(null,innerArgs);}});var sync=true;fn.apply(this,args);sync=false;});};},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(require,module,exports){'use strict';module.exports=Array.isArray||function isArray(obj){return Object.prototype.toString.call(obj)==='[object Array]';};},{}],6:[function(require,module,exports){'use strict';var isArray=require('async.util.isarray');module.exports=function isArrayLike(arr){return isArray(arr)||// has a positive integer length property
|
|
1
|
+
"use strict";function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _defineProperty2(e,r,t){return(r=_toPropertyKey2(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey2(t){var i=_toPrimitive2(t,"string");return"symbol"==typeof i?i:i+"";}function _toPrimitive2(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f();}else if(typeof define==="function"&&define.amd){define([],f);}else{var g;if(typeof window!=="undefined"){g=window;}else if(typeof global!=="undefined"){g=global;}else if(typeof self!=="undefined"){g=self;}else{g=this;}g.Pict=f();}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a;}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r);},p,p.exports,r,e,n,t);}return n[i].exports;}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o;}return r;}()({1:[function(require,module,exports){'use strict';var eachOfLimit=require('async.util.eachoflimit');var withoutIndex=require('async.util.withoutindex');module.exports=function eachLimit(arr,limit,iterator,cb){return eachOfLimit(limit)(arr,withoutIndex(iterator),cb);};},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(require,module,exports){'use strict';module.exports=function(tasks){function makeCallback(index){function fn(){if(tasks.length){tasks[index].apply(null,arguments);}return fn.next();}fn.next=function(){return index<tasks.length-1?makeCallback(index+1):null;};return fn;}return makeCallback(0);};},{}],3:[function(require,module,exports){var once=require('async.util.once');var noop=require('async.util.noop');var onlyOnce=require('async.util.onlyonce');var keyIterator=require('async.util.keyiterator');module.exports=function eachOfLimit(limit){return function(obj,iterator,cb){cb=once(cb||noop);obj=obj||[];var nextKey=keyIterator(obj);if(limit<=0){return cb(null);}var done=false;var running=0;var errored=false;(function replenish(){if(done&&running<=0){return cb(null);}while(running<limit&&!errored){var key=nextKey();if(key===null){done=true;if(running<=0){cb(null);}return;}running+=1;iterator(obj[key],key,onlyOnce(function(err){running-=1;if(err){cb(err);errored=true;}else{replenish();}}));}})();};};},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(require,module,exports){'use strict';var setImmediate=require('async.util.setimmediate');var restParam=require('async.util.restparam');module.exports=function(fn){return restParam(function(args){var callback=args.pop();args.push(function(){var innerArgs=arguments;if(sync){setImmediate(function(){callback.apply(null,innerArgs);});}else{callback.apply(null,innerArgs);}});var sync=true;fn.apply(this,args);sync=false;});};},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(require,module,exports){'use strict';module.exports=Array.isArray||function isArray(obj){return Object.prototype.toString.call(obj)==='[object Array]';};},{}],6:[function(require,module,exports){'use strict';var isArray=require('async.util.isarray');module.exports=function isArrayLike(arr){return isArray(arr)||// has a positive integer length property
|
|
2
2
|
typeof arr.length==='number'&&arr.length>=0&&arr.length%1===0;};},{"async.util.isarray":5}],7:[function(require,module,exports){'use strict';var _keys=require('async.util.keys');var isArrayLike=require('async.util.isarraylike');module.exports=function keyIterator(coll){var i=-1;var len;var keys;if(isArrayLike(coll)){len=coll.length;return function next(){i++;return i<len?i:null;};}else{keys=_keys(coll);len=keys.length;return function next(){i++;return i<len?keys[i]:null;};}};},{"async.util.isarraylike":6,"async.util.keys":8}],8:[function(require,module,exports){'use strict';module.exports=Object.keys||function keys(obj){var _keys=[];for(var k in obj){if(obj.hasOwnProperty(k)){_keys.push(k);}}return _keys;};},{}],9:[function(require,module,exports){'use strict';module.exports=function noop(){};},{}],10:[function(require,module,exports){'use strict';module.exports=function once(fn){return function(){if(fn===null)return;fn.apply(this,arguments);fn=null;};};},{}],11:[function(require,module,exports){'use strict';module.exports=function only_once(fn){return function(){if(fn===null)throw new Error('Callback was already called.');fn.apply(this,arguments);fn=null;};};},{}],12:[function(require,module,exports){'use strict';module.exports=function restParam(func,startIndex){startIndex=startIndex==null?func.length-1:+startIndex;return function(){var length=Math.max(arguments.length-startIndex,0);var rest=new Array(length);for(var index=0;index<length;index++){rest[index]=arguments[index+startIndex];}switch(startIndex){case 0:return func.call(this,rest);case 1:return func.call(this,arguments[0],rest);}};};},{}],13:[function(require,module,exports){(function(setImmediate){(function(){'use strict';var _setImmediate=typeof setImmediate==='function'&&setImmediate;var fallback=function(fn){setTimeout(fn,0);};module.exports=function setImmediate(fn){// not a direct alias for IE10 compatibility
|
|
3
|
-
return(_setImmediate||fallback)(fn);};}).call(this);}).call(this,require("timers").setImmediate);},{"timers":
|
|
3
|
+
return(_setImmediate||fallback)(fn);};}).call(this);}).call(this,require("timers").setImmediate);},{"timers":186}],14:[function(require,module,exports){'use strict';module.exports=function withoutIndex(iterator){return function(value,index,callback){return iterator(value,callback);};};},{}],15:[function(require,module,exports){'use strict';var once=require('async.util.once');var noop=require('async.util.noop');var isArray=require('async.util.isarray');var restParam=require('async.util.restparam');var ensureAsync=require('async.util.ensureasync');var iterator=require('async.iterator');module.exports=function(tasks,cb){cb=once(cb||noop);if(!isArray(tasks))return cb(new Error('First argument to waterfall must be an array of functions'));if(!tasks.length)return cb();function wrapIterator(iterator){return restParam(function(err,args){if(err){cb.apply(null,[err].concat(args));}else{var next=iterator.next();if(next){args.push(wrapIterator(next));}else{args.push(cb);}ensureAsync(iterator).apply(null,args);}});}wrapIterator(iterator(tasks))();};},{"async.iterator":2,"async.util.ensureasync":4,"async.util.isarray":5,"async.util.noop":9,"async.util.once":10,"async.util.restparam":12}],16:[function(require,module,exports){'use strict';exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=='undefined'?Uint8Array:Array;var code='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';for(var i=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i;}// Support decoding URL-safe base64 strings, as Node.js does.
|
|
4
4
|
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
5
5
|
revLookup['-'.charCodeAt(0)]=62;revLookup['_'.charCodeAt(0)]=63;function getLens(b64){var len=b64.length;if(len%4>0){throw new Error('Invalid string. Length must be a multiple of 4');}// Trim off extra bytes after placeholder bytes are found
|
|
6
6
|
// See: https://github.com/beatgammit/base64-js/issues/42
|
|
@@ -625,7 +625,7 @@ for(i=listeners.length-1;i>=0;i--){this.removeListener(type,listeners[i]);}}retu
|
|
|
625
625
|
// EventEmitters, we do not listen for `error` events here.
|
|
626
626
|
emitter.addEventListener(name,function wrapListener(arg){// IE does not have builtin `{ once: true }` support so we
|
|
627
627
|
// have to do it manually.
|
|
628
|
-
if(flags.once){emitter.removeEventListener(name,wrapListener);}listener(arg);});}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof emitter);}}},{}],51:[function(require,module,exports){module.exports={"
|
|
628
|
+
if(flags.once){emitter.removeEventListener(name,wrapListener);}listener(arg);});}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof emitter);}}},{}],51:[function(require,module,exports){module.exports={"_from":"fable-log@^3.0.18","_id":"fable-log@3.0.18","_inBundle":false,"_integrity":"sha512-VGLVuqpHGd2RzohnzwN7k1IAr5kSuhaNg3i2tC/4ibPnaYJ0ICpIXXoCsnw/WABGgmfq2ICJ4I7XlB654Du4nQ==","_location":"/fable-log","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"fable-log@^3.0.18","name":"fable-log","escapedName":"fable-log","rawSpec":"^3.0.18","saveSpec":null,"fetchSpec":"^3.0.18"},"_requiredBy":["/fable"],"_resolved":"https://registry.npmjs.org/fable-log/-/fable-log-3.0.18.tgz","_shasum":"4f9ceb33c01b53d380d15e12fe64aa90f1ddce8c","_spec":"fable-log@^3.0.18","_where":"/Users/jacksonpollard/pict/node_modules/fable","author":{"name":"Steven Velozo","email":"steven@velozo.com","url":"http://velozo.com/"},"browser":{"./source/Fable-Log-DefaultProviders-Node.js":"./source/Fable-Log-DefaultProviders-Web.js"},"bugs":{"url":"https://github.com/stevenvelozo/fable-log/issues"},"bundleDependencies":false,"dependencies":{"fable-serviceproviderbase":"^3.0.19"},"deprecated":false,"description":"A simple logging wrapper.","devDependencies":{"quackage":"^1.0.58"},"homepage":"https://github.com/stevenvelozo/fable-log","keywords":["logging"],"license":"MIT","main":"source/Fable-Log.js","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"]},"name":"fable-log","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/fable-log.git"},"scripts":{"coverage":"npx quack coverage","start":"node source/Fable-Log.js","test":"npx quack test","tests":"npx quack test -g"},"version":"3.0.18"};},{}],52:[function(require,module,exports){/**
|
|
629
629
|
* Base Logger Class
|
|
630
630
|
*
|
|
631
631
|
*
|
|
@@ -673,7 +673,7 @@ switch(pLevel){case'trace':this.logStreamsTrace.push(pLogger);case'debug':this.l
|
|
|
673
673
|
for(let i=0;i<this._StreamDefinitions.length;i++){let tmpStreamDefinition=Object.assign({loggertype:'default',streamtype:'console',level:'info'},this._StreamDefinitions[i]);if(!(tmpStreamDefinition.loggertype in this._Providers)){console.log(`Error initializing log stream: bad loggertype in stream definition ${JSON.stringify(tmpStreamDefinition)}`);}else{this.addLogger(new this._Providers[tmpStreamDefinition.loggertype](tmpStreamDefinition,this),tmpStreamDefinition.level);}}// Now initialize each one.
|
|
674
674
|
for(let i=0;i<this.logStreams.length;i++){this.logStreams[i].initialize();}}logTime(pMessage,pDatum){let tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time';let tmpTime=new Date();this.info(`${tmpMessage} ${tmpTime} (epoch ${+tmpTime})`,pDatum);}// Get a timestamp
|
|
675
675
|
getTimeStamp(){return+new Date();}getTimeDelta(pTimeStamp){let tmpEndTime=+new Date();return tmpEndTime-pTimeStamp;}// Log the delta between a timestamp, and now with a message
|
|
676
|
-
logTimeDelta(pTimeDelta,pMessage,pDatum){let tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time Measurement';let tmpDatum=typeof pDatum==='object'?pDatum:{};let tmpEndTime=+new Date();this.info(`${tmpMessage} logged at (epoch ${+tmpEndTime}) took (${pTimeDelta}ms)`,pDatum);}logTimeDeltaHuman(pTimeDelta,pMessage,pDatum){let tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time Measurement';let tmpEndTime=+new Date();let tmpMs=parseInt(pTimeDelta%1000);let tmpSeconds=parseInt(pTimeDelta/1000%60);let tmpMinutes=parseInt(pTimeDelta/(1000*60)%60);let tmpHours=parseInt(pTimeDelta/(1000*60*60));tmpMs=tmpMs<10?"00"+tmpMs:tmpMs<100?"0"+tmpMs:tmpMs;tmpSeconds=tmpSeconds<10?"0"+tmpSeconds:tmpSeconds;tmpMinutes=tmpMinutes<10?"0"+tmpMinutes:tmpMinutes;tmpHours=tmpHours<10?"0"+tmpHours:tmpHours;this.info(`${tmpMessage} logged at (epoch ${+tmpEndTime}) took (${pTimeDelta}ms) or (${tmpHours}:${tmpMinutes}:${tmpSeconds}.${tmpMs})`,pDatum);}logTimeDeltaRelative(pStartTime,pMessage,pDatum){this.logTimeDelta(this.getTimeDelta(pStartTime),pMessage,pDatum);}logTimeDeltaRelativeHuman(pStartTime,pMessage,pDatum){this.logTimeDeltaHuman(this.getTimeDelta(pStartTime),pMessage,pDatum);}}module.exports=FableLog;module.exports.LogProviderBase=require('./Fable-Log-BaseLogger.js');module.exports.LogProviderConsole=require('./Fable-Log-Logger-Console.js');module.exports.LogProviderFlatfile=require('./Fable-Log-Logger-SimpleFlatFile.js');},{"../package.json":51,"./Fable-Log-BaseLogger.js":52,"./Fable-Log-DefaultProviders-Node.js":53,"./Fable-Log-DefaultStreams.json":54,"./Fable-Log-Logger-Console.js":55,"./Fable-Log-Logger-SimpleFlatFile.js":56,"fable-serviceproviderbase":59}],58:[function(require,module,exports){module.exports={"name":"fable-serviceproviderbase","
|
|
676
|
+
logTimeDelta(pTimeDelta,pMessage,pDatum){let tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time Measurement';let tmpDatum=typeof pDatum==='object'?pDatum:{};let tmpEndTime=+new Date();this.info(`${tmpMessage} logged at (epoch ${+tmpEndTime}) took (${pTimeDelta}ms)`,pDatum);}logTimeDeltaHuman(pTimeDelta,pMessage,pDatum){let tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time Measurement';let tmpEndTime=+new Date();let tmpMs=parseInt(pTimeDelta%1000);let tmpSeconds=parseInt(pTimeDelta/1000%60);let tmpMinutes=parseInt(pTimeDelta/(1000*60)%60);let tmpHours=parseInt(pTimeDelta/(1000*60*60));tmpMs=tmpMs<10?"00"+tmpMs:tmpMs<100?"0"+tmpMs:tmpMs;tmpSeconds=tmpSeconds<10?"0"+tmpSeconds:tmpSeconds;tmpMinutes=tmpMinutes<10?"0"+tmpMinutes:tmpMinutes;tmpHours=tmpHours<10?"0"+tmpHours:tmpHours;this.info(`${tmpMessage} logged at (epoch ${+tmpEndTime}) took (${pTimeDelta}ms) or (${tmpHours}:${tmpMinutes}:${tmpSeconds}.${tmpMs})`,pDatum);}logTimeDeltaRelative(pStartTime,pMessage,pDatum){this.logTimeDelta(this.getTimeDelta(pStartTime),pMessage,pDatum);}logTimeDeltaRelativeHuman(pStartTime,pMessage,pDatum){this.logTimeDeltaHuman(this.getTimeDelta(pStartTime),pMessage,pDatum);}}module.exports=FableLog;module.exports.LogProviderBase=require('./Fable-Log-BaseLogger.js');module.exports.LogProviderConsole=require('./Fable-Log-Logger-Console.js');module.exports.LogProviderFlatfile=require('./Fable-Log-Logger-SimpleFlatFile.js');},{"../package.json":51,"./Fable-Log-BaseLogger.js":52,"./Fable-Log-DefaultProviders-Node.js":53,"./Fable-Log-DefaultStreams.json":54,"./Fable-Log-Logger-Console.js":55,"./Fable-Log-Logger-SimpleFlatFile.js":56,"fable-serviceproviderbase":59}],58:[function(require,module,exports){module.exports={"_from":"fable-serviceproviderbase@^3.0.19","_id":"fable-serviceproviderbase@3.0.19","_inBundle":false,"_integrity":"sha512-q/chQR1Z+sgfsDy4q0kHg09EEjUzYKLYHNUcLC0idTp08n3mzikU+ynKKDB56k2WkosZzhoAKg2YHRGi4/c3ig==","_location":"/fable-serviceproviderbase","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"fable-serviceproviderbase@^3.0.19","name":"fable-serviceproviderbase","escapedName":"fable-serviceproviderbase","rawSpec":"^3.0.19","saveSpec":null,"fetchSpec":"^3.0.19"},"_requiredBy":["/cachetrax","/data-arithmatic","/fable","/fable-log","/fable-settings","/fable-uuid","/manyfest","/meadow-connection-dgraph","/meadow-connection-manager","/meadow-connection-mongodb","/meadow-connection-mssql","/meadow-connection-mysql","/meadow-connection-postgresql","/meadow-connection-solr","/meadow-connection-sqlite","/meadow-endpoints","/meadow-integration","/meadow-migrationmanager/pict-section-flow","/orator","/orator-authentication","/orator-serviceserver-base","/orator-static-server","/pict-application","/pict-docuserve","/pict-provider","/pict-section-flow","/pict-section-form","/pict-service-commandlineutility","/pict-sessionmanager","/pict-template","/pict-terminalui","/pict-view","/retold-data-service","/stricture/pict-terminalui"],"_resolved":"https://registry.npmjs.org/fable-serviceproviderbase/-/fable-serviceproviderbase-3.0.19.tgz","_shasum":"e04a7f953bbd658b5e37c0a38ebbb54348a2f1d4","_spec":"fable-serviceproviderbase@^3.0.19","_where":"/Users/jacksonpollard/pict/node_modules/cachetrax","author":{"name":"Steven Velozo","email":"steven@velozo.com","url":"http://velozo.com/"},"bugs":{"url":"https://github.com/stevenvelozo/fable-serviceproviderbase/issues"},"bundleDependencies":false,"deprecated":false,"description":"Simple base classes for fable services.","devDependencies":{"@types/mocha":"^10.0.10","fable":"^3.1.62","quackage":"^1.0.58","typescript":"^5.9.3"},"homepage":"https://github.com/stevenvelozo/fable-serviceproviderbase","keywords":["entity","behavior"],"license":"MIT","main":"source/Fable-ServiceProviderBase.js","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"]},"name":"fable-serviceproviderbase","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/fable-serviceproviderbase.git"},"scripts":{"build":"npx quack build","check":"tsc -p . --noEmit","coverage":"npx quack coverage","start":"node source/Fable-ServiceProviderBase.js","test":"npx quack test","tests":"npx quack test -g","types":"tsc -p ./tsconfig.build.json"},"types":"types/source/Fable-ServiceProviderBase.d.ts","version":"3.0.19"};},{}],59:[function(require,module,exports){/**
|
|
677
677
|
* Fable Service Base
|
|
678
678
|
* @author <steven@velozo.com>
|
|
679
679
|
*/const libPackage=require('../package.json');class FableServiceProviderBase{/**
|
|
@@ -694,7 +694,7 @@ this.serviceType=`Unknown-${this.UUID}`;// The service hash is used to identify
|
|
|
694
694
|
this.Hash=typeof pServiceHash==='string'?pServiceHash:!this.fable&&typeof pOptions==='string'?pOptions:`${this.UUID}`;}/**
|
|
695
695
|
* @param {import('fable')} pFable
|
|
696
696
|
*/connectFable(pFable){if(typeof pFable!=='object'||!pFable.isFable){let tmpErrorMessage=`Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof pFable}].}`;console.log(tmpErrorMessage);return new Error(tmpErrorMessage);}if(!this.fable){this.fable=pFable;}if(!this.log){this.log=this.fable.Logging;}if(!this.services){this.services=this.fable.services;}if(!this.servicesMap){this.servicesMap=this.fable.servicesMap;}return true;}}_defineProperty2(FableServiceProviderBase,"isFableService",true);module.exports=FableServiceProviderBase;// This is left here in case we want to go back to having different code/base class for "core" services
|
|
697
|
-
module.exports.CoreServiceProviderBase=FableServiceProviderBase;},{"../package.json":58}],60:[function(require,module,exports){module.exports={"
|
|
697
|
+
module.exports.CoreServiceProviderBase=FableServiceProviderBase;},{"../package.json":58}],60:[function(require,module,exports){module.exports={"_from":"fable-settings@^3.0.16","_id":"fable-settings@3.0.16","_inBundle":false,"_integrity":"sha512-GTcUdDdWHhhjN3c9JZPczmuTK/cbl3iJzWfkY8zkvyJjFt/b2gyTHR1jL0OBQaeVJ3xToZaH7QRFhfJxlr4mMQ==","_location":"/fable-settings","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"fable-settings@^3.0.16","name":"fable-settings","escapedName":"fable-settings","rawSpec":"^3.0.16","saveSpec":null,"fetchSpec":"^3.0.16"},"_requiredBy":["/fable"],"_resolved":"https://registry.npmjs.org/fable-settings/-/fable-settings-3.0.16.tgz","_shasum":"c576f75f4338a0fc4f37fe59444ce4f4124eb002","_spec":"fable-settings@^3.0.16","_where":"/Users/jacksonpollard/pict/node_modules/fable","author":{"name":"Steven Velozo","email":"steven@velozo.com","url":"http://velozo.com/"},"bugs":{"url":"https://github.com/stevenvelozo/fable-settings/issues"},"bundleDependencies":false,"dependencies":{"fable-serviceproviderbase":"^3.0.19","precedent":"^1.0.17"},"deprecated":false,"description":"A simple, tolerant configuration chain.","devDependencies":{"quackage":"^1.0.58"},"homepage":"https://github.com/stevenvelozo/fable-settings","keywords":["configuration"],"license":"MIT","main":"source/Fable-Settings.js","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"]},"name":"fable-settings","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/fable-settings.git"},"scripts":{"build":"npx quack build","coverage":"npx quack coverage","docker-dev-build-image":"docker build ./ -f Dockerfile_LUXURYCode -t retold/fable-settings:local","docker-dev-run":"docker run -it -d --name retold-fable-settings-dev -p 30003:8080 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable-settings\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" retold/fable-settings:local","start":"node source/Fable-Settings.js","test":"npx quack test"},"version":"3.0.16"};},{}],61:[function(require,module,exports){module.exports={"Product":"ApplicationNameHere","ProductVersion":"0.0.0","ConfigFile":false,"LogStreams":[{"level":"trace"}]};},{}],62:[function(require,module,exports){(function(process){(function(){/**
|
|
698
698
|
* Fable Settings Template Processor
|
|
699
699
|
*
|
|
700
700
|
* This class allows environment variables to come in via templated expressions, and defaults to be set.
|
|
@@ -738,7 +738,7 @@ this._configureEnvTemplating(tmpSettingsTo);return tmpSettingsTo;}// Fill in set
|
|
|
738
738
|
fill(pSettingsFrom){// If an invalid settings from object is passed in (e.g. object constructor without passing in anything) this should still work
|
|
739
739
|
let tmpSettingsFrom=typeof pSettingsFrom==='object'?pSettingsFrom:{};// do not mutate the From object property values
|
|
740
740
|
let tmpSettingsFromCopy=JSON.parse(JSON.stringify(tmpSettingsFrom));this.settings=this._deepMergeObjects(tmpSettingsFromCopy,this.settings);return this.settings;}};// This is for backwards compatibility
|
|
741
|
-
function autoConstruct(pSettings){return new FableSettings(pSettings);}module.exports=FableSettings;module.exports.new=autoConstruct;},{"../package.json":60,"./Fable-Settings-Default":61,"./Fable-Settings-TemplateProcessor.js":62,"fable-serviceproviderbase":59}],64:[function(require,module,exports){module.exports={"
|
|
741
|
+
function autoConstruct(pSettings){return new FableSettings(pSettings);}module.exports=FableSettings;module.exports.new=autoConstruct;},{"../package.json":60,"./Fable-Settings-Default":61,"./Fable-Settings-TemplateProcessor.js":62,"fable-serviceproviderbase":59}],64:[function(require,module,exports){module.exports={"_from":"fable-uuid@^3.0.14","_id":"fable-uuid@3.0.14","_inBundle":false,"_integrity":"sha512-Jbr9I1/TCdxtvD9udNFsRpdoa0XIfcgx6IEo6oa8hiPEWsPdzb2MnQGGRAPqsft5kC0eEYBr/sf4P3LqeFK7Jw==","_location":"/fable-uuid","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"fable-uuid@^3.0.14","name":"fable-uuid","escapedName":"fable-uuid","rawSpec":"^3.0.14","saveSpec":null,"fetchSpec":"^3.0.14"},"_requiredBy":["/fable"],"_resolved":"https://registry.npmjs.org/fable-uuid/-/fable-uuid-3.0.14.tgz","_shasum":"41a4550f6245c980ab731d44fac999730e3f6678","_spec":"fable-uuid@^3.0.14","_where":"/Users/jacksonpollard/pict/node_modules/fable","author":{"name":"Steven Velozo","email":"steven@velozo.com","url":"http://velozo.com/"},"browser":{"./source/Fable-UUID-Random.js":"./source/Fable-UUID-Random-Browser.js"},"bugs":{"url":"https://github.com/stevenvelozo/fable-uuid/issues"},"bundleDependencies":false,"dependencies":{"fable-serviceproviderbase":"^3.0.19"},"deprecated":false,"description":"A simple UUID Generator.","devDependencies":{"pict-docuserve":"^0.1.5","quackage":"^1.1.2"},"homepage":"https://github.com/stevenvelozo/fable-uuid","keywords":["logging"],"license":"MIT","main":"source/Fable-UUID.js","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"]},"name":"fable-uuid","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/fable-uuid.git"},"scripts":{"build":"npx quack build","coverage":"npx quack coverage","docker-dev-build-image":"docker build ./ -f Dockerfile_LUXURYCode -t retold/fable-uuid:local","docker-dev-run":"docker run -it -d --name retold-fable-uuid-dev -p 30002:8080 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable-uuid\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" retold/fable-uuid:local","start":"node source/Fable-UUID.js","test":"npx quack test"},"version":"3.0.14"};},{}],65:[function(require,module,exports){/**
|
|
742
742
|
* Random Byte Generator - Browser version
|
|
743
743
|
*
|
|
744
744
|
*
|
|
@@ -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={"
|
|
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={"_from":"fable@^3.1.74","_id":"fable@3.1.75","_inBundle":false,"_integrity":"sha512-HHe53CNv5gXZZ0FEq2qoj0RqlF9TsIFQ1WX/V2CGj8POKJhM3JbUVIyxBcpZr5zHGbzZ+9PWZ0TUdxQWUYJ9zg==","_location":"/fable","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"fable@^3.1.74","name":"fable","escapedName":"fable","rawSpec":"^3.1.74","saveSpec":null,"fetchSpec":"^3.1.74"},"_requiredBy":["/","/foxhound","/meadow-endpoints","/meadow-integration","/meadow-migrationmanager","/pict","/pict-terminalui","/pict-view","/retold-data-service","/stricture","/stricture/pict-terminalui"],"_resolved":"https://registry.npmjs.org/fable/-/fable-3.1.75.tgz","_shasum":"1e61d5f1ee963e1b9810b5c28757fe1cfaff052a","_spec":"fable@^3.1.74","_where":"/Users/jacksonpollard/pict","author":{"name":"Steven Velozo","email":"steven@velozo.com","url":"http://velozo.com/"},"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"},"bugs":{"url":"https://github.com/stevenvelozo/fable/issues"},"bundleDependencies":false,"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"},"deprecated":false,"description":"A service dependency injection, configuration and logging library.","devDependencies":{"pict-docuserve":"^1.3.2","quackage":"^1.2.3"},"homepage":"https://github.com/stevenvelozo/fable","keywords":["entity","behavior"],"license":"MIT","main":"source/Fable.js","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"]},"name":"fable","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/fable.git"},"scripts":{"build":"npx quack build","coverage":"npx quack coverage","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","prepublishOnly":"npx quack build","start":"node source/Fable.js","test":"npx quack test","tests":"npx quack test -g"},"version":"3.1.75"};},{}],68:[function(require,module,exports){/**
|
|
775
775
|
* Fable Application Services Support Library
|
|
776
776
|
* @author <steven@velozo.com>
|
|
777
777
|
*/// Pre-init services
|
|
@@ -958,7 +958,7 @@ if(!(pEndIndex<this.length)){pEndIndex=this.length;}else{pEndIndex|=0;// round p
|
|
|
958
958
|
* @param {string} pJoin - The string to join with
|
|
959
959
|
* @param {...any} pParams - Any number of parameters
|
|
960
960
|
* @return {string}
|
|
961
|
-
*/joinStringsInternal(){const[
|
|
961
|
+
*/joinStringsInternal(){const _arguments=Array.prototype.slice.call(arguments),pJoinOn=_arguments[0],pParams=_arrayLikeToArray(_arguments).slice(1);const tmpFlattenedArrays=this.fable.Utility.flattenArrayOfSolverInputs(pParams);return this.joinStrings(pJoinOn,...tmpFlattenedArrays);}/**
|
|
962
962
|
* Concatenate a list of values together into a string.
|
|
963
963
|
*
|
|
964
964
|
* @param {...any} pValues - The strings to concatenate
|
|
@@ -980,7 +980,7 @@ if(!(pEndIndex<this.length)){pEndIndex=this.length;}else{pEndIndex|=0;// round p
|
|
|
980
980
|
* @param {string} pJoin - The string to join with
|
|
981
981
|
* @param {...any} pParams - Any number of parameters
|
|
982
982
|
* @return {string}
|
|
983
|
-
*/joinStringsRawInternal(){const[
|
|
983
|
+
*/joinStringsRawInternal(){const _arguments2=Array.prototype.slice.call(arguments),pJoinOn=_arguments2[0],pParams=_arrayLikeToArray(_arguments2).slice(1);const tmpFlattenedArrays=this.fable.Utility.flattenArrayOfSolverInputs(pParams);return this.joinStringsRaw(pJoinOn,...tmpFlattenedArrays);}/**
|
|
984
984
|
* Clean wrapping characters if they exist consistently around the string. If they do not, the string is returned unchanged.
|
|
985
985
|
*
|
|
986
986
|
* @param {string} pWrapCharacter - The character expected as the wrapping character
|
|
@@ -1426,7 +1426,7 @@ this.LogNoisiness='LogNoisiness'in this.fable?this.fable.LogNoisiness:0;}/**
|
|
|
1426
1426
|
* @returns {any} - The result of solving the expression.
|
|
1427
1427
|
*/solve(pExpression,pDataSourceObject,pResultObject,pManifest,pDataDestinationObject){let tmpResultsObject=typeof pResultObject==='object'?pResultObject:{};let tmpDataSourceObject=typeof pDataSourceObject==='object'?pDataSourceObject:{};let tmpDataDestinationObject=typeof pDataDestinationObject==='object'?pDataDestinationObject:{};// This is technically a "pre-compile" and we can keep this Results Object around to reuse for better performance. Not required.
|
|
1428
1428
|
this.tokenize(pExpression,tmpResultsObject);// Lint the tokenized expression to make sure it's valid
|
|
1429
|
-
this.lintTokenizedExpression(tmpResultsObject.RawTokens,tmpResultsObject);this.buildPostfixedSolveList(tmpResultsObject.RawTokens,tmpResultsObject);const tmpManifest=typeof pManifest==='object'?pManifest:this.fable.newManyfest();if(tmpResultsObject.SolverDirectives.Code=='SERIES'){const
|
|
1429
|
+
this.lintTokenizedExpression(tmpResultsObject.RawTokens,tmpResultsObject);this.buildPostfixedSolveList(tmpResultsObject.RawTokens,tmpResultsObject);const tmpManifest=typeof pManifest==='object'?pManifest:this.fable.newManyfest();if(tmpResultsObject.SolverDirectives.Code=='SERIES'){const _this$_prepareDirecti=this._prepareDirectiveParameters([tmpResultsObject.SolverDirectives.Step,tmpResultsObject.SolverDirectives.From,tmpResultsObject.SolverDirectives.To],['1'],tmpResultsObject,tmpDataSourceObject,tmpManifest),_this$_prepareDirecti2=_slicedToArray(_this$_prepareDirecti,3),tmpStep=_this$_prepareDirecti2[0],tmpFrom=_this$_prepareDirecti2[1],tmpTo=_this$_prepareDirecti2[2];if(isNaN(tmpFrom)||isNaN(tmpTo)){tmpResultsObject.ExpressionParserLog.push(`ExpressionParser.solve detected invalid SERIES directive parameters. FROM, TO must be numeric.`);this.log.warn(tmpResultsObject.ExpressionParserLog[tmpResultsObject.ExpressionParserLog.length-1]);return null;}// Make sure from/to are not equal
|
|
1430
1430
|
if(this.fable.Math.comparePrecise(tmpFrom,tmpTo)==0){tmpResultsObject.ExpressionParserLog.push(`ExpressionParser.solve detected invalid SERIES directive parameters. FROM and TO cannot be equal.`);this.log.warn(tmpResultsObject.ExpressionParserLog[tmpResultsObject.ExpressionParserLog.length-1]);return null;}// Make sure that Step is the correct positive/negative based on From and To
|
|
1431
1431
|
if(this.fable.Math.comparePrecise(tmpStep,'0')==0){tmpResultsObject.ExpressionParserLog.push(`ExpressionParser.solve detected invalid SERIES directive parameters. STEP cannot be zero.`);this.log.warn(tmpResultsObject.ExpressionParserLog[tmpResultsObject.ExpressionParserLog.length-1]);return null;}if(this.fable.Math.comparePrecise(tmpFrom,tmpTo)<0){// From < To so Step must be positive
|
|
1432
1432
|
if(this.fable.Math.comparePrecise(tmpStep,'0')<0){tmpResultsObject.ExpressionParserLog.push(`ExpressionParser.solve detected invalid SERIES directive parameters. STEP must be positive when FROM < TO.`);this.log.warn(tmpResultsObject.ExpressionParserLog[tmpResultsObject.ExpressionParserLog.length-1]);return null;}}else{// From >= To so Step must be negative
|
|
@@ -1456,7 +1456,7 @@ if(tmpTargetRowIndex<0||tmpTargetRowIndex>=tmpRows.length){// Out of bounds -- u
|
|
|
1456
1456
|
tmpRowStepDataSourceObject[tmpVariableKey]=tmpVariableDescription.Default;}else{const tmpTargetRow=tmpRows[tmpTargetRowIndex];if(tmpVariableDescription.Property===null){// No property specified, use the whole row
|
|
1457
1457
|
tmpRowStepDataSourceObject[tmpVariableKey]=tmpTargetRow;}else{// Look up the property on the target row
|
|
1458
1458
|
let tmpValue=tmpManifest.getValueByHash(tmpTargetRow,tmpVariableDescription.Property);if(tmpValue==null){tmpValue=tmpVariableDescription.Default;}tmpRowStepDataSourceObject[tmpVariableKey]=tmpValue;}}}let tmpMutatedValues=this.substituteValuesInTokenizedObjects(tmpResultsObject.PostfixTokenObjects,tmpRowStepDataSourceObject,tmpResultsObject,tmpManifest);tmpValueArray.push(this.solvePostfixedExpression(tmpResultsObject.PostfixSolveList,tmpDataDestinationObject,tmpResultsObject,tmpManifest));for(let j=0;j<tmpMutatedValues.length;j++){tmpMutatedValues[j].Resolved=false;}tmpStepCounter++;}// Do the assignment
|
|
1459
|
-
let tmpAssignmentManifestHash=tmpResultsObject.PostfixedAssignmentAddress;if(tmpResultsObject.OriginalRawTokens[1]==='='&&typeof tmpResultsObject.OriginalRawTokens[0]==='string'&&tmpResultsObject.OriginalRawTokens[0].length>0){tmpAssignmentManifestHash=tmpResultsObject.OriginalRawTokens[0];}tmpManifest.setValueByHash(tmpDataDestinationObject,tmpAssignmentManifestHash,tmpValueArray);return tmpValueArray;}else if(tmpResultsObject.SolverDirectives.Code=='MONTECARLO'){const
|
|
1459
|
+
let tmpAssignmentManifestHash=tmpResultsObject.PostfixedAssignmentAddress;if(tmpResultsObject.OriginalRawTokens[1]==='='&&typeof tmpResultsObject.OriginalRawTokens[0]==='string'&&tmpResultsObject.OriginalRawTokens[0].length>0){tmpAssignmentManifestHash=tmpResultsObject.OriginalRawTokens[0];}tmpManifest.setValueByHash(tmpDataDestinationObject,tmpAssignmentManifestHash,tmpValueArray);return tmpValueArray;}else if(tmpResultsObject.SolverDirectives.Code=='MONTECARLO'){const _this$_prepareDirecti3=this._prepareDirectiveParameters([tmpResultsObject.SolverDirectives.SampleCount],['1'],tmpResultsObject,tmpDataSourceObject,tmpManifest),_this$_prepareDirecti4=_slicedToArray(_this$_prepareDirecti3,1),tmpSampleCount=_this$_prepareDirecti4[0];if(isNaN(tmpSampleCount)){tmpResultsObject.ExpressionParserLog.push(`ExpressionParser.solve detected invalid MONTECARLO directive parameters. SAMPLECOUNT must be numeric.`);this.log.warn(tmpResultsObject.ExpressionParserLog[tmpResultsObject.ExpressionParserLog.length-1]);return null;}let tmpMonteCarloOutput=JSON.parse(JSON.stringify(tmpResultsObject.SolverDirectives));tmpMonteCarloOutput.Samples=[];// Now go through each variable and prepare its object of values
|
|
1460
1460
|
let tmpVariableKeys=Object.keys(tmpMonteCarloOutput.Values);for(let i=0;i<tmpVariableKeys.length;i++){let tmpVariableKey=tmpVariableKeys[i];let tmpVariableDescription=tmpMonteCarloOutput.Values[tmpVariableKey];// For each variable, generate its array of sampled values
|
|
1461
1461
|
tmpVariableDescription.Distribution={};tmpVariableDescription.ValueSequence=[];// Resolve the points if they are tokenized expressions
|
|
1462
1462
|
const tmpResolvedPoints=[];for(let j=0;j<tmpVariableDescription.Points.length;j++){let tmpPointToken=tmpVariableDescription.Points[j];let tmpPointValue=this.fable.Math.parsePrecise(tmpPointToken,NaN);if(isNaN(tmpPointValue)&&typeof tmpPointToken==='string'&&tmpPointToken.length>0){tmpPointValue=tmpManifest.getValueByHash(tmpDataSourceObject,tmpPointToken);if(!tmpPointValue||tmpPointValue==null){//TODO: Warn?
|
|
@@ -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"}};},{}],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"}};},{}],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
|
|
@@ -1638,7 +1638,7 @@ this.getTokenType(pTokenizedExpression[0])==='Token.StateAddress'||this.getToken
|
|
|
1638
1638
|
){tmpResults.ExpressionParserLog.push(`WARNING: ExpressionParser.lintTokenizedExpression found a single equality assignment in the tokenized expression with no assignable address on the left side of the assignment.`);tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);}}}// 5. Check that there are no operators adjacent to each other
|
|
1639
1639
|
// This is a simple lint check, not a full-blown syntax check
|
|
1640
1640
|
let tmpTokenPrevious=false;for(let i=0;i<pTokenizedExpression.length-1;i++){if(pTokenizedExpression[i]in this.ExpressionParser.tokenMap&&this.ExpressionParser.tokenMap[pTokenizedExpression[i]].Type!='Parenthesis'&&!tmpTokenPrevious){tmpTokenPrevious=true;}else if(pTokenizedExpression[i]in this.ExpressionParser.tokenMap&&this.ExpressionParser.tokenMap[pTokenizedExpression[i]].Type!='Parenthesis'){// If this isn't a + or - positivity/negativity multiplier, it's an error.
|
|
1641
|
-
if(pTokenizedExpression[i]!=='+'&&pTokenizedExpression[i]!=='-'){tmpResults.ExpressionParserLog.push(`ERROR: ExpressionParser.lintTokenizedExpression found an ${pTokenizedExpression[i]} operator adjacent to another operator in the tokenized expression at token index ${i}`);tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);}}else{tmpTokenPrevious=false;}}return tmpResults.LinterResults;}}module.exports=ExpressionParserLinter;},{"./Fable-Service-ExpressionParser-Base.js":77}],82:[function(require,module,exports){const
|
|
1641
|
+
if(pTokenizedExpression[i]!=='+'&&pTokenizedExpression[i]!=='-'){tmpResults.ExpressionParserLog.push(`ERROR: ExpressionParser.lintTokenizedExpression found an ${pTokenizedExpression[i]} operator adjacent to another operator in the tokenized expression at token index ${i}`);tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);}}else{tmpTokenPrevious=false;}}return tmpResults.LinterResults;}}module.exports=ExpressionParserLinter;},{"./Fable-Service-ExpressionParser-Base.js":77}],82:[function(require,module,exports){const _require3=require('big.js'),PE=_require3.PE;const libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');/**
|
|
1642
1642
|
* Represents a user-friendly messaging service for the ExpressionParser compiler output.
|
|
1643
1643
|
* @class ExpressionParserMessaging
|
|
1644
1644
|
* @extends libExpressionParserOperationBase
|
|
@@ -2366,8 +2366,8 @@ const tmpLinearCoefficients=this.gaussianElimination(tmpDependentTransposeMultip
|
|
|
2366
2366
|
*
|
|
2367
2367
|
* @return {Array<Array<number|string>>} - inverted matrix
|
|
2368
2368
|
*/matrixInverse(pMatrix){const n=pMatrix.length;const tmpIdentityMatrix=pMatrix.map((row,i)=>row.map((_,j)=>i===j?1:0));const tmpAugmentedMatrix=pMatrix.map((row,i)=>row.concat(tmpIdentityMatrix[i]));for(let i=0;i<n;++i){// Pivot
|
|
2369
|
-
let maxRow=i;for(let k=i+1;k<n;++k){if(this.gtPrecise(this.absPrecise(tmpAugmentedMatrix[k][i]),this.absPrecise(tmpAugmentedMatrix[maxRow][i]))){maxRow=k;}}
|
|
2370
|
-
const tmpPivotValue=tmpAugmentedMatrix[i][i];for(let j=0;j<2*n;++j){tmpAugmentedMatrix[i][j]=this.dividePrecise(tmpAugmentedMatrix[i][j],tmpPivotValue);}// Eliminate other rows
|
|
2369
|
+
let maxRow=i;for(let k=i+1;k<n;++k){if(this.gtPrecise(this.absPrecise(tmpAugmentedMatrix[k][i]),this.absPrecise(tmpAugmentedMatrix[maxRow][i]))){maxRow=k;}}// divide by pivot
|
|
2370
|
+
var _ref=[tmpAugmentedMatrix[maxRow],tmpAugmentedMatrix[i]];tmpAugmentedMatrix[i]=_ref[0];tmpAugmentedMatrix[maxRow]=_ref[1];const tmpPivotValue=tmpAugmentedMatrix[i][i];for(let j=0;j<2*n;++j){tmpAugmentedMatrix[i][j]=this.dividePrecise(tmpAugmentedMatrix[i][j],tmpPivotValue);}// Eliminate other rows
|
|
2371
2371
|
for(let k=0;k<n;++k){if(k===i){continue;}const tmpFactor=tmpAugmentedMatrix[k][i];for(let j=0;j<2*n;++j){tmpAugmentedMatrix[k][j]=this.subtractPrecise(tmpAugmentedMatrix[k][j],this.multiplyPrecise(tmpFactor,tmpAugmentedMatrix[i][j]));}}}// Extract right half (inverse)
|
|
2372
2372
|
return tmpAugmentedMatrix.map(row=>row.slice(n));}/**
|
|
2373
2373
|
* Compute solution to linear system using Gaussian elimination.
|
|
@@ -2548,7 +2548,9 @@ pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// Flush the ou
|
|
|
2548
2548
|
this.appendOutputBuffer(pCharacter,pParserState);// If this last character is the end of the pattern, parse it.
|
|
2549
2549
|
// Run the function
|
|
2550
2550
|
let 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,pScope,pState);}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,pScope,pState);}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.
|
|
2551
|
-
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{
|
|
2551
|
+
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{// Partial end-pattern match aborted -- roll Pattern back to the start node so
|
|
2552
|
+
// subsequent characters scan for the end pattern from the beginning again.
|
|
2553
|
+
pParserState.EndPatternMatchBegan=false;pParserState.Pattern=pParserState.PatternStartNode;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.
|
|
2552
2554
|
pParserState.EndPatternMatchBegan=true;// This leaf has a PatternEnd tree, so we will wait until that end is met.
|
|
2553
2555
|
pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// If this last character is the end of the pattern, parse it.
|
|
2554
2556
|
if('Parse'in pParserState.Pattern){// Run the t*mplate function
|
|
@@ -2584,7 +2586,9 @@ if(!pParserState.StartPatternMatchComplete&&pCharacter in pParserState.Pattern){
|
|
|
2584
2586
|
pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// Flush the output buffer.
|
|
2585
2587
|
this.appendOutputBuffer(pCharacter,pParserState);// If this last character is the end of the pattern, parse it.
|
|
2586
2588
|
if('Parse'in pParserState.Pattern){return this.executePatternAsync(pParserState,pData,fCallback,pDataContext,pScope,pState);}}else if(pCharacter in pParserState.PatternStartNode.PatternEnd){// We broke out of the end -- see if this is a new start of the end.
|
|
2587
|
-
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{
|
|
2589
|
+
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{// Partial end-pattern match aborted -- roll Pattern back to the start node so
|
|
2590
|
+
// subsequent characters scan for the end pattern from the beginning again.
|
|
2591
|
+
pParserState.EndPatternMatchBegan=false;pParserState.Pattern=pParserState.PatternStartNode;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.
|
|
2588
2592
|
pParserState.EndPatternMatchBegan=true;// This leaf has a PatternEnd tree, so we will wait until that end is met.
|
|
2589
2593
|
pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// If this last character is the end of the pattern, parse it.
|
|
2590
2594
|
if('Parse'in pParserState.Pattern){return this.executePatternAsync(pParserState,pData,fCallback,pDataContext,pScope,pState);}}}else{// We are in a pattern start but didn't match one; reset and start trying again from this character.
|
|
@@ -2643,7 +2647,7 @@ if(pParserContext){tmpLeaf.ParserContext=pParserContext;}tmpLeaf.isAsync=true;re
|
|
|
2643
2647
|
* @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
|
|
2644
2648
|
* @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.
|
|
2645
2649
|
* @param {Object} pParserContext - The context to pass to the parser function
|
|
2646
|
-
*/addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}module.exports=WordTree;},{}],93:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":1},"Steps":[],"Errors":[],"Log":[]};},{}],94:[function(require,module,exports){const
|
|
2650
|
+
*/addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}module.exports=WordTree;},{}],93:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":1},"Steps":[],"Errors":[],"Log":[]};},{}],94:[function(require,module,exports){const _require4=require('big.js'),PE=_require4.PE;const libFableServiceBase=require('fable-serviceproviderbase');const _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));class FableOperation extends libFableServiceBase{constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);// Timestamps will just be the long ints
|
|
2647
2651
|
this.timeStamps={};this.serviceType='PhasedOperation';this.state=JSON.parse(_OperationStatePrototypeString);this.stepMap={};this.stepFunctions={};// Match the service instantiation to the operation.
|
|
2648
2652
|
this.state.Metadata.Hash=this.Hash;this.state.Metadata.UUID=this.UUID;this.state.Metadata.Name=typeof this.options.Name=='string'?this.options.Name:`Unnamed Operation ${this.state.Metadata.UUID}`;this.name=this.state.Metadata.Name;this.progressTrackerSet=this.fable.instantiateServiceProviderWithoutRegistration('ProgressTrackerSet');this.state.OverallProgressTracker=this.progressTrackerSet.createProgressTracker(`Overall-${this.state.Metadata.UUID}`);// This is here to use the pass-through logging functions in the operation itself.
|
|
2649
2653
|
this.log=this;}execute(fExecutionCompleteCallback){// TODO: Should the same operation be allowed to execute more than one time?
|
|
@@ -2822,7 +2826,7 @@ return this._executeBinaryUploadInternal(pOptions,fCallback,fOnProgress);}/**
|
|
|
2822
2826
|
* @param {(pProgress: number) => void} [fOnProgress] - Optional progress callback (0.0 to 1.0); called with 1.0 on completion
|
|
2823
2827
|
* @private
|
|
2824
2828
|
*/_executeBinaryUploadInternal(pOptions,fCallback,fOnProgress){let tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug(`Beginning ${tmpOptions.method} binary upload to ${tmpOptions.url} at ${tmpOptions.RequestStartTime}`);}tmpOptions.json=false;return this._executeWithRedirects(tmpOptions,(pError,pResponse)=>{if(pError){return fCallback(pError,pResponse);}if(this.TraceLog){let tmpConnectTime=this.fable.log.getTimeStamp();this.fable.log.debug(`--> Binary upload ${tmpOptions.method} connected in ${this.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime)}ms code ${pResponse.statusCode}`);}let tmpData='';pResponse.on('data',pChunk=>{if(this.TraceLog){let tmpChunkTime=this.fable.log.getTimeStamp();this.fable.log.debug(`--> Binary upload ${tmpOptions.method} response chunk size ${pChunk.length}b received in ${this.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime)}ms`);}tmpData+=pChunk;});pResponse.on('end',()=>{if(this.TraceLog){let tmpCompletionTime=this.fable.log.getTimeStamp();this.fable.log.debug(`==> Binary upload ${tmpOptions.method} completed in ${this.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime)}ms`);}// Signal completion via progress callback
|
|
2825
|
-
if(typeof fOnProgress==='function'){fOnProgress(1.0);}return fCallback(pError,pResponse,tmpData);});});}getRawText(pOptionsOrURL,fCallback){let tmpRequestOptions=typeof pOptionsOrURL=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeChunkedRequest(tmpRequestOptions,fCallback);}}module.exports=FableServiceRestClient;}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20,"cookie":31,"fable-serviceproviderbase":59,"http":
|
|
2829
|
+
if(typeof fOnProgress==='function'){fOnProgress(1.0);}return fCallback(pError,pResponse,tmpData);});});}getRawText(pOptionsOrURL,fCallback){let tmpRequestOptions=typeof pOptionsOrURL=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeChunkedRequest(tmpRequestOptions,fCallback);}}module.exports=FableServiceRestClient;}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20,"cookie":31,"fable-serviceproviderbase":59,"http":166,"https":113,"simple-get":165}],99:[function(require,module,exports){const libFableServiceBase=require('fable-serviceproviderbase');class FableServiceTemplate extends libFableServiceBase{// Underscore and lodash have a behavior, _.template, which compiles a
|
|
2826
2830
|
// string-based template with code snippets into simple executable pieces,
|
|
2827
2831
|
// with the added twist of returning a precompiled function ready to go.
|
|
2828
2832
|
//
|
|
@@ -3032,7 +3036,7 @@ $gOPD=null;}}module.exports=$gOPD;},{"./gOPD":108}],110:[function(require,module
|
|
|
3032
3036
|
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
|
3033
3037
|
var symVal=42;obj[sym]=symVal;for(var _ in obj){return false;}// eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
|
3034
3038
|
if(typeof Object.keys==='function'&&Object.keys(obj).length!==0){return false;}if(typeof Object.getOwnPropertyNames==='function'&&Object.getOwnPropertyNames(obj).length!==0){return false;}var syms=Object.getOwnPropertySymbols(obj);if(syms.length!==1||syms[0]!==sym){return false;}if(!Object.prototype.propertyIsEnumerable.call(obj,sym)){return false;}if(typeof Object.getOwnPropertyDescriptor==='function'){// eslint-disable-next-line no-extra-parens
|
|
3035
|
-
var descriptor=/** @type {PropertyDescriptor} */Object.getOwnPropertyDescriptor(obj,sym);if(descriptor.value!==symVal||descriptor.enumerable!==true){return false;}}return true;};},{}],112:[function(require,module,exports){'use strict';var call=Function.prototype.call;var $hasOwn=Object.prototype.hasOwnProperty;var bind=require('function-bind');/** @type {import('.')} */module.exports=bind.call(call,$hasOwn);},{"function-bind":103}],113:[function(require,module,exports){var http=require('http');var url=require('url');var https=module.exports;for(var key in http){if(http.hasOwnProperty(key))https[key]=http[key];}https.request=function(params,cb){params=validateParams(params);return http.request.call(this,params,cb);};https.get=function(params,cb){params=validateParams(params);return http.get.call(this,params,cb);};function validateParams(params){if(typeof params==='string'){params=url.parse(params);}if(!params.protocol){params.protocol='https:';}if(params.protocol!=='https:'){throw new Error('Protocol "'+params.protocol+'" not supported. Expected "https:"');}return params;}},{"http":
|
|
3039
|
+
var descriptor=/** @type {PropertyDescriptor} */Object.getOwnPropertyDescriptor(obj,sym);if(descriptor.value!==symVal||descriptor.enumerable!==true){return false;}}return true;};},{}],112:[function(require,module,exports){'use strict';var call=Function.prototype.call;var $hasOwn=Object.prototype.hasOwnProperty;var bind=require('function-bind');/** @type {import('.')} */module.exports=bind.call(call,$hasOwn);},{"function-bind":103}],113:[function(require,module,exports){var http=require('http');var url=require('url');var https=module.exports;for(var key in http){if(http.hasOwnProperty(key))https[key]=http[key];}https.request=function(params,cb){params=validateParams(params);return http.request.call(this,params,cb);};https.get=function(params,cb){params=validateParams(params);return http.get.call(this,params,cb);};function validateParams(params){if(typeof params==='string'){params=url.parse(params);}if(!params.protocol){params.protocol='https:';}if(params.protocol!=='https:'){throw new Error('Protocol "'+params.protocol+'" not supported. Expected "https:"');}return params;}},{"http":166,"url":188}],114:[function(require,module,exports){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias;}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity;}else{m=m+Math.pow(2,mLen);e=e-eBias;}return(s?-1:1)*m*Math.pow(2,e-mLen);};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<<eLen)-1;var eBias=eMax>>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax;}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2;}if(e+eBias>=1){value+=rt/c;}else{value+=rt*Math.pow(2,1-eBias);}if(value*c>=2){e++;c/=2;}if(e+eBias>=eMax){m=0;e=eMax;}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias;}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0;}}for(;mLen>=8;buffer[offset+i]=m&0xff,i+=d,m/=256,mLen-=8){}e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&0xff,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128;};},{}],115:[function(require,module,exports){if(typeof Object.create==='function'){// implementation from standard node.js 'util' module
|
|
3036
3040
|
module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}});}};}else{// old school shim for old browsers
|
|
3037
3041
|
module.exports=function inherits(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor();ctor.prototype.constructor=ctor;}};}},{}],116:[function(require,module,exports){// When a boxed property is passed in, it should have quotes of some
|
|
3038
3042
|
// kind around it.
|
|
@@ -3980,7 +3984,7 @@ this.objectAddressCheckAddressExists=new libObjectAddressCheckAddressExists(this
|
|
|
3980
3984
|
*/// Reset critical manifest properties
|
|
3981
3985
|
reset(){this.scope='DEFAULT';this.elementAddresses=[];this.elementHashes={};this.elementDescriptors={};}clone(){// Make a copy of the options in-place
|
|
3982
3986
|
let tmpNewOptions=JSON.parse(JSON.stringify(this.options));let tmpNewManyfest=new Manyfest(this.fable,tmpNewOptions,this.Hash);tmpNewManyfest.logInfo=this.logInfo;tmpNewManyfest.logError=this.logError;//FIXME: mostly written by co-pilot
|
|
3983
|
-
const
|
|
3987
|
+
const _this$getManifest=this.getManifest(),Scope=_this$getManifest.Scope,Descriptors=_this$getManifest.Descriptors,HashTranslations=_this$getManifest.HashTranslations;tmpNewManyfest.scope=Scope;tmpNewManyfest.elementDescriptors=Descriptors;tmpNewManyfest.elementAddresses=Object.keys(Descriptors);// Rebuild the element hashes
|
|
3984
3988
|
for(let i=0;i<tmpNewManyfest.elementAddresses.length;i++){let tmpAddress=tmpNewManyfest.elementAddresses[i];let tmpDescriptor=tmpNewManyfest.elementDescriptors[tmpAddress];tmpNewManyfest.elementHashes[tmpAddress]=tmpAddress;if('Hash'in tmpDescriptor){tmpNewManyfest.elementHashes[tmpDescriptor.Hash]=tmpAddress;}}// Import the hash translations
|
|
3985
3989
|
tmpNewManyfest.hashTranslations.addTranslation(this.hashTranslations.translationTable);return tmpNewManyfest;}// Deserialize a Manifest from a string
|
|
3986
3990
|
/**
|
|
@@ -4169,7 +4173,7 @@ if(startDot===-1)startDot=i;else if(preDotState!==1)preDotState=1;}else if(start
|
|
|
4169
4173
|
// have a good chance at having a non-empty extension
|
|
4170
4174
|
preDotState=-1;}}if(startDot===-1||end===-1||// We saw a non-dot character immediately before the dot
|
|
4171
4175
|
preDotState===0||// The (right-most) trimmed path component is exactly '..'
|
|
4172
|
-
preDotState===1&&startDot===end-1&&startDot===startPart+1){if(end!==-1){if(startPart===0&&isAbsolute)ret.base=ret.name=path.slice(1,end);else ret.base=ret.name=path.slice(startPart,end);}}else{if(startPart===0&&isAbsolute){ret.name=path.slice(1,startDot);ret.base=path.slice(1,end);}else{ret.name=path.slice(startPart,startDot);ret.base=path.slice(startPart,end);}ret.ext=path.slice(startDot,end);}if(startPart>0)ret.dir=path.slice(0,startPart-1);else if(isAbsolute)ret.dir='/';return ret;},sep:'/',delimiter:':',win32:null,posix:null};posix.posix=posix;module.exports=posix;}).call(this);}).call(this,require('_process'));},{"_process":150}],139:[function(require,module,exports){module.exports={"
|
|
4176
|
+
preDotState===1&&startDot===end-1&&startDot===startPart+1){if(end!==-1){if(startPart===0&&isAbsolute)ret.base=ret.name=path.slice(1,end);else ret.base=ret.name=path.slice(startPart,end);}}else{if(startPart===0&&isAbsolute){ret.name=path.slice(1,startDot);ret.base=path.slice(1,end);}else{ret.name=path.slice(startPart,startDot);ret.base=path.slice(startPart,end);}ret.ext=path.slice(startDot,end);}if(startPart>0)ret.dir=path.slice(0,startPart-1);else if(isAbsolute)ret.dir='/';return ret;},sep:'/',delimiter:':',win32:null,posix:null};posix.posix=posix;module.exports=posix;}).call(this);}).call(this,require('_process'));},{"_process":150}],139:[function(require,module,exports){module.exports={"_from":"pict-application@^1.0.34","_id":"pict-application@1.0.34","_inBundle":false,"_integrity":"sha512-z+qyYs/kMdAk3I2Z4XDUvGjNyK/gfFM3r5zhHQcQrIxOcVqMwXMZvoMDWzCXc6SzyTJjoWHKZkdfmtRnft2RNw==","_location":"/pict-application","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"pict-application@^1.0.34","name":"pict-application","escapedName":"pict-application","rawSpec":"^1.0.34","saveSpec":null,"fetchSpec":"^1.0.34"},"_requiredBy":["/","/meadow-migrationmanager","/pict","/pict-docuserve","/pict-terminalui","/retold-harness","/stricture","/stricture/pict-terminalui"],"_resolved":"https://registry.npmjs.org/pict-application/-/pict-application-1.0.34.tgz","_shasum":"382dfc18e314ad1cdab3b8cd6687f441bf7521f8","_spec":"pict-application@^1.0.34","_where":"/Users/jacksonpollard/pict","author":{"name":"steven velozo","email":"steven@velozo.com"},"bugs":{"url":"https://github.com/stevenvelozo/pict-application/issues"},"bundleDependencies":false,"dependencies":{"fable-serviceproviderbase":"^3.0.19"},"deprecated":false,"description":"Application base class for a pict view-based application","devDependencies":{"@eslint/js":"^9.28.0","browser-env":"^3.3.0","eslint":"^9.28.0","pict":"^1.0.348","pict-docuserve":"^0.1.5","pict-provider":"^1.0.10","pict-view":"^1.0.66","quackage":"^1.1.0","typescript":"^5.9.3"},"homepage":"https://github.com/stevenvelozo/pict-application#readme","license":"MIT","main":"source/Pict-Application.js","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"]},"name":"pict-application","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/pict-application.git"},"scripts":{"build":"npx quack build","coverage":"npx quack coverage","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-application-image:local","docker-dev-run":"docker run -it -d --name pict-application-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict-application\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-application-image:local","docker-dev-shell":"docker exec -it pict-application-dev /bin/bash","lint":"eslint source/**","start":"node source/Pict-Application.js","test":"npx quack test","tests":"npx quack test -g","types":"tsc -p ."},"types":"types/source/Pict-Application.d.ts","version":"1.0.34"};},{}],140:[function(require,module,exports){const libFableServiceBase=require('fable-serviceproviderbase');const libPackage=require('../package.json');const defaultPictSettings={Name:'DefaultPictApplication',// The main "viewport" is the view that is used to host our application
|
|
4173
4177
|
MainViewportViewIdentifier:'Default-View',MainViewportRenderableHash:false,MainViewportDestinationAddress:false,MainViewportDefaultDataAddress:false,// Whether or not we should automatically render the main viewport and other autorender views after we initialize the pict application
|
|
4174
4178
|
AutoSolveAfterInitialize:true,AutoRenderMainViewportViewAfterInitialize:true,AutoRenderViewsAfterInitialize:false,AutoLoginAfterInitialize:false,AutoLoadDataAfterLogin:false,ConfigurationOnlyViews:[],Manifests:{},// The prefix to prepend on all template destination hashes
|
|
4175
4179
|
IdentifierAddressPrefix:'PICT-'};/**
|
|
@@ -4371,7 +4375,7 @@ let tmpLoadedViews=Object.keys(this.pict.views);// Sort the views by their prior
|
|
|
4371
4375
|
// If they are all the default priority 0, it will end up being add order due to JSON Object Property Key order stuff
|
|
4372
4376
|
tmpLoadedViews.sort((a,b)=>{return this.pict.views[a].options.AutoRenderOrdinal-this.pict.views[b].options.AutoRenderOrdinal;});for(let i=0;i<tmpLoadedViews.length;i++){let tmpView=this.pict.views[tmpLoadedViews[i]];if(tmpView.options.AutoRender){tmpAnticipate.anticipate(tmpView.renderAsync.bind(tmpView));}}tmpAnticipate.wait(pError=>{this.lastAutoRenderTimestamp=this.fable.log.getTimeStamp();if(this.pict.LogNoisiness>0){this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`);}return tmpCallback(pError);});}/**
|
|
4373
4377
|
* @return {boolean}
|
|
4374
|
-
*/get isPictApplication(){return true;}}module.exports=PictApplication;},{"../package.json":139,"fable-serviceproviderbase":59}],141:[function(require,module,exports){module.exports={"
|
|
4378
|
+
*/get isPictApplication(){return true;}}module.exports=PictApplication;},{"../package.json":139,"fable-serviceproviderbase":59}],141:[function(require,module,exports){module.exports={"_from":"pict-provider@^1.0.13","_id":"pict-provider@1.0.13","_inBundle":false,"_integrity":"sha512-MRNtnuFfQYyM6pDTfth9XQETUkN91m1sVPRfgurZkrlsh8Cd9uvCgBQWfjQWjqwAHxKCIrp+QJcij2nNB81NsA==","_location":"/pict-provider","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"pict-provider@^1.0.13","name":"pict-provider","escapedName":"pict-provider","rawSpec":"^1.0.13","saveSpec":null,"fetchSpec":"^1.0.13"},"_requiredBy":["/","/bibliograph","/meadow-migrationmanager/pict-section-flow","/pict","/pict-docuserve","/pict-provider-theme","/pict-section-content","/pict-section-flow","/pict-section-form","/pict-section-theme","/quackage/pict-provider-theme"],"_resolved":"https://registry.npmjs.org/pict-provider/-/pict-provider-1.0.13.tgz","_shasum":"af7bc4353d0381812d86a671d2a0da08c038c80c","_spec":"pict-provider@^1.0.13","_where":"/Users/jacksonpollard/pict","author":{"name":"steven velozo","email":"steven@velozo.com"},"bugs":{"url":"https://github.com/stevenvelozo/pict-provider/issues"},"bundleDependencies":false,"dependencies":{"fable-serviceproviderbase":"^3.0.19"},"deprecated":false,"description":"Pict Provider Base Class","devDependencies":{"@eslint/js":"^9.39.1","eslint":"^9.39.1","pict":"^1.0.351","pict-docuserve":"^0.1.5","quackage":"^1.1.0","typescript":"^5.9.3"},"homepage":"https://github.com/stevenvelozo/pict-provider#readme","license":"MIT","main":"source/Pict-Provider.js","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"]},"name":"pict-provider","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/pict-provider.git"},"scripts":{"build":"npx quack build","coverage":"npx quack coverage","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-provider-image:local","docker-dev-run":"docker run -it -d --name pict-provider-dev -p 24125:8080 -p 30027:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict-provider\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-provider-image:local","docker-dev-shell":"docker exec -it pict-provider-dev /bin/bash","lint":"eslint source/**","start":"node source/Pict-Provider.js","test":"npx quack test","tests":"npx quack test -g","types":"tsc -p ."},"types":"types/source/Pict-Provider.d.ts","version":"1.0.13"};},{}],142:[function(require,module,exports){const libFableServiceBase=require('fable-serviceproviderbase');const libPackage=require('../package.json');const defaultPictProviderSettings={ProviderIdentifier:false,// If this is set to true, when the App initializes this will.
|
|
4375
4379
|
// After the App initializes, initialize will be called as soon as it's added.
|
|
4376
4380
|
AutoInitialize:true,AutoInitializeOrdinal:0,AutoLoadDataWithApp:true,AutoLoadDataOrdinal:0,AutoSolveWithApp:true,AutoSolveOrdinal:0,Manifests:{},Templates:[]};class PictProvider extends libFableServiceBase{/**
|
|
4377
4381
|
* @param {import('fable')} pFable - The Fable instance.
|
|
@@ -4435,7 +4439,7 @@ return fCallback();}}onAfterInitialize(){if(this.pict.LogNoisiness>3){this.log.t
|
|
|
4435
4439
|
* @param {(pError?: Error) => void} fCallback - The callback to call after the data post-load.
|
|
4436
4440
|
*
|
|
4437
4441
|
* @return {void}
|
|
4438
|
-
*/onAfterSaveDataAsync(fCallback){return fCallback();}}module.exports=PictProvider;},{"../package.json":141,"fable-serviceproviderbase":59}],143:[function(require,module,exports){module.exports={"
|
|
4442
|
+
*/onAfterSaveDataAsync(fCallback){return fCallback();}}module.exports=PictProvider;},{"../package.json":141,"fable-serviceproviderbase":59}],143:[function(require,module,exports){module.exports={"_from":"pict-template@^1.0.15","_id":"pict-template@1.0.15","_inBundle":false,"_integrity":"sha512-oS+1FFJN5+BiggktJOpYb/HHW4DH/Iz2t6p5RELFZk0OOpsEh4wryAK/8hGfXwzdOXaJMpwL7nxcgO3v6WS1ow==","_location":"/pict-template","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"pict-template@^1.0.15","name":"pict-template","escapedName":"pict-template","rawSpec":"^1.0.15","saveSpec":null,"fetchSpec":"^1.0.15"},"_requiredBy":["/","/pict","/pict-provider-theme","/pict-section-form","/quackage/pict-provider-theme"],"_resolved":"https://registry.npmjs.org/pict-template/-/pict-template-1.0.15.tgz","_shasum":"23b2ec321ff2d2f1c78557ec523af5b3063198f4","_spec":"pict-template@^1.0.15","_where":"/Users/jacksonpollard/pict","author":{"name":"steven velozo","email":"steven@velozo.com"},"bugs":{"url":"https://github.com/stevenvelozo/pict-view/issues"},"bundleDependencies":false,"dependencies":{"fable-serviceproviderbase":"^3.0.19"},"deprecated":false,"description":"Pict Template Base Class","devDependencies":{"pict":"^1.0.348","quackage":"^1.0.58","typescript":"^5.9.3"},"homepage":"https://github.com/stevenvelozo/pict-view#readme","license":"MIT","main":"source/Pict-Template.js","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"]},"name":"pict-template","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/pict-view.git"},"scripts":{"build":"npx quack build","coverage":"npx quack coverage","start":"node source/Pict-Template.js","test":"npx quack test","tests":"npx quack test -g","types":"tsc -p ."},"types":"types/source/Pict-Template.d.ts","version":"1.0.15"};},{}],144:[function(require,module,exports){const libFableServiceBase=require('fable-serviceproviderbase');const libPackage=require('../package.json');/** @typedef {import('pict') & {
|
|
4439
4443
|
* [key: string]: any, // represent services for now as a workaround
|
|
4440
4444
|
* }} Pict *//**
|
|
4441
4445
|
* @class PictTemplateExpression
|
|
@@ -4483,7 +4487,7 @@ return fCallback();}}onAfterInitialize(){if(this.pict.LogNoisiness>3){this.log.t
|
|
|
4483
4487
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
4484
4488
|
*
|
|
4485
4489
|
* @return {any} The value at the given address, or undefined
|
|
4486
|
-
*/resolveStateFromAddress(pAddress,pRecord,pContextArray,pRootDataObject,pScope,pState){return this.pict.resolveStateFromAddress(pAddress,pRecord,pContextArray,pRootDataObject,pScope,pState);}}module.exports=PictTemplateExpression;module.exports.template_hash='Default';},{"../package.json":143,"fable-serviceproviderbase":59}],145:[function(require,module,exports){module.exports={"
|
|
4490
|
+
*/resolveStateFromAddress(pAddress,pRecord,pContextArray,pRootDataObject,pScope,pState){return this.pict.resolveStateFromAddress(pAddress,pRecord,pContextArray,pRootDataObject,pScope,pState);}}module.exports=PictTemplateExpression;module.exports.template_hash='Default';},{"../package.json":143,"fable-serviceproviderbase":59}],145:[function(require,module,exports){module.exports={"_from":"pict-view@^1.0.68","_id":"pict-view@1.0.68","_inBundle":false,"_integrity":"sha512-hDrfBlcmCc+WyLJeapMhqCgI7yt5+6by+u5FQGnrlClezzcM3zzQv3rWJydQub1c3YBcSnSjqjpwa3Lx7Oik9w==","_location":"/pict-view","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"pict-view@^1.0.68","name":"pict-view","escapedName":"pict-view","rawSpec":"^1.0.68","saveSpec":null,"fetchSpec":"^1.0.68"},"_requiredBy":["/","/meadow-integration","/meadow-migrationmanager","/meadow-migrationmanager/pict-section-flow","/pict","/pict-docuserve","/pict-section-code","/pict-section-connection-form","/pict-section-content","/pict-section-flow","/pict-section-form","/pict-section-histogram","/pict-section-modal","/pict-section-theme","/pict-section-tuigrid","/pict-terminalui","/retold-harness","/stricture","/stricture/pict-terminalui"],"_resolved":"https://registry.npmjs.org/pict-view/-/pict-view-1.0.68.tgz","_shasum":"5df78b51e03625f624c988aad6c7f27b014e8f31","_spec":"pict-view@^1.0.68","_where":"/Users/jacksonpollard/pict","author":{"name":"steven velozo","email":"steven@velozo.com"},"bugs":{"url":"https://github.com/stevenvelozo/pict-view/issues"},"bundleDependencies":false,"dependencies":{"fable":"^3.1.67","fable-serviceproviderbase":"^3.0.19"},"deprecated":false,"description":"Pict View Base Class","devDependencies":{"@eslint/js":"^9.39.1","browser-env":"^3.3.0","eslint":"^9.39.1","pict":"^1.0.363","quackage":"^1.0.65","typescript":"^5.9.3"},"homepage":"https://github.com/stevenvelozo/pict-view#readme","license":"MIT","main":"source/Pict-View.js","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"]},"name":"pict-view","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/pict-view.git"},"scripts":{"build":"npx quack build","coverage":"npx quack coverage","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-view-image:local","docker-dev-run":"docker run -it -d --name pict-view-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict-view\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-view-image:local","docker-dev-shell":"docker exec -it pict-view-dev /bin/bash","lint":"eslint source/**","start":"node source/Pict-View.js","test":"npx quack test","tests":"npx quack test -g","types":"tsc -p ."},"types":"types/source/Pict-View.d.ts","version":"1.0.68"};},{}],146:[function(require,module,exports){const libFableServiceBase=require('fable-serviceproviderbase');const libPackage=require('../package.json');const defaultPictViewSettings={DefaultRenderable:false,DefaultDestinationAddress:false,DefaultTemplateRecordAddress:false,ViewIdentifier:false,// If this is set to true, when the App initializes this will.
|
|
4487
4491
|
// After the App initializes, initialize will be called as soon as it's added.
|
|
4488
4492
|
AutoInitialize:true,AutoInitializeOrdinal:0,// If this is set to true, when the App autorenders (on load) this will.
|
|
4489
4493
|
// After the App initializes, render will be called as soon as it's added.
|
|
@@ -4911,162 +4915,7 @@ return cachedClearTimeout.call(null,marker);}catch(e){// same as above but when
|
|
|
4911
4915
|
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
4912
4916
|
return cachedClearTimeout.call(this,marker);}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return;}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue);}else{queueIndex=-1;}if(queue.length){drainQueue();}}function drainQueue(){if(draining){return;}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run();}}queueIndex=-1;len=queue.length;}currentQueue=null;draining=false;runClearTimeout(timeout);}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i];}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue);}};// v8 likes predictible objects
|
|
4913
4917
|
function Item(fun,array){this.fun=fun;this.array=array;}Item.prototype.run=function(){this.fun.apply(null,this.array);};process.title='browser';process.browser=true;process.env={};process.argv=[];process.version='';// empty string to avoid regexp issues
|
|
4914
|
-
process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[];};process.binding=function(name){throw new Error('process.binding is not supported');};process.cwd=function(){return'/';};process.chdir=function(dir){throw new Error('process.chdir is not supported');};process.umask=function(){return 0;};},{}],151:[function(require,module,exports){
|
|
4915
|
-
* The `punycode` object.
|
|
4916
|
-
* @name punycode
|
|
4917
|
-
* @type Object
|
|
4918
|
-
*/var punycode,/** Highest positive signed 32-bit float value */maxInt=2147483647,// aka. 0x7FFFFFFF or 2^31-1
|
|
4919
|
-
/** Bootstring parameters */base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,// 0x80
|
|
4920
|
-
delimiter='-',// '\x2D'
|
|
4921
|
-
/** Regular expressions */regexPunycode=/^xn--/,regexNonASCII=/[^\x20-\x7E]/,// unprintable ASCII chars + non-ASCII chars
|
|
4922
|
-
regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,// RFC 3490 separators
|
|
4923
|
-
/** Error messages */errors={'overflow':'Overflow: input needs wider integers to process','not-basic':'Illegal input >= 0x80 (not a basic code point)','invalid-input':'Invalid input'},/** Convenience shortcuts */baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode,/** Temporary variable */key;/*--------------------------------------------------------------------------*//**
|
|
4924
|
-
* A generic error utility function.
|
|
4925
|
-
* @private
|
|
4926
|
-
* @param {String} type The error type.
|
|
4927
|
-
* @returns {Error} Throws a `RangeError` with the applicable error message.
|
|
4928
|
-
*/function error(type){throw new RangeError(errors[type]);}/**
|
|
4929
|
-
* A generic `Array#map` utility function.
|
|
4930
|
-
* @private
|
|
4931
|
-
* @param {Array} array The array to iterate over.
|
|
4932
|
-
* @param {Function} callback The function that gets called for every array
|
|
4933
|
-
* item.
|
|
4934
|
-
* @returns {Array} A new array of values returned by the callback function.
|
|
4935
|
-
*/function map(array,fn){var length=array.length;var result=[];while(length--){result[length]=fn(array[length]);}return result;}/**
|
|
4936
|
-
* A simple `Array#map`-like wrapper to work with domain name strings or email
|
|
4937
|
-
* addresses.
|
|
4938
|
-
* @private
|
|
4939
|
-
* @param {String} domain The domain name or email address.
|
|
4940
|
-
* @param {Function} callback The function that gets called for every
|
|
4941
|
-
* character.
|
|
4942
|
-
* @returns {Array} A new string of characters returned by the callback
|
|
4943
|
-
* function.
|
|
4944
|
-
*/function mapDomain(string,fn){var parts=string.split('@');var result='';if(parts.length>1){// In email addresses, only the domain name should be punycoded. Leave
|
|
4945
|
-
// the local part (i.e. everything up to `@`) intact.
|
|
4946
|
-
result=parts[0]+'@';string=parts[1];}// Avoid `split(regex)` for IE8 compatibility. See #17.
|
|
4947
|
-
string=string.replace(regexSeparators,'\x2E');var labels=string.split('.');var encoded=map(labels,fn).join('.');return result+encoded;}/**
|
|
4948
|
-
* Creates an array containing the numeric code points of each Unicode
|
|
4949
|
-
* character in the string. While JavaScript uses UCS-2 internally,
|
|
4950
|
-
* this function will convert a pair of surrogate halves (each of which
|
|
4951
|
-
* UCS-2 exposes as separate characters) into a single code point,
|
|
4952
|
-
* matching UTF-16.
|
|
4953
|
-
* @see `punycode.ucs2.encode`
|
|
4954
|
-
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
4955
|
-
* @memberOf punycode.ucs2
|
|
4956
|
-
* @name decode
|
|
4957
|
-
* @param {String} string The Unicode input string (UCS-2).
|
|
4958
|
-
* @returns {Array} The new array of code points.
|
|
4959
|
-
*/function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter<length){value=string.charCodeAt(counter++);if(value>=0xD800&&value<=0xDBFF&&counter<length){// high surrogate, and there is a next character
|
|
4960
|
-
extra=string.charCodeAt(counter++);if((extra&0xFC00)==0xDC00){// low surrogate
|
|
4961
|
-
output.push(((value&0x3FF)<<10)+(extra&0x3FF)+0x10000);}else{// unmatched surrogate; only append this code unit, in case the next
|
|
4962
|
-
// code unit is the high surrogate of a surrogate pair
|
|
4963
|
-
output.push(value);counter--;}}else{output.push(value);}}return output;}/**
|
|
4964
|
-
* Creates a string based on an array of numeric code points.
|
|
4965
|
-
* @see `punycode.ucs2.decode`
|
|
4966
|
-
* @memberOf punycode.ucs2
|
|
4967
|
-
* @name encode
|
|
4968
|
-
* @param {Array} codePoints The array of numeric code points.
|
|
4969
|
-
* @returns {String} The new Unicode string (UCS-2).
|
|
4970
|
-
*/function ucs2encode(array){return map(array,function(value){var output='';if(value>0xFFFF){value-=0x10000;output+=stringFromCharCode(value>>>10&0x3FF|0xD800);value=0xDC00|value&0x3FF;}output+=stringFromCharCode(value);return output;}).join('');}/**
|
|
4971
|
-
* Converts a basic code point into a digit/integer.
|
|
4972
|
-
* @see `digitToBasic()`
|
|
4973
|
-
* @private
|
|
4974
|
-
* @param {Number} codePoint The basic numeric code point value.
|
|
4975
|
-
* @returns {Number} The numeric value of a basic code point (for use in
|
|
4976
|
-
* representing integers) in the range `0` to `base - 1`, or `base` if
|
|
4977
|
-
* the code point does not represent a value.
|
|
4978
|
-
*/function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22;}if(codePoint-65<26){return codePoint-65;}if(codePoint-97<26){return codePoint-97;}return base;}/**
|
|
4979
|
-
* Converts a digit/integer into a basic code point.
|
|
4980
|
-
* @see `basicToDigit()`
|
|
4981
|
-
* @private
|
|
4982
|
-
* @param {Number} digit The numeric value of a basic code point.
|
|
4983
|
-
* @returns {Number} The basic code point whose value (when used for
|
|
4984
|
-
* representing integers) is `digit`, which needs to be in the range
|
|
4985
|
-
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
|
|
4986
|
-
* used; else, the lowercase form is used. The behavior is undefined
|
|
4987
|
-
* if `flag` is non-zero and `digit` has no uppercase form.
|
|
4988
|
-
*/function digitToBasic(digit,flag){// 0..25 map to ASCII a..z or A..Z
|
|
4989
|
-
// 26..35 map to ASCII 0..9
|
|
4990
|
-
return digit+22+75*(digit<26)-((flag!=0)<<5);}/**
|
|
4991
|
-
* Bias adaptation function as per section 3.4 of RFC 3492.
|
|
4992
|
-
* https://tools.ietf.org/html/rfc3492#section-3.4
|
|
4993
|
-
* @private
|
|
4994
|
-
*/function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for/* no initialization */(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}/**
|
|
4995
|
-
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
|
|
4996
|
-
* symbols.
|
|
4997
|
-
* @memberOf punycode
|
|
4998
|
-
* @param {String} input The Punycode string of ASCII-only symbols.
|
|
4999
|
-
* @returns {String} The resulting string of Unicode symbols.
|
|
5000
|
-
*/function decode(input){// Don't use UCS-2
|
|
5001
|
-
var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic,j,index,oldi,w,k,digit,t,/** Cached calculation results */baseMinusT;// Handle the basic code points: let `basic` be the number of input code
|
|
5002
|
-
// points before the last delimiter, or `0` if there is none, then copy
|
|
5003
|
-
// the first basic code points to the output.
|
|
5004
|
-
basic=input.lastIndexOf(delimiter);if(basic<0){basic=0;}for(j=0;j<basic;++j){// if it's not a basic code point
|
|
5005
|
-
if(input.charCodeAt(j)>=0x80){error('not-basic');}output.push(input.charCodeAt(j));}// Main decoding loop: start just after the last delimiter if any basic code
|
|
5006
|
-
// points were copied; start at the beginning otherwise.
|
|
5007
|
-
for/* no final expression */(index=basic>0?basic+1:0;index<inputLength;){// `index` is the index of the next character to be consumed.
|
|
5008
|
-
// Decode a generalized variable-length integer into `delta`,
|
|
5009
|
-
// which gets added to `i`. The overflow checking is easier
|
|
5010
|
-
// if we increase `i` as we go, then subtract off its starting
|
|
5011
|
-
// value at the end to obtain `delta`.
|
|
5012
|
-
for/* no condition */(oldi=i,w=1,k=base;;k+=base){if(index>=inputLength){error('invalid-input');}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error('overflow');}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break;}baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error('overflow');}w*=baseMinusT;}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);// `i` was supposed to wrap around from `out` to `0`,
|
|
5013
|
-
// incrementing `n` each time, so we'll fix that now:
|
|
5014
|
-
if(floor(i/out)>maxInt-n){error('overflow');}n+=floor(i/out);i%=out;// Insert `n` at position `i` of the output
|
|
5015
|
-
output.splice(i++,0,n);}return ucs2encode(output);}/**
|
|
5016
|
-
* Converts a string of Unicode symbols (e.g. a domain name label) to a
|
|
5017
|
-
* Punycode string of ASCII-only symbols.
|
|
5018
|
-
* @memberOf punycode
|
|
5019
|
-
* @param {String} input The string of Unicode symbols.
|
|
5020
|
-
* @returns {String} The resulting Punycode string of ASCII-only symbols.
|
|
5021
|
-
*/function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],/** `inputLength` will hold the number of code points in `input`. */inputLength,/** Cached calculation results */handledCPCountPlusOne,baseMinusT,qMinusT;// Convert the input in UCS-2 to Unicode
|
|
5022
|
-
input=ucs2decode(input);// Cache the length
|
|
5023
|
-
inputLength=input.length;// Initialize the state
|
|
5024
|
-
n=initialN;delta=0;bias=initialBias;// Handle the basic code points
|
|
5025
|
-
for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<0x80){output.push(stringFromCharCode(currentValue));}}handledCPCount=basicLength=output.length;// `handledCPCount` is the number of code points that have been handled;
|
|
5026
|
-
// `basicLength` is the number of basic code points.
|
|
5027
|
-
// Finish the basic string - if it is not empty - with a delimiter
|
|
5028
|
-
if(basicLength){output.push(delimiter);}// Main encoding loop:
|
|
5029
|
-
while(handledCPCount<inputLength){// All non-basic code points < n have been handled already. Find the next
|
|
5030
|
-
// larger one:
|
|
5031
|
-
for(m=maxInt,j=0;j<inputLength;++j){currentValue=input[j];if(currentValue>=n&¤tValue<m){m=currentValue;}}// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
|
|
5032
|
-
// but guard against overflow
|
|
5033
|
-
handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/handledCPCountPlusOne)){error('overflow');}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<n&&++delta>maxInt){error('overflow');}if(currentValue==n){// Represent delta as a generalized variable-length integer
|
|
5034
|
-
for/* no condition */(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break;}qMinusT=q-t;baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT);}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount;}}++delta;++n;}return output.join('');}/**
|
|
5035
|
-
* Converts a Punycode string representing a domain name or an email address
|
|
5036
|
-
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
|
|
5037
|
-
* it doesn't matter if you call it on a string that has already been
|
|
5038
|
-
* converted to Unicode.
|
|
5039
|
-
* @memberOf punycode
|
|
5040
|
-
* @param {String} input The Punycoded domain name or email address to
|
|
5041
|
-
* convert to Unicode.
|
|
5042
|
-
* @returns {String} The Unicode representation of the given Punycode
|
|
5043
|
-
* string.
|
|
5044
|
-
*/function toUnicode(input){return mapDomain(input,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string;});}/**
|
|
5045
|
-
* Converts a Unicode string representing a domain name or an email address to
|
|
5046
|
-
* Punycode. Only the non-ASCII parts of the domain name will be converted,
|
|
5047
|
-
* i.e. it doesn't matter if you call it with a domain that's already in
|
|
5048
|
-
* ASCII.
|
|
5049
|
-
* @memberOf punycode
|
|
5050
|
-
* @param {String} input The domain name or email address to convert, as a
|
|
5051
|
-
* Unicode string.
|
|
5052
|
-
* @returns {String} The Punycode representation of the given domain name or
|
|
5053
|
-
* email address.
|
|
5054
|
-
*/function toASCII(input){return mapDomain(input,function(string){return regexNonASCII.test(string)?'xn--'+encode(string):string;});}/*--------------------------------------------------------------------------*//** Define the public API */punycode={/**
|
|
5055
|
-
* A string representing the current Punycode.js version number.
|
|
5056
|
-
* @memberOf punycode
|
|
5057
|
-
* @type String
|
|
5058
|
-
*/'version':'1.4.1',/**
|
|
5059
|
-
* An object of methods to convert from JavaScript's internal character
|
|
5060
|
-
* representation (UCS-2) to Unicode code points, and back.
|
|
5061
|
-
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
5062
|
-
* @memberOf punycode
|
|
5063
|
-
* @type Object
|
|
5064
|
-
*/'ucs2':{'decode':ucs2decode,'encode':ucs2encode},'decode':decode,'encode':encode,'toASCII':toASCII,'toUnicode':toUnicode};/** Expose `punycode` */// Some AMD build optimizers, like r.js, check for specific condition patterns
|
|
5065
|
-
// like the following:
|
|
5066
|
-
if(typeof define=='function'&&typeof define.amd=='object'&&define.amd){define('punycode',function(){return punycode;});}else if(freeExports&&freeModule){if(module.exports==freeExports){// in Node.js, io.js, or RingoJS v0.8.0+
|
|
5067
|
-
freeModule.exports=punycode;}else{// in Narwhal or RingoJS v0.7.0-
|
|
5068
|
-
for(key in punycode){punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key]);}}}else{// in Rhino or a web browser
|
|
5069
|
-
root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],152:[function(require,module,exports){'use strict';var replace=String.prototype.replace;var percentTwenties=/%20/g;var Format={RFC1738:'RFC1738',RFC3986:'RFC3986'};module.exports={'default':Format.RFC3986,formatters:{RFC1738:function(value){return replace.call(value,percentTwenties,'+');},RFC3986:function(value){return String(value);}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986};},{}],153:[function(require,module,exports){'use strict';var stringify=require('./stringify');var parse=require('./parse');var formats=require('./formats');module.exports={formats:formats,parse:parse,stringify:stringify};},{"./formats":152,"./parse":154,"./stringify":155}],154:[function(require,module,exports){'use strict';var utils=require('./utils');var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var defaults={allowDots:false,allowEmptyArrays:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:'utf-8',charsetSentinel:false,comma:false,decodeDotInKeys:false,decoder:utils.decode,delimiter:'&',depth:5,duplicates:'combine',ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1000,parseArrays:true,plainObjects:false,strictDepth:false,strictMerge:true,strictNullHandling:false,throwOnLimitExceeded:false};var interpretNumericEntities=function(str){return str.replace(/&#(\d+);/g,function($0,numberStr){return String.fromCharCode(parseInt(numberStr,10));});};var parseArrayValue=function(val,options,currentArrayLength){if(val&&typeof val==='string'&&options.comma&&val.indexOf(',')>-1){return val.split(',');}if(options.throwOnLimitExceeded&¤tArrayLength>=options.arrayLimit){throw new RangeError('Array limit exceeded. Only '+options.arrayLimit+' element'+(options.arrayLimit===1?'':'s')+' allowed in an array.');}return val;};// This is what browsers will submit when the ✓ character occurs in an
|
|
4918
|
+
process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[];};process.binding=function(name){throw new Error('process.binding is not supported');};process.cwd=function(){return'/';};process.chdir=function(dir){throw new Error('process.chdir is not supported');};process.umask=function(){return 0;};},{}],151:[function(require,module,exports){'use strict';var replace=String.prototype.replace;var percentTwenties=/%20/g;var Format={RFC1738:'RFC1738',RFC3986:'RFC3986'};module.exports={'default':Format.RFC3986,formatters:{RFC1738:function(value){return replace.call(value,percentTwenties,'+');},RFC3986:function(value){return String(value);}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986};},{}],152:[function(require,module,exports){'use strict';var stringify=require('./stringify');var parse=require('./parse');var formats=require('./formats');module.exports={formats:formats,parse:parse,stringify:stringify};},{"./formats":151,"./parse":153,"./stringify":154}],153:[function(require,module,exports){'use strict';var utils=require('./utils');var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var defaults={allowDots:false,allowEmptyArrays:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:'utf-8',charsetSentinel:false,comma:false,decodeDotInKeys:false,decoder:utils.decode,delimiter:'&',depth:5,duplicates:'combine',ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1000,parseArrays:true,plainObjects:false,strictDepth:false,strictMerge:true,strictNullHandling:false,throwOnLimitExceeded:false};var interpretNumericEntities=function(str){return str.replace(/&#(\d+);/g,function($0,numberStr){return String.fromCharCode(parseInt(numberStr,10));});};var parseArrayValue=function(val,options,currentArrayLength){if(val&&typeof val==='string'&&options.comma&&val.indexOf(',')>-1){return val.split(',');}if(options.throwOnLimitExceeded&¤tArrayLength>=options.arrayLimit){throw new RangeError('Array limit exceeded. Only '+options.arrayLimit+' element'+(options.arrayLimit===1?'':'s')+' allowed in an array.');}return val;};// This is what browsers will submit when the ✓ character occurs in an
|
|
5070
4919
|
// application/x-www-form-urlencoded body and the encoding of the page containing
|
|
5071
4920
|
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
|
5072
4921
|
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
|
@@ -5074,18 +4923,30 @@ root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="und
|
|
|
5074
4923
|
var isoSentinel='utf8=%26%2310003%3B';// encodeURIComponent('✓')
|
|
5075
4924
|
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
|
5076
4925
|
var charsetSentinel='utf8=%E2%9C%93';// encodeURIComponent('✓')
|
|
5077
|
-
var parseValues=function parseQueryStringValues(str,options){var obj={__proto__:null};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,''):str;cleanStr=cleanStr.replace(/%5B/gi,'[').replace(/%5D/gi,']');var limit=options.parameterLimit===Infinity?void undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,options.throwOnLimitExceeded?limit+1:limit);if(options.throwOnLimitExceeded&&parts.length>limit){throw new RangeError('Parameter limit exceeded. Only '+limit+' parameter'+(limit===1?'':'s')+' allowed.');}var skipIndex=-1;// Keep track of where the utf8 sentinel was found
|
|
4926
|
+
var parseValues=function parseQueryStringValues(str,options){var obj={__proto__:null};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,''):str;cleanStr=cleanStr.replace(/%5B/gi,'[').replace(/%5D/gi,']');var limit=options.parameterLimit===Infinity?void undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,options.throwOnLimitExceeded&&typeof limit!=='undefined'?limit+1:limit);if(options.throwOnLimitExceeded&&typeof limit!=='undefined'&&parts.length>limit){throw new RangeError('Parameter limit exceeded. Only '+limit+' parameter'+(limit===1?'':'s')+' allowed.');}var skipIndex=-1;// Keep track of where the utf8 sentinel was found
|
|
5078
4927
|
var i;var charset=options.charset;if(options.charsetSentinel){for(i=0;i<parts.length;++i){if(parts[i].indexOf('utf8=')===0){if(parts[i]===charsetSentinel){charset='utf-8';}else if(parts[i]===isoSentinel){charset='iso-8859-1';}skipIndex=i;i=parts.length;// The eslint settings do not allow break;
|
|
5079
4928
|
}}}for(i=0;i<parts.length;++i){if(i===skipIndex){continue;}var part=parts[i];var bracketEqualsPos=part.indexOf(']=');var pos=bracketEqualsPos===-1?part.indexOf('='):bracketEqualsPos+1;var key;var val;if(pos===-1){key=options.decoder(part,defaults.decoder,charset,'key');val=options.strictNullHandling?null:'';}else{key=options.decoder(part.slice(0,pos),defaults.decoder,charset,'key');if(key!==null){val=utils.maybeMap(parseArrayValue(part.slice(pos+1),options,isArray(obj[key])?obj[key].length:0),function(encodedVal){return options.decoder(encodedVal,defaults.decoder,charset,'value');});}}if(val&&options.interpretNumericEntities&&charset==='iso-8859-1'){val=interpretNumericEntities(String(val));}if(part.indexOf('[]=')>-1){val=isArray(val)?[val]:val;}if(options.comma&&isArray(val)&&val.length>options.arrayLimit){if(options.throwOnLimitExceeded){throw new RangeError('Array limit exceeded. Only '+options.arrayLimit+' element'+(options.arrayLimit===1?'':'s')+' allowed in an array.');}val=utils.combine([],val,options.arrayLimit,options.plainObjects);}if(key!==null){var existing=has.call(obj,key);if(existing&&(options.duplicates==='combine'||part.indexOf('[]=')>-1)){obj[key]=utils.combine(obj[key],val,options.arrayLimit,options.plainObjects);}else if(!existing||options.duplicates==='last'){obj[key]=val;}}}return obj;};var parseObject=function(chain,val,options,valuesParsed){var currentArrayLength=0;if(chain.length>0&&chain[chain.length-1]==='[]'){var parentKey=chain.slice(0,-1).join('');currentArrayLength=Array.isArray(val)&&val[parentKey]?val[parentKey].length:0;}var leaf=valuesParsed?val:parseArrayValue(val,options,currentArrayLength);for(var i=chain.length-1;i>=0;--i){var obj;var root=chain[i];if(root==='[]'&&options.parseArrays){if(utils.isOverflow(leaf)){// leaf is already an overflow object, preserve it
|
|
5080
|
-
obj=leaf;}else{obj=options.allowEmptyArrays&&(leaf===''||options.strictNullHandling&&leaf===null)?[]:utils.combine([],leaf,options.arrayLimit,options.plainObjects);}}else{obj=options.plainObjects?{__proto__:null}:{};var cleanRoot=root.charAt(0)==='['&&root.charAt(root.length-1)===']'?root.slice(1,-1):root;var decodedRoot=options.decodeDotInKeys?cleanRoot.replace(/%2E/g,'.'):cleanRoot;var index=parseInt(decodedRoot,10);var isValidArrayIndex=!isNaN(index)&&root!==decodedRoot&&String(index)===decodedRoot&&index>=0&&options.parseArrays;if(!options.parseArrays&&decodedRoot===''){obj={0:leaf};}else if(isValidArrayIndex&&index<options.arrayLimit){obj=[];obj[index]=leaf;}else if(isValidArrayIndex&&options.throwOnLimitExceeded){throw new RangeError('Array limit exceeded. Only '+options.arrayLimit+' element'+(options.arrayLimit===1?'':'s')+' allowed in an array.');}else if(isValidArrayIndex){obj[index]=leaf;utils.markOverflow(obj,index);}else if(decodedRoot!=='__proto__'){obj[decodedRoot]=leaf;}}leaf=obj;}return leaf;}
|
|
4929
|
+
obj=leaf;}else{obj=options.allowEmptyArrays&&(leaf===''||options.strictNullHandling&&leaf===null)?[]:utils.combine([],leaf,options.arrayLimit,options.plainObjects);}}else{obj=options.plainObjects?{__proto__:null}:{};var cleanRoot=root.charAt(0)==='['&&root.charAt(root.length-1)===']'?root.slice(1,-1):root;var decodedRoot=options.decodeDotInKeys?cleanRoot.replace(/%2E/g,'.'):cleanRoot;var index=parseInt(decodedRoot,10);var isValidArrayIndex=!isNaN(index)&&root!==decodedRoot&&String(index)===decodedRoot&&index>=0&&options.parseArrays;if(!options.parseArrays&&decodedRoot===''){obj={0:leaf};}else if(isValidArrayIndex&&index<options.arrayLimit){obj=[];obj[index]=leaf;}else if(isValidArrayIndex&&options.throwOnLimitExceeded){throw new RangeError('Array limit exceeded. Only '+options.arrayLimit+' element'+(options.arrayLimit===1?'':'s')+' allowed in an array.');}else if(isValidArrayIndex){obj[index]=leaf;utils.markOverflow(obj,index);}else if(decodedRoot!=='__proto__'){obj[decodedRoot]=leaf;}}leaf=obj;}return leaf;};// Split a key like "a[b][c[]]" into ['a', '[b]', '[c[]]'] while preserving
|
|
4930
|
+
// qs parse semantics for depth/prototype guards.
|
|
4931
|
+
var splitKeyIntoSegments=function splitKeyIntoSegments(originalKey,options){var key=options.allowDots?originalKey.replace(/\.([^.[]+)/g,'[$1]'):originalKey;// depth <= 0 keeps the whole key as one segment
|
|
4932
|
+
if(options.depth<=0){if(!options.plainObjects&&has.call(Object.prototype,key)){if(!options.allowPrototypes){return;}}return[key];}var segments=[];// parent before the first '[' (may be empty if key starts with '[')
|
|
4933
|
+
var first=key.indexOf('[');var parent=first>=0?key.slice(0,first):key;if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return;}}segments[segments.length]=parent;}var n=key.length;var open=first;var collected=0;while(open>=0&&collected<options.depth){var level=1;var i=open+1;var close=-1;// balance nested '[' and ']' inside this bracket group using a nesting level counter
|
|
4934
|
+
while(i<n&&close<0){var cu=key.charCodeAt(i);if(cu===0x5B){// '['
|
|
4935
|
+
level+=1;}else if(cu===0x5D){// ']'
|
|
4936
|
+
level-=1;if(level===0){close=i;// found matching close; loop will exit by condition
|
|
4937
|
+
}}i+=1;}if(close<0){// Unterminated group: wrap the raw remainder in one bracket pair so it stays
|
|
4938
|
+
// a single literal segment (e.g. "[[]b" -> "[[]b]"); we do not infer missing ']'.
|
|
4939
|
+
segments[segments.length]='['+key.slice(open)+']';return segments;}var seg=key.slice(open,close+1);// prototype guard for the content of this group
|
|
4940
|
+
var content=seg.slice(1,-1);if(!options.plainObjects&&has.call(Object.prototype,content)&&!options.allowPrototypes){return;}segments[segments.length]=seg;collected+=1;// find the next '[' after this balanced group
|
|
4941
|
+
open=key.indexOf('[',close+1);}if(open>=0){if(options.strictDepth===true){throw new RangeError('Input depth exceeded depth option of '+options.depth+' and strictDepth is true');}segments[segments.length]='['+key.slice(open)+']';}return segments;};var parseKeys=function parseQueryStringKeys(givenKey,val,options,valuesParsed){if(!givenKey){return;}var keys=splitKeyIntoSegments(givenKey,options);if(!keys){return;}return parseObject(keys,val,options,valuesParsed);};var normalizeParseOptions=function normalizeParseOptions(opts){if(!opts){return defaults;}if(typeof opts.allowEmptyArrays!=='undefined'&&typeof opts.allowEmptyArrays!=='boolean'){throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');}if(typeof opts.decodeDotInKeys!=='undefined'&&typeof opts.decodeDotInKeys!=='boolean'){throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');}if(opts.decoder!==null&&typeof opts.decoder!=='undefined'&&typeof opts.decoder!=='function'){throw new TypeError('Decoder has to be a function.');}if(typeof opts.charset!=='undefined'&&opts.charset!=='utf-8'&&opts.charset!=='iso-8859-1'){throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}if(typeof opts.throwOnLimitExceeded!=='undefined'&&typeof opts.throwOnLimitExceeded!=='boolean'){throw new TypeError('`throwOnLimitExceeded` option must be a boolean');}var charset=typeof opts.charset==='undefined'?defaults.charset:opts.charset;var duplicates=typeof opts.duplicates==='undefined'?defaults.duplicates:opts.duplicates;if(duplicates!=='combine'&&duplicates!=='first'&&duplicates!=='last'){throw new TypeError('The duplicates option must be either combine, first, or last');}var allowDots=typeof opts.allowDots==='undefined'?opts.decodeDotInKeys===true?true:defaults.allowDots:!!opts.allowDots;return{allowDots:allowDots,allowEmptyArrays:typeof opts.allowEmptyArrays==='boolean'?!!opts.allowEmptyArrays:defaults.allowEmptyArrays,allowPrototypes:typeof opts.allowPrototypes==='boolean'?opts.allowPrototypes:defaults.allowPrototypes,allowSparse:typeof opts.allowSparse==='boolean'?opts.allowSparse:defaults.allowSparse,arrayLimit:typeof opts.arrayLimit==='number'?opts.arrayLimit:defaults.arrayLimit,charset:charset,charsetSentinel:typeof opts.charsetSentinel==='boolean'?opts.charsetSentinel:defaults.charsetSentinel,comma:typeof opts.comma==='boolean'?opts.comma:defaults.comma,decodeDotInKeys:typeof opts.decodeDotInKeys==='boolean'?opts.decodeDotInKeys:defaults.decodeDotInKeys,decoder:typeof opts.decoder==='function'?opts.decoder:defaults.decoder,delimiter:typeof opts.delimiter==='string'||utils.isRegExp(opts.delimiter)?opts.delimiter:defaults.delimiter,// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
5081
4942
|
depth:typeof opts.depth==='number'||opts.depth===false?+opts.depth:defaults.depth,duplicates:duplicates,ignoreQueryPrefix:opts.ignoreQueryPrefix===true,interpretNumericEntities:typeof opts.interpretNumericEntities==='boolean'?opts.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:typeof opts.parameterLimit==='number'?opts.parameterLimit:defaults.parameterLimit,parseArrays:opts.parseArrays!==false,plainObjects:typeof opts.plainObjects==='boolean'?opts.plainObjects:defaults.plainObjects,strictDepth:typeof opts.strictDepth==='boolean'?!!opts.strictDepth:defaults.strictDepth,strictMerge:typeof opts.strictMerge==='boolean'?!!opts.strictMerge:defaults.strictMerge,strictNullHandling:typeof opts.strictNullHandling==='boolean'?opts.strictNullHandling:defaults.strictNullHandling,throwOnLimitExceeded:typeof opts.throwOnLimitExceeded==='boolean'?opts.throwOnLimitExceeded:false};};module.exports=function(str,opts){var options=normalizeParseOptions(opts);if(str===''||str===null||typeof str==='undefined'){return options.plainObjects?{__proto__:null}:{};}var tempObj=typeof str==='string'?parseValues(str,options):str;var obj=options.plainObjects?{__proto__:null}:{};// Iterate over the keys and setup the new object
|
|
5082
|
-
var keys=Object.keys(tempObj);for(var i=0;i<keys.length;++i){var key=keys[i];var newObj=parseKeys(key,tempObj[key],options,typeof str==='string');obj=utils.merge(obj,newObj,options);}if(options.allowSparse===true){return obj;}return utils.compact(obj);};},{"./utils":
|
|
4943
|
+
var keys=Object.keys(tempObj);for(var i=0;i<keys.length;++i){var key=keys[i];var newObj=parseKeys(key,tempObj[key],options,typeof str==='string');obj=utils.merge(obj,newObj,options);}if(options.allowSparse===true){return obj;}return utils.compact(obj);};},{"./utils":155}],154:[function(require,module,exports){'use strict';var getSideChannel=require('side-channel');var utils=require('./utils');var formats=require('./formats');var has=Object.prototype.hasOwnProperty;var arrayPrefixGenerators={brackets:function brackets(prefix){return prefix+'[]';},comma:'comma',indices:function indices(prefix,key){return prefix+'['+key+']';},repeat:function repeat(prefix){return prefix;}};var isArray=Array.isArray;var push=Array.prototype.push;var pushToArray=function(arr,valueOrArray){push.apply(arr,isArray(valueOrArray)?valueOrArray:[valueOrArray]);};var toISO=Date.prototype.toISOString;var defaultFormat=formats['default'];var defaults={addQueryPrefix:false,allowDots:false,allowEmptyArrays:false,arrayFormat:'indices',charset:'utf-8',charsetSentinel:false,commaRoundTrip:false,delimiter:'&',encode:true,encodeDotInKeys:false,encoder:utils.encode,encodeValuesOnly:false,filter:void undefined,format:defaultFormat,formatter:formats.formatters[defaultFormat],// deprecated
|
|
5083
4944
|
indices:false,serializeDate:function serializeDate(date){return toISO.call(date);},skipNulls:false,strictNullHandling:false};var isNonNullishPrimitive=function isNonNullishPrimitive(v){return typeof v==='string'||typeof v==='number'||typeof v==='boolean'||typeof v==='symbol'||typeof v==='bigint';};var sentinel={};var stringify=function stringify(object,prefix,generateArrayPrefix,commaRoundTrip,allowEmptyArrays,strictNullHandling,skipNulls,encodeDotInKeys,encoder,filter,sort,allowDots,serializeDate,format,formatter,encodeValuesOnly,charset,sideChannel){var obj=object;var tmpSc=sideChannel;var step=0;var findFlag=false;while((tmpSc=tmpSc.get(sentinel))!==void undefined&&!findFlag){// Where object last appeared in the ref tree
|
|
5084
4945
|
var pos=tmpSc.get(object);step+=1;if(typeof pos!=='undefined'){if(pos===step){throw new RangeError('Cyclic object value');}else{findFlag=true;// Break while
|
|
5085
|
-
}}if(typeof tmpSc.get(sentinel)==='undefined'){step=0;}}if(typeof filter==='function'){obj=filter(prefix,obj);}else if(obj instanceof Date){obj=serializeDate(obj);}else if(generateArrayPrefix==='comma'&&isArray(obj)){obj=utils.maybeMap(obj,function(value){if(value instanceof Date){return serializeDate(value);}return value;});}if(obj===null){if(strictNullHandling){return encoder&&!encodeValuesOnly?encoder(prefix,defaults.encoder,charset,'key',format):prefix;}obj='';}if(isNonNullishPrimitive(obj)||utils.isBuffer(obj)){if(encoder){var keyValue=encodeValuesOnly?prefix:encoder(prefix,defaults.encoder,charset,'key',format);return[formatter(keyValue)+'='+formatter(encoder(obj,defaults.encoder,charset,'value',format))];}return[formatter(prefix)+'='+formatter(String(obj))];}var values=[];if(typeof obj==='undefined'){return values;}var objKeys;if(generateArrayPrefix==='comma'&&isArray(obj)){// we need to join elements in
|
|
5086
|
-
if(encodeValuesOnly&&encoder){obj=utils.maybeMap(obj,encoder);}objKeys=[{value:obj.length>0?obj.join(',')||null:void undefined}];}else if(isArray(filter)){objKeys=filter;}else{var keys=Object.keys(obj);objKeys=sort?keys.sort(sort):keys;}var encodedPrefix=encodeDotInKeys?String(prefix).replace(/\./g,'%2E'):String(prefix);var adjustedPrefix=commaRoundTrip&&isArray(obj)&&obj.length===1?encodedPrefix+'[]':encodedPrefix;if(allowEmptyArrays&&isArray(obj)&&obj.length===0){return adjustedPrefix+'[]';}for(var j=0;j<objKeys.length;++j){var key=objKeys[j];var value=typeof key==='object'&&key&&typeof key.value!=='undefined'?key.value:obj[key];if(skipNulls&&value===null){continue;}var encodedKey=allowDots&&encodeDotInKeys?String(key).replace(/\./g,'%2E'):String(key);var keyPrefix=isArray(obj)?typeof generateArrayPrefix==='function'?generateArrayPrefix(adjustedPrefix,encodedKey):adjustedPrefix:adjustedPrefix+(allowDots?'.'+encodedKey:'['+encodedKey+']');sideChannel.set(object,step);var valueSideChannel=getSideChannel();valueSideChannel.set(sentinel,sideChannel);pushToArray(values,stringify(value,keyPrefix,generateArrayPrefix,commaRoundTrip,allowEmptyArrays,strictNullHandling,skipNulls,encodeDotInKeys,generateArrayPrefix==='comma'&&encodeValuesOnly&&isArray(obj)?null:encoder,filter,sort,allowDots,serializeDate,format,formatter,encodeValuesOnly,charset,valueSideChannel));}return values;};var normalizeStringifyOptions=function normalizeStringifyOptions(opts){if(!opts){return defaults;}if(typeof opts.allowEmptyArrays!=='undefined'&&typeof opts.allowEmptyArrays!=='boolean'){throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');}if(typeof opts.encodeDotInKeys!=='undefined'&&typeof opts.encodeDotInKeys!=='boolean'){throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');}if(opts.encoder!==null&&typeof opts.encoder!=='undefined'&&typeof opts.encoder!=='function'){throw new TypeError('Encoder has to be a function.');}var charset=opts.charset||defaults.charset;if(typeof opts.charset!=='undefined'&&opts.charset!=='utf-8'&&opts.charset!=='iso-8859-1'){throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}var format=formats['default'];if(typeof opts.format!=='undefined'){if(!has.call(formats.formatters,opts.format)){throw new TypeError('Unknown format option provided.');}format=opts.format;}var formatter=formats.formatters[format];var filter=defaults.filter;if(typeof opts.filter==='function'||isArray(opts.filter)){filter=opts.filter;}var arrayFormat;if(opts.arrayFormat in arrayPrefixGenerators){arrayFormat=opts.arrayFormat;}else if('indices'in opts){arrayFormat=opts.indices?'indices':'repeat';}else{arrayFormat=defaults.arrayFormat;}if('commaRoundTrip'in opts&&typeof opts.commaRoundTrip!=='boolean'){throw new TypeError('`commaRoundTrip` must be a boolean, or absent');}var allowDots=typeof opts.allowDots==='undefined'?opts.encodeDotInKeys===true?true:defaults.allowDots:!!opts.allowDots;return{addQueryPrefix:typeof opts.addQueryPrefix==='boolean'?opts.addQueryPrefix:defaults.addQueryPrefix,allowDots:allowDots,allowEmptyArrays:typeof opts.allowEmptyArrays==='boolean'?!!opts.allowEmptyArrays:defaults.allowEmptyArrays,arrayFormat:arrayFormat,charset:charset,charsetSentinel:typeof opts.charsetSentinel==='boolean'?opts.charsetSentinel:defaults.charsetSentinel,commaRoundTrip:!!opts.commaRoundTrip,delimiter:typeof opts.delimiter==='undefined'?defaults.delimiter:opts.delimiter,encode:typeof opts.encode==='boolean'?opts.encode:defaults.encode,encodeDotInKeys:typeof opts.encodeDotInKeys==='boolean'?opts.encodeDotInKeys:defaults.encodeDotInKeys,encoder:typeof opts.encoder==='function'?opts.encoder:defaults.encoder,encodeValuesOnly:typeof opts.encodeValuesOnly==='boolean'?opts.encodeValuesOnly:defaults.encodeValuesOnly,filter:filter,format:format,formatter:formatter,serializeDate:typeof opts.serializeDate==='function'?opts.serializeDate:defaults.serializeDate,skipNulls:typeof opts.skipNulls==='boolean'?opts.skipNulls:defaults.skipNulls,sort:typeof opts.sort==='function'?opts.sort:null,strictNullHandling:typeof opts.strictNullHandling==='boolean'?opts.strictNullHandling:defaults.strictNullHandling};};module.exports=function(object,opts){var obj=object;var options=normalizeStringifyOptions(opts);var objKeys;var filter;if(typeof options.filter==='function'){filter=options.filter;obj=filter('',obj);}else if(isArray(options.filter)){filter=options.filter;objKeys=filter;}var keys=[];if(typeof obj!=='object'||obj===null){return'';}var generateArrayPrefix=arrayPrefixGenerators[options.arrayFormat];var commaRoundTrip=generateArrayPrefix==='comma'&&options.commaRoundTrip;if(!objKeys){objKeys=Object.keys(obj);}if(options.sort){objKeys.sort(options.sort);}var sideChannel=getSideChannel();for(var i=0;i<objKeys.length;++i){var key=objKeys[i];var value=obj[key];if(options.skipNulls&&value===null){continue;}pushToArray(keys,stringify(value,key,generateArrayPrefix,commaRoundTrip,options.allowEmptyArrays,options.strictNullHandling,options.skipNulls,options.encodeDotInKeys,options.encode?options.encoder:null,options.filter,options.sort,options.allowDots,options.serializeDate,options.format,options.formatter,options.encodeValuesOnly,options.charset,sideChannel));}var joined=keys.join(options.delimiter);var prefix=options.addQueryPrefix===true?'?':'';if(options.charsetSentinel){if(options.charset==='iso-8859-1'){// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
5087
|
-
prefix+='utf8=%26%2310003%3B
|
|
5088
|
-
prefix+='utf8=%E2%9C%93
|
|
4946
|
+
}}if(typeof tmpSc.get(sentinel)==='undefined'){step=0;}}if(typeof filter==='function'){obj=filter(prefix,obj);}else if(obj instanceof Date){obj=serializeDate(obj);}else if(generateArrayPrefix==='comma'&&isArray(obj)){obj=utils.maybeMap(obj,function(value){if(value instanceof Date){return serializeDate(value);}return value;});}if(obj===null){if(strictNullHandling){return formatter(encoder&&!encodeValuesOnly?encoder(prefix,defaults.encoder,charset,'key',format):prefix);}obj='';}if(isNonNullishPrimitive(obj)||utils.isBuffer(obj)){if(encoder){var keyValue=encodeValuesOnly?prefix:encoder(prefix,defaults.encoder,charset,'key',format);return[formatter(keyValue)+'='+formatter(encoder(obj,defaults.encoder,charset,'value',format))];}return[formatter(prefix)+'='+formatter(String(obj))];}var values=[];if(typeof obj==='undefined'){return values;}var objKeys;if(generateArrayPrefix==='comma'&&isArray(obj)){// we need to join elements in
|
|
4947
|
+
if(encodeValuesOnly&&encoder){obj=utils.maybeMap(obj,function(v){return v==null?v:encoder(v);});}objKeys=[{value:obj.length>0?obj.join(',')||null:void undefined}];}else if(isArray(filter)){objKeys=filter;}else{var keys=Object.keys(obj);objKeys=sort?keys.sort(sort):keys;}var encodedPrefix=encodeDotInKeys?String(prefix).replace(/\./g,'%2E'):String(prefix);var adjustedPrefix=commaRoundTrip&&isArray(obj)&&obj.length===1?encodedPrefix+'[]':encodedPrefix;if(allowEmptyArrays&&isArray(obj)&&obj.length===0){return adjustedPrefix+'[]';}for(var j=0;j<objKeys.length;++j){var key=objKeys[j];var value=typeof key==='object'&&key&&typeof key.value!=='undefined'?key.value:obj[key];if(skipNulls&&value===null){continue;}var encodedKey=allowDots&&encodeDotInKeys?String(key).replace(/\./g,'%2E'):String(key);var keyPrefix=isArray(obj)?typeof generateArrayPrefix==='function'?generateArrayPrefix(adjustedPrefix,encodedKey):adjustedPrefix:adjustedPrefix+(allowDots?'.'+encodedKey:'['+encodedKey+']');sideChannel.set(object,step);var valueSideChannel=getSideChannel();valueSideChannel.set(sentinel,sideChannel);pushToArray(values,stringify(value,keyPrefix,generateArrayPrefix,commaRoundTrip,allowEmptyArrays,strictNullHandling,skipNulls,encodeDotInKeys,generateArrayPrefix==='comma'&&encodeValuesOnly&&isArray(obj)?null:encoder,filter,sort,allowDots,serializeDate,format,formatter,encodeValuesOnly,charset,valueSideChannel));}return values;};var normalizeStringifyOptions=function normalizeStringifyOptions(opts){if(!opts){return defaults;}if(typeof opts.allowEmptyArrays!=='undefined'&&typeof opts.allowEmptyArrays!=='boolean'){throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');}if(typeof opts.encodeDotInKeys!=='undefined'&&typeof opts.encodeDotInKeys!=='boolean'){throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');}if(opts.encoder!==null&&typeof opts.encoder!=='undefined'&&typeof opts.encoder!=='function'){throw new TypeError('Encoder has to be a function.');}var charset=opts.charset||defaults.charset;if(typeof opts.charset!=='undefined'&&opts.charset!=='utf-8'&&opts.charset!=='iso-8859-1'){throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}var format=formats['default'];if(typeof opts.format!=='undefined'){if(!has.call(formats.formatters,opts.format)){throw new TypeError('Unknown format option provided.');}format=opts.format;}var formatter=formats.formatters[format];var filter=defaults.filter;if(typeof opts.filter==='function'||isArray(opts.filter)){filter=opts.filter;}var arrayFormat;if(opts.arrayFormat in arrayPrefixGenerators){arrayFormat=opts.arrayFormat;}else if('indices'in opts){arrayFormat=opts.indices?'indices':'repeat';}else{arrayFormat=defaults.arrayFormat;}if('commaRoundTrip'in opts&&typeof opts.commaRoundTrip!=='boolean'){throw new TypeError('`commaRoundTrip` must be a boolean, or absent');}var allowDots=typeof opts.allowDots==='undefined'?opts.encodeDotInKeys===true?true:defaults.allowDots:!!opts.allowDots;return{addQueryPrefix:typeof opts.addQueryPrefix==='boolean'?opts.addQueryPrefix:defaults.addQueryPrefix,allowDots:allowDots,allowEmptyArrays:typeof opts.allowEmptyArrays==='boolean'?!!opts.allowEmptyArrays:defaults.allowEmptyArrays,arrayFormat:arrayFormat,charset:charset,charsetSentinel:typeof opts.charsetSentinel==='boolean'?opts.charsetSentinel:defaults.charsetSentinel,commaRoundTrip:!!opts.commaRoundTrip,delimiter:typeof opts.delimiter==='undefined'?defaults.delimiter:opts.delimiter,encode:typeof opts.encode==='boolean'?opts.encode:defaults.encode,encodeDotInKeys:typeof opts.encodeDotInKeys==='boolean'?opts.encodeDotInKeys:defaults.encodeDotInKeys,encoder:typeof opts.encoder==='function'?opts.encoder:defaults.encoder,encodeValuesOnly:typeof opts.encodeValuesOnly==='boolean'?opts.encodeValuesOnly:defaults.encodeValuesOnly,filter:filter,format:format,formatter:formatter,serializeDate:typeof opts.serializeDate==='function'?opts.serializeDate:defaults.serializeDate,skipNulls:typeof opts.skipNulls==='boolean'?opts.skipNulls:defaults.skipNulls,sort:typeof opts.sort==='function'?opts.sort:null,strictNullHandling:typeof opts.strictNullHandling==='boolean'?opts.strictNullHandling:defaults.strictNullHandling};};module.exports=function(object,opts){var obj=object;var options=normalizeStringifyOptions(opts);var objKeys;var filter;if(typeof options.filter==='function'){filter=options.filter;obj=filter('',obj);}else if(isArray(options.filter)){filter=options.filter;objKeys=filter;}var keys=[];if(typeof obj!=='object'||obj===null){return'';}var generateArrayPrefix=arrayPrefixGenerators[options.arrayFormat];var commaRoundTrip=generateArrayPrefix==='comma'&&options.commaRoundTrip;if(!objKeys){objKeys=Object.keys(obj);}if(options.sort){objKeys.sort(options.sort);}var sideChannel=getSideChannel();for(var i=0;i<objKeys.length;++i){var key=objKeys[i];if(typeof key==='undefined'||key===null){continue;}var value=obj[key];if(options.skipNulls&&value===null){continue;}pushToArray(keys,stringify(value,key,generateArrayPrefix,commaRoundTrip,options.allowEmptyArrays,options.strictNullHandling,options.skipNulls,options.encodeDotInKeys,options.encode?options.encoder:null,options.filter,options.sort,options.allowDots,options.serializeDate,options.format,options.formatter,options.encodeValuesOnly,options.charset,sideChannel));}var joined=keys.join(options.delimiter);var prefix=options.addQueryPrefix===true?'?':'';if(options.charsetSentinel){if(options.charset==='iso-8859-1'){// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
4948
|
+
prefix+='utf8=%26%2310003%3B'+options.delimiter;}else{// encodeURIComponent('✓')
|
|
4949
|
+
prefix+='utf8=%E2%9C%93'+options.delimiter;}}return joined.length>0?prefix+joined:'';};},{"./formats":151,"./utils":155,"side-channel":163}],155:[function(require,module,exports){'use strict';var formats=require('./formats');var getSideChannel=require('side-channel');var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;// Track objects created from arrayLimit overflow using side-channel
|
|
5089
4950
|
// Stores the current max numeric index for O(1) lookup
|
|
5090
4951
|
var overflowChannel=getSideChannel();var markOverflow=function markOverflow(obj,maxIndex){overflowChannel.set(obj,maxIndex);return obj;};var isOverflow=function isOverflow(obj){return overflowChannel.has(obj);};var getMaxIndex=function getMaxIndex(obj){return overflowChannel.get(obj);};var setMaxIndex=function setMaxIndex(obj,maxIndex){overflowChannel.set(obj,maxIndex);};var hexTable=function(){var array=[];for(var i=0;i<256;++i){array[array.length]='%'+((i<16?'0':'')+i.toString(16)).toUpperCase();}return array;}();var compactQueue=function compactQueue(queue){while(queue.length>1){var item=queue.pop();var obj=item.obj[item.prop];if(isArray(obj)){var compacted=[];for(var j=0;j<obj.length;++j){if(typeof obj[j]!=='undefined'){compacted[compacted.length]=obj[j];}}item.obj[item.prop]=compacted;}}};var arrayToObject=function arrayToObject(source,options){var obj=options&&options.plainObjects?{__proto__:null}:{};for(var i=0;i<source.length;++i){if(typeof source[i]!=='undefined'){obj[i]=source[i];}}return obj;};var merge=function merge(target,source,options){/* eslint no-param-reassign: 0 */if(!source){return target;}if(typeof source!=='object'&&typeof source!=='function'){if(isArray(target)){var nextIndex=target.length;if(options&&typeof options.arrayLimit==='number'&&nextIndex>options.arrayLimit){return markOverflow(arrayToObject(target.concat(source),options),nextIndex);}target[nextIndex]=source;}else if(target&&typeof target==='object'){if(isOverflow(target)){// Add at next numeric index for overflow objects
|
|
5091
4952
|
var newIndex=getMaxIndex(target)+1;target[newIndex]=source;setMaxIndex(target,newIndex);}else if(options&&options.strictMerge){return[target,source];}else if(options&&(options.plainObjects||options.allowPrototypes)||!has.call(Object.prototype,source)){target[source]=true;}}else{return[target,source];}return target;}if(!target||typeof target!=='object'){if(isOverflow(source)){// Create new object with target at 0, source values shifted by 1
|
|
@@ -5102,7 +4963,7 @@ if(str.length===0){return str;}var string=str;if(typeof str==='symbol'){string=S
|
|
|
5102
4963
|
||c>=0x61&&c<=0x7A// A-Z
|
|
5103
4964
|
||format===formats.RFC1738&&(c===0x28||c===0x29)// ( )
|
|
5104
4965
|
){arr[arr.length]=segment.charAt(i);continue;}if(c<0x80){arr[arr.length]=hexTable[c];continue;}if(c<0x800){arr[arr.length]=hexTable[0xC0|c>>6]+hexTable[0x80|c&0x3F];continue;}if(c<0xD800||c>=0xE000){arr[arr.length]=hexTable[0xE0|c>>12]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F];continue;}i+=1;c=0x10000+((c&0x3FF)<<10|segment.charCodeAt(i)&0x3FF);arr[arr.length]=hexTable[0xF0|c>>18]+hexTable[0x80|c>>12&0x3F]+hexTable[0x80|c>>6&0x3F]+hexTable[0x80|c&0x3F];}out+=arr.join('');}return out;};var compact=function compact(value){var queue=[{obj:{o:value},prop:'o'}];var refs=[];for(var i=0;i<queue.length;++i){var item=queue[i];var obj=item.obj[item.prop];var keys=Object.keys(obj);for(var j=0;j<keys.length;++j){var key=keys[j];var val=obj[key];if(typeof val==='object'&&val!==null&&refs.indexOf(val)===-1){queue[queue.length]={obj:obj,prop:key};refs[refs.length]=val;}}}compactQueue(queue);return value;};var isRegExp=function isRegExp(obj){return Object.prototype.toString.call(obj)==='[object RegExp]';};var isBuffer=function isBuffer(obj){if(!obj||typeof obj!=='object'){return false;}return!!(obj.constructor&&obj.constructor.isBuffer&&obj.constructor.isBuffer(obj));};var combine=function combine(a,b,arrayLimit,plainObjects){// If 'a' is already an overflow object, add to it
|
|
5105
|
-
if(isOverflow(a)){var newIndex=getMaxIndex(a)+1;a[newIndex]=b;setMaxIndex(a,newIndex);return a;}var result=[].concat(a,b);if(result.length>arrayLimit){return markOverflow(arrayToObject(result,{plainObjects:plainObjects}),result.length-1);}return result;};var maybeMap=function maybeMap(val,fn){if(isArray(val)){var mapped=[];for(var i=0;i<val.length;i+=1){mapped[mapped.length]=fn(val[i]);}return mapped;}return fn(val);};module.exports={arrayToObject:arrayToObject,assign:assign,combine:combine,compact:compact,decode:decode,encode:encode,isBuffer:isBuffer,isOverflow:isOverflow,isRegExp:isRegExp,markOverflow:markOverflow,maybeMap:maybeMap,merge:merge};},{"./formats":
|
|
4966
|
+
if(isOverflow(a)){var newIndex=getMaxIndex(a)+1;a[newIndex]=b;setMaxIndex(a,newIndex);return a;}var result=[].concat(a,b);if(result.length>arrayLimit){return markOverflow(arrayToObject(result,{plainObjects:plainObjects}),result.length-1);}return result;};var maybeMap=function maybeMap(val,fn){if(isArray(val)){var mapped=[];for(var i=0;i<val.length;i+=1){mapped[mapped.length]=fn(val[i]);}return mapped;}return fn(val);};module.exports={arrayToObject:arrayToObject,assign:assign,combine:combine,compact:compact,decode:decode,encode:encode,isBuffer:isBuffer,isOverflow:isOverflow,isRegExp:isRegExp,markOverflow:markOverflow,maybeMap:maybeMap,merge:merge};},{"./formats":151,"side-channel":163}],156:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
5106
4967
|
//
|
|
5107
4968
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
5108
4969
|
// copy of this software and associated documentation files (the
|
|
@@ -5126,7 +4987,7 @@ if(isOverflow(a)){var newIndex=getMaxIndex(a)+1;a[newIndex]=b;setMaxIndex(a,newI
|
|
|
5126
4987
|
// obj.hasOwnProperty(prop) will break.
|
|
5127
4988
|
// See: https://github.com/joyent/node/issues/1707
|
|
5128
4989
|
function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}module.exports=function(qs,sep,eq,options){sep=sep||'&';eq=eq||'=';var obj={};if(typeof qs!=='string'||qs.length===0){return obj;}var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1000;if(options&&typeof options.maxKeys==='number'){maxKeys=options.maxKeys;}var len=qs.length;// maxKeys <= 0 means that we should not limit keys count
|
|
5129
|
-
if(maxKeys>0&&len>maxKeys){len=maxKeys;}for(var i=0;i<len;++i){var x=qs[i].replace(regexp,'%20'),idx=x.indexOf(eq),kstr,vstr,k,v;if(idx>=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1);}else{kstr=x;vstr='';}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v;}else if(isArray(obj[k])){obj[k].push(v);}else{obj[k]=[obj[k],v];}}return obj;};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};},{}],
|
|
4990
|
+
if(maxKeys>0&&len>maxKeys){len=maxKeys;}for(var i=0;i<len;++i){var x=qs[i].replace(regexp,'%20'),idx=x.indexOf(eq),kstr,vstr,k,v;if(idx>=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1);}else{kstr=x;vstr='';}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k)){obj[k]=v;}else if(isArray(obj[k])){obj[k].push(v);}else{obj[k]=[obj[k],v];}}return obj;};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};},{}],157:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
5130
4991
|
//
|
|
5131
4992
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
5132
4993
|
// copy of this software and associated documentation files (the
|
|
@@ -5146,10 +5007,10 @@ if(maxKeys>0&&len>maxKeys){len=maxKeys;}for(var i=0;i<len;++i){var x=qs[i].repla
|
|
|
5146
5007
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
5147
5008
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
5148
5009
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
5149
|
-
'use strict';var stringifyPrimitive=function(v){switch(typeof v){case'string':return v;case'boolean':return v?'true':'false';case'number':return isFinite(v)?v:'';default:return'';}};module.exports=function(obj,sep,eq,name){sep=sep||'&';eq=eq||'=';if(obj===null){obj=undefined;}if(typeof obj==='object'){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v));}).join(sep);}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]));}}).join(sep);}if(!name)return'';return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj));};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i<xs.length;i++){res.push(f(xs[i],i));}return res;}var objectKeys=Object.keys||function(obj){var res=[];for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))res.push(key);}return res;};},{}],
|
|
5010
|
+
'use strict';var stringifyPrimitive=function(v){switch(typeof v){case'string':return v;case'boolean':return v?'true':'false';case'number':return isFinite(v)?v:'';default:return'';}};module.exports=function(obj,sep,eq,name){sep=sep||'&';eq=eq||'=';if(obj===null){obj=undefined;}if(typeof obj==='object'){return map(objectKeys(obj),function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+eq;if(isArray(obj[k])){return map(obj[k],function(v){return ks+encodeURIComponent(stringifyPrimitive(v));}).join(sep);}else{return ks+encodeURIComponent(stringifyPrimitive(obj[k]));}}).join(sep);}if(!name)return'';return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj));};var isArray=Array.isArray||function(xs){return Object.prototype.toString.call(xs)==='[object Array]';};function map(xs,f){if(xs.map)return xs.map(f);var res=[];for(var i=0;i<xs.length;i++){res.push(f(xs[i],i));}return res;}var objectKeys=Object.keys||function(obj){var res=[];for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))res.push(key);}return res;};},{}],158:[function(require,module,exports){'use strict';exports.decode=exports.parse=require('./decode');exports.encode=exports.stringify=require('./encode');},{"./decode":156,"./encode":157}],159:[function(require,module,exports){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *//* eslint-disable node/no-deprecated-api */var buffer=require('buffer');var Buffer=buffer.Buffer;// alternative to using Object.keys for old browsers
|
|
5150
5011
|
function copyProps(src,dst){for(var key in src){dst[key]=src[key];}}if(Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow){module.exports=buffer;}else{// Copy properties from require('buffer')
|
|
5151
5012
|
copyProps(buffer,exports);exports.Buffer=SafeBuffer;}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length);}SafeBuffer.prototype=Object.create(Buffer.prototype);// Copy static methods from Buffer
|
|
5152
|
-
copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==='number'){throw new TypeError('Argument must not be a number');}return Buffer(arg,encodingOrOffset,length);};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==='string'){buf.fill(fill,encoding);}else{buf.fill(fill);}}else{buf.fill(0);}return buf;};SafeBuffer.allocUnsafe=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return Buffer(size);};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return buffer.SlowBuffer(size);};},{"buffer":20}],
|
|
5013
|
+
copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==='number'){throw new TypeError('Argument must not be a number');}return Buffer(arg,encodingOrOffset,length);};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==='string'){buf.fill(fill,encoding);}else{buf.fill(fill);}}else{buf.fill(0);}return buf;};SafeBuffer.allocUnsafe=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return Buffer(size);};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=='number'){throw new TypeError('Argument must be a number');}return buffer.SlowBuffer(size);};},{"buffer":20}],160:[function(require,module,exports){'use strict';var inspect=require('object-inspect');var $TypeError=require('es-errors/type');/*
|
|
5153
5014
|
* This function traverses the list returning the node corresponding to the given key.
|
|
5154
5015
|
*
|
|
5155
5016
|
* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.
|
|
@@ -5161,17 +5022,16 @@ curr.next=/** @type {NonNullable<typeof list.next>} */list.next;list.next=curr;/
|
|
|
5161
5022
|
}return curr;}}};/** @type {import('./list.d.ts').listGet} */var listGet=function(objects,key){if(!objects){return void undefined;}var node=listGetNode(objects,key);return node&&node.value;};/** @type {import('./list.d.ts').listSet} */var listSet=function(objects,key,value){var node=listGetNode(objects,key);if(node){node.value=value;}else{// Prepend the new node to the beginning of the list
|
|
5162
5023
|
objects.next=/** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */{// eslint-disable-line no-param-reassign, no-extra-parens
|
|
5163
5024
|
key:key,next:objects.next,value:value};}};/** @type {import('./list.d.ts').listHas} */var listHas=function(objects,key){if(!objects){return false;}return!!listGetNode(objects,key);};/** @type {import('./list.d.ts').listDelete} */// eslint-disable-next-line consistent-return
|
|
5164
|
-
var listDelete=function(objects,key){if(objects){return listGetNode(objects,key,true);}};/** @type {import('.')} */module.exports=function getSideChannelList(){/** @typedef {ReturnType<typeof getSideChannelList>} Channel *//** @typedef {Parameters<Channel['get']>[0]} K *//** @typedef {Parameters<Channel['set']>[1]} V *//** @type {import('./list.d.ts').RootNode<V, K> | undefined} */var $o;/** @type {Channel} */var channel={assert:function(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function(key){var
|
|
5025
|
+
var listDelete=function(objects,key){if(objects){return listGetNode(objects,key,true);}};/** @type {import('.')} */module.exports=function getSideChannelList(){/** @typedef {ReturnType<typeof getSideChannelList>} Channel *//** @typedef {Parameters<Channel['get']>[0]} K *//** @typedef {Parameters<Channel['set']>[1]} V *//** @type {import('./list.d.ts').RootNode<V, K> | undefined} */var $o;/** @type {Channel} */var channel={assert:function(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function(key){var deletedNode=listDelete($o,key);if(deletedNode&&$o&&!$o.next){$o=void undefined;}return!!deletedNode;},get:function(key){return listGet($o,key);},has:function(key){return listHas($o,key);},set:function(key,value){if(!$o){// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
|
|
5165
5026
|
$o={next:void undefined};}// eslint-disable-next-line no-extra-parens
|
|
5166
|
-
listSet(/** @type {NonNullable<typeof $o>} */$o,key,value);}}
|
|
5167
|
-
return channel;};},{"es-errors/type":47,"object-inspect":136}],162:[function(require,module,exports){'use strict';var GetIntrinsic=require('get-intrinsic');var callBound=require('call-bound');var inspect=require('object-inspect');var $TypeError=require('es-errors/type');var $Map=GetIntrinsic('%Map%',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */var $mapGet=callBound('Map.prototype.get',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */var $mapSet=callBound('Map.prototype.set',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */var $mapHas=callBound('Map.prototype.has',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */var $mapDelete=callBound('Map.prototype.delete',true);/** @type {<K, V>(thisArg: Map<K, V>) => number} */var $mapSize=callBound('Map.prototype.size',true);/** @type {import('.')} */module.exports=!!$Map&&/** @type {Exclude<import('.'), false>} */function getSideChannelMap(){/** @typedef {ReturnType<typeof getSideChannelMap>} Channel *//** @typedef {Parameters<Channel['get']>[0]} K *//** @typedef {Parameters<Channel['set']>[1]} V *//** @type {Map<K, V> | undefined} */var $m;/** @type {Channel} */var channel={assert:function(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function(key){if($m){var result=$mapDelete($m,key);if($mapSize($m)===0){$m=void undefined;}return result;}return false;},get:function(key){// eslint-disable-line consistent-return
|
|
5027
|
+
listSet(/** @type {NonNullable<typeof $o>} */$o,key,value);}};return channel;};},{"es-errors/type":47,"object-inspect":136}],161:[function(require,module,exports){'use strict';var GetIntrinsic=require('get-intrinsic');var callBound=require('call-bound');var inspect=require('object-inspect');var $TypeError=require('es-errors/type');var $Map=GetIntrinsic('%Map%',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */var $mapGet=callBound('Map.prototype.get',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */var $mapSet=callBound('Map.prototype.set',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */var $mapHas=callBound('Map.prototype.has',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */var $mapDelete=callBound('Map.prototype.delete',true);/** @type {<K, V>(thisArg: Map<K, V>) => number} */var $mapSize=callBound('Map.prototype.size',true);/** @type {import('.')} */module.exports=!!$Map&&/** @type {Exclude<import('.'), false>} */function getSideChannelMap(){/** @typedef {ReturnType<typeof getSideChannelMap>} Channel *//** @typedef {Parameters<Channel['get']>[0]} K *//** @typedef {Parameters<Channel['set']>[1]} V *//** @type {Map<K, V> | undefined} */var $m;/** @type {Channel} */var channel={assert:function(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function(key){if($m){var result=$mapDelete($m,key);if($mapSize($m)===0){$m=void undefined;}return result;}return false;},get:function(key){// eslint-disable-line consistent-return
|
|
5168
5028
|
if($m){return $mapGet($m,key);}},has:function(key){if($m){return $mapHas($m,key);}return false;},set:function(key,value){if(!$m){// @ts-expect-error TS can't handle narrowing a variable inside a closure
|
|
5169
5029
|
$m=new $Map();}$mapSet($m,key,value);}};// @ts-expect-error TODO: figure out why TS is erroring here
|
|
5170
|
-
return channel;};},{"call-bound":30,"es-errors/type":47,"get-intrinsic":104,"object-inspect":136}],
|
|
5030
|
+
return channel;};},{"call-bound":30,"es-errors/type":47,"get-intrinsic":104,"object-inspect":136}],162:[function(require,module,exports){'use strict';var GetIntrinsic=require('get-intrinsic');var callBound=require('call-bound');var inspect=require('object-inspect');var getSideChannelMap=require('side-channel-map');var $TypeError=require('es-errors/type');var $WeakMap=GetIntrinsic('%WeakMap%',true);/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */var $weakMapGet=callBound('WeakMap.prototype.get',true);/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */var $weakMapSet=callBound('WeakMap.prototype.set',true);/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */var $weakMapHas=callBound('WeakMap.prototype.has',true);/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */var $weakMapDelete=callBound('WeakMap.prototype.delete',true);/** @type {import('.')} */module.exports=$WeakMap?/** @type {Exclude<import('.'), false>} */function getSideChannelWeakMap(){/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel *//** @typedef {Parameters<Channel['get']>[0]} K *//** @typedef {Parameters<Channel['set']>[1]} V *//** @type {WeakMap<K & object, V> | undefined} */var $wm;/** @type {Channel | undefined} */var $m;/** @type {Channel} */var channel={assert:function(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function(key){if($WeakMap&&key&&(typeof key==='object'||typeof key==='function')){if($wm){return $weakMapDelete($wm,key);}}else if(getSideChannelMap){if($m){return $m['delete'](key);}}return false;},get:function(key){if($WeakMap&&key&&(typeof key==='object'||typeof key==='function')){if($wm){return $weakMapGet($wm,key);}}return $m&&$m.get(key);},has:function(key){if($WeakMap&&key&&(typeof key==='object'||typeof key==='function')){if($wm){return $weakMapHas($wm,key);}}return!!$m&&$m.has(key);},set:function(key,value){if($WeakMap&&key&&(typeof key==='object'||typeof key==='function')){if(!$wm){$wm=new $WeakMap();}$weakMapSet($wm,key,value);}else if(getSideChannelMap){if(!$m){$m=getSideChannelMap();}// eslint-disable-next-line no-extra-parens
|
|
5171
5031
|
/** @type {NonNullable<typeof $m>} */$m.set(key,value);}}};// @ts-expect-error TODO: figure out why this is erroring
|
|
5172
|
-
return channel;}:getSideChannelMap;},{"call-bound":30,"es-errors/type":47,"get-intrinsic":104,"object-inspect":136,"side-channel-map":
|
|
5173
|
-
return channel;};},{"es-errors/type":47,"object-inspect":136,"side-channel-list":
|
|
5174
|
-
const http=require('http');const https=require('https');const once=require('once');const querystring=require('querystring');const url=require('url');const isStream=o=>o!==null&&typeof o==='object'&&typeof o.pipe==='function';function simpleGet(opts,cb){opts=Object.assign({maxRedirects:10},typeof opts==='string'?{url:opts}:opts);cb=once(cb);if(opts.url){const
|
|
5032
|
+
return channel;}:getSideChannelMap;},{"call-bound":30,"es-errors/type":47,"get-intrinsic":104,"object-inspect":136,"side-channel-map":161}],163:[function(require,module,exports){'use strict';var $TypeError=require('es-errors/type');var inspect=require('object-inspect');var getSideChannelList=require('side-channel-list');var getSideChannelMap=require('side-channel-map');var getSideChannelWeakMap=require('side-channel-weakmap');var makeChannel=getSideChannelWeakMap||getSideChannelMap||getSideChannelList;/** @type {import('.')} */module.exports=function getSideChannel(){/** @typedef {ReturnType<typeof getSideChannel>} Channel *//** @type {Channel | undefined} */var $channelData;/** @type {Channel} */var channel={assert:function(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function(key){return!!$channelData&&$channelData['delete'](key);},get:function(key){return $channelData&&$channelData.get(key);},has:function(key){return!!$channelData&&$channelData.has(key);},set:function(key,value){if(!$channelData){$channelData=makeChannel();}$channelData.set(key,value);}};// @ts-expect-error TODO: figure out why this is erroring
|
|
5033
|
+
return channel;};},{"es-errors/type":47,"object-inspect":136,"side-channel-list":160,"side-channel-map":161,"side-channel-weakmap":162}],164:[function(require,module,exports){(function(Buffer){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */module.exports=function(stream,cb){var chunks=[];stream.on('data',function(chunk){chunks.push(chunk);});stream.once('end',function(){if(cb)cb(null,Buffer.concat(chunks));cb=null;});stream.once('error',function(err){if(cb)cb(err);cb=null;});};}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20}],165:[function(require,module,exports){(function(Buffer){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */module.exports=simpleGet;const concat=require('simple-concat');const decompressResponse=require('decompress-response');// excluded from browser build
|
|
5034
|
+
const http=require('http');const https=require('https');const once=require('once');const querystring=require('querystring');const url=require('url');const isStream=o=>o!==null&&typeof o==='object'&&typeof o.pipe==='function';function simpleGet(opts,cb){opts=Object.assign({maxRedirects:10},typeof opts==='string'?{url:opts}:opts);cb=once(cb);if(opts.url){const _url$parse=url.parse(opts.url),hostname=_url$parse.hostname,port=_url$parse.port,protocol=_url$parse.protocol,auth=_url$parse.auth,path=_url$parse.path;// eslint-disable-line node/no-deprecated-api
|
|
5175
5035
|
delete opts.url;if(!hostname&&!port&&!protocol&&!auth)opts.path=path;// Relative redirect
|
|
5176
5036
|
else Object.assign(opts,{hostname,port,protocol,auth,path});// Absolute redirect
|
|
5177
5037
|
}const headers={'accept-encoding':'gzip, deflate'};if(opts.headers)Object.keys(opts.headers).forEach(k=>headers[k.toLowerCase()]=opts.headers[k]);opts.headers=headers;let body;if(opts.body){body=opts.json&&!isStream(opts.body)?JSON.stringify(opts.body):opts.body;}else if(opts.form){body=typeof opts.form==='string'?opts.form:querystring.stringify(opts.form);opts.headers['content-type']='application/x-www-form-urlencoded';}if(body){if(!opts.method)opts.method='POST';if(!isStream(body))opts.headers['content-length']=Buffer.byteLength(body);if(opts.json&&!opts.form)opts.headers['content-type']='application/json';}delete opts.body;delete opts.form;if(opts.json)opts.headers.accept='application/json';if(opts.method)opts.method=opts.method.toUpperCase();const originalHost=opts.hostname;// hostname before potential redirect
|
|
@@ -5182,13 +5042,13 @@ res.resume();// Discard response
|
|
|
5182
5042
|
const redirectHost=url.parse(opts.url).hostname;// eslint-disable-line node/no-deprecated-api
|
|
5183
5043
|
// If redirected host is different than original host, drop headers to prevent cookie leak (#73)
|
|
5184
5044
|
if(redirectHost!==null&&redirectHost!==originalHost){delete opts.headers.cookie;delete opts.headers.authorization;}if(opts.method==='POST'&&[301,302].includes(res.statusCode)){opts.method='GET';// On 301/302 redirect, change POST to GET (see #35)
|
|
5185
|
-
delete opts.headers['content-length'];delete opts.headers['content-type'];}if(opts.maxRedirects--===0)return cb(new Error('too many redirects'));else return simpleGet(opts,cb);}const tryUnzip=typeof decompressResponse==='function'&&opts.method!=='HEAD';cb(null,tryUnzip?decompressResponse(res):res);});req.on('timeout',()=>{req.abort();cb(new Error('Request timed out'));});req.on('error',cb);if(isStream(body))body.on('error',cb).pipe(req);else req.end(body);return req;}simpleGet.concat=(opts,cb)=>{return simpleGet(opts,(err,res)=>{if(err)return cb(err);concat(res,(err,data)=>{if(err)return cb(err);if(opts.json){try{data=JSON.parse(data.toString());}catch(err){return cb(err,res,data);}}cb(null,res,data);});});};['get','post','put','patch','head','delete'].forEach(method=>{simpleGet[method]=(opts,cb)=>{if(typeof opts==='string')opts={url:opts};return simpleGet(Object.assign({method:method.toUpperCase()},opts),cb);};});}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20,"decompress-response":18,"http":
|
|
5045
|
+
delete opts.headers['content-length'];delete opts.headers['content-type'];}if(opts.maxRedirects--===0)return cb(new Error('too many redirects'));else return simpleGet(opts,cb);}const tryUnzip=typeof decompressResponse==='function'&&opts.method!=='HEAD';cb(null,tryUnzip?decompressResponse(res):res);});req.on('timeout',()=>{req.abort();cb(new Error('Request timed out'));});req.on('error',cb);if(isStream(body))body.on('error',cb).pipe(req);else req.end(body);return req;}simpleGet.concat=(opts,cb)=>{return simpleGet(opts,(err,res)=>{if(err)return cb(err);concat(res,(err,data)=>{if(err)return cb(err);if(opts.json){try{data=JSON.parse(data.toString());}catch(err){return cb(err,res,data);}}cb(null,res,data);});});};['get','post','put','patch','head','delete'].forEach(method=>{simpleGet[method]=(opts,cb)=>{if(typeof opts==='string')opts={url:opts};return simpleGet(Object.assign({method:method.toUpperCase()},opts),cb);};});}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20,"decompress-response":18,"http":166,"https":113,"once":137,"querystring":158,"simple-concat":164,"url":188}],166:[function(require,module,exports){(function(global){(function(){var ClientRequest=require('./lib/request');var response=require('./lib/response');var extend=require('xtend');var statusCodes=require('builtin-status-codes');var url=require('url');var http=exports;http.request=function(opts,cb){if(typeof opts==='string')opts=url.parse(opts);else opts=extend(opts);// Normally, the page is loaded from http or https, so not specifying a protocol
|
|
5186
5046
|
// will result in a (valid) protocol-relative url. However, this won't work if
|
|
5187
5047
|
// the protocol is something else, like 'file:'
|
|
5188
5048
|
var defaultProtocol=global.location.protocol.search(/^https?:$/)===-1?'http:':'';var protocol=opts.protocol||defaultProtocol;var host=opts.hostname||opts.host;var port=opts.port;var path=opts.path||'/';// Necessary for IPv6 addresses
|
|
5189
5049
|
if(host&&host.indexOf(':')!==-1)host='['+host+']';// This may be a relative url. The browser should always be able to interpret it correctly.
|
|
5190
5050
|
opts.url=(host?protocol+'//'+host:'')+(port?':'+port:'')+path;opts.method=(opts.method||'GET').toUpperCase();opts.headers=opts.headers||{};// Also valid opts.auth, opts.mode
|
|
5191
|
-
var req=new ClientRequest(opts);if(cb)req.on('response',cb);return req;};http.get=function get(opts,cb){var req=http.request(opts,cb);req.end();return req;};http.ClientRequest=ClientRequest;http.IncomingMessage=response.IncomingMessage;http.Agent=function(){};http.Agent.defaultMaxSockets=4;http.globalAgent=new http.Agent();http.STATUS_CODES=statusCodes;http.METHODS=['CHECKOUT','CONNECT','COPY','DELETE','GET','HEAD','LOCK','M-SEARCH','MERGE','MKACTIVITY','MKCOL','MOVE','NOTIFY','OPTIONS','PATCH','POST','PROPFIND','PROPPATCH','PURGE','PUT','REPORT','SEARCH','SUBSCRIBE','TRACE','UNLOCK','UNSUBSCRIBE'];}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./lib/request":
|
|
5051
|
+
var req=new ClientRequest(opts);if(cb)req.on('response',cb);return req;};http.get=function get(opts,cb){var req=http.request(opts,cb);req.end();return req;};http.ClientRequest=ClientRequest;http.IncomingMessage=response.IncomingMessage;http.Agent=function(){};http.Agent.defaultMaxSockets=4;http.globalAgent=new http.Agent();http.STATUS_CODES=statusCodes;http.METHODS=['CHECKOUT','CONNECT','COPY','DELETE','GET','HEAD','LOCK','M-SEARCH','MERGE','MKACTIVITY','MKCOL','MOVE','NOTIFY','OPTIONS','PATCH','POST','PROPFIND','PROPPATCH','PURGE','PUT','REPORT','SEARCH','SUBSCRIBE','TRACE','UNLOCK','UNSUBSCRIBE'];}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"./lib/request":168,"./lib/response":169,"builtin-status-codes":21,"url":188,"xtend":191}],167:[function(require,module,exports){(function(global){(function(){exports.fetch=isFunction(global.fetch)&&isFunction(global.ReadableStream);exports.writableStream=isFunction(global.WritableStream);exports.abortController=isFunction(global.AbortController);// The xhr request to example.com may violate some restrictive CSP configurations,
|
|
5192
5052
|
// so if we're running in a browser that supports `fetch`, avoid calling getXHR()
|
|
5193
5053
|
// and assume support for certain features below.
|
|
5194
5054
|
var xhr;function getXHR(){// Cache the xhr value
|
|
@@ -5203,7 +5063,7 @@ exports.arraybuffer=exports.fetch||checkTypeSupport('arraybuffer');// These next
|
|
|
5203
5063
|
exports.msstream=!exports.fetch&&checkTypeSupport('ms-stream');exports.mozchunkedarraybuffer=!exports.fetch&&checkTypeSupport('moz-chunked-arraybuffer');// If fetch is supported, then overrideMimeType will be supported too. Skip calling
|
|
5204
5064
|
// getXHR().
|
|
5205
5065
|
exports.overrideMimeType=exports.fetch||(getXHR()?isFunction(getXHR().overrideMimeType):false);function isFunction(value){return typeof value==='function';}xhr=null;// Help gc
|
|
5206
|
-
}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],
|
|
5066
|
+
}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],168:[function(require,module,exports){(function(process,global,Buffer){(function(){var capability=require('./capability');var inherits=require('inherits');var response=require('./response');var stream=require('readable-stream');var IncomingMessage=response.IncomingMessage;var rStates=response.readyStates;function decideMode(preferBinary,useFetch){if(capability.fetch&&useFetch){return'fetch';}else if(capability.mozchunkedarraybuffer){return'moz-chunked-arraybuffer';}else if(capability.msstream){return'ms-stream';}else if(capability.arraybuffer&&preferBinary){return'arraybuffer';}else{return'text';}}var ClientRequest=module.exports=function(opts){var self=this;stream.Writable.call(self);self._opts=opts;self._body=[];self._headers={};if(opts.auth)self.setHeader('Authorization','Basic '+Buffer.from(opts.auth).toString('base64'));Object.keys(opts.headers).forEach(function(name){self.setHeader(name,opts.headers[name]);});var preferBinary;var useFetch=true;if(opts.mode==='disable-fetch'||'requestTimeout'in opts&&!capability.abortController){// If the use of XHR should be preferred. Not typically needed.
|
|
5207
5067
|
useFetch=false;preferBinary=true;}else if(opts.mode==='prefer-streaming'){// If streaming is a high priority but binary compatibility and
|
|
5208
5068
|
// the accuracy of the 'content-type' header aren't
|
|
5209
5069
|
preferBinary=false;}else if(opts.mode==='allow-wrong-content-type'){// If streaming is more important than preserving the 'content-type' header
|
|
@@ -5220,7 +5080,7 @@ if(self._mode==='moz-chunked-arraybuffer'){xhr.onprogress=function(){self._onXHR
|
|
|
5220
5080
|
* Even though the spec says it should be available in readyState 3,
|
|
5221
5081
|
* accessing it throws an exception in IE8
|
|
5222
5082
|
*/function statusValid(xhr){try{var status=xhr.status;return status!==null&&status!==0;}catch(e){return false;}}ClientRequest.prototype._onXHRProgress=function(){var self=this;self._resetTimers(false);if(!statusValid(self._xhr)||self._destroyed)return;if(!self._response)self._connect();self._response._onXHRProgress(self._resetTimers.bind(self));};ClientRequest.prototype._connect=function(){var self=this;if(self._destroyed)return;self._response=new IncomingMessage(self._xhr,self._fetchResponse,self._mode,self._resetTimers.bind(self));self._response.on('error',function(err){self.emit('error',err);});self.emit('response',self._response);};ClientRequest.prototype._write=function(chunk,encoding,cb){var self=this;self._body.push(chunk);cb();};ClientRequest.prototype._resetTimers=function(done){var self=this;global.clearTimeout(self._socketTimer);self._socketTimer=null;if(done){global.clearTimeout(self._fetchTimer);self._fetchTimer=null;}else if(self._socketTimeout){self._socketTimer=global.setTimeout(function(){self.emit('timeout');},self._socketTimeout);}};ClientRequest.prototype.abort=ClientRequest.prototype.destroy=function(err){var self=this;self._destroyed=true;self._resetTimers(true);if(self._response)self._response._destroyed=true;if(self._xhr)self._xhr.abort();else if(self._fetchAbortController)self._fetchAbortController.abort();if(err)self.emit('error',err);};ClientRequest.prototype.end=function(data,encoding,cb){var self=this;if(typeof data==='function'){cb=data;data=undefined;}stream.Writable.prototype.end.call(self,data,encoding,cb);};ClientRequest.prototype.setTimeout=function(timeout,cb){var self=this;if(cb)self.once('timeout',cb);self._socketTimeout=timeout;self._resetTimers(false);};ClientRequest.prototype.flushHeaders=function(){};ClientRequest.prototype.setNoDelay=function(){};ClientRequest.prototype.setSocketKeepAlive=function(){};// Taken from http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader%28%29-method
|
|
5223
|
-
var unsafeHeaders=['accept-charset','accept-encoding','access-control-request-headers','access-control-request-method','connection','content-length','cookie','cookie2','date','dnt','expect','host','keep-alive','origin','referer','te','trailer','transfer-encoding','upgrade','via'];}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":
|
|
5083
|
+
var unsafeHeaders=['accept-charset','accept-encoding','access-control-request-headers','access-control-request-method','connection','content-length','cookie','cookie2','date','dnt','expect','host','keep-alive','origin','referer','te','trailer','transfer-encoding','upgrade','via'];}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":167,"./response":169,"_process":150,"buffer":20,"inherits":115,"readable-stream":184}],169:[function(require,module,exports){(function(process,global,Buffer){(function(){var capability=require('./capability');var inherits=require('inherits');var stream=require('readable-stream');var rStates=exports.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4};var IncomingMessage=exports.IncomingMessage=function(xhr,response,mode,resetTimers){var self=this;stream.Readable.call(self);self._mode=mode;self.headers={};self.rawHeaders=[];self.trailers={};self.rawTrailers=[];// Fake the 'close' event, but only once 'end' fires
|
|
5224
5084
|
self.on('end',function(){// The nextTick is necessary to prevent the 'request' module from causing an infinite loop
|
|
5225
5085
|
process.nextTick(function(){self.emit('close');});});if(mode==='fetch'){self._fetchResponse=response;self.url=response.url;self.statusCode=response.status;self.statusMessage=response.statusText;response.headers.forEach(function(header,key){self.headers[key.toLowerCase()]=header;self.rawHeaders.push(key,header);});if(capability.writableStream){var writable=new WritableStream({write:function(chunk){resetTimers(false);return new Promise(function(resolve,reject){if(self._destroyed){reject();}else if(self.push(Buffer.from(chunk))){resolve();}else{self._resumeFetch=resolve;}});},close:function(){resetTimers(true);if(!self._destroyed)self.push(null);},abort:function(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);}});try{response.body.pipeTo(writable).catch(function(err){resetTimers(true);if(!self._destroyed)self.emit('error',err);});return;}catch(e){}// pipeTo method isn't defined. Can't find a better way to feature test this
|
|
5226
5086
|
}// fallback for when writableStream or pipeTo aren't available
|
|
@@ -5228,13 +5088,13 @@ var reader=response.body.getReader();function read(){reader.read().then(function
|
|
|
5228
5088
|
}}};inherits(IncomingMessage,stream.Readable);IncomingMessage.prototype._read=function(){var self=this;var resolve=self._resumeFetch;if(resolve){self._resumeFetch=null;resolve();}};IncomingMessage.prototype._onXHRProgress=function(resetTimers){var self=this;var xhr=self._xhr;var response=null;switch(self._mode){case'text':response=xhr.responseText;if(response.length>self._pos){var newData=response.substr(self._pos);if(self._charset==='x-user-defined'){var buffer=Buffer.alloc(newData.length);for(var i=0;i<newData.length;i++)buffer[i]=newData.charCodeAt(i)&0xff;self.push(buffer);}else{self.push(newData,self._charset);}self._pos=response.length;}break;case'arraybuffer':if(xhr.readyState!==rStates.DONE||!xhr.response)break;response=xhr.response;self.push(Buffer.from(new Uint8Array(response)));break;case'moz-chunked-arraybuffer':// take whole
|
|
5229
5089
|
response=xhr.response;if(xhr.readyState!==rStates.LOADING||!response)break;self.push(Buffer.from(new Uint8Array(response)));break;case'ms-stream':response=xhr.response;if(xhr.readyState!==rStates.LOADING)break;var reader=new global.MSStreamReader();reader.onprogress=function(){if(reader.result.byteLength>self._pos){self.push(Buffer.from(new Uint8Array(reader.result.slice(self._pos))));self._pos=reader.result.byteLength;}};reader.onload=function(){resetTimers(true);self.push(null);};// reader.onerror = ??? // TODO: this
|
|
5230
5090
|
reader.readAsArrayBuffer(response);break;}// The ms-stream case handles end separately in reader.onload()
|
|
5231
|
-
if(self._xhr.readyState===rStates.DONE&&self._mode!=='ms-stream'){resetTimers(true);self.push(null);}};}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":
|
|
5091
|
+
if(self._xhr.readyState===rStates.DONE&&self._mode!=='ms-stream'){resetTimers(true);self.push(null);}};}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},require("buffer").Buffer);},{"./capability":167,"_process":150,"buffer":20,"inherits":115,"readable-stream":184}],170:[function(require,module,exports){'use strict';function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}var codes={};function createErrorType(code,message,Base){if(!Base){Base=Error;}function getMessage(arg1,arg2,arg3){if(typeof message==='string'){return message;}else{return message(arg1,arg2,arg3);}}var NodeError=/*#__PURE__*/function(_Base){_inheritsLoose(NodeError,_Base);function NodeError(arg1,arg2,arg3){return _Base.call(this,getMessage(arg1,arg2,arg3))||this;}return NodeError;}(Base);NodeError.prototype.name=Base.name;NodeError.prototype.code=code;codes[code]=NodeError;}// https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
|
|
5232
5092
|
function oneOf(expected,thing){if(Array.isArray(expected)){var len=expected.length;expected=expected.map(function(i){return String(i);});if(len>2){return"one of ".concat(thing," ").concat(expected.slice(0,len-1).join(', '),", or ")+expected[len-1];}else if(len===2){return"one of ".concat(thing," ").concat(expected[0]," or ").concat(expected[1]);}else{return"of ".concat(thing," ").concat(expected[0]);}}else{return"of ".concat(thing," ").concat(String(expected));}}// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
|
|
5233
5093
|
function startsWith(str,search,pos){return str.substr(!pos||pos<0?0:+pos,search.length)===search;}// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
|
|
5234
5094
|
function endsWith(str,search,this_len){if(this_len===undefined||this_len>str.length){this_len=str.length;}return str.substring(this_len-search.length,this_len)===search;}// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
|
|
5235
5095
|
function includes(str,search,start){if(typeof start!=='number'){start=0;}if(start+search.length>str.length){return false;}else{return str.indexOf(search,start)!==-1;}}createErrorType('ERR_INVALID_OPT_VALUE',function(name,value){return'The value "'+value+'" is invalid for option "'+name+'"';},TypeError);createErrorType('ERR_INVALID_ARG_TYPE',function(name,expected,actual){// determiner: 'must be' or 'must not be'
|
|
5236
5096
|
var determiner;if(typeof expected==='string'&&startsWith(expected,'not ')){determiner='must not be';expected=expected.replace(/^not /,'');}else{determiner='must be';}var msg;if(endsWith(name,' argument')){// For cases like 'first argument'
|
|
5237
|
-
msg="The ".concat(name," ").concat(determiner," ").concat(oneOf(expected,'type'));}else{var type=includes(name,'.')?'property':'argument';msg="The \"".concat(name,"\" ").concat(type," ").concat(determiner," ").concat(oneOf(expected,'type'));}msg+=". Received type ".concat(typeof actual);return msg;},TypeError);createErrorType('ERR_STREAM_PUSH_AFTER_EOF','stream.push() after EOF');createErrorType('ERR_METHOD_NOT_IMPLEMENTED',function(name){return'The '+name+' method is not implemented';});createErrorType('ERR_STREAM_PREMATURE_CLOSE','Premature close');createErrorType('ERR_STREAM_DESTROYED',function(name){return'Cannot call '+name+' after a stream was destroyed';});createErrorType('ERR_MULTIPLE_CALLBACK','Callback called multiple times');createErrorType('ERR_STREAM_CANNOT_PIPE','Cannot pipe, not readable');createErrorType('ERR_STREAM_WRITE_AFTER_END','write after end');createErrorType('ERR_STREAM_NULL_VALUES','May not write null values to stream',TypeError);createErrorType('ERR_UNKNOWN_ENCODING',function(arg){return'Unknown encoding: '+arg;},TypeError);createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT','stream.unshift() after end event');module.exports.codes=codes;},{}],
|
|
5097
|
+
msg="The ".concat(name," ").concat(determiner," ").concat(oneOf(expected,'type'));}else{var type=includes(name,'.')?'property':'argument';msg="The \"".concat(name,"\" ").concat(type," ").concat(determiner," ").concat(oneOf(expected,'type'));}msg+=". Received type ".concat(typeof actual);return msg;},TypeError);createErrorType('ERR_STREAM_PUSH_AFTER_EOF','stream.push() after EOF');createErrorType('ERR_METHOD_NOT_IMPLEMENTED',function(name){return'The '+name+' method is not implemented';});createErrorType('ERR_STREAM_PREMATURE_CLOSE','Premature close');createErrorType('ERR_STREAM_DESTROYED',function(name){return'Cannot call '+name+' after a stream was destroyed';});createErrorType('ERR_MULTIPLE_CALLBACK','Callback called multiple times');createErrorType('ERR_STREAM_CANNOT_PIPE','Cannot pipe, not readable');createErrorType('ERR_STREAM_WRITE_AFTER_END','write after end');createErrorType('ERR_STREAM_NULL_VALUES','May not write null values to stream',TypeError);createErrorType('ERR_UNKNOWN_ENCODING',function(arg){return'Unknown encoding: '+arg;},TypeError);createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT','stream.unshift() after end event');module.exports.codes=codes;},{}],171:[function(require,module,exports){(function(process){(function(){// Copyright Joyent, Inc. and other Node contributors.
|
|
5238
5098
|
//
|
|
5239
5099
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
5240
5100
|
// copy of this software and associated documentation files (the
|
|
@@ -5279,7 +5139,7 @@ enumerable:false,get:function get(){if(this._readableState===undefined||this._wr
|
|
|
5279
5139
|
// has not been initialized yet
|
|
5280
5140
|
if(this._readableState===undefined||this._writableState===undefined){return;}// backward compatibility, the user is explicitly
|
|
5281
5141
|
// managing destroyed
|
|
5282
|
-
this._readableState.destroyed=value;this._writableState.destroyed=value;}});}).call(this);}).call(this,require('_process'));},{"./_stream_readable":
|
|
5142
|
+
this._readableState.destroyed=value;this._writableState.destroyed=value;}});}).call(this);}).call(this,require('_process'));},{"./_stream_readable":173,"./_stream_writable":175,"_process":150,"inherits":115}],172:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
5283
5143
|
//
|
|
5284
5144
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
5285
5145
|
// copy of this software and associated documentation files (the
|
|
@@ -5302,7 +5162,7 @@ this._readableState.destroyed=value;this._writableState.destroyed=value;}});}).c
|
|
|
5302
5162
|
// a passthrough stream.
|
|
5303
5163
|
// basically just the most minimal sort of Transform stream.
|
|
5304
5164
|
// Every written chunk gets output as-is.
|
|
5305
|
-
'use strict';module.exports=PassThrough;var Transform=require('./_stream_transform');require('inherits')(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options);}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk);};},{"./_stream_transform":
|
|
5165
|
+
'use strict';module.exports=PassThrough;var Transform=require('./_stream_transform');require('inherits')(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options);}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk);};},{"./_stream_transform":174,"inherits":115}],173:[function(require,module,exports){(function(process,global){(function(){// Copyright Joyent, Inc. and other Node contributors.
|
|
5306
5166
|
//
|
|
5307
5167
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
5308
5168
|
// copy of this software and associated documentation files (the
|
|
@@ -5554,7 +5414,7 @@ if(state.decoder)ret=state.buffer.join('');else if(state.buffer.length===1)ret=s
|
|
|
5554
5414
|
ret=state.buffer.consume(n,state.decoder);}return ret;}function endReadable(stream){var state=stream._readableState;debug('endReadable',state.endEmitted);if(!state.endEmitted){state.ended=true;process.nextTick(endReadableNT,state,stream);}}function endReadableNT(state,stream){debug('endReadableNT',state.endEmitted,state.length);// Check that we didn't get one last unshift.
|
|
5555
5415
|
if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit('end');if(state.autoDestroy){// In case of duplex streams we need a way to detect
|
|
5556
5416
|
// if the writable side is ready for autoDestroy as well
|
|
5557
|
-
var wState=stream._writableState;if(!wState||wState.autoDestroy&&wState.finished){stream.destroy();}}}}if(typeof Symbol==='function'){Readable.from=function(iterable,opts){if(from===undefined){from=require('./internal/streams/from');}return from(Readable,iterable,opts);};}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i;}return-1;}}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":
|
|
5417
|
+
var wState=stream._writableState;if(!wState||wState.autoDestroy&&wState.finished){stream.destroy();}}}}if(typeof Symbol==='function'){Readable.from=function(iterable,opts){if(from===undefined){from=require('./internal/streams/from');}return from(Readable,iterable,opts);};}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i;}return-1;}}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":170,"./_stream_duplex":171,"./internal/streams/async_iterator":176,"./internal/streams/buffer_list":177,"./internal/streams/destroy":178,"./internal/streams/from":180,"./internal/streams/state":182,"./internal/streams/stream":183,"_process":150,"buffer":20,"events":50,"inherits":115,"string_decoder/":185,"util":18}],174:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
5558
5418
|
//
|
|
5559
5419
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
5560
5420
|
// copy of this software and associated documentation files (the
|
|
@@ -5640,7 +5500,7 @@ ts.needTransform=true;}};Transform.prototype._destroy=function(err,cb){Duplex.pr
|
|
|
5640
5500
|
stream.push(data);// TODO(BridgeAR): Write a test for these two error cases
|
|
5641
5501
|
// if there's nothing in the write buffer, then that means
|
|
5642
5502
|
// that nothing more will ever be provided
|
|
5643
|
-
if(stream._writableState.length)throw new ERR_TRANSFORM_WITH_LENGTH_0();if(stream._transformState.transforming)throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();return stream.push(null);}},{"../errors":
|
|
5503
|
+
if(stream._writableState.length)throw new ERR_TRANSFORM_WITH_LENGTH_0();if(stream._transformState.transforming)throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();return stream.push(null);}},{"../errors":170,"./_stream_duplex":171,"inherits":115}],175:[function(require,module,exports){(function(process,global){(function(){// Copyright Joyent, Inc. and other Node contributors.
|
|
5644
5504
|
//
|
|
5645
5505
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
5646
5506
|
// copy of this software and associated documentation files (the
|
|
@@ -5775,7 +5635,7 @@ enumerable:false,get:function get(){if(this._writableState===undefined){return f
|
|
|
5775
5635
|
// has not been initialized yet
|
|
5776
5636
|
if(!this._writableState){return;}// backward compatibility, the user is explicitly
|
|
5777
5637
|
// managing destroyed
|
|
5778
|
-
this._writableState.destroyed=value;}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){cb(err);};}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":
|
|
5638
|
+
this._writableState.destroyed=value;}});Writable.prototype.destroy=destroyImpl.destroy;Writable.prototype._undestroy=destroyImpl.undestroy;Writable.prototype._destroy=function(err,cb){cb(err);};}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":170,"./_stream_duplex":171,"./internal/streams/destroy":178,"./internal/streams/state":182,"./internal/streams/stream":183,"_process":150,"buffer":20,"inherits":115,"util-deprecate":189}],176:[function(require,module,exports){(function(process){(function(){'use strict';var _Object$setPrototypeO;function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}var finished=require('./end-of-stream');var kLastResolve=Symbol('lastResolve');var kLastReject=Symbol('lastReject');var kError=Symbol('error');var kEnded=Symbol('ended');var kLastPromise=Symbol('lastPromise');var kHandlePromise=Symbol('handlePromise');var kStream=Symbol('stream');function createIterResult(value,done){return{value:value,done:done};}function readAndResolve(iter){var resolve=iter[kLastResolve];if(resolve!==null){var data=iter[kStream].read();// we defer if data is null
|
|
5779
5639
|
// we can be expecting either 'end' or
|
|
5780
5640
|
// 'error'
|
|
5781
5641
|
if(data!==null){iter[kLastPromise]=null;iter[kLastResolve]=null;iter[kLastReject]=null;resolve(createIterResult(data,false));}}}function onReadable(iter){// we wait for the next tick, because it might
|
|
@@ -5797,7 +5657,7 @@ var data=this[kStream].read();if(data!==null){return Promise.resolve(createIterR
|
|
|
5797
5657
|
// Readable class this is attached to
|
|
5798
5658
|
return new Promise(function(resolve,reject){_this2[kStream].destroy(null,function(err){if(err){reject(err);return;}resolve(createIterResult(undefined,true));});});}),_Object$setPrototypeO),AsyncIteratorPrototype);var createReadableStreamAsyncIterator=function createReadableStreamAsyncIterator(stream){var _Object$create;var iterator=Object.create(ReadableStreamAsyncIteratorPrototype,(_Object$create={},_defineProperty(_Object$create,kStream,{value:stream,writable:true}),_defineProperty(_Object$create,kLastResolve,{value:null,writable:true}),_defineProperty(_Object$create,kLastReject,{value:null,writable:true}),_defineProperty(_Object$create,kError,{value:null,writable:true}),_defineProperty(_Object$create,kEnded,{value:stream._readableState.endEmitted,writable:true}),_defineProperty(_Object$create,kHandlePromise,{value:function value(resolve,reject){var data=iterator[kStream].read();if(data){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;resolve(createIterResult(data,false));}else{iterator[kLastResolve]=resolve;iterator[kLastReject]=reject;}},writable:true}),_Object$create));iterator[kLastPromise]=null;finished(stream,function(err){if(err&&err.code!=='ERR_STREAM_PREMATURE_CLOSE'){var reject=iterator[kLastReject];// reject if we are waiting for data in the Promise
|
|
5799
5659
|
// returned by next() and store the error
|
|
5800
|
-
if(reject!==null){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;reject(err);}iterator[kError]=err;return;}var resolve=iterator[kLastResolve];if(resolve!==null){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;resolve(createIterResult(undefined,true));}iterator[kEnded]=true;});stream.on('readable',onReadable.bind(null,iterator));return iterator;};module.exports=createReadableStreamAsyncIterator;}).call(this);}).call(this,require('_process'));},{"./end-of-stream":
|
|
5660
|
+
if(reject!==null){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;reject(err);}iterator[kError]=err;return;}var resolve=iterator[kLastResolve];if(resolve!==null){iterator[kLastPromise]=null;iterator[kLastResolve]=null;iterator[kLastReject]=null;resolve(createIterResult(undefined,true));}iterator[kEnded]=true;});stream.on('readable',onReadable.bind(null,iterator));return iterator;};module.exports=createReadableStreamAsyncIterator;}).call(this);}).call(this,require('_process'));},{"./end-of-stream":179,"_process":150}],177:[function(require,module,exports){'use strict';function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;})),keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}return target;}function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}var _require=require('buffer'),Buffer=_require.Buffer;var _require2=require('util'),inspect=_require2.inspect;var custom=inspect&&inspect.custom||'inspect';function copyBuffer(src,target,offset){Buffer.prototype.copy.call(src,target,offset);}module.exports=/*#__PURE__*/function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0;}_createClass(BufferList,[{key:"push",value:function push(v){var entry={data:v,next:null};if(this.length>0)this.tail.next=entry;else this.head=entry;this.tail=entry;++this.length;}},{key:"unshift",value:function unshift(v){var entry={data:v,next:this.head};if(this.length===0)this.tail=entry;this.head=entry;++this.length;}},{key:"shift",value:function shift(){if(this.length===0)return;var ret=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return ret;}},{key:"clear",value:function clear(){this.head=this.tail=null;this.length=0;}},{key:"join",value:function join(s){if(this.length===0)return'';var p=this.head;var ret=''+p.data;while(p=p.next)ret+=s+p.data;return ret;}},{key:"concat",value:function concat(n){if(this.length===0)return Buffer.alloc(0);var ret=Buffer.allocUnsafe(n>>>0);var p=this.head;var i=0;while(p){copyBuffer(p.data,ret,i);i+=p.data.length;p=p.next;}return ret;}// Consumes a specified amount of bytes or characters from the buffered data.
|
|
5801
5661
|
},{key:"consume",value:function consume(n,hasStrings){var ret;if(n<this.head.data.length){// `slice` is the same for buffers and strings.
|
|
5802
5662
|
ret=this.head.data.slice(0,n);this.head.data=this.head.data.slice(n);}else if(n===this.head.data.length){// First chunk is a perfect match.
|
|
5803
5663
|
ret=this.shift();}else{// Result spans more than one buffer.
|
|
@@ -5806,7 +5666,7 @@ ret=hasStrings?this._getString(n):this._getBuffer(n);}return ret;}},{key:"first"
|
|
|
5806
5666
|
},{key:"_getBuffer",value:function _getBuffer(n){var ret=Buffer.allocUnsafe(n);var p=this.head;var c=1;p.data.copy(ret);n-=p.data.length;while(p=p.next){var buf=p.data;var nb=n>buf.length?buf.length:n;buf.copy(ret,ret.length-n,0,nb);n-=nb;if(n===0){if(nb===buf.length){++c;if(p.next)this.head=p.next;else this.head=this.tail=null;}else{this.head=p;p.data=buf.slice(nb);}break;}++c;}this.length-=c;return ret;}// Make sure the linked list only shows the minimal necessary information.
|
|
5807
5667
|
},{key:custom,value:function value(_,options){return inspect(this,_objectSpread(_objectSpread({},options),{},{// Only inspect one level.
|
|
5808
5668
|
depth:0,// It should not recurse.
|
|
5809
|
-
customInspect:false}));}}]);return BufferList;}();},{"buffer":20,"util":18}],
|
|
5669
|
+
customInspect:false}));}}]);return BufferList;}();},{"buffer":20,"util":18}],178:[function(require,module,exports){(function(process){(function(){'use strict';// undocumented cb() API, needed for core, not for public API
|
|
5810
5670
|
function destroy(err,cb){var _this=this;var readableDestroyed=this._readableState&&this._readableState.destroyed;var writableDestroyed=this._writableState&&this._writableState.destroyed;if(readableDestroyed||writableDestroyed){if(cb){cb(err);}else if(err){if(!this._writableState){process.nextTick(emitErrorNT,this,err);}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;process.nextTick(emitErrorNT,this,err);}}return this;}// we set destroyed to true before firing error callbacks in order
|
|
5811
5671
|
// to make it re-entrance safe in case destroy() is called within callbacks
|
|
5812
5672
|
if(this._readableState){this._readableState.destroyed=true;}// if this is a duplex stream mark the writable part as destroyed as well
|
|
@@ -5815,15 +5675,15 @@ if(this._writableState){this._writableState.destroyed=true;}this._destroy(err||n
|
|
|
5815
5675
|
// For now when you opt-in to autoDestroy we allow
|
|
5816
5676
|
// the error to be emitted nextTick. In a future
|
|
5817
5677
|
// semver major update we should change the default to this.
|
|
5818
|
-
var rState=stream._readableState;var wState=stream._writableState;if(rState&&rState.autoDestroy||wState&&wState.autoDestroy)stream.destroy(err);else stream.emit('error',err);}module.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy};}).call(this);}).call(this,require('_process'));},{"_process":150}],
|
|
5678
|
+
var rState=stream._readableState;var wState=stream._writableState;if(rState&&rState.autoDestroy||wState&&wState.autoDestroy)stream.destroy(err);else stream.emit('error',err);}module.exports={destroy:destroy,undestroy:undestroy,errorOrDestroy:errorOrDestroy};}).call(this);}).call(this,require('_process'));},{"_process":150}],179:[function(require,module,exports){// Ported from https://github.com/mafintosh/end-of-stream with
|
|
5819
5679
|
// permission from the author, Mathias Buus (@mafintosh).
|
|
5820
5680
|
'use strict';var ERR_STREAM_PREMATURE_CLOSE=require('../../../errors').codes.ERR_STREAM_PREMATURE_CLOSE;function once(callback){var called=false;return function(){if(called)return;called=true;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}callback.apply(this,args);};}function noop(){}function isRequest(stream){return stream.setHeader&&typeof stream.abort==='function';}function eos(stream,opts,callback){if(typeof opts==='function')return eos(stream,null,opts);if(!opts)opts={};callback=once(callback||noop);var readable=opts.readable||opts.readable!==false&&stream.readable;var writable=opts.writable||opts.writable!==false&&stream.writable;var onlegacyfinish=function onlegacyfinish(){if(!stream.writable)onfinish();};var writableEnded=stream._writableState&&stream._writableState.finished;var onfinish=function onfinish(){writable=false;writableEnded=true;if(!readable)callback.call(stream);};var readableEnded=stream._readableState&&stream._readableState.endEmitted;var onend=function onend(){readable=false;readableEnded=true;if(!writable)callback.call(stream);};var onerror=function onerror(err){callback.call(stream,err);};var onclose=function onclose(){var err;if(readable&&!readableEnded){if(!stream._readableState||!stream._readableState.ended)err=new ERR_STREAM_PREMATURE_CLOSE();return callback.call(stream,err);}if(writable&&!writableEnded){if(!stream._writableState||!stream._writableState.ended)err=new ERR_STREAM_PREMATURE_CLOSE();return callback.call(stream,err);}};var onrequest=function onrequest(){stream.req.on('finish',onfinish);};if(isRequest(stream)){stream.on('complete',onfinish);stream.on('abort',onclose);if(stream.req)onrequest();else stream.on('request',onrequest);}else if(writable&&!stream._writableState){// legacy streams
|
|
5821
|
-
stream.on('end',onlegacyfinish);stream.on('close',onlegacyfinish);}stream.on('end',onend);stream.on('finish',onfinish);if(opts.error!==false)stream.on('error',onerror);stream.on('close',onclose);return function(){stream.removeListener('complete',onfinish);stream.removeListener('abort',onclose);stream.removeListener('request',onrequest);if(stream.req)stream.req.removeListener('finish',onfinish);stream.removeListener('end',onlegacyfinish);stream.removeListener('close',onlegacyfinish);stream.removeListener('finish',onfinish);stream.removeListener('end',onend);stream.removeListener('error',onerror);stream.removeListener('close',onclose);};}module.exports=eos;},{"../../../errors":
|
|
5681
|
+
stream.on('end',onlegacyfinish);stream.on('close',onlegacyfinish);}stream.on('end',onend);stream.on('finish',onfinish);if(opts.error!==false)stream.on('error',onerror);stream.on('close',onclose);return function(){stream.removeListener('complete',onfinish);stream.removeListener('abort',onclose);stream.removeListener('request',onrequest);if(stream.req)stream.req.removeListener('finish',onfinish);stream.removeListener('end',onlegacyfinish);stream.removeListener('close',onlegacyfinish);stream.removeListener('finish',onfinish);stream.removeListener('end',onend);stream.removeListener('error',onerror);stream.removeListener('close',onclose);};}module.exports=eos;},{"../../../errors":170}],180:[function(require,module,exports){module.exports=function(){throw new Error('Readable.from is not available in the browser');};},{}],181:[function(require,module,exports){// Ported from https://github.com/mafintosh/pump with
|
|
5822
5682
|
// permission from the author, Mathias Buus (@mafintosh).
|
|
5823
5683
|
'use strict';var eos;function once(callback){var called=false;return function(){if(called)return;called=true;callback.apply(void 0,arguments);};}var _require$codes=require('../../../errors').codes,ERR_MISSING_ARGS=_require$codes.ERR_MISSING_ARGS,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED;function noop(err){// Rethrow the error if it exists to avoid swallowing it
|
|
5824
5684
|
if(err)throw err;}function isRequest(stream){return stream.setHeader&&typeof stream.abort==='function';}function destroyer(stream,reading,writing,callback){callback=once(callback);var closed=false;stream.on('close',function(){closed=true;});if(eos===undefined)eos=require('./end-of-stream');eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=true;callback();});var destroyed=false;return function(err){if(closed)return;if(destroyed)return;destroyed=true;// request.destroy just do .end - .abort is what we want
|
|
5825
|
-
if(isRequest(stream))return stream.abort();if(typeof stream.destroy==='function')return stream.destroy();callback(err||new ERR_STREAM_DESTROYED('pipe'));};}function call(fn){fn();}function pipe(from,to){return from.pipe(to);}function popCallback(streams){if(!streams.length)return noop;if(typeof streams[streams.length-1]!=='function')return noop;return streams.pop();}function pipeline(){for(var _len=arguments.length,streams=new Array(_len),_key=0;_key<_len;_key++){streams[_key]=arguments[_key];}var callback=popCallback(streams);if(Array.isArray(streams[0]))streams=streams[0];if(streams.length<2){throw new ERR_MISSING_ARGS('streams');}var error;var destroys=streams.map(function(stream,i){var reading=i<streams.length-1;var writing=i>0;return destroyer(stream,reading,writing,function(err){if(!error)error=err;if(err)destroys.forEach(call);if(reading)return;destroys.forEach(call);callback(error);});});return streams.reduce(pipe);}module.exports=pipeline;},{"../../../errors":
|
|
5826
|
-
return state.objectMode?16:16*1024;}module.exports={getHighWaterMark:getHighWaterMark};},{"../../../errors":
|
|
5685
|
+
if(isRequest(stream))return stream.abort();if(typeof stream.destroy==='function')return stream.destroy();callback(err||new ERR_STREAM_DESTROYED('pipe'));};}function call(fn){fn();}function pipe(from,to){return from.pipe(to);}function popCallback(streams){if(!streams.length)return noop;if(typeof streams[streams.length-1]!=='function')return noop;return streams.pop();}function pipeline(){for(var _len=arguments.length,streams=new Array(_len),_key=0;_key<_len;_key++){streams[_key]=arguments[_key];}var callback=popCallback(streams);if(Array.isArray(streams[0]))streams=streams[0];if(streams.length<2){throw new ERR_MISSING_ARGS('streams');}var error;var destroys=streams.map(function(stream,i){var reading=i<streams.length-1;var writing=i>0;return destroyer(stream,reading,writing,function(err){if(!error)error=err;if(err)destroys.forEach(call);if(reading)return;destroys.forEach(call);callback(error);});});return streams.reduce(pipe);}module.exports=pipeline;},{"../../../errors":170,"./end-of-stream":179}],182:[function(require,module,exports){'use strict';var ERR_INVALID_OPT_VALUE=require('../../../errors').codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(options,isDuplex,duplexKey){return options.highWaterMark!=null?options.highWaterMark:isDuplex?options[duplexKey]:null;}function getHighWaterMark(state,options,duplexKey,isDuplex){var hwm=highWaterMarkFrom(options,isDuplex,duplexKey);if(hwm!=null){if(!(isFinite(hwm)&&Math.floor(hwm)===hwm)||hwm<0){var name=isDuplex?duplexKey:'highWaterMark';throw new ERR_INVALID_OPT_VALUE(name,hwm);}return Math.floor(hwm);}// Default value
|
|
5686
|
+
return state.objectMode?16:16*1024;}module.exports={getHighWaterMark:getHighWaterMark};},{"../../../errors":170}],183:[function(require,module,exports){module.exports=require('events').EventEmitter;},{"events":50}],184:[function(require,module,exports){exports=module.exports=require('./lib/_stream_readable.js');exports.Stream=exports;exports.Readable=exports;exports.Writable=require('./lib/_stream_writable.js');exports.Duplex=require('./lib/_stream_duplex.js');exports.Transform=require('./lib/_stream_transform.js');exports.PassThrough=require('./lib/_stream_passthrough.js');exports.finished=require('./lib/internal/streams/end-of-stream.js');exports.pipeline=require('./lib/internal/streams/pipeline.js');},{"./lib/_stream_duplex.js":171,"./lib/_stream_passthrough.js":172,"./lib/_stream_readable.js":173,"./lib/_stream_transform.js":174,"./lib/_stream_writable.js":175,"./lib/internal/streams/end-of-stream.js":179,"./lib/internal/streams/pipeline.js":181}],185:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
5827
5687
|
//
|
|
5828
5688
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
5829
5689
|
// copy of this software and associated documentation files (the
|
|
@@ -5877,13 +5737,168 @@ function utf8End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed)
|
|
|
5877
5737
|
function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString('utf16le',i);if(r){var c=r.charCodeAt(r.length-1);if(c>=0xD800&&c<=0xDBFF){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1);}}return r;}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString('utf16le',i,buf.length-1);}// For UTF-16LE we do not explicitly append special replacement characters if we
|
|
5878
5738
|
// end on a partial character, we simply let v8 handle that.
|
|
5879
5739
|
function utf16End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString('utf16le',0,end);}return r;}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString('base64',i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1];}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];}return buf.toString('base64',i,buf.length-n);}function base64End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed)return r+this.lastChar.toString('base64',0,3-this.lastNeed);return r;}// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
|
|
5880
|
-
function simpleWrite(buf){return buf.toString(this.encoding);}function simpleEnd(buf){return buf&&buf.length?this.write(buf):'';}},{"safe-buffer":
|
|
5740
|
+
function simpleWrite(buf){return buf.toString(this.encoding);}function simpleEnd(buf){return buf&&buf.length?this.write(buf):'';}},{"safe-buffer":159}],186:[function(require,module,exports){(function(setImmediate,clearImmediate){(function(){var nextTick=require('process/browser.js').nextTick;var apply=Function.prototype.apply;var slice=Array.prototype.slice;var immediateIds={};var nextImmediateId=0;// DOM APIs, for completeness
|
|
5881
5741
|
exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout);};exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval);};exports.clearTimeout=exports.clearInterval=function(timeout){timeout.close();};function Timeout(id,clearFn){this._id=id;this._clearFn=clearFn;}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(window,this._id);};// Does not start the time, just sets up the members needed.
|
|
5882
5742
|
exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId);item._idleTimeout=msecs;};exports.unenroll=function(item){clearTimeout(item._idleTimeoutId);item._idleTimeout=-1;};exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;if(msecs>=0){item._idleTimeoutId=setTimeout(function onTimeout(){if(item._onTimeout)item._onTimeout();},msecs);}};// That's not how node.js implements it but the exposed api is the same.
|
|
5883
5743
|
exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick(function onNextTick(){if(immediateIds[id]){// fn.call() is faster so we optimize for the common use-case
|
|
5884
5744
|
// @see http://jsperf.com/call-apply-segu
|
|
5885
5745
|
if(args){fn.apply(null,args);}else{fn.call(null);}// Prevent ids from leaking
|
|
5886
|
-
exports.clearImmediate(id);}});return id;};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id];};}).call(this);}).call(this,require("timers").setImmediate,require("timers").clearImmediate);},{"process/browser.js":150,"timers":
|
|
5746
|
+
exports.clearImmediate(id);}});return id;};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id];};}).call(this);}).call(this,require("timers").setImmediate,require("timers").clearImmediate);},{"process/browser.js":150,"timers":186}],187:[function(require,module,exports){(function(global){(function(){/*! https://mths.be/punycode v1.4.1 by @mathias */;(function(root){/** Detect free variables */var freeExports=typeof exports=='object'&&exports&&!exports.nodeType&&exports;var freeModule=typeof module=='object'&&module&&!module.nodeType&&module;var freeGlobal=typeof global=='object'&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal){root=freeGlobal;}/**
|
|
5747
|
+
* The `punycode` object.
|
|
5748
|
+
* @name punycode
|
|
5749
|
+
* @type Object
|
|
5750
|
+
*/var punycode,/** Highest positive signed 32-bit float value */maxInt=2147483647,// aka. 0x7FFFFFFF or 2^31-1
|
|
5751
|
+
/** Bootstring parameters */base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,// 0x80
|
|
5752
|
+
delimiter='-',// '\x2D'
|
|
5753
|
+
/** Regular expressions */regexPunycode=/^xn--/,regexNonASCII=/[^\x20-\x7E]/,// unprintable ASCII chars + non-ASCII chars
|
|
5754
|
+
regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,// RFC 3490 separators
|
|
5755
|
+
/** Error messages */errors={'overflow':'Overflow: input needs wider integers to process','not-basic':'Illegal input >= 0x80 (not a basic code point)','invalid-input':'Invalid input'},/** Convenience shortcuts */baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode,/** Temporary variable */key;/*--------------------------------------------------------------------------*//**
|
|
5756
|
+
* A generic error utility function.
|
|
5757
|
+
* @private
|
|
5758
|
+
* @param {String} type The error type.
|
|
5759
|
+
* @returns {Error} Throws a `RangeError` with the applicable error message.
|
|
5760
|
+
*/function error(type){throw new RangeError(errors[type]);}/**
|
|
5761
|
+
* A generic `Array#map` utility function.
|
|
5762
|
+
* @private
|
|
5763
|
+
* @param {Array} array The array to iterate over.
|
|
5764
|
+
* @param {Function} callback The function that gets called for every array
|
|
5765
|
+
* item.
|
|
5766
|
+
* @returns {Array} A new array of values returned by the callback function.
|
|
5767
|
+
*/function map(array,fn){var length=array.length;var result=[];while(length--){result[length]=fn(array[length]);}return result;}/**
|
|
5768
|
+
* A simple `Array#map`-like wrapper to work with domain name strings or email
|
|
5769
|
+
* addresses.
|
|
5770
|
+
* @private
|
|
5771
|
+
* @param {String} domain The domain name or email address.
|
|
5772
|
+
* @param {Function} callback The function that gets called for every
|
|
5773
|
+
* character.
|
|
5774
|
+
* @returns {Array} A new string of characters returned by the callback
|
|
5775
|
+
* function.
|
|
5776
|
+
*/function mapDomain(string,fn){var parts=string.split('@');var result='';if(parts.length>1){// In email addresses, only the domain name should be punycoded. Leave
|
|
5777
|
+
// the local part (i.e. everything up to `@`) intact.
|
|
5778
|
+
result=parts[0]+'@';string=parts[1];}// Avoid `split(regex)` for IE8 compatibility. See #17.
|
|
5779
|
+
string=string.replace(regexSeparators,'\x2E');var labels=string.split('.');var encoded=map(labels,fn).join('.');return result+encoded;}/**
|
|
5780
|
+
* Creates an array containing the numeric code points of each Unicode
|
|
5781
|
+
* character in the string. While JavaScript uses UCS-2 internally,
|
|
5782
|
+
* this function will convert a pair of surrogate halves (each of which
|
|
5783
|
+
* UCS-2 exposes as separate characters) into a single code point,
|
|
5784
|
+
* matching UTF-16.
|
|
5785
|
+
* @see `punycode.ucs2.encode`
|
|
5786
|
+
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
5787
|
+
* @memberOf punycode.ucs2
|
|
5788
|
+
* @name decode
|
|
5789
|
+
* @param {String} string The Unicode input string (UCS-2).
|
|
5790
|
+
* @returns {Array} The new array of code points.
|
|
5791
|
+
*/function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter<length){value=string.charCodeAt(counter++);if(value>=0xD800&&value<=0xDBFF&&counter<length){// high surrogate, and there is a next character
|
|
5792
|
+
extra=string.charCodeAt(counter++);if((extra&0xFC00)==0xDC00){// low surrogate
|
|
5793
|
+
output.push(((value&0x3FF)<<10)+(extra&0x3FF)+0x10000);}else{// unmatched surrogate; only append this code unit, in case the next
|
|
5794
|
+
// code unit is the high surrogate of a surrogate pair
|
|
5795
|
+
output.push(value);counter--;}}else{output.push(value);}}return output;}/**
|
|
5796
|
+
* Creates a string based on an array of numeric code points.
|
|
5797
|
+
* @see `punycode.ucs2.decode`
|
|
5798
|
+
* @memberOf punycode.ucs2
|
|
5799
|
+
* @name encode
|
|
5800
|
+
* @param {Array} codePoints The array of numeric code points.
|
|
5801
|
+
* @returns {String} The new Unicode string (UCS-2).
|
|
5802
|
+
*/function ucs2encode(array){return map(array,function(value){var output='';if(value>0xFFFF){value-=0x10000;output+=stringFromCharCode(value>>>10&0x3FF|0xD800);value=0xDC00|value&0x3FF;}output+=stringFromCharCode(value);return output;}).join('');}/**
|
|
5803
|
+
* Converts a basic code point into a digit/integer.
|
|
5804
|
+
* @see `digitToBasic()`
|
|
5805
|
+
* @private
|
|
5806
|
+
* @param {Number} codePoint The basic numeric code point value.
|
|
5807
|
+
* @returns {Number} The numeric value of a basic code point (for use in
|
|
5808
|
+
* representing integers) in the range `0` to `base - 1`, or `base` if
|
|
5809
|
+
* the code point does not represent a value.
|
|
5810
|
+
*/function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22;}if(codePoint-65<26){return codePoint-65;}if(codePoint-97<26){return codePoint-97;}return base;}/**
|
|
5811
|
+
* Converts a digit/integer into a basic code point.
|
|
5812
|
+
* @see `basicToDigit()`
|
|
5813
|
+
* @private
|
|
5814
|
+
* @param {Number} digit The numeric value of a basic code point.
|
|
5815
|
+
* @returns {Number} The basic code point whose value (when used for
|
|
5816
|
+
* representing integers) is `digit`, which needs to be in the range
|
|
5817
|
+
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
|
|
5818
|
+
* used; else, the lowercase form is used. The behavior is undefined
|
|
5819
|
+
* if `flag` is non-zero and `digit` has no uppercase form.
|
|
5820
|
+
*/function digitToBasic(digit,flag){// 0..25 map to ASCII a..z or A..Z
|
|
5821
|
+
// 26..35 map to ASCII 0..9
|
|
5822
|
+
return digit+22+75*(digit<26)-((flag!=0)<<5);}/**
|
|
5823
|
+
* Bias adaptation function as per section 3.4 of RFC 3492.
|
|
5824
|
+
* https://tools.ietf.org/html/rfc3492#section-3.4
|
|
5825
|
+
* @private
|
|
5826
|
+
*/function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for/* no initialization */(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin);}return floor(k+(baseMinusTMin+1)*delta/(delta+skew));}/**
|
|
5827
|
+
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
|
|
5828
|
+
* symbols.
|
|
5829
|
+
* @memberOf punycode
|
|
5830
|
+
* @param {String} input The Punycode string of ASCII-only symbols.
|
|
5831
|
+
* @returns {String} The resulting string of Unicode symbols.
|
|
5832
|
+
*/function decode(input){// Don't use UCS-2
|
|
5833
|
+
var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic,j,index,oldi,w,k,digit,t,/** Cached calculation results */baseMinusT;// Handle the basic code points: let `basic` be the number of input code
|
|
5834
|
+
// points before the last delimiter, or `0` if there is none, then copy
|
|
5835
|
+
// the first basic code points to the output.
|
|
5836
|
+
basic=input.lastIndexOf(delimiter);if(basic<0){basic=0;}for(j=0;j<basic;++j){// if it's not a basic code point
|
|
5837
|
+
if(input.charCodeAt(j)>=0x80){error('not-basic');}output.push(input.charCodeAt(j));}// Main decoding loop: start just after the last delimiter if any basic code
|
|
5838
|
+
// points were copied; start at the beginning otherwise.
|
|
5839
|
+
for/* no final expression */(index=basic>0?basic+1:0;index<inputLength;){// `index` is the index of the next character to be consumed.
|
|
5840
|
+
// Decode a generalized variable-length integer into `delta`,
|
|
5841
|
+
// which gets added to `i`. The overflow checking is easier
|
|
5842
|
+
// if we increase `i` as we go, then subtract off its starting
|
|
5843
|
+
// value at the end to obtain `delta`.
|
|
5844
|
+
for/* no condition */(oldi=i,w=1,k=base;;k+=base){if(index>=inputLength){error('invalid-input');}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error('overflow');}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break;}baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error('overflow');}w*=baseMinusT;}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);// `i` was supposed to wrap around from `out` to `0`,
|
|
5845
|
+
// incrementing `n` each time, so we'll fix that now:
|
|
5846
|
+
if(floor(i/out)>maxInt-n){error('overflow');}n+=floor(i/out);i%=out;// Insert `n` at position `i` of the output
|
|
5847
|
+
output.splice(i++,0,n);}return ucs2encode(output);}/**
|
|
5848
|
+
* Converts a string of Unicode symbols (e.g. a domain name label) to a
|
|
5849
|
+
* Punycode string of ASCII-only symbols.
|
|
5850
|
+
* @memberOf punycode
|
|
5851
|
+
* @param {String} input The string of Unicode symbols.
|
|
5852
|
+
* @returns {String} The resulting Punycode string of ASCII-only symbols.
|
|
5853
|
+
*/function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],/** `inputLength` will hold the number of code points in `input`. */inputLength,/** Cached calculation results */handledCPCountPlusOne,baseMinusT,qMinusT;// Convert the input in UCS-2 to Unicode
|
|
5854
|
+
input=ucs2decode(input);// Cache the length
|
|
5855
|
+
inputLength=input.length;// Initialize the state
|
|
5856
|
+
n=initialN;delta=0;bias=initialBias;// Handle the basic code points
|
|
5857
|
+
for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<0x80){output.push(stringFromCharCode(currentValue));}}handledCPCount=basicLength=output.length;// `handledCPCount` is the number of code points that have been handled;
|
|
5858
|
+
// `basicLength` is the number of basic code points.
|
|
5859
|
+
// Finish the basic string - if it is not empty - with a delimiter
|
|
5860
|
+
if(basicLength){output.push(delimiter);}// Main encoding loop:
|
|
5861
|
+
while(handledCPCount<inputLength){// All non-basic code points < n have been handled already. Find the next
|
|
5862
|
+
// larger one:
|
|
5863
|
+
for(m=maxInt,j=0;j<inputLength;++j){currentValue=input[j];if(currentValue>=n&¤tValue<m){m=currentValue;}}// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
|
|
5864
|
+
// but guard against overflow
|
|
5865
|
+
handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/handledCPCountPlusOne)){error('overflow');}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<n&&++delta>maxInt){error('overflow');}if(currentValue==n){// Represent delta as a generalized variable-length integer
|
|
5866
|
+
for/* no condition */(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break;}qMinusT=q-t;baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT);}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount;}}++delta;++n;}return output.join('');}/**
|
|
5867
|
+
* Converts a Punycode string representing a domain name or an email address
|
|
5868
|
+
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
|
|
5869
|
+
* it doesn't matter if you call it on a string that has already been
|
|
5870
|
+
* converted to Unicode.
|
|
5871
|
+
* @memberOf punycode
|
|
5872
|
+
* @param {String} input The Punycoded domain name or email address to
|
|
5873
|
+
* convert to Unicode.
|
|
5874
|
+
* @returns {String} The Unicode representation of the given Punycode
|
|
5875
|
+
* string.
|
|
5876
|
+
*/function toUnicode(input){return mapDomain(input,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string;});}/**
|
|
5877
|
+
* Converts a Unicode string representing a domain name or an email address to
|
|
5878
|
+
* Punycode. Only the non-ASCII parts of the domain name will be converted,
|
|
5879
|
+
* i.e. it doesn't matter if you call it with a domain that's already in
|
|
5880
|
+
* ASCII.
|
|
5881
|
+
* @memberOf punycode
|
|
5882
|
+
* @param {String} input The domain name or email address to convert, as a
|
|
5883
|
+
* Unicode string.
|
|
5884
|
+
* @returns {String} The Punycode representation of the given domain name or
|
|
5885
|
+
* email address.
|
|
5886
|
+
*/function toASCII(input){return mapDomain(input,function(string){return regexNonASCII.test(string)?'xn--'+encode(string):string;});}/*--------------------------------------------------------------------------*//** Define the public API */punycode={/**
|
|
5887
|
+
* A string representing the current Punycode.js version number.
|
|
5888
|
+
* @memberOf punycode
|
|
5889
|
+
* @type String
|
|
5890
|
+
*/'version':'1.4.1',/**
|
|
5891
|
+
* An object of methods to convert from JavaScript's internal character
|
|
5892
|
+
* representation (UCS-2) to Unicode code points, and back.
|
|
5893
|
+
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
5894
|
+
* @memberOf punycode
|
|
5895
|
+
* @type Object
|
|
5896
|
+
*/'ucs2':{'decode':ucs2decode,'encode':ucs2encode},'decode':decode,'encode':encode,'toASCII':toASCII,'toUnicode':toUnicode};/** Expose `punycode` */// Some AMD build optimizers, like r.js, check for specific condition patterns
|
|
5897
|
+
// like the following:
|
|
5898
|
+
if(typeof define=='function'&&typeof define.amd=='object'&&define.amd){define('punycode',function(){return punycode;});}else if(freeExports&&freeModule){if(module.exports==freeExports){// in Node.js, io.js, or RingoJS v0.8.0+
|
|
5899
|
+
freeModule.exports=punycode;}else{// in Narwhal or RingoJS v0.7.0-
|
|
5900
|
+
for(key in punycode){punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key]);}}}else{// in Rhino or a web browser
|
|
5901
|
+
root.punycode=punycode;}})(this);}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{}],188:[function(require,module,exports){/*
|
|
5887
5902
|
* Copyright Joyent, Inc. and other Node contributors.
|
|
5888
5903
|
*
|
|
5889
5904
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
@@ -6061,7 +6076,7 @@ if(psychotic){result.hostname=isAbsolute?'':srcPath.length?srcPath.shift():'';re
|
|
|
6061
6076
|
* this especially happens in cases like
|
|
6062
6077
|
* url.resolveObject('mailto:local1@domain1', 'local2@domain2')
|
|
6063
6078
|
*/var authInHost=result.host&&result.host.indexOf('@')>0?result.host.split('@'):false;if(authInHost){result.auth=authInHost.shift();result.hostname=authInHost.shift();result.host=result.hostname;}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift('');}if(srcPath.length>0){result.pathname=srcPath.join('/');}else{result.pathname=null;result.path=null;}// to support request.http
|
|
6064
|
-
if(result.pathname!==null||result.search!==null){result.path=(result.pathname?result.pathname:'')+(result.search?result.search:'');}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result;};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==':'){this.port=port.substr(1);}host=host.substr(0,host.length-port.length);}if(host){this.hostname=host;}};exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url;},{"punycode/":
|
|
6079
|
+
if(result.pathname!==null||result.search!==null){result.path=(result.pathname?result.pathname:'')+(result.search?result.search:'');}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result;};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==':'){this.port=port.substr(1);}host=host.substr(0,host.length-port.length);}if(host){this.hostname=host;}};exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url;},{"punycode/":187,"qs":152}],189:[function(require,module,exports){(function(global){(function(){/**
|
|
6065
6080
|
* Module exports.
|
|
6066
6081
|
*/module.exports=deprecate;/**
|
|
6067
6082
|
* Mark that a method should not be used.
|
|
@@ -6091,7 +6106,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
6091
6106
|
// presumably different callback function.
|
|
6092
6107
|
// This makes sure that own properties are retained, so that
|
|
6093
6108
|
// decorations and such are not lost along the way.
|
|
6094
|
-
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.
|
|
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.371","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/stevenvelozo/pict/issues"},"homepage":"https://github.com/stevenvelozo/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.3.2","quackage":"^1.2.3","sinon":"^20.0.0","typescript":"^5.9.3"},"dependencies":{"cachetrax":"^1.0.6","fable":"^3.1.74","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.
|
|
6095
6110
|
/* global Pict, _Pict: writeable *//**
|
|
6096
6111
|
* Simple function to load a pict Application
|
|
6097
6112
|
*
|
|
@@ -6386,7 +6401,7 @@ this.fable.manifest.setValueByHash(tmpDestinationEntity,tmpBucketAddress,tmpSour
|
|
|
6386
6401
|
* @param {Record<string, any>} pInputRecord - The input record to use when resolving the output recordset address mapping.
|
|
6387
6402
|
*
|
|
6388
6403
|
* @return {string|null} - The resolved output recordset address, or null if no mapping was found.
|
|
6389
|
-
*/_resolveOutputRecordsetAddressMapping(pConfiguration,pContext,pInputRecord){const tmpAddressSpace=Object.assign({InputRecord:pInputRecord},pContext);for(const tmpRule of Object.keys(pConfiguration.OutputRecordsetAddressMapping)){const
|
|
6404
|
+
*/_resolveOutputRecordsetAddressMapping(pConfiguration,pContext,pInputRecord){const tmpAddressSpace=Object.assign({InputRecord:pInputRecord},pContext);for(const tmpRule of Object.keys(pConfiguration.OutputRecordsetAddressMapping)){const _tmpRule$split=tmpRule.split(','),_tmpRule$split2=_slicedToArray(_tmpRule$split,3),tmpLHSAddress=_tmpRule$split2[0],tmpOperator=_tmpRule$split2[1],tmpMatchValue=_tmpRule$split2[2];const tmpLHS=this.fable.manifest.getValueByHash(tmpAddressSpace,tmpLHSAddress);if(!tmpLHS){if(this.fable.LogNoisiness>0){this.log.warn(`EntityBundleRequest failed to project dataset because the LHS address [${tmpLHSAddress}] did not return a value.`);}continue;}switch(tmpOperator){case'AnyContains':if(!Array.isArray(tmpLHS)){//TODO: consider making this use objects as well?
|
|
6390
6405
|
this.log.error(`EntityBundleRequest failed to project dataset because the LHS address [${tmpLHSAddress}] did not return an array.`);continue;}for(const tmpLHSValue of tmpLHS){if(String(tmpLHSValue).includes(tmpMatchValue)){return pConfiguration.OutputRecordsetAddressMapping[tmpRule];}}}}return null;}/**
|
|
6391
6406
|
* @param {Record<string, any>} pCustomRequestInformation - The custom request information object.
|
|
6392
6407
|
* @param {Record<string, any>} pContext - The context object to use when parsing templates and resolving addresses.
|
|
@@ -6489,6 +6504,22 @@ this.recordCache[pEntity].prune(function(){let tmpPossibleRecord=this.recordCach
|
|
|
6489
6504
|
return fCallback(new Error(`Error getting entity [${pEntity}] with ID [${pIDRecord}] from url [${tmpOptions.url}]: ${pResponse.statusCode} ${JSON.stringify(pBody || {})}`));
|
|
6490
6505
|
}
|
|
6491
6506
|
*/if(pBody){this.recordCache[pEntity].put(pBody,pIDRecord);}return fCallback(pError,pBody);});}.bind(this));}/**
|
|
6507
|
+
* For a given list of objects, cache connected entity records (use lazy loading of pages and not count requests).
|
|
6508
|
+
*
|
|
6509
|
+
* @param {Array} pRecordSet - An array of objects to check cache on joined records for, and, get/cache the records as needed.
|
|
6510
|
+
* @param {Array} pIDListToCache - An array of property strings that are the ID fields to cache connected records for.
|
|
6511
|
+
* @param {Array} pEntityListToCache - An array of entity names, which can override the speculative entity name derived from the ID field name.
|
|
6512
|
+
* @param {boolean} pLiteRecords - If true, only cache lite records (ID and Name fields).
|
|
6513
|
+
*
|
|
6514
|
+
* @return {void}
|
|
6515
|
+
*/cacheConnectedEntityRecordsWithoutCount(pRecordSet,pIDListToCache,pEntityListToCache,pLiteRecords,fCallback){//FIXME: pLiteRecords is ignored?
|
|
6516
|
+
if(!Array.isArray(pRecordSet)||pRecordSet.length<1){return fCallback();}if(!Array.isArray(pIDListToCache)||pIDListToCache.length<1){return fCallback();};const tmpAnticipate=this.fable.newAnticipate();const tmpEntityListToCache=pEntityListToCache||[];tmpAnticipate.maxOperations=10;for(let i=0;i<pIDListToCache.length;i++){const tmpEntityIDSourceField=pIDListToCache[i];// If an entity name override is provided, use it, otherwise speculate the joined entity name ID field from the source ID field name.
|
|
6517
|
+
const tmpEntityName=tmpEntityListToCache[i]||tmpEntityIDSourceField.replace(/^ID/,'');const tmpIDField=`ID${tmpEntityName}`;// Make a set of IDs to fetch for this entity.
|
|
6518
|
+
const tmpEntityIDsToFetch=new Set();// Initialize the cache
|
|
6519
|
+
this.initializeCache(tmpEntityName);// First pass: gather IDs to fetch
|
|
6520
|
+
for(const tmpRecord of pRecordSet){const tmpIDValue=tmpRecord[tmpEntityIDSourceField];if(tmpIDValue){const tmpCachedRecord=this.recordCache[tmpEntityName].read(tmpIDValue);if(!tmpCachedRecord){tmpEntityIDsToFetch.add(tmpIDValue);}}}// Now if there are records to fetch, do the request.
|
|
6521
|
+
if(tmpEntityIDsToFetch.size>0){tmpAnticipate.anticipate(function(fRequestComplete){const tmpIDRecordsArray=Array.from(tmpEntityIDsToFetch);const tmpMeadowFilterExpression=`FBL~ID${tmpEntityName}~INN~${tmpIDRecordsArray.join(',')}`;this.getEntitySet(tmpEntityName,tmpMeadowFilterExpression,(pError,pEntitySet)=>{if(pError){this.log.error(`cacheConnectedEntityRecords error getting connected entity records for [${tmpEntityName}] with IDs [${tmpIDRecordsArray.join(',')}]: ${pError}`,{Stack:pError.stack});return fRequestComplete(pError);}// The method automagically cached them for us! Just move on to the next...
|
|
6522
|
+
return fRequestComplete();},null,{NoCount:true});}.bind(this));}}tmpAnticipate.wait(pError=>{if(pError){this.log.error(`cacheConnectedEntityRecords error gathering connected entity records: ${pError}`,{Stack:pError.stack});return fCallback(pError);}return fCallback();});}/**
|
|
6492
6523
|
* For a given list of objects, cache connected entity records.
|
|
6493
6524
|
*
|
|
6494
6525
|
* @param {Array} pRecordSet - An array of objects to check cache on joined records for, and, get/cache the records as needed.
|
|
@@ -6543,7 +6574,9 @@ else if(tmpColumnName in this.entityColumnTranslations){tmpIDColumnsToCache.push
|
|
|
6543
6574
|
// FBL~ID${pDestinationEntity}~INN~${tmpIDRecordsCommaSeparated}
|
|
6544
6575
|
// If the list is mega-long we can parse it and break it into chunks.
|
|
6545
6576
|
this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
|
|
6546
|
-
this.recordSetCache[pEntity].prune(function(){let tmpPossibleRecords=this.recordSetCache[pEntity].read(pMeadowFilterExpression);if(tmpPossibleRecords){return fCallback(null,tmpPossibleRecords);}
|
|
6577
|
+
this.recordSetCache[pEntity].prune(function(){let tmpPossibleRecords=this.recordSetCache[pEntity].read(pMeadowFilterExpression);if(tmpPossibleRecords){return fCallback(null,tmpPossibleRecords);}if(pOptions.NoCount){// Lazily load until we hit a not full page rather than using couns.
|
|
6578
|
+
// Does not respect parallelization.
|
|
6579
|
+
const pageSize=250;let page=0;let returnSet=[];const tmpFilterStanza=pMeadowFilterExpression?`/FilteredTo/${pMeadowFilterExpression}`:'';const recursiveCallback=(pDownloadError,pDownloadResponse,pDownloadBody)=>{if(pDownloadResponse&&pDownloadResponse.statusCode&&pDownloadResponse.statusCode>=400||!Array.isArray(pDownloadBody)){this.log.error(`Error getting entity set of [${pEntity}] filtered to [${pMeadowFilterExpression}]: ${pDownloadResponse.statusCode} ${pDownloadResponse.statusMessage}`);return fCallback(new Error(`Error getting entity set of [${pEntity}] filtered to [${pMeadowFilterExpression}]: ${pDownloadResponse.statusCode} ${JSON.stringify(pDownloadBody||{})}`),[]);}if((pDownloadBody===null||pDownloadBody===void 0?void 0:pDownloadBody.length)<pageSize){returnSet=returnSet.concat(pDownloadBody);if(returnSet){this.recordSetCache[pEntity].put(returnSet,pMeadowFilterExpression);}this.cacheIndividualEntityRecords(pEntity,returnSet);fCallback(null,returnSet);}else{page+=1;this.restClient.getJSON(`${this.options.urlPrefix}${pEntity}s${tmpFilterStanza}/${page*pageSize}/${pageSize}`+(postfix||''),recursiveCallback);}};return this.restClient.getJSON(`${this.options.urlPrefix}${pEntity}s${tmpFilterStanza}/${page*pageSize}/${pageSize}`+(postfix||''),recursiveCallback);}return this.getEntitySetRecordCount(pEntity,pMeadowFilterExpression,(pRecordCountError,pRecordCount)=>{if(pRecordCountError){return fCallback(pRecordCountError);}let tmpRecordCount=pRecordCount;if(isNaN(pRecordCount)){this.log.error(`Entity count did not return a number for [${pEntity}] filtered to [${pMeadowFilterExpression}]... something is fatally wrong from the server accessed in getEntitySet call.`);return fCallback(new Error('Entity count did not return a number in getEntitySet.'));}let tmpDownloadBatchSize=this.options.downloadBatchSize;const tmpFilterStanza=pMeadowFilterExpression?`/FilteredTo/${pMeadowFilterExpression}`:'';const tmpPageCount=Math.ceil(tmpRecordCount/tmpDownloadBatchSize);// Build an indexed array of page descriptors to preserve ordering
|
|
6547
6580
|
const tmpPages=[];for(let i=0;i<tmpPageCount;i++){tmpPages.push({Index:i,URL:`${this.options.urlPrefix}${pEntity}s${tmpFilterStanza}/${i*tmpDownloadBatchSize}/${tmpDownloadBatchSize}`,Records:null});}// Fetch pages concurrently and reassemble in order.
|
|
6548
6581
|
// Per-call DownloadPageConcurrency overrides the provider-level default.
|
|
6549
6582
|
const tmpPageConcurrency=typeof pOptions.DownloadPageConcurrency==='number'?pOptions.DownloadPageConcurrency:typeof this.options.downloadPageConcurrency==='number'?this.options.downloadPageConcurrency:4;this.fable.Utility.eachLimit(tmpPages,tmpPageConcurrency,(pPage,fDownloadCallback)=>{this.restClient.getJSON(pPage.URL+(postfix||''),(pDownloadError,pDownloadResponse,pDownloadBody)=>{if(pDownloadResponse&&pDownloadResponse.statusCode&&pDownloadResponse.statusCode>=400){this.log.error(`Error getting entity set of [${pEntity}] filtered to [${pMeadowFilterExpression}] from url [${pPage.URL}]: ${pDownloadResponse.statusCode} ${pDownloadResponse.statusMessage}`);return fDownloadCallback(new Error(`Error getting entity set of [${pEntity}] filtered to [${pMeadowFilterExpression}] from url [${pPage.URL}]: ${pDownloadResponse.statusCode} ${JSON.stringify(pDownloadBody||{})}`));}if(Array.isArray(pDownloadBody)){pPage.Records=pDownloadBody;}return fDownloadCallback(pDownloadError);});},pFullDownloadError=>{// Reassemble pages in index order to maintain consistent ordering
|
|
@@ -6879,7 +6912,13 @@ this.addTemplate(require(`./templates/Pict-Template-Icon.js`));// Look up an ent
|
|
|
6879
6912
|
// ...meaning GET BOOK with IDBook FROM AppData.Some.Address.IDBook and render it to Render-Book-Template
|
|
6880
6913
|
this.addTemplate(require(`./templates/Pict-Template-Entity.js`));// Child Template Expressions
|
|
6881
6914
|
// {~T:Template:AddressOfData~}
|
|
6882
|
-
this.addTemplate(require(`./templates/Pict-Template-Template.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateByDataAddress.js`));//
|
|
6915
|
+
this.addTemplate(require(`./templates/Pict-Template-Template.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateByDataAddress.js`));// Inline Template Expression -- parse the contents as a template at runtime
|
|
6916
|
+
// {<TEMPLATED CONTENT HERE, {~D:AppData.SomeValue~}.>}
|
|
6917
|
+
this.addTemplate(require(`./templates/Pict-Template-InlineTemplate.js`));// Function Expression -- call a function by address with addressed arguments
|
|
6918
|
+
// {~Function:Pict.providers.X.makeThing:Record.X:Record.Y~} / {~F:...~}
|
|
6919
|
+
this.addTemplate(require(`./templates/Pict-Template-Function.js`));// Addressed Template Expression -- resolve an address to a template string and render it
|
|
6920
|
+
// {[AppData.MyTemplate]}
|
|
6921
|
+
this.addTemplate(require(`./templates/Pict-Template-AddressedTemplate.js`));// {~SBR:AppData.Equation:AppData.HomeworkRectangleSize:AppData.HomeworkManifest~}
|
|
6883
6922
|
this.addTemplate(require(`./templates/Pict-Template-SolveByReference.js`));this.addTemplate(require(`./templates/Pict-Template-Solve.js`));// {~TS:Template:AddressOfDataSet~}
|
|
6884
6923
|
this.addTemplate(require(`./templates/Pict-Template-TemplateSet.js`));// {~TVS:Template:AddressOfDataSet~}
|
|
6885
6924
|
this.addTemplate(require(`./templates/Pict-Template-TemplateValueSet.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateSetWithPayload.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateFromMap.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateSetFromMap.js`));// Logical Branching Template Expressions
|
|
@@ -6989,7 +7028,7 @@ let tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||typ
|
|
|
6989
7028
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
6990
7029
|
*/parseTemplateSetWithPayloadByHash(pTemplateHash,pDataSet,pPayload,fCallback,pContextArray,pScope,pState){let tmpTemplateString=this.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
6991
7030
|
if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplateSetWithPayload(tmpTemplateString,pDataSet,pPayload,fCallback,pContextArray,pScope,pState);}}module.exports=Pict;module.exports.ServiceProviderBase=require('fable-serviceproviderbase');module.exports.PictApplicationClass=require("pict-application");module.exports.PictViewClass=require("pict-view");module.exports.PictProviderClass=require("pict-provider");module.exports.PictTemplateClass=require("pict-template");module.exports.EnvironmentLog=require("./environments/Pict-Environment-Log.js");module.exports.EnvironmentObject=require("./environments/Pict-Environment-Object.js");module.exports.FilterClauseBase=require('./filters/FilterClauseBase.js');module.exports.FilterClauseLocal=require('./filters/FilterClauseLocal.js');module.exports.FilterClauseInternalJoin=require('./filters/FilterClauseInternalJoin.js');module.exports.FilterClauseExternalJoin=require('./filters/FilterClauseExternalJoin.js');// This is to help understand the type of enivironement we're executing in
|
|
6992
|
-
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require(`./Pict-Browser-SafeOnDocumentReady.js`);module.exports.safeLoadPictApplication=require(`./Pict-Browser-SafeLoad.js`);},{"../package.json":192,"./Pict-Browser-SafeLoad.js":193,"./Pict-Browser-SafeOnDocumentReady.js":194,"./Pict-CSS.js":195,"./Pict-Content-Assignment.js":196,"./Pict-DataProvider.js":197,"./Pict-Meadow-EntityProvider.js":198,"./Pict-Template-Audit.js":199,"./Pict-Template-Provider.js":200,"./environments/Pict-Environment-Log.js":202,"./environments/Pict-Environment-Object.js":203,"./filters/FilterClauseBase.js":205,"./filters/FilterClauseExternalJoin.js":206,"./filters/FilterClauseInternalJoin.js":207,"./filters/FilterClauseLocal.js":208,"./providers/Provider-DataBroker.js":210,"./providers/Provider-Filter-Manager.js":211,"./providers/Provider-Icon.js":212,"./services/Fable-Service-TransactionTracking.js":213,"./templates/Pict-Template-
|
|
7031
|
+
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require(`./Pict-Browser-SafeOnDocumentReady.js`);module.exports.safeLoadPictApplication=require(`./Pict-Browser-SafeLoad.js`);},{"../package.json":192,"./Pict-Browser-SafeLoad.js":193,"./Pict-Browser-SafeOnDocumentReady.js":194,"./Pict-CSS.js":195,"./Pict-Content-Assignment.js":196,"./Pict-DataProvider.js":197,"./Pict-Meadow-EntityProvider.js":198,"./Pict-Template-Audit.js":199,"./Pict-Template-Provider.js":200,"./environments/Pict-Environment-Log.js":202,"./environments/Pict-Environment-Object.js":203,"./filters/FilterClauseBase.js":205,"./filters/FilterClauseExternalJoin.js":206,"./filters/FilterClauseInternalJoin.js":207,"./filters/FilterClauseLocal.js":208,"./providers/Provider-DataBroker.js":210,"./providers/Provider-Filter-Manager.js":211,"./providers/Provider-Icon.js":212,"./services/Fable-Service-TransactionTracking.js":213,"./templates/Pict-Template-AddressedTemplate.js":214,"./templates/Pict-Template-Data.js":215,"./templates/Pict-Template-DataValueByKey.js":216,"./templates/Pict-Template-DataWithAbsoluteFallback.js":217,"./templates/Pict-Template-DataWithTemplateFallback.js":218,"./templates/Pict-Template-Entity.js":219,"./templates/Pict-Template-Function.js":220,"./templates/Pict-Template-Icon.js":221,"./templates/Pict-Template-InlineTemplate.js":222,"./templates/Pict-Template-Self.js":223,"./templates/Pict-Template-Solve.js":224,"./templates/Pict-Template-SolveByReference.js":225,"./templates/Pict-Template-Template.js":226,"./templates/Pict-Template-TemplateByDataAddress.js":227,"./templates/Pict-Template-TemplateByReference.js":228,"./templates/Pict-Template-TemplateByTypes.js":229,"./templates/Pict-Template-TemplateFromAddress.js":230,"./templates/Pict-Template-TemplateFromMap.js":231,"./templates/Pict-Template-TemplateSet.js":232,"./templates/Pict-Template-TemplateSetFromMap.js":233,"./templates/Pict-Template-TemplateSetWithPayload.js":234,"./templates/Pict-Template-TemplateValueSet.js":235,"./templates/Pict-Template-View.js":236,"./templates/data-generation/Pict-Template-RandomNumber.js":237,"./templates/data-generation/Pict-Template-RandomNumberString.js":238,"./templates/data/Pict-Template-DataEncodeJavascriptString.js":239,"./templates/data/Pict-Template-DataJson.js":240,"./templates/data/Pict-Template-DateOnlyFormat.js":241,"./templates/data/Pict-Template-DateOnlyYMD.js":242,"./templates/data/Pict-Template-DateTimeFormat.js":243,"./templates/data/Pict-Template-DateTimeYMD.js":244,"./templates/data/Pict-Template-Digits.js":245,"./templates/data/Pict-Template-Dollars.js":246,"./templates/data/Pict-Template-HtmlCommentEnd.js":247,"./templates/data/Pict-Template-HtmlCommentStart.js":248,"./templates/data/Pict-Template-Join.js":249,"./templates/data/Pict-Template-JoinUnique.js":250,"./templates/data/Pict-Template-PascalCaseIdentifier.js":251,"./templates/data/Pict-Template-PluckJoinUnique.js":252,"./templates/debugging/Pict-Template-Breakpoint.js":253,"./templates/debugging/Pict-Template-DataValueTree.js":254,"./templates/debugging/Pict-Template-LogStatement.js":255,"./templates/debugging/Pict-Template-LogValue.js":256,"./templates/debugging/Pict-Template-LogValueTree.js":257,"./templates/logic/Pict-Template-NotEmpty.js":258,"./templates/logic/Pict-Template-TemplateIf.js":260,"./templates/logic/Pict-Template-TemplateIfAbsolute.js":261,"fable":68,"fable-serviceproviderbase":59,"pict-application":140,"pict-provider":142,"pict-template":144,"pict-view":146}],202:[function(require,module,exports){/**
|
|
6993
7032
|
* Pict browser shim loader
|
|
6994
7033
|
* @author <steven@velozo.com>
|
|
6995
7034
|
*
|
|
@@ -7192,7 +7231,7 @@ tmpFilter.Operator='EQ';tmpFilter.Value=tmpValue;}else{tmpFilter.Operator='LK';t
|
|
|
7192
7231
|
*/compileMeadowFilterStanzas(pFilterState){const tmpBundleConfig=[];//TODO: mathematically solve the number line
|
|
7193
7232
|
// planned synthesized syntax for running on the server
|
|
7194
7233
|
// 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~}
|
|
7195
|
-
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||'',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{
|
|
7234
|
+
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||'',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;}/**
|
|
7196
7235
|
* @param {string} pFilter
|
|
7197
7236
|
*
|
|
7198
7237
|
* @return {string}
|
|
@@ -7649,7 +7688,49 @@ return this.transactionMap[pKey];}this.transactionMap[pKey]={TransactionKey:pKey
|
|
|
7649
7688
|
* @return {boolean} true if the event is new, false if it has already been registered
|
|
7650
7689
|
*/checkEvent(pKey,pEvent,pHash){let tmpHash=typeof pHash==='string'?pHash:'';let tmpTransaction=this.transactionMap[pKey];if(tmpTransaction==null){this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] does not exist; auto creating...`);tmpTransaction=this.registerTransaction(pKey);}if(tmpTransaction.Events[pEvent]==null){tmpTransaction.Events[pEvent]={};}if(tmpHash in tmpTransaction.Events[pEvent]){//this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] firing a second time...`);
|
|
7651
7690
|
this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] already exists in transaction [${pKey}]`,'Event');return false;}else{//this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] firing a first time...`);
|
|
7652
|
-
this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] registered in transaction [${pKey}]`,'Event');tmpTransaction.Events[pEvent][tmpHash]=true;return true;}}}module.exports=TransactionTracking;/** @type {Record<string, any>} */TransactionTracking.default_configuration={};},{"fable-serviceproviderbase":59}],214:[function(require,module,exports){const libPictTemplate=require('pict-template')
|
|
7691
|
+
this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] registered in transaction [${pKey}]`,'Event');tmpTransaction.Events[pEvent][tmpHash]=true;return true;}}}module.exports=TransactionTracking;/** @type {Record<string, any>} */TransactionTracking.default_configuration={};},{"fable-serviceproviderbase":59}],214:[function(require,module,exports){const libPictTemplate=require('pict-template');/**
|
|
7692
|
+
* Addressed Template expression.
|
|
7693
|
+
*
|
|
7694
|
+
* {[AppData.MyTemplate]}
|
|
7695
|
+
*
|
|
7696
|
+
* Looks up the value at the given address (resolved through the same
|
|
7697
|
+
* scope as {~D:~} -- Record, AppData, Pict, Bundle, Context, Scope,
|
|
7698
|
+
* TempData, __State) and renders it as a template against the current
|
|
7699
|
+
* Record/Context/Scope/State. Pairs with the inline template `{<...>}`:
|
|
7700
|
+
*
|
|
7701
|
+
* {<inline body, parsed at runtime>}
|
|
7702
|
+
* {[AppData.PathToTemplateString]} <- body is *stored* at the address
|
|
7703
|
+
*
|
|
7704
|
+
* If the address does not resolve, or resolves to a non-string, a warning
|
|
7705
|
+
* is logged that names the address and the full expression, and the
|
|
7706
|
+
* expression renders as ''.
|
|
7707
|
+
*/class PictTemplateProviderAddressedTemplate extends libPictTemplate{/**
|
|
7708
|
+
* @param {Object} pFable - The Fable Framework instance
|
|
7709
|
+
* @param {Object} pOptions - The options for the service
|
|
7710
|
+
* @param {String} pServiceHash - The hash of the service
|
|
7711
|
+
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);/** @type {any} */this.log;this.addPattern('{[',']}');}/**
|
|
7712
|
+
* Render the addressed template: resolve the address to a template
|
|
7713
|
+
* string and parse it against the current scope.
|
|
7714
|
+
*
|
|
7715
|
+
* @param {string} pTemplateHash - The address (what's between `{[` and `]}`)
|
|
7716
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7717
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7718
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7719
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7720
|
+
*
|
|
7721
|
+
* @return {string} The rendered template, or '' when the address can't be resolved to a string.
|
|
7722
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpAddress=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fAddressedTemplateRender]::[${tmpAddress}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fAddressedTemplateRender]::[${tmpAddress}]`);}if(tmpAddress.length<1){this.log.warn(`Pict: Addressed Template Render: No address provided in expression [{[${pTemplateHash}]}]`);return'';}let tmpTemplate=this.resolveStateFromAddress(tmpAddress,tmpRecord,pContextArray,null,pScope,pState);if(tmpTemplate==null){this.log.warn(`Pict: Addressed Template Render: Address [${tmpAddress}] did not resolve for expression [{[${pTemplateHash}]}]`);return'';}if(typeof tmpTemplate!=='string'){this.log.warn(`Pict: Addressed Template Render: Address [${tmpAddress}] resolved to a non-string (${typeof tmpTemplate}) for expression [{[${pTemplateHash}]}]`);return'';}if(tmpTemplate.length<1){return'';}return this.pict.parseTemplate(tmpTemplate,pRecord,null,pContextArray,pScope,pState);}/**
|
|
7723
|
+
* Render the addressed template asynchronously.
|
|
7724
|
+
*
|
|
7725
|
+
* @param {string} pTemplateHash - The address (what's between `{[` and `]}`)
|
|
7726
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7727
|
+
* @param {(error?: Error, content?: String) => void} fCallback - callback function invoked with the rendered template, or an error
|
|
7728
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7729
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7730
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7731
|
+
*
|
|
7732
|
+
* @return {void}
|
|
7733
|
+
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){let tmpAddress=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fAddressedTemplateRenderAsync]::[${tmpAddress}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fAddressedTemplateRenderAsync]::[${tmpAddress}]`);}if(tmpAddress.length<1){this.log.warn(`Pict: Addressed Template Render: No address provided in expression [{[${pTemplateHash}]}]`);return tmpCallback(null,'');}let tmpTemplate=this.resolveStateFromAddress(tmpAddress,tmpRecord,pContextArray,null,pScope,pState);if(tmpTemplate==null){this.log.warn(`Pict: Addressed Template Render: Address [${tmpAddress}] did not resolve for expression [{[${pTemplateHash}]}]`);return tmpCallback(null,'');}if(typeof tmpTemplate!=='string'){this.log.warn(`Pict: Addressed Template Render: Address [${tmpAddress}] resolved to a non-string (${typeof tmpTemplate}) for expression [{[${pTemplateHash}]}]`);return tmpCallback(null,'');}if(tmpTemplate.length<1){return tmpCallback(null,'');}this.pict.parseTemplate(tmpTemplate,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderAddressedTemplate;module.exports.template_hash='AddressedTemplate';},{"pict-template":144}],215:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderData extends libPictTemplate{/**
|
|
7653
7734
|
* @param {Object} pFable - The Fable Framework instance
|
|
7654
7735
|
* @param {Object} pOptions - The options for the service
|
|
7655
7736
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7663,7 +7744,7 @@ this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] registered in transa
|
|
|
7663
7744
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7664
7745
|
*
|
|
7665
7746
|
* @return {string} The rendered template
|
|
7666
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpDefaultValue='';if(tmpHash.indexOf(':')>-1){tmpDefaultValue=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}let tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray,null,pScope,pState);}if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'||tmpValue===''){return tmpDefaultValue;}return tmpValue;}}module.exports=PictTemplateProviderData;},{"pict-template":144}],
|
|
7747
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpDefaultValue='';if(tmpHash.indexOf(':')>-1){tmpDefaultValue=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}let tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray,null,pScope,pState);}if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'||tmpValue===''){return tmpDefaultValue;}return tmpValue;}}module.exports=PictTemplateProviderData;},{"pict-template":144}],216:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDataValueByKey extends libPictTemplate{/**
|
|
7667
7748
|
* @param {Object} pFable - The Fable Framework instance
|
|
7668
7749
|
* @param {Object} pOptions - The options for the service
|
|
7669
7750
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7677,7 +7758,7 @@ this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] registered in transa
|
|
|
7677
7758
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7678
7759
|
*
|
|
7679
7760
|
* @return {string} The rendered template
|
|
7680
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpHashArray=tmpHash.split(':');if(tmpHashArray.length<2){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] failed because there were not two stanzas in the expression [${pTemplateHash}]`);return'';}let tmpDefaultValue='';if(tmpHashArray.length>2){tmpDefaultValue=tmpHashArray[2];}let tmpValueObject=this.resolveStateFromAddress(tmpHashArray[0],tmpRecord,pContextArray,null,pScope,pState);let tmpValueAddress=this.resolveStateFromAddress(tmpHashArray[1],tmpRecord,pContextArray,null,pScope,pState);let tmpValue=this.pict.manifest.getValueByHash(tmpValueObject,tmpValueAddress);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return tmpDefaultValue;}return tmpValue;}}module.exports=PictTemplateProviderDataValueByKey;},{"pict-template":144}],
|
|
7761
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpHashArray=tmpHash.split(':');if(tmpHashArray.length<2){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] failed because there were not two stanzas in the expression [${pTemplateHash}]`);return'';}let tmpDefaultValue='';if(tmpHashArray.length>2){tmpDefaultValue=tmpHashArray[2];}let tmpValueObject=this.resolveStateFromAddress(tmpHashArray[0],tmpRecord,pContextArray,null,pScope,pState);let tmpValueAddress=this.resolveStateFromAddress(tmpHashArray[1],tmpRecord,pContextArray,null,pScope,pState);let tmpValue=this.pict.manifest.getValueByHash(tmpValueObject,tmpValueAddress);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return tmpDefaultValue;}return tmpValue;}}module.exports=PictTemplateProviderDataValueByKey;},{"pict-template":144}],217:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderData extends libPictTemplate{/**
|
|
7681
7762
|
* @param {Object} pFable - The Fable Framework instance
|
|
7682
7763
|
* @param {Object} pOptions - The options for the service
|
|
7683
7764
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7705,7 +7786,7 @@ return tmpAbsoluteFallbackValue;}/**
|
|
|
7705
7786
|
*
|
|
7706
7787
|
* @return {void} The result is passed to the callback function
|
|
7707
7788
|
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT DataWithAbsoluteFallback [fDataRender]::[${tmpHash}] with tmpRecord:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithAbsoluteFallback [fDataRender]::[${tmpHash}]`);}let tmpAbsoluteFallbackValue='';if(tmpHash.indexOf(':')>-1){tmpAbsoluteFallbackValue=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}let tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray,null,pScope,pState);if(tmpValue&&tmpValue!=='undefined'){if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithAbsoluteFallback [fDataRender]::[${tmpHash}] - Found value: ${tmpValue}`);}return tmpCallback(null,tmpValue);}}// If the value is not found or is undefined, use the fallback value
|
|
7708
|
-
return tmpCallback(null,tmpAbsoluteFallbackValue);}}module.exports=PictTemplateProviderData;},{"pict-template":144}],
|
|
7789
|
+
return tmpCallback(null,tmpAbsoluteFallbackValue);}}module.exports=PictTemplateProviderData;},{"pict-template":144}],218:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderData extends libPictTemplate{/**
|
|
7709
7790
|
* @param {Object} pFable - The Fable Framework instance
|
|
7710
7791
|
* @param {Object} pOptions - The options for the service
|
|
7711
7792
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7735,7 +7816,7 @@ return'';}if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFall
|
|
|
7735
7816
|
* @return {void} The result is passed to the callback function
|
|
7736
7817
|
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] with tmpRecord:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}]`);}let tmpTemplateFallbackAddress='';if(tmpHash.indexOf(':')>-1){tmpTemplateFallbackAddress=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}let tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray,null,pScope,pState);if(tmpValue&&tmpValue!=='undefined'){if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] - Found value: ${tmpValue}`);}return tmpCallback(null,tmpValue);}}// If the value is not found or is undefined, try to use the fallback template
|
|
7737
7818
|
this.pict.parseTemplateByHash(tmpTemplateFallbackAddress,tmpRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}if(pValue==null||pValue===''){this.log.warn(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] - No fallback template found at address: ${tmpTemplateFallbackAddress}`);// If no fallback template is found, return an empty string
|
|
7738
|
-
return tmpCallback(null,'');}if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] - Using fallback template from address: ${tmpTemplateFallbackAddress}`);}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderData;},{"pict-template":144}],
|
|
7819
|
+
return tmpCallback(null,'');}if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] - Using fallback template from address: ${tmpTemplateFallbackAddress}`);}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderData;},{"pict-template":144}],219:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderEntity extends libPictTemplate{/**
|
|
7739
7820
|
* @param {Object} pFable - The Fable Framework instance
|
|
7740
7821
|
* @param {Object} pOptions - The options for the service
|
|
7741
7822
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7766,7 +7847,43 @@ let tmpAddressParts=tmpHash.split('^');if(tmpAddressParts.length<2){this.log.war
|
|
|
7766
7847
|
tmpEntityID=this.resolveStateFromAddress(String(tmpEntityID),tmpData,pContextArray,null,pScope,pState);}// No Entity or EntityID
|
|
7767
7848
|
if(!tmpEntity||!tmpEntityID){this.log.warn(`Pict: Entity Render: Entity or entity ID not resolved for [${tmpHash}] Entity: ${tmpEntity} ID: ${tmpEntityID}`);return tmpCallback(null,'');}if(this.pict.LogNoisiness>3){this.log.trace(`Pict: Entity Render: Entity [${tmpEntity}] with ID [${tmpEntityID}] as template [${tmpEntityTemplate}] from [${tmpHash}]`);}// Now try to get the entity
|
|
7768
7849
|
this.pict.EntityProvider.getEntity(tmpEntity,tmpEntityID,function(pError,pRecord){if(pError){this.log.error(`Pict: Entity Render: Error getting entity [${tmpEntity}] with ID [${tmpEntityID}] for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}// Now render the template
|
|
7769
|
-
if(tmpEntityTemplate){this.pict.parseTemplateByHash(tmpEntityTemplate,pRecord,tmpCallback,pContextArray,pScope,pState);}else{tmpCallback(null,'');}}.bind(this));}}module.exports=PictTemplateProviderEntity;},{"pict-template":144}],
|
|
7850
|
+
if(tmpEntityTemplate){this.pict.parseTemplateByHash(tmpEntityTemplate,pRecord,tmpCallback,pContextArray,pScope,pState);}else{tmpCallback(null,'');}}.bind(this));}}module.exports=PictTemplateProviderEntity;},{"pict-template":144}],220:[function(require,module,exports){const libPictTemplate=require('pict-template');/**
|
|
7851
|
+
* Function template expression.
|
|
7852
|
+
*
|
|
7853
|
+
* {~Function:Pict.providers.SomeProvider.makeThing:Record.X:Record.Y~}
|
|
7854
|
+
* {~F:Pict.providers.SomeProvider.makeThing:Record.X:Record.Y~}
|
|
7855
|
+
*
|
|
7856
|
+
* First parameter is the address of a function to call (resolved with
|
|
7857
|
+
* `pict.resolveStateFromAddress` against the usual root: Record, AppData,
|
|
7858
|
+
* Pict, Bundle, Context, Scope, TempData, __State). Each subsequent
|
|
7859
|
+
* `:`-separated parameter is itself an address whose resolved value is
|
|
7860
|
+
* passed as an argument to the function. Arity is dynamic.
|
|
7861
|
+
*
|
|
7862
|
+
* Returns whatever the function returns (coerced to '' when null /
|
|
7863
|
+
* undefined). If the address does not resolve to a function, a warning is
|
|
7864
|
+
* logged that names the address and the full template expression, and the
|
|
7865
|
+
* expression renders as ''. If the function throws, the error is logged
|
|
7866
|
+
* and the expression renders as ''.
|
|
7867
|
+
*
|
|
7868
|
+
* `this` is bound to the address's parent object so instance methods work
|
|
7869
|
+
* naturally: `Pict.providers.X.go(...)` invokes with `this === Pict.providers.X`.
|
|
7870
|
+
*/class PictTemplateProviderFunction extends libPictTemplate{/**
|
|
7871
|
+
* @param {Object} pFable - The Fable Framework instance
|
|
7872
|
+
* @param {Object} pOptions - The options for the service
|
|
7873
|
+
* @param {String} pServiceHash - The hash of the service
|
|
7874
|
+
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);/** @type {any} */this.log;this.addPattern('{~Function:','~}');this.addPattern('{~F:','~}');}/**
|
|
7875
|
+
* Render the Function expression: call the resolved function with the
|
|
7876
|
+
* resolved arguments and return its result.
|
|
7877
|
+
*
|
|
7878
|
+
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
7879
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7880
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7881
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7882
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7883
|
+
*
|
|
7884
|
+
* @return {string} The function's return value, stringified by the template engine; '' if the function is missing or throws.
|
|
7885
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fFunctionRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fFunctionRender]::[${tmpHash}]`);}let tmpParts=tmpHash.split(':');let tmpFunctionAddress=tmpParts.length>0?tmpParts[0].trim():'';if(tmpFunctionAddress.length<1){this.log.warn(`Pict: Function Render: No function address provided in template [{~Function:${tmpHash}~}]`);return'';}let tmpFunction=this.resolveStateFromAddress(tmpFunctionAddress,tmpRecord,pContextArray,null,pScope,pState);if(typeof tmpFunction!=='function'){this.log.warn(`Pict: Function Render: Function not found at address [${tmpFunctionAddress}] for template [{~Function:${tmpHash}~}]`);return'';}// Resolve `this` to the function's parent so instance methods bind naturally.
|
|
7886
|
+
let tmpThis=null;let tmpLastDot=tmpFunctionAddress.lastIndexOf('.');if(tmpLastDot>0){let tmpParentAddress=tmpFunctionAddress.substring(0,tmpLastDot);tmpThis=this.resolveStateFromAddress(tmpParentAddress,tmpRecord,pContextArray,null,pScope,pState);}let tmpArguments=[];for(let i=1;i<tmpParts.length;i++){tmpArguments.push(this.resolveStateFromAddress(tmpParts[i],tmpRecord,pContextArray,null,pScope,pState));}try{let tmpResult=tmpFunction.apply(tmpThis,tmpArguments);if(tmpResult==null){return'';}return tmpResult;}catch(pError){this.log.warn(`Pict: Function Render: Error invoking function at [${tmpFunctionAddress}] for template [{~Function:${tmpHash}~}]: ${pError.message}`);return'';}}}module.exports=PictTemplateProviderFunction;module.exports.template_hash='Function';},{"pict-template":144}],221:[function(require,module,exports){const libPictTemplate=require('pict-template');/**
|
|
7770
7887
|
* Icon template tag — emits a themable SVG icon by PascalCase name.
|
|
7771
7888
|
*
|
|
7772
7889
|
* {~Icon:Home~} → default variant for 'Home'
|
|
@@ -7795,7 +7912,46 @@ if(tmpEntityTemplate){this.pict.parseTemplateByHash(tmpEntityTemplate,pRecord,tm
|
|
|
7795
7912
|
*/render(pTemplateHash){let tmpBody=(pTemplateHash||'').trim();if(tmpBody.length<1){return'';}let tmpName=tmpBody;let tmpVariant=null;let tmpColon=tmpBody.indexOf(':');if(tmpColon>-1){tmpName=tmpBody.slice(0,tmpColon).trim();tmpVariant=tmpBody.slice(tmpColon+1).trim();}let tmpProvider=this.pict&&this.pict.providers&&this.pict.providers.Icon;if(!tmpProvider||typeof tmpProvider.get!=='function'){// Provider missing — should never happen in a normally-booted
|
|
7796
7913
|
// Pict app, but degrade silently rather than emit something
|
|
7797
7914
|
// that looks like a template tag.
|
|
7798
|
-
return'';}let tmpOpts=tmpVariant?{variant:tmpVariant}:undefined;return tmpProvider.get(tmpName,tmpOpts);}}module.exports=PictTemplateProviderIcon;},{"pict-template":144}],
|
|
7915
|
+
return'';}let tmpOpts=tmpVariant?{variant:tmpVariant}:undefined;return tmpProvider.get(tmpName,tmpOpts);}}module.exports=PictTemplateProviderIcon;},{"pict-template":144}],222:[function(require,module,exports){const libPictTemplate=require('pict-template');/**
|
|
7916
|
+
* Inline Template expression.
|
|
7917
|
+
*
|
|
7918
|
+
* Captures its raw contents (verbatim, including any other pict template
|
|
7919
|
+
* tags) and processes them as a template at runtime. At render time the
|
|
7920
|
+
* captured string is fed back through `pict.parseTemplate(...)` with the
|
|
7921
|
+
* same Record/Context/Scope/State that was active at the outer scope.
|
|
7922
|
+
*
|
|
7923
|
+
* {<TEMPLATED CONTENT HERE, {~D:AppData.SomeValue~}.>}
|
|
7924
|
+
*
|
|
7925
|
+
* Direct nesting of `{<...>}` inside another `{<...>}` is not supported;
|
|
7926
|
+
* the first `>}` closes the outer block. Wrap the inner literal in a
|
|
7927
|
+
* registered template hash and reference it with `{~T:Hash~}` for that.
|
|
7928
|
+
*/class PictTemplateProviderInlineTemplate extends libPictTemplate{/**
|
|
7929
|
+
* @param {Object} pFable - The Fable Framework instance
|
|
7930
|
+
* @param {Object} pOptions - The options for the service
|
|
7931
|
+
* @param {String} pServiceHash - The hash of the service
|
|
7932
|
+
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);/** @type {any} */this.log;this.addPattern('{<','>}');}/**
|
|
7933
|
+
* Render an inline template expression, returning a string with the
|
|
7934
|
+
* processed template content.
|
|
7935
|
+
*
|
|
7936
|
+
* @param {string} pTemplateBody - The raw inline template body (what was between `{<` and `>}`)
|
|
7937
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7938
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7939
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7940
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7941
|
+
*
|
|
7942
|
+
* @return {string} The rendered template
|
|
7943
|
+
*/render(pTemplateBody,pRecord,pContextArray,pScope,pState){let tmpBody=typeof pTemplateBody==='string'?pTemplateBody:'';if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fInlineTemplateRender]::[${tmpBody}] with tmpData:`,pRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fInlineTemplateRender]::[${tmpBody}]`);}if(tmpBody.length<1){return'';}return this.pict.parseTemplate(tmpBody,pRecord,null,pContextArray,pScope,pState);}/**
|
|
7944
|
+
* Render an inline template expression, delivering the result to a callback.
|
|
7945
|
+
*
|
|
7946
|
+
* @param {string} pTemplateBody - The raw inline template body (what was between `{<` and `>}`)
|
|
7947
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7948
|
+
* @param {(error?: Error, content?: String) => void} fCallback - callback function invoked with the rendered template, or an error
|
|
7949
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7950
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7951
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7952
|
+
*
|
|
7953
|
+
* @return {void}
|
|
7954
|
+
*/renderAsync(pTemplateBody,pRecord,fCallback,pContextArray,pScope,pState){let tmpBody=typeof pTemplateBody==='string'?pTemplateBody:'';let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fInlineTemplateRenderAsync]::[${tmpBody}] with tmpData:`,pRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fInlineTemplateRenderAsync]::[${tmpBody}]`);}if(tmpBody.length<1){return tmpCallback(null,'');}this.pict.parseTemplate(tmpBody,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderInlineTemplate;module.exports.template_hash='InlineTemplate';},{"pict-template":144}],223:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderSelf extends libPictTemplate{/**
|
|
7799
7955
|
* @param {Object} pFable - The Fable Framework instance
|
|
7800
7956
|
* @param {Object} pOptions - The options for the service
|
|
7801
7957
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7809,7 +7965,7 @@ return'';}let tmpOpts=tmpVariant?{variant:tmpVariant}:undefined;return tmpProvid
|
|
|
7809
7965
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7810
7966
|
*
|
|
7811
7967
|
* @return {string} The rendered template
|
|
7812
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){return this.pict.browserAddress;}}module.exports=PictTemplateProviderSelf;},{"pict-template":144}],
|
|
7968
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){return this.pict.browserAddress;}}module.exports=PictTemplateProviderSelf;},{"pict-template":144}],224:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderSolve extends libPictTemplate{/**
|
|
7813
7969
|
* @param {Object} pFable - The Fable Framework instance
|
|
7814
7970
|
* @param {Object} pOptions - The options for the service
|
|
7815
7971
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7824,7 +7980,7 @@ return'';}let tmpOpts=tmpVariant?{variant:tmpVariant}:undefined;return tmpProvid
|
|
|
7824
7980
|
*
|
|
7825
7981
|
* @return {string} The rendered template
|
|
7826
7982
|
*/render(pSolveParams,pRecord,pContextArray,pScope,pState){// {~S:ROUND(250*0.4129+Width,3):AppData.HomeworkRectangleSize:AppData.HomeworkManifest~}
|
|
7827
|
-
const
|
|
7983
|
+
const _pSolveParams$trim$sp=pSolveParams.trim().split(':',3),_pSolveParams$trim$sp2=_slicedToArray(_pSolveParams$trim$sp,3),tmpEquation=_pSolveParams$trim$sp2[0],tmpRecordAddress=_pSolveParams$trim$sp2[1],tmpManifestAddress=_pSolveParams$trim$sp2[2];const tmpContextualRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Solve [fTemplateRender]::[${pSolveParams}] with tmpData:`,tmpContextualRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Solve [fTemplateRender]::[${pSolveParams}]`);}if(!tmpEquation){if(this.pict.LogNoisiness>2){this.log.warn(`Pict: Solve: Equation not found for [${tmpEquation}]`);}return'';}const tmpRecord=tmpRecordAddress&&this.pict.resolveStateFromAddress(tmpRecordAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||tmpContextualRecord;const tmpManifest=tmpManifestAddress&&this.pict.resolveStateFromAddress(tmpManifestAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||this.pict.manifest;const expressionParser=this.fable.instantiateServiceProviderIfNotExists('ExpressionParser');const tmpResultObject={};return expressionParser.solve(tmpEquation,tmpRecord,tmpResultObject,tmpManifest,tmpRecord);}}module.exports=PictTemplateProviderSolve;},{"pict-template":144}],225:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderSolveByReference extends libPictTemplate{/**
|
|
7828
7984
|
* @param {Object} pFable - The Fable Framework instance
|
|
7829
7985
|
* @param {Object} pOptions - The options for the service
|
|
7830
7986
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7839,7 +7995,7 @@ const[tmpEquation,tmpRecordAddress,tmpManifestAddress]=pSolveParams.trim().split
|
|
|
7839
7995
|
*
|
|
7840
7996
|
* @return {string} The rendered template
|
|
7841
7997
|
*/render(pSolveParams,pRecord,pContextArray,pScope,pState){// {~SBR:AppData.Equation:AppData.HomeworkRectangleSize:AppData.HomeworkManifest~}
|
|
7842
|
-
const
|
|
7998
|
+
const _pSolveParams$trim$sp3=pSolveParams.trim().split(':',3),_pSolveParams$trim$sp4=_slicedToArray(_pSolveParams$trim$sp3,3),tmpEquationAddress=_pSolveParams$trim$sp4[0],tmpRecordAddress=_pSolveParams$trim$sp4[1],tmpManifestAddress=_pSolveParams$trim$sp4[2];const tmpContextualRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT SolveByReference [fTemplateRender]::[${pSolveParams}] with tmpData:`,tmpContextualRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT SolveByReference [fTemplateRender]::[${pSolveParams}]`);}const tmpEquation=this.pict.resolveStateFromAddress(tmpEquationAddress,tmpContextualRecord,pContextArray,null,pScope,pState);if(!tmpEquation){if(this.pict.LogNoisiness>2){this.log.warn(`Pict: SolveByReference: Equation not found for [${tmpEquationAddress}]`);}return'';}const tmpRecord=tmpRecordAddress&&this.pict.resolveStateFromAddress(tmpRecordAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||tmpContextualRecord;const tmpManifest=tmpManifestAddress&&this.pict.resolveStateFromAddress(tmpManifestAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||this.pict.manifest;const expressionParser=this.fable.instantiateServiceProviderIfNotExists('ExpressionParser');const tmpResultObject={};return expressionParser.solve(tmpEquation,tmpRecord,tmpResultObject,tmpManifest,tmpRecord);}}module.exports=PictTemplateProviderSolveByReference;},{"pict-template":144}],226:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplate extends libPictTemplate{/**
|
|
7843
7999
|
* @param {Object} pFable - The Fable Framework instance
|
|
7844
8000
|
* @param {Object} pOptions - The options for the service
|
|
7845
8001
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7871,7 +8027,7 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray,
|
|
|
7871
8027
|
let tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
7872
8028
|
if(!tmpTemplateHash){this.log.warn(`Pict: Template Render Async: TemplateHash not resolved for [${tmpHash}]`);return fCallback(null,'');}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
7873
8029
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
7874
|
-
this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplate;},{"pict-template":144}],
|
|
8030
|
+
this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplate;},{"pict-template":144}],227:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateByDataAddress extends libPictTemplate{/**
|
|
7875
8031
|
* @param {Object} pFable - The Fable Framework instance
|
|
7876
8032
|
* @param {Object} pOptions - The options for the service
|
|
7877
8033
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7903,7 +8059,7 @@ return this.pict.parseTemplate(tmpTemplate,pRecord,null,pContextArray,pScope,pSt
|
|
|
7903
8059
|
let tmpHashTemplateSeparator=tmpDataAddress.indexOf(':');tmpTemplateDataAddress=tmpDataAddress.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpDataAddress.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateDataAddress=tmpDataAddress;}// No template hash
|
|
7904
8060
|
if(!tmpTemplateDataAddress){this.log.warn(`Pict: Template Render Async: TemplateHash not resolved for [${tmpDataAddress}]`);return tmpCallback(null,'');}let tmpTemplate=this.pict.resolveStateFromAddress(tmpTemplateDataAddress,pRecord,pContextArray,null,pScope,pState)||'';if(!tmpTemplate){if(this.pict.LogNoisiness>2){this.log.warn(`Pict: Template Render: Template not found for [${tmpTemplateDataAddress}]`);}tmpTemplate='';}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
7905
8061
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
7906
|
-
this.pict.parseTemplate(tmpTemplate,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplate(tmpTemplate,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateByDataAddress;},{"pict-template":144}],
|
|
8062
|
+
this.pict.parseTemplate(tmpTemplate,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplate(tmpTemplate,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateByDataAddress;},{"pict-template":144}],228:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplate extends libPictTemplate{/**
|
|
7907
8063
|
* @param {Object} pFable - The Fable Framework instance
|
|
7908
8064
|
* @param {Object} pOptions - The options for the service
|
|
7909
8065
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7939,7 +8095,7 @@ if(!tmpTemplateHashReferenceLocation){this.log.warn(`Pict: Template Render Async
|
|
|
7939
8095
|
let tmpTemplateHash=this.resolveStateFromAddress(tmpTemplateHashReferenceLocation,pRecord,pContextArray,null,pScope,pState);// No template hash
|
|
7940
8096
|
if(!tmpTemplateHash){this.log.warn(`Pict: Template Render Async: TemplateHash not resolved for [${tmpHash}]`);return fCallback(null,'');}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
7941
8097
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
7942
|
-
this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplate;},{"pict-template":144}],
|
|
8098
|
+
this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplate;},{"pict-template":144}],229:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateByTypes extends libPictTemplate{/**
|
|
7943
8099
|
* @param {Object} pFable - The Fable Framework instance
|
|
7944
8100
|
* @param {Object} pOptions - The options for the service
|
|
7945
8101
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7972,7 +8128,7 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,tmpRecord,null,pContextArra
|
|
|
7972
8128
|
let tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){return fCallback(null,'');}tmpAddressToTest=tmpTemplateHashes[0];tmpDataTypesToTest=tmpTemplateHashes[1].split(',');tmpTemplateHash=tmpTemplateHashes[2];if(tmpTemplateHashes.length>3){tmpAddressOfData=tmpTemplateHashes[3];}if(tmpTemplateHashes.length>4){tmpFallbackTemplate=tmpTemplateHashes[4];}// No template hash
|
|
7973
8129
|
if(!tmpTemplateHash){return fCallback(null,'');}let tmpRecord=pRecord;if(tmpAddressOfData){tmpRecord=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState);}const tmpValueAtAddress=this.resolveStateFromAddress(tmpAddressToTest,tmpData,pContextArray,null,pScope,pState);/** @type {string} */let tmpTypeOfDataAtAddress=typeof tmpValueAtAddress;if(tmpTypeOfDataAtAddress=='object'&&Array.isArray(tmpValueAtAddress)){tmpTypeOfDataAtAddress='array';}if(tmpDataTypesToTest.indexOf(tmpTypeOfDataAtAddress)===-1){// Type not found, use the fallback template if we have one.
|
|
7974
8130
|
if(tmpFallbackTemplate){tmpTemplateHash=tmpFallbackTemplate;}else{return fCallback(null,'');}}// No address was provided, just render the template with what this template has.
|
|
7975
|
-
this.pict.parseTemplateByHash(tmpTemplateHash,tmpRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderTemplateByTypes;},{"pict-template":144}],
|
|
8131
|
+
this.pict.parseTemplateByHash(tmpTemplateHash,tmpRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderTemplateByTypes;},{"pict-template":144}],230:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateFromAddress extends libPictTemplate{/**
|
|
7976
8132
|
* @param {Object} pFable - The Fable Framework instance
|
|
7977
8133
|
* @param {Object} pOptions - The options for the service
|
|
7978
8134
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8008,7 +8164,7 @@ if(!tmpTemplateContentAddress){this.log.warn(`Pict: Template Render Async: Templ
|
|
|
8008
8164
|
let tmpTemplateContent=this.resolveStateFromAddress(tmpTemplateContentAddress,pRecord,pContextArray,null,pScope,pState);// No template hash
|
|
8009
8165
|
if(!tmpTemplateContent){this.log.warn(`Pict: Template Render Async: TemplateHash not resolved for [${tmpHash}]`);return fCallback(null,'');}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
8010
8166
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
8011
|
-
this.pict.parseTemplate(tmpTemplateContent,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplate(tmpTemplateContent,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateFromAddress;},{"pict-template":144}],
|
|
8167
|
+
this.pict.parseTemplate(tmpTemplateContent,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplate(tmpTemplateContent,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateFromAddress;},{"pict-template":144}],231:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateFromMap extends libPictTemplate{/**
|
|
8012
8168
|
* @param {Object} pFable - The Fable Framework instance
|
|
8013
8169
|
* @param {Object} pOptions - The options for the service
|
|
8014
8170
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8042,7 +8198,7 @@ let tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this
|
|
|
8042
8198
|
if(!tmpTemplateFromMapHash){this.log.warn(`Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [${tmpHash}]`);return fCallback(null,'');}// Now resolve the data
|
|
8043
8199
|
let tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray,null,pScope,pState);let tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray,null,pScope,pState);if(!tmpMap){this.log.warn(`Pict: TemplateFromMap Render: Map not resolved for [${tmpHash}]`);return fCallback(null,'');}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
8044
8200
|
// The async portion of this is a mind bender because of how entry can happen dynamically from TemplateFromMaps
|
|
8045
|
-
this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateFromMap;},{"pict-template":144}],
|
|
8201
|
+
this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateFromMap;},{"pict-template":144}],232:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateSet extends libPictTemplate{/**
|
|
8046
8202
|
* @param {Object} pFable - The Fable Framework instance
|
|
8047
8203
|
* @param {Object} pOptions - The options for the service
|
|
8048
8204
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8075,7 +8231,7 @@ let tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this
|
|
|
8075
8231
|
if(!tmpTemplateFromMapHash){this.log.warn(`Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [${tmpHash}]`);return fCallback(null,'');}// Now resolve the data
|
|
8076
8232
|
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState);if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
8077
8233
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
8078
|
-
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateSet;},{"pict-template":144}],
|
|
8234
|
+
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateSet;},{"pict-template":144}],233:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateSetFromMap extends libPictTemplate{/**
|
|
8079
8235
|
* @param {Object} pFable - The Fable Framework instance
|
|
8080
8236
|
* @param {Object} pOptions - The options for the service
|
|
8081
8237
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8109,7 +8265,7 @@ let tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this
|
|
|
8109
8265
|
if(!tmpTemplateFromMapHash){this.log.warn(`Pict: TemplateFromMapSet Render Async: TemplateFromMapHash not resolved for [${tmpHash}]`);return fCallback(null,'');}// Now resolve the data
|
|
8110
8266
|
let tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray,null,pScope,pState);let tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray,null,pScope,pState);if(!tmpMap){this.log.warn(`Pict: TemplateFromMapSet Render: Map not resolved for [${tmpHash}]`);return fCallback(null,'');}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
8111
8267
|
// The async portion of this is a mind bender because of how entry can happen dynamically from TemplateFromMaps
|
|
8112
|
-
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateSetFromMap;},{"pict-template":144}],
|
|
8268
|
+
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateSetFromMap;},{"pict-template":144}],234:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateSetWithPayload extends libPictTemplate{/**
|
|
8113
8269
|
* @param {Object} pFable - The Fable Framework instance
|
|
8114
8270
|
* @param {Object} pOptions - The options for the service
|
|
8115
8271
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8136,7 +8292,7 @@ let tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){t
|
|
|
8136
8292
|
*
|
|
8137
8293
|
* @return {void}
|
|
8138
8294
|
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fTemplateSetWithPayloadRenderAsync]::[${tmpHash}]`);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fTemplateSetWithPayloadRenderAsync]::[${tmpHash}]`);}let tmpTemplateHash;let tmpAddressOfData;let tmpAddressOfPayload;// This is just a simple 3 part hash (template, address of set, address of payload)
|
|
8139
|
-
let tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){this.log.trace(`PICT Template [fTemplateSetWithPayloadRender]::[${tmpHash}] failed because there were not three stanzas in the expression [${pTemplateHash}]`);return fCallback(null,'');}tmpTemplateHash=tmpTemplateHashes[0];tmpAddressOfData=tmpTemplateHashes[1];tmpAddressOfPayload=tmpTemplateHashes[2];let tmpData=this.resolveStateFromAddress(tmpAddressOfData,pRecord,pContextArray,null,pScope,pState);if(!tmpData){tmpData=pRecord;}if(!tmpData){tmpData={};}let tmpPayloadData=this.resolveStateFromAddress(tmpAddressOfPayload,pRecord,pContextArray,null,pScope,pState);if(!tmpPayloadData){tmpPayloadData=pRecord;}if(!tmpPayloadData){tmpPayloadData={};}this.pict.parseTemplateSetWithPayloadByHash(tmpTemplateHash,tmpData,tmpPayloadData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderTemplateSetWithPayload;},{"pict-template":144}],
|
|
8295
|
+
let tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){this.log.trace(`PICT Template [fTemplateSetWithPayloadRender]::[${tmpHash}] failed because there were not three stanzas in the expression [${pTemplateHash}]`);return fCallback(null,'');}tmpTemplateHash=tmpTemplateHashes[0];tmpAddressOfData=tmpTemplateHashes[1];tmpAddressOfPayload=tmpTemplateHashes[2];let tmpData=this.resolveStateFromAddress(tmpAddressOfData,pRecord,pContextArray,null,pScope,pState);if(!tmpData){tmpData=pRecord;}if(!tmpData){tmpData={};}let tmpPayloadData=this.resolveStateFromAddress(tmpAddressOfPayload,pRecord,pContextArray,null,pScope,pState);if(!tmpPayloadData){tmpPayloadData=pRecord;}if(!tmpPayloadData){tmpPayloadData={};}this.pict.parseTemplateSetWithPayloadByHash(tmpTemplateHash,tmpData,tmpPayloadData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderTemplateSetWithPayload;},{"pict-template":144}],235:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateValueSet extends libPictTemplate{/**
|
|
8140
8296
|
* @param {Object} pFable - The Fable Framework instance
|
|
8141
8297
|
* @param {Object} pOptions - The options for the service
|
|
8142
8298
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8169,7 +8325,7 @@ let tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this
|
|
|
8169
8325
|
if(!tmpTemplateFromMapHash){this.log.warn(`Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [${tmpHash}]`);return fCallback(null,'');}// Now resolve the data
|
|
8170
8326
|
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState);let tmpDataValueSet=[];if(Array.isArray(tmpData)){for(let i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(typeof tmpData==='object'){let tmpValueKeys=Object.keys(tmpData);for(let i=0;i<tmpValueKeys.length;i++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[i]],Key:tmpData[tmpValueKeys[i]]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
8171
8327
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
8172
|
-
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateValueSet;},{"pict-template":144}],
|
|
8328
|
+
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateValueSet;},{"pict-template":144}],236:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderView extends libPictTemplate{/**
|
|
8173
8329
|
* @param {Object} pFable - The Fable Framework instance
|
|
8174
8330
|
* @param {Object} pOptions - The options for the service
|
|
8175
8331
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8196,7 +8352,7 @@ return tmpResult;}/**
|
|
|
8196
8352
|
* @return {void}
|
|
8197
8353
|
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){const tmpViewHash=pTemplateHash.trim();if(!(tmpViewHash in this.pict.views)){this.log.warn(`Pict: View Template Render: View not found for [${tmpViewHash}]`);return fCallback(null,'');}let tmpRenderGUID=this.pict.getUUID();const tmpView=this.pict.views[tmpViewHash];return tmpView.renderAsync('__Virtual',`__TemplateOutputCache.${tmpRenderGUID}`,pRecord,pState?pState.RootRenderable:undefined,(pError,pResult)=>{if(pError){this.log.warn(`Pict: View Template Render: Error rendering view [${tmpViewHash}]`,pError);return fCallback(pError,'');}let tmpResult=this.pict.__TemplateOutputCache[tmpRenderGUID];// TODO: Uncomment this when we like how it's working
|
|
8198
8354
|
//delete this.pict.__TemplateOutputCache[tmpRenderGUID];
|
|
8199
|
-
return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},{"pict-template":144}],
|
|
8355
|
+
return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},{"pict-template":144}],237:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderRandomNumber extends libPictTemplate{/**
|
|
8200
8356
|
* @param {Object} pFable - The Fable Framework instance
|
|
8201
8357
|
* @param {Object} pOptions - The options for the service
|
|
8202
8358
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8210,7 +8366,7 @@ return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},
|
|
|
8210
8366
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8211
8367
|
*
|
|
8212
8368
|
* @return {string} The rendered template
|
|
8213
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fRandomNumber]::[${tmpHash}]`);}let tmpMinimumNumber=0;let tmpMaxNumber=9999999;if(tmpHash.length>0){let tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpMinimumNumber=parseInt(tmpHashParts[0]);}catch{tmpMinimumNumber=0;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch{tmpMaxNumber=9999999;}}}return this.fable.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);}}module.exports=PictTemplateProviderRandomNumber;},{"pict-template":144}],
|
|
8369
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fRandomNumber]::[${tmpHash}]`);}let tmpMinimumNumber=0;let tmpMaxNumber=9999999;if(tmpHash.length>0){let tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpMinimumNumber=parseInt(tmpHashParts[0]);}catch{tmpMinimumNumber=0;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch{tmpMaxNumber=9999999;}}}return this.fable.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);}}module.exports=PictTemplateProviderRandomNumber;},{"pict-template":144}],238:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderRandomNumberString extends libPictTemplate{/**
|
|
8214
8370
|
* @param {Object} pFable - The Fable Framework instance
|
|
8215
8371
|
* @param {Object} pOptions - The options for the service
|
|
8216
8372
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8224,7 +8380,7 @@ return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},
|
|
|
8224
8380
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8225
8381
|
*
|
|
8226
8382
|
* @return {string} The rendered template
|
|
8227
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fRandomNumberString]::[${tmpHash}]`);}let tmpStringLength=4;let tmpMaxNumber=9999;if(tmpHash.length>0){let tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpStringLength=parseInt(tmpHashParts[0]);}catch{tmpStringLength=4;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch{tmpMaxNumber=9999;}}}return this.fable.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);}}module.exports=PictTemplateProviderRandomNumberString;},{"pict-template":144}],
|
|
8383
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fRandomNumberString]::[${tmpHash}]`);}let tmpStringLength=4;let tmpMaxNumber=9999;if(tmpHash.length>0){let tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpStringLength=parseInt(tmpHashParts[0]);}catch{tmpStringLength=4;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch{tmpMaxNumber=9999;}}}return this.fable.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);}}module.exports=PictTemplateProviderRandomNumberString;},{"pict-template":144}],239:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDataEncodeJavascriptString extends libPictTemplate{/**
|
|
8228
8384
|
* @param {Object} pFable - The Fable Framework instance
|
|
8229
8385
|
* @param {Object} pOptions - The options for the service
|
|
8230
8386
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8238,7 +8394,7 @@ return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},
|
|
|
8238
8394
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8239
8395
|
*
|
|
8240
8396
|
* @return {string} The rendered template
|
|
8241
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}]`);}let tmpDataToEncode=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.pict.DataFormat.stringEncodeForJavascript(tmpDataToEncode);}}module.exports=PictTemplateProviderDataEncodeJavascriptString;},{"pict-template":144}],
|
|
8397
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}]`);}let tmpDataToEncode=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.pict.DataFormat.stringEncodeForJavascript(tmpDataToEncode);}}module.exports=PictTemplateProviderDataEncodeJavascriptString;},{"pict-template":144}],240:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderJSONOutput extends libPictTemplate{/**
|
|
8242
8398
|
* @param {Object} pFable - The Fable Framework instance
|
|
8243
8399
|
* @param {Object} pOptions - The options for the service
|
|
8244
8400
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8252,7 +8408,7 @@ return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},
|
|
|
8252
8408
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8253
8409
|
*
|
|
8254
8410
|
* @return {string} The rendered template
|
|
8255
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}]`);}let tmpDataToStringify=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);if(!tmpDataToStringify){tmpDataToStringify=pRecord;}return JSON.stringify(tmpDataToStringify);}}module.exports=PictTemplateProviderJSONOutput;},{"pict-template":144}],
|
|
8411
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}]`);}let tmpDataToStringify=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);if(!tmpDataToStringify){tmpDataToStringify=pRecord;}return JSON.stringify(tmpDataToStringify);}}module.exports=PictTemplateProviderJSONOutput;},{"pict-template":144}],241:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDateOnlyFormat extends libPictTemplate{/**
|
|
8256
8412
|
* @param {import('fable')} pFable - The Fable Framework instance
|
|
8257
8413
|
* @param {any} pOptions - The options for the service
|
|
8258
8414
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8273,7 +8429,7 @@ let tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);return tmpDayJS.format(tmp
|
|
|
8273
8429
|
```javascript
|
|
8274
8430
|
|
|
8275
8431
|
```
|
|
8276
|
-
*/},{"pict-template":144}],
|
|
8432
|
+
*/},{"pict-template":144}],242:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDateOnlyYMD extends libPictTemplate{/**
|
|
8277
8433
|
* @param {Object} pFable - The Fable Framework instance
|
|
8278
8434
|
* @param {Object} pOptions - The options for the service
|
|
8279
8435
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8291,7 +8447,7 @@ let tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);return tmpDayJS.format(tmp
|
|
|
8291
8447
|
let tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);//FIXME: this is kind of wacked out; -62167219200000 is the unix ms timestamp for 0000-01-01 00:00:00 UTC
|
|
8292
8448
|
// not even sure showing negative is right; showing the era is probably better (BCE vs CE)
|
|
8293
8449
|
//const prefix = tmpDayJS.valueOf() < -62167219200000 ? '-' : '';
|
|
8294
|
-
const tmpPrefix='';return tmpPrefix+tmpDayJS.format('YYYY-MM-DD');}}module.exports=PictTemplateProviderDateOnlyYMD;},{"pict-template":144}],
|
|
8450
|
+
const tmpPrefix='';return tmpPrefix+tmpDayJS.format('YYYY-MM-DD');}}module.exports=PictTemplateProviderDateOnlyYMD;},{"pict-template":144}],243:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDateTimeFormat extends libPictTemplate{/**
|
|
8295
8451
|
* @param {Object} pFable - The Fable Framework instance
|
|
8296
8452
|
* @param {Object} pOptions - The options for the service
|
|
8297
8453
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8316,7 +8472,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8316
8472
|
```javascript
|
|
8317
8473
|
|
|
8318
8474
|
```
|
|
8319
|
-
*/},{"pict-template":144}],
|
|
8475
|
+
*/},{"pict-template":144}],244:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDateTimeYMD extends libPictTemplate{/**
|
|
8320
8476
|
* @param {Object} pFable - The Fable Framework instance
|
|
8321
8477
|
* @param {Object} pOptions - The options for the service
|
|
8322
8478
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8335,7 +8491,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8335
8491
|
let tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);try{// Try to cast the day to be a specific timezone if one is set for the app
|
|
8336
8492
|
if(this.pict.options.Timezone){tmpDayJS=tmpDayJS.tz(this.pict.options.Timezone);}else{try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error(`Error guessing dayJS guess() function; dates may be formatted to GMT by default. (${pError.message||pError})`);}}}catch{//this.log.error(`Error casting timezone using tz .. casting to the browser guess which is [${this.fable.Dates.dayJS.tz.guess()}].`);
|
|
8337
8493
|
// Day.js will try to guess the user's timezone for us
|
|
8338
|
-
try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error(`Error guessing dayJS guess() function; dates may be formatted to GMT by default. (${pError.message||pError})`);}}return tmpDayJS.format('YYYY-MM-DD');}}module.exports=PictTemplateProviderDateTimeYMD;},{"pict-template":144}],
|
|
8494
|
+
try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error(`Error guessing dayJS guess() function; dates may be formatted to GMT by default. (${pError.message||pError})`);}}return tmpDayJS.format('YYYY-MM-DD');}}module.exports=PictTemplateProviderDateTimeYMD;},{"pict-template":144}],245:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDigits extends libPictTemplate{/**
|
|
8339
8495
|
* @param {Object} pFable - The Fable Framework instance
|
|
8340
8496
|
* @param {Object} pOptions - The options for the service
|
|
8341
8497
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8349,7 +8505,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8349
8505
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8350
8506
|
*
|
|
8351
8507
|
* @return {string} The rendered template
|
|
8352
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDigits]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDigits]::[${tmpHash}]`);}let tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.fable.DataFormat.formatterAddCommasToNumber(this.fable.DataFormat.formatterRoundNumber(tmpColumnData,2));}}module.exports=PictTemplateProviderDigits;},{"pict-template":144}],
|
|
8508
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDigits]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDigits]::[${tmpHash}]`);}let tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.fable.DataFormat.formatterAddCommasToNumber(this.fable.DataFormat.formatterRoundNumber(tmpColumnData,2));}}module.exports=PictTemplateProviderDigits;},{"pict-template":144}],246:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDollars extends libPictTemplate{/**
|
|
8353
8509
|
* @param {Object} pFable - The Fable Framework instance
|
|
8354
8510
|
* @param {Object} pOptions - The options for the service
|
|
8355
8511
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8363,7 +8519,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8363
8519
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8364
8520
|
*
|
|
8365
8521
|
* @return {string} The rendered template
|
|
8366
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDollars]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDollars]::[${tmpHash}]`);}let tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.fable.DataFormat.formatterDollars(tmpColumnData);}}module.exports=PictTemplateProviderDollars;},{"pict-template":144}],
|
|
8522
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDollars]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDollars]::[${tmpHash}]`);}let tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.fable.DataFormat.formatterDollars(tmpColumnData);}}module.exports=PictTemplateProviderDollars;},{"pict-template":144}],247:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderHTMLCommandEnd extends libPictTemplate{/**
|
|
8367
8523
|
* @param {Object} pFable - The Fable Framework instance
|
|
8368
8524
|
* @param {Object} pOptions - The options for the service
|
|
8369
8525
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8377,7 +8533,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8377
8533
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8378
8534
|
*
|
|
8379
8535
|
* @return {string} The rendered template
|
|
8380
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpValue=false;const
|
|
8536
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpValue=false;const _tmpHash$split=tmpHash.split(':'),_tmpHash$split2=_slicedToArray(_tmpHash$split,2),tmpValueAddress=_tmpHash$split2[0],tmpPolarityStr=_tmpHash$split2[1];if(tmpValueAddress!=null){tmpValue=this.resolveStateFromAddress(tmpValueAddress,tmpRecord,pContextArray,null,pScope,pState);}const tmpPolarity=tmpPolarityStr!=null?tmpPolarityStr==='1'||tmpPolarityStr.toLowerCase()==='true'||tmpPolarityStr.toLowerCase()==='t':false;if(Boolean(tmpValue)==tmpPolarity){return' -->';}return'';}}module.exports=PictTemplateProviderHTMLCommandEnd;},{"pict-template":144}],248:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderHTMLCommandStart extends libPictTemplate{/**
|
|
8381
8537
|
* @param {Object} pFable - The Fable Framework instance
|
|
8382
8538
|
* @param {Object} pOptions - The options for the service
|
|
8383
8539
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8391,7 +8547,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8391
8547
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8392
8548
|
*
|
|
8393
8549
|
* @return {string} The rendered template
|
|
8394
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpValue=false;const
|
|
8550
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpValue=false;const _tmpHash$split3=tmpHash.split(':'),_tmpHash$split4=_slicedToArray(_tmpHash$split3,2),tmpValueAddress=_tmpHash$split4[0],tmpPolarityStr=_tmpHash$split4[1];if(tmpValueAddress!=null){tmpValue=this.resolveStateFromAddress(tmpValueAddress,tmpRecord,pContextArray,null,pScope,pState);}const tmpPolarity=tmpPolarityStr!=null?tmpPolarityStr==='1'||tmpPolarityStr.toLowerCase()==='true'||tmpPolarityStr.toLowerCase()==='t':false;if(Boolean(tmpValue)==tmpPolarity){return'<!-- ';}return'';}}module.exports=PictTemplateProviderHTMLCommandStart;},{"pict-template":144}],249:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderJoin extends libPictTemplate{/**
|
|
8395
8551
|
* @param {Object} pFable - The Fable Framework instance
|
|
8396
8552
|
* @param {Object} pOptions - The options for the service
|
|
8397
8553
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8406,7 +8562,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8406
8562
|
*
|
|
8407
8563
|
* @return {string} The rendered template
|
|
8408
8564
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash;let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Join [fDataRender]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Join [fDataRender]::[${tmpHash}]`);}let tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
8409
|
-
let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(let j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}module.exports=PictTemplateProviderJoin;},{"pict-template":144}],
|
|
8565
|
+
let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(let j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}module.exports=PictTemplateProviderJoin;},{"pict-template":144}],250:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderJoinUnique extends libPictTemplate{/**
|
|
8410
8566
|
* @param {Object} pFable - The Fable Framework instance
|
|
8411
8567
|
* @param {Object} pOptions - The options for the service
|
|
8412
8568
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8421,7 +8577,7 @@ let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];for(let i=0;i<tmpD
|
|
|
8421
8577
|
*
|
|
8422
8578
|
* @return {string} The rendered template
|
|
8423
8579
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash;let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Join Unique [fDataRender]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Join Unique [fDataRender]::[${tmpHash}]`);}let tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
8424
|
-
let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={};for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(let j=0;j<tmpValueSet.length;j++){if(!(tmpValueSet[j]in tmpValueMap)){tmpValueMap[tmpValueSet[j]]=true;tmpValueList.push(tmpValueSet[j]);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}module.exports=PictTemplateProviderJoinUnique;},{"pict-template":144}],
|
|
8580
|
+
let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={};for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(let j=0;j<tmpValueSet.length;j++){if(!(tmpValueSet[j]in tmpValueMap)){tmpValueMap[tmpValueSet[j]]=true;tmpValueList.push(tmpValueSet[j]);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}module.exports=PictTemplateProviderJoinUnique;},{"pict-template":144}],251:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderPascalCaseIdentifier extends libPictTemplate{/**
|
|
8425
8581
|
* @param {Object} pFable - The Fable Framework instance
|
|
8426
8582
|
* @param {Object} pOptions - The options for the service
|
|
8427
8583
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8441,7 +8597,7 @@ let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={}
|
|
|
8441
8597
|
```javascript
|
|
8442
8598
|
|
|
8443
8599
|
```
|
|
8444
|
-
*/},{"pict-template":144}],
|
|
8600
|
+
*/},{"pict-template":144}],252:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderPluckJoinUnique extends libPictTemplate{/**
|
|
8445
8601
|
* @param {Object} pFable - The Fable Framework instance
|
|
8446
8602
|
* @param {Object} pOptions - The options for the service
|
|
8447
8603
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8457,7 +8613,7 @@ let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={}
|
|
|
8457
8613
|
* @return {string} The rendered template
|
|
8458
8614
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash;let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Pluck Join Unique [fDataRender]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Pluck Join Unique [fDataRender]::[${tmpHash}]`);}let tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<3){return'';}// Get the separator string
|
|
8459
8615
|
let tmpSeparator=tmpDataAddresses.shift();let tmpAddress=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={};for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){// This one only works on arrays of objects.
|
|
8460
|
-
for(let j=0;j<tmpValueSet.length;j++){if(tmpValueSet[j]===null||typeof tmpValueSet!=='object'){continue;}let tmpValue=this.pict.manifest.getValueByHash(tmpValueSet[j],tmpAddress);if(!(tmpValue in tmpValueMap)){tmpValueMap[tmpValue]=true;tmpValueList.push(tmpValue);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}module.exports=PictTemplateProviderPluckJoinUnique;},{"pict-template":144}],
|
|
8616
|
+
for(let j=0;j<tmpValueSet.length;j++){if(tmpValueSet[j]===null||typeof tmpValueSet!=='object'){continue;}let tmpValue=this.pict.manifest.getValueByHash(tmpValueSet[j],tmpAddress);if(!(tmpValue in tmpValueMap)){tmpValueMap[tmpValue]=true;tmpValueList.push(tmpValue);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}module.exports=PictTemplateProviderPluckJoinUnique;},{"pict-template":144}],253:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderBreakpoint extends libPictTemplate{/**
|
|
8461
8617
|
* @param {Object} pFable - The Fable Framework instance
|
|
8462
8618
|
* @param {Object} pOptions - The options for the service
|
|
8463
8619
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8473,7 +8629,7 @@ for(let j=0;j<tmpValueSet.length;j++){if(tmpValueSet[j]===null||typeof tmpValueS
|
|
|
8473
8629
|
* @return {string} The rendered template
|
|
8474
8630
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpError=new Error(`PICT Template Breakpoint: ${tmpHash}`);this.log.trace(`PICT Template Breakpoint: ${tmpHash}`,tmpError.stack);//throw tmpError;
|
|
8475
8631
|
debugger;// eslint-disable-line no-debugger
|
|
8476
|
-
return'';}}module.exports=PictTemplateProviderBreakpoint;},{"pict-template":144}],
|
|
8632
|
+
return'';}}module.exports=PictTemplateProviderBreakpoint;},{"pict-template":144}],254:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDataValueTree extends libPictTemplate{/**
|
|
8477
8633
|
* @param {Object} pFable - The Fable Framework instance
|
|
8478
8634
|
* @param {Object} pOptions - The options for the service
|
|
8479
8635
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8503,7 +8659,7 @@ tmpPictObjectWrapTemplate=`<div class="PICT PICTObjectSet">{~D:Record.ObjectValu
|
|
|
8503
8659
|
*/dataValueTreeObjectSet(pObject,pRootObject,pCurrentDepth,pMaxDepth,pContextArray,pScope,pState){let tmpTemplateResult='';if(typeof pObject!=='object'){return tmpTemplateResult;}let tmpObjectValueKeys=Object.keys(pObject);let tmpPictObjectBranchTemplate=this.pict.TemplateProvider.getTemplate('PICT-Object-Branch');if(!tmpPictObjectBranchTemplate){// This template is here because it is a default template. Users can override this template by providing their own as PICT-Object-Branch
|
|
8504
8660
|
tmpPictObjectBranchTemplate=`
|
|
8505
8661
|
<div class="PICTObjectBranchDepth_{~D:Record.CurrentDepth~}"><div class="PICTObjectBranch">{~D:Record.BranchKey~}</div><div class="PICTObjectBranchValue">{~D:Record.BranchValue~}</div></div>
|
|
8506
|
-
`;}for(let i=0;i<tmpObjectValueKeys.length;i++){let tmpBranchType=typeof pObject[tmpObjectValueKeys[i]];let tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray,pScope);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}let tmpDataValue={AppData:this.pict.AppData,Bundle:this.pict.Bundle,RootContainer:pRootObject,Container:pObject,BranchEntryCount:tmpObjectValueKeys.length,BranchIndex:i,BranchKey:tmpObjectValueKeys[i],BranchValue:tmpBranchValue,BranchDataType:tmpBranchType,CurrentDepth:pCurrentDepth,MaxDepth:pMaxDepth};tmpTemplateResult+=this.pict.parseTemplate(tmpPictObjectBranchTemplate,tmpDataValue,null,pContextArray,pScope,pState);}return tmpTemplateResult;}}module.exports=PictTemplateProviderDataValueTree;},{"pict-template":144}],
|
|
8662
|
+
`;}for(let i=0;i<tmpObjectValueKeys.length;i++){let tmpBranchType=typeof pObject[tmpObjectValueKeys[i]];let tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray,pScope);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}let tmpDataValue={AppData:this.pict.AppData,Bundle:this.pict.Bundle,RootContainer:pRootObject,Container:pObject,BranchEntryCount:tmpObjectValueKeys.length,BranchIndex:i,BranchKey:tmpObjectValueKeys[i],BranchValue:tmpBranchValue,BranchDataType:tmpBranchType,CurrentDepth:pCurrentDepth,MaxDepth:pMaxDepth};tmpTemplateResult+=this.pict.parseTemplate(tmpPictObjectBranchTemplate,tmpDataValue,null,pContextArray,pScope,pState);}return tmpTemplateResult;}}module.exports=PictTemplateProviderDataValueTree;},{"pict-template":144}],255:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderLogStatement extends libPictTemplate{/**
|
|
8507
8663
|
* @param {Object} pFable - The Fable Framework instance
|
|
8508
8664
|
* @param {Object} pOptions - The options for the service
|
|
8509
8665
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8517,7 +8673,7 @@ tmpPictObjectBranchTemplate=`
|
|
|
8517
8673
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8518
8674
|
*
|
|
8519
8675
|
* @return {string} The rendered template
|
|
8520
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();this.log.trace(`PICT Template Log Message: ${tmpHash}`);return'';}}module.exports=PictTemplateProviderLogStatement;},{"pict-template":144}],
|
|
8676
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();this.log.trace(`PICT Template Log Message: ${tmpHash}`);return'';}}module.exports=PictTemplateProviderLogStatement;},{"pict-template":144}],256:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderLogValue extends libPictTemplate{/**
|
|
8521
8677
|
* @param {Object} pFable - The Fable Framework instance
|
|
8522
8678
|
* @param {Object} pOptions - The options for the service
|
|
8523
8679
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8531,7 +8687,7 @@ tmpPictObjectBranchTemplate=`
|
|
|
8531
8687
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8532
8688
|
*
|
|
8533
8689
|
* @return {string} The rendered template
|
|
8534
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};let tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);let tmpValueType=typeof tmpValue;if(tmpValue==null||tmpValueType=='undefined'){this.log.trace(`PICT Template Log Value: [${tmpHash}] is ${tmpValueType}.`);}else if(tmpValueType=='object'){this.log.trace(`PICT Template Log Value: [${tmpHash}] is an object.`,tmpValue);}else{this.log.trace(`PICT Template Log Value: [${tmpHash}] is a ${tmpValueType} = [${tmpValue}]`);}return'';}}module.exports=PictTemplateProviderLogValue;},{"pict-template":144}],
|
|
8690
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};let tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);let tmpValueType=typeof tmpValue;if(tmpValue==null||tmpValueType=='undefined'){this.log.trace(`PICT Template Log Value: [${tmpHash}] is ${tmpValueType}.`);}else if(tmpValueType=='object'){this.log.trace(`PICT Template Log Value: [${tmpHash}] is an object.`,tmpValue);}else{this.log.trace(`PICT Template Log Value: [${tmpHash}] is a ${tmpValueType} = [${tmpValue}]`);}return'';}}module.exports=PictTemplateProviderLogValue;},{"pict-template":144}],257:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderLogValueTree extends libPictTemplate{/**
|
|
8535
8691
|
* @param {Object} pFable - The Fable Framework instance
|
|
8536
8692
|
* @param {Object} pOptions - The options for the service
|
|
8537
8693
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8545,7 +8701,7 @@ tmpPictObjectBranchTemplate=`
|
|
|
8545
8701
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8546
8702
|
*
|
|
8547
8703
|
* @return {string} The rendered template
|
|
8548
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpData=typeof pRecord==='object'?pRecord:{};tmpData.TemplateHash=pTemplateHash.trim();tmpData.ValueTreeParameters=tmpData.TemplateHash.split('^');if(tmpData.ValueTreeParameters.length<1){return'';}tmpData.ResolvedValue=this.resolveStateFromAddress(tmpData.ValueTreeParameters[0],tmpData,pContextArray,null,pScope,pState);tmpData.ResolvedValueType=typeof tmpData.ResolvedValue;try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch{tmpData.TreeMaxDepth=1;}if(tmpData.ResolvedValueType=='object'){this.logValueTreeObjectSet(tmpData.ResolvedValue,tmpData.ValueTreeParameters[0],tmpData.ResolvedValue,0,tmpData.TreeMaxDepth);}else{this.log.trace(`PICT Template Log Value Tree: [${tmpData.TemplateHash}] resolved data is not an object.`,tmpData.ResolvedValue);}return'';}}module.exports=PictTemplateProviderLogValueTree;},{"pict-template":144}],
|
|
8704
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpData=typeof pRecord==='object'?pRecord:{};tmpData.TemplateHash=pTemplateHash.trim();tmpData.ValueTreeParameters=tmpData.TemplateHash.split('^');if(tmpData.ValueTreeParameters.length<1){return'';}tmpData.ResolvedValue=this.resolveStateFromAddress(tmpData.ValueTreeParameters[0],tmpData,pContextArray,null,pScope,pState);tmpData.ResolvedValueType=typeof tmpData.ResolvedValue;try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch{tmpData.TreeMaxDepth=1;}if(tmpData.ResolvedValueType=='object'){this.logValueTreeObjectSet(tmpData.ResolvedValue,tmpData.ValueTreeParameters[0],tmpData.ResolvedValue,0,tmpData.TreeMaxDepth);}else{this.log.trace(`PICT Template Log Value Tree: [${tmpData.TemplateHash}] resolved data is not an object.`,tmpData.ResolvedValue);}return'';}}module.exports=PictTemplateProviderLogValueTree;},{"pict-template":144}],258:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderNotEmpty extends libPictTemplate{/**
|
|
8549
8705
|
* @param {Object} pFable - The Fable Framework instance
|
|
8550
8706
|
* @param {Object} pOptions - The options for the service
|
|
8551
8707
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8560,11 +8716,11 @@ tmpPictObjectBranchTemplate=`
|
|
|
8560
8716
|
*
|
|
8561
8717
|
* @return {string} The rendered template
|
|
8562
8718
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fNotEmptyRender]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>2){this.log.trace(`PICT Template [fNotEmptyRender]::[${tmpHash}]`);}let tmpHashParts=tmpHash.split('^');// For now just check truthiness. Not sure if this is grand.
|
|
8563
|
-
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray,null,pScope,pState)){return tmpHashParts[1];}return'';}}module.exports=PictTemplateProviderNotEmpty;},{"pict-template":144}],
|
|
8719
|
+
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray,null,pScope,pState)){return tmpHashParts[1];}return'';}}module.exports=PictTemplateProviderNotEmpty;},{"pict-template":144}],259:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateIfBase extends libPictTemplate{/**
|
|
8564
8720
|
* @param {Object} pFable - The Fable Framework instance
|
|
8565
8721
|
* @param {Object} pOptions - The options for the service
|
|
8566
8722
|
* @param {String} pServiceHash - The hash of the service
|
|
8567
|
-
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);}compareValues(pValueLeft,pOperator,pValueRight){switch(pOperator){case'TRUE':return pValueLeft===true;case'FALSE':return pValueLeft===false;case'LNGT':case'LENGTH_GREATER_THAN':switch(typeof pValueLeft){case'string':return pValueLeft.length>pValueRight;case'object':return pValueLeft.length>pValueRight;default:return false;}case'LNLT':case'LENGTH_LESS_THAN':switch(typeof pValueLeft){case'string':return pValueLeft.length<pValueRight;case'object':return pValueLeft.length<pValueRight;default:return false;}case'!==':return pValueLeft!==pValueRight;case'!=':return pValueLeft!=pValueRight;case'<':return pValueLeft<pValueRight;case'>':return pValueLeft>pValueRight;case'<=':return pValueLeft<=pValueRight;case'>=':return pValueLeft>=pValueRight;case'===':return pValueLeft===pValueRight;case'==':return pValueLeft==pValueRight;default:return false;}}}module.exports=PictTemplateProviderTemplateIfBase;},{"pict-template":144}],
|
|
8723
|
+
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);}compareValues(pValueLeft,pOperator,pValueRight){switch(pOperator){case'TRUE':return pValueLeft===true;case'FALSE':return pValueLeft===false;case'LNGT':case'LENGTH_GREATER_THAN':switch(typeof pValueLeft){case'string':return pValueLeft.length>pValueRight;case'object':return pValueLeft.length>pValueRight;default:return false;}case'LNLT':case'LENGTH_LESS_THAN':switch(typeof pValueLeft){case'string':return pValueLeft.length<pValueRight;case'object':return pValueLeft.length<pValueRight;default:return false;}case'!==':return pValueLeft!==pValueRight;case'!=':return pValueLeft!=pValueRight;case'<':return pValueLeft<pValueRight;case'>':return pValueLeft>pValueRight;case'<=':return pValueLeft<=pValueRight;case'>=':return pValueLeft>=pValueRight;case'===':return pValueLeft===pValueRight;case'==':return pValueLeft==pValueRight;default:return false;}}}module.exports=PictTemplateProviderTemplateIfBase;},{"pict-template":144}],260:[function(require,module,exports){const libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');class PictTemplateProviderTemplateIf extends libPictTemplateIf{/**
|
|
8568
8724
|
* @param {Object} pFable - The Fable Framework instance
|
|
8569
8725
|
* @param {Object} pOptions - The options for the service
|
|
8570
8726
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8599,7 +8755,7 @@ if(!tmpTemplateHash){this.log.warn(`Pict: Template Render: TemplateHash not reso
|
|
|
8599
8755
|
if(!tmpComparisonOperation){this.log.warn(`Pict: Template Render: Comparison Operation not resolved for [${tmpHash}]`);return tmpCallback(null,'');}// Now try to break the comparison into three parts...
|
|
8600
8756
|
let tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn(`Pict: Template Render: Comparison Operation not complete (three parts expected) for [${tmpHash}]`);return tmpCallback(null,'');}// Now look up the data at the comparison location
|
|
8601
8757
|
try{// This is the only thing that's different from the absolute value function above. Collapse these.
|
|
8602
|
-
let tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray,null,pScope,pState),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray,null,pScope,pState));if(!tmpComparisonResult){return tmpCallback(null,'');}if(!tmpAddressOfData){this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}catch(pError){this.log.error(`Pict: Template Render: Error looking up comparison data for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}}}module.exports=PictTemplateProviderTemplateIf;},{"./Pict-Template-TemplateIf-Base.js":
|
|
8758
|
+
let tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray,null,pScope,pState),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray,null,pScope,pState));if(!tmpComparisonResult){return tmpCallback(null,'');}if(!tmpAddressOfData){this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}catch(pError){this.log.error(`Pict: Template Render: Error looking up comparison data for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}}}module.exports=PictTemplateProviderTemplateIf;},{"./Pict-Template-TemplateIf-Base.js":259}],261:[function(require,module,exports){const libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');class PictTemplateProviderTemplateIfAbsolute extends libPictTemplateIf{/**
|
|
8603
8759
|
* @param {Object} pFable - The Fable Framework instance
|
|
8604
8760
|
* @param {Object} pOptions - The options for the service
|
|
8605
8761
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8633,5 +8789,5 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray,
|
|
|
8633
8789
|
if(!tmpTemplateHash){this.log.warn(`Pict: Template Render: TemplateHash not resolved for [${tmpHash}]`);return tmpCallback(null,'');}// No comparison operation
|
|
8634
8790
|
if(!tmpComparisonOperation){this.log.warn(`Pict: Template Render: Comparison Operation not resolved for [${tmpHash}]`);return tmpCallback(null,'');}// Now try to break the comparison into three parts...
|
|
8635
8791
|
let tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn(`Pict: Template Render: Comparison Operation not complete (three parts expected) for [${tmpHash}]`);return tmpCallback(null,'');}// Now look up the data at the comparison location
|
|
8636
|
-
try{let tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray,null,pScope,pState),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return tmpCallback(null,'');}if(!tmpAddressOfData){this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}catch(pError){this.log.error(`Pict: Template Render: Error looking up comparison data for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}}}module.exports=PictTemplateProviderTemplateIfAbsolute;},{"./Pict-Template-TemplateIf-Base.js":
|
|
8792
|
+
try{let tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray,null,pScope,pState),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return tmpCallback(null,'');}if(!tmpAddressOfData){this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}catch(pError){this.log.error(`Pict: Template Render: Error looking up comparison data for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}}}module.exports=PictTemplateProviderTemplateIfAbsolute;},{"./Pict-Template-TemplateIf-Base.js":259}]},{},[201])(201);});
|
|
8637
8793
|
//# sourceMappingURL=pict.js.map
|