@inploi/plugin-chatbot 14.2.0 → 14.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cdn/index.js CHANGED
@@ -1,9 +1,9 @@
1
- (function(){"use strict";var Ue;function an(e){return{lang:(e==null?void 0:e.lang)??(Ue==null?void 0:Ue.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(Ue==null?void 0:Ue.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(Ue==null?void 0:Ue.abortPipeEarly)}}var Mr;function us(e){return Mr==null?void 0:Mr.get(e)}var Vr;function ds(e){return Vr==null?void 0:Vr.get(e)}var Pr;function fs(e,t){var r;return(r=Pr==null?void 0:Pr.get(e))==null?void 0:r.get(t)}function on(e){var r,i;let t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((i=(r=Object.getPrototypeOf(e))==null?void 0:r.constructor)==null?void 0:i.name))??"null":t}function De(e,t,r,i,n){let a=n&&"input"in n?n.input:r.value,o=(n==null?void 0:n.expected)??e.expects??null,s=(n==null?void 0:n.received)??on(a),l={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:"R"}eceived ${s}`,requirement:e.requirement,path:n==null?void 0:n.path,issues:n==null?void 0:n.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},d=e.kind==="schema",p=(n==null?void 0:n.message)??e.message??fs(e.reference,l.lang)??(d?ds(l.lang):null)??i.message??us(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),d&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function ye(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},an())}}}function ps(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function hs(e,t){let r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}function sn(e){return{kind:"transformation",type:"transform",reference:sn,async:!1,operation:e,"~run"(t){return t.value=this.operation(t.value),t}}}function gs(e,t,r){return typeof e.fallback=="function"?e.fallback(t,r):e.fallback}function Or(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function ln(){return{kind:"schema",type:"any",reference:ln,expects:"any",async:!1,get"~standard"(){return ye(this)},"~run"(e){return e.typed=!0,e}}}function cn(e,t){return{kind:"schema",type:"array",reference:cn,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return ye(this)},"~run"(r,i){var a;let n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let o=0;o<n.length;o++){let s=n[o],l=this.item["~run"]({value:s},i);if(l.issues){let d={type:"array",origin:"value",input:n,key:o,value:s};for(let p of l.issues)p.path?p.path.unshift(d):p.path=[d],(a=r.issues)==null||a.push(p);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else De(this,"type",r,i);return r}}}function Lr(e){return{kind:"schema",type:"boolean",reference:Lr,expects:"boolean",async:!1,message:e,get"~standard"(){return ye(this)},"~run"(t,r){return typeof t.value=="boolean"?t.typed=!0:De(this,"type",t,r),t}}}function ir(e,t){return{kind:"schema",type:"literal",reference:ir,expects:on(e),async:!1,literal:e,message:t,get"~standard"(){return ye(this)},"~run"(r,i){return r.value===this.literal?r.typed=!0:De(this,"type",r,i),r}}}function nr(e,t){return{kind:"schema",type:"nullable",reference:nr,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,get"~standard"(){return ye(this)},"~run"(r,i){return r.value===null&&(this.default!==void 0&&(r.value=Or(this,r,i)),r.value===null)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function ar(e){return{kind:"schema",type:"number",reference:ar,expects:"number",async:!1,message:e,get"~standard"(){return ye(this)},"~run"(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:De(this,"type",t,r),t}}}function ue(e,t){return{kind:"schema",type:"object",reference:ue,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return ye(this)},"~run"(r,i){var a;let n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(let o in this.entries){let s=this.entries[o];if(o in n||(s.type==="exact_optional"||s.type==="optional"||s.type==="nullish")&&s.default!==void 0){let l=o in n?n[o]:Or(s),d=s["~run"]({value:l},i);if(d.issues){let p={type:"object",origin:"value",input:n,key:o,value:l};for(let u of d.issues)u.path?u.path.unshift(p):u.path=[p],(a=r.issues)==null||a.push(u);if(r.issues||(r.issues=d.issues),i.abortEarly){r.typed=!1;break}}d.typed||(r.typed=!1),r.value[o]=d.value}else if(s.fallback!==void 0)r.value[o]=gs(s);else if(s.type!=="exact_optional"&&s.type!=="optional"&&s.type!=="nullish"&&(De(this,"key",r,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:n,key:o,value:n[o]}]}),i.abortEarly))break}}else De(this,"type",r,i);return r}}}function Se(e,t){return{kind:"schema",type:"optional",reference:Se,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return ye(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=Or(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function un(e,t,r){return{kind:"schema",type:"record",reference:un,expects:"Object",async:!1,key:e,value:t,message:r,get"~standard"(){return ye(this)},"~run"(i,n){var o,s;let a=i.value;if(a&&typeof a=="object"){i.typed=!0,i.value={};for(let l in a)if(ps(a,l)){let d=a[l],p=this.key["~run"]({value:l},n);if(p.issues){let h={type:"object",origin:"key",input:a,key:l,value:d};for(let b of p.issues)b.path=[h],(o=i.issues)==null||o.push(b);if(i.issues||(i.issues=p.issues),n.abortEarly){i.typed=!1;break}}let u=this.value["~run"]({value:d},n);if(u.issues){let h={type:"object",origin:"value",input:a,key:l,value:d};for(let b of u.issues)b.path?b.path.unshift(h):b.path=[h],(s=i.issues)==null||s.push(b);if(i.issues||(i.issues=u.issues),n.abortEarly){i.typed=!1;break}}(!p.typed||!u.typed)&&(i.typed=!1),p.typed&&(i.value[p.value]=u.value)}}else De(this,"type",i,n);return i}}}function Ce(e){return{kind:"schema",type:"string",reference:Ce,expects:"string",async:!1,message:e,get"~standard"(){return ye(this)},"~run"(t,r){return typeof t.value=="string"?t.typed=!0:De(this,"type",t,r),t}}}function dn(e){let t;if(e)for(let r of e)t?t.push(...r.issues):t=r.issues;return t}function jr(e,t){return{kind:"schema",type:"union",reference:jr,expects:hs(e.map(r=>r.expects),"|"),async:!1,options:e,message:t,get"~standard"(){return ye(this)},"~run"(r,i){let n,a,o;for(let s of this.options){let l=s["~run"]({value:r.value},i);if(l.typed)if(l.issues)a?a.push(l):a=[l];else{n=l;break}else o?o.push(l):o=[l]}if(n)return n;if(a){if(a.length===1)return a[0];De(this,"type",r,i,{issues:dn(a)}),r.typed=!0}else{if((o==null?void 0:o.length)===1)return o[0];De(this,"type",r,i,{issues:dn(o)})}return r}}}function or(){return{kind:"schema",type:"unknown",reference:or,expects:"unknown",async:!1,get"~standard"(){return ye(this)},"~run"(e){return e.typed=!0,e}}}function bs(...e){return{...e[0],pipe:e,get"~standard"(){return ye(this)},"~run"(t,r){for(let i of e)if(i.kind!=="metadata"){if(t.issues&&(i.kind==="schema"||i.kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=i["~run"](t,r))}return t}}}function fn(e,t,r){let i=e["~run"]({value:t},an(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var vs=e=>({ok:!0,err:!1,val:e}),ws=e=>({err:!0,ok:!1,val:e}),Br=e=>e.filter(t=>(t.type==="question-boolean"||t.type==="question-enum")&&!!t.data.preApply);function Rr(e,t,r){var o,s;let i=e.find(l=>l.type==="pre-apply-result");if(!i)return;let n=(o=t[i.data.participationKey])==null?void 0:o.value,a={};if(n===!0)for(let l of Br(e)){let d=(s=t[l.data.key])==null?void 0:s.value;Array.isArray(d)&&d.length===1&&(d=d[0]),(typeof d=="boolean"||typeof d=="string")&&(a[l.data.key]=d)}return{node_id:i.id,flow_session_id:r,participation:n,answers:a}}function ms(e,t){let r=Rr(e,t,""),i=Br(e).map(a=>{let o=a.data.preApply,s=r==null?void 0:r.answers[a.data.key],l=a.type==="question-boolean"?typeof s=="boolean":a.data.options.some(d=>d.value===s);return{key:a.data.key,severity:o.severity,message:o.mismatchMessage,matched:l&&s===o.expectedValue,valid:l}}),n=(r==null?void 0:r.participation)===!1?"skipped":(r==null?void 0:r.participation)===!0&&i.length>0&&i.every(a=>a.valid)?"completed":"unavailable";return{status:n,hasHardConcerns:n==="completed"?i.some(a=>!a.matched&&a.severity==="hard"):null,hasAdvisoryConcerns:n==="completed"?i.some(a=>!a.matched&&a.severity==="advisory"):null,answers:n==="completed"?i:[]}}function ys(e,t){let r=new Set(Br(e).map(i=>i.data.key));for(let i of e)i.type==="pre-apply-result"&&(r.add(i.data.key),r.add(i.data.participationKey));return Object.fromEntries(Object.entries(t).filter(([i])=>!r.has(i)))}var Mt=(e,t)=>{if(t.length===0)return;let r=e;for(let i of t){if(r==null||typeof r!="object")return;r=r[i]}return r},_s=(e,t="all")=>{let r={},i=t==="all"?null:new Set(t);for(let n in e){let a=e[n];a&&(i&&!i.has(n)||(r[n]=a.value))}return r},xs=({key:e,submissions:t})=>{var i;let r=(i=t[e])==null?void 0:i.value;if(typeof r!="string"&&typeof r!="number")throw new Error(`Submission at “${e}” is not a string or number`);return r},pn=({key:e,path:t,submissions:r,context:i})=>{if(e==="$context"){if(!t)return;let n=Mt(i,t);switch(typeof n){case"string":return{type:"string",value:n};case"number":return{type:"number",value:n};case"boolean":return{type:"boolean",value:n};default:console.warn(`Unexpected type for $context.${t.join(".")}`,n);return}}return r[e]},ks=e=>{let t=e.split(".").pop();return t?vs(t?"."+t:""):ws("No file extension found")},Ss=(e,t)=>{if(t.length===0)return!0;let r=t.map(i=>i.toLowerCase());return e.every(i=>{let n=ks(i.name);return n.ok&&r.includes(n.val.toLowerCase())})},Vt=e=>e<=1e3?`${Math.round(e)}KB`:e<1e3*10?`${(e/1e3).toFixed(1)}MB`:`${Math.round(e/1e3)}MB`,sr=e=>typeof e=="string"?e:`+${e.countryCode} ${e.phoneNumber}`,Cs=ue({integration_response:ue({data:ue({redirect_url:Ce(),message:Se(nr(Ce())),button_text:Se(nr(Ce()))})})}),$s=e=>fn(Cs,e).success,Es=ue({integration_response:ue({status:Se(or()),error:ue({message:Ce(),data:Se(or())})})}),Is=e=>fn(Es,e).success;ue({success:ir(!1),message:Se(or())});var hn=(e,t)=>{if(!Is(e))return;let r=e.integration_response,i=r.error.data,n=typeof i=="object"&&i!==null?i:{},a=h=>typeof n[h]=="string"?n[h]:void 0,o=h=>typeof n[h]=="boolean"?n[h]:void 0,s=typeof r.status=="number"?r.status:t,l=a("phase"),d=a("verdict"),p=a("code"),u=s===409&&l==="submit"&&d==="confirmed"?"duplicate":s===410&&p==="job_closed"?"closed":l==="submit"&&d==="unknown"?"unknown":void 0;return{message:r.error.message,status:s,phase:l,retryable:o("retryable"),verdict:d,code:p,field:a("field"),outcome:u}},As=e=>{if(typeof e!="object"||e===null)return null;let t=e.integration_response;if(typeof t!="object"||t===null)return null;let r=t;if(typeof r.status!="number"||r.service!==void 0&&typeof r.service!="string")return null;let i="data"in r,n=r.error,a=typeof n=="object"&&n!==null&&typeof n.message=="string"&&"data"in n;if(!i&&!a)return null;let o=i?r.data:n.data??null;return{service:r.service??"INVALID_SERVICE",response:{status:r.status,payload:o}}},Fs=({context:e,schema:t,logger:r})=>{if(t)for(let i in t){let n=t[i];if(!n)continue;let a=Mt(e,i.split("."));if(n.required&&a==null){let o=`Configuration error in context: ${i} is required`;throw r.error(o),new Error(o)}if(a!=null)switch(n.type){case"number":if(typeof a!="number")throw new Error(`Configuration error in context: ${i} is not a number`);break;case"string":if(typeof a!="string")throw new Error(`Configuration error in context: ${i} is not a string`);break;default:n.type}}};let qe;function gn(e){return{lang:(e==null?void 0:e.lang)??(qe==null?void 0:qe.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(qe==null?void 0:qe.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(qe==null?void 0:qe.abortPipeEarly)}}let zr;function Ns(e){return zr==null?void 0:zr.get(e)}let Ur;function Ts(e){return Ur==null?void 0:Ur.get(e)}let qr;function Ds(e,t){var r;return(r=qr==null?void 0:qr.get(e))==null?void 0:r.get(t)}function bn(e){var r,i;const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((i=(r=Object.getPrototypeOf(e))==null?void 0:r.constructor)==null?void 0:i.name))??"null":t}function Me(e,t,r,i,n){const a=n&&"input"in n?n.input:r.value,o=(n==null?void 0:n.expected)??e.expects??null,s=(n==null?void 0:n.received)??bn(a),l={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:"R"}eceived ${s}`,requirement:e.requirement,path:n==null?void 0:n.path,issues:n==null?void 0:n.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},d=e.kind==="schema",p=(n==null?void 0:n.message)??e.message??Ds(e.reference,l.lang)??(d?Ts(l.lang):null)??i.message??Ns(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),d&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function $e(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},gn())}}}function Ms(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function Vs(e,t){const r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}function Hr(e,t){return{kind:"validation",type:"max_length",reference:Hr,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&Me(this,"length",r,i,{received:`${r.value.length}`}),r}}}function lr(e,t){return{kind:"validation",type:"min_length",reference:lr,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&Me(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Wr(){return{kind:"transformation",type:"trim",reference:Wr,async:!1,"~run"(e){return e.value=e.value.trim(),e}}}function Ps(e,t,r){return typeof e.fallback=="function"?e.fallback(t,r):e.fallback}function cr(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function vn(e,t){return{kind:"schema",type:"array",reference:vn,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return $e(this)},"~run"(r,i){var a;const n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let o=0;o<n.length;o++){const s=n[o],l=this.item["~run"]({value:s},i);if(l.issues){const d={type:"array",origin:"value",input:n,key:o,value:s};for(const p of l.issues)p.path?p.path.unshift(d):p.path=[d],(a=r.issues)==null||a.push(p);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else Me(this,"type",r,i);return r}}}function Kr(e){return{kind:"schema",type:"boolean",reference:Kr,expects:"boolean",async:!1,message:e,get"~standard"(){return $e(this)},"~run"(t,r){return typeof t.value=="boolean"?t.typed=!0:Me(this,"type",t,r),t}}}function H(e,t){return{kind:"schema",type:"nullable",reference:H,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,get"~standard"(){return $e(this)},"~run"(r,i){return r.value===null&&(this.default!==void 0&&(r.value=cr(this,r,i)),r.value===null)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function Pt(e,t){return{kind:"schema",type:"nullish",reference:Pt,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return $e(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=cr(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function ut(e){return{kind:"schema",type:"number",reference:ut,expects:"number",async:!1,message:e,get"~standard"(){return $e(this)},"~run"(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:Me(this,"type",t,r),t}}}function Ee(e,t){return{kind:"schema",type:"object",reference:Ee,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return $e(this)},"~run"(r,i){var a;const n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(const o in this.entries){const s=this.entries[o];if(o in n||(s.type==="exact_optional"||s.type==="optional"||s.type==="nullish")&&s.default!==void 0){const l=o in n?n[o]:cr(s),d=s["~run"]({value:l},i);if(d.issues){const p={type:"object",origin:"value",input:n,key:o,value:l};for(const u of d.issues)u.path?u.path.unshift(p):u.path=[p],(a=r.issues)==null||a.push(u);if(r.issues||(r.issues=d.issues),i.abortEarly){r.typed=!1;break}}d.typed||(r.typed=!1),r.value[o]=d.value}else if(s.fallback!==void 0)r.value[o]=Ps(s);else if(s.type!=="exact_optional"&&s.type!=="optional"&&s.type!=="nullish"&&(Me(this,"key",r,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:n,key:o,value:n[o]}]}),i.abortEarly))break}}else Me(this,"type",r,i);return r}}}function wn(e,t){return{kind:"schema",type:"optional",reference:wn,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return $e(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=cr(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function _t(e,t){return{kind:"schema",type:"picklist",reference:_t,expects:Vs(e.map(bn),"|"),async:!1,options:e,message:t,get"~standard"(){return $e(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:Me(this,"type",r,i),r}}}function Gr(e,t,r){return{kind:"schema",type:"record",reference:Gr,expects:"Object",async:!1,key:e,value:t,message:r,get"~standard"(){return $e(this)},"~run"(i,n){var o,s;const a=i.value;if(a&&typeof a=="object"){i.typed=!0,i.value={};for(const l in a)if(Ms(a,l)){const d=a[l],p=this.key["~run"]({value:l},n);if(p.issues){const h={type:"object",origin:"key",input:a,key:l,value:d};for(const b of p.issues)b.path=[h],(o=i.issues)==null||o.push(b);if(i.issues||(i.issues=p.issues),n.abortEarly){i.typed=!1;break}}const u=this.value["~run"]({value:d},n);if(u.issues){const h={type:"object",origin:"value",input:a,key:l,value:d};for(const b of u.issues)b.path?b.path.unshift(h):b.path=[h],(s=i.issues)==null||s.push(b);if(i.issues||(i.issues=u.issues),n.abortEarly){i.typed=!1;break}}(!p.typed||!u.typed)&&(i.typed=!1),p.typed&&(i.value[p.value]=u.value)}}else Me(this,"type",i,n);return i}}}function O(e){return{kind:"schema",type:"string",reference:O,expects:"string",async:!1,message:e,get"~standard"(){return $e(this)},"~run"(t,r){return typeof t.value=="string"?t.typed=!0:Me(this,"type",t,r),t}}}function mn(){return{kind:"schema",type:"unknown",reference:mn,expects:"unknown",async:!1,get"~standard"(){return $e(this)},"~run"(e){return e.typed=!0,e}}}function Yr(...e){return{...e[0],pipe:e,get"~standard"(){return $e(this)},"~run"(t,r){for(const i of e)if(i.kind!=="metadata"){if(t.issues&&(i.kind==="schema"||i.kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=i["~run"](t,r))}return t}}}function Jr(e,t,r){const i=e["~run"]({value:t},gn(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var Os=e=>e,Ls=class extends Error{constructor(t,r){super(t),this.status=r,this.name="ErrorWithStatus"}},yn=class extends Ls{constructor(t,r,i){super(t),this.data=i,this.name="ApiError",this.status=r??500}},js=e=>e instanceof yn&&e.data!==void 0,Bs={sandbox:"https://talent-bank.staging.inploi.com",production:"https://talent-bank.inploi.com",_internal_local:"http://localhost:8787"};function Rs(){return{"~standard":{vendor:"inploi",version:1,validate:e=>({value:e})}}}function Pf(e){return e}var zs=["agent","sdk","form","integration","migration"],Us=["APPLIED","SHORTLISTED","INTERVIEWED","OFFERED","HIRED","REJECTED","WITHDRAWN"],qs=["screening","cv_match","interview","overall"],Hs=["PENDING","SCHEDULED","IN_PROGRESS","COMPLETED","CANCELLED"],Ws=["careers_site","chatbot","plugin_job_search","ats_import","referral","agency","other","unknown"],_n=_t(zs),Ks=_t(Us),Gs=Yr(O(),Wr(),lr(1),Hr(100)),Ys=_t(qs),Js=_t(Hs),Zs=Yr(O(),Wr(),lr(1),Hr(100)),Xs=_t(Ws),xn=Ee({id:O(),email:H(O()),firstName:H(O()),lastName:H(O()),phone:H(O()),source:H(_n),identifiedAt:H(O()),createdAt:O(),updatedAt:O()}),kn=Yr(O(),lr(1)),Zr=Gr(O(),mn()),Qs=Ee({id:O(),applicationId:O(),status:Js,scheduledAt:H(O()),completedAt:H(O()),meta:H(Zr),createdAt:O(),updatedAt:O()}),el=Ee({score:ut(),reason:O(),confidence:ut()}),Sn=Ee({id:O(),candidateId:O(),jobId:ut(),stage:Gs,stageGroup:Ks,stageEnteredAt:O(),rating:H(ut()),disqualifiedAt:H(O()),disqualificationReason:H(Zs),disqualificationNote:H(O()),source:Xs,sourceDetail:H(O()),sessionId:H(ut()),externalApplicationId:H(O()),meta:H(Zr),context:H(Zr),scoredAt:H(O()),createdAt:O(),updatedAt:O()}),tl=Ee({id:O(),applicationId:O(),scoreType:Ys,score:H(ut()),reason:H(O()),categories:H(Gr(O(),el)),scoredBy:H(O()),createdAt:O()});({...Sn.entries},{...xn.entries});var rl=Ee({anonymousId:kn,email:kn,firstName:Pt(O()),lastName:Pt(O()),phone:Pt(O()),source:Pt(_n)}),il=Ee({candidateId:O(),isNew:Kr()}),nl=Ee({id:O(),stageGroup:O(),createdAt:O()}),al=Ee({isDuplicate:Kr(),existingApplication:wn(nl)}),ol=({environment:e,publishableKey:t,logger:r})=>{let i=Bs[e];return{async checkDuplicate(n){try{let a=new URLSearchParams({email:n.email,scope:n.scope});n.scope==="job"&&n.jobId!=null&&a.set("job_id",String(n.jobId));let o=await fetch(`${i}/applications/check-duplicate?${a}`,{method:"GET",headers:{Accept:"application/json","x-publishable-key":t}});if(!o.ok)return r.error(`[TalentBankClient] checkDuplicate failed with status ${o.status}`),{isDuplicate:!1};let s=await o.json(),l=Jr(al,s);return l.success?l.output:(r.error("[TalentBankClient] checkDuplicate response failed strict validation; falling back to isDuplicate flag"),typeof s=="object"&&s!=null&&typeof s.isDuplicate=="boolean"?{isDuplicate:s.isDuplicate}:{isDuplicate:!1})}catch(a){return r.error("[TalentBankClient] checkDuplicate failed:",a),{isDuplicate:!1}}},async identify(n){try{if(!n.anonymousId)return r.error("[TalentBankClient] identify skipped because anonymousId is missing"),null;let a={email:n.email,firstName:n.firstName,lastName:n.lastName,phone:n.phone,anonymousId:n.anonymousId,source:n.source??"sdk"},o=Jr(rl,a);if(!o.success)return r.error("[TalentBankClient] identify received invalid input"),null;let s=await fetch(`${i}/identify`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","x-publishable-key":t},body:JSON.stringify(o.output)});if(!s.ok)return r.error(`[TalentBankClient] identify failed with status ${s.status}`),null;let l=Jr(il,await s.json());return l.success?l.output:(r.error("[TalentBankClient] identify returned an invalid response"),null)}catch(a){return r.error("[TalentBankClient] identify failed:",a),null}}}},Ot,N,Cn,$n,dt,En,In,Xr,An,xt={},Fn=[],sl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ur=Array.isArray;function He(e,t){for(var r in t)e[r]=t[r];return e}function Nn(e){var t=e.parentNode;t&&t.removeChild(e)}function _e(e,t,r){var i,n,a,o={};for(a in t)a=="key"?i=t[a]:a=="ref"?n=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?Ot.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return Lt(e,o,i,n,null)}function Lt(e,t,r,i,n){var a={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:n??++Cn};return n==null&&N.vnode!=null&&N.vnode(a),a}function ll(){return{current:null}}function X(e){return e.children}function Ae(e,t){this.props=e,this.context=t}function dr(e,t){if(t==null)return e.__?dr(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?dr(e):null}function Tn(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return Tn(e)}}function Qr(e){(!e.__d&&(e.__d=!0)&&dt.push(e)&&!fr.__r++||En!==N.debounceRendering)&&((En=N.debounceRendering)||In)(fr)}function fr(){var e,t,r,i,n,a,o,s,l;for(dt.sort(Xr);e=dt.shift();)e.__d&&(t=dt.length,i=void 0,n=void 0,a=void 0,s=(o=(r=e).__v).__e,(l=r.__P)&&(i=[],n=[],(a=He({},o)).__v=o.__v+1,ei(l,o,a,r.__n,l.ownerSVGElement!==void 0,o.__h!=null?[s]:null,i,s??dr(o),o.__h,n),jn(i,o,n),o.__e!=s&&Tn(o)),dt.length>t&&dt.sort(Xr));fr.__r=0}function Dn(e,t,r,i,n,a,o,s,l,d,p){var u,h,b,m,_,I,A,v,y,S,$=0,V=i&&i.__k||Fn,q=V.length,M=q,C=t.length;for(r.__k=[],u=0;u<C;u++)(m=r.__k[u]=(m=t[u])==null||typeof m=="boolean"||typeof m=="function"?null:typeof m=="string"||typeof m=="number"||typeof m=="bigint"?Lt(null,m,null,null,m):ur(m)?Lt(X,{children:m},null,null,null):m.__b>0?Lt(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)!=null&&(m.__=r,m.__b=r.__b+1,(v=cl(m,V,A=u+$,M))===-1?b=xt:(b=V[v]||xt,V[v]=void 0,M--),ei(e,m,b,n,a,o,s,l,d,p),_=m.__e,(h=m.ref)&&b.ref!=h&&(b.ref&&ti(b.ref,null,m),p.push(h,m.__c||_,m)),_!=null&&(I==null&&(I=_),S=!(y=b===xt||b.__v===null)&&v===A,y?v==-1&&$--:v!==A&&(v===A+1?($++,S=!0):v>A?M>C-A?($+=v-A,S=!0):$--:$=v<A&&v==A-1?v-A:0),A=u+$,S=S||v==u&&!y,typeof m.type!="function"||v===A&&b.__k!==m.__k?typeof m.type=="function"||S?m.__d!==void 0?(l=m.__d,m.__d=void 0):l=_.nextSibling:l=Vn(e,_,l):l=Mn(m,l,e),typeof r.type=="function"&&(r.__d=l)));for(r.__e=I,u=q;u--;)V[u]!=null&&(typeof r.type=="function"&&V[u].__e!=null&&V[u].__e==r.__d&&(r.__d=V[u].__e.nextSibling),Bn(V[u],V[u]))}function Mn(e,t,r){for(var i,n=e.__k,a=0;n&&a<n.length;a++)(i=n[a])&&(i.__=e,t=typeof i.type=="function"?Mn(i,t,r):Vn(r,i.__e,t));return t}function We(e,t){return t=t||[],e==null||typeof e=="boolean"||(ur(e)?e.some(function(r){We(r,t)}):t.push(e)),t}function Vn(e,t,r){return r==null||r.parentNode!==e?e.insertBefore(t,null):t==r&&t.parentNode!=null||e.insertBefore(t,r),t.nextSibling}function cl(e,t,r,i){var n=e.key,a=e.type,o=r-1,s=r+1,l=t[r];if(l===null||l&&n==l.key&&a===l.type)return r;if(i>(l!=null?1:0))for(;o>=0||s<t.length;){if(o>=0){if((l=t[o])&&n==l.key&&a===l.type)return o;o--}if(s<t.length){if((l=t[s])&&n==l.key&&a===l.type)return s;s++}}return-1}function ul(e,t,r,i,n){var a;for(a in r)a==="children"||a==="key"||a in t||pr(e,a,null,r[a],i);for(a in t)n&&typeof t[a]!="function"||a==="children"||a==="key"||a==="value"||a==="checked"||r[a]===t[a]||pr(e,a,t[a],r[a],i)}function Pn(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||sl.test(t)?r:r+"px"}function pr(e,t,r,i,n){var a;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||Pn(e.style,t,"");if(r)for(t in r)i&&r[t]===i[t]||Pn(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?i||e.addEventListener(t,a?Ln:On,a):e.removeEventListener(t,a?Ln:On,a);else if(t!=="dangerouslySetInnerHTML"){if(n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function On(e){return this.l[e.type+!1](N.event?N.event(e):e)}function Ln(e){return this.l[e.type+!0](N.event?N.event(e):e)}function ei(e,t,r,i,n,a,o,s,l,d){var p,u,h,b,m,_,I,A,v,y,S,$,V,q,M,C=t.type;if(t.constructor!==void 0)return null;r.__h!=null&&(l=r.__h,s=t.__e=r.__e,t.__h=null,a=[s]),(p=N.__b)&&p(t);try{e:if(typeof C=="function"){if(A=t.props,v=(p=C.contextType)&&i[p.__c],y=p?v?v.props.value:p.__:i,r.__c?I=(u=t.__c=r.__c).__=u.__E:("prototype"in C&&C.prototype.render?t.__c=u=new C(A,y):(t.__c=u=new Ae(A,y),u.constructor=C,u.render=fl),v&&v.sub(u),u.props=A,u.state||(u.state={}),u.context=y,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),C.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=He({},u.__s)),He(u.__s,C.getDerivedStateFromProps(A,u.__s))),b=u.props,m=u.state,u.__v=t,h)C.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(C.getDerivedStateFromProps==null&&A!==b&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(A,y),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(A,u.__s,y)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=A,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(R){R&&(R.__=t)}),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(A,u.__s,y),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(b,m,_)})}if(u.context=y,u.props=A,u.__P=e,u.__e=!1,$=N.__r,V=0,"prototype"in C&&C.prototype.render){for(u.state=u.__s,u.__d=!1,$&&$(t),p=u.render(u.props,u.state,u.context),q=0;q<u._sb.length;q++)u.__h.push(u._sb[q]);u._sb=[]}else do u.__d=!1,$&&$(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++V<25);u.state=u.__s,u.getChildContext!=null&&(i=He(He({},i),u.getChildContext())),h||u.getSnapshotBeforeUpdate==null||(_=u.getSnapshotBeforeUpdate(b,m)),Dn(e,ur(M=p!=null&&p.type===X&&p.key==null?p.props.children:p)?M:[M],t,r,i,n,a,o,s,l,d),u.base=t.__e,t.__h=null,u.__h.length&&o.push(u),I&&(u.__E=u.__=null)}else a==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=dl(r.__e,t,r,i,n,a,o,l,d);(p=N.diffed)&&p(t)}catch(R){t.__v=null,(l||a!=null)&&(t.__e=s,t.__h=!!l,a[a.indexOf(s)]=null),N.__e(R,t,r)}}function jn(e,t,r){for(var i=0;i<r.length;i++)ti(r[i],r[++i],r[++i]);N.__c&&N.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(a){a.call(n)})}catch(a){N.__e(a,n.__v)}})}function dl(e,t,r,i,n,a,o,s,l){var d,p,u,h=r.props,b=t.props,m=t.type,_=0;if(m==="svg"&&(n=!0),a!=null){for(;_<a.length;_++)if((d=a[_])&&"setAttribute"in d==!!m&&(m?d.localName===m:d.nodeType===3)){e=d,a[_]=null;break}}if(e==null){if(m===null)return document.createTextNode(b);e=n?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,b.is&&b),a=null,s=!1}if(m===null)h===b||s&&e.data===b||(e.data=b);else{if(a=a&&Ot.call(e.childNodes),p=(h=r.props||xt).dangerouslySetInnerHTML,u=b.dangerouslySetInnerHTML,!s){if(a!=null)for(h={},_=0;_<e.attributes.length;_++)h[e.attributes[_].name]=e.attributes[_].value;(u||p)&&(u&&(p&&u.__html==p.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(ul(e,b,h,n,s),u)t.__k=[];else if(Dn(e,ur(_=t.props.children)?_:[_],t,r,i,n&&m!=="foreignObject",a,o,a?a[0]:r.__k&&dr(r,0),s,l),a!=null)for(_=a.length;_--;)a[_]!=null&&Nn(a[_]);s||("value"in b&&(_=b.value)!==void 0&&(_!==e.value||m==="progress"&&!_||m==="option"&&_!==h.value)&&pr(e,"value",_,h.value,!1),"checked"in b&&(_=b.checked)!==void 0&&_!==e.checked&&pr(e,"checked",_,h.checked,!1))}return e}function ti(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(i){N.__e(i,r)}}function Bn(e,t,r){var i,n;if(N.unmount&&N.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||ti(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){N.__e(a,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Bn(i[n],t,r||typeof e.type!="function");r||e.__e==null||Nn(e.__e),e.__=e.__e=e.__d=void 0}function fl(e,t,r){return this.constructor(e,r)}function ft(e,t,r){var i,n,a,o;N.__&&N.__(e,t),n=(i=typeof r=="function")?null:r&&r.__k||t.__k,a=[],o=[],ei(t,e=(!i&&r||t).__k=_e(X,null,[e]),n||xt,xt,t.ownerSVGElement!==void 0,!i&&r?[r]:n?null:t.firstChild?Ot.call(t.childNodes):null,a,!i&&r?r:n?n.__e:t.firstChild,i,o),jn(a,e,o)}function Rn(e,t){ft(e,t,Rn)}function pl(e,t,r){var i,n,a,o,s=He({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)a=="key"?i=t[a]:a=="ref"?n=t[a]:s[a]=t[a]===void 0&&o!==void 0?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?Ot.call(arguments,2):r),Lt(e.type,s,i||e.key,n||e.ref,null)}function zn(e,t){var r={__c:t="__cC"+An++,__:e,Consumer:function(i,n){return i.children(n)},Provider:function(i){var n,a;return this.getChildContext||(n=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&n.some(function(s){s.__e=!0,Qr(s)})},this.sub=function(o){n.push(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){n.splice(n.indexOf(o),1),s&&s.call(o)}}),i.children}};return r.Provider.__=r.Consumer.contextType=r}Ot=Fn.slice,N={__e:function(e,t,r,i){for(var n,a,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&a.getDerivedStateFromError!=null&&(n.setState(a.getDerivedStateFromError(e)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(s){e=s}throw e}},Cn=0,$n=function(e){return e!=null&&e.constructor===void 0},Ae.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=He({},this.state),typeof e=="function"&&(e=e(He({},r),this.props)),e&&He(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Qr(this))},Ae.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Qr(this))},Ae.prototype.render=X,dt=[],In=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Xr=function(e,t){return e.__v.__b-t.__v.__b},fr.__r=0,An=0;function Un(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=Un(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function Ke(){for(var e,t,r=0,i="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=Un(e))&&(i&&(i+=" "),i+=t);return i}const qn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hn=Ke,pt=(e,t)=>r=>{var i;if((t==null?void 0:t.variants)==null)return Hn(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:n,defaultVariants:a}=t,o=Object.keys(n).map(d=>{const p=r==null?void 0:r[d],u=a==null?void 0:a[d];if(p===null)return null;const h=qn(p)||qn(u);return n[d][h]}),s=r&&Object.entries(r).reduce((d,p)=>{let[u,h]=p;return h===void 0||(d[u]=h),d},{}),l=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((d,p)=>{let{class:u,className:h,...b}=p;return Object.entries(b).every(m=>{let[_,I]=m;return Array.isArray(I)?I.includes({...a,...s}[_]):{...a,...s}[_]===I})?[...d,u,h]:d},[]);return Hn(e,o,l,r==null?void 0:r.class,r==null?void 0:r.className)};var tt,G,ri,Wn,kt=0,Kn=[],hr=[],Gn=N.__b,Yn=N.__r,Jn=N.diffed,Zn=N.__c,Xn=N.unmount;function St(e,t){N.__h&&N.__h(G,e,kt||t),kt=0;var r=G.__H||(G.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:hr}),r.__[e]}function Ge(e){return kt=1,Qn(ra,e)}function Qn(e,t,r){var i=St(tt++,2);if(i.t=e,!i.__c&&(i.__=[r?r(t):ra(void 0,t),function(s){var l=i.__N?i.__N[0]:i.__[0],d=i.t(l,s);l!==d&&(i.__N=[d,i.__[1]],i.__c.setState({}))}],i.__c=G,!G.u)){var n=function(s,l,d){if(!i.__c.__H)return!0;var p=i.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!a||a.call(this,s,l,d);var u=!1;return p.forEach(function(h){if(h.__N){var b=h.__[0];h.__=h.__N,h.__N=void 0,b!==h.__[0]&&(u=!0)}}),!(!u&&i.__c.props===s)&&(!a||a.call(this,s,l,d))};G.u=!0;var a=G.shouldComponentUpdate,o=G.componentWillUpdate;G.componentWillUpdate=function(s,l,d){if(this.__e){var p=a;a=void 0,n(s,l,d),a=p}o&&o.call(this,s,l,d)},G.shouldComponentUpdate=n}return i.__N||i.__}function ii(e,t){var r=St(tt++,3);!N.__s&&ai(r.__H,t)&&(r.__=e,r.i=t,G.__H.__h.push(r))}function be(e,t){var r=St(tt++,4);!N.__s&&ai(r.__H,t)&&(r.__=e,r.i=t,G.__h.push(r))}function ve(e){return kt=5,rt(function(){return{current:e}},[])}function hl(e,t,r){kt=6,be(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function rt(e,t){var r=St(tt++,7);return ai(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function gl(e,t){return kt=8,rt(function(){return e},t)}function ea(e){var t=G.context[e.__c],r=St(tt++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(G)),t.props.value):e.__}function bl(e,t){N.useDebugValue&&N.useDebugValue(t?t(e):e)}function vl(){var e=St(tt++,11);if(!e.__){for(var t=G.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function wl(){for(var e;e=Kn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(gr),e.__H.__h.forEach(ni),e.__H.__h=[]}catch(t){e.__H.__h=[],N.__e(t,e.__v)}}N.__b=function(e){G=null,Gn&&Gn(e)},N.__r=function(e){Yn&&Yn(e),tt=0;var t=(G=e.__c).__H;t&&(ri===G?(t.__h=[],G.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=hr,r.__N=r.i=void 0})):(t.__h.forEach(gr),t.__h.forEach(ni),t.__h=[],tt=0)),ri=G},N.diffed=function(e){Jn&&Jn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Kn.push(t)!==1&&Wn===N.requestAnimationFrame||((Wn=N.requestAnimationFrame)||ml)(wl)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==hr&&(r.__=r.__V),r.i=void 0,r.__V=hr})),ri=G=null},N.__c=function(e,t){t.some(function(r){try{r.__h.forEach(gr),r.__h=r.__h.filter(function(i){return!i.__||ni(i)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],N.__e(i,r.__v)}}),Zn&&Zn(e,t)},N.unmount=function(e){Xn&&Xn(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(i){try{gr(i)}catch(n){t=n}}),r.__H=void 0,t&&N.__e(t,r.__v))};var ta=typeof requestAnimationFrame=="function";function ml(e){var t,r=function(){clearTimeout(i),ta&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,100);ta&&(t=requestAnimationFrame(r))}function gr(e){var t=G,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),G=t}function ni(e){var t=G;e.__c=e.__(),G=t}function ai(e,t){return!e||e.length!==t.length||t.some(function(r,i){return r!==e[i]})}function ra(e,t){return typeof t=="function"?t(e):t}function ia(e,t){for(var r in t)e[r]=t[r];return e}function oi(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var i in t)if(i!=="__source"&&e[i]!==t[i])return!0;return!1}function si(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function li(e){this.props=e}function yl(e,t){function r(n){var a=this.props.ref,o=a==n.ref;return!o&&a&&(a.call?a(null):a.current=null),t?!t(this.props,n)||!o:oi(this.props,n)}function i(n){return this.shouldComponentUpdate=r,_e(e,n)}return i.displayName="Memo("+(e.displayName||e.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}(li.prototype=new Ae).isPureReactComponent=!0,li.prototype.shouldComponentUpdate=function(e,t){return oi(this.props,e)||oi(this.state,t)};var na=N.__b;N.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),na&&na(e)};var _l=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ci(e){function t(r){var i=ia({},r);return delete i.ref,e(i,r.ref||null)}return t.$$typeof=_l,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var aa=function(e,t){return e==null?null:We(We(e).map(t))},xl={map:aa,forEach:aa,count:function(e){return e?We(e).length:0},only:function(e){var t=We(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:We},kl=N.__e;N.__e=function(e,t,r,i){if(e.then){for(var n,a=t;a=a.__;)if((n=a.__c)&&n.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),n.__c(e,t)}kl(e,t,r,i)};var oa=N.unmount;function sa(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(i){typeof i.__c=="function"&&i.__c()}),e.__c.__H=null),(e=ia({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(i){return sa(i,t,r)})),e}function la(e,t,r){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(i){return la(i,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=r)),e}function jt(){this.__u=0,this.t=null,this.__b=null}function ca(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ua(e){var t,r,i;function n(a){if(t||(t=e()).then(function(o){r=o.default||o},function(o){i=o}),i)throw i;if(!r)throw t;return _e(r,a)}return n.displayName="Lazy",n.__f=!0,n}function Bt(){this.u=null,this.o=null}N.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),oa&&oa(e)},(jt.prototype=new Ae).__c=function(e,t){var r=t.__c,i=this;i.t==null&&(i.t=[]),i.t.push(r);var n=ca(i.__v),a=!1,o=function(){a||(a=!0,r.__R=null,n?n(s):s())};r.__R=o;var s=function(){if(!--i.__u){if(i.state.__a){var d=i.state.__a;i.__v.__k[0]=la(d,d.__c.__P,d.__c.__O)}var p;for(i.setState({__a:i.__b=null});p=i.t.pop();)p.forceUpdate()}},l=t.__h===!0;i.__u++||l||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(o,o)},jt.prototype.componentWillUnmount=function(){this.t=[]},jt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=sa(this.__b,r,i.__O=i.__P)}this.__b=null}var n=t.__a&&_e(X,null,e.fallback);return n&&(n.__h=null),[_e(X,null,t.__a?null:e.children),n]};var da=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function Sl(e){return this.getChildContext=function(){return e.context},e.children}function Cl(e){var t=this,r=e.i;t.componentWillUnmount=function(){ft(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),e.__v?(t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(i){this.childNodes.push(i),t.i.appendChild(i)},insertBefore:function(i,n){this.childNodes.push(i),t.i.appendChild(i)},removeChild:function(i){this.childNodes.splice(this.childNodes.indexOf(i)>>>1,1),t.i.removeChild(i)}}),ft(_e(Sl,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function $l(e,t){var r=_e(Cl,{__v:e,i:t});return r.containerInfo=t,r}(Bt.prototype=new Ae).__a=function(e){var t=this,r=ca(t.__v),i=t.o.get(e);return i[0]++,function(n){var a=function(){t.props.revealOrder?(i.push(n),da(t,e,i)):n()};r?r(a):a()}},Bt.prototype.render=function(e){this.u=null,this.o=new Map;var t=We(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},Bt.prototype.componentDidUpdate=Bt.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){da(e,r,t)})};var fa=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,El=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Il=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Al=/[A-Z0-9]/g,Fl=typeof document<"u",Nl=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Tl(e,t,r){return t.__k==null&&(t.textContent=""),ft(e,t),typeof r=="function"&&r(),e?e.__c:null}function Dl(e,t,r){return Rn(e,t),typeof r=="function"&&r(),e?e.__c:null}Ae.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ae.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var pa=N.event;function Ml(){}function Vl(){return this.cancelBubble}function Pl(){return this.defaultPrevented}N.event=function(e){return pa&&(e=pa(e)),e.persist=Ml,e.isPropagationStopped=Vl,e.isDefaultPrevented=Pl,e.nativeEvent=e};var ui,Ol={enumerable:!1,configurable:!0,get:function(){return this.class}},ha=N.vnode;N.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,i=t.type,n={};for(var a in r){var o=r[a];if(!(a==="value"&&"defaultValue"in r&&o==null||Fl&&a==="children"&&i==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&o===!0?o="":s==="ondoubleclick"?a="ondblclick":s!=="onchange"||i!=="input"&&i!=="textarea"||Nl(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":Il.test(a)?a=s:i.indexOf("-")===-1&&El.test(a)?a=a.replace(Al,"-$&").toLowerCase():o===null&&(o=void 0):s=a="oninput",s==="oninput"&&n[a=s]&&(a="oninputCapture"),n[a]=o}}i=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=We(r.children).forEach(function(l){l.props.selected=n.value.indexOf(l.props.value)!=-1})),i=="select"&&n.defaultValue!=null&&(n.value=We(r.children).forEach(function(l){l.props.selected=n.multiple?n.defaultValue.indexOf(l.props.value)!=-1:n.defaultValue==l.props.value})),r.class&&!r.className?(n.class=r.class,Object.defineProperty(n,"className",Ol)):(r.className&&!r.class||r.class&&r.className)&&(n.class=n.className=r.className),t.props=n}(e),e.$$typeof=fa,ha&&ha(e)};var ga=N.__r;N.__r=function(e){ga&&ga(e),ui=e.__c};var ba=N.diffed;N.diffed=function(e){ba&&ba(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),ui=null};var Ll={ReactCurrentDispatcher:{current:{readContext:function(e){return ui.__n[e.__c].props.value}}}};function jl(e){return _e.bind(null,e)}function va(e){return!!e&&e.$$typeof===fa}function Bl(e){return va(e)?pl.apply(null,arguments):e}function Rl(e){return!!e.__k&&(ft(null,e),!0)}function zl(e){return e&&(e.base||e.nodeType===1&&e)||null}var Ul=function(e,t){return e(t)},ql=function(e,t){return e(t)},Hl=X;function wa(e){e()}function Wl(e){return e}function Kl(){return[!1,wa]}var Gl=be;function Yl(e,t){var r=t(),i=Ge({h:{__:r,v:t}}),n=i[0].h,a=i[1];return be(function(){n.__=r,n.v=t,si(n.__,t())||a({h:n})},[e,r,t]),ii(function(){return si(n.__,n.v())||a({h:n}),e(function(){si(n.__,n.v())||a({h:n})})},[e]),r}var de={useState:Ge,useId:vl,useReducer:Qn,useEffect:ii,useLayoutEffect:be,useInsertionEffect:Gl,useTransition:Kl,useDeferredValue:Wl,useSyncExternalStore:Yl,startTransition:wa,useRef:ve,useImperativeHandle:hl,useMemo:rt,useCallback:gl,useContext:ea,useDebugValue:bl,version:"17.0.2",Children:xl,render:Tl,hydrate:Dl,unmountComponentAtNode:Rl,createPortal:$l,createElement:_e,createContext:zn,createFactory:jl,cloneElement:Bl,createRef:ll,Fragment:X,isValidElement:va,findDOMNode:zl,Component:Ae,PureComponent:li,memo:yl,forwardRef:ci,flushSync:ql,unstable_batchedUpdates:Ul,StrictMode:Hl,Suspense:jt,SuspenseList:Bt,lazy:ua,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ll};const fe=Symbol.for("@ts-pattern/matcher"),ma=Symbol.for("@ts-pattern/isVariadic"),br="@ts-pattern/anonymous-select-key",di=e=>!!(e&&typeof e=="object"),vr=e=>e&&!!e[fe],Q=(e,t,r)=>{if(vr(e)){const i=e[fe](),{matched:n,selections:a}=i.match(t);return n&&a&&Object.keys(a).forEach(o=>r(o,a[o])),n}if(di(e)){if(!di(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let i=[],n=[],a=[];for(const o of e.keys()){const s=e[o];vr(s)&&s[ma]?a.push(s):a.length?n.push(s):i.push(s)}if(a.length){if(a.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<i.length+n.length)return!1;const o=t.slice(0,i.length),s=n.length===0?[]:t.slice(-n.length),l=t.slice(i.length,n.length===0?1/0:-n.length);return i.every((d,p)=>Q(d,o[p],r))&&n.every((d,p)=>Q(d,s[p],r))&&(a.length===0||Q(a[0],l,r))}return e.length===t.length&&e.every((o,s)=>Q(o,t[s],r))}return Reflect.ownKeys(e).every(i=>{const n=e[i];return(i in t||vr(a=n)&&a[fe]().matcherType==="optional")&&Q(n,t[i],r);var a})}return Object.is(t,e)},pe=e=>{var t,r,i;return di(e)?vr(e)?(t=(r=(i=e[fe]()).getSelectionKeys)==null?void 0:r.call(i))!=null?t:[]:Array.isArray(e)?Rt(e,pe):Rt(Object.values(e),pe):[]},Rt=(e,t)=>e.reduce((r,i)=>r.concat(t(i)),[]);function Jl(...e){if(e.length===1){const[t]=e;return r=>Q(t,r,()=>{})}if(e.length===2){const[t,r]=e;return Q(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function re(e){return Object.assign(e,{optional:()=>pi(e),and:t=>Y(e,t),or:t=>ya(e,t),select:t=>t===void 0?zt(e):zt(t,e)})}function fi(e){return Object.assign((t=>Object.assign(t,{[Symbol.iterator](){let r=0;const i=[{value:Object.assign(t,{[ma]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var n;return(n=i[r++])!=null?n:i.at(-1)}}}}))(e),{optional:()=>fi(pi(e)),select:t=>fi(t===void 0?zt(e):zt(t,e))})}function pi(e){return re({[fe]:()=>({match:t=>{let r={};const i=(n,a)=>{r[n]=a};return t===void 0?(pe(e).forEach(n=>i(n,void 0)),{matched:!0,selections:r}):{matched:Q(e,t,i),selections:r}},getSelectionKeys:()=>pe(e),matcherType:"optional"})})}const Zl=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},Xl=(e,t)=>{for(const[r,i]of e.entries())if(!t(i,r))return!1;return!0},Ql=(e,t)=>{const r=Reflect.ownKeys(e);for(const i of r)if(!t(i,e[i]))return!1;return!0};function Y(...e){return re({[fe]:()=>({match:t=>{let r={};const i=(n,a)=>{r[n]=a};return{matched:e.every(n=>Q(n,t,i)),selections:r}},getSelectionKeys:()=>Rt(e,pe),matcherType:"and"})})}function ya(...e){return re({[fe]:()=>({match:t=>{let r={};const i=(n,a)=>{r[n]=a};return Rt(e,pe).forEach(n=>i(n,void 0)),{matched:e.some(n=>Q(n,t,i)),selections:r}},getSelectionKeys:()=>Rt(e,pe),matcherType:"or"})})}function j(e){return{[fe]:()=>({match:t=>({matched:!!e(t)})})}}function zt(...e){const t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return re({[fe]:()=>({match:i=>{let n={[t??br]:i};return{matched:r===void 0||Q(r,i,(a,o)=>{n[a]=o}),selections:n}},getSelectionKeys:()=>[t??br].concat(r===void 0?[]:pe(r))})})}function _a(e){return!0}function Ve(e){return typeof e=="number"}function it(e){return typeof e=="string"}function nt(e){return typeof e=="bigint"}const xa=re(j(_a)),ec=re(j(_a)),tc=xa,at=e=>Object.assign(re(e),{startsWith:t=>{return at(Y(e,(r=t,j(i=>it(i)&&i.startsWith(r)))));var r},endsWith:t=>{return at(Y(e,(r=t,j(i=>it(i)&&i.endsWith(r)))));var r},minLength:t=>at(Y(e,(r=>j(i=>it(i)&&i.length>=r))(t))),length:t=>at(Y(e,(r=>j(i=>it(i)&&i.length===r))(t))),maxLength:t=>at(Y(e,(r=>j(i=>it(i)&&i.length<=r))(t))),includes:t=>{return at(Y(e,(r=t,j(i=>it(i)&&i.includes(r)))));var r},regex:t=>{return at(Y(e,(r=t,j(i=>it(i)&&!!i.match(r)))));var r}}),ka=at(j(it)),Pe=e=>Object.assign(re(e),{between:(t,r)=>Pe(Y(e,((i,n)=>j(a=>Ve(a)&&i<=a&&n>=a))(t,r))),lt:t=>Pe(Y(e,(r=>j(i=>Ve(i)&&i<r))(t))),gt:t=>Pe(Y(e,(r=>j(i=>Ve(i)&&i>r))(t))),lte:t=>Pe(Y(e,(r=>j(i=>Ve(i)&&i<=r))(t))),gte:t=>Pe(Y(e,(r=>j(i=>Ve(i)&&i>=r))(t))),int:()=>Pe(Y(e,j(t=>Ve(t)&&Number.isInteger(t)))),finite:()=>Pe(Y(e,j(t=>Ve(t)&&Number.isFinite(t)))),positive:()=>Pe(Y(e,j(t=>Ve(t)&&t>0))),negative:()=>Pe(Y(e,j(t=>Ve(t)&&t<0)))}),rc=Pe(j(Ve)),ot=e=>Object.assign(re(e),{between:(t,r)=>ot(Y(e,((i,n)=>j(a=>nt(a)&&i<=a&&n>=a))(t,r))),lt:t=>ot(Y(e,(r=>j(i=>nt(i)&&i<r))(t))),gt:t=>ot(Y(e,(r=>j(i=>nt(i)&&i>r))(t))),lte:t=>ot(Y(e,(r=>j(i=>nt(i)&&i<=r))(t))),gte:t=>ot(Y(e,(r=>j(i=>nt(i)&&i>=r))(t))),positive:()=>ot(Y(e,j(t=>nt(t)&&t>0))),negative:()=>ot(Y(e,j(t=>nt(t)&&t<0)))}),ic=ot(j(nt)),nc=re(j(function(e){return typeof e=="boolean"})),ac=re(j(function(e){return typeof e=="symbol"})),oc=re(j(function(e){return e==null})),sc=re(j(function(e){return e!=null}));var Ut={__proto__:null,matcher:fe,optional:pi,array:function(...e){return fi({[fe]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const r=e[0];let i={};if(t.length===0)return pe(r).forEach(a=>{i[a]=[]}),{matched:!0,selections:i};const n=(a,o)=>{i[a]=(i[a]||[]).concat([o])};return{matched:t.every(a=>Q(r,a,n)),selections:i}},getSelectionKeys:()=>e.length===0?[]:pe(e[0])})})},set:function(...e){return re({[fe]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};if(e.length===0)return{matched:!0};const i=(a,o)=>{r[a]=(r[a]||[]).concat([o])},n=e[0];return{matched:Zl(t,a=>Q(n,a,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:pe(e[0])})})},map:function(...e){return re({[fe]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const i=(s,l)=>{r[s]=(r[s]||[]).concat([l])};if(e.length===0)return{matched:!0};var n;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(n=e[0])==null?void 0:n.toString()}`);const[a,o]=e;return{matched:Xl(t,(s,l)=>{const d=Q(a,l,i),p=Q(o,s,i);return d&&p}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...pe(e[0]),...pe(e[1])]})})},record:function(...e){return re({[fe]:()=>({match:t=>{if(t===null||typeof t!="object"||Array.isArray(t))return{matched:!1};var r;if(e.length===0)throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(r=e[0])==null?void 0:r.toString()}`);let i={};const n=(s,l)=>{i[s]=(i[s]||[]).concat([l])},[a,o]=e.length===1?[ka,e[0]]:e;return{matched:Ql(t,(s,l)=>{const d=typeof s!="string"||Number.isNaN(Number(s))?null:Number(s),p=d!==null&&Q(a,d,n),u=Q(a,s,n),h=Q(o,l,n);return(u||p)&&h}),selections:i}},getSelectionKeys:()=>e.length===0?[]:[...pe(e[0]),...pe(e[1])]})})},intersection:Y,union:ya,not:function(e){return re({[fe]:()=>({match:t=>({matched:!Q(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:j,select:zt,any:xa,unknown:ec,_:tc,string:ka,number:rc,bigint:ic,boolean:nc,symbol:ac,nullish:oc,nonNullable:sc,instanceOf:function(e){return re(j(function(t){return r=>r instanceof t}(e)))},shape:function(e){return re(j(Jl(e)))}};class lc extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}}const hi={matched:!1,value:void 0};function wr(e){return new mr(e,hi)}class mr{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;const r=t[t.length-1],i=[t[0]];let n;t.length===3&&typeof t[1]=="function"?n=t[1]:t.length>2&&i.push(...t.slice(1,t.length-1));let a=!1,o={};const s=(d,p)=>{a=!0,o[d]=p},l=!i.some(d=>Q(d,this.input,s))||n&&!n(this.input)?hi:{matched:!0,value:r(a?br in o?o[br]:o:this.input,this.input)};return new mr(this.input,l)}when(t,r){if(this.state.matched)return this;const i=!!t(this.input);return new mr(this.input,i?{matched:!0,value:r(this.input,this.input)}:hi)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(t=cc){return this.state.matched?this.state.value:t(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}}function cc(e){throw new lc(e)}var uc=["other","few","many","two","one","zero"],Sa=({terms:e,overrides:t,locale:r})=>{const i=new Intl.PluralRules(r);function n(a,o){const s=(t==null?void 0:t[a])??e[a];switch(typeof s){case"string":return s.replace(/{{(\w+)}}/g,(l,d)=>{var p;return((p=o==null?void 0:o[d])==null?void 0:p.toString())??""});case"object":{if(typeof(o==null?void 0:o.count)!="number")throw new Error(`Missing count for translation key “${a.toString()}”`);let l=i.select(o.count);if(!(l in s)){const d=uc.find(p=>p in s);if(!d)throw new Error(`Missing plural rule for translation key “${a.toString()}”`);l=d}return s[l].replace(/{{(\w+)}}/g,(d,p)=>{var u;return((u=o==null?void 0:o[p])==null?void 0:u.toString())??""})}default:throw new Error(`Invalid translation value in dictionary for key “${a.toString()}”.`)}}return n},dc=0;function c(e,t,r,i,n,a){var o,s,l={};for(s in t)s=="ref"?o=t[s]:l[s]=t[s];var d={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--dc,__source:n,__self:a};if(typeof e=="function"&&(o=e.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return N.vnode&&N.vnode(d),d}var Ca=zn(null),$a=e=>({defaultTerms:e,TranslationProvider:({terms:t,children:r,locale:i})=>{const n=rt(()=>Sa({locale:i,terms:e,overrides:t}),[t,i]);return c(Ca.Provider,{value:{t:n,locale:i},children:r})},useTranslation:()=>{const t=ea(Ca);if(t===null)throw new Error("Please wrap useTranslation in a TranslationProvider");return{t:t.t,locale:t.locale}},createTFunction:({overrides:t,locale:r})=>Sa({terms:e,overrides:t,locale:r})}),{TranslationProvider:Of,useTranslation:Lf,createTFunction:jf,defaultTerms:fc}=$a({submission_redirect_message:"Almost there! Please complete your submission here:",complete_submission:"Complete submission",submission_completed:"Submission completed!",submission_failed:"Failed to submit",close_application:"Close application",invalid_state:"Invalid application state",redirect_url_error:"Couldn’t get the redirect URL.",upload_file:{one:"Select file to upload",other:"Select files to upload"},file_max_size:"max {{size}}",file_extensions:"Accepted file extensions",address_error:"Something went wrong! Plase continue manually",address_search:"Type and search for places…",address_manual:"Fill in manually",back:"Back",search:"Search",unknown_error:"An error occurred",line1:"Line 1",line2:"Line 2",line3:"Line 3",city:"City",state:"State",postcode:"Postcode",country:"Country",select_country:"Select a country",validation_empty:"Please enter a value",validation_date:"Please enter a valid date (YYYY-MM-DD)",validation_email:"That doesn’t look like a valid email address",validation_url:"That doesn’t look like a valid URL",validation_max_chars:"Please enter no more than {{count}} characters",validation_min_chars:"Please enter {{count}} or more characters",validation_phone:"Please enter a valid phone number",validation_phone_min_chars:"Your phone number must be at least {{count}} digits long",validation_country_code:"Please select a country code",validation_number:"Please enter a valid number",validation_number_min:"Please enter a number greater than or equal to {{min}}",validation_number_max:"Please enter a number less than or equal to {{max}}",validation_number_decimal_cases:"Please enter a number with at most {{count}} decimal cases",validation_file:"Please select a file",validation_file_ext:"Please only upload {{ext}} files",validation_file_min:{one:"Please upload at least one file",other:"Please only upload at least {{count}} files"},validation_file_max:{one:"Please only upload one file",other:"Please only upload up to {{count}} files"},validation_file_size:"Your file is too big. Please upload a file smaller than {{size}}",validation_required:"This field is required.",validation_multiple_choice_min:{one:"Please select at least {{count}} option",other:"Please select at least {{count}} options"},validation_multiple_choice_max:{one:"Please select at most {{count}} option",other:"Please select at most {{count}} options"},optional:"optional"});const{TranslationProvider:pc,useTranslation:le,createTFunction:hc}=$a({...fc,error_heading:"Something unexpected happened",undo:"Change answer",conversation_history:"Conversation history",jump_to_current:"Jump to current question",send:"Send",submitting:"Sending your application…",skip:"Skip",skipped:"Skipped",submission_closed:"This role is no longer accepting applications.",submission_duplicate:"You've already applied for this role, so we haven't submitted a second application. If that doesn't sound right, check your email for a confirmation or try again in a few minutes.",submission_duplicate_earlier_attempt:"It looks like your earlier attempt did go through. You don't need to apply again — check your email for confirmation.",submission_retryable:"We couldn't submit your application. Please try again.",submission_failed:"We couldn't submit your application. Choose Restart to try again.",submission_unknown:"We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.",submission_unreadable_document:"We couldn't read that file. Please upload a different one.",submission_still_working:"Still working — the employer's application system is taking a little longer than usual. Please keep this window open.",file_preparing:{one:"Preparing your file…",other:"Preparing your files…"},file_ready:{one:"Your file is ready to send",other:"Your files are ready to send"},file_read_error:"We couldn't read this file. Select it again or choose another file.",file_read_error_replacement:"We couldn't read this file, so your previous file is no longer selected. Select it again or choose another file.",address_error:"We couldn't search for that address. Try again, or fill it in manually.",address_searching:"Searching addresses…",address_no_results:"We couldn't find that address. Check the spelling or postcode, or fill it in manually.",maximize:"Maximise",minimize:"Minimise"}),Bf="";function Ye(e,t){if(!e)throw new Error(t)}var gi=e=>e===null||typeof e!="object"?e:Array.isArray(e)?e.map(gi):Object.keys(e).sort().reduce((t,r)=>(t[r]=gi(e[r]),t),{}),gc=e=>{let t=JSON.stringify(gi(e)),r=5381;for(let i=0;i<t.length;i++)r=r*33^t.charCodeAt(i);return(r>>>0).toString(36)},bc=Symbol.for("preact-signals");function bi(){if(Ct>1)Ct--;else{for(var e,t=!1;qt!==void 0;){var r=qt;for(qt=void 0,vi++;r!==void 0;){var i=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ia(r))try{r.c()}catch(n){t||(e=n,t=!0)}r=i}}if(vi=0,Ct--,t)throw e}}var W=void 0,qt=void 0,Ct=0,vi=0,yr=0;function Ea(e){if(W!==void 0){var t=e.n;if(t===void 0||t.t!==W)return t={i:0,S:e,p:W.s,n:void 0,t:W,e:void 0,x:void 0,r:t},W.s!==void 0&&(W.s.n=t),W.s=t,e.n=t,32&W.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=W.s,t.n=void 0,W.s.n=t,W.s=t),t}}function se(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}se.prototype.brand=bc,se.prototype.h=function(){return!0},se.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},se.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}},se.prototype.subscribe=function(e){var t=this;return mi(function(){var r=t.value,i=W;W=void 0;try{e(r)}finally{W=i}})},se.prototype.valueOf=function(){return this.value},se.prototype.toString=function(){return this.value+""},se.prototype.toJSON=function(){return this.value},se.prototype.peek=function(){var e=W;W=void 0;try{return this.value}finally{W=e}},Object.defineProperty(se.prototype,"value",{get:function(){var e=Ea(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(vi>100)throw new Error("Cycle detected");this.v=e,this.i++,yr++,Ct++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{bi()}}}});function Je(e){return new se(e)}function Ia(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Aa(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Fa(e){for(var t=e.s,r=void 0;t!==void 0;){var i=t.p;t.i===-1?(t.S.U(t),i!==void 0&&(i.n=t.n),t.n!==void 0&&(t.n.p=i)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=i}e.s=r}function $t(e){se.call(this,void 0),this.x=e,this.s=void 0,this.g=yr-1,this.f=4}($t.prototype=new se).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===yr))return!0;if(this.g=yr,this.f|=1,this.i>0&&!Ia(this))return this.f&=-2,!0;var e=W;try{Aa(this),W=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return W=e,Fa(this),this.f&=-2,!0},$t.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}se.prototype.S.call(this,e)},$t.prototype.U=function(e){if(this.t!==void 0&&(se.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},$t.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty($t.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ea(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function vc(e){return new $t(e)}function Na(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Ct++;var r=W;W=void 0;try{t()}catch(i){throw e.f&=-2,e.f|=8,wi(e),i}finally{W=r,bi()}}}function wi(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Na(e)}function wc(e){if(W!==this)throw new Error("Out-of-order effect");Fa(this),W=e,this.f&=-2,8&this.f&&wi(this),bi()}function Ht(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Ht.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Ht.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Na(this),Aa(this),Ct++;var e=W;return W=this,wc.bind(this,e)},Ht.prototype.N=function(){2&this.f||(this.f|=2,this.o=qt,qt=this)},Ht.prototype.d=function(){this.f|=8,1&this.f||wi(this)};function mi(e){var t=new Ht(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var yi;function Et(e,t){N[e]=t.bind(null,N[e]||function(){})}function _r(e){yi&&yi(),yi=e&&e.S()}function Ta(e){var t=this,r=e.data,i=yc(r);i.value=r;var n=rt(function(){for(var a=t.__v;a=a.__;)if(a.__c){a.__c.__$f|=4;break}return t.__$u.c=function(){var o;!$n(n.peek())&&((o=t.base)==null?void 0:o.nodeType)===3?t.base.data=n.peek():(t.__$f|=1,t.setState({}))},vc(function(){var o=i.value.value;return o===0?0:o===!0?"":o||""})},[]);return n.value}Ta.displayName="_st",Object.defineProperties(se.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ta},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Et("__b",function(e,t){if(typeof t.type=="string"){var r,i=t.props;for(var n in i)if(n!=="children"){var a=i[n];a instanceof se&&(r||(t.__np=r={}),r[n]=a,i[n]=a.peek())}}e(t)}),Et("__r",function(e,t){_r();var r,i=t.__c;i&&(i.__$f&=-2,(r=i.__$u)===void 0&&(i.__$u=r=function(n){var a;return mi(function(){a=this}),a.c=function(){i.__$f|=1,i.setState({})},a}())),_r(r),e(t)}),Et("__e",function(e,t,r,i){_r(),e(t,r,i)}),Et("diffed",function(e,t){_r();var r;if(typeof t.type=="string"&&(r=t.__e)){var i=t.__np,n=t.props;if(i){var a=r.U;if(a)for(var o in a){var s=a[o];s!==void 0&&!(o in i)&&(s.d(),a[o]=void 0)}else r.U=a={};for(var l in i){var d=a[l],p=i[l];d===void 0?(d=mc(r,l,p,n),a[l]=d):d.o(p,n)}}}e(t)});function mc(e,t,r,i){var n=t in e&&e.ownerSVGElement===void 0,a=Je(r);return{o:function(o,s){a.value=o,i=s},d:mi(function(){var o=a.value.value;i[t]!==o&&(i[t]=o,n?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}Et("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var i=r.U;if(i){r.U=void 0;for(var n in i){var a=i[n];a&&a.d()}}}}else{var o=t.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}e(t)}),Et("__h",function(e,t,r,i){(i<3||i===9)&&(t.__$f|=2),e(t,r,i)}),Ae.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var i in t)return!0;for(var n in e)if(n!=="__source"&&e[n]!==this.props[n])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function yc(e){return rt(function(){return Je(e)},[])}const _i=(e,t)=>t.some(r=>e instanceof r);let Da,Ma;function _c(){return Da||(Da=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function xc(){return Ma||(Ma=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const xi=new WeakMap,ki=new WeakMap,xr=new WeakMap;function kc(e){const t=new Promise((r,i)=>{const n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{r(ht(e.result)),n()},o=()=>{i(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",o)});return xr.set(t,e),t}function Sc(e){if(xi.has(e))return;const t=new Promise((r,i)=>{const n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{r(),n()},o=()=>{i(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});xi.set(e,t)}let Si={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return xi.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return ht(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function Va(e){Si=e(Si)}function Cc(e){return xc().includes(e)?function(...t){return e.apply(Ci(this),t),ht(this.request)}:function(...t){return ht(e.apply(Ci(this),t))}}function $c(e){return typeof e=="function"?Cc(e):(e instanceof IDBTransaction&&Sc(e),_i(e,_c())?new Proxy(e,Si):e)}function ht(e){if(e instanceof IDBRequest)return kc(e);if(ki.has(e))return ki.get(e);const t=$c(e);return t!==e&&(ki.set(e,t),xr.set(t,e)),t}const Ci=e=>xr.get(e);function Ec(e,t,{blocked:r,upgrade:i,blocking:n,terminated:a}={}){const o=indexedDB.open(e,t),s=ht(o);return i&&o.addEventListener("upgradeneeded",l=>{i(ht(o.result),l.oldVersion,l.newVersion,ht(o.transaction),l)}),r&&o.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),s.then(l=>{a&&l.addEventListener("close",()=>a()),n&&l.addEventListener("versionchange",d=>n(d.oldVersion,d.newVersion,d))}).catch(()=>{}),s}const Ic=["get","getKey","getAll","getAllKeys","count"],Ac=["put","add","delete","clear"],$i=new Map;function Pa(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if($i.get(t))return $i.get(t);const r=t.replace(/FromIndex$/,""),i=t!==r,n=Ac.includes(r);if(!(r in(i?IDBIndex:IDBObjectStore).prototype)||!(n||Ic.includes(r)))return;const a=async function(o,...s){const l=this.transaction(o,n?"readwrite":"readonly");let d=l.store;return i&&(d=d.index(s.shift())),(await Promise.all([d[r](...s),n&&l.done]))[0]};return $i.set(t,a),a}Va(e=>({...e,get:(t,r,i)=>Pa(t,r)||e.get(t,r,i),has:(t,r)=>!!Pa(t,r)||e.has(t,r)}));const Fc=["continue","continuePrimaryKey","advance"],Oa={},Ei=new WeakMap,La=new WeakMap,Nc={get(e,t){if(!Fc.includes(t))return e[t];let r=Oa[t];return r||(r=Oa[t]=function(...i){Ei.set(this,La.get(this)[t](...i))}),r}};async function*Tc(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,Nc);for(La.set(r,t),xr.set(r,Ci(t));t;)yield r,t=await(Ei.get(r)||t.continue()),Ei.delete(r)}function ja(e,t){return t===Symbol.asyncIterator&&_i(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&_i(e,[IDBIndex,IDBObjectStore])}Va(e=>({...e,get(t,r,i){return ja(t,r)?Tc:e.get(t,r,i)},has(t,r){return ja(t,r)||e.has(t,r)}}));const kr=typeof indexedDB>"u"?void 0:Ec("inploi-chatbot",3,{upgrade(e){try{e.deleteObjectStore("state")}catch{}e.createObjectStore("state")}});let Sr,Ii,Wt;const Ba=()=>{if(!Sr)return Wt;const e=Sr;Sr=void 0;const t=Ua(e),r=kr==null?void 0:kr.then(i=>i.put("state",e.data,t)).finally(()=>{Wt===r&&(Wt=void 0)});return Wt=r,Wt},Oe={getStateData:async(e,t,r)=>{var n;const i=Ua({...e,flowKeys:t,context:r});return(n=await kr)==null?void 0:n.get("state",i)},setStateData:e=>{Sr=e,clearTimeout(Ii),Ii=setTimeout(()=>void Ba(),1e3)},flushStateData:()=>(clearTimeout(Ii),Ba()??Promise.resolve())},Ra=e=>{const t=e.find(r=>r.isHead);if(!t)throw new Error("No head node found");return t},It=e=>t=>t?t.type===e:!1;class gt extends Error{constructor(){super("Aborted")}}const Dc=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),za=()=>({messages:[],submissions:{},currentInput:null,nodeHistory:[],startedWriteNodeIds:[],isFinished:!1,hasInteracted:!1,sequence:0,flowSessionId:Dc()}),Mc=e=>wr(e).with({nativeEvent:{submitter:Ut.select(Ut.union(Ut.instanceOf(HTMLButtonElement),Ut.instanceOf(HTMLInputElement)))}},t=>t).otherwise(()=>{throw new Error("invalid submitter")}),Cr=(e,t,r,i=0)=>{if(!t.nextId)return r(t.id,{stepsMade:i,remainingSteps:0}),{stepsMade:i,remainingSteps:0};const n=e.find(d=>d.id===t.nextId);if(n===void 0)return{stepsMade:i,remainingSteps:0};const a=t.type==="if-block"?t.branchId:void 0,o=e.find(d=>d.id===a),s=t.type.includes("question")?1:0;if(o){const d=s+Math.max(Cr(e,n,r,i+s).remainingSteps,Cr(e,o,r,i+s).remainingSteps);return r(t.id,{stepsMade:i,remainingSteps:d}),{stepsMade:i,remainingSteps:d}}const l=s+Cr(e,n,r,i+s).remainingSteps;return r(t.id,{stepsMade:i,remainingSteps:l}),{stepsMade:i,remainingSteps:l}},Vc=e=>{const t={},r=e.find(i=>i.isHead);return r&&Cr(e,r,(i,n)=>{t[i]=n}),t},Ua=e=>[...e.flowKeys,e.id,e.version,e.build,gc(e.context)].join("/"),Ai=e=>{var t,r;if(!(e.data.isFinished||(t=e.data.startedWriteNodeIds)!=null&&t.length))return(r=[...e.data.messages].reverse().find(i=>i.groupId&&e.nodes.some(n=>n.id===i.groupId&&n.type.startsWith("question-"))&&(i.type==="system"||"author"in i&&i.author==="user")))==null?void 0:r.groupId},Le=Je({state:"idle"}),bt=e=>{const{state:t,flow:r}=Le.value;if(t!=="loaded")return;Ye(r,"No flow to update");const i=e(r.data);r.data=i,Le.value={state:t,flow:r},Oe.setStateData(r)},D={current$:Le,viewState$:Je("closed"),prepareFlow:async({flow:e,context:t={},flowKeys:r,title:i,analytics:n,job:a,locationOrigin:o})=>(await Oe.flushStateData().catch(()=>{}),{data:await Oe.getStateData(e,r,t)??za(),startedAt:new Date,nodeIdToProgress:Vc(e.nodes),flowKeys:r,id:e.id,version:e.version,nodes:e.nodes,build:e.build,context:t,title:i,analytics:n,job:a,locationOrigin:o}),commitFlow:e=>{Le.value={state:"loaded",flow:e},Oe.setStateData(e)},cancelCurrentFlow:()=>{Le.value={state:"idle"},D.viewState$.value="closed"},markAsFinished:()=>bt(e=>({...e,isFinished:!0})),markAsInteracted:()=>bt(e=>({...e,hasInteracted:!0})),setCurrentNodeId:e=>bt(t=>(t.nodeHistory.push(e),t)),setApplicationRecovery:async e=>{bt(t=>(e?t.applicationRecovery=e:delete t.applicationRecovery,t)),await Oe.flushStateData()},restart:()=>{const{state:e,flow:t}=Le.value;if(e!=="loaded")throw new Error("Flow cannot be restarted: not in valid state");const r={...za(),unconfirmedAttemptKeys:t.data.unconfirmedAttemptKeys},i={...t,data:r,startedAt:new Date};Le.value={state:e,flow:i},Oe.setStateData(i)},addMessage:(e,t)=>{const r={...e,groupId:t};return bt(i=>(i.messages.push(r),i))},removeMessagesSentByNodeIds:e=>{const{state:t,flow:r}=Le.value;Ye(t==="loaded","Application not loaded");const i=r.data.messages.filter(n=>!n.groupId||!e.includes(n.groupId));r.data.messages=i,Oe.setStateData(r)},setSubmission:(e,t)=>bt(r=>(t===null?delete r.submissions[e]:r.submissions[e]=t,r)),setInput:e=>bt(t=>({...t,currentInput:e??null})),persistWriteBarrier:async e=>{Le.peek().flow===e&&(Le.value={state:"loaded",flow:e}),Oe.setStateData(e),await Oe.flushStateData()}},Pc=({message:e})=>{const{t}=le();return c("div",{class:"flex flex-grow flex-col items-center justify-center",children:[c("svg",{class:"text-error-9 h-16 w-16",fill:"none",xmlns:"http://www.w3.org/2000/svg","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round",viewBox:"0 0 96 96",children:[c("path",{d:"M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z",fill:"#fff"}),c("path",{d:"M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z"}),c("line",{x1:"36.7",y1:"39.3",x2:"44.8",y2:"47.4"}),c("line",{x1:"52.2",y1:"39.3",x2:"60.3",y2:"47.4"}),c("line",{x1:"44.7",y1:"39.2",x2:"36.6",y2:"47.3"}),c("line",{x1:"60.2",y1:"39.2",x2:"52.1",y2:"47.3"}),c("path",{d:"M38 56h19"})]}),c("div",{class:"flex flex-col gap-2 text-center",children:[c("p",{class:"text-error-11 font-bold",children:t("error_heading")}),e&&c("p",{class:"text-neutral-9 text-sm",children:e})]})]})},$r=e=>c("svg",{role:"img",viewBox:"0 0 24 24",...e,children:[c("title",{children:"Loading"}),c("style",{children:"#s1{animation:3s linear infinite forwards s1__to}@keyframes s1__to{0%{transform:translate(12px,0)}66.666667%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,12px)}}#s2{animation:3s linear infinite forwards s2__ts}@keyframes s2__ts{0%{transform:scale(0,0)}70%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%{transform:scale(1,1)}}#s3{animation:3s linear infinite forwards s3__to}@keyframes s3__to{0%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,33.333333%{transform:translate(12px,24px)}}#s4{animation:3s linear infinite forwards s4__ts}@keyframes s4__ts{0%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%,30%{transform:scale(0,0)}}#s5{animation:3s linear infinite forwards s5__to}@keyframes s5__to{0%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}33.333333%{transform:translate(12px,12.045742px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,66.666667%{transform:translate(12px,24px)}}#s6{animation:3s linear infinite forwards s6__ts}@keyframes s6__ts{0%,100%,63.333333%{transform:scale(0,0)}3.333333%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}33.333333%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}#s7{animation:3s linear infinite forwards s7__to}@keyframes s7__to{0%{transform:translate(12px,0)}33.333333%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}66.666667%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,24px)}}#s8{animation:3s linear infinite forwards s8__ts}@keyframes s8__ts{0%,100%,96.666667%{transform:scale(0,0)}36.666667%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}66.666667%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}"}),c("g",{id:"s1",transform:"translate(12,0)",children:c("g",{id:"s2",transform:"scale(0,0)",children:c("circle",{r:"6.5",transform:"translate(0,0)",fill:"currentColor"})})}),c("g",{id:"s3",transform:"translate(12,12)",children:c("g",{id:"s4",transform:"scale(1,1)",children:c("circle",{r:"6.5",transform:"translate(0,0)",fill:"currentColor"})})}),c("g",{id:"s5",transform:"translate(12,0)",children:c("g",{id:"s6",transform:"scale(0,0)",children:c("path",{d:"M6.5,13c3.5899,0,6.5-2.9101,6.5-6.5s-2.9101-6.5-6.5-6.5-6.5,2.91015-6.5,6.5s2.91015,6.5,6.5,6.5Zm0-4C7.88071,9,9,7.88071,9,6.5s-1.11929-2.5-2.5-2.5-2.5,1.11929-2.5,2.5s1.11929,2.5,2.5,2.5Z",transform:"translate(-6.5,-6.5)","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"})})}),c("g",{id:"s7",transform:"translate(12,0)",children:c("g",{id:"s8",transform:"scale(0,0)",children:c("path",{d:"M0,6c0,3.58984,2.91016,6.5,6.5,6.5s6.5-2.91016,6.5-6.5h-4C9,7.38086,7.88086,8.5,6.5,8.5s-2.5-1.11914-2.5-2.5h-4Z",transform:"translate(-6.5,-9.25)",fill:"currentColor"})})})]}),qa=()=>c("div",{class:"flex flex-grow flex-col items-center justify-center",children:c($r,{class:"text-neutral-6 h-8 w-8"})}),Oc=e=>{const r=e/100,i=1.3;return e<0?"0%":e>100?"100%":`${Math.round((1-(1-.1)*Math.pow(1-r,i))*100)}%`},Lc=pt("touch-hitbox fr relative flex-none rounded-full p-2 transition-all",{variants:{variant:{neutral:"text-neutral-11 hover:text-neutral-12 active:text-neutral-12 hover:bg-interactive-bg-hover active:bg-interactive-bg-active ",white:"text-white/80 hover:text-white active:text-white hover:bg-white/20 active:bg-white/30"}},defaultVariants:{variant:"neutral"}}),Kt=({class:e,children:t,variant:r,...i})=>c("button",{class:Ke(Lc({variant:r}),e),...i,children:c("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round",xmlns:"http://www.w3.org/2000/svg",children:t})}),Ha=()=>c("path",{d:"M12.5 6.5L8 11L3.5 6.5"}),jc=()=>{if(D.current$.value.state!=="loaded")return null;const e=D.current$.value.flow.nodeIdToProgress,t=D.current$.value.flow.data.nodeHistory.at(-1);if(t===void 0)return null;const r=e[t];if(r===void 0)return null;const i=100*(r.stepsMade/(r.remainingSteps+r.stepsMade));return c("div",{class:"bg-accent-3",children:c("div",{style:{width:Oc(i)},class:"bg-accent-9 ring-accent-6 relative h-[3px] rounded-full transition-all duration-1000"})})},Bc=({children:e,params:t})=>{const{t:r}=le(),i=D.viewState$;return c(X,{children:c("header",{class:"ring-divider bg-statusbar absolute left-0 right-0 top-0 z-20 mx-auto items-center ring-1 backdrop-blur-md backdrop-saturate-150",children:[c("div",{class:"ring-neutral-7 flex h-[var(--header-height)] gap-2 rounded-t-3xl ring-0 ring-inset transition-all duration-300 [&:has(>.view-switch:focus-visible)]:ring-1",children:[c("p",{id:"chatbot-status-bar",class:"sr-only",children:e}),c("button",{onClick:()=>{i.value="minimised"},class:"view-switch h-full flex-grow overflow-hidden px-4 py-1 focus-visible:outline-none",onTouchStart:Fi,children:c("p",{"aria-hidden":!0,class:"text-neutral-12 truncate text-sm font-bold tracking-tight",children:e})}),c("div",{class:"flex flex-shrink-0 items-center gap-3 p-1.5",children:[t.feedback?c("div",{"data-widget":"inploi-feedback","data-key":"chatbot-header",class:Ke({hidden:D.current$.value.state!=="loaded"||i.value!=="maximised"}),children:c("div",{class:"ring-neutral-4 bg-neutral-3 h-8 w-[72px] animate-pulse rounded-full ring-1"})}):null,D.current$.value.state==="loaded"&&c(Kt,{class:"mx-1","aria-label":"Restart",onClick:()=>{D.restart()},children:[c("path",{d:"M12 8.5C12 9.29113 11.7654 10.0645 11.3259 10.7223C10.8864 11.3801 10.2616 11.8928 9.53073 12.1955C8.79983 12.4983 7.99556 12.5775 7.21964 12.4231C6.44371 12.2688 5.73098 11.8878 5.17157 11.3284C4.61216 10.769 4.2312 10.0563 4.07686 9.28036C3.92252 8.50444 4.00173 7.70017 4.30448 6.96927C4.60723 6.23836 5.11992 5.61365 5.77772 5.17412C6.43552 4.7346 7.20887 4.5 8 4.5H9"}),c("path",{d:"M8 7L10 4.5L8 2.5"})]},"restart"),c(Kt,{class:"view-switch mx-1",onTouchStart:Fi,"aria-label":r("minimize"),onClick:()=>i.value="minimised",children:c(Ha,{})},"minmax")]})]}),c(jc,{})]})})};function Fi(){}const Rc=ua(()=>Promise.resolve().then(()=>Cf).then(e=>e.ChatbotBody)),Wa=pt("selection:bg-accent-4 selection:text-accent-12 fixed bottom-2 left-2 right-2 isolate mx-auto max-h-full focus:outline-none [&:has(.view-switch:active)]:scale-[0.98] transition-all duration-1000 ease-expo-out",{variants:{view:{closed:"hidden",minimised:"max-w-[min(300px,calc(100vw-4rem))] h-[var(--header-height)] animate-slide-in-bottom",maximised:"max-w-[450px] h-[var(--content-height)] animate-maximise"}}}),Ka=pt("relative flex h-full overflow-hidden rounded-3xl outline outline-1",{variants:{view:{closed:"hidden",minimised:"outline-accent-10 bg-accent-9",maximised:"outline-neutral-3 bg-neutral-1 flex-col"}}}),zc=({open:e,...t})=>{const r=ve(null);return be(()=>{const i=r.current;i&&(e?i.showModal():i.close())},[e]),c("dialog",{ref:r,...t})},Uc=({logger:e,apiClient:t,analytics:r,talentBankClient:i,params:n})=>{const{state:a,flow:o,error:s}=D.current$.value,l=D.viewState$.value,d=a!=="idle"&&l==="maximised",p=ve(null),u=o?[...o.data.nodeHistory].reverse().map(h=>o.nodes.find(b=>b.id===h)).find(h=>(h==null?void 0:h.type)==="flow-section"):void 0;return c(pc,{terms:n.terms,locale:void 0,children:[c(zc,{open:d,onClose:()=>D.viewState$.value="minimised",children:c("div",{ref:p,"aria-modal":"true",role:"dialog","aria-labelledby":"chatbot-status-bar",class:Wa({view:"maximised"}),children:c("div",{class:Ka({view:"maximised"}),children:[c(Bc,{params:n,children:u?c(X,{children:[c("span",{class:"block",children:u.data.title}),c("span",{class:"block truncate text-xs font-normal",children:o==null?void 0:o.title})]}):o==null?void 0:o.title}),wr({state:a,view:l}).with({state:"idle"},()=>null).with({state:"loading"},()=>c(qa,{},"loading")).with({state:"loaded"},()=>c(jt,{fallback:c(qa,{},"loading"),children:c(Rc,{analytics:r,apiClient:t,logger:e,talentBankClient:i})})).with({state:"error"},()=>c(Pc,{message:s})).exhaustive()]})})}),l==="minimised"?c(qc,{flow:o}):null]})},qc=({flow:e})=>{const{t}=le();return c("div",{class:Wa({view:"minimised",class:"z-100 isolate"}),children:c("div",{class:Ka({view:"minimised"}),children:[c("button",{onClick:()=>{D.viewState$.value="maximised"},class:"view-switch h-full flex-grow overflow-hidden px-4 py-1 focus-visible:outline-none",onTouchStart:Fi,children:c("p",{"aria-hidden":!0,class:"truncate text-sm font-bold tracking-tight text-white",children:e==null?void 0:e.title})}),c("div",{class:"flex items-center px-0.5",children:c(Kt,{class:"mx-1","aria-label":t("close_application"),onClick:D.cancelCurrentFlow,variant:"white",children:c("path",{d:"M12 12L4 4M12 4L4 12"})},"close")})]})})},Hc=`[data-widget=inploi-chatbot]{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;z-index:2147483647;font-size:16px;font-family:sans-serif;--i-lowest: 0 0% 100%;--i-e-1: 340 100% 99%;--i-e-2: 353 100% 98%;--i-e-3: 351 91% 96%;--i-e-4: 351 100% 93%;--i-e-5: 350 100% 90%;--i-e-6: 351 80% 86%;--i-e-7: 349 68% 81%;--i-e-8: 348 61% 74%;--i-e-9: 348 75% 59%;--i-e-10: 347 70% 55%;--i-e-11: 345 70% 47%;--i-e-12: 344 63% 24%;--header-height: 44px;--content-height:calc(100vh - 64px);--content-height:calc(100svh - 64px)}@media screen and (min-width: 768px){[data-widget=inploi-chatbot]{--content-height: min(640px, calc(100vh - 16px));--content-height: min(640px, calc(100svh - 16px)) }}[data-widget=inploi-chatbot] *,[data-widget=inploi-chatbot] :before,[data-widget=inploi-chatbot] :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }[data-widget=inploi-chatbot] ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }[data-widget=inploi-chatbot]{--tw-content: "";font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}[data-widget=inploi-chatbot] em{font-style:italic}[data-widget=inploi-chatbot] strong{font-weight:700}[data-widget=inploi-chatbot] *{font-weight:inherit;font-style:inherit;box-sizing:border-box;font-family:inherit;border-style:solid;border-width:0;-webkit-tap-highlight-color:transparent}[data-widget=inploi-chatbot] :before,[data-widget=inploi-chatbot] :after{box-sizing:border-box}[data-widget=inploi-chatbot] :is(ul,ol){list-style:none;padding:0;margin:0}[data-widget=inploi-chatbot] :is(p){margin:0;padding:0}[data-widget=inploi-chatbot] :is(li){margin:0;padding:0;list-style:none}[data-widget=inploi-chatbot] :is(button){margin:0;padding:0;border:unset;background:unset;text-align:unset}[data-widget=inploi-chatbot] .container{width:100%}@media (min-width: 640px){[data-widget=inploi-chatbot] .container{max-width:640px}}@media (min-width: 768px){[data-widget=inploi-chatbot] .container{max-width:768px}}@media (min-width: 1024px){[data-widget=inploi-chatbot] .container{max-width:1024px}}@media (min-width: 1280px){[data-widget=inploi-chatbot] .container{max-width:1280px}}@media (min-width: 1536px){[data-widget=inploi-chatbot] .container{max-width:1536px}}[data-widget=inploi-chatbot] .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}[data-widget=inploi-chatbot] .visible{visibility:visible}[data-widget=inploi-chatbot] .invisible{visibility:hidden}[data-widget=inploi-chatbot] .collapse{visibility:collapse}[data-widget=inploi-chatbot] .static{position:static}[data-widget=inploi-chatbot] .fixed{position:fixed}[data-widget=inploi-chatbot] .absolute{position:absolute}[data-widget=inploi-chatbot] .relative{position:relative}[data-widget=inploi-chatbot] .sticky{position:sticky}[data-widget=inploi-chatbot] .inset-0{top:0;right:0;bottom:0;left:0}[data-widget=inploi-chatbot] .bottom-0{bottom:0}[data-widget=inploi-chatbot] .bottom-2{bottom:8px}[data-widget=inploi-chatbot] .bottom-2\\.5{bottom:10px}[data-widget=inploi-chatbot] .left-0{left:0}[data-widget=inploi-chatbot] .left-1\\/2{left:50%}[data-widget=inploi-chatbot] .left-2{left:8px}[data-widget=inploi-chatbot] .right-0{right:0}[data-widget=inploi-chatbot] .right-0\\.5{right:2px}[data-widget=inploi-chatbot] .right-1{right:4px}[data-widget=inploi-chatbot] .right-2{right:8px}[data-widget=inploi-chatbot] .top-0{top:0}[data-widget=inploi-chatbot] .isolate{isolation:isolate}[data-widget=inploi-chatbot] .z-20{z-index:20}[data-widget=inploi-chatbot] .z-50{z-index:50}[data-widget=inploi-chatbot] .m-0{margin:0}[data-widget=inploi-chatbot] .mx-1{margin-left:4px;margin-right:4px}[data-widget=inploi-chatbot] .mx-auto{margin-left:auto;margin-right:auto}[data-widget=inploi-chatbot] .mb-1{margin-bottom:4px}[data-widget=inploi-chatbot] .ml-auto{margin-left:auto}[data-widget=inploi-chatbot] .mt-0\\.5{margin-top:2px}[data-widget=inploi-chatbot] .mt-auto{margin-top:auto}[data-widget=inploi-chatbot] .block{display:block}[data-widget=inploi-chatbot] .inline-block{display:inline-block}[data-widget=inploi-chatbot] .inline{display:inline}[data-widget=inploi-chatbot] .flex{display:flex}[data-widget=inploi-chatbot] .inline-flex{display:inline-flex}[data-widget=inploi-chatbot] .table{display:table}[data-widget=inploi-chatbot] .table-row{display:table-row}[data-widget=inploi-chatbot] .flow-root{display:flow-root}[data-widget=inploi-chatbot] .grid{display:grid}[data-widget=inploi-chatbot] .inline-grid{display:inline-grid}[data-widget=inploi-chatbot] .contents{display:contents}[data-widget=inploi-chatbot] .list-item{display:list-item}[data-widget=inploi-chatbot] .\\!hidden{display:none!important}[data-widget=inploi-chatbot] .hidden{display:none}[data-widget=inploi-chatbot] .size-\\[1lh\\]{width:1lh;height:1lh}[data-widget=inploi-chatbot] .h-1\\.5{height:6px}[data-widget=inploi-chatbot] .h-16{height:64px}[data-widget=inploi-chatbot] .h-4{height:16px}[data-widget=inploi-chatbot] .h-48{height:192px}[data-widget=inploi-chatbot] .h-8{height:32px}[data-widget=inploi-chatbot] .h-\\[3px\\]{height:3px}[data-widget=inploi-chatbot] .h-\\[var\\(--content-height\\)\\]{height:var(--content-height)}[data-widget=inploi-chatbot] .h-\\[var\\(--header-height\\)\\]{height:var(--header-height)}[data-widget=inploi-chatbot] .h-full{height:100%}[data-widget=inploi-chatbot] .max-h-\\[calc\\(100\\%-var\\(--header-height\\)-4rem\\)\\]{max-height:calc(100% - var(--header-height) - 64px)}[data-widget=inploi-chatbot] .max-h-\\[calc\\(8lh\\+1rem\\)\\]{max-height:calc(8lh + 16px)}[data-widget=inploi-chatbot] .max-h-full{max-height:100%}[data-widget=inploi-chatbot] .min-h-0{min-height:0px}[data-widget=inploi-chatbot] .min-h-\\[36px\\]{min-height:36px}[data-widget=inploi-chatbot] .min-h-\\[calc\\(1lh\\+1rem\\)\\]{min-height:calc(1lh + 16px)}[data-widget=inploi-chatbot] .w-1\\.5{width:6px}[data-widget=inploi-chatbot] .w-16{width:64px}[data-widget=inploi-chatbot] .w-24{width:96px}[data-widget=inploi-chatbot] .w-4{width:16px}[data-widget=inploi-chatbot] .w-64{width:256px}[data-widget=inploi-chatbot] .w-8{width:32px}[data-widget=inploi-chatbot] .w-\\[72px\\]{width:72px}[data-widget=inploi-chatbot] .w-full{width:100%}[data-widget=inploi-chatbot] .min-w-0{min-width:0px}[data-widget=inploi-chatbot] .min-w-\\[2rem\\]{min-width:32px}[data-widget=inploi-chatbot] .max-w-\\[450px\\]{max-width:450px}[data-widget=inploi-chatbot] .max-w-\\[min\\(100\\%\\,24rem\\)\\]{max-width:min(100%,384px)}[data-widget=inploi-chatbot] .max-w-\\[min\\(300px\\,calc\\(100vw-4rem\\)\\)\\]{max-width:min(300px,calc(100vw - 64px))}[data-widget=inploi-chatbot] .max-w-\\[var\\(--radix-popover-content-available-width\\)\\]{max-width:var(--radix-popover-content-available-width)}[data-widget=inploi-chatbot] .max-w-full{max-width:100%}[data-widget=inploi-chatbot] .flex-1{flex:1 1 0%}[data-widget=inploi-chatbot] .flex-auto{flex:1 1 auto}[data-widget=inploi-chatbot] .flex-none{flex:none}[data-widget=inploi-chatbot] .flex-shrink{flex-shrink:1}[data-widget=inploi-chatbot] .flex-shrink-0{flex-shrink:0}[data-widget=inploi-chatbot] .shrink{flex-shrink:1}[data-widget=inploi-chatbot] .shrink-0{flex-shrink:0}[data-widget=inploi-chatbot] .flex-grow,[data-widget=inploi-chatbot] .grow{flex-grow:1}[data-widget=inploi-chatbot] .border-collapse{border-collapse:collapse}[data-widget=inploi-chatbot] .-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}[data-widget=inploi-chatbot] .animate-bounce{animation:bounce 1s infinite}@keyframes bubble-in{0%{transform:translateY(100%) scale(.8);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}[data-widget=inploi-chatbot] .animate-bubble-in{animation:bubble-in .3s cubic-bezier(.34,1.56,.64,1)}@keyframes maximise{0%{transform:translateY(50%) scaleX(.7)}to{transform:translateY(0)}}[data-widget=inploi-chatbot] .animate-maximise{animation:maximise .4s cubic-bezier(.16,1,.3,1)}@keyframes pulse{50%{opacity:.5}}[data-widget=inploi-chatbot] .animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slide-in-bottom{0%{transform:translateY(-100%) scaleX(1.25)}to{transform:translateY(0)}}[data-widget=inploi-chatbot] .animate-slide-in-bottom{animation:slide-in-bottom .3s cubic-bezier(.175,.885,.32,1.275)}[data-widget=inploi-chatbot] .cursor-pointer{cursor:pointer}[data-widget=inploi-chatbot] .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-widget=inploi-chatbot] .select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}[data-widget=inploi-chatbot] .resize-y{resize:vertical}[data-widget=inploi-chatbot] .resize{resize:both}[data-widget=inploi-chatbot] .scroll-pb-12{scroll-padding-bottom:48px}[data-widget=inploi-chatbot] .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}[data-widget=inploi-chatbot] .flex-col{flex-direction:column}[data-widget=inploi-chatbot] .flex-wrap{flex-wrap:wrap}[data-widget=inploi-chatbot] .items-start{align-items:flex-start}[data-widget=inploi-chatbot] .items-center{align-items:center}[data-widget=inploi-chatbot] .items-stretch{align-items:stretch}[data-widget=inploi-chatbot] .justify-end{justify-content:flex-end}[data-widget=inploi-chatbot] .justify-center{justify-content:center}[data-widget=inploi-chatbot] .gap-0{gap:0px}[data-widget=inploi-chatbot] .gap-1{gap:4px}[data-widget=inploi-chatbot] .gap-1\\.5{gap:6px}[data-widget=inploi-chatbot] .gap-2{gap:8px}[data-widget=inploi-chatbot] .gap-2\\.5{gap:10px}[data-widget=inploi-chatbot] .gap-3{gap:12px}[data-widget=inploi-chatbot] .gap-4{gap:16px}[data-widget=inploi-chatbot] .self-center{align-self:center}[data-widget=inploi-chatbot] .overflow-hidden{overflow:hidden}[data-widget=inploi-chatbot] .overflow-y-auto{overflow-y:auto}[data-widget=inploi-chatbot] .overscroll-contain{overscroll-behavior:contain}[data-widget=inploi-chatbot] .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[data-widget=inploi-chatbot] .text-ellipsis{text-overflow:ellipsis}[data-widget=inploi-chatbot] .whitespace-nowrap{white-space:nowrap}[data-widget=inploi-chatbot] .text-balance{text-wrap:balance}[data-widget=inploi-chatbot] .text-pretty{text-wrap:pretty}[data-widget=inploi-chatbot] .break-words{overflow-wrap:break-word}[data-widget=inploi-chatbot] .rounded{border-radius:4px}[data-widget=inploi-chatbot] .rounded-2xl{border-radius:16px}[data-widget=inploi-chatbot] .rounded-3xl{border-radius:24px}[data-widget=inploi-chatbot] .rounded-\\[18px\\]{border-radius:18px}[data-widget=inploi-chatbot] .rounded-full{border-radius:9999px}[data-widget=inploi-chatbot] .rounded-lg{border-radius:8px}[data-widget=inploi-chatbot] .rounded-md{border-radius:6px}[data-widget=inploi-chatbot] .rounded-xl{border-radius:12px}[data-widget=inploi-chatbot] .rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}[data-widget=inploi-chatbot] .rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}[data-widget=inploi-chatbot] .rounded-t-3xl{border-top-left-radius:24px;border-top-right-radius:24px}[data-widget=inploi-chatbot] .rounded-bl-md{border-bottom-left-radius:6px}[data-widget=inploi-chatbot] .rounded-br-md{border-bottom-right-radius:6px}[data-widget=inploi-chatbot] .border{border-width:1px}[data-widget=inploi-chatbot] .border-b{border-bottom-width:1px}[data-widget=inploi-chatbot] .border-t{border-top-width:1px}[data-widget=inploi-chatbot] .border-solid{border-style:solid}[data-widget=inploi-chatbot] .border-dashed{border-style:dashed}[data-widget=inploi-chatbot] .border-accent-9{border-color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .border-divider{border-color:var(--i-color-divider)}[data-widget=inploi-chatbot] .border-neutral-5{border-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .border-neutral-8{border-color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .border-transparent{border-color:transparent}[data-widget=inploi-chatbot] .border-b-neutral-3{border-bottom-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .border-b-neutral-5{border-bottom-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .border-b-transparent{border-bottom-color:transparent}[data-widget=inploi-chatbot] .bg-accent-1{background-color:var(--i-color-a-1)}[data-widget=inploi-chatbot] .bg-accent-3{background-color:var(--i-color-a-3)}[data-widget=inploi-chatbot] .bg-accent-9{background-color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .bg-bubble-weak-bg{background-color:var(--i-bubble-weak-bg)}[data-widget=inploi-chatbot] .bg-lowest{background-color:var(--i-color-lowest)}[data-widget=inploi-chatbot] .bg-neutral-1{background-color:var(--i-color-n-1)}[data-widget=inploi-chatbot] .bg-neutral-2{background-color:var(--i-color-n-2)}[data-widget=inploi-chatbot] .bg-neutral-3{background-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .bg-statusbar{background-color:var(--i-status-bar-bg)}[data-widget=inploi-chatbot] .bg-transparent{background-color:transparent}[data-widget=inploi-chatbot] .bg-none{background-image:none}[data-widget=inploi-chatbot] .p-1{padding:4px}[data-widget=inploi-chatbot] .p-1\\.5{padding:6px}[data-widget=inploi-chatbot] .p-10{padding:40px}[data-widget=inploi-chatbot] .p-11{padding:44px}[data-widget=inploi-chatbot] .p-12{padding:48px}[data-widget=inploi-chatbot] .p-2{padding:8px}[data-widget=inploi-chatbot] .p-2\\.5{padding:10px}[data-widget=inploi-chatbot] .p-3{padding:12px}[data-widget=inploi-chatbot] .p-4{padding:16px}[data-widget=inploi-chatbot] .p-5{padding:20px}[data-widget=inploi-chatbot] .p-6{padding:24px}[data-widget=inploi-chatbot] .p-7{padding:28px}[data-widget=inploi-chatbot] .p-8{padding:32px}[data-widget=inploi-chatbot] .p-9{padding:36px}[data-widget=inploi-chatbot] .px-0\\.5{padding-left:2px;padding-right:2px}[data-widget=inploi-chatbot] .px-1{padding-left:4px;padding-right:4px}[data-widget=inploi-chatbot] .px-1\\.5{padding-left:6px;padding-right:6px}[data-widget=inploi-chatbot] .px-2{padding-left:8px;padding-right:8px}[data-widget=inploi-chatbot] .px-3{padding-left:12px;padding-right:12px}[data-widget=inploi-chatbot] .px-4{padding-left:16px;padding-right:16px}[data-widget=inploi-chatbot] .px-5{padding-left:20px;padding-right:20px}[data-widget=inploi-chatbot] .py-0\\.5{padding-top:2px;padding-bottom:2px}[data-widget=inploi-chatbot] .py-1{padding-top:4px;padding-bottom:4px}[data-widget=inploi-chatbot] .py-1\\.5{padding-top:6px;padding-bottom:6px}[data-widget=inploi-chatbot] .py-2{padding-top:8px;padding-bottom:8px}[data-widget=inploi-chatbot] .py-2\\.5{padding-top:10px;padding-bottom:10px}[data-widget=inploi-chatbot] .py-3{padding-top:12px;padding-bottom:12px}[data-widget=inploi-chatbot] .pb-2{padding-bottom:8px}[data-widget=inploi-chatbot] .pb-6{padding-bottom:24px}[data-widget=inploi-chatbot] .pl-1\\.5{padding-left:6px}[data-widget=inploi-chatbot] .pl-2{padding-left:8px}[data-widget=inploi-chatbot] .pl-2\\.5{padding-left:10px}[data-widget=inploi-chatbot] .pl-3{padding-left:12px}[data-widget=inploi-chatbot] .pl-4{padding-left:16px}[data-widget=inploi-chatbot] .pr-1{padding-right:4px}[data-widget=inploi-chatbot] .pr-16{padding-right:64px}[data-widget=inploi-chatbot] .pr-2\\.5{padding-right:10px}[data-widget=inploi-chatbot] .pr-3{padding-right:12px}[data-widget=inploi-chatbot] .pr-4{padding-right:16px}[data-widget=inploi-chatbot] .pt-2{padding-top:8px}[data-widget=inploi-chatbot] .pt-2\\.5{padding-top:10px}[data-widget=inploi-chatbot] .pt-3{padding-top:12px}[data-widget=inploi-chatbot] .pt-5{padding-top:20px}[data-widget=inploi-chatbot] .pt-\\[calc\\(var\\(--header-height\\)\\+1rem\\)\\]{padding-top:calc(var(--header-height) + 16px)}[data-widget=inploi-chatbot] .text-center{text-align:center}[data-widget=inploi-chatbot] .text-justify{text-align:justify}[data-widget=inploi-chatbot] .text-\\[10px\\]{font-size:10px}[data-widget=inploi-chatbot] .text-\\[11px\\]{font-size:11px}[data-widget=inploi-chatbot] .text-base{font-size:16px;line-height:24px}[data-widget=inploi-chatbot] .text-sm{font-size:14px;line-height:20px}[data-widget=inploi-chatbot] .text-xs{font-size:12px;line-height:16px}[data-widget=inploi-chatbot] .font-bold{font-weight:700}[data-widget=inploi-chatbot] .font-medium{font-weight:500}[data-widget=inploi-chatbot] .font-normal{font-weight:400}[data-widget=inploi-chatbot] .font-semibold{font-weight:600}[data-widget=inploi-chatbot] .uppercase{text-transform:uppercase}[data-widget=inploi-chatbot] .lowercase{text-transform:lowercase}[data-widget=inploi-chatbot] .capitalize{text-transform:capitalize}[data-widget=inploi-chatbot] .italic{font-style:italic}[data-widget=inploi-chatbot] .ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}[data-widget=inploi-chatbot] .leading-3{line-height:12px}[data-widget=inploi-chatbot] .leading-snug{line-height:1.375}[data-widget=inploi-chatbot] .leading-tight{line-height:1.25}[data-widget=inploi-chatbot] .tracking-\\[-0\\.01em\\]{letter-spacing:-.01em}[data-widget=inploi-chatbot] .tracking-tight{letter-spacing:-.025em}[data-widget=inploi-chatbot] .tracking-wide{letter-spacing:.025em}[data-widget=inploi-chatbot] .tracking-widest{letter-spacing:.1em}[data-widget=inploi-chatbot] .text-\\[\\#4CAF50\\]{--tw-text-opacity: 1;color:rgb(76 175 80 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .text-\\[\\#FFC107\\]{--tw-text-opacity: 1;color:rgb(255 193 7 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .text-accent-1{color:var(--i-color-a-1)}[data-widget=inploi-chatbot] .text-accent-10{color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .text-accent-11{color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .text-accent-12{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .text-accent-9{color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .text-error-11{color:var(--i-color-e-11)}[data-widget=inploi-chatbot] .text-error-9{color:var(--i-color-e-9)}[data-widget=inploi-chatbot] .text-neutral-10{color:var(--i-color-n-10)}[data-widget=inploi-chatbot] .text-neutral-11{color:var(--i-color-n-11)}[data-widget=inploi-chatbot] .text-neutral-12{color:var(--i-color-n-12)}[data-widget=inploi-chatbot] .text-neutral-6{color:var(--i-color-n-6)}[data-widget=inploi-chatbot] .text-neutral-8{color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .text-neutral-9{color:var(--i-color-n-9)}[data-widget=inploi-chatbot] .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .text-white\\/80{color:#fffc}[data-widget=inploi-chatbot] .underline{text-decoration-line:underline}[data-widget=inploi-chatbot] .no-underline{text-decoration-line:none}[data-widget=inploi-chatbot] .underline-offset-2{text-underline-offset:2px}[data-widget=inploi-chatbot] .underline-offset-4{text-underline-offset:4px}[data-widget=inploi-chatbot] .caret-accent-9{caret-color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .opacity-0{opacity:0}[data-widget=inploi-chatbot] .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-\\[0_0_0_1px\\]{--tw-shadow: 0 0 0 1px;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-surface-lg{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 6px 4px 0px oklch(0% 0 0 / .02), 0px 11px 4px 0px oklch(0% 0 0 / .01), 0px 32px 24px -12px oklch(0% 0 0 / .06);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color), 0px 11px 4px 0px var(--tw-shadow-color), 0px 32px 24px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-surface-md{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 6px 4px 0px oklch(0% 0 0 / .02), 0px 6px 4px 0px oklch(0% 0 0 / .01);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-surface-sm{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 4px 4px 0px oklch(0% 0 0 / .02);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 4px 4px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-bubble-strong-shadow{--tw-shadow-color: var(--i-bubble-strong-shadow);--tw-shadow: var(--tw-shadow-colored)}[data-widget=inploi-chatbot] .outline-none{outline:2px solid transparent;outline-offset:2px}[data-widget=inploi-chatbot] .outline{outline-style:solid}[data-widget=inploi-chatbot] .outline-1{outline-width:1px}[data-widget=inploi-chatbot] .outline-2{outline-width:2px}[data-widget=inploi-chatbot] .outline-accent-10{outline-color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .outline-accent-4{outline-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .outline-bubble-weak{outline-color:var(--i-bubble-weak-outline)}[data-widget=inploi-chatbot] .outline-divider{outline-color:var(--i-color-divider)}[data-widget=inploi-chatbot] .outline-neutral-3{outline-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .outline-neutral-6{outline-color:var(--i-color-n-6)}[data-widget=inploi-chatbot] .ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .ring-inset{--tw-ring-inset: inset}[data-widget=inploi-chatbot] .ring-accent-6{--tw-ring-color: var(--i-color-a-6)}[data-widget=inploi-chatbot] .ring-divider{--tw-ring-color: var(--i-color-divider)}[data-widget=inploi-chatbot] .ring-lowest{--tw-ring-color: var(--i-color-lowest)}[data-widget=inploi-chatbot] .ring-neutral-4{--tw-ring-color: var(--i-color-n-4)}[data-widget=inploi-chatbot] .ring-neutral-5{--tw-ring-color: var(--i-color-n-5)}[data-widget=inploi-chatbot] .ring-neutral-7{--tw-ring-color: var(--i-color-n-7)}[data-widget=inploi-chatbot] .ring-transparent{--tw-ring-color: transparent}[data-widget=inploi-chatbot] .ring-offset-\\[1\\.5px\\]{--tw-ring-offset-width: 1.5px}[data-widget=inploi-chatbot] .ring-offset-neutral-1{--tw-ring-offset-color: var(--i-color-n-1)}[data-widget=inploi-chatbot] .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .drop-shadow-\\[0_1\\.5px_var\\(--i-color-n-1\\)\\]{--tw-drop-shadow: drop-shadow(0 1.5px var(--i-color-n-1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}[data-widget=inploi-chatbot] .backdrop-saturate-150{--tw-backdrop-saturate: saturate(1.5);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}[data-widget=inploi-chatbot] .backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}[data-widget=inploi-chatbot] .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .transition-\\[background\\,color\\,border-color\\,box-shadow\\]{transition-property:background,color,border-color,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .duration-100{transition-duration:.1s}[data-widget=inploi-chatbot] .duration-1000{transition-duration:1s}[data-widget=inploi-chatbot] .duration-300{transition-duration:.3s}[data-widget=inploi-chatbot] .ease-expo-out{transition-timing-function:cubic-bezier(.16,1,.3,1)}[data-widget=inploi-chatbot] .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}[data-widget=inploi-chatbot] .will-change-\\[transform\\,opacity\\]{will-change:transform,opacity}[data-widget=inploi-chatbot] .text-wrap-balance{text-wrap:balance}[data-widget=inploi-chatbot] .fr{outline:none}[data-widget=inploi-chatbot] .fr:focus{outline:none}[data-widget=inploi-chatbot] .fr:focus-visible{outline:none;--tw-ring-offset-width: 1px;--tw-ring-offset-color: var(--i-color-lowest);--tw-ring-opacity: 1;--tw-ring-color: var(--i-color-a-9);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .gutter-stable{scrollbar-gutter:stable}[data-widget=inploi-chatbot] .hide-scrollbars::-webkit-scrollbar{display:none}[data-widget=inploi-chatbot] .hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}[data-widget=inploi-chatbot] .touch-hitbox:before{content:"";position:absolute;display:block;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-height:44px;min-width:44px;z-index:9999}[data-widget=inploi-chatbot] .\\[-webkit-outer-spin-button\\:none\\]{-webkit-outer-spin-button:none}[data-widget=inploi-chatbot] .\\[a-zA-Z0-9-_\\:\\.\\$\\@\\?\\]{a-z-a--z0-9-_:.$@?}[data-widget=inploi-chatbot] .\\[grid-template-columns\\:min-content_1fr\\]{grid-template-columns:min-content 1fr}[data-widget=inploi-chatbot] .\\[text-wrap\\:pretty\\]{text-wrap:pretty}[data-widget=inploi-chatbot] .selection\\:bg-accent-4 *::-moz-selection{background-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .selection\\:bg-accent-4 *::selection{background-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .selection\\:bg-transparent *::-moz-selection{background-color:transparent}[data-widget=inploi-chatbot] .selection\\:bg-transparent *::selection{background-color:transparent}[data-widget=inploi-chatbot] .selection\\:text-accent-12 *::-moz-selection{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .selection\\:text-accent-12 *::selection{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .selection\\:bg-accent-4::-moz-selection{background-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .selection\\:bg-accent-4::selection{background-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .selection\\:bg-transparent::-moz-selection{background-color:transparent}[data-widget=inploi-chatbot] .selection\\:bg-transparent::selection{background-color:transparent}[data-widget=inploi-chatbot] .selection\\:text-accent-12::-moz-selection{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .selection\\:text-accent-12::selection{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .placeholder\\:text-neutral-10::-moz-placeholder{color:var(--i-color-n-10)}[data-widget=inploi-chatbot] .placeholder\\:text-neutral-10::placeholder{color:var(--i-color-n-10)}[data-widget=inploi-chatbot] .placeholder\\:text-neutral-8::-moz-placeholder{color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .placeholder\\:text-neutral-8::placeholder{color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .first-of-type\\:rounded-l-lg:first-of-type{border-top-left-radius:8px;border-bottom-left-radius:8px}[data-widget=inploi-chatbot] .last-of-type\\:rounded-r-lg:last-of-type{border-top-right-radius:8px;border-bottom-right-radius:8px}[data-widget=inploi-chatbot] .autofill\\:shadow-\\[inset_0_0_0_1000px_hsl\\(210_16\\.7\\%_97\\.6\\%\\)\\]:-webkit-autofill{--tw-shadow: inset 0 0 0 1000px hsl(210 16.7% 97.6%);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:shadow-\\[inset_0_0_0_1000px_hsl\\(210_16\\.7\\%_97\\.6\\%\\)\\]:autofill{--tw-shadow: inset 0 0 0 1000px hsl(210 16.7% 97.6%);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:shadow-\\[inset_0_0_0_1000px_var\\(--i-color-a-2\\)\\]:-webkit-autofill{--tw-shadow: inset 0 0 0 1000px var(--i-color-a-2);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:shadow-\\[inset_0_0_0_1000px_var\\(--i-color-a-2\\)\\]:autofill{--tw-shadow: inset 0 0 0 1000px var(--i-color-a-2);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:\\[-webkit-text-fill-color\\:var\\(--i-color-a-11\\)\\]:-webkit-autofill{-webkit-text-fill-color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .autofill\\:\\[-webkit-text-fill-color\\:var\\(--i-color-a-11\\)\\]:autofill{-webkit-text-fill-color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .focus-within\\:bg-neutral-5:focus-within{background-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .focus-within\\:outline-none:focus-within{outline:2px solid transparent;outline-offset:2px}[data-widget=inploi-chatbot] .focus-within\\:outline-accent-7:focus-within{outline-color:var(--i-color-a-7)}[data-widget=inploi-chatbot] .hover\\:z-10:hover{z-index:10}[data-widget=inploi-chatbot] .hover\\:scale-\\[1\\.02\\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .hover\\:border-accent-10:hover{border-color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .hover\\:border-neutral-5:hover{border-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .hover\\:bg-accent-10:hover{background-color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .hover\\:bg-divider:hover{background-color:var(--i-color-divider)}[data-widget=inploi-chatbot] .hover\\:bg-interactive-bg-hover:hover{background-color:var(--i-interactive-bg-hover)}[data-widget=inploi-chatbot] .hover\\:bg-neutral-2:hover{background-color:var(--i-color-n-2)}[data-widget=inploi-chatbot] .hover\\:bg-neutral-3:hover{background-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .hover\\:bg-neutral-4:hover{background-color:var(--i-color-n-4)}[data-widget=inploi-chatbot] .hover\\:bg-neutral-5:hover{background-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .hover\\:bg-white\\/20:hover{background-color:#fff3}[data-widget=inploi-chatbot] .hover\\:text-accent-11:hover{color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .hover\\:text-neutral-12:hover{color:var(--i-color-n-12)}[data-widget=inploi-chatbot] .hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .hover\\:underline:hover{text-decoration-line:underline}[data-widget=inploi-chatbot] .hover\\:ring-accent-8:hover{--tw-ring-color: var(--i-color-a-8)}[data-widget=inploi-chatbot] .hover\\:ring-divider:hover{--tw-ring-color: var(--i-color-divider)}[data-widget=inploi-chatbot] .focus\\:z-20:focus{z-index:20}[data-widget=inploi-chatbot] .focus\\:bg-neutral-5:focus{background-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .focus\\:shadow-\\[0_0_0_2px\\]:focus{--tw-shadow: 0 0 0 2px;--tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}[data-widget=inploi-chatbot] .autofill\\:focus\\:shadow-\\[inset_0_0_0_1000px_var\\(--i-color-a-1\\)\\]:focus:-webkit-autofill{--tw-shadow: inset 0 0 0 1000px var(--i-color-a-1);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:focus\\:shadow-\\[inset_0_0_0_1000px_var\\(--i-color-a-1\\)\\]:focus:autofill{--tw-shadow: inset 0 0 0 1000px var(--i-color-a-1);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .focus-visible\\:bg-neutral-3:focus-visible{background-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}[data-widget=inploi-chatbot] .focus-visible\\:outline-2:focus-visible{outline-width:2px}[data-widget=inploi-chatbot] .focus-visible\\:outline-accent-7:focus-visible{outline-color:var(--i-color-a-7)}[data-widget=inploi-chatbot] .focus-visible\\:outline-accent-8:focus-visible{outline-color:var(--i-color-a-8)}[data-widget=inploi-chatbot] .focus-visible\\:ring-4:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}[data-widget=inploi-chatbot] .active\\:scale-\\[\\.97\\]:active{--tw-scale-x: .97;--tw-scale-y: .97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .active\\:border-submit-bg-active:active{border-color:var(--i-submit-button-bg-active)}[data-widget=inploi-chatbot] .active\\:bg-accent-10:active{background-color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .active\\:bg-accent-2:active{background-color:var(--i-color-a-2)}[data-widget=inploi-chatbot] .active\\:bg-interactive-bg-active:active{background-color:var(--i-interactive-bg-active)}[data-widget=inploi-chatbot] .active\\:bg-interactive-bg-hover:active{background-color:var(--i-interactive-bg-hover)}[data-widget=inploi-chatbot] .active\\:bg-submit-bg-active:active{background-color:var(--i-submit-button-bg-active)}[data-widget=inploi-chatbot] .active\\:bg-white\\/30:active{background-color:#ffffff4d}[data-widget=inploi-chatbot] .active\\:text-accent-10:active{color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .active\\:text-accent-11:active{color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .active\\:text-neutral-12:active{color:var(--i-color-n-12)}[data-widget=inploi-chatbot] .active\\:text-white:active{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .active\\:outline-neutral-8:active{outline-color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .active\\:ring-2:active{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .active\\:ring-accent-7:active{--tw-ring-color: var(--i-color-a-7)}[data-widget=inploi-chatbot] .active\\:ring-interactive-bg-hover:active{--tw-ring-color: var(--i-interactive-bg-hover)}[data-widget=inploi-chatbot] .active\\:ring-offset-2:active{--tw-ring-offset-width: 2px}[data-widget=inploi-chatbot] .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}[data-widget=inploi-chatbot] .disabled\\:opacity-50:disabled{opacity:.5}[data-widget=inploi-chatbot] .peer:checked~.peer-checked\\:bg-accent-2{background-color:var(--i-color-a-2)}[data-widget=inploi-chatbot] .peer:checked~.peer-checked\\:text-accent-9{color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .peer:checked~.peer-checked\\:outline-accent-7{outline-color:var(--i-color-a-7)}[data-widget=inploi-chatbot] .peer:focus-visible~.peer-focus-visible\\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .peer:focus-visible~.peer-focus-visible\\:ring-accent-9{--tw-ring-color: var(--i-color-a-9)}[data-widget=inploi-chatbot] .peer:focus-visible~.peer-focus-visible\\:ring-offset-accent-7{--tw-ring-offset-color: var(--i-color-a-7)}[data-widget=inploi-chatbot] .group[aria-pressed=true] .group-aria-\\[pressed\\=true\\]\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (pointer: coarse){[data-widget=inploi-chatbot] .pointer-coarse\\:touch-hitbox\\:\\:before:before{content:"";position:absolute;display:block;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-height:44px;min-width:44px;z-index:9999}}[data-widget=inploi-chatbot] .\\[\\&\\:has\\(\\+\\*\\>input\\:focus\\)\\]\\:text-neutral-11:has(+*>input:focus){color:var(--i-color-n-11)}[data-widget=inploi-chatbot] .\\[\\&\\:has\\(\\.view-switch\\:active\\)\\]\\:scale-\\[0\\.98\\]:has(.view-switch:active){--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .\\[\\&\\:has\\(\\>\\.view-switch\\:focus-visible\\)\\]\\:ring-1:has(>.view-switch:focus-visible){--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}[data-widget=inploi-chatbot] dialog::backdrop{animation:fade-in .5s cubic-bezier(.16,1,.3,1) both}[data-widget=inploi-chatbot] dialog::backdrop{background-color:var(--i-overlay-bg)}
2
- `,Ga="inploi-chatbot",Ni=`[data-widget='${Ga}']`,Wc=()=>({getChatbotElement:()=>document.querySelector(Ni),getOrCreateChatbotElement:()=>{const e=document.querySelector(Ni);if(e)return document.body.appendChild(e),e;const t=document.createElement("div");return document.body.appendChild(t),t.dataset.widget=Ga,t}}),Kc=25,Ya=Je(()=>{}),Gc=(e,t)=>new Promise((r,i)=>{if(t!=null&&t.aborted)return i(new gt);const n=setTimeout(r,e);t==null||t.addEventListener("abort",()=>{clearTimeout(n),i(new gt)},{once:!0})}),ie={onSubmitSuccessFn$:Je(()=>{}),onInteractionFn$:Je(()=>{}),isBotTyping$:Je(!1),isReadingHistory$:Je(!1),scrollToEnd:()=>Ya.value()},Yc=()=>{const e=ve(null);be(()=>{const r=e.current;if(!r)return;const i=()=>{ie.isReadingHistory$.value=!1,r.scrollTo({top:r.scrollHeight,behavior:"instant"})};Ya.value=i;const n=()=>{ie.isReadingHistory$.value=r.scrollHeight-r.scrollTop-r.clientHeight>2};r.addEventListener("scroll",n,{passive:!0});const a=new ResizeObserver(()=>{ie.isReadingHistory$.peek()||i()});return a.observe(r),r.firstElementChild&&a.observe(r.firstElementChild),()=>{r.removeEventListener("scroll",n),a.disconnect()}},[]);const t=rt(()=>({setSubmission:(i,n)=>D.setSubmission(i,n),send:async({message:i,signal:n,groupId:a})=>{if(await wr(i).with({author:"bot",type:"text"},async o=>{if(n!=null&&n.aborted)throw new gt;ie.isBotTyping$.value=!0;const s=Math.min(Math.max(20,o.text.length),100)*Kc;try{await Gc(s,n)}finally{ie.isBotTyping$.value=!1}}).otherwise(async()=>{}),n!=null&&n.aborted)throw new gt;D.addMessage(i,a)},input:({input:i,signal:n})=>{if(n!=null&&n.aborted)throw new gt;return D.setInput(i),new Promise(a=>{const o=s=>{if(n!=null&&n.aborted)throw new gt;D.setInput(void 0),i.key&&D.setSubmission(i.key,s),a(s)};ie.onSubmitSuccessFn$.value=o})}}),[]);return{chatRef:e,chatService:t}};var Ja=bs(jr([Ce(),ar()]),sn(String)),Za=ue({id:Ja,version:ar(),build:ar(),nodes:cn(ln()),context_schema:Se(nr(un(Ce(),ue({required:Lr(),type:jr([ir("string"),ir("number")])}))))}),Jc=ue({flow:Za}),Zc=ue({company:ue({name:Ce()}),flow:Za,job:ue({id:Ja,title:Ce()}),user:Se(ue({city:Se(Ce()),country:Se(Ce()),isEU:Se(Lr()),continent:Se(Ce())}))}),Xc={pathname:"/flow/job/:id",method:"GET",schema:{searchParams:Rs(),response:Zc}},Qc={pathname:"/flow/id/:id",method:"GET",schema:{response:Jc}},eu=["1","2","3","4","5","6","7","8","9","10","11","12"],tu={light:{1:[98.8,.015],2:[97.8,.018],3:[95.8,.025],4:[92,.04],5:[89,.05],6:[85,.07],7:[80.5,.08],8:[74,.11],9:[60,.22],10:[56,.23],11:[50,.19],12:[25,.18]},dark:{1:[19,.015],2:[21,.018],3:[25.5,.055],4:[29.3,.084],5:[33.5,.098],6:[39.05,.107],7:[45,.11],8:[55,.13],9:[60,.22],10:[67,.18],11:[79.3,.12],12:[95,.04]}},ru=(e,t=1,r)=>i=>{const[n,a]=tu[r][i];return"oklch("+n+"% "+a*t+" "+e+")"},Ti=e=>{const t=ru(e.hue,e.chroma,e.mode);return Object.fromEntries(eu.map(r=>[e.prefix+r,e.transform(t(r))]))},Di=e=>e,iu=e=>{const t=Object.keys(e).flatMap(r=>{const i=e[r];return typeof i=="object"&&i!==null?Object.keys(i).map(n=>{const a=i[n];return[`${String(r)}.${n}`,a]}):[[r,i]]});return Object.fromEntries(t)},Er=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Mi=(e,...t)=>{if(!t.length)return e;const r=t.shift();if(Er(e)&&Er(r))for(const i in r){const n=r[i];if(Er(n)){e[i]||Object.assign(e,{[i]:{}});const a=e[i];Er(a)&&Mi(a,n)}else Object.assign(e,{[i]:r[i]})}return Mi(e,...t)},nu=e=>{function t(r,i){const n=[e.prefix,i.toString().replace(/\./g,"-")].join("");return r==="declaration"?`--${n}`:`var(--${n})`}return t},au=()=>({core:e=>({semantic:t=>({component:r=>({from:i=>{const{theme:n,getToken:a}=i,o=h=>a("reference",h.toString()),s=e({theme:n}),l=t({theme:n,core:o,raw:{core:s}}),d=r({theme:n,core:o,semantic:o,raw:{core:s,semantic:l}}),p=iu(Mi(s,l,d)),u=([h,b],m)=>{const _=[m,h].filter(Boolean).join(".");return typeof b=="object"?Object.entries(b).flatMap(I=>u(I,_)):[[i.getToken("declaration",_),b]]};return{values:p,declarations:Object.fromEntries(Object.entries(p).flatMap(h=>u(h))),ref:h=>a("reference",h.toString())}}})})})});const[Vi,Pi,Xa]=["oklch(0% 0 0)","oklch(100% 0 0)","transparent"],ou=au().core(({theme:e})=>({color:{black:Vi,white:Pi,lowest:e.mode==="light"?Pi:Vi,highest:e.mode==="light"?Vi:Pi,...Ti({prefix:"a-",hue:e.hue,chroma:e.chroma,mode:e.mode,transform:Di}),...Ti({prefix:"n-",hue:e.hue,chroma:.05,mode:e.mode,transform:Di}),...Ti({prefix:"e-",hue:20,chroma:e.chroma,mode:e.mode,transform:Di})},typography:{}})).semantic(({core:e,raw:t,theme:r})=>{const i=(n,a)=>t.core.color[n].replace(")",` / ${a})`);return{"font-family":{body:"inherit",headings:"inherit"},"font-style":{body:"normal",headings:"normal"},"font-weight-body":"normal","font-weight-headings":"normal","radius-app":"1.5rem","radius-interactive":"1.5rem",color:{divider:i("n-8",r.mode==="dark"?.4:.2)},"copy-body":e("color.n-12"),"copy-headings":e("color.n-12"),interactive:{copy:e("color.n-11"),"copy-hover":e("color.n-12"),"copy-active":e("color.n-12"),bg:Xa,"bg-hover":i("n-10",.2),"bg-active":i("n-10",.3)}}}).component(({raw:e,theme:t,semantic:r,core:i})=>{const n=(a,o)=>e.core.color[a].replace(")",` / ${o})`);return{app:{bg:i(t.mode==="dark"?"color.n-1":"color.n-2")},overlay:{bg:n("black",.4)},bubble:{"weak-bg":i(t.mode==="dark"?"color.n-3":"color.lowest"),"weak-outline":r("color.divider"),"strong-shadow":n("a-9",.05)},"status-bar":{bg:n("n-2",.8),"bg-button":Xa,"bg-button-hover":n("n-10",.4),"bg-button-active":n("n-10",.5)},"submit-button":{"bg-active":i(t.mode==="dark"?"color.a-8":"color.a-11")}}}),su=nu({prefix:"i-"}),lu=e=>{const t=ou.from({theme:e,getToken:su}),r=Object.entries(t.declarations).map(([i,n])=>`${i}: ${n};`);return`${Ni} {
1
+ (function(){"use strict";var ze;function dn(e){return{lang:(e==null?void 0:e.lang)??(ze==null?void 0:ze.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(ze==null?void 0:ze.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(ze==null?void 0:ze.abortPipeEarly)}}var Rr;function gs(e){return Rr==null?void 0:Rr.get(e)}var zr;function bs(e){return zr==null?void 0:zr.get(e)}var Ur;function vs(e,t){var r;return(r=Ur==null?void 0:Ur.get(e))==null?void 0:r.get(t)}function fn(e){var r,i;let t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((i=(r=Object.getPrototypeOf(e))==null?void 0:r.constructor)==null?void 0:i.name))??"null":t}function De(e,t,r,i,n){let a=n&&"input"in n?n.input:r.value,o=(n==null?void 0:n.expected)??e.expects??null,s=(n==null?void 0:n.received)??fn(a),l={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:"R"}eceived ${s}`,requirement:e.requirement,path:n==null?void 0:n.path,issues:n==null?void 0:n.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},d=e.kind==="schema",p=(n==null?void 0:n.message)??e.message??vs(e.reference,l.lang)??(d?bs(l.lang):null)??i.message??gs(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),d&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function _e(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},dn())}}}function ws(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function ms(e,t){let r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}function pn(e){return{kind:"transformation",type:"transform",reference:pn,async:!1,operation:e,"~run"(t){return t.value=this.operation(t.value),t}}}function ys(e,t,r){return typeof e.fallback=="function"?e.fallback(t,r):e.fallback}function qr(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function hn(){return{kind:"schema",type:"any",reference:hn,expects:"any",async:!1,get"~standard"(){return _e(this)},"~run"(e){return e.typed=!0,e}}}function gn(e,t){return{kind:"schema",type:"array",reference:gn,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return _e(this)},"~run"(r,i){var a;let n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let o=0;o<n.length;o++){let s=n[o],l=this.item["~run"]({value:s},i);if(l.issues){let d={type:"array",origin:"value",input:n,key:o,value:s};for(let p of l.issues)p.path?p.path.unshift(d):p.path=[d],(a=r.issues)==null||a.push(p);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else De(this,"type",r,i);return r}}}function Hr(e){return{kind:"schema",type:"boolean",reference:Hr,expects:"boolean",async:!1,message:e,get"~standard"(){return _e(this)},"~run"(t,r){return typeof t.value=="boolean"?t.typed=!0:De(this,"type",t,r),t}}}function or(e,t){return{kind:"schema",type:"literal",reference:or,expects:fn(e),async:!1,literal:e,message:t,get"~standard"(){return _e(this)},"~run"(r,i){return r.value===this.literal?r.typed=!0:De(this,"type",r,i),r}}}function sr(e,t){return{kind:"schema",type:"nullable",reference:sr,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,get"~standard"(){return _e(this)},"~run"(r,i){return r.value===null&&(this.default!==void 0&&(r.value=qr(this,r,i)),r.value===null)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function lr(e){return{kind:"schema",type:"number",reference:lr,expects:"number",async:!1,message:e,get"~standard"(){return _e(this)},"~run"(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:De(this,"type",t,r),t}}}function fe(e,t){return{kind:"schema",type:"object",reference:fe,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return _e(this)},"~run"(r,i){var a;let n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(let o in this.entries){let s=this.entries[o];if(o in n||(s.type==="exact_optional"||s.type==="optional"||s.type==="nullish")&&s.default!==void 0){let l=o in n?n[o]:qr(s),d=s["~run"]({value:l},i);if(d.issues){let p={type:"object",origin:"value",input:n,key:o,value:l};for(let u of d.issues)u.path?u.path.unshift(p):u.path=[p],(a=r.issues)==null||a.push(u);if(r.issues||(r.issues=d.issues),i.abortEarly){r.typed=!1;break}}d.typed||(r.typed=!1),r.value[o]=d.value}else if(s.fallback!==void 0)r.value[o]=ys(s);else if(s.type!=="exact_optional"&&s.type!=="optional"&&s.type!=="nullish"&&(De(this,"key",r,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:n,key:o,value:n[o]}]}),i.abortEarly))break}}else De(this,"type",r,i);return r}}}function Ce(e,t){return{kind:"schema",type:"optional",reference:Ce,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return _e(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=qr(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function bn(e,t,r){return{kind:"schema",type:"record",reference:bn,expects:"Object",async:!1,key:e,value:t,message:r,get"~standard"(){return _e(this)},"~run"(i,n){var o,s;let a=i.value;if(a&&typeof a=="object"){i.typed=!0,i.value={};for(let l in a)if(ws(a,l)){let d=a[l],p=this.key["~run"]({value:l},n);if(p.issues){let h={type:"object",origin:"key",input:a,key:l,value:d};for(let b of p.issues)b.path=[h],(o=i.issues)==null||o.push(b);if(i.issues||(i.issues=p.issues),n.abortEarly){i.typed=!1;break}}let u=this.value["~run"]({value:d},n);if(u.issues){let h={type:"object",origin:"value",input:a,key:l,value:d};for(let b of u.issues)b.path?b.path.unshift(h):b.path=[h],(s=i.issues)==null||s.push(b);if(i.issues||(i.issues=u.issues),n.abortEarly){i.typed=!1;break}}(!p.typed||!u.typed)&&(i.typed=!1),p.typed&&(i.value[p.value]=u.value)}}else De(this,"type",i,n);return i}}}function $e(e){return{kind:"schema",type:"string",reference:$e,expects:"string",async:!1,message:e,get"~standard"(){return _e(this)},"~run"(t,r){return typeof t.value=="string"?t.typed=!0:De(this,"type",t,r),t}}}function vn(e){let t;if(e)for(let r of e)t?t.push(...r.issues):t=r.issues;return t}function Wr(e,t){return{kind:"schema",type:"union",reference:Wr,expects:ms(e.map(r=>r.expects),"|"),async:!1,options:e,message:t,get"~standard"(){return _e(this)},"~run"(r,i){let n,a,o;for(let s of this.options){let l=s["~run"]({value:r.value},i);if(l.typed)if(l.issues)a?a.push(l):a=[l];else{n=l;break}else o?o.push(l):o=[l]}if(n)return n;if(a){if(a.length===1)return a[0];De(this,"type",r,i,{issues:vn(a)}),r.typed=!0}else{if((o==null?void 0:o.length)===1)return o[0];De(this,"type",r,i,{issues:vn(o)})}return r}}}function cr(){return{kind:"schema",type:"unknown",reference:cr,expects:"unknown",async:!1,get"~standard"(){return _e(this)},"~run"(e){return e.typed=!0,e}}}function _s(...e){return{...e[0],pipe:e,get"~standard"(){return _e(this)},"~run"(t,r){for(let i of e)if(i.kind!=="metadata"){if(t.issues&&(i.kind==="schema"||i.kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=i["~run"](t,r))}return t}}}function wn(e,t,r){let i=e["~run"]({value:t},dn(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var xs=e=>({ok:!0,err:!1,val:e}),ks=e=>({err:!0,ok:!1,val:e}),Kr=e=>e.filter(t=>(t.type==="question-boolean"||t.type==="question-enum")&&!!t.data.preApply);function Gr(e,t,r){var o,s;let i=e.find(l=>l.type==="pre-apply-result");if(!i)return;let n=(o=t[i.data.participationKey])==null?void 0:o.value,a={};if(n===!0)for(let l of Kr(e)){let d=(s=t[l.data.key])==null?void 0:s.value;Array.isArray(d)&&d.length===1&&(d=d[0]),(typeof d=="boolean"||typeof d=="string")&&(a[l.data.key]=d)}return{node_id:i.id,flow_session_id:r,participation:n,answers:a}}function Ss(e,t){let r=Gr(e,t,""),i=Kr(e).map(a=>{let o=a.data.preApply,s=r==null?void 0:r.answers[a.data.key],l=a.type==="question-boolean"?typeof s=="boolean":a.data.options.some(d=>d.value===s);return{key:a.data.key,severity:o.severity,message:o.mismatchMessage,matched:l&&s===o.expectedValue,valid:l}}),n=(r==null?void 0:r.participation)===!1?"skipped":(r==null?void 0:r.participation)===!0&&i.length>0&&i.every(a=>a.valid)?"completed":"unavailable";return{status:n,hasHardConcerns:n==="completed"?i.some(a=>!a.matched&&a.severity==="hard"):null,hasAdvisoryConcerns:n==="completed"?i.some(a=>!a.matched&&a.severity==="advisory"):null,answers:n==="completed"?i:[]}}function Cs(e,t){let r=new Set(Kr(e).map(i=>i.data.key));for(let i of e)i.type==="pre-apply-result"&&(r.add(i.data.key),r.add(i.data.participationKey));return Object.fromEntries(Object.entries(t).filter(([i])=>!r.has(i)))}var Pt=(e,t)=>{if(t.length===0)return;let r=e;for(let i of t){if(r==null||typeof r!="object")return;r=r[i]}return r},$s=(e,t="all")=>{let r={},i=t==="all"?null:new Set(t);for(let n in e){let a=e[n];a&&(i&&!i.has(n)||(r[n]=a.value))}return r},Es=({key:e,submissions:t})=>{var i;let r=(i=t[e])==null?void 0:i.value;if(typeof r!="string"&&typeof r!="number")throw new Error(`Submission at “${e}” is not a string or number`);return r},mn=({key:e,path:t,submissions:r,context:i})=>{if(e==="$context"){if(!t)return;let n=Pt(i,t);switch(typeof n){case"string":return{type:"string",value:n};case"number":return{type:"number",value:n};case"boolean":return{type:"boolean",value:n};default:console.warn(`Unexpected type for $context.${t.join(".")}`,n);return}}return r[e]},Is=e=>{let t=e.split(".").pop();return t?xs(t?"."+t:""):ks("No file extension found")},yn=(e,t)=>{if(t.length===0)return!0;let r=t.map(i=>i.toLowerCase());return e.every(i=>{let n=Is(i.name);return n.ok&&r.includes(n.val.toLowerCase())})},Ot=e=>e<=1e3?`${Math.round(e)}KB`:e<1e3*10?`${(e/1e3).toFixed(1)}MB`:`${Math.round(e/1e3)}MB`,ur=e=>typeof e=="string"?e:`+${e.countryCode} ${e.phoneNumber}`,As=fe({integration_response:fe({data:fe({redirect_url:$e(),message:Ce(sr($e())),button_text:Ce(sr($e()))})})}),Ns=e=>wn(As,e).success,Fs=fe({integration_response:fe({status:Ce(cr()),error:fe({message:$e(),data:Ce(cr())})})}),Ts=e=>wn(Fs,e).success;fe({success:or(!1),message:Ce(cr())});var _n=(e,t)=>{if(!Ts(e))return;let r=e.integration_response,i=r.error.data,n=typeof i=="object"&&i!==null?i:{},a=h=>typeof n[h]=="string"?n[h]:void 0,o=h=>typeof n[h]=="boolean"?n[h]:void 0,s=typeof r.status=="number"?r.status:t,l=a("phase"),d=a("verdict"),p=a("code"),u=s===409&&l==="submit"&&d==="confirmed"?"duplicate":s===410&&p==="job_closed"?"closed":l==="submit"&&d==="unknown"?"unknown":void 0;return{message:r.error.message,status:s,phase:l,retryable:o("retryable"),verdict:d,code:p,field:a("field"),outcome:u}},Ds=e=>{if(typeof e!="object"||e===null)return null;let t=e.integration_response;if(typeof t!="object"||t===null)return null;let r=t;if(typeof r.status!="number"||r.service!==void 0&&typeof r.service!="string")return null;let i="data"in r,n=r.error,a=typeof n=="object"&&n!==null&&typeof n.message=="string"&&"data"in n;if(!i&&!a)return null;let o=i?r.data:n.data??null;return{service:r.service??"INVALID_SERVICE",response:{status:r.status,payload:o}}},Ms=({context:e,schema:t,logger:r})=>{if(t)for(let i in t){let n=t[i];if(!n)continue;let a=Pt(e,i.split("."));if(n.required&&a==null){let o=`Configuration error in context: ${i} is required`;throw r.error(o),new Error(o)}if(a!=null)switch(n.type){case"number":if(typeof a!="number")throw new Error(`Configuration error in context: ${i} is not a number`);break;case"string":if(typeof a!="string")throw new Error(`Configuration error in context: ${i} is not a string`);break;default:n.type}}};let Ue;function xn(e){return{lang:(e==null?void 0:e.lang)??(Ue==null?void 0:Ue.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(Ue==null?void 0:Ue.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(Ue==null?void 0:Ue.abortPipeEarly)}}let Yr;function Vs(e){return Yr==null?void 0:Yr.get(e)}let Jr;function Ps(e){return Jr==null?void 0:Jr.get(e)}let Xr;function Os(e,t){var r;return(r=Xr==null?void 0:Xr.get(e))==null?void 0:r.get(t)}function kn(e){var r,i;const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((i=(r=Object.getPrototypeOf(e))==null?void 0:r.constructor)==null?void 0:i.name))??"null":t}function Me(e,t,r,i,n){const a=n&&"input"in n?n.input:r.value,o=(n==null?void 0:n.expected)??e.expects??null,s=(n==null?void 0:n.received)??kn(a),l={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:"R"}eceived ${s}`,requirement:e.requirement,path:n==null?void 0:n.path,issues:n==null?void 0:n.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},d=e.kind==="schema",p=(n==null?void 0:n.message)??e.message??Os(e.reference,l.lang)??(d?Ps(l.lang):null)??i.message??Vs(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),d&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function Ee(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},xn())}}}function Ls(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function js(e,t){const r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}function Zr(e,t){return{kind:"validation",type:"max_length",reference:Zr,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&Me(this,"length",r,i,{received:`${r.value.length}`}),r}}}function dr(e,t){return{kind:"validation",type:"min_length",reference:dr,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&Me(this,"length",r,i,{received:`${r.value.length}`}),r}}}function Qr(){return{kind:"transformation",type:"trim",reference:Qr,async:!1,"~run"(e){return e.value=e.value.trim(),e}}}function Bs(e,t,r){return typeof e.fallback=="function"?e.fallback(t,r):e.fallback}function fr(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function Sn(e,t){return{kind:"schema",type:"array",reference:Sn,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return Ee(this)},"~run"(r,i){var a;const n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let o=0;o<n.length;o++){const s=n[o],l=this.item["~run"]({value:s},i);if(l.issues){const d={type:"array",origin:"value",input:n,key:o,value:s};for(const p of l.issues)p.path?p.path.unshift(d):p.path=[d],(a=r.issues)==null||a.push(p);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else Me(this,"type",r,i);return r}}}function ei(e){return{kind:"schema",type:"boolean",reference:ei,expects:"boolean",async:!1,message:e,get"~standard"(){return Ee(this)},"~run"(t,r){return typeof t.value=="boolean"?t.typed=!0:Me(this,"type",t,r),t}}}function q(e,t){return{kind:"schema",type:"nullable",reference:q,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,get"~standard"(){return Ee(this)},"~run"(r,i){return r.value===null&&(this.default!==void 0&&(r.value=fr(this,r,i)),r.value===null)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function Lt(e,t){return{kind:"schema",type:"nullish",reference:Lt,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Ee(this)},"~run"(r,i){return(r.value===null||r.value===void 0)&&(this.default!==void 0&&(r.value=fr(this,r,i)),r.value===null||r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function ft(e){return{kind:"schema",type:"number",reference:ft,expects:"number",async:!1,message:e,get"~standard"(){return Ee(this)},"~run"(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:Me(this,"type",t,r),t}}}function Ie(e,t){return{kind:"schema",type:"object",reference:Ie,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return Ee(this)},"~run"(r,i){var a;const n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(const o in this.entries){const s=this.entries[o];if(o in n||(s.type==="exact_optional"||s.type==="optional"||s.type==="nullish")&&s.default!==void 0){const l=o in n?n[o]:fr(s),d=s["~run"]({value:l},i);if(d.issues){const p={type:"object",origin:"value",input:n,key:o,value:l};for(const u of d.issues)u.path?u.path.unshift(p):u.path=[p],(a=r.issues)==null||a.push(u);if(r.issues||(r.issues=d.issues),i.abortEarly){r.typed=!1;break}}d.typed||(r.typed=!1),r.value[o]=d.value}else if(s.fallback!==void 0)r.value[o]=Bs(s);else if(s.type!=="exact_optional"&&s.type!=="optional"&&s.type!=="nullish"&&(Me(this,"key",r,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:n,key:o,value:n[o]}]}),i.abortEarly))break}}else Me(this,"type",r,i);return r}}}function Cn(e,t){return{kind:"schema",type:"optional",reference:Cn,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Ee(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=fr(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function kt(e,t){return{kind:"schema",type:"picklist",reference:kt,expects:js(e.map(kn),"|"),async:!1,options:e,message:t,get"~standard"(){return Ee(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:Me(this,"type",r,i),r}}}function ti(e,t,r){return{kind:"schema",type:"record",reference:ti,expects:"Object",async:!1,key:e,value:t,message:r,get"~standard"(){return Ee(this)},"~run"(i,n){var o,s;const a=i.value;if(a&&typeof a=="object"){i.typed=!0,i.value={};for(const l in a)if(Ls(a,l)){const d=a[l],p=this.key["~run"]({value:l},n);if(p.issues){const h={type:"object",origin:"key",input:a,key:l,value:d};for(const b of p.issues)b.path=[h],(o=i.issues)==null||o.push(b);if(i.issues||(i.issues=p.issues),n.abortEarly){i.typed=!1;break}}const u=this.value["~run"]({value:d},n);if(u.issues){const h={type:"object",origin:"value",input:a,key:l,value:d};for(const b of u.issues)b.path?b.path.unshift(h):b.path=[h],(s=i.issues)==null||s.push(b);if(i.issues||(i.issues=u.issues),n.abortEarly){i.typed=!1;break}}(!p.typed||!u.typed)&&(i.typed=!1),p.typed&&(i.value[p.value]=u.value)}}else Me(this,"type",i,n);return i}}}function P(e){return{kind:"schema",type:"string",reference:P,expects:"string",async:!1,message:e,get"~standard"(){return Ee(this)},"~run"(t,r){return typeof t.value=="string"?t.typed=!0:Me(this,"type",t,r),t}}}function $n(){return{kind:"schema",type:"unknown",reference:$n,expects:"unknown",async:!1,get"~standard"(){return Ee(this)},"~run"(e){return e.typed=!0,e}}}function ri(...e){return{...e[0],pipe:e,get"~standard"(){return Ee(this)},"~run"(t,r){for(const i of e)if(i.kind!=="metadata"){if(t.issues&&(i.kind==="schema"||i.kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=i["~run"](t,r))}return t}}}function ii(e,t,r){const i=e["~run"]({value:t},xn(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var Rs=e=>e,zs=class extends Error{constructor(t,r){super(t),this.status=r,this.name="ErrorWithStatus"}},En=class extends zs{constructor(t,r,i){super(t),this.data=i,this.name="ApiError",this.status=r??500}},Us=e=>e instanceof En&&e.data!==void 0,qs={sandbox:"https://talent-bank.staging.inploi.com",production:"https://talent-bank.inploi.com",_internal_local:"http://localhost:8787"};function Hs(){return{"~standard":{vendor:"inploi",version:1,validate:e=>({value:e})}}}function Bf(e){return e}var Ws=["agent","sdk","form","integration","migration"],Ks=["APPLIED","SHORTLISTED","INTERVIEWED","OFFERED","HIRED","REJECTED","WITHDRAWN"],Gs=["screening","cv_match","interview","overall"],Ys=["PENDING","SCHEDULED","IN_PROGRESS","COMPLETED","CANCELLED"],Js=["careers_site","chatbot","plugin_job_search","ats_import","referral","agency","other","unknown"],In=kt(Ws),Xs=kt(Ks),Zs=ri(P(),Qr(),dr(1),Zr(100)),Qs=kt(Gs),el=kt(Ys),tl=ri(P(),Qr(),dr(1),Zr(100)),rl=kt(Js),An=Ie({id:P(),email:q(P()),firstName:q(P()),lastName:q(P()),phone:q(P()),source:q(In),identifiedAt:q(P()),createdAt:P(),updatedAt:P()}),Nn=ri(P(),dr(1)),ni=ti(P(),$n()),il=Ie({id:P(),applicationId:P(),status:el,scheduledAt:q(P()),completedAt:q(P()),meta:q(ni),createdAt:P(),updatedAt:P()}),nl=Ie({score:ft(),reason:P(),confidence:ft()}),Fn=Ie({id:P(),candidateId:P(),jobId:ft(),stage:Zs,stageGroup:Xs,stageEnteredAt:P(),rating:q(ft()),disqualifiedAt:q(P()),disqualificationReason:q(tl),disqualificationNote:q(P()),source:rl,sourceDetail:q(P()),sessionId:q(ft()),externalApplicationId:q(P()),meta:q(ni),context:q(ni),scoredAt:q(P()),createdAt:P(),updatedAt:P()}),al=Ie({id:P(),applicationId:P(),scoreType:Qs,score:q(ft()),reason:q(P()),categories:q(ti(P(),nl)),scoredBy:q(P()),createdAt:P()});({...Fn.entries},{...An.entries});var ol=Ie({anonymousId:Nn,email:Nn,firstName:Lt(P()),lastName:Lt(P()),phone:Lt(P()),source:Lt(In)}),sl=Ie({candidateId:P(),isNew:ei()}),ll=Ie({id:P(),stageGroup:P(),createdAt:P()}),cl=Ie({isDuplicate:ei(),existingApplication:Cn(ll)}),ul=({environment:e,publishableKey:t,logger:r})=>{let i=qs[e];return{async checkDuplicate(n){try{let a=new URLSearchParams({email:n.email,scope:n.scope});n.scope==="job"&&n.jobId!=null&&a.set("job_id",String(n.jobId));let o=await fetch(`${i}/applications/check-duplicate?${a}`,{method:"GET",headers:{Accept:"application/json","x-publishable-key":t}});if(!o.ok)return r.error(`[TalentBankClient] checkDuplicate failed with status ${o.status}`),{isDuplicate:!1};let s=await o.json(),l=ii(cl,s);return l.success?l.output:(r.error("[TalentBankClient] checkDuplicate response failed strict validation; falling back to isDuplicate flag"),typeof s=="object"&&s!=null&&typeof s.isDuplicate=="boolean"?{isDuplicate:s.isDuplicate}:{isDuplicate:!1})}catch(a){return r.error("[TalentBankClient] checkDuplicate failed:",a),{isDuplicate:!1}}},async identify(n){try{if(!n.anonymousId)return r.error("[TalentBankClient] identify skipped because anonymousId is missing"),null;let a={email:n.email,firstName:n.firstName,lastName:n.lastName,phone:n.phone,anonymousId:n.anonymousId,source:n.source??"sdk"},o=ii(ol,a);if(!o.success)return r.error("[TalentBankClient] identify received invalid input"),null;let s=await fetch(`${i}/identify`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","x-publishable-key":t},body:JSON.stringify(o.output)});if(!s.ok)return r.error(`[TalentBankClient] identify failed with status ${s.status}`),null;let l=ii(sl,await s.json());return l.success?l.output:(r.error("[TalentBankClient] identify returned an invalid response"),null)}catch(a){return r.error("[TalentBankClient] identify failed:",a),null}}}},jt,F,Tn,Dn,pt,Mn,Vn,ai,Pn,St={},On=[],dl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pr=Array.isArray;function qe(e,t){for(var r in t)e[r]=t[r];return e}function Ln(e){var t=e.parentNode;t&&t.removeChild(e)}function xe(e,t,r){var i,n,a,o={};for(a in t)a=="key"?i=t[a]:a=="ref"?n=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?jt.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return Bt(e,o,i,n,null)}function Bt(e,t,r,i,n){var a={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:n??++Tn};return n==null&&F.vnode!=null&&F.vnode(a),a}function fl(){return{current:null}}function ee(e){return e.children}function Ae(e,t){this.props=e,this.context=t}function hr(e,t){if(t==null)return e.__?hr(e.__,e.__.__k.indexOf(e)+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?hr(e):null}function jn(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return jn(e)}}function oi(e){(!e.__d&&(e.__d=!0)&&pt.push(e)&&!gr.__r++||Mn!==F.debounceRendering)&&((Mn=F.debounceRendering)||Vn)(gr)}function gr(){var e,t,r,i,n,a,o,s,l;for(pt.sort(ai);e=pt.shift();)e.__d&&(t=pt.length,i=void 0,n=void 0,a=void 0,s=(o=(r=e).__v).__e,(l=r.__P)&&(i=[],n=[],(a=qe({},o)).__v=o.__v+1,si(l,o,a,r.__n,l.ownerSVGElement!==void 0,o.__h!=null?[s]:null,i,s??hr(o),o.__h,n),Wn(i,o,n),o.__e!=s&&jn(o)),pt.length>t&&pt.sort(ai));gr.__r=0}function Bn(e,t,r,i,n,a,o,s,l,d,p){var u,h,b,m,k,A,x,v,y,S,E=0,M=i&&i.__k||On,R=M.length,V=R,O=t.length;for(r.__k=[],u=0;u<O;u++)(m=r.__k[u]=(m=t[u])==null||typeof m=="boolean"||typeof m=="function"?null:typeof m=="string"||typeof m=="number"||typeof m=="bigint"?Bt(null,m,null,null,m):pr(m)?Bt(ee,{children:m},null,null,null):m.__b>0?Bt(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)!=null&&(m.__=r,m.__b=r.__b+1,(v=pl(m,M,x=u+E,V))===-1?b=St:(b=M[v]||St,M[v]=void 0,V--),si(e,m,b,n,a,o,s,l,d,p),k=m.__e,(h=m.ref)&&b.ref!=h&&(b.ref&&li(b.ref,null,m),p.push(h,m.__c||k,m)),k!=null&&(A==null&&(A=k),S=!(y=b===St||b.__v===null)&&v===x,y?v==-1&&E--:v!==x&&(v===x+1?(E++,S=!0):v>x?V>O-x?(E+=v-x,S=!0):E--:E=v<x&&v==x-1?v-x:0),x=u+E,S=S||v==u&&!y,typeof m.type!="function"||v===x&&b.__k!==m.__k?typeof m.type=="function"||S?m.__d!==void 0?(l=m.__d,m.__d=void 0):l=k.nextSibling:l=zn(e,k,l):l=Rn(m,l,e),typeof r.type=="function"&&(r.__d=l)));for(r.__e=A,u=R;u--;)M[u]!=null&&(typeof r.type=="function"&&M[u].__e!=null&&M[u].__e==r.__d&&(r.__d=M[u].__e.nextSibling),Kn(M[u],M[u]))}function Rn(e,t,r){for(var i,n=e.__k,a=0;n&&a<n.length;a++)(i=n[a])&&(i.__=e,t=typeof i.type=="function"?Rn(i,t,r):zn(r,i.__e,t));return t}function He(e,t){return t=t||[],e==null||typeof e=="boolean"||(pr(e)?e.some(function(r){He(r,t)}):t.push(e)),t}function zn(e,t,r){return r==null||r.parentNode!==e?e.insertBefore(t,null):t==r&&t.parentNode!=null||e.insertBefore(t,r),t.nextSibling}function pl(e,t,r,i){var n=e.key,a=e.type,o=r-1,s=r+1,l=t[r];if(l===null||l&&n==l.key&&a===l.type)return r;if(i>(l!=null?1:0))for(;o>=0||s<t.length;){if(o>=0){if((l=t[o])&&n==l.key&&a===l.type)return o;o--}if(s<t.length){if((l=t[s])&&n==l.key&&a===l.type)return s;s++}}return-1}function hl(e,t,r,i,n){var a;for(a in r)a==="children"||a==="key"||a in t||br(e,a,null,r[a],i);for(a in t)n&&typeof t[a]!="function"||a==="children"||a==="key"||a==="value"||a==="checked"||r[a]===t[a]||br(e,a,t[a],r[a],i)}function Un(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||dl.test(t)?r:r+"px"}function br(e,t,r,i,n){var a;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||Un(e.style,t,"");if(r)for(t in r)i&&r[t]===i[t]||Un(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?i||e.addEventListener(t,a?Hn:qn,a):e.removeEventListener(t,a?Hn:qn,a);else if(t!=="dangerouslySetInnerHTML"){if(n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,r))}}function qn(e){return this.l[e.type+!1](F.event?F.event(e):e)}function Hn(e){return this.l[e.type+!0](F.event?F.event(e):e)}function si(e,t,r,i,n,a,o,s,l,d){var p,u,h,b,m,k,A,x,v,y,S,E,M,R,V,O=t.type;if(t.constructor!==void 0)return null;r.__h!=null&&(l=r.__h,s=t.__e=r.__e,t.__h=null,a=[s]),(p=F.__b)&&p(t);try{e:if(typeof O=="function"){if(x=t.props,v=(p=O.contextType)&&i[p.__c],y=p?v?v.props.value:p.__:i,r.__c?A=(u=t.__c=r.__c).__=u.__E:("prototype"in O&&O.prototype.render?t.__c=u=new O(x,y):(t.__c=u=new Ae(x,y),u.constructor=O,u.render=bl),v&&v.sub(u),u.props=x,u.state||(u.state={}),u.context=y,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),u.__s==null&&(u.__s=u.state),O.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=qe({},u.__s)),qe(u.__s,O.getDerivedStateFromProps(x,u.__s))),b=u.props,m=u.state,u.__v=t,h)O.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(O.getDerivedStateFromProps==null&&x!==b&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(x,y),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(x,u.__s,y)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(u.props=x,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.forEach(function(L){L&&(L.__=t)}),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[],u.__h.length&&o.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(x,u.__s,y),u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(b,m,k)})}if(u.context=y,u.props=x,u.__P=e,u.__e=!1,E=F.__r,M=0,"prototype"in O&&O.prototype.render){for(u.state=u.__s,u.__d=!1,E&&E(t),p=u.render(u.props,u.state,u.context),R=0;R<u._sb.length;R++)u.__h.push(u._sb[R]);u._sb=[]}else do u.__d=!1,E&&E(t),p=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++M<25);u.state=u.__s,u.getChildContext!=null&&(i=qe(qe({},i),u.getChildContext())),h||u.getSnapshotBeforeUpdate==null||(k=u.getSnapshotBeforeUpdate(b,m)),Bn(e,pr(V=p!=null&&p.type===ee&&p.key==null?p.props.children:p)?V:[V],t,r,i,n,a,o,s,l,d),u.base=t.__e,t.__h=null,u.__h.length&&o.push(u),A&&(u.__E=u.__=null)}else a==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=gl(r.__e,t,r,i,n,a,o,l,d);(p=F.diffed)&&p(t)}catch(L){t.__v=null,(l||a!=null)&&(t.__e=s,t.__h=!!l,a[a.indexOf(s)]=null),F.__e(L,t,r)}}function Wn(e,t,r){for(var i=0;i<r.length;i++)li(r[i],r[++i],r[++i]);F.__c&&F.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(a){a.call(n)})}catch(a){F.__e(a,n.__v)}})}function gl(e,t,r,i,n,a,o,s,l){var d,p,u,h=r.props,b=t.props,m=t.type,k=0;if(m==="svg"&&(n=!0),a!=null){for(;k<a.length;k++)if((d=a[k])&&"setAttribute"in d==!!m&&(m?d.localName===m:d.nodeType===3)){e=d,a[k]=null;break}}if(e==null){if(m===null)return document.createTextNode(b);e=n?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,b.is&&b),a=null,s=!1}if(m===null)h===b||s&&e.data===b||(e.data=b);else{if(a=a&&jt.call(e.childNodes),p=(h=r.props||St).dangerouslySetInnerHTML,u=b.dangerouslySetInnerHTML,!s){if(a!=null)for(h={},k=0;k<e.attributes.length;k++)h[e.attributes[k].name]=e.attributes[k].value;(u||p)&&(u&&(p&&u.__html==p.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(hl(e,b,h,n,s),u)t.__k=[];else if(Bn(e,pr(k=t.props.children)?k:[k],t,r,i,n&&m!=="foreignObject",a,o,a?a[0]:r.__k&&hr(r,0),s,l),a!=null)for(k=a.length;k--;)a[k]!=null&&Ln(a[k]);s||("value"in b&&(k=b.value)!==void 0&&(k!==e.value||m==="progress"&&!k||m==="option"&&k!==h.value)&&br(e,"value",k,h.value,!1),"checked"in b&&(k=b.checked)!==void 0&&k!==e.checked&&br(e,"checked",k,h.checked,!1))}return e}function li(e,t,r){try{typeof e=="function"?e(t):e.current=t}catch(i){F.__e(i,r)}}function Kn(e,t,r){var i,n;if(F.unmount&&F.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||li(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(a){F.__e(a,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&Kn(i[n],t,r||typeof e.type!="function");r||e.__e==null||Ln(e.__e),e.__=e.__e=e.__d=void 0}function bl(e,t,r){return this.constructor(e,r)}function ht(e,t,r){var i,n,a,o;F.__&&F.__(e,t),n=(i=typeof r=="function")?null:r&&r.__k||t.__k,a=[],o=[],si(t,e=(!i&&r||t).__k=xe(ee,null,[e]),n||St,St,t.ownerSVGElement!==void 0,!i&&r?[r]:n?null:t.firstChild?jt.call(t.childNodes):null,a,!i&&r?r:n?n.__e:t.firstChild,i,o),Wn(a,e,o)}function Gn(e,t){ht(e,t,Gn)}function vl(e,t,r){var i,n,a,o,s=qe({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)a=="key"?i=t[a]:a=="ref"?n=t[a]:s[a]=t[a]===void 0&&o!==void 0?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?jt.call(arguments,2):r),Bt(e.type,s,i||e.key,n||e.ref,null)}function Yn(e,t){var r={__c:t="__cC"+Pn++,__:e,Consumer:function(i,n){return i.children(n)},Provider:function(i){var n,a;return this.getChildContext||(n=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&n.some(function(s){s.__e=!0,oi(s)})},this.sub=function(o){n.push(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){n.splice(n.indexOf(o),1),s&&s.call(o)}}),i.children}};return r.Provider.__=r.Consumer.contextType=r}jt=On.slice,F={__e:function(e,t,r,i){for(var n,a,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&a.getDerivedStateFromError!=null&&(n.setState(a.getDerivedStateFromError(e)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),o=n.__d),o)return n.__E=n}catch(s){e=s}throw e}},Tn=0,Dn=function(e){return e!=null&&e.constructor===void 0},Ae.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=qe({},this.state),typeof e=="function"&&(e=e(qe({},r),this.props)),e&&qe(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),oi(this))},Ae.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),oi(this))},Ae.prototype.render=ee,pt=[],Vn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ai=function(e,t){return e.__v.__b-t.__v.__b},gr.__r=0,Pn=0;function Jn(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=Jn(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function We(){for(var e,t,r=0,i="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=Jn(e))&&(i&&(i+=" "),i+=t);return i}const Xn=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zn=We,gt=(e,t)=>r=>{var i;if((t==null?void 0:t.variants)==null)return Zn(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:n,defaultVariants:a}=t,o=Object.keys(n).map(d=>{const p=r==null?void 0:r[d],u=a==null?void 0:a[d];if(p===null)return null;const h=Xn(p)||Xn(u);return n[d][h]}),s=r&&Object.entries(r).reduce((d,p)=>{let[u,h]=p;return h===void 0||(d[u]=h),d},{}),l=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((d,p)=>{let{class:u,className:h,...b}=p;return Object.entries(b).every(m=>{let[k,A]=m;return Array.isArray(A)?A.includes({...a,...s}[k]):{...a,...s}[k]===A})?[...d,u,h]:d},[]);return Zn(e,o,l,r==null?void 0:r.class,r==null?void 0:r.className)};var Qe,G,ci,Qn,Ct=0,ea=[],vr=[],ta=F.__b,ra=F.__r,ia=F.diffed,na=F.__c,aa=F.unmount;function $t(e,t){F.__h&&F.__h(G,e,Ct||t),Ct=0;var r=G.__H||(G.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:vr}),r.__[e]}function Ne(e){return Ct=1,oa(ca,e)}function oa(e,t,r){var i=$t(Qe++,2);if(i.t=e,!i.__c&&(i.__=[r?r(t):ca(void 0,t),function(s){var l=i.__N?i.__N[0]:i.__[0],d=i.t(l,s);l!==d&&(i.__N=[d,i.__[1]],i.__c.setState({}))}],i.__c=G,!G.u)){var n=function(s,l,d){if(!i.__c.__H)return!0;var p=i.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!a||a.call(this,s,l,d);var u=!1;return p.forEach(function(h){if(h.__N){var b=h.__[0];h.__=h.__N,h.__N=void 0,b!==h.__[0]&&(u=!0)}}),!(!u&&i.__c.props===s)&&(!a||a.call(this,s,l,d))};G.u=!0;var a=G.shouldComponentUpdate,o=G.componentWillUpdate;G.componentWillUpdate=function(s,l,d){if(this.__e){var p=a;a=void 0,n(s,l,d),a=p}o&&o.call(this,s,l,d)},G.shouldComponentUpdate=n}return i.__N||i.__}function wr(e,t){var r=$t(Qe++,3);!F.__s&&di(r.__H,t)&&(r.__=e,r.i=t,G.__H.__h.push(r))}function we(e,t){var r=$t(Qe++,4);!F.__s&&di(r.__H,t)&&(r.__=e,r.i=t,G.__h.push(r))}function me(e){return Ct=5,et(function(){return{current:e}},[])}function wl(e,t,r){Ct=6,we(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function et(e,t){var r=$t(Qe++,7);return di(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function ml(e,t){return Ct=8,et(function(){return e},t)}function sa(e){var t=G.context[e.__c],r=$t(Qe++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(G)),t.props.value):e.__}function yl(e,t){F.useDebugValue&&F.useDebugValue(t?t(e):e)}function _l(){var e=$t(Qe++,11);if(!e.__){for(var t=G.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function xl(){for(var e;e=ea.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(mr),e.__H.__h.forEach(ui),e.__H.__h=[]}catch(t){e.__H.__h=[],F.__e(t,e.__v)}}F.__b=function(e){G=null,ta&&ta(e)},F.__r=function(e){ra&&ra(e),Qe=0;var t=(G=e.__c).__H;t&&(ci===G?(t.__h=[],G.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=vr,r.__N=r.i=void 0})):(t.__h.forEach(mr),t.__h.forEach(ui),t.__h=[],Qe=0)),ci=G},F.diffed=function(e){ia&&ia(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ea.push(t)!==1&&Qn===F.requestAnimationFrame||((Qn=F.requestAnimationFrame)||kl)(xl)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==vr&&(r.__=r.__V),r.i=void 0,r.__V=vr})),ci=G=null},F.__c=function(e,t){t.some(function(r){try{r.__h.forEach(mr),r.__h=r.__h.filter(function(i){return!i.__||ui(i)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],F.__e(i,r.__v)}}),na&&na(e,t)},F.unmount=function(e){aa&&aa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(i){try{mr(i)}catch(n){t=n}}),r.__H=void 0,t&&F.__e(t,r.__v))};var la=typeof requestAnimationFrame=="function";function kl(e){var t,r=function(){clearTimeout(i),la&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,100);la&&(t=requestAnimationFrame(r))}function mr(e){var t=G,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),G=t}function ui(e){var t=G;e.__c=e.__(),G=t}function di(e,t){return!e||e.length!==t.length||t.some(function(r,i){return r!==e[i]})}function ca(e,t){return typeof t=="function"?t(e):t}function ua(e,t){for(var r in t)e[r]=t[r];return e}function fi(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var i in t)if(i!=="__source"&&e[i]!==t[i])return!0;return!1}function pi(e,t){return e===t&&(e!==0||1/e==1/t)||e!=e&&t!=t}function hi(e){this.props=e}function Sl(e,t){function r(n){var a=this.props.ref,o=a==n.ref;return!o&&a&&(a.call?a(null):a.current=null),t?!t(this.props,n)||!o:fi(this.props,n)}function i(n){return this.shouldComponentUpdate=r,xe(e,n)}return i.displayName="Memo("+(e.displayName||e.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i}(hi.prototype=new Ae).isPureReactComponent=!0,hi.prototype.shouldComponentUpdate=function(e,t){return fi(this.props,e)||fi(this.state,t)};var da=F.__b;F.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),da&&da(e)};var Cl=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function gi(e){function t(r){var i=ua({},r);return delete i.ref,e(i,r.ref||null)}return t.$$typeof=Cl,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var fa=function(e,t){return e==null?null:He(He(e).map(t))},$l={map:fa,forEach:fa,count:function(e){return e?He(e).length:0},only:function(e){var t=He(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:He},El=F.__e;F.__e=function(e,t,r,i){if(e.then){for(var n,a=t;a=a.__;)if((n=a.__c)&&n.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),n.__c(e,t)}El(e,t,r,i)};var pa=F.unmount;function ha(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(i){typeof i.__c=="function"&&i.__c()}),e.__c.__H=null),(e=ua({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(i){return ha(i,t,r)})),e}function ga(e,t,r){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(i){return ga(i,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=r)),e}function Rt(){this.__u=0,this.t=null,this.__b=null}function ba(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function va(e){var t,r,i;function n(a){if(t||(t=e()).then(function(o){r=o.default||o},function(o){i=o}),i)throw i;if(!r)throw t;return xe(r,a)}return n.displayName="Lazy",n.__f=!0,n}function zt(){this.u=null,this.o=null}F.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&e.__h===!0&&(e.type=null),pa&&pa(e)},(Rt.prototype=new Ae).__c=function(e,t){var r=t.__c,i=this;i.t==null&&(i.t=[]),i.t.push(r);var n=ba(i.__v),a=!1,o=function(){a||(a=!0,r.__R=null,n?n(s):s())};r.__R=o;var s=function(){if(!--i.__u){if(i.state.__a){var d=i.state.__a;i.__v.__k[0]=ga(d,d.__c.__P,d.__c.__O)}var p;for(i.setState({__a:i.__b=null});p=i.t.pop();)p.forceUpdate()}},l=t.__h===!0;i.__u++||l||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(o,o)},Rt.prototype.componentWillUnmount=function(){this.t=[]},Rt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=ha(this.__b,r,i.__O=i.__P)}this.__b=null}var n=t.__a&&xe(ee,null,e.fallback);return n&&(n.__h=null),[xe(ee,null,t.__a?null:e.children),n]};var wa=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.u=r=r[2]}};function Il(e){return this.getChildContext=function(){return e.context},e.children}function Al(e){var t=this,r=e.i;t.componentWillUnmount=function(){ht(null,t.l),t.l=null,t.i=null},t.i&&t.i!==r&&t.componentWillUnmount(),e.__v?(t.l||(t.i=r,t.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function(i){this.childNodes.push(i),t.i.appendChild(i)},insertBefore:function(i,n){this.childNodes.push(i),t.i.appendChild(i)},removeChild:function(i){this.childNodes.splice(this.childNodes.indexOf(i)>>>1,1),t.i.removeChild(i)}}),ht(xe(Il,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function Nl(e,t){var r=xe(Al,{__v:e,i:t});return r.containerInfo=t,r}(zt.prototype=new Ae).__a=function(e){var t=this,r=ba(t.__v),i=t.o.get(e);return i[0]++,function(n){var a=function(){t.props.revealOrder?(i.push(n),wa(t,e,i)):n()};r?r(a):a()}},zt.prototype.render=function(e){this.u=null,this.o=new Map;var t=He(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},zt.prototype.componentDidUpdate=zt.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){wa(e,r,t)})};var ma=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Fl=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Tl=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Dl=/[A-Z0-9]/g,Ml=typeof document<"u",Vl=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Pl(e,t,r){return t.__k==null&&(t.textContent=""),ht(e,t),typeof r=="function"&&r(),e?e.__c:null}function Ol(e,t,r){return Gn(e,t),typeof r=="function"&&r(),e?e.__c:null}Ae.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ae.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var ya=F.event;function Ll(){}function jl(){return this.cancelBubble}function Bl(){return this.defaultPrevented}F.event=function(e){return ya&&(e=ya(e)),e.persist=Ll,e.isPropagationStopped=jl,e.isDefaultPrevented=Bl,e.nativeEvent=e};var bi,Rl={enumerable:!1,configurable:!0,get:function(){return this.class}},_a=F.vnode;F.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,i=t.type,n={};for(var a in r){var o=r[a];if(!(a==="value"&&"defaultValue"in r&&o==null||Ml&&a==="children"&&i==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&o===!0?o="":s==="ondoubleclick"?a="ondblclick":s!=="onchange"||i!=="input"&&i!=="textarea"||Vl(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":Tl.test(a)?a=s:i.indexOf("-")===-1&&Fl.test(a)?a=a.replace(Dl,"-$&").toLowerCase():o===null&&(o=void 0):s=a="oninput",s==="oninput"&&n[a=s]&&(a="oninputCapture"),n[a]=o}}i=="select"&&n.multiple&&Array.isArray(n.value)&&(n.value=He(r.children).forEach(function(l){l.props.selected=n.value.indexOf(l.props.value)!=-1})),i=="select"&&n.defaultValue!=null&&(n.value=He(r.children).forEach(function(l){l.props.selected=n.multiple?n.defaultValue.indexOf(l.props.value)!=-1:n.defaultValue==l.props.value})),r.class&&!r.className?(n.class=r.class,Object.defineProperty(n,"className",Rl)):(r.className&&!r.class||r.class&&r.className)&&(n.class=n.className=r.className),t.props=n}(e),e.$$typeof=ma,_a&&_a(e)};var xa=F.__r;F.__r=function(e){xa&&xa(e),bi=e.__c};var ka=F.diffed;F.diffed=function(e){ka&&ka(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),bi=null};var zl={ReactCurrentDispatcher:{current:{readContext:function(e){return bi.__n[e.__c].props.value}}}};function Ul(e){return xe.bind(null,e)}function Sa(e){return!!e&&e.$$typeof===ma}function ql(e){return Sa(e)?vl.apply(null,arguments):e}function Hl(e){return!!e.__k&&(ht(null,e),!0)}function Wl(e){return e&&(e.base||e.nodeType===1&&e)||null}var Kl=function(e,t){return e(t)},Gl=function(e,t){return e(t)},Yl=ee;function Ca(e){e()}function Jl(e){return e}function Xl(){return[!1,Ca]}var Zl=we;function Ql(e,t){var r=t(),i=Ne({h:{__:r,v:t}}),n=i[0].h,a=i[1];return we(function(){n.__=r,n.v=t,pi(n.__,t())||a({h:n})},[e,r,t]),wr(function(){return pi(n.__,n.v())||a({h:n}),e(function(){pi(n.__,n.v())||a({h:n})})},[e]),r}var pe={useState:Ne,useId:_l,useReducer:oa,useEffect:wr,useLayoutEffect:we,useInsertionEffect:Zl,useTransition:Xl,useDeferredValue:Jl,useSyncExternalStore:Ql,startTransition:Ca,useRef:me,useImperativeHandle:wl,useMemo:et,useCallback:ml,useContext:sa,useDebugValue:yl,version:"17.0.2",Children:$l,render:Pl,hydrate:Ol,unmountComponentAtNode:Hl,createPortal:Nl,createElement:xe,createContext:Yn,createFactory:Ul,cloneElement:ql,createRef:fl,Fragment:ee,isValidElement:Sa,findDOMNode:Wl,Component:Ae,PureComponent:hi,memo:Sl,forwardRef:gi,flushSync:Gl,unstable_batchedUpdates:Kl,StrictMode:Yl,Suspense:Rt,SuspenseList:zt,lazy:va,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zl};const he=Symbol.for("@ts-pattern/matcher"),$a=Symbol.for("@ts-pattern/isVariadic"),yr="@ts-pattern/anonymous-select-key",vi=e=>!!(e&&typeof e=="object"),_r=e=>e&&!!e[he],te=(e,t,r)=>{if(_r(e)){const i=e[he](),{matched:n,selections:a}=i.match(t);return n&&a&&Object.keys(a).forEach(o=>r(o,a[o])),n}if(vi(e)){if(!vi(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let i=[],n=[],a=[];for(const o of e.keys()){const s=e[o];_r(s)&&s[$a]?a.push(s):a.length?n.push(s):i.push(s)}if(a.length){if(a.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<i.length+n.length)return!1;const o=t.slice(0,i.length),s=n.length===0?[]:t.slice(-n.length),l=t.slice(i.length,n.length===0?1/0:-n.length);return i.every((d,p)=>te(d,o[p],r))&&n.every((d,p)=>te(d,s[p],r))&&(a.length===0||te(a[0],l,r))}return e.length===t.length&&e.every((o,s)=>te(o,t[s],r))}return Reflect.ownKeys(e).every(i=>{const n=e[i];return(i in t||_r(a=n)&&a[he]().matcherType==="optional")&&te(n,t[i],r);var a})}return Object.is(t,e)},ge=e=>{var t,r,i;return vi(e)?_r(e)?(t=(r=(i=e[he]()).getSelectionKeys)==null?void 0:r.call(i))!=null?t:[]:Array.isArray(e)?Ut(e,ge):Ut(Object.values(e),ge):[]},Ut=(e,t)=>e.reduce((r,i)=>r.concat(t(i)),[]);function ec(...e){if(e.length===1){const[t]=e;return r=>te(t,r,()=>{})}if(e.length===2){const[t,r]=e;return te(t,r,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function ne(e){return Object.assign(e,{optional:()=>mi(e),and:t=>Y(e,t),or:t=>Ea(e,t),select:t=>t===void 0?qt(e):qt(t,e)})}function wi(e){return Object.assign((t=>Object.assign(t,{[Symbol.iterator](){let r=0;const i=[{value:Object.assign(t,{[$a]:!0}),done:!1},{done:!0,value:void 0}];return{next:()=>{var n;return(n=i[r++])!=null?n:i.at(-1)}}}}))(e),{optional:()=>wi(mi(e)),select:t=>wi(t===void 0?qt(e):qt(t,e))})}function mi(e){return ne({[he]:()=>({match:t=>{let r={};const i=(n,a)=>{r[n]=a};return t===void 0?(ge(e).forEach(n=>i(n,void 0)),{matched:!0,selections:r}):{matched:te(e,t,i),selections:r}},getSelectionKeys:()=>ge(e),matcherType:"optional"})})}const tc=(e,t)=>{for(const r of e)if(!t(r))return!1;return!0},rc=(e,t)=>{for(const[r,i]of e.entries())if(!t(i,r))return!1;return!0},ic=(e,t)=>{const r=Reflect.ownKeys(e);for(const i of r)if(!t(i,e[i]))return!1;return!0};function Y(...e){return ne({[he]:()=>({match:t=>{let r={};const i=(n,a)=>{r[n]=a};return{matched:e.every(n=>te(n,t,i)),selections:r}},getSelectionKeys:()=>Ut(e,ge),matcherType:"and"})})}function Ea(...e){return ne({[he]:()=>({match:t=>{let r={};const i=(n,a)=>{r[n]=a};return Ut(e,ge).forEach(n=>i(n,void 0)),{matched:e.some(n=>te(n,t,i)),selections:r}},getSelectionKeys:()=>Ut(e,ge),matcherType:"or"})})}function j(e){return{[he]:()=>({match:t=>({matched:!!e(t)})})}}function qt(...e){const t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return ne({[he]:()=>({match:i=>{let n={[t??yr]:i};return{matched:r===void 0||te(r,i,(a,o)=>{n[a]=o}),selections:n}},getSelectionKeys:()=>[t??yr].concat(r===void 0?[]:ge(r))})})}function Ia(e){return!0}function Ve(e){return typeof e=="number"}function tt(e){return typeof e=="string"}function rt(e){return typeof e=="bigint"}const Aa=ne(j(Ia)),nc=ne(j(Ia)),ac=Aa,it=e=>Object.assign(ne(e),{startsWith:t=>{return it(Y(e,(r=t,j(i=>tt(i)&&i.startsWith(r)))));var r},endsWith:t=>{return it(Y(e,(r=t,j(i=>tt(i)&&i.endsWith(r)))));var r},minLength:t=>it(Y(e,(r=>j(i=>tt(i)&&i.length>=r))(t))),length:t=>it(Y(e,(r=>j(i=>tt(i)&&i.length===r))(t))),maxLength:t=>it(Y(e,(r=>j(i=>tt(i)&&i.length<=r))(t))),includes:t=>{return it(Y(e,(r=t,j(i=>tt(i)&&i.includes(r)))));var r},regex:t=>{return it(Y(e,(r=t,j(i=>tt(i)&&!!i.match(r)))));var r}}),Na=it(j(tt)),Pe=e=>Object.assign(ne(e),{between:(t,r)=>Pe(Y(e,((i,n)=>j(a=>Ve(a)&&i<=a&&n>=a))(t,r))),lt:t=>Pe(Y(e,(r=>j(i=>Ve(i)&&i<r))(t))),gt:t=>Pe(Y(e,(r=>j(i=>Ve(i)&&i>r))(t))),lte:t=>Pe(Y(e,(r=>j(i=>Ve(i)&&i<=r))(t))),gte:t=>Pe(Y(e,(r=>j(i=>Ve(i)&&i>=r))(t))),int:()=>Pe(Y(e,j(t=>Ve(t)&&Number.isInteger(t)))),finite:()=>Pe(Y(e,j(t=>Ve(t)&&Number.isFinite(t)))),positive:()=>Pe(Y(e,j(t=>Ve(t)&&t>0))),negative:()=>Pe(Y(e,j(t=>Ve(t)&&t<0)))}),oc=Pe(j(Ve)),nt=e=>Object.assign(ne(e),{between:(t,r)=>nt(Y(e,((i,n)=>j(a=>rt(a)&&i<=a&&n>=a))(t,r))),lt:t=>nt(Y(e,(r=>j(i=>rt(i)&&i<r))(t))),gt:t=>nt(Y(e,(r=>j(i=>rt(i)&&i>r))(t))),lte:t=>nt(Y(e,(r=>j(i=>rt(i)&&i<=r))(t))),gte:t=>nt(Y(e,(r=>j(i=>rt(i)&&i>=r))(t))),positive:()=>nt(Y(e,j(t=>rt(t)&&t>0))),negative:()=>nt(Y(e,j(t=>rt(t)&&t<0)))}),sc=nt(j(rt)),lc=ne(j(function(e){return typeof e=="boolean"})),cc=ne(j(function(e){return typeof e=="symbol"})),uc=ne(j(function(e){return e==null})),dc=ne(j(function(e){return e!=null}));var Ht={__proto__:null,matcher:he,optional:mi,array:function(...e){return wi({[he]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const r=e[0];let i={};if(t.length===0)return ge(r).forEach(a=>{i[a]=[]}),{matched:!0,selections:i};const n=(a,o)=>{i[a]=(i[a]||[]).concat([o])};return{matched:t.every(a=>te(r,a,n)),selections:i}},getSelectionKeys:()=>e.length===0?[]:ge(e[0])})})},set:function(...e){return ne({[he]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};if(e.length===0)return{matched:!0};const i=(a,o)=>{r[a]=(r[a]||[]).concat([o])},n=e[0];return{matched:tc(t,a=>te(n,a,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:ge(e[0])})})},map:function(...e){return ne({[he]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let r={};if(t.size===0)return{matched:!0,selections:r};const i=(s,l)=>{r[s]=(r[s]||[]).concat([l])};if(e.length===0)return{matched:!0};var n;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(n=e[0])==null?void 0:n.toString()}`);const[a,o]=e;return{matched:rc(t,(s,l)=>{const d=te(a,l,i),p=te(o,s,i);return d&&p}),selections:r}},getSelectionKeys:()=>e.length===0?[]:[...ge(e[0]),...ge(e[1])]})})},record:function(...e){return ne({[he]:()=>({match:t=>{if(t===null||typeof t!="object"||Array.isArray(t))return{matched:!1};var r;if(e.length===0)throw new Error(`\`P.record\` wasn't given enough arguments. Expected (value) or (key, value), received ${(r=e[0])==null?void 0:r.toString()}`);let i={};const n=(s,l)=>{i[s]=(i[s]||[]).concat([l])},[a,o]=e.length===1?[Na,e[0]]:e;return{matched:ic(t,(s,l)=>{const d=typeof s!="string"||Number.isNaN(Number(s))?null:Number(s),p=d!==null&&te(a,d,n),u=te(a,s,n),h=te(o,l,n);return(u||p)&&h}),selections:i}},getSelectionKeys:()=>e.length===0?[]:[...ge(e[0]),...ge(e[1])]})})},intersection:Y,union:Ea,not:function(e){return ne({[he]:()=>({match:t=>({matched:!te(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:j,select:qt,any:Aa,unknown:nc,_:ac,string:Na,number:oc,bigint:sc,boolean:lc,symbol:cc,nullish:uc,nonNullable:dc,instanceOf:function(e){return ne(j(function(t){return r=>r instanceof t}(e)))},shape:function(e){return ne(j(ec(e)))}};class fc extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}}const yi={matched:!1,value:void 0};function xr(e){return new kr(e,yi)}class kr{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;const r=t[t.length-1],i=[t[0]];let n;t.length===3&&typeof t[1]=="function"?n=t[1]:t.length>2&&i.push(...t.slice(1,t.length-1));let a=!1,o={};const s=(d,p)=>{a=!0,o[d]=p},l=!i.some(d=>te(d,this.input,s))||n&&!n(this.input)?yi:{matched:!0,value:r(a?yr in o?o[yr]:o:this.input,this.input)};return new kr(this.input,l)}when(t,r){if(this.state.matched)return this;const i=!!t(this.input);return new kr(this.input,i?{matched:!0,value:r(this.input,this.input)}:yi)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(t=pc){return this.state.matched?this.state.value:t(this.input)}run(){return this.exhaustive()}returnType(){return this}narrow(){return this}}function pc(e){throw new fc(e)}var hc=["other","few","many","two","one","zero"],Fa=({terms:e,overrides:t,locale:r})=>{const i=new Intl.PluralRules(r);function n(a,o){const s=(t==null?void 0:t[a])??e[a];switch(typeof s){case"string":return s.replace(/{{(\w+)}}/g,(l,d)=>{var p;return((p=o==null?void 0:o[d])==null?void 0:p.toString())??""});case"object":{if(typeof(o==null?void 0:o.count)!="number")throw new Error(`Missing count for translation key “${a.toString()}”`);let l=i.select(o.count);if(!(l in s)){const d=hc.find(p=>p in s);if(!d)throw new Error(`Missing plural rule for translation key “${a.toString()}”`);l=d}return s[l].replace(/{{(\w+)}}/g,(d,p)=>{var u;return((u=o==null?void 0:o[p])==null?void 0:u.toString())??""})}default:throw new Error(`Invalid translation value in dictionary for key “${a.toString()}”.`)}}return n},gc=0;function c(e,t,r,i,n,a){var o,s,l={};for(s in t)s=="ref"?o=t[s]:l[s]=t[s];var d={type:e,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--gc,__source:n,__self:a};if(typeof e=="function"&&(o=e.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return F.vnode&&F.vnode(d),d}var Ta=Yn(null),Da=e=>({defaultTerms:e,TranslationProvider:({terms:t,children:r,locale:i})=>{const n=et(()=>Fa({locale:i,terms:e,overrides:t}),[t,i]);return c(Ta.Provider,{value:{t:n,locale:i},children:r})},useTranslation:()=>{const t=sa(Ta);if(t===null)throw new Error("Please wrap useTranslation in a TranslationProvider");return{t:t.t,locale:t.locale}},createTFunction:({overrides:t,locale:r})=>Fa({terms:e,overrides:t,locale:r})}),{TranslationProvider:Rf,useTranslation:zf,createTFunction:Uf,defaultTerms:bc}=Da({submission_redirect_message:"Almost there! Please complete your submission here:",complete_submission:"Complete submission",submission_completed:"Submission completed!",submission_failed:"Failed to submit",close_application:"Close application",invalid_state:"Invalid application state",redirect_url_error:"Couldn’t get the redirect URL.",upload_file:{one:"Select file to upload",other:"Select files to upload"},file_max_size:"max {{size}}",file_extensions:"Accepted file extensions",address_error:"Something went wrong! Plase continue manually",address_search:"Type and search for places…",address_manual:"Fill in manually",back:"Back",search:"Search",unknown_error:"An error occurred",line1:"Line 1",line2:"Line 2",line3:"Line 3",city:"City",state:"State",postcode:"Postcode",country:"Country",select_country:"Select a country",validation_empty:"Please enter a value",validation_date:"Please enter a valid date (YYYY-MM-DD)",validation_email:"That doesn’t look like a valid email address",validation_url:"That doesn’t look like a valid URL",validation_max_chars:"Please enter no more than {{count}} characters",validation_min_chars:"Please enter {{count}} or more characters",validation_phone:"Please enter a valid phone number",validation_phone_min_chars:"Your phone number must be at least {{count}} digits long",validation_country_code:"Please select a country code",validation_number:"Please enter a valid number",validation_number_min:"Please enter a number greater than or equal to {{min}}",validation_number_max:"Please enter a number less than or equal to {{max}}",validation_number_decimal_cases:"Please enter a number with at most {{count}} decimal cases",validation_file:"Please select a file",validation_file_ext:"Please only upload {{ext}} files",validation_file_min:{one:"Please upload at least one file",other:"Please only upload at least {{count}} files"},validation_file_max:{one:"Please only upload one file",other:"Please only upload up to {{count}} files"},validation_file_size:"Your file is too big. Please upload a file smaller than {{size}}",validation_required:"This field is required.",validation_multiple_choice_min:{one:"Please select at least {{count}} option",other:"Please select at least {{count}} options"},validation_multiple_choice_max:{one:"Please select at most {{count}} option",other:"Please select at most {{count}} options"},optional:"optional"});const{TranslationProvider:vc,useTranslation:se,createTFunction:wc}=Da({...bc,error_heading:"Something unexpected happened",undo:"Change answer",conversation_history:"Conversation history",jump_to_current:"Jump to current question",send:"Send",submitting:"Sending your application…",skip:"Skip",skipped:"Skipped",submission_closed:"This role is no longer accepting applications.",submission_duplicate:"You've already applied for this role, so we haven't submitted a second application. If that doesn't sound right, check your email for a confirmation or try again in a few minutes.",submission_duplicate_earlier_attempt:"It looks like your earlier attempt did go through. You don't need to apply again — check your email for confirmation.",submission_retryable:"We couldn't submit your application. Please try again.",submission_failed:"We couldn't submit your application. Choose Restart to try again.",submission_unknown:"We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.",submission_unreadable_document:"We couldn't read that file. Please upload a different one.",submission_cooldown:{one:"Submit will be available again in {{count}} second.",other:"Submit will be available again in {{count}} seconds."},submission_cooldown_ready:"Submit is available again.",submission_still_working:"Still working — the employer's application system is taking a little longer than usual. Please keep this window open.",file_preparing:{one:"Preparing your file…",other:"Preparing your files…"},file_ready:{one:"Your file is ready to send",other:"Your files are ready to send"},file_read_error:"We couldn't read this file. Select it again or choose another file.",file_read_error_replacement:"We couldn't read this file, so your previous file is no longer selected. Select it again or choose another file.",address_error:"We couldn't search for that address. Try again, or fill it in manually.",address_searching:"Searching addresses…",address_no_results:"We couldn't find that address. Check the spelling or postcode, or fill it in manually.",maximize:"Maximise",minimize:"Minimise"}),qf="";function Ke(e,t){if(!e)throw new Error(t)}var _i=e=>e===null||typeof e!="object"?e:Array.isArray(e)?e.map(_i):Object.keys(e).sort().reduce((t,r)=>(t[r]=_i(e[r]),t),{}),mc=e=>{let t=JSON.stringify(_i(e)),r=5381;for(let i=0;i<t.length;i++)r=r*33^t.charCodeAt(i);return(r>>>0).toString(36)},yc=Symbol.for("preact-signals");function xi(){if(Et>1)Et--;else{for(var e,t=!1;Wt!==void 0;){var r=Wt;for(Wt=void 0,ki++;r!==void 0;){var i=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Va(r))try{r.c()}catch(n){t||(e=n,t=!0)}r=i}}if(ki=0,Et--,t)throw e}}var H=void 0,Wt=void 0,Et=0,ki=0,Sr=0;function Ma(e){if(H!==void 0){var t=e.n;if(t===void 0||t.t!==H)return t={i:0,S:e,p:H.s,n:void 0,t:H,e:void 0,x:void 0,r:t},H.s!==void 0&&(H.s.n=t),H.s=t,e.n=t,32&H.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=H.s,t.n=void 0,H.s.n=t,H.s=t),t}}function le(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}le.prototype.brand=yc,le.prototype.h=function(){return!0},le.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)},le.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}},le.prototype.subscribe=function(e){var t=this;return Ci(function(){var r=t.value,i=H;H=void 0;try{e(r)}finally{H=i}})},le.prototype.valueOf=function(){return this.value},le.prototype.toString=function(){return this.value+""},le.prototype.toJSON=function(){return this.value},le.prototype.peek=function(){var e=H;H=void 0;try{return this.value}finally{H=e}},Object.defineProperty(le.prototype,"value",{get:function(){var e=Ma(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ki>100)throw new Error("Cycle detected");this.v=e,this.i++,Sr++,Et++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{xi()}}}});function Ge(e){return new le(e)}function Va(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Pa(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Oa(e){for(var t=e.s,r=void 0;t!==void 0;){var i=t.p;t.i===-1?(t.S.U(t),i!==void 0&&(i.n=t.n),t.n!==void 0&&(t.n.p=i)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=i}e.s=r}function It(e){le.call(this,void 0),this.x=e,this.s=void 0,this.g=Sr-1,this.f=4}(It.prototype=new le).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Sr))return!0;if(this.g=Sr,this.f|=1,this.i>0&&!Va(this))return this.f&=-2,!0;var e=H;try{Pa(this),H=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return H=e,Oa(this),this.f&=-2,!0},It.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}le.prototype.S.call(this,e)},It.prototype.U=function(e){if(this.t!==void 0&&(le.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},It.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(It.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ma(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function _c(e){return new It(e)}function La(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Et++;var r=H;H=void 0;try{t()}catch(i){throw e.f&=-2,e.f|=8,Si(e),i}finally{H=r,xi()}}}function Si(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,La(e)}function xc(e){if(H!==this)throw new Error("Out-of-order effect");Oa(this),H=e,this.f&=-2,8&this.f&&Si(this),xi()}function Kt(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Kt.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},Kt.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,La(this),Pa(this),Et++;var e=H;return H=this,xc.bind(this,e)},Kt.prototype.N=function(){2&this.f||(this.f|=2,this.o=Wt,Wt=this)},Kt.prototype.d=function(){this.f|=8,1&this.f||Si(this)};function Ci(e){var t=new Kt(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var $i;function At(e,t){F[e]=t.bind(null,F[e]||function(){})}function Cr(e){$i&&$i(),$i=e&&e.S()}function ja(e){var t=this,r=e.data,i=Sc(r);i.value=r;var n=et(function(){for(var a=t.__v;a=a.__;)if(a.__c){a.__c.__$f|=4;break}return t.__$u.c=function(){var o;!Dn(n.peek())&&((o=t.base)==null?void 0:o.nodeType)===3?t.base.data=n.peek():(t.__$f|=1,t.setState({}))},_c(function(){var o=i.value.value;return o===0?0:o===!0?"":o||""})},[]);return n.value}ja.displayName="_st",Object.defineProperties(le.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ja},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),At("__b",function(e,t){if(typeof t.type=="string"){var r,i=t.props;for(var n in i)if(n!=="children"){var a=i[n];a instanceof le&&(r||(t.__np=r={}),r[n]=a,i[n]=a.peek())}}e(t)}),At("__r",function(e,t){Cr();var r,i=t.__c;i&&(i.__$f&=-2,(r=i.__$u)===void 0&&(i.__$u=r=function(n){var a;return Ci(function(){a=this}),a.c=function(){i.__$f|=1,i.setState({})},a}())),Cr(r),e(t)}),At("__e",function(e,t,r,i){Cr(),e(t,r,i)}),At("diffed",function(e,t){Cr();var r;if(typeof t.type=="string"&&(r=t.__e)){var i=t.__np,n=t.props;if(i){var a=r.U;if(a)for(var o in a){var s=a[o];s!==void 0&&!(o in i)&&(s.d(),a[o]=void 0)}else r.U=a={};for(var l in i){var d=a[l],p=i[l];d===void 0?(d=kc(r,l,p,n),a[l]=d):d.o(p,n)}}}e(t)});function kc(e,t,r,i){var n=t in e&&e.ownerSVGElement===void 0,a=Ge(r);return{o:function(o,s){a.value=o,i=s},d:Ci(function(){var o=a.value.value;i[t]!==o&&(i[t]=o,n?e[t]=o:o?e.setAttribute(t,o):e.removeAttribute(t))})}}At("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var i=r.U;if(i){r.U=void 0;for(var n in i){var a=i[n];a&&a.d()}}}}else{var o=t.__c;if(o){var s=o.__$u;s&&(o.__$u=void 0,s.d())}}e(t)}),At("__h",function(e,t,r,i){(i<3||i===9)&&(t.__$f|=2),e(t,r,i)}),Ae.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var i in t)return!0;for(var n in e)if(n!=="__source"&&e[n]!==this.props[n])return!0;for(var a in this.props)if(!(a in e))return!0;return!1};function Sc(e){return et(function(){return Ge(e)},[])}const Ei=(e,t)=>t.some(r=>e instanceof r);let Ba,Ra;function Cc(){return Ba||(Ba=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function $c(){return Ra||(Ra=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Ii=new WeakMap,Ai=new WeakMap,$r=new WeakMap;function Ec(e){const t=new Promise((r,i)=>{const n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{r(bt(e.result)),n()},o=()=>{i(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",o)});return $r.set(t,e),t}function Ic(e){if(Ii.has(e))return;const t=new Promise((r,i)=>{const n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{r(),n()},o=()=>{i(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});Ii.set(e,t)}let Ni={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return Ii.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return bt(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function za(e){Ni=e(Ni)}function Ac(e){return $c().includes(e)?function(...t){return e.apply(Fi(this),t),bt(this.request)}:function(...t){return bt(e.apply(Fi(this),t))}}function Nc(e){return typeof e=="function"?Ac(e):(e instanceof IDBTransaction&&Ic(e),Ei(e,Cc())?new Proxy(e,Ni):e)}function bt(e){if(e instanceof IDBRequest)return Ec(e);if(Ai.has(e))return Ai.get(e);const t=Nc(e);return t!==e&&(Ai.set(e,t),$r.set(t,e)),t}const Fi=e=>$r.get(e);function Fc(e,t,{blocked:r,upgrade:i,blocking:n,terminated:a}={}){const o=indexedDB.open(e,t),s=bt(o);return i&&o.addEventListener("upgradeneeded",l=>{i(bt(o.result),l.oldVersion,l.newVersion,bt(o.transaction),l)}),r&&o.addEventListener("blocked",l=>r(l.oldVersion,l.newVersion,l)),s.then(l=>{a&&l.addEventListener("close",()=>a()),n&&l.addEventListener("versionchange",d=>n(d.oldVersion,d.newVersion,d))}).catch(()=>{}),s}const Tc=["get","getKey","getAll","getAllKeys","count"],Dc=["put","add","delete","clear"],Ti=new Map;function Ua(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Ti.get(t))return Ti.get(t);const r=t.replace(/FromIndex$/,""),i=t!==r,n=Dc.includes(r);if(!(r in(i?IDBIndex:IDBObjectStore).prototype)||!(n||Tc.includes(r)))return;const a=async function(o,...s){const l=this.transaction(o,n?"readwrite":"readonly");let d=l.store;return i&&(d=d.index(s.shift())),(await Promise.all([d[r](...s),n&&l.done]))[0]};return Ti.set(t,a),a}za(e=>({...e,get:(t,r,i)=>Ua(t,r)||e.get(t,r,i),has:(t,r)=>!!Ua(t,r)||e.has(t,r)}));const Mc=["continue","continuePrimaryKey","advance"],qa={},Di=new WeakMap,Ha=new WeakMap,Vc={get(e,t){if(!Mc.includes(t))return e[t];let r=qa[t];return r||(r=qa[t]=function(...i){Di.set(this,Ha.get(this)[t](...i))}),r}};async function*Pc(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;const r=new Proxy(t,Vc);for(Ha.set(r,t),$r.set(r,Fi(t));t;)yield r,t=await(Di.get(r)||t.continue()),Di.delete(r)}function Wa(e,t){return t===Symbol.asyncIterator&&Ei(e,[IDBIndex,IDBObjectStore,IDBCursor])||t==="iterate"&&Ei(e,[IDBIndex,IDBObjectStore])}za(e=>({...e,get(t,r,i){return Wa(t,r)?Pc:e.get(t,r,i)},has(t,r){return Wa(t,r)||e.has(t,r)}}));const Er=typeof indexedDB>"u"?void 0:Fc("inploi-chatbot",3,{upgrade(e){try{e.deleteObjectStore("state")}catch{}e.createObjectStore("state")}});let Ir,Mi,Gt;const Ka=()=>{if(!Ir)return Gt;const e=Ir;Ir=void 0;const t=Ja(e),r=Er==null?void 0:Er.then(i=>i.put("state",e.data,t)).finally(()=>{Gt===r&&(Gt=void 0)});return Gt=r,Gt},Oe={getStateData:async(e,t,r)=>{var n;const i=Ja({...e,flowKeys:t,context:r});return(n=await Er)==null?void 0:n.get("state",i)},setStateData:e=>{Ir=e,clearTimeout(Mi),Mi=setTimeout(()=>void Ka(),1e3)},flushStateData:()=>(clearTimeout(Mi),Ka()??Promise.resolve())},Ga=e=>{const t=e.find(r=>r.isHead);if(!t)throw new Error("No head node found");return t},Nt=e=>t=>t?t.type===e:!1;class vt extends Error{constructor(){super("Aborted")}}const Oc=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():Math.random().toString(36).slice(2),Ya=()=>({messages:[],submissions:{},currentInput:null,nodeHistory:[],startedWriteNodeIds:[],isFinished:!1,hasInteracted:!1,sequence:0,flowSessionId:Oc()}),Lc=e=>xr(e).with({nativeEvent:{submitter:Ht.select(Ht.union(Ht.instanceOf(HTMLButtonElement),Ht.instanceOf(HTMLInputElement)))}},t=>t).otherwise(()=>{throw new Error("invalid submitter")}),Ar=(e,t,r,i=0)=>{if(!t.nextId)return r(t.id,{stepsMade:i,remainingSteps:0}),{stepsMade:i,remainingSteps:0};const n=e.find(d=>d.id===t.nextId);if(n===void 0)return{stepsMade:i,remainingSteps:0};const a=t.type==="if-block"?t.branchId:void 0,o=e.find(d=>d.id===a),s=t.type.includes("question")?1:0;if(o){const d=s+Math.max(Ar(e,n,r,i+s).remainingSteps,Ar(e,o,r,i+s).remainingSteps);return r(t.id,{stepsMade:i,remainingSteps:d}),{stepsMade:i,remainingSteps:d}}const l=s+Ar(e,n,r,i+s).remainingSteps;return r(t.id,{stepsMade:i,remainingSteps:l}),{stepsMade:i,remainingSteps:l}},jc=e=>{const t={},r=e.find(i=>i.isHead);return r&&Ar(e,r,(i,n)=>{t[i]=n}),t},Ja=e=>[...e.flowKeys,e.id,e.version,e.build,mc(e.context)].join("/"),Vi=e=>{var t,r;if(!(e.data.isFinished||(t=e.data.startedWriteNodeIds)!=null&&t.length))return(r=[...e.data.messages].reverse().find(i=>i.groupId&&e.nodes.some(n=>n.id===i.groupId&&n.type.startsWith("question-"))&&(i.type==="system"||"author"in i&&i.author==="user")))==null?void 0:r.groupId},Le=Ge({state:"idle"}),wt=e=>{const{state:t,flow:r}=Le.value;if(t!=="loaded")return;Ke(r,"No flow to update");const i=e(r.data);r.data=i,Le.value={state:t,flow:r},Oe.setStateData(r)},D={current$:Le,viewState$:Ge("closed"),prepareFlow:async({flow:e,context:t={},flowKeys:r,title:i,analytics:n,job:a,locationOrigin:o})=>(await Oe.flushStateData().catch(()=>{}),{data:await Oe.getStateData(e,r,t)??Ya(),startedAt:new Date,nodeIdToProgress:jc(e.nodes),flowKeys:r,id:e.id,version:e.version,nodes:e.nodes,build:e.build,context:t,title:i,analytics:n,job:a,locationOrigin:o}),commitFlow:e=>{Le.value={state:"loaded",flow:e},Oe.setStateData(e)},cancelCurrentFlow:()=>{Le.value={state:"idle"},D.viewState$.value="closed"},markAsFinished:()=>wt(e=>({...e,isFinished:!0})),markAsInteracted:()=>wt(e=>({...e,hasInteracted:!0})),setCurrentNodeId:e=>wt(t=>(t.nodeHistory.push(e),t)),setApplicationRecovery:async e=>{wt(t=>(e?t.applicationRecovery=e:delete t.applicationRecovery,t)),await Oe.flushStateData()},restart:()=>{const{state:e,flow:t}=Le.value;if(e!=="loaded")throw new Error("Flow cannot be restarted: not in valid state");const r={...Ya(),unconfirmedAttemptKeys:t.data.unconfirmedAttemptKeys,submitCooldown:t.data.submitCooldown},i={...t,data:r,startedAt:new Date};Le.value={state:e,flow:i},Oe.setStateData(i)},addMessage:(e,t)=>{const r={...e,groupId:t};return wt(i=>(i.messages.push(r),i))},removeMessagesSentByNodeIds:e=>{const{state:t,flow:r}=Le.value;Ke(t==="loaded","Application not loaded");const i=r.data.messages.filter(n=>!n.groupId||!e.includes(n.groupId));r.data.messages=i,Oe.setStateData(r)},setSubmission:(e,t)=>wt(r=>(t===null?delete r.submissions[e]:r.submissions[e]=t,r)),setInput:e=>wt(t=>({...t,currentInput:e??null})),persistWriteBarrier:async e=>{Le.peek().flow===e&&(Le.value={state:"loaded",flow:e}),Oe.setStateData(e),await Oe.flushStateData()}},Bc=({message:e})=>{const{t}=se();return c("div",{class:"flex flex-grow flex-col items-center justify-center",children:[c("svg",{class:"text-error-9 h-16 w-16",fill:"none",xmlns:"http://www.w3.org/2000/svg","stroke-width":"2",stroke:"currentColor","stroke-linecap":"round",viewBox:"0 0 96 96",children:[c("path",{d:"M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z",fill:"#fff"}),c("path",{d:"M48 79H19.9l-1.3-.3a3 3 0 0 1-1.3-1.3c-.1-.3-.2-.6-.2-1.3l-.1-2.5V48a31 31 0 1 1 31 31Z"}),c("line",{x1:"36.7",y1:"39.3",x2:"44.8",y2:"47.4"}),c("line",{x1:"52.2",y1:"39.3",x2:"60.3",y2:"47.4"}),c("line",{x1:"44.7",y1:"39.2",x2:"36.6",y2:"47.3"}),c("line",{x1:"60.2",y1:"39.2",x2:"52.1",y2:"47.3"}),c("path",{d:"M38 56h19"})]}),c("div",{class:"flex flex-col gap-2 text-center",children:[c("p",{class:"text-error-11 font-bold",children:t("error_heading")}),e&&c("p",{class:"text-neutral-9 text-sm",children:e})]})]})},Nr=e=>c("svg",{role:"img",viewBox:"0 0 24 24",...e,children:[c("title",{children:"Loading"}),c("style",{children:"#s1{animation:3s linear infinite forwards s1__to}@keyframes s1__to{0%{transform:translate(12px,0)}66.666667%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,12px)}}#s2{animation:3s linear infinite forwards s2__ts}@keyframes s2__ts{0%{transform:scale(0,0)}70%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%{transform:scale(1,1)}}#s3{animation:3s linear infinite forwards s3__to}@keyframes s3__to{0%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,33.333333%{transform:translate(12px,24px)}}#s4{animation:3s linear infinite forwards s4__ts}@keyframes s4__ts{0%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}100%,30%{transform:scale(0,0)}}#s5{animation:3s linear infinite forwards s5__to}@keyframes s5__to{0%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}33.333333%{transform:translate(12px,12.045742px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%,66.666667%{transform:translate(12px,24px)}}#s6{animation:3s linear infinite forwards s6__ts}@keyframes s6__ts{0%,100%,63.333333%{transform:scale(0,0)}3.333333%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}33.333333%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}#s7{animation:3s linear infinite forwards s7__to}@keyframes s7__to{0%{transform:translate(12px,0)}33.333333%{transform:translate(12px,0);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}66.666667%{transform:translate(12px,12px);animation-timing-function:cubic-bezier(0.77,0,0.175,1)}100%{transform:translate(12px,24px)}}#s8{animation:3s linear infinite forwards s8__ts}@keyframes s8__ts{0%,100%,96.666667%{transform:scale(0,0)}36.666667%{transform:scale(0,0);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}66.666667%{transform:scale(1,1);animation-timing-function:cubic-bezier(0.86,0,0.07,1)}}"}),c("g",{id:"s1",transform:"translate(12,0)",children:c("g",{id:"s2",transform:"scale(0,0)",children:c("circle",{r:"6.5",transform:"translate(0,0)",fill:"currentColor"})})}),c("g",{id:"s3",transform:"translate(12,12)",children:c("g",{id:"s4",transform:"scale(1,1)",children:c("circle",{r:"6.5",transform:"translate(0,0)",fill:"currentColor"})})}),c("g",{id:"s5",transform:"translate(12,0)",children:c("g",{id:"s6",transform:"scale(0,0)",children:c("path",{d:"M6.5,13c3.5899,0,6.5-2.9101,6.5-6.5s-2.9101-6.5-6.5-6.5-6.5,2.91015-6.5,6.5s2.91015,6.5,6.5,6.5Zm0-4C7.88071,9,9,7.88071,9,6.5s-1.11929-2.5-2.5-2.5-2.5,1.11929-2.5,2.5s1.11929,2.5,2.5,2.5Z",transform:"translate(-6.5,-6.5)","clip-rule":"evenodd",fill:"currentColor","fill-rule":"evenodd"})})}),c("g",{id:"s7",transform:"translate(12,0)",children:c("g",{id:"s8",transform:"scale(0,0)",children:c("path",{d:"M0,6c0,3.58984,2.91016,6.5,6.5,6.5s6.5-2.91016,6.5-6.5h-4C9,7.38086,7.88086,8.5,6.5,8.5s-2.5-1.11914-2.5-2.5h-4Z",transform:"translate(-6.5,-9.25)",fill:"currentColor"})})})]}),Xa=()=>c("div",{class:"flex flex-grow flex-col items-center justify-center",children:c(Nr,{class:"text-neutral-6 h-8 w-8"})}),Rc=e=>{const r=e/100,i=1.3;return e<0?"0%":e>100?"100%":`${Math.round((1-(1-.1)*Math.pow(1-r,i))*100)}%`},zc=gt("touch-hitbox fr relative flex-none rounded-full p-2 transition-all",{variants:{variant:{neutral:"text-neutral-11 hover:text-neutral-12 active:text-neutral-12 hover:bg-interactive-bg-hover active:bg-interactive-bg-active ",white:"text-white/80 hover:text-white active:text-white hover:bg-white/20 active:bg-white/30"}},defaultVariants:{variant:"neutral"}}),Yt=({class:e,children:t,variant:r,...i})=>c("button",{class:We(zc({variant:r}),e),...i,children:c("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round",xmlns:"http://www.w3.org/2000/svg",children:t})}),Za=()=>c("path",{d:"M12.5 6.5L8 11L3.5 6.5"}),Uc=()=>{if(D.current$.value.state!=="loaded")return null;const e=D.current$.value.flow.nodeIdToProgress,t=D.current$.value.flow.data.nodeHistory.at(-1);if(t===void 0)return null;const r=e[t];if(r===void 0)return null;const i=100*(r.stepsMade/(r.remainingSteps+r.stepsMade));return c("div",{class:"bg-accent-3",children:c("div",{style:{width:Rc(i)},class:"bg-accent-9 ring-accent-6 relative h-[3px] rounded-full transition-all duration-1000"})})},qc=({children:e,params:t})=>{const{t:r}=se(),i=D.viewState$;return c(ee,{children:c("header",{class:"ring-divider bg-statusbar absolute left-0 right-0 top-0 z-20 mx-auto items-center ring-1 backdrop-blur-md backdrop-saturate-150",children:[c("div",{class:"ring-neutral-7 flex h-[var(--header-height)] gap-2 rounded-t-3xl ring-0 ring-inset transition-all duration-300 [&:has(>.view-switch:focus-visible)]:ring-1",children:[c("p",{id:"chatbot-status-bar",class:"sr-only",children:e}),c("button",{onClick:()=>{i.value="minimised"},class:"view-switch h-full flex-grow overflow-hidden px-4 py-1 focus-visible:outline-none",onTouchStart:Pi,children:c("p",{"aria-hidden":!0,class:"text-neutral-12 truncate text-sm font-bold tracking-tight",children:e})}),c("div",{class:"flex flex-shrink-0 items-center gap-3 p-1.5",children:[t.feedback?c("div",{"data-widget":"inploi-feedback","data-key":"chatbot-header",class:We({hidden:D.current$.value.state!=="loaded"||i.value!=="maximised"}),children:c("div",{class:"ring-neutral-4 bg-neutral-3 h-8 w-[72px] animate-pulse rounded-full ring-1"})}):null,D.current$.value.state==="loaded"&&c(Yt,{class:"mx-1","aria-label":"Restart",onClick:()=>{D.restart()},children:[c("path",{d:"M12 8.5C12 9.29113 11.7654 10.0645 11.3259 10.7223C10.8864 11.3801 10.2616 11.8928 9.53073 12.1955C8.79983 12.4983 7.99556 12.5775 7.21964 12.4231C6.44371 12.2688 5.73098 11.8878 5.17157 11.3284C4.61216 10.769 4.2312 10.0563 4.07686 9.28036C3.92252 8.50444 4.00173 7.70017 4.30448 6.96927C4.60723 6.23836 5.11992 5.61365 5.77772 5.17412C6.43552 4.7346 7.20887 4.5 8 4.5H9"}),c("path",{d:"M8 7L10 4.5L8 2.5"})]},"restart"),c(Yt,{class:"view-switch mx-1",onTouchStart:Pi,"aria-label":r("minimize"),onClick:()=>i.value="minimised",children:c(Za,{})},"minmax")]})]}),c(Uc,{})]})})};function Pi(){}const Hc=va(()=>Promise.resolve().then(()=>Ff).then(e=>e.ChatbotBody)),Qa=gt("selection:bg-accent-4 selection:text-accent-12 fixed bottom-2 left-2 right-2 isolate mx-auto max-h-full focus:outline-none [&:has(.view-switch:active)]:scale-[0.98] transition-all duration-1000 ease-expo-out",{variants:{view:{closed:"hidden",minimised:"max-w-[min(300px,calc(100vw-4rem))] h-[var(--header-height)] animate-slide-in-bottom",maximised:"max-w-[450px] h-[var(--content-height)] animate-maximise"}}}),eo=gt("relative flex h-full overflow-hidden rounded-3xl outline outline-1",{variants:{view:{closed:"hidden",minimised:"outline-accent-10 bg-accent-9",maximised:"outline-neutral-3 bg-neutral-1 flex-col"}}}),Wc=({open:e,...t})=>{const r=me(null);return we(()=>{const i=r.current;i&&(e?i.showModal():i.close())},[e]),c("dialog",{ref:r,...t})},Kc=({logger:e,apiClient:t,analytics:r,talentBankClient:i,params:n})=>{const{state:a,flow:o,error:s}=D.current$.value,l=D.viewState$.value,d=a!=="idle"&&l==="maximised",p=me(null),u=o?[...o.data.nodeHistory].reverse().map(h=>o.nodes.find(b=>b.id===h)).find(h=>(h==null?void 0:h.type)==="flow-section"):void 0;return c(vc,{terms:n.terms,locale:void 0,children:[c(Wc,{open:d,onClose:()=>D.viewState$.value="minimised",children:c("div",{ref:p,"aria-modal":"true",role:"dialog","aria-labelledby":"chatbot-status-bar",class:Qa({view:"maximised"}),children:c("div",{class:eo({view:"maximised"}),children:[c(qc,{params:n,children:u?c(ee,{children:[c("span",{class:"block",children:u.data.title}),c("span",{class:"block truncate text-xs font-normal",children:o==null?void 0:o.title})]}):o==null?void 0:o.title}),xr({state:a,view:l}).with({state:"idle"},()=>null).with({state:"loading"},()=>c(Xa,{},"loading")).with({state:"loaded"},()=>c(Rt,{fallback:c(Xa,{},"loading"),children:c(Hc,{analytics:r,apiClient:t,logger:e,talentBankClient:i})})).with({state:"error"},()=>c(Bc,{message:s})).exhaustive()]})})}),l==="minimised"?c(Gc,{flow:o}):null]})},Gc=({flow:e})=>{const{t}=se();return c("div",{class:Qa({view:"minimised",class:"z-100 isolate"}),children:c("div",{class:eo({view:"minimised"}),children:[c("button",{onClick:()=>{D.viewState$.value="maximised"},class:"view-switch h-full flex-grow overflow-hidden px-4 py-1 focus-visible:outline-none",onTouchStart:Pi,children:c("p",{"aria-hidden":!0,class:"truncate text-sm font-bold tracking-tight text-white",children:e==null?void 0:e.title})}),c("div",{class:"flex items-center px-0.5",children:c(Yt,{class:"mx-1","aria-label":t("close_application"),onClick:D.cancelCurrentFlow,variant:"white",children:c("path",{d:"M12 12L4 4M12 4L4 12"})},"close")})]})})},Yc=`[data-widget=inploi-chatbot]{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;position:relative;z-index:2147483647;font-size:16px;font-family:sans-serif;--i-lowest: 0 0% 100%;--i-e-1: 340 100% 99%;--i-e-2: 353 100% 98%;--i-e-3: 351 91% 96%;--i-e-4: 351 100% 93%;--i-e-5: 350 100% 90%;--i-e-6: 351 80% 86%;--i-e-7: 349 68% 81%;--i-e-8: 348 61% 74%;--i-e-9: 348 75% 59%;--i-e-10: 347 70% 55%;--i-e-11: 345 70% 47%;--i-e-12: 344 63% 24%;--header-height: 44px;--content-height:calc(100vh - 64px);--content-height:calc(100svh - 64px)}@media screen and (min-width: 768px){[data-widget=inploi-chatbot]{--content-height: min(640px, calc(100vh - 16px));--content-height: min(640px, calc(100svh - 16px)) }}[data-widget=inploi-chatbot] *,[data-widget=inploi-chatbot] :before,[data-widget=inploi-chatbot] :after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }[data-widget=inploi-chatbot] ::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }[data-widget=inploi-chatbot]{--tw-content: "";font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}[data-widget=inploi-chatbot] em{font-style:italic}[data-widget=inploi-chatbot] strong{font-weight:700}[data-widget=inploi-chatbot] *{font-weight:inherit;font-style:inherit;box-sizing:border-box;font-family:inherit;border-style:solid;border-width:0;-webkit-tap-highlight-color:transparent}[data-widget=inploi-chatbot] :before,[data-widget=inploi-chatbot] :after{box-sizing:border-box}[data-widget=inploi-chatbot] :is(ul,ol){list-style:none;padding:0;margin:0}[data-widget=inploi-chatbot] :is(p){margin:0;padding:0}[data-widget=inploi-chatbot] :is(li){margin:0;padding:0;list-style:none}[data-widget=inploi-chatbot] :is(button){margin:0;padding:0;border:unset;background:unset;text-align:unset}[data-widget=inploi-chatbot] .container{width:100%}@media (min-width: 640px){[data-widget=inploi-chatbot] .container{max-width:640px}}@media (min-width: 768px){[data-widget=inploi-chatbot] .container{max-width:768px}}@media (min-width: 1024px){[data-widget=inploi-chatbot] .container{max-width:1024px}}@media (min-width: 1280px){[data-widget=inploi-chatbot] .container{max-width:1280px}}@media (min-width: 1536px){[data-widget=inploi-chatbot] .container{max-width:1536px}}[data-widget=inploi-chatbot] .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}[data-widget=inploi-chatbot] .visible{visibility:visible}[data-widget=inploi-chatbot] .invisible{visibility:hidden}[data-widget=inploi-chatbot] .collapse{visibility:collapse}[data-widget=inploi-chatbot] .static{position:static}[data-widget=inploi-chatbot] .fixed{position:fixed}[data-widget=inploi-chatbot] .absolute{position:absolute}[data-widget=inploi-chatbot] .relative{position:relative}[data-widget=inploi-chatbot] .sticky{position:sticky}[data-widget=inploi-chatbot] .inset-0{top:0;right:0;bottom:0;left:0}[data-widget=inploi-chatbot] .bottom-0{bottom:0}[data-widget=inploi-chatbot] .bottom-2{bottom:8px}[data-widget=inploi-chatbot] .bottom-2\\.5{bottom:10px}[data-widget=inploi-chatbot] .left-0{left:0}[data-widget=inploi-chatbot] .left-1\\/2{left:50%}[data-widget=inploi-chatbot] .left-2{left:8px}[data-widget=inploi-chatbot] .right-0{right:0}[data-widget=inploi-chatbot] .right-0\\.5{right:2px}[data-widget=inploi-chatbot] .right-1{right:4px}[data-widget=inploi-chatbot] .right-2{right:8px}[data-widget=inploi-chatbot] .top-0{top:0}[data-widget=inploi-chatbot] .isolate{isolation:isolate}[data-widget=inploi-chatbot] .z-20{z-index:20}[data-widget=inploi-chatbot] .z-50{z-index:50}[data-widget=inploi-chatbot] .m-0{margin:0}[data-widget=inploi-chatbot] .mx-1{margin-left:4px;margin-right:4px}[data-widget=inploi-chatbot] .mx-auto{margin-left:auto;margin-right:auto}[data-widget=inploi-chatbot] .mb-1{margin-bottom:4px}[data-widget=inploi-chatbot] .ml-auto{margin-left:auto}[data-widget=inploi-chatbot] .mt-0\\.5{margin-top:2px}[data-widget=inploi-chatbot] .mt-auto{margin-top:auto}[data-widget=inploi-chatbot] .block{display:block}[data-widget=inploi-chatbot] .inline-block{display:inline-block}[data-widget=inploi-chatbot] .inline{display:inline}[data-widget=inploi-chatbot] .flex{display:flex}[data-widget=inploi-chatbot] .inline-flex{display:inline-flex}[data-widget=inploi-chatbot] .table{display:table}[data-widget=inploi-chatbot] .table-row{display:table-row}[data-widget=inploi-chatbot] .flow-root{display:flow-root}[data-widget=inploi-chatbot] .grid{display:grid}[data-widget=inploi-chatbot] .inline-grid{display:inline-grid}[data-widget=inploi-chatbot] .contents{display:contents}[data-widget=inploi-chatbot] .list-item{display:list-item}[data-widget=inploi-chatbot] .\\!hidden{display:none!important}[data-widget=inploi-chatbot] .hidden{display:none}[data-widget=inploi-chatbot] .size-\\[1lh\\]{width:1lh;height:1lh}[data-widget=inploi-chatbot] .h-1\\.5{height:6px}[data-widget=inploi-chatbot] .h-16{height:64px}[data-widget=inploi-chatbot] .h-4{height:16px}[data-widget=inploi-chatbot] .h-48{height:192px}[data-widget=inploi-chatbot] .h-8{height:32px}[data-widget=inploi-chatbot] .h-\\[3px\\]{height:3px}[data-widget=inploi-chatbot] .h-\\[var\\(--content-height\\)\\]{height:var(--content-height)}[data-widget=inploi-chatbot] .h-\\[var\\(--header-height\\)\\]{height:var(--header-height)}[data-widget=inploi-chatbot] .h-full{height:100%}[data-widget=inploi-chatbot] .max-h-\\[calc\\(100\\%-var\\(--header-height\\)-4rem\\)\\]{max-height:calc(100% - var(--header-height) - 64px)}[data-widget=inploi-chatbot] .max-h-\\[calc\\(8lh\\+1rem\\)\\]{max-height:calc(8lh + 16px)}[data-widget=inploi-chatbot] .max-h-full{max-height:100%}[data-widget=inploi-chatbot] .min-h-0{min-height:0px}[data-widget=inploi-chatbot] .min-h-\\[36px\\]{min-height:36px}[data-widget=inploi-chatbot] .min-h-\\[calc\\(1lh\\+1rem\\)\\]{min-height:calc(1lh + 16px)}[data-widget=inploi-chatbot] .w-1\\.5{width:6px}[data-widget=inploi-chatbot] .w-16{width:64px}[data-widget=inploi-chatbot] .w-24{width:96px}[data-widget=inploi-chatbot] .w-4{width:16px}[data-widget=inploi-chatbot] .w-64{width:256px}[data-widget=inploi-chatbot] .w-8{width:32px}[data-widget=inploi-chatbot] .w-\\[72px\\]{width:72px}[data-widget=inploi-chatbot] .w-full{width:100%}[data-widget=inploi-chatbot] .min-w-0{min-width:0px}[data-widget=inploi-chatbot] .min-w-\\[2rem\\]{min-width:32px}[data-widget=inploi-chatbot] .max-w-\\[450px\\]{max-width:450px}[data-widget=inploi-chatbot] .max-w-\\[min\\(100\\%\\,24rem\\)\\]{max-width:min(100%,384px)}[data-widget=inploi-chatbot] .max-w-\\[min\\(300px\\,calc\\(100vw-4rem\\)\\)\\]{max-width:min(300px,calc(100vw - 64px))}[data-widget=inploi-chatbot] .max-w-\\[var\\(--radix-popover-content-available-width\\)\\]{max-width:var(--radix-popover-content-available-width)}[data-widget=inploi-chatbot] .max-w-full{max-width:100%}[data-widget=inploi-chatbot] .flex-1{flex:1 1 0%}[data-widget=inploi-chatbot] .flex-auto{flex:1 1 auto}[data-widget=inploi-chatbot] .flex-none{flex:none}[data-widget=inploi-chatbot] .flex-shrink{flex-shrink:1}[data-widget=inploi-chatbot] .flex-shrink-0{flex-shrink:0}[data-widget=inploi-chatbot] .shrink{flex-shrink:1}[data-widget=inploi-chatbot] .shrink-0{flex-shrink:0}[data-widget=inploi-chatbot] .flex-grow,[data-widget=inploi-chatbot] .grow{flex-grow:1}[data-widget=inploi-chatbot] .border-collapse{border-collapse:collapse}[data-widget=inploi-chatbot] .-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .scale-75{--tw-scale-x: .75;--tw-scale-y: .75;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}[data-widget=inploi-chatbot] .animate-bounce{animation:bounce 1s infinite}@keyframes bubble-in{0%{transform:translateY(100%) scale(.8);opacity:0}to{transform:translateY(0) scale(1);opacity:1}}[data-widget=inploi-chatbot] .animate-bubble-in{animation:bubble-in .3s cubic-bezier(.34,1.56,.64,1)}@keyframes maximise{0%{transform:translateY(50%) scaleX(.7)}to{transform:translateY(0)}}[data-widget=inploi-chatbot] .animate-maximise{animation:maximise .4s cubic-bezier(.16,1,.3,1)}@keyframes pulse{50%{opacity:.5}}[data-widget=inploi-chatbot] .animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slide-in-bottom{0%{transform:translateY(-100%) scaleX(1.25)}to{transform:translateY(0)}}[data-widget=inploi-chatbot] .animate-slide-in-bottom{animation:slide-in-bottom .3s cubic-bezier(.175,.885,.32,1.275)}[data-widget=inploi-chatbot] .cursor-pointer{cursor:pointer}[data-widget=inploi-chatbot] .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-widget=inploi-chatbot] .select-text{-webkit-user-select:text;-moz-user-select:text;user-select:text}[data-widget=inploi-chatbot] .resize-y{resize:vertical}[data-widget=inploi-chatbot] .resize{resize:both}[data-widget=inploi-chatbot] .scroll-pb-12{scroll-padding-bottom:48px}[data-widget=inploi-chatbot] .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}[data-widget=inploi-chatbot] .flex-col{flex-direction:column}[data-widget=inploi-chatbot] .flex-wrap{flex-wrap:wrap}[data-widget=inploi-chatbot] .items-start{align-items:flex-start}[data-widget=inploi-chatbot] .items-center{align-items:center}[data-widget=inploi-chatbot] .items-stretch{align-items:stretch}[data-widget=inploi-chatbot] .justify-end{justify-content:flex-end}[data-widget=inploi-chatbot] .justify-center{justify-content:center}[data-widget=inploi-chatbot] .gap-0{gap:0px}[data-widget=inploi-chatbot] .gap-1{gap:4px}[data-widget=inploi-chatbot] .gap-1\\.5{gap:6px}[data-widget=inploi-chatbot] .gap-2{gap:8px}[data-widget=inploi-chatbot] .gap-2\\.5{gap:10px}[data-widget=inploi-chatbot] .gap-3{gap:12px}[data-widget=inploi-chatbot] .gap-4{gap:16px}[data-widget=inploi-chatbot] .self-center{align-self:center}[data-widget=inploi-chatbot] .overflow-hidden{overflow:hidden}[data-widget=inploi-chatbot] .overflow-y-auto{overflow-y:auto}[data-widget=inploi-chatbot] .overscroll-contain{overscroll-behavior:contain}[data-widget=inploi-chatbot] .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[data-widget=inploi-chatbot] .text-ellipsis{text-overflow:ellipsis}[data-widget=inploi-chatbot] .whitespace-nowrap{white-space:nowrap}[data-widget=inploi-chatbot] .text-balance{text-wrap:balance}[data-widget=inploi-chatbot] .text-pretty{text-wrap:pretty}[data-widget=inploi-chatbot] .break-words{overflow-wrap:break-word}[data-widget=inploi-chatbot] .rounded{border-radius:4px}[data-widget=inploi-chatbot] .rounded-2xl{border-radius:16px}[data-widget=inploi-chatbot] .rounded-3xl{border-radius:24px}[data-widget=inploi-chatbot] .rounded-\\[18px\\]{border-radius:18px}[data-widget=inploi-chatbot] .rounded-full{border-radius:9999px}[data-widget=inploi-chatbot] .rounded-lg{border-radius:8px}[data-widget=inploi-chatbot] .rounded-md{border-radius:6px}[data-widget=inploi-chatbot] .rounded-xl{border-radius:12px}[data-widget=inploi-chatbot] .rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}[data-widget=inploi-chatbot] .rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}[data-widget=inploi-chatbot] .rounded-t-3xl{border-top-left-radius:24px;border-top-right-radius:24px}[data-widget=inploi-chatbot] .rounded-bl-md{border-bottom-left-radius:6px}[data-widget=inploi-chatbot] .rounded-br-md{border-bottom-right-radius:6px}[data-widget=inploi-chatbot] .border{border-width:1px}[data-widget=inploi-chatbot] .border-b{border-bottom-width:1px}[data-widget=inploi-chatbot] .border-t{border-top-width:1px}[data-widget=inploi-chatbot] .border-solid{border-style:solid}[data-widget=inploi-chatbot] .border-dashed{border-style:dashed}[data-widget=inploi-chatbot] .border-accent-9{border-color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .border-divider{border-color:var(--i-color-divider)}[data-widget=inploi-chatbot] .border-neutral-5{border-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .border-neutral-8{border-color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .border-transparent{border-color:transparent}[data-widget=inploi-chatbot] .border-b-neutral-3{border-bottom-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .border-b-neutral-5{border-bottom-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .border-b-transparent{border-bottom-color:transparent}[data-widget=inploi-chatbot] .bg-accent-1{background-color:var(--i-color-a-1)}[data-widget=inploi-chatbot] .bg-accent-3{background-color:var(--i-color-a-3)}[data-widget=inploi-chatbot] .bg-accent-9{background-color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .bg-bubble-weak-bg{background-color:var(--i-bubble-weak-bg)}[data-widget=inploi-chatbot] .bg-lowest{background-color:var(--i-color-lowest)}[data-widget=inploi-chatbot] .bg-neutral-1{background-color:var(--i-color-n-1)}[data-widget=inploi-chatbot] .bg-neutral-2{background-color:var(--i-color-n-2)}[data-widget=inploi-chatbot] .bg-neutral-3{background-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .bg-statusbar{background-color:var(--i-status-bar-bg)}[data-widget=inploi-chatbot] .bg-transparent{background-color:transparent}[data-widget=inploi-chatbot] .bg-none{background-image:none}[data-widget=inploi-chatbot] .p-1{padding:4px}[data-widget=inploi-chatbot] .p-1\\.5{padding:6px}[data-widget=inploi-chatbot] .p-10{padding:40px}[data-widget=inploi-chatbot] .p-11{padding:44px}[data-widget=inploi-chatbot] .p-12{padding:48px}[data-widget=inploi-chatbot] .p-2{padding:8px}[data-widget=inploi-chatbot] .p-2\\.5{padding:10px}[data-widget=inploi-chatbot] .p-3{padding:12px}[data-widget=inploi-chatbot] .p-4{padding:16px}[data-widget=inploi-chatbot] .p-5{padding:20px}[data-widget=inploi-chatbot] .p-6{padding:24px}[data-widget=inploi-chatbot] .p-7{padding:28px}[data-widget=inploi-chatbot] .p-8{padding:32px}[data-widget=inploi-chatbot] .p-9{padding:36px}[data-widget=inploi-chatbot] .px-0\\.5{padding-left:2px;padding-right:2px}[data-widget=inploi-chatbot] .px-1{padding-left:4px;padding-right:4px}[data-widget=inploi-chatbot] .px-1\\.5{padding-left:6px;padding-right:6px}[data-widget=inploi-chatbot] .px-2{padding-left:8px;padding-right:8px}[data-widget=inploi-chatbot] .px-3{padding-left:12px;padding-right:12px}[data-widget=inploi-chatbot] .px-4{padding-left:16px;padding-right:16px}[data-widget=inploi-chatbot] .px-5{padding-left:20px;padding-right:20px}[data-widget=inploi-chatbot] .py-0\\.5{padding-top:2px;padding-bottom:2px}[data-widget=inploi-chatbot] .py-1{padding-top:4px;padding-bottom:4px}[data-widget=inploi-chatbot] .py-1\\.5{padding-top:6px;padding-bottom:6px}[data-widget=inploi-chatbot] .py-2{padding-top:8px;padding-bottom:8px}[data-widget=inploi-chatbot] .py-2\\.5{padding-top:10px;padding-bottom:10px}[data-widget=inploi-chatbot] .py-3{padding-top:12px;padding-bottom:12px}[data-widget=inploi-chatbot] .pb-2{padding-bottom:8px}[data-widget=inploi-chatbot] .pb-6{padding-bottom:24px}[data-widget=inploi-chatbot] .pl-1\\.5{padding-left:6px}[data-widget=inploi-chatbot] .pl-2{padding-left:8px}[data-widget=inploi-chatbot] .pl-2\\.5{padding-left:10px}[data-widget=inploi-chatbot] .pl-3{padding-left:12px}[data-widget=inploi-chatbot] .pl-4{padding-left:16px}[data-widget=inploi-chatbot] .pr-1{padding-right:4px}[data-widget=inploi-chatbot] .pr-16{padding-right:64px}[data-widget=inploi-chatbot] .pr-2\\.5{padding-right:10px}[data-widget=inploi-chatbot] .pr-3{padding-right:12px}[data-widget=inploi-chatbot] .pr-4{padding-right:16px}[data-widget=inploi-chatbot] .pt-2{padding-top:8px}[data-widget=inploi-chatbot] .pt-2\\.5{padding-top:10px}[data-widget=inploi-chatbot] .pt-3{padding-top:12px}[data-widget=inploi-chatbot] .pt-5{padding-top:20px}[data-widget=inploi-chatbot] .pt-\\[calc\\(var\\(--header-height\\)\\+1rem\\)\\]{padding-top:calc(var(--header-height) + 16px)}[data-widget=inploi-chatbot] .text-center{text-align:center}[data-widget=inploi-chatbot] .text-justify{text-align:justify}[data-widget=inploi-chatbot] .text-\\[10px\\]{font-size:10px}[data-widget=inploi-chatbot] .text-\\[11px\\]{font-size:11px}[data-widget=inploi-chatbot] .text-base{font-size:16px;line-height:24px}[data-widget=inploi-chatbot] .text-sm{font-size:14px;line-height:20px}[data-widget=inploi-chatbot] .text-xs{font-size:12px;line-height:16px}[data-widget=inploi-chatbot] .font-bold{font-weight:700}[data-widget=inploi-chatbot] .font-medium{font-weight:500}[data-widget=inploi-chatbot] .font-normal{font-weight:400}[data-widget=inploi-chatbot] .font-semibold{font-weight:600}[data-widget=inploi-chatbot] .uppercase{text-transform:uppercase}[data-widget=inploi-chatbot] .lowercase{text-transform:lowercase}[data-widget=inploi-chatbot] .capitalize{text-transform:capitalize}[data-widget=inploi-chatbot] .italic{font-style:italic}[data-widget=inploi-chatbot] .ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}[data-widget=inploi-chatbot] .leading-3{line-height:12px}[data-widget=inploi-chatbot] .leading-snug{line-height:1.375}[data-widget=inploi-chatbot] .leading-tight{line-height:1.25}[data-widget=inploi-chatbot] .tracking-\\[-0\\.01em\\]{letter-spacing:-.01em}[data-widget=inploi-chatbot] .tracking-tight{letter-spacing:-.025em}[data-widget=inploi-chatbot] .tracking-wide{letter-spacing:.025em}[data-widget=inploi-chatbot] .tracking-widest{letter-spacing:.1em}[data-widget=inploi-chatbot] .text-\\[\\#4CAF50\\]{--tw-text-opacity: 1;color:rgb(76 175 80 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .text-\\[\\#FFC107\\]{--tw-text-opacity: 1;color:rgb(255 193 7 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .text-accent-1{color:var(--i-color-a-1)}[data-widget=inploi-chatbot] .text-accent-10{color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .text-accent-11{color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .text-accent-12{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .text-accent-9{color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .text-error-11{color:var(--i-color-e-11)}[data-widget=inploi-chatbot] .text-error-9{color:var(--i-color-e-9)}[data-widget=inploi-chatbot] .text-neutral-10{color:var(--i-color-n-10)}[data-widget=inploi-chatbot] .text-neutral-11{color:var(--i-color-n-11)}[data-widget=inploi-chatbot] .text-neutral-12{color:var(--i-color-n-12)}[data-widget=inploi-chatbot] .text-neutral-6{color:var(--i-color-n-6)}[data-widget=inploi-chatbot] .text-neutral-8{color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .text-neutral-9{color:var(--i-color-n-9)}[data-widget=inploi-chatbot] .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .text-white\\/80{color:#fffc}[data-widget=inploi-chatbot] .underline{text-decoration-line:underline}[data-widget=inploi-chatbot] .no-underline{text-decoration-line:none}[data-widget=inploi-chatbot] .underline-offset-2{text-underline-offset:2px}[data-widget=inploi-chatbot] .underline-offset-4{text-underline-offset:4px}[data-widget=inploi-chatbot] .caret-accent-9{caret-color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .opacity-0{opacity:0}[data-widget=inploi-chatbot] .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-\\[0_0_0_1px\\]{--tw-shadow: 0 0 0 1px;--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-surface-lg{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 6px 4px 0px oklch(0% 0 0 / .02), 0px 11px 4px 0px oklch(0% 0 0 / .01), 0px 32px 24px -12px oklch(0% 0 0 / .06);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color), 0px 11px 4px 0px var(--tw-shadow-color), 0px 32px 24px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-surface-md{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 6px 4px 0px oklch(0% 0 0 / .02), 0px 6px 4px 0px oklch(0% 0 0 / .01);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color), 0px 6px 4px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-surface-sm{--tw-shadow: 0px 3px 3px 0px oklch(0% 0 0 / .03), 0px 4px 4px 0px oklch(0% 0 0 / .02);--tw-shadow-colored: 0px 3px 3px 0px var(--tw-shadow-color), 0px 4px 4px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .shadow-bubble-strong-shadow{--tw-shadow-color: var(--i-bubble-strong-shadow);--tw-shadow: var(--tw-shadow-colored)}[data-widget=inploi-chatbot] .outline-none{outline:2px solid transparent;outline-offset:2px}[data-widget=inploi-chatbot] .outline{outline-style:solid}[data-widget=inploi-chatbot] .outline-1{outline-width:1px}[data-widget=inploi-chatbot] .outline-2{outline-width:2px}[data-widget=inploi-chatbot] .outline-accent-10{outline-color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .outline-accent-4{outline-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .outline-bubble-weak{outline-color:var(--i-bubble-weak-outline)}[data-widget=inploi-chatbot] .outline-divider{outline-color:var(--i-color-divider)}[data-widget=inploi-chatbot] .outline-neutral-3{outline-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .outline-neutral-6{outline-color:var(--i-color-n-6)}[data-widget=inploi-chatbot] .ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .ring-inset{--tw-ring-inset: inset}[data-widget=inploi-chatbot] .ring-accent-6{--tw-ring-color: var(--i-color-a-6)}[data-widget=inploi-chatbot] .ring-divider{--tw-ring-color: var(--i-color-divider)}[data-widget=inploi-chatbot] .ring-lowest{--tw-ring-color: var(--i-color-lowest)}[data-widget=inploi-chatbot] .ring-neutral-4{--tw-ring-color: var(--i-color-n-4)}[data-widget=inploi-chatbot] .ring-neutral-5{--tw-ring-color: var(--i-color-n-5)}[data-widget=inploi-chatbot] .ring-neutral-7{--tw-ring-color: var(--i-color-n-7)}[data-widget=inploi-chatbot] .ring-transparent{--tw-ring-color: transparent}[data-widget=inploi-chatbot] .ring-offset-\\[1\\.5px\\]{--tw-ring-offset-width: 1.5px}[data-widget=inploi-chatbot] .ring-offset-neutral-1{--tw-ring-offset-color: var(--i-color-n-1)}[data-widget=inploi-chatbot] .blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .drop-shadow-\\[0_1\\.5px_var\\(--i-color-n-1\\)\\]{--tw-drop-shadow: drop-shadow(0 1.5px var(--i-color-n-1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}[data-widget=inploi-chatbot] .backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}[data-widget=inploi-chatbot] .backdrop-saturate-150{--tw-backdrop-saturate: saturate(1.5);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}[data-widget=inploi-chatbot] .backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}[data-widget=inploi-chatbot] .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .transition-\\[background\\,color\\,border-color\\,box-shadow\\]{transition-property:background,color,border-color,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}[data-widget=inploi-chatbot] .duration-100{transition-duration:.1s}[data-widget=inploi-chatbot] .duration-1000{transition-duration:1s}[data-widget=inploi-chatbot] .duration-300{transition-duration:.3s}[data-widget=inploi-chatbot] .ease-expo-out{transition-timing-function:cubic-bezier(.16,1,.3,1)}[data-widget=inploi-chatbot] .ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}[data-widget=inploi-chatbot] .will-change-\\[transform\\,opacity\\]{will-change:transform,opacity}[data-widget=inploi-chatbot] .text-wrap-balance{text-wrap:balance}[data-widget=inploi-chatbot] .fr{outline:none}[data-widget=inploi-chatbot] .fr:focus{outline:none}[data-widget=inploi-chatbot] .fr:focus-visible{outline:none;--tw-ring-offset-width: 1px;--tw-ring-offset-color: var(--i-color-lowest);--tw-ring-opacity: 1;--tw-ring-color: var(--i-color-a-9);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .gutter-stable{scrollbar-gutter:stable}[data-widget=inploi-chatbot] .hide-scrollbars::-webkit-scrollbar{display:none}[data-widget=inploi-chatbot] .hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}[data-widget=inploi-chatbot] .touch-hitbox:before{content:"";position:absolute;display:block;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-height:44px;min-width:44px;z-index:9999}[data-widget=inploi-chatbot] .\\[-webkit-outer-spin-button\\:none\\]{-webkit-outer-spin-button:none}[data-widget=inploi-chatbot] .\\[a-zA-Z0-9-_\\:\\.\\$\\@\\?\\]{a-z-a--z0-9-_:.$@?}[data-widget=inploi-chatbot] .\\[grid-template-columns\\:min-content_1fr\\]{grid-template-columns:min-content 1fr}[data-widget=inploi-chatbot] .\\[text-wrap\\:pretty\\]{text-wrap:pretty}[data-widget=inploi-chatbot] .selection\\:bg-accent-4 *::-moz-selection{background-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .selection\\:bg-accent-4 *::selection{background-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .selection\\:bg-transparent *::-moz-selection{background-color:transparent}[data-widget=inploi-chatbot] .selection\\:bg-transparent *::selection{background-color:transparent}[data-widget=inploi-chatbot] .selection\\:text-accent-12 *::-moz-selection{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .selection\\:text-accent-12 *::selection{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .selection\\:bg-accent-4::-moz-selection{background-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .selection\\:bg-accent-4::selection{background-color:var(--i-color-a-4)}[data-widget=inploi-chatbot] .selection\\:bg-transparent::-moz-selection{background-color:transparent}[data-widget=inploi-chatbot] .selection\\:bg-transparent::selection{background-color:transparent}[data-widget=inploi-chatbot] .selection\\:text-accent-12::-moz-selection{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .selection\\:text-accent-12::selection{color:var(--i-color-a-12)}[data-widget=inploi-chatbot] .placeholder\\:text-neutral-10::-moz-placeholder{color:var(--i-color-n-10)}[data-widget=inploi-chatbot] .placeholder\\:text-neutral-10::placeholder{color:var(--i-color-n-10)}[data-widget=inploi-chatbot] .placeholder\\:text-neutral-8::-moz-placeholder{color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .placeholder\\:text-neutral-8::placeholder{color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .first-of-type\\:rounded-l-lg:first-of-type{border-top-left-radius:8px;border-bottom-left-radius:8px}[data-widget=inploi-chatbot] .last-of-type\\:rounded-r-lg:last-of-type{border-top-right-radius:8px;border-bottom-right-radius:8px}[data-widget=inploi-chatbot] .autofill\\:shadow-\\[inset_0_0_0_1000px_hsl\\(210_16\\.7\\%_97\\.6\\%\\)\\]:-webkit-autofill{--tw-shadow: inset 0 0 0 1000px hsl(210 16.7% 97.6%);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:shadow-\\[inset_0_0_0_1000px_hsl\\(210_16\\.7\\%_97\\.6\\%\\)\\]:autofill{--tw-shadow: inset 0 0 0 1000px hsl(210 16.7% 97.6%);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:shadow-\\[inset_0_0_0_1000px_var\\(--i-color-a-2\\)\\]:-webkit-autofill{--tw-shadow: inset 0 0 0 1000px var(--i-color-a-2);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:shadow-\\[inset_0_0_0_1000px_var\\(--i-color-a-2\\)\\]:autofill{--tw-shadow: inset 0 0 0 1000px var(--i-color-a-2);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:\\[-webkit-text-fill-color\\:var\\(--i-color-a-11\\)\\]:-webkit-autofill{-webkit-text-fill-color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .autofill\\:\\[-webkit-text-fill-color\\:var\\(--i-color-a-11\\)\\]:autofill{-webkit-text-fill-color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .focus-within\\:bg-neutral-5:focus-within{background-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .focus-within\\:outline-none:focus-within{outline:2px solid transparent;outline-offset:2px}[data-widget=inploi-chatbot] .focus-within\\:outline-accent-7:focus-within{outline-color:var(--i-color-a-7)}[data-widget=inploi-chatbot] .hover\\:z-10:hover{z-index:10}[data-widget=inploi-chatbot] .hover\\:scale-\\[1\\.02\\]:hover{--tw-scale-x: 1.02;--tw-scale-y: 1.02;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .hover\\:border-accent-10:hover{border-color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .hover\\:border-neutral-5:hover{border-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .hover\\:bg-accent-10:hover{background-color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .hover\\:bg-divider:hover{background-color:var(--i-color-divider)}[data-widget=inploi-chatbot] .hover\\:bg-interactive-bg-hover:hover{background-color:var(--i-interactive-bg-hover)}[data-widget=inploi-chatbot] .hover\\:bg-neutral-2:hover{background-color:var(--i-color-n-2)}[data-widget=inploi-chatbot] .hover\\:bg-neutral-3:hover{background-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .hover\\:bg-neutral-4:hover{background-color:var(--i-color-n-4)}[data-widget=inploi-chatbot] .hover\\:bg-neutral-5:hover{background-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .hover\\:bg-white\\/20:hover{background-color:#fff3}[data-widget=inploi-chatbot] .hover\\:text-accent-11:hover{color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .hover\\:text-neutral-12:hover{color:var(--i-color-n-12)}[data-widget=inploi-chatbot] .hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .hover\\:underline:hover{text-decoration-line:underline}[data-widget=inploi-chatbot] .hover\\:ring-accent-8:hover{--tw-ring-color: var(--i-color-a-8)}[data-widget=inploi-chatbot] .hover\\:ring-divider:hover{--tw-ring-color: var(--i-color-divider)}[data-widget=inploi-chatbot] .focus\\:z-20:focus{z-index:20}[data-widget=inploi-chatbot] .focus\\:bg-neutral-5:focus{background-color:var(--i-color-n-5)}[data-widget=inploi-chatbot] .focus\\:shadow-\\[0_0_0_2px\\]:focus{--tw-shadow: 0 0 0 2px;--tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}[data-widget=inploi-chatbot] .autofill\\:focus\\:shadow-\\[inset_0_0_0_1000px_var\\(--i-color-a-1\\)\\]:focus:-webkit-autofill{--tw-shadow: inset 0 0 0 1000px var(--i-color-a-1);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .autofill\\:focus\\:shadow-\\[inset_0_0_0_1000px_var\\(--i-color-a-1\\)\\]:focus:autofill{--tw-shadow: inset 0 0 0 1000px var(--i-color-a-1);--tw-shadow-colored: inset 0 0 0 1000px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}[data-widget=inploi-chatbot] .focus-visible\\:bg-neutral-3:focus-visible{background-color:var(--i-color-n-3)}[data-widget=inploi-chatbot] .focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}[data-widget=inploi-chatbot] .focus-visible\\:outline-2:focus-visible{outline-width:2px}[data-widget=inploi-chatbot] .focus-visible\\:outline-accent-7:focus-visible{outline-color:var(--i-color-a-7)}[data-widget=inploi-chatbot] .focus-visible\\:outline-accent-8:focus-visible{outline-color:var(--i-color-a-8)}[data-widget=inploi-chatbot] .focus-visible\\:ring-4:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}[data-widget=inploi-chatbot] .active\\:scale-\\[\\.97\\]:active{--tw-scale-x: .97;--tw-scale-y: .97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .active\\:border-submit-bg-active:active{border-color:var(--i-submit-button-bg-active)}[data-widget=inploi-chatbot] .active\\:bg-accent-10:active{background-color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .active\\:bg-accent-2:active{background-color:var(--i-color-a-2)}[data-widget=inploi-chatbot] .active\\:bg-interactive-bg-active:active{background-color:var(--i-interactive-bg-active)}[data-widget=inploi-chatbot] .active\\:bg-interactive-bg-hover:active{background-color:var(--i-interactive-bg-hover)}[data-widget=inploi-chatbot] .active\\:bg-submit-bg-active:active{background-color:var(--i-submit-button-bg-active)}[data-widget=inploi-chatbot] .active\\:bg-white\\/30:active{background-color:#ffffff4d}[data-widget=inploi-chatbot] .active\\:text-accent-10:active{color:var(--i-color-a-10)}[data-widget=inploi-chatbot] .active\\:text-accent-11:active{color:var(--i-color-a-11)}[data-widget=inploi-chatbot] .active\\:text-neutral-12:active{color:var(--i-color-n-12)}[data-widget=inploi-chatbot] .active\\:text-white:active{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}[data-widget=inploi-chatbot] .active\\:outline-neutral-8:active{outline-color:var(--i-color-n-8)}[data-widget=inploi-chatbot] .active\\:ring-2:active{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .active\\:ring-accent-7:active{--tw-ring-color: var(--i-color-a-7)}[data-widget=inploi-chatbot] .active\\:ring-interactive-bg-hover:active{--tw-ring-color: var(--i-interactive-bg-hover)}[data-widget=inploi-chatbot] .active\\:ring-offset-2:active{--tw-ring-offset-width: 2px}[data-widget=inploi-chatbot] .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}[data-widget=inploi-chatbot] .disabled\\:opacity-50:disabled{opacity:.5}[data-widget=inploi-chatbot] .peer:checked~.peer-checked\\:bg-accent-2{background-color:var(--i-color-a-2)}[data-widget=inploi-chatbot] .peer:checked~.peer-checked\\:text-accent-9{color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .peer:checked~.peer-checked\\:outline-accent-7{outline-color:var(--i-color-a-7)}[data-widget=inploi-chatbot] .peer:focus-visible~.peer-focus-visible\\:ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .peer:focus-visible~.peer-focus-visible\\:ring-accent-9{--tw-ring-color: var(--i-color-a-9)}[data-widget=inploi-chatbot] .peer:focus-visible~.peer-focus-visible\\:ring-offset-accent-7{--tw-ring-offset-color: var(--i-color-a-7)}[data-widget=inploi-chatbot] .aria-disabled\\:cursor-not-allowed[aria-disabled=true]{cursor:not-allowed}[data-widget=inploi-chatbot] .aria-disabled\\:opacity-50[aria-disabled=true]{opacity:.5}[data-widget=inploi-chatbot] .aria-disabled\\:hover\\:border-accent-9:hover[aria-disabled=true]{border-color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .aria-disabled\\:hover\\:bg-accent-9:hover[aria-disabled=true]{background-color:var(--i-color-a-9)}[data-widget=inploi-chatbot] .aria-disabled\\:active\\:ring-1:active[aria-disabled=true]{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}[data-widget=inploi-chatbot] .aria-disabled\\:active\\:ring-offset-\\[1\\.5px\\]:active[aria-disabled=true]{--tw-ring-offset-width: 1.5px}[data-widget=inploi-chatbot] .group[aria-pressed=true] .group-aria-\\[pressed\\=true\\]\\:scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (pointer: coarse){[data-widget=inploi-chatbot] .pointer-coarse\\:touch-hitbox\\:\\:before:before{content:"";position:absolute;display:block;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-height:44px;min-width:44px;z-index:9999}}[data-widget=inploi-chatbot] .\\[\\&\\:has\\(\\+\\*\\>input\\:focus\\)\\]\\:text-neutral-11:has(+*>input:focus){color:var(--i-color-n-11)}[data-widget=inploi-chatbot] .\\[\\&\\:has\\(\\.view-switch\\:active\\)\\]\\:scale-\\[0\\.98\\]:has(.view-switch:active){--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}[data-widget=inploi-chatbot] .\\[\\&\\:has\\(\\>\\.view-switch\\:focus-visible\\)\\]\\:ring-1:has(>.view-switch:focus-visible){--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}@keyframes fade-in{0%{opacity:0}to{opacity:1}}[data-widget=inploi-chatbot] dialog::backdrop{animation:fade-in .5s cubic-bezier(.16,1,.3,1) both}[data-widget=inploi-chatbot] dialog::backdrop{background-color:var(--i-overlay-bg)}
2
+ `,to="inploi-chatbot",Oi=`[data-widget='${to}']`,Jc=()=>({getChatbotElement:()=>document.querySelector(Oi),getOrCreateChatbotElement:()=>{const e=document.querySelector(Oi);if(e)return document.body.appendChild(e),e;const t=document.createElement("div");return document.body.appendChild(t),t.dataset.widget=to,t}}),Xc=25,ro=Ge(()=>{}),Zc=(e,t)=>new Promise((r,i)=>{if(t!=null&&t.aborted)return i(new vt);const n=setTimeout(r,e);t==null||t.addEventListener("abort",()=>{clearTimeout(n),i(new vt)},{once:!0})}),ae={onSubmitSuccessFn$:Ge(()=>{}),onInteractionFn$:Ge(()=>{}),isBotTyping$:Ge(!1),isReadingHistory$:Ge(!1),scrollToEnd:()=>ro.value()},Qc=()=>{const e=me(null);we(()=>{const r=e.current;if(!r)return;const i=()=>{ae.isReadingHistory$.value=!1,r.scrollTo({top:r.scrollHeight,behavior:"instant"})};ro.value=i;const n=()=>{ae.isReadingHistory$.value=r.scrollHeight-r.scrollTop-r.clientHeight>2};r.addEventListener("scroll",n,{passive:!0});const a=new ResizeObserver(()=>{ae.isReadingHistory$.peek()||i()});return a.observe(r),r.firstElementChild&&a.observe(r.firstElementChild),()=>{r.removeEventListener("scroll",n),a.disconnect()}},[]);const t=et(()=>({setSubmission:(i,n)=>D.setSubmission(i,n),send:async({message:i,signal:n,groupId:a})=>{if(await xr(i).with({author:"bot",type:"text"},async o=>{if(n!=null&&n.aborted)throw new vt;ae.isBotTyping$.value=!0;const s=Math.min(Math.max(20,o.text.length),100)*Xc;try{await Zc(s,n)}finally{ae.isBotTyping$.value=!1}}).otherwise(async()=>{}),n!=null&&n.aborted)throw new vt;D.addMessage(i,a)},input:({input:i,signal:n})=>{if(n!=null&&n.aborted)throw new vt;return D.setInput(i),new Promise(a=>{const o=s=>{if(n!=null&&n.aborted)throw new vt;D.setInput(void 0),i.key&&D.setSubmission(i.key,s),a(s)};ae.onSubmitSuccessFn$.value=o})}}),[]);return{chatRef:e,chatService:t}};var io=_s(Wr([$e(),lr()]),pn(String)),no=fe({id:io,version:lr(),build:lr(),nodes:gn(hn()),context_schema:Ce(sr(bn($e(),fe({required:Hr(),type:Wr([or("string"),or("number")])}))))}),eu=fe({flow:no}),tu=fe({company:fe({name:$e()}),flow:no,job:fe({id:io,title:$e()}),user:Ce(fe({city:Ce($e()),country:Ce($e()),isEU:Ce(Hr()),continent:Ce($e())}))}),ru={pathname:"/flow/job/:id",method:"GET",schema:{searchParams:Hs(),response:tu}},iu={pathname:"/flow/id/:id",method:"GET",schema:{response:eu}},nu=["1","2","3","4","5","6","7","8","9","10","11","12"],au={light:{1:[98.8,.015],2:[97.8,.018],3:[95.8,.025],4:[92,.04],5:[89,.05],6:[85,.07],7:[80.5,.08],8:[74,.11],9:[60,.22],10:[56,.23],11:[50,.19],12:[25,.18]},dark:{1:[19,.015],2:[21,.018],3:[25.5,.055],4:[29.3,.084],5:[33.5,.098],6:[39.05,.107],7:[45,.11],8:[55,.13],9:[60,.22],10:[67,.18],11:[79.3,.12],12:[95,.04]}},ou=(e,t=1,r)=>i=>{const[n,a]=au[r][i];return"oklch("+n+"% "+a*t+" "+e+")"},Li=e=>{const t=ou(e.hue,e.chroma,e.mode);return Object.fromEntries(nu.map(r=>[e.prefix+r,e.transform(t(r))]))},ji=e=>e,su=e=>{const t=Object.keys(e).flatMap(r=>{const i=e[r];return typeof i=="object"&&i!==null?Object.keys(i).map(n=>{const a=i[n];return[`${String(r)}.${n}`,a]}):[[r,i]]});return Object.fromEntries(t)},Fr=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Bi=(e,...t)=>{if(!t.length)return e;const r=t.shift();if(Fr(e)&&Fr(r))for(const i in r){const n=r[i];if(Fr(n)){e[i]||Object.assign(e,{[i]:{}});const a=e[i];Fr(a)&&Bi(a,n)}else Object.assign(e,{[i]:r[i]})}return Bi(e,...t)},lu=e=>{function t(r,i){const n=[e.prefix,i.toString().replace(/\./g,"-")].join("");return r==="declaration"?`--${n}`:`var(--${n})`}return t},cu=()=>({core:e=>({semantic:t=>({component:r=>({from:i=>{const{theme:n,getToken:a}=i,o=h=>a("reference",h.toString()),s=e({theme:n}),l=t({theme:n,core:o,raw:{core:s}}),d=r({theme:n,core:o,semantic:o,raw:{core:s,semantic:l}}),p=su(Bi(s,l,d)),u=([h,b],m)=>{const k=[m,h].filter(Boolean).join(".");return typeof b=="object"?Object.entries(b).flatMap(A=>u(A,k)):[[i.getToken("declaration",k),b]]};return{values:p,declarations:Object.fromEntries(Object.entries(p).flatMap(h=>u(h))),ref:h=>a("reference",h.toString())}}})})})});const[Ri,zi,ao]=["oklch(0% 0 0)","oklch(100% 0 0)","transparent"],uu=cu().core(({theme:e})=>({color:{black:Ri,white:zi,lowest:e.mode==="light"?zi:Ri,highest:e.mode==="light"?Ri:zi,...Li({prefix:"a-",hue:e.hue,chroma:e.chroma,mode:e.mode,transform:ji}),...Li({prefix:"n-",hue:e.hue,chroma:.05,mode:e.mode,transform:ji}),...Li({prefix:"e-",hue:20,chroma:e.chroma,mode:e.mode,transform:ji})},typography:{}})).semantic(({core:e,raw:t,theme:r})=>{const i=(n,a)=>t.core.color[n].replace(")",` / ${a})`);return{"font-family":{body:"inherit",headings:"inherit"},"font-style":{body:"normal",headings:"normal"},"font-weight-body":"normal","font-weight-headings":"normal","radius-app":"1.5rem","radius-interactive":"1.5rem",color:{divider:i("n-8",r.mode==="dark"?.4:.2)},"copy-body":e("color.n-12"),"copy-headings":e("color.n-12"),interactive:{copy:e("color.n-11"),"copy-hover":e("color.n-12"),"copy-active":e("color.n-12"),bg:ao,"bg-hover":i("n-10",.2),"bg-active":i("n-10",.3)}}}).component(({raw:e,theme:t,semantic:r,core:i})=>{const n=(a,o)=>e.core.color[a].replace(")",` / ${o})`);return{app:{bg:i(t.mode==="dark"?"color.n-1":"color.n-2")},overlay:{bg:n("black",.4)},bubble:{"weak-bg":i(t.mode==="dark"?"color.n-3":"color.lowest"),"weak-outline":r("color.divider"),"strong-shadow":n("a-9",.05)},"status-bar":{bg:n("n-2",.8),"bg-button":ao,"bg-button-hover":n("n-10",.4),"bg-button-active":n("n-10",.5)},"submit-button":{"bg-active":i(t.mode==="dark"?"color.a-8":"color.a-11")}}}),du=lu({prefix:"i-"}),fu=e=>{const t=uu.from({theme:e,getToken:du}),r=Object.entries(t.declarations).map(([i,n])=>`${i}: ${n};`);return`${Oi} {
3
3
  ${r.concat(r).join(`
4
4
  `)}
5
- }`},cu=({_internal_domManager:e=Wc(),theme:t,terms:r,feedback:i})=>Os(({apiClient:n,rpcClient:a,logger:o,analytics:s,publishableKey:l,env:d})=>{let p=!1,u=0;const h=hc({locale:void 0,overrides:r??{}}),b=l&&d?ol({environment:d,publishableKey:l,logger:o}):void 0,m=v=>v===u,_=()=>{if(typeof window>"u")return;u++,Oe.flushStateData().catch(()=>{}),D.cancelCurrentFlow(),ie.isBotTyping$.value=!1;const v=e.getChatbotElement();v&&(ft(null,v),v.remove()),p=!1,o.info("Chatbot plugin destroyed")},I=()=>{if(typeof window>"u")return;const v=u,y=[_e("style",{id:"inploi-chatbot-styles"},Hc),_e("style",{id:"inploi-chatbot-theme"},lu(t))],S=e.getOrCreateChatbotElement();if(ft(_e(X,{},[y,_e(Uc,{apiClient:n,logger:o,analytics:s,talentBankClient:b,params:{theme:t,terms:r,feedback:i}})]),S),i){const $=V=>{var M,C;if(!m(v))return;const q=(M=e.getChatbotElement())==null?void 0:M.querySelector("dialog");q&&uu({instance:V({rpcClient:a,apiClient:n,logger:o,analytics:s}),theme:t,terms:((C=i.params)==null?void 0:C.terms)??{},host:q})};i.plugin instanceof Promise?i.plugin.then(({feedbackPlugin:V})=>{$(V())}).catch(V=>{o.error("Error preparing feedback plugin",V)}):$(i.plugin)}p=!0},A=async(v,y)=>{if(!m(y))return;Fs({context:v.context||{},schema:v.flow.context_schema,logger:o});const S=await D.prepareFlow(v);m(y)&&D.commitFlow(S)};return{prepare:async()=>{if(!(typeof window>"u"))try{if(p)return;I(),o.info("Chatbot plugin prepared")}catch(v){o.error("Error preparing chatbot plugin",v)}},fetchFlowByJobId:async(v,y)=>a.request(Xc,{params:{id:v},searchParams:{id_type:(y==null?void 0:y.idType)==="inploi"?"internal":"external"}}).then(S=>({flow:S.flow,title:S.job.title,flowKeys:[S.job.id,...(y==null?void 0:y.flowKeys)??[]],job:{id:S.job.id,id_type:"external"},...y,context:{user:S.user,...y==null?void 0:y.context}})),fetchFlowById:async(v,y)=>a.request(Qc,{params:{id:v}}).then(S=>{var $;return{flow:S.flow,title:"Chatbot",flowKeys:(y==null?void 0:y.flowKeys)??[],...y,analytics:{customProperties:{flow_id:S.flow.id,flow_version:S.flow.version,...($=y==null?void 0:y.analytics)==null?void 0:$.customProperties}}}}),open:async v=>{if(!(typeof window>"u"))try{D.cancelCurrentFlow(),D.viewState$.value="maximised",p||I();const y=u;v instanceof Promise?(D.current$.value={state:"loading"},v.then(S=>A(S,y)).catch(S=>{if(!m(y))return;const $=S instanceof Error?S.message:h("unknown_error");D.current$.value={state:"error",error:$}})):await A(v,y)}catch(y){o.error("Error starting flow",y)}},close:async()=>{typeof window>"u"||(D.cancelCurrentFlow(),o.info("Closed flow from an external source"))},destroy:_}});function uu({instance:e,terms:t,theme:r,host:i}){e.render({key:"chatbot-header",size:"sm",theme:{accent:{chroma:r.chroma??1,hue:r.hue},positive:{hue:180,chroma:1},negative:{hue:33,chroma:1},mode:r.mode,corners:"rounded",highlights:"stroke"},terms:t,host:i})}if(!window.inploi)throw new Error("Please insert the SDK script tag above the plugins.");window.inploi.chatbotPlugin=cu;const Qa=(e,t,r)=>{var i;return e.log({event:r,properties:{flow_id:t.id,flow_version:t.version,flow_session_id:t.data.flowSessionId,flow_build:t.build,flow_type:"CHATBOT_DRAWER",job:t.job},customProperties:(i=t.analytics)==null?void 0:i.customProperties})};var eo=({condition:e,context:t,submissions:r,ifBlock:i})=>{let[n,...a]=e.compareKey.split(".");if(!n)return!1;let o=pn({context:t,key:n,path:a,submissions:r});if(!o)return!1;switch(o.type){case"address":{let s=Mt(o.value,a);switch(e.compare){case"equals":return s===e.compareValue;case"contains":return typeof s!="string"?!1:s.includes(e.compareValue);case"notEquals":return s!==e.compareValue;case"notContains":return typeof s!="string"?!0:!s.includes(e.compareValue)}break}case"integration":{if(typeof o.value!="object"||Array.isArray(o.value))return!1;let s=Mt(o.value,a),l={...i,data:{compareKey:"_temp",compare:e.compare,compareValue:e.compareValue}};switch(typeof s){case"boolean":return Gt(l,{submissions:{_temp:{value:s,type:"boolean"}},context:t});case"string":return Gt(l,{submissions:{_temp:{value:s,type:"string"}},context:t});case"number":return Gt(l,{submissions:{_temp:{value:s,type:"number"}},context:t});case"object":return Array.isArray(s)&&s.every(d=>typeof d=="string")?Gt(l,{submissions:{_temp:{value:s,type:"enum"}},context:t}):!1}break}case"boolean":{let s=e.compareValue==="true";switch(e.compare){case"equals":return o.value===s;case"notEquals":return o.value!==s}break}case"phone":case"string":{let s=o.type==="phone"?sr(o.value):o.value;switch(e.compare){case"equals":return s===e.compareValue;case"contains":return s?s.includes(e.compareValue):!1;case"notEquals":return s!==e.compareValue;case"notContains":return s?!s.includes(e.compareValue):!0}break}case"number":{try{let s=Number(e.compareValue);switch(e.compare){case"equals":return o.value===s;case"notEquals":return o.value!==s;case"greaterThan":return o.value>s;case"greaterThanOrEqualTo":return o.value>=s;case"lessThan":return o.value<s;case"lessThanOrEqualTo":return o.value<=s}}catch{return console.error(`Failed to parse number in if-block ${i.id}`,o.value),!1}break}case"enum":switch(e.compare){case"equals":return o.value.length===1&&o.value[0]===e.compareValue;case"notEquals":return o.value.length===1&&o.value[0]!==e.compareValue;case"contains":return o.value.includes(e.compareValue);case"notContains":return!o.value.includes(e.compareValue)}break}},Gt=(e,{context:t,submissions:r})=>{let i="combinator"in e.data?e.data.conditions:[e.data];if(("combinator"in e.data?e.data.combinator:"and")==="or"){for(let n of i)if(eo({condition:n,context:t,submissions:r,ifBlock:e}))return!0;return!1}else{for(let n of i)if(!eo({condition:n,context:t,submissions:r,ifBlock:e}))return!1;return!0}},du=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g,fu=(e,{context:t,submissions:r})=>e.replace(du,(i,n,a="")=>{let[o,...s]=n.trim().split("."),l=pn({key:o,path:s,submissions:r,context:t});if(!l)return a;switch(l.type){case"boolean":return l.value===!0?"true":"false";case"file":return l.value.map(d=>`${d.name} (${Vt(d.sizeKb)})`).join(", ");case"enum":return l.value.join(", ");case"address":return Object.values(l.value).filter(d=>d&&d.trim().length>0).join(", ");case"number":case"string":return l.value?l.value.toString():a;case"phone":return sr(l.value);case"integration":{if(typeof l.value!="object"||Array.isArray(l.value))break;let d=Mt(l.value,s);switch(typeof d){case"boolean":return d===!0?"true":"false";case"string":return d;case"number":return d.toString();case"object":if(Array.isArray(d)&&d.every(p=>typeof p=="string"))return d.join(", ")}break}}return a});const to=({context:e,submissions:t})=>({context:e,submissions:t??{}}),je=(e,t)=>fu(e,to(t)),pu=(e,t)=>Gt(e,to(t)),ro=({node:e,nodes:t,stopWhen:r})=>{if((r==null?void 0:r(e))===!0)return e;const i=e.nextId?t.find(n=>n.id===e.nextId):void 0;if(i)return ro({node:i,nodes:t,stopWhen:r})},hu=({childNode:e,nodes:t})=>{const i=t.filter(n=>n.type==="if-block").find(n=>{if(!n.branchId)return!1;const a=t.find(s=>s.id===n.branchId);if(!a)return!1;const o=ro({node:a,nodes:t,stopWhen:s=>s.id===e.id});return!(!o||o.id!==e.id)});if(i!=null&&i.nextId)return t.find(n=>n.id===i.nextId)},gu=({flow:e,analytics:t,logger:r,talentBankClient:i,context:n,apiClient:a,getSubmissions:o,getApplicationRecovery:s,setApplicationRecovery:l,chatService:d,persistWriteBarrier:p,onFlowEnd:u,onInterpret:h,t:b})=>{var A;let m=new AbortController;(A=e.data).startedWriteNodeIds??(A.startedWriteNodeIds=e.nodes.flatMap(v=>{var $,V;if(v.type!=="integration-application-submit"||!e.data.nodeHistory.includes(v.id))return[];const y=v.data.key?($=o())==null?void 0:$[v.data.key]:void 0;return(y==null?void 0:y.type)==="integration"&&((V=hn(y.value))==null?void 0:V.verdict)==="not_submitted"?[]:[v.id]}));const _={...t.service,log:v=>t.service.log({...v,customProperties:{...v.customProperties,...t.customProperties}})},I=async(v,y)=>{const S=m.signal;if(S.aborted)return;const $=o(),V=s(),q=(V==null?void 0:V.submitNodeId)===v.id?e.nodes.find(M=>{var C;return M.id===V.fileQuestionNodeId&&M.type==="question-file"&&((C=$==null?void 0:$[M.data.key])==null?void 0:C.type)!=="file"}):void 0;if(q)return I(q,y);h==null||h(v,y);try{await bu({flow:e,analytics:_,logger:r,talentBankClient:i,apiClient:a,context:n,node:v,submissions:$,applicationRecovery:V,setApplicationRecovery:async M=>{if(!S.aborted)try{await l(M)}catch(C){r.error("Failed to persist application recovery",C)}},forceSubmitConfirmation:(V==null?void 0:V.submitNodeId)===v.id,persistWriteBarrier:p,signal:S,t:b,chat:{sendMessage:async M=>d.send({groupId:v.id,message:M,signal:S}),userInput:async M=>d.input({input:M,signal:S}),setSubmission:(M,C)=>{S.aborted||d.setSubmission(M,C)}},next:M=>{if(S.aborted)return;const C=(V==null?void 0:V.fileQuestionNodeId)===v.id?V.submitNodeId:M,R=C?e.nodes.find(oe=>oe.id===C):hu({childNode:v,nodes:e.nodes});return R?I(R,v):u==null?void 0:u(v)},end:()=>{S.aborted||u==null||u(v)}})}catch(M){if(M instanceof gt)return;throw M}};return{interpret:async v=>{const y=e.nodes.find(S=>S.id===v)??Ra(e.nodes);return I(y)},undo:v=>{var C;if((C=e.data.startedWriteNodeIds)!=null&&C.length||e.data.isFinished)return{removed:0};const y=Ai(e),S=y?v.lastIndexOf(y):-1,$=e.nodes.find(R=>R.id===y);if(S===-1||!$)return{removed:0};const V=e.nodes.find(R=>R.id===v[v.length-1]);m.abort();const q=v.splice(S);e.data.messages=e.data.messages.filter(R=>!R.groupId||!q.includes(R.groupId)),e.data.currentInput=null;const M=o();for(const R of q.slice(1)){const oe=e.nodes.find(P=>P.id===R);if(!(!oe||!M||oe.id===y)&&("key"in oe.data&&oe.data.key&&delete M[oe.data.key],"keys"in oe.data))for(const P of Object.values(oe.data.keys))typeof P=="string"&&delete M[P]}return m=new AbortController,I($,V),{removed:q.length}},abort:()=>{m.abort()}}};async function bu(e){const t=e.node;switch(t.type){case"flow-section":return await e.chat.sendMessage({type:"system",variant:"info",text:t.data.title}),e.next(t.nextId);case"pre-apply-result":return Vu({...e,node:t});case"text":return Cu({...e,node:t});case"image":return $u({...e,node:t});case"question-text":return Eu({...e,node:t});case"question-enum":return Fu({...e,node:t});case"question-number":return Iu({...e,node:t});case"question-phone":return Au({...e,node:t});case"question-boolean":return Nu({...e,node:t});case"question-file":return Du({...e,node:t});case"question-address":return Tu({...e,node:t});case"end-flow":return Mu({...e,node:t});case"if-block":return Su({...e,node:t});case"jump":return mu({...e,node:t});case"link":return ku({...e,node:t});case"integration-application-submit":return xu({...e,node:t});case"add-submission":return yu({...e,node:t});case"integration-workflow-get":throw Error("Workflow should be unreachable");case"check-duplicate":return wu({...e,node:t});case"feedback":return vu({...e,node:t});default:throw new Error(`Unknown node: ${JSON.stringify(t)}`)}}async function vu({next:e,node:t}){e(t.nextId)}async function wu({next:e,node:t,talentBankClient:r,submissions:i,flow:n,logger:a,chat:o}){var l;let s={isDuplicate:!1};if(i&&r){const d=t.data.scope==="job"?(l=n.job)==null?void 0:l.id:void 0;if(t.data.scope==="company"||d!=null)try{s=await r.checkDuplicate({email:xs({key:t.data.email,submissions:i}).toString(),jobId:d,scope:t.data.scope})}catch(p){a.error("[check-duplicate]",p)}}o.setSubmission(t.data.key,{type:"integration",value:s}),e(t.nextId)}async function mu({next:e,node:t}){e(t.data.targetId)}async function yu({next:e,node:t,logger:r,submissions:i,context:n}){if(!i){r.error("Submissions not found");return}i[t.data.key]={type:"string",value:je(t.data.value,{submissions:i,context:n})},e(t.nextId)}const _u=5e3;async function xu({chat:e,next:t,end:r,node:i,logger:n,apiClient:a,submissions:o,analytics:s,flow:l,applicationRecovery:d,setApplicationRecovery:p,forceSubmitConfirmation:u,persistWriteBarrier:h,signal:b,t:m}){var I;if((I=l.data.startedWriteNodeIds)!=null&&I.includes(i.id)&&(d==null?void 0:d.submitNodeId)!==i.id)return await e.sendMessage({type:"system",variant:"warning",text:m("submission_unknown")}),r();const _=async A=>{var B,Z,ae,me;A!==!0&&await e.userInput({type:"submit",key:void 0,config:{label:i.data.submitLabel}}),await e.sendMessage({type:"loading",text:m("submitting")});const{anonymous_id:v,session_id:y}=s.getSessionInfo();if(b.aborted)return;const S=((B=l.data.startedWriteNodeIds)==null?void 0:B.includes(i.id))===!0;if((d==null?void 0:d.submitNodeId)===i.id&&await p(void 0),S||(l.data.startedWriteNodeIds=[...l.data.startedWriteNodeIds??[],i.id]),await h().catch(L=>n.error("Failed to persist application write barrier",L)),b.aborted)return;let $;const V=setTimeout(()=>{$=(async()=>{await e.sendMessage({type:"text",author:"bot",text:m("submission_still_working")}),await e.sendMessage({type:"loading",text:m("submitting")})})().catch(L=>n.error("Failed to send submission progress message",L))},_u);let q;const M=await a.fetch("/flow/submit",{method:"POST",body:JSON.stringify({log_submit:!1,integration_id:i.data.integrationId,anonymous_id:v,session_id:y,job:l.job,flow_build:l.build,submissions:ys(l.nodes,_s(o||{},i.data.submitKeys)),pre_apply:Rr(l.nodes,o||{},l.data.flowSessionId)})}).catch(L=>(q=L,js(L)?L.data:L));if(clearTimeout(V),await $,b.aborted)return;i.data.key&&e.setSubmission(i.data.key,{type:"integration",value:M});const C=hn(M,q instanceof yn?q.status:void 0),R=l.job?`${i.id}@${l.job.id_type}:${l.job.id}`:i.id,oe=((Z=l.data.unconfirmedAttemptKeys)==null?void 0:Z.includes(R))===!0,P=As(M);if(P&&s.log({event:"FLOW_SUBMIT",properties:{flow_id:l.id,flow_version:l.version,flow_session_id:l.data.flowSessionId,flow_build:l.build,service:P.service,response:P.response,flow_type:"CHATBOT_DRAWER",job:l.job,...(C==null?void 0:C.outcome)==="duplicate"&&{outcome:oe?"duplicate_after_own_attempt":"duplicate"}}}),$s(M)){const{redirect_url:L,message:Te,button_text:ze}=M.integration_response.data;await e.sendMessage({type:"text",author:"bot",text:Te??m("submission_redirect_message")});try{const Ie=new URL(L);v&&!Ie.searchParams.has("anonymous_id")&&Ie.searchParams.set("anonymous_id",v),await e.sendMessage({type:"link",href:Ie.toString(),text:ze??m("complete_submission"),onClick:()=>{if(!y){n.error("session_id not set, cannot log FLOW_REDIRECT event");return}s.log({event:"FLOW_REDIRECT",properties:{flow_build:l.build,flow_id:l.id,flow_session_id:y,flow_version:l.version,href:Ie.toString(),job:l.job}})}})}catch(Ie){n.error(`Invalid redirect URL: ${L}`,Ie),e.sendMessage({type:"system",variant:"error",text:m("redirect_url_error")})}return t(i.nextId)}if((M==null?void 0:M.success)===!0)return i.data.skipConfirmation!==!0&&await e.sendMessage({type:"system",variant:"success",text:m("submission_completed")}),t(i.nextId);if((C==null?void 0:C.verdict)==="not_submitted"||(C==null?void 0:C.outcome)==="duplicate"||(C==null?void 0:C.outcome)==="closed"?(S||(l.data.startedWriteNodeIds=(ae=l.data.startedWriteNodeIds)==null?void 0:ae.filter(L=>L!==i.id)),(d==null?void 0:d.submitNodeId)===i.id&&await p(d),await h().catch(L=>n.error("Failed to persist application write barrier release",L))):(C==null?void 0:C.verdict)!=="confirmed"&&!oe&&(l.data.unconfirmedAttemptKeys=[...l.data.unconfirmedAttemptKeys??[],R],await h().catch(L=>n.error("Failed to persist unconfirmed attempt",L))),C){n.error(q??C.message);const L=C.phase==="submit"&&C.verdict==="confirmed"&&C.code==="unreadable_document"&&typeof C.field=="string"&&C.status!==void 0&&C.status>=400&&C.status<500&&((me=o==null?void 0:o[C.field])==null?void 0:me.type)==="file"?C.field:void 0,Te=L===void 0?void 0:l.nodes.find(ze=>ze.type==="question-file"&&ze.data.key===L);return Te&&L!==void 0?(e.setSubmission(L,null),await p({fileQuestionNodeId:Te.id,submitNodeId:i.id}),await e.sendMessage({type:"system",variant:"error",text:m("submission_unreadable_document")}),t(Te.id)):C.outcome==="duplicate"?(await e.sendMessage({type:"system",variant:"info",text:m(oe?"submission_duplicate_earlier_attempt":"submission_duplicate")}),_(!1)):C.outcome==="closed"?(await e.sendMessage({type:"system",variant:"info",text:m("submission_closed")}),_(!1)):C.outcome==="unknown"?(await e.sendMessage({type:"system",variant:"warning",text:m("submission_unknown")}),_(!1)):(C.phase==="workflow"||C.phase==="authentication")&&C.retryable===!0&&C.verdict==="not_submitted"?(await e.sendMessage({type:"system",variant:"error",text:m("submission_retryable")}),_(!1)):(await e.sendMessage({type:"system",variant:"error",text:m("submission_failed")}),r())}return n.error(q??M),await e.sendMessage({type:"system",variant:"error",text:m("submission_failed")}),r()};await _(u===!0?!1:i.data.skipConfirmation)}async function ku({chat:e,next:t,node:r,submissions:i,context:n}){await e.sendMessage({type:"link",href:je(r.data.href,{submissions:i,context:n}),text:je(r.data.cta,{submissions:i,context:n})}),t(r.nextId)}async function Su({submissions:e,next:t,node:r,context:i}){t(pu(r,{submissions:e,context:i})?r.branchId:r.nextId)}async function Cu({chat:e,next:t,node:r,submissions:i,context:n}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.text,{submissions:i,context:n})}),t(r.nextId)}async function $u({chat:e,next:t,node:r}){await e.sendMessage({author:"bot",type:"image",url:r.data.url,height:r.data.height,width:r.data.width}),t(r.nextId)}async function Eu({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=r.data.format==="phone"?await e.userInput({key:r.data.key,type:"phone",config:{optional:r.data.optional,placeholder:r.data.placeholder,minChars:r.data.minChars,maxChars:r.data.maxChars,submissionFormat:"text",defaultValue:{}}}):await e.userInput({key:r.data.key,type:"text",config:{optional:r.data.optional,placeholder:r.data.placeholder,format:r.data.format,maxChars:r.data.maxChars,minChars:r.data.minChars}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.type==="phone"?sr(o.value):o.value}),t(r.nextId)}async function Iu({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=await e.userInput({key:r.data.key,type:"number",config:{max:r.data.max,min:r.data.min,optional:r.data.optional,placeholder:r.data.placeholder,decimalCases:r.data.decimalCases}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.value.toString()}),t(r.nextId)}async function Au({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=await e.userInput({key:r.data.key,type:"phone",config:{minChars:r.data.minChars,defaultValue:{countryCode:r.data.defaultCountryCode},placeholder:r.data.placeholder,submissionFormat:"phone",optional:r.data.optional}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.type==="phone"?sr(o.value):o.value}),t(r.nextId)}async function Fu({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=await e.userInput({key:r.data.key,type:"multiple-choice",config:r.data});o.value.length===0?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:r.data.options.filter(s=>o.value.includes(s.value)).map(s=>s.label).join(", ")}),t(r.nextId)}async function Nu({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=await e.userInput({key:r.data.key,type:"boolean",config:{optional:r.data.optional,labels:{true:r.data.trueLabel,false:r.data.falseLabel}}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.value===!0?r.data.trueLabel:r.data.falseLabel}),t(r.nextId)}async function Tu({chat:e,next:t,node:r,t:i}){await e.sendMessage({author:"bot",type:"text",text:r.data.question});const n=await e.userInput({type:"address",key:r.data.key,config:{optional:r.data.optional,keys:r.data.keys,placeholder:r.data.placeholder}});if(n===null)await e.sendMessage({type:"system",variant:"info",text:i("skipped")});else{const a=Object.values(n.value).filter(o=>o&&o.trim().length>0).join(", ");await e.sendMessage({author:"user",type:"text",text:a})}return t(r.nextId)}async function Du({node:e,chat:t,next:r,submissions:i,context:n,t:a}){await t.sendMessage({author:"bot",type:"text",text:je(e.data.question,{submissions:i,context:n})});const o=await t.userInput({key:e.data.key,type:"file",config:{optional:e.data.optional,extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb??10*1024,allowMultiple:e.data.multiple===!0}});if(o===null)await t.sendMessage({type:"system",variant:"info",text:a("skipped")});else for(const s of o.value)await t.sendMessage({author:"user",type:"file",fileName:s.name,fileSizeKb:s.sizeKb});return r(e.nextId)}async function Mu({chat:e,end:t,node:r}){await e.sendMessage({type:"system",variant:"info",text:r.data.systemMessage}),t()}async function Vu({node:e,flow:t,submissions:r,chat:i,next:n,apiClient:a,analytics:o}){const s=ms(t.nodes,r||{}),{answers:l,...d}=s;i.setSubmission(e.data.key,{type:"integration",value:d});const p=new AbortController,u=setTimeout(()=>p.abort(),5e3);if(a.fetch("/flow/pre-apply",{method:"POST",signal:p.signal,body:JSON.stringify({...o.getSessionInfo(),job:t.job,flow_build:t.build,pre_apply:Rr(t.nodes,r||{},t.data.flowSessionId)})}).catch(()=>{}).finally(()=>clearTimeout(u)),s.status!=="skipped"){const b=[s.status==="unavailable"?"We could not prepare your pre-apply summary. You can still continue to your application.":s.hasHardConcerns?e.data.messages.hard:s.hasAdvisoryConcerns?e.data.messages.advisory:e.data.messages.matched];for(const m of["hard","advisory"]){const _=l.filter(I=>!I.matched&&I.severity===m);_.length&&b.push((m==="hard"?"Role requirements":"Other things to consider")+`
6
- `+_.map(I=>`• ${I.message}`).join(`
5
+ }`},pu=({_internal_domManager:e=Jc(),theme:t,terms:r,feedback:i})=>Rs(({apiClient:n,rpcClient:a,logger:o,analytics:s,publishableKey:l,env:d})=>{let p=!1,u=0;const h=wc({locale:void 0,overrides:r??{}}),b=l&&d?ul({environment:d,publishableKey:l,logger:o}):void 0,m=v=>v===u,k=()=>{if(typeof window>"u")return;u++,Oe.flushStateData().catch(()=>{}),D.cancelCurrentFlow(),ae.isBotTyping$.value=!1;const v=e.getChatbotElement();v&&(ht(null,v),v.remove()),p=!1,o.info("Chatbot plugin destroyed")},A=()=>{if(typeof window>"u")return;const v=u,y=[xe("style",{id:"inploi-chatbot-styles"},Yc),xe("style",{id:"inploi-chatbot-theme"},fu(t))],S=e.getOrCreateChatbotElement();if(ht(xe(ee,{},[y,xe(Kc,{apiClient:n,logger:o,analytics:s,talentBankClient:b,params:{theme:t,terms:r,feedback:i}})]),S),i){const E=M=>{var V,O;if(!m(v))return;const R=(V=e.getChatbotElement())==null?void 0:V.querySelector("dialog");R&&hu({instance:M({rpcClient:a,apiClient:n,logger:o,analytics:s}),theme:t,terms:((O=i.params)==null?void 0:O.terms)??{},host:R})};i.plugin instanceof Promise?i.plugin.then(({feedbackPlugin:M})=>{E(M())}).catch(M=>{o.error("Error preparing feedback plugin",M)}):E(i.plugin)}p=!0},x=async(v,y)=>{if(!m(y))return;Ms({context:v.context||{},schema:v.flow.context_schema,logger:o});const S=await D.prepareFlow(v);m(y)&&D.commitFlow(S)};return{prepare:async()=>{if(!(typeof window>"u"))try{if(p)return;A(),o.info("Chatbot plugin prepared")}catch(v){o.error("Error preparing chatbot plugin",v)}},fetchFlowByJobId:async(v,y)=>a.request(ru,{params:{id:v},searchParams:{id_type:(y==null?void 0:y.idType)==="inploi"?"internal":"external"}}).then(S=>({flow:S.flow,title:S.job.title,flowKeys:[S.job.id,...(y==null?void 0:y.flowKeys)??[]],job:{id:S.job.id,id_type:"external"},...y,context:{user:S.user,...y==null?void 0:y.context}})),fetchFlowById:async(v,y)=>a.request(iu,{params:{id:v}}).then(S=>{var E;return{flow:S.flow,title:"Chatbot",flowKeys:(y==null?void 0:y.flowKeys)??[],...y,analytics:{customProperties:{flow_id:S.flow.id,flow_version:S.flow.version,...(E=y==null?void 0:y.analytics)==null?void 0:E.customProperties}}}}),open:async v=>{if(!(typeof window>"u"))try{D.cancelCurrentFlow(),D.viewState$.value="maximised",p||A();const y=u;v instanceof Promise?(D.current$.value={state:"loading"},v.then(S=>x(S,y)).catch(S=>{if(!m(y))return;const E=S instanceof Error?S.message:h("unknown_error");D.current$.value={state:"error",error:E}})):await x(v,y)}catch(y){o.error("Error starting flow",y)}},close:async()=>{typeof window>"u"||(D.cancelCurrentFlow(),o.info("Closed flow from an external source"))},destroy:k}});function hu({instance:e,terms:t,theme:r,host:i}){e.render({key:"chatbot-header",size:"sm",theme:{accent:{chroma:r.chroma??1,hue:r.hue},positive:{hue:180,chroma:1},negative:{hue:33,chroma:1},mode:r.mode,corners:"rounded",highlights:"stroke"},terms:t,host:i})}if(!window.inploi)throw new Error("Please insert the SDK script tag above the plugins.");window.inploi.chatbotPlugin=pu;const oo=(e,t,r)=>{var i;return e.log({event:r,properties:{flow_id:t.id,flow_version:t.version,flow_session_id:t.data.flowSessionId,flow_build:t.build,flow_type:"CHATBOT_DRAWER",job:t.job},customProperties:(i=t.analytics)==null?void 0:i.customProperties})};var so=({condition:e,context:t,submissions:r,ifBlock:i})=>{let[n,...a]=e.compareKey.split(".");if(!n)return!1;let o=mn({context:t,key:n,path:a,submissions:r});if(!o)return!1;switch(o.type){case"address":{let s=Pt(o.value,a);switch(e.compare){case"equals":return s===e.compareValue;case"contains":return typeof s!="string"?!1:s.includes(e.compareValue);case"notEquals":return s!==e.compareValue;case"notContains":return typeof s!="string"?!0:!s.includes(e.compareValue)}break}case"integration":{if(typeof o.value!="object"||Array.isArray(o.value))return!1;let s=Pt(o.value,a),l={...i,data:{compareKey:"_temp",compare:e.compare,compareValue:e.compareValue}};switch(typeof s){case"boolean":return Jt(l,{submissions:{_temp:{value:s,type:"boolean"}},context:t});case"string":return Jt(l,{submissions:{_temp:{value:s,type:"string"}},context:t});case"number":return Jt(l,{submissions:{_temp:{value:s,type:"number"}},context:t});case"object":return Array.isArray(s)&&s.every(d=>typeof d=="string")?Jt(l,{submissions:{_temp:{value:s,type:"enum"}},context:t}):!1}break}case"boolean":{let s=e.compareValue==="true";switch(e.compare){case"equals":return o.value===s;case"notEquals":return o.value!==s}break}case"phone":case"string":{let s=o.type==="phone"?ur(o.value):o.value;switch(e.compare){case"equals":return s===e.compareValue;case"contains":return s?s.includes(e.compareValue):!1;case"notEquals":return s!==e.compareValue;case"notContains":return s?!s.includes(e.compareValue):!0}break}case"number":{try{let s=Number(e.compareValue);switch(e.compare){case"equals":return o.value===s;case"notEquals":return o.value!==s;case"greaterThan":return o.value>s;case"greaterThanOrEqualTo":return o.value>=s;case"lessThan":return o.value<s;case"lessThanOrEqualTo":return o.value<=s}}catch{return console.error(`Failed to parse number in if-block ${i.id}`,o.value),!1}break}case"enum":switch(e.compare){case"equals":return o.value.length===1&&o.value[0]===e.compareValue;case"notEquals":return o.value.length===1&&o.value[0]!==e.compareValue;case"contains":return o.value.includes(e.compareValue);case"notContains":return!o.value.includes(e.compareValue)}break}},Jt=(e,{context:t,submissions:r})=>{let i="combinator"in e.data?e.data.conditions:[e.data];if(("combinator"in e.data?e.data.combinator:"and")==="or"){for(let n of i)if(so({condition:n,context:t,submissions:r,ifBlock:e}))return!0;return!1}else{for(let n of i)if(!so({condition:n,context:t,submissions:r,ifBlock:e}))return!1;return!0}},gu=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g,bu=(e,{context:t,submissions:r})=>e.replace(gu,(i,n,a="")=>{let[o,...s]=n.trim().split("."),l=mn({key:o,path:s,submissions:r,context:t});if(!l)return a;switch(l.type){case"boolean":return l.value===!0?"true":"false";case"file":return l.value.map(d=>`${d.name} (${Ot(d.sizeKb)})`).join(", ");case"enum":return l.value.join(", ");case"address":return Object.values(l.value).filter(d=>d&&d.trim().length>0).join(", ");case"number":case"string":return l.value?l.value.toString():a;case"phone":return ur(l.value);case"integration":{if(typeof l.value!="object"||Array.isArray(l.value))break;let d=Pt(l.value,s);switch(typeof d){case"boolean":return d===!0?"true":"false";case"string":return d;case"number":return d.toString();case"object":if(Array.isArray(d)&&d.every(p=>typeof p=="string"))return d.join(", ")}break}}return a});const lo=({context:e,submissions:t})=>({context:e,submissions:t??{}}),je=(e,t)=>bu(e,lo(t)),vu=(e,t)=>Jt(e,lo(t)),co=({node:e,nodes:t,stopWhen:r})=>{if((r==null?void 0:r(e))===!0)return e;const i=e.nextId?t.find(n=>n.id===e.nextId):void 0;if(i)return co({node:i,nodes:t,stopWhen:r})},wu=({childNode:e,nodes:t})=>{const i=t.filter(n=>n.type==="if-block").find(n=>{if(!n.branchId)return!1;const a=t.find(s=>s.id===n.branchId);if(!a)return!1;const o=co({node:a,nodes:t,stopWhen:s=>s.id===e.id});return!(!o||o.id!==e.id)});if(i!=null&&i.nextId)return t.find(n=>n.id===i.nextId)},mu=({flow:e,analytics:t,logger:r,talentBankClient:i,context:n,apiClient:a,getSubmissions:o,getApplicationRecovery:s,setApplicationRecovery:l,chatService:d,persistWriteBarrier:p,onFlowEnd:u,onInterpret:h,t:b})=>{var x;let m=new AbortController;(x=e.data).startedWriteNodeIds??(x.startedWriteNodeIds=e.nodes.flatMap(v=>{var E,M;if(v.type!=="integration-application-submit"||!e.data.nodeHistory.includes(v.id))return[];const y=v.data.key?(E=o())==null?void 0:E[v.data.key]:void 0;return(y==null?void 0:y.type)==="integration"&&((M=_n(y.value))==null?void 0:M.verdict)==="not_submitted"?[]:[v.id]}));const k={...t.service,log:v=>t.service.log({...v,customProperties:{...v.customProperties,...t.customProperties}})},A=async(v,y)=>{const S=m.signal;if(S.aborted)return;const E=o(),M=s(),R=(M==null?void 0:M.submitNodeId)===v.id?e.nodes.find(V=>{var O;return V.id===M.fileQuestionNodeId&&V.type==="question-file"&&((O=E==null?void 0:E[V.data.key])==null?void 0:O.type)!=="file"}):void 0;if(R)return A(R,y);h==null||h(v,y);try{await yu({flow:e,analytics:k,logger:r,talentBankClient:i,apiClient:a,context:n,node:v,submissions:E,applicationRecovery:M,setApplicationRecovery:async V=>{if(!S.aborted)try{await l(V)}catch(O){r.error("Failed to persist application recovery",O)}},forceSubmitConfirmation:(M==null?void 0:M.submitNodeId)===v.id,persistWriteBarrier:p,signal:S,t:b,chat:{sendMessage:async V=>d.send({groupId:v.id,message:V,signal:S}),userInput:async V=>d.input({input:V,signal:S}),setSubmission:(V,O)=>{S.aborted||d.setSubmission(V,O)}},next:V=>{if(S.aborted)return;const O=(M==null?void 0:M.fileQuestionNodeId)===v.id?M.submitNodeId:V,L=O?e.nodes.find(K=>K.id===O):wu({childNode:v,nodes:e.nodes});return L?A(L,v):u==null?void 0:u(v)},end:()=>{S.aborted||u==null||u(v)}})}catch(V){if(V instanceof vt)return;throw V}};return{interpret:async v=>{const y=e.nodes.find(S=>S.id===v)??Ga(e.nodes);return A(y)},undo:v=>{var O;if((O=e.data.startedWriteNodeIds)!=null&&O.length||e.data.isFinished)return{removed:0};const y=Vi(e),S=y?v.lastIndexOf(y):-1,E=e.nodes.find(L=>L.id===y);if(S===-1||!E)return{removed:0};const M=e.nodes.find(L=>L.id===v[v.length-1]);m.abort();const R=v.splice(S);e.data.messages=e.data.messages.filter(L=>!L.groupId||!R.includes(L.groupId)),e.data.currentInput=null;const V=o();for(const L of R.slice(1)){const K=e.nodes.find($=>$.id===L);if(!(!K||!V||K.id===y)&&("key"in K.data&&K.data.key&&delete V[K.data.key],"keys"in K.data))for(const $ of Object.values(K.data.keys))typeof $=="string"&&delete V[$]}return m=new AbortController,A(E,M),{removed:R.length}},abort:()=>{m.abort()}}};async function yu(e){const t=e.node;switch(t.type){case"flow-section":return await e.chat.sendMessage({type:"system",variant:"info",text:t.data.title}),e.next(t.nextId);case"pre-apply-result":return ju({...e,node:t});case"text":return Au({...e,node:t});case"image":return Nu({...e,node:t});case"question-text":return Fu({...e,node:t});case"question-enum":return Mu({...e,node:t});case"question-number":return Tu({...e,node:t});case"question-phone":return Du({...e,node:t});case"question-boolean":return Vu({...e,node:t});case"question-file":return Ou({...e,node:t});case"question-address":return Pu({...e,node:t});case"end-flow":return Lu({...e,node:t});case"if-block":return Iu({...e,node:t});case"jump":return ku({...e,node:t});case"link":return Eu({...e,node:t});case"integration-application-submit":return $u({...e,node:t});case"add-submission":return Su({...e,node:t});case"integration-workflow-get":throw Error("Workflow should be unreachable");case"check-duplicate":return xu({...e,node:t});case"feedback":return _u({...e,node:t});default:throw new Error(`Unknown node: ${JSON.stringify(t)}`)}}async function _u({next:e,node:t}){e(t.nextId)}async function xu({next:e,node:t,talentBankClient:r,submissions:i,flow:n,logger:a,chat:o}){var l;let s={isDuplicate:!1};if(i&&r){const d=t.data.scope==="job"?(l=n.job)==null?void 0:l.id:void 0;if(t.data.scope==="company"||d!=null)try{s=await r.checkDuplicate({email:Es({key:t.data.email,submissions:i}).toString(),jobId:d,scope:t.data.scope})}catch(p){a.error("[check-duplicate]",p)}}o.setSubmission(t.data.key,{type:"integration",value:s}),e(t.nextId)}async function ku({next:e,node:t}){e(t.data.targetId)}async function Su({next:e,node:t,logger:r,submissions:i,context:n}){if(!i){r.error("Submissions not found");return}i[t.data.key]={type:"string",value:je(t.data.value,{submissions:i,context:n})},e(t.nextId)}const Cu=5e3,uo=3e4;async function $u({chat:e,next:t,end:r,node:i,logger:n,apiClient:a,submissions:o,analytics:s,flow:l,applicationRecovery:d,setApplicationRecovery:p,forceSubmitConfirmation:u,persistWriteBarrier:h,signal:b,t:m}){var x;if((x=l.data.startedWriteNodeIds)!=null&&x.includes(i.id)&&(d==null?void 0:d.submitNodeId)!==i.id)return await e.sendMessage({type:"system",variant:"warning",text:m("submission_unknown")}),r();const k=l.job?`${i.id}@${l.job.id_type}:${l.job.id}`:i.id,A=async v=>{var de,st,lt,ct,ar;const y=((de=l.data.submitCooldown)==null?void 0:de.key)===k?l.data.submitCooldown:void 0;y&&(y.until=Math.min(y.until,Date.now()+uo));const S=y==null?void 0:y.until;(v!==!0||S!==void 0&&S>Date.now())&&await e.userInput({type:"submit",key:void 0,config:{label:i.data.submitLabel,...S!==void 0&&{availableAt:S}}}),await e.sendMessage({type:"loading",text:m("submitting")});const{anonymous_id:E,session_id:M}=s.getSessionInfo();if(b.aborted)return;const R=((st=l.data.startedWriteNodeIds)==null?void 0:st.includes(i.id))===!0;if((d==null?void 0:d.submitNodeId)===i.id&&await p(void 0),R||(l.data.startedWriteNodeIds=[...l.data.startedWriteNodeIds??[],i.id]),await h().catch(J=>n.error("Failed to persist application write barrier",J)),b.aborted)return;let V;const O=setTimeout(()=>{V=(async()=>{await e.sendMessage({type:"text",author:"bot",text:m("submission_still_working")}),await e.sendMessage({type:"loading",text:m("submitting")})})().catch(J=>n.error("Failed to send submission progress message",J))},Cu);let L;const K=await a.fetch("/flow/submit",{method:"POST",body:JSON.stringify({log_submit:!1,integration_id:i.data.integrationId,anonymous_id:E,session_id:M,job:l.job,flow_build:l.build,submissions:Cs(l.nodes,$s(o||{},i.data.submitKeys)),pre_apply:Gr(l.nodes,o||{},l.data.flowSessionId)})}).catch(J=>(L=J,Us(J)?J.data:J));if(clearTimeout(O),await V,b.aborted)return;i.data.key&&e.setSubmission(i.data.key,{type:"integration",value:K});const $=_n(K,L instanceof En?L.status:void 0),B=((lt=l.data.unconfirmedAttemptKeys)==null?void 0:lt.includes(k))===!0,Z=Ds(K);if(Z&&s.log({event:"FLOW_SUBMIT",properties:{flow_id:l.id,flow_version:l.version,flow_session_id:l.data.flowSessionId,flow_build:l.build,service:Z.service,response:Z.response,flow_type:"CHATBOT_DRAWER",job:l.job,...($==null?void 0:$.outcome)==="duplicate"&&{outcome:B?"duplicate_after_own_attempt":"duplicate"}}}),Ns(K)){const{redirect_url:J,message:an,button_text:Br}=K.integration_response.data;await e.sendMessage({type:"text",author:"bot",text:an??m("submission_redirect_message")});try{const ut=new URL(J);E&&!ut.searchParams.has("anonymous_id")&&ut.searchParams.set("anonymous_id",E),await e.sendMessage({type:"link",href:ut.toString(),text:Br??m("complete_submission"),onClick:()=>{if(!M){n.error("session_id not set, cannot log FLOW_REDIRECT event");return}s.log({event:"FLOW_REDIRECT",properties:{flow_build:l.build,flow_id:l.id,flow_session_id:M,flow_version:l.version,href:ut.toString(),job:l.job}})}})}catch(ut){n.error(`Invalid redirect URL: ${J}`,ut),e.sendMessage({type:"system",variant:"error",text:m("redirect_url_error")})}return t(i.nextId)}if((K==null?void 0:K.success)===!0)return i.data.skipConfirmation!==!0&&await e.sendMessage({type:"system",variant:"success",text:m("submission_completed")}),t(i.nextId);const Q=($==null?void 0:$.phase)==="submit"&&$.verdict==="confirmed"&&$.code==="unreadable_document"&&typeof $.field=="string"&&$.status!==void 0&&$.status>=400&&$.status<500&&((ct=o==null?void 0:o[$.field])==null?void 0:ct.type)==="file"?$.field:void 0,ue=Q===void 0?void 0:l.nodes.find(J=>J.type==="question-file"&&J.data.key===Q);return ue||(l.data.submitCooldown={key:k,until:Date.now()+uo}),($==null?void 0:$.verdict)==="not_submitted"||($==null?void 0:$.outcome)==="duplicate"||($==null?void 0:$.outcome)==="closed"?(R||(l.data.startedWriteNodeIds=(ar=l.data.startedWriteNodeIds)==null?void 0:ar.filter(J=>J!==i.id)),(d==null?void 0:d.submitNodeId)===i.id&&await p(d),await h().catch(J=>n.error("Failed to persist application write barrier release",J))):($==null?void 0:$.verdict)!=="confirmed"&&!B?(l.data.unconfirmedAttemptKeys=[...l.data.unconfirmedAttemptKeys??[],k],await h().catch(J=>n.error("Failed to persist unconfirmed attempt",J))):await h().catch(J=>n.error("Failed to persist submit cooldown",J)),$?(n.error(L??$.message),ue&&Q!==void 0?(e.setSubmission(Q,null),await p({fileQuestionNodeId:ue.id,submitNodeId:i.id}),await e.sendMessage({type:"system",variant:"error",text:m("submission_unreadable_document")}),t(ue.id)):$.outcome==="duplicate"?(await e.sendMessage({type:"system",variant:"info",text:m(B?"submission_duplicate_earlier_attempt":"submission_duplicate")}),A(!1)):$.outcome==="closed"?(await e.sendMessage({type:"system",variant:"info",text:m("submission_closed")}),A(!1)):$.outcome==="unknown"?(await e.sendMessage({type:"system",variant:"warning",text:m("submission_unknown")}),A(!1)):($.phase==="workflow"||$.phase==="authentication")&&$.retryable===!0&&$.verdict==="not_submitted"?(await e.sendMessage({type:"system",variant:"error",text:m("submission_retryable")}),A(!1)):(await e.sendMessage({type:"system",variant:"error",text:m("submission_failed")}),r())):(n.error(L??K),await e.sendMessage({type:"system",variant:"error",text:m("submission_failed")}),r())};await A(u===!0?!1:i.data.skipConfirmation)}async function Eu({chat:e,next:t,node:r,submissions:i,context:n}){await e.sendMessage({type:"link",href:je(r.data.href,{submissions:i,context:n}),text:je(r.data.cta,{submissions:i,context:n})}),t(r.nextId)}async function Iu({submissions:e,next:t,node:r,context:i}){t(vu(r,{submissions:e,context:i})?r.branchId:r.nextId)}async function Au({chat:e,next:t,node:r,submissions:i,context:n}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.text,{submissions:i,context:n})}),t(r.nextId)}async function Nu({chat:e,next:t,node:r}){await e.sendMessage({author:"bot",type:"image",url:r.data.url,height:r.data.height,width:r.data.width}),t(r.nextId)}async function Fu({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=r.data.format==="phone"?await e.userInput({key:r.data.key,type:"phone",config:{optional:r.data.optional,placeholder:r.data.placeholder,minChars:r.data.minChars,maxChars:r.data.maxChars,submissionFormat:"text",defaultValue:{}}}):await e.userInput({key:r.data.key,type:"text",config:{optional:r.data.optional,placeholder:r.data.placeholder,format:r.data.format,maxChars:r.data.maxChars,minChars:r.data.minChars}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.type==="phone"?ur(o.value):o.value}),t(r.nextId)}async function Tu({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=await e.userInput({key:r.data.key,type:"number",config:{max:r.data.max,min:r.data.min,optional:r.data.optional,placeholder:r.data.placeholder,decimalCases:r.data.decimalCases}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.value.toString()}),t(r.nextId)}async function Du({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=await e.userInput({key:r.data.key,type:"phone",config:{minChars:r.data.minChars,defaultValue:{countryCode:r.data.defaultCountryCode},placeholder:r.data.placeholder,submissionFormat:"phone",optional:r.data.optional}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.type==="phone"?ur(o.value):o.value}),t(r.nextId)}async function Mu({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=await e.userInput({key:r.data.key,type:"multiple-choice",config:r.data});o.value.length===0?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:r.data.options.filter(s=>o.value.includes(s.value)).map(s=>s.label).join(", ")}),t(r.nextId)}async function Vu({chat:e,next:t,node:r,submissions:i,context:n,t:a}){await e.sendMessage({author:"bot",type:"text",text:je(r.data.question,{submissions:i,context:n})});const o=await e.userInput({key:r.data.key,type:"boolean",config:{optional:r.data.optional,labels:{true:r.data.trueLabel,false:r.data.falseLabel}}});o===null?await e.sendMessage({type:"system",variant:"info",text:a("skipped")}):await e.sendMessage({author:"user",type:"text",text:o.value===!0?r.data.trueLabel:r.data.falseLabel}),t(r.nextId)}async function Pu({chat:e,next:t,node:r,t:i}){await e.sendMessage({author:"bot",type:"text",text:r.data.question});const n=await e.userInput({type:"address",key:r.data.key,config:{optional:r.data.optional,keys:r.data.keys,placeholder:r.data.placeholder}});if(n===null)await e.sendMessage({type:"system",variant:"info",text:i("skipped")});else{const a=Object.values(n.value).filter(o=>o&&o.trim().length>0).join(", ");await e.sendMessage({author:"user",type:"text",text:a})}return t(r.nextId)}async function Ou({node:e,chat:t,next:r,submissions:i,context:n,t:a}){await t.sendMessage({author:"bot",type:"text",text:je(e.data.question,{submissions:i,context:n})});const o=await t.userInput({key:e.data.key,type:"file",config:{optional:e.data.optional,extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb??10*1024,allowMultiple:e.data.multiple===!0}});if(o===null)await t.sendMessage({type:"system",variant:"info",text:a("skipped")});else for(const s of o.value)await t.sendMessage({author:"user",type:"file",fileName:s.name,fileSizeKb:s.sizeKb});return r(e.nextId)}async function Lu({chat:e,end:t,node:r}){await e.sendMessage({type:"system",variant:"info",text:r.data.systemMessage}),t()}async function ju({node:e,flow:t,submissions:r,chat:i,next:n,apiClient:a,analytics:o}){const s=Ss(t.nodes,r||{}),{answers:l,...d}=s;i.setSubmission(e.data.key,{type:"integration",value:d});const p=new AbortController,u=setTimeout(()=>p.abort(),5e3);if(a.fetch("/flow/pre-apply",{method:"POST",signal:p.signal,body:JSON.stringify({...o.getSessionInfo(),job:t.job,flow_build:t.build,pre_apply:Gr(t.nodes,r||{},t.data.flowSessionId)})}).catch(()=>{}).finally(()=>clearTimeout(u)),s.status!=="skipped"){const b=[s.status==="unavailable"?"We could not prepare your pre-apply summary. You can still continue to your application.":s.hasHardConcerns?e.data.messages.hard:s.hasAdvisoryConcerns?e.data.messages.advisory:e.data.messages.matched];for(const m of["hard","advisory"]){const k=l.filter(A=>!A.matched&&A.severity===m);k.length&&b.push((m==="hard"?"Role requirements":"Other things to consider")+`
6
+ `+k.map(A=>`• ${A.message}`).join(`
7
7
  `))}await i.sendMessage({type:"text",author:"bot",text:b.join(`
8
8
 
9
- `)}),s.hasHardConcerns&&e.data.alternativeLink&&await i.sendMessage({type:"link",href:e.data.alternativeLink.href,text:e.data.alternativeLink.label}),await i.userInput({type:"submit",key:void 0,config:{label:e.data.continueLabel}})}return n(e.nextId)}const vt=({class:e,...t})=>{const{t:r}=le();return c("button",{class:Ke("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50",e),type:"submit",...t,children:c("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",children:[c("title",{children:r("send")}),c("path",{d:"M3.5 7.5L8 3L12.5 7.5"}),c("path",{d:"M8 4V13"})]})})};var Ze;function Ir(e){return{lang:(e==null?void 0:e.lang)??(Ze==null?void 0:Ze.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(Ze==null?void 0:Ze.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(Ze==null?void 0:Ze.abortPipeEarly)}}var Oi;function Pu(e){return Oi==null?void 0:Oi.get(e)}var Li;function Ou(e){return Li==null?void 0:Li.get(e)}var ji;function Lu(e,t){var r;return(r=ji==null?void 0:ji.get(e))==null?void 0:r.get(t)}function At(e){var r,i;const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((i=(r=Object.getPrototypeOf(e))==null?void 0:r.constructor)==null?void 0:i.name))??"null":t}function ce(e,t,r,i,n){const a=n&&"input"in n?n.input:r.value,o=(n==null?void 0:n.expected)??e.expects??null,s=(n==null?void 0:n.received)??At(a),l={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:"R"}eceived ${s}`,requirement:e.requirement,path:n==null?void 0:n.path,issues:n==null?void 0:n.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},d=e.kind==="schema",p=(n==null?void 0:n.message)??e.message??Lu(e.reference,l.lang)??(d?Ou(l.lang):null)??i.message??Pu(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),d&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function Be(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},Ir())}}}function ju(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function Bu(e,t){const r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}function Ru(e){if(e.path){let t="";for(const r of e.path)if(typeof r.key=="string"||typeof r.key=="number")t?t+=`.${r.key}`:t+=r.key;else return null;return t}return null}var zu=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}},Uu=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function io(e,t){return{kind:"validation",type:"check",reference:io,async:!1,expects:null,requirement:e,message:t,"~run"(r,i){return r.typed&&!this.requirement(r.value)&&ce(this,"input",r,i),r}}}function no(e){return{kind:"validation",type:"email",reference:no,expects:null,async:!1,requirement:Uu,message:e,"~run"(t,r){return t.typed&&!this.requirement.test(t.value)&&ce(this,"email",t,r),t}}}function Yt(e,t){return{kind:"validation",type:"max_length",reference:Yt,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&ce(this,"length",r,i,{received:`${r.value.length}`}),r}}}function ao(e,t){return{kind:"validation",type:"max_value",reference:ao,async:!1,expects:`<=${e instanceof Date?e.toJSON():At(e)}`,requirement:e,message:t,"~run"(r,i){return r.typed&&!(r.value<=this.requirement)&&ce(this,"value",r,i,{received:r.value instanceof Date?r.value.toJSON():At(r.value)}),r}}}function Ft(e,t){return{kind:"validation",type:"min_length",reference:Ft,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&ce(this,"length",r,i,{received:`${r.value.length}`}),r}}}function oo(e,t){return{kind:"validation",type:"min_value",reference:oo,async:!1,expects:`>=${e instanceof Date?e.toJSON():At(e)}`,requirement:e,message:t,"~run"(r,i){return r.typed&&!(r.value>=this.requirement)&&ce(this,"value",r,i,{received:r.value instanceof Date?r.value.toJSON():At(r.value)}),r}}}function Bi(e,t){return{kind:"validation",type:"regex",reference:Bi,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&!this.requirement.test(r.value)&&ce(this,"format",r,i),r}}}function Ri(e){return{kind:"transformation",type:"transform",reference:Ri,async:!1,operation:e,"~run"(t){return t.value=this.operation(t.value),t}}}function so(e){return{kind:"validation",type:"url",reference:so,async:!1,expects:null,requirement(t){try{return new URL(t),!0}catch{return!1}},message:e,"~run"(t,r){return t.typed&&!this.requirement(t.value)&&ce(this,"URL",t,r),t}}}function qu(e,t,r){return typeof e.fallback=="function"?e.fallback(t,r):e.fallback}function lo(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function co(e,t){return{kind:"schema",type:"array",reference:co,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return Be(this)},"~run"(r,i){var a;const n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let o=0;o<n.length;o++){const s=n[o],l=this.item["~run"]({value:s},i);if(l.issues){const d={type:"array",origin:"value",input:n,key:o,value:s};for(const p of l.issues)p.path?p.path.unshift(d):p.path=[d],(a=r.issues)==null||a.push(p);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else ce(this,"type",r,i);return r}}}function uo(e){return{kind:"schema",type:"boolean",reference:uo,expects:"boolean",async:!1,message:e,get"~standard"(){return Be(this)},"~run"(t,r){return typeof t.value=="boolean"?t.typed=!0:ce(this,"type",t,r),t}}}function fo(e){return{kind:"schema",type:"number",reference:fo,expects:"number",async:!1,message:e,get"~standard"(){return Be(this)},"~run"(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:ce(this,"type",t,r),t}}}function Xe(e,t){return{kind:"schema",type:"object",reference:Xe,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return Be(this)},"~run"(r,i){var a;const n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(const o in this.entries){const s=this.entries[o];if(o in n||(s.type==="exact_optional"||s.type==="optional"||s.type==="nullish")&&s.default!==void 0){const l=o in n?n[o]:lo(s),d=s["~run"]({value:l},i);if(d.issues){const p={type:"object",origin:"value",input:n,key:o,value:l};for(const u of d.issues)u.path?u.path.unshift(p):u.path=[p],(a=r.issues)==null||a.push(u);if(r.issues||(r.issues=d.issues),i.abortEarly){r.typed=!1;break}}d.typed||(r.typed=!1),r.value[o]=d.value}else if(s.fallback!==void 0)r.value[o]=qu(s);else if(s.type!=="exact_optional"&&s.type!=="optional"&&s.type!=="nullish"&&(ce(this,"key",r,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:n,key:o,value:n[o]}]}),i.abortEarly))break}}else ce(this,"type",r,i);return r}}}function Jt(e,t){return{kind:"schema",type:"optional",reference:Jt,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Be(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=lo(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function po(e,t){return{kind:"schema",type:"picklist",reference:po,expects:Bu(e.map(At),"|"),async:!1,options:e,message:t,get"~standard"(){return Be(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:ce(this,"type",r,i),r}}}function ho(e,t,r){return{kind:"schema",type:"record",reference:ho,expects:"Object",async:!1,key:e,value:t,message:r,get"~standard"(){return Be(this)},"~run"(i,n){var o,s;const a=i.value;if(a&&typeof a=="object"){i.typed=!0,i.value={};for(const l in a)if(ju(a,l)){const d=a[l],p=this.key["~run"]({value:l},n);if(p.issues){const h={type:"object",origin:"key",input:a,key:l,value:d};for(const b of p.issues)b.path=[h],(o=i.issues)==null||o.push(b);if(i.issues||(i.issues=p.issues),n.abortEarly){i.typed=!1;break}}const u=this.value["~run"]({value:d},n);if(u.issues){const h={type:"object",origin:"value",input:a,key:l,value:d};for(const b of u.issues)b.path?b.path.unshift(h):b.path=[h],(s=i.issues)==null||s.push(b);if(i.issues||(i.issues=u.issues),n.abortEarly){i.typed=!1;break}}(!p.typed||!u.typed)&&(i.typed=!1),p.typed&&(i.value[p.value]=u.value)}}else ce(this,"type",i,n);return i}}}function xe(e){return{kind:"schema",type:"string",reference:xe,expects:"string",async:!1,message:e,get"~standard"(){return Be(this)},"~run"(t,r){return typeof t.value=="string"?t.typed=!0:ce(this,"type",t,r),t}}}function Hu(e,t,r){const i=e["~run"]({value:t},Ir(r));if(i.issues)throw new zu(i.issues);return i.value}function Wu(e,t){const r={};for(const i in e.entries)r[i]=!t||t.includes(i)?Jt(e.entries[i]):e.entries[i];return{...e,entries:r,get"~standard"(){return Be(this)}}}function st(...e){return{...e[0],pipe:e,get"~standard"(){return Be(this)},"~run"(t,r){for(const i of e)if(i.kind!=="metadata"){if(t.issues&&(i.kind==="schema"||i.kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=i["~run"](t,r))}return t}}}function Ku(e,t,r){const i=e["~run"]({value:t},Ir(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}async function Gu(e,t,r){const i=await e["~run"]({value:t},Ir(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}const Nt=({error:e})=>!e||!e.message?null:c("div",{role:"alert",class:"text-error-11 flex max-w-full items-start gap-1 overflow-hidden rounded-2xl px-2 py-2",children:[c("svg",{class:"text-error-9 mt-0.5 h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c("circle",{cx:"8",cy:"8",r:"6.3",stroke:"currentColor","stroke-width":"1.4"}),c("rect",{x:"7",y:"4",width:"2",height:"5",fill:"currentColor"}),c("rect",{x:"7",y:"10",width:"2",height:"2",fill:"currentColor"})]}),c("p",{class:"break-words pr-1 text-sm",children:e.message})]}),wt=({class:e,...t})=>{const{t:r}=le();return c("button",{type:"button",class:Ke("fr touch-hitbox text-neutral-10 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all",e),...t,children:[c("svg",{"aria-hidden":!0,class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"1.5",children:[c("title",{children:r("skip")}),c("path",{d:"M3.25 11.25A5 5 0 0 1 12 7"}),c("path",{d:"M13.25 4.5V8.25H9.5"})]}),r("skip")]})};var zi={Afghanistan:"93",Albania:"355",Algeria:"213","American Samoa":"1 684",Andorra:"376",Angola:"244",Anguilla:"1 264",Antarctica:"672","Antigua and Barbuda":"1 268",Argentina:"54",Armenia:"374",Aruba:"297",Australia:"61",Austria:"43",Azerbaijan:"994",Bahrain:"973",Bangladesh:"880",Barbados:"1 246",Belarus:"375",Belgium:"32",Belize:"501",Benin:"229",Bermuda:"1 441",Bhutan:"975",Bolivia:"591","Bosnia and Herzegovina":"387",Botswana:"267","Bouvet Island":"47",Brazil:"55","British Indian Ocean Territory":"246","British Virgin Islands":"1 284",Brunei:"673",Bulgaria:"359","Burkina Faso":"226",Burundi:"257","Cabo Verde":"238",Cambodia:"855",Cameroon:"237",Canada:"1","Caribbean Netherlands":"599","Cayman Islands":"1 345","Central African Republic":"236",Chad:"235",Chile:"56",China:"86","Christmas Island":"61","Cocos (Keeling) Islands":"61",Colombia:"57",Comoros:"269","Cook Islands":"682","Costa Rica":"506",Croatia:"385",Cuba:"53",Curaçao:"599",Cyprus:"357",Czechia:"420","Côte d'Ivoire":"225","Democratic Republic of the Congo":"243",Denmark:"45",Djibouti:"253","Dominican Republic":"1 809",Ecuador:"593",Egypt:"20","El Salvador":"503","Equatorial Guinea":"240",Eritrea:"291",Estonia:"372",Eswatini:"268",Ethiopia:"251","Falkland Islands (Islas Malvinas)":"500","Faroe Islands":"298",Fiji:"679",Finland:"358",France:"33","French Guiana":"594","French Polynesia":"689","French Southern and Antarctic Lands":"262",Gabon:"241",Georgia:"995",Germany:"49",Ghana:"233",Gibraltar:"350",Greece:"30",Greenland:"299",Grenada:"1 473",Guadeloupe:"590",Guam:"1 671",Guatemala:"502",Guernsey:"44",Guinea:"224","Guinea-Bissau":"245",Guyana:"592",Haiti:"509",Honduras:"504","Hong Kong":"852",Hungary:"36",Iceland:"354",India:"91",Indonesia:"62",Iran:"98",Iraq:"964",Ireland:"353","Isle of Man":"44",Israel:"972",Italy:"39",Jamaica:"1 876",Japan:"81",Jersey:"44",Jordan:"962",Kazakhstan:"7",Kenya:"254",Kiribati:"686",Kosovo:"383",Kuwait:"965",Kyrgyzstan:"996",Laos:"856",Latvia:"371",Lebanon:"961",Lesotho:"266",Liberia:"231",Libya:"218",Liechtenstein:"423",Lithuania:"370",Luxembourg:"352",Macao:"853",Madagascar:"261",Malawi:"265",Malaysia:"60",Maldives:"960",Mali:"223",Malta:"356","Marshall Islands":"692",Martinique:"596",Mauritania:"222",Mauritius:"230",Mayotte:"262",Mexico:"52",Micronesia:"691",Moldova:"373",Monaco:"377",Mongolia:"976",Montenegro:"382",Montserrat:"1 664",Morocco:"212",Mozambique:"258","Myanmar (Burma)":"95",Namibia:"264",Nauru:"674",Nepal:"977",Netherlands:"31","New Caledonia":"687","New Zealand":"64",Nicaragua:"505",Niger:"227",Nigeria:"234",Niue:"683","Norfolk Island":"672","North Korea":"850","North Macedonia":"389","Northern Mariana Islands":"1 670",Norway:"47",Oman:"968",Pakistan:"92",Palau:"680",Palestine:"970",Panama:"507","Papua New Guinea":"675",Paraguay:"595",Peru:"51",Philippines:"63","Pitcairn Islands":"64",Poland:"48",Portugal:"351","Puerto Rico":"1 787",Qatar:"974",Romania:"40",Russia:"7",Rwanda:"250",Réunion:"262","Saint Barthélemy":"590","Saint Helena, Ascension and Tristan da Cunha":"290","Saint Kitts and Nevis":"1 869","Saint Lucia":"1 758","Saint Martin":"590","Saint Pierre and Miquelon":"508","Saint Vincent and the Grenadines":"1 784",Samoa:"685","San Marino":"378","Saudi Arabia":"966",Senegal:"221",Serbia:"381",Seychelles:"248","Sierra Leone":"232",Singapore:"65","Sint Maarten":"1 721",Slovakia:"421",Slovenia:"386","Solomon Islands":"677",Somalia:"252","South Africa":"27","South Georgia and the South Sandwich Islands":"500","South Korea":"82","South Sudan":"211",Spain:"34","Sri Lanka":"94",Sudan:"249",Suriname:"597","Svalbard and Jan Mayen":"47",Sweden:"46",Switzerland:"41",Syria:"963","São Tomé and Príncipe":"239",Taiwan:"886",Tajikistan:"992",Tanzania:"255",Thailand:"66","The Bahamas":"1 242","The Gambia":"220","Timor-Leste":"670",Togo:"228",Tokelau:"690",Tonga:"676","Trinidad and Tobago":"1 868",Tunisia:"216",Turkmenistan:"993","Turks and Caicos Islands":"1 649",Tuvalu:"688",Türkiye:"90","U.S. Virgin Islands":"1 340",Uganda:"256",Ukraine:"380","United Arab Emirates":"971","United Kingdom":"44","United States":"1","United States Minor Outlying Islands":"1",Uruguay:"598",Uzbekistan:"998",Vanuatu:"678","Vatican City":"379",Venezuela:"58",Vietnam:"84","Wallis and Futuna":"681","Western Sahara":"212",Yemen:"967",Zambia:"260",Zimbabwe:"263","Åland Islands":"358"};const Zt=pt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all",{variants:{optional:{true:"pr-16 pl-3",false:"pl-3 pr-3"}},defaultVariants:{optional:!1}}),Yu="https://api.mapbox.com/search/searchbox/v1/suggest",Ju="ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==",Zu=e=>atob(e).split("").reverse().join(""),Qe=Xe({name:xe()}),Xu=Xe({suggestions:co(Xe({full_address:Jt(xe()),place_formatted:Jt(xe()),name:Jt(xe()),mapbox_id:xe(),context:Wu(Xe({address:Qe,street:Qe,neighborhood:Qe,locality:Qe,district:Qe,place:Qe,region:Qe,postcode:Qe,country:Qe}))}))}),Qu=({logger:e,t})=>rt(()=>{var i;const r=(i=D.current$.peek().flow)==null?void 0:i.data.flowSessionId;return r?{enabled:!0,getPredictions:async n=>{var u;const a=new URL(Yu);a.searchParams.set("q",n),a.searchParams.set("session_token",r);const o=(u=D.current$.peek().flow)==null?void 0:u.locationOrigin;o&&o.lat!==void 0&&o.lng!==void 0&&o.lat>=-90&&o.lat<=90&&o.lng>=-180&&o.lng<=180&&a.searchParams.set("proximity",`${o.lng},${o.lat}`),a.searchParams.set("access_token",Zu(Ju));const l=await fetch(a);if(!l.ok)return e.error("Failed to get address details",l),{ok:!1,error:t("address_error")};const d=Ku(Xu,await l.json());if(d.success===!1)return e.error("Failed to parse address details",d.issues),{ok:!1,error:t("address_error")};const{suggestions:p}=d.output;return{ok:!0,data:p.map(h=>{var b,m,_,I,A,v,y,S,$;return{label:h.full_address??h.place_formatted??h.name??h.mapbox_id,id:h.mapbox_id,address:{line1:((b=h.context.address)==null?void 0:b.name)??((m=h.context.street)==null?void 0:m.name),line2:void 0,line3:((_=h.context.neighborhood)==null?void 0:_.name)??((I=h.context.locality)==null?void 0:I.name),city:((A=h.context.place)==null?void 0:A.name)??((v=h.context.district)==null?void 0:v.name),state:(y=h.context.region)==null?void 0:y.name,postcode:(S=h.context.postcode)==null?void 0:S.name,country:($=h.context.country)==null?void 0:$.name}}})}}}:{enabled:!1}},[e,t]),go=e=>{const{t}=le();return c("button",{type:"button",class:"touch-hitbox text-neutral-10 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 relative flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",...e,children:[c("svg",{width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M10 3L5 8L10 13"})}),c("span",{children:t("back")})]})},ed=({input:e,onSubmitSuccess:t,logger:r})=>{const{t:i}=le(),[n,a]=Ge(),{enabled:o,getPredictions:s}=Qu({logger:r,t:i}),[l,d]=Ge(o?"query":"manual"),[p,u]=Ge(""),[h,b]=Ge(),m=ve(),_=ve(),I=v=>{var S;if(Ye(o,"Query state should not be enabled"),v=v.trim(),v===((S=m.current)==null?void 0:S.query)||v===(h==null?void 0:h.query)&&h.status==="done")return;if(u(v),v===""){m.current=void 0,b(void 0);return}const y=m.current={query:v};b({query:v,status:"pending"}),s(v).then($=>{m.current===y&&(m.current=void 0,b($.ok?{query:v,status:"done",items:$.data}:{query:v,status:"failed",error:$.error}))},$=>{m.current===y&&(m.current=void 0,r.error("Failed to get address details",$),b({query:v,status:"failed",error:i("address_error")}))})},A=(v,y)=>{a(S=>({...S,[v]:y}))};switch(l){case"query":return Ye(o,"Query state should not be enabled"),c(td,{input:e,onSkip:()=>t(null),onAddressSelect:v=>{if(v===""){m.current&&(m.current=void 0,b(void 0)),d("manual");return}const y=(h==null?void 0:h.status)==="done"?h.items.find(S=>S.id===v):void 0;y&&(_.current!==v&&a(y.address),_.current=v,d("details"))},onAddressSearch:I,lookup:h,query:p});case"details":return Ye(n!==void 0),c(vo,{input:e,logger:r,onSubmitSuccess:t,addressFields:n,onFieldChange:A,actions:c(go,{onClick:()=>{d("query")}})});case"manual":return c(vo,{logger:r,input:e,onSubmitSuccess:t,addressFields:n??{},onFieldChange:A,actions:o?c(go,{onClick:()=>{d("query")}}):void 0})}},td=({input:e,onSkip:t,lookup:r,onAddressSelect:i,query:n,onAddressSearch:a})=>{const{t:o}=le(),s=ve(null);return be(()=>{s.current&&(s.current.focus(),s.current.select())},[]),c(X,{children:[c("form",{noValidate:!0,onSubmit:l=>{l.preventDefault();const p=new FormData(l.currentTarget).get("address");typeof p=="string"&&a(p)},class:"flex gap-2 p-2.5",children:[c("div",{class:"group relative flex-1",children:[c("input",{ref:s,name:"address",id:"chat-address",autocomplete:"address-line1 country-name postal-code",autoFocus:!0,placeholder:e.config.placeholder||o("address_search"),defaultValue:n,class:Zt({optional:!!e.config.optional,className:"w-full rounded-full"})}),c("button",{type:"submit",class:"touch-hitbox text-neutral-12 hover:bg-neutral-3 fr absolute bottom-0 right-0 top-0 flex cursor-pointer items-center gap-1 rounded-full px-3 transition-all",children:[c("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("g",{id:"inploi",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",strokeWidth:"1.5",children:[c("circle",{cx:"7",cy:"7",r:"4"}),c("path",{d:"M10 10L13 13"})]})}),c("span",{class:"sr-only",children:o("search")})]})]}),e.config.optional&&c(wt,{class:"relative",onClick:t})]}),(r==null?void 0:r.status)==="failed"?c(Nt,{error:{message:r.error}}):null,c("p",{role:"status",class:(r==null?void 0:r.status)==="pending"||(r==null?void 0:r.status)==="done"&&r.items.length===0?"text-neutral-10 flex items-center gap-2 px-4 py-2 text-sm":"sr-only",children:(r==null?void 0:r.status)==="pending"?c(X,{children:[c($r,{"aria-hidden":"true",class:"h-4 w-4 shrink-0"}),o("address_searching")]}):(r==null?void 0:r.status)==="done"&&r.items.length===0?o("address_no_results"):null}),c("ul",{children:[((r==null?void 0:r.status)==="done"?r.items:[]).map(l=>c("li",{children:c("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{i(l.id)},children:[c("span",{class:"flex-grow",children:l.label}),c("svg",{class:"flex-none",width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M6 3L11 8L6 13"})})]})},l.id)),c("li",{children:c("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{i("")},children:c("span",{class:"flex-grow",children:o("address_manual")})})},"")]})]})},bo=["line1","line2","line3","city","state","postcode","country"],vo=({addressFields:e,onFieldChange:t,onSubmitSuccess:r,actions:i,input:n})=>{const a=ve(null);be(()=>{if(a.current){const l=a.current.querySelector("input");l&&(l.focus(),l.select())}},[]);const o=Object.keys(zi),{t:s}=le();return c("form",{class:"flex flex-col px-2 pt-2",onSubmit:l=>{const d=new FormData(l.currentTarget),p=Object.fromEntries(d.entries());r({type:"address",value:p})},children:[c("div",{class:"bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",ref:a,children:bo.map((l,d)=>{const p=`isdk_${l}`,u=n.config.keys[l];return u?c(X,{children:[c("label",{for:p,class:"text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",children:s(l)}),c("div",{class:"flex flex-col items-stretch gap-1.5",children:[l==="country"?c("div",{class:"relative",children:[c("select",{class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",name:u,id:p,defaultValue:e[l],onChange:h=>t(l,h.currentTarget.value),required:!0,children:[e.country&&!o.includes(e.country)?c("option",{value:e[l],children:e[l]}):c("option",{value:"",children:s("select_country")}),o.map(h=>c("option",{value:h,children:h},h))]}),c("svg",{class:"text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",width:"16",height:"16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M4 6.5L8 10.5L12 6.5"})})]}):c("input",{autoFocus:d===0?!0:void 0,class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",name:u,id:p,defaultValue:e[l],onInput:h=>t(l,h.currentTarget.value),required:!0}),d===bo.length-1?c("hr",{class:"m-0 w-full border-b border-b-transparent"}):c("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"})]})]}):null})}),c("div",{class:"bg-neutral-1 sticky bottom-0 flex items-center py-2",children:[i,c(vt,{class:"ml-auto"})]})]})},Ui=()=>{const e=ve(null);return ii(()=>{var t;(t=e.current)==null||t.focus()},[]),e},wo=["true","false"],rd=po(wo),id="answer",mo="flex items-center flex-wrap gap-2 p-2.5",yo="min-w-0 max-w-full flex-auto",_o=ci(({label:e,...t},r)=>c("button",{class:"bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2 py-2.5 ring-2 transition-all selection:bg-transparent",...t,ref:r,children:c("p",{class:"text-center text-base",children:e})})),nd=({input:e,onSubmitSuccess:t})=>{const r=Ui();return c("form",{noValidate:!0,class:"",onSubmit:i=>{i.preventDefault();const n=Mc(i).value,a=Hu(rd,n);t({type:"boolean",value:a==="true"})},children:[c("ul",{class:mo,children:wo.map((i,n)=>c("li",{class:yo,children:c(_o,{ref:n===0?r:null,type:"submit",name:id,value:i,label:e.config.labels[i]},i)}))}),e.config.optional&&c("div",{class:"px-2 pb-2",children:c(wt,{class:"relative w-full",type:"button",onClick:()=>t(null)})})]})},ad=e=>new Promise((t,r)=>{const i=new FileReader;i.onload=()=>{if(typeof i.result!="string"||!i.result)return r(new Error("Invalid file"));t(i.result)},i.onerror=r,i.readAsDataURL(e)}),xo=e=>e.reduce((t,r)=>t+r.sizeKb,0),od=It("file"),ko=3,qi=e=>{const t=e.lastIndexOf(".");return t===-1?[e,""]:[e.slice(0,t),e.slice(t)]},sd=({file:e,class:t,...r})=>{const[i,n]=qi(e.name);return c("div",{class:Ke("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline",t),...r,children:[c("p",{"aria-label":"File name",class:"text-accent-12 flex flex-grow overflow-hidden",children:[c("span",{class:"block truncate",children:i}),c("span",{children:n})]}),c("p",{"aria-label":"File size",class:"text-accent-11",children:Vt(e.sizeKb)})]})},So=({class:e,...t})=>c("li",{class:Ke("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),ld=(e,t)=>{const[r,i]=qi(e);return`${r.slice(0,t)}${i}`},Co=e=>({name:ld(e.name,42),sizeKb:e.size/1e3}),cd=({input:e,onSubmitSuccess:t})=>{var m;const r=(m=D.current$.value.flow)==null?void 0:m.data.submissions[e.key],[i,n]=Ge(od(r)&&r.value.length?{status:"ready",files:r.value}:{status:"empty"}),a=ve(0),o=i.status==="ready"?i.files:[],s=i.status==="ready"||i.status==="pending"?i.files:[],l=i.status==="error"?i.error:void 0,d=s.length-ko,p=xo(s),u=Ui(),{t:h}=le(),b=_=>{if(!_.length)return{type:"required",message:h("validation_file")};if(!Ss(_,e.config.extensions))return{type:"validate",message:h("validation_file_ext",{ext:e.config.extensions.join(", ")})};if(e.config.fileSizeLimitKib&&xo(_)>e.config.fileSizeLimitKib)return{type:"max",message:h("validation_file_size",{size:Vt(e.config.fileSizeLimitKib)})};if(!e.config.allowMultiple&&_.length>1)return{type:"invalid",message:h("validation_file_max",{count:1})}};return c("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:_=>{if(_.preventDefault(),i.status==="pending"||i.status==="error")return;const I=b(o);I?n({status:"error",error:I}):t({type:"file",value:o})},children:[c("div",{class:"flex items-center gap-2",children:[c("label",{ref:u,for:"dropzone-file",class:"border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",children:[s.length>0?c("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[s.slice(0,ko).map(_=>{const[I,A]=qi(_.name);return c(So,{class:"flex overflow-hidden",children:[c("span",{class:"block truncate",children:I}),c("span",{children:A})]})}),d>0?c(So,{children:["+",d," file",d!==1?"s":""]}):null]}):c("div",{class:"flex flex-col justify-center gap-4 pb-6 pt-5",children:[c("header",{class:"flex flex-col items-center gap-0",children:[c("svg",{class:"text-neutral-11 mb-1 h-8 w-8","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:c("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),c("p",{class:"text-neutral-12 tracking-[-0.01em]",children:h("upload_file",{count:e.config.allowMultiple?2:1})}),e.config.fileSizeLimitKib?c("p",{class:"text-neutral-10 text-xs",children:["(",h("file_max_size",{size:Vt(e.config.fileSizeLimitKib)}),")"]}):null]}),c("aside",{class:"flex flex-col items-center gap-2",children:[c("p",{id:"accepted-filetypes",class:"sr-only",children:h("file_extensions")}),c("ul",{"aria-describedby":"accepted-filetypes",class:"flex flex-wrap justify-center gap-2",children:e.config.extensions.map(_=>c("li",{class:"ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",children:_.replace(".","")}))})]})]}),c("p",{role:"status",class:Ke("text-neutral-11 flex items-center gap-1.5 text-xs",s.length===0&&"sr-only"),children:i.status==="pending"?c(X,{children:[c($r,{"aria-hidden":"true",class:"h-4 w-4"}),h("file_preparing",{count:s.length})]}):i.status==="ready"?c(X,{children:[Vt(p)," ",o.length>1?"total":"",c("span",{class:"sr-only",children:[". ",h("file_ready",{count:o.length})]})]}):null}),c("input",{id:"dropzone-file",onInput:async _=>{Ye(_.target instanceof HTMLInputElement);const I=_.target.files?Array.from(_.target.files):[];if(_.target.value="",!I.length)return;const A=++a.current,v=i.status==="ready",y=I.map(Co),S=b(y);if(S)return n({status:"error",error:S});n({status:"pending",files:y});try{const $=await Promise.all(I.map(async V=>({...Co(V),data:await ad(V)})));a.current===A&&n({status:"ready",files:$})}catch{a.current===A&&n({status:"error",error:{type:"invalid",message:h(v?"file_read_error_replacement":"file_read_error")}})}},multiple:e.config.allowMultiple,type:"file",class:"sr-only"})]}),c("div",{class:"flex h-full flex-col items-center gap-2",children:[c(vt,{disabled:o.length===0}),e.config.optional&&c(wt,{class:"relative",onClick:()=>t(null)})]})]}),c(Nt,{error:l})]})};var Xt=e=>e.type==="checkbox",mt=e=>e instanceof Date,we=e=>e==null;const $o=e=>typeof e=="object";var ee=e=>!we(e)&&!Array.isArray(e)&&$o(e)&&!mt(e),ud=e=>ee(e)&&e.target?Xt(e.target)?e.target.checked:e.target.value:e,dd=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,fd=(e,t)=>e.has(dd(t)),pd=e=>{const t=e.constructor&&e.constructor.prototype;return ee(t)&&t.hasOwnProperty("isPrototypeOf")},Hi=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ne(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Hi&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(ee(e)&&pd(e)))return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=ne(e[n]));return i}var Ar=e=>/^\w*$/.test(e),J=e=>e===void 0,Wi=e=>Array.isArray(e)?e.filter(Boolean):[],Ki=e=>Wi(e.replace(/["|']|\]/g,"").split(/\.|\[/)),F=(e,t,r)=>{if(!t||!ee(e))return r;const i=(Ar(t)?[t]:Ki(t)).reduce((n,a)=>we(n)?n:n[a],e);return J(i)||i===e?J(e[t])?r:e[t]:i},Re=e=>typeof e=="boolean",Fe=e=>typeof e=="function",K=(e,t,r)=>{let i=-1;const n=Ar(t)?[t]:Ki(t),a=n.length,o=a-1;for(;++i<a;){const s=n[i];let l=r;if(i!==o){const d=e[s];l=ee(d)||Array.isArray(d)?d:isNaN(+n[i+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=l,e=e[s]}};const Eo={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ne={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},et={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},hd=de.createContext(null);hd.displayName="HookFormControlContext";var gd=(e,t,r,i=!0)=>{const n={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Ne.all&&(t._proxyFormState[o]=!i||Ne.all),r&&(r[o]=!0),e[o]}});return n};const bd=typeof window<"u"?de.useLayoutEffect:de.useEffect;var ke=e=>typeof e=="string",vd=(e,t,r,i,n)=>ke(e)?(i&&t.watch.add(e),F(r,e,n)):Array.isArray(e)?e.map(a=>(i&&t.watch.add(a),F(r,a))):(i&&(t.watchAll=!0),r),Gi=e=>we(e)||!$o(e);function lt(e,t,r=new WeakSet){if(Gi(e)||Gi(t))return Object.is(e,t);if(mt(e)&&mt(t))return Object.is(e.getTime(),t.getTime());const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of i){const o=e[a];if(!n.includes(a))return!1;if(a!=="ref"){const s=t[a];if(mt(o)&&mt(s)||ee(o)&&ee(s)||Array.isArray(o)&&Array.isArray(s)?!lt(o,s,r):!Object.is(o,s))return!1}}return!0}const wd=de.createContext(null);wd.displayName="HookFormContext";var Io=(e,t,r,i,n)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:n||!0}}:{},Qt=e=>Array.isArray(e)?e:[e],Ao=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}};function Fo(e,t){const r={};for(const i in e)if(e.hasOwnProperty(i)){const n=e[i],a=t[i];if(n&&ee(n)&&a){const o=Fo(n,a);ee(o)&&(r[i]=o)}else e[i]&&(r[i]=a)}return r}var he=e=>ee(e)&&!Object.keys(e).length,Yi=e=>e.type==="file",Fr=e=>{if(!Hi)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},No=e=>e.type==="select-multiple",Ji=e=>e.type==="radio",md=e=>Ji(e)||Xt(e),Zi=e=>Fr(e)&&e.isConnected;function yd(e,t){const r=t.slice(0,-1).length;let i=0;for(;i<r;)e=J(e)?i++:e[t[i++]];return e}function _d(e){for(const t in e)if(e.hasOwnProperty(t)&&!J(e[t]))return!1;return!0}function te(e,t){const r=Array.isArray(t)?t:Ar(t)?[t]:Ki(t),i=r.length===1?e:yd(e,r),n=r.length-1,a=r[n];return i&&delete i[a],n!==0&&(ee(i)&&he(i)||Array.isArray(i)&&_d(i))&&te(e,r.slice(0,-1)),e}var xd=e=>{for(const t in e)if(Fe(e[t]))return!0;return!1};function To(e){return Array.isArray(e)||ee(e)&&!xd(e)}function Xi(e,t={}){for(const r in e){const i=e[r];To(i)?(t[r]=Array.isArray(i)?[]:{},Xi(i,t[r])):J(i)||(t[r]=!0)}return t}function Tt(e,t,r){r||(r=Xi(t));for(const i in e){const n=e[i];if(To(n))J(t)||Gi(r[i])?r[i]=Xi(n,Array.isArray(n)?[]:{}):Tt(n,we(t)?{}:t[i],r[i]);else{const a=t[i];r[i]=!lt(n,a)}}return r}const Do={value:!1,isValid:!1},Mo={value:!0,isValid:!0};var Vo=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!J(e[0].attributes.value)?J(e[0].value)||e[0].value===""?Mo:{value:e[0].value,isValid:!0}:Mo:Do}return Do},Po=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:i})=>J(e)?e:t?e===""?NaN:e&&+e:r&&ke(e)?new Date(e):i?i(e):e;const Oo={isValid:!1,value:null};var Lo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Oo):Oo;function jo(e){const t=e.ref;return Yi(t)?t.files:Ji(t)?Lo(e.refs).value:No(t)?[...t.selectedOptions].map(({value:r})=>r):Xt(t)?Vo(e.refs).value:Po(J(t.value)?e.ref.value:t.value,e)}var kd=(e,t,r,i)=>{const n={};for(const a of e){const o=F(t,a);o&&K(n,a,o._f)}return{criteriaMode:r,names:[...e],fields:n,shouldUseNativeValidation:i}},Nr=e=>e instanceof RegExp,er=e=>J(e)?e:Nr(e)?e.source:ee(e)?Nr(e.value)?e.value.source:e.value:e,Bo=e=>({isOnSubmit:!e||e===Ne.onSubmit,isOnBlur:e===Ne.onBlur,isOnChange:e===Ne.onChange,isOnAll:e===Ne.all,isOnTouch:e===Ne.onTouched});const Ro="AsyncFunction";var Sd=e=>!!e&&!!e.validate&&!!(Fe(e.validate)&&e.validate.constructor.name===Ro||ee(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Ro)),Cd=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),zo=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const tr=(e,t,r,i)=>{for(const n of r||Object.keys(e)){const a=F(e,n);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],n)&&!i)return!0;if(o.ref&&t(o.ref,o.name)&&!i)return!0;if(tr(s,t))break}else if(ee(s)&&tr(s,t))break}}};function Uo(e,t,r){const i=F(e,r);if(i||Ar(r))return{error:i,name:r};const n=r.split(".");for(;n.length;){const a=n.join("."),o=F(t,a),s=F(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};n.pop()}return{name:r}}var $d=(e,t,r,i)=>{r(e);const{name:n,...a}=e;return he(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!i||Ne.all))},Ed=(e,t,r)=>!e||!t||e===t||Qt(e).some(i=>i&&(r?i===t:i.startsWith(t)||t.startsWith(i))),Id=(e,t,r,i,n)=>n.isOnAll?!1:!r&&n.isOnTouch?!(t||e):(r?i.isOnBlur:n.isOnBlur)?!e:(r?i.isOnChange:n.isOnChange)?e:!0,Ad=(e,t)=>!Wi(F(e,t)).length&&te(e,t),Fd=(e,t,r)=>{const i=Qt(F(e,r));return K(i,"root",t[r]),K(e,r,i),e};function qo(e,t,r="validate"){if(ke(e)||Array.isArray(e)&&e.every(ke)||Re(e)&&!e)return{type:r,message:ke(e)?e:"",ref:t}}var Dt=e=>ee(e)&&!Nr(e)?e:{value:e,message:""},Ho=async(e,t,r,i,n,a)=>{const{ref:o,refs:s,required:l,maxLength:d,minLength:p,min:u,max:h,pattern:b,validate:m,name:_,valueAsNumber:I,mount:A}=e._f,v=F(r,_);if(!A||t.has(_))return{};const y=s?s[0]:o,S=P=>{n&&y.reportValidity&&(y.setCustomValidity(Re(P)?"":P||""),y.reportValidity())},$={},V=Ji(o),q=Xt(o),M=V||q,C=(I||Yi(o))&&J(o.value)&&J(v)||Fr(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,R=Io.bind(null,_,i,$),oe=(P,B,Z,ae=et.maxLength,me=et.minLength)=>{const L=P?B:Z;$[_]={type:P?ae:me,message:L,ref:o,...R(P?ae:me,L)}};if(a?!Array.isArray(v)||!v.length:l&&(!M&&(C||we(v))||Re(v)&&!v||q&&!Vo(s).isValid||V&&!Lo(s).isValid)){const{value:P,message:B}=ke(l)?{value:!!l,message:l}:Dt(l);if(P&&($[_]={type:et.required,message:B,ref:y,...R(et.required,B)},!i))return S(B),$}if(!C&&(!we(u)||!we(h))){let P,B;const Z=Dt(h),ae=Dt(u);if(!we(v)&&!isNaN(v)){const me=o.valueAsNumber||v&&+v;we(Z.value)||(P=me>Z.value),we(ae.value)||(B=me<ae.value)}else{const me=o.valueAsDate||new Date(v),L=Ie=>new Date(new Date().toDateString()+" "+Ie),Te=o.type=="time",ze=o.type=="week";ke(Z.value)&&v&&(P=Te?L(v)>L(Z.value):ze?v>Z.value:me>new Date(Z.value)),ke(ae.value)&&v&&(B=Te?L(v)<L(ae.value):ze?v<ae.value:me<new Date(ae.value))}if((P||B)&&(oe(!!P,Z.message,ae.message,et.max,et.min),!i))return S($[_].message),$}if((d||p)&&!C&&(ke(v)||a&&Array.isArray(v))){const P=Dt(d),B=Dt(p),Z=!we(P.value)&&v.length>+P.value,ae=!we(B.value)&&v.length<+B.value;if((Z||ae)&&(oe(Z,P.message,B.message),!i))return S($[_].message),$}if(b&&!C&&ke(v)){const{value:P,message:B}=Dt(b);if(Nr(P)&&!v.match(P)&&($[_]={type:et.pattern,message:B,ref:o,...R(et.pattern,B)},!i))return S(B),$}if(m){if(Fe(m)){const P=await m(v,r),B=qo(P,y);if(B&&($[_]={...B,...R(et.validate,B.message)},!i))return S(B.message),$}else if(ee(m)){let P={};for(const B in m){if(!he(P)&&!i)break;const Z=qo(await m[B](v,r),y,B);Z&&(P={...Z,...R(B,Z.message)},S(Z.message),i&&($[_]=P))}if(!he(P)&&($[_]={ref:y,...P},!i))return $}}return S(!0),$};const Nd={mode:Ne.onSubmit,reValidateMode:Ne.onChange,shouldFocusError:!0};function Td(e={}){let t={...Nd,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Fe(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},n=ee(t.defaultValues)||ee(t.values)?ne(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:ne(n),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,d=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...p};let h={...u};const b={array:Ao(),state:Ao()},m=t.criteriaMode===Ne.all,_=f=>g=>{clearTimeout(d),d=setTimeout(f,g)},I=async f=>{if(!o.keepIsValid&&!t.disabled&&(u.isValid||h.isValid||f)){let g;t.resolver?(g=he((await M()).errors),A()):g=await R(i,!0),g!==r.isValid&&b.state.next({isValid:g})}},A=(f,g)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((f||Array.from(s.mount)).forEach(w=>{w&&(g?K(r.validatingFields,w,g):te(r.validatingFields,w))}),b.state.next({validatingFields:r.validatingFields,isValidating:!he(r.validatingFields)}))},v=(f,g=[],w,E,k=!0,x=!0)=>{if(E&&w&&!t.disabled){if(o.action=!0,x&&Array.isArray(F(i,f))){const T=w(F(i,f),E.argA,E.argB);k&&K(i,f,T)}if(x&&Array.isArray(F(r.errors,f))){const T=w(F(r.errors,f),E.argA,E.argB);k&&K(r.errors,f,T),Ad(r.errors,f)}if((u.touchedFields||h.touchedFields)&&x&&Array.isArray(F(r.touchedFields,f))){const T=w(F(r.touchedFields,f),E.argA,E.argB);k&&K(r.touchedFields,f,T)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=Tt(n,a)),b.state.next({name:f,isDirty:P(f,g),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else K(a,f,g)},y=(f,g)=>{K(r.errors,f,g),b.state.next({errors:r.errors})},S=f=>{r.errors=f,b.state.next({errors:r.errors,isValid:!1})},$=(f,g,w,E)=>{const k=F(i,f);if(k){const x=F(a,f,J(w)?F(n,f):w);J(x)||E&&E.defaultChecked||g?K(a,f,g?x:jo(k._f)):ae(f,x),o.mount&&!o.action&&I()}},V=(f,g,w,E,k)=>{let x=!1,T=!1;const z={name:f};if(!t.disabled){if(!w||E){(u.isDirty||h.isDirty)&&(T=r.isDirty,r.isDirty=z.isDirty=P(),x=T!==z.isDirty);const U=lt(F(n,f),g);T=!!F(r.dirtyFields,f),U?te(r.dirtyFields,f):K(r.dirtyFields,f,!0),z.dirtyFields=r.dirtyFields,x=x||(u.dirtyFields||h.dirtyFields)&&T!==!U}if(w){const U=F(r.touchedFields,f);U||(K(r.touchedFields,f,w),z.touchedFields=r.touchedFields,x=x||(u.touchedFields||h.touchedFields)&&U!==w)}x&&k&&b.state.next(z)}return x?z:{}},q=(f,g,w,E)=>{const k=F(r.errors,f),x=(u.isValid||h.isValid)&&Re(g)&&r.isValid!==g;if(t.delayError&&w?(l=_(()=>y(f,w)),l(t.delayError)):(clearTimeout(d),l=null,w?K(r.errors,f,w):te(r.errors,f)),(w?!lt(k,w):k)||!he(E)||x){const T={...E,...x&&Re(g)?{isValid:g}:{},errors:r.errors,name:f};r={...r,...T},b.state.next(T)}},M=async f=>(A(f,!0),await t.resolver(a,t.context,kd(f||s.mount,i,t.criteriaMode,t.shouldUseNativeValidation))),C=async f=>{const{errors:g}=await M(f);if(A(f),f)for(const w of f){const E=F(g,w);E?K(r.errors,w,E):te(r.errors,w)}else r.errors=g;return g},R=async(f,g,w={valid:!0})=>{for(const E in f){const k=f[E];if(k){const{_f:x,...T}=k;if(x){const z=s.array.has(x.name),U=k._f&&Sd(k._f);U&&u.validatingFields&&A([x.name],!0);const ge=await Ho(k,s.disabled,a,m,t.shouldUseNativeValidation&&!g,z);if(U&&u.validatingFields&&A([x.name]),ge[x.name]&&(w.valid=!1,g||e.shouldUseNativeValidation))break;!g&&(F(ge,x.name)?z?Fd(r.errors,ge,x.name):K(r.errors,x.name,ge[x.name]):te(r.errors,x.name))}!he(T)&&await R(T,g,w)}}return w.valid},oe=()=>{for(const f of s.unMount){const g=F(i,f);g&&(g._f.refs?g._f.refs.every(w=>!Zi(w)):!Zi(g._f.ref))&&Qi(f)}s.unMount=new Set},P=(f,g)=>!t.disabled&&(f&&g&&K(a,f,g),!lt(Qo(),n)),B=(f,g,w)=>vd(f,s,{...o.mount?a:J(g)?n:ke(f)?{[f]:g}:g},w,g),Z=f=>Wi(F(o.mount?a:n,f,t.shouldUnregister?F(n,f,[]):[])),ae=(f,g,w={})=>{const E=F(i,f);let k=g;if(E){const x=E._f;x&&(!x.disabled&&K(a,f,Po(g,x)),k=Fr(x.ref)&&we(g)?"":g,No(x.ref)?[...x.ref.options].forEach(T=>T.selected=k.includes(T.value)):x.refs?Xt(x.ref)?x.refs.forEach(T=>{(!T.defaultChecked||!T.disabled)&&(Array.isArray(k)?T.checked=!!k.find(z=>z===T.value):T.checked=k===T.value||!!k)}):x.refs.forEach(T=>T.checked=T.value===k):Yi(x.ref)?x.ref.value="":(x.ref.value=k,x.ref.type||b.state.next({name:f,values:ne(a)})))}(w.shouldDirty||w.shouldTouch)&&V(f,k,w.shouldTouch,w.shouldDirty,!0),w.shouldValidate&&Ie(f)},me=(f,g,w)=>{for(const E in g){if(!g.hasOwnProperty(E))return;const k=g[E],x=f+"."+E,T=F(i,x);(s.array.has(f)||ee(k)||T&&!T._f)&&!mt(k)?me(x,k,w):ae(x,k,w)}},L=(f,g,w={})=>{const E=F(i,f),k=s.array.has(f),x=ne(g);K(a,f,x),k?(b.array.next({name:f,values:ne(a)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&w.shouldDirty&&b.state.next({name:f,dirtyFields:Tt(n,a),isDirty:P(f,x)})):E&&!E._f&&!we(x)?me(f,x,w):ae(f,x,w),zo(f,s)?b.state.next({...r,name:f,values:ne(a)}):b.state.next({name:o.mount?f:void 0,values:ne(a)})},Te=async f=>{o.mount=!0;const g=f.target;let w=g.name,E=!0;const k=F(i,w),x=U=>{E=Number.isNaN(U)||mt(U)&&isNaN(U.getTime())||lt(U,F(a,w,U))},T=Bo(t.mode),z=Bo(t.reValidateMode);if(k){let U,ge;const yt=g.type?jo(k._f):ud(f),ct=f.type===Eo.BLUR||f.type===Eo.FOCUS_OUT,Df=!Cd(k._f)&&!t.resolver&&!F(r.errors,w)&&!k._f.deps||Id(ct,F(r.touchedFields,w),r.isSubmitted,z,T),rn=zo(w,s,ct);K(a,w,yt),ct?(!g||!g.readOnly)&&(k._f.onBlur&&k._f.onBlur(f),l&&l(0)):k._f.onChange&&k._f.onChange(f);const nn=V(w,yt,ct),Mf=!he(nn)||rn;if(!ct&&b.state.next({name:w,type:f.type,values:ne(a)}),Df)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?ct&&I():ct||I()),Mf&&b.state.next({name:w,...rn?{}:nn});if(!ct&&rn&&b.state.next({...r}),t.resolver){const{errors:ls}=await M([w]);if(A([w]),x(yt),E){const Vf=Uo(r.errors,i,w),cs=Uo(ls,i,Vf.name||w);U=cs.error,w=cs.name,ge=he(ls)}}else A([w],!0),U=(await Ho(k,s.disabled,a,m,t.shouldUseNativeValidation))[w],A([w]),x(yt),E&&(U?ge=!1:(u.isValid||h.isValid)&&(ge=await R(i,!0)));E&&(k._f.deps&&(!Array.isArray(k._f.deps)||k._f.deps.length>0)&&Ie(k._f.deps),q(w,ge,U,nn))}},ze=(f,g)=>{if(F(r.errors,g)&&f.focus)return f.focus(),1},Ie=async(f,g={})=>{let w,E;const k=Qt(f);if(t.resolver){const x=await C(J(f)?f:k);w=he(x),E=f?!k.some(T=>F(x,T)):w}else f?(E=(await Promise.all(k.map(async x=>{const T=F(i,x);return await R(T&&T._f?{[x]:T}:T)}))).every(Boolean),!(!E&&!r.isValid)&&I()):E=w=await R(i);return b.state.next({...!ke(f)||(u.isValid||h.isValid)&&w!==r.isValid?{}:{name:f},...t.resolver||!f?{isValid:w}:{},errors:r.errors}),g.shouldFocus&&!E&&tr(i,ze,f?k:s.mount),E},Qo=(f,g)=>{let w={...o.mount?a:n};return g&&(w=Fo(g.dirtyFields?r.dirtyFields:r.touchedFields,w)),J(f)?w:ke(f)?F(w,f):f.map(E=>F(w,E))},es=(f,g)=>({invalid:!!F((g||r).errors,f),isDirty:!!F((g||r).dirtyFields,f),error:F((g||r).errors,f),isValidating:!!F(r.validatingFields,f),isTouched:!!F((g||r).touchedFields,f)}),$f=f=>{const g=f?Qt(f):void 0;g==null||g.forEach(w=>te(r.errors,w)),g?g.forEach(w=>{b.state.next({name:w,errors:r.errors})}):b.state.next({errors:{}})},ts=(f,g,w)=>{const E=(F(i,f,{_f:{}})._f||{}).ref,k=F(r.errors,f)||{},{ref:x,message:T,type:z,...U}=k;K(r.errors,f,{...U,...g,ref:E}),b.state.next({name:f,errors:r.errors,isValid:!1}),w&&w.shouldFocus&&E&&E.focus&&E.focus()},Ef=(f,g)=>Fe(f)?b.state.subscribe({next:w=>"values"in w&&f(B(void 0,g),w)}):B(f,g,!0),rs=f=>b.state.subscribe({next:g=>{Ed(f.name,g.name,f.exact)&&$d(g,f.formState||u,Tf,f.reRenderRoot)&&f.callback({values:{...a},...r,...g,defaultValues:n})}}).unsubscribe,If=f=>(o.mount=!0,h={...h,...f.formState},rs({...f,formState:{...p,...f.formState}})),Qi=(f,g={})=>{for(const w of f?Qt(f):s.mount)s.mount.delete(w),s.array.delete(w),g.keepValue||(te(i,w),te(a,w)),!g.keepError&&te(r.errors,w),!g.keepDirty&&te(r.dirtyFields,w),!g.keepTouched&&te(r.touchedFields,w),!g.keepIsValidating&&te(r.validatingFields,w),!t.shouldUnregister&&!g.keepDefaultValue&&te(n,w);b.state.next({values:ne(a)}),b.state.next({...r,...g.keepDirty?{isDirty:P()}:{}}),!g.keepIsValid&&I()},is=({disabled:f,name:g})=>{if(Re(f)&&o.mount||f||s.disabled.has(g)){const k=s.disabled.has(g)!==!!f;f?s.disabled.add(g):s.disabled.delete(g),k&&o.mount&&!o.action&&I()}},en=(f,g={})=>{let w=F(i,f);const E=Re(g.disabled)||Re(t.disabled);return K(i,f,{...w||{},_f:{...w&&w._f?w._f:{ref:{name:f}},name:f,mount:!0,...g}}),s.mount.add(f),w?is({disabled:Re(g.disabled)?g.disabled:t.disabled,name:f}):$(f,!0,g.value),{...E?{disabled:g.disabled||t.disabled}:{},...t.progressive?{required:!!g.required,min:er(g.min),max:er(g.max),minLength:er(g.minLength),maxLength:er(g.maxLength),pattern:er(g.pattern)}:{},name:f,onChange:Te,onBlur:Te,ref:k=>{if(k){en(f,g),w=F(i,f);const x=J(k.value)&&k.querySelectorAll&&k.querySelectorAll("input,select,textarea")[0]||k,T=md(x),z=w._f.refs||[];if(T?z.find(U=>U===x):x===w._f.ref)return;K(i,f,{_f:{...w._f,...T?{refs:[...z.filter(Zi),x,...Array.isArray(F(n,f))?[{}]:[]],ref:{type:x.type,name:f}}:{ref:x}}}),$(f,!1,void 0,x)}else w=F(i,f,{}),w._f&&(w._f.mount=!1),(t.shouldUnregister||g.shouldUnregister)&&!(fd(s.array,f)&&o.action)&&s.unMount.add(f)}}},tn=()=>t.shouldFocusError&&tr(i,ze,s.mount),Af=f=>{Re(f)&&(b.state.next({disabled:f}),tr(i,(g,w)=>{const E=F(i,w);E&&(g.disabled=E._f.disabled||f,Array.isArray(E._f.refs)&&E._f.refs.forEach(k=>{k.disabled=E._f.disabled||f}))},0,!1))},ns=(f,g)=>async w=>{let E;w&&(w.preventDefault&&w.preventDefault(),w.persist&&w.persist());let k=ne(a);if(b.state.next({isSubmitting:!0}),t.resolver){const{errors:x,values:T}=await M();A(),r.errors=x,k=ne(T)}else await R(i);if(s.disabled.size)for(const x of s.disabled)te(k,x);if(te(r.errors,"root"),he(r.errors)){b.state.next({errors:{}});try{await f(k,w)}catch(x){E=x}}else g&&await g({...r.errors},w),tn(),setTimeout(tn);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:he(r.errors)&&!E,submitCount:r.submitCount+1,errors:r.errors}),E)throw E},Ff=(f,g={})=>{F(i,f)&&(J(g.defaultValue)?L(f,ne(F(n,f))):(L(f,g.defaultValue),K(n,f,ne(g.defaultValue))),g.keepTouched||te(r.touchedFields,f),g.keepDirty||(te(r.dirtyFields,f),r.isDirty=g.defaultValue?P(f,ne(F(n,f))):P()),g.keepError||(te(r.errors,f),u.isValid&&I()),b.state.next({...r}))},as=(f,g={})=>{const w=f?ne(f):n,E=ne(w),k=he(f),x=k?n:E;if(g.keepDefaultValues||(n=w),!g.keepValues){if(g.keepDirtyValues){const T=new Set([...s.mount,...Object.keys(Tt(n,a))]);for(const z of Array.from(T)){const U=F(r.dirtyFields,z),ge=F(a,z),yt=F(x,z);U&&!J(ge)?K(x,z,ge):!U&&!J(yt)&&L(z,yt)}}else{if(Hi&&J(f))for(const T of s.mount){const z=F(i,T);if(z&&z._f){const U=Array.isArray(z._f.refs)?z._f.refs[0]:z._f.ref;if(Fr(U)){const ge=U.closest("form");if(ge){ge.reset();break}}}}if(g.keepFieldsRef)for(const T of s.mount)L(T,F(x,T));else i={}}a=t.shouldUnregister?g.keepDefaultValues?ne(n):{}:ne(x),b.array.next({values:{...x}}),b.state.next({values:{...x}})}s={mount:g.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!g.keepIsValid||!!g.keepDirtyValues||!t.shouldUnregister&&!he(x),o.watch=!!t.shouldUnregister,o.keepIsValid=!!g.keepIsValid,o.action=!1,g.keepErrors||(r.errors={}),b.state.next({submitCount:g.keepSubmitCount?r.submitCount:0,isDirty:k?!1:g.keepDirty?r.isDirty:!!(g.keepDefaultValues&&!lt(f,n)),isSubmitted:g.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:k?{}:g.keepDirtyValues?g.keepDefaultValues&&a?Tt(n,a):r.dirtyFields:g.keepDefaultValues&&f?Tt(n,f):g.keepDirty?r.dirtyFields:{},touchedFields:g.keepTouched?r.touchedFields:{},errors:g.keepErrors?r.errors:{},isSubmitSuccessful:g.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},os=(f,g)=>as(Fe(f)?f(a):f,{...t.resetOptions,...g}),Nf=(f,g={})=>{const w=F(i,f),E=w&&w._f;if(E){const k=E.refs?E.refs[0]:E.ref;k.focus&&setTimeout(()=>{k.focus(),g.shouldSelect&&Fe(k.select)&&k.select()})}},Tf=f=>{r={...r,...f}},ss={control:{register:en,unregister:Qi,getFieldState:es,handleSubmit:ns,setError:ts,_subscribe:rs,_runSchema:M,_updateIsValidating:A,_focusError:tn,_getWatch:B,_getDirty:P,_setValid:I,_setFieldArray:v,_setDisabledField:is,_setErrors:S,_getFieldArray:Z,_reset:as,_resetDefaultValues:()=>Fe(t.defaultValues)&&t.defaultValues().then(f=>{os(f,t.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:oe,_disableForm:Af,_subjects:b,_proxyFormState:u,get _fields(){return i},get _formValues(){return a},get _state(){return o},set _state(f){o=f},get _defaultValues(){return n},get _names(){return s},set _names(f){s=f},get _formState(){return r},get _options(){return t},set _options(f){t={...t,...f}}},subscribe:If,trigger:Ie,register:en,handleSubmit:ns,watch:Ef,setValue:L,getValues:Qo,reset:os,resetField:Ff,clearErrors:$f,unregister:Qi,setError:ts,setFocus:Nf,getFieldState:es};return{...ss,formControl:ss}}function Tr(e={}){const t=de.useRef(void 0),r=de.useRef(void 0),[i,n]=de.useState({isDirty:!1,isValidating:!1,isLoading:Fe(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Fe(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!Fe(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=Td(e);t.current={...s,formState:i}}const a=t.current.control;return a._options=e,bd(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>n({...a._formState}),reRenderRoot:!0});return n(s=>({...s,isReady:!0})),a._formState.isReady=!0,o},[a]),de.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),de.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),de.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),de.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),de.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==i.isDirty&&a._subjects.state.next({isDirty:o})}},[a,i.isDirty]),de.useEffect(()=>{var o;e.values&&!lt(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((o=a._options.resetOptions)===null||o===void 0)&&o.keepIsValid||a._setValid(),r.current=e.values,n(s=>({...s}))):a._resetDefaultValues()},[a,e.values]),de.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=de.useMemo(()=>gd(i,a),[a,i]),t.current}const Wo=(e,t,r)=>{if(e&&"reportValidity"in e){const i=F(r,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},Dd=(e,t)=>{for(const r in t.fields){const i=t.fields[r];i&&i.ref&&"reportValidity"in i.ref?Wo(i.ref,r,e):i.refs&&i.refs.forEach(n=>Wo(n,r,e))}},Md=(e,t)=>{t.shouldUseNativeValidation&&Dd(e,t);const r={};for(const i in e){const n=F(t.fields,i),a=Object.assign(e[i]||{},{ref:n&&n.ref});if(Vd(t.names||Object.keys(e),i)){const o=Object.assign({},F(r,i));K(o,"root",a),K(r,i,o)}else K(r,i,a)}return r},Vd=(e,t)=>e.some(r=>r.startsWith(t+"."));var Dr=function(e,t,r){return r===void 0&&(r={}),function(i,n,a){try{var o=!a.shouldUseNativeValidation&&a.criteriaMode==="all";return Promise.resolve(Gu(e,i,Object.assign({},t,{abortPipeEarly:!o}))).then(function(s){if(s.issues){for(var l={};s.issues.length;){var d=s.issues[0],p=Ru(d);if(p&&(l[p]||(l[p]={message:d.message,type:d.type}),o)){var u=l[p].types,h=u&&u[d.type];l[p]=Io(p,o,l,d.type,h?[].concat(h,d.message):d.message)}s.issues.shift()}return{values:{},errors:Md(l,a)}}return{values:r.raw?i:s.output,errors:{}}})}catch(s){return Promise.reject(s)}}};const Ko=27,Go=12,Yo=10,Pd=It("enum"),Od=(e,t)=>{const r={min:e.minSelected??0,max:e.maxSelected??e.options.length};return Dr(Xe({checked:st(ho(xe(),uo()),Ri(i=>Object.entries(i).filter(([n,a])=>a).map(([n,a])=>n)),Yt(r.max,t("validation_multiple_choice_max",{count:r.max})),Ft(r.min,t("validation_multiple_choice_min",{count:r.min})))}))},Ld=ci(({option:e,...t},r)=>c(X,{children:[c("input",{class:"peer sr-only h-full",type:"checkbox",...t,ref:r}),c("label",{class:"bg-lowest hover:bg-neutral-2 active:outline-neutral-8 ease-expo-out outline-divider text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 peer-focus-visible:ring-accent-9 peer-focus-visible:ring-offset-accent-7 block cursor-pointer select-none rounded-2xl px-3 py-1.5 outline outline-1 ring-0 ring-transparent transition-all selection:bg-transparent peer-focus-visible:ring-4",htmlFor:t.id,children:e.label})]})),Jo=pt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4",{variants:{variant:{singleOption:"justify-center",booleanLike:mo}}}),jd=({input:e,onSubmitSuccess:t})=>{var p,u;const r=e.key?(p=D.current$.value.flow)==null?void 0:p.data.submissions[e.key]:void 0,i=(e.config.minSelected===1||e.config.minSelected===void 0)&&e.config.maxSelected===1,n=i&&e.config.options.length===2,{t:a}=le(),{register:o,handleSubmit:s,formState:{errors:l}}=Tr({defaultValues:{checked:i?{}:Pd(r)?Object.fromEntries(r.value.map(h=>[h,!0])):{}},resolver:Od(e.config,a)}),d=Ui();return n?c("ul",{style:{maxHeight:6.5*Ko+5*Go+2*Yo},class:Jo({variant:"booleanLike"}),children:e.config.options.map((h,b)=>c("li",{class:yo,children:c(_o,{type:"submit",ref:m=>{m&&b===0&&(d.current=m)},label:h.label,value:"true",onClick:()=>t({type:"enum",value:[h.value]})})},h.value))}):c("form",{noValidate:!0,onSubmit:h=>s(b=>{const m=b.checked;t({type:"enum",value:m})})(h),children:[c("div",{class:"flex items-center gap-1",children:[c("ul",{style:{maxHeight:6.5*Ko+5*Go+2*Yo},class:Jo({variant:e.config.options.length===1?"singleOption":void 0}),children:e.config.options.map((h,b)=>{const m=`checked.${h.value}`,{ref:_,...I}=o(m);return c("li",{class:"relative",children:c(Ld,{option:h,autoFocus:b===0,ref:A=>{A&&b===0&&(d.current=A),_(A)},id:m,...I,onClick:i?()=>t({type:"enum",value:[h.value]}):void 0})},h.value)})}),c("div",{class:"flex flex-col items-center gap-2 pr-2.5 pt-2.5",children:[i?null:c(vt,{}),e.config.minSelected===0&&c(wt,{class:"relative",type:"button",onClick:()=>t({type:"enum",value:[]})})]})]}),c("div",{class:"px-1",children:c(Nt,{error:(u=l.checked)==null?void 0:u.root})})]})},Bd=It("number"),Rd=(e,t)=>{const r=e.min??Number.MIN_SAFE_INTEGER,i=e.max??Number.MAX_SAFE_INTEGER,n=e.decimalCases??0;return Dr(Xe({number:st(fo(t("validation_number")),oo(r,t("validation_number_min",{min:r})),ao(i,t("validation_number_max",{max:i})),io(a=>a===Number(a.toFixed(n)),t("validation_number_decimal_cases",{count:n})))}))},zd=({input:e,onSubmitSuccess:t})=>{var u;const r=e.config.defaultValue,i=e.key?(u=D.current$.value.flow)==null?void 0:u.data.submissions[e.key]:void 0,{t:n}=le(),{register:a,handleSubmit:o,formState:{errors:s}}=Tr({defaultValues:{number:Bd(i)?i.value:r?Number(r):void 0},resolver:Rd(e.config,n)}),{ref:l,...d}=a("number",{required:!e.config.optional,valueAsNumber:!0}),p=ve();return be(()=>{p.current&&(p.current.focus(),p.current.select())},[]),c("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:o(h=>{h.number!==void 0&&t({type:"number",value:h.number})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative min-w-0 flex-grow",children:[c("input",{...d,id:"chat-input",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:h=>{h&&(p.current=h),l(h)},type:"text",min:e.config.min,max:e.config.max,class:Zt({optional:e.config.optional,className:"[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"}),placeholder:e.config.placeholder}),e.config.optional&&c(wt,{class:"absolute bottom-0 right-0.5 top-0",onClick:()=>t(null)})]}),c(vt,{})]}),c(Nt,{error:s.number})]})},Ud=e=>{if(e==="")return{countryCode:"",phoneNumber:""};const t=Object.entries(zi).find(n=>e.startsWith(n[1])),r=t?t[1]:"",i=e.replace(r,"");return/^\d+$/.test(i)?{countryCode:r,phoneNumber:i}:{countryCode:"",phoneNumber:""}},qd="44",Hd=/^[0-9 ]+$/,Wd=It("string"),Kd=It("phone"),Gd=e=>{const t=st(xe(e("validation_country_code")),Bi(Hd,e("validation_country_code"))),r=st(xe(e("validation_phone")),Ft(1,e("validation_phone")),Ri(i=>i.replace(/[^0-9]/g,"")));return Dr(Xe({countryCode:t,phoneNumber:r}))},Yd=({input:e,onSubmitSuccess:t})=>{var _;const r=e.key?(_=D.current$.value.flow)==null?void 0:_.data.submissions[e.key]:void 0,{t:i}=le(),[n,a]=Ge(),o=Wd(r)?Ud(r.value):Kd(r)?r.value:void 0,{register:s,handleSubmit:l,formState:{errors:d},watch:p}=Tr({defaultValues:{countryCode:(o==null?void 0:o.countryCode)??e.config.defaultValue.countryCode??qd,phoneNumber:(o==null?void 0:o.phoneNumber)??e.config.defaultValue.phoneNumber??""},resolver:Gd(i)}),{ref:u,...h}=s("phoneNumber",{required:!e.config.optional}),b=ve(),m=p("countryCode");return be(()=>{b.current&&(b.current.focus(),b.current.select())},[]),c("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:l(I=>{const A=I.phoneNumber.replace(/[^0-9]/g,""),v=I.countryCode.replace(/[^0-9]/g,"");a(void 0);const y=e.config.minChars??7,S=A.length+v.length;if(S<y)return a(i("validation_phone_min_chars",{count:y}));const $=e.config.maxChars;if($!=null&&S>$)return a(i("validation_max_chars",{count:$}));e.config.submissionFormat==="phone"?t({type:"phone",value:{countryCode:v,phoneNumber:A}}):t({type:"string",value:m+I.phoneNumber})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative flex min-w-0 flex-1 flex-grow gap-2",children:[c("label",{class:"text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",htmlFor:`isdk_phone_${e.key}`,children:[c("span",{children:["+",m]}),c("select",{...s("countryCode",{}),id:`isdk_phone_${e.key}`,class:"absolute inset-0 opacity-0",children:Object.entries(zi).map(([I,A])=>c("option",{value:A,children:[I," (+",A,")"]},I))})]}),c("input",{...h,id:"chat-input",type:"tel",inputMode:"tel",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:I=>{I&&(b.current=I),u(I)},class:Zt({optional:e.config.optional,className:"min-w-0 flex-1 rounded-r-full"}),placeholder:e.config.placeholder}),e.config.optional&&c(wt,{class:"absolute bottom-0 right-1 top-0",onClick:()=>t(null)})]}),c(vt,{})]}),c(Nt,{error:d.countryCode||d.phoneNumber||{message:n}})]})},Jd=({input:e,onSubmitSuccess:t})=>c("div",{class:"flex flex-col items-center py-3",children:c("button",{class:"bg-accent-9 hover:bg-accent-10 active:bg-submit-bg-active hover:border-accent-10 active:border-submit-bg-active border-accent-9 ring-accent-6 focus-visible:outline-accent-8 ring-offset-neutral-1 flex cursor-pointer rounded-full border border-solid px-5 py-3 pr-4 text-white outline-none ring-1 ring-offset-[1.5px] transition-all duration-300 focus-visible:outline-2 active:ring-2 active:ring-offset-2",name:e.key,onClick:()=>{t(null)},children:c("span",{class:"flex items-center gap-1.5",children:[c("span",{class:"inline-flex items-center text-sm font-medium",children:e.config.label||"Submit"}),c("svg",{stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c("path",{d:"M4 8L8 4L12 8"}),c("path",{d:"M8 4V13"})]})]})})}),Zd={date:{type:"date",inputMode:"text"},email:{type:"email",inputMode:"email",formNoValidate:!0},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},Xd=It("string"),Qd=(e,t)=>{const r={maxLength:t("validation_max_chars",{count:e.maxChars??999}),minLength:t("validation_min_chars",{count:e.minChars??1})};return Dr(Xe({text:{date:st(xe(t("validation_date")),Bi(/^\d{4}-\d{2}-\d{2}$/,t("validation_date"))),email:st(xe(t("validation_email")),no(t("validation_email")),Ft(e.minChars??1,r.minLength),Yt(e.maxChars??1/0,r.maxLength)),text:st(xe(),Ft(e.minChars??1,r.minLength),Yt(e.maxChars??1/0,r.maxLength)),url:st(xe(t("validation_url")),so(t("validation_url")),Ft(e.minChars??1,r.minLength),Yt(e.maxChars??1/0,r.maxLength))}[e.format]}))},ef={text:({input:e,onSubmitSuccess:t})=>{var u;const{t:r}=le(),i=e.key?(u=D.current$.value.flow)==null?void 0:u.data.submissions[e.key]:void 0,n=e.config.defaultValue,{register:a,handleSubmit:o,formState:{errors:s}}=Tr({defaultValues:{text:Xd(i)?i.value:n??""},resolver:Qd(e.config,r)}),{ref:l,...d}=a("text",{required:!e.config.optional}),p=ve();return be(()=>{p.current&&(p.current.focus(),p.current.select())},[]),c("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:o(h=>{t({type:"string",value:h.text})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative min-w-0 flex-1",children:[c("input",{id:"chat-input",...d,...Zd[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:h=>{h&&(p.current=h),l(h)},placeholder:e.config.placeholder,class:Zt({optional:!!e.config.optional,className:"w-full rounded-full"})}),e.config.optional&&c(wt,{class:"absolute bottom-0 right-0.5 top-0",onClick:()=>t(null)})]}),c(vt,{})]}),c(Nt,{error:s.text})]})},phone:Yd,"multiple-choice":jd,boolean:nd,file:cd,submit:Jd,address:ed,number:zd},tf=({logger:e})=>{var n;const t=(n=D.current$.value.flow)==null?void 0:n.data.currentInput,r=ve(null),i=()=>ie.onInteractionFn$.value();return be(()=>{var a;(a=r.current)==null||a.scrollTo({top:0})},[t]),c("div",{ref:r,class:"border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",children:c("div",{class:"flex flex-col",onPointerDownCapture:t?i:void 0,onKeyDownCapture:t?i:void 0,children:t?(()=>{const a=ef[t.type];return c(a,{logger:e,onSubmitSuccess:ie.onSubmitSuccessFn$.value,input:t})})():c("div",{class:"flex items-center gap-2 p-2.5",children:[c("input",{"aria-hidden":"true",id:"chat-input",class:Zt({optional:!1,className:"flex-grow rounded-full"}),disabled:!0}),c(vt,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})})})};function rf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var nf=function(e){return e instanceof RegExp},af=function(t){var r=/[\\^$.*+?()[\]{}|]/g,i=RegExp(r.source);return t&&i.test(t)?t.replace(r,"\\$&"):t},Zo=function(e){return typeof e=="string"},of=function(e){var t=[];return e.forEach(function(r){Array.isArray(r)?t=t.concat(r):t.push(r)}),t};function sf(e,t,r){var i=0,n=0;if(e==="")return e;if(!e||!Zo(e))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var a=t;nf(a)||(a=new RegExp("("+af(a)+")","gi"));for(var o=e.split(a),s=1,l=o.length;s<l;s+=2){if(o[s]===void 0||o[s-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}n=o[s].length,i+=o[s-1].length,o[s]=r(o[s],s,i),i+=n}return o}var lf=function(t,r,i){return Array.isArray(t)||(t=[t]),of(t.map(function(n){return Zo(n)?sf(n,r,i):n}))};const rr=rf(lf),cf=/(\[[^\]]+\]\([^)]+\))/g,uf=/\[([^\]]+)\]\(([^)]+)\)/,df=/(https?:\/\/[^\s]+)/g,ff=/_(.*?)_/g,pf=/\*\*(.*?)\*\*/g,hf=/\\n|\n/g,Xo="text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline",gf=e=>{const t=rr(e,cf,(o,s)=>{const[,l,d]=o.match(uf)??[];return d?c("a",{class:Xo,href:d,children:l??d},d+s):c("span",{children:"INVALID LINK"})}),r=rr(t,df,(o,s)=>c("a",{class:Xo,href:o,children:o},o+s)),i=rr(r,ff,(o,s)=>c("em",{children:o},o+s)),n=rr(i,pf,(o,s)=>c("strong",{children:o},o+s));return rr(n,hf,(o,s)=>c("br",{},`br-${s}`))},bf=pt("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative",{variants:{side:{left:"bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",right:"ml-auto bg-accent-9 text-white rounded-br-md shadow-surface-sm shadow-bubble-strong-shadow"},animate:{true:"animate-bubble-in",false:""}},defaultVariants:{side:"left"}}),vf=({children:e,className:t,animate:r,side:i,...n})=>c("p",{style:{transformOrigin:i==="left"?"0% 50%":"100% 50%"},class:bf({className:t,side:i,animate:r}),...n,children:e}),wf=({message:e})=>c("div",{class:"bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",children:c("a",{onClick:e.onClick,class:"bg-lowest shadow-surface-sm ring-accent-6 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 text-wrap-balance flex items-center gap-1.5 rounded-full py-2 pl-4 pr-2.5 text-center no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",target:"_blank",href:e.href,children:[e.text,c("svg",{class:"flex-none",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})})]})}),mf=({className:e,...t})=>c("div",{"aria-hidden":!0,children:ie.isBotTyping$.value===!0?c("div",{"aria-label":"Typing…",class:Ke("flex gap-1 p-4",e),...t,children:Array.from({length:3},(r,i)=>c("div",{class:"bg-accent-9 h-1.5 w-1.5 animate-bounce rounded-full",style:{animationDelay:`${-i*200}ms`}}))}):void 0}),yf={bot:"left",user:"right"},_f=pt("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]",{variants:{variant:{info:"text-neutral-8",warning:"text-[#FFC107]",error:"text-error-9",success:"text-[#4CAF50]"}}}),xf=({lastSentMessageFooter:e})=>{const t=D.current$.value.flow,r=(t==null?void 0:t.data.messages)??[],i=t?Ai(t):void 0;return c("ol",{"aria-label":"Chat messages","aria-live":"polite",class:"mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[r.map((n,a)=>c(X,{children:c("li",{class:"flex",tabIndex:a===r.length-1?-1:void 0,children:[i&&n.groupId===i&&!r.slice(a+1).some(o=>o.groupId===i)?e:null,wr(n).with({type:"system"},o=>c("p",{class:_f({variant:o.variant}),children:o.text})).with({type:"text",author:Ut.union("bot","user")},o=>{const s=a===r.length-1,l=o.author==="bot"?gf(o.text):o.text;return c(X,{children:c(vf,{animate:s,side:yf[o.author],children:l},a)})}).with({type:"link"},o=>c(wf,{message:o})).with({type:"image"},o=>c("img",{class:"shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",src:o.url,style:{aspectRatio:o.width/o.height}})).with({type:"file"},o=>c(sd,{class:o.author==="bot"?void 0:"ml-auto",file:{name:o.fileName,sizeKb:o.fileSizeKb}})).with({type:"loading"},o=>{const s=r[r.length-1];return!(o===s)||ie.isBotTyping$.value?null:c("div",{class:"flex flex-grow flex-col items-center justify-center gap-2",children:[c($r,{"aria-hidden":o.text?"true":void 0,class:"text-neutral-6 h-8 w-8"}),o.text?c("p",{role:"status",class:"text-neutral-11 text-sm",children:o.text}):null]})}).exhaustive()]})},a)),c(mf,{},"typing")]})},kf=({logger:e,apiClient:t,analytics:r,talentBankClient:i})=>{const{flow:n}=D.current$.value;Ye(n,"Flow is required to exist to show chatbot body");const a=D.viewState$.value,{chatRef:o,chatService:s}=Yc(),{t:l}=le(),[d,p]=Ge();return be(()=>{a==="maximised"&&ie.scrollToEnd()},[a]),be(()=>{var v;const{state:u,flow:h}=D.current$.peek();if(u!=="loaded")throw new Error(l("invalid_state"));let b=h.data.nodeHistory.at(-1);if(ie.scrollToEnd(),D.setInput(void 0),h.data.isFinished)return;const m=()=>{const y=D.current$.peek().flow;!y||y.data.hasInteracted||(D.markAsInteracted(),Qa(r,y,"FLOW_INTERACT"))};ie.onInteractionFn$.value=m,b===void 0?(b=Ra(n.nodes).id,D.setCurrentNodeId(b),Qa(r,h,"FLOW_START")):D.removeMessagesSentByNodeIds([b]);const{interpret:_,abort:I,undo:A}=gu({context:n.context,analytics:{service:r,customProperties:(v=n.analytics)==null?void 0:v.customProperties},apiClient:t,logger:e,talentBankClient:i,flow:n,chatService:s,t:l,getApplicationRecovery:()=>{var y;return(y=D.current$.peek().flow)==null?void 0:y.data.applicationRecovery},setApplicationRecovery:D.setApplicationRecovery,persistWriteBarrier:()=>D.persistWriteBarrier(h),getSubmissions:()=>{var y;return(y=D.current$.peek().flow)==null?void 0:y.data.submissions},onInterpret:y=>D.setCurrentNodeId(y.id),onFlowEnd:async()=>{var S;D.markAsFinished();const y=D.current$.peek().flow;Ye(y),r.log({event:"FLOW_END",properties:{flow_id:n.id,flow_version:n.version,flow_session_id:y.data.flowSessionId,flow_build:n.build,job:n.job},customProperties:(S=n.analytics)==null?void 0:S.customProperties})}});return p(()=>A),_(b),()=>{ie.onInteractionFn$.value===m&&(ie.onInteractionFn$.value=()=>{}),I()}},[r,t,s,e,n,i,l]),c(X,{children:[c("div",{class:"relative flex min-h-0 w-full max-w-full flex-grow flex-col",children:[c("div",{ref:o,role:"region","aria-label":l("conversation_history"),tabIndex:0,className:"hide-scrollbars fr flex min-h-0 w-full max-w-full flex-grow flex-col overflow-y-auto ring-inset",style:{WebkitOverflowScrolling:"touch"},children:c(xf,{lastSentMessageFooter:!Ai(n)||!d?null:c(Sf,{undoFn:d})})}),ie.isReadingHistory$.value&&!n.data.isFinished&&!ie.isBotTyping$.value&&c("div",{class:"absolute bottom-2 left-1/2 -translate-x-1/2",children:c(Kt,{class:"bg-neutral-1 ring-divider shadow-surface-md ring-1","aria-label":l("jump_to_current"),onClick:()=>{var h,b;ie.scrollToEnd(),(b=((h=o.current)==null?void 0:h.querySelector('li[tabindex="-1"]'))??o.current)==null||b.focus({preventScroll:!0})},children:c(Ha,{})})})]}),c(tf,{logger:e})]})},Sf=({undoFn:e})=>{const{t}=le();return c("div",{class:"flex flex-1 items-center justify-end px-1",children:c(Kt,{"aria-label":t("undo"),onClick:async()=>{const{flow:r}=D.current$.peek();Ye(r),e(r.data.nodeHistory)},children:c("path",{d:"M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"})})})},Cf=Object.freeze(Object.defineProperty({__proto__:null,ChatbotBody:kf},Symbol.toStringTag,{value:"Module"}))})();
9
+ `)}),s.hasHardConcerns&&e.data.alternativeLink&&await i.sendMessage({type:"link",href:e.data.alternativeLink.href,text:e.data.alternativeLink.label}),await i.userInput({type:"submit",key:void 0,config:{label:e.data.continueLabel}})}return n(e.nextId)}const mt=({class:e,...t})=>{const{t:r}=se();return c("button",{class:We("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50",e),type:"submit",...t,children:c("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",children:[c("title",{children:r("send")}),c("path",{d:"M3.5 7.5L8 3L12.5 7.5"}),c("path",{d:"M8 4V13"})]})})};var Ye;function Tr(e){return{lang:(e==null?void 0:e.lang)??(Ye==null?void 0:Ye.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(Ye==null?void 0:Ye.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(Ye==null?void 0:Ye.abortPipeEarly)}}var Ui;function Bu(e){return Ui==null?void 0:Ui.get(e)}var qi;function Ru(e){return qi==null?void 0:qi.get(e)}var Hi;function zu(e,t){var r;return(r=Hi==null?void 0:Hi.get(e))==null?void 0:r.get(t)}function Ft(e){var r,i;const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((i=(r=Object.getPrototypeOf(e))==null?void 0:r.constructor)==null?void 0:i.name))??"null":t}function ce(e,t,r,i,n){const a=n&&"input"in n?n.input:r.value,o=(n==null?void 0:n.expected)??e.expects??null,s=(n==null?void 0:n.received)??Ft(a),l={kind:e.kind,type:e.type,input:a,expected:o,received:s,message:`Invalid ${t}: ${o?`Expected ${o} but r`:"R"}eceived ${s}`,requirement:e.requirement,path:n==null?void 0:n.path,issues:n==null?void 0:n.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},d=e.kind==="schema",p=(n==null?void 0:n.message)??e.message??zu(e.reference,l.lang)??(d?Ru(l.lang):null)??i.message??Bu(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),d&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function Be(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},Tr())}}}function Uu(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function qu(e,t){const r=[...new Set(e)];return r.length>1?`(${r.join(` ${t} `)})`:r[0]??"never"}function Hu(e){if(e.path){let t="";for(const r of e.path)if(typeof r.key=="string"||typeof r.key=="number")t?t+=`.${r.key}`:t+=r.key;else return null;return t}return null}var Wu=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}},Ku=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function fo(e,t){return{kind:"validation",type:"check",reference:fo,async:!1,expects:null,requirement:e,message:t,"~run"(r,i){return r.typed&&!this.requirement(r.value)&&ce(this,"input",r,i),r}}}function po(e){return{kind:"validation",type:"email",reference:po,expects:null,async:!1,requirement:Ku,message:e,"~run"(t,r){return t.typed&&!this.requirement.test(t.value)&&ce(this,"email",t,r),t}}}function Xt(e,t){return{kind:"validation",type:"max_length",reference:Xt,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&r.value.length>this.requirement&&ce(this,"length",r,i,{received:`${r.value.length}`}),r}}}function ho(e,t){return{kind:"validation",type:"max_value",reference:ho,async:!1,expects:`<=${e instanceof Date?e.toJSON():Ft(e)}`,requirement:e,message:t,"~run"(r,i){return r.typed&&!(r.value<=this.requirement)&&ce(this,"value",r,i,{received:r.value instanceof Date?r.value.toJSON():Ft(r.value)}),r}}}function Tt(e,t){return{kind:"validation",type:"min_length",reference:Tt,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&r.value.length<this.requirement&&ce(this,"length",r,i,{received:`${r.value.length}`}),r}}}function go(e,t){return{kind:"validation",type:"min_value",reference:go,async:!1,expects:`>=${e instanceof Date?e.toJSON():Ft(e)}`,requirement:e,message:t,"~run"(r,i){return r.typed&&!(r.value>=this.requirement)&&ce(this,"value",r,i,{received:r.value instanceof Date?r.value.toJSON():Ft(r.value)}),r}}}function Wi(e,t){return{kind:"validation",type:"regex",reference:Wi,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(r,i){return r.typed&&!this.requirement.test(r.value)&&ce(this,"format",r,i),r}}}function Ki(e){return{kind:"transformation",type:"transform",reference:Ki,async:!1,operation:e,"~run"(t){return t.value=this.operation(t.value),t}}}function bo(e){return{kind:"validation",type:"url",reference:bo,async:!1,expects:null,requirement(t){try{return new URL(t),!0}catch{return!1}},message:e,"~run"(t,r){return t.typed&&!this.requirement(t.value)&&ce(this,"URL",t,r),t}}}function Gu(e,t,r){return typeof e.fallback=="function"?e.fallback(t,r):e.fallback}function vo(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function wo(e,t){return{kind:"schema",type:"array",reference:wo,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return Be(this)},"~run"(r,i){var a;const n=r.value;if(Array.isArray(n)){r.typed=!0,r.value=[];for(let o=0;o<n.length;o++){const s=n[o],l=this.item["~run"]({value:s},i);if(l.issues){const d={type:"array",origin:"value",input:n,key:o,value:s};for(const p of l.issues)p.path?p.path.unshift(d):p.path=[d],(a=r.issues)==null||a.push(p);if(r.issues||(r.issues=l.issues),i.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value.push(l.value)}}else ce(this,"type",r,i);return r}}}function mo(e){return{kind:"schema",type:"boolean",reference:mo,expects:"boolean",async:!1,message:e,get"~standard"(){return Be(this)},"~run"(t,r){return typeof t.value=="boolean"?t.typed=!0:ce(this,"type",t,r),t}}}function yo(e){return{kind:"schema",type:"number",reference:yo,expects:"number",async:!1,message:e,get"~standard"(){return Be(this)},"~run"(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:ce(this,"type",t,r),t}}}function Je(e,t){return{kind:"schema",type:"object",reference:Je,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return Be(this)},"~run"(r,i){var a;const n=r.value;if(n&&typeof n=="object"){r.typed=!0,r.value={};for(const o in this.entries){const s=this.entries[o];if(o in n||(s.type==="exact_optional"||s.type==="optional"||s.type==="nullish")&&s.default!==void 0){const l=o in n?n[o]:vo(s),d=s["~run"]({value:l},i);if(d.issues){const p={type:"object",origin:"value",input:n,key:o,value:l};for(const u of d.issues)u.path?u.path.unshift(p):u.path=[p],(a=r.issues)==null||a.push(u);if(r.issues||(r.issues=d.issues),i.abortEarly){r.typed=!1;break}}d.typed||(r.typed=!1),r.value[o]=d.value}else if(s.fallback!==void 0)r.value[o]=Gu(s);else if(s.type!=="exact_optional"&&s.type!=="optional"&&s.type!=="nullish"&&(ce(this,"key",r,i,{input:void 0,expected:`"${o}"`,path:[{type:"object",origin:"key",input:n,key:o,value:n[o]}]}),i.abortEarly))break}}else ce(this,"type",r,i);return r}}}function Zt(e,t){return{kind:"schema",type:"optional",reference:Zt,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return Be(this)},"~run"(r,i){return r.value===void 0&&(this.default!==void 0&&(r.value=vo(this,r,i)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,i)}}}function _o(e,t){return{kind:"schema",type:"picklist",reference:_o,expects:qu(e.map(Ft),"|"),async:!1,options:e,message:t,get"~standard"(){return Be(this)},"~run"(r,i){return this.options.includes(r.value)?r.typed=!0:ce(this,"type",r,i),r}}}function xo(e,t,r){return{kind:"schema",type:"record",reference:xo,expects:"Object",async:!1,key:e,value:t,message:r,get"~standard"(){return Be(this)},"~run"(i,n){var o,s;const a=i.value;if(a&&typeof a=="object"){i.typed=!0,i.value={};for(const l in a)if(Uu(a,l)){const d=a[l],p=this.key["~run"]({value:l},n);if(p.issues){const h={type:"object",origin:"key",input:a,key:l,value:d};for(const b of p.issues)b.path=[h],(o=i.issues)==null||o.push(b);if(i.issues||(i.issues=p.issues),n.abortEarly){i.typed=!1;break}}const u=this.value["~run"]({value:d},n);if(u.issues){const h={type:"object",origin:"value",input:a,key:l,value:d};for(const b of u.issues)b.path?b.path.unshift(h):b.path=[h],(s=i.issues)==null||s.push(b);if(i.issues||(i.issues=u.issues),n.abortEarly){i.typed=!1;break}}(!p.typed||!u.typed)&&(i.typed=!1),p.typed&&(i.value[p.value]=u.value)}}else ce(this,"type",i,n);return i}}}function ke(e){return{kind:"schema",type:"string",reference:ke,expects:"string",async:!1,message:e,get"~standard"(){return Be(this)},"~run"(t,r){return typeof t.value=="string"?t.typed=!0:ce(this,"type",t,r),t}}}function Yu(e,t,r){const i=e["~run"]({value:t},Tr(r));if(i.issues)throw new Wu(i.issues);return i.value}function Ju(e,t){const r={};for(const i in e.entries)r[i]=!t||t.includes(i)?Zt(e.entries[i]):e.entries[i];return{...e,entries:r,get"~standard"(){return Be(this)}}}function at(...e){return{...e[0],pipe:e,get"~standard"(){return Be(this)},"~run"(t,r){for(const i of e)if(i.kind!=="metadata"){if(t.issues&&(i.kind==="schema"||i.kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=i["~run"](t,r))}return t}}}function Xu(e,t,r){const i=e["~run"]({value:t},Tr(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}async function Zu(e,t,r){const i=await e["~run"]({value:t},Tr(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}const Dt=({error:e})=>!e||!e.message?null:c("div",{role:"alert",class:"text-error-11 flex max-w-full items-start gap-1 overflow-hidden rounded-2xl px-2 py-2",children:[c("svg",{class:"text-error-9 mt-0.5 h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c("circle",{cx:"8",cy:"8",r:"6.3",stroke:"currentColor","stroke-width":"1.4"}),c("rect",{x:"7",y:"4",width:"2",height:"5",fill:"currentColor"}),c("rect",{x:"7",y:"10",width:"2",height:"2",fill:"currentColor"})]}),c("p",{class:"break-words pr-1 text-sm",children:e.message})]}),yt=({class:e,...t})=>{const{t:r}=se();return c("button",{type:"button",class:We("fr touch-hitbox text-neutral-10 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all",e),...t,children:[c("svg",{"aria-hidden":!0,class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"1.5",children:[c("title",{children:r("skip")}),c("path",{d:"M3.25 11.25A5 5 0 0 1 12 7"}),c("path",{d:"M13.25 4.5V8.25H9.5"})]}),r("skip")]})};var Gi={Afghanistan:"93",Albania:"355",Algeria:"213","American Samoa":"1 684",Andorra:"376",Angola:"244",Anguilla:"1 264",Antarctica:"672","Antigua and Barbuda":"1 268",Argentina:"54",Armenia:"374",Aruba:"297",Australia:"61",Austria:"43",Azerbaijan:"994",Bahrain:"973",Bangladesh:"880",Barbados:"1 246",Belarus:"375",Belgium:"32",Belize:"501",Benin:"229",Bermuda:"1 441",Bhutan:"975",Bolivia:"591","Bosnia and Herzegovina":"387",Botswana:"267","Bouvet Island":"47",Brazil:"55","British Indian Ocean Territory":"246","British Virgin Islands":"1 284",Brunei:"673",Bulgaria:"359","Burkina Faso":"226",Burundi:"257","Cabo Verde":"238",Cambodia:"855",Cameroon:"237",Canada:"1","Caribbean Netherlands":"599","Cayman Islands":"1 345","Central African Republic":"236",Chad:"235",Chile:"56",China:"86","Christmas Island":"61","Cocos (Keeling) Islands":"61",Colombia:"57",Comoros:"269","Cook Islands":"682","Costa Rica":"506",Croatia:"385",Cuba:"53",Curaçao:"599",Cyprus:"357",Czechia:"420","Côte d'Ivoire":"225","Democratic Republic of the Congo":"243",Denmark:"45",Djibouti:"253","Dominican Republic":"1 809",Ecuador:"593",Egypt:"20","El Salvador":"503","Equatorial Guinea":"240",Eritrea:"291",Estonia:"372",Eswatini:"268",Ethiopia:"251","Falkland Islands (Islas Malvinas)":"500","Faroe Islands":"298",Fiji:"679",Finland:"358",France:"33","French Guiana":"594","French Polynesia":"689","French Southern and Antarctic Lands":"262",Gabon:"241",Georgia:"995",Germany:"49",Ghana:"233",Gibraltar:"350",Greece:"30",Greenland:"299",Grenada:"1 473",Guadeloupe:"590",Guam:"1 671",Guatemala:"502",Guernsey:"44",Guinea:"224","Guinea-Bissau":"245",Guyana:"592",Haiti:"509",Honduras:"504","Hong Kong":"852",Hungary:"36",Iceland:"354",India:"91",Indonesia:"62",Iran:"98",Iraq:"964",Ireland:"353","Isle of Man":"44",Israel:"972",Italy:"39",Jamaica:"1 876",Japan:"81",Jersey:"44",Jordan:"962",Kazakhstan:"7",Kenya:"254",Kiribati:"686",Kosovo:"383",Kuwait:"965",Kyrgyzstan:"996",Laos:"856",Latvia:"371",Lebanon:"961",Lesotho:"266",Liberia:"231",Libya:"218",Liechtenstein:"423",Lithuania:"370",Luxembourg:"352",Macao:"853",Madagascar:"261",Malawi:"265",Malaysia:"60",Maldives:"960",Mali:"223",Malta:"356","Marshall Islands":"692",Martinique:"596",Mauritania:"222",Mauritius:"230",Mayotte:"262",Mexico:"52",Micronesia:"691",Moldova:"373",Monaco:"377",Mongolia:"976",Montenegro:"382",Montserrat:"1 664",Morocco:"212",Mozambique:"258","Myanmar (Burma)":"95",Namibia:"264",Nauru:"674",Nepal:"977",Netherlands:"31","New Caledonia":"687","New Zealand":"64",Nicaragua:"505",Niger:"227",Nigeria:"234",Niue:"683","Norfolk Island":"672","North Korea":"850","North Macedonia":"389","Northern Mariana Islands":"1 670",Norway:"47",Oman:"968",Pakistan:"92",Palau:"680",Palestine:"970",Panama:"507","Papua New Guinea":"675",Paraguay:"595",Peru:"51",Philippines:"63","Pitcairn Islands":"64",Poland:"48",Portugal:"351","Puerto Rico":"1 787",Qatar:"974",Romania:"40",Russia:"7",Rwanda:"250",Réunion:"262","Saint Barthélemy":"590","Saint Helena, Ascension and Tristan da Cunha":"290","Saint Kitts and Nevis":"1 869","Saint Lucia":"1 758","Saint Martin":"590","Saint Pierre and Miquelon":"508","Saint Vincent and the Grenadines":"1 784",Samoa:"685","San Marino":"378","Saudi Arabia":"966",Senegal:"221",Serbia:"381",Seychelles:"248","Sierra Leone":"232",Singapore:"65","Sint Maarten":"1 721",Slovakia:"421",Slovenia:"386","Solomon Islands":"677",Somalia:"252","South Africa":"27","South Georgia and the South Sandwich Islands":"500","South Korea":"82","South Sudan":"211",Spain:"34","Sri Lanka":"94",Sudan:"249",Suriname:"597","Svalbard and Jan Mayen":"47",Sweden:"46",Switzerland:"41",Syria:"963","São Tomé and Príncipe":"239",Taiwan:"886",Tajikistan:"992",Tanzania:"255",Thailand:"66","The Bahamas":"1 242","The Gambia":"220","Timor-Leste":"670",Togo:"228",Tokelau:"690",Tonga:"676","Trinidad and Tobago":"1 868",Tunisia:"216",Turkmenistan:"993","Turks and Caicos Islands":"1 649",Tuvalu:"688",Türkiye:"90","U.S. Virgin Islands":"1 340",Uganda:"256",Ukraine:"380","United Arab Emirates":"971","United Kingdom":"44","United States":"1","United States Minor Outlying Islands":"1",Uruguay:"598",Uzbekistan:"998",Vanuatu:"678","Vatican City":"379",Venezuela:"58",Vietnam:"84","Wallis and Futuna":"681","Western Sahara":"212",Yemen:"967",Zambia:"260",Zimbabwe:"263","Åland Islands":"358"};const Qt=gt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all",{variants:{optional:{true:"pr-16 pl-3",false:"pl-3 pr-3"}},defaultVariants:{optional:!1}}),Qu="https://api.mapbox.com/search/searchbox/v1/suggest",ed="ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==",td=e=>atob(e).split("").reverse().join(""),Xe=Je({name:ke()}),rd=Je({suggestions:wo(Je({full_address:Zt(ke()),place_formatted:Zt(ke()),name:Zt(ke()),mapbox_id:ke(),context:Ju(Je({address:Xe,street:Xe,neighborhood:Xe,locality:Xe,district:Xe,place:Xe,region:Xe,postcode:Xe,country:Xe}))}))}),id=({logger:e,t})=>et(()=>{var i;const r=(i=D.current$.peek().flow)==null?void 0:i.data.flowSessionId;return r?{enabled:!0,getPredictions:async n=>{var u;const a=new URL(Qu);a.searchParams.set("q",n),a.searchParams.set("session_token",r);const o=(u=D.current$.peek().flow)==null?void 0:u.locationOrigin;o&&o.lat!==void 0&&o.lng!==void 0&&o.lat>=-90&&o.lat<=90&&o.lng>=-180&&o.lng<=180&&a.searchParams.set("proximity",`${o.lng},${o.lat}`),a.searchParams.set("access_token",td(ed));const l=await fetch(a);if(!l.ok)return e.error("Failed to get address details",l),{ok:!1,error:t("address_error")};const d=Xu(rd,await l.json());if(d.success===!1)return e.error("Failed to parse address details",d.issues),{ok:!1,error:t("address_error")};const{suggestions:p}=d.output;return{ok:!0,data:p.map(h=>{var b,m,k,A,x,v,y,S,E;return{label:h.full_address??h.place_formatted??h.name??h.mapbox_id,id:h.mapbox_id,address:{line1:((b=h.context.address)==null?void 0:b.name)??((m=h.context.street)==null?void 0:m.name),line2:void 0,line3:((k=h.context.neighborhood)==null?void 0:k.name)??((A=h.context.locality)==null?void 0:A.name),city:((x=h.context.place)==null?void 0:x.name)??((v=h.context.district)==null?void 0:v.name),state:(y=h.context.region)==null?void 0:y.name,postcode:(S=h.context.postcode)==null?void 0:S.name,country:(E=h.context.country)==null?void 0:E.name}}})}}}:{enabled:!1}},[e,t]),ko=e=>{const{t}=se();return c("button",{type:"button",class:"touch-hitbox text-neutral-10 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 relative flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",...e,children:[c("svg",{width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M10 3L5 8L10 13"})}),c("span",{children:t("back")})]})},nd=({input:e,onSubmitSuccess:t,logger:r})=>{const{t:i}=se(),[n,a]=Ne(),{enabled:o,getPredictions:s}=id({logger:r,t:i}),[l,d]=Ne(o?"query":"manual"),[p,u]=Ne(""),[h,b]=Ne(),m=me(),k=me(),A=v=>{var S;if(Ke(o,"Query state should not be enabled"),v=v.trim(),v===((S=m.current)==null?void 0:S.query)||v===(h==null?void 0:h.query)&&h.status==="done")return;if(u(v),v===""){m.current=void 0,b(void 0);return}const y=m.current={query:v};b({query:v,status:"pending"}),s(v).then(E=>{m.current===y&&(m.current=void 0,b(E.ok?{query:v,status:"done",items:E.data}:{query:v,status:"failed",error:E.error}))},E=>{m.current===y&&(m.current=void 0,r.error("Failed to get address details",E),b({query:v,status:"failed",error:i("address_error")}))})},x=(v,y)=>{a(S=>({...S,[v]:y}))};switch(l){case"query":return Ke(o,"Query state should not be enabled"),c(ad,{input:e,onSkip:()=>t(null),onAddressSelect:v=>{if(v===""){m.current&&(m.current=void 0,b(void 0)),d("manual");return}const y=(h==null?void 0:h.status)==="done"?h.items.find(S=>S.id===v):void 0;y&&(k.current!==v&&a(y.address),k.current=v,d("details"))},onAddressSearch:A,lookup:h,query:p});case"details":return Ke(n!==void 0),c(Co,{input:e,logger:r,onSubmitSuccess:t,addressFields:n,onFieldChange:x,actions:c(ko,{onClick:()=>{d("query")}})});case"manual":return c(Co,{logger:r,input:e,onSubmitSuccess:t,addressFields:n??{},onFieldChange:x,actions:o?c(ko,{onClick:()=>{d("query")}}):void 0})}},ad=({input:e,onSkip:t,lookup:r,onAddressSelect:i,query:n,onAddressSearch:a})=>{const{t:o}=se(),s=me(null);return we(()=>{s.current&&(s.current.focus(),s.current.select())},[]),c(ee,{children:[c("form",{noValidate:!0,onSubmit:l=>{l.preventDefault();const p=new FormData(l.currentTarget).get("address");typeof p=="string"&&a(p)},class:"flex gap-2 p-2.5",children:[c("div",{class:"group relative flex-1",children:[c("input",{ref:s,name:"address",id:"chat-address",autocomplete:"address-line1 country-name postal-code",autoFocus:!0,placeholder:e.config.placeholder||o("address_search"),defaultValue:n,class:Qt({optional:!!e.config.optional,className:"w-full rounded-full"})}),c("button",{type:"submit",class:"touch-hitbox text-neutral-12 hover:bg-neutral-3 fr absolute bottom-0 right-0 top-0 flex cursor-pointer items-center gap-1 rounded-full px-3 transition-all",children:[c("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("g",{id:"inploi",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",strokeWidth:"1.5",children:[c("circle",{cx:"7",cy:"7",r:"4"}),c("path",{d:"M10 10L13 13"})]})}),c("span",{class:"sr-only",children:o("search")})]})]}),e.config.optional&&c(yt,{class:"relative",onClick:t})]}),(r==null?void 0:r.status)==="failed"?c(Dt,{error:{message:r.error}}):null,c("p",{role:"status",class:(r==null?void 0:r.status)==="pending"||(r==null?void 0:r.status)==="done"&&r.items.length===0?"text-neutral-10 flex items-center gap-2 px-4 py-2 text-sm":"sr-only",children:(r==null?void 0:r.status)==="pending"?c(ee,{children:[c(Nr,{"aria-hidden":"true",class:"h-4 w-4 shrink-0"}),o("address_searching")]}):(r==null?void 0:r.status)==="done"&&r.items.length===0?o("address_no_results"):null}),c("ul",{children:[((r==null?void 0:r.status)==="done"?r.items:[]).map(l=>c("li",{children:c("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{i(l.id)},children:[c("span",{class:"flex-grow",children:l.label}),c("svg",{class:"flex-none",width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M6 3L11 8L6 13"})})]})},l.id)),c("li",{children:c("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{i("")},children:c("span",{class:"flex-grow",children:o("address_manual")})})},"")]})]})},So=["line1","line2","line3","city","state","postcode","country"],Co=({addressFields:e,onFieldChange:t,onSubmitSuccess:r,actions:i,input:n})=>{const a=me(null);we(()=>{if(a.current){const l=a.current.querySelector("input");l&&(l.focus(),l.select())}},[]);const o=Object.keys(Gi),{t:s}=se();return c("form",{class:"flex flex-col px-2 pt-2",onSubmit:l=>{const d=new FormData(l.currentTarget),p=Object.fromEntries(d.entries());r({type:"address",value:p})},children:[c("div",{class:"bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",ref:a,children:So.map((l,d)=>{const p=`isdk_${l}`,u=n.config.keys[l];return u?c(ee,{children:[c("label",{for:p,class:"text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",children:s(l)}),c("div",{class:"flex flex-col items-stretch gap-1.5",children:[l==="country"?c("div",{class:"relative",children:[c("select",{class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",name:u,id:p,defaultValue:e[l],onChange:h=>t(l,h.currentTarget.value),required:!0,children:[e.country&&!o.includes(e.country)?c("option",{value:e[l],children:e[l]}):c("option",{value:"",children:s("select_country")}),o.map(h=>c("option",{value:h,children:h},h))]}),c("svg",{class:"text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",width:"16",height:"16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M4 6.5L8 10.5L12 6.5"})})]}):c("input",{autoFocus:d===0?!0:void 0,class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",name:u,id:p,defaultValue:e[l],onInput:h=>t(l,h.currentTarget.value),required:!0}),d===So.length-1?c("hr",{class:"m-0 w-full border-b border-b-transparent"}):c("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"})]})]}):null})}),c("div",{class:"bg-neutral-1 sticky bottom-0 flex items-center py-2",children:[i,c(mt,{class:"ml-auto"})]})]})},Yi=()=>{const e=me(null);return wr(()=>{var t;(t=e.current)==null||t.focus()},[]),e},$o=["true","false"],od=_o($o),sd="answer",Eo="flex items-center flex-wrap gap-2 p-2.5",Io="min-w-0 max-w-full flex-auto",Ao=gi(({label:e,...t},r)=>c("button",{class:"bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2 py-2.5 ring-2 transition-all selection:bg-transparent",...t,ref:r,children:c("p",{class:"text-center text-base",children:e})})),ld=({input:e,onSubmitSuccess:t})=>{const r=Yi();return c("form",{noValidate:!0,class:"",onSubmit:i=>{i.preventDefault();const n=Lc(i).value,a=Yu(od,n);t({type:"boolean",value:a==="true"})},children:[c("ul",{class:Eo,children:$o.map((i,n)=>c("li",{class:Io,children:c(Ao,{ref:n===0?r:null,type:"submit",name:sd,value:i,label:e.config.labels[i]},i)}))}),e.config.optional&&c("div",{class:"px-2 pb-2",children:c(yt,{class:"relative w-full",type:"button",onClick:()=>t(null)})})]})},cd=e=>new Promise((t,r)=>{const i=new FileReader;i.onload=()=>{if(typeof i.result!="string"||!i.result)return r(new Error("Invalid file"));t(i.result)},i.onerror=r,i.readAsDataURL(e)}),No=e=>e.reduce((t,r)=>t+r.sizeKb,0),ud=Nt("file"),Fo=3,Dr=e=>{const t=e.lastIndexOf(".");return t===-1?[e,""]:[e.slice(0,t),e.slice(t)]},dd=({file:e,class:t,...r})=>{const[i,n]=Dr(e.name);return c("div",{class:We("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline",t),...r,children:[c("p",{"aria-label":"File name",class:"text-accent-12 flex flex-grow overflow-hidden",children:[c("span",{class:"block truncate",children:i}),c("span",{children:n})]}),c("p",{"aria-label":"File size",class:"text-accent-11",children:Ot(e.sizeKb)})]})},To=({class:e,...t})=>c("li",{class:We("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...t}),fd=(e,t)=>{const[r,i]=Dr(e);return`${r.slice(0,t)}${i}`},Do=e=>({name:fd(e.name,42),sizeKb:e.size/1e3}),pd=[".heic",".heif",".jpg",".jpeg",".png",".gif",".webp",".txt",".rtf",".odt",".pages",".zip"],hd=(e,t,r)=>{const i=Dr(t.name)[1].toLowerCase(),n=[...r.map(o=>o.toLowerCase()),...pd],a=i===""?"none":n.includes(i)?i:"other";return`chatbot-file-refused:${e}:${a}`},gd=({input:e,onSubmitSuccess:t,analytics:r})=>{var A;const i=(A=D.current$.value.flow)==null?void 0:A.data.submissions[e.key],[n,a]=Ne(ud(i)&&i.value.length?{status:"ready",files:i.value}:{status:"empty"}),o=me(0),s=n.status==="ready"?n.files:[],l=n.status==="ready"||n.status==="pending"?n.files:[],d=n.status==="error"?n.error:void 0,p=l.length-Fo,u=No(l),h=Yi(),{t:b}=se(),m=x=>{if(!x.length)return{reason:"required",error:{type:"required",message:b("validation_file")}};if(!yn(x,e.config.extensions))return{reason:"type",file:x.find(v=>!yn([v],e.config.extensions)),error:{type:"validate",message:b("validation_file_ext",{ext:e.config.extensions.join(", ")})}};if(e.config.fileSizeLimitKib&&No(x)>e.config.fileSizeLimitKib)return{reason:"size",error:{type:"max",message:b("validation_file_size",{size:Ot(e.config.fileSizeLimitKib)})}};if(!e.config.allowMultiple&&x.length>1)return{reason:"count",error:{type:"invalid",message:b("validation_file_max",{count:1})}}},k=(x,v)=>{var y,S;return r.log({event:"INTERACTION",properties:{tag:hd(x,v,e.config.extensions)},customProperties:(S=(y=D.current$.peek().flow)==null?void 0:y.analytics)==null?void 0:S.customProperties})};return c("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:x=>{if(x.preventDefault(),n.status==="pending"||n.status==="error")return;const v=m(s);v?a({status:"error",error:v.error}):t({type:"file",value:s})},children:[c("div",{class:"flex items-center gap-2",children:[c("label",{ref:h,for:"dropzone-file",class:"border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",children:[l.length>0?c("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[l.slice(0,Fo).map(x=>{const[v,y]=Dr(x.name);return c(To,{class:"flex overflow-hidden",children:[c("span",{class:"block truncate",children:v}),c("span",{children:y})]})}),p>0?c(To,{children:["+",p," file",p!==1?"s":""]}):null]}):c("div",{class:"flex flex-col justify-center gap-4 pb-6 pt-5",children:[c("header",{class:"flex flex-col items-center gap-0",children:[c("svg",{class:"text-neutral-11 mb-1 h-8 w-8","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:c("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),c("p",{class:"text-neutral-12 tracking-[-0.01em]",children:b("upload_file",{count:e.config.allowMultiple?2:1})}),e.config.fileSizeLimitKib?c("p",{class:"text-neutral-10 text-xs",children:["(",b("file_max_size",{size:Ot(e.config.fileSizeLimitKib)}),")"]}):null]}),c("aside",{class:"flex flex-col items-center gap-2",children:[c("p",{id:"accepted-filetypes",class:"sr-only",children:b("file_extensions")}),c("ul",{"aria-describedby":"accepted-filetypes",class:"flex flex-wrap justify-center gap-2",children:e.config.extensions.map(x=>c("li",{class:"ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",children:x.replace(".","")}))})]})]}),c("p",{role:"status",class:We("text-neutral-11 flex items-center gap-1.5 text-xs",l.length===0&&"sr-only"),children:n.status==="pending"?c(ee,{children:[c(Nr,{"aria-hidden":"true",class:"h-4 w-4"}),b("file_preparing",{count:l.length})]}):n.status==="ready"?c(ee,{children:[Ot(u)," ",s.length>1?"total":"",c("span",{class:"sr-only",children:[". ",b("file_ready",{count:s.length})]})]}):null}),c("input",{id:"dropzone-file",onInput:async x=>{Ke(x.target instanceof HTMLInputElement);const v=x.target.files?Array.from(x.target.files):[];x.target.value="";const[y]=v;if(!y)return;const S=++o.current,E=n.status==="ready",M=v.map(Do),R=m(M);if(R)return k(R.reason,R.file??y),a({status:"error",error:R.error});a({status:"pending",files:M});let V;try{const O=await Promise.all(v.map(async L=>{try{return{...Do(L),data:await cd(L)}}catch(K){throw V??(V=L),K}}));o.current===S&&a({status:"ready",files:O})}catch{if(o.current!==S)return;k("unreadable",V??y),a({status:"error",error:{type:"invalid",message:b(E?"file_read_error_replacement":"file_read_error")}})}},multiple:e.config.allowMultiple,accept:e.config.extensions.join(","),type:"file",class:"sr-only"})]}),c("div",{class:"flex h-full flex-col items-center gap-2",children:[c(mt,{disabled:s.length===0}),e.config.optional&&c(yt,{class:"relative",onClick:()=>t(null)})]})]}),c(Dt,{error:d})]})};var er=e=>e.type==="checkbox",_t=e=>e instanceof Date,ye=e=>e==null;const Mo=e=>typeof e=="object";var re=e=>!ye(e)&&!Array.isArray(e)&&Mo(e)&&!_t(e),bd=e=>re(e)&&e.target?er(e.target)?e.target.checked:e.target.value:e,vd=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,wd=(e,t)=>e.has(vd(t)),md=e=>{const t=e.constructor&&e.constructor.prototype;return re(t)&&t.hasOwnProperty("isPrototypeOf")},Ji=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function oe(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Ji&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(re(e)&&md(e)))return e;const i=r?[]:Object.create(Object.getPrototypeOf(e));for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=oe(e[n]));return i}var Mr=e=>/^\w*$/.test(e),X=e=>e===void 0,Xi=e=>Array.isArray(e)?e.filter(Boolean):[],Zi=e=>Xi(e.replace(/["|']|\]/g,"").split(/\.|\[/)),N=(e,t,r)=>{if(!t||!re(e))return r;const i=(Mr(t)?[t]:Zi(t)).reduce((n,a)=>ye(n)?n:n[a],e);return X(i)||i===e?X(e[t])?r:e[t]:i},Re=e=>typeof e=="boolean",Fe=e=>typeof e=="function",W=(e,t,r)=>{let i=-1;const n=Mr(t)?[t]:Zi(t),a=n.length,o=a-1;for(;++i<a;){const s=n[i];let l=r;if(i!==o){const d=e[s];l=re(d)||Array.isArray(d)?d:isNaN(+n[i+1])?{}:[]}if(s==="__proto__"||s==="constructor"||s==="prototype")return;e[s]=l,e=e[s]}};const Vo={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Te={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ze={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},yd=pe.createContext(null);yd.displayName="HookFormControlContext";var _d=(e,t,r,i=!0)=>{const n={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Te.all&&(t._proxyFormState[o]=!i||Te.all),r&&(r[o]=!0),e[o]}});return n};const xd=typeof window<"u"?pe.useLayoutEffect:pe.useEffect;var Se=e=>typeof e=="string",kd=(e,t,r,i,n)=>Se(e)?(i&&t.watch.add(e),N(r,e,n)):Array.isArray(e)?e.map(a=>(i&&t.watch.add(a),N(r,a))):(i&&(t.watchAll=!0),r),Qi=e=>ye(e)||!Mo(e);function ot(e,t,r=new WeakSet){if(Qi(e)||Qi(t))return Object.is(e,t);if(_t(e)&&_t(t))return Object.is(e.getTime(),t.getTime());const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of i){const o=e[a];if(!n.includes(a))return!1;if(a!=="ref"){const s=t[a];if(_t(o)&&_t(s)||re(o)&&re(s)||Array.isArray(o)&&Array.isArray(s)?!ot(o,s,r):!Object.is(o,s))return!1}}return!0}const Sd=pe.createContext(null);Sd.displayName="HookFormContext";var Po=(e,t,r,i,n)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:n||!0}}:{},tr=e=>Array.isArray(e)?e:[e],Oo=()=>{let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}};function Lo(e,t){const r={};for(const i in e)if(e.hasOwnProperty(i)){const n=e[i],a=t[i];if(n&&re(n)&&a){const o=Lo(n,a);re(o)&&(r[i]=o)}else e[i]&&(r[i]=a)}return r}var be=e=>re(e)&&!Object.keys(e).length,en=e=>e.type==="file",Vr=e=>{if(!Ji)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},jo=e=>e.type==="select-multiple",tn=e=>e.type==="radio",Cd=e=>tn(e)||er(e),rn=e=>Vr(e)&&e.isConnected;function $d(e,t){const r=t.slice(0,-1).length;let i=0;for(;i<r;)e=X(e)?i++:e[t[i++]];return e}function Ed(e){for(const t in e)if(e.hasOwnProperty(t)&&!X(e[t]))return!1;return!0}function ie(e,t){const r=Array.isArray(t)?t:Mr(t)?[t]:Zi(t),i=r.length===1?e:$d(e,r),n=r.length-1,a=r[n];return i&&delete i[a],n!==0&&(re(i)&&be(i)||Array.isArray(i)&&Ed(i))&&ie(e,r.slice(0,-1)),e}var Id=e=>{for(const t in e)if(Fe(e[t]))return!0;return!1};function Bo(e){return Array.isArray(e)||re(e)&&!Id(e)}function nn(e,t={}){for(const r in e){const i=e[r];Bo(i)?(t[r]=Array.isArray(i)?[]:{},nn(i,t[r])):X(i)||(t[r]=!0)}return t}function Mt(e,t,r){r||(r=nn(t));for(const i in e){const n=e[i];if(Bo(n))X(t)||Qi(r[i])?r[i]=nn(n,Array.isArray(n)?[]:{}):Mt(n,ye(t)?{}:t[i],r[i]);else{const a=t[i];r[i]=!ot(n,a)}}return r}const Ro={value:!1,isValid:!1},zo={value:!0,isValid:!0};var Uo=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!X(e[0].attributes.value)?X(e[0].value)||e[0].value===""?zo:{value:e[0].value,isValid:!0}:zo:Ro}return Ro},qo=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:i})=>X(e)?e:t?e===""?NaN:e&&+e:r&&Se(e)?new Date(e):i?i(e):e;const Ho={isValid:!1,value:null};var Wo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Ho):Ho;function Ko(e){const t=e.ref;return en(t)?t.files:tn(t)?Wo(e.refs).value:jo(t)?[...t.selectedOptions].map(({value:r})=>r):er(t)?Uo(e.refs).value:qo(X(t.value)?e.ref.value:t.value,e)}var Ad=(e,t,r,i)=>{const n={};for(const a of e){const o=N(t,a);o&&W(n,a,o._f)}return{criteriaMode:r,names:[...e],fields:n,shouldUseNativeValidation:i}},Pr=e=>e instanceof RegExp,rr=e=>X(e)?e:Pr(e)?e.source:re(e)?Pr(e.value)?e.value.source:e.value:e,Go=e=>({isOnSubmit:!e||e===Te.onSubmit,isOnBlur:e===Te.onBlur,isOnChange:e===Te.onChange,isOnAll:e===Te.all,isOnTouch:e===Te.onTouched});const Yo="AsyncFunction";var Nd=e=>!!e&&!!e.validate&&!!(Fe(e.validate)&&e.validate.constructor.name===Yo||re(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Yo)),Fd=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Jo=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const ir=(e,t,r,i)=>{for(const n of r||Object.keys(e)){const a=N(e,n);if(a){const{_f:o,...s}=a;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],n)&&!i)return!0;if(o.ref&&t(o.ref,o.name)&&!i)return!0;if(ir(s,t))break}else if(re(s)&&ir(s,t))break}}};function Xo(e,t,r){const i=N(e,r);if(i||Mr(r))return{error:i,name:r};const n=r.split(".");for(;n.length;){const a=n.join("."),o=N(t,a),s=N(e,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(s&&s.type)return{name:a,error:s};if(s&&s.root&&s.root.type)return{name:`${a}.root`,error:s.root};n.pop()}return{name:r}}var Td=(e,t,r,i)=>{r(e);const{name:n,...a}=e;return be(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!i||Te.all))},Dd=(e,t,r)=>!e||!t||e===t||tr(e).some(i=>i&&(r?i===t:i.startsWith(t)||t.startsWith(i))),Md=(e,t,r,i,n)=>n.isOnAll?!1:!r&&n.isOnTouch?!(t||e):(r?i.isOnBlur:n.isOnBlur)?!e:(r?i.isOnChange:n.isOnChange)?e:!0,Vd=(e,t)=>!Xi(N(e,t)).length&&ie(e,t),Pd=(e,t,r)=>{const i=tr(N(e,r));return W(i,"root",t[r]),W(e,r,i),e};function Zo(e,t,r="validate"){if(Se(e)||Array.isArray(e)&&e.every(Se)||Re(e)&&!e)return{type:r,message:Se(e)?e:"",ref:t}}var Vt=e=>re(e)&&!Pr(e)?e:{value:e,message:""},Qo=async(e,t,r,i,n,a)=>{const{ref:o,refs:s,required:l,maxLength:d,minLength:p,min:u,max:h,pattern:b,validate:m,name:k,valueAsNumber:A,mount:x}=e._f,v=N(r,k);if(!x||t.has(k))return{};const y=s?s[0]:o,S=$=>{n&&y.reportValidity&&(y.setCustomValidity(Re($)?"":$||""),y.reportValidity())},E={},M=tn(o),R=er(o),V=M||R,O=(A||en(o))&&X(o.value)&&X(v)||Vr(o)&&o.value===""||v===""||Array.isArray(v)&&!v.length,L=Po.bind(null,k,i,E),K=($,B,Z,Q=Ze.maxLength,ue=Ze.minLength)=>{const de=$?B:Z;E[k]={type:$?Q:ue,message:de,ref:o,...L($?Q:ue,de)}};if(a?!Array.isArray(v)||!v.length:l&&(!V&&(O||ye(v))||Re(v)&&!v||R&&!Uo(s).isValid||M&&!Wo(s).isValid)){const{value:$,message:B}=Se(l)?{value:!!l,message:l}:Vt(l);if($&&(E[k]={type:Ze.required,message:B,ref:y,...L(Ze.required,B)},!i))return S(B),E}if(!O&&(!ye(u)||!ye(h))){let $,B;const Z=Vt(h),Q=Vt(u);if(!ye(v)&&!isNaN(v)){const ue=o.valueAsNumber||v&&+v;ye(Z.value)||($=ue>Z.value),ye(Q.value)||(B=ue<Q.value)}else{const ue=o.valueAsDate||new Date(v),de=ct=>new Date(new Date().toDateString()+" "+ct),st=o.type=="time",lt=o.type=="week";Se(Z.value)&&v&&($=st?de(v)>de(Z.value):lt?v>Z.value:ue>new Date(Z.value)),Se(Q.value)&&v&&(B=st?de(v)<de(Q.value):lt?v<Q.value:ue<new Date(Q.value))}if(($||B)&&(K(!!$,Z.message,Q.message,Ze.max,Ze.min),!i))return S(E[k].message),E}if((d||p)&&!O&&(Se(v)||a&&Array.isArray(v))){const $=Vt(d),B=Vt(p),Z=!ye($.value)&&v.length>+$.value,Q=!ye(B.value)&&v.length<+B.value;if((Z||Q)&&(K(Z,$.message,B.message),!i))return S(E[k].message),E}if(b&&!O&&Se(v)){const{value:$,message:B}=Vt(b);if(Pr($)&&!v.match($)&&(E[k]={type:Ze.pattern,message:B,ref:o,...L(Ze.pattern,B)},!i))return S(B),E}if(m){if(Fe(m)){const $=await m(v,r),B=Zo($,y);if(B&&(E[k]={...B,...L(Ze.validate,B.message)},!i))return S(B.message),E}else if(re(m)){let $={};for(const B in m){if(!be($)&&!i)break;const Z=Zo(await m[B](v,r),y,B);Z&&($={...Z,...L(B,Z.message)},S(Z.message),i&&(E[k]=$))}if(!be($)&&(E[k]={ref:y,...$},!i))return E}}return S(!0),E};const Od={mode:Te.onSubmit,reValidateMode:Te.onChange,shouldFocusError:!0};function Ld(e={}){let t={...Od,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Fe(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},n=re(t.defaultValues)||re(t.values)?oe(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:oe(n),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,d=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...p};let h={...u};const b={array:Oo(),state:Oo()},m=t.criteriaMode===Te.all,k=f=>g=>{clearTimeout(d),d=setTimeout(f,g)},A=async f=>{if(!o.keepIsValid&&!t.disabled&&(u.isValid||h.isValid||f)){let g;t.resolver?(g=be((await V()).errors),x()):g=await L(i,!0),g!==r.isValid&&b.state.next({isValid:g})}},x=(f,g)=>{!t.disabled&&(u.isValidating||u.validatingFields||h.isValidating||h.validatingFields)&&((f||Array.from(s.mount)).forEach(w=>{w&&(g?W(r.validatingFields,w,g):ie(r.validatingFields,w))}),b.state.next({validatingFields:r.validatingFields,isValidating:!be(r.validatingFields)}))},v=(f,g=[],w,I,C=!0,_=!0)=>{if(I&&w&&!t.disabled){if(o.action=!0,_&&Array.isArray(N(i,f))){const T=w(N(i,f),I.argA,I.argB);C&&W(i,f,T)}if(_&&Array.isArray(N(r.errors,f))){const T=w(N(r.errors,f),I.argA,I.argB);C&&W(r.errors,f,T),Vd(r.errors,f)}if((u.touchedFields||h.touchedFields)&&_&&Array.isArray(N(r.touchedFields,f))){const T=w(N(r.touchedFields,f),I.argA,I.argB);C&&W(r.touchedFields,f,T)}(u.dirtyFields||h.dirtyFields)&&(r.dirtyFields=Mt(n,a)),b.state.next({name:f,isDirty:$(f,g),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else W(a,f,g)},y=(f,g)=>{W(r.errors,f,g),b.state.next({errors:r.errors})},S=f=>{r.errors=f,b.state.next({errors:r.errors,isValid:!1})},E=(f,g,w,I)=>{const C=N(i,f);if(C){const _=N(a,f,X(w)?N(n,f):w);X(_)||I&&I.defaultChecked||g?W(a,f,g?_:Ko(C._f)):Q(f,_),o.mount&&!o.action&&A()}},M=(f,g,w,I,C)=>{let _=!1,T=!1;const z={name:f};if(!t.disabled){if(!w||I){(u.isDirty||h.isDirty)&&(T=r.isDirty,r.isDirty=z.isDirty=$(),_=T!==z.isDirty);const U=ot(N(n,f),g);T=!!N(r.dirtyFields,f),U?ie(r.dirtyFields,f):W(r.dirtyFields,f,!0),z.dirtyFields=r.dirtyFields,_=_||(u.dirtyFields||h.dirtyFields)&&T!==!U}if(w){const U=N(r.touchedFields,f);U||(W(r.touchedFields,f,w),z.touchedFields=r.touchedFields,_=_||(u.touchedFields||h.touchedFields)&&U!==w)}_&&C&&b.state.next(z)}return _?z:{}},R=(f,g,w,I)=>{const C=N(r.errors,f),_=(u.isValid||h.isValid)&&Re(g)&&r.isValid!==g;if(t.delayError&&w?(l=k(()=>y(f,w)),l(t.delayError)):(clearTimeout(d),l=null,w?W(r.errors,f,w):ie(r.errors,f)),(w?!ot(C,w):C)||!be(I)||_){const T={...I,..._&&Re(g)?{isValid:g}:{},errors:r.errors,name:f};r={...r,...T},b.state.next(T)}},V=async f=>(x(f,!0),await t.resolver(a,t.context,Ad(f||s.mount,i,t.criteriaMode,t.shouldUseNativeValidation))),O=async f=>{const{errors:g}=await V(f);if(x(f),f)for(const w of f){const I=N(g,w);I?W(r.errors,w,I):ie(r.errors,w)}else r.errors=g;return g},L=async(f,g,w={valid:!0})=>{for(const I in f){const C=f[I];if(C){const{_f:_,...T}=C;if(_){const z=s.array.has(_.name),U=C._f&&Nd(C._f);U&&u.validatingFields&&x([_.name],!0);const ve=await Qo(C,s.disabled,a,m,t.shouldUseNativeValidation&&!g,z);if(U&&u.validatingFields&&x([_.name]),ve[_.name]&&(w.valid=!1,g||e.shouldUseNativeValidation))break;!g&&(N(ve,_.name)?z?Pd(r.errors,ve,_.name):W(r.errors,_.name,ve[_.name]):ie(r.errors,_.name))}!be(T)&&await L(T,g,w)}}return w.valid},K=()=>{for(const f of s.unMount){const g=N(i,f);g&&(g._f.refs?g._f.refs.every(w=>!rn(w)):!rn(g._f.ref))&&on(f)}s.unMount=new Set},$=(f,g)=>!t.disabled&&(f&&g&&W(a,f,g),!ot(ar(),n)),B=(f,g,w)=>kd(f,s,{...o.mount?a:X(g)?n:Se(f)?{[f]:g}:g},w,g),Z=f=>Xi(N(o.mount?a:n,f,t.shouldUnregister?N(n,f,[]):[])),Q=(f,g,w={})=>{const I=N(i,f);let C=g;if(I){const _=I._f;_&&(!_.disabled&&W(a,f,qo(g,_)),C=Vr(_.ref)&&ye(g)?"":g,jo(_.ref)?[..._.ref.options].forEach(T=>T.selected=C.includes(T.value)):_.refs?er(_.ref)?_.refs.forEach(T=>{(!T.defaultChecked||!T.disabled)&&(Array.isArray(C)?T.checked=!!C.find(z=>z===T.value):T.checked=C===T.value||!!C)}):_.refs.forEach(T=>T.checked=T.value===C):en(_.ref)?_.ref.value="":(_.ref.value=C,_.ref.type||b.state.next({name:f,values:oe(a)})))}(w.shouldDirty||w.shouldTouch)&&M(f,C,w.shouldTouch,w.shouldDirty,!0),w.shouldValidate&&ct(f)},ue=(f,g,w)=>{for(const I in g){if(!g.hasOwnProperty(I))return;const C=g[I],_=f+"."+I,T=N(i,_);(s.array.has(f)||re(C)||T&&!T._f)&&!_t(C)?ue(_,C,w):Q(_,C,w)}},de=(f,g,w={})=>{const I=N(i,f),C=s.array.has(f),_=oe(g);W(a,f,_),C?(b.array.next({name:f,values:oe(a)}),(u.isDirty||u.dirtyFields||h.isDirty||h.dirtyFields)&&w.shouldDirty&&b.state.next({name:f,dirtyFields:Mt(n,a),isDirty:$(f,_)})):I&&!I._f&&!ye(_)?ue(f,_,w):Q(f,_,w),Jo(f,s)?b.state.next({...r,name:f,values:oe(a)}):b.state.next({name:o.mount?f:void 0,values:oe(a)})},st=async f=>{o.mount=!0;const g=f.target;let w=g.name,I=!0;const C=N(i,w),_=U=>{I=Number.isNaN(U)||_t(U)&&isNaN(U.getTime())||ot(U,N(a,w,U))},T=Go(t.mode),z=Go(t.reValidateMode);if(C){let U,ve;const xt=g.type?Ko(C._f):bd(f),dt=f.type===Vo.BLUR||f.type===Vo.FOCUS_OUT,Of=!Fd(C._f)&&!t.resolver&&!N(r.errors,w)&&!C._f.deps||Md(dt,N(r.touchedFields,w),r.isSubmitted,z,T),cn=Jo(w,s,dt);W(a,w,xt),dt?(!g||!g.readOnly)&&(C._f.onBlur&&C._f.onBlur(f),l&&l(0)):C._f.onChange&&C._f.onChange(f);const un=M(w,xt,dt),Lf=!be(un)||cn;if(!dt&&b.state.next({name:w,type:f.type,values:oe(a)}),Of)return(u.isValid||h.isValid)&&(t.mode==="onBlur"?dt&&A():dt||A()),Lf&&b.state.next({name:w,...cn?{}:un});if(!dt&&cn&&b.state.next({...r}),t.resolver){const{errors:ps}=await V([w]);if(x([w]),_(xt),I){const jf=Xo(r.errors,i,w),hs=Xo(ps,i,jf.name||w);U=hs.error,w=hs.name,ve=be(ps)}}else x([w],!0),U=(await Qo(C,s.disabled,a,m,t.shouldUseNativeValidation))[w],x([w]),_(xt),I&&(U?ve=!1:(u.isValid||h.isValid)&&(ve=await L(i,!0)));I&&(C._f.deps&&(!Array.isArray(C._f.deps)||C._f.deps.length>0)&&ct(C._f.deps),R(w,ve,U,un))}},lt=(f,g)=>{if(N(r.errors,g)&&f.focus)return f.focus(),1},ct=async(f,g={})=>{let w,I;const C=tr(f);if(t.resolver){const _=await O(X(f)?f:C);w=be(_),I=f?!C.some(T=>N(_,T)):w}else f?(I=(await Promise.all(C.map(async _=>{const T=N(i,_);return await L(T&&T._f?{[_]:T}:T)}))).every(Boolean),!(!I&&!r.isValid)&&A()):I=w=await L(i);return b.state.next({...!Se(f)||(u.isValid||h.isValid)&&w!==r.isValid?{}:{name:f},...t.resolver||!f?{isValid:w}:{},errors:r.errors}),g.shouldFocus&&!I&&ir(i,lt,f?C:s.mount),I},ar=(f,g)=>{let w={...o.mount?a:n};return g&&(w=Lo(g.dirtyFields?r.dirtyFields:r.touchedFields,w)),X(f)?w:Se(f)?N(w,f):f.map(I=>N(w,I))},J=(f,g)=>({invalid:!!N((g||r).errors,f),isDirty:!!N((g||r).dirtyFields,f),error:N((g||r).errors,f),isValidating:!!N(r.validatingFields,f),isTouched:!!N((g||r).touchedFields,f)}),an=f=>{const g=f?tr(f):void 0;g==null||g.forEach(w=>ie(r.errors,w)),g?g.forEach(w=>{b.state.next({name:w,errors:r.errors})}):b.state.next({errors:{}})},Br=(f,g,w)=>{const I=(N(i,f,{_f:{}})._f||{}).ref,C=N(r.errors,f)||{},{ref:_,message:T,type:z,...U}=C;W(r.errors,f,{...U,...g,ref:I}),b.state.next({name:f,errors:r.errors,isValid:!1}),w&&w.shouldFocus&&I&&I.focus&&I.focus()},ut=(f,g)=>Fe(f)?b.state.subscribe({next:w=>"values"in w&&f(B(void 0,g),w)}):B(f,g,!0),ss=f=>b.state.subscribe({next:g=>{Dd(f.name,g.name,f.exact)&&Td(g,f.formState||u,Pf,f.reRenderRoot)&&f.callback({values:{...a},...r,...g,defaultValues:n})}}).unsubscribe,Tf=f=>(o.mount=!0,h={...h,...f.formState},ss({...f,formState:{...p,...f.formState}})),on=(f,g={})=>{for(const w of f?tr(f):s.mount)s.mount.delete(w),s.array.delete(w),g.keepValue||(ie(i,w),ie(a,w)),!g.keepError&&ie(r.errors,w),!g.keepDirty&&ie(r.dirtyFields,w),!g.keepTouched&&ie(r.touchedFields,w),!g.keepIsValidating&&ie(r.validatingFields,w),!t.shouldUnregister&&!g.keepDefaultValue&&ie(n,w);b.state.next({values:oe(a)}),b.state.next({...r,...g.keepDirty?{isDirty:$()}:{}}),!g.keepIsValid&&A()},ls=({disabled:f,name:g})=>{if(Re(f)&&o.mount||f||s.disabled.has(g)){const C=s.disabled.has(g)!==!!f;f?s.disabled.add(g):s.disabled.delete(g),C&&o.mount&&!o.action&&A()}},sn=(f,g={})=>{let w=N(i,f);const I=Re(g.disabled)||Re(t.disabled);return W(i,f,{...w||{},_f:{...w&&w._f?w._f:{ref:{name:f}},name:f,mount:!0,...g}}),s.mount.add(f),w?ls({disabled:Re(g.disabled)?g.disabled:t.disabled,name:f}):E(f,!0,g.value),{...I?{disabled:g.disabled||t.disabled}:{},...t.progressive?{required:!!g.required,min:rr(g.min),max:rr(g.max),minLength:rr(g.minLength),maxLength:rr(g.maxLength),pattern:rr(g.pattern)}:{},name:f,onChange:st,onBlur:st,ref:C=>{if(C){sn(f,g),w=N(i,f);const _=X(C.value)&&C.querySelectorAll&&C.querySelectorAll("input,select,textarea")[0]||C,T=Cd(_),z=w._f.refs||[];if(T?z.find(U=>U===_):_===w._f.ref)return;W(i,f,{_f:{...w._f,...T?{refs:[...z.filter(rn),_,...Array.isArray(N(n,f))?[{}]:[]],ref:{type:_.type,name:f}}:{ref:_}}}),E(f,!1,void 0,_)}else w=N(i,f,{}),w._f&&(w._f.mount=!1),(t.shouldUnregister||g.shouldUnregister)&&!(wd(s.array,f)&&o.action)&&s.unMount.add(f)}}},ln=()=>t.shouldFocusError&&ir(i,lt,s.mount),Df=f=>{Re(f)&&(b.state.next({disabled:f}),ir(i,(g,w)=>{const I=N(i,w);I&&(g.disabled=I._f.disabled||f,Array.isArray(I._f.refs)&&I._f.refs.forEach(C=>{C.disabled=I._f.disabled||f}))},0,!1))},cs=(f,g)=>async w=>{let I;w&&(w.preventDefault&&w.preventDefault(),w.persist&&w.persist());let C=oe(a);if(b.state.next({isSubmitting:!0}),t.resolver){const{errors:_,values:T}=await V();x(),r.errors=_,C=oe(T)}else await L(i);if(s.disabled.size)for(const _ of s.disabled)ie(C,_);if(ie(r.errors,"root"),be(r.errors)){b.state.next({errors:{}});try{await f(C,w)}catch(_){I=_}}else g&&await g({...r.errors},w),ln(),setTimeout(ln);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:be(r.errors)&&!I,submitCount:r.submitCount+1,errors:r.errors}),I)throw I},Mf=(f,g={})=>{N(i,f)&&(X(g.defaultValue)?de(f,oe(N(n,f))):(de(f,g.defaultValue),W(n,f,oe(g.defaultValue))),g.keepTouched||ie(r.touchedFields,f),g.keepDirty||(ie(r.dirtyFields,f),r.isDirty=g.defaultValue?$(f,oe(N(n,f))):$()),g.keepError||(ie(r.errors,f),u.isValid&&A()),b.state.next({...r}))},us=(f,g={})=>{const w=f?oe(f):n,I=oe(w),C=be(f),_=C?n:I;if(g.keepDefaultValues||(n=w),!g.keepValues){if(g.keepDirtyValues){const T=new Set([...s.mount,...Object.keys(Mt(n,a))]);for(const z of Array.from(T)){const U=N(r.dirtyFields,z),ve=N(a,z),xt=N(_,z);U&&!X(ve)?W(_,z,ve):!U&&!X(xt)&&de(z,xt)}}else{if(Ji&&X(f))for(const T of s.mount){const z=N(i,T);if(z&&z._f){const U=Array.isArray(z._f.refs)?z._f.refs[0]:z._f.ref;if(Vr(U)){const ve=U.closest("form");if(ve){ve.reset();break}}}}if(g.keepFieldsRef)for(const T of s.mount)de(T,N(_,T));else i={}}a=t.shouldUnregister?g.keepDefaultValues?oe(n):{}:oe(_),b.array.next({values:{..._}}),b.state.next({values:{..._}})}s={mount:g.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!g.keepIsValid||!!g.keepDirtyValues||!t.shouldUnregister&&!be(_),o.watch=!!t.shouldUnregister,o.keepIsValid=!!g.keepIsValid,o.action=!1,g.keepErrors||(r.errors={}),b.state.next({submitCount:g.keepSubmitCount?r.submitCount:0,isDirty:C?!1:g.keepDirty?r.isDirty:!!(g.keepDefaultValues&&!ot(f,n)),isSubmitted:g.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:C?{}:g.keepDirtyValues?g.keepDefaultValues&&a?Mt(n,a):r.dirtyFields:g.keepDefaultValues&&f?Mt(n,f):g.keepDirty?r.dirtyFields:{},touchedFields:g.keepTouched?r.touchedFields:{},errors:g.keepErrors?r.errors:{},isSubmitSuccessful:g.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},ds=(f,g)=>us(Fe(f)?f(a):f,{...t.resetOptions,...g}),Vf=(f,g={})=>{const w=N(i,f),I=w&&w._f;if(I){const C=I.refs?I.refs[0]:I.ref;C.focus&&setTimeout(()=>{C.focus(),g.shouldSelect&&Fe(C.select)&&C.select()})}},Pf=f=>{r={...r,...f}},fs={control:{register:sn,unregister:on,getFieldState:J,handleSubmit:cs,setError:Br,_subscribe:ss,_runSchema:V,_updateIsValidating:x,_focusError:ln,_getWatch:B,_getDirty:$,_setValid:A,_setFieldArray:v,_setDisabledField:ls,_setErrors:S,_getFieldArray:Z,_reset:us,_resetDefaultValues:()=>Fe(t.defaultValues)&&t.defaultValues().then(f=>{ds(f,t.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:K,_disableForm:Df,_subjects:b,_proxyFormState:u,get _fields(){return i},get _formValues(){return a},get _state(){return o},set _state(f){o=f},get _defaultValues(){return n},get _names(){return s},set _names(f){s=f},get _formState(){return r},get _options(){return t},set _options(f){t={...t,...f}}},subscribe:Tf,trigger:ct,register:sn,handleSubmit:cs,watch:ut,setValue:de,getValues:ar,reset:ds,resetField:Mf,clearErrors:an,unregister:on,setError:Br,setFocus:Vf,getFieldState:J};return{...fs,formControl:fs}}function Or(e={}){const t=pe.useRef(void 0),r=pe.useRef(void 0),[i,n]=pe.useState({isDirty:!1,isValidating:!1,isLoading:Fe(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Fe(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!Fe(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...s}=Ld(e);t.current={...s,formState:i}}const a=t.current.control;return a._options=e,xd(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>n({...a._formState}),reRenderRoot:!0});return n(s=>({...s,isReady:!0})),a._formState.isReady=!0,o},[a]),pe.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),pe.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),pe.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),pe.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),pe.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==i.isDirty&&a._subjects.state.next({isDirty:o})}},[a,i.isDirty]),pe.useEffect(()=>{var o;e.values&&!ot(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((o=a._options.resetOptions)===null||o===void 0)&&o.keepIsValid||a._setValid(),r.current=e.values,n(s=>({...s}))):a._resetDefaultValues()},[a,e.values]),pe.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=pe.useMemo(()=>_d(i,a),[a,i]),t.current}const es=(e,t,r)=>{if(e&&"reportValidity"in e){const i=N(r,t);e.setCustomValidity(i&&i.message||""),e.reportValidity()}},jd=(e,t)=>{for(const r in t.fields){const i=t.fields[r];i&&i.ref&&"reportValidity"in i.ref?es(i.ref,r,e):i.refs&&i.refs.forEach(n=>es(n,r,e))}},Bd=(e,t)=>{t.shouldUseNativeValidation&&jd(e,t);const r={};for(const i in e){const n=N(t.fields,i),a=Object.assign(e[i]||{},{ref:n&&n.ref});if(Rd(t.names||Object.keys(e),i)){const o=Object.assign({},N(r,i));W(o,"root",a),W(r,i,o)}else W(r,i,a)}return r},Rd=(e,t)=>e.some(r=>r.startsWith(t+"."));var Lr=function(e,t,r){return r===void 0&&(r={}),function(i,n,a){try{var o=!a.shouldUseNativeValidation&&a.criteriaMode==="all";return Promise.resolve(Zu(e,i,Object.assign({},t,{abortPipeEarly:!o}))).then(function(s){if(s.issues){for(var l={};s.issues.length;){var d=s.issues[0],p=Hu(d);if(p&&(l[p]||(l[p]={message:d.message,type:d.type}),o)){var u=l[p].types,h=u&&u[d.type];l[p]=Po(p,o,l,d.type,h?[].concat(h,d.message):d.message)}s.issues.shift()}return{values:{},errors:Bd(l,a)}}return{values:r.raw?i:s.output,errors:{}}})}catch(s){return Promise.reject(s)}}};const ts=27,rs=12,is=10,zd=Nt("enum"),Ud=(e,t)=>{const r={min:e.minSelected??0,max:e.maxSelected??e.options.length};return Lr(Je({checked:at(xo(ke(),mo()),Ki(i=>Object.entries(i).filter(([n,a])=>a).map(([n,a])=>n)),Xt(r.max,t("validation_multiple_choice_max",{count:r.max})),Tt(r.min,t("validation_multiple_choice_min",{count:r.min})))}))},qd=gi(({option:e,...t},r)=>c(ee,{children:[c("input",{class:"peer sr-only h-full",type:"checkbox",...t,ref:r}),c("label",{class:"bg-lowest hover:bg-neutral-2 active:outline-neutral-8 ease-expo-out outline-divider text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 peer-focus-visible:ring-accent-9 peer-focus-visible:ring-offset-accent-7 block cursor-pointer select-none rounded-2xl px-3 py-1.5 outline outline-1 ring-0 ring-transparent transition-all selection:bg-transparent peer-focus-visible:ring-4",htmlFor:t.id,children:e.label})]})),ns=gt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4",{variants:{variant:{singleOption:"justify-center",booleanLike:Eo}}}),Hd=({input:e,onSubmitSuccess:t})=>{var p,u;const r=e.key?(p=D.current$.value.flow)==null?void 0:p.data.submissions[e.key]:void 0,i=(e.config.minSelected===1||e.config.minSelected===void 0)&&e.config.maxSelected===1,n=i&&e.config.options.length===2,{t:a}=se(),{register:o,handleSubmit:s,formState:{errors:l}}=Or({defaultValues:{checked:i?{}:zd(r)?Object.fromEntries(r.value.map(h=>[h,!0])):{}},resolver:Ud(e.config,a)}),d=Yi();return n?c("ul",{style:{maxHeight:6.5*ts+5*rs+2*is},class:ns({variant:"booleanLike"}),children:e.config.options.map((h,b)=>c("li",{class:Io,children:c(Ao,{type:"submit",ref:m=>{m&&b===0&&(d.current=m)},label:h.label,value:"true",onClick:()=>t({type:"enum",value:[h.value]})})},h.value))}):c("form",{noValidate:!0,onSubmit:h=>s(b=>{const m=b.checked;t({type:"enum",value:m})})(h),children:[c("div",{class:"flex items-center gap-1",children:[c("ul",{style:{maxHeight:6.5*ts+5*rs+2*is},class:ns({variant:e.config.options.length===1?"singleOption":void 0}),children:e.config.options.map((h,b)=>{const m=`checked.${h.value}`,{ref:k,...A}=o(m);return c("li",{class:"relative",children:c(qd,{option:h,autoFocus:b===0,ref:x=>{x&&b===0&&(d.current=x),k(x)},id:m,...A,onClick:i?()=>t({type:"enum",value:[h.value]}):void 0})},h.value)})}),c("div",{class:"flex flex-col items-center gap-2 pr-2.5 pt-2.5",children:[i?null:c(mt,{}),e.config.minSelected===0&&c(yt,{class:"relative",type:"button",onClick:()=>t({type:"enum",value:[]})})]})]}),c("div",{class:"px-1",children:c(Dt,{error:(u=l.checked)==null?void 0:u.root})})]})},Wd=Nt("number"),Kd=(e,t)=>{const r=e.min??Number.MIN_SAFE_INTEGER,i=e.max??Number.MAX_SAFE_INTEGER,n=e.decimalCases??0;return Lr(Je({number:at(yo(t("validation_number")),go(r,t("validation_number_min",{min:r})),ho(i,t("validation_number_max",{max:i})),fo(a=>a===Number(a.toFixed(n)),t("validation_number_decimal_cases",{count:n})))}))},Gd=({input:e,onSubmitSuccess:t})=>{var u;const r=e.config.defaultValue,i=e.key?(u=D.current$.value.flow)==null?void 0:u.data.submissions[e.key]:void 0,{t:n}=se(),{register:a,handleSubmit:o,formState:{errors:s}}=Or({defaultValues:{number:Wd(i)?i.value:r?Number(r):void 0},resolver:Kd(e.config,n)}),{ref:l,...d}=a("number",{required:!e.config.optional,valueAsNumber:!0}),p=me();return we(()=>{p.current&&(p.current.focus(),p.current.select())},[]),c("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:o(h=>{h.number!==void 0&&t({type:"number",value:h.number})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative min-w-0 flex-grow",children:[c("input",{...d,id:"chat-input",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:h=>{h&&(p.current=h),l(h)},type:"text",min:e.config.min,max:e.config.max,class:Qt({optional:e.config.optional,className:"[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"}),placeholder:e.config.placeholder}),e.config.optional&&c(yt,{class:"absolute bottom-0 right-0.5 top-0",onClick:()=>t(null)})]}),c(mt,{})]}),c(Dt,{error:s.number})]})},Yd=e=>{if(e==="")return{countryCode:"",phoneNumber:""};const t=Object.entries(Gi).find(n=>e.startsWith(n[1])),r=t?t[1]:"",i=e.replace(r,"");return/^\d+$/.test(i)?{countryCode:r,phoneNumber:i}:{countryCode:"",phoneNumber:""}},Jd="44",Xd=/^[0-9 ]+$/,Zd=Nt("string"),Qd=Nt("phone"),ef=e=>{const t=at(ke(e("validation_country_code")),Wi(Xd,e("validation_country_code"))),r=at(ke(e("validation_phone")),Tt(1,e("validation_phone")),Ki(i=>i.replace(/[^0-9]/g,"")));return Lr(Je({countryCode:t,phoneNumber:r}))},tf=({input:e,onSubmitSuccess:t})=>{var k;const r=e.key?(k=D.current$.value.flow)==null?void 0:k.data.submissions[e.key]:void 0,{t:i}=se(),[n,a]=Ne(),o=Zd(r)?Yd(r.value):Qd(r)?r.value:void 0,{register:s,handleSubmit:l,formState:{errors:d},watch:p}=Or({defaultValues:{countryCode:(o==null?void 0:o.countryCode)??e.config.defaultValue.countryCode??Jd,phoneNumber:(o==null?void 0:o.phoneNumber)??e.config.defaultValue.phoneNumber??""},resolver:ef(i)}),{ref:u,...h}=s("phoneNumber",{required:!e.config.optional}),b=me(),m=p("countryCode");return we(()=>{b.current&&(b.current.focus(),b.current.select())},[]),c("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:l(A=>{const x=A.phoneNumber.replace(/[^0-9]/g,""),v=A.countryCode.replace(/[^0-9]/g,"");a(void 0);const y=e.config.minChars??7,S=x.length+v.length;if(S<y)return a(i("validation_phone_min_chars",{count:y}));const E=e.config.maxChars;if(E!=null&&S>E)return a(i("validation_max_chars",{count:E}));e.config.submissionFormat==="phone"?t({type:"phone",value:{countryCode:v,phoneNumber:x}}):t({type:"string",value:m+A.phoneNumber})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative flex min-w-0 flex-1 flex-grow gap-2",children:[c("label",{class:"text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",htmlFor:`isdk_phone_${e.key}`,children:[c("span",{children:["+",m]}),c("select",{...s("countryCode",{}),id:`isdk_phone_${e.key}`,class:"absolute inset-0 opacity-0",children:Object.entries(Gi).map(([A,x])=>c("option",{value:x,children:[A," (+",x,")"]},A))})]}),c("input",{...h,id:"chat-input",type:"tel",inputMode:"tel",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:A=>{A&&(b.current=A),u(A)},class:Qt({optional:e.config.optional,className:"min-w-0 flex-1 rounded-r-full"}),placeholder:e.config.placeholder}),e.config.optional&&c(yt,{class:"absolute bottom-0 right-1 top-0",onClick:()=>t(null)})]}),c(mt,{})]}),c(Dt,{error:d.countryCode||d.phoneNumber||{message:n}})]})},jr=e=>e===void 0?0:Math.max(0,Math.ceil((e-Date.now())/1e3)),rf=({input:e,onSubmitSuccess:t})=>{const{t:r}=se(),{availableAt:i}=e.config,[n,a]=Ne(()=>jr(i)),[o,s]=Ne("");wr(()=>{const d=jr(i);if(a(d),d===0)return;s(r("submission_cooldown",{count:d}));const p=setInterval(()=>{const u=jr(i);a(u),!(u>0)&&(clearInterval(p),s(r("submission_cooldown_ready")))},250);return()=>clearInterval(p)},[i,r]);const l=n>0;return c("div",{class:"flex flex-col items-center gap-2 py-3",children:[c("button",{class:"bg-accent-9 hover:bg-accent-10 active:bg-submit-bg-active hover:border-accent-10 active:border-submit-bg-active border-accent-9 ring-accent-6 focus-visible:outline-accent-8 ring-offset-neutral-1 aria-disabled:hover:bg-accent-9 aria-disabled:hover:border-accent-9 flex cursor-pointer rounded-full border border-solid px-5 py-3 pr-4 text-white outline-none ring-1 ring-offset-[1.5px] transition-all duration-300 focus-visible:outline-2 active:ring-2 active:ring-offset-2 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:active:ring-1 aria-disabled:active:ring-offset-[1.5px]",name:e.key,"aria-disabled":l,"aria-describedby":l?"submit-cooldown":void 0,onClick:()=>{jr(i)>0||t(null)},children:c("span",{class:"flex items-center gap-1.5",children:[c("span",{class:"inline-flex items-center text-sm font-medium",children:e.config.label||"Submit"}),c("svg",{stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c("path",{d:"M4 8L8 4L12 8"}),c("path",{d:"M8 4V13"})]})]})}),l&&c("p",{id:"submit-cooldown","aria-hidden":"true",class:"text-neutral-11 text-xs",children:r("submission_cooldown",{count:n})}),c("p",{role:"status",class:"sr-only",children:o})]})},nf={date:{type:"date",inputMode:"text"},email:{type:"email",inputMode:"email",formNoValidate:!0},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},af=Nt("string"),of=(e,t)=>{const r={maxLength:t("validation_max_chars",{count:e.maxChars??999}),minLength:t("validation_min_chars",{count:e.minChars??1})};return Lr(Je({text:{date:at(ke(t("validation_date")),Wi(/^\d{4}-\d{2}-\d{2}$/,t("validation_date"))),email:at(ke(t("validation_email")),po(t("validation_email")),Tt(e.minChars??1,r.minLength),Xt(e.maxChars??1/0,r.maxLength)),text:at(ke(),Tt(e.minChars??1,r.minLength),Xt(e.maxChars??1/0,r.maxLength)),url:at(ke(t("validation_url")),bo(t("validation_url")),Tt(e.minChars??1,r.minLength),Xt(e.maxChars??1/0,r.maxLength))}[e.format]}))},sf={text:({input:e,onSubmitSuccess:t})=>{var u;const{t:r}=se(),i=e.key?(u=D.current$.value.flow)==null?void 0:u.data.submissions[e.key]:void 0,n=e.config.defaultValue,{register:a,handleSubmit:o,formState:{errors:s}}=Or({defaultValues:{text:af(i)?i.value:n??""},resolver:of(e.config,r)}),{ref:l,...d}=a("text",{required:!e.config.optional}),p=me();return we(()=>{p.current&&(p.current.focus(),p.current.select())},[]),c("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:o(h=>{t({type:"string",value:h.text})}),children:[c("div",{class:"flex items-center gap-2",children:[c("div",{class:"relative min-w-0 flex-1",children:[c("input",{id:"chat-input",...d,...nf[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:h=>{h&&(p.current=h),l(h)},placeholder:e.config.placeholder,class:Qt({optional:!!e.config.optional,className:"w-full rounded-full"})}),e.config.optional&&c(yt,{class:"absolute bottom-0 right-0.5 top-0",onClick:()=>t(null)})]}),c(mt,{})]}),c(Dt,{error:s.text})]})},phone:tf,"multiple-choice":Hd,boolean:ld,file:gd,submit:rf,address:nd,number:Gd},lf=({logger:e,analytics:t})=>{var a;const r=(a=D.current$.value.flow)==null?void 0:a.data.currentInput,i=me(null),n=()=>ae.onInteractionFn$.value();return we(()=>{var o;(o=i.current)==null||o.scrollTo({top:0})},[r]),c("div",{ref:i,class:"border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",children:c("div",{class:"flex flex-col",onPointerDownCapture:r?n:void 0,onKeyDownCapture:r?n:void 0,children:r?(()=>{const o=sf[r.type];return c(o,{logger:e,analytics:t,onSubmitSuccess:ae.onSubmitSuccessFn$.value,input:r})})():c("div",{class:"flex items-center gap-2 p-2.5",children:[c("input",{"aria-hidden":"true",id:"chat-input",class:Qt({optional:!1,className:"flex-grow rounded-full"}),disabled:!0}),c(mt,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})})})};function cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var uf=function(e){return e instanceof RegExp},df=function(t){var r=/[\\^$.*+?()[\]{}|]/g,i=RegExp(r.source);return t&&i.test(t)?t.replace(r,"\\$&"):t},as=function(e){return typeof e=="string"},ff=function(e){var t=[];return e.forEach(function(r){Array.isArray(r)?t=t.concat(r):t.push(r)}),t};function pf(e,t,r){var i=0,n=0;if(e==="")return e;if(!e||!as(e))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var a=t;uf(a)||(a=new RegExp("("+df(a)+")","gi"));for(var o=e.split(a),s=1,l=o.length;s<l;s+=2){if(o[s]===void 0||o[s-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}n=o[s].length,i+=o[s-1].length,o[s]=r(o[s],s,i),i+=n}return o}var hf=function(t,r,i){return Array.isArray(t)||(t=[t]),ff(t.map(function(n){return as(n)?pf(n,r,i):n}))};const nr=cf(hf),gf=/(\[[^\]]+\]\([^)]+\))/g,bf=/\[([^\]]+)\]\(([^)]+)\)/,vf=/(https?:\/\/[^\s]+)/g,wf=/_(.*?)_/g,mf=/\*\*(.*?)\*\*/g,yf=/\\n|\n/g,os="text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline",_f=e=>{const t=nr(e,gf,(o,s)=>{const[,l,d]=o.match(bf)??[];return d?c("a",{class:os,href:d,children:l??d},d+s):c("span",{children:"INVALID LINK"})}),r=nr(t,vf,(o,s)=>c("a",{class:os,href:o,children:o},o+s)),i=nr(r,wf,(o,s)=>c("em",{children:o},o+s)),n=nr(i,mf,(o,s)=>c("strong",{children:o},o+s));return nr(n,yf,(o,s)=>c("br",{},`br-${s}`))},xf=gt("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative",{variants:{side:{left:"bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",right:"ml-auto bg-accent-9 text-white rounded-br-md shadow-surface-sm shadow-bubble-strong-shadow"},animate:{true:"animate-bubble-in",false:""}},defaultVariants:{side:"left"}}),kf=({children:e,className:t,animate:r,side:i,...n})=>c("p",{style:{transformOrigin:i==="left"?"0% 50%":"100% 50%"},class:xf({className:t,side:i,animate:r}),...n,children:e}),Sf=({message:e})=>c("div",{class:"bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",children:c("a",{onClick:e.onClick,class:"bg-lowest shadow-surface-sm ring-accent-6 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 text-wrap-balance flex items-center gap-1.5 rounded-full py-2 pl-4 pr-2.5 text-center no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",target:"_blank",href:e.href,children:[e.text,c("svg",{class:"flex-none",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})})]})}),Cf=({className:e,...t})=>c("div",{"aria-hidden":!0,children:ae.isBotTyping$.value===!0?c("div",{"aria-label":"Typing…",class:We("flex gap-1 p-4",e),...t,children:Array.from({length:3},(r,i)=>c("div",{class:"bg-accent-9 h-1.5 w-1.5 animate-bounce rounded-full",style:{animationDelay:`${-i*200}ms`}}))}):void 0}),$f={bot:"left",user:"right"},Ef=gt("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]",{variants:{variant:{info:"text-neutral-8",warning:"text-[#FFC107]",error:"text-error-9",success:"text-[#4CAF50]"}}}),If=({lastSentMessageFooter:e})=>{const t=D.current$.value.flow,r=(t==null?void 0:t.data.messages)??[],i=t?Vi(t):void 0;return c("ol",{"aria-label":"Chat messages","aria-live":"polite",class:"mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[r.map((n,a)=>c(ee,{children:c("li",{class:"flex",tabIndex:a===r.length-1?-1:void 0,children:[i&&n.groupId===i&&!r.slice(a+1).some(o=>o.groupId===i)?e:null,xr(n).with({type:"system"},o=>c("p",{class:Ef({variant:o.variant}),children:o.text})).with({type:"text",author:Ht.union("bot","user")},o=>{const s=a===r.length-1,l=o.author==="bot"?_f(o.text):o.text;return c(ee,{children:c(kf,{animate:s,side:$f[o.author],children:l},a)})}).with({type:"link"},o=>c(Sf,{message:o})).with({type:"image"},o=>c("img",{class:"shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",src:o.url,style:{aspectRatio:o.width/o.height}})).with({type:"file"},o=>c(dd,{class:o.author==="bot"?void 0:"ml-auto",file:{name:o.fileName,sizeKb:o.fileSizeKb}})).with({type:"loading"},o=>{const s=r[r.length-1];return!(o===s)||ae.isBotTyping$.value?null:c("div",{class:"flex flex-grow flex-col items-center justify-center gap-2",children:[c(Nr,{"aria-hidden":o.text?"true":void 0,class:"text-neutral-6 h-8 w-8"}),o.text?c("p",{role:"status",class:"text-neutral-11 text-sm",children:o.text}):null]})}).exhaustive()]})},a)),c(Cf,{},"typing")]})},Af=({logger:e,apiClient:t,analytics:r,talentBankClient:i})=>{const{flow:n}=D.current$.value;Ke(n,"Flow is required to exist to show chatbot body");const a=D.viewState$.value,{chatRef:o,chatService:s}=Qc(),{t:l}=se(),[d,p]=Ne();return we(()=>{a==="maximised"&&ae.scrollToEnd()},[a]),we(()=>{var v;const{state:u,flow:h}=D.current$.peek();if(u!=="loaded")throw new Error(l("invalid_state"));let b=h.data.nodeHistory.at(-1);if(ae.scrollToEnd(),D.setInput(void 0),h.data.isFinished)return;const m=()=>{const y=D.current$.peek().flow;!y||y.data.hasInteracted||(D.markAsInteracted(),oo(r,y,"FLOW_INTERACT"))};ae.onInteractionFn$.value=m,b===void 0?(b=Ga(n.nodes).id,D.setCurrentNodeId(b),oo(r,h,"FLOW_START")):D.removeMessagesSentByNodeIds([b]);const{interpret:k,abort:A,undo:x}=mu({context:n.context,analytics:{service:r,customProperties:(v=n.analytics)==null?void 0:v.customProperties},apiClient:t,logger:e,talentBankClient:i,flow:n,chatService:s,t:l,getApplicationRecovery:()=>{var y;return(y=D.current$.peek().flow)==null?void 0:y.data.applicationRecovery},setApplicationRecovery:D.setApplicationRecovery,persistWriteBarrier:()=>D.persistWriteBarrier(h),getSubmissions:()=>{var y;return(y=D.current$.peek().flow)==null?void 0:y.data.submissions},onInterpret:y=>D.setCurrentNodeId(y.id),onFlowEnd:async()=>{var S;D.markAsFinished();const y=D.current$.peek().flow;Ke(y),r.log({event:"FLOW_END",properties:{flow_id:n.id,flow_version:n.version,flow_session_id:y.data.flowSessionId,flow_build:n.build,job:n.job},customProperties:(S=n.analytics)==null?void 0:S.customProperties})}});return p(()=>x),k(b),()=>{ae.onInteractionFn$.value===m&&(ae.onInteractionFn$.value=()=>{}),A()}},[r,t,s,e,n,i,l]),c(ee,{children:[c("div",{class:"relative flex min-h-0 w-full max-w-full flex-grow flex-col",children:[c("div",{ref:o,role:"region","aria-label":l("conversation_history"),tabIndex:0,className:"hide-scrollbars fr flex min-h-0 w-full max-w-full flex-grow flex-col overflow-y-auto ring-inset",style:{WebkitOverflowScrolling:"touch"},children:c(If,{lastSentMessageFooter:!Vi(n)||!d?null:c(Nf,{undoFn:d})})}),ae.isReadingHistory$.value&&!n.data.isFinished&&!ae.isBotTyping$.value&&c("div",{class:"absolute bottom-2 left-1/2 -translate-x-1/2",children:c(Yt,{class:"bg-neutral-1 ring-divider shadow-surface-md ring-1","aria-label":l("jump_to_current"),onClick:()=>{var h,b;ae.scrollToEnd(),(b=((h=o.current)==null?void 0:h.querySelector('li[tabindex="-1"]'))??o.current)==null||b.focus({preventScroll:!0})},children:c(Za,{})})})]}),c(lf,{logger:e,analytics:r})]})},Nf=({undoFn:e})=>{const{t}=se();return c("div",{class:"flex flex-1 items-center justify-end px-1",children:c(Yt,{"aria-label":t("undo"),onClick:async()=>{const{flow:r}=D.current$.peek();Ke(r),e(r.data.nodeHistory)},children:c("path",{d:"M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"})})})},Ff=Object.freeze(Object.defineProperty({__proto__:null,ChatbotBody:Af},Symbol.toStringTag,{value:"Module"}))})();