@roxyapi/ui 0.21.1 → 0.22.0
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/AGENTS.md +2 -0
- package/components-catalog.json +123 -123
- package/dist/cdn/components/endpoint-form.js +4 -4
- package/dist/cdn/components/endpoint-form.js.map +3 -3
- package/dist/cdn/roxy-ui.js +37 -37
- package/dist/cdn/roxy-ui.js.map +3 -3
- package/dist/components/endpoint-form.d.ts +35 -2
- package/dist/components/endpoint-form.d.ts.map +1 -1
- package/dist/components/endpoint-form.js +1 -1
- package/dist/components/endpoint-form.js.map +3 -3
- package/dist/index.cjs +42 -42
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +51 -51
- package/dist/index.js.map +3 -3
- package/dist/schemas/post--astrology-relocation-chart.json +1 -1
- package/dist/schemas/post--tarot-spreads-career.json +1 -1
- package/dist/types/types.gen.d.ts +5 -5
- package/dist/utils/field-schema.d.ts +33 -0
- package/dist/utils/field-schema.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/endpoint-form.ts +75 -12
- package/src/types/types.gen.ts +5 -5
- package/src/utils/field-schema.ts +57 -1
- package/src/version.ts +1 -1
|
@@ -52,8 +52,24 @@ export declare class RoxyEndpointForm extends LitElement {
|
|
|
52
52
|
private isRendered;
|
|
53
53
|
/** Ordered, de-duplicated group keys (undefined flat group plus each named object). */
|
|
54
54
|
private groupKeys;
|
|
55
|
-
/** True when the fields in `group` (or the flat top level) carry latitude+longitude
|
|
55
|
+
/** True when the fields in `group` (or the flat top level) carry a latitude+longitude pair, so a location-search can autofill them. Timezone is NOT required here, see {@link LOCATION_PAIR}. */
|
|
56
56
|
private groupHasLocation;
|
|
57
|
+
/**
|
|
58
|
+
* Location groups in field order. Order is load-bearing: when a request carries coordinate
|
|
59
|
+
* groups but only ONE unprefixed top-level `timezone`, the FIRST group owns it, because that
|
|
60
|
+
* timezone belongs to the primary moment (`generateRelocationChart` has one `timezone` and it is
|
|
61
|
+
* the birth timezone). Without an owner both city boxes would write the same key and the second
|
|
62
|
+
* pick would silently overwrite the first with the wrong offset.
|
|
63
|
+
*/
|
|
64
|
+
private locationGroups;
|
|
65
|
+
/**
|
|
66
|
+
* The timezone field a group's city search should fill, or undefined when there is none.
|
|
67
|
+
*
|
|
68
|
+
* Prefers a timezone inside the group (the nested `person1`/`person2` shape has its own). Falls
|
|
69
|
+
* back to an unowned flat `timezone` for the first location group only, which is what makes the
|
|
70
|
+
* prefixed shape work without leaving a decimal-hours box for a visitor to guess at.
|
|
71
|
+
*/
|
|
72
|
+
private timezoneFieldFor;
|
|
57
73
|
/**
|
|
58
74
|
* True when the location block must show a required mark, i.e. ANY member of the trio is required. The block is a single city-search input that fills all three, so if even one is required (e.g. bodygraph requires `timezone` while `latitude`/`longitude` are optional) the input is required and `collectMissing` blocks submit without it. Requiring ALL three understated that: the asterisk went missing on a block the form still enforced, which reads as optional to a non-technical embedder.
|
|
59
75
|
*/
|
|
@@ -67,7 +83,15 @@ export declare class RoxyEndpointForm extends LitElement {
|
|
|
67
83
|
private effectiveSubmitLabel;
|
|
68
84
|
/** The site-owner language from the element `lang` attribute (native), or undefined. Read here, never a Lit property, to avoid shadowing the native accessor. */
|
|
69
85
|
private effectiveLang;
|
|
70
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Location-select handler bound to a group: fills that group's coordinate keys plus whichever
|
|
88
|
+
* timezone field it owns.
|
|
89
|
+
*
|
|
90
|
+
* Keys are LOOKED UP from the model rather than built as `group.name`. That assumption held only
|
|
91
|
+
* while every group came from object nesting; a prefixed group stores under the original wire
|
|
92
|
+
* name (`birthLatitude`), so constructing `birth.latitude` would write a key the request builder
|
|
93
|
+
* never reads and the coordinates would silently stay empty.
|
|
94
|
+
*/
|
|
71
95
|
private onLocationFor;
|
|
72
96
|
private selectTile;
|
|
73
97
|
/** Roving-tabindex arrow-key navigation for a tile radiogroup, modeled on the shared tablist pattern (selection follows focus). */
|
|
@@ -85,6 +109,15 @@ export declare class RoxyEndpointForm extends LitElement {
|
|
|
85
109
|
private renderToggle;
|
|
86
110
|
private renderInput;
|
|
87
111
|
private renderField;
|
|
112
|
+
/**
|
|
113
|
+
* The fields this group's city search actually fills, named in the help text.
|
|
114
|
+
*
|
|
115
|
+
* Not the hardcoded "latitude, longitude, timezone" it used to say: a group does not always own a
|
|
116
|
+
* timezone. `generateRelocationChart` has one top-level `timezone` that belongs to the birth
|
|
117
|
+
* moment, so the relocation block fills coordinates only, and promising a timezone there would be
|
|
118
|
+
* a visible lie on the one form that made this method necessary.
|
|
119
|
+
*/
|
|
120
|
+
private locationFillList;
|
|
88
121
|
private locationBlock;
|
|
89
122
|
private groupCard;
|
|
90
123
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-form.d.ts","sourceRoot":"","sources":["../../src/components/endpoint-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"endpoint-form.d.ts","sourceRoot":"","sources":["../../src/components/endpoint-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AA6BrD;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC;AA6CD;;;;;;;GAOG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IAC/C,MAAM,CAAC,MAAM,4BAsQX;IAGF,QAAQ,SAAiC;IAGzC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAU;IAEhC,wLAAwL;IAExL,OAAO,SAAM;IAEb,gGAAgG;IAEhG,WAAW,SAAM;IAEjB,oHAAoH;IAEpH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gJAAgJ;IAEhJ,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAGxC,OAAO,CAAC,MAAM,CAAkB;IAGhC,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AmCnB,OAAO,CAAC,WAAW;IAanB;;;;;;;OAOG;IACH,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,SAAS;IAWjB,MAAM;IAgDN,OAAO,CAAC,MAAM;CAQd;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,oBAAoB,EAAE,gBAAgB,CAAC;KACvC;CACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var G=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var p=(o,i,e,r)=>{for(var t=r>1?void 0:r?B(i,e):i,n=o.length-1,a;n>=0;n--)(a=o[n])&&(t=(r?a(i,e,t):a(t))||t);return r&&t&&G(i,e,t),t};import{css as J,html as c,LitElement as Z,nothing as g}from"lit";import{customElement as W,property as h,state as y}from"lit/decorators.js";import{ifDefined as O}from"lit/directives/if-defined.js";var L={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};var q=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"];import{css as H}from"lit";var R=H`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;import{css as j,html as V}from"lit";function $(){return V`<svg class="roxy-chevron" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var M=j`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;function T(o){return o?o.charAt(0).toUpperCase()+o.slice(1).toLowerCase():""}function m(o){return o.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([a-z])([0-9])/g,"$1 $2").replace(/^\w/,i=>i.toUpperCase())}var U=12,b=["latitude","longitude","timezone"],K=q.map(o=>o.toLowerCase());function v(o,i){if(o){if("$ref"in o&&o.$ref){let e=o.$ref.split("/").pop();return e?i[e]:void 0}return o}}function E(o){let i=o.anyOf??o.oneOf;return!i||i.length===0?o:i.find(e=>Array.isArray(e.enum))??i.find(e=>A(e)&&A(e)!=="null")??i[0]??o}function A(o){if(typeof o.type=="string")return o.type;if(!Array.isArray(o.type))return;let i=o.type.filter(e=>e!=="null");return i.length===1?i[0]:void 0}function Y(o){let i=E(o),e=A(i);return Array.isArray(i.enum)?i.enum.length<=U?"tiles":"select":e==="boolean"?"toggle":i.format==="date"?"date":i.format==="time"?"time":i.format==="date-time"?"datetime":e==="integer"||e==="number"?"number":e==="string"?"text":e==="array"?"array":null}function C(o){if(o.length!==12)return!1;let i=new Set(o.map(e=>e.toLowerCase()));return K.every(e=>i.has(e))}function w(o,i,e){let r=E(i);return{key:e.key,name:o,group:e.group,inQuery:e.inQuery,kind:Y(i)??"text",required:e.required,description:r.description??i.description,enum:r.enum,min:r.minimum,max:r.maximum,default:i.default??r.default,example:i.example??r.example}}function z(o,i,e){let r=[],t=!1,n=o.requestBody?.content?.["application/json"]?.schema,a=v(n,i);if(a?.properties){let s=new Set(a.required??[]);for(let[d,l]of Object.entries(a.properties)){let f=v(l,i)??{};if(f.type==="object"&&f.properties){let x=new Set(f.required??[]);for(let[S,N]of Object.entries(f.properties)){let _=v(N,i)??{};r.push(w(S,_,{key:`${d}.${S}`,group:d,required:s.has(d)&&x.has(S)}))}}else r.push(w(d,f,{key:d,required:s.has(d)}))}}for(let s of o.parameters??[]){if(s.in!=="path"&&s.in!=="query")continue;if(s.name==="lang"&&s.in==="query"){t=!0;continue}let d=v(s.schema,i)??{};r.push(w(s.name,d,{key:s.name,required:!!s.required,inQuery:s.in==="query"}))}return{title:Q(o.summary,e),fields:r,hasLang:t}}function Q(o,i){let e=o?.split(" - ")[0]?.trim();return e||m(i.split("/").pop()??"")}function D(o){let i=o.toLowerCase();return/compat|synastry|guna|connection|penta|composite/.test(i)?"Compare":/\bcast\b|\/draw|iching|hexagram|tarot/.test(i)?"Cast":/horoscope|dream|angel|nakshatra|crystal|meaning|reference/.test(i)?"Get reading":"Generate"}function F(o,i){let e=i.replace(/^\//,"").replace(/[{}]/g,"").replace(/\//g,"-");return`${o.toLowerCase()}--${e}.json`}var I="0.21.1";var P="https://roxyapi.com/api/v2/openapi.json",X=`https://cdn.jsdelivr.net/npm/@roxyapi/ui@${I}/dist/schemas`,k=new Map;function $e(){k.clear()}async function ee(o){let i=k.get(o);return i||(i=fetch(o).then(async e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{throw k.delete(o),e}),k.set(o,i)),i}function re(){return globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2)}function te(o){let i=o.trim();if(!i)return[];try{let e=JSON.parse(i);if(Array.isArray(e))return e}catch{}return i.split(",").map(e=>e.trim()).filter(Boolean)}var u=class extends Z{constructor(){super(...arguments);this.endpoint="vedic-astrology/birth-chart";this.method="POST";this.specUrl="";this.submitLabel="";this.fields=[];this.formTitle="";this.hasLang=!1;this.values={};this.loaded=!1;this.specError=null;this.validationErrors=[];this.retryLoadSchema=()=>{this.loaded=!1,this.specError=null,this.loadSchema()};this.onSubmit=e=>{e.preventDefault(),this.submit()}}connectedCallback(){super.connectedCallback(),this.loadSchema()}async loadSchema(){this.specError=null;try{this.applyModel(await this.resolveModel())}catch(e){let r=e instanceof Error?e.message:String(e);this.specError=r,this.loaded=!0,this.dispatchEvent(new CustomEvent("roxy-spec-error",{detail:{url:this.specUrl||P,message:r},bubbles:!0,composed:!0}))}}async resolveModel(){return this.specUrl?this.modelFromSpec(this.specUrl):await this.tryLoadSlice()??this.modelFromSpec(P)}async modelFromSpec(e){let r=await ee(e),t=`/${this.endpoint.replace(/^\//,"")}`,n=r.paths?.[t]?.[this.method.toLowerCase()];if(!n)throw new Error(`Endpoint ${this.method} ${t} not found in OpenAPI spec`);return z(n,r.components?.schemas??{},this.endpoint)}async tryLoadSlice(){try{let e=await fetch(`${X}/${F(this.method,this.endpoint)}`);return e.ok?await e.json():null}catch{return null}}applyModel(e){this.fields=e.fields,this.formTitle=e.title,this.hasLang=e.hasLang;let r={};for(let t of e.fields){t.default!==void 0&&(r[t.key]=t.default);let n=t.group?this.initialValues?.[t.group]?.[t.name]:this.initialValues?.[t.name];n!==void 0&&(r[t.key]=n)}this.values=r,this.loaded=!0}setValue(e,r){this.values={...this.values,[e]:r}}roleOf(e){return e.name==="seed"?"seed":(e.name==="limit"||e.name==="offset")&&!e.required?"hidden-default":b.includes(e.name)&&this.groupHasLocation(e.group)?"location":"normal"}isRendered(e){return this.roleOf(e)==="normal"}groupKeys(){let e=[];for(let r of this.fields)e.includes(r.group)||e.push(r.group);return e}groupHasLocation(e){let r=this.fields.filter(t=>t.group===e);return b.every(t=>r.some(n=>n.name===t))}locationRequired(e){let r=this.fields.filter(t=>t.group===e);return b.some(t=>r.some(n=>n.name===t&&n.required))}groupIsRequired(e){return this.groupHasLocation(e)||this.fields.some(r=>r.group===e&&r.required)}get singleEnumField(){if(this.groupKeys().some(t=>this.groupHasLocation(t))||this.groupKeys().some(t=>t!==void 0))return null;let e=this.fields.filter(t=>t.required&&this.isRendered(t)),r=e[0];return e.length!==1||!r?null:r.kind==="tiles"||r.kind==="select"?r:null}effectiveSubmitLabel(){return this.submitLabel||D(this.endpoint)}effectiveLang(){return this.lang||void 0}onLocationFor(e){let r=e?`${e}.`:"";return t=>{let n=t.detail;n&&(this.values={...this.values,[`${r}latitude`]:n.latitude,[`${r}longitude`]:n.longitude,[`${r}timezone`]:n.timezone??n.utcOffset})}}selectTile(e,r){this.setValue(e.key,r),this.singleEnumField?.key===e.key&&this.submit()}onTilesKeyDown(e){return r=>{let t=e.enum??[];if(t.length===0)return;let n=t.indexOf(this.values[e.key]),a;if(r.key==="Home")a=0;else if(r.key==="End")a=t.length-1;else if(r.key==="ArrowRight"||r.key==="ArrowDown")a=n===-1?0:(n+1)%t.length;else if(r.key==="ArrowLeft"||r.key==="ArrowUp")a=n===-1?t.length-1:(n-1+t.length)%t.length;else return;r.preventDefault();let s=t[a];if(s===void 0)return;this.selectTile(e,s);let d=r.currentTarget;requestAnimationFrame(()=>d.querySelector(`[data-tile='${a}']`)?.focus())}}submit(){let e=this.collectMissing();if(e.keys.length>0){this.validationErrors=e.labels,this.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{missing:e.keys},bubbles:!0,composed:!0}));return}this.validationErrors=[];let r={};for(let a of this.fields){let s=this.values[a.key];if(a.name==="seed"&&(s===void 0||s==="")&&(s=re()),!(s===void 0||s===""))if(a.kind==="array"&&typeof s=="string"&&(s=te(s)),a.group){let d=r[a.group]??{};d[a.name]=s,r[a.group]=d}else r[a.name]=s}let t=this.fields.filter(a=>a.inQuery).map(a=>a.name),n=this.effectiveLang();this.hasLang&&n&&(r.lang=n,t.push("lang")),this.dispatchEvent(new CustomEvent("roxy-submit",{detail:{endpoint:this.endpoint,values:r,queryKeys:t,sticky:this.singleEnumField!=null},bubbles:!0,composed:!0}))}collectMissing(){let e=[],r=[],t=new Set;for(let n of this.fields){if(!n.required)continue;let a=this.roleOf(n)==="location";if(!this.isRendered(n)&&!a)continue;let s=this.values[n.key];if(!(s!==void 0&&s!=="")){if(e.push(n.key),a){t.add(n.group);continue}r.push(n.group?`${m(n.group)} ${m(n.name)}`:m(n.name))}}for(let n of t)r.push(n?`${m(n)} location`:"Birth location");return{keys:e,labels:r}}reqMark(e){return e.required?c`<span class="req" aria-hidden="true">*</span>`:g}description(e){if(!e.description)return g;if(e.description.length<=120)return c`<small class="help">${e.description}</small>`;let r=e.description.split(". ")[0]??e.description;return c`<details class="help-details"><summary><span class="help-lead">${r}</span>${$()}</summary><small class="help help-full">${e.description}</small></details>`}renderTiles(e){let r=`roxy-form-${e.key}-label`,t=!!e.enum&&C(e.enum),n=e.enum??[],a=n.indexOf(this.values[e.key]),s=a===-1?0:a;return c`<div class="field tiles-field"><span class="label" id="${r}">${m(e.name)}${this.reqMark(e)}</span><div class="tiles" role="radiogroup" aria-labelledby="${r}" @keydown="${this.onTilesKeyDown(e)}">${n.map((d,l)=>{let f=this.values[e.key]===d,x=t?L[T(d)]:void 0;return c`<button type="button" class="tile" role="radio" data-tile="${l}" aria-checked="${f?"true":"false"}" tabindex="${l===s?"0":"-1"}" @click="${()=>this.selectTile(e,d)}">${x?c`<span class="tile-glyph" aria-hidden="true">${x}</span>`:g} <span class="tile-label">${m(d)}</span></button>`})}</div>${this.description(e)}</div>`}renderSelect(e){let r=`roxy-form-${e.key}`;return c`<div class="field"><label for="${r}">${m(e.name)}${this.reqMark(e)}</label> <select id="${r}" ?required="${e.required}" @change="${t=>this.setValue(e.key,t.target.value)}"><option value="">Choose</option>${(e.enum??[]).map(t=>c`<option value="${t}" ?selected="${this.values[e.key]===t}">${m(t)}</option>`)}</select> ${this.description(e)}</div>`}renderToggle(e){let r=`roxy-form-${e.key}`,t=this.values[e.key]===!0;return c`<div class="field"><div class="toggle-row"><button type="button" id="${r}" class="toggle" role="switch" aria-checked="${t?"true":"false"}" @click="${()=>this.setValue(e.key,!t)}"><span class="knob"></span></button> <label class="toggle-label" for="${r}">${m(e.name)}${this.reqMark(e)}</label></div>${this.description(e)}</div>`}renderInput(e){let r=`roxy-form-${e.key}`,t=e.kind==="datetime"?"datetime-local":e.kind==="number"?"number":e.kind,n=e.kind==="array"?"Comma separated":e.example!=null?String(e.example):"";return c`<div class="field"><label for="${r}">${m(e.name)}${this.reqMark(e)}</label> <input id="${r}" type="${e.kind==="array"?"text":t}" ?required="${e.required}" min="${O(e.min)}" max="${O(e.max)}" step="${e.kind==="number"?"any":g}" placeholder="${n||g}" .value="${this.values[e.key]??""}" @input="${a=>this.setValue(e.key,this.coerce(e.kind,a.target.value))}"> ${this.description(e)}</div>`}renderField(e){switch(e.kind){case"tiles":return this.renderTiles(e);case"select":return this.renderSelect(e);case"toggle":return this.renderToggle(e);default:return this.renderInput(e)}}locationBlock(e){return c`<div class="location-block"><label>${e?`${m(e)} location`:"Birth location"}${this.locationRequired(e)?c`<span class="req" aria-hidden="true">*</span>`:g}</label><roxy-location-search publishable-key="${O(this.publishableKey)}" @roxy-location-select="${this.onLocationFor(e)}" placeholder="City of birth"></roxy-location-search><small class="help">Required: latitude, longitude, timezone. Pick a city to autofill.</small></div>`}groupCard(e){let r=this.fields.filter(t=>t.group===e&&this.isRendered(t));return c`<fieldset class="person-group"><legend>${m(e)}</legend>${this.groupHasLocation(e)?this.locationBlock(e):g}<div class="fields">${r.map(t=>this.renderField(t))}</div></fieldset>`}render(){if(!this.loaded)return c`<form><div class="roxy-skeleton" style="height:8rem"></div></form>`;if(this.specError)return c`<div class="spec-error" role="alert">Schema load failed: ${this.specError} <button type="button" class="submit" @click="${this.retryLoadSchema}">Retry</button></div>`;let e=this.fields.filter(l=>!l.group&&this.isRendered(l)),r=e.filter(l=>l.required),t=e.filter(l=>!l.required),n=this.groupKeys().filter(l=>l!==void 0),a=n.filter(l=>this.groupIsRequired(l)),s=n.filter(l=>!this.groupIsRequired(l)),d=t.length>0||s.length>0;return c`<form @submit="${this.onSubmit}"><h2 class="title">${this.formTitle}</h2>${this.validationErrors.length>0?c`<div class="validation-error" role="alert"><strong>Please complete:</strong> ${this.validationErrors.join(", ")}</div>`:g}<div class="fields">${r.map(l=>this.renderField(l))}</div>${this.groupHasLocation(void 0)?this.locationBlock(void 0):g} ${a.map(l=>this.groupCard(l))} ${d?c`<details class="advanced"><summary>Advanced${$()}</summary><div class="fields">${t.map(l=>this.renderField(l))}</div>${s.map(l=>this.groupCard(l))}</details>`:g} ${this.singleEnumField?g:c`<button class="submit" type="submit">${this.effectiveSubmitLabel()}</button>`}</form>`}coerce(e,r){if(r!==""){if(e==="number"){let t=Number(r);return Number.isFinite(t)?t:void 0}return r}}};u.styles=[R,M,J`form{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.fields{align-items:start;gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.fields:empty{display:none}.person-group{background:var(--roxy-surface,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);gap:var(--roxy-space-md,1rem);min-inline-size:0;margin:0;display:grid}.person-group legend{padding:0 var(--roxy-space-xs,.25rem);font-weight:var(--roxy-weight-bold,600)}.field{gap:var(--roxy-space-xs,.25rem);flex-direction:column;min-width:0;display:flex}.tiles-field{grid-column:1/-1}label,.label{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-secondary,#475569)}.req{color:var(--roxy-danger-fg,#991b1b);margin-left:4px}input,select{box-sizing:border-box;width:100%;padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);font-family:inherit}input:focus,select:focus{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-color:var(--roxy-accent-ink,#b45309)}.help{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem)}.help-details>summary{cursor:pointer;color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);align-items:center;gap:4px;display:flex}.help-details .help-lead{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.help-details .help-full{margin-top:var(--roxy-space-xs,.25rem);display:block}.location-block{gap:var(--roxy-space-xs,.25rem);grid-column:1/-1;display:grid}.tiles{gap:var(--roxy-space-sm,.5rem);grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr));display:grid}.tile{min-height:44px;padding:var(--roxy-space-sm,.5rem);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;transition:border-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease), background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-direction:column;justify-content:center;align-items:center;gap:2px;display:flex}.tile:hover{border-color:var(--roxy-accent,#f59e0b)}.tile[aria-checked=true]{border-color:var(--roxy-accent,#f59e0b);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 12%, transparent);color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.tile:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.tile-glyph{font-size:1.35em;line-height:1}.toggle-row{align-items:center;gap:var(--roxy-space-sm,.5rem);display:flex}.toggle{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);background:var(--roxy-border,#e4e4e7);cursor:pointer;width:44px;height:26px;transition:background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0;padding:0;position:relative}.toggle[aria-checked=true]{background:var(--roxy-accent,#f59e0b);border-color:var(--roxy-accent,#f59e0b)}.toggle .knob{background:var(--roxy-bg,#fff);width:20px;height:20px;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);border-radius:50%;position:absolute;top:2px;left:2px}.toggle[aria-checked=true] .knob{transform:translate(18px)}.toggle:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.toggle-label{cursor:pointer}@media (prefers-reduced-motion:reduce){.tile,.toggle,.toggle .knob{transition:none}}.advanced{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.advanced>summary{cursor:pointer;font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a);align-items:center;gap:6px;display:flex}.advanced[open]>summary{margin-bottom:var(--roxy-space-md,1rem)}.advanced .fields,.advanced .person-group{margin-top:var(--roxy-space-md,1rem)}.validation-error{gap:var(--roxy-space-xs,.25rem);padding:var(--roxy-space-md,1rem);background:color-mix(in srgb, var(--roxy-danger,#dc2626) 8%, transparent);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);display:grid}button.submit{background:var(--roxy-accent-ink,#b45309);color:var(--roxy-bg,#fff);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-lg,1.5rem);font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);cursor:pointer;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));border:0;justify-self:start}button.submit:hover{transform:scale(1.02)}button.submit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}@media (prefers-reduced-motion:reduce){button.submit{transition:none}}.spec-error{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}`],p([h({type:String,attribute:"data-endpoint"})],u.prototype,"endpoint",2),p([h({type:String})],u.prototype,"method",2),p([h({type:String,attribute:"spec-url"})],u.prototype,"specUrl",2),p([h({type:String,attribute:"submit-label"})],u.prototype,"submitLabel",2),p([h({type:String,attribute:"publishable-key"})],u.prototype,"publishableKey",2),p([h({attribute:!1})],u.prototype,"initialValues",2),p([y()],u.prototype,"fields",2),p([y()],u.prototype,"formTitle",2),p([y()],u.prototype,"hasLang",2),p([y()],u.prototype,"values",2),p([y()],u.prototype,"loaded",2),p([y()],u.prototype,"specError",2),p([y()],u.prototype,"validationErrors",2),u=p([W("roxy-endpoint-form")],u);export{u as RoxyEndpointForm,$e as resetSpecCache};
|
|
1
|
+
var H=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var m=(n,i,e,r)=>{for(var t=r>1?void 0:r?j(i,e):i,o=n.length-1,a;o>=0;o--)(a=n[o])&&(t=(r?a(i,e,t):a(t))||t);return r&&t&&H(i,e,t),t};import{css as W,html as c,LitElement as X,nothing as g}from"lit";import{customElement as ee,property as x,state as y}from"lit/decorators.js";import{ifDefined as L}from"lit/directives/if-defined.js";var q={Aries:"\u2648",Taurus:"\u2649",Gemini:"\u264A",Cancer:"\u264B",Leo:"\u264C",Virgo:"\u264D",Libra:"\u264E",Scorpio:"\u264F",Sagittarius:"\u2650",Capricorn:"\u2651",Aquarius:"\u2652",Pisces:"\u2653"};var R=["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"];import{css as B}from"lit";var M=B`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;import{css as V,html as K}from"lit";function $(){return K`<svg class="roxy-chevron" viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`}var T=V`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;function C(n){return n?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():""}function p(n){return n.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([a-z])([0-9])/g,"$1 $2").replace(/^\w/,i=>i.toUpperCase())}var U=12,A=["latitude","longitude","timezone"],O=["latitude","longitude"];function Y(n){let i=n.match(/^(.+?)(Latitude|Longitude)$/);return i?{group:i[1],leaf:i[2].toLowerCase()}:null}var Q=R.map(n=>n.toLowerCase());function v(n,i){if(n){if("$ref"in n&&n.$ref){let e=n.$ref.split("/").pop();return e?i[e]:void 0}return n}}function F(n){let i=n.anyOf??n.oneOf;return!i||i.length===0?n:i.find(e=>Array.isArray(e.enum))??i.find(e=>w(e)&&w(e)!=="null")??i[0]??n}function w(n){if(typeof n.type=="string")return n.type;if(!Array.isArray(n.type))return;let i=n.type.filter(e=>e!=="null");return i.length===1?i[0]:void 0}function J(n){let i=F(n),e=w(i);return Array.isArray(i.enum)?i.enum.length<=U?"tiles":"select":e==="boolean"?"toggle":i.format==="date"?"date":i.format==="time"?"time":i.format==="date-time"?"datetime":e==="integer"||e==="number"?"number":e==="string"?"text":e==="array"?"array":null}function z(n){if(n.length!==12)return!1;let i=new Set(n.map(e=>e.toLowerCase()));return Q.every(e=>i.has(e))}function b(n,i,e){let r=F(i);return{key:e.key,name:n,group:e.group,inQuery:e.inQuery,kind:J(i)??"text",required:e.required,description:r.description??i.description,enum:r.enum,min:r.minimum,max:r.maximum,default:i.default??r.default,example:i.example??r.example}}function E(n,i,e){let r=[],t=!1,o=n.requestBody?.content?.["application/json"]?.schema,a=v(o,i);if(a?.properties){let s=new Set(a.required??[]);for(let[d,l]of Object.entries(a.properties)){let h=v(l,i)??{};if(h.type==="object"&&h.properties){let f=new Set(h.required??[]);for(let[S,_]of Object.entries(h.properties)){let G=v(_,i)??{};r.push(b(S,G,{key:`${d}.${S}`,group:d,required:s.has(d)&&f.has(S)}))}}else{let f=Y(d);r.push(f?b(f.leaf,h,{key:d,group:f.group,required:s.has(d)}):b(d,h,{key:d,required:s.has(d)}))}}}for(let s of n.parameters??[]){if(s.in!=="path"&&s.in!=="query")continue;if(s.name==="lang"&&s.in==="query"){t=!0;continue}let d=v(s.schema,i)??{};r.push(b(s.name,d,{key:s.name,required:!!s.required,inQuery:s.in==="query"}))}return{title:Z(n.summary,e),fields:r,hasLang:t}}function Z(n,i){let e=n?.split(" - ")[0]?.trim();return e||p(i.split("/").pop()??"")}function I(n){let i=n.toLowerCase();return/compat|synastry|guna|connection|penta|composite/.test(i)?"Compare":/\bcast\b|\/draw|iching|hexagram|tarot/.test(i)?"Cast":/horoscope|dream|angel|nakshatra|crystal|meaning|reference/.test(i)?"Get reading":"Generate"}function D(n,i){let e=i.replace(/^\//,"").replace(/[{}]/g,"").replace(/\//g,"-");return`${n.toLowerCase()}--${e}.json`}var P="0.22.0";var N="https://roxyapi.com/api/v2/openapi.json",re=`https://cdn.jsdelivr.net/npm/@roxyapi/ui@${P}/dist/schemas`,k=new Map;function Ae(){k.clear()}async function te(n){let i=k.get(n);return i||(i=fetch(n).then(async e=>{if(!e.ok)throw new Error(`HTTP ${e.status}`);return await e.json()}).catch(e=>{throw k.delete(n),e}),k.set(n,i)),i}function ie(){return globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2)}function ne(n){let i=n.trim();if(!i)return[];try{let e=JSON.parse(i);if(Array.isArray(e))return e}catch{}return i.split(",").map(e=>e.trim()).filter(Boolean)}var u=class extends X{constructor(){super(...arguments);this.endpoint="vedic-astrology/birth-chart";this.method="POST";this.specUrl="";this.submitLabel="";this.fields=[];this.formTitle="";this.hasLang=!1;this.values={};this.loaded=!1;this.specError=null;this.validationErrors=[];this.retryLoadSchema=()=>{this.loaded=!1,this.specError=null,this.loadSchema()};this.onSubmit=e=>{e.preventDefault(),this.submit()}}connectedCallback(){super.connectedCallback(),this.loadSchema()}async loadSchema(){this.specError=null;try{this.applyModel(await this.resolveModel())}catch(e){let r=e instanceof Error?e.message:String(e);this.specError=r,this.loaded=!0,this.dispatchEvent(new CustomEvent("roxy-spec-error",{detail:{url:this.specUrl||N,message:r},bubbles:!0,composed:!0}))}}async resolveModel(){return this.specUrl?this.modelFromSpec(this.specUrl):await this.tryLoadSlice()??this.modelFromSpec(N)}async modelFromSpec(e){let r=await te(e),t=`/${this.endpoint.replace(/^\//,"")}`,o=r.paths?.[t]?.[this.method.toLowerCase()];if(!o)throw new Error(`Endpoint ${this.method} ${t} not found in OpenAPI spec`);return E(o,r.components?.schemas??{},this.endpoint)}async tryLoadSlice(){try{let e=await fetch(`${re}/${D(this.method,this.endpoint)}`);return e.ok?await e.json():null}catch{return null}}applyModel(e){this.fields=e.fields,this.formTitle=e.title,this.hasLang=e.hasLang;let r={};for(let t of e.fields){t.default!==void 0&&(r[t.key]=t.default);let o=t.group?this.initialValues?.[t.group]?.[t.name]:this.initialValues?.[t.name];o!==void 0&&(r[t.key]=o)}this.values=r,this.loaded=!0}setValue(e,r){this.values={...this.values,[e]:r}}roleOf(e){return e.name==="seed"?"seed":(e.name==="limit"||e.name==="offset")&&!e.required?"hidden-default":A.includes(e.name)&&this.groupHasLocation(e.group)||e.name==="timezone"&&this.locationGroups().some(r=>this.timezoneFieldFor(r)?.key===e.key)?"location":"normal"}isRendered(e){return this.roleOf(e)==="normal"}groupKeys(){let e=[];for(let r of this.fields)e.includes(r.group)||e.push(r.group);return e}groupHasLocation(e){let r=this.fields.filter(t=>t.group===e);return O.every(t=>r.some(o=>o.name===t))}locationGroups(){return this.groupKeys().filter(e=>this.groupHasLocation(e))}timezoneFieldFor(e){let r=this.fields.find(t=>t.group===e&&t.name==="timezone");if(r)return r;if(this.locationGroups()[0]===e)return this.fields.find(t=>t.group===void 0&&t.name==="timezone")}locationRequired(e){let r=this.fields.filter(t=>t.group===e);return A.some(t=>r.some(o=>o.name===t&&o.required))}groupIsRequired(e){return this.groupHasLocation(e)||this.fields.some(r=>r.group===e&&r.required)}get singleEnumField(){if(this.groupKeys().some(t=>this.groupHasLocation(t))||this.groupKeys().some(t=>t!==void 0))return null;let e=this.fields.filter(t=>t.required&&this.isRendered(t)),r=e[0];return e.length!==1||!r?null:r.kind==="tiles"||r.kind==="select"?r:null}effectiveSubmitLabel(){return this.submitLabel||I(this.endpoint)}effectiveLang(){return this.lang||void 0}onLocationFor(e){return r=>{let t=r.detail;if(!t)return;let o=h=>this.fields.find(f=>f.group===e&&f.name===h)?.key,a={...this.values},s=o("latitude"),d=o("longitude");s&&(a[s]=t.latitude),d&&(a[d]=t.longitude);let l=this.timezoneFieldFor(e);l&&(a[l.key]=t.timezone??t.utcOffset),this.values=a}}selectTile(e,r){this.setValue(e.key,r),this.singleEnumField?.key===e.key&&this.submit()}onTilesKeyDown(e){return r=>{let t=e.enum??[];if(t.length===0)return;let o=t.indexOf(this.values[e.key]),a;if(r.key==="Home")a=0;else if(r.key==="End")a=t.length-1;else if(r.key==="ArrowRight"||r.key==="ArrowDown")a=o===-1?0:(o+1)%t.length;else if(r.key==="ArrowLeft"||r.key==="ArrowUp")a=o===-1?t.length-1:(o-1+t.length)%t.length;else return;r.preventDefault();let s=t[a];if(s===void 0)return;this.selectTile(e,s);let d=r.currentTarget;requestAnimationFrame(()=>d.querySelector(`[data-tile='${a}']`)?.focus())}}submit(){let e=this.collectMissing();if(e.keys.length>0){this.validationErrors=e.labels,this.dispatchEvent(new CustomEvent("roxy-validation-error",{detail:{missing:e.keys},bubbles:!0,composed:!0}));return}this.validationErrors=[];let r={};for(let a of this.fields){let s=this.values[a.key];if(a.name==="seed"&&(s===void 0||s==="")&&(s=ie()),!(s===void 0||s===""))if(a.kind==="array"&&typeof s=="string"&&(s=ne(s)),a.group){let d=r[a.group]??{};d[a.name]=s,r[a.group]=d}else r[a.name]=s}let t=this.fields.filter(a=>a.inQuery).map(a=>a.name),o=this.effectiveLang();this.hasLang&&o&&(r.lang=o,t.push("lang")),this.dispatchEvent(new CustomEvent("roxy-submit",{detail:{endpoint:this.endpoint,values:r,queryKeys:t,sticky:this.singleEnumField!=null},bubbles:!0,composed:!0}))}collectMissing(){let e=[],r=[],t=new Set;for(let o of this.fields){if(!o.required)continue;let a=this.roleOf(o)==="location";if(!this.isRendered(o)&&!a)continue;let s=this.values[o.key];if(!(s!==void 0&&s!=="")){if(e.push(o.key),a){t.add(o.group);continue}r.push(o.group?`${p(o.group)} ${p(o.name)}`:p(o.name))}}for(let o of t)r.push(o?`${p(o)} location`:"Birth location");return{keys:e,labels:r}}reqMark(e){return e.required?c`<span class="req" aria-hidden="true">*</span>`:g}description(e){if(!e.description)return g;if(e.description.length<=120)return c`<small class="help">${e.description}</small>`;let r=e.description.split(". ")[0]??e.description;return c`<details class="help-details"><summary><span class="help-lead">${r}</span>${$()}</summary><small class="help help-full">${e.description}</small></details>`}renderTiles(e){let r=`roxy-form-${e.key}-label`,t=!!e.enum&&z(e.enum),o=e.enum??[],a=o.indexOf(this.values[e.key]),s=a===-1?0:a;return c`<div class="field tiles-field"><span class="label" id="${r}">${p(e.name)}${this.reqMark(e)}</span><div class="tiles" role="radiogroup" aria-labelledby="${r}" @keydown="${this.onTilesKeyDown(e)}">${o.map((d,l)=>{let h=this.values[e.key]===d,f=t?q[C(d)]:void 0;return c`<button type="button" class="tile" role="radio" data-tile="${l}" aria-checked="${h?"true":"false"}" tabindex="${l===s?"0":"-1"}" @click="${()=>this.selectTile(e,d)}">${f?c`<span class="tile-glyph" aria-hidden="true">${f}</span>`:g} <span class="tile-label">${p(d)}</span></button>`})}</div>${this.description(e)}</div>`}renderSelect(e){let r=`roxy-form-${e.key}`;return c`<div class="field"><label for="${r}">${p(e.name)}${this.reqMark(e)}</label> <select id="${r}" ?required="${e.required}" @change="${t=>this.setValue(e.key,t.target.value)}"><option value="">Choose</option>${(e.enum??[]).map(t=>c`<option value="${t}" ?selected="${this.values[e.key]===t}">${p(t)}</option>`)}</select> ${this.description(e)}</div>`}renderToggle(e){let r=`roxy-form-${e.key}`,t=this.values[e.key]===!0;return c`<div class="field"><div class="toggle-row"><button type="button" id="${r}" class="toggle" role="switch" aria-checked="${t?"true":"false"}" @click="${()=>this.setValue(e.key,!t)}"><span class="knob"></span></button> <label class="toggle-label" for="${r}">${p(e.name)}${this.reqMark(e)}</label></div>${this.description(e)}</div>`}renderInput(e){let r=`roxy-form-${e.key}`,t=e.kind==="datetime"?"datetime-local":e.kind==="number"?"number":e.kind,o=e.kind==="array"?"Comma separated":e.example!=null?String(e.example):"";return c`<div class="field"><label for="${r}">${p(e.name)}${this.reqMark(e)}</label> <input id="${r}" type="${e.kind==="array"?"text":t}" ?required="${e.required}" min="${L(e.min)}" max="${L(e.max)}" step="${e.kind==="number"?"any":g}" placeholder="${o||g}" .value="${this.values[e.key]??""}" @input="${a=>this.setValue(e.key,this.coerce(e.kind,a.target.value))}"> ${this.description(e)}</div>`}renderField(e){switch(e.kind){case"tiles":return this.renderTiles(e);case"select":return this.renderSelect(e);case"toggle":return this.renderToggle(e);default:return this.renderInput(e)}}locationFillList(e){let r=[...O];return this.timezoneFieldFor(e)&&r.push("timezone"),r.join(", ")}locationBlock(e){return c`<div class="location-block"><label>${e?`${p(e)} location`:"Birth location"}${this.locationRequired(e)?c`<span class="req" aria-hidden="true">*</span>`:g}</label><roxy-location-search publishable-key="${L(this.publishableKey)}" @roxy-location-select="${this.onLocationFor(e)}" placeholder="${e?`${p(e)} city`:"City of birth"}"></roxy-location-search><small class="help">Fills ${this.locationFillList(e)}. Pick a city to autofill.</small></div>`}groupCard(e){let r=this.fields.filter(t=>t.group===e&&this.isRendered(t));return c`<fieldset class="person-group"><legend>${p(e)}</legend>${this.groupHasLocation(e)?this.locationBlock(e):g}<div class="fields">${r.map(t=>this.renderField(t))}</div></fieldset>`}render(){if(!this.loaded)return c`<form><div class="roxy-skeleton" style="height:8rem"></div></form>`;if(this.specError)return c`<div class="spec-error" role="alert">Schema load failed: ${this.specError} <button type="button" class="submit" @click="${this.retryLoadSchema}">Retry</button></div>`;let e=this.fields.filter(l=>!l.group&&this.isRendered(l)),r=e.filter(l=>l.required),t=e.filter(l=>!l.required),o=this.groupKeys().filter(l=>l!==void 0),a=o.filter(l=>this.groupIsRequired(l)),s=o.filter(l=>!this.groupIsRequired(l)),d=t.length>0||s.length>0;return c`<form @submit="${this.onSubmit}"><h2 class="title">${this.formTitle}</h2>${this.validationErrors.length>0?c`<div class="validation-error" role="alert"><strong>Please complete:</strong> ${this.validationErrors.join(", ")}</div>`:g}<div class="fields">${r.map(l=>this.renderField(l))}</div>${this.groupHasLocation(void 0)?this.locationBlock(void 0):g} ${a.map(l=>this.groupCard(l))} ${d?c`<details class="advanced"><summary>Advanced${$()}</summary><div class="fields">${t.map(l=>this.renderField(l))}</div>${s.map(l=>this.groupCard(l))}</details>`:g} ${this.singleEnumField?g:c`<button class="submit" type="submit">${this.effectiveSubmitLabel()}</button>`}</form>`}coerce(e,r){if(r!==""){if(e==="number"){let t=Number(r);return Number.isFinite(t)?t:void 0}return r}}};u.styles=[M,T,W`form{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.fields{align-items:start;gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.fields:empty{display:none}.person-group{background:var(--roxy-surface,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);gap:var(--roxy-space-md,1rem);min-inline-size:0;margin:0;display:grid}.person-group legend{padding:0 var(--roxy-space-xs,.25rem);font-weight:var(--roxy-weight-bold,600)}.field{gap:var(--roxy-space-xs,.25rem);flex-direction:column;min-width:0;display:flex}.tiles-field{grid-column:1/-1}label,.label{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-secondary,#475569)}.req{color:var(--roxy-danger-fg,#991b1b);margin-left:4px}input,select{box-sizing:border-box;width:100%;padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);font-family:inherit}input:focus,select:focus{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-color:var(--roxy-accent-ink,#b45309)}.help{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem)}.help-details>summary{cursor:pointer;color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);align-items:center;gap:4px;display:flex}.help-details .help-lead{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.help-details .help-full{margin-top:var(--roxy-space-xs,.25rem);display:block}.location-block{gap:var(--roxy-space-xs,.25rem);grid-column:1/-1;display:grid}.tiles{gap:var(--roxy-space-sm,.5rem);grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr));display:grid}.tile{min-height:44px;padding:var(--roxy-space-sm,.5rem);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;transition:border-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease), background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-direction:column;justify-content:center;align-items:center;gap:2px;display:flex}.tile:hover{border-color:var(--roxy-accent,#f59e0b)}.tile[aria-checked=true]{border-color:var(--roxy-accent,#f59e0b);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 12%, transparent);color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.tile:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.tile-glyph{font-size:1.35em;line-height:1}.toggle-row{align-items:center;gap:var(--roxy-space-sm,.5rem);display:flex}.toggle{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);background:var(--roxy-border,#e4e4e7);cursor:pointer;width:44px;height:26px;transition:background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0;padding:0;position:relative}.toggle[aria-checked=true]{background:var(--roxy-accent,#f59e0b);border-color:var(--roxy-accent,#f59e0b)}.toggle .knob{background:var(--roxy-bg,#fff);width:20px;height:20px;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);border-radius:50%;position:absolute;top:2px;left:2px}.toggle[aria-checked=true] .knob{transform:translate(18px)}.toggle:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.toggle-label{cursor:pointer}@media (prefers-reduced-motion:reduce){.tile,.toggle,.toggle .knob{transition:none}}.advanced{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.advanced>summary{cursor:pointer;font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a);align-items:center;gap:6px;display:flex}.advanced[open]>summary{margin-bottom:var(--roxy-space-md,1rem)}.advanced .fields,.advanced .person-group{margin-top:var(--roxy-space-md,1rem)}.validation-error{gap:var(--roxy-space-xs,.25rem);padding:var(--roxy-space-md,1rem);background:color-mix(in srgb, var(--roxy-danger,#dc2626) 8%, transparent);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);display:grid}button.submit{background:var(--roxy-accent-ink,#b45309);color:var(--roxy-bg,#fff);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-lg,1.5rem);font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);cursor:pointer;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));border:0;justify-self:start}button.submit:hover{transform:scale(1.02)}button.submit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}@media (prefers-reduced-motion:reduce){button.submit{transition:none}}.spec-error{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}`],m([x({type:String,attribute:"data-endpoint"})],u.prototype,"endpoint",2),m([x({type:String})],u.prototype,"method",2),m([x({type:String,attribute:"spec-url"})],u.prototype,"specUrl",2),m([x({type:String,attribute:"submit-label"})],u.prototype,"submitLabel",2),m([x({type:String,attribute:"publishable-key"})],u.prototype,"publishableKey",2),m([x({attribute:!1})],u.prototype,"initialValues",2),m([y()],u.prototype,"fields",2),m([y()],u.prototype,"formTitle",2),m([y()],u.prototype,"hasLang",2),m([y()],u.prototype,"values",2),m([y()],u.prototype,"loaded",2),m([y()],u.prototype,"specError",2),m([y()],u.prototype,"validationErrors",2),u=m([ee("roxy-endpoint-form")],u);export{u as RoxyEndpointForm,Ae as resetSpecCache};
|
|
2
2
|
//# sourceMappingURL=endpoint-form.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/endpoint-form.ts", "../../src/tokens/index.ts", "../../src/utils/base-styles.ts", "../../src/utils/disclosure.ts", "../../src/utils/string.ts", "../../src/utils/field-schema.ts", "../../src/version.ts"],
|
|
4
|
-
"sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { chevron, disclosureStyles } from '../utils/disclosure.js';\nimport {\n\tbuildFormModel,\n\tderiveSubmitLabel,\n\ttype FieldDef,\n\ttype FormModel,\n\tisZodiacEnum,\n\tLOCATION_TRIO,\n\ttype OpenApiDoc,\n\ttype OperationSchema,\n\tsliceFileName,\n} from '../utils/field-schema.js';\nimport { capitalize, humanize } from '../utils/string.js';\nimport { ROXY_UI_VERSION } from '../version.js';\n\n/** Production spec, fetched when no slice is available and no explicit `spec-url` is set. */\nconst PROD_SPEC_URL = 'https://roxyapi.com/api/v2/openapi.json';\n\n/** Version-pinned jsDelivr base for the digested per-operation schema slices, mirroring the wrapper CDN pinning so a slice matches the bundle it ships beside. */\nconst SLICE_BASE = `https://cdn.jsdelivr.net/npm/@roxyapi/ui@${ROXY_UI_VERSION}/dist/schemas`;\n\nconst specCache = new Map<string, Promise<OpenApiDoc>>();\n\n/**\n * Drop every cached spec promise.\n\n * @remarks\n * Test-only, and deliberately NOT re-exported from the package entry. The cache is module state shared by every test file in a single `bun test` process, and it only self-evicts on rejection, so one file that resolves a spec leaves a warm entry that silently satisfies a later file assertion about fetching. That made slice-fallback coverage pass or fail purely on file order.\n\n * @internal\n */\nexport function resetSpecCache(): void {\n\tspecCache.clear();\n}\n\nasync function loadSpec(url: string): Promise<OpenApiDoc> {\n\tlet pending = specCache.get(url);\n\tif (!pending) {\n\t\tpending = fetch(url)\n\t\t\t.then(async (res) => {\n\t\t\t\tif (!res.ok) throw new Error(`HTTP ${res.status}`);\n\t\t\t\treturn (await res.json()) as OpenApiDoc;\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\t// Evict the rejected promise BEFORE rethrowing so subsequent\n\t\t\t\t// callers (the user clicking Retry, a remount) hit the network\n\t\t\t\t// again instead of replaying the cached failure forever.\n\t\t\t\tspecCache.delete(url);\n\t\t\t\tthrow err;\n\t\t\t});\n\t\tspecCache.set(url, pending);\n\t}\n\treturn pending;\n}\n\n/** A fresh seed for a hidden `seed` field, so each submit is a new draw unless the caller pinned one. */\nfunction randomSeed(): string {\n\treturn (\n\t\tglobalThis.crypto?.randomUUID?.() ?? Math.random().toString(36).slice(2)\n\t);\n}\n\n/** Parse an array-field text value into a real array: JSON when it parses to one, else comma-separated tokens. */\nfunction parseArrayValue(raw: string): unknown {\n\tconst trimmed = raw.trim();\n\tif (!trimmed) return [];\n\ttry {\n\t\tconst parsed = JSON.parse(trimmed);\n\t\tif (Array.isArray(parsed)) return parsed;\n\t} catch {\n\t\t// Not JSON: fall through to comma splitting.\n\t}\n\treturn trimmed\n\t\t.split(',')\n\t\t.map((s) => s.trim())\n\t\t.filter(Boolean);\n}\n\n/**\n * Schema-driven form. Pass `endpoint` (e.g. \"vedic-astrology/birth-chart\"). The form digests the operation's request schema into a spec-derived input for each parameter (a zodiac tile grid, a date or time input, a city search, a toggle) with progressive disclosure, and emits a `roxy-submit` CustomEvent carrying the validated payload. The caller decides what to do (call the SDK, render a chart, navigate).\n *\n * @remarks\n * Schema resolution order: an explicit `spec-url` fetches that full spec and digests it (unchanged, the demo path); otherwise the form tries a small version-pinned per-operation slice from the CDN, and on any miss falls back to fetching the production spec. Each input kind is chosen purely from the parameter shape (see {@link ../utils/field-schema.ts}), so a new endpoint gets a working, on-brand form with no per-endpoint code.\n *\n * The visitor-facing `lang` parameter is never rendered: a site owner sets the element `lang` attribute, and the form routes it to the query string on submit. Optional parameters collapse under one Advanced disclosure; a form whose only required field is an enum submits on selection.\n */\n@customElement('roxy-endpoint-form')\nexport class RoxyEndpointForm extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tdisclosureStyles,\n\t\tcss`form{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.fields{align-items:start;gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.fields:empty{display:none}.person-group{background:var(--roxy-surface,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);gap:var(--roxy-space-md,1rem);min-inline-size:0;margin:0;display:grid}.person-group legend{padding:0 var(--roxy-space-xs,.25rem);font-weight:var(--roxy-weight-bold,600)}.field{gap:var(--roxy-space-xs,.25rem);flex-direction:column;min-width:0;display:flex}.tiles-field{grid-column:1/-1}label,.label{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-secondary,#475569)}.req{color:var(--roxy-danger-fg,#991b1b);margin-left:4px}input,select{box-sizing:border-box;width:100%;padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);font-family:inherit}input:focus,select:focus{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-color:var(--roxy-accent-ink,#b45309)}.help{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem)}.help-details>summary{cursor:pointer;color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);align-items:center;gap:4px;display:flex}.help-details .help-lead{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.help-details .help-full{margin-top:var(--roxy-space-xs,.25rem);display:block}.location-block{gap:var(--roxy-space-xs,.25rem);grid-column:1/-1;display:grid}.tiles{gap:var(--roxy-space-sm,.5rem);grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr));display:grid}.tile{min-height:44px;padding:var(--roxy-space-sm,.5rem);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;transition:border-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease), background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-direction:column;justify-content:center;align-items:center;gap:2px;display:flex}.tile:hover{border-color:var(--roxy-accent,#f59e0b)}.tile[aria-checked=true]{border-color:var(--roxy-accent,#f59e0b);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 12%, transparent);color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.tile:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.tile-glyph{font-size:1.35em;line-height:1}.toggle-row{align-items:center;gap:var(--roxy-space-sm,.5rem);display:flex}.toggle{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);background:var(--roxy-border,#e4e4e7);cursor:pointer;width:44px;height:26px;transition:background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0;padding:0;position:relative}.toggle[aria-checked=true]{background:var(--roxy-accent,#f59e0b);border-color:var(--roxy-accent,#f59e0b)}.toggle .knob{background:var(--roxy-bg,#fff);width:20px;height:20px;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);border-radius:50%;position:absolute;top:2px;left:2px}.toggle[aria-checked=true] .knob{transform:translate(18px)}.toggle:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.toggle-label{cursor:pointer}@media (prefers-reduced-motion:reduce){.tile,.toggle,.toggle .knob{transition:none}}.advanced{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.advanced>summary{cursor:pointer;font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a);align-items:center;gap:6px;display:flex}.advanced[open]>summary{margin-bottom:var(--roxy-space-md,1rem)}.advanced .fields,.advanced .person-group{margin-top:var(--roxy-space-md,1rem)}.validation-error{gap:var(--roxy-space-xs,.25rem);padding:var(--roxy-space-md,1rem);background:color-mix(in srgb, var(--roxy-danger,#dc2626) 8%, transparent);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);display:grid}button.submit{background:var(--roxy-accent-ink,#b45309);color:var(--roxy-bg,#fff);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-lg,1.5rem);font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);cursor:pointer;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));border:0;justify-self:start}button.submit:hover{transform:scale(1.02)}button.submit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}@media (prefers-reduced-motion:reduce){button.submit{transition:none}}.spec-error{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}`,\n\t];\n\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = 'vedic-astrology/birth-chart';\n\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Explicit OpenAPI spec URL. When set, the form fetches and digests that full spec (the demo path). When empty, it resolves a version-pinned slice first, then the production spec. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl = '';\n\n\t/** Override the submit-button label. Empty derives an outcome-first label from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel = '';\n\n\t/** Browser-safe publishable key, forwarded to the slotted city search so the natal or synastry form can geocode. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Prefill values, keyed by field name (nested per group). Used by `remember` mode and to restore the previous submission. JS property only. */\n\t@property({ attribute: false })\n\tinitialValues?: Record<string, unknown>;\n\n\t@state()\n\tprivate fields: FieldDef[] = [];\n\n\t@state()\n\tprivate formTitle = '';\n\n\t@state()\n\tprivate hasLang = false;\n\n\t@state()\n\tprivate values: Record<string, unknown> = {};\n\n\t@state()\n\tprivate loaded = false;\n\n\t@state()\n\tprivate specError: string | null = null;\n\n\t@state()\n\tprivate validationErrors: string[] = [];\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tvoid this.loadSchema();\n\t}\n\n\tprivate async loadSchema() {\n\t\tthis.specError = null;\n\t\ttry {\n\t\t\tthis.applyModel(await this.resolveModel());\n\t\t} catch (err) {\n\t\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\t\tthis.specError = message;\n\t\t\tthis.loaded = true;\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('roxy-spec-error', {\n\t\t\t\t\tdetail: { url: this.specUrl || PROD_SPEC_URL, message },\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Resolve the form model: explicit spec-url wins; else a version-pinned slice; else the production spec. */\n\tprivate async resolveModel(): Promise<FormModel> {\n\t\tif (this.specUrl) return this.modelFromSpec(this.specUrl);\n\t\tconst slice = await this.tryLoadSlice();\n\t\treturn slice ?? this.modelFromSpec(PROD_SPEC_URL);\n\t}\n\n\t/** Fetch and digest one operation from a full OpenAPI document. */\n\tprivate async modelFromSpec(url: string): Promise<FormModel> {\n\t\tconst spec = await loadSpec(url);\n\t\tconst path = `/${this.endpoint.replace(/^\\//, '')}`;\n\t\tconst op = spec.paths?.[path]?.[this.method.toLowerCase()] as\n\t\t\t| OperationSchema\n\t\t\t| undefined;\n\t\tif (!op) {\n\t\t\tthrow new Error(\n\t\t\t\t`Endpoint ${this.method} ${path} not found in OpenAPI spec`,\n\t\t\t);\n\t\t}\n\t\treturn buildFormModel(op, spec.components?.schemas ?? {}, this.endpoint);\n\t}\n\n\t/** Try the small precomputed slice; return null on any miss so the caller falls back to the full spec. */\n\tprivate async tryLoadSlice(): Promise<FormModel | null> {\n\t\ttry {\n\t\t\tconst res = await fetch(\n\t\t\t\t`${SLICE_BASE}/${sliceFileName(this.method, this.endpoint)}`,\n\t\t\t);\n\t\t\tif (!res.ok) return null;\n\t\t\treturn (await res.json()) as FormModel;\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate applyModel(model: FormModel) {\n\t\tthis.fields = model.fields;\n\t\tthis.formTitle = model.title;\n\t\tthis.hasLang = model.hasLang;\n\t\t// Pre-fill: schema defaults first, then any remembered/initial values (only\n\t\t// for fields this endpoint has) so a stale stored payload from another\n\t\t// endpoint cannot inject unknown keys. Remembered values are nested per\n\t\t// group, so read them by group.\n\t\tconst init: Record<string, unknown> = {};\n\t\tfor (const f of model.fields) {\n\t\t\tif (f.default !== undefined) init[f.key] = f.default;\n\t\t\tconst remembered = f.group\n\t\t\t\t? (\n\t\t\t\t\t\tthis.initialValues?.[f.group] as Record<string, unknown> | undefined\n\t\t\t\t\t)?.[f.name]\n\t\t\t\t: this.initialValues?.[f.name];\n\t\t\tif (remembered !== undefined) init[f.key] = remembered;\n\t\t}\n\t\tthis.values = init;\n\t\tthis.loaded = true;\n\t}\n\n\tprivate retryLoadSchema = () => {\n\t\tthis.loaded = false;\n\t\tthis.specError = null;\n\t\tvoid this.loadSchema();\n\t};\n\n\tprivate setValue(name: string, value: unknown) {\n\t\tthis.values = { ...this.values, [name]: value };\n\t}\n\n\t/** The field's render role: a hidden autogenerated seed, a hidden defaulted limit/offset, a suppressed location coordinate, or a normally rendered input. */\n\tprivate roleOf(\n\t\tf: FieldDef,\n\t): 'seed' | 'hidden-default' | 'location' | 'normal' {\n\t\tif (f.name === 'seed') return 'seed';\n\t\tif ((f.name === 'limit' || f.name === 'offset') && !f.required)\n\t\t\treturn 'hidden-default';\n\t\tif (\n\t\t\t(LOCATION_TRIO as readonly string[]).includes(f.name) &&\n\t\t\tthis.groupHasLocation(f.group)\n\t\t)\n\t\t\treturn 'location';\n\t\treturn 'normal';\n\t}\n\n\t/** True when the field renders its own input (as opposed to being hidden or replaced by the city search). */\n\tprivate isRendered(f: FieldDef): boolean {\n\t\treturn this.roleOf(f) === 'normal';\n\t}\n\n\t/** Ordered, de-duplicated group keys (undefined flat group plus each named object). */\n\tprivate groupKeys(): (string | undefined)[] {\n\t\tconst keys: (string | undefined)[] = [];\n\t\tfor (const f of this.fields)\n\t\t\tif (!keys.includes(f.group)) keys.push(f.group);\n\t\treturn keys;\n\t}\n\n\t/** True when the fields in `group` (or the flat top level) carry latitude+longitude+timezone, so a location-search can autofill them. */\n\tprivate groupHasLocation(group?: string): boolean {\n\t\tconst inGroup = this.fields.filter((f) => f.group === group);\n\t\treturn LOCATION_TRIO.every((n) => inGroup.some((f) => f.name === n));\n\t}\n\n\t/**\n\t * True when the location block must show a required mark, i.e. ANY member of the trio is required. The block is a single city-search input that fills all three, so if even one is required (e.g. bodygraph requires `timezone` while `latitude`/`longitude` are optional) the input is required and `collectMissing` blocks submit without it. Requiring ALL three understated that: the asterisk went missing on a block the form still enforced, which reads as optional to a non-technical embedder.\n\t */\n\tprivate locationRequired(group?: string): boolean {\n\t\tconst inGroup = this.fields.filter((f) => f.group === group);\n\t\treturn LOCATION_TRIO.some((n) =>\n\t\t\tinGroup.some((f) => f.name === n && f.required),\n\t\t);\n\t}\n\n\t/** A named group is a required input when any of its leaf fields is required or it carries a location. */\n\tprivate groupIsRequired(group: string): boolean {\n\t\treturn (\n\t\t\tthis.groupHasLocation(group) ||\n\t\t\tthis.fields.some((f) => f.group === group && f.required)\n\t\t);\n\t}\n\n\t/**\n\t * The single visible required enum field, when the whole form reduces to exactly one: no location block, no named group, one required rendered enum. This is what turns the horoscope form into a tap-to-load sign grid; returns null otherwise.\n\t */\n\tprivate get singleEnumField(): FieldDef | null {\n\t\tif (this.groupKeys().some((g) => this.groupHasLocation(g))) return null;\n\t\tif (this.groupKeys().some((g) => g !== undefined)) return null;\n\t\tconst req = this.fields.filter((f) => f.required && this.isRendered(f));\n\t\tconst only = req[0];\n\t\tif (req.length !== 1 || !only) return null;\n\t\treturn only.kind === 'tiles' || only.kind === 'select' ? only : null;\n\t}\n\n\tprivate effectiveSubmitLabel(): string {\n\t\treturn this.submitLabel || deriveSubmitLabel(this.endpoint);\n\t}\n\n\t/** The site-owner language from the element `lang` attribute (native), or undefined. Read here, never a Lit property, to avoid shadowing the native accessor. */\n\tprivate effectiveLang(): string | undefined {\n\t\treturn this.lang || undefined;\n\t}\n\n\t/** Location-select handler bound to a group: fills that group's lat/lng/timezone keys (flat top level when group is undefined). */\n\tprivate onLocationFor(group?: string) {\n\t\tconst prefix = group ? `${group}.` : '';\n\t\treturn (e: Event) => {\n\t\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\t\tlatitude?: number;\n\t\t\t\tlongitude?: number;\n\t\t\t\ttimezone?: string;\n\t\t\t\tutcOffset?: number;\n\t\t\t};\n\t\t\tif (!detail) return;\n\t\t\tthis.values = {\n\t\t\t\t...this.values,\n\t\t\t\t[`${prefix}latitude`]: detail.latitude,\n\t\t\t\t[`${prefix}longitude`]: detail.longitude,\n\t\t\t\t[`${prefix}timezone`]: detail.timezone ?? detail.utcOffset,\n\t\t\t};\n\t\t};\n\t}\n\n\tprivate selectTile(f: FieldDef, value: string) {\n\t\tthis.setValue(f.key, value);\n\t\tif (this.singleEnumField?.key === f.key) this.submit();\n\t}\n\n\t/** Roving-tabindex arrow-key navigation for a tile radiogroup, modeled on the shared tablist pattern (selection follows focus). */\n\tprivate onTilesKeyDown(f: FieldDef) {\n\t\treturn (e: KeyboardEvent) => {\n\t\t\tconst opts = f.enum ?? [];\n\t\t\tif (opts.length === 0) return;\n\t\t\tconst cur = opts.indexOf(this.values[f.key] as string);\n\t\t\tlet next: number;\n\t\t\tif (e.key === 'Home') next = 0;\n\t\t\telse if (e.key === 'End') next = opts.length - 1;\n\t\t\telse if (e.key === 'ArrowRight' || e.key === 'ArrowDown')\n\t\t\t\tnext = cur === -1 ? 0 : (cur + 1) % opts.length;\n\t\t\telse if (e.key === 'ArrowLeft' || e.key === 'ArrowUp')\n\t\t\t\tnext =\n\t\t\t\t\tcur === -1 ? opts.length - 1 : (cur - 1 + opts.length) % opts.length;\n\t\t\telse return;\n\t\t\te.preventDefault();\n\t\t\tconst value = opts[next];\n\t\t\tif (value === undefined) return;\n\t\t\tthis.selectTile(f, value);\n\t\t\tconst root = e.currentTarget as HTMLElement;\n\t\t\trequestAnimationFrame(() =>\n\t\t\t\troot.querySelector<HTMLButtonElement>(`[data-tile='${next}']`)?.focus(),\n\t\t\t);\n\t\t};\n\t}\n\n\tprivate onSubmit = (e: Event) => {\n\t\te.preventDefault();\n\t\tthis.submit();\n\t};\n\n\t/** Validate, then emit `roxy-submit` with the reconstructed payload, the spec query keys, and whether the form was a single-enum sticky picker. */\n\tprivate submit() {\n\t\tconst missing = this.collectMissing();\n\t\tif (missing.keys.length > 0) {\n\t\t\tthis.validationErrors = missing.labels;\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\t\t\tdetail: { missing: missing.keys },\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tthis.validationErrors = [];\n\t\tconst out: Record<string, unknown> = {};\n\t\tfor (const f of this.fields) {\n\t\t\tlet v = this.values[f.key];\n\t\t\t// A hidden seed autogenerates per submit unless a value was remembered.\n\t\t\tif (f.name === 'seed' && (v === undefined || v === '')) v = randomSeed();\n\t\t\tif (v === undefined || v === '') continue;\n\t\t\tif (f.kind === 'array' && typeof v === 'string') v = parseArrayValue(v);\n\t\t\tif (f.group) {\n\t\t\t\tconst g = (out[f.group] as Record<string, unknown> | undefined) ?? {};\n\t\t\t\tg[f.name] = v;\n\t\t\t\tout[f.group] = g;\n\t\t\t} else {\n\t\t\t\tout[f.name] = v;\n\t\t\t}\n\t\t}\n\t\t// The spec knows which parameters belong in the query string; the listener\n\t\t// does not. Report them (including a site-owner lang) so a POST with a query\n\t\t// parameter reaches the API correctly instead of being dropped in the body.\n\t\tconst queryKeys = this.fields.filter((f) => f.inQuery).map((f) => f.name);\n\t\tconst lang = this.effectiveLang();\n\t\tif (this.hasLang && lang) {\n\t\t\tout.lang = lang;\n\t\t\tqueryKeys.push('lang');\n\t\t}\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('roxy-submit', {\n\t\t\t\tdetail: {\n\t\t\t\t\tendpoint: this.endpoint,\n\t\t\t\t\tvalues: out,\n\t\t\t\t\tqueryKeys,\n\t\t\t\t\tsticky: this.singleEnumField != null,\n\t\t\t\t},\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** Required fields left empty, with the location trio collapsed to one entry per group. Seed and hidden defaults never block. */\n\tprivate collectMissing(): { keys: string[]; labels: string[] } {\n\t\tconst keys: string[] = [];\n\t\tconst labels: string[] = [];\n\t\tconst locGroups = new Set<string | undefined>();\n\t\tfor (const f of this.fields) {\n\t\t\tif (!f.required) continue;\n\t\t\tconst isLocation = this.roleOf(f) === 'location';\n\t\t\tif (!this.isRendered(f) && !isLocation) continue;\n\t\t\tconst v = this.values[f.key];\n\t\t\tif (v !== undefined && v !== '') continue;\n\t\t\tkeys.push(f.key);\n\t\t\tif (isLocation) {\n\t\t\t\tlocGroups.add(f.group);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlabels.push(\n\t\t\t\tf.group ? `${humanize(f.group)} ${humanize(f.name)}` : humanize(f.name),\n\t\t\t);\n\t\t}\n\t\tfor (const g of locGroups) {\n\t\t\tlabels.push(g ? `${humanize(g)} location` : 'Birth location');\n\t\t}\n\t\treturn { keys, labels };\n\t}\n\n\tprivate reqMark(f: FieldDef) {\n\t\treturn f.required\n\t\t\t? html`<span class=\"req\" aria-hidden=\"true\">*</span>`\n\t\t\t: nothing;\n\t}\n\n\t/** A description under a field: rendered inline when short, collapsed behind a disclosure showing its first line when long. */\n\tprivate description(f: FieldDef) {\n\t\tif (!f.description) return nothing;\n\t\tif (f.description.length <= 120) {\n\t\t\treturn html`<small class=\"help\">${f.description}</small>`;\n\t\t}\n\t\tconst lead = f.description.split('. ')[0] ?? f.description;\n\t\treturn html`<details class=\"help-details\"><summary><span class=\"help-lead\">${lead}</span>${chevron()}</summary><small class=\"help help-full\">${f.description}</small></details>`;\n\t}\n\n\tprivate renderTiles(f: FieldDef) {\n\t\tconst labelId = `roxy-form-${f.key}-label`;\n\t\tconst zodiac = !!f.enum && isZodiacEnum(f.enum);\n\t\tconst opts = f.enum ?? [];\n\t\tconst cur = opts.indexOf(this.values[f.key] as string);\n\t\tconst active = cur === -1 ? 0 : cur;\n\t\treturn html`<div class=\"field tiles-field\"><span class=\"label\" id=\"${labelId}\">${humanize(f.name)}${this.reqMark(f)}</span><div class=\"tiles\" role=\"radiogroup\" aria-labelledby=\"${labelId}\" @keydown=\"${this.onTilesKeyDown(f)}\">${opts.map((opt, i) => {\n\t\t\t\t\tconst selected = this.values[f.key] === opt;\n\t\t\t\t\tconst glyph = zodiac ? SIGN_GLYPH[capitalize(opt)] : undefined;\n\t\t\t\t\treturn html`<button type=\"button\" class=\"tile\" role=\"radio\" data-tile=\"${i}\" aria-checked=\"${selected ? 'true' : 'false'}\" tabindex=\"${i === active ? '0' : '-1'}\" @click=\"${() => this.selectTile(f, opt)}\">${\n\t\t\t\t\t\t\tglyph\n\t\t\t\t\t\t\t\t? html`<span class=\"tile-glyph\" aria-hidden=\"true\">${glyph}</span>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t} <span class=\"tile-label\">${humanize(opt)}</span></button>`;\n\t\t\t\t})}</div>${this.description(f)}</div>`;\n\t}\n\n\tprivate renderSelect(f: FieldDef) {\n\t\tconst id = `roxy-form-${f.key}`;\n\t\treturn html`<div class=\"field\"><label for=\"${id}\">${humanize(f.name)}${this.reqMark(f)}</label> <select id=\"${id}\" ?required=\"${f.required}\" @change=\"${(e: Event) =>\n\t\t\t\t\tthis.setValue(f.key, (e.target as HTMLSelectElement).value)}\"><option value=\"\">Choose</option>${(f.enum ?? []).map(\n\t\t\t\t\t(\n\t\t\t\t\t\topt,\n\t\t\t\t\t) => html`<option value=\"${opt}\" ?selected=\"${this.values[f.key] === opt}\">${humanize(opt)}</option>`,\n\t\t\t\t)}</select> ${this.description(f)}</div>`;\n\t}\n\n\tprivate renderToggle(f: FieldDef) {\n\t\tconst id = `roxy-form-${f.key}`;\n\t\tconst checked = this.values[f.key] === true;\n\t\treturn html`<div class=\"field\"><div class=\"toggle-row\"><button type=\"button\" id=\"${id}\" class=\"toggle\" role=\"switch\" aria-checked=\"${checked ? 'true' : 'false'}\" @click=\"${() => this.setValue(f.key, !checked)}\"><span class=\"knob\"></span></button> <label class=\"toggle-label\" for=\"${id}\">${humanize(f.name)}${this.reqMark(f)}</label></div>${this.description(f)}</div>`;\n\t}\n\n\tprivate renderInput(f: FieldDef) {\n\t\tconst id = `roxy-form-${f.key}`;\n\t\tconst type =\n\t\t\tf.kind === 'datetime'\n\t\t\t\t? 'datetime-local'\n\t\t\t\t: f.kind === 'number'\n\t\t\t\t\t? 'number'\n\t\t\t\t\t: f.kind;\n\t\tconst placeholder =\n\t\t\tf.kind === 'array'\n\t\t\t\t? 'Comma separated'\n\t\t\t\t: f.example != null\n\t\t\t\t\t? String(f.example)\n\t\t\t\t\t: '';\n\t\treturn html`<div class=\"field\"><label for=\"${id}\">${humanize(f.name)}${this.reqMark(f)}</label> <input id=\"${id}\" type=\"${f.kind === 'array' ? 'text' : type}\" ?required=\"${f.required}\" min=\"${ifDefined(f.min)}\" max=\"${ifDefined(f.max)}\" step=\"${f.kind === 'number' ? 'any' : nothing}\" placeholder=\"${placeholder || nothing}\" .value=\"${(this.values[f.key] ?? '') as string}\" @input=\"${(e: Event) =>\n\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\tf.key,\n\t\t\t\t\t\tthis.coerce(f.kind, (e.target as HTMLInputElement).value),\n\t\t\t\t\t)}\"> ${this.description(f)}</div>`;\n\t}\n\n\tprivate renderField(f: FieldDef) {\n\t\tswitch (f.kind) {\n\t\t\tcase 'tiles':\n\t\t\t\treturn this.renderTiles(f);\n\t\t\tcase 'select':\n\t\t\t\treturn this.renderSelect(f);\n\t\t\tcase 'toggle':\n\t\t\t\treturn this.renderToggle(f);\n\t\t\tdefault:\n\t\t\t\treturn this.renderInput(f);\n\t\t}\n\t}\n\n\tprivate locationBlock(group?: string) {\n\t\treturn html`<div class=\"location-block\"><label>${group ? `${humanize(group)} location` : 'Birth location'}${\n\t\t\t\t\tthis.locationRequired(group)\n\t\t\t\t\t\t? html`<span class=\"req\" aria-hidden=\"true\">*</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</label><roxy-location-search publishable-key=\"${ifDefined(this.publishableKey)}\" @roxy-location-select=\"${this.onLocationFor(group)}\" placeholder=\"City of birth\"></roxy-location-search><small class=\"help\">Required: latitude, longitude, timezone. Pick a city to autofill.</small></div>`;\n\t}\n\n\tprivate groupCard(group: string) {\n\t\tconst fields = this.fields.filter(\n\t\t\t(f) => f.group === group && this.isRendered(f),\n\t\t);\n\t\treturn html`<fieldset class=\"person-group\"><legend>${humanize(group)}</legend>${this.groupHasLocation(group) ? this.locationBlock(group) : nothing}<div class=\"fields\">${fields.map((f) => this.renderField(f))}</div></fieldset>`;\n\t}\n\n\trender() {\n\t\tif (!this.loaded) {\n\t\t\treturn html`<form><div class=\"roxy-skeleton\" style=\"height:8rem\"></div></form>`;\n\t\t}\n\t\tif (this.specError) {\n\t\t\treturn html`<div class=\"spec-error\" role=\"alert\">Schema load failed: ${this.specError} <button type=\"button\" class=\"submit\" @click=\"${this.retryLoadSchema}\">Retry</button></div>`;\n\t\t}\n\n\t\tconst flat = this.fields.filter((f) => !f.group && this.isRendered(f));\n\t\tconst flatReq = flat.filter((f) => f.required);\n\t\tconst flatOpt = flat.filter((f) => !f.required);\n\t\tconst named = this.groupKeys().filter((g): g is string => g !== undefined);\n\t\tconst reqGroups = named.filter((g) => this.groupIsRequired(g));\n\t\tconst optGroups = named.filter((g) => !this.groupIsRequired(g));\n\t\tconst hasAdvanced = flatOpt.length > 0 || optGroups.length > 0;\n\n\t\treturn html`<form @submit=\"${this.onSubmit}\"><h2 class=\"title\">${this.formTitle}</h2>${\n\t\t\t\tthis.validationErrors.length > 0\n\t\t\t\t\t? html`<div class=\"validation-error\" role=\"alert\"><strong>Please complete:</strong> ${this.validationErrors.join(', ')}</div>`\n\t\t\t\t\t: nothing\n\t\t\t}<div class=\"fields\">${flatReq.map((f) => this.renderField(f))}</div>${this.groupHasLocation(undefined) ? this.locationBlock(undefined) : nothing} ${reqGroups.map((g) => this.groupCard(g))} ${\n\t\t\t\thasAdvanced\n\t\t\t\t\t? html`<details class=\"advanced\"><summary>Advanced${chevron()}</summary><div class=\"fields\">${flatOpt.map((f) => this.renderField(f))}</div>${optGroups.map((g) => this.groupCard(g))}</details>`\n\t\t\t\t\t: nothing\n\t\t\t} ${\n\t\t\t\tthis.singleEnumField\n\t\t\t\t\t? nothing\n\t\t\t\t\t: html`<button class=\"submit\" type=\"submit\">${this.effectiveSubmitLabel()}</button>`\n\t\t\t}</form>`;\n\t}\n\n\tprivate coerce(kind: string, v: string): unknown {\n\t\tif (v === '') return undefined;\n\t\tif (kind === 'number') {\n\t\t\tconst n = Number(v);\n\t\t\treturn Number.isFinite(n) ? n : undefined;\n\t\t}\n\t\treturn v;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-endpoint-form': RoxyEndpointForm;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\n/**\n * Glyph per aspect, keyed by the hyphen-free canonical name.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. Unicode lists `\u22BB` XOR and `\u22BC` NAND as cross-references FROM the real quincunx and semisextile glyphs, so they look like safe stand-ins and are easy to pair the wrong way round, which renders a 150 degree quincunx with the 30 degree semisextile symbol. An astrologer reads the glyph, not the tooltip.\n */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\tsemisquare: '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { TemplateResult } from 'lit';\nimport { css, html } from 'lit';\n\n/**\n * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the\n * browser default triangle with a thin chevron that rotates when the host\n * `<details>` opens. Render it inside the `<summary>` and pair with\n * {@link disclosureStyles}.\n */\nexport function chevron(): TemplateResult {\n\treturn html`<svg class=\"roxy-chevron\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\"><path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>`;\n}\n\n/**\n * Shared `<details>` accordion styling: hides the native disclosure triangle\n * and rotates the {@link chevron} 180 degrees when the accordion is open.\n * Import into any component that renders disclosure accordions so the chevron\n * looks and behaves identically.\n */\nexport const disclosureStyles = css`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Pure, framework-free schema layer shared by the self-fetch form. It turns one OpenAPI operation into a digested list of {@link FieldDef}s whose {@link InputKind} decides which input widget renders, with zero Lit or DOM dependency so the build-time slice generator ({@link ../../../scripts/build-schemas.ts}) and the taxonomy-coverage test consume the exact same classification the browser does.\n *\n * @remarks\n * The registry is by SHAPE, never by name: {@link classifyInput} inspects `enum` / `type` / `format` only, so a new API parameter gets a working widget with no code change, and the taxonomy gate fails loudly (via a `null` return) the day a genuinely new shape appears. Name-driven behaviour (suppressing `lang`, hiding `seed` / `limit` / `offset`, replacing the latitude+longitude+timezone trio with a city search) is a separate render-time concern layered on top by the form, never encoded here.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\nimport { humanize } from './string.js';\n\n/** A JSON `$ref` node, before resolution against `components.schemas`. */\nexport interface OpenApiSchemaRef {\n\t$ref?: string;\n}\n\n/** The subset of an OpenAPI 3 schema object the form reads. */\nexport interface OpenApiSchema extends OpenApiSchemaRef {\n\t/** A plain name in 3.0, or an ARRAY in 3.1 where nullability is spelled `['number', 'null']`. Read it through {@link scalarType}, never compare it directly. */\n\ttype?: string | string[];\n\tformat?: string;\n\tdescription?: string;\n\tenum?: string[];\n\tdefault?: unknown;\n\tminimum?: number;\n\tmaximum?: number;\n\tproperties?: Record<string, OpenApiSchema>;\n\trequired?: string[];\n\titems?: OpenApiSchema;\n\texample?: unknown;\n\tanyOf?: OpenApiSchema[];\n\toneOf?: OpenApiSchema[];\n}\n\n/** One operation's request shape, as read from `spec.paths[path][method]`. */\nexport interface OperationSchema {\n\tsummary?: string;\n\trequestBody?: {\n\t\tcontent?: Record<string, { schema?: OpenApiSchema | OpenApiSchemaRef }>;\n\t};\n\tparameters?: Array<{\n\t\tname: string;\n\t\tin: string;\n\t\trequired?: boolean;\n\t\tschema?: OpenApiSchema;\n\t}>;\n}\n\n/** The minimal OpenAPI document surface the form introspects. */\nexport interface OpenApiDoc {\n\tpaths?: Record<string, Record<string, unknown>>;\n\tcomponents?: { schemas?: Record<string, OpenApiSchema> };\n}\n\n/** The fully typed spec document the build-time scripts read from the committed `specs/openapi.json`: every path item value is an {@link OperationSchema}. The runtime form keeps the looser {@link OpenApiDoc} because a live spec fetch is untrusted input it narrows per operation. */\nexport interface SpecDoc {\n\tpaths: Record<string, Record<string, OperationSchema>>;\n\tcomponents?: { schemas?: Record<string, OpenApiSchema> };\n}\n\n/**\n * The widget kind a parameter resolves to. This is the closed set the taxonomy gate enforces: every request parameter in the spec MUST classify to one of these, or {@link classifyInput} returns `null` and the gate fails, forcing a conscious decision when the API grows a new shape.\n */\nexport type InputKind =\n\t| 'tiles'\n\t| 'select'\n\t| 'toggle'\n\t| 'date'\n\t| 'time'\n\t| 'datetime'\n\t| 'number'\n\t| 'text'\n\t| 'array';\n\n/** A single input the form renders, digested from one schema property or parameter. */\nexport interface FieldDef {\n\t/** Unique storage + input key: the property name, or \"group.name\" for a nested object field. */\n\tkey: string;\n\t/** Schema property name (the label source), e.g. \"date\". */\n\tname: string;\n\t/** Parent object key for a nested schema (person1/person2); undefined for a flat field. */\n\tgroup?: string;\n\t/** True when the spec declares the field as `in: query`, so it belongs in the query string even on a POST. */\n\tinQuery?: boolean;\n\t/** The resolved widget kind. */\n\tkind: InputKind;\n\trequired: boolean;\n\tdescription?: string;\n\tenum?: string[];\n\tmin?: number;\n\tmax?: number;\n\tdefault?: unknown;\n\t/** Spec `example`, used as the placeholder for a text input. */\n\texample?: unknown;\n}\n\n/** The digested form model for one operation. The build-time slice is exactly this shape. */\nexport interface FormModel {\n\t/** Concise heading derived from the operation summary, falling back to the path. */\n\ttitle: string;\n\t/** Every rendered field. The `lang` query parameter is intentionally excluded (routed via the element `lang` attribute instead). */\n\tfields: FieldDef[];\n\t/** True when the operation carries a `lang` query parameter, so the form knows to route an effective language to the query string on submit. */\n\thasLang: boolean;\n}\n\n/** At most this many enum options render as a tile/chip picker; above it a filterable select is used instead. */\nexport const TILE_MAX = 12;\n\n/** The latitude+longitude+timezone trio the form suppresses in favour of a city search. Centralised so the render path and tests agree. */\nexport const LOCATION_TRIO = ['latitude', 'longitude', 'timezone'] as const;\n\n/** Canonical lowercase zodiac set, derived from {@link SIGNS_ORDER} so sign detection and the glyph map can never disagree. */\nconst ZODIAC_LOWER = SIGNS_ORDER.map((s) => s.toLowerCase());\n\n/** Resolve a `$ref` (one hop is all the spec uses) against the schema map; pass non-refs through. */\nexport function resolveSchema(\n\tschema: OpenApiSchema | OpenApiSchemaRef | undefined,\n\tall: Record<string, OpenApiSchema>,\n): OpenApiSchema | undefined {\n\tif (!schema) return undefined;\n\tif ('$ref' in schema && schema.$ref) {\n\t\tconst name = schema.$ref.split('/').pop();\n\t\treturn name ? all[name] : undefined;\n\t}\n\treturn schema as OpenApiSchema;\n}\n\n/**\n * Collapse an `anyOf`/`oneOf` union to the single member that decides the widget: an enum member wins (so `houseSystem` as enum-or-string renders as a picker), then any concrete-typed member (so timezone as number-or-string resolves to a real kind), else the first member. Non-union schemas pass through untouched.\n */\nfunction representative(s: OpenApiSchema): OpenApiSchema {\n\tconst union = s.anyOf ?? s.oneOf;\n\tif (!union || union.length === 0) return s;\n\treturn (\n\t\tunion.find((m) => Array.isArray(m.enum)) ??\n\t\tunion.find((m) => scalarType(m) && scalarType(m) !== 'null') ??\n\t\tunion[0] ??\n\t\ts\n\t);\n}\n\n/**\n * Map one resolved schema to its {@link InputKind}, or `null` when the shape is genuinely unhandled. The form treats `null` as a plain text fallback (never crashes); the taxonomy gate treats it as a failure (forces a decision). Object schemas are never passed here: an object with `properties` expands into a group of leaf fields upstream, so it has no leaf kind of its own.\n */\n/**\n * The single scalar type name a schema resolves to, across both OpenAPI spellings.\n *\n * @remarks\n * OpenAPI 3.1 expresses a nullable scalar as `type: ['number', 'null']` where 3.0 wrote `type: 'number', nullable: true`. Every direct `type === 'number'` comparison silently stops matching the day the served document switches, and the field then classifies as UNHANDLED rather than as a number, which is how a whole form degrades to text boxes without one test noticing. The `null` member carries no input information, so the remaining single member IS the type.\n */\nexport function scalarType(s: OpenApiSchema): string | undefined {\n\tif (typeof s.type === 'string') return s.type;\n\tif (!Array.isArray(s.type)) return undefined;\n\tconst real = s.type.filter((t) => t !== 'null');\n\treturn real.length === 1 ? real[0] : undefined;\n}\n\nexport function classifyInput(schema: OpenApiSchema): InputKind | null {\n\tconst s = representative(schema);\n\tconst type = scalarType(s);\n\tif (Array.isArray(s.enum))\n\t\treturn s.enum.length <= TILE_MAX ? 'tiles' : 'select';\n\tif (type === 'boolean') return 'toggle';\n\tif (s.format === 'date') return 'date';\n\tif (s.format === 'time') return 'time';\n\tif (s.format === 'date-time') return 'datetime';\n\tif (type === 'integer' || type === 'number') return 'number';\n\tif (type === 'string') return 'text';\n\tif (type === 'array') return 'array';\n\treturn null;\n}\n\n/** True when an enum's values are exactly the twelve zodiac signs (case-insensitive), so the tiles can carry sign glyphs. */\nexport function isZodiacEnum(values: readonly string[]): boolean {\n\tif (values.length !== 12) return false;\n\tconst lower = new Set(values.map((v) => v.toLowerCase()));\n\treturn ZODIAC_LOWER.every((s) => lower.has(s));\n}\n\n/** One digested leaf field from a resolved schema. Shared by the flat and grouped construction paths so params and body props carry identical metadata (min/max included). */\nfunction toField(\n\tname: string,\n\tresolved: OpenApiSchema,\n\topts: { key: string; group?: string; required: boolean; inQuery?: boolean },\n): FieldDef {\n\tconst rep = representative(resolved);\n\treturn {\n\t\tkey: opts.key,\n\t\tname,\n\t\tgroup: opts.group,\n\t\tinQuery: opts.inQuery,\n\t\tkind: classifyInput(resolved) ?? 'text',\n\t\trequired: opts.required,\n\t\tdescription: rep.description ?? resolved.description,\n\t\tenum: rep.enum,\n\t\tmin: rep.minimum,\n\t\tmax: rep.maximum,\n\t\tdefault: resolved.default ?? rep.default,\n\t\texample: resolved.example ?? rep.example,\n\t};\n}\n\n/**\n * Digest one operation into the {@link FormModel} the form renders. This is the single construction path: body properties (nested objects expand to `group.sub` keys) and path+query parameters flow through {@link toField} identically, so a query integer keeps its min/max the same as a body integer. The `lang` query parameter is dropped from `fields` and surfaced as {@link FormModel.hasLang} instead.\n */\nexport function buildFormModel(\n\top: OperationSchema,\n\tschemas: Record<string, OpenApiSchema>,\n\tendpoint: string,\n): FormModel {\n\tconst fields: FieldDef[] = [];\n\tlet hasLang = false;\n\n\tconst bodyRef = op.requestBody?.content?.['application/json']?.schema;\n\tconst bodySchema = resolveSchema(bodyRef, schemas);\n\tif (bodySchema?.properties) {\n\t\tconst required = new Set(bodySchema.required ?? []);\n\t\tfor (const [name, sub] of Object.entries(bodySchema.properties)) {\n\t\t\tconst resolved = resolveSchema(sub, schemas) ?? {};\n\t\t\tif (resolved.type === 'object' && resolved.properties) {\n\t\t\t\tconst subRequired = new Set(resolved.required ?? []);\n\t\t\t\tfor (const [subName, subSchema] of Object.entries(\n\t\t\t\t\tresolved.properties,\n\t\t\t\t)) {\n\t\t\t\t\tconst r = resolveSchema(subSchema, schemas) ?? {};\n\t\t\t\t\tfields.push(\n\t\t\t\t\t\ttoField(subName, r, {\n\t\t\t\t\t\t\tkey: `${name}.${subName}`,\n\t\t\t\t\t\t\tgroup: name,\n\t\t\t\t\t\t\trequired: required.has(name) && subRequired.has(subName),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfields.push(\n\t\t\t\t\ttoField(name, resolved, { key: name, required: required.has(name) }),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const param of op.parameters ?? []) {\n\t\tif (param.in !== 'path' && param.in !== 'query') continue;\n\t\t// lang is site-owner chrome, not a visitor field: route it through the\n\t\t// element `lang` attribute, never render it in the form.\n\t\tif (param.name === 'lang' && param.in === 'query') {\n\t\t\thasLang = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst resolved = resolveSchema(param.schema, schemas) ?? {};\n\t\tfields.push(\n\t\t\ttoField(param.name, resolved, {\n\t\t\t\tkey: param.name,\n\t\t\t\trequired: !!param.required,\n\t\t\t\tinQuery: param.in === 'query',\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn { title: deriveTitle(op.summary, endpoint), fields, hasLang };\n}\n\n/**\n * Concise form heading. Prefers the operation summary (spec-authored), taking the clause before the first \" - \" so \"Daily horoscope by zodiac sign - Transit-based forecast\" reads as \"Daily horoscope by zodiac sign\", and falls back to the humanized last path segment.\n */\nexport function deriveTitle(\n\tsummary: string | undefined,\n\tendpoint: string,\n): string {\n\tconst lead = summary?.split(' - ')[0]?.trim();\n\tif (lead) return lead;\n\treturn humanize(endpoint.split('/').pop() ?? '');\n}\n\n/**\n * Outcome-first submit-button label keyed off the endpoint intent. Chart and reading endpoints \"Generate\", divination endpoints \"Cast\", comparison endpoints \"Compare\", and lookup/reading GETs \"Get reading\". A generic verb beats a bare \"Submit\" on a widget a visitor never set up.\n */\nexport function deriveSubmitLabel(endpoint: string): string {\n\tconst e = endpoint.toLowerCase();\n\tif (/compat|synastry|guna|connection|penta|composite/.test(e))\n\t\treturn 'Compare';\n\tif (/\\bcast\\b|\\/draw|iching|hexagram|tarot/.test(e)) return 'Cast';\n\tif (/horoscope|dream|angel|nakshatra|crystal|meaning|reference/.test(e))\n\t\treturn 'Get reading';\n\treturn 'Generate';\n}\n\n/** Deterministic slice filename for one operation, shared by the generator and the runtime loader so both address the same artifact. */\nexport function sliceFileName(method: string, endpoint: string): string {\n\tconst path = endpoint\n\t\t.replace(/^\\//, '')\n\t\t.replace(/[{}]/g, '')\n\t\t.replace(/\\//g, '-');\n\treturn `${method.toLowerCase()}--${path}.json`;\n}\n", "// Generated by scripts/sync-version.ts. Do not edit.\nexport const ROXY_UI_VERSION = '0.21.1';\n"],
|
|
5
|
-
"mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,cAAAC,EAAY,WAAAC,MAAe,MAC/C,OAAS,iBAAAC,EAAe,YAAAC,EAAU,SAAAC,MAAa,oBAC/C,OAAS,aAAAC,MAAiB,+BC8CnB,IAAMC,EAAqC,CACjD,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,IAAK,SACL,MAAO,SACP,MAAO,SACP,QAAS,SACT,YAAa,SACb,UAAW,SACX,SAAU,SACV,OAAQ,QACT,EAiBO,IAAMC,EAAc,CAC1B,QACA,SACA,SACA,SACA,MACA,QACA,QACA,UACA,cACA,YACA,WACA,QACD,EC3FA,OAAS,OAAAC,MAAW,MAMb,IAAMC,EAAaD,67FCL1B,OAAS,OAAAE,EAAK,QAAAC,MAAY,MAQnB,S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OAAO,SAASd,CAAC,EAAIA,EAAI,MACjC,CACA,OAAOc,EACR,CACD,EAreahC,EACL,OAAS,CACfmE,EACAC,EACAC,giLACD,EAGAC,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,GAP1CvE,EAQZ,wBAGAsE,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GAVdvE,EAWZ,sBAIAsE,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,UAAW,CAAC,GAdrCvE,EAeZ,uBAIAsE,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,CAAC,GAlBzCvE,EAmBZ,2BAIAsE,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,iBAAkB,CAAC,GAtB5CvE,EAuBZ,8BAIAsE,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GA1BlBvE,EA2BZ,6BAGQsE,EAAA,CADPE,EAAM,GA7BKxE,EA8BJ,sBAGAsE,EAAA,CADPE,EAAM,GAhCKxE,EAiCJ,yBAGAsE,EAAA,CADPE,EAAM,GAnCKxE,EAoCJ,uBAGAsE,EAAA,CADPE,EAAM,GAtCKxE,EAuCJ,sBAGAsE,EAAA,CADPE,EAAM,GAzCKxE,EA0CJ,sBAGAsE,EAAA,CADPE,EAAM,GA5CKxE,EA6CJ,yBAGAsE,EAAA,CADPE,EAAM,GA/CKxE,EAgDJ,gCAhDIA,EAANsE,EAAA,CADNG,EAAc,oBAAoB,GACtBzE",
|
|
6
|
-
"names": ["css", "html", "LitElement", "nothing", "customElement", "property", "state", "ifDefined", "SIGN_GLYPH", "SIGNS_ORDER", "css", "baseStyles", "css", "html", "chevron", "disclosureStyles", "capitalize", "s", "humanize", "c", "TILE_MAX", "LOCATION_TRIO", "ZODIAC_LOWER", "SIGNS_ORDER", "s", "resolveSchema", "schema", "all", "
|
|
4
|
+
"sourcesContent": ["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SIGN_GLYPH } from '../tokens/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { chevron, disclosureStyles } from '../utils/disclosure.js';\nimport {\n\tbuildFormModel,\n\tderiveSubmitLabel,\n\ttype FieldDef,\n\ttype FormModel,\n\tisZodiacEnum,\n\tLOCATION_PAIR,\n\tLOCATION_TRIO,\n\ttype OpenApiDoc,\n\ttype OperationSchema,\n\tsliceFileName,\n} from '../utils/field-schema.js';\nimport { capitalize, humanize } from '../utils/string.js';\nimport { ROXY_UI_VERSION } from '../version.js';\n\n/** Production spec, fetched when no slice is available and no explicit `spec-url` is set. */\nconst PROD_SPEC_URL = 'https://roxyapi.com/api/v2/openapi.json';\n\n/** Version-pinned jsDelivr base for the digested per-operation schema slices, mirroring the wrapper CDN pinning so a slice matches the bundle it ships beside. */\nconst SLICE_BASE = `https://cdn.jsdelivr.net/npm/@roxyapi/ui@${ROXY_UI_VERSION}/dist/schemas`;\n\nconst specCache = new Map<string, Promise<OpenApiDoc>>();\n\n/**\n * Drop every cached spec promise.\n\n * @remarks\n * Test-only, and deliberately NOT re-exported from the package entry. The cache is module state shared by every test file in a single `bun test` process, and it only self-evicts on rejection, so one file that resolves a spec leaves a warm entry that silently satisfies a later file assertion about fetching. That made slice-fallback coverage pass or fail purely on file order.\n\n * @internal\n */\nexport function resetSpecCache(): void {\n\tspecCache.clear();\n}\n\nasync function loadSpec(url: string): Promise<OpenApiDoc> {\n\tlet pending = specCache.get(url);\n\tif (!pending) {\n\t\tpending = fetch(url)\n\t\t\t.then(async (res) => {\n\t\t\t\tif (!res.ok) throw new Error(`HTTP ${res.status}`);\n\t\t\t\treturn (await res.json()) as OpenApiDoc;\n\t\t\t})\n\t\t\t.catch((err) => {\n\t\t\t\t// Evict the rejected promise BEFORE rethrowing so subsequent\n\t\t\t\t// callers (the user clicking Retry, a remount) hit the network\n\t\t\t\t// again instead of replaying the cached failure forever.\n\t\t\t\tspecCache.delete(url);\n\t\t\t\tthrow err;\n\t\t\t});\n\t\tspecCache.set(url, pending);\n\t}\n\treturn pending;\n}\n\n/** A fresh seed for a hidden `seed` field, so each submit is a new draw unless the caller pinned one. */\nfunction randomSeed(): string {\n\treturn (\n\t\tglobalThis.crypto?.randomUUID?.() ?? Math.random().toString(36).slice(2)\n\t);\n}\n\n/** Parse an array-field text value into a real array: JSON when it parses to one, else comma-separated tokens. */\nfunction parseArrayValue(raw: string): unknown {\n\tconst trimmed = raw.trim();\n\tif (!trimmed) return [];\n\ttry {\n\t\tconst parsed = JSON.parse(trimmed);\n\t\tif (Array.isArray(parsed)) return parsed;\n\t} catch {\n\t\t// Not JSON: fall through to comma splitting.\n\t}\n\treturn trimmed\n\t\t.split(',')\n\t\t.map((s) => s.trim())\n\t\t.filter(Boolean);\n}\n\n/**\n * Schema-driven form. Pass `endpoint` (e.g. \"vedic-astrology/birth-chart\"). The form digests the operation's request schema into a spec-derived input for each parameter (a zodiac tile grid, a date or time input, a city search, a toggle) with progressive disclosure, and emits a `roxy-submit` CustomEvent carrying the validated payload. The caller decides what to do (call the SDK, render a chart, navigate).\n *\n * @remarks\n * Schema resolution order: an explicit `spec-url` fetches that full spec and digests it (unchanged, the demo path); otherwise the form tries a small version-pinned per-operation slice from the CDN, and on any miss falls back to fetching the production spec. Each input kind is chosen purely from the parameter shape (see {@link ../utils/field-schema.ts}), so a new endpoint gets a working, on-brand form with no per-endpoint code.\n *\n * The visitor-facing `lang` parameter is never rendered: a site owner sets the element `lang` attribute, and the form routes it to the query string on submit. Optional parameters collapse under one Advanced disclosure; a form whose only required field is an enum submits on selection.\n */\n@customElement('roxy-endpoint-form')\nexport class RoxyEndpointForm extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tdisclosureStyles,\n\t\tcss`form{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);display:grid}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);margin:0}.fields{align-items:start;gap:var(--roxy-space-md,1rem);grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));display:grid}.fields:empty{display:none}.person-group{background:var(--roxy-surface,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-md,1rem);gap:var(--roxy-space-md,1rem);min-inline-size:0;margin:0;display:grid}.person-group legend{padding:0 var(--roxy-space-xs,.25rem);font-weight:var(--roxy-weight-bold,600)}.field{gap:var(--roxy-space-xs,.25rem);flex-direction:column;min-width:0;display:flex}.tiles-field{grid-column:1/-1}label,.label{font-size:var(--roxy-text-sm,.875rem);color:var(--roxy-secondary,#475569)}.req{color:var(--roxy-danger-fg,#991b1b);margin-left:4px}input,select{box-sizing:border-box;width:100%;padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);font-size:var(--roxy-text-base,1rem);color:var(--roxy-fg,#0a0a0a);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);font-family:inherit}input:focus,select:focus{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-color:var(--roxy-accent-ink,#b45309)}.help{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem)}.help-details>summary{cursor:pointer;color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-xs,.75rem);align-items:center;gap:4px;display:flex}.help-details .help-lead{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.help-details .help-full{margin-top:var(--roxy-space-xs,.25rem);display:block}.location-block{gap:var(--roxy-space-xs,.25rem);grid-column:1/-1;display:grid}.tiles{gap:var(--roxy-space-sm,.5rem);grid-template-columns:repeat(auto-fit,minmax(5.5rem,1fr));display:grid}.tile{min-height:44px;padding:var(--roxy-space-sm,.5rem);background:var(--roxy-bg,#fff);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;transition:border-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease), background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-direction:column;justify-content:center;align-items:center;gap:2px;display:flex}.tile:hover{border-color:var(--roxy-accent,#f59e0b)}.tile[aria-checked=true]{border-color:var(--roxy-accent,#f59e0b);background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 12%, transparent);color:var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}.tile:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.tile-glyph{font-size:1.35em;line-height:1}.toggle-row{align-items:center;gap:var(--roxy-space-sm,.5rem);display:flex}.toggle{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-full,9999px);background:var(--roxy-border,#e4e4e7);cursor:pointer;width:44px;height:26px;transition:background-color var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0;padding:0;position:relative}.toggle[aria-checked=true]{background:var(--roxy-accent,#f59e0b);border-color:var(--roxy-accent,#f59e0b)}.toggle .knob{background:var(--roxy-bg,#fff);width:20px;height:20px;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);border-radius:50%;position:absolute;top:2px;left:2px}.toggle[aria-checked=true] .knob{transform:translate(18px)}.toggle:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.toggle-label{cursor:pointer}@media (prefers-reduced-motion:reduce){.tile,.toggle,.toggle .knob{transition:none}}.advanced{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.advanced>summary{cursor:pointer;font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-fg,#0a0a0a);align-items:center;gap:6px;display:flex}.advanced[open]>summary{margin-bottom:var(--roxy-space-md,1rem)}.advanced .fields,.advanced .person-group{margin-top:var(--roxy-space-md,1rem)}.validation-error{gap:var(--roxy-space-xs,.25rem);padding:var(--roxy-space-md,1rem);background:color-mix(in srgb, var(--roxy-danger,#dc2626) 8%, transparent);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);display:grid}button.submit{background:var(--roxy-accent-ink,#b45309);color:var(--roxy-bg,#fff);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-lg,1.5rem);font-size:var(--roxy-text-base,1rem);font-weight:var(--roxy-weight-bold,600);cursor:pointer;transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1));border:0;justify-self:start}button.submit:hover{transform:scale(1.02)}button.submit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}@media (prefers-reduced-motion:reduce){button.submit{transition:none}}.spec-error{gap:var(--roxy-space-md,1rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}`,\n\t];\n\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = 'vedic-astrology/birth-chart';\n\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Explicit OpenAPI spec URL. When set, the form fetches and digests that full spec (the demo path). When empty, it resolves a version-pinned slice first, then the production spec. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl = '';\n\n\t/** Override the submit-button label. Empty derives an outcome-first label from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel = '';\n\n\t/** Browser-safe publishable key, forwarded to the slotted city search so the natal or synastry form can geocode. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Prefill values, keyed by field name (nested per group). Used by `remember` mode and to restore the previous submission. JS property only. */\n\t@property({ attribute: false })\n\tinitialValues?: Record<string, unknown>;\n\n\t@state()\n\tprivate fields: FieldDef[] = [];\n\n\t@state()\n\tprivate formTitle = '';\n\n\t@state()\n\tprivate hasLang = false;\n\n\t@state()\n\tprivate values: Record<string, unknown> = {};\n\n\t@state()\n\tprivate loaded = false;\n\n\t@state()\n\tprivate specError: string | null = null;\n\n\t@state()\n\tprivate validationErrors: string[] = [];\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback();\n\t\tvoid this.loadSchema();\n\t}\n\n\tprivate async loadSchema() {\n\t\tthis.specError = null;\n\t\ttry {\n\t\t\tthis.applyModel(await this.resolveModel());\n\t\t} catch (err) {\n\t\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\t\tthis.specError = message;\n\t\t\tthis.loaded = true;\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('roxy-spec-error', {\n\t\t\t\t\tdetail: { url: this.specUrl || PROD_SPEC_URL, message },\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Resolve the form model: explicit spec-url wins; else a version-pinned slice; else the production spec. */\n\tprivate async resolveModel(): Promise<FormModel> {\n\t\tif (this.specUrl) return this.modelFromSpec(this.specUrl);\n\t\tconst slice = await this.tryLoadSlice();\n\t\treturn slice ?? this.modelFromSpec(PROD_SPEC_URL);\n\t}\n\n\t/** Fetch and digest one operation from a full OpenAPI document. */\n\tprivate async modelFromSpec(url: string): Promise<FormModel> {\n\t\tconst spec = await loadSpec(url);\n\t\tconst path = `/${this.endpoint.replace(/^\\//, '')}`;\n\t\tconst op = spec.paths?.[path]?.[this.method.toLowerCase()] as\n\t\t\t| OperationSchema\n\t\t\t| undefined;\n\t\tif (!op) {\n\t\t\tthrow new Error(\n\t\t\t\t`Endpoint ${this.method} ${path} not found in OpenAPI spec`,\n\t\t\t);\n\t\t}\n\t\treturn buildFormModel(op, spec.components?.schemas ?? {}, this.endpoint);\n\t}\n\n\t/** Try the small precomputed slice; return null on any miss so the caller falls back to the full spec. */\n\tprivate async tryLoadSlice(): Promise<FormModel | null> {\n\t\ttry {\n\t\t\tconst res = await fetch(\n\t\t\t\t`${SLICE_BASE}/${sliceFileName(this.method, this.endpoint)}`,\n\t\t\t);\n\t\t\tif (!res.ok) return null;\n\t\t\treturn (await res.json()) as FormModel;\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate applyModel(model: FormModel) {\n\t\tthis.fields = model.fields;\n\t\tthis.formTitle = model.title;\n\t\tthis.hasLang = model.hasLang;\n\t\t// Pre-fill: schema defaults first, then any remembered/initial values (only\n\t\t// for fields this endpoint has) so a stale stored payload from another\n\t\t// endpoint cannot inject unknown keys. Remembered values are nested per\n\t\t// group, so read them by group.\n\t\tconst init: Record<string, unknown> = {};\n\t\tfor (const f of model.fields) {\n\t\t\tif (f.default !== undefined) init[f.key] = f.default;\n\t\t\tconst remembered = f.group\n\t\t\t\t? (\n\t\t\t\t\t\tthis.initialValues?.[f.group] as Record<string, unknown> | undefined\n\t\t\t\t\t)?.[f.name]\n\t\t\t\t: this.initialValues?.[f.name];\n\t\t\tif (remembered !== undefined) init[f.key] = remembered;\n\t\t}\n\t\tthis.values = init;\n\t\tthis.loaded = true;\n\t}\n\n\tprivate retryLoadSchema = () => {\n\t\tthis.loaded = false;\n\t\tthis.specError = null;\n\t\tvoid this.loadSchema();\n\t};\n\n\tprivate setValue(name: string, value: unknown) {\n\t\tthis.values = { ...this.values, [name]: value };\n\t}\n\n\t/** The field's render role: a hidden autogenerated seed, a hidden defaulted limit/offset, a suppressed location coordinate, or a normally rendered input. */\n\tprivate roleOf(\n\t\tf: FieldDef,\n\t): 'seed' | 'hidden-default' | 'location' | 'normal' {\n\t\tif (f.name === 'seed') return 'seed';\n\t\tif ((f.name === 'limit' || f.name === 'offset') && !f.required)\n\t\t\treturn 'hidden-default';\n\t\tif (\n\t\t\t(LOCATION_TRIO as readonly string[]).includes(f.name) &&\n\t\t\tthis.groupHasLocation(f.group)\n\t\t)\n\t\t\treturn 'location';\n\t\t// A flat timezone in a group with no coordinates of its own is still suppressed when a\n\t\t// location group has claimed it, otherwise the prefixed shape shows a raw decimal-hours\n\t\t// box beside two city searches that already know the answer.\n\t\tif (\n\t\t\tf.name === 'timezone' &&\n\t\t\tthis.locationGroups().some((g) => this.timezoneFieldFor(g)?.key === f.key)\n\t\t)\n\t\t\treturn 'location';\n\t\treturn 'normal';\n\t}\n\n\t/** True when the field renders its own input (as opposed to being hidden or replaced by the city search). */\n\tprivate isRendered(f: FieldDef): boolean {\n\t\treturn this.roleOf(f) === 'normal';\n\t}\n\n\t/** Ordered, de-duplicated group keys (undefined flat group plus each named object). */\n\tprivate groupKeys(): (string | undefined)[] {\n\t\tconst keys: (string | undefined)[] = [];\n\t\tfor (const f of this.fields)\n\t\t\tif (!keys.includes(f.group)) keys.push(f.group);\n\t\treturn keys;\n\t}\n\n\t/** True when the fields in `group` (or the flat top level) carry a latitude+longitude pair, so a location-search can autofill them. Timezone is NOT required here, see {@link LOCATION_PAIR}. */\n\tprivate groupHasLocation(group?: string): boolean {\n\t\tconst inGroup = this.fields.filter((f) => f.group === group);\n\t\treturn LOCATION_PAIR.every((n) => inGroup.some((f) => f.name === n));\n\t}\n\n\t/**\n\t * Location groups in field order. Order is load-bearing: when a request carries coordinate\n\t * groups but only ONE unprefixed top-level `timezone`, the FIRST group owns it, because that\n\t * timezone belongs to the primary moment (`generateRelocationChart` has one `timezone` and it is\n\t * the birth timezone). Without an owner both city boxes would write the same key and the second\n\t * pick would silently overwrite the first with the wrong offset.\n\t */\n\tprivate locationGroups(): (string | undefined)[] {\n\t\treturn this.groupKeys().filter((g) => this.groupHasLocation(g));\n\t}\n\n\t/**\n\t * The timezone field a group's city search should fill, or undefined when there is none.\n\t *\n\t * Prefers a timezone inside the group (the nested `person1`/`person2` shape has its own). Falls\n\t * back to an unowned flat `timezone` for the first location group only, which is what makes the\n\t * prefixed shape work without leaving a decimal-hours box for a visitor to guess at.\n\t */\n\tprivate timezoneFieldFor(group?: string): FieldDef | undefined {\n\t\tconst own = this.fields.find(\n\t\t\t(f) => f.group === group && f.name === 'timezone',\n\t\t);\n\t\tif (own) return own;\n\t\tif (this.locationGroups()[0] !== group) return undefined;\n\t\treturn this.fields.find(\n\t\t\t(f) => f.group === undefined && f.name === 'timezone',\n\t\t);\n\t}\n\n\t/**\n\t * True when the location block must show a required mark, i.e. ANY member of the trio is required. The block is a single city-search input that fills all three, so if even one is required (e.g. bodygraph requires `timezone` while `latitude`/`longitude` are optional) the input is required and `collectMissing` blocks submit without it. Requiring ALL three understated that: the asterisk went missing on a block the form still enforced, which reads as optional to a non-technical embedder.\n\t */\n\tprivate locationRequired(group?: string): boolean {\n\t\tconst inGroup = this.fields.filter((f) => f.group === group);\n\t\treturn LOCATION_TRIO.some((n) =>\n\t\t\tinGroup.some((f) => f.name === n && f.required),\n\t\t);\n\t}\n\n\t/** A named group is a required input when any of its leaf fields is required or it carries a location. */\n\tprivate groupIsRequired(group: string): boolean {\n\t\treturn (\n\t\t\tthis.groupHasLocation(group) ||\n\t\t\tthis.fields.some((f) => f.group === group && f.required)\n\t\t);\n\t}\n\n\t/**\n\t * The single visible required enum field, when the whole form reduces to exactly one: no location block, no named group, one required rendered enum. This is what turns the horoscope form into a tap-to-load sign grid; returns null otherwise.\n\t */\n\tprivate get singleEnumField(): FieldDef | null {\n\t\tif (this.groupKeys().some((g) => this.groupHasLocation(g))) return null;\n\t\tif (this.groupKeys().some((g) => g !== undefined)) return null;\n\t\tconst req = this.fields.filter((f) => f.required && this.isRendered(f));\n\t\tconst only = req[0];\n\t\tif (req.length !== 1 || !only) return null;\n\t\treturn only.kind === 'tiles' || only.kind === 'select' ? only : null;\n\t}\n\n\tprivate effectiveSubmitLabel(): string {\n\t\treturn this.submitLabel || deriveSubmitLabel(this.endpoint);\n\t}\n\n\t/** The site-owner language from the element `lang` attribute (native), or undefined. Read here, never a Lit property, to avoid shadowing the native accessor. */\n\tprivate effectiveLang(): string | undefined {\n\t\treturn this.lang || undefined;\n\t}\n\n\t/**\n\t * Location-select handler bound to a group: fills that group's coordinate keys plus whichever\n\t * timezone field it owns.\n\t *\n\t * Keys are LOOKED UP from the model rather than built as `group.name`. That assumption held only\n\t * while every group came from object nesting; a prefixed group stores under the original wire\n\t * name (`birthLatitude`), so constructing `birth.latitude` would write a key the request builder\n\t * never reads and the coordinates would silently stay empty.\n\t */\n\tprivate onLocationFor(group?: string) {\n\t\treturn (e: Event) => {\n\t\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\t\tlatitude?: number;\n\t\t\t\tlongitude?: number;\n\t\t\t\ttimezone?: string;\n\t\t\t\tutcOffset?: number;\n\t\t\t};\n\t\t\tif (!detail) return;\n\t\t\tconst keyOf = (name: string) =>\n\t\t\t\tthis.fields.find((f) => f.group === group && f.name === name)?.key;\n\t\t\tconst next: Record<string, unknown> = { ...this.values };\n\t\t\tconst lat = keyOf('latitude');\n\t\t\tconst lon = keyOf('longitude');\n\t\t\tif (lat) next[lat] = detail.latitude;\n\t\t\tif (lon) next[lon] = detail.longitude;\n\t\t\tconst tz = this.timezoneFieldFor(group);\n\t\t\tif (tz) next[tz.key] = detail.timezone ?? detail.utcOffset;\n\t\t\tthis.values = next;\n\t\t};\n\t}\n\n\tprivate selectTile(f: FieldDef, value: string) {\n\t\tthis.setValue(f.key, value);\n\t\tif (this.singleEnumField?.key === f.key) this.submit();\n\t}\n\n\t/** Roving-tabindex arrow-key navigation for a tile radiogroup, modeled on the shared tablist pattern (selection follows focus). */\n\tprivate onTilesKeyDown(f: FieldDef) {\n\t\treturn (e: KeyboardEvent) => {\n\t\t\tconst opts = f.enum ?? [];\n\t\t\tif (opts.length === 0) return;\n\t\t\tconst cur = opts.indexOf(this.values[f.key] as string);\n\t\t\tlet next: number;\n\t\t\tif (e.key === 'Home') next = 0;\n\t\t\telse if (e.key === 'End') next = opts.length - 1;\n\t\t\telse if (e.key === 'ArrowRight' || e.key === 'ArrowDown')\n\t\t\t\tnext = cur === -1 ? 0 : (cur + 1) % opts.length;\n\t\t\telse if (e.key === 'ArrowLeft' || e.key === 'ArrowUp')\n\t\t\t\tnext =\n\t\t\t\t\tcur === -1 ? opts.length - 1 : (cur - 1 + opts.length) % opts.length;\n\t\t\telse return;\n\t\t\te.preventDefault();\n\t\t\tconst value = opts[next];\n\t\t\tif (value === undefined) return;\n\t\t\tthis.selectTile(f, value);\n\t\t\tconst root = e.currentTarget as HTMLElement;\n\t\t\trequestAnimationFrame(() =>\n\t\t\t\troot.querySelector<HTMLButtonElement>(`[data-tile='${next}']`)?.focus(),\n\t\t\t);\n\t\t};\n\t}\n\n\tprivate onSubmit = (e: Event) => {\n\t\te.preventDefault();\n\t\tthis.submit();\n\t};\n\n\t/** Validate, then emit `roxy-submit` with the reconstructed payload, the spec query keys, and whether the form was a single-enum sticky picker. */\n\tprivate submit() {\n\t\tconst missing = this.collectMissing();\n\t\tif (missing.keys.length > 0) {\n\t\t\tthis.validationErrors = missing.labels;\n\t\t\tthis.dispatchEvent(\n\t\t\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\t\t\tdetail: { missing: missing.keys },\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tthis.validationErrors = [];\n\t\tconst out: Record<string, unknown> = {};\n\t\tfor (const f of this.fields) {\n\t\t\tlet v = this.values[f.key];\n\t\t\t// A hidden seed autogenerates per submit unless a value was remembered.\n\t\t\tif (f.name === 'seed' && (v === undefined || v === '')) v = randomSeed();\n\t\t\tif (v === undefined || v === '') continue;\n\t\t\tif (f.kind === 'array' && typeof v === 'string') v = parseArrayValue(v);\n\t\t\tif (f.group) {\n\t\t\t\tconst g = (out[f.group] as Record<string, unknown> | undefined) ?? {};\n\t\t\t\tg[f.name] = v;\n\t\t\t\tout[f.group] = g;\n\t\t\t} else {\n\t\t\t\tout[f.name] = v;\n\t\t\t}\n\t\t}\n\t\t// The spec knows which parameters belong in the query string; the listener\n\t\t// does not. Report them (including a site-owner lang) so a POST with a query\n\t\t// parameter reaches the API correctly instead of being dropped in the body.\n\t\tconst queryKeys = this.fields.filter((f) => f.inQuery).map((f) => f.name);\n\t\tconst lang = this.effectiveLang();\n\t\tif (this.hasLang && lang) {\n\t\t\tout.lang = lang;\n\t\t\tqueryKeys.push('lang');\n\t\t}\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('roxy-submit', {\n\t\t\t\tdetail: {\n\t\t\t\t\tendpoint: this.endpoint,\n\t\t\t\t\tvalues: out,\n\t\t\t\t\tqueryKeys,\n\t\t\t\t\tsticky: this.singleEnumField != null,\n\t\t\t\t},\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t);\n\t}\n\n\t/** Required fields left empty, with the location trio collapsed to one entry per group. Seed and hidden defaults never block. */\n\tprivate collectMissing(): { keys: string[]; labels: string[] } {\n\t\tconst keys: string[] = [];\n\t\tconst labels: string[] = [];\n\t\tconst locGroups = new Set<string | undefined>();\n\t\tfor (const f of this.fields) {\n\t\t\tif (!f.required) continue;\n\t\t\tconst isLocation = this.roleOf(f) === 'location';\n\t\t\tif (!this.isRendered(f) && !isLocation) continue;\n\t\t\tconst v = this.values[f.key];\n\t\t\tif (v !== undefined && v !== '') continue;\n\t\t\tkeys.push(f.key);\n\t\t\tif (isLocation) {\n\t\t\t\tlocGroups.add(f.group);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlabels.push(\n\t\t\t\tf.group ? `${humanize(f.group)} ${humanize(f.name)}` : humanize(f.name),\n\t\t\t);\n\t\t}\n\t\tfor (const g of locGroups) {\n\t\t\tlabels.push(g ? `${humanize(g)} location` : 'Birth location');\n\t\t}\n\t\treturn { keys, labels };\n\t}\n\n\tprivate reqMark(f: FieldDef) {\n\t\treturn f.required\n\t\t\t? html`<span class=\"req\" aria-hidden=\"true\">*</span>`\n\t\t\t: nothing;\n\t}\n\n\t/** A description under a field: rendered inline when short, collapsed behind a disclosure showing its first line when long. */\n\tprivate description(f: FieldDef) {\n\t\tif (!f.description) return nothing;\n\t\tif (f.description.length <= 120) {\n\t\t\treturn html`<small class=\"help\">${f.description}</small>`;\n\t\t}\n\t\tconst lead = f.description.split('. ')[0] ?? f.description;\n\t\treturn html`<details class=\"help-details\"><summary><span class=\"help-lead\">${lead}</span>${chevron()}</summary><small class=\"help help-full\">${f.description}</small></details>`;\n\t}\n\n\tprivate renderTiles(f: FieldDef) {\n\t\tconst labelId = `roxy-form-${f.key}-label`;\n\t\tconst zodiac = !!f.enum && isZodiacEnum(f.enum);\n\t\tconst opts = f.enum ?? [];\n\t\tconst cur = opts.indexOf(this.values[f.key] as string);\n\t\tconst active = cur === -1 ? 0 : cur;\n\t\treturn html`<div class=\"field tiles-field\"><span class=\"label\" id=\"${labelId}\">${humanize(f.name)}${this.reqMark(f)}</span><div class=\"tiles\" role=\"radiogroup\" aria-labelledby=\"${labelId}\" @keydown=\"${this.onTilesKeyDown(f)}\">${opts.map((opt, i) => {\n\t\t\t\t\tconst selected = this.values[f.key] === opt;\n\t\t\t\t\tconst glyph = zodiac ? SIGN_GLYPH[capitalize(opt)] : undefined;\n\t\t\t\t\treturn html`<button type=\"button\" class=\"tile\" role=\"radio\" data-tile=\"${i}\" aria-checked=\"${selected ? 'true' : 'false'}\" tabindex=\"${i === active ? '0' : '-1'}\" @click=\"${() => this.selectTile(f, opt)}\">${\n\t\t\t\t\t\t\tglyph\n\t\t\t\t\t\t\t\t? html`<span class=\"tile-glyph\" aria-hidden=\"true\">${glyph}</span>`\n\t\t\t\t\t\t\t\t: nothing\n\t\t\t\t\t\t} <span class=\"tile-label\">${humanize(opt)}</span></button>`;\n\t\t\t\t})}</div>${this.description(f)}</div>`;\n\t}\n\n\tprivate renderSelect(f: FieldDef) {\n\t\tconst id = `roxy-form-${f.key}`;\n\t\treturn html`<div class=\"field\"><label for=\"${id}\">${humanize(f.name)}${this.reqMark(f)}</label> <select id=\"${id}\" ?required=\"${f.required}\" @change=\"${(e: Event) =>\n\t\t\t\t\tthis.setValue(f.key, (e.target as HTMLSelectElement).value)}\"><option value=\"\">Choose</option>${(f.enum ?? []).map(\n\t\t\t\t\t(\n\t\t\t\t\t\topt,\n\t\t\t\t\t) => html`<option value=\"${opt}\" ?selected=\"${this.values[f.key] === opt}\">${humanize(opt)}</option>`,\n\t\t\t\t)}</select> ${this.description(f)}</div>`;\n\t}\n\n\tprivate renderToggle(f: FieldDef) {\n\t\tconst id = `roxy-form-${f.key}`;\n\t\tconst checked = this.values[f.key] === true;\n\t\treturn html`<div class=\"field\"><div class=\"toggle-row\"><button type=\"button\" id=\"${id}\" class=\"toggle\" role=\"switch\" aria-checked=\"${checked ? 'true' : 'false'}\" @click=\"${() => this.setValue(f.key, !checked)}\"><span class=\"knob\"></span></button> <label class=\"toggle-label\" for=\"${id}\">${humanize(f.name)}${this.reqMark(f)}</label></div>${this.description(f)}</div>`;\n\t}\n\n\tprivate renderInput(f: FieldDef) {\n\t\tconst id = `roxy-form-${f.key}`;\n\t\tconst type =\n\t\t\tf.kind === 'datetime'\n\t\t\t\t? 'datetime-local'\n\t\t\t\t: f.kind === 'number'\n\t\t\t\t\t? 'number'\n\t\t\t\t\t: f.kind;\n\t\tconst placeholder =\n\t\t\tf.kind === 'array'\n\t\t\t\t? 'Comma separated'\n\t\t\t\t: f.example != null\n\t\t\t\t\t? String(f.example)\n\t\t\t\t\t: '';\n\t\treturn html`<div class=\"field\"><label for=\"${id}\">${humanize(f.name)}${this.reqMark(f)}</label> <input id=\"${id}\" type=\"${f.kind === 'array' ? 'text' : type}\" ?required=\"${f.required}\" min=\"${ifDefined(f.min)}\" max=\"${ifDefined(f.max)}\" step=\"${f.kind === 'number' ? 'any' : nothing}\" placeholder=\"${placeholder || nothing}\" .value=\"${(this.values[f.key] ?? '') as string}\" @input=\"${(e: Event) =>\n\t\t\t\t\tthis.setValue(\n\t\t\t\t\t\tf.key,\n\t\t\t\t\t\tthis.coerce(f.kind, (e.target as HTMLInputElement).value),\n\t\t\t\t\t)}\"> ${this.description(f)}</div>`;\n\t}\n\n\tprivate renderField(f: FieldDef) {\n\t\tswitch (f.kind) {\n\t\t\tcase 'tiles':\n\t\t\t\treturn this.renderTiles(f);\n\t\t\tcase 'select':\n\t\t\t\treturn this.renderSelect(f);\n\t\t\tcase 'toggle':\n\t\t\t\treturn this.renderToggle(f);\n\t\t\tdefault:\n\t\t\t\treturn this.renderInput(f);\n\t\t}\n\t}\n\n\t/**\n\t * The fields this group's city search actually fills, named in the help text.\n\t *\n\t * Not the hardcoded \"latitude, longitude, timezone\" it used to say: a group does not always own a\n\t * timezone. `generateRelocationChart` has one top-level `timezone` that belongs to the birth\n\t * moment, so the relocation block fills coordinates only, and promising a timezone there would be\n\t * a visible lie on the one form that made this method necessary.\n\t */\n\tprivate locationFillList(group?: string): string {\n\t\tconst names = [...LOCATION_PAIR] as string[];\n\t\tif (this.timezoneFieldFor(group)) names.push('timezone');\n\t\treturn names.join(', ');\n\t}\n\n\tprivate locationBlock(group?: string) {\n\t\treturn html`<div class=\"location-block\"><label>${group ? `${humanize(group)} location` : 'Birth location'}${\n\t\t\t\t\tthis.locationRequired(group)\n\t\t\t\t\t\t? html`<span class=\"req\" aria-hidden=\"true\">*</span>`\n\t\t\t\t\t\t: nothing\n\t\t\t\t}</label><roxy-location-search publishable-key=\"${ifDefined(this.publishableKey)}\" @roxy-location-select=\"${this.onLocationFor(group)}\" placeholder=\"${group ? `${humanize(group)} city` : 'City of birth'}\"></roxy-location-search><small class=\"help\">Fills ${this.locationFillList(group)}. Pick a city to autofill.</small></div>`;\n\t}\n\n\tprivate groupCard(group: string) {\n\t\tconst fields = this.fields.filter(\n\t\t\t(f) => f.group === group && this.isRendered(f),\n\t\t);\n\t\treturn html`<fieldset class=\"person-group\"><legend>${humanize(group)}</legend>${this.groupHasLocation(group) ? this.locationBlock(group) : nothing}<div class=\"fields\">${fields.map((f) => this.renderField(f))}</div></fieldset>`;\n\t}\n\n\trender() {\n\t\tif (!this.loaded) {\n\t\t\treturn html`<form><div class=\"roxy-skeleton\" style=\"height:8rem\"></div></form>`;\n\t\t}\n\t\tif (this.specError) {\n\t\t\treturn html`<div class=\"spec-error\" role=\"alert\">Schema load failed: ${this.specError} <button type=\"button\" class=\"submit\" @click=\"${this.retryLoadSchema}\">Retry</button></div>`;\n\t\t}\n\n\t\tconst flat = this.fields.filter((f) => !f.group && this.isRendered(f));\n\t\tconst flatReq = flat.filter((f) => f.required);\n\t\tconst flatOpt = flat.filter((f) => !f.required);\n\t\tconst named = this.groupKeys().filter((g): g is string => g !== undefined);\n\t\tconst reqGroups = named.filter((g) => this.groupIsRequired(g));\n\t\tconst optGroups = named.filter((g) => !this.groupIsRequired(g));\n\t\tconst hasAdvanced = flatOpt.length > 0 || optGroups.length > 0;\n\n\t\treturn html`<form @submit=\"${this.onSubmit}\"><h2 class=\"title\">${this.formTitle}</h2>${\n\t\t\t\tthis.validationErrors.length > 0\n\t\t\t\t\t? html`<div class=\"validation-error\" role=\"alert\"><strong>Please complete:</strong> ${this.validationErrors.join(', ')}</div>`\n\t\t\t\t\t: nothing\n\t\t\t}<div class=\"fields\">${flatReq.map((f) => this.renderField(f))}</div>${this.groupHasLocation(undefined) ? this.locationBlock(undefined) : nothing} ${reqGroups.map((g) => this.groupCard(g))} ${\n\t\t\t\thasAdvanced\n\t\t\t\t\t? html`<details class=\"advanced\"><summary>Advanced${chevron()}</summary><div class=\"fields\">${flatOpt.map((f) => this.renderField(f))}</div>${optGroups.map((g) => this.groupCard(g))}</details>`\n\t\t\t\t\t: nothing\n\t\t\t} ${\n\t\t\t\tthis.singleEnumField\n\t\t\t\t\t? nothing\n\t\t\t\t\t: html`<button class=\"submit\" type=\"submit\">${this.effectiveSubmitLabel()}</button>`\n\t\t\t}</form>`;\n\t}\n\n\tprivate coerce(kind: string, v: string): unknown {\n\t\tif (v === '') return undefined;\n\t\tif (kind === 'number') {\n\t\t\tconst n = Number(v);\n\t\t\treturn Number.isFinite(n) ? n : undefined;\n\t\t}\n\t\treturn v;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-endpoint-form': RoxyEndpointForm;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\n/**\n * Glyph per aspect, keyed by the hyphen-free canonical name.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. Unicode lists `\u22BB` XOR and `\u22BC` NAND as cross-references FROM the real quincunx and semisextile glyphs, so they look like safe stand-ins and are easy to pair the wrong way round, which renders a 150 degree quincunx with the 30 degree semisextile symbol. An astrologer reads the glyph, not the tooltip.\n */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\tsemisquare: '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "import type { TemplateResult } from 'lit';\nimport { css, html } from 'lit';\n\n/**\n * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the\n * browser default triangle with a thin chevron that rotates when the host\n * `<details>` opens. Render it inside the `<summary>` and pair with\n * {@link disclosureStyles}.\n */\nexport function chevron(): TemplateResult {\n\treturn html`<svg class=\"roxy-chevron\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\"><path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>`;\n}\n\n/**\n * Shared `<details>` accordion styling: hides the native disclosure triangle\n * and rotates the {@link chevron} 180 degrees when the accordion is open.\n * Import into any component that renders disclosure accordions so the chevron\n * looks and behaves identically.\n */\nexport const disclosureStyles = css`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Pure, framework-free schema layer shared by the self-fetch form. It turns one OpenAPI operation into a digested list of {@link FieldDef}s whose {@link InputKind} decides which input widget renders, with zero Lit or DOM dependency so the build-time slice generator ({@link ../../../scripts/build-schemas.ts}) and the taxonomy-coverage test consume the exact same classification the browser does.\n *\n * @remarks\n * The registry is by SHAPE, never by name: {@link classifyInput} inspects `enum` / `type` / `format` only, so a new API parameter gets a working widget with no code change, and the taxonomy gate fails loudly (via a `null` return) the day a genuinely new shape appears. Name-driven behaviour (suppressing `lang`, hiding `seed` / `limit` / `offset`, replacing the latitude+longitude+timezone trio with a city search) is a separate render-time concern layered on top by the form, never encoded here.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\nimport { humanize } from './string.js';\n\n/** A JSON `$ref` node, before resolution against `components.schemas`. */\nexport interface OpenApiSchemaRef {\n\t$ref?: string;\n}\n\n/** The subset of an OpenAPI 3 schema object the form reads. */\nexport interface OpenApiSchema extends OpenApiSchemaRef {\n\t/** A plain name in 3.0, or an ARRAY in 3.1 where nullability is spelled `['number', 'null']`. Read it through {@link scalarType}, never compare it directly. */\n\ttype?: string | string[];\n\tformat?: string;\n\tdescription?: string;\n\tenum?: string[];\n\tdefault?: unknown;\n\tminimum?: number;\n\tmaximum?: number;\n\tproperties?: Record<string, OpenApiSchema>;\n\trequired?: string[];\n\titems?: OpenApiSchema;\n\texample?: unknown;\n\tanyOf?: OpenApiSchema[];\n\toneOf?: OpenApiSchema[];\n}\n\n/** One operation's request shape, as read from `spec.paths[path][method]`. */\nexport interface OperationSchema {\n\tsummary?: string;\n\trequestBody?: {\n\t\tcontent?: Record<string, { schema?: OpenApiSchema | OpenApiSchemaRef }>;\n\t};\n\tparameters?: Array<{\n\t\tname: string;\n\t\tin: string;\n\t\trequired?: boolean;\n\t\tschema?: OpenApiSchema;\n\t}>;\n}\n\n/** The minimal OpenAPI document surface the form introspects. */\nexport interface OpenApiDoc {\n\tpaths?: Record<string, Record<string, unknown>>;\n\tcomponents?: { schemas?: Record<string, OpenApiSchema> };\n}\n\n/** The fully typed spec document the build-time scripts read from the committed `specs/openapi.json`: every path item value is an {@link OperationSchema}. The runtime form keeps the looser {@link OpenApiDoc} because a live spec fetch is untrusted input it narrows per operation. */\nexport interface SpecDoc {\n\tpaths: Record<string, Record<string, OperationSchema>>;\n\tcomponents?: { schemas?: Record<string, OpenApiSchema> };\n}\n\n/**\n * The widget kind a parameter resolves to. This is the closed set the taxonomy gate enforces: every request parameter in the spec MUST classify to one of these, or {@link classifyInput} returns `null` and the gate fails, forcing a conscious decision when the API grows a new shape.\n */\nexport type InputKind =\n\t| 'tiles'\n\t| 'select'\n\t| 'toggle'\n\t| 'date'\n\t| 'time'\n\t| 'datetime'\n\t| 'number'\n\t| 'text'\n\t| 'array';\n\n/** A single input the form renders, digested from one schema property or parameter. */\nexport interface FieldDef {\n\t/** Unique storage + input key: the property name, or \"group.name\" for a nested object field. */\n\tkey: string;\n\t/** Schema property name (the label source), e.g. \"date\". */\n\tname: string;\n\t/** Parent object key for a nested schema (person1/person2); undefined for a flat field. */\n\tgroup?: string;\n\t/** True when the spec declares the field as `in: query`, so it belongs in the query string even on a POST. */\n\tinQuery?: boolean;\n\t/** The resolved widget kind. */\n\tkind: InputKind;\n\trequired: boolean;\n\tdescription?: string;\n\tenum?: string[];\n\tmin?: number;\n\tmax?: number;\n\tdefault?: unknown;\n\t/** Spec `example`, used as the placeholder for a text input. */\n\texample?: unknown;\n}\n\n/** The digested form model for one operation. The build-time slice is exactly this shape. */\nexport interface FormModel {\n\t/** Concise heading derived from the operation summary, falling back to the path. */\n\ttitle: string;\n\t/** Every rendered field. The `lang` query parameter is intentionally excluded (routed via the element `lang` attribute instead). */\n\tfields: FieldDef[];\n\t/** True when the operation carries a `lang` query parameter, so the form knows to route an effective language to the query string on submit. */\n\thasLang: boolean;\n}\n\n/** At most this many enum options render as a tile/chip picker; above it a filterable select is used instead. */\nexport const TILE_MAX = 12;\n\n/** The latitude+longitude+timezone trio the form suppresses in favour of a city search. Centralised so the render path and tests agree. */\nexport const LOCATION_TRIO = ['latitude', 'longitude', 'timezone'] as const;\n\n/**\n * The coordinate pair that DEFINES a location group. `timezone` is deliberately absent.\n *\n * @remarks\n * A group qualifies for a city search on latitude+longitude alone, because a timezone is not always\n * part of the group that owns the coordinates: `generateRelocationChart` carries two coordinate\n * pairs and exactly ONE top-level `timezone`, which is the BIRTH timezone (relocating does not move\n * the birth moment), so the relocation pair correctly has no timezone of its own. Requiring all\n * three would leave that operation rendering raw number inputs, which is the bug this exists to\n * prevent.\n */\nexport const LOCATION_PAIR = ['latitude', 'longitude'] as const;\n\n/**\n * Split a flat coordinate property into its group prefix and canonical leaf name, or `null` when the\n * name is not a prefixed coordinate.\n *\n * @remarks\n * **Two shapes carry two locations in one request and this handles the second one.** Most\n * multi-location operations nest per person (`person1`/`person2`, `personA`/`personB`), so object\n * nesting alone already groups them. `generateRelocationChart` is the only operation in the spec\n * that instead puts both pairs at the TOP level and distinguishes them by a name prefix\n * (`birthLatitude` / `relocationLatitude`). Keying the grouping off the prefix as well as off the\n * nesting means both shapes converge on the same group machinery, and a future `partnerLatitude`\n * needs no code change.\n *\n * Matching is deliberately restricted to the coordinate pair. A prefix is NOT harvested from any\n * other field name, so `birthDate` stays an ordinary field in the flat group and does not invent a\n * phantom `birth` group with a lone date in it.\n */\nexport function splitCoordinateName(\n\tname: string,\n): { group: string; leaf: (typeof LOCATION_PAIR)[number] } | null {\n\tconst m = name.match(/^(.+?)(Latitude|Longitude)$/);\n\tif (!m) return null;\n\treturn {\n\t\tgroup: m[1],\n\t\tleaf: m[2].toLowerCase() as (typeof LOCATION_PAIR)[number],\n\t};\n}\n\n/** Canonical lowercase zodiac set, derived from {@link SIGNS_ORDER} so sign detection and the glyph map can never disagree. */\nconst ZODIAC_LOWER = SIGNS_ORDER.map((s) => s.toLowerCase());\n\n/** Resolve a `$ref` (one hop is all the spec uses) against the schema map; pass non-refs through. */\nexport function resolveSchema(\n\tschema: OpenApiSchema | OpenApiSchemaRef | undefined,\n\tall: Record<string, OpenApiSchema>,\n): OpenApiSchema | undefined {\n\tif (!schema) return undefined;\n\tif ('$ref' in schema && schema.$ref) {\n\t\tconst name = schema.$ref.split('/').pop();\n\t\treturn name ? all[name] : undefined;\n\t}\n\treturn schema as OpenApiSchema;\n}\n\n/**\n * Collapse an `anyOf`/`oneOf` union to the single member that decides the widget: an enum member wins (so `houseSystem` as enum-or-string renders as a picker), then any concrete-typed member (so timezone as number-or-string resolves to a real kind), else the first member. Non-union schemas pass through untouched.\n */\nfunction representative(s: OpenApiSchema): OpenApiSchema {\n\tconst union = s.anyOf ?? s.oneOf;\n\tif (!union || union.length === 0) return s;\n\treturn (\n\t\tunion.find((m) => Array.isArray(m.enum)) ??\n\t\tunion.find((m) => scalarType(m) && scalarType(m) !== 'null') ??\n\t\tunion[0] ??\n\t\ts\n\t);\n}\n\n/**\n * Map one resolved schema to its {@link InputKind}, or `null` when the shape is genuinely unhandled. The form treats `null` as a plain text fallback (never crashes); the taxonomy gate treats it as a failure (forces a decision). Object schemas are never passed here: an object with `properties` expands into a group of leaf fields upstream, so it has no leaf kind of its own.\n */\n/**\n * The single scalar type name a schema resolves to, across both OpenAPI spellings.\n *\n * @remarks\n * OpenAPI 3.1 expresses a nullable scalar as `type: ['number', 'null']` where 3.0 wrote `type: 'number', nullable: true`. Every direct `type === 'number'` comparison silently stops matching the day the served document switches, and the field then classifies as UNHANDLED rather than as a number, which is how a whole form degrades to text boxes without one test noticing. The `null` member carries no input information, so the remaining single member IS the type.\n */\nexport function scalarType(s: OpenApiSchema): string | undefined {\n\tif (typeof s.type === 'string') return s.type;\n\tif (!Array.isArray(s.type)) return undefined;\n\tconst real = s.type.filter((t) => t !== 'null');\n\treturn real.length === 1 ? real[0] : undefined;\n}\n\nexport function classifyInput(schema: OpenApiSchema): InputKind | null {\n\tconst s = representative(schema);\n\tconst type = scalarType(s);\n\tif (Array.isArray(s.enum))\n\t\treturn s.enum.length <= TILE_MAX ? 'tiles' : 'select';\n\tif (type === 'boolean') return 'toggle';\n\tif (s.format === 'date') return 'date';\n\tif (s.format === 'time') return 'time';\n\tif (s.format === 'date-time') return 'datetime';\n\tif (type === 'integer' || type === 'number') return 'number';\n\tif (type === 'string') return 'text';\n\tif (type === 'array') return 'array';\n\treturn null;\n}\n\n/** True when an enum's values are exactly the twelve zodiac signs (case-insensitive), so the tiles can carry sign glyphs. */\nexport function isZodiacEnum(values: readonly string[]): boolean {\n\tif (values.length !== 12) return false;\n\tconst lower = new Set(values.map((v) => v.toLowerCase()));\n\treturn ZODIAC_LOWER.every((s) => lower.has(s));\n}\n\n/** One digested leaf field from a resolved schema. Shared by the flat and grouped construction paths so params and body props carry identical metadata (min/max included). */\nfunction toField(\n\tname: string,\n\tresolved: OpenApiSchema,\n\topts: { key: string; group?: string; required: boolean; inQuery?: boolean },\n): FieldDef {\n\tconst rep = representative(resolved);\n\treturn {\n\t\tkey: opts.key,\n\t\tname,\n\t\tgroup: opts.group,\n\t\tinQuery: opts.inQuery,\n\t\tkind: classifyInput(resolved) ?? 'text',\n\t\trequired: opts.required,\n\t\tdescription: rep.description ?? resolved.description,\n\t\tenum: rep.enum,\n\t\tmin: rep.minimum,\n\t\tmax: rep.maximum,\n\t\tdefault: resolved.default ?? rep.default,\n\t\texample: resolved.example ?? rep.example,\n\t};\n}\n\n/**\n * Digest one operation into the {@link FormModel} the form renders. This is the single construction path: body properties (nested objects expand to `group.sub` keys) and path+query parameters flow through {@link toField} identically, so a query integer keeps its min/max the same as a body integer. The `lang` query parameter is dropped from `fields` and surfaced as {@link FormModel.hasLang} instead.\n */\nexport function buildFormModel(\n\top: OperationSchema,\n\tschemas: Record<string, OpenApiSchema>,\n\tendpoint: string,\n): FormModel {\n\tconst fields: FieldDef[] = [];\n\tlet hasLang = false;\n\n\tconst bodyRef = op.requestBody?.content?.['application/json']?.schema;\n\tconst bodySchema = resolveSchema(bodyRef, schemas);\n\tif (bodySchema?.properties) {\n\t\tconst required = new Set(bodySchema.required ?? []);\n\t\tfor (const [name, sub] of Object.entries(bodySchema.properties)) {\n\t\t\tconst resolved = resolveSchema(sub, schemas) ?? {};\n\t\t\tif (resolved.type === 'object' && resolved.properties) {\n\t\t\t\tconst subRequired = new Set(resolved.required ?? []);\n\t\t\t\tfor (const [subName, subSchema] of Object.entries(\n\t\t\t\t\tresolved.properties,\n\t\t\t\t)) {\n\t\t\t\t\tconst r = resolveSchema(subSchema, schemas) ?? {};\n\t\t\t\t\tfields.push(\n\t\t\t\t\t\ttoField(subName, r, {\n\t\t\t\t\t\t\tkey: `${name}.${subName}`,\n\t\t\t\t\t\t\tgroup: name,\n\t\t\t\t\t\t\trequired: required.has(name) && subRequired.has(subName),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// A prefixed coordinate joins a group named after its prefix and reports the\n\t\t\t\t// canonical leaf name, so the trio logic and the city search match it unchanged.\n\t\t\t\t// `key` stays the ORIGINAL property name because it is the storage and wire\n\t\t\t\t// identity: rewriting it to `birth.latitude` would serialise a body the API\n\t\t\t\t// rejects.\n\t\t\t\tconst coord = splitCoordinateName(name);\n\t\t\t\tfields.push(\n\t\t\t\t\tcoord\n\t\t\t\t\t\t? toField(coord.leaf, resolved, {\n\t\t\t\t\t\t\t\tkey: name,\n\t\t\t\t\t\t\t\tgroup: coord.group,\n\t\t\t\t\t\t\t\trequired: required.has(name),\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: toField(name, resolved, {\n\t\t\t\t\t\t\t\tkey: name,\n\t\t\t\t\t\t\t\trequired: required.has(name),\n\t\t\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const param of op.parameters ?? []) {\n\t\tif (param.in !== 'path' && param.in !== 'query') continue;\n\t\t// lang is site-owner chrome, not a visitor field: route it through the\n\t\t// element `lang` attribute, never render it in the form.\n\t\tif (param.name === 'lang' && param.in === 'query') {\n\t\t\thasLang = true;\n\t\t\tcontinue;\n\t\t}\n\t\tconst resolved = resolveSchema(param.schema, schemas) ?? {};\n\t\tfields.push(\n\t\t\ttoField(param.name, resolved, {\n\t\t\t\tkey: param.name,\n\t\t\t\trequired: !!param.required,\n\t\t\t\tinQuery: param.in === 'query',\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn { title: deriveTitle(op.summary, endpoint), fields, hasLang };\n}\n\n/**\n * Concise form heading. Prefers the operation summary (spec-authored), taking the clause before the first \" - \" so \"Daily horoscope by zodiac sign - Transit-based forecast\" reads as \"Daily horoscope by zodiac sign\", and falls back to the humanized last path segment.\n */\nexport function deriveTitle(\n\tsummary: string | undefined,\n\tendpoint: string,\n): string {\n\tconst lead = summary?.split(' - ')[0]?.trim();\n\tif (lead) return lead;\n\treturn humanize(endpoint.split('/').pop() ?? '');\n}\n\n/**\n * Outcome-first submit-button label keyed off the endpoint intent. Chart and reading endpoints \"Generate\", divination endpoints \"Cast\", comparison endpoints \"Compare\", and lookup/reading GETs \"Get reading\". A generic verb beats a bare \"Submit\" on a widget a visitor never set up.\n */\nexport function deriveSubmitLabel(endpoint: string): string {\n\tconst e = endpoint.toLowerCase();\n\tif (/compat|synastry|guna|connection|penta|composite/.test(e))\n\t\treturn 'Compare';\n\tif (/\\bcast\\b|\\/draw|iching|hexagram|tarot/.test(e)) return 'Cast';\n\tif (/horoscope|dream|angel|nakshatra|crystal|meaning|reference/.test(e))\n\t\treturn 'Get reading';\n\treturn 'Generate';\n}\n\n/** Deterministic slice filename for one operation, shared by the generator and the runtime loader so both address the same artifact. */\nexport function sliceFileName(method: string, endpoint: string): string {\n\tconst path = endpoint\n\t\t.replace(/^\\//, '')\n\t\t.replace(/[{}]/g, '')\n\t\t.replace(/\\//g, '-');\n\treturn `${method.toLowerCase()}--${path}.json`;\n}\n", "// Generated by scripts/sync-version.ts. Do not edit.\nexport const ROXY_UI_VERSION = '0.22.0';\n"],
|
|
5
|
+
"mappings": "wMAAA,OAAS,OAAAA,EAAK,QAAAC,EAAM,cAAAC,EAAY,WAAAC,MAAe,MAC/C,OAAS,iBAAAC,GAAe,YAAAC,EAAU,SAAAC,MAAa,oBAC/C,OAAS,aAAAC,MAAiB,+BC8CnB,IAAMC,EAAqC,CACjD,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,IAAK,SACL,MAAO,SACP,MAAO,SACP,QAAS,SACT,YAAa,SACb,UAAW,SACX,SAAU,SACV,OAAQ,QACT,EAiBO,IAAMC,EAAc,CAC1B,QACA,SACA,SACA,SACA,MACA,QACA,QACA,UACA,cACA,YACA,WACA,QACD,EC3FA,OAAS,OAAAC,MAAW,MAMb,IAAMC,EAAaD,67FCL1B,OAAS,OAAAE,EAAK,QAAAC,MAAY,MAQnB,SAASC,GAA0B,CACzC,OAAOD,6NACR,CAQO,IAAME,EAAmBH,qYCPzB,SAASI,EAAWC,EAAmB,CAC7C,OAAKA,EACEA,EAAE,OAAO,CAAC,EAAE,YAAY,EAAIA,EAAE,MAAM,CAAC,EAAE,YAAY,EAD3C,EAEhB,CAEO,SAASC,EAASD,EAAmB,CAC3C,OACCA,EACE,QAAQ,SAAU,GAAG,EACrB,QAAQ,kBAAmB,OAAO,EAGlC,QAAQ,kBAAmB,OAAO,EAClC,QAAQ,MAAQE,GAAMA,EAAE,YAAY,CAAC,CAEzC,CC+EO,IAAMC,EAAW,GAGXC,EAAgB,CAAC,WAAY,YAAa,UAAU,EAapDC,EAAgB,CAAC,WAAY,WAAW,EAmB9C,SAASC,EACfC,EACiE,CACjE,IAAMC,EAAID,EAAK,MAAM,6BAA6B,EAClD,OAAKC,EAC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8BAIA4E,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GA1BlB7E,EA2BZ,6BAGQ4E,EAAA,CADPE,EAAM,GA7BK9E,EA8BJ,sBAGA4E,EAAA,CADPE,EAAM,GAhCK9E,EAiCJ,yBAGA4E,EAAA,CADPE,EAAM,GAnCK9E,EAoCJ,uBAGA4E,EAAA,CADPE,EAAM,GAtCK9E,EAuCJ,sBAGA4E,EAAA,CADPE,EAAM,GAzCK9E,EA0CJ,sBAGA4E,EAAA,CADPE,EAAM,GA5CK9E,EA6CJ,yBAGA4E,EAAA,CADPE,EAAM,GA/CK9E,EAgDJ,gCAhDIA,EAAN4E,EAAA,CADNG,GAAc,oBAAoB,GACtB/E",
|
|
6
|
+
"names": ["css", "html", "LitElement", "nothing", "customElement", "property", "state", "ifDefined", "SIGN_GLYPH", "SIGNS_ORDER", "css", "baseStyles", "css", "html", "chevron", "disclosureStyles", "capitalize", "s", "humanize", "c", "TILE_MAX", "LOCATION_TRIO", "LOCATION_PAIR", "splitCoordinateName", "name", "m", "ZODIAC_LOWER", "SIGNS_ORDER", "s", "resolveSchema", "schema", "all", "representative", "union", "scalarType", "real", "t", "classifyInput", "type", "isZodiacEnum", "values", "lower", "v", "toField", "resolved", "opts", "rep", "buildFormModel", "op", "schemas", "endpoint", "fields", "hasLang", "bodyRef", "bodySchema", "required", "sub", "subRequired", "subName", "subSchema", "r", "coord", "param", "deriveTitle", "summary", "lead", "humanize", "deriveSubmitLabel", "e", "sliceFileName", "method", "path", "ROXY_UI_VERSION", "PROD_SPEC_URL", "SLICE_BASE", "ROXY_UI_VERSION", "specCache", "resetSpecCache", "loadSpec", "url", "pending", "res", "err", "randomSeed", "parseArrayValue", "raw", "trimmed", "parsed", "s", "RoxyEndpointForm", "LitElement", "message", "spec", "path", "op", "buildFormModel", "sliceFileName", "model", "init", "f", "remembered", "name", "value", "LOCATION_TRIO", "g", "keys", "group", "inGroup", "LOCATION_PAIR", "n", "own", "req", "only", "deriveSubmitLabel", "e", "detail", "keyOf", "next", "lat", "lon", "tz", "opts", "cur", "root", "missing", "out", "v", "queryKeys", "lang", "labels", "locGroups", "isLocation", "humanize", "html", "nothing", "lead", "chevron", "labelId", "zodiac", "isZodiacEnum", "active", "opt", "i", "selected", "glyph", "SIGN_GLYPH", "capitalize", "id", "checked", "type", "placeholder", "ifDefined", "names", "fields", "flat", "flatReq", "flatOpt", "named", "reqGroups", "optGroups", "hasAdvanced", "kind", "baseStyles", "disclosureStyles", "css", "__decorateClass", "property", "state", "customElement"]
|
|
7
7
|
}
|