your-ai-workflow-firebase-os 2.0.2 → 2.0.3
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/AccessNotice-BZ5Gt1nP.js +40 -0
- package/dist/AccessNotice-CN7kc70o.cjs +1 -0
- package/dist/{AddressField-B2YBRXcx.js → AddressField-9Sqn8TvC.js} +3 -3
- package/dist/{AddressField-BBv8NGX8.cjs → AddressField-B7wtV8yA.cjs} +1 -1
- package/dist/Assets-DBMwZ3bN.cjs +1 -0
- package/dist/Assets-DT-NU_WO.js +296 -0
- package/dist/Attachments-Bl9_dfsu.js +46 -0
- package/dist/Attachments-UVK9SRXf.cjs +1 -0
- package/dist/Billing-0RIHayHy.cjs +1 -0
- package/dist/Billing-FNE2r3_d.js +379 -0
- package/dist/BookingCalendar-BP5kiv3d.cjs +1 -0
- package/dist/BookingCalendar-DZ2fEFja.js +309 -0
- package/dist/Button-4lzOE31p.js +48 -0
- package/dist/Button-5DlB2MCi.cjs +1 -0
- package/dist/CalendarView-BimoXy_k.cjs +1 -0
- package/dist/CalendarView-D-ykjpvI.js +664 -0
- package/dist/ConfirmModal-Di9GR-vV.cjs +1 -0
- package/dist/ConfirmModal-gKQEpd4d.js +113 -0
- package/dist/ContactPopup-BXnHrRwl.js +1114 -0
- package/dist/ContactPopup-lxmRMoIa.cjs +1 -0
- package/dist/CopyLink-BpEQWmfI.cjs +1 -0
- package/dist/CopyLink-CBAVfcm1.js +43 -0
- package/dist/DashboardNav-CXa_ci-_.cjs +1 -0
- package/dist/DashboardNav-Dmn7PVSp.js +886 -0
- package/dist/EmailAdmin-CjN_rvxT.js +318 -0
- package/dist/EmailAdmin-lAEBdY1s.cjs +1 -0
- package/dist/EventCard-46EquygT.cjs +1 -0
- package/dist/EventCard-B6xD-mk3.js +97 -0
- package/dist/FileViewerPopup-CX-J75TM.js +1283 -0
- package/dist/FileViewerPopup-D8-MmIoS.cjs +3 -0
- package/dist/FormNote-BivRNA3J.js +50 -0
- package/dist/FormNote-BtdTGpml.cjs +1 -0
- package/dist/FormsAdmin-B5PBCG2W.js +812 -0
- package/dist/FormsAdmin-BQCULvi5.cjs +1 -0
- package/dist/Inbox-BPk2ZkE5.js +779 -0
- package/dist/Inbox-DNrcBx0o.cjs +3 -0
- package/dist/Loader-Bu89fsbB.cjs +1 -0
- package/dist/Loader-D4gwgBOq.js +32 -0
- package/dist/ManagePlanButton-B0dwqZBd.cjs +1 -0
- package/dist/ManagePlanButton-BSrOHYze.js +29 -0
- package/dist/MyBookings-6qr0GgzO.cjs +1 -0
- package/dist/MyBookings-BQjGM2LQ.js +113 -0
- package/dist/PageTitle-CZhgmmDT.cjs +3 -0
- package/dist/PageTitle-D93YCiN8.js +1606 -0
- package/dist/PagesAdmin-BcHIcqM5.cjs +34 -0
- package/dist/PagesAdmin-D69P9nRb.js +5802 -0
- package/dist/PagesAdmin-DNwZOKjA.cjs +1 -0
- package/dist/PagesAdmin-HUITEcHx.js +3 -0
- package/dist/PaymentsAdmin-C2iCI9qC.js +1291 -0
- package/dist/PaymentsAdmin-CoXi2vCm.cjs +2 -0
- package/dist/{PhoneInputField-B3P_vUDW.cjs → PhoneInputField-BEwYZMB7.cjs} +1 -1
- package/dist/{PhoneInputField-D3wWs-M8.js → PhoneInputField-BG0L2djE.js} +2 -2
- package/dist/PhoneInputField-DfOtCIH_.js +2 -0
- package/dist/{PhoneInputField-CdNTvWXQ.cjs → PhoneInputField-jhWvto8C.cjs} +1 -1
- package/dist/Popup-DHYGFl2-.cjs +1 -0
- package/dist/Popup-xROLytgr.js +142 -0
- package/dist/ProviderMark-BBfaM5Yl.js +52 -0
- package/dist/ProviderMark-xLkUN3Fx.cjs +1 -0
- package/dist/PublishApp-Bm-6r3Td.js +595 -0
- package/dist/PublishApp-D4XJUkJa.cjs +2 -0
- package/dist/Said-CoC15awL.js +94 -0
- package/dist/Said-IqCNofdh.cjs +1 -0
- package/dist/ScheduleAdmin-BKfQkrR8.js +1853 -0
- package/dist/ScheduleAdmin-DwK36GAZ.cjs +1 -0
- package/dist/SchedulePicker--urIH2Eb.js +112 -0
- package/dist/SchedulePicker-nmqzUnUH.cjs +1 -0
- package/dist/Setup-CHLgd-ag.js +849 -0
- package/dist/Setup-CaDranTm.cjs +1374 -0
- package/dist/SetupPayments-CVIwh1eQ.js +411 -0
- package/dist/SetupPayments-HNXWA25X.cjs +1 -0
- package/dist/SignInAdmin-C94-A-0w.cjs +4 -0
- package/dist/SignInAdmin-Yxgv_8U4.js +766 -0
- package/dist/SupportBar-CDT0HwdP.cjs +1 -0
- package/dist/SupportBar-CN_JGC-9.js +117 -0
- package/dist/SystemTabContent-L3vGGF3P.cjs +1 -0
- package/dist/SystemTabContent-QdxxLILE.js +35 -0
- package/dist/TemplateDrive-DV8zNjYe.cjs +1 -0
- package/dist/TemplateDrive-NJY_AAvV.js +1197 -0
- package/dist/ThemeAdmin-BzFjJkLg.js +269 -0
- package/dist/ThemeAdmin-DVnPNxe7.cjs +1 -0
- package/dist/ThemeAdmin-DY7Vc4Sj.cjs +3 -0
- package/dist/ThemeAdmin-DnC-D2N3.js +2 -0
- package/dist/{ContactPopup-Dsg2ntq3.js → TimeZoneField-DkI1Bkcz.js} +3191 -5322
- package/dist/TimeZoneField-qs7NPR30.cjs +12 -0
- package/dist/TransactionsAdmin-BsZ-oQWi.js +582 -0
- package/dist/TransactionsAdmin-CTSTiPld.cjs +1 -0
- package/dist/Trouble-9es_AI4F.cjs +1 -0
- package/dist/Trouble-oWt9fMsm.js +164 -0
- package/dist/Users-CTitWXyd.cjs +1 -0
- package/dist/Users-DJjQTWJF.js +1207 -0
- package/dist/aiModels-DIP9fn8T.cjs +1 -0
- package/dist/{aiModels-BHlEfuRJ.js → aiModels-DnDhNGup.js} +29 -61
- package/dist/arrivalRoads-BJ-35vkk.js +228 -0
- package/dist/arrivalRoads-qoU-B4jt.cjs +4 -0
- package/dist/{bake-BWG3y-15.cjs → bake-n2wyFw0B.cjs} +1 -1
- package/dist/{bake-BtYOG1Du.js → bake-naZeMu98.js} +1 -1
- package/dist/bookingPages-C7a3srPG.js +102 -0
- package/dist/bookingPages-DvbFbD9X.cjs +1 -0
- package/dist/components/CustomSelect.d.ts +7 -1
- package/dist/components/RegistrationFields.d.ts +6 -1
- package/dist/components/Reveal.d.ts +12 -0
- package/dist/components/ScrollToTop.d.ts +4 -0
- package/dist/contentFallback-C9MZjdq7.cjs +1 -0
- package/dist/contentFallback-CEDY0Pwp.js +96 -0
- package/dist/contentKey-Bwry4lDa.js +13 -0
- package/dist/contentKey-DJGYYnAE.cjs +1 -0
- package/dist/email-BfnZnMwD.cjs +1 -0
- package/dist/email-Ddj8Dlu6.js +58 -0
- package/dist/{fileBytes-BdwaFKRy.cjs → fileBytes-BJPaiX9Y.cjs} +1 -1
- package/dist/{fileBytes-DuW2K-H_.js → fileBytes-bjgvCfWu.js} +2 -2
- package/dist/forms-Bvx9HTM6.js +75 -0
- package/dist/forms-CmNeTETW.cjs +1 -0
- package/dist/lib/ThemeContext.d.ts +0 -14
- package/dist/lib/bareImgWatch.d.ts +6 -1
- package/dist/lib/localEdits.d.ts +2 -0
- package/dist/lib/paymentProducts.d.ts +8 -0
- package/dist/lib/payments.d.ts +11 -1
- package/dist/notices-B7iIrIEg.js +29 -0
- package/dist/notices-upMg8UVh.cjs +1 -0
- package/dist/openOnArrival-Buwqb86D.cjs +1 -0
- package/dist/openOnArrival-S2K6v-lB.js +35 -0
- package/dist/pageFiles--Ih60ITP.js +45 -0
- package/dist/pageFiles-UtBmlOcD.cjs +1 -0
- package/dist/pages/PagesAdmin.d.ts +69 -0
- package/dist/people-2jZE_pdI.js +102 -0
- package/dist/people-BpVvIr9-.cjs +1 -0
- package/dist/personName-CFw3pxuu.js +18 -0
- package/dist/personName-CbzN_i57.cjs +1 -0
- package/dist/publishSteps-C1cDFzzB.js +88 -0
- package/dist/publishSteps-SSm8afDw.cjs +1 -0
- package/dist/recordLock-DHVvI9bP.js +61 -0
- package/dist/recordLock-DWeIxiwh.cjs +1 -0
- package/dist/recordsKey-B7QrxdeU.cjs +1 -0
- package/dist/recordsKey-D5-wC0Aw.js +141 -0
- package/dist/registrationFields-CLeR2lQJ.js +181 -0
- package/dist/registrationFields-v4pOoRdn.cjs +1 -0
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.es.js +1 -1
- package/dist/roles-D6VaHWfV.js +147 -0
- package/dist/roles-DQUFFBQe.cjs +1 -0
- package/dist/scheduleData-ATN8w5hI.js +727 -0
- package/dist/scheduleData-Cltj0ABZ.cjs +1 -0
- package/dist/server.cjs.js +6 -6
- package/dist/server.es.js +716 -715
- package/dist/serviceStatus-TQyZO_Y_.cjs +1 -0
- package/dist/serviceStatus-vS8AI7SZ.js +125 -0
- package/dist/tabAudience-BqpN6dsR.cjs +1 -0
- package/dist/tabAudience-CRyMvv0v.js +34 -0
- package/dist/transactions-BqMQDRx3.js +343 -0
- package/dist/transactions-CufFrdAM.cjs +1 -0
- package/dist/useIsPhone-BVGx_X3e.js +13 -0
- package/dist/useIsPhone-o63tNneA.cjs +1 -0
- package/dist/{validate-DzSJWuyL.js → validate-CmC_tLK-.js} +433 -351
- package/dist/validate-DZMwqSrb.cjs +103 -0
- package/dist/vite/validate.d.ts +14 -0
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.es.js +1 -1
- package/dist/your-ai-workflow-firebase-os.cjs.js +15 -1431
- package/dist/your-ai-workflow-firebase-os.css +1 -1
- package/dist/your-ai-workflow-firebase-os.es.js +8200 -32421
- package/package.json +1 -1
- package/src/index.css +122 -2
- package/dist/ContactPopup-IwBm-eqz.cjs +0 -12
- package/dist/PhoneInputField-CVamkTJg.js +0 -2
- package/dist/aiModels-BIhoTNH0.cjs +0 -1
- package/dist/validate-e48WXJdP.cjs +0 -103
- /package/dist/{address-DI1YaCI4.cjs → address-Bsb8COq2.cjs} +0 -0
- /package/dist/{address-Ca1h_UZX.js → address-C2bHNxJU.js} +0 -0
- /package/dist/{dist-BkUiTtIb.js → dist-DUPvBnOA.js} +0 -0
- /package/dist/{dist-BLGlDv1e.cjs → dist-E4jTFPs7.cjs} +0 -0
- /package/dist/{lucide-react-BYniZ3lQ.cjs → lucide-react-BwV6L6Is.cjs} +0 -0
- /package/dist/{lucide-react-ehRy1vqS.js → lucide-react-CA7GD7Nv.js} +0 -0
- /package/dist/{mediaKind-dk396a03.cjs → mediaKind-D0MWyv6b.cjs} +0 -0
- /package/dist/{mediaKind-De2Cx_kB.js → mediaKind-DmKMsjeY.js} +0 -0
- /package/dist/{pdf-u73U7-6s.js → pdf-DRXcPGkr.js} +0 -0
- /package/dist/{pdf-B24jYmSf.cjs → pdf-jLjjhvjp.cjs} +0 -0
- /package/dist/{pdf.worker.min-BPOWx2_9.js → pdf.worker.min-CfKZezeM.js} +0 -0
- /package/dist/{pdf.worker.min-BvhEiZFe.cjs → pdf.worker.min-bLgNWd7w.cjs} +0 -0
- /package/dist/{verifiedAccount-C1iCxopN.js → verifiedAccount-DRbRFJ6H.js} +0 -0
- /package/dist/{verifiedAccount-D3OeaOBo.cjs → verifiedAccount-DScyKk96.cjs} +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Ln as e, ja as t } from "./TimeZoneField-DkI1Bkcz.js";
|
|
2
|
+
import { f as n, v as r } from "./mediaKind-DmKMsjeY.js";
|
|
3
|
+
import { deleteObject as i, ref as a } from "firebase/storage";
|
|
4
|
+
//#region src/lib/pageFiles.ts
|
|
5
|
+
var o = (e) => `${e}files`, s = "case_files", c = (e, t) => e && t ? `${s}/${e}/${t}` : "";
|
|
6
|
+
function l(e) {
|
|
7
|
+
let t = /^https?:\/\/[^?#\s]*\/v0\/b\/[^/]+\/o\/([^?#\s]+)/.exec(e);
|
|
8
|
+
if (!t) return "";
|
|
9
|
+
try {
|
|
10
|
+
return decodeURIComponent(t[1]);
|
|
11
|
+
} catch {
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
var u = (e) => {
|
|
16
|
+
let t = String(e || "").split("/");
|
|
17
|
+
return t.length === 2 && /^[a-z][a-z0-9]*_files$/.test(t[0]) && t[0] !== "case_files" ? t[0] : "";
|
|
18
|
+
}, d = (t) => u(t) === e, f = /^[a-z][a-z0-9_]*_(files|uploads)\//;
|
|
19
|
+
function p(e, t = 5) {
|
|
20
|
+
let n = /* @__PURE__ */ new Set(), r = (e, t) => {
|
|
21
|
+
if (typeof e == "string") {
|
|
22
|
+
let t = l(e) || (f.test(e) ? e : "");
|
|
23
|
+
t && n.add(t);
|
|
24
|
+
} else t > 0 && Array.isArray(e) ? e.forEach((e) => r(e, t - 1)) : t > 0 && e && typeof e == "object" && Object.values(e).forEach((e) => r(e, t - 1));
|
|
25
|
+
};
|
|
26
|
+
return r(e, t), [...n];
|
|
27
|
+
}
|
|
28
|
+
function m(e, t) {
|
|
29
|
+
let n = /* @__PURE__ */ new Set(), r = (e) => e.startsWith(`${t}/`) && e.length > t.length + 1, i = (e, t) => {
|
|
30
|
+
if (typeof e == "string") {
|
|
31
|
+
let t = r(e) ? e : l(e);
|
|
32
|
+
r(t) && n.add(t);
|
|
33
|
+
} else t < 2 && Array.isArray(e) ? e.forEach((e) => i(e, t + 1)) : t < 2 && e && typeof e == "object" && Object.values(e).forEach((e) => i(e, t + 1));
|
|
34
|
+
};
|
|
35
|
+
return i(e, 0), [...n];
|
|
36
|
+
}
|
|
37
|
+
async function h(e, o, s) {
|
|
38
|
+
if (!e) return;
|
|
39
|
+
let c = new Set(o.filter((t) => t.id !== e.id).flatMap((e) => m(e, s))), l = m(e, s).filter((e) => !c.has(e));
|
|
40
|
+
await Promise.all([...l.map((e) => i(a(t, e)).catch((t) => {
|
|
41
|
+
console.warn(`${e}: the record is gone but its file stayed (${t?.code || t}).`);
|
|
42
|
+
})), ...l.flatMap((e) => [r(e), n(e)]).filter(Boolean).map((e) => i(a(t, e)).catch(() => {}))]);
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { m as a, p as c, o as i, c as n, h as o, d as r, l as s, u as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-qs7NPR30.cjs`),t=require(`./mediaKind-D0MWyv6b.cjs`);let n=require(`firebase/storage`);var r=e=>`${e}files`,i=`case_files`,a=(e,t)=>e&&t?`${i}/${e}/${t}`:``;function o(e){let t=/^https?:\/\/[^?#\s]*\/v0\/b\/[^/]+\/o\/([^?#\s]+)/.exec(e);if(!t)return``;try{return decodeURIComponent(t[1])}catch{return``}}var s=e=>{let t=String(e||``).split(`/`);return t.length===2&&/^[a-z][a-z0-9]*_files$/.test(t[0])&&t[0]!==`case_files`?t[0]:``},c=t=>s(t)===e.Ln,l=/^[a-z][a-z0-9_]*_(files|uploads)\//;function u(e,t=5){let n=new Set,r=(e,t)=>{if(typeof e==`string`){let t=o(e)||(l.test(e)?e:``);t&&n.add(t)}else t>0&&Array.isArray(e)?e.forEach(e=>r(e,t-1)):t>0&&e&&typeof e==`object`&&Object.values(e).forEach(e=>r(e,t-1))};return r(e,t),[...n]}function d(e,t){let n=new Set,r=e=>e.startsWith(`${t}/`)&&e.length>t.length+1,i=(e,t)=>{if(typeof e==`string`){let t=r(e)?e:o(e);r(t)&&n.add(t)}else t<2&&Array.isArray(e)?e.forEach(e=>i(e,t+1)):t<2&&e&&typeof e==`object`&&Object.values(e).forEach(e=>i(e,t+1))};return i(e,0),[...n]}async function f(r,i,a){if(!r)return;let o=new Set(i.filter(e=>e.id!==r.id).flatMap(e=>d(e,a))),s=d(r,a).filter(e=>!o.has(e));await Promise.all([...s.map(t=>(0,n.deleteObject)((0,n.ref)(e.ja,t)).catch(e=>{console.warn(`${t}: the record is gone but its file stayed (${e?.code||e}).`)})),...s.flatMap(e=>[t.v(e),t.f(e)]).filter(Boolean).map(t=>(0,n.deleteObject)((0,n.ref)(e.ja,t)).catch(()=>{}))])}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
|
@@ -80,6 +80,12 @@ export declare const groupsNamed: (text: string, roles?: CustomRole[]) => string
|
|
|
80
80
|
* or they name one and keep something from it.
|
|
81
81
|
*/
|
|
82
82
|
export declare const mentionsAudienceSplit: (text: string, roles?: CustomRole[]) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Words that say each person SEES ONLY what is assigned to them — the one
|
|
85
|
+
* reading of "assigned" that makes a record one person's own. "Edit the ones
|
|
86
|
+
* assigned to them" and "who it is assigned to" on a shared board do not.
|
|
87
|
+
*/
|
|
88
|
+
export declare const SEES_ONLY_ASSIGNED: RegExp;
|
|
83
89
|
/**
|
|
84
90
|
* The lines that say how the page is divided between groups — only when the
|
|
85
91
|
* owner's words divide it, and only on a page where the answer differs by
|
|
@@ -233,6 +239,15 @@ export declare const DELETE_LOCK_OFF_LINE = "Anybody who can change a record on
|
|
|
233
239
|
export declare const DELETE_NONE_LINE = "Nothing on this page may be deleted \u2014 not by me, not by my admins, not by anybody. My app enforces it: every record saved through actions.saveRecord carries a lock my database honours. So never draw a Delete, a Remove, a bin or any other way of throwing a record away here \u2014 actions.canDelete(record) is false for everybody on this page, and you never decide it from a role yourself. Changing a record is not deleting it \u2014 everybody who could change one still can.";
|
|
234
240
|
export declare const DELETE_NONE_ON_LINE = "From now on nothing on this page may be deleted \u2014 not by me, not by my admins, not by anybody. My app has locked every record: take away every Delete, Remove and bin this page has, and never draw one again. Changing a record is not deleting it \u2014 everybody who could change one still can. Change nothing else.";
|
|
235
241
|
/** The switch, said in the first sentence — wherever it is on the row, and only what it says. */
|
|
242
|
+
/** Words that say something on the page is thrown away — beside a switch that says nobody may. */
|
|
243
|
+
export declare const DELETE_WORDS: RegExp;
|
|
244
|
+
/**
|
|
245
|
+
* The line under Who may delete: the answer's own hint — or, while no answer
|
|
246
|
+
* was given and the owner's words throw things away, that the two disagree.
|
|
247
|
+
* "A draft can be deleted" beside a row that never answered got a sentence
|
|
248
|
+
* saying nothing on the page may be deleted, by anybody (2026-09-24).
|
|
249
|
+
*/
|
|
250
|
+
export declare const deleteByHint: (config: any) => string;
|
|
236
251
|
export declare const deleteLockLines: (config: any) => string[];
|
|
237
252
|
/**
|
|
238
253
|
* Where the owner's words are silent, the DEFAULT — by the kind of page, and
|
|
@@ -735,6 +750,49 @@ export declare const variantLines: (words: string) => string[];
|
|
|
735
750
|
* the line below is an if, so a page that only shows one loses nothing.
|
|
736
751
|
*/
|
|
737
752
|
export declare const COUNT_WORDS: RegExp;
|
|
753
|
+
/**
|
|
754
|
+
* Words that move things through STAGES — a kanban, a pipeline, columns a
|
|
755
|
+
* card is dragged between, "from New to Done". Never the bare "board" (a
|
|
756
|
+
* notice board) or "stage" (at a venue): the words have to say things move.
|
|
757
|
+
*/
|
|
758
|
+
export declare const STAGE_WORDS: RegExp;
|
|
759
|
+
/**
|
|
760
|
+
* Things that move through stages are the app's own <Pipeline>. Said in the
|
|
761
|
+
* sentence and not only in the contract because the Products rehearsal
|
|
762
|
+
* (2026-09-22) showed what a piece named only there gets: HTML5 draggable,
|
|
763
|
+
* dead under a finger. Not on a preset (the board keeps its own) and not on
|
|
764
|
+
* a page of the website.
|
|
765
|
+
*/
|
|
766
|
+
export declare const pipelineLines: (config: any, words: string) => string[];
|
|
767
|
+
/**
|
|
768
|
+
* Words that put a PERSON from the team on a record — assigned to, handed
|
|
769
|
+
* to, who leads it, who is on it. Not the bare "lead": a pipeline of sales
|
|
770
|
+
* leads names nobody.
|
|
771
|
+
*/
|
|
772
|
+
export declare const TEAM_PEOPLE_WORDS: RegExp;
|
|
773
|
+
/**
|
|
774
|
+
* A person from the team ON a shared record — the assignee, the lead — and
|
|
775
|
+
* the picker they are chosen with. On a shared team or admins page the
|
|
776
|
+
* record is everybody's and the person is a FIELD on it: told only "assigned
|
|
777
|
+
* to them", the sentence used to send the page after a user_ collection
|
|
778
|
+
* keyed by the assignee's uid (the private page's shape), and the board the
|
|
779
|
+
* owner described became a drawer each colleague could not see into. The
|
|
780
|
+
* picker is named because the alternative a model reaches for is
|
|
781
|
+
* user_profiles read by hand, which every role but the team is refused.
|
|
782
|
+
*/
|
|
783
|
+
export declare const teamPeopleLines: (config: any, words: string) => string[];
|
|
784
|
+
/** Words that ask a card to say who made or changed a thing — "the lead's face", "who finished it", "created by". */
|
|
785
|
+
export declare const MADE_BY_WORDS: RegExp;
|
|
786
|
+
/** Who made or changed a record is already stamped on it, and <MadeBy> draws it. */
|
|
787
|
+
export declare const madeByLines: (config: any, words: string) => string[];
|
|
788
|
+
/**
|
|
789
|
+
* Words that ask for numbers DRAWN — a chart, a graph, "shown visually so I
|
|
790
|
+
* can see where the time goes". Narrower than CHART_WORDS on purpose: "make
|
|
791
|
+
* the workflow visual" is about a page's look, not a picture of numbers.
|
|
792
|
+
*/
|
|
793
|
+
export declare const DRAWN_NUMBERS_WORDS: RegExp;
|
|
794
|
+
/** Numbers drawn side by side are <Bars> — on a page whose own numbers they are, where no tally is being counted (tallyLines says it there). */
|
|
795
|
+
export declare const chartLines: (config: any, words: string) => string[];
|
|
738
796
|
/** A count is nudged with the app's own stepper, and saved once they stop — not on every press. */
|
|
739
797
|
export declare const countLines: (words: string) => string[];
|
|
740
798
|
/**
|
|
@@ -1437,6 +1495,10 @@ export declare const linkAudienceWords: (audience?: string, config?: any) => {
|
|
|
1437
1495
|
kind: string;
|
|
1438
1496
|
who: string;
|
|
1439
1497
|
};
|
|
1498
|
+
/** Words that give the person an entry is about something to DO to it. */
|
|
1499
|
+
export declare const SENDER_ACTS_WORDS: RegExp;
|
|
1500
|
+
/** How the person an entry is about acts on it: an entry of their own, sent to whoever holds theirs. */
|
|
1501
|
+
export declare const senderActsLine: (collection: string, where: string) => string;
|
|
1440
1502
|
/**
|
|
1441
1503
|
* What a link ALREADY BUILT still means, for a sentence that changes one of
|
|
1442
1504
|
* its two pages.
|
|
@@ -1532,6 +1594,13 @@ export declare const deadRoadHint: (config: any, targets: WiringPageRow[]) => st
|
|
|
1532
1594
|
* page's setting is not on this row, so the line says where it is.
|
|
1533
1595
|
*/
|
|
1534
1596
|
export declare const deadRoadEndWords: (target: WiringPageRow) => string;
|
|
1597
|
+
/** The shared lists THIS page of sent entries links to. */
|
|
1598
|
+
export declare const sharedListEnds: (config: any, targets: WiringPageRow[]) => WiringPageRow[];
|
|
1599
|
+
export declare const sharedListEndWords: (target: WiringPageRow) => string;
|
|
1600
|
+
/** The pages of sent entries linked to THIS shared list, from either row. */
|
|
1601
|
+
export declare const sharedListSources: (config: any, targets: WiringPageRow[]) => WiringPageRow[];
|
|
1602
|
+
/** The line under the shared list's space answer while a page of sent entries is linked to it. */
|
|
1603
|
+
export declare const sharedListHint: (config: any, targets: WiringPageRow[]) => string;
|
|
1535
1604
|
/**
|
|
1536
1605
|
* What holds a sentence back on either end of a road with nowhere to end.
|
|
1537
1606
|
* A page that can never show what it is for is not one to hand over: the
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { dr as e, ha as t, ka as n, ma as r, ya as i } from "./TimeZoneField-DkI1Bkcz.js";
|
|
2
|
+
import { O as a, T as o, _ as s, l as c } from "./verifiedAccount-DRbRFJ6H.js";
|
|
3
|
+
import { n as l } from "./personName-CFw3pxuu.js";
|
|
4
|
+
import { useEffect as u, useMemo as d, useState as f } from "react";
|
|
5
|
+
import { collection as p, query as m, where as h } from "firebase/firestore";
|
|
6
|
+
//#region src/lib/people.ts
|
|
7
|
+
var g = "user_profiles", _ = (e, n) => {
|
|
8
|
+
let r = t(n);
|
|
9
|
+
return e?.code === "permission-denied" ? `The people marked ${r} are not yours to list yet. Whoever runs this app opens that by ticking both roles on one page whose entries are sent to people, and pasting the security rules again from the Setup screen.` : `The people marked ${r} could not be listed just now.`;
|
|
10
|
+
}, v = (e, t) => e.name.localeCompare(t.name), y = (e) => {
|
|
11
|
+
let t = [];
|
|
12
|
+
return e.forEach((e) => {
|
|
13
|
+
let n = e.data() || {};
|
|
14
|
+
n.inactive === !0 || n.removed === !0 || t.push({
|
|
15
|
+
uid: e.id,
|
|
16
|
+
name: l(n),
|
|
17
|
+
photo: String(n.photoURL || n.avatar || n.avatarUrl || ""),
|
|
18
|
+
email: String(n.email || "").trim(),
|
|
19
|
+
phone: String(n.phone || "").trim(),
|
|
20
|
+
role: String(n.role || "")
|
|
21
|
+
});
|
|
22
|
+
}), t.sort(v);
|
|
23
|
+
};
|
|
24
|
+
function b(t) {
|
|
25
|
+
let { user: r, roleConfirmed: o } = e(), s = r?.uid || "", c = a(String(t || "")), l = `${s}|${c}`, [v, b] = f({
|
|
26
|
+
loading: !0,
|
|
27
|
+
people: [],
|
|
28
|
+
error: "",
|
|
29
|
+
asked: ""
|
|
30
|
+
});
|
|
31
|
+
return u(() => {
|
|
32
|
+
if (!s || !c || !o) return;
|
|
33
|
+
let e = !0, t = i(`${g}|role:${c}`, () => m(p(n, g), h("role", "==", c)), (t) => {
|
|
34
|
+
e && b({
|
|
35
|
+
loading: !1,
|
|
36
|
+
people: y(t),
|
|
37
|
+
error: "",
|
|
38
|
+
asked: l
|
|
39
|
+
});
|
|
40
|
+
}, (t) => {
|
|
41
|
+
e && b({
|
|
42
|
+
loading: !1,
|
|
43
|
+
people: [],
|
|
44
|
+
error: _(t, c),
|
|
45
|
+
asked: l
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
return () => {
|
|
49
|
+
e = !1, t();
|
|
50
|
+
};
|
|
51
|
+
}, [
|
|
52
|
+
s,
|
|
53
|
+
c,
|
|
54
|
+
o,
|
|
55
|
+
l
|
|
56
|
+
]), d(() => !s || !c ? {
|
|
57
|
+
loading: !1,
|
|
58
|
+
people: [],
|
|
59
|
+
error: ""
|
|
60
|
+
} : !o || v.asked !== l ? {
|
|
61
|
+
loading: !0,
|
|
62
|
+
people: [],
|
|
63
|
+
error: ""
|
|
64
|
+
} : {
|
|
65
|
+
loading: v.loading,
|
|
66
|
+
people: v.people,
|
|
67
|
+
error: v.error
|
|
68
|
+
}, [
|
|
69
|
+
s,
|
|
70
|
+
c,
|
|
71
|
+
o,
|
|
72
|
+
l,
|
|
73
|
+
v
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
function x(e, t = r()) {
|
|
77
|
+
let n = a(String(e || ""));
|
|
78
|
+
if (!n) return [];
|
|
79
|
+
let i = t.find((e) => e.id === n)?.sees;
|
|
80
|
+
return Array.isArray(i) ? i.filter((e) => typeof e == "string" && !!e && e !== n) : [];
|
|
81
|
+
}
|
|
82
|
+
function S(e, t) {
|
|
83
|
+
let n = a(String(e || ""));
|
|
84
|
+
if (!n) return [];
|
|
85
|
+
let r = [];
|
|
86
|
+
for (let e of Array.isArray(t) ? t : []) {
|
|
87
|
+
let t = e?.config || {};
|
|
88
|
+
if (!s(o(t)) || !c(t).includes(n)) continue;
|
|
89
|
+
let i = String(e?.title || "").trim();
|
|
90
|
+
i && !r.includes(i) && r.push(i);
|
|
91
|
+
}
|
|
92
|
+
return r;
|
|
93
|
+
}
|
|
94
|
+
var C = (e) => e.length < 2 ? e[0] || "" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
|
|
95
|
+
function w(e, n = [], i = r()) {
|
|
96
|
+
let a = x(e, i).map((e) => t(e, i));
|
|
97
|
+
if (!a.length) return "";
|
|
98
|
+
let o = n.filter(Boolean), s = o.length ? `from the ${C(o)} ${o.length > 1 ? "pages" : "page"}` : "from a page where entries are sent to people";
|
|
99
|
+
return `Can see who is ${C(a)} — ${s}`;
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { w as n, b as r, S as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-qs7NPR30.cjs`),t=require(`./verifiedAccount-DScyKk96.cjs`),n=require(`./personName-CbzN_i57.cjs`);let r=require(`react`),i=require(`firebase/firestore`);var a=`user_profiles`,o=(t,n)=>{let r=e.ha(n);return t?.code===`permission-denied`?`The people marked ${r} are not yours to list yet. Whoever runs this app opens that by ticking both roles on one page whose entries are sent to people, and pasting the security rules again from the Setup screen.`:`The people marked ${r} could not be listed just now.`},s=(e,t)=>e.name.localeCompare(t.name),c=e=>{let t=[];return e.forEach(e=>{let r=e.data()||{};r.inactive===!0||r.removed===!0||t.push({uid:e.id,name:n.n(r),photo:String(r.photoURL||r.avatar||r.avatarUrl||``),email:String(r.email||``).trim(),phone:String(r.phone||``).trim(),role:String(r.role||``)})}),t.sort(s)};function l(n){let{user:s,roleConfirmed:l}=e.dr(),u=s?.uid||``,d=t.O(String(n||``)),f=`${u}|${d}`,[p,m]=(0,r.useState)({loading:!0,people:[],error:``,asked:``});return(0,r.useEffect)(()=>{if(!u||!d||!l)return;let t=!0,n=e.ya(`${a}|role:${d}`,()=>(0,i.query)((0,i.collection)(e.ka,a),(0,i.where)(`role`,`==`,d)),e=>{t&&m({loading:!1,people:c(e),error:``,asked:f})},e=>{t&&m({loading:!1,people:[],error:o(e,d),asked:f})});return()=>{t=!1,n()}},[u,d,l,f]),(0,r.useMemo)(()=>!u||!d?{loading:!1,people:[],error:``}:!l||p.asked!==f?{loading:!0,people:[],error:``}:{loading:p.loading,people:p.people,error:p.error},[u,d,l,f,p])}function u(n,r=e.ma()){let i=t.O(String(n||``));if(!i)return[];let a=r.find(e=>e.id===i)?.sees;return Array.isArray(a)?a.filter(e=>typeof e==`string`&&!!e&&e!==i):[]}function d(e,n){let r=t.O(String(e||``));if(!r)return[];let i=[];for(let e of Array.isArray(n)?n:[]){let n=e?.config||{};if(!t._(t.T(n))||!t.l(n).includes(r))continue;let a=String(e?.title||``).trim();a&&!i.includes(a)&&i.push(a)}return i}var f=e=>e.length<2?e[0]||``:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`;function p(t,n=[],r=e.ma()){let i=u(t,r).map(t=>e.ha(t,r));if(!i.length)return``;let a=n.filter(Boolean),o=a.length?`from the ${f(a)} ${a.length>1?`pages`:`page`}`:`from a page where entries are sent to people`;return`Can see who is ${f(i)} — ${o}`}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return d}});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/lib/personName.ts
|
|
2
|
+
var e = "Somebody", t = "Has not finished registering", n = (e) => String(e ?? "").trim();
|
|
3
|
+
function r(t, r = e) {
|
|
4
|
+
let i = t || {};
|
|
5
|
+
return n(i.displayName) || n(i.email) || n(i.phone) || r;
|
|
6
|
+
}
|
|
7
|
+
function i(e) {
|
|
8
|
+
let t = e || {}, i = r(t, "");
|
|
9
|
+
return [n(t.email), n(t.phone)].filter((e) => !!e && e !== i).join(" · ");
|
|
10
|
+
}
|
|
11
|
+
function a(e) {
|
|
12
|
+
let r = i(e);
|
|
13
|
+
if (r) return r;
|
|
14
|
+
let a = e || {};
|
|
15
|
+
return n(a.displayName) && n(a.email) ? "" : t;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as n, a as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=`Somebody`,t=`Has not finished registering`,n=e=>String(e??``).trim();function r(t,r=e){let i=t||{};return n(i.displayName)||n(i.email)||n(i.phone)||r}function i(e){let t=e||{},i=r(t,``);return[n(t.email),n(t.phone)].filter(e=>!!e&&e!==i).join(` · `)}function a(e){let r=i(e);if(r)return r;let a=e||{};return n(a.displayName)&&n(a.email)?``:t}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ka as e } from "./TimeZoneField-DkI1Bkcz.js";
|
|
2
|
+
import { useEffect as t, useState as n } from "react";
|
|
3
|
+
import { doc as r, onSnapshot as i, setDoc as a } from "firebase/firestore";
|
|
4
|
+
//#region src/lib/publishSteps.ts
|
|
5
|
+
var o = {
|
|
6
|
+
collection: "sys_configs",
|
|
7
|
+
doc: "publish"
|
|
8
|
+
}, s = [
|
|
9
|
+
"published",
|
|
10
|
+
"connected",
|
|
11
|
+
"authorised"
|
|
12
|
+
], c = {
|
|
13
|
+
appName: "",
|
|
14
|
+
domain: "",
|
|
15
|
+
done: []
|
|
16
|
+
};
|
|
17
|
+
function l(e) {
|
|
18
|
+
let t = Array.isArray(e?.done) ? e.done : [];
|
|
19
|
+
return {
|
|
20
|
+
appName: typeof e?.appName == "string" ? e.appName : "",
|
|
21
|
+
domain: typeof e?.domain == "string" ? e.domain : "",
|
|
22
|
+
done: s.filter((e) => t.includes(e))
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function u(e) {
|
|
26
|
+
let t = String(e ?? "").trim().toLowerCase();
|
|
27
|
+
return t = t.replace(/^[a-z][a-z0-9+.-]*:\/\//, ""), t = t.split(/[/?#]/)[0], t = t.replace(/\.ai\.studio$/, ""), t.replace(/[\s_]+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "");
|
|
28
|
+
}
|
|
29
|
+
var d = (e) => {
|
|
30
|
+
let t = u(e);
|
|
31
|
+
return t ? `https://${t}.ai.studio/` : "";
|
|
32
|
+
};
|
|
33
|
+
function f(e) {
|
|
34
|
+
let t = String(e ?? "").trim().toLowerCase();
|
|
35
|
+
return t = t.replace(/^[a-z][a-z0-9+.-]*:\/\//, ""), t = t.replace(/^[^/@]*@/, ""), t = t.split(/[/?#]/)[0], t = t.split(":")[0], t = t.replace(/^www\./, ""), t = t.replace(/^\.+|\.+$/g, ""), /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*\.[a-z]{2,}$/.test(t) ? t : "";
|
|
36
|
+
}
|
|
37
|
+
var p = (e) => {
|
|
38
|
+
let t = f(e);
|
|
39
|
+
return t ? `https://${t}/` : "";
|
|
40
|
+
}, m = (e) => p(e?.domain) || d(e?.appName);
|
|
41
|
+
function h(e, t = null) {
|
|
42
|
+
let n = (t) => e.includes(t), r = s.find((e) => !n(e)) ?? null, i = r ? s.indexOf(r) : s.length - 1;
|
|
43
|
+
return s.map((e, a) => {
|
|
44
|
+
let o = a <= i, s = t !== null && t === e && o;
|
|
45
|
+
return {
|
|
46
|
+
id: e,
|
|
47
|
+
visible: o,
|
|
48
|
+
done: n(e),
|
|
49
|
+
open: s || t === null && e === r
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
var g = (e, t) => s.filter((n) => n === t || e.includes(n));
|
|
54
|
+
function _(e) {
|
|
55
|
+
return !e || !e.configured ? !1 : e.mode === "live" ? !e.webhookConfigured : !0;
|
|
56
|
+
}
|
|
57
|
+
function v() {
|
|
58
|
+
let [s, u] = n({
|
|
59
|
+
loading: !0,
|
|
60
|
+
record: c
|
|
61
|
+
});
|
|
62
|
+
return t(() => i(r(e, o.collection, o.doc), (e) => u({
|
|
63
|
+
loading: !1,
|
|
64
|
+
record: l(e.exists() ? e.data() : null)
|
|
65
|
+
}), () => u({
|
|
66
|
+
loading: !1,
|
|
67
|
+
record: c
|
|
68
|
+
})), []), {
|
|
69
|
+
loading: s.loading,
|
|
70
|
+
record: s.record,
|
|
71
|
+
save: async (t) => {
|
|
72
|
+
u((e) => ({
|
|
73
|
+
loading: !1,
|
|
74
|
+
record: {
|
|
75
|
+
...e.record,
|
|
76
|
+
...t
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
try {
|
|
80
|
+
return await a(r(e, o.collection, o.doc), t, { merge: !0 }), null;
|
|
81
|
+
} catch (e) {
|
|
82
|
+
return console.error("Could not save where you got to", e), "That could not be saved. Only an admin can, and only while you are signed in.";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { p as a, _ as c, f as i, v as l, d as n, h as o, u as r, m as s, s as t, g as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-qs7NPR30.cjs`);let t=require(`react`),n=require(`firebase/firestore`);var r={collection:`sys_configs`,doc:`publish`},i=[`published`,`connected`,`authorised`],a={appName:``,domain:``,done:[]};function o(e){let t=Array.isArray(e?.done)?e.done:[];return{appName:typeof e?.appName==`string`?e.appName:``,domain:typeof e?.domain==`string`?e.domain:``,done:i.filter(e=>t.includes(e))}}function s(e){let t=String(e??``).trim().toLowerCase();return t=t.replace(/^[a-z][a-z0-9+.-]*:\/\//,``),t=t.split(/[/?#]/)[0],t=t.replace(/\.ai\.studio$/,``),t.replace(/[\s_]+/g,`-`).replace(/[^a-z0-9-]/g,``).replace(/-{2,}/g,`-`).replace(/^-+|-+$/g,``)}var c=e=>{let t=s(e);return t?`https://${t}.ai.studio/`:``};function l(e){let t=String(e??``).trim().toLowerCase();return t=t.replace(/^[a-z][a-z0-9+.-]*:\/\//,``),t=t.replace(/^[^/@]*@/,``),t=t.split(/[/?#]/)[0],t=t.split(`:`)[0],t=t.replace(/^www\./,``),t=t.replace(/^\.+|\.+$/g,``),/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*\.[a-z]{2,}$/.test(t)?t:``}var u=e=>{let t=l(e);return t?`https://${t}/`:``},d=e=>u(e?.domain)||c(e?.appName);function f(e,t=null){let n=t=>e.includes(t),r=i.find(e=>!n(e))??null,a=r?i.indexOf(r):i.length-1;return i.map((e,i)=>{let o=i<=a,s=t!==null&&t===e&&o;return{id:e,visible:o,done:n(e),open:s||t===null&&e===r}})}var p=(e,t)=>i.filter(n=>n===t||e.includes(n));function m(e){return!e||!e.configured?!1:e.mode===`live`?!e.webhookConfigured:!0}function h(){let[i,s]=(0,t.useState)({loading:!0,record:a});return(0,t.useEffect)(()=>(0,n.onSnapshot)((0,n.doc)(e.ka,r.collection,r.doc),e=>s({loading:!1,record:o(e.exists()?e.data():null)}),()=>s({loading:!1,record:a})),[]),{loading:i.loading,record:i.record,save:async t=>{s(e=>({loading:!1,record:{...e.record,...t}}));try{return await(0,n.setDoc)((0,n.doc)(e.ka,r.collection,r.doc),t,{merge:!0}),null}catch(e){return console.error(`Could not save where you got to`,e),`That could not be saved. Only an admin can, and only while you are signed in.`}}}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return p}});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ka as e } from "./TimeZoneField-DkI1Bkcz.js";
|
|
2
|
+
import { deleteField as t, doc as n, writeBatch as r } from "firebase/firestore";
|
|
3
|
+
//#region src/lib/recordLock.ts
|
|
4
|
+
var i = [
|
|
5
|
+
{
|
|
6
|
+
value: "none",
|
|
7
|
+
label: "No one"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
value: "admin",
|
|
11
|
+
label: "Only me and my admins"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: "all",
|
|
15
|
+
label: "Everyone who can change it"
|
|
16
|
+
}
|
|
17
|
+
], a = {
|
|
18
|
+
none: "Nothing on this page can be thrown away — there is no Delete button for anybody, you included. Pick one of the others where something has to go.",
|
|
19
|
+
admin: "Nobody but an admin can delete anything on this page — the database refuses it, whatever the page shows. Needs the rules pasted from /setup at 1.14.66 or later.",
|
|
20
|
+
all: "Whoever may change a record may delete it too."
|
|
21
|
+
}, o = ["admin"], s = [], c = [
|
|
22
|
+
"board",
|
|
23
|
+
"table",
|
|
24
|
+
"calendar",
|
|
25
|
+
"drive"
|
|
26
|
+
], l = (e) => {
|
|
27
|
+
let t = String(e?.pageType || "");
|
|
28
|
+
return !t || t === "public" || t === "admin" ? !1 : !c.includes(String(e?.template || ""));
|
|
29
|
+
}, u = (e) => {
|
|
30
|
+
let t = e?.deleteBy;
|
|
31
|
+
return t === "admin" ? "admin" : t === "all" || t === "" ? "all" : t === "none" || l(e) ? "none" : "all";
|
|
32
|
+
}, d = (e) => {
|
|
33
|
+
let t = u(e);
|
|
34
|
+
return t === "admin" ? o : t === "none" ? s : null;
|
|
35
|
+
}, f = (e) => {
|
|
36
|
+
let t = d(e);
|
|
37
|
+
return t ? { lock: { delete: [...t] } } : {};
|
|
38
|
+
}, p = (e) => {
|
|
39
|
+
let t = e?.lock?.delete;
|
|
40
|
+
return Array.isArray(t) ? t.map(String) : null;
|
|
41
|
+
}, m = (e, t) => {
|
|
42
|
+
let n = p(e);
|
|
43
|
+
return n ? n.length ? t === "admin" || !!t && n.includes(t) : !1 : !0;
|
|
44
|
+
}, h = (e, t) => {
|
|
45
|
+
let n = d(t), r = p(e);
|
|
46
|
+
return n ? r !== null && r.length === n.length && n.every((e) => r.includes(e)) : r === null;
|
|
47
|
+
};
|
|
48
|
+
async function g(i, a, o, s) {
|
|
49
|
+
if (!s || !i) return 0;
|
|
50
|
+
let c = d(o), l = a.filter((e) => e && e.id && !h(e, o));
|
|
51
|
+
if (!l.length) return 0;
|
|
52
|
+
let u = c ? { lock: { delete: [...c] } } : { lock: t() };
|
|
53
|
+
for (let t = 0; t < l.length; t += 500) {
|
|
54
|
+
let a = r(e);
|
|
55
|
+
for (let r of l.slice(t, t + 500)) a.update(n(e, i, r.id), u);
|
|
56
|
+
await a.commit();
|
|
57
|
+
}
|
|
58
|
+
return l.length;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { l as a, u as i, a as n, f as o, g as r, m as s, i as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-qs7NPR30.cjs`);let t=require(`firebase/firestore`);var n=[{value:`none`,label:`No one`},{value:`admin`,label:`Only me and my admins`},{value:`all`,label:`Everyone who can change it`}],r={none:`Nothing on this page can be thrown away — there is no Delete button for anybody, you included. Pick one of the others where something has to go.`,admin:`Nobody but an admin can delete anything on this page — the database refuses it, whatever the page shows. Needs the rules pasted from /setup at 1.14.66 or later.`,all:`Whoever may change a record may delete it too.`},i=[`admin`],a=[],o=[`board`,`table`,`calendar`,`drive`],s=e=>{let t=String(e?.pageType||``);return!t||t===`public`||t===`admin`?!1:!o.includes(String(e?.template||``))},c=e=>{let t=e?.deleteBy;return t===`admin`?`admin`:t===`all`||t===``?`all`:t===`none`||s(e)?`none`:`all`},l=e=>{let t=c(e);return t===`admin`?i:t===`none`?a:null},u=e=>{let t=l(e);return t?{lock:{delete:[...t]}}:{}},d=e=>{let t=e?.lock?.delete;return Array.isArray(t)?t.map(String):null},f=(e,t)=>{let n=d(e);return n?n.length?t===`admin`||!!t&&n.includes(t):!1:!0},p=(e,t)=>{let n=l(t),r=d(e);return n?r!==null&&r.length===n.length&&n.every(e=>r.includes(e)):r===null};async function m(n,r,i,a){if(!a||!n)return 0;let o=l(i),s=r.filter(e=>e&&e.id&&!p(e,i));if(!s.length)return 0;let c=o?{lock:{delete:[...o]}}:{lock:(0,t.deleteField)()};for(let r=0;r<s.length;r+=500){let i=(0,t.writeBatch)(e.ka);for(let a of s.slice(r,r+500))i.update((0,t.doc)(e.ka,n,a.id),c);await i.commit()}return s.length}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-qs7NPR30.cjs`),t=require(`./DashboardNav-CXa_ci-_.cjs`),n=require(`./verifiedAccount-DScyKk96.cjs`);let r=require(`react`),i=require(`firebase/firestore`);var a=[{id:`home`,title:`Home`,path:`/`,audience:`public`},{id:`contact`,title:`Contact`,path:`/contact`,audience:`public`},{id:`dashboard`,title:`Dashboard`,path:`/dashboard`,audience:`user`},{id:`support`,title:`Support`,path:`/support`,audience:`user`}],o=new Set([`home`,`drive`,`assets`,`contact`,`guide`,`templates`,`setup`,`support`,`theme`,`page_order`,`tab_order`]),s={public:0,user:1,internal:2,admin:3},c=(e,t)=>{let n=String(e||``).trim();return n?n.startsWith(`/`)?n:`/${n}`:`/${t}`},l=e=>new Set((Array.isArray(e?.order)?e.order:[]).filter(e=>e&&typeof e==`object`&&e.removed).map(e=>String(e.id)));function u(e,r,i,l,u=t.S()){let d=[...a];for(let{id:t,data:n}of e)o.has(t)||d.push({id:t,title:String(n?.pageName||n?.title||t),path:c(n?.route,t),brief:String(n?.brief||``),config:n,audience:`public`});for(let{id:e,data:t}of r)o.has(e)||d.push({id:e,title:String(t?.tabName||t?.title||e),path:c(t?.route,e),brief:String(t?.brief||``),config:t,audience:n.S(t?.pageType)});for(let[e,t]of u){if(o.has(e)||d.some(t=>t.id===e)||d.some(t=>String(t.config?.fileId||``)===e))continue;let r=!!t.isPublic;if((r?i:l).has(e))continue;let a=t.config||{},s=c(a.route,e);d.some(e=>e.path===s)||d.push({id:e,title:String(r?a.pageName||a.pageTitle||a.title||e:a.tabName||a.tabTitle||a.title||e),path:s,brief:String(a.brief||``),config:a,audience:r?`public`:n.S(a.pageType)})}return d.sort((e,t)=>(s[e.audience||`public`]??9)-(s[t.audience||`public`]??9)||e.title.localeCompare(t.title))}function d(){let[t,n]=(0,r.useState)(null),[a,o]=(0,r.useState)(null),[s,c]=(0,r.useState)(new Set),[d,f]=(0,r.useState)(new Set);return(0,r.useEffect)(()=>{let t=e=>{let t=[];return e.forEach(e=>t.push({id:e.id,data:e.data()})),t},r=[(0,i.onSnapshot)((0,i.collection)(e.ka,`sys_pages`),e=>n(t(e)),()=>n([])),(0,i.onSnapshot)((0,i.collection)(e.ka,`sys_tabs`),e=>o(t(e)),()=>o([])),(0,i.onSnapshot)((0,i.doc)(e.ka,`sys_configs`,`page_order`),e=>c(l(e.exists()?e.data():null)),()=>{}),(0,i.onSnapshot)((0,i.doc)(e.ka,`sys_configs`,`tab_order`),e=>f(l(e.exists()?e.data():null)),()=>{})];return()=>r.forEach(e=>e())},[]),t===null||a===null?null:u(t,a,s,d)}var f=[`board`,`table`,`calendar`,`drive`],p=[`inline_form`,`popup_form`],m=e=>typeof e!=`string`||e===``||e===`none`||e===`custom`||![...f,...p].includes(e),h=(e,t)=>m(e)||t&&!g(e),g=e=>typeof e==`string`&&f.includes(e),_=e=>String(e??``).toLowerCase().replace(/[^a-z0-9]+/g,`_`),v=(e,t)=>String(e?.recordsKey??``).trim()||_(e?.tabName||e?.pageId||t),y=(e,t)=>{let n=String(e?.recordsKey??``).trim();if(n)return n;let r=String(e?.pageName??``).toLowerCase().replace(/\s+/g,`_`)||e?.pageId||`custom_page`;return t&&e?.pageId||r},b={board:`tasks`,table:`table`,calendar:`events`,drive:`files`};function x(e,t,n=``){let r=b[String(e?.template??``)];return r?`${t}${y({...e,pageId:e?.pageId||n},!0)}_${r}`:t===`case_`?w(e,t):`${t}${v(e,t===`admin_`?`admin_page`:t===`mem_`?`internal_page`:`user_page`)}_records`}function S(e,t,n){let r=String(e?.recordsKey??``).trim();if(r)return r;let i=g(String(e?.template??``));return n?i?y({...e,pageId:t},!1):``:i?t:v(e,t)}var C=e=>(String(e?.recordsKey??``).trim()||String(e?.tabName||e?.contentKey||`page`)).toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``)||`page`,w=(e,t=n.i)=>`${t}${C(e)}_entries`;Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return d}});
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ka as e } from "./TimeZoneField-DkI1Bkcz.js";
|
|
2
|
+
import { S as t } from "./DashboardNav-Dmn7PVSp.js";
|
|
3
|
+
import { S as n, i as r } from "./verifiedAccount-DRbRFJ6H.js";
|
|
4
|
+
import { useEffect as i, useState as a } from "react";
|
|
5
|
+
import { collection as o, doc as s, onSnapshot as c } from "firebase/firestore";
|
|
6
|
+
//#region src/lib/pageRows.ts
|
|
7
|
+
var l = [
|
|
8
|
+
{
|
|
9
|
+
id: "home",
|
|
10
|
+
title: "Home",
|
|
11
|
+
path: "/",
|
|
12
|
+
audience: "public"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "contact",
|
|
16
|
+
title: "Contact",
|
|
17
|
+
path: "/contact",
|
|
18
|
+
audience: "public"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "dashboard",
|
|
22
|
+
title: "Dashboard",
|
|
23
|
+
path: "/dashboard",
|
|
24
|
+
audience: "user"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "support",
|
|
28
|
+
title: "Support",
|
|
29
|
+
path: "/support",
|
|
30
|
+
audience: "user"
|
|
31
|
+
}
|
|
32
|
+
], u = new Set([
|
|
33
|
+
"home",
|
|
34
|
+
"drive",
|
|
35
|
+
"assets",
|
|
36
|
+
"contact",
|
|
37
|
+
"guide",
|
|
38
|
+
"templates",
|
|
39
|
+
"setup",
|
|
40
|
+
"support",
|
|
41
|
+
"theme",
|
|
42
|
+
"page_order",
|
|
43
|
+
"tab_order"
|
|
44
|
+
]), d = {
|
|
45
|
+
public: 0,
|
|
46
|
+
user: 1,
|
|
47
|
+
internal: 2,
|
|
48
|
+
admin: 3
|
|
49
|
+
}, f = (e, t) => {
|
|
50
|
+
let n = String(e || "").trim();
|
|
51
|
+
return n ? n.startsWith("/") ? n : `/${n}` : `/${t}`;
|
|
52
|
+
}, p = (e) => new Set((Array.isArray(e?.order) ? e.order : []).filter((e) => e && typeof e == "object" && e.removed).map((e) => String(e.id)));
|
|
53
|
+
function m(e, r, i, a, o = t()) {
|
|
54
|
+
let s = [...l];
|
|
55
|
+
for (let { id: t, data: n } of e) u.has(t) || s.push({
|
|
56
|
+
id: t,
|
|
57
|
+
title: String(n?.pageName || n?.title || t),
|
|
58
|
+
path: f(n?.route, t),
|
|
59
|
+
brief: String(n?.brief || ""),
|
|
60
|
+
config: n,
|
|
61
|
+
audience: "public"
|
|
62
|
+
});
|
|
63
|
+
for (let { id: e, data: t } of r) u.has(e) || s.push({
|
|
64
|
+
id: e,
|
|
65
|
+
title: String(t?.tabName || t?.title || e),
|
|
66
|
+
path: f(t?.route, e),
|
|
67
|
+
brief: String(t?.brief || ""),
|
|
68
|
+
config: t,
|
|
69
|
+
audience: n(t?.pageType)
|
|
70
|
+
});
|
|
71
|
+
for (let [e, t] of o) {
|
|
72
|
+
if (u.has(e) || s.some((t) => t.id === e) || s.some((t) => String(t.config?.fileId || "") === e)) continue;
|
|
73
|
+
let r = !!t.isPublic;
|
|
74
|
+
if ((r ? i : a).has(e)) continue;
|
|
75
|
+
let o = t.config || {}, c = f(o.route, e);
|
|
76
|
+
s.some((e) => e.path === c) || s.push({
|
|
77
|
+
id: e,
|
|
78
|
+
title: String(r ? o.pageName || o.pageTitle || o.title || e : o.tabName || o.tabTitle || o.title || e),
|
|
79
|
+
path: c,
|
|
80
|
+
brief: String(o.brief || ""),
|
|
81
|
+
config: o,
|
|
82
|
+
audience: r ? "public" : n(o.pageType)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return s.sort((e, t) => (d[e.audience || "public"] ?? 9) - (d[t.audience || "public"] ?? 9) || e.title.localeCompare(t.title));
|
|
86
|
+
}
|
|
87
|
+
function h() {
|
|
88
|
+
let [t, n] = a(null), [r, l] = a(null), [u, d] = a(/* @__PURE__ */ new Set()), [f, h] = a(/* @__PURE__ */ new Set());
|
|
89
|
+
return i(() => {
|
|
90
|
+
let t = (e) => {
|
|
91
|
+
let t = [];
|
|
92
|
+
return e.forEach((e) => t.push({
|
|
93
|
+
id: e.id,
|
|
94
|
+
data: e.data()
|
|
95
|
+
})), t;
|
|
96
|
+
}, r = [
|
|
97
|
+
c(o(e, "sys_pages"), (e) => n(t(e)), () => n([])),
|
|
98
|
+
c(o(e, "sys_tabs"), (e) => l(t(e)), () => l([])),
|
|
99
|
+
c(s(e, "sys_configs", "page_order"), (e) => d(p(e.exists() ? e.data() : null)), () => {}),
|
|
100
|
+
c(s(e, "sys_configs", "tab_order"), (e) => h(p(e.exists() ? e.data() : null)), () => {})
|
|
101
|
+
];
|
|
102
|
+
return () => r.forEach((e) => e());
|
|
103
|
+
}, []), t === null || r === null ? null : m(t, r, u, f);
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/configs/pages/templates.ts
|
|
107
|
+
var g = [
|
|
108
|
+
"board",
|
|
109
|
+
"table",
|
|
110
|
+
"calendar",
|
|
111
|
+
"drive"
|
|
112
|
+
], _ = ["inline_form", "popup_form"], v = (e) => typeof e != "string" || e === "" || e === "none" || e === "custom" || ![...g, ..._].includes(e), y = (e, t) => v(e) || t && !b(e), b = (e) => typeof e == "string" && g.includes(e), x = (e) => String(e ?? "").toLowerCase().replace(/[^a-z0-9]+/g, "_"), S = (e, t) => String(e?.recordsKey ?? "").trim() || x(e?.tabName || e?.pageId || t), C = (e, t) => {
|
|
113
|
+
let n = String(e?.recordsKey ?? "").trim();
|
|
114
|
+
if (n) return n;
|
|
115
|
+
let r = String(e?.pageName ?? "").toLowerCase().replace(/\s+/g, "_") || e?.pageId || "custom_page";
|
|
116
|
+
return t && e?.pageId || r;
|
|
117
|
+
}, w = {
|
|
118
|
+
board: "tasks",
|
|
119
|
+
table: "table",
|
|
120
|
+
calendar: "events",
|
|
121
|
+
drive: "files"
|
|
122
|
+
};
|
|
123
|
+
function T(e, t, n = "") {
|
|
124
|
+
let r = w[String(e?.template ?? "")];
|
|
125
|
+
return r ? `${t}${C({
|
|
126
|
+
...e,
|
|
127
|
+
pageId: e?.pageId || n
|
|
128
|
+
}, !0)}_${r}` : t === "case_" ? O(e, t) : `${t}${S(e, t === "admin_" ? "admin_page" : t === "mem_" ? "internal_page" : "user_page")}_records`;
|
|
129
|
+
}
|
|
130
|
+
function E(e, t, n) {
|
|
131
|
+
let r = String(e?.recordsKey ?? "").trim();
|
|
132
|
+
if (r) return r;
|
|
133
|
+
let i = b(String(e?.template ?? ""));
|
|
134
|
+
return n ? i ? C({
|
|
135
|
+
...e,
|
|
136
|
+
pageId: t
|
|
137
|
+
}, !1) : "" : i ? t : S(e, t);
|
|
138
|
+
}
|
|
139
|
+
var D = (e) => (String(e?.recordsKey ?? "").trim() || String(e?.tabName || e?.contentKey || "page")).toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "page", O = (e, t = r) => `${t}${D(e)}_entries`;
|
|
140
|
+
//#endregion
|
|
141
|
+
export { E as a, y as c, C as i, l, D as n, S as o, T as r, b as s, O as t, h as u };
|