@africode/core 5.0.8 → 5.0.9
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/AGENT_INSTRUCTIONS.md +595 -595
- package/COMPONENT_SCHEMA.json +1800 -991
- package/bin/create-africode.js +87 -25
- package/components/auth-form.js +154 -0
- package/components/index.js +10 -0
- package/components/kyc-upload.js +173 -0
- package/components/nav-drawer.js +217 -0
- package/components/transaction-ledger.js +138 -0
- package/components/wallet-balance.js +114 -0
- package/core/a2ui-schema-manager.js +1 -1
- package/core/a2ui.js +178 -1
- package/core/bun-runtime.js +122 -7
- package/core/cli/commands/build.js +30 -5
- package/core/cli/ui.js +13 -3
- package/core/compliance.js +201 -0
- package/core/middleware.js +80 -17
- package/core/patterns.js +168 -0
- package/core/request-analytics.js +254 -0
- package/core/request-identity.js +79 -29
- package/core/sdk.js +4 -1
- package/core/validation.js +13 -0
- package/dist/africode.js +858 -457
- package/dist/africode.js.map +14 -9
- package/dist/build-info.json +3 -3
- package/dist/components.js +784 -383
- package/dist/components.js.map +11 -6
- package/package.json +1 -1
- package/templates/starter/package.json +5 -5
- package/templates/starter/src/index.js +18 -0
- package/templates/starter/src/pages/index.js +1 -1
- package/templates/starter-3d/package.json +5 -5
- package/templates/starter-3d/src/pages/index.js +1 -1
- package/templates/starter-dashboard/.env.example +21 -0
- package/templates/starter-dashboard/africode.config.js +20 -0
- package/templates/starter-dashboard/package.json +14 -0
- package/templates/starter-dashboard/src/index.js +17 -0
- package/templates/starter-dashboard/src/pages/api/analytics.js +24 -0
- package/templates/starter-dashboard/src/pages/index.html +118 -0
- package/templates/starter-dashboard/src/pages/index.js +110 -0
- package/templates/starter-dashboard/src/styles/main.css +172 -0
- package/templates/starter-fintech/.env.example +28 -0
- package/templates/starter-fintech/africode.config.js +20 -0
- package/templates/starter-fintech/package.json +15 -0
- package/templates/starter-fintech/src/index.js +17 -0
- package/templates/starter-fintech/src/pages/api/auth.js +45 -0
- package/templates/starter-fintech/src/pages/api/transfer.js +65 -0
- package/templates/starter-fintech/src/pages/api/wallet.js +39 -0
- package/templates/starter-fintech/src/pages/api/webhooks/payment.js +32 -0
- package/templates/starter-fintech/src/pages/index.html +169 -0
- package/templates/starter-fintech/src/pages/index.js +161 -0
- package/templates/starter-fintech/src/styles/main.css +246 -0
- package/templates/starter-react/package.json +5 -5
- package/templates/starter-react/src/pages/index.js +1 -1
- package/templates/starter-tailwind/package.json +5 -5
- package/templates/starter-tailwind/src/pages/index.js +1 -1
- package/templates/starter-website/.env.example +18 -0
- package/templates/starter-website/africode.config.js +20 -0
- package/templates/starter-website/package.json +14 -0
- package/templates/starter-website/src/index.js +17 -0
- package/templates/starter-website/src/pages/index.html +124 -0
- package/templates/starter-website/src/pages/index.js +116 -0
- package/templates/starter-website/src/styles/main.css +195 -0
package/dist/africode.js
CHANGED
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
var
|
|
1
|
+
var le=Object.defineProperty;var ee=(t)=>t;function be(t,n){this[t]=ee.bind(null,n)}var $=(t,n)=>{for(var r in n)le(t,r,{get:n[r],enumerable:!0,configurable:!0,set:be.bind(n,r)})};var m=(t,n)=>()=>(t&&(n=t(t=0)),n);function ht(t){if(sn.has(t))return sn.get(t);let r=new Proxy(t,{get(o,a,l){let e=Reflect.get(o,a,l);if(e!==null&&typeof e==="object")return ht(e);return e},set(o,a,l,e){let b=Reflect.get(o,a,e);if(b!==l){let f=Reflect.set(o,a,l,e);if(f)io(e,l,b,a);return f}return!0},deleteProperty(o,a){let l=Reflect.get(o,a),e=Reflect.deleteProperty(o,a);if(e){let b=sn.get(o);io(b,void 0,l,a)}return e}});return sn.set(t,r),r}function T(t,n){if(!mn.has(t))mn.set(t,new Set);let r=mn.get(t);return r.add(n),()=>{r.delete(n)}}function io(t,n,r,o){let a=mn.get(t);if(!a)return;a.forEach((l)=>{try{l(n,r,o)}catch(e){console.error("[AfriCode State] Subscriber error:",e)}})}class Gr{constructor(){this.store={}}get(t){return t.split("/").reduce((n,r)=>n?.[r],this.store)}set(t,n){let r=t.split("/"),o=this.store;while(r.length>1){let a=r.shift();if(!o[a]||typeof o[a]!=="object")o[a]={};o=o[a]}o[r[0]]=n}getAll(){return this.store}}function fo(t){let n=t,r=new Set,o=()=>{return n},a=(l)=>{if(n!==l)n=typeof l==="function"?l(n):l,r.forEach((e)=>e()),io()};return o.subscribe=(l)=>{return r.add(l),()=>r.delete(l)},[o,a]}function ho(t){return t(),T(t)}var mn,sn,Ki;var rt=m(()=>{mn=new WeakMap,sn=new WeakMap;Ki=new Gr});var ie,J,Qr;var Ht=m(()=>{rt();ie={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},J=ht(ie),Qr={setTheme(t){if(["dark","light","system"].includes(t))J.theme=t,J.ui.theme=t},setLanguage(t){J.language=t},toggleSidebar(t){if(typeof t==="boolean")J.ui.sidebarCollapsed=t;else J.ui.sidebarCollapsed=!J.ui.sidebarCollapsed},setActivePage(t){J.ui.activePage=t}}});function fe(t,n,r=50,o=50){let a=[];for(let l=0;l<t;l++){let e=2*Math.PI*l/t-Math.PI/2,b=r+n*Math.cos(e),f=o+n*Math.sin(e);a.push(`${b.toFixed(2)},${f.toFixed(2)}`)}return a.join(" ")}function co({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:r="#8B0000",stripeWidth:o=4,size:a=40}={}){let l=`
|
|
2
2
|
<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 ${a} ${a}">
|
|
3
|
-
<rect width="${a}" height="${a}" fill="${
|
|
4
|
-
<rect x="0" y="0" width="${a}" height="${
|
|
5
|
-
<rect x="0" y="${a/2-
|
|
6
|
-
<rect x="0" y="${a-
|
|
7
|
-
<rect x="0" y="0" width="${
|
|
8
|
-
<rect x="${a/2-
|
|
9
|
-
<rect x="${a-
|
|
3
|
+
<rect width="${a}" height="${a}" fill="${r}"/>
|
|
4
|
+
<rect x="0" y="0" width="${a}" height="${o}" fill="${t}" opacity="0.8"/>
|
|
5
|
+
<rect x="0" y="${a/2-o/2}" width="${a}" height="${o}" fill="${n}" opacity="0.6"/>
|
|
6
|
+
<rect x="0" y="${a-o}" width="${a}" height="${o}" fill="${t}" opacity="0.8"/>
|
|
7
|
+
<rect x="0" y="0" width="${o}" height="${a}" fill="${t}" opacity="0.5"/>
|
|
8
|
+
<rect x="${a/2-o/2}" y="0" width="${o}" height="${a}" fill="${n}" opacity="0.4"/>
|
|
9
|
+
<rect x="${a-o}" y="0" width="${o}" height="${a}" fill="${t}" opacity="0.5"/>
|
|
10
10
|
</svg>
|
|
11
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
12
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
13
|
-
<rect width="${
|
|
11
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function go({earthColor:t="#8B4513",ochreColor:n="#CD853F",charcoalColor:r="#2F2F2F",size:o=50}={}){let a=`
|
|
12
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
13
|
+
<rect width="${o}" height="${o}" fill="${t}"/>
|
|
14
14
|
<!-- Cave art inspired figures -->
|
|
15
|
-
<circle cx="${
|
|
16
|
-
<line x1="${
|
|
17
|
-
<line x1="${
|
|
15
|
+
<circle cx="${o*0.3}" cy="${o*0.3}" r="${o*0.08}" fill="${n}"/>
|
|
16
|
+
<line x1="${o*0.3}" y1="${o*0.38}" x2="${o*0.3}" y2="${o*0.6}" stroke="${r}" stroke-width="2"/>
|
|
17
|
+
<line x1="${o*0.2}" y1="${o*0.45}" x2="${o*0.4}" y2="${o*0.45}" stroke="${r}" stroke-width="2"/>
|
|
18
18
|
<!-- Animal figure -->
|
|
19
|
-
<ellipse cx="${
|
|
20
|
-
<line x1="${
|
|
21
|
-
<line x1="${
|
|
19
|
+
<ellipse cx="${o*0.7}" cy="${o*0.5}" rx="${o*0.15}" ry="${o*0.08}" fill="${n}"/>
|
|
20
|
+
<line x1="${o*0.6}" y1="${o*0.58}" x2="${o*0.6}" y2="${o*0.7}" stroke="${r}" stroke-width="2"/>
|
|
21
|
+
<line x1="${o*0.8}" y1="${o*0.58}" x2="${o*0.8}" y2="${o*0.7}" stroke="${r}" stroke-width="2"/>
|
|
22
22
|
<!-- Dots like ancient markings -->
|
|
23
|
-
<circle cx="${
|
|
24
|
-
<circle cx="${
|
|
23
|
+
<circle cx="${o*0.15}" cy="${o*0.8}" r="3" fill="${n}"/>
|
|
24
|
+
<circle cx="${o*0.85}" cy="${o*0.2}" r="3" fill="${n}"/>
|
|
25
25
|
</svg>
|
|
26
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
27
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
28
|
-
<rect width="${
|
|
26
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function so({primaryColor:t="#1EB53A",accentColor:n="#FCD116",size:r=30}={}){let o=`
|
|
27
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
|
|
28
|
+
<rect width="${r}" height="${r}" fill="${t}"/>
|
|
29
29
|
<!-- Pindo (Border) Motifs: Cashew/Triangle -->
|
|
30
|
-
<path d="M0,0 L${
|
|
31
|
-
<path d="M${
|
|
32
|
-
<circle cx="${
|
|
30
|
+
<path d="M0,0 L${r/2},${r/2} L0,${r} Z" fill="${n}"/>
|
|
31
|
+
<path d="M${r},0 L${r/2},${r/2} L${r},${r} Z" fill="${n}"/>
|
|
32
|
+
<circle cx="${r/2}" cy="${r/2}" r="${r*0.15}" fill="none" stroke="${n}" stroke-width="2"/>
|
|
33
33
|
</svg>
|
|
34
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
35
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
36
|
-
<rect width="${
|
|
34
|
+
`;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function he({primaryColor:t="#FF6B00",secondaryColor:n="#002B5C",backgroundColor:r="#FFFFFF",size:o=40}={}){let a=`
|
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
36
|
+
<rect width="${o}" height="${o}" fill="${r}"/>
|
|
37
37
|
<!-- Border pattern -->
|
|
38
|
-
<rect x="0" y="0" width="${
|
|
39
|
-
<rect x="0" y="${
|
|
40
|
-
<rect x="0" y="0" width="${
|
|
41
|
-
<rect x="${
|
|
38
|
+
<rect x="0" y="0" width="${o}" height="${o*0.1}" fill="${t}"/>
|
|
39
|
+
<rect x="0" y="${o*0.9}" width="${o}" height="${o*0.1}" fill="${t}"/>
|
|
40
|
+
<rect x="0" y="0" width="${o*0.1}" height="${o}" fill="${t}"/>
|
|
41
|
+
<rect x="${o*0.9}" y="0" width="${o*0.1}" height="${o}" fill="${t}"/>
|
|
42
42
|
<!-- Center motif -->
|
|
43
|
-
<circle cx="${
|
|
44
|
-
<text x="${
|
|
43
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.15}" fill="${n}"/>
|
|
44
|
+
<text x="${o*0.5}" y="${o*0.55}" text-anchor="middle" fill="${t}" font-size="${o*0.08}">KANGA</text>
|
|
45
45
|
</svg>
|
|
46
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
47
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
48
|
-
<rect width="${
|
|
46
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function de({primaryColor:t="#8B4513",secondaryColor:n="#DAA520",backgroundColor:r="#F5F5DC",size:o=30}={}){let a=`
|
|
47
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
48
|
+
<rect width="${o}" height="${o}" fill="${r}"/>
|
|
49
49
|
<!-- Kuba geometric border -->
|
|
50
|
-
<polygon points="0,0 ${
|
|
51
|
-
<polygon points="${
|
|
52
|
-
<polygon points="0,${
|
|
53
|
-
<polygon points="${
|
|
50
|
+
<polygon points="0,0 ${o*0.3},0 0,${o*0.3}" fill="${t}"/>
|
|
51
|
+
<polygon points="${o},0 ${o*0.7},0 ${o},${o*0.3}" fill="${t}"/>
|
|
52
|
+
<polygon points="0,${o} ${o*0.3},${o} 0,${o*0.7}" fill="${t}"/>
|
|
53
|
+
<polygon points="${o},${o} ${o*0.7},${o} ${o},${o*0.7}" fill="${t}"/>
|
|
54
54
|
<!-- Center diamond -->
|
|
55
|
-
<polygon points="${
|
|
55
|
+
<polygon points="${o*0.5},${o*0.3} ${o*0.7},${o*0.5} ${o*0.5},${o*0.7} ${o*0.3},${o*0.5}" fill="${n}"/>
|
|
56
56
|
</svg>
|
|
57
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
58
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
59
|
-
<rect width="${
|
|
57
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function ce({primaryColor:t="#FF0000",secondaryColor:n="#000000",accentColor:r="#FFFFFF",size:o=40}={}){let a=`
|
|
58
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
59
|
+
<rect width="${o}" height="${o}" fill="${r}"/>
|
|
60
60
|
<!-- Bead pattern -->
|
|
61
|
-
<circle cx="${
|
|
62
|
-
<circle cx="${
|
|
63
|
-
<circle cx="${
|
|
64
|
-
<circle cx="${
|
|
65
|
-
<circle cx="${
|
|
66
|
-
<circle cx="${
|
|
67
|
-
<circle cx="${
|
|
68
|
-
<circle cx="${
|
|
69
|
-
<circle cx="${
|
|
61
|
+
<circle cx="${o*0.2}" cy="${o*0.2}" r="${o*0.08}" fill="${t}"/>
|
|
62
|
+
<circle cx="${o*0.5}" cy="${o*0.2}" r="${o*0.08}" fill="${n}"/>
|
|
63
|
+
<circle cx="${o*0.8}" cy="${o*0.2}" r="${o*0.08}" fill="${t}"/>
|
|
64
|
+
<circle cx="${o*0.2}" cy="${o*0.5}" r="${o*0.08}" fill="${n}"/>
|
|
65
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.08}" fill="${t}"/>
|
|
66
|
+
<circle cx="${o*0.8}" cy="${o*0.5}" r="${o*0.08}" fill="${n}"/>
|
|
67
|
+
<circle cx="${o*0.2}" cy="${o*0.8}" r="${o*0.08}" fill="${t}"/>
|
|
68
|
+
<circle cx="${o*0.5}" cy="${o*0.8}" r="${o*0.08}" fill="${n}"/>
|
|
69
|
+
<circle cx="${o*0.8}" cy="${o*0.8}" r="${o*0.08}" fill="${t}"/>
|
|
70
70
|
</svg>
|
|
71
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
72
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
73
|
-
<ellipse cx="${
|
|
71
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function ge({primaryColor:t="#8B0000",secondaryColor:n="#FFD700",backgroundColor:r="#654321",size:o=50}={}){let a=`
|
|
72
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
73
|
+
<ellipse cx="${o*0.5}" cy="${o*0.5}" rx="${o*0.4}" ry="${o*0.45}" fill="${r}"/>
|
|
74
74
|
<!-- Shield patterns -->
|
|
75
|
-
<ellipse cx="${
|
|
76
|
-
<rect x="${
|
|
75
|
+
<ellipse cx="${o*0.5}" cy="${o*0.3}" rx="${o*0.2}" ry="${o*0.15}" fill="${t}"/>
|
|
76
|
+
<rect x="${o*0.4}" y="${o*0.5}" width="${o*0.2}" height="${o*0.3}" fill="${n}"/>
|
|
77
77
|
<!-- Decorative lines -->
|
|
78
|
-
<line x1="${
|
|
79
|
-
<line x1="${
|
|
78
|
+
<line x1="${o*0.3}" y1="${o*0.2}" x2="${o*0.7}" y2="${o*0.2}" stroke="${t}" stroke-width="3"/>
|
|
79
|
+
<line x1="${o*0.3}" y1="${o*0.8}" x2="${o*0.7}" y2="${o*0.8}" stroke="${t}" stroke-width="3"/>
|
|
80
80
|
</svg>
|
|
81
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
81
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function se({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:r="#FFFF00",backgroundColor:o="#FFFFFF",size:a=50}={}){let l=`
|
|
82
82
|
<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 ${a} ${a}">
|
|
83
|
-
<rect width="${a}" height="${a}" fill="${
|
|
83
|
+
<rect width="${a}" height="${a}" fill="${o}"/>
|
|
84
84
|
<!-- Ndebele geometric patterns -->
|
|
85
85
|
<polygon points="${a*0.2},${a*0.2} ${a*0.4},${a*0.2} ${a*0.3},${a*0.4}" fill="${t}"/>
|
|
86
86
|
<polygon points="${a*0.6},${a*0.2} ${a*0.8},${a*0.2} ${a*0.7},${a*0.4}" fill="${n}"/>
|
|
87
|
-
<polygon points="${a*0.2},${a*0.6} ${a*0.4},${a*0.6} ${a*0.3},${a*0.8}" fill="${
|
|
87
|
+
<polygon points="${a*0.2},${a*0.6} ${a*0.4},${a*0.6} ${a*0.3},${a*0.8}" fill="${r}"/>
|
|
88
88
|
<polygon points="${a*0.6},${a*0.6} ${a*0.8},${a*0.6} ${a*0.7},${a*0.8}" fill="${t}"/>
|
|
89
89
|
<!-- Center design -->
|
|
90
90
|
<circle cx="${a*0.5}" cy="${a*0.5}" r="${a*0.15}" fill="${n}"/>
|
|
91
|
-
<rect x="${a*0.45}" y="${a*0.45}" width="${a*0.1}" height="${a*0.1}" fill="${
|
|
91
|
+
<rect x="${a*0.45}" y="${a*0.45}" width="${a*0.1}" height="${a*0.1}" fill="${r}"/>
|
|
92
92
|
</svg>
|
|
93
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
94
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
95
|
-
<rect width="${
|
|
96
|
-
<circle cx="${
|
|
97
|
-
<circle cx="${
|
|
98
|
-
<circle cx="${
|
|
99
|
-
<circle cx="${
|
|
100
|
-
<circle cx="${
|
|
101
|
-
<circle cx="${
|
|
93
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function mo({primaryColor:t="#00A3DD",secondaryColor:n="#FCD116",backgroundColor:r="#1EB53A",size:o=50}={}){let a=`
|
|
94
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
95
|
+
<rect width="${o}" height="${o}" fill="${r}"/>
|
|
96
|
+
<circle cx="${o*0.25}" cy="${o*0.25}" r="${o*0.2}" fill="${t}" opacity="0.8"/>
|
|
97
|
+
<circle cx="${o*0.75}" cy="${o*0.75}" r="${o*0.2}" fill="${t}" opacity="0.8"/>
|
|
98
|
+
<circle cx="${o*0.25}" cy="${o*0.25}" r="${o*0.1}" fill="${n}"/>
|
|
99
|
+
<circle cx="${o*0.75}" cy="${o*0.75}" r="${o*0.1}" fill="${n}"/>
|
|
100
|
+
<circle cx="${o*0.75}" cy="${o*0.25}" r="${o*0.08}" fill="${n}" opacity="0.6"/>
|
|
101
|
+
<circle cx="${o*0.25}" cy="${o*0.75}" r="${o*0.08}" fill="${n}" opacity="0.6"/>
|
|
102
102
|
</svg>
|
|
103
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
103
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function vo({colors:t=["#FFD700","#228B22","#DC143C","#000000"],size:n=60}={}){let[r,o,a,l]=t,e=n/6,b=`
|
|
104
104
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
105
105
|
<rect width="${n}" height="${n}" fill="${l}"/>
|
|
106
106
|
<!-- Horizontal bands -->
|
|
107
|
-
<rect x="0" y="0" width="${n}" height="${
|
|
108
|
-
<rect x="0" y="${
|
|
109
|
-
<rect x="0" y="${
|
|
110
|
-
<rect x="0" y="${
|
|
111
|
-
<rect x="0" y="${
|
|
112
|
-
<rect x="0" y="${
|
|
107
|
+
<rect x="0" y="0" width="${n}" height="${e}" fill="${r}"/>
|
|
108
|
+
<rect x="0" y="${e}" width="${n}" height="${e}" fill="${o}"/>
|
|
109
|
+
<rect x="0" y="${e*2}" width="${n}" height="${e}" fill="${a}"/>
|
|
110
|
+
<rect x="0" y="${e*3}" width="${n}" height="${e}" fill="${r}"/>
|
|
111
|
+
<rect x="0" y="${e*4}" width="${n}" height="${e}" fill="${o}"/>
|
|
112
|
+
<rect x="0" y="${e*5}" width="${n}" height="${e}" fill="${a}"/>
|
|
113
113
|
<!-- Vertical accents -->
|
|
114
114
|
<rect x="${n*0.2}" y="0" width="3" height="${n}" fill="${l}" opacity="0.5"/>
|
|
115
115
|
<rect x="${n*0.4}" y="0" width="3" height="${n}" fill="${l}" opacity="0.5"/>
|
|
116
116
|
<rect x="${n*0.6}" y="0" width="3" height="${n}" fill="${l}" opacity="0.5"/>
|
|
117
117
|
<rect x="${n*0.8}" y="0" width="3" height="${n}" fill="${l}" opacity="0.5"/>
|
|
118
118
|
<!-- Kente squares -->
|
|
119
|
-
<rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${
|
|
119
|
+
<rect x="${n*0.1}" y="${n*0.1}" width="${n*0.15}" height="${n*0.15}" fill="${r}" stroke="${l}" stroke-width="1"/>
|
|
120
120
|
<rect x="${n*0.75}" y="${n*0.75}" width="${n*0.15}" height="${n*0.15}" fill="${a}" stroke="${l}" stroke-width="1"/>
|
|
121
121
|
</svg>
|
|
122
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
123
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
124
|
-
<rect width="${
|
|
122
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function po({symbolColor:t="#000000",backgroundColor:n="#CD853F",size:r=50}={}){let o=`
|
|
123
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
|
|
124
|
+
<rect width="${r}" height="${r}" fill="${n}"/>
|
|
125
125
|
<!-- Sankofa-inspired heart shape (go back and get it) -->
|
|
126
|
-
<path d="M${
|
|
127
|
-
C${
|
|
128
|
-
L${
|
|
129
|
-
L${
|
|
130
|
-
C${
|
|
126
|
+
<path d="M${r*0.5} ${r*0.2}
|
|
127
|
+
C${r*0.3} ${r*0.1} ${r*0.15} ${r*0.3} ${r*0.25} ${r*0.5}
|
|
128
|
+
L${r*0.5} ${r*0.8}
|
|
129
|
+
L${r*0.75} ${r*0.5}
|
|
130
|
+
C${r*0.85} ${r*0.3} ${r*0.7} ${r*0.1} ${r*0.5} ${r*0.2}"
|
|
131
131
|
fill="none" stroke="${t}" stroke-width="3"/>
|
|
132
132
|
<!-- Spiral detail -->
|
|
133
|
-
<circle cx="${
|
|
134
|
-
<circle cx="${
|
|
133
|
+
<circle cx="${r*0.35}" cy="${r*0.45}" r="${r*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
|
|
134
|
+
<circle cx="${r*0.65}" cy="${r*0.45}" r="${r*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
|
|
135
135
|
</svg>
|
|
136
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
136
|
+
`;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function uo({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[r,o,a]=t,l=n/10,e=`
|
|
137
137
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
138
|
-
<rect width="${n}" height="${n}" fill="${
|
|
138
|
+
<rect width="${n}" height="${n}" fill="${r}"/>
|
|
139
139
|
<!-- Horizontal stripes -->
|
|
140
|
-
<rect x="0" y="${l}" width="${n}" height="${l*0.5}" fill="${
|
|
140
|
+
<rect x="0" y="${l}" width="${n}" height="${l*0.5}" fill="${o}"/>
|
|
141
141
|
<rect x="0" y="${l*3}" width="${n}" height="${l*0.5}" fill="${a}"/>
|
|
142
|
-
<rect x="0" y="${l*5}" width="${n}" height="${l*0.5}" fill="${
|
|
142
|
+
<rect x="0" y="${l*5}" width="${n}" height="${l*0.5}" fill="${o}"/>
|
|
143
143
|
<rect x="0" y="${l*7}" width="${n}" height="${l*0.5}" fill="${a}"/>
|
|
144
|
-
<rect x="0" y="${l*9}" width="${n}" height="${l*0.5}" fill="${
|
|
144
|
+
<rect x="0" y="${l*9}" width="${n}" height="${l*0.5}" fill="${o}"/>
|
|
145
145
|
<!-- Vertical accent lines -->
|
|
146
|
-
<rect x="${n*0.48}" y="0" width="${l*0.4}" height="${n}" fill="${
|
|
146
|
+
<rect x="${n*0.48}" y="0" width="${l*0.4}" height="${n}" fill="${o}" opacity="0.7"/>
|
|
147
147
|
<!-- Diamond motifs -->
|
|
148
148
|
<polygon points="${n*0.25},${n*0.3} ${n*0.35},${n*0.5} ${n*0.25},${n*0.7} ${n*0.15},${n*0.5}"
|
|
149
|
-
fill="${
|
|
149
|
+
fill="${o}" stroke="${a}" stroke-width="1"/>
|
|
150
150
|
<polygon points="${n*0.75},${n*0.3} ${n*0.85},${n*0.5} ${n*0.75},${n*0.7} ${n*0.65},${n*0.5}"
|
|
151
|
-
fill="${
|
|
151
|
+
fill="${o}" stroke="${a}" stroke-width="1"/>
|
|
152
152
|
</svg>
|
|
153
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
153
|
+
`;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}function $o({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:r="#FFD700",backgroundColor:o="#FFFFFF",size:a=60}={}){let l=`
|
|
154
154
|
<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 ${a} ${a}">
|
|
155
|
-
<rect width="${a}" height="${a}" fill="${
|
|
155
|
+
<rect width="${a}" height="${a}" fill="${o}"/>
|
|
156
156
|
<!-- Bold circular motifs -->
|
|
157
157
|
<circle cx="${a*0.3}" cy="${a*0.3}" r="${a*0.25}" fill="${t}"/>
|
|
158
158
|
<circle cx="${a*0.3}" cy="${a*0.3}" r="${a*0.15}" fill="${n}"/>
|
|
159
|
-
<circle cx="${a*0.3}" cy="${a*0.3}" r="${a*0.08}" fill="${
|
|
159
|
+
<circle cx="${a*0.3}" cy="${a*0.3}" r="${a*0.08}" fill="${r}"/>
|
|
160
160
|
|
|
161
161
|
<circle cx="${a*0.8}" cy="${a*0.8}" r="${a*0.2}" fill="${n}"/>
|
|
162
162
|
<circle cx="${a*0.8}" cy="${a*0.8}" r="${a*0.1}" fill="${t}"/>
|
|
@@ -166,108 +166,108 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
166
166
|
stroke="${t}" stroke-width="4"/>
|
|
167
167
|
|
|
168
168
|
<!-- Small dots -->
|
|
169
|
-
<circle cx="${a*0.1}" cy="${a*0.8}" r="${a*0.05}" fill="${
|
|
170
|
-
<circle cx="${a*0.9}" cy="${a*0.2}" r="${a*0.05}" fill="${
|
|
169
|
+
<circle cx="${a*0.1}" cy="${a*0.8}" r="${a*0.05}" fill="${r}"/>
|
|
170
|
+
<circle cx="${a*0.9}" cy="${a*0.2}" r="${a*0.05}" fill="${r}"/>
|
|
171
171
|
</svg>
|
|
172
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
173
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
174
|
-
<rect width="${
|
|
172
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function wo({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:r="#8B4513",size:o=60}={}){let a=`
|
|
173
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
174
|
+
<rect width="${o}" height="${o}" fill="${t}"/>
|
|
175
175
|
<!-- Zigzags -->
|
|
176
|
-
<polyline points="0,${
|
|
176
|
+
<polyline points="0,${o*0.2} ${o*0.25},0 ${o*0.5},${o*0.2} ${o*0.75},0 ${o},${o*0.2}"
|
|
177
177
|
fill="none" stroke="${n}" stroke-width="3"/>
|
|
178
|
-
<polyline points="0,${
|
|
178
|
+
<polyline points="0,${o*0.8} ${o*0.25},${o} ${o*0.5},${o*0.8} ${o*0.75},${o} ${o},${o*0.8}"
|
|
179
179
|
fill="none" stroke="${n}" stroke-width="3"/>
|
|
180
180
|
<!-- Crosses -->
|
|
181
|
-
<line x1="${
|
|
182
|
-
<line x1="${
|
|
183
|
-
<line x1="${
|
|
184
|
-
<line x1="${
|
|
181
|
+
<line x1="${o*0.25}" y1="${o*0.4}" x2="${o*0.25}" y2="${o*0.6}" stroke="${n}" stroke-width="2"/>
|
|
182
|
+
<line x1="${o*0.15}" y1="${o*0.5}" x2="${o*0.35}" y2="${o*0.5}" stroke="${n}" stroke-width="2"/>
|
|
183
|
+
<line x1="${o*0.75}" y1="${o*0.4}" x2="${o*0.75}" y2="${o*0.6}" stroke="${n}" stroke-width="2"/>
|
|
184
|
+
<line x1="${o*0.65}" y1="${o*0.5}" x2="${o*0.85}" y2="${o*0.5}" stroke="${n}" stroke-width="2"/>
|
|
185
185
|
<!-- Dots -->
|
|
186
|
-
<circle cx="${
|
|
186
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.08}" fill="${r}"/>
|
|
187
187
|
</svg>
|
|
188
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
189
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
190
|
-
<rect width="${
|
|
188
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function xo({primaryColor:t="#D2B48C",secondaryColor:n="#3E2723",size:r=60}={}){let o=`
|
|
189
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
|
|
190
|
+
<rect width="${r}" height="${r}" fill="${t}"/>
|
|
191
191
|
<!-- Interlocking diamonds/rectangles -->
|
|
192
|
-
<rect x="${
|
|
193
|
-
<rect x="${
|
|
194
|
-
<rect x="${
|
|
192
|
+
<rect x="${r*0.1}" y="${r*0.1}" width="${r*0.3}" height="${r*0.3}" fill="${n}"/>
|
|
193
|
+
<rect x="${r*0.6}" y="${r*0.6}" width="${r*0.3}" height="${r*0.3}" fill="${n}"/>
|
|
194
|
+
<rect x="${r*0.6}" y="${r*0.1}" width="${r*0.3}" height="${r*0.3}"
|
|
195
195
|
fill="none" stroke="${n}" stroke-width="4"/>
|
|
196
|
-
<rect x="${
|
|
196
|
+
<rect x="${r*0.1}" y="${r*0.6}" width="${r*0.3}" height="${r*0.3}"
|
|
197
197
|
fill="none" stroke="${n}" stroke-width="4"/>
|
|
198
198
|
<!-- Center lines -->
|
|
199
|
-
<line x1="${
|
|
200
|
-
<line x1="${
|
|
199
|
+
<line x1="${r*0.4}" y1="${r*0.5}" x2="${r*0.6}" y2="${r*0.5}" stroke="${n}" stroke-width="2"/>
|
|
200
|
+
<line x1="${r*0.5}" y1="${r*0.4}" x2="${r*0.5}" y2="${r*0.6}" stroke="${n}" stroke-width="2"/>
|
|
201
201
|
</svg>
|
|
202
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
203
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
204
|
-
<rect width="${
|
|
202
|
+
`;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function Ao({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:r="#B22222",size:o=60}={}){let a=`
|
|
203
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
204
|
+
<rect width="${o}" height="${o}" fill="${n}"/>
|
|
205
205
|
<!-- Spiral/Diamond Motif -->
|
|
206
|
-
<path d="M${
|
|
207
|
-
L${
|
|
208
|
-
L${
|
|
209
|
-
L${
|
|
206
|
+
<path d="M${o*0.5} ${o*0.1}
|
|
207
|
+
L${o*0.9} ${o*0.5}
|
|
208
|
+
L${o*0.5} ${o*0.9}
|
|
209
|
+
L${o*0.1} ${o*0.5} Z"
|
|
210
210
|
fill="${t}"/>
|
|
211
|
-
<path d="M${
|
|
212
|
-
L${
|
|
213
|
-
L${
|
|
214
|
-
L${
|
|
211
|
+
<path d="M${o*0.5} ${o*0.3}
|
|
212
|
+
L${o*0.7} ${o*0.5}
|
|
213
|
+
L${o*0.5} ${o*0.7}
|
|
214
|
+
L${o*0.3} ${o*0.5} Z"
|
|
215
215
|
fill="${n}"/>
|
|
216
|
-
<circle cx="${
|
|
216
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${r}"/>
|
|
217
217
|
</svg>
|
|
218
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
219
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
220
|
-
<rect width="${
|
|
218
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function _o({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:r=40}={}){let[o,a,l]=t,e=`
|
|
219
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
|
|
220
|
+
<rect width="${r}" height="${r}" fill="${n}"/>
|
|
221
221
|
<!-- Diamond Chain -->
|
|
222
|
-
<polygon points="${
|
|
223
|
-
fill="${
|
|
224
|
-
<polygon points="${
|
|
222
|
+
<polygon points="${r*0.5},0 ${r},${r*0.5} ${r*0.5},${r} 0,${r*0.5}"
|
|
223
|
+
fill="${o}" opacity="0.2"/>
|
|
224
|
+
<polygon points="${r*0.5},${r*0.2} ${r*0.8},${r*0.5} ${r*0.5},${r*0.8} ${r*0.2},${r*0.5}"
|
|
225
225
|
fill="${a}"/>
|
|
226
|
-
<rect x="${
|
|
226
|
+
<rect x="${r*0.4}" y="${r*0.4}" width="${r*0.2}" height="${r*0.2}" fill="${l}"/>
|
|
227
227
|
<!-- Side accents -->
|
|
228
|
-
<line x1="0" y1="0" x2="0" y2="${
|
|
229
|
-
<line x1="${
|
|
228
|
+
<line x1="0" y1="0" x2="0" y2="${r}" stroke="${o}" stroke-width="4"/>
|
|
229
|
+
<line x1="${r}" y1="0" x2="${r}" y2="${r}" stroke="${o}" stroke-width="4"/>
|
|
230
230
|
</svg>
|
|
231
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
231
|
+
`;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}function ko({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:r=2}={}){let[o,a,l,e]=t,b=`
|
|
232
232
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
233
233
|
<rect width="${n}" height="${n}" fill="#FFFFFF"/>
|
|
234
|
-
<rect x="${
|
|
235
|
-
width="${n-
|
|
236
|
-
fill="none" stroke="#000000" stroke-width="${
|
|
234
|
+
<rect x="${r}" y="${r}"
|
|
235
|
+
width="${n-r*2}" height="${n-r*2}"
|
|
236
|
+
fill="none" stroke="#000000" stroke-width="${r}"/>
|
|
237
237
|
<rect x="${n*0.15}" y="${n*0.15}" width="${n*0.35}" height="${n*0.35}"
|
|
238
|
-
fill="${
|
|
238
|
+
fill="${o}" stroke="#000000" stroke-width="${r/2}"/>
|
|
239
239
|
<rect x="${n*0.5}" y="${n*0.15}" width="${n*0.35}" height="${n*0.35}"
|
|
240
|
-
fill="${a}" stroke="#000000" stroke-width="${
|
|
240
|
+
fill="${a}" stroke="#000000" stroke-width="${r/2}"/>
|
|
241
241
|
<rect x="${n*0.15}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
|
|
242
|
-
fill="${l}" stroke="#000000" stroke-width="${
|
|
242
|
+
fill="${l}" stroke="#000000" stroke-width="${r/2}"/>
|
|
243
243
|
<rect x="${n*0.5}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
|
|
244
|
-
fill="${
|
|
244
|
+
fill="${e}" stroke="#000000" stroke-width="${r/2}"/>
|
|
245
245
|
<polygon points="${n/2},${n*0.3} ${n*0.7},${n/2} ${n/2},${n*0.7} ${n*0.3},${n/2}"
|
|
246
|
-
fill="#FFFFFF" stroke="#000000" stroke-width="${
|
|
246
|
+
fill="#FFFFFF" stroke="#000000" stroke-width="${r}"/>
|
|
247
247
|
</svg>
|
|
248
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
248
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}function qo({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[r,o,a,l,e]=t,b=n/10,f=`
|
|
249
249
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
250
|
-
<rect width="${n}" height="${n}" fill="${
|
|
250
|
+
<rect width="${n}" height="${n}" fill="${o}"/>
|
|
251
251
|
<!-- Triangle pattern (isivivane - sacred cairn) -->
|
|
252
252
|
<polygon points="${n*0.5},${n*0.1} ${n*0.9},${n*0.9} ${n*0.1},${n*0.9}"
|
|
253
|
-
fill="none" stroke="${
|
|
253
|
+
fill="none" stroke="${r}" stroke-width="2"/>
|
|
254
254
|
<polygon points="${n*0.5},${n*0.25} ${n*0.75},${n*0.75} ${n*0.25},${n*0.75}"
|
|
255
255
|
fill="${a}"/>
|
|
256
256
|
<!-- Beadwork dots -->
|
|
257
|
-
<circle cx="${n*0.5}" cy="${n*0.35}" r="${
|
|
258
|
-
<circle cx="${n*0.35}" cy="${n*0.6}" r="${
|
|
259
|
-
<circle cx="${n*0.65}" cy="${n*0.6}" r="${
|
|
260
|
-
<circle cx="${n*0.5}" cy="${n*0.8}" r="${
|
|
257
|
+
<circle cx="${n*0.5}" cy="${n*0.35}" r="${b}" fill="${r}"/>
|
|
258
|
+
<circle cx="${n*0.35}" cy="${n*0.6}" r="${b}" fill="${l}"/>
|
|
259
|
+
<circle cx="${n*0.65}" cy="${n*0.6}" r="${b}" fill="${e}"/>
|
|
260
|
+
<circle cx="${n*0.5}" cy="${n*0.8}" r="${b}" fill="${r}"/>
|
|
261
261
|
<!-- Border dots -->
|
|
262
|
-
<circle cx="${n*0.1}" cy="${n*0.1}" r="${
|
|
263
|
-
<circle cx="${n*0.9}" cy="${n*0.1}" r="${
|
|
262
|
+
<circle cx="${n*0.1}" cy="${n*0.1}" r="${b*0.7}" fill="${a}"/>
|
|
263
|
+
<circle cx="${n*0.9}" cy="${n*0.1}" r="${b*0.7}" fill="${l}"/>
|
|
264
264
|
</svg>
|
|
265
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
265
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Lo({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[r,o,a,l]=t,e=`
|
|
266
266
|
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
267
|
-
<rect width="${n}" height="${n}" fill="${
|
|
267
|
+
<rect width="${n}" height="${n}" fill="${r}"/>
|
|
268
268
|
<!-- Shield shape (central to Eswatini culture) -->
|
|
269
269
|
<ellipse cx="${n*0.5}" cy="${n*0.45}" rx="${n*0.35}" ry="${n*0.4}"
|
|
270
|
-
fill="${
|
|
270
|
+
fill="${o}" stroke="${a}" stroke-width="3"/>
|
|
271
271
|
<!-- Inner pattern -->
|
|
272
272
|
<ellipse cx="${n*0.5}" cy="${n*0.45}" rx="${n*0.2}" ry="${n*0.25}"
|
|
273
273
|
fill="${a}"/>
|
|
@@ -282,72 +282,72 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
282
282
|
<polygon points="${n*0.1},${n*0.3} ${n*0.05},${n*0.5} ${n*0.15},${n*0.5}" fill="${l}"/>
|
|
283
283
|
<polygon points="${n*0.9},${n*0.3} ${n*0.85},${n*0.5} ${n*0.95},${n*0.5}" fill="${l}"/>
|
|
284
284
|
</svg>
|
|
285
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
286
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
287
|
-
<rect width="${
|
|
285
|
+
`;return`data:image/svg+xml,${encodeURIComponent(e.trim())}`}function Ho({primaryColor:t="#FFFFFF",accentColor:n="#00A86B",backgroundColor:r="#1a1a2e",size:o=50}={}){let a=`
|
|
286
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
287
|
+
<rect width="${o}" height="${o}" fill="${r}"/>
|
|
288
288
|
<!-- Horizontal bands -->
|
|
289
|
-
<rect x="0" y="${
|
|
290
|
-
<rect x="0" y="${
|
|
289
|
+
<rect x="0" y="${o*0.2}" width="${o}" height="${o*0.1}" fill="${t}"/>
|
|
290
|
+
<rect x="0" y="${o*0.7}" width="${o}" height="${o*0.1}" fill="${t}"/>
|
|
291
291
|
<!-- Vertical bands -->
|
|
292
|
-
<rect x="${
|
|
293
|
-
<rect x="${
|
|
292
|
+
<rect x="${o*0.2}" y="0" width="${o*0.1}" height="${o}" fill="${n}"/>
|
|
293
|
+
<rect x="${o*0.7}" y="0" width="${o*0.1}" height="${o}" fill="${n}"/>
|
|
294
294
|
<!-- Central diamond -->
|
|
295
|
-
<polygon points="${
|
|
295
|
+
<polygon points="${o*0.5},${o*0.35} ${o*0.65},${o*0.5} ${o*0.5},${o*0.65} ${o*0.35},${o*0.5}"
|
|
296
296
|
fill="${n}" stroke="${t}" stroke-width="2"/>
|
|
297
297
|
<!-- Corner triangles -->
|
|
298
|
-
<polygon points="0,0 ${
|
|
299
|
-
<polygon points="${
|
|
300
|
-
<polygon points="0,${
|
|
301
|
-
<polygon points="${
|
|
298
|
+
<polygon points="0,0 ${o*0.15},0 0,${o*0.15}" fill="${n}"/>
|
|
299
|
+
<polygon points="${o},0 ${o*0.85},0 ${o},${o*0.15}" fill="${n}"/>
|
|
300
|
+
<polygon points="0,${o} ${o*0.15},${o} 0,${o*0.85}" fill="${n}"/>
|
|
301
|
+
<polygon points="${o},${o} ${o*0.85},${o} ${o},${o*0.85}" fill="${n}"/>
|
|
302
302
|
</svg>
|
|
303
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
303
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function me(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function Mo({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:r="#FFD700",backgroundColor:o="#F5F5DC",size:a=60}={}){let l=`
|
|
304
304
|
<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${a}" viewBox="0 0 ${a} ${a}">
|
|
305
|
-
<rect width="${a}" height="${a}" fill="${
|
|
305
|
+
<rect width="${a}" height="${a}" fill="${o}"/>
|
|
306
306
|
<!-- Lozenge (Diamond) - universal protective symbol -->
|
|
307
307
|
<polygon points="${a*0.5},${a*0.1} ${a*0.9},${a*0.5} ${a*0.5},${a*0.9} ${a*0.1},${a*0.5}"
|
|
308
308
|
fill="${t}" stroke="${n}" stroke-width="2"/>
|
|
309
309
|
<!-- Inner geometric details -->
|
|
310
|
-
<line x1="${a*0.5}" y1="${a*0.1}" x2="${a*0.5}" y2="${a*0.9}" stroke="${
|
|
311
|
-
<line x1="${a*0.1}" y1="${a*0.5}" x2="${a*0.9}" y2="${a*0.5}" stroke="${
|
|
310
|
+
<line x1="${a*0.5}" y1="${a*0.1}" x2="${a*0.5}" y2="${a*0.9}" stroke="${r}" stroke-width="2"/>
|
|
311
|
+
<line x1="${a*0.1}" y1="${a*0.5}" x2="${a*0.9}" y2="${a*0.5}" stroke="${r}" stroke-width="2"/>
|
|
312
312
|
<!-- X symbols (Fibula/Cross) -->
|
|
313
313
|
<line x1="${a*0.4}" y1="${a*0.4}" x2="${a*0.6}" y2="${a*0.6}" stroke="${n}" stroke-width="2"/>
|
|
314
314
|
<line x1="${a*0.6}" y1="${a*0.4}" x2="${a*0.4}" y2="${a*0.6}" stroke="${n}" stroke-width="2"/>
|
|
315
315
|
</svg>
|
|
316
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
317
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
318
|
-
<rect width="${
|
|
316
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Ro({primaryColor:t="#4B0082",secondaryColor:n="#8A2BE2",accentColor:r="#FFFFFF",size:o=50}={}){let a=`
|
|
317
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
318
|
+
<rect width="${o}" height="${o}" fill="${t}"/>
|
|
319
319
|
<!-- Resist circles (Oniko) -->
|
|
320
|
-
<circle cx="${
|
|
321
|
-
<circle cx="${
|
|
322
|
-
<circle cx="${
|
|
320
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.35}" fill="none" stroke="${n}" stroke-width="3"/>
|
|
321
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.25}" fill="none" stroke="${r}" stroke-width="2" stroke-dasharray="4 2"/>
|
|
322
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${r}" opacity="0.8"/>
|
|
323
323
|
<!-- Corner ripples -->
|
|
324
|
-
<path d="M0,0 Q${
|
|
325
|
-
<path d="M${
|
|
324
|
+
<path d="M0,0 Q${o*0.2},0 ${o*0.2},${o*0.2} Q0,${o*0.2} 0,0" fill="${n}"/>
|
|
325
|
+
<path d="M${o},${o} Q${o*0.8},${o} ${o*0.8},${o*0.8} Q${o},${o*0.8} ${o},${o}" fill="${n}"/>
|
|
326
326
|
</svg>
|
|
327
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
328
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
329
|
-
<rect width="${
|
|
327
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function ve({primaryColor:t="#2D3D6B",secondaryColor:n="#6B8CC7",accentColor:r="#FFFFFF",size:o=60}={}){let a=`
|
|
328
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
329
|
+
<rect width="${o}" height="${o}" fill="${t}"/>
|
|
330
330
|
<!-- Southern Cross / Tuareg Star -->
|
|
331
|
-
<path d="M${
|
|
332
|
-
fill="none" stroke="${
|
|
333
|
-
<circle cx="${
|
|
331
|
+
<path d="M${o*0.5} 0 L${o*0.6} ${o*0.4} L${o} ${o*0.5} L${o*0.6} ${o*0.6} L${o*0.5} ${o} L${o*0.4} ${o*0.6} L0 ${o*0.5} L${o*0.4} ${o*0.4} Z"
|
|
332
|
+
fill="none" stroke="${r}" stroke-width="2"/>
|
|
333
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${n}"/>
|
|
334
334
|
</svg>
|
|
335
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
336
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
337
|
-
<rect width="${
|
|
338
|
-
<path d="M${
|
|
335
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function pe({inkColor:t="#3A2E2C",parchmentColor:n="#F4E4BC",size:r=50}={}){let o=`
|
|
336
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 ${r} ${r}">
|
|
337
|
+
<rect width="${r}" height="${r}" fill="${n}"/>
|
|
338
|
+
<path d="M${r*0.2} ${r*0.2} L${r*0.4} ${r*0.2} M${r*0.3} ${r*0.2} L${r*0.3} ${r*0.5} Q${r*0.4} ${r*0.6} ${r*0.2} ${r*0.7}"
|
|
339
339
|
fill="none" stroke="${t}" stroke-width="3" stroke-linecap="round"/>
|
|
340
|
-
<path d="M${
|
|
340
|
+
<path d="M${r*0.6} ${r*0.3} C${r*0.8} ${r*0.3} ${r*0.8} ${r*0.6} ${r*0.6} ${r*0.6} L${r*0.8} ${r*0.8}"
|
|
341
341
|
fill="none" stroke="${t}" stroke-width="3" stroke-linecap="round"/>
|
|
342
342
|
</svg>
|
|
343
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
344
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
345
|
-
<rect width="${
|
|
346
|
-
<path d="M${
|
|
347
|
-
fill="${t}" stroke="${
|
|
343
|
+
`;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function ue({clayColor:t="#4E342E",earthColor:n="#3E2723",accentColor:r="#BCAAA4",size:o=60}={}){let a=`
|
|
344
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
345
|
+
<rect width="${o}" height="${o}" fill="${n}"/>
|
|
346
|
+
<path d="M${o*0.2} ${o*0.5} Q${o*0.3} ${o*0.2} ${o*0.5} ${o*0.3} T${o*0.8} ${o*0.5} Q${o*0.7} ${o*0.8} ${o*0.5} ${o*0.7} T${o*0.2} ${o*0.5}"
|
|
347
|
+
fill="${t}" stroke="${r}" stroke-width="2"/>
|
|
348
348
|
</svg>
|
|
349
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
350
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
349
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Fr({primaryColor:t="#334155",secondaryColor:n="#1e293b",size:r=100}={}){let o=`
|
|
350
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${r}" viewBox="0 0 100 100">
|
|
351
351
|
<rect width="100" height="100" fill="${n}"/>
|
|
352
352
|
<path d="M10 10 H90 V90 H10 Z" fill="none" stroke="${t}" stroke-width="0.5" opacity="0.3"/>
|
|
353
353
|
<path d="M20 20 V50 H50 V80 H80" fill="none" stroke="${t}" stroke-width="1"/>
|
|
@@ -355,20 +355,80 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
355
355
|
<circle cx="80" cy="80" r="2" fill="${t}"/>
|
|
356
356
|
<circle cx="50" cy="50" r="1.5" fill="${t}"/>
|
|
357
357
|
</svg>
|
|
358
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
358
|
+
`;return`data:image/svg+xml,${encodeURIComponent(o.trim())}`}function $e({primaryColor:t="#000000",secondaryColor:n="#FCD116",backgroundColor:r="#FFFFFF",size:o=50}={}){let a=`
|
|
359
|
+
|
|
360
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}">
|
|
361
|
+
|
|
362
|
+
<rect width="${o}" height="${o}" fill="${r}"/>
|
|
363
|
+
|
|
364
|
+
<!-- Adire tie-dye circles -->
|
|
365
|
+
|
|
366
|
+
<circle cx="${o*0.2}" cy="${o*0.2}" r="${o*0.15}" fill="${t}"/>
|
|
367
|
+
|
|
368
|
+
<circle cx="${o*0.8}" cy="${o*0.2}" r="${o*0.15}" fill="${t}"/>
|
|
369
|
+
|
|
370
|
+
<circle cx="${o*0.2}" cy="${o*0.8}" r="${o*0.15}" fill="${t}"/>
|
|
371
|
+
|
|
372
|
+
<circle cx="${o*0.8}" cy="${o*0.8}" r="${o*0.15}" fill="${t}"/>
|
|
373
|
+
|
|
374
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${n}"/>
|
|
375
|
+
|
|
376
|
+
<!-- Connecting lines -->
|
|
377
|
+
|
|
378
|
+
<line x1="${o*0.2}" y1="${o*0.2}" x2="${o*0.8}" y2="${o*0.8}" stroke="${t}" stroke-width="2"/>
|
|
379
|
+
|
|
380
|
+
<line x1="${o*0.8}" y1="${o*0.2}" x2="${o*0.2}" y2="${o*0.8}" stroke="${t}" stroke-width="2"/>
|
|
381
|
+
|
|
382
|
+
</svg>
|
|
383
|
+
|
|
384
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function we({colors:t=["#000000","#FCD116","#E82127","#006B3F"],size:n=60}={}){let[r,o,a,l]=t,e=n/6,b=`
|
|
385
|
+
|
|
386
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${n}" viewBox="0 0 ${n} ${n}">
|
|
387
|
+
|
|
388
|
+
<rect width="${n}" height="${n}" fill="${o}"/>
|
|
389
|
+
|
|
390
|
+
<!-- Horizontal black stripes -->
|
|
391
|
+
|
|
392
|
+
<rect x="0" y="0" width="${n}" height="${e}" fill="${r}"/>
|
|
393
|
+
|
|
394
|
+
<rect x="0" y="${e*2}" width="${n}" height="${e}" fill="${r}"/>
|
|
395
|
+
|
|
396
|
+
<rect x="0" y="${e*4}" width="${n}" height="${e}" fill="${r}"/>
|
|
397
|
+
|
|
398
|
+
<!-- Vertical red stripes -->
|
|
399
|
+
|
|
400
|
+
<rect x="0" y="0" width="${e}" height="${n}" fill="${a}" opacity="0.6"/>
|
|
401
|
+
|
|
402
|
+
<rect x="${e*2}" y="0" width="${e}" height="${n}" fill="${a}" opacity="0.6"/>
|
|
403
|
+
|
|
404
|
+
<rect x="${e*4}" y="0" width="${e}" height="${n}" fill="${a}" opacity="0.6"/>
|
|
405
|
+
|
|
406
|
+
<!-- Green corner squares -->
|
|
407
|
+
|
|
408
|
+
<rect x="0" y="0" width="${e*0.8}" height="${e*0.8}" fill="${l}"/>
|
|
409
|
+
|
|
410
|
+
<rect x="${n-e*0.8}" y="0" width="${e*0.8}" height="${e*0.8}" fill="${l}"/>
|
|
411
|
+
|
|
412
|
+
<rect x="0" y="${n-e*0.8}" width="${e*0.8}" height="${e*0.8}" fill="${l}"/>
|
|
413
|
+
|
|
414
|
+
<rect x="${n-e*0.8}" y="${n-e*0.8}" width="${e*0.8}" height="${e*0.8}" fill="${l}"/>
|
|
415
|
+
|
|
416
|
+
</svg>
|
|
417
|
+
|
|
418
|
+
`;return`data:image/svg+xml,${encodeURIComponent(b.trim())}`}var Mt;var Rt=m(()=>{Mt={generatePolygon:fe,generateShuka:co,generateHadzabe:go,generateKanga:he,generateKangaBorder:so,generateKitenge:mo,generateMasaiShield:ge,generateTibeb:_o,generateImigongo:Ao,generateKente:vo,generateAdinkra:po,generateAsoOke:uo,generateAnkara:$o,generateBogolan:wo,generateAdire:Ro,generateKuba:xo,generateKubaBorder:de,generateBerber:Mo,generateNdebele:ko,generateNdebelePaint:se,generateZulu:qo,generateZuluBeads:ce,generateSwazi:Lo,generateXhosa:Ho,generateYorubaAdire:$e,generateAkanKente:we,applyPattern:me,generateTuareg:ve,generateGeez:pe,generateBoli:ue,generateCircuit:Fr,circuit:Fr}});class Yo{constructor(t){this.value=t,this.__type="RawHtml",Object.freeze(this)}toString(){return this.value}valueOf(){return this.value}}function _e(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Wr({title:t="AfriCode App",meta:n="",stylesheet:r="/styles/africanity.css",children:o}={}){return c`<!DOCTYPE html>
|
|
359
419
|
<html lang="en">
|
|
360
420
|
<head>
|
|
361
421
|
<meta charset="UTF-8">
|
|
362
422
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
363
423
|
<title>${t}</title>
|
|
364
424
|
${n}
|
|
365
|
-
${
|
|
425
|
+
${r?c`<link rel="stylesheet" href="${r}">`:""}
|
|
366
426
|
<script type="module" src="/core/sdk.js"></script>
|
|
367
427
|
</head>
|
|
368
428
|
<body>
|
|
369
|
-
${
|
|
429
|
+
${o}
|
|
370
430
|
</body>
|
|
371
|
-
</html>`}function Yr(t){if(t instanceof Ho)return t.toString();if(Array.isArray(t))return t.map(Yr).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return rb(t)}var d=(t,...n)=>{let o="";for(let r=0;r<t.length;r++)if(o+=t[r],r<n.length)o+=Yr(n[r]);return new Ho(o)};var H,Lo,g,W=(t)=>{switch(typeof t){case"undefined":return g.undefined;case"string":return g.string;case"number":return Number.isNaN(t)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":if(Array.isArray(t))return g.array;if(t===null)return g.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return g.promise;if(typeof Map<"u"&&t instanceof Map)return g.map;if(typeof Set<"u"&&t instanceof Set)return g.set;if(typeof Date<"u"&&t instanceof Date)return g.date;return g.object;default:return g.unknown}};var Yt=m(()=>{(function(t){t.assertEqual=(a)=>{};function n(a){}t.assertIs=n;function o(a){throw Error()}t.assertNever=o,t.arrayToEnum=(a)=>{let l={};for(let b of a)l[b]=b;return l},t.getValidEnumValues=(a)=>{let l=t.objectKeys(a).filter((e)=>typeof a[a[e]]!=="number"),b={};for(let e of l)b[e]=a[e];return t.objectValues(b)},t.objectValues=(a)=>{return t.objectKeys(a).map(function(l){return a[l]})},t.objectKeys=typeof Object.keys==="function"?(a)=>Object.keys(a):(a)=>{let l=[];for(let b in a)if(Object.prototype.hasOwnProperty.call(a,b))l.push(b);return l},t.find=(a,l)=>{for(let b of a)if(l(b))return b;return},t.isInteger=typeof Number.isInteger==="function"?(a)=>Number.isInteger(a):(a)=>typeof a==="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,l=" | "){return a.map((b)=>typeof b==="string"?`'${b}'`:b).join(l)}t.joinValues=r,t.jsonStringifyReplacer=(a,l)=>{if(typeof l==="bigint")return l.toString();return l}})(H||(H={}));(function(t){t.mergeShapes=(n,o)=>{return{...n,...o}}})(Lo||(Lo={}));g=H.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var c,ab=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},J;var pn=m(()=>{Yt();c=H.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);J=class J extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(o)=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,n);else this.__proto__=n;this.name="ZodError",this.issues=t}format(t){let n=t||function(a){return a.message},o={_errors:[]},r=(a)=>{for(let l of a.issues)if(l.code==="invalid_union")l.unionErrors.map(r);else if(l.code==="invalid_return_type")r(l.returnTypeError);else if(l.code==="invalid_arguments")r(l.argumentsError);else if(l.path.length===0)o._errors.push(n(l));else{let b=o,e=0;while(e<l.path.length){let i=l.path[e];if(e!==l.path.length-1)b[i]=b[i]||{_errors:[]};else b[i]=b[i]||{_errors:[]},b[i]._errors.push(n(l));b=b[i],e++}}};return r(this),o}static assert(t){if(!(t instanceof J))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,H.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let a=r.path[0];n[a]=n[a]||[],n[a].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};J.create=(t)=>{return new J(t)}});var lb=(t,n)=>{let o;switch(t.code){case c.invalid_type:if(t.received===g.undefined)o="Required";else o=`Expected ${t.expected}, received ${t.received}`;break;case c.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(t.expected,H.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:o=`Unrecognized key(s) in object: ${H.joinValues(t.keys,", ")}`;break;case c.invalid_union:o="Invalid input";break;case c.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${H.joinValues(t.options)}`;break;case c.invalid_enum_value:o=`Invalid enum value. Expected ${H.joinValues(t.options)}, received '${t.received}'`;break;case c.invalid_arguments:o="Invalid function arguments";break;case c.invalid_return_type:o="Invalid function return type";break;case c.invalid_date:o="Invalid date";break;case c.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(o=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")o=`${o} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)o=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)o=`Invalid input: must end with "${t.validation.endsWith}"`;else H.assertNever(t.validation);else if(t.validation!=="regex")o=`Invalid ${t.validation}`;else o="Invalid";break;case c.too_small:if(t.type==="array")o=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")o=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")o=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")o=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else o="Invalid input";break;case c.too_big:if(t.type==="array")o=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")o=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")o=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")o=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")o=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else o="Invalid input";break;case c.custom:o="Invalid input";break;case c.invalid_intersection_types:o="Intersection results could not be merged";break;case c.not_multiple_of:o=`Number must be a multiple of ${t.multipleOf}`;break;case c.not_finite:o="Number must be finite";break;default:o=n.defaultError,H.assertNever(t)}return{message:o}},j;var Mo=m(()=>{pn();Yt();j=lb});function bb(t){Sr=t}function ct(){return Sr}var Sr;var mn=m(()=>{Mo();Sr=j});function p(t,n){let o=ct(),r=St({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o===j?void 0:j].filter((a)=>!!a)});t.common.issues.push(r)}class S{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return x;if(r.status==="dirty")t.dirty();o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let a=await r.key,l=await r.value;o.push({key:a,value:l})}return S.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:a,value:l}=r;if(a.status==="aborted")return x;if(l.status==="aborted")return x;if(a.status==="dirty")t.dirty();if(l.status==="dirty")t.dirty();if(a.value!=="__proto__"&&(typeof l.value<"u"||r.alwaysSet))o[a.value]=l.value}return{status:t.value,value:o}}}var St=(t)=>{let{data:n,path:o,errorMaps:r,issueData:a}=t,l=[...o,...a.path||[]],b={...a,path:l};if(a.message!==void 0)return{...a,path:l,message:a.message};let e="",i=r.filter(($)=>!!$).slice().reverse();for(let $ of i)e=$(b,{data:n,defaultError:e}).message;return{...a,path:l,message:e}},eb,x,at=(t)=>({status:"dirty",value:t}),R=(t)=>({status:"valid",value:t}),$n=(t)=>t.status==="aborted",wn=(t)=>t.status==="dirty",P=(t)=>t.status==="valid",dt=(t)=>typeof Promise<"u"&&t instanceof Promise;var Yo=m(()=>{mn();Mo();eb=[];x=Object.freeze({status:"aborted"})});var Rr=()=>{};var w;var Xr=m(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(w||(w={}))});class E{constructor(t,n,o,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=r}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function _(t){if(!t)return{};let{errorMap:n,invalid_type_error:o,required_error:r,description:a}=t;if(n&&(o||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:a};return{errorMap:(b,e)=>{let{message:i}=t;if(b.code==="invalid_enum_value")return{message:i??e.defaultError};if(typeof e.data>"u")return{message:i??r??e.defaultError};if(b.code!=="invalid_type")return{message:e.defaultError};return{message:i??o??e.defaultError}},description:a}}class k{get description(){return this._def.description}_getType(t){return W(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:W(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new S,ctx:{common:t.parent.common,data:t.data,parsedType:W(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(dt(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:W(t)},r=this._parseSync({data:t,path:o.path,parent:o});return Qr(o,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:W(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return P(o)?{value:o.value}:{issues:n.common.issues}}catch(o){if(o?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((o)=>P(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:W(t)},r=this._parse({data:t,path:o.path,parent:o}),a=await(dt(r)?r:Promise.resolve(r));return Qr(o,a)}refine(t,n){let o=(r)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(r);else return n};return this._refinement((r,a)=>{let l=t(r),b=()=>a.addIssue({code:c.custom,...o(r)});if(typeof Promise<"u"&&l instanceof Promise)return l.then((e)=>{if(!e)return b(),!1;else return!0});if(!l)return b(),!1;else return!0})}refinement(t,n){return this._refinement((o,r)=>{if(!t(o))return r.addIssue(typeof n==="function"?n(o,r):n),!1;else return!0})}_refinement(t){return new D({schema:this,typeName:A.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(n)=>this["~validate"](n)}}optional(){return B.create(this,this._def)}nullable(){return C.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return F.create(this)}promise(){return it.create(this,this._def)}or(t){return wt.create([this,t],this._def)}and(t){return ut.create(this,t,this._def)}transform(t){return new D({..._(this._def),schema:this,typeName:A.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new _t({..._(this._def),innerType:this,defaultValue:n,typeName:A.ZodDefault})}brand(){return new sn({typeName:A.ZodBranded,type:this,..._(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new kt({..._(this._def),innerType:this,catchValue:n,typeName:A.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Ft.create(this,t)}readonly(){return qt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Fr(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let o=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${o}`}function kb(t){return new RegExp(`^${Fr(t)}$`)}function Br(t){let n=`${Gr}T${Fr(t)}`,o=[];if(o.push(t.local?"Z?":"Z"),t.offset)o.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${o.join("|")})`,new RegExp(`^${n}$`)}function qb(t,n){if((n==="v4"||!n)&&$b.test(t))return!0;if((n==="v6"||!n)&&ub.test(t))return!0;return!1}function Hb(t,n){if(!gb.test(t))return!1;try{let[o]=t.split(".");if(!o)return!1;let r=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),a=JSON.parse(atob(r));if(typeof a!=="object"||a===null)return!1;if("typ"in a&&a?.typ!=="JWT")return!1;if(!a.alg)return!1;if(n&&a.alg!==n)return!1;return!0}catch{return!1}}function Lb(t,n){if((n==="v4"||!n)&&wb.test(t))return!0;if((n==="v6"||!n)&&sb.test(t))return!0;return!1}function Mb(t,n){let o=(t.toString().split(".")[1]||"").length,r=(n.toString().split(".")[1]||"").length,a=o>r?o:r,l=Number.parseInt(t.toFixed(a).replace(".","")),b=Number.parseInt(n.toFixed(a).replace(".",""));return l%b/10**a}function gt(t){if(t instanceof L){let n={};for(let o in t.shape){let r=t.shape[o];n[o]=B.create(gt(r))}return new L({...t._def,shape:()=>n})}else if(t instanceof F)return new F({...t._def,type:gt(t.element)});else if(t instanceof B)return B.create(gt(t.unwrap()));else if(t instanceof C)return C.create(gt(t.unwrap()));else if(t instanceof V)return V.create(t.items.map((n)=>gt(n)));else return t}function Ro(t,n){let o=W(t),r=W(n);if(t===n)return{valid:!0,data:t};else if(o===g.object&&r===g.object){let a=H.objectKeys(n),l=H.objectKeys(t).filter((e)=>a.indexOf(e)!==-1),b={...t,...n};for(let e of l){let i=Ro(t[e],n[e]);if(!i.valid)return{valid:!1};b[e]=i.data}return{valid:!0,data:b}}else if(o===g.array&&r===g.array){if(t.length!==n.length)return{valid:!1};let a=[];for(let l=0;l<t.length;l++){let b=t[l],e=n[l],i=Ro(b,e);if(!i.valid)return{valid:!1};a.push(i.data)}return{valid:!0,data:a}}else if(o===g.date&&r===g.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function Er(t,n){return new tt({values:t,typeName:A.ZodEnum,..._(n)})}function Jr(t,n){let o=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof o==="string"?{message:o}:o}function Dr(t,n={},o){if(t)return bt.create().superRefine((r,a)=>{let l=t(r);if(l instanceof Promise)return l.then((b)=>{if(!b){let e=Jr(n,r),i=e.fatal??o??!0;a.addIssue({code:"custom",...e,fatal:i})}});if(!l){let b=Jr(n,r),e=b.fatal??o??!0;a.addIssue({code:"custom",...b,fatal:e})}return});return bt.create()}var Qr=(t,n)=>{if(P(n))return{success:!0,data:n.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new J(t.common.issues);return this._error=o,this._error}}}},ib,hb,fb,cb,db,gb,vb,pb,mb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",So,$b,wb,ub,sb,xb,Ab,Gr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",_b,G,Z,z,pt,lt,Rt,mt,$t,bt,T,U,Xt,F,L,wt,y=(t)=>{if(t instanceof st)return y(t.schema);else if(t instanceof D)return y(t.innerType());else if(t instanceof xt)return[t.value];else if(t instanceof tt)return t.options;else if(t instanceof At)return H.objectValues(t.enum);else if(t instanceof _t)return y(t._def.innerType);else if(t instanceof mt)return[void 0];else if(t instanceof $t)return[null];else if(t instanceof B)return[void 0,...y(t.unwrap())];else if(t instanceof C)return[null,...y(t.unwrap())];else if(t instanceof sn)return y(t.unwrap());else if(t instanceof qt)return y(t.unwrap());else if(t instanceof kt)return y(t._def.innerType);else return[]},un,ut,V,Qt,Jt,et,vt,st,xt,tt,At,it,D,B,C,_t,kt,Gt,Yb,sn,Ft,qt,Sb,A,Rb=(t,n={message:`Input not instance of ${t.name}`})=>Dr((o)=>o instanceof t,n),Or,Wr,Xb,Qb,Ur,Jb,Gb,Fb,Bb,Eb,Db,Ob,Wb,Ub,Vb,Nb,Kb,jb,yb,Cb,Ib,Pb,Tb,Zb,zb,te,ne,oe,re,ae,le,be,ee,ie,he=()=>Or().optional(),fe=()=>Wr().optional(),ce=()=>Ur().optional(),de,ge;var Vr=m(()=>{pn();mn();Xr();Yo();Yt();ib=/^c[^\s-]{8,}$/i,hb=/^[0-9a-z]+$/,fb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,cb=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,db=/^[a-z0-9_-]{21}$/i,gb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vb=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,pb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$b=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,wb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ub=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,sb=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ab=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_b=new RegExp(`^${Gr}$`);G=class G extends k{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==g.string){let a=this._getOrReturnCtx(t);return p(a,{code:c.invalid_type,expected:g.string,received:a.parsedType}),x}let o=new S,r=void 0;for(let a of this._def.checks)if(a.kind==="min"){if(t.data.length<a.value)r=this._getOrReturnCtx(t,r),p(r,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),o.dirty()}else if(a.kind==="max"){if(t.data.length>a.value)r=this._getOrReturnCtx(t,r),p(r,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),o.dirty()}else if(a.kind==="length"){let l=t.data.length>a.value,b=t.data.length<a.value;if(l||b){if(r=this._getOrReturnCtx(t,r),l)p(r,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message});else if(b)p(r,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message});o.dirty()}}else if(a.kind==="email"){if(!pb.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"email",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="emoji"){if(!So)So=new RegExp(mb,"u");if(!So.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"emoji",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="uuid"){if(!cb.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"uuid",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="nanoid"){if(!db.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"nanoid",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="cuid"){if(!ib.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"cuid",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="cuid2"){if(!hb.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"cuid2",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="ulid"){if(!fb.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"ulid",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),p(r,{validation:"url",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="regex"){if(a.regex.lastIndex=0,!a.regex.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"regex",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="trim")t.data=t.data.trim();else if(a.kind==="includes"){if(!t.data.includes(a.value,a.position))r=this._getOrReturnCtx(t,r),p(r,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),o.dirty()}else if(a.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(a.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(a.kind==="startsWith"){if(!t.data.startsWith(a.value))r=this._getOrReturnCtx(t,r),p(r,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),o.dirty()}else if(a.kind==="endsWith"){if(!t.data.endsWith(a.value))r=this._getOrReturnCtx(t,r),p(r,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),o.dirty()}else if(a.kind==="datetime"){if(!Br(a).test(t.data))r=this._getOrReturnCtx(t,r),p(r,{code:c.invalid_string,validation:"datetime",message:a.message}),o.dirty()}else if(a.kind==="date"){if(!_b.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{code:c.invalid_string,validation:"date",message:a.message}),o.dirty()}else if(a.kind==="time"){if(!kb(a).test(t.data))r=this._getOrReturnCtx(t,r),p(r,{code:c.invalid_string,validation:"time",message:a.message}),o.dirty()}else if(a.kind==="duration"){if(!vb.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"duration",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="ip"){if(!qb(t.data,a.version))r=this._getOrReturnCtx(t,r),p(r,{validation:"ip",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="jwt"){if(!Hb(t.data,a.alg))r=this._getOrReturnCtx(t,r),p(r,{validation:"jwt",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="cidr"){if(!Lb(t.data,a.version))r=this._getOrReturnCtx(t,r),p(r,{validation:"cidr",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="base64"){if(!xb.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"base64",code:c.invalid_string,message:a.message}),o.dirty()}else if(a.kind==="base64url"){if(!Ab.test(t.data))r=this._getOrReturnCtx(t,r),p(r,{validation:"base64url",code:c.invalid_string,message:a.message}),o.dirty()}else H.assertNever(a);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement((r)=>t.test(r),{validation:n,code:c.invalid_string,...w.errToObj(o)})}_addCheck(t){return new G({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...w.errToObj(t)})}url(t){return this._addCheck({kind:"url",...w.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...w.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...w.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...w.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...w.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...w.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...w.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...w.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...w.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...w.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...w.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...w.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...w.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...w.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...w.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...w.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...w.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...w.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...w.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...w.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...w.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...w.errToObj(n)})}nonempty(t){return this.min(1,w.errToObj(t))}trim(){return new G({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new G({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxLength(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};G.create=(t)=>{return new G({checks:[],typeName:A.ZodString,coerce:t?.coerce??!1,..._(t)})};Z=class Z extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==g.number){let a=this._getOrReturnCtx(t);return p(a,{code:c.invalid_type,expected:g.number,received:a.parsedType}),x}let o=void 0,r=new S;for(let a of this._def.checks)if(a.kind==="int"){if(!H.isInteger(t.data))o=this._getOrReturnCtx(t,o),p(o,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()}else if(a.kind==="min"){if(a.inclusive?t.data<a.value:t.data<=a.value)o=this._getOrReturnCtx(t,o),p(o,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()}else if(a.kind==="max"){if(a.inclusive?t.data>a.value:t.data>=a.value)o=this._getOrReturnCtx(t,o),p(o,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()}else if(a.kind==="multipleOf"){if(Mb(t.data,a.value)!==0)o=this._getOrReturnCtx(t,o),p(o,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()}else if(a.kind==="finite"){if(!Number.isFinite(t.data))o=this._getOrReturnCtx(t,o),p(o,{code:c.not_finite,message:a.message}),r.dirty()}else H.assertNever(a);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,w.toString(n))}gt(t,n){return this.setLimit("min",t,!1,w.toString(n))}lte(t,n){return this.setLimit("max",t,!0,w.toString(n))}lt(t,n){return this.setLimit("max",t,!1,w.toString(n))}setLimit(t,n,o,r){return new Z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:w.toString(r)}]})}_addCheck(t){return new Z({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:w.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:w.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:w.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&H.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks)if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;else if(o.kind==="min"){if(n===null||o.value>n)n=o.value}else if(o.kind==="max"){if(t===null||o.value<t)t=o.value}return Number.isFinite(n)&&Number.isFinite(t)}};Z.create=(t)=>{return new Z({checks:[],typeName:A.ZodNumber,coerce:t?.coerce||!1,..._(t)})};z=class z extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==g.bigint)return this._getInvalidInput(t);let o=void 0,r=new S;for(let a of this._def.checks)if(a.kind==="min"){if(a.inclusive?t.data<a.value:t.data<=a.value)o=this._getOrReturnCtx(t,o),p(o,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()}else if(a.kind==="max"){if(a.inclusive?t.data>a.value:t.data>=a.value)o=this._getOrReturnCtx(t,o),p(o,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()}else if(a.kind==="multipleOf"){if(t.data%a.value!==BigInt(0))o=this._getOrReturnCtx(t,o),p(o,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()}else H.assertNever(a);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return p(n,{code:c.invalid_type,expected:g.bigint,received:n.parsedType}),x}gte(t,n){return this.setLimit("min",t,!0,w.toString(n))}gt(t,n){return this.setLimit("min",t,!1,w.toString(n))}lte(t,n){return this.setLimit("max",t,!0,w.toString(n))}lt(t,n){return this.setLimit("max",t,!1,w.toString(n))}setLimit(t,n,o,r){return new z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:w.toString(r)}]})}_addCheck(t){return new z({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:w.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};z.create=(t)=>{return new z({checks:[],typeName:A.ZodBigInt,coerce:t?.coerce??!1,..._(t)})};pt=class pt extends k{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==g.boolean){let o=this._getOrReturnCtx(t);return p(o,{code:c.invalid_type,expected:g.boolean,received:o.parsedType}),x}return R(t.data)}};pt.create=(t)=>{return new pt({typeName:A.ZodBoolean,coerce:t?.coerce||!1,..._(t)})};lt=class lt extends k{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==g.date){let a=this._getOrReturnCtx(t);return p(a,{code:c.invalid_type,expected:g.date,received:a.parsedType}),x}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return p(a,{code:c.invalid_date}),x}let o=new S,r=void 0;for(let a of this._def.checks)if(a.kind==="min"){if(t.data.getTime()<a.value)r=this._getOrReturnCtx(t,r),p(r,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),o.dirty()}else if(a.kind==="max"){if(t.data.getTime()>a.value)r=this._getOrReturnCtx(t,r),p(r,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),o.dirty()}else H.assertNever(a);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new lt({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:w.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:w.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t!=null?new Date(t):null}};lt.create=(t)=>{return new lt({checks:[],coerce:t?.coerce||!1,typeName:A.ZodDate,..._(t)})};Rt=class Rt extends k{_parse(t){if(this._getType(t)!==g.symbol){let o=this._getOrReturnCtx(t);return p(o,{code:c.invalid_type,expected:g.symbol,received:o.parsedType}),x}return R(t.data)}};Rt.create=(t)=>{return new Rt({typeName:A.ZodSymbol,..._(t)})};mt=class mt extends k{_parse(t){if(this._getType(t)!==g.undefined){let o=this._getOrReturnCtx(t);return p(o,{code:c.invalid_type,expected:g.undefined,received:o.parsedType}),x}return R(t.data)}};mt.create=(t)=>{return new mt({typeName:A.ZodUndefined,..._(t)})};$t=class $t extends k{_parse(t){if(this._getType(t)!==g.null){let o=this._getOrReturnCtx(t);return p(o,{code:c.invalid_type,expected:g.null,received:o.parsedType}),x}return R(t.data)}};$t.create=(t)=>{return new $t({typeName:A.ZodNull,..._(t)})};bt=class bt extends k{constructor(){super(...arguments);this._any=!0}_parse(t){return R(t.data)}};bt.create=(t)=>{return new bt({typeName:A.ZodAny,..._(t)})};T=class T extends k{constructor(){super(...arguments);this._unknown=!0}_parse(t){return R(t.data)}};T.create=(t)=>{return new T({typeName:A.ZodUnknown,..._(t)})};U=class U extends k{_parse(t){let n=this._getOrReturnCtx(t);return p(n,{code:c.invalid_type,expected:g.never,received:n.parsedType}),x}};U.create=(t)=>{return new U({typeName:A.ZodNever,..._(t)})};Xt=class Xt extends k{_parse(t){if(this._getType(t)!==g.undefined){let o=this._getOrReturnCtx(t);return p(o,{code:c.invalid_type,expected:g.void,received:o.parsedType}),x}return R(t.data)}};Xt.create=(t)=>{return new Xt({typeName:A.ZodVoid,..._(t)})};F=class F extends k{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==g.array)return p(n,{code:c.invalid_type,expected:g.array,received:n.parsedType}),x;if(r.exactLength!==null){let l=n.data.length>r.exactLength.value,b=n.data.length<r.exactLength.value;if(l||b)p(n,{code:l?c.too_big:c.too_small,minimum:b?r.exactLength.value:void 0,maximum:l?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty()}if(r.minLength!==null){if(n.data.length<r.minLength.value)p(n,{code:c.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()}if(r.maxLength!==null){if(n.data.length>r.maxLength.value)p(n,{code:c.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()}if(n.common.async)return Promise.all([...n.data].map((l,b)=>{return r.type._parseAsync(new E(n,l,n.path,b))})).then((l)=>{return S.mergeArray(o,l)});let a=[...n.data].map((l,b)=>{return r.type._parseSync(new E(n,l,n.path,b))});return S.mergeArray(o,a)}get element(){return this._def.type}min(t,n){return new F({...this._def,minLength:{value:t,message:w.toString(n)}})}max(t,n){return new F({...this._def,maxLength:{value:t,message:w.toString(n)}})}length(t,n){return new F({...this._def,exactLength:{value:t,message:w.toString(n)}})}nonempty(t){return this.min(1,t)}};F.create=(t,n)=>{return new F({type:t,minLength:null,maxLength:null,exactLength:null,typeName:A.ZodArray,..._(n)})};L=class L extends k{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=H.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==g.object){let i=this._getOrReturnCtx(t);return p(i,{code:c.invalid_type,expected:g.object,received:i.parsedType}),x}let{status:o,ctx:r}=this._processInputParams(t),{shape:a,keys:l}=this._getCached(),b=[];if(!(this._def.catchall instanceof U&&this._def.unknownKeys==="strip")){for(let i in r.data)if(!l.includes(i))b.push(i)}let e=[];for(let i of l){let $=a[i],q=r.data[i];e.push({key:{status:"valid",value:i},value:$._parse(new E(r,q,r.path,i)),alwaysSet:i in r.data})}if(this._def.catchall instanceof U){let i=this._def.unknownKeys;if(i==="passthrough")for(let $ of b)e.push({key:{status:"valid",value:$},value:{status:"valid",value:r.data[$]}});else if(i==="strict"){if(b.length>0)p(r,{code:c.unrecognized_keys,keys:b}),o.dirty()}else if(i==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let i=this._def.catchall;for(let $ of b){let q=r.data[$];e.push({key:{status:"valid",value:$},value:i._parse(new E(r,q,r.path,$)),alwaysSet:$ in r.data})}}if(r.common.async)return Promise.resolve().then(async()=>{let i=[];for(let $ of e){let q=await $.key,Y=await $.value;i.push({key:q,value:Y,alwaysSet:$.alwaysSet})}return i}).then((i)=>{return S.mergeObjectSync(o,i)});else return S.mergeObjectSync(o,e)}get shape(){return this._def.shape()}strict(t){return w.errToObj,new L({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;if(n.code==="unrecognized_keys")return{message:w.errToObj(t).message??r};return{message:r}}}:{}})}strip(){return new L({...this._def,unknownKeys:"strip"})}passthrough(){return new L({...this._def,unknownKeys:"passthrough"})}extend(t){return new L({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new L({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:A.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new L({...this._def,catchall:t})}pick(t){let n={};for(let o of H.objectKeys(t))if(t[o]&&this.shape[o])n[o]=this.shape[o];return new L({...this._def,shape:()=>n})}omit(t){let n={};for(let o of H.objectKeys(this.shape))if(!t[o])n[o]=this.shape[o];return new L({...this._def,shape:()=>n})}deepPartial(){return gt(this)}partial(t){let n={};for(let o of H.objectKeys(this.shape)){let r=this.shape[o];if(t&&!t[o])n[o]=r;else n[o]=r.optional()}return new L({...this._def,shape:()=>n})}required(t){let n={};for(let o of H.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let a=this.shape[o];while(a instanceof B)a=a._def.innerType;n[o]=a}return new L({...this._def,shape:()=>n})}keyof(){return Er(H.objectKeys(this.shape))}};L.create=(t,n)=>{return new L({shape:()=>t,unknownKeys:"strip",catchall:U.create(),typeName:A.ZodObject,..._(n)})};L.strictCreate=(t,n)=>{return new L({shape:()=>t,unknownKeys:"strict",catchall:U.create(),typeName:A.ZodObject,..._(n)})};L.lazycreate=(t,n)=>{return new L({shape:t,unknownKeys:"strip",catchall:U.create(),typeName:A.ZodObject,..._(n)})};wt=class wt extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function r(a){for(let b of a)if(b.result.status==="valid")return b.result;for(let b of a)if(b.result.status==="dirty")return n.common.issues.push(...b.ctx.common.issues),b.result;let l=a.map((b)=>new J(b.ctx.common.issues));return p(n,{code:c.invalid_union,unionErrors:l}),x}if(n.common.async)return Promise.all(o.map(async(a)=>{let l={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(r);else{let a=void 0,l=[];for(let e of o){let i={...n,common:{...n.common,issues:[]},parent:null},$=e._parseSync({data:n.data,path:n.path,parent:i});if($.status==="valid")return $;else if($.status==="dirty"&&!a)a={result:$,ctx:i};if(i.common.issues.length)l.push(i.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let b=l.map((e)=>new J(e));return p(n,{code:c.invalid_union,unionErrors:b}),x}}get options(){return this._def.options}};wt.create=(t,n)=>{return new wt({options:t,typeName:A.ZodUnion,..._(n)})};un=class un extends k{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==g.object)return p(n,{code:c.invalid_type,expected:g.object,received:n.parsedType}),x;let o=this.discriminator,r=n.data[o],a=this.optionsMap.get(r);if(!a)return p(n,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),x;if(n.common.async)return a._parseAsync({data:n.data,path:n.path,parent:n});else return a._parseSync({data:n.data,path:n.path,parent:n})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let a of n){let l=y(a.shape[t]);if(!l.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let b of l){if(r.has(b))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(b)}`);r.set(b,a)}}return new un({typeName:A.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,..._(o)})}};ut=class ut extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=(a,l)=>{if($n(a)||$n(l))return x;let b=Ro(a.value,l.value);if(!b.valid)return p(o,{code:c.invalid_intersection_types}),x;if(wn(a)||wn(l))n.dirty();return{status:n.value,value:b.data}};if(o.common.async)return Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([a,l])=>r(a,l));else return r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};ut.create=(t,n,o)=>{return new ut({left:t,right:n,typeName:A.ZodIntersection,..._(o)})};V=class V extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==g.array)return p(o,{code:c.invalid_type,expected:g.array,received:o.parsedType}),x;if(o.data.length<this._def.items.length)return p(o,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;if(!this._def.rest&&o.data.length>this._def.items.length)p(o,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let a=[...o.data].map((l,b)=>{let e=this._def.items[b]||this._def.rest;if(!e)return null;return e._parse(new E(o,l,o.path,b))}).filter((l)=>!!l);if(o.common.async)return Promise.all(a).then((l)=>{return S.mergeArray(n,l)});else return S.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new V({...this._def,rest:t})}};V.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new V({items:t,typeName:A.ZodTuple,rest:null,..._(n)})};Qt=class Qt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==g.object)return p(o,{code:c.invalid_type,expected:g.object,received:o.parsedType}),x;let r=[],a=this._def.keyType,l=this._def.valueType;for(let b in o.data)r.push({key:a._parse(new E(o,b,o.path,b)),value:l._parse(new E(o,o.data[b],o.path,b)),alwaysSet:b in o.data});if(o.common.async)return S.mergeObjectAsync(n,r);else return S.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){if(n instanceof k)return new Qt({keyType:t,valueType:n,typeName:A.ZodRecord,..._(o)});return new Qt({keyType:G.create(),valueType:t,typeName:A.ZodRecord,..._(n)})}};Jt=class Jt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==g.map)return p(o,{code:c.invalid_type,expected:g.map,received:o.parsedType}),x;let r=this._def.keyType,a=this._def.valueType,l=[...o.data.entries()].map(([b,e],i)=>{return{key:r._parse(new E(o,b,o.path,[i,"key"])),value:a._parse(new E(o,e,o.path,[i,"value"]))}});if(o.common.async){let b=new Map;return Promise.resolve().then(async()=>{for(let e of l){let i=await e.key,$=await e.value;if(i.status==="aborted"||$.status==="aborted")return x;if(i.status==="dirty"||$.status==="dirty")n.dirty();b.set(i.value,$.value)}return{status:n.value,value:b}})}else{let b=new Map;for(let e of l){let{key:i,value:$}=e;if(i.status==="aborted"||$.status==="aborted")return x;if(i.status==="dirty"||$.status==="dirty")n.dirty();b.set(i.value,$.value)}return{status:n.value,value:b}}}};Jt.create=(t,n,o)=>{return new Jt({valueType:n,keyType:t,typeName:A.ZodMap,..._(o)})};et=class et extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==g.set)return p(o,{code:c.invalid_type,expected:g.set,received:o.parsedType}),x;let r=this._def;if(r.minSize!==null){if(o.data.size<r.minSize.value)p(o,{code:c.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()}if(r.maxSize!==null){if(o.data.size>r.maxSize.value)p(o,{code:c.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty()}let a=this._def.valueType;function l(e){let i=new Set;for(let $ of e){if($.status==="aborted")return x;if($.status==="dirty")n.dirty();i.add($.value)}return{status:n.value,value:i}}let b=[...o.data.values()].map((e,i)=>a._parse(new E(o,e,o.path,i)));if(o.common.async)return Promise.all(b).then((e)=>l(e));else return l(b)}min(t,n){return new et({...this._def,minSize:{value:t,message:w.toString(n)}})}max(t,n){return new et({...this._def,maxSize:{value:t,message:w.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};et.create=(t,n)=>{return new et({valueType:t,minSize:null,maxSize:null,typeName:A.ZodSet,..._(n)})};vt=class vt extends k{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==g.function)return p(n,{code:c.invalid_type,expected:g.function,received:n.parsedType}),x;function o(b,e){return St({data:b,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ct(),j].filter((i)=>!!i),issueData:{code:c.invalid_arguments,argumentsError:e}})}function r(b,e){return St({data:b,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ct(),j].filter((i)=>!!i),issueData:{code:c.invalid_return_type,returnTypeError:e}})}let a={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof it){let b=this;return R(async function(...e){let i=new J([]),$=await b._def.args.parseAsync(e,a).catch((M)=>{throw i.addIssue(o(e,M)),i}),q=await Reflect.apply(l,this,$);return await b._def.returns._def.type.parseAsync(q,a).catch((M)=>{throw i.addIssue(r(q,M)),i})})}else{let b=this;return R(function(...e){let i=b._def.args.safeParse(e,a);if(!i.success)throw new J([o(e,i.error)]);let $=Reflect.apply(l,this,i.data),q=b._def.returns.safeParse($,a);if(!q.success)throw new J([r($,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new vt({...this._def,args:V.create(t).rest(T.create())})}returns(t){return new vt({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new vt({args:t?t:V.create([]).rest(T.create()),returns:n||T.create(),typeName:A.ZodFunction,..._(o)})}};st=class st extends k{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};st.create=(t,n)=>{return new st({getter:t,typeName:A.ZodLazy,..._(n)})};xt=class xt extends k{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return p(n,{received:n.data,code:c.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:t.data}}get value(){return this._def.value}};xt.create=(t,n)=>{return new xt({value:t,typeName:A.ZodLiteral,..._(n)})};tt=class tt extends k{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return p(n,{expected:H.joinValues(o),received:n.parsedType,code:c.invalid_type}),x}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return p(n,{received:n.data,code:c.invalid_enum_value,options:o}),x}return R(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return tt.create(t,{...this._def,...n})}exclude(t,n=this._def){return tt.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};tt.create=Er;At=class At extends k{_parse(t){let n=H.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==g.string&&o.parsedType!==g.number){let r=H.objectValues(n);return p(o,{expected:H.joinValues(r),received:o.parsedType,code:c.invalid_type}),x}if(!this._cache)this._cache=new Set(H.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let r=H.objectValues(n);return p(o,{received:o.data,code:c.invalid_enum_value,options:r}),x}return R(t.data)}get enum(){return this._def.values}};At.create=(t,n)=>{return new At({values:t,typeName:A.ZodNativeEnum,..._(n)})};it=class it extends k{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==g.promise&&n.common.async===!1)return p(n,{code:c.invalid_type,expected:g.promise,received:n.parsedType}),x;let o=n.parsedType===g.promise?n.data:Promise.resolve(n.data);return R(o.then((r)=>{return this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};it.create=(t,n)=>{return new it({type:t,typeName:A.ZodPromise,..._(n)})};D=class D extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===A.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=this._def.effect||null,a={addIssue:(l)=>{if(p(o,l),l.fatal)n.abort();else n.dirty()},get path(){return o.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){let l=r.transform(o.data,a);if(o.common.async)return Promise.resolve(l).then(async(b)=>{if(n.value==="aborted")return x;let e=await this._def.schema._parseAsync({data:b,path:o.path,parent:o});if(e.status==="aborted")return x;if(e.status==="dirty")return at(e.value);if(n.value==="dirty")return at(e.value);return e});else{if(n.value==="aborted")return x;let b=this._def.schema._parseSync({data:l,path:o.path,parent:o});if(b.status==="aborted")return x;if(b.status==="dirty")return at(b.value);if(n.value==="dirty")return at(b.value);return b}}if(r.type==="refinement"){let l=(b)=>{let e=r.refinement(b,a);if(o.common.async)return Promise.resolve(e);if(e instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return b};if(o.common.async===!1){let b=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(b.status==="aborted")return x;if(b.status==="dirty")n.dirty();return l(b.value),{status:n.value,value:b.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((b)=>{if(b.status==="aborted")return x;if(b.status==="dirty")n.dirty();return l(b.value).then(()=>{return{status:n.value,value:b.value}})})}if(r.type==="transform")if(o.common.async===!1){let l=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!P(l))return x;let b=r.transform(l.value,a);if(b instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:b}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((l)=>{if(!P(l))return x;return Promise.resolve(r.transform(l.value,a)).then((b)=>({status:n.value,value:b}))});H.assertNever(r)}};D.create=(t,n,o)=>{return new D({schema:t,typeName:A.ZodEffects,effect:n,..._(o)})};D.createWithPreprocess=(t,n,o)=>{return new D({schema:n,effect:{type:"preprocess",transform:t},typeName:A.ZodEffects,..._(o)})};B=class B extends k{_parse(t){if(this._getType(t)===g.undefined)return R(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};B.create=(t,n)=>{return new B({innerType:t,typeName:A.ZodOptional,..._(n)})};C=class C extends k{_parse(t){if(this._getType(t)===g.null)return R(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};C.create=(t,n)=>{return new C({innerType:t,typeName:A.ZodNullable,..._(n)})};_t=class _t extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;if(n.parsedType===g.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};_t.create=(t,n)=>{return new _t({innerType:t,typeName:A.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,..._(n)})};kt=class kt extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(dt(r))return r.then((a)=>{return{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new J(o.common.issues)},input:o.data})}});else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new J(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};kt.create=(t,n)=>{return new kt({innerType:t,typeName:A.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,..._(n)})};Gt=class Gt extends k{_parse(t){if(this._getType(t)!==g.nan){let o=this._getOrReturnCtx(t);return p(o,{code:c.invalid_type,expected:g.nan,received:o.parsedType}),x}return{status:"valid",value:t.data}}};Gt.create=(t)=>{return new Gt({typeName:A.ZodNaN,..._(t)})};Yb=Symbol("zod_brand");sn=class sn extends k{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}};Ft=class Ft extends k{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(a.status==="aborted")return x;if(a.status==="dirty")return n.dirty(),at(a.value);else return this._def.out._parseAsync({data:a.value,path:o.path,parent:o})})();else{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(r.status==="aborted")return x;if(r.status==="dirty")return n.dirty(),{status:"dirty",value:r.value};else return this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new Ft({in:t,out:n,typeName:A.ZodPipeline})}};qt=class qt extends k{_parse(t){let n=this._def.innerType._parse(t),o=(r)=>{if(P(r))r.value=Object.freeze(r.value);return r};return dt(n)?n.then((r)=>o(r)):o(n)}unwrap(){return this._def.innerType}};qt.create=(t,n)=>{return new qt({innerType:t,typeName:A.ZodReadonly,..._(n)})};Sb={object:L.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(A||(A={}));Or=G.create,Wr=Z.create,Xb=Gt.create,Qb=z.create,Ur=pt.create,Jb=lt.create,Gb=Rt.create,Fb=mt.create,Bb=$t.create,Eb=bt.create,Db=T.create,Ob=U.create,Wb=Xt.create,Ub=F.create,Vb=L.create,Nb=L.strictCreate,Kb=wt.create,jb=un.create,yb=ut.create,Cb=V.create,Ib=Qt.create,Pb=Jt.create,Tb=et.create,Zb=vt.create,zb=st.create,te=xt.create,ne=tt.create,oe=At.create,re=it.create,ae=D.create,le=B.create,be=C.create,ee=D.createWithPreprocess,ie=Ft.create,de={string:(t)=>G.create({...t,coerce:!0}),number:(t)=>Z.create({...t,coerce:!0}),boolean:(t)=>pt.create({...t,coerce:!0}),bigint:(t)=>z.create({...t,coerce:!0}),date:(t)=>lt.create({...t,coerce:!0})},ge=x});var v={};s(v,{void:()=>Wb,util:()=>H,unknown:()=>Db,union:()=>Kb,undefined:()=>Fb,tuple:()=>Cb,transformer:()=>ae,symbol:()=>Gb,string:()=>Or,strictObject:()=>Nb,setErrorMap:()=>bb,set:()=>Tb,record:()=>Ib,quotelessJson:()=>ab,promise:()=>re,preprocess:()=>ee,pipeline:()=>ie,ostring:()=>he,optional:()=>le,onumber:()=>fe,oboolean:()=>ce,objectUtil:()=>Lo,object:()=>Vb,number:()=>Wr,nullable:()=>be,null:()=>Bb,never:()=>Ob,nativeEnum:()=>oe,nan:()=>Xb,map:()=>Pb,makeIssue:()=>St,literal:()=>te,lazy:()=>zb,late:()=>Sb,isValid:()=>P,isDirty:()=>wn,isAsync:()=>dt,isAborted:()=>$n,intersection:()=>yb,instanceof:()=>Rb,getParsedType:()=>W,getErrorMap:()=>ct,function:()=>Zb,enum:()=>ne,effect:()=>ae,discriminatedUnion:()=>jb,defaultErrorMap:()=>j,datetimeRegex:()=>Br,date:()=>Jb,custom:()=>Dr,coerce:()=>de,boolean:()=>Ur,bigint:()=>Qb,array:()=>Ub,any:()=>Eb,addIssueToContext:()=>p,ZodVoid:()=>Xt,ZodUnknown:()=>T,ZodUnion:()=>wt,ZodUndefined:()=>mt,ZodType:()=>k,ZodTuple:()=>V,ZodTransformer:()=>D,ZodSymbol:()=>Rt,ZodString:()=>G,ZodSet:()=>et,ZodSchema:()=>k,ZodRecord:()=>Qt,ZodReadonly:()=>qt,ZodPromise:()=>it,ZodPipeline:()=>Ft,ZodParsedType:()=>g,ZodOptional:()=>B,ZodObject:()=>L,ZodNumber:()=>Z,ZodNullable:()=>C,ZodNull:()=>$t,ZodNever:()=>U,ZodNativeEnum:()=>At,ZodNaN:()=>Gt,ZodMap:()=>Jt,ZodLiteral:()=>xt,ZodLazy:()=>st,ZodIssueCode:()=>c,ZodIntersection:()=>ut,ZodFunction:()=>vt,ZodFirstPartyTypeKind:()=>A,ZodError:()=>J,ZodEnum:()=>tt,ZodEffects:()=>D,ZodDiscriminatedUnion:()=>un,ZodDefault:()=>_t,ZodDate:()=>lt,ZodCatch:()=>kt,ZodBranded:()=>sn,ZodBoolean:()=>pt,ZodBigInt:()=>z,ZodArray:()=>F,ZodAny:()=>bt,Schema:()=>k,ParseStatus:()=>S,OK:()=>R,NEVER:()=>ge,INVALID:()=>x,EMPTY_PATH:()=>eb,DIRTY:()=>at,BRAND:()=>Yb});var Xo=m(()=>{mn();Yo();Rr();Yt();Vr();pn()});var Nr=m(()=>{Xo();Xo()});function Qo(t,...n){if(ve())return;(console[t]||console.log).call(console,...n)}var ve=()=>Boolean(globalThis.__AFRICODE_TEST__||globalThis.__AFRICODE_SILENT_LOGS__);function xn(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(xn);let n={};for(let o of Object.keys(t))n[o]=xn(t[o]);return n}function yr(t,n){let o={...t};for(let r of Object.keys(n))if(n[r]!==null&&typeof n[r]==="object"&&!Array.isArray(n[r])&&typeof t[r]==="object"&&!Array.isArray(t[r]))o[r]=yr(t[r]||{},n[r]);else o[r]=n[r];return o}function Cr(t={}){return jr=yr(Kr,t),pe=!0,Bt()}function Bt(){return Object.freeze(xn(jr))}var Kr,jr,pe=!1;var Jo=m(()=>{Kr={validation:{trimStrings:!1,emptyAsNullDefault:!1},security:{csrf:{enabled:!0,excludePaths:[],sameSite:"Strict",secure:!1},rateLimit:{enabled:!0,windowMs:60000,maxRequests:60,excludePaths:[]}},hooks:{onValidationError:null,onSecurityViolation:null,onRateLimit:null,onDatabaseError:null,onRequest:null}},jr=xn(Kr)});class ht{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(o){if(o instanceof v.ZodError){let r={};return o.errors.forEach((a)=>{let l=a.path.join(".");r[l]=a.message}),{success:!1,errors:r}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(o){if(o instanceof v.ZodError)return{success:!1,error:o.errors[0]?.message||"Invalid value"};return{success:!1,error:"Validation failed"}}}static getFieldError(t,n){if(t.success)return null;return t.errors?.[n]||null}static hasFieldError(t,n){return!!this.getFieldError(t,n)}}class N{constructor(t,n="string"){this._baseSchema=t,this._fieldType=n,this._isNullable=!1,this._isOptional=!1,this._emptyAsNull=!1,this._trim=!1,this._customMessage=null}nullable(){return this._isNullable=!0,this}optional(){return this._isOptional=!0,this}emptyAsNull(){if(!this._isNullable)throw Error(`[AfriCode] .emptyAsNull() requires .nullable() to be called first. Use: afri.${this._fieldType}().nullable().emptyAsNull()`);return this._emptyAsNull=!0,this}trim(){return this._trim=!0,this}message(t){return this._customMessage=t,this}build(){let t=this._baseSchema;if(this._isNullable)t=t.nullable();if(this._isOptional)t=t.optional();return t}getMeta(){return{fieldType:this._fieldType,isNullable:this._isNullable,isOptional:this._isOptional,emptyAsNull:this._emptyAsNull,trim:this._trim}}}function Pr(t,n){let o={...n},r=!1;try{r=Bt().validation?.trimStrings===!0}catch{}for(let[a,l]of Object.entries(t)){if(!(l instanceof N))continue;let b=l.getMeta(),e=o[a];if(typeof e==="string"&&(b.trim||r))o[a]=e.trim();if(b.emptyAsNull&&o[a]==="")o[a]=null}return o}function Tr(t){let n={};for(let[o,r]of Object.entries(t))if(r instanceof N)n[o]=r.build();else n[o]=r;return v.object(n)}var An,O,Ir;var _n=m(()=>{Nr();Jo();An={login:v.object({email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain at least one uppercase letter, one lowercase letter, and one number")}),register:v.object({name:v.string().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s'-]+$/,"Name can only contain letters, spaces, hyphens, and apostrophes"),email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])/,"Password must contain uppercase, lowercase, number, and special character"),confirmPassword:v.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:v.object({action:v.literal("register"),email:v.string().min(1,"Email is required").email("Please enter a valid email address"),username:v.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:v.string().min(8,"Password must be at least 8 characters"),full_name:v.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:v.object({action:v.literal("login"),email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters")}),logout:v.object({action:v.literal("logout")}),action:v.discriminatedUnion("action",[v.object({action:v.literal("register")}).merge(v.object({email:v.string().min(1,"Email is required").email("Please enter a valid email address"),username:v.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:v.string().min(8,"Password must be at least 8 characters"),full_name:v.string().min(2,"Full name is required").max(100,"Full name is too long")})),v.object({action:v.literal("login")}).merge(v.object({email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters")})),v.object({action:v.literal("logout")})])},contact:v.object({name:v.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:v.string().email("Please enter a valid email address"),message:v.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:v.string().min(1,"Email is required").email("Please enter a valid email address"),password:v.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:v.string().regex(/^[\+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:v.string().min(1,"URL is required").url("Please enter a valid URL"),required:v.string().min(1,"This field is required"),positiveNumber:v.number().positive("Must be a positive number"),integer:v.number().int("Must be a whole number"),futureDate:v.date().min(new Date,"Date must be in the future"),imageFile:v.instanceof(File).refine((t)=>t.size<=5242880,"File size must be less than 5MB").refine((t)=>["image/jpeg","image/png","image/gif","image/webp"].includes(t.type),"File must be a JPEG, PNG, GIF, or WebP image"),userProfile:v.object({full_name:v.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:v.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:v.string().url("Please enter a valid URL").nullable().optional(),theme:v.enum(["africanity","dark","light","system"]).optional(),language:v.string().min(2).max(10).optional()}),project:v.object({name:v.string().min(1,"Project name is required").max(100,"Project name is too long"),description:v.string().max(1000,"Description is too long").nullable().optional(),repository_url:v.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:v.string().url("Please enter a valid demo URL").nullable().optional(),tags:v.array(v.string()).optional(),is_public:v.boolean().optional()})};O={required:(t="This field is required")=>v.string().min(1,t),email:(t="Please enter a valid email address")=>v.string().email(t),minLength:(t,n)=>v.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>v.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>v.string().regex(t,n),numeric:(t="Must be a number")=>v.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>v.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>v.string().min(1,"URL is required").url(t)};Ir={url(t="Please enter a valid URL"){return new N(v.string().min(1,"URL cannot be empty").url(t),"url")},email(t="Please enter a valid email address"){return new N(v.string().min(1,"Email cannot be empty").email(t),"email")},string(t={}){let n=v.string();if(t.min!==void 0)n=n.min(t.min,t.message||`Must be at least ${t.min} characters`);if(t.max!==void 0)n=n.max(t.max,t.message||`Must be less than ${t.max} characters`);return new N(n,"string")},number(t={}){let n=v.number();if(t.min!==void 0)n=n.min(t.min);if(t.max!==void 0)n=n.max(t.max);if(t.int)n=n.int("Must be a whole number");return new N(n,"number")},phone(t="Please enter a valid phone number"){return new N(v.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),"phone")}}});function f(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var $e,aa,h;var u=m(()=>{$e=globalThis.HTMLElement??class{},aa=typeof CSSStyleSheet<"u";h=class h extends $e{constructor(){super();this.attachShadow({mode:"open"});let t=this.render;if(t&&typeof t==="function")this.render=()=>{try{t.call(this),this.removeAttribute("has-error")}catch(n){console.error(`[AfriCode] Rendering error in <${this.localName}>:`,n),this.setAttribute("has-error","true"),this.shadowRoot.innerHTML=`
|
|
431
|
+
</html>`}function Or(t){if(t instanceof Yo)return t.toString();if(Array.isArray(t))return t.map(Or).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return _e(t)}var c=(t,...n)=>{let r="";for(let o=0;o<t.length;o++)if(r+=t[o],o<n.length)r+=Or(n[o]);return new Yo(r)};var L,Jo,s,N=(t)=>{switch(typeof t){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(t)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":if(Array.isArray(t))return s.array;if(t===null)return s.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return s.promise;if(typeof Map<"u"&&t instanceof Map)return s.map;if(typeof Set<"u"&&t instanceof Set)return s.set;if(typeof Date<"u"&&t instanceof Date)return s.date;return s.object;default:return s.unknown}};var St=m(()=>{(function(t){t.assertEqual=(a)=>{};function n(a){}t.assertIs=n;function r(a){throw Error()}t.assertNever=r,t.arrayToEnum=(a)=>{let l={};for(let e of a)l[e]=e;return l},t.getValidEnumValues=(a)=>{let l=t.objectKeys(a).filter((b)=>typeof a[a[b]]!=="number"),e={};for(let b of l)e[b]=a[b];return t.objectValues(e)},t.objectValues=(a)=>{return t.objectKeys(a).map(function(l){return a[l]})},t.objectKeys=typeof Object.keys==="function"?(a)=>Object.keys(a):(a)=>{let l=[];for(let e in a)if(Object.prototype.hasOwnProperty.call(a,e))l.push(e);return l},t.find=(a,l)=>{for(let e of a)if(l(e))return e;return},t.isInteger=typeof Number.isInteger==="function"?(a)=>Number.isInteger(a):(a)=>typeof a==="number"&&Number.isFinite(a)&&Math.floor(a)===a;function o(a,l=" | "){return a.map((e)=>typeof e==="string"?`'${e}'`:e).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(a,l)=>{if(typeof l==="bigint")return l.toString();return l}})(L||(L={}));(function(t){t.mergeShapes=(n,r)=>{return{...n,...r}}})(Jo||(Jo={}));s=L.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var d,ke=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},G;var pn=m(()=>{St();d=L.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);G=class G extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,n);else this.__proto__=n;this.name="ZodError",this.issues=t}format(t){let n=t||function(a){return a.message},r={_errors:[]},o=(a)=>{for(let l of a.issues)if(l.code==="invalid_union")l.unionErrors.map(o);else if(l.code==="invalid_return_type")o(l.returnTypeError);else if(l.code==="invalid_arguments")o(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let e=r,b=0;while(b<l.path.length){let f=l.path[b];if(b!==l.path.length-1)e[f]=e[f]||{_errors:[]};else e[f]=e[f]||{_errors:[]},e[f]._errors.push(n(l));e=e[f],b++}}};return o(this),r}static assert(t){if(!(t instanceof G))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,L.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];n[a]=n[a]||[],n[a].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};G.create=(t)=>{return new G(t)}});var qe=(t,n)=>{let r;switch(t.code){case d.invalid_type:if(t.received===s.undefined)r="Required";else r=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,L.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:r=`Unrecognized key(s) in object: ${L.joinValues(t.keys,", ")}`;break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${L.joinValues(t.options)}`;break;case d.invalid_enum_value:r=`Invalid enum value. Expected ${L.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)r=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)r=`Invalid input: must end with "${t.validation.endsWith}"`;else L.assertNever(t.validation);else if(t.validation!=="regex")r=`Invalid ${t.validation}`;else r="Invalid";break;case d.too_small:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else r="Invalid input";break;case d.too_big:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else r="Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:r="Number must be finite";break;default:r=n.defaultError,L.assertNever(t)}return{message:r}},C;var Go=m(()=>{pn();St();C=qe});function Le(t){Ur=t}function dt(){return Ur}var Ur;var un=m(()=>{Go();Ur=C});function v(t,n){let r=dt(),o=Xt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===C?void 0:C].filter((a)=>!!a)});t.common.issues.push(o)}class S{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,n){let r=[];for(let o of n){if(o.status==="aborted")return x;if(o.status==="dirty")t.dirty();r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let o of n){let a=await o.key,l=await o.value;r.push({key:a,value:l})}return S.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let o of n){let{key:a,value:l}=o;if(a.status==="aborted")return x;if(l.status==="aborted")return x;if(a.status==="dirty")t.dirty();if(l.status==="dirty")t.dirty();if(a.value!=="__proto__"&&(typeof l.value<"u"||o.alwaysSet))r[a.value]=l.value}return{status:t.value,value:r}}}var Xt=(t)=>{let{data:n,path:r,errorMaps:o,issueData:a}=t,l=[...r,...a.path||[]],e={...a,path:l};if(a.message!==void 0)return{...a,path:l,message:a.message};let b="",f=o.filter((u)=>!!u).slice().reverse();for(let u of f)b=u(e,{data:n,defaultError:b}).message;return{...a,path:l,message:b}},He,x,at=(t)=>({status:"dirty",value:t}),X=(t)=>({status:"valid",value:t}),$n=(t)=>t.status==="aborted",wn=(t)=>t.status==="dirty",Z=(t)=>t.status==="valid",ct=(t)=>typeof Promise<"u"&&t instanceof Promise;var Qo=m(()=>{un();Go();He=[];x=Object.freeze({status:"aborted"})});var Nr=()=>{};var w;var yr=m(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(w||(w={}))});class E{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function _(t){if(!t)return{};let{errorMap:n,invalid_type_error:r,required_error:o,description:a}=t;if(n&&(r||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:a};return{errorMap:(e,b)=>{let{message:f}=t;if(e.code==="invalid_enum_value")return{message:f??b.defaultError};if(typeof b.data>"u")return{message:f??o??b.defaultError};if(e.code!=="invalid_type")return{message:b.defaultError};return{message:f??r??b.defaultError}},description:a}}class k{get description(){return this._def.description}_getType(t){return N(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new S,ctx:{common:t.parent.common,data:t.data,parsedType:N(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(ct(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},o=this._parseSync({data:t,path:r.path,parent:r});return Vr(r,o)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)};if(!this["~standard"].async)try{let r=this._parseSync({data:t,path:[],parent:n});return Z(r)?{value:r.value}:{issues:n.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((r)=>Z(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:N(t)},o=this._parse({data:t,path:r.path,parent:r}),a=await(ct(o)?o:Promise.resolve(o));return Vr(r,a)}refine(t,n){let r=(o)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(o);else return n};return this._refinement((o,a)=>{let l=t(o),e=()=>a.addIssue({code:d.custom,...r(o)});if(typeof Promise<"u"&&l instanceof Promise)return l.then((b)=>{if(!b)return e(),!1;else return!0});if(!l)return e(),!1;else return!0})}refinement(t,n){return this._refinement((r,o)=>{if(!t(r))return o.addIssue(typeof n==="function"?n(r,o):n),!1;else return!0})}_refinement(t){return new W({schema:this,typeName:A.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(n)=>this["~validate"](n)}}optional(){return D.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this)}promise(){return it.create(this,this._def)}or(t){return ut.create([this,t],this._def)}and(t){return $t.create(this,t,this._def)}transform(t){return new W({..._(this._def),schema:this,typeName:A.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new _t({..._(this._def),innerType:this,defaultValue:n,typeName:A.ZodDefault})}brand(){return new An({typeName:A.ZodBranded,type:this,..._(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new kt({..._(this._def),innerType:this,catchValue:n,typeName:A.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Bt.create(this,t)}readonly(){return qt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Cr(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${r}`}function ye(t){return new RegExp(`^${Cr(t)}$`)}function Ir(t){let n=`${jr}T${Cr(t)}`,r=[];if(r.push(t.local?"Z?":"Z"),t.offset)r.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${r.join("|")})`,new RegExp(`^${n}$`)}function Ve(t,n){if((n==="v4"||!n)&&Be.test(t))return!0;if((n==="v6"||!n)&&Ee.test(t))return!0;return!1}function Ke(t,n){if(!Je.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let o=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(o));if(typeof a!=="object"||a===null)return!1;if("typ"in a&&a?.typ!=="JWT")return!1;if(!a.alg)return!1;if(n&&a.alg!==n)return!1;return!0}catch{return!1}}function je(t,n){if((n==="v4"||!n)&&De.test(t))return!0;if((n==="v6"||!n)&&We.test(t))return!0;return!1}function Ce(t,n){let r=(t.toString().split(".")[1]||"").length,o=(n.toString().split(".")[1]||"").length,a=r>o?r:o,l=Number.parseInt(t.toFixed(a).replace(".","")),e=Number.parseInt(n.toFixed(a).replace(".",""));return l%e/10**a}function gt(t){if(t instanceof H){let n={};for(let r in t.shape){let o=t.shape[r];n[r]=D.create(gt(o))}return new H({...t._def,shape:()=>n})}else if(t instanceof B)return new B({...t._def,type:gt(t.element)});else if(t instanceof D)return D.create(gt(t.unwrap()));else if(t instanceof P)return P.create(gt(t.unwrap()));else if(t instanceof V)return V.create(t.items.map((n)=>gt(n)));else return t}function Bo(t,n){let r=N(t),o=N(n);if(t===n)return{valid:!0,data:t};else if(r===s.object&&o===s.object){let a=L.objectKeys(n),l=L.objectKeys(t).filter((b)=>a.indexOf(b)!==-1),e={...t,...n};for(let b of l){let f=Bo(t[b],n[b]);if(!f.valid)return{valid:!1};e[b]=f.data}return{valid:!0,data:e}}else if(r===s.array&&o===s.array){if(t.length!==n.length)return{valid:!1};let a=[];for(let l=0;l<t.length;l++){let e=t[l],b=n[l],f=Bo(e,b);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else if(r===s.date&&o===s.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function Pr(t,n){return new ot({values:t,typeName:A.ZodEnum,..._(n)})}function Kr(t,n){let r=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof r==="string"?{message:r}:r}function Tr(t,n={},r){if(t)return et.create().superRefine((o,a)=>{let l=t(o);if(l instanceof Promise)return l.then((e)=>{if(!e){let b=Kr(n,o),f=b.fatal??r??!0;a.addIssue({code:"custom",...b,fatal:f})}});if(!l){let e=Kr(n,o),b=e.fatal??r??!0;a.addIssue({code:"custom",...e,fatal:b})}return});return et.create()}var Vr=(t,n)=>{if(Z(n))return{success:!0,data:n.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new G(t.common.issues);return this._error=r,this._error}}}},Me,Re,Se,Xe,Ye,Je,Ge,Qe,Fe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Fo,Be,De,Ee,We,Oe,Ue,jr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ne,F,tt,nt,mt,lt,Yt,vt,pt,et,z,y,Jt,B,H,ut,I=(t)=>{if(t instanceof wt)return I(t.schema);else if(t instanceof W)return I(t.innerType());else if(t instanceof xt)return[t.value];else if(t instanceof ot)return t.options;else if(t instanceof At)return L.objectValues(t.enum);else if(t instanceof _t)return I(t._def.innerType);else if(t instanceof vt)return[void 0];else if(t instanceof pt)return[null];else if(t instanceof D)return[void 0,...I(t.unwrap())];else if(t instanceof P)return[null,...I(t.unwrap())];else if(t instanceof An)return I(t.unwrap());else if(t instanceof qt)return I(t.unwrap());else if(t instanceof kt)return I(t._def.innerType);else return[]},xn,$t,V,Gt,Qt,bt,st,wt,xt,ot,At,it,W,D,P,_t,kt,Ft,Ie,An,Bt,qt,Pe,A,Te=(t,n={message:`Input not instance of ${t.name}`})=>Tr((r)=>r instanceof t,n),Zr,zr,Ze,ze,ta,tb,nb,ob,rb,ab,lb,eb,bb,ib,fb,hb,db,cb,gb,sb,mb,vb,pb,ub,$b,wb,xb,Ab,_b,kb,qb,Lb,Hb,Mb,Rb=()=>Zr().optional(),Sb=()=>zr().optional(),Xb=()=>ta().optional(),Yb,Jb;var na=m(()=>{pn();un();yr();Qo();St();Me=/^c[^\s-]{8,}$/i,Re=/^[0-9a-z]+$/,Se=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ye=/^[a-z0-9_-]{21}$/i,Je=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ge=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Qe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Be=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,De=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ee=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,We=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Oe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ue=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ne=new RegExp(`^${jr}$`);F=class F extends k{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==s.string){let a=this._getOrReturnCtx(t);return v(a,{code:d.invalid_type,expected:s.string,received:a.parsedType}),x}let r=new S,o=void 0;for(let a of this._def.checks)if(a.kind==="min"){if(t.data.length<a.value)o=this._getOrReturnCtx(t,o),v(o,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty()}else if(a.kind==="max"){if(t.data.length>a.value)o=this._getOrReturnCtx(t,o),v(o,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty()}else if(a.kind==="length"){let l=t.data.length>a.value,e=t.data.length<a.value;if(l||e){if(o=this._getOrReturnCtx(t,o),l)v(o,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message});else if(e)v(o,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message});r.dirty()}}else if(a.kind==="email"){if(!Qe.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"email",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="emoji"){if(!Fo)Fo=new RegExp(Fe,"u");if(!Fo.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"emoji",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="uuid"){if(!Xe.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"uuid",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="nanoid"){if(!Ye.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"nanoid",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cuid"){if(!Me.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"cuid",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cuid2"){if(!Re.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"cuid2",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="ulid"){if(!Se.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"ulid",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),v(o,{validation:"url",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="regex"){if(a.regex.lastIndex=0,!a.regex.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"regex",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="trim")t.data=t.data.trim();else if(a.kind==="includes"){if(!t.data.includes(a.value,a.position))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()}else if(a.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(a.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(a.kind==="startsWith"){if(!t.data.startsWith(a.value))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()}else if(a.kind==="endsWith"){if(!t.data.endsWith(a.value))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()}else if(a.kind==="datetime"){if(!Ir(a).test(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:"datetime",message:a.message}),r.dirty()}else if(a.kind==="date"){if(!Ne.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:"date",message:a.message}),r.dirty()}else if(a.kind==="time"){if(!ye(a).test(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:d.invalid_string,validation:"time",message:a.message}),r.dirty()}else if(a.kind==="duration"){if(!Ge.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"duration",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="ip"){if(!Ve(t.data,a.version))o=this._getOrReturnCtx(t,o),v(o,{validation:"ip",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="jwt"){if(!Ke(t.data,a.alg))o=this._getOrReturnCtx(t,o),v(o,{validation:"jwt",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="cidr"){if(!je(t.data,a.version))o=this._getOrReturnCtx(t,o),v(o,{validation:"cidr",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="base64"){if(!Oe.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"base64",code:d.invalid_string,message:a.message}),r.dirty()}else if(a.kind==="base64url"){if(!Ue.test(t.data))o=this._getOrReturnCtx(t,o),v(o,{validation:"base64url",code:d.invalid_string,message:a.message}),r.dirty()}else L.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement((o)=>t.test(o),{validation:n,code:d.invalid_string,...w.errToObj(r)})}_addCheck(t){return new F({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...w.errToObj(t)})}url(t){return this._addCheck({kind:"url",...w.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...w.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...w.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...w.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...w.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...w.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...w.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...w.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...w.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...w.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...w.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...w.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...w.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...w.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...w.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...w.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...w.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...w.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...w.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...w.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...w.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...w.errToObj(n)})}nonempty(t){return this.min(1,w.errToObj(t))}trim(){return new F({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new F({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new F({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxLength(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};F.create=(t)=>{return new F({checks:[],typeName:A.ZodString,coerce:t?.coerce??!1,..._(t)})};tt=class tt extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==s.number){let a=this._getOrReturnCtx(t);return v(a,{code:d.invalid_type,expected:s.number,received:a.parsedType}),x}let r=void 0,o=new S;for(let a of this._def.checks)if(a.kind==="int"){if(!L.isInteger(t.data))r=this._getOrReturnCtx(t,r),v(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()}else if(a.kind==="min"){if(a.inclusive?t.data<a.value:t.data<=a.value)r=this._getOrReturnCtx(t,r),v(r,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()}else if(a.kind==="max"){if(a.inclusive?t.data>a.value:t.data>=a.value)r=this._getOrReturnCtx(t,r),v(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()}else if(a.kind==="multipleOf"){if(Ce(t.data,a.value)!==0)r=this._getOrReturnCtx(t,r),v(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()}else if(a.kind==="finite"){if(!Number.isFinite(t.data))r=this._getOrReturnCtx(t,r),v(r,{code:d.not_finite,message:a.message}),o.dirty()}else L.assertNever(a);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,w.toString(n))}gt(t,n){return this.setLimit("min",t,!1,w.toString(n))}lte(t,n){return this.setLimit("max",t,!0,w.toString(n))}lt(t,n){return this.setLimit("max",t,!1,w.toString(n))}setLimit(t,n,r,o){return new tt({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:w.toString(o)}]})}_addCheck(t){return new tt({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:w.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:w.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:w.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&L.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(n===null||r.value>n)n=r.value}else if(r.kind==="max"){if(t===null||r.value<t)t=r.value}return Number.isFinite(n)&&Number.isFinite(t)}};tt.create=(t)=>{return new tt({checks:[],typeName:A.ZodNumber,coerce:t?.coerce||!1,..._(t)})};nt=class nt extends k{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==s.bigint)return this._getInvalidInput(t);let r=void 0,o=new S;for(let a of this._def.checks)if(a.kind==="min"){if(a.inclusive?t.data<a.value:t.data<=a.value)r=this._getOrReturnCtx(t,r),v(r,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()}else if(a.kind==="max"){if(a.inclusive?t.data>a.value:t.data>=a.value)r=this._getOrReturnCtx(t,r),v(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()}else if(a.kind==="multipleOf"){if(t.data%a.value!==BigInt(0))r=this._getOrReturnCtx(t,r),v(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()}else L.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return v(n,{code:d.invalid_type,expected:s.bigint,received:n.parsedType}),x}gte(t,n){return this.setLimit("min",t,!0,w.toString(n))}gt(t,n){return this.setLimit("min",t,!1,w.toString(n))}lte(t,n){return this.setLimit("max",t,!0,w.toString(n))}lt(t,n){return this.setLimit("max",t,!1,w.toString(n))}setLimit(t,n,r,o){return new nt({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:w.toString(o)}]})}_addCheck(t){return new nt({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:w.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t}get maxValue(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t}};nt.create=(t)=>{return new nt({checks:[],typeName:A.ZodBigInt,coerce:t?.coerce??!1,..._(t)})};mt=class mt extends k{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==s.boolean){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.boolean,received:r.parsedType}),x}return X(t.data)}};mt.create=(t)=>{return new mt({typeName:A.ZodBoolean,coerce:t?.coerce||!1,..._(t)})};lt=class lt extends k{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==s.date){let a=this._getOrReturnCtx(t);return v(a,{code:d.invalid_type,expected:s.date,received:a.parsedType}),x}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return v(a,{code:d.invalid_date}),x}let r=new S,o=void 0;for(let a of this._def.checks)if(a.kind==="min"){if(t.data.getTime()<a.value)o=this._getOrReturnCtx(t,o),v(o,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()}else if(a.kind==="max"){if(t.data.getTime()>a.value)o=this._getOrReturnCtx(t,o),v(o,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()}else L.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new lt({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:w.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:w.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)if(n.kind==="min"){if(t===null||n.value>t)t=n.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)if(n.kind==="max"){if(t===null||n.value<t)t=n.value}return t!=null?new Date(t):null}};lt.create=(t)=>{return new lt({checks:[],coerce:t?.coerce||!1,typeName:A.ZodDate,..._(t)})};Yt=class Yt extends k{_parse(t){if(this._getType(t)!==s.symbol){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.symbol,received:r.parsedType}),x}return X(t.data)}};Yt.create=(t)=>{return new Yt({typeName:A.ZodSymbol,..._(t)})};vt=class vt extends k{_parse(t){if(this._getType(t)!==s.undefined){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.undefined,received:r.parsedType}),x}return X(t.data)}};vt.create=(t)=>{return new vt({typeName:A.ZodUndefined,..._(t)})};pt=class pt extends k{_parse(t){if(this._getType(t)!==s.null){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.null,received:r.parsedType}),x}return X(t.data)}};pt.create=(t)=>{return new pt({typeName:A.ZodNull,..._(t)})};et=class et extends k{constructor(){super(...arguments);this._any=!0}_parse(t){return X(t.data)}};et.create=(t)=>{return new et({typeName:A.ZodAny,..._(t)})};z=class z extends k{constructor(){super(...arguments);this._unknown=!0}_parse(t){return X(t.data)}};z.create=(t)=>{return new z({typeName:A.ZodUnknown,..._(t)})};y=class y extends k{_parse(t){let n=this._getOrReturnCtx(t);return v(n,{code:d.invalid_type,expected:s.never,received:n.parsedType}),x}};y.create=(t)=>{return new y({typeName:A.ZodNever,..._(t)})};Jt=class Jt extends k{_parse(t){if(this._getType(t)!==s.undefined){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.void,received:r.parsedType}),x}return X(t.data)}};Jt.create=(t)=>{return new Jt({typeName:A.ZodVoid,..._(t)})};B=class B extends k{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==s.array)return v(n,{code:d.invalid_type,expected:s.array,received:n.parsedType}),x;if(o.exactLength!==null){let l=n.data.length>o.exactLength.value,e=n.data.length<o.exactLength.value;if(l||e)v(n,{code:l?d.too_big:d.too_small,minimum:e?o.exactLength.value:void 0,maximum:l?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty()}if(o.minLength!==null){if(n.data.length<o.minLength.value)v(n,{code:d.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()}if(o.maxLength!==null){if(n.data.length>o.maxLength.value)v(n,{code:d.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()}if(n.common.async)return Promise.all([...n.data].map((l,e)=>{return o.type._parseAsync(new E(n,l,n.path,e))})).then((l)=>{return S.mergeArray(r,l)});let a=[...n.data].map((l,e)=>{return o.type._parseSync(new E(n,l,n.path,e))});return S.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new B({...this._def,minLength:{value:t,message:w.toString(n)}})}max(t,n){return new B({...this._def,maxLength:{value:t,message:w.toString(n)}})}length(t,n){return new B({...this._def,exactLength:{value:t,message:w.toString(n)}})}nonempty(t){return this.min(1,t)}};B.create=(t,n)=>{return new B({type:t,minLength:null,maxLength:null,exactLength:null,typeName:A.ZodArray,..._(n)})};H=class H extends k{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=L.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==s.object){let f=this._getOrReturnCtx(t);return v(f,{code:d.invalid_type,expected:s.object,received:f.parsedType}),x}let{status:r,ctx:o}=this._processInputParams(t),{shape:a,keys:l}=this._getCached(),e=[];if(!(this._def.catchall instanceof y&&this._def.unknownKeys==="strip")){for(let f in o.data)if(!l.includes(f))e.push(f)}let b=[];for(let f of l){let u=a[f],q=o.data[f];b.push({key:{status:"valid",value:f},value:u._parse(new E(o,q,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof y){let f=this._def.unknownKeys;if(f==="passthrough")for(let u of e)b.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(f==="strict"){if(e.length>0)v(o,{code:d.unrecognized_keys,keys:e}),r.dirty()}else if(f==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let u of e){let q=o.data[u];b.push({key:{status:"valid",value:u},value:f._parse(new E(o,q,o.path,u)),alwaysSet:u in o.data})}}if(o.common.async)return Promise.resolve().then(async()=>{let f=[];for(let u of b){let q=await u.key,R=await u.value;f.push({key:q,value:R,alwaysSet:u.alwaysSet})}return f}).then((f)=>{return S.mergeObjectSync(r,f)});else return S.mergeObjectSync(r,b)}get shape(){return this._def.shape()}strict(t){return w.errToObj,new H({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;if(n.code==="unrecognized_keys")return{message:w.errToObj(t).message??o};return{message:o}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(t){return new H({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new H({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:A.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new H({...this._def,catchall:t})}pick(t){let n={};for(let r of L.objectKeys(t))if(t[r]&&this.shape[r])n[r]=this.shape[r];return new H({...this._def,shape:()=>n})}omit(t){let n={};for(let r of L.objectKeys(this.shape))if(!t[r])n[r]=this.shape[r];return new H({...this._def,shape:()=>n})}deepPartial(){return gt(this)}partial(t){let n={};for(let r of L.objectKeys(this.shape)){let o=this.shape[r];if(t&&!t[r])n[r]=o;else n[r]=o.optional()}return new H({...this._def,shape:()=>n})}required(t){let n={};for(let r of L.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];while(a instanceof D)a=a._def.innerType;n[r]=a}return new H({...this._def,shape:()=>n})}keyof(){return Pr(L.objectKeys(this.shape))}};H.create=(t,n)=>{return new H({shape:()=>t,unknownKeys:"strip",catchall:y.create(),typeName:A.ZodObject,..._(n)})};H.strictCreate=(t,n)=>{return new H({shape:()=>t,unknownKeys:"strict",catchall:y.create(),typeName:A.ZodObject,..._(n)})};H.lazycreate=(t,n)=>{return new H({shape:t,unknownKeys:"strip",catchall:y.create(),typeName:A.ZodObject,..._(n)})};ut=class ut extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(a){for(let e of a)if(e.result.status==="valid")return e.result;for(let e of a)if(e.result.status==="dirty")return n.common.issues.push(...e.ctx.common.issues),e.result;let l=a.map((e)=>new G(e.ctx.common.issues));return v(n,{code:d.invalid_union,unionErrors:l}),x}if(n.common.async)return Promise.all(r.map(async(a)=>{let l={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(o);else{let a=void 0,l=[];for(let b of r){let f={...n,common:{...n.common,issues:[]},parent:null},u=b._parseSync({data:n.data,path:n.path,parent:f});if(u.status==="valid")return u;else if(u.status==="dirty"&&!a)a={result:u,ctx:f};if(f.common.issues.length)l.push(f.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let e=l.map((b)=>new G(b));return v(n,{code:d.invalid_union,unionErrors:e}),x}}get options(){return this._def.options}};ut.create=(t,n)=>{return new ut({options:t,typeName:A.ZodUnion,..._(n)})};xn=class xn extends k{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==s.object)return v(n,{code:d.invalid_type,expected:s.object,received:n.parsedType}),x;let r=this.discriminator,o=n.data[r],a=this.optionsMap.get(o);if(!a)return v(n,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),x;if(n.common.async)return a._parseAsync({data:n.data,path:n.path,parent:n});else return a._parseSync({data:n.data,path:n.path,parent:n})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let o=new Map;for(let a of n){let l=I(a.shape[t]);if(!l.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let e of l){if(o.has(e))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(e)}`);o.set(e,a)}}return new xn({typeName:A.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,..._(r)})}};$t=class $t extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(a,l)=>{if($n(a)||$n(l))return x;let e=Bo(a.value,l.value);if(!e.valid)return v(r,{code:d.invalid_intersection_types}),x;if(wn(a)||wn(l))n.dirty();return{status:n.value,value:e.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,l])=>o(a,l));else return o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};$t.create=(t,n,r)=>{return new $t({left:t,right:n,typeName:A.ZodIntersection,..._(r)})};V=class V extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==s.array)return v(r,{code:d.invalid_type,expected:s.array,received:r.parsedType}),x;if(r.data.length<this._def.items.length)return v(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;if(!this._def.rest&&r.data.length>this._def.items.length)v(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let a=[...r.data].map((l,e)=>{let b=this._def.items[e]||this._def.rest;if(!b)return null;return b._parse(new E(r,l,r.path,e))}).filter((l)=>!!l);if(r.common.async)return Promise.all(a).then((l)=>{return S.mergeArray(n,l)});else return S.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new V({...this._def,rest:t})}};V.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new V({items:t,typeName:A.ZodTuple,rest:null,..._(n)})};Gt=class Gt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==s.object)return v(r,{code:d.invalid_type,expected:s.object,received:r.parsedType}),x;let o=[],a=this._def.keyType,l=this._def.valueType;for(let e in r.data)o.push({key:a._parse(new E(r,e,r.path,e)),value:l._parse(new E(r,r.data[e],r.path,e)),alwaysSet:e in r.data});if(r.common.async)return S.mergeObjectAsync(n,o);else return S.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){if(n instanceof k)return new Gt({keyType:t,valueType:n,typeName:A.ZodRecord,..._(r)});return new Gt({keyType:F.create(),valueType:t,typeName:A.ZodRecord,..._(n)})}};Qt=class Qt extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==s.map)return v(r,{code:d.invalid_type,expected:s.map,received:r.parsedType}),x;let o=this._def.keyType,a=this._def.valueType,l=[...r.data.entries()].map(([e,b],f)=>{return{key:o._parse(new E(r,e,r.path,[f,"key"])),value:a._parse(new E(r,b,r.path,[f,"value"]))}});if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let b of l){let f=await b.key,u=await b.value;if(f.status==="aborted"||u.status==="aborted")return x;if(f.status==="dirty"||u.status==="dirty")n.dirty();e.set(f.value,u.value)}return{status:n.value,value:e}})}else{let e=new Map;for(let b of l){let{key:f,value:u}=b;if(f.status==="aborted"||u.status==="aborted")return x;if(f.status==="dirty"||u.status==="dirty")n.dirty();e.set(f.value,u.value)}return{status:n.value,value:e}}}};Qt.create=(t,n,r)=>{return new Qt({valueType:n,keyType:t,typeName:A.ZodMap,..._(r)})};bt=class bt extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==s.set)return v(r,{code:d.invalid_type,expected:s.set,received:r.parsedType}),x;let o=this._def;if(o.minSize!==null){if(r.data.size<o.minSize.value)v(r,{code:d.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()}if(o.maxSize!==null){if(r.data.size>o.maxSize.value)v(r,{code:d.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty()}let a=this._def.valueType;function l(b){let f=new Set;for(let u of b){if(u.status==="aborted")return x;if(u.status==="dirty")n.dirty();f.add(u.value)}return{status:n.value,value:f}}let e=[...r.data.values()].map((b,f)=>a._parse(new E(r,b,r.path,f)));if(r.common.async)return Promise.all(e).then((b)=>l(b));else return l(e)}min(t,n){return new bt({...this._def,minSize:{value:t,message:w.toString(n)}})}max(t,n){return new bt({...this._def,maxSize:{value:t,message:w.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};bt.create=(t,n)=>{return new bt({valueType:t,minSize:null,maxSize:null,typeName:A.ZodSet,..._(n)})};st=class st extends k{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==s.function)return v(n,{code:d.invalid_type,expected:s.function,received:n.parsedType}),x;function r(e,b){return Xt({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,dt(),C].filter((f)=>!!f),issueData:{code:d.invalid_arguments,argumentsError:b}})}function o(e,b){return Xt({data:e,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,dt(),C].filter((f)=>!!f),issueData:{code:d.invalid_return_type,returnTypeError:b}})}let a={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof it){let e=this;return X(async function(...b){let f=new G([]),u=await e._def.args.parseAsync(b,a).catch((M)=>{throw f.addIssue(r(b,M)),f}),q=await Reflect.apply(l,this,u);return await e._def.returns._def.type.parseAsync(q,a).catch((M)=>{throw f.addIssue(o(q,M)),f})})}else{let e=this;return X(function(...b){let f=e._def.args.safeParse(b,a);if(!f.success)throw new G([r(b,f.error)]);let u=Reflect.apply(l,this,f.data),q=e._def.returns.safeParse(u,a);if(!q.success)throw new G([o(u,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new st({...this._def,args:V.create(t).rest(z.create())})}returns(t){return new st({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new st({args:t?t:V.create([]).rest(z.create()),returns:n||z.create(),typeName:A.ZodFunction,..._(r)})}};wt=class wt extends k{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};wt.create=(t,n)=>{return new wt({getter:t,typeName:A.ZodLazy,..._(n)})};xt=class xt extends k{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return v(n,{received:n.data,code:d.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:t.data}}get value(){return this._def.value}};xt.create=(t,n)=>{return new xt({value:t,typeName:A.ZodLiteral,..._(n)})};ot=class ot extends k{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return v(n,{expected:L.joinValues(r),received:n.parsedType,code:d.invalid_type}),x}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return v(n,{received:n.data,code:d.invalid_enum_value,options:r}),x}return X(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ot.create(t,{...this._def,...n})}exclude(t,n=this._def){return ot.create(this.options.filter((r)=>!t.includes(r)),{...this._def,...n})}};ot.create=Pr;At=class At extends k{_parse(t){let n=L.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==s.string&&r.parsedType!==s.number){let o=L.objectValues(n);return v(r,{expected:L.joinValues(o),received:r.parsedType,code:d.invalid_type}),x}if(!this._cache)this._cache=new Set(L.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let o=L.objectValues(n);return v(r,{received:r.data,code:d.invalid_enum_value,options:o}),x}return X(t.data)}get enum(){return this._def.values}};At.create=(t,n)=>{return new At({values:t,typeName:A.ZodNativeEnum,..._(n)})};it=class it extends k{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==s.promise&&n.common.async===!1)return v(n,{code:d.invalid_type,expected:s.promise,received:n.parsedType}),x;let r=n.parsedType===s.promise?n.data:Promise.resolve(n.data);return X(r.then((o)=>{return this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};it.create=(t,n)=>{return new it({type:t,typeName:A.ZodPromise,..._(n)})};W=class W extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===A.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:(l)=>{if(v(r,l),l.fatal)n.abort();else n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let l=o.transform(r.data,a);if(r.common.async)return Promise.resolve(l).then(async(e)=>{if(n.value==="aborted")return x;let b=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});if(b.status==="aborted")return x;if(b.status==="dirty")return at(b.value);if(n.value==="dirty")return at(b.value);return b});else{if(n.value==="aborted")return x;let e=this._def.schema._parseSync({data:l,path:r.path,parent:r});if(e.status==="aborted")return x;if(e.status==="dirty")return at(e.value);if(n.value==="dirty")return at(e.value);return e}}if(o.type==="refinement"){let l=(e)=>{let b=o.refinement(e,a);if(r.common.async)return Promise.resolve(b);if(b instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(r.common.async===!1){let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(e.status==="aborted")return x;if(e.status==="dirty")n.dirty();return l(e.value),{status:n.value,value:e.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e)=>{if(e.status==="aborted")return x;if(e.status==="dirty")n.dirty();return l(e.value).then(()=>{return{status:n.value,value:e.value}})})}if(o.type==="transform")if(r.common.async===!1){let l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Z(l))return x;let e=o.transform(l.value,a);if(e instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:e}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((l)=>{if(!Z(l))return x;return Promise.resolve(o.transform(l.value,a)).then((e)=>({status:n.value,value:e}))});L.assertNever(o)}};W.create=(t,n,r)=>{return new W({schema:t,typeName:A.ZodEffects,effect:n,..._(r)})};W.createWithPreprocess=(t,n,r)=>{return new W({schema:n,effect:{type:"preprocess",transform:t},typeName:A.ZodEffects,..._(r)})};D=class D extends k{_parse(t){if(this._getType(t)===s.undefined)return X(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};D.create=(t,n)=>{return new D({innerType:t,typeName:A.ZodOptional,..._(n)})};P=class P extends k{_parse(t){if(this._getType(t)===s.null)return X(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};P.create=(t,n)=>{return new P({innerType:t,typeName:A.ZodNullable,..._(n)})};_t=class _t extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;if(n.parsedType===s.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};_t.create=(t,n)=>{return new _t({innerType:t,typeName:A.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,..._(n)})};kt=class kt extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(ct(o))return o.then((a)=>{return{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new G(r.common.issues)},input:r.data})}});else return{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new G(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};kt.create=(t,n)=>{return new kt({innerType:t,typeName:A.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,..._(n)})};Ft=class Ft extends k{_parse(t){if(this._getType(t)!==s.nan){let r=this._getOrReturnCtx(t);return v(r,{code:d.invalid_type,expected:s.nan,received:r.parsedType}),x}return{status:"valid",value:t.data}}};Ft.create=(t)=>{return new Ft({typeName:A.ZodNaN,..._(t)})};Ie=Symbol("zod_brand");An=class An extends k{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}};Bt=class Bt extends k{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(a.status==="aborted")return x;if(a.status==="dirty")return n.dirty(),at(a.value);else return this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();else{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(o.status==="aborted")return x;if(o.status==="dirty")return n.dirty(),{status:"dirty",value:o.value};else return this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Bt({in:t,out:n,typeName:A.ZodPipeline})}};qt=class qt extends k{_parse(t){let n=this._def.innerType._parse(t),r=(o)=>{if(Z(o))o.value=Object.freeze(o.value);return o};return ct(n)?n.then((o)=>r(o)):r(n)}unwrap(){return this._def.innerType}};qt.create=(t,n)=>{return new qt({innerType:t,typeName:A.ZodReadonly,..._(n)})};Pe={object:H.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(A||(A={}));Zr=F.create,zr=tt.create,Ze=Ft.create,ze=nt.create,ta=mt.create,tb=lt.create,nb=Yt.create,ob=vt.create,rb=pt.create,ab=et.create,lb=z.create,eb=y.create,bb=Jt.create,ib=B.create,fb=H.create,hb=H.strictCreate,db=ut.create,cb=xn.create,gb=$t.create,sb=V.create,mb=Gt.create,vb=Qt.create,pb=bt.create,ub=st.create,$b=wt.create,wb=xt.create,xb=ot.create,Ab=At.create,_b=it.create,kb=W.create,qb=D.create,Lb=P.create,Hb=W.createWithPreprocess,Mb=Bt.create,Yb={string:(t)=>F.create({...t,coerce:!0}),number:(t)=>tt.create({...t,coerce:!0}),boolean:(t)=>mt.create({...t,coerce:!0}),bigint:(t)=>nt.create({...t,coerce:!0}),date:(t)=>lt.create({...t,coerce:!0})},Jb=x});var g={};$(g,{void:()=>bb,util:()=>L,unknown:()=>lb,union:()=>db,undefined:()=>ob,tuple:()=>sb,transformer:()=>kb,symbol:()=>nb,string:()=>Zr,strictObject:()=>hb,setErrorMap:()=>Le,set:()=>pb,record:()=>mb,quotelessJson:()=>ke,promise:()=>_b,preprocess:()=>Hb,pipeline:()=>Mb,ostring:()=>Rb,optional:()=>qb,onumber:()=>Sb,oboolean:()=>Xb,objectUtil:()=>Jo,object:()=>fb,number:()=>zr,nullable:()=>Lb,null:()=>rb,never:()=>eb,nativeEnum:()=>Ab,nan:()=>Ze,map:()=>vb,makeIssue:()=>Xt,literal:()=>wb,lazy:()=>$b,late:()=>Pe,isValid:()=>Z,isDirty:()=>wn,isAsync:()=>ct,isAborted:()=>$n,intersection:()=>gb,instanceof:()=>Te,getParsedType:()=>N,getErrorMap:()=>dt,function:()=>ub,enum:()=>xb,effect:()=>kb,discriminatedUnion:()=>cb,defaultErrorMap:()=>C,datetimeRegex:()=>Ir,date:()=>tb,custom:()=>Tr,coerce:()=>Yb,boolean:()=>ta,bigint:()=>ze,array:()=>ib,any:()=>ab,addIssueToContext:()=>v,ZodVoid:()=>Jt,ZodUnknown:()=>z,ZodUnion:()=>ut,ZodUndefined:()=>vt,ZodType:()=>k,ZodTuple:()=>V,ZodTransformer:()=>W,ZodSymbol:()=>Yt,ZodString:()=>F,ZodSet:()=>bt,ZodSchema:()=>k,ZodRecord:()=>Gt,ZodReadonly:()=>qt,ZodPromise:()=>it,ZodPipeline:()=>Bt,ZodParsedType:()=>s,ZodOptional:()=>D,ZodObject:()=>H,ZodNumber:()=>tt,ZodNullable:()=>P,ZodNull:()=>pt,ZodNever:()=>y,ZodNativeEnum:()=>At,ZodNaN:()=>Ft,ZodMap:()=>Qt,ZodLiteral:()=>xt,ZodLazy:()=>wt,ZodIssueCode:()=>d,ZodIntersection:()=>$t,ZodFunction:()=>st,ZodFirstPartyTypeKind:()=>A,ZodError:()=>G,ZodEnum:()=>ot,ZodEffects:()=>W,ZodDiscriminatedUnion:()=>xn,ZodDefault:()=>_t,ZodDate:()=>lt,ZodCatch:()=>kt,ZodBranded:()=>An,ZodBoolean:()=>mt,ZodBigInt:()=>nt,ZodArray:()=>B,ZodAny:()=>et,Schema:()=>k,ParseStatus:()=>S,OK:()=>X,NEVER:()=>Jb,INVALID:()=>x,EMPTY_PATH:()=>He,DIRTY:()=>at,BRAND:()=>Ie});var Do=m(()=>{un();Qo();Nr();St();na();pn()});var oa=m(()=>{Do();Do()});function Lt(t,...n){if(Gb())return;(console[t]||console.log).call(console,...n)}var Gb=()=>Boolean(globalThis.__AFRICODE_TEST__||globalThis.__AFRICODE_SILENT_LOGS__);function _n(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(_n);let n={};for(let r of Object.keys(t))n[r]=_n(t[r]);return n}function la(t,n){let r={...t};for(let o of Object.keys(n))if(n[o]!==null&&typeof n[o]==="object"&&!Array.isArray(n[o])&&typeof t[o]==="object"&&!Array.isArray(t[o]))r[o]=la(t[o]||{},n[o]);else r[o]=n[o];return r}function ea(t={}){return aa=la(ra,t),Qb=!0,Dt()}function Dt(){return Object.freeze(_n(aa))}var ra,aa,Qb=!1;var Eo=m(()=>{ra={validation:{trimStrings:!1,emptyAsNullDefault:!1},security:{csrf:{enabled:!0,excludePaths:[],sameSite:"Strict",secure:!1},rateLimit:{enabled:!0,windowMs:60000,maxRequests:60,excludePaths:[]}},hooks:{onValidationError:null,onSecurityViolation:null,onRateLimit:null,onDatabaseError:null,onRequest:null}},aa=_n(ra)});class ft{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(r){if(r instanceof g.ZodError){let o={};return r.errors.forEach((a)=>{let l=a.path.join(".");o[l]=a.message}),{success:!1,errors:o}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(r){if(r instanceof g.ZodError)return{success:!1,error:r.errors[0]?.message||"Invalid value"};return{success:!1,error:"Validation failed"}}}static getFieldError(t,n){if(t.success)return null;return t.errors?.[n]||null}static hasFieldError(t,n){return!!this.getFieldError(t,n)}}class K{constructor(t,n="string"){this._baseSchema=t,this._fieldType=n,this._isNullable=!1,this._isOptional=!1,this._emptyAsNull=!1,this._trim=!1,this._customMessage=null}nullable(){return this._isNullable=!0,this}optional(){return this._isOptional=!0,this}emptyAsNull(){if(!this._isNullable)throw Error(`[AfriCode] .emptyAsNull() requires .nullable() to be called first. Use: afri.${this._fieldType}().nullable().emptyAsNull()`);return this._emptyAsNull=!0,this}trim(){return this._trim=!0,this}message(t){if(this._customMessage=t,this._customMessage&&this._baseSchema){if(this._fieldType==="string"&&this._baseSchema._def?.minLength)this._baseSchema=g.string().min(this._baseSchema._def.minLength.value,t);else if(this._fieldType==="url")this._baseSchema=g.string().min(1,"URL cannot be empty").url(t);else if(this._fieldType==="email")this._baseSchema=g.string().min(1,"Email cannot be empty").email(t);else if(this._fieldType==="phone")this._baseSchema=g.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t)}return this}build(){let t=this._baseSchema;if(this._isNullable)t=t.nullable();if(this._isOptional)t=t.optional();return t}getMeta(){return{fieldType:this._fieldType,isNullable:this._isNullable,isOptional:this._isOptional,emptyAsNull:this._emptyAsNull,trim:this._trim}}}function ia(t,n){let r={...n},o=!1;try{o=Dt().validation?.trimStrings===!0}catch{}for(let[a,l]of Object.entries(t)){if(!(l instanceof K))continue;let e=l.getMeta(),b=r[a];if(typeof b==="string"&&(e.trim||o))r[a]=b.trim();if(e.emptyAsNull&&r[a]==="")r[a]=null}return r}function fa(t){let n={};for(let[r,o]of Object.entries(t))if(o instanceof K)n[r]=o.build();else n[r]=o;return g.object(n)}var kn,O,ba;var qn=m(()=>{oa();Eo();kn={login:g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain at least one uppercase letter, one lowercase letter, and one number")}),register:g.object({name:g.string().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").regex(/^[a-zA-Z\s'-]+$/,"Name can only contain letters, spaces, hyphens, and apostrophes"),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])/,"Password must contain uppercase, lowercase, number, and special character"),confirmPassword:g.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:g.object({action:g.literal("register"),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),username:g.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:g.string().min(8,"Password must be at least 8 characters"),full_name:g.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:g.object({action:g.literal("login"),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters")}),logout:g.object({action:g.literal("logout")}),action:g.discriminatedUnion("action",[g.object({action:g.literal("register")}).merge(g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),username:g.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:g.string().min(8,"Password must be at least 8 characters"),full_name:g.string().min(2,"Full name is required").max(100,"Full name is too long")})),g.object({action:g.literal("login")}).merge(g.object({email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters")})),g.object({action:g.literal("logout")})])},contact:g.object({name:g.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:g.string().email("Please enter a valid email address"),message:g.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:g.string().min(1,"Email is required").email("Please enter a valid email address"),password:g.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:g.string().regex(/^[\+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:g.string().min(1,"URL is required").url("Please enter a valid URL"),required:g.string().min(1,"This field is required"),positiveNumber:g.number().positive("Must be a positive number"),integer:g.number().int("Must be a whole number"),futureDate:g.date().min(new Date,"Date must be in the future"),imageFile:g.instanceof(File).refine((t)=>t.size<=5242880,"File size must be less than 5MB").refine((t)=>["image/jpeg","image/png","image/gif","image/webp"].includes(t.type),"File must be a JPEG, PNG, GIF, or WebP image"),userProfile:g.object({full_name:g.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:g.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:g.string().url("Please enter a valid URL").nullable().optional(),theme:g.enum(["africanity","dark","light","system"]).optional(),language:g.string().min(2).max(10).optional()}),project:g.object({name:g.string().min(1,"Project name is required").max(100,"Project name is too long"),description:g.string().max(1000,"Description is too long").nullable().optional(),repository_url:g.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:g.string().url("Please enter a valid demo URL").nullable().optional(),tags:g.array(g.string()).optional(),is_public:g.boolean().optional()})};O={required:(t="This field is required")=>g.string().min(1,t),email:(t="Please enter a valid email address")=>g.string().email(t),minLength:(t,n)=>g.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>g.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>g.string().regex(t,n),numeric:(t="Must be a number")=>g.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>g.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>g.string().min(1,"URL is required").url(t)};ba={url(t="Please enter a valid URL"){return new K(g.string().min(1,"URL cannot be empty").url(t),"url")},email(t="Please enter a valid email address"){return new K(g.string().min(1,"Email cannot be empty").email(t),"email")},string(t={}){let n=g.string();if(t.min!==void 0)n=n.min(t.min,t.message||`Must be at least ${t.min} characters`);if(t.max!==void 0)n=n.max(t.max,t.message||`Must be less than ${t.max} characters`);return new K(n,"string")},number(t={}){let n=g.number();if(t.min!==void 0)n=n.min(t.min);if(t.max!==void 0)n=n.max(t.max);if(t.int)n=n.int("Must be a whole number");return new K(n,"number")},phone(t="Please enter a valid phone number"){return new K(g.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),"phone")}}});function h(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var Fb,va,i;var p=m(()=>{Fb=globalThis.HTMLElement??class{},va=typeof CSSStyleSheet<"u";i=class i extends Fb{constructor(){super();this.attachShadow({mode:"open"});let t=this.render;if(t&&typeof t==="function")this.render=()=>{try{t.call(this),this.removeAttribute("has-error")}catch(n){console.error(`[AfriCode] Rendering error in <${this.localName}>:`,n),this.setAttribute("has-error","true"),this.shadowRoot.innerHTML=`
|
|
372
432
|
<style>
|
|
373
433
|
.af-local-error {
|
|
374
434
|
padding: 1rem;
|
|
@@ -387,7 +447,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
387
447
|
<span aria-hidden="true">⚠️</span>
|
|
388
448
|
<span>Failed to render</span>
|
|
389
449
|
</div>
|
|
390
|
-
`,this.emit("af-component-error",{component:this.localName,message:n.message,stack:n.stack})}}}connectedCallback(){}static styleCache=new Map;static globalSheets=[];static injectGlobalSheet(t){if(!
|
|
450
|
+
`,this.emit("af-component-error",{component:this.localName,message:n.message,stack:n.stack})}}}connectedCallback(){}static styleCache=new Map;static globalSheets=[];static injectGlobalSheet(t){if(!va)return;if(!(t instanceof CSSStyleSheet))return;if(!i.globalSheets.includes(t))i.globalSheets.push(t)}async loadStyles(t=""){if(!this.shadowRoot)return;let r=va&&"adoptedStyleSheets"in this.shadowRoot,o=typeof t==="string"&&t.length>0?t:"/styles/africanity.css",a=typeof t==="string"&&t.length>0?t:null;if(i.styleCache.has(o)){let l=i.styleCache.get(o);if(r)this.shadowRoot.adoptedStyleSheets=[l,...i.globalSheets];else this._applyFallbackStyle(l?.cssText||l?.text||l||"");return}try{let l=a;if(!l){let e=await fetch("/styles/africanity.css");if(!e.ok)throw Error(`Unable to load stylesheet: ${e.status}`);l=await e.text()}if(r){let e=new CSSStyleSheet;e.replaceSync(l),i.styleCache.set(o,e),this.shadowRoot.adoptedStyleSheets=[e,...i.globalSheets];return}this._applyFallbackStyle(l),i.styleCache.set(o,{text:l})}catch(l){this._applyFallbackStyle(a||"")}}_applyFallbackStyle(t){if(!this.shadowRoot)return;let n=this.shadowRoot.querySelector("style[data-africode-core-styles]");if(!n)n=document.createElement("style"),n.setAttribute("data-africode-core-styles",""),this.shadowRoot.prepend(n);n.textContent=t}spacing(t){return`var(--space-${t})`}createElement(t,{classes:n=[],attributes:r={},text:o=""}={}){let a=document.createElement(t);if(n.length)a.classList.add(...n);if(Object.entries(r).forEach(([l,e])=>a.setAttribute(l,e)),o)a.textContent=o;return a}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var pa={};$(pa,{default:()=>Bb,AfriUIButton:()=>Wt});var Wt,Bb;var Io=m(()=>{p();Wt=class Wt extends i{static get observedAttributes(){return["variant","size","disabled","loading","full-width","aria-label"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(n)=>{if(this.hasAttribute("disabled")||this.hasAttribute("loading")){n.preventDefault();return}this.emit("af-ui-button-click",{originalEvent:n})})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"primary",n=this.getAttribute("size")||"md",r=this.hasAttribute("disabled"),o=this.hasAttribute("loading"),a=this.getAttribute("aria-label")||"";this.shadowRoot.innerHTML=c`
|
|
391
451
|
<style>
|
|
392
452
|
:host { display: inline-block; }
|
|
393
453
|
|
|
@@ -480,14 +540,14 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
480
540
|
|
|
481
541
|
<button
|
|
482
542
|
class="${t} ${n}"
|
|
483
|
-
${
|
|
543
|
+
${r?"disabled":""}
|
|
484
544
|
${a?`aria-label="${a}"`:""}
|
|
485
|
-
${
|
|
545
|
+
${o?'aria-busy="true"':""}
|
|
486
546
|
>
|
|
487
|
-
${
|
|
547
|
+
${o?c`<span class="spinner"></span>`:""}
|
|
488
548
|
<slot></slot>
|
|
489
549
|
</button>
|
|
490
|
-
`}};
|
|
550
|
+
`}};h("af-ui-button",Wt);Bb=Wt});var ua={};$(ua,{default:()=>Db,AfriUICard:()=>Ot});var Ot,Db;var Po=m(()=>{p();Ot=class Ot extends i{static get observedAttributes(){return["variant","bordered","clickable"]}constructor(){super();this.render()}connectedCallback(){if(this.loadStyles(),this.hasAttribute("clickable"))this.shadowRoot.querySelector(".card")?.addEventListener("click",()=>{this.emit("af-ui-card-click")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"elevated",n=this.hasAttribute("bordered"),r=this.hasAttribute("clickable");this.shadowRoot.innerHTML=c`
|
|
491
551
|
<style>
|
|
492
552
|
:host { display: block; }
|
|
493
553
|
|
|
@@ -517,7 +577,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
517
577
|
<article class="card ${t}">
|
|
518
578
|
<slot></slot>
|
|
519
579
|
</article>
|
|
520
|
-
`}};
|
|
580
|
+
`}};h("af-ui-card",Ot);Db=Ot});var $a={};$($a,{default:()=>Eb,AfriUIInput:()=>Ut});var Ut,Eb;var To=m(()=>{p();Ut=class Ut extends i{static get observedAttributes(){return["label","placeholder","type","value","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",()=>{this.emit("af-ui-input",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"",r=this.getAttribute("type")||"text",o=this.getAttribute("value")||"",a=this.hasAttribute("disabled"),l=this.getAttribute("error")||"";this.shadowRoot.innerHTML=c`
|
|
521
581
|
<style>
|
|
522
582
|
:host { display: block; font-family: 'Inter', system-ui, sans-serif; }
|
|
523
583
|
|
|
@@ -565,17 +625,17 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
565
625
|
</style>
|
|
566
626
|
|
|
567
627
|
<div class="field">
|
|
568
|
-
${t?
|
|
628
|
+
${t?c`<label>${t}</label>`:""}
|
|
569
629
|
<input
|
|
570
|
-
type="${
|
|
630
|
+
type="${r}"
|
|
571
631
|
placeholder="${n}"
|
|
572
|
-
value="${
|
|
632
|
+
value="${o}"
|
|
573
633
|
${a?"disabled":""}
|
|
574
634
|
aria-invalid="${Boolean(l)}"
|
|
575
635
|
/>
|
|
576
636
|
<div class="error">${l}</div>
|
|
577
637
|
</div>
|
|
578
|
-
`}};
|
|
638
|
+
`}};h("af-ui-input",Ut);Eb=Ut});var wa={};$(wa,{default:()=>Wb,AfriUIBadge:()=>Nt});var Nt,Wb;var Zo=m(()=>{p();Nt=class Nt extends i{static get observedAttributes(){return["variant","size","pill"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"secondary",n=this.getAttribute("size")||"md",r=this.hasAttribute("pill");this.shadowRoot.innerHTML=c`
|
|
579
639
|
<style>
|
|
580
640
|
:host { display: inline-block; font-family: 'Inter', system-ui, sans-serif; }
|
|
581
641
|
|
|
@@ -584,7 +644,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
584
644
|
align-items: center;
|
|
585
645
|
justify-content: center;
|
|
586
646
|
gap: 0.4rem;
|
|
587
|
-
border-radius: ${
|
|
647
|
+
border-radius: ${r?"999px":"0.6rem"};
|
|
588
648
|
padding: ${n==="sm"?"0.25rem 0.65rem":n==="lg"?"0.55rem 1rem":"0.4rem 0.8rem"};
|
|
589
649
|
font-size: ${n==="sm"?"0.75rem":n==="lg"?"0.95rem":"0.85rem"};
|
|
590
650
|
font-weight: 700;
|
|
@@ -602,16 +662,16 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
602
662
|
</style>
|
|
603
663
|
|
|
604
664
|
<span class="badge ${t}"><slot></slot></span>
|
|
605
|
-
`}};
|
|
665
|
+
`}};h("af-ui-badge",Nt);Wb=Nt});var xa={};$(xa,{default:()=>Ob,AfriUISwitch:()=>yt});var yt,Ob;var zo=m(()=>{p();yt=class yt extends i{static get observedAttributes(){return["checked","disabled","size"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(t)=>{if(this.hasAttribute("disabled"))return;let n=!this.hasAttribute("checked");if(n)this.setAttribute("checked","");else this.removeAttribute("checked");this.emit("af-ui-switch-toggle",{checked:n,originalEvent:t})})}attributeChangedCallback(){this.render()}render(){let t=this.hasAttribute("checked"),n=this.hasAttribute("disabled"),r=this.getAttribute("size")||"md",o=r==="sm"?{width:36,height:20,knob:14}:r==="lg"?{width:56,height:32,knob:24}:{width:48,height:28,knob:20},a=t?"true":"false";this.shadowRoot.innerHTML=c`
|
|
606
666
|
<style>
|
|
607
667
|
:host { display: inline-block; }
|
|
608
668
|
|
|
609
669
|
button {
|
|
610
670
|
all: unset;
|
|
611
671
|
position: relative;
|
|
612
|
-
width: ${
|
|
613
|
-
height: ${
|
|
614
|
-
border-radius: ${
|
|
672
|
+
width: ${o.width}px;
|
|
673
|
+
height: ${o.height}px;
|
|
674
|
+
border-radius: ${o.height/2}px;
|
|
615
675
|
background: ${t?"#2563eb":"#e5e7eb"};
|
|
616
676
|
cursor: ${n?"not-allowed":"pointer"};
|
|
617
677
|
transition: background 180ms ease;
|
|
@@ -621,10 +681,10 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
621
681
|
.knob {
|
|
622
682
|
position: absolute;
|
|
623
683
|
top: 50%;
|
|
624
|
-
left: ${t?`${
|
|
684
|
+
left: ${t?`${o.width-o.knob-4}px`:"4px"};
|
|
625
685
|
transform: translateY(-50%);
|
|
626
|
-
width: ${
|
|
627
|
-
height: ${
|
|
686
|
+
width: ${o.knob}px;
|
|
687
|
+
height: ${o.knob}px;
|
|
628
688
|
border-radius: 999px;
|
|
629
689
|
background: #ffffff;
|
|
630
690
|
transition: left 180ms ease;
|
|
@@ -637,7 +697,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
637
697
|
<button role="switch" aria-checked="${a}" ${n?"disabled":""}>
|
|
638
698
|
<span class="knob"></span>
|
|
639
699
|
</button>
|
|
640
|
-
`}};
|
|
700
|
+
`}};h("af-ui-switch",yt);Ob=yt});var Aa={};$(Aa,{default:()=>Ub,AfriUISelect:()=>Vt});var Vt,Ub;var tr=m(()=>{p();Vt=class Vt extends i{static get observedAttributes(){return["label","placeholder","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("select");if(!t)return;t.addEventListener("change",()=>{this.emit("af-ui-select",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"Select an option",r=this.hasAttribute("disabled"),o=this.getAttribute("error")||"";this.shadowRoot.innerHTML=c`
|
|
641
701
|
<style>
|
|
642
702
|
:host { display: block; font-family: 'Inter', system-ui, sans-serif; }
|
|
643
703
|
|
|
@@ -666,14 +726,14 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
666
726
|
</style>
|
|
667
727
|
|
|
668
728
|
<div class="field">
|
|
669
|
-
${t?
|
|
670
|
-
<select ${
|
|
729
|
+
${t?c`<label>${t}</label>`:""}
|
|
730
|
+
<select ${r?"disabled":""}>
|
|
671
731
|
<option disabled selected hidden>${n}</option>
|
|
672
732
|
<slot></slot>
|
|
673
733
|
</select>
|
|
674
|
-
<div class="error">${
|
|
734
|
+
<div class="error">${o}</div>
|
|
675
735
|
</div>
|
|
676
|
-
`}};
|
|
736
|
+
`}};h("af-ui-select",Vt);Ub=Vt});var _a={};$(_a,{default:()=>Nb,AfriUITextarea:()=>Kt});var Kt,Nb;var nr=m(()=>{p();Kt=class Kt extends i{static get observedAttributes(){return["label","placeholder","rows","disabled","error"]}constructor(){super();this.render()}connectedCallback(){this._attachListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector("textarea");if(!t)return;t.addEventListener("input",()=>{this.emit("af-ui-textarea",{value:t.value})})}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"",r=this.getAttribute("rows")||"4",o=this.hasAttribute("disabled"),a=this.getAttribute("error")||"";this.shadowRoot.innerHTML=c`
|
|
677
737
|
<style>
|
|
678
738
|
:host { display: block; font-family: 'Inter', system-ui, sans-serif; }
|
|
679
739
|
|
|
@@ -703,11 +763,11 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
703
763
|
</style>
|
|
704
764
|
|
|
705
765
|
<div class="field">
|
|
706
|
-
${t?
|
|
707
|
-
<textarea rows="${
|
|
766
|
+
${t?c`<label>${t}</label>`:""}
|
|
767
|
+
<textarea rows="${r}" placeholder="${n}" ${o?"disabled":""}></textarea>
|
|
708
768
|
<div class="error">${a}</div>
|
|
709
769
|
</div>
|
|
710
|
-
`}};
|
|
770
|
+
`}};h("af-ui-textarea",Kt);Nb=Kt});var ka={};$(ka,{default:()=>yb,AfriUIChip:()=>jt});var jt,yb;var or=m(()=>{p();jt=class jt extends i{static get observedAttributes(){return["variant","size","dismissible"]}constructor(){super();this.render()}connectedCallback(){this.render(),this._attachListeners()}attributeChangedCallback(){this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector(".chip button");if(!t)return;t.addEventListener("click",(n)=>{n.stopPropagation(),this.emit("af-ui-chip-dismiss",{})})}render(){let t=this.getAttribute("variant")||"neutral",n=this.getAttribute("size")||"md",r=this.hasAttribute("dismissible");this.shadowRoot.innerHTML=c`
|
|
711
771
|
<style>
|
|
712
772
|
:host { display: inline-flex; }
|
|
713
773
|
|
|
@@ -743,9 +803,9 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
743
803
|
|
|
744
804
|
<span class="chip ${t}">
|
|
745
805
|
<slot></slot>
|
|
746
|
-
${
|
|
806
|
+
${r?c`<button aria-label="Remove">×</button>`:""}
|
|
747
807
|
</span>
|
|
748
|
-
`}};
|
|
808
|
+
`}};h("af-ui-chip",jt);yb=jt});var qa={};$(qa,{default:()=>Vb,AfriUITag:()=>Ct});var Ct,Vb;var rr=m(()=>{p();Ct=class Ct extends i{static get observedAttributes(){return["variant","size"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"secondary",n=this.getAttribute("size")||"md",r={sm:"0.25rem 0.6rem",md:"0.35rem 0.8rem",lg:"0.5rem 1rem"};this.shadowRoot.innerHTML=c`
|
|
749
809
|
<style>
|
|
750
810
|
:host { display: inline-block; font-family: 'Inter', sans-serif; }
|
|
751
811
|
|
|
@@ -754,7 +814,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
754
814
|
align-items: center;
|
|
755
815
|
justify-content: center;
|
|
756
816
|
gap: 0.35rem;
|
|
757
|
-
padding: ${
|
|
817
|
+
padding: ${r[n]};
|
|
758
818
|
border-radius: 999px;
|
|
759
819
|
font-size: ${n==="sm"?"0.75rem":n==="lg"?"0.95rem":"0.85rem"};
|
|
760
820
|
font-weight: 600;
|
|
@@ -771,14 +831,14 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
771
831
|
</style>
|
|
772
832
|
|
|
773
833
|
<span class="tag ${t}"><slot></slot></span>
|
|
774
|
-
`}};
|
|
834
|
+
`}};h("af-ui-tag",Ct);Vb=Ct});var La={};$(La,{default:()=>Kb,AfriUIAvatar:()=>It});var It,Kb;var ar=m(()=>{p();It=class It extends i{static get observedAttributes(){return["src","initials","size","badge"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("src"),n=this.getAttribute("initials")||"AC",r=this.getAttribute("size")||"md",o=r==="sm"?"32px":r==="lg"?"64px":"48px",a=this.getAttribute("badge");this.shadowRoot.innerHTML=c`
|
|
775
835
|
<style>
|
|
776
836
|
:host { display: inline-flex; }
|
|
777
837
|
|
|
778
838
|
.avatar {
|
|
779
839
|
position: relative;
|
|
780
|
-
width: ${
|
|
781
|
-
height: ${
|
|
840
|
+
width: ${o};
|
|
841
|
+
height: ${o};
|
|
782
842
|
border-radius: 999px;
|
|
783
843
|
overflow: hidden;
|
|
784
844
|
background: linear-gradient(135deg, #1eb53a, #fcd116);
|
|
@@ -787,7 +847,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
787
847
|
align-items: center;
|
|
788
848
|
justify-content: center;
|
|
789
849
|
font-weight: 700;
|
|
790
|
-
font-size: ${
|
|
850
|
+
font-size: ${r==="sm"?"0.85rem":r==="lg"?"1.25rem":"1rem"};
|
|
791
851
|
}
|
|
792
852
|
|
|
793
853
|
img {
|
|
@@ -811,17 +871,17 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
811
871
|
</style>
|
|
812
872
|
|
|
813
873
|
<div class="avatar">
|
|
814
|
-
${t?
|
|
815
|
-
${a?
|
|
874
|
+
${t?c`<img src="${t}" alt="Avatar" />`:c`<span>${n}</span>`}
|
|
875
|
+
${a?c`<span class="badge">${a}</span>`:""}
|
|
816
876
|
</div>
|
|
817
|
-
`}};
|
|
877
|
+
`}};h("af-ui-avatar",It);Kb=It});var Ha={};$(Ha,{default:()=>jb,AfriUIProgressRing:()=>Pt});var Pt,jb;var lr=m(()=>{p();Pt=class Pt extends i{static get observedAttributes(){return["value","size","stroke","label"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=Number(this.getAttribute("value")||0),n=Number(this.getAttribute("size")||96),r=Number(this.getAttribute("stroke")||10),o=this.getAttribute("label")||"",a=(n-r)/2,l=2*Math.PI*a,e=l-t/100*l;this.shadowRoot.innerHTML=c`
|
|
818
878
|
<style>
|
|
819
879
|
:host { display: inline-flex; align-items: center; justify-content: center; }
|
|
820
880
|
.ring { position: relative; width: ${n}px; height: ${n}px; }
|
|
821
881
|
svg { transform: rotate(-90deg); width: 100%; height: 100%; }
|
|
822
|
-
circle { fill: none; stroke-width: ${
|
|
882
|
+
circle { fill: none; stroke-width: ${r}; stroke-linecap: round; }
|
|
823
883
|
.bg { stroke: rgba(15, 23, 42, 0.12); }
|
|
824
|
-
.progress { stroke: #2563eb; stroke-dasharray: ${l}; stroke-dashoffset: ${
|
|
884
|
+
.progress { stroke: #2563eb; stroke-dasharray: ${l}; stroke-dashoffset: ${e}; transition: stroke-dashoffset 0.35s ease; }
|
|
825
885
|
.label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #111827; font-family: 'Inter', sans-serif; }
|
|
826
886
|
.value { font-size: 1rem; font-weight: 700; }
|
|
827
887
|
.subtitle { font-size: 0.75rem; color: #6b7280; }
|
|
@@ -833,10 +893,10 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
833
893
|
</svg>
|
|
834
894
|
<div class="label">
|
|
835
895
|
<div class="value">${t}%</div>
|
|
836
|
-
${
|
|
896
|
+
${o?c`<div class="subtitle">${o}</div>`:""}
|
|
837
897
|
</div>
|
|
838
898
|
</div>
|
|
839
|
-
`}};
|
|
899
|
+
`}};h("af-ui-progress-ring",Pt);jb=Pt});var Ma={};$(Ma,{default:()=>Cb,AfriUITooltip:()=>Tt});var Tt,Cb;var er=m(()=>{p();Tt=class Tt extends i{static get observedAttributes(){return["text","position"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("text")||"",n=this.getAttribute("position")||"top";this.shadowRoot.innerHTML=c`
|
|
840
900
|
<style>
|
|
841
901
|
:host { position: relative; display: inline-flex; }
|
|
842
902
|
|
|
@@ -869,7 +929,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
869
929
|
</style>
|
|
870
930
|
<slot></slot>
|
|
871
931
|
<div class="tooltip ${n}" role="tooltip">${t}</div>
|
|
872
|
-
`}};
|
|
932
|
+
`}};h("af-ui-tooltip",Tt);Cb=Tt});var Ra={};$(Ra,{default:()=>Ib,AfriUIPopover:()=>Zt});var Zt,Ib;var br=m(()=>{p();Zt=class Zt extends i{static get observedAttributes(){return["label","open"]}constructor(){super();this._open=this.hasAttribute("open"),this.render()}connectedCallback(){this._attachListeners()}attributeChangedCallback(){this._open=this.hasAttribute("open"),this.render(),this._attachListeners()}_attachListeners(){let t=this.shadowRoot.querySelector(".trigger");if(!t)return;t.addEventListener("click",()=>{if(this._open=!this._open,this._open)this.setAttribute("open","");else this.removeAttribute("open");this.render(),this._attachListeners()})}render(){let t=this.getAttribute("label")||"Open",n=this._open;this.shadowRoot.innerHTML=c`
|
|
873
933
|
<style>
|
|
874
934
|
:host { position: relative; display: inline-flex; }
|
|
875
935
|
.trigger {
|
|
@@ -901,7 +961,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
901
961
|
</style>
|
|
902
962
|
<button class="trigger" type="button">${t}</button>
|
|
903
963
|
<div class="panel"><slot></slot></div>
|
|
904
|
-
`}};
|
|
964
|
+
`}};h("af-ui-popover",Zt);Ib=Zt});var Sa={};$(Sa,{default:()=>Pb,AfriUITabs:()=>zt,AfriUITabPanel:()=>ir});var zt,ir,Pb;var fr=m(()=>{p();zt=class zt extends i{static get observedAttributes(){return["active"]}constructor(){super();this._active=this.getAttribute("active")||"0",this.render()}connectedCallback(){this._attachListeners()}attributeChangedCallback(){this._active=this.getAttribute("active")||"0",this.render(),this._attachListeners()}_attachListeners(){this.shadowRoot.querySelectorAll('[role="tab"]').forEach((n)=>{n.addEventListener("click",()=>{let r=n.getAttribute("data-index");this.setAttribute("active",r)})})}render(){let t=this._active,n=Array.from(this.children).filter((r)=>r.tagName.toLowerCase()==="ui-tab-panel");this.shadowRoot.innerHTML=c`
|
|
905
965
|
<style>
|
|
906
966
|
:host { display: block; font-family: 'Inter', system-ui, sans-serif; }
|
|
907
967
|
|
|
@@ -927,23 +987,23 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
927
987
|
.panel.active { display: block; }
|
|
928
988
|
</style>
|
|
929
989
|
<div class="tab-list" role="tablist">
|
|
930
|
-
${n.map((o
|
|
990
|
+
${n.map((r,o)=>c`
|
|
931
991
|
<button
|
|
932
992
|
role="tab"
|
|
933
|
-
data-index="${
|
|
934
|
-
class="${String(
|
|
935
|
-
aria-selected="${String(
|
|
993
|
+
data-index="${o}"
|
|
994
|
+
class="${String(o)===String(t)?"active":""}"
|
|
995
|
+
aria-selected="${String(o)===String(t)}"
|
|
936
996
|
>
|
|
937
|
-
${
|
|
997
|
+
${r.getAttribute("label")||`Tab ${o+1}`}
|
|
938
998
|
</button>
|
|
939
999
|
`).join("")}
|
|
940
1000
|
</div>
|
|
941
|
-
${n.map((o
|
|
942
|
-
<div class="panel ${String(
|
|
943
|
-
${
|
|
1001
|
+
${n.map((r,o)=>c`
|
|
1002
|
+
<div class="panel ${String(o)===String(t)?"active":""}" role="tabpanel">
|
|
1003
|
+
${r.innerHTML}
|
|
944
1004
|
</div>
|
|
945
1005
|
`).join("")}
|
|
946
|
-
`}};
|
|
1006
|
+
`}};ir=class ir extends i{render(){this.shadowRoot.innerHTML=c`<slot></slot>`}};h("af-ui-tabs",zt);h("ui-tab-panel",ir);Pb=zt});var Xa={};$(Xa,{default:()=>Tb,AfriUITable:()=>tn});var tn,Tb;var hr=m(()=>{p();tn=class tn extends i{static get observedAttributes(){return["striped","bordered","compact"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.hasAttribute("striped"),n=this.hasAttribute("bordered"),r=this.hasAttribute("compact");this.shadowRoot.innerHTML=c`
|
|
947
1007
|
<style>
|
|
948
1008
|
:host { display: block; overflow-x: auto; }
|
|
949
1009
|
table {
|
|
@@ -954,7 +1014,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
954
1014
|
color: #0f172a;
|
|
955
1015
|
}
|
|
956
1016
|
th, td {
|
|
957
|
-
padding: ${
|
|
1017
|
+
padding: ${r?"0.75rem":"1rem"};
|
|
958
1018
|
text-align: left;
|
|
959
1019
|
border-bottom: 1px solid #e5e7eb;
|
|
960
1020
|
}
|
|
@@ -978,7 +1038,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
978
1038
|
<table class="${n?"bordered":""}">
|
|
979
1039
|
<slot></slot>
|
|
980
1040
|
</table>
|
|
981
|
-
`}};
|
|
1041
|
+
`}};h("af-ui-table",tn);Tb=tn});var Ya={};$(Ya,{default:()=>Zb,AfriUIStat:()=>nn});var nn,Zb;var dr=m(()=>{p();nn=class nn extends i{static get observedAttributes(){return["label","value","delta","trend"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("label")||"Metric",n=this.getAttribute("value")||"0",r=this.getAttribute("delta")||"",o=this.getAttribute("trend")||"neutral",a=o==="positive"?"#16a34a":o==="negative"?"#dc2626":"#475569";this.shadowRoot.innerHTML=c`
|
|
982
1042
|
<style>
|
|
983
1043
|
:host { display: block; font-family: 'Inter', sans-serif; }
|
|
984
1044
|
.stat {
|
|
@@ -1014,9 +1074,9 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1014
1074
|
<div class="stat">
|
|
1015
1075
|
<div class="label">${t}</div>
|
|
1016
1076
|
<div class="value">${n}</div>
|
|
1017
|
-
${
|
|
1077
|
+
${r?c`<div class="delta">${r}</div>`:""}
|
|
1018
1078
|
</div>
|
|
1019
|
-
`}};
|
|
1079
|
+
`}};h("af-ui-stat",nn);Zb=nn});var Ja={};$(Ja,{default:()=>zb,AfriFooter:()=>on});var on,zb;var cr=m(()=>{p();on=class on extends i{static get observedAttributes(){return["company","year"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("company")||"AfriCode",n=this.getAttribute("year")||new Date().getFullYear();this.shadowRoot.innerHTML=c`
|
|
1020
1080
|
<style>
|
|
1021
1081
|
:host {
|
|
1022
1082
|
display: block;
|
|
@@ -1096,7 +1156,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1096
1156
|
<slot name="legal"></slot>
|
|
1097
1157
|
</div>
|
|
1098
1158
|
</footer>
|
|
1099
|
-
`}};
|
|
1159
|
+
`}};h("af-footer",on);zb=on});var Ga={};$(Ga,{default:()=>ti,AfriBreadcrumb:()=>rn});var rn,ti;var gr=m(()=>{p();rn=class rn extends i{static get observedAttributes(){return["separator"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("separator")||"/";this.shadowRoot.innerHTML=c`
|
|
1100
1160
|
<style>
|
|
1101
1161
|
:host {
|
|
1102
1162
|
display: block;
|
|
@@ -1136,7 +1196,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1136
1196
|
<nav aria-label="Breadcrumb">
|
|
1137
1197
|
<slot></slot>
|
|
1138
1198
|
</nav>
|
|
1139
|
-
`}};
|
|
1199
|
+
`}};h("af-breadcrumb",rn);ti=rn});var Qa={};$(Qa,{default:()=>ni,AfriFeatureGrid:()=>an});var an,ni;var sr=m(()=>{p();an=class an extends i{static get observedAttributes(){return["columns"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("columns")||"3";this.shadowRoot.innerHTML=c`
|
|
1140
1200
|
<style>
|
|
1141
1201
|
:host {
|
|
1142
1202
|
display: block;
|
|
@@ -1189,7 +1249,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1189
1249
|
<div class="grid">
|
|
1190
1250
|
<slot></slot>
|
|
1191
1251
|
</div>
|
|
1192
|
-
`}};
|
|
1252
|
+
`}};h("af-feature-grid",an);ni=an});var Fa={};$(Fa,{default:()=>oi,AfriPricingCard:()=>ln});var ln,oi;var mr=m(()=>{p();ln=class ln extends i{static get observedAttributes(){return["title","price","frequency","highlight"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Standard",n=this.getAttribute("price")||"$49",r=this.getAttribute("frequency")||"per month",o=this.hasAttribute("highlight");this.shadowRoot.innerHTML=c`
|
|
1193
1253
|
<style>
|
|
1194
1254
|
:host {
|
|
1195
1255
|
display: block;
|
|
@@ -1201,8 +1261,8 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1201
1261
|
gap: 1rem;
|
|
1202
1262
|
padding: 1.75rem;
|
|
1203
1263
|
border-radius: 28px;
|
|
1204
|
-
background: ${
|
|
1205
|
-
color: ${
|
|
1264
|
+
background: ${o?"linear-gradient(180deg, #1EB53A, #0f172a)":"#ffffff"};
|
|
1265
|
+
color: ${o?"#ffffff":"#0f172a"};
|
|
1206
1266
|
border: 1px solid rgba(15, 23, 42, 0.08);
|
|
1207
1267
|
box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
|
|
1208
1268
|
}
|
|
@@ -1220,7 +1280,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1220
1280
|
}
|
|
1221
1281
|
|
|
1222
1282
|
.frequency {
|
|
1223
|
-
color: ${
|
|
1283
|
+
color: ${o?"rgba(255,255,255,0.8)":"#64748b"};
|
|
1224
1284
|
font-size: 0.95rem;
|
|
1225
1285
|
margin-top: -0.25rem;
|
|
1226
1286
|
}
|
|
@@ -1231,7 +1291,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1231
1291
|
}
|
|
1232
1292
|
|
|
1233
1293
|
::slotted(.feature) {
|
|
1234
|
-
color: ${
|
|
1294
|
+
color: ${o?"#e2e8f0":"#475569"};
|
|
1235
1295
|
font-size: 0.95rem;
|
|
1236
1296
|
display: flex;
|
|
1237
1297
|
align-items: center;
|
|
@@ -1247,14 +1307,14 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1247
1307
|
<div>
|
|
1248
1308
|
<h3 class="title">${t}</h3>
|
|
1249
1309
|
<div class="price">${n}</div>
|
|
1250
|
-
<div class="frequency">${
|
|
1310
|
+
<div class="frequency">${r}</div>
|
|
1251
1311
|
</div>
|
|
1252
1312
|
<div class="features">
|
|
1253
1313
|
<slot></slot>
|
|
1254
1314
|
</div>
|
|
1255
1315
|
<div class="footer"><slot name="action"></slot></div>
|
|
1256
1316
|
</div>
|
|
1257
|
-
`}};
|
|
1317
|
+
`}};h("af-pricing-card",ln);oi=ln});var Ba={};$(Ba,{default:()=>ri,AfriTestimonial:()=>en});var en,ri;var vr=m(()=>{p();en=class en extends i{static get observedAttributes(){return["author","role","company"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("author")||"Customer",n=this.getAttribute("role")||"Founder",r=this.getAttribute("company")||"";this.shadowRoot.innerHTML=c`
|
|
1258
1318
|
<style>
|
|
1259
1319
|
:host {
|
|
1260
1320
|
display: block;
|
|
@@ -1311,10 +1371,10 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1311
1371
|
<div class="quote"><slot></slot></div>
|
|
1312
1372
|
<div class="author">
|
|
1313
1373
|
<span class="name">${t}</span>
|
|
1314
|
-
<span class="meta">${n}${
|
|
1374
|
+
<span class="meta">${n}${r?` · ${r}`:""}</span>
|
|
1315
1375
|
</div>
|
|
1316
1376
|
</article>
|
|
1317
|
-
`}};
|
|
1377
|
+
`}};h("af-testimonial",en);ri=en});var Da={};$(Da,{default:()=>ai,AfriDashboardShell:()=>bn});var bn,ai;var pr=m(()=>{p();bn=class bn extends i{static get observedAttributes(){return["sidebar-width","topbar-height"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("sidebar-width")||"280px",n=this.getAttribute("topbar-height")||"72px";this.shadowRoot.innerHTML=c`
|
|
1318
1378
|
<style>
|
|
1319
1379
|
:host {
|
|
1320
1380
|
display: block;
|
|
@@ -1365,7 +1425,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1365
1425
|
<header class="topbar"><slot name="topbar"></slot></header>
|
|
1366
1426
|
<main class="content"><slot></slot></main>
|
|
1367
1427
|
</div>
|
|
1368
|
-
`}};
|
|
1428
|
+
`}};h("af-dashboard-shell",bn);ai=bn});var Ea={};$(Ea,{default:()=>li,AfriDashboardTopbar:()=>fn});var fn,li;var ur=m(()=>{p();fn=class fn extends i{static get observedAttributes(){return["title","description"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Dashboard",n=this.getAttribute("description")||"";this.shadowRoot.innerHTML=c`
|
|
1369
1429
|
<style>
|
|
1370
1430
|
:host {
|
|
1371
1431
|
display: block;
|
|
@@ -1412,11 +1472,11 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1412
1472
|
<div class="topbar">
|
|
1413
1473
|
<div class="heading">
|
|
1414
1474
|
<div class="title">${t}</div>
|
|
1415
|
-
${n?
|
|
1475
|
+
${n?c`<div class="description">${n}</div>`:""}
|
|
1416
1476
|
</div>
|
|
1417
1477
|
<div class="actions"><slot name="actions"></slot></div>
|
|
1418
1478
|
</div>
|
|
1419
|
-
`}};
|
|
1479
|
+
`}};h("af-dashboard-topbar",fn);li=fn});var Wa={};$(Wa,{default:()=>ei,AfriDashboardCard:()=>hn});var hn,ei;var $r=m(()=>{p();hn=class hn extends i{static get observedAttributes(){return["title","variant"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"",n=this.getAttribute("variant")||"surface",r={surface:{background:"#ffffff",border:"1px solid rgba(15, 23, 42, 0.08)",shadow:"0 18px 36px rgba(15, 23, 42, 0.04)"},elevated:{background:"linear-gradient(180deg, #ffffff 0%, #f8fafc 100%)",border:"1px solid rgba(15, 23, 42, 0.12)",shadow:"0 24px 48px rgba(15, 23, 42, 0.08)"}},o=r[n]||r.surface;this.shadowRoot.innerHTML=c`
|
|
1420
1480
|
<style>
|
|
1421
1481
|
:host {
|
|
1422
1482
|
display: block;
|
|
@@ -1424,10 +1484,10 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1424
1484
|
}
|
|
1425
1485
|
|
|
1426
1486
|
.card {
|
|
1427
|
-
background: ${
|
|
1428
|
-
border: ${
|
|
1487
|
+
background: ${o.background};
|
|
1488
|
+
border: ${o.border};
|
|
1429
1489
|
border-radius: 24px;
|
|
1430
|
-
box-shadow: ${
|
|
1490
|
+
box-shadow: ${o.shadow};
|
|
1431
1491
|
padding: 1.5rem;
|
|
1432
1492
|
min-height: 100px;
|
|
1433
1493
|
overflow: hidden;
|
|
@@ -1450,10 +1510,10 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1450
1510
|
</style>
|
|
1451
1511
|
|
|
1452
1512
|
<div class="card">
|
|
1453
|
-
${t?
|
|
1513
|
+
${t?c`<div class="header"><h3 class="title">${t}</h3><slot name="header"></slot></div>`:""}
|
|
1454
1514
|
<div class="body"><slot></slot></div>
|
|
1455
1515
|
</div>
|
|
1456
|
-
`}};
|
|
1516
|
+
`}};h("af-dashboard-card",hn);ei=hn});var Oa={};$(Oa,{default:()=>bi,AfriDashboardMetric:()=>dn});var dn,bi;var wr=m(()=>{p();dn=class dn extends i{static get observedAttributes(){return["label","value","delta","trend"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("label")||"Metric",n=this.getAttribute("value")||"0",r=this.getAttribute("delta")||"",o=this.getAttribute("trend")||"neutral",a=o==="positive"?"#16a34a":o==="negative"?"#dc2626":"#475569";this.shadowRoot.innerHTML=c`
|
|
1457
1517
|
<style>
|
|
1458
1518
|
:host {
|
|
1459
1519
|
display: block;
|
|
@@ -1496,9 +1556,9 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1496
1556
|
<div class="metric">
|
|
1497
1557
|
<div class="label">${t}</div>
|
|
1498
1558
|
<div class="value">${n}</div>
|
|
1499
|
-
${
|
|
1559
|
+
${r?c`<div class="delta">${r}</div>`:""}
|
|
1500
1560
|
</div>
|
|
1501
|
-
`}};
|
|
1561
|
+
`}};h("af-dashboard-metric",dn);bi=dn});var Ua={};$(Ua,{default:()=>ii,AfriDashboardActivityList:()=>cn});var cn,ii;var xr=m(()=>{p();cn=class cn extends i{static get observedAttributes(){return["title","empty-text"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("title")||"Recent Activity",n=this.getAttribute("empty-text")||"No recent activity available.";this.shadowRoot.innerHTML=c`
|
|
1502
1562
|
<style>
|
|
1503
1563
|
:host {
|
|
1504
1564
|
display: block;
|
|
@@ -1568,7 +1628,348 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1568
1628
|
</slot>
|
|
1569
1629
|
</div>
|
|
1570
1630
|
</div>
|
|
1571
|
-
`}};
|
|
1631
|
+
`}};h("af-dashboard-activity-list",cn);ii=cn});var Na={};$(Na,{AfriAuthForm:()=>Hn});function hi(t){return typeof t==="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}var fi=`
|
|
1632
|
+
:host {
|
|
1633
|
+
display: block;
|
|
1634
|
+
color: var(--af-smart-text, var(--af-text, #172033));
|
|
1635
|
+
font-family: var(--af-font-family, Inter, system-ui, sans-serif);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
form {
|
|
1639
|
+
display: grid;
|
|
1640
|
+
gap: 12px;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
label {
|
|
1644
|
+
display: grid;
|
|
1645
|
+
gap: 6px;
|
|
1646
|
+
color: var(--af-smart-muted, var(--af-muted, #647084));
|
|
1647
|
+
font-size: 0.86rem;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
input {
|
|
1651
|
+
min-height: 42px;
|
|
1652
|
+
border: 1px solid var(--af-smart-border, var(--af-border, #d8dee8));
|
|
1653
|
+
border-radius: 6px;
|
|
1654
|
+
padding: 0 12px;
|
|
1655
|
+
background: var(--af-smart-field-bg, var(--af-surface-muted, #eef2f7));
|
|
1656
|
+
color: inherit;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
button {
|
|
1660
|
+
min-height: 42px;
|
|
1661
|
+
border: 1px solid var(--af-smart-primary, var(--af-primary, #0f766e));
|
|
1662
|
+
border-radius: 6px;
|
|
1663
|
+
background: var(--af-smart-primary, var(--af-primary, #0f766e));
|
|
1664
|
+
color: var(--af-smart-primary-text, #ffffff);
|
|
1665
|
+
cursor: pointer;
|
|
1666
|
+
font: inherit;
|
|
1667
|
+
font-weight: 700;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
button:disabled {
|
|
1671
|
+
cursor: wait;
|
|
1672
|
+
opacity: 0.7;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
.message {
|
|
1676
|
+
min-height: 20px;
|
|
1677
|
+
color: var(--af-smart-muted, var(--af-muted, #647084));
|
|
1678
|
+
font-size: 0.86rem;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.message.error {
|
|
1682
|
+
color: var(--af-smart-danger, var(--af-danger, #b42318));
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
.message.success {
|
|
1686
|
+
color: var(--af-smart-success, var(--af-success, #087443));
|
|
1687
|
+
}
|
|
1688
|
+
`,Hn;var Ar=m(()=>{p();Hn=class Hn extends i{static get observedAttributes(){return["endpoint","button-label"]}connectedCallback(){this.render()}attributeChangedCallback(){if(this.isConnected)this.render()}get endpoint(){return this.getAttribute("endpoint")||"/api/auth"}render(){this.shadowRoot.innerHTML=`
|
|
1689
|
+
<style>${fi}</style>
|
|
1690
|
+
<form novalidate>
|
|
1691
|
+
<label>
|
|
1692
|
+
Email
|
|
1693
|
+
<input name="email" type="email" autocomplete="email" required />
|
|
1694
|
+
</label>
|
|
1695
|
+
<label>
|
|
1696
|
+
Password
|
|
1697
|
+
<input name="password" type="password" autocomplete="current-password" minlength="8" required />
|
|
1698
|
+
</label>
|
|
1699
|
+
<button type="submit">${this.getAttribute("button-label")||"Continue"}</button>
|
|
1700
|
+
<div class="message" role="status" aria-live="polite"></div>
|
|
1701
|
+
</form>
|
|
1702
|
+
`,this.shadowRoot.querySelector("form").addEventListener("submit",(t)=>this.handleSubmit(t))}setMessage(t,n=""){let r=this.shadowRoot.querySelector(".message");r.className=n?`message ${n}`:"message",r.textContent=t}async handleSubmit(t){t.preventDefault();let n=t.currentTarget,r=n.querySelector("button"),o={email:n.elements.email.value.trim(),password:n.elements.password.value};if(!hi(o.email)||o.password.length<8){this.setMessage("Enter a valid email and password.","error"),this.emit("af-auth-error",{code:"INVALID_INPUT"});return}r.disabled=!0,this.setMessage("Checking credentials...");try{let a=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),l=await a.json();if(!a.ok||l.ok===!1){this.setMessage(l.error||"Authentication failed.","error"),this.emit("af-auth-error",{response:l,status:a.status});return}this.setMessage("Authenticated.","success"),this.emit("af-auth-success",l)}catch(a){this.setMessage("Authentication service unavailable.","error"),this.emit("af-auth-error",{code:"NETWORK_ERROR",message:a.message})}finally{r.disabled=!1}}};h("af-auth-form",Hn)});var ya={};$(ya,{AfriKycUpload:()=>Mn});var di=`
|
|
1703
|
+
:host {
|
|
1704
|
+
display: block;
|
|
1705
|
+
color: var(--af-smart-text, var(--af-text, #172033));
|
|
1706
|
+
font-family: var(--af-font-family, Inter, system-ui, sans-serif);
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
form {
|
|
1710
|
+
display: grid;
|
|
1711
|
+
gap: 12px;
|
|
1712
|
+
padding: 16px;
|
|
1713
|
+
border: 1px solid var(--af-smart-border, var(--af-border, #d8dee8));
|
|
1714
|
+
border-radius: 8px;
|
|
1715
|
+
background: var(--af-smart-surface, var(--af-surface, #ffffff));
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
label {
|
|
1719
|
+
display: grid;
|
|
1720
|
+
gap: 6px;
|
|
1721
|
+
color: var(--af-smart-muted, var(--af-muted, #647084));
|
|
1722
|
+
font-size: 0.86rem;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
input {
|
|
1726
|
+
width: 100%;
|
|
1727
|
+
border: 1px solid var(--af-smart-border, var(--af-border, #d8dee8));
|
|
1728
|
+
border-radius: 6px;
|
|
1729
|
+
padding: 10px;
|
|
1730
|
+
background: var(--af-smart-field-bg, var(--af-surface-muted, #eef2f7));
|
|
1731
|
+
color: inherit;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
button {
|
|
1735
|
+
min-height: 42px;
|
|
1736
|
+
border: 1px solid var(--af-smart-primary, var(--af-primary, #0f766e));
|
|
1737
|
+
border-radius: 6px;
|
|
1738
|
+
background: var(--af-smart-primary, var(--af-primary, #0f766e));
|
|
1739
|
+
color: var(--af-smart-primary-text, #ffffff);
|
|
1740
|
+
cursor: pointer;
|
|
1741
|
+
font: inherit;
|
|
1742
|
+
font-weight: 700;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
button:disabled {
|
|
1746
|
+
cursor: wait;
|
|
1747
|
+
opacity: 0.7;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
.hint,
|
|
1751
|
+
.message {
|
|
1752
|
+
color: var(--af-smart-muted, var(--af-muted, #647084));
|
|
1753
|
+
font-size: 0.84rem;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
.message.error {
|
|
1757
|
+
color: var(--af-smart-danger, var(--af-danger, #b42318));
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
.message.success {
|
|
1761
|
+
color: var(--af-smart-success, var(--af-success, #087443));
|
|
1762
|
+
}
|
|
1763
|
+
`,ci,Mn;var _r=m(()=>{p();ci=new Set(["application/pdf","image/jpeg","image/png"]);Mn=class Mn extends i{static get observedAttributes(){return["endpoint","max-size-mb"]}connectedCallback(){this.render()}attributeChangedCallback(){if(this.isConnected)this.render()}get endpoint(){return this.getAttribute("endpoint")||"/api/kyc"}get maxSizeMb(){return Number(this.getAttribute("max-size-mb")||5)}render(){this.shadowRoot.innerHTML=`
|
|
1764
|
+
<style>${di}</style>
|
|
1765
|
+
<form novalidate>
|
|
1766
|
+
<label>
|
|
1767
|
+
Identity document
|
|
1768
|
+
<input name="document" type="file" accept="application/pdf,image/jpeg,image/png" required />
|
|
1769
|
+
</label>
|
|
1770
|
+
<span class="hint">PDF, JPG, or PNG. Maximum ${this.maxSizeMb} MB.</span>
|
|
1771
|
+
<button type="submit">Upload for review</button>
|
|
1772
|
+
<div class="message" role="status" aria-live="polite"></div>
|
|
1773
|
+
</form>
|
|
1774
|
+
`,this.shadowRoot.querySelector("form").addEventListener("submit",(t)=>this.handleSubmit(t))}setMessage(t,n=""){let r=this.shadowRoot.querySelector(".message");r.className=n?`message ${n}`:"message",r.textContent=t}validateFile(t){if(!t)return{ok:!1,code:"FILE_REQUIRED",error:"Choose an identity document."};if(!ci.has(t.type))return{ok:!1,code:"UNSUPPORTED_FILE_TYPE",error:"Use a PDF, JPG, or PNG document."};if(t.size>this.maxSizeMb*1024*1024)return{ok:!1,code:"FILE_TOO_LARGE",error:`File must be ${this.maxSizeMb} MB or smaller.`};return{ok:!0}}async handleSubmit(t){t.preventDefault();let n=t.currentTarget,r=n.querySelector("button"),o=n.elements.document.files?.[0],a=this.validateFile(o);if(!a.ok){this.setMessage(a.error,"error"),this.emit("af-kyc-error",a);return}let l=new FormData;l.set("document",o,o.name),r.disabled=!0,this.setMessage("Uploading document...");try{let e=await fetch(this.endpoint,{method:"POST",body:l}),b=await e.json().catch(()=>({}));if(!e.ok||b.ok===!1){this.setMessage(b.error||"Document upload failed.","error"),this.emit("af-kyc-error",{response:b,status:e.status});return}this.setMessage("Document received for review.","success"),this.emit("af-kyc-success",b)}catch(e){this.setMessage("KYC service unavailable.","error"),this.emit("af-kyc-error",{code:"NETWORK_ERROR",message:e.message})}finally{r.disabled=!1}}};h("af-kyc-upload",Mn)});var Va={};$(Va,{AfriWalletBalance:()=>Rn});function qr(t,n){return`${n||"TZS"} ${Number(t||0).toLocaleString("en-US")}`}var kr=`
|
|
1775
|
+
:host {
|
|
1776
|
+
display: block;
|
|
1777
|
+
color: var(--af-smart-text, var(--af-text, #172033));
|
|
1778
|
+
font-family: var(--af-font-family, Inter, system-ui, sans-serif);
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
.wallet {
|
|
1782
|
+
display: grid;
|
|
1783
|
+
gap: 8px;
|
|
1784
|
+
padding: 16px;
|
|
1785
|
+
border: 1px solid var(--af-smart-border, var(--af-border, #d8dee8));
|
|
1786
|
+
border-radius: 8px;
|
|
1787
|
+
background: var(--af-smart-surface, var(--af-surface, #ffffff));
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
.label,
|
|
1791
|
+
.meta {
|
|
1792
|
+
color: var(--af-smart-muted, var(--af-muted, #647084));
|
|
1793
|
+
font-size: 0.84rem;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
.amount {
|
|
1797
|
+
font-size: 1.8rem;
|
|
1798
|
+
font-weight: 760;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
.error {
|
|
1802
|
+
color: var(--af-smart-danger, var(--af-danger, #b42318));
|
|
1803
|
+
}
|
|
1804
|
+
`,Rn;var Lr=m(()=>{p();Rn=class Rn extends i{static get observedAttributes(){return["endpoint"]}connectedCallback(){this.renderLoading(),this.load()}attributeChangedCallback(){if(this.isConnected)this.load()}get endpoint(){return this.getAttribute("endpoint")||"/api/wallet"}renderLoading(){this.shadowRoot.innerHTML=`
|
|
1805
|
+
<style>${kr}</style>
|
|
1806
|
+
<article class="wallet">
|
|
1807
|
+
<span class="label">Available balance</span>
|
|
1808
|
+
<strong class="amount">Loading</strong>
|
|
1809
|
+
<span class="meta">Fetching wallet</span>
|
|
1810
|
+
</article>
|
|
1811
|
+
`}renderWallet(t){this.shadowRoot.innerHTML=`
|
|
1812
|
+
<style>${kr}</style>
|
|
1813
|
+
<article class="wallet">
|
|
1814
|
+
<span class="label">Available balance</span>
|
|
1815
|
+
<strong class="amount"></strong>
|
|
1816
|
+
<span class="meta"></span>
|
|
1817
|
+
</article>
|
|
1818
|
+
`,this.shadowRoot.querySelector(".amount").textContent=qr(t.availableBalance,t.currency),this.shadowRoot.querySelector(".meta").textContent=`Ledger ${qr(t.ledgerBalance,t.currency)} · Daily limit ${qr(t.dailyLimit,t.currency)}`}renderError(t){this.shadowRoot.innerHTML=`
|
|
1819
|
+
<style>${kr}</style>
|
|
1820
|
+
<article class="wallet">
|
|
1821
|
+
<span class="label">Available balance</span>
|
|
1822
|
+
<strong class="amount error">Unavailable</strong>
|
|
1823
|
+
<span class="meta error"></span>
|
|
1824
|
+
</article>
|
|
1825
|
+
`,this.shadowRoot.querySelector(".meta").textContent=t}async load(){try{let t=await fetch(this.endpoint),n=await t.json();if(!t.ok||n.ok===!1||!n.wallet)throw Error(n.error||"Wallet data unavailable.");this.renderWallet(n.wallet),this.emit("af-wallet-load",n)}catch(t){this.renderError("Wallet API is unavailable."),this.emit("af-wallet-error",{message:t.message})}}};h("af-wallet-balance",Rn)});var ja={};$(ja,{AfriTransactionLedger:()=>Sn});function gi(t,n){return`${n||"TZS"} ${Number(t||0).toLocaleString("en-US")}`}var Ka=`
|
|
1826
|
+
:host {
|
|
1827
|
+
display: block;
|
|
1828
|
+
color: var(--af-smart-text, var(--af-text, #172033));
|
|
1829
|
+
font-family: var(--af-font-family, Inter, system-ui, sans-serif);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
.ledger {
|
|
1833
|
+
display: grid;
|
|
1834
|
+
gap: 10px;
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
.row {
|
|
1838
|
+
display: grid;
|
|
1839
|
+
grid-template-columns: 1fr auto;
|
|
1840
|
+
gap: 12px;
|
|
1841
|
+
padding: 12px;
|
|
1842
|
+
border: 1px solid var(--af-smart-border, var(--af-border, #d8dee8));
|
|
1843
|
+
border-radius: 8px;
|
|
1844
|
+
background: var(--af-smart-surface, var(--af-surface, #ffffff));
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
.status,
|
|
1848
|
+
.empty {
|
|
1849
|
+
color: var(--af-smart-muted, var(--af-muted, #647084));
|
|
1850
|
+
font-size: 0.84rem;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
.amount {
|
|
1854
|
+
font-weight: 760;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
.error {
|
|
1858
|
+
color: var(--af-smart-danger, var(--af-danger, #b42318));
|
|
1859
|
+
}
|
|
1860
|
+
`,Sn;var Hr=m(()=>{p();Sn=class Sn extends i{static get observedAttributes(){return["endpoint"]}connectedCallback(){this.renderShell("Loading transactions"),this.load()}attributeChangedCallback(){if(this.isConnected)this.load()}get endpoint(){return this.getAttribute("endpoint")||"/api/wallet"}renderShell(t=""){if(this.shadowRoot.innerHTML=`
|
|
1861
|
+
<style>${Ka}</style>
|
|
1862
|
+
<div class="ledger" role="list"></div>
|
|
1863
|
+
`,t){let n=document.createElement("div");n.className="empty",n.textContent=t,this.shadowRoot.querySelector(".ledger").append(n)}}renderTransactions(t){this.renderShell();let n=this.shadowRoot.querySelector(".ledger");if(!t.length){let r=document.createElement("div");r.className="empty",r.textContent="No transactions yet.",n.append(r);return}n.replaceChildren(...t.map((r)=>{let o=document.createElement("article"),a=document.createElement("div"),l=document.createElement("strong"),e=document.createElement("div"),b=document.createElement("span");return o.className="row",o.setAttribute("role","listitem"),e.className="status",b.className="amount",l.textContent=r.counterparty||r.id||"Transaction",e.textContent=r.status||r.type||"pending",b.textContent=gi(r.amount,r.currency),a.append(l,e),o.append(a,b),o}))}renderError(t){this.shadowRoot.innerHTML=`
|
|
1864
|
+
<style>${Ka}</style>
|
|
1865
|
+
<div class="empty error"></div>
|
|
1866
|
+
`,this.shadowRoot.querySelector(".empty").textContent=t}async load(){try{let t=await fetch(this.endpoint),n=await t.json(),r=Array.isArray(n.transactions)?n.transactions:[];if(!t.ok||n.ok===!1)throw Error(n.error||"Ledger data unavailable.");this.renderTransactions(r),this.emit("af-ledger-load",{transactions:r})}catch(t){this.renderError("Transaction ledger unavailable."),this.emit("af-ledger-error",{message:t.message})}}};h("af-transaction-ledger",Sn)});var Ca={};$(Ca,{default:()=>si,AfriNavDrawer:()=>gn});var gn,si;var Mr=m(()=>{p();p();gn=class gn extends i{constructor(){super();this.isOpen=!1,this.position=this.getAttribute("position")||"left",this.width=this.getAttribute("width")||"280px",this.overlay=this.hasAttribute("overlay")}static get observedAttributes(){return["open","position","width","overlay"]}attributeChangedCallback(t,n,r){switch(t){case"open":this.isOpen=r!==null,this.render();break;case"position":this.position=r;break;case"width":this.width=r;break;case"overlay":this.overlay=r!==null;break}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.loadStyles()}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown=(t)=>{if(t.key==="Escape"&&this.isOpen)this.close()};toggle(){this.isOpen?this.close():this.open()}open(){this.isOpen=!0,this.setAttribute("open",""),this.render(),this.emit("af-navdrawer-open",{drawer:this})}close(){this.isOpen=!1,this.removeAttribute("open"),this.render(),this.emit("af-navdrawer-close",{drawer:this})}render(){if(!this.shadowRoot)return;if(this.shadowRoot.innerHTML=`
|
|
1867
|
+
<style>
|
|
1868
|
+
:host {
|
|
1869
|
+
display: block;
|
|
1870
|
+
position: fixed;
|
|
1871
|
+
z-index: 1000;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
.nav-drawer {
|
|
1875
|
+
position: fixed;
|
|
1876
|
+
top: 0;
|
|
1877
|
+
${this.position}: 0;
|
|
1878
|
+
width: ${this.width};
|
|
1879
|
+
height: 100vh;
|
|
1880
|
+
background: var(--af-bg, #ffffff);
|
|
1881
|
+
box-shadow: var(--af-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
|
|
1882
|
+
transform: translateX(${this.position==="left"?"-100%":"100%"});
|
|
1883
|
+
transition: transform 0.3s ease-in-out;
|
|
1884
|
+
overflow-y: auto;
|
|
1885
|
+
z-index: 1001;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
.nav-drawer.open {
|
|
1889
|
+
transform: translateX(0);
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
.nav-drawer-overlay {
|
|
1893
|
+
position: fixed;
|
|
1894
|
+
top: 0;
|
|
1895
|
+
left: 0;
|
|
1896
|
+
width: 100vw;
|
|
1897
|
+
height: 100vh;
|
|
1898
|
+
background: rgba(0, 0, 0, 0.5);
|
|
1899
|
+
opacity: 0;
|
|
1900
|
+
visibility: hidden;
|
|
1901
|
+
transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
|
|
1902
|
+
z-index: 1000;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
.nav-drawer-overlay.open {
|
|
1906
|
+
opacity: 1;
|
|
1907
|
+
visibility: visible;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
.nav-drawer-header {
|
|
1911
|
+
display: flex;
|
|
1912
|
+
justify-content: space-between;
|
|
1913
|
+
align-items: center;
|
|
1914
|
+
padding: 1rem;
|
|
1915
|
+
border-bottom: 1px solid var(--af-border-color, #e5e7eb);
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
.nav-drawer-title {
|
|
1919
|
+
margin: 0;
|
|
1920
|
+
font-size: 1.25rem;
|
|
1921
|
+
font-weight: 600;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
.close-btn {
|
|
1925
|
+
background: none;
|
|
1926
|
+
border: none;
|
|
1927
|
+
font-size: 1.5rem;
|
|
1928
|
+
cursor: pointer;
|
|
1929
|
+
padding: 0.25rem;
|
|
1930
|
+
border-radius: 4px;
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
.close-btn:hover {
|
|
1934
|
+
background: var(--af-hover-bg, #f3f4f6);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
.nav-drawer-content {
|
|
1938
|
+
padding: 1rem;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
.nav-item {
|
|
1942
|
+
display: block;
|
|
1943
|
+
padding: 0.75rem 1rem;
|
|
1944
|
+
text-decoration: none;
|
|
1945
|
+
color: var(--af-text, #1f2937);
|
|
1946
|
+
border-radius: 6px;
|
|
1947
|
+
margin-bottom: 0.25rem;
|
|
1948
|
+
transition: background-color 0.2s;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
.nav-item:hover {
|
|
1952
|
+
background-color: var(--af-hover-bg, #f3f4f6);
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
.nav-item.active {
|
|
1956
|
+
background-color: var(--af-primary, #10b981);
|
|
1957
|
+
color: white;
|
|
1958
|
+
}
|
|
1959
|
+
</style>
|
|
1960
|
+
|
|
1961
|
+
${this.overlay?`<div class="nav-drawer-overlay ${this.isOpen?"open":""}" part="overlay"></div>`:""}
|
|
1962
|
+
|
|
1963
|
+
<aside class="nav-drawer ${this.isOpen?"open":""}" part="drawer" role="dialog" aria-modal="true" aria-label="Navigation menu">
|
|
1964
|
+
<header class="nav-drawer-header" part="header">
|
|
1965
|
+
<h2 class="nav-drawer-title" part="title"><slot name="title">Menu</slot></h2>
|
|
1966
|
+
<button class="close-btn" part="close-button" @click="${()=>this.close()}" aria-label="Close menu">✕</button>
|
|
1967
|
+
</header>
|
|
1968
|
+
<div class="nav-drawer-content" part="content">
|
|
1969
|
+
<slot name="content"></slot>
|
|
1970
|
+
</div>
|
|
1971
|
+
</aside>
|
|
1972
|
+
`,this.overlay){let t=this.shadowRoot.querySelector(".nav-drawer-overlay");if(t)t.addEventListener("click",()=>this.close())}}getItems(){return this.querySelectorAll('[slot="content"] .nav-item')}setActiveItem(t){this.getItems().forEach((o)=>o.classList.remove("active"));let r=this.querySelector(t);if(r)r.classList.add("active")}};h("af-nav-drawer",gn);si=gn});var Ia={};$(Ia,{default:()=>mi,AfriButton:()=>Xn});var Xn,mi;var Pa=m(()=>{p();Xn=class Xn extends i{static get observedAttributes(){return["variant","size","theme","disabled","loading","icon","aria-label"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector("button")?.addEventListener("click",(n)=>{if(this.hasAttribute("disabled")||this.hasAttribute("loading")){n.preventDefault();return}this.emit("af-click",{originalEvent:n})})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"primary",n=this.getAttribute("size")||"md",r=this.getAttribute("theme")||"tanzania",o=this.hasAttribute("disabled"),a=this.hasAttribute("loading"),l=this.getAttribute("icon"),e=this.getAttribute("aria-label"),b={tanzania:{primary:"#1EB53A",accent:"#FCD116",text:"#FFFFFF"},maasai:{primary:"#FF0000",accent:"#8B0000",text:"#FFFFFF"},ndebele:{primary:"#4169E1",accent:"#FFD700",text:"#FFFFFF"},ocean:{primary:"#00A3DD",accent:"#0077BE",text:"#FFFFFF"}},f=b[r]||b.tanzania;this.shadowRoot.innerHTML=`
|
|
1572
1973
|
<style>
|
|
1573
1974
|
:host {
|
|
1574
1975
|
display: inline-block;
|
|
@@ -1596,8 +1997,8 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1596
1997
|
|
|
1597
1998
|
/* Variants */
|
|
1598
1999
|
.variant-primary {
|
|
1599
|
-
background: ${
|
|
1600
|
-
color: ${
|
|
2000
|
+
background: ${f.primary};
|
|
2001
|
+
color: ${f.text};
|
|
1601
2002
|
}
|
|
1602
2003
|
.variant-primary:hover:not(:disabled) {
|
|
1603
2004
|
filter: brightness(1.1);
|
|
@@ -1607,25 +2008,25 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1607
2008
|
|
|
1608
2009
|
.variant-secondary {
|
|
1609
2010
|
background: transparent;
|
|
1610
|
-
color: ${
|
|
1611
|
-
border: 2px solid ${
|
|
2011
|
+
color: ${f.primary};
|
|
2012
|
+
border: 2px solid ${f.primary};
|
|
1612
2013
|
}
|
|
1613
2014
|
.variant-secondary:hover:not(:disabled) {
|
|
1614
|
-
background: ${
|
|
1615
|
-
color: ${
|
|
2015
|
+
background: ${f.primary};
|
|
2016
|
+
color: ${f.text};
|
|
1616
2017
|
}
|
|
1617
2018
|
|
|
1618
2019
|
.variant-ghost {
|
|
1619
2020
|
background: transparent;
|
|
1620
|
-
color: ${
|
|
2021
|
+
color: ${f.primary};
|
|
1621
2022
|
}
|
|
1622
2023
|
.variant-ghost:hover:not(:disabled) {
|
|
1623
2024
|
background: rgba(0,0,0,0.05);
|
|
1624
2025
|
}
|
|
1625
2026
|
|
|
1626
2027
|
.variant-gradient {
|
|
1627
|
-
background: linear-gradient(135deg, ${
|
|
1628
|
-
color: ${
|
|
2028
|
+
background: linear-gradient(135deg, ${f.primary} 0%, ${f.accent} 100%);
|
|
2029
|
+
color: ${f.text};
|
|
1629
2030
|
}
|
|
1630
2031
|
.variant-gradient:hover:not(:disabled) {
|
|
1631
2032
|
transform: translateY(-2px);
|
|
@@ -1664,15 +2065,15 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1664
2065
|
|
|
1665
2066
|
<button
|
|
1666
2067
|
class="variant-${t} size-${n}"
|
|
1667
|
-
${
|
|
1668
|
-
${
|
|
2068
|
+
${o?"disabled":""}
|
|
2069
|
+
${e?`aria-label="${e}"`:""}
|
|
1669
2070
|
${a?'aria-busy="true"':""}
|
|
1670
2071
|
>
|
|
1671
2072
|
${a?'<span class="spinner"></span>':""}
|
|
1672
2073
|
${l&&!a?`<span class="icon">${l}</span>`:""}
|
|
1673
2074
|
<slot></slot>
|
|
1674
2075
|
</button>
|
|
1675
|
-
`}};
|
|
2076
|
+
`}};h("af-button",Xn);mi=Xn});var Ta={};$(Ta,{default:()=>vi,AfriCard:()=>Yn});var Yn,vi;var Za=m(()=>{p();Yn=class Yn extends i{static get observedAttributes(){return["theme","variant","clickable","image"]}constructor(){super();this.render()}connectedCallback(){if(this.hasAttribute("clickable"))this.shadowRoot.querySelector(".card").addEventListener("click",()=>{this.emit("af-click")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"default",n=this.getAttribute("variant")||"elevated",r=this.hasAttribute("clickable"),o=this.getAttribute("image"),a={default:{accent:"#333",border:"#eee"},tanzania:{accent:"#1EB53A",border:"#1EB53A"},maasai:{accent:"#FF0000",border:"#8B0000"},ndebele:{accent:"#4169E1",border:"#4169E1"}},e={elevated:"box-shadow: 0 2px 12px rgba(0,0,0,0.1);",outlined:`border: 2px solid ${(a[t]||a.default).border};`,flat:"background: #f8f9fa;"};this.shadowRoot.innerHTML=html`
|
|
1676
2077
|
<style>
|
|
1677
2078
|
:host {
|
|
1678
2079
|
display: block;
|
|
@@ -1687,7 +2088,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1687
2088
|
overflow: hidden;
|
|
1688
2089
|
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
1689
2090
|
position: relative;
|
|
1690
|
-
${
|
|
2091
|
+
${r?"cursor: pointer;":""}
|
|
1691
2092
|
}
|
|
1692
2093
|
|
|
1693
2094
|
.card::before {
|
|
@@ -1698,7 +2099,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1698
2099
|
pointer-events: none;
|
|
1699
2100
|
}
|
|
1700
2101
|
|
|
1701
|
-
${
|
|
2102
|
+
${r?`
|
|
1702
2103
|
.card:hover {
|
|
1703
2104
|
transform: translateY(-8px);
|
|
1704
2105
|
border-color: rgba(252, 209, 22, 0.4);
|
|
@@ -1740,7 +2141,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1740
2141
|
</style>
|
|
1741
2142
|
|
|
1742
2143
|
<article class="card">
|
|
1743
|
-
${
|
|
2144
|
+
${o?`<img class="card-image" src="${o}" alt="" />`:""}
|
|
1744
2145
|
<div class="card-body">
|
|
1745
2146
|
<slot></slot>
|
|
1746
2147
|
</div>
|
|
@@ -1750,7 +2151,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1750
2151
|
</div>
|
|
1751
2152
|
`:""}
|
|
1752
2153
|
</article>
|
|
1753
|
-
`}};
|
|
2154
|
+
`}};h("af-card",Yn);vi=Yn});var za={};$(za,{default:()=>pi,AfriNavbar:()=>Jn});var Jn,pi;var tl=m(()=>{p();Ht();rt();Jn=class Jn extends i{static get observedAttributes(){return["theme","logo","sticky"]}constructor(){super();this._isOpen=!1,this._unsubscribe=null,this.render()}connectedCallback(){super.connectedCallback(),this.shadowRoot.querySelector(".menu-toggle")?.addEventListener("click",()=>{this._isOpen=!this._isOpen;let t=this.shadowRoot.querySelector(".nav-links"),n=this.shadowRoot.querySelector(".menu-toggle");if(t)t.classList.toggle("open",this._isOpen);if(n)n.classList.toggle("open",this._isOpen),n.setAttribute("aria-expanded",String(this._isOpen))})}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"dark",n=this.getAttribute("logo")||"AfriCode",r=this.hasAttribute("sticky");this.shadowRoot.innerHTML=`
|
|
1754
2155
|
<style>
|
|
1755
2156
|
:host {
|
|
1756
2157
|
display: block;
|
|
@@ -1926,7 +2327,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1926
2327
|
<slot></slot>
|
|
1927
2328
|
</div>
|
|
1928
2329
|
</nav>
|
|
1929
|
-
`}};
|
|
2330
|
+
`}};h("af-navbar",Jn);pi=Jn});var nl={};$(nl,{default:()=>ui,AfriInput:()=>Gn});var Gn,ui;var ol=m(()=>{p();qn();Gn=class Gn extends i{static get observedAttributes(){return["type","name","label","placeholder","error","helper","theme","icon","required","aria-label","aria-describedby","validation"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}get value(){return this.shadowRoot.querySelector("input")?.value||""}set value(t){let n=this.shadowRoot.querySelector("input");if(n)n.value=t}connectedCallback(){this._attachInputListeners(),this.loadStyles()}attributeChangedCallback(){this.render(),this._attachInputListeners()}_attachInputListeners(){let t=this.shadowRoot.querySelector("input");if(!t)return;t.addEventListener("input",(n)=>{if(this.emit("af-input",{value:n.target.value}),this.hasAttribute("error"))this.removeAttribute("error")}),t.addEventListener("blur",()=>{this.emit("af-blur",{value:this.value}),this._validateInput()})}_setupValidation(){if(!this.getAttribute("validation"))return;let n=this.shadowRoot.querySelector("input");if(!n)return;n.addEventListener("input",()=>{if(this.hasAttribute("error"))this.removeAttribute("error")})}_validateInput(){let t=this.shadowRoot.querySelector("input");if(!t)return;let n=this.getAttribute("validation"),r=t.value;if(this.hasAttribute("required")&&!r.trim()){this.setAttribute("error","This field is required");return}if(n&&r.trim()){let a=this._getValidationSchema(n);if(a){let l=ft.validateField(a,r);if(!l.success)this.setAttribute("error",l.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:O.email(),password:O.password(),phone:O.phone(),url:O.url(),required:O.required()};if(t.includes(":")){let[r,o]=t.split(":"),a=parseInt(o);switch(r){case"minLength":return O.minLength(a);case"maxLength":return O.maxLength(a);case"pattern":return O.pattern(new RegExp(o),"Invalid format")}}return n[t]||null}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",r=this.getAttribute("label")||"",o=this.getAttribute("placeholder")||"",a=this.getAttribute("error")||"",l=this.getAttribute("helper")||"",e=this.getAttribute("theme")||"tanzania",b=this.getAttribute("icon")||"",f=this.hasAttribute("required"),u=this.getAttribute("aria-label"),q=this.getAttribute("aria-describedby"),R={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},M=R[e]||R.tanzania,Y=[];if(a)Y.push(`error-${this._uniqueId}`);else if(l)Y.push(`helper-${this._uniqueId}`);if(q)Y.push(...q.split(" "));let bo=Y.length>0?`aria-describedby="${Y.join(" ")}"`:"";this.shadowRoot.innerHTML=`
|
|
1930
2331
|
<style>
|
|
1931
2332
|
:host {
|
|
1932
2333
|
display: block;
|
|
@@ -1959,7 +2360,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
1959
2360
|
input {
|
|
1960
2361
|
width: 100%;
|
|
1961
2362
|
padding: 10px 13px;
|
|
1962
|
-
${
|
|
2363
|
+
${b?"padding-left: 40px;":""}
|
|
1963
2364
|
font-size: 15px;
|
|
1964
2365
|
border: 2px solid #ddd;
|
|
1965
2366
|
border-radius: 5px;
|
|
@@ -2000,25 +2401,25 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2000
2401
|
</style>
|
|
2001
2402
|
|
|
2002
2403
|
<div class="input-wrapper">
|
|
2003
|
-
${
|
|
2404
|
+
${r?`<label for="input-${this._uniqueId}">${r}${f?'<span class="required-star">*</span>':""}</label>`:""}
|
|
2004
2405
|
<div class="input-container">
|
|
2005
|
-
${
|
|
2406
|
+
${b?`<span class="icon">${b}</span>`:""}
|
|
2006
2407
|
<input
|
|
2007
2408
|
id="input-${this._uniqueId}"
|
|
2008
2409
|
name="${n}"
|
|
2009
2410
|
type="${t}"
|
|
2010
|
-
placeholder="${
|
|
2411
|
+
placeholder="${o}"
|
|
2011
2412
|
class="${a?"has-error":""}"
|
|
2012
|
-
${
|
|
2013
|
-
${
|
|
2413
|
+
${f?"required":""}
|
|
2414
|
+
${u?`aria-label="${u}"`:""}
|
|
2014
2415
|
${a?'aria-invalid="true"':""}
|
|
2015
|
-
${
|
|
2416
|
+
${bo}
|
|
2016
2417
|
/>
|
|
2017
2418
|
</div>
|
|
2018
2419
|
${a?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${a}</div>`:""}
|
|
2019
2420
|
${l&&!a?`<div id="helper-${this._uniqueId}" class="helper-text">${l}</div>`:""}
|
|
2020
2421
|
</div>
|
|
2021
|
-
`}};
|
|
2422
|
+
`}};h("af-input",Gn);ui=Gn});var rl={};$(rl,{default:()=>$i,AfriAlert:()=>Qn});var Qn,$i;var al=m(()=>{p();Qn=class Qn extends i{static get observedAttributes(){return["type","title","dismissible"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector(".close-btn")?.addEventListener("click",()=>{this.remove(),this.emit("af-dismiss")})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"info",n=this.getAttribute("title")||"",r=this.hasAttribute("dismissible"),o={success:{bg:"#d4edda",border:"#1EB53A",text:"#155724",icon:"✓"},warning:{bg:"#fff3cd",border:"#FCD116",text:"#856404",icon:"⚠"},error:{bg:"#f8d7da",border:"#DC3545",text:"#721c24",icon:"✕"},info:{bg:"#d1ecf1",border:"#00A3DD",text:"#0c5460",icon:"ℹ"}},a=o[t]||o.info;this.shadowRoot.innerHTML=`
|
|
2022
2423
|
<style>
|
|
2023
2424
|
:host {
|
|
2024
2425
|
display: block;
|
|
@@ -2096,36 +2497,36 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2096
2497
|
${n?`<div class="title">${n}</div>`:""}
|
|
2097
2498
|
<slot></slot>
|
|
2098
2499
|
</div>
|
|
2099
|
-
${
|
|
2500
|
+
${r?'<button class="close-btn" aria-label="Dismiss">×</button>':""}
|
|
2100
2501
|
</div>
|
|
2101
|
-
`}};
|
|
2102
|
-
align-items: ${
|
|
2103
|
-
justify-items: ${
|
|
2502
|
+
`}};h("af-alert",Qn);$i=Qn});var ll={};$(ll,{AfriGrid:()=>Rr});function wi(t,n){let{sidebarSide:r="left",sidebarWidth:o="280px",minWidth:a="280px",gap:l="24px",columns:e,rows:b,align:f="stretch",justify:u="stretch",dense:q=!1}=n,R=q?"dense":"",M=`
|
|
2503
|
+
align-items: ${f};
|
|
2504
|
+
justify-items: ${u};
|
|
2104
2505
|
gap: ${l};
|
|
2105
|
-
`;switch(t){case"sidebar":return
|
|
2506
|
+
`;switch(t){case"sidebar":return r==="right"?`display: grid; grid-template-columns: 1fr ${o}; ${M}`:`display: grid; grid-template-columns: ${o} 1fr; ${M}`;case"holy-grail":return`
|
|
2106
2507
|
display: grid;
|
|
2107
|
-
grid-template-columns: ${
|
|
2508
|
+
grid-template-columns: ${o} 1fr ${o};
|
|
2108
2509
|
grid-template-rows: auto 1fr auto;
|
|
2109
2510
|
${M}
|
|
2110
2511
|
`;case"bento":return`
|
|
2111
2512
|
display: grid;
|
|
2112
2513
|
grid-template-columns: repeat(12, 1fr);
|
|
2113
2514
|
grid-auto-rows: minmax(120px, auto);
|
|
2114
|
-
grid-auto-flow: row ${
|
|
2515
|
+
grid-auto-flow: row ${R};
|
|
2115
2516
|
${M}
|
|
2116
2517
|
`;case"masonry":return`
|
|
2117
2518
|
display: grid;
|
|
2118
2519
|
grid-template-columns: repeat(auto-fill, minmax(${a}, 1fr));
|
|
2119
2520
|
grid-template-rows: masonry;
|
|
2120
|
-
grid-auto-flow: row ${
|
|
2521
|
+
grid-auto-flow: row ${R};
|
|
2121
2522
|
${M}
|
|
2122
|
-
`;case"auto":default:{let
|
|
2523
|
+
`;case"auto":default:{let Y=e?`repeat(${e}, 1fr)`:`repeat(auto-fit, minmax(${a}, 1fr))`,bo=b?`repeat(${b}, 1fr)`:"auto";return`
|
|
2123
2524
|
display: grid;
|
|
2124
|
-
grid-template-columns: ${
|
|
2125
|
-
${
|
|
2126
|
-
grid-auto-flow: row ${
|
|
2525
|
+
grid-template-columns: ${Y};
|
|
2526
|
+
${b?`grid-template-rows: ${bo};`:""}
|
|
2527
|
+
grid-auto-flow: row ${R};
|
|
2127
2528
|
${M}
|
|
2128
|
-
`}}}var
|
|
2529
|
+
`}}}var Rr;var el=m(()=>{p();Rr=class Rr extends i{static get observedAttributes(){return["min-width","gap","columns","rows","layout","align","justify","dense","sidebar-side","sidebar-width"]}attributeChangedCallback(){if(this.isConnected)this.render()}_getAttrs(){return{minWidth:this.getAttribute("min-width")||"280px",gap:this.getAttribute("gap")||"24px",columns:this.getAttribute("columns")||null,rows:this.getAttribute("rows")||null,layout:this.getAttribute("layout")||"auto",align:this.getAttribute("align")||"stretch",justify:this.getAttribute("justify")||"stretch",dense:this.hasAttribute("dense"),sidebarSide:this.getAttribute("sidebar-side")||"left",sidebarWidth:this.getAttribute("sidebar-width")||"280px"}}_buildResponsiveBreakpoints(t){if(t.layout!=="auto"&&t.layout!=="masonry")return"";return`
|
|
2129
2530
|
@media (max-width: 768px) {
|
|
2130
2531
|
.grid {
|
|
2131
2532
|
grid-template-columns: repeat(auto-fit, minmax(min(${t.minWidth}, 100%), 1fr));
|
|
@@ -2142,7 +2543,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2142
2543
|
grid-template-columns: 1fr;
|
|
2143
2544
|
}
|
|
2144
2545
|
}
|
|
2145
|
-
`}render(){let t=this._getAttrs(),n=
|
|
2546
|
+
`}render(){let t=this._getAttrs(),n=wi(t.layout,t),r=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=c`
|
|
2146
2547
|
<style>
|
|
2147
2548
|
:host {
|
|
2148
2549
|
display: block;
|
|
@@ -2161,7 +2562,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2161
2562
|
min-width: 0; /* Prevent overflow in grid context */
|
|
2162
2563
|
}
|
|
2163
2564
|
|
|
2164
|
-
${
|
|
2565
|
+
${r}
|
|
2165
2566
|
</style>
|
|
2166
2567
|
|
|
2167
2568
|
<div
|
|
@@ -2172,7 +2573,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2172
2573
|
>
|
|
2173
2574
|
<slot></slot>
|
|
2174
2575
|
</div>
|
|
2175
|
-
`}connectedCallback(){this.render(),this._setupResizeObserver()}disconnectedCallback(){if(this._resizeObserver)this._resizeObserver.disconnect()}_setupResizeObserver(){if(typeof ResizeObserver>"u")return;let t=this.offsetWidth;this._resizeObserver=new ResizeObserver((n)=>{for(let
|
|
2576
|
+
`}connectedCallback(){this.render(),this._setupResizeObserver()}disconnectedCallback(){if(this._resizeObserver)this._resizeObserver.disconnect()}_setupResizeObserver(){if(typeof ResizeObserver>"u")return;let t=this.offsetWidth;this._resizeObserver=new ResizeObserver((n)=>{for(let r of n){let o=r.contentRect.width;if(Math.abs(o-t)>10)t=o,this.emit("af-grid-resize",{width:o,height:r.contentRect.height,layout:this.getAttribute("layout")||"auto"})}}),this._resizeObserver.observe(this)}setLayout(t){this.setAttribute("layout",t)}setColumns(t){this.setAttribute("columns",String(t))}setDense(t){if(t)this.setAttribute("dense","");else this.removeAttribute("dense")}};h("af-grid",Rr)});var bl={};$(bl,{AfriSection:()=>Sr});var Sr;var il=m(()=>{p();Sr=class Sr extends i{render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("title");this.shadowRoot.innerHTML=c`
|
|
2176
2577
|
<style>
|
|
2177
2578
|
:host { display: block; width: 100%; }
|
|
2178
2579
|
.section {
|
|
@@ -2199,20 +2600,20 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2199
2600
|
}
|
|
2200
2601
|
</style>
|
|
2201
2602
|
<section class="section">
|
|
2202
|
-
${n?
|
|
2603
|
+
${n?c`
|
|
2203
2604
|
<div class="section-header">
|
|
2204
2605
|
<h2>${n}</h2>
|
|
2205
2606
|
</div>
|
|
2206
2607
|
`:""}
|
|
2207
2608
|
<slot></slot>
|
|
2208
2609
|
</section>
|
|
2209
|
-
`}connectedCallback(){this.render()}};
|
|
2610
|
+
`}connectedCallback(){this.render()}};h("af-section",Sr)});var fl={};$(fl,{default:()=>xi,AfriIcon:()=>Fn});var Fn,xi;var hl=m(()=>{p();Fn=class Fn extends i{static get observedAttributes(){return["name","size"]}connectedCallback(){this.render()}render(){let t=this.getAttribute("name")||"circle",n=this.getAttribute("size")||"24",o={check:'<path d="M20 6L9 17l-5-5" />',x:'<path d="M18 6L6 18M6 6l12 12" />',"arrow-right":'<path d="M5 12h14M12 5l7 7-7 7" />',menu:'<path d="M3 12h18M3 6h18M3 18h18" />',search:'<circle cx="11" cy="11" r="8" /><path d="M21 21l-4.35-4.35" />'}[t]||"";this.shadowRoot.innerHTML=`
|
|
2210
2611
|
<style>
|
|
2211
2612
|
:host { display: inline-flex; vertical-align: middle; }
|
|
2212
2613
|
svg { width: ${n}px; height: ${n}px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
2213
2614
|
</style>
|
|
2214
|
-
<svg viewBox="0 0 24 24">${
|
|
2215
|
-
`}};
|
|
2615
|
+
<svg viewBox="0 0 24 24">${o}</svg>
|
|
2616
|
+
`}};h("af-icon",Fn);xi=Fn});var dl={};$(dl,{default:()=>Ai,AfriAccordion:()=>Bn});var Bn,Ai;var cl=m(()=>{p();Bn=class Bn extends i{static get observedAttributes(){return["theme","multiple"]}constructor(){super();this._openItems=new Set,this._uniqueId=Math.random().toString(36).substr(2,9),this.render()}connectedCallback(){this._setupAccordion()}_setupAccordion(){this.shadowRoot.querySelectorAll(".accordion-header").forEach((n,r)=>{n.addEventListener("click",()=>{this._toggleItem(r)})})}_toggleItem(t){let n=this.hasAttribute("multiple");if(this._openItems.has(t))this._openItems.delete(t);else{if(!n)this._openItems.clear();this._openItems.add(t)}this.render(),this._setupAccordion(),this.emit("af-toggle",{index:t,open:this._openItems.has(t)})}attributeChangedCallback(){this.render(),this._setupAccordion()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="items"]'),r=n?Array.from(n.children):[],o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},a=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
|
|
2216
2617
|
<style>
|
|
2217
2618
|
:host {
|
|
2218
2619
|
display: block;
|
|
@@ -2290,22 +2691,22 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2290
2691
|
</style>
|
|
2291
2692
|
|
|
2292
2693
|
<div class="accordion">
|
|
2293
|
-
${
|
|
2694
|
+
${r.map((l,e)=>{let b=this._openItems.has(e),f=`accordion-header-${this._uniqueId}-${e}`,u=`accordion-panel-${this._uniqueId}-${e}`;return`
|
|
2294
2695
|
<div class="accordion-item">
|
|
2295
2696
|
<button
|
|
2296
|
-
class="accordion-header ${
|
|
2297
|
-
aria-expanded="${
|
|
2298
|
-
aria-controls="${
|
|
2299
|
-
id="${
|
|
2697
|
+
class="accordion-header ${b?"active":""}"
|
|
2698
|
+
aria-expanded="${b}"
|
|
2699
|
+
aria-controls="${u}"
|
|
2700
|
+
id="${f}"
|
|
2300
2701
|
>
|
|
2301
|
-
<span>${l.getAttribute("title")||`Item ${
|
|
2702
|
+
<span>${l.getAttribute("title")||`Item ${e+1}`}</span>
|
|
2302
2703
|
<span class="accordion-icon">▼</span>
|
|
2303
2704
|
</button>
|
|
2304
2705
|
<div
|
|
2305
|
-
class="accordion-content ${
|
|
2306
|
-
id="${
|
|
2706
|
+
class="accordion-content ${b?"open":""}"
|
|
2707
|
+
id="${u}"
|
|
2307
2708
|
role="region"
|
|
2308
|
-
aria-labelledby="${
|
|
2709
|
+
aria-labelledby="${f}"
|
|
2309
2710
|
>
|
|
2310
2711
|
<div class="accordion-body">
|
|
2311
2712
|
${l.innerHTML}
|
|
@@ -2315,7 +2716,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2315
2716
|
`}).join("")}
|
|
2316
2717
|
</div>
|
|
2317
2718
|
<slot name="items"></slot>
|
|
2318
|
-
`}};
|
|
2719
|
+
`}};h("af-accordion",Bn);Ai=Bn});var gl={};$(gl,{default:()=>_i,AfriHero:()=>Dn});var Dn,_i;var sl=m(()=>{p();Ht();rt();Dn=class Dn extends i{static get observedAttributes(){return["title","subtitle","pattern","overlay"]}connectedCallback(){super.connectedCallback(),this.render(),this.loadStyles()}render(){let t=this.getAttribute("title")||"AfriCode",n=this.getAttribute("subtitle")||"",r=this.getAttribute("pattern")||"",o=this.getAttribute("variant")||"default";this.shadowRoot.innerHTML=`
|
|
2319
2720
|
<style>
|
|
2320
2721
|
:host {
|
|
2321
2722
|
display: flex;
|
|
@@ -2383,11 +2784,11 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2383
2784
|
z-index: 2;
|
|
2384
2785
|
}
|
|
2385
2786
|
|
|
2386
|
-
${
|
|
2787
|
+
${r?`
|
|
2387
2788
|
.pattern-bg {
|
|
2388
2789
|
position: absolute;
|
|
2389
2790
|
inset: 0;
|
|
2390
|
-
background-image: url('${
|
|
2791
|
+
background-image: url('${r}');
|
|
2391
2792
|
background-size: cover;
|
|
2392
2793
|
background-position: center;
|
|
2393
2794
|
opacity: 0.15;
|
|
@@ -2405,7 +2806,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2405
2806
|
|
|
2406
2807
|
<div class="aura"></div>
|
|
2407
2808
|
<div class="mesh"></div>
|
|
2408
|
-
${
|
|
2809
|
+
${r?'<div class="pattern-bg"></div>':""}
|
|
2409
2810
|
|
|
2410
2811
|
<div class="content">
|
|
2411
2812
|
<h1>${t}</h1>
|
|
@@ -2415,7 +2816,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2415
2816
|
</div>
|
|
2416
2817
|
<slot></slot>
|
|
2417
2818
|
</div>
|
|
2418
|
-
`}};
|
|
2819
|
+
`}};h("af-hero",Dn);_i=Dn});var ml={};$(ml,{default:()=>ki,AfriTable:()=>En});var En,ki;var vl=m(()=>{p();En=class En extends i{static get observedAttributes(){return["theme","striped","hoverable"]}constructor(){super();this._columns=[],this._data=[],this._sortColumn=null,this._sortDirection="asc",this.render()}set columns(t){this._columns=t,this.render()}set data(t){this._data=t,this.render()}attributeChangedCallback(){this.render()}_handleSort(t){if(this._sortColumn===t)this._sortDirection=this._sortDirection==="asc"?"desc":"asc";else this._sortColumn=t,this._sortDirection="asc";this.emit("af-sort",{column:t,direction:this._sortDirection}),this.render()}_getSortedData(){if(!this._sortColumn)return this._data;return[...this._data].sort((t,n)=>{let r=t[this._sortColumn],o=n[this._sortColumn],a=this._sortDirection==="asc"?1:-1;if(typeof r==="number")return(r-o)*a;return String(r).localeCompare(String(o))*a})}render(){let t=this.getAttribute("theme")||"tanzania",n=this.hasAttribute("striped"),r=this.hasAttribute("hoverable"),o={tanzania:{header:"#1EB53A",text:"#FFFFFF",accent:"#FCD116"},maasai:{header:"#8B0000",text:"#FFFFFF",accent:"#FF0000"},ndebele:{header:"#4169E1",text:"#FFFFFF",accent:"#FFD700"}},a=o[t]||o.tanzania,l=this._getSortedData();this.shadowRoot.innerHTML=`
|
|
2419
2820
|
<style>
|
|
2420
2821
|
:host {
|
|
2421
2822
|
display: block;
|
|
@@ -2465,7 +2866,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2465
2866
|
}
|
|
2466
2867
|
`:""}
|
|
2467
2868
|
|
|
2468
|
-
${
|
|
2869
|
+
${r?`
|
|
2469
2870
|
tbody tr:hover {
|
|
2470
2871
|
background: ${a.accent}20;
|
|
2471
2872
|
}
|
|
@@ -2482,20 +2883,20 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2482
2883
|
<table>
|
|
2483
2884
|
<thead>
|
|
2484
2885
|
<tr>
|
|
2485
|
-
${this._columns.map((
|
|
2486
|
-
<th data-column="${
|
|
2487
|
-
${
|
|
2886
|
+
${this._columns.map((e)=>`
|
|
2887
|
+
<th data-column="${e.key}">
|
|
2888
|
+
${e.label}
|
|
2488
2889
|
<span class="sort-icon">
|
|
2489
|
-
${this._sortColumn===
|
|
2890
|
+
${this._sortColumn===e.key?this._sortDirection==="asc"?"↑":"↓":"↕"}
|
|
2490
2891
|
</span>
|
|
2491
2892
|
</th>
|
|
2492
2893
|
`).join("")}
|
|
2493
2894
|
</tr>
|
|
2494
2895
|
</thead>
|
|
2495
2896
|
<tbody>
|
|
2496
|
-
${l.length?l.map((
|
|
2897
|
+
${l.length?l.map((e)=>`
|
|
2497
2898
|
<tr>
|
|
2498
|
-
${this._columns.map((
|
|
2899
|
+
${this._columns.map((b)=>`<td>${e[b.key]??""}</td>`).join("")}
|
|
2499
2900
|
</tr>
|
|
2500
2901
|
`).join(""):`
|
|
2501
2902
|
<tr>
|
|
@@ -2505,7 +2906,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2505
2906
|
</tbody>
|
|
2506
2907
|
</table>
|
|
2507
2908
|
</div>
|
|
2508
|
-
`,this.shadowRoot.querySelectorAll("th").forEach((
|
|
2909
|
+
`,this.shadowRoot.querySelectorAll("th").forEach((e)=>{e.addEventListener("click",()=>{this._handleSort(e.dataset.column)})})}};h("af-table",En);ki=En});var pl={};$(pl,{default:()=>qi,AfriModal:()=>Wn});var Wn,qi;var ul=m(()=>{p();Wn=class Wn extends i{static get observedAttributes(){return["open","theme","size","aria-label","aria-labelledby"]}constructor(){super();this.render()}connectedCallback(){this._setupListeners()}_setupListeners(){this.shadowRoot.querySelector(".backdrop")?.addEventListener("click",(t)=>{if(t.target.classList.contains("backdrop"))this.close()}),this.shadowRoot.querySelector(".close-btn")?.addEventListener("click",()=>{this.close()}),document.addEventListener("keydown",(t)=>{if(t.key==="Escape"&&this.hasAttribute("open"))this.close()}),this.shadowRoot.addEventListener("keydown",(t)=>{if(t.key==="Tab"&&this.hasAttribute("open"))this._handleTabKey(t)})}_getFocusableElements(){let t=this.shadowRoot.querySelector(".modal"),n='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',r=Array.from(t?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')||[]),o=Array.from(this.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));return[...r,...o]}_focusFirstFocusableElement(){let t=this._getFocusableElements();if(t.length>0)t[0].focus();else this.shadowRoot.querySelector(".close-btn")?.focus()}_handleTabKey(t){let n=this._getFocusableElements();if(n.length===0){t.preventDefault();return}let r=n[0],o=n[n.length-1];if(t.shiftKey){if(document.activeElement===r)t.preventDefault(),o.focus()}else if(document.activeElement===o)t.preventDefault(),r.focus()}open(){this.setAttribute("open",""),document.body.style.overflow="hidden",this._previousFocus=document.activeElement,this._focusFirstFocusableElement(),this.emit("af-open")}close(){if(this.removeAttribute("open"),document.body.style.overflow="",this._previousFocus&&this._previousFocus.focus)this._previousFocus.focus();this.emit("af-close")}attributeChangedCallback(t,n,r){if(this.render(),t==="open")this._setupListeners()}render(){let t=this.hasAttribute("open"),n=this.getAttribute("theme")||"tanzania",r=this.getAttribute("size")||"md",o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},a=o[n]||o.tanzania,l={sm:"400px",md:"560px",lg:"720px",full:"95vw"},e=this.getAttribute("aria-label"),b=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
|
|
2509
2910
|
<style>
|
|
2510
2911
|
:host {
|
|
2511
2912
|
font-family: 'Inter', system-ui, sans-serif;
|
|
@@ -2532,7 +2933,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2532
2933
|
background: white;
|
|
2533
2934
|
border-radius: 8px;
|
|
2534
2935
|
width: 100%;
|
|
2535
|
-
max-width: ${l[
|
|
2936
|
+
max-width: ${l[r]||l.md};
|
|
2536
2937
|
max-height: 90vh;
|
|
2537
2938
|
overflow: hidden;
|
|
2538
2939
|
display: flex;
|
|
@@ -2596,7 +2997,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2596
2997
|
</style>
|
|
2597
2998
|
|
|
2598
2999
|
<div class="backdrop">
|
|
2599
|
-
<div class="modal" role="dialog" aria-modal="true" ${
|
|
3000
|
+
<div class="modal" role="dialog" aria-modal="true" ${e?`aria-label="${e}"`:`aria-labelledby="${b}"`}>
|
|
2600
3001
|
<div class="modal-header">
|
|
2601
3002
|
<slot name="header" id="modal-title"></slot>
|
|
2602
3003
|
<button class="close-btn" aria-label="Close modal">×</button>
|
|
@@ -2609,7 +3010,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2609
3010
|
</div>
|
|
2610
3011
|
</div>
|
|
2611
3012
|
</div>
|
|
2612
|
-
`}};
|
|
3013
|
+
`}};h("af-modal",Wn);qi=Wn});var $l={};$($l,{default:()=>Li,AfriTabs:()=>On});var On,Li;var wl=m(()=>{p();On=class On extends i{static get observedAttributes(){return["theme"]}constructor(){super();this._activeTab=0,this.render()}connectedCallback(){this._setupTabs(),this.addEventListener("keydown",this._handleKeydown.bind(this))}_handleKeydown(t){let n=this.querySelector('[slot="tabs"]'),r=n?Array.from(n.children):[];if(r.length===0)return;switch(t.key){case"ArrowLeft":t.preventDefault(),this._activeTab=this._activeTab>0?this._activeTab-1:r.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break;case"ArrowRight":t.preventDefault(),this._activeTab=this._activeTab<r.length-1?this._activeTab+1:0,this.render(),this._setupTabs(),this._focusActiveTab();break;case"Home":t.preventDefault(),this._activeTab=0,this.render(),this._setupTabs(),this._focusActiveTab();break;case"End":t.preventDefault(),this._activeTab=r.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break}}_focusActiveTab(){let t=this.shadowRoot.querySelectorAll(".tab-button");if(t[this._activeTab])t[this._activeTab].focus()}_setupTabs(){this.shadowRoot.querySelectorAll(".tab-button").forEach((n,r)=>{n.addEventListener("click",()=>{this._activeTab=r,this.render(),this._setupTabs(),this.emit("af-tab-change",{index:r,tab:n.textContent})})})}attributeChangedCallback(){this.render(),this._setupTabs()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="tabs"]'),r=n?Array.from(n.children):[],o={tanzania:{active:"#1EB53A",text:"#FFFFFF"},maasai:{active:"#FF0000",text:"#FFFFFF"},ndebele:{active:"#4169E1",text:"#FFFFFF"}},a=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
|
|
2613
3014
|
<style>
|
|
2614
3015
|
:host {
|
|
2615
3016
|
display: block;
|
|
@@ -2681,30 +3082,30 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2681
3082
|
|
|
2682
3083
|
<div class="tabs-container">
|
|
2683
3084
|
<div class="tab-list" role="tablist">
|
|
2684
|
-
${
|
|
2685
|
-
<button class="tab-button ${
|
|
3085
|
+
${r.map((l,e)=>`
|
|
3086
|
+
<button class="tab-button ${e===this._activeTab?"active":""}"
|
|
2686
3087
|
role="tab"
|
|
2687
|
-
aria-selected="${
|
|
2688
|
-
aria-controls="panel-${
|
|
2689
|
-
tabindex="${
|
|
2690
|
-
id="tab-${
|
|
2691
|
-
${l.getAttribute("label")||`Tab ${
|
|
3088
|
+
aria-selected="${e===this._activeTab}"
|
|
3089
|
+
aria-controls="panel-${e}"
|
|
3090
|
+
tabindex="${e===this._activeTab?"0":"-1"}"
|
|
3091
|
+
id="tab-${e}">
|
|
3092
|
+
${l.getAttribute("label")||`Tab ${e+1}`}
|
|
2692
3093
|
</button>
|
|
2693
3094
|
`).join("")}
|
|
2694
3095
|
</div>
|
|
2695
3096
|
<div class="tab-panels">
|
|
2696
|
-
${
|
|
2697
|
-
<div class="tab-panel ${
|
|
3097
|
+
${r.map((l,e)=>`
|
|
3098
|
+
<div class="tab-panel ${e===this._activeTab?"active":""}"
|
|
2698
3099
|
role="tabpanel"
|
|
2699
|
-
id="panel-${
|
|
2700
|
-
aria-labelledby="tab-${
|
|
3100
|
+
id="panel-${e}"
|
|
3101
|
+
aria-labelledby="tab-${e}">
|
|
2701
3102
|
${l.innerHTML}
|
|
2702
3103
|
</div>
|
|
2703
3104
|
`).join("")}
|
|
2704
3105
|
</div>
|
|
2705
3106
|
</div>
|
|
2706
3107
|
<slot name="tabs"></slot>
|
|
2707
|
-
`}};
|
|
3108
|
+
`}};h("af-tabs",On);Li=On});var xl={};$(xl,{default:()=>Hi,AfriSidebar:()=>Un});var Un,Hi;var Al=m(()=>{p();Ht();rt();Un=class Un extends i{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=T(()=>{this.updateUI()}),this.render()}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}updateUI(){let t=J.ui.sidebarCollapsed,n=this.shadowRoot.querySelector(".sidebar"),r=this.shadowRoot.querySelector(".sidebar-title"),o=this.shadowRoot.getElementById("toggle"),a=this.shadowRoot.querySelector(".sidebar-content");if(n)n.style.width=t?"60px":"260px";if(r)r.style.opacity=t?"0":"1";if(a)a.style.padding=t?"12px":"20px";if(o)o.innerHTML=t?"→":"← Collapse"}render(){let t=this.getAttribute("position")||"left",n=J.ui.sidebarCollapsed;this.shadowRoot.innerHTML=`
|
|
2708
3109
|
<style>
|
|
2709
3110
|
:host {
|
|
2710
3111
|
display: block;
|
|
@@ -2813,7 +3214,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2813
3214
|
</button>
|
|
2814
3215
|
</div>
|
|
2815
3216
|
</aside>
|
|
2816
|
-
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};
|
|
3217
|
+
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};h("af-sidebar",Un);Hi=Un});var _l={};$(_l,{default:()=>Mi,AfriDropdown:()=>Nn});var Nn,Mi;var kl=m(()=>{p();Nn=class Nn extends i{static get observedAttributes(){return["label","open"]}constructor(){super();this._open=!1,this.render()}toggle(){if(this._open=!this._open,this._open)this.setAttribute("open","");else this.removeAttribute("open");this.render()}close(){this._open=!1,this.removeAttribute("open"),this.render()}connectedCallback(){document.addEventListener("click",(t)=>{if(!this.contains(t.target))this.close()}),this.addEventListener("keydown",this._handleKeydown.bind(this))}_handleKeydown(t){let n=this.shadowRoot.getElementById("trigger");switch(t.key){case"Enter":case" ":t.preventDefault(),this.toggle();break;case"Escape":if(this._open)t.preventDefault(),this.close(),n.focus();break;case"ArrowDown":if(!this._open)t.preventDefault(),this.toggle();break}}render(){let t=this.getAttribute("label")||"Menu",n=this.hasAttribute("open");this.shadowRoot.innerHTML=`
|
|
2817
3218
|
<style>
|
|
2818
3219
|
:host {
|
|
2819
3220
|
display: inline-block;
|
|
@@ -2895,7 +3296,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2895
3296
|
<div class="dropdown-menu" role="menu" ${n?"":'aria-hidden="true"'}>
|
|
2896
3297
|
<slot></slot>
|
|
2897
3298
|
</div>
|
|
2898
|
-
`,this.shadowRoot.getElementById("trigger").addEventListener("click",(
|
|
3299
|
+
`,this.shadowRoot.getElementById("trigger").addEventListener("click",(r)=>{r.stopPropagation(),this.toggle()})}};h("af-dropdown",Nn);Mi=Nn});var ql={};$(ql,{default:()=>Ri,AfriSelect:()=>yn});var yn,Ri;var Ll=m(()=>{p();yn=class yn extends i{static get observedAttributes(){return["label","placeholder","theme","error","required","aria-label","aria-describedby"]}constructor(){super();this._uniqueId=Math.random().toString(36).substr(2,9),this._isOpen=!1,this._selectedIndex=-1,this._options=[],this.render()}get value(){return this._selectedIndex>=0?this._options[this._selectedIndex]?.value:""}connectedCallback(){this._options=Array.from(this.querySelectorAll("option")).map((t)=>({value:t.value,label:t.textContent})),this.render(),this._setupListeners()}_setupListeners(){let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");t?.addEventListener("click",()=>{this._toggleDropdown()}),t?.addEventListener("keydown",(r)=>{this._handleKeydown(r)}),this.shadowRoot.querySelectorAll(".select-option").forEach((r,o)=>{r.addEventListener("click",()=>{this._selectOption(o)})}),document.addEventListener("click",(r)=>{if(!this.contains(r.target)&&this._isOpen)this._closeDropdown()})}_toggleDropdown(){this._isOpen=!this._isOpen;let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");if(n?.classList.toggle("open",this._isOpen),t?.classList.toggle("open",this._isOpen),this._isOpen)t?.setAttribute("aria-expanded","true"),n?.setAttribute("aria-hidden","false");else t?.setAttribute("aria-expanded","false"),n?.setAttribute("aria-hidden","true")}_closeDropdown(){this._isOpen=!1;let t=this.shadowRoot.querySelector(".select-trigger"),n=this.shadowRoot.querySelector(".select-dropdown");n?.classList.remove("open"),t?.classList.remove("open"),t?.setAttribute("aria-expanded","false"),n?.setAttribute("aria-hidden","true")}_selectOption(t){this._selectedIndex=t,this._closeDropdown(),this.render(),this._setupListeners(),this.emit("af-change",{value:this.value,label:this._options[t].label})}_handleKeydown(t){let n=this.shadowRoot.querySelector(".select-trigger");switch(t.key){case"Enter":case" ":t.preventDefault(),this._toggleDropdown();break;case"Escape":if(this._isOpen)t.preventDefault(),this._closeDropdown(),n.focus();break;case"ArrowDown":if(!this._isOpen)t.preventDefault(),this._toggleDropdown();else t.preventDefault(),this._navigateOptions(1);break;case"ArrowUp":if(this._isOpen)t.preventDefault(),this._navigateOptions(-1);break}}_navigateOptions(t){let n=this.shadowRoot.querySelectorAll(".select-option");if(n.length===0)return;let r=this._selectedIndex+t;if(r<0)r=n.length-1;if(r>=n.length)r=0;this._selectedIndex=r,this.render(),this._setupListeners(),this.shadowRoot.querySelector(".select-option.selected")?.scrollIntoView({block:"nearest"})}attributeChangedCallback(){this.render(),this._setupListeners()}render(){let t=this.getAttribute("label")||"",n=this.getAttribute("placeholder")||"Select an option",r=this.getAttribute("theme")||"tanzania",o=this.getAttribute("error")||"",a=this.hasAttribute("required"),l=this.getAttribute("aria-label"),e=this.getAttribute("aria-describedby"),b={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},f=b[r]||b.tanzania,u=[];if(o)u.push(`error-${this._uniqueId}`);if(e)u.push(...e.split(" "));let q=u.length>0?`aria-describedby="${u.join(" ")}"`:"",R=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
|
|
2899
3300
|
<style>
|
|
2900
3301
|
:host {
|
|
2901
3302
|
display: block;
|
|
@@ -2912,7 +3313,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2912
3313
|
}
|
|
2913
3314
|
|
|
2914
3315
|
.required-star {
|
|
2915
|
-
color: ${
|
|
3316
|
+
color: ${f.error};
|
|
2916
3317
|
margin-left: 2px;
|
|
2917
3318
|
}
|
|
2918
3319
|
|
|
@@ -2924,7 +3325,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2924
3325
|
width: 100%;
|
|
2925
3326
|
padding: 10px 40px 10px 13px;
|
|
2926
3327
|
font-size: 15px;
|
|
2927
|
-
border: 2px solid ${
|
|
3328
|
+
border: 2px solid ${o?f.error:"#ddd"};
|
|
2928
3329
|
border-radius: 5px;
|
|
2929
3330
|
background: white;
|
|
2930
3331
|
cursor: pointer;
|
|
@@ -2937,8 +3338,8 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2937
3338
|
.select-trigger:focus,
|
|
2938
3339
|
.select-trigger.open {
|
|
2939
3340
|
outline: none;
|
|
2940
|
-
border-color: ${
|
|
2941
|
-
box-shadow: 0 0 0 3px ${
|
|
3341
|
+
border-color: ${o?f.error:f.focus};
|
|
3342
|
+
box-shadow: 0 0 0 3px ${o?f.error+"20":f.focus+"20"};
|
|
2942
3343
|
}
|
|
2943
3344
|
|
|
2944
3345
|
.select-arrow {
|
|
@@ -2984,18 +3385,18 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
2984
3385
|
}
|
|
2985
3386
|
|
|
2986
3387
|
.select-option:hover {
|
|
2987
|
-
background: ${
|
|
3388
|
+
background: ${f.focus}15;
|
|
2988
3389
|
}
|
|
2989
3390
|
|
|
2990
3391
|
.select-option.selected {
|
|
2991
|
-
background: ${
|
|
3392
|
+
background: ${f.focus};
|
|
2992
3393
|
color: white;
|
|
2993
3394
|
}
|
|
2994
3395
|
|
|
2995
3396
|
.error-text {
|
|
2996
3397
|
font-size: 12px;
|
|
2997
3398
|
margin-top: 4px;
|
|
2998
|
-
color: ${
|
|
3399
|
+
color: ${f.error};
|
|
2999
3400
|
}
|
|
3000
3401
|
|
|
3001
3402
|
::slotted(option) {
|
|
@@ -3011,27 +3412,27 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3011
3412
|
aria-expanded="${this._isOpen}"
|
|
3012
3413
|
aria-haspopup="listbox"
|
|
3013
3414
|
${l?`aria-label="${l}"`:""}
|
|
3014
|
-
${
|
|
3415
|
+
${o?'aria-invalid="true"':""}
|
|
3015
3416
|
${q}>
|
|
3016
|
-
${
|
|
3417
|
+
${R}
|
|
3017
3418
|
</button>
|
|
3018
3419
|
<span class="select-arrow" aria-hidden="true">▼</span>
|
|
3019
3420
|
<div class="select-dropdown ${this._isOpen?"open":""}"
|
|
3020
3421
|
role="listbox"
|
|
3021
3422
|
aria-hidden="${!this._isOpen}">
|
|
3022
|
-
${this._options.map((M,
|
|
3023
|
-
<div class="select-option ${
|
|
3024
|
-
data-index="${
|
|
3423
|
+
${this._options.map((M,Y)=>`
|
|
3424
|
+
<div class="select-option ${Y===this._selectedIndex?"selected":""}"
|
|
3425
|
+
data-index="${Y}"
|
|
3025
3426
|
role="option"
|
|
3026
|
-
aria-selected="${
|
|
3427
|
+
aria-selected="${Y===this._selectedIndex}">
|
|
3027
3428
|
${M.label}
|
|
3028
3429
|
</div>
|
|
3029
3430
|
`).join("")}
|
|
3030
3431
|
</div>
|
|
3031
3432
|
</div>
|
|
3032
|
-
${
|
|
3433
|
+
${o?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${o}</div>`:""}
|
|
3033
3434
|
<slot></slot>
|
|
3034
|
-
`}};
|
|
3435
|
+
`}};h("af-select",yn);Ri=yn});var Hl={};$(Hl,{default:()=>Si,AfriForm:()=>Vn});var Vn,Si;var Ml=m(()=>{p();qn();Vn=class Vn extends i{static get observedAttributes(){return["action","method","error","success","schema"]}constructor(){super();this.handleSubmit=this.handleSubmit.bind(this)}connectedCallback(){this.render(),this.shadowRoot.querySelector("form").addEventListener("submit",this.handleSubmit),this.loadStyles()}async handleSubmit(t){t.preventDefault();let n=t.target,r=this.querySelector('[type="submit"]')||this.shadowRoot.querySelector('button[type="submit"]'),o=this.getAttribute("schema"),a=o?this._getSchema(o):null,l=this.getAttribute("action"),e=this.getAttribute("method")||"GET",b=new FormData(n),f=Object.fromEntries(b.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((q)=>{let R=q.getAttribute("name");if(R)f[R]=q.value}),a){let q=ft.validate(a,f);if(!q.success){this._showValidationErrors(q.errors),this.emit("af-validation-error",{errors:q.errors});return}}if(!l)return;if(r){var u=r.textContent;r.textContent="Wait...",r.disabled=!0}try{let q=await fetch(l,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(q.ok)this.emit("success",await q.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let R=await q.text();this.emit("error",R),this.setAttribute("error",R),this.removeAttribute("success")}}catch(q){this.emit("error",q.message),this.setAttribute("error",q.message),this.removeAttribute("success")}finally{if(r)r.textContent=u,r.disabled=!1}}_getSchema(t){return kn[t]||null}_showValidationErrors(t){this.shadowRoot.querySelectorAll(".field-error").forEach((n)=>n.remove()),Object.entries(t).forEach(([n,r])=>{let o=this.querySelector(`[name="${n}"]`);if(o)if(o.tagName==="AF-INPUT")o.setAttribute("error",r);else{let a=document.createElement("div");a.className="field-error",a.textContent=r,a.style.color="red",a.style.fontSize="12px",a.style.marginTop="4px",o.parentNode.insertBefore(a,o.nextSibling)}})}};h("af-form",Vn);Si=Vn});var Rl={};$(Rl,{default:()=>Xi,AfriTooltip:()=>Kn});var Kn,Xi;var Sl=m(()=>{p();Kn=class Kn extends i{static get observedAttributes(){return["text","position"]}constructor(){super();this._tooltipId=`af-tooltip-${Math.random().toString(36).substr(2,9)}`,this.render()}connectedCallback(){this._setupTooltipListeners()}attributeChangedCallback(){this.render(),this._setupTooltipListeners()}_setupTooltipListeners(){let t=this.shadowRoot.querySelector(".tooltip-trigger"),n=this.shadowRoot.querySelector(".tooltip-content");if(!t||!n)return;t.addEventListener("focus",()=>{n.style.opacity="1",n.style.visibility="visible",n.setAttribute("aria-hidden","false")}),t.addEventListener("blur",()=>{n.style.opacity="0",n.style.visibility="hidden",n.setAttribute("aria-hidden","true")}),t.addEventListener("mouseenter",()=>{n.style.opacity="1",n.style.visibility="visible",n.setAttribute("aria-hidden","false")}),t.addEventListener("mouseleave",()=>{n.style.opacity="0",n.style.visibility="hidden",n.setAttribute("aria-hidden","true")})}render(){let t=this.getAttribute("text")||"Tooltip",n=this.getAttribute("position")||"top",r={top:`
|
|
3035
3436
|
bottom: 100%;
|
|
3036
3437
|
left: 50%;
|
|
3037
3438
|
transform: translateX(-50%) translateY(-8px);
|
|
@@ -3062,7 +3463,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3062
3463
|
|
|
3063
3464
|
.tooltip-content {
|
|
3064
3465
|
position: absolute;
|
|
3065
|
-
${
|
|
3466
|
+
${r[n]}
|
|
3066
3467
|
padding: 8px 12px;
|
|
3067
3468
|
background: #1e1e1e;
|
|
3068
3469
|
border: 1px solid #2a2a2a;
|
|
@@ -3120,7 +3521,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3120
3521
|
<slot></slot>
|
|
3121
3522
|
</span>
|
|
3122
3523
|
<div class="tooltip-content" id="${this._tooltipId}" role="tooltip" aria-hidden="true">${t}</div>
|
|
3123
|
-
`}};
|
|
3524
|
+
`}};h("af-tooltip",Kn);Xi=Kn});var Xl={};$(Xl,{default:()=>Yi,AfriToast:()=>jn});var jn,Yi;var Yl=m(()=>{p();jn=class jn extends i{static get observedAttributes(){return["type","message","duration"]}constructor(){super();this.render()}show(t,n="info",r=4000){if(this.setAttribute("message",t),this.setAttribute("type",n),this.render(),this.shadowRoot.querySelector(".toast").classList.add("show"),r>0)setTimeout(()=>this.hide(),r)}hide(){this.shadowRoot.querySelector(".toast").classList.remove("show"),setTimeout(()=>this.emit("af-toast-close"),300)}render(){let t=this.getAttribute("type")||"info",n=this.getAttribute("message")||"",r={success:"✓",error:"✗",warning:"⚠",info:"ℹ"},o={success:"#1EB53A",error:"#EF3340",warning:"#FCD116",info:"#00A3DD"};this.shadowRoot.innerHTML=`
|
|
3124
3525
|
<style>
|
|
3125
3526
|
:host {
|
|
3126
3527
|
position: fixed;
|
|
@@ -3137,7 +3538,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3137
3538
|
padding: 16px 20px;
|
|
3138
3539
|
background: #121212;
|
|
3139
3540
|
border: 1px solid #1e1e1e;
|
|
3140
|
-
border-left: 4px solid ${
|
|
3541
|
+
border-left: 4px solid ${o[t]};
|
|
3141
3542
|
border-radius: 8px;
|
|
3142
3543
|
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
|
|
3143
3544
|
transform: translateX(120%);
|
|
@@ -3154,8 +3555,8 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3154
3555
|
width: 28px;
|
|
3155
3556
|
height: 28px;
|
|
3156
3557
|
border-radius: 50%;
|
|
3157
|
-
background: ${
|
|
3158
|
-
color: ${
|
|
3558
|
+
background: ${o[t]}20;
|
|
3559
|
+
color: ${o[t]};
|
|
3159
3560
|
display: flex;
|
|
3160
3561
|
align-items: center;
|
|
3161
3562
|
justify-content: center;
|
|
@@ -3188,13 +3589,13 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3188
3589
|
</style>
|
|
3189
3590
|
|
|
3190
3591
|
<div class="toast">
|
|
3191
|
-
<span class="toast-icon">${
|
|
3592
|
+
<span class="toast-icon">${r[t]}</span>
|
|
3192
3593
|
<div class="toast-content">
|
|
3193
3594
|
<div class="toast-message">${n}</div>
|
|
3194
3595
|
</div>
|
|
3195
3596
|
<button class="toast-close" id="close">×</button>
|
|
3196
3597
|
</div>
|
|
3197
|
-
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};
|
|
3598
|
+
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};h("af-toast",jn);Yi=jn});var Jl={};$(Jl,{default:()=>Ji,AfriBadge:()=>Cn});var Cn,Ji;var Gl=m(()=>{p();Cn=class Cn extends i{static get observedAttributes(){return["variant","size","removable"]}constructor(){super();this.render()}connectedCallback(){this.shadowRoot.querySelector(".remove-btn")?.addEventListener("click",()=>{this.emit("af-remove"),this.remove()})}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("size")||"md",r=this.hasAttribute("removable"),o={default:{bg:"#e9ecef",text:"#495057"},success:{bg:"#d4edda",text:"#155724"},warning:{bg:"#fff3cd",text:"#856404"},error:{bg:"#f8d7da",text:"#721c24"},info:{bg:"#d1ecf1",text:"#0c5460"},tanzania:{bg:"#1EB53A",text:"#FFFFFF"},maasai:{bg:"#FF0000",text:"#FFFFFF"},ndebele:{bg:"#4169E1",text:"#FFFFFF"},gold:{bg:"#FCD116",text:"#000000"}},a=o[t]||o.default,l={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},e=l[n]||l.md;this.shadowRoot.innerHTML=`
|
|
3198
3599
|
<style>
|
|
3199
3600
|
:host {
|
|
3200
3601
|
display: inline-block;
|
|
@@ -3205,8 +3606,8 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3205
3606
|
display: inline-flex;
|
|
3206
3607
|
align-items: center;
|
|
3207
3608
|
gap: 5px;
|
|
3208
|
-
padding: ${
|
|
3209
|
-
font-size: ${
|
|
3609
|
+
padding: ${e.padding};
|
|
3610
|
+
font-size: ${e.fontSize};
|
|
3210
3611
|
font-weight: 600;
|
|
3211
3612
|
background: ${a.bg};
|
|
3212
3613
|
color: ${a.text};
|
|
@@ -3233,9 +3634,9 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3233
3634
|
|
|
3234
3635
|
<span class="badge">
|
|
3235
3636
|
<slot></slot>
|
|
3236
|
-
${
|
|
3637
|
+
${r?'<button class="remove-btn" aria-label="Remove">×</button>':""}
|
|
3237
3638
|
</span>
|
|
3238
|
-
`}};
|
|
3639
|
+
`}};h("af-badge",Cn);Ji=Cn});var Ql={};$(Ql,{default:()=>Gi,AfriAvatar:()=>In});var In,Gi;var Fl=m(()=>{p();In=class In extends i{static get observedAttributes(){return["src","name","size","status","theme"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getInitials(t){if(!t)return"?";let n=t.trim().split(" ");if(n.length>=2)return(n[0][0]+n[n.length-1][0]).toUpperCase();return t.substring(0,2).toUpperCase()}render(){let t=this.getAttribute("src"),n=this.getAttribute("name")||"",r=this.getAttribute("size")||"md",o=this.getAttribute("status"),a=this.getAttribute("theme")||"tanzania",l={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},e=l[a]||l.tanzania,b={sm:{size:"32px",font:"12px",status:"8px"},md:{size:"44px",font:"16px",status:"10px"},lg:{size:"64px",font:"22px",status:"14px"},xl:{size:"96px",font:"32px",status:"18px"}},f=b[r]||b.md,u={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
|
|
3239
3640
|
<style>
|
|
3240
3641
|
:host {
|
|
3241
3642
|
display: inline-block;
|
|
@@ -3244,16 +3645,16 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3244
3645
|
|
|
3245
3646
|
.avatar {
|
|
3246
3647
|
position: relative;
|
|
3247
|
-
width: ${
|
|
3248
|
-
height: ${
|
|
3648
|
+
width: ${f.size};
|
|
3649
|
+
height: ${f.size};
|
|
3249
3650
|
border-radius: 50%;
|
|
3250
3651
|
display: flex;
|
|
3251
3652
|
align-items: center;
|
|
3252
3653
|
justify-content: center;
|
|
3253
|
-
background: ${
|
|
3654
|
+
background: ${e};
|
|
3254
3655
|
color: white;
|
|
3255
3656
|
font-weight: 600;
|
|
3256
|
-
font-size: ${
|
|
3657
|
+
font-size: ${f.font};
|
|
3257
3658
|
overflow: hidden;
|
|
3258
3659
|
}
|
|
3259
3660
|
|
|
@@ -3267,19 +3668,19 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3267
3668
|
position: absolute;
|
|
3268
3669
|
bottom: 0;
|
|
3269
3670
|
right: 0;
|
|
3270
|
-
width: ${
|
|
3271
|
-
height: ${
|
|
3671
|
+
width: ${f.status};
|
|
3672
|
+
height: ${f.status};
|
|
3272
3673
|
border-radius: 50%;
|
|
3273
3674
|
border: 2px solid white;
|
|
3274
|
-
background: ${
|
|
3675
|
+
background: ${o?u[o]||u.offline:"transparent"};
|
|
3275
3676
|
}
|
|
3276
3677
|
</style>
|
|
3277
3678
|
|
|
3278
3679
|
<div class="avatar" title="${n}">
|
|
3279
3680
|
${t?`<img src="${t}" alt="${n}" />`:this._getInitials(n)}
|
|
3280
|
-
${
|
|
3681
|
+
${o?'<span class="status"></span>':""}
|
|
3281
3682
|
</div>
|
|
3282
|
-
`}};
|
|
3683
|
+
`}};h("af-avatar",In);Gi=In});var Bl={};$(Bl,{default:()=>Qi,AfriProgress:()=>Pn});var Pn,Qi;var Dl=m(()=>{p();Pn=class Pn extends i{static get observedAttributes(){return["value","max","theme","size","label","animated"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=parseFloat(this.getAttribute("value"))||0,n=parseFloat(this.getAttribute("max"))||100,r=this.getAttribute("theme")||"tanzania",o=this.getAttribute("size")||"md",a=this.getAttribute("label"),l=this.hasAttribute("animated"),e=Math.min(100,Math.max(0,t/n*100)),b={tanzania:{bar:"#1EB53A",track:"#e9ecef"},maasai:{bar:"#FF0000",track:"#e9ecef"},ndebele:{bar:"#4169E1",track:"#e9ecef"},gold:{bar:"#FCD116",track:"#e9ecef"},gradient:{bar:"linear-gradient(90deg, #1EB53A 0%, #FCD116 50%, #00A3DD 100%)",track:"#e9ecef"}},f=b[r]||b.tanzania,u={sm:"6px",md:"10px",lg:"16px"},q=u[o]||u.md;this.shadowRoot.innerHTML=`
|
|
3283
3684
|
<style>
|
|
3284
3685
|
:host {
|
|
3285
3686
|
display: block;
|
|
@@ -3309,15 +3710,15 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3309
3710
|
.progress-track {
|
|
3310
3711
|
width: 100%;
|
|
3311
3712
|
height: ${q};
|
|
3312
|
-
background: ${
|
|
3713
|
+
background: ${f.track};
|
|
3313
3714
|
border-radius: 100px;
|
|
3314
3715
|
overflow: hidden;
|
|
3315
3716
|
}
|
|
3316
3717
|
|
|
3317
3718
|
.progress-bar {
|
|
3318
3719
|
height: 100%;
|
|
3319
|
-
width: ${
|
|
3320
|
-
background: ${
|
|
3720
|
+
width: ${e}%;
|
|
3721
|
+
background: ${f.bar};
|
|
3321
3722
|
border-radius: 100px;
|
|
3322
3723
|
transition: width 500ms ease-out;
|
|
3323
3724
|
${l?`
|
|
@@ -3346,7 +3747,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3346
3747
|
${`
|
|
3347
3748
|
<div class="progress-header">
|
|
3348
3749
|
<span class="progress-label">${a||""}</span>
|
|
3349
|
-
<span class="progress-value">${
|
|
3750
|
+
<span class="progress-value">${e.toFixed(0)}%</span>
|
|
3350
3751
|
</div>
|
|
3351
3752
|
`}
|
|
3352
3753
|
<div class="progress-track">
|
|
@@ -3356,7 +3757,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3356
3757
|
aria-valuemax="${n}"></div>
|
|
3357
3758
|
</div>
|
|
3358
3759
|
</div>
|
|
3359
|
-
`}};
|
|
3760
|
+
`}};h("af-progress",Pn);Qi=Pn});var El={};$(El,{default:()=>Fi,AfriLoader:()=>Tn});var Tn,Fi;var Wl=m(()=>{p();Tn=class Tn extends i{static get observedAttributes(){return["size","color","type"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("size")||"40",n=this.getAttribute("color")||"currentColor",r=this.getAttribute("type")||"spiral",o={spiral:`M25,25 m0,-20 a20,20 0 1,1 0,40 a20,20 0 1,1 0,-40
|
|
3360
3761
|
M25,25 m0,-15 a15,15 0 1,0 0,30 a15,15 0 1,0 0,-30`,sun:"M25,5 L25,45 M5,25 L45,25 M11,11 L39,39 M39,11 L11,39",diamond:"M25,5 L45,25 L25,45 L5,25 Z"};this.shadowRoot.innerHTML=`
|
|
3361
3762
|
<style>
|
|
3362
3763
|
:host {
|
|
@@ -3384,10 +3785,10 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3384
3785
|
</style>
|
|
3385
3786
|
<div class="loader">
|
|
3386
3787
|
<svg viewBox="0 0 50 50">
|
|
3387
|
-
${
|
|
3788
|
+
${r==="spiral"?`<path d="${o.spiral}" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:r==="sun"?`<path d="${o.sun}" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:`<path d="${o.diamond}" fill="none" stroke="currentColor" stroke-width="4" />`}
|
|
3388
3789
|
</svg>
|
|
3389
3790
|
</div>
|
|
3390
|
-
`}};
|
|
3791
|
+
`}};h("af-loader",Tn);Fi=Tn});var Ol={};$(Ol,{default:()=>Bi,AfriSkeleton:()=>Zn});var Zn,Bi;var Ul=m(()=>{p();Zn=class Zn extends i{static get observedAttributes(){return["variant","width","height","lines"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("variant")||"text",n=this.getAttribute("width")||"100%",r=this.getAttribute("height")||"auto",o=parseInt(this.getAttribute("lines"))||1,a={text:{height:"16px",borderRadius:"4px"},title:{height:"28px",borderRadius:"4px"},avatar:{width:"48px",height:"48px",borderRadius:"50%"},card:{height:"200px",borderRadius:"12px"},button:{height:"40px",borderRadius:"6px",width:"120px"}},l=a[t]||a.text;this.shadowRoot.innerHTML=`
|
|
3391
3792
|
<style>
|
|
3392
3793
|
:host {
|
|
3393
3794
|
display: block;
|
|
@@ -3422,33 +3823,33 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3422
3823
|
}
|
|
3423
3824
|
</style>
|
|
3424
3825
|
|
|
3425
|
-
${t==="text"||t==="title"?Array(
|
|
3426
|
-
`}};
|
|
3427
|
-
L${n*0.625},0 L${n*0.75},${
|
|
3428
|
-
L${n*0.9},${
|
|
3429
|
-
L${n*0.7},${
|
|
3430
|
-
L${n*0.5},${
|
|
3431
|
-
L${n*0.3},${
|
|
3432
|
-
L${n*0.1},${
|
|
3826
|
+
${t==="text"||t==="title"?Array(o).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${l.width||n}; height: ${l.height||r};"></div>`}
|
|
3827
|
+
`}};h("af-skeleton",Zn);Bi=Zn});var Nl={};$(Nl,{default:()=>Di,AfriDivider:()=>zn});var zn,Di;var yl=m(()=>{p();zn=class zn extends i{static get observedAttributes(){return["pattern","height","color","flip"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getPatternPath(t,n,r){switch(t||"zigzag"){case"zigzag":return`M0,${r} L${n/4},0 L${n/2},${r} L${n*0.75},0 L${n},${r} V${r+10} H0 Z`;case"waves":return`M0,${r/2} Q${n/4},0 ${n/2},${r/2} T${n},${r/2} V${r} H0 Z`;case"triangles":return`M0,${r} L${n/8},0 L${n/4},${r} L${n*0.375},0 L${n/2},${r}
|
|
3828
|
+
L${n*0.625},0 L${n*0.75},${r} L${n*0.875},0 L${n},${r} V${r+10} H0 Z`;case"diamonds":return`M0,0 H${n} V${r/2}
|
|
3829
|
+
L${n*0.9},${r} L${n*0.8},${r/2}
|
|
3830
|
+
L${n*0.7},${r} L${n*0.6},${r/2}
|
|
3831
|
+
L${n*0.5},${r} L${n*0.4},${r/2}
|
|
3832
|
+
L${n*0.3},${r} L${n*0.2},${r/2}
|
|
3833
|
+
L${n*0.1},${r} L0,${r/2} Z`;default:return`M0,0 H${n} V${r} H0 Z`}}render(){let t=this.getAttribute("pattern")||"zigzag",n=this.getAttribute("height")||"50",r=this.getAttribute("color")||"currentColor",o=this.hasAttribute("flip");this.shadowRoot.innerHTML=`
|
|
3433
3834
|
<style>
|
|
3434
3835
|
:host {
|
|
3435
3836
|
display: block;
|
|
3436
3837
|
line-height: 0;
|
|
3437
3838
|
width: 100%;
|
|
3438
3839
|
overflow: hidden;
|
|
3439
|
-
color: ${
|
|
3840
|
+
color: ${r};
|
|
3440
3841
|
}
|
|
3441
3842
|
svg {
|
|
3442
3843
|
display: block;
|
|
3443
3844
|
width: 100%;
|
|
3444
3845
|
height: ${n}px;
|
|
3445
|
-
${
|
|
3846
|
+
${o?"transform: rotate(180deg);":""}
|
|
3446
3847
|
}
|
|
3447
3848
|
</style>
|
|
3448
3849
|
<svg viewBox="0 0 100 ${n}" preserveAspectRatio="none">
|
|
3449
3850
|
<path d="${this._getPatternPath(t,100,parseInt(n))}" fill="currentColor" />
|
|
3450
3851
|
</svg>
|
|
3451
|
-
`}};
|
|
3852
|
+
`}};h("af-divider",zn);Di=zn});var Vl={};$(Vl,{default:()=>Ei,KangaCard:()=>to});var to,Ei;var Kl=m(()=>{p();Rt();to=class to extends i{static get observedAttributes(){return["theme","proverb","proverb-translation"]}constructor(){super();this.render()}connectedCallback(){this.loadStyles(),this.applyTheme()}attributeChangedCallback(t,n,r){if(n!==r)if(t==="theme")this.applyTheme();else this.render()}getThemeColors(){let t=this.getAttribute("theme")||"tanzania",n={tanzania:{primary:"#1EB53A",accent:"#FCD116",border:"#00A3DD",text:"#000000"},maasai:{primary:"#8B0000",accent:"#FF0000",border:"#000000",text:"#FFFFFF"},ndebele:{primary:"#4169E1",accent:"#FFD700",border:"#FF69B4",text:"#000000"}};return n[t]||n.tanzania}applyTheme(){let t=this.getThemeColors(),n=this.shadowRoot.querySelector(".pindo");if(n){let r=generateKangaBorder({primaryColor:t.primary,accentColor:t.accent});n.style.backgroundImage=`url("${r}")`,n.style.backgroundRepeat="repeat"}}render(){let t=this.getAttribute("proverb")||"",n=this.getAttribute("proverb-translation")||"",r=this.getThemeColors();this.shadowRoot.innerHTML=`
|
|
3452
3853
|
<style>
|
|
3453
3854
|
:host {
|
|
3454
3855
|
display: block;
|
|
@@ -3471,7 +3872,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3471
3872
|
/* Pindo - Decorative Border */
|
|
3472
3873
|
.pindo {
|
|
3473
3874
|
padding: var(--space-13, 13px);
|
|
3474
|
-
background-color: ${
|
|
3875
|
+
background-color: ${r.primary};
|
|
3475
3876
|
}
|
|
3476
3877
|
|
|
3477
3878
|
/* Mji - Central Content Area */
|
|
@@ -3483,8 +3884,8 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3483
3884
|
|
|
3484
3885
|
/* Jina - Proverb Inscription */
|
|
3485
3886
|
.jina {
|
|
3486
|
-
background-color: ${
|
|
3487
|
-
color: ${
|
|
3887
|
+
background-color: ${r.border};
|
|
3888
|
+
color: ${r.text};
|
|
3488
3889
|
padding: var(--space-8, 8px) var(--space-13, 13px);
|
|
3489
3890
|
text-align: center;
|
|
3490
3891
|
font-style: italic;
|
|
@@ -3511,7 +3912,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3511
3912
|
}
|
|
3512
3913
|
|
|
3513
3914
|
::slotted(h1), ::slotted(h2), ::slotted(h3) {
|
|
3514
|
-
color: ${
|
|
3915
|
+
color: ${r.primary};
|
|
3515
3916
|
margin-bottom: var(--space-8, 8px);
|
|
3516
3917
|
}
|
|
3517
3918
|
</style>
|
|
@@ -3530,7 +3931,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3530
3931
|
</div>
|
|
3531
3932
|
`:'<div class="jina"><slot name="proverb"></slot></div>'}
|
|
3532
3933
|
</article>
|
|
3533
|
-
`,this.applyTheme()}};
|
|
3934
|
+
`,this.applyTheme()}};h("af-kanga-card",to);Ei=to});var jl={};$(jl,{default:()=>Wi,CulturalCard:()=>no});var no,Wi;var Cl=m(()=>{p();Rt();no=class no extends i{static get observedAttributes(){return["culture","interactive"]}constructor(){super();this._cultures={maasai:{name:"Maasai",region:"Tanzania/Kenya",pattern:"generateShuka",colors:{primary:"#FF0000",accent:"#000000"}},hadzabe:{name:"Hadzabe",region:"Tanzania",pattern:"generateHadzabe",colors:{primary:"#8B4513",accent:"#CD853F"}},swahili:{name:"Swahili",region:"East Africa",pattern:"generateKangaBorder",colors:{primary:"#1EB53A",accent:"#FCD116"}},kitenge:{name:"Kitenge",region:"East Africa",pattern:"generateKitenge",colors:{primary:"#00A3DD",accent:"#1EB53A"}},tibeb:{name:"Tibeb",region:"Ethiopia",pattern:"generateTibeb",colors:{primary:"#009E60",accent:"#FCDD09"}},ashanti:{name:"Ashanti/Akan",region:"Ghana",pattern:"generateKente",colors:{primary:"#FFD700",accent:"#228B22"}},adinkra:{name:"Adinkra",region:"Ghana",pattern:"generateAdinkra",colors:{primary:"#000000",accent:"#CD853F"}},bogolan:{name:"Bogolan",region:"Mali",pattern:"generateBogolan",colors:{primary:"#3E2723",accent:"#D7CCC8"}},yoruba:{name:"Yoruba",region:"Nigeria",pattern:"generateAsoOke",colors:{primary:"#4B0082",accent:"#FFD700"}},ankara:{name:"Ankara",region:"West Africa",pattern:"generateAnkara",colors:{primary:"#FF6B00",accent:"#00A86B"}},kuba:{name:"Kuba Shoowa",region:"DRC",pattern:"generateKuba",colors:{primary:"#D2B48C",accent:"#3E2723"}},imigongo:{name:"Imigongo",region:"Rwanda",pattern:"generateImigongo",colors:{primary:"#000000",accent:"#B22222"}},ndebele:{name:"Ndebele",region:"South Africa",pattern:"generateNdebele",colors:{primary:"#4169E1",accent:"#FFD700"}},zulu:{name:"Zulu",region:"South Africa",pattern:"generateZulu",colors:{primary:"#FF0000",accent:"#000000"}},swazi:{name:"Swazi",region:"Eswatini",pattern:"generateSwazi",colors:{primary:"#3E5EB9",accent:"#FECD00"}},xhosa:{name:"Xhosa",region:"South Africa",pattern:"generateXhosa",colors:{primary:"#00A86B",accent:"#1a1a2e"}}},this.render()}connectedCallback(){this._setupInteraction()}_setupInteraction(){if(!this.hasAttribute("interactive"))return;this.shadowRoot.querySelector(".culture-selector")?.addEventListener("change",(n)=>{this.setAttribute("culture",n.target.value),this.emit("af-culture-change",{culture:n.target.value})})}attributeChangedCallback(){this.render(),this._setupInteraction()}render(){let t=this.getAttribute("culture")||"maasai",n=this.hasAttribute("interactive"),r=this._cultures[t]||this._cultures.maasai,o=Mt[r.pattern],a=o?o():"";this.shadowRoot.innerHTML=`
|
|
3534
3935
|
<style>
|
|
3535
3936
|
:host {
|
|
3536
3937
|
display: block;
|
|
@@ -3572,7 +3973,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3572
3973
|
position: absolute;
|
|
3573
3974
|
bottom: 10px;
|
|
3574
3975
|
left: 10px;
|
|
3575
|
-
background: ${
|
|
3976
|
+
background: ${r.colors.primary};
|
|
3576
3977
|
color: white;
|
|
3577
3978
|
padding: 4px 12px;
|
|
3578
3979
|
border-radius: 20px;
|
|
@@ -3607,7 +4008,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3607
4008
|
.card-title h3 {
|
|
3608
4009
|
margin: 0;
|
|
3609
4010
|
font-size: 18px;
|
|
3610
|
-
color: ${
|
|
4011
|
+
color: ${r.colors.primary};
|
|
3611
4012
|
}
|
|
3612
4013
|
|
|
3613
4014
|
.culture-icon {
|
|
@@ -3616,7 +4017,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3616
4017
|
border-radius: 50%;
|
|
3617
4018
|
background-image: url("${a}");
|
|
3618
4019
|
background-size: cover;
|
|
3619
|
-
border: 2px solid ${
|
|
4020
|
+
border: 2px solid ${r.colors.accent};
|
|
3620
4021
|
}
|
|
3621
4022
|
|
|
3622
4023
|
.card-content {
|
|
@@ -3628,7 +4029,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3628
4029
|
width: 100%;
|
|
3629
4030
|
padding: 10px;
|
|
3630
4031
|
margin-top: 15px;
|
|
3631
|
-
border: 2px solid ${
|
|
4032
|
+
border: 2px solid ${r.colors.primary};
|
|
3632
4033
|
border-radius: 6px;
|
|
3633
4034
|
font-family: inherit;
|
|
3634
4035
|
font-size: 14px;
|
|
@@ -3638,7 +4039,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3638
4039
|
|
|
3639
4040
|
.culture-selector:focus {
|
|
3640
4041
|
outline: none;
|
|
3641
|
-
box-shadow: 0 0 0 3px ${
|
|
4042
|
+
box-shadow: 0 0 0 3px ${r.colors.primary}30;
|
|
3642
4043
|
}
|
|
3643
4044
|
|
|
3644
4045
|
select option {
|
|
@@ -3654,13 +4055,13 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3654
4055
|
<article class="cultural-card">
|
|
3655
4056
|
<div class="pattern-header">
|
|
3656
4057
|
<div class="pattern-overlay"></div>
|
|
3657
|
-
<span class="culture-badge">${
|
|
3658
|
-
<span class="region-badge">\uD83D\uDCCD ${
|
|
4058
|
+
<span class="culture-badge">${r.name}</span>
|
|
4059
|
+
<span class="region-badge">\uD83D\uDCCD ${r.region}</span>
|
|
3659
4060
|
</div>
|
|
3660
4061
|
<div class="card-body">
|
|
3661
4062
|
<div class="card-title">
|
|
3662
4063
|
<div class="culture-icon"></div>
|
|
3663
|
-
<h3>${
|
|
4064
|
+
<h3>${r.name} Pattern</h3>
|
|
3664
4065
|
</div>
|
|
3665
4066
|
<div class="card-content">
|
|
3666
4067
|
<slot></slot>
|
|
@@ -3695,7 +4096,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3695
4096
|
`:""}
|
|
3696
4097
|
</div>
|
|
3697
4098
|
</article>
|
|
3698
|
-
`}};
|
|
4099
|
+
`}};h("af-cultural-card",no);Wi=no});var Il={};$(Il,{default:()=>Oi,PatternShowcase:()=>oo});var oo,Oi;var Pl=m(()=>{p();Rt();oo=class oo extends i{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:co,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:go,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:so,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:mo,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:_o,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:vo,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:po,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:wo,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:uo,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:Ro,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:$o,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:xo,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:Ao,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:Mo,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:ko,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:qo,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:Lo,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:Ho,meaning:"Dignity, Coming of age"}],this.render()}connectedCallback(){this._setupHovers()}_setupHovers(){this.shadowRoot.querySelectorAll(".pattern-item").forEach((t)=>{t.addEventListener("click",()=>{let n=t.dataset.key,r=this._allPatterns.find((o)=>o.key===n);if(r)this.emit("af-pattern-select",{pattern:r})})})}attributeChangedCallback(){this.render(),this._setupHovers()}render(){let t=this.getAttribute("region")||"all",n=this.getAttribute("size")||"md",r=t==="all"?this._allPatterns:this._allPatterns.filter((l)=>l.region===t),o={sm:80,md:120,lg:160},a=o[n]||o.md;this.shadowRoot.innerHTML=`
|
|
3699
4100
|
<style>
|
|
3700
4101
|
:host {
|
|
3701
4102
|
display: block;
|
|
@@ -3815,7 +4216,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3815
4216
|
</div>
|
|
3816
4217
|
|
|
3817
4218
|
<div class="pattern-grid">
|
|
3818
|
-
${
|
|
4219
|
+
${r.map((l)=>`
|
|
3819
4220
|
<div class="pattern-item" data-key="${l.key}">
|
|
3820
4221
|
<div class="pattern-preview" style="background-image: url('${l.fn()}')"></div>
|
|
3821
4222
|
<div class="pattern-info">
|
|
@@ -3828,7 +4229,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3828
4229
|
`).join("")}
|
|
3829
4230
|
</div>
|
|
3830
4231
|
</div>
|
|
3831
|
-
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((l)=>{l.addEventListener("click",()=>{this.setAttribute("region",l.dataset.region)})})}};
|
|
4232
|
+
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((l)=>{l.addEventListener("click",()=>{this.setAttribute("region",l.dataset.region)})})}};h("af-pattern-showcase",oo);Oi=oo});var Tl={};$(Tl,{AfriLanguageSwitcher:()=>Xr});var Xr;var Zl=m(()=>{p();Xr=class Xr extends i{static get observedAttributes(){return["current"]}render(){let t=[{code:"en",name:"English"},{code:"sw",name:"Kiswahili"},{code:"fr",name:"Français"},{code:"ar",name:"العربية",dir:"rtl"},{code:"am",name:"አማርኛ"},{code:"yo",name:"Yorùbá"}],n=this.getAttribute("current")||"en",r=t.find((o)=>o.code===n)||t[0];this.shadowRoot.innerHTML=c`
|
|
3832
4233
|
<style>
|
|
3833
4234
|
:host { display: inline-block; position: relative; font-family: var(--font-body); }
|
|
3834
4235
|
.switcher-btn {
|
|
@@ -3869,17 +4270,17 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3869
4270
|
|
|
3870
4271
|
<button class="switcher-btn">
|
|
3871
4272
|
<span>🌍</span>
|
|
3872
|
-
<span>${
|
|
4273
|
+
<span>${r.name}</span>
|
|
3873
4274
|
</button>
|
|
3874
4275
|
|
|
3875
4276
|
<div class="dropdown">
|
|
3876
|
-
${t.map((
|
|
3877
|
-
<div class="lang-option" data-code="${
|
|
3878
|
-
${
|
|
4277
|
+
${t.map((o)=>c`
|
|
4278
|
+
<div class="lang-option" data-code="${o.code}" dir="${o.dir||"ltr"}">
|
|
4279
|
+
${o.name}
|
|
3879
4280
|
</div>
|
|
3880
4281
|
`)}
|
|
3881
4282
|
</div>
|
|
3882
|
-
`,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((
|
|
4283
|
+
`,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((o)=>{o.onclick=()=>{let a=o.dataset.code;if(this.setAttribute("current",a),this.removeAttribute("open"),this.emit("lang-change",{code:a}),a==="ar")document.documentElement.dir="rtl";else document.documentElement.dir="ltr"}})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}};h("af-language-switcher",Xr)});var zl={};$(zl,{AfriAuth:()=>Yr});var Yr;var te=m(()=>{p();Yr=class Yr extends i{constructor(){super();this.mode="login"}connectedCallback(){this.render(),this.setupEvents()}setupEvents(){let t=this.shadowRoot.querySelector("form"),n=this.shadowRoot.querySelector(".toggle-mode");if(n)n.addEventListener("click",(r)=>{r.preventDefault(),this.mode=this.mode==="login"?"register":"login",this.render(),this.setupEvents()});if(t)t.addEventListener("submit",async(r)=>{r.preventDefault();let o=this.shadowRoot.querySelector("#email").value,a=this.shadowRoot.querySelector("#password").value,l=this.shadowRoot.querySelector(".feedback");l.textContent="Processing...";try{let b=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:o,password:a})})).json();if(b.error)l.textContent=b.error,l.style.color="#ef4444";else l.textContent="Success! Redirecting...",l.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch(e){l.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
|
|
3883
4284
|
<style>
|
|
3884
4285
|
:host {
|
|
3885
4286
|
display: block;
|
|
@@ -3977,7 +4378,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
3977
4378
|
<span class="toggle-mode">${t?"Create an account":"Sign in"}</span>
|
|
3978
4379
|
</div>
|
|
3979
4380
|
</div>
|
|
3980
|
-
`}};
|
|
4381
|
+
`}};h("af-auth",Yr)});var ne={};$(ne,{default:()=>Ui});var Jr,Ui;var oe=m(()=>{p();Jr=class Jr extends i{constructor(){super();this.currentTheme="dark"}connectedCallback(){this.loadStyles();let t=localStorage.getItem("africode-theme");if(t)this.currentTheme=t,document.documentElement.setAttribute("data-theme",t);else{let n=window.matchMedia("(prefers-color-scheme: light)").matches;this.currentTheme=n?"light":"dark",document.documentElement.setAttribute("data-theme",this.currentTheme)}this.render()}toggleTheme(){this.currentTheme=this.currentTheme==="dark"?"light":"dark",document.documentElement.setAttribute("data-theme",this.currentTheme),localStorage.setItem("africode-theme",this.currentTheme),window.dispatchEvent(new CustomEvent("theme-changed",{detail:{theme:this.currentTheme}})),this.render()}render(){let t=this.currentTheme==="dark";this.shadowRoot.innerHTML=c`
|
|
3981
4382
|
<style>
|
|
3982
4383
|
.toggle-btn {
|
|
3983
4384
|
background: var(--bg-surface-elevated, var(--afri-obsidian));
|
|
@@ -4006,13 +4407,13 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
4006
4407
|
<span class="icon">\${isDark ? '🌙' : '☀️'}</span>
|
|
4007
4408
|
<span>\${isDark ? 'Dark Mode' : 'Light Mode'}</span>
|
|
4008
4409
|
</button>
|
|
4009
|
-
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};
|
|
4410
|
+
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};h("af-theme-toggle",Jr);Ui=Jr});rt();Ht();Rt();var So={};$(So,{transitionPage:()=>Dr,default:()=>Ae,animateStaggered:()=>Br,Easing:()=>vn});var vn={DrumBeat:"cubic-bezier(0.1, 0.9, 0.2, 1.0)",KoraPluck:"cubic-bezier(0.34, 1.56, 0.64, 1)",RiverFlow:"cubic-bezier(0.4, 0.0, 0.2, 1)"};function Br(t,{delay:n=50,duration:r=600,easing:o=vn.DrumBeat,y:a=20,scale:l=0.95}={}){let e=typeof t==="string"?document.querySelectorAll(t):t;if(!e||e.length===0)return;let b=new IntersectionObserver((f)=>{f.forEach((u,q)=>{if(u.isIntersecting){let R=Math.random()*10,M=q*n+R,Y=u.target;Y.animate([{opacity:0,transform:`translateY(${a}px) scale(${l})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:r,delay:M,easing:o,fill:"forwards"}),b.unobserve(Y),Y.style.opacity="1"}})},{threshold:0.1});e.forEach((f)=>{f.style.opacity="0",b.observe(f)})}function Dr(t){document.body.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.98)"}],{duration:200,easing:"ease-in"}).onfinish=()=>{t(),document.body.animate([{opacity:0,transform:"scale(1.02)"},{opacity:1,transform:"scale(1)"}],{duration:400,easing:vn.DrumBeat})}}var Ae={Easing:vn,animateStaggered:Br,transitionPage:Dr};function Er(t){if(typeof window>"u")return;if(!("IntersectionObserver"in window)){Object.values(t).forEach((r)=>r());return}let n=new IntersectionObserver((r)=>{r.forEach((o)=>{if(o.isIntersecting){let a=o.target.tagName.toLowerCase(),l=t[a];if(l)console.log(`\uD83C\uDFDD️ Hydrating Island: <${a}>`),l().then(()=>{delete t[a]}).catch((e)=>console.error(`Failed to hydrate <${a}>`,e));n.unobserve(o.target)}})},{rootMargin:"50px 0px"});Object.keys(t).forEach((r)=>{document.querySelectorAll(r).forEach((o)=>n.observe(o))})}qn();Eo();function Wo(t){if(!t)return{};let n={};return t.split(";").forEach((r)=>{let[o,a]=r.trim().split("=");if(o&&a)n[decodeURIComponent(o)]=decodeURIComponent(a)}),n}function ha(){return crypto.randomUUID()}function da(t){let r=(t.headers||{}).get("cookie");return Wo(r)[Oo]||null}var Oo="session_id";class ca{constructor(){this.sessions=new Map}ensure(t){if(!this.sessions.has(t))this.sessions.set(t,{data:{counter:{value:0}},meta:{createdAt:new Date,lastSeenAt:new Date}});return this.sessions.get(t)}touch(t){let n=this.ensure(t);return n.meta.lastSeenAt=new Date,n}has(t){return this.sessions.has(t)}get(t){return this.touch(t).data}set(t,n,r){let o=this.get(t),a=n.split("/"),l=o;while(a.length>1){let e=a.shift();if(!l[e]||typeof l[e]!=="object")l[e]={};l=l[e]}return l[a[0]]=r,r}delete(t){return this.sessions.delete(t)}clear(){this.sessions.clear()}}var j=new ca;var ga={incrementCounter(t){let o=(j.get(t).counter?.value||0)+1;return j.set(t,"counter/value",o),o},resetCounter(t){return j.set(t,"counter/value",0),0},getCounter(t){return j.get(t).counter?.value||0}};class U extends Error{constructor(t,n="INTERNAL_ERROR",r={},o=500){super(t);this.name="AfriCodeError",this.code=n,this.context=r,this.statusCode=o,this.timestamp=new Date().toISOString()}toJSON(){return{error:{code:this.code,message:this.message,...this.context.field?{field:this.context.field}:{},...Object.keys(this.context).length>0?{context:this.context}:{}}}}toResponse(){return new Response(JSON.stringify(this.toJSON()),{status:this.statusCode,headers:{"Content-Type":"application/json"}})}}class Ln extends U{constructor(t,n=null,r={}){super(t,"VALIDATION_FAILED",{field:n,...r},422);this.name="ValidationError"}static fromZodError(t){let n=t.issues[0],r=n?.path?.join(".")||null,o=n?.message||"Validation failed";return new Ln(o,r,{issues:t.issues.map((a)=>({field:a.path.join("."),message:a.message,code:a.code}))})}}class Uo extends U{constructor(t,n){let r=n===""?"an empty string":`"${n}"`;super(`Field '${t}' must be a valid URL or null. Got ${r}.`,"INVALID_URL",{field:t,received:n},422);this.name="InvalidUrlError"}}class Et extends U{constructor(t,n="SECURITY_VIOLATION",r={},o=403){super(t,n,r,o);this.name="SecurityError"}}class No extends Et{constructor(t="missing"){let n={missing:"CSRF token missing. Include the token in both the cookie and the X-CSRF-Token header.",mismatch:"CSRF token mismatch. The header token does not match the cookie token."};super(n[t]||n.missing,"CSRF_FAILURE",{reason:t});this.name="CsrfError"}}class yo extends Et{constructor(t,n="Too many requests. Please try again later."){super(n,"RATE_LIMIT_EXCEEDED",{retryAfter:t},429);this.name="RateLimitError"}}class Vo extends U{constructor(t,n=null,r={}){super(t,"DATABASE_ERROR",{operation:n,...r},500);this.name="DatabaseError"}}class Ko extends U{constructor(t,n,r={}){super(`Component Error in <${n}>: ${t}`,"COMPONENT_ERROR",{componentName:n,...r},500);this.name="ComponentError"}}class jo{constructor(){this.middlewares=[],this.isRunning=!1}use(t,n=null){if(typeof t!=="function")throw new U("Middleware must be a function","MIDDLEWARE_INVALID",{},500);let r=async(o)=>{let a=Date.now();try{Lt("debug",`[Middleware] Running ${n||"anonymous"} middleware`);let l=await t(o),e=Date.now()-a;return Lt("debug",`[Middleware] ${n||"anonymous"} completed in ${e}ms`),l}catch(l){throw Lt("error",`[Middleware] Error in ${n||"anonymous"}: ${l.message}`),new U(`Middleware error in ${n||"anonymous"}: ${l.message}`,"MIDDLEWARE_EXECUTION_ERROR",{cause:l},500)}};return this.middlewareMeta=this.middlewareMeta||new WeakMap,this.middlewareMeta.set(r,{original:t,name:n||t.name||"anonymous"}),this.middlewares.push(r),this}async run(t){if(this.isRunning)throw new MiddlewareError("Middleware pipeline is already running");this.isRunning=!0;try{for(let n of this.middlewares){let r=await n(t);if(r instanceof Response)return r;if(r?.response)return r.response;if(r?.context)Object.assign(t,r.context)}return null}finally{this.isRunning=!1}}count(){return this.middlewares.length}clear(){return this.middlewares=[],this}}function sa(){return async(t)=>{return Lt("log",`[AfriCode] ${t.req.method} ${t.pathname}`),{}}}function ma(t={}){return async(n)=>{let{protectedPaths:r=[],authorize:o=()=>!1,unauthorizedResponse:a=()=>new Response("Unauthorized",{status:401})}=t;if(r.some((e)=>n.pathname.startsWith(e))){if(!await o(n))return{response:a(n)}}return{}}}p();p();class Co extends i{static get observedAttributes(){return["theme","fallback-message"]}constructor(){super();this._hasError=!1,this._errorDetail=null,this.render()}connectedCallback(){this.addEventListener("af-component-error",this._handleError.bind(this))}disconnectedCallback(){this.removeEventListener("af-component-error",this._handleError.bind(this))}_handleError(t){t.stopPropagation(),this._hasError=!0,this._errorDetail=t.detail,console.warn("[AfriCode Boundary] Caught error:",this._errorDetail),this.render()}reset(){this._hasError=!1,this._errorDetail=null,this.render()}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.getAttribute("fallback-message")||"A part of this page failed to load.",r={tanzania:{bg:"#FFF9E6",border:"#FCD116",text:"#5A4A00"},maasai:{bg:"#FFEEEE",border:"#FF0000",text:"#8B0000"},ndebele:{bg:"#EBF0FF",border:"#4169E1",text:"#002B5C"},ocean:{bg:"#E6FAFF",border:"#00A3DD",text:"#004A66"}},o=r[t]||r.tanzania;if(this._hasError){this.shadowRoot.innerHTML=`
|
|
4010
4411
|
<style>
|
|
4011
4412
|
:host { display: block; width: 100%; font-family: 'Inter', system-ui, sans-serif; }
|
|
4012
4413
|
.boundary-error {
|
|
4013
|
-
background: ${
|
|
4014
|
-
border-left: 4px solid ${
|
|
4015
|
-
color: ${
|
|
4414
|
+
background: ${o.bg};
|
|
4415
|
+
border-left: 4px solid ${o.border};
|
|
4416
|
+
color: ${o.text};
|
|
4016
4417
|
padding: 16px 20px;
|
|
4017
4418
|
border-radius: 4px;
|
|
4018
4419
|
margin: 12px 0;
|
|
@@ -4045,8 +4446,8 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
4045
4446
|
}
|
|
4046
4447
|
button {
|
|
4047
4448
|
background: transparent;
|
|
4048
|
-
border: 1px solid ${
|
|
4049
|
-
color: ${
|
|
4449
|
+
border: 1px solid ${o.border};
|
|
4450
|
+
color: ${o.text};
|
|
4050
4451
|
padding: 6px 12px;
|
|
4051
4452
|
border-radius: 4px;
|
|
4052
4453
|
cursor: pointer;
|
|
@@ -4077,7 +4478,7 @@ var Wl=Object.defineProperty;var Ul=(t)=>t;function Vl(t,n){this[t]=Ul.bind(null
|
|
|
4077
4478
|
`,this.shadowRoot.getElementById("retry-btn").addEventListener("click",()=>{this.reset()});return}this.shadowRoot.innerHTML=`
|
|
4078
4479
|
<style>:host { display: block; }</style>
|
|
4079
4480
|
<slot></slot>
|
|
4080
|
-
`}}f("af-error-boundary",Vo);No();Ko();jo();yo();Co();Io();Po();To();Zo();zo();tr();nr();or();ar();lr();br();er();ir();hr();fr();cr();dr();gr();vr();pr();mr();var Tn={"af-button":()=>Promise.resolve().then(() => (Xa(),Ra)),"af-card":()=>Promise.resolve().then(() => (Ja(),Qa)),"af-navbar":()=>Promise.resolve().then(() => (Fa(),Ga)),"af-input":()=>Promise.resolve().then(() => (Ea(),Ba)),"af-alert":()=>Promise.resolve().then(() => (Oa(),Da)),"af-grid":()=>Promise.resolve().then(() => (Ua(),Wa)),"af-section":()=>Promise.resolve().then(() => (Na(),Va)),"af-icon":()=>Promise.resolve().then(() => (ja(),Ka)),"af-ui-button":()=>Promise.resolve().then(() => (No(),la)),"af-ui-card":()=>Promise.resolve().then(() => (Ko(),ba)),"af-ui-input":()=>Promise.resolve().then(() => (jo(),ea)),"af-ui-badge":()=>Promise.resolve().then(() => (yo(),ia)),"af-ui-switch":()=>Promise.resolve().then(() => (Co(),ha)),"af-ui-select":()=>Promise.resolve().then(() => (Io(),fa)),"af-ui-textarea":()=>Promise.resolve().then(() => (Po(),ca)),"af-ui-chip":()=>Promise.resolve().then(() => (To(),da)),"af-ui-tag":()=>Promise.resolve().then(() => (Zo(),ga)),"af-ui-avatar":()=>Promise.resolve().then(() => (zo(),va)),"af-ui-progress-ring":()=>Promise.resolve().then(() => (tr(),pa)),"af-ui-tooltip":()=>Promise.resolve().then(() => (nr(),ma)),"af-ui-popover":()=>Promise.resolve().then(() => (or(),$a)),"af-ui-tabs":()=>Promise.resolve().then(() => (ar(),wa)),"af-ui-table":()=>Promise.resolve().then(() => (lr(),ua)),"af-ui-stat":()=>Promise.resolve().then(() => (br(),sa)),"af-footer":()=>Promise.resolve().then(() => (er(),xa)),"af-breadcrumb":()=>Promise.resolve().then(() => (ir(),Aa)),"af-feature-grid":()=>Promise.resolve().then(() => (hr(),_a)),"af-pricing-card":()=>Promise.resolve().then(() => (fr(),ka)),"af-testimonial":()=>Promise.resolve().then(() => (cr(),qa)),"af-dashboard-shell":()=>Promise.resolve().then(() => (dr(),Ha)),"af-dashboard-topbar":()=>Promise.resolve().then(() => (gr(),La)),"af-dashboard-card":()=>Promise.resolve().then(() => (vr(),Ma)),"af-dashboard-metric":()=>Promise.resolve().then(() => (pr(),Ya)),"af-dashboard-activity-list":()=>Promise.resolve().then(() => (mr(),Sa)),"af-accordion":()=>Promise.resolve().then(() => (Ca(),ya)),"af-hero":()=>Promise.resolve().then(() => (Pa(),Ia)),"af-table":()=>Promise.resolve().then(() => (Za(),Ta)),"af-modal":()=>Promise.resolve().then(() => (tl(),za)),"af-tabs":()=>Promise.resolve().then(() => (ol(),nl)),"af-sidebar":()=>Promise.resolve().then(() => (al(),rl)),"af-dropdown":()=>Promise.resolve().then(() => (bl(),ll)),"af-select":()=>Promise.resolve().then(() => (il(),el)),"af-form":()=>Promise.resolve().then(() => (fl(),hl)),"af-tooltip":()=>Promise.resolve().then(() => (dl(),cl)),"af-toast":()=>Promise.resolve().then(() => (vl(),gl)),"af-badge":()=>Promise.resolve().then(() => (ml(),pl)),"af-avatar":()=>Promise.resolve().then(() => (wl(),$l)),"af-progress":()=>Promise.resolve().then(() => (sl(),ul)),"af-loader":()=>Promise.resolve().then(() => (Al(),xl)),"af-skeleton":()=>Promise.resolve().then(() => (kl(),_l)),"af-divider":()=>Promise.resolve().then(() => (Hl(),ql)),"af-kanga-card":()=>Promise.resolve().then(() => (Ml(),Ll)),"af-cultural-card":()=>Promise.resolve().then(() => (Sl(),Yl)),"af-pattern-showcase":()=>Promise.resolve().then(() => (Xl(),Rl)),"af-language-switcher":()=>Promise.resolve().then(() => (Jl(),Ql)),"af-auth":()=>Promise.resolve().then(() => (Fl(),Gl)),"af-theme-toggle":()=>Promise.resolve().then(() => (El(),Bl))};var ot={COMPONENT:"component",FORM:"form",LIST:"list",CARD:"card",MODAL:"modal",TOAST:"toast",PROGRESS:"progress"},ef={component:{type:"object",properties:{id:{type:"string"},type:{type:"string",enum:Object.values(ot)},props:{type:"object"},children:{type:"array",items:{$ref:"#"}}},required:["id","type"]}};function Dl(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Zn(t){if(Array.isArray(t))return t.map(Zn).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")return Dl(t);if(typeof t!=="object")return"";let n=t.tag||t.tagName;if(!n)return"";let o=t.props||{},r=Object.entries(o).filter(([,l])=>l!==null&&l!==void 0&&l!==!1).map(([l,b])=>b===!0?l:`${l}="${Dl(b)}"`).join(" "),a=Zn(t.children??t.content??"");return`<${n}${r?` ${r}`:""}>${a}</${n}>`}function wi(t){return/<\s*script\b|on\w+\s*=|javascript:/i.test(String(t))}class zn{constructor(t){this.root=t,this.components=new Map}render(t){if(!t||!t.type)throw Error("Invalid A2UI message");if(t.html!==void 0){if(wi(t.html))throw Error("Unsafe HTML is not allowed in A2UI render messages");throw Error("Raw HTML payloads are not supported in A2UI render messages")}let n=Array.isArray(t.components)?t.components.map(Zn).join(""):Zn(t.component||t);if(t.id)this.components.set(t.id,{id:t.id,type:t.type,props:t.props||{},children:t.children||t.components||[]});if(this.root&&typeof this.root.appendChild==="function"&&typeof document<"u"&&n){let r=document.createElement("div");r.innerHTML=n;while(r.firstChild)this.root.appendChild(r.firstChild)}return n}createElement(t){let{type:n,props:o={},children:r=[]}=t,a;switch(n){case ot.COMPONENT:a=this.createCustomComponent(o);break;case ot.FORM:a=this.createForm(o);break;case ot.LIST:a=this.createList(o);break;case ot.CARD:a=this.createCard(o);break;case ot.MODAL:a=this.createModal(o);break;case ot.TOAST:a=this.createToast(o);break;case ot.PROGRESS:a=this.createProgress(o);break;default:throw Error(`Unknown A2UI component type: ${n}`)}if(r.length>0)for(let l of r){let b=this.createElement(l);a.appendChild(b)}return a}createCustomComponent({tag:t,...n}){let o=document.createElement(t||"div");return Object.assign(o,n),o}createForm({fields:t=[],onSubmit:n}){let o=document.createElement("af-form");for(let r of t){let a=document.createElement("af-input");a.setAttribute("name",r.name),a.setAttribute("placeholder",r.placeholder||""),a.setAttribute("type",r.type||"text"),o.appendChild(a)}if(n)o.addEventListener("submit",n);return o}createList({items:t=[]}){let n=document.createElement("af-grid");for(let o of t){let r=this.createCard(o);n.appendChild(r)}return n}createCard({title:t,content:n,image:o}){let r=document.createElement("af-card");if(t){let a=document.createElement("h3");a.textContent=t,r.appendChild(a)}if(n){let a=document.createElement("p");a.textContent=n,r.appendChild(a)}if(o){let a=document.createElement("img");a.src=o,a.alt=t||"Card image",r.appendChild(a)}return r}createModal({title:t,content:n,actions:o=[]}){let r=document.createElement("af-modal");if(r.setAttribute("open",""),t){let l=document.createElement("h2");l.slot="header",l.textContent=t,r.appendChild(l)}if(n){let l=document.createElement("p");l.textContent=n,r.appendChild(l)}let a=document.createElement("div");a.slot="footer";for(let l of o){let b=document.createElement("af-button");if(b.textContent=l.label,l.primary)b.setAttribute("variant","primary");if(l.onClick)b.addEventListener("click",l.onClick);a.appendChild(b)}return r.appendChild(a),r}createToast({message:t,type:n="info",duration:o=3000}){let r=document.createElement("af-toast");return r.setAttribute("type",n),r.textContent=t,setTimeout(()=>{r.remove()},o),r}createProgress({value:t=0,max:n=100,label:o}){let r=document.createElement("af-progress");if(r.setAttribute("value",t),r.setAttribute("max",n),o)r.setAttribute("label",o);return r}update(t,n){let o=this.components.get(t);if(o)Object.assign(o,n)}remove(t){let n=this.components.get(t);if(n)n.remove(),this.components.delete(t)}}class to{constructor(t){this.renderer=t,this.messageQueue=[],this.messageHandlers=[],this.isProcessing=!1}onMessage(t){if(typeof t==="function")this.messageHandlers.push(t)}sendMessage(t){return this.processMessage(t)}processMessage(t){if(typeof t==="string")try{t=JSON.parse(t)}catch{return console.warn("Invalid A2UI message format:",t),null}if(t?.type==="render"&&this.renderer)return this.renderer.render(t);for(let n of this.messageHandlers)n(t);return t}processQueue(){if(this.isProcessing||this.messageQueue.length===0)return;this.isProcessing=!0;while(this.messageQueue.length>0){let t=this.messageQueue.shift();try{this.renderer.render(t)}catch(n){console.error("A2UI render error:",n)}}this.isProcessing=!1}async handleStream(t){let n=t.getReader(),o=new TextDecoder,r="";while(!0){let{done:a,value:l}=await n.read();if(a)break;r+=o.decode(l,{stream:!0});let b=r.split(`
|
|
4081
|
-
`);
|
|
4481
|
+
`}}h("af-error-boundary",Co);Io();Po();To();Zo();zo();tr();nr();or();rr();ar();lr();er();br();fr();hr();dr();cr();gr();sr();mr();vr();pr();ur();$r();wr();xr();Ar();_r();Lr();Hr();Mr();var ro={"af-button":()=>Promise.resolve().then(() => (Pa(),Ia)),"af-card":()=>Promise.resolve().then(() => (Za(),Ta)),"af-navbar":()=>Promise.resolve().then(() => (tl(),za)),"af-input":()=>Promise.resolve().then(() => (ol(),nl)),"af-alert":()=>Promise.resolve().then(() => (al(),rl)),"af-grid":()=>Promise.resolve().then(() => (el(),ll)),"af-section":()=>Promise.resolve().then(() => (il(),bl)),"af-icon":()=>Promise.resolve().then(() => (hl(),fl)),"af-ui-button":()=>Promise.resolve().then(() => (Io(),pa)),"af-ui-card":()=>Promise.resolve().then(() => (Po(),ua)),"af-ui-input":()=>Promise.resolve().then(() => (To(),$a)),"af-ui-badge":()=>Promise.resolve().then(() => (Zo(),wa)),"af-ui-switch":()=>Promise.resolve().then(() => (zo(),xa)),"af-ui-select":()=>Promise.resolve().then(() => (tr(),Aa)),"af-ui-textarea":()=>Promise.resolve().then(() => (nr(),_a)),"af-ui-chip":()=>Promise.resolve().then(() => (or(),ka)),"af-ui-tag":()=>Promise.resolve().then(() => (rr(),qa)),"af-ui-avatar":()=>Promise.resolve().then(() => (ar(),La)),"af-ui-progress-ring":()=>Promise.resolve().then(() => (lr(),Ha)),"af-ui-tooltip":()=>Promise.resolve().then(() => (er(),Ma)),"af-ui-popover":()=>Promise.resolve().then(() => (br(),Ra)),"af-ui-tabs":()=>Promise.resolve().then(() => (fr(),Sa)),"af-ui-table":()=>Promise.resolve().then(() => (hr(),Xa)),"af-ui-stat":()=>Promise.resolve().then(() => (dr(),Ya)),"af-footer":()=>Promise.resolve().then(() => (cr(),Ja)),"af-breadcrumb":()=>Promise.resolve().then(() => (gr(),Ga)),"af-feature-grid":()=>Promise.resolve().then(() => (sr(),Qa)),"af-pricing-card":()=>Promise.resolve().then(() => (mr(),Fa)),"af-testimonial":()=>Promise.resolve().then(() => (vr(),Ba)),"af-dashboard-shell":()=>Promise.resolve().then(() => (pr(),Da)),"af-dashboard-topbar":()=>Promise.resolve().then(() => (ur(),Ea)),"af-dashboard-card":()=>Promise.resolve().then(() => ($r(),Wa)),"af-dashboard-metric":()=>Promise.resolve().then(() => (wr(),Oa)),"af-dashboard-activity-list":()=>Promise.resolve().then(() => (xr(),Ua)),"af-accordion":()=>Promise.resolve().then(() => (cl(),dl)),"af-hero":()=>Promise.resolve().then(() => (sl(),gl)),"af-table":()=>Promise.resolve().then(() => (vl(),ml)),"af-modal":()=>Promise.resolve().then(() => (ul(),pl)),"af-tabs":()=>Promise.resolve().then(() => (wl(),$l)),"af-sidebar":()=>Promise.resolve().then(() => (Al(),xl)),"af-dropdown":()=>Promise.resolve().then(() => (kl(),_l)),"af-select":()=>Promise.resolve().then(() => (Ll(),ql)),"af-form":()=>Promise.resolve().then(() => (Ml(),Hl)),"af-tooltip":()=>Promise.resolve().then(() => (Sl(),Rl)),"af-toast":()=>Promise.resolve().then(() => (Yl(),Xl)),"af-badge":()=>Promise.resolve().then(() => (Gl(),Jl)),"af-avatar":()=>Promise.resolve().then(() => (Fl(),Ql)),"af-progress":()=>Promise.resolve().then(() => (Dl(),Bl)),"af-loader":()=>Promise.resolve().then(() => (Wl(),El)),"af-skeleton":()=>Promise.resolve().then(() => (Ul(),Ol)),"af-divider":()=>Promise.resolve().then(() => (yl(),Nl)),"af-kanga-card":()=>Promise.resolve().then(() => (Kl(),Vl)),"af-cultural-card":()=>Promise.resolve().then(() => (Cl(),jl)),"af-pattern-showcase":()=>Promise.resolve().then(() => (Pl(),Il)),"af-language-switcher":()=>Promise.resolve().then(() => (Zl(),Tl)),"af-auth":()=>Promise.resolve().then(() => (te(),zl)),"af-auth-form":()=>Promise.resolve().then(() => (Ar(),Na)),"af-kyc-upload":()=>Promise.resolve().then(() => (_r(),ya)),"af-wallet-balance":()=>Promise.resolve().then(() => (Lr(),Va)),"af-transaction-ledger":()=>Promise.resolve().then(() => (Hr(),ja)),"af-nav-drawer":()=>Promise.resolve().then(() => (Mr(),Ca)),"af-theme-toggle":()=>Promise.resolve().then(() => (oe(),ne))};var Q={COMPONENT:"component",FORM:"form",LIST:"list",CARD:"card",MODAL:"modal",TOAST:"toast",PROGRESS:"progress",CHART:"chart",DATATABLE:"datatable",TABS:"tabs",ACCORDION:"accordion",STEPPER:"stepper",DASHBOARD_WIDGET:"dashboard-widget"},Vh={component:{type:"object",properties:{id:{type:"string"},type:{type:"string",enum:Object.values(Q)},props:{type:"object"},children:{type:"array",items:{$ref:"#"}}},required:["id","type"]}};function re(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ao(t){if(Array.isArray(t))return t.map(ao).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")return re(t);if(typeof t!=="object")return"";let n=t.tag||t.tagName;if(!n)return"";let r=t.props||{},o=Object.entries(r).filter(([,l])=>l!==null&&l!==void 0&&l!==!1).map(([l,e])=>e===!0?l:`${l}="${re(e)}"`).join(" "),a=ao(t.children??t.content??"");return`<${n}${o?` ${o}`:""}>${a}</${n}>`}function Ni(t){return/<\s*script\b|on\w+\s*=|javascript:/i.test(String(t))}class lo{constructor(t){this.root=t,this.components=new Map}render(t){if(!t||!t.type)throw Error("Invalid A2UI message");if(t.html!==void 0){if(Ni(t.html))throw Error("Unsafe HTML is not allowed in A2UI render messages");throw Error("Raw HTML payloads are not supported in A2UI render messages")}let n=Array.isArray(t.components)?t.components.map(ao).join(""):ao(t.component||t);if(t.id)this.components.set(t.id,{id:t.id,type:t.type,props:t.props||{},children:t.children||t.components||[]});if(this.root&&typeof this.root.appendChild==="function"&&typeof document<"u"&&n){let o=document.createElement("div");o.innerHTML=n;while(o.firstChild)this.root.appendChild(o.firstChild)}return n}createElement(t){let{type:n,props:r={},children:o=[]}=t,a;switch(n){case Q.COMPONENT:a=this.createCustomComponent(r);break;case Q.FORM:a=this.createForm(r);break;case Q.LIST:a=this.createList(r);break;case Q.CARD:a=this.createCard(r);break;case Q.MODAL:a=this.createModal(r);break;case Q.TOAST:a=this.createToast(r);break;case Q.PROGRESS:a=this.createProgress(r);break;case Q.CHART:a=this.createChart(r);break;case Q.DATATABLE:a=this.createDatatable(r);break;case Q.TABS:a=this.createTabs(r);break;case Q.ACCORDION:a=this.createAccordion(r);break;case Q.STEPPER:a=this.createStepper(r);break;case Q.DASHBOARD_WIDGET:a=this.createDashboardWidget(r);break;default:throw Error(`Unknown A2UI component type: ${n}`)}if(o.length>0)for(let l of o){let e=this.createElement(l);a.appendChild(e)}return a}createCustomComponent({tag:t,...n}){let r=document.createElement(t||"div");return Object.assign(r,n),r}createForm({fields:t=[],onSubmit:n}){let r=document.createElement("af-form");for(let o of t){let a=document.createElement("af-input");a.setAttribute("name",o.name),a.setAttribute("placeholder",o.placeholder||""),a.setAttribute("type",o.type||"text"),r.appendChild(a)}if(n)r.addEventListener("submit",n);return r}createList({items:t=[]}){let n=document.createElement("af-grid");for(let r of t){let o=this.createCard(r);n.appendChild(o)}return n}createCard({title:t,content:n,image:r}){let o=document.createElement("af-card");if(t){let a=document.createElement("h3");a.textContent=t,o.appendChild(a)}if(n){let a=document.createElement("p");a.textContent=n,o.appendChild(a)}if(r){let a=document.createElement("img");a.src=r,a.alt=t||"Card image",o.appendChild(a)}return o}createModal({title:t,content:n,actions:r=[]}){let o=document.createElement("af-modal");if(o.setAttribute("open",""),t){let l=document.createElement("h2");l.slot="header",l.textContent=t,o.appendChild(l)}if(n){let l=document.createElement("p");l.textContent=n,o.appendChild(l)}let a=document.createElement("div");a.slot="footer";for(let l of r){let e=document.createElement("af-button");if(e.textContent=l.label,l.primary)e.setAttribute("variant","primary");if(l.onClick)e.addEventListener("click",l.onClick);a.appendChild(e)}return o.appendChild(a),o}createToast({message:t,type:n="info",duration:r=3000}){let o=document.createElement("af-toast");return o.setAttribute("type",n),o.textContent=t,setTimeout(()=>{o.remove()},r),o}createProgress({value:t=0,max:n=100,label:r}){let o=document.createElement("af-progress");if(o.setAttribute("value",t),o.setAttribute("max",n),r)o.setAttribute("label",r);return o}createChart({type:t="bar",data:n=[],labels:r=[],title:o,options:a={}}){let l=document.createElement("af-chart");if(l.setAttribute("type",t),l.setAttribute("data",JSON.stringify(n)),l.setAttribute("labels",JSON.stringify(r)),o)l.setAttribute("title",o);if(a)l.setAttribute("options",JSON.stringify(a));return l}createDatatable({columns:t=[],rows:n=[],title:r,options:o={}}){let a=document.createElement("af-datatable");if(a.setAttribute("columns",JSON.stringify(t)),a.setAttribute("rows",JSON.stringify(n)),r)a.setAttribute("title",r);if(o)a.setAttribute("options",JSON.stringify(o));return a}createTabs({tabs:t=[],activeTab:n=0}){let r=document.createElement("af-tabs");r.setAttribute("active",n);for(let o=0;o<t.length;o++){let a=t[o],l=document.createElement("af-tab-button");l.setAttribute("tab-id",o),l.textContent=a.title;let e=document.createElement("af-tab-content");e.setAttribute("tab-id",o),e.innerHTML=a.content||"",r.appendChild(l),r.appendChild(e)}return r}createAccordion({items:t=[]}){let n=document.createElement("af-accordion");for(let r of t){let o=document.createElement("af-accordion-panel"),a=document.createElement("af-accordion-header");a.textContent=r.title;let l=document.createElement("af-accordion-content");l.innerHTML=r.content||"",o.appendChild(a),o.appendChild(l),n.appendChild(o)}return n}createStepper({steps:t=[],currentStep:n=0}){let r=document.createElement("af-stepper");r.setAttribute("current-step",n);for(let o=0;o<t.length;o++){let a=document.createElement("af-step");if(a.setAttribute("step-number",o+1),a.setAttribute("active",o<=n),o===n)a.setAttribute("current","true");a.textContent=t[o].title||`Step ${o+1}`,r.appendChild(a)}return r}createDashboardWidget({title:t,content:n,type:r="card",size:o="medium",actions:a=[]}){let l=document.createElement("af-dashboard-widget");if(l.setAttribute("type",r),l.setAttribute("size",o),t){let e=document.createElement("h3");e.className="widget-title",e.textContent=t,l.appendChild(e)}if(n){let e=document.createElement("div");e.className="widget-content",e.innerHTML=typeof n==="string"?n:JSON.stringify(n),l.appendChild(e)}if(a.length>0){let e=document.createElement("div");e.className="widget-actions";for(let b of a){let f=document.createElement("af-button");if(f.textContent=b.label,f.setAttribute("variant",b.variant||"secondary"),b.onClick)f.addEventListener("click",b.onClick);e.appendChild(f)}l.appendChild(e)}return l}update(t,n){let r=this.components.get(t);if(r)Object.assign(r,n)}remove(t){let n=this.components.get(t);if(n)n.remove(),this.components.delete(t)}}class eo{constructor(t){this.renderer=t,this.messageQueue=[],this.messageHandlers=[],this.isProcessing=!1}onMessage(t){if(typeof t==="function")this.messageHandlers.push(t)}sendMessage(t){return this.processMessage(t)}processMessage(t){if(typeof t==="string")try{t=JSON.parse(t)}catch{return console.warn("Invalid A2UI message format:",t),null}if(t?.type==="render"&&this.renderer)return this.renderer.render(t);for(let n of this.messageHandlers)n(t);return t}processQueue(){if(this.isProcessing||this.messageQueue.length===0)return;this.isProcessing=!0;while(this.messageQueue.length>0){let t=this.messageQueue.shift();try{this.renderer.render(t)}catch(n){console.error("A2UI render error:",n)}}this.isProcessing=!1}async handleStream(t){let n=t.getReader(),r=new TextDecoder,o="";while(!0){let{done:a,value:l}=await n.read();if(a)break;o+=r.decode(l,{stream:!0});let e=o.split(`
|
|
4482
|
+
`);o=e.pop();for(let b of e)if(b.trim())this.processMessage(b.trim())}if(o.trim())this.processMessage(o.trim())}createStream(){let t=new Set;return{subscribe(n){if(typeof n!=="function")return()=>{};return t.add(n),()=>t.delete(n)},push(n){for(let r of t)r(n)}}}validateAgainstSchema(t){let n=t?.tag||t?.tagName;return Promise.resolve(Boolean(n&&ro[n]))}}function ae(t){if(typeof document>"u")t=null;else t=t||document.body;let n=new lo(t),r=new eo(n);if(typeof window<"u")window.a2ui={render:(o)=>r.processMessage(o),handleStream:(o)=>r.handleStream(o),update:(o,a)=>n.update(o,a),remove:(o)=>n.remove(o),sendMessage:(o)=>r.sendMessage(o),onMessage:(o)=>r.onMessage(o),createStream:()=>r.createStream(),validateAgainstSchema:(o)=>r.validateAgainstSchema(o)};return{renderer:n,protocol:r}}rt();function yi(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Browser SDK Initialized");let n={...ro,...t};if(Object.keys(n).length>0)Er(n)}}var bd={createReactiveState:ht,subscribe:T,createSignal:fo,createEffect:ho,store:J,actions:Qr,patterns:Mt,motion:So,html:c,Layout:Wr,schemas:kn,Validation:ft,rules:O,afri:ba,AfriFieldBuilder:K,normalizeInput:ia,buildSchema:fa,createFramework:ea,getConfig:Dt,getRequestIdentity:da,parseCookieHeader:Wo,createSessionId:ha,SESSION_COOKIE_NAME:Oo,sessionStore:j,runtimeActions:ga,MiddlewareManager:jo,loggerMiddleware:sa,authMiddleware:ma,AfriCodeError:U,ValidationError:Ln,InvalidUrlError:Uo,SecurityError:Et,CsrfError:No,RateLimitError:yo,DatabaseError:Vo,ComponentError:Ko,initA2UI:ae,A2UIRenderer:lo,A2UIProtocol:eo,init:yi};export{T as subscribe,J as store,j as sessionStore,kn as schemas,ga as runtimeActions,O as rules,Mt as patterns,Wo as parseCookieHeader,ia as normalizeInput,So as motion,sa as loggerMiddleware,ae as initA2UI,yi as init,c as html,da as getRequestIdentity,Dt as getConfig,bd as default,fo as createSignal,ha as createSessionId,ht as createReactiveState,ea as createFramework,ho as createEffect,fa as buildSchema,ma as authMiddleware,ba as afri,Qr as actions,Ln as ValidationError,ft as Validation,Et as SecurityError,Oo as SESSION_COOKIE_NAME,yo as RateLimitError,jo as MiddlewareManager,Wr as Layout,Uo as InvalidUrlError,Vo as DatabaseError,No as CsrfError,Ko as ComponentError,K as AfriFieldBuilder,U as AfriCodeError,lo as A2UIRenderer,eo as A2UIProtocol};
|
|
4082
4483
|
|
|
4083
|
-
//# debugId=
|
|
4484
|
+
//# debugId=F0A067E8E7015B7664756E2164756E21
|