@africode/core 5.0.3 → 5.0.5
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/COMPONENT_SCHEMA.json +990 -836
- package/README.md +30 -0
- package/components/index.js +14 -0
- package/components/ui-badge.js +61 -0
- package/components/ui-button.js +149 -0
- package/components/ui-card.js +75 -0
- package/components/ui-input.js +110 -0
- package/components/ui-switch.js +85 -0
- package/core/cli/commands/build.js +33 -2
- package/core/cli/commands/dev.js +38 -1
- package/core/lipa-namba-journey.js +28 -6
- package/core/sdk-browser.js +140 -0
- package/dist/africode.js +604 -353
- package/dist/africode.js.map +22 -10
- package/dist/build-info.json +3 -3
- package/dist/components.js +554 -304
- package/dist/components.js.map +9 -4
- package/package.json +6 -5
- package/templates/starter/src/pages/index.html +2 -2
- package/templates/starter-3d/src/pages/index.html +2 -2
- package/templates/starter-react/src/pages/index.html +2 -2
- package/templates/starter-tailwind/src/pages/index.html +2 -2
- package/templates/starter-tailwind/src/pages/index.js +30 -0
- package/templates/starter-tailwind/tailwind.config.cjs +18 -0
- package/src/index.ts +0 -196
package/dist/africode.js
CHANGED
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Rb=Object.defineProperty;var Bb=(t)=>t;function Db(t,n){this[t]=Bb.bind(null,n)}var i=(t,n)=>{for(var b in n)Rb(t,b,{get:n[b],enumerable:!0,configurable:!0,set:Db.bind(n,b)})};var x=(t,n)=>()=>(t&&(n=t(t=0)),n);function $t(t){if(jt.has(t))return jt.get(t);let b=new Proxy(t,{get(o,l,a){let h=Reflect.get(o,l,a);if(h!==null&&typeof h==="object")return $t(h);return h},set(o,l,a,h){let f=Reflect.get(o,l,h);if(f!==a){let r=Reflect.set(o,l,a,h);if(r)On(h,a,f,l);return r}return!0},deleteProperty(o,l){let a=Reflect.get(o,l),h=Reflect.deleteProperty(o,l);if(h){let f=jt.get(o);On(f,void 0,a,l)}return h}});return jt.set(t,b),b}function y(t,n){if(!It.has(t))It.set(t,new Set);let b=It.get(t);return b.add(n),()=>{b.delete(n)}}function On(t,n,b,o){let l=It.get(t);if(!l)return;l.forEach((a)=>{try{a(n,b,o)}catch(h){console.error("[AfriCode State] Subscriber error:",h)}})}class Do{constructor(){this.store={}}get(t){return t.split("/").reduce((n,b)=>n?.[b],this.store)}set(t,n){let b=t.split("/"),o=this.store;while(b.length>1){let l=b.shift();if(!o[l]||typeof o[l]!=="object")o[l]={};o=o[l]}o[b[0]]=n}getAll(){return this.store}}function Wn(t){let n=t,b=new Set,o=()=>{return n},l=(a)=>{if(n!==a)n=typeof a==="function"?a(n):a,b.forEach((h)=>h()),On()};return o.subscribe=(a)=>{return b.add(a),()=>b.delete(a)},[o,l]}function mn(t){return t(),y(t)}var It,jt,ja;var bt=x(()=>{It=new WeakMap,jt=new WeakMap;ja=new Do});var Eb,D,Eo;var Qt=x(()=>{bt();Eb={theme:"light",language:"en",ui:{sidebarCollapsed:!1,theme:"dark",activePage:"home"},user:{name:"Guest",permissions:[]},config:{animationsEnabled:!0,soundEnabled:!1}},D=$t(Eb),Eo={setTheme(t){if(["dark","light","system"].includes(t))D.theme=t,D.ui.theme=t},setLanguage(t){D.language=t},toggleSidebar(t){if(typeof t==="boolean")D.ui.sidebarCollapsed=t;else D.ui.sidebarCollapsed=!D.ui.sidebarCollapsed},setActivePage(t){D.ui.activePage=t}}});function Ob(t,n,b=50,o=50){let l=[];for(let a=0;a<t;a++){let h=2*Math.PI*a/t-Math.PI/2,f=b+n*Math.cos(h),r=o+n*Math.sin(h);l.push(`${f.toFixed(2)},${r.toFixed(2)}`)}return l.join(" ")}function pn({primaryColor:t="#FF0000",secondaryColor:n="#000000",backgroundColor:b="#8B0000",stripeWidth:o=4,size:l=40}={}){let a=`
|
|
2
2
|
<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
|
|
3
|
-
<rect width="${l}" height="${l}" fill="${
|
|
4
|
-
<rect x="0" y="0" width="${l}" height="${
|
|
5
|
-
<rect x="0" y="${l/2-
|
|
6
|
-
<rect x="0" y="${l-
|
|
7
|
-
<rect x="0" y="0" width="${
|
|
8
|
-
<rect x="${l/2-
|
|
9
|
-
<rect x="${l-
|
|
3
|
+
<rect width="${l}" height="${l}" fill="${b}"/>
|
|
4
|
+
<rect x="0" y="0" width="${l}" height="${o}" fill="${t}" opacity="0.8"/>
|
|
5
|
+
<rect x="0" y="${l/2-o/2}" width="${l}" height="${o}" fill="${n}" opacity="0.6"/>
|
|
6
|
+
<rect x="0" y="${l-o}" width="${l}" height="${o}" fill="${t}" opacity="0.8"/>
|
|
7
|
+
<rect x="0" y="0" width="${o}" height="${l}" fill="${t}" opacity="0.5"/>
|
|
8
|
+
<rect x="${l/2-o/2}" y="0" width="${o}" height="${l}" fill="${n}" opacity="0.4"/>
|
|
9
|
+
<rect x="${l-o}" y="0" width="${o}" height="${l}" fill="${t}" opacity="0.5"/>
|
|
10
10
|
</svg>
|
|
11
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
12
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
13
|
-
<rect width="${
|
|
11
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function un({earthColor:t="#8B4513",ochreColor:n="#CD853F",charcoalColor:b="#2F2F2F",size:o=50}={}){let l=`
|
|
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="${b}" stroke-width="2"/>
|
|
17
|
+
<line x1="${o*0.2}" y1="${o*0.45}" x2="${o*0.4}" y2="${o*0.45}" stroke="${b}" 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="${b}" stroke-width="2"/>
|
|
21
|
+
<line x1="${o*0.8}" y1="${o*0.58}" x2="${o*0.8}" y2="${o*0.7}" stroke="${b}" 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(l.trim())}`}function
|
|
27
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
28
|
-
<rect width="${
|
|
26
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Un({primaryColor:t="#1EB53A",accentColor:n="#FCD116",size:b=30}={}){let o=`
|
|
27
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
28
|
+
<rect width="${b}" height="${b}" 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${b/2},${b/2} L0,${b} Z" fill="${n}"/>
|
|
31
|
+
<path d="M${b},0 L${b/2},${b/2} L${b},${b} Z" fill="${n}"/>
|
|
32
|
+
<circle cx="${b/2}" cy="${b/2}" r="${b*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 Wb({primaryColor:t="#FF6B00",secondaryColor:n="#002B5C",backgroundColor:b="#FFFFFF",size:o=40}={}){let l=`
|
|
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="${b}"/>
|
|
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(l.trim())}`}function
|
|
47
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
48
|
-
<rect width="${
|
|
46
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function mb({primaryColor:t="#8B4513",secondaryColor:n="#DAA520",backgroundColor:b="#F5F5DC",size:o=30}={}){let l=`
|
|
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="${b}"/>
|
|
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(l.trim())}`}function
|
|
58
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
59
|
-
<rect width="${
|
|
57
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function pb({primaryColor:t="#FF0000",secondaryColor:n="#000000",accentColor:b="#FFFFFF",size:o=40}={}){let l=`
|
|
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="${b}"/>
|
|
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(l.trim())}`}function
|
|
72
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
73
|
-
<ellipse cx="${
|
|
71
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function ub({primaryColor:t="#8B0000",secondaryColor:n="#FFD700",backgroundColor:b="#654321",size:o=50}={}){let l=`
|
|
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="${b}"/>
|
|
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(l.trim())}`}function
|
|
81
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Ub({primaryColor:t="#FF1493",secondaryColor:n="#00FF00",accentColor:b="#FFFF00",backgroundColor:o="#FFFFFF",size:l=50}={}){let a=`
|
|
82
82
|
<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
|
|
83
|
-
<rect width="${l}" height="${l}" fill="${
|
|
83
|
+
<rect width="${l}" height="${l}" fill="${o}"/>
|
|
84
84
|
<!-- Ndebele geometric patterns -->
|
|
85
85
|
<polygon points="${l*0.2},${l*0.2} ${l*0.4},${l*0.2} ${l*0.3},${l*0.4}" fill="${t}"/>
|
|
86
86
|
<polygon points="${l*0.6},${l*0.2} ${l*0.8},${l*0.2} ${l*0.7},${l*0.4}" fill="${n}"/>
|
|
87
|
-
<polygon points="${l*0.2},${l*0.6} ${l*0.4},${l*0.6} ${l*0.3},${l*0.8}" fill="${
|
|
87
|
+
<polygon points="${l*0.2},${l*0.6} ${l*0.4},${l*0.6} ${l*0.3},${l*0.8}" fill="${b}"/>
|
|
88
88
|
<polygon points="${l*0.6},${l*0.6} ${l*0.8},${l*0.6} ${l*0.7},${l*0.8}" fill="${t}"/>
|
|
89
89
|
<!-- Center design -->
|
|
90
90
|
<circle cx="${l*0.5}" cy="${l*0.5}" r="${l*0.15}" fill="${n}"/>
|
|
91
|
-
<rect x="${l*0.45}" y="${l*0.45}" width="${l*0.1}" height="${l*0.1}" fill="${
|
|
91
|
+
<rect x="${l*0.45}" y="${l*0.45}" width="${l*0.1}" height="${l*0.1}" fill="${b}"/>
|
|
92
92
|
</svg>
|
|
93
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.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(a.trim())}`}function Vn({primaryColor:t="#00A3DD",secondaryColor:n="#FCD116",backgroundColor:b="#1EB53A",size:o=50}={}){let l=`
|
|
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="${b}"/>
|
|
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(l.trim())}`}function
|
|
103
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Nn({colors:t=["#FFD700","#228B22","#DC143C","#000000"],size:n=60}={}){let[b,o,l,a]=t,h=n/6,f=`
|
|
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="${a}"/>
|
|
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="${h}" fill="${b}"/>
|
|
108
|
+
<rect x="0" y="${h}" width="${n}" height="${h}" fill="${o}"/>
|
|
109
|
+
<rect x="0" y="${h*2}" width="${n}" height="${h}" fill="${l}"/>
|
|
110
|
+
<rect x="0" y="${h*3}" width="${n}" height="${h}" fill="${b}"/>
|
|
111
|
+
<rect x="0" y="${h*4}" width="${n}" height="${h}" fill="${o}"/>
|
|
112
|
+
<rect x="0" y="${h*5}" width="${n}" height="${h}" fill="${l}"/>
|
|
113
113
|
<!-- Vertical accents -->
|
|
114
114
|
<rect x="${n*0.2}" y="0" width="3" height="${n}" fill="${a}" opacity="0.5"/>
|
|
115
115
|
<rect x="${n*0.4}" y="0" width="3" height="${n}" fill="${a}" opacity="0.5"/>
|
|
116
116
|
<rect x="${n*0.6}" y="0" width="3" height="${n}" fill="${a}" opacity="0.5"/>
|
|
117
117
|
<rect x="${n*0.8}" y="0" width="3" height="${n}" fill="${a}" 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="${b}" stroke="${a}" stroke-width="1"/>
|
|
120
120
|
<rect x="${n*0.75}" y="${n*0.75}" width="${n*0.15}" height="${n*0.15}" fill="${l}" stroke="${a}" 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(f.trim())}`}function Kn({symbolColor:t="#000000",backgroundColor:n="#CD853F",size:b=50}={}){let o=`
|
|
123
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
124
|
+
<rect width="${b}" height="${b}" 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${b*0.5} ${b*0.2}
|
|
127
|
+
C${b*0.3} ${b*0.1} ${b*0.15} ${b*0.3} ${b*0.25} ${b*0.5}
|
|
128
|
+
L${b*0.5} ${b*0.8}
|
|
129
|
+
L${b*0.75} ${b*0.5}
|
|
130
|
+
C${b*0.85} ${b*0.3} ${b*0.7} ${b*0.1} ${b*0.5} ${b*0.2}"
|
|
131
131
|
fill="none" stroke="${t}" stroke-width="3"/>
|
|
132
132
|
<!-- Spiral detail -->
|
|
133
|
-
<circle cx="${
|
|
134
|
-
<circle cx="${
|
|
133
|
+
<circle cx="${b*0.35}" cy="${b*0.45}" r="${b*0.08}" fill="none" stroke="${t}" stroke-width="2"/>
|
|
134
|
+
<circle cx="${b*0.65}" cy="${b*0.45}" r="${b*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 jn({colors:t=["#4B0082","#FFD700","#FFFFFF"],size:n=50}={}){let[b,o,l]=t,a=n/10,h=`
|
|
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="${b}"/>
|
|
139
139
|
<!-- Horizontal stripes -->
|
|
140
|
-
<rect x="0" y="${a}" width="${n}" height="${a*0.5}" fill="${
|
|
140
|
+
<rect x="0" y="${a}" width="${n}" height="${a*0.5}" fill="${o}"/>
|
|
141
141
|
<rect x="0" y="${a*3}" width="${n}" height="${a*0.5}" fill="${l}"/>
|
|
142
|
-
<rect x="0" y="${a*5}" width="${n}" height="${a*0.5}" fill="${
|
|
142
|
+
<rect x="0" y="${a*5}" width="${n}" height="${a*0.5}" fill="${o}"/>
|
|
143
143
|
<rect x="0" y="${a*7}" width="${n}" height="${a*0.5}" fill="${l}"/>
|
|
144
|
-
<rect x="0" y="${a*9}" width="${n}" height="${a*0.5}" fill="${
|
|
144
|
+
<rect x="0" y="${a*9}" width="${n}" height="${a*0.5}" fill="${o}"/>
|
|
145
145
|
<!-- Vertical accent lines -->
|
|
146
|
-
<rect x="${n*0.48}" y="0" width="${a*0.4}" height="${n}" fill="${
|
|
146
|
+
<rect x="${n*0.48}" y="0" width="${a*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="${l}" 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="${l}" stroke-width="1"/>
|
|
152
152
|
</svg>
|
|
153
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
153
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function In({primaryColor:t="#FF6B00",secondaryColor:n="#00A86B",accentColor:b="#FFD700",backgroundColor:o="#FFFFFF",size:l=60}={}){let a=`
|
|
154
154
|
<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
|
|
155
|
-
<rect width="${l}" height="${l}" fill="${
|
|
155
|
+
<rect width="${l}" height="${l}" fill="${o}"/>
|
|
156
156
|
<!-- Bold circular motifs -->
|
|
157
157
|
<circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.25}" fill="${t}"/>
|
|
158
158
|
<circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.15}" fill="${n}"/>
|
|
159
|
-
<circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.08}" fill="${
|
|
159
|
+
<circle cx="${l*0.3}" cy="${l*0.3}" r="${l*0.08}" fill="${b}"/>
|
|
160
160
|
|
|
161
161
|
<circle cx="${l*0.8}" cy="${l*0.8}" r="${l*0.2}" fill="${n}"/>
|
|
162
162
|
<circle cx="${l*0.8}" cy="${l*0.8}" r="${l*0.1}" fill="${t}"/>
|
|
@@ -166,108 +166,108 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
166
166
|
stroke="${t}" stroke-width="4"/>
|
|
167
167
|
|
|
168
168
|
<!-- Small dots -->
|
|
169
|
-
<circle cx="${l*0.1}" cy="${l*0.8}" r="${l*0.05}" fill="${
|
|
170
|
-
<circle cx="${l*0.9}" cy="${l*0.2}" r="${l*0.05}" fill="${
|
|
169
|
+
<circle cx="${l*0.1}" cy="${l*0.8}" r="${l*0.05}" fill="${b}"/>
|
|
170
|
+
<circle cx="${l*0.9}" cy="${l*0.2}" r="${l*0.05}" fill="${b}"/>
|
|
171
171
|
</svg>
|
|
172
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
173
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
174
|
-
<rect width="${
|
|
172
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function Pn({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:b="#8B4513",size:o=60}={}){let l=`
|
|
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="${b}"/>
|
|
187
187
|
</svg>
|
|
188
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
189
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
190
|
-
<rect width="${
|
|
188
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Tn({primaryColor:t="#D2B48C",secondaryColor:n="#3E2723",size:b=60}={}){let o=`
|
|
189
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
190
|
+
<rect width="${b}" height="${b}" fill="${t}"/>
|
|
191
191
|
<!-- Interlocking diamonds/rectangles -->
|
|
192
|
-
<rect x="${
|
|
193
|
-
<rect x="${
|
|
194
|
-
<rect x="${
|
|
192
|
+
<rect x="${b*0.1}" y="${b*0.1}" width="${b*0.3}" height="${b*0.3}" fill="${n}"/>
|
|
193
|
+
<rect x="${b*0.6}" y="${b*0.6}" width="${b*0.3}" height="${b*0.3}" fill="${n}"/>
|
|
194
|
+
<rect x="${b*0.6}" y="${b*0.1}" width="${b*0.3}" height="${b*0.3}"
|
|
195
195
|
fill="none" stroke="${n}" stroke-width="4"/>
|
|
196
|
-
<rect x="${
|
|
196
|
+
<rect x="${b*0.1}" y="${b*0.6}" width="${b*0.3}" height="${b*0.3}"
|
|
197
197
|
fill="none" stroke="${n}" stroke-width="4"/>
|
|
198
198
|
<!-- Center lines -->
|
|
199
|
-
<line x1="${
|
|
200
|
-
<line x1="${
|
|
199
|
+
<line x1="${b*0.4}" y1="${b*0.5}" x2="${b*0.6}" y2="${b*0.5}" stroke="${n}" stroke-width="2"/>
|
|
200
|
+
<line x1="${b*0.5}" y1="${b*0.4}" x2="${b*0.5}" y2="${b*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 Cn({primaryColor:t="#000000",secondaryColor:n="#FFFFFF",accentColor:b="#B22222",size:o=60}={}){let l=`
|
|
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="${b}"/>
|
|
217
217
|
</svg>
|
|
218
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
219
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
220
|
-
<rect width="${
|
|
218
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function yn({colors:t=["#009E60","#FCDD09","#EF3340"],backgroundColor:n="#FFFFFF",size:b=40}={}){let[o,l,a]=t,h=`
|
|
219
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
220
|
+
<rect width="${b}" height="${b}" fill="${n}"/>
|
|
221
221
|
<!-- Diamond Chain -->
|
|
222
|
-
<polygon points="${
|
|
223
|
-
fill="${
|
|
224
|
-
<polygon points="${
|
|
222
|
+
<polygon points="${b*0.5},0 ${b},${b*0.5} ${b*0.5},${b} 0,${b*0.5}"
|
|
223
|
+
fill="${o}" opacity="0.2"/>
|
|
224
|
+
<polygon points="${b*0.5},${b*0.2} ${b*0.8},${b*0.5} ${b*0.5},${b*0.8} ${b*0.2},${b*0.5}"
|
|
225
225
|
fill="${l}"/>
|
|
226
|
-
<rect x="${
|
|
226
|
+
<rect x="${b*0.4}" y="${b*0.4}" width="${b*0.2}" height="${b*0.2}" fill="${a}"/>
|
|
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="${b}" stroke="${o}" stroke-width="4"/>
|
|
229
|
+
<line x1="${b}" y1="0" x2="${b}" y2="${b}" stroke="${o}" stroke-width="4"/>
|
|
230
230
|
</svg>
|
|
231
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
231
|
+
`;return`data:image/svg+xml,${encodeURIComponent(h.trim())}`}function en({colors:t=["#FFD700","#4169E1","#FF69B4","#228B22"],size:n=60,strokeWidth:b=2}={}){let[o,l,a,h]=t,f=`
|
|
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="${b}" y="${b}"
|
|
235
|
+
width="${n-b*2}" height="${n-b*2}"
|
|
236
|
+
fill="none" stroke="#000000" stroke-width="${b}"/>
|
|
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="${b/2}"/>
|
|
239
239
|
<rect x="${n*0.5}" y="${n*0.15}" width="${n*0.35}" height="${n*0.35}"
|
|
240
|
-
fill="${l}" stroke="#000000" stroke-width="${
|
|
240
|
+
fill="${l}" stroke="#000000" stroke-width="${b/2}"/>
|
|
241
241
|
<rect x="${n*0.15}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
|
|
242
|
-
fill="${a}" stroke="#000000" stroke-width="${
|
|
242
|
+
fill="${a}" stroke="#000000" stroke-width="${b/2}"/>
|
|
243
243
|
<rect x="${n*0.5}" y="${n*0.5}" width="${n*0.35}" height="${n*0.35}"
|
|
244
|
-
fill="${
|
|
244
|
+
fill="${h}" stroke="#000000" stroke-width="${b/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="${b}"/>
|
|
247
247
|
</svg>
|
|
248
|
-
`;return`data:image/svg+xml,${encodeURIComponent(
|
|
248
|
+
`;return`data:image/svg+xml,${encodeURIComponent(f.trim())}`}function Zn({colors:t=["#FFFFFF","#000000","#FF0000","#00A86B","#FFD700"],size:n=50}={}){let[b,o,l,a,h]=t,f=n/10,r=`
|
|
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="${b}" 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="${l}"/>
|
|
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="${f}" fill="${b}"/>
|
|
258
|
+
<circle cx="${n*0.35}" cy="${n*0.6}" r="${f}" fill="${a}"/>
|
|
259
|
+
<circle cx="${n*0.65}" cy="${n*0.6}" r="${f}" fill="${h}"/>
|
|
260
|
+
<circle cx="${n*0.5}" cy="${n*0.8}" r="${f}" fill="${b}"/>
|
|
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="${f*0.7}" fill="${l}"/>
|
|
263
|
+
<circle cx="${n*0.9}" cy="${n*0.1}" r="${f*0.7}" fill="${a}"/>
|
|
264
264
|
</svg>
|
|
265
|
-
`;return`data:image/svg+xml,${encodeURIComponent(r.trim())}`}function
|
|
265
|
+
`;return`data:image/svg+xml,${encodeURIComponent(r.trim())}`}function sn({colors:t=["#3E5EB9","#FECD00","#B10C0C","#FFFFFF"],size:n=50}={}){let[b,o,l,a]=t,h=`
|
|
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="${b}"/>
|
|
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="${l}" 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="${l}"/>
|
|
@@ -282,72 +282,72 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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="${a}"/>
|
|
283
283
|
<polygon points="${n*0.9},${n*0.3} ${n*0.85},${n*0.5} ${n*0.95},${n*0.5}" fill="${a}"/>
|
|
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(h.trim())}`}function zn({primaryColor:t="#FFFFFF",accentColor:n="#00A86B",backgroundColor:b="#1a1a2e",size:o=50}={}){let l=`
|
|
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="${b}"/>
|
|
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(l.trim())}`}function
|
|
303
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Vb(t,n){t.style.backgroundImage=`url("${n}")`,t.style.backgroundRepeat="repeat"}function to({primaryColor:t="#8B0000",secondaryColor:n="#000000",accentColor:b="#FFD700",backgroundColor:o="#F5F5DC",size:l=60}={}){let a=`
|
|
304
304
|
<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="0 0 ${l} ${l}">
|
|
305
|
-
<rect width="${l}" height="${l}" fill="${
|
|
305
|
+
<rect width="${l}" height="${l}" fill="${o}"/>
|
|
306
306
|
<!-- Lozenge (Diamond) - universal protective symbol -->
|
|
307
307
|
<polygon points="${l*0.5},${l*0.1} ${l*0.9},${l*0.5} ${l*0.5},${l*0.9} ${l*0.1},${l*0.5}"
|
|
308
308
|
fill="${t}" stroke="${n}" stroke-width="2"/>
|
|
309
309
|
<!-- Inner geometric details -->
|
|
310
|
-
<line x1="${l*0.5}" y1="${l*0.1}" x2="${l*0.5}" y2="${l*0.9}" stroke="${
|
|
311
|
-
<line x1="${l*0.1}" y1="${l*0.5}" x2="${l*0.9}" y2="${l*0.5}" stroke="${
|
|
310
|
+
<line x1="${l*0.5}" y1="${l*0.1}" x2="${l*0.5}" y2="${l*0.9}" stroke="${b}" stroke-width="2"/>
|
|
311
|
+
<line x1="${l*0.1}" y1="${l*0.5}" x2="${l*0.9}" y2="${l*0.5}" stroke="${b}" stroke-width="2"/>
|
|
312
312
|
<!-- X symbols (Fibula/Cross) -->
|
|
313
313
|
<line x1="${l*0.4}" y1="${l*0.4}" x2="${l*0.6}" y2="${l*0.6}" stroke="${n}" stroke-width="2"/>
|
|
314
314
|
<line x1="${l*0.6}" y1="${l*0.4}" x2="${l*0.4}" y2="${l*0.6}" stroke="${n}" stroke-width="2"/>
|
|
315
315
|
</svg>
|
|
316
|
-
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function
|
|
317
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
318
|
-
<rect width="${
|
|
316
|
+
`;return`data:image/svg+xml,${encodeURIComponent(a.trim())}`}function no({primaryColor:t="#4B0082",secondaryColor:n="#8A2BE2",accentColor:b="#FFFFFF",size:o=50}={}){let l=`
|
|
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="${b}" stroke-width="2" stroke-dasharray="4 2"/>
|
|
322
|
+
<circle cx="${o*0.5}" cy="${o*0.5}" r="${o*0.1}" fill="${b}" 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(l.trim())}`}function
|
|
328
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
329
|
-
<rect width="${
|
|
327
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Nb({primaryColor:t="#2D3D6B",secondaryColor:n="#6B8CC7",accentColor:b="#FFFFFF",size:o=60}={}){let l=`
|
|
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="${b}" 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(l.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(l.trim())}`}function Kb({inkColor:t="#3A2E2C",parchmentColor:n="#F4E4BC",size:b=50}={}){let o=`
|
|
336
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" viewBox="0 0 ${b} ${b}">
|
|
337
|
+
<rect width="${b}" height="${b}" fill="${n}"/>
|
|
338
|
+
<path d="M${b*0.2} ${b*0.2} L${b*0.4} ${b*0.2} M${b*0.3} ${b*0.2} L${b*0.3} ${b*0.5} Q${b*0.4} ${b*0.6} ${b*0.2} ${b*0.7}"
|
|
339
339
|
fill="none" stroke="${t}" stroke-width="3" stroke-linecap="round"/>
|
|
340
|
-
<path d="M${
|
|
340
|
+
<path d="M${b*0.6} ${b*0.3} C${b*0.8} ${b*0.3} ${b*0.8} ${b*0.6} ${b*0.6} ${b*0.6} L${b*0.8} ${b*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 jb({clayColor:t="#4E342E",earthColor:n="#3E2723",accentColor:b="#BCAAA4",size:o=60}={}){let l=`
|
|
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="${b}" stroke-width="2"/>
|
|
348
348
|
</svg>
|
|
349
|
-
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function
|
|
350
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
349
|
+
`;return`data:image/svg+xml,${encodeURIComponent(l.trim())}`}function Oo({primaryColor:t="#334155",secondaryColor:n="#1e293b",size:b=100}={}){let o=`
|
|
350
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${b}" height="${b}" 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,20 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.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())}`}var Jt;var Gt=x(()=>{Jt={generatePolygon:Ob,generateShuka:pn,generateHadzabe:un,generateKanga:Wb,generateKangaBorder:Un,generateKitenge:Vn,generateMasaiShield:ub,generateTibeb:yn,generateImigongo:Cn,generateKente:Nn,generateAdinkra:Kn,generateAsoOke:jn,generateAnkara:In,generateBogolan:Pn,generateAdire:no,generateKuba:Tn,generateKubaBorder:mb,generateBerber:to,generateNdebele:en,generateNdebelePaint:Ub,generateZulu:Zn,generateZuluBeads:pb,generateSwazi:sn,generateXhosa:zn,applyPattern:Vb,generateTuareg:Nb,generateGeez:Kb,generateBoli:jb,generateCircuit:Oo,circuit:Oo}});class lo{constructor(t){this.value=t,this.__type="RawHtml",Object.freeze(this)}toString(){return this.value}valueOf(){return this.value}}function Tb(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function uo({title:t="AfriCode App",meta:n="",stylesheet:b="/styles/africanity.css",children:o}={}){return Q`<!DOCTYPE html>
|
|
359
359
|
<html lang="en">
|
|
360
360
|
<head>
|
|
361
361
|
<meta charset="UTF-8">
|
|
362
362
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
363
363
|
<title>${t}</title>
|
|
364
364
|
${n}
|
|
365
|
-
${
|
|
365
|
+
${b?Q`<link rel="stylesheet" href="${b}">`:""}
|
|
366
366
|
<script type="module" src="/core/sdk.js"></script>
|
|
367
367
|
</head>
|
|
368
368
|
<body>
|
|
369
|
-
${
|
|
369
|
+
${o}
|
|
370
370
|
</body>
|
|
371
|
-
</html>`}function h0(t){if(t instanceof Vn)return t.toString();if(Array.isArray(t))return t.map(h0).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return so(t)}var m=(t,...n)=>{let o="";for(let b=0;b<t.length;b++)if(o+=t[b],b<n.length)o+=h0(n[b]);return new Vn(o)};function A(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var zo,r0,c;var M=x(()=>{zo=globalThis.HTMLElement??class{},r0=typeof CSSStyleSheet<"u";c=class c extends zo{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=`
|
|
371
|
+
</html>`}function Uo(t){if(t instanceof lo)return t.toString();if(Array.isArray(t))return t.map(Uo).join("");if(t===null||t===void 0||t===!1)return"";if(t===!0)return"true";return Tb(t)}var Q=(t,...n)=>{let b="";for(let o=0;o<t.length;o++)if(b+=t[o],o<n.length)b+=Uo(n[o]);return new lo(b)};var M,ao,$,V=(t)=>{switch(typeof t){case"undefined":return $.undefined;case"string":return $.string;case"number":return Number.isNaN(t)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":if(Array.isArray(t))return $.array;if(t===null)return $.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return $.promise;if(typeof Map<"u"&&t instanceof Map)return $.map;if(typeof Set<"u"&&t instanceof Set)return $.set;if(typeof Date<"u"&&t instanceof Date)return $.date;return $.object;default:return $.unknown}};var St=x(()=>{(function(t){t.assertEqual=(l)=>{};function n(l){}t.assertIs=n;function b(l){throw Error()}t.assertNever=b,t.arrayToEnum=(l)=>{let a={};for(let h of l)a[h]=h;return a},t.getValidEnumValues=(l)=>{let a=t.objectKeys(l).filter((f)=>typeof l[l[f]]!=="number"),h={};for(let f of a)h[f]=l[f];return t.objectValues(h)},t.objectValues=(l)=>{return t.objectKeys(l).map(function(a){return l[a]})},t.objectKeys=typeof Object.keys==="function"?(l)=>Object.keys(l):(l)=>{let a=[];for(let h in l)if(Object.prototype.hasOwnProperty.call(l,h))a.push(h);return a},t.find=(l,a)=>{for(let h of l)if(a(h))return h;return},t.isInteger=typeof Number.isInteger==="function"?(l)=>Number.isInteger(l):(l)=>typeof l==="number"&&Number.isFinite(l)&&Math.floor(l)===l;function o(l,a=" | "){return l.map((h)=>typeof h==="string"?`'${h}'`:h).join(a)}t.joinValues=o,t.jsonStringifyReplacer=(l,a)=>{if(typeof a==="bigint")return a.toString();return a}})(M||(M={}));(function(t){t.mergeShapes=(n,b)=>{return{...n,...b}}})(ao||(ao={}));$=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var g,Cb=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},E;var Tt=x(()=>{St();g=M.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"]);E=class E extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(b)=>{this.issues=[...this.issues,b]},this.addIssues=(b=[])=>{this.issues=[...this.issues,...b]};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(l){return l.message},b={_errors:[]},o=(l)=>{for(let a of l.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)b._errors.push(n(a));else{let h=b,f=0;while(f<a.path.length){let r=a.path[f];if(f!==a.path.length-1)h[r]=h[r]||{_errors:[]};else h[r]=h[r]||{_errors:[]},h[r]._errors.push(n(a));h=h[r],f++}}};return o(this),b}static assert(t){if(!(t instanceof E))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},b=[];for(let o of this.issues)if(o.path.length>0){let l=o.path[0];n[l]=n[l]||[],n[l].push(t(o))}else b.push(t(o));return{formErrors:b,fieldErrors:n}}get formErrors(){return this.flatten()}};E.create=(t)=>{return new E(t)}});var yb=(t,n)=>{let b;switch(t.code){case g.invalid_type:if(t.received===$.undefined)b="Required";else b=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:b=`Invalid literal value, expected ${JSON.stringify(t.expected,M.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:b=`Unrecognized key(s) in object: ${M.joinValues(t.keys,", ")}`;break;case g.invalid_union:b="Invalid input";break;case g.invalid_union_discriminator:b=`Invalid discriminator value. Expected ${M.joinValues(t.options)}`;break;case g.invalid_enum_value:b=`Invalid enum value. Expected ${M.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:b="Invalid function arguments";break;case g.invalid_return_type:b="Invalid function return type";break;case g.invalid_date:b="Invalid date";break;case g.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(b=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")b=`${b} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)b=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)b=`Invalid input: must end with "${t.validation.endsWith}"`;else M.assertNever(t.validation);else if(t.validation!=="regex")b=`Invalid ${t.validation}`;else b="Invalid";break;case g.too_small:if(t.type==="array")b=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")b=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")b=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")b=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")b=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else b="Invalid input";break;case g.too_big:if(t.type==="array")b=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")b=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")b=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")b=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")b=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else b="Invalid input";break;case g.custom:b="Invalid input";break;case g.invalid_intersection_types:b="Intersection results could not be merged";break;case g.not_multiple_of:b=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:b="Number must be finite";break;default:b=n.defaultError,M.assertNever(t)}return{message:b}},P;var ho=x(()=>{Tt();St();P=yb});function eb(t){Vo=t}function ct(){return Vo}var Vo;var Ct=x(()=>{ho();Vo=P});function w(t,n){let b=ct(),o=Ft({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,b,b===P?void 0:P].filter((l)=>!!l)});t.common.issues.push(o)}class F{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 b=[];for(let o of n){if(o.status==="aborted")return q;if(o.status==="dirty")t.dirty();b.push(o.value)}return{status:t.value,value:b}}static async mergeObjectAsync(t,n){let b=[];for(let o of n){let l=await o.key,a=await o.value;b.push({key:l,value:a})}return F.mergeObjectSync(t,b)}static mergeObjectSync(t,n){let b={};for(let o of n){let{key:l,value:a}=o;if(l.status==="aborted")return q;if(a.status==="aborted")return q;if(l.status==="dirty")t.dirty();if(a.status==="dirty")t.dirty();if(l.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet))b[l.value]=a.value}return{status:t.value,value:b}}}var Ft=(t)=>{let{data:n,path:b,errorMaps:o,issueData:l}=t,a=[...b,...l.path||[]],h={...l,path:a};if(l.message!==void 0)return{...l,path:a,message:l.message};let f="",r=o.filter((A)=>!!A).slice().reverse();for(let A of r)f=A(h,{data:n,defaultError:f}).message;return{...l,path:a,message:f}},Zb,q,lt=(t)=>({status:"dirty",value:t}),R=(t)=>({status:"valid",value:t}),yt=(t)=>t.status==="aborted",et=(t)=>t.status==="dirty",e=(t)=>t.status==="valid",vt=(t)=>typeof Promise<"u"&&t instanceof Promise;var fo=x(()=>{Ct();ho();Zb=[];q=Object.freeze({status:"aborted"})});var No=()=>{};var d;var Ko=x(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(d||(d={}))});class p{constructor(t,n,b,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=b,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 H(t){if(!t)return{};let{errorMap:n,invalid_type_error:b,required_error:o,description:l}=t;if(n&&(b||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:l};return{errorMap:(h,f)=>{let{message:r}=t;if(h.code==="invalid_enum_value")return{message:r??f.defaultError};if(typeof f.data>"u")return{message:r??o??f.defaultError};if(h.code!=="invalid_type")return{message:f.defaultError};return{message:r??b??f.defaultError}},description:l}}class Y{get description(){return this._def.description}_getType(t){return V(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:V(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new F,ctx:{common:t.parent.common,data:t.data,parsedType:V(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(vt(n))throw Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let b=this.safeParse(t,n);if(b.success)return b.data;throw b.error}safeParse(t,n){let b={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:V(t)},o=this._parseSync({data:t,path:b.path,parent:b});return jo(b,o)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:V(t)};if(!this["~standard"].async)try{let b=this._parseSync({data:t,path:[],parent:n});return e(b)?{value:b.value}:{issues:n.common.issues}}catch(b){if(b?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then((b)=>e(b)?{value:b.value}:{issues:n.common.issues})}async parseAsync(t,n){let b=await this.safeParseAsync(t,n);if(b.success)return b.data;throw b.error}async safeParseAsync(t,n){let b={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:V(t)},o=this._parse({data:t,path:b.path,parent:b}),l=await(vt(o)?o:Promise.resolve(o));return jo(b,l)}refine(t,n){let b=(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,l)=>{let a=t(o),h=()=>l.addIssue({code:g.custom,...b(o)});if(typeof Promise<"u"&&a instanceof Promise)return a.then((f)=>{if(!f)return h(),!1;else return!0});if(!a)return h(),!1;else return!0})}refinement(t,n){return this._refinement((b,o)=>{if(!t(b))return o.addIssue(typeof n==="function"?n(b,o):n),!1;else return!0})}_refinement(t){return new u({schema:this,typeName:k.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 m.create(this,this._def)}nullable(){return C.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return rt.create(this,this._def)}or(t){return qt.create([this,t],this._def)}and(t){return kt.create(this,t,this._def)}transform(t){return new u({...H(this._def),schema:this,typeName:k.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new it({...H(this._def),innerType:this,defaultValue:n,typeName:k.ZodDefault})}brand(){return new st({typeName:k.ZodBranded,type:this,...H(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new Lt({...H(this._def),innerType:this,catchValue:n,typeName:k.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Wt.create(this,t)}readonly(){return Mt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function To(t){let n="[0-5]\\d";if(t.precision)n=`${n}\\.\\d{${t.precision}}`;else if(t.precision==null)n=`${n}(\\.\\d+)?`;let b=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${b}`}function _l(t){return new RegExp(`^${To(t)}$`)}function Co(t){let n=`${Po}T${To(t)}`,b=[];if(b.push(t.local?"Z?":"Z"),t.offset)b.push("([+-]\\d{2}:?\\d{2})");return n=`${n}(${b.join("|")})`,new RegExp(`^${n}$`)}function Al(t,n){if((n==="v4"||!n)&&fl.test(t))return!0;if((n==="v6"||!n)&&gl.test(t))return!0;return!1}function dl(t,n){if(!bl.test(t))return!1;try{let[b]=t.split(".");if(!b)return!1;let o=b.replace(/-/g,"+").replace(/_/g,"/").padEnd(b.length+(4-b.length%4)%4,"="),l=JSON.parse(atob(o));if(typeof l!=="object"||l===null)return!1;if("typ"in l&&l?.typ!=="JWT")return!1;if(!l.alg)return!1;if(n&&l.alg!==n)return!1;return!0}catch{return!1}}function xl(t,n){if((n==="v4"||!n)&&rl.test(t))return!0;if((n==="v6"||!n)&&$l.test(t))return!0;return!1}function ql(t,n){let b=(t.toString().split(".")[1]||"").length,o=(n.toString().split(".")[1]||"").length,l=b>o?b:o,a=Number.parseInt(t.toFixed(l).replace(".","")),h=Number.parseInt(n.toFixed(l).replace(".",""));return a%h/10**l}function wt(t){if(t instanceof J){let n={};for(let b in t.shape){let o=t.shape[b];n[b]=m.create(wt(o))}return new J({...t._def,shape:()=>n})}else if(t instanceof W)return new W({...t._def,type:wt(t.element)});else if(t instanceof m)return m.create(wt(t.unwrap()));else if(t instanceof C)return C.create(wt(t.unwrap()));else if(t instanceof K)return K.create(t.items.map((n)=>wt(n)));else return t}function go(t,n){let b=V(t),o=V(n);if(t===n)return{valid:!0,data:t};else if(b===$.object&&o===$.object){let l=M.objectKeys(n),a=M.objectKeys(t).filter((f)=>l.indexOf(f)!==-1),h={...t,...n};for(let f of a){let r=go(t[f],n[f]);if(!r.valid)return{valid:!1};h[f]=r.data}return{valid:!0,data:h}}else if(b===$.array&&o===$.array){if(t.length!==n.length)return{valid:!1};let l=[];for(let a=0;a<t.length;a++){let h=t[a],f=n[a],r=go(h,f);if(!r.valid)return{valid:!1};l.push(r.data)}return{valid:!0,data:l}}else if(b===$.date&&o===$.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function yo(t,n){return new tt({values:t,typeName:k.ZodEnum,...H(n)})}function Io(t,n){let b=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof b==="string"?{message:b}:b}function eo(t,n={},b){if(t)return ht.create().superRefine((o,l)=>{let a=t(o);if(a instanceof Promise)return a.then((h)=>{if(!h){let f=Io(n,o),r=f.fatal??b??!0;l.addIssue({code:"custom",...f,fatal:r})}});if(!a){let h=Io(n,o),f=h.fatal??b??!0;l.addIssue({code:"custom",...h,fatal:f})}return});return ht.create()}var jo=(t,n)=>{if(e(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 b=new E(t.common.issues);return this._error=b,this._error}}}},sb,zb,tl,nl,ol,bl,ll,al,hl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ro,fl,rl,gl,$l,cl,vl,Po="((\\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])))",wl,O,s,z,At,at,Rt,dt,xt,ht,Z,N,Bt,W,J,qt,T=(t)=>{if(t instanceof Ht)return T(t.schema);else if(t instanceof u)return T(t.innerType());else if(t instanceof Yt)return[t.value];else if(t instanceof tt)return t.options;else if(t instanceof Xt)return M.objectValues(t.enum);else if(t instanceof it)return T(t._def.innerType);else if(t instanceof dt)return[void 0];else if(t instanceof xt)return[null];else if(t instanceof m)return[void 0,...T(t.unwrap())];else if(t instanceof C)return[null,...T(t.unwrap())];else if(t instanceof st)return T(t.unwrap());else if(t instanceof Mt)return T(t.unwrap());else if(t instanceof Lt)return T(t._def.innerType);else return[]},Zt,kt,K,Dt,Et,ft,_t,Ht,Yt,tt,Xt,rt,u,m,C,it,Lt,Ot,kl,st,Wt,Mt,Hl,k,Yl=(t,n={message:`Input not instance of ${t.name}`})=>eo((b)=>b instanceof t,n),Zo,so,Xl,il,zo,Ll,Ml,Ql,Jl,Gl,Sl,Fl,Rl,Bl,Dl,El,Ol,Wl,ml,pl,ul,Ul,Vl,Nl,Kl,jl,Il,Pl,Tl,Cl,yl,el,Zl,sl,zl=()=>Zo().optional(),ta=()=>so().optional(),na=()=>zo().optional(),oa,ba;var t0=x(()=>{Tt();Ct();Ko();fo();St();sb=/^c[^\s-]{8,}$/i,zb=/^[0-9a-z]+$/,tl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nl=/^[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,ol=/^[a-z0-9_-]{21}$/i,bl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ll=/^[-+]?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)?)??$/,al=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fl=/^(?:(?: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])$/,rl=/^(?:(?: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])$/,gl=/^(([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]))$/,$l=/^(([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])$/,cl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wl=new RegExp(`^${Po}$`);O=class O extends Y{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==$.string){let l=this._getOrReturnCtx(t);return w(l,{code:g.invalid_type,expected:$.string,received:l.parsedType}),q}let b=new F,o=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.length<l.value)o=this._getOrReturnCtx(t,o),w(o,{code:g.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="max"){if(t.data.length>l.value)o=this._getOrReturnCtx(t,o),w(o,{code:g.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="length"){let a=t.data.length>l.value,h=t.data.length<l.value;if(a||h){if(o=this._getOrReturnCtx(t,o),a)w(o,{code:g.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});else if(h)w(o,{code:g.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});b.dirty()}}else if(l.kind==="email"){if(!al.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"email",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="emoji"){if(!ro)ro=new RegExp(hl,"u");if(!ro.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"emoji",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="uuid"){if(!nl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"uuid",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="nanoid"){if(!ol.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"nanoid",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="cuid"){if(!sb.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"cuid",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="cuid2"){if(!zb.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"cuid2",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="ulid"){if(!tl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"ulid",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),w(o,{validation:"url",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="regex"){if(l.regex.lastIndex=0,!l.regex.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"regex",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="trim")t.data=t.data.trim();else if(l.kind==="includes"){if(!t.data.includes(l.value,l.position))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),b.dirty()}else if(l.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(l.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(l.kind==="startsWith"){if(!t.data.startsWith(l.value))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:{startsWith:l.value},message:l.message}),b.dirty()}else if(l.kind==="endsWith"){if(!t.data.endsWith(l.value))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:{endsWith:l.value},message:l.message}),b.dirty()}else if(l.kind==="datetime"){if(!Co(l).test(t.data))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:"datetime",message:l.message}),b.dirty()}else if(l.kind==="date"){if(!wl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:"date",message:l.message}),b.dirty()}else if(l.kind==="time"){if(!_l(l).test(t.data))o=this._getOrReturnCtx(t,o),w(o,{code:g.invalid_string,validation:"time",message:l.message}),b.dirty()}else if(l.kind==="duration"){if(!ll.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"duration",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="ip"){if(!Al(t.data,l.version))o=this._getOrReturnCtx(t,o),w(o,{validation:"ip",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="jwt"){if(!dl(t.data,l.alg))o=this._getOrReturnCtx(t,o),w(o,{validation:"jwt",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="cidr"){if(!xl(t.data,l.version))o=this._getOrReturnCtx(t,o),w(o,{validation:"cidr",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="base64"){if(!cl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"base64",code:g.invalid_string,message:l.message}),b.dirty()}else if(l.kind==="base64url"){if(!vl.test(t.data))o=this._getOrReturnCtx(t,o),w(o,{validation:"base64url",code:g.invalid_string,message:l.message}),b.dirty()}else M.assertNever(l);return{status:b.value,value:t.data}}_regex(t,n,b){return this.refinement((o)=>t.test(o),{validation:n,code:g.invalid_string,...d.errToObj(b)})}_addCheck(t){return new O({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...d.errToObj(t)})}url(t){return this._addCheck({kind:"url",...d.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...d.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...d.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...d.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...d.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...d.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...d.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...d.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...d.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...d.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...d.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...d.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,...d.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,...d.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...d.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...d.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...d.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...d.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...d.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...d.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...d.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...d.errToObj(n)})}nonempty(t){return this.min(1,d.errToObj(t))}trim(){return new O({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new O({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new O({...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}};O.create=(t)=>{return new O({checks:[],typeName:k.ZodString,coerce:t?.coerce??!1,...H(t)})};s=class s extends Y{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)!==$.number){let l=this._getOrReturnCtx(t);return w(l,{code:g.invalid_type,expected:$.number,received:l.parsedType}),q}let b=void 0,o=new F;for(let l of this._def.checks)if(l.kind==="int"){if(!M.isInteger(t.data))b=this._getOrReturnCtx(t,b),w(b,{code:g.invalid_type,expected:"integer",received:"float",message:l.message}),o.dirty()}else if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)b=this._getOrReturnCtx(t,b),w(b,{code:g.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)b=this._getOrReturnCtx(t,b),w(b,{code:g.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="multipleOf"){if(ql(t.data,l.value)!==0)b=this._getOrReturnCtx(t,b),w(b,{code:g.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()}else if(l.kind==="finite"){if(!Number.isFinite(t.data))b=this._getOrReturnCtx(t,b),w(b,{code:g.not_finite,message:l.message}),o.dirty()}else M.assertNever(l);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,d.toString(n))}gt(t,n){return this.setLimit("min",t,!1,d.toString(n))}lte(t,n){return this.setLimit("max",t,!0,d.toString(n))}lt(t,n){return this.setLimit("max",t,!1,d.toString(n))}setLimit(t,n,b,o){return new s({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:b,message:d.toString(o)}]})}_addCheck(t){return new s({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:d.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:d.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:d.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:d.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:d.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:d.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:d.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:d.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:d.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"&&M.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let b of this._def.checks)if(b.kind==="finite"||b.kind==="int"||b.kind==="multipleOf")return!0;else if(b.kind==="min"){if(n===null||b.value>n)n=b.value}else if(b.kind==="max"){if(t===null||b.value<t)t=b.value}return Number.isFinite(n)&&Number.isFinite(t)}};s.create=(t)=>{return new s({checks:[],typeName:k.ZodNumber,coerce:t?.coerce||!1,...H(t)})};z=class z extends Y{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)!==$.bigint)return this._getInvalidInput(t);let b=void 0,o=new F;for(let l of this._def.checks)if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)b=this._getOrReturnCtx(t,b),w(b,{code:g.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)b=this._getOrReturnCtx(t,b),w(b,{code:g.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()}else if(l.kind==="multipleOf"){if(t.data%l.value!==BigInt(0))b=this._getOrReturnCtx(t,b),w(b,{code:g.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()}else M.assertNever(l);return{status:o.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return w(n,{code:g.invalid_type,expected:$.bigint,received:n.parsedType}),q}gte(t,n){return this.setLimit("min",t,!0,d.toString(n))}gt(t,n){return this.setLimit("min",t,!1,d.toString(n))}lte(t,n){return this.setLimit("max",t,!0,d.toString(n))}lt(t,n){return this.setLimit("max",t,!1,d.toString(n))}setLimit(t,n,b,o){return new z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:b,message:d.toString(o)}]})}_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:d.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:d.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:d.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:d.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:d.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:k.ZodBigInt,coerce:t?.coerce??!1,...H(t)})};At=class At extends Y{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==$.boolean){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.boolean,received:b.parsedType}),q}return R(t.data)}};At.create=(t)=>{return new At({typeName:k.ZodBoolean,coerce:t?.coerce||!1,...H(t)})};at=class at extends Y{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==$.date){let l=this._getOrReturnCtx(t);return w(l,{code:g.invalid_type,expected:$.date,received:l.parsedType}),q}if(Number.isNaN(t.data.getTime())){let l=this._getOrReturnCtx(t);return w(l,{code:g.invalid_date}),q}let b=new F,o=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.getTime()<l.value)o=this._getOrReturnCtx(t,o),w(o,{code:g.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),b.dirty()}else if(l.kind==="max"){if(t.data.getTime()>l.value)o=this._getOrReturnCtx(t,o),w(o,{code:g.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),b.dirty()}else M.assertNever(l);return{status:b.value,value:new Date(t.data.getTime())}}_addCheck(t){return new at({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:d.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:d.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}};at.create=(t)=>{return new at({checks:[],coerce:t?.coerce||!1,typeName:k.ZodDate,...H(t)})};Rt=class Rt extends Y{_parse(t){if(this._getType(t)!==$.symbol){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.symbol,received:b.parsedType}),q}return R(t.data)}};Rt.create=(t)=>{return new Rt({typeName:k.ZodSymbol,...H(t)})};dt=class dt extends Y{_parse(t){if(this._getType(t)!==$.undefined){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.undefined,received:b.parsedType}),q}return R(t.data)}};dt.create=(t)=>{return new dt({typeName:k.ZodUndefined,...H(t)})};xt=class xt extends Y{_parse(t){if(this._getType(t)!==$.null){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.null,received:b.parsedType}),q}return R(t.data)}};xt.create=(t)=>{return new xt({typeName:k.ZodNull,...H(t)})};ht=class ht extends Y{constructor(){super(...arguments);this._any=!0}_parse(t){return R(t.data)}};ht.create=(t)=>{return new ht({typeName:k.ZodAny,...H(t)})};Z=class Z extends Y{constructor(){super(...arguments);this._unknown=!0}_parse(t){return R(t.data)}};Z.create=(t)=>{return new Z({typeName:k.ZodUnknown,...H(t)})};N=class N extends Y{_parse(t){let n=this._getOrReturnCtx(t);return w(n,{code:g.invalid_type,expected:$.never,received:n.parsedType}),q}};N.create=(t)=>{return new N({typeName:k.ZodNever,...H(t)})};Bt=class Bt extends Y{_parse(t){if(this._getType(t)!==$.undefined){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.void,received:b.parsedType}),q}return R(t.data)}};Bt.create=(t)=>{return new Bt({typeName:k.ZodVoid,...H(t)})};W=class W extends Y{_parse(t){let{ctx:n,status:b}=this._processInputParams(t),o=this._def;if(n.parsedType!==$.array)return w(n,{code:g.invalid_type,expected:$.array,received:n.parsedType}),q;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,h=n.data.length<o.exactLength.value;if(a||h)w(n,{code:a?g.too_big:g.too_small,minimum:h?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),b.dirty()}if(o.minLength!==null){if(n.data.length<o.minLength.value)w(n,{code:g.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),b.dirty()}if(o.maxLength!==null){if(n.data.length>o.maxLength.value)w(n,{code:g.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),b.dirty()}if(n.common.async)return Promise.all([...n.data].map((a,h)=>{return o.type._parseAsync(new p(n,a,n.path,h))})).then((a)=>{return F.mergeArray(b,a)});let l=[...n.data].map((a,h)=>{return o.type._parseSync(new p(n,a,n.path,h))});return F.mergeArray(b,l)}get element(){return this._def.type}min(t,n){return new W({...this._def,minLength:{value:t,message:d.toString(n)}})}max(t,n){return new W({...this._def,maxLength:{value:t,message:d.toString(n)}})}length(t,n){return new W({...this._def,exactLength:{value:t,message:d.toString(n)}})}nonempty(t){return this.min(1,t)}};W.create=(t,n)=>{return new W({type:t,minLength:null,maxLength:null,exactLength:null,typeName:k.ZodArray,...H(n)})};J=class J extends Y{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=M.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$.object){let r=this._getOrReturnCtx(t);return w(r,{code:g.invalid_type,expected:$.object,received:r.parsedType}),q}let{status:b,ctx:o}=this._processInputParams(t),{shape:l,keys:a}=this._getCached(),h=[];if(!(this._def.catchall instanceof N&&this._def.unknownKeys==="strip")){for(let r in o.data)if(!a.includes(r))h.push(r)}let f=[];for(let r of a){let A=l[r],L=o.data[r];f.push({key:{status:"valid",value:r},value:A._parse(new p(o,L,o.path,r)),alwaysSet:r in o.data})}if(this._def.catchall instanceof N){let r=this._def.unknownKeys;if(r==="passthrough")for(let A of h)f.push({key:{status:"valid",value:A},value:{status:"valid",value:o.data[A]}});else if(r==="strict"){if(h.length>0)w(o,{code:g.unrecognized_keys,keys:h}),b.dirty()}else if(r==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let r=this._def.catchall;for(let A of h){let L=o.data[A];f.push({key:{status:"valid",value:A},value:r._parse(new p(o,L,o.path,A)),alwaysSet:A in o.data})}}if(o.common.async)return Promise.resolve().then(async()=>{let r=[];for(let A of f){let L=await A.key,S=await A.value;r.push({key:L,value:S,alwaysSet:A.alwaysSet})}return r}).then((r)=>{return F.mergeObjectSync(b,r)});else return F.mergeObjectSync(b,f)}get shape(){return this._def.shape()}strict(t){return d.errToObj,new J({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,b)=>{let o=this._def.errorMap?.(n,b).message??b.defaultError;if(n.code==="unrecognized_keys")return{message:d.errToObj(t).message??o};return{message:o}}}:{}})}strip(){return new J({...this._def,unknownKeys:"strip"})}passthrough(){return new J({...this._def,unknownKeys:"passthrough"})}extend(t){return new J({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new J({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:k.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new J({...this._def,catchall:t})}pick(t){let n={};for(let b of M.objectKeys(t))if(t[b]&&this.shape[b])n[b]=this.shape[b];return new J({...this._def,shape:()=>n})}omit(t){let n={};for(let b of M.objectKeys(this.shape))if(!t[b])n[b]=this.shape[b];return new J({...this._def,shape:()=>n})}deepPartial(){return wt(this)}partial(t){let n={};for(let b of M.objectKeys(this.shape)){let o=this.shape[b];if(t&&!t[b])n[b]=o;else n[b]=o.optional()}return new J({...this._def,shape:()=>n})}required(t){let n={};for(let b of M.objectKeys(this.shape))if(t&&!t[b])n[b]=this.shape[b];else{let l=this.shape[b];while(l instanceof m)l=l._def.innerType;n[b]=l}return new J({...this._def,shape:()=>n})}keyof(){return yo(M.objectKeys(this.shape))}};J.create=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strip",catchall:N.create(),typeName:k.ZodObject,...H(n)})};J.strictCreate=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strict",catchall:N.create(),typeName:k.ZodObject,...H(n)})};J.lazycreate=(t,n)=>{return new J({shape:t,unknownKeys:"strip",catchall:N.create(),typeName:k.ZodObject,...H(n)})};qt=class qt extends Y{_parse(t){let{ctx:n}=this._processInputParams(t),b=this._def.options;function o(l){for(let h of l)if(h.result.status==="valid")return h.result;for(let h of l)if(h.result.status==="dirty")return n.common.issues.push(...h.ctx.common.issues),h.result;let a=l.map((h)=>new E(h.ctx.common.issues));return w(n,{code:g.invalid_union,unionErrors:a}),q}if(n.common.async)return Promise.all(b.map(async(l)=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);else{let l=void 0,a=[];for(let f of b){let r={...n,common:{...n.common,issues:[]},parent:null},A=f._parseSync({data:n.data,path:n.path,parent:r});if(A.status==="valid")return A;else if(A.status==="dirty"&&!l)l={result:A,ctx:r};if(r.common.issues.length)a.push(r.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;let h=a.map((f)=>new E(f));return w(n,{code:g.invalid_union,unionErrors:h}),q}}get options(){return this._def.options}};qt.create=(t,n)=>{return new qt({options:t,typeName:k.ZodUnion,...H(n)})};Zt=class Zt extends Y{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.object)return w(n,{code:g.invalid_type,expected:$.object,received:n.parsedType}),q;let b=this.discriminator,o=n.data[b],l=this.optionsMap.get(o);if(!l)return w(n,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[b]}),q;if(n.common.async)return l._parseAsync({data:n.data,path:n.path,parent:n});else return l._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,b){let o=new Map;for(let l of n){let a=T(l.shape[t]);if(!a.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let h of a){if(o.has(h))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(h)}`);o.set(h,l)}}return new Zt({typeName:k.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...H(b)})}};kt=class kt extends Y{_parse(t){let{status:n,ctx:b}=this._processInputParams(t),o=(l,a)=>{if(yt(l)||yt(a))return q;let h=go(l.value,a.value);if(!h.valid)return w(b,{code:g.invalid_intersection_types}),q;if(et(l)||et(a))n.dirty();return{status:n.value,value:h.data}};if(b.common.async)return Promise.all([this._def.left._parseAsync({data:b.data,path:b.path,parent:b}),this._def.right._parseAsync({data:b.data,path:b.path,parent:b})]).then(([l,a])=>o(l,a));else return o(this._def.left._parseSync({data:b.data,path:b.path,parent:b}),this._def.right._parseSync({data:b.data,path:b.path,parent:b}))}};kt.create=(t,n,b)=>{return new kt({left:t,right:n,typeName:k.ZodIntersection,...H(b)})};K=class K extends Y{_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.parsedType!==$.array)return w(b,{code:g.invalid_type,expected:$.array,received:b.parsedType}),q;if(b.data.length<this._def.items.length)return w(b,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;if(!this._def.rest&&b.data.length>this._def.items.length)w(b,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let l=[...b.data].map((a,h)=>{let f=this._def.items[h]||this._def.rest;if(!f)return null;return f._parse(new p(b,a,b.path,h))}).filter((a)=>!!a);if(b.common.async)return Promise.all(l).then((a)=>{return F.mergeArray(n,a)});else return F.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new K({...this._def,rest:t})}};K.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new K({items:t,typeName:k.ZodTuple,rest:null,...H(n)})};Dt=class Dt extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.parsedType!==$.object)return w(b,{code:g.invalid_type,expected:$.object,received:b.parsedType}),q;let o=[],l=this._def.keyType,a=this._def.valueType;for(let h in b.data)o.push({key:l._parse(new p(b,h,b.path,h)),value:a._parse(new p(b,b.data[h],b.path,h)),alwaysSet:h in b.data});if(b.common.async)return F.mergeObjectAsync(n,o);else return F.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,b){if(n instanceof Y)return new Dt({keyType:t,valueType:n,typeName:k.ZodRecord,...H(b)});return new Dt({keyType:O.create(),valueType:t,typeName:k.ZodRecord,...H(n)})}};Et=class Et extends Y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.parsedType!==$.map)return w(b,{code:g.invalid_type,expected:$.map,received:b.parsedType}),q;let o=this._def.keyType,l=this._def.valueType,a=[...b.data.entries()].map(([h,f],r)=>{return{key:o._parse(new p(b,h,b.path,[r,"key"])),value:l._parse(new p(b,f,b.path,[r,"value"]))}});if(b.common.async){let h=new Map;return Promise.resolve().then(async()=>{for(let f of a){let r=await f.key,A=await f.value;if(r.status==="aborted"||A.status==="aborted")return q;if(r.status==="dirty"||A.status==="dirty")n.dirty();h.set(r.value,A.value)}return{status:n.value,value:h}})}else{let h=new Map;for(let f of a){let{key:r,value:A}=f;if(r.status==="aborted"||A.status==="aborted")return q;if(r.status==="dirty"||A.status==="dirty")n.dirty();h.set(r.value,A.value)}return{status:n.value,value:h}}}};Et.create=(t,n,b)=>{return new Et({valueType:n,keyType:t,typeName:k.ZodMap,...H(b)})};ft=class ft extends Y{_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.parsedType!==$.set)return w(b,{code:g.invalid_type,expected:$.set,received:b.parsedType}),q;let o=this._def;if(o.minSize!==null){if(b.data.size<o.minSize.value)w(b,{code:g.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()}if(o.maxSize!==null){if(b.data.size>o.maxSize.value)w(b,{code:g.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty()}let l=this._def.valueType;function a(f){let r=new Set;for(let A of f){if(A.status==="aborted")return q;if(A.status==="dirty")n.dirty();r.add(A.value)}return{status:n.value,value:r}}let h=[...b.data.values()].map((f,r)=>l._parse(new p(b,f,b.path,r)));if(b.common.async)return Promise.all(h).then((f)=>a(f));else return a(h)}min(t,n){return new ft({...this._def,minSize:{value:t,message:d.toString(n)}})}max(t,n){return new ft({...this._def,maxSize:{value:t,message:d.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};ft.create=(t,n)=>{return new ft({valueType:t,minSize:null,maxSize:null,typeName:k.ZodSet,...H(n)})};_t=class _t extends Y{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.function)return w(n,{code:g.invalid_type,expected:$.function,received:n.parsedType}),q;function b(h,f){return Ft({data:h,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ct(),P].filter((r)=>!!r),issueData:{code:g.invalid_arguments,argumentsError:f}})}function o(h,f){return Ft({data:h,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ct(),P].filter((r)=>!!r),issueData:{code:g.invalid_return_type,returnTypeError:f}})}let l={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof rt){let h=this;return R(async function(...f){let r=new E([]),A=await h._def.args.parseAsync(f,l).catch((G)=>{throw r.addIssue(b(f,G)),r}),L=await Reflect.apply(a,this,A);return await h._def.returns._def.type.parseAsync(L,l).catch((G)=>{throw r.addIssue(o(L,G)),r})})}else{let h=this;return R(function(...f){let r=h._def.args.safeParse(f,l);if(!r.success)throw new E([b(f,r.error)]);let A=Reflect.apply(a,this,r.data),L=h._def.returns.safeParse(A,l);if(!L.success)throw new E([o(A,L.error)]);return L.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new _t({...this._def,args:K.create(t).rest(Z.create())})}returns(t){return new _t({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,b){return new _t({args:t?t:K.create([]).rest(Z.create()),returns:n||Z.create(),typeName:k.ZodFunction,...H(b)})}};Ht=class Ht extends Y{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})}};Ht.create=(t,n)=>{return new Ht({getter:t,typeName:k.ZodLazy,...H(n)})};Yt=class Yt extends Y{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return w(n,{received:n.data,code:g.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}};Yt.create=(t,n)=>{return new Yt({value:t,typeName:k.ZodLiteral,...H(n)})};tt=class tt extends Y{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),b=this._def.values;return w(n,{expected:M.joinValues(b),received:n.parsedType,code:g.invalid_type}),q}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),b=this._def.values;return w(n,{received:n.data,code:g.invalid_enum_value,options:b}),q}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((b)=>!t.includes(b)),{...this._def,...n})}};tt.create=yo;Xt=class Xt extends Y{_parse(t){let n=M.getValidEnumValues(this._def.values),b=this._getOrReturnCtx(t);if(b.parsedType!==$.string&&b.parsedType!==$.number){let o=M.objectValues(n);return w(b,{expected:M.joinValues(o),received:b.parsedType,code:g.invalid_type}),q}if(!this._cache)this._cache=new Set(M.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let o=M.objectValues(n);return w(b,{received:b.data,code:g.invalid_enum_value,options:o}),q}return R(t.data)}get enum(){return this._def.values}};Xt.create=(t,n)=>{return new Xt({values:t,typeName:k.ZodNativeEnum,...H(n)})};rt=class rt extends Y{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.promise&&n.common.async===!1)return w(n,{code:g.invalid_type,expected:$.promise,received:n.parsedType}),q;let b=n.parsedType===$.promise?n.data:Promise.resolve(n.data);return R(b.then((o)=>{return this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};rt.create=(t,n)=>{return new rt({type:t,typeName:k.ZodPromise,...H(n)})};u=class u extends Y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===k.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:b}=this._processInputParams(t),o=this._def.effect||null,l={addIssue:(a)=>{if(w(b,a),a.fatal)n.abort();else n.dirty()},get path(){return b.path}};if(l.addIssue=l.addIssue.bind(l),o.type==="preprocess"){let a=o.transform(b.data,l);if(b.common.async)return Promise.resolve(a).then(async(h)=>{if(n.value==="aborted")return q;let f=await this._def.schema._parseAsync({data:h,path:b.path,parent:b});if(f.status==="aborted")return q;if(f.status==="dirty")return lt(f.value);if(n.value==="dirty")return lt(f.value);return f});else{if(n.value==="aborted")return q;let h=this._def.schema._parseSync({data:a,path:b.path,parent:b});if(h.status==="aborted")return q;if(h.status==="dirty")return lt(h.value);if(n.value==="dirty")return lt(h.value);return h}}if(o.type==="refinement"){let a=(h)=>{let f=o.refinement(h,l);if(b.common.async)return Promise.resolve(f);if(f instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(b.common.async===!1){let h=this._def.schema._parseSync({data:b.data,path:b.path,parent:b});if(h.status==="aborted")return q;if(h.status==="dirty")n.dirty();return a(h.value),{status:n.value,value:h.value}}else return this._def.schema._parseAsync({data:b.data,path:b.path,parent:b}).then((h)=>{if(h.status==="aborted")return q;if(h.status==="dirty")n.dirty();return a(h.value).then(()=>{return{status:n.value,value:h.value}})})}if(o.type==="transform")if(b.common.async===!1){let a=this._def.schema._parseSync({data:b.data,path:b.path,parent:b});if(!e(a))return q;let h=o.transform(a.value,l);if(h instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:h}}else return this._def.schema._parseAsync({data:b.data,path:b.path,parent:b}).then((a)=>{if(!e(a))return q;return Promise.resolve(o.transform(a.value,l)).then((h)=>({status:n.value,value:h}))});M.assertNever(o)}};u.create=(t,n,b)=>{return new u({schema:t,typeName:k.ZodEffects,effect:n,...H(b)})};u.createWithPreprocess=(t,n,b)=>{return new u({schema:n,effect:{type:"preprocess",transform:t},typeName:k.ZodEffects,...H(b)})};m=class m extends Y{_parse(t){if(this._getType(t)===$.undefined)return R(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};m.create=(t,n)=>{return new m({innerType:t,typeName:k.ZodOptional,...H(n)})};C=class C extends Y{_parse(t){if(this._getType(t)===$.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:k.ZodNullable,...H(n)})};it=class it extends Y{_parse(t){let{ctx:n}=this._processInputParams(t),b=n.data;if(n.parsedType===$.undefined)b=this._def.defaultValue();return this._def.innerType._parse({data:b,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};it.create=(t,n)=>{return new it({innerType:t,typeName:k.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...H(n)})};Lt=class Lt extends Y{_parse(t){let{ctx:n}=this._processInputParams(t),b={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:b.data,path:b.path,parent:{...b}});if(vt(o))return o.then((l)=>{return{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new E(b.common.issues)},input:b.data})}});else return{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new E(b.common.issues)},input:b.data})}}removeCatch(){return this._def.innerType}};Lt.create=(t,n)=>{return new Lt({innerType:t,typeName:k.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...H(n)})};Ot=class Ot extends Y{_parse(t){if(this._getType(t)!==$.nan){let b=this._getOrReturnCtx(t);return w(b,{code:g.invalid_type,expected:$.nan,received:b.parsedType}),q}return{status:"valid",value:t.data}}};Ot.create=(t)=>{return new Ot({typeName:k.ZodNaN,...H(t)})};kl=Symbol("zod_brand");st=class st extends Y{_parse(t){let{ctx:n}=this._processInputParams(t),b=n.data;return this._def.type._parse({data:b,path:n.path,parent:n})}unwrap(){return this._def.type}};Wt=class Wt extends Y{_parse(t){let{status:n,ctx:b}=this._processInputParams(t);if(b.common.async)return(async()=>{let l=await this._def.in._parseAsync({data:b.data,path:b.path,parent:b});if(l.status==="aborted")return q;if(l.status==="dirty")return n.dirty(),lt(l.value);else return this._def.out._parseAsync({data:l.value,path:b.path,parent:b})})();else{let o=this._def.in._parseSync({data:b.data,path:b.path,parent:b});if(o.status==="aborted")return q;if(o.status==="dirty")return n.dirty(),{status:"dirty",value:o.value};else return this._def.out._parseSync({data:o.value,path:b.path,parent:b})}}static create(t,n){return new Wt({in:t,out:n,typeName:k.ZodPipeline})}};Mt=class Mt extends Y{_parse(t){let n=this._def.innerType._parse(t),b=(o)=>{if(e(o))o.value=Object.freeze(o.value);return o};return vt(n)?n.then((o)=>b(o)):b(n)}unwrap(){return this._def.innerType}};Mt.create=(t,n)=>{return new Mt({innerType:t,typeName:k.ZodReadonly,...H(n)})};Hl={object:J.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"})(k||(k={}));Zo=O.create,so=s.create,Xl=Ot.create,il=z.create,zo=At.create,Ll=at.create,Ml=Rt.create,Ql=dt.create,Jl=xt.create,Gl=ht.create,Sl=Z.create,Fl=N.create,Rl=Bt.create,Bl=W.create,Dl=J.create,El=J.strictCreate,Ol=qt.create,Wl=Zt.create,ml=kt.create,pl=K.create,ul=Dt.create,Ul=Et.create,Vl=ft.create,Nl=_t.create,Kl=Ht.create,jl=Yt.create,Il=tt.create,Pl=Xt.create,Tl=rt.create,Cl=u.create,yl=m.create,el=C.create,Zl=u.createWithPreprocess,sl=Wt.create,oa={string:(t)=>O.create({...t,coerce:!0}),number:(t)=>s.create({...t,coerce:!0}),boolean:(t)=>At.create({...t,coerce:!0}),bigint:(t)=>z.create({...t,coerce:!0}),date:(t)=>at.create({...t,coerce:!0})},ba=q});var v={};i(v,{void:()=>Rl,util:()=>M,unknown:()=>Sl,union:()=>Ol,undefined:()=>Ql,tuple:()=>pl,transformer:()=>Cl,symbol:()=>Ml,string:()=>Zo,strictObject:()=>El,setErrorMap:()=>eb,set:()=>Vl,record:()=>ul,quotelessJson:()=>Cb,promise:()=>Tl,preprocess:()=>Zl,pipeline:()=>sl,ostring:()=>zl,optional:()=>yl,onumber:()=>ta,oboolean:()=>na,objectUtil:()=>ao,object:()=>Dl,number:()=>so,nullable:()=>el,null:()=>Jl,never:()=>Fl,nativeEnum:()=>Pl,nan:()=>Xl,map:()=>Ul,makeIssue:()=>Ft,literal:()=>jl,lazy:()=>Kl,late:()=>Hl,isValid:()=>e,isDirty:()=>et,isAsync:()=>vt,isAborted:()=>yt,intersection:()=>ml,instanceof:()=>Yl,getParsedType:()=>V,getErrorMap:()=>ct,function:()=>Nl,enum:()=>Il,effect:()=>Cl,discriminatedUnion:()=>Wl,defaultErrorMap:()=>P,datetimeRegex:()=>Co,date:()=>Ll,custom:()=>eo,coerce:()=>oa,boolean:()=>zo,bigint:()=>il,array:()=>Bl,any:()=>Gl,addIssueToContext:()=>w,ZodVoid:()=>Bt,ZodUnknown:()=>Z,ZodUnion:()=>qt,ZodUndefined:()=>dt,ZodType:()=>Y,ZodTuple:()=>K,ZodTransformer:()=>u,ZodSymbol:()=>Rt,ZodString:()=>O,ZodSet:()=>ft,ZodSchema:()=>Y,ZodRecord:()=>Dt,ZodReadonly:()=>Mt,ZodPromise:()=>rt,ZodPipeline:()=>Wt,ZodParsedType:()=>$,ZodOptional:()=>m,ZodObject:()=>J,ZodNumber:()=>s,ZodNullable:()=>C,ZodNull:()=>xt,ZodNever:()=>N,ZodNativeEnum:()=>Xt,ZodNaN:()=>Ot,ZodMap:()=>Et,ZodLiteral:()=>Yt,ZodLazy:()=>Ht,ZodIssueCode:()=>g,ZodIntersection:()=>kt,ZodFunction:()=>_t,ZodFirstPartyTypeKind:()=>k,ZodError:()=>E,ZodEnum:()=>tt,ZodEffects:()=>u,ZodDiscriminatedUnion:()=>Zt,ZodDefault:()=>it,ZodDate:()=>at,ZodCatch:()=>Lt,ZodBranded:()=>st,ZodBoolean:()=>At,ZodBigInt:()=>z,ZodArray:()=>W,ZodAny:()=>ht,Schema:()=>Y,ParseStatus:()=>F,OK:()=>R,NEVER:()=>ba,INVALID:()=>q,EMPTY_PATH:()=>Zb,DIRTY:()=>lt,BRAND:()=>kl});var $o=x(()=>{Ct();fo();No();St();t0();Tt()});var n0=x(()=>{$o();$o()});function co(t,...n){if(la())return;(console[t]||console.log).call(console,...n)}var la=()=>Boolean(globalThis.__AFRICODE_TEST__||globalThis.__AFRICODE_SILENT_LOGS__);function zt(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(zt);let n={};for(let b of Object.keys(t))n[b]=zt(t[b]);return n}function l0(t,n){let b={...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]))b[o]=l0(t[o]||{},n[o]);else b[o]=n[o];return b}function a0(t={}){return b0=l0(o0,t),aa=!0,mt()}function mt(){return Object.freeze(zt(b0))}var o0,b0,aa=!1;var vo=x(()=>{o0={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}},b0=zt(o0)});class gt{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(b){if(b instanceof v.ZodError){let o={};return b.errors.forEach((l)=>{let a=l.path.join(".");o[a]=l.message}),{success:!1,errors:o}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(b){if(b instanceof v.ZodError)return{success:!1,error:b.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 j{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 f0(t,n){let b={...n},o=!1;try{o=mt().validation?.trimStrings===!0}catch{}for(let[l,a]of Object.entries(t)){if(!(a instanceof j))continue;let h=a.getMeta(),f=b[l];if(typeof f==="string"&&(h.trim||o))b[l]=f.trim();if(h.emptyAsNull&&b[l]==="")b[l]=null}return b}function r0(t){let n={};for(let[b,o]of Object.entries(t))if(o instanceof j)n[b]=o.build();else n[b]=o;return v.object(n)}var tn,U,h0;var nn=x(()=>{n0();vo();tn={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()})};U={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)};h0={url(t="Please enter a valid URL"){return new j(v.string().min(1,"URL cannot be empty").url(t),"url")},email(t="Please enter a valid email address"){return new j(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 j(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 j(n,"number")},phone(t="Please enter a valid phone number"){return new j(v.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),"phone")}}});function _(t,n){if(typeof customElements>"u")return;if(!customElements.get(t))customElements.define(t,n)}var fa,A0,c;var X=x(()=>{fa=globalThis.HTMLElement??class{},A0=typeof CSSStyleSheet<"u";c=class c extends fa{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
372
|
<style>
|
|
373
373
|
.af-local-error {
|
|
374
374
|
padding: 1rem;
|
|
@@ -387,7 +387,257 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
387
387
|
<span aria-hidden="true">⚠️</span>
|
|
388
388
|
<span>Failed to render</span>
|
|
389
389
|
</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(!
|
|
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(!A0)return;if(!(t instanceof CSSStyleSheet))return;if(!c.globalSheets.includes(t))c.globalSheets.push(t)}async loadStyles(t=""){if(!this.shadowRoot)return;let b=A0&&"adoptedStyleSheets"in this.shadowRoot,o=typeof t==="string"&&t.length>0?t:"/styles/africanity.css",l=typeof t==="string"&&t.length>0?t:null;if(c.styleCache.has(o)){let a=c.styleCache.get(o);if(b)this.shadowRoot.adoptedStyleSheets=[a,...c.globalSheets];else this._applyFallbackStyle(a?.cssText||a?.text||a||"");return}try{let a=l;if(!a){let h=await fetch("/styles/africanity.css");if(!h.ok)throw Error(`Unable to load stylesheet: ${h.status}`);a=await h.text()}if(b){let h=new CSSStyleSheet;h.replaceSync(a),c.styleCache.set(o,h),this.shadowRoot.adoptedStyleSheets=[h,...c.globalSheets];return}this._applyFallbackStyle(a),c.styleCache.set(o,{text:a})}catch(a){this._applyFallbackStyle(l||"")}}_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:b={},text:o=""}={}){let l=document.createElement(t);if(n.length)l.classList.add(...n);if(Object.entries(b).forEach(([a,h])=>l.setAttribute(a,h)),o)l.textContent=o;return l}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}}});var d0={};i(d0,{default:()=>ra,AfriUIButton:()=>ut});var ut,ra;var io=x(()=>{X();ut=class ut extends c{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",b=this.hasAttribute("disabled"),o=this.hasAttribute("loading"),l=this.getAttribute("aria-label")||"";this.shadowRoot.innerHTML=Q`
|
|
391
|
+
<style>
|
|
392
|
+
:host { display: inline-block; }
|
|
393
|
+
|
|
394
|
+
button {
|
|
395
|
+
all: unset;
|
|
396
|
+
box-sizing: border-box;
|
|
397
|
+
min-height: 42px;
|
|
398
|
+
padding: 0 18px;
|
|
399
|
+
border-radius: 999px;
|
|
400
|
+
font-family: 'Inter', system-ui, sans-serif;
|
|
401
|
+
font-weight: 600;
|
|
402
|
+
cursor: pointer;
|
|
403
|
+
display: inline-flex;
|
|
404
|
+
align-items: center;
|
|
405
|
+
justify-content: center;
|
|
406
|
+
gap: 0.5rem;
|
|
407
|
+
transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
|
|
408
|
+
text-decoration: none;
|
|
409
|
+
border: 1px solid transparent;
|
|
410
|
+
user-select: none;
|
|
411
|
+
white-space: nowrap;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
:host([full-width]) button { width: 100%; }
|
|
415
|
+
|
|
416
|
+
button.primary {
|
|
417
|
+
background: #2563eb;
|
|
418
|
+
color: #fff;
|
|
419
|
+
box-shadow: 0 8px 24px rgba(37, 99, 235, 0.24);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
button.primary:hover:not(:disabled) {
|
|
423
|
+
transform: translateY(-1px);
|
|
424
|
+
background: #1d4ed8;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
button.secondary {
|
|
428
|
+
background: #f8fafc;
|
|
429
|
+
color: #1f2937;
|
|
430
|
+
border-color: #cbd5e1;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
button.secondary:hover:not(:disabled) {
|
|
434
|
+
background: #e2e8f0;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
button.ghost {
|
|
438
|
+
background: transparent;
|
|
439
|
+
color: #0f172a;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
button.ghost:hover:not(:disabled) {
|
|
443
|
+
background: rgba(15, 23, 42, 0.05);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
button.link {
|
|
447
|
+
background: transparent;
|
|
448
|
+
color: #2563eb;
|
|
449
|
+
box-shadow: none;
|
|
450
|
+
padding: 0;
|
|
451
|
+
border-radius: 0;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
button.link:hover:not(:disabled) {
|
|
455
|
+
text-decoration: underline;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
button.size-sm { min-height: 34px; padding: 0 14px; font-size: 0.85rem; }
|
|
459
|
+
button.size-md { min-height: 42px; padding: 0 18px; font-size: 0.95rem; }
|
|
460
|
+
button.size-lg { min-height: 50px; padding: 0 22px; font-size: 1rem; }
|
|
461
|
+
|
|
462
|
+
button:disabled {
|
|
463
|
+
opacity: 0.55;
|
|
464
|
+
cursor: not-allowed;
|
|
465
|
+
transform: none;
|
|
466
|
+
box-shadow: none;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.spinner {
|
|
470
|
+
width: 18px;
|
|
471
|
+
height: 18px;
|
|
472
|
+
border: 2px solid currentColor;
|
|
473
|
+
border-bottom-color: transparent;
|
|
474
|
+
border-radius: 999px;
|
|
475
|
+
animation: spin 0.8s linear infinite;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
479
|
+
</style>
|
|
480
|
+
|
|
481
|
+
<button
|
|
482
|
+
class="${t} ${n}"
|
|
483
|
+
${b?"disabled":""}
|
|
484
|
+
${l?`aria-label="${l}"`:""}
|
|
485
|
+
${o?'aria-busy="true"':""}
|
|
486
|
+
>
|
|
487
|
+
${o?Q`<span class="spinner"></span>`:""}
|
|
488
|
+
<slot></slot>
|
|
489
|
+
</button>
|
|
490
|
+
`}};_("af-ui-button",ut);ra=ut});var x0={};i(x0,{default:()=>ga,AfriUICard:()=>Ut});var Ut,ga;var Lo=x(()=>{X();Ut=class Ut extends c{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"),b=this.hasAttribute("clickable");this.shadowRoot.innerHTML=Q`
|
|
491
|
+
<style>
|
|
492
|
+
:host { display: block; }
|
|
493
|
+
|
|
494
|
+
.card {
|
|
495
|
+
border-radius: 1rem;
|
|
496
|
+
padding: 1.5rem;
|
|
497
|
+
background: #ffffff;
|
|
498
|
+
color: #0f172a;
|
|
499
|
+
transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
|
|
500
|
+
border: 1px solid transparent;
|
|
501
|
+
box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.card.elevated { background: #fff; }
|
|
505
|
+
.card.flat { background: #f8fafc; box-shadow: none; }
|
|
506
|
+
.card.outlined { background: #fff; border-color: #e2e8f0; box-shadow: none; }
|
|
507
|
+
|
|
508
|
+
.card:hover:not(.disabled) {
|
|
509
|
+
transform: translateY(-2px);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
:host([bordered]) .card { border-color: #cbd5e1; }
|
|
513
|
+
|
|
514
|
+
:host([clickable]) .card { cursor: pointer; }
|
|
515
|
+
</style>
|
|
516
|
+
|
|
517
|
+
<article class="card ${t}">
|
|
518
|
+
<slot></slot>
|
|
519
|
+
</article>
|
|
520
|
+
`}};_("af-ui-card",Ut);ga=Ut});var q0={};i(q0,{default:()=>$a,AfriUIInput:()=>Vt});var Vt,$a;var Mo=x(()=>{X();Vt=class Vt extends c{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")||"",b=this.getAttribute("type")||"text",o=this.getAttribute("value")||"",l=this.hasAttribute("disabled"),a=this.getAttribute("error")||"";this.shadowRoot.innerHTML=Q`
|
|
521
|
+
<style>
|
|
522
|
+
:host { display: block; font-family: 'Inter', system-ui, sans-serif; }
|
|
523
|
+
|
|
524
|
+
label {
|
|
525
|
+
display: block;
|
|
526
|
+
font-size: 0.85rem;
|
|
527
|
+
font-weight: 600;
|
|
528
|
+
margin-bottom: 0.5rem;
|
|
529
|
+
color: #111827;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.field {
|
|
533
|
+
display: grid;
|
|
534
|
+
gap: 0.45rem;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
input {
|
|
538
|
+
width: 100%;
|
|
539
|
+
border: 1px solid #d1d5db;
|
|
540
|
+
border-radius: 0.75rem;
|
|
541
|
+
padding: 0.95rem 1rem;
|
|
542
|
+
font-size: 0.95rem;
|
|
543
|
+
color: #111827;
|
|
544
|
+
background: #ffffff;
|
|
545
|
+
transition: border-color 150ms ease, box-shadow 150ms ease;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
input:focus {
|
|
549
|
+
outline: none;
|
|
550
|
+
border-color: #2563eb;
|
|
551
|
+
box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
input:disabled {
|
|
555
|
+
opacity: 0.65;
|
|
556
|
+
cursor: not-allowed;
|
|
557
|
+
background: #f8fafc;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.error {
|
|
561
|
+
color: #dc2626;
|
|
562
|
+
font-size: 0.8rem;
|
|
563
|
+
min-height: 1rem;
|
|
564
|
+
}
|
|
565
|
+
</style>
|
|
566
|
+
|
|
567
|
+
<div class="field">
|
|
568
|
+
${t?Q`<label>${t}</label>`:""}
|
|
569
|
+
<input
|
|
570
|
+
type="${b}"
|
|
571
|
+
placeholder="${n}"
|
|
572
|
+
value="${o}"
|
|
573
|
+
${l?"disabled":""}
|
|
574
|
+
aria-invalid="${Boolean(a)}"
|
|
575
|
+
/>
|
|
576
|
+
<div class="error">${a}</div>
|
|
577
|
+
</div>
|
|
578
|
+
`}};_("af-ui-input",Vt);$a=Vt});var k0={};i(k0,{default:()=>ca,AfriUIBadge:()=>Nt});var Nt,ca;var Qo=x(()=>{X();Nt=class Nt extends c{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",b=this.hasAttribute("pill");this.shadowRoot.innerHTML=Q`
|
|
579
|
+
<style>
|
|
580
|
+
:host { display: inline-block; font-family: 'Inter', system-ui, sans-serif; }
|
|
581
|
+
|
|
582
|
+
.badge {
|
|
583
|
+
display: inline-flex;
|
|
584
|
+
align-items: center;
|
|
585
|
+
justify-content: center;
|
|
586
|
+
gap: 0.4rem;
|
|
587
|
+
border-radius: ${b?"999px":"0.6rem"};
|
|
588
|
+
padding: ${n==="sm"?"0.25rem 0.65rem":n==="lg"?"0.55rem 1rem":"0.4rem 0.8rem"};
|
|
589
|
+
font-size: ${n==="sm"?"0.75rem":n==="lg"?"0.95rem":"0.85rem"};
|
|
590
|
+
font-weight: 700;
|
|
591
|
+
color: #111827;
|
|
592
|
+
background: var(--af-ui-badge-bg, #e2e8f0);
|
|
593
|
+
border: 1px solid transparent;
|
|
594
|
+
white-space: nowrap;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.badge.primary { background: #2563eb; color: #ffffff; }
|
|
598
|
+
.badge.success { background: #16a34a; color: #ffffff; }
|
|
599
|
+
.badge.warning { background: #f59e0b; color: #0f172a; }
|
|
600
|
+
.badge.danger { background: #dc2626; color: #ffffff; }
|
|
601
|
+
.badge.secondary { background: #f8fafc; color: #0f172a; }
|
|
602
|
+
</style>
|
|
603
|
+
|
|
604
|
+
<span class="badge ${t}"><slot></slot></span>
|
|
605
|
+
`}};_("af-ui-badge",Nt);ca=Nt});var H0={};i(H0,{default:()=>va,AfriUISwitch:()=>Kt});var Kt,va;var Jo=x(()=>{X();Kt=class Kt extends c{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"),b=this.getAttribute("size")||"md",o=b==="sm"?{width:36,height:20,knob:14}:b==="lg"?{width:56,height:32,knob:24}:{width:48,height:28,knob:20},l=t?"true":"false";this.shadowRoot.innerHTML=Q`
|
|
606
|
+
<style>
|
|
607
|
+
:host { display: inline-block; }
|
|
608
|
+
|
|
609
|
+
button {
|
|
610
|
+
all: unset;
|
|
611
|
+
position: relative;
|
|
612
|
+
width: ${o.width}px;
|
|
613
|
+
height: ${o.height}px;
|
|
614
|
+
border-radius: ${o.height/2}px;
|
|
615
|
+
background: ${t?"#2563eb":"#e5e7eb"};
|
|
616
|
+
cursor: ${n?"not-allowed":"pointer"};
|
|
617
|
+
transition: background 180ms ease;
|
|
618
|
+
box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.knob {
|
|
622
|
+
position: absolute;
|
|
623
|
+
top: 50%;
|
|
624
|
+
left: ${t?`${o.width-o.knob-4}px`:"4px"};
|
|
625
|
+
transform: translateY(-50%);
|
|
626
|
+
width: ${o.knob}px;
|
|
627
|
+
height: ${o.knob}px;
|
|
628
|
+
border-radius: 999px;
|
|
629
|
+
background: #ffffff;
|
|
630
|
+
transition: left 180ms ease;
|
|
631
|
+
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
button:disabled { opacity: 0.65; }
|
|
635
|
+
</style>
|
|
636
|
+
|
|
637
|
+
<button role="switch" aria-checked="${l}" ${n?"disabled":""}>
|
|
638
|
+
<span class="knob"></span>
|
|
639
|
+
</button>
|
|
640
|
+
`}};_("af-ui-switch",Kt);va=Kt});var Y0={};i(Y0,{default:()=>wa,AfriButton:()=>bn});var bn,wa;var X0=x(()=>{X();bn=class bn extends c{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",b=this.getAttribute("theme")||"tanzania",o=this.hasAttribute("disabled"),l=this.hasAttribute("loading"),a=this.getAttribute("icon"),h=this.getAttribute("aria-label"),f={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"}},r=f[b]||f.tanzania;this.shadowRoot.innerHTML=`
|
|
391
641
|
<style>
|
|
392
642
|
:host {
|
|
393
643
|
display: inline-block;
|
|
@@ -483,15 +733,15 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
483
733
|
|
|
484
734
|
<button
|
|
485
735
|
class="variant-${t} size-${n}"
|
|
486
|
-
${
|
|
487
|
-
${
|
|
736
|
+
${o?"disabled":""}
|
|
737
|
+
${h?`aria-label="${h}"`:""}
|
|
488
738
|
${l?'aria-busy="true"':""}
|
|
489
739
|
>
|
|
490
740
|
${l?'<span class="spinner"></span>':""}
|
|
491
741
|
${a&&!l?`<span class="icon">${a}</span>`:""}
|
|
492
742
|
<slot></slot>
|
|
493
743
|
</button>
|
|
494
|
-
`}};
|
|
744
|
+
`}};_("af-button",bn);wa=bn});var i0={};i(i0,{default:()=>_a,AfriCard:()=>ln});var ln,_a;var L0=x(()=>{X();ln=class ln extends c{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",b=this.hasAttribute("clickable"),o=this.getAttribute("image"),l={default:{accent:"#333",border:"#eee"},tanzania:{accent:"#1EB53A",border:"#1EB53A"},maasai:{accent:"#FF0000",border:"#8B0000"},ndebele:{accent:"#4169E1",border:"#4169E1"}},h={elevated:"box-shadow: 0 2px 12px rgba(0,0,0,0.1);",outlined:`border: 2px solid ${(l[t]||l.default).border};`,flat:"background: #f8f9fa;"};this.shadowRoot.innerHTML=html`
|
|
495
745
|
<style>
|
|
496
746
|
:host {
|
|
497
747
|
display: block;
|
|
@@ -506,7 +756,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
506
756
|
overflow: hidden;
|
|
507
757
|
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
|
508
758
|
position: relative;
|
|
509
|
-
${
|
|
759
|
+
${b?"cursor: pointer;":""}
|
|
510
760
|
}
|
|
511
761
|
|
|
512
762
|
.card::before {
|
|
@@ -517,7 +767,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
517
767
|
pointer-events: none;
|
|
518
768
|
}
|
|
519
769
|
|
|
520
|
-
${
|
|
770
|
+
${b?`
|
|
521
771
|
.card:hover {
|
|
522
772
|
transform: translateY(-8px);
|
|
523
773
|
border-color: rgba(252, 209, 22, 0.4);
|
|
@@ -559,7 +809,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
559
809
|
</style>
|
|
560
810
|
|
|
561
811
|
<article class="card">
|
|
562
|
-
${
|
|
812
|
+
${o?`<img class="card-image" src="${o}" alt="" />`:""}
|
|
563
813
|
<div class="card-body">
|
|
564
814
|
<slot></slot>
|
|
565
815
|
</div>
|
|
@@ -569,7 +819,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
569
819
|
</div>
|
|
570
820
|
`:""}
|
|
571
821
|
</article>
|
|
572
|
-
`}};
|
|
822
|
+
`}};_("af-card",ln);_a=ln});var M0={};i(M0,{default:()=>Aa,AfriNavbar:()=>an});var an,Aa;var Q0=x(()=>{X();Qt();bt();an=class an extends c{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",b=this.hasAttribute("sticky");this.shadowRoot.innerHTML=`
|
|
573
823
|
<style>
|
|
574
824
|
:host {
|
|
575
825
|
display: block;
|
|
@@ -745,7 +995,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
745
995
|
<slot></slot>
|
|
746
996
|
</div>
|
|
747
997
|
</nav>
|
|
748
|
-
`}};A("af-navbar",Vt);ob=Vt});var k,Nn,$,N=(t)=>{switch(typeof t){case"undefined":return $.undefined;case"string":return $.string;case"number":return Number.isNaN(t)?$.nan:$.number;case"boolean":return $.boolean;case"function":return $.function;case"bigint":return $.bigint;case"symbol":return $.symbol;case"object":if(Array.isArray(t))return $.array;if(t===null)return $.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return $.promise;if(typeof Map<"u"&&t instanceof Map)return $.map;if(typeof Set<"u"&&t instanceof Set)return $.set;if(typeof Date<"u"&&t instanceof Date)return $.date;return $.object;default:return $.unknown}};var Mt=x(()=>{(function(t){t.assertEqual=(l)=>{};function n(l){}t.assertIs=n;function o(l){throw Error()}t.assertNever=o,t.arrayToEnum=(l)=>{let a={};for(let f of l)a[f]=f;return a},t.getValidEnumValues=(l)=>{let a=t.objectKeys(l).filter((h)=>typeof l[l[h]]!=="number"),f={};for(let h of a)f[h]=l[h];return t.objectValues(f)},t.objectValues=(l)=>{return t.objectKeys(l).map(function(a){return l[a]})},t.objectKeys=typeof Object.keys==="function"?(l)=>Object.keys(l):(l)=>{let a=[];for(let f in l)if(Object.prototype.hasOwnProperty.call(l,f))a.push(f);return a},t.find=(l,a)=>{for(let f of l)if(a(f))return f;return},t.isInteger=typeof Number.isInteger==="function"?(l)=>Number.isInteger(l):(l)=>typeof l==="number"&&Number.isFinite(l)&&Math.floor(l)===l;function b(l,a=" | "){return l.map((f)=>typeof f==="string"?`'${f}'`:f).join(a)}t.joinValues=b,t.jsonStringifyReplacer=(l,a)=>{if(typeof a==="bigint")return a.toString();return a}})(k||(k={}));(function(t){t.mergeShapes=(n,o)=>{return{...n,...o}}})(Nn||(Nn={}));$=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var g,bb=(t)=>{return JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:")},O;var jt=x(()=>{Mt();g=k.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"]);O=class O 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(l){return l.message},o={_errors:[]},b=(l)=>{for(let a of l.issues)if(a.code==="invalid_union")a.unionErrors.map(b);else if(a.code==="invalid_return_type")b(a.returnTypeError);else if(a.code==="invalid_arguments")b(a.argumentsError);else if(a.path.length===0)o._errors.push(n(a));else{let f=o,h=0;while(h<a.path.length){let r=a.path[h];if(h!==a.path.length-1)f[r]=f[r]||{_errors:[]};else f[r]=f[r]||{_errors:[]},f[r]._errors.push(n(a));f=f[r],h++}}};return b(this),o}static assert(t){if(!(t instanceof O))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(n)=>n.message){let n={},o=[];for(let b of this.issues)if(b.path.length>0){let l=b.path[0];n[l]=n[l]||[],n[l].push(t(b))}else o.push(t(b));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};O.create=(t)=>{return new O(t)}});var lb=(t,n)=>{let o;switch(t.code){case g.invalid_type:if(t.received===$.undefined)o="Required";else o=`Expected ${t.expected}, received ${t.received}`;break;case g.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(t.expected,k.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:o=`Unrecognized key(s) in object: ${k.joinValues(t.keys,", ")}`;break;case g.invalid_union:o="Invalid input";break;case g.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${k.joinValues(t.options)}`;break;case g.invalid_enum_value:o=`Invalid enum value. Expected ${k.joinValues(t.options)}, received '${t.received}'`;break;case g.invalid_arguments:o="Invalid function arguments";break;case g.invalid_return_type:o="Invalid function return type";break;case g.invalid_date:o="Invalid date";break;case g.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 k.assertNever(t.validation);else if(t.validation!=="regex")o=`Invalid ${t.validation}`;else o="Invalid";break;case g.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 g.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 g.custom:o="Invalid input";break;case g.invalid_intersection_types:o="Intersection results could not be merged";break;case g.not_multiple_of:o=`Number must be a multiple of ${t.multipleOf}`;break;case g.not_finite:o="Number must be finite";break;default:o=n.defaultError,k.assertNever(t)}return{message:o}},u;var Kn=x(()=>{jt();Mt();u=lb});function ab(t){A0=t}function ft(){return A0}var A0;var Nt=x(()=>{Kn();A0=u});function v(t,n){let o=ft(),b=Qt({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o,o===u?void 0:u].filter((l)=>!!l)});t.common.issues.push(b)}class F{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 b of n){if(b.status==="aborted")return H;if(b.status==="dirty")t.dirty();o.push(b.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let b of n){let l=await b.key,a=await b.value;o.push({key:l,value:a})}return F.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let b of n){let{key:l,value:a}=b;if(l.status==="aborted")return H;if(a.status==="aborted")return H;if(l.status==="dirty")t.dirty();if(a.status==="dirty")t.dirty();if(l.value!=="__proto__"&&(typeof a.value<"u"||b.alwaysSet))o[l.value]=a.value}return{status:t.value,value:o}}}var Qt=(t)=>{let{data:n,path:o,errorMaps:b,issueData:l}=t,a=[...o,...l.path||[]],f={...l,path:a};if(l.message!==void 0)return{...l,path:a,message:l.message};let h="",r=b.filter((_)=>!!_).slice().reverse();for(let _ of r)h=_(f,{data:n,defaultError:h}).message;return{...l,path:a,message:h}},fb,H,tt=(t)=>({status:"dirty",value:t}),R=(t)=>({status:"valid",value:t}),Kt=(t)=>t.status==="aborted",pt=(t)=>t.status==="dirty",C=(t)=>t.status==="valid",ht=(t)=>typeof Promise<"u"&&t instanceof Promise;var pn=x(()=>{Nt();Kn();fb=[];H=Object.freeze({status:"aborted"})});var q0=()=>{};var q;var H0=x(()=>{(function(t){t.errToObj=(n)=>typeof n==="string"?{message:n}:n||{},t.toString=(n)=>typeof n==="string"?n:n?.message})(q||(q={}))});class V{constructor(t,n,o,b){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=b}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 Y(t){if(!t)return{};let{errorMap:n,invalid_type_error:o,required_error:b,description:l}=t;if(n&&(o||b))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(n)return{errorMap:n,description:l};return{errorMap:(f,h)=>{let{message:r}=t;if(f.code==="invalid_enum_value")return{message:r??h.defaultError};if(typeof h.data>"u")return{message:r??b??h.defaultError};if(f.code!=="invalid_type")return{message:h.defaultError};return{message:r??o??h.defaultError}},description:l}}class X{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 F,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(ht(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:N(t)},b=this._parseSync({data:t,path:o.path,parent:o});return E0(o,b)}"~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 o=this._parseSync({data:t,path:[],parent:n});return C(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)=>C(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:N(t)},b=this._parse({data:t,path:o.path,parent:o}),l=await(ht(b)?b:Promise.resolve(b));return E0(o,l)}refine(t,n){let o=(b)=>{if(typeof n==="string"||typeof n>"u")return{message:n};else if(typeof n==="function")return n(b);else return n};return this._refinement((b,l)=>{let a=t(b),f=()=>l.addIssue({code:g.custom,...o(b)});if(typeof Promise<"u"&&a instanceof Promise)return a.then((h)=>{if(!h)return f(),!1;else return!0});if(!a)return f(),!1;else return!0})}refinement(t,n){return this._refinement((o,b)=>{if(!t(o))return b.addIssue(typeof n==="function"?n(o,b):n),!1;else return!0})}_refinement(t){return new j({schema:this,typeName:E.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 U.create(this,this._def)}nullable(){return i.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return d.create(this)}promise(){return lt.create(this,this._def)}or(t){return ct.create([this,t],this._def)}and(t){return _t.create(this,t,this._def)}transform(t){return new j({...Y(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t==="function"?t:()=>t;return new Et({...Y(this._def),innerType:this,defaultValue:n,typeName:E.ZodDefault})}brand(){return new It({typeName:E.ZodBranded,type:this,...Y(this._def)})}catch(t){let n=typeof t==="function"?t:()=>t;return new xt({...Y(this._def),innerType:this,catchValue:n,typeName:E.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Rt.create(this,t)}readonly(){return Yt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function X0(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(`^${X0(t)}$`)}function S0(t){let n=`${Y0}T${X0(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 Mb(t,n){if((n==="v4"||!n)&&qb.test(t))return!0;if((n==="v6"||!n)&&Eb.test(t))return!0;return!1}function Qb(t,n){if(!wb.test(t))return!1;try{let[o]=t.split(".");if(!o)return!1;let b=o.replace(/-/g,"+").replace(/_/g,"/").padEnd(o.length+(4-o.length%4)%4,"="),l=JSON.parse(atob(b));if(typeof l!=="object"||l===null)return!1;if("typ"in l&&l?.typ!=="JWT")return!1;if(!l.alg)return!1;if(n&&l.alg!==n)return!1;return!0}catch{return!1}}function Jb(t,n){if((n==="v4"||!n)&&Hb.test(t))return!0;if((n==="v6"||!n)&&xb.test(t))return!0;return!1}function Gb(t,n){let o=(t.toString().split(".")[1]||"").length,b=(n.toString().split(".")[1]||"").length,l=o>b?o:b,a=Number.parseInt(t.toFixed(l).replace(".","")),f=Number.parseInt(n.toFixed(l).replace(".",""));return a%f/10**l}function rt(t){if(t instanceof J){let n={};for(let o in t.shape){let b=t.shape[o];n[o]=U.create(rt(b))}return new J({...t._def,shape:()=>n})}else if(t instanceof d)return new d({...t._def,type:rt(t.element)});else if(t instanceof U)return U.create(rt(t.unwrap()));else if(t instanceof i)return i.create(rt(t.unwrap()));else if(t instanceof p)return p.create(t.items.map((n)=>rt(n)));else return t}function In(t,n){let o=N(t),b=N(n);if(t===n)return{valid:!0,data:t};else if(o===$.object&&b===$.object){let l=k.objectKeys(n),a=k.objectKeys(t).filter((h)=>l.indexOf(h)!==-1),f={...t,...n};for(let h of a){let r=In(t[h],n[h]);if(!r.valid)return{valid:!1};f[h]=r.data}return{valid:!0,data:f}}else if(o===$.array&&b===$.array){if(t.length!==n.length)return{valid:!1};let l=[];for(let a=0;a<t.length;a++){let f=t[a],h=n[a],r=In(f,h);if(!r.valid)return{valid:!1};l.push(r.data)}return{valid:!0,data:l}}else if(o===$.date&&b===$.date&&+t===+n)return{valid:!0,data:t};else return{valid:!1}}function k0(t,n){return new s({values:t,typeName:E.ZodEnum,...Y(n)})}function x0(t,n){let o=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;return typeof o==="string"?{message:o}:o}function M0(t,n={},o){if(t)return ot.create().superRefine((b,l)=>{let a=t(b);if(a instanceof Promise)return a.then((f)=>{if(!f){let h=x0(n,b),r=h.fatal??o??!0;l.addIssue({code:"custom",...h,fatal:r})}});if(!a){let f=x0(n,b),h=f.fatal??o??!0;l.addIssue({code:"custom",...f,fatal:h})}return});return ot.create()}var E0=(t,n)=>{if(C(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 O(t.common.issues);return this._error=o,this._error}}}},hb,rb,gb,$b,vb,wb,cb,_b,Ab="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",un,qb,Hb,Eb,xb,Yb,Xb,Y0="((\\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])))",Sb,W,Z,e,$t,nt,Jt,vt,wt,ot,y,K,Gt,d,J,ct,I=(t)=>{if(t instanceof At)return I(t.schema);else if(t instanceof j)return I(t.innerType());else if(t instanceof qt)return[t.value];else if(t instanceof s)return t.options;else if(t instanceof Ht)return k.objectValues(t.enum);else if(t instanceof Et)return I(t._def.innerType);else if(t instanceof vt)return[void 0];else if(t instanceof wt)return[null];else if(t instanceof U)return[void 0,...I(t.unwrap())];else if(t instanceof i)return[null,...I(t.unwrap())];else if(t instanceof It)return I(t.unwrap());else if(t instanceof Yt)return I(t.unwrap());else if(t instanceof xt)return I(t._def.innerType);else return[]},ut,_t,p,Lt,Ft,bt,gt,At,qt,s,Ht,lt,j,U,i,Et,xt,mt,Lb,It,Rt,Yt,Fb,E,mb=(t,n={message:`Input not instance of ${t.name}`})=>M0((o)=>o instanceof t,n),Q0,J0,Rb,Bb,G0,Db,Ob,Wb,db,Ub,Vb,jb,Nb,Kb,pb,ub,Ib,ib,Pb,Tb,Cb,yb,Zb,eb,sb,zb,tl,nl,ol,bl,ll,al,fl,hl,rl=()=>Q0().optional(),gl=()=>J0().optional(),$l=()=>G0().optional(),vl,wl;var L0=x(()=>{jt();Nt();H0();pn();Mt();hb=/^c[^\s-]{8,}$/i,rb=/^[0-9a-z]+$/,gb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$b=/^[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,vb=/^[a-z0-9_-]{21}$/i,wb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,cb=/^[-+]?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)?)??$/,_b=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qb=/^(?:(?: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])$/,Hb=/^(?:(?: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])$/,Eb=/^(([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]))$/,xb=/^(([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])$/,Yb=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xb=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Sb=new RegExp(`^${Y0}$`);W=class W extends X{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==$.string){let l=this._getOrReturnCtx(t);return v(l,{code:g.invalid_type,expected:$.string,received:l.parsedType}),H}let o=new F,b=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.length<l.value)b=this._getOrReturnCtx(t,b),v(b,{code:g.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="max"){if(t.data.length>l.value)b=this._getOrReturnCtx(t,b),v(b,{code:g.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty()}else if(l.kind==="length"){let a=t.data.length>l.value,f=t.data.length<l.value;if(a||f){if(b=this._getOrReturnCtx(t,b),a)v(b,{code:g.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});else if(f)v(b,{code:g.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message});o.dirty()}}else if(l.kind==="email"){if(!_b.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"email",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="emoji"){if(!un)un=new RegExp(Ab,"u");if(!un.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"emoji",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="uuid"){if(!$b.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"uuid",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="nanoid"){if(!vb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"nanoid",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid"){if(!hb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"cuid",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cuid2"){if(!rb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"cuid2",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ulid"){if(!gb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"ulid",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="url")try{new URL(t.data)}catch{b=this._getOrReturnCtx(t,b),v(b,{validation:"url",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="regex"){if(l.regex.lastIndex=0,!l.regex.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"regex",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="trim")t.data=t.data.trim();else if(l.kind==="includes"){if(!t.data.includes(l.value,l.position))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()}else if(l.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(l.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(l.kind==="startsWith"){if(!t.data.startsWith(l.value))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="endsWith"){if(!t.data.endsWith(l.value))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()}else if(l.kind==="datetime"){if(!S0(l).test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:"datetime",message:l.message}),o.dirty()}else if(l.kind==="date"){if(!Sb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:"date",message:l.message}),o.dirty()}else if(l.kind==="time"){if(!kb(l).test(t.data))b=this._getOrReturnCtx(t,b),v(b,{code:g.invalid_string,validation:"time",message:l.message}),o.dirty()}else if(l.kind==="duration"){if(!cb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"duration",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="ip"){if(!Mb(t.data,l.version))b=this._getOrReturnCtx(t,b),v(b,{validation:"ip",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="jwt"){if(!Qb(t.data,l.alg))b=this._getOrReturnCtx(t,b),v(b,{validation:"jwt",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="cidr"){if(!Jb(t.data,l.version))b=this._getOrReturnCtx(t,b),v(b,{validation:"cidr",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64"){if(!Yb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"base64",code:g.invalid_string,message:l.message}),o.dirty()}else if(l.kind==="base64url"){if(!Xb.test(t.data))b=this._getOrReturnCtx(t,b),v(b,{validation:"base64url",code:g.invalid_string,message:l.message}),o.dirty()}else k.assertNever(l);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement((b)=>t.test(b),{validation:n,code:g.invalid_string,...q.errToObj(o)})}_addCheck(t){return new W({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...q.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...q.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...q.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...q.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,...q.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,...q.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...q.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...q.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...q.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...q.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...q.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...q.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...q.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...q.errToObj(n)})}nonempty(t){return this.min(1,q.errToObj(t))}trim(){return new W({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new W({...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}};W.create=(t)=>{return new W({checks:[],typeName:E.ZodString,coerce:t?.coerce??!1,...Y(t)})};Z=class Z extends X{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)!==$.number){let l=this._getOrReturnCtx(t);return v(l,{code:g.invalid_type,expected:$.number,received:l.parsedType}),H}let o=void 0,b=new F;for(let l of this._def.checks)if(l.kind==="int"){if(!k.isInteger(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:g.invalid_type,expected:"integer",received:"float",message:l.message}),b.dirty()}else if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:g.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:g.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(Gb(t.data,l.value)!==0)o=this._getOrReturnCtx(t,o),v(o,{code:g.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else if(l.kind==="finite"){if(!Number.isFinite(t.data))o=this._getOrReturnCtx(t,o),v(o,{code:g.not_finite,message:l.message}),b.dirty()}else k.assertNever(l);return{status:b.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,q.toString(n))}setLimit(t,n,o,b){return new Z({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new Z({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:q.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:q.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"&&k.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:E.ZodNumber,coerce:t?.coerce||!1,...Y(t)})};e=class e extends X{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)!==$.bigint)return this._getInvalidInput(t);let o=void 0,b=new F;for(let l of this._def.checks)if(l.kind==="min"){if(l.inclusive?t.data<l.value:t.data<=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:g.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),b.dirty()}else if(l.kind==="max"){if(l.inclusive?t.data>l.value:t.data>=l.value)o=this._getOrReturnCtx(t,o),v(o,{code:g.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),b.dirty()}else if(l.kind==="multipleOf"){if(t.data%l.value!==BigInt(0))o=this._getOrReturnCtx(t,o),v(o,{code:g.not_multiple_of,multipleOf:l.value,message:l.message}),b.dirty()}else k.assertNever(l);return{status:b.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return v(n,{code:g.invalid_type,expected:$.bigint,received:n.parsedType}),H}gte(t,n){return this.setLimit("min",t,!0,q.toString(n))}gt(t,n){return this.setLimit("min",t,!1,q.toString(n))}lte(t,n){return this.setLimit("max",t,!0,q.toString(n))}lt(t,n){return this.setLimit("max",t,!1,q.toString(n))}setLimit(t,n,o,b){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:q.toString(b)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:q.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:q.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}};e.create=(t)=>{return new e({checks:[],typeName:E.ZodBigInt,coerce:t?.coerce??!1,...Y(t)})};$t=class $t extends X{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==$.boolean){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.boolean,received:o.parsedType}),H}return R(t.data)}};$t.create=(t)=>{return new $t({typeName:E.ZodBoolean,coerce:t?.coerce||!1,...Y(t)})};nt=class nt extends X{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==$.date){let l=this._getOrReturnCtx(t);return v(l,{code:g.invalid_type,expected:$.date,received:l.parsedType}),H}if(Number.isNaN(t.data.getTime())){let l=this._getOrReturnCtx(t);return v(l,{code:g.invalid_date}),H}let o=new F,b=void 0;for(let l of this._def.checks)if(l.kind==="min"){if(t.data.getTime()<l.value)b=this._getOrReturnCtx(t,b),v(b,{code:g.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()}else if(l.kind==="max"){if(t.data.getTime()>l.value)b=this._getOrReturnCtx(t,b),v(b,{code:g.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()}else k.assertNever(l);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new nt({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:q.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:q.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}};nt.create=(t)=>{return new nt({checks:[],coerce:t?.coerce||!1,typeName:E.ZodDate,...Y(t)})};Jt=class Jt extends X{_parse(t){if(this._getType(t)!==$.symbol){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.symbol,received:o.parsedType}),H}return R(t.data)}};Jt.create=(t)=>{return new Jt({typeName:E.ZodSymbol,...Y(t)})};vt=class vt extends X{_parse(t){if(this._getType(t)!==$.undefined){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.undefined,received:o.parsedType}),H}return R(t.data)}};vt.create=(t)=>{return new vt({typeName:E.ZodUndefined,...Y(t)})};wt=class wt extends X{_parse(t){if(this._getType(t)!==$.null){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.null,received:o.parsedType}),H}return R(t.data)}};wt.create=(t)=>{return new wt({typeName:E.ZodNull,...Y(t)})};ot=class ot extends X{constructor(){super(...arguments);this._any=!0}_parse(t){return R(t.data)}};ot.create=(t)=>{return new ot({typeName:E.ZodAny,...Y(t)})};y=class y extends X{constructor(){super(...arguments);this._unknown=!0}_parse(t){return R(t.data)}};y.create=(t)=>{return new y({typeName:E.ZodUnknown,...Y(t)})};K=class K extends X{_parse(t){let n=this._getOrReturnCtx(t);return v(n,{code:g.invalid_type,expected:$.never,received:n.parsedType}),H}};K.create=(t)=>{return new K({typeName:E.ZodNever,...Y(t)})};Gt=class Gt extends X{_parse(t){if(this._getType(t)!==$.undefined){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.void,received:o.parsedType}),H}return R(t.data)}};Gt.create=(t)=>{return new Gt({typeName:E.ZodVoid,...Y(t)})};d=class d extends X{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),b=this._def;if(n.parsedType!==$.array)return v(n,{code:g.invalid_type,expected:$.array,received:n.parsedType}),H;if(b.exactLength!==null){let a=n.data.length>b.exactLength.value,f=n.data.length<b.exactLength.value;if(a||f)v(n,{code:a?g.too_big:g.too_small,minimum:f?b.exactLength.value:void 0,maximum:a?b.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:b.exactLength.message}),o.dirty()}if(b.minLength!==null){if(n.data.length<b.minLength.value)v(n,{code:g.too_small,minimum:b.minLength.value,type:"array",inclusive:!0,exact:!1,message:b.minLength.message}),o.dirty()}if(b.maxLength!==null){if(n.data.length>b.maxLength.value)v(n,{code:g.too_big,maximum:b.maxLength.value,type:"array",inclusive:!0,exact:!1,message:b.maxLength.message}),o.dirty()}if(n.common.async)return Promise.all([...n.data].map((a,f)=>{return b.type._parseAsync(new V(n,a,n.path,f))})).then((a)=>{return F.mergeArray(o,a)});let l=[...n.data].map((a,f)=>{return b.type._parseSync(new V(n,a,n.path,f))});return F.mergeArray(o,l)}get element(){return this._def.type}min(t,n){return new d({...this._def,minLength:{value:t,message:q.toString(n)}})}max(t,n){return new d({...this._def,maxLength:{value:t,message:q.toString(n)}})}length(t,n){return new d({...this._def,exactLength:{value:t,message:q.toString(n)}})}nonempty(t){return this.min(1,t)}};d.create=(t,n)=>{return new d({type:t,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...Y(n)})};J=class J extends X{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=k.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$.object){let r=this._getOrReturnCtx(t);return v(r,{code:g.invalid_type,expected:$.object,received:r.parsedType}),H}let{status:o,ctx:b}=this._processInputParams(t),{shape:l,keys:a}=this._getCached(),f=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip")){for(let r in b.data)if(!a.includes(r))f.push(r)}let h=[];for(let r of a){let _=l[r],S=b.data[r];h.push({key:{status:"valid",value:r},value:_._parse(new V(b,S,b.path,r)),alwaysSet:r in b.data})}if(this._def.catchall instanceof K){let r=this._def.unknownKeys;if(r==="passthrough")for(let _ of f)h.push({key:{status:"valid",value:_},value:{status:"valid",value:b.data[_]}});else if(r==="strict"){if(f.length>0)v(b,{code:g.unrecognized_keys,keys:f}),o.dirty()}else if(r==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let r=this._def.catchall;for(let _ of f){let S=b.data[_];h.push({key:{status:"valid",value:_},value:r._parse(new V(b,S,b.path,_)),alwaysSet:_ in b.data})}}if(b.common.async)return Promise.resolve().then(async()=>{let r=[];for(let _ of h){let S=await _.key,L=await _.value;r.push({key:S,value:L,alwaysSet:_.alwaysSet})}return r}).then((r)=>{return F.mergeObjectSync(o,r)});else return F.mergeObjectSync(o,h)}get shape(){return this._def.shape()}strict(t){return q.errToObj,new J({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let b=this._def.errorMap?.(n,o).message??o.defaultError;if(n.code==="unrecognized_keys")return{message:q.errToObj(t).message??b};return{message:b}}}:{}})}strip(){return new J({...this._def,unknownKeys:"strip"})}passthrough(){return new J({...this._def,unknownKeys:"passthrough"})}extend(t){return new J({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new J({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:E.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new J({...this._def,catchall:t})}pick(t){let n={};for(let o of k.objectKeys(t))if(t[o]&&this.shape[o])n[o]=this.shape[o];return new J({...this._def,shape:()=>n})}omit(t){let n={};for(let o of k.objectKeys(this.shape))if(!t[o])n[o]=this.shape[o];return new J({...this._def,shape:()=>n})}deepPartial(){return rt(this)}partial(t){let n={};for(let o of k.objectKeys(this.shape)){let b=this.shape[o];if(t&&!t[o])n[o]=b;else n[o]=b.optional()}return new J({...this._def,shape:()=>n})}required(t){let n={};for(let o of k.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let l=this.shape[o];while(l instanceof U)l=l._def.innerType;n[o]=l}return new J({...this._def,shape:()=>n})}keyof(){return k0(k.objectKeys(this.shape))}};J.create=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strip",catchall:K.create(),typeName:E.ZodObject,...Y(n)})};J.strictCreate=(t,n)=>{return new J({shape:()=>t,unknownKeys:"strict",catchall:K.create(),typeName:E.ZodObject,...Y(n)})};J.lazycreate=(t,n)=>{return new J({shape:t,unknownKeys:"strip",catchall:K.create(),typeName:E.ZodObject,...Y(n)})};ct=class ct extends X{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function b(l){for(let f of l)if(f.result.status==="valid")return f.result;for(let f of l)if(f.result.status==="dirty")return n.common.issues.push(...f.ctx.common.issues),f.result;let a=l.map((f)=>new O(f.ctx.common.issues));return v(n,{code:g.invalid_union,unionErrors:a}),H}if(n.common.async)return Promise.all(o.map(async(l)=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(b);else{let l=void 0,a=[];for(let h of o){let r={...n,common:{...n.common,issues:[]},parent:null},_=h._parseSync({data:n.data,path:n.path,parent:r});if(_.status==="valid")return _;else if(_.status==="dirty"&&!l)l={result:_,ctx:r};if(r.common.issues.length)a.push(r.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;let f=a.map((h)=>new O(h));return v(n,{code:g.invalid_union,unionErrors:f}),H}}get options(){return this._def.options}};ct.create=(t,n)=>{return new ct({options:t,typeName:E.ZodUnion,...Y(n)})};ut=class ut extends X{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.object)return v(n,{code:g.invalid_type,expected:$.object,received:n.parsedType}),H;let o=this.discriminator,b=n.data[o],l=this.optionsMap.get(b);if(!l)return v(n,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),H;if(n.common.async)return l._parseAsync({data:n.data,path:n.path,parent:n});else return l._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 b=new Map;for(let l of n){let a=I(l.shape[t]);if(!a.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of a){if(b.has(f))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);b.set(f,l)}}return new ut({typeName:E.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:b,...Y(o)})}};_t=class _t extends X{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=(l,a)=>{if(Kt(l)||Kt(a))return H;let f=In(l.value,a.value);if(!f.valid)return v(o,{code:g.invalid_intersection_types}),H;if(pt(l)||pt(a))n.dirty();return{status:n.value,value:f.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(([l,a])=>b(l,a));else return b(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};_t.create=(t,n,o)=>{return new _t({left:t,right:n,typeName:E.ZodIntersection,...Y(o)})};p=class p extends X{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.array)return v(o,{code:g.invalid_type,expected:$.array,received:o.parsedType}),H;if(o.data.length<this._def.items.length)return v(o,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),H;if(!this._def.rest&&o.data.length>this._def.items.length)v(o,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty();let l=[...o.data].map((a,f)=>{let h=this._def.items[f]||this._def.rest;if(!h)return null;return h._parse(new V(o,a,o.path,f))}).filter((a)=>!!a);if(o.common.async)return Promise.all(l).then((a)=>{return F.mergeArray(n,a)});else return F.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new p({...this._def,rest:t})}};p.create=(t,n)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new p({items:t,typeName:E.ZodTuple,rest:null,...Y(n)})};Lt=class Lt extends X{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!==$.object)return v(o,{code:g.invalid_type,expected:$.object,received:o.parsedType}),H;let b=[],l=this._def.keyType,a=this._def.valueType;for(let f in o.data)b.push({key:l._parse(new V(o,f,o.path,f)),value:a._parse(new V(o,o.data[f],o.path,f)),alwaysSet:f in o.data});if(o.common.async)return F.mergeObjectAsync(n,b);else return F.mergeObjectSync(n,b)}get element(){return this._def.valueType}static create(t,n,o){if(n instanceof X)return new Lt({keyType:t,valueType:n,typeName:E.ZodRecord,...Y(o)});return new Lt({keyType:W.create(),valueType:t,typeName:E.ZodRecord,...Y(n)})}};Ft=class Ft extends X{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!==$.map)return v(o,{code:g.invalid_type,expected:$.map,received:o.parsedType}),H;let b=this._def.keyType,l=this._def.valueType,a=[...o.data.entries()].map(([f,h],r)=>{return{key:b._parse(new V(o,f,o.path,[r,"key"])),value:l._parse(new V(o,h,o.path,[r,"value"]))}});if(o.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let h of a){let r=await h.key,_=await h.value;if(r.status==="aborted"||_.status==="aborted")return H;if(r.status==="dirty"||_.status==="dirty")n.dirty();f.set(r.value,_.value)}return{status:n.value,value:f}})}else{let f=new Map;for(let h of a){let{key:r,value:_}=h;if(r.status==="aborted"||_.status==="aborted")return H;if(r.status==="dirty"||_.status==="dirty")n.dirty();f.set(r.value,_.value)}return{status:n.value,value:f}}}};Ft.create=(t,n,o)=>{return new Ft({valueType:n,keyType:t,typeName:E.ZodMap,...Y(o)})};bt=class bt extends X{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==$.set)return v(o,{code:g.invalid_type,expected:$.set,received:o.parsedType}),H;let b=this._def;if(b.minSize!==null){if(o.data.size<b.minSize.value)v(o,{code:g.too_small,minimum:b.minSize.value,type:"set",inclusive:!0,exact:!1,message:b.minSize.message}),n.dirty()}if(b.maxSize!==null){if(o.data.size>b.maxSize.value)v(o,{code:g.too_big,maximum:b.maxSize.value,type:"set",inclusive:!0,exact:!1,message:b.maxSize.message}),n.dirty()}let l=this._def.valueType;function a(h){let r=new Set;for(let _ of h){if(_.status==="aborted")return H;if(_.status==="dirty")n.dirty();r.add(_.value)}return{status:n.value,value:r}}let f=[...o.data.values()].map((h,r)=>l._parse(new V(o,h,o.path,r)));if(o.common.async)return Promise.all(f).then((h)=>a(h));else return a(f)}min(t,n){return new bt({...this._def,minSize:{value:t,message:q.toString(n)}})}max(t,n){return new bt({...this._def,maxSize:{value:t,message:q.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:E.ZodSet,...Y(n)})};gt=class gt extends X{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.function)return v(n,{code:g.invalid_type,expected:$.function,received:n.parsedType}),H;function o(f,h){return Qt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ft(),u].filter((r)=>!!r),issueData:{code:g.invalid_arguments,argumentsError:h}})}function b(f,h){return Qt({data:f,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ft(),u].filter((r)=>!!r),issueData:{code:g.invalid_return_type,returnTypeError:h}})}let l={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof lt){let f=this;return R(async function(...h){let r=new O([]),_=await f._def.args.parseAsync(h,l).catch((G)=>{throw r.addIssue(o(h,G)),r}),S=await Reflect.apply(a,this,_);return await f._def.returns._def.type.parseAsync(S,l).catch((G)=>{throw r.addIssue(b(S,G)),r})})}else{let f=this;return R(function(...h){let r=f._def.args.safeParse(h,l);if(!r.success)throw new O([o(h,r.error)]);let _=Reflect.apply(a,this,r.data),S=f._def.returns.safeParse(_,l);if(!S.success)throw new O([b(_,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new gt({...this._def,args:p.create(t).rest(y.create())})}returns(t){return new gt({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new gt({args:t?t:p.create([]).rest(y.create()),returns:n||y.create(),typeName:E.ZodFunction,...Y(o)})}};At=class At extends X{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})}};At.create=(t,n)=>{return new At({getter:t,typeName:E.ZodLazy,...Y(n)})};qt=class qt extends X{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return v(n,{received:n.data,code:g.invalid_literal,expected:this._def.value}),H}return{status:"valid",value:t.data}}get value(){return this._def.value}};qt.create=(t,n)=>{return new qt({value:t,typeName:E.ZodLiteral,...Y(n)})};s=class s extends X{_parse(t){if(typeof t.data!=="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return v(n,{expected:k.joinValues(o),received:n.parsedType,code:g.invalid_type}),H}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 v(n,{received:n.data,code:g.invalid_enum_value,options:o}),H}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 s.create(t,{...this._def,...n})}exclude(t,n=this._def){return s.create(this.options.filter((o)=>!t.includes(o)),{...this._def,...n})}};s.create=k0;Ht=class Ht extends X{_parse(t){let n=k.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==$.string&&o.parsedType!==$.number){let b=k.objectValues(n);return v(o,{expected:k.joinValues(b),received:o.parsedType,code:g.invalid_type}),H}if(!this._cache)this._cache=new Set(k.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let b=k.objectValues(n);return v(o,{received:o.data,code:g.invalid_enum_value,options:b}),H}return R(t.data)}get enum(){return this._def.values}};Ht.create=(t,n)=>{return new Ht({values:t,typeName:E.ZodNativeEnum,...Y(n)})};lt=class lt extends X{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==$.promise&&n.common.async===!1)return v(n,{code:g.invalid_type,expected:$.promise,received:n.parsedType}),H;let o=n.parsedType===$.promise?n.data:Promise.resolve(n.data);return R(o.then((b)=>{return this._def.type.parseAsync(b,{path:n.path,errorMap:n.common.contextualErrorMap})}))}};lt.create=(t,n)=>{return new lt({type:t,typeName:E.ZodPromise,...Y(n)})};j=class j extends X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),b=this._def.effect||null,l={addIssue:(a)=>{if(v(o,a),a.fatal)n.abort();else n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),b.type==="preprocess"){let a=b.transform(o.data,l);if(o.common.async)return Promise.resolve(a).then(async(f)=>{if(n.value==="aborted")return H;let h=await this._def.schema._parseAsync({data:f,path:o.path,parent:o});if(h.status==="aborted")return H;if(h.status==="dirty")return tt(h.value);if(n.value==="dirty")return tt(h.value);return h});else{if(n.value==="aborted")return H;let f=this._def.schema._parseSync({data:a,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")return tt(f.value);if(n.value==="dirty")return tt(f.value);return f}}if(b.type==="refinement"){let a=(f)=>{let h=b.refinement(f,l);if(o.common.async)return Promise.resolve(h);if(h instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(o.common.async===!1){let f=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(f.status==="aborted")return H;if(f.status==="dirty")n.dirty();return a(f.value),{status:n.value,value:f.value}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((f)=>{if(f.status==="aborted")return H;if(f.status==="dirty")n.dirty();return a(f.value).then(()=>{return{status:n.value,value:f.value}})})}if(b.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!C(a))return H;let f=b.transform(a.value,l);if(f instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:f}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then((a)=>{if(!C(a))return H;return Promise.resolve(b.transform(a.value,l)).then((f)=>({status:n.value,value:f}))});k.assertNever(b)}};j.create=(t,n,o)=>{return new j({schema:t,typeName:E.ZodEffects,effect:n,...Y(o)})};j.createWithPreprocess=(t,n,o)=>{return new j({schema:n,effect:{type:"preprocess",transform:t},typeName:E.ZodEffects,...Y(o)})};U=class U extends X{_parse(t){if(this._getType(t)===$.undefined)return R(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};U.create=(t,n)=>{return new U({innerType:t,typeName:E.ZodOptional,...Y(n)})};i=class i extends X{_parse(t){if(this._getType(t)===$.null)return R(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i.create=(t,n)=>{return new i({innerType:t,typeName:E.ZodNullable,...Y(n)})};Et=class Et extends X{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;if(n.parsedType===$.undefined)o=this._def.defaultValue();return this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Et.create=(t,n)=>{return new Et({innerType:t,typeName:E.ZodDefault,defaultValue:typeof n.default==="function"?n.default:()=>n.default,...Y(n)})};xt=class xt extends X{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},b=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});if(ht(b))return b.then((l)=>{return{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new O(o.common.issues)},input:o.data})}});else return{status:"valid",value:b.status==="valid"?b.value:this._def.catchValue({get error(){return new O(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};xt.create=(t,n)=>{return new xt({innerType:t,typeName:E.ZodCatch,catchValue:typeof n.catch==="function"?n.catch:()=>n.catch,...Y(n)})};mt=class mt extends X{_parse(t){if(this._getType(t)!==$.nan){let o=this._getOrReturnCtx(t);return v(o,{code:g.invalid_type,expected:$.nan,received:o.parsedType}),H}return{status:"valid",value:t.data}}};mt.create=(t)=>{return new mt({typeName:E.ZodNaN,...Y(t)})};Lb=Symbol("zod_brand");It=class It extends X{_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}};Rt=class Rt extends X{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});if(l.status==="aborted")return H;if(l.status==="dirty")return n.dirty(),tt(l.value);else return this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();else{let b=this._def.in._parseSync({data:o.data,path:o.path,parent:o});if(b.status==="aborted")return H;if(b.status==="dirty")return n.dirty(),{status:"dirty",value:b.value};else return this._def.out._parseSync({data:b.value,path:o.path,parent:o})}}static create(t,n){return new Rt({in:t,out:n,typeName:E.ZodPipeline})}};Yt=class Yt extends X{_parse(t){let n=this._def.innerType._parse(t),o=(b)=>{if(C(b))b.value=Object.freeze(b.value);return b};return ht(n)?n.then((b)=>o(b)):o(n)}unwrap(){return this._def.innerType}};Yt.create=(t,n)=>{return new Yt({innerType:t,typeName:E.ZodReadonly,...Y(n)})};Fb={object:J.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"})(E||(E={}));Q0=W.create,J0=Z.create,Rb=mt.create,Bb=e.create,G0=$t.create,Db=nt.create,Ob=Jt.create,Wb=vt.create,db=wt.create,Ub=ot.create,Vb=y.create,jb=K.create,Nb=Gt.create,Kb=d.create,pb=J.create,ub=J.strictCreate,Ib=ct.create,ib=ut.create,Pb=_t.create,Tb=p.create,Cb=Lt.create,yb=Ft.create,Zb=bt.create,eb=gt.create,sb=At.create,zb=qt.create,tl=s.create,nl=Ht.create,ol=lt.create,bl=j.create,ll=U.create,al=i.create,fl=j.createWithPreprocess,hl=Rt.create,vl={string:(t)=>W.create({...t,coerce:!0}),number:(t)=>Z.create({...t,coerce:!0}),boolean:(t)=>$t.create({...t,coerce:!0}),bigint:(t)=>e.create({...t,coerce:!0}),date:(t)=>nt.create({...t,coerce:!0})},wl=H});var w={};Q(w,{void:()=>Nb,util:()=>k,unknown:()=>Vb,union:()=>Ib,undefined:()=>Wb,tuple:()=>Tb,transformer:()=>bl,symbol:()=>Ob,string:()=>Q0,strictObject:()=>ub,setErrorMap:()=>ab,set:()=>Zb,record:()=>Cb,quotelessJson:()=>bb,promise:()=>ol,preprocess:()=>fl,pipeline:()=>hl,ostring:()=>rl,optional:()=>ll,onumber:()=>gl,oboolean:()=>$l,objectUtil:()=>Nn,object:()=>pb,number:()=>J0,nullable:()=>al,null:()=>db,never:()=>jb,nativeEnum:()=>nl,nan:()=>Rb,map:()=>yb,makeIssue:()=>Qt,literal:()=>zb,lazy:()=>sb,late:()=>Fb,isValid:()=>C,isDirty:()=>pt,isAsync:()=>ht,isAborted:()=>Kt,intersection:()=>Pb,instanceof:()=>mb,getParsedType:()=>N,getErrorMap:()=>ft,function:()=>eb,enum:()=>tl,effect:()=>bl,discriminatedUnion:()=>ib,defaultErrorMap:()=>u,datetimeRegex:()=>S0,date:()=>Db,custom:()=>M0,coerce:()=>vl,boolean:()=>G0,bigint:()=>Bb,array:()=>Kb,any:()=>Ub,addIssueToContext:()=>v,ZodVoid:()=>Gt,ZodUnknown:()=>y,ZodUnion:()=>ct,ZodUndefined:()=>vt,ZodType:()=>X,ZodTuple:()=>p,ZodTransformer:()=>j,ZodSymbol:()=>Jt,ZodString:()=>W,ZodSet:()=>bt,ZodSchema:()=>X,ZodRecord:()=>Lt,ZodReadonly:()=>Yt,ZodPromise:()=>lt,ZodPipeline:()=>Rt,ZodParsedType:()=>$,ZodOptional:()=>U,ZodObject:()=>J,ZodNumber:()=>Z,ZodNullable:()=>i,ZodNull:()=>wt,ZodNever:()=>K,ZodNativeEnum:()=>Ht,ZodNaN:()=>mt,ZodMap:()=>Ft,ZodLiteral:()=>qt,ZodLazy:()=>At,ZodIssueCode:()=>g,ZodIntersection:()=>_t,ZodFunction:()=>gt,ZodFirstPartyTypeKind:()=>E,ZodError:()=>O,ZodEnum:()=>s,ZodEffects:()=>j,ZodDiscriminatedUnion:()=>ut,ZodDefault:()=>Et,ZodDate:()=>nt,ZodCatch:()=>xt,ZodBranded:()=>It,ZodBoolean:()=>$t,ZodBigInt:()=>e,ZodArray:()=>d,ZodAny:()=>ot,Schema:()=>X,ParseStatus:()=>F,OK:()=>R,NEVER:()=>wl,INVALID:()=>H,EMPTY_PATH:()=>fb,DIRTY:()=>tt,BRAND:()=>Lb});var Pn=x(()=>{Nt();pn();q0();Mt();L0();jt()});var F0=x(()=>{Pn();Pn()});function Tn(t){if(t===null||typeof t!=="object")return t;if(Array.isArray(t))return t.map(Tn);let n={};for(let o of Object.keys(t))n[o]=Tn(t[o]);return n}var cl,Ba;var m0=x(()=>{cl={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}},Ba=Tn(cl)});class Bt{static validate(t,n){try{return{success:!0,data:t.parse(n)}}catch(o){if(o instanceof w.ZodError){let b={};return o.errors.forEach((l)=>{let a=l.path.join(".");b[a]=l.message}),{success:!1,errors:b}}return{success:!1,errors:{general:"Validation failed"}}}}static validateField(t,n){try{return t.parse(n),{success:!0}}catch(o){if(o instanceof w.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)}}var R0,P;var Cn=x(()=>{F0();m0();R0={login:w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.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:w.object({name:w.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:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.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:w.string()}).refine((t)=>t.password===t.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),auth:{register:w.object({action:w.literal("register"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),username:w.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:w.string().min(8,"Password must be at least 8 characters"),full_name:w.string().min(2,"Full name is required").max(100,"Full name is too long")}),login:w.object({action:w.literal("login"),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters")}),logout:w.object({action:w.literal("logout")}),action:w.discriminatedUnion("action",[w.object({action:w.literal("register")}).merge(w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),username:w.string().min(3,"Username must be at least 3 characters").max(30,"Username must be less than 30 characters"),password:w.string().min(8,"Password must be at least 8 characters"),full_name:w.string().min(2,"Full name is required").max(100,"Full name is too long")})),w.object({action:w.literal("login")}).merge(w.object({email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters")})),w.object({action:w.literal("logout")})])},contact:w.object({name:w.string().min(2,"Name must be at least 2 characters").max(100,"Name is too long"),email:w.string().email("Please enter a valid email address"),message:w.string().min(10,"Message must be at least 10 characters").max(1000,"Message is too long")}),email:w.string().min(1,"Email is required").email("Please enter a valid email address"),password:w.string().min(8,"Password must be at least 8 characters").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"Password must contain uppercase, lowercase, and number"),phone:w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,"Please enter a valid phone number"),url:w.string().min(1,"URL is required").url("Please enter a valid URL"),required:w.string().min(1,"This field is required"),positiveNumber:w.number().positive("Must be a positive number"),integer:w.number().int("Must be a whole number"),futureDate:w.date().min(new Date,"Date must be in the future"),imageFile:w.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:w.object({full_name:w.string().min(2,"Full name must be at least 2 characters").max(100,"Full name is too long").optional(),bio:w.string().max(500,"Bio must be less than 500 characters").nullable().optional(),avatar_url:w.string().url("Please enter a valid URL").nullable().optional(),theme:w.enum(["africanity","dark","light","system"]).optional(),language:w.string().min(2).max(10).optional()}),project:w.object({name:w.string().min(1,"Project name is required").max(100,"Project name is too long"),description:w.string().max(1000,"Description is too long").nullable().optional(),repository_url:w.string().url("Please enter a valid repository URL").nullable().optional(),demo_url:w.string().url("Please enter a valid demo URL").nullable().optional(),tags:w.array(w.string()).optional(),is_public:w.boolean().optional()})};P={required:(t="This field is required")=>w.string().min(1,t),email:(t="Please enter a valid email address")=>w.string().email(t),minLength:(t,n)=>w.string().min(t,n||`Must be at least ${t} characters`),maxLength:(t,n)=>w.string().max(t,n||`Must be less than ${t} characters`),pattern:(t,n)=>w.string().regex(t,n),numeric:(t="Must be a number")=>w.string().regex(/^\d+$/,t),phone:(t="Please enter a valid phone number")=>w.string().regex(/^[\+]?[1-9][\d]{0,15}$/,t),url:(t="Please enter a valid URL")=>w.string().min(1,"URL is required").url(t)}});var B0={};Q(B0,{default:()=>_l,AfriInput:()=>it});var it,_l;var D0=x(()=>{M();Cn();it=class it extends c{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"),o=t.value;if(this.hasAttribute("required")&&!o.trim()){this.setAttribute("error","This field is required");return}if(n&&o.trim()){let l=this._getValidationSchema(n);if(l){let a=Bt.validateField(l,o);if(!a.success)this.setAttribute("error",a.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:P.email(),password:P.password(),phone:P.phone(),url:P.url(),required:P.required()};if(t.includes(":")){let[o,b]=t.split(":"),l=parseInt(b);switch(o){case"minLength":return P.minLength(l);case"maxLength":return P.maxLength(l);case"pattern":return P.pattern(new RegExp(b),"Invalid format")}}return n[t]||null}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",o=this.getAttribute("label")||"",b=this.getAttribute("placeholder")||"",l=this.getAttribute("error")||"",a=this.getAttribute("helper")||"",f=this.getAttribute("theme")||"tanzania",h=this.getAttribute("icon")||"",r=this.hasAttribute("required"),_=this.getAttribute("aria-label"),S=this.getAttribute("aria-describedby"),L={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},G=L[f]||L.tanzania,B=[];if(l)B.push(`error-${this._uniqueId}`);else if(a)B.push(`helper-${this._uniqueId}`);if(S)B.push(...S.split(" "));let _n=B.length>0?`aria-describedby="${B.join(" ")}"`:"";this.shadowRoot.innerHTML=`
|
|
998
|
+
`}};_("af-navbar",an);Aa=an});var J0={};i(J0,{default:()=>da,AfriInput:()=>hn});var hn,da;var G0=x(()=>{X();nn();hn=class hn extends c{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"),b=t.value;if(this.hasAttribute("required")&&!b.trim()){this.setAttribute("error","This field is required");return}if(n&&b.trim()){let l=this._getValidationSchema(n);if(l){let a=gt.validateField(l,b);if(!a.success)this.setAttribute("error",a.error);else this.removeAttribute("error")}}}_getValidationSchema(t){let n={email:U.email(),password:U.password(),phone:U.phone(),url:U.url(),required:U.required()};if(t.includes(":")){let[b,o]=t.split(":"),l=parseInt(o);switch(b){case"minLength":return U.minLength(l);case"maxLength":return U.maxLength(l);case"pattern":return U.pattern(new RegExp(o),"Invalid format")}}return n[t]||null}attributeChangedCallback(){this.render()}render(){let t=this.getAttribute("type")||"text",n=this.getAttribute("name")||"",b=this.getAttribute("label")||"",o=this.getAttribute("placeholder")||"",l=this.getAttribute("error")||"",a=this.getAttribute("helper")||"",h=this.getAttribute("theme")||"tanzania",f=this.getAttribute("icon")||"",r=this.hasAttribute("required"),A=this.getAttribute("aria-label"),L=this.getAttribute("aria-describedby"),S={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},G=S[h]||S.tanzania,B=[];if(l)B.push(`error-${this._uniqueId}`);else if(a)B.push(`helper-${this._uniqueId}`);if(L)B.push(...L.split(" "));let En=B.length>0?`aria-describedby="${B.join(" ")}"`:"";this.shadowRoot.innerHTML=`
|
|
749
999
|
<style>
|
|
750
1000
|
:host {
|
|
751
1001
|
display: block;
|
|
@@ -778,7 +1028,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
778
1028
|
input {
|
|
779
1029
|
width: 100%;
|
|
780
1030
|
padding: 10px 13px;
|
|
781
|
-
${
|
|
1031
|
+
${f?"padding-left: 40px;":""}
|
|
782
1032
|
font-size: 15px;
|
|
783
1033
|
border: 2px solid #ddd;
|
|
784
1034
|
border-radius: 5px;
|
|
@@ -819,25 +1069,25 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
819
1069
|
</style>
|
|
820
1070
|
|
|
821
1071
|
<div class="input-wrapper">
|
|
822
|
-
${
|
|
1072
|
+
${b?`<label for="input-${this._uniqueId}">${b}${r?'<span class="required-star">*</span>':""}</label>`:""}
|
|
823
1073
|
<div class="input-container">
|
|
824
|
-
${
|
|
1074
|
+
${f?`<span class="icon">${f}</span>`:""}
|
|
825
1075
|
<input
|
|
826
1076
|
id="input-${this._uniqueId}"
|
|
827
1077
|
name="${n}"
|
|
828
1078
|
type="${t}"
|
|
829
|
-
placeholder="${
|
|
1079
|
+
placeholder="${o}"
|
|
830
1080
|
class="${l?"has-error":""}"
|
|
831
1081
|
${r?"required":""}
|
|
832
|
-
${
|
|
1082
|
+
${A?`aria-label="${A}"`:""}
|
|
833
1083
|
${l?'aria-invalid="true"':""}
|
|
834
|
-
${
|
|
1084
|
+
${En}
|
|
835
1085
|
/>
|
|
836
1086
|
</div>
|
|
837
1087
|
${l?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${l}</div>`:""}
|
|
838
1088
|
${a&&!l?`<div id="helper-${this._uniqueId}" class="helper-text">${a}</div>`:""}
|
|
839
1089
|
</div>
|
|
840
|
-
`}};
|
|
1090
|
+
`}};_("af-input",hn);da=hn});var S0={};i(S0,{default:()=>xa,AfriAlert:()=>fn});var fn,xa;var F0=x(()=>{X();fn=class fn extends c{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")||"",b=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:"ℹ"}},l=o[t]||o.info;this.shadowRoot.innerHTML=`
|
|
841
1091
|
<style>
|
|
842
1092
|
:host {
|
|
843
1093
|
display: block;
|
|
@@ -915,36 +1165,36 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
915
1165
|
${n?`<div class="title">${n}</div>`:""}
|
|
916
1166
|
<slot></slot>
|
|
917
1167
|
</div>
|
|
918
|
-
${
|
|
1168
|
+
${b?'<button class="close-btn" aria-label="Dismiss">×</button>':""}
|
|
919
1169
|
</div>
|
|
920
|
-
`}};
|
|
1170
|
+
`}};_("af-alert",fn);xa=fn});var R0={};i(R0,{AfriGrid:()=>Go});function qa(t,n){let{sidebarSide:b="left",sidebarWidth:o="280px",minWidth:l="280px",gap:a="24px",columns:h,rows:f,align:r="stretch",justify:A="stretch",dense:L=!1}=n,S=L?"dense":"",G=`
|
|
921
1171
|
align-items: ${r};
|
|
922
|
-
justify-items: ${
|
|
1172
|
+
justify-items: ${A};
|
|
923
1173
|
gap: ${a};
|
|
924
|
-
`;switch(t){case"sidebar":return
|
|
1174
|
+
`;switch(t){case"sidebar":return b==="right"?`display: grid; grid-template-columns: 1fr ${o}; ${G}`:`display: grid; grid-template-columns: ${o} 1fr; ${G}`;case"holy-grail":return`
|
|
925
1175
|
display: grid;
|
|
926
|
-
grid-template-columns: ${
|
|
1176
|
+
grid-template-columns: ${o} 1fr ${o};
|
|
927
1177
|
grid-template-rows: auto 1fr auto;
|
|
928
1178
|
${G}
|
|
929
1179
|
`;case"bento":return`
|
|
930
1180
|
display: grid;
|
|
931
1181
|
grid-template-columns: repeat(12, 1fr);
|
|
932
1182
|
grid-auto-rows: minmax(120px, auto);
|
|
933
|
-
grid-auto-flow: row ${
|
|
1183
|
+
grid-auto-flow: row ${S};
|
|
934
1184
|
${G}
|
|
935
1185
|
`;case"masonry":return`
|
|
936
1186
|
display: grid;
|
|
937
1187
|
grid-template-columns: repeat(auto-fill, minmax(${l}, 1fr));
|
|
938
1188
|
grid-template-rows: masonry;
|
|
939
|
-
grid-auto-flow: row ${
|
|
1189
|
+
grid-auto-flow: row ${S};
|
|
940
1190
|
${G}
|
|
941
|
-
`;case"auto":default:{let B=
|
|
1191
|
+
`;case"auto":default:{let B=h?`repeat(${h}, 1fr)`:`repeat(auto-fit, minmax(${l}, 1fr))`,En=f?`repeat(${f}, 1fr)`:"auto";return`
|
|
942
1192
|
display: grid;
|
|
943
1193
|
grid-template-columns: ${B};
|
|
944
|
-
${
|
|
945
|
-
grid-auto-flow: row ${
|
|
1194
|
+
${f?`grid-template-rows: ${En};`:""}
|
|
1195
|
+
grid-auto-flow: row ${S};
|
|
946
1196
|
${G}
|
|
947
|
-
`}}}var
|
|
1197
|
+
`}}}var Go;var B0=x(()=>{X();Go=class Go extends c{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`
|
|
948
1198
|
@media (max-width: 768px) {
|
|
949
1199
|
.grid {
|
|
950
1200
|
grid-template-columns: repeat(auto-fit, minmax(min(${t.minWidth}, 100%), 1fr));
|
|
@@ -961,7 +1211,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
961
1211
|
grid-template-columns: 1fr;
|
|
962
1212
|
}
|
|
963
1213
|
}
|
|
964
|
-
`}render(){let t=this._getAttrs(),n=
|
|
1214
|
+
`}render(){let t=this._getAttrs(),n=qa(t.layout,t),b=this._buildResponsiveBreakpoints(t)+this._buildSidebarResponsive(t);this.shadowRoot.innerHTML=Q`
|
|
965
1215
|
<style>
|
|
966
1216
|
:host {
|
|
967
1217
|
display: block;
|
|
@@ -980,7 +1230,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
980
1230
|
min-width: 0; /* Prevent overflow in grid context */
|
|
981
1231
|
}
|
|
982
1232
|
|
|
983
|
-
${
|
|
1233
|
+
${b}
|
|
984
1234
|
</style>
|
|
985
1235
|
|
|
986
1236
|
<div
|
|
@@ -991,7 +1241,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
991
1241
|
>
|
|
992
1242
|
<slot></slot>
|
|
993
1243
|
</div>
|
|
994
|
-
`}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
|
|
1244
|
+
`}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 b of n){let o=b.contentRect.width;if(Math.abs(o-t)>10)t=o,this.emit("af-grid-resize",{width:o,height:b.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")}};_("af-grid",Go)});var D0={};i(D0,{AfriSection:()=>So});var So;var E0=x(()=>{X();So=class So extends c{render(){let t=this.getAttribute("variant")||"default",n=this.getAttribute("title");this.shadowRoot.innerHTML=Q`
|
|
995
1245
|
<style>
|
|
996
1246
|
:host { display: block; width: 100%; }
|
|
997
1247
|
.section {
|
|
@@ -1018,20 +1268,20 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1018
1268
|
}
|
|
1019
1269
|
</style>
|
|
1020
1270
|
<section class="section">
|
|
1021
|
-
${n?
|
|
1271
|
+
${n?Q`
|
|
1022
1272
|
<div class="section-header">
|
|
1023
1273
|
<h2>${n}</h2>
|
|
1024
1274
|
</div>
|
|
1025
1275
|
`:""}
|
|
1026
1276
|
<slot></slot>
|
|
1027
1277
|
</section>
|
|
1028
|
-
`}connectedCallback(){this.render()}};
|
|
1278
|
+
`}connectedCallback(){this.render()}};_("af-section",So)});var O0={};i(O0,{default:()=>ka,AfriIcon:()=>rn});var rn,ka;var W0=x(()=>{X();rn=class rn extends c{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=`
|
|
1029
1279
|
<style>
|
|
1030
1280
|
:host { display: inline-flex; vertical-align: middle; }
|
|
1031
1281
|
svg { width: ${n}px; height: ${n}px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
1032
1282
|
</style>
|
|
1033
|
-
<svg viewBox="0 0 24 24">${
|
|
1034
|
-
`}};
|
|
1283
|
+
<svg viewBox="0 0 24 24">${o}</svg>
|
|
1284
|
+
`}};_("af-icon",rn);ka=rn});var m0={};i(m0,{default:()=>Ha,AfriAccordion:()=>gn});var gn,Ha;var p0=x(()=>{X();gn=class gn extends c{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,b)=>{n.addEventListener("click",()=>{this._toggleItem(b)})})}_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"]'),b=n?Array.from(n.children):[],o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},l=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
|
|
1035
1285
|
<style>
|
|
1036
1286
|
:host {
|
|
1037
1287
|
display: block;
|
|
@@ -1109,20 +1359,20 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1109
1359
|
</style>
|
|
1110
1360
|
|
|
1111
1361
|
<div class="accordion">
|
|
1112
|
-
${
|
|
1362
|
+
${b.map((a,h)=>{let f=this._openItems.has(h),r=`accordion-header-${this._uniqueId}-${h}`,A=`accordion-panel-${this._uniqueId}-${h}`;return`
|
|
1113
1363
|
<div class="accordion-item">
|
|
1114
1364
|
<button
|
|
1115
|
-
class="accordion-header ${
|
|
1116
|
-
aria-expanded="${
|
|
1117
|
-
aria-controls="${
|
|
1365
|
+
class="accordion-header ${f?"active":""}"
|
|
1366
|
+
aria-expanded="${f}"
|
|
1367
|
+
aria-controls="${A}"
|
|
1118
1368
|
id="${r}"
|
|
1119
1369
|
>
|
|
1120
|
-
<span>${a.getAttribute("title")||`Item ${
|
|
1370
|
+
<span>${a.getAttribute("title")||`Item ${h+1}`}</span>
|
|
1121
1371
|
<span class="accordion-icon">▼</span>
|
|
1122
1372
|
</button>
|
|
1123
1373
|
<div
|
|
1124
|
-
class="accordion-content ${
|
|
1125
|
-
id="${
|
|
1374
|
+
class="accordion-content ${f?"open":""}"
|
|
1375
|
+
id="${A}"
|
|
1126
1376
|
role="region"
|
|
1127
1377
|
aria-labelledby="${r}"
|
|
1128
1378
|
>
|
|
@@ -1134,7 +1384,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1134
1384
|
`}).join("")}
|
|
1135
1385
|
</div>
|
|
1136
1386
|
<slot name="items"></slot>
|
|
1137
|
-
`}};
|
|
1387
|
+
`}};_("af-accordion",gn);Ha=gn});var u0={};i(u0,{default:()=>Ya,AfriHero:()=>$n});var $n,Ya;var U0=x(()=>{X();Qt();bt();$n=class $n extends c{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")||"",b=this.getAttribute("pattern")||"",o=this.getAttribute("variant")||"default";this.shadowRoot.innerHTML=`
|
|
1138
1388
|
<style>
|
|
1139
1389
|
:host {
|
|
1140
1390
|
display: flex;
|
|
@@ -1202,11 +1452,11 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1202
1452
|
z-index: 2;
|
|
1203
1453
|
}
|
|
1204
1454
|
|
|
1205
|
-
${
|
|
1455
|
+
${b?`
|
|
1206
1456
|
.pattern-bg {
|
|
1207
1457
|
position: absolute;
|
|
1208
1458
|
inset: 0;
|
|
1209
|
-
background-image: url('${
|
|
1459
|
+
background-image: url('${b}');
|
|
1210
1460
|
background-size: cover;
|
|
1211
1461
|
background-position: center;
|
|
1212
1462
|
opacity: 0.15;
|
|
@@ -1224,7 +1474,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1224
1474
|
|
|
1225
1475
|
<div class="aura"></div>
|
|
1226
1476
|
<div class="mesh"></div>
|
|
1227
|
-
${
|
|
1477
|
+
${b?'<div class="pattern-bg"></div>':""}
|
|
1228
1478
|
|
|
1229
1479
|
<div class="content">
|
|
1230
1480
|
<h1>${t}</h1>
|
|
@@ -1234,7 +1484,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1234
1484
|
</div>
|
|
1235
1485
|
<slot></slot>
|
|
1236
1486
|
</div>
|
|
1237
|
-
`}};
|
|
1487
|
+
`}};_("af-hero",$n);Ya=$n});var V0={};i(V0,{default:()=>Xa,AfriTable:()=>cn});var cn,Xa;var N0=x(()=>{X();cn=class cn extends c{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 b=t[this._sortColumn],o=n[this._sortColumn],l=this._sortDirection==="asc"?1:-1;if(typeof b==="number")return(b-o)*l;return String(b).localeCompare(String(o))*l})}render(){let t=this.getAttribute("theme")||"tanzania",n=this.hasAttribute("striped"),b=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"}},l=o[t]||o.tanzania,a=this._getSortedData();this.shadowRoot.innerHTML=`
|
|
1238
1488
|
<style>
|
|
1239
1489
|
:host {
|
|
1240
1490
|
display: block;
|
|
@@ -1284,7 +1534,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1284
1534
|
}
|
|
1285
1535
|
`:""}
|
|
1286
1536
|
|
|
1287
|
-
${
|
|
1537
|
+
${b?`
|
|
1288
1538
|
tbody tr:hover {
|
|
1289
1539
|
background: ${l.accent}20;
|
|
1290
1540
|
}
|
|
@@ -1301,20 +1551,20 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1301
1551
|
<table>
|
|
1302
1552
|
<thead>
|
|
1303
1553
|
<tr>
|
|
1304
|
-
${this._columns.map((
|
|
1305
|
-
<th data-column="${
|
|
1306
|
-
${
|
|
1554
|
+
${this._columns.map((h)=>`
|
|
1555
|
+
<th data-column="${h.key}">
|
|
1556
|
+
${h.label}
|
|
1307
1557
|
<span class="sort-icon">
|
|
1308
|
-
${this._sortColumn===
|
|
1558
|
+
${this._sortColumn===h.key?this._sortDirection==="asc"?"↑":"↓":"↕"}
|
|
1309
1559
|
</span>
|
|
1310
1560
|
</th>
|
|
1311
1561
|
`).join("")}
|
|
1312
1562
|
</tr>
|
|
1313
1563
|
</thead>
|
|
1314
1564
|
<tbody>
|
|
1315
|
-
${a.length?a.map((
|
|
1565
|
+
${a.length?a.map((h)=>`
|
|
1316
1566
|
<tr>
|
|
1317
|
-
${this._columns.map((
|
|
1567
|
+
${this._columns.map((f)=>`<td>${h[f.key]??""}</td>`).join("")}
|
|
1318
1568
|
</tr>
|
|
1319
1569
|
`).join(""):`
|
|
1320
1570
|
<tr>
|
|
@@ -1324,7 +1574,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1324
1574
|
</tbody>
|
|
1325
1575
|
</table>
|
|
1326
1576
|
</div>
|
|
1327
|
-
`,this.shadowRoot.querySelectorAll("th").forEach((
|
|
1577
|
+
`,this.shadowRoot.querySelectorAll("th").forEach((h)=>{h.addEventListener("click",()=>{this._handleSort(h.dataset.column)})})}};_("af-table",cn);Xa=cn});var K0={};i(K0,{default:()=>ia,AfriModal:()=>vn});var vn,ia;var j0=x(()=>{X();vn=class vn extends c{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"])',b=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[...b,...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 b=n[0],o=n[n.length-1];if(t.shiftKey){if(document.activeElement===b)t.preventDefault(),o.focus()}else if(document.activeElement===o)t.preventDefault(),b.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,b){if(this.render(),t==="open")this._setupListeners()}render(){let t=this.hasAttribute("open"),n=this.getAttribute("theme")||"tanzania",b=this.getAttribute("size")||"md",o={tanzania:{accent:"#1EB53A"},maasai:{accent:"#FF0000"},ndebele:{accent:"#4169E1"}},l=o[n]||o.tanzania,a={sm:"400px",md:"560px",lg:"720px",full:"95vw"},h=this.getAttribute("aria-label"),f=this.getAttribute("aria-labelledby")||"modal-title";this.shadowRoot.innerHTML=`
|
|
1328
1578
|
<style>
|
|
1329
1579
|
:host {
|
|
1330
1580
|
font-family: 'Inter', system-ui, sans-serif;
|
|
@@ -1351,7 +1601,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1351
1601
|
background: white;
|
|
1352
1602
|
border-radius: 8px;
|
|
1353
1603
|
width: 100%;
|
|
1354
|
-
max-width: ${a[
|
|
1604
|
+
max-width: ${a[b]||a.md};
|
|
1355
1605
|
max-height: 90vh;
|
|
1356
1606
|
overflow: hidden;
|
|
1357
1607
|
display: flex;
|
|
@@ -1415,7 +1665,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1415
1665
|
</style>
|
|
1416
1666
|
|
|
1417
1667
|
<div class="backdrop">
|
|
1418
|
-
<div class="modal" role="dialog" aria-modal="true" ${
|
|
1668
|
+
<div class="modal" role="dialog" aria-modal="true" ${h?`aria-label="${h}"`:`aria-labelledby="${f}"`}>
|
|
1419
1669
|
<div class="modal-header">
|
|
1420
1670
|
<slot name="header" id="modal-title"></slot>
|
|
1421
1671
|
<button class="close-btn" aria-label="Close modal">×</button>
|
|
@@ -1428,7 +1678,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1428
1678
|
</div>
|
|
1429
1679
|
</div>
|
|
1430
1680
|
</div>
|
|
1431
|
-
`}};
|
|
1681
|
+
`}};_("af-modal",vn);ia=vn});var I0={};i(I0,{default:()=>La,AfriTabs:()=>wn});var wn,La;var P0=x(()=>{X();wn=class wn extends c{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"]'),b=n?Array.from(n.children):[];if(b.length===0)return;switch(t.key){case"ArrowLeft":t.preventDefault(),this._activeTab=this._activeTab>0?this._activeTab-1:b.length-1,this.render(),this._setupTabs(),this._focusActiveTab();break;case"ArrowRight":t.preventDefault(),this._activeTab=this._activeTab<b.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=b.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,b)=>{n.addEventListener("click",()=>{this._activeTab=b,this.render(),this._setupTabs(),this.emit("af-tab-change",{index:b,tab:n.textContent})})})}attributeChangedCallback(){this.render(),this._setupTabs()}render(){let t=this.getAttribute("theme")||"tanzania",n=this.querySelector('[slot="tabs"]'),b=n?Array.from(n.children):[],o={tanzania:{active:"#1EB53A",text:"#FFFFFF"},maasai:{active:"#FF0000",text:"#FFFFFF"},ndebele:{active:"#4169E1",text:"#FFFFFF"}},l=o[t]||o.tanzania;this.shadowRoot.innerHTML=`
|
|
1432
1682
|
<style>
|
|
1433
1683
|
:host {
|
|
1434
1684
|
display: block;
|
|
@@ -1500,30 +1750,30 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1500
1750
|
|
|
1501
1751
|
<div class="tabs-container">
|
|
1502
1752
|
<div class="tab-list" role="tablist">
|
|
1503
|
-
${
|
|
1504
|
-
<button class="tab-button ${
|
|
1753
|
+
${b.map((a,h)=>`
|
|
1754
|
+
<button class="tab-button ${h===this._activeTab?"active":""}"
|
|
1505
1755
|
role="tab"
|
|
1506
|
-
aria-selected="${
|
|
1507
|
-
aria-controls="panel-${
|
|
1508
|
-
tabindex="${
|
|
1509
|
-
id="tab-${
|
|
1510
|
-
${a.getAttribute("label")||`Tab ${
|
|
1756
|
+
aria-selected="${h===this._activeTab}"
|
|
1757
|
+
aria-controls="panel-${h}"
|
|
1758
|
+
tabindex="${h===this._activeTab?"0":"-1"}"
|
|
1759
|
+
id="tab-${h}">
|
|
1760
|
+
${a.getAttribute("label")||`Tab ${h+1}`}
|
|
1511
1761
|
</button>
|
|
1512
1762
|
`).join("")}
|
|
1513
1763
|
</div>
|
|
1514
1764
|
<div class="tab-panels">
|
|
1515
|
-
${
|
|
1516
|
-
<div class="tab-panel ${
|
|
1765
|
+
${b.map((a,h)=>`
|
|
1766
|
+
<div class="tab-panel ${h===this._activeTab?"active":""}"
|
|
1517
1767
|
role="tabpanel"
|
|
1518
|
-
id="panel-${
|
|
1519
|
-
aria-labelledby="tab-${
|
|
1768
|
+
id="panel-${h}"
|
|
1769
|
+
aria-labelledby="tab-${h}">
|
|
1520
1770
|
${a.innerHTML}
|
|
1521
1771
|
</div>
|
|
1522
1772
|
`).join("")}
|
|
1523
1773
|
</div>
|
|
1524
1774
|
</div>
|
|
1525
1775
|
<slot name="tabs"></slot>
|
|
1526
|
-
`}};
|
|
1776
|
+
`}};_("af-tabs",wn);La=wn});var T0={};i(T0,{default:()=>Ma,AfriSidebar:()=>_n});var _n,Ma;var C0=x(()=>{X();Qt();bt();_n=class _n extends c{static get observedAttributes(){return["position"]}constructor(){super();this._unsubscribe=null}connectedCallback(){super.connectedCallback(),this._unsubscribe=y(()=>{this.updateUI()}),this.render()}disconnectedCallback(){if(this._unsubscribe)this._unsubscribe()}updateUI(){let t=D.ui.sidebarCollapsed,n=this.shadowRoot.querySelector(".sidebar"),b=this.shadowRoot.querySelector(".sidebar-title"),o=this.shadowRoot.getElementById("toggle"),l=this.shadowRoot.querySelector(".sidebar-content");if(n)n.style.width=t?"60px":"260px";if(b)b.style.opacity=t?"0":"1";if(l)l.style.padding=t?"12px":"20px";if(o)o.innerHTML=t?"→":"← Collapse"}render(){let t=this.getAttribute("position")||"left",n=D.ui.sidebarCollapsed;this.shadowRoot.innerHTML=`
|
|
1527
1777
|
<style>
|
|
1528
1778
|
:host {
|
|
1529
1779
|
display: block;
|
|
@@ -1632,7 +1882,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1632
1882
|
</button>
|
|
1633
1883
|
</div>
|
|
1634
1884
|
</aside>
|
|
1635
|
-
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};
|
|
1885
|
+
`,this.shadowRoot.getElementById("toggle").addEventListener("click",()=>{actions.toggleSidebar()})}};_("af-sidebar",_n);Ma=_n});var y0={};i(y0,{default:()=>Qa,AfriDropdown:()=>An});var An,Qa;var e0=x(()=>{X();An=class An extends c{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=`
|
|
1636
1886
|
<style>
|
|
1637
1887
|
:host {
|
|
1638
1888
|
display: inline-block;
|
|
@@ -1714,7 +1964,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1714
1964
|
<div class="dropdown-menu" role="menu" ${n?"":'aria-hidden="true"'}>
|
|
1715
1965
|
<slot></slot>
|
|
1716
1966
|
</div>
|
|
1717
|
-
`,this.shadowRoot.getElementById("trigger").addEventListener("click",(
|
|
1967
|
+
`,this.shadowRoot.getElementById("trigger").addEventListener("click",(b)=>{b.stopPropagation(),this.toggle()})}};_("af-dropdown",An);Qa=An});var Z0={};i(Z0,{default:()=>Ja,AfriSelect:()=>dn});var dn,Ja;var s0=x(()=>{X();dn=class dn extends c{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",(b)=>{this._handleKeydown(b)}),this.shadowRoot.querySelectorAll(".select-option").forEach((b,o)=>{b.addEventListener("click",()=>{this._selectOption(o)})}),document.addEventListener("click",(b)=>{if(!this.contains(b.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 b=this._selectedIndex+t;if(b<0)b=n.length-1;if(b>=n.length)b=0;this._selectedIndex=b,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",b=this.getAttribute("theme")||"tanzania",o=this.getAttribute("error")||"",l=this.hasAttribute("required"),a=this.getAttribute("aria-label"),h=this.getAttribute("aria-describedby"),f={tanzania:{focus:"#1EB53A",error:"#DC3545"},maasai:{focus:"#FF0000",error:"#8B0000"},ndebele:{focus:"#4169E1",error:"#DC143C"}},r=f[b]||f.tanzania,A=[];if(o)A.push(`error-${this._uniqueId}`);if(h)A.push(...h.split(" "));let L=A.length>0?`aria-describedby="${A.join(" ")}"`:"",S=this._selectedIndex>=0?this._options[this._selectedIndex]?.label:n;this.shadowRoot.innerHTML=`
|
|
1718
1968
|
<style>
|
|
1719
1969
|
:host {
|
|
1720
1970
|
display: block;
|
|
@@ -1743,7 +1993,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1743
1993
|
width: 100%;
|
|
1744
1994
|
padding: 10px 40px 10px 13px;
|
|
1745
1995
|
font-size: 15px;
|
|
1746
|
-
border: 2px solid ${
|
|
1996
|
+
border: 2px solid ${o?r.error:"#ddd"};
|
|
1747
1997
|
border-radius: 5px;
|
|
1748
1998
|
background: white;
|
|
1749
1999
|
cursor: pointer;
|
|
@@ -1756,8 +2006,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1756
2006
|
.select-trigger:focus,
|
|
1757
2007
|
.select-trigger.open {
|
|
1758
2008
|
outline: none;
|
|
1759
|
-
border-color: ${
|
|
1760
|
-
box-shadow: 0 0 0 3px ${
|
|
2009
|
+
border-color: ${o?r.error:r.focus};
|
|
2010
|
+
box-shadow: 0 0 0 3px ${o?r.error+"20":r.focus+"20"};
|
|
1761
2011
|
}
|
|
1762
2012
|
|
|
1763
2013
|
.select-arrow {
|
|
@@ -1830,9 +2080,9 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1830
2080
|
aria-expanded="${this._isOpen}"
|
|
1831
2081
|
aria-haspopup="listbox"
|
|
1832
2082
|
${a?`aria-label="${a}"`:""}
|
|
1833
|
-
${
|
|
1834
|
-
${
|
|
1835
|
-
${
|
|
2083
|
+
${o?'aria-invalid="true"':""}
|
|
2084
|
+
${L}>
|
|
2085
|
+
${S}
|
|
1836
2086
|
</button>
|
|
1837
2087
|
<span class="select-arrow" aria-hidden="true">▼</span>
|
|
1838
2088
|
<div class="select-dropdown ${this._isOpen?"open":""}"
|
|
@@ -1848,9 +2098,9 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1848
2098
|
`).join("")}
|
|
1849
2099
|
</div>
|
|
1850
2100
|
</div>
|
|
1851
|
-
${
|
|
2101
|
+
${o?`<div id="error-${this._uniqueId}" class="error-text" role="alert">${o}</div>`:""}
|
|
1852
2102
|
<slot></slot>
|
|
1853
|
-
`}};
|
|
2103
|
+
`}};_("af-select",dn);Ja=dn});var z0={};i(z0,{default:()=>Ga,AfriForm:()=>xn});var xn,Ga;var tb=x(()=>{X();nn();xn=class xn extends c{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,b=this.querySelector('[type="submit"]')||this.shadowRoot.querySelector('button[type="submit"]'),o=this.getAttribute("schema"),l=o?this._getSchema(o):null,a=this.getAttribute("action"),h=this.getAttribute("method")||"GET",f=new FormData(n),r=Object.fromEntries(f.entries());if(Array.from(this.querySelectorAll("af-input")).forEach((L)=>{let S=L.getAttribute("name");if(S)r[S]=L.value}),l){let L=gt.validate(l,r);if(!L.success){this._showValidationErrors(L.errors),this.emit("af-validation-error",{errors:L.errors});return}}if(!a)return;if(b){var A=b.textContent;b.textContent="Wait...",b.disabled=!0}try{let L=await fetch(a,{method:h,headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(L.ok)this.emit("success",await L.json()),this.setAttribute("success","Form submitted successfully!"),this.removeAttribute("error");else{let S=await L.text();this.emit("error",S),this.setAttribute("error",S),this.removeAttribute("success")}}catch(L){this.emit("error",L.message),this.setAttribute("error",L.message),this.removeAttribute("success")}finally{if(b)b.textContent=A,b.disabled=!1}}_getSchema(t){return tn[t]||null}_showValidationErrors(t){this.shadowRoot.querySelectorAll(".field-error").forEach((n)=>n.remove()),Object.entries(t).forEach(([n,b])=>{let o=this.querySelector(`[name="${n}"]`);if(o)if(o.tagName==="AF-INPUT")o.setAttribute("error",b);else{let l=document.createElement("div");l.className="field-error",l.textContent=b,l.style.color="red",l.style.fontSize="12px",l.style.marginTop="4px",o.parentNode.insertBefore(l,o.nextSibling)}})}};_("af-form",xn);Ga=xn});var nb={};i(nb,{default:()=>Sa,AfriTooltip:()=>qn});var qn,Sa;var ob=x(()=>{X();qn=class qn extends c{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",b={top:`
|
|
1854
2104
|
bottom: 100%;
|
|
1855
2105
|
left: 50%;
|
|
1856
2106
|
transform: translateX(-50%) translateY(-8px);
|
|
@@ -1881,7 +2131,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1881
2131
|
|
|
1882
2132
|
.tooltip-content {
|
|
1883
2133
|
position: absolute;
|
|
1884
|
-
${
|
|
2134
|
+
${b[n]}
|
|
1885
2135
|
padding: 8px 12px;
|
|
1886
2136
|
background: #1e1e1e;
|
|
1887
2137
|
border: 1px solid #2a2a2a;
|
|
@@ -1939,7 +2189,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1939
2189
|
<slot></slot>
|
|
1940
2190
|
</span>
|
|
1941
2191
|
<div class="tooltip-content" id="${this._tooltipId}" role="tooltip" aria-hidden="true">${t}</div>
|
|
1942
|
-
`}};
|
|
2192
|
+
`}};_("af-tooltip",qn);Sa=qn});var bb={};i(bb,{default:()=>Fa,AfriToast:()=>kn});var kn,Fa;var lb=x(()=>{X();kn=class kn extends c{static get observedAttributes(){return["type","message","duration"]}constructor(){super();this.render()}show(t,n="info",b=4000){if(this.setAttribute("message",t),this.setAttribute("type",n),this.render(),this.shadowRoot.querySelector(".toast").classList.add("show"),b>0)setTimeout(()=>this.hide(),b)}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")||"",b={success:"✓",error:"✗",warning:"⚠",info:"ℹ"},o={success:"#1EB53A",error:"#EF3340",warning:"#FCD116",info:"#00A3DD"};this.shadowRoot.innerHTML=`
|
|
1943
2193
|
<style>
|
|
1944
2194
|
:host {
|
|
1945
2195
|
position: fixed;
|
|
@@ -1956,7 +2206,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1956
2206
|
padding: 16px 20px;
|
|
1957
2207
|
background: #121212;
|
|
1958
2208
|
border: 1px solid #1e1e1e;
|
|
1959
|
-
border-left: 4px solid ${
|
|
2209
|
+
border-left: 4px solid ${o[t]};
|
|
1960
2210
|
border-radius: 8px;
|
|
1961
2211
|
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
|
|
1962
2212
|
transform: translateX(120%);
|
|
@@ -1973,8 +2223,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
1973
2223
|
width: 28px;
|
|
1974
2224
|
height: 28px;
|
|
1975
2225
|
border-radius: 50%;
|
|
1976
|
-
background: ${
|
|
1977
|
-
color: ${
|
|
2226
|
+
background: ${o[t]}20;
|
|
2227
|
+
color: ${o[t]};
|
|
1978
2228
|
display: flex;
|
|
1979
2229
|
align-items: center;
|
|
1980
2230
|
justify-content: center;
|
|
@@ -2007,13 +2257,13 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2007
2257
|
</style>
|
|
2008
2258
|
|
|
2009
2259
|
<div class="toast">
|
|
2010
|
-
<span class="toast-icon">${
|
|
2260
|
+
<span class="toast-icon">${b[t]}</span>
|
|
2011
2261
|
<div class="toast-content">
|
|
2012
2262
|
<div class="toast-message">${n}</div>
|
|
2013
2263
|
</div>
|
|
2014
2264
|
<button class="toast-close" id="close">×</button>
|
|
2015
2265
|
</div>
|
|
2016
|
-
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};
|
|
2266
|
+
`,this.shadowRoot.getElementById("close")?.addEventListener("click",()=>this.hide())}};_("af-toast",kn);Fa=kn});var ab={};i(ab,{default:()=>Ra,AfriBadge:()=>Hn});var Hn,Ra;var hb=x(()=>{X();Hn=class Hn extends c{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",b=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"}},l=o[t]||o.default,a={sm:{padding:"2px 6px",fontSize:"11px"},md:{padding:"4px 10px",fontSize:"13px"},lg:{padding:"6px 14px",fontSize:"15px"}},h=a[n]||a.md;this.shadowRoot.innerHTML=`
|
|
2017
2267
|
<style>
|
|
2018
2268
|
:host {
|
|
2019
2269
|
display: inline-block;
|
|
@@ -2024,8 +2274,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2024
2274
|
display: inline-flex;
|
|
2025
2275
|
align-items: center;
|
|
2026
2276
|
gap: 5px;
|
|
2027
|
-
padding: ${
|
|
2028
|
-
font-size: ${
|
|
2277
|
+
padding: ${h.padding};
|
|
2278
|
+
font-size: ${h.fontSize};
|
|
2029
2279
|
font-weight: 600;
|
|
2030
2280
|
background: ${l.bg};
|
|
2031
2281
|
color: ${l.text};
|
|
@@ -2052,9 +2302,9 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2052
2302
|
|
|
2053
2303
|
<span class="badge">
|
|
2054
2304
|
<slot></slot>
|
|
2055
|
-
${
|
|
2305
|
+
${b?'<button class="remove-btn" aria-label="Remove">×</button>':""}
|
|
2056
2306
|
</span>
|
|
2057
|
-
`}};
|
|
2307
|
+
`}};_("af-badge",Hn);Ra=Hn});var fb={};i(fb,{default:()=>Ba,AfriAvatar:()=>Yn});var Yn,Ba;var rb=x(()=>{X();Yn=class Yn extends c{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")||"",b=this.getAttribute("size")||"md",o=this.getAttribute("status"),l=this.getAttribute("theme")||"tanzania",a={tanzania:"#1EB53A",maasai:"#FF0000",ndebele:"#4169E1",gold:"#FCD116"},h=a[l]||a.tanzania,f={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"}},r=f[b]||f.md,A={online:"#28a745",offline:"#6c757d",busy:"#dc3545",away:"#ffc107"};this.shadowRoot.innerHTML=`
|
|
2058
2308
|
<style>
|
|
2059
2309
|
:host {
|
|
2060
2310
|
display: inline-block;
|
|
@@ -2069,7 +2319,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2069
2319
|
display: flex;
|
|
2070
2320
|
align-items: center;
|
|
2071
2321
|
justify-content: center;
|
|
2072
|
-
background: ${
|
|
2322
|
+
background: ${h};
|
|
2073
2323
|
color: white;
|
|
2074
2324
|
font-weight: 600;
|
|
2075
2325
|
font-size: ${r.font};
|
|
@@ -2090,15 +2340,15 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2090
2340
|
height: ${r.status};
|
|
2091
2341
|
border-radius: 50%;
|
|
2092
2342
|
border: 2px solid white;
|
|
2093
|
-
background: ${
|
|
2343
|
+
background: ${o?A[o]||A.offline:"transparent"};
|
|
2094
2344
|
}
|
|
2095
2345
|
</style>
|
|
2096
2346
|
|
|
2097
2347
|
<div class="avatar" title="${n}">
|
|
2098
2348
|
${t?`<img src="${t}" alt="${n}" />`:this._getInitials(n)}
|
|
2099
|
-
${
|
|
2349
|
+
${o?'<span class="status"></span>':""}
|
|
2100
2350
|
</div>
|
|
2101
|
-
`}};
|
|
2351
|
+
`}};_("af-avatar",Yn);Ba=Yn});var gb={};i(gb,{default:()=>Da,AfriProgress:()=>Xn});var Xn,Da;var $b=x(()=>{X();Xn=class Xn extends c{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,b=this.getAttribute("theme")||"tanzania",o=this.getAttribute("size")||"md",l=this.getAttribute("label"),a=this.hasAttribute("animated"),h=Math.min(100,Math.max(0,t/n*100)),f={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"}},r=f[b]||f.tanzania,A={sm:"6px",md:"10px",lg:"16px"},L=A[o]||A.md;this.shadowRoot.innerHTML=`
|
|
2102
2352
|
<style>
|
|
2103
2353
|
:host {
|
|
2104
2354
|
display: block;
|
|
@@ -2127,7 +2377,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2127
2377
|
|
|
2128
2378
|
.progress-track {
|
|
2129
2379
|
width: 100%;
|
|
2130
|
-
height: ${
|
|
2380
|
+
height: ${L};
|
|
2131
2381
|
background: ${r.track};
|
|
2132
2382
|
border-radius: 100px;
|
|
2133
2383
|
overflow: hidden;
|
|
@@ -2135,7 +2385,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2135
2385
|
|
|
2136
2386
|
.progress-bar {
|
|
2137
2387
|
height: 100%;
|
|
2138
|
-
width: ${
|
|
2388
|
+
width: ${h}%;
|
|
2139
2389
|
background: ${r.bar};
|
|
2140
2390
|
border-radius: 100px;
|
|
2141
2391
|
transition: width 500ms ease-out;
|
|
@@ -2165,7 +2415,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2165
2415
|
${`
|
|
2166
2416
|
<div class="progress-header">
|
|
2167
2417
|
<span class="progress-label">${l||""}</span>
|
|
2168
|
-
<span class="progress-value">${
|
|
2418
|
+
<span class="progress-value">${h.toFixed(0)}%</span>
|
|
2169
2419
|
</div>
|
|
2170
2420
|
`}
|
|
2171
2421
|
<div class="progress-track">
|
|
@@ -2175,7 +2425,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2175
2425
|
aria-valuemax="${n}"></div>
|
|
2176
2426
|
</div>
|
|
2177
2427
|
</div>
|
|
2178
|
-
`}};
|
|
2428
|
+
`}};_("af-progress",Xn);Da=Xn});var cb={};i(cb,{default:()=>Ea,AfriLoader:()=>Ln});var Ln,Ea;var vb=x(()=>{X();Ln=class Ln extends c{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",b=this.getAttribute("type")||"spiral",o={spiral:`M25,25 m0,-20 a20,20 0 1,1 0,40 a20,20 0 1,1 0,-40
|
|
2179
2429
|
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=`
|
|
2180
2430
|
<style>
|
|
2181
2431
|
:host {
|
|
@@ -2203,10 +2453,10 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2203
2453
|
</style>
|
|
2204
2454
|
<div class="loader">
|
|
2205
2455
|
<svg viewBox="0 0 50 50">
|
|
2206
|
-
${
|
|
2456
|
+
${b==="spiral"?`<path d="${o.spiral}" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:b==="sun"?`<path d="${o.sun}" stroke="currentColor" stroke-width="4" stroke-linecap="round" />`:`<path d="${o.diamond}" fill="none" stroke="currentColor" stroke-width="4" />`}
|
|
2207
2457
|
</svg>
|
|
2208
2458
|
</div>
|
|
2209
|
-
`}};
|
|
2459
|
+
`}};_("af-loader",Ln);Ea=Ln});var wb={};i(wb,{default:()=>Oa,AfriSkeleton:()=>Mn});var Mn,Oa;var _b=x(()=>{X();Mn=class Mn extends c{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%",b=this.getAttribute("height")||"auto",o=parseInt(this.getAttribute("lines"))||1,l={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"}},a=l[t]||l.text;this.shadowRoot.innerHTML=`
|
|
2210
2460
|
<style>
|
|
2211
2461
|
:host {
|
|
2212
2462
|
display: block;
|
|
@@ -2241,33 +2491,33 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2241
2491
|
}
|
|
2242
2492
|
</style>
|
|
2243
2493
|
|
|
2244
|
-
${t==="text"||t==="title"?Array(
|
|
2245
|
-
`}};
|
|
2246
|
-
L${n*0.625},0 L${n*0.75},${
|
|
2247
|
-
L${n*0.9},${
|
|
2248
|
-
L${n*0.7},${
|
|
2249
|
-
L${n*0.5},${
|
|
2250
|
-
L${n*0.3},${
|
|
2251
|
-
L${n*0.1},${
|
|
2494
|
+
${t==="text"||t==="title"?Array(o).fill(0).map(()=>'<div class="skeleton skeleton-line"></div>').join(""):`<div class="skeleton" style="width: ${a.width||n}; height: ${a.height||b};"></div>`}
|
|
2495
|
+
`}};_("af-skeleton",Mn);Oa=Mn});var Ab={};i(Ab,{default:()=>Wa,AfriDivider:()=>Qn});var Qn,Wa;var db=x(()=>{X();Qn=class Qn extends c{static get observedAttributes(){return["pattern","height","color","flip"]}constructor(){super();this.render()}attributeChangedCallback(){this.render()}_getPatternPath(t,n,b){switch(t||"zigzag"){case"zigzag":return`M0,${b} L${n/4},0 L${n/2},${b} L${n*0.75},0 L${n},${b} V${b+10} H0 Z`;case"waves":return`M0,${b/2} Q${n/4},0 ${n/2},${b/2} T${n},${b/2} V${b} H0 Z`;case"triangles":return`M0,${b} L${n/8},0 L${n/4},${b} L${n*0.375},0 L${n/2},${b}
|
|
2496
|
+
L${n*0.625},0 L${n*0.75},${b} L${n*0.875},0 L${n},${b} V${b+10} H0 Z`;case"diamonds":return`M0,0 H${n} V${b/2}
|
|
2497
|
+
L${n*0.9},${b} L${n*0.8},${b/2}
|
|
2498
|
+
L${n*0.7},${b} L${n*0.6},${b/2}
|
|
2499
|
+
L${n*0.5},${b} L${n*0.4},${b/2}
|
|
2500
|
+
L${n*0.3},${b} L${n*0.2},${b/2}
|
|
2501
|
+
L${n*0.1},${b} L0,${b/2} Z`;default:return`M0,0 H${n} V${b} H0 Z`}}render(){let t=this.getAttribute("pattern")||"zigzag",n=this.getAttribute("height")||"50",b=this.getAttribute("color")||"currentColor",o=this.hasAttribute("flip");this.shadowRoot.innerHTML=`
|
|
2252
2502
|
<style>
|
|
2253
2503
|
:host {
|
|
2254
2504
|
display: block;
|
|
2255
2505
|
line-height: 0;
|
|
2256
2506
|
width: 100%;
|
|
2257
2507
|
overflow: hidden;
|
|
2258
|
-
color: ${
|
|
2508
|
+
color: ${b};
|
|
2259
2509
|
}
|
|
2260
2510
|
svg {
|
|
2261
2511
|
display: block;
|
|
2262
2512
|
width: 100%;
|
|
2263
2513
|
height: ${n}px;
|
|
2264
|
-
${
|
|
2514
|
+
${o?"transform: rotate(180deg);":""}
|
|
2265
2515
|
}
|
|
2266
2516
|
</style>
|
|
2267
2517
|
<svg viewBox="0 0 100 ${n}" preserveAspectRatio="none">
|
|
2268
2518
|
<path d="${this._getPatternPath(t,100,parseInt(n))}" fill="currentColor" />
|
|
2269
2519
|
</svg>
|
|
2270
|
-
`}};
|
|
2520
|
+
`}};_("af-divider",Qn);Wa=Qn});var xb={};i(xb,{default:()=>ma,KangaCard:()=>Jn});var Jn,ma;var qb=x(()=>{X();Gt();Jn=class Jn extends c{static get observedAttributes(){return["theme","proverb","proverb-translation"]}constructor(){super();this.render()}connectedCallback(){this.loadStyles(),this.applyTheme()}attributeChangedCallback(t,n,b){if(n!==b)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 b=generateKangaBorder({primaryColor:t.primary,accentColor:t.accent});n.style.backgroundImage=`url("${b}")`,n.style.backgroundRepeat="repeat"}}render(){let t=this.getAttribute("proverb")||"",n=this.getAttribute("proverb-translation")||"",b=this.getThemeColors();this.shadowRoot.innerHTML=`
|
|
2271
2521
|
<style>
|
|
2272
2522
|
:host {
|
|
2273
2523
|
display: block;
|
|
@@ -2290,7 +2540,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2290
2540
|
/* Pindo - Decorative Border */
|
|
2291
2541
|
.pindo {
|
|
2292
2542
|
padding: var(--space-13, 13px);
|
|
2293
|
-
background-color: ${
|
|
2543
|
+
background-color: ${b.primary};
|
|
2294
2544
|
}
|
|
2295
2545
|
|
|
2296
2546
|
/* Mji - Central Content Area */
|
|
@@ -2302,8 +2552,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2302
2552
|
|
|
2303
2553
|
/* Jina - Proverb Inscription */
|
|
2304
2554
|
.jina {
|
|
2305
|
-
background-color: ${
|
|
2306
|
-
color: ${
|
|
2555
|
+
background-color: ${b.border};
|
|
2556
|
+
color: ${b.text};
|
|
2307
2557
|
padding: var(--space-8, 8px) var(--space-13, 13px);
|
|
2308
2558
|
text-align: center;
|
|
2309
2559
|
font-style: italic;
|
|
@@ -2330,7 +2580,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2330
2580
|
}
|
|
2331
2581
|
|
|
2332
2582
|
::slotted(h1), ::slotted(h2), ::slotted(h3) {
|
|
2333
|
-
color: ${
|
|
2583
|
+
color: ${b.primary};
|
|
2334
2584
|
margin-bottom: var(--space-8, 8px);
|
|
2335
2585
|
}
|
|
2336
2586
|
</style>
|
|
@@ -2349,7 +2599,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2349
2599
|
</div>
|
|
2350
2600
|
`:'<div class="jina"><slot name="proverb"></slot></div>'}
|
|
2351
2601
|
</article>
|
|
2352
|
-
`,this.applyTheme()}};
|
|
2602
|
+
`,this.applyTheme()}};_("af-kanga-card",Jn);ma=Jn});var kb={};i(kb,{default:()=>pa,CulturalCard:()=>Gn});var Gn,pa;var Hb=x(()=>{X();Gt();Gn=class Gn extends c{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"),b=this._cultures[t]||this._cultures.maasai,o=Jt[b.pattern],l=o?o():"";this.shadowRoot.innerHTML=`
|
|
2353
2603
|
<style>
|
|
2354
2604
|
:host {
|
|
2355
2605
|
display: block;
|
|
@@ -2391,7 +2641,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2391
2641
|
position: absolute;
|
|
2392
2642
|
bottom: 10px;
|
|
2393
2643
|
left: 10px;
|
|
2394
|
-
background: ${
|
|
2644
|
+
background: ${b.colors.primary};
|
|
2395
2645
|
color: white;
|
|
2396
2646
|
padding: 4px 12px;
|
|
2397
2647
|
border-radius: 20px;
|
|
@@ -2426,7 +2676,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2426
2676
|
.card-title h3 {
|
|
2427
2677
|
margin: 0;
|
|
2428
2678
|
font-size: 18px;
|
|
2429
|
-
color: ${
|
|
2679
|
+
color: ${b.colors.primary};
|
|
2430
2680
|
}
|
|
2431
2681
|
|
|
2432
2682
|
.culture-icon {
|
|
@@ -2435,7 +2685,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2435
2685
|
border-radius: 50%;
|
|
2436
2686
|
background-image: url("${l}");
|
|
2437
2687
|
background-size: cover;
|
|
2438
|
-
border: 2px solid ${
|
|
2688
|
+
border: 2px solid ${b.colors.accent};
|
|
2439
2689
|
}
|
|
2440
2690
|
|
|
2441
2691
|
.card-content {
|
|
@@ -2447,7 +2697,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2447
2697
|
width: 100%;
|
|
2448
2698
|
padding: 10px;
|
|
2449
2699
|
margin-top: 15px;
|
|
2450
|
-
border: 2px solid ${
|
|
2700
|
+
border: 2px solid ${b.colors.primary};
|
|
2451
2701
|
border-radius: 6px;
|
|
2452
2702
|
font-family: inherit;
|
|
2453
2703
|
font-size: 14px;
|
|
@@ -2457,7 +2707,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2457
2707
|
|
|
2458
2708
|
.culture-selector:focus {
|
|
2459
2709
|
outline: none;
|
|
2460
|
-
box-shadow: 0 0 0 3px ${
|
|
2710
|
+
box-shadow: 0 0 0 3px ${b.colors.primary}30;
|
|
2461
2711
|
}
|
|
2462
2712
|
|
|
2463
2713
|
select option {
|
|
@@ -2473,13 +2723,13 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2473
2723
|
<article class="cultural-card">
|
|
2474
2724
|
<div class="pattern-header">
|
|
2475
2725
|
<div class="pattern-overlay"></div>
|
|
2476
|
-
<span class="culture-badge">${
|
|
2477
|
-
<span class="region-badge">\uD83D\uDCCD ${
|
|
2726
|
+
<span class="culture-badge">${b.name}</span>
|
|
2727
|
+
<span class="region-badge">\uD83D\uDCCD ${b.region}</span>
|
|
2478
2728
|
</div>
|
|
2479
2729
|
<div class="card-body">
|
|
2480
2730
|
<div class="card-title">
|
|
2481
2731
|
<div class="culture-icon"></div>
|
|
2482
|
-
<h3>${
|
|
2732
|
+
<h3>${b.name} Pattern</h3>
|
|
2483
2733
|
</div>
|
|
2484
2734
|
<div class="card-content">
|
|
2485
2735
|
<slot></slot>
|
|
@@ -2514,7 +2764,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2514
2764
|
`:""}
|
|
2515
2765
|
</div>
|
|
2516
2766
|
</article>
|
|
2517
|
-
`}};
|
|
2767
|
+
`}};_("af-cultural-card",Gn);pa=Gn});var Yb={};i(Yb,{default:()=>ua,PatternShowcase:()=>Sn});var Sn,ua;var Xb=x(()=>{X();Gt();Sn=class Sn extends c{static get observedAttributes(){return["region","size"]}constructor(){super();this._allPatterns=[{key:"shuka",name:"Maasai Shuka",region:"east",country:"Tanzania/Kenya",fn:pn,meaning:"Bravery, Unity, Identity"},{key:"hadzabe",name:"Hadzabe",region:"east",country:"Tanzania",fn:un,meaning:"Ancient traditions, Hunter-gatherer heritage"},{key:"kanga",name:"Kanga",region:"east",country:"Tanzania/Kenya",fn:Un,meaning:"Communication, Proverbs, Femininity"},{key:"kitenge",name:"Kitenge",region:"east",country:"East Africa",fn:Vn,meaning:"Celebration, African identity"},{key:"tibeb",name:"Tibeb",region:"east",country:"Ethiopia",fn:yn,meaning:"Faith, Tradition, Celebration"},{key:"kente",name:"Kente",region:"west",country:"Ghana",fn:Nn,meaning:"Royalty, Wisdom, Celebration"},{key:"adinkra",name:"Adinkra",region:"west",country:"Ghana",fn:Kn,meaning:"Philosophy, Proverbs, Wisdom"},{key:"bogolan",name:"Bogolan",region:"west",country:"Mali",fn:Pn,meaning:"Earth energy, Protection, Healing"},{key:"asooke",name:"Aso-Oke",region:"west",country:"Nigeria",fn:jn,meaning:"Prestige, Celebration, Heritage"},{key:"adire",name:"Adire (Indigo)",region:"west",country:"Nigeria",fn:no,meaning:"Creativity, Uniqueness, Depth"},{key:"ankara",name:"Ankara",region:"west",country:"West Africa",fn:In,meaning:"Boldness, Pan-African pride"},{key:"kuba",name:"Kuba Shoowa",region:"central",country:"DRC",fn:Tn,meaning:"Status, Mathematics, Eternity"},{key:"imigongo",name:"Imigongo",region:"central",country:"Rwanda",fn:Cn,meaning:"Resilience, Strength, Artistry"},{key:"berber",name:"Berber",region:"north",country:"North Africa",fn:to,meaning:"Protection, Nature, Identity"},{key:"ndebele",name:"Ndebele",region:"south",country:"South Africa",fn:en,meaning:"Artistry, Marriage, Status"},{key:"zulu",name:"Zulu Beadwork",region:"south",country:"South Africa",fn:Zn,meaning:"Love letters, Community"},{key:"swazi",name:"Swazi",region:"south",country:"Eswatini",fn:sn,meaning:"Monarchy, Warriors, Pride"},{key:"xhosa",name:"Xhosa",region:"south",country:"South Africa",fn:zn,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,b=this._allPatterns.find((o)=>o.key===n);if(b)this.emit("af-pattern-select",{pattern:b})})})}attributeChangedCallback(){this.render(),this._setupHovers()}render(){let t=this.getAttribute("region")||"all",n=this.getAttribute("size")||"md",b=t==="all"?this._allPatterns:this._allPatterns.filter((a)=>a.region===t),o={sm:80,md:120,lg:160},l=o[n]||o.md;this.shadowRoot.innerHTML=`
|
|
2518
2768
|
<style>
|
|
2519
2769
|
:host {
|
|
2520
2770
|
display: block;
|
|
@@ -2634,7 +2884,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2634
2884
|
</div>
|
|
2635
2885
|
|
|
2636
2886
|
<div class="pattern-grid">
|
|
2637
|
-
${
|
|
2887
|
+
${b.map((a)=>`
|
|
2638
2888
|
<div class="pattern-item" data-key="${a.key}">
|
|
2639
2889
|
<div class="pattern-preview" style="background-image: url('${a.fn()}')"></div>
|
|
2640
2890
|
<div class="pattern-info">
|
|
@@ -2647,7 +2897,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2647
2897
|
`).join("")}
|
|
2648
2898
|
</div>
|
|
2649
2899
|
</div>
|
|
2650
|
-
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((a)=>{a.addEventListener("click",()=>{this.setAttribute("region",a.dataset.region)})})}};
|
|
2900
|
+
`,this.shadowRoot.querySelectorAll(".region-tab").forEach((a)=>{a.addEventListener("click",()=>{this.setAttribute("region",a.dataset.region)})})}};_("af-pattern-showcase",Sn);ua=Sn});var ib={};i(ib,{AfriLanguageSwitcher:()=>Fo});var Fo;var Lb=x(()=>{X();Fo=class Fo extends c{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",b=t.find((o)=>o.code===n)||t[0];this.shadowRoot.innerHTML=Q`
|
|
2651
2901
|
<style>
|
|
2652
2902
|
:host { display: inline-block; position: relative; font-family: var(--font-body); }
|
|
2653
2903
|
.switcher-btn {
|
|
@@ -2688,17 +2938,17 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2688
2938
|
|
|
2689
2939
|
<button class="switcher-btn">
|
|
2690
2940
|
<span>🌍</span>
|
|
2691
|
-
<span>${
|
|
2941
|
+
<span>${b.name}</span>
|
|
2692
2942
|
</button>
|
|
2693
2943
|
|
|
2694
2944
|
<div class="dropdown">
|
|
2695
|
-
${t.map((
|
|
2696
|
-
<div class="lang-option" data-code="${
|
|
2697
|
-
${
|
|
2945
|
+
${t.map((o)=>Q`
|
|
2946
|
+
<div class="lang-option" data-code="${o.code}" dir="${o.dir||"ltr"}">
|
|
2947
|
+
${o.name}
|
|
2698
2948
|
</div>
|
|
2699
2949
|
`)}
|
|
2700
2950
|
</div>
|
|
2701
|
-
`,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((
|
|
2951
|
+
`,this.shadowRoot.querySelector(".switcher-btn").onclick=()=>{this.toggleAttribute("open")},this.shadowRoot.querySelectorAll(".lang-option").forEach((o)=>{o.onclick=()=>{let l=o.dataset.code;if(this.setAttribute("current",l),this.removeAttribute("open"),this.emit("lang-change",{code:l}),l==="ar")document.documentElement.dir="rtl";else document.documentElement.dir="ltr"}})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}};_("af-language-switcher",Fo)});var Mb={};i(Mb,{AfriAuth:()=>Ro});var Ro;var Qb=x(()=>{X();Ro=class Ro extends c{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",(b)=>{b.preventDefault(),this.mode=this.mode==="login"?"register":"login",this.render(),this.setupEvents()});if(t)t.addEventListener("submit",async(b)=>{b.preventDefault();let o=this.shadowRoot.querySelector("#email").value,l=this.shadowRoot.querySelector("#password").value,a=this.shadowRoot.querySelector(".feedback");a.textContent="Processing...";try{let f=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:this.mode,email:o,password:l})})).json();if(f.error)a.textContent=f.error,a.style.color="#ef4444";else a.textContent="Success! Redirecting...",a.style.color="#22c55e",setTimeout(()=>window.location.href="/",1000)}catch(h){a.textContent="Network Error"}})}render(){let t=this.mode==="login";this.shadowRoot.innerHTML=`
|
|
2702
2952
|
<style>
|
|
2703
2953
|
:host {
|
|
2704
2954
|
display: block;
|
|
@@ -2796,7 +3046,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2796
3046
|
<span class="toggle-mode">${t?"Create an account":"Sign in"}</span>
|
|
2797
3047
|
</div>
|
|
2798
3048
|
</div>
|
|
2799
|
-
`}};
|
|
3049
|
+
`}};_("af-auth",Ro)});var Jb={};i(Jb,{default:()=>Ua});var Bo,Ua;var Gb=x(()=>{X();Bo=class Bo extends c{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=Q`
|
|
2800
3050
|
<style>
|
|
2801
3051
|
.toggle-btn {
|
|
2802
3052
|
background: var(--bg-surface-elevated, var(--afri-obsidian));
|
|
@@ -2825,13 +3075,13 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2825
3075
|
<span class="icon">\${isDark ? '🌙' : '☀️'}</span>
|
|
2826
3076
|
<span>\${isDark ? 'Dark Mode' : 'Light Mode'}</span>
|
|
2827
3077
|
</button>
|
|
2828
|
-
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};
|
|
3078
|
+
`;let n=this.shadowRoot.querySelector(".toggle-btn");if(n)n.addEventListener("click",()=>this.toggleTheme())}};_("af-theme-toggle",Bo);Ua=Bo});bt();Qt();Gt();var oo={};i(oo,{transitionPage:()=>mo,default:()=>Pb,animateStaggered:()=>Wo,Easing:()=>Pt});var Pt={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 Wo(t,{delay:n=50,duration:b=600,easing:o=Pt.DrumBeat,y:l=20,scale:a=0.95}={}){let h=typeof t==="string"?document.querySelectorAll(t):t;if(!h||h.length===0)return;let f=new IntersectionObserver((r)=>{r.forEach((A,L)=>{if(A.isIntersecting){let S=Math.random()*10,G=L*n+S,B=A.target;B.animate([{opacity:0,transform:`translateY(${l}px) scale(${a})`},{opacity:1,transform:"translateY(0) scale(1)"}],{duration:b,delay:G,easing:o,fill:"forwards"}),f.unobserve(B),B.style.opacity="1"}})},{threshold:0.1});h.forEach((r)=>{r.style.opacity="0",f.observe(r)})}function mo(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:Pt.DrumBeat})}}var Pb={Easing:Pt,animateStaggered:Wo,transitionPage:mo};function po(t){if(typeof window>"u")return;if(!("IntersectionObserver"in window)){Object.values(t).forEach((b)=>b());return}let n=new IntersectionObserver((b)=>{b.forEach((o)=>{if(o.isIntersecting){let l=o.target.tagName.toLowerCase(),a=t[l];if(a)console.log(`\uD83C\uDFDD️ Hydrating Island: <${l}>`),a().then(()=>{delete t[l]}).catch((h)=>console.error(`Failed to hydrate <${l}>`,h));n.unobserve(o.target)}})},{rootMargin:"50px 0px"});Object.keys(t).forEach((b)=>{document.querySelectorAll(b).forEach((o)=>n.observe(o))})}nn();vo();var g0="afri_session",ha=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function wo(t=""){return t.split(";").map((n)=>n.trim()).filter(Boolean).reduce((n,b)=>{let o=b.indexOf("=");if(o===-1)return n;let l=b.slice(0,o).trim(),a=b.slice(o+1).trim();return n[l]=a,n},{})}function _o(){return crypto.randomUUID()}function $0(t){let n=t?.headers?.get?.("cookie")||"",o=wo(n).afri_session;if(o&&ha.test(o))return o;return _o()}class c0{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,b){let o=this.get(t),l=n.split("/"),a=o;while(l.length>1){let h=l.shift();if(!a[h]||typeof a[h]!=="object")a[h]={};a=a[h]}return a[l[0]]=b,b}delete(t){return this.sessions.delete(t)}clear(){this.sessions.clear()}}var I=new c0;var v0={incrementCounter(t){let o=(I.get(t).counter?.value||0)+1;return I.set(t,"counter/value",o),o},resetCounter(t){return I.set(t,"counter/value",0),0},getCounter(t){return I.get(t).counter?.value||0}};class Ao{constructor(){this.middlewares=[]}use(t){if(typeof t!=="function")throw Error("Middleware must be a function");return this.middlewares.push(t),this}async run(t){for(let n of this.middlewares){let b=await n(t);if(b instanceof Response)return b;if(b?.response)return b.response;if(b?.context)Object.assign(t,b.context)}return null}}function w0(){return async(t)=>{return co("log",`[AfriCode] ${t.req.method} ${t.pathname}`),{}}}function _0(t={}){return async(n)=>{let{protectedPaths:b=[],authorize:o=()=>!1,unauthorizedResponse:l=()=>new Response("Unauthorized",{status:401})}=t;if(b.some((h)=>n.pathname.startsWith(h))){if(!await o(n))return{response:l(n)}}return{}}}class nt extends Error{constructor(t,n="INTERNAL_ERROR",b={},o=500){super(t);this.name="AfriCodeError",this.code=n,this.context=b,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 on extends nt{constructor(t,n=null,b={}){super(t,"VALIDATION_FAILED",{field:n,...b},422);this.name="ValidationError"}static fromZodError(t){let n=t.issues[0],b=n?.path?.join(".")||null,o=n?.message||"Validation failed";return new on(o,b,{issues:t.issues.map((l)=>({field:l.path.join("."),message:l.message,code:l.code}))})}}class xo extends nt{constructor(t,n){let b=n===""?"an empty string":`"${n}"`;super(`Field '${t}' must be a valid URL or null. Got ${b}.`,"INVALID_URL",{field:t,received:n},422);this.name="InvalidUrlError"}}class pt extends nt{constructor(t,n="SECURITY_VIOLATION",b={},o=403){super(t,n,b,o);this.name="SecurityError"}}class qo extends pt{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 ko extends pt{constructor(t,n="Too many requests. Please try again later."){super(n,"RATE_LIMIT_EXCEEDED",{retryAfter:t},429);this.name="RateLimitError"}}class Ho extends nt{constructor(t,n=null,b={}){super(t,"DATABASE_ERROR",{operation:n,...b},500);this.name="DatabaseError"}}class Yo extends nt{constructor(t,n,b={}){super(`Component Error in <${n}>: ${t}`,"COMPONENT_ERROR",{componentName:n,...b},500);this.name="ComponentError"}}X();X();class Xo extends c{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.",b={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=b[t]||b.tanzania;if(this._hasError){this.shadowRoot.innerHTML=`
|
|
2829
3079
|
<style>
|
|
2830
3080
|
:host { display: block; width: 100%; font-family: 'Inter', system-ui, sans-serif; }
|
|
2831
3081
|
.boundary-error {
|
|
2832
|
-
background: ${
|
|
2833
|
-
border-left: 4px solid ${
|
|
2834
|
-
color: ${
|
|
3082
|
+
background: ${o.bg};
|
|
3083
|
+
border-left: 4px solid ${o.border};
|
|
3084
|
+
color: ${o.text};
|
|
2835
3085
|
padding: 16px 20px;
|
|
2836
3086
|
border-radius: 4px;
|
|
2837
3087
|
margin: 12px 0;
|
|
@@ -2864,8 +3114,8 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2864
3114
|
}
|
|
2865
3115
|
button {
|
|
2866
3116
|
background: transparent;
|
|
2867
|
-
border: 1px solid ${
|
|
2868
|
-
color: ${
|
|
3117
|
+
border: 1px solid ${o.border};
|
|
3118
|
+
color: ${o.text};
|
|
2869
3119
|
padding: 6px 12px;
|
|
2870
3120
|
border-radius: 4px;
|
|
2871
3121
|
cursor: pointer;
|
|
@@ -2896,6 +3146,7 @@ var Wo=Object.defineProperty;var Uo=(t)=>t;function Vo(t,n){this[t]=Uo.bind(null
|
|
|
2896
3146
|
`,this.shadowRoot.getElementById("retry-btn").addEventListener("click",()=>{this.reset()});return}this.shadowRoot.innerHTML=`
|
|
2897
3147
|
<style>:host { display: block; }</style>
|
|
2898
3148
|
<slot></slot>
|
|
2899
|
-
`}}
|
|
3149
|
+
`}}_("af-error-boundary",Xo);io();Lo();Mo();Qo();Jo();var Fn={"af-button":()=>Promise.resolve().then(() => (X0(),Y0)),"af-card":()=>Promise.resolve().then(() => (L0(),i0)),"af-navbar":()=>Promise.resolve().then(() => (Q0(),M0)),"af-input":()=>Promise.resolve().then(() => (G0(),J0)),"af-alert":()=>Promise.resolve().then(() => (F0(),S0)),"af-grid":()=>Promise.resolve().then(() => (B0(),R0)),"af-section":()=>Promise.resolve().then(() => (E0(),D0)),"af-icon":()=>Promise.resolve().then(() => (W0(),O0)),"af-ui-button":()=>Promise.resolve().then(() => (io(),d0)),"af-ui-card":()=>Promise.resolve().then(() => (Lo(),x0)),"af-ui-input":()=>Promise.resolve().then(() => (Mo(),q0)),"af-ui-badge":()=>Promise.resolve().then(() => (Qo(),k0)),"af-ui-switch":()=>Promise.resolve().then(() => (Jo(),H0)),"af-accordion":()=>Promise.resolve().then(() => (p0(),m0)),"af-hero":()=>Promise.resolve().then(() => (U0(),u0)),"af-table":()=>Promise.resolve().then(() => (N0(),V0)),"af-modal":()=>Promise.resolve().then(() => (j0(),K0)),"af-tabs":()=>Promise.resolve().then(() => (P0(),I0)),"af-sidebar":()=>Promise.resolve().then(() => (C0(),T0)),"af-dropdown":()=>Promise.resolve().then(() => (e0(),y0)),"af-select":()=>Promise.resolve().then(() => (s0(),Z0)),"af-form":()=>Promise.resolve().then(() => (tb(),z0)),"af-tooltip":()=>Promise.resolve().then(() => (ob(),nb)),"af-toast":()=>Promise.resolve().then(() => (lb(),bb)),"af-badge":()=>Promise.resolve().then(() => (hb(),ab)),"af-avatar":()=>Promise.resolve().then(() => (rb(),fb)),"af-progress":()=>Promise.resolve().then(() => ($b(),gb)),"af-loader":()=>Promise.resolve().then(() => (vb(),cb)),"af-skeleton":()=>Promise.resolve().then(() => (_b(),wb)),"af-divider":()=>Promise.resolve().then(() => (db(),Ab)),"af-kanga-card":()=>Promise.resolve().then(() => (qb(),xb)),"af-cultural-card":()=>Promise.resolve().then(() => (Hb(),kb)),"af-pattern-showcase":()=>Promise.resolve().then(() => (Xb(),Yb)),"af-language-switcher":()=>Promise.resolve().then(() => (Lb(),ib)),"af-auth":()=>Promise.resolve().then(() => (Qb(),Mb)),"af-theme-toggle":()=>Promise.resolve().then(() => (Gb(),Jb))};var ot={COMPONENT:"component",FORM:"form",LIST:"list",CARD:"card",MODAL:"modal",TOAST:"toast",PROGRESS:"progress"},Kf={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 Sb(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Rn(t){if(Array.isArray(t))return t.map(Rn).join("");if(t===null||t===void 0||t===!1)return"";if(typeof t==="string"||typeof t==="number"||typeof t==="boolean")return Sb(t);if(typeof t!=="object")return"";let n=t.tag||t.tagName;if(!n)return"";let b=t.props||{},o=Object.entries(b).filter(([,a])=>a!==null&&a!==void 0&&a!==!1).map(([a,h])=>h===!0?a:`${a}="${Sb(h)}"`).join(" "),l=Rn(t.children??t.content??"");return`<${n}${o?` ${o}`:""}>${l}</${n}>`}function Va(t){return/<\s*script\b|on\w+\s*=|javascript:/i.test(String(t))}class Bn{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(Va(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(Rn).join(""):Rn(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:b={},children:o=[]}=t,l;switch(n){case ot.COMPONENT:l=this.createCustomComponent(b);break;case ot.FORM:l=this.createForm(b);break;case ot.LIST:l=this.createList(b);break;case ot.CARD:l=this.createCard(b);break;case ot.MODAL:l=this.createModal(b);break;case ot.TOAST:l=this.createToast(b);break;case ot.PROGRESS:l=this.createProgress(b);break;default:throw Error(`Unknown A2UI component type: ${n}`)}if(o.length>0)for(let a of o){let h=this.createElement(a);l.appendChild(h)}return l}createCustomComponent({tag:t,...n}){let b=document.createElement(t||"div");return Object.assign(b,n),b}createForm({fields:t=[],onSubmit:n}){let b=document.createElement("af-form");for(let o of t){let l=document.createElement("af-input");l.setAttribute("name",o.name),l.setAttribute("placeholder",o.placeholder||""),l.setAttribute("type",o.type||"text"),b.appendChild(l)}if(n)b.addEventListener("submit",n);return b}createList({items:t=[]}){let n=document.createElement("af-grid");for(let b of t){let o=this.createCard(b);n.appendChild(o)}return n}createCard({title:t,content:n,image:b}){let o=document.createElement("af-card");if(t){let l=document.createElement("h3");l.textContent=t,o.appendChild(l)}if(n){let l=document.createElement("p");l.textContent=n,o.appendChild(l)}if(b){let l=document.createElement("img");l.src=b,l.alt=t||"Card image",o.appendChild(l)}return o}createModal({title:t,content:n,actions:b=[]}){let o=document.createElement("af-modal");if(o.setAttribute("open",""),t){let a=document.createElement("h2");a.slot="header",a.textContent=t,o.appendChild(a)}if(n){let a=document.createElement("p");a.textContent=n,o.appendChild(a)}let l=document.createElement("div");l.slot="footer";for(let a of b){let h=document.createElement("af-button");if(h.textContent=a.label,a.primary)h.setAttribute("variant","primary");if(a.onClick)h.addEventListener("click",a.onClick);l.appendChild(h)}return o.appendChild(l),o}createToast({message:t,type:n="info",duration:b=3000}){let o=document.createElement("af-toast");return o.setAttribute("type",n),o.textContent=t,setTimeout(()=>{o.remove()},b),o}createProgress({value:t=0,max:n=100,label:b}){let o=document.createElement("af-progress");if(o.setAttribute("value",t),o.setAttribute("max",n),b)o.setAttribute("label",b);return o}update(t,n){let b=this.components.get(t);if(b)Object.assign(b,n)}remove(t){let n=this.components.get(t);if(n)n.remove(),this.components.delete(t)}}class Dn{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(),b=new TextDecoder,o="";while(!0){let{done:l,value:a}=await n.read();if(l)break;o+=b.decode(a,{stream:!0});let h=o.split(`
|
|
3150
|
+
`);o=h.pop();for(let f of h)if(f.trim())this.processMessage(f.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 b of t)b(n)}}}validateAgainstSchema(t){let n=t?.tag||t?.tagName;return Promise.resolve(Boolean(n&&Fn[n]))}}function Fb(t){if(typeof document>"u")t=null;else t=t||document.body;let n=new Bn(t),b=new Dn(n);if(typeof window<"u")window.a2ui={render:(o)=>b.processMessage(o),handleStream:(o)=>b.handleStream(o),update:(o,l)=>n.update(o,l),remove:(o)=>n.remove(o),sendMessage:(o)=>b.sendMessage(o),onMessage:(o)=>b.onMessage(o),createStream:()=>b.createStream(),validateAgainstSchema:(o)=>b.validateAgainstSchema(o)};return{renderer:n,protocol:b}}bt();function Na(t={}){if(typeof window<"u"){console.log("\uD83C\uDF0D AfriCode Browser SDK Initialized");let n={...Fn,...t};if(Object.keys(n).length>0)po(n)}}var ar={createReactiveState:$t,subscribe:y,createSignal:Wn,createEffect:mn,store:D,actions:Eo,patterns:Jt,motion:oo,html:Q,Layout:uo,schemas:tn,Validation:gt,rules:U,afri:h0,AfriFieldBuilder:j,normalizeInput:f0,buildSchema:r0,createFramework:a0,getConfig:mt,getRequestIdentity:$0,parseCookieHeader:wo,createSessionId:_o,SESSION_COOKIE_NAME:g0,sessionStore:I,runtimeActions:v0,MiddlewareManager:Ao,loggerMiddleware:w0,authMiddleware:_0,AfriCodeError:nt,ValidationError:on,InvalidUrlError:xo,SecurityError:pt,CsrfError:qo,RateLimitError:ko,DatabaseError:Ho,ComponentError:Yo,initA2UI:Fb,A2UIRenderer:Bn,A2UIProtocol:Dn,init:Na};export{y as subscribe,D as store,I as sessionStore,tn as schemas,v0 as runtimeActions,U as rules,Jt as patterns,wo as parseCookieHeader,f0 as normalizeInput,oo as motion,w0 as loggerMiddleware,Fb as initA2UI,Na as init,Q as html,$0 as getRequestIdentity,mt as getConfig,ar as default,Wn as createSignal,_o as createSessionId,$t as createReactiveState,a0 as createFramework,mn as createEffect,r0 as buildSchema,_0 as authMiddleware,h0 as afri,Eo as actions,on as ValidationError,gt as Validation,pt as SecurityError,g0 as SESSION_COOKIE_NAME,ko as RateLimitError,Ao as MiddlewareManager,uo as Layout,xo as InvalidUrlError,Ho as DatabaseError,qo as CsrfError,Yo as ComponentError,j as AfriFieldBuilder,nt as AfriCodeError,Bn as A2UIRenderer,Dn as A2UIProtocol};
|
|
2900
3151
|
|
|
2901
|
-
//# debugId=
|
|
3152
|
+
//# debugId=93BD7AC2977DAFC264756E2164756E21
|