@encatch/ws-react 0.0.28 → 0.0.29

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.
@@ -43,7 +43,7 @@ React keys must be passed directly to JSX without using spread:
43
43
 
44
44
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const ge of this.seen.entries()){const ce=ge[1];if(r===ge[0]){f(ge);continue}if(a.external){const be=a.external.registry.get(ge[0])?.id;if(r!==ge[0]&&be){f(ge);continue}}if(this.metadataRegistry.get(ge[0])?.id){f(ge);continue}if(ce.cycle){f(ge);continue}if(ce.count>1&&a.reused==="ref"){f(ge);continue}}const _=(ge,ce)=>{const Ce=this.seen.get(ge),be=Ce.def??Ce.schema,P={...be};if(Ce.ref===null)return;const Se=Ce.ref;if(Ce.ref=null,Se){_(Se,ce);const Pe=this.seen.get(Se).schema;Pe.$ref&&(ce.target==="draft-7"||ce.target==="draft-4"||ce.target==="openapi-3.0")?(be.allOf=be.allOf??[],be.allOf.push(Pe)):(Object.assign(be,Pe),Object.assign(be,P))}Ce.isParent||this.override({zodSchema:ge,jsonSchema:be,path:Ce.path??[]})};for(const ge of[...this.seen.entries()].reverse())_(ge[0],{target:this.target});const F={};if(this.target==="draft-2020-12"?F.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?F.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?F.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),a.external?.uri){const ge=a.external.registry.get(r)?.id;if(!ge)throw new Error("Schema is missing an `id` property");F.$id=a.external.uri(ge)}Object.assign(F,t.def);const X=a.external?.defs??{};for(const ge of this.seen.entries()){const ce=ge[1];ce.def&&ce.defId&&(X[ce.defId]=ce.def)}a.external||Object.keys(X).length>0&&(this.target==="draft-2020-12"?F.$defs=X:F.definitions=X);try{return JSON.parse(JSON.stringify(F))}catch{throw new Error("Error converting schema to JSON.")}}}function nm(e,r){if(e instanceof xs){const a=new iu(r),t={};for(const _ of e._idmap.entries()){const[F,X]=_;a.process(X)}const s={},f={registry:e,uri:r?.uri,defs:t};for(const _ of e._idmap.entries()){const[F,X]=_;s[F]=a.emit(X,{...r,external:f})}if(Object.keys(t).length>0){const _=a.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[_]:t}}return{schemas:s}}const o=new iu(r);return o.process(e),o.emit(e,r)}function Kt(e,r){const o=r??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);const t=e._zod.def;switch(t.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Kt(t.element,o);case"object":{for(const s in t.shape)if(Kt(t.shape[s],o))return!0;return!1}case"union":{for(const s of t.options)if(Kt(s,o))return!0;return!1}case"intersection":return Kt(t.left,o)||Kt(t.right,o);case"tuple":{for(const s of t.items)if(Kt(s,o))return!0;return!!(t.rest&&Kt(t.rest,o))}case"record":return Kt(t.keyType,o)||Kt(t.valueType,o);case"map":return Kt(t.keyType,o)||Kt(t.valueType,o);case"set":return Kt(t.valueType,o);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Kt(t.innerType,o);case"lazy":return Kt(t.getter(),o);case"default":return Kt(t.innerType,o);case"prefault":return Kt(t.innerType,o);case"custom":return!1;case"transform":return!0;case"pipe":return Kt(t.in,o)||Kt(t.out,o);case"success":return!1;case"catch":return!1;case"function":return!1}throw new Error(`Unknown schema type: ${t.type}`)}const Lw=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:hf,$ZodArray:_f,$ZodAsyncError:Un,$ZodBase64:nf,$ZodBase64URL:af,$ZodBigInt:ys,$ZodBigIntFormat:ff,$ZodBoolean:bs,$ZodCIDRv4:tf,$ZodCIDRv6:rf,$ZodCUID:Qd,$ZodCUID2:Wd,$ZodCatch:Bf,$ZodCheck:Pt,$ZodCheckBigIntFormat:yd,$ZodCheckEndsWith:Od,$ZodCheckGreaterThan:gs,$ZodCheckIncludes:Td,$ZodCheckLengthEquals:Sd,$ZodCheckLessThan:ms,$ZodCheckLowerCase:zd,$ZodCheckMaxLength:kd,$ZodCheckMaxSize:$d,$ZodCheckMimeType:Ad,$ZodCheckMinLength:xd,$ZodCheckMinSize:wd,$ZodCheckMultipleOf:vd,$ZodCheckNumberFormat:bd,$ZodCheckOverwrite:Md,$ZodCheckProperty:Cd,$ZodCheckRegex:Id,$ZodCheckSizeEquals:_d,$ZodCheckStartsWith:jd,$ZodCheckStringFormat:Vi,$ZodCheckUpperCase:Nd,$ZodCodec:ks,$ZodCustom:ip,$ZodCustomStringFormat:cf,$ZodDate:$f,$ZodDefault:Ff,$ZodDiscriminatedUnion:Nf,$ZodE164:sf,$ZodEmail:Rd,$ZodEmoji:qd,$ZodEncodeError:jo,$ZodEnum:Uf,$ZodError:Ha,$ZodFile:Lf,$ZodFunction:tp,$ZodGUID:Ld,$ZodIPv4:Xd,$ZodIPv6:ef,$ZodISODate:Yd,$ZodISODateTime:Bd,$ZodISODuration:Hd,$ZodISOTime:Kd,$ZodIntersection:Tf,$ZodJWT:lf,$ZodKSUID:Jd,$ZodLazy:np,$ZodLiteral:Df,$ZodMap:Ef,$ZodNaN:Yf,$ZodNanoID:Fd,$ZodNever:bf,$ZodNonOptional:Gf,$ZodNull:gf,$ZodNullable:qf,$ZodNumber:vs,$ZodNumberFormat:df,$ZodObject:Sf,$ZodObjectJIT:If,$ZodOptional:Zf,$ZodPipe:Kf,$ZodPrefault:Wf,$ZodPromise:rp,$ZodReadonly:Hf,$ZodRealError:Sr,$ZodRecord:Of,$ZodRegistry:xs,$ZodSet:Af,$ZodString:Ji,$ZodStringFormat:Et,$ZodSuccess:Jf,$ZodSymbol:pf,$ZodTemplateLiteral:ep,$ZodTransform:Pf,$ZodTuple:_s,$ZodType:He,$ZodULID:Gd,$ZodURL:Zd,$ZodUUID:Pd,$ZodUndefined:mf,$ZodUnion:$s,$ZodUnknown:vf,$ZodVoid:yf,$ZodXID:Vd,$brand:pc,$constructor:U,$input:mp,$output:pp,Doc:Ud,JSONSchema:Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),JSONSchemaGenerator:iu,NEVER:fc,TimePrecision:vp,_any:Lp,_array:Yp,_base64:qs,_base64url:Fs,_bigint:Op,_boolean:Tp,_catch:Ew,_check:tm,_cidrv4:Rs,_cidrv6:Zs,_coercedBigint:Ep,_coercedBoolean:jp,_coercedDate:Fp,_coercedNumber:kp,_coercedString:hp,_cuid:Cs,_cuid2:As,_custom:Hp,_date:qp,_decode:is,_decodeAsync:as,_default:Tw,_discriminatedUnion:vw,_e164:Qs,_email:Is,_emoji:Os,_encode:ns,_encodeAsync:os,_endsWith:Hs,_enum:kw,_file:Kp,_float32:Sp,_float64:Ip,_gt:qn,_gte:Ir,_guid:Qo,_includes:Ys,_int:xp,_int32:zp,_int64:Cp,_intersection:bw,_ipv4:Ls,_ipv6:Ps,_isoDate:yp,_isoDateTime:bp,_isoDuration:wp,_isoTime:$p,_jwt:Ws,_ksuid:Ds,_lazy:Uw,_length:Jo,_literal:Sw,_lowercase:Js,_lt:Zn,_lte:qr,_map:ww,_max:qr,_maxLength:Vo,_maxSize:Go,_mime:Xs,_min:Ir,_minLength:gi,_minSize:Hi,_multipleOf:Ki,_nan:Qp,_nanoid:Es,_nativeEnum:xw,_negative:Gp,_never:Rp,_nonnegative:Jp,_nonoptional:jw,_nonpositive:Vp,_normalize:eu,_null:Dp,_nullable:Nw,_number:_p,_optional:zw,_overwrite:Fn,_parse:Zi,_parseAsync:qi,_pipe:Cw,_positive:Wp,_promise:Dw,_property:Bp,_readonly:Aw,_record:$w,_refine:Xp,_regex:Vs,_safeDecode:us,_safeDecodeAsync:cs,_safeEncode:ss,_safeEncodeAsync:ls,_safeParse:Fi,_safeParseAsync:Qi,_set:_w,_size:Gs,_startsWith:Ks,_string:gp,_stringFormat:Xi,_stringbool:rm,_success:Ow,_superRefine:em,_symbol:Mp,_templateLiteral:Mw,_toLowerCase:ru,_toUpperCase:nu,_transform:Iw,_trim:tu,_tuple:yw,_uint32:Np,_uint64:Ap,_ulid:Ms,_undefined:Up,_union:hw,_unknown:Pp,_uppercase:Bs,_url:Wo,_uuid:zs,_uuidv4:Ns,_uuidv6:Ts,_uuidv7:js,_void:Zp,_xid:Us,clone:Or,config:hr,decode:gy,decodeAsync:vy,encode:my,encodeAsync:hy,flattenError:Xa,formatError:es,globalConfig:Oo,globalRegistry:Rn,isValidBase64:hs,isValidBase64URL:of,isValidJWT:uf,locales:fp,parse:ts,parseAsync:rs,prettifyError:Ac,regexes:ps,registry:Ss,safeDecode:yy,safeDecodeAsync:wy,safeEncode:by,safeEncodeAsync:$y,safeParse:Mc,safeParseAsync:Uc,toDotPath:Cc,toJSONSchema:nm,treeifyError:Ec,util:jc,version:Dd},Symbol.toStringTag,{value:"Module"})),ou=U("ZodISODateTime",(e,r)=>{Bd.init(e,r),At.init(e,r)});function im(e){return bp(ou,e)}const au=U("ZodISODate",(e,r)=>{Yd.init(e,r),At.init(e,r)});function om(e){return yp(au,e)}const su=U("ZodISOTime",(e,r)=>{Kd.init(e,r),At.init(e,r)});function am(e){return $p(su,e)}const uu=U("ZodISODuration",(e,r)=>{Hd.init(e,r),At.init(e,r)});function sm(e){return wp(uu,e)}const Pw=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:au,ZodISODateTime:ou,ZodISODuration:uu,ZodISOTime:su,date:om,datetime:im,duration:sm,time:am},Symbol.toStringTag,{value:"Module"})),um=(e,r)=>{Ha.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>es(e,o)},flatten:{value:o=>Xa(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,Eo,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,Eo,2)}},isEmpty:{get(){return e.issues.length===0}}})},Rw=U("ZodError",um),zr=U("ZodError",um,{Parent:Error}),lm=Zi(zr),cm=qi(zr),dm=Fi(zr),fm=Qi(zr),pm=ns(zr),mm=is(zr),gm=os(zr),hm=as(zr),vm=ss(zr),bm=us(zr),ym=ls(zr),$m=cs(zr),it=U("ZodType",(e,r)=>(He.init(e,r),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...o)=>e.clone({...r,checks:[...r.checks??[],...o.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),e.clone=(o,a)=>Or(e,o,a),e.brand=()=>e,e.register=((o,a)=>(o.add(e,a),e)),e.parse=(o,a)=>lm(e,o,a,{callee:e.parse}),e.safeParse=(o,a)=>dm(e,o,a),e.parseAsync=async(o,a)=>cm(e,o,a,{callee:e.parseAsync}),e.safeParseAsync=async(o,a)=>fm(e,o,a),e.spa=e.safeParseAsync,e.encode=(o,a)=>pm(e,o,a),e.decode=(o,a)=>mm(e,o,a),e.encodeAsync=async(o,a)=>gm(e,o,a),e.decodeAsync=async(o,a)=>hm(e,o,a),e.safeEncode=(o,a)=>vm(e,o,a),e.safeDecode=(o,a)=>bm(e,o,a),e.safeEncodeAsync=async(o,a)=>ym(e,o,a),e.safeDecodeAsync=async(o,a)=>$m(e,o,a),e.refine=(o,a)=>e.check(ng(o,a)),e.superRefine=o=>e.check(ig(o)),e.overwrite=o=>e.check(Fn(o)),e.optional=()=>na(e),e.nullable=()=>ia(e),e.nullish=()=>na(ia(e)),e.nonoptional=o=>Gm(e,o),e.array=()=>xt(e),e.or=o=>on([e,o]),e.and=o=>Cm(e,o),e.transform=o=>oa(e,Cu(o)),e.default=o=>Fm(e,o),e.prefault=o=>Wm(e,o),e.catch=o=>Bm(e,o),e.pipe=o=>oa(e,o),e.readonly=()=>Hm(e),e.describe=o=>{const a=e.clone();return Rn.add(a,{description:o}),a},Object.defineProperty(e,"description",{get(){return Rn.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Rn.get(e);const a=e.clone();return Rn.add(a,o[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),lu=U("_ZodString",(e,r)=>{Ji.init(e,r),it.init(e,r);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...a)=>e.check(Vs(...a)),e.includes=(...a)=>e.check(Ys(...a)),e.startsWith=(...a)=>e.check(Ks(...a)),e.endsWith=(...a)=>e.check(Hs(...a)),e.min=(...a)=>e.check(gi(...a)),e.max=(...a)=>e.check(Vo(...a)),e.length=(...a)=>e.check(Jo(...a)),e.nonempty=(...a)=>e.check(gi(1,...a)),e.lowercase=a=>e.check(Js(a)),e.uppercase=a=>e.check(Bs(a)),e.trim=()=>e.check(tu()),e.normalize=(...a)=>e.check(eu(...a)),e.toLowerCase=()=>e.check(ru()),e.toUpperCase=()=>e.check(nu())}),Bo=U("ZodString",(e,r)=>{Ji.init(e,r),lu.init(e,r),e.email=o=>e.check(Is(cu,o)),e.url=o=>e.check(Wo(Ko,o)),e.jwt=o=>e.check(Ws(Su,o)),e.emoji=o=>e.check(Os(du,o)),e.guid=o=>e.check(Qo(Yo,o)),e.uuid=o=>e.check(zs(nn,o)),e.uuidv4=o=>e.check(Ns(nn,o)),e.uuidv6=o=>e.check(Ts(nn,o)),e.uuidv7=o=>e.check(js(nn,o)),e.nanoid=o=>e.check(Es(fu,o)),e.guid=o=>e.check(Qo(Yo,o)),e.cuid=o=>e.check(Cs(pu,o)),e.cuid2=o=>e.check(As(mu,o)),e.ulid=o=>e.check(Ms(gu,o)),e.base64=o=>e.check(qs(_u,o)),e.base64url=o=>e.check(Fs(ku,o)),e.xid=o=>e.check(Us(hu,o)),e.ksuid=o=>e.check(Ds(vu,o)),e.ipv4=o=>e.check(Ls(bu,o)),e.ipv6=o=>e.check(Ps(yu,o)),e.cidrv4=o=>e.check(Rs($u,o)),e.cidrv6=o=>e.check(Zs(wu,o)),e.e164=o=>e.check(Qs(xu,o)),e.datetime=o=>e.check(im(o)),e.date=o=>e.check(om(o)),e.time=o=>e.check(am(o)),e.duration=o=>e.check(sm(o))});function j(e){return gp(Bo,e)}const At=U("ZodStringFormat",(e,r)=>{Et.init(e,r),lu.init(e,r)}),cu=U("ZodEmail",(e,r)=>{Rd.init(e,r),At.init(e,r)});function Zw(e){return Is(cu,e)}const Yo=U("ZodGUID",(e,r)=>{Ld.init(e,r),At.init(e,r)});function qw(e){return Qo(Yo,e)}const nn=U("ZodUUID",(e,r)=>{Pd.init(e,r),At.init(e,r)});function wm(e){return zs(nn,e)}function Fw(e){return Ns(nn,e)}function Qw(e){return Ts(nn,e)}function Ww(e){return js(nn,e)}const Ko=U("ZodURL",(e,r)=>{Zd.init(e,r),At.init(e,r)});function Gw(e){return Wo(Ko,e)}function Vw(e){return Wo(Ko,{protocol:/^https?$/,hostname:Xc,...le(e)})}const du=U("ZodEmoji",(e,r)=>{qd.init(e,r),At.init(e,r)});function Jw(e){return Os(du,e)}const fu=U("ZodNanoID",(e,r)=>{Fd.init(e,r),At.init(e,r)});function Bw(e){return Es(fu,e)}const pu=U("ZodCUID",(e,r)=>{Qd.init(e,r),At.init(e,r)});function Yw(e){return Cs(pu,e)}const mu=U("ZodCUID2",(e,r)=>{Wd.init(e,r),At.init(e,r)});function Kw(e){return As(mu,e)}const gu=U("ZodULID",(e,r)=>{Gd.init(e,r),At.init(e,r)});function Hw(e){return Ms(gu,e)}const hu=U("ZodXID",(e,r)=>{Vd.init(e,r),At.init(e,r)});function Xw(e){return Us(hu,e)}const vu=U("ZodKSUID",(e,r)=>{Jd.init(e,r),At.init(e,r)});function e_(e){return Ds(vu,e)}const bu=U("ZodIPv4",(e,r)=>{Xd.init(e,r),At.init(e,r)});function t_(e){return Ls(bu,e)}const yu=U("ZodIPv6",(e,r)=>{ef.init(e,r),At.init(e,r)});function r_(e){return Ps(yu,e)}const $u=U("ZodCIDRv4",(e,r)=>{tf.init(e,r),At.init(e,r)});function n_(e){return Rs($u,e)}const wu=U("ZodCIDRv6",(e,r)=>{rf.init(e,r),At.init(e,r)});function i_(e){return Zs(wu,e)}const _u=U("ZodBase64",(e,r)=>{nf.init(e,r),At.init(e,r)});function o_(e){return qs(_u,e)}const ku=U("ZodBase64URL",(e,r)=>{af.init(e,r),At.init(e,r)});function a_(e){return Fs(ku,e)}const xu=U("ZodE164",(e,r)=>{sf.init(e,r),At.init(e,r)});function s_(e){return Qs(xu,e)}const Su=U("ZodJWT",(e,r)=>{lf.init(e,r),At.init(e,r)});function u_(e){return Ws(Su,e)}const eo=U("ZodCustomStringFormat",(e,r)=>{cf.init(e,r),At.init(e,r)});function l_(e,r,o={}){return Xi(eo,e,r,o)}function c_(e){return Xi(eo,"hostname",fs,e)}function d_(e){return Xi(eo,"hex",gd,e)}function f_(e,r){const o=r?.enc??"hex",a=`${e}_${o}`,t=ps[a];if(!t)throw new Error(`Unrecognized hash format: ${a}`);return Xi(eo,a,t,r)}const Ho=U("ZodNumber",(e,r)=>{vs.init(e,r),it.init(e,r),e.gt=(a,t)=>e.check(qn(a,t)),e.gte=(a,t)=>e.check(Ir(a,t)),e.min=(a,t)=>e.check(Ir(a,t)),e.lt=(a,t)=>e.check(Zn(a,t)),e.lte=(a,t)=>e.check(qr(a,t)),e.max=(a,t)=>e.check(qr(a,t)),e.int=a=>e.check(Iu(a)),e.safe=a=>e.check(Iu(a)),e.positive=a=>e.check(qn(0,a)),e.nonnegative=a=>e.check(Ir(0,a)),e.negative=a=>e.check(Zn(0,a)),e.nonpositive=a=>e.check(qr(0,a)),e.multipleOf=(a,t)=>e.check(Ki(a,t)),e.step=(a,t)=>e.check(Ki(a,t)),e.finite=()=>e;const o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});function bt(e){return _p(Ho,e)}const hi=U("ZodNumberFormat",(e,r)=>{df.init(e,r),Ho.init(e,r)});function Iu(e){return xp(hi,e)}function p_(e){return Sp(hi,e)}function m_(e){return Ip(hi,e)}function g_(e){return zp(hi,e)}function h_(e){return Np(hi,e)}const Xo=U("ZodBoolean",(e,r)=>{bs.init(e,r),it.init(e,r)});function at(e){return Tp(Xo,e)}const ea=U("ZodBigInt",(e,r)=>{ys.init(e,r),it.init(e,r),e.gte=(a,t)=>e.check(Ir(a,t)),e.min=(a,t)=>e.check(Ir(a,t)),e.gt=(a,t)=>e.check(qn(a,t)),e.gte=(a,t)=>e.check(Ir(a,t)),e.min=(a,t)=>e.check(Ir(a,t)),e.lt=(a,t)=>e.check(Zn(a,t)),e.lte=(a,t)=>e.check(qr(a,t)),e.max=(a,t)=>e.check(qr(a,t)),e.positive=a=>e.check(qn(BigInt(0),a)),e.negative=a=>e.check(Zn(BigInt(0),a)),e.nonpositive=a=>e.check(qr(BigInt(0),a)),e.nonnegative=a=>e.check(Ir(BigInt(0),a)),e.multipleOf=(a,t)=>e.check(Ki(a,t));const o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function v_(e){return Op(ea,e)}const zu=U("ZodBigIntFormat",(e,r)=>{ff.init(e,r),ea.init(e,r)});function b_(e){return Cp(zu,e)}function y_(e){return Ap(zu,e)}const _m=U("ZodSymbol",(e,r)=>{pf.init(e,r),it.init(e,r)});function $_(e){return Mp(_m,e)}const km=U("ZodUndefined",(e,r)=>{mf.init(e,r),it.init(e,r)});function w_(e){return Up(km,e)}const xm=U("ZodNull",(e,r)=>{gf.init(e,r),it.init(e,r)});function Sm(e){return Dp(xm,e)}const Im=U("ZodAny",(e,r)=>{hf.init(e,r),it.init(e,r)});function ta(){return Lp(Im)}const zm=U("ZodUnknown",(e,r)=>{vf.init(e,r),it.init(e,r)});function Qn(){return Pp(zm)}const Nm=U("ZodNever",(e,r)=>{bf.init(e,r),it.init(e,r)});function Nu(e){return Rp(Nm,e)}const Tm=U("ZodVoid",(e,r)=>{yf.init(e,r),it.init(e,r)});function Tu(e){return Zp(Tm,e)}const ju=U("ZodDate",(e,r)=>{$f.init(e,r),it.init(e,r),e.min=(a,t)=>e.check(Ir(a,t)),e.max=(a,t)=>e.check(qr(a,t));const o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function __(e){return qp(ju,e)}const jm=U("ZodArray",(e,r)=>{_f.init(e,r),it.init(e,r),e.element=r.element,e.min=(o,a)=>e.check(gi(o,a)),e.nonempty=o=>e.check(gi(1,o)),e.max=(o,a)=>e.check(Vo(o,a)),e.length=(o,a)=>e.check(Jo(o,a)),e.unwrap=()=>e.element});function xt(e,r){return Yp(jm,e,r)}function k_(e){const r=e._zod.def.shape;return Rt(Object.keys(r))}const ra=U("ZodObject",(e,r)=>{If.init(e,r),it.init(e,r),ct(e,"shape",()=>r.shape),e.keyof=()=>Rt(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Qn()}),e.loose=()=>e.clone({...e._zod.def,catchall:Qn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Nu()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>kc(e,o),e.safeExtend=o=>xc(e,o),e.merge=o=>Sc(e,o),e.pick=o=>wc(e,o),e.omit=o=>_c(e,o),e.partial=(...o)=>Ic(Au,e,o[0]),e.required=(...o)=>zc(Mu,e,o[0])});function ze(e,r){const o={type:"object",get shape(){return Pr(this,"shape",e?Ao(e):{}),this.shape},...le(r)};return new ra(o)}function x_(e,r){return new ra({type:"object",get shape(){return Pr(this,"shape",Ao(e)),this.shape},catchall:Nu(),...le(r)})}function S_(e,r){return new ra({type:"object",get shape(){return Pr(this,"shape",Ao(e)),this.shape},catchall:Qn(),...le(r)})}const Ou=U("ZodUnion",(e,r)=>{$s.init(e,r),it.init(e,r),e.options=r.options});function on(e,r){return new Ou({type:"union",options:e,...le(r)})}const Om=U("ZodDiscriminatedUnion",(e,r)=>{Ou.init(e,r),Nf.init(e,r)});function to(e,r,o){return new Om({type:"union",options:r,discriminator:e,...le(o)})}const Em=U("ZodIntersection",(e,r)=>{Tf.init(e,r),it.init(e,r)});function Cm(e,r){return new Em({type:"intersection",left:e,right:r})}const Am=U("ZodTuple",(e,r)=>{_s.init(e,r),it.init(e,r),e.rest=o=>e.clone({...e._zod.def,rest:o})});function Mm(e,r,o){const a=r instanceof He,t=a?o:r,s=a?r:null;return new Am({type:"tuple",items:e,rest:s,...le(t)})}const Eu=U("ZodRecord",(e,r)=>{Of.init(e,r),it.init(e,r),e.keyType=r.keyType,e.valueType=r.valueType});function Ht(e,r,o){return new Eu({type:"record",keyType:e,valueType:r,...le(o)})}function I_(e,r,o){const a=Or(e);return a._zod.values=void 0,new Eu({type:"record",keyType:a,valueType:r,...le(o)})}const Um=U("ZodMap",(e,r)=>{Ef.init(e,r),it.init(e,r),e.keyType=r.keyType,e.valueType=r.valueType});function z_(e,r,o){return new Um({type:"map",keyType:e,valueType:r,...le(o)})}const Dm=U("ZodSet",(e,r)=>{Af.init(e,r),it.init(e,r),e.min=(...o)=>e.check(Hi(...o)),e.nonempty=o=>e.check(Hi(1,o)),e.max=(...o)=>e.check(Go(...o)),e.size=(...o)=>e.check(Gs(...o))});function N_(e,r){return new Dm({type:"set",valueType:e,...le(r)})}const ro=U("ZodEnum",(e,r)=>{Uf.init(e,r),it.init(e,r),e.enum=r.entries,e.options=Object.values(r.entries);const o=new Set(Object.keys(r.entries));e.extract=(a,t)=>{const s={};for(const f of a)if(o.has(f))s[f]=r.entries[f];else throw new Error(`Key ${f} not found in enum`);return new ro({...r,checks:[],...le(t),entries:s})},e.exclude=(a,t)=>{const s={...r.entries};for(const f of a)if(o.has(f))delete s[f];else throw new Error(`Key ${f} not found in enum`);return new ro({...r,checks:[],...le(t),entries:s})}});function Rt(e,r){const o=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new ro({type:"enum",entries:o,...le(r)})}function T_(e,r){return new ro({type:"enum",entries:e,...le(r)})}const Lm=U("ZodLiteral",(e,r)=>{Df.init(e,r),it.init(e,r),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function Tt(e,r){return new Lm({type:"literal",values:Array.isArray(e)?e:[e],...le(r)})}const Pm=U("ZodFile",(e,r)=>{Lf.init(e,r),it.init(e,r),e.min=(o,a)=>e.check(Hi(o,a)),e.max=(o,a)=>e.check(Go(o,a)),e.mime=(o,a)=>e.check(Xs(Array.isArray(o)?o:[o],a))});function j_(e){return Kp(Pm,e)}const Rm=U("ZodTransform",(e,r)=>{Pf.init(e,r),it.init(e,r),e._zod.parse=(o,a)=>{if(a.direction==="backward")throw new jo(e.constructor.name);o.addIssue=s=>{if(typeof s=="string")o.issues.push(pi(s,o.value,r));else{const f=s;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=o.value),f.inst??(f.inst=e),o.issues.push(pi(f))}};const t=r.transform(o.value,o);return t instanceof Promise?t.then(s=>(o.value=s,o)):(o.value=t,o)}});function Cu(e){return new Rm({type:"transform",transform:e})}const Au=U("ZodOptional",(e,r)=>{Zf.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType});function na(e){return new Au({type:"optional",innerType:e})}const Zm=U("ZodNullable",(e,r)=>{qf.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType});function ia(e){return new Zm({type:"nullable",innerType:e})}function O_(e){return na(ia(e))}const qm=U("ZodDefault",(e,r)=>{Ff.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Fm(e,r){return new qm({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Mo(r)}})}const Qm=U("ZodPrefault",(e,r)=>{Wf.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Wm(e,r){return new Qm({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():Mo(r)}})}const Mu=U("ZodNonOptional",(e,r)=>{Gf.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Gm(e,r){return new Mu({type:"nonoptional",innerType:e,...le(r)})}const Vm=U("ZodSuccess",(e,r)=>{Jf.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType});function E_(e){return new Vm({type:"success",innerType:e})}const Jm=U("ZodCatch",(e,r)=>{Bf.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Bm(e,r){return new Jm({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}const Ym=U("ZodNaN",(e,r)=>{Yf.init(e,r),it.init(e,r)});function C_(e){return Qp(Ym,e)}const Uu=U("ZodPipe",(e,r)=>{Kf.init(e,r),it.init(e,r),e.in=r.in,e.out=r.out});function oa(e,r){return new Uu({type:"pipe",in:e,out:r})}const Du=U("ZodCodec",(e,r)=>{Uu.init(e,r),ks.init(e,r)});function A_(e,r,o){return new Du({type:"pipe",in:e,out:r,transform:o.decode,reverseTransform:o.encode})}const Km=U("ZodReadonly",(e,r)=>{Hf.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Hm(e){return new Km({type:"readonly",innerType:e})}const Xm=U("ZodTemplateLiteral",(e,r)=>{ep.init(e,r),it.init(e,r)});function M_(e,r){return new Xm({type:"template_literal",parts:e,...le(r)})}const eg=U("ZodLazy",(e,r)=>{np.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.getter()});function Lu(e){return new eg({type:"lazy",getter:e})}const tg=U("ZodPromise",(e,r)=>{rp.init(e,r),it.init(e,r),e.unwrap=()=>e._zod.def.innerType});function U_(e){return new tg({type:"promise",innerType:e})}const rg=U("ZodFunction",(e,r)=>{tp.init(e,r),it.init(e,r)});function aa(e){return new rg({type:"function",input:Array.isArray(e?.input)?Mm(e?.input):e?.input??xt(Qn()),output:e?.output??Qn()})}const sa=U("ZodCustom",(e,r)=>{ip.init(e,r),it.init(e,r)});function D_(e){const r=new Pt({check:"custom"});return r._zod.check=e,r}function L_(e,r){return Hp(sa,e??(()=>!0),r)}function ng(e,r={}){return Xp(sa,e,r)}function ig(e){return em(e)}function P_(e,r={error:`Input not instance of ${e.name}`}){const o=new sa({type:"custom",check:"custom",fn:a=>a instanceof e,abort:!0,...le(r)});return o._zod.bag.Class=e,o}const R_=(...e)=>rm({Codec:Du,Boolean:Xo,String:Bo},...e);function Z_(e){const r=Lu(()=>on([j(e),bt(),at(),Sm(),xt(r),Ht(j(),r)]));return r}function q_(e,r){return oa(Cu(e),r)}const F_={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Q_(e){hr({customError:e})}function W_(){return hr().customError}var Pu;Pu||(Pu={});function G_(e){return hp(Bo,e)}function V_(e){return kp(Ho,e)}function J_(e){return jp(Xo,e)}function B_(e){return Ep(ea,e)}function Y_(e){return Fp(ju,e)}const K_=Object.freeze(Object.defineProperty({__proto__:null,bigint:B_,boolean:J_,date:Y_,number:V_,string:G_},Symbol.toStringTag,{value:"Module"}));hr(sp());const H_=Object.freeze(Object.defineProperty({__proto__:null,$brand:pc,$input:mp,$output:pp,NEVER:fc,TimePrecision:vp,ZodAny:Im,ZodArray:jm,ZodBase64:_u,ZodBase64URL:ku,ZodBigInt:ea,ZodBigIntFormat:zu,ZodBoolean:Xo,ZodCIDRv4:$u,ZodCIDRv6:wu,ZodCUID:pu,ZodCUID2:mu,ZodCatch:Jm,ZodCodec:Du,ZodCustom:sa,ZodCustomStringFormat:eo,ZodDate:ju,ZodDefault:qm,ZodDiscriminatedUnion:Om,ZodE164:xu,ZodEmail:cu,ZodEmoji:du,ZodEnum:ro,ZodError:Rw,ZodFile:Pm,get ZodFirstPartyTypeKind(){return Pu},ZodFunction:rg,ZodGUID:Yo,ZodIPv4:bu,ZodIPv6:yu,ZodISODate:au,ZodISODateTime:ou,ZodISODuration:uu,ZodISOTime:su,ZodIntersection:Em,ZodIssueCode:F_,ZodJWT:Su,ZodKSUID:vu,ZodLazy:eg,ZodLiteral:Lm,ZodMap:Um,ZodNaN:Ym,ZodNanoID:fu,ZodNever:Nm,ZodNonOptional:Mu,ZodNull:xm,ZodNullable:Zm,ZodNumber:Ho,ZodNumberFormat:hi,ZodObject:ra,ZodOptional:Au,ZodPipe:Uu,ZodPrefault:Qm,ZodPromise:tg,ZodReadonly:Km,ZodRealError:zr,ZodRecord:Eu,ZodSet:Dm,ZodString:Bo,ZodStringFormat:At,ZodSuccess:Vm,ZodSymbol:_m,ZodTemplateLiteral:Xm,ZodTransform:Rm,ZodTuple:Am,ZodType:it,ZodULID:gu,ZodURL:Ko,ZodUUID:nn,ZodUndefined:km,ZodUnion:Ou,ZodUnknown:zm,ZodVoid:Tm,ZodXID:hu,_ZodString:lu,_default:Fm,_function:aa,any:ta,array:xt,base64:o_,base64url:a_,bigint:v_,boolean:at,catch:Bm,check:D_,cidrv4:n_,cidrv6:i_,clone:Or,codec:A_,coerce:K_,config:hr,core:Lw,cuid:Yw,cuid2:Kw,custom:L_,date:__,decode:mm,decodeAsync:hm,discriminatedUnion:to,e164:s_,email:Zw,emoji:Jw,encode:pm,encodeAsync:gm,endsWith:Hs,enum:Rt,file:j_,flattenError:Xa,float32:p_,float64:m_,formatError:es,function:aa,getErrorMap:W_,globalRegistry:Rn,gt:qn,gte:Ir,guid:qw,hash:f_,hex:d_,hostname:c_,httpUrl:Vw,includes:Ys,instanceof:P_,int:Iu,int32:g_,int64:b_,intersection:Cm,ipv4:t_,ipv6:r_,iso:Pw,json:Z_,jwt:u_,keyof:k_,ksuid:e_,lazy:Lu,length:Jo,literal:Tt,locales:fp,looseObject:S_,lowercase:Js,lt:Zn,lte:qr,map:z_,maxLength:Vo,maxSize:Go,mime:Xs,minLength:gi,minSize:Hi,multipleOf:Ki,nan:C_,nanoid:Bw,nativeEnum:T_,negative:Gp,never:Nu,nonnegative:Jp,nonoptional:Gm,nonpositive:Vp,normalize:eu,null:Sm,nullable:ia,nullish:O_,number:bt,object:ze,optional:na,overwrite:Fn,parse:lm,parseAsync:cm,partialRecord:I_,pipe:oa,positive:Wp,prefault:Wm,preprocess:q_,prettifyError:Ac,promise:U_,property:Bp,readonly:Hm,record:Ht,refine:ng,regex:Vs,regexes:ps,registry:Ss,safeDecode:bm,safeDecodeAsync:$m,safeEncode:vm,safeEncodeAsync:ym,safeParse:dm,safeParseAsync:fm,set:N_,setErrorMap:Q_,size:Gs,startsWith:Ks,strictObject:x_,string:j,stringFormat:l_,stringbool:R_,success:E_,superRefine:ig,symbol:$_,templateLiteral:M_,toJSONSchema:nm,toLowerCase:ru,toUpperCase:nu,transform:Cu,treeifyError:Ec,trim:tu,tuple:Mm,uint32:h_,uint64:y_,ulid:Hw,undefined:w_,union:on,unknown:Qn,uppercase:Bs,url:Gw,util:jc,uuid:wm,uuidv4:Fw,uuidv6:Qw,uuidv7:Ww,void:Tu,xid:Xw},Symbol.toStringTag,{value:"Module"}));var X_=Object.defineProperty,an=(e,r)=>X_(e,"name",{value:r,configurable:!0}),og=Rt(["rating","single_choice","nps","nested_selection","multiple_choice_multiple","short_answer","long_text","annotation"]).describe("Enumeration of all supported question types for form fields"),ek={RATING:"rating",SINGLE_CHOICE:"single_choice",NPS:"nps",NESTED_SELECTION:"nested_selection",MULTIPLE_CHOICE_MULTIPLE:"multiple_choice_multiple",SHORT_ANSWER:"short_answer",LONG_TEXT:"long_text",ANNOTATION:"annotation"},ag=Rt(["required","min","max","minLength","maxLength","pattern","email","url","custom"]).describe("Enumeration of all supported validation rule types"),tk={REQUIRED:"required",MIN:"min",MAX:"max",MIN_LENGTH:"minLength",MAX_LENGTH:"maxLength",PATTERN:"pattern",EMAIL:"email",URL:"url",CUSTOM:"custom"},sg=ze({type:ag.describe("Type of validation rule to apply"),value:on([j(),bt(),at()]).optional().describe("Value for the validation rule (string, number, or boolean)"),message:j().optional().describe("Custom error message when validation fails"),describe:j().max(500).optional().describe("LLM tool call description for this validation rule")}).describe("Schema defining validation rules for question responses"),rk=Rt(["equals","not_equals","contains","not_contains","greater_than","less_than","is_empty","is_not_empty"]).describe("Enumeration of all supported visibility condition operators"),nk={EQUALS:"equals",NOT_EQUALS:"not_equals",CONTAINS:"contains",NOT_CONTAINS:"not_contains",GREATER_THAN:"greater_than",LESS_THAN:"less_than",IS_EMPTY:"is_empty",IS_NOT_EMPTY:"is_not_empty"},ug=ze({field:j().describe("ID of the field to check against"),operator:rk.describe("Comparison operator for the condition"),value:on([j(),bt(),at()]).optional().describe("Value to compare against (string, number, or boolean)"),describe:j().max(500).optional().describe("LLM tool call description for this visibility condition")}).describe("Schema defining conditions that control when questions are visible"),ua=ze({id:j().describe("Unique identifier for the section"),title:j().min(1).max(200).describe("Display title for the section"),questionIds:xt(j()).min(1).describe("Array of question IDs that belong to this section")}).describe("Schema defining sections that organize questions into logical groups"),lg=Rt(["D","P","A","S"]),ik={DRAFT:"D",PUBLISHED:"P",ARCHIVED:"A",SUSPENDED:"S"},cg=Rt(["star","heart","thumbs-up","diamond","emoji","emoji-exp"]),ok={STAR:"star",HEART:"heart",THUMBS_UP:"thumbs_up",DIAMOND:"diamond",EMOJI:"emoji",EMOJI_EXP:"emoji_exp"},dg=Rt(["small","medium","large"]),ak={SMALL:"small",MEDIUM:"medium",LARGE:"large"},fg=Rt(["radio","list","chip","dropdown"]),sk={RADIO:"radio",LIST:"list",CHIP:"chip",DROPDOWN:"dropdown"},pg=Rt(["checkbox","list","chip"]),uk={CHECKBOX:"checkbox",LIST:"list",CHIP:"chip"},mg=Rt(["randomize","flip","rotate","ascending","none"]),lk={RANDOMIZE:"randomize",FLIP:"flip",ROTATE:"rotate",ASCENDING:"ascending",NONE:"none"},sn=ze({id:j().describe("Unique identifier for the question"),type:og.describe("The type of question (rating, single_choice, etc.)"),title:j().min(1).max(200).describe("The main title/question text displayed to users"),description:j().max(1e3).optional().describe("Optional detailed description or help text"),describe:j().max(2e3).optional().describe("LLM tool call description for better AI understanding and context"),required:at().default(!1).describe("Whether this question must be answered"),errorMessage:j().max(500).optional().describe("Custom error message when validation fails"),validations:xt(sg).optional().default([]).describe("Array of validation rules to apply"),visibility:xt(ug).optional().default([]).describe("Conditions that control when this question is shown"),isFixed:at().describe("Whether this question position is fixed or can be reordered"),sectionId:j().optional().describe("ID of the section this question belongs to"),status:lg.describe("Current status of the question (Draft, Published, etc.)")}).describe("Base schema for all question types with common properties"),gg=sn.extend({type:Tt("rating").describe("Must be exactly 'rating'"),showLabels:at().optional().describe("Whether to show min/max labels"),minLabel:j().max(100).optional().describe("Label for the minimum rating value"),maxLabel:j().max(100).optional().describe("Label for the maximum rating value"),displayStyle:cg.optional().describe("Visual style for rating display"),numberOfRatings:bt().int().min(1).max(10).describe("Number of rating options (1-10)"),representationSize:dg.optional().describe("Size of rating visual elements"),color:j().regex(/^#[0-9A-F]{6}$/i,"Must be a valid hex color").optional().describe("Hex color for rating elements")}).describe("Schema for rating questions with customizable display options"),hg=sn.extend({type:Tt("annotation").describe("Must be exactly 'annotation'"),annotationText:j().max(1e3).optional().describe("Text to display when annotation is provided"),noAnnotationText:j().max(500).optional().describe("Text to display when no annotation is provided")}).describe("Schema for annotation questions that provide additional context or instructions"),Ru=ze({id:j().describe("Unique identifier for this option (system time milliseconds)"),value:j().min(1).max(100).describe("The internal value used for this option"),label:j().min(1).max(200).describe("The display text shown to users for this option"),describe:j().max(500).optional().describe("LLM tool call description providing context about this option"),imageUrl:j().url().optional().describe("Optional image URL to display with this option")}).describe("Schema for individual options in choice-based questions"),Zu=Lu(()=>ze({id:j().describe("Unique identifier for this nested option (system time milliseconds)"),value:j().min(1).max(100).describe("The internal value used for this nested option"),label:j().min(1).max(200).describe("The display text shown for this nested option"),describe:j().max(500).optional().describe("LLM tool call description for this nested option context"),imageUrl:j().url().optional().describe("Optional image URL for this nested option"),hint:j().max(500).optional().describe("Optional hint text to help users understand this nested option"),children:xt(Zu).optional().default([]).describe("Array of child options for hierarchical structure")}).describe("Schema for nested options with hierarchical structure support")),vg=sn.extend({type:Tt("single_choice").describe("Must be exactly 'single_choice'"),displayStyle:fg.optional().describe("Visual style for displaying options"),randomizeOptions:at().optional().default(!1).describe("Whether to randomize the order of options"),options:xt(Ru).min(1).max(50).describe("Array of options for user selection (1-50 options)")}).describe("Schema for single-choice multiple selection questions"),bg=sn.extend({type:Tt("multiple_choice_multiple").describe("Must be exactly 'multiple_choice_multiple'"),displayStyle:pg.optional().describe("Visual style for displaying multiple options"),minSelections:bt().int().min(0).optional().describe("Minimum number of options that must be selected"),maxSelections:bt().int().min(1).optional().describe("Maximum number of options that can be selected"),randomizeOptions:at().optional().default(!1).describe("Whether to randomize the order of options"),options:xt(Ru).min(1).max(50).describe("Array of options for user selection (1-50 options)")}).refine(e=>e.minSelections!==void 0&&e.maxSelections!==void 0?e.minSelections<=e.maxSelections:!0,{message:"minSelections cannot be greater than maxSelections",path:["minSelections"]}).describe("Schema for multiple-choice questions allowing multiple selections"),yg=sn.extend({type:Tt("nps").describe("Must be exactly 'nps'"),min:Tt(0).describe("NPS always starts at 0"),max:Tt(10).describe("NPS always ends at 10"),minLabel:j().max(100).optional().describe("Label for the minimum NPS value (0)"),maxLabel:j().max(100).optional().describe("Label for the maximum NPS value (10)"),scaleLabels:Ht(j().regex(/^\d+$/),j().max(50)).optional().describe("Custom labels for specific NPS values (0-10)"),prepopulatedValue:bt().int().min(0).max(10).optional().describe("Default value to pre-select (0-10)")}).refine(e=>e.scaleLabels?Object.keys(e.scaleLabels).every(o=>{const a=Number(o);return!isNaN(a)&&a>=0&&a<=10}):!0,{message:"scaleLabels keys must be between 0 and 10 (inclusive)",path:["scaleLabels"]}).describe("Schema for Net Promoter Score questions with 0-10 scale"),$g=sn.extend({type:Tt("short_answer").describe("Must be exactly 'short_answer'"),maxCharacters:bt().int().min(1).max(1e4).optional().describe("Maximum number of characters allowed"),minCharacters:bt().int().min(0).optional().describe("Minimum number of characters required"),placeholder:j().max(200).optional().describe("Placeholder text shown in the input field"),enableRegexValidation:at().optional().default(!1).describe("Whether to enable regex pattern validation"),regexPattern:j().optional().describe("Regular expression pattern for validation"),enableEnhanceWithAi:at().optional().default(!1).describe("Whether to enable AI enhancement features"),promptTemplate:j().max(2e3).optional().describe("Template for AI enhancement prompts"),cooldownSeconds:bt().int().min(0).max(3600).optional().describe("Cooldown period between AI enhancements (0-3600 seconds)"),maxEnhancements:bt().int().min(1).max(10).optional().describe("Maximum number of AI enhancements allowed"),maxTokenAllowed:bt().int().min(1).max(1e4).optional().describe("Maximum tokens allowed for AI processing"),minCharactersToEnhance:bt().int().min(1).optional().describe("Minimum characters needed to trigger AI enhancement")}).refine(e=>e.minCharacters!==void 0&&e.maxCharacters!==void 0?e.minCharacters<=e.maxCharacters:!0,{message:"minCharacters cannot be greater than maxCharacters",path:["minCharacters"]}).refine(e=>!(e.enableRegexValidation&&!e.regexPattern),{message:"regexPattern is required when enableRegexValidation is true",path:["regexPattern"]}).refine(e=>!(e.enableEnhanceWithAi&&!e.promptTemplate),{message:"promptTemplate is required when enableEnhanceWithAi is true",path:["promptTemplate"]}).describe("Schema for short answer questions with optional AI enhancement"),wg=sn.extend({type:Tt("long_text").describe("Must be exactly 'long_text'"),maxCharacters:bt().int().min(1).max(5e4).optional().describe("Maximum number of characters allowed (higher limit for long text)"),minCharacters:bt().int().min(0).optional().describe("Minimum number of characters required"),rows:bt().int().min(1).max(20).optional().describe("Number of textarea rows to display (1-20)"),placeholder:j().max(500).optional().describe("Placeholder text for the textarea (longer for long text)"),enableEnhanceWithAi:at().optional().default(!1).describe("Whether to enable AI enhancement features"),promptTemplate:j().max(2e3).optional().describe("Template for AI enhancement prompts"),cooldownSeconds:bt().int().min(0).max(3600).optional().describe("Cooldown period between AI enhancements (0-3600 seconds)"),maxEnhancements:bt().int().min(1).max(10).optional().describe("Maximum number of AI enhancements allowed"),maxTokenAllowed:bt().int().min(1).max(25e3).optional().describe("Maximum tokens allowed for AI processing (higher for long text)"),minCharactersToEnhance:bt().int().min(1).optional().describe("Minimum characters needed to trigger AI enhancement")}).refine(e=>e.minCharacters!==void 0&&e.maxCharacters!==void 0?e.minCharacters<=e.maxCharacters:!0,{message:"minCharacters cannot be greater than maxCharacters",path:["minCharacters"]}).refine(e=>!(e.enableEnhanceWithAi&&!e.promptTemplate),{message:"promptTemplate is required when enableEnhanceWithAi is true",path:["promptTemplate"]}).describe("Schema for long answer questions with rich text support and AI enhancement"),_g=sn.extend({type:Tt("nested_selection").describe("Must be exactly 'nested_selection'"),placeholder:j().max(200).optional().describe("Placeholder text for the nested dropdown"),options:xt(Zu).min(1).max(100).describe("Array of nested options for hierarchical selection (1-100 options)"),displayStyle:Tt("list").describe("Fixed display style for nested dropdowns"),choiceOrderOption:mg.optional().default("none").describe("How to order the nested choices"),preserveLastChoices:bt().int().min(0).max(10).optional().describe("Number of choice levels to preserve (0-10)"),prepopulatedValue:j().max(1e3).optional().describe("Default value to pre-populate"),allowOther:at().optional().default(!1).describe('Whether to allow custom "other" options'),otherColumnName:j().max(100).optional().describe('Column name for storing custom "other" values'),maxDepth:bt().int().min(1).max(10).optional().describe("Maximum nesting depth allowed (1-10)"),cascadeLabels:at().optional().default(!1).describe("Whether to cascade labels from parent options")}).refine(e=>!(e.allowOther&&!e.otherColumnName),{message:"otherColumnName is required when allowOther is true",path:["otherColumnName"]}).describe("Schema for nested dropdown questions with hierarchical option structure"),la=to("type",[gg,hg,vg,bg,yg,$g,wg,_g]),kg=ze({markerNo:j(),timeline:j(),comment:j()}),xg=ze({fileType:j(),fileName:j(),markers:xt(kg)}),Sg=ze({nps:bt().optional().describe("Net Promoter Score value (e.g., 0-10)"),nestedSelection:xt(j()).optional().describe("Array of selected nested option IDs"),longText:j().optional().describe("Long text answer, e.g., paragraph or essay"),shortAnswer:j().optional().describe("Short text answer, e.g., single sentence or word"),singleChoice:j().optional().describe("single selected option ID (for single choice questions)"),rating:bt().optional().describe("Star rating value (e.g., 1-5)"),multipleChoiceMultiple:xt(j()).optional().describe("Array of selected option IDs for multiple choice questions"),annotation:xg.optional().describe("Annotation object containing file and marker details"),others:j().optional().describe("For multiple choice questions and single choice questions, this is the value of the other option")}).describe("Flexible answer item supporting various question types and custom fields"),Ig=Sg,zg=Rt(["R","S"]).describe("Enumeration of feedback types: R=Recurring, O=One-time"),ck={RECURRING:"R",ONE_TIME:"S"},Ng=Rt(["Y","N"]).describe("Yes/No enumeration using Y/N values"),dk={YES:"Y",NO:"N"},Tg=Rt(["minutes","hours","days","weeks","months","years"]).describe("Time units for recurring feedback schedules"),fk={MINUTES:"minutes",HOURS:"hours",DAYS:"days",WEEKS:"weeks",MONTHS:"months",YEARS:"years"},qu=ze({surveyType:zg.describe("Type of feedback: R for recurring, O for one-time"),showOnce:Ng.describe("Whether the feedback should be shown only once per user"),stopWhenResponsesCount:j().regex(/^\d+$/,"Must be a valid number string").describe("Stop feedback when this number of responses is reached (as string)"),recurringValue:j().regex(/^\d+$/,"Must be a valid number string").describe("Value for recurring schedule (e.g., every 15 days)"),recurringUnit:Tg.describe("Time unit for recurring schedule"),startDate:j().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(\+|\-)\d{2}:\d{2}$/,"Must be a valid ISO date string with timezone").describe("Start date and time for the feedback in ISO format"),stopDate:j().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(\+|\-)\d{2}:\d{2}$/,"Must be a valid ISO date string with timezone").describe("Stop date and time for the feedback in ISO format")}).refine(e=>!(e.surveyType==="S"&&e.showOnce==="N"),{message:"One-time feedback must have showOnce set to 'Y'",path:["showOnce"]}).refine(e=>e.surveyType==="R"?parseInt(e.recurringValue)>0:!0,{message:"Recurring feedback must have a positive recurring value",path:["recurringValue"]}).refine(e=>{const r=new Date(e.startDate);return new Date(e.stopDate)>r},{message:"Stop date must be after start date",path:["stopDate"]}).describe("Schema defining frequency and scheduling properties for feedback"),jg=ze({isShareable:at().describe("Whether the feedback results can be shared externally"),isEmailShareable:at().describe("Whether the feedback can be shared via email")}).describe("Schema defining external publishing and sharing properties for feedback"),Og=Rt(["P","D","A","S"]).describe("Publication status: P=Published, D=Draft, A=Archived, S=Stopped"),pk={PUBLISHED:"P",DRAFT:"D",ARCHIVED:"A",STOPPED:"S"},Eg=ze({formTitle:j().describe("Title of the feedback form"),formDescription:j().describe("Description of the feedback form"),isPublished:Og.describe("Publication status of the feedback form")}).describe("Schema defining feedback configuration properties"),ot=j().min(1).describe("Translated text content"),Cg=ze({type:Tt("rating").describe("Question type identifier"),title:ot.describe("Question title translation"),description:ot.optional().describe("Question description translation"),errorMessage:ot.optional().describe("Error message translation"),minLabel:ot.optional().describe("Minimum rating label translation"),maxLabel:ot.optional().describe("Maximum rating label translation")}).describe("Translation schema for rating questions"),Ag=ze({type:Tt("single_choice").describe("Question type identifier"),title:ot.describe("Question title translation"),description:ot.optional().describe("Question description translation"),errorMessage:ot.optional().describe("Error message translation"),placeholder:ot.optional().describe("Input placeholder translation")}).catchall(ot).refine(e=>Object.keys(e).filter(o=>!["type","title","description","errorMessage","placeholder"].includes(o)).every(o=>/^option\..+\.(label|value)$/.test(o)),{message:"Additional keys must follow the pattern 'option.{id}.{label|value}'"}).describe("Translation schema for single choice questions"),Mg=ze({type:Tt("multiple_choice_multiple").describe("Question type identifier"),title:ot.describe("Question title translation"),description:ot.optional().describe("Question description translation"),errorMessage:ot.optional().describe("Error message translation"),placeholder:ot.optional().describe("Input placeholder translation")}).catchall(ot).refine(e=>Object.keys(e).filter(o=>!["type","title","description","errorMessage","placeholder"].includes(o)).every(o=>/^option\..+\.(label|value)$/.test(o)),{message:"Additional keys must follow the pattern 'option.{id}.{label|value}'"}).describe("Translation schema for multiple choice questions"),Ug=ze({type:Tt("nps").describe("Question type identifier"),title:ot.describe("Question title translation"),description:ot.optional().describe("Question description translation"),errorMessage:ot.optional().describe("Error message translation"),minLabel:ot.optional().describe("Minimum NPS label (0) translation"),maxLabel:ot.optional().describe("Maximum NPS label (10) translation")}).catchall(ot).refine(e=>Object.keys(e).filter(o=>!["type","title","description","errorMessage","minLabel","maxLabel"].includes(o)).every(o=>/^scaleLabel\.\d+$/.test(o)),{message:"Additional keys must follow the pattern 'scaleLabel.{number}'"}).describe("Translation schema for NPS questions"),Dg=ze({type:Tt("short_answer").describe("Question type identifier"),title:ot.describe("Question title translation"),description:ot.optional().describe("Question description translation"),errorMessage:ot.optional().describe("Error message translation"),placeholder:ot.optional().describe("Input placeholder translation")}).describe("Translation schema for short answer questions"),Lg=ze({type:Tt("long_text").describe("Question type identifier"),title:ot.describe("Question title translation"),description:ot.optional().describe("Question description translation"),errorMessage:ot.optional().describe("Error message translation"),placeholder:ot.optional().describe("Textarea placeholder translation")}).describe("Translation schema for long answer questions"),Pg=ze({type:Tt("nested_selection").describe("Question type identifier"),title:ot.describe("Question title translation"),description:ot.optional().describe("Question description translation"),errorMessage:ot.optional().describe("Error message translation"),placeholder:ot.optional().describe("Dropdown placeholder translation")}).catchall(ot).refine(e=>Object.keys(e).filter(o=>!["type","title","description","errorMessage","placeholder"].includes(o)).every(o=>/^nestedOption\..+\.(label|hint)$/.test(o)),{message:"Additional keys must follow the pattern 'nestedOption.{id}.{label|hint}'"}).describe("Translation schema for nested selection questions"),Rg=ze({type:Tt("annotation").describe("Question type identifier"),title:ot.describe("Question title translation"),description:ot.optional().describe("Question description translation"),errorMessage:ot.optional().describe("Error message translation"),annotationText:ot.optional().describe("Annotation display text translation"),noAnnotationText:ot.optional().describe("No annotation display text translation")}).describe("Translation schema for annotation questions"),Zg=on([Cg,Ag,Mg,Ug,Dg,Lg,Pg,Rg]).describe("Union of all question type translation schemas"),mk=j().min(2).max(10).describe("Language code (e.g., 'en', 'es', 'hi')"),gk=Ht(mk,Zg).describe("Question translations keyed by language code"),qg=Ht(j().uuid(),gk).describe("Question-centric translations keyed by question ID, then by language code"),Fu=qg.describe("Question-centric translations at root level"),Fg=class{constructor(r,o="en"){this.translations=r,this.defaultLanguage=o}getQuestionTranslations(r,o){const a=this.translations[r];if(!a)return null;let t=a[o];return t||(t=a[this.defaultLanguage]),t||null}getTranslationText(r,o,a){const t=this.getQuestionTranslations(r,o);if(!t)return null;if(a in t){const s=t[a];return typeof s=="string"?s:null}return null}getQuestionLanguages(r){const o=this.translations[r];return o?Object.keys(o):[]}getAvailableLanguages(){const r=new Set;return Object.values(this.translations).forEach(o=>{Object.keys(o).forEach(a=>{r.add(a)})}),Array.from(r)}isLanguageSupportedForQuestion(r,o){const a=this.translations[r];return a?o in a:!1}isLanguageSupported(r){return this.getAvailableLanguages().includes(r)}getDefaultLanguage(){return this.defaultLanguage}getQuestionIds(){return Object.keys(this.translations)}getQuestionType(r,o){const a=o||this.defaultLanguage;return this.getQuestionTranslations(r,a)?.type||null}};an(Fg,"TranslationProvider");var Qg=Fg;function Wg(e,r="en"){return new Qg(e,r)}an(Wg,"createTranslationProvider");var Gg=Rt(["fade","manual"]).describe("How the end screen should be dismissed (fade out or manual dismissal)"),hk={FADE:"fade",MANUAL:"manual"},Qu=ze({title:j().min(1).max(200).describe("The main title displayed on the welcome screen"),description:j().min(1).max(1e3).describe("Description text shown on the welcome screen"),buttonLabel:j().min(1).max(50).describe("Text displayed on the welcome screen button")}).describe("Schema for welcome screen configuration fields"),Wu=ze({title:j().min(1).max(200).describe("The main title displayed on the end screen"),message:j().min(1).max(1e3).describe("Message text shown on the end screen"),buttonLabel:j().min(1).max(50).describe("Text displayed on the end screen button"),dismissBehavior:Gg.describe("How the end screen should be dismissed (fade out or manual dismissal)"),fadeDuration:bt().int().min(0).max(1e4).describe("Duration in milliseconds for fade dismissal (0-10000)")}).describe("Schema for end screen configuration fields"),Gu=ze({title:j().min(1).max(200).describe("Translated title text for welcome screen"),description:j().min(1).max(1e3).describe("Translated description text for welcome screen"),buttonLabel:j().min(1).max(50).describe("Translated text for the welcome button label")}).describe("Schema for welcome screen translation fields"),Vu=ze({buttonLabel:j().min(1).max(50).describe("Translated text for the end button label"),title:j().min(1).max(200).describe("Translated title text for end screen"),message:j().min(1).max(1e3).describe("Translated message text for end screen")}).describe("Schema for end screen translation fields"),Ju=ze({pagination:at().describe("Whether to show pagination for multi-page forms"),questionNumber:at().describe("Whether to display question numbers"),pageTitle:at().describe("Whether to show page titles in multi-page forms"),blockerFeedback:at().describe("Whether to show blocker feedback for validation errors"),submitButtonLabel:j().min(1).max(50).describe("Text for the submit button"),previousButtonLabel:j().min(1).max(50).describe("Text for the previous button in pagination"),nextButtonLabel:j().min(1).max(50).describe("Text for the next button in pagination"),aiEnhancementSuccessMessage:j().min(1).max(100).describe("Message shown when AI enhancement is successful (max 100 characters)"),aiEnhancementCooldownErrorMessage:j().min(1).max(100).describe("Message shown when AI enhancement is on cooldown (max 100 characters)"),aiEnhancementMaxReachedErrorMessage:j().min(1).max(100).describe("Message shown when maximum AI enhancements reached (max 100 characters)")}).describe("Schema for other form configuration fields"),Bu=ze({value:j().min(1).max(10).describe("Language code (e.g., 'en', 'es', 'fr')"),label:j().min(1).max(50).describe("Display name for the language (e.g., 'English', 'Spanish', 'French')"),isFixed:at().default(!1).describe("Whether this language is fixed and cannot be deleted by users")}).describe("Schema for individual language field with value, label, and fixed status"),ca=xt(Bu).describe("Schema for array of available languages"),Yu=ze({submitButtonLabel:j().min(1).max(50).describe("Translated text for the submit button"),previousButtonLabel:j().min(1).max(50).describe("Translated text for the previous button in pagination"),nextButtonLabel:j().min(1).max(50).describe("Translated text for the next button in pagination"),aiEnhancementSuccessMessage:j().min(1).max(100).describe("Translated message shown when AI enhancement is successful (max 100 characters)"),aiEnhancementCooldownErrorMessage:j().min(1).max(100).describe("Translated message shown when AI enhancement is on cooldown (max 100 characters)"),aiEnhancementMaxReachedErrorMessage:j().min(1).max(100).describe("Translated message shown when maximum AI enhancements reached (max 100 characters)")}).describe("Schema for other form configuration field translations"),Ku=Rt(["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]).describe("Available positions for widget placement"),vk={TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",MIDDLE_LEFT:"middle-left",MIDDLE_CENTER:"middle-center",MIDDLE_RIGHT:"middle-right",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"},bk=Rt(["light","dark"]).describe("Available theme modes for the widget"),yk={LIGHT:"light",DARK:"dark"},Vg=ze({darkOverlay:at().describe("Whether to show a dark overlay behind the widget"),closeButton:at().describe("Whether to display a close button on the widget"),progressBar:at().describe("Whether to show a progress bar indicating completion status"),showBranding:at().describe("Whether to display branding elements on the widget"),customPosition:at().describe("Whether custom positioning is enabled"),customIconPosition:at().describe("Whether custom icon positioning is enabled"),customCss:j().optional().describe("Custom CSS link to apply for the feedback form")}).describe("Feature settings controlling widget UI behavior and appearance"),Hu=ze({brandColor:j().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,"Must be a valid hex color (e.g., #3366CC)").describe("Primary brand color in hex format"),overlayColor:j().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,"Must be a valid hex color (e.g., #FFFFFF)").describe("Overlay background color in hex format"),textColor:j().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,"Must be a valid hex color (e.g., #333333)").describe("Primary text color in hex format"),backgroundColor:on([j().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i),j().regex(/^rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*(?:,\s*[01](?:\.\d+)?)?\s*\)$/i)]).describe("Background color in hex format or rgba format (e.g., #1A1A1A or rgba(255,255,255, 1))"),theme:j().optional().describe("JSON string of shadcn variables for the theme")}).describe("Color scheme for a single theme"),Xu=ze({light:Hu,dark:Hu}).describe("Complete theme configuration with light and dark variants"),el=ze({themes:Xu.describe("Color themes for light and dark modes"),featureSettings:Vg.describe("UI feature settings controlling widget behavior"),selectedPosition:Ku.describe("Selected position for the main widget"),selectedIconPosition:Ku.describe("Selected position for the widget icon")}).describe("Complete theme and UI configuration including colors, features, and positioning"),Jg=ze({name:j().describe("The operator name (e.g., '=', '!=', 'contains', 'beginsWith', 'matches')"),label:j().describe("Human-readable label for the operator (e.g., 'equals', 'not equals', 'contains')")}).describe("Schema defining an operator for custom event fields"),Bg=ze({name:j().describe("The field name (e.g., 'event_name', 'add_to_cart', 'cart_item_number')"),label:j().describe("Human-readable label for the field"),placeholder:j().describe("Placeholder text for input fields"),operators:xt(Jg).min(1).describe("Array of available operators for this field")}).describe("Schema defining a custom event field with its operators"),Yg=ze({customEventFields:xt(Bg).optional().describe("Array of custom event fields with their operators and labels")}).describe("Schema defining metadata for conditional if clauses"),Kg=ze({query:j().describe("The structured query definition as a JSON string"),naturalLanguage:j().describe("Human-readable description of the query conditions"),jsonLogic:j().describe("JSON Logic representation of the query as a JSON string"),sqlQuery:j().describe("SQL representation of the query for database operations")}).describe("Schema defining query output structure with all fields as strings"),Hg=ze({id:j().describe("Unique identifier for this condition"),event:j().describe("The event that triggers evaluation of this condition (e.g., 'pageLoad', 'pageView', 'scroll', 'custom')"),queryOutput:Kg.describe("The query conditions to evaluate when the event occurs"),metadata:Yg.optional().describe("Optional metadata containing custom event fields and their configurations")}).describe("Schema defining the 'if' condition for auto-trigger logic"),Xg=ze({triggerType:j().describe("The type of action to perform (e.g., 'delay', 'scroll', 'immediately')"),delay:bt().int().min(0).optional().describe("Delay in seconds before performing the action"),scroll:on([j(),bt()]).optional().describe("Scroll position (percentage as string like '75%' or pixel value as number)")}).describe("Schema defining the action to perform when conditions are met"),eh=ze({if:Hg.describe("The condition that must be met"),then:Xg.describe("The action to perform when the condition is met")}).describe("Schema defining a conditional when clause with if-then logic"),da=ze({id:j().describe("Unique identifier for this filter condition"),category:j().describe("The category this filter belongs to (e.g., 'device', 'user', 'geo_location')"),property:j().describe("The property to filter on (e.g., 'device_type', 'age', 'country')"),operator:j().describe("The comparison operator (e.g., 'equals', 'greaterThan', 'lessThan')"),values:xt(j()).min(1).describe("Array of values to compare against"),tbl_key:j().describe("The database table key for this property")}).describe("Schema defining a single filter condition within a category"),th=ze({device:xt(da).optional().describe("Array of device-specific filter conditions"),user:xt(da).optional().describe("Array of user-specific filter conditions"),geo_location:xt(da).optional().describe("Array of geo-location specific filter conditions")}).describe("Schema defining category-specific filters for audience targeting"),rh=ze({applications:xt(j()).min(1).describe("Array of application names this targeting applies to"),userType:j().describe("The type of user this targeting applies to (e.g., 'both', 'new', 'returning')"),categorySpecificFilters:th.optional().describe("Optional category-specific filters for more granular targeting")}).describe("Schema defining who the audience targeting applies to"),nh=ze({id:j().describe("Unique identifier for the audience segment"),name:j().min(1).max(200).describe("Display name for the audience segment"),isImportant:at().describe("Whether this segment is marked as important for targeting"),when:xt(eh).min(1).describe("Array of conditional when clauses with if-then logic"),who:rh.describe("User criteria and conditions defining who belongs to this segment")}).describe("Schema defining an audience segment for targeting with conditional logic"),tl=ze({isAuto:at().describe("Whether automatic triggering is enabled for this audience"),isManual:at().describe("Whether manual triggering is enabled for this audience"),segments:xt(nh).min(0).describe("Array of audience segments for targeting conditions")}).refine(e=>e.isAuto||e.isManual,{message:"At least one of isAuto or isManual must be true",path:["isAuto"]}).describe("Schema defining audience trigger properties for form targeting"),fa=to("isEnabled",[ze({isEnabled:Tt(!1).describe("Whether other configuration properties are enabled"),otherFields:Ju.describe("Other form configuration fields including pagination, buttons, and display options"),translations:Ht(j(),Yu).optional().describe("Translations for other configuration field labels and buttons keyed by language code")}),ze({isEnabled:Tt(!0).describe("Whether other configuration properties are enabled"),otherFields:Ju.describe("Other form configuration fields including pagination, buttons, and display options"),translations:Ht(j(),Yu).describe("Translations for other configuration field labels and buttons keyed by language code")})]).describe("Schema for other configuration properties including fields and translations"),pa=to("isEnabled",[ze({isEnabled:Tt(!1).describe("Whether welcome screen is enabled"),welcomeFields:Qu.optional().describe("Welcome screen configuration fields including title, description, and button label"),translations:Ht(j(),Gu).optional().describe("Translations for welcome screen content keyed by language code")}),ze({isEnabled:Tt(!0).describe("Whether welcome screen is enabled"),welcomeFields:Qu.describe("Welcome screen configuration fields including title, description, and button label"),translations:Ht(j(),Gu).describe("Translations for welcome screen content keyed by language code")})]).describe("Schema for welcome screen properties including fields and translations"),ma=to("isEnabled",[ze({isEnabled:Tt(!1).describe("Whether end screen is enabled"),endFields:Wu.optional().describe("End screen configuration fields including title, message, button label, and dismissal behavior"),translations:Ht(j(),Vu).optional().describe("Translations for end screen content keyed by language code")}),ze({isEnabled:Tt(!0).describe("Whether end screen is enabled"),endFields:Wu.describe("End screen configuration fields including title, message, button label, and dismissal behavior"),translations:Ht(j(),Vu).describe("Translations for end screen content keyed by language code")})]).describe("Schema for end screen properties including fields and translations"),ih=ze({themeConfiguration:el.describe("Theme configuration including colors, features, and positioning")}).describe("Schema for appearance properties including theme configuration"),$k=ze({feedbackConfigurationId:wm().describe("Unique identifier for the feedback configuration"),feedbackConfiguration:Eg.describe("Configuration properties for the feedback form"),questionnaireFields:ze({questions:Ht(j(),la).describe("Collection of questions keyed by their string identifiers"),sections:xt(ua).describe("Array of sections that organize questions into logical groups"),selectedLanguages:ca.describe("Array of languages selected for this questionnaire"),translations:Fu.describe("Multi-language translations for questions and form content")}).describe("Fields defining the questionnaire structure, questions, sections, selected languages, and translations"),frequencyAndSchedulingProperties:qu.describe("Properties controlling when and how often the feedback is shown"),externalPublishingProperties:jg.describe("Properties controlling external sharing and publishing of feedback results"),audienceTriggerProperties:tl.describe("Properties defining audience targeting and trigger conditions for the feedback form"),otherConfigurationProperties:fa.describe("Additional configuration properties including form display options and translations"),welcomeScreenProperties:pa.describe("Welcome screen configuration including content and translations"),endScreenProperties:ma.describe("End screen configuration including content, dismissal behavior, and translations"),appearanceProperties:ih.describe("Appearance configuration including themes, colors, and UI feature settings")}).describe("Complete schema for all feedback-level properties including scheduling, publishing, audience targeting, configuration, screens, and appearance"),oh=ze({mandatoryFetchConfigAtPaths:xt(j()).describe("Array of paths where configuration must be fetched from server when navigated by user"),configSyncIntervalSeconds:bt().int().positive().describe("Interval in seconds for configuration synchronization between client and server"),disableAllSurvey:at().describe("Flag to disable all surveys globally"),feedbackIntervalDuration:bt().int().positive().describe("Duration in seconds for feedback interval between two auto triggered feedbacks")}).describe("Master properties configuration for global survey settings"),ah=Rt(["light","dark","system"]).describe("Enumeration of supported theme modes"),wk={LIGHT:"light",DARK:"dark",SYSTEM:"system"},no=ze({$deviceType:j().describe("Type of device being used"),$timezone:j().describe("Device timezone (e.g., 'Asia/Calcutta')"),$theme:ah.describe("Current theme mode preference"),$os:j().describe("Operating system running on the device"),$osVersion:j().describe("Version of the operating system"),$appVersion:j().describe("Version of the application"),$app:j().describe("Browser or application being used"),$language:j().describe("Language preference (e.g., 'en-GB')")}).describe("Device information collected from the client"),io=ze({$sessionId:j().uuid().describe("Unique session identifier"),$timestamp:j().optional().describe("ISO timestamp of the session")}).describe("Session information for tracking user sessions"),_k=ze({deviceInfo:no.describe("Device information"),sessionInfo:io.describe("Session information")}).describe("Combined device and session information"),sh=ze({$counter:Ht(j(),bt().int()).describe("Counter properties for user tracking (can be positive or negative)").optional(),$set:Ht(j(),ta()).describe("Properties to set for the user").optional(),$setOnce:Ht(j(),ta()).describe("Properties to set once for the user (won't overwrite existing values)").optional(),$unset:xt(j()).describe("Array of property names to unset/remove from the user").optional()}).loose().describe("User properties including counters, set operations, and other dynamic data"),ga=ze({userName:j().email().describe("User's email address as username"),properties:sh.describe("User properties and counters")}).describe("User information including identification and properties"),uh=Rt(["V","S"]).describe("User action: V for view, S for submit"),kk={VIEW:"V",SUBMIT:"S"},ha=ze({feedbackIdentifier:j().uuid().describe("Unique identifier for the feedback instance"),feedbackConfigurationId:j().uuid().describe("Unique identifier for the feedback configuration"),completionTimeInSeconds:bt().int().min(0).describe("Time taken to complete the feedback in seconds"),userAction:uh.describe("Action performed by the user"),responseLanguageCode:j().length(2).describe("Language code for the response (e.g., 'en', 'es')")}).describe("Configuration information for the feedback form"),lh=ze({questionId:j().uuid().describe("Unique identifier for the question"),answer:Ig.describe("The answer provided for this question"),type:j().describe("Type of the question (e.g., 'rating', 'single_choice')"),error:j().optional().describe("Error message if any validation failed")}).describe("Response to a specific question in the feedback form"),ch=ze({questions:xt(lh).min(1).describe("Array of question responses")}).describe("User responses to feedback questions"),dh=ze({customEventName:j().nullable().describe("Custom event name that triggered the feedback"),currentPath:j().describe("Current page path where feedback was triggered"),eventType:j().describe("Type of event that triggered the feedback")}).passthrough().describe("Properties of the trigger that matched for this feedback"),rl=ze({formConfig:ha.describe("Form configuration information"),deviceInfo:no.describe("Device information"),sessionInfo:io.optional().describe("Session information"),userInfo:ga.optional().describe("User information (optional)"),matchedTriggerProperties:dh.optional().describe("Properties of the matched trigger"),customProperties:Ht(j(),Qn()).optional().describe("Custom properties for advanced use cases")}).describe("Base submit feedback request schema"),fh=rl.extend({formConfig:ha.extend({userAction:Tt("V").describe("Action performed by the user (view)")})}).strict().describe("View feedback request schema (no response required)"),ph=rl.extend({formConfig:ha.extend({userAction:Tt("S").describe("Action performed by the user (submit)")}),response:ch.describe("User responses (required for submit)")}).strict().describe("Submit feedback request schema (response required)"),xk=on([fh,ph]).describe("Union schema for both view and submit feedback requests"),mh=ze({feedbackConfigurationId:j().uuid().describe("Unique identifier for the feedback configuration"),feedbackTitle:j().describe("Title of the feedback configuration"),triggerProperties:tl.describe("Trigger properties including auto/manual settings and audience segments"),appearanceProperties:ze({themes:ze({light:ze({brandColor:j().describe("Brand color for light theme"),overlayColor:j().describe("Overlay color for light theme"),textColor:j().describe("Text color for light theme"),backgroundColor:j().describe("Background color for light theme")}).describe("Light theme colors"),dark:ze({brandColor:j().describe("Brand color for dark theme"),overlayColor:j().describe("Overlay color for dark theme"),textColor:j().describe("Text color for dark theme"),backgroundColor:j().describe("Background color for dark theme")}).describe("Dark theme colors")}).nullable().optional().describe("Theme configuration (optional)"),featureSettings:ze({darkOverlay:at().describe("Whether to show dark overlay"),closeButton:at().describe("Whether to show close button"),progressBar:at().describe("Whether to show progress bar"),showBranding:at().describe("Whether to show branding"),customPosition:at().describe("Whether custom position is enabled"),customIconPosition:at().describe("Whether custom icon position is enabled"),customCss:j().nullable().optional().describe("Custom CSS link (optional)")}).describe("Feature settings for the feedback form"),selectedIconPosition:j().describe("Selected position for the feedback icon"),selectedPosition:j().describe("Selected position for the feedback form")}).describe("Appearance properties for the feedback form"),frequencyAndScheduling:qu.optional().describe("Frequency and scheduling properties for the feedback (optional)")}).describe("Individual feedback configuration item in the list"),gh=ze({feedbackConfigurationId:j().uuid().describe("Unique identifier for the feedback configuration"),responseLanguageCode:j().length(2).describe("Language code for the response (e.g., 'en', 'es')")}).describe("Form configuration for fetching feedback details"),Sk=ze({deviceInfo:no.describe("Device information"),sessionInfo:io.describe("Session information"),userInfo:ga.optional().describe("User information (optional)"),force:at().optional().describe("Forcefully fetch eligible feedback list (optional)")}).strict().describe("Request schema for fetching available feedback configurations"),Ik=ze({formConfig:gh.describe("Form configuration for the specific feedback"),deviceInfo:no.describe("Device information"),sessionInfo:io.describe("Session information"),userInfo:ga.optional().describe("User information (optional)")}).strict().describe("Request schema for fetching specific feedback form details"),hh=ze({formTitle:j().describe("Title of the feedback form"),formDescription:j().describe("Description of the feedback form")}).describe("Form configuration response with title and description"),vh=ze({questions:Ht(j(),la).describe("Collection of questions keyed by their string identifiers"),sections:xt(ua).describe("Array of sections that organize questions into logical groups"),translations:Ht(j(),ta()).describe("Translations object (can be empty or contain language-specific translations)"),selectedLanguages:ca.describe("Array of languages selected for this questionnaire")}).describe("Questionnaire fields response including questions, sections, translations, and selected languages"),zk=ze({feedbackConfigurationId:j().uuid().describe("Unique identifier for the feedback configuration"),feedbackIdentifier:j().uuid().describe("Unique identifier for this specific feedback instance"),formConfiguration:hh.describe("Form configuration with title and description"),questionnaireFields:vh.describe("Questionnaire structure including questions, sections, translations, and languages"),otherConfigurationProperties:fa.describe("Other configuration properties using existing schema"),welcomeScreenProperties:pa.describe("Welcome screen properties using existing schema"),endScreenProperties:ma.describe("End screen properties using existing schema")}).strict().describe("Complete response schema for fetchFeedbackDetails API using existing field schemas"),Nk=ze({masterProperties:oh.describe("Master properties for global survey settings"),feedbackConfiguration:xt(mh).describe("Array of available feedback configurations")}).strict().describe("Response schema for fetchConfigurationList API"),Tk=ze({questionId:j().describe("Unique identifier for the question"),identifier:j().uuid().describe("Unique identifier for the feedback instance"),feedbackConfigurationId:j().uuid().describe("Unique identifier for the feedback configuration"),userText:j().describe("Original text input from the user")}).strict().describe("Request schema for refining user text input"),bh=ze({userText:j().describe("Original text input from the user"),refinedText:j().describe("Refined/improved version of the user text")}).describe("Data containing original and refined text"),jk=ze({success:at().describe("Indicates whether the operation was successful"),code:j().describe("Response code indicating the status"),message:j().describe("Human-readable message describing the result"),messageId:j().describe("Unique identifier for the response message"),data:bh.describe("Response data containing original and refined text"),error:j().optional().describe("Error message if the operation failed (optional)")}).strict().describe("Response schema for refine text API operation");function vi(e,r){if(e===null||typeof e>"u"||typeof e!="object")return e;const o=Array.isArray(e)?[]:{};for(const[a,t]of Object.entries(e)){let s=a;typeof a=="string"&&!a.includes("-")&&(s=r(a)),o[s]=Array.isArray(t)?t.map(f=>typeof f=="object"&&!(f instanceof Uint8Array)&&!(f instanceof Date)?vi(f,r):f):t instanceof Uint8Array||t instanceof Date?t:typeof t=="object"?vi(t,r):t}return o}an(vi,"convertObject");function va(e){return e.length===1?e.toLowerCase():e.replace(/^([A-Z])/,r=>r[0].toLowerCase()).replace(/[_-]([a-z0-9])/g,r=>r[1].toUpperCase())}an(va,"toCamel");function yh(e){return vi(e,va)}an(yh,"objectToCamel");function nl(e){let r=e,o=0;for(;(/([a-z])([0-9])/.exec(r)?.length||0)>2&&o<10;)r=r.replace(/([a-z])([0-9])/,(a,t,s)=>`${t.toLowerCase()}_${s.toLowerCase()}`),o+=1;for(;(/(.+?)([A-Z])/.exec(r)?.length||0)>2&&o<10;)r=r.replace(/(.+?)([A-Z])/,(a,t,s)=>`${t.toLowerCase()}_${s.toLowerCase()}`),o+=1;return r.toLowerCase()}an(nl,"toSnake");function $h(e){return vi(e,nl)}an($h,"objectToSnake");function il(e){return va(e).replace(/^([a-z])/,r=>r[0].toUpperCase())}an(il,"toPascal");function wh(e){return vi(e,il)}an(wh,"objectToPascal");var _h=Rt(["light","dark"]).describe("Current theme mode of the application"),Ok={LIGHT:"light",DARK:"dark"},Ek=ze({theme:Xu.describe("Theme configuration including light and dark theme colors"),currentMode:_h.describe("Current theme mode (light or dark)"),currentLanguage:Bu.describe("Currently selected language configuration"),questions:Ht(j(),la).describe("Collection of questions keyed by their string identifiers"),questionLanguages:ca.describe("Available languages for questions"),otherConfigurationProperties:fa.describe("Other configuration properties including form display options and translations"),welcomeScreenProperties:pa.optional().describe("Welcome screen configuration (optional)"),endScreenProperties:ma.optional().describe("End screen configuration (optional)"),translations:Fu.optional().describe("Multi-language translations for questions and form content (optional)"),onSectionChange:aa({input:[bt()],output:Tu()}).optional().describe("Optional callback function triggered when section changes"),onClose:aa({input:[],output:Tu()}).optional().describe("Optional callback function triggered when the form is closed"),sections:xt(ua).describe("Array of sections that organize questions into logical groups"),themeSettings:el.describe("Complete theme configuration including colors, features, and positioning")}).describe("Schema for application props interface containing all form configuration and state");const Ck=Zb(Object.freeze(Object.defineProperty({__proto__:null,AnnotationMarkerSchema:kg,AnnotationSchema:xg,AnswerItemSchema:Sg,AnswerSchema:Ig,ChoiceOrderOptions:lk,CurrentModes:Ok,DeviceThemes:wk,DismissBehaviors:hk,EndFieldsTranslationSchema:Vu,EndScreenFieldsSchema:Wu,LanguageFieldSchema:Bu,LanguagesSchema:ca,MultipleChoiceDisplayStyles:sk,MultipleChoiceMultipleDisplayStyles:uk,OtherFieldsSchema:Ju,OtherFieldsTranslationSchema:Yu,Positions:vk,PublicationStatuses:pk,QuestionStatuses:ik,QuestionTypes:ek,RatingDisplayStyles:ok,RatingRepresentationSizes:ak,RecurringUnits:fk,SurveyTypes:ck,ThemeModes:yk,TranslationProvider:Qg,UserActions:kk,ValidationRuleTypes:tk,VisibilityConditionOperators:nk,WelcomeFieldsTranslationSchema:Gu,WelcomeScreenFieldsSchema:Qu,YesNoValues:dk,annotationQuestionSchema:hg,annotationQuestionTranslationSchema:Rg,appPropsSchema:Ek,appearancePropertiesSchema:ih,audienceSegmentSchema:nh,audienceTriggerPropertiesSchema:tl,baseSubmitFeedbackSchema:rl,categorySpecificFiltersSchema:th,choiceOrderOptionSchema:mg,combinedQuestionSchema:la,conditionalIfMetadataSchema:Yg,conditionalIfSchema:Hg,conditionalWhenSchema:eh,createTranslationProvider:Wg,currentModeSchema:_h,customEventFieldOperatorSchema:Jg,customEventFieldSchema:Bg,deviceInfoSchema:no,deviceSessionInfoSchema:_k,deviceThemeSchema:ah,dismissBehaviorSchema:Gg,endScreenPropertiesSchema:ma,externalPublishingPropertiesSchema:jg,featureSettingsSchema:Vg,feedbackConfigurationItemSchema:mh,feedbackConfigurationSchema:Eg,feedbackRequestSchema:xk,fetchConfigurationListResponseSchema:Nk,fetchConfigurationListSchema:Sk,fetchFeedbackDetailsResponseSchema:zk,fetchFeedbackDetailsSchema:Ik,fetchFormConfigSchema:gh,filterConditionSchema:da,formConfigSchema:ha,formConfigurationResponseSchema:hh,formPropertiesSchema:$k,frequencyAndSchedulingPropertiesSchema:qu,longAnswerQuestionSchema:wg,longAnswerQuestionTranslationSchema:Lg,masterPropertiesSchema:oh,matchedTriggerPropertiesSchema:dh,multipleChoiceDisplayStyleSchema:fg,multipleChoiceMultipleDisplayStyleSchema:pg,multipleChoiceMultipleQuestionSchema:bg,multipleChoiceQuestionTranslationSchema:Mg,multipleChoiceSingleQuestionSchema:vg,nestedDropdownQuestionSchema:_g,nestedOptionSchema:Zu,nestedSelectionQuestionTranslationSchema:Pg,npsQuestionSchema:yg,npsQuestionTranslationSchema:Ug,objectToCamel:yh,objectToPascal:wh,objectToSnake:$h,otherConfigurationPropertiesSchema:fa,positionSchema:Ku,publicationStatusSchema:Og,queryOutputSchema:Kg,questionCentricTranslationsSchema:qg,questionOptionSchema:Ru,questionResponseSchema:lh,questionSchema:sn,questionStatusSchema:lg,questionTranslationSchema:Zg,questionTypeSchema:og,questionnaireFieldsResponseSchema:vh,ratingDisplayStyleSchema:cg,ratingQuestionSchema:gg,ratingQuestionTranslationSchema:Cg,ratingRepresentationSizeSchema:dg,recurringUnitSchema:Tg,refineTextDataSchema:bh,refineTextParamsSchema:Tk,refineTextResponseSchema:jk,responseSchema:ch,sectionSchema:ua,sessionInfoSchema:io,shortAnswerQuestionSchema:$g,shortAnswerQuestionTranslationSchema:Dg,singleChoiceQuestionTranslationSchema:Ag,submitFeedbackSchema:ph,surveyTypeSchema:zg,themeColorsSchema:Hu,themeConfigurationSchema:el,themeModeSchema:bk,themesSchema:Xu,toCamel:va,toPascal:il,toSnake:nl,translationEntrySchema:ot,translationsSchema:Fu,triggerActionSchema:Xg,userActionSchema:uh,userInfoSchema:ga,userPropertiesSchema:sh,validationRuleSchema:sg,validationRuleTypeSchema:ag,viewFeedbackSchema:fh,visibilityConditionSchema:ug,welcomeScreenPropertiesSchema:pa,whoSchema:rh,yesNoSchema:Ng,z:H_},Symbol.toStringTag,{value:"Module"})));var Ak=Li.exports,kh;function Mk(){return kh||(kh=1,(function(e,r){(function(o,a){a(r,Ck)})(Ak,(function(o,a){typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");let t=!1,s=!1;function f(){t=!0}f();const _=1,F=2,X=4,ge=8,ce=16,Ce=1,be=2,P=4,Se=8,Pe=16,yt=1,gt=2,vt="[",_t="[!",vr="]",Yr={},Jt=Symbol(),ba="http://www.w3.org/1999/xhtml",ol="http://www.w3.org/2000/svg",ya="@attach",oo=!1;var kn=Array.isArray,al=Array.prototype.indexOf,Wn=Array.from,Gn=Object.keys,Kr=Object.defineProperty,Er=Object.getOwnPropertyDescriptor,ao=Object.getOwnPropertyDescriptors,so=Object.prototype,ve=Array.prototype,et=Object.getPrototypeOf,Ct=Object.isExtensible;function Zt(i){return typeof i=="function"}const $t=()=>{};function Cr(i){return i()}function Vn(i){for(var n=0;n<i.length;n++)i[n]()}function bi(){var i,n,u=new Promise((l,d)=>{i=l,n=d});return{promise:u,resolve:i,reject:n}}function Xt(i,n){if(Array.isArray(i))return i;if(!(Symbol.iterator in i))return Array.from(i);const u=[];for(const l of i)if(u.push(l),u.length===n)break;return u}const Qt=2,Jn=4,yi=8,Bn=16,un=32,xn=64,sl=128,Ar=256,$a=512,ur=1024,Nr=2048,ln=4096,Fr=8192,Yn=16384,ul=32768,Kn=65536,xh=1<<17,Lk=1<<18,Hn=1<<19,Sh=1<<20,ll=1<<21,wa=1<<22,Xn=1<<23,Hr=Symbol("$state"),cl=Symbol("legacy props"),Pk=Symbol(""),uo=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Rk=1,_a=3,ei=8;function dl(i){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Zk(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function qk(i){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Fk(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Qk(i){throw new Error("https://svelte.dev/e/effect_orphan")}function Wk(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Gk(){throw new Error("https://svelte.dev/e/hydration_failed")}function Vk(i){throw new Error("https://svelte.dev/e/props_invalid_value")}function Jk(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Bk(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Yk(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Kk(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function ka(i){console.warn("https://svelte.dev/e/hydration_mismatch")}function Hk(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Xk(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let Ze=!1;function br(i){Ze=i}let Xe;function rr(i){if(i===null)throw ka(),Yr;return Xe=i}function cn(){return rr(en(Xe))}function D(i){if(Ze){if(en(Xe)!==null)throw ka(),Yr;Xe=i}}function dr(i=1){if(Ze){for(var n=i,u=Xe;n--;)u=en(u);Xe=u}}function xa(i=!0){for(var n=0,u=Xe;;){if(u.nodeType===ei){var l=u.data;if(l===vr){if(n===0)return u;n-=1}else(l===vt||l===_t)&&(n+=1)}var d=en(u);i&&u.remove(),u=d}}function Ih(i){if(!i||i.nodeType!==ei)throw ka(),Yr;return i.data}function zh(i){return i===this.v}function Nh(i,n){return i!=i?n==n:i!==n||i!==null&&typeof i=="object"||typeof i=="function"}function Th(i){return!Nh(i,this.v)}const ex=[];function tx(i,n=!1,u=!1){return Sa(i,new Map,"",ex,null,u)}function Sa(i,n,u,l,d=null,p=!1){if(typeof i=="object"&&i!==null){var m=n.get(i);if(m!==void 0)return m;if(i instanceof Map)return new Map(i);if(i instanceof Set)return new Set(i);if(kn(i)){var h=Array(i.length);n.set(i,h),d!==null&&n.set(d,h);for(var g=0;g<i.length;g+=1){var v=i[g];g in i&&(h[g]=Sa(v,n,u,l,null,p))}return h}if(et(i)===so){h={},n.set(i,h),d!==null&&n.set(d,h);for(var y in i)h[y]=Sa(i[y],n,u,l,null,p);return h}if(i instanceof Date)return structuredClone(i);if(typeof i.toJSON=="function"&&!p)return Sa(i.toJSON(),n,u,l,i)}if(i instanceof EventTarget)return i;try{return structuredClone(i)}catch{return i}}let jt=null;function $i(i){jt=i}function fl(i){return pl().get(i)}function jh(i,n){return pl().set(i,n),n}function rx(i){return pl().has(i)}function tt(i,n=!1,u){jt={p:jt,c:null,e:null,s:i,x:null,l:t&&!n?{s:null,u:null,$:[]}:null}}function rt(i){var n=jt,u=n.e;if(u!==null){n.e=null;for(var l of u)tv(l)}return i!==void 0&&(n.x=i),jt=n.p,i??{}}function lo(){return!t||jt!==null&&jt.l===null}function pl(i){return jt===null&&dl(),jt.c??=new Map(nx(jt)||void 0)}function nx(i){let n=i.p;for(;n!==null;){const u=n.c;if(u!==null)return u;n=n.p}return null}let ti=[];function Oh(){var i=ti;ti=[],Vn(i)}function dn(i){if(ti.length===0&&!co){var n=ti;queueMicrotask(()=>{n===ti&&Oh()})}ti.push(i)}function ix(){for(;ti.length>0;)Oh()}const ox=new WeakMap;function Eh(i){var n=nt;if(n===null)return pt.f|=Xn,i;if((n.f&ul)===0){if((n.f&sl)===0)throw!n.parent&&i instanceof Error&&Ch(i),i;n.b.error(i)}else wi(i,n)}function wi(i,n){for(;n!==null;){if((n.f&sl)!==0)try{n.b.error(i);return}catch(u){i=u}n=n.parent}throw i instanceof Error&&Ch(i),i}function Ch(i){const n=ox.get(i);n&&(Kr(i,"message",{value:n.message}),Kr(i,"stack",{value:n.stack}))}const Ia=new Set;let Lt=null,za=null,ml=new Set,Xr=[],Na=null,gl=!1,co=!1;class Qr{current=new Map;#e=new Map;#t=new Set;#n=0;#o=null;#i=[];#a=[];#r=[];#s=[];#u=[];#c=[];skipped_effects=new Set;process(n){Xr=[],za=null;for(const d of n)this.#d(d);if(this.#n===0){this.#f();var u=this.#a,l=this.#r;this.#a=[],this.#r=[],this.#s=[],za=this,Lt=null,Mh(u),Mh(l),za=null,this.#o?.resolve()}else this.#l(this.#a),this.#l(this.#r),this.#l(this.#s);for(const d of this.#i)xi(d);this.#i=[]}#d(n){n.f^=ur;for(var u=n.first;u!==null;){var l=u.f,d=(l&(un|xn))!==0,p=d&&(l&ur)!==0,m=p||(l&Fr)!==0||this.skipped_effects.has(u);if(!m&&u.fn!==null){d?u.f^=ur:(l&Jn)!==0?this.#r.push(u):(l&ur)===0&&((l&wa)!==0&&u.b?.is_pending()?this.#i.push(u):ho(u)&&((u.f&Bn)!==0&&this.#s.push(u),xi(u)));var h=u.first;if(h!==null){u=h;continue}}var g=u.parent;for(u=u.next;u===null&&g!==null;)u=g.next,g=g.parent}}#l(n){for(const u of n)((u.f&Nr)!==0?this.#u:this.#c).push(u),pr(u,ur);n.length=0}capture(n,u){this.#e.has(n)||this.#e.set(n,u),this.current.set(n,n.v)}activate(){Lt=this}deactivate(){Lt=null}flush(){if(Xr.length>0){if(this.activate(),Ah(),Lt!==null&&Lt!==this)return}else this.#n===0&&this.#f();this.deactivate();for(const n of ml)if(ml.delete(n),n(),Lt!==null)break}#f(){for(const n of this.#t)n();if(this.#t.clear(),Ia.size>1){this.#e.clear();let n=!0;for(const u of Ia){if(u===this){n=!1;continue}for(const[l,d]of this.current){if(u.current.has(l))if(n)u.current.set(l,d);else continue;Uh(l)}if(Xr.length>0){Lt=u;for(const l of Xr)u.#d(l);Xr=[]}}Lt=null}Ia.delete(this)}increment(){this.#n+=1}decrement(){this.#n-=1;for(const n of this.#u)pr(n,Nr),ni(n);for(const n of this.#c)pr(n,ln),ni(n);this.flush()}add_callback(n){this.#t.add(n)}settled(){return(this.#o??=bi()).promise}static ensure(){if(Lt===null){const n=Lt=new Qr;Ia.add(Lt),co||Qr.enqueue(()=>{Lt===n&&n.flush()})}return Lt}static enqueue(n){dn(n)}static apply(n){return $t}}function dt(i){var n=co;co=!0;try{for(var u;;){if(ix(),Xr.length===0&&(Lt?.flush(),Xr.length===0))return Na=null,u;Ah()}}finally{co=n}}function Ah(){var i=ki;gl=!0;try{var n=0;for(uv(!0);Xr.length>0;){var u=Qr.ensure();if(n++>1e3){var l,d;ax()}u.process(Xr),Sn.clear()}}finally{gl=!1,uv(i),Na=null}}function ax(){try{Wk()}catch(i){wi(i,Na)}}let ri=null;function Mh(i){var n=i.length;if(n!==0){for(var u=0;u<n;){var l=i[u++];if((l.f&(Yn|Fr))===0&&ho(l)&&(ri=[],xi(l),l.deps===null&&l.first===null&&l.nodes_start===null&&(l.teardown===null&&l.ac===null?ov(l):l.fn=null),ri?.length>0)){Sn.clear();for(const d of ri)xi(d);ri=[]}}ri=null}}function Uh(i){if(i.reactions!==null)for(const n of i.reactions){const u=n.f;(u&Qt)!==0?Uh(n):(u&(wa|Bn))!==0&&(pr(n,Nr),ni(n))}}function ni(i){for(var n=Na=i;n.parent!==null;){n=n.parent;var u=n.f;if(gl&&n===nt&&(u&Bn)!==0)return;if((u&(xn|un))!==0){if((u&ur)===0)return;n.f^=ur}}Xr.push(n)}function Dh(i){let n=0,u=In(0),l;return()=>{bx()&&(c(u),ii(()=>(n===0&&(l=O(()=>i(()=>po(u)))),n+=1,()=>{dn(()=>{n-=1,n===0&&(l?.(),l=void 0,po(u))})})))}}var sx=Kn|Hn|sl;function ux(i,n,u){new lx(i,n,u)}class lx{parent;#e=!1;#t;#n=Ze?Xe:null;#o;#i;#a;#r=null;#s=null;#u=null;#c=null;#d=0;#l=0;#f=!1;#p=null;#v=()=>{this.#p&&_i(this.#p,this.#d)};#b=Dh(()=>(this.#p=In(this.#d),()=>{this.#p=null}));constructor(n,u,l){this.#t=n,this.#o=u,this.#i=l,this.parent=nt.b,this.#e=!!this.#o.pending,this.#a=Nn(()=>{if(nt.b=this,Ze){const d=this.#n;cn(),d.nodeType===ei&&d.data===_t?this.#$():this.#y()}else{try{this.#r=lr(()=>l(this.#t))}catch(d){this.error(d)}this.#l>0?this.#g():this.#e=!1}},sx),Ze&&(this.#t=Xe)}#y(){try{this.#r=lr(()=>this.#i(this.#t))}catch(n){this.error(n)}this.#e=!1}#$(){const n=this.#o.pending;n&&(this.#s=lr(()=>n(this.#t)),Qr.enqueue(()=>{this.#r=this.#m(()=>(Qr.ensure(),lr(()=>this.#i(this.#t)))),this.#l>0?this.#g():(Tn(this.#s,()=>{this.#s=null}),this.#e=!1)}))}is_pending(){return this.#e||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#o.pending}#m(n){var u=nt,l=pt,d=jt;Ur(this.#a),$r(this.#a),$i(this.#a.ctx);try{return n()}catch(p){return Eh(p),null}finally{Ur(u),$r(l),$i(d)}}#g(){const n=this.#o.pending;this.#r!==null&&(this.#c=document.createDocumentFragment(),cx(this.#r,this.#c)),this.#s===null&&(this.#s=lr(()=>n(this.#t)))}#h(n){if(!this.has_pending_snippet()){this.parent&&this.parent.#h(n);return}this.#l+=n,this.#l===0&&(this.#e=!1,this.#s&&Tn(this.#s,()=>{this.#s=null}),this.#c&&(this.#t.before(this.#c),this.#c=null),dn(()=>{Qr.ensure().flush()}))}update_pending_count(n){this.#h(n),this.#d+=n,ml.add(this.#v)}get_effect_pending(){return this.#b(),c(this.#p)}error(n){var u=this.#o.onerror;let l=this.#o.failed;if(this.#f||!u&&!l)throw n;this.#r&&(nr(this.#r),this.#r=null),this.#s&&(nr(this.#s),this.#s=null),this.#u&&(nr(this.#u),this.#u=null),Ze&&(rr(this.#n),dr(),rr(xa()));var d=!1,p=!1;const m=()=>{if(d){Xk();return}d=!0,p&&Kk(),Qr.ensure(),this.#d=0,this.#u!==null&&Tn(this.#u,()=>{this.#u=null}),this.#e=this.has_pending_snippet(),this.#r=this.#m(()=>(this.#f=!1,lr(()=>this.#i(this.#t)))),this.#l>0?this.#g():this.#e=!1};var h=pt;try{$r(null),p=!0,u?.(n,m),p=!1}catch(g){wi(g,this.#a&&this.#a.parent)}finally{$r(h)}l&&dn(()=>{this.#u=this.#m(()=>{this.#f=!0;try{return lr(()=>{l(this.#t,()=>n,()=>m)})}catch(g){return wi(g,this.#a.parent),null}finally{this.#f=!1}})})}}function cx(i,n){for(var u=i.nodes_start,l=i.nodes_end;u!==null;){var d=u===l?null:en(u);n.append(u),u=d}}function Lh(i,n,u){const l=lo()?fo:Le;if(n.length===0){u(i.map(l));return}var d=Lt,p=nt,m=dx(),h=Ze;Promise.all(n.map(g=>fx(g))).then(g=>{m();try{u([...i.map(l),...g])}catch(v){(p.f&Yn)===0&&wi(v,p)}h&&br(!1),d?.deactivate(),Ph()}).catch(g=>{wi(g,p)})}function dx(){var i=nt,n=pt,u=jt,l=Lt,d=Ze;if(d)var p=Xe;return function(){Ur(i),$r(n),$i(u),l?.activate(),d&&(br(!0),rr(p))}}function Ph(){Ur(null),$r(null),$i(null)}function fo(i){var n=Qt|Nr,u=pt!==null&&(pt.f&Qt)!==0?pt:null;return nt===null||u!==null&&(u.f&Ar)!==0?n|=Ar:nt.f|=Hn,{ctx:jt,deps:null,effects:null,equals:zh,f:n,fn:i,reactions:null,rv:0,v:Jt,wv:0,parent:u??nt,ac:null}}function fx(i,n){let u=nt;u===null&&Zk();var l=u.b,d=void 0,p=In(Jt),m=!pt,h=new Map;return wx(()=>{var g=bi();d=g.promise;try{Promise.resolve(i()).then(g.resolve,g.reject)}catch(b){g.reject(b)}var v=Lt,y=l.is_pending();m&&(l.update_pending_count(1),y||(v.increment(),h.get(v)?.reject(uo),h.set(v,g)));const k=(b,I=void 0)=>{y||v.activate(),I?I!==uo&&(p.f|=Xn,_i(p,I)):((p.f&Xn)!==0&&(p.f^=Xn),_i(p,b)),m&&(l.update_pending_count(-1),y||v.decrement()),Ph()};g.promise.then(k,b=>k(null,b||"unknown"))}),yl(()=>{for(const g of h.values())g.reject(uo)}),new Promise(g=>{function v(y){function k(){y===d?g(p):v(d)}y.then(k,k)}v(d)})}function ht(i){const n=fo(i);return cv(n),n}function Le(i){const n=fo(i);return n.equals=Th,n}function Rh(i){var n=i.effects;if(n!==null){i.effects=null;for(var u=0;u<n.length;u+=1)nr(n[u])}}function px(i){for(var n=i.parent;n!==null;){if((n.f&Qt)===0)return n;n=n.parent}return null}function hl(i){var n,u=nt;Ur(px(i));try{Rh(i),n=gv(i)}finally{Ur(u)}return n}function Zh(i){var n=hl(i);if(i.equals(n)||(i.v=n,i.wv=pv()),!oi){var u=(jn||(i.f&Ar)!==0)&&i.deps!==null?ln:ur;pr(i,u)}}const Sn=new Map;function In(i,n){var u={f:0,v:i,reactions:null,equals:zh,rv:0,wv:0};return u}function Wr(i,n){const u=In(i);return cv(u),u}function re(i,n=!1,u=!0){const l=In(i);return n||(l.equals=Th),t&&u&&jt!==null&&jt.l!==null&&(jt.l.s??=[]).push(l),l}function qh(i,n){return $(i,O(()=>c(i))),n}function $(i,n,u=!1){pt!==null&&(!Jr||(pt.f&xh)!==0)&&lo()&&(pt.f&(Qt|Bn|wa|xh))!==0&&!fn?.includes(i)&&Yk();let l=u?zn(n):n;return _i(i,l)}function _i(i,n){if(!i.equals(n)){var u=i.v;oi?Sn.set(i,n):Sn.set(i,u),i.v=n;var l=Qr.ensure();l.capture(i,u),(i.f&Qt)!==0&&((i.f&Nr)!==0&&hl(i),pr(i,(i.f&Ar)===0?ur:ln)),i.wv=pv(),Qh(i,Nr),lo()&&nt!==null&&(nt.f&ur)!==0&&(nt.f&(un|xn))===0&&(Dr===null?xx([i]):Dr.push(i))}return n}function Fh(i,n=1){var u=c(i),l=n===1?u++:u--;return $(i,u),l}function po(i){$(i,i.v+1)}function Qh(i,n){var u=i.reactions;if(u!==null)for(var l=lo(),d=u.length,p=0;p<d;p++){var m=u[p],h=m.f;if(!(!l&&m===nt)){var g=(h&Nr)===0;g&&pr(m,n),(h&Qt)!==0?Qh(m,ln):g&&((h&Bn)!==0&&ri!==null&&ri.push(m),ni(m))}}}function zn(i){if(typeof i!="object"||i===null||Hr in i)return i;const n=et(i);if(n!==so&&n!==ve)return i;var u=new Map,l=kn(i),d=Wr(0),p=ai,m=h=>{if(ai===p)return h();var g=pt,v=ai;$r(null),fv(p);var y=h();return $r(g),fv(v),y};return l&&u.set("length",Wr(i.length)),new Proxy(i,{defineProperty(h,g,v){(!("value"in v)||v.configurable===!1||v.enumerable===!1||v.writable===!1)&&Jk();var y=u.get(g);return y===void 0?y=m(()=>{var k=Wr(v.value);return u.set(g,k),k}):$(y,v.value,!0),!0},deleteProperty(h,g){var v=u.get(g);if(v===void 0){if(g in h){const y=m(()=>Wr(Jt));u.set(g,y),po(d)}}else $(v,Jt),po(d);return!0},get(h,g,v){if(g===Hr)return i;var y=u.get(g),k=g in h;if(y===void 0&&(!k||Er(h,g)?.writable)&&(y=m(()=>{var I=zn(k?h[g]:Jt),S=Wr(I);return S}),u.set(g,y)),y!==void 0){var b=c(y);return b===Jt?void 0:b}return Reflect.get(h,g,v)},getOwnPropertyDescriptor(h,g){var v=Reflect.getOwnPropertyDescriptor(h,g);if(v&&"value"in v){var y=u.get(g);y&&(v.value=c(y))}else if(v===void 0){var k=u.get(g),b=k?.v;if(k!==void 0&&b!==Jt)return{enumerable:!0,configurable:!0,value:b,writable:!0}}return v},has(h,g){if(g===Hr)return!0;var v=u.get(g),y=v!==void 0&&v.v!==Jt||Reflect.has(h,g);if(v!==void 0||nt!==null&&(!y||Er(h,g)?.writable)){v===void 0&&(v=m(()=>{var b=y?zn(h[g]):Jt,I=Wr(b);return I}),u.set(g,v));var k=c(v);if(k===Jt)return!1}return y},set(h,g,v,y){var k=u.get(g),b=g in h;if(l&&g==="length")for(var I=v;I<k.v;I+=1){var S=u.get(I+"");S!==void 0?$(S,Jt):I in h&&(S=m(()=>Wr(Jt)),u.set(I+"",S))}if(k===void 0)(!b||Er(h,g)?.writable)&&(k=m(()=>Wr(void 0)),$(k,zn(v)),u.set(g,k));else{b=k.v!==Jt;var T=m(()=>zn(v));$(k,T)}var G=Reflect.getOwnPropertyDescriptor(h,g);if(G?.set&&G.set.call(y,v),!b){if(l&&typeof g=="string"){var te=u.get("length"),ae=Number(g);Number.isInteger(ae)&&ae>=te.v&&$(te,ae+1)}po(d)}return!0},ownKeys(h){c(d);var g=Reflect.ownKeys(h).filter(k=>{var b=u.get(k);return b===void 0||b.v!==Jt});for(var[v,y]of u)y.v!==Jt&&!(v in h)&&g.push(v);return g},setPrototypeOf(){Bk()}})}function Wh(i){try{if(i!==null&&typeof i=="object"&&Hr in i)return i[Hr]}catch{}return i}function mx(i,n){return Object.is(Wh(i),Wh(n))}var Gh,Vh,Jh,Bh;function vl(){if(Gh===void 0){Gh=window,Vh=/Firefox/.test(navigator.userAgent);var i=Element.prototype,n=Node.prototype,u=Text.prototype;Jh=Er(n,"firstChild").get,Bh=Er(n,"nextSibling").get,Ct(i)&&(i.__click=void 0,i.__className=void 0,i.__attributes=null,i.__style=void 0,i.__e=void 0),Ct(u)&&(u.__t=void 0)}}function Mr(i=""){return document.createTextNode(i)}function Gr(i){return Jh.call(i)}function en(i){return Bh.call(i)}function Z(i,n){if(!Ze)return Gr(i);var u=Gr(Xe);if(u===null)u=Xe.appendChild(Mr());else if(n&&u.nodeType!==_a){var l=Mr();return u?.before(l),rr(l),l}return rr(u),u}function je(i,n=!1){if(!Ze){var u=Gr(i);return u instanceof Comment&&u.data===""?en(u):u}if(n&&Xe?.nodeType!==_a){var l=Mr();return Xe?.before(l),rr(l),l}return Xe}function de(i,n=1,u=!1){let l=Ze?Xe:i;for(var d;n--;)d=l,l=en(l);if(!Ze)return l;if(u&&l?.nodeType!==_a){var p=Mr();return l===null?d?.after(p):l.before(p),rr(p),p}return rr(l),l}function bl(i){i.textContent=""}function Yh(){return!1}function gx(i,n){if(n){const u=document.body;i.autofocus=!0,dn(()=>{document.activeElement===u&&i.focus()})}}function hx(i){Ze&&Gr(i)!==null&&bl(i)}let Kh=!1;function Hh(){Kh||(Kh=!0,document.addEventListener("reset",i=>{Promise.resolve().then(()=>{if(!i.defaultPrevented)for(const n of i.target.elements)n.__on_r?.()})},{capture:!0}))}function Ta(i){var n=pt,u=nt;$r(null),Ur(null);try{return i()}finally{$r(n),Ur(u)}}function Xh(i,n,u,l=u){i.addEventListener(n,()=>Ta(u));const d=i.__on_r;d?i.__on_r=()=>{d(),l(!0)}:i.__on_r=()=>l(!0),Hh()}function ev(i){nt===null&&pt===null&&Qk(),pt!==null&&(pt.f&Ar)!==0&&nt===null&&Fk(),oi&&qk()}function vx(i,n){var u=n.last;u===null?n.last=n.first=i:(u.next=i,i.prev=u,n.last=i)}function Vr(i,n,u,l=!0){var d=nt;d!==null&&(d.f&Fr)!==0&&(i|=Fr);var p={ctx:jt,deps:null,nodes_start:null,nodes_end:null,f:i|Nr,first:null,fn:n,last:null,next:null,parent:d,b:d&&d.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(u)try{xi(p),p.f|=ul}catch(g){throw nr(p),g}else n!==null&&ni(p);if(l){var m=p;if(u&&m.deps===null&&m.teardown===null&&m.nodes_start===null&&m.first===m.last&&(m.f&Hn)===0&&(m=m.first),m!==null&&(m.parent=d,d!==null&&vx(m,d),pt!==null&&(pt.f&Qt)!==0&&(i&xn)===0)){var h=pt;(h.effects??=[]).push(m)}}return p}function bx(){return pt!==null&&!Jr}function yl(i){const n=Vr(yi,null,!1);return pr(n,ur),n.teardown=i,n}function mo(i){ev();var n=nt.f,u=!pt&&(n&un)!==0&&(n&ul)===0;if(u){var l=jt;(l.e??=[]).push(i)}else return tv(i)}function tv(i){return Vr(Jn|Sh,i,!1)}function rv(i){return ev(),Vr(yi|Sh,i,!0)}function yx(i){Qr.ensure();const n=Vr(xn|Hn,i,!0);return()=>{nr(n)}}function $x(i){Qr.ensure();const n=Vr(xn|Hn,i,!0);return(u={})=>new Promise(l=>{u.outro?Tn(n,()=>{nr(n),l(void 0)}):(nr(n),l(void 0))})}function $l(i){return Vr(Jn,i,!1)}function he(i,n){var u=jt,l={effect:null,ran:!1,deps:i};u.l.$.push(l),l.effect=ii(()=>{i(),!l.ran&&(l.ran=!0,O(n))})}function fr(){var i=jt;ii(()=>{for(var n of i.l.$){n.deps();var u=n.effect;(u.f&ur)!==0&&pr(u,ln),ho(u)&&xi(u),n.ran=!1}})}function wx(i){return Vr(wa|Hn,i,!0)}function ii(i,n=0){return Vr(yi|n,i,!0)}function Te(i,n=[],u=[]){Lh(n,u,l=>{Vr(yi,()=>i(...l.map(c)),!0)})}function Nn(i,n=0){var u=Vr(Bn|n,i,!0);return u}function lr(i,n=!0){return Vr(un|Hn,i,!0,n)}function nv(i){var n=i.teardown;if(n!==null){const u=oi,l=pt;lv(!0),$r(null);try{n.call(null)}finally{lv(u),$r(l)}}}function iv(i,n=!1){var u=i.first;for(i.first=i.last=null;u!==null;){const d=u.ac;d!==null&&Ta(()=>{d.abort(uo)});var l=u.next;(u.f&xn)!==0?u.parent=null:nr(u,n),u=l}}function _x(i){for(var n=i.first;n!==null;){var u=n.next;(n.f&un)===0&&nr(n),n=u}}function nr(i,n=!0){var u=!1;(n||(i.f&Lk)!==0)&&i.nodes_start!==null&&i.nodes_end!==null&&(kx(i.nodes_start,i.nodes_end),u=!0),iv(i,n&&!u),Oa(i,0),pr(i,Yn);var l=i.transitions;if(l!==null)for(const p of l)p.stop();nv(i);var d=i.parent;d!==null&&d.first!==null&&ov(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes_start=i.nodes_end=i.ac=null}function kx(i,n){for(;i!==null;){var u=i===n?null:en(i);i.remove(),i=u}}function ov(i){var n=i.parent,u=i.prev,l=i.next;u!==null&&(u.next=l),l!==null&&(l.prev=u),n!==null&&(n.first===i&&(n.first=l),n.last===i&&(n.last=u))}function Tn(i,n){var u=[];wl(i,u,!0),av(u,()=>{nr(i),n&&n()})}function av(i,n){var u=i.length;if(u>0){var l=()=>--u||n();for(var d of i)d.out(l)}else n()}function wl(i,n,u){if((i.f&Fr)===0){if(i.f^=Fr,i.transitions!==null)for(const m of i.transitions)(m.is_global||u)&&n.push(m);for(var l=i.first;l!==null;){var d=l.next,p=(l.f&Kn)!==0||(l.f&un)!==0;wl(l,n,p?u:!1),l=d}}}function ja(i){sv(i,!0)}function sv(i,n){if((i.f&Fr)!==0){i.f^=Fr,(i.f&ur)===0&&(pr(i,Nr),ni(i));for(var u=i.first;u!==null;){var l=u.next,d=(u.f&Kn)!==0||(u.f&un)!==0;sv(u,d?n:!1),u=l}if(i.transitions!==null)for(const p of i.transitions)(p.is_global||n)&&p.in()}}let ki=!1;function uv(i){ki=i}let oi=!1;function lv(i){oi=i}let pt=null,Jr=!1;function $r(i){pt=i}let nt=null;function Ur(i){nt=i}let fn=null;function cv(i){pt!==null&&(fn===null?fn=[i]:fn.push(i))}let yr=null,Tr=0,Dr=null;function xx(i){Dr=i}let dv=1,go=0,ai=go;function fv(i){ai=i}let jn=!1;function pv(){return++dv}function ho(i){var n=i.f;if((n&Nr)!==0)return!0;if((n&ln)!==0){var u=i.deps,l=(n&Ar)!==0;if(u!==null){var d,p,m=(n&$a)!==0,h=l&&nt!==null&&!jn,g=u.length;if((m||h)&&(nt===null||(nt.f&Yn)===0)){var v=i,y=v.parent;for(d=0;d<g;d++)p=u[d],(m||!p?.reactions?.includes(v))&&(p.reactions??=[]).push(v);m&&(v.f^=$a),h&&y!==null&&(y.f&Ar)===0&&(v.f^=Ar)}for(d=0;d<g;d++)if(p=u[d],ho(p)&&Zh(p),p.wv>i.wv)return!0}(!l||nt!==null&&!jn)&&pr(i,ur)}return!1}function mv(i,n,u=!0){var l=i.reactions;if(l!==null&&!fn?.includes(i))for(var d=0;d<l.length;d++){var p=l[d];(p.f&Qt)!==0?mv(p,n,!1):n===p&&(u?pr(p,Nr):(p.f&ur)!==0&&pr(p,ln),ni(p))}}function gv(i){var n=yr,u=Tr,l=Dr,d=pt,p=jn,m=fn,h=jt,g=Jr,v=ai,y=i.f;yr=null,Tr=0,Dr=null,jn=(y&Ar)!==0&&(Jr||!ki||pt===null),pt=(y&(un|xn))===0?i:null,fn=null,$i(i.ctx),Jr=!1,ai=++go,i.ac!==null&&(Ta(()=>{i.ac.abort(uo)}),i.ac=null);try{i.f|=ll;var k=i.fn,b=k(),I=i.deps;if(yr!==null){var S;if(Oa(i,Tr),I!==null&&Tr>0)for(I.length=Tr+yr.length,S=0;S<yr.length;S++)I[Tr+S]=yr[S];else i.deps=I=yr;if(!jn||(y&Qt)!==0&&i.reactions!==null)for(S=Tr;S<I.length;S++)(I[S].reactions??=[]).push(i)}else I!==null&&Tr<I.length&&(Oa(i,Tr),I.length=Tr);if(lo()&&Dr!==null&&!Jr&&I!==null&&(i.f&(Qt|ln|Nr))===0)for(S=0;S<Dr.length;S++)mv(Dr[S],i);return d!==null&&d!==i&&(go++,Dr!==null&&(l===null?l=Dr:l.push(...Dr))),(i.f&Xn)!==0&&(i.f^=Xn),b}catch(T){return Eh(T)}finally{i.f^=ll,yr=n,Tr=u,Dr=l,pt=d,jn=p,fn=m,$i(h),Jr=g,ai=v}}function Sx(i,n){let u=n.reactions;if(u!==null){var l=al.call(u,i);if(l!==-1){var d=u.length-1;d===0?u=n.reactions=null:(u[l]=u[d],u.pop())}}u===null&&(n.f&Qt)!==0&&(yr===null||!yr.includes(n))&&(pr(n,ln),(n.f&(Ar|$a))===0&&(n.f^=$a),Rh(n),Oa(n,0))}function Oa(i,n){var u=i.deps;if(u!==null)for(var l=n;l<u.length;l++)Sx(i,u[l])}function xi(i){var n=i.f;if((n&Yn)===0){pr(i,ur);var u=nt,l=ki;nt=i,ki=!0;try{(n&Bn)!==0?_x(i):iv(i),nv(i);var d=gv(i);i.teardown=typeof d=="function"?d:null,i.wv=dv;var p;oo&&s&&(i.f&Nr)!==0&&i.deps}finally{ki=l,nt=u}}}async function Ix(){await Promise.resolve(),dt()}function c(i){var n=i.f,u=(n&Qt)!==0;if(pt!==null&&!Jr){var l=nt!==null&&(nt.f&Yn)!==0;if(!l&&!fn?.includes(i)){var d=pt.deps;if((pt.f&ll)!==0)i.rv<go&&(i.rv=go,yr===null&&d!==null&&d[Tr]===i?Tr++:yr===null?yr=[i]:(!jn||!yr.includes(i))&&yr.push(i));else{(pt.deps??=[]).push(i);var p=i.reactions;p===null?i.reactions=[pt]:p.includes(pt)||p.push(pt)}}}else if(u&&i.deps===null&&i.effects===null){var m=i,h=m.parent;h!==null&&(h.f&Ar)===0&&(m.f^=Ar)}if(oi){if(Sn.has(i))return Sn.get(i);if(u){m=i;var g=m.v;return((m.f&ur)===0&&m.reactions!==null||hv(m))&&(g=hl(m)),Sn.set(m,g),g}}else u&&(m=i,ho(m)&&Zh(m));if((i.f&Xn)!==0)throw i.v;return i.v}function hv(i){if(i.v===Jt)return!0;if(i.deps===null)return!1;for(const n of i.deps)if(Sn.has(n)||(n.f&Qt)!==0&&hv(n))return!0;return!1}function O(i){var n=Jr;try{return Jr=!0,i()}finally{Jr=n}}const zx=-7169;function pr(i,n){i.f=i.f&zx|n}function x(i){if(!(typeof i!="object"||!i||i instanceof EventTarget)){if(Hr in i)_l(i);else if(!Array.isArray(i))for(let n in i){const u=i[n];typeof u=="object"&&u&&Hr in u&&_l(u)}}}function _l(i,n=new Set){if(typeof i=="object"&&i!==null&&!(i instanceof EventTarget)&&!n.has(i)){n.add(i),i instanceof Date&&i.getTime();for(let l in i)try{_l(i[l],n)}catch{}const u=et(i);if(u!==Object.prototype&&u!==Array.prototype&&u!==Map.prototype&&u!==Set.prototype&&u!==Date.prototype){const l=ao(u);for(let d in l){const p=l[d].get;if(p)try{p.call(i)}catch{}}}}}const vv=new Set,kl=new Set;function bv(i,n,u,l={}){function d(p){if(l.capture||vo.call(n,p),!p.cancelBubble)return Ta(()=>u?.call(this,p))}return i.startsWith("pointer")||i.startsWith("touch")||i==="wheel"?dn(()=>{n.addEventListener(i,d,l)}):n.addEventListener(i,d,l),d}function yv(i,n,u,l={}){var d=bv(n,i,u,l);return()=>{i.removeEventListener(n,d,l)}}function xl(i){for(var n=0;n<i.length;n++)vv.add(i[n]);for(var u of kl)u(i)}let $v=null;function vo(i){var n=this,u=n.ownerDocument,l=i.type,d=i.composedPath?.()||[],p=d[0]||i.target;$v=i;var m=0,h=$v===i&&i.__root;if(h){var g=d.indexOf(h);if(g!==-1&&(n===document||n===window)){i.__root=n;return}var v=d.indexOf(n);if(v===-1)return;g<=v&&(m=g)}if(p=d[m]||i.target,p!==n){Kr(i,"currentTarget",{configurable:!0,get(){return p||u}});var y=pt,k=nt;$r(null),Ur(null);try{for(var b,I=[];p!==null;){var S=p.assignedSlot||p.parentNode||p.host||null;try{var T=p["__"+l];if(T!=null&&(!p.disabled||i.target===p))if(kn(T)){var[G,...te]=T;G.apply(p,[i,...te])}else T.call(p,i)}catch(ae){b?I.push(ae):b=ae}if(i.cancelBubble||S===n||S===null)break;p=S}if(b){for(let ae of I)queueMicrotask(()=>{throw ae});throw b}}finally{i.__root=n,delete i.currentTarget,$r(y),Ur(k)}}}function wv(i){var n=document.createElement("template");return n.innerHTML=i.replaceAll("<!>","<!---->"),n.content}function Br(i,n){var u=nt;u.nodes_start===null&&(u.nodes_start=i,u.nodes_end=n)}function ee(i,n){var u=(n&yt)!==0,l=(n&gt)!==0,d,p=!i.startsWith("<!>");return()=>{if(Ze)return Br(Xe,null),Xe;d===void 0&&(d=wv(p?i:"<!>"+i),u||(d=Gr(d)));var m=l||Vh?document.importNode(d,!0):d.cloneNode(!0);if(u){var h=Gr(m),g=m.lastChild;Br(h,g)}else Br(m,m);return m}}function Nx(i,n,u="svg"){var l=!i.startsWith("<!>"),d=`<${u}>${l?i:"<!>"+i}</${u}>`,p;return()=>{if(Ze)return Br(Xe,null),Xe;if(!p){var m=wv(d),h=Gr(m);p=Gr(h)}var g=p.cloneNode(!0);return Br(g,g),g}}function On(i,n){return Nx(i,n,"svg")}function pn(i=""){if(!Ze){var n=Mr(i+"");return Br(n,n),n}var u=Xe;return u.nodeType!==_a&&(u.before(u=Mr()),rr(u)),Br(u,u),u}function qe(){if(Ze)return Br(Xe,null),Xe;var i=document.createDocumentFragment(),n=document.createComment(""),u=Mr();return i.append(n,u),Br(n,u),i}function N(i,n){if(Ze){nt.nodes_end=Xe,cn();return}i!==null&&i.before(n)}function Ea(){if(Ze&&Xe&&Xe.nodeType===ei&&Xe.textContent?.startsWith("$")){const i=Xe.textContent.substring(1);return cn(),i}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function Tx(i){return i.endsWith("capture")&&i!=="gotpointercapture"&&i!=="lostpointercapture"}const jx=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Ox(i){return jx.includes(i)}const Ex={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Cx(i){return i=i.toLowerCase(),Ex[i]??i}const Ax=["touchstart","touchmove"];function Mx(i){return Ax.includes(i)}const Ux=["textarea","script","style","title"];function Dx(i){return Ux.includes(i)}function Oe(i,n){var u=n==null?"":typeof n=="object"?n+"":n;u!==(i.__t??=i.nodeValue)&&(i.__t=u,i.nodeValue=u+"")}function _v(i,n){return kv(i,n)}function Lx(i,n){vl(),n.intro=n.intro??!1;const u=n.target,l=Ze,d=Xe;try{for(var p=Gr(u);p&&(p.nodeType!==ei||p.data!==vt);)p=en(p);if(!p)throw Yr;br(!0),rr(p);const m=kv(i,{...n,anchor:p});return br(!1),m}catch(m){if(m instanceof Error&&m.message.split(`
45
45
  `).some(h=>h.startsWith("https://svelte.dev/e/")))throw m;return m!==Yr&&console.warn("Failed to hydrate: ",m),n.recover===!1&&Gk(),vl(),bl(u),br(!1),_v(i,n)}finally{br(l),rr(d)}}const Si=new Map;function kv(i,{target:n,anchor:u,props:l={},events:d,context:p,intro:m=!0}){vl();var h=new Set,g=k=>{for(var b=0;b<k.length;b++){var I=k[b];if(!h.has(I)){h.add(I);var S=Mx(I);n.addEventListener(I,vo,{passive:S});var T=Si.get(I);T===void 0?(document.addEventListener(I,vo,{passive:S}),Si.set(I,1)):Si.set(I,T+1)}}};g(Wn(vv)),kl.add(g);var v=void 0,y=$x(()=>{var k=u??n.appendChild(Mr());return ux(k,{pending:()=>{}},b=>{if(p){tt({});var I=jt;I.c=p}if(d&&(l.$$events=d),Ze&&Br(b,null),v=i(b,l)||{},Ze&&(nt.nodes_end=Xe,Xe===null||Xe.nodeType!==ei||Xe.data!==vr))throw ka(),Yr;p&&rt()}),()=>{for(var b of h){n.removeEventListener(b,vo);var I=Si.get(b);--I===0?(document.removeEventListener(b,vo),Si.delete(b)):Si.set(b,I)}kl.delete(g),k!==u&&k.parentNode?.removeChild(k)}});return Sl.set(v,y),v}let Sl=new WeakMap;function Px(i,n){const u=Sl.get(i);return u?(Sl.delete(i),u(n)):Promise.resolve()}function Wt(i,n,...u){var l=i,d=$t,p;Nn(()=>{d!==(d=n())&&(p&&(nr(p),p=null),p=lr(()=>d(l,...u)))},Kn),Ze&&(l=Xe)}function En(i){jt===null&&dl(),t&&jt.l!==null?Rx(jt).m.push(i):mo(()=>{const n=O(i);if(typeof n=="function")return n})}function bo(i){jt===null&&dl(),En(()=>()=>O(i))}function Rx(i){var n=i.l;return n.u??={a:[],b:[],m:[]}}function Zx(){return Symbol(ya)}function se(i,n,u=!1){Ze&&cn();var l=i,d=null,p=null,m=Jt,h=u?Kn:0,g=!1;const v=(b,I=!0)=>{g=!0,k(I,b)};function y(){var b=m?d:p,I=m?p:d;b&&ja(b),I&&Tn(I,()=>{m?p=null:d=null})}const k=(b,I)=>{if(m===(m=b))return;let S=!1;if(Ze){const te=Ih(l)===_t;!!m===te&&(l=xa(),rr(l),br(!1),S=!0)}var T=Yh(),G=l;m?d??=I&&lr(()=>I(G)):p??=I&&lr(()=>I(G)),T||y(),S&&br(!0)};Nn(()=>{g=!1,n(v),g||k(null,null)},h),Ze&&(l=Xe)}function Lr(i,n){return n}function qx(i,n,u){for(var l=i.items,d=[],p=n.length,m=0;m<p;m++)wl(n[m].e,d,!0);var h=p>0&&d.length===0&&u!==null;if(h){var g=u.parentNode;bl(g),g.append(u),l.clear(),tn(i,n[0].prev,n[p-1].next)}av(d,()=>{for(var v=0;v<p;v++){var y=n[v];h||(l.delete(y.k),tn(i,y.prev,y.next)),nr(y.e,!h)}})}function wr(i,n,u,l,d,p=null){var m=i,h={flags:n,items:new Map,first:null},g=(n&X)!==0;if(g){var v=i;m=Ze?rr(Gr(v)):v.appendChild(Mr())}Ze&&cn();var y=null,k=!1,b=new Map,I=Le(()=>{var te=u();return kn(te)?te:te==null?[]:Wn(te)}),S,T;function G(){Fx(T,S,h,b,m,d,n,l,u),p!==null&&(S.length===0?y?ja(y):y=lr(()=>p(m)):y!==null&&Tn(y,()=>{y=null}))}Nn(()=>{T??=nt,S=c(I);var te=S.length;if(k&&te===0)return;k=te===0;let ae=!1;if(Ze){var K=Ih(m)===_t;K!==(te===0)&&(m=xa(),rr(m),br(!1),ae=!0)}if(Ze){for(var V=null,E,A=0;A<te;A++){if(Xe.nodeType===ei&&Xe.data===vr){m=Xe,ae=!0,br(!1);break}var Y=S[A],ne=l(Y,A);E=xv(Xe,h,V,null,Y,ne,A,d,n,u),h.items.set(ne,E),V=E}te>0&&rr(xa())}Ze?te===0&&p&&(y=lr(()=>p(m))):G(),ae&&br(!0),c(I)}),Ze&&(m=Xe)}function Fx(i,n,u,l,d,p,m,h,g){var v=(m&ge)!==0,y=(m&(_|F))!==0,k=n.length,b=u.items,I=u.first,S=I,T,G=null,te,ae=[],K=[],V,E,A,Y;if(v)for(Y=0;Y<k;Y+=1)V=n[Y],E=h(V,Y),A=b.get(E),A!==void 0&&(A.a?.measure(),(te??=new Set).add(A));for(Y=0;Y<k;Y+=1){if(V=n[Y],E=h(V,Y),A=b.get(E),A===void 0){var ne=l.get(E);if(ne!==void 0){l.delete(E),b.set(E,ne);var _e=G?G.next:S;tn(u,G,ne),tn(u,ne,_e),Il(ne,_e,d),G=ne}else{var Ee=S?S.e.nodes_start:d;G=xv(Ee,u,G,G===null?u.first:G.next,V,E,Y,p,m,g)}b.set(E,G),ae=[],K=[],S=G.next;continue}if(y&&Qx(A,V,Y,m),(A.e.f&Fr)!==0&&(ja(A.e),v&&(A.a?.unfix(),(te??=new Set).delete(A))),A!==S){if(T!==void 0&&T.has(A)){if(ae.length<K.length){var Fe=K[0],ie;G=Fe.prev;var ke=ae[0],pe=ae[ae.length-1];for(ie=0;ie<ae.length;ie+=1)Il(ae[ie],Fe,d);for(ie=0;ie<K.length;ie+=1)T.delete(K[ie]);tn(u,ke.prev,pe.next),tn(u,G,ke),tn(u,pe,Fe),S=Fe,G=pe,Y-=1,ae=[],K=[]}else T.delete(A),Il(A,S,d),tn(u,A.prev,A.next),tn(u,A,G===null?u.first:G.next),tn(u,G,A),G=A;continue}for(ae=[],K=[];S!==null&&S.k!==E;)(S.e.f&Fr)===0&&(T??=new Set).add(S),K.push(S),S=S.next;if(S===null)continue;A=S}ae.push(A),G=A,S=A.next}if(S!==null||T!==void 0){for(var oe=T===void 0?[]:Wn(T);S!==null;)(S.e.f&Fr)===0&&oe.push(S),S=S.next;var ue=oe.length;if(ue>0){var J=(m&X)!==0&&k===0?d:null;if(v){for(Y=0;Y<ue;Y+=1)oe[Y].a?.measure();for(Y=0;Y<ue;Y+=1)oe[Y].a?.fix()}qx(u,oe,J)}}v&&dn(()=>{if(te!==void 0)for(A of te)A.a?.apply()}),i.first=u.first&&u.first.e,i.last=G&&G.e;for(var M of l.values())nr(M.e);l.clear()}function Qx(i,n,u,l){(l&_)!==0&&_i(i.v,n),(l&F)!==0?_i(i.i,u):i.i=u}function xv(i,n,u,l,d,p,m,h,g,v,y){var k=(g&_)!==0,b=(g&ce)===0,I=k?b?re(d,!1,!1):In(d):d,S=(g&F)===0?m:In(m),T={i:S,v:I,k:p,a:null,e:null,prev:u,next:l};try{if(i===null){var G=document.createDocumentFragment();G.append(i=Mr())}return T.e=lr(()=>h(i,I,S,v),Ze),T.e.prev=u&&u.e,T.e.next=l&&l.e,u===null?y||(n.first=T):(u.next=T,u.e.next=T.e),l!==null&&(l.prev=T,l.e.prev=T.e),T}finally{}}function Il(i,n,u){for(var l=i.next?i.next.e.nodes_start:u,d=n?n.e.nodes_start:u,p=i.e.nodes_start;p!==null&&p!==l;){var m=en(p);d.before(p),p=m}}function tn(i,n,u){n===null?i.first=u:(n.next=u,n.e.next=u&&u.e),u!==null&&(u.prev=n,u.e.prev=n&&n.e)}function Cn(i,n,u,l,d){Ze&&cn();var p=n.$$slots?.[u],m=!1;p===!0&&(p=n.children,m=!0),p===void 0||p(i,m?()=>l:l)}function Ca(i,n,u){Ze&&cn();var l=i,d,p,m=null,h=null;function g(){p&&(Tn(p),p=null),m&&(m.lastChild.remove(),l.before(m),m=null),p=h,h=null}Nn(()=>{if(d!==(d=n())){var v=Yh();if(d){var y=l;v&&(m=document.createDocumentFragment(),m.append(y=Mr()),p&&Lt.skipped_effects.add(p)),h=lr(()=>u(y,d))}v?Lt.add_callback(g):g()}},Kn),Ze&&(l=Xe)}function Sv(i,n,u,l,d,p){let m=Ze;Ze&&cn();var h,g,v=null;Ze&&Xe.nodeType===Rk&&(v=Xe,cn());var y=Ze?Xe:i,k;Nn(()=>{const b=n()||null;var I=ol;b!==h&&(k&&(b===null?Tn(k,()=>{k=null,g=null}):b===g?ja(k):nr(k)),b&&b!==g&&(k=lr(()=>{if(v=Ze?v:document.createElementNS(I,b),Br(v,v),l){Ze&&Dx(b)&&v.append(document.createComment(""));var S=Ze?Gr(v):v.appendChild(Mr());Ze&&(S===null?br(!1):rr(S)),l(v,S)}nt.nodes_end=v,y.before(v)})),h=b,h&&(g=h))},Kn),m&&(br(!0),rr(y))}function Wx(i,n){var u=void 0,l;Nn(()=>{u!==(u=n())&&(l&&(nr(l),l=null),u&&(l=lr(()=>{$l(()=>u(i))})))})}function Iv(i){var n,u,l="";if(typeof i=="string"||typeof i=="number")l+=i;else if(typeof i=="object")if(Array.isArray(i)){var d=i.length;for(n=0;n<d;n++)i[n]&&(u=Iv(i[n]))&&(l&&(l+=" "),l+=u)}else for(u in i)i[u]&&(l&&(l+=" "),l+=u);return l}function yo(){for(var i,n,u=0,l="",d=arguments.length;u<d;u++)(i=arguments[u])&&(n=Iv(i))&&(l&&(l+=" "),l+=n);return l}function Gx(i){return typeof i=="object"?yo(i):i??""}const zv=[...`
46
- \r\f \v\uFEFF`];function Vx(i,n,u){var l=i==null?"":""+i;if(u){for(var d in u)if(u[d])l=l?l+" "+d:d;else if(l.length)for(var p=d.length,m=0;(m=l.indexOf(d,m))>=0;){var h=m+p;(m===0||zv.includes(l[m-1]))&&(h===l.length||zv.includes(l[h]))?l=(m===0?"":l.substring(0,m))+l.substring(h+1):m=h}}return l===""?null:l}function Nv(i,n=!1){var u=n?" !important;":";",l="";for(var d in i){var p=i[d];p!=null&&p!==""&&(l+=" "+d+": "+p+u)}return l}function zl(i){return i[0]!=="-"||i[1]!=="-"?i.toLowerCase():i}function Jx(i,n){if(n){var u="",l,d;if(Array.isArray(n)?(l=n[0],d=n[1]):l=n,i){i=String(i).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var p=!1,m=0,h=!1,g=[];l&&g.push(...Object.keys(l).map(zl)),d&&g.push(...Object.keys(d).map(zl));var v=0,y=-1;const T=i.length;for(var k=0;k<T;k++){var b=i[k];if(h?b==="/"&&i[k-1]==="*"&&(h=!1):p?p===b&&(p=!1):b==="/"&&i[k+1]==="*"?h=!0:b==='"'||b==="'"?p=b:b==="("?m++:b===")"&&m--,!h&&p===!1&&m===0){if(b===":"&&y===-1)y=k;else if(b===";"||k===T-1){if(y!==-1){var I=zl(i.substring(v,y).trim());if(!g.includes(I)){b!==";"&&k++;var S=i.substring(v,k).trim();u+=" "+S+";"}}v=k+1,y=-1}}}}return l&&(u+=Nv(l)),d&&(u+=Nv(d,!0)),u=u.trim(),u===""?null:u}return i==null?null:String(i)}function mn(i,n,u,l,d,p){var m=i.__className;if(Ze||m!==u||m===void 0){var h=Vx(u,l,p);(!Ze||h!==i.getAttribute("class"))&&(h==null?i.removeAttribute("class"):n?i.className=h:i.setAttribute("class",h)),i.__className=u}else if(p&&d!==p)for(var g in p){var v=!!p[g];(d==null||v!==!!d[g])&&i.classList.toggle(g,v)}return p}function Nl(i,n={},u,l){for(var d in u){var p=u[d];n[d]!==p&&(u[d]==null?i.style.removeProperty(d):i.style.setProperty(d,p,l))}}function $o(i,n,u,l){var d=i.__style;if(Ze||d!==n){var p=Jx(n,l);(!Ze||p!==i.getAttribute("style"))&&(p==null?i.removeAttribute("style"):i.style.cssText=p),i.__style=n}else l&&(Array.isArray(l)?(Nl(i,u?.[0],l[0]),Nl(i,u?.[1],l[1],"important")):Nl(i,u,l));return l}function Tl(i,n,u=!1){if(i.multiple){if(n==null)return;if(!kn(n))return Hk();for(var l of i.options)l.selected=n.includes(Tv(l));return}for(l of i.options){var d=Tv(l);if(mx(d,n)){l.selected=!0;return}}(!u||n!==void 0)&&(i.selectedIndex=-1)}function Bx(i){var n=new MutationObserver(()=>{Tl(i,i.__value)});n.observe(i,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),yl(()=>{n.disconnect()})}function Tv(i){return"__value"in i?i.__value:i.value}const wo=Symbol("class"),_o=Symbol("style"),jv=Symbol("is custom element"),Ov=Symbol("is html");function Yx(i){if(Ze){var n=!1,u=()=>{if(!n){if(n=!0,i.hasAttribute("value")){var l=i.value;si(i,"value",null),i.value=l}if(i.hasAttribute("checked")){var d=i.checked;si(i,"checked",null),i.checked=d}}};i.__on_r=u,dn(u),Hh()}}function Kx(i,n){n?i.hasAttribute("selected")||i.setAttribute("selected",""):i.removeAttribute("selected")}function si(i,n,u,l){var d=Ev(i);Ze&&(d[n]=i.getAttribute(n),n==="src"||n==="srcset"||n==="href"&&i.nodeName==="LINK")||d[n]!==(d[n]=u)&&(n==="loading"&&(i[Pk]=u),u==null?i.removeAttribute(n):typeof u!="string"&&Av(i).includes(n)?i[n]=u:i.setAttribute(n,u))}function Hx(i,n,u,l,d=!1,p=!1){if(Ze&&d&&i.tagName==="INPUT"){var m=i,h=m.type==="checkbox"?"defaultChecked":"defaultValue";h in u||Yx(m)}var g=Ev(i),v=g[jv],y=!g[Ov];let k=Ze&&v;k&&br(!1);var b=n||{},I=i.tagName==="OPTION";for(var S in n)S in u||(u[S]=null);u.class?u.class=Gx(u.class):u[wo]&&(u.class=null),u[_o]&&(u.style??=null);var T=Av(i);for(const A in u){let Y=u[A];if(I&&A==="value"&&Y==null){i.value=i.__value="",b[A]=Y;continue}if(A==="class"){var G=i.namespaceURI==="http://www.w3.org/1999/xhtml";mn(i,G,Y,l,n?.[wo],u[wo]),b[A]=Y,b[wo]=u[wo];continue}if(A==="style"){$o(i,Y,n?.[_o],u[_o]),b[A]=Y,b[_o]=u[_o];continue}var te=b[A];if(!(Y===te&&!(Y===void 0&&i.hasAttribute(A)))){b[A]=Y;var ae=A[0]+A[1];if(ae!=="$$")if(ae==="on"){const ne={},_e="$$"+A;let Ee=A.slice(2);var K=Ox(Ee);if(Tx(Ee)&&(Ee=Ee.slice(0,-7),ne.capture=!0),!K&&te){if(Y!=null)continue;i.removeEventListener(Ee,b[_e],ne),b[_e]=null}if(Y!=null)if(K)i[`__${Ee}`]=Y,xl([Ee]);else{let Fe=function(ie){b[A].call(this,ie)};b[_e]=bv(Ee,i,Fe,ne)}else K&&(i[`__${Ee}`]=void 0)}else if(A==="style")si(i,A,Y);else if(A==="autofocus")gx(i,!!Y);else if(!v&&(A==="__value"||A==="value"&&Y!=null))i.value=i.__value=Y;else if(A==="selected"&&I)Kx(i,Y);else{var V=A;y||(V=Cx(V));var E=V==="defaultValue"||V==="defaultChecked";if(Y==null&&!v&&!E)if(g[A]=null,V==="value"||V==="checked"){let ne=i;const _e=n===void 0;if(V==="value"){let Ee=ne.defaultValue;ne.removeAttribute(V),ne.defaultValue=Ee,ne.value=ne.__value=_e?Ee:null}else{let Ee=ne.defaultChecked;ne.removeAttribute(V),ne.defaultChecked=Ee,ne.checked=_e?Ee:!1}}else i.removeAttribute(A);else E||T.includes(V)&&(v||typeof Y!="string")?(i[V]=Y,V in g&&(g[V]=Jt)):typeof Y!="function"&&si(i,V,Y)}}}return k&&br(!0),b}function Bt(i,n,u=[],l=[],d,p=!1,m=!1){Lh(u,l,h=>{var g=void 0,v={},y=i.nodeName==="SELECT",k=!1;if(Nn(()=>{var I=n(...h.map(c)),S=Hx(i,g,I,d,p,m);k&&y&&"value"in I&&Tl(i,I.value);for(let G of Object.getOwnPropertySymbols(v))I[G]||nr(v[G]);for(let G of Object.getOwnPropertySymbols(I)){var T=I[G];G.description===ya&&(!g||T!==g[G])&&(v[G]&&nr(v[G]),v[G]=lr(()=>Wx(i,()=>T))),S[G]=T}g=S}),y){var b=i;$l(()=>{Tl(b,g.value,!0),Bx(b)})}k=!0})}function Ev(i){return i.__attributes??={[jv]:i.nodeName.includes("-"),[Ov]:i.namespaceURI===ba}}var Cv=new Map;function Av(i){var n=i.getAttribute("is")||i.nodeName,u=Cv.get(n);if(u)return u;Cv.set(n,u=[]);for(var l,d=i,p=Element.prototype;p!==d;){l=ao(d);for(var m in l)l[m].set&&u.push(m);d=et(d)}return u}function Aa(i,n,u=n){var l=new WeakSet;Xh(i,"input",async d=>{var p=d?i.defaultValue:i.value;if(p=jl(i)?Ol(p):p,u(p),Lt!==null&&l.add(Lt),await Ix(),p!==(p=n())){var m=i.selectionStart,h=i.selectionEnd,g=i.value.length;if(i.value=p??"",h!==null){var v=i.value.length;m===h&&h===g&&v>g?(i.selectionStart=v,i.selectionEnd=v):(i.selectionStart=m,i.selectionEnd=Math.min(h,v))}}}),(Ze&&i.defaultValue!==i.value||O(n)==null&&i.value)&&(u(jl(i)?Ol(i.value):i.value),Lt!==null&&l.add(Lt)),ii(()=>{var d=n();if(i===document.activeElement){var p=za??Lt;if(l.has(p))return}jl(i)&&d===Ol(i.value)||i.type==="date"&&!d&&!i.value||d!==i.value&&(i.value=d??"")})}function jl(i){var n=i.type;return n==="number"||n==="range"}function Ol(i){return i===""?null:+i}function Xx(i,n,u=n){Xh(i,"change",()=>{u(i.files)}),Ze&&i.files&&u(i.files),ii(()=>{i.files=n()})}function Mv(i,n){return i===n||i?.[Hr]===n}function _r(i={},n,u,l){return $l(()=>{var d,p;return ii(()=>{d=p,p=[],O(()=>{i!==u(...p)&&(n(i,...p),d&&Mv(u(...d),i)&&n(null,...d))})}),()=>{dn(()=>{p&&Mv(u(...p),i)&&n(null,...p)})}}),i}function er(i=!1){const n=jt,u=n.l.u;if(!u)return;let l=()=>x(n.s);if(i){let d=0,p={};const m=fo(()=>{let h=!1;const g=n.s;for(const v in g)g[v]!==p[v]&&(p[v]=g[v],h=!0);return h&&d++,d});l=()=>c(m)}u.b.length&&rv(()=>{Uv(n,l),Vn(u.b)}),mo(()=>{const d=O(()=>u.m.map(Cr));return()=>{for(const p of d)typeof p=="function"&&p()}}),u.a.length&&mo(()=>{Uv(n,l),Vn(u.a)})}function Uv(i,n){if(i.l.s)for(const u of i.l.s)c(u);n()}function Dv(i,n,u){if(i==null)return n(void 0),$t;const l=O(()=>i.subscribe(n,u));return l.unsubscribe?()=>l.unsubscribe():l}const Ii=[];function e0(i,n=$t){let u=null;const l=new Set;function d(h){if(Nh(i,h)&&(i=h,u)){const g=!Ii.length;for(const v of l)v[1](),Ii.push(v,i);if(g){for(let v=0;v<Ii.length;v+=2)Ii[v][0](Ii[v+1]);Ii.length=0}}}function p(h){d(h(i))}function m(h,g=$t){const v=[h,g];return l.add(v),l.size===1&&(u=n(d,p)||$t),h(i),()=>{l.delete(v),l.size===0&&u&&(u(),u=null)}}return{set:d,update:p,subscribe:m}}function ko(i){let n;return Dv(i,u=>n=u)(),n}let Ma=!1,El=Symbol();function Lv(i,n,u){const l=u[n]??={store:null,source:re(void 0),unsubscribe:$t};if(l.store!==i&&!(El in u))if(l.unsubscribe(),l.store=i??null,i==null)l.source.v=void 0,l.unsubscribe=$t;else{var d=!0;l.unsubscribe=Dv(i,p=>{d?l.source.v=p:$(l.source,p)}),d=!1}return i&&El in u?ko(i):c(l.source)}function Pv(){const i={};function n(){yl(()=>{for(var u in i)i[u].unsubscribe();Kr(i,El,{enumerable:!1,value:!0})})}return[i,n]}function t0(i){var n=Ma;try{return Ma=!1,[i(),Ma]}finally{Ma=n}}const r0={get(i,n){if(!i.exclude.includes(n))return i.props[n]},set(i,n){return!1},getOwnPropertyDescriptor(i,n){if(!i.exclude.includes(n)&&n in i.props)return{enumerable:!0,configurable:!0,value:i.props[n]}},has(i,n){return i.exclude.includes(n)?!1:n in i.props},ownKeys(i){return Reflect.ownKeys(i.props).filter(n=>!i.exclude.includes(n))}};function qt(i,n,u){return new Proxy({props:i,exclude:n},r0)}const n0={get(i,n){if(!i.exclude.includes(n))return c(i.version),n in i.special?i.special[n]():i.props[n]},set(i,n,u){if(!(n in i.special)){var l=nt;try{Ur(i.parent_effect),i.special[n]=w({get[n](){return i.props[n]}},n,P)}finally{Ur(l)}}return i.special[n](u),Fh(i.version),!0},getOwnPropertyDescriptor(i,n){if(!i.exclude.includes(n)&&n in i.props)return{enumerable:!0,configurable:!0,value:i.props[n]}},deleteProperty(i,n){return i.exclude.includes(n)||(i.exclude.push(n),Fh(i.version)),!0},has(i,n){return i.exclude.includes(n)?!1:n in i.props},ownKeys(i){return Reflect.ownKeys(i.props).filter(n=>!i.exclude.includes(n))}};function gn(i,n){return new Proxy({props:i,exclude:n,special:{},version:In(0),parent_effect:nt},n0)}const i0={get(i,n){let u=i.props.length;for(;u--;){let l=i.props[u];if(Zt(l)&&(l=l()),typeof l=="object"&&l!==null&&n in l)return l[n]}},set(i,n,u){let l=i.props.length;for(;l--;){let d=i.props[l];Zt(d)&&(d=d());const p=Er(d,n);if(p&&p.set)return p.set(u),!0}return!1},getOwnPropertyDescriptor(i,n){let u=i.props.length;for(;u--;){let l=i.props[u];if(Zt(l)&&(l=l()),typeof l=="object"&&l!==null&&n in l){const d=Er(l,n);return d&&!d.configurable&&(d.configurable=!0),d}}},has(i,n){if(n===Hr||n===cl)return!1;for(let u of i.props)if(Zt(u)&&(u=u()),u!=null&&n in u)return!0;return!1},ownKeys(i){const n=[];for(let u of i.props)if(Zt(u)&&(u=u()),!!u){for(const l in u)n.includes(l)||n.push(l);for(const l of Object.getOwnPropertySymbols(u))n.includes(l)||n.push(l)}return n}};function Mt(...i){return new Proxy({props:i},i0)}function w(i,n,u,l){var d=!t||(u&be)!==0,p=(u&Se)!==0,m=(u&Pe)!==0,h=l,g=!0,v=()=>(g&&(g=!1,h=m?O(l):l),h),y;if(p){var k=Hr in i||cl in i;y=Er(i,n)?.set??(k&&n in i?K=>i[n]=K:void 0)}var b,I=!1;p?[b,I]=t0(()=>i[n]):b=i[n],b===void 0&&l!==void 0&&(b=v(),y&&(d&&Vk(),y(b)));var S;if(d?S=()=>{var K=i[n];return K===void 0?v():(g=!0,K)}:S=()=>{var K=i[n];return K!==void 0&&(h=void 0),K===void 0?h:K},d&&(u&P)===0)return S;if(y){var T=i.$$legacy;return(function(K,V){return arguments.length>0?((!d||!V||T||I)&&y(V?S():K),K):S()})}var G=!1,te=((u&Ce)!==0?fo:Le)(()=>(G=!1,S()));p&&c(te);var ae=nt;return(function(K,V){if(arguments.length>0){const E=V?c(te):d&&p?zn(K):K;return $(te,E),G=!0,h!==void 0&&(h=E),K}return oi&&G||(ae.f&Yn)!==0?te.v:c(te)})}function o0(i){return new a0(i)}class a0{#e;#t;constructor(n){var u=new Map,l=(p,m)=>{var h=re(m,!1,!1);return u.set(p,h),h};const d=new Proxy({...n.props||{},$$events:{}},{get(p,m){return c(u.get(m)??l(m,Reflect.get(p,m)))},has(p,m){return m===cl?!0:(c(u.get(m)??l(m,Reflect.get(p,m))),Reflect.has(p,m))},set(p,m,h){return $(u.get(m)??l(m,h),h),Reflect.set(p,m,h)}});this.#t=(n.hydrate?Lx:_v)(n.component,{target:n.target,anchor:n.anchor,props:d,context:n.context,intro:n.intro??!1,recover:n.recover}),(!n?.props?.$$host||n.sync===!1)&&dt(),this.#e=d.$$events;for(const p of Object.keys(this.#t))p==="$set"||p==="$destroy"||p==="$on"||Kr(this,p,{get(){return this.#t[p]},set(m){this.#t[p]=m},enumerable:!0});this.#t.$set=p=>{Object.assign(d,p)},this.#t.$destroy=()=>{Px(this.#t)}}$set(n){this.#t.$set(n)}$on(n,u){this.#e[n]=this.#e[n]||[];const l=(...d)=>u.call(this,...d);return this.#e[n].push(l),()=>{this.#e[n]=this.#e[n].filter(d=>d!==l)}}$destroy(){this.#t.$destroy()}}let Rv;typeof HTMLElement=="function"&&(Rv=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(i,n,u){super(),this.$$ctor=i,this.$$s=n,u&&this.attachShadow({mode:"open"})}addEventListener(i,n,u){if(this.$$l[i]=this.$$l[i]||[],this.$$l[i].push(n),this.$$c){const l=this.$$c.$on(i,n);this.$$l_u.set(n,l)}super.addEventListener(i,n,u)}removeEventListener(i,n,u){if(super.removeEventListener(i,n,u),this.$$c){const l=this.$$l_u.get(n);l&&(l(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(l){return d=>{const p=document.createElement("slot");l!=="default"&&(p.name=l),N(d,p)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},u=s0(this);for(const l of this.$$s)l in u&&(l==="default"&&!this.$$d.children?(this.$$d.children=i(l),n.default=!0):n[l]=i(l));for(const l of this.attributes){const d=this.$$g_p(l.name);d in this.$$d||(this.$$d[d]=Ua(d,l.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=o0({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=yx(()=>{ii(()=>{this.$$r=!0;for(const l of Gn(this.$$c)){if(!this.$$p_d[l]?.reflect)continue;this.$$d[l]=this.$$c[l];const d=Ua(l,this.$$d[l],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,d)}this.$$r=!1})});for(const l in this.$$l)for(const d of this.$$l[l]){const p=this.$$c.$on(l,d);this.$$l_u.set(d,p)}this.$$l={}}}attributeChangedCallback(i,n,u){this.$$r||(i=this.$$g_p(i),this.$$d[i]=Ua(i,u,this.$$p_d,"toProp"),this.$$c?.$set({[i]:this.$$d[i]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(i){return Gn(this.$$p_d).find(n=>this.$$p_d[n].attribute===i||!this.$$p_d[n].attribute&&n.toLowerCase()===i)||i}});function Ua(i,n,u,l){const d=u[i]?.type;if(n=d==="Boolean"&&typeof n!="boolean"?n!=null:n,!l||!u[i])return n;if(l==="toAttribute")switch(d){case"Object":case"Array":return n==null?null:JSON.stringify(n);case"Boolean":return n?"":null;case"Number":return n??null;default:return n}else switch(d){case"Object":case"Array":return n&&JSON.parse(n);case"Boolean":return n;case"Number":return n!=null?+n:n;default:return n}}function s0(i){const n={};return i.childNodes.forEach(u=>{n[u.slot||"default"]=!0}),n}function Zv(i,n,u,l,d,p){let m=class extends Rv{constructor(){super(i,u,d),this.$$p_d=n}static get observedAttributes(){return Gn(n).map(h=>(n[h].attribute||h).toLowerCase())}};return Gn(n).forEach(h=>{Kr(m.prototype,h,{get(){return this.$$c&&h in this.$$c?this.$$c[h]:this.$$d[h]},set(g){g=Ua(h,g,n),this.$$d[h]=g;var v=this.$$c;if(v){var y=Er(v,h)?.get;y?v[h]=g:v.$set({[h]:g})}}})}),l.forEach(h=>{Kr(m.prototype,h,{get(){return this.$$c?.[h]}})}),i.element=m,m}const u0={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};var l0=On("<svg><!><!></svg>");function ui(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=gn(u,["type","name","color","size","stroke","iconNode"]);tt(n,!1);let d=w(n,"type",8),p=w(n,"name",8),m=w(n,"color",8,"currentColor"),h=w(n,"size",8,24),g=w(n,"stroke",8,2),v=w(n,"iconNode",8);er();var y=l0();Bt(y,()=>({...u0[d()],...l,width:h(),height:h(),class:(x(p()),x(u),O(()=>`tabler-icon tabler-icon-${p()} ${u.class??""}`)),...d()==="filled"?{fill:m()}:{"stroke-width":g(),stroke:m()}}));var k=Z(y);wr(k,1,v,Lr,(I,S)=>{var T=ht(()=>Xt(c(S),2));let G=()=>c(T)[0],te=()=>c(T)[1];var ae=qe(),K=je(ae);Sv(K,G,!0,(V,E)=>{Bt(V,()=>({...te()}))}),N(I,ae)});var b=de(k);Cn(b,n,"default",{}),D(y),N(i,y),rt()}function qv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M9 14l-4 -4l4 -4"}],["path",{d:"M5 10h11a4 4 0 1 1 0 8h-1"}]];ui(i,Mt({type:"outline",name:"arrow-back-up"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Fv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M15 6l-6 6l6 6"}]];ui(i,Mt({type:"outline",name:"chevron-left"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Da(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M9 6l6 6l-6 6"}]];ui(i,Mt({type:"outline",name:"chevron-right"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function c0(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M5 12l-2 0l9 -9l9 9l-2 0"}],["path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"}],["path",{d:"M10 12h4v4h-4z"}]];ui(i,Mt({type:"outline",name:"home-2"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Qv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M15 8h.01"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"}]];ui(i,Mt({type:"outline",name:"photo"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Wv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}],["path",{d:"M15 6l3 3"}],["path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}],["path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}]];ui(i,Mt({type:"outline",name:"wand"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Gv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M18 6l-12 12"}],["path",{d:"M6 6l12 12"}]];ui(i,Mt({type:"outline",name:"x"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}const d0={questions:[],questionsData:{}},Vv=Symbol("formResponses"),f0=()=>{const i=e0(d0),n=(h,g,v,y)=>{if((g==null||g===""||Array.isArray(g)&&g.length===0)&&!y){p(h);return}let k;switch(v){case"rating":k={rating:g};break;case"nps":k={nps:g};break;case"long_text":k={longText:g};break;case"short_answer":k={shortAnswer:g};break;case"single_choice":k={singleChoice:g};break;case"multiple_choice_multiple":k={multipleChoiceMultiple:Array.isArray(g)?g:[g]};break;case"nested_selection":k={nestedSelection:Array.isArray(g)?g:[g]};break;case"annotation":k={annotation:g};break;default:k=g}i.update(b=>{const I=b.questions.findIndex(S=>S.questionId===h);return I!==-1?{...b,questions:b.questions.map((S,T)=>T===I?{...S,answer:k,type:v,error:y}:S)}:{...b,questions:[...b.questions,{questionId:h,answer:k,type:v,error:y}]}})},u=(h,g)=>{m(h)&&i.update(v=>({...v,questions:v.questions.map(y=>y.questionId===h?{...y,error:g}:y)}))},l=()=>{i.update(h=>({...h,questions:h.questions.map(g=>({...g,error:void 0}))}))},d=()=>ko(i).questions.some(h=>h.error!==void 0&&h.error!==null&&h.error!==""),p=h=>{i.update(g=>({...g,questions:g.questions.filter(v=>v.questionId!==h)}))},m=h=>ko(i).questions.find(g=>g.questionId===h);return{formResponses:i,updateQuestionResponse:n,getQuestionResponse:m,removeQuestionResponse:p,setQuestionError:u,hasValidationErrors:d,clearValidationErrors:l,clearResponses:()=>{i.update(h=>({...h,questions:[]}))},bulkUpdateResponses:h=>{i.update(g=>({...g,questions:h}))},storeQuestions:h=>{console.log("🔴 [formResponses] Storing questions:",h),Object.entries(h).forEach(([g,v])=>{v.type==="single_choice"&&console.log(`🔴 [formResponses] Storing single_choice question ${g}:`,{id:v.id,type:v.type,title:v.title,hasOptions:"options"in v,options:v.options,optionsType:typeof v.options,isArray:Array.isArray(v.options),optionsLength:Array.isArray(v.options)?v.options.length:"N/A",fullQuestion:v})}),i.update(g=>({...g,questionsData:h}))},getQuestionData:h=>{const g=ko(i).questionsData[h];return g&&g.type==="single_choice"&&console.log(`🔴 [formResponses] Getting single_choice question ${h}:`,{id:g.id,type:g.type,title:g.title,hasOptions:"options"in g,options:g.options,optionsType:typeof g.options,isArray:Array.isArray(g.options),optionsLength:Array.isArray(g.options)?g.options.length:"N/A",fullQuestion:g}),g}}},Jv=()=>{const i=f0();return jh(Vv,i),i},hn=()=>fl(Vv),Cl="-",p0=i=>{const n=g0(i),{conflictingClassGroups:u,conflictingClassGroupModifiers:l}=i;return{getClassGroupId:d=>{const p=d.split(Cl);return p[0]===""&&p.length!==1&&p.shift(),Bv(p,n)||m0(d)},getConflictingClassGroupIds:(d,p)=>{const m=u[d]||[];return p&&l[d]?[...m,...l[d]]:m}}},Bv=(i,n)=>{if(i.length===0)return n.classGroupId;const u=i[0],l=n.nextPart.get(u),d=l?Bv(i.slice(1),l):void 0;if(d)return d;if(n.validators.length===0)return;const p=i.join(Cl);return n.validators.find(({validator:m})=>m(p))?.classGroupId},Yv=/^\[(.+)\]$/,m0=i=>{if(Yv.test(i)){const n=Yv.exec(i)[1],u=n?.substring(0,n.indexOf(":"));if(u)return"arbitrary.."+u}},g0=i=>{const{theme:n,classGroups:u}=i,l={nextPart:new Map,validators:[]};for(const d in u)Al(u[d],l,d,n);return l},Al=(i,n,u,l)=>{i.forEach(d=>{if(typeof d=="string"){const p=d===""?n:Kv(n,d);p.classGroupId=u;return}if(typeof d=="function"){if(h0(d)){Al(d(l),n,u,l);return}n.validators.push({validator:d,classGroupId:u});return}Object.entries(d).forEach(([p,m])=>{Al(m,Kv(n,p),u,l)})})},Kv=(i,n)=>{let u=i;return n.split(Cl).forEach(l=>{u.nextPart.has(l)||u.nextPart.set(l,{nextPart:new Map,validators:[]}),u=u.nextPart.get(l)}),u},h0=i=>i.isThemeGetter,v0=i=>{if(i<1)return{get:()=>{},set:()=>{}};let n=0,u=new Map,l=new Map;const d=(p,m)=>{u.set(p,m),n++,n>i&&(n=0,l=u,u=new Map)};return{get(p){let m=u.get(p);if(m!==void 0)return m;if((m=l.get(p))!==void 0)return d(p,m),m},set(p,m){u.has(p)?u.set(p,m):d(p,m)}}},Ml="!",Ul=":",b0=Ul.length,y0=i=>{const{prefix:n,experimentalParseClassName:u}=i;let l=d=>{const p=[];let m=0,h=0,g=0,v;for(let S=0;S<d.length;S++){let T=d[S];if(m===0&&h===0){if(T===Ul){p.push(d.slice(g,S)),g=S+b0;continue}if(T==="/"){v=S;continue}}T==="["?m++:T==="]"?m--:T==="("?h++:T===")"&&h--}const y=p.length===0?d:d.substring(g),k=$0(y),b=k!==y,I=v&&v>g?v-g:void 0;return{modifiers:p,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:I}};if(n){const d=n+Ul,p=l;l=m=>m.startsWith(d)?p(m.substring(d.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(u){const d=l;l=p=>u({className:p,parseClassName:d})}return l},$0=i=>i.endsWith(Ml)?i.substring(0,i.length-1):i.startsWith(Ml)?i.substring(1):i,w0=i=>{const n=Object.fromEntries(i.orderSensitiveModifiers.map(u=>[u,!0]));return u=>{if(u.length<=1)return u;const l=[];let d=[];return u.forEach(p=>{p[0]==="["||n[p]?(l.push(...d.sort(),p),d=[]):d.push(p)}),l.push(...d.sort()),l}},_0=i=>({cache:v0(i.cacheSize),parseClassName:y0(i),sortModifiers:w0(i),...p0(i)}),k0=/\s+/,x0=(i,n)=>{const{parseClassName:u,getClassGroupId:l,getConflictingClassGroupIds:d,sortModifiers:p}=n,m=[],h=i.trim().split(k0);let g="";for(let v=h.length-1;v>=0;v-=1){const y=h[v],{isExternal:k,modifiers:b,hasImportantModifier:I,baseClassName:S,maybePostfixModifierPosition:T}=u(y);if(k){g=y+(g.length>0?" "+g:g);continue}let G=!!T,te=l(G?S.substring(0,T):S);if(!te){if(!G){g=y+(g.length>0?" "+g:g);continue}if(te=l(S),!te){g=y+(g.length>0?" "+g:g);continue}G=!1}const ae=p(b).join(":"),K=I?ae+Ml:ae,V=K+te;if(m.includes(V))continue;m.push(V);const E=d(te,G);for(let A=0;A<E.length;++A){const Y=E[A];m.push(K+Y)}g=y+(g.length>0?" "+g:g)}return g};function S0(){let i=0,n,u,l="";for(;i<arguments.length;)(n=arguments[i++])&&(u=Hv(n))&&(l&&(l+=" "),l+=u);return l}const Hv=i=>{if(typeof i=="string")return i;let n,u="";for(let l=0;l<i.length;l++)i[l]&&(n=Hv(i[l]))&&(u&&(u+=" "),u+=n);return u};function Dl(i,...n){let u,l,d,p=m;function m(g){const v=n.reduce((y,k)=>k(y),i());return u=_0(v),l=u.cache.get,d=u.cache.set,p=h,h(g)}function h(g){const v=l(g);if(v)return v;const y=x0(g,u);return d(g,y),y}return function(){return p(S0.apply(null,arguments))}}const tr=i=>{const n=u=>u[i]||[];return n.isThemeGetter=!0,n},Xv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,I0=/^\d+\/\d+$/,z0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,j0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zi=i=>I0.test(i),st=i=>!!i&&!Number.isNaN(Number(i)),An=i=>!!i&&Number.isInteger(Number(i)),Ll=i=>i.endsWith("%")&&st(i.slice(0,-1)),vn=i=>z0.test(i),E0=()=>!0,C0=i=>N0.test(i)&&!T0.test(i),tb=()=>!1,A0=i=>j0.test(i),M0=i=>O0.test(i),U0=i=>!Ae(i)&&!Me(i),D0=i=>Ni(i,ab,tb),Ae=i=>Xv.test(i),li=i=>Ni(i,sb,C0),Pl=i=>Ni(i,q0,st),rb=i=>Ni(i,ib,tb),L0=i=>Ni(i,ob,M0),La=i=>Ni(i,ub,A0),Me=i=>eb.test(i),xo=i=>Ti(i,sb),P0=i=>Ti(i,F0),nb=i=>Ti(i,ib),R0=i=>Ti(i,ab),Z0=i=>Ti(i,ob),Pa=i=>Ti(i,ub,!0),Ni=(i,n,u)=>{const l=Xv.exec(i);return l?l[1]?n(l[1]):u(l[2]):!1},Ti=(i,n,u=!1)=>{const l=eb.exec(i);return l?l[1]?n(l[1]):u:!1},ib=i=>i==="position"||i==="percentage",ob=i=>i==="image"||i==="url",ab=i=>i==="length"||i==="size"||i==="bg-size",sb=i=>i==="length",q0=i=>i==="number",F0=i=>i==="family-name",ub=i=>i==="shadow",Rl=()=>{const i=tr("color"),n=tr("font"),u=tr("text"),l=tr("font-weight"),d=tr("tracking"),p=tr("leading"),m=tr("breakpoint"),h=tr("container"),g=tr("spacing"),v=tr("radius"),y=tr("shadow"),k=tr("inset-shadow"),b=tr("text-shadow"),I=tr("drop-shadow"),S=tr("blur"),T=tr("perspective"),G=tr("aspect"),te=tr("ease"),ae=tr("animate"),K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...V(),Me,Ae],A=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto","contain","none"],ne=()=>[Me,Ae,g],_e=()=>[zi,"full","auto",...ne()],Ee=()=>[An,"none","subgrid",Me,Ae],Fe=()=>["auto",{span:["full",An,Me,Ae]},An,Me,Ae],ie=()=>[An,"auto",Me,Ae],ke=()=>["auto","min","max","fr",Me,Ae],pe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],oe=()=>["start","end","center","stretch","center-safe","end-safe"],ue=()=>["auto",...ne()],J=()=>[zi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ne()],M=()=>[i,Me,Ae],R=()=>[...V(),nb,rb,{position:[Me,Ae]}],C=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",R0,D0,{size:[Me,Ae]}],W=()=>[Ll,xo,li],Q=()=>["","none","full",v,Me,Ae],xe=()=>["",st,xo,li],Ne=()=>["solid","dashed","dotted","double"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[st,Ll,nb,rb],me=()=>["","none",S,Me,Ae],we=()=>["none",st,Me,Ae],De=()=>["none",st,Me,Ae],Ge=()=>[st,Me,Ae],Ke=()=>[zi,"full",...ne()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vn],breakpoint:[vn],color:[E0],container:[vn],"drop-shadow":[vn],ease:["in","out","in-out"],font:[U0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vn],shadow:[vn],spacing:["px",st],text:[vn],"text-shadow":[vn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zi,Ae,Me,G]}],container:["container"],columns:[{columns:[st,Ae,Me,h]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_e()}],"inset-x":[{"inset-x":_e()}],"inset-y":[{"inset-y":_e()}],start:[{start:_e()}],end:[{end:_e()}],top:[{top:_e()}],right:[{right:_e()}],bottom:[{bottom:_e()}],left:[{left:_e()}],visibility:["visible","invisible","collapse"],z:[{z:[An,"auto",Me,Ae]}],basis:[{basis:[zi,"full","auto",h,...ne()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,zi,"auto","initial","none",Ae]}],grow:[{grow:["",st,Me,Ae]}],shrink:[{shrink:["",st,Me,Ae]}],order:[{order:[An,"first","last","none",Me,Ae]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:Fe()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:Fe()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ke()}],"auto-rows":[{"auto-rows":ke()}],gap:[{gap:ne()}],"gap-x":[{"gap-x":ne()}],"gap-y":[{"gap-y":ne()}],"justify-content":[{justify:[...pe(),"normal"]}],"justify-items":[{"justify-items":[...oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...oe()]}],"align-content":[{content:["normal",...pe()]}],"align-items":[{items:[...oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":pe()}],"place-items":[{"place-items":[...oe(),"baseline"]}],"place-self":[{"place-self":["auto",...oe()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:ue()}],mx:[{mx:ue()}],my:[{my:ue()}],ms:[{ms:ue()}],me:[{me:ue()}],mt:[{mt:ue()}],mr:[{mr:ue()}],mb:[{mb:ue()}],ml:[{ml:ue()}],"space-x":[{"space-x":ne()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ne()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[h,"screen",...J()]}],"min-w":[{"min-w":[h,"screen","none",...J()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[m]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",u,xo,li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,Me,Pl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ll,Ae]}],"font-family":[{font:[P0,Ae,n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,Me,Ae]}],"line-clamp":[{"line-clamp":[st,"none",Me,Pl]}],leading:[{leading:[p,...ne()]}],"list-image":[{"list-image":["none",Me,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[st,"from-font","auto",Me,li]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[st,"auto",Me,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ne()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:C()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},An,Me,Ae],radial:["",Me,Ae],conic:[An,Me,Ae]},Z0,L0]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:xe()}],"border-w-x":[{"border-x":xe()}],"border-w-y":[{"border-y":xe()}],"border-w-s":[{"border-s":xe()}],"border-w-e":[{"border-e":xe()}],"border-w-t":[{"border-t":xe()}],"border-w-r":[{"border-r":xe()}],"border-w-b":[{"border-b":xe()}],"border-w-l":[{"border-l":xe()}],"divide-x":[{"divide-x":xe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":xe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[st,Me,Ae]}],"outline-w":[{outline:["",st,xo,li]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",y,Pa,La]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",k,Pa,La]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[st,li]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":xe()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",b,Pa,La]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[st,Me,Ae]}],"mix-blend":[{"mix-blend":[...B(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":B()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[st]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Me,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":V()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:C()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Ae]}],filter:[{filter:["","none",Me,Ae]}],blur:[{blur:me()}],brightness:[{brightness:[st,Me,Ae]}],contrast:[{contrast:[st,Me,Ae]}],"drop-shadow":[{"drop-shadow":["","none",I,Pa,La]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",st,Me,Ae]}],"hue-rotate":[{"hue-rotate":[st,Me,Ae]}],invert:[{invert:["",st,Me,Ae]}],saturate:[{saturate:[st,Me,Ae]}],sepia:[{sepia:["",st,Me,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Ae]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[st,Me,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[st,Me,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,Me,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,Me,Ae]}],"backdrop-invert":[{"backdrop-invert":["",st,Me,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[st,Me,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[st,Me,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",st,Me,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ne()}],"border-spacing-x":[{"border-spacing-x":ne()}],"border-spacing-y":[{"border-spacing-y":ne()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",Me,Ae]}],ease:[{ease:["linear","initial",te,Me,Ae]}],delay:[{delay:[st,Me,Ae]}],animate:[{animate:["none",ae,Me,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,Me,Ae]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:Ge()}],"skew-x":[{"skew-x":Ge()}],"skew-y":[{"skew-y":Ge()}],transform:[{transform:[Me,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ke()}],"translate-x":[{"translate-x":Ke()}],"translate-y":[{"translate-y":Ke()}],"translate-z":[{"translate-z":Ke()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ne()}],"scroll-mx":[{"scroll-mx":ne()}],"scroll-my":[{"scroll-my":ne()}],"scroll-ms":[{"scroll-ms":ne()}],"scroll-me":[{"scroll-me":ne()}],"scroll-mt":[{"scroll-mt":ne()}],"scroll-mr":[{"scroll-mr":ne()}],"scroll-mb":[{"scroll-mb":ne()}],"scroll-ml":[{"scroll-ml":ne()}],"scroll-p":[{"scroll-p":ne()}],"scroll-px":[{"scroll-px":ne()}],"scroll-py":[{"scroll-py":ne()}],"scroll-ps":[{"scroll-ps":ne()}],"scroll-pe":[{"scroll-pe":ne()}],"scroll-pt":[{"scroll-pt":ne()}],"scroll-pr":[{"scroll-pr":ne()}],"scroll-pb":[{"scroll-pb":ne()}],"scroll-pl":[{"scroll-pl":ne()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Me,Ae]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[st,xo,li,Pl]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Q0=(i,{cacheSize:n,prefix:u,experimentalParseClassName:l,extend:d={},override:p={}})=>(So(i,"cacheSize",n),So(i,"prefix",u),So(i,"experimentalParseClassName",l),Ra(i.theme,p.theme),Ra(i.classGroups,p.classGroups),Ra(i.conflictingClassGroups,p.conflictingClassGroups),Ra(i.conflictingClassGroupModifiers,p.conflictingClassGroupModifiers),So(i,"orderSensitiveModifiers",p.orderSensitiveModifiers),Za(i.theme,d.theme),Za(i.classGroups,d.classGroups),Za(i.conflictingClassGroups,d.conflictingClassGroups),Za(i.conflictingClassGroupModifiers,d.conflictingClassGroupModifiers),lb(i,d,"orderSensitiveModifiers"),i),So=(i,n,u)=>{u!==void 0&&(i[n]=u)},Ra=(i,n)=>{if(n)for(const u in n)So(i,u,n[u])},Za=(i,n)=>{if(n)for(const u in n)lb(i,n,u)},lb=(i,n,u)=>{const l=n[u];l!==void 0&&(i[u]=i[u]?i[u].concat(l):l)},W0=(i,...n)=>typeof i=="function"?Dl(Rl,i,...n):Dl(()=>Q0(Rl(),i),...n),cb=Dl(Rl);function jr(...i){return cb(yo(i))}var G0=/\s+/g,Zl=i=>typeof i!="string"||!i?i:i.replace(G0," ").trim(),qa=(...i)=>{let n=[],u=l=>{if(!l&&l!==0&&l!==0n)return;if(Array.isArray(l)){for(let p=0,m=l.length;p<m;p++)u(l[p]);return}let d=typeof l;if(d==="string"||d==="number"||d==="bigint"){if(d==="number"&&l!==l)return;n.push(String(l))}else if(d==="object"){let p=Object.keys(l);for(let m=0,h=p.length;m<h;m++){let g=p[m];l[g]&&n.push(g)}}};for(let l=0,d=i.length;l<d;l++){let p=i[l];p!=null&&u(p)}return n.length>0?Zl(n.join(" ")):void 0},db=i=>i===!1?"false":i===!0?"true":i===0?"0":i,kr=i=>{if(!i||typeof i!="object")return!0;for(let n in i)return!1;return!0},V0=(i,n)=>{if(i===n)return!0;if(!i||!n)return!1;let u=Object.keys(i),l=Object.keys(n);if(u.length!==l.length)return!1;for(let d=0;d<u.length;d++){let p=u[d];if(!l.includes(p)||i[p]!==n[p])return!1}return!0},fb=(i,n)=>{for(let u in n)if(Object.prototype.hasOwnProperty.call(n,u)){let l=n[u];u in i?i[u]=qa(i[u],l):i[u]=l}return i},pb=(i,n)=>{for(let u=0;u<i.length;u++){let l=i[u];Array.isArray(l)?pb(l,n):l&&n.push(l)}},mb=(...i)=>{let n=[];pb(i,n);let u=[];for(let l=0;l<n.length;l++)n[l]&&u.push(n[l]);return u},ql=(i,n)=>{let u={};for(let l in i){let d=i[l];if(l in n){let p=n[l];Array.isArray(d)||Array.isArray(p)?u[l]=mb(p,d):typeof d=="object"&&typeof p=="object"&&d&&p?u[l]=ql(d,p):u[l]=p+" "+d}else u[l]=d}for(let l in n)l in i||(u[l]=n[l]);return u},J0={twMerge:!0,twMergeConfig:{},responsiveVariants:!1};function B0(){let i=null,n={},u=!1;return{get cachedTwMerge(){return i},set cachedTwMerge(l){i=l},get cachedTwMergeConfig(){return n},set cachedTwMergeConfig(l){n=l},get didTwMergeConfigChange(){return u},set didTwMergeConfigChange(l){u=l},reset(){i=null,n={},u=!1}}}var bn=B0(),Y0=i=>{let n=(u,l)=>{let{extend:d=null,slots:p={},variants:m={},compoundVariants:h=[],compoundSlots:g=[],defaultVariants:v={}}=u,y={...J0,...l},k=d?.base?qa(d.base,u?.base):u?.base,b=d?.variants&&!kr(d.variants)?ql(m,d.variants):m,I=d?.defaultVariants&&!kr(d.defaultVariants)?{...d.defaultVariants,...v}:v;!kr(y.twMergeConfig)&&!V0(y.twMergeConfig,bn.cachedTwMergeConfig)&&(bn.didTwMergeConfigChange=!0,bn.cachedTwMergeConfig=y.twMergeConfig);let S=kr(d?.slots),T=kr(p)?{}:{base:qa(u?.base,S&&d?.base),...p},G=S?T:fb({...d?.slots},kr(T)?{base:u?.base}:T),te=kr(d?.compoundVariants)?h:mb(d?.compoundVariants,h),ae=V=>{if(kr(b)&&kr(p)&&S)return i(k,V?.class,V?.className)(y);if(te&&!Array.isArray(te))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof te}`);if(g&&!Array.isArray(g))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof g}`);let E=(pe,oe,ue=[],J)=>{let M=ue;if(typeof oe=="string"){let R=Zl(oe).split(" ");for(let C=0;C<R.length;C++)M.push(`${pe}:${R[C]}`)}else if(Array.isArray(oe))for(let R=0;R<oe.length;R++)M.push(`${pe}:${oe[R]}`);else if(typeof oe=="object"&&typeof J=="string"&&J in oe){let R=oe[J];if(R&&typeof R=="string"){let C=Zl(R).split(" "),z=[];for(let W=0;W<C.length;W++)z.push(`${pe}:${C[W]}`);M[J]=M[J]?M[J].concat(z):z}else if(Array.isArray(R)&&R.length>0){let C=[];for(let z=0;z<R.length;z++)C.push(`${pe}:${R[z]}`);M[J]=C}}return M},A=(pe,oe=b,ue=null,J=null)=>{let M=oe[pe];if(!M||kr(M))return null;let R=J?.[pe]??V?.[pe];if(R===null)return null;let C=db(R),z=Array.isArray(y.responsiveVariants)&&y.responsiveVariants.length>0||y.responsiveVariants===!0,W=I?.[pe],Q=[];if(typeof C=="object"&&z)for(let[B,fe]of Object.entries(C)){let me=M[fe];if(B==="initial"){W=fe;continue}Array.isArray(y.responsiveVariants)&&!y.responsiveVariants.includes(B)||(Q=E(B,me,Q,ue))}let xe=C!=null&&typeof C!="object"?C:db(W),Ne=M[xe||"false"];return typeof Q=="object"&&typeof ue=="string"&&Q[ue]?fb(Q,Ne):Q.length>0?(Q.push(Ne),ue==="base"?Q.join(" "):Q):Ne},Y=()=>{if(!b)return null;let pe=Object.keys(b),oe=[];for(let ue=0;ue<pe.length;ue++){let J=A(pe[ue],b);J&&oe.push(J)}return oe},ne=(pe,oe)=>{if(!b||typeof b!="object")return null;let ue=[];for(let J in b){let M=A(J,b,pe,oe),R=pe==="base"&&typeof M=="string"?M:M&&M[pe];R&&ue.push(R)}return ue},_e={};for(let pe in V){let oe=V[pe];oe!==void 0&&(_e[pe]=oe)}let Ee=(pe,oe)=>{let ue=typeof V?.[pe]=="object"?{[pe]:V[pe]?.initial}:{};return{...I,..._e,...ue,...oe}},Fe=(pe=[],oe)=>{let ue=[],J=pe.length;for(let M=0;M<J;M++){let{class:R,className:C,...z}=pe[M],W=!0,Q=Ee(null,oe);for(let xe in z){let Ne=z[xe],B=Q[xe];if(Array.isArray(Ne)){if(!Ne.includes(B)){W=!1;break}}else{if((Ne==null||Ne===!1)&&(B==null||B===!1))continue;if(B!==Ne){W=!1;break}}}W&&(R&&ue.push(R),C&&ue.push(C))}return ue},ie=pe=>{let oe=Fe(te,pe);if(!Array.isArray(oe))return oe;let ue={},J=i;for(let M=0;M<oe.length;M++){let R=oe[M];if(typeof R=="string")ue.base=J(ue.base,R)(y);else if(typeof R=="object")for(let C in R)ue[C]=J(ue[C],R[C])(y)}return ue},ke=pe=>{if(g.length<1)return null;let oe={},ue=Ee(null,pe);for(let J=0;J<g.length;J++){let{slots:M=[],class:R,className:C,...z}=g[J];if(!kr(z)){let W=!0;for(let Q in z){let xe=ue[Q],Ne=z[Q];if(xe===void 0||(Array.isArray(Ne)?!Ne.includes(xe):Ne!==xe)){W=!1;break}}if(!W)continue}for(let W=0;W<M.length;W++){let Q=M[W];oe[Q]||(oe[Q]=[]),oe[Q].push([R,C])}}return oe};if(!kr(p)||!S){let pe={};if(typeof G=="object"&&!kr(G)){let oe=i;for(let ue in G)pe[ue]=J=>{let M=ie(J),R=ke(J);return oe(G[ue],ne(ue,J),M?M[ue]:void 0,R?R[ue]:void 0,J?.class,J?.className)(y)}}return pe}return i(k,Y(),Fe(te),V?.class,V?.className)(y)},K=()=>{if(!(!b||typeof b!="object"))return Object.keys(b)};return ae.variantKeys=K(),ae.extend=d,ae.base=k,ae.slots=G,ae.variants=b,ae.defaultVariants=I,ae.compoundSlots=g,ae.compoundVariants=te,ae};return{tv:n,createTV:u=>(l,d)=>n(l,d?ql(u,d):u)}},K0=i=>kr(i)?cb:W0({...i,extend:{theme:i.theme,classGroups:i.classGroups,conflictingClassGroupModifiers:i.conflictingClassGroupModifiers,conflictingClassGroups:i.conflictingClassGroups,...i.extend}}),H0=(...i)=>n=>{let u=qa(i);return!u||!n.twMerge?u:((!bn.cachedTwMerge||bn.didTwMergeConfigChange)&&(bn.didTwMergeConfigChange=!1,bn.cachedTwMerge=K0(bn.cachedTwMergeConfig)),bn.cachedTwMerge(u)||void 0)},{tv:X0}=Y0(H0);const gb=X0({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",outline:"bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});var eS=ee("<a><!></a>"),tS=ee("<button><!></button>");function Gt(i,n){tt(n,!0);let u=w(n,"variant",3,"default"),l=w(n,"size",3,"default"),d=w(n,"ref",15,null),p=w(n,"href",3,void 0),m=w(n,"type",3,"button"),h=qt(n,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children","onclick"]);var g=qe(),v=je(g);{var y=b=>{var I=eS();Bt(I,T=>({"data-slot":"button",class:T,href:n.disabled?void 0:p(),"aria-disabled":n.disabled,role:n.disabled?"link":void 0,tabindex:n.disabled?-1:void 0,...h}),[()=>jr(gb({variant:u(),size:l()}),n.class)]);var S=Z(I);Wt(S,()=>n.children??$t),D(I),_r(I,T=>d(T),()=>d()),N(b,I)},k=b=>{var I=tS();Bt(I,T=>({"data-slot":"button",class:T,type:m(),disabled:n.disabled,onclick:n.onclick,...h}),[()=>jr(gb({variant:u(),size:l()}),n.class)]);var S=Z(I);Wt(S,()=>n.children??$t),D(I),_r(I,T=>d(T),()=>d()),N(b,I)};se(v,b=>{p()?b(y):b(k,!1)})}N(i,g),rt()}var rS=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),nS=ee('<span class="text-destructive ml-1">*</span>'),iS=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),oS=ee('<span class="text-xs xs:text-xs text-muted-foreground font-medium"> </span>'),aS=ee('<span class="text-xs xs:text-xs text-muted-foreground font-medium text-right"> </span>'),sS=ee('<div class="flex justify-between items-center px-1 sm:px-2"><!> <!></div>'),uS=ee('<div class="flex items-start gap-2 text-sm text-destructive bg-destructive/5 px-4 ml-2 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),lS=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <div class="flex flex-col gap-3 pt-2"><div class="flex gap-0.5 xs:gap-1 sm:gap-1.5 md:gap-2 justify-center items-center w-full"></div> <!></div> <!></div>');function cS(i,n){tt(n,!1);const u=re(),l=re(),{updateQuestionResponse:d,removeQuestionResponse:p}=hn();let m=w(n,"question",8),h=w(n,"value",24,()=>-1),g=w(n,"onChange",8),v=w(n,"error",8,void 0),y=w(n,"currentMode",8,void 0),k=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);let b=re(h()??-1);function I(oe){c(b)===oe?($(b,-1),g()(-1),p(m().id)):($(b,oe),g()(oe),d(m().id,oe,a.QuestionTypes.NPS))}he(()=>x(y()),()=>{$(u,y()==="dark")}),he(()=>x(h()),()=>{h()!==void 0&&$(b,h())}),he(()=>x(m()),()=>{$(l,Array.from({length:(m().max??10)-(m().min??0)+1},(oe,ue)=>ue+(m().min??0)))}),fr(),er();var S=lS(),T=Z(S),G=Z(T);{var te=oe=>{var ue=rS(),J=Z(ue);D(ue),Te(()=>Oe(J,`${k()??""}.`)),N(oe,ue)};se(G,oe=>{k()!==void 0&&oe(te)})}var ae=de(G,2),K=Z(ae),V=Z(K),E=de(V);{var A=oe=>{var ue=nS();N(oe,ue)};se(E,oe=>{x(m()),O(()=>m().required)&&oe(A)})}D(K);var Y=de(K,2);{var ne=oe=>{var ue=iS(),J=Z(ue,!0);D(ue),Te(()=>Oe(J,(x(m()),O(()=>m().description)))),N(oe,ue)};se(Y,oe=>{x(m()),O(()=>m().description)&&oe(ne)})}D(ae),D(T);var _e=de(T,2),Ee=Z(_e);wr(Ee,5,()=>c(l),Lr,(oe,ue)=>{{let J=Le(()=>`flex-1 min-w-0 h-8 xs:h-9 sm:h-10 text-xs xs:text-sm sm:text-base font-semibold transition-all ${c(b)===c(ue)?"bg-primary/10 text-primary border-primary border-[2px] shadow-md hover:bg-primary/90 scale-105 dark:border-primary/90 dark:bg-primary dark:hover:bg-primary dark:hover:text-primary-foreground hover:text-primary-foreground":"bg-card text-card-foreground border-[2px] hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"}`);Gt(oe,{type:"button",variant:"outline",size:"sm",get class(){return c(J)},onclick:()=>I(c(ue)),children:(M,R)=>{dr();var C=pn();Te(()=>Oe(C,c(ue))),N(M,C)},$$slots:{default:!0}})}}),D(Ee);var Fe=de(Ee,2);{var ie=oe=>{var ue=sS(),J=Z(ue);{var M=z=>{var W=oS(),Q=Z(W,!0);D(W),Te(()=>Oe(Q,(x(m()),O(()=>m().minLabel)))),N(z,W)};se(J,z=>{x(m()),O(()=>m().minLabel)&&z(M)})}var R=de(J,2);{var C=z=>{var W=aS(),Q=Z(W,!0);D(W),Te(()=>Oe(Q,(x(m()),O(()=>m().maxLabel)))),N(z,W)};se(R,z=>{x(m()),O(()=>m().maxLabel)&&z(C)})}D(ue),N(oe,ue)};se(Fe,oe=>{x(m()),O(()=>m().minLabel||m().maxLabel)&&oe(ie)})}D(_e);var ke=de(_e,2);{var pe=oe=>{var ue=uS(),J=Z(ue),M=Z(J,!0);D(J),D(ue),Te(()=>Oe(M,v())),N(oe,ue)};se(ke,oe=>{v()&&oe(pe)})}D(S),Te(()=>Oe(V,`${x(m()),O(()=>m().title)??""} `)),N(i,S),rt()}var dS=ee("<nav><!></nav>");function fS(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=qt(n,["$$slots","$$events","$$legacy","ref","class","children"]);var d=dS();Bt(d,()=>({"data-slot":"breadcrumb",class:n.class,"aria-label":"breadcrumb",...l}));var p=Z(d);Wt(p,()=>n.children??$t),D(d),_r(d,m=>u(m),()=>u()),N(i,d),rt()}/**
46
+ \r\f \v\uFEFF`];function Vx(i,n,u){var l=i==null?"":""+i;if(u){for(var d in u)if(u[d])l=l?l+" "+d:d;else if(l.length)for(var p=d.length,m=0;(m=l.indexOf(d,m))>=0;){var h=m+p;(m===0||zv.includes(l[m-1]))&&(h===l.length||zv.includes(l[h]))?l=(m===0?"":l.substring(0,m))+l.substring(h+1):m=h}}return l===""?null:l}function Nv(i,n=!1){var u=n?" !important;":";",l="";for(var d in i){var p=i[d];p!=null&&p!==""&&(l+=" "+d+": "+p+u)}return l}function zl(i){return i[0]!=="-"||i[1]!=="-"?i.toLowerCase():i}function Jx(i,n){if(n){var u="",l,d;if(Array.isArray(n)?(l=n[0],d=n[1]):l=n,i){i=String(i).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var p=!1,m=0,h=!1,g=[];l&&g.push(...Object.keys(l).map(zl)),d&&g.push(...Object.keys(d).map(zl));var v=0,y=-1;const T=i.length;for(var k=0;k<T;k++){var b=i[k];if(h?b==="/"&&i[k-1]==="*"&&(h=!1):p?p===b&&(p=!1):b==="/"&&i[k+1]==="*"?h=!0:b==='"'||b==="'"?p=b:b==="("?m++:b===")"&&m--,!h&&p===!1&&m===0){if(b===":"&&y===-1)y=k;else if(b===";"||k===T-1){if(y!==-1){var I=zl(i.substring(v,y).trim());if(!g.includes(I)){b!==";"&&k++;var S=i.substring(v,k).trim();u+=" "+S+";"}}v=k+1,y=-1}}}}return l&&(u+=Nv(l)),d&&(u+=Nv(d,!0)),u=u.trim(),u===""?null:u}return i==null?null:String(i)}function mn(i,n,u,l,d,p){var m=i.__className;if(Ze||m!==u||m===void 0){var h=Vx(u,l,p);(!Ze||h!==i.getAttribute("class"))&&(h==null?i.removeAttribute("class"):n?i.className=h:i.setAttribute("class",h)),i.__className=u}else if(p&&d!==p)for(var g in p){var v=!!p[g];(d==null||v!==!!d[g])&&i.classList.toggle(g,v)}return p}function Nl(i,n={},u,l){for(var d in u){var p=u[d];n[d]!==p&&(u[d]==null?i.style.removeProperty(d):i.style.setProperty(d,p,l))}}function $o(i,n,u,l){var d=i.__style;if(Ze||d!==n){var p=Jx(n,l);(!Ze||p!==i.getAttribute("style"))&&(p==null?i.removeAttribute("style"):i.style.cssText=p),i.__style=n}else l&&(Array.isArray(l)?(Nl(i,u?.[0],l[0]),Nl(i,u?.[1],l[1],"important")):Nl(i,u,l));return l}function Tl(i,n,u=!1){if(i.multiple){if(n==null)return;if(!kn(n))return Hk();for(var l of i.options)l.selected=n.includes(Tv(l));return}for(l of i.options){var d=Tv(l);if(mx(d,n)){l.selected=!0;return}}(!u||n!==void 0)&&(i.selectedIndex=-1)}function Bx(i){var n=new MutationObserver(()=>{Tl(i,i.__value)});n.observe(i,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),yl(()=>{n.disconnect()})}function Tv(i){return"__value"in i?i.__value:i.value}const wo=Symbol("class"),_o=Symbol("style"),jv=Symbol("is custom element"),Ov=Symbol("is html");function Yx(i){if(Ze){var n=!1,u=()=>{if(!n){if(n=!0,i.hasAttribute("value")){var l=i.value;si(i,"value",null),i.value=l}if(i.hasAttribute("checked")){var d=i.checked;si(i,"checked",null),i.checked=d}}};i.__on_r=u,dn(u),Hh()}}function Kx(i,n){n?i.hasAttribute("selected")||i.setAttribute("selected",""):i.removeAttribute("selected")}function si(i,n,u,l){var d=Ev(i);Ze&&(d[n]=i.getAttribute(n),n==="src"||n==="srcset"||n==="href"&&i.nodeName==="LINK")||d[n]!==(d[n]=u)&&(n==="loading"&&(i[Pk]=u),u==null?i.removeAttribute(n):typeof u!="string"&&Av(i).includes(n)?i[n]=u:i.setAttribute(n,u))}function Hx(i,n,u,l,d=!1,p=!1){if(Ze&&d&&i.tagName==="INPUT"){var m=i,h=m.type==="checkbox"?"defaultChecked":"defaultValue";h in u||Yx(m)}var g=Ev(i),v=g[jv],y=!g[Ov];let k=Ze&&v;k&&br(!1);var b=n||{},I=i.tagName==="OPTION";for(var S in n)S in u||(u[S]=null);u.class?u.class=Gx(u.class):u[wo]&&(u.class=null),u[_o]&&(u.style??=null);var T=Av(i);for(const A in u){let Y=u[A];if(I&&A==="value"&&Y==null){i.value=i.__value="",b[A]=Y;continue}if(A==="class"){var G=i.namespaceURI==="http://www.w3.org/1999/xhtml";mn(i,G,Y,l,n?.[wo],u[wo]),b[A]=Y,b[wo]=u[wo];continue}if(A==="style"){$o(i,Y,n?.[_o],u[_o]),b[A]=Y,b[_o]=u[_o];continue}var te=b[A];if(!(Y===te&&!(Y===void 0&&i.hasAttribute(A)))){b[A]=Y;var ae=A[0]+A[1];if(ae!=="$$")if(ae==="on"){const ne={},_e="$$"+A;let Ee=A.slice(2);var K=Ox(Ee);if(Tx(Ee)&&(Ee=Ee.slice(0,-7),ne.capture=!0),!K&&te){if(Y!=null)continue;i.removeEventListener(Ee,b[_e],ne),b[_e]=null}if(Y!=null)if(K)i[`__${Ee}`]=Y,xl([Ee]);else{let Fe=function(ie){b[A].call(this,ie)};b[_e]=bv(Ee,i,Fe,ne)}else K&&(i[`__${Ee}`]=void 0)}else if(A==="style")si(i,A,Y);else if(A==="autofocus")gx(i,!!Y);else if(!v&&(A==="__value"||A==="value"&&Y!=null))i.value=i.__value=Y;else if(A==="selected"&&I)Kx(i,Y);else{var V=A;y||(V=Cx(V));var E=V==="defaultValue"||V==="defaultChecked";if(Y==null&&!v&&!E)if(g[A]=null,V==="value"||V==="checked"){let ne=i;const _e=n===void 0;if(V==="value"){let Ee=ne.defaultValue;ne.removeAttribute(V),ne.defaultValue=Ee,ne.value=ne.__value=_e?Ee:null}else{let Ee=ne.defaultChecked;ne.removeAttribute(V),ne.defaultChecked=Ee,ne.checked=_e?Ee:!1}}else i.removeAttribute(A);else E||T.includes(V)&&(v||typeof Y!="string")?(i[V]=Y,V in g&&(g[V]=Jt)):typeof Y!="function"&&si(i,V,Y)}}}return k&&br(!0),b}function Bt(i,n,u=[],l=[],d,p=!1,m=!1){Lh(u,l,h=>{var g=void 0,v={},y=i.nodeName==="SELECT",k=!1;if(Nn(()=>{var I=n(...h.map(c)),S=Hx(i,g,I,d,p,m);k&&y&&"value"in I&&Tl(i,I.value);for(let G of Object.getOwnPropertySymbols(v))I[G]||nr(v[G]);for(let G of Object.getOwnPropertySymbols(I)){var T=I[G];G.description===ya&&(!g||T!==g[G])&&(v[G]&&nr(v[G]),v[G]=lr(()=>Wx(i,()=>T))),S[G]=T}g=S}),y){var b=i;$l(()=>{Tl(b,g.value,!0),Bx(b)})}k=!0})}function Ev(i){return i.__attributes??={[jv]:i.nodeName.includes("-"),[Ov]:i.namespaceURI===ba}}var Cv=new Map;function Av(i){var n=i.getAttribute("is")||i.nodeName,u=Cv.get(n);if(u)return u;Cv.set(n,u=[]);for(var l,d=i,p=Element.prototype;p!==d;){l=ao(d);for(var m in l)l[m].set&&u.push(m);d=et(d)}return u}function Aa(i,n,u=n){var l=new WeakSet;Xh(i,"input",async d=>{var p=d?i.defaultValue:i.value;if(p=jl(i)?Ol(p):p,u(p),Lt!==null&&l.add(Lt),await Ix(),p!==(p=n())){var m=i.selectionStart,h=i.selectionEnd,g=i.value.length;if(i.value=p??"",h!==null){var v=i.value.length;m===h&&h===g&&v>g?(i.selectionStart=v,i.selectionEnd=v):(i.selectionStart=m,i.selectionEnd=Math.min(h,v))}}}),(Ze&&i.defaultValue!==i.value||O(n)==null&&i.value)&&(u(jl(i)?Ol(i.value):i.value),Lt!==null&&l.add(Lt)),ii(()=>{var d=n();if(i===document.activeElement){var p=za??Lt;if(l.has(p))return}jl(i)&&d===Ol(i.value)||i.type==="date"&&!d&&!i.value||d!==i.value&&(i.value=d??"")})}function jl(i){var n=i.type;return n==="number"||n==="range"}function Ol(i){return i===""?null:+i}function Xx(i,n,u=n){Xh(i,"change",()=>{u(i.files)}),Ze&&i.files&&u(i.files),ii(()=>{i.files=n()})}function Mv(i,n){return i===n||i?.[Hr]===n}function _r(i={},n,u,l){return $l(()=>{var d,p;return ii(()=>{d=p,p=[],O(()=>{i!==u(...p)&&(n(i,...p),d&&Mv(u(...d),i)&&n(null,...d))})}),()=>{dn(()=>{p&&Mv(u(...p),i)&&n(null,...p)})}}),i}function er(i=!1){const n=jt,u=n.l.u;if(!u)return;let l=()=>x(n.s);if(i){let d=0,p={};const m=fo(()=>{let h=!1;const g=n.s;for(const v in g)g[v]!==p[v]&&(p[v]=g[v],h=!0);return h&&d++,d});l=()=>c(m)}u.b.length&&rv(()=>{Uv(n,l),Vn(u.b)}),mo(()=>{const d=O(()=>u.m.map(Cr));return()=>{for(const p of d)typeof p=="function"&&p()}}),u.a.length&&mo(()=>{Uv(n,l),Vn(u.a)})}function Uv(i,n){if(i.l.s)for(const u of i.l.s)c(u);n()}function Dv(i,n,u){if(i==null)return n(void 0),$t;const l=O(()=>i.subscribe(n,u));return l.unsubscribe?()=>l.unsubscribe():l}const Ii=[];function e0(i,n=$t){let u=null;const l=new Set;function d(h){if(Nh(i,h)&&(i=h,u)){const g=!Ii.length;for(const v of l)v[1](),Ii.push(v,i);if(g){for(let v=0;v<Ii.length;v+=2)Ii[v][0](Ii[v+1]);Ii.length=0}}}function p(h){d(h(i))}function m(h,g=$t){const v=[h,g];return l.add(v),l.size===1&&(u=n(d,p)||$t),h(i),()=>{l.delete(v),l.size===0&&u&&(u(),u=null)}}return{set:d,update:p,subscribe:m}}function ko(i){let n;return Dv(i,u=>n=u)(),n}let Ma=!1,El=Symbol();function Lv(i,n,u){const l=u[n]??={store:null,source:re(void 0),unsubscribe:$t};if(l.store!==i&&!(El in u))if(l.unsubscribe(),l.store=i??null,i==null)l.source.v=void 0,l.unsubscribe=$t;else{var d=!0;l.unsubscribe=Dv(i,p=>{d?l.source.v=p:$(l.source,p)}),d=!1}return i&&El in u?ko(i):c(l.source)}function Pv(){const i={};function n(){yl(()=>{for(var u in i)i[u].unsubscribe();Kr(i,El,{enumerable:!1,value:!0})})}return[i,n]}function t0(i){var n=Ma;try{return Ma=!1,[i(),Ma]}finally{Ma=n}}const r0={get(i,n){if(!i.exclude.includes(n))return i.props[n]},set(i,n){return!1},getOwnPropertyDescriptor(i,n){if(!i.exclude.includes(n)&&n in i.props)return{enumerable:!0,configurable:!0,value:i.props[n]}},has(i,n){return i.exclude.includes(n)?!1:n in i.props},ownKeys(i){return Reflect.ownKeys(i.props).filter(n=>!i.exclude.includes(n))}};function qt(i,n,u){return new Proxy({props:i,exclude:n},r0)}const n0={get(i,n){if(!i.exclude.includes(n))return c(i.version),n in i.special?i.special[n]():i.props[n]},set(i,n,u){if(!(n in i.special)){var l=nt;try{Ur(i.parent_effect),i.special[n]=w({get[n](){return i.props[n]}},n,P)}finally{Ur(l)}}return i.special[n](u),Fh(i.version),!0},getOwnPropertyDescriptor(i,n){if(!i.exclude.includes(n)&&n in i.props)return{enumerable:!0,configurable:!0,value:i.props[n]}},deleteProperty(i,n){return i.exclude.includes(n)||(i.exclude.push(n),Fh(i.version)),!0},has(i,n){return i.exclude.includes(n)?!1:n in i.props},ownKeys(i){return Reflect.ownKeys(i.props).filter(n=>!i.exclude.includes(n))}};function gn(i,n){return new Proxy({props:i,exclude:n,special:{},version:In(0),parent_effect:nt},n0)}const i0={get(i,n){let u=i.props.length;for(;u--;){let l=i.props[u];if(Zt(l)&&(l=l()),typeof l=="object"&&l!==null&&n in l)return l[n]}},set(i,n,u){let l=i.props.length;for(;l--;){let d=i.props[l];Zt(d)&&(d=d());const p=Er(d,n);if(p&&p.set)return p.set(u),!0}return!1},getOwnPropertyDescriptor(i,n){let u=i.props.length;for(;u--;){let l=i.props[u];if(Zt(l)&&(l=l()),typeof l=="object"&&l!==null&&n in l){const d=Er(l,n);return d&&!d.configurable&&(d.configurable=!0),d}}},has(i,n){if(n===Hr||n===cl)return!1;for(let u of i.props)if(Zt(u)&&(u=u()),u!=null&&n in u)return!0;return!1},ownKeys(i){const n=[];for(let u of i.props)if(Zt(u)&&(u=u()),!!u){for(const l in u)n.includes(l)||n.push(l);for(const l of Object.getOwnPropertySymbols(u))n.includes(l)||n.push(l)}return n}};function Mt(...i){return new Proxy({props:i},i0)}function w(i,n,u,l){var d=!t||(u&be)!==0,p=(u&Se)!==0,m=(u&Pe)!==0,h=l,g=!0,v=()=>(g&&(g=!1,h=m?O(l):l),h),y;if(p){var k=Hr in i||cl in i;y=Er(i,n)?.set??(k&&n in i?K=>i[n]=K:void 0)}var b,I=!1;p?[b,I]=t0(()=>i[n]):b=i[n],b===void 0&&l!==void 0&&(b=v(),y&&(d&&Vk(),y(b)));var S;if(d?S=()=>{var K=i[n];return K===void 0?v():(g=!0,K)}:S=()=>{var K=i[n];return K!==void 0&&(h=void 0),K===void 0?h:K},d&&(u&P)===0)return S;if(y){var T=i.$$legacy;return(function(K,V){return arguments.length>0?((!d||!V||T||I)&&y(V?S():K),K):S()})}var G=!1,te=((u&Ce)!==0?fo:Le)(()=>(G=!1,S()));p&&c(te);var ae=nt;return(function(K,V){if(arguments.length>0){const E=V?c(te):d&&p?zn(K):K;return $(te,E),G=!0,h!==void 0&&(h=E),K}return oi&&G||(ae.f&Yn)!==0?te.v:c(te)})}function o0(i){return new a0(i)}class a0{#e;#t;constructor(n){var u=new Map,l=(p,m)=>{var h=re(m,!1,!1);return u.set(p,h),h};const d=new Proxy({...n.props||{},$$events:{}},{get(p,m){return c(u.get(m)??l(m,Reflect.get(p,m)))},has(p,m){return m===cl?!0:(c(u.get(m)??l(m,Reflect.get(p,m))),Reflect.has(p,m))},set(p,m,h){return $(u.get(m)??l(m,h),h),Reflect.set(p,m,h)}});this.#t=(n.hydrate?Lx:_v)(n.component,{target:n.target,anchor:n.anchor,props:d,context:n.context,intro:n.intro??!1,recover:n.recover}),(!n?.props?.$$host||n.sync===!1)&&dt(),this.#e=d.$$events;for(const p of Object.keys(this.#t))p==="$set"||p==="$destroy"||p==="$on"||Kr(this,p,{get(){return this.#t[p]},set(m){this.#t[p]=m},enumerable:!0});this.#t.$set=p=>{Object.assign(d,p)},this.#t.$destroy=()=>{Px(this.#t)}}$set(n){this.#t.$set(n)}$on(n,u){this.#e[n]=this.#e[n]||[];const l=(...d)=>u.call(this,...d);return this.#e[n].push(l),()=>{this.#e[n]=this.#e[n].filter(d=>d!==l)}}$destroy(){this.#t.$destroy()}}let Rv;typeof HTMLElement=="function"&&(Rv=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(i,n,u){super(),this.$$ctor=i,this.$$s=n,u&&this.attachShadow({mode:"open"})}addEventListener(i,n,u){if(this.$$l[i]=this.$$l[i]||[],this.$$l[i].push(n),this.$$c){const l=this.$$c.$on(i,n);this.$$l_u.set(n,l)}super.addEventListener(i,n,u)}removeEventListener(i,n,u){if(super.removeEventListener(i,n,u),this.$$c){const l=this.$$l_u.get(n);l&&(l(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let i=function(l){return d=>{const p=document.createElement("slot");l!=="default"&&(p.name=l),N(d,p)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},u=s0(this);for(const l of this.$$s)l in u&&(l==="default"&&!this.$$d.children?(this.$$d.children=i(l),n.default=!0):n[l]=i(l));for(const l of this.attributes){const d=this.$$g_p(l.name);d in this.$$d||(this.$$d[d]=Ua(d,l.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)!(l in this.$$d)&&this[l]!==void 0&&(this.$$d[l]=this[l],delete this[l]);this.$$c=o0({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=yx(()=>{ii(()=>{this.$$r=!0;for(const l of Gn(this.$$c)){if(!this.$$p_d[l]?.reflect)continue;this.$$d[l]=this.$$c[l];const d=Ua(l,this.$$d[l],this.$$p_d,"toAttribute");d==null?this.removeAttribute(this.$$p_d[l].attribute||l):this.setAttribute(this.$$p_d[l].attribute||l,d)}this.$$r=!1})});for(const l in this.$$l)for(const d of this.$$l[l]){const p=this.$$c.$on(l,d);this.$$l_u.set(d,p)}this.$$l={}}}attributeChangedCallback(i,n,u){this.$$r||(i=this.$$g_p(i),this.$$d[i]=Ua(i,u,this.$$p_d,"toProp"),this.$$c?.$set({[i]:this.$$d[i]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(i){return Gn(this.$$p_d).find(n=>this.$$p_d[n].attribute===i||!this.$$p_d[n].attribute&&n.toLowerCase()===i)||i}});function Ua(i,n,u,l){const d=u[i]?.type;if(n=d==="Boolean"&&typeof n!="boolean"?n!=null:n,!l||!u[i])return n;if(l==="toAttribute")switch(d){case"Object":case"Array":return n==null?null:JSON.stringify(n);case"Boolean":return n?"":null;case"Number":return n??null;default:return n}else switch(d){case"Object":case"Array":return n&&JSON.parse(n);case"Boolean":return n;case"Number":return n!=null?+n:n;default:return n}}function s0(i){const n={};return i.childNodes.forEach(u=>{n[u.slot||"default"]=!0}),n}function Zv(i,n,u,l,d,p){let m=class extends Rv{constructor(){super(i,u,d),this.$$p_d=n}static get observedAttributes(){return Gn(n).map(h=>(n[h].attribute||h).toLowerCase())}};return Gn(n).forEach(h=>{Kr(m.prototype,h,{get(){return this.$$c&&h in this.$$c?this.$$c[h]:this.$$d[h]},set(g){g=Ua(h,g,n),this.$$d[h]=g;var v=this.$$c;if(v){var y=Er(v,h)?.get;y?v[h]=g:v.$set({[h]:g})}}})}),l.forEach(h=>{Kr(m.prototype,h,{get(){return this.$$c?.[h]}})}),i.element=m,m}const u0={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};var l0=On("<svg><!><!></svg>");function ui(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=gn(u,["type","name","color","size","stroke","iconNode"]);tt(n,!1);let d=w(n,"type",8),p=w(n,"name",8),m=w(n,"color",8,"currentColor"),h=w(n,"size",8,24),g=w(n,"stroke",8,2),v=w(n,"iconNode",8);er();var y=l0();Bt(y,()=>({...u0[d()],...l,width:h(),height:h(),class:(x(p()),x(u),O(()=>`tabler-icon tabler-icon-${p()} ${u.class??""}`)),...d()==="filled"?{fill:m()}:{"stroke-width":g(),stroke:m()}}));var k=Z(y);wr(k,1,v,Lr,(I,S)=>{var T=ht(()=>Xt(c(S),2));let G=()=>c(T)[0],te=()=>c(T)[1];var ae=qe(),K=je(ae);Sv(K,G,!0,(V,E)=>{Bt(V,()=>({...te()}))}),N(I,ae)});var b=de(k);Cn(b,n,"default",{}),D(y),N(i,y),rt()}function qv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M9 14l-4 -4l4 -4"}],["path",{d:"M5 10h11a4 4 0 1 1 0 8h-1"}]];ui(i,Mt({type:"outline",name:"arrow-back-up"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Fv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M15 6l-6 6l6 6"}]];ui(i,Mt({type:"outline",name:"chevron-left"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Da(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M9 6l6 6l-6 6"}]];ui(i,Mt({type:"outline",name:"chevron-right"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function c0(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M5 12l-2 0l9 -9l9 9l-2 0"}],["path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"}],["path",{d:"M10 12h4v4h-4z"}]];ui(i,Mt({type:"outline",name:"home-2"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Qv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M15 8h.01"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12z"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3"}]];ui(i,Mt({type:"outline",name:"photo"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Wv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M6 21l15 -15l-3 -3l-15 15l3 3"}],["path",{d:"M15 6l3 3"}],["path",{d:"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}],["path",{d:"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2"}]];ui(i,Mt({type:"outline",name:"wand"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}function Gv(i,n){const u=gn(n,["children","$$slots","$$events","$$legacy"]),l=[["path",{d:"M18 6l-12 12"}],["path",{d:"M6 6l12 12"}]];ui(i,Mt({type:"outline",name:"x"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Cn(h,n,"default",{}),N(d,m)},$$slots:{default:!0}}))}const d0={questions:[],questionsData:{}},Vv=Symbol("formResponses"),f0=()=>{const i=e0(d0),n=(h,g,v,y)=>{if((g==null||g===""||Array.isArray(g)&&g.length===0)&&!y){p(h);return}let k;switch(v){case"rating":k={rating:g};break;case"nps":k={nps:g};break;case"long_text":k={longText:g};break;case"short_answer":k={shortAnswer:g};break;case"single_choice":k={singleChoice:g};break;case"multiple_choice_multiple":k={multipleChoiceMultiple:Array.isArray(g)?g:[g]};break;case"nested_selection":k={nestedSelection:Array.isArray(g)?g:[g]};break;case"annotation":k={annotation:g};break;default:k=g}i.update(b=>{const I=b.questions.findIndex(S=>S.questionId===h);return I!==-1?{...b,questions:b.questions.map((S,T)=>T===I?{...S,answer:k,type:v,error:y}:S)}:{...b,questions:[...b.questions,{questionId:h,answer:k,type:v,error:y}]}})},u=(h,g)=>{m(h)&&i.update(v=>({...v,questions:v.questions.map(y=>y.questionId===h?{...y,error:g}:y)}))},l=()=>{i.update(h=>({...h,questions:h.questions.map(g=>({...g,error:void 0}))}))},d=()=>ko(i).questions.some(h=>h.error!==void 0&&h.error!==null&&h.error!==""),p=h=>{i.update(g=>({...g,questions:g.questions.filter(v=>v.questionId!==h)}))},m=h=>ko(i).questions.find(g=>g.questionId===h);return{formResponses:i,updateQuestionResponse:n,getQuestionResponse:m,removeQuestionResponse:p,setQuestionError:u,hasValidationErrors:d,clearValidationErrors:l,clearResponses:()=>{i.update(h=>({...h,questions:[]}))},bulkUpdateResponses:h=>{i.update(g=>({...g,questions:h}))},storeQuestions:h=>{console.log("🔴 [formResponses] Storing questions:",h),Object.entries(h).forEach(([g,v])=>{v.type==="single_choice"&&console.log(`🔴 [formResponses] Storing single_choice question ${g}:`,{id:v.id,type:v.type,title:v.title,hasOptions:"options"in v,options:v.options,optionsType:typeof v.options,isArray:Array.isArray(v.options),optionsLength:Array.isArray(v.options)?v.options.length:"N/A",fullQuestion:v})}),i.update(g=>({...g,questionsData:h}))},getQuestionData:h=>{const g=ko(i).questionsData[h];return g&&g.type==="single_choice"&&console.log(`🔴 [formResponses] Getting single_choice question ${h}:`,{id:g.id,type:g.type,title:g.title,hasOptions:"options"in g,options:g.options,optionsType:typeof g.options,isArray:Array.isArray(g.options),optionsLength:Array.isArray(g.options)?g.options.length:"N/A",fullQuestion:g}),g}}},Jv=()=>{const i=f0();return jh(Vv,i),i},hn=()=>fl(Vv),Cl="-",p0=i=>{const n=g0(i),{conflictingClassGroups:u,conflictingClassGroupModifiers:l}=i;return{getClassGroupId:d=>{const p=d.split(Cl);return p[0]===""&&p.length!==1&&p.shift(),Bv(p,n)||m0(d)},getConflictingClassGroupIds:(d,p)=>{const m=u[d]||[];return p&&l[d]?[...m,...l[d]]:m}}},Bv=(i,n)=>{if(i.length===0)return n.classGroupId;const u=i[0],l=n.nextPart.get(u),d=l?Bv(i.slice(1),l):void 0;if(d)return d;if(n.validators.length===0)return;const p=i.join(Cl);return n.validators.find(({validator:m})=>m(p))?.classGroupId},Yv=/^\[(.+)\]$/,m0=i=>{if(Yv.test(i)){const n=Yv.exec(i)[1],u=n?.substring(0,n.indexOf(":"));if(u)return"arbitrary.."+u}},g0=i=>{const{theme:n,classGroups:u}=i,l={nextPart:new Map,validators:[]};for(const d in u)Al(u[d],l,d,n);return l},Al=(i,n,u,l)=>{i.forEach(d=>{if(typeof d=="string"){const p=d===""?n:Kv(n,d);p.classGroupId=u;return}if(typeof d=="function"){if(h0(d)){Al(d(l),n,u,l);return}n.validators.push({validator:d,classGroupId:u});return}Object.entries(d).forEach(([p,m])=>{Al(m,Kv(n,p),u,l)})})},Kv=(i,n)=>{let u=i;return n.split(Cl).forEach(l=>{u.nextPart.has(l)||u.nextPart.set(l,{nextPart:new Map,validators:[]}),u=u.nextPart.get(l)}),u},h0=i=>i.isThemeGetter,v0=i=>{if(i<1)return{get:()=>{},set:()=>{}};let n=0,u=new Map,l=new Map;const d=(p,m)=>{u.set(p,m),n++,n>i&&(n=0,l=u,u=new Map)};return{get(p){let m=u.get(p);if(m!==void 0)return m;if((m=l.get(p))!==void 0)return d(p,m),m},set(p,m){u.has(p)?u.set(p,m):d(p,m)}}},Ml="!",Ul=":",b0=Ul.length,y0=i=>{const{prefix:n,experimentalParseClassName:u}=i;let l=d=>{const p=[];let m=0,h=0,g=0,v;for(let S=0;S<d.length;S++){let T=d[S];if(m===0&&h===0){if(T===Ul){p.push(d.slice(g,S)),g=S+b0;continue}if(T==="/"){v=S;continue}}T==="["?m++:T==="]"?m--:T==="("?h++:T===")"&&h--}const y=p.length===0?d:d.substring(g),k=$0(y),b=k!==y,I=v&&v>g?v-g:void 0;return{modifiers:p,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:I}};if(n){const d=n+Ul,p=l;l=m=>m.startsWith(d)?p(m.substring(d.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(u){const d=l;l=p=>u({className:p,parseClassName:d})}return l},$0=i=>i.endsWith(Ml)?i.substring(0,i.length-1):i.startsWith(Ml)?i.substring(1):i,w0=i=>{const n=Object.fromEntries(i.orderSensitiveModifiers.map(u=>[u,!0]));return u=>{if(u.length<=1)return u;const l=[];let d=[];return u.forEach(p=>{p[0]==="["||n[p]?(l.push(...d.sort(),p),d=[]):d.push(p)}),l.push(...d.sort()),l}},_0=i=>({cache:v0(i.cacheSize),parseClassName:y0(i),sortModifiers:w0(i),...p0(i)}),k0=/\s+/,x0=(i,n)=>{const{parseClassName:u,getClassGroupId:l,getConflictingClassGroupIds:d,sortModifiers:p}=n,m=[],h=i.trim().split(k0);let g="";for(let v=h.length-1;v>=0;v-=1){const y=h[v],{isExternal:k,modifiers:b,hasImportantModifier:I,baseClassName:S,maybePostfixModifierPosition:T}=u(y);if(k){g=y+(g.length>0?" "+g:g);continue}let G=!!T,te=l(G?S.substring(0,T):S);if(!te){if(!G){g=y+(g.length>0?" "+g:g);continue}if(te=l(S),!te){g=y+(g.length>0?" "+g:g);continue}G=!1}const ae=p(b).join(":"),K=I?ae+Ml:ae,V=K+te;if(m.includes(V))continue;m.push(V);const E=d(te,G);for(let A=0;A<E.length;++A){const Y=E[A];m.push(K+Y)}g=y+(g.length>0?" "+g:g)}return g};function S0(){let i=0,n,u,l="";for(;i<arguments.length;)(n=arguments[i++])&&(u=Hv(n))&&(l&&(l+=" "),l+=u);return l}const Hv=i=>{if(typeof i=="string")return i;let n,u="";for(let l=0;l<i.length;l++)i[l]&&(n=Hv(i[l]))&&(u&&(u+=" "),u+=n);return u};function Dl(i,...n){let u,l,d,p=m;function m(g){const v=n.reduce((y,k)=>k(y),i());return u=_0(v),l=u.cache.get,d=u.cache.set,p=h,h(g)}function h(g){const v=l(g);if(v)return v;const y=x0(g,u);return d(g,y),y}return function(){return p(S0.apply(null,arguments))}}const tr=i=>{const n=u=>u[i]||[];return n.isThemeGetter=!0,n},Xv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,eb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,I0=/^\d+\/\d+$/,z0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N0=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,j0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zi=i=>I0.test(i),st=i=>!!i&&!Number.isNaN(Number(i)),An=i=>!!i&&Number.isInteger(Number(i)),Ll=i=>i.endsWith("%")&&st(i.slice(0,-1)),vn=i=>z0.test(i),E0=()=>!0,C0=i=>N0.test(i)&&!T0.test(i),tb=()=>!1,A0=i=>j0.test(i),M0=i=>O0.test(i),U0=i=>!Ae(i)&&!Me(i),D0=i=>Ni(i,ab,tb),Ae=i=>Xv.test(i),li=i=>Ni(i,sb,C0),Pl=i=>Ni(i,q0,st),rb=i=>Ni(i,ib,tb),L0=i=>Ni(i,ob,M0),La=i=>Ni(i,ub,A0),Me=i=>eb.test(i),xo=i=>Ti(i,sb),P0=i=>Ti(i,F0),nb=i=>Ti(i,ib),R0=i=>Ti(i,ab),Z0=i=>Ti(i,ob),Pa=i=>Ti(i,ub,!0),Ni=(i,n,u)=>{const l=Xv.exec(i);return l?l[1]?n(l[1]):u(l[2]):!1},Ti=(i,n,u=!1)=>{const l=eb.exec(i);return l?l[1]?n(l[1]):u:!1},ib=i=>i==="position"||i==="percentage",ob=i=>i==="image"||i==="url",ab=i=>i==="length"||i==="size"||i==="bg-size",sb=i=>i==="length",q0=i=>i==="number",F0=i=>i==="family-name",ub=i=>i==="shadow",Rl=()=>{const i=tr("color"),n=tr("font"),u=tr("text"),l=tr("font-weight"),d=tr("tracking"),p=tr("leading"),m=tr("breakpoint"),h=tr("container"),g=tr("spacing"),v=tr("radius"),y=tr("shadow"),k=tr("inset-shadow"),b=tr("text-shadow"),I=tr("drop-shadow"),S=tr("blur"),T=tr("perspective"),G=tr("aspect"),te=tr("ease"),ae=tr("animate"),K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...V(),Me,Ae],A=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto","contain","none"],ne=()=>[Me,Ae,g],_e=()=>[zi,"full","auto",...ne()],Ee=()=>[An,"none","subgrid",Me,Ae],Fe=()=>["auto",{span:["full",An,Me,Ae]},An,Me,Ae],ie=()=>[An,"auto",Me,Ae],ke=()=>["auto","min","max","fr",Me,Ae],pe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],oe=()=>["start","end","center","stretch","center-safe","end-safe"],ue=()=>["auto",...ne()],J=()=>[zi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ne()],M=()=>[i,Me,Ae],R=()=>[...V(),nb,rb,{position:[Me,Ae]}],C=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",R0,D0,{size:[Me,Ae]}],Q=()=>[Ll,xo,li],W=()=>["","none","full",v,Me,Ae],xe=()=>["",st,xo,li],Ne=()=>["solid","dashed","dotted","double"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[st,Ll,nb,rb],me=()=>["","none",S,Me,Ae],we=()=>["none",st,Me,Ae],De=()=>["none",st,Me,Ae],Ge=()=>[st,Me,Ae],Ke=()=>[zi,"full",...ne()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vn],breakpoint:[vn],color:[E0],container:[vn],"drop-shadow":[vn],ease:["in","out","in-out"],font:[U0],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vn],shadow:[vn],spacing:["px",st],text:[vn],"text-shadow":[vn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zi,Ae,Me,G]}],container:["container"],columns:[{columns:[st,Ae,Me,h]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_e()}],"inset-x":[{"inset-x":_e()}],"inset-y":[{"inset-y":_e()}],start:[{start:_e()}],end:[{end:_e()}],top:[{top:_e()}],right:[{right:_e()}],bottom:[{bottom:_e()}],left:[{left:_e()}],visibility:["visible","invisible","collapse"],z:[{z:[An,"auto",Me,Ae]}],basis:[{basis:[zi,"full","auto",h,...ne()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,zi,"auto","initial","none",Ae]}],grow:[{grow:["",st,Me,Ae]}],shrink:[{shrink:["",st,Me,Ae]}],order:[{order:[An,"first","last","none",Me,Ae]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:Fe()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:Fe()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ke()}],"auto-rows":[{"auto-rows":ke()}],gap:[{gap:ne()}],"gap-x":[{"gap-x":ne()}],"gap-y":[{"gap-y":ne()}],"justify-content":[{justify:[...pe(),"normal"]}],"justify-items":[{"justify-items":[...oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...oe()]}],"align-content":[{content:["normal",...pe()]}],"align-items":[{items:[...oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":pe()}],"place-items":[{"place-items":[...oe(),"baseline"]}],"place-self":[{"place-self":["auto",...oe()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:ue()}],mx:[{mx:ue()}],my:[{my:ue()}],ms:[{ms:ue()}],me:[{me:ue()}],mt:[{mt:ue()}],mr:[{mr:ue()}],mb:[{mb:ue()}],ml:[{ml:ue()}],"space-x":[{"space-x":ne()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ne()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],w:[{w:[h,"screen",...J()]}],"min-w":[{"min-w":[h,"screen","none",...J()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[m]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",u,xo,li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,Me,Pl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ll,Ae]}],"font-family":[{font:[P0,Ae,n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,Me,Ae]}],"line-clamp":[{"line-clamp":[st,"none",Me,Pl]}],leading:[{leading:[p,...ne()]}],"list-image":[{"list-image":["none",Me,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[st,"from-font","auto",Me,li]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[st,"auto",Me,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ne()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:C()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},An,Me,Ae],radial:["",Me,Ae],conic:[An,Me,Ae]},Z0,L0]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:xe()}],"border-w-x":[{"border-x":xe()}],"border-w-y":[{"border-y":xe()}],"border-w-s":[{"border-s":xe()}],"border-w-e":[{"border-e":xe()}],"border-w-t":[{"border-t":xe()}],"border-w-r":[{"border-r":xe()}],"border-w-b":[{"border-b":xe()}],"border-w-l":[{"border-l":xe()}],"divide-x":[{"divide-x":xe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":xe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[st,Me,Ae]}],"outline-w":[{outline:["",st,xo,li]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",y,Pa,La]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",k,Pa,La]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[st,li]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":xe()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",b,Pa,La]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[st,Me,Ae]}],"mix-blend":[{"mix-blend":[...B(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":B()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[st]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Me,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":V()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:C()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Ae]}],filter:[{filter:["","none",Me,Ae]}],blur:[{blur:me()}],brightness:[{brightness:[st,Me,Ae]}],contrast:[{contrast:[st,Me,Ae]}],"drop-shadow":[{"drop-shadow":["","none",I,Pa,La]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",st,Me,Ae]}],"hue-rotate":[{"hue-rotate":[st,Me,Ae]}],invert:[{invert:["",st,Me,Ae]}],saturate:[{saturate:[st,Me,Ae]}],sepia:[{sepia:["",st,Me,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Ae]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[st,Me,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[st,Me,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,Me,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,Me,Ae]}],"backdrop-invert":[{"backdrop-invert":["",st,Me,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[st,Me,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[st,Me,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",st,Me,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ne()}],"border-spacing-x":[{"border-spacing-x":ne()}],"border-spacing-y":[{"border-spacing-y":ne()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",Me,Ae]}],ease:[{ease:["linear","initial",te,Me,Ae]}],delay:[{delay:[st,Me,Ae]}],animate:[{animate:["none",ae,Me,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,Me,Ae]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:Ge()}],"skew-x":[{"skew-x":Ge()}],"skew-y":[{"skew-y":Ge()}],transform:[{transform:[Me,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ke()}],"translate-x":[{"translate-x":Ke()}],"translate-y":[{"translate-y":Ke()}],"translate-z":[{"translate-z":Ke()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ne()}],"scroll-mx":[{"scroll-mx":ne()}],"scroll-my":[{"scroll-my":ne()}],"scroll-ms":[{"scroll-ms":ne()}],"scroll-me":[{"scroll-me":ne()}],"scroll-mt":[{"scroll-mt":ne()}],"scroll-mr":[{"scroll-mr":ne()}],"scroll-mb":[{"scroll-mb":ne()}],"scroll-ml":[{"scroll-ml":ne()}],"scroll-p":[{"scroll-p":ne()}],"scroll-px":[{"scroll-px":ne()}],"scroll-py":[{"scroll-py":ne()}],"scroll-ps":[{"scroll-ps":ne()}],"scroll-pe":[{"scroll-pe":ne()}],"scroll-pt":[{"scroll-pt":ne()}],"scroll-pr":[{"scroll-pr":ne()}],"scroll-pb":[{"scroll-pb":ne()}],"scroll-pl":[{"scroll-pl":ne()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Me,Ae]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[st,xo,li,Pl]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Q0=(i,{cacheSize:n,prefix:u,experimentalParseClassName:l,extend:d={},override:p={}})=>(So(i,"cacheSize",n),So(i,"prefix",u),So(i,"experimentalParseClassName",l),Ra(i.theme,p.theme),Ra(i.classGroups,p.classGroups),Ra(i.conflictingClassGroups,p.conflictingClassGroups),Ra(i.conflictingClassGroupModifiers,p.conflictingClassGroupModifiers),So(i,"orderSensitiveModifiers",p.orderSensitiveModifiers),Za(i.theme,d.theme),Za(i.classGroups,d.classGroups),Za(i.conflictingClassGroups,d.conflictingClassGroups),Za(i.conflictingClassGroupModifiers,d.conflictingClassGroupModifiers),lb(i,d,"orderSensitiveModifiers"),i),So=(i,n,u)=>{u!==void 0&&(i[n]=u)},Ra=(i,n)=>{if(n)for(const u in n)So(i,u,n[u])},Za=(i,n)=>{if(n)for(const u in n)lb(i,n,u)},lb=(i,n,u)=>{const l=n[u];l!==void 0&&(i[u]=i[u]?i[u].concat(l):l)},W0=(i,...n)=>typeof i=="function"?Dl(Rl,i,...n):Dl(()=>Q0(Rl(),i),...n),cb=Dl(Rl);function jr(...i){return cb(yo(i))}var G0=/\s+/g,Zl=i=>typeof i!="string"||!i?i:i.replace(G0," ").trim(),qa=(...i)=>{let n=[],u=l=>{if(!l&&l!==0&&l!==0n)return;if(Array.isArray(l)){for(let p=0,m=l.length;p<m;p++)u(l[p]);return}let d=typeof l;if(d==="string"||d==="number"||d==="bigint"){if(d==="number"&&l!==l)return;n.push(String(l))}else if(d==="object"){let p=Object.keys(l);for(let m=0,h=p.length;m<h;m++){let g=p[m];l[g]&&n.push(g)}}};for(let l=0,d=i.length;l<d;l++){let p=i[l];p!=null&&u(p)}return n.length>0?Zl(n.join(" ")):void 0},db=i=>i===!1?"false":i===!0?"true":i===0?"0":i,kr=i=>{if(!i||typeof i!="object")return!0;for(let n in i)return!1;return!0},V0=(i,n)=>{if(i===n)return!0;if(!i||!n)return!1;let u=Object.keys(i),l=Object.keys(n);if(u.length!==l.length)return!1;for(let d=0;d<u.length;d++){let p=u[d];if(!l.includes(p)||i[p]!==n[p])return!1}return!0},fb=(i,n)=>{for(let u in n)if(Object.prototype.hasOwnProperty.call(n,u)){let l=n[u];u in i?i[u]=qa(i[u],l):i[u]=l}return i},pb=(i,n)=>{for(let u=0;u<i.length;u++){let l=i[u];Array.isArray(l)?pb(l,n):l&&n.push(l)}},mb=(...i)=>{let n=[];pb(i,n);let u=[];for(let l=0;l<n.length;l++)n[l]&&u.push(n[l]);return u},ql=(i,n)=>{let u={};for(let l in i){let d=i[l];if(l in n){let p=n[l];Array.isArray(d)||Array.isArray(p)?u[l]=mb(p,d):typeof d=="object"&&typeof p=="object"&&d&&p?u[l]=ql(d,p):u[l]=p+" "+d}else u[l]=d}for(let l in n)l in i||(u[l]=n[l]);return u},J0={twMerge:!0,twMergeConfig:{},responsiveVariants:!1};function B0(){let i=null,n={},u=!1;return{get cachedTwMerge(){return i},set cachedTwMerge(l){i=l},get cachedTwMergeConfig(){return n},set cachedTwMergeConfig(l){n=l},get didTwMergeConfigChange(){return u},set didTwMergeConfigChange(l){u=l},reset(){i=null,n={},u=!1}}}var bn=B0(),Y0=i=>{let n=(u,l)=>{let{extend:d=null,slots:p={},variants:m={},compoundVariants:h=[],compoundSlots:g=[],defaultVariants:v={}}=u,y={...J0,...l},k=d?.base?qa(d.base,u?.base):u?.base,b=d?.variants&&!kr(d.variants)?ql(m,d.variants):m,I=d?.defaultVariants&&!kr(d.defaultVariants)?{...d.defaultVariants,...v}:v;!kr(y.twMergeConfig)&&!V0(y.twMergeConfig,bn.cachedTwMergeConfig)&&(bn.didTwMergeConfigChange=!0,bn.cachedTwMergeConfig=y.twMergeConfig);let S=kr(d?.slots),T=kr(p)?{}:{base:qa(u?.base,S&&d?.base),...p},G=S?T:fb({...d?.slots},kr(T)?{base:u?.base}:T),te=kr(d?.compoundVariants)?h:mb(d?.compoundVariants,h),ae=V=>{if(kr(b)&&kr(p)&&S)return i(k,V?.class,V?.className)(y);if(te&&!Array.isArray(te))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof te}`);if(g&&!Array.isArray(g))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof g}`);let E=(pe,oe,ue=[],J)=>{let M=ue;if(typeof oe=="string"){let R=Zl(oe).split(" ");for(let C=0;C<R.length;C++)M.push(`${pe}:${R[C]}`)}else if(Array.isArray(oe))for(let R=0;R<oe.length;R++)M.push(`${pe}:${oe[R]}`);else if(typeof oe=="object"&&typeof J=="string"&&J in oe){let R=oe[J];if(R&&typeof R=="string"){let C=Zl(R).split(" "),z=[];for(let Q=0;Q<C.length;Q++)z.push(`${pe}:${C[Q]}`);M[J]=M[J]?M[J].concat(z):z}else if(Array.isArray(R)&&R.length>0){let C=[];for(let z=0;z<R.length;z++)C.push(`${pe}:${R[z]}`);M[J]=C}}return M},A=(pe,oe=b,ue=null,J=null)=>{let M=oe[pe];if(!M||kr(M))return null;let R=J?.[pe]??V?.[pe];if(R===null)return null;let C=db(R),z=Array.isArray(y.responsiveVariants)&&y.responsiveVariants.length>0||y.responsiveVariants===!0,Q=I?.[pe],W=[];if(typeof C=="object"&&z)for(let[B,fe]of Object.entries(C)){let me=M[fe];if(B==="initial"){Q=fe;continue}Array.isArray(y.responsiveVariants)&&!y.responsiveVariants.includes(B)||(W=E(B,me,W,ue))}let xe=C!=null&&typeof C!="object"?C:db(Q),Ne=M[xe||"false"];return typeof W=="object"&&typeof ue=="string"&&W[ue]?fb(W,Ne):W.length>0?(W.push(Ne),ue==="base"?W.join(" "):W):Ne},Y=()=>{if(!b)return null;let pe=Object.keys(b),oe=[];for(let ue=0;ue<pe.length;ue++){let J=A(pe[ue],b);J&&oe.push(J)}return oe},ne=(pe,oe)=>{if(!b||typeof b!="object")return null;let ue=[];for(let J in b){let M=A(J,b,pe,oe),R=pe==="base"&&typeof M=="string"?M:M&&M[pe];R&&ue.push(R)}return ue},_e={};for(let pe in V){let oe=V[pe];oe!==void 0&&(_e[pe]=oe)}let Ee=(pe,oe)=>{let ue=typeof V?.[pe]=="object"?{[pe]:V[pe]?.initial}:{};return{...I,..._e,...ue,...oe}},Fe=(pe=[],oe)=>{let ue=[],J=pe.length;for(let M=0;M<J;M++){let{class:R,className:C,...z}=pe[M],Q=!0,W=Ee(null,oe);for(let xe in z){let Ne=z[xe],B=W[xe];if(Array.isArray(Ne)){if(!Ne.includes(B)){Q=!1;break}}else{if((Ne==null||Ne===!1)&&(B==null||B===!1))continue;if(B!==Ne){Q=!1;break}}}Q&&(R&&ue.push(R),C&&ue.push(C))}return ue},ie=pe=>{let oe=Fe(te,pe);if(!Array.isArray(oe))return oe;let ue={},J=i;for(let M=0;M<oe.length;M++){let R=oe[M];if(typeof R=="string")ue.base=J(ue.base,R)(y);else if(typeof R=="object")for(let C in R)ue[C]=J(ue[C],R[C])(y)}return ue},ke=pe=>{if(g.length<1)return null;let oe={},ue=Ee(null,pe);for(let J=0;J<g.length;J++){let{slots:M=[],class:R,className:C,...z}=g[J];if(!kr(z)){let Q=!0;for(let W in z){let xe=ue[W],Ne=z[W];if(xe===void 0||(Array.isArray(Ne)?!Ne.includes(xe):Ne!==xe)){Q=!1;break}}if(!Q)continue}for(let Q=0;Q<M.length;Q++){let W=M[Q];oe[W]||(oe[W]=[]),oe[W].push([R,C])}}return oe};if(!kr(p)||!S){let pe={};if(typeof G=="object"&&!kr(G)){let oe=i;for(let ue in G)pe[ue]=J=>{let M=ie(J),R=ke(J);return oe(G[ue],ne(ue,J),M?M[ue]:void 0,R?R[ue]:void 0,J?.class,J?.className)(y)}}return pe}return i(k,Y(),Fe(te),V?.class,V?.className)(y)},K=()=>{if(!(!b||typeof b!="object"))return Object.keys(b)};return ae.variantKeys=K(),ae.extend=d,ae.base=k,ae.slots=G,ae.variants=b,ae.defaultVariants=I,ae.compoundSlots=g,ae.compoundVariants=te,ae};return{tv:n,createTV:u=>(l,d)=>n(l,d?ql(u,d):u)}},K0=i=>kr(i)?cb:W0({...i,extend:{theme:i.theme,classGroups:i.classGroups,conflictingClassGroupModifiers:i.conflictingClassGroupModifiers,conflictingClassGroups:i.conflictingClassGroups,...i.extend}}),H0=(...i)=>n=>{let u=qa(i);return!u||!n.twMerge?u:((!bn.cachedTwMerge||bn.didTwMergeConfigChange)&&(bn.didTwMergeConfigChange=!1,bn.cachedTwMerge=K0(bn.cachedTwMergeConfig)),bn.cachedTwMerge(u)||void 0)},{tv:X0}=Y0(H0);const gb=X0({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white",outline:"bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});var eS=ee("<a><!></a>"),tS=ee("<button><!></button>");function Gt(i,n){tt(n,!0);let u=w(n,"variant",3,"default"),l=w(n,"size",3,"default"),d=w(n,"ref",15,null),p=w(n,"href",3,void 0),m=w(n,"type",3,"button"),h=qt(n,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children","onclick"]);var g=qe(),v=je(g);{var y=b=>{var I=eS();Bt(I,T=>({"data-slot":"button",class:T,href:n.disabled?void 0:p(),"aria-disabled":n.disabled,role:n.disabled?"link":void 0,tabindex:n.disabled?-1:void 0,...h}),[()=>jr(gb({variant:u(),size:l()}),n.class)]);var S=Z(I);Wt(S,()=>n.children??$t),D(I),_r(I,T=>d(T),()=>d()),N(b,I)},k=b=>{var I=tS();Bt(I,T=>({"data-slot":"button",class:T,type:m(),disabled:n.disabled,onclick:n.onclick,...h}),[()=>jr(gb({variant:u(),size:l()}),n.class)]);var S=Z(I);Wt(S,()=>n.children??$t),D(I),_r(I,T=>d(T),()=>d()),N(b,I)};se(v,b=>{p()?b(y):b(k,!1)})}N(i,g),rt()}var rS=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),nS=ee('<span class="text-destructive ml-1">*</span>'),iS=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),oS=ee('<span class="text-xs xs:text-xs text-muted-foreground font-medium"> </span>'),aS=ee('<span class="text-xs xs:text-xs text-muted-foreground font-medium text-right"> </span>'),sS=ee('<div class="flex justify-between items-center px-1 sm:px-2"><!> <!></div>'),uS=ee('<div class="flex items-start gap-2 text-sm text-destructive bg-destructive/5 px-4 ml-2 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),lS=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <div class="flex flex-col gap-3 pt-2"><div class="flex gap-0.5 xs:gap-1 sm:gap-1.5 md:gap-2 justify-center items-center w-full"></div> <!></div> <!></div>');function cS(i,n){tt(n,!1);const u=re(),l=re(),{updateQuestionResponse:d,removeQuestionResponse:p}=hn();let m=w(n,"question",8),h=w(n,"value",24,()=>-1),g=w(n,"onChange",8),v=w(n,"error",8,void 0),y=w(n,"currentMode",8,void 0),k=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);let b=re(h()??-1);function I(oe){c(b)===oe?($(b,-1),g()(-1),p(m().id)):($(b,oe),g()(oe),d(m().id,oe,a.QuestionTypes.NPS))}he(()=>x(y()),()=>{$(u,y()==="dark")}),he(()=>x(h()),()=>{h()!==void 0&&$(b,h())}),he(()=>x(m()),()=>{$(l,Array.from({length:(m().max??10)-(m().min??0)+1},(oe,ue)=>ue+(m().min??0)))}),fr(),er();var S=lS(),T=Z(S),G=Z(T);{var te=oe=>{var ue=rS(),J=Z(ue);D(ue),Te(()=>Oe(J,`${k()??""}.`)),N(oe,ue)};se(G,oe=>{k()!==void 0&&oe(te)})}var ae=de(G,2),K=Z(ae),V=Z(K),E=de(V);{var A=oe=>{var ue=nS();N(oe,ue)};se(E,oe=>{x(m()),O(()=>m().required)&&oe(A)})}D(K);var Y=de(K,2);{var ne=oe=>{var ue=iS(),J=Z(ue,!0);D(ue),Te(()=>Oe(J,(x(m()),O(()=>m().description)))),N(oe,ue)};se(Y,oe=>{x(m()),O(()=>m().description)&&oe(ne)})}D(ae),D(T);var _e=de(T,2),Ee=Z(_e);wr(Ee,5,()=>c(l),Lr,(oe,ue)=>{{let J=Le(()=>`flex-1 min-w-0 h-8 xs:h-9 sm:h-10 text-xs xs:text-sm sm:text-base font-semibold transition-all ${c(b)===c(ue)?"bg-primary/10 text-primary border-primary border-[2px] shadow-md hover:bg-primary/90 scale-105 dark:border-primary/90 dark:bg-primary dark:hover:bg-primary dark:hover:text-primary-foreground hover:text-primary-foreground":"bg-card text-card-foreground border-[2px] hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"}`);Gt(oe,{type:"button",variant:"outline",size:"sm",get class(){return c(J)},onclick:()=>I(c(ue)),children:(M,R)=>{dr();var C=pn();Te(()=>Oe(C,c(ue))),N(M,C)},$$slots:{default:!0}})}}),D(Ee);var Fe=de(Ee,2);{var ie=oe=>{var ue=sS(),J=Z(ue);{var M=z=>{var Q=oS(),W=Z(Q,!0);D(Q),Te(()=>Oe(W,(x(m()),O(()=>m().minLabel)))),N(z,Q)};se(J,z=>{x(m()),O(()=>m().minLabel)&&z(M)})}var R=de(J,2);{var C=z=>{var Q=aS(),W=Z(Q,!0);D(Q),Te(()=>Oe(W,(x(m()),O(()=>m().maxLabel)))),N(z,Q)};se(R,z=>{x(m()),O(()=>m().maxLabel)&&z(C)})}D(ue),N(oe,ue)};se(Fe,oe=>{x(m()),O(()=>m().minLabel||m().maxLabel)&&oe(ie)})}D(_e);var ke=de(_e,2);{var pe=oe=>{var ue=uS(),J=Z(ue),M=Z(J,!0);D(J),D(ue),Te(()=>Oe(M,v())),N(oe,ue)};se(ke,oe=>{v()&&oe(pe)})}D(S),Te(()=>Oe(V,`${x(m()),O(()=>m().title)??""} `)),N(i,S),rt()}var dS=ee("<nav><!></nav>");function fS(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=qt(n,["$$slots","$$events","$$legacy","ref","class","children"]);var d=dS();Bt(d,()=>({"data-slot":"breadcrumb",class:n.class,"aria-label":"breadcrumb",...l}));var p=Z(d);Wt(p,()=>n.children??$t),D(d),_r(d,m=>u(m),()=>u()),N(i,d),rt()}/**
47
47
  * @license @lucide/svelte v0.544.0 - ISC
48
48
  *
49
49
  * ISC License
@@ -129,7 +129,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
129
129
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
130
130
  * SOFTWARE.
131
131
  *
132
- */let u=qt(n,["$$slots","$$events","$$legacy"]);const l=[["path",{d:"m9 18 6-6-6-6"}]];Fa(i,Mt({name:"chevron-right"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Wt(h,()=>n.children??$t),N(d,m)},$$slots:{default:!0}})),rt()}var vS=ee("<li><!></li>");function bS(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=qt(n,["$$slots","$$events","$$legacy","ref","class","children"]);var d=vS();Bt(d,g=>({"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",class:g,...l}),[()=>jr("[&>svg]:size-3.5",n.class)]);var p=Z(d);{var m=g=>{var v=qe(),y=je(v);Wt(y,()=>n.children??$t),N(g,v)},h=g=>{hS(g,{})};se(p,g=>{n.children?g(m):g(h,!1)})}D(d),_r(d,g=>u(g),()=>u()),N(i,d),rt()}var yS=ee("<a><!></a>");function $S(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"href",3,void 0),d=qt(n,["$$slots","$$events","$$legacy","ref","class","href","child","children"]);const p=ht(()=>({"data-slot":"breadcrumb-link",class:jr("hover:text-foreground transition-colors",n.class),href:l(),...d}));var m=qe(),h=je(m);{var g=y=>{var k=qe(),b=je(k);Wt(b,()=>n.child,()=>({props:c(p)})),N(y,k)},v=y=>{var k=yS();Bt(k,()=>({...c(p)}));var b=Z(k);Wt(b,()=>n.children??$t),D(k),_r(k,I=>u(I),()=>u()),N(y,k)};se(h,y=>{n.child?y(g):y(v,!1)})}N(i,m),rt()}var wS=ee("<ol><!></ol>");function _S(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=qt(n,["$$slots","$$events","$$legacy","ref","class","children"]);var d=wS();Bt(d,m=>({"data-slot":"breadcrumb-list",class:m,...l}),[()=>jr("text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5",n.class)]);var p=Z(d);Wt(p,()=>n.children??$t),D(d),_r(d,m=>u(m),()=>u()),N(i,d),rt()}var kS=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),xS=ee('<span class="text-destructive ml-1">*</span>'),SS=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),IS=ee("<!> <!>",1),zS=ee("<!> <!>",1),NS=On('<svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7"></path></svg>'),TS=ee('<span class="flex items-center gap-3 w-full"><span class="flex-1 text-sm font-medium"> </span> <!></span>'),jS=ee('<div class="p-2 space-y-1"></div>'),OS=ee('<div class="flex flex-col items-center justify-center py-12 px-4"><div class="w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-3"><svg class="w-6 h-6 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm font-medium text-muted-foreground">No options available</p></div>'),ES=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md border border-destructive/20"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="font-medium"> </span></div>'),CS=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <div class="border border-border rounded-xl bg-card shadow-sm overflow-hidden"><div class="px-4 py-3 bg-accent/30 border-b border-border backdrop-blur-sm"><!></div> <div class="max-h-[420px] overflow-y-auto scrollbar-thin"><!></div></div> <!></div>');function AS(i,n){tt(n,!1);const u=re();let l=w(n,"question",8),d=w(n,"value",24,()=>[]),p=w(n,"onChange",8),m=w(n,"error",8,void 0),h=w(n,"currentMode",8,void 0),g=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);const v=d()?Array.isArray(d())?d():[d()]:[];let y=re(v),k=re(T()),b=re(!1),I=re([]),S=re([]);function T(){return v.length===0?[]:v.slice(0,-1)}function G(B,fe){$(b,!0),B.children&&B.children.length>0?$(k,fe):($(y,fe),$(k,fe.slice(0,-1)),p()(fe))}function te(B){const fe=c(y);return fe.length!==B.length?!1:B.every((me,we)=>fe[we]===me)}function ae(B){let fe=l().options;for(let me=0;me<B.length;me++){const we=fe.find(De=>De.value===B[me]);if(we&&we.children)fe=we.children;else return[]}return fe}function K(B){const fe=[];let me=l().options;for(let we=0;we<B.length;we++){const De=me.find(Ge=>Ge.value===B[we]);De&&(fe.push({value:B[we],label:De.label,index:we}),De.children&&(me=De.children))}return fe}function V(B){$(b,!0),$(k,c(k).slice(0,B+1))}function E(){$(b,!0),$(k,[]),$(y,[]),p()([])}he(()=>x(h()),()=>{$(u,h()==="dark")}),he(()=>(x(d()),c(b)),()=>{if(d()!==void 0&&!c(b)){const B=Array.isArray(d())?d():[d()];$(y,B),B.length>0?$(k,B.slice(0,-1)):$(k,[])}else d()===void 0&&!c(b)&&($(y,[]),$(k,[]))}),he(()=>c(k),()=>{$(I,ae(c(k)))}),he(()=>c(k),()=>{$(S,K(c(k)))}),fr(),er();var A=CS(),Y=Z(A),ne=Z(Y);{var _e=B=>{var fe=kS(),me=Z(fe);D(fe),Te(()=>Oe(me,`${g()??""}.`)),N(B,fe)};se(ne,B=>{g()!==void 0&&B(_e)})}var Ee=de(ne,2),Fe=Z(Ee),ie=Z(Fe),ke=de(ie);{var pe=B=>{var fe=xS();N(B,fe)};se(ke,B=>{x(l()),O(()=>l().required)&&B(pe)})}D(Fe);var oe=de(Fe,2);{var ue=B=>{var fe=SS(),me=Z(fe,!0);D(fe),Te(()=>Oe(me,(x(l()),O(()=>l().description)))),N(B,fe)};se(oe,B=>{x(l()),O(()=>l().description)&&B(ue)})}D(Ee),D(Y);var J=de(Y,2),M=Z(J),R=Z(M);fS(R,{children:(B,fe)=>{_S(B,{class:"flex items-center gap-1.5 flex-wrap",children:(me,we)=>{var De=zS(),Ge=je(De);hb(Ge,{children:(Je,lt)=>{Gt(Je,{type:"button",variant:"ghost",size:"sm",class:"h-8 w-8 p-0 hover:bg-background/80 rounded-md transition-colors",onclick:E,"aria-label":"Home",children:(ft,Ue)=>{c0(ft,{size:18,class:"text-muted-foreground hover:text-foreground transition-colors"})},$$slots:{default:!0}})},$$slots:{default:!0}});var Ke=de(Ge,2);wr(Ke,1,()=>c(S),Lr,(Je,lt)=>{var ft=IS(),Ue=je(ft);bS(Ue,{class:"text-muted-foreground/50",children:(St,Ut)=>{Da(St,{size:14})},$$slots:{default:!0}});var kt=de(Ue,2);hb(kt,{children:(St,Ut)=>{$S(St,{onclick:()=>V(c(lt).index),class:"cursor-pointer text-sm font-medium text-foreground/80 hover:text-primary transition-colors px-2 py-1 rounded-md hover:bg-background/50",children:(Ft,wt)=>{dr();var zt=pn();Te(()=>Oe(zt,(c(lt),O(()=>c(lt).label)))),N(Ft,zt)},$$slots:{default:!0}})},$$slots:{default:!0}}),N(Je,ft)}),N(me,De)},$$slots:{default:!0}})},$$slots:{default:!0}}),D(M);var C=de(M,2),z=Z(C);{var W=B=>{var fe=jS();wr(fe,5,()=>c(I),Lr,(me,we)=>{const De=Le(()=>(c(k),c(we),O(()=>te([...c(k),c(we).value])))),Ge=Le(()=>(c(we),O(()=>c(we).children&&c(we).children.length>0)));{let Ke=Le(()=>`w-full justify-start px-4 py-3.5 h-auto rounded-lg text-left transition-all relative group ${c(De)&&!c(Ge)?"bg-primary text-primary-foreground border-primary shadow-md hover:shadow-lg hover:bg-primary/90 hover:text-primary-foreground dark:hover:bg-primary":"text-foreground hover:bg-accent/50 hover:border-border/50 border border-transparent"}`);Gt(me,{type:"button",variant:"ghost",get class(){return c(Ke)},onclick:()=>G(c(we),[...c(k),c(we).value]),children:(Je,lt)=>{var ft=TS(),Ue=Z(ft),kt=Z(Ue,!0);D(Ue);var St=de(Ue,2);{var Ut=wt=>{{let zt=Le(()=>`flex-shrink-0 transition-transform group-hover:translate-x-0.5 ${c(De)?"text-primary":"text-muted-foreground"}`);Da(wt,{size:18,get class(){return c(zt)}})}},Ft=wt=>{var zt=qe(),Nt=je(zt);{var Yt=ir=>{var mr=NS();N(ir,mr)};se(Nt,ir=>{c(De)&&ir(Yt)},!0)}N(wt,zt)};se(St,wt=>{c(Ge)?wt(Ut):wt(Ft,!1)})}D(ft),Te(()=>Oe(kt,(c(we),O(()=>c(we).label)))),N(Je,ft)},$$slots:{default:!0}})}}),D(fe),N(B,fe)},Q=B=>{var fe=OS();N(B,fe)};se(z,B=>{c(I),O(()=>c(I).length>0)?B(W):B(Q,!1)})}D(C),D(J);var xe=de(J,2);{var Ne=B=>{var fe=ES(),me=de(Z(fe),2),we=Z(me,!0);D(me),D(fe),Te(()=>Oe(we,m())),N(B,fe)};se(xe,B=>{m()&&B(Ne)})}D(A),Te(()=>Oe(ie,`${x(l()),O(()=>l().title)??""} `)),N(i,A),rt()}var MS=ee("<textarea></textarea>");function US(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"value",15),d=w(n,"data-slot",3,"textarea"),p=qt(n,["$$slots","$$events","$$legacy","ref","value","class","data-slot"]);var m=MS();hx(m),Bt(m,h=>({"data-slot":d(),class:h,...p}),[()=>jr("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 field-sizing-content shadow-xs flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n.class)]),_r(m,h=>u(h),()=>u()),Aa(m,l),N(i,m),rt()}function vb(i){if(!i)return{code:null,message:""};const n=i.split("|").map(u=>u.trim());if(n.length>=2){const u=n[0],l=n.slice(1).join("|").trim(),d=l.match(/(\d+)\s+seconds?/i),p=d?parseInt(d[1],10):void 0;return{code:u,message:l,seconds:p}}return{code:null,message:i}}function bb(i,n,u){let l=i;n(l);const d=setInterval(()=>{l--,n(l),l<=0&&(clearInterval(d),u())},1e3);return d}function yb(i,n,u,l){if(!u?.otherFields)return n;const{otherFields:d}=u;switch(i){case"1001":{const p=d.aiEnhancementCooldownErrorMessage||n;return l!==void 0?`${p} (${l}s)`:p}case"1002":return d.aiEnhancementMaxReachedErrorMessage||n;default:return n}}async function $b(i){return await window.encatch._internal.refineText({questionId:i.questionId,identifier:i.identifier,feedbackConfigurationId:i.feedbackConfigurationId,userText:i.userText})}var DS=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),LS=ee('<span class="text-destructive ml-1">*</span>'),PS=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),RS=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/5 px-4 mx-4 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),ZS=On('<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>'),qS=ee('<div class="flex items-center gap-1 border border-border rounded-lg p-0.5"><!> <span class="text-xs font-medium text-muted-foreground px-2"> </span> <!></div>'),FS=ee("<!> <span>Reset</span>",1),QS=ee('<div class="flex items-center gap-2 text-sm text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/30 px-3 py-2 rounded-md border border-green-200 dark:border-green-900"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg> <span class="font-medium"> </span></div>'),WS=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md border border-destructive/20"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="font-medium"> </span></div>'),GS=ee('<div class="flex items-center gap-2 flex-wrap"><!> <!> <!></div> <!> <!>',1),VS=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <div class="relative"><!> <div> </div></div> <!></div>');function JS(i,n){tt(n,!1);const u=re(),l=re(),d=re(),p=re(),m=re(),h=re(),g=re(),v=re();let y=w(n,"question",8),k=w(n,"value",8,""),b=w(n,"onChange",8),I=w(n,"error",8,void 0),S=w(n,"currentMode",8,void 0),T=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0),w(n,"apiKey",8,void 0),w(n,"hostUrl",8,void 0);let G=w(n,"identifier",8,void 0),te=w(n,"feedbackConfigurationId",8,void 0),ae=w(n,"otherConfigurationProperties",8,void 0),K=re(k()??""),V=re(null),E=re(0),A=re(I()),Y=re(!1),ne=re(!1),_e=re(!1),Ee=re(null),Fe=re(null),ie=re(!1),ke=re(!1),pe=re(""),oe=re(0),ue=null,J=re(c(K));const{updateQuestionResponse:M,setQuestionError:R}=hn();En(()=>{setTimeout(()=>{const H=z(c(K));$(A,H),H&&R(y().id,H),$(ie,!0)},0)}),bo(()=>{ue!==null&&clearInterval(ue)});function C(){c(Y)||$(Y,!0)}function z(H){if(y().required&&(!H||H.trim()===""))return y().errorMessage||"This field is required";if(y().maxCharacters!==void 0&&H.length>y().maxCharacters||y().minCharacters!==void 0&&H.length>0&&H.length<y().minCharacters)return y().errorMessage}function W(H){ue!==null&&clearInterval(ue),ue=bb(H,ye=>{$(oe,ye)},()=>{ue=null,$(Ee,null)})}async function Q(){if(!fe()||!G()||!te())return;const H=c(K);try{$(_e,!0),$(Ee,null);const ye=await $b({questionId:y().id,identifier:G(),feedbackConfigurationId:te(),userText:H});if(ye?.data?.refinedText){const L=ye.data.refinedText;$(Fe,ae()?.otherFields?.aiEnhancementSuccessMessage||ye.message||"Text refined successfully"),c(V)?($(V,{original:c(V).original,enhanced:[...c(V).enhanced,L]}),$(E,c(V).enhanced.length)):($(V,{original:H,enhanced:[L]}),$(E,1)),$(K,L),$(ne,!0);const q=z(L);$(A,q),b()(L),M(y().id,L,a.QuestionTypes.LONG_TEXT,q)}else{if(ye?.message){const{code:L,message:q,seconds:We}=vb(ye.message);L==="1001"&&We!==void 0&&W(We),$(Ee,yb(L,q,ae(),We))}$(ne,!1)}}catch(ye){console.error("Error enhancing text:",ye),$(Ee,"An error occurred while enhancing text"),$(ne,!1)}finally{$(_e,!1)}}function xe(){if(!c(V))return;const H=c(V).original;$(K,H),$(E,0);const ye=z(H);$(A,ye),b()(H),M(y().id,H,a.QuestionTypes.LONG_TEXT,ye)}function Ne(H){if(!c(V))return;let ye;if(H===0)ye=c(V).original;else{const q=H-1;if(q>=c(V).enhanced.length)return;ye=c(V).enhanced[q]}$(K,ye),$(E,H);const L=z(ye);$(A,L),b()(ye),M(y().id,ye,a.QuestionTypes.LONG_TEXT,L)}function B(){return c(V)?c(V).enhanced.length+1:0}function fe(){const H=c(K).trim();return H?y().minCharactersToEnhance!==void 0?H.length>=y().minCharactersToEnhance:!0:!1}he(()=>x(S()),()=>{$(u,S()==="dark")}),he(()=>(x(k()),c(K),c(Y)),()=>{k()!==void 0&&k()!==c(K)&&!c(Y)&&($(K,k()),$(J,k()))}),he(()=>c(K),()=>{$(l,c(K).length)}),he(()=>x(y()),()=>{$(d,y().minCharacters)}),he(()=>x(y()),()=>{$(p,y().maxCharacters)}),he(()=>(c(p),c(l)),()=>{$(m,c(p)!==void 0&&c(l)>c(p))}),he(()=>(c(d),c(l)),()=>{$(h,c(d)!==void 0&&c(l)<c(d)&&c(l)>0)}),he(()=>(c(m),c(h)),()=>{$(g,c(m)||c(h))}),he(()=>(c(d),c(p)),()=>{$(v,c(d)!==void 0||c(p)!==void 0)}),he(()=>(c(K),x(y())),()=>{const H=c(K).trim();H?y().minCharactersToEnhance!==void 0?$(ke,H.length>=y().minCharactersToEnhance):$(ke,!0):$(ke,!1)}),he(()=>(c(d),c(p),c(l),x(y())),()=>{c(d)!==void 0&&c(p)!==void 0?$(pe,`${c(l)} / (${c(d)} - ${c(p)})`):c(p)!==void 0&&y().required?$(pe,`${c(l)} / (1 - ${c(p)})`):c(d)!==void 0?$(pe,`${c(l)} / (${c(d)} - 5000)`):$(pe,"")}),he(()=>(c(oe),x(ae())),()=>{c(oe)>0&&ae()?.otherFields?.aiEnhancementCooldownErrorMessage&&$(Ee,`${ae().otherFields.aiEnhancementCooldownErrorMessage} (${c(oe)}s)`)}),he(()=>x(I()),()=>{I()!==void 0&&$(A,I())}),he(()=>(c(ie),c(Y),c(K),c(J),x(y()),a.QuestionTypes),()=>{if(c(ie)&&c(Y)&&c(K)!==c(J)){$(J,c(K));const H=z(c(K));$(A,H),M(y().id,c(K),a.QuestionTypes.LONG_TEXT,H)}}),fr(),er();var me=VS(),we=Z(me),De=Z(we);{var Ge=H=>{var ye=DS(),L=Z(ye);D(ye),Te(()=>Oe(L,`${T()??""}.`)),N(H,ye)};se(De,H=>{T()!==void 0&&H(Ge)})}var Ke=de(De,2),Je=Z(Ke),lt=Z(Je),ft=de(lt);{var Ue=H=>{var ye=LS();N(H,ye)};se(ft,H=>{x(y()),O(()=>y().required)&&H(Ue)})}D(Je);var kt=de(Je,2);{var St=H=>{var ye=PS(),L=Z(ye,!0);D(ye),Te(()=>Oe(L,(x(y()),O(()=>y().description)))),N(H,ye)};se(kt,H=>{x(y()),O(()=>y().description)&&H(St)})}D(Ke),D(we);var Ut=de(we,2);{var Ft=H=>{var ye=RS(),L=Z(ye),q=Z(L,!0);D(L),D(ye),Te(()=>Oe(q,c(A))),N(H,ye)};se(Ut,H=>{c(A)&&c(Y)&&H(Ft)})}var wt=de(Ut,2),zt=Z(wt);{let H=Le(()=>(x(y()),O(()=>y().rows||4)));US(zt,{class:"w-full min-h-[120px] text-secondary-foreground focus-visible:ring-0 focus-visible:ring-offset-0 resize-y",onfocus:C,get placeholder(){return x(y()),O(()=>y().placeholder)},get rows(){return c(H)},onblur:()=>{if(c(ie)){const ye=z(c(K));$(A,ye),R(y().id,ye),b()(c(K))}},get value(){return c(K)},set value(ye){$(K,ye)},$$legacy:!0})}var Nt=de(zt,2),Yt=Z(Nt);D(Nt),D(wt);var ir=de(wt,2);{var mr=H=>{var ye=GS(),L=je(ye),q=Z(L);{let Ve=Le(()=>c(_e)||!c(ke));Gt(q,{type:"button",variant:"secondary",size:"sm",class:"gap-2",onclick:Q,get disabled(){return c(Ve)},children:(ut,Dt)=>{var mt=qe(),gr=je(mt);{var yn=Ot=>{var xr=ZS();N(Ot,xr)},cr=Ot=>{Wv(Ot,{size:16})};se(gr,Ot=>{c(_e)?Ot(yn):Ot(cr,!1)})}N(ut,mt)},$$slots:{default:!0}})}var We=de(q,2);{var Qe=Ve=>{var ut=qS(),Dt=Z(ut);{let cr=Le(()=>c(E)===0);Gt(Dt,{type:"button",class:"p-1.5 rounded hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onclick:()=>{c(E)>0&&Ne(c(E)-1)},get disabled(){return c(cr)},title:"Previous version",children:(Ot,xr)=>{Fv(Ot,{size:14,class:"text-muted-foreground"})},$$slots:{default:!0}})}var mt=de(Dt,2),gr=Z(mt);D(mt);var yn=de(mt,2);{let cr=Le(()=>(c(E),O(()=>c(E)>=B()-1)));Gt(yn,{type:"button",class:"p-1.5 rounded hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onclick:()=>{const Ot=B();c(E)<Ot-1&&Ne(c(E)+1)},get disabled(){return c(cr)},title:"Next version",children:(Ot,xr)=>{Da(Ot,{size:14,class:"text-muted-foreground"})},$$slots:{default:!0}})}D(ut),Te(cr=>Oe(gr,`${c(E)+1} / ${cr??""}`),[()=>O(B)]),N(Ve,ut)};se(We,Ve=>{c(V),c(_e),O(()=>c(V)&&!c(_e)&&c(V).enhanced&&c(V).enhanced.length>1)&&Ve(Qe)})}var Ie=de(We,2);{var Be=Ve=>{Gt(Ve,{type:"button",variant:"ghost",size:"sm",class:"gap-2",onclick:xe,title:"Back to original text",children:(ut,Dt)=>{var mt=FS(),gr=je(mt);qv(gr,{size:16}),dr(2),N(ut,mt)},$$slots:{default:!0}})};se(Ie,Ve=>{c(V)&&!c(_e)&&c(E)!==0&&Ve(Be)})}D(L);var Re=de(L,2);{var or=Ve=>{var ut=QS(),Dt=de(Z(ut),2),mt=Z(Dt,!0);D(Dt),D(ut),Te(()=>Oe(mt,c(Fe))),N(Ve,ut)};se(Re,Ve=>{c(ne)&&!c(Ee)&&Ve(or)})}var Vt=de(Re,2);{var ar=Ve=>{var ut=WS(),Dt=de(Z(ut),2),mt=Z(Dt,!0);D(Dt),D(ut),Te(()=>Oe(mt,c(Ee))),N(Ve,ut)};se(Vt,Ve=>{c(Ee)&&Ve(ar)})}N(H,ye)};se(ir,H=>{x(y()),O(()=>y().enableEnhanceWithAi)&&H(mr)})}D(me),Te(H=>{Oe(lt,`${x(y()),O(()=>y().title)??""} `),mn(Nt,1,`absolute right-3 bottom-3 text-xs font-medium px-2 py-1 rounded-full transition-colors whitespace-nowrap ${c(g)?"bg-destructive/10 text-destructive border border-destructive/20":"bg-muted text-muted-foreground"}`),Oe(Yt,`${c(K),O(()=>c(K)?.length||0)??""}${H??""}`)},[()=>(c(pe),O(()=>c(pe)?` ${c(pe).split("/")[1]||""}`:""))]),N(i,me),rt()}var BS=ee("<input/>"),YS=ee("<input/>");function KS(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"value",15),d=w(n,"files",15),p=w(n,"data-slot",3,"input"),m=qt(n,["$$slots","$$events","$$legacy","ref","value","type","files","class","data-slot"]);var h=qe(),g=je(h);{var v=k=>{var b=BS();Bt(b,I=>({"data-slot":p(),class:I,type:"file",...m}),[()=>jr("selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n.class)],void 0,void 0,!0),_r(b,I=>u(I),()=>u()),Xx(b,d),Aa(b,l),N(k,b)},y=k=>{var b=YS();Bt(b,I=>({"data-slot":p(),class:I,type:n.type,...m}),[()=>jr("border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n.class)],void 0,void 0,!0),_r(b,I=>u(I),()=>u()),Aa(b,l),N(k,b)};se(g,k=>{n.type==="file"?k(v):k(y,!1)})}N(i,h),rt()}var HS=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),XS=ee('<span class="text-destructive ml-1">*</span>'),eI=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),tI=ee('<div class="flex items-start gap-2 text-sm text-destructive bg-destructive/5 px-4 ml-2 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),rI=On('<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>'),nI=ee('<div class="flex items-center gap-1 border border-border rounded-lg p-0.5"><!> <span class="text-xs font-medium text-muted-foreground px-2"> </span> <!></div>'),iI=ee("<!> <span>Reset</span>",1),oI=ee('<div class="flex items-center gap-2 text-sm text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/30 px-3 py-2 rounded-md border border-green-200 dark:border-green-900"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg> <span class="font-medium"> </span></div>'),aI=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md border border-destructive/20"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="font-medium"> </span></div>'),sI=ee('<div class="flex items-center gap-2 flex-wrap"><!> <!> <!></div> <!> <!>',1),uI=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <div class="relative px-2"><!> <div> </div></div> <!></div>');function lI(i,n){tt(n,!1);const u=re(),l=re(),d=re(),p=re(),m=re(),h=re(),g=re(),v=re(),{updateQuestionResponse:y,setQuestionError:k}=hn();let b=w(n,"question",8),I=w(n,"value",8,""),S=w(n,"onChange",8),T=w(n,"error",8,void 0),G=w(n,"currentMode",8,void 0),te=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0),w(n,"apiKey",8,void 0),w(n,"hostUrl",8,void 0);let ae=w(n,"identifier",8,void 0),K=w(n,"feedbackConfigurationId",8,void 0),V=w(n,"otherConfigurationProperties",8,void 0),E=re(I()||""),A=re(null),Y=re(0),ne=re(T()),_e=re(!1),Ee=re(!1),Fe=re(!1),ie=re(null),ke=re(null),pe=re(!1),oe=re(!1),ue=re(""),J=re(0),M=null,R=re(c(E));En(()=>{setTimeout(()=>{const H=B(c(E));$(ne,H),H&&k(b().id,H),$(pe,!0)},0)}),bo(()=>{M!==null&&clearInterval(M)});function C(){c(_e)||$(_e,!0)}function z(H){M!==null&&clearInterval(M),M=bb(H,ye=>{$(J,ye)},()=>{M=null,$(ie,null)})}async function W(){if(!fe())return;const H=c(E);try{$(Fe,!0),$(ie,null);const ye=await $b({questionId:b().id,identifier:ae(),feedbackConfigurationId:K(),userText:H});if(ye?.data?.refinedText){const L=ye.data.refinedText;$(ke,V()?.otherFields?.aiEnhancementSuccessMessage||ye.message||"Text refined successfully"),c(A)?($(A,{original:c(A).original,enhanced:[...c(A).enhanced,L]}),$(Y,c(A).enhanced.length)):($(A,{original:H,enhanced:[L]}),$(Y,1)),$(E,L),$(Ee,!0);const q=B(L);$(ne,q),S()(L),y(b().id,L,a.QuestionTypes.SHORT_ANSWER,q)}else{if(ye?.message){const{code:L,message:q,seconds:We}=vb(ye.message);L==="1001"&&We!==void 0&&z(We),$(ie,yb(L,q,V(),We))}$(Ee,!1)}}catch(ye){console.error("Error enhancing text:",ye),$(ie,"An error occurred while enhancing text!"),$(Ee,!1)}finally{$(Fe,!1)}}function Q(){if(!c(A))return;const H=c(A).original;$(E,H),$(Y,0);const ye=B(H);$(ne,ye),S()(H),y(b().id,H,a.QuestionTypes.SHORT_ANSWER,ye)}function xe(H){if(!c(A))return;let ye;if(H===0)ye=c(A).original;else{const q=H-1;if(q>=c(A).enhanced.length)return;ye=c(A).enhanced[q]}$(E,ye),$(Y,H);const L=B(ye);$(ne,L),S()(ye),y(b().id,ye,a.QuestionTypes.SHORT_ANSWER,L)}function Ne(){return c(A)?c(A).enhanced.length+1:0}function B(H){if(b().required&&(!H||H.trim()===""))return b().errorMessage||"This field is required";if(b().maxCharacters!==void 0&&H.length>b().maxCharacters||b().minCharacters!==void 0&&H.length>0&&H.length<b().minCharacters)return b().errorMessage;if(b().enableRegexValidation&&b().regexPattern)try{const ye=new RegExp(b().regexPattern);if(H.length>0&&!ye.test(H))return b().errorMessage||"Input does not match required pattern"}catch{}}function fe(){const H=c(E).trim();return H?b().minCharactersToEnhance!==void 0?H.length>=b().minCharactersToEnhance:!0:!1}he(()=>x(G()),()=>{$(u,G()==="dark")}),he(()=>(x(I()),c(E),c(_e)),()=>{I()!==void 0&&I()!==c(E)&&!c(_e)&&($(E,I()),$(R,I()))}),he(()=>c(E),()=>{$(l,c(E).length||0)}),he(()=>x(b()),()=>{$(d,b().minCharacters)}),he(()=>x(b()),()=>{$(p,b().maxCharacters)}),he(()=>(c(p),c(l)),()=>{$(m,c(p)!==void 0&&c(l)>c(p))}),he(()=>(c(d),c(l)),()=>{$(h,c(d)!==void 0&&c(l)<c(d)&&c(l)>0)}),he(()=>(c(m),c(h)),()=>{$(g,c(m)||c(h))}),he(()=>(c(d),c(p)),()=>{$(v,c(d)!==void 0||c(p)!==void 0)}),he(()=>(c(E),x(b())),()=>{const H=c(E).trim();H?b().minCharactersToEnhance!==void 0?$(oe,H.length>=b().minCharactersToEnhance):$(oe,!0):$(oe,!1)}),he(()=>(c(E),c(d),c(p),x(b())),()=>{const H=c(E)?.length||0;c(d)!==void 0&&c(p)!==void 0?$(ue,`${H} / (${c(d)} - ${c(p)})`):c(p)!==void 0&&b().required?$(ue,`${H} / (1 - ${c(p)})`):c(d)!==void 0?$(ue,`${H} / (${c(d)} - 5000)`):$(ue,`${H}`)}),he(()=>(c(J),x(V())),()=>{c(J)>0&&V()?.otherFields?.aiEnhancementCooldownErrorMessage&&$(ie,`${V().otherFields.aiEnhancementCooldownErrorMessage} (${c(J)}s)`)}),he(()=>x(T()),()=>{T()!==void 0&&$(ne,T())}),he(()=>(c(pe),c(_e),c(E),c(R),x(b()),a.QuestionTypes),()=>{if(c(pe)&&c(_e)&&c(E)!==c(R)){$(R,c(E));const H=B(c(E));$(ne,H),y(b().id,c(E),a.QuestionTypes.SHORT_ANSWER,H)}}),fr(),er();var me=uI(),we=Z(me),De=Z(we);{var Ge=H=>{var ye=HS(),L=Z(ye);D(ye),Te(()=>Oe(L,`${te()??""}.`)),N(H,ye)};se(De,H=>{te()!==void 0&&H(Ge)})}var Ke=de(De,2),Je=Z(Ke),lt=Z(Je),ft=de(lt);{var Ue=H=>{var ye=XS();N(H,ye)};se(ft,H=>{x(b()),O(()=>b().required)&&H(Ue)})}D(Je);var kt=de(Je,2);{var St=H=>{var ye=eI(),L=Z(ye,!0);D(ye),Te(()=>Oe(L,(x(b()),O(()=>b().description)))),N(H,ye)};se(kt,H=>{x(b()),O(()=>b().description)&&H(St)})}D(Ke),D(we);var Ut=de(we,2);{var Ft=H=>{var ye=tI(),L=Z(ye),q=Z(L,!0);D(L),D(ye),Te(()=>Oe(q,c(ne))),N(H,ye)};se(Ut,H=>{c(ne)&&c(_e)&&H(Ft)})}var wt=de(Ut,2),zt=Z(wt);{let H=Le(()=>`w-full pr-20 py-5 text-secondary-foreground ${c(v)?"pr-20":""}`);KS(zt,{get class(){return c(H)},onfocus:C,get placeholder(){return x(b()),O(()=>b().placeholder)},onblur:()=>{if(c(pe)){const ye=B(c(E));$(ne,ye),k(b().id,ye),S()(c(E))}},get value(){return c(E)},set value(ye){$(E,ye)},$$legacy:!0})}var Nt=de(zt,2),Yt=Z(Nt,!0);D(Nt),D(wt);var ir=de(wt,2);{var mr=H=>{var ye=sI(),L=je(ye),q=Z(L);{let Ve=Le(()=>c(Fe)||!c(oe));Gt(q,{type:"button",variant:"secondary",size:"sm",class:"gap-2",onclick:W,get disabled(){return c(Ve)},children:(ut,Dt)=>{var mt=qe(),gr=je(mt);{var yn=Ot=>{var xr=rI();N(Ot,xr)},cr=Ot=>{Wv(Ot,{size:16})};se(gr,Ot=>{c(Fe)?Ot(yn):Ot(cr,!1)})}N(ut,mt)},$$slots:{default:!0}})}var We=de(q,2);{var Qe=Ve=>{var ut=nI(),Dt=Z(ut);{let cr=Le(()=>c(Y)===0);Gt(Dt,{type:"button",class:"p-1.5 rounded hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onclick:()=>{c(Y)>0&&xe(c(Y)-1)},get disabled(){return c(cr)},title:"Previous version",children:(Ot,xr)=>{Fv(Ot,{size:14,class:"text-muted-foreground"})},$$slots:{default:!0}})}var mt=de(Dt,2),gr=Z(mt);D(mt);var yn=de(mt,2);{let cr=Le(()=>(c(Y),O(()=>c(Y)>=Ne()-1)));Gt(yn,{type:"button",class:"p-1.5 rounded hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onclick:()=>{const Ot=Ne();c(Y)<Ot-1&&xe(c(Y)+1)},get disabled(){return c(cr)},title:"Next version",children:(Ot,xr)=>{Da(Ot,{size:14,class:"text-muted-foreground"})},$$slots:{default:!0}})}D(ut),Te(cr=>Oe(gr,`${c(Y)+1} / ${cr??""}`),[()=>O(Ne)]),N(Ve,ut)};se(We,Ve=>{c(A),c(Fe),O(()=>c(A)&&!c(Fe)&&c(A).enhanced&&c(A).enhanced.length>1)&&Ve(Qe)})}var Ie=de(We,2);{var Be=Ve=>{Gt(Ve,{type:"button",variant:"ghost",size:"sm",class:"gap-2",onclick:Q,title:"Back to original text",children:(ut,Dt)=>{var mt=iI(),gr=je(mt);qv(gr,{size:16}),dr(2),N(ut,mt)},$$slots:{default:!0}})};se(Ie,Ve=>{c(A)&&!c(Fe)&&c(Y)!==0&&Ve(Be)})}D(L);var Re=de(L,2);{var or=Ve=>{var ut=oI(),Dt=de(Z(ut),2),mt=Z(Dt,!0);D(Dt),D(ut),Te(()=>Oe(mt,c(ke))),N(Ve,ut)};se(Re,Ve=>{c(Ee)&&!c(ie)&&Ve(or)})}var Vt=de(Re,2);{var ar=Ve=>{var ut=aI(),Dt=de(Z(ut),2),mt=Z(Dt,!0);D(Dt),D(ut),Te(()=>Oe(mt,c(ie))),N(Ve,ut)};se(Vt,Ve=>{c(ie)&&Ve(ar)})}N(H,ye)};se(ir,H=>{x(b()),O(()=>b().enableEnhanceWithAi)&&H(mr)})}D(me),Te(()=>{Oe(lt,`${x(b()),O(()=>b().title)??""} `),mn(Nt,1,`absolute right-5 top-1/2 -translate-y-1/2 text-xs font-medium px-2 py-1 rounded-full transition-colors whitespace-nowrap ${c(g)?"bg-destructive/10 text-destructive border border-destructive/20":"bg-muted text-muted-foreground"}`),Oe(Yt,(c(E),O(()=>c(E)?.length||0)))}),N(i,me),rt()}function cI(i){return typeof i=="function"}function dI(i){return i!==null&&typeof i=="object"}const fI=["string","number","bigint","boolean"];function Fl(i){return i==null||fI.includes(typeof i)?!0:Array.isArray(i)?i.every(n=>Fl(n)):typeof i=="object"?Object.getPrototypeOf(i)===Object.prototype:!1}const ji=Symbol("box"),Qa=Symbol("is-writable");function It(i,n){const u=ht(i);return n?{[ji]:!0,[Qa]:!0,get current(){return c(u)},set current(l){n(l)}}:{[ji]:!0,get current(){return i()}}}function Io(i){return dI(i)&&ji in i}function Ql(i){return Io(i)&&Qa in i}function pI(i){return Io(i)?i:cI(i)?It(i):hI(i)}function mI(i){return Object.entries(i).reduce((n,[u,l])=>Io(l)?(Ql(l)?Object.defineProperty(n,u,{get(){return l.current},set(d){l.current=d}}):Object.defineProperty(n,u,{get(){return l.current}}),n):Object.assign(n,{[u]:l}),{})}function gI(i){return Ql(i)?{[ji]:!0,get current(){return i.current}}:i}function hI(i){let n=Wr(zn(i));return{[ji]:!0,[Qa]:!0,get current(){return c(n)},set current(u){$(n,u,!0)}}}function ci(i){let n=Wr(zn(i));return{[ji]:!0,[Qa]:!0,get current(){return c(n)},set current(u){$(n,u,!0)}}}ci.from=pI,ci.with=It,ci.flatten=mI,ci.readonly=gI,ci.isBox=Io,ci.isWritableBox=Ql;function vI(...i){return function(n){for(const u of i)if(u){if(n.defaultPrevented)return;typeof u=="function"?u.call(this,n):u.current?.call(this,n)}}}var wb=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,bI=/\n/g,yI=/^\s*/,$I=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,wI=/^:\s*/,_I=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,kI=/^[;\s]*/,xI=/^\s+|\s+$/g,SI=`
132
+ */let u=qt(n,["$$slots","$$events","$$legacy"]);const l=[["path",{d:"m9 18 6-6-6-6"}]];Fa(i,Mt({name:"chevron-right"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Wt(h,()=>n.children??$t),N(d,m)},$$slots:{default:!0}})),rt()}var vS=ee("<li><!></li>");function bS(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=qt(n,["$$slots","$$events","$$legacy","ref","class","children"]);var d=vS();Bt(d,g=>({"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",class:g,...l}),[()=>jr("[&>svg]:size-3.5",n.class)]);var p=Z(d);{var m=g=>{var v=qe(),y=je(v);Wt(y,()=>n.children??$t),N(g,v)},h=g=>{hS(g,{})};se(p,g=>{n.children?g(m):g(h,!1)})}D(d),_r(d,g=>u(g),()=>u()),N(i,d),rt()}var yS=ee("<a><!></a>");function $S(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"href",3,void 0),d=qt(n,["$$slots","$$events","$$legacy","ref","class","href","child","children"]);const p=ht(()=>({"data-slot":"breadcrumb-link",class:jr("hover:text-foreground transition-colors",n.class),href:l(),...d}));var m=qe(),h=je(m);{var g=y=>{var k=qe(),b=je(k);Wt(b,()=>n.child,()=>({props:c(p)})),N(y,k)},v=y=>{var k=yS();Bt(k,()=>({...c(p)}));var b=Z(k);Wt(b,()=>n.children??$t),D(k),_r(k,I=>u(I),()=>u()),N(y,k)};se(h,y=>{n.child?y(g):y(v,!1)})}N(i,m),rt()}var wS=ee("<ol><!></ol>");function _S(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=qt(n,["$$slots","$$events","$$legacy","ref","class","children"]);var d=wS();Bt(d,m=>({"data-slot":"breadcrumb-list",class:m,...l}),[()=>jr("text-muted-foreground flex flex-wrap items-center gap-1.5 break-words text-sm sm:gap-2.5",n.class)]);var p=Z(d);Wt(p,()=>n.children??$t),D(d),_r(d,m=>u(m),()=>u()),N(i,d),rt()}var kS=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),xS=ee('<span class="text-destructive ml-1">*</span>'),SS=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),IS=ee("<!> <!>",1),zS=ee("<!> <!>",1),NS=On('<svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7"></path></svg>'),TS=ee('<span class="flex items-center gap-3 w-full"><span class="flex-1 text-sm font-medium"> </span> <!></span>'),jS=ee('<div class="p-2 space-y-1"></div>'),OS=ee('<div class="flex flex-col items-center justify-center py-12 px-4"><div class="w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-3"><svg class="w-6 h-6 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm font-medium text-muted-foreground">No options available</p></div>'),ES=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md border border-destructive/20"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="font-medium"> </span></div>'),CS=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <div class="border border-border rounded-xl bg-card shadow-sm overflow-hidden"><div class="px-4 py-3 bg-accent/30 border-b border-border backdrop-blur-sm"><!></div> <div class="max-h-[420px] overflow-y-auto scrollbar-thin"><!></div></div> <!></div>');function AS(i,n){tt(n,!1);const u=re();let l=w(n,"question",8),d=w(n,"value",24,()=>[]),p=w(n,"onChange",8),m=w(n,"error",8,void 0),h=w(n,"currentMode",8,void 0),g=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);const v=d()?Array.isArray(d())?d():[d()]:[];let y=re(v),k=re(T()),b=re(!1),I=re([]),S=re([]);function T(){return v.length===0?[]:v.slice(0,-1)}function G(B,fe){$(b,!0),B.children&&B.children.length>0?$(k,fe):($(y,fe),$(k,fe.slice(0,-1)),p()(fe))}function te(B){const fe=c(y);return fe.length!==B.length?!1:B.every((me,we)=>fe[we]===me)}function ae(B){let fe=l().options;for(let me=0;me<B.length;me++){const we=fe.find(De=>De.value===B[me]);if(we&&we.children)fe=we.children;else return[]}return fe}function K(B){const fe=[];let me=l().options;for(let we=0;we<B.length;we++){const De=me.find(Ge=>Ge.value===B[we]);De&&(fe.push({value:B[we],label:De.label,index:we}),De.children&&(me=De.children))}return fe}function V(B){$(b,!0),$(k,c(k).slice(0,B+1))}function E(){$(b,!0),$(k,[]),$(y,[]),p()([])}he(()=>x(h()),()=>{$(u,h()==="dark")}),he(()=>(x(d()),c(b)),()=>{if(d()!==void 0&&!c(b)){const B=Array.isArray(d())?d():[d()];$(y,B),B.length>0?$(k,B.slice(0,-1)):$(k,[])}else d()===void 0&&!c(b)&&($(y,[]),$(k,[]))}),he(()=>c(k),()=>{$(I,ae(c(k)))}),he(()=>c(k),()=>{$(S,K(c(k)))}),fr(),er();var A=CS(),Y=Z(A),ne=Z(Y);{var _e=B=>{var fe=kS(),me=Z(fe);D(fe),Te(()=>Oe(me,`${g()??""}.`)),N(B,fe)};se(ne,B=>{g()!==void 0&&B(_e)})}var Ee=de(ne,2),Fe=Z(Ee),ie=Z(Fe),ke=de(ie);{var pe=B=>{var fe=xS();N(B,fe)};se(ke,B=>{x(l()),O(()=>l().required)&&B(pe)})}D(Fe);var oe=de(Fe,2);{var ue=B=>{var fe=SS(),me=Z(fe,!0);D(fe),Te(()=>Oe(me,(x(l()),O(()=>l().description)))),N(B,fe)};se(oe,B=>{x(l()),O(()=>l().description)&&B(ue)})}D(Ee),D(Y);var J=de(Y,2),M=Z(J),R=Z(M);fS(R,{children:(B,fe)=>{_S(B,{class:"flex items-center gap-1.5 flex-wrap",children:(me,we)=>{var De=zS(),Ge=je(De);hb(Ge,{children:(Je,lt)=>{Gt(Je,{type:"button",variant:"ghost",size:"sm",class:"h-8 w-8 p-0 hover:bg-background/80 rounded-md transition-colors",onclick:E,"aria-label":"Home",children:(ft,Ue)=>{c0(ft,{size:18,class:"text-muted-foreground hover:text-foreground transition-colors"})},$$slots:{default:!0}})},$$slots:{default:!0}});var Ke=de(Ge,2);wr(Ke,1,()=>c(S),Lr,(Je,lt)=>{var ft=IS(),Ue=je(ft);bS(Ue,{class:"text-muted-foreground/50",children:(St,Ut)=>{Da(St,{size:14})},$$slots:{default:!0}});var kt=de(Ue,2);hb(kt,{children:(St,Ut)=>{$S(St,{onclick:()=>V(c(lt).index),class:"cursor-pointer text-sm font-medium text-foreground/80 hover:text-primary transition-colors px-2 py-1 rounded-md hover:bg-background/50",children:(Ft,wt)=>{dr();var zt=pn();Te(()=>Oe(zt,(c(lt),O(()=>c(lt).label)))),N(Ft,zt)},$$slots:{default:!0}})},$$slots:{default:!0}}),N(Je,ft)}),N(me,De)},$$slots:{default:!0}})},$$slots:{default:!0}}),D(M);var C=de(M,2),z=Z(C);{var Q=B=>{var fe=jS();wr(fe,5,()=>c(I),Lr,(me,we)=>{const De=Le(()=>(c(k),c(we),O(()=>te([...c(k),c(we).value])))),Ge=Le(()=>(c(we),O(()=>c(we).children&&c(we).children.length>0)));{let Ke=Le(()=>`w-full justify-start px-4 py-3.5 h-auto rounded-lg text-left transition-all relative group ${c(De)&&!c(Ge)?"bg-primary text-primary-foreground border-primary shadow-md hover:shadow-lg hover:bg-primary/90 hover:text-primary-foreground dark:hover:bg-primary":"text-foreground hover:bg-accent/50 hover:border-border/50 border border-transparent"}`);Gt(me,{type:"button",variant:"ghost",get class(){return c(Ke)},onclick:()=>G(c(we),[...c(k),c(we).value]),children:(Je,lt)=>{var ft=TS(),Ue=Z(ft),kt=Z(Ue,!0);D(Ue);var St=de(Ue,2);{var Ut=wt=>{{let zt=Le(()=>`flex-shrink-0 transition-transform group-hover:translate-x-0.5 ${c(De)?"text-primary":"text-muted-foreground"}`);Da(wt,{size:18,get class(){return c(zt)}})}},Ft=wt=>{var zt=qe(),Nt=je(zt);{var Yt=ir=>{var mr=NS();N(ir,mr)};se(Nt,ir=>{c(De)&&ir(Yt)},!0)}N(wt,zt)};se(St,wt=>{c(Ge)?wt(Ut):wt(Ft,!1)})}D(ft),Te(()=>Oe(kt,(c(we),O(()=>c(we).label)))),N(Je,ft)},$$slots:{default:!0}})}}),D(fe),N(B,fe)},W=B=>{var fe=OS();N(B,fe)};se(z,B=>{c(I),O(()=>c(I).length>0)?B(Q):B(W,!1)})}D(C),D(J);var xe=de(J,2);{var Ne=B=>{var fe=ES(),me=de(Z(fe),2),we=Z(me,!0);D(me),D(fe),Te(()=>Oe(we,m())),N(B,fe)};se(xe,B=>{m()&&B(Ne)})}D(A),Te(()=>Oe(ie,`${x(l()),O(()=>l().title)??""} `)),N(i,A),rt()}var MS=ee("<textarea></textarea>");function US(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"value",15),d=w(n,"data-slot",3,"textarea"),p=qt(n,["$$slots","$$events","$$legacy","ref","value","class","data-slot"]);var m=MS();hx(m),Bt(m,h=>({"data-slot":d(),class:h,...p}),[()=>jr("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 field-sizing-content shadow-xs flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n.class)]),_r(m,h=>u(h),()=>u()),Aa(m,l),N(i,m),rt()}function vb(i){if(!i)return{code:null,message:""};const n=i.split("|").map(u=>u.trim());if(n.length>=2){const u=n[0],l=n.slice(1).join("|").trim(),d=l.match(/(\d+)\s+seconds?/i),p=d?parseInt(d[1],10):void 0;return{code:u,message:l,seconds:p}}return{code:null,message:i}}function bb(i,n,u){let l=i;n(l);const d=setInterval(()=>{l--,n(l),l<=0&&(clearInterval(d),u())},1e3);return d}function yb(i,n,u,l){if(!u?.otherFields)return n;const{otherFields:d}=u;switch(i){case"1001":{const p=d.aiEnhancementCooldownErrorMessage||n;return l!==void 0?`${p} (${l}s)`:p}case"1002":return d.aiEnhancementMaxReachedErrorMessage||n;default:return n}}async function $b(i){return await window.encatch._internal.refineText({questionId:i.questionId,identifier:i.identifier,feedbackConfigurationId:i.feedbackConfigurationId,userText:i.userText})}var DS=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),LS=ee('<span class="text-destructive ml-1">*</span>'),PS=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),RS=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/5 px-4 mx-4 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),ZS=On('<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>'),qS=ee('<div class="flex items-center gap-1 border border-border rounded-lg p-0.5"><!> <span class="text-xs font-medium text-muted-foreground px-2"> </span> <!></div>'),FS=ee("<!> <span>Reset</span>",1),QS=ee('<div class="flex items-center gap-2 text-sm text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/30 px-3 py-2 rounded-md border border-green-200 dark:border-green-900"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg> <span class="font-medium"> </span></div>'),WS=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md border border-destructive/20"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="font-medium"> </span></div>'),GS=ee('<div class="flex items-center gap-2 flex-wrap"><!> <!> <!></div> <!> <!>',1),VS=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <div class="relative"><!> <div> </div></div> <!></div>');function JS(i,n){tt(n,!1);const u=re(),l=re(),d=re(),p=re(),m=re(),h=re(),g=re(),v=re();let y=w(n,"question",8),k=w(n,"value",8,""),b=w(n,"onChange",8),I=w(n,"error",8,void 0),S=w(n,"currentMode",8,void 0),T=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0),w(n,"apiKey",8,void 0),w(n,"hostUrl",8,void 0);let G=w(n,"identifier",8,void 0),te=w(n,"feedbackConfigurationId",8,void 0),ae=w(n,"otherConfigurationProperties",8,void 0),K=re(k()??""),V=re(null),E=re(0),A=re(I()),Y=re(!1),ne=re(!1),_e=re(!1),Ee=re(null),Fe=re(null),ie=re(!1),ke=re(!1),pe=re(""),oe=re(0),ue=null,J=re(c(K));const{updateQuestionResponse:M,setQuestionError:R}=hn();En(()=>{setTimeout(()=>{const H=z(c(K));$(A,H),H&&R(y().id,H),$(ie,!0)},0)}),bo(()=>{ue!==null&&clearInterval(ue)});function C(){c(Y)||$(Y,!0)}function z(H){if(y().required&&(!H||H.trim()===""))return y().errorMessage||"This field is required";if(y().maxCharacters!==void 0&&H.length>y().maxCharacters||y().minCharacters!==void 0&&H.length>0&&H.length<y().minCharacters)return y().errorMessage}function Q(H){ue!==null&&clearInterval(ue),ue=bb(H,ye=>{$(oe,ye)},()=>{ue=null,$(Ee,null)})}async function W(){if(!fe()||!G()||!te())return;const H=c(K);try{$(_e,!0),$(Ee,null);const ye=await $b({questionId:y().id,identifier:G(),feedbackConfigurationId:te(),userText:H});if(ye?.data?.refinedText){const L=ye.data.refinedText;$(Fe,ae()?.otherFields?.aiEnhancementSuccessMessage||ye.message||"Text refined successfully"),c(V)?($(V,{original:c(V).original,enhanced:[...c(V).enhanced,L]}),$(E,c(V).enhanced.length)):($(V,{original:H,enhanced:[L]}),$(E,1)),$(K,L),$(ne,!0);const q=z(L);$(A,q),b()(L),M(y().id,L,a.QuestionTypes.LONG_TEXT,q)}else{if(ye?.message){const{code:L,message:q,seconds:We}=vb(ye.message);L==="1001"&&We!==void 0&&Q(We),$(Ee,yb(L,q,ae(),We))}$(ne,!1)}}catch(ye){console.error("Error enhancing text:",ye),$(Ee,"An error occurred while enhancing text"),$(ne,!1)}finally{$(_e,!1)}}function xe(){if(!c(V))return;const H=c(V).original;$(K,H),$(E,0);const ye=z(H);$(A,ye),b()(H),M(y().id,H,a.QuestionTypes.LONG_TEXT,ye)}function Ne(H){if(!c(V))return;let ye;if(H===0)ye=c(V).original;else{const q=H-1;if(q>=c(V).enhanced.length)return;ye=c(V).enhanced[q]}$(K,ye),$(E,H);const L=z(ye);$(A,L),b()(ye),M(y().id,ye,a.QuestionTypes.LONG_TEXT,L)}function B(){return c(V)?c(V).enhanced.length+1:0}function fe(){const H=c(K).trim();return H?y().minCharactersToEnhance!==void 0?H.length>=y().minCharactersToEnhance:!0:!1}he(()=>x(S()),()=>{$(u,S()==="dark")}),he(()=>(x(k()),c(K),c(Y)),()=>{k()!==void 0&&k()!==c(K)&&!c(Y)&&($(K,k()),$(J,k()))}),he(()=>c(K),()=>{$(l,c(K).length)}),he(()=>x(y()),()=>{$(d,y().minCharacters)}),he(()=>x(y()),()=>{$(p,y().maxCharacters)}),he(()=>(c(p),c(l)),()=>{$(m,c(p)!==void 0&&c(l)>c(p))}),he(()=>(c(d),c(l)),()=>{$(h,c(d)!==void 0&&c(l)<c(d)&&c(l)>0)}),he(()=>(c(m),c(h)),()=>{$(g,c(m)||c(h))}),he(()=>(c(d),c(p)),()=>{$(v,c(d)!==void 0||c(p)!==void 0)}),he(()=>(c(K),x(y())),()=>{const H=c(K).trim();H?y().minCharactersToEnhance!==void 0?$(ke,H.length>=y().minCharactersToEnhance):$(ke,!0):$(ke,!1)}),he(()=>(c(d),c(p),c(l),x(y())),()=>{c(d)!==void 0&&c(p)!==void 0?$(pe,`${c(l)} / (${c(d)} - ${c(p)})`):c(p)!==void 0&&y().required?$(pe,`${c(l)} / (1 - ${c(p)})`):c(d)!==void 0?$(pe,`${c(l)} / (${c(d)} - 5000)`):$(pe,"")}),he(()=>(c(oe),x(ae())),()=>{c(oe)>0&&ae()?.otherFields?.aiEnhancementCooldownErrorMessage&&$(Ee,`${ae().otherFields.aiEnhancementCooldownErrorMessage} (${c(oe)}s)`)}),he(()=>x(I()),()=>{I()!==void 0&&$(A,I())}),he(()=>(c(ie),c(Y),c(K),c(J),x(y()),a.QuestionTypes),()=>{if(c(ie)&&c(Y)&&c(K)!==c(J)){$(J,c(K));const H=z(c(K));$(A,H),M(y().id,c(K),a.QuestionTypes.LONG_TEXT,H)}}),fr(),er();var me=VS(),we=Z(me),De=Z(we);{var Ge=H=>{var ye=DS(),L=Z(ye);D(ye),Te(()=>Oe(L,`${T()??""}.`)),N(H,ye)};se(De,H=>{T()!==void 0&&H(Ge)})}var Ke=de(De,2),Je=Z(Ke),lt=Z(Je),ft=de(lt);{var Ue=H=>{var ye=LS();N(H,ye)};se(ft,H=>{x(y()),O(()=>y().required)&&H(Ue)})}D(Je);var kt=de(Je,2);{var St=H=>{var ye=PS(),L=Z(ye,!0);D(ye),Te(()=>Oe(L,(x(y()),O(()=>y().description)))),N(H,ye)};se(kt,H=>{x(y()),O(()=>y().description)&&H(St)})}D(Ke),D(we);var Ut=de(we,2);{var Ft=H=>{var ye=RS(),L=Z(ye),q=Z(L,!0);D(L),D(ye),Te(()=>Oe(q,c(A))),N(H,ye)};se(Ut,H=>{c(A)&&c(Y)&&H(Ft)})}var wt=de(Ut,2),zt=Z(wt);{let H=Le(()=>(x(y()),O(()=>y().rows||4)));US(zt,{class:"w-full min-h-[120px] text-secondary-foreground focus-visible:ring-0 focus-visible:ring-offset-0 resize-y",onfocus:C,get placeholder(){return x(y()),O(()=>y().placeholder)},get rows(){return c(H)},onblur:()=>{if(c(ie)){const ye=z(c(K));$(A,ye),R(y().id,ye),b()(c(K))}},get value(){return c(K)},set value(ye){$(K,ye)},$$legacy:!0})}var Nt=de(zt,2),Yt=Z(Nt);D(Nt),D(wt);var ir=de(wt,2);{var mr=H=>{var ye=GS(),L=je(ye),q=Z(L);{let Ve=Le(()=>c(_e)||!c(ke));Gt(q,{type:"button",variant:"secondary",size:"sm",class:"gap-2",onclick:W,get disabled(){return c(Ve)},children:(ut,Dt)=>{var mt=qe(),gr=je(mt);{var yn=Ot=>{var xr=ZS();N(Ot,xr)},cr=Ot=>{Wv(Ot,{size:16})};se(gr,Ot=>{c(_e)?Ot(yn):Ot(cr,!1)})}N(ut,mt)},$$slots:{default:!0}})}var We=de(q,2);{var Qe=Ve=>{var ut=qS(),Dt=Z(ut);{let cr=Le(()=>c(E)===0);Gt(Dt,{type:"button",class:"p-1.5 rounded hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onclick:()=>{c(E)>0&&Ne(c(E)-1)},get disabled(){return c(cr)},title:"Previous version",children:(Ot,xr)=>{Fv(Ot,{size:14,class:"text-muted-foreground"})},$$slots:{default:!0}})}var mt=de(Dt,2),gr=Z(mt);D(mt);var yn=de(mt,2);{let cr=Le(()=>(c(E),O(()=>c(E)>=B()-1)));Gt(yn,{type:"button",class:"p-1.5 rounded hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onclick:()=>{const Ot=B();c(E)<Ot-1&&Ne(c(E)+1)},get disabled(){return c(cr)},title:"Next version",children:(Ot,xr)=>{Da(Ot,{size:14,class:"text-muted-foreground"})},$$slots:{default:!0}})}D(ut),Te(cr=>Oe(gr,`${c(E)+1} / ${cr??""}`),[()=>O(B)]),N(Ve,ut)};se(We,Ve=>{c(V),c(_e),O(()=>c(V)&&!c(_e)&&c(V).enhanced&&c(V).enhanced.length>1)&&Ve(Qe)})}var Ie=de(We,2);{var Be=Ve=>{Gt(Ve,{type:"button",variant:"ghost",size:"sm",class:"gap-2",onclick:xe,title:"Back to original text",children:(ut,Dt)=>{var mt=FS(),gr=je(mt);qv(gr,{size:16}),dr(2),N(ut,mt)},$$slots:{default:!0}})};se(Ie,Ve=>{c(V)&&!c(_e)&&c(E)!==0&&Ve(Be)})}D(L);var Re=de(L,2);{var or=Ve=>{var ut=QS(),Dt=de(Z(ut),2),mt=Z(Dt,!0);D(Dt),D(ut),Te(()=>Oe(mt,c(Fe))),N(Ve,ut)};se(Re,Ve=>{c(ne)&&!c(Ee)&&Ve(or)})}var Vt=de(Re,2);{var ar=Ve=>{var ut=WS(),Dt=de(Z(ut),2),mt=Z(Dt,!0);D(Dt),D(ut),Te(()=>Oe(mt,c(Ee))),N(Ve,ut)};se(Vt,Ve=>{c(Ee)&&Ve(ar)})}N(H,ye)};se(ir,H=>{x(y()),O(()=>y().enableEnhanceWithAi)&&H(mr)})}D(me),Te(H=>{Oe(lt,`${x(y()),O(()=>y().title)??""} `),mn(Nt,1,`absolute right-3 bottom-3 text-xs font-medium px-2 py-1 rounded-full transition-colors whitespace-nowrap ${c(g)?"bg-destructive/10 text-destructive border border-destructive/20":"bg-muted text-muted-foreground"}`),Oe(Yt,`${c(K),O(()=>c(K)?.length||0)??""}${H??""}`)},[()=>(c(pe),O(()=>c(pe)?` ${c(pe).split("/")[1]||""}`:""))]),N(i,me),rt()}var BS=ee("<input/>"),YS=ee("<input/>");function KS(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"value",15),d=w(n,"files",15),p=w(n,"data-slot",3,"input"),m=qt(n,["$$slots","$$events","$$legacy","ref","value","type","files","class","data-slot"]);var h=qe(),g=je(h);{var v=k=>{var b=BS();Bt(b,I=>({"data-slot":p(),class:I,type:"file",...m}),[()=>jr("selection:bg-primary dark:bg-input/30 selection:text-primary-foreground border-input ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 pt-1.5 text-sm font-medium outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n.class)],void 0,void 0,!0),_r(b,I=>u(I),()=>u()),Xx(b,d),Aa(b,l),N(k,b)},y=k=>{var b=YS();Bt(b,I=>({"data-slot":p(),class:I,type:n.type,...m}),[()=>jr("border-input bg-background selection:bg-primary dark:bg-input/30 selection:text-primary-foreground ring-offset-background placeholder:text-muted-foreground shadow-xs flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base outline-none transition-[color,box-shadow] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",n.class)],void 0,void 0,!0),_r(b,I=>u(I),()=>u()),Aa(b,l),N(k,b)};se(g,k=>{n.type==="file"?k(v):k(y,!1)})}N(i,h),rt()}var HS=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),XS=ee('<span class="text-destructive ml-1">*</span>'),eI=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),tI=ee('<div class="flex items-start gap-2 text-sm text-destructive bg-destructive/5 px-4 ml-2 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),rI=On('<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>'),nI=ee('<div class="flex items-center gap-1 border border-border rounded-lg p-0.5"><!> <span class="text-xs font-medium text-muted-foreground px-2"> </span> <!></div>'),iI=ee("<!> <span>Reset</span>",1),oI=ee('<div class="flex items-center gap-2 text-sm text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/30 px-3 py-2 rounded-md border border-green-200 dark:border-green-900"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg> <span class="font-medium"> </span></div>'),aI=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md border border-destructive/20"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="font-medium"> </span></div>'),sI=ee('<div class="flex items-center gap-2 flex-wrap"><!> <!> <!></div> <!> <!>',1),uI=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <div class="relative px-2"><!> <div> </div></div> <!></div>');function lI(i,n){tt(n,!1);const u=re(),l=re(),d=re(),p=re(),m=re(),h=re(),g=re(),v=re(),{updateQuestionResponse:y,setQuestionError:k}=hn();let b=w(n,"question",8),I=w(n,"value",8,""),S=w(n,"onChange",8),T=w(n,"error",8,void 0),G=w(n,"currentMode",8,void 0),te=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0),w(n,"apiKey",8,void 0),w(n,"hostUrl",8,void 0);let ae=w(n,"identifier",8,void 0),K=w(n,"feedbackConfigurationId",8,void 0),V=w(n,"otherConfigurationProperties",8,void 0),E=re(I()||""),A=re(null),Y=re(0),ne=re(T()),_e=re(!1),Ee=re(!1),Fe=re(!1),ie=re(null),ke=re(null),pe=re(!1),oe=re(!1),ue=re(""),J=re(0),M=null,R=re(c(E));En(()=>{setTimeout(()=>{const H=B(c(E));$(ne,H),H&&k(b().id,H),$(pe,!0)},0)}),bo(()=>{M!==null&&clearInterval(M)});function C(){c(_e)||$(_e,!0)}function z(H){M!==null&&clearInterval(M),M=bb(H,ye=>{$(J,ye)},()=>{M=null,$(ie,null)})}async function Q(){if(!fe())return;const H=c(E);try{$(Fe,!0),$(ie,null);const ye=await $b({questionId:b().id,identifier:ae(),feedbackConfigurationId:K(),userText:H});if(ye?.data?.refinedText){const L=ye.data.refinedText;$(ke,V()?.otherFields?.aiEnhancementSuccessMessage||ye.message||"Text refined successfully"),c(A)?($(A,{original:c(A).original,enhanced:[...c(A).enhanced,L]}),$(Y,c(A).enhanced.length)):($(A,{original:H,enhanced:[L]}),$(Y,1)),$(E,L),$(Ee,!0);const q=B(L);$(ne,q),S()(L),y(b().id,L,a.QuestionTypes.SHORT_ANSWER,q)}else{if(ye?.message){const{code:L,message:q,seconds:We}=vb(ye.message);L==="1001"&&We!==void 0&&z(We),$(ie,yb(L,q,V(),We))}$(Ee,!1)}}catch(ye){console.error("Error enhancing text:",ye),$(ie,"An error occurred while enhancing text!"),$(Ee,!1)}finally{$(Fe,!1)}}function W(){if(!c(A))return;const H=c(A).original;$(E,H),$(Y,0);const ye=B(H);$(ne,ye),S()(H),y(b().id,H,a.QuestionTypes.SHORT_ANSWER,ye)}function xe(H){if(!c(A))return;let ye;if(H===0)ye=c(A).original;else{const q=H-1;if(q>=c(A).enhanced.length)return;ye=c(A).enhanced[q]}$(E,ye),$(Y,H);const L=B(ye);$(ne,L),S()(ye),y(b().id,ye,a.QuestionTypes.SHORT_ANSWER,L)}function Ne(){return c(A)?c(A).enhanced.length+1:0}function B(H){if(b().required&&(!H||H.trim()===""))return b().errorMessage||"This field is required";if(b().maxCharacters!==void 0&&H.length>b().maxCharacters||b().minCharacters!==void 0&&H.length>0&&H.length<b().minCharacters)return b().errorMessage;if(b().enableRegexValidation&&b().regexPattern)try{const ye=new RegExp(b().regexPattern);if(H.length>0&&!ye.test(H))return b().errorMessage||"Input does not match required pattern"}catch{}}function fe(){const H=c(E).trim();return H?b().minCharactersToEnhance!==void 0?H.length>=b().minCharactersToEnhance:!0:!1}he(()=>x(G()),()=>{$(u,G()==="dark")}),he(()=>(x(I()),c(E),c(_e)),()=>{I()!==void 0&&I()!==c(E)&&!c(_e)&&($(E,I()),$(R,I()))}),he(()=>c(E),()=>{$(l,c(E).length||0)}),he(()=>x(b()),()=>{$(d,b().minCharacters)}),he(()=>x(b()),()=>{$(p,b().maxCharacters)}),he(()=>(c(p),c(l)),()=>{$(m,c(p)!==void 0&&c(l)>c(p))}),he(()=>(c(d),c(l)),()=>{$(h,c(d)!==void 0&&c(l)<c(d)&&c(l)>0)}),he(()=>(c(m),c(h)),()=>{$(g,c(m)||c(h))}),he(()=>(c(d),c(p)),()=>{$(v,c(d)!==void 0||c(p)!==void 0)}),he(()=>(c(E),x(b())),()=>{const H=c(E).trim();H?b().minCharactersToEnhance!==void 0?$(oe,H.length>=b().minCharactersToEnhance):$(oe,!0):$(oe,!1)}),he(()=>(c(E),c(d),c(p),x(b())),()=>{const H=c(E)?.length||0;c(d)!==void 0&&c(p)!==void 0?$(ue,`${H} / (${c(d)} - ${c(p)})`):c(p)!==void 0&&b().required?$(ue,`${H} / (1 - ${c(p)})`):c(d)!==void 0?$(ue,`${H} / (${c(d)} - 5000)`):$(ue,`${H}`)}),he(()=>(c(J),x(V())),()=>{c(J)>0&&V()?.otherFields?.aiEnhancementCooldownErrorMessage&&$(ie,`${V().otherFields.aiEnhancementCooldownErrorMessage} (${c(J)}s)`)}),he(()=>x(T()),()=>{T()!==void 0&&$(ne,T())}),he(()=>(c(pe),c(_e),c(E),c(R),x(b()),a.QuestionTypes),()=>{if(c(pe)&&c(_e)&&c(E)!==c(R)){$(R,c(E));const H=B(c(E));$(ne,H),y(b().id,c(E),a.QuestionTypes.SHORT_ANSWER,H)}}),fr(),er();var me=uI(),we=Z(me),De=Z(we);{var Ge=H=>{var ye=HS(),L=Z(ye);D(ye),Te(()=>Oe(L,`${te()??""}.`)),N(H,ye)};se(De,H=>{te()!==void 0&&H(Ge)})}var Ke=de(De,2),Je=Z(Ke),lt=Z(Je),ft=de(lt);{var Ue=H=>{var ye=XS();N(H,ye)};se(ft,H=>{x(b()),O(()=>b().required)&&H(Ue)})}D(Je);var kt=de(Je,2);{var St=H=>{var ye=eI(),L=Z(ye,!0);D(ye),Te(()=>Oe(L,(x(b()),O(()=>b().description)))),N(H,ye)};se(kt,H=>{x(b()),O(()=>b().description)&&H(St)})}D(Ke),D(we);var Ut=de(we,2);{var Ft=H=>{var ye=tI(),L=Z(ye),q=Z(L,!0);D(L),D(ye),Te(()=>Oe(q,c(ne))),N(H,ye)};se(Ut,H=>{c(ne)&&c(_e)&&H(Ft)})}var wt=de(Ut,2),zt=Z(wt);{let H=Le(()=>`w-full pr-20 py-5 text-secondary-foreground ${c(v)?"pr-20":""}`);KS(zt,{get class(){return c(H)},onfocus:C,get placeholder(){return x(b()),O(()=>b().placeholder)},onblur:()=>{if(c(pe)){const ye=B(c(E));$(ne,ye),k(b().id,ye),S()(c(E))}},get value(){return c(E)},set value(ye){$(E,ye)},$$legacy:!0})}var Nt=de(zt,2),Yt=Z(Nt,!0);D(Nt),D(wt);var ir=de(wt,2);{var mr=H=>{var ye=sI(),L=je(ye),q=Z(L);{let Ve=Le(()=>c(Fe)||!c(oe));Gt(q,{type:"button",variant:"secondary",size:"sm",class:"gap-2",onclick:Q,get disabled(){return c(Ve)},children:(ut,Dt)=>{var mt=qe(),gr=je(mt);{var yn=Ot=>{var xr=rI();N(Ot,xr)},cr=Ot=>{Wv(Ot,{size:16})};se(gr,Ot=>{c(Fe)?Ot(yn):Ot(cr,!1)})}N(ut,mt)},$$slots:{default:!0}})}var We=de(q,2);{var Qe=Ve=>{var ut=nI(),Dt=Z(ut);{let cr=Le(()=>c(Y)===0);Gt(Dt,{type:"button",class:"p-1.5 rounded hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onclick:()=>{c(Y)>0&&xe(c(Y)-1)},get disabled(){return c(cr)},title:"Previous version",children:(Ot,xr)=>{Fv(Ot,{size:14,class:"text-muted-foreground"})},$$slots:{default:!0}})}var mt=de(Dt,2),gr=Z(mt);D(mt);var yn=de(mt,2);{let cr=Le(()=>(c(Y),O(()=>c(Y)>=Ne()-1)));Gt(yn,{type:"button",class:"p-1.5 rounded hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onclick:()=>{const Ot=Ne();c(Y)<Ot-1&&xe(c(Y)+1)},get disabled(){return c(cr)},title:"Next version",children:(Ot,xr)=>{Da(Ot,{size:14,class:"text-muted-foreground"})},$$slots:{default:!0}})}D(ut),Te(cr=>Oe(gr,`${c(Y)+1} / ${cr??""}`),[()=>O(Ne)]),N(Ve,ut)};se(We,Ve=>{c(A),c(Fe),O(()=>c(A)&&!c(Fe)&&c(A).enhanced&&c(A).enhanced.length>1)&&Ve(Qe)})}var Ie=de(We,2);{var Be=Ve=>{Gt(Ve,{type:"button",variant:"ghost",size:"sm",class:"gap-2",onclick:W,title:"Back to original text",children:(ut,Dt)=>{var mt=iI(),gr=je(mt);qv(gr,{size:16}),dr(2),N(ut,mt)},$$slots:{default:!0}})};se(Ie,Ve=>{c(A)&&!c(Fe)&&c(Y)!==0&&Ve(Be)})}D(L);var Re=de(L,2);{var or=Ve=>{var ut=oI(),Dt=de(Z(ut),2),mt=Z(Dt,!0);D(Dt),D(ut),Te(()=>Oe(mt,c(ke))),N(Ve,ut)};se(Re,Ve=>{c(Ee)&&!c(ie)&&Ve(or)})}var Vt=de(Re,2);{var ar=Ve=>{var ut=aI(),Dt=de(Z(ut),2),mt=Z(Dt,!0);D(Dt),D(ut),Te(()=>Oe(mt,c(ie))),N(Ve,ut)};se(Vt,Ve=>{c(ie)&&Ve(ar)})}N(H,ye)};se(ir,H=>{x(b()),O(()=>b().enableEnhanceWithAi)&&H(mr)})}D(me),Te(()=>{Oe(lt,`${x(b()),O(()=>b().title)??""} `),mn(Nt,1,`absolute right-5 top-1/2 -translate-y-1/2 text-xs font-medium px-2 py-1 rounded-full transition-colors whitespace-nowrap ${c(g)?"bg-destructive/10 text-destructive border border-destructive/20":"bg-muted text-muted-foreground"}`),Oe(Yt,(c(E),O(()=>c(E)?.length||0)))}),N(i,me),rt()}function cI(i){return typeof i=="function"}function dI(i){return i!==null&&typeof i=="object"}const fI=["string","number","bigint","boolean"];function Fl(i){return i==null||fI.includes(typeof i)?!0:Array.isArray(i)?i.every(n=>Fl(n)):typeof i=="object"?Object.getPrototypeOf(i)===Object.prototype:!1}const ji=Symbol("box"),Qa=Symbol("is-writable");function It(i,n){const u=ht(i);return n?{[ji]:!0,[Qa]:!0,get current(){return c(u)},set current(l){n(l)}}:{[ji]:!0,get current(){return i()}}}function Io(i){return dI(i)&&ji in i}function Ql(i){return Io(i)&&Qa in i}function pI(i){return Io(i)?i:cI(i)?It(i):hI(i)}function mI(i){return Object.entries(i).reduce((n,[u,l])=>Io(l)?(Ql(l)?Object.defineProperty(n,u,{get(){return l.current},set(d){l.current=d}}):Object.defineProperty(n,u,{get(){return l.current}}),n):Object.assign(n,{[u]:l}),{})}function gI(i){return Ql(i)?{[ji]:!0,get current(){return i.current}}:i}function hI(i){let n=Wr(zn(i));return{[ji]:!0,[Qa]:!0,get current(){return c(n)},set current(u){$(n,u,!0)}}}function ci(i){let n=Wr(zn(i));return{[ji]:!0,[Qa]:!0,get current(){return c(n)},set current(u){$(n,u,!0)}}}ci.from=pI,ci.with=It,ci.flatten=mI,ci.readonly=gI,ci.isBox=Io,ci.isWritableBox=Ql;function vI(...i){return function(n){for(const u of i)if(u){if(n.defaultPrevented)return;typeof u=="function"?u.call(this,n):u.current?.call(this,n)}}}var wb=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,bI=/\n/g,yI=/^\s*/,$I=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,wI=/^:\s*/,_I=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,kI=/^[;\s]*/,xI=/^\s+|\s+$/g,SI=`
133
133
  `,_b="/",kb="*",di="",II="comment",zI="declaration";function NI(i,n){if(typeof i!="string")throw new TypeError("First argument must be a string");if(!i)return[];n=n||{};var u=1,l=1;function d(S){var T=S.match(bI);T&&(u+=T.length);var G=S.lastIndexOf(SI);l=~G?S.length-G:l+S.length}function p(){var S={line:u,column:l};return function(T){return T.position=new m(S),v(),T}}function m(S){this.start=S,this.end={line:u,column:l},this.source=n.source}m.prototype.content=i;function h(S){var T=new Error(n.source+":"+u+":"+l+": "+S);if(T.reason=S,T.filename=n.source,T.line=u,T.column=l,T.source=i,!n.silent)throw T}function g(S){var T=S.exec(i);if(T){var G=T[0];return d(G),i=i.slice(G.length),T}}function v(){g(yI)}function y(S){var T;for(S=S||[];T=k();)T!==!1&&S.push(T);return S}function k(){var S=p();if(!(_b!=i.charAt(0)||kb!=i.charAt(1))){for(var T=2;di!=i.charAt(T)&&(kb!=i.charAt(T)||_b!=i.charAt(T+1));)++T;if(T+=2,di===i.charAt(T-1))return h("End of comment missing");var G=i.slice(2,T-2);return l+=2,d(G),i=i.slice(T),l+=2,S({type:II,comment:G})}}function b(){var S=p(),T=g($I);if(T){if(k(),!g(wI))return h("property missing ':'");var G=g(_I),te=S({type:zI,property:xb(T[0].replace(wb,di)),value:G?xb(G[0].replace(wb,di)):di});return g(kI),te}}function I(){var S=[];y(S);for(var T;T=b();)T!==!1&&(S.push(T),y(S));return S}return v(),I()}function xb(i){return i?i.replace(xI,di):di}function TI(i,n){let u=null;if(!i||typeof i!="string")return u;const l=NI(i),d=typeof n=="function";return l.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:h}=p;d?n(m,h,p):h&&(u=u||{},u[m]=h)}),u}const jI=/\d/,OI=["-","_","/","."];function EI(i=""){if(!jI.test(i))return i!==i.toLowerCase()}function CI(i){const n=[];let u="",l,d;for(const p of i){const m=OI.includes(p);if(m===!0){n.push(u),u="",l=void 0;continue}const h=EI(p);if(d===!1){if(l===!1&&h===!0){n.push(u),u=p,l=h;continue}if(l===!0&&h===!1&&u.length>1){const g=u.at(-1);n.push(u.slice(0,Math.max(0,u.length-1))),u=g+p,l=h;continue}}u+=p,l=h,d=m}return n.push(u),n}function Sb(i){return i?CI(i).map(n=>MI(n)).join(""):""}function AI(i){return UI(Sb(i||""))}function MI(i){return i?i[0].toUpperCase()+i.slice(1):""}function UI(i){return i?i[0].toLowerCase()+i.slice(1):""}function Wa(i){if(!i)return{};const n={};function u(l,d){if(l.startsWith("-moz-")||l.startsWith("-webkit-")||l.startsWith("-ms-")||l.startsWith("-o-")){n[Sb(l)]=d;return}if(l.startsWith("--")){n[l]=d;return}n[AI(l)]=d}return TI(i,u),n}function DI(...i){return(...n)=>{for(const u of i)typeof u=="function"&&u(...n)}}function LI(i,n){const u=RegExp(i,"g");return l=>{if(typeof l!="string")throw new TypeError(`expected an argument of type string, but got ${typeof l}`);return l.match(u)?l.replace(u,n):l}}const PI=LI(/[A-Z]/,i=>`-${i.toLowerCase()}`);function RI(i){if(!i||typeof i!="object"||Array.isArray(i))throw new TypeError(`expected an argument of type object, but got ${typeof i}`);return Object.keys(i).map(n=>`${PI(n)}: ${i[n]};`).join(`
134
134
  `)}function Ib(i={}){return RI(i).replace(`
135
135
  `," ")}const ZI=["onabort","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onauxclick","onbeforeinput","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncompositionend","oncompositionstart","oncompositionupdate","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onfocusin","onfocusout","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectionchange","onselectstart","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onvolumechange","onwaiting","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel"],qI=new Set(ZI);function FI(i){return qI.has(i)}function zo(...i){const n={...i[0]};for(let u=1;u<i.length;u++){const l=i[u];if(l){for(const d of Object.keys(l)){const p=n[d],m=l[d],h=typeof p=="function",g=typeof m=="function";if(h&&FI(d)){const v=p,y=m;n[d]=vI(v,y)}else if(h&&g)n[d]=DI(p,m);else if(d==="class"){const v=Fl(p),y=Fl(m);v&&y?n[d]=yo(p,m):v?n[d]=yo(p):y&&(n[d]=yo(m))}else if(d==="style"){const v=typeof p=="object",y=typeof m=="object",k=typeof p=="string",b=typeof m=="string";if(v&&y)n[d]={...p,...m};else if(v&&b){const I=Wa(m);n[d]={...p,...I}}else if(k&&y){const I=Wa(p);n[d]={...I,...m}}else if(k&&b){const I=Wa(p),S=Wa(m);n[d]={...I,...S}}else v?n[d]=p:y?n[d]=m:k?n[d]=p:b&&(n[d]=m)}else n[d]=m!==void 0?m:p}for(const d of Object.getOwnPropertySymbols(l)){const p=n[d],m=l[d];n[d]=m!==void 0?m:p}}}return typeof n.style=="object"&&(n.style=Ib(n.style).replaceAll(`
@@ -176,7 +176,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
176
176
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
177
177
  * SOFTWARE.
178
178
  *
179
- */let u=qt(n,["$$slots","$$events","$$legacy"]);const l=[["circle",{cx:"12",cy:"12",r:"10"}]];Fa(i,Mt({name:"circle"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Wt(h,()=>n.children??$t),N(d,m)},$$slots:{default:!0}})),rt()}var z1=ee('<div data-slot="radio-group-indicator" class="relative flex items-center justify-center"><!></div>');function N1(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=qt(n,["$$slots","$$events","$$legacy","ref","class"]);var d=qe(),p=je(d);{const m=(g,v)=>{let y=()=>v?.().checked;var k=z1(),b=Z(k);{var I=S=>{I1(S,{class:"fill-primary absolute left-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})};se(b,S=>{y()&&S(I)})}D(k),N(g,k)};let h=ht(()=>jr("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 shadow-xs aspect-square size-4 shrink-0 rounded-full border outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n.class));Ca(p,()=>x1,(g,v)=>{v(g,Mt({"data-slot":"radio-group-item",get class(){return c(h)}},()=>l,{get ref(){return u()},set ref(y){u(y)},children:m,$$slots:{default:!0}}))})}N(i,d),rt()}var T1=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),j1=ee('<span class="text-destructive ml-1">*</span>'),O1=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),E1=ee(' <div class="flex items-center space-x-3"><!> <label class="text-sm font-medium cursor-pointer text-foreground hover:text-primary transition-colors select-none"> </label></div>',1),C1=ee(" <!>",1),A1=ee(" <!>",1),M1=ee(' <p class="text-sm text-muted-foreground">No options available</p>',1),U1=ee(" <!>",1),D1=ee(' <div class="flex flex-wrap gap-2 px-4"></div>',1),L1=ee('<p class="text-sm text-muted-foreground">No options available</p>'),P1=ee(" <!>",1),R1=On('<svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7"></path></svg>'),Z1=ee('<span class="flex-1"> </span> <!>',1),q1=ee(' <div class="flex flex-col gap-2 w-full px-2"></div>',1),F1=ee('<p class="text-sm text-muted-foreground">No options available</p>'),Q1=ee(" <!>",1),W1=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md border border-destructive/20"><span class="font-medium"> </span></div>'),G1=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <!></div>');function V1(i,n){tt(n,!1);const u=re();let l=w(n,"question",8),d=w(n,"value",8,""),p=w(n,"onChange",8),m=w(n,"error",8,void 0),h=w(n,"currentMode",8,void 0),g=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);let v=re(d()||"");function y(ie){c(v)===ie?($(v,""),p()("")):($(v,ie),p()(ie))}he(()=>x(l()),()=>{l()&&console.log(`🟢 [MultipleChoiceSingle] Question received for ${l().id}:`,{id:l().id,type:l().type,title:l().title,displayStyle:l().displayStyle,hasOptions:"options"in l(),options:l().options,optionsType:typeof l().options,isArray:Array.isArray(l().options),optionsLength:Array.isArray(l().options)?l().options.length:"N/A",optionsCheck:l().options&&Array.isArray(l().options)&&l().options.length>0,fullQuestion:l()})}),he(()=>x(h()),()=>{$(u,h()==="dark")}),he(()=>x(d()),()=>{d()!==void 0&&$(v,d())}),fr(),er();var k=G1(),b=Z(k),I=Z(b);{var S=ie=>{var ke=T1(),pe=Z(ke);D(ke),Te(()=>Oe(pe,`${g()??""}.`)),N(ie,ke)};se(I,ie=>{g()!==void 0&&ie(S)})}var T=de(I,2),G=Z(T),te=Z(G),ae=de(te);{var K=ie=>{var ke=j1();N(ie,ke)};se(ae,ie=>{x(l()),O(()=>l().required)&&ie(K)})}D(G);var V=de(G,2);{var E=ie=>{var ke=O1(),pe=Z(ke,!0);D(ke),Te(()=>Oe(pe,(x(l()),O(()=>l().description)))),N(ie,ke)};se(V,ie=>{x(l()),O(()=>l().description)&&ie(E)})}D(T),D(b);var A=de(b),Y=de(A);{var ne=ie=>{var ke=U1(),pe=je(ke),oe=de(pe);{var ue=M=>{var R=A1(),C=je(R),z=de(C);S1(z,{get value(){return c(v)},class:"flex flex-col gap-3",children:(W,Q)=>{dr();var xe=C1(),Ne=je(xe),B=de(Ne);wr(B,1,()=>(x(l()),O(()=>l().options)),fe=>fe.value,(fe,me)=>{dr();var we=E1(),De=je(we),Ge=de(De),Ke=Z(Ge);{let ft=Le(()=>(x(l()),c(me),O(()=>`${l().id}-${c(me).value}`)));N1(Ke,{get value(){return c(me),O(()=>c(me).value)},get id(){return c(ft)},onclick:()=>y(c(me).value),class:`h-5 w-5 rounded-full border-2 cursor-pointer transition-all
179
+ */let u=qt(n,["$$slots","$$events","$$legacy"]);const l=[["circle",{cx:"12",cy:"12",r:"10"}]];Fa(i,Mt({name:"circle"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Wt(h,()=>n.children??$t),N(d,m)},$$slots:{default:!0}})),rt()}var z1=ee('<div data-slot="radio-group-indicator" class="relative flex items-center justify-center"><!></div>');function N1(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=qt(n,["$$slots","$$events","$$legacy","ref","class"]);var d=qe(),p=je(d);{const m=(g,v)=>{let y=()=>v?.().checked;var k=z1(),b=Z(k);{var I=S=>{I1(S,{class:"fill-primary absolute left-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})};se(b,S=>{y()&&S(I)})}D(k),N(g,k)};let h=ht(()=>jr("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 shadow-xs aspect-square size-4 shrink-0 rounded-full border outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n.class));Ca(p,()=>x1,(g,v)=>{v(g,Mt({"data-slot":"radio-group-item",get class(){return c(h)}},()=>l,{get ref(){return u()},set ref(y){u(y)},children:m,$$slots:{default:!0}}))})}N(i,d),rt()}var T1=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),j1=ee('<span class="text-destructive ml-1">*</span>'),O1=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),E1=ee(' <div class="flex items-center space-x-3"><!> <label class="text-sm font-medium cursor-pointer text-foreground hover:text-primary transition-colors select-none"> </label></div>',1),C1=ee(" <!>",1),A1=ee(" <!>",1),M1=ee(' <p class="text-sm text-muted-foreground">No options available</p>',1),U1=ee(" <!>",1),D1=ee(' <div class="flex flex-wrap gap-2 px-4"></div>',1),L1=ee('<p class="text-sm text-muted-foreground">No options available</p>'),P1=ee(" <!>",1),R1=On('<svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7"></path></svg>'),Z1=ee('<span class="flex-1"> </span> <!>',1),q1=ee(' <div class="flex flex-col gap-2 w-full px-2"></div>',1),F1=ee('<p class="text-sm text-muted-foreground">No options available</p>'),Q1=ee(" <!>",1),W1=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md border border-destructive/20"><span class="font-medium"> </span></div>'),G1=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <!></div>');function V1(i,n){tt(n,!1);const u=re();let l=w(n,"question",8),d=w(n,"value",8,""),p=w(n,"onChange",8),m=w(n,"error",8,void 0),h=w(n,"currentMode",8,void 0),g=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);let v=re(d()||"");function y(ie){c(v)===ie?($(v,""),p()("")):($(v,ie),p()(ie))}he(()=>x(l()),()=>{l()&&console.log(`🟢 [MultipleChoiceSingle] Question received for ${l().id}:`,{id:l().id,type:l().type,title:l().title,displayStyle:l().displayStyle,hasOptions:"options"in l(),options:l().options,optionsType:typeof l().options,isArray:Array.isArray(l().options),optionsLength:Array.isArray(l().options)?l().options.length:"N/A",optionsCheck:l().options&&Array.isArray(l().options)&&l().options.length>0,fullQuestion:l()})}),he(()=>x(h()),()=>{$(u,h()==="dark")}),he(()=>x(d()),()=>{d()!==void 0&&$(v,d())}),fr(),er();var k=G1(),b=Z(k),I=Z(b);{var S=ie=>{var ke=T1(),pe=Z(ke);D(ke),Te(()=>Oe(pe,`${g()??""}.`)),N(ie,ke)};se(I,ie=>{g()!==void 0&&ie(S)})}var T=de(I,2),G=Z(T),te=Z(G),ae=de(te);{var K=ie=>{var ke=j1();N(ie,ke)};se(ae,ie=>{x(l()),O(()=>l().required)&&ie(K)})}D(G);var V=de(G,2);{var E=ie=>{var ke=O1(),pe=Z(ke,!0);D(ke),Te(()=>Oe(pe,(x(l()),O(()=>l().description)))),N(ie,ke)};se(V,ie=>{x(l()),O(()=>l().description)&&ie(E)})}D(T),D(b);var A=de(b),Y=de(A);{var ne=ie=>{var ke=U1(),pe=je(ke),oe=de(pe);{var ue=M=>{var R=A1(),C=je(R),z=de(C);S1(z,{class:"flex flex-col gap-3",get value(){return c(v)},set value(Q){$(v,Q)},children:(Q,W)=>{dr();var xe=C1(),Ne=je(xe),B=de(Ne);wr(B,1,()=>(x(l()),O(()=>l().options)),fe=>fe.value,(fe,me)=>{dr();var we=E1(),De=je(we),Ge=de(De),Ke=Z(Ge);{let ft=Le(()=>(x(l()),c(me),O(()=>`${l().id}-${c(me).value}`)));N1(Ke,{get value(){return c(me),O(()=>c(me).value)},get id(){return c(ft)},onclick:()=>y(c(me).value),class:`h-5 w-5 rounded-full border-2 cursor-pointer transition-all
180
180
  data-[state=checked]:border-primary
181
181
  data-[state=checked]:bg-primary
182
182
  dark:data-[state=checked]:bg-primary
@@ -189,8 +189,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
189
189
  [&_[data-slot=radio-group-indicator]_svg]:fill-primary-foreground
190
190
  [&_[data-slot=radio-group-indicator]_svg]:stroke-primary-foreground
191
191
  dark:[&_[data-slot=radio-group-indicator]_svg]:fill-primary-foreground
192
- dark:[&_[data-slot=radio-group-indicator]_svg]:stroke-primary-foreground`})}var Je=de(Ke,2),lt=Z(Je,!0);D(Je),D(Ge),Te(ft=>{Oe(De,`${ft??""} `),si(Je,"for",(x(l()),c(me),O(()=>`${l().id}-${c(me).value}`))),Oe(lt,(c(me),O(()=>c(me).label)))},[()=>(x(l()),c(me),O(()=>(console.log(`🟡 [MultipleChoiceSingle] INSIDE EACH LOOP - Rendering option for ${l().id}:`,{option:c(me),optionValue:c(me).value,optionLabel:c(me).label,optionId:c(me).id}),"")))]),N(fe,we)}),Te(fe=>Oe(Ne,`${fe??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Inside RadioGroup.Root, about to iterate options for ${l().id}`),console.log("🟡 [MultipleChoiceSingle] Options array:",l().options),console.log("🟡 [MultipleChoiceSingle] Options length:",l().options.length),"")))]),N(W,xe)},$$slots:{default:!0}}),Te((W,Q)=>Oe(C,`${W??""}
193
- ${Q??""} `),[()=>(x(l()),c(v),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Rendering radio options for ${l().id}:`,{optionsCount:l().options.length,options:l().options,displayStyle:l().displayStyle,selectedValue:c(v),conditionPassed:!0}),""))),()=>(x(l()),c(v),O(()=>(console.log(`🟡 [MultipleChoiceSingle] About to render RadioGroup.Root for ${l().id}`,{selectedValue:c(v),optionsArray:l().options,optionsLength:l().options.length,firstOption:l().options[0]}),"")))]),N(M,R)},J=M=>{var R=M1(),C=je(R);dr(),Te(z=>Oe(C,`${z??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] NO OPTIONS - Condition failed for ${l().id}:`,{hasOptions:!!l().options,isArray:Array.isArray(l().options),length:l().options?Array.isArray(l().options)?l().options.length:"not array":"undefined",options:l().options,conditionCheck:l().options&&Array.isArray(l().options)&&l().options.length>0}),"")))]),N(M,R)};se(oe,M=>{x(l()),O(()=>l().options&&Array.isArray(l().options)&&l().options.length>0)?M(ue):M(J,!1)})}Te(M=>Oe(pe,`${M??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Entering radio rendering block for ${l().id}`),"")))]),N(ie,ke)},_e=ie=>{var ke=qe(),pe=je(ke);{var oe=J=>{var M=P1(),R=je(M),C=de(R);{var z=Q=>{var xe=D1(),Ne=je(xe),B=de(Ne);wr(B,5,()=>(x(l()),O(()=>l().options)),Lr,(fe,me)=>{{let we=Le(()=>(c(v),c(me),O(()=>`rounded-full px-4 py-2 text-sm font-medium transition-all hover:scale-105 ${c(v)===c(me).value?"bg-primary/10 text-primary border-primary border-[2px] hover:bg-primary/50 hover:text-primary-foreground dark:border-primary/90 dark:bg-primary dark:hover:bg-primary":"bg-card text-card-foreground border-[2px] hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"}`)));Gt(fe,{type:"button",variant:"outline",get class(){return c(we)},onclick:()=>y(c(me).value),children:(De,Ge)=>{dr();var Ke=pn();Te(()=>Oe(Ke,(c(me),O(()=>c(me).label)))),N(De,Ke)},$$slots:{default:!0}})}}),D(B),Te(fe=>Oe(Ne,`${fe??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Rendering chip options for ${l().id}:`,{optionsCount:l().options.length,options:l().options}),"")))]),N(Q,xe)},W=Q=>{var xe=L1();N(Q,xe)};se(C,Q=>{x(l()),O(()=>l().options&&Array.isArray(l().options)&&l().options.length>0)?Q(z):Q(W,!1)})}Te(Q=>Oe(R,`${Q??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Checking chip display for ${l().id}`),"")))]),N(J,M)},ue=J=>{var M=qe(),R=je(M);{var C=W=>{var Q=Q1(),xe=je(Q),Ne=de(xe);{var B=me=>{var we=q1(),De=je(we),Ge=de(De);wr(Ge,5,()=>(x(l()),O(()=>l().options)),Lr,(Ke,Je)=>{{let lt=Le(()=>(c(v),c(Je),O(()=>`justify-start text-left px-4 py-6 text-sm font-medium transition-all rounded-lg shadow-none relative ${c(v)===c(Je).value?"bg-primary/10 text-primary border-primary border-[2px] hover:bg-primary/50 hover:text-primary-foreground dark:border-primary/90 dark:bg-primary dark:hover:bg-primary":"bg-card text-card-foreground border-[2px] hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"}`)));Gt(Ke,{type:"button",variant:"outline",get class(){return c(lt)},onclick:()=>y(c(Je).value),onkeydown:ft=>ft.key==="Enter"&&y(c(Je).value),children:(ft,Ue)=>{var kt=Z1(),St=je(kt),Ut=Z(St,!0);D(St);var Ft=de(St,2);{var wt=zt=>{var Nt=R1();N(zt,Nt)};se(Ft,zt=>{c(v),c(Je),O(()=>c(v)===c(Je).value)&&zt(wt)})}Te(()=>Oe(Ut,(c(Je),O(()=>c(Je).label)))),N(ft,kt)},$$slots:{default:!0}})}}),D(Ge),Te(Ke=>Oe(De,`${Ke??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Rendering list options for ${l().id}:`,{optionsCount:l().options.length,options:l().options}),"")))]),N(me,we)},fe=me=>{var we=F1();N(me,we)};se(Ne,me=>{x(l()),O(()=>l().options&&Array.isArray(l().options)&&l().options.length>0)?me(B):me(fe,!1)})}Te(me=>Oe(xe,`${me??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Checking list display for ${l().id}`),"")))]),N(W,Q)},z=W=>{var Q=pn();Te(xe=>Oe(Q,xe),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Unknown display style for ${l().id}:`,{displayStyle:l().displayStyle,hasOptions:!!l().options,options:l().options}),"")))]),N(W,Q)};se(R,W=>{x(l()),O(()=>l().displayStyle==="list")?W(C):W(z,!1)},!0)}N(J,M)};se(pe,J=>{x(l()),O(()=>l().displayStyle==="chip")?J(oe):J(ue,!1)},!0)}N(ie,ke)};se(Y,ie=>{x(l()),O(()=>l().displayStyle==="radio"||!l().displayStyle)?ie(ne):ie(_e,!1)})}var Ee=de(Y,2);{var Fe=ie=>{var ke=W1(),pe=Z(ke),oe=Z(pe,!0);D(pe),D(ke),Te(()=>Oe(oe,m())),N(ie,ke)};se(Ee,ie=>{m()&&ie(Fe)})}D(k),Te(ie=>{Oe(te,`${x(l()),O(()=>l().title)??""} `),Oe(A,` ${ie??""} `)},[()=>(x(l()),O(()=>(()=>{const ie=l().displayStyle,ke=ie==="radio"||!ie;return console.log(`🟡 [MultipleChoiceSingle] Display style check for ${l().id}:`,{displayStyle:ie,displayStyleType:typeof ie,isRadio:ke,willRenderRadio:ke,hasOptions:!!l().options,optionsIsArray:Array.isArray(l().options),optionsLength:Array.isArray(l().options)?l().options.length:"N/A"}),""})()))]),N(i,k),rt()}var J1=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),B1=ee('<span class="text-destructive ml-1">*</span>'),Y1=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),K1=ee("<span> </span>"),H1=ee('<span class="text-xs xs:text-xs text-muted-foreground font-medium"> </span>'),X1=ee('<span class="text-xs xs:text-xs text-muted-foreground font-medium text-right"> </span>'),ez=ee('<div class="flex justify-between items-center px-1 sm:px-2"><!> <!></div>'),tz=ee('<div class="flex items-start gap-2 text-sm text-destructive bg-destructive/5 px-4 ml-2 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),rz=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <div class="flex flex-col gap-3 pt-2"><div></div> <!></div> <!></div>');function nz(i,n){tt(n,!1);const u=re(),l=re(),d=re(),{removeQuestionResponse:p}=hn();let m=w(n,"question",8),h=w(n,"value",8,0),g=w(n,"onChange",8),v=w(n,"error",8,void 0),y=w(n,"currentMode",8,void 0),k=w(n,"questionNumber",8,void 0),b=w(n,"themeSettings",8,void 0);w(n,"currentLanguage",8,void 0);let I=re(h()??0),S=re(h()??0),T=re(0);function G(R){c(S)===R?($(I,0),$(S,0),g()(0),p(m().id)):($(I,R),$(S,R),g()(R))}function te(R,C,z){const{displayStyle:W="star",representationSize:Q="medium",numberOfRatings:xe=5,color:Ne}=m(),B=typeof window<"u"&&window.innerWidth<640?"small":Q,fe=C>=R,me=C===R,we=z===R,De=z>=R,Ge=`rating-icon ${B}-size ${fe?"selected":""} ${c(l)?"dark-mode":""}`,Ke=W==="emoji"||W==="thumbs-up",Je=Ne??c(d)?.brandColor??"var(--brand-color)";let lt="";if(Ke?lt=`opacity: ${(W==="thumbs-up"?fe||De:me||we)?"1":"0.4"}; transform: scale(${W==="thumbs-up"&&me||W==="emoji"&&me?"1.1":"1"}); transition: opacity 0.2s ease, transform 0.2s ease;`:lt=`color: ${fe?Je:c(l)?"#4b5563":"#d1d5db"}; transition: color 0.25s ease;`,W==="emoji"){const Ue=["😡","😞","😕","😐","🙂","😊","😄","😁","🤩","😍"],kt=Math.floor((R-1)*(Ue.length/xe)),St=Math.min(Math.max(kt,0),Ue.length-1);return{content:Ue[St],type:"emoji",style:lt,baseClass:`${Ge} rating-${W}-icon`}}const ft={star:"★",heart:"♥","thumbs-up":"👍",diamond:"◆"}[W];return ft?{content:ft,type:W,style:lt,baseClass:`${Ge} rating-${W}-icon`}:null}he(()=>x(m()),()=>{$(u,m().displayStyle==="emoji"||m().displayStyle==="thumbs-up")}),he(()=>x(y()),()=>{$(l,y()==="dark")}),he(()=>(x(b()),x(y())),()=>{$(d,b()?.[y()==="dark"?"dark":"light"]||null)}),he(()=>x(h()),()=>{h()!==void 0&&($(I,h()),$(S,h()))}),fr(),er();var ae=rz(),K=Z(ae),V=Z(K);{var E=R=>{var C=J1(),z=Z(C);D(C),Te(()=>Oe(z,`${k()??""}.`)),N(R,C)};se(V,R=>{k()!==void 0&&R(E)})}var A=de(V,2),Y=Z(A),ne=Z(Y),_e=de(ne);{var Ee=R=>{var C=B1();N(R,C)};se(_e,R=>{x(m()),O(()=>m().required)&&R(Ee)})}D(Y);var Fe=de(Y,2);{var ie=R=>{var C=Y1(),z=Z(C,!0);D(C),Te(()=>Oe(z,(x(m()),O(()=>m().description)))),N(R,C)};se(Fe,R=>{x(m()),O(()=>m().description)&&R(ie)})}D(A),D(K);var ke=de(K,2),pe=Z(ke);wr(pe,5,()=>(x(m()),O(()=>Array.from({length:m().numberOfRatings??5},(R,C)=>C+1))),Lr,(R,C)=>{const z=Le(()=>(c(C),c(I),c(T),O(()=>te(c(C),c(I),c(T))))),W=Le(()=>(x(m()),O(()=>m().numberOfRatings??5))),Q=Le(()=>c(W)>10?"p-0.5 xs:p-1 sm:p-1.5":c(W)>7?"p-1 xs:p-1.5 sm:p-2":"p-1.5 xs:p-2 sm:p-2.5"),xe=Le(()=>c(W)>10?"text-base xs:text-lg sm:text-xl":c(W)>7?"text-lg xs:text-xl sm:text-2xl":"text-xl xs:text-2xl sm:text-3xl");var Ne=qe(),B=je(Ne);{var fe=me=>{{let we=Le(()=>c(Q)),De=Le(()=>c(u)?"":"hover:scale-110");Gt(me,{type:"button",variant:"ghost",size:"icon",get class(){return`h-auto w-auto ${c(we)??""} rounded-lg hover:bg-accent transition-all flex-shrink-0 ${c(De)??""}`},onclick:()=>G(c(C)),onmouseenter:()=>{$(I,c(C)),$(T,c(C))},onmouseleave:()=>{$(T,0),$(I,c(S))},children:(Ge,Ke)=>{var Je=K1(),lt=Z(Je,!0);D(Je),Te(()=>{mn(Je,1,`${x(c(z)),O(()=>c(z).baseClass)??""} ${c(u)?`${c(xe)} leading-none`:""}`),$o(Je,(x(c(z)),O(()=>c(z).style))),Oe(lt,(x(c(z)),O(()=>c(z).content)))}),N(Ge,Je)},$$slots:{default:!0}})}};se(B,me=>{c(z)&&me(fe)})}N(R,Ne)}),D(pe);var oe=de(pe,2);{var ue=R=>{var C=ez(),z=Z(C);{var W=Ne=>{var B=H1(),fe=Z(B,!0);D(B),Te(()=>Oe(fe,(x(m()),O(()=>m().minLabel)))),N(Ne,B)};se(z,Ne=>{x(m()),O(()=>m().minLabel)&&Ne(W)})}var Q=de(z,2);{var xe=Ne=>{var B=X1(),fe=Z(B,!0);D(B),Te(()=>Oe(fe,(x(m()),O(()=>m().maxLabel)))),N(Ne,B)};se(Q,Ne=>{x(m()),O(()=>m().maxLabel)&&Ne(xe)})}D(C),N(R,C)};se(oe,R=>{x(m()),O(()=>m().showLabels)&&R(ue)})}D(ke);var J=de(ke,2);{var M=R=>{var C=tz(),z=Z(C),W=Z(z,!0);D(z),D(C),Te(()=>Oe(W,v())),N(R,C)};se(J,R=>{v()&&R(M)})}D(ae),Te(()=>{Oe(ne,`${x(m()),O(()=>m().title)??""} `),mn(pe,1,`flex ${c(u)?"gap-0":"gap-0.5 xs:gap-1 sm:gap-1.5 md:gap-2"} justify-center items-center w-full`)}),N(i,ae),rt()}function iz(i,n){tt(n,!0);/**
192
+ dark:[&_[data-slot=radio-group-indicator]_svg]:stroke-primary-foreground`})}var Je=de(Ke,2),lt=Z(Je,!0);D(Je),D(Ge),Te(ft=>{Oe(De,`${ft??""} `),si(Je,"for",(x(l()),c(me),O(()=>`${l().id}-${c(me).value}`))),Oe(lt,(c(me),O(()=>c(me).label)))},[()=>(x(l()),c(me),O(()=>(console.log(`🟡 [MultipleChoiceSingle] INSIDE EACH LOOP - Rendering option for ${l().id}:`,{option:c(me),optionValue:c(me).value,optionLabel:c(me).label,optionId:c(me).id}),"")))]),N(fe,we)}),Te(fe=>Oe(Ne,`${fe??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Inside RadioGroup.Root, about to iterate options for ${l().id}`),console.log("🟡 [MultipleChoiceSingle] Options array:",l().options),console.log("🟡 [MultipleChoiceSingle] Options length:",l().options.length),"")))]),N(Q,xe)},$$slots:{default:!0},$$legacy:!0}),Te((Q,W)=>Oe(C,`${Q??""}
193
+ ${W??""} `),[()=>(x(l()),c(v),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Rendering radio options for ${l().id}:`,{optionsCount:l().options.length,options:l().options,displayStyle:l().displayStyle,selectedValue:c(v),conditionPassed:!0}),""))),()=>(x(l()),c(v),O(()=>(console.log(`🟡 [MultipleChoiceSingle] About to render RadioGroup.Root for ${l().id}`,{selectedValue:c(v),optionsArray:l().options,optionsLength:l().options.length,firstOption:l().options[0]}),"")))]),N(M,R)},J=M=>{var R=M1(),C=je(R);dr(),Te(z=>Oe(C,`${z??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] NO OPTIONS - Condition failed for ${l().id}:`,{hasOptions:!!l().options,isArray:Array.isArray(l().options),length:l().options?Array.isArray(l().options)?l().options.length:"not array":"undefined",options:l().options,conditionCheck:l().options&&Array.isArray(l().options)&&l().options.length>0}),"")))]),N(M,R)};se(oe,M=>{x(l()),O(()=>l().options&&Array.isArray(l().options)&&l().options.length>0)?M(ue):M(J,!1)})}Te(M=>Oe(pe,`${M??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Entering radio rendering block for ${l().id}`),"")))]),N(ie,ke)},_e=ie=>{var ke=qe(),pe=je(ke);{var oe=J=>{var M=P1(),R=je(M),C=de(R);{var z=W=>{var xe=D1(),Ne=je(xe),B=de(Ne);wr(B,5,()=>(x(l()),O(()=>l().options)),Lr,(fe,me)=>{{let we=Le(()=>(c(v),c(me),O(()=>`rounded-full px-4 py-2 text-sm font-medium transition-all hover:scale-105 ${c(v)===c(me).value?"bg-primary/10 text-primary border-primary border-[2px] hover:bg-primary/50 hover:text-primary-foreground dark:border-primary/90 dark:bg-primary dark:hover:bg-primary":"bg-card text-card-foreground border-[2px] hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"}`)));Gt(fe,{type:"button",variant:"outline",get class(){return c(we)},onclick:()=>y(c(me).value),children:(De,Ge)=>{dr();var Ke=pn();Te(()=>Oe(Ke,(c(me),O(()=>c(me).label)))),N(De,Ke)},$$slots:{default:!0}})}}),D(B),Te(fe=>Oe(Ne,`${fe??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Rendering chip options for ${l().id}:`,{optionsCount:l().options.length,options:l().options}),"")))]),N(W,xe)},Q=W=>{var xe=L1();N(W,xe)};se(C,W=>{x(l()),O(()=>l().options&&Array.isArray(l().options)&&l().options.length>0)?W(z):W(Q,!1)})}Te(W=>Oe(R,`${W??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Checking chip display for ${l().id}`),"")))]),N(J,M)},ue=J=>{var M=qe(),R=je(M);{var C=Q=>{var W=Q1(),xe=je(W),Ne=de(xe);{var B=me=>{var we=q1(),De=je(we),Ge=de(De);wr(Ge,5,()=>(x(l()),O(()=>l().options)),Lr,(Ke,Je)=>{{let lt=Le(()=>(c(v),c(Je),O(()=>`justify-start text-left px-4 py-6 text-sm font-medium transition-all rounded-lg shadow-none relative ${c(v)===c(Je).value?"bg-primary/10 text-primary border-primary border-[2px] hover:bg-primary/50 hover:text-primary-foreground dark:border-primary/90 dark:bg-primary dark:hover:bg-primary":"bg-card text-card-foreground border-[2px] hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"}`)));Gt(Ke,{type:"button",variant:"outline",get class(){return c(lt)},onclick:()=>y(c(Je).value),onkeydown:ft=>ft.key==="Enter"&&y(c(Je).value),children:(ft,Ue)=>{var kt=Z1(),St=je(kt),Ut=Z(St,!0);D(St);var Ft=de(St,2);{var wt=zt=>{var Nt=R1();N(zt,Nt)};se(Ft,zt=>{c(v),c(Je),O(()=>c(v)===c(Je).value)&&zt(wt)})}Te(()=>Oe(Ut,(c(Je),O(()=>c(Je).label)))),N(ft,kt)},$$slots:{default:!0}})}}),D(Ge),Te(Ke=>Oe(De,`${Ke??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Rendering list options for ${l().id}:`,{optionsCount:l().options.length,options:l().options}),"")))]),N(me,we)},fe=me=>{var we=F1();N(me,we)};se(Ne,me=>{x(l()),O(()=>l().options&&Array.isArray(l().options)&&l().options.length>0)?me(B):me(fe,!1)})}Te(me=>Oe(xe,`${me??""} `),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Checking list display for ${l().id}`),"")))]),N(Q,W)},z=Q=>{var W=pn();Te(xe=>Oe(W,xe),[()=>(x(l()),O(()=>(console.log(`🟡 [MultipleChoiceSingle] Unknown display style for ${l().id}:`,{displayStyle:l().displayStyle,hasOptions:!!l().options,options:l().options}),"")))]),N(Q,W)};se(R,Q=>{x(l()),O(()=>l().displayStyle==="list")?Q(C):Q(z,!1)},!0)}N(J,M)};se(pe,J=>{x(l()),O(()=>l().displayStyle==="chip")?J(oe):J(ue,!1)},!0)}N(ie,ke)};se(Y,ie=>{x(l()),O(()=>l().displayStyle==="radio"||!l().displayStyle)?ie(ne):ie(_e,!1)})}var Ee=de(Y,2);{var Fe=ie=>{var ke=W1(),pe=Z(ke),oe=Z(pe,!0);D(pe),D(ke),Te(()=>Oe(oe,m())),N(ie,ke)};se(Ee,ie=>{m()&&ie(Fe)})}D(k),Te(ie=>{Oe(te,`${x(l()),O(()=>l().title)??""} `),Oe(A,` ${ie??""} `)},[()=>(x(l()),O(()=>(()=>{const ie=l().displayStyle,ke=ie==="radio"||!ie;return console.log(`🟡 [MultipleChoiceSingle] Display style check for ${l().id}:`,{displayStyle:ie,displayStyleType:typeof ie,isRadio:ke,willRenderRadio:ke,hasOptions:!!l().options,optionsIsArray:Array.isArray(l().options),optionsLength:Array.isArray(l().options)?l().options.length:"N/A"}),""})()))]),N(i,k),rt()}var J1=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),B1=ee('<span class="text-destructive ml-1">*</span>'),Y1=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),K1=ee("<span> </span>"),H1=ee('<span class="text-xs xs:text-xs text-muted-foreground font-medium"> </span>'),X1=ee('<span class="text-xs xs:text-xs text-muted-foreground font-medium text-right"> </span>'),ez=ee('<div class="flex justify-between items-center px-1 sm:px-2"><!> <!></div>'),tz=ee('<div class="flex items-start gap-2 text-sm text-destructive bg-destructive/5 px-4 ml-2 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),rz=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <div class="flex flex-col gap-3 pt-2"><div></div> <!></div> <!></div>');function nz(i,n){tt(n,!1);const u=re(),l=re(),d=re(),{removeQuestionResponse:p}=hn();let m=w(n,"question",8),h=w(n,"value",8,0),g=w(n,"onChange",8),v=w(n,"error",8,void 0),y=w(n,"currentMode",8,void 0),k=w(n,"questionNumber",8,void 0),b=w(n,"themeSettings",8,void 0);w(n,"currentLanguage",8,void 0);let I=re(h()??0),S=re(h()??0),T=re(0);function G(R){c(S)===R?($(I,0),$(S,0),g()(0),p(m().id)):($(I,R),$(S,R),g()(R))}function te(R,C,z){const{displayStyle:Q="star",representationSize:W="medium",numberOfRatings:xe=5,color:Ne}=m(),B=typeof window<"u"&&window.innerWidth<640?"small":W,fe=C>=R,me=C===R,we=z===R,De=z>=R,Ge=`rating-icon ${B}-size ${fe?"selected":""} ${c(l)?"dark-mode":""}`,Ke=Q==="emoji"||Q==="thumbs-up",Je=Ne??c(d)?.brandColor??"var(--brand-color)";let lt="";if(Ke?lt=`opacity: ${(Q==="thumbs-up"?fe||De:me||we)?"1":"0.4"}; transform: scale(${Q==="thumbs-up"&&me||Q==="emoji"&&me?"1.1":"1"}); transition: opacity 0.2s ease, transform 0.2s ease;`:lt=`color: ${fe?Je:c(l)?"#4b5563":"#d1d5db"}; transition: color 0.25s ease;`,Q==="emoji"){const Ue=["😡","😞","😕","😐","🙂","😊","😄","😁","🤩","😍"],kt=Math.floor((R-1)*(Ue.length/xe)),St=Math.min(Math.max(kt,0),Ue.length-1);return{content:Ue[St],type:"emoji",style:lt,baseClass:`${Ge} rating-${Q}-icon`}}const ft={star:"★",heart:"♥","thumbs-up":"👍",diamond:"◆"}[Q];return ft?{content:ft,type:Q,style:lt,baseClass:`${Ge} rating-${Q}-icon`}:null}he(()=>x(m()),()=>{$(u,m().displayStyle==="emoji"||m().displayStyle==="thumbs-up")}),he(()=>x(y()),()=>{$(l,y()==="dark")}),he(()=>(x(b()),x(y())),()=>{$(d,b()?.[y()==="dark"?"dark":"light"]||null)}),he(()=>x(h()),()=>{h()!==void 0&&($(I,h()),$(S,h()))}),fr(),er();var ae=rz(),K=Z(ae),V=Z(K);{var E=R=>{var C=J1(),z=Z(C);D(C),Te(()=>Oe(z,`${k()??""}.`)),N(R,C)};se(V,R=>{k()!==void 0&&R(E)})}var A=de(V,2),Y=Z(A),ne=Z(Y),_e=de(ne);{var Ee=R=>{var C=B1();N(R,C)};se(_e,R=>{x(m()),O(()=>m().required)&&R(Ee)})}D(Y);var Fe=de(Y,2);{var ie=R=>{var C=Y1(),z=Z(C,!0);D(C),Te(()=>Oe(z,(x(m()),O(()=>m().description)))),N(R,C)};se(Fe,R=>{x(m()),O(()=>m().description)&&R(ie)})}D(A),D(K);var ke=de(K,2),pe=Z(ke);wr(pe,5,()=>(x(m()),O(()=>Array.from({length:m().numberOfRatings??5},(R,C)=>C+1))),Lr,(R,C)=>{const z=Le(()=>(c(C),c(I),c(T),O(()=>te(c(C),c(I),c(T))))),Q=Le(()=>(x(m()),O(()=>m().numberOfRatings??5))),W=Le(()=>c(Q)>10?"p-0.5 xs:p-1 sm:p-1.5":c(Q)>7?"p-1 xs:p-1.5 sm:p-2":"p-1.5 xs:p-2 sm:p-2.5"),xe=Le(()=>c(Q)>10?"text-base xs:text-lg sm:text-xl":c(Q)>7?"text-lg xs:text-xl sm:text-2xl":"text-xl xs:text-2xl sm:text-3xl");var Ne=qe(),B=je(Ne);{var fe=me=>{{let we=Le(()=>c(W)),De=Le(()=>c(u)?"":"hover:scale-110");Gt(me,{type:"button",variant:"ghost",size:"icon",get class(){return`h-auto w-auto ${c(we)??""} rounded-lg hover:bg-accent transition-all flex-shrink-0 ${c(De)??""}`},onclick:()=>G(c(C)),onmouseenter:()=>{$(I,c(C)),$(T,c(C))},onmouseleave:()=>{$(T,0),$(I,c(S))},children:(Ge,Ke)=>{var Je=K1(),lt=Z(Je,!0);D(Je),Te(()=>{mn(Je,1,`${x(c(z)),O(()=>c(z).baseClass)??""} ${c(u)?`${c(xe)} leading-none`:""}`),$o(Je,(x(c(z)),O(()=>c(z).style))),Oe(lt,(x(c(z)),O(()=>c(z).content)))}),N(Ge,Je)},$$slots:{default:!0}})}};se(B,me=>{c(z)&&me(fe)})}N(R,Ne)}),D(pe);var oe=de(pe,2);{var ue=R=>{var C=ez(),z=Z(C);{var Q=Ne=>{var B=H1(),fe=Z(B,!0);D(B),Te(()=>Oe(fe,(x(m()),O(()=>m().minLabel)))),N(Ne,B)};se(z,Ne=>{x(m()),O(()=>m().minLabel)&&Ne(Q)})}var W=de(z,2);{var xe=Ne=>{var B=X1(),fe=Z(B,!0);D(B),Te(()=>Oe(fe,(x(m()),O(()=>m().maxLabel)))),N(Ne,B)};se(W,Ne=>{x(m()),O(()=>m().maxLabel)&&Ne(xe)})}D(C),N(R,C)};se(oe,R=>{x(m()),O(()=>m().showLabels)&&R(ue)})}D(ke);var J=de(ke,2);{var M=R=>{var C=tz(),z=Z(C),Q=Z(z,!0);D(z),D(C),Te(()=>Oe(Q,v())),N(R,C)};se(J,R=>{v()&&R(M)})}D(ae),Te(()=>{Oe(ne,`${x(m()),O(()=>m().title)??""} `),mn(pe,1,`flex ${c(u)?"gap-0":"gap-0.5 xs:gap-1 sm:gap-1.5 md:gap-2"} justify-center items-center w-full`)}),N(i,ae),rt()}function iz(i,n){tt(n,!0);/**
194
194
  * @license @lucide/svelte v0.544.0 - ISC
195
195
  *
196
196
  * ISC License
@@ -276,8 +276,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
276
276
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
277
277
  * SOFTWARE.
278
278
  *
279
- */let u=qt(n,["$$slots","$$events","$$legacy"]);const l=[["path",{d:"M5 12h14"}]];Fa(i,Mt({name:"minus"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Wt(h,()=>n.children??$t),N(d,m)},$$slots:{default:!0}})),rt()}var az=ee('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function sz(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"checked",15,!1),d=w(n,"indeterminate",15,!1),p=qt(n,["$$slots","$$events","$$legacy","ref","checked","indeterminate","class"]);var m=qe(),h=je(m);{const g=(y,k)=>{let b=()=>k?.().checked,I=()=>k?.().indeterminate;var S=az(),T=Z(S);{var G=ae=>{iz(ae,{class:"size-3.5"})},te=ae=>{var K=qe(),V=je(K);{var E=A=>{oz(A,{class:"size-3.5"})};se(V,A=>{I()&&A(E)},!0)}N(ae,K)};se(T,ae=>{b()?ae(G):ae(te,!1)})}D(S),N(y,S)};let v=ht(()=>jr("border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive shadow-xs peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border outline-none transition-shadow focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n.class));Ca(h,()=>m1,(y,k)=>{k(y,Mt({"data-slot":"checkbox",get class(){return c(v)}},()=>p,{get ref(){return u()},set ref(b){u(b)},get checked(){return l()},set checked(b){l(b)},get indeterminate(){return d()},set indeterminate(b){d(b)},children:g,$$slots:{default:!0}}))})}N(i,m),rt()}var uz=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),lz=ee('<span class="text-destructive ml-1">*</span>'),cz=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),dz=ee('<div class="flex items-start gap-2 text-sm text-destructive bg-destructive/5 px-4 ml-2 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),fz=ee('<div class="flex items-center gap-2 text-sm text-amber-600 bg-amber-50 dark:bg-amber-950/30 dark:text-amber-500 px-3 py-2 rounded-md border border-amber-200 dark:border-amber-900"><span class="font-medium"> </span></div>'),pz=ee('<div class="flex items-center space-x-3"><!> <label> </label></div>'),mz=ee('<div class="flex flex-col gap-3"></div>'),gz=(i,n,u)=>n(c(u).value),hz=ee('<button type="button"> </button>'),vz=ee('<div class="flex flex-wrap gap-2 px-4"></div>'),bz=On('<svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7"></path></svg>'),yz=ee('<span class="flex-1"> </span> <!>',1),$z=ee('<div class="flex flex-col gap-2 w-full px-2"></div>'),wz=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <!> <!></div>');function _z(i,n){tt(n,!1);const u=re(),{updateQuestionResponse:l,setQuestionError:d}=hn();let p=w(n,"question",8),m=w(n,"value",24,()=>[]),h=w(n,"onChange",8),g=w(n,"error",8,void 0),v=w(n,"currentMode",8,void 0),y=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);let k=re(m()||[]),b=re(g()),I=re(void 0),S=!1,T=re(!1);En(()=>{setTimeout(()=>{const C=G(c(k));$(b,C),C&&d(p().id,C),S=!0},0)});function G(C){if(p().required&&(!C||C.length===0))return p().errorMessage;const z=p().maxSelections;if(z!==void 0&&C.length>z)return p().errorMessage;const W=p().minSelections;if(W!==void 0&&C.length>0&&C.length<W)return p().errorMessage}function te(C){if(!S)return;$(T,!0);const z=[...c(k)];if(z.includes(C)){const W=z.filter(xe=>xe!==C);$(k,W),h()(W),$(I,void 0);const Q=G(W);$(b,Q),l(p().id,W,a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE,Q)}else{const W=p().maxSelections;if(W!==void 0&&z.length>=W){const Q=p().errorMessage;$(I,Q),l(p().id,z,a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE,void 0)}else{const Q=[...z,C];$(k,Q),h()(Q),$(I,void 0);const xe=G(Q);$(b,xe),l(p().id,Q,a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE,xe)}}}he(()=>x(v()),()=>{$(u,v()==="dark")}),he(()=>(x(m()),c(T)),()=>{m()!==void 0&&!c(T)&&$(k,m())}),he(()=>x(g()),()=>{g()!==void 0&&$(b,g())}),fr(),er();var ae=wz(),K=Z(ae),V=Z(K);{var E=C=>{var z=uz(),W=Z(z);D(z),Te(()=>Oe(W,`${y()??""}.`)),N(C,z)};se(V,C=>{y()!==void 0&&C(E)})}var A=de(V,2),Y=Z(A),ne=Z(Y),_e=de(ne);{var Ee=C=>{var z=lz();N(C,z)};se(_e,C=>{x(p()),O(()=>p().required)&&C(Ee)})}D(Y);var Fe=de(Y,2);{var ie=C=>{var z=cz(),W=Z(z,!0);D(z),Te(()=>Oe(W,(x(p()),O(()=>p().description)))),N(C,z)};se(Fe,C=>{x(p()),O(()=>p().description)&&C(ie)})}D(A),D(K);var ke=de(K,2);{var pe=C=>{var z=dz(),W=Z(z),Q=Z(W,!0);D(W),D(z),Te(()=>Oe(Q,c(b))),N(C,z)};se(ke,C=>{c(b)&&C(pe)})}var oe=de(ke,2);{var ue=C=>{var z=fz(),W=Z(z),Q=Z(W,!0);D(W),D(z),Te(()=>Oe(Q,c(I))),N(C,z)};se(oe,C=>{c(I)&&C(ue)})}var J=de(oe,2);{var M=C=>{var z=mz();wr(z,5,()=>(x(p()),O(()=>p().options)),Lr,(W,Q)=>{const xe=Le(()=>(c(k),c(Q),O(()=>c(k).includes(c(Q).value)))),Ne=Le(()=>(x(p()),c(k),x(c(xe)),O(()=>p().maxSelections!==void 0&&c(k).length>=p().maxSelections&&!c(xe))));var B=pz(),fe=Z(B);{let De=Le(()=>(x(p()),c(Q),O(()=>`${p().id}-${c(Q).value}`))),Ge=Le(()=>(c(k),c(Q),O(()=>c(k).includes(c(Q).value))));sz(fe,{get id(){return c(De)},get checked(){return c(Ge)},onCheckedChange:()=>te(c(Q).value),get disabled(){return c(Ne)},class:"h-5 w-5 rounded border-2 cursor-pointer transition-all data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=unchecked]:border-input data-[state=unchecked]:bg-background data-[state=checked]:text-primary-foreground disabled:opacity-50 disabled:cursor-not-allowed"})}var me=de(fe,2),we=Z(me,!0);D(me),D(B),Te(()=>{si(me,"for",(x(p()),c(Q),O(()=>`${p().id}-${c(Q).value}`))),mn(me,1,`text-sm font-medium cursor-pointer text-foreground hover:text-primary transition-colors select-none ${c(Ne)?"opacity-50 cursor-not-allowed":""}`),Oe(we,(c(Q),O(()=>c(Q).label)))}),N(W,B)}),D(z),N(C,z)},R=C=>{var z=qe(),W=je(z);{var Q=Ne=>{var B=vz();wr(B,5,()=>(x(p()),O(()=>p().options)),Lr,(fe,me)=>{const we=Le(()=>(c(k),c(me),O(()=>c(k).includes(c(me).value)))),De=Le(()=>(x(p()),c(k),x(c(we)),O(()=>p().maxSelections!==void 0&&c(k).length>=p().maxSelections&&!c(we))));var Ge=hz();Ge.__click=[gz,te,me];var Ke=Z(Ge,!0);D(Ge),Te(()=>{Ge.disabled=c(De),mn(Ge,1,`rounded-full px-4 py-2 text-sm font-medium transition-all border-2 ${c(we)?"bg-primary/10 text-primary border-primary border-[2px] hover:bg-primary/50 hover:text-primary-foreground dark:border-primary/90 dark:bg-primary dark:hover:bg-primary":"bg-card text-card-foreground border-border hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"} ${c(De)?"opacity-50 cursor-not-allowed":"hover:scale-105 cursor-pointer"}`),Oe(Ke,(c(me),O(()=>c(me).label)))}),N(fe,Ge)}),D(B),N(Ne,B)},xe=Ne=>{var B=qe(),fe=je(B);{var me=we=>{var De=$z();wr(De,5,()=>(x(p()),O(()=>p().options)),Lr,(Ge,Ke)=>{const Je=Le(()=>(c(k),c(Ke),O(()=>c(k).includes(c(Ke).value)))),lt=Le(()=>(x(p()),c(k),x(c(Je)),O(()=>p().maxSelections!==void 0&&c(k).length>=p().maxSelections&&!c(Je))));{let ft=Le(()=>`justify-start text-left px-4 py-6 text-sm font-medium transition-all rounded-lg shadow-none relative ${c(Je)?"bg-primary/10 text-primary border-primary border-[2px] hover:bg-primary/50 hover:text-primary-foreground dark:border-primary/90 dark:bg-primary dark:hover:bg-primary":"bg-card text-card-foreground border-[2px] hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"} ${c(lt)?"opacity-50 cursor-not-allowed":""}`);Gt(Ge,{type:"button",variant:"outline",get disabled(){return c(lt)},get class(){return c(ft)},onclick:()=>te(c(Ke).value),onkeydown:Ue=>Ue.key==="Enter"&&te(c(Ke).value),children:(Ue,kt)=>{var St=yz(),Ut=je(St),Ft=Z(Ut,!0);D(Ut);var wt=de(Ut,2);{var zt=Nt=>{var Yt=bz();N(Nt,Yt)};se(wt,Nt=>{c(Je)&&Nt(zt)})}Te(()=>Oe(Ft,(c(Ke),O(()=>c(Ke).label)))),N(Ue,St)},$$slots:{default:!0}})}}),D(De),N(we,De)};se(fe,we=>{x(p()),O(()=>p().displayStyle==="list")&&we(me)},!0)}N(Ne,B)};se(W,Ne=>{x(p()),O(()=>p().displayStyle==="chip")?Ne(Q):Ne(xe,!1)},!0)}N(C,z)};se(J,C=>{x(p()),O(()=>p().displayStyle==="checkbox"||!p().displayStyle)?C(M):C(R,!1)})}D(ae),Te(()=>Oe(ne,`${x(p()),O(()=>p().title)??""} `)),N(i,ae),rt()}xl(["click"]);function kz(i,n,u,l,d,p,m,h,g){c(n)||$(n,!0),$(u,!1),$(l,void 0),d()(void 0);const v=p(void 0);$(m,v),h(g().id,void 0,a.QuestionTypes.ANNOTATION,v)}var xz=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),Sz=ee('<span class="text-destructive ml-1">*</span>'),Iz=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),zz=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/5 px-4 mx-4 py-2 rounded-md border border-destructive/20"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="font-normal"> </span></div>'),Nz=ee('<div class="group relative border-2 border-dashed border-border hover:border-primary/50 rounded-xl bg-muted/30 hover:bg-muted/50 transition-all cursor-pointer overflow-hidden"><div class="flex items-center justify-center gap-3 px-6 py-8"><div class="w-12 h-12 rounded-full bg-background shadow-sm flex items-center justify-center group-hover:scale-110 transition-transform"><!></div> <div class="flex flex-col"><span class="text-sm font-semibold text-foreground"> </span> <span class="text-xs text-muted-foreground">Click to add annotation</span></div></div></div>'),Tz=ee('<div class="relative border-2 border-primary/20 rounded-xl bg-primary/5 overflow-hidden shadow-sm hover:shadow-md transition-all"><div class="flex items-center justify-between gap-3 px-6 py-4"><div class="flex items-center gap-3 flex-1 min-w-0"><div class="w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0"><!></div> <div class="flex flex-col flex-1 min-w-0"><span class="text-sm font-semibold text-foreground truncate"> </span> <span class="text-xs text-muted-foreground">Annotation added</span></div></div> <button class="w-8 h-8 rounded-full bg-destructive/10 hover:bg-destructive/20 text-destructive flex items-center justify-center transition-colors flex-shrink-0" type="button" aria-label="Remove annotation"><!></button></div></div>'),jz=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <div class="w-full"><!> <!></div></div>');function Oz(i,n){tt(n,!1);const u=re(),{updateQuestionResponse:l,setQuestionError:d,formResponses:p}=hn();let m=w(n,"question",8),h=w(n,"value",8,void 0),g=w(n,"onChange",8),v=w(n,"error",8,void 0),y=w(n,"currentMode",8,void 0),k=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);let b=re(!1),I=re(void 0),S=re(v()),T=re(!1);En(()=>{const R=ko(p).questions.find(C=>C.questionId===m().id);if(R?.answer&&"annotation"in R.answer){const C=R.answer.annotation;$(I,C),$(b,!0),typeof C=="object"&&C!==null&&g()(C)}setTimeout(()=>{const C=c(I),z=G(C);$(S,z),z&&d(m().id,z)},0)});function G(R){let C="";if(typeof R=="string"?C=R:R&&typeof R=="object"&&(C="has_annotation_data"),m().required&&(!C||C.trim()===""))return m().errorMessage??"This field is required"}he(()=>x(y()),()=>{$(u,y()==="dark")}),he(()=>(x(h()),x(g())),()=>{if(h()!==void 0){if(typeof h()=="string"){const R=h().trim()!=="";$(b,R),$(I,h())}else if(typeof h()=="object"&&h()!==null&&"annotation"in h()){const R=h().annotation;$(b,!0),$(I,R),g()(R)}}else $(I,void 0),$(b,!1)}),he(()=>x(v()),()=>{v()!==void 0&&$(S,v())}),fr(),er();var te=jz(),ae=Z(te),K=Z(ae);{var V=R=>{var C=xz(),z=Z(C);D(C),Te(()=>Oe(z,`${k()??""}.`)),N(R,C)};se(K,R=>{k()!==void 0&&R(V)})}var E=de(K,2),A=Z(E),Y=Z(A),ne=de(Y);{var _e=R=>{var C=Sz();N(R,C)};se(ne,R=>{x(m()),O(()=>m().required)&&R(_e)})}D(A);var Ee=de(A,2);{var Fe=R=>{var C=Iz(),z=Z(C,!0);D(C),Te(()=>Oe(z,(x(m()),O(()=>m().description)))),N(R,C)};se(Ee,R=>{x(m()),O(()=>m().description)&&R(Fe)})}D(E),D(ae);var ie=de(ae,2);{var ke=R=>{var C=zz(),z=de(Z(C),2),W=Z(z,!0);D(z),D(C),Te(()=>Oe(W,c(S))),N(R,C)};se(ie,R=>{c(S)&&c(T)&&R(ke)})}var pe=de(ie,2),oe=Z(pe);{var ue=R=>{var C=Nz(),z=Z(C),W=Z(z),Q=Z(W);Qv(Q,{size:24,class:"text-muted-foreground group-hover:text-primary transition-colors"}),D(W);var xe=de(W,2),Ne=Z(xe),B=Z(Ne,!0);D(Ne),dr(2),D(xe),D(z),D(C),Te(()=>Oe(B,(x(m()),O(()=>m().noAnnotationText??"No Annotation")))),N(R,C)};se(oe,R=>{c(b)||R(ue)})}var J=de(oe,2);{var M=R=>{var C=Tz(),z=Z(C),W=Z(z),Q=Z(W),xe=Z(Q);Qv(xe,{size:20,class:"text-primary"}),D(Q);var Ne=de(Q,2),B=Z(Ne),fe=Z(B,!0);D(B),dr(2),D(Ne),D(W);var me=de(W,2);me.__click=[kz,T,b,I,g,G,S,l,m];var we=Z(me);Gv(we,{size:16}),D(me),D(z),D(C),Te(()=>Oe(fe,(x(m()),O(()=>m().annotationText??"Annotation")))),N(R,C)};se(J,R=>{c(b)&&R(M)})}D(pe),D(te),Te(()=>Oe(Y,`${x(m()),O(()=>m().title)??""} `)),N(i,te),rt()}xl(["click"]);var Ez=ee('<p class="text-muted-foreground text-[1rem] leading-[1.5rem]"> </p>'),Cz=ee('<div class="flex flex-col items-center text-center mb-0 w-full mt-[8px]"><h2 class="text-foreground font-[600] text-[1.5rem] mb-[1rem]"> </h2> <!></div>');function Az(i,n){tt(n,!1);const u=re(),l=re();let d=w(n,"welcomeScreenProperties",8,null);w(n,"onStart",8,void 0);let p=w(n,"currentMode",8,void 0),m=w(n,"currentLanguage",8,void 0);w(n,"themeSettings",8,void 0),he(()=>x(p()),()=>{$(u,p()==="dark")}),he(()=>(x(d()),x(m())),()=>{$(l,d()?.translations&&m()&&d().translations[m()]?d().translations[m()]:d()?.welcomeFields??{title:"Welcome to our survey!",description:"We value your feedback and appreciate your time.",buttonLabel:"Start"})}),fr(),er();var h=Cz(),g=Z(h),v=Z(g,!0);D(g);var y=de(g,2);{var k=b=>{var I=Ez(),S=Z(I,!0);D(I),Te(()=>Oe(S,(c(l),O(()=>c(l).description)))),N(b,I)};se(y,b=>{c(l),O(()=>c(l).description)&&b(k)})}D(h),Te(()=>Oe(v,(c(l),O(()=>c(l).title)))),N(i,h),rt()}var Mz=ee('<p class="text-muted-foreground text-[1rem] leading-[1.5rem]"> </p>'),Uz=ee('<div class="flex flex-col items-center text-center mb-0 w-full mt-[8px]"><h2 class="text-foreground font-[600] text-[1.5rem] mb-[1rem]"> </h2> <!></div>');function Dz(i,n){tt(n,!1);const u=re(),l=re(),d=re(),p=re(),m=re();let h=w(n,"endScreenProperties",8,null),g=w(n,"onExit",8,void 0),v=w(n,"currentMode",8,void 0),y=w(n,"currentLanguage",8,void 0);w(n,"themeSettings",8,void 0);let k=w(n,"isScreenVisible",8,void 0),b=re(null);bo(()=>{c(b)!==null&&clearTimeout(c(b))}),he(()=>x(v()),()=>{$(u,v()==="dark")}),he(()=>(x(h()),x(y())),()=>{$(l,h()?.translations&&y()&&h().translations[y()]?h().translations[y()]:h()?.endFields??{title:"Thank you for participating!",message:"Your feedback is important to us.",buttonLabel:"Exit",dismissBehavior:"close",fadeDuration:300})}),he(()=>x(k()),()=>{$(d,k()===!0)}),he(()=>x(h()),()=>{$(p,h()?.endFields?.dismissBehavior)}),he(()=>x(h()),()=>{$(m,h()?.endFields?.fadeDuration||0)}),he(()=>(c(b),c(d),c(p),x(g()),c(m)),()=>{c(b)!==null&&(clearTimeout(c(b)),$(b,null)),c(d)&&c(p)==="fade"&&typeof g()=="function"&&c(m)>0&&$(b,setTimeout(()=>{g()?.()},c(m)*1e3))}),fr(),er();var I=Uz(),S=Z(I),T=Z(S,!0);D(S);var G=de(S,2);{var te=ae=>{var K=Mz(),V=Z(K,!0);D(K),Te(()=>Oe(V,(c(l),O(()=>c(l).message)))),N(ae,K)};se(G,ae=>{c(l),O(()=>c(l).message)&&ae(te)})}D(I),Te(()=>Oe(T,(c(l),O(()=>c(l).title)))),N(i,I),rt()}var Lz=ee("<h2> </h2>"),Pz=ee('<!> <div class="question-wrapper"><div class="question-container"><!></div></div>',1),Rz=ee("<!> <!>",1),Zz=ee('<div id="section-container"><!> <!> <!></div>');function qz(i,n){tt(n,!1);const u=re(),l=re(),{storeQuestions:d,getQuestionData:p}=hn();let m=w(n,"questions",8),h=w(n,"sections",8),g=w(n,"formData",8),v=w(n,"errors",8),y=w(n,"onChange",8),k=w(n,"currentMode",8,void 0),b=w(n,"welcomeScreenProperties",8),I=w(n,"otherConfigurationProperties",8),S=w(n,"currentSectionIndex",8),T=w(n,"endScreenProperties",8,void 0),G=w(n,"currentLanguage",8,void 0),te=w(n,"themeSettings",8),ae=w(n,"onClose",8,void 0),K=w(n,"isScreenVisible",8,void 0),V=w(n,"apiKey",8,void 0),E=w(n,"hostUrl",8,void 0),A=w(n,"identifier",8,void 0),Y=w(n,"feedbackConfigurationId",8,void 0);function ne(J){return c(u).get(J)??-1}function _e(J){switch(J){case a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE:return[];case a.QuestionTypes.NPS:case a.QuestionTypes.RATING:return-1;case a.QuestionTypes.SHORT_ANSWER:case a.QuestionTypes.LONG_TEXT:case a.QuestionTypes.SINGLE_CHOICE:return"";default:return}}function Ee(J){return Array.isArray(J)?J:typeof J=="object"&&J!==null?Object.values(J).filter(M=>M!==void 0):typeof J=="string"?[J]:[]}function Fe(J){return typeof J=="number"?J:typeof J=="string"?Number(J):0}function ie(J){return typeof J=="string"?J:String(typeof J=="object"&&J!==null?Object.values(J)[0]||"":J||"")}function ke(J,M){if(J==null){const R=_e(M);return R!==void 0?R:J}switch(M){case a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE:return Ee(J);case a.QuestionTypes.NPS:case a.QuestionTypes.RATING:return Fe(J);case a.QuestionTypes.SINGLE_CHOICE:return ie(J);default:return J}}he(()=>(x(m()),a.QuestionTypes),()=>{m()&&Object.keys(m()).length>0&&(console.log("🟠 [FormRenderer] Questions received:",m()),Object.entries(m()).forEach(([J,M])=>{M.type===a.QuestionTypes.SINGLE_CHOICE&&console.log(`🟠 [FormRenderer] Single choice question ${J}:`,{id:M.id,type:M.type,title:M.title,hasOptions:"options"in M,options:M.options,optionsType:typeof M.options,isArray:Array.isArray(M.options),optionsLength:Array.isArray(M.options)?M.options.length:"N/A",fullQuestion:M})}),d(m()))}),he(()=>x(h()),()=>{$(u,(()=>{const J=new Map;let M=0;return h().forEach(R=>{R.id!=="welcome_screen"&&R.id!=="thankyou_screen"&&R.questionIds.forEach(C=>{J.set(C,M++)})}),J})())}),he(()=>(x(h()),x(S())),()=>{$(l,h()[S()])}),fr(),er();var pe=qe(),oe=je(pe);{var ue=J=>{var M=qe(),R=je(M);wr(R,1,()=>(x(h()),x(S()),O(()=>[h()[S()]])),C=>C.id,(C,z)=>{var W=Zz(),Q=Z(W);{var xe=we=>{Az(we,{get welcomeScreenProperties(){return b()},get currentMode(){return k()},get currentLanguage(){return G()},get themeSettings(){return te()}})};se(Q,we=>{c(z),O(()=>c(z).id==="welcome_screen")&&we(xe)})}var Ne=de(Q,2);{var B=we=>{{let De=Le(()=>T()?T():{});Dz(we,{get endScreenProperties(){return c(De)},get onExit(){return ae()},get currentMode(){return k()},get currentLanguage(){return G()},get themeSettings(){return te()},get isScreenVisible(){return K()}})}};se(Ne,we=>{c(z),O(()=>c(z).id==="thankyou_screen")&&we(B)})}var fe=de(Ne,2);{var me=we=>{var De=Rz(),Ge=je(De);{var Ke=lt=>{var ft=Lz(),Ue=Z(ft,!0);D(ft),Te(()=>{mn(ft,1,`section-title ${k()==="dark"?"dark-mode":""}`),Oe(Ue,(c(z),O(()=>c(z).title)))}),N(lt,ft)};se(Ge,lt=>{x(I()),O(()=>I().isEnabled&&I().otherFields.pageTitle)&&lt(Ke)})}var Je=de(Ge,2);wr(Je,1,()=>(c(z),O(()=>c(z).questionIds)),Lr,(lt,ft)=>{const Ue=Le(()=>(c(ft),O(()=>p(c(ft)))));var kt=qe(),St=je(kt);{var Ut=Ft=>{const wt=Le(()=>(x(I()),O(()=>I()?.isEnabled&&I().otherFields.questionNumber))),zt=Le(()=>(x(c(Ue)),O(()=>ne(c(Ue).id)))),Nt=Le(()=>(x(c(Ue)),x(g()),x(y()),x(v()),x(k()),x(G()),x(te()),x(c(wt)),x(c(zt)),O(()=>({question:c(Ue),value:ke(g()[c(Ue).id],c(Ue).type),onChange:Qe=>y()(c(Ue).id,Qe,c(Ue).type),error:v()[c(Ue).id],currentMode:k(),currentLanguage:G(),themeSettings:te(),questionNumber:c(wt)?c(zt)+1:void 0}))));var Yt=Pz(),ir=je(Yt);{var mr=Qe=>{const Ie=Le(()=>c(Ue));var Be=qe(),Re=je(Be);{var or=Vt=>{};se(Re,Vt=>{x(c(Ie)),O(()=>c(Ie).options)&&Vt(or)})}N(Qe,Be)};se(ir,Qe=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.SINGLE_CHOICE)&&Qe(mr)})}var H=de(ir,2),ye=Z(H),L=Z(ye);{var q=Qe=>{cS(Qe,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},We=Qe=>{var Ie=qe(),Be=je(Ie);{var Re=Vt=>{AS(Vt,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},or=Vt=>{var ar=qe(),Ve=je(ar);{var ut=mt=>{JS(mt,Mt(()=>c(Nt),{get question(){return c(Ue)},get apiKey(){return V()},get hostUrl(){return E()},get identifier(){return A()},get feedbackConfigurationId(){return Y()},get otherConfigurationProperties(){return I()}}))},Dt=mt=>{var gr=qe(),yn=je(gr);{var cr=xr=>{lI(xr,Mt(()=>c(Nt),{get question(){return c(Ue)},get apiKey(){return V()},get hostUrl(){return E()},get identifier(){return A()},get feedbackConfigurationId(){return Y()},get otherConfigurationProperties(){return I()}}))},Ot=xr=>{var Ub=qe(),mN=je(Ub);{var gN=Ci=>{V1(Ci,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},hN=Ci=>{var Db=qe(),vN=je(Db);{var bN=Ai=>{nz(Ai,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},yN=Ai=>{var Lb=qe(),$N=je(Lb);{var wN=Mi=>{_z(Mi,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},_N=Mi=>{var Pb=qe(),kN=je(Pb);{var xN=uc=>{Oz(uc,Mt(()=>c(Nt),{get question(){return c(Ue)}}))};se(kN,uc=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.ANNOTATION)&&uc(xN)},!0)}N(Mi,Pb)};se($N,Mi=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE)?Mi(wN):Mi(_N,!1)},!0)}N(Ai,Lb)};se(vN,Ai=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.RATING)?Ai(bN):Ai(yN,!1)},!0)}N(Ci,Db)};se(mN,Ci=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.SINGLE_CHOICE)?Ci(gN):Ci(hN,!1)},!0)}N(xr,Ub)};se(yn,xr=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.SHORT_ANSWER)?xr(cr):xr(Ot,!1)},!0)}N(mt,gr)};se(Ve,mt=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.LONG_TEXT)?mt(ut):mt(Dt,!1)},!0)}N(Vt,ar)};se(Be,Vt=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.NESTED_SELECTION)?Vt(Re):Vt(or,!1)},!0)}N(Qe,Ie)};se(L,Qe=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.NPS)?Qe(q):Qe(We,!1)})}D(ye),D(H),N(Ft,Yt)};se(St,Ft=>{c(Ue)&&Ft(Ut)})}N(lt,kt)}),N(we,De)};se(fe,we=>{c(z),O(()=>c(z).id!=="welcome_screen"&&c(z).id!=="thankyou_screen")&&we(me)})}D(W),N(C,W)}),N(J,M)};se(oe,J=>{x(S()),x(h()),O(()=>S()<h().length&&h().length>0)&&J(ue)})}N(i,pe),rt()}var Fz=ee('<div class="flex justify-center"><!></div>'),Qz=ee('<div class="flex justify-center"><!></div>'),Wz=ee('<div class="flex-1"></div>'),Gz=On('<svg class="w-5 h-5 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>'),Vz=ee('<div class="flex items-center justify-between gap-3"><!> <!></div>'),Jz=ee('<div class="w-full py-6 px-4 bg-background"><!></div>');function Bz(i,n){tt(n,!1);const u=()=>Lv(b,"$formResponses",l),[l,d]=Pv(),p=re(),m=re(),h=re(),g=re(),v=re(),{hasValidationErrors:y,clearValidationErrors:k,formResponses:b}=hn();let I=w(n,"isWelcomeScreen",8),S=w(n,"isThankYouScreen",8),T=w(n,"isFirstSection",8),G=w(n,"isFirstPageAfterWelcome",8,!1),te=w(n,"isLastSection",8),ae=w(n,"welcomeScreenProperties",8,null),K=w(n,"endScreenProperties",8,null),V=w(n,"otherConfigurationProperties",8,null),E=w(n,"currentMode",8),A=w(n,"currentLanguage",8),Y=w(n,"handlePrevious",8),ne=w(n,"handleNext",8),_e=w(n,"handleSubmit",8),Ee=w(n,"onClose",8,void 0);w(n,"themeSettings",8);let Fe=w(n,"nextButtonDisabled",8,!1),ie=w(n,"submitButtonDisabled",8,!1),ke=w(n,"isSinglePageSurvey",8,!1),pe=re(!1),oe=re(!1);const ue=()=>{Ee()&&Ee()()},J=()=>{if(!S()&&!K()?.isEnabled){$(pe,!0),window.setTimeout(()=>{$(pe,!1),Ee()&&Ee()()},3e3);try{_e()()}catch(xe){console.error("Error during form submission:",xe)}}else _e()()},M=()=>{k(),Y()()},R=()=>{ne()()};he(()=>(x(V()),x(A())),()=>{$(p,(()=>{const xe={previousButtonLabel:"Previous",nextButtonLabel:"Next",submitButtonLabel:"Submit"};return V()?.isEnabled?V()?.translations&&A()&&V().translations[A()]?V().translations[A()]:V()?.otherFields??xe:xe})())}),he(()=>(x(ae()),x(A())),()=>{$(m,ae()?.translations&&A()&&ae().translations[A()]?ae().translations[A()]:ae()?.welcomeFields??{title:"Welcome to our survey!",description:"We value your feedback and appreciate your time.",buttonLabel:"Start"})}),he(()=>(x(K()),x(A())),()=>{$(h,K()?.translations&&A()&&K().translations[A()]?K().translations[A()]:K()?.endFields??{buttonLabel:"Exit",dismissBehavior:"close"})}),he(()=>x(E()),()=>{$(g,E()==="dark")}),he(()=>x(Fe()),()=>{$(v,y()||Fe())}),he(()=>(u(),x(ie())),()=>{u();const xe=y();$(oe,xe||ie())}),fr(),er();var C=Jz(),z=Z(C);{var W=xe=>{var Ne=Fz(),B=Z(Ne);Gt(B,{onclick:R,size:"default",class:"px-8 py-6 text-base font-semibold rounded-md shadow-md hover:shadow-md transition-all",children:(fe,me)=>{dr();var we=pn();Te(()=>Oe(we,(c(m),O(()=>c(m).buttonLabel)))),N(fe,we)},$$slots:{default:!0}}),D(Ne),N(xe,Ne)},Q=xe=>{var Ne=qe(),B=je(Ne);{var fe=we=>{var De=Qz(),Ge=Z(De);Gt(Ge,{onclick:()=>ue(),size:"default",class:"px-8 py-6 text-base font-semibold rounded-md shadow-md hover:shadow-md transition-all",children:(Ke,Je)=>{dr();var lt=pn();Te(()=>Oe(lt,(c(h),O(()=>c(h).buttonLabel)))),N(Ke,lt)},$$slots:{default:!0}}),D(De),N(we,De)},me=we=>{var De=Vz(),Ge=Z(De);{var Ke=kt=>{{let St=Le(()=>T()||G());Gt(kt,{onclick:()=>M(),get disabled(){return c(St)},variant:"secondary",size:"default",class:"px-6 py-5 text-sm font-semibold rounded-md transition-all disabled:cursor-not-allowed",children:(Ut,Ft)=>{dr();var wt=pn();Te(()=>Oe(wt,(c(p),O(()=>c(p).previousButtonLabel)))),N(Ut,wt)},$$slots:{default:!0}})}},Je=kt=>{var St=Wz();N(kt,St)};se(Ge,kt=>{ke()?kt(Je,!1):kt(Ke)})}var lt=de(Ge,2);{var ft=kt=>{{let St=Le(()=>c(oe)||c(pe)),Ut=Le(()=>ke()?"mx-auto":"");Gt(kt,{onclick:()=>J(),get disabled(){return c(St)},size:"default",get class(){return`px-6 py-5 text-base font-semibold rounded-lg shadow-md hover:shadow-md transition-all ${c(Ut)??""}`},children:(Ft,wt)=>{var zt=qe(),Nt=je(zt);{var Yt=mr=>{var H=Gz();N(mr,H)},ir=mr=>{var H=pn();Te(()=>Oe(H,(c(p),O(()=>c(p).submitButtonLabel)))),N(mr,H)};se(Nt,mr=>{c(pe)?mr(Yt):mr(ir,!1)})}N(Ft,zt)},$$slots:{default:!0}})}},Ue=kt=>{var St=qe(),Ut=je(St);{var Ft=wt=>{Gt(wt,{onclick:R,get disabled(){return c(v)},size:"default",variant:"default",class:"px-6 py-5 text-base font-semibold rounded-md shadow-md hover:shadow-md transition-all ",children:(zt,Nt)=>{dr();var Yt=pn();Te(()=>Oe(Yt,(c(p),O(()=>c(p).nextButtonLabel)))),N(zt,Yt)},$$slots:{default:!0}})};se(Ut,wt=>{ke()||wt(Ft)},!0)}N(kt,St)};se(lt,kt=>{te()?kt(ft):kt(Ue,!1)})}D(De),N(we,De)};se(B,we=>{S()?we(fe):we(me,!1)},!0)}N(xe,Ne)};se(z,xe=>{I()?xe(W):xe(Q,!1)})}D(C),N(i,C),rt(),d()}var Yz=ee('<div data-slot="progress-indicator" class="bg-primary h-full w-full flex-1 transition-all"></div>');function Kz(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"max",3,100),d=qt(n,["$$slots","$$events","$$legacy","ref","class","max","value"]);var p=qe(),m=je(p);{let h=ht(()=>jr("bg-primary/20 relative w-full overflow-hidden rounded-full",n.class));Ca(m,()=>b1,(g,v)=>{v(g,Mt({"data-slot":"progress",get class(){return c(h)},get value(){return n.value},get max(){return l()}},()=>d,{get ref(){return u()},set ref(y){u(y)},children:(y,k)=>{var b=Yz();Te(()=>$o(b,`transform: translateX(-${100-100*(n.value??0)/(l()??1)}%)`)),N(y,b)},$$slots:{default:!0}}))})}N(i,p),rt()}const Hz="encatch-forms",Mn="form-responses",Xz=1;async function oc(){return new Promise((i,n)=>{if(typeof window>"u"||!window.indexedDB){n(new Error("IndexedDB is not available in this environment"));return}const u=indexedDB.open(Hz,Xz);u.onerror=()=>{console.error("[IndexedDB] Error opening database:",u.error),n(u.error)},u.onsuccess=()=>{i(u.result)},u.onupgradeneeded=l=>{const d=l.target.result;d.objectStoreNames.contains(Mn)||d.createObjectStore(Mn,{keyPath:"id"})}})}async function eN(i,n){try{const u=await oc();return new Promise((l,d)=>{const p=u.transaction([Mn],"readwrite"),m=p.objectStore(Mn),h={id:i,responses:n,timestamp:Date.now()},g=m.put(h);g.onsuccess=()=>{l()},g.onerror=()=>{console.error("[IndexedDB] Error saving data:",g.error),d(g.error)},p.oncomplete=()=>{u.close()}})}catch(u){throw console.error("[IndexedDB] Error in saveFormData:",u),u}}async function tN(i){try{const n=await oc();return new Promise((u,l)=>{const d=n.transaction([Mn],"readonly"),p=d.objectStore(Mn).get(i);p.onsuccess=()=>{const m=p.result;m&&m.responses?u(m.responses):u(null)},p.onerror=()=>{console.error("[IndexedDB] Error loading data:",p.error),l(p.error)},d.oncomplete=()=>{n.close()}})}catch(n){throw console.error("[IndexedDB] Error in loadFormData:",n),n}}async function Cb(i){try{const n=await oc();return new Promise((u,l)=>{const d=n.transaction([Mn],"readwrite"),p=d.objectStore(Mn).delete(i);p.onsuccess=()=>{u()},p.onerror=()=>{console.error("[IndexedDB] Error clearing data:",p.error),l(p.error)},d.oncomplete=()=>{n.close()}})}catch(n){throw console.error("[IndexedDB] Error in clearFormData:",n),n}}class rN extends EventTarget{subscriptions=new Map;targetOrigin="*";matchesFilter(n,u){return!u||u==="*"||u===null||u===void 0?!0:typeof u=="string"?n===u:Array.isArray(u)?u.includes(n||""):typeof u=="function"?u(n||""):!1}getFormIdFromPayload(n){return n?.feedbackConfigurationId}publish(n,u,l){typeof window<"u"&&window.dispatchEvent(new CustomEvent(n,{detail:u,bubbles:!0})),l?.usePostMessage!==!1&&this.sendPostMessage(n,u)}subscribe(n,u,l){const d=Symbol("subscription"),p={eventType:n,handler:u,filter:l?.formId,id:d,once:l?.once};this.subscriptions.has(n)||this.subscriptions.set(n,[]),this.subscriptions.get(n).push(p);const m=h=>{const g=h,v=this.getFormIdFromPayload(g.detail);this.matchesFilter(v,l?.formId)&&(u(g.detail),l?.once&&typeof window<"u"&&window.removeEventListener(n,m))};return typeof window<"u"&&window.addEventListener(n,m),()=>{this.unsubscribe(d),typeof window<"u"&&window.removeEventListener(n,m)}}unsubscribe(n){for(const[u,l]of this.subscriptions.entries()){const d=l.findIndex(p=>p.id===n);if(d!==-1){l.splice(d,1),l.length===0&&this.subscriptions.delete(u);break}}}subscribeAll(n,u){const l=["form:view","form:submit","form:close","form:section:change","form:question:answered","form:error"],d=[];return l.forEach(p=>{const m=this.subscribe(p,h=>n(p,h),u);d.push(m)}),()=>{d.forEach(p=>p())}}getSubscriptionCount(n){return n?this.subscriptions.get(n)?.length||0:Array.from(this.subscriptions.values()).reduce((u,l)=>u+l.length,0)}clearSubscriptions(n){n?this.subscriptions.delete(n):this.subscriptions.clear()}sendPostMessage(n,u){const l={type:`encatch:${n}`,payload:u,source:"encatch-form-engine"};window.parent&&window.parent!==window&&window.parent.postMessage(l,this.targetOrigin),document.querySelectorAll("iframe").forEach(d=>{d.contentWindow&&d.contentWindow.postMessage(l,this.targetOrigin)}),typeof window.ReactNativeWebView<"u"&&window.ReactNativeWebView.postMessage(JSON.stringify({action:n.replace("form:",""),data:JSON.stringify(u)}))}}const Ei=new rN;var nN=ee('<div class="flex items-center justify-center min-h-[400px] bg-primary-foreground"><div class="text-center"><div class="inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary mb-4"></div> <p class="text-sm text-muted-foreground">Loading your previous responses...</p></div></div>'),iN=ee('<div class="flex-shrink-0" style="height: 3px; min-height: 3px; max-height: 3px;"><!></div>'),oN=ee('<div class="bg-background flex items-center justify-center py-2"><img alt="encatch Logo" class="mr-2 h-5 w-5"/> <p class="m-0 text-xs font-medium text-muted-foreground">Powered by encatch</p></div>'),aN=ee('<!> <div class="form-content-container custom-scrollbar bg-background"><!></div> <!> <!>',1),sN=ee('<div id="encatch-form-id"><!></div>');function ac(i,n){tt(n,!1);const u=()=>Lv(T,"$formResponses",l),[l,d]=Pv(),p=re(),m=re(),h=re(),g=re(),v=re(),y=re(),k=re(),b=re(),I=re(),S=re(),{formResponses:T,updateQuestionResponse:G,bulkUpdateResponses:te}=hn();let ae=w(n,"theme",28,()=>({dark:{brandColor:"#000",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000",theme:"{}"},light:{brandColor:"#fff",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff",theme:"{}"}})),K=w(n,"currentMode",12,"light"),V=w(n,"currentLanguage",28,()=>({value:"en",label:"en"})),E=w(n,"questions",28,()=>({})),A=w(n,"questionLanguages",28,()=>[]),Y=w(n,"otherConfigurationProperties",12,null),ne=w(n,"welcomeScreenProperties",12,null),_e=w(n,"endScreenProperties",12,null),Ee=w(n,"translations",28,()=>({})),Fe=w(n,"sections",24,()=>[]),ie=w(n,"themeSettings",12,null),ke=w(n,"onClose",12,void 0),pe=w(n,"onSectionChange",8,void 0),oe=w(n,"apiKey",8,void 0),ue=w(n,"hostUrl",8,void 0),J=w(n,"feedbackConfigId",8,void 0),M=w(n,"identifier",8,void 0),R=w(n,"persistMode",8,"none"),C=w(n,"instanceId",8,void 0),z=re(0),W=re(!1),Q=re(0),xe=re(!1),Ne=re({}),B=re((()=>{let L=[...Fe()||[]];const q=ne()?.isEnabled??!0,We=_e()?.isEnabled??!0;return q&&L.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),We&&L.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),L})()),fe=re(!1),me=re();const we=L=>{if(!L)return document.documentElement;let q=L;for(;q;){if(q.parentNode&&q.parentNode instanceof ShadowRoot)return L;q=q.parentNode}return document.documentElement},De=()=>{const L=window;return typeof window<"u"&&L.encatchAnnotate!==void 0&&typeof L.encatchAnnotate=="object"&&L.encatchAnnotate!==null&&typeof L.encatchAnnotate.getAnnotation=="function"},Ge=()=>{if(De()){const L=window.encatchAnnotate?.getAnnotation?.();L&&Object.entries(E()).forEach(([q,We])=>{We.type===a.QuestionTypes.ANNOTATION&&G(q,L,a.QuestionTypes.ANNOTATION)})}},Ke=(L,q,We,Qe,Ie="")=>L.map(Be=>{let Re=Ie?`${Ie}.children.${Be.id}.label`:`option.${Be.id}.label`,or=Qe[q]?.[We]?.[Re],Vt={...Be};return or&&(Vt.label=or),Be.children&&Be.children.length>0&&(Vt.children=Ke(Be.children,q,We,Qe,Ie?`${Ie}.children.${Be.id}`:`option.${Be.id}`)),Vt}),Je=L=>{console.log("🟣 [App.svelte] updateTranslatedQuestions called with lang:",L),console.log("🟣 [App.svelte] Original questions before translation:",E());const q=Ee()||{},We=Object.fromEntries(Object.entries(E()).map(([Qe,Ie])=>{const Be=q[Qe]?.[L]||{};let Re={...Ie};return Ie.type===a.QuestionTypes.SINGLE_CHOICE&&console.log(`🟣 [App.svelte] Processing single_choice question ${Qe}:`,{originalHasOptions:"options"in Ie,originalOptions:Ie.options,originalOptionsType:typeof Ie.options,originalIsArray:Array.isArray(Ie.options),spreadHasOptions:"options"in Re,spreadOptions:Re.options,spreadOptionsType:typeof Re.options,spreadIsArray:Array.isArray(Re.options)}),Be.title&&(Re.title=Be.title),Be.description&&(Re.description=Be.description),Be.errorMessage&&(Re.errorMessage=Be.errorMessage),Ie.type===a.QuestionTypes.SHORT_ANSWER||Ie.type===a.QuestionTypes.LONG_TEXT?Be.placeholder&&(Re.placeholder=Be.placeholder):Ie.type===a.QuestionTypes.RATING||Ie.type===a.QuestionTypes.NPS?(Be.minLabel&&(Re.minLabel=Be.minLabel),Be.maxLabel&&(Re.maxLabel=Be.maxLabel)):Ie.type===a.QuestionTypes.ANNOTATION&&(Be.annotationText&&(Re.annotationText=Be.annotationText),Be.noAnnotationText&&(Re.noAnnotationText=Be.noAnnotationText)),Ie.type===a.QuestionTypes.SINGLE_CHOICE?(console.log(`🟣 [App.svelte] Handling single_choice options for ${Qe}:`,{"options in q":"options"in Ie,"q.options":Ie.options,"q.options type":typeof Ie.options,"q.options isArray":Array.isArray(Ie.options),"newQ.options before":Re.options,"newQ.options type before":typeof Re.options,"newQ.options isArray before":Array.isArray(Re.options)}),"options"in Ie&&Ie.options&&Array.isArray(Ie.options)?(Re.options=Ke(Ie.options,Qe,L,q),console.log(`🟣 [App.svelte] Translated options for ${Qe}:`,Re.options)):"options"in Ie&&Ie.options?(Re.options=Array.isArray(Ie.options)?[...Ie.options]:Ie.options,console.log(`🟣 [App.svelte] Preserved non-array options for ${Qe}:`,Re.options)):Re.options||(Re.options=Ie.options||[],console.log(`🟣 [App.svelte] Set fallback options for ${Qe}:`,Re.options)),console.log(`🟣 [App.svelte] Final options for ${Qe}:`,{finalOptions:Re.options,finalType:typeof Re.options,finalIsArray:Array.isArray(Re.options),finalLength:Array.isArray(Re.options)?Re.options.length:"N/A"})):(Ie.type===a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE&&"options"in Ie&&Ie.options&&Array.isArray(Ie.options)||Ie.type===a.QuestionTypes.NESTED_SELECTION&&"options"in Ie&&Ie.options&&Array.isArray(Ie.options))&&(Re.options=Ke(Ie.options,Qe,L,q)),[Qe,Re]}));console.log("🟣 [App.svelte] New questions after translation:",We),Object.entries(We).forEach(([Qe,Ie])=>{Ie.type===a.QuestionTypes.SINGLE_CHOICE&&console.log(`🟣 [App.svelte] Final single_choice question ${Qe}:`,{id:Ie.id,type:Ie.type,title:Ie.title,hasOptions:"options"in Ie,options:Ie.options,optionsType:typeof Ie.options,isArray:Array.isArray(Ie.options),optionsLength:Array.isArray(Ie.options)?Ie.options.length:"N/A",fullQuestion:Ie})}),E(We)},lt=()=>c(B).reduce((L,q)=>L+q.questionIds.length,0),ft=()=>u().questions.filter(L=>{try{if(L.type===a.QuestionTypes.SHORT_ANSWER){if(!L.answer||typeof L.answer!="object")return!1;const q=L.answer.shortAnswer;if(q==null||typeof q=="string"&&q.trim()==="")return!1}if(L.type===a.QuestionTypes.LONG_TEXT){if(!L.answer||typeof L.answer!="object")return!1;const q=L.answer.longText;if(q==null||typeof q=="string"&&q.trim()==="")return!1}return!0}catch(q){return console.error("Error checking answer:",L.questionId,q),!0}}).length,Ue=()=>ft()/lt()*100,kt=(L,q,We)=>{let Qe=q;Array.isArray(q)&&(Qe=[...q]),G(L,Qe,We),$(Ne,{...c(Ne),[L]:""}),Ei.publish("form:question:answered",{feedbackConfigurationId:C()||"",questionId:L,questionType:We,answer:Qe,timestamp:Date.now()})},St=()=>{if(c(Q)>0){const L=c(Q)-1;$(Q,L),pe()?.(L),Ei.publish("form:section:change",{feedbackConfigurationId:C()||"",sectionIndex:L,sectionId:c(B)[L]?.id||"",timestamp:Date.now()})}},Ut=()=>{if(c(Q)<c(B).length-1){const L=c(Q)+1;$(Q,L),pe()?.(L),Ei.publish("form:section:change",{feedbackConfigurationId:C()||"",sectionIndex:L,sectionId:c(B)[L]?.id||"",timestamp:Date.now()})}},Ft=()=>{Ei.publish("form:submit",{feedbackConfigurationId:C()||"",feedbackIdentifier:M()||"",response:{questions:u().questions},timestamp:Date.now()});const L=c(B).findIndex(q=>q.id==="thankyou_screen");if(L!==-1&&($(Q,L),pe()?.(L)),$(xe,!0),window.encatch?._internal?.submitFeedback?window.encatch._internal.submitFeedback({response:{questions:u().questions},action:"S",feedbackConfigurationId:J()||"",feedbackIdentifier:M()||"",duration:0}):console.error("window.encatch._internal.submitFeedback is not available"),R()==="retain"&&J()&&M()){const q=`${J()}_${M()}`;Cb(q).then(()=>{}).catch(We=>{console.error("[App] Error clearing saved data after submission:",We)})}},wt=()=>{Ei.publish("form:close",{feedbackConfigurationId:C()||"",feedbackIdentifier:M(),timestamp:Date.now()}),ke()?.()},zt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMDAgMTAwMDsiIAogIGhlaWdodD0iMjAiCiAgd2lkdGg9IjIwIgogIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMzODQ4OUQ7fQoJLnN0MXtmaWxsOiMxRjFCNEY7fQoJLnN0MntmaWxsOiNGN0I5Mjg7fQoJLnN0M3tmaWxsOiMwMEI4N0E7fQoJLnN0NHtmaWxsOiNFMDI0NUU7fQoJLnN0NXtmaWxsOiNGRkZGRkY7fQoJLnN0NntmaWxsOiNGOEZFRkY7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDUiIGQ9Ik00MDQuOCwyMTAuOEMzMDkuMSwyNDEuOSwyMzQsMzE3LjYsMjAzLjIsNDEzLjRjLTYxLjMsMTkwLjEsNDcuOSwzNjguNSwyMTIuNSw0MjBjNS43LDEuOCwxMS42LTIuNSwxMS42LTguNQoJCXYtNjkuN2MwLTMuNi0yLjItNi44LTUuNi04LjJDMzMyLjQsNzEwLjcsMjY5LjMsNjIzLDI2OS4zLDUyMC44YzAtMTM0LjcsMTA5LjYtMjQ0LjIsMjQ0LjItMjQ0LjJjMTE5LjMsMCwyMTguOCw4NS43LDIzOS45LDE5OC45CgkJYzAuMywxLjktMS4xLDMuNi0zLDMuNmgtMzcuNGMtOC44LDAtMTUuOSw3LjEtMTUuOSwxNS45djQ3LjJjMCwxMS4xLDMuOSwyMC42LDE1LDIwLjZsNDUuNi0wLjNoNDEuN3YtMC4yaDM0LjEKCQljNC4yLDAsNy42LTMuNCw3LjYtNy42di0zMy44Qzg0MS4xLDMwNC45LDYzMS40LDEzNy4yLDQwNC44LDIxMC44eiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTI2NSw3MTYuOGwtMTUuNCwxMTYuNmMtMC40LDIuOCwyLjUsNC45LDUsMy43TDM2OCw3ODUuN2MyLjYtMS4yLDIuOC00LjcsMC41LTYuMmwtOTcuOS02NS4yCgkJQzI2OC40LDcxMi44LDI2NS40LDcxNC4xLDI2NSw3MTYuOHoiLz4KCTxwYXRoIGNsYXNzPSJzdDUiIGQ9Ik02NjYuMyw1NjMuM2gtNzguNmMtMi41LDAtNC41LTItNC41LTQuNXYtNzguNmMwLTIuNSwyLTQuNSw0LjUtNC41aDc4LjZjMi41LDAsNC41LDIsNC41LDQuNXY3OC42CgkJQzY3MC45LDU2MS4yLDY2OC44LDU2My4zLDY2Ni4zLDU2My4zeiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTQ0NC4yLDU2My4zaC03Ni41Yy0zLjEsMC01LjUtMi41LTUuNS01LjV2LTc2LjVjMC0zLjEsMi41LTUuNSw1LjUtNS41aDc2LjVjMy4xLDAsNS41LDIuNSw1LjUsNS41djc2LjUKCQlDNDQ5LjcsNTYwLjgsNDQ3LjIsNTYzLjMsNDQ0LjIsNTYzLjN6Ii8+Cgk8cGF0aCBjbGFzcz0ic3Q1IiBkPSJNNTU1LjMsNTYzLjNoLTc3LjZjLTIuOCwwLTUtMi4zLTUtNXYtNzcuNmMwLTIuOCwyLjMtNSw1LTVoNzcuNmMyLjgsMCw1LDIuMyw1LDV2NzcuNgoJCUM1NjAuMyw1NjEsNTU4LDU2My4zLDU1NS4zLDU2My4zeiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTY4My45LDI1NC45Yy0xODMuOS0xMTMuMi00MzUuMi0zNi41LTQ5MS4zLDE5NWMtMjMuNyw5Ny44LDEuNSwyMDEuNCw2Ni45LDI3Ny45CgkJYzEyOS44LDE1MS44LDMzOSwxNTIuMyw0NjkuMSwzOS4xYzQuNS0zLjksMy45LTExLjItMS4yLTE0LjNsLTU5LjMtMzYuNWMtMy4xLTEuOS03LTEuNy05LjksMC41Yy03Ny43LDU3LTE4NS41LDY0LjgtMjcyLjUsMTEuMwoJCWMtMTE0LjgtNzAuNi0xNTAuNi0yMjEuMy04MC0zMzZjNjIuNS0xMDEuNiwxODcuNy0xNDEuNCwyOTUuMS0xMDAuMSIvPgo8L2c+Cjwvc3ZnPgo=",Nt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMDAgMTAwMDsiIAogIGhlaWdodD0iMjAiCiAgd2lkdGg9IjIwIgogIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMzODQ4OUQ7fQoJLnN0MXtmaWxsOiMxRjFCNEY7fQoJLnN0MntmaWxsOiNGN0I5Mjg7fQoJLnN0M3tmaWxsOiMwMEI4N0E7fQoJLnN0NHtmaWxsOiNFMDI0NUU7fQoJLnN0NXtmaWxsOiNGRkZGRkY7fQoJLnN0NntmaWxsOiNGOEZFRkY7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0zODEuOSwxOTkuNmMtOTUuNywzMS4xLTE3MC44LDEwNi44LTIwMS43LDIwMi42Yy02MS4zLDE5MC4xLDQ3LjksMzY4LjUsMjEyLjUsNDIwYzUuNywxLjgsMTEuNi0yLjUsMTEuNi04LjUKCQlWNzQ0YzAtMy42LTIuMi02LjgtNS42LTguMmMtODkuMy0zNi4zLTE1Mi40LTEyNC4xLTE1Mi40LTIyNi4yYzAtMTM0LjcsMTA5LjYtMjQ0LjIsMjQ0LjItMjQ0LjJjMTE5LjMsMCwyMTguOCw4NS43LDIzOS45LDE5OC45CgkJYzAuMywxLjktMS4xLDMuNi0zLDMuNmgtMzcuNGMtOC44LDAtMTUuOSw3LjEtMTUuOSwxNS45VjUzMWMwLDExLjEsMy45LDIwLjYsMTUsMjAuNmw0NS42LTAuM2g0MS43di0wLjJoMzQuMQoJCWM0LjIsMCw3LjYtMy40LDcuNi03LjZ2LTMzLjhDODE4LjIsMjkzLjcsNjA4LjUsMTI2LDM4MS45LDE5OS42eiIvPgoJPHBhdGggY2xhc3M9InN0MSIgZD0iTTI0Mi4xLDcwNS42bC0xNS40LDExNi42Yy0wLjQsMi44LDIuNSw0LjksNSwzLjdMMzQ1LDc3NC41YzIuNi0xLjIsMi44LTQuNywwLjUtNi4yTDI0Ny42LDcwMwoJCUMyNDUuNCw3MDEuNiwyNDIuNCw3MDIuOSwyNDIuMSw3MDUuNnoiLz4KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik02NDMuNCw1NTIuMWgtNzguNmMtMi41LDAtNC41LTItNC41LTQuNXYtNzguNmMwLTIuNSwyLTQuNSw0LjUtNC41aDc4LjZjMi41LDAsNC41LDIsNC41LDQuNXY3OC42CgkJQzY0Ny45LDU1MCw2NDUuOSw1NTIuMSw2NDMuNCw1NTIuMXoiLz4KCTxwYXRoIGNsYXNzPSJzdDMiIGQ9Ik00MjEuMiw1NTIuMWgtNzYuNWMtMy4xLDAtNS41LTIuNS01LjUtNS41VjQ3MGMwLTMuMSwyLjUtNS41LDUuNS01LjVoNzYuNWMzLjEsMCw1LjUsMi41LDUuNSw1LjV2NzYuNQoJCUM0MjYuOCw1NDkuNiw0MjQuMyw1NTIuMSw0MjEuMiw1NTIuMXoiLz4KCTxwYXRoIGNsYXNzPSJzdDQiIGQ9Ik01MzIuMyw1NTIuMWgtNzcuNmMtMi44LDAtNS0yLjMtNS01di03Ny42YzAtMi44LDIuMy01LDUtNWg3Ny42YzIuOCwwLDUsMi4zLDUsNVY1NDcKCQlDNTM3LjQsNTQ5LjgsNTM1LjEsNTUyLjEsNTMyLjMsNTUyLjF6Ii8+Cgk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNjYxLDI0My42Yy0xODMuOS0xMTMuMi00MzUuMi0zNi41LTQ5MS4zLDE5NWMtMjMuNyw5Ny44LDEuNSwyMDEuNCw2Ni45LDI3Ny45CgkJYzEyOS44LDE1MS44LDMzOSwxNTIuMyw0NjkuMSwzOS4xYzQuNS0zLjksMy45LTExLjItMS4yLTE0LjNsLTU5LjMtMzYuNWMtMy4xLTEuOS03LTEuNy05LjksMC41Yy03Ny43LDU3LTE4NS41LDY0LjgtMjcyLjUsMTEuMwoJCWMtMTE0LjgtNzAuNi0xNTAuNi0yMjEuMy04MC0zMzZDMzQ1LjIsMjc5LDQ3MC40LDIzOS4yLDU3Ny45LDI4MC41Ii8+CjwvZz4KPC9zdmc+Cg==";let Yt=re();he(()=>(x(C()),x(M()),x(J()),x(R()),x(V()),x(ne()),x(_e()),c(B),c(Q)),()=>{En(async()=>{Ei.publish("form:view",{feedbackConfigurationId:C()||"",feedbackIdentifier:M()||"",timestamp:Date.now()});const L=`${J()||"default"}_${M()||"default"}`;if(R()==="retain"){$(W,!0);try{const q=await tN(L);q&&q.length>0&&te(q)}catch(q){console.error("[App] Error loading saved data:",q)}finally{$(W,!1)}}else if(R()==="reset")try{await Cb(L)}catch(q){console.error("[App] Error clearing saved data:",q)}Ge(),window.updateEncatchForm=q=>{if(q.theme&&ae(q.theme),q.currentMode&&K(q.currentMode),q.currentLanguage&&(V(q.currentLanguage),V()?.value&&Je(V().value)),q.questions&&E(q.questions),q.questionLanguages&&A(q.questionLanguages),q.otherConfigurationProperties&&Y(q.otherConfigurationProperties),q.welcomeScreenProperties&&ne(q.welcomeScreenProperties),q.endScreenProperties){const We=_e()?.isEnabled,Qe=q.endScreenProperties.isEnabled;if(We&&!Qe){const Ie=c(B).findIndex(Be=>Be.id==="thankyou_screen");Ie===c(Q)&&$(Q,Math.max(0,Ie-1))}_e(q.endScreenProperties)}if(q.sections){const We=[...q.sections],Qe=q.welcomeScreenProperties?.isEnabled??ne()?.isEnabled??!0,Ie=q.endScreenProperties?.isEnabled??_e()?.isEnabled??!0;Qe&&!We.some(Be=>Be.id==="welcome_screen")&&We.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),Ie&&!We.some(Be=>Be.id==="thankyou_screen")&&We.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),$(B,We),Qe&&c(Q)===0&&$(Q,0)}q.translations&&(Ee(q.translations),V()?.value&&Je(V().value)),q.themeSettings&&ie(q.themeSettings),q.onClose&&ke(q.onClose)}})}),he(()=>(x(E()),a.QuestionTypes),()=>{E()&&Object.keys(E()).length>0&&(console.log("🔵 [App.svelte] Questions received:",E()),Object.entries(E()).forEach(([L,q])=>{q.type===a.QuestionTypes.SINGLE_CHOICE&&console.log(`🔵 [App.svelte] Single choice question ${L}:`,{id:q.id,type:q.type,title:q.title,hasOptions:"options"in q,options:q.options,optionsType:typeof q.options,isArray:Array.isArray(q.options),optionsLength:Array.isArray(q.options)?q.options.length:"N/A",fullQuestion:q})}))}),he(()=>x(Fe()),()=>{Fe()&&Fe().length>0&&console.log("🟢 [App.svelte] Sections received:",Fe())}),he(()=>x(Ee()),()=>{Ee()&&Object.keys(Ee()).length>0&&console.log("🟡 [App.svelte] Translations received:",Ee())}),he(()=>(c(me),x(ie()),x(K())),()=>{if(c(me)&&ie()&&ie().themes&&K()&&ie().themes[K()]){const L=we(c(me)),q=ie().themes[K()];if(q&&q.theme&&q.theme!=="{}")try{const We=JSON.parse(q.theme);Object.entries(We).forEach(([Qe,Ie])=>{Ie&&typeof Ie=="string"&&L.style.setProperty(Qe,Ie)})}catch(We){console.error("Error parsing theme JSON:",We)}}}),he(()=>x(K()),()=>{$(p,K()==="dark"?zt:Nt)}),he(()=>(x(V()),x(ne()),x(_e()),x(Y())),()=>{if(V()&&V().value){const L=V().value;Je(L),ne()?.translations?.[L]&&ne({...ne(),welcomeFields:{...ne().welcomeFields,...ne().translations[L]}}),_e()?.translations?.[L]&&_e().endFields&&_e({..._e(),endFields:{..._e().endFields,..._e().translations[L],dismissBehavior:_e().endFields.dismissBehavior??"fade",fadeDuration:_e().endFields.fadeDuration??300}}),Y()?.translations?.[L]&&Y().otherFields&&Y({...Y(),otherFields:{...Y().otherFields,...Y().translations[L],pagination:Y().otherFields.pagination??!1,questionNumber:Y().otherFields.questionNumber??!1,pageTitle:Y().otherFields.pageTitle??!1,blockerFeedback:Y().otherFields.blockerFeedback??!1}})}}),he(()=>(x(Fe()),x(ne()),x(_e()),c(Q),c(fe),c(xe)),()=>{const L=[...Fe()];let q=!1;const We=L.some(Re=>Re.id==="welcome_screen"),Qe=L.some(Re=>Re.id==="thankyou_screen"),Ie=ne()?.isEnabled??!0,Be=_e()?.isEnabled??!0;if(Ie&&!We)L.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),q=!0;else if(!Ie&&We){const Re=L.filter(or=>or.id!=="welcome_screen");Re.length!==L.length&&($(B,Re),q=!0)}if(Be&&!Qe)L.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),q=!0;else if(!Be&&Qe){const Re=L.filter(or=>or.id!=="thankyou_screen");if(Re.length!==L.length){const or=L.findIndex(Vt=>Vt.id==="thankyou_screen");(c(Q)===or||c(Q)>=Re.length)&&$(Q,Math.max(0,Re.length-1)),$(B,Re),q=!0}}q&&($(B,L),c(fe)||(!c(xe)&&!(!Be&&Qe)&&$(Q,0),$(fe,!0)))}),he(()=>(x(_e()),c(Q),c(B)),()=>{$(m,_e()?.isEnabled&&c(Q)===c(B).length-1)}),he(()=>c(B),()=>{$(h,c(B).filter(L=>L.id!=="welcome_screen"&&L.id!=="thankyou_screen").length===1)}),he(()=>(c(Q),c(B)),()=>{$(g,c(Q)===0&&c(B)[0]?.id==="welcome_screen")}),he(()=>(c(B),c(Q)),()=>{$(v,c(B)[c(Q)]?.id==="thankyou_screen")}),he(()=>c(Q),()=>{$(y,c(Q)===0)}),he(()=>(c(B),c(Q)),()=>{$(k,c(B)[0]?.id==="welcome_screen"&&c(Q)===1)}),he(()=>(c(B),c(Q)),()=>{$(b,(()=>{const L=c(B).findIndex(q=>q.id==="thankyou_screen");return L!==-1?c(Q)===L-1:c(Q)===c(B).length-1})())}),he(()=>(c(B),c(Q),c(g),c(v),u(),x(E())),()=>{$(I,(()=>{const L=c(B)[c(Q)];if(!L||c(g)||c(v))return!1;const q=L.questionIds||[],We=u().questions.reduce((Qe,Ie)=>(Qe[Ie.questionId]=Ie,Qe),{});for(const Qe of q){const Ie=E()[Qe],Be=!!We[Qe];if(Ie?.required&&!Be)return!0}return!1})())}),he(()=>(c(Q),c(B)),()=>{c(Q)>=0&&c(Q)<c(B).length}),he(()=>(u(),a.QuestionTypes),()=>{$(S,u().questions.reduce((L,q)=>{if(q.answer)switch(q.type){case a.QuestionTypes.RATING:L[q.questionId]=q.answer.rating;break;case a.QuestionTypes.NPS:L[q.questionId]=q.answer.nps;break;case a.QuestionTypes.LONG_TEXT:L[q.questionId]=q.answer.longText;break;case a.QuestionTypes.SHORT_ANSWER:L[q.questionId]=q.answer.shortAnswer;break;case a.QuestionTypes.SINGLE_CHOICE:L[q.questionId]=q.answer.singleChoice;break;case a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE:L[q.questionId]=[...q.answer.multipleChoiceMultiple||[]];break;case a.QuestionTypes.NESTED_SELECTION:L[q.questionId]=[...q.answer.nestedSelection||[]];break;default:L[q.questionId]=q.answer}else L[q.questionId]=null;return L},{}))}),he(()=>u(),()=>{u();const L=Ue();$(z,L)}),he(()=>(x(R()),x(J()),x(M()),c(W),c(Yt),u()),()=>{if(R()==="retain"&&J()&&M()&&!c(W)){const L=`${J()}_${M()}`;c(Yt)&&clearTimeout(c(Yt)),$(Yt,setTimeout(()=>{eN(L,u().questions).then(()=>{}).catch(q=>{console.error("[App] Error auto-saving to IndexedDB:",q)})},500))}}),he(()=>x(E()),()=>{E()&&Ge()}),fr(),er();var ir=sN(),mr=Z(ir);{var H=L=>{var q=nN();N(L,q)},ye=L=>{var q=aN(),We=je(q);{var Qe=ar=>{var Ve=iN(),ut=Z(Ve);Kz(ut,{get value(){return c(z)},max:100,class:"h-full w-full rounded-none bg-muted/40 [&_[data-slot=progress-indicator]]:bg-primary [&_[data-slot=progress-indicator]]:transition-all [&_[data-slot=progress-indicator]]:duration-300 [&_[data-slot=progress-indicator]]:ease-in-out"}),D(Ve),N(ar,Ve)};se(We,ar=>{x(ie()),c(g),c(v),O(()=>ie()?.featureSettings?.progressBar&&!c(g)&&!c(v))&&ar(Qe)})}var Ie=de(We,2),Be=Z(Ie);{let ar=Le(()=>Y()||{isEnabled:!1,otherFields:{pagination:!1,questionNumber:!1,pageTitle:!1,blockerFeedback:!1,submitButtonLabel:"Submit",previousButtonLabel:"Previous",nextButtonLabel:"Next",aiEnhancementSuccessMessage:"",aiEnhancementCooldownErrorMessage:"",aiEnhancementMaxReachedErrorMessage:""},translations:{}}),Ve=Le(()=>ne()||{isEnabled:!1,welcomeFields:{title:"Welcome",description:"",buttonLabel:"Start"},translations:{}}),ut=Le(()=>_e()||void 0),Dt=Le(()=>(x(V()),O(()=>V()?.value||"en"))),mt=Le(()=>(x(ie()),O(()=>ie()?.themes||{light:{brandColor:"#000",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff"},dark:{brandColor:"#fff",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000"}}))),gr=Le(()=>c(m)===!0);qz(Be,{get questions(){return E()},get sections(){return c(B)},get formData(){return c(S)},get errors(){return c(Ne)},onChange:kt,get currentMode(){return K()},get currentSectionIndex(){return c(Q)},get otherConfigurationProperties(){return c(ar)},get welcomeScreenProperties(){return c(Ve)},get endScreenProperties(){return c(ut)},get currentLanguage(){return c(Dt)},get themeSettings(){return c(mt)},onClose:wt,get isScreenVisible(){return c(gr)},get apiKey(){return oe()},get feedbackConfigurationId(){return J()},get hostUrl(){return ue()},get identifier(){return M()}})}D(Ie);var Re=de(Ie,2);{let ar=Le(()=>(x(V()),O(()=>V()?.value||"en"))),Ve=Le(()=>(x(ie()),O(()=>ie()?.themes||{light:{brandColor:"#000",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff"},dark:{brandColor:"#fff",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000"}})));Bz(Re,{get isWelcomeScreen(){return c(g)},get isThankYouScreen(){return c(v)},get isFirstSection(){return c(y)},get isFirstPageAfterWelcome(){return c(k)},get isLastSection(){return c(b)},get welcomeScreenProperties(){return ne()},get endScreenProperties(){return _e()},get otherConfigurationProperties(){return Y()},get currentMode(){return K()},get currentLanguage(){return c(ar)},handlePrevious:St,handleNext:Ut,handleSubmit:Ft,onClose:wt,get themeSettings(){return c(Ve)},get nextButtonDisabled(){return c(I)},get submitButtonDisabled(){return c(I)},get isSinglePageSurvey(){return c(h)}})}var or=de(Re,2);{var Vt=ar=>{var Ve=oN(),ut=Z(Ve);dr(2),D(Ve),Te(()=>si(ut,"src",c(p))),N(ar,Ve)};se(or,ar=>{x(ie()),O(()=>ie()?.featureSettings?.showBranding)&&ar(Vt)})}N(L,q)};se(mr,L=>{c(W)?L(H):L(ye,!1)})}D(ir),_r(ir,L=>$(me,L),()=>c(me)),Te(()=>mn(ir,1,`encatch-form ${K()==="dark"?"theme-dark dark":"theme-light"}`)),N(i,ir),rt(),d()}var uN=ee('<div class="fixed inset-0 transition-opacity duration-300"></div>'),lN=ee('<!> <div id="encatch-feedback-popup" class="rounded-xl shadow-2xl overflow-hidden"><!> <!></div>',1);function Ab(i,n){tt(n,!1);const u=re(),l=re(),d=Jv();let p=w(n,"themeMode",8,"light"),m=w(n,"feedbackConfiguration",8,null),h=w(n,"apiKey",8,""),g=w(n,"hostUrl",8,"");w(n,"deviceInfo",8,null),w(n,"sessionId",8,""),w(n,"userInfo",8,null);let v=w(n,"language",8,"en"),y=w(n,"configurationData",8,null),k=w(n,"onClose",8,void 0),b=w(n,"trackPopupHeight",8,void 0),I=w(n,"feedbackConfigId",8,void 0),S=w(n,"identifier",8,void 0),T=re(document.documentElement.clientWidth),G=re(!1),te=re(null),ae=re(),K;const V=()=>{if(c(ae)){const ie=c(ae).querySelector("#section-container");if(ie){const ke=window.innerHeight*.75,pe=ie.clientHeight,oe=84,ue=60,J=Math.min(pe+oe+ue,ke);c(ae).style.transition.includes("height")||qh(ae,c(ae).style.transition="height 0.5s cubic-bezier(0.4, 0, 0.2, 1)"),qh(ae,c(ae).style.height=`${J}px`),ie.style.overflowY=pe+oe+ue>ke?"auto":"hidden"}}},E=()=>{$(T,document.documentElement.clientWidth)},A=()=>{d.clearResponses(),$(G,!1),setTimeout(()=>{k()?.()},300)},Y=ie=>{const ke={position:"fixed",width:c(u),"max-width":c(u),height:"30%",transition:"transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease","transform-origin":"center center","will-change":"transform, opacity"};switch(ie){case"top-left":return{...ke,top:"12px",left:"12px",transform:"translate(0, 0)"};case"top-center":return{...ke,top:"12px",left:"50%",transform:"translate(-50%, 0)"};case"top-right":return{...ke,top:"12px",right:"12px",transform:"translate(0, 0)"};case"center-left":return{...ke,top:"50%",left:"12px",transform:"translateY(-50%)"};case"center":return{...ke,top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)"};case"center-right":return{...ke,top:"50%",right:"12px",transform:"translateY(-50%)"};case"bottom-left":return{...ke,bottom:"12px",left:"12px",transform:"translate(0, 0)"};case"bottom-center":return{...ke,bottom:"12px",left:"50%",transform:"translate(-50%, 0)"};case"bottom-right":return{...ke,bottom:"12px",right:"12px",transform:"translate(0, 0)"};case"bottom-full":return{...ke,bottom:"0",left:"50%",width:"100%","max-width":"100%",transform:"translate(-50%, 0)"};case"top-full":return{...ke,top:"0",left:"50%",width:"100%","max-width":"100%",transform:"translate(-50%, 0)"};case"full":return{...ke,top:"0",left:"0",width:"100%","max-width":"100%",height:"100%",transform:"translate(0, 0)"};default:return ke}},ne=ie=>Object.entries(ie).map(([ke,pe])=>`${ke}: ${pe}`).join("; ");En(()=>{window.addEventListener("resize",E),setTimeout(()=>{$(G,!0)},100),K=window.setInterval(V,5e3),b()&&b()(V),requestAnimationFrame(()=>{setTimeout(()=>V(),0)})}),bo(()=>{window.removeEventListener("resize",E),K&&window.clearInterval(K)}),he(()=>c(T),()=>{$(u,c(T)<=768?"95%":"600px")}),he(()=>x(y()),()=>{$(te,y())}),he(()=>c(te),()=>{c(te)?.feedbackIdentifier}),he(()=>x(m()),()=>{$(l,m()&&m().appearanceProperties&&m().appearanceProperties.selectedPosition?Y(m().appearanceProperties.selectedPosition):{})}),fr(),er();var _e=qe(),Ee=je(_e);{var Fe=ie=>{var ke=lN(),pe=je(ke);{var oe=z=>{var W=uN();Te(()=>$o(W,`background-color: ${x(m()),x(p()),O(()=>m().appearanceProperties.themes[p()].overlayColor)??""}; z-index: 1000; opacity: ${c(G)?"0.4":"0"};`)),N(z,W)};se(pe,z=>{x(m()),O(()=>m()?.appearanceProperties?.featureSettings?.darkOverlay)&&z(oe)})}var ue=de(pe,2),J=Z(ue);{var M=z=>{Gt(z,{variant:"ghost",size:"icon",class:"absolute top-3 right-3 z-10 h-8 w-8 rounded border-none bg-background text-primary hover:bg-accent hover:text-accent-foreground transition-all duration-200 active:scale-95",onclick:A,"aria-label":"Close popup",children:(W,Q)=>{Gv(W,{size:20,stroke:2})},$$slots:{default:!0}})};se(J,z=>{x(m()),O(()=>m()?.appearanceProperties?.featureSettings?.closeButton)&&z(M)})}var R=de(J,2);{var C=z=>{{let W=Le(()=>({value:v(),label:v()})),Q=Le(()=>(c(te),O(()=>c(te)?.questionnaireFields.questions||{}))),xe=Le(()=>(c(te),O(()=>c(te)?.questionnaireFields.selectedLanguages||[]))),Ne=Le(()=>(c(te),O(()=>c(te)?.questionnaireFields.translations||{}))),B=Le(()=>(c(te),O(()=>c(te)?.otherConfigurationProperties))),fe=Le(()=>(c(te),O(()=>c(te)?.welcomeScreenProperties))),me=Le(()=>(c(te),O(()=>c(te)?.endScreenProperties))),we=Le(()=>(c(te),O(()=>c(te)?.questionnaireFields.sections||[])));ac(z,{get theme(){return x(m()),O(()=>m().appearanceProperties.themes)},get themeSettings(){return x(m()),O(()=>m().appearanceProperties)},get currentMode(){return p()},get currentLanguage(){return c(W)},get questions(){return c(Q)},get questionLanguages(){return c(xe)},get translations(){return c(Ne)},get otherConfigurationProperties(){return c(B)},get welcomeScreenProperties(){return c(fe)},get endScreenProperties(){return c(me)},get sections(){return c(we)},onSectionChange:()=>{requestAnimationFrame(()=>{setTimeout(()=>V(),0)})},onClose:A,get apiKey(){return h()},get hostUrl(){return g()},get feedbackConfigId(){return I()},get identifier(){return S()}})}};se(R,z=>{x(m()),c(te),O(()=>m()?.appearanceProperties&&c(te))&&z(C)})}D(ue),_r(ue,z=>$(ae,z),()=>c(ae)),Te(z=>$o(ue,`${z??""}; background-color: ${x(m()),x(p()),O(()=>m()?.appearanceProperties?.themes?.[p()]?.overlayColor||"transparent")??""}; z-index: 1001;`),[()=>(c(l),O(()=>ne(c(l))))]),N(ie,ke)};se(Ee,ie=>{ie(Fe)})}N(i,_e),rt()}var cN=ee('<div class="encatch-scale-wrapper"><!></div>');function sc(i,n){tt(n,!1);const u=Jv();let l=w(n,"theme",28,()=>({dark:{brandColor:"#000",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000"},light:{brandColor:"#fff",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff"}})),d=w(n,"currentMode",12,"light"),p=w(n,"currentLanguage",28,()=>({value:"en",label:"en",isFixed:!0})),m=w(n,"questions",28,()=>({})),h=w(n,"questionLanguages",28,()=>[]),g=w(n,"otherConfigurationProperties",12,null),v=w(n,"welcomeScreenProperties",12,null),y=w(n,"endScreenProperties",12,null),k=w(n,"translations",28,()=>({})),b=w(n,"sections",28,()=>[]),I=w(n,"themeSettings",12,null),S=w(n,"onClose",12,void 0),T=w(n,"onSectionChange",12,void 0),G=w(n,"apiKey",12,void 0),te=w(n,"hostUrl",12,void 0),ae=w(n,"feedbackConfigId",12,void 0),K=w(n,"identifier",12,void 0),V=w(n,"cssLink",12,void 0),E=w(n,"scale",12,100),A=w(n,"persistMode",12,"none"),Y=w(n,"instanceId",12,void 0);const ne="https://app.dev.encatch.com/s/index-latest.css";let _e=re(!1),Ee=re(!1),Fe=re(!1),ie=re();const ke=z=>{if(!z)return null;let W=z;for(;W;){if(W instanceof ShadowRoot)return W;W=W.parentNode}return null},pe=z=>{const W=new CSSStyleSheet,Q=z/100;return W.replaceSync(`
279
+ */let u=qt(n,["$$slots","$$events","$$legacy"]);const l=[["path",{d:"M5 12h14"}]];Fa(i,Mt({name:"minus"},()=>u,{get iconNode(){return l},children:(d,p)=>{var m=qe(),h=je(m);Wt(h,()=>n.children??$t),N(d,m)},$$slots:{default:!0}})),rt()}var az=ee('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function sz(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"checked",15,!1),d=w(n,"indeterminate",15,!1),p=qt(n,["$$slots","$$events","$$legacy","ref","checked","indeterminate","class"]);var m=qe(),h=je(m);{const g=(y,k)=>{let b=()=>k?.().checked,I=()=>k?.().indeterminate;var S=az(),T=Z(S);{var G=ae=>{iz(ae,{class:"size-3.5"})},te=ae=>{var K=qe(),V=je(K);{var E=A=>{oz(A,{class:"size-3.5"})};se(V,A=>{I()&&A(E)},!0)}N(ae,K)};se(T,ae=>{b()?ae(G):ae(te,!1)})}D(S),N(y,S)};let v=ht(()=>jr("border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive shadow-xs peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border outline-none transition-shadow focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n.class));Ca(h,()=>m1,(y,k)=>{k(y,Mt({"data-slot":"checkbox",get class(){return c(v)}},()=>p,{get ref(){return u()},set ref(b){u(b)},get checked(){return l()},set checked(b){l(b)},get indeterminate(){return d()},set indeterminate(b){d(b)},children:g,$$slots:{default:!0}}))})}N(i,m),rt()}var uz=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),lz=ee('<span class="text-destructive ml-1">*</span>'),cz=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),dz=ee('<div class="flex items-start gap-2 text-sm text-destructive bg-destructive/5 px-4 ml-2 py-2 rounded-md border border-destructive/20"><span class="font-normal"> </span></div>'),fz=ee('<div class="flex items-center gap-2 text-sm text-amber-600 bg-amber-50 dark:bg-amber-950/30 dark:text-amber-500 px-3 py-2 rounded-md border border-amber-200 dark:border-amber-900"><span class="font-medium"> </span></div>'),pz=ee('<div class="flex items-center space-x-3"><!> <label> </label></div>'),mz=ee('<div class="flex flex-col gap-3"></div>'),gz=(i,n,u)=>n(c(u).value),hz=ee('<button type="button"> </button>'),vz=ee('<div class="flex flex-wrap gap-2 px-4"></div>'),bz=On('<svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M5 13l4 4L19 7"></path></svg>'),yz=ee('<span class="flex-1"> </span> <!>',1),$z=ee('<div class="flex flex-col gap-2 w-full px-2"></div>'),wz=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <!> <!></div>');function _z(i,n){tt(n,!1);const u=re(),{updateQuestionResponse:l,setQuestionError:d}=hn();let p=w(n,"question",8),m=w(n,"value",24,()=>[]),h=w(n,"onChange",8),g=w(n,"error",8,void 0),v=w(n,"currentMode",8,void 0),y=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);let k=re(m()||[]),b=re(g()),I=re(void 0),S=!1,T=re(!1);En(()=>{setTimeout(()=>{const C=G(c(k));$(b,C),C&&d(p().id,C),S=!0},0)});function G(C){if(p().required&&(!C||C.length===0))return p().errorMessage;const z=p().maxSelections;if(z!==void 0&&C.length>z)return p().errorMessage;const Q=p().minSelections;if(Q!==void 0&&C.length>0&&C.length<Q)return p().errorMessage}function te(C){if(!S)return;$(T,!0);const z=[...c(k)];if(z.includes(C)){const Q=z.filter(xe=>xe!==C);$(k,Q),h()(Q),$(I,void 0);const W=G(Q);$(b,W),l(p().id,Q,a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE,W)}else{const Q=p().maxSelections;if(Q!==void 0&&z.length>=Q){const W=p().errorMessage;$(I,W),l(p().id,z,a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE,void 0)}else{const W=[...z,C];$(k,W),h()(W),$(I,void 0);const xe=G(W);$(b,xe),l(p().id,W,a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE,xe)}}}he(()=>x(v()),()=>{$(u,v()==="dark")}),he(()=>(x(m()),c(T)),()=>{m()!==void 0&&!c(T)&&$(k,m())}),he(()=>x(g()),()=>{g()!==void 0&&$(b,g())}),fr(),er();var ae=wz(),K=Z(ae),V=Z(K);{var E=C=>{var z=uz(),Q=Z(z);D(z),Te(()=>Oe(Q,`${y()??""}.`)),N(C,z)};se(V,C=>{y()!==void 0&&C(E)})}var A=de(V,2),Y=Z(A),ne=Z(Y),_e=de(ne);{var Ee=C=>{var z=lz();N(C,z)};se(_e,C=>{x(p()),O(()=>p().required)&&C(Ee)})}D(Y);var Fe=de(Y,2);{var ie=C=>{var z=cz(),Q=Z(z,!0);D(z),Te(()=>Oe(Q,(x(p()),O(()=>p().description)))),N(C,z)};se(Fe,C=>{x(p()),O(()=>p().description)&&C(ie)})}D(A),D(K);var ke=de(K,2);{var pe=C=>{var z=dz(),Q=Z(z),W=Z(Q,!0);D(Q),D(z),Te(()=>Oe(W,c(b))),N(C,z)};se(ke,C=>{c(b)&&C(pe)})}var oe=de(ke,2);{var ue=C=>{var z=fz(),Q=Z(z),W=Z(Q,!0);D(Q),D(z),Te(()=>Oe(W,c(I))),N(C,z)};se(oe,C=>{c(I)&&C(ue)})}var J=de(oe,2);{var M=C=>{var z=mz();wr(z,5,()=>(x(p()),O(()=>p().options)),Lr,(Q,W)=>{const xe=Le(()=>(c(k),c(W),O(()=>c(k).includes(c(W).value)))),Ne=Le(()=>(x(p()),c(k),x(c(xe)),O(()=>p().maxSelections!==void 0&&c(k).length>=p().maxSelections&&!c(xe))));var B=pz(),fe=Z(B);{let De=Le(()=>(x(p()),c(W),O(()=>`${p().id}-${c(W).value}`))),Ge=Le(()=>(c(k),c(W),O(()=>c(k).includes(c(W).value))));sz(fe,{get id(){return c(De)},get checked(){return c(Ge)},onCheckedChange:()=>te(c(W).value),get disabled(){return c(Ne)},class:"h-5 w-5 rounded border-2 cursor-pointer transition-all data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=unchecked]:border-input data-[state=unchecked]:bg-background data-[state=checked]:text-primary-foreground disabled:opacity-50 disabled:cursor-not-allowed"})}var me=de(fe,2),we=Z(me,!0);D(me),D(B),Te(()=>{si(me,"for",(x(p()),c(W),O(()=>`${p().id}-${c(W).value}`))),mn(me,1,`text-sm font-medium cursor-pointer text-foreground hover:text-primary transition-colors select-none ${c(Ne)?"opacity-50 cursor-not-allowed":""}`),Oe(we,(c(W),O(()=>c(W).label)))}),N(Q,B)}),D(z),N(C,z)},R=C=>{var z=qe(),Q=je(z);{var W=Ne=>{var B=vz();wr(B,5,()=>(x(p()),O(()=>p().options)),Lr,(fe,me)=>{const we=Le(()=>(c(k),c(me),O(()=>c(k).includes(c(me).value)))),De=Le(()=>(x(p()),c(k),x(c(we)),O(()=>p().maxSelections!==void 0&&c(k).length>=p().maxSelections&&!c(we))));var Ge=hz();Ge.__click=[gz,te,me];var Ke=Z(Ge,!0);D(Ge),Te(()=>{Ge.disabled=c(De),mn(Ge,1,`rounded-full px-4 py-2 text-sm font-medium transition-all border-2 ${c(we)?"bg-primary/10 text-primary border-primary border-[2px] hover:bg-primary/50 hover:text-primary-foreground dark:border-primary/90 dark:bg-primary dark:hover:bg-primary":"bg-card text-card-foreground border-border hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"} ${c(De)?"opacity-50 cursor-not-allowed":"hover:scale-105 cursor-pointer"}`),Oe(Ke,(c(me),O(()=>c(me).label)))}),N(fe,Ge)}),D(B),N(Ne,B)},xe=Ne=>{var B=qe(),fe=je(B);{var me=we=>{var De=$z();wr(De,5,()=>(x(p()),O(()=>p().options)),Lr,(Ge,Ke)=>{const Je=Le(()=>(c(k),c(Ke),O(()=>c(k).includes(c(Ke).value)))),lt=Le(()=>(x(p()),c(k),x(c(Je)),O(()=>p().maxSelections!==void 0&&c(k).length>=p().maxSelections&&!c(Je))));{let ft=Le(()=>`justify-start text-left px-4 py-6 text-sm font-medium transition-all rounded-lg shadow-none relative ${c(Je)?"bg-primary/10 text-primary border-primary border-[2px] hover:bg-primary/50 hover:text-primary-foreground dark:border-primary/90 dark:bg-primary dark:hover:bg-primary":"bg-card text-card-foreground border-[2px] hover:border-primary hover:bg-accent/50 dark:hover:bg-primary/20 dark:hover:text-card-foreground"} ${c(lt)?"opacity-50 cursor-not-allowed":""}`);Gt(Ge,{type:"button",variant:"outline",get disabled(){return c(lt)},get class(){return c(ft)},onclick:()=>te(c(Ke).value),onkeydown:Ue=>Ue.key==="Enter"&&te(c(Ke).value),children:(Ue,kt)=>{var St=yz(),Ut=je(St),Ft=Z(Ut,!0);D(Ut);var wt=de(Ut,2);{var zt=Nt=>{var Yt=bz();N(Nt,Yt)};se(wt,Nt=>{c(Je)&&Nt(zt)})}Te(()=>Oe(Ft,(c(Ke),O(()=>c(Ke).label)))),N(Ue,St)},$$slots:{default:!0}})}}),D(De),N(we,De)};se(fe,we=>{x(p()),O(()=>p().displayStyle==="list")&&we(me)},!0)}N(Ne,B)};se(Q,Ne=>{x(p()),O(()=>p().displayStyle==="chip")?Ne(W):Ne(xe,!1)},!0)}N(C,z)};se(J,C=>{x(p()),O(()=>p().displayStyle==="checkbox"||!p().displayStyle)?C(M):C(R,!1)})}D(ae),Te(()=>Oe(ne,`${x(p()),O(()=>p().title)??""} `)),N(i,ae),rt()}xl(["click"]);function kz(i,n,u,l,d,p,m,h,g){c(n)||$(n,!0),$(u,!1),$(l,void 0),d()(void 0);const v=p(void 0);$(m,v),h(g().id,void 0,a.QuestionTypes.ANNOTATION,v)}var xz=ee('<span class="text-lg font-medium text-muted-foreground min-w-[1.25rem]"> </span>'),Sz=ee('<span class="text-destructive ml-1">*</span>'),Iz=ee('<p class="text-sm text-muted-foreground leading-relaxed"> </p>'),zz=ee('<div class="flex items-center gap-2 text-sm text-destructive bg-destructive/5 px-4 mx-4 py-2 rounded-md border border-destructive/20"><svg class="w-4 h-4 shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> <span class="font-normal"> </span></div>'),Nz=ee('<div class="group relative border-2 border-dashed border-border hover:border-primary/50 rounded-xl bg-muted/30 hover:bg-muted/50 transition-all cursor-pointer overflow-hidden"><div class="flex items-center justify-center gap-3 px-6 py-8"><div class="w-12 h-12 rounded-full bg-background shadow-sm flex items-center justify-center group-hover:scale-110 transition-transform"><!></div> <div class="flex flex-col"><span class="text-sm font-semibold text-foreground"> </span> <span class="text-xs text-muted-foreground">Click to add annotation</span></div></div></div>'),Tz=ee('<div class="relative border-2 border-primary/20 rounded-xl bg-primary/5 overflow-hidden shadow-sm hover:shadow-md transition-all"><div class="flex items-center justify-between gap-3 px-6 py-4"><div class="flex items-center gap-3 flex-1 min-w-0"><div class="w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0"><!></div> <div class="flex flex-col flex-1 min-w-0"><span class="text-sm font-semibold text-foreground truncate"> </span> <span class="text-xs text-muted-foreground">Annotation added</span></div></div> <button class="w-8 h-8 rounded-full bg-destructive/10 hover:bg-destructive/20 text-destructive flex items-center justify-center transition-colors flex-shrink-0" type="button" aria-label="Remove annotation"><!></button></div></div>'),jz=ee('<div class="w-full space-y-4"><div class="flex text-left items-start gap-3"><!> <div class="flex-1 space-y-1.5"><div class="text-lg font-medium text-foreground leading-tight"> <!></div> <!></div></div> <!> <div class="w-full"><!> <!></div></div>');function Oz(i,n){tt(n,!1);const u=re(),{updateQuestionResponse:l,setQuestionError:d,formResponses:p}=hn();let m=w(n,"question",8),h=w(n,"value",8,void 0),g=w(n,"onChange",8),v=w(n,"error",8,void 0),y=w(n,"currentMode",8,void 0),k=w(n,"questionNumber",8,void 0);w(n,"themeSettings",8,void 0),w(n,"currentLanguage",8,void 0);let b=re(!1),I=re(void 0),S=re(v()),T=re(!1);En(()=>{const R=ko(p).questions.find(C=>C.questionId===m().id);if(R?.answer&&"annotation"in R.answer){const C=R.answer.annotation;$(I,C),$(b,!0),typeof C=="object"&&C!==null&&g()(C)}setTimeout(()=>{const C=c(I),z=G(C);$(S,z),z&&d(m().id,z)},0)});function G(R){let C="";if(typeof R=="string"?C=R:R&&typeof R=="object"&&(C="has_annotation_data"),m().required&&(!C||C.trim()===""))return m().errorMessage??"This field is required"}he(()=>x(y()),()=>{$(u,y()==="dark")}),he(()=>(x(h()),x(g())),()=>{if(h()!==void 0){if(typeof h()=="string"){const R=h().trim()!=="";$(b,R),$(I,h())}else if(typeof h()=="object"&&h()!==null&&"annotation"in h()){const R=h().annotation;$(b,!0),$(I,R),g()(R)}}else $(I,void 0),$(b,!1)}),he(()=>x(v()),()=>{v()!==void 0&&$(S,v())}),fr(),er();var te=jz(),ae=Z(te),K=Z(ae);{var V=R=>{var C=xz(),z=Z(C);D(C),Te(()=>Oe(z,`${k()??""}.`)),N(R,C)};se(K,R=>{k()!==void 0&&R(V)})}var E=de(K,2),A=Z(E),Y=Z(A),ne=de(Y);{var _e=R=>{var C=Sz();N(R,C)};se(ne,R=>{x(m()),O(()=>m().required)&&R(_e)})}D(A);var Ee=de(A,2);{var Fe=R=>{var C=Iz(),z=Z(C,!0);D(C),Te(()=>Oe(z,(x(m()),O(()=>m().description)))),N(R,C)};se(Ee,R=>{x(m()),O(()=>m().description)&&R(Fe)})}D(E),D(ae);var ie=de(ae,2);{var ke=R=>{var C=zz(),z=de(Z(C),2),Q=Z(z,!0);D(z),D(C),Te(()=>Oe(Q,c(S))),N(R,C)};se(ie,R=>{c(S)&&c(T)&&R(ke)})}var pe=de(ie,2),oe=Z(pe);{var ue=R=>{var C=Nz(),z=Z(C),Q=Z(z),W=Z(Q);Qv(W,{size:24,class:"text-muted-foreground group-hover:text-primary transition-colors"}),D(Q);var xe=de(Q,2),Ne=Z(xe),B=Z(Ne,!0);D(Ne),dr(2),D(xe),D(z),D(C),Te(()=>Oe(B,(x(m()),O(()=>m().noAnnotationText??"No Annotation")))),N(R,C)};se(oe,R=>{c(b)||R(ue)})}var J=de(oe,2);{var M=R=>{var C=Tz(),z=Z(C),Q=Z(z),W=Z(Q),xe=Z(W);Qv(xe,{size:20,class:"text-primary"}),D(W);var Ne=de(W,2),B=Z(Ne),fe=Z(B,!0);D(B),dr(2),D(Ne),D(Q);var me=de(Q,2);me.__click=[kz,T,b,I,g,G,S,l,m];var we=Z(me);Gv(we,{size:16}),D(me),D(z),D(C),Te(()=>Oe(fe,(x(m()),O(()=>m().annotationText??"Annotation")))),N(R,C)};se(J,R=>{c(b)&&R(M)})}D(pe),D(te),Te(()=>Oe(Y,`${x(m()),O(()=>m().title)??""} `)),N(i,te),rt()}xl(["click"]);var Ez=ee('<p class="text-muted-foreground text-[1rem] leading-[1.5rem]"> </p>'),Cz=ee('<div class="flex flex-col items-center text-center mb-0 w-full mt-[8px]"><h2 class="text-foreground font-[600] text-[1.5rem] mb-[1rem]"> </h2> <!></div>');function Az(i,n){tt(n,!1);const u=re(),l=re();let d=w(n,"welcomeScreenProperties",8,null);w(n,"onStart",8,void 0);let p=w(n,"currentMode",8,void 0),m=w(n,"currentLanguage",8,void 0);w(n,"themeSettings",8,void 0),he(()=>x(p()),()=>{$(u,p()==="dark")}),he(()=>(x(d()),x(m())),()=>{$(l,d()?.translations&&m()&&d().translations[m()]?d().translations[m()]:d()?.welcomeFields??{title:"Welcome to our survey!",description:"We value your feedback and appreciate your time.",buttonLabel:"Start"})}),fr(),er();var h=Cz(),g=Z(h),v=Z(g,!0);D(g);var y=de(g,2);{var k=b=>{var I=Ez(),S=Z(I,!0);D(I),Te(()=>Oe(S,(c(l),O(()=>c(l).description)))),N(b,I)};se(y,b=>{c(l),O(()=>c(l).description)&&b(k)})}D(h),Te(()=>Oe(v,(c(l),O(()=>c(l).title)))),N(i,h),rt()}var Mz=ee('<p class="text-muted-foreground text-[1rem] leading-[1.5rem]"> </p>'),Uz=ee('<div class="flex flex-col items-center text-center mb-0 w-full mt-[8px]"><h2 class="text-foreground font-[600] text-[1.5rem] mb-[1rem]"> </h2> <!></div>');function Dz(i,n){tt(n,!1);const u=re(),l=re(),d=re(),p=re(),m=re();let h=w(n,"endScreenProperties",8,null),g=w(n,"onExit",8,void 0),v=w(n,"currentMode",8,void 0),y=w(n,"currentLanguage",8,void 0);w(n,"themeSettings",8,void 0);let k=w(n,"isScreenVisible",8,void 0),b=re(null);bo(()=>{c(b)!==null&&clearTimeout(c(b))}),he(()=>x(v()),()=>{$(u,v()==="dark")}),he(()=>(x(h()),x(y())),()=>{$(l,h()?.translations&&y()&&h().translations[y()]?h().translations[y()]:h()?.endFields??{title:"Thank you for participating!",message:"Your feedback is important to us.",buttonLabel:"Exit",dismissBehavior:"close",fadeDuration:300})}),he(()=>x(k()),()=>{$(d,k()===!0)}),he(()=>x(h()),()=>{$(p,h()?.endFields?.dismissBehavior)}),he(()=>x(h()),()=>{$(m,h()?.endFields?.fadeDuration||0)}),he(()=>(c(b),c(d),c(p),x(g()),c(m)),()=>{c(b)!==null&&(clearTimeout(c(b)),$(b,null)),c(d)&&c(p)==="fade"&&typeof g()=="function"&&c(m)>0&&$(b,setTimeout(()=>{g()?.()},c(m)*1e3))}),fr(),er();var I=Uz(),S=Z(I),T=Z(S,!0);D(S);var G=de(S,2);{var te=ae=>{var K=Mz(),V=Z(K,!0);D(K),Te(()=>Oe(V,(c(l),O(()=>c(l).message)))),N(ae,K)};se(G,ae=>{c(l),O(()=>c(l).message)&&ae(te)})}D(I),Te(()=>Oe(T,(c(l),O(()=>c(l).title)))),N(i,I),rt()}var Lz=ee("<h2> </h2>"),Pz=ee('<!> <div class="question-wrapper"><div class="question-container"><!></div></div>',1),Rz=ee("<!> <!>",1),Zz=ee('<div id="section-container"><!> <!> <!></div>');function qz(i,n){tt(n,!1);const u=re(),l=re(),{storeQuestions:d,getQuestionData:p}=hn();let m=w(n,"questions",8),h=w(n,"sections",8),g=w(n,"formData",8),v=w(n,"errors",8),y=w(n,"onChange",8),k=w(n,"currentMode",8,void 0),b=w(n,"welcomeScreenProperties",8),I=w(n,"otherConfigurationProperties",8),S=w(n,"currentSectionIndex",8),T=w(n,"endScreenProperties",8,void 0),G=w(n,"currentLanguage",8,void 0),te=w(n,"themeSettings",8),ae=w(n,"onClose",8,void 0),K=w(n,"isScreenVisible",8,void 0),V=w(n,"apiKey",8,void 0),E=w(n,"hostUrl",8,void 0),A=w(n,"identifier",8,void 0),Y=w(n,"feedbackConfigurationId",8,void 0);function ne(J){return c(u).get(J)??-1}function _e(J){switch(J){case a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE:return[];case a.QuestionTypes.NPS:case a.QuestionTypes.RATING:return-1;case a.QuestionTypes.SHORT_ANSWER:case a.QuestionTypes.LONG_TEXT:case a.QuestionTypes.SINGLE_CHOICE:return"";default:return}}function Ee(J){return Array.isArray(J)?J:typeof J=="object"&&J!==null?Object.values(J).filter(M=>M!==void 0):typeof J=="string"?[J]:[]}function Fe(J){return typeof J=="number"?J:typeof J=="string"?Number(J):0}function ie(J){return typeof J=="string"?J:String(typeof J=="object"&&J!==null?Object.values(J)[0]||"":J||"")}function ke(J,M){if(J==null){const R=_e(M);return R!==void 0?R:J}switch(M){case a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE:return Ee(J);case a.QuestionTypes.NPS:case a.QuestionTypes.RATING:return Fe(J);case a.QuestionTypes.SINGLE_CHOICE:return ie(J);default:return J}}he(()=>(x(m()),a.QuestionTypes),()=>{m()&&Object.keys(m()).length>0&&(console.log("🟠 [FormRenderer] Questions received:",m()),Object.entries(m()).forEach(([J,M])=>{M.type===a.QuestionTypes.SINGLE_CHOICE&&console.log(`🟠 [FormRenderer] Single choice question ${J}:`,{id:M.id,type:M.type,title:M.title,hasOptions:"options"in M,options:M.options,optionsType:typeof M.options,isArray:Array.isArray(M.options),optionsLength:Array.isArray(M.options)?M.options.length:"N/A",fullQuestion:M})}),d(m()))}),he(()=>x(h()),()=>{$(u,(()=>{const J=new Map;let M=0;return h().forEach(R=>{R.id!=="welcome_screen"&&R.id!=="thankyou_screen"&&R.questionIds.forEach(C=>{J.set(C,M++)})}),J})())}),he(()=>(x(h()),x(S())),()=>{$(l,h()[S()])}),fr(),er();var pe=qe(),oe=je(pe);{var ue=J=>{var M=qe(),R=je(M);wr(R,1,()=>(x(h()),x(S()),O(()=>[h()[S()]])),C=>C.id,(C,z)=>{var Q=Zz(),W=Z(Q);{var xe=we=>{Az(we,{get welcomeScreenProperties(){return b()},get currentMode(){return k()},get currentLanguage(){return G()},get themeSettings(){return te()}})};se(W,we=>{c(z),O(()=>c(z).id==="welcome_screen")&&we(xe)})}var Ne=de(W,2);{var B=we=>{{let De=Le(()=>T()?T():{});Dz(we,{get endScreenProperties(){return c(De)},get onExit(){return ae()},get currentMode(){return k()},get currentLanguage(){return G()},get themeSettings(){return te()},get isScreenVisible(){return K()}})}};se(Ne,we=>{c(z),O(()=>c(z).id==="thankyou_screen")&&we(B)})}var fe=de(Ne,2);{var me=we=>{var De=Rz(),Ge=je(De);{var Ke=lt=>{var ft=Lz(),Ue=Z(ft,!0);D(ft),Te(()=>{mn(ft,1,`section-title ${k()==="dark"?"dark-mode":""}`),Oe(Ue,(c(z),O(()=>c(z).title)))}),N(lt,ft)};se(Ge,lt=>{x(I()),O(()=>I().isEnabled&&I().otherFields.pageTitle)&&lt(Ke)})}var Je=de(Ge,2);wr(Je,1,()=>(c(z),O(()=>c(z).questionIds)),Lr,(lt,ft)=>{const Ue=Le(()=>(c(ft),O(()=>p(c(ft)))));var kt=qe(),St=je(kt);{var Ut=Ft=>{const wt=Le(()=>(x(I()),O(()=>I()?.isEnabled&&I().otherFields.questionNumber))),zt=Le(()=>(x(c(Ue)),O(()=>ne(c(Ue).id)))),Nt=Le(()=>(x(c(Ue)),x(g()),x(y()),x(v()),x(k()),x(G()),x(te()),x(c(wt)),x(c(zt)),O(()=>({question:c(Ue),value:ke(g()[c(Ue).id],c(Ue).type),onChange:Qe=>y()(c(Ue).id,Qe,c(Ue).type),error:v()[c(Ue).id],currentMode:k(),currentLanguage:G(),themeSettings:te(),questionNumber:c(wt)?c(zt)+1:void 0}))));var Yt=Pz(),ir=je(Yt);{var mr=Qe=>{const Ie=Le(()=>c(Ue));var Be=qe(),Re=je(Be);{var or=Vt=>{};se(Re,Vt=>{x(c(Ie)),O(()=>c(Ie).options)&&Vt(or)})}N(Qe,Be)};se(ir,Qe=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.SINGLE_CHOICE)&&Qe(mr)})}var H=de(ir,2),ye=Z(H),L=Z(ye);{var q=Qe=>{cS(Qe,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},We=Qe=>{var Ie=qe(),Be=je(Ie);{var Re=Vt=>{AS(Vt,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},or=Vt=>{var ar=qe(),Ve=je(ar);{var ut=mt=>{JS(mt,Mt(()=>c(Nt),{get question(){return c(Ue)},get apiKey(){return V()},get hostUrl(){return E()},get identifier(){return A()},get feedbackConfigurationId(){return Y()},get otherConfigurationProperties(){return I()}}))},Dt=mt=>{var gr=qe(),yn=je(gr);{var cr=xr=>{lI(xr,Mt(()=>c(Nt),{get question(){return c(Ue)},get apiKey(){return V()},get hostUrl(){return E()},get identifier(){return A()},get feedbackConfigurationId(){return Y()},get otherConfigurationProperties(){return I()}}))},Ot=xr=>{var Ub=qe(),mN=je(Ub);{var gN=Ci=>{V1(Ci,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},hN=Ci=>{var Db=qe(),vN=je(Db);{var bN=Ai=>{nz(Ai,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},yN=Ai=>{var Lb=qe(),$N=je(Lb);{var wN=Mi=>{_z(Mi,Mt(()=>c(Nt),{get question(){return c(Ue)}}))},_N=Mi=>{var Pb=qe(),kN=je(Pb);{var xN=uc=>{Oz(uc,Mt(()=>c(Nt),{get question(){return c(Ue)}}))};se(kN,uc=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.ANNOTATION)&&uc(xN)},!0)}N(Mi,Pb)};se($N,Mi=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE)?Mi(wN):Mi(_N,!1)},!0)}N(Ai,Lb)};se(vN,Ai=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.RATING)?Ai(bN):Ai(yN,!1)},!0)}N(Ci,Db)};se(mN,Ci=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.SINGLE_CHOICE)?Ci(gN):Ci(hN,!1)},!0)}N(xr,Ub)};se(yn,xr=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.SHORT_ANSWER)?xr(cr):xr(Ot,!1)},!0)}N(mt,gr)};se(Ve,mt=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.LONG_TEXT)?mt(ut):mt(Dt,!1)},!0)}N(Vt,ar)};se(Be,Vt=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.NESTED_SELECTION)?Vt(Re):Vt(or,!1)},!0)}N(Qe,Ie)};se(L,Qe=>{x(c(Ue)),x(a.QuestionTypes),O(()=>c(Ue).type===a.QuestionTypes.NPS)?Qe(q):Qe(We,!1)})}D(ye),D(H),N(Ft,Yt)};se(St,Ft=>{c(Ue)&&Ft(Ut)})}N(lt,kt)}),N(we,De)};se(fe,we=>{c(z),O(()=>c(z).id!=="welcome_screen"&&c(z).id!=="thankyou_screen")&&we(me)})}D(Q),N(C,Q)}),N(J,M)};se(oe,J=>{x(S()),x(h()),O(()=>S()<h().length&&h().length>0)&&J(ue)})}N(i,pe),rt()}var Fz=ee('<div class="flex justify-center"><!></div>'),Qz=ee('<div class="flex justify-center"><!></div>'),Wz=ee('<div class="flex-1"></div>'),Gz=On('<svg class="w-5 h-5 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>'),Vz=ee('<div class="flex items-center justify-between gap-3"><!> <!></div>'),Jz=ee('<div class="w-full py-6 px-4 bg-background"><!></div>');function Bz(i,n){tt(n,!1);const u=()=>Lv(b,"$formResponses",l),[l,d]=Pv(),p=re(),m=re(),h=re(),g=re(),v=re(),{hasValidationErrors:y,clearValidationErrors:k,formResponses:b}=hn();let I=w(n,"isWelcomeScreen",8),S=w(n,"isThankYouScreen",8),T=w(n,"isFirstSection",8),G=w(n,"isFirstPageAfterWelcome",8,!1),te=w(n,"isLastSection",8),ae=w(n,"welcomeScreenProperties",8,null),K=w(n,"endScreenProperties",8,null),V=w(n,"otherConfigurationProperties",8,null),E=w(n,"currentMode",8),A=w(n,"currentLanguage",8),Y=w(n,"handlePrevious",8),ne=w(n,"handleNext",8),_e=w(n,"handleSubmit",8),Ee=w(n,"onClose",8,void 0);w(n,"themeSettings",8);let Fe=w(n,"nextButtonDisabled",8,!1),ie=w(n,"submitButtonDisabled",8,!1),ke=w(n,"isSinglePageSurvey",8,!1),pe=re(!1),oe=re(!1);const ue=()=>{Ee()&&Ee()()},J=()=>{if(!S()&&!K()?.isEnabled){$(pe,!0),window.setTimeout(()=>{$(pe,!1),Ee()&&Ee()()},3e3);try{_e()()}catch(xe){console.error("Error during form submission:",xe)}}else _e()()},M=()=>{k(),Y()()},R=()=>{ne()()};he(()=>(x(V()),x(A())),()=>{$(p,(()=>{const xe={previousButtonLabel:"Previous",nextButtonLabel:"Next",submitButtonLabel:"Submit"};return V()?.isEnabled?V()?.translations&&A()&&V().translations[A()]?V().translations[A()]:V()?.otherFields??xe:xe})())}),he(()=>(x(ae()),x(A())),()=>{$(m,ae()?.translations&&A()&&ae().translations[A()]?ae().translations[A()]:ae()?.welcomeFields??{title:"Welcome to our survey!",description:"We value your feedback and appreciate your time.",buttonLabel:"Start"})}),he(()=>(x(K()),x(A())),()=>{$(h,K()?.translations&&A()&&K().translations[A()]?K().translations[A()]:K()?.endFields??{buttonLabel:"Exit",dismissBehavior:"close"})}),he(()=>x(E()),()=>{$(g,E()==="dark")}),he(()=>x(Fe()),()=>{$(v,y()||Fe())}),he(()=>(u(),x(ie())),()=>{u();const xe=y();$(oe,xe||ie())}),fr(),er();var C=Jz(),z=Z(C);{var Q=xe=>{var Ne=Fz(),B=Z(Ne);Gt(B,{onclick:R,size:"default",class:"px-8 py-6 text-base font-semibold rounded-md shadow-md hover:shadow-md transition-all",children:(fe,me)=>{dr();var we=pn();Te(()=>Oe(we,(c(m),O(()=>c(m).buttonLabel)))),N(fe,we)},$$slots:{default:!0}}),D(Ne),N(xe,Ne)},W=xe=>{var Ne=qe(),B=je(Ne);{var fe=we=>{var De=Qz(),Ge=Z(De);Gt(Ge,{onclick:()=>ue(),size:"default",class:"px-8 py-6 text-base font-semibold rounded-md shadow-md hover:shadow-md transition-all",children:(Ke,Je)=>{dr();var lt=pn();Te(()=>Oe(lt,(c(h),O(()=>c(h).buttonLabel)))),N(Ke,lt)},$$slots:{default:!0}}),D(De),N(we,De)},me=we=>{var De=Vz(),Ge=Z(De);{var Ke=kt=>{{let St=Le(()=>T()||G());Gt(kt,{onclick:()=>M(),get disabled(){return c(St)},variant:"secondary",size:"default",class:"px-6 py-5 text-sm font-semibold rounded-md transition-all disabled:cursor-not-allowed",children:(Ut,Ft)=>{dr();var wt=pn();Te(()=>Oe(wt,(c(p),O(()=>c(p).previousButtonLabel)))),N(Ut,wt)},$$slots:{default:!0}})}},Je=kt=>{var St=Wz();N(kt,St)};se(Ge,kt=>{ke()?kt(Je,!1):kt(Ke)})}var lt=de(Ge,2);{var ft=kt=>{{let St=Le(()=>c(oe)||c(pe)),Ut=Le(()=>ke()?"mx-auto":"");Gt(kt,{onclick:()=>J(),get disabled(){return c(St)},size:"default",get class(){return`px-6 py-5 text-base font-semibold rounded-lg shadow-md hover:shadow-md transition-all ${c(Ut)??""}`},children:(Ft,wt)=>{var zt=qe(),Nt=je(zt);{var Yt=mr=>{var H=Gz();N(mr,H)},ir=mr=>{var H=pn();Te(()=>Oe(H,(c(p),O(()=>c(p).submitButtonLabel)))),N(mr,H)};se(Nt,mr=>{c(pe)?mr(Yt):mr(ir,!1)})}N(Ft,zt)},$$slots:{default:!0}})}},Ue=kt=>{var St=qe(),Ut=je(St);{var Ft=wt=>{Gt(wt,{onclick:R,get disabled(){return c(v)},size:"default",variant:"default",class:"px-6 py-5 text-base font-semibold rounded-md shadow-md hover:shadow-md transition-all ",children:(zt,Nt)=>{dr();var Yt=pn();Te(()=>Oe(Yt,(c(p),O(()=>c(p).nextButtonLabel)))),N(zt,Yt)},$$slots:{default:!0}})};se(Ut,wt=>{ke()||wt(Ft)},!0)}N(kt,St)};se(lt,kt=>{te()?kt(ft):kt(Ue,!1)})}D(De),N(we,De)};se(B,we=>{S()?we(fe):we(me,!1)},!0)}N(xe,Ne)};se(z,xe=>{I()?xe(Q):xe(W,!1)})}D(C),N(i,C),rt(),d()}var Yz=ee('<div data-slot="progress-indicator" class="bg-primary h-full w-full flex-1 transition-all"></div>');function Kz(i,n){tt(n,!0);let u=w(n,"ref",15,null),l=w(n,"max",3,100),d=qt(n,["$$slots","$$events","$$legacy","ref","class","max","value"]);var p=qe(),m=je(p);{let h=ht(()=>jr("bg-primary/20 relative w-full overflow-hidden rounded-full",n.class));Ca(m,()=>b1,(g,v)=>{v(g,Mt({"data-slot":"progress",get class(){return c(h)},get value(){return n.value},get max(){return l()}},()=>d,{get ref(){return u()},set ref(y){u(y)},children:(y,k)=>{var b=Yz();Te(()=>$o(b,`transform: translateX(-${100-100*(n.value??0)/(l()??1)}%)`)),N(y,b)},$$slots:{default:!0}}))})}N(i,p),rt()}const Hz="encatch-forms",Mn="form-responses",Xz=1;async function oc(){return new Promise((i,n)=>{if(typeof window>"u"||!window.indexedDB){n(new Error("IndexedDB is not available in this environment"));return}const u=indexedDB.open(Hz,Xz);u.onerror=()=>{console.error("[IndexedDB] Error opening database:",u.error),n(u.error)},u.onsuccess=()=>{i(u.result)},u.onupgradeneeded=l=>{const d=l.target.result;d.objectStoreNames.contains(Mn)||d.createObjectStore(Mn,{keyPath:"id"})}})}async function eN(i,n){try{const u=await oc();return new Promise((l,d)=>{const p=u.transaction([Mn],"readwrite"),m=p.objectStore(Mn),h={id:i,responses:n,timestamp:Date.now()},g=m.put(h);g.onsuccess=()=>{l()},g.onerror=()=>{console.error("[IndexedDB] Error saving data:",g.error),d(g.error)},p.oncomplete=()=>{u.close()}})}catch(u){throw console.error("[IndexedDB] Error in saveFormData:",u),u}}async function tN(i){try{const n=await oc();return new Promise((u,l)=>{const d=n.transaction([Mn],"readonly"),p=d.objectStore(Mn).get(i);p.onsuccess=()=>{const m=p.result;m&&m.responses?u(m.responses):u(null)},p.onerror=()=>{console.error("[IndexedDB] Error loading data:",p.error),l(p.error)},d.oncomplete=()=>{n.close()}})}catch(n){throw console.error("[IndexedDB] Error in loadFormData:",n),n}}async function Cb(i){try{const n=await oc();return new Promise((u,l)=>{const d=n.transaction([Mn],"readwrite"),p=d.objectStore(Mn).delete(i);p.onsuccess=()=>{u()},p.onerror=()=>{console.error("[IndexedDB] Error clearing data:",p.error),l(p.error)},d.oncomplete=()=>{n.close()}})}catch(n){throw console.error("[IndexedDB] Error in clearFormData:",n),n}}class rN extends EventTarget{subscriptions=new Map;targetOrigin="*";matchesFilter(n,u){return!u||u==="*"||u===null||u===void 0?!0:typeof u=="string"?n===u:Array.isArray(u)?u.includes(n||""):typeof u=="function"?u(n||""):!1}getFormIdFromPayload(n){return n?.feedbackConfigurationId}publish(n,u,l){typeof window<"u"&&window.dispatchEvent(new CustomEvent(n,{detail:u,bubbles:!0})),l?.usePostMessage!==!1&&this.sendPostMessage(n,u)}subscribe(n,u,l){const d=Symbol("subscription"),p={eventType:n,handler:u,filter:l?.formId,id:d,once:l?.once};this.subscriptions.has(n)||this.subscriptions.set(n,[]),this.subscriptions.get(n).push(p);const m=h=>{const g=h,v=this.getFormIdFromPayload(g.detail);this.matchesFilter(v,l?.formId)&&(u(g.detail),l?.once&&typeof window<"u"&&window.removeEventListener(n,m))};return typeof window<"u"&&window.addEventListener(n,m),()=>{this.unsubscribe(d),typeof window<"u"&&window.removeEventListener(n,m)}}unsubscribe(n){for(const[u,l]of this.subscriptions.entries()){const d=l.findIndex(p=>p.id===n);if(d!==-1){l.splice(d,1),l.length===0&&this.subscriptions.delete(u);break}}}subscribeAll(n,u){const l=["form:view","form:submit","form:close","form:section:change","form:question:answered","form:error"],d=[];return l.forEach(p=>{const m=this.subscribe(p,h=>n(p,h),u);d.push(m)}),()=>{d.forEach(p=>p())}}getSubscriptionCount(n){return n?this.subscriptions.get(n)?.length||0:Array.from(this.subscriptions.values()).reduce((u,l)=>u+l.length,0)}clearSubscriptions(n){n?this.subscriptions.delete(n):this.subscriptions.clear()}sendPostMessage(n,u){const l={type:`encatch:${n}`,payload:u,source:"encatch-form-engine"};window.parent&&window.parent!==window&&window.parent.postMessage(l,this.targetOrigin),document.querySelectorAll("iframe").forEach(d=>{d.contentWindow&&d.contentWindow.postMessage(l,this.targetOrigin)}),typeof window.ReactNativeWebView<"u"&&window.ReactNativeWebView.postMessage(JSON.stringify({action:n.replace("form:",""),data:JSON.stringify(u)}))}}const Ei=new rN;var nN=ee('<div class="flex items-center justify-center min-h-[400px] bg-primary-foreground"><div class="text-center"><div class="inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-primary mb-4"></div> <p class="text-sm text-muted-foreground">Loading your previous responses...</p></div></div>'),iN=ee('<div class="flex-shrink-0" style="height: 3px; min-height: 3px; max-height: 3px;"><!></div>'),oN=ee('<div class="bg-background flex items-center justify-center py-2"><img alt="encatch Logo" class="mr-2 h-5 w-5"/> <p class="m-0 text-xs font-medium text-muted-foreground">Powered by encatch</p></div>'),aN=ee('<!> <div class="form-content-container custom-scrollbar bg-background"><!></div> <!> <!>',1),sN=ee('<div id="encatch-form-id"><!></div>');function ac(i,n){tt(n,!1);const u=()=>Lv(T,"$formResponses",l),[l,d]=Pv(),p=re(),m=re(),h=re(),g=re(),v=re(),y=re(),k=re(),b=re(),I=re(),S=re(),{formResponses:T,updateQuestionResponse:G,bulkUpdateResponses:te}=hn();let ae=w(n,"theme",28,()=>({dark:{brandColor:"#000",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000",theme:"{}"},light:{brandColor:"#fff",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff",theme:"{}"}})),K=w(n,"currentMode",12,"light"),V=w(n,"currentLanguage",28,()=>({value:"en",label:"en"})),E=w(n,"questions",28,()=>({})),A=w(n,"questionLanguages",28,()=>[]),Y=w(n,"otherConfigurationProperties",12,null),ne=w(n,"welcomeScreenProperties",12,null),_e=w(n,"endScreenProperties",12,null),Ee=w(n,"translations",28,()=>({})),Fe=w(n,"sections",24,()=>[]),ie=w(n,"themeSettings",12,null),ke=w(n,"onClose",12,void 0),pe=w(n,"onSectionChange",8,void 0),oe=w(n,"apiKey",8,void 0),ue=w(n,"hostUrl",8,void 0),J=w(n,"feedbackConfigId",8,void 0),M=w(n,"identifier",8,void 0),R=w(n,"persistMode",8,"none"),C=w(n,"instanceId",8,void 0),z=re(0),Q=re(!1),W=re(0),xe=re(!1),Ne=re({}),B=re((()=>{let L=[...Fe()||[]];const q=ne()?.isEnabled??!0,We=_e()?.isEnabled??!0;return q&&L.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),We&&L.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),L})()),fe=re(!1),me=re();const we=L=>{if(!L)return document.documentElement;let q=L;for(;q;){if(q.parentNode&&q.parentNode instanceof ShadowRoot)return L;q=q.parentNode}return document.documentElement},De=()=>{const L=window;return typeof window<"u"&&L.encatchAnnotate!==void 0&&typeof L.encatchAnnotate=="object"&&L.encatchAnnotate!==null&&typeof L.encatchAnnotate.getAnnotation=="function"},Ge=()=>{if(De()){const L=window.encatchAnnotate?.getAnnotation?.();L&&Object.entries(E()).forEach(([q,We])=>{We.type===a.QuestionTypes.ANNOTATION&&G(q,L,a.QuestionTypes.ANNOTATION)})}},Ke=(L,q,We,Qe,Ie="")=>L.map(Be=>{let Re=Ie?`${Ie}.children.${Be.id}.label`:`option.${Be.id}.label`,or=Qe[q]?.[We]?.[Re],Vt={...Be};return or&&(Vt.label=or),Be.children&&Be.children.length>0&&(Vt.children=Ke(Be.children,q,We,Qe,Ie?`${Ie}.children.${Be.id}`:`option.${Be.id}`)),Vt}),Je=L=>{console.log("🟣 [App.svelte] updateTranslatedQuestions called with lang:",L),console.log("🟣 [App.svelte] Original questions before translation:",E());const q=Ee()||{},We=Object.fromEntries(Object.entries(E()).map(([Qe,Ie])=>{const Be=q[Qe]?.[L]||{};let Re={...Ie};return Ie.type===a.QuestionTypes.SINGLE_CHOICE&&console.log(`🟣 [App.svelte] Processing single_choice question ${Qe}:`,{originalHasOptions:"options"in Ie,originalOptions:Ie.options,originalOptionsType:typeof Ie.options,originalIsArray:Array.isArray(Ie.options),spreadHasOptions:"options"in Re,spreadOptions:Re.options,spreadOptionsType:typeof Re.options,spreadIsArray:Array.isArray(Re.options)}),Be.title&&(Re.title=Be.title),Be.description&&(Re.description=Be.description),Be.errorMessage&&(Re.errorMessage=Be.errorMessage),Ie.type===a.QuestionTypes.SHORT_ANSWER||Ie.type===a.QuestionTypes.LONG_TEXT?Be.placeholder&&(Re.placeholder=Be.placeholder):Ie.type===a.QuestionTypes.RATING||Ie.type===a.QuestionTypes.NPS?(Be.minLabel&&(Re.minLabel=Be.minLabel),Be.maxLabel&&(Re.maxLabel=Be.maxLabel)):Ie.type===a.QuestionTypes.ANNOTATION&&(Be.annotationText&&(Re.annotationText=Be.annotationText),Be.noAnnotationText&&(Re.noAnnotationText=Be.noAnnotationText)),Ie.type===a.QuestionTypes.SINGLE_CHOICE?(console.log(`🟣 [App.svelte] Handling single_choice options for ${Qe}:`,{"options in q":"options"in Ie,"q.options":Ie.options,"q.options type":typeof Ie.options,"q.options isArray":Array.isArray(Ie.options),"newQ.options before":Re.options,"newQ.options type before":typeof Re.options,"newQ.options isArray before":Array.isArray(Re.options)}),"options"in Ie&&Ie.options&&Array.isArray(Ie.options)?(Re.options=Ke(Ie.options,Qe,L,q),console.log(`🟣 [App.svelte] Translated options for ${Qe}:`,Re.options)):"options"in Ie&&Ie.options?(Re.options=Array.isArray(Ie.options)?[...Ie.options]:Ie.options,console.log(`🟣 [App.svelte] Preserved non-array options for ${Qe}:`,Re.options)):Re.options||(Re.options=Ie.options||[],console.log(`🟣 [App.svelte] Set fallback options for ${Qe}:`,Re.options)),console.log(`🟣 [App.svelte] Final options for ${Qe}:`,{finalOptions:Re.options,finalType:typeof Re.options,finalIsArray:Array.isArray(Re.options),finalLength:Array.isArray(Re.options)?Re.options.length:"N/A"})):(Ie.type===a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE&&"options"in Ie&&Ie.options&&Array.isArray(Ie.options)||Ie.type===a.QuestionTypes.NESTED_SELECTION&&"options"in Ie&&Ie.options&&Array.isArray(Ie.options))&&(Re.options=Ke(Ie.options,Qe,L,q)),[Qe,Re]}));console.log("🟣 [App.svelte] New questions after translation:",We),Object.entries(We).forEach(([Qe,Ie])=>{Ie.type===a.QuestionTypes.SINGLE_CHOICE&&console.log(`🟣 [App.svelte] Final single_choice question ${Qe}:`,{id:Ie.id,type:Ie.type,title:Ie.title,hasOptions:"options"in Ie,options:Ie.options,optionsType:typeof Ie.options,isArray:Array.isArray(Ie.options),optionsLength:Array.isArray(Ie.options)?Ie.options.length:"N/A",fullQuestion:Ie})}),E(We)},lt=()=>c(B).reduce((L,q)=>L+q.questionIds.length,0),ft=()=>u().questions.filter(L=>{try{if(L.type===a.QuestionTypes.SHORT_ANSWER){if(!L.answer||typeof L.answer!="object")return!1;const q=L.answer.shortAnswer;if(q==null||typeof q=="string"&&q.trim()==="")return!1}if(L.type===a.QuestionTypes.LONG_TEXT){if(!L.answer||typeof L.answer!="object")return!1;const q=L.answer.longText;if(q==null||typeof q=="string"&&q.trim()==="")return!1}return!0}catch(q){return console.error("Error checking answer:",L.questionId,q),!0}}).length,Ue=()=>ft()/lt()*100,kt=(L,q,We)=>{let Qe=q;Array.isArray(q)&&(Qe=[...q]),G(L,Qe,We),$(Ne,{...c(Ne),[L]:""}),Ei.publish("form:question:answered",{feedbackConfigurationId:C()||"",questionId:L,questionType:We,answer:Qe,timestamp:Date.now()})},St=()=>{if(c(W)>0){const L=c(W)-1;$(W,L),pe()?.(L),Ei.publish("form:section:change",{feedbackConfigurationId:C()||"",sectionIndex:L,sectionId:c(B)[L]?.id||"",timestamp:Date.now()})}},Ut=()=>{if(c(W)<c(B).length-1){const L=c(W)+1;$(W,L),pe()?.(L),Ei.publish("form:section:change",{feedbackConfigurationId:C()||"",sectionIndex:L,sectionId:c(B)[L]?.id||"",timestamp:Date.now()})}},Ft=()=>{Ei.publish("form:submit",{feedbackConfigurationId:C()||"",feedbackIdentifier:M()||"",response:{questions:u().questions},timestamp:Date.now()});const L=c(B).findIndex(q=>q.id==="thankyou_screen");if(L!==-1&&($(W,L),pe()?.(L)),$(xe,!0),window.encatch?._internal?.submitFeedback?window.encatch._internal.submitFeedback({response:{questions:u().questions},action:"S",feedbackConfigurationId:J()||"",feedbackIdentifier:M()||"",duration:0}):console.error("window.encatch._internal.submitFeedback is not available"),R()==="retain"&&J()&&M()){const q=`${J()}_${M()}`;Cb(q).then(()=>{}).catch(We=>{console.error("[App] Error clearing saved data after submission:",We)})}},wt=()=>{Ei.publish("form:close",{feedbackConfigurationId:C()||"",feedbackIdentifier:M(),timestamp:Date.now()}),ke()?.()},zt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMDAgMTAwMDsiIAogIGhlaWdodD0iMjAiCiAgd2lkdGg9IjIwIgogIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMzODQ4OUQ7fQoJLnN0MXtmaWxsOiMxRjFCNEY7fQoJLnN0MntmaWxsOiNGN0I5Mjg7fQoJLnN0M3tmaWxsOiMwMEI4N0E7fQoJLnN0NHtmaWxsOiNFMDI0NUU7fQoJLnN0NXtmaWxsOiNGRkZGRkY7fQoJLnN0NntmaWxsOiNGOEZFRkY7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDUiIGQ9Ik00MDQuOCwyMTAuOEMzMDkuMSwyNDEuOSwyMzQsMzE3LjYsMjAzLjIsNDEzLjRjLTYxLjMsMTkwLjEsNDcuOSwzNjguNSwyMTIuNSw0MjBjNS43LDEuOCwxMS42LTIuNSwxMS42LTguNQoJCXYtNjkuN2MwLTMuNi0yLjItNi44LTUuNi04LjJDMzMyLjQsNzEwLjcsMjY5LjMsNjIzLDI2OS4zLDUyMC44YzAtMTM0LjcsMTA5LjYtMjQ0LjIsMjQ0LjItMjQ0LjJjMTE5LjMsMCwyMTguOCw4NS43LDIzOS45LDE5OC45CgkJYzAuMywxLjktMS4xLDMuNi0zLDMuNmgtMzcuNGMtOC44LDAtMTUuOSw3LjEtMTUuOSwxNS45djQ3LjJjMCwxMS4xLDMuOSwyMC42LDE1LDIwLjZsNDUuNi0wLjNoNDEuN3YtMC4yaDM0LjEKCQljNC4yLDAsNy42LTMuNCw3LjYtNy42di0zMy44Qzg0MS4xLDMwNC45LDYzMS40LDEzNy4yLDQwNC44LDIxMC44eiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTI2NSw3MTYuOGwtMTUuNCwxMTYuNmMtMC40LDIuOCwyLjUsNC45LDUsMy43TDM2OCw3ODUuN2MyLjYtMS4yLDIuOC00LjcsMC41LTYuMmwtOTcuOS02NS4yCgkJQzI2OC40LDcxMi44LDI2NS40LDcxNC4xLDI2NSw3MTYuOHoiLz4KCTxwYXRoIGNsYXNzPSJzdDUiIGQ9Ik02NjYuMyw1NjMuM2gtNzguNmMtMi41LDAtNC41LTItNC41LTQuNXYtNzguNmMwLTIuNSwyLTQuNSw0LjUtNC41aDc4LjZjMi41LDAsNC41LDIsNC41LDQuNXY3OC42CgkJQzY3MC45LDU2MS4yLDY2OC44LDU2My4zLDY2Ni4zLDU2My4zeiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTQ0NC4yLDU2My4zaC03Ni41Yy0zLjEsMC01LjUtMi41LTUuNS01LjV2LTc2LjVjMC0zLjEsMi41LTUuNSw1LjUtNS41aDc2LjVjMy4xLDAsNS41LDIuNSw1LjUsNS41djc2LjUKCQlDNDQ5LjcsNTYwLjgsNDQ3LjIsNTYzLjMsNDQ0LjIsNTYzLjN6Ii8+Cgk8cGF0aCBjbGFzcz0ic3Q1IiBkPSJNNTU1LjMsNTYzLjNoLTc3LjZjLTIuOCwwLTUtMi4zLTUtNXYtNzcuNmMwLTIuOCwyLjMtNSw1LTVoNzcuNmMyLjgsMCw1LDIuMyw1LDV2NzcuNgoJCUM1NjAuMyw1NjEsNTU4LDU2My4zLDU1NS4zLDU2My4zeiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTY4My45LDI1NC45Yy0xODMuOS0xMTMuMi00MzUuMi0zNi41LTQ5MS4zLDE5NWMtMjMuNyw5Ny44LDEuNSwyMDEuNCw2Ni45LDI3Ny45CgkJYzEyOS44LDE1MS44LDMzOSwxNTIuMyw0NjkuMSwzOS4xYzQuNS0zLjksMy45LTExLjItMS4yLTE0LjNsLTU5LjMtMzYuNWMtMy4xLTEuOS03LTEuNy05LjksMC41Yy03Ny43LDU3LTE4NS41LDY0LjgtMjcyLjUsMTEuMwoJCWMtMTE0LjgtNzAuNi0xNTAuNi0yMjEuMy04MC0zMzZjNjIuNS0xMDEuNiwxODcuNy0xNDEuNCwyOTUuMS0xMDAuMSIvPgo8L2c+Cjwvc3ZnPgo=",Nt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMDAgMTAwMDsiIAogIGhlaWdodD0iMjAiCiAgd2lkdGg9IjIwIgogIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMzODQ4OUQ7fQoJLnN0MXtmaWxsOiMxRjFCNEY7fQoJLnN0MntmaWxsOiNGN0I5Mjg7fQoJLnN0M3tmaWxsOiMwMEI4N0E7fQoJLnN0NHtmaWxsOiNFMDI0NUU7fQoJLnN0NXtmaWxsOiNGRkZGRkY7fQoJLnN0NntmaWxsOiNGOEZFRkY7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0zODEuOSwxOTkuNmMtOTUuNywzMS4xLTE3MC44LDEwNi44LTIwMS43LDIwMi42Yy02MS4zLDE5MC4xLDQ3LjksMzY4LjUsMjEyLjUsNDIwYzUuNywxLjgsMTEuNi0yLjUsMTEuNi04LjUKCQlWNzQ0YzAtMy42LTIuMi02LjgtNS42LTguMmMtODkuMy0zNi4zLTE1Mi40LTEyNC4xLTE1Mi40LTIyNi4yYzAtMTM0LjcsMTA5LjYtMjQ0LjIsMjQ0LjItMjQ0LjJjMTE5LjMsMCwyMTguOCw4NS43LDIzOS45LDE5OC45CgkJYzAuMywxLjktMS4xLDMuNi0zLDMuNmgtMzcuNGMtOC44LDAtMTUuOSw3LjEtMTUuOSwxNS45VjUzMWMwLDExLjEsMy45LDIwLjYsMTUsMjAuNmw0NS42LTAuM2g0MS43di0wLjJoMzQuMQoJCWM0LjIsMCw3LjYtMy40LDcuNi03LjZ2LTMzLjhDODE4LjIsMjkzLjcsNjA4LjUsMTI2LDM4MS45LDE5OS42eiIvPgoJPHBhdGggY2xhc3M9InN0MSIgZD0iTTI0Mi4xLDcwNS42bC0xNS40LDExNi42Yy0wLjQsMi44LDIuNSw0LjksNSwzLjdMMzQ1LDc3NC41YzIuNi0xLjIsMi44LTQuNywwLjUtNi4yTDI0Ny42LDcwMwoJCUMyNDUuNCw3MDEuNiwyNDIuNCw3MDIuOSwyNDIuMSw3MDUuNnoiLz4KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik02NDMuNCw1NTIuMWgtNzguNmMtMi41LDAtNC41LTItNC41LTQuNXYtNzguNmMwLTIuNSwyLTQuNSw0LjUtNC41aDc4LjZjMi41LDAsNC41LDIsNC41LDQuNXY3OC42CgkJQzY0Ny45LDU1MCw2NDUuOSw1NTIuMSw2NDMuNCw1NTIuMXoiLz4KCTxwYXRoIGNsYXNzPSJzdDMiIGQ9Ik00MjEuMiw1NTIuMWgtNzYuNWMtMy4xLDAtNS41LTIuNS01LjUtNS41VjQ3MGMwLTMuMSwyLjUtNS41LDUuNS01LjVoNzYuNWMzLjEsMCw1LjUsMi41LDUuNSw1LjV2NzYuNQoJCUM0MjYuOCw1NDkuNiw0MjQuMyw1NTIuMSw0MjEuMiw1NTIuMXoiLz4KCTxwYXRoIGNsYXNzPSJzdDQiIGQ9Ik01MzIuMyw1NTIuMWgtNzcuNmMtMi44LDAtNS0yLjMtNS01di03Ny42YzAtMi44LDIuMy01LDUtNWg3Ny42YzIuOCwwLDUsMi4zLDUsNVY1NDcKCQlDNTM3LjQsNTQ5LjgsNTM1LjEsNTUyLjEsNTMyLjMsNTUyLjF6Ii8+Cgk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNjYxLDI0My42Yy0xODMuOS0xMTMuMi00MzUuMi0zNi41LTQ5MS4zLDE5NWMtMjMuNyw5Ny44LDEuNSwyMDEuNCw2Ni45LDI3Ny45CgkJYzEyOS44LDE1MS44LDMzOSwxNTIuMyw0NjkuMSwzOS4xYzQuNS0zLjksMy45LTExLjItMS4yLTE0LjNsLTU5LjMtMzYuNWMtMy4xLTEuOS03LTEuNy05LjksMC41Yy03Ny43LDU3LTE4NS41LDY0LjgtMjcyLjUsMTEuMwoJCWMtMTE0LjgtNzAuNi0xNTAuNi0yMjEuMy04MC0zMzZDMzQ1LjIsMjc5LDQ3MC40LDIzOS4yLDU3Ny45LDI4MC41Ii8+CjwvZz4KPC9zdmc+Cg==";let Yt=re();he(()=>(x(C()),x(M()),x(J()),x(R()),x(V()),x(ne()),x(_e()),c(B),c(W)),()=>{En(async()=>{Ei.publish("form:view",{feedbackConfigurationId:C()||"",feedbackIdentifier:M()||"",timestamp:Date.now()});const L=`${J()||"default"}_${M()||"default"}`;if(R()==="retain"){$(Q,!0);try{const q=await tN(L);q&&q.length>0&&te(q)}catch(q){console.error("[App] Error loading saved data:",q)}finally{$(Q,!1)}}else if(R()==="reset")try{await Cb(L)}catch(q){console.error("[App] Error clearing saved data:",q)}Ge(),window.updateEncatchForm=q=>{if(q.theme&&ae(q.theme),q.currentMode&&K(q.currentMode),q.currentLanguage&&(V(q.currentLanguage),V()?.value&&Je(V().value)),q.questions&&E(q.questions),q.questionLanguages&&A(q.questionLanguages),q.otherConfigurationProperties&&Y(q.otherConfigurationProperties),q.welcomeScreenProperties&&ne(q.welcomeScreenProperties),q.endScreenProperties){const We=_e()?.isEnabled,Qe=q.endScreenProperties.isEnabled;if(We&&!Qe){const Ie=c(B).findIndex(Be=>Be.id==="thankyou_screen");Ie===c(W)&&$(W,Math.max(0,Ie-1))}_e(q.endScreenProperties)}if(q.sections){const We=[...q.sections],Qe=q.welcomeScreenProperties?.isEnabled??ne()?.isEnabled??!0,Ie=q.endScreenProperties?.isEnabled??_e()?.isEnabled??!0;Qe&&!We.some(Be=>Be.id==="welcome_screen")&&We.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),Ie&&!We.some(Be=>Be.id==="thankyou_screen")&&We.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),$(B,We),Qe&&c(W)===0&&$(W,0)}q.translations&&(Ee(q.translations),V()?.value&&Je(V().value)),q.themeSettings&&ie(q.themeSettings),q.onClose&&ke(q.onClose)}})}),he(()=>(x(E()),a.QuestionTypes),()=>{E()&&Object.keys(E()).length>0&&(console.log("🔵 [App.svelte] Questions received:",E()),Object.entries(E()).forEach(([L,q])=>{q.type===a.QuestionTypes.SINGLE_CHOICE&&console.log(`🔵 [App.svelte] Single choice question ${L}:`,{id:q.id,type:q.type,title:q.title,hasOptions:"options"in q,options:q.options,optionsType:typeof q.options,isArray:Array.isArray(q.options),optionsLength:Array.isArray(q.options)?q.options.length:"N/A",fullQuestion:q})}))}),he(()=>x(Fe()),()=>{Fe()&&Fe().length>0&&console.log("🟢 [App.svelte] Sections received:",Fe())}),he(()=>x(Ee()),()=>{Ee()&&Object.keys(Ee()).length>0&&console.log("🟡 [App.svelte] Translations received:",Ee())}),he(()=>(c(me),x(ie()),x(K())),()=>{if(c(me)&&ie()&&ie().themes&&K()&&ie().themes[K()]){const L=we(c(me)),q=ie().themes[K()];if(q&&q.theme&&q.theme!=="{}")try{const We=JSON.parse(q.theme);Object.entries(We).forEach(([Qe,Ie])=>{Ie&&typeof Ie=="string"&&L.style.setProperty(Qe,Ie)})}catch(We){console.error("Error parsing theme JSON:",We)}}}),he(()=>x(K()),()=>{$(p,K()==="dark"?zt:Nt)}),he(()=>(x(V()),x(ne()),x(_e()),x(Y())),()=>{if(V()&&V().value){const L=V().value;Je(L),ne()?.translations?.[L]&&ne({...ne(),welcomeFields:{...ne().welcomeFields,...ne().translations[L]}}),_e()?.translations?.[L]&&_e().endFields&&_e({..._e(),endFields:{..._e().endFields,..._e().translations[L],dismissBehavior:_e().endFields.dismissBehavior??"fade",fadeDuration:_e().endFields.fadeDuration??300}}),Y()?.translations?.[L]&&Y().otherFields&&Y({...Y(),otherFields:{...Y().otherFields,...Y().translations[L],pagination:Y().otherFields.pagination??!1,questionNumber:Y().otherFields.questionNumber??!1,pageTitle:Y().otherFields.pageTitle??!1,blockerFeedback:Y().otherFields.blockerFeedback??!1}})}}),he(()=>(x(Fe()),x(ne()),x(_e()),c(W),c(fe),c(xe)),()=>{const L=[...Fe()];let q=!1;const We=L.some(Re=>Re.id==="welcome_screen"),Qe=L.some(Re=>Re.id==="thankyou_screen"),Ie=ne()?.isEnabled??!0,Be=_e()?.isEnabled??!0;if(Ie&&!We)L.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),q=!0;else if(!Ie&&We){const Re=L.filter(or=>or.id!=="welcome_screen");Re.length!==L.length&&($(B,Re),q=!0)}if(Be&&!Qe)L.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),q=!0;else if(!Be&&Qe){const Re=L.filter(or=>or.id!=="thankyou_screen");if(Re.length!==L.length){const or=L.findIndex(Vt=>Vt.id==="thankyou_screen");(c(W)===or||c(W)>=Re.length)&&$(W,Math.max(0,Re.length-1)),$(B,Re),q=!0}}q&&($(B,L),c(fe)||(!c(xe)&&!(!Be&&Qe)&&$(W,0),$(fe,!0)))}),he(()=>(x(_e()),c(W),c(B)),()=>{$(m,_e()?.isEnabled&&c(W)===c(B).length-1)}),he(()=>c(B),()=>{$(h,c(B).filter(L=>L.id!=="welcome_screen"&&L.id!=="thankyou_screen").length===1)}),he(()=>(c(W),c(B)),()=>{$(g,c(W)===0&&c(B)[0]?.id==="welcome_screen")}),he(()=>(c(B),c(W)),()=>{$(v,c(B)[c(W)]?.id==="thankyou_screen")}),he(()=>c(W),()=>{$(y,c(W)===0)}),he(()=>(c(B),c(W)),()=>{$(k,c(B)[0]?.id==="welcome_screen"&&c(W)===1)}),he(()=>(c(B),c(W)),()=>{$(b,(()=>{const L=c(B).findIndex(q=>q.id==="thankyou_screen");return L!==-1?c(W)===L-1:c(W)===c(B).length-1})())}),he(()=>(c(B),c(W),c(g),c(v),u(),x(E())),()=>{$(I,(()=>{const L=c(B)[c(W)];if(!L||c(g)||c(v))return!1;const q=L.questionIds||[],We=u().questions.reduce((Qe,Ie)=>(Qe[Ie.questionId]=Ie,Qe),{});for(const Qe of q){const Ie=E()[Qe],Be=!!We[Qe];if(Ie?.required&&!Be)return!0}return!1})())}),he(()=>(c(W),c(B)),()=>{c(W)>=0&&c(W)<c(B).length}),he(()=>(u(),a.QuestionTypes),()=>{$(S,u().questions.reduce((L,q)=>{if(q.answer)switch(q.type){case a.QuestionTypes.RATING:L[q.questionId]=q.answer.rating;break;case a.QuestionTypes.NPS:L[q.questionId]=q.answer.nps;break;case a.QuestionTypes.LONG_TEXT:L[q.questionId]=q.answer.longText;break;case a.QuestionTypes.SHORT_ANSWER:L[q.questionId]=q.answer.shortAnswer;break;case a.QuestionTypes.SINGLE_CHOICE:L[q.questionId]=q.answer.singleChoice;break;case a.QuestionTypes.MULTIPLE_CHOICE_MULTIPLE:L[q.questionId]=[...q.answer.multipleChoiceMultiple||[]];break;case a.QuestionTypes.NESTED_SELECTION:L[q.questionId]=[...q.answer.nestedSelection||[]];break;default:L[q.questionId]=q.answer}else L[q.questionId]=null;return L},{}))}),he(()=>u(),()=>{u();const L=Ue();$(z,L)}),he(()=>(x(R()),x(J()),x(M()),c(Q),c(Yt),u()),()=>{if(R()==="retain"&&J()&&M()&&!c(Q)){const L=`${J()}_${M()}`;c(Yt)&&clearTimeout(c(Yt)),$(Yt,setTimeout(()=>{eN(L,u().questions).then(()=>{}).catch(q=>{console.error("[App] Error auto-saving to IndexedDB:",q)})},500))}}),he(()=>x(E()),()=>{E()&&Ge()}),fr(),er();var ir=sN(),mr=Z(ir);{var H=L=>{var q=nN();N(L,q)},ye=L=>{var q=aN(),We=je(q);{var Qe=ar=>{var Ve=iN(),ut=Z(Ve);Kz(ut,{get value(){return c(z)},max:100,class:"h-full w-full rounded-none bg-muted/40 [&_[data-slot=progress-indicator]]:bg-primary [&_[data-slot=progress-indicator]]:transition-all [&_[data-slot=progress-indicator]]:duration-300 [&_[data-slot=progress-indicator]]:ease-in-out"}),D(Ve),N(ar,Ve)};se(We,ar=>{x(ie()),c(g),c(v),O(()=>ie()?.featureSettings?.progressBar&&!c(g)&&!c(v))&&ar(Qe)})}var Ie=de(We,2),Be=Z(Ie);{let ar=Le(()=>Y()||{isEnabled:!1,otherFields:{pagination:!1,questionNumber:!1,pageTitle:!1,blockerFeedback:!1,submitButtonLabel:"Submit",previousButtonLabel:"Previous",nextButtonLabel:"Next",aiEnhancementSuccessMessage:"",aiEnhancementCooldownErrorMessage:"",aiEnhancementMaxReachedErrorMessage:""},translations:{}}),Ve=Le(()=>ne()||{isEnabled:!1,welcomeFields:{title:"Welcome",description:"",buttonLabel:"Start"},translations:{}}),ut=Le(()=>_e()||void 0),Dt=Le(()=>(x(V()),O(()=>V()?.value||"en"))),mt=Le(()=>(x(ie()),O(()=>ie()?.themes||{light:{brandColor:"#000",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff"},dark:{brandColor:"#fff",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000"}}))),gr=Le(()=>c(m)===!0);qz(Be,{get questions(){return E()},get sections(){return c(B)},get formData(){return c(S)},get errors(){return c(Ne)},onChange:kt,get currentMode(){return K()},get currentSectionIndex(){return c(W)},get otherConfigurationProperties(){return c(ar)},get welcomeScreenProperties(){return c(Ve)},get endScreenProperties(){return c(ut)},get currentLanguage(){return c(Dt)},get themeSettings(){return c(mt)},onClose:wt,get isScreenVisible(){return c(gr)},get apiKey(){return oe()},get feedbackConfigurationId(){return J()},get hostUrl(){return ue()},get identifier(){return M()}})}D(Ie);var Re=de(Ie,2);{let ar=Le(()=>(x(V()),O(()=>V()?.value||"en"))),Ve=Le(()=>(x(ie()),O(()=>ie()?.themes||{light:{brandColor:"#000",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff"},dark:{brandColor:"#fff",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000"}})));Bz(Re,{get isWelcomeScreen(){return c(g)},get isThankYouScreen(){return c(v)},get isFirstSection(){return c(y)},get isFirstPageAfterWelcome(){return c(k)},get isLastSection(){return c(b)},get welcomeScreenProperties(){return ne()},get endScreenProperties(){return _e()},get otherConfigurationProperties(){return Y()},get currentMode(){return K()},get currentLanguage(){return c(ar)},handlePrevious:St,handleNext:Ut,handleSubmit:Ft,onClose:wt,get themeSettings(){return c(Ve)},get nextButtonDisabled(){return c(I)},get submitButtonDisabled(){return c(I)},get isSinglePageSurvey(){return c(h)}})}var or=de(Re,2);{var Vt=ar=>{var Ve=oN(),ut=Z(Ve);dr(2),D(Ve),Te(()=>si(ut,"src",c(p))),N(ar,Ve)};se(or,ar=>{x(ie()),O(()=>ie()?.featureSettings?.showBranding)&&ar(Vt)})}N(L,q)};se(mr,L=>{c(Q)?L(H):L(ye,!1)})}D(ir),_r(ir,L=>$(me,L),()=>c(me)),Te(()=>mn(ir,1,`encatch-form ${K()==="dark"?"theme-dark dark":"theme-light"}`)),N(i,ir),rt(),d()}var uN=ee('<div class="fixed inset-0 transition-opacity duration-300"></div>'),lN=ee('<!> <div id="encatch-feedback-popup" class="rounded-xl shadow-2xl overflow-hidden"><!> <!></div>',1);function Ab(i,n){tt(n,!1);const u=re(),l=re(),d=Jv();let p=w(n,"themeMode",8,"light"),m=w(n,"feedbackConfiguration",8,null),h=w(n,"apiKey",8,""),g=w(n,"hostUrl",8,"");w(n,"deviceInfo",8,null),w(n,"sessionId",8,""),w(n,"userInfo",8,null);let v=w(n,"language",8,"en"),y=w(n,"configurationData",8,null),k=w(n,"onClose",8,void 0),b=w(n,"trackPopupHeight",8,void 0),I=w(n,"feedbackConfigId",8,void 0),S=w(n,"identifier",8,void 0),T=re(document.documentElement.clientWidth),G=re(!1),te=re(null),ae=re(),K;const V=()=>{if(c(ae)){const ie=c(ae).querySelector("#section-container");if(ie){const ke=window.innerHeight*.75,pe=ie.clientHeight,oe=84,ue=60,J=Math.min(pe+oe+ue,ke);c(ae).style.transition.includes("height")||qh(ae,c(ae).style.transition="height 0.5s cubic-bezier(0.4, 0, 0.2, 1)"),qh(ae,c(ae).style.height=`${J}px`),ie.style.overflowY=pe+oe+ue>ke?"auto":"hidden"}}},E=()=>{$(T,document.documentElement.clientWidth)},A=()=>{d.clearResponses(),$(G,!1),setTimeout(()=>{k()?.()},300)},Y=ie=>{const ke={position:"fixed",width:c(u),"max-width":c(u),height:"30%",transition:"transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease","transform-origin":"center center","will-change":"transform, opacity"};switch(ie){case"top-left":return{...ke,top:"12px",left:"12px",transform:"translate(0, 0)"};case"top-center":return{...ke,top:"12px",left:"50%",transform:"translate(-50%, 0)"};case"top-right":return{...ke,top:"12px",right:"12px",transform:"translate(0, 0)"};case"center-left":return{...ke,top:"50%",left:"12px",transform:"translateY(-50%)"};case"center":return{...ke,top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)"};case"center-right":return{...ke,top:"50%",right:"12px",transform:"translateY(-50%)"};case"bottom-left":return{...ke,bottom:"12px",left:"12px",transform:"translate(0, 0)"};case"bottom-center":return{...ke,bottom:"12px",left:"50%",transform:"translate(-50%, 0)"};case"bottom-right":return{...ke,bottom:"12px",right:"12px",transform:"translate(0, 0)"};case"bottom-full":return{...ke,bottom:"0",left:"50%",width:"100%","max-width":"100%",transform:"translate(-50%, 0)"};case"top-full":return{...ke,top:"0",left:"50%",width:"100%","max-width":"100%",transform:"translate(-50%, 0)"};case"full":return{...ke,top:"0",left:"0",width:"100%","max-width":"100%",height:"100%",transform:"translate(0, 0)"};default:return ke}},ne=ie=>Object.entries(ie).map(([ke,pe])=>`${ke}: ${pe}`).join("; ");En(()=>{window.addEventListener("resize",E),setTimeout(()=>{$(G,!0)},100),K=window.setInterval(V,5e3),b()&&b()(V),requestAnimationFrame(()=>{setTimeout(()=>V(),0)})}),bo(()=>{window.removeEventListener("resize",E),K&&window.clearInterval(K)}),he(()=>c(T),()=>{$(u,c(T)<=768?"95%":"600px")}),he(()=>x(y()),()=>{$(te,y())}),he(()=>c(te),()=>{c(te)?.feedbackIdentifier}),he(()=>x(m()),()=>{$(l,m()&&m().appearanceProperties&&m().appearanceProperties.selectedPosition?Y(m().appearanceProperties.selectedPosition):{})}),fr(),er();var _e=qe(),Ee=je(_e);{var Fe=ie=>{var ke=lN(),pe=je(ke);{var oe=z=>{var Q=uN();Te(()=>$o(Q,`background-color: ${x(m()),x(p()),O(()=>m().appearanceProperties.themes[p()].overlayColor)??""}; z-index: 1000; opacity: ${c(G)?"0.4":"0"};`)),N(z,Q)};se(pe,z=>{x(m()),O(()=>m()?.appearanceProperties?.featureSettings?.darkOverlay)&&z(oe)})}var ue=de(pe,2),J=Z(ue);{var M=z=>{Gt(z,{variant:"ghost",size:"icon",class:"absolute top-3 right-3 z-10 h-8 w-8 rounded border-none bg-background text-primary hover:bg-accent hover:text-accent-foreground transition-all duration-200 active:scale-95",onclick:A,"aria-label":"Close popup",children:(Q,W)=>{Gv(Q,{size:20,stroke:2})},$$slots:{default:!0}})};se(J,z=>{x(m()),O(()=>m()?.appearanceProperties?.featureSettings?.closeButton)&&z(M)})}var R=de(J,2);{var C=z=>{{let Q=Le(()=>({value:v(),label:v()})),W=Le(()=>(c(te),O(()=>c(te)?.questionnaireFields.questions||{}))),xe=Le(()=>(c(te),O(()=>c(te)?.questionnaireFields.selectedLanguages||[]))),Ne=Le(()=>(c(te),O(()=>c(te)?.questionnaireFields.translations||{}))),B=Le(()=>(c(te),O(()=>c(te)?.otherConfigurationProperties))),fe=Le(()=>(c(te),O(()=>c(te)?.welcomeScreenProperties))),me=Le(()=>(c(te),O(()=>c(te)?.endScreenProperties))),we=Le(()=>(c(te),O(()=>c(te)?.questionnaireFields.sections||[])));ac(z,{get theme(){return x(m()),O(()=>m().appearanceProperties.themes)},get themeSettings(){return x(m()),O(()=>m().appearanceProperties)},get currentMode(){return p()},get currentLanguage(){return c(Q)},get questions(){return c(W)},get questionLanguages(){return c(xe)},get translations(){return c(Ne)},get otherConfigurationProperties(){return c(B)},get welcomeScreenProperties(){return c(fe)},get endScreenProperties(){return c(me)},get sections(){return c(we)},onSectionChange:()=>{requestAnimationFrame(()=>{setTimeout(()=>V(),0)})},onClose:A,get apiKey(){return h()},get hostUrl(){return g()},get feedbackConfigId(){return I()},get identifier(){return S()}})}};se(R,z=>{x(m()),c(te),O(()=>m()?.appearanceProperties&&c(te))&&z(C)})}D(ue),_r(ue,z=>$(ae,z),()=>c(ae)),Te(z=>$o(ue,`${z??""}; background-color: ${x(m()),x(p()),O(()=>m()?.appearanceProperties?.themes?.[p()]?.overlayColor||"transparent")??""}; z-index: 1001;`),[()=>(c(l),O(()=>ne(c(l))))]),N(ie,ke)};se(Ee,ie=>{ie(Fe)})}N(i,_e),rt()}var cN=ee('<div class="encatch-scale-wrapper"><!></div>');function sc(i,n){tt(n,!1);const u=Jv();let l=w(n,"theme",28,()=>({dark:{brandColor:"#000",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000"},light:{brandColor:"#fff",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff"}})),d=w(n,"currentMode",12,"light"),p=w(n,"currentLanguage",28,()=>({value:"en",label:"en",isFixed:!0})),m=w(n,"questions",28,()=>({})),h=w(n,"questionLanguages",28,()=>[]),g=w(n,"otherConfigurationProperties",12,null),v=w(n,"welcomeScreenProperties",12,null),y=w(n,"endScreenProperties",12,null),k=w(n,"translations",28,()=>({})),b=w(n,"sections",28,()=>[]),I=w(n,"themeSettings",12,null),S=w(n,"onClose",12,void 0),T=w(n,"onSectionChange",12,void 0),G=w(n,"apiKey",12,void 0),te=w(n,"hostUrl",12,void 0),ae=w(n,"feedbackConfigId",12,void 0),K=w(n,"identifier",12,void 0),V=w(n,"cssLink",12,void 0),E=w(n,"scale",12,100),A=w(n,"persistMode",12,"none"),Y=w(n,"instanceId",12,void 0);const ne="https://app.dev.encatch.com/s/index-latest.css";let _e=re(!1),Ee=re(!1),Fe=re(!1),ie=re();const ke=z=>{if(!z)return null;let Q=z;for(;Q;){if(Q instanceof ShadowRoot)return Q;Q=Q.parentNode}return null},pe=z=>{const Q=new CSSStyleSheet,W=z/100;return Q.replaceSync(`
280
280
  .encatch-scale-wrapper {
281
- zoom: ${Q} !important;
281
+ zoom: ${W} !important;
282
282
  }
283
- `),W};let oe=re(),ue=re("");En(()=>{V()||$(_e,!0)}),bo(()=>{u.clearResponses()}),he(()=>(c(ie),c(oe),x(E())),()=>{if(c(ie)){const z=ke(c(ie));if(z&&c(oe)){const W=z.adoptedStyleSheets.indexOf(c(oe));W>-1&&z.adoptedStyleSheets.splice(W,1)}$(oe,pe(E())),z&&(z.adoptedStyleSheets=[...z.adoptedStyleSheets,c(oe)])}}),he(()=>(c(ie),c(Ee)),()=>{c(ie)&&!c(Ee)&&setTimeout(()=>{const z=ke(c(ie)),W=document.createElement("link");W.rel="stylesheet",W.href=ne,W.onload=()=>{$(Ee,!0)},W.onerror=()=>{console.error("Failed to load base CSS"),$(Ee,!0)},z?z.appendChild(W):document.head.appendChild(W)},0)}),he(()=>(c(ie),x(V()),c(ue)),()=>{c(ie)&&V()&&c(ue)!==V()&&($(_e,!1),$(Fe,!1),setTimeout(()=>{const z=ke(c(ie)),W=document.createElement("link");W.rel="stylesheet",W.href=V(),W.onload=()=>{$(_e,!0),$(ue,V())},W.onerror=()=>{$(Fe,!0),$(ue,V())},z?z.appendChild(W):document.head.appendChild(W)},0))}),fr();var J={get theme(){return l()},set theme(z){l(z),dt()},get currentMode(){return d()},set currentMode(z){d(z),dt()},get currentLanguage(){return p()},set currentLanguage(z){p(z),dt()},get questions(){return m()},set questions(z){m(z),dt()},get questionLanguages(){return h()},set questionLanguages(z){h(z),dt()},get otherConfigurationProperties(){return g()},set otherConfigurationProperties(z){g(z),dt()},get welcomeScreenProperties(){return v()},set welcomeScreenProperties(z){v(z),dt()},get endScreenProperties(){return y()},set endScreenProperties(z){y(z),dt()},get translations(){return k()},set translations(z){k(z),dt()},get sections(){return b()},set sections(z){b(z),dt()},get themeSettings(){return I()},set themeSettings(z){I(z),dt()},get onClose(){return S()},set onClose(z){S(z),dt()},get onSectionChange(){return T()},set onSectionChange(z){T(z),dt()},get apiKey(){return G()},set apiKey(z){G(z),dt()},get hostUrl(){return te()},set hostUrl(z){te(z),dt()},get feedbackConfigId(){return ae()},set feedbackConfigId(z){ae(z),dt()},get identifier(){return K()},set identifier(z){K(z),dt()},get cssLink(){return V()},set cssLink(z){V(z),dt()},get scale(){return E()},set scale(z){E(z),dt()},get persistMode(){return A()},set persistMode(z){A(z),dt()},get instanceId(){return Y()},set instanceId(z){Y(z),dt()}};er();var M=cN(),R=Z(M);{var C=z=>{ac(z,{get theme(){return l()},get currentMode(){return d()},get currentLanguage(){return p()},get questions(){return m()},get questionLanguages(){return h()},get otherConfigurationProperties(){return g()},get welcomeScreenProperties(){return v()},get endScreenProperties(){return y()},get translations(){return k()},get sections(){return b()},get themeSettings(){return I()},get onClose(){return S()},get onSectionChange(){return T()},get apiKey(){return G()},get hostUrl(){return te()},get feedbackConfigId(){return ae()},get identifier(){return K()},get persistMode(){return A()},get instanceId(){return Y()}})};se(R,z=>{c(_e)&&z(C)})}return D(M),_r(M,z=>$(ie,z),()=>c(ie)),N(i,M),rt(J)}customElements.define("encatch-app",Zv(sc,{theme:{},currentMode:{},currentLanguage:{},questions:{},questionLanguages:{},otherConfigurationProperties:{},welcomeScreenProperties:{},endScreenProperties:{},translations:{},sections:{},themeSettings:{},onClose:{},onSectionChange:{},apiKey:{},hostUrl:{},feedbackConfigId:{},identifier:{},cssLink:{},scale:{},persistMode:{},instanceId:{}},[],[],!0));var dN=ee("<div><!></div>");function Mb(i,n){tt(n,!1);let u=w(n,"themeMode",12,"light"),l=w(n,"feedbackConfiguration",12,null),d=w(n,"apiKey",12,""),p=w(n,"hostUrl",12,""),m=w(n,"deviceInfo",12,null),h=w(n,"sessionId",12,""),g=w(n,"userInfo",12,null),v=w(n,"language",12,"en"),y=w(n,"configurationData",12,null),k=w(n,"onClose",12,void 0),b=w(n,"trackPopupHeight",12,void 0),I=w(n,"feedbackConfigId",12,void 0),S=w(n,"identifier",12,void 0),T=w(n,"cssLinks",28,()=>[]),G=re();const te=E=>{if(!E)return null;let A=E;for(;A;){if(A instanceof ShadowRoot)return A;A=A.parentNode}return null};he(()=>(c(G),x(T())),()=>{if(c(G)&&T()&&T().length>0){const E=te(c(G));E&&T().forEach(A=>{if(!Array.from(E.querySelectorAll('link[rel="stylesheet"]')).find(Y=>Y.href===A)){const Y=document.createElement("link");Y.rel="stylesheet",Y.href=A,E.appendChild(Y)}})}}),fr();var ae={get themeMode(){return u()},set themeMode(E){u(E),dt()},get feedbackConfiguration(){return l()},set feedbackConfiguration(E){l(E),dt()},get apiKey(){return d()},set apiKey(E){d(E),dt()},get hostUrl(){return p()},set hostUrl(E){p(E),dt()},get deviceInfo(){return m()},set deviceInfo(E){m(E),dt()},get sessionId(){return h()},set sessionId(E){h(E),dt()},get userInfo(){return g()},set userInfo(E){g(E),dt()},get language(){return v()},set language(E){v(E),dt()},get configurationData(){return y()},set configurationData(E){y(E),dt()},get onClose(){return k()},set onClose(E){k(E),dt()},get trackPopupHeight(){return b()},set trackPopupHeight(E){b(E),dt()},get feedbackConfigId(){return I()},set feedbackConfigId(E){I(E),dt()},get identifier(){return S()},set identifier(E){S(E),dt()},get cssLinks(){return T()},set cssLinks(E){T(E),dt()}};er();var K=dN(),V=Z(K);return Ab(V,{get themeMode(){return u()},get feedbackConfiguration(){return l()},get apiKey(){return d()},get hostUrl(){return p()},get deviceInfo(){return m()},get sessionId(){return h()},get userInfo(){return g()},get language(){return v()},get configurationData(){return y()},get onClose(){return k()},get trackPopupHeight(){return b()},get feedbackConfigId(){return I()},get identifier(){return S()}}),D(K),_r(K,E=>$(G,E),()=>c(G)),N(i,K),rt(ae)}customElements.define("encatch-form",Zv(Mb,{themeMode:{},feedbackConfiguration:{},apiKey:{},hostUrl:{},deviceInfo:{},sessionId:{},userInfo:{},language:{},configurationData:{},onClose:{},trackPopupHeight:{},feedbackConfigId:{},identifier:{},cssLinks:{}},[],[],!0));const fN=Mb,pN=sc;o.App=ac,o.EncatchApp=sc,o.EncatchAppElement=pN,o.EncatchFormElement=fN,o.PopupUi=Ab,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}))})(Li,Li.exports)),Li.exports}var Uk=Mk();const Dk=Rb({__proto__:null},[Uk]);rn.EncatchPreview=Vb,rn.useEncatchFormEvent=Jb,rn.useEncatchFormEventAll=Bb,Object.defineProperty(rn,Symbol.toStringTag,{value:"Module"})}));
283
+ `),Q};let oe=re(),ue=re("");En(()=>{V()||$(_e,!0)}),bo(()=>{u.clearResponses()}),he(()=>(c(ie),c(oe),x(E())),()=>{if(c(ie)){const z=ke(c(ie));if(z&&c(oe)){const Q=z.adoptedStyleSheets.indexOf(c(oe));Q>-1&&z.adoptedStyleSheets.splice(Q,1)}$(oe,pe(E())),z&&(z.adoptedStyleSheets=[...z.adoptedStyleSheets,c(oe)])}}),he(()=>(c(ie),c(Ee)),()=>{c(ie)&&!c(Ee)&&setTimeout(()=>{const z=ke(c(ie)),Q=document.createElement("link");Q.rel="stylesheet",Q.href=ne,Q.onload=()=>{$(Ee,!0)},Q.onerror=()=>{console.error("Failed to load base CSS"),$(Ee,!0)},z?z.appendChild(Q):document.head.appendChild(Q)},0)}),he(()=>(c(ie),x(V()),c(ue)),()=>{c(ie)&&V()&&c(ue)!==V()&&($(_e,!1),$(Fe,!1),setTimeout(()=>{const z=ke(c(ie)),Q=document.createElement("link");Q.rel="stylesheet",Q.href=V(),Q.onload=()=>{$(_e,!0),$(ue,V())},Q.onerror=()=>{$(Fe,!0),$(ue,V())},z?z.appendChild(Q):document.head.appendChild(Q)},0))}),fr();var J={get theme(){return l()},set theme(z){l(z),dt()},get currentMode(){return d()},set currentMode(z){d(z),dt()},get currentLanguage(){return p()},set currentLanguage(z){p(z),dt()},get questions(){return m()},set questions(z){m(z),dt()},get questionLanguages(){return h()},set questionLanguages(z){h(z),dt()},get otherConfigurationProperties(){return g()},set otherConfigurationProperties(z){g(z),dt()},get welcomeScreenProperties(){return v()},set welcomeScreenProperties(z){v(z),dt()},get endScreenProperties(){return y()},set endScreenProperties(z){y(z),dt()},get translations(){return k()},set translations(z){k(z),dt()},get sections(){return b()},set sections(z){b(z),dt()},get themeSettings(){return I()},set themeSettings(z){I(z),dt()},get onClose(){return S()},set onClose(z){S(z),dt()},get onSectionChange(){return T()},set onSectionChange(z){T(z),dt()},get apiKey(){return G()},set apiKey(z){G(z),dt()},get hostUrl(){return te()},set hostUrl(z){te(z),dt()},get feedbackConfigId(){return ae()},set feedbackConfigId(z){ae(z),dt()},get identifier(){return K()},set identifier(z){K(z),dt()},get cssLink(){return V()},set cssLink(z){V(z),dt()},get scale(){return E()},set scale(z){E(z),dt()},get persistMode(){return A()},set persistMode(z){A(z),dt()},get instanceId(){return Y()},set instanceId(z){Y(z),dt()}};er();var M=cN(),R=Z(M);{var C=z=>{ac(z,{get theme(){return l()},get currentMode(){return d()},get currentLanguage(){return p()},get questions(){return m()},get questionLanguages(){return h()},get otherConfigurationProperties(){return g()},get welcomeScreenProperties(){return v()},get endScreenProperties(){return y()},get translations(){return k()},get sections(){return b()},get themeSettings(){return I()},get onClose(){return S()},get onSectionChange(){return T()},get apiKey(){return G()},get hostUrl(){return te()},get feedbackConfigId(){return ae()},get identifier(){return K()},get persistMode(){return A()},get instanceId(){return Y()}})};se(R,z=>{c(_e)&&z(C)})}return D(M),_r(M,z=>$(ie,z),()=>c(ie)),N(i,M),rt(J)}customElements.define("encatch-app",Zv(sc,{theme:{},currentMode:{},currentLanguage:{},questions:{},questionLanguages:{},otherConfigurationProperties:{},welcomeScreenProperties:{},endScreenProperties:{},translations:{},sections:{},themeSettings:{},onClose:{},onSectionChange:{},apiKey:{},hostUrl:{},feedbackConfigId:{},identifier:{},cssLink:{},scale:{},persistMode:{},instanceId:{}},[],[],!0));var dN=ee("<div><!></div>");function Mb(i,n){tt(n,!1);let u=w(n,"themeMode",12,"light"),l=w(n,"feedbackConfiguration",12,null),d=w(n,"apiKey",12,""),p=w(n,"hostUrl",12,""),m=w(n,"deviceInfo",12,null),h=w(n,"sessionId",12,""),g=w(n,"userInfo",12,null),v=w(n,"language",12,"en"),y=w(n,"configurationData",12,null),k=w(n,"onClose",12,void 0),b=w(n,"trackPopupHeight",12,void 0),I=w(n,"feedbackConfigId",12,void 0),S=w(n,"identifier",12,void 0),T=w(n,"cssLinks",28,()=>[]),G=re();const te=E=>{if(!E)return null;let A=E;for(;A;){if(A instanceof ShadowRoot)return A;A=A.parentNode}return null};he(()=>(c(G),x(T())),()=>{if(c(G)&&T()&&T().length>0){const E=te(c(G));E&&T().forEach(A=>{if(!Array.from(E.querySelectorAll('link[rel="stylesheet"]')).find(Y=>Y.href===A)){const Y=document.createElement("link");Y.rel="stylesheet",Y.href=A,E.appendChild(Y)}})}}),fr();var ae={get themeMode(){return u()},set themeMode(E){u(E),dt()},get feedbackConfiguration(){return l()},set feedbackConfiguration(E){l(E),dt()},get apiKey(){return d()},set apiKey(E){d(E),dt()},get hostUrl(){return p()},set hostUrl(E){p(E),dt()},get deviceInfo(){return m()},set deviceInfo(E){m(E),dt()},get sessionId(){return h()},set sessionId(E){h(E),dt()},get userInfo(){return g()},set userInfo(E){g(E),dt()},get language(){return v()},set language(E){v(E),dt()},get configurationData(){return y()},set configurationData(E){y(E),dt()},get onClose(){return k()},set onClose(E){k(E),dt()},get trackPopupHeight(){return b()},set trackPopupHeight(E){b(E),dt()},get feedbackConfigId(){return I()},set feedbackConfigId(E){I(E),dt()},get identifier(){return S()},set identifier(E){S(E),dt()},get cssLinks(){return T()},set cssLinks(E){T(E),dt()}};er();var K=dN(),V=Z(K);return Ab(V,{get themeMode(){return u()},get feedbackConfiguration(){return l()},get apiKey(){return d()},get hostUrl(){return p()},get deviceInfo(){return m()},get sessionId(){return h()},get userInfo(){return g()},get language(){return v()},get configurationData(){return y()},get onClose(){return k()},get trackPopupHeight(){return b()},get feedbackConfigId(){return I()},get identifier(){return S()}}),D(K),_r(K,E=>$(G,E),()=>c(G)),N(i,K),rt(ae)}customElements.define("encatch-form",Zv(Mb,{themeMode:{},feedbackConfiguration:{},apiKey:{},hostUrl:{},deviceInfo:{},sessionId:{},userInfo:{},language:{},configurationData:{},onClose:{},trackPopupHeight:{},feedbackConfigId:{},identifier:{},cssLinks:{}},[],[],!0));const fN=Mb,pN=sc;o.App=ac,o.EncatchApp=sc,o.EncatchAppElement=pN,o.EncatchFormElement=fN,o.PopupUi=Ab,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}))})(Li,Li.exports)),Li.exports}var Uk=Mk();const Dk=Rb({__proto__:null},[Uk]);rn.EncatchPreview=Vb,rn.useEncatchFormEvent=Jb,rn.useEncatchFormEventAll=Bb,Object.defineProperty(rn,Symbol.toStringTag,{value:"Module"})}));