aw-wizard-forms 3.1.3 → 4.0.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.
@@ -1,85 +1,670 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WizardForm={})}(this,function(t){"use strict";function e(){if("undefined"==typeof document)return;const t=document.cookie.match(/hubspotutk=([^;]+)/);return t?t[1]:void 0}function r(t){const{portalId:r,formId:s,fieldMapping:i={},mock:o=!1}=t;return{name:"hubspot",mapFields(t){const e={};for(const[r,s]of Object.entries(t))e[i[r]||r]=s;return e},async submit(t,i){if(o)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,formData:t}};const a=`https://api.hsforms.com/submissions/v3/integration/submit/${r}/${s}`,n=this.mapFields(t),l={fields:Object.entries(n).map(([t,e])=>({name:t,value:Array.isArray(e)?e.join(";"):(e??"")+""})),context:{pageUri:i.pageUrl,pageName:i.pageTitle,hutk:e()}};try{const t=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return t.ok?{success:!0,data:await t.json()}:{success:!1,error:(await t.json().catch(()=>({}))).message||"HubSpot submission failed: "+t.status}}catch(d){return{success:!1,error:d instanceof Error?d.message:"Network error"}}}}}function s(t){const{url:e,method:r="POST",headers:s={},fieldMapping:i={},mock:o=!1}=t;return{name:"webhook",mapFields(t){const e={};for(const[r,s]of Object.entries(t))e[i[r]||r]=s;return e},async submit(t,i){if(o)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,formData:t}};if(!e)return{success:!1,error:"Webhook URL is required"};const a={formData:this.mapFields(t),context:{pageUrl:i.pageUrl,pageTitle:i.pageTitle,referrer:i.referrer,submittedAt:i.timestamp}};try{const t=await fetch(e,{method:r,headers:{"Content-Type":"application/json",...s},body:JSON.stringify(a)});if(!t.ok){const e=await t.text().catch(()=>"");return{success:!1,error:`Webhook failed: ${t.status} ${e}`.trim()}}let i;try{i=await t.json()}catch{i={status:t.status}}return{success:!0,data:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Network error"}}}}}function i(){return"undefined"!=typeof window&&void 0!==window.RevenueHero}function o(t){const{routerId:e,fieldMapping:r={},mock:s=!1}=t;return{name:"revenuehero",mapFields(t){const e={};for(const[s,i]of Object.entries(t))e[r[s]||s]=i;return e},async submit(t,r){if(s)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,scheduled:!0}};if(!e)return{success:!1,error:"RevenueHero router ID is required"};if(!i())return{success:!1,error:"RevenueHero SDK not loaded. Please load the SDK in your page."};const o=this.mapFields(t),a=(o.email||o.workEmail||"")+"";if(!a)return{success:!1,error:"Email is required for RevenueHero scheduling"};try{return window.RevenueHero.schedule({routerId:e,email:a,...o}),{success:!0,data:{scheduled:!0,email:a}}}catch(n){return{success:!1,error:n instanceof Error?n.message:"RevenueHero error"}}}}}const a=globalThis,n=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,l=Symbol(),d=new WeakMap;let h=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==l)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=d.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&d.set(e,t))}return t}toString(){return this.cssText}};const c=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new h("string"==typeof t?t:t+"",void 0,l))(e)})(t):t,{is:p,defineProperty:u,getOwnPropertyDescriptor:f,getOwnPropertyNames:m,getOwnPropertySymbols:w,getPrototypeOf:g}=Object,b=globalThis,_=b.trustedTypes,v=_?_.emptyScript:"",y=b.reactiveElementPolyfillSupport,x=(t,e)=>t,S={toAttribute(t,e){switch(e){case Boolean:t=t?v:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(s){r=null}}return r}},$=(t,e)=>!p(t,e),E={attribute:!0,type:String,converter:S,reflect:!1,useDefault:!1,hasChanged:$};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),b.litPropertyMetadata??(b.litPropertyMetadata=new WeakMap);let k=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=E){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(t,r,e);void 0!==s&&u(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){const{get:s,set:i}=f(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const o=s?.call(this);i?.call(this,e),this.requestUpdate(t,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??E}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const t=this.properties,e=[...m(t),...w(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const t=this._$Eu(e,r);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(c(t))}else void 0!==t&&e.push(c(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(n)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const r of e){const e=document.createElement("style"),s=a.litNonce;void 0!==s&&e.setAttribute("nonce",s),e.textContent=r.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(void 0!==s&&!0===r.reflect){const i=(void 0!==r.converter?.toAttribute?r.converter:S).toAttribute(e,r.type);this._$Em=t,null==i?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(t,e){const r=this.constructor,s=r._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=r.getPropertyOptions(s),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:S;this._$Em=s;const o=i.fromAttribute(e,t.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(t,e,r,s=!1,i){if(void 0!==t){const o=this.constructor;if(!1===s&&(i=this[t]),r??(r=o.getPropertyOptions(t)),!((r.hasChanged??$)(i,e)||r.useDefault&&r.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:s,wrapped:i},o){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==i||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===s&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,r,s)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[x("elementProperties")]=new Map,k[x("finalized")]=new Map,y?.({ReactiveElement:k}),(b.reactiveElementVersions??(b.reactiveElementVersions=[])).push("2.1.2");const A=globalThis,C=t=>t,z=A.trustedTypes,O=z?z.createPolicy("lit-html",{createHTML:t=>t}):void 0,W="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,T="?"+P,D=`<${T}>`,M=document,F=()=>M.createComment(""),L=t=>null===t||"object"!=typeof t&&"function"!=typeof t,N=Array.isArray,I="[ \t\n\f\r]",q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,R=/>/g,V=RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,U=/"/g,B=/^(?:script|style|textarea|title)$/i,Y=(t,...e)=>({_$litType$:1,strings:t,values:e}),K=Symbol.for("lit-noChange"),X=Symbol.for("lit-nothing"),J=new WeakMap,G=M.createTreeWalker(M,129);function Z(t,e){if(!N(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==O?O.createHTML(e):e}class Q{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let i=0,o=0;const a=t.length-1,n=this.parts,[l,d]=((t,e)=>{const r=t.length-1,s=[];let i,o=2===e?"<svg>":3===e?"<math>":"",a=q;for(let n=0;n<r;n++){const e=t[n];let r,l,d=-1,h=0;for(;h<e.length&&(a.lastIndex=h,l=a.exec(e),null!==l);)h=a.lastIndex,a===q?"!--"===l[1]?a=j:void 0!==l[1]?a=R:void 0!==l[2]?(B.test(l[2])&&(i=RegExp("</"+l[2],"g")),a=V):void 0!==l[3]&&(a=V):a===V?">"===l[0]?(a=i??q,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,r=l[1],a=void 0===l[3]?V:'"'===l[3]?U:H):a===U||a===H?a=V:a===j||a===R?a=q:(a=V,i=void 0);const c=a===V&&t[n+1].startsWith("/>")?" ":"";o+=a===q?e+D:d>=0?(s.push(r),e.slice(0,d)+W+e.slice(d)+P+c):e+P+(-2===d?n:c)}return[Z(t,o+(t[r]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]})(t,e);if(this.el=Q.createElement(l,r),G.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=G.nextNode())&&n.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(W)){const e=d[o++],r=s.getAttribute(t).split(P),a=/([.?@])?(.*)/.exec(e);n.push({type:1,index:i,name:a[2],strings:r,ctor:"."===a[1]?it:"?"===a[1]?ot:"@"===a[1]?at:st}),s.removeAttribute(t)}else t.startsWith(P)&&(n.push({type:6,index:i}),s.removeAttribute(t));if(B.test(s.tagName)){const t=s.textContent.split(P),e=t.length-1;if(e>0){s.textContent=z?z.emptyScript:"";for(let r=0;r<e;r++)s.append(t[r],F()),G.nextNode(),n.push({type:2,index:++i});s.append(t[e],F())}}}else if(8===s.nodeType)if(s.data===T)n.push({type:2,index:i});else{let t=-1;for(;-1!==(t=s.data.indexOf(P,t+1));)n.push({type:7,index:i}),t+=P.length-1}i++}}static createElement(t,e){const r=M.createElement("template");return r.innerHTML=t,r}}function tt(t,e,r=t,s){if(e===K)return e;let i=void 0!==s?r._$Co?.[s]:r._$Cl;const o=L(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,r,s)),void 0!==s?(r._$Co??(r._$Co=[]))[s]=i:r._$Cl=i),void 0!==i&&(e=tt(t,i._$AS(t,e.values),i,s)),e}class et{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,s=(t?.creationScope??M).importNode(e,!0);G.currentNode=s;let i=G.nextNode(),o=0,a=0,n=r[0];for(;void 0!==n;){if(o===n.index){let e;2===n.type?e=new rt(i,i.nextSibling,this,t):1===n.type?e=new n.ctor(i,n.name,n.strings,this,t):6===n.type&&(e=new nt(i,this,t)),this._$AV.push(e),n=r[++a]}o!==n?.index&&(i=G.nextNode(),o++)}return G.currentNode=M,s}p(t){let e=0;for(const r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class rt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,s){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=tt(this,t,e),L(t)?t===X||null==t||""===t?(this._$AH!==X&&this._$AR(),this._$AH=X):t!==this._$AH&&t!==K&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>N(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==X&&L(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:r}=t,s="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=Q.createElement(Z(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new et(s,this),r=t.u(this.options);t.p(e),this.T(r),this._$AH=t}}_$AC(t){let e=J.get(t.strings);return void 0===e&&J.set(t.strings,e=new Q(t)),e}k(t){N(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,s=0;for(const i of t)s===e.length?e.push(r=new rt(this.O(F()),this.O(F()),this,this.options)):r=e[s],r._$AI(i),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=C(t).nextSibling;C(t).remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class st{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,i){this.type=1,this._$AH=X,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=X}_$AI(t,e=this,r,s){const i=this.strings;let o=!1;if(void 0===i)t=tt(this,t,e,0),o=!L(t)||t!==this._$AH&&t!==K,o&&(this._$AH=t);else{const s=t;let a,n;for(t=i[0],a=0;a<i.length-1;a++)n=tt(this,s[r+a],e,a),n===K&&(n=this._$AH[a]),o||(o=!L(n)||n!==this._$AH[a]),n===X?t=X:t!==X&&(t+=(n??"")+i[a+1]),this._$AH[a]=n}o&&!s&&this.j(t)}j(t){t===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class it extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===X?void 0:t}}class ot extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==X)}}class at extends st{constructor(t,e,r,s,i){super(t,e,r,s,i),this.type=5}_$AI(t,e=this){if((t=tt(this,t,e,0)??X)===K)return;const r=this._$AH,s=t===X&&r!==X||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,i=t!==X&&(r===X||s);s&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class nt{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){tt(this,t)}}const lt=A.litHtmlPolyfillSupport;lt?.(Q,rt),(A.litHtmlVersions??(A.litHtmlVersions=[])).push("3.3.2");const dt=globalThis;class ht extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,r)=>{const s=r?.renderBefore??e;let i=s._$litPart$;if(void 0===i){const t=r?.renderBefore??null;s._$litPart$=i=new rt(e.insertBefore(F(),t),t,void 0,r??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}}ht._$litElement$=!0,ht.finalized=!0,dt.litElementHydrateSupport?.({LitElement:ht});const ct=dt.litElementPolyfillSupport;ct?.({LitElement:ht}),(dt.litElementVersions??(dt.litElementVersions=[])).push("4.2.2");const pt=t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},ut={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:$},ft=(t=ut,e,r)=>{const{kind:s,metadata:i}=r;let o=globalThis.litPropertyMetadata.get(i);if(void 0===o&&globalThis.litPropertyMetadata.set(i,o=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),o.set(r.name,t),"accessor"===s){const{name:s}=r;return{set(r){const i=e.get.call(this);e.set.call(this,r),this.requestUpdate(s,i,t,!0,r)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=r;return function(r){const i=this[s];e.call(this,r),this.requestUpdate(s,i,t,!0,r)}}throw Error("Unsupported decorator location: "+s)};function mt(t){return(e,r)=>"object"==typeof r?ft(t,e,r):((t,e,r)=>{const s=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),s?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}function wt(t){return mt({...t,state:!0,attribute:!1})}class gt{constructor(t){this._formData={},this._validation={},this._currentStep=1,this._totalSteps=0,this._submitting=!1,this._submitted=!1,this._stepConfigs=new Map,this._subscribers=new Set,this.host=t,t.addController(this)}hostConnected(){}hostDisconnected(){this._subscribers.clear()}get formData(){return{...this._formData}}get validation(){return{...this._validation}}get currentStep(){return this._currentStep}get totalSteps(){return this._totalSteps}get submitting(){return this._submitting}get submitted(){return this._submitted}get error(){return this._error}get state(){return{formData:this.formData,validation:this.validation,currentStep:this._currentStep,totalSteps:this._totalSteps,submitting:this._submitting,submitted:this._submitted,error:this._error}}setValue(t,e){this._formData[t]=e,this._validation[t]?this._validation[t]={...this._validation[t],value:e,dirty:!0}:this._validation[t]={name:t,value:e,result:{valid:!0},touched:!1,dirty:!0},this._notifyChange()}getValue(t){return this._formData[t]}setValidation(t,e){const r=this._validation[t];this._validation[t]={name:t,value:r?.value??this._formData[t],result:e,touched:r?.touched??!1,dirty:r?.dirty??!1},this._notifyChange()}markTouched(t){this._validation[t]?this._validation[t]={...this._validation[t],touched:!0}:this._validation[t]={name:t,value:this._formData[t],result:{valid:!0},touched:!0,dirty:!1},this._notifyChange()}setTotalSteps(t){this._totalSteps=t,this._notifyChange()}setStepConfig(t,e){this._stepConfigs.set(t,e)}getStepConfig(t){return this._stepConfigs.get(t)}getStepFields(t){return this._stepConfigs.get(t)?.fields??[]}goToStep(t){if(t<1||t>this._totalSteps)return!1;const e=this._stepConfigs.get(t);return e?.skipIf?.(this._formData)?t>this._currentStep?this.goToStep(t+1):this.goToStep(t-1):(this._currentStep=t,this._notifyChange(),!0)}nextStep(){return this.goToStep(this._currentStep+1)}previousStep(){return this.goToStep(this._currentStep-1)}isFirstStep(){return 1===this._currentStep}isLastStep(){return this._currentStep===this._totalSteps}isStepValid(t){return this.getStepFields(t).every(t=>{const e=this._validation[t];return!e||e.result.valid})}isCurrentStepValid(){return this.isStepValid(this._currentStep)}getFieldError(t){const e=this._validation[t];if(e?.touched&&!e.result.valid)return e.result.error}hasFieldError(t){return void 0!==this.getFieldError(t)}setSubmitting(t){this._submitting=t,this._notifyChange()}setSubmitted(t){this._submitted=t,this._notifyChange()}setError(t){this._error=t,this._notifyChange()}reset(){this._formData={},this._validation={},this._currentStep=1,this._submitting=!1,this._submitted=!1,this._error=void 0,this._notifyChange()}subscribe(t){return this._subscribers.add(t),()=>{this._subscribers.delete(t)}}_notifyChange(){this.host.requestUpdate();const t=this.state;this._subscribers.forEach(e=>{try{e(t)}catch(r){}})}}class bt{constructor(t,e={}){this._enabled=!0,this.host=t,this._config={blockEnterOnTextarea:!0,...e},this._boundHandler=this._handleKeydown.bind(this),t.addController(this)}hostConnected(){this.host.addEventListener("keydown",this._boundHandler),document.addEventListener("keydown",this._boundHandler)}hostDisconnected(){this.host.removeEventListener("keydown",this._boundHandler),document.removeEventListener("keydown",this._boundHandler)}_handleKeydown(t){if(!this._enabled)return;const e=this._getActiveElement(),r="TEXTAREA"===e?.tagName,s="INPUT"===e?.tagName,i="true"===e?.getAttribute("contenteditable"),o=r||s||i;switch(t.key){case"Enter":if(r&&this._config.blockEnterOnTextarea)return;this._config.onEnter&&(t.preventDefault(),this._config.onEnter());break;case"Escape":this._config.onEscape&&(t.preventDefault(),this._config.onEscape());break;case"ArrowUp":!o&&this._config.onArrowUp&&(t.preventDefault(),this._config.onArrowUp());break;case"ArrowDown":!o&&this._config.onArrowDown&&(t.preventDefault(),this._config.onArrowDown());break;case"ArrowLeft":!o&&this._config.onArrowLeft&&(t.preventDefault(),this._config.onArrowLeft());break;case"ArrowRight":!o&&this._config.onArrowRight&&(t.preventDefault(),this._config.onArrowRight())}}_getActiveElement(){let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}updateConfig(t){this._config={...this._config,...t}}enable(){this._enabled=!0}disable(){this._enabled=!1}get enabled(){return this._enabled}}var _t=Object.defineProperty,vt=Object.getOwnPropertyDescriptor,yt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?vt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&_t(e,r,o),o};t.WfBadge=class extends ht{constructor(){super(...arguments),this.shortcut="",this.variant="default"}createRenderRoot(){return this}render(){return Y`
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WizardForm={})}(this,function(t){"use strict";function e(){if("undefined"==typeof document)return;const t=document.cookie.match(/hubspotutk=([^;]+)/);return t?t[1]:void 0}function s(t){const{portalId:s,formId:r,fieldMapping:i={},mock:o=!1}=t;return{name:"hubspot",mapFields(t){const e={};for(const[s,r]of Object.entries(t))e[i[s]||s]=r;return e},async submit(t,i){if(o)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,formData:t}};const a=`https://api.hsforms.com/submissions/v3/integration/submit/${s}/${r}`,n=this.mapFields(t),l={fields:Object.entries(n).map(([t,e])=>({name:t,value:Array.isArray(e)?e.join(";"):(e??"")+""})),context:{pageUri:i.pageUrl,pageName:i.pageTitle,hutk:e()}};try{const t=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return t.ok?{success:!0,data:await t.json()}:{success:!1,error:(await t.json().catch(()=>({}))).message||"HubSpot submission failed: "+t.status}}catch(d){return{success:!1,error:d instanceof Error?d.message:"Network error"}}}}}function r(t){const{url:e,method:s="POST",headers:r={},fieldMapping:i={},mock:o=!1}=t;return{name:"webhook",mapFields(t){const e={};for(const[s,r]of Object.entries(t))e[i[s]||s]=r;return e},async submit(t,i){if(o)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,formData:t}};if(!e)return{success:!1,error:"Webhook URL is required"};const a={formData:this.mapFields(t),context:{pageUrl:i.pageUrl,pageTitle:i.pageTitle,referrer:i.referrer,submittedAt:i.timestamp}};try{const t=await fetch(e,{method:s,headers:{"Content-Type":"application/json",...r},body:JSON.stringify(a)});if(!t.ok){const e=await t.text().catch(()=>"");return{success:!1,error:`Webhook failed: ${t.status} ${e}`.trim()}}let i;try{i=await t.json()}catch{i={status:t.status}}return{success:!0,data:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Network error"}}}}}function i(){return"undefined"!=typeof window&&void 0!==window.RevenueHero}function o(t){const{routerId:e,fieldMapping:s={},mock:r=!1}=t;return{name:"revenuehero",mapFields(t){const e={};for(const[r,i]of Object.entries(t))e[s[r]||r]=i;return e},async submit(t,s){if(r)return await new Promise(t=>setTimeout(t,500)),{success:!0,data:{mock:!0,scheduled:!0}};if(!e)return{success:!1,error:"RevenueHero router ID is required"};if(!i())return{success:!1,error:"RevenueHero SDK not loaded. Please load the SDK in your page."};const o=this.mapFields(t),a=(o.email||o.workEmail||"")+"";if(!a)return{success:!1,error:"Email is required for RevenueHero scheduling"};try{return window.RevenueHero.schedule({routerId:e,email:a,...o}),{success:!0,data:{scheduled:!0,email:a}}}catch(n){return{success:!1,error:n instanceof Error?n.message:"RevenueHero error"}}}}}const a=globalThis,n=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,l=Symbol(),d=new WeakMap;let h=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==l)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=d.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&d.set(e,t))}return t}toString(){return this.cssText}};const c=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[r+1],t[0]);return new h(s,t,l)},p=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new h("string"==typeof t?t:t+"",void 0,l))(e)})(t):t,{is:u,defineProperty:f,getOwnPropertyDescriptor:m,getOwnPropertyNames:g,getOwnPropertySymbols:b,getPrototypeOf:w}=Object,_=globalThis,v=_.trustedTypes,y=v?v.emptyScript:"",S=_.reactiveElementPolyfillSupport,x=(t,e)=>t,$={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(r){s=null}}return s}},E=(t,e)=>!u(t,e),k={attribute:!0,type:String,converter:$,reflect:!1,useDefault:!1,hasChanged:E};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);let A=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=k){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);void 0!==r&&f(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:i}=m(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const o=r?.call(this);i?.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??k}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=w(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const t=this.properties,e=[...g(t),...b(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const t=this._$Eu(e,s);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(p(t))}else void 0!==t&&e.push(p(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(n)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),r=a.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(void 0!==r&&!0===s.reflect){const i=(void 0!==s.converter?.toAttribute?s.converter:$).toAttribute(e,s.type);this._$Em=t,null==i?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(t,e){const s=this.constructor,r=s._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=s.getPropertyOptions(r),i="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:$;this._$Em=r;const o=i.fromAttribute(e,t.type);this[r]=o??this._$Ej?.get(r)??o,this._$Em=null}}requestUpdate(t,e,s,r=!1,i){if(void 0!==t){const o=this.constructor;if(!1===r&&(i=this[t]),s??(s=o.getPropertyOptions(t)),!((s.hasChanged??E)(i,e)||s.useDefault&&s.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:r,wrapped:i},o){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==i||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===r&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,r=this[e];!0!==t||this._$AL.has(e)||void 0===r||this.C(e,void 0,s,r)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[x("elementProperties")]=new Map,A[x("finalized")]=new Map,S?.({ReactiveElement:A}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.1.2");const C=globalThis,O=t=>t,W=C.trustedTypes,z=W?W.createPolicy("lit-html",{createHTML:t=>t}):void 0,P="$lit$",N=`lit$${Math.random().toFixed(9).slice(2)}$`,L="?"+N,T=`<${L}>`,D=document,F=()=>D.createComment(""),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,B=Array.isArray,I="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,q=/-->/g,H=/>/g,U=RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),V=/'/g,R=/"/g,Y=/^(?:script|style|textarea|title)$/i,K=(t,...e)=>({_$litType$:1,strings:t,values:e}),X=Symbol.for("lit-noChange"),J=Symbol.for("lit-nothing"),G=new WeakMap,Z=D.createTreeWalker(D,129);function Q(t,e){if(!B(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==z?z.createHTML(e):e}class tt{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let i=0,o=0;const a=t.length-1,n=this.parts,[l,d]=((t,e)=>{const s=t.length-1,r=[];let i,o=2===e?"<svg>":3===e?"<math>":"",a=j;for(let n=0;n<s;n++){const e=t[n];let s,l,d=-1,h=0;for(;h<e.length&&(a.lastIndex=h,l=a.exec(e),null!==l);)h=a.lastIndex,a===j?"!--"===l[1]?a=q:void 0!==l[1]?a=H:void 0!==l[2]?(Y.test(l[2])&&(i=RegExp("</"+l[2],"g")),a=U):void 0!==l[3]&&(a=U):a===U?">"===l[0]?(a=i??j,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,s=l[1],a=void 0===l[3]?U:'"'===l[3]?R:V):a===R||a===V?a=U:a===q||a===H?a=j:(a=U,i=void 0);const c=a===U&&t[n+1].startsWith("/>")?" ":"";o+=a===j?e+T:d>=0?(r.push(s),e.slice(0,d)+P+e.slice(d)+N+c):e+N+(-2===d?n:c)}return[Q(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]})(t,e);if(this.el=tt.createElement(l,s),Z.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=Z.nextNode())&&n.length<a;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(P)){const e=d[o++],s=r.getAttribute(t).split(N),a=/([.?@])?(.*)/.exec(e);n.push({type:1,index:i,name:a[2],strings:s,ctor:"."===a[1]?ot:"?"===a[1]?at:"@"===a[1]?nt:it}),r.removeAttribute(t)}else t.startsWith(N)&&(n.push({type:6,index:i}),r.removeAttribute(t));if(Y.test(r.tagName)){const t=r.textContent.split(N),e=t.length-1;if(e>0){r.textContent=W?W.emptyScript:"";for(let s=0;s<e;s++)r.append(t[s],F()),Z.nextNode(),n.push({type:2,index:++i});r.append(t[e],F())}}}else if(8===r.nodeType)if(r.data===L)n.push({type:2,index:i});else{let t=-1;for(;-1!==(t=r.data.indexOf(N,t+1));)n.push({type:7,index:i}),t+=N.length-1}i++}}static createElement(t,e){const s=D.createElement("template");return s.innerHTML=t,s}}function et(t,e,s=t,r){if(e===X)return e;let i=void 0!==r?s._$Co?.[r]:s._$Cl;const o=M(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,s,r)),void 0!==r?(s._$Co??(s._$Co=[]))[r]=i:s._$Cl=i),void 0!==i&&(e=et(t,i._$AS(t,e.values),i,r)),e}class st{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,r=(t?.creationScope??D).importNode(e,!0);Z.currentNode=r;let i=Z.nextNode(),o=0,a=0,n=s[0];for(;void 0!==n;){if(o===n.index){let e;2===n.type?e=new rt(i,i.nextSibling,this,t):1===n.type?e=new n.ctor(i,n.name,n.strings,this,t):6===n.type&&(e=new lt(i,this,t)),this._$AV.push(e),n=s[++a]}o!==n?.index&&(i=Z.nextNode(),o++)}return Z.currentNode=D,r}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class rt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,r){this.type=2,this._$AH=J,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=et(this,t,e),M(t)?t===J||null==t||""===t?(this._$AH!==J&&this._$AR(),this._$AH=J):t!==this._$AH&&t!==X&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>B(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==J&&M(this._$AH)?this._$AA.nextSibling.data=t:this.T(D.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,r="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=tt.createElement(Q(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new st(r,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new tt(t)),e}k(t){B(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,r=0;for(const i of t)r===e.length?e.push(s=new rt(this.O(F()),this.O(F()),this,this.options)):s=e[r],s._$AI(i),r++;r<e.length&&(this._$AR(s&&s._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=O(t).nextSibling;O(t).remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class it{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,r,i){this.type=1,this._$AH=J,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=J}_$AI(t,e=this,s,r){const i=this.strings;let o=!1;if(void 0===i)t=et(this,t,e,0),o=!M(t)||t!==this._$AH&&t!==X,o&&(this._$AH=t);else{const r=t;let a,n;for(t=i[0],a=0;a<i.length-1;a++)n=et(this,r[s+a],e,a),n===X&&(n=this._$AH[a]),o||(o=!M(n)||n!==this._$AH[a]),n===J?t=J:t!==J&&(t+=(n??"")+i[a+1]),this._$AH[a]=n}o&&!r&&this.j(t)}j(t){t===J?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class ot extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===J?void 0:t}}class at extends it{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==J)}}class nt extends it{constructor(t,e,s,r,i){super(t,e,s,r,i),this.type=5}_$AI(t,e=this){if((t=et(this,t,e,0)??J)===X)return;const s=this._$AH,r=t===J&&s!==J||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==J&&(s===J||r);r&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class lt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){et(this,t)}}const dt=C.litHtmlPolyfillSupport;dt?.(tt,rt),(C.litHtmlVersions??(C.litHtmlVersions=[])).push("3.3.2");const ht=globalThis;class ct extends A{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const r=s?.renderBefore??e;let i=r._$litPart$;if(void 0===i){const t=s?.renderBefore??null;r._$litPart$=i=new rt(e.insertBefore(F(),t),t,void 0,s??{})}return i._$AI(t),i})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return X}}ct._$litElement$=!0,ct.finalized=!0,ht.litElementHydrateSupport?.({LitElement:ct});const pt=ht.litElementPolyfillSupport;pt?.({LitElement:ct}),(ht.litElementVersions??(ht.litElementVersions=[])).push("4.2.2");const ut=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},ft={attribute:!0,type:String,converter:$,reflect:!1,hasChanged:E},mt=(t=ft,e,s)=>{const{kind:r,metadata:i}=s;let o=globalThis.litPropertyMetadata.get(i);if(void 0===o&&globalThis.litPropertyMetadata.set(i,o=new Map),"setter"===r&&((t=Object.create(t)).wrapped=!0),o.set(s.name,t),"accessor"===r){const{name:r}=s;return{set(s){const i=e.get.call(this);e.set.call(this,s),this.requestUpdate(r,i,t,!0,s)},init(e){return void 0!==e&&this.C(r,void 0,t,e),e}}}if("setter"===r){const{name:r}=s;return function(s){const i=this[r];e.call(this,s),this.requestUpdate(r,i,t,!0,s)}}throw Error("Unsupported decorator location: "+r)};function gt(t){return(e,s)=>"object"==typeof s?mt(t,e,s):((t,e,s)=>{const r=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),r?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}function bt(t){return gt({...t,state:!0,attribute:!1})}function wt(t,e){return(e,s,r)=>((t,e,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,s),s))(e,s,{get(){return e=this,e.renderRoot?.querySelector(t)??null;var e}})}c`
2
+ /* Colors */
3
+ --wf-color-primary: #8040f0;
4
+ --wf-color-primary-border: #602cbb;
5
+ --wf-color-primary-light: rgba(128, 64, 240, 0.08);
6
+ --wf-color-surface: #f3f3f5;
7
+ --wf-color-surface-hover: #e9e9eb;
8
+ --wf-color-border: #d4d4d4;
9
+ --wf-color-text: #0a0a0a;
10
+ --wf-color-text-secondary: #404040;
11
+ --wf-color-text-muted: #646464;
12
+ --wf-color-error: #dc3545;
13
+ --wf-color-badge-bg: #fcfcfc;
14
+ --wf-color-badge-border: #d4d4d4;
15
+ --wf-color-badge-text: #5f5f5f;
16
+ --wf-color-progress-active: rgba(0, 0, 0, 0.1);
17
+ --wf-color-progress-inactive: rgba(0, 0, 0, 0.05);
18
+
19
+ /* Spacing scale */
20
+ --wf-spacing-1: 4px;
21
+ --wf-spacing-2: 8px;
22
+ --wf-spacing-3: 12px;
23
+ --wf-spacing-4: 16px;
24
+ --wf-spacing-5: 20px;
25
+ --wf-spacing-6: 24px;
26
+ --wf-spacing-8: 32px;
27
+
28
+ /* Border radius */
29
+ --wf-radius-sm: 4px;
30
+ --wf-radius-md: 8px;
31
+ --wf-radius-lg: 8px;
32
+ --wf-radius-full: 99px;
33
+
34
+ /* Typography */
35
+ --wf-font-size-xs: 0.75rem;
36
+ --wf-font-size-sm: 0.875rem;
37
+ --wf-font-size-base: 1rem;
38
+ --wf-font-size-lg: 1.25rem;
39
+ --wf-font-size-xl: 1.5rem;
40
+ --wf-font-size-2xl: 2rem;
41
+ --wf-font-size-3xl: 2.5rem;
42
+
43
+ /* Input dimensions */
44
+ --wf-input-min-height: 56px;
45
+
46
+ /* Frosted glass effect (iOS-style) */
47
+ --wf-glass-bg: rgba(255, 255, 255, 0.7);
48
+ --wf-glass-bg-hover: rgba(255, 255, 255, 0.85);
49
+ --wf-glass-border: rgba(0, 0, 0, 0.1);
50
+ --wf-glass-blur: 20px;
51
+ --wf-glass-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
52
+ `,c`
53
+ --wf-color-surface: #2d2d2d;
54
+ --wf-color-surface-hover: #3d3d3d;
55
+ --wf-color-border: #4d4d4d;
56
+ --wf-color-text: #f8f9fa;
57
+ --wf-color-text-secondary: #d0d0d0;
58
+ --wf-color-text-muted: #adb5bd;
59
+ --wf-color-badge-bg: #3d3d3d;
60
+ --wf-color-badge-border: #4d4d4d;
61
+ --wf-color-badge-text: #adb5bd;
62
+ --wf-color-progress-active: rgba(200, 200, 200, 0.6);
63
+ --wf-color-progress-inactive: rgba(100, 100, 100, 0.6);
64
+
65
+ /* Dark theme frosted glass */
66
+ --wf-glass-bg: rgba(45, 45, 45, 0.7);
67
+ --wf-glass-bg-hover: rgba(60, 60, 60, 0.8);
68
+ --wf-glass-border: rgba(255, 255, 255, 0.1);
69
+ `;const _t=c`@keyframes wf-spin{to{transform:rotate(360deg)}}@keyframes wf-blink{0%,to{opacity:1}50%{opacity:.5}}@keyframes wf-stepFadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes wf-stepFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}@keyframes wf-stepSlideInRight{0%{opacity:0;transform:translate(30px)}to{opacity:1;transform:translate(0)}}@keyframes wf-stepSlideInLeft{0%{opacity:0;transform:translate(-30px)}to{opacity:1;transform:translate(0)}}`,vt=c`.wf-btn{justify-content:center;align-items:center;gap:var(--wf-spacing-2,8px);padding:var(--wf-spacing-3,12px)var(--wf-spacing-4,16px);min-height:48px;font-size:var(--wf-font-size-base,1rem);border-radius:var(--wf-radius-md,8px);cursor:pointer;box-sizing:border-box;border:1px solid #0000;outline:none;font-family:inherit;font-weight:600;transition:all .15s;display:inline-flex}.wf-btn:focus-visible{box-shadow:0 0 0 3px #8040f04d}.wf-btn:disabled{opacity:.5;cursor:not-allowed}`;c`.wf-glass{background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d)}.wf-glass:hover{background:var(--wf-glass-bg-hover,#ffffffd9)}`,c`
70
+ ${_t}
71
+
72
+ * {
73
+ box-sizing: border-box;
74
+ }
75
+ `;const yt=[_t,c`
76
+ /* ----------------------------------------
77
+ :host - Design tokens & base styles
78
+ ---------------------------------------- */
79
+ :host {
80
+ display: block;
81
+
82
+ /* Color tokens */
83
+ --wf-color-primary: #8040f0;
84
+ --wf-color-primary-border: #602cbb;
85
+ --wf-color-primary-light: rgba(128, 64, 240, 0.08);
86
+ --wf-color-surface: #f3f3f5;
87
+ --wf-color-surface-hover: #e9e9eb;
88
+ --wf-color-border: #d4d4d4;
89
+ --wf-color-text: #0a0a0a;
90
+ --wf-color-text-secondary: #404040;
91
+ --wf-color-text-muted: #646464;
92
+ --wf-color-error: #dc3545;
93
+ --wf-color-badge-bg: #fcfcfc;
94
+ --wf-color-badge-border: #d4d4d4;
95
+ --wf-color-badge-text: #5f5f5f;
96
+ --wf-color-progress-active: rgba(0, 0, 0, 0.1);
97
+ --wf-color-progress-inactive: rgba(0, 0, 0, 0.05);
98
+
99
+ /* Spacing tokens */
100
+ --wf-spacing-1: 4px;
101
+ --wf-spacing-2: 8px;
102
+ --wf-spacing-3: 12px;
103
+ --wf-spacing-4: 16px;
104
+ --wf-spacing-5: 20px;
105
+ --wf-spacing-6: 24px;
106
+ --wf-spacing-8: 32px;
107
+
108
+ /* Border radius tokens */
109
+ --wf-radius-sm: 4px;
110
+ --wf-radius-md: 8px;
111
+ --wf-radius-lg: 8px;
112
+ --wf-radius-full: 99px;
113
+
114
+ /* Typography tokens */
115
+ --wf-font-size-xs: 0.75rem;
116
+ --wf-font-size-sm: 0.875rem;
117
+ --wf-font-size-base: 1rem;
118
+ --wf-font-size-lg: 1.25rem;
119
+ --wf-font-size-xl: 1.5rem;
120
+ --wf-font-size-2xl: 2rem;
121
+ --wf-font-size-3xl: 2.5rem;
122
+
123
+ /* Input tokens */
124
+ --wf-input-min-height: 56px;
125
+
126
+ /* Frosted glass effect (iOS-style) */
127
+ --wf-glass-bg: rgba(255, 255, 255, 0.7);
128
+ --wf-glass-bg-hover: rgba(255, 255, 255, 0.85);
129
+ --wf-glass-border: rgba(0, 0, 0, 0.1);
130
+ --wf-glass-blur: 20px;
131
+ --wf-glass-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
132
+ }
133
+
134
+ :host([hidden]) {
135
+ display: none;
136
+ }
137
+
138
+ /* Dark theme */
139
+ :host([theme='dark']) {
140
+ --wf-color-surface: #2d2d2d;
141
+ --wf-color-surface-hover: #3d3d3d;
142
+ --wf-color-border: #4d4d4d;
143
+ --wf-color-text: #f8f9fa;
144
+ --wf-color-text-secondary: #d0d0d0;
145
+ --wf-color-text-muted: #adb5bd;
146
+ --wf-color-badge-bg: #3d3d3d;
147
+ --wf-color-badge-border: #4d4d4d;
148
+ --wf-color-badge-text: #adb5bd;
149
+ --wf-color-progress-active: rgba(200, 200, 200, 0.6);
150
+ --wf-color-progress-inactive: rgba(100, 100, 100, 0.6);
151
+
152
+ /* Dark theme frosted glass */
153
+ --wf-glass-bg: rgba(45, 45, 45, 0.7);
154
+ --wf-glass-bg-hover: rgba(60, 60, 60, 0.8);
155
+ --wf-glass-border: rgba(255, 255, 255, 0.1);
156
+ }
157
+
158
+ /* Auto theme (respects system preference) */
159
+ @media (prefers-color-scheme: dark) {
160
+ :host([theme='auto']) {
161
+ --wf-color-surface: #2d2d2d;
162
+ --wf-color-surface-hover: #3d3d3d;
163
+ --wf-color-border: #4d4d4d;
164
+ --wf-color-text: #f8f9fa;
165
+ --wf-color-text-secondary: #d0d0d0;
166
+ --wf-color-text-muted: #adb5bd;
167
+ --wf-color-badge-bg: #3d3d3d;
168
+ --wf-color-badge-border: #4d4d4d;
169
+ --wf-color-badge-text: #adb5bd;
170
+ --wf-color-progress-active: rgba(200, 200, 200, 0.6);
171
+ --wf-color-progress-inactive: rgba(100, 100, 100, 0.6);
172
+
173
+ /* Dark theme frosted glass */
174
+ --wf-glass-bg: rgba(45, 45, 45, 0.7);
175
+ --wf-glass-bg-hover: rgba(60, 60, 60, 0.8);
176
+ --wf-glass-border: rgba(255, 255, 255, 0.1);
177
+ }
178
+ }
179
+
180
+ /* ----------------------------------------
181
+ Container
182
+ ---------------------------------------- */
183
+ .wf-container {
184
+ margin: 0 auto;
185
+ }
186
+
187
+ /* ----------------------------------------
188
+ Success screen
189
+ ---------------------------------------- */
190
+ .wf-success-screen {
191
+ text-align: center;
192
+ padding: var(--wf-spacing-6, 24px);
193
+ }
194
+
195
+ /* ----------------------------------------
196
+ Error message
197
+ ---------------------------------------- */
198
+ .wf-form-error {
199
+ padding: var(--wf-spacing-4, 16px);
200
+ margin-bottom: var(--wf-spacing-4, 16px);
201
+ background-color: rgba(220, 53, 69, 0.1);
202
+ border: 1px solid var(--wf-color-error, #dc3545);
203
+ border-radius: var(--wf-radius-md, 8px);
204
+ color: var(--wf-color-error, #dc3545);
205
+ font-size: var(--wf-font-size-base, 1rem);
206
+ }
207
+
208
+ /* ----------------------------------------
209
+ Slot styles
210
+ ---------------------------------------- */
211
+ ::slotted(wf-step) {
212
+ display: none;
213
+ width: 100%;
214
+ }
215
+
216
+ ::slotted(wf-step[active]) {
217
+ display: block;
218
+ animation: wf-stepFadeIn 0.3s ease forwards;
219
+ }
220
+
221
+ ::slotted(wf-step[direction='forward'][active]) {
222
+ animation: wf-stepSlideInRight 0.3s ease forwards;
223
+ }
224
+
225
+ ::slotted(wf-step[direction='backward'][active]) {
226
+ animation: wf-stepSlideInLeft 0.3s ease forwards;
227
+ }
228
+
229
+ ::slotted(wf-step[leaving]) {
230
+ display: block;
231
+ animation: wf-stepFadeOut 0.2s ease forwards;
232
+ }
233
+
234
+ /* Success slot hidden by default, shown when submitted */
235
+ ::slotted([slot='success']) {
236
+ display: none;
237
+ }
238
+
239
+ :host([submitted]) ::slotted([slot='success']) {
240
+ display: block;
241
+ }
242
+
243
+ :host([submitted]) ::slotted(wf-step) {
244
+ display: none !important;
245
+ }
246
+ `];class St{constructor(t){this._formData={},this._validation={},this._currentStep=1,this._totalSteps=0,this._submitting=!1,this._submitted=!1,this._stepConfigs=new Map,this._subscribers=new Set,this.host=t,t.addController(this)}hostConnected(){}hostDisconnected(){this._subscribers.clear()}get formData(){return{...this._formData}}get validation(){return{...this._validation}}get currentStep(){return this._currentStep}get totalSteps(){return this._totalSteps}get submitting(){return this._submitting}get submitted(){return this._submitted}get error(){return this._error}get state(){return{formData:this.formData,validation:this.validation,currentStep:this._currentStep,totalSteps:this._totalSteps,submitting:this._submitting,submitted:this._submitted,error:this._error}}setValue(t,e){this._formData[t]=e,this._validation[t]?this._validation[t]={...this._validation[t],value:e,dirty:!0}:this._validation[t]={name:t,value:e,result:{valid:!0},touched:!1,dirty:!0},this._notifyChange()}getValue(t){return this._formData[t]}setValidation(t,e){const s=this._validation[t];this._validation[t]={name:t,value:s?.value??this._formData[t],result:e,touched:s?.touched??!1,dirty:s?.dirty??!1},this._notifyChange()}markTouched(t){this._validation[t]?this._validation[t]={...this._validation[t],touched:!0}:this._validation[t]={name:t,value:this._formData[t],result:{valid:!0},touched:!0,dirty:!1},this._notifyChange()}setTotalSteps(t){this._totalSteps=t,this._notifyChange()}setStepConfig(t,e){this._stepConfigs.set(t,e)}getStepConfig(t){return this._stepConfigs.get(t)}getStepFields(t){return this._stepConfigs.get(t)?.fields??[]}goToStep(t){if(t<1||t>this._totalSteps)return!1;const e=this._stepConfigs.get(t);return e?.skipIf?.(this._formData)?t>this._currentStep?this.goToStep(t+1):this.goToStep(t-1):(this._currentStep=t,this._notifyChange(),!0)}nextStep(){return this.goToStep(this._currentStep+1)}previousStep(){return this.goToStep(this._currentStep-1)}isFirstStep(){return 1===this._currentStep}isLastStep(){return this._currentStep===this._totalSteps}isStepValid(t){return this.getStepFields(t).every(t=>{const e=this._validation[t];return!e||e.result.valid})}isCurrentStepValid(){return this.isStepValid(this._currentStep)}getFieldError(t){const e=this._validation[t];if(e?.touched&&!e.result.valid)return e.result.error}hasFieldError(t){return void 0!==this.getFieldError(t)}setSubmitting(t){this._submitting=t,this._notifyChange()}setSubmitted(t){this._submitted=t,this._notifyChange()}setError(t){this._error=t,this._notifyChange()}reset(){this._formData={},this._validation={},this._currentStep=1,this._submitting=!1,this._submitted=!1,this._error=void 0,this._notifyChange()}subscribe(t){return this._subscribers.add(t),()=>{this._subscribers.delete(t)}}_notifyChange(){this.host.requestUpdate();const t=this.state;this._subscribers.forEach(e=>{try{e(t)}catch(s){}})}}class xt{constructor(t,e={}){this._enabled=!0,this.host=t,this._config={blockEnterOnTextarea:!0,...e},this._boundHandler=this._handleKeydown.bind(this),t.addController(this)}hostConnected(){this.host.addEventListener("keydown",this._boundHandler),document.addEventListener("keydown",this._boundHandler)}hostDisconnected(){this.host.removeEventListener("keydown",this._boundHandler),document.removeEventListener("keydown",this._boundHandler)}_handleKeydown(t){if(!this._enabled)return;const e=this._getActiveElement(),s="TEXTAREA"===e?.tagName,r="INPUT"===e?.tagName,i="true"===e?.getAttribute("contenteditable"),o=s||r||i;switch(t.key){case"Enter":if(s&&this._config.blockEnterOnTextarea)return;this._config.onEnter&&(t.preventDefault(),this._config.onEnter());break;case"Escape":this._config.onEscape&&(t.preventDefault(),this._config.onEscape());break;case"ArrowUp":!o&&this._config.onArrowUp&&(t.preventDefault(),this._config.onArrowUp());break;case"ArrowDown":!o&&this._config.onArrowDown&&(t.preventDefault(),this._config.onArrowDown());break;case"ArrowLeft":!o&&this._config.onArrowLeft&&(t.preventDefault(),this._config.onArrowLeft());break;case"ArrowRight":!o&&this._config.onArrowRight&&(t.preventDefault(),this._config.onArrowRight())}}_getActiveElement(){let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}updateConfig(t){this._config={...this._config,...t}}enable(){this._enabled=!0}disable(){this._enabled=!1}get enabled(){return this._enabled}}const $t=c`
247
+ :host {
248
+ display: inline-flex;
249
+ }
250
+
251
+ :host([hidden]) {
252
+ display: none;
253
+ }
254
+
255
+ .wf-badge {
256
+ display: inline-flex;
257
+ align-items: center;
258
+ justify-content: center;
259
+ box-sizing: border-box;
260
+ min-width: 24px;
261
+ height: 24px;
262
+ padding: var(--wf-spacing-1, 4px) var(--wf-spacing-2, 8px);
263
+ font-size: var(--wf-font-size-xs, 0.75rem);
264
+ font-weight: 500;
265
+ font-family: inherit;
266
+ text-transform: uppercase;
267
+ flex-shrink: 0;
268
+ line-height: 1;
269
+ }
270
+
271
+ .wf-badge--default {
272
+ background-color: var(--wf-color-badge-bg, #fcfcfc);
273
+ border: 1px solid var(--wf-color-badge-border, #d4d4d4);
274
+ border-radius: var(--wf-radius-sm, 4px);
275
+ color: var(--wf-color-badge-text, #5f5f5f);
276
+ }
277
+
278
+ .wf-badge--selected {
279
+ background-color: var(--wf-color-primary, #8040f0);
280
+ border: 1px solid var(--wf-color-primary, #8040f0);
281
+ border-radius: var(--wf-radius-sm, 4px);
282
+ color: white;
283
+ }
284
+
285
+ .wf-badge--button {
286
+ background-color: transparent;
287
+ border: none;
288
+ border-radius: var(--wf-radius-sm, 4px);
289
+ color: rgba(255, 255, 255, 0.65);
290
+ }
291
+
292
+ .wf-badge--button-secondary {
293
+ background-color: transparent;
294
+ border: none;
295
+ border-radius: var(--wf-radius-sm, 4px);
296
+ color: var(--wf-color-text-muted, #5f5f5f);
297
+ }
298
+ `;var Et=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,At=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?kt(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&Et(e,s,o),o};t.WfBadge=class extends ct{constructor(){super(...arguments),this.shortcut="",this.variant="default"}render(){return K`
2
299
  <span
3
300
  class="wf-badge wf-badge--${this.variant}"
4
301
  aria-hidden="true"
302
+ data-testid="wf-badge"
5
303
  >
6
304
  ${this.shortcut}
7
305
  </span>
8
- `}},yt([mt({type:String})],t.WfBadge.prototype,"shortcut",2),yt([mt({type:String})],t.WfBadge.prototype,"variant",2),t.WfBadge=yt([pt("wf-badge")],t.WfBadge);var xt=Object.defineProperty,St=Object.getOwnPropertyDescriptor,$t=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?St(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&xt(e,r,o),o};t.WizardForm=class extends ht{constructor(){super(),this.hubspotPortal="",this.hubspotForm="",this.theme="light",this.mock=!1,this.showProgress=!1,this.autoAdvance=!0,this.hideBack=!0,this.submitOnStep=!1,this._steps=[],this._currentStep=1,this._totalSteps=0,this._formData={},this._submitting=!1,this._submitted=!1,this._error="",this._cachedSuccessContent=null,this._stateController=new gt(this),this._handleFieldChange=t=>{const{name:e,value:r,extraFields:s}=t.detail;this._formData[e]=r,this._stateController.setValue(e,r),s&&Object.entries(s).forEach(([t,e])=>{this._formData[t]=e,this._stateController.setValue(t,e)}),this._error="",this.dispatchEvent(new CustomEvent("wf:field-change",{detail:{name:e,value:r,formData:{...this._formData}},bubbles:!0,composed:!0}))},this._handleOptionSelect=t=>{if(this.autoAdvance){const e=t.target.closest("wf-options");e&&!e.hasAttribute("multi")&&setTimeout(()=>{this._goNext()},300)}},new bt(this,{onEnter:()=>this._handleEnter(),onEscape:()=>this._handleEscape()})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("wf-change",this._handleFieldChange),this.addEventListener("wf-option-select",this._handleOptionSelect)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("wf-change",this._handleFieldChange),this.removeEventListener("wf-option-select",this._handleOptionSelect)}firstUpdated(){this._cachedSuccessContent=this.querySelector('[slot="success"]'),this._discoverSteps(),this._showCurrentStep()}render(){return this._submitted?(this._steps.forEach(t=>{t.active=!1,t.style.display="none"}),this._cachedSuccessContent?(this._cachedSuccessContent.style.display="",Y`
9
- <div class="wf-container wf-submitted">
306
+ `}},t.WfBadge.styles=$t,At([gt({type:String})],t.WfBadge.prototype,"shortcut",2),At([gt({type:String})],t.WfBadge.prototype,"variant",2),t.WfBadge=At([ut("wf-badge")],t.WfBadge);var Ct=Object.defineProperty,Ot=Object.getOwnPropertyDescriptor,Wt=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?Ot(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&Ct(e,s,o),o};t.WizardForm=class extends ct{constructor(){super(),this.hubspotPortal="",this.hubspotForm="",this.theme="light",this.mock=!1,this.showProgress=!1,this.autoAdvance=!0,this.hideBack=!0,this.submitOnStep=!1,this._steps=[],this._currentStep=1,this._totalSteps=0,this._formData={},this._submitting=!1,this.submitted=!1,this._error="",this._otherInputActive=!1,this._stateController=new St(this),this._handleFieldChange=t=>{const{name:e,value:s,extraFields:r}=t.detail;if(this._formData[e]=s,this._stateController.setValue(e,s),r){Object.entries(r).forEach(([t,e])=>{this._formData[t]=e,this._stateController.setValue(t,e)});const t=Object.values(r).some(t=>t&&(t+"").trim());this._otherInputActive=t}else this._otherInputActive=!1;this._error="",this.dispatchEvent(new CustomEvent("wf:field-change",{detail:{name:e,value:s,formData:{...this._formData}},bubbles:!0,composed:!0}))},this._handleOptionSelect=t=>{if(!this._stepHasComposableNav()&&this.autoAdvance){const e=t.target.closest("wf-options");e&&!e.hasAttribute("multi")&&setTimeout(()=>{this._goNext()},300)}},this._handleNavNext=async t=>{t.stopPropagation(),await this._goNext()},this._handleNavBack=t=>{t.stopPropagation(),this._goBack()},this._handleNavStateRequest=()=>{this._broadcastNavState()},new xt(this,{onEnter:()=>this._handleEnter(),onEscape:()=>this._handleEscape()})}connectedCallback(){super.connectedCallback(),this.addEventListener("wf-change",this._handleFieldChange),this.addEventListener("wf-option-select",this._handleOptionSelect),this.addEventListener("wf:nav-next",this._handleNavNext),this.addEventListener("wf:nav-back",this._handleNavBack),this.addEventListener("wf:nav-state-request",this._handleNavStateRequest)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("wf-change",this._handleFieldChange),this.removeEventListener("wf-option-select",this._handleOptionSelect),this.removeEventListener("wf:nav-next",this._handleNavNext),this.removeEventListener("wf:nav-back",this._handleNavBack),this.removeEventListener("wf:nav-state-request",this._handleNavStateRequest)}firstUpdated(){this._discoverSteps(),this._showCurrentStep(),this._broadcastNavState()}render(){return this.submitted?(this._steps.forEach(t=>{t.active=!1}),K`
307
+ <div class="wf-container" data-testid="wf-container">
308
+ <slot name="success">
10
309
  <div class="wf-success-screen">
11
- ${this._cachedSuccessContent}
310
+ <h2>Thank you!</h2>
311
+ <p>Your submission has been received.</p>
12
312
  </div>
13
- </div>
14
- `):Y`
15
- <div class="wf-container wf-submitted">
16
- <div class="wf-success-screen">
17
- <h2>Thank you!</h2>
18
- <p>Your submission has been received.</p>
19
- </div>
313
+ </slot>
20
314
  </div>
21
- `):(this._cachedSuccessContent&&(this._cachedSuccessContent.style.display="none"),Y`
22
- <div class="wf-container">
23
- ${this._error?Y`<div class="wf-form-error" role="alert">${this._error}</div>`:X}
315
+ `):K`
316
+ <div class="wf-container" data-testid="wf-container">
317
+ ${this._error?K`<div class="wf-form-error" role="alert" data-testid="wf-form-error">${this._error}</div>`:J}
24
318
 
25
- ${this._renderNavigation()}
319
+ <slot @slotchange="${this._handleSlotChange}"></slot>
26
320
  </div>
27
- `)}_renderProgress(){const t=[];for(let e=1;e<=this._totalSteps;e++){const r=e<this._currentStep,s=e===this._currentStep;t.push(Y`
321
+ `}_handleSlotChange(){this._discoverSteps()}_renderProgress(){const t=[];for(let e=1;e<=this._totalSteps;e++){const s=e<this._currentStep,r=e===this._currentStep;t.push(K`
28
322
  <div
29
- class="wf-progress-segment ${r?"completed":""} ${s?"active":""}"
323
+ class="wf-progress-segment ${s?"completed":""} ${r?"active":""}"
30
324
  ></div>
31
- `)}return Y`<div class="wf-progress">${t}</div>`}_renderNavigation(){const t=1===this._currentStep,e=this._currentStep===this._totalSteps,r=!this.hideBack&&!t;return Y`
32
- <div class="wf-navigation">
33
- ${r?Y`
34
- <button
35
- class="wf-btn wf-btn-back"
36
- @click="${this._goBack}"
37
- ?disabled="${this._submitting}"
38
- data-testid="wf-back-btn"
39
- >
40
- <span class="wf-btn-shortcut"><wf-badge shortcut="Esc" variant="button-secondary"></wf-badge></span>
41
- Back
42
- </button>
43
- `:X}
44
-
45
- <button
46
- class="wf-btn wf-btn-next"
47
- @click="${this._goNext}"
48
- ?disabled="${this._submitting}"
49
- data-testid="wf-next-btn"
50
- >
51
- ${this._submitting?Y`<span class="wf-loading"></span>`:e?"Submit":"Continue"}
52
- <span class="wf-btn-shortcut"><wf-badge shortcut="Enter ↵" variant="button"></wf-badge></span>
53
- </button>
325
+ `)}return K`<div class="wf-progress">${t}</div>`}_renderNavigation(){return J}_discoverSteps(){const t=this.shadowRoot?.querySelector("slot:not([name])");if(t){const e=t.assignedElements({flatten:!0});this._steps=e.filter(t=>"wf-step"===t.tagName.toLowerCase())}else this._steps=Array.from(this.querySelectorAll(":scope > wf-step"));this._steps.forEach((t,e)=>{t.step=e+1}),this._totalSteps=this._steps.length,this._stateController.setTotalSteps(this._totalSteps),document.dispatchEvent(new CustomEvent("wf:steps-discovered",{detail:{wizard:this,wizardId:this.id,totalSteps:this._totalSteps,currentStep:this._currentStep}}))}_showCurrentStep(){this._steps.forEach((t,e)=>{e+1===this._currentStep?t.show("forward"):t.active=!1})}_getStepByNumber(t){const e=t-1;return this._steps[e]}_stepRequiresManualNav(){if(!this.autoAdvance)return!0;const t=this._getStepByNumber(this._currentStep);if(!t)return!0;const e=["wf-input","wf-email","wf-textarea","wf-number"];for(const s of e)if(t.querySelector(s))return!0;return!!t.querySelector("wf-options[multi]")||!(!t.querySelector("wf-options[allow-other]")||!this._otherInputActive)}_stepHasComposableNav(){const t=this._getStepByNumber(this._currentStep);if(!t)return!1;const e=t.querySelectorAll("wf-next-btn, wf-back-btn");for(const s of e)if(!s.closest("wf-other"))return!0;return!1}_broadcastNavState(){this.dispatchEvent(new CustomEvent("wf:nav-state",{detail:{currentStep:this._currentStep,totalSteps:this._totalSteps,isFirstStep:1===this._currentStep,isLastStep:this._currentStep===this._totalSteps,isSubmitting:this._submitting},bubbles:!1}))}async _goNext(){if(this._submitting)return;const t=this._getStepByNumber(this._currentStep);t&&!(await t.validate())||(this._currentStep>=this._totalSteps?await this._submit():this._navigateToStep(this._currentStep+1,"forward"))}_goBack(){this._submitting||this._currentStep<=1||this._navigateToStep(this._currentStep-1,"backward")}async _navigateToStep(t,e){if(t<1||t>this._totalSteps)return;const s=this._getStepByNumber(t);if(!s)return;if(s.shouldSkip(this._formData)){const s="forward"===e?t+1:t-1;return s>=1&&s<=this._totalSteps?this._navigateToStep(s,e):void 0}const r=this._currentStep;let i,o=!1;if(this.submitOnStep&&this.hubspotPortal&&this.hubspotForm)try{await this._submitPartialToHubSpot(),o=!0,i="hubspot"}catch(n){return void this.dispatchEvent(new CustomEvent("wf:error",{detail:{error:n instanceof Error?n.message:"Partial submission failed",formData:this._getFieldsUpToStep(this._currentStep)},bubbles:!0,composed:!0}))}const a=this._getStepByNumber(this._currentStep);a&&await a.hide(),this._currentStep=t,this._stateController.goToStep(t),this._otherInputActive=!1,this._broadcastNavState(),s.show(e),this.dispatchEvent(new CustomEvent("wf:step-change",{detail:{from:r,to:t,direction:e,submitted:o,adapter:i},bubbles:!0,composed:!0}))}async _handleEnter(){await this._goNext()}_handleEscape(){this._goBack()}async _submit(){if(this._submitting)return;const t={...this._formData},e=new CustomEvent("wf:submit",{detail:{formData:t},bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(e),e.defaultPrevented)return;this._submitting=!0,this._error="",this._broadcastNavState();let s=t;this.serialize&&(s=this.serialize(t));try{let t;this.mock?(await new Promise(t=>setTimeout(t,1e3)),t={success:!0}):t=this.hubspotPortal&&this.hubspotForm?await this._submitToHubSpot(s):{success:!0},this.submitted=!0,this.dispatchEvent(new CustomEvent("wf:success",{detail:{formData:s,response:t},bubbles:!0,composed:!0}))}catch(r){const t=r instanceof Error?r.message:"Submission failed";this._error=t,this.dispatchEvent(new CustomEvent("wf:error",{detail:{error:t,formData:s},bubbles:!0,composed:!0}))}finally{this._submitting=!1,this._broadcastNavState()}}async _submitToHubSpot(t){const e=`https://api.hsforms.com/submissions/v3/integration/submit/${this.hubspotPortal}/${this.hubspotForm}`,s={fields:Object.entries(t).map(([t,e])=>({name:t,value:Array.isArray(e)?e.join(";"):(e??"")+""})),context:{pageUri:window.location.href,pageName:document.title}},r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!r.ok){const t=await r.json().catch(()=>({}));throw Error(t.message||"HubSpot submission failed: "+r.status)}return r.json()}_getFieldsUpToStep(t){const e={};for(let s=0;s<t&&s<this._steps.length;s++)this._steps[s].querySelectorAll("[name]").forEach(t=>{t.name&&void 0!==this._formData[t.name]&&(e[t.name]=this._formData[t.name])});return e}async _submitPartialToHubSpot(){let t={...this._getFieldsUpToStep(this._currentStep)};this.serialize&&(t=this.serialize(t)),await this._submitToHubSpot(t)}get formData(){return{...this._formData}}get currentStep(){return this._currentStep}get totalSteps(){return this._totalSteps}get isSubmitting(){return this._submitting}get isSubmitted(){return this.submitted}goToStep(t){const e=t>this._currentStep?"forward":"backward";this._navigateToStep(t,e)}next(){return this._goNext()}back(){this._goBack()}submit(){return this._submit()}reset(){this._formData={},this._currentStep=1,this._submitting=!1,this.submitted=!1,this._error="",this._stateController.reset(),this._showCurrentStep(),this._steps.forEach(t=>{t.querySelectorAll("wf-options, wf-field, wf-email").forEach(t=>{"reset"in t&&"function"==typeof t.reset&&t.reset()})})}setFormData(t){this._formData={...this._formData,...t},Object.entries(t).forEach(([t,e])=>{this._stateController.setValue(t,e)})}},t.WizardForm.styles=yt,Wt([gt({type:String,attribute:"hubspot-portal"})],t.WizardForm.prototype,"hubspotPortal",2),Wt([gt({type:String,attribute:"hubspot-form"})],t.WizardForm.prototype,"hubspotForm",2),Wt([gt({type:String,reflect:!0})],t.WizardForm.prototype,"theme",2),Wt([gt({type:Boolean})],t.WizardForm.prototype,"mock",2),Wt([gt({type:Boolean,attribute:"show-progress"})],t.WizardForm.prototype,"showProgress",2),Wt([gt({type:Boolean,attribute:"auto-advance"})],t.WizardForm.prototype,"autoAdvance",2),Wt([gt({type:Boolean,attribute:"hide-back"})],t.WizardForm.prototype,"hideBack",2),Wt([gt({attribute:!1})],t.WizardForm.prototype,"serialize",2),Wt([gt({type:Boolean,attribute:"submit-on-step"})],t.WizardForm.prototype,"submitOnStep",2),Wt([bt()],t.WizardForm.prototype,"_steps",2),Wt([bt()],t.WizardForm.prototype,"_currentStep",2),Wt([bt()],t.WizardForm.prototype,"_totalSteps",2),Wt([bt()],t.WizardForm.prototype,"_formData",2),Wt([bt()],t.WizardForm.prototype,"_submitting",2),Wt([gt({type:Boolean,reflect:!0})],t.WizardForm.prototype,"submitted",2),Wt([bt()],t.WizardForm.prototype,"_error",2),Wt([bt()],t.WizardForm.prototype,"_otherInputActive",2),t.WizardForm=Wt([ut("wizard-form")],t.WizardForm),t.WfSuccess=class extends ct{render(){return K`<slot></slot>`}},t.WfSuccess.styles=c`
326
+ :host {
327
+ display: block;
328
+ }
329
+
330
+ :host([hidden]) {
331
+ display: none;
332
+ }
333
+ `,t.WfSuccess=Wt([ut("wf-success")],t.WfSuccess);const zt=[_t,c`
334
+ :host {
335
+ display: none;
336
+ width: 100%;
337
+ }
338
+
339
+ :host([hidden]) {
340
+ display: none !important;
341
+ }
342
+
343
+ :host([active]) {
344
+ display: block;
345
+ animation: wf-stepFadeIn 0.3s ease forwards;
346
+ }
347
+
348
+ :host([direction='forward'][active]) {
349
+ animation: wf-stepSlideInRight 0.3s ease forwards;
350
+ }
351
+
352
+ :host([direction='backward'][active]) {
353
+ animation: wf-stepSlideInLeft 0.3s ease forwards;
354
+ }
355
+
356
+ :host([leaving]) {
357
+ display: block;
358
+ animation: wf-stepFadeOut 0.2s ease forwards;
359
+ }
360
+
361
+ .wf-step-content {
362
+ display: flex;
363
+ flex-direction: column;
364
+ gap: var(--wf-spacing-4, 16px);
365
+ }
366
+
367
+ /* Slotted heading styles */
368
+ ::slotted(h1),
369
+ ::slotted(h2),
370
+ ::slotted(h3) {
371
+ margin: 0;
372
+ font-weight: 600;
373
+ color: var(--wf-color-text, #212529);
374
+ }
375
+
376
+ ::slotted(h2) {
377
+ font-size: var(--wf-font-size-3xl, 2rem);
378
+ }
379
+
380
+ ::slotted(p) {
381
+ margin: 0;
382
+ color: var(--wf-color-text-muted, #6c757d);
383
+ font-size: var(--wf-font-size-xl, 1.375rem);
384
+ }
385
+ `];var Pt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Lt=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?Nt(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&Pt(e,s,o),o};t.WfStep=class extends ct{constructor(){super(...arguments),this.step=0,this.active=!1,this.direction="forward",this.leaving=!1,this.skipIf="",this._fields=[]}render(){return K`
386
+ <div class="wf-step-content" data-testid="wf-step-content">
387
+ <slot></slot>
54
388
  </div>
55
- `}_discoverSteps(){this._steps=Array.from(this.querySelectorAll(":scope > wf-step")),this._steps.forEach((t,e)=>{t.step=e+1}),this._totalSteps=this._steps.length,this._stateController.setTotalSteps(this._totalSteps),document.dispatchEvent(new CustomEvent("wf:steps-discovered",{detail:{wizard:this,wizardId:this.id,totalSteps:this._totalSteps,currentStep:this._currentStep}}))}_showCurrentStep(){this._steps.forEach((t,e)=>{e+1===this._currentStep?t.show("forward"):t.active=!1})}_getStepByNumber(t){const e=t-1;return this._steps[e]}async _goNext(){if(this._submitting)return;const t=this._getStepByNumber(this._currentStep);t&&!(await t.validate())||(this._currentStep>=this._totalSteps?await this._submit():this._navigateToStep(this._currentStep+1,"forward"))}_goBack(){this._submitting||this._currentStep<=1||this._navigateToStep(this._currentStep-1,"backward")}async _navigateToStep(t,e){if(t<1||t>this._totalSteps)return;const r=this._getStepByNumber(t);if(!r)return;if(r.shouldSkip(this._formData)){const r="forward"===e?t+1:t-1;return r>=1&&r<=this._totalSteps?this._navigateToStep(r,e):void 0}const s=this._currentStep;let i,o=!1;if(this.submitOnStep&&this.hubspotPortal&&this.hubspotForm)try{await this._submitPartialToHubSpot(),o=!0,i="hubspot"}catch(n){return void this.dispatchEvent(new CustomEvent("wf:error",{detail:{error:n instanceof Error?n.message:"Partial submission failed",formData:this._getFieldsUpToStep(this._currentStep)},bubbles:!0,composed:!0}))}const a=this._getStepByNumber(this._currentStep);a&&await a.hide(),this._currentStep=t,this._stateController.goToStep(t),r.show(e),this.dispatchEvent(new CustomEvent("wf:step-change",{detail:{from:s,to:t,direction:e,submitted:o,adapter:i},bubbles:!0,composed:!0}))}async _handleEnter(){await this._goNext()}_handleEscape(){this._goBack()}async _submit(){if(this._submitting)return;const t={...this._formData},e=new CustomEvent("wf:submit",{detail:{formData:t},bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(e),e.defaultPrevented)return;this._submitting=!0,this._error="";let r=t;this.serialize&&(r=this.serialize(t));try{let t;this.mock?(await new Promise(t=>setTimeout(t,1e3)),t={success:!0}):t=this.hubspotPortal&&this.hubspotForm?await this._submitToHubSpot(r):{success:!0},this._submitted=!0,this.dispatchEvent(new CustomEvent("wf:success",{detail:{formData:r,response:t},bubbles:!0,composed:!0}))}catch(s){const t=s instanceof Error?s.message:"Submission failed";this._error=t,this.dispatchEvent(new CustomEvent("wf:error",{detail:{error:t,formData:r},bubbles:!0,composed:!0}))}finally{this._submitting=!1}}async _submitToHubSpot(t){const e=`https://api.hsforms.com/submissions/v3/integration/submit/${this.hubspotPortal}/${this.hubspotForm}`,r={fields:Object.entries(t).map(([t,e])=>({name:t,value:Array.isArray(e)?e.join(";"):(e??"")+""})),context:{pageUri:window.location.href,pageName:document.title}},s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok){const t=await s.json().catch(()=>({}));throw Error(t.message||"HubSpot submission failed: "+s.status)}return s.json()}_getFieldsUpToStep(t){const e={};for(let r=0;r<t&&r<this._steps.length;r++)this._steps[r].querySelectorAll("[name]").forEach(t=>{t.name&&void 0!==this._formData[t.name]&&(e[t.name]=this._formData[t.name])});return e}async _submitPartialToHubSpot(){let t={...this._getFieldsUpToStep(this._currentStep)};this.serialize&&(t=this.serialize(t)),await this._submitToHubSpot(t)}get formData(){return{...this._formData}}get currentStep(){return this._currentStep}get totalSteps(){return this._totalSteps}get isSubmitting(){return this._submitting}get isSubmitted(){return this._submitted}goToStep(t){const e=t>this._currentStep?"forward":"backward";this._navigateToStep(t,e)}next(){return this._goNext()}back(){this._goBack()}submit(){return this._submit()}reset(){this._formData={},this._currentStep=1,this._submitting=!1,this._submitted=!1,this._error="",this._stateController.reset(),this._showCurrentStep(),this._steps.forEach(t=>{t.querySelectorAll("wf-options, wf-field, wf-email").forEach(t=>{"reset"in t&&"function"==typeof t.reset&&t.reset()})})}setFormData(t){this._formData={...this._formData,...t},Object.entries(t).forEach(([t,e])=>{this._stateController.setValue(t,e)})}},$t([mt({type:String,attribute:"hubspot-portal"})],t.WizardForm.prototype,"hubspotPortal",2),$t([mt({type:String,attribute:"hubspot-form"})],t.WizardForm.prototype,"hubspotForm",2),$t([mt({type:String,reflect:!0})],t.WizardForm.prototype,"theme",2),$t([mt({type:Boolean})],t.WizardForm.prototype,"mock",2),$t([mt({type:Boolean,attribute:"show-progress"})],t.WizardForm.prototype,"showProgress",2),$t([mt({type:Boolean,attribute:"auto-advance"})],t.WizardForm.prototype,"autoAdvance",2),$t([mt({type:Boolean,attribute:"hide-back"})],t.WizardForm.prototype,"hideBack",2),$t([mt({attribute:!1})],t.WizardForm.prototype,"serialize",2),$t([mt({type:Boolean,attribute:"submit-on-step"})],t.WizardForm.prototype,"submitOnStep",2),$t([wt()],t.WizardForm.prototype,"_steps",2),$t([wt()],t.WizardForm.prototype,"_currentStep",2),$t([wt()],t.WizardForm.prototype,"_totalSteps",2),$t([wt()],t.WizardForm.prototype,"_formData",2),$t([wt()],t.WizardForm.prototype,"_submitting",2),$t([wt()],t.WizardForm.prototype,"_submitted",2),$t([wt()],t.WizardForm.prototype,"_error",2),t.WizardForm=$t([pt("wizard-form")],t.WizardForm),t.WfSuccess=class extends ht{createRenderRoot(){return this}render(){return Y``}},t.WfSuccess=$t([pt("wf-success")],t.WfSuccess);var Et=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,At=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?kt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Et(e,r,o),o};t.WfStep=class extends ht{constructor(){super(...arguments),this.step=0,this.active=!1,this.direction="forward",this.leaving=!1,this.skipIf="",this._fields=[]}createRenderRoot(){return this}render(){return Y`
56
- <div class="wf-step-content"></div>
57
- `}firstUpdated(){this._discoverFields()}updated(t){t.has("active")&&this.active&&(this.leaving=!1,this._focusFirstField())}_discoverFields(){const t=["wf-options","wf-field","wf-email","wf-input","wf-textarea","wf-number"],e=[],r=s=>{if(t.includes(s.tagName.toLowerCase())){const t=s.getAttribute("name");t&&e.push(t)}Array.from(s.children).forEach(r)};Array.from(this.children).forEach(r),this._fields=e}_focusFirstField(){requestAnimationFrame(()=>{for(const t of this.children){const e=this._findFocusable(t);if(e)return void e.focus()}})}_findFocusable(t){if(t instanceof HTMLElement&&"function"==typeof t.focus&&["wf-field","wf-email","wf-input","wf-textarea"].includes(t.tagName.toLowerCase()))return t;for(const e of t.children){const t=this._findFocusable(e);if(t)return t}return null}get fields(){return[...this._fields]}shouldSkip(t){if(!this.skipIf)return!1;try{const e=this.skipIf.trim();if(e.startsWith("!"))return!t[e.slice(1)];if(e.includes("===")){const[r,s]=e.split("===").map(t=>t.trim());return t[r]===s.replace(/['"]/g,"")}if(e.includes("!==")){const[r,s]=e.split("!==").map(t=>t.trim());return t[r]!==s.replace(/['"]/g,"")}return!!t[e]}catch(e){return!1}}show(t="forward"){this.direction=t,this.leaving=!1,this.active=!0}hide(){return new Promise(t=>{this.leaving=!0;const e=()=>{this.active=!1,this.leaving=!1,this.removeEventListener("animationend",e),t()};this.addEventListener("animationend",e),setTimeout(()=>{this.active=!1,this.leaving=!1,this.removeEventListener("animationend",e),t()},300)})}async validate(){const t=[];let e=!0;const r=async s=>{"validate"in s&&"function"==typeof s.validate&&(await s.validate()||(t.push(s),e=!1));for(const t of s.children)await r(t)};for(const s of this.children)await r(s);if(t.length>0){const e=t[0];e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{"focus"in e&&"function"==typeof e.focus&&e.focus()},100)}return e}},At([mt({type:Number,attribute:"data-step"})],t.WfStep.prototype,"step",2),At([mt({type:Boolean,reflect:!0})],t.WfStep.prototype,"active",2),At([mt({type:String,reflect:!0})],t.WfStep.prototype,"direction",2),At([mt({type:Boolean,reflect:!0})],t.WfStep.prototype,"leaving",2),At([mt({type:String,attribute:"data-skip-if"})],t.WfStep.prototype,"skipIf",2),At([wt()],t.WfStep.prototype,"_fields",2),t.WfStep=At([pt("wf-step")],t.WfStep);var Ct=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,Ot=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?zt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Ct(e,r,o),o};const Wt={none:0,xs:4,sm:8,md:16,lg:24,xl:32};t.WfLayout=class extends ht{constructor(){super(...arguments),this.mode="flex",this.direction="column",this.gap="none",this.gapX="",this.gapY="",this.align="stretch",this.justify="start",this.padding="none",this.paddingX="",this.paddingY="",this.wrap=!1,this.width="full",this.columns="auto",this.minItemWidth="200px"}createRenderRoot(){return this}_resolveSpacing(t){if(!t||"none"===t)return"0";if(t in Wt)return Wt[t]+"px";const e=parseFloat(t);return isNaN(e)?t:e+"px"}_getGapX(){return this._resolveSpacing(this.gapX||this.gap)}_getGapY(){return this._resolveSpacing(this.gapY||this.gap)}_getPadding(){const t=this._resolveSpacing(this.padding),e=this.paddingX?this._resolveSpacing(this.paddingX):t;return`${this.paddingY?this._resolveSpacing(this.paddingY):t} ${e}`}_buildStyles(){const t=[];if("grid"===this.mode){t.push("display: grid");const e=parseInt(this.columns,10);!isNaN(e)&&e>0?t.push(`grid-template-columns: repeat(${e}, 1fr)`):t.push(`grid-template-columns: repeat(auto-fit, minmax(${this.minItemWidth}, 1fr))`),"stretch"!==this.align&&t.push("align-items: "+this.align),"start"!==this.justify&&t.push("justify-content: "+this.justify)}else t.push("display: flex"),t.push("flex-direction: "+this.direction),this.wrap&&t.push("flex-wrap: wrap"),"stretch"!==this.align&&t.push("align-items: "+this.align),"start"!==this.justify&&t.push("justify-content: "+this.justify);const e=this._getGapX(),r=this._getGapY();"0"===e&&"0"===r||(t.push("column-gap: "+e),t.push("row-gap: "+r));const s=this._getPadding();return"0 0"!==s&&t.push("padding: "+s),t.join("; ")}updated(t){super.updated(t),this.style.cssText=this._buildStyles(),this.classList.remove("wf-layout--width-full","wf-layout--width-auto","wf-layout--width-fit"),this.classList.add("wf-layout--width-"+this.width)}render(){return Y``}},Ot([mt({type:String})],t.WfLayout.prototype,"mode",2),Ot([mt({type:String})],t.WfLayout.prototype,"direction",2),Ot([mt({type:String})],t.WfLayout.prototype,"gap",2),Ot([mt({type:String,attribute:"gap-x"})],t.WfLayout.prototype,"gapX",2),Ot([mt({type:String,attribute:"gap-y"})],t.WfLayout.prototype,"gapY",2),Ot([mt({type:String})],t.WfLayout.prototype,"align",2),Ot([mt({type:String})],t.WfLayout.prototype,"justify",2),Ot([mt({type:String})],t.WfLayout.prototype,"padding",2),Ot([mt({type:String,attribute:"padding-x"})],t.WfLayout.prototype,"paddingX",2),Ot([mt({type:String,attribute:"padding-y"})],t.WfLayout.prototype,"paddingY",2),Ot([mt({type:Boolean})],t.WfLayout.prototype,"wrap",2),Ot([mt({type:String})],t.WfLayout.prototype,"width",2),Ot([mt({type:String})],t.WfLayout.prototype,"columns",2),Ot([mt({type:String,attribute:"min-item-width"})],t.WfLayout.prototype,"minItemWidth",2),t.WfLayout=Ot([pt("wf-layout")],t.WfLayout);var Pt=Object.defineProperty,Tt=Object.getOwnPropertyDescriptor,Dt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Tt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Pt(e,r,o),o};t.WfOptions=class extends ht{constructor(){super(...arguments),this.name="",this.multi=!1,this.required=!1,this.min=0,this.max=0,this.columns=2,this.allowOther=!1,this.otherLabel="Other, please specify:",this.otherPlaceholder="Enter your answer",this.otherRequired=!1,this.otherName="",this.otherFieldValue="Others",this._selected=new Set,this._otherValue="",this._errorMessage="",this._validationActivated=!1,this._options=[],this._shortcutMap=new Map,this._otherShortcut="",this._handleOptionSelect=t=>{t.stopPropagation();const{value:e}=t.detail;this._selectValue(e)},this._handleKeydown=t=>{const e=this.closest("wf-step");if(!e||!e.hasAttribute("active"))return;const r=t.composedPath()[0];if("INPUT"===r?.tagName||"TEXTAREA"===r?.tagName)return;const s=this.querySelector(".wf-other-input");if(s&&document.activeElement===s)return;const i=t.key.toUpperCase();if(1===i.length&&i>="A"&&i<="Z"){if(this.allowOther&&i===this._otherShortcut){t.preventDefault();const e=this.querySelector(".wf-other-input");return void(e&&e.focus())}const e=this._shortcutMap.get(i);e&&!e.disabled&&(t.preventDefault(),e.triggerSelect())}}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._errorMessage="",this._validationActivated=!1,this.addEventListener("wf-option-select",this._handleOptionSelect),document.addEventListener("keydown",this._handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("wf-option-select",this._handleOptionSelect),document.removeEventListener("keydown",this._handleKeydown)}firstUpdated(){const t=this.querySelector("wf-layout");Array.from(this.querySelectorAll(":scope > wf-option")).forEach(e=>t?.appendChild(e)),this._discoverOptions(),this.requestUpdate()}updated(t){(t.has("multi")||t.has("max"))&&this._updateOptionStates()}render(){return this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable",this.multi+""),this.setAttribute("aria-required",this.required+""),Y`
58
- <wf-layout mode="grid" columns="${this.columns}" gap="md">
59
- <!-- wf-option children will be moved here in firstUpdated -->
60
- </wf-layout>
61
- ${this.allowOther?Y`
62
- <div class="wf-other-container">
63
- <label class="wf-other-label">${this.otherLabel}</label>
64
- <div class="wf-other-input-wrapper">
65
- ${this._otherShortcut?Y`<wf-badge shortcut="${this._otherShortcut}"></wf-badge>`:""}
66
- <input
67
- type="text"
68
- class="wf-other-input"
69
- .value="${this._otherValue}"
70
- placeholder="${this.otherPlaceholder}"
71
- data-testid="wf-other-input"
72
- @input="${this._handleOtherInput}"
73
- @keydown="${this._handleOtherKeydown}"
74
- @focus="${this._handleOtherFocus}"
75
- />
76
- </div>
77
- </div>
78
- `:""}
79
- <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
80
- ${this._errorMessage}
81
- </span>
82
- `}_handleOtherInput(t){const e=t.target;this._otherValue=e.value,this._otherValue.trim()&&this._selected.size>0&&(this._selected.clear(),this._updateOptionStates()),this._dispatchChange()}_handleOtherFocus(){}_handleOtherKeydown(t){"Escape"===t.key&&(t.stopPropagation(),t.target.blur())}_discoverOptions(){const t=this.querySelector("wf-layout");this._options=t?Array.from(t.querySelectorAll(":scope > wf-option")):[],this._shortcutMap.clear(),this._options.forEach((t,e)=>{if(e<26){const r=String.fromCharCode(65+e);t.shortcut=r,this._shortcutMap.set(r,t)}t.setSelected(this._selected.has(t.value))}),this.allowOther&&this._options.length<26&&(this._otherShortcut=String.fromCharCode(65+this._options.length))}_selectValue(t){this.multi?this._handleMultiSelect(t):this._handleSingleSelect(t),this.allowOther&&this._otherValue&&(this._otherValue=""),this._updateOptionStates(),this._validateSelection(),this._dispatchChange()}_handleSingleSelect(t){this._selected.clear(),this._selected.add(t)}_handleMultiSelect(t){if(this._selected.has(t))this._selected.delete(t);else{if(this.max>0&&this._selected.size>=this.max)return;this._selected.add(t)}}_updateOptionStates(){this._options.forEach(t=>{t.setSelected(this._selected.has(t.value))})}_checkValidation(){const t=this.allowOther&&this._otherValue.trim(),e=this._selected.size>0||t;if(this.required&&!e)return!1;if(this.multi){if(this.min>0&&this._selected.size<this.min&&!t)return!1;if(this.max>0&&this._selected.size>this.max)return!1}return!0}_validateSelection(){if(!this._validationActivated)return this._errorMessage="",this._checkValidation();this._errorMessage="";const t=this.allowOther&&this._otherValue.trim(),e=this._selected.size>0||t;if(this.required&&!e)return this._errorMessage=this.allowOther?"Please select an option or specify in the text field":"Please select an option",!1;if(this.multi){if(this.min>0&&this._selected.size<this.min&&!t)return this._errorMessage=`Please select at least ${this.min} option${this.min>1?"s":""}`,!1;if(this.max>0&&this._selected.size>this.max)return this._errorMessage=`Please select at most ${this.max} option${this.max>1?"s":""}`,!1}return!0}_dispatchChange(){const t=Array.from(this._selected),e=this.allowOther&&this._otherValue.trim()&&0===this._selected.size;let r;r=this.otherName&&e?this.multi?[this.otherFieldValue]:this.otherFieldValue:this.value;const s={name:this.name,value:r,selected:t};this.otherName&&(s.extraFields={[this.otherName]:e?this._otherValue.trim():""}),this.dispatchEvent(new CustomEvent("wf-change",{detail:s,bubbles:!0,composed:!0}))}get value(){if(this.allowOther&&this._otherValue.trim()&&0===this._selected.size)return this.multi?[this._otherValue]:this._otherValue;const t=Array.from(this._selected);return this.multi?t:t[0]??""}set value(t){this._selected.clear(),Array.isArray(t)?t.forEach(t=>this._selected.add(t)):t&&this._selected.add(t),this._updateOptionStates(),this._validateSelection()}getSelected(){return Array.from(this._selected)}isSelected(t){return this._selected.has(t)}select(t){this._selectValue(t)}deselect(t){this._selected.has(t)&&(this._selected.delete(t),this._updateOptionStates(),this._validateSelection(),this._dispatchChange())}clear(){this._selected.clear(),this._updateOptionStates(),this._validateSelection(),this._dispatchChange()}validate(){return this._validationActivated=!0,this._validateSelection()}get isValid(){return this._checkValidation()}showError(t){this._errorMessage=t}clearError(){this._errorMessage=""}focus(){this._options[0]?.focus()}reset(){this._selected.clear(),this._otherValue="",this._errorMessage="",this._validationActivated=!1,this._options.forEach(t=>{t.hasAttribute("selected")&&this._selected.add(t.value),t.setSelected(this._selected.has(t.value))}),this._dispatchChange()}},Dt([mt({type:String})],t.WfOptions.prototype,"name",2),Dt([mt({type:Boolean})],t.WfOptions.prototype,"multi",2),Dt([mt({type:Boolean})],t.WfOptions.prototype,"required",2),Dt([mt({type:Number})],t.WfOptions.prototype,"min",2),Dt([mt({type:Number})],t.WfOptions.prototype,"max",2),Dt([mt({type:Number,reflect:!0})],t.WfOptions.prototype,"columns",2),Dt([mt({type:Boolean,attribute:"allow-other"})],t.WfOptions.prototype,"allowOther",2),Dt([mt({type:String,attribute:"other-label"})],t.WfOptions.prototype,"otherLabel",2),Dt([mt({type:String,attribute:"other-placeholder"})],t.WfOptions.prototype,"otherPlaceholder",2),Dt([mt({type:Boolean,attribute:"other-required"})],t.WfOptions.prototype,"otherRequired",2),Dt([mt({type:String,attribute:"other-name"})],t.WfOptions.prototype,"otherName",2),Dt([mt({type:String,attribute:"other-value"})],t.WfOptions.prototype,"otherFieldValue",2),Dt([wt()],t.WfOptions.prototype,"_selected",2),Dt([wt()],t.WfOptions.prototype,"_otherValue",2),Dt([wt()],t.WfOptions.prototype,"_errorMessage",2),Dt([wt()],t.WfOptions.prototype,"_otherShortcut",2),t.WfOptions=Dt([pt("wf-options")],t.WfOptions);var Mt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Lt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Ft(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Mt(e,r,o),o};t.WfOption=class extends ht{constructor(){super(...arguments),this.value="",this.selected=!1,this.disabled=!1,this.shortcut="",this._selecting=!1,this._cachedContent=[]}createRenderRoot(){return this}connectedCallback(){0===this._cachedContent.length&&(this._cachedContent=Array.from(this.childNodes).map(t=>t.cloneNode(!0)),this.textContent=""),super.connectedCallback()}render(){return Y`
389
+ `}firstUpdated(){this._discoverFields()}updated(t){t.has("active")&&this.active&&(this.leaving=!1,this._focusFirstField())}_discoverFields(){const t=["wf-options","wf-field","wf-email","wf-input","wf-textarea","wf-number"],e=[],s=r=>{if(t.includes(r.tagName.toLowerCase())){const t=r.getAttribute("name");t&&e.push(t)}Array.from(r.children).forEach(s)};Array.from(this.children).forEach(s),this._fields=e}_focusFirstField(){requestAnimationFrame(()=>{for(const t of this.children){const e=this._findFocusable(t);if(e)return void e.focus()}})}_findFocusable(t){if(t instanceof HTMLElement&&"function"==typeof t.focus&&["wf-field","wf-email","wf-input","wf-textarea"].includes(t.tagName.toLowerCase()))return t;for(const e of t.children){const t=this._findFocusable(e);if(t)return t}return null}get fields(){return[...this._fields]}shouldSkip(t){if(!this.skipIf)return!1;try{const e=this.skipIf.trim();if(e.startsWith("!"))return!t[e.slice(1)];if(e.includes("===")){const[s,r]=e.split("===").map(t=>t.trim());return t[s]===r.replace(/['"]/g,"")}if(e.includes("!==")){const[s,r]=e.split("!==").map(t=>t.trim());return t[s]!==r.replace(/['"]/g,"")}return!!t[e]}catch(e){return!1}}show(t="forward"){this.direction=t,this.leaving=!1,this.active=!0}hide(){return new Promise(t=>{this.leaving=!0;const e=()=>{this.active=!1,this.leaving=!1,this.removeEventListener("animationend",e),t()};this.addEventListener("animationend",e),setTimeout(()=>{this.active=!1,this.leaving=!1,this.removeEventListener("animationend",e),t()},300)})}async validate(){const t=[];let e=!0;const s=async r=>{"validate"in r&&"function"==typeof r.validate&&(await r.validate()||(t.push(r),e=!1));for(const t of r.children)await s(t)};for(const r of this.children)await s(r);if(t.length>0){const e=t[0];e.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{"focus"in e&&"function"==typeof e.focus&&e.focus()},100)}return e}},t.WfStep.styles=zt,Lt([gt({type:Number,attribute:"data-step"})],t.WfStep.prototype,"step",2),Lt([gt({type:Boolean,reflect:!0})],t.WfStep.prototype,"active",2),Lt([gt({type:String,reflect:!0})],t.WfStep.prototype,"direction",2),Lt([gt({type:Boolean,reflect:!0})],t.WfStep.prototype,"leaving",2),Lt([gt({type:String,attribute:"data-skip-if"})],t.WfStep.prototype,"skipIf",2),Lt([bt()],t.WfStep.prototype,"_fields",2),t.WfStep=Lt([ut("wf-step")],t.WfStep);const Tt=c`
390
+ :host {
391
+ display: block;
392
+ box-sizing: border-box;
393
+ }
394
+
395
+ :host([hidden]) {
396
+ display: none;
397
+ }
398
+
399
+ /* Width classes */
400
+ :host(.wf-layout--width-full) {
401
+ width: 100%;
402
+ }
403
+
404
+ :host(.wf-layout--width-auto) {
405
+ width: auto;
406
+ }
407
+
408
+ :host(.wf-layout--width-fit) {
409
+ width: fit-content;
410
+ }
411
+ `;var Dt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Mt=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?Ft(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&Dt(e,s,o),o};const Bt={none:0,xs:4,sm:8,md:16,lg:24,xl:32};t.WfLayout=class extends ct{constructor(){super(...arguments),this.mode="flex",this.direction="column",this.gap="none",this.gapX="",this.gapY="",this.align="stretch",this.justify="start",this.padding="none",this.paddingX="",this.paddingY="",this.wrap=!1,this.width="full",this.columns="auto",this.minItemWidth="200px"}_resolveSpacing(t){if(!t||"none"===t)return"0";if(t in Bt)return Bt[t]+"px";const e=parseFloat(t);return isNaN(e)?t:e+"px"}_getGapX(){return this._resolveSpacing(this.gapX||this.gap)}_getGapY(){return this._resolveSpacing(this.gapY||this.gap)}_getPadding(){const t=this._resolveSpacing(this.padding),e=this.paddingX?this._resolveSpacing(this.paddingX):t;return`${this.paddingY?this._resolveSpacing(this.paddingY):t} ${e}`}_buildStyles(){const t=[];if("grid"===this.mode){t.push("display: grid");const e=parseInt(this.columns,10);!isNaN(e)&&e>0?t.push(`grid-template-columns: repeat(${e}, 1fr)`):t.push(`grid-template-columns: repeat(auto-fit, minmax(${this.minItemWidth}, 1fr))`),"stretch"!==this.align&&t.push("align-items: "+this.align),"start"!==this.justify&&t.push("justify-content: "+this.justify)}else t.push("display: flex"),t.push("flex-direction: "+this.direction),this.wrap&&t.push("flex-wrap: wrap"),"stretch"!==this.align&&t.push("align-items: "+this.align),"start"!==this.justify&&t.push("justify-content: "+this.justify);const e=this._getGapX(),s=this._getGapY();"0"===e&&"0"===s||(t.push("column-gap: "+e),t.push("row-gap: "+s));const r=this._getPadding();return"0 0"!==r&&t.push("padding: "+r),t.join("; ")}_applyChildStyles(){if(!this._slot)return;const t=this._slot.assignedElements({flatten:!0});for(const e of t){const t=e,s=[],r=t.getAttribute("data-span");r&&s.push("grid-column: span "+r);const i=t.getAttribute("data-row-span");i&&s.push("grid-row: span "+i),t.hasAttribute("data-grow")&&s.push("flex-grow: 1"),t.hasAttribute("data-shrink")&&s.push("flex-shrink: 0");const o=t.getAttribute("data-align");o&&s.push("align-self: "+o);const a=t.getAttribute("data-order");if(a&&s.push("order: "+a),s.length>0){const e=t.style.cssText,r=s.join("; ");t.style.cssText=e?`${e}; ${r}`:r}}}_handleLayoutSlotChange(){this._applyChildStyles()}updated(t){super.updated(t),this.style.cssText=this._buildStyles(),this.classList.remove("wf-layout--width-full","wf-layout--width-auto","wf-layout--width-fit"),this.classList.add("wf-layout--width-"+this.width),this._applyChildStyles()}render(){return K`<slot @slotchange="${this._handleLayoutSlotChange}"></slot>`}},t.WfLayout.styles=Tt,Mt([gt({type:String})],t.WfLayout.prototype,"mode",2),Mt([gt({type:String})],t.WfLayout.prototype,"direction",2),Mt([gt({type:String})],t.WfLayout.prototype,"gap",2),Mt([gt({type:String,attribute:"gap-x"})],t.WfLayout.prototype,"gapX",2),Mt([gt({type:String,attribute:"gap-y"})],t.WfLayout.prototype,"gapY",2),Mt([gt({type:String})],t.WfLayout.prototype,"align",2),Mt([gt({type:String})],t.WfLayout.prototype,"justify",2),Mt([gt({type:String})],t.WfLayout.prototype,"padding",2),Mt([gt({type:String,attribute:"padding-x"})],t.WfLayout.prototype,"paddingX",2),Mt([gt({type:String,attribute:"padding-y"})],t.WfLayout.prototype,"paddingY",2),Mt([gt({type:Boolean})],t.WfLayout.prototype,"wrap",2),Mt([gt({type:String})],t.WfLayout.prototype,"width",2),Mt([gt({type:String})],t.WfLayout.prototype,"columns",2),Mt([gt({type:String,attribute:"min-item-width"})],t.WfLayout.prototype,"minItemWidth",2),Mt([wt("slot")],t.WfLayout.prototype,"_slot",2),t.WfLayout=Mt([ut("wf-layout")],t.WfLayout);const It=c`
412
+ :host {
413
+ display: grid;
414
+ box-sizing: border-box;
415
+ }
416
+
417
+ :host([hidden]) {
418
+ display: none;
419
+ }
420
+
421
+ /* Width classes inherited from WfLayout */
422
+ :host(.wf-layout--width-full) {
423
+ width: 100%;
424
+ }
425
+
426
+ :host(.wf-layout--width-auto) {
427
+ width: auto;
428
+ }
429
+
430
+ :host(.wf-layout--width-fit) {
431
+ width: fit-content;
432
+ }
433
+
434
+ /* Error wrapper for animated expand/collapse */
435
+ .wf-error-wrapper {
436
+ grid-column: 1 / -1;
437
+ order: 1000;
438
+ display: grid;
439
+ grid-template-rows: 0fr;
440
+ transition: grid-template-rows 200ms ease-out;
441
+ }
442
+
443
+ .wf-error-wrapper.wf-has-error {
444
+ grid-template-rows: 1fr;
445
+ }
446
+
447
+ .wf-error-message {
448
+ overflow: hidden;
449
+ min-height: 0;
450
+ font-size: var(--wf-font-size-sm, 0.875rem);
451
+ color: var(--wf-color-error, #dc3545);
452
+ opacity: 0;
453
+ transform: translateY(-4px);
454
+ transition: opacity 200ms ease-out, transform 200ms ease-out;
455
+ }
456
+
457
+ .wf-has-error .wf-error-message {
458
+ margin-top: var(--wf-spacing-2, 8px);
459
+ opacity: 1;
460
+ transform: translateY(0);
461
+ }
462
+
463
+ /* Slotted wf-other spans full width and appears after options */
464
+ ::slotted(wf-other) {
465
+ grid-column: 1 / -1;
466
+ order: 999;
467
+ }
468
+ `,jt=c`
469
+ :host {
470
+ display: block;
471
+ }
472
+
473
+ :host([hidden]) {
474
+ display: none;
475
+ }
476
+
477
+ .wf-other-container {
478
+ margin-top: var(--wf-spacing-4, 16px);
479
+ }
480
+
481
+ .wf-other-label {
482
+ display: block;
483
+ margin-bottom: var(--wf-spacing-2, 8px);
484
+ font-size: var(--wf-font-size-sm, 0.875rem);
485
+ font-weight: 500;
486
+ color: var(--wf-color-text, #0a0a0a);
487
+ }
488
+
489
+ .wf-other-label span {
490
+ font-weight: 400;
491
+ color: var(--wf-color-text-muted, #646464);
492
+ }
493
+
494
+ .wf-other-input-wrapper {
495
+ display: flex;
496
+ align-items: center;
497
+ gap: var(--wf-spacing-3, 12px);
498
+ min-height: var(--wf-input-min-height, 56px);
499
+ background: var(--wf-glass-bg, rgba(255, 255, 255, 0.7));
500
+ backdrop-filter: blur(var(--wf-glass-blur, 20px));
501
+ -webkit-backdrop-filter: blur(var(--wf-glass-blur, 20px));
502
+ border: 1px solid var(--wf-glass-border, rgba(0, 0, 0, 0.1));
503
+ border-radius: var(--wf-radius-md, 8px);
504
+ box-shadow: var(--wf-glass-shadow, 0 4px 6px rgba(0, 0, 0, 0.05));
505
+ padding-left: var(--wf-spacing-3, 12px);
506
+ transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
507
+ }
508
+
509
+ .wf-other-input-wrapper:focus-within {
510
+ border-color: var(--wf-color-primary, #8040f0);
511
+ box-shadow: 0 0 0 3px rgba(128, 64, 240, 0.1);
512
+ }
513
+
514
+ .wf-other-input {
515
+ flex: 1;
516
+ min-height: calc(var(--wf-input-min-height, 56px) - 2px);
517
+ padding: var(--wf-spacing-3, 12px);
518
+ padding-left: 0;
519
+ font-size: var(--wf-font-size-base, 1rem);
520
+ font-weight: 500;
521
+ color: var(--wf-color-text, #0a0a0a);
522
+ background: transparent;
523
+ border: none;
524
+ outline: none;
525
+ box-sizing: border-box;
526
+ }
527
+
528
+ .wf-other-input::placeholder {
529
+ color: var(--wf-color-text-muted, #646464);
530
+ font-weight: 500;
531
+ }
532
+
533
+ .wf-other-actions {
534
+ display: flex;
535
+ align-items: center;
536
+ justify-content: stretch;
537
+ }
538
+
539
+ /* Ensure slotted button fills the action column */
540
+ .wf-other-actions ::slotted(*) {
541
+ width: 100%;
542
+ }
543
+ `;var qt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Ut=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?Ht(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&qt(e,s,o),o};t.WfOther=class extends ct{constructor(){super(...arguments),this.label="Others, please specify:",this.placeholder="",this.required=!1,this.disabled=!1,this.shortcut="",this._value="",this._handleInput=t=>{const e=t.target;this._value=e.value,this._notifyChange()}}get value(){return this._value}set value(t){this._value=t}clear(){this._value="",this._notifyChange()}focusInput(){const t=this.shadowRoot?.querySelector(".wf-other-input");t?.focus()}_notifyChange(){this.dispatchEvent(new CustomEvent("wf-other-change",{detail:{value:this._value,name:this.name},bubbles:!0,composed:!0}))}render(){return K`
544
+ <div class="wf-other-container" data-testid="wf-other">
545
+ <label class="wf-other-label">
546
+ ${this.label}
547
+ ${this.labelHint?K`<span>${this.labelHint}</span>`:J}
548
+ </label>
549
+ <wf-layout mode="grid" columns="4" gap="md">
550
+ <div class="wf-other-input-wrapper" data-span="3">
551
+ ${this.shortcut?K`<wf-badge shortcut="${this.shortcut}"></wf-badge>`:J}
552
+ <input
553
+ type="text"
554
+ class="wf-other-input"
555
+ placeholder="${this.placeholder}"
556
+ .value="${this._value}"
557
+ ?disabled="${this.disabled}"
558
+ ?required="${this.required}"
559
+ @input="${this._handleInput}"
560
+ data-testid="wf-other-input"
561
+ />
562
+ </div>
563
+ <!-- Slot for action buttons (like wf-next-btn) -->
564
+ <div class="wf-other-actions">
565
+ <slot></slot>
566
+ </div>
567
+ </wf-layout>
568
+ </div>
569
+ `}},t.WfOther.styles=jt,Ut([gt({type:String})],t.WfOther.prototype,"label",2),Ut([gt({type:String,attribute:"label-hint"})],t.WfOther.prototype,"labelHint",2),Ut([gt({type:String})],t.WfOther.prototype,"placeholder",2),Ut([gt({type:String})],t.WfOther.prototype,"name",2),Ut([gt({type:Boolean})],t.WfOther.prototype,"required",2),Ut([gt({type:Boolean})],t.WfOther.prototype,"disabled",2),Ut([gt({type:String})],t.WfOther.prototype,"shortcut",2),Ut([bt()],t.WfOther.prototype,"_value",2),t.WfOther=Ut([ut("wf-other")],t.WfOther);var Vt=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,Yt=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?Rt(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&Vt(e,s,o),o};t.WfOptions=class extends t.WfLayout{constructor(){super(...arguments),this.mode="grid",this.gap="md",this.name="",this.multi=!1,this.required=!1,this.min=0,this.max=0,this.columns="2",this._selected=new Set,this._otherValue="",this._errorMessage="",this._validationActivated=!1,this._options=[],this._shortcutMap=new Map,this._composableOther=null,this._handleComposableOtherChange=t=>{t.stopPropagation(),this._otherValue=t.detail.value,this._otherValue.trim()&&this._selected.size>0&&(this._selected.clear(),this._updateOptionStates()),this._dispatchChange()},this._handleOptionSelect=t=>{if(t.detail.forwarded)return;t.stopPropagation();const{value:e}=t.detail;this._selectValue(e),this.multi||this.dispatchEvent(new CustomEvent("wf-option-select",{detail:{...t.detail,forwarded:!0},bubbles:!0,composed:!0}))},this._handleKeydown=t=>{const e=this.closest("wf-step");if(!e||!e.hasAttribute("active"))return;const s=t.composedPath()[0];if("INPUT"===s?.tagName||"TEXTAREA"===s?.tagName)return;const r=t.key.toUpperCase();if(1===r.length&&r>="A"&&r<="Z"){if(this._composableOther&&r===this._composableOther.shortcut)return t.preventDefault(),void this._composableOther.focusInput();const e=this._shortcutMap.get(r);e&&!e.disabled&&(t.preventDefault(),e.triggerSelect())}}}connectedCallback(){super.connectedCallback(),this._errorMessage="",this._validationActivated=!1,this.addEventListener("wf-option-select",this._handleOptionSelect),this.addEventListener("wf-other-change",this._handleComposableOtherChange),document.addEventListener("keydown",this._handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("wf-option-select",this._handleOptionSelect),this.removeEventListener("wf-other-change",this._handleComposableOtherChange),document.removeEventListener("keydown",this._handleKeydown)}firstUpdated(t){super.firstUpdated(t);const e=(this._defaultSlot?.assignedElements({flatten:!0})||[]).find(t=>"wf-other"===t.tagName.toLowerCase());this._composableOther=e||null,this._discoverOptions(),this.requestUpdate()}_hasComposableOther(){return null!==this._composableOther}updated(t){super.updated(t),(t.has("multi")||t.has("max"))&&this._updateOptionStates()}render(){return super.updated(new Map),this.setAttribute("role","listbox"),this.setAttribute("aria-multiselectable",this.multi+""),this.setAttribute("aria-required",this.required+""),K`
570
+ <slot @slotchange="${this._handleSlotChange}"></slot>
571
+ <div class="wf-error-wrapper ${this._errorMessage?"wf-has-error":""}">
572
+ <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
573
+ ${this._errorMessage||""}
574
+ </span>
575
+ </div>
576
+ `}_handleSlotChange(){const t=(this._defaultSlot?.assignedElements({flatten:!0})||[]).find(t=>"wf-other"===t.tagName.toLowerCase());this._composableOther=t||null,this._discoverOptions()}_discoverOptions(){const t=this._defaultSlot?.assignedElements({flatten:!0})||[];if(this._options=t.filter(t=>"wf-option"===t.tagName.toLowerCase()),this._shortcutMap.clear(),this._options.forEach((t,e)=>{if(e<26){const s=String.fromCharCode(65+e);t.shortcut=s,this._shortcutMap.set(s,t)}t.setSelected(this._selected.has(t.value))}),this._composableOther&&this._options.length<26){const t=String.fromCharCode(65+this._options.length);this._composableOther.shortcut=t}}_selectValue(t){this.multi?this._handleMultiSelect(t):this._handleSingleSelect(t),this._otherValue&&(this._otherValue="",this._composableOther&&this._composableOther.clear()),this._updateOptionStates(),this._validateSelection(),this._dispatchChange()}_handleSingleSelect(t){this._selected.clear(),this._selected.add(t)}_handleMultiSelect(t){if(this._selected.has(t))this._selected.delete(t);else{if(this.max>0&&this._selected.size>=this.max)return;this._selected.add(t)}}_updateOptionStates(){this._options.forEach(t=>{t.setSelected(this._selected.has(t.value))})}_checkValidation(){const t=this._hasComposableOther()&&this._otherValue.trim(),e=this._selected.size>0||t;if(this.required&&!e)return!1;if(this.multi){if(this.min>0&&this._selected.size<this.min&&!t)return!1;if(this.max>0&&this._selected.size>this.max)return!1}return!0}_validateSelection(){if(!this._validationActivated)return this._errorMessage="",this._checkValidation();this._errorMessage="";const t=this._hasComposableOther()&&this._otherValue.trim(),e=this._selected.size>0||t;if(this.required&&!e)return this._errorMessage=this._hasComposableOther()?"Please select an option or specify in the text field":"Please select an option",!1;if(this.multi){if(this.min>0&&this._selected.size<this.min&&!t)return this._errorMessage=`Please select at least ${this.min} option${this.min>1?"s":""}`,!1;if(this.max>0&&this._selected.size>this.max)return this._errorMessage=`Please select at most ${this.max} option${this.max>1?"s":""}`,!1}return!0}_dispatchChange(){const t=Array.from(this._selected),e={name:this.name,value:this.value,selected:t};this.dispatchEvent(new CustomEvent("wf-change",{detail:e,bubbles:!0,composed:!0}))}get value(){if(this._hasComposableOther()&&this._otherValue.trim()&&0===this._selected.size)return this.multi?[this._otherValue]:this._otherValue;const t=Array.from(this._selected);return this.multi?t:t[0]??""}set value(t){this._selected.clear(),Array.isArray(t)?t.forEach(t=>this._selected.add(t)):t&&this._selected.add(t),this._updateOptionStates(),this._validateSelection()}getSelected(){return Array.from(this._selected)}isSelected(t){return this._selected.has(t)}select(t){this._selectValue(t)}deselect(t){this._selected.has(t)&&(this._selected.delete(t),this._updateOptionStates(),this._validateSelection(),this._dispatchChange())}clear(){this._selected.clear(),this._updateOptionStates(),this._validateSelection(),this._dispatchChange()}validate(){return this._validationActivated=!0,this._validateSelection()}get isValid(){return this._checkValidation()}showError(t){this._errorMessage=t}clearError(){this._errorMessage=""}focus(){this._options[0]?.focus()}reset(){this._selected.clear(),this._otherValue="",this._errorMessage="",this._validationActivated=!1,this._composableOther&&this._composableOther.clear(),this._options.forEach(t=>{t.hasAttribute("selected")&&this._selected.add(t.value),t.setSelected(this._selected.has(t.value))}),this._dispatchChange()}},t.WfOptions.styles=[t.WfLayout.styles,It],Yt([wt("slot:not([name])")],t.WfOptions.prototype,"_defaultSlot",2),Yt([gt({type:String})],t.WfOptions.prototype,"mode",2),Yt([gt({type:String})],t.WfOptions.prototype,"gap",2),Yt([gt({type:String})],t.WfOptions.prototype,"name",2),Yt([gt({type:Boolean})],t.WfOptions.prototype,"multi",2),Yt([gt({type:Boolean})],t.WfOptions.prototype,"required",2),Yt([gt({type:Number})],t.WfOptions.prototype,"min",2),Yt([gt({type:Number})],t.WfOptions.prototype,"max",2),Yt([gt({type:String,reflect:!0})],t.WfOptions.prototype,"columns",2),Yt([bt()],t.WfOptions.prototype,"_selected",2),Yt([bt()],t.WfOptions.prototype,"_otherValue",2),Yt([bt()],t.WfOptions.prototype,"_errorMessage",2),t.WfOptions=Yt([ut("wf-options")],t.WfOptions);const Kt=c`
577
+ :host {
578
+ display: block;
579
+ }
580
+
581
+ :host([hidden]) {
582
+ display: none;
583
+ }
584
+
585
+ .wf-option-card {
586
+ display: flex;
587
+ align-items: center;
588
+ gap: var(--wf-spacing-3, 12px);
589
+ width: 100%;
590
+ min-height: var(--wf-input-min-height, 56px);
591
+ padding: var(--wf-spacing-3, 12px);
592
+ background: var(--wf-glass-bg, rgba(255, 255, 255, 0.7));
593
+ backdrop-filter: blur(var(--wf-glass-blur, 20px));
594
+ -webkit-backdrop-filter: blur(var(--wf-glass-blur, 20px));
595
+ border: 1px solid var(--wf-glass-border, rgba(0, 0, 0, 0.1));
596
+ border-radius: var(--wf-radius-md, 8px);
597
+ box-shadow: var(--wf-glass-shadow, 0 4px 6px rgba(0, 0, 0, 0.05));
598
+ cursor: pointer;
599
+ text-align: left;
600
+ font-family: inherit;
601
+ font-size: var(--wf-font-size-base, 1rem);
602
+ font-weight: 500;
603
+ color: var(--wf-color-text, #0a0a0a);
604
+ transition: border-color 150ms ease, background 150ms ease, transform 100ms ease;
605
+ outline: none;
606
+ box-sizing: border-box;
607
+ }
608
+
609
+ .wf-option-card:hover:not(:disabled) {
610
+ border-color: var(--wf-color-primary, #8040f0);
611
+ background: var(--wf-glass-bg-hover, rgba(255, 255, 255, 0.85));
612
+ }
613
+
614
+ .wf-option-card:focus-visible {
615
+ border-color: var(--wf-color-primary, #8040f0);
616
+ box-shadow: 0 0 0 3px rgba(128, 64, 240, 0.2);
617
+ }
618
+
619
+ .wf-option-card[aria-selected='true'] {
620
+ border-color: var(--wf-color-primary, #8040f0);
621
+ background-color: var(--wf-color-primary-light, rgba(128, 64, 240, 0.1));
622
+ }
623
+
624
+ .wf-option-card:disabled {
625
+ opacity: 0.5;
626
+ cursor: not-allowed;
627
+ }
628
+
629
+ .wf-option-card:active:not(:disabled) {
630
+ transform: scale(0.98);
631
+ }
632
+
633
+ .wf-option-card.selecting {
634
+ animation: wf-blink 0.3s ease;
635
+ }
636
+
637
+ @keyframes wf-blink {
638
+ 0%, 100% {
639
+ opacity: 1;
640
+ }
641
+ 50% {
642
+ opacity: 0.5;
643
+ }
644
+ }
645
+
646
+ .wf-option-content {
647
+ flex: 1;
648
+ min-width: 0;
649
+ }
650
+
651
+ /* Slotted content styling */
652
+ ::slotted(strong),
653
+ ::slotted(h3),
654
+ ::slotted(h4) {
655
+ display: block;
656
+ font-weight: 600;
657
+ margin: 0;
658
+ }
659
+
660
+ ::slotted(span),
661
+ ::slotted(p) {
662
+ display: block;
663
+ font-size: var(--wf-font-size-sm, 0.875rem);
664
+ color: var(--wf-color-text-muted, #646464);
665
+ margin: 4px 0 0 0;
666
+ }
667
+ `;var Xt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,Gt=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?Jt(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&Xt(e,s,o),o};t.WfOption=class extends ct{constructor(){super(...arguments),this.value="",this.selected=!1,this.disabled=!1,this.shortcut="",this._selecting=!1}render(){return K`
83
668
  <button
84
669
  class="wf-option-card ${this._selecting?"selecting":""}"
85
670
  role="option"
@@ -88,39 +673,193 @@
88
673
  data-testid="wf-option-btn"
89
674
  @click="${this._handleClick}"
90
675
  >
91
- ${this.shortcut?Y`<wf-badge
676
+ ${this.shortcut?K`<wf-badge
92
677
  shortcut="${this.shortcut}"
93
678
  variant="${this.selected?"selected":"default"}"
94
- ></wf-badge>`:X}
679
+ ></wf-badge>`:J}
95
680
  <div class="wf-option-content">
96
- ${this._cachedContent}
681
+ <slot></slot>
97
682
  </div>
98
683
  </button>
99
- `}_handleClick(t){this.disabled?t.preventDefault():this._triggerSelect()}triggerSelect(){this.disabled||this._triggerSelect()}_triggerSelect(){this._selecting=!0;const t={value:this.value,selected:!this.selected};this.dispatchEvent(new CustomEvent("wf-option-select",{detail:t,bubbles:!0,composed:!0})),setTimeout(()=>{this._selecting=!1},300)}focus(){const t=this.querySelector("button");t?.focus()}setSelected(t){this.selected=t}},Lt([mt({type:String})],t.WfOption.prototype,"value",2),Lt([mt({type:Boolean,reflect:!0})],t.WfOption.prototype,"selected",2),Lt([mt({type:Boolean,reflect:!0})],t.WfOption.prototype,"disabled",2),Lt([mt({type:String})],t.WfOption.prototype,"shortcut",2),Lt([wt()],t.WfOption.prototype,"_selecting",2),t.WfOption=Lt([pt("wf-option")],t.WfOption);var Nt=Object.defineProperty,It=(t,e,r,s)=>{for(var i,o=void 0,a=t.length-1;a>=0;a--)(i=t[a])&&(o=i(e,r,o)||o);return o&&Nt(e,r,o),o};class qt extends ht{constructor(){super(...arguments),this.name="",this.label="",this.required=!1,this.hint="",this._errorMessage="",this._value="",this._validationActivated=!1,this._debounceTimer=null,this._validators=[],this._handleInput=t=>{const e=t.target;this._value=e.value,this._validationActivated&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.validate()},this._getDebounceMs())),this.dispatchEvent(new CustomEvent("wf-change",{detail:{name:this.name,value:this._value},bubbles:!0,composed:!0}))},this._handleBlur=()=>{this.dispatchEvent(new CustomEvent("wf-blur",{detail:{name:this.name,value:this._value},bubbles:!0,composed:!0}))},this._handleFocus=()=>{this.dispatchEvent(new CustomEvent("wf-focus",{detail:{name:this.name},bubbles:!0,composed:!0}))}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._setupValidators()}updated(t){this._getValidationTriggerProperties().some(e=>t.has(e))&&this._setupValidators()}_getDebounceMs(){return 600}_getFocusableSelector(){return"input"}get value(){return this._value}set value(t){this._value=t}addValidator(t){this._validators.push(t)}async validate(){this._validationActivated=!0;const t=this.value;for(const r of this._validators)try{const e=await r.validate(t);if(!e.valid)return this._errorMessage=e.error??r.message??"Validation failed",!1}catch(e){return this._errorMessage="Validation error occurred",!1}return this._errorMessage="",!0}get isValid(){const t=this.value;for(const e of this._validators){const r=e.validate(t);if(!(r instanceof Promise||r.valid))return!1}return!0}showError(t){this._errorMessage=t}clearError(){this._errorMessage=""}focus(){const t=this.querySelector(this._getFocusableSelector());t?.focus()}reset(){this._value="",this._errorMessage="",this._validationActivated=!1,this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}}It([mt({type:String})],qt.prototype,"name"),It([mt({type:String})],qt.prototype,"label"),It([mt({type:Boolean})],qt.prototype,"required"),It([mt({type:String})],qt.prototype,"hint"),It([wt()],qt.prototype,"_errorMessage"),It([wt()],qt.prototype,"_value");const jt=["gmail.com","yahoo.com","hotmail.com","outlook.com","aol.com","icloud.com","mail.com","protonmail.com","zoho.com","yandex.com","live.com","msn.com","me.com","inbox.com","gmx.com"];class Rt{constructor(t){this._validators=new Map,this.host=t,t.addController(this)}hostConnected(){}hostDisconnected(){this._validators.clear()}addValidator(t,e){const r=this._validators.get(t)??[];this._validators.set(t,[...r,e])}addValidators(t,e){e.forEach(e=>this.addValidator(t,e))}removeValidator(t,e){const r=this._validators.get(t)??[];this._validators.set(t,r.filter(t=>t.name!==e))}clearValidators(t){this._validators.delete(t)}getValidators(t){return this._validators.get(t)??[]}async validate(t,e){const r=this.getValidators(t);for(const i of r)try{const t=await i.validate(e);if(!t.valid)return{valid:!1,error:t.error??i.message??"Validation failed"}}catch(s){return{valid:!1,error:"Validation error occurred"}}return{valid:!0}}validateSync(t,e){const r=this.getValidators(t);for(const s of r){const t=s.validate(e);if(!(t instanceof Promise||t.valid))return{valid:!1,error:t.error??s.message??"Validation failed"}}return{valid:!0}}static required(t="This field is required"){return{name:"required",message:t,validate:e=>null==e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length?{valid:!1,error:t}:{valid:!0}}}static email(t="Please enter a valid email address"){const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return{name:"email",message:t,validate:r=>"string"!=typeof r||""===r.trim()||e.test(r)?{valid:!0}:{valid:!1,error:t}}}static workEmail(t=jt,e="Please use your work email address"){return{name:"workEmail",message:e,validate:r=>{if("string"!=typeof r||""===r.trim())return{valid:!0};const s=r.split("@")[1]?.toLowerCase();return s&&t.includes(s)?{valid:!1,error:e}:{valid:!0}}}}static pattern(t,e="Invalid format"){return{name:"pattern",message:e,validate:r=>"string"!=typeof r||""===r.trim()||t.test(r)?{valid:!0}:{valid:!1,error:e}}}static minLength(t,e){const r=e??`Minimum ${t} characters required`;return{name:"minLength",message:r,validate:e=>"string"!=typeof e?{valid:!0}:e.length<t?{valid:!1,error:r}:{valid:!0}}}static maxLength(t,e){const r=e??`Maximum ${t} characters allowed`;return{name:"maxLength",message:r,validate:e=>"string"!=typeof e?{valid:!0}:e.length>t?{valid:!1,error:r}:{valid:!0}}}static minSelections(t,e){const r=e??`Select at least ${t} option${t>1?"s":""}`;return{name:"minSelections",message:r,validate:e=>Array.isArray(e)&&e.length<t?{valid:!1,error:r}:{valid:!0}}}static maxSelections(t,e){const r=e??`Select at most ${t} option${t>1?"s":""}`;return{name:"maxSelections",message:r,validate:e=>Array.isArray(e)&&e.length>t?{valid:!1,error:r}:{valid:!0}}}static custom(t,e,r){return{name:t,message:r,validate:e}}}var Vt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Ut=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Ht(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Vt(e,r,o),o};t.WfField=class extends qt{constructor(){super(...arguments),this._inputElement=null}connectedCallback(){super.connectedCallback(),this.addEventListener("input",this._handleInput),this.addEventListener("blur",this._handleBlur,!0),this.addEventListener("focus",this._handleFocus,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("input",this._handleInput),this.removeEventListener("blur",this._handleBlur,!0),this.removeEventListener("focus",this._handleFocus,!0)}firstUpdated(){this._discoverInput(),this._setupValidators()}_getValidationTriggerProperties(){return["required"]}_getDebounceMs(){return 300}_setupValidators(){if(!this._inputElement)return;if(this._validators=[],(this.required||this._inputElement.hasAttribute("required"))&&this._validators.push(Rt.required()),"email"===this._inputElement.getAttribute("type")&&this._validators.push(Rt.email()),this._inputElement.hasAttribute("data-work-email")){const t=this._inputElement.getAttribute("data-blocked-domains"),e=t?t.split(",").map(t=>t.trim()):void 0;this._validators.push(Rt.workEmail(e))}const t=this._inputElement.getAttribute("pattern");if(t){const e=this._inputElement.getAttribute("data-pattern-message")||"Invalid format";this._validators.push(Rt.pattern(RegExp(t),e))}const e=this._inputElement.getAttribute("minlength");e&&this._validators.push(Rt.minLength(parseInt(e,10)));const r=this._inputElement.getAttribute("maxlength");r&&this._validators.push(Rt.maxLength(parseInt(r,10)))}_handleSlotChange(){this._discoverInput(),this._setupValidators()}_discoverInput(){const t=this.shadowRoot?.querySelector("slot");if(!t)return;const e=t.assignedElements({flatten:!0});for(const r of e)if(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){this._inputElement=r,r.id||(r.id=this.name),r.name||(r.name=this.name),this._value=r.value;break}}get value(){return this._inputElement?.value??this._value}set value(t){this._value=t,this._inputElement&&(this._inputElement.value=(t??"")+"")}focus(){this._inputElement?.focus()}reset(){super.reset(),this._inputElement&&(this._inputElement.value="")}render(){return Y`
100
- <div class="wf-field-container">
101
- ${this.label?Y`<label
102
- class="wf-label ${this.required?"wf-label-required":""}"
103
- for="${this.name}"
104
- >
105
- ${this.label}
106
- </label>`:""}
107
- <div class="wf-input-wrapper">
108
- <slot @slotchange="${this._handleSlotChange}"></slot>
109
- </div>
110
- ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
111
- <span class="wf-error-message" role="alert" aria-live="polite">
112
- ${this._errorMessage}
113
- </span>
114
- </div>
115
- `}},Ut([wt()],t.WfField.prototype,"_inputElement",2),t.WfField=Ut([pt("wf-field")],t.WfField);var Bt=Object.defineProperty,Yt=Object.getOwnPropertyDescriptor,Kt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Yt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Bt(e,r,o),o};t.WfEmail=class extends qt{constructor(){super(...arguments),this.placeholder="you@company.com",this.workEmail=!1,this.blockedDomains="",this.workEmailMessage="Please use your work email address",this.disabled=!1}_getValidationTriggerProperties(){return["required","workEmail","blockedDomains"]}_getDebounceMs(){return 300}_setupValidators(){if(this._validators=[],this.required&&this._validators.push(Rt.required()),this._validators.push(Rt.email()),this.workEmail){let t=jt;this.blockedDomains&&(t=this.blockedDomains.split(",").map(t=>t.trim().toLowerCase())),this._validators.push(Rt.workEmail(t,this.workEmailMessage))}}render(){return Y`
684
+ `}_handleClick(t){this.disabled?t.preventDefault():this._triggerSelect()}triggerSelect(){this.disabled||this._triggerSelect()}_triggerSelect(){this._selecting=!0;const t={value:this.value,selected:!this.selected};this.dispatchEvent(new CustomEvent("wf-option-select",{detail:t,bubbles:!0,composed:!0})),setTimeout(()=>{this._selecting=!1},300)}focus(){const t=this.shadowRoot?.querySelector("button");t?.focus()}setSelected(t){this.selected=t}},t.WfOption.styles=Kt,Gt([gt({type:String})],t.WfOption.prototype,"value",2),Gt([gt({type:Boolean,reflect:!0})],t.WfOption.prototype,"selected",2),Gt([gt({type:Boolean,reflect:!0})],t.WfOption.prototype,"disabled",2),Gt([gt({type:String})],t.WfOption.prototype,"shortcut",2),Gt([bt()],t.WfOption.prototype,"_selecting",2),t.WfOption=Gt([ut("wf-option")],t.WfOption);const Zt=c`
685
+ :host {
686
+ display: block;
687
+ }
688
+
689
+ :host([hidden]) {
690
+ display: none;
691
+ }
692
+
693
+ .wf-field-container {
694
+ display: flex;
695
+ flex-direction: column;
696
+ }
697
+
698
+ .wf-label {
699
+ font-size: var(--wf-font-size-sm, 0.875rem);
700
+ font-weight: 500;
701
+ color: var(--wf-color-text, #0a0a0a);
702
+ margin-bottom: var(--wf-spacing-2, 8px);
703
+ }
704
+
705
+ .wf-label-required::after {
706
+ content: ' *';
707
+ color: var(--wf-color-error, #dc3545);
708
+ }
709
+
710
+ /* Error wrapper for animated expand/collapse */
711
+ .wf-error-wrapper {
712
+ display: grid;
713
+ grid-template-rows: 0fr;
714
+ transition: grid-template-rows 200ms ease-out;
715
+ }
716
+
717
+ .wf-error-wrapper.wf-has-error {
718
+ grid-template-rows: 1fr;
719
+ }
720
+
721
+ .wf-error-message {
722
+ overflow: hidden;
723
+ min-height: 0;
724
+ font-size: var(--wf-font-size-sm, 0.875rem);
725
+ color: var(--wf-color-error, #dc3545);
726
+ opacity: 0;
727
+ transform: translateY(-4px);
728
+ transition: opacity 200ms ease-out, transform 200ms ease-out;
729
+ }
730
+
731
+ .wf-has-error .wf-error-message {
732
+ margin-top: var(--wf-spacing-2, 8px);
733
+ opacity: 1;
734
+ transform: translateY(0);
735
+ }
736
+
737
+ .wf-hint {
738
+ font-size: var(--wf-font-size-sm, 0.875rem);
739
+ color: var(--wf-color-text-muted, #646464);
740
+ margin-top: var(--wf-spacing-2, 8px);
741
+ }
742
+
743
+ .wf-input {
744
+ width: 100%;
745
+ min-height: var(--wf-input-min-height, 56px);
746
+ padding: var(--wf-spacing-4, 16px);
747
+ font-size: var(--wf-font-size-base, 1rem);
748
+ font-weight: 400;
749
+ font-family: inherit;
750
+ background: var(--wf-glass-bg, rgba(255, 255, 255, 0.7));
751
+ backdrop-filter: blur(var(--wf-glass-blur, 20px));
752
+ -webkit-backdrop-filter: blur(var(--wf-glass-blur, 20px));
753
+ border: 1px solid var(--wf-glass-border, rgba(0, 0, 0, 0.1));
754
+ border-radius: var(--wf-radius-md, 8px);
755
+ box-shadow: var(--wf-glass-shadow, 0 4px 6px rgba(0, 0, 0, 0.05));
756
+ color: var(--wf-color-text, #0a0a0a);
757
+ transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
758
+ outline: none;
759
+ box-sizing: border-box;
760
+ }
761
+
762
+ .wf-input::placeholder {
763
+ color: var(--wf-color-text-muted, #646464);
764
+ font-weight: 500;
765
+ }
766
+
767
+ .wf-input:focus {
768
+ border-color: var(--wf-color-primary, #8040f0);
769
+ box-shadow: 0 0 0 3px rgba(128, 64, 240, 0.2);
770
+ }
771
+
772
+ .wf-input:disabled {
773
+ opacity: 0.5;
774
+ cursor: not-allowed;
775
+ }
776
+
777
+ .wf-input.wf-input-error {
778
+ border-color: var(--wf-color-error, #dc3545);
779
+ }
780
+
781
+ .wf-input.wf-input-error:focus {
782
+ box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
783
+ }
784
+
785
+ /* Textarea-specific styles */
786
+ .wf-textarea {
787
+ width: 100%;
788
+ padding: var(--wf-spacing-4, 16px);
789
+ font-size: var(--wf-font-size-base, 1rem);
790
+ font-family: inherit;
791
+ background: var(--wf-glass-bg, rgba(255, 255, 255, 0.7));
792
+ backdrop-filter: blur(var(--wf-glass-blur, 20px));
793
+ -webkit-backdrop-filter: blur(var(--wf-glass-blur, 20px));
794
+ border: 1px solid var(--wf-glass-border, rgba(0, 0, 0, 0.1));
795
+ border-radius: var(--wf-radius-lg, 12px);
796
+ box-shadow: var(--wf-glass-shadow, 0 4px 6px rgba(0, 0, 0, 0.05));
797
+ color: var(--wf-color-text, #212529);
798
+ transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
799
+ outline: none;
800
+ box-sizing: border-box;
801
+ resize: vertical;
802
+ min-height: 100px;
803
+ }
804
+
805
+ .wf-textarea::placeholder {
806
+ color: var(--wf-color-text-muted, #6c757d);
807
+ }
808
+
809
+ .wf-textarea:focus {
810
+ border-color: var(--wf-color-primary, #8b5cf6);
811
+ box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
812
+ }
813
+
814
+ .wf-textarea:disabled {
815
+ opacity: 0.5;
816
+ cursor: not-allowed;
817
+ }
818
+
819
+ .wf-textarea.wf-textarea-error {
820
+ border-color: var(--wf-color-error, #dc3545);
821
+ }
822
+
823
+ .wf-textarea.wf-textarea-error:focus {
824
+ box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
825
+ }
826
+
827
+ .wf-char-count {
828
+ font-size: var(--wf-font-size-sm, 0.875rem);
829
+ color: var(--wf-color-text-muted, #6c757d);
830
+ text-align: right;
831
+ }
832
+
833
+ .wf-char-count.wf-char-limit {
834
+ color: var(--wf-color-error, #dc3545);
835
+ }
836
+
837
+ /* wf-field slotted input styles */
838
+ .wf-input-wrapper {
839
+ position: relative;
840
+ }
841
+
842
+ /* Number input - hide spinners */
843
+ .wf-input::-webkit-outer-spin-button,
844
+ .wf-input::-webkit-inner-spin-button {
845
+ -webkit-appearance: none;
846
+ margin: 0;
847
+ }
848
+
849
+ .wf-input[type='number'] {
850
+ -moz-appearance: textfield;
851
+ }
852
+ `;var Qt=Object.defineProperty,te=(t,e,s,r)=>{for(var i,o=void 0,a=t.length-1;a>=0;a--)(i=t[a])&&(o=i(e,s,o)||o);return o&&Qt(e,s,o),o};const ee=class extends ct{constructor(){super(...arguments),this.name="",this.label="",this.required=!1,this.hint="",this._errorMessage="",this._value="",this._validationActivated=!1,this._debounceTimer=null,this._validators=[],this._handleInput=t=>{const e=t.target;this._value=e.value,this._validationActivated&&(this._debounceTimer&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this.validate()},this._getDebounceMs())),this.dispatchEvent(new CustomEvent("wf-change",{detail:{name:this.name,value:this._value},bubbles:!0,composed:!0}))},this._handleBlur=()=>{this.dispatchEvent(new CustomEvent("wf-blur",{detail:{name:this.name,value:this._value},bubbles:!0,composed:!0}))},this._handleFocus=()=>{this.dispatchEvent(new CustomEvent("wf-focus",{detail:{name:this.name},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this._setupValidators()}updated(t){this._getValidationTriggerProperties().some(e=>t.has(e))&&this._setupValidators()}_getDebounceMs(){return 600}_getFocusableSelector(){return"input"}_renderLabel(){return this.label?K`<label
853
+ class="wf-label ${this.required?"wf-label-required":""}"
854
+ for="${this.name}"
855
+ data-testid="wf-label"
856
+ >${this.label}</label>`:J}_renderHint(){return!this.hint||this._errorMessage?J:K`<span class="wf-hint">${this.hint}</span>`}_renderError(){return K`<div class="wf-error-wrapper ${this._errorMessage?"wf-has-error":""}">
857
+ <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
858
+ ${this._errorMessage||""}
859
+ </span>
860
+ </div>`}get value(){return this._value}set value(t){this._value=t}addValidator(t){this._validators.push(t)}async validate(){this._validationActivated=!0;const t=this.value;for(const s of this._validators)try{const e=await s.validate(t);if(!e.valid)return this._errorMessage=e.error??s.message??"Validation failed",!1}catch(e){return this._errorMessage="Validation error occurred",!1}return this._errorMessage="",!0}get isValid(){const t=this.value;for(const e of this._validators){const s=e.validate(t);if(!(s instanceof Promise||s.valid))return!1}return!0}showError(t){this._errorMessage=t}clearError(){this._errorMessage=""}focus(){const t=this.shadowRoot?.querySelector(this._getFocusableSelector());t?.focus()}reset(){this._value="",this._errorMessage="",this._validationActivated=!1,this._debounceTimer&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}};ee.styles=Zt;let se=ee;te([gt({type:String})],se.prototype,"name"),te([gt({type:String})],se.prototype,"label"),te([gt({type:Boolean})],se.prototype,"required"),te([gt({type:String})],se.prototype,"hint"),te([bt()],se.prototype,"_errorMessage"),te([bt()],se.prototype,"_value");const re=["gmail.com","yahoo.com","hotmail.com","outlook.com","aol.com","icloud.com","mail.com","protonmail.com","zoho.com","yandex.com","live.com","msn.com","me.com","inbox.com","gmx.com"];class ie{constructor(t){this._validators=new Map,this.host=t,t.addController(this)}hostConnected(){}hostDisconnected(){this._validators.clear()}addValidator(t,e){const s=this._validators.get(t)??[];this._validators.set(t,[...s,e])}addValidators(t,e){e.forEach(e=>this.addValidator(t,e))}removeValidator(t,e){const s=this._validators.get(t)??[];this._validators.set(t,s.filter(t=>t.name!==e))}clearValidators(t){this._validators.delete(t)}getValidators(t){return this._validators.get(t)??[]}async validate(t,e){const s=this.getValidators(t);for(const i of s)try{const t=await i.validate(e);if(!t.valid)return{valid:!1,error:t.error??i.message??"Validation failed"}}catch(r){return{valid:!1,error:"Validation error occurred"}}return{valid:!0}}validateSync(t,e){const s=this.getValidators(t);for(const r of s){const t=r.validate(e);if(!(t instanceof Promise||t.valid))return{valid:!1,error:t.error??r.message??"Validation failed"}}return{valid:!0}}static required(t="This field is required"){return{name:"required",message:t,validate:e=>null==e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length?{valid:!1,error:t}:{valid:!0}}}static email(t="Please enter a valid email address"){const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return{name:"email",message:t,validate:s=>"string"!=typeof s||""===s.trim()||e.test(s)?{valid:!0}:{valid:!1,error:t}}}static workEmail(t=re,e="Please use your work email address"){return{name:"workEmail",message:e,validate:s=>{if("string"!=typeof s||""===s.trim())return{valid:!0};const r=s.split("@")[1]?.toLowerCase();return r&&t.includes(r)?{valid:!1,error:e}:{valid:!0}}}}static pattern(t,e="Invalid format"){return{name:"pattern",message:e,validate:s=>"string"!=typeof s||""===s.trim()||t.test(s)?{valid:!0}:{valid:!1,error:e}}}static minLength(t,e){const s=e??`Minimum ${t} characters required`;return{name:"minLength",message:s,validate:e=>"string"!=typeof e?{valid:!0}:e.length<t?{valid:!1,error:s}:{valid:!0}}}static maxLength(t,e){const s=e??`Maximum ${t} characters allowed`;return{name:"maxLength",message:s,validate:e=>"string"!=typeof e?{valid:!0}:e.length>t?{valid:!1,error:s}:{valid:!0}}}static minSelections(t,e){const s=e??`Select at least ${t} option${t>1?"s":""}`;return{name:"minSelections",message:s,validate:e=>Array.isArray(e)&&e.length<t?{valid:!1,error:s}:{valid:!0}}}static maxSelections(t,e){const s=e??`Select at most ${t} option${t>1?"s":""}`;return{name:"maxSelections",message:s,validate:e=>Array.isArray(e)&&e.length>t?{valid:!1,error:s}:{valid:!0}}}static custom(t,e,s){return{name:t,message:s,validate:e}}}var oe=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,ne=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?ae(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&oe(e,s,o),o};t.WfEmail=class extends se{constructor(){super(...arguments),this.placeholder="you@company.com",this.workEmail=!1,this.blockedDomains="",this.workEmailMessage="Please use your work email address",this.disabled=!1}_getValidationTriggerProperties(){return["required","workEmail","blockedDomains"]}_getDebounceMs(){return 300}_setupValidators(){if(this._validators=[],this.required&&this._validators.push(ie.required()),this._validators.push(ie.email()),this.workEmail){let t=re;this.blockedDomains&&(t=this.blockedDomains.split(",").map(t=>t.trim().toLowerCase())),this._validators.push(ie.workEmail(t,this.workEmailMessage))}}render(){return K`
116
861
  <div class="wf-field-container">
117
- ${this.label?Y`<label
118
- class="wf-label ${this.required?"wf-label-required":""}"
119
- for="${this.name}"
120
- data-testid="wf-label"
121
- >
122
- ${this.label}
123
- </label>`:""}
862
+ ${this._renderLabel()}
124
863
  <input
125
864
  type="email"
126
865
  class="wf-input ${this._errorMessage?"wf-input-error":""}"
@@ -135,20 +874,12 @@
135
874
  @blur="${this._handleBlur}"
136
875
  @focus="${this._handleFocus}"
137
876
  />
138
- ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
139
- <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
140
- ${this._errorMessage}
141
- </span>
877
+ ${this._renderHint()}
878
+ ${this._renderError()}
142
879
  </div>
143
- `}},Kt([mt({type:String})],t.WfEmail.prototype,"placeholder",2),Kt([mt({type:Boolean,attribute:"work-email"})],t.WfEmail.prototype,"workEmail",2),Kt([mt({type:String,attribute:"blocked-domains"})],t.WfEmail.prototype,"blockedDomains",2),Kt([mt({type:String,attribute:"work-email-message"})],t.WfEmail.prototype,"workEmailMessage",2),Kt([mt({type:Boolean})],t.WfEmail.prototype,"disabled",2),t.WfEmail=Kt([pt("wf-email")],t.WfEmail);var Xt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,Gt=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Jt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Xt(e,r,o),o};t.WfInput=class extends qt{constructor(){super(...arguments),this.placeholder="",this.type="text",this.patternMessage="Invalid format",this.disabled=!1,this.autocomplete=""}_getValidationTriggerProperties(){return["required","minlength","maxlength","pattern"]}_setupValidators(){this._validators=[],this.required&&this._validators.push(Rt.required()),void 0!==this.minlength&&this._validators.push(Rt.minLength(this.minlength)),void 0!==this.maxlength&&this._validators.push(Rt.maxLength(this.maxlength)),this.pattern&&this._validators.push(Rt.pattern(RegExp(this.pattern),this.patternMessage))}render(){return Y`
880
+ `}},ne([gt({type:String})],t.WfEmail.prototype,"placeholder",2),ne([gt({type:Boolean,attribute:"work-email"})],t.WfEmail.prototype,"workEmail",2),ne([gt({type:String,attribute:"blocked-domains"})],t.WfEmail.prototype,"blockedDomains",2),ne([gt({type:String,attribute:"work-email-message"})],t.WfEmail.prototype,"workEmailMessage",2),ne([gt({type:Boolean})],t.WfEmail.prototype,"disabled",2),t.WfEmail=ne([ut("wf-email")],t.WfEmail);var le=Object.defineProperty,de=Object.getOwnPropertyDescriptor,he=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?de(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&le(e,s,o),o};t.WfInput=class extends se{constructor(){super(...arguments),this.placeholder="",this.type="text",this.patternMessage="Invalid format",this.disabled=!1,this.autocomplete=""}_getValidationTriggerProperties(){return["required","minlength","maxlength","pattern"]}_setupValidators(){this._validators=[],this.required&&this._validators.push(ie.required()),void 0!==this.minlength&&this._validators.push(ie.minLength(this.minlength)),void 0!==this.maxlength&&this._validators.push(ie.maxLength(this.maxlength)),this.pattern&&this._validators.push(ie.pattern(RegExp(this.pattern),this.patternMessage))}render(){return K`
144
881
  <div class="wf-field-container">
145
- ${this.label?Y`<label
146
- class="wf-label ${this.required?"wf-label-required":""}"
147
- for="${this.name}"
148
- data-testid="wf-label"
149
- >
150
- ${this.label}
151
- </label>`:""}
882
+ ${this._renderLabel()}
152
883
  <input
153
884
  type="${this.type}"
154
885
  class="wf-input ${this._errorMessage?"wf-input-error":""}"
@@ -164,20 +895,12 @@
164
895
  @blur="${this._handleBlur}"
165
896
  @focus="${this._handleFocus}"
166
897
  />
167
- ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
168
- <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
169
- ${this._errorMessage}
170
- </span>
898
+ ${this._renderHint()}
899
+ ${this._renderError()}
171
900
  </div>
172
- `}},Gt([mt({type:String})],t.WfInput.prototype,"placeholder",2),Gt([mt({type:String})],t.WfInput.prototype,"type",2),Gt([mt({type:Number})],t.WfInput.prototype,"minlength",2),Gt([mt({type:Number})],t.WfInput.prototype,"maxlength",2),Gt([mt({type:String})],t.WfInput.prototype,"pattern",2),Gt([mt({type:String,attribute:"pattern-message"})],t.WfInput.prototype,"patternMessage",2),Gt([mt({type:Boolean})],t.WfInput.prototype,"disabled",2),Gt([mt({type:String})],t.WfInput.prototype,"autocomplete",2),t.WfInput=Gt([pt("wf-input")],t.WfInput);var Zt=Object.defineProperty,Qt=Object.getOwnPropertyDescriptor,te=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?Qt(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&Zt(e,r,o),o};t.WfNumber=class extends t.WfInput{constructor(){super(...arguments),this.step=1}_setupValidators(){this._validators=[],this.required&&this._validators.push(Rt.required()),void 0===this.min&&void 0===this.max||this._validators.push(Rt.custom("range",t=>{if(""===t||null==t)return{valid:!0};const e=Number(t);return isNaN(e)?{valid:!1,error:"Please enter a valid number"}:void 0!==this.min&&e<this.min?{valid:!1,error:"Value must be at least "+this.min}:void 0!==this.max&&e>this.max?{valid:!1,error:"Value must be at most "+this.max}:{valid:!0}},"Value out of range"))}render(){return Y`
901
+ `}},he([gt({type:String})],t.WfInput.prototype,"placeholder",2),he([gt({type:String})],t.WfInput.prototype,"type",2),he([gt({type:Number})],t.WfInput.prototype,"minlength",2),he([gt({type:Number})],t.WfInput.prototype,"maxlength",2),he([gt({type:String})],t.WfInput.prototype,"pattern",2),he([gt({type:String,attribute:"pattern-message"})],t.WfInput.prototype,"patternMessage",2),he([gt({type:Boolean})],t.WfInput.prototype,"disabled",2),he([gt({type:String})],t.WfInput.prototype,"autocomplete",2),t.WfInput=he([ut("wf-input")],t.WfInput);var ce=Object.defineProperty,pe=Object.getOwnPropertyDescriptor,ue=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?pe(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&ce(e,s,o),o};t.WfNumber=class extends t.WfInput{constructor(){super(...arguments),this.step=1}_setupValidators(){this._validators=[],this.required&&this._validators.push(ie.required()),void 0===this.min&&void 0===this.max||this._validators.push(ie.custom("range",t=>{if(""===t||null==t)return{valid:!0};const e=Number(t);return isNaN(e)?{valid:!1,error:"Please enter a valid number"}:void 0!==this.min&&e<this.min?{valid:!1,error:"Value must be at least "+this.min}:void 0!==this.max&&e>this.max?{valid:!1,error:"Value must be at most "+this.max}:{valid:!0}},"Value out of range"))}render(){return K`
173
902
  <div class="wf-field-container">
174
- ${this.label?Y`<label
175
- class="wf-label ${this.required?"wf-label-required":""}"
176
- for="${this.name}"
177
- data-testid="wf-label"
178
- >
179
- ${this.label}
180
- </label>`:""}
903
+ ${this._renderLabel()}
181
904
  <input
182
905
  type="number"
183
906
  class="wf-input ${this._errorMessage?"wf-input-error":""}"
@@ -196,20 +919,12 @@
196
919
  @blur="${this._handleBlur}"
197
920
  @focus="${this._handleFocus}"
198
921
  />
199
- ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
200
- <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
201
- ${this._errorMessage}
202
- </span>
922
+ ${this._renderHint()}
923
+ ${this._renderError()}
203
924
  </div>
204
- `}get valueAsNumber(){return Number(this._value)||0}set valueAsNumber(t){this._value=t+""}},te([mt({type:Number})],t.WfNumber.prototype,"min",2),te([mt({type:Number})],t.WfNumber.prototype,"max",2),te([mt({type:Number})],t.WfNumber.prototype,"step",2),t.WfNumber=te([pt("wf-number")],t.WfNumber);var ee=Object.defineProperty,re=Object.getOwnPropertyDescriptor,se=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?re(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&ee(e,r,o),o};function ie(t){const e="string"==typeof t.container?document.querySelector(t.container):t.container;if(!e)throw Error("[WizardForm] Container not found: "+t.container);let i=e.querySelector("wizard-form");if(!i&&(i=e,"wizard-form"!==i.tagName.toLowerCase()))throw Error("[WizardForm] Container must be a <wizard-form> element or contain one");t.theme&&i.setAttribute("theme",t.theme),void 0!==t.showProgress&&(i.showProgress=t.showProgress),void 0!==t.autoAdvance&&(i.autoAdvance=t.autoAdvance),t.mock&&(i.mock=t.mock);let a=null;if("object"==typeof t.adapter)a=t.adapter;else switch(t.adapter||"json"){case"hubspot":if(!t.hubspot?.portalId||!t.hubspot?.formId)throw Error("[WizardForm] HubSpot config requires portalId and formId");a=r({portalId:t.hubspot.portalId,formId:t.hubspot.formId,fieldMapping:t.hubspot.fieldMapping,mock:t.mock}),i.setAttribute("hubspot-portal",t.hubspot.portalId),i.setAttribute("hubspot-form",t.hubspot.formId);break;case"webhook":if(!t.webhook?.url)throw Error("[WizardForm] Webhook config requires url");a=s({url:t.webhook.url,method:t.webhook.method,headers:t.webhook.headers,fieldMapping:t.webhook.fieldMapping,mock:t.mock});break;case"revenuehero":if(!t.revenuehero?.routerId)throw Error("[WizardForm] RevenueHero config requires routerId");a=o({routerId:t.revenuehero.routerId,fieldMapping:t.revenuehero.fieldMapping,mock:t.mock});break;case"json":a=null}const n=e=>{const r=e.detail.formData;let s={...r};if(t.serialize&&(s=t.serialize(s)),t.mock&&(window.__wizardFormData=s,window.__wizardFormRawData=r,window.__wizardFormInstance=p),t.onSubmit&&!1===t.onSubmit(s))e.preventDefault();else if(a){e.preventDefault();const o={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,timestamp:(new Date).toISOString()};a.submit(s,o).then(e=>{t.mock&&(window.__wizardFormResponse=e),e.success?(i._submitted=!0,i.requestUpdate(),i.dispatchEvent(new CustomEvent("wf:success",{detail:{formData:r,response:e.data},bubbles:!0,composed:!0}))):(t.mock&&(window.__wizardFormError=e.error),t.onError&&t.onError(e.error||"Submission failed",r))})}},l=e=>{t.mock&&(window.__wizardFormResponse={success:!0,data:e.detail.response}),t.onSuccess&&t.onSuccess(e.detail.formData,e.detail.response)},d=e=>{t.mock&&(window.__wizardFormError=e.detail.error),t.onError&&t.onError(e.detail.error,e.detail.formData)},h=e=>{t.onStepChange&&t.onStepChange(e.detail.from,e.detail.to,e.detail.direction)},c=e=>{t.onFieldChange&&t.onFieldChange(e.detail.name,e.detail.value,e.detail.formData)};i.addEventListener("wf:submit",n),i.addEventListener("wf:success",l),i.addEventListener("wf:error",d),i.addEventListener("wf:step-change",h),i.addEventListener("wf:field-change",c);const p={element:i,get formData(){return i.formData},get currentStep(){return i.currentStep},get totalSteps(){return i.totalSteps},next:()=>i.next(),back(){i.back()},goToStep(t){i.goToStep(t)},submit:()=>i.submit(),reset(){i.reset()},setFormData(t){i.setFormData(t)},destroy(){i.removeEventListener("wf:submit",n),i.removeEventListener("wf:success",l),i.removeEventListener("wf:error",d),i.removeEventListener("wf:step-change",h),i.removeEventListener("wf:field-change",c)},serialize:t.serialize};return p}t.WfTextarea=class extends qt{constructor(){super(...arguments),this.placeholder="",this.rows=4,this.disabled=!1,this.showCount=!1,this._handleKeydown=t=>{"Enter"===t.key&&t.stopPropagation()}}_getValidationTriggerProperties(){return["required","minlength","maxlength"]}_getFocusableSelector(){return"textarea"}_setupValidators(){this._validators=[],this.required&&this._validators.push(Rt.required()),void 0!==this.minlength&&this._validators.push(Rt.minLength(this.minlength)),void 0!==this.maxlength&&this._validators.push(Rt.maxLength(this.maxlength))}render(){const t=this._value.length,e=void 0!==this.maxlength&&t>=this.maxlength;return Y`
925
+ `}get valueAsNumber(){return Number(this._value)||0}set valueAsNumber(t){this._value=t+""}},ue([gt({type:Number})],t.WfNumber.prototype,"min",2),ue([gt({type:Number})],t.WfNumber.prototype,"max",2),ue([gt({type:Number})],t.WfNumber.prototype,"step",2),t.WfNumber=ue([ut("wf-number")],t.WfNumber);var fe=Object.defineProperty,me=Object.getOwnPropertyDescriptor,ge=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?me(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&fe(e,s,o),o};function be(t){const e="string"==typeof t.container?document.querySelector(t.container):t.container;if(!e)throw Error("[WizardForm] Container not found: "+t.container);let i=e.querySelector("wizard-form");if(!i&&(i=e,"wizard-form"!==i.tagName.toLowerCase()))throw Error("[WizardForm] Container must be a <wizard-form> element or contain one");t.theme&&i.setAttribute("theme",t.theme),void 0!==t.showProgress&&(i.showProgress=t.showProgress),void 0!==t.autoAdvance&&(i.autoAdvance=t.autoAdvance),t.mock&&(i.mock=t.mock);let a=null;if("object"==typeof t.adapter)a=t.adapter;else switch(t.adapter||"json"){case"hubspot":if(!t.hubspot?.portalId||!t.hubspot?.formId)throw Error("[WizardForm] HubSpot config requires portalId and formId");a=s({portalId:t.hubspot.portalId,formId:t.hubspot.formId,fieldMapping:t.hubspot.fieldMapping,mock:t.mock}),i.setAttribute("hubspot-portal",t.hubspot.portalId),i.setAttribute("hubspot-form",t.hubspot.formId);break;case"webhook":if(!t.webhook?.url)throw Error("[WizardForm] Webhook config requires url");a=r({url:t.webhook.url,method:t.webhook.method,headers:t.webhook.headers,fieldMapping:t.webhook.fieldMapping,mock:t.mock});break;case"revenuehero":if(!t.revenuehero?.routerId)throw Error("[WizardForm] RevenueHero config requires routerId");a=o({routerId:t.revenuehero.routerId,fieldMapping:t.revenuehero.fieldMapping,mock:t.mock});break;case"json":a=null}const n=e=>{const s=e.detail.formData;let r={...s};if(t.serialize&&(r=t.serialize(r)),t.mock&&(window.__wizardFormData=r,window.__wizardFormRawData=s,window.__wizardFormInstance=p),t.onSubmit&&!1===t.onSubmit(r))e.preventDefault();else if(a){e.preventDefault();const o={pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,timestamp:(new Date).toISOString()};a.submit(r,o).then(e=>{t.mock&&(window.__wizardFormResponse=e),e.success?(i._submitted=!0,i.requestUpdate(),i.dispatchEvent(new CustomEvent("wf:success",{detail:{formData:s,response:e.data},bubbles:!0,composed:!0}))):(t.mock&&(window.__wizardFormError=e.error),t.onError&&t.onError(e.error||"Submission failed",s))})}},l=e=>{t.mock&&(window.__wizardFormResponse={success:!0,data:e.detail.response}),t.onSuccess&&t.onSuccess(e.detail.formData,e.detail.response)},d=e=>{t.mock&&(window.__wizardFormError=e.detail.error),t.onError&&t.onError(e.detail.error,e.detail.formData)},h=e=>{t.onStepChange&&t.onStepChange(e.detail.from,e.detail.to,e.detail.direction)},c=e=>{t.onFieldChange&&t.onFieldChange(e.detail.name,e.detail.value,e.detail.formData)};i.addEventListener("wf:submit",n),i.addEventListener("wf:success",l),i.addEventListener("wf:error",d),i.addEventListener("wf:step-change",h),i.addEventListener("wf:field-change",c);const p={element:i,get formData(){return i.formData},get currentStep(){return i.currentStep},get totalSteps(){return i.totalSteps},next:()=>i.next(),back(){i.back()},goToStep(t){i.goToStep(t)},submit:()=>i.submit(),reset(){i.reset()},setFormData(t){i.setFormData(t)},destroy(){i.removeEventListener("wf:submit",n),i.removeEventListener("wf:success",l),i.removeEventListener("wf:error",d),i.removeEventListener("wf:step-change",h),i.removeEventListener("wf:field-change",c)},serialize:t.serialize};return p}t.WfTextarea=class extends se{constructor(){super(...arguments),this.placeholder="",this.rows=4,this.disabled=!1,this.showCount=!1,this._handleKeydown=t=>{"Enter"===t.key&&t.stopPropagation()}}_getValidationTriggerProperties(){return["required","minlength","maxlength"]}_getFocusableSelector(){return"textarea"}_setupValidators(){this._validators=[],this.required&&this._validators.push(ie.required()),void 0!==this.minlength&&this._validators.push(ie.minLength(this.minlength)),void 0!==this.maxlength&&this._validators.push(ie.maxLength(this.maxlength))}render(){const t=this._value.length,e=void 0!==this.maxlength&&t>=this.maxlength;return K`
205
926
  <div class="wf-field-container">
206
- ${this.label?Y`<label
207
- class="wf-label ${this.required?"wf-label-required":""}"
208
- for="${this.name}"
209
- data-testid="wf-label"
210
- >
211
- ${this.label}
212
- </label>`:""}
927
+ ${this._renderLabel()}
213
928
  <textarea
214
929
  class="wf-textarea ${this._errorMessage?"wf-textarea-error":""}"
215
930
  id="${this.name}"
@@ -226,43 +941,165 @@
226
941
  @focus="${this._handleFocus}"
227
942
  @keydown="${this._handleKeydown}"
228
943
  ></textarea>
229
- ${this.showCount&&this.maxlength?Y`<span class="wf-char-count ${e?"wf-char-limit":""}" data-testid="wf-counter">
944
+ ${this.showCount&&this.maxlength?K`<span class="wf-char-count ${e?"wf-char-limit":""}" data-testid="wf-counter">
230
945
  ${t}/${this.maxlength}
231
946
  </span>`:""}
232
- ${this.hint&&!this._errorMessage?Y`<span class="wf-hint">${this.hint}</span>`:""}
233
- <span class="wf-error-message" role="alert" aria-live="polite" data-testid="wf-error">
234
- ${this._errorMessage}
235
- </span>
947
+ ${this._renderHint()}
948
+ ${this._renderError()}
236
949
  </div>
237
- `}},se([mt({type:String})],t.WfTextarea.prototype,"placeholder",2),se([mt({type:Number})],t.WfTextarea.prototype,"rows",2),se([mt({type:Number})],t.WfTextarea.prototype,"minlength",2),se([mt({type:Number})],t.WfTextarea.prototype,"maxlength",2),se([mt({type:Boolean})],t.WfTextarea.prototype,"disabled",2),se([mt({type:Boolean,attribute:"show-count"})],t.WfTextarea.prototype,"showCount",2),t.WfTextarea=se([pt("wf-textarea")],t.WfTextarea);const oe={init:ie};var ae=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,le=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?ne(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&ae(e,r,o),o};t.WfProgress=class extends ht{constructor(){super(...arguments),this.for="",this._currentStep=1,this._totalSteps=1,this._isComplete=!1,this._wizard=null,this._boundHandleStepChange=this._handleStepChange.bind(this),this._boundHandleSuccess=this._handleSuccess.bind(this),this._boundHandleStepsDiscovered=this._handleStepsDiscovered.bind(this)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),document.addEventListener("wf:steps-discovered",this._boundHandleStepsDiscovered),requestAnimationFrame(()=>{this._connectToWizard()})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("wf:steps-discovered",this._boundHandleStepsDiscovered),this._disconnectFromWizard()}_connectToWizard(){this.for?this._wizard=document.getElementById(this.for):this._wizard=this.closest("wizard-form"),this._wizard&&(this._currentStep=this._wizard.currentStep||1,this._totalSteps=this._wizard.totalSteps||1,this._isComplete=this._wizard.isSubmitted||!1,this._wizard.addEventListener("wf:step-change",this._boundHandleStepChange),this._wizard.addEventListener("wf:success",this._boundHandleSuccess))}_disconnectFromWizard(){this._wizard&&(this._wizard.removeEventListener("wf:step-change",this._boundHandleStepChange),this._wizard.removeEventListener("wf:success",this._boundHandleSuccess),this._wizard=null)}_handleStepChange(t){this._currentStep=t.detail.to,this._wizard&&(this._totalSteps=this._wizard.totalSteps)}_handleStepsDiscovered(t){const{wizard:e,wizardId:r,totalSteps:s,currentStep:i}=t.detail;if(this.for){if(r!==this.for)return}else{const t=this.closest("wizard-form");if(!t||t!==e)return}!this._wizard&&e&&(this._wizard=e,e.addEventListener("wf:step-change",this._boundHandleStepChange),e.addEventListener("wf:success",this._boundHandleSuccess)),this._totalSteps=s,this._currentStep=i}_handleSuccess(){this._isComplete=!0}render(){if(this._isComplete)return null;const t=[];for(let e=1;e<=this._totalSteps;e++){const r=e<this._currentStep,s=e===this._currentStep;t.push(Y`
950
+ `}},ge([gt({type:String})],t.WfTextarea.prototype,"placeholder",2),ge([gt({type:Number})],t.WfTextarea.prototype,"rows",2),ge([gt({type:Number})],t.WfTextarea.prototype,"minlength",2),ge([gt({type:Number})],t.WfTextarea.prototype,"maxlength",2),ge([gt({type:Boolean})],t.WfTextarea.prototype,"disabled",2),ge([gt({type:Boolean,attribute:"show-count"})],t.WfTextarea.prototype,"showCount",2),t.WfTextarea=ge([ut("wf-textarea")],t.WfTextarea);const we={init:be},_e=c`
951
+ :host {
952
+ display: block;
953
+ }
954
+
955
+ :host([hidden]) {
956
+ display: none;
957
+ }
958
+
959
+ .wf-progress {
960
+ display: flex;
961
+ gap: var(--wf-spacing-4, 16px);
962
+ }
963
+
964
+ .wf-progress-segment {
965
+ width: 32px;
966
+ height: 8px;
967
+ background-color: var(--wf-color-progress-inactive, rgba(0, 0, 0, 0.05));
968
+ border-radius: var(--wf-radius-full, 99px);
969
+ transition: background-color 300ms ease;
970
+ }
971
+
972
+ .wf-progress-segment.completed,
973
+ .wf-progress-segment.active {
974
+ background-color: var(--wf-color-progress-active, rgba(0, 0, 0, 0.1));
975
+ }
976
+ `;var ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,Se=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?ye(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&ve(e,s,o),o};t.WfProgress=class extends ct{constructor(){super(...arguments),this.for="",this._currentStep=1,this._totalSteps=1,this._isComplete=!1,this._wizard=null,this._boundHandleStepChange=this._handleStepChange.bind(this),this._boundHandleSuccess=this._handleSuccess.bind(this),this._boundHandleStepsDiscovered=this._handleStepsDiscovered.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("wf:steps-discovered",this._boundHandleStepsDiscovered),requestAnimationFrame(()=>{this._connectToWizard()})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("wf:steps-discovered",this._boundHandleStepsDiscovered),this._disconnectFromWizard()}_connectToWizard(){this.for?this._wizard=document.getElementById(this.for):this._wizard=this.closest("wizard-form"),this._wizard&&(this._currentStep=this._wizard.currentStep||1,this._totalSteps=this._wizard.totalSteps||1,this._isComplete=this._wizard.isSubmitted||!1,this._wizard.addEventListener("wf:step-change",this._boundHandleStepChange),this._wizard.addEventListener("wf:success",this._boundHandleSuccess))}_disconnectFromWizard(){this._wizard&&(this._wizard.removeEventListener("wf:step-change",this._boundHandleStepChange),this._wizard.removeEventListener("wf:success",this._boundHandleSuccess),this._wizard=null)}_handleStepChange(t){this._currentStep=t.detail.to,this._wizard&&(this._totalSteps=this._wizard.totalSteps)}_handleStepsDiscovered(t){const{wizard:e,wizardId:s,totalSteps:r,currentStep:i}=t.detail;if(this.for){if(s!==this.for)return}else{const t=this.closest("wizard-form");if(!t||t!==e)return}!this._wizard&&e&&(this._wizard=e,e.addEventListener("wf:step-change",this._boundHandleStepChange),e.addEventListener("wf:success",this._boundHandleSuccess)),this._totalSteps=r,this._currentStep=i}_handleSuccess(){this._isComplete=!0}render(){if(this._isComplete)return null;const t=[];for(let e=1;e<=this._totalSteps;e++){const s=e<this._currentStep,r=e===this._currentStep;t.push(K`
238
977
  <div
239
- class="wf-progress-segment ${r?"completed":""} ${s?"active":""}"
978
+ class="wf-progress-segment ${s?"completed":""} ${r?"active":""}"
979
+ data-testid="wf-progress-segment"
980
+ data-step="${e}"
981
+ data-completed="${s}"
982
+ data-active="${r}"
240
983
  role="progressbar"
241
984
  aria-valuenow="${this._currentStep}"
242
985
  aria-valuemin="1"
243
986
  aria-valuemax="${this._totalSteps}"
244
987
  ></div>
245
- `)}return Y`<div class="wf-progress" role="group" aria-label="Form progress">${t}</div>`}},le([mt({type:String})],t.WfProgress.prototype,"for",2),le([wt()],t.WfProgress.prototype,"_currentStep",2),le([wt()],t.WfProgress.prototype,"_totalSteps",2),le([wt()],t.WfProgress.prototype,"_isComplete",2),t.WfProgress=le([pt("wf-progress")],t.WfProgress);var de=Object.defineProperty,he=Object.getOwnPropertyDescriptor,ce=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?he(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&de(e,r,o),o};t.WfThankYou=class extends ht{constructor(){super(...arguments),this.title="Thank you!",this._cachedIconContent=[],this._cachedFooterContent=[],this._cachedDefaultContent=[],this.subtitle="We've received your request.",this.hideIcon=!1}createRenderRoot(){return this}connectedCallback(){if(0===this._cachedIconContent.length&&0===this._cachedFooterContent.length&&0===this._cachedDefaultContent.length){const t=this.querySelector('[slot="icon"]'),e=this.querySelector('[slot="footer"]');t&&(this._cachedIconContent=[t.cloneNode(!0)]),e&&(this._cachedFooterContent=[e.cloneNode(!0)]),Array.from(this.childNodes).forEach(t=>{t.nodeType===Node.ELEMENT_NODE?t.hasAttribute("slot")||this._cachedDefaultContent.push(t.cloneNode(!0)):t.nodeType===Node.TEXT_NODE&&t.textContent?.trim()&&this._cachedDefaultContent.push(t.cloneNode(!0))}),this.textContent=""}super.connectedCallback()}render(){return Y`
246
- ${this.hideIcon?"":Y`
247
- <div class="wf-thank-you-icon">
248
- ${this._cachedIconContent.length>0?this._cachedIconContent:Y`<svg
249
- xmlns="http://www.w3.org/2000/svg"
250
- fill="none"
251
- viewBox="0 0 24 24"
252
- stroke="currentColor"
253
- >
254
- <path
255
- stroke-linecap="round"
256
- stroke-linejoin="round"
257
- stroke-width="2"
258
- d="M5 13l4 4L19 7"
259
- />
260
- </svg>`}
261
- </div>
262
- `}
263
- <h2 class="wf-thank-you-title">${this.title}</h2>
264
- <p class="wf-thank-you-subtitle">${this.subtitle}</p>
265
- ${this._cachedDefaultContent}
266
- ${this._cachedFooterContent.length>0?Y`<div class="wf-thank-you-footer">${this._cachedFooterContent}</div>`:""}
267
- `}},ce([mt({type:String})],t.WfThankYou.prototype,"title",2),ce([mt({type:String})],t.WfThankYou.prototype,"subtitle",2),ce([mt({type:Boolean,attribute:"hide-icon"})],t.WfThankYou.prototype,"hideIcon",2),t.WfThankYou=ce([pt("wf-thank-you")],t.WfThankYou),function(){if("undefined"==typeof document)return;const t="wf-global-styles";if(document.getElementById(t))return;const e=document.createElement("style");e.id=t,e.textContent='wizard-form{--wf-color-primary:#8040f0;--wf-color-primary-border:#602cbb;--wf-color-primary-light:#8040f014;--wf-color-surface:#f3f3f5;--wf-color-surface-hover:#e9e9eb;--wf-color-border:#d4d4d4;--wf-color-text:#0a0a0a;--wf-color-text-secondary:#404040;--wf-color-text-muted:#646464;--wf-color-error:#dc3545;--wf-color-badge-bg:#fcfcfc;--wf-color-badge-border:#d4d4d4;--wf-color-badge-text:#5f5f5f;--wf-color-progress-active:#0000001a;--wf-color-progress-inactive:#0000000d;--wf-spacing-1:4px;--wf-spacing-2:8px;--wf-spacing-3:12px;--wf-spacing-4:16px;--wf-spacing-5:20px;--wf-spacing-6:24px;--wf-spacing-8:32px;--wf-radius-sm:4px;--wf-radius-md:8px;--wf-radius-lg:8px;--wf-radius-full:99px;--wf-font-size-xs:.75rem;--wf-font-size-sm:.875rem;--wf-font-size-base:1rem;--wf-font-size-lg:1.25rem;--wf-font-size-xl:1.5rem;--wf-font-size-2xl:2rem;--wf-font-size-3xl:2.5rem;--wf-input-min-height:56px;--wf-glass-bg:#ffffffb3;--wf-glass-bg-hover:#ffffffd9;--wf-glass-border:#0000001a;--wf-glass-blur:20px;--wf-glass-shadow:0 4px 6px #0000000d;display:block}wizard-form[theme=dark]{--wf-color-surface:#2d2d2d;--wf-color-surface-hover:#3d3d3d;--wf-color-border:#4d4d4d;--wf-color-text:#f8f9fa;--wf-color-text-secondary:#d0d0d0;--wf-color-text-muted:#adb5bd;--wf-color-badge-bg:#3d3d3d;--wf-color-badge-border:#4d4d4d;--wf-color-badge-text:#adb5bd;--wf-color-progress-active:#c8c8c899;--wf-color-progress-inactive:#64646499;--wf-glass-bg:#2d2d2db3;--wf-glass-bg-hover:#3c3c3ccc;--wf-glass-border:#ffffff1a}@media (prefers-color-scheme:dark){wizard-form[theme=auto]{--wf-color-surface:#2d2d2d;--wf-color-surface-hover:#3d3d3d;--wf-color-border:#4d4d4d;--wf-color-text:#f8f9fa;--wf-color-text-secondary:#d0d0d0;--wf-color-text-muted:#adb5bd;--wf-color-badge-bg:#3d3d3d;--wf-color-badge-border:#4d4d4d;--wf-color-badge-text:#adb5bd;--wf-color-progress-active:#c8c8c899;--wf-color-progress-inactive:#64646499;--wf-glass-bg:#2d2d2db3;--wf-glass-bg-hover:#3c3c3ccc;--wf-glass-border:#ffffff1a}}wizard-form .wf-container{margin:0 auto}wizard-form .wf-progress{gap:var(--wf-spacing-4,16px);margin-top:var(--wf-spacing-6,24px);display:flex}wizard-form .wf-progress-segment{background-color:var(--wf-color-progress-inactive,#0000001a);border-radius:var(--wf-radius-full,99px);width:32px;height:8px;transition:background-color .3s}wizard-form .wf-progress-segment.completed,wizard-form .wf-progress-segment.active{background-color:var(--wf-color-progress-active,#0000004d)}wizard-form .wf-steps-container{min-height:200px}wizard-form .wf-navigation{justify-content:space-between;gap:var(--wf-spacing-4,16px);margin-top:var(--wf-spacing-6,24px);display:flex}wizard-form .wf-btn{justify-content:center;align-items:center;gap:var(--wf-spacing-2,8px);padding:var(--wf-spacing-3,12px)var(--wf-spacing-4,16px);min-height:48px;font-size:var(--wf-font-size-base,1rem);border-radius:var(--wf-radius-md,8px);cursor:pointer;border:1px solid #0000;outline:none;font-family:inherit;font-weight:600;transition:all .15s;display:inline-flex}wizard-form .wf-btn:focus-visible{box-shadow:0 0 0 3px #8040f04d}wizard-form .wf-btn-back{background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);color:var(--wf-color-text,#0a0a0a)}wizard-form .wf-btn-back:hover:not(:disabled){background:var(--wf-glass-bg-hover,#ffffffd9)}wizard-form .wf-btn-next{background-color:var(--wf-color-primary,#8040f0);border:1px solid var(--wf-color-primary-border,#602cbb);color:#fff;flex:1;margin-left:auto;position:relative}wizard-form .wf-btn-next:hover:not(:disabled){filter:brightness(1.1)}wizard-form .wf-btn:disabled{opacity:.5;cursor:not-allowed}wizard-form .wf-btn-shortcut{right:var(--wf-spacing-4,16px);align-items:center;gap:2px;display:inline-flex;position:absolute}wizard-form .wf-btn-back .wf-btn-shortcut{position:static}wizard-form .wf-success-screen{text-align:center;padding:var(--wf-spacing-6,24px)}wizard-form .wf-loading{border:2px solid #0000001a;border-top-color:#fff;border-radius:50%;width:20px;height:20px;animation:.8s linear infinite wf-spin;display:inline-block}@keyframes wf-spin{to{transform:rotate(360deg)}}wizard-form .wf-form-error{padding:var(--wf-spacing-4,16px);margin-bottom:var(--wf-spacing-4,16px);border:1px solid var(--wf-color-error,#dc3545);border-radius:var(--wf-radius-md,8px);color:var(--wf-color-error,#dc3545);font-size:var(--wf-font-size-base,1rem);background-color:#dc35451a}wf-success{display:block}wf-success h1,wf-success h2,wf-success h3{margin:0 0 var(--wf-spacing-4,16px)0;color:var(--wf-color-text,#212529);font-weight:600}wf-success p{color:var(--wf-color-text-muted,#6c757d);margin:0}wf-step{width:100%;display:none}wf-step[active]{animation:.3s forwards wf-stepFadeIn;display:block}wf-step[direction=forward][active]{animation:.3s forwards wf-stepSlideInRight}wf-step[direction=backward][active]{animation:.3s forwards wf-stepSlideInLeft}wf-step[leaving]{animation:.2s forwards wf-stepFadeOut;display:block}@keyframes wf-stepFadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes wf-stepFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}@keyframes wf-stepSlideInRight{0%{opacity:0;transform:translate(30px)}to{opacity:1;transform:translate(0)}}@keyframes wf-stepSlideInLeft{0%{opacity:0;transform:translate(-30px)}to{opacity:1;transform:translate(0)}}wf-step .wf-step-content{gap:var(--wf-spacing-4,16px);flex-direction:column;display:flex}wf-step h1,wf-step h2,wf-step h3{color:var(--wf-color-text,#212529);margin:0;font-weight:600}wf-step h2{font-size:var(--wf-font-size-3xl,2rem)}wf-step p{color:var(--wf-color-text-muted,#6c757d);font-size:var(--wf-font-size-xl,1.375rem);margin:0}wf-options{display:block}wf-options[hidden]{display:none}wf-options .wf-options-container{gap:var(--wf-spacing-4,16px);grid-template-columns:repeat(2,1fr);display:grid}wf-options[columns="1"] .wf-options-container{grid-template-columns:1fr}@media (width<=600px){wf-options .wf-options-container{grid-template-columns:1fr}}wf-options .wf-error-message{margin-top:var(--wf-spacing-2,8px);font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-error,#dc3545);min-height:20px;display:block}wf-options .wf-other-container{margin-top:var(--wf-spacing-4,16px)}wf-options .wf-other-label{margin-bottom:var(--wf-spacing-2,8px);font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text,#0a0a0a);font-weight:500;display:block}wf-options .wf-other-label span{color:var(--wf-color-text-muted,#646464);font-weight:400}wf-options .wf-other-input-wrapper{align-items:center;gap:var(--wf-spacing-3,12px);min-height:var(--wf-input-min-height,56px);background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);border-radius:var(--wf-radius-md,8px);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);padding-left:var(--wf-spacing-4,16px);transition:border-color .15s,box-shadow .15s,background .15s;display:flex}wf-options .wf-other-input-wrapper:focus-within{border-color:var(--wf-color-primary,#8040f0);box-shadow:0 0 0 3px #8040f01a}wf-options .wf-other-input{min-height:calc(var(--wf-input-min-height,56px) - 2px);padding:var(--wf-spacing-4,16px);font-size:var(--wf-font-size-base,1rem);color:var(--wf-color-text,#0a0a0a);box-sizing:border-box;background:0 0;border:none;outline:none;flex:1;padding-left:0;font-weight:500}wf-options .wf-other-input::placeholder{color:var(--wf-color-text-muted,#646464);font-weight:500}wf-option{display:block}wf-option[hidden]{display:none}wf-option .wf-option-card{align-items:center;gap:var(--wf-spacing-3,12px);width:100%;min-height:var(--wf-input-min-height,56px);padding:var(--wf-spacing-3,12px);background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);border-radius:var(--wf-radius-md,8px);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);cursor:pointer;text-align:left;font-family:inherit;font-size:var(--wf-font-size-base,1rem);color:var(--wf-color-text,#0a0a0a);box-sizing:border-box;outline:none;font-weight:500;transition:border-color .15s,background .15s,transform .1s;display:flex}wf-option .wf-option-card:hover:not(:disabled){border-color:var(--wf-color-primary,#8040f0);background:var(--wf-glass-bg-hover,#ffffffd9)}wf-option .wf-option-card:focus-visible{border-color:var(--wf-color-primary,#8040f0);box-shadow:0 0 0 3px #8040f033}wf-option .wf-option-card[aria-selected=true]{border-color:var(--wf-color-primary,#8040f0);background-color:var(--wf-color-primary-light,#8040f01a)}wf-option .wf-option-card:disabled{opacity:.5;cursor:not-allowed}wf-option .wf-option-card:active:not(:disabled){transform:scale(.98)}wf-option .wf-option-card.selecting{animation:.3s wf-blink}@keyframes wf-blink{0%,to{opacity:1}50%{opacity:.5}}wf-option .wf-option-content{flex:1;min-width:0}wf-option .wf-option-content strong,wf-option .wf-option-content h3,wf-option .wf-option-content h4{margin:0;font-weight:600;display:block}wf-option .wf-option-content span,wf-option .wf-option-content p{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text-muted,#646464);margin:4px 0 0;display:block}wf-progress{display:block}wf-progress[hidden]{display:none}wf-progress .wf-progress{gap:var(--wf-spacing-4,16px);display:flex}wf-progress .wf-progress-segment{background-color:var(--wf-color-progress-inactive,#0000000d);border-radius:var(--wf-radius-full,99px);width:32px;height:8px;transition:background-color .3s}wf-progress .wf-progress-segment.completed,wf-progress .wf-progress-segment.active{background-color:var(--wf-color-progress-active,#0000001a)}wf-badge{display:inline-flex}wf-badge[hidden]{display:none}wf-badge .wf-badge{box-sizing:border-box;min-width:24px;height:24px;padding:var(--wf-spacing-1,4px)var(--wf-spacing-2,8px);font-size:var(--wf-font-size-xs,.75rem);text-transform:uppercase;flex-shrink:0;justify-content:center;align-items:center;font-family:inherit;font-weight:500;line-height:1;display:inline-flex}wf-badge .wf-badge--default{background-color:var(--wf-color-badge-bg,#fcfcfc);border:1px solid var(--wf-color-badge-border,#d4d4d4);border-radius:var(--wf-radius-sm,4px);color:var(--wf-color-badge-text,#5f5f5f)}wf-badge .wf-badge--selected{background-color:var(--wf-color-primary,#8040f0);border:1px solid var(--wf-color-primary,#8040f0);border-radius:var(--wf-radius-sm,4px);color:#fff}wf-badge .wf-badge--button{border-radius:var(--wf-radius-sm,4px);color:#ffffffa6;background-color:#0000;border:none}wf-badge .wf-badge--button-secondary{border-radius:var(--wf-radius-sm,4px);color:var(--wf-color-text-muted,#5f5f5f);background-color:#0000;border:none}wf-layout{box-sizing:border-box;display:block}wf-layout[hidden]{display:none}wf-layout.wf-layout--width-full{width:100%}wf-layout.wf-layout--width-auto{width:auto}wf-layout.wf-layout--width-fit{width:fit-content}wf-thank-you{text-align:center;padding:var(--wf-spacing-8,48px)var(--wf-spacing-4,24px);display:block}wf-thank-you[hidden]{display:none}wf-thank-you .wf-thank-you-icon{width:72px;height:72px;margin:0 auto var(--wf-spacing-4,24px);background:linear-gradient(135deg,#10b981 0%,#059669 100%);border-radius:50%;justify-content:center;align-items:center;display:flex;box-shadow:0 10px 25px -5px #10b98166}wf-thank-you .wf-thank-you-icon svg{color:#fff;width:36px;height:36px}wf-thank-you .wf-thank-you-title{color:var(--wf-color-text,#1e293b);margin:0 0 12px;font-size:28px;font-weight:700}wf-thank-you .wf-thank-you-subtitle{color:var(--wf-color-text-muted,#64748b);margin:0 0 24px;font-size:16px;line-height:1.6}wf-thank-you [slot=footer]{margin-top:var(--wf-spacing-4,24px)}wf-input,wf-email,wf-textarea,wf-field,wf-number{display:block}wf-input[hidden],wf-email[hidden],wf-textarea[hidden],wf-field[hidden],wf-number[hidden]{display:none}.wf-field-container{gap:var(--wf-spacing-2,8px);flex-direction:column;display:flex}.wf-label{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text,#0a0a0a);font-weight:500}.wf-label-required:after{content:" *";color:var(--wf-color-error,#dc3545)}.wf-error-message{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-error,#dc3545)}.wf-hint{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text-muted,#646464)}.wf-input{width:100%;min-height:var(--wf-input-min-height,56px);padding:var(--wf-spacing-4,16px);font-size:var(--wf-font-size-base,1rem);background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);border-radius:var(--wf-radius-md,8px);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);color:var(--wf-color-text,#0a0a0a);box-sizing:border-box;outline:none;font-family:inherit;font-weight:400;transition:border-color .15s,box-shadow .15s,background .15s}.wf-input::placeholder{color:var(--wf-color-text-muted,#646464);font-weight:500}.wf-input:focus{border-color:var(--wf-color-primary,#8040f0);box-shadow:0 0 0 3px #8040f033}.wf-input:disabled{opacity:.5;cursor:not-allowed}.wf-input.wf-input-error{border-color:var(--wf-color-error,#dc3545)}.wf-input.wf-input-error:focus{box-shadow:0 0 0 3px #dc354533}.wf-textarea{width:100%;padding:var(--wf-spacing-4,16px);font-size:var(--wf-font-size-base,1rem);background:var(--wf-glass-bg,#ffffffb3);-webkit-backdrop-filter:blur(var(--wf-glass-blur,20px));border:1px solid var(--wf-glass-border,#0000001a);border-radius:var(--wf-radius-lg,12px);box-shadow:var(--wf-glass-shadow,0 4px 6px #0000000d);color:var(--wf-color-text,#212529);box-sizing:border-box;resize:vertical;outline:none;min-height:100px;font-family:inherit;transition:border-color .15s,box-shadow .15s,background .15s}.wf-textarea::placeholder{color:var(--wf-color-text-muted,#6c757d)}.wf-textarea:focus{border-color:var(--wf-color-primary,#8b5cf6);box-shadow:0 0 0 3px #8b5cf633}.wf-textarea:disabled{opacity:.5;cursor:not-allowed}.wf-textarea.wf-textarea-error{border-color:var(--wf-color-error,#dc3545)}.wf-textarea.wf-textarea-error:focus{box-shadow:0 0 0 3px #dc354533}.wf-char-count{font-size:var(--wf-font-size-sm,.875rem);color:var(--wf-color-text-muted,#6c757d);text-align:right}.wf-char-count.wf-char-limit{color:var(--wf-color-error,#dc3545)}wf-field .wf-input-wrapper{position:relative}wf-field .wf-input-wrapper input,wf-field .wf-input-wrapper textarea,wf-field .wf-input-wrapper select{width:100%;padding:var(--wf-spacing-4,16px);font-size:var(--wf-font-size-base,1rem);background-color:var(--wf-color-surface,#f8f9fa);border:2px solid var(--wf-color-border,#dee2e6);border-radius:var(--wf-radius-lg,12px);color:var(--wf-color-text,#212529);box-sizing:border-box;outline:none;font-family:inherit;transition:border-color .15s,box-shadow .15s}wf-field .wf-input-wrapper input::placeholder,wf-field .wf-input-wrapper textarea::placeholder{color:var(--wf-color-text-muted,#6c757d)}wf-field .wf-input-wrapper input:focus,wf-field .wf-input-wrapper textarea:focus,wf-field .wf-input-wrapper select:focus{border-color:var(--wf-color-primary,#8b5cf6);box-shadow:0 0 0 3px #8b5cf633}wf-field .wf-input-wrapper input:disabled,wf-field .wf-input-wrapper textarea:disabled,wf-field .wf-input-wrapper select:disabled{opacity:.5;cursor:not-allowed}wf-number .wf-input::-webkit-outer-spin-button,wf-number .wf-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}wf-number .wf-input[type=number]{-moz-appearance:textfield}',document.head.appendChild(e)}(),t.DEFAULT_BLOCKED_DOMAINS=jt,t.FormStateController=gt,t.KeyboardController=bt,t.ValidationController=Rt,t.createHubSpotAdapter=r,t.createRevenueHeroAdapter=o,t.createWebhookAdapter=s,t.default=oe,t.getHubSpotCookie=e,t.init=ie,t.isRevenueHeroLoaded=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
988
+ `)}return K`<div class="wf-progress" data-testid="wf-progress-bar" role="group" aria-label="Form progress">${t}</div>`}},t.WfProgress.styles=_e,Se([gt({type:String})],t.WfProgress.prototype,"for",2),Se([bt()],t.WfProgress.prototype,"_currentStep",2),Se([bt()],t.WfProgress.prototype,"_totalSteps",2),Se([bt()],t.WfProgress.prototype,"_isComplete",2),t.WfProgress=Se([ut("wf-progress")],t.WfProgress);var xe=Object.defineProperty,$e=(t,e,s,r)=>{for(var i,o=void 0,a=t.length-1;a>=0;a--)(i=t[a])&&(o=i(e,s,o)||o);return o&&xe(e,s,o),o};class Ee extends ct{constructor(){super(...arguments),this._isFirstStep=!0,this._isLastStep=!1,this._isSubmitting=!1,this._handleNavState=t=>{this._isFirstStep=t.detail.isFirstStep,this._isLastStep=t.detail.isLastStep,this._isSubmitting=t.detail.isSubmitting}}connectedCallback(){super.connectedCallback(),this._findWizardForm()?.addEventListener("wf:nav-state",this._handleNavState),this._requestNavState()}disconnectedCallback(){super.disconnectedCallback(),this._findWizardForm()?.removeEventListener("wf:nav-state",this._handleNavState)}_findWizardForm(){return this.closest("wizard-form")}_requestNavState(){this.dispatchEvent(new CustomEvent("wf:nav-state-request",{bubbles:!0,composed:!0}))}_dispatchNavEvent(){this.dispatchEvent(new CustomEvent(this._getEventName(),{bubbles:!0,composed:!0}))}}$e([bt()],Ee.prototype,"_isFirstStep"),$e([bt()],Ee.prototype,"_isLastStep"),$e([bt()],Ee.prototype,"_isSubmitting");const ke=[_t,vt,c`
989
+ :host {
990
+ display: block;
991
+ width: 100%;
992
+ }
993
+
994
+ :host([hidden]) {
995
+ display: none;
996
+ }
997
+
998
+ .wf-btn-next {
999
+ width: 100%;
1000
+ flex: 1;
1001
+ background-color: var(--wf-color-primary, #8040f0);
1002
+ border: 1px solid var(--wf-color-primary-border, #602cbb);
1003
+ color: white;
1004
+ position: relative;
1005
+ }
1006
+
1007
+ .wf-btn-next:hover:not(:disabled) {
1008
+ filter: brightness(1.1);
1009
+ }
1010
+
1011
+ .wf-btn-shortcut {
1012
+ position: absolute;
1013
+ right: var(--wf-spacing-4, 16px);
1014
+ display: inline-flex;
1015
+ align-items: center;
1016
+ gap: 2px;
1017
+ }
1018
+
1019
+ .wf-loading {
1020
+ display: inline-block;
1021
+ width: 20px;
1022
+ height: 20px;
1023
+ border: 2px solid rgba(0, 0, 0, 0.1);
1024
+ border-radius: 50%;
1025
+ border-top-color: white;
1026
+ animation: wf-spin 0.8s linear infinite;
1027
+ }
1028
+
1029
+ /* Inline button styles (for use inside wf-other) */
1030
+ :host([inline]) {
1031
+ display: inline-block;
1032
+ width: auto;
1033
+ }
1034
+
1035
+ :host([inline]) .wf-btn {
1036
+ min-height: var(--wf-input-min-height, 56px);
1037
+ width: auto;
1038
+ padding: var(--wf-spacing-3, 12px) var(--wf-spacing-5, 20px);
1039
+ }
1040
+
1041
+ :host([inline]) .wf-btn-shortcut {
1042
+ position: static;
1043
+ margin-left: var(--wf-spacing-2, 8px);
1044
+ }
1045
+ `];var Ae=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,Oe=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?Ce(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&Ae(e,s,o),o};t.WfNextBtn=class extends Ee{constructor(){super(...arguments),this.showShortcut=!0,this.inline=!1,this.disabled=!1,this._handleClick=()=>{this.disabled||this._isSubmitting||this._dispatchNavEvent()}}_getEventName(){return"wf:nav-next"}_getButtonLabel(){return this.label?this.label:!this.inline&&("submit"===this.action||"next"!==this.action&&this._isLastStep)?"Submit":"Continue"}_isSubmitAction(){return!this.inline&&("submit"===this.action||"next"!==this.action&&this._isLastStep)}render(){const t=this._getButtonLabel(),e=this.disabled||this._isSubmitting;return K`
1046
+ <button
1047
+ type="button"
1048
+ class="wf-btn wf-btn-next"
1049
+ ?disabled="${e}"
1050
+ @click="${this._handleClick}"
1051
+ data-testid="wf-next-btn"
1052
+ >
1053
+ ${this._isSubmitting?K`<span class="wf-loading"></span>`:K`
1054
+ ${t}
1055
+ ${this.showShortcut?K`
1056
+ <span class="wf-btn-shortcut ${this.inline?"wf-btn-shortcut-inline":""}">
1057
+ <wf-badge variant="button" shortcut="↵"></wf-badge>
1058
+ </span>
1059
+ `:J}
1060
+ `}
1061
+ </button>
1062
+ `}},t.WfNextBtn.styles=ke,Oe([gt({type:String})],t.WfNextBtn.prototype,"label",2),Oe([gt({type:String})],t.WfNextBtn.prototype,"action",2),Oe([gt({type:Boolean,attribute:"show-shortcut"})],t.WfNextBtn.prototype,"showShortcut",2),Oe([gt({type:Boolean})],t.WfNextBtn.prototype,"inline",2),Oe([gt({type:Boolean})],t.WfNextBtn.prototype,"disabled",2),t.WfNextBtn=Oe([ut("wf-next-btn")],t.WfNextBtn);const We=[vt,c`
1063
+ :host {
1064
+ display: inline-block;
1065
+ }
1066
+
1067
+ :host([hidden]) {
1068
+ display: none;
1069
+ }
1070
+
1071
+ .wf-btn-back {
1072
+ background: var(--wf-glass-bg, rgba(255, 255, 255, 0.7));
1073
+ backdrop-filter: blur(var(--wf-glass-blur, 20px));
1074
+ -webkit-backdrop-filter: blur(var(--wf-glass-blur, 20px));
1075
+ border: 1px solid var(--wf-glass-border, rgba(0, 0, 0, 0.1));
1076
+ box-shadow: var(--wf-glass-shadow, 0 4px 6px rgba(0, 0, 0, 0.05));
1077
+ color: var(--wf-color-text, #0a0a0a);
1078
+ }
1079
+
1080
+ .wf-btn-back:hover:not(:disabled) {
1081
+ background: var(--wf-glass-bg-hover, rgba(255, 255, 255, 0.85));
1082
+ }
1083
+
1084
+ .wf-btn-shortcut {
1085
+ display: inline-flex;
1086
+ align-items: center;
1087
+ gap: 2px;
1088
+ }
1089
+ `];var ze=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,Ne=(t,e,s,r)=>{for(var i,o=r>1?void 0:r?Pe(e,s):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r?i(e,s,o):i(o))||o);return r&&o&&ze(e,s,o),o};t.WfBackBtn=class extends Ee{constructor(){super(...arguments),this.label="Back",this.showShortcut=!0,this.disabled=!1,this.hideOnFirst=!0,this._handleClick=()=>{this.disabled||this._dispatchNavEvent()}}_getEventName(){return"wf:nav-back"}render(){return this.hideOnFirst&&this._isFirstStep?J:K`
1090
+ <button
1091
+ type="button"
1092
+ class="wf-btn wf-btn-back"
1093
+ ?disabled="${this.disabled}"
1094
+ @click="${this._handleClick}"
1095
+ data-testid="wf-back-btn"
1096
+ >
1097
+ ${this.showShortcut?K`
1098
+ <span class="wf-btn-shortcut">
1099
+ <wf-badge variant="button-secondary">Esc</wf-badge>
1100
+ </span>
1101
+ `:J}
1102
+ ${this.label}
1103
+ </button>
1104
+ `}},t.WfBackBtn.styles=We,Ne([gt({type:String})],t.WfBackBtn.prototype,"label",2),Ne([gt({type:Boolean,attribute:"show-shortcut"})],t.WfBackBtn.prototype,"showShortcut",2),Ne([gt({type:Boolean})],t.WfBackBtn.prototype,"disabled",2),Ne([gt({type:Boolean,attribute:"hide-on-first"})],t.WfBackBtn.prototype,"hideOnFirst",2),t.WfBackBtn=Ne([ut("wf-back-btn")],t.WfBackBtn),t.DEFAULT_BLOCKED_DOMAINS=re,t.FormStateController=St,t.KeyboardController=xt,t.ValidationController=ie,t.createHubSpotAdapter=s,t.createRevenueHeroAdapter=o,t.createWebhookAdapter=r,t.default=we,t.getHubSpotCookie=e,t.init=be,t.isRevenueHeroLoaded=i,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
268
1105
  //# sourceMappingURL=wizard-form.min.js.map