@leaddreamer/inventorylogic 0.0.3-beta.81 → 0.0.3-beta.82
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/business/Utilities/promise-queue/index.js +3 -1
- package/package.json +2 -5
- package/dist/InventoryLogic.0ac93278.js +0 -35
- package/dist/InventoryLogic.0ac93278.js.map +0 -1
- package/dist/InventoryLogic.31f6d549.js +0 -152
- package/dist/InventoryLogic.31f6d549.js.map +0 -1
- package/dist/InventoryLogic.35827495.js +0 -285
- package/dist/InventoryLogic.35827495.js.map +0 -1
- package/dist/InventoryLogic.37dfff3e.js +0 -72
- package/dist/InventoryLogic.37dfff3e.js.map +0 -1
- package/dist/InventoryLogic.4206cb15.js +0 -213
- package/dist/InventoryLogic.4206cb15.js.map +0 -1
- package/dist/InventoryLogic.44193a77.js +0 -35
- package/dist/InventoryLogic.44193a77.js.map +0 -1
- package/dist/InventoryLogic.46ca6768.js +0 -131
- package/dist/InventoryLogic.46ca6768.js.map +0 -1
- package/dist/InventoryLogic.4d012935.js +0 -151
- package/dist/InventoryLogic.4d012935.js.map +0 -1
- package/dist/InventoryLogic.57f24f5f.js +0 -155
- package/dist/InventoryLogic.57f24f5f.js.map +0 -1
- package/dist/InventoryLogic.59be76a4.js +0 -184
- package/dist/InventoryLogic.59be76a4.js.map +0 -1
- package/dist/InventoryLogic.70925a32.js +0 -375
- package/dist/InventoryLogic.70925a32.js.map +0 -1
- package/dist/InventoryLogic.72fcf301.js +0 -6
- package/dist/InventoryLogic.72fcf301.js.map +0 -1
- package/dist/InventoryLogic.7741caec.js +0 -375
- package/dist/InventoryLogic.7741caec.js.map +0 -1
- package/dist/InventoryLogic.78480e5e.js +0 -152
- package/dist/InventoryLogic.78480e5e.js.map +0 -1
- package/dist/InventoryLogic.80d0e568.js +0 -135
- package/dist/InventoryLogic.80d0e568.js.map +0 -1
- package/dist/InventoryLogic.8a273d2e.js +0 -110
- package/dist/InventoryLogic.8a273d2e.js.map +0 -1
- package/dist/InventoryLogic.8addb055.js +0 -202
- package/dist/InventoryLogic.8addb055.js.map +0 -1
- package/dist/InventoryLogic.9dee46ea.js +0 -6
- package/dist/InventoryLogic.9dee46ea.js.map +0 -1
- package/dist/InventoryLogic.b90f66ea.js +0 -124
- package/dist/InventoryLogic.b90f66ea.js.map +0 -1
- package/dist/InventoryLogic.bb447b4c.js +0 -39
- package/dist/InventoryLogic.bb447b4c.js.map +0 -1
- package/dist/InventoryLogic.d27e84a7.js +0 -75
- package/dist/InventoryLogic.d27e84a7.js.map +0 -1
- package/dist/InventoryLogic.d69ad127.js +0 -217
- package/dist/InventoryLogic.d69ad127.js.map +0 -1
- package/dist/InventoryLogic.e03e6b07.js +0 -245
- package/dist/InventoryLogic.e03e6b07.js.map +0 -1
- package/dist/InventoryLogic.f276f76c.js +0 -213
- package/dist/InventoryLogic.f276f76c.js.map +0 -1
- package/dist/InventoryLogic.f4627c8a.js +0 -160
- package/dist/InventoryLogic.f4627c8a.js.map +0 -1
- package/dist/index.js +0 -23
- package/dist/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=22"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.3-beta.
|
|
6
|
+
"version": "0.0.3-beta.82",
|
|
7
7
|
"description": "Business & Database Logic for Inventory Services",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -26,12 +26,9 @@
|
|
|
26
26
|
"*.md",
|
|
27
27
|
"**/*.md",
|
|
28
28
|
"*.json",
|
|
29
|
-
"**/*.json"
|
|
30
|
-
"./dist/*.*",
|
|
31
|
-
"./dist/**/*.*"
|
|
29
|
+
"**/*.json"
|
|
32
30
|
],
|
|
33
31
|
"source": "index.js",
|
|
34
|
-
"browser": "dist/index.js",
|
|
35
32
|
"main": "index.js",
|
|
36
33
|
"type": "module",
|
|
37
34
|
"scripts": {
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {UNSUBSCRIBEKEYS as $fefa9c41cb73ae0b$export$7d0a9b0c57bf84fd, ADDRESSES as $fefa9c41cb73ae0b$export$6890d3564b1f252d, BUSINESS as $fefa9c41cb73ae0b$export$6f454e69bce3a691, BRANDS as $fefa9c41cb73ae0b$export$9547bc19be285f8c, MANAGEDBRANDS as $fefa9c41cb73ae0b$export$73f9b6e7973e6848, ORGANIZATIONS as $fefa9c41cb73ae0b$export$a338fcb90fb9aa37, MANAGEDORGANIZATIONS as $fefa9c41cb73ae0b$export$e72e4cc6cbc6ed26, PRIVATEDATA as $fefa9c41cb73ae0b$export$398ebe85ebcaa41f, BUSINESSDATA as $fefa9c41cb73ae0b$export$e651cf32bc3f78a4, LOGISTICS as $fefa9c41cb73ae0b$export$466d3e044dd15afb, COMMODITY as $fefa9c41cb73ae0b$export$eb747620ce9c5e16, COMMODITIES as $fefa9c41cb73ae0b$export$695940e05bf65de8, LINEITEM as $fefa9c41cb73ae0b$export$4843f9d856059ffd, LINEITEMS as $fefa9c41cb73ae0b$export$f079c6e3d7477fb7, LABORRATES as $fefa9c41cb73ae0b$export$32912c8ca0a712d8, MESSAGES as $fefa9c41cb73ae0b$export$af7faffe10421f14, PRODUCT as $fefa9c41cb73ae0b$export$e36553b0ff5db35a, PRODUCTS as $fefa9c41cb73ae0b$export$4f02bea739260915, PAYMENT as $fefa9c41cb73ae0b$export$eaa266db8852871e, PAYMENTS as $fefa9c41cb73ae0b$export$fadbf22af86be55a, CARDS as $fefa9c41cb73ae0b$export$5f768699f44cc740, TRANSFERS as $fefa9c41cb73ae0b$export$88e60f3c1cd6ae1f, FUNDAMENTALS as $fefa9c41cb73ae0b$export$1a96cd5ee36c0372, PAYOUTRATES as $fefa9c41cb73ae0b$export$e313271f328bdd7d, RATES as $fefa9c41cb73ae0b$export$6b29f6d6b64b8c84, MCC as $fefa9c41cb73ae0b$export$af5764009005aa8e, BUSINESS_TYPE as $fefa9c41cb73ae0b$export$1bd589465335bb9d, ACCESS as $fefa9c41cb73ae0b$export$5eb0c58c8af5c758, ACCESSTO as $fefa9c41cb73ae0b$export$d66f9cc3fc90ff67, STAGE as $fefa9c41cb73ae0b$export$f9865a0a7f208c15, STAGES as $fefa9c41cb73ae0b$export$47007d96f3617630, MATERIAL as $fefa9c41cb73ae0b$export$ca8f11448d1a1116, MATERIALS as $fefa9c41cb73ae0b$export$b7815f33793b967, RECEIPTS as $fefa9c41cb73ae0b$export$cfa5730cd5118215, UNITS as $fefa9c41cb73ae0b$export$a037d132965e1c9f, UNIT as $fefa9c41cb73ae0b$export$97361b7a0c542045, USER as $fefa9c41cb73ae0b$export$ff09b90989b21a8, USERS as $fefa9c41cb73ae0b$export$5a898dd3a28f57e9, MARKUPS as $fefa9c41cb73ae0b$export$1bfdae073fb20e6c, BASE as $fefa9c41cb73ae0b$export$9e15ff8aa6bc996f, HIGHVALUE as $fefa9c41cb73ae0b$export$d93f73eb990136ee, SERVICE as $fefa9c41cb73ae0b$export$3ccfc9db9b7bf43f, FABRICATION as $fefa9c41cb73ae0b$export$5d39addb0306dfd4, WHOLESALE as $fefa9c41cb73ae0b$export$75be49b93be74cb5, RETAIL as $fefa9c41cb73ae0b$export$4466b7859aa06ffd, PAYMENT_SUCCEEDED as $fefa9c41cb73ae0b$export$22e7de231b4ec209, CUSTOMER as $fefa9c41cb73ae0b$export$1d0cc9f143bfe9fc, CUSTOMERADDRESS as $fefa9c41cb73ae0b$export$f437a67b3be18bd2, fakerJSON as $fefa9c41cb73ae0b$export$fe909d0e7ec8aa88, COMPONENT_RANGE as $fefa9c41cb73ae0b$export$72581e25313abf48, COMPONENT_COUNT_RANGE as $fefa9c41cb73ae0b$export$d141374f02dd06d9, ISBN_LENGTH as $fefa9c41cb73ae0b$export$dbb3cd0a4caa6254} from "./InventoryLogic.d27e84a7.js";
|
|
2
|
-
import {AddressDefault as $5e875028eacae923$export$5b4eaa31e9936f4c, AddressForm as $5e875028eacae923$export$20ca2f03d61fd4de, AddressSelectForm as $5e875028eacae923$export$688a09815a2d76e, maplink as $5e875028eacae923$export$5003d738bf1e0422, deleteAddress as $5e875028eacae923$export$6f33ffc8bc2e0c30, deleteAddressByIdAndParent as $5e875028eacae923$export$2873378411ec704, formatAddress as $5e875028eacae923$export$9ab766ce7f4c1f3c, saveAddress as $5e875028eacae923$export$f4e55b204eefc919, fetchAddresses as $5e875028eacae923$export$c9b8cb1768a98d34} from "./InventoryLogic.37dfff3e.js";
|
|
3
|
-
import {fetchFullAccount as $852adca6ae24886c$export$aeea048b1874c987, fetchBusinessData as $852adca6ae24886c$export$a273004aea0035e0, accountPage as $852adca6ae24886c$export$f81f3e9fae10e6db, createBusinessData as $852adca6ae24886c$export$ca4306a1b5762f0e, saveBusinessData as $852adca6ae24886c$export$4bb3a8bbe6017432, deleteBusinessData as $852adca6ae24886c$export$b8447d25d283e6cc, businessDataPath as $852adca6ae24886c$export$8c755753b01b12f, profileComplete as $852adca6ae24886c$export$1e2f140c95101692, profileIncomplete as $852adca6ae24886c$export$f9e1390aa5941c3f, setOpenIssues as $852adca6ae24886c$export$89c9bbe01d357e36, clearOpenIssues as $852adca6ae24886c$export$45379be9a22c2a97} from "./InventoryLogic.57f24f5f.js";
|
|
4
|
-
import {updateCommodity as $21e76cc83a2e54db$export$1ec126d59f4db979, deleteCommodity as $21e76cc83a2e54db$export$9b6c8c0861c73078, deleteCommodityById as $21e76cc83a2e54db$export$51973e05c49d13bf, createCommodity as $21e76cc83a2e54db$export$8566c10d5b97fabb, updateCommodityByID as $21e76cc83a2e54db$export$8396fff7636b69e4, knownCommodity as $21e76cc83a2e54db$export$3171ba3c6caae841, fetchCommodity as $21e76cc83a2e54db$export$dad83ce325511ae2, fetchCommodities as $21e76cc83a2e54db$export$965ec48652f232c7, fetchCommoditiesPaginated as $21e76cc83a2e54db$export$7ad949526eb4312b, fetchCommodityName as $21e76cc83a2e54db$export$a621d0454ced7cc7} from "./InventoryLogic.46ca6768.js";
|
|
5
|
-
import {fetchFundamentals as $367d3ba5e1953c5d$export$f235c8eeea8b793b, fetchRates as $367d3ba5e1953c5d$export$1135a00cfd97f348, fetchPayoutRates as $367d3ba5e1953c5d$export$e545b306de1ff740, fetchMCCs as $367d3ba5e1953c5d$export$e12c451a9ec5cd7c, fetchBusinessTypes as $367d3ba5e1953c5d$export$b0ed4f3c6bb2aee1} from "./InventoryLogic.80d0e568.js";
|
|
6
|
-
import {deleteLineItem as $618035149cc2f269$export$42fb5c11b332038a, deleteLineItemById as $618035149cc2f269$export$9311bf4c650d8c56, createLineItem as $618035149cc2f269$export$9160586647000ce, knownLineItem as $618035149cc2f269$export$682c51c4d54f1588, fetchLineItem as $618035149cc2f269$export$7c918f386d58a9a2, fetchLineItems as $618035149cc2f269$export$93ad1b66295660db, fetchProductLineItems as $618035149cc2f269$export$d2c186a25126fe28, paginateProductLineItems as $618035149cc2f269$export$e6123a92ff8533fc, fetchLineItemName as $618035149cc2f269$export$218cbdd54a707ec7} from "./InventoryLogic.8addb055.js";
|
|
7
|
-
import {MaterialChoices as $082cf3de7799191e$export$ede25c0a3a34c1c7, StageChoices as $082cf3de7799191e$export$eeb76fa3f6b878ea} from "./InventoryLogic.4d012935.js";
|
|
8
|
-
import {logMessageEvent as $b08abff958f5c1f9$export$1d949c62ce6e9407, messageStatus as $b08abff958f5c1f9$export$fb609933e410a9ca, messageEvents as $b08abff958f5c1f9$export$404463f191aa95a1} from "./InventoryLogic.bb447b4c.js";
|
|
9
|
-
import {ERROR_TYPES as $f9cb07fd17b476cd$export$63d334e60537ba01, PaymentDefault as $f9cb07fd17b476cd$export$25824cbb4751202b, paymentDescriptor as $f9cb07fd17b476cd$export$1dc3fa0a524d39c3, receiptDefault as $f9cb07fd17b476cd$export$a5734ae35e42ad51, createPaymentRecord as $f9cb07fd17b476cd$export$e7759a8c3eb8b251, savePaymentData as $f9cb07fd17b476cd$export$f034950df5cadf57, fetchPayment as $f9cb07fd17b476cd$export$81ed014c52470b45, fetchPaymentByUser as $f9cb07fd17b476cd$export$bf9a06d1f6c31bf4, addPaymentDescriptor as $f9cb07fd17b476cd$export$e5cc111dc11d988, savePaymentDescriptor as $f9cb07fd17b476cd$export$218f64344bb0d5b1, removePaymentDescriptor as $f9cb07fd17b476cd$export$2edf51a087d55c34, fetchPDByFingerprint as $f9cb07fd17b476cd$export$719d384deb9d4a1d, fetchPaymentDescriptors as $f9cb07fd17b476cd$export$e67def8f84ea0ce8, listPDSummaries as $f9cb07fd17b476cd$export$afe4f672b985ac26, fetchLatestPDSummary as $f9cb07fd17b476cd$export$46296a85983d5325, fetchPDByOwnerType as $f9cb07fd17b476cd$export$c10d531939e9952c, replaceDefaultPDSummary as $f9cb07fd17b476cd$export$6495802cd4961871, saveReceiptRecord as $f9cb07fd17b476cd$export$4c730f12f97432c2, updateReceipt as $f9cb07fd17b476cd$export$9d597d6207d02073, saveReceiptRecordByOwnerType as $f9cb07fd17b476cd$export$16e7bde1d3e4806e, anyReceiptsByMonthStamp as $f9cb07fd17b476cd$export$be8e05196fbdd05c, fetchReceiptsFiltered as $f9cb07fd17b476cd$export$4eb0e1031e4cb663, saveReceiptRecordByChild as $f9cb07fd17b476cd$export$9612333da9eb2b55, fetchProblemReceipts as $f9cb07fd17b476cd$export$f9dd3c42a9fe0ec7, fetchPledgeTicketReceipt as $f9cb07fd17b476cd$export$912a34b09f6646f6, markReceiptFromPledgeTicket as $f9cb07fd17b476cd$export$cc5e46e81267707d, markReceipt as $f9cb07fd17b476cd$export$b31aae8a995874b9} from "./InventoryLogic.d69ad127.js";
|
|
10
|
-
import {fetchPrivateData as $61cd1791d5265689$export$c3bebe1b4bbebe25, createPrivateData as $61cd1791d5265689$export$9cc830020e353c38, savePrivateData as $61cd1791d5265689$export$fd09f53e2b56e2af, deletePrivateData as $61cd1791d5265689$export$4d99519ebd12d7e2, privateDataPath as $61cd1791d5265689$export$9319c406c799955a} from "./InventoryLogic.8a273d2e.js";
|
|
11
|
-
import {createProduct as $e615241e8e7f6b5a$export$9c734a715e6666d0, makeProductFromChild as $e615241e8e7f6b5a$export$d4a471daa895146b, GoogleAPIProductMap as $e409a6a48e9bf1c0$export$4059922dac929494, JSONProductFeedToItemMapping as $63eb266a363bf697$export$8f68ab01093b41d6, squarespaceFeedTest as $63eb266a363bf697$export$c736243f342fb27b} from "./InventoryLogic.70925a32.js";
|
|
12
|
-
import {summarizeUser as $aeb56590b68e5483$export$7822bd6f88cc1494, deleteUser as $aeb56590b68e5483$export$7d0f10f273c0438a, deleteUserById as $aeb56590b68e5483$export$1eb857e02349d4c8, createUser as $aeb56590b68e5483$export$3493b8991d49f558, buildUserRecords as $aeb56590b68e5483$export$2cccdc7105e5f652, updateUserByID as $aeb56590b68e5483$export$3c10411f5368919b, updateUser as $aeb56590b68e5483$export$e3ac7a5d19605772, knownUser as $aeb56590b68e5483$export$e1980ceaf83ba89, fetchUser as $aeb56590b68e5483$export$6cf10d295bf9320e, fetchUsers as $aeb56590b68e5483$export$2bb8333a9210be15, fetchUsersPaginated as $aeb56590b68e5483$export$db873fddb7c8685b, fetchAnonymousPaginated as $aeb56590b68e5483$export$8cc74b74b196db4a, fetchUserName as $aeb56590b68e5483$export$32d6fa31f0d8a28, fetchUserEmail as $aeb56590b68e5483$export$53755dbf7eaa9f86, userFromId as $aeb56590b68e5483$export$e1ca85ff667d230a, fetchUserPaymentById as $aeb56590b68e5483$export$85df9b940b8f75fd, fetchUserByEmail as $aeb56590b68e5483$export$747404941cf39e5f, fetchFullUser as $aeb56590b68e5483$export$3f848cf621800fba, fetchUserFromChild as $aeb56590b68e5483$export$127de379ac0a4e64, makeUserFromChild as $aeb56590b68e5483$export$a081e2667846200b} from "./InventoryLogic.f276f76c.js";
|
|
13
|
-
import * as $d403d40112d3687c$exports from "./InventoryLogic.31f6d549.js";
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A collection of Business logic and database functions. Shared between ReactJS
|
|
17
|
-
* frontEnd and NodeJS BackEnd
|
|
18
|
-
* @module InventoryLogic
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export {$fefa9c41cb73ae0b$export$7d0a9b0c57bf84fd as UNSUBSCRIBEKEYS, $fefa9c41cb73ae0b$export$6890d3564b1f252d as ADDRESSES, $fefa9c41cb73ae0b$export$6f454e69bce3a691 as BUSINESS, $fefa9c41cb73ae0b$export$9547bc19be285f8c as BRANDS, $fefa9c41cb73ae0b$export$73f9b6e7973e6848 as MANAGEDBRANDS, $fefa9c41cb73ae0b$export$a338fcb90fb9aa37 as ORGANIZATIONS, $fefa9c41cb73ae0b$export$e72e4cc6cbc6ed26 as MANAGEDORGANIZATIONS, $fefa9c41cb73ae0b$export$398ebe85ebcaa41f as PRIVATEDATA, $fefa9c41cb73ae0b$export$e651cf32bc3f78a4 as BUSINESSDATA, $fefa9c41cb73ae0b$export$466d3e044dd15afb as LOGISTICS, $fefa9c41cb73ae0b$export$eb747620ce9c5e16 as COMMODITY, $fefa9c41cb73ae0b$export$695940e05bf65de8 as COMMODITIES, $fefa9c41cb73ae0b$export$4843f9d856059ffd as LINEITEM, $fefa9c41cb73ae0b$export$f079c6e3d7477fb7 as LINEITEMS, $fefa9c41cb73ae0b$export$32912c8ca0a712d8 as LABORRATES, $fefa9c41cb73ae0b$export$af7faffe10421f14 as MESSAGES, $fefa9c41cb73ae0b$export$e36553b0ff5db35a as PRODUCT, $fefa9c41cb73ae0b$export$4f02bea739260915 as PRODUCTS, $fefa9c41cb73ae0b$export$eaa266db8852871e as PAYMENT, $fefa9c41cb73ae0b$export$fadbf22af86be55a as PAYMENTS, $fefa9c41cb73ae0b$export$5f768699f44cc740 as CARDS, $fefa9c41cb73ae0b$export$88e60f3c1cd6ae1f as TRANSFERS, $fefa9c41cb73ae0b$export$1a96cd5ee36c0372 as FUNDAMENTALS, $fefa9c41cb73ae0b$export$e313271f328bdd7d as PAYOUTRATES, $fefa9c41cb73ae0b$export$6b29f6d6b64b8c84 as RATES, $fefa9c41cb73ae0b$export$af5764009005aa8e as MCC, $fefa9c41cb73ae0b$export$1bd589465335bb9d as BUSINESS_TYPE, $fefa9c41cb73ae0b$export$5eb0c58c8af5c758 as ACCESS, $fefa9c41cb73ae0b$export$d66f9cc3fc90ff67 as ACCESSTO, $fefa9c41cb73ae0b$export$f9865a0a7f208c15 as STAGE, $fefa9c41cb73ae0b$export$47007d96f3617630 as STAGES, $fefa9c41cb73ae0b$export$ca8f11448d1a1116 as MATERIAL, $fefa9c41cb73ae0b$export$b7815f33793b967 as MATERIALS, $fefa9c41cb73ae0b$export$cfa5730cd5118215 as RECEIPTS, $fefa9c41cb73ae0b$export$a037d132965e1c9f as UNITS, $fefa9c41cb73ae0b$export$97361b7a0c542045 as UNIT, $fefa9c41cb73ae0b$export$ff09b90989b21a8 as USER, $fefa9c41cb73ae0b$export$5a898dd3a28f57e9 as USERS, $fefa9c41cb73ae0b$export$1bfdae073fb20e6c as MARKUPS, $fefa9c41cb73ae0b$export$9e15ff8aa6bc996f as BASE, $fefa9c41cb73ae0b$export$d93f73eb990136ee as HIGHVALUE, $fefa9c41cb73ae0b$export$3ccfc9db9b7bf43f as SERVICE, $fefa9c41cb73ae0b$export$5d39addb0306dfd4 as FABRICATION, $fefa9c41cb73ae0b$export$75be49b93be74cb5 as WHOLESALE, $fefa9c41cb73ae0b$export$4466b7859aa06ffd as RETAIL, $fefa9c41cb73ae0b$export$22e7de231b4ec209 as PAYMENT_SUCCEEDED, $fefa9c41cb73ae0b$export$1d0cc9f143bfe9fc as CUSTOMER, $fefa9c41cb73ae0b$export$f437a67b3be18bd2 as CUSTOMERADDRESS, $fefa9c41cb73ae0b$export$fe909d0e7ec8aa88 as fakerJSON, $fefa9c41cb73ae0b$export$72581e25313abf48 as COMPONENT_RANGE, $fefa9c41cb73ae0b$export$d141374f02dd06d9 as COMPONENT_COUNT_RANGE, $fefa9c41cb73ae0b$export$dbb3cd0a4caa6254 as ISBN_LENGTH, $5e875028eacae923$export$5b4eaa31e9936f4c as AddressDefault, $5e875028eacae923$export$20ca2f03d61fd4de as AddressForm, $5e875028eacae923$export$688a09815a2d76e as AddressSelectForm, $5e875028eacae923$export$5003d738bf1e0422 as maplink, $5e875028eacae923$export$6f33ffc8bc2e0c30 as deleteAddress, $5e875028eacae923$export$2873378411ec704 as deleteAddressByIdAndParent, $5e875028eacae923$export$9ab766ce7f4c1f3c as formatAddress, $5e875028eacae923$export$f4e55b204eefc919 as saveAddress, $5e875028eacae923$export$c9b8cb1768a98d34 as fetchAddresses, $852adca6ae24886c$export$aeea048b1874c987 as fetchFullAccount, $852adca6ae24886c$export$a273004aea0035e0 as fetchBusinessData, $852adca6ae24886c$export$f81f3e9fae10e6db as accountPage, $852adca6ae24886c$export$ca4306a1b5762f0e as createBusinessData, $852adca6ae24886c$export$4bb3a8bbe6017432 as saveBusinessData, $852adca6ae24886c$export$b8447d25d283e6cc as deleteBusinessData, $852adca6ae24886c$export$8c755753b01b12f as businessDataPath, $852adca6ae24886c$export$1e2f140c95101692 as profileComplete, $852adca6ae24886c$export$f9e1390aa5941c3f as profileIncomplete, $852adca6ae24886c$export$89c9bbe01d357e36 as setOpenIssues, $852adca6ae24886c$export$45379be9a22c2a97 as clearOpenIssues, $21e76cc83a2e54db$export$1ec126d59f4db979 as updateCommodity, $21e76cc83a2e54db$export$9b6c8c0861c73078 as deleteCommodity, $21e76cc83a2e54db$export$51973e05c49d13bf as deleteCommodityById, $21e76cc83a2e54db$export$8566c10d5b97fabb as createCommodity, $21e76cc83a2e54db$export$8396fff7636b69e4 as updateCommodityByID, $21e76cc83a2e54db$export$3171ba3c6caae841 as knownCommodity, $21e76cc83a2e54db$export$dad83ce325511ae2 as fetchCommodity, $21e76cc83a2e54db$export$965ec48652f232c7 as fetchCommodities, $21e76cc83a2e54db$export$7ad949526eb4312b as fetchCommoditiesPaginated, $21e76cc83a2e54db$export$a621d0454ced7cc7 as fetchCommodityName, $367d3ba5e1953c5d$export$f235c8eeea8b793b as fetchFundamentals, $367d3ba5e1953c5d$export$1135a00cfd97f348 as fetchRates, $367d3ba5e1953c5d$export$e545b306de1ff740 as fetchPayoutRates, $367d3ba5e1953c5d$export$e12c451a9ec5cd7c as fetchMCCs, $367d3ba5e1953c5d$export$b0ed4f3c6bb2aee1 as fetchBusinessTypes, $618035149cc2f269$export$42fb5c11b332038a as deleteLineItem, $618035149cc2f269$export$9311bf4c650d8c56 as deleteLineItemById, $618035149cc2f269$export$9160586647000ce as createLineItem, $618035149cc2f269$export$682c51c4d54f1588 as knownLineItem, $618035149cc2f269$export$7c918f386d58a9a2 as fetchLineItem, $618035149cc2f269$export$93ad1b66295660db as fetchLineItems, $618035149cc2f269$export$d2c186a25126fe28 as fetchProductLineItems, $618035149cc2f269$export$e6123a92ff8533fc as paginateProductLineItems, $618035149cc2f269$export$218cbdd54a707ec7 as fetchLineItemName, $082cf3de7799191e$export$ede25c0a3a34c1c7 as MaterialChoices, $082cf3de7799191e$export$eeb76fa3f6b878ea as StageChoices, $b08abff958f5c1f9$export$1d949c62ce6e9407 as logMessageEvent, $b08abff958f5c1f9$export$fb609933e410a9ca as messageStatus, $b08abff958f5c1f9$export$404463f191aa95a1 as messageEvents, $f9cb07fd17b476cd$export$63d334e60537ba01 as ERROR_TYPES, $f9cb07fd17b476cd$export$25824cbb4751202b as PaymentDefault, $f9cb07fd17b476cd$export$1dc3fa0a524d39c3 as paymentDescriptor, $f9cb07fd17b476cd$export$a5734ae35e42ad51 as receiptDefault, $f9cb07fd17b476cd$export$e7759a8c3eb8b251 as createPaymentRecord, $f9cb07fd17b476cd$export$f034950df5cadf57 as savePaymentData, $f9cb07fd17b476cd$export$81ed014c52470b45 as fetchPayment, $f9cb07fd17b476cd$export$bf9a06d1f6c31bf4 as fetchPaymentByUser, $f9cb07fd17b476cd$export$e5cc111dc11d988 as addPaymentDescriptor, $f9cb07fd17b476cd$export$218f64344bb0d5b1 as savePaymentDescriptor, $f9cb07fd17b476cd$export$2edf51a087d55c34 as removePaymentDescriptor, $f9cb07fd17b476cd$export$719d384deb9d4a1d as fetchPDByFingerprint, $f9cb07fd17b476cd$export$e67def8f84ea0ce8 as fetchPaymentDescriptors, $f9cb07fd17b476cd$export$afe4f672b985ac26 as listPDSummaries, $f9cb07fd17b476cd$export$46296a85983d5325 as fetchLatestPDSummary, $f9cb07fd17b476cd$export$c10d531939e9952c as fetchPDByOwnerType, $f9cb07fd17b476cd$export$6495802cd4961871 as replaceDefaultPDSummary, $f9cb07fd17b476cd$export$4c730f12f97432c2 as saveReceiptRecord, $f9cb07fd17b476cd$export$9d597d6207d02073 as updateReceipt, $f9cb07fd17b476cd$export$16e7bde1d3e4806e as saveReceiptRecordByOwnerType, $f9cb07fd17b476cd$export$be8e05196fbdd05c as anyReceiptsByMonthStamp, $f9cb07fd17b476cd$export$4eb0e1031e4cb663 as fetchReceiptsFiltered, $f9cb07fd17b476cd$export$9612333da9eb2b55 as saveReceiptRecordByChild, $f9cb07fd17b476cd$export$f9dd3c42a9fe0ec7 as fetchProblemReceipts, $f9cb07fd17b476cd$export$912a34b09f6646f6 as fetchPledgeTicketReceipt, $f9cb07fd17b476cd$export$cc5e46e81267707d as markReceiptFromPledgeTicket, $f9cb07fd17b476cd$export$b31aae8a995874b9 as markReceipt, $61cd1791d5265689$export$c3bebe1b4bbebe25 as fetchPrivateData, $61cd1791d5265689$export$9cc830020e353c38 as createPrivateData, $61cd1791d5265689$export$fd09f53e2b56e2af as savePrivateData, $61cd1791d5265689$export$4d99519ebd12d7e2 as deletePrivateData, $61cd1791d5265689$export$9319c406c799955a as privateDataPath, $e615241e8e7f6b5a$export$9c734a715e6666d0 as createProduct, $e615241e8e7f6b5a$export$d4a471daa895146b as makeProductFromChild, $e409a6a48e9bf1c0$export$4059922dac929494 as GoogleAPIProductMap, $63eb266a363bf697$export$8f68ab01093b41d6 as JSONProductFeedToItemMapping, $63eb266a363bf697$export$c736243f342fb27b as squarespaceFeedTest, $aeb56590b68e5483$export$7822bd6f88cc1494 as summarizeUser, $aeb56590b68e5483$export$7d0f10f273c0438a as deleteUser, $aeb56590b68e5483$export$1eb857e02349d4c8 as deleteUserById, $aeb56590b68e5483$export$3493b8991d49f558 as createUser, $aeb56590b68e5483$export$2cccdc7105e5f652 as buildUserRecords, $aeb56590b68e5483$export$3c10411f5368919b as updateUserByID, $aeb56590b68e5483$export$e3ac7a5d19605772 as updateUser, $aeb56590b68e5483$export$e1980ceaf83ba89 as knownUser, $aeb56590b68e5483$export$6cf10d295bf9320e as fetchUser, $aeb56590b68e5483$export$2bb8333a9210be15 as fetchUsers, $aeb56590b68e5483$export$db873fddb7c8685b as fetchUsersPaginated, $aeb56590b68e5483$export$8cc74b74b196db4a as fetchAnonymousPaginated, $aeb56590b68e5483$export$32d6fa31f0d8a28 as fetchUserName, $aeb56590b68e5483$export$53755dbf7eaa9f86 as fetchUserEmail, $aeb56590b68e5483$export$e1ca85ff667d230a as userFromId, $aeb56590b68e5483$export$85df9b940b8f75fd as fetchUserPaymentById, $aeb56590b68e5483$export$747404941cf39e5f as fetchUserByEmail, $aeb56590b68e5483$export$3f848cf621800fba as fetchFullUser, $aeb56590b68e5483$export$127de379ac0a4e64 as fetchUserFromChild, $aeb56590b68e5483$export$a081e2667846200b as makeUserFromChild, $9ab66828811feaa2$export$c89b632375228111 as fetchLinkedItem, $9ab66828811feaa2$export$5a3279b4c9648f0f as fetchSubItem, $9ab66828811feaa2$export$d39fdbaf795265a7 as fetchType, $9ab66828811feaa2$export$abd398b6018f8436 as searchType, $9ab66828811feaa2$export$921842c360078a33 as recordByIdAndType, $9ab66828811feaa2$export$9536a88c96a1be48 as typedRecordFromChild, $9ab66828811feaa2$export$c093435923294c4e as typedSortArray, $9ab66828811feaa2$export$19e2e60a6b9b3b01 as processItemType, $9ab66828811feaa2$export$d2db84ed358b7054 as formatLinkedItem, $9ab66828811feaa2$export$da804150202b2b8d as summarizeItem, $9ab66828811feaa2$export$31dbe01f37b7732f as baseItem, $9ab66828811feaa2$export$3ee853080fb51bea as baseForm, $9ab66828811feaa2$export$5af4610fbe1137fd as dataForm, $9ab66828811feaa2$export$f681a8129d2e9d28 as createForm, $9ab66828811feaa2$export$c050911d30958522 as accountForm, $9ab66828811feaa2$export$55369601a4bc1cda as saveForm, $9ab66828811feaa2$export$24178ee8231de835 as updateChangeForm, $9ab66828811feaa2$export$b9a757ca31a5f892 as choicesForm, $9baf0c6b8de436d9$export$cc9d030424d53c6d as saveHost, $9baf0c6b8de436d9$export$f5d1cbac23428e02 as simpleObjectCompare, $9baf0c6b8de436d9$export$62f58f44692b37a8 as formatItem, $9baf0c6b8de436d9$export$398604a469f7de9a as compare, $9baf0c6b8de436d9$export$3145210430358e7 as anyInAny, $9baf0c6b8de436d9$export$15b0b9b385c1f78e as lesserOf, $9baf0c6b8de436d9$export$e375dfe918aae343 as largerOf, $9baf0c6b8de436d9$export$f7bac52274eacccb as archiveRecord, $9baf0c6b8de436d9$export$b6b6e72408f809e2 as refPathToBaseRecord, $9baf0c6b8de436d9$export$adf7c0fe6059d774 as bound, $9baf0c6b8de436d9$export$884089555def93f8 as blindPush, $9baf0c6b8de436d9$export$7fecbbe7deb1a058 as addToArrayObject, $9baf0c6b8de436d9$export$36538c15a30486a1 as makeHexAsNeeded, $d403d40112d3687c$exports as default};
|
|
35
|
-
//# sourceMappingURL=InventoryLogic.0ac93278.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;CAIC","sources":["business/index.js"],"sourcesContent":["/**\n * A collection of Business logic and database functions. Shared between ReactJS\n * frontEnd and NodeJS BackEnd\n * @module InventoryLogic\n */\nexport * from \"./boilerplate/index.js\";\nexport * from \"./Addresses/index.js\";\nexport * from \"./BusinessData/index.js\";\nexport * from \"./Commodities/index.js\";\nexport * from \"./Fundamentals/index.js\";\nexport * from \"./LineItem/index.js\";\nexport * from \"./Markups/index.js\";\nexport * from \"./Messages/index.js\";\nexport * from \"./Payment/index.js\";\nexport * from \"./PrivateData/index.js\";\nexport * from \"./Product/index.js\";\nexport * from \"./User/index.js\";\nexport * from \"./Utilities/index.js\";\n"],"names":[],"version":3,"file":"InventoryLogic.0ac93278.js.map"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import {ADDRESSES as $fefa9c41cb73ae0b$export$6890d3564b1f252d} from "./InventoryLogic.d27e84a7.js";
|
|
2
|
-
import {saveHost as $9baf0c6b8de436d9$export$cc9d030424d53c6d, simpleObjectCompare as $9baf0c6b8de436d9$export$f5d1cbac23428e02, formatItem as $9baf0c6b8de436d9$export$62f58f44692b37a8, compare as $9baf0c6b8de436d9$export$398604a469f7de9a, anyInAny as $9baf0c6b8de436d9$export$3145210430358e7, lesserOf as $9baf0c6b8de436d9$export$15b0b9b385c1f78e, largerOf as $9baf0c6b8de436d9$export$e375dfe918aae343, archiveRecord as $9baf0c6b8de436d9$export$f7bac52274eacccb, refPathToBaseRecord as $9baf0c6b8de436d9$export$b6b6e72408f809e2, bound as $9baf0c6b8de436d9$export$adf7c0fe6059d774, blindPush as $9baf0c6b8de436d9$export$884089555def93f8, addToArrayObject as $9baf0c6b8de436d9$export$7fecbbe7deb1a058, makeHexAsNeeded as $9baf0c6b8de436d9$export$36538c15a30486a1} from "./InventoryLogic.35827495.js";
|
|
3
|
-
import $3gfAb$InventoryLogic59be76a4js from "./InventoryLogic.59be76a4.js";
|
|
4
|
-
import {fetchRecord as $3gfAb$fetchRecord, collectRecords as $3gfAb$collectRecords, collectRecordsByFilter as $3gfAb$collectRecordsByFilter, typedIdFromChild as $3gfAb$typedIdFromChild, typedRefPathFromChild as $3gfAb$typedRefPathFromChild, writeBack as $3gfAb$writeBack, writeRecord as $3gfAb$writeRecord} from "@leaddreamer/firebase-wrapper";
|
|
5
|
-
import {Forms as $3gfAb$Forms} from "@leaddreamer/staticforms";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Typedefs, constants, support functions and database operations related to usage Units
|
|
9
|
-
* and conversions
|
|
10
|
-
* @module Utilities
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//////////////////////////////////////////////////////////////////////
|
|
17
|
-
/**
|
|
18
|
-
* pulls the document Id from a passed refPath string (firebase dependent)
|
|
19
|
-
* @param {!string} refPath
|
|
20
|
-
* @returns {string} Id
|
|
21
|
-
*/ function $9ab66828811feaa2$var$stripDocIdFromRefPath(refPath) {
|
|
22
|
-
return refPath.split("/").pop();
|
|
23
|
-
}
|
|
24
|
-
async function $9ab66828811feaa2$export$c89b632375228111(type, link, refPath = null) {
|
|
25
|
-
return (0, $3gfAb$fetchRecord)(type, link, refPath);
|
|
26
|
-
//the "link" in this case is the document Id
|
|
27
|
-
}
|
|
28
|
-
async function $9ab66828811feaa2$export$5a3279b4c9648f0f(type, refPath) {
|
|
29
|
-
let result;
|
|
30
|
-
const commonId = $9ab66828811feaa2$var$stripDocIdFromRefPath(refPath);
|
|
31
|
-
try {
|
|
32
|
-
result = await (0, $3gfAb$fetchRecord)(type, commonId, refPath);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
//if there is no record, create a skeleton record
|
|
35
|
-
result = Promise.resolve({
|
|
36
|
-
Id: commonId,
|
|
37
|
-
refPath: `${refPath}/${type}/${commonId}`
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return result;
|
|
41
|
-
//returns a PROMISE
|
|
42
|
-
//subrecord items are in the named sub-collection with the parent's Id
|
|
43
|
-
//these collections have ONLY one document
|
|
44
|
-
}
|
|
45
|
-
async function $9ab66828811feaa2$export$d39fdbaf795265a7(type, refPath = null) {
|
|
46
|
-
const tablePath = type;
|
|
47
|
-
if (type === (0, $fefa9c41cb73ae0b$export$6890d3564b1f252d) && !refPath) return null;
|
|
48
|
-
return (0, $3gfAb$collectRecords)(tablePath, refPath);
|
|
49
|
-
//returns a PROMISE
|
|
50
|
-
//subrecord items are in the named sub-collection
|
|
51
|
-
}
|
|
52
|
-
async function $9ab66828811feaa2$export$abd398b6018f8436(type, parent = null, prompt = null, limit = null) {
|
|
53
|
-
const field = (0, $3gfAb$Forms).SearchBy[type];
|
|
54
|
-
let filterArray = prompt && prompt.length ? [
|
|
55
|
-
{
|
|
56
|
-
fieldRef: field,
|
|
57
|
-
opStr: ">=",
|
|
58
|
-
value: prompt
|
|
59
|
-
}
|
|
60
|
-
] : null;
|
|
61
|
-
const sortArray = [
|
|
62
|
-
{
|
|
63
|
-
fieldRef: field,
|
|
64
|
-
dirStr: "asc"
|
|
65
|
-
}
|
|
66
|
-
];
|
|
67
|
-
return (0, $3gfAb$collectRecordsByFilter)(type, parent?.refPath, filterArray, sortArray, limit);
|
|
68
|
-
}
|
|
69
|
-
const $9ab66828811feaa2$export$921842c360078a33 = (Id, Type)=>{
|
|
70
|
-
return {
|
|
71
|
-
Id: Id,
|
|
72
|
-
refPath: `/${Type}/${Id}`
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
function $9ab66828811feaa2$export$9536a88c96a1be48(child, type) {
|
|
76
|
-
return {
|
|
77
|
-
Id: (0, $3gfAb$typedIdFromChild)(child, type),
|
|
78
|
-
refPath: (0, $3gfAb$typedRefPathFromChild)(child, type)
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function $9ab66828811feaa2$export$c093435923294c4e(type) {
|
|
82
|
-
switch(type){
|
|
83
|
-
case 0, $fefa9c41cb73ae0b$export$6890d3564b1f252d:
|
|
84
|
-
return [
|
|
85
|
-
{
|
|
86
|
-
fieldRef: "address_line_1",
|
|
87
|
-
dirStr: "asc"
|
|
88
|
-
}
|
|
89
|
-
];
|
|
90
|
-
default:
|
|
91
|
-
return [
|
|
92
|
-
{
|
|
93
|
-
fieldRef: "name",
|
|
94
|
-
dirStr: "asc"
|
|
95
|
-
}
|
|
96
|
-
];
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
async function $9ab66828811feaa2$export$19e2e60a6b9b3b01(item, type, refPath = null, batch = null) {
|
|
100
|
-
switch(type){
|
|
101
|
-
case 0, $fefa9c41cb73ae0b$export$6890d3564b1f252d:
|
|
102
|
-
return item?.Id ? (0, $3gfAb$writeBack)(item, batch) : (0, $3gfAb$writeRecord)(type, item, refPath, batch);
|
|
103
|
-
default:
|
|
104
|
-
return Promise.resolve(null);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
async function $9ab66828811feaa2$export$d2db84ed358b7054(link, type, refPath) {
|
|
108
|
-
const tablePath = type;
|
|
109
|
-
const Id = link; //can also be a partial path ending with Id
|
|
110
|
-
const item = await (0, $3gfAb$fetchRecord)(tablePath, Id, refPath);
|
|
111
|
-
return $9ab66828811feaa2$export$da804150202b2b8d(item, type);
|
|
112
|
-
}
|
|
113
|
-
function $9ab66828811feaa2$export$da804150202b2b8d(item, type) {
|
|
114
|
-
//checks for presence in the Forms object
|
|
115
|
-
return (0, $3gfAb$Forms).Summarize[type] ? (0, $3gfAb$Forms).Summarize[type](item) : item.name || item.Id;
|
|
116
|
-
}
|
|
117
|
-
function $9ab66828811feaa2$export$31dbe01f37b7732f(type) {
|
|
118
|
-
return (0, $3gfAb$Forms).Base[type];
|
|
119
|
-
}
|
|
120
|
-
function $9ab66828811feaa2$export$3ee853080fb51bea(type) {
|
|
121
|
-
return (0, $3gfAb$Forms).BaseForm[type];
|
|
122
|
-
}
|
|
123
|
-
function $9ab66828811feaa2$export$5af4610fbe1137fd(type) {
|
|
124
|
-
return (0, $3gfAb$Forms)?.Data[type] ? (0, $3gfAb$Forms).Data[type] : null;
|
|
125
|
-
}
|
|
126
|
-
function $9ab66828811feaa2$export$f681a8129d2e9d28(type) {
|
|
127
|
-
return (0, $3gfAb$Forms)?.CreateForm[type] ? (0, $3gfAb$Forms).CreateForm[type] : null;
|
|
128
|
-
}
|
|
129
|
-
function $9ab66828811feaa2$export$c050911d30958522(type) {
|
|
130
|
-
return (0, $3gfAb$Forms)?.AccountForm[type] ? (0, $3gfAb$Forms).AccountForm[type] : null;
|
|
131
|
-
}
|
|
132
|
-
function $9ab66828811feaa2$export$55369601a4bc1cda(type) {
|
|
133
|
-
return (0, $3gfAb$Forms)?.Save[type] ? (0, $3gfAb$Forms).Save[type] : ()=>{};
|
|
134
|
-
}
|
|
135
|
-
function $9ab66828811feaa2$export$24178ee8231de835(type) {
|
|
136
|
-
//if there *is* a special change function, return it, else
|
|
137
|
-
//return a simple function to return the new value directly
|
|
138
|
-
return (0, $3gfAb$Forms)?.UpdateChange[type] ? (0, $3gfAb$Forms).UpdateChange[type] //returns a FUNCTION
|
|
139
|
-
: (prev, value, itemFor)=>{
|
|
140
|
-
return {
|
|
141
|
-
...prev,
|
|
142
|
-
[itemFor]: value
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function $9ab66828811feaa2$export$b9a757ca31a5f892(fieldname) {
|
|
147
|
-
return (0, $3gfAb$Forms).Choices[fieldname] ? (0, $3gfAb$Forms).Choices[fieldname] : {};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
export {$9ab66828811feaa2$export$c89b632375228111 as fetchLinkedItem, $9ab66828811feaa2$export$5a3279b4c9648f0f as fetchSubItem, $9ab66828811feaa2$export$d39fdbaf795265a7 as fetchType, $9ab66828811feaa2$export$abd398b6018f8436 as searchType, $9ab66828811feaa2$export$921842c360078a33 as recordByIdAndType, $9ab66828811feaa2$export$9536a88c96a1be48 as typedRecordFromChild, $9ab66828811feaa2$export$c093435923294c4e as typedSortArray, $9ab66828811feaa2$export$19e2e60a6b9b3b01 as processItemType, $9ab66828811feaa2$export$d2db84ed358b7054 as formatLinkedItem, $9ab66828811feaa2$export$da804150202b2b8d as summarizeItem, $9ab66828811feaa2$export$31dbe01f37b7732f as baseItem, $9ab66828811feaa2$export$3ee853080fb51bea as baseForm, $9ab66828811feaa2$export$5af4610fbe1137fd as dataForm, $9ab66828811feaa2$export$f681a8129d2e9d28 as createForm, $9ab66828811feaa2$export$c050911d30958522 as accountForm, $9ab66828811feaa2$export$55369601a4bc1cda as saveForm, $9ab66828811feaa2$export$24178ee8231de835 as updateChangeForm, $9ab66828811feaa2$export$b9a757ca31a5f892 as choicesForm, $9baf0c6b8de436d9$export$cc9d030424d53c6d as saveHost, $9baf0c6b8de436d9$export$f5d1cbac23428e02 as simpleObjectCompare, $9baf0c6b8de436d9$export$62f58f44692b37a8 as formatItem, $9baf0c6b8de436d9$export$398604a469f7de9a as compare, $9baf0c6b8de436d9$export$3145210430358e7 as anyInAny, $9baf0c6b8de436d9$export$15b0b9b385c1f78e as lesserOf, $9baf0c6b8de436d9$export$e375dfe918aae343 as largerOf, $9baf0c6b8de436d9$export$f7bac52274eacccb as archiveRecord, $9baf0c6b8de436d9$export$b6b6e72408f809e2 as refPathToBaseRecord, $9baf0c6b8de436d9$export$adf7c0fe6059d774 as bound, $9baf0c6b8de436d9$export$884089555def93f8 as blindPush, $9baf0c6b8de436d9$export$7fecbbe7deb1a058 as addToArrayObject, $9baf0c6b8de436d9$export$36538c15a30486a1 as makeHexAsNeeded, $d403d40112d3687c$exports as default};
|
|
152
|
-
//# sourceMappingURL=InventoryLogic.31f6d549.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;CAIC;;;;;AAaD,sEAAsE;AAEtE;;;;CAIC,GACD,SAAS,4CAAsB,OAAO;IACpC,OAAO,QAAQ,KAAK,CAAC,KAAK,GAAG;AAC/B;AAUO,eAAe,0CAAgB,IAAI,EAAE,IAAI,EAAE,UAAU,IAAI;IAC9D,OAAO,CAAA,GAAA,kBAAU,EAAE,MAAM,MAAM;AAC/B,4CAA4C;AAC9C;AAUO,eAAe,0CAAa,IAAI,EAAE,OAAO;IAC9C,IAAI;IACJ,MAAM,WAAW,4CAAsB;IACvC,IAAI;QACF,SAAS,MAAM,CAAA,GAAA,kBAAU,EAAE,MAAM,UAAU;IAC7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AI,EAAE,WAAW,CAAC,KAAK,GAAG;AAC9D;AAUO,SAAS,0CAAS,IAAI;IAC3B,OAAO,CAAA,GAAA,YAAI,GAAG,IAAI,CAAC,KAAK,GAAG,CAAA,GAAA,YAAI,EAAE,IAAI,CAAC,KAAK,GAAG,KAAQ;AACxD;AAmBO,SAAS,0CAAiB,IAAI;IACnC,0DAA0D;IAC1D,2DAA2D;IAC3D,OAAO,CAAA,GAAA,YAAI,GAAG,YAAY,CAAC,KAAK,GAC5B,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,KAAK,CAAC,oBAAoB;OAC7C,CAAC,MAAM,OAAO;QACd,OAAO;YACL,GAAG,IAAI;YACP,CAAC,QAAQ,EAAE;QACb;IACF;AACJ;AAUO,SAAS,0CAAY,SAAS;IACnC,OAAO,CAAA,GAAA,YAAI,EAAE,OAAO,CAAC,UAAU,GAC3B,CAAA,GAAA,YAAI,EAAE,OAAO,CAAC,UAAU,GACxB,CAAC;AACP","sources":["business/Utilities/index.js"],"sourcesContent":["/**\n * Typedefs, constants, support functions and database operations related to usage Units\n * and conversions\n * @module Utilities\n */\nimport {\n collectRecordsByFilter,\n typedIdFromChild,\n typedRefPathFromChild,\n fetchRecord,\n collectRecords,\n writeBack,\n writeRecord,\n} from \"@leaddreamer/firebase-wrapper\";\nimport { Forms } from \"@leaddreamer/staticforms\";\nimport { ADDRESSES } from \"../boilerplate/index.js\";\n\n//////////////////////////////////////////////////////////////////////\n\n/**\n * pulls the document Id from a passed refPath string (firebase dependent)\n * @param {!string} refPath\n * @returns {string} Id\n */\nfunction stripDocIdFromRefPath(refPath) {\n return refPath.split(\"/\").pop();\n}\n\n/**\n * used generic for constructing forms for input and display\n * @param {!string} type refers to the sub-collection name\n * @param {!string} link refers to the linking \"value\" - a documentID\n * @param {?string} refPath optionally refers to the \"/\" separate path to\n * the parent document in firebase\n * @returns {Promise.RecordDocument}\n */\nexport async function fetchLinkedItem(type, link, refPath = null) {\n return fetchRecord(type, link, refPath);\n //the \"link\" in this case is the document Id\n}\n\n/**\n * some items are stored in the database as a single-record collection, using\n * the same Id as the parent\n * @param {!string} type refers to the sub-collection name\n * @param {!string} refPath refers to the \"/\" separate path to the required\n * parent document in firebase\n * @returns {Promise.RecordDocument}\n */\nexport async function fetchSubItem(type, refPath) {\n let result;\n const commonId = stripDocIdFromRefPath(refPath);\n try {\n result = await fetchRecord(type, commonId, refPath);\n } catch (err) {\n //if there is no record, create a skeleton record\n result = Promise.resolve({\n Id: commonId,\n refPath: `${refPath}/${type}/${commonId}`,\n });\n }\n return result;\n //returns a PROMISE\n //subrecord items are in the named sub-collection with the parent's Id\n //these collections have ONLY one document\n}\n\n/**\n * returns an entire sub-collection by \"type\" (sub-collection name).\n * If refpath is omitted, assumes \"type\" is a top-level collection\n * @param {!string} type refers to the sub-collection name\n * @param {?string} refPath optionally refers to the \"/\" separate path to\n * the parent document in firebase\n * @returns {Promise.Array.RecordDocument}\n */\nexport async function fetchType(type, refPath = null) {\n const tablePath = type;\n\n if (type === ADDRESSES && !refPath) return null;\n\n return collectRecords(tablePath, refPath);\n //returns a PROMISE\n //subrecord items are in the named sub-collection\n}\n\n/**\n * returns a Promise which resolves to an array of all Type's whose\n * name begins with the provided prompt, optionally limited to a provided number\n * CASE SENSITIVE FOR NOW\n * @param {string} type type of record to search\n * @param {Record} parent parent object of records, if any\n * @param {?string} prompt Used to query for matching records\n * @param {?string|number} limit Used to limit the number of results\n * @returns {Promise.Array.OrganizationType}\n */\nexport async function searchType(\n type,\n parent = null,\n prompt = null,\n limit = null,\n) {\n const field = Forms.SearchBy[type];\n let filterArray =\n prompt && prompt.length\n ? [{ fieldRef: field, opStr: \">=\", value: prompt }]\n : null;\n const sortArray = [\n {\n fieldRef: field,\n dirStr: \"asc\",\n },\n ];\n return collectRecordsByFilter(\n type,\n parent?.refPath,\n filterArray,\n sortArray,\n limit,\n );\n}\n\n/**\n * creates and returns a minimal record from an Id and `type`\n * @param {!string} Id\n * @param {!string} Type\n * @returns {AccountType}\n */\nexport const recordByIdAndType = (Id, Type) => {\n return {\n Id: Id,\n refPath: `/${Type}/${Id}`,\n };\n};\n\n/**\n * builds a representation of a parent from a child, by type\n * @param {string} type \n * @param {Record} child \n * @returns {Record}\n */\n\nexport function typedRecordFromChild(child, type) {\n return {\n Id: typedIdFromChild(child, type),\n refPath: typedRefPathFromChild(child, type),\n }\n}\n\n/**\n * Firebase query support - builds default sort options\n * @param {!string} type\n * @returns {Array.SortObject}\n */\nexport function typedSortArray(type) {\n switch (type) {\n case ADDRESSES:\n return [{ fieldRef: \"address_line_1\", dirStr: \"asc\" }];\n default:\n return [{ fieldRef: \"name\", dirStr: \"asc\" }];\n }\n}\n\n/**\n * generic form data processing for database by \"type\" (collection name)\n * @param {RecordDocument} item\n * @param {!string} type refers to the sub-collection name\n * @param {?string} refPath optionally refers to the \"/\" separate path to\n * the parent document in firebase\n * @returns {Promise.RecordDocument}\n */\nexport async function processItemType(\n item,\n type,\n refPath = null,\n batch = null,\n) {\n switch (type) {\n case ADDRESSES:\n return item?.Id\n ? writeBack(item, batch)\n : writeRecord(type, item, refPath, batch);\n default:\n return Promise.resolve(null);\n }\n}\n\n/**\n * fetches a sub-record from the database and returns the result as a summary string\n * @param {!string} link refers to the linking \"value\" - a documentID\n * @param {!string} type refers to the sub-collection name\n * @param {!string} refPath refers to the \"/\" separate path to the required\n * parent document in firebase\n * @returns {Promise.string}\n */\nexport async function formatLinkedItem(link, type, refPath) {\n const tablePath = type;\n const Id = link; //can also be a partial path ending with Id\n const item = await fetchRecord(tablePath, Id, refPath);\n return summarizeItem(item, type);\n}\n\n/**\n * parameterized function to return string summary of an object\n * By default, returns the \"name\" property of the item.\n * @param {object} item - data object to summarize\n * @param {String|\"User\"|\"Product\"|\"LineItem\"|\"Commodities\"|\"Units\"} type\n * - type of the object to summarize\n * @returns {string}\n */\nexport function summarizeItem(item, type) {\n //checks for presence in the Forms object\n return Forms.Summarize[type] ? Forms.Summarize[type](item) : (item.name || item.Id);\n}\n\n/**\n * Convenience function to mask actual Forms array from the front-end\n * This version returns the \"base\" item sample for a business-object type,\n * where the keys are the field/property names, and the values are the\n * default values as defined in the business logic\n * @param {string} type \n * @returns {object} keys and default values\n */\nexport function baseItem(type) {\n return Forms.Base[type];\n}\n\n/**\n * Convenience function to mask actual Forms array from the front-end\n * This version returns the \"baseForm\" withe keys/properties, and\n * values are strings with \":\" separated definitions for EditForm and\n * similar functionality - see \"EditForm\" for more details\n * @param {string} type \n * @returns {object} keys and default values\n */\nexport function baseForm(type) {\n return Forms.BaseForm[type];\n}\n\n/**\n * Convenience function to mask actual Forms array from the front-end\n * This version returns the \"Data\" object with keys/properties, and\n * values are strings with \":\" separated definitions for Faker and\n * similar functionality - to generate \"fake\" simulated data for testing\n * @param {string} type \n * @returns {object} keys and default values\n */\nexport function dataForm(type) {\n return Forms?.Data[type] ? Forms.Data[type] : null;\n}\n\n/**\n * Convenience function to mask actual Forms array from the front-end\n * This version returns the \"createForm\" withe keys/properties, and\n * values are strings with \":\" separated definitions for EditForm and\n * similar functionality - see \"EditForm\" for more details\n * Specifically for limited \"front-end\" use to CREATE new\n * business-objects with the minimum entries necessary\n * @param {string} type \n * @returns {object} keys and default values\n */\nexport function createForm(type) {\n return Forms?.CreateForm[type]\n ? Forms.CreateForm[type]\n : null;\n\n}\n\n/**\n * Convenience function to mask actual Forms array from the front-end\n * This version returns the \"createForm\" withe keys/properties, and\n * values are strings with \":\" separated definitions for EditForm and\n * similar functionality - see \"EditForm\" for more details\n * Specifically for limited \"front-end\" use on ACCOUNT business-objects\n * with the minimum entries necessary\n * @param {string} type \n * @returns {object} keys and default values\n */\nexport function accountForm(type) {\n return Forms?.AccountForm[type] ? Forms.AccountForm[type] : null;\n}\n\n/**\n * Convenience function to mask actual Forms array from the front-end\n * This version returns a FUNCTION to use for saving a business-object\n * to the database - abstracting type-specific features and functionality\n * from the front end\n * @param {string} type \n * @returns {callback}\n */\nexport function saveForm(type) {\n return Forms?.Save[type] ? Forms.Save[type] : () => { };\n}\n\n/**\n * @function UpdateChange\n * Function Signature for UpdateChange functions\n * @param {object} prev\n * @param {object} value\n * @param {string} itemFor\n * @param {object} fullChoiceObject\n * @returns {object}\n */\n\n/**\n * Convenience function to mask actual Forms array from the front-end\n * This version returns a FUNCTION to respond to cross-field dependent\n * chnages during editing with EditForm, reactdatagrid, etc\n * @param {string} type \n * @returns {callback}\n */\nexport function updateChangeForm(type) {\n //if there *is* a special change function, return it, else\n //return a simple function to return the new value directly\n return Forms?.UpdateChange[type]\n ? Forms.UpdateChange[type] //returns a FUNCTION\n : (prev, value, itemFor) => {\n return {\n ...prev,\n [itemFor]: value\n };\n };\n}\n\n/**\n * Returns an object whose keys are the available choices for a\n * business-object field, and whose values represent the sort order\n * Most fieldname have no such choices. Both the definitions and \n * usage are defined in business logic elsewhere\n * @param {string} fieldname which business type is being processes\n * @returns {object}\n */\nexport function choicesForm(fieldname) {\n return Forms.Choices[fieldname]\n ? Forms.Choices[fieldname]\n : {};\n}\n\nexport * from \"./other.js\";\nexport * from \"./promise-queue/index.js\";\n"],"names":[],"version":3,"file":"InventoryLogic.31f6d549.js.map"}
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import $lLeNo$dayjs from "dayjs";
|
|
2
|
-
import $lLeNo$dayjspluginisSameOrAfterjs from "dayjs/plugin/isSameOrAfter.js";
|
|
3
|
-
import $lLeNo$dayjspluginisSameOrBeforejs from "dayjs/plugin/isSameOrBefore.js";
|
|
4
|
-
import {writeBack as $lLeNo$writeBack, runTransaction as $lLeNo$runTransaction, fetchRecordByRefPath as $lLeNo$fetchRecordByRefPath, deleteRecordByRefPath as $lLeNo$deleteRecordByRefPath} from "@leaddreamer/firebase-wrapper";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Typedefs, constants, support functions and database operations for
|
|
8
|
-
* general Utilities
|
|
9
|
-
* @module Utilities
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//the following inits the dayjs plugins
|
|
15
|
-
(0, $lLeNo$dayjs).extend((0, $lLeNo$dayjspluginisSameOrAfterjs));
|
|
16
|
-
(0, $lLeNo$dayjs).extend((0, $lLeNo$dayjspluginisSameOrBeforejs));
|
|
17
|
-
async function $9baf0c6b8de436d9$export$cc9d030424d53c6d(host, batch = null) {
|
|
18
|
-
return (0, $lLeNo$writeBack)(host, batch);
|
|
19
|
-
}
|
|
20
|
-
function $9baf0c6b8de436d9$export$f5d1cbac23428e02(object1, object2) {
|
|
21
|
-
let result = Object.keys(object1).reduce((accumulate, key)=>{
|
|
22
|
-
// eslint-disable-next-line
|
|
23
|
-
return object1[key] == object2[key] ? accumulate : false;
|
|
24
|
-
}, true); // note simple (not object) compare
|
|
25
|
-
return result;
|
|
26
|
-
}
|
|
27
|
-
function $9baf0c6b8de436d9$export$62f58f44692b37a8(thisObject, thisFormat) {
|
|
28
|
-
let final = thisFormat.replace(/{.+?}/g, function(field) {
|
|
29
|
-
let fieldRaw = field.slice(1, -1);
|
|
30
|
-
//below allows for DOT notation access within the item object
|
|
31
|
-
let fieldparts = fieldRaw.split(":");
|
|
32
|
-
let [fieldname, fieldStyle] = fieldparts;
|
|
33
|
-
let fieldArray = fieldname.split(".");
|
|
34
|
-
//below walks into an object - note: ASSUMES an object
|
|
35
|
-
const bob = fieldArray.reduce((lastObject, nextName)=>{
|
|
36
|
-
return lastObject[nextName];
|
|
37
|
-
}, thisObject);
|
|
38
|
-
return bob ? $9baf0c6b8de436d9$var$specialFormat(bob, fieldStyle) : "----";
|
|
39
|
-
});
|
|
40
|
-
return final;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @private
|
|
44
|
-
* @param {any} value
|
|
45
|
-
* @param {!string} style
|
|
46
|
-
* @returns {any|string}
|
|
47
|
-
*/ function $9baf0c6b8de436d9$var$specialFormat(value, style) {
|
|
48
|
-
switch(style){
|
|
49
|
-
case "timestamp":
|
|
50
|
-
return (0, $lLeNo$dayjs)(value.toDate()).format("MMM DD, YYYY");
|
|
51
|
-
default:
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function $9baf0c6b8de436d9$export$398604a469f7de9a(thisItem, anotherItem, sort = "Id:number") {
|
|
56
|
-
let [field, type] = sort.split(":");
|
|
57
|
-
type = type ? type : "number";
|
|
58
|
-
switch(type){
|
|
59
|
-
case "string":
|
|
60
|
-
let nameArray = thisItem[field].split("The ");
|
|
61
|
-
let anotherArray = anotherItem[field].split("The ");
|
|
62
|
-
return (nameArray[0] ? nameArray[0] : nameArray[1]).localeCompare(anotherArray[0] ? anotherArray[0] : anotherArray[1]);
|
|
63
|
-
case "date":
|
|
64
|
-
//if (!thisItem[field] || !anotherItem[field]) return 0;
|
|
65
|
-
return !thisItem[field] || (0, $lLeNo$dayjs)(thisItem[field]).isBefore(anotherItem[field], "day") ? -1 : anotherItem[field] && (0, $lLeNo$dayjs)(thisItem[field]).isSame(anotherItem[field], "day") ? 0 : 1;
|
|
66
|
-
default:
|
|
67
|
-
return Number(thisItem[field]) - Number(anotherItem[field]);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function $9baf0c6b8de436d9$export$3145210430358e7(findFrom, findIn) {
|
|
71
|
-
let mapFindIn = new Map();
|
|
72
|
-
findIn.forEach((entry, index)=>{
|
|
73
|
-
mapFindIn.set(entry, true);
|
|
74
|
-
}); //speed up by avoiding second loop
|
|
75
|
-
const findFromLength = findFrom.length;
|
|
76
|
-
let found = false;
|
|
77
|
-
for(let findFromIndex = 0; findFromIndex < findFromLength && !found; findFromIndex++)if (mapFindIn.get(findFrom[findFromIndex].valueOf())) found = true; //note this breaks both loops
|
|
78
|
-
return found;
|
|
79
|
-
}
|
|
80
|
-
function $9baf0c6b8de436d9$export$15b0b9b385c1f78e(...args) {
|
|
81
|
-
return Math.min(...args);
|
|
82
|
-
}
|
|
83
|
-
function $9baf0c6b8de436d9$export$e375dfe918aae343(...args) {
|
|
84
|
-
return Math.max(...args);
|
|
85
|
-
}
|
|
86
|
-
async function $9baf0c6b8de436d9$export$f7bac52274eacccb(record) {
|
|
87
|
-
//split the reference path into it's constituent parts
|
|
88
|
-
const parts = record.refPath.split("/");
|
|
89
|
-
const partsCount = parts.length;
|
|
90
|
-
if (Math.floor(partsCount / 2) * 2 !== partsCount) //throw "safe" error
|
|
91
|
-
return; //returns a null promise resolved
|
|
92
|
-
let archivePath = "";
|
|
93
|
-
let index = 0;
|
|
94
|
-
//adde a "_" to the start of every collection named in the path
|
|
95
|
-
//this avoids collectionGroup issues, but follows a parallel path
|
|
96
|
-
do {
|
|
97
|
-
archivePath = `${archivePath}/_${parts[index]}/${parts[index + 1]}`;
|
|
98
|
-
index += 2;
|
|
99
|
-
}while (index < partsCount);
|
|
100
|
-
await (0, $lLeNo$runTransaction)(async (batch)=>{
|
|
101
|
-
//////////////////////////////
|
|
102
|
-
//Read a current full copy of the record
|
|
103
|
-
const realRecord = await (0, $lLeNo$fetchRecordByRefPath)(record.refPath, batch);
|
|
104
|
-
//Write it to the "archivePath"
|
|
105
|
-
await (0, $lLeNo$writeBack)({
|
|
106
|
-
...realRecord,
|
|
107
|
-
refPath: archivePath
|
|
108
|
-
}, batch);
|
|
109
|
-
//delete the original copy
|
|
110
|
-
await (0, $lLeNo$deleteRecordByRefPath)(realRecord.refPath, batch);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
function $9baf0c6b8de436d9$export$b6b6e72408f809e2(refPath) {
|
|
114
|
-
return {
|
|
115
|
-
Id: refPath.split("/").pop(),
|
|
116
|
-
refPath: refPath
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function $9baf0c6b8de436d9$export$adf7c0fe6059d774(value, lowerBound, upperBound) {
|
|
120
|
-
return $9baf0c6b8de436d9$export$e375dfe918aae343($9baf0c6b8de436d9$export$15b0b9b385c1f78e(value, upperBound), lowerBound);
|
|
121
|
-
}
|
|
122
|
-
function $9baf0c6b8de436d9$export$884089555def93f8(targetArray, newObject) {
|
|
123
|
-
targetArray ? targetArray.push(newObject) : targetArray = [
|
|
124
|
-
newObject
|
|
125
|
-
];
|
|
126
|
-
return targetArray;
|
|
127
|
-
}
|
|
128
|
-
function $9baf0c6b8de436d9$export$7fecbbe7deb1a058(arrayObject, key, object) {
|
|
129
|
-
if (arrayObject[key] && arrayObject[key].length) //if the key is already present, *and* there are already objects in the keyed array
|
|
130
|
-
arrayObject[key].push(object); //push the object onto the indexed array
|
|
131
|
-
else arrayObject[key] = [
|
|
132
|
-
object
|
|
133
|
-
];
|
|
134
|
-
}
|
|
135
|
-
function $9baf0c6b8de436d9$export$36538c15a30486a1(color) {
|
|
136
|
-
var colours = {
|
|
137
|
-
aliceblue: "#f0f8ff",
|
|
138
|
-
antiquewhite: "#faebd7",
|
|
139
|
-
aqua: "#00ffff",
|
|
140
|
-
aquamarine: "#7fffd4",
|
|
141
|
-
azure: "#f0ffff",
|
|
142
|
-
beige: "#f5f5dc",
|
|
143
|
-
bisque: "#ffe4c4",
|
|
144
|
-
black: "#000000",
|
|
145
|
-
blanchedalmond: "#ffebcd",
|
|
146
|
-
blue: "#0000ff",
|
|
147
|
-
blueviolet: "#8a2be2",
|
|
148
|
-
brown: "#a52a2a",
|
|
149
|
-
burlywood: "#deb887",
|
|
150
|
-
cadetblue: "#5f9ea0",
|
|
151
|
-
chartreuse: "#7fff00",
|
|
152
|
-
chocolate: "#d2691e",
|
|
153
|
-
coral: "#ff7f50",
|
|
154
|
-
cornflowerblue: "#6495ed",
|
|
155
|
-
cornsilk: "#fff8dc",
|
|
156
|
-
crimson: "#dc143c",
|
|
157
|
-
cyan: "#00ffff",
|
|
158
|
-
darkblue: "#00008b",
|
|
159
|
-
darkcyan: "#008b8b",
|
|
160
|
-
darkgoldenrod: "#b8860b",
|
|
161
|
-
darkgray: "#a9a9a9",
|
|
162
|
-
darkgreen: "#006400",
|
|
163
|
-
darkkhaki: "#bdb76b",
|
|
164
|
-
darkmagenta: "#8b008b",
|
|
165
|
-
darkolivegreen: "#556b2f",
|
|
166
|
-
darkorange: "#ff8c00",
|
|
167
|
-
darkorchid: "#9932cc",
|
|
168
|
-
darkred: "#8b0000",
|
|
169
|
-
darksalmon: "#e9967a",
|
|
170
|
-
darkseagreen: "#8fbc8f",
|
|
171
|
-
darkslateblue: "#483d8b",
|
|
172
|
-
darkslategray: "#2f4f4f",
|
|
173
|
-
darkturquoise: "#00ced1",
|
|
174
|
-
darkviolet: "#9400d3",
|
|
175
|
-
deeppink: "#ff1493",
|
|
176
|
-
deepskyblue: "#00bfff",
|
|
177
|
-
dimgray: "#696969",
|
|
178
|
-
dodgerblue: "#1e90ff",
|
|
179
|
-
firebrick: "#b22222",
|
|
180
|
-
floralwhite: "#fffaf0",
|
|
181
|
-
forestgreen: "#228b22",
|
|
182
|
-
fuchsia: "#ff00ff",
|
|
183
|
-
gainsboro: "#dcdcdc",
|
|
184
|
-
ghostwhite: "#f8f8ff",
|
|
185
|
-
gold: "#ffd700",
|
|
186
|
-
goldenrod: "#daa520",
|
|
187
|
-
gray: "#808080",
|
|
188
|
-
green: "#008000",
|
|
189
|
-
greenyellow: "#adff2f",
|
|
190
|
-
honeydew: "#f0fff0",
|
|
191
|
-
hotpink: "#ff69b4",
|
|
192
|
-
"indianred ": "#cd5c5c",
|
|
193
|
-
indigo: "#4b0082",
|
|
194
|
-
ivory: "#fffff0",
|
|
195
|
-
khaki: "#f0e68c",
|
|
196
|
-
lavender: "#e6e6fa",
|
|
197
|
-
lavenderblush: "#fff0f5",
|
|
198
|
-
lawngreen: "#7cfc00",
|
|
199
|
-
lemonchiffon: "#fffacd",
|
|
200
|
-
lightblue: "#add8e6",
|
|
201
|
-
lightcoral: "#f08080",
|
|
202
|
-
lightcyan: "#e0ffff",
|
|
203
|
-
lightgoldenrodyellow: "#fafad2",
|
|
204
|
-
lightgrey: "#d3d3d3",
|
|
205
|
-
lightgreen: "#90ee90",
|
|
206
|
-
lightpink: "#ffb6c1",
|
|
207
|
-
lightsalmon: "#ffa07a",
|
|
208
|
-
lightseagreen: "#20b2aa",
|
|
209
|
-
lightskyblue: "#87cefa",
|
|
210
|
-
lightslategray: "#778899",
|
|
211
|
-
lightsteelblue: "#b0c4de",
|
|
212
|
-
lightyellow: "#ffffe0",
|
|
213
|
-
lime: "#00ff00",
|
|
214
|
-
limegreen: "#32cd32",
|
|
215
|
-
linen: "#faf0e6",
|
|
216
|
-
magenta: "#ff00ff",
|
|
217
|
-
maroon: "#800000",
|
|
218
|
-
mediumaquamarine: "#66cdaa",
|
|
219
|
-
mediumblue: "#0000cd",
|
|
220
|
-
mediumorchid: "#ba55d3",
|
|
221
|
-
mediumpurple: "#9370d8",
|
|
222
|
-
mediumseagreen: "#3cb371",
|
|
223
|
-
mediumslateblue: "#7b68ee",
|
|
224
|
-
mediumspringgreen: "#00fa9a",
|
|
225
|
-
mediumturquoise: "#48d1cc",
|
|
226
|
-
mediumvioletred: "#c71585",
|
|
227
|
-
midnightblue: "#191970",
|
|
228
|
-
mintcream: "#f5fffa",
|
|
229
|
-
mistyrose: "#ffe4e1",
|
|
230
|
-
moccasin: "#ffe4b5",
|
|
231
|
-
navajowhite: "#ffdead",
|
|
232
|
-
navy: "#000080",
|
|
233
|
-
oldlace: "#fdf5e6",
|
|
234
|
-
olive: "#808000",
|
|
235
|
-
olivedrab: "#6b8e23",
|
|
236
|
-
orange: "#ffa500",
|
|
237
|
-
orangered: "#ff4500",
|
|
238
|
-
orchid: "#da70d6",
|
|
239
|
-
palegoldenrod: "#eee8aa",
|
|
240
|
-
palegreen: "#98fb98",
|
|
241
|
-
paleturquoise: "#afeeee",
|
|
242
|
-
palevioletred: "#d87093",
|
|
243
|
-
papayawhip: "#ffefd5",
|
|
244
|
-
peachpuff: "#ffdab9",
|
|
245
|
-
peru: "#cd853f",
|
|
246
|
-
pink: "#ffc0cb",
|
|
247
|
-
plum: "#dda0dd",
|
|
248
|
-
powderblue: "#b0e0e6",
|
|
249
|
-
purple: "#800080",
|
|
250
|
-
rebeccapurple: "#663399",
|
|
251
|
-
red: "#ff0000",
|
|
252
|
-
rosybrown: "#bc8f8f",
|
|
253
|
-
royalblue: "#4169e1",
|
|
254
|
-
saddlebrown: "#8b4513",
|
|
255
|
-
salmon: "#fa8072",
|
|
256
|
-
sandybrown: "#f4a460",
|
|
257
|
-
seagreen: "#2e8b57",
|
|
258
|
-
seashell: "#fff5ee",
|
|
259
|
-
sienna: "#a0522d",
|
|
260
|
-
silver: "#c0c0c0",
|
|
261
|
-
skyblue: "#87ceeb",
|
|
262
|
-
slateblue: "#6a5acd",
|
|
263
|
-
slategray: "#708090",
|
|
264
|
-
snow: "#fffafa",
|
|
265
|
-
springgreen: "#00ff7f",
|
|
266
|
-
steelblue: "#4682b4",
|
|
267
|
-
tan: "#d2b48c",
|
|
268
|
-
teal: "#008080",
|
|
269
|
-
thistle: "#d8bfd8",
|
|
270
|
-
tomato: "#ff6347",
|
|
271
|
-
turquoise: "#40e0d0",
|
|
272
|
-
violet: "#ee82ee",
|
|
273
|
-
wheat: "#f5deb3",
|
|
274
|
-
white: "#ffffff",
|
|
275
|
-
whitesmoke: "#f5f5f5",
|
|
276
|
-
yellow: "#ffff00",
|
|
277
|
-
yellowgreen: "#9acd32"
|
|
278
|
-
};
|
|
279
|
-
if (colours[color.toLowerCase()]) return colours[color.toLowerCase()];
|
|
280
|
-
return color;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
export {$9baf0c6b8de436d9$export$cc9d030424d53c6d as saveHost, $9baf0c6b8de436d9$export$f5d1cbac23428e02 as simpleObjectCompare, $9baf0c6b8de436d9$export$62f58f44692b37a8 as formatItem, $9baf0c6b8de436d9$export$398604a469f7de9a as compare, $9baf0c6b8de436d9$export$3145210430358e7 as anyInAny, $9baf0c6b8de436d9$export$15b0b9b385c1f78e as lesserOf, $9baf0c6b8de436d9$export$e375dfe918aae343 as largerOf, $9baf0c6b8de436d9$export$f7bac52274eacccb as archiveRecord, $9baf0c6b8de436d9$export$b6b6e72408f809e2 as refPathToBaseRecord, $9baf0c6b8de436d9$export$adf7c0fe6059d774 as bound, $9baf0c6b8de436d9$export$884089555def93f8 as blindPush, $9baf0c6b8de436d9$export$7fecbbe7deb1a058 as addToArrayObject, $9baf0c6b8de436d9$export$36538c15a30486a1 as makeHexAsNeeded};
|
|
285
|
-
//# sourceMappingURL=InventoryLogic.35827495.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;AAAA;;;;CAIC;;;;AAWD,uCAAuC;AAEvC,CAAA,GAAA,YAAI,EAAE,MAAM,CAAC,CAAA,GAAA,iCAAY;AACzB,CAAA,GAAA,YAAI,EAAE,MAAM,CAAC,CAAA,GAAA,kCAAa;AAOnB,eAAe,0CAAS,IAAI,EAAE,QAAQ,IAAI;IAC/C,OAAO,CAAA,GAAA,gBAAQ,EAAE,MAAM;AACzB;AASO,SAAS,0CAAoB,OAAO,EAAE,OAAO;IAClD,IAAI,SAAS,OAAO,IAAI,CAAC,SAAS,MAAM,CAAC,CAAC,YAAY;QACpD,2BAA2B;QAC3B,OAAO,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,GAAG,aAAa;IACrD,GAAG,OAAO,mCAAmC;IAC7C,OAAO;AACT;AAUO,SAAS,0CAAW,UAAU,EAAE,UAAU;IAC/C,IAAI,QAAQ,WAAW,OAAO,CAC5B,UACA,SAAU,KAAK;QACb,IAAI,WAAW,MAAM,KAAK,CAAC,GAAG;QAC9B,6DAA6D;QAC7D,IAAI,aAAa,SAAS,KAAK,CAAC;QAChC,IAAI,CAAC,WAAW,WAAW,GAAG;QAC9B,IAAI,aAAa,UAAU,KAAK,CAAC;QACjC,sDAAsD;QACtD,MAAM,MAAM,WAAW,MAAM,CAAC,CAAC,YAAY;YACzC,OAAO,UAAU,CAAC,SAAS;QAC7B,GAAG;QACH,OAAO,MAAM,oCAAc,KAAK,cAAc;IAChD;IAEF,OAAO;AACT;AAEA;;;;;CAKC,GACD,SAAS,oCAAc,KAAK,EA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,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,YAAY;QACZ,cAAc;QACd,cAAc;QACd,gBAAgB;QAChB,iBAAiB;QACjB,mBAAmB;QACnB,iBAAiB;QACjB,iBAAiB;QACjB,cAAc;QACd,WAAW;QACX,WAAW;QACX,UAAU;QACV,aAAa;QACb,MAAM;QACN,SAAS;QACT,OAAO;QACP,WAAW;QACX,QAAQ;QACR,WAAW;QACX,QAAQ;QACR,eAAe;QACf,WAAW;QACX,eAAe;QACf,eAAe;QACf,YAAY;QACZ,WAAW;QACX,MAAM;QACN,MAAM;QACN,MAAM;QACN,YAAY;QACZ,QAAQ;QACR,eAAe;QACf,KAAK;QACL,WAAW;QACX,WAAW;QACX,aAAa;QACb,QAAQ;QACR,YAAY;QACZ,UAAU;QACV,UAAU;QACV,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,WAAW;QACX,WAAW;QACX,MAAM;QACN,aAAa;QACb,WAAW;QACX,KAAK;QACL,MAAM;QACN,SAAS;QACT,QAAQ;QACR,WAAW;QACX,QAAQ;QACR,OAAO;QACP,OAAO;QACP,YAAY;QACZ,QAAQ;QACR,aAAa;IACf;IAEA,IAAI,OAAO,CAAC,MAAM,WAAW,GAAG,EAAE,OAAO,OAAO,CAAC,MAAM,WAAW,GAAG;IACrE,OAAO;AACT","sources":["business/Utilities/other.js"],"sourcesContent":["/**\n * Typedefs, constants, support functions and database operations for\n * general Utilities\n * @module Utilities\n */\nimport dayjs from \"dayjs\";\n//import promisePool from \"es6-promise-pool\";\nimport isSameOrAfter from \"dayjs/plugin/isSameOrAfter.js\";\nimport isSameOrBefore from \"dayjs/plugin/isSameOrBefore.js\";\nimport {\n fetchRecordByRefPath,\n runTransaction,\n writeBack,\n deleteRecordByRefPath,\n} from \"@leaddreamer/firebase-wrapper\";\n//the following inits the dayjs plugins\n\ndayjs.extend(isSameOrAfter);\ndayjs.extend(isSameOrBefore);\n\n/**\n * A convenience function for some shared artist/host front-end pages\n * @param {OrganizationType} host\n * @returns {Promise.OrganizationType}\n */\nexport async function saveHost(host, batch = null) {\n return writeBack(host, batch);\n}\n\n/**\n * Simple top-level object compare - assumes objects have similar structure - or\n * AT LEAST all the fields of object1 are present in object2\n * @param {object} object1\n * @param {object} object2\n * @returns {boolean}\n */\nexport function simpleObjectCompare(object1, object2) {\n let result = Object.keys(object1).reduce((accumulate, key) => {\n // eslint-disable-next-line\n return object1[key] == object2[key] ? accumulate : false;\n }, true); // note simple (not object) compare\n return result;\n}\n\n/**\n * Allows string substitution from an object\n * field names support Dot notation\n * field names allow \":\" extension for alternate formatting\n * @param {object} thisItem - object to create formated string from\n * @param {string} thisFormat - string describing formatted output - fieldname wrapped in {} will be substituted. DOT notation allowed for fields.\n * @returns {string}\n */\nexport function formatItem(thisObject, thisFormat) {\n let final = thisFormat.replace(\n /{.+?}/g, //global, non-greedy - i.e. multiple {} bracketed elements\n function (field) {\n let fieldRaw = field.slice(1, -1);\n //below allows for DOT notation access within the item object\n let fieldparts = fieldRaw.split(\":\");\n let [fieldname, fieldStyle] = fieldparts;\n let fieldArray = fieldname.split(\".\");\n //below walks into an object - note: ASSUMES an object\n const bob = fieldArray.reduce((lastObject, nextName) => {\n return lastObject[nextName];\n }, thisObject);\n return bob ? specialFormat(bob, fieldStyle) : \"----\";\n }\n );\n return final;\n}\n\n/**\n * @private\n * @param {any} value\n * @param {!string} style\n * @returns {any|string}\n */\nfunction specialFormat(value, style) {\n switch (style) {\n case \"timestamp\":\n return dayjs(value.toDate()).format(\"MMM DD, YYYY\");\n default:\n return value;\n }\n}\n\n/**\n * @param {object} thisItem - one of two objects being compared\n * @param {object} anotherItem - the other of two objects being compared\n * @param {!string} sort - string describing sort - format \"fieldName:sortType\" - sort Type is \"string, \"date\" or \"number\" (default)\n * @return {string}\n */\nexport function compare(thisItem, anotherItem, sort = \"Id:number\") {\n let [field, type] = sort.split(\":\");\n type = type ? type : \"number\";\n switch (type) {\n case \"string\":\n let nameArray = thisItem[field].split(\"The \");\n let anotherArray = anotherItem[field].split(\"The \");\n return (nameArray[0] ? nameArray[0] : nameArray[1]).localeCompare(\n anotherArray[0] ? anotherArray[0] : anotherArray[1]\n );\n\n case \"date\":\n //if (!thisItem[field] || !anotherItem[field]) return 0;\n return !thisItem[field] ||\n dayjs(thisItem[field]).isBefore(anotherItem[field], \"day\")\n ? -1\n : anotherItem[field] &&\n dayjs(thisItem[field]).isSame(anotherItem[field], \"day\")\n ? 0\n : 1;\n\n default:\n return Number(thisItem[field]) - Number(anotherItem[field]);\n }\n}\n\n/**\n * An array based compare function - is any entry of findFrom present in findIn\n * @param {Array.any} findFrom\n * @param {Array.any} findIn\n * @returns {boolean}\n */\nexport function anyInAny(findFrom, findIn) {\n let mapFindIn = new Map();\n\n findIn.forEach((entry, index) => {\n mapFindIn.set(entry, true);\n }); //speed up by avoiding second loop\n\n const findFromLength = findFrom.length;\n let found = false;\n for (\n let findFromIndex = 0;\n findFromIndex < findFromLength && !found;\n findFromIndex++\n )\n if (\n mapFindIn.get(findFrom[findFromIndex].valueOf())\n //findFrom[findFromIndex].valueOf() === findIn[arrayTwoIndex].valueOf()\n )\n found = true; //note this breaks both loops\n\n return found;\n}\n\n/**\n * A convenience function for legibility\n * @param {any} args unbounded list of arguments\n * @returns {number} the least of any of the arguments\nb */\nexport function lesserOf(...args) {\n return Math.min(...args);\n}\n\n/**\n * @param {any} args unbounded list of arguments\n * @returns {number} the largest of any of the arguments\n */\nexport function largerOf(...args) {\n return Math.max(...args);\n}\n\n/**\n * \"Moves\" a record from our standard tree structureto a parallel archival\n * structure, by prepending a \"_\" to the collection names in the path\n * This prevents the archived record from appearing in collectionGroup queries\n * @param {RecordDocument} record\n * @param {!string} record.refPath\n * @returns {Promise}\n */\nexport async function archiveRecord(record) {\n //split the reference path into it's constituent parts\n const parts = record.refPath.split(\"/\");\n const partsCount = parts.length;\n if (Math.floor(partsCount / 2) * 2 !== partsCount) {\n //throw \"safe\" error\n return; //returns a null promise resolved\n }\n\n let archivePath = \"\";\n let index = 0;\n //adde a \"_\" to the start of every collection named in the path\n //this avoids collectionGroup issues, but follows a parallel path\n do {\n archivePath = `${archivePath}/_${parts[index]}/${parts[index + 1]}`;\n index += 2;\n } while (index < partsCount);\n await runTransaction(async (batch) => {\n //////////////////////////////\n //Read a current full copy of the record\n const realRecord = await fetchRecordByRefPath(record.refPath, batch);\n //Write it to the \"archivePath\"\n await writeBack({ ...realRecord, refPath: archivePath }, batch);\n //delete the original copy\n await deleteRecordByRefPath(realRecord.refPath, batch);\n });\n}\n\n/**\n * uses a passed refPath to create the most basic document record form\n * @param {!string} refPath - \"/\" separated document path reference\n * @returns {RecordDocument}\n */\nexport function refPathToBaseRecord(refPath) {\n return {\n Id: refPath.split(\"/\").pop(),\n refPath: refPath,\n };\n}\n\n/**\n * clips value to given bounds\n * @param {number} value\n * @param {number} lowerBound\n * @param {number} upperBound\n * @returns {number}\n */\nexport function bound(value, lowerBound, upperBound) {\n return largerOf(lesserOf(value, upperBound), lowerBound);\n}\n\n/**\n * function to push an element to an array which may not be initialized\n * @param {Array.object} targetArray\n * @param {object} newObject\n * \n */\nexport function blindPush(targetArray, newObject) {\n targetArray\n ? targetArray.push(newObject)\n : (targetArray = [newObject]);\n return targetArray;\n}\n\n/**\n * @param {Array.Array.object} arrayObject\n * @param {string} key key or index to choose which Array.object to add *this* object to\n * @param {object} object\n */\nexport function addToArrayObject(arrayObject, key, object) {\n if (arrayObject[key] && arrayObject[key].length) {\n //if the key is already present, *and* there are already objects in the keyed array\n arrayObject[key].push(object); //push the object onto the indexed array\n } else {\n arrayObject[key] = [object];\n }\n}\n\n\n\n/**\n * @param {string} color name of color\n * @returns {string} hex value of named color\n */\nexport function makeHexAsNeeded(color) {\n var colours = {\n aliceblue: \"#f0f8ff\",\n antiquewhite: \"#faebd7\",\n aqua: \"#00ffff\",\n aquamarine: \"#7fffd4\",\n azure: \"#f0ffff\",\n beige: \"#f5f5dc\",\n bisque: \"#ffe4c4\",\n black: \"#000000\",\n blanchedalmond: \"#ffebcd\",\n blue: \"#0000ff\",\n blueviolet: \"#8a2be2\",\n brown: \"#a52a2a\",\n burlywood: \"#deb887\",\n cadetblue: \"#5f9ea0\",\n chartreuse: \"#7fff00\",\n chocolate: \"#d2691e\",\n coral: \"#ff7f50\",\n cornflowerblue: \"#6495ed\",\n cornsilk: \"#fff8dc\",\n crimson: \"#dc143c\",\n cyan: \"#00ffff\",\n darkblue: \"#00008b\",\n darkcyan: \"#008b8b\",\n darkgoldenrod: \"#b8860b\",\n darkgray: \"#a9a9a9\",\n darkgreen: \"#006400\",\n darkkhaki: \"#bdb76b\",\n darkmagenta: \"#8b008b\",\n darkolivegreen: \"#556b2f\",\n darkorange: \"#ff8c00\",\n darkorchid: \"#9932cc\",\n darkred: \"#8b0000\",\n darksalmon: \"#e9967a\",\n darkseagreen: \"#8fbc8f\",\n darkslateblue: \"#483d8b\",\n darkslategray: \"#2f4f4f\",\n darkturquoise: \"#00ced1\",\n darkviolet: \"#9400d3\",\n deeppink: \"#ff1493\",\n deepskyblue: \"#00bfff\",\n dimgray: \"#696969\",\n dodgerblue: \"#1e90ff\",\n firebrick: \"#b22222\",\n floralwhite: \"#fffaf0\",\n forestgreen: \"#228b22\",\n fuchsia: \"#ff00ff\",\n gainsboro: \"#dcdcdc\",\n ghostwhite: \"#f8f8ff\",\n gold: \"#ffd700\",\n goldenrod: \"#daa520\",\n gray: \"#808080\",\n green: \"#008000\",\n greenyellow: \"#adff2f\",\n honeydew: \"#f0fff0\",\n hotpink: \"#ff69b4\",\n \"indianred \": \"#cd5c5c\",\n indigo: \"#4b0082\",\n ivory: \"#fffff0\",\n khaki: \"#f0e68c\",\n lavender: \"#e6e6fa\",\n lavenderblush: \"#fff0f5\",\n lawngreen: \"#7cfc00\",\n lemonchiffon: \"#fffacd\",\n lightblue: \"#add8e6\",\n lightcoral: \"#f08080\",\n lightcyan: \"#e0ffff\",\n lightgoldenrodyellow: \"#fafad2\",\n lightgrey: \"#d3d3d3\",\n lightgreen: \"#90ee90\",\n lightpink: \"#ffb6c1\",\n lightsalmon: \"#ffa07a\",\n lightseagreen: \"#20b2aa\",\n lightskyblue: \"#87cefa\",\n lightslategray: \"#778899\",\n lightsteelblue: \"#b0c4de\",\n lightyellow: \"#ffffe0\",\n lime: \"#00ff00\",\n limegreen: \"#32cd32\",\n linen: \"#faf0e6\",\n magenta: \"#ff00ff\",\n maroon: \"#800000\",\n mediumaquamarine: \"#66cdaa\",\n mediumblue: \"#0000cd\",\n mediumorchid: \"#ba55d3\",\n mediumpurple: \"#9370d8\",\n mediumseagreen: \"#3cb371\",\n mediumslateblue: \"#7b68ee\",\n mediumspringgreen: \"#00fa9a\",\n mediumturquoise: \"#48d1cc\",\n mediumvioletred: \"#c71585\",\n midnightblue: \"#191970\",\n mintcream: \"#f5fffa\",\n mistyrose: \"#ffe4e1\",\n moccasin: \"#ffe4b5\",\n navajowhite: \"#ffdead\",\n navy: \"#000080\",\n oldlace: \"#fdf5e6\",\n olive: \"#808000\",\n olivedrab: \"#6b8e23\",\n orange: \"#ffa500\",\n orangered: \"#ff4500\",\n orchid: \"#da70d6\",\n palegoldenrod: \"#eee8aa\",\n palegreen: \"#98fb98\",\n paleturquoise: \"#afeeee\",\n palevioletred: \"#d87093\",\n papayawhip: \"#ffefd5\",\n peachpuff: \"#ffdab9\",\n peru: \"#cd853f\",\n pink: \"#ffc0cb\",\n plum: \"#dda0dd\",\n powderblue: \"#b0e0e6\",\n purple: \"#800080\",\n rebeccapurple: \"#663399\",\n red: \"#ff0000\",\n rosybrown: \"#bc8f8f\",\n royalblue: \"#4169e1\",\n saddlebrown: \"#8b4513\",\n salmon: \"#fa8072\",\n sandybrown: \"#f4a460\",\n seagreen: \"#2e8b57\",\n seashell: \"#fff5ee\",\n sienna: \"#a0522d\",\n silver: \"#c0c0c0\",\n skyblue: \"#87ceeb\",\n slateblue: \"#6a5acd\",\n slategray: \"#708090\",\n snow: \"#fffafa\",\n springgreen: \"#00ff7f\",\n steelblue: \"#4682b4\",\n tan: \"#d2b48c\",\n teal: \"#008080\",\n thistle: \"#d8bfd8\",\n tomato: \"#ff6347\",\n turquoise: \"#40e0d0\",\n violet: \"#ee82ee\",\n wheat: \"#f5deb3\",\n white: \"#ffffff\",\n whitesmoke: \"#f5f5f5\",\n yellow: \"#ffff00\",\n yellowgreen: \"#9acd32\",\n };\n\n if (colours[color.toLowerCase()]) return colours[color.toLowerCase()];\n return color;\n}\n"],"names":[],"version":3,"file":"InventoryLogic.35827495.js.map"}
|