your-ai-workflow-firebase-os 1.14.65 → 1.14.67

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.
Files changed (107) hide show
  1. package/README.md +2 -2
  2. package/dist/AddressField-BNDk0sSH.cjs +1 -0
  3. package/dist/{AddressField-BCq5zzC7.js → AddressField-BjgPj4Gc.js} +23 -30
  4. package/dist/ContactPopup-B8gSeCaK.cjs +12 -0
  5. package/dist/{ContactPopup-DeKjWUuc.js → ContactPopup-aOwI-H3Q.js} +4414 -4057
  6. package/dist/PhoneInputField-BBcn3v4d.js +2 -0
  7. package/dist/{PhoneInputField-CwoN3v9L.js → PhoneInputField-DzbnB65k.js} +5 -12
  8. package/dist/PhoneInputField-m6STmA8A.cjs +1 -0
  9. package/dist/{PhoneInputField-OzZ29a2w.cjs → PhoneInputField-p60Pe2nE.cjs} +1 -1
  10. package/dist/aiModels-BHlEfuRJ.js +261 -0
  11. package/dist/aiModels-BIhoTNH0.cjs +1 -0
  12. package/dist/{bake-68Cr0xl2.cjs → bake-D0gLVNTL.cjs} +1 -1
  13. package/dist/{bake-pnQmp4R4.js → bake-OErV2MLy.js} +14 -14
  14. package/dist/components/Bars.d.ts +30 -0
  15. package/dist/components/Basket.d.ts +56 -0
  16. package/dist/components/BuyButton.d.ts +25 -0
  17. package/dist/components/BuyerDetails.d.ts +19 -3
  18. package/dist/components/DashboardNav.d.ts +0 -1
  19. package/dist/components/History.d.ts +18 -0
  20. package/dist/components/MadeBy.d.ts +25 -0
  21. package/dist/components/Navbar.d.ts +16 -0
  22. package/dist/components/NumberStepper.d.ts +50 -0
  23. package/dist/components/Plans.d.ts +20 -0
  24. package/dist/components/Reveal.d.ts +40 -0
  25. package/dist/components/SignInCard.d.ts +51 -0
  26. package/dist/components/SigningIn.d.ts +2 -2
  27. package/dist/components/SupportBar.d.ts +2 -1
  28. package/dist/components/Swatch.d.ts +42 -0
  29. package/dist/components/UploadBox.d.ts +7 -1
  30. package/dist/configs/pages/menuOrders.config.d.ts +6 -6
  31. package/dist/configs/theme.config.d.ts +15 -0
  32. package/dist/contract/rulesCheckedFirestore.d.ts +9 -0
  33. package/dist/{dist-BkUiTtIb.js → dist-_zWHDDrc.js} +1 -1
  34. package/dist/fileBytes-B0qxHYQL.cjs +1 -0
  35. package/dist/fileBytes-uhq3pGCS.js +146 -0
  36. package/dist/index.d.ts +33 -0
  37. package/dist/lib/ThemeContext.d.ts +10 -1
  38. package/dist/lib/access.d.ts +51 -10
  39. package/dist/lib/aiModels.d.ts +60 -11
  40. package/dist/lib/basket.d.ts +57 -0
  41. package/dist/lib/buildChecks.d.ts +17 -0
  42. package/dist/lib/cases.d.ts +99 -0
  43. package/dist/lib/casesFromForm.d.ts +12 -0
  44. package/dist/lib/creator.d.ts +33 -0
  45. package/dist/lib/customPayments.d.ts +27 -3
  46. package/dist/lib/history.d.ts +49 -0
  47. package/dist/lib/orderEntry.d.ts +4 -0
  48. package/dist/lib/pageDesignLines.d.ts +27 -2
  49. package/dist/lib/pageGutter.d.ts +24 -1
  50. package/dist/lib/paymentProducts.d.ts +3 -3
  51. package/dist/lib/payments.d.ts +17 -0
  52. package/dist/lib/plans.d.ts +63 -0
  53. package/dist/lib/publicCopy.d.ts +33 -0
  54. package/dist/lib/recordLock.d.ts +39 -0
  55. package/dist/lib/recordsKey.d.ts +9 -0
  56. package/dist/lib/stock.d.ts +70 -0
  57. package/dist/lib/stockFromOrders.d.ts +56 -0
  58. package/dist/lib/tally.d.ts +41 -0
  59. package/dist/lib/transactions.d.ts +20 -0
  60. package/dist/lib/visitorState.d.ts +16 -4
  61. package/dist/{lucide-react-CWbDYh_b.cjs → lucide-react-CxW3OCAz.cjs} +1 -1
  62. package/dist/{lucide-react-XnMhzoY4.js → lucide-react-DI9OQCGA.js} +2622 -2622
  63. package/dist/{shrinkImage-3xr5ciyA.js → mediaKind-De2Cx_kB.js} +80 -1
  64. package/dist/mediaKind-dk396a03.cjs +1 -0
  65. package/dist/pages/Inbox.d.ts +75 -0
  66. package/dist/pages/PagesAdmin.d.ts +340 -10
  67. package/dist/pages/TransactionsAdmin.d.ts +3 -1
  68. package/dist/{pdf-u73U7-6s.js → pdf-DLuvpvHg.js} +1 -1
  69. package/dist/{pdf.worker.min-BPOWx2_9.js → pdf.worker.min-C0gkd2Ec.js} +1 -1
  70. package/dist/renderer.cjs.js +1 -1
  71. package/dist/renderer.es.js +1 -1
  72. package/dist/server/ai.d.ts +148 -45
  73. package/dist/server/index.d.ts +21 -0
  74. package/dist/server/sold.d.ts +96 -0
  75. package/dist/server/stripeClient.d.ts +20 -0
  76. package/dist/server.cjs.js +7 -5
  77. package/dist/server.es.js +1614 -507
  78. package/dist/templates/PublicPageTemplate.d.ts +3 -1
  79. package/dist/templates/caseMode.d.ts +23 -0
  80. package/dist/validate-0aVjsUWX.js +1473 -0
  81. package/dist/validate-BG8U4JYB.cjs +103 -0
  82. package/dist/{verifiedAccount-CWSiPEGw.js → verifiedAccount-C1iCxopN.js} +20 -15
  83. package/dist/verifiedAccount-D3OeaOBo.cjs +1 -0
  84. package/dist/vite/packageExports.d.ts +1 -0
  85. package/dist/vite/validate.d.ts +21 -0
  86. package/dist/vite.cjs.js +1 -1
  87. package/dist/vite.es.js +1 -1
  88. package/dist/your-ai-workflow-firebase-os.cjs.js +216 -53
  89. package/dist/your-ai-workflow-firebase-os.css +1 -1
  90. package/dist/your-ai-workflow-firebase-os.es.js +12985 -10236
  91. package/package.json +2 -2
  92. package/src/configs/theme.config.ts +24 -1
  93. package/src/index.css +91 -20
  94. package/dist/AddressField-BoWP-YBN.cjs +0 -1
  95. package/dist/ContactPopup-D51WT_JX.cjs +0 -12
  96. package/dist/PhoneInputField-CYGg7OpC.js +0 -2
  97. package/dist/PhoneInputField-DS1Xf7qp.cjs +0 -1
  98. package/dist/fileBytes-7gOo9zta.js +0 -222
  99. package/dist/fileBytes-Bo6AI-u6.cjs +0 -1
  100. package/dist/shrinkImage-C_4Lixmb.cjs +0 -1
  101. package/dist/tabAudience-D3w48LAz.cjs +0 -1
  102. package/dist/tabAudience-DKaiLhWr.js +0 -34
  103. package/dist/validate-4d7Du1h4.js +0 -1216
  104. package/dist/validate-S9GIZ4p8.cjs +0 -103
  105. package/dist/verifiedAccount-COYkSEid.cjs +0 -1
  106. /package/dist/{pdf-B24jYmSf.cjs → pdf-CC5g01eC.cjs} +0 -0
  107. /package/dist/{pdf.worker.min-BvhEiZFe.cjs → pdf.worker.min-pI_P-OCl.cjs} +0 -0
package/README.md CHANGED
@@ -33,8 +33,8 @@ That's it. **One component. Zero configuration files.**
33
33
  | 📁 **File Storage** | An admin-only Assets screen for public images, plus a drive preset any page can be built on |
34
34
  | 📬 **Forms** | Created with their pages on `/pages` — say in one box what a form should ask and what happens after (or name one you already have) and the AI builds it with the page; see and hand-edit every form afterwards on `/forms`. Questions can ask for a file — a CV, a photo, a receipt — and the upload works signed out |
35
35
  | 📥 **Inbox** | Every form entry in one list at `/inbox`, filtered "From anyone" or "From signed-in users"; an attached file opens from the entry by its own name |
36
- | 💳 **Payments** | Stripe checkout in one line — a Take payments switch at the top of `/payments` pauses every Pay button and checkout at once (read by the server, so a built page stops too), then the owner configures what they sell under What you sell on `/payments` (things paid for once — each a name and a price, grouped under one entry — or plans and their Stripe ids), answers How your payments work in one box per payment (start to finish; whatever is skipped, the AI decides), then adds payments to a page from that page's own Payments section on `/pages` — offered first, a Dynamic payment only that page has, whose amount the page works out (`<PayButton amount={total}>`, e.g. a basket's total at checkout); then one they already have, a one-time payment made right there (it lands on `/payments` too), or a subscription (a page with none sends the owner to `/payments` with a subscription already chosen, and back with it added) — and the page's sentence carries the exact `<PayButton>` tags and the owner's words — public and signed-in pages sell with `<PayButton>`, internal and admin pages show the team the sales through `useSales()`, and before-paying questions go through the app's own forms. Connection says Test mode connected and nothing about webhooks while the owner practises; the Go live switch under it is always there and, once flipped, walks the test→live change — the live secret key, live price ids only when a subscription is sold (test ids kept, and the id-swap prompt for the assistant generated), and last the webhook, locked until step 3 of `/publish` is ticked because Stripe needs the published address, which it then hands over with a copy button — buyers get a built-in `/billing` page that appears after their first purchase, and every cancel/switch/invoice screen is Stripe's own billing portal |
37
- | 🧾 **Transactions** | The ledger, `/transactions`: every charge and subscription made through the app, live from Stripe (anything else in the same Stripe account is left out), each row opening on everything the page collected — the buyer's details from `<BuyerDetails>` (their account, made before the Pay button; they ride the button's `metadata`) and the order a public shop sent back through its form, joined to the payment by the entry id the button carried — plus who paid, how, where it goes and the receipt; an order started and never paid for stays listed as No payment. A payment's forms carry `transaction: true`, so their entries land here and never in the Inbox |
36
+ | 💳 **Payments** | Stripe checkout in one line — a Take payments switch at the top of `/payments` pauses every Pay button and checkout at once (read by the server, so a built page stops too), then the owner configures what they sell under What you sell on `/payments` (things paid for once — each a name and a price, grouped under one entry — or plans and their Stripe ids), answers How your payments work in one box per payment (start to finish; whatever is skipped, the AI decides), then adds payments to a page from that page's own Payments section on `/pages` — offered first, a Dynamic payment only that page has, whose amount the page works out (one `<BuyButton amount={total}>`, or a whole basket as `<Basket>` — the bag, who is paying and the Pay button in one drawer, with `<CheckoutReturn>` for the way back); then one they already have, a one-time payment made right there (it lands on `/payments` too), or a subscription (a page with none sends the owner to `/payments` with a subscription already chosen, and back with it added) — and the page's sentence carries the exact `<BuyButton>` tags and the owner's words — public and signed-in pages sell with `<BuyButton>`, `<Basket>` and `<Plans>` (each asks who is paying itself, then goes on to Stripe), internal and admin pages show the team the sales through `useSales()`, and before-paying questions go through the app's own forms. Connection says Test mode connected and nothing about webhooks while the owner practises; the Go live switch under it is always there and, once flipped, walks the test→live change — the live secret key, live price ids only when a subscription is sold (test ids kept, and the id-swap prompt for the assistant generated), and last the webhook, locked until step 3 of `/publish` is ticked because Stripe needs the published address, which it then hands over with a copy button — buyers get a built-in `/billing` page that appears after their first purchase, and every cancel/switch/invoice screen is Stripe's own billing portal |
37
+ | 🧾 **Transactions** | The ledger, `/transactions`: every charge and subscription made through the app, live from Stripe (anything else in the same Stripe account is left out), each row opening on everything the page collected — the buyer's details (their account, asked for by `<BuyButton>` / `<Basket>` before the money moves; they ride the payment's `metadata`) and the order a shop's `<Basket>` saved before the payment started, joined to it by the entry id the payment carried — plus who paid, how, where it goes and the receipt; an order started and never paid for stays listed as No payment. A payment's forms carry `transaction: true`, so their entries land here and never in the Inbox |
38
38
  | 📅 **Schedule** | Calendly-style booking, built in — on `/schedule` the owner keeps SCHEDULES: a week of hours per team member, in that person's own time zone, with the days they are away marked on it. Under them, BOOKING LINKS: one meeting each, booked in a chosen set of hours — its name, its length, how far ahead, how much notice, what it asks the visitor beyond their name and email, and a one-time payment taken first when they want one. Every link has a shipped booking page at `/book/{id}` to send to anyone: the app's theme and name, a full calendar in the visitor's own time zone, and Stripe checkout before the time is confirmed when a payment is attached. One set of hours carries as many links as you like, and they share one availability, so a time taken under any of them is gone from all; Your booking pages makes one address that offers several. The calendar at the top of `/schedule` shows everything booked on a month grid — Paid beside the paid ones, Cancel to free the time — read by an admin as the whole team or as any one person, and whoever booked reads the same calendar under My bookings. On `/pages` a page can be built on somebody's hours (Schedules on that page: a rota, or a page people book time on — the hours are read live, so changing the week changes the page) or carry a plain link to a booking link or page already made (Booking links), and any form can ask a Pick-a-time question. The assistant never builds a calendar, a time picker or a bookings collection |
39
39
  | 🔗 **Payment links** | Every one-time payment has a shipped page at `/pay/{id}` in the app's theme and name — under Payment links on `/payments` the owner adds one from a name, a line about it and a price, copies the link and sends it to anyone; Customise this page makes a real page on `/pages` and hands over the sentence that builds it, and the link goes there once it is built |
40
40
  | ✉️ **Email** | Resend in one line — a Send email switch at the top of `/email` stops every send at once (the server reads it before each one); while it is on, every page can send email once it is connected: `emailOwner()` tells the owner what happened, `emailPerson()` confirms to the person a record names, `emailAnyone()` lets a team page write to any address (a signed-in admin or team member only), receipts and sale alerts send themselves off a Pay button's settings, and `/email` says what the app can do with email and where owner mail goes |
@@ -0,0 +1 @@
1
+ require(`./chunk-CiTBaPhY.cjs`);const e=require(`./lucide-react-CxW3OCAz.cjs`),t=require(`./address-B2E5LmUz.cjs`),n=require(`./dist-BLGlDv1e.cjs`);let r=require(`react`),i=require(`react/jsx-runtime`);var a=null;function o(){return a||(a=n.t.map(e=>{let t=n.n(e);return{iso2:t.iso2,name:t.name}}).sort((e,t)=>e.name.localeCompare(t.name)),a)}var s=e=>o().find(t=>t.iso2===String(e||``).toLowerCase())?.name||``,c={"united states of america":`us`,usa:`us`,"u.s.":`us`,"u.s.a.":`us`,uk:`gb`,"great britain":`gb`,england:`gb`,scotland:`gb`,wales:`gb`,"northern ireland":`gb`,"russian federation":`ru`,deutschland:`de`,españa:`es`,italia:`it`,brasil:`br`,"south korea":`kr`,"republic of korea":`kr`,"north korea":`kp`,czechia:`cz`,"czech republic":`cz`,"viet nam":`vn`,türkiye:`tr`,"the netherlands":`nl`,holland:`nl`,uae:`ae`,"united arab emirates":`ae`,"hong kong sar":`hk`,macau:`mo`,"ivory coast":`ci`,"côte d'ivoire":`ci`,eswatini:`sz`,"myanmar (burma)":`mm`,burma:`mm`};function l(e){let t=String(e||``).trim().toLowerCase();if(!t)return``;if(/^[a-z]{2}$/.test(t)&&o().some(e=>e.iso2===t))return t;if(c[t])return c[t];let n=o().find(e=>e.name.toLowerCase()===t);return n?n.iso2:o().find(e=>t.startsWith(e.name.toLowerCase())||e.name.toLowerCase().startsWith(t))?.iso2||``}function u(e){let t=l(e);return t?s(t):String(e||``).trim()}var d=`https://photon.komoot.io/api/`;function f(e){let t=(e.street||``).trim(),n=(e.housenumber||``).trim();return t?n?`${n} ${t}`:t:(e.name||``).trim()}var p=e=>(e.city||e.town||e.village||e.district||e.county||``).trim();function m(e,t){let n=e.properties;if(!n)return null;let r=f(n),i=p(n);if(!r&&!i)return null;let a=(n.state||``).trim(),o=(n.postcode||``).trim(),s=(n.country||``).trim(),c=[a,o].filter(Boolean).join(` `);return{id:`${n.osm_type||`x`}${n.osm_id??t}-${t}`,label:[r,i,c,s].filter(Boolean).join(`, `),street:r,city:i,region:a,postcode:o,country:s,countryCode:(n.countrycode||``).trim().toLowerCase()}}function h(e){let t=new Set;return e.filter(e=>{let n=e.label.toLowerCase();return t.has(n)?!1:(t.add(n),!0)})}async function g(e,t={}){let n=String(e||``).trim();if(n.length<3)return[];let r=`${d}?q=${encodeURIComponent(n)}&limit=${t.limit??6}`;try{let e=await fetch(r,{signal:t.signal});if(!e.ok)return[];let n=await e.json();return h((Array.isArray(n?.features)?n.features:[]).map(m).filter(e=>e!==null))}catch{return[]}}var _=`text-[13px] font-medium text-foreground/70 select-none mb-2`,v={borderRadius:`var(--input-radius, 0.75rem)`},y=`flex items-center h-12 w-full px-4 text-[15px] text-foreground transition-all duration-300 glass-panel`,b=`block h-12 w-full px-4 py-2 text-[15px] text-foreground transition-all duration-300 placeholder:text-foreground/40 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel`,x=`flex-1 min-w-0 bg-transparent border-none outline-none shadow-none p-0 text-[15px] text-foreground placeholder:text-foreground/40 no-glow`;function S(e){let[t,n]=(0,r.useState)(!1),[i,a]=(0,r.useState)(!1),[o,s]=(0,r.useState)([]),[c,l]=(0,r.useState)(-1),u=(0,r.useRef)(!1),d=(0,r.useRef)(!1),f=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(u.current){u.current=!1;return}if(!d.current){s([]),a(!1),n(!1);return}let t=e.trim();if(t.length<3){s([]),a(!1),n(!1);return}let r=new AbortController;a(!0);let i=setTimeout(async()=>{let e=await g(t,{signal:r.signal});r.signal.aborted||(s(e),l(-1),a(!1),n(e.length>0))},250);return()=>{r.abort(),clearTimeout(i)}},[e]),(0,r.useEffect)(()=>{if(!t)return;let e=e=>{f.current?.contains(e.target)||n(!1)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[t]),{open:t,setOpen:n,busy:i,rows:o,active:c,setActive:l,boxRef:f,typed:d,take:e=>{u.current=!0,e(),n(!1),s([]),l(-1)},onKeyDown:(e,r)=>{if(e.key===`Escape`&&t){e.stopPropagation(),n(!1);return}!t||!o.length||(e.key===`ArrowDown`?(e.preventDefault(),l(e=>(e+1)%o.length)):e.key===`ArrowUp`?(e.preventDefault(),l(e=>(e<=0?o.length:e)-1)):e.key===`Enter`&&c>=0&&(e.preventDefault(),r(o[c])))}}}function C({label:t,value:n,disabled:a,onPick:s}){let[c,u]=(0,r.useState)(!1),[d,f]=(0,r.useState)(``),p=(0,r.useRef)(null),m=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!c){f(``);return}m.current?.focus();let e=e=>{p.current?.contains(e.target)||u(!1)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[c]);let h=d.trim().toLowerCase(),g=h?o().filter(e=>e.name.toLowerCase().includes(h)):o(),_=l(n);return(0,i.jsxs)(`div`,{className:`relative w-full`,ref:p,children:[(0,i.jsxs)(`button`,{type:`button`,disabled:a,onClick:()=>u(e=>!e),"aria-haspopup":`listbox`,"aria-expanded":c,"aria-label":t,className:`${y} justify-between gap-2 text-left cursor-pointer hover:border-accent/40 disabled:cursor-not-allowed disabled:opacity-50`,style:v,children:[(0,i.jsx)(`span`,{className:`truncate ${n?`text-foreground`:`text-foreground/40`}`,children:n||`Country`}),(0,i.jsx)(e.an,{className:`w-3.5 h-3.5 shrink-0 text-foreground/50 transition-transform duration-300 ${c?`rotate-180`:``}`})]}),c&&(0,i.jsxs)(`div`,{role:`listbox`,"aria-label":t,className:`absolute z-[999999] top-[calc(100%+8px)] left-0 w-full glass-popover overflow-hidden`,style:v,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2 px-3 h-11 border-b border-[var(--panel-border)]/50`,children:[(0,i.jsx)(e.P,{className:`w-3.5 h-3.5 shrink-0 text-foreground/35`}),(0,i.jsx)(`input`,{ref:m,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{if(e.key===`Escape`){e.stopPropagation(),u(!1);return}e.key===`Enter`&&(e.preventDefault(),g[0]&&(s(g[0].name),u(!1)))},placeholder:`Search countries`,"aria-label":`Search countries`,autoComplete:`off`,className:`${x} text-[14px]`})]}),(0,i.jsxs)(`div`,{className:`max-h-56 overflow-y-auto no-scrollbar p-1`,children:[n&&!h&&(0,i.jsxs)(`div`,{role:`option`,"aria-selected":!1,onClick:()=>{s(``),u(!1)},className:`flex items-center gap-2.5 px-3 py-2.5 text-[13px] font-medium text-foreground/60 hover:bg-foreground/5 cursor-pointer`,style:{borderRadius:`calc(var(--input-radius, 0.75rem) - 0.25rem)`},children:[(0,i.jsx)(e.o,{className:`w-3.5 h-3.5 shrink-0 text-foreground/35`}),(0,i.jsx)(`span`,{className:`truncate`,children:`No country`})]}),g.map(e=>(0,i.jsx)(`div`,{role:`option`,"aria-selected":e.iso2===_,onClick:()=>{s(e.name),u(!1)},className:`flex items-center px-3 py-2.5 transition-colors font-medium text-[13px] cursor-pointer ${e.iso2===_?`bg-accent/10 text-accent font-bold`:`text-foreground/80 hover:bg-foreground/5 hover:text-foreground`}`,style:{borderRadius:`calc(var(--input-radius, 0.75rem) - 0.25rem)`},children:(0,i.jsx)(`span`,{className:`truncate`,children:e.name})},e.iso2)),g.length===0&&(0,i.jsx)(`div`,{className:`px-3 py-2.5 text-[13px] text-foreground/40`,children:`No match`})]})]})]})}function w({id:n,label:r,value:a,onChange:o,required:s=!1,disabled:c=!1,placeholder:d,error:f}){let p=S(a.street),m=t.a(l(a.country)),h=e=>o({...a,...e}),g=e=>p.take(()=>o({street:e.street,city:e.city,region:e.region,postcode:e.postcode,country:u(e.countryCode||e.country)||a.country})),w=(e,t,n,o,s)=>(0,i.jsx)(`div`,{className:o,children:(0,i.jsx)(`input`,{type:`text`,disabled:c,value:a[e],onChange:t=>h({[e]:t.target.value}),placeholder:n,"aria-label":`${r} — ${t}`,autoComplete:s,className:b,style:v})},e),T=m.postal?`col-span-1`:`col-span-2`,E=m.region?`col-span-1`:`col-span-2`,D=!!(a.country||a.city||a.region||a.postcode);return(0,i.jsxs)(`div`,{className:`flex flex-col w-full`,ref:p.boxRef,children:[(0,i.jsx)(`label`,{className:_,htmlFor:n,children:r}),(0,i.jsxs)(`div`,{className:`relative w-full`,children:[(0,i.jsxs)(`div`,{className:`${y} gap-2.5 focus-within:border-accent glow-focus ${f?`border-red-500/50`:``}`,style:v,children:[(0,i.jsx)(e.st,{className:`w-4 h-4 shrink-0 text-foreground/40`}),(0,i.jsx)(`input`,{id:n,type:`text`,required:s,disabled:c,value:a.street,onChange:e=>{p.typed.current=!0,h({street:e.target.value})},onFocus:()=>{p.rows.length&&p.setOpen(!0)},onKeyDown:e=>p.onKeyDown(e,g),role:`combobox`,"aria-expanded":p.open,"aria-autocomplete":`list`,"aria-controls":`${n}-list`,placeholder:d||`Start typing your address`,autoComplete:`address-line1`,className:x}),p.busy&&(0,i.jsx)(e.mt,{className:`w-3.5 h-3.5 shrink-0 text-foreground/30 animate-spin`})]}),p.open&&(0,i.jsx)(`div`,{id:`${n}-list`,role:`listbox`,"aria-label":r,className:`absolute z-[999999] top-[calc(100%+8px)] left-0 w-full glass-popover overflow-hidden p-1`,style:v,children:p.rows.map((t,n)=>(0,i.jsxs)(`div`,{role:`option`,"aria-selected":n===p.active,onMouseEnter:()=>p.setActive(n),onClick:()=>g(t),className:`flex items-center gap-2.5 px-3 py-2.5 transition-colors text-[13px] font-medium cursor-pointer ${n===p.active?`bg-accent/10 text-accent`:`text-foreground/80 hover:bg-foreground/5`}`,style:{borderRadius:`calc(var(--input-radius, 0.75rem) - 0.25rem)`},children:[(0,i.jsx)(e.st,{className:`w-3.5 h-3.5 shrink-0 text-foreground/35`}),(0,i.jsx)(`span`,{className:`truncate`,children:t.label})]},t.id))})]}),(0,i.jsx)(`div`,{className:`mt-2.5`,children:(0,i.jsx)(C,{label:`${r} — country`,value:a.country,disabled:c,onPick:e=>h({country:e})})}),D&&(0,i.jsxs)(`div`,{className:`grid grid-cols-2 gap-2.5 mt-2.5`,children:[w(`city`,`city`,t.t[m.locality],`col-span-2`,`address-level2`),m.region&&w(`region`,`region`,t.t[m.region],T,`address-level1`),m.postal&&w(`postcode`,`postcode`,t.t[m.postal],E,`postal-code`)]}),f&&(0,i.jsx)(`p`,{className:`text-[13px] text-red-500 font-medium mt-1.5`,children:f})]})}exports.AddressField=w,exports.default=w;
@@ -1,6 +1,6 @@
1
- import { P as e, an as t, o as n, ot as r, pt as i } from "./lucide-react-XnMhzoY4.js";
1
+ import { P as e, an as t, mt as n, o as r, st as i } from "./lucide-react-DI9OQCGA.js";
2
2
  import { a, t as o } from "./address-D8d-lOZG.js";
3
- import { n as s, t as c } from "./dist-BkUiTtIb.js";
3
+ import { n as s, t as c } from "./dist-_zWHDDrc.js";
4
4
  import { useEffect as l, useRef as u, useState as d } from "react";
5
5
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
6
6
  //#region src/lib/countryList.ts
@@ -113,7 +113,7 @@ async function T(e, t = {}) {
113
113
  }
114
114
  //#endregion
115
115
  //#region src/components/AddressField.tsx
116
- var E = "text-[13px] font-medium text-foreground/50 select-none mb-1.5 ml-1", D = { borderRadius: "var(--input-radius, 0.75rem)" }, O = "flex items-center h-12 w-full px-4 text-[15px] text-foreground transition-all duration-300 glass-panel", k = "block h-12 w-full px-4 py-2 text-[15px] text-foreground transition-all duration-300 placeholder:text-foreground/40 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel", A = "flex-1 min-w-0 bg-transparent border-none outline-none shadow-none p-0 text-[15px] text-foreground placeholder:text-foreground/40 no-glow";
116
+ var E = "text-[13px] font-medium text-foreground/70 select-none mb-2", D = { borderRadius: "var(--input-radius, 0.75rem)" }, O = "flex items-center h-12 w-full px-4 text-[15px] text-foreground transition-all duration-300 glass-panel", k = "block h-12 w-full px-4 py-2 text-[15px] text-foreground transition-all duration-300 placeholder:text-foreground/40 focus:outline-none focus:border-accent glow-focus disabled:cursor-not-allowed disabled:opacity-50 glass-panel", A = "flex-1 min-w-0 bg-transparent border-none outline-none shadow-none p-0 text-[15px] text-foreground placeholder:text-foreground/40 no-glow";
117
117
  function j(e) {
118
118
  let [t, n] = d(!1), [r, i] = d(!1), [a, o] = d([]), [s, c] = d(-1), f = u(!1), p = u(!1), m = u(null);
119
119
  return l(() => {
@@ -166,7 +166,7 @@ function j(e) {
166
166
  }
167
167
  };
168
168
  }
169
- function M({ label: r, value: i, disabled: a, onPick: o }) {
169
+ function M({ label: n, value: i, disabled: a, onPick: o }) {
170
170
  let [s, c] = d(!1), [m, g] = d(""), _ = u(null), y = u(null);
171
171
  l(() => {
172
172
  if (!s) {
@@ -189,7 +189,7 @@ function M({ label: r, value: i, disabled: a, onPick: o }) {
189
189
  onClick: () => c((e) => !e),
190
190
  "aria-haspopup": "listbox",
191
191
  "aria-expanded": s,
192
- "aria-label": r,
192
+ "aria-label": n,
193
193
  className: `${O} justify-between gap-2 text-left cursor-pointer hover:border-accent/40 disabled:cursor-not-allowed disabled:opacity-50`,
194
194
  style: D,
195
195
  children: [/* @__PURE__ */ f("span", {
@@ -198,7 +198,7 @@ function M({ label: r, value: i, disabled: a, onPick: o }) {
198
198
  }), /* @__PURE__ */ f(t, { className: `w-3.5 h-3.5 shrink-0 text-foreground/50 transition-transform duration-300 ${s ? "rotate-180" : ""}` })]
199
199
  }), s && /* @__PURE__ */ p("div", {
200
200
  role: "listbox",
201
- "aria-label": r,
201
+ "aria-label": n,
202
202
  className: "absolute z-[999999] top-[calc(100%+8px)] left-0 w-full glass-popover overflow-hidden",
203
203
  style: D,
204
204
  children: [/* @__PURE__ */ p("div", {
@@ -230,7 +230,7 @@ function M({ label: r, value: i, disabled: a, onPick: o }) {
230
230
  },
231
231
  className: "flex items-center gap-2.5 px-3 py-2.5 text-[13px] font-medium text-foreground/60 hover:bg-foreground/5 cursor-pointer",
232
232
  style: { borderRadius: "calc(var(--input-radius, 0.75rem) - 0.25rem)" },
233
- children: [/* @__PURE__ */ f(n, { className: "w-3.5 h-3.5 shrink-0 text-foreground/35" }), /* @__PURE__ */ f("span", {
233
+ children: [/* @__PURE__ */ f(r, { className: "w-3.5 h-3.5 shrink-0 text-foreground/35" }), /* @__PURE__ */ f("span", {
234
234
  className: "truncate",
235
235
  children: "No country"
236
236
  })]
@@ -257,45 +257,38 @@ function M({ label: r, value: i, disabled: a, onPick: o }) {
257
257
  })]
258
258
  });
259
259
  }
260
- function N({ id: e, label: t, value: n, onChange: s, required: c = !1, disabled: l = !1, placeholder: u, error: d }) {
261
- let m = j(n.street), h = a(v(n.country)), g = (e) => s({
262
- ...n,
260
+ function N({ id: e, label: t, value: r, onChange: s, required: c = !1, disabled: l = !1, placeholder: u, error: d }) {
261
+ let m = j(r.street), h = a(v(r.country)), g = (e) => s({
262
+ ...r,
263
263
  ...e
264
264
  }), _ = (e) => m.take(() => s({
265
265
  street: e.street,
266
266
  city: e.city,
267
267
  region: e.region,
268
268
  postcode: e.postcode,
269
- country: y(e.countryCode || e.country) || n.country
270
- })), b = (e, r, i, a, o) => /* @__PURE__ */ f("div", {
269
+ country: y(e.countryCode || e.country) || r.country
270
+ })), b = (e, n, i, a, o) => /* @__PURE__ */ f("div", {
271
271
  className: a,
272
272
  children: /* @__PURE__ */ f("input", {
273
273
  type: "text",
274
274
  disabled: l,
275
- value: n[e],
275
+ value: r[e],
276
276
  onChange: (t) => g({ [e]: t.target.value }),
277
277
  placeholder: i,
278
- "aria-label": `${t} — ${r}`,
278
+ "aria-label": `${t} — ${n}`,
279
279
  autoComplete: o,
280
280
  className: k,
281
281
  style: D
282
282
  })
283
- }, e), x = h.postal ? "col-span-1" : "col-span-2", S = h.region ? "col-span-1" : "col-span-2", C = !!(n.country || n.city || n.region || n.postcode);
283
+ }, e), x = h.postal ? "col-span-1" : "col-span-2", S = h.region ? "col-span-1" : "col-span-2", C = !!(r.country || r.city || r.region || r.postcode);
284
284
  return /* @__PURE__ */ p("div", {
285
285
  className: "flex flex-col w-full",
286
286
  ref: m.boxRef,
287
287
  children: [
288
- /* @__PURE__ */ p("label", {
288
+ /* @__PURE__ */ f("label", {
289
289
  className: E,
290
290
  htmlFor: e,
291
- children: [
292
- t,
293
- " ",
294
- c && /* @__PURE__ */ f("span", {
295
- className: "text-red-500",
296
- children: "*"
297
- })
298
- ]
291
+ children: t
299
292
  }),
300
293
  /* @__PURE__ */ p("div", {
301
294
  className: "relative w-full",
@@ -303,13 +296,13 @@ function N({ id: e, label: t, value: n, onChange: s, required: c = !1, disabled:
303
296
  className: `${O} gap-2.5 focus-within:border-accent glow-focus ${d ? "border-red-500/50" : ""}`,
304
297
  style: D,
305
298
  children: [
306
- /* @__PURE__ */ f(r, { className: "w-4 h-4 shrink-0 text-foreground/40" }),
299
+ /* @__PURE__ */ f(i, { className: "w-4 h-4 shrink-0 text-foreground/40" }),
307
300
  /* @__PURE__ */ f("input", {
308
301
  id: e,
309
302
  type: "text",
310
303
  required: c,
311
304
  disabled: l,
312
- value: n.street,
305
+ value: r.street,
313
306
  onChange: (e) => {
314
307
  m.typed.current = !0, g({ street: e.target.value });
315
308
  },
@@ -325,7 +318,7 @@ function N({ id: e, label: t, value: n, onChange: s, required: c = !1, disabled:
325
318
  autoComplete: "address-line1",
326
319
  className: A
327
320
  }),
328
- m.busy && /* @__PURE__ */ f(i, { className: "w-3.5 h-3.5 shrink-0 text-foreground/30 animate-spin" })
321
+ m.busy && /* @__PURE__ */ f(n, { className: "w-3.5 h-3.5 shrink-0 text-foreground/30 animate-spin" })
329
322
  ]
330
323
  }), m.open && /* @__PURE__ */ f("div", {
331
324
  id: `${e}-list`,
@@ -340,7 +333,7 @@ function N({ id: e, label: t, value: n, onChange: s, required: c = !1, disabled:
340
333
  onClick: () => _(e),
341
334
  className: `flex items-center gap-2.5 px-3 py-2.5 transition-colors text-[13px] font-medium cursor-pointer ${t === m.active ? "bg-accent/10 text-accent" : "text-foreground/80 hover:bg-foreground/5"}`,
342
335
  style: { borderRadius: "calc(var(--input-radius, 0.75rem) - 0.25rem)" },
343
- children: [/* @__PURE__ */ f(r, { className: "w-3.5 h-3.5 shrink-0 text-foreground/35" }), /* @__PURE__ */ f("span", {
336
+ children: [/* @__PURE__ */ f(i, { className: "w-3.5 h-3.5 shrink-0 text-foreground/35" }), /* @__PURE__ */ f("span", {
344
337
  className: "truncate",
345
338
  children: e.label
346
339
  })]
@@ -351,7 +344,7 @@ function N({ id: e, label: t, value: n, onChange: s, required: c = !1, disabled:
351
344
  className: "mt-2.5",
352
345
  children: /* @__PURE__ */ f(M, {
353
346
  label: `${t} — country`,
354
- value: n.country,
347
+ value: r.country,
355
348
  disabled: l,
356
349
  onPick: (e) => g({ country: e })
357
350
  })
@@ -365,7 +358,7 @@ function N({ id: e, label: t, value: n, onChange: s, required: c = !1, disabled:
365
358
  ]
366
359
  }),
367
360
  d && /* @__PURE__ */ f("p", {
368
- className: "text-xs text-red-500 font-medium mt-1.5 ml-1",
361
+ className: "text-[13px] text-red-500 font-medium mt-1.5",
369
362
  children: d
370
363
  })
371
364
  ]