@encatch/ws-react 0.0.1

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.
@@ -0,0 +1,43 @@
1
+ (function(Sn,Yn){typeof exports=="object"&&typeof module<"u"?Yn(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],Yn):(Sn=typeof globalThis<"u"?globalThis:Sn||self,Yn(Sn.WsReact={},Sn.React))})(this,(function(Sn,Yn){"use strict";var Br={exports:{}},_r={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Xi;function _c(){if(Xi)return _r;Xi=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var l in o)l!=="key"&&(s[l]=o[l])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return _r.Fragment=t,_r.jsx=n,_r.jsxs=n,_r}var xr={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var es;function xc(){return es||(es=1,process.env.NODE_ENV!=="production"&&(function(){function e(g){if(g==null)return null;if(typeof g=="function")return g.$$typeof===he?null:g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case L:return"Fragment";case U:return"Profiler";case $:return"StrictMode";case F:return"Suspense";case Z:return"SuspenseList";case ge:return"Activity"}if(typeof g=="object")switch(typeof g.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case k:return"Portal";case T:return(g.displayName||"Context")+".Provider";case G:return(g._context.displayName||"Context")+".Consumer";case x:var j=g.render;return g=g.displayName,g||(g=j.displayName||j.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case B:return j=g.displayName||null,j!==null?j:e(g.type)||"Memo";case R:j=g._payload,g=g._init;try{return e(g(j))}catch{}}return null}function t(g){return""+g}function n(g){try{t(g);var j=!1}catch{j=!0}if(j){j=console;var q=j.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return q.call(j,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),t(g)}}function r(g){if(g===L)return"<>";if(typeof g=="object"&&g!==null&&g.$$typeof===R)return"<...>";try{var j=e(g);return j?"<"+j+">":"<...>"}catch{return"<...>"}}function o(){var g=Te.A;return g===null?null:g.getOwner()}function s(){return Error("react-stack-top-frame")}function a(g){if(ie.call(g,"key")){var j=Object.getOwnPropertyDescriptor(g,"key").get;if(j&&j.isReactWarning)return!1}return g.key!==void 0}function l(g,j){function q(){E||(E=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",j))}q.isReactWarning=!0,Object.defineProperty(g,"key",{get:q,configurable:!0})}function c(){var g=e(this.type);return A[g]||(A[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function u(g,j,q,W,H,ne,ve,ue){return q=ne.ref,g={$$typeof:y,type:g,key:j,props:ne,_owner:H},(q!==void 0?q:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:c}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ve}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function d(g,j,q,W,H,ne,ve,ue){var we=j.children;if(we!==void 0)if(W)if(le(we)){for(W=0;W<we.length;W++)m(we[W]);Object.freeze&&Object.freeze(we)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(we);if(ie.call(j,"key")){we=e(g);var re=Object.keys(j).filter(function(be){return be!=="key"});W=0<re.length?"{key: someKey, "+re.join(": ..., ")+": ...}":"{key: someKey}",v[we+W]||(re=0<re.length?"{"+re.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,W,we,re,we),v[we+W]=!0)}if(we=null,q!==void 0&&(n(q),we=""+q),a(j)&&(n(j.key),we=""+j.key),"key"in j){q={};for(var X in j)X!=="key"&&(q[X]=j[X])}else q=j;return we&&l(q,typeof g=="function"?g.displayName||g.name||"Unknown":g),u(g,we,ne,H,o(),q,ve,ue)}function m(g){typeof g=="object"&&g!==null&&g.$$typeof===y&&g._store&&(g._store.validated=1)}var f=Yn,y=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),T=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),ge=Symbol.for("react.activity"),he=Symbol.for("react.client.reference"),Te=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=Object.prototype.hasOwnProperty,le=Array.isArray,Y=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(g){return g()}};var E,A={},C=f.react_stack_bottom_frame.bind(f,s)(),p=Y(r(s)),v={};xr.Fragment=L,xr.jsx=function(g,j,q,W,H){var ne=1e4>Te.recentlyCreatedOwnerStacks++;return d(g,j,q,!1,W,H,ne?Error("react-stack-top-frame"):C,ne?Y(r(g)):p)},xr.jsxs=function(g,j,q,W,H){var ne=1e4>Te.recentlyCreatedOwnerStacks++;return d(g,j,q,!0,W,H,ne?Error("react-stack-top-frame"):C,ne?Y(r(g)):p)}})()),xr}var ts;function $c(){return ts||(ts=1,process.env.NODE_ENV==="production"?Br.exports=_c():Br.exports=xc()),Br.exports}var Sc=$c();typeof window<"u"&&!customElements.get("encatch-app")&&Promise.resolve().then(()=>bc).then(({EncatchAppElement:e})=>{customElements.define("encatch-app",e)});const Tc=e=>(Yn.useEffect(()=>{typeof window<"u"&&!customElements.get("encatch-app")&&Promise.resolve().then(()=>bc).then(({EncatchAppElement:t})=>{customElements.define("encatch-app",t)})},[]),Sc.jsx("encatch-app",{...e}));function D(e,t,n){function r(l,c){var u;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(u=l._zod).traits??(u.traits=new Set),l._zod.traits.add(e),t(l,c);for(const d in a.prototype)d in l||Object.defineProperty(l,d,{value:a.prototype[d].bind(l)});l._zod.constr=a,l._zod.def=c}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function a(l){var c;const u=n?.Parent?new s:this;r(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>n?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class Bn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ns extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const rs={};function pn(e){return rs}function Ic(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Do(e,t){return typeof t=="bigint"?t.toString():t}function Hr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qo(e){return e==null}function Zo(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Cc(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let o=(r.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=n>o?n:o,a=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return a%l/10**s}const os=Symbol("evaluating");function Pe(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==os)return r===void 0&&(r=os,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function zc(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function hn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Hn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function is(e){return JSON.stringify(e)}const ss="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Mc=Hr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Jn(e){if($r(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!($r(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function as(e){return Jn(e)?{...e}:Array.isArray(e)?[...e]:e}const Lc=new Set(["string","number","symbol"]);function Kn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ye(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Nc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Ec={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ac(e,t){const n=e._zod.def,r=Hn(e._zod.def,{get shape(){const o={};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=n.shape[s])}return hn(this,"shape",o),o},checks:[]});return mn(e,r)}function Pc(e,t){const n=e._zod.def,r=Hn(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete o[s]}return hn(this,"shape",o),o},checks:[]});return mn(e,r)}function jc(e,t){if(!Jn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const o=Hn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return hn(this,"shape",s),s},checks:[]});return mn(e,o)}function Oc(e,t){if(!Jn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return hn(this,"shape",r),r},checks:e._zod.def.checks};return mn(e,n)}function Dc(e,t){const n=Hn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return hn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return mn(e,n)}function qc(e,t,n){const r=Hn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const a in n){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(s[a]=e?new e({type:"optional",innerType:o[a]}):o[a])}else for(const a in o)s[a]=e?new e({type:"optional",innerType:o[a]}):o[a];return hn(this,"shape",s),s},checks:[]});return mn(t,r)}function Zc(e,t,n){const r=Hn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const a in n){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(s[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)s[a]=new e({type:"nonoptional",innerType:o[a]});return hn(this,"shape",s),s},checks:[]});return mn(t,r)}function Xn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Tn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Jr(e){return typeof e=="string"?e:e?.message}function gn(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Jr(e.inst?._zod.def?.error?.(e))??Jr(t?.error?.(e))??Jr(n.customError?.(e))??Jr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Uo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Sr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const ls=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Do,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},cs=D("$ZodError",ls),Kr=D("$ZodError",ls,{Parent:Error});function Uc(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Rc(e,t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>o({issues:l}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)r._errors.push(n(a));else{let l=r,c=0;for(;c<a.path.length;){const u=a.path[c];c===a.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(a))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return o(e),r}const Xr=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new Bn;if(a.issues.length){const l=new(o?.Err??e)(a.issues.map(c=>gn(c,s,pn())));throw ss(l,o?.callee),l}return a.value},us=Xr(Kr),eo=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new(o?.Err??e)(a.issues.map(c=>gn(c,s,pn())));throw ss(l,o?.callee),l}return a.value},ds=eo(Kr),to=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Bn;return s.issues.length?{success:!1,error:new(e??cs)(s.issues.map(a=>gn(a,o,pn())))}:{success:!0,data:s.value}},Fc=to(Kr),no=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>gn(a,o,pn())))}:{success:!0,data:s.value}},Wc=no(Kr),Qc=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xr(e)(t,n,o)},Vc=e=>(t,n,r)=>Xr(e)(t,n,r),Gc=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return eo(e)(t,n,o)},Yc=e=>async(t,n,r)=>eo(e)(t,n,r),Bc=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return to(e)(t,n,o)},Hc=e=>(t,n,r)=>to(e)(t,n,r),Jc=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return no(e)(t,n,o)},Kc=e=>async(t,n,r)=>no(e)(t,n,r),Xc=/^[cC][^\s-]{8,}$/,eu=/^[0-9a-z]+$/,tu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nu=/^[0-9a-vA-V]{20}$/,ru=/^[A-Za-z0-9]{27}$/,ou=/^[a-zA-Z0-9_-]{21}$/,iu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,su=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fs=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,au=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function cu(){return new RegExp(lu,"u")}const uu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,du=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fu=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,pu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ps=/^[A-Za-z0-9_-]*$/,mu=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,gu=/^\+(?:[0-9]){6,14}[0-9]$/,hs="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",vu=new RegExp(`^${hs}$`);function ms(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bu(e){return new RegExp(`^${ms(e)}$`)}function yu(e){const t=ms({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${hs}T(?:${r})$`)}const wu=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ku=/^-?\d+$/,_u=/^-?\d+(?:\.\d+)?/,xu=/^(?:true|false)$/i,$u=/^[^A-Z]*$/,Su=/^[^a-z]*$/,_t=D("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),gs={number:"number",bigint:"bigint",object:"date"},vs=D("$ZodCheckLessThan",(e,t)=>{_t.init(e,t);const n=gs[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bs=D("$ZodCheckGreaterThan",(e,t)=>{_t.init(e,t);const n=gs[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tu=D("$ZodCheckMultipleOf",(e,t)=>{_t.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Cc(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Iu=D("$ZodCheckNumberFormat",(e,t)=>{_t.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=Ec[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=ku)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}l<o&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>s&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:e})}}),Cu=D("$ZodCheckMaxLength",(e,t)=>{var n;_t.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!qo(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const a=Uo(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),zu=D("$ZodCheckMinLength",(e,t)=>{var n;_t.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!qo(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const a=Uo(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Mu=D("$ZodCheckLengthEquals",(e,t)=>{var n;_t.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!qo(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const a=Uo(o),l=s>t.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ro=D("$ZodCheckStringFormat",(e,t)=>{var n,r;_t.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Lu=D("$ZodCheckRegex",(e,t)=>{ro.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Nu=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$u),ro.init(e,t)}),Eu=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Su),ro.init(e,t)}),Au=D("$ZodCheckIncludes",(e,t)=>{_t.init(e,t);const n=Kn(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Pu=D("$ZodCheckStartsWith",(e,t)=>{_t.init(e,t);const n=new RegExp(`^${Kn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ju=D("$ZodCheckEndsWith",(e,t)=>{_t.init(e,t);const n=new RegExp(`.*${Kn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Ou=D("$ZodCheckOverwrite",(e,t)=>{_t.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Du{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
23
+ `).filter(a=>a),o=Math.min(...r.map(a=>a.length-a.trimStart().length)),s=r.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
24
+ `))}}const qu={major:4,minor:1,patch:8},qe=D("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qu;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,l,c)=>{let u=Xn(a),d;for(const m of l){if(m._zod.def.when){if(!m._zod.def.when(a))continue}else if(u)continue;const f=a.issues.length,y=m._zod.check(a);if(y instanceof Promise&&c?.async===!1)throw new Bn;if(d||y instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await y,a.issues.length!==f&&(u||(u=Xn(a,f)))});else{if(a.issues.length===f)continue;u||(u=Xn(a,f))}}return d?d.then(()=>a):a},s=(a,l,c)=>{if(Xn(a))return a.aborted=!0,a;const u=o(l,r,c);if(u instanceof Promise){if(c.async===!1)throw new Bn;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,l)):s(u,a,l)}const c=e._zod.parse(a,l);if(c instanceof Promise){if(l.async===!1)throw new Bn;return c.then(u=>o(u,r,l))}return o(c,r,l)}}e["~standard"]={validate:o=>{try{const s=Fc(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Wc(e,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Ro=D("$ZodString",(e,t)=>{qe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wu(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ve=D("$ZodStringFormat",(e,t)=>{ro.init(e,t),Ro.init(e,t)}),Zu=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=su),Ve.init(e,t)}),Uu=D("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=fs(r))}else t.pattern??(t.pattern=fs());Ve.init(e,t)}),Ru=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=au),Ve.init(e,t)}),Fu=D("$ZodURL",(e,t)=>{Ve.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:mu.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Wu=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=cu()),Ve.init(e,t)}),Qu=D("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ou),Ve.init(e,t)}),Vu=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Xc),Ve.init(e,t)}),Gu=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eu),Ve.init(e,t)}),Yu=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tu),Ve.init(e,t)}),Bu=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nu),Ve.init(e,t)}),Hu=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ru),Ve.init(e,t)}),Ju=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=yu(t)),Ve.init(e,t)}),Ku=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=vu),Ve.init(e,t)}),Xu=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=bu(t)),Ve.init(e,t)}),ed=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=iu),Ve.init(e,t)}),td=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=uu),Ve.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),nd=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=du),Ve.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),rd=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fu),Ve.init(e,t)}),od=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=pu),Ve.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ys(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const id=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hu),Ve.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{ys(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function sd(e){if(!ps.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ys(n)}const ad=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ps),Ve.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{sd(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ld=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gu),Ve.init(e,t)});function cd(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const ud=D("$ZodJWT",(e,t)=>{Ve.init(e,t),e._zod.check=n=>{cd(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ws=D("$ZodNumber",(e,t)=>{qe.init(e,t),e._zod.pattern=e._zod.bag.pattern??_u,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),dd=D("$ZodNumber",(e,t)=>{Iu.init(e,t),ws.init(e,t)}),fd=D("$ZodBoolean",(e,t)=>{qe.init(e,t),e._zod.pattern=xu,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),pd=D("$ZodAny",(e,t)=>{qe.init(e,t),e._zod.parse=n=>n}),hd=D("$ZodUnknown",(e,t)=>{qe.init(e,t),e._zod.parse=n=>n}),md=D("$ZodNever",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),gd=D("$ZodVoid",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;return typeof o>"u"||n.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),n}});function ks(e,t,n){e.issues.length&&t.issues.push(...Tn(n,e.issues)),t.value[n]=e.value}const vd=D("$ZodArray",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let a=0;a<o.length;a++){const l=o[a],c=t.element._zod.run({value:l,issues:[]},r);c instanceof Promise?s.push(c.then(u=>ks(u,n,a))):ks(c,n,a)}return s.length?Promise.all(s).then(()=>n):n}});function oo(e,t,n,r){e.issues.length&&t.issues.push(...Tn(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function _s(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Nc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function xs(e,t,n,r,o,s){const a=[],l=o.keySet,c=o.catchall._zod,u=c.def.type;for(const d of Object.keys(t)){if(l.has(d))continue;if(u==="never"){a.push(d);continue}const m=c.run({value:t[d],issues:[]},r);m instanceof Promise?e.push(m.then(f=>oo(f,n,d,t))):oo(m,n,d,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const bd=D("$ZodObject",(e,t)=>{qe.init(e,t);const n=Hr(()=>_s(t));Pe(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const d of u.values)l[c].add(d)}}return l});const r=$r,o=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=n.value);const c=a.value;if(!r(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const u=[],d=s.shape;for(const m of s.keys){const y=d[m]._zod.run({value:c[m],issues:[]},l);y instanceof Promise?u.push(y.then(k=>oo(k,a,m,c))):oo(y,a,m,c)}return o?xs(u,c,a,l,n.value,e):u.length?Promise.all(u).then(()=>a):a}}),yd=D("$ZodObjectJIT",(e,t)=>{bd.init(e,t);const n=e._zod.parse,r=Hr(()=>_s(t)),o=f=>{const y=new Du(["shape","payload","ctx"]),k=r.value,L=T=>{const x=is(T);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};y.write("const input = payload.value;");const $=Object.create(null);let U=0;for(const T of k.keys)$[T]=`key_${U++}`;y.write("const newResult = {};");for(const T of k.keys){const x=$[T],F=is(T);y.write(`const ${x} = ${L(T)};`),y.write(`
25
+ if (${x}.issues.length) {
26
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
27
+ ...iss,
28
+ path: iss.path ? [${F}, ...iss.path] : [${F}]
29
+ })));
30
+ }
31
+
32
+
33
+ if (${x}.value === undefined) {
34
+ if (${F} in input) {
35
+ newResult[${F}] = undefined;
36
+ }
37
+ } else {
38
+ newResult[${F}] = ${x}.value;
39
+ }
40
+
41
+ `)}y.write("payload.value = newResult;"),y.write("return payload;");const G=y.compile();return(T,x)=>G(f,T,x)};let s;const a=$r,l=!rs.jitless,u=l&&Mc.value,d=t.catchall;let m;e._zod.parse=(f,y)=>{m??(m=r.value);const k=f.value;return a(k)?l&&u&&y?.async===!1&&y.jitless!==!0?(s||(s=o(t.shape)),f=s(f,y),d?xs([],k,f,y,m,e):f):n(f,y):(f.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),f)}});function $s(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Xn(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(a=>gn(a,r,pn())))}),t)}const Ss=D("$ZodUnion",(e,t)=>{qe.init(e,t),Pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Pe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Zo(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let a=!1;const l=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),a=!0;else{if(u.issues.length===0)return u;l.push(u)}}return a?Promise.all(l).then(c=>$s(c,o,e,s)):$s(l,o,e,s)}}),wd=D("$ZodDiscriminatedUnion",(e,t)=>{Ss.init(e,t);const n=e._zod.parse;Pe(e._zod,"propValues",()=>{const o={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,c]of Object.entries(a)){o[l]||(o[l]=new Set);for(const u of c)o[l].add(u)}}return o});const r=Hr(()=>{const o=t.options,s=new Map;for(const a of o){const l=a._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const c of l){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a)}}return s});e._zod.parse=(o,s)=>{const a=o.value;if(!$r(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;const l=r.value.get(a?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),o)}}),kd=D("$ZodIntersection",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,u])=>Ts(n,c,u)):Ts(n,s,a)}});function Fo(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Jn(e)&&Jn(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const a=Fo(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],a=Fo(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ts(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Xn(e))return e;const r=Fo(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Is=D("$ZodTuple",(e,t)=>{qe.init(e,t);const n=t.items,r=n.length-[...n].reverse().findIndex(o=>o._zod.optin!=="optional");e._zod.parse=(o,s)=>{const a=o.value;if(!Array.isArray(a))return o.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];const l=[];if(!t.rest){const u=a.length>n.length,d=a.length<r-1;if(u||d)return o.issues.push({...u?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:a,inst:e,origin:"array"}),o}let c=-1;for(const u of n){if(c++,c>=a.length&&c>=r)continue;const d=u._zod.run({value:a[c],issues:[]},s);d instanceof Promise?l.push(d.then(m=>io(m,o,c))):io(d,o,c)}if(t.rest){const u=a.slice(n.length);for(const d of u){c++;const m=t.rest._zod.run({value:d,issues:[]},s);m instanceof Promise?l.push(m.then(f=>io(f,o,c))):io(m,o,c)}}return l.length?Promise.all(l).then(()=>o):o}});function io(e,t,n){e.issues.length&&t.issues.push(...Tn(n,e.issues)),t.value[n]=e.value}const _d=D("$ZodRecord",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Jn(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[];if(t.keyType._zod.values){const a=t.keyType._zod.values;n.value={};for(const c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){const u=t.valueType._zod.run({value:o[c],issues:[]},r);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&n.issues.push(...Tn(c,d.issues)),n.value[c]=d.value})):(u.issues.length&&n.issues.push(...Tn(c,u.issues)),n.value[c]=u.value)}let l;for(const c in o)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;const l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(u=>gn(u,r,pn())),input:a,path:[a],inst:e}),n.value[l.value]=l.value;continue}const c=t.valueType._zod.run({value:o[a],issues:[]},r);c instanceof Promise?s.push(c.then(u=>{u.issues.length&&n.issues.push(...Tn(a,u.issues)),n.value[l.value]=u.value})):(c.issues.length&&n.issues.push(...Tn(a,c.issues)),n.value[l.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),xd=D("$ZodEnum",(e,t)=>{qe.init(e,t);const n=Ic(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Lc.has(typeof o)).map(o=>typeof o=="string"?Kn(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),$d=D("$ZodLiteral",(e,t)=>{if(qe.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Kn(n):n?Kn(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const o=n.value;return e._zod.values.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),Sd=D("$ZodTransform",(e,t)=>{qe.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ns(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new Bn;return n.value=o,n}});function Cs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Td=D("$ZodOptional",(e,t)=>{qe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Pe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zo(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Cs(s,n.value)):Cs(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Id=D("$ZodNullable",(e,t)=>{qe.init(e,t),Pe(e._zod,"optin",()=>t.innerType._zod.optin),Pe(e._zod,"optout",()=>t.innerType._zod.optout),Pe(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zo(n.source)}|null)$`):void 0}),Pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Cd=D("$ZodDefault",(e,t)=>{qe.init(e,t),e._zod.optin="optional",Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>zs(s,t)):zs(o,t)}});function zs(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zd=D("$ZodPrefault",(e,t)=>{qe.init(e,t),e._zod.optin="optional",Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Md=D("$ZodNonOptional",(e,t)=>{qe.init(e,t),Pe(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Ms(s,e)):Ms(o,e)}});function Ms(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Ld=D("$ZodCatch",(e,t)=>{qe.init(e,t),Pe(e._zod,"optin",()=>t.innerType._zod.optin),Pe(e._zod,"optout",()=>t.innerType._zod.optout),Pe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(a=>gn(a,r,pn()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>gn(s,r,pn()))},input:n.value}),n.issues=[]),n)}}),Nd=D("$ZodPipe",(e,t)=>{qe.init(e,t),Pe(e._zod,"values",()=>t.in._zod.values),Pe(e._zod,"optin",()=>t.in._zod.optin),Pe(e._zod,"optout",()=>t.out._zod.optout),Pe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(a=>so(a,t.in,r)):so(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>so(s,t.out,r)):so(o,t.out,r)}});function so(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ed=D("$ZodReadonly",(e,t)=>{qe.init(e,t),Pe(e._zod,"propValues",()=>t.innerType._zod.propValues),Pe(e._zod,"values",()=>t.innerType._zod.values),Pe(e._zod,"optin",()=>t.innerType._zod.optin),Pe(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ls):Ls(o)}});function Ls(e){return e.value=Object.freeze(e.value),e}const Ad=D("$ZodFunction",(e,t)=>(qe.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...r){const o=e._def.input?us(e._def.input,r):r,s=Reflect.apply(n,this,o);return e._def.output?us(e._def.output,s):s}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){const o=e._def.input?await ds(e._def.input,r):r,s=await Reflect.apply(n,this,o);return e._def.output?await ds(e._def.output,s):s}},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{const r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new Is({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{const r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),Pd=D("$ZodLazy",(e,t)=>{qe.init(e,t),Pe(e._zod,"innerType",()=>t.getter()),Pe(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Pe(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Pe(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),Pe(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),jd=D("$ZodCustom",(e,t)=>{_t.init(e,t),qe.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>Ns(s,n,r,e));Ns(o,n,r,e)}});function Ns(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Sr(o))}}class Od{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Dd(){return new Od}const ao=Dd();function qd(e,t){return new e({type:"string",...ye(t)})}function Zd(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(t)})}function Es(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(t)})}function As(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(t)})}function Ud(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(t)})}function Rd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(t)})}function Fd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(t)})}function Wd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ye(t)})}function Qd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(t)})}function Vd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(t)})}function Gd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(t)})}function Yd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(t)})}function Bd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(t)})}function Hd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ye(t)})}function Jd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(t)})}function Kd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(t)})}function Xd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(t)})}function ef(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(t)})}function tf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(t)})}function nf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ye(t)})}function rf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(t)})}function of(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ye(t)})}function sf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(t)})}function af(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(t)})}function lf(e,t){return new e({type:"string",format:"date",check:"string_format",...ye(t)})}function cf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ye(t)})}function uf(e,t){return new e({type:"string",format:"duration",check:"string_format",...ye(t)})}function df(e,t){return new e({type:"number",checks:[],...ye(t)})}function ff(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(t)})}function pf(e,t){return new e({type:"boolean",...ye(t)})}function hf(e){return new e({type:"any"})}function mf(e){return new e({type:"unknown"})}function gf(e,t){return new e({type:"never",...ye(t)})}function vf(e,t){return new e({type:"void",...ye(t)})}function Ps(e,t){return new vs({check:"less_than",...ye(t),value:e,inclusive:!1})}function Wo(e,t){return new vs({check:"less_than",...ye(t),value:e,inclusive:!0})}function js(e,t){return new bs({check:"greater_than",...ye(t),value:e,inclusive:!1})}function Qo(e,t){return new bs({check:"greater_than",...ye(t),value:e,inclusive:!0})}function Os(e,t){return new Tu({check:"multiple_of",...ye(t),value:e})}function Ds(e,t){return new Cu({check:"max_length",...ye(t),maximum:e})}function lo(e,t){return new zu({check:"min_length",...ye(t),minimum:e})}function qs(e,t){return new Mu({check:"length_equals",...ye(t),length:e})}function bf(e,t){return new Lu({check:"string_format",format:"regex",...ye(t),pattern:e})}function yf(e){return new Nu({check:"string_format",format:"lowercase",...ye(e)})}function wf(e){return new Eu({check:"string_format",format:"uppercase",...ye(e)})}function kf(e,t){return new Au({check:"string_format",format:"includes",...ye(t),includes:e})}function _f(e,t){return new Pu({check:"string_format",format:"starts_with",...ye(t),prefix:e})}function xf(e,t){return new ju({check:"string_format",format:"ends_with",...ye(t),suffix:e})}function Tr(e){return new Ou({check:"overwrite",tx:e})}function $f(e){return Tr(t=>t.normalize(e))}function Sf(){return Tr(e=>e.trim())}function Tf(){return Tr(e=>e.toLowerCase())}function If(){return Tr(e=>e.toUpperCase())}function Cf(e,t,n){return new e({type:"array",element:t,...ye(n)})}function zf(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ye(n)})}function Mf(e){const t=Lf(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Sr(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Sr(o))}},e(n.value,n)));return t}function Lf(e,t){const n=new _t({check:"custom",...ye(t)});return n._zod.check=e,n}const Nf=D("ZodISODateTime",(e,t)=>{Ju.init(e,t),Be.init(e,t)});function Ef(e){return af(Nf,e)}const Af=D("ZodISODate",(e,t)=>{Ku.init(e,t),Be.init(e,t)});function Pf(e){return lf(Af,e)}const jf=D("ZodISOTime",(e,t)=>{Xu.init(e,t),Be.init(e,t)});function Of(e){return cf(jf,e)}const Df=D("ZodISODuration",(e,t)=>{ed.init(e,t),Be.init(e,t)});function qf(e){return uf(Df,e)}const Nt=D("ZodError",(e,t)=>{cs.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Rc(e,n)},flatten:{value:n=>Uc(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Do,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Do,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Zf=Xr(Nt),Uf=eo(Nt),Rf=to(Nt),Ff=no(Nt),Wf=Qc(Nt),Qf=Vc(Nt),Vf=Gc(Nt),Gf=Yc(Nt),Yf=Bc(Nt),Bf=Hc(Nt),Hf=Jc(Nt),Jf=Kc(Nt),Re=D("ZodType",(e,t)=>(qe.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>mn(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Zf(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Rf(e,n,r),e.parseAsync=async(n,r)=>Uf(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Ff(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Wf(e,n,r),e.decode=(n,r)=>Qf(e,n,r),e.encodeAsync=async(n,r)=>Vf(e,n,r),e.decodeAsync=async(n,r)=>Gf(e,n,r),e.safeEncode=(n,r)=>Yf(e,n,r),e.safeDecode=(n,r)=>Bf(e,n,r),e.safeEncodeAsync=async(n,r)=>Hf(e,n,r),e.safeDecodeAsync=async(n,r)=>Jf(e,n,r),e.refine=(n,r)=>e.check(Hp(n,r)),e.superRefine=n=>e.check(Jp(n)),e.overwrite=n=>e.check(Tr(n)),e.optional=()=>Gs(e),e.nullable=()=>Ys(e),e.nullish=()=>Gs(Ys(e)),e.nonoptional=n=>Zp(e,n),e.array=()=>Ze(e),e.or=n=>In([e,n]),e.and=n=>Cp(e,n),e.transform=n=>Hs(e,Ap(n)),e.default=n=>Op(e,n),e.prefault=n=>qp(e,n),e.catch=n=>Rp(e,n),e.pipe=n=>Hs(e,n),e.readonly=()=>Qp(e),e.describe=n=>{const r=e.clone();return ao.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return ao.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ao.get(e);const r=e.clone();return ao.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Zs=D("_ZodString",(e,t)=>{Ro.init(e,t),Re.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(bf(...r)),e.includes=(...r)=>e.check(kf(...r)),e.startsWith=(...r)=>e.check(_f(...r)),e.endsWith=(...r)=>e.check(xf(...r)),e.min=(...r)=>e.check(lo(...r)),e.max=(...r)=>e.check(Ds(...r)),e.length=(...r)=>e.check(qs(...r)),e.nonempty=(...r)=>e.check(lo(1,...r)),e.lowercase=r=>e.check(yf(r)),e.uppercase=r=>e.check(wf(r)),e.trim=()=>e.check(Sf()),e.normalize=(...r)=>e.check($f(...r)),e.toLowerCase=()=>e.check(Tf()),e.toUpperCase=()=>e.check(If())}),Kf=D("ZodString",(e,t)=>{Ro.init(e,t),Zs.init(e,t),e.email=n=>e.check(Zd(Xf,n)),e.url=n=>e.check(Wd(tp,n)),e.jwt=n=>e.check(sf(gp,n)),e.emoji=n=>e.check(Qd(np,n)),e.guid=n=>e.check(Es(Us,n)),e.uuid=n=>e.check(As(Ir,n)),e.uuidv4=n=>e.check(Ud(Ir,n)),e.uuidv6=n=>e.check(Rd(Ir,n)),e.uuidv7=n=>e.check(Fd(Ir,n)),e.nanoid=n=>e.check(Vd(rp,n)),e.guid=n=>e.check(Es(Us,n)),e.cuid=n=>e.check(Gd(op,n)),e.cuid2=n=>e.check(Yd(ip,n)),e.ulid=n=>e.check(Bd(sp,n)),e.base64=n=>e.check(nf(pp,n)),e.base64url=n=>e.check(rf(hp,n)),e.xid=n=>e.check(Hd(ap,n)),e.ksuid=n=>e.check(Jd(lp,n)),e.ipv4=n=>e.check(Kd(cp,n)),e.ipv6=n=>e.check(Xd(up,n)),e.cidrv4=n=>e.check(ef(dp,n)),e.cidrv6=n=>e.check(tf(fp,n)),e.e164=n=>e.check(of(mp,n)),e.datetime=n=>e.check(Ef(n)),e.date=n=>e.check(Pf(n)),e.time=n=>e.check(Of(n)),e.duration=n=>e.check(qf(n))});function _(e){return qd(Kf,e)}const Be=D("ZodStringFormat",(e,t)=>{Ve.init(e,t),Zs.init(e,t)}),Xf=D("ZodEmail",(e,t)=>{Ru.init(e,t),Be.init(e,t)}),Us=D("ZodGUID",(e,t)=>{Zu.init(e,t),Be.init(e,t)}),Ir=D("ZodUUID",(e,t)=>{Uu.init(e,t),Be.init(e,t)});function ep(e){return As(Ir,e)}const tp=D("ZodURL",(e,t)=>{Fu.init(e,t),Be.init(e,t)}),np=D("ZodEmoji",(e,t)=>{Wu.init(e,t),Be.init(e,t)}),rp=D("ZodNanoID",(e,t)=>{Qu.init(e,t),Be.init(e,t)}),op=D("ZodCUID",(e,t)=>{Vu.init(e,t),Be.init(e,t)}),ip=D("ZodCUID2",(e,t)=>{Gu.init(e,t),Be.init(e,t)}),sp=D("ZodULID",(e,t)=>{Yu.init(e,t),Be.init(e,t)}),ap=D("ZodXID",(e,t)=>{Bu.init(e,t),Be.init(e,t)}),lp=D("ZodKSUID",(e,t)=>{Hu.init(e,t),Be.init(e,t)}),cp=D("ZodIPv4",(e,t)=>{td.init(e,t),Be.init(e,t)}),up=D("ZodIPv6",(e,t)=>{nd.init(e,t),Be.init(e,t)}),dp=D("ZodCIDRv4",(e,t)=>{rd.init(e,t),Be.init(e,t)}),fp=D("ZodCIDRv6",(e,t)=>{od.init(e,t),Be.init(e,t)}),pp=D("ZodBase64",(e,t)=>{id.init(e,t),Be.init(e,t)}),hp=D("ZodBase64URL",(e,t)=>{ad.init(e,t),Be.init(e,t)}),mp=D("ZodE164",(e,t)=>{ld.init(e,t),Be.init(e,t)}),gp=D("ZodJWT",(e,t)=>{ud.init(e,t),Be.init(e,t)}),Rs=D("ZodNumber",(e,t)=>{ws.init(e,t),Re.init(e,t),e.gt=(r,o)=>e.check(js(r,o)),e.gte=(r,o)=>e.check(Qo(r,o)),e.min=(r,o)=>e.check(Qo(r,o)),e.lt=(r,o)=>e.check(Ps(r,o)),e.lte=(r,o)=>e.check(Wo(r,o)),e.max=(r,o)=>e.check(Wo(r,o)),e.int=r=>e.check(Fs(r)),e.safe=r=>e.check(Fs(r)),e.positive=r=>e.check(js(0,r)),e.nonnegative=r=>e.check(Qo(0,r)),e.negative=r=>e.check(Ps(0,r)),e.nonpositive=r=>e.check(Wo(0,r)),e.multipleOf=(r,o)=>e.check(Os(r,o)),e.step=(r,o)=>e.check(Os(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Oe(e){return df(Rs,e)}const vp=D("ZodNumberFormat",(e,t)=>{dd.init(e,t),Rs.init(e,t)});function Fs(e){return ff(vp,e)}const bp=D("ZodBoolean",(e,t)=>{fd.init(e,t),Re.init(e,t)});function Le(e){return pf(bp,e)}const yp=D("ZodAny",(e,t)=>{pd.init(e,t),Re.init(e,t)});function Vo(){return hf(yp)}const wp=D("ZodUnknown",(e,t)=>{hd.init(e,t),Re.init(e,t)});function Cr(){return mf(wp)}const kp=D("ZodNever",(e,t)=>{md.init(e,t),Re.init(e,t)});function _p(e){return gf(kp,e)}const xp=D("ZodVoid",(e,t)=>{gd.init(e,t),Re.init(e,t)});function Ws(e){return vf(xp,e)}const $p=D("ZodArray",(e,t)=>{vd.init(e,t),Re.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(lo(n,r)),e.nonempty=n=>e.check(lo(1,n)),e.max=(n,r)=>e.check(Ds(n,r)),e.length=(n,r)=>e.check(qs(n,r)),e.unwrap=()=>e.element});function Ze(e,t){return Cf($p,e,t)}const Sp=D("ZodObject",(e,t)=>{yd.init(e,t),Re.init(e,t),Pe(e,"shape",()=>t.shape),e.keyof=()=>tt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Cr()}),e.loose=()=>e.clone({...e._zod.def,catchall:Cr()}),e.strict=()=>e.clone({...e._zod.def,catchall:_p()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>jc(e,n),e.safeExtend=n=>Oc(e,n),e.merge=n=>Dc(e,n),e.pick=n=>Ac(e,n),e.omit=n=>Pc(e,n),e.partial=(...n)=>qc(Vs,e,n[0]),e.required=(...n)=>Zc(Bs,e,n[0])});function se(e,t){const n={type:"object",get shape(){return hn(this,"shape",e?zc(e):{}),this.shape},...ye(t)};return new Sp(n)}const Qs=D("ZodUnion",(e,t)=>{Ss.init(e,t),Re.init(e,t),e.options=t.options});function In(e,t){return new Qs({type:"union",options:e,...ye(t)})}const Tp=D("ZodDiscriminatedUnion",(e,t)=>{Qs.init(e,t),wd.init(e,t)});function co(e,t,n){return new Tp({type:"union",options:t,discriminator:e,...ye(n)})}const Ip=D("ZodIntersection",(e,t)=>{kd.init(e,t),Re.init(e,t)});function Cp(e,t){return new Ip({type:"intersection",left:e,right:t})}const zp=D("ZodTuple",(e,t)=>{Is.init(e,t),Re.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Mp(e,t,n){const r=t instanceof qe,o=r?n:t,s=r?t:null;return new zp({type:"tuple",items:e,rest:s,...ye(o)})}const Lp=D("ZodRecord",(e,t)=>{_d.init(e,t),Re.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function st(e,t,n){return new Lp({type:"record",keyType:e,valueType:t,...ye(n)})}const Go=D("ZodEnum",(e,t)=>{xd.init(e,t),Re.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const a of r)if(n.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Go({...t,checks:[],...ye(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const a of r)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Go({...t,checks:[],...ye(o),entries:s})}});function tt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Go({type:"enum",entries:n,...ye(t)})}const Np=D("ZodLiteral",(e,t)=>{$d.init(e,t),Re.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Fe(e,t){return new Np({type:"literal",values:Array.isArray(e)?e:[e],...ye(t)})}const Ep=D("ZodTransform",(e,t)=>{Sd.init(e,t),Re.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ns(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Sr(s,n.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(Sr(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function Ap(e){return new Ep({type:"transform",transform:e})}const Vs=D("ZodOptional",(e,t)=>{Td.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Gs(e){return new Vs({type:"optional",innerType:e})}const Pp=D("ZodNullable",(e,t)=>{Id.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ys(e){return new Pp({type:"nullable",innerType:e})}const jp=D("ZodDefault",(e,t)=>{Cd.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Op(e,t){return new jp({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():as(t)}})}const Dp=D("ZodPrefault",(e,t)=>{zd.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function qp(e,t){return new Dp({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():as(t)}})}const Bs=D("ZodNonOptional",(e,t)=>{Md.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Zp(e,t){return new Bs({type:"nonoptional",innerType:e,...ye(t)})}const Up=D("ZodCatch",(e,t)=>{Ld.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rp(e,t){return new Up({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Fp=D("ZodPipe",(e,t)=>{Nd.init(e,t),Re.init(e,t),e.in=t.in,e.out=t.out});function Hs(e,t){return new Fp({type:"pipe",in:e,out:t})}const Wp=D("ZodReadonly",(e,t)=>{Ed.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qp(e){return new Wp({type:"readonly",innerType:e})}const Vp=D("ZodLazy",(e,t)=>{Pd.init(e,t),Re.init(e,t),e.unwrap=()=>e._zod.def.getter()});function Gp(e){return new Vp({type:"lazy",getter:e})}const Yp=D("ZodFunction",(e,t)=>{Ad.init(e,t),Re.init(e,t)});function Js(e){return new Yp({type:"function",input:Array.isArray(e?.input)?Mp(e?.input):e?.input??Ze(Cr()),output:e?.output??Cr()})}const Bp=D("ZodCustom",(e,t)=>{jd.init(e,t),Re.init(e,t)});function Hp(e,t={}){return zf(Bp,e,t)}function Jp(e){return Mf(e)}var Kp=Object.defineProperty,Xt=(e,t)=>Kp(e,"name",{value:t,configurable:!0}),Xp=tt(["rating","single_choice","nps","nested_selection","multiple_choice_multiple","short_answer","long_text","annotation"]).describe("Enumeration of all supported question types for form fields"),xe={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"},eh=tt(["required","min","max","minLength","maxLength","pattern","email","url","custom"]).describe("Enumeration of all supported validation rule types"),th=se({type:eh.describe("Type of validation rule to apply"),value:In([_(),Oe(),Le()]).optional().describe("Value for the validation rule (string, number, or boolean)"),message:_().optional().describe("Custom error message when validation fails"),describe:_().max(500).optional().describe("LLM tool call description for this validation rule")}).describe("Schema defining validation rules for question responses"),nh=tt(["equals","not_equals","contains","not_contains","greater_than","less_than","is_empty","is_not_empty"]).describe("Enumeration of all supported visibility condition operators"),rh=se({field:_().describe("ID of the field to check against"),operator:nh.describe("Comparison operator for the condition"),value:In([_(),Oe(),Le()]).optional().describe("Value to compare against (string, number, or boolean)"),describe:_().max(500).optional().describe("LLM tool call description for this visibility condition")}).describe("Schema defining conditions that control when questions are visible"),Yo=se({id:_().describe("Unique identifier for the section"),title:_().min(1).max(200).describe("Display title for the section"),questionIds:Ze(_()).min(1).describe("Array of question IDs that belong to this section")}).describe("Schema defining sections that organize questions into logical groups"),oh=tt(["D","P","A","S"]),ih=tt(["star","heart","thumbs-up","diamond","emoji","emoji-exp"]),sh=tt(["small","medium","large"]),ah=tt(["radio","list","chip","dropdown"]),lh=tt(["checkbox","list","chip"]),ch=tt(["randomize","flip","rotate","ascending","none"]),vn=se({id:_().describe("Unique identifier for the question"),type:Xp.describe("The type of question (rating, single_choice, etc.)"),title:_().min(1).max(200).describe("The main title/question text displayed to users"),description:_().max(1e3).optional().describe("Optional detailed description or help text"),describe:_().max(2e3).optional().describe("LLM tool call description for better AI understanding and context"),required:Le().default(!1).describe("Whether this question must be answered"),errorMessage:_().max(500).optional().describe("Custom error message when validation fails"),validations:Ze(th).optional().default([]).describe("Array of validation rules to apply"),visibility:Ze(rh).optional().default([]).describe("Conditions that control when this question is shown"),isFixed:Le().describe("Whether this question position is fixed or can be reordered"),sectionId:_().optional().describe("ID of the section this question belongs to"),status:oh.describe("Current status of the question (Draft, Published, etc.)")}).describe("Base schema for all question types with common properties"),uh=vn.extend({type:Fe("rating").describe("Must be exactly 'rating'"),showLabels:Le().optional().describe("Whether to show min/max labels"),minLabel:_().max(100).optional().describe("Label for the minimum rating value"),maxLabel:_().max(100).optional().describe("Label for the maximum rating value"),displayStyle:ih.optional().describe("Visual style for rating display"),numberOfRatings:Oe().int().min(1).max(10).describe("Number of rating options (1-10)"),representationSize:sh.optional().describe("Size of rating visual elements"),color:_().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"),dh=vn.extend({type:Fe("annotation").describe("Must be exactly 'annotation'"),annotationText:_().max(1e3).optional().describe("Text to display when annotation is provided"),noAnnotationText:_().max(500).optional().describe("Text to display when no annotation is provided")}).describe("Schema for annotation questions that provide additional context or instructions"),Ks=se({id:_().describe("Unique identifier for this option (system time milliseconds)"),value:_().min(1).max(100).describe("The internal value used for this option"),label:_().min(1).max(200).describe("The display text shown to users for this option"),describe:_().max(500).optional().describe("LLM tool call description providing context about this option"),imageUrl:_().url().optional().describe("Optional image URL to display with this option")}).describe("Schema for individual options in choice-based questions"),Xs=Gp(()=>se({id:_().describe("Unique identifier for this nested option (system time milliseconds)"),value:_().min(1).max(100).describe("The internal value used for this nested option"),label:_().min(1).max(200).describe("The display text shown for this nested option"),describe:_().max(500).optional().describe("LLM tool call description for this nested option context"),imageUrl:_().url().optional().describe("Optional image URL for this nested option"),hint:_().max(500).optional().describe("Optional hint text to help users understand this nested option"),children:Ze(Xs).optional().default([]).describe("Array of child options for hierarchical structure")}).describe("Schema for nested options with hierarchical structure support")),fh=vn.extend({type:Fe("single_choice").describe("Must be exactly 'single_choice'"),displayStyle:ah.optional().describe("Visual style for displaying options"),randomizeOptions:Le().optional().default(!1).describe("Whether to randomize the order of options"),options:Ze(Ks).min(1).max(50).describe("Array of options for user selection (1-50 options)")}).describe("Schema for single-choice multiple selection questions"),ph=vn.extend({type:Fe("multiple_choice_multiple").describe("Must be exactly 'multiple_choice_multiple'"),displayStyle:lh.optional().describe("Visual style for displaying multiple options"),minSelections:Oe().int().min(0).optional().describe("Minimum number of options that must be selected"),maxSelections:Oe().int().min(1).optional().describe("Maximum number of options that can be selected"),randomizeOptions:Le().optional().default(!1).describe("Whether to randomize the order of options"),options:Ze(Ks).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"),hh=vn.extend({type:Fe("nps").describe("Must be exactly 'nps'"),min:Fe(0).describe("NPS always starts at 0"),max:Fe(10).describe("NPS always ends at 10"),minLabel:_().max(100).optional().describe("Label for the minimum NPS value (0)"),maxLabel:_().max(100).optional().describe("Label for the maximum NPS value (10)"),scaleLabels:st(_().regex(/^\d+$/),_().max(50)).optional().describe("Custom labels for specific NPS values (0-10)"),prepopulatedValue:Oe().int().min(0).max(10).optional().describe("Default value to pre-select (0-10)")}).refine(e=>e.scaleLabels?Object.keys(e.scaleLabels).every(n=>{const r=Number(n);return!isNaN(r)&&r>=0&&r<=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"),mh=vn.extend({type:Fe("short_answer").describe("Must be exactly 'short_answer'"),maxCharacters:Oe().int().min(1).max(1e4).optional().describe("Maximum number of characters allowed"),minCharacters:Oe().int().min(0).optional().describe("Minimum number of characters required"),placeholder:_().max(200).optional().describe("Placeholder text shown in the input field"),enableRegexValidation:Le().optional().default(!1).describe("Whether to enable regex pattern validation"),regexPattern:_().optional().describe("Regular expression pattern for validation"),enableEnhanceWithAi:Le().optional().default(!1).describe("Whether to enable AI enhancement features"),promptTemplate:_().max(2e3).optional().describe("Template for AI enhancement prompts"),cooldownSeconds:Oe().int().min(0).max(3600).optional().describe("Cooldown period between AI enhancements (0-3600 seconds)"),maxEnhancements:Oe().int().min(1).max(10).optional().describe("Maximum number of AI enhancements allowed"),maxTokenAllowed:Oe().int().min(1).max(1e4).optional().describe("Maximum tokens allowed for AI processing"),minCharactersToEnhance:Oe().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"),gh=vn.extend({type:Fe("long_text").describe("Must be exactly 'long_text'"),maxCharacters:Oe().int().min(1).max(5e4).optional().describe("Maximum number of characters allowed (higher limit for long text)"),minCharacters:Oe().int().min(0).optional().describe("Minimum number of characters required"),rows:Oe().int().min(1).max(20).optional().describe("Number of textarea rows to display (1-20)"),placeholder:_().max(500).optional().describe("Placeholder text for the textarea (longer for long text)"),enableEnhanceWithAi:Le().optional().default(!1).describe("Whether to enable AI enhancement features"),promptTemplate:_().max(2e3).optional().describe("Template for AI enhancement prompts"),cooldownSeconds:Oe().int().min(0).max(3600).optional().describe("Cooldown period between AI enhancements (0-3600 seconds)"),maxEnhancements:Oe().int().min(1).max(10).optional().describe("Maximum number of AI enhancements allowed"),maxTokenAllowed:Oe().int().min(1).max(25e3).optional().describe("Maximum tokens allowed for AI processing (higher for long text)"),minCharactersToEnhance:Oe().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"),vh=vn.extend({type:Fe("nested_selection").describe("Must be exactly 'nested_selection'"),placeholder:_().max(200).optional().describe("Placeholder text for the nested dropdown"),options:Ze(Xs).min(1).max(100).describe("Array of nested options for hierarchical selection (1-100 options)"),displayStyle:Fe("list").describe("Fixed display style for nested dropdowns"),choiceOrderOption:ch.optional().default("none").describe("How to order the nested choices"),preserveLastChoices:Oe().int().min(0).max(10).optional().describe("Number of choice levels to preserve (0-10)"),prepopulatedValue:_().max(1e3).optional().describe("Default value to pre-populate"),allowOther:Le().optional().default(!1).describe('Whether to allow custom "other" options'),otherColumnName:_().max(100).optional().describe('Column name for storing custom "other" values'),maxDepth:Oe().int().min(1).max(10).optional().describe("Maximum nesting depth allowed (1-10)"),cascadeLabels:Le().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"),Bo=co("type",[uh,dh,fh,ph,hh,mh,gh,vh]),bh=se({markerNo:_(),timeline:_(),comment:_()}),yh=se({fileType:_(),fileName:_(),markers:Ze(bh)}),wh=se({nps:Oe().optional().describe("Net Promoter Score value (e.g., 0-10)"),nestedSelection:Ze(_()).optional().describe("Array of selected nested option IDs"),longText:_().optional().describe("Long text answer, e.g., paragraph or essay"),shortAnswer:_().optional().describe("Short text answer, e.g., single sentence or word"),singleChoice:_().optional().describe("single selected option ID (for single choice questions)"),rating:Oe().optional().describe("Star rating value (e.g., 1-5)"),multipleChoiceMultiple:Ze(_()).optional().describe("Array of selected option IDs for multiple choice questions"),annotation:yh.optional().describe("Annotation object containing file and marker details"),others:_().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"),kh=wh,_h=tt(["R","S"]).describe("Enumeration of feedback types: R=Recurring, O=One-time"),xh=tt(["Y","N"]).describe("Yes/No enumeration using Y/N values"),$h=tt(["minutes","hours","days","weeks","months","years"]).describe("Time units for recurring feedback schedules"),Sh=se({surveyType:_h.describe("Type of feedback: R for recurring, O for one-time"),showOnce:xh.describe("Whether the feedback should be shown only once per user"),stopWhenResponsesCount:_().regex(/^\d+$/,"Must be a valid number string").describe("Stop feedback when this number of responses is reached (as string)"),recurringValue:_().regex(/^\d+$/,"Must be a valid number string").describe("Value for recurring schedule (e.g., every 15 days)"),recurringUnit:$h.describe("Time unit for recurring schedule"),startDate:_().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:_().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 t=new Date(e.startDate);return new Date(e.stopDate)>t},{message:"Stop date must be after start date",path:["stopDate"]}).describe("Schema defining frequency and scheduling properties for feedback"),Th=se({isShareable:Le().describe("Whether the feedback results can be shared externally"),isEmailShareable:Le().describe("Whether the feedback can be shared via email")}).describe("Schema defining external publishing and sharing properties for feedback"),Ih=tt(["P","D","A","S"]).describe("Publication status: P=Published, D=Draft, A=Archived, S=Stopped"),Ch=se({formTitle:_().describe("Title of the feedback form"),formDescription:_().describe("Description of the feedback form"),isPublished:Ih.describe("Publication status of the feedback form")}).describe("Schema defining feedback configuration properties"),Ce=_().min(1).describe("Translated text content"),zh=se({type:Fe("rating").describe("Question type identifier"),title:Ce.describe("Question title translation"),description:Ce.optional().describe("Question description translation"),errorMessage:Ce.optional().describe("Error message translation"),minLabel:Ce.optional().describe("Minimum rating label translation"),maxLabel:Ce.optional().describe("Maximum rating label translation")}).describe("Translation schema for rating questions"),Mh=se({type:Fe("single_choice").describe("Question type identifier"),title:Ce.describe("Question title translation"),description:Ce.optional().describe("Question description translation"),errorMessage:Ce.optional().describe("Error message translation"),placeholder:Ce.optional().describe("Input placeholder translation")}).catchall(Ce).refine(e=>Object.keys(e).filter(n=>!["type","title","description","errorMessage","placeholder"].includes(n)).every(n=>/^option\..+\.(label|value)$/.test(n)),{message:"Additional keys must follow the pattern 'option.{id}.{label|value}'"}).describe("Translation schema for single choice questions"),Lh=se({type:Fe("multiple_choice_multiple").describe("Question type identifier"),title:Ce.describe("Question title translation"),description:Ce.optional().describe("Question description translation"),errorMessage:Ce.optional().describe("Error message translation"),placeholder:Ce.optional().describe("Input placeholder translation")}).catchall(Ce).refine(e=>Object.keys(e).filter(n=>!["type","title","description","errorMessage","placeholder"].includes(n)).every(n=>/^option\..+\.(label|value)$/.test(n)),{message:"Additional keys must follow the pattern 'option.{id}.{label|value}'"}).describe("Translation schema for multiple choice questions"),Nh=se({type:Fe("nps").describe("Question type identifier"),title:Ce.describe("Question title translation"),description:Ce.optional().describe("Question description translation"),errorMessage:Ce.optional().describe("Error message translation"),minLabel:Ce.optional().describe("Minimum NPS label (0) translation"),maxLabel:Ce.optional().describe("Maximum NPS label (10) translation")}).catchall(Ce).refine(e=>Object.keys(e).filter(n=>!["type","title","description","errorMessage","minLabel","maxLabel"].includes(n)).every(n=>/^scaleLabel\.\d+$/.test(n)),{message:"Additional keys must follow the pattern 'scaleLabel.{number}'"}).describe("Translation schema for NPS questions"),Eh=se({type:Fe("short_answer").describe("Question type identifier"),title:Ce.describe("Question title translation"),description:Ce.optional().describe("Question description translation"),errorMessage:Ce.optional().describe("Error message translation"),placeholder:Ce.optional().describe("Input placeholder translation")}).describe("Translation schema for short answer questions"),Ah=se({type:Fe("long_text").describe("Question type identifier"),title:Ce.describe("Question title translation"),description:Ce.optional().describe("Question description translation"),errorMessage:Ce.optional().describe("Error message translation"),placeholder:Ce.optional().describe("Textarea placeholder translation")}).describe("Translation schema for long answer questions"),Ph=se({type:Fe("nested_selection").describe("Question type identifier"),title:Ce.describe("Question title translation"),description:Ce.optional().describe("Question description translation"),errorMessage:Ce.optional().describe("Error message translation"),placeholder:Ce.optional().describe("Dropdown placeholder translation")}).catchall(Ce).refine(e=>Object.keys(e).filter(n=>!["type","title","description","errorMessage","placeholder"].includes(n)).every(n=>/^nestedOption\..+\.(label|hint)$/.test(n)),{message:"Additional keys must follow the pattern 'nestedOption.{id}.{label|hint}'"}).describe("Translation schema for nested selection questions"),jh=se({type:Fe("annotation").describe("Question type identifier"),title:Ce.describe("Question title translation"),description:Ce.optional().describe("Question description translation"),errorMessage:Ce.optional().describe("Error message translation"),annotationText:Ce.optional().describe("Annotation display text translation"),noAnnotationText:Ce.optional().describe("No annotation display text translation")}).describe("Translation schema for annotation questions"),Oh=In([zh,Mh,Lh,Nh,Eh,Ah,Ph,jh]).describe("Union of all question type translation schemas"),Dh=_().min(2).max(10).describe("Language code (e.g., 'en', 'es', 'hi')"),qh=st(Dh,Oh).describe("Question translations keyed by language code"),Zh=st(_().uuid(),qh).describe("Question-centric translations keyed by question ID, then by language code"),ea=Zh.describe("Question-centric translations at root level"),ta=class{constructor(t,n="en"){this.translations=t,this.defaultLanguage=n}getQuestionTranslations(t,n){const r=this.translations[t];if(!r)return null;let o=r[n];return o||(o=r[this.defaultLanguage]),o||null}getTranslationText(t,n,r){const o=this.getQuestionTranslations(t,n);if(!o)return null;if(r in o){const s=o[r];return typeof s=="string"?s:null}return null}getQuestionLanguages(t){const n=this.translations[t];return n?Object.keys(n):[]}getAvailableLanguages(){const t=new Set;return Object.values(this.translations).forEach(n=>{Object.keys(n).forEach(r=>{t.add(r)})}),Array.from(t)}isLanguageSupportedForQuestion(t,n){const r=this.translations[t];return r?n in r:!1}isLanguageSupported(t){return this.getAvailableLanguages().includes(t)}getDefaultLanguage(){return this.defaultLanguage}getQuestionIds(){return Object.keys(this.translations)}getQuestionType(t,n){const r=n||this.defaultLanguage;return this.getQuestionTranslations(t,r)?.type||null}};Xt(ta,"TranslationProvider");var Uh=ta;function Rh(e,t="en"){return new Uh(e,t)}Xt(Rh,"createTranslationProvider");var Fh=tt(["fade","manual"]).describe("How the end screen should be dismissed (fade out or manual dismissal)"),na=se({title:_().min(1).max(200).describe("The main title displayed on the welcome screen"),description:_().min(1).max(1e3).describe("Description text shown on the welcome screen"),buttonLabel:_().min(1).max(50).describe("Text displayed on the welcome screen button")}).describe("Schema for welcome screen configuration fields"),ra=se({title:_().min(1).max(200).describe("The main title displayed on the end screen"),message:_().min(1).max(1e3).describe("Message text shown on the end screen"),buttonLabel:_().min(1).max(50).describe("Text displayed on the end screen button"),dismissBehavior:Fh.describe("How the end screen should be dismissed (fade out or manual dismissal)"),fadeDuration:Oe().int().min(0).max(1e4).describe("Duration in milliseconds for fade dismissal (0-10000)")}).describe("Schema for end screen configuration fields"),oa=se({title:_().min(1).max(200).describe("Translated title text for welcome screen"),description:_().min(1).max(1e3).describe("Translated description text for welcome screen"),buttonLabel:_().min(1).max(50).describe("Translated text for the welcome button label")}).describe("Schema for welcome screen translation fields"),ia=se({buttonLabel:_().min(1).max(50).describe("Translated text for the end button label"),title:_().min(1).max(200).describe("Translated title text for end screen"),message:_().min(1).max(1e3).describe("Translated message text for end screen")}).describe("Schema for end screen translation fields"),sa=se({pagination:Le().describe("Whether to show pagination for multi-page forms"),questionNumber:Le().describe("Whether to display question numbers"),pageTitle:Le().describe("Whether to show page titles in multi-page forms"),blockerFeedback:Le().describe("Whether to show blocker feedback for validation errors"),submitButtonLabel:_().min(1).max(50).describe("Text for the submit button"),previousButtonLabel:_().min(1).max(50).describe("Text for the previous button in pagination"),nextButtonLabel:_().min(1).max(50).describe("Text for the next button in pagination"),aiEnhancementSuccessMessage:_().min(1).max(100).describe("Message shown when AI enhancement is successful (max 100 characters)"),aiEnhancementCooldownErrorMessage:_().min(1).max(100).describe("Message shown when AI enhancement is on cooldown (max 100 characters)"),aiEnhancementMaxReachedErrorMessage:_().min(1).max(100).describe("Message shown when maximum AI enhancements reached (max 100 characters)")}).describe("Schema for other form configuration fields"),aa=se({value:_().min(1).max(10).describe("Language code (e.g., 'en', 'es', 'fr')"),label:_().min(1).max(50).describe("Display name for the language (e.g., 'English', 'Spanish', 'French')"),isFixed:Le().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"),Ho=Ze(aa).describe("Schema for array of available languages"),la=se({submitButtonLabel:_().min(1).max(50).describe("Translated text for the submit button"),previousButtonLabel:_().min(1).max(50).describe("Translated text for the previous button in pagination"),nextButtonLabel:_().min(1).max(50).describe("Translated text for the next button in pagination"),aiEnhancementSuccessMessage:_().min(1).max(100).describe("Translated message shown when AI enhancement is successful (max 100 characters)"),aiEnhancementCooldownErrorMessage:_().min(1).max(100).describe("Translated message shown when AI enhancement is on cooldown (max 100 characters)"),aiEnhancementMaxReachedErrorMessage:_().min(1).max(100).describe("Translated message shown when maximum AI enhancements reached (max 100 characters)")}).describe("Schema for other form configuration field translations"),ca=tt(["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"]).describe("Available positions for widget placement");tt(["light","dark"]).describe("Available theme modes for the widget");var Wh=se({darkOverlay:Le().describe("Whether to show a dark overlay behind the widget"),closeButton:Le().describe("Whether to display a close button on the widget"),progressBar:Le().describe("Whether to show a progress bar indicating completion status"),showBranding:Le().describe("Whether to display branding elements on the widget"),customPosition:Le().describe("Whether custom positioning is enabled"),customIconPosition:Le().describe("Whether custom icon positioning is enabled"),customCss:_().optional().describe("Custom CSS link to apply for the feedback form")}).describe("Feature settings controlling widget UI behavior and appearance"),ua=se({brandColor:_().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:_().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:_().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:In([_().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i),_().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))")}).describe("Color scheme for a single theme"),da=se({light:ua,dark:ua}).describe("Complete theme configuration with light and dark variants"),fa=se({themes:da.describe("Color themes for light and dark modes"),featureSettings:Wh.describe("UI feature settings controlling widget behavior"),selectedPosition:ca.describe("Selected position for the main widget"),selectedIconPosition:ca.describe("Selected position for the widget icon")}).describe("Complete theme and UI configuration including colors, features, and positioning"),Qh=se({name:_().describe("The operator name (e.g., '=', '!=', 'contains', 'beginsWith', 'matches')"),label:_().describe("Human-readable label for the operator (e.g., 'equals', 'not equals', 'contains')")}).describe("Schema defining an operator for custom event fields"),Vh=se({name:_().describe("The field name (e.g., 'event_name', 'add_to_cart', 'cart_item_number')"),label:_().describe("Human-readable label for the field"),placeholder:_().describe("Placeholder text for input fields"),operators:Ze(Qh).min(1).describe("Array of available operators for this field")}).describe("Schema defining a custom event field with its operators"),Gh=se({customEventFields:Ze(Vh).optional().describe("Array of custom event fields with their operators and labels")}).describe("Schema defining metadata for conditional if clauses"),Yh=se({query:_().describe("The structured query definition as a JSON string"),naturalLanguage:_().describe("Human-readable description of the query conditions"),jsonLogic:_().describe("JSON Logic representation of the query as a JSON string"),sqlQuery:_().describe("SQL representation of the query for database operations")}).describe("Schema defining query output structure with all fields as strings"),Bh=se({id:_().describe("Unique identifier for this condition"),event:_().describe("The event that triggers evaluation of this condition (e.g., 'pageLoad', 'pageView', 'scroll', 'custom')"),queryOutput:Yh.describe("The query conditions to evaluate when the event occurs"),metadata:Gh.optional().describe("Optional metadata containing custom event fields and their configurations")}).describe("Schema defining the 'if' condition for auto-trigger logic"),Hh=se({triggerType:_().describe("The type of action to perform (e.g., 'delay', 'scroll', 'immediately')"),delay:Oe().int().min(0).optional().describe("Delay in seconds before performing the action"),scroll:In([_(),Oe()]).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"),Jh=se({if:Bh.describe("The condition that must be met"),then:Hh.describe("The action to perform when the condition is met")}).describe("Schema defining a conditional when clause with if-then logic"),Jo=se({id:_().describe("Unique identifier for this filter condition"),category:_().describe("The category this filter belongs to (e.g., 'device', 'user', 'geo_location')"),property:_().describe("The property to filter on (e.g., 'device_type', 'age', 'country')"),operator:_().describe("The comparison operator (e.g., 'equals', 'greaterThan', 'lessThan')"),values:Ze(_()).min(1).describe("Array of values to compare against"),tbl_key:_().describe("The database table key for this property")}).describe("Schema defining a single filter condition within a category"),Kh=se({device:Ze(Jo).optional().describe("Array of device-specific filter conditions"),user:Ze(Jo).optional().describe("Array of user-specific filter conditions"),geo_location:Ze(Jo).optional().describe("Array of geo-location specific filter conditions")}).describe("Schema defining category-specific filters for audience targeting"),Xh=se({applications:Ze(_()).min(1).describe("Array of application names this targeting applies to"),userType:_().describe("The type of user this targeting applies to (e.g., 'both', 'new', 'returning')"),categorySpecificFilters:Kh.optional().describe("Optional category-specific filters for more granular targeting")}).describe("Schema defining who the audience targeting applies to"),em=se({id:_().describe("Unique identifier for the audience segment"),name:_().min(1).max(200).describe("Display name for the audience segment"),isImportant:Le().describe("Whether this segment is marked as important for targeting"),when:Ze(Jh).min(1).describe("Array of conditional when clauses with if-then logic"),who:Xh.describe("User criteria and conditions defining who belongs to this segment")}).describe("Schema defining an audience segment for targeting with conditional logic"),pa=se({isAuto:Le().describe("Whether automatic triggering is enabled for this audience"),isManual:Le().describe("Whether manual triggering is enabled for this audience"),segments:Ze(em).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"),Ko=co("isEnabled",[se({isEnabled:Fe(!1).describe("Whether other configuration properties are enabled"),otherFields:sa.describe("Other form configuration fields including pagination, buttons, and display options"),translations:st(_(),la).optional().describe("Translations for other configuration field labels and buttons keyed by language code")}),se({isEnabled:Fe(!0).describe("Whether other configuration properties are enabled"),otherFields:sa.describe("Other form configuration fields including pagination, buttons, and display options"),translations:st(_(),la).describe("Translations for other configuration field labels and buttons keyed by language code")})]).describe("Schema for other configuration properties including fields and translations"),Xo=co("isEnabled",[se({isEnabled:Fe(!1).describe("Whether welcome screen is enabled"),welcomeFields:na.optional().describe("Welcome screen configuration fields including title, description, and button label"),translations:st(_(),oa).optional().describe("Translations for welcome screen content keyed by language code")}),se({isEnabled:Fe(!0).describe("Whether welcome screen is enabled"),welcomeFields:na.describe("Welcome screen configuration fields including title, description, and button label"),translations:st(_(),oa).describe("Translations for welcome screen content keyed by language code")})]).describe("Schema for welcome screen properties including fields and translations"),ei=co("isEnabled",[se({isEnabled:Fe(!1).describe("Whether end screen is enabled"),endFields:ra.optional().describe("End screen configuration fields including title, message, button label, and dismissal behavior"),translations:st(_(),ia).optional().describe("Translations for end screen content keyed by language code")}),se({isEnabled:Fe(!0).describe("Whether end screen is enabled"),endFields:ra.describe("End screen configuration fields including title, message, button label, and dismissal behavior"),translations:st(_(),ia).describe("Translations for end screen content keyed by language code")})]).describe("Schema for end screen properties including fields and translations"),tm=se({themeConfiguration:fa.describe("Theme configuration including colors, features, and positioning")}).describe("Schema for appearance properties including theme configuration");se({feedbackConfigurationId:ep().describe("Unique identifier for the feedback configuration"),feedbackConfiguration:Ch.describe("Configuration properties for the feedback form"),questionnaireFields:se({questions:st(_(),Bo).describe("Collection of questions keyed by their string identifiers"),sections:Ze(Yo).describe("Array of sections that organize questions into logical groups"),selectedLanguages:Ho.describe("Array of languages selected for this questionnaire"),translations:ea.describe("Multi-language translations for questions and form content")}).describe("Fields defining the questionnaire structure, questions, sections, selected languages, and translations"),frequencyAndSchedulingProperties:Sh.describe("Properties controlling when and how often the feedback is shown"),externalPublishingProperties:Th.describe("Properties controlling external sharing and publishing of feedback results"),audienceTriggerProperties:pa.describe("Properties defining audience targeting and trigger conditions for the feedback form"),otherConfigurationProperties:Ko.describe("Additional configuration properties including form display options and translations"),welcomeScreenProperties:Xo.describe("Welcome screen configuration including content and translations"),endScreenProperties:ei.describe("End screen configuration including content, dismissal behavior, and translations"),appearanceProperties:tm.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");var nm=se({mandatoryFetchConfigAtPaths:Ze(_()).describe("Array of paths where configuration must be fetched from server when navigated by user"),configSyncIntervalSeconds:Oe().int().positive().describe("Interval in seconds for configuration synchronization between client and server"),disableAllSurvey:Le().describe("Flag to disable all surveys globally"),feedbackIntervalDuration:Oe().int().positive().describe("Duration in seconds for feedback interval between two auto triggered feedbacks")}).describe("Master properties configuration for global survey settings"),rm=tt(["light","dark","system"]).describe("Enumeration of supported theme modes"),uo=se({$deviceType:_().describe("Type of device being used"),$timezone:_().describe("Device timezone (e.g., 'Asia/Calcutta')"),$theme:rm.describe("Current theme mode preference"),$os:_().describe("Operating system running on the device"),$osVersion:_().describe("Version of the operating system"),$appVersion:_().describe("Version of the application"),$app:_().describe("Browser or application being used"),$language:_().describe("Language preference (e.g., 'en-GB')")}).describe("Device information collected from the client"),fo=se({$sessionId:_().uuid().describe("Unique session identifier"),$timestamp:_().optional().describe("ISO timestamp of the session")}).describe("Session information for tracking user sessions");se({deviceInfo:uo.describe("Device information"),sessionInfo:fo.describe("Session information")}).describe("Combined device and session information");var om=se({$counter:st(_(),Oe().int()).describe("Counter properties for user tracking (can be positive or negative)").optional(),$set:st(_(),Vo()).describe("Properties to set for the user").optional(),$setOnce:st(_(),Vo()).describe("Properties to set once for the user (won't overwrite existing values)").optional(),$unset:Ze(_()).describe("Array of property names to unset/remove from the user").optional()}).loose().describe("User properties including counters, set operations, and other dynamic data"),ti=se({userName:_().email().describe("User's email address as username"),properties:om.describe("User properties and counters")}).describe("User information including identification and properties"),im=tt(["V","S"]).describe("User action: V for view, S for submit"),ni=se({feedbackIdentifier:_().uuid().describe("Unique identifier for the feedback instance"),feedbackConfigurationId:_().uuid().describe("Unique identifier for the feedback configuration"),completionTimeInSeconds:Oe().int().min(0).describe("Time taken to complete the feedback in seconds"),userAction:im.describe("Action performed by the user"),responseLanguageCode:_().length(2).describe("Language code for the response (e.g., 'en', 'es')")}).describe("Configuration information for the feedback form"),sm=se({questionId:_().uuid().describe("Unique identifier for the question"),answer:kh.describe("The answer provided for this question"),type:_().describe("Type of the question (e.g., 'rating', 'single_choice')"),error:_().optional().describe("Error message if any validation failed")}).describe("Response to a specific question in the feedback form"),am=se({questions:Ze(sm).min(1).describe("Array of question responses")}).describe("User responses to feedback questions"),lm=se({customEventName:_().nullable().describe("Custom event name that triggered the feedback"),currentPath:_().describe("Current page path where feedback was triggered"),eventType:_().describe("Type of event that triggered the feedback")}).passthrough().describe("Properties of the trigger that matched for this feedback"),ha=se({formConfig:ni.describe("Form configuration information"),deviceInfo:uo.describe("Device information"),sessionInfo:fo.describe("Session information"),userInfo:ti.optional().describe("User information (optional)"),matchedTriggerProperties:lm.describe("Properties of the matched trigger"),customProperties:st(_(),Cr()).optional().describe("Custom properties for advanced use cases")}).describe("Base submit feedback request schema"),cm=ha.extend({formConfig:ni.extend({userAction:Fe("V").describe("Action performed by the user (view)")})}).strict().describe("View feedback request schema (no response required)"),um=ha.extend({formConfig:ni.extend({userAction:Fe("S").describe("Action performed by the user (submit)")}),response:am.describe("User responses (required for submit)")}).strict().describe("Submit feedback request schema (response required)");In([cm,um]).describe("Union schema for both view and submit feedback requests");var dm=se({feedbackConfigurationId:_().uuid().describe("Unique identifier for the feedback configuration"),feedbackTitle:_().describe("Title of the feedback configuration"),triggerProperties:pa.describe("Trigger properties including auto/manual settings and audience segments"),appearanceProperties:se({themes:se({light:se({brandColor:_().describe("Brand color for light theme"),overlayColor:_().describe("Overlay color for light theme"),textColor:_().describe("Text color for light theme"),backgroundColor:_().describe("Background color for light theme")}).describe("Light theme colors"),dark:se({brandColor:_().describe("Brand color for dark theme"),overlayColor:_().describe("Overlay color for dark theme"),textColor:_().describe("Text color for dark theme"),backgroundColor:_().describe("Background color for dark theme")}).describe("Dark theme colors")}).nullable().optional().describe("Theme configuration (optional)"),featureSettings:se({darkOverlay:Le().describe("Whether to show dark overlay"),closeButton:Le().describe("Whether to show close button"),progressBar:Le().describe("Whether to show progress bar"),showBranding:Le().describe("Whether to show branding"),customPosition:Le().describe("Whether custom position is enabled"),customIconPosition:Le().describe("Whether custom icon position is enabled"),customCss:_().nullable().optional().describe("Custom CSS link (optional)")}).describe("Feature settings for the feedback form"),selectedIconPosition:_().describe("Selected position for the feedback icon"),selectedPosition:_().describe("Selected position for the feedback form")}).describe("Appearance properties for the feedback form")}).describe("Individual feedback configuration item in the list"),fm=se({feedbackConfigurationId:_().uuid().describe("Unique identifier for the feedback configuration"),responseLanguageCode:_().length(2).describe("Language code for the response (e.g., 'en', 'es')")}).describe("Form configuration for fetching feedback details");se({deviceInfo:uo.describe("Device information"),sessionInfo:fo.describe("Session information"),userInfo:ti.optional().describe("User information (optional)"),force:Le().optional().describe("Forcefully fetch eligible feedback list (optional)")}).strict().describe("Request schema for fetching available feedback configurations"),se({formConfig:fm.describe("Form configuration for the specific feedback"),deviceInfo:uo.describe("Device information"),sessionInfo:fo.describe("Session information"),userInfo:ti.optional().describe("User information (optional)")}).strict().describe("Request schema for fetching specific feedback form details");var pm=se({formTitle:_().describe("Title of the feedback form"),formDescription:_().describe("Description of the feedback form")}).describe("Form configuration response with title and description"),hm=se({questions:st(_(),Bo).describe("Collection of questions keyed by their string identifiers"),sections:Ze(Yo).describe("Array of sections that organize questions into logical groups"),translations:st(_(),Vo()).describe("Translations object (can be empty or contain language-specific translations)"),selectedLanguages:Ho.describe("Array of languages selected for this questionnaire")}).describe("Questionnaire fields response including questions, sections, translations, and selected languages");se({feedbackConfigurationId:_().uuid().describe("Unique identifier for the feedback configuration"),feedbackIdentifier:_().uuid().describe("Unique identifier for this specific feedback instance"),formConfiguration:pm.describe("Form configuration with title and description"),questionnaireFields:hm.describe("Questionnaire structure including questions, sections, translations, and languages"),otherConfigurationProperties:Ko.describe("Other configuration properties using existing schema"),welcomeScreenProperties:Xo.describe("Welcome screen properties using existing schema"),endScreenProperties:ei.describe("End screen properties using existing schema")}).strict().describe("Complete response schema for fetchFeedbackDetails API using existing field schemas"),se({masterProperties:nm.describe("Master properties for global survey settings"),feedbackConfiguration:Ze(dm).describe("Array of available feedback configurations")}).strict().describe("Response schema for fetchConfigurationList API"),se({questionId:_().describe("Unique identifier for the question"),identifier:_().uuid().describe("Unique identifier for the feedback instance"),feedbackConfigurationId:_().uuid().describe("Unique identifier for the feedback configuration"),userText:_().describe("Original text input from the user")}).strict().describe("Request schema for refining user text input");var mm=se({userText:_().describe("Original text input from the user"),refinedText:_().describe("Refined/improved version of the user text")}).describe("Data containing original and refined text");se({success:Le().describe("Indicates whether the operation was successful"),code:_().describe("Response code indicating the status"),message:_().describe("Human-readable message describing the result"),messageId:_().describe("Unique identifier for the response message"),data:mm.describe("Response data containing original and refined text"),error:_().optional().describe("Error message if the operation failed (optional)")}).strict().describe("Response schema for refine text API operation");function er(e,t){if(e===null||typeof e>"u"||typeof e!="object")return e;const n=Array.isArray(e)?[]:{};for(const[r,o]of Object.entries(e)){let s=r;typeof r=="string"&&!r.includes("-")&&(s=t(r)),n[s]=Array.isArray(o)?o.map(a=>typeof a=="object"&&!(a instanceof Uint8Array)&&!(a instanceof Date)?er(a,t):a):o instanceof Uint8Array||o instanceof Date?o:typeof o=="object"?er(o,t):o}return n}Xt(er,"convertObject");function ri(e){return e.length===1?e.toLowerCase():e.replace(/^([A-Z])/,t=>t[0].toLowerCase()).replace(/[_-]([a-z0-9])/g,t=>t[1].toUpperCase())}Xt(ri,"toCamel");function gm(e){return er(e,ri)}Xt(gm,"objectToCamel");function ma(e){let t=e,n=0;for(;(/([a-z])([0-9])/.exec(t)?.length||0)>2&&n<10;)t=t.replace(/([a-z])([0-9])/,(r,o,s)=>`${o.toLowerCase()}_${s.toLowerCase()}`),n+=1;for(;(/(.+?)([A-Z])/.exec(t)?.length||0)>2&&n<10;)t=t.replace(/(.+?)([A-Z])/,(r,o,s)=>`${o.toLowerCase()}_${s.toLowerCase()}`),n+=1;return t.toLowerCase()}Xt(ma,"toSnake");function vm(e){return er(e,ma)}Xt(vm,"objectToSnake");function ga(e){return ri(e).replace(/^([a-z])/,t=>t[0].toUpperCase())}Xt(ga,"toPascal");function bm(e){return er(e,ga)}Xt(bm,"objectToPascal");var ym=tt(["light","dark"]).describe("Current theme mode of the application");se({theme:da.describe("Theme configuration including light and dark theme colors"),currentMode:ym.describe("Current theme mode (light or dark)"),currentLanguage:aa.describe("Currently selected language configuration"),questions:st(_(),Bo).describe("Collection of questions keyed by their string identifiers"),questionLanguages:Ho.describe("Available languages for questions"),otherConfigurationProperties:Ko.describe("Other configuration properties including form display options and translations"),welcomeScreenProperties:Xo.optional().describe("Welcome screen configuration (optional)"),endScreenProperties:ei.optional().describe("End screen configuration (optional)"),translations:ea.optional().describe("Multi-language translations for questions and form content (optional)"),onSectionChange:Js({input:[Oe()],output:Ws()}).optional().describe("Optional callback function triggered when section changes"),onClose:Js({input:[],output:Ws()}).optional().describe("Optional callback function triggered when the form is closed"),sections:Ze(Yo).describe("Array of sections that organize questions into logical groups"),themeSettings:fa.describe("Complete theme configuration including colors, features, and positioning")}).describe("Schema for application props interface containing all form configuration and state");const wm="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(wm);let tr=!1,km=!1;function _m(){tr=!0}_m();const oi=1,ii=2,va=4,xm=8,$m=16,Sm=1,Tm=2,ba=4,Im=8,Cm=16,zm=1,Mm=2,ya="[",po="[!",si="]",nr={},ot=Symbol(),Lm="http://www.w3.org/1999/xhtml",Nm="http://www.w3.org/2000/svg",Em="@attach",Am=!1;var ho=Array.isArray,Pm=Array.prototype.indexOf,ai=Array.from,mo=Object.keys,Cn=Object.defineProperty,en=Object.getOwnPropertyDescriptor,wa=Object.getOwnPropertyDescriptors,jm=Object.prototype,Om=Array.prototype,li=Object.getPrototypeOf,ka=Object.isExtensible;function zr(e){return typeof e=="function"}const Vt=()=>{};function Dm(e){return e()}function ci(e){for(var t=0;t<e.length;t++)e[t]()}function _a(){var e,t,n=new Promise((r,o)=>{e=r,t=o});return{promise:n,resolve:e,reject:t}}function qm(e,t){if(Array.isArray(e))return e;if(!(Symbol.iterator in e))return Array.from(e);const n=[];for(const r of e)if(n.push(r),n.length===t)break;return n}const xt=2,ui=4,go=8,zn=16,tn=32,bn=64,di=128,Et=256,vo=512,at=1024,It=2048,nn=4096,Dt=8192,Mn=16384,fi=32768,rr=65536,xa=1<<17,Zm=1<<18,Ln=1<<19,$a=1<<20,pi=1<<21,bo=1<<22,Nn=1<<23,Gt=Symbol("$state"),hi=Symbol("legacy props"),Um=Symbol(""),Mr=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Rm=1,mi=3,or=8;function Sa(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Fm(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Wm(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Qm(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Vm(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Gm(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ym(){throw new Error("https://svelte.dev/e/hydration_failed")}function Bm(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Hm(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Jm(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Km(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Xm(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function yo(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function eg(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function tg(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let $e=!1;function pt(e){$e=e}let Me;function lt(e){if(e===null)throw yo(),nr;return Me=e}function En(){return lt(Bt(Me))}function S(e){if($e){if(Bt(Me)!==null)throw yo(),nr;Me=e}}function ng(e=1){if($e){for(var t=e,n=Me;t--;)n=Bt(n);Me=n}}function wo(e=!0){for(var t=0,n=Me;;){if(n.nodeType===or){var r=n.data;if(r===si){if(t===0)return n;t-=1}else(r===ya||r===po)&&(t+=1)}var o=Bt(n);e&&n.remove(),n=o}}function Ta(e){if(!e||e.nodeType!==or)throw yo(),nr;return e.data}function Ia(e){return e===this.v}function Ca(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function za(e){return!Ca(e,this.v)}let Ge=null;function ir(e){Ge=e}function Xe(e,t=!1,n){Ge={p:Ge,c:null,e:null,s:e,x:null,l:tr&&!t?{s:null,u:null,$:[]}:null}}function et(e){var t=Ge,n=t.e;if(n!==null){t.e=null;for(var r of n)Ka(r)}return e!==void 0&&(t.x=e),Ge=t.p,e??{}}function Lr(){return!tr||Ge!==null&&Ge.l===null}let An=[];function Ma(){var e=An;An=[],ci(e)}function rn(e){if(An.length===0&&!Nr){var t=An;queueMicrotask(()=>{t===An&&Ma()})}An.push(e)}function rg(){for(;An.length>0;)Ma()}const og=new WeakMap;function La(e){var t=Ie;if(t===null)return Ee.f|=Nn,e;if((t.f&fi)===0){if((t.f&di)===0)throw!t.parent&&e instanceof Error&&Na(e),e;t.b.error(e)}else sr(e,t)}function sr(e,t){for(;t!==null;){if((t.f&di)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e instanceof Error&&Na(e),e}function Na(e){const t=og.get(e);t&&(Cn(e,"message",{value:t.message}),Cn(e,"stack",{value:t.stack}))}const ko=new Set;let Je=null,_o=null,gi=new Set,Yt=[],xo=null,vi=!1,Nr=!1;class qt{current=new Map;#t=new Map;#e=new Set;#u=0;#i=null;#l=[];#o=[];#r=[];#n=[];#s=[];#c=[];skipped_effects=new Set;process(t){Yt=[],_o=null;for(const o of t)this.#d(o);if(this.#u===0){this.#f();var n=this.#o,r=this.#r;this.#o=[],this.#r=[],this.#n=[],_o=this,Je=null,Aa(n),Aa(r),_o=null,this.#i?.resolve()}else this.#a(this.#o),this.#a(this.#r),this.#a(this.#n);for(const o of this.#l)ur(o);this.#l=[]}#d(t){t.f^=at;for(var n=t.first;n!==null;){var r=n.f,o=(r&(tn|bn))!==0,s=o&&(r&at)!==0,a=s||(r&Dt)!==0||this.skipped_effects.has(n);if(!a&&n.fn!==null){o?n.f^=at:(r&ui)!==0?this.#r.push(n):(r&at)===0&&((r&bo)!==0&&n.b?.is_pending()?this.#l.push(n):jr(n)&&((n.f&zn)!==0&&this.#n.push(n),ur(n)));var l=n.first;if(l!==null){n=l;continue}}var c=n.parent;for(n=n.next;n===null&&c!==null;)n=c.next,c=c.parent}}#a(t){for(const n of t)((n.f&It)!==0?this.#s:this.#c).push(n),dt(n,at);t.length=0}capture(t,n){this.#t.has(t)||this.#t.set(t,n),this.current.set(t,t.v)}activate(){Je=this}deactivate(){Je=null}flush(){if(Yt.length>0){if(this.activate(),Ea(),Je!==null&&Je!==this)return}else this.#u===0&&this.#f();this.deactivate();for(const t of gi)if(gi.delete(t),t(),Je!==null)break}#f(){for(const t of this.#e)t();if(this.#e.clear(),ko.size>1){this.#t.clear();let t=!0;for(const n of ko){if(n===this){t=!1;continue}for(const[r,o]of this.current){if(n.current.has(r))if(t)n.current.set(r,o);else continue;Pa(r)}if(Yt.length>0){Je=n;for(const r of Yt)n.#d(r);Yt=[]}}Je=null}ko.delete(this)}increment(){this.#u+=1}decrement(){this.#u-=1;for(const t of this.#s)dt(t,It),jn(t);for(const t of this.#c)dt(t,nn),jn(t);this.flush()}add_callback(t){this.#e.add(t)}settled(){return(this.#i??=_a()).promise}static ensure(){if(Je===null){const t=Je=new qt;ko.add(Je),Nr||qt.enqueue(()=>{Je===t&&t.flush()})}return Je}static enqueue(t){rn(t)}static apply(t){return Vt}}function je(e){var t=Nr;Nr=!0;try{for(var n;;){if(rg(),Yt.length===0&&(Je?.flush(),Yt.length===0))return xo=null,n;Ea()}}finally{Nr=t}}function Ea(){var e=cr;vi=!0;try{var t=0;for(ol(!0);Yt.length>0;){var n=qt.ensure();if(t++>1e3){var r,o;ig()}n.process(Yt),yn.clear()}}finally{vi=!1,ol(e),xo=null}}function ig(){try{Gm()}catch(e){sr(e,xo)}}let Pn=null;function Aa(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if((r.f&(Mn|Dt))===0&&jr(r)&&(Pn=[],ur(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null&&r.ac===null?tl(r):r.fn=null),Pn?.length>0)){yn.clear();for(const o of Pn)ur(o);Pn=[]}}Pn=null}}function Pa(e){if(e.reactions!==null)for(const t of e.reactions){const n=t.f;(n&xt)!==0?Pa(t):(n&(bo|zn))!==0&&(dt(t,It),jn(t))}}function jn(e){for(var t=xo=e;t.parent!==null;){t=t.parent;var n=t.f;if(vi&&t===Ie&&(n&zn)!==0)return;if((n&(bn|tn))!==0){if((n&at)===0)return;t.f^=at}}Yt.push(t)}function sg(e){let t=0,n=wn(0),r;return()=>{wg()&&(i(n),On(()=>(t===0&&(r=z(()=>e(()=>Ar(n)))),t+=1,()=>{rn(()=>{t-=1,t===0&&(r?.(),r=void 0,Ar(n))})})))}}var ag=rr|Ln|di;function lg(e,t,n){new cg(e,t,n)}class cg{parent;#t=!1;#e;#u=$e?Me:null;#i;#l;#o;#r=null;#n=null;#s=null;#c=null;#d=0;#a=0;#f=!1;#p=null;#v=()=>{this.#p&&ar(this.#p,this.#d)};#b=sg(()=>(this.#p=wn(this.#d),()=>{this.#p=null}));constructor(t,n,r){this.#e=t,this.#i=n,this.#l=r,this.parent=Ie.b,this.#t=!!this.#i.pending,this.#o=Dn(()=>{if(Ie.b=this,$e){const o=this.#u;En(),o.nodeType===or&&o.data===po?this.#w():this.#y()}else{try{this.#r=ut(()=>r(this.#e))}catch(o){this.error(o)}this.#a>0?this.#m():this.#t=!1}},ag),$e&&(this.#e=Me)}#y(){try{this.#r=ut(()=>this.#l(this.#e))}catch(t){this.error(t)}this.#t=!1}#w(){const t=this.#i.pending;t&&(this.#n=ut(()=>t(this.#e)),qt.enqueue(()=>{this.#r=this.#h(()=>(qt.ensure(),ut(()=>this.#l(this.#e)))),this.#a>0?this.#m():(qn(this.#n,()=>{this.#n=null}),this.#t=!1)}))}is_pending(){return this.#t||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!this.#i.pending}#h(t){var n=Ie,r=Ee,o=Ge;At(this.#o),St(this.#o),ir(this.#o.ctx);try{return t()}catch(s){return La(s),null}finally{At(n),St(r),ir(o)}}#m(){const t=this.#i.pending;this.#r!==null&&(this.#c=document.createDocumentFragment(),ug(this.#r,this.#c)),this.#n===null&&(this.#n=ut(()=>t(this.#e)))}#g(t){if(!this.has_pending_snippet()){this.parent&&this.parent.#g(t);return}this.#a+=t,this.#a===0&&(this.#t=!1,this.#n&&qn(this.#n,()=>{this.#n=null}),this.#c&&(this.#e.before(this.#c),this.#c=null),rn(()=>{qt.ensure().flush()}))}update_pending_count(t){this.#g(t),this.#d+=t,gi.add(this.#v)}get_effect_pending(){return this.#b(),i(this.#p)}error(t){var n=this.#i.onerror;let r=this.#i.failed;if(this.#f||!n&&!r)throw t;this.#r&&(it(this.#r),this.#r=null),this.#n&&(it(this.#n),this.#n=null),this.#s&&(it(this.#s),this.#s=null),$e&&(lt(this.#u),ng(),lt(wo()));var o=!1,s=!1;const a=()=>{if(o){tg();return}o=!0,s&&Xm(),qt.ensure(),this.#d=0,this.#s!==null&&qn(this.#s,()=>{this.#s=null}),this.#t=this.has_pending_snippet(),this.#r=this.#h(()=>(this.#f=!1,ut(()=>this.#l(this.#e)))),this.#a>0?this.#m():this.#t=!1};var l=Ee;try{St(null),s=!0,n?.(t,a),s=!1}catch(c){sr(c,this.#o&&this.#o.parent)}finally{St(l)}r&&rn(()=>{this.#s=this.#h(()=>{this.#f=!0;try{return ut(()=>{r(this.#e,()=>t,()=>a)})}catch(c){return sr(c,this.#o.parent),null}finally{this.#f=!1}})})}}function ug(e,t){for(var n=e.nodes_start,r=e.nodes_end;n!==null;){var o=n===r?null:Bt(n);t.append(n),n=o}}function ja(e,t,n){const r=Lr()?Er:Ue;if(t.length===0){n(e.map(r));return}var o=Je,s=Ie,a=dg(),l=$e;Promise.all(t.map(c=>fg(c))).then(c=>{a();try{n([...e.map(r),...c])}catch(u){(s.f&Mn)===0&&sr(u,s)}l&&pt(!1),o?.deactivate(),Oa()}).catch(c=>{sr(c,s)})}function dg(){var e=Ie,t=Ee,n=Ge,r=Je,o=$e;if(o)var s=Me;return function(){At(e),St(t),ir(n),r?.activate(),o&&(pt(!0),lt(s))}}function Oa(){At(null),St(null),ir(null)}function Er(e){var t=xt|It,n=Ee!==null&&(Ee.f&xt)!==0?Ee:null;return Ie===null||n!==null&&(n.f&Et)!==0?t|=Et:Ie.f|=Ln,{ctx:Ge,deps:null,effects:null,equals:Ia,f:t,fn:e,reactions:null,rv:0,v:ot,wv:0,parent:n??Ie,ac:null}}function fg(e,t){let n=Ie;n===null&&Fm();var r=n.b,o=void 0,s=wn(ot),a=!Ee,l=new Map;return $g(()=>{var c=_a();o=c.promise;try{Promise.resolve(e()).then(c.resolve,c.reject)}catch(f){c.reject(f)}var u=Je,d=r.is_pending();a&&(r.update_pending_count(1),d||(u.increment(),l.get(u)?.reject(Mr),l.set(u,c)));const m=(f,y=void 0)=>{d||u.activate(),y?y!==Mr&&(s.f|=Nn,ar(s,y)):((s.f&Nn)!==0&&(s.f^=Nn),ar(s,f)),a&&(r.update_pending_count(-1),d||u.decrement()),Oa()};c.promise.then(m,f=>m(null,f||"unknown"))}),So(()=>{for(const c of l.values())c.reject(Mr)}),new Promise(c=>{function u(d){function m(){d===o?c(s):u(o)}d.then(m,m)}u(o)})}function pg(e){const t=Er(e);return sl(t),t}function Ue(e){const t=Er(e);return t.equals=za,t}function Da(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)it(t[n])}}function hg(e){for(var t=e.parent;t!==null;){if((t.f&xt)===0)return t;t=t.parent}return null}function bi(e){var t,n=Ie;At(hg(e));try{Da(e),t=dl(e)}finally{At(n)}return t}function qa(e){var t=bi(e);if(e.equals(t)||(e.v=t,e.wv=cl()),!Zn){var n=(_n||(e.f&Et)!==0)&&e.deps!==null?nn:at;dt(e,n)}}const yn=new Map;function wn(e,t){var n={f:0,v:e,reactions:null,equals:Ia,rv:0,wv:0};return n}function kn(e,t){const n=wn(e);return sl(n),n}function Q(e,t=!1,n=!0){const r=wn(e);return t||(r.equals=za),tr&&n&&Ge!==null&&Ge.l!==null&&(Ge.l.s??=[]).push(r),r}function Za(e,t){return h(e,z(()=>i(e))),t}function h(e,t,n=!1){Ee!==null&&(!Rt||(Ee.f&xa)!==0)&&Lr()&&(Ee.f&(xt|zn|bo|xa))!==0&&!sn?.includes(e)&&Km();let r=n?lr(t):t;return ar(e,r)}function ar(e,t){if(!e.equals(t)){var n=e.v;Zn?yn.set(e,t):yn.set(e,n),e.v=t;var r=qt.ensure();r.capture(e,n),(e.f&xt)!==0&&((e.f&It)!==0&&bi(e),dt(e,(e.f&Et)===0?at:nn)),e.wv=cl(),Ra(e,It),Lr()&&Ie!==null&&(Ie.f&at)!==0&&(Ie.f&(tn|bn))===0&&(Pt===null?Ig([e]):Pt.push(e))}return t}function Ua(e,t=1){var n=i(e),r=t===1?n++:n--;return h(e,n),r}function Ar(e){h(e,e.v+1)}function Ra(e,t){var n=e.reactions;if(n!==null)for(var r=Lr(),o=n.length,s=0;s<o;s++){var a=n[s],l=a.f;if(!(!r&&a===Ie)){var c=(l&It)===0;c&&dt(a,t),(l&xt)!==0?Ra(a,nn):c&&((l&zn)!==0&&Pn!==null&&Pn.push(a),jn(a))}}}function lr(e){if(typeof e!="object"||e===null||Gt in e)return e;const t=li(e);if(t!==jm&&t!==Om)return e;var n=new Map,r=ho(e),o=kn(0),s=Un,a=l=>{if(Un===s)return l();var c=Ee,u=Un;St(null),ll(s);var d=l();return St(c),ll(u),d};return r&&n.set("length",kn(e.length)),new Proxy(e,{defineProperty(l,c,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Hm();var d=n.get(c);return d===void 0?d=a(()=>{var m=kn(u.value);return n.set(c,m),m}):h(d,u.value,!0),!0},deleteProperty(l,c){var u=n.get(c);if(u===void 0){if(c in l){const d=a(()=>kn(ot));n.set(c,d),Ar(o)}}else h(u,ot),Ar(o);return!0},get(l,c,u){if(c===Gt)return e;var d=n.get(c),m=c in l;if(d===void 0&&(!m||en(l,c)?.writable)&&(d=a(()=>{var y=lr(m?l[c]:ot),k=kn(y);return k}),n.set(c,d)),d!==void 0){var f=i(d);return f===ot?void 0:f}return Reflect.get(l,c,u)},getOwnPropertyDescriptor(l,c){var u=Reflect.getOwnPropertyDescriptor(l,c);if(u&&"value"in u){var d=n.get(c);d&&(u.value=i(d))}else if(u===void 0){var m=n.get(c),f=m?.v;if(m!==void 0&&f!==ot)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return u},has(l,c){if(c===Gt)return!0;var u=n.get(c),d=u!==void 0&&u.v!==ot||Reflect.has(l,c);if(u!==void 0||Ie!==null&&(!d||en(l,c)?.writable)){u===void 0&&(u=a(()=>{var f=d?lr(l[c]):ot,y=kn(f);return y}),n.set(c,u));var m=i(u);if(m===ot)return!1}return d},set(l,c,u,d){var m=n.get(c),f=c in l;if(r&&c==="length")for(var y=u;y<m.v;y+=1){var k=n.get(y+"");k!==void 0?h(k,ot):y in l&&(k=a(()=>kn(ot)),n.set(y+"",k))}if(m===void 0)(!f||en(l,c)?.writable)&&(m=a(()=>kn(void 0)),h(m,lr(u)),n.set(c,m));else{f=m.v!==ot;var L=a(()=>lr(u));h(m,L)}var $=Reflect.getOwnPropertyDescriptor(l,c);if($?.set&&$.set.call(d,u),!f){if(r&&typeof c=="string"){var U=n.get("length"),G=Number(c);Number.isInteger(G)&&G>=U.v&&h(U,G+1)}Ar(o)}return!0},ownKeys(l){i(o);var c=Reflect.ownKeys(l).filter(m=>{var f=n.get(m);return f===void 0||f.v!==ot});for(var[u,d]of n)d.v!==ot&&!(u in l)&&c.push(u);return c},setPrototypeOf(){Jm()}})}function Fa(e){try{if(e!==null&&typeof e=="object"&&Gt in e)return e[Gt]}catch{}return e}function mg(e,t){return Object.is(Fa(e),Fa(t))}var Wa,Qa,Va,Ga;function yi(){if(Wa===void 0){Wa=window,Qa=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Va=en(t,"firstChild").get,Ga=en(t,"nextSibling").get,ka(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),ka(n)&&(n.__t=void 0)}}function on(e=""){return document.createTextNode(e)}function Zt(e){return Va.call(e)}function Bt(e){return Ga.call(e)}function I(e,t){if(!$e)return Zt(e);var n=Zt(Me);if(n===null)n=Me.appendChild(on());else if(t&&n.nodeType!==mi){var r=on();return n?.before(r),lt(r),r}return lt(n),n}function Ne(e,t=!1){if(!$e){var n=Zt(e);return n instanceof Comment&&n.data===""?Bt(n):n}if(t&&Me?.nodeType!==mi){var r=on();return Me?.before(r),lt(r),r}return Me}function oe(e,t=1,n=!1){let r=$e?Me:e;for(var o;t--;)o=r,r=Bt(r);if(!$e)return r;if(n&&r?.nodeType!==mi){var s=on();return r===null?o?.after(s):r.before(s),lt(s),s}return lt(r),r}function wi(e){e.textContent=""}function gg(){return!1}function vg(e,t){if(t){const n=document.body;e.autofocus=!0,rn(()=>{document.activeElement===n&&e.focus()})}}function bg(e){$e&&Zt(e)!==null&&wi(e)}let Ya=!1;function Ba(){Ya||(Ya=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function $o(e){var t=Ee,n=Ie;St(null),At(null);try{return e()}finally{St(t),At(n)}}function Ha(e,t,n,r=n){e.addEventListener(t,()=>$o(n));const o=e.__on_r;o?e.__on_r=()=>{o(),r(!0)}:e.__on_r=()=>r(!0),Ba()}function Ja(e){Ie===null&&Ee===null&&Vm(),Ee!==null&&(Ee.f&Et)!==0&&Ie===null&&Qm(),Zn&&Wm()}function yg(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Ut(e,t,n,r=!0){var o=Ie;o!==null&&(o.f&Dt)!==0&&(e|=Dt);var s={ctx:Ge,deps:null,nodes_start:null,nodes_end:null,f:e|It,first:null,fn:t,last:null,next:null,parent:o,b:o&&o.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{ur(s),s.f|=fi}catch(c){throw it(s),c}else t!==null&&jn(s);if(r){var a=s;if(n&&a.deps===null&&a.teardown===null&&a.nodes_start===null&&a.first===a.last&&(a.f&Ln)===0&&(a=a.first),a!==null&&(a.parent=o,o!==null&&yg(a,o),Ee!==null&&(Ee.f&xt)!==0&&(e&bn)===0)){var l=Ee;(l.effects??=[]).push(a)}}return s}function wg(){return Ee!==null&&!Rt}function So(e){const t=Ut(go,null,!1);return dt(t,at),t.teardown=e,t}function ki(e){Ja();var t=Ie.f,n=!Ee&&(t&tn)!==0&&(t&fi)===0;if(n){var r=Ge;(r.e??=[]).push(e)}else return Ka(e)}function Ka(e){return Ut(ui|$a,e,!1)}function kg(e){return Ja(),Ut(go|$a,e,!0)}function _g(e){qt.ensure();const t=Ut(bn|Ln,e,!0);return()=>{it(t)}}function xg(e){qt.ensure();const t=Ut(bn|Ln,e,!0);return(n={})=>new Promise(r=>{n.outro?qn(t,()=>{it(t),r(void 0)}):(it(t),r(void 0))})}function _i(e){return Ut(ui,e,!1)}function ee(e,t){var n=Ge,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=On(()=>{e(),!r.ran&&(r.ran=!0,z(t))})}function $t(){var e=Ge;On(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&at)!==0&&dt(n,nn),jr(n)&&ur(n),t.ran=!1}})}function $g(e){return Ut(bo|Ln,e,!0)}function On(e,t=0){return Ut(go|t,e,!0)}function ae(e,t=[],n=[]){ja(t,n,r=>{Ut(go,()=>e(...r.map(i)),!0)})}function Dn(e,t=0){var n=Ut(zn|t,e,!0);return n}function ut(e,t=!0){return Ut(tn|Ln,e,!0,t)}function Xa(e){var t=e.teardown;if(t!==null){const n=Zn,r=Ee;il(!0),St(null);try{t.call(null)}finally{il(n),St(r)}}}function el(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const o=n.ac;o!==null&&$o(()=>{o.abort(Mr)});var r=n.next;(n.f&bn)!==0?n.parent=null:it(n,t),n=r}}function Sg(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&tn)===0&&it(t),t=n}}function it(e,t=!0){var n=!1;(t||(e.f&Zm)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(Tg(e.nodes_start,e.nodes_end),n=!0),el(e,t&&!n),Io(e,0),dt(e,Mn);var r=e.transitions;if(r!==null)for(const s of r)s.stop();Xa(e);var o=e.parent;o!==null&&o.first!==null&&tl(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function Tg(e,t){for(;e!==null;){var n=e===t?null:Bt(e);e.remove(),e=n}}function tl(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function qn(e,t){var n=[];xi(e,n,!0),nl(n,()=>{it(e),t&&t()})}function nl(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var o of e)o.out(r)}else t()}function xi(e,t,n){if((e.f&Dt)===0){if(e.f^=Dt,e.transitions!==null)for(const a of e.transitions)(a.is_global||n)&&t.push(a);for(var r=e.first;r!==null;){var o=r.next,s=(r.f&rr)!==0||(r.f&tn)!==0;xi(r,t,s?n:!1),r=o}}}function To(e){rl(e,!0)}function rl(e,t){if((e.f&Dt)!==0){e.f^=Dt,(e.f&at)===0&&(dt(e,It),jn(e));for(var n=e.first;n!==null;){var r=n.next,o=(n.f&rr)!==0||(n.f&tn)!==0;rl(n,o?t:!1),n=r}if(e.transitions!==null)for(const s of e.transitions)(s.is_global||t)&&s.in()}}let cr=!1;function ol(e){cr=e}let Zn=!1;function il(e){Zn=e}let Ee=null,Rt=!1;function St(e){Ee=e}let Ie=null;function At(e){Ie=e}let sn=null;function sl(e){Ee!==null&&(sn===null?sn=[e]:sn.push(e))}let ht=null,Ct=0,Pt=null;function Ig(e){Pt=e}let al=1,Pr=0,Un=Pr;function ll(e){Un=e}let _n=!1;function cl(){return++al}function jr(e){var t=e.f;if((t&It)!==0)return!0;if((t&nn)!==0){var n=e.deps,r=(t&Et)!==0;if(n!==null){var o,s,a=(t&vo)!==0,l=r&&Ie!==null&&!_n,c=n.length;if((a||l)&&(Ie===null||(Ie.f&Mn)===0)){var u=e,d=u.parent;for(o=0;o<c;o++)s=n[o],(a||!s?.reactions?.includes(u))&&(s.reactions??=[]).push(u);a&&(u.f^=vo),l&&d!==null&&(d.f&Et)===0&&(u.f^=Et)}for(o=0;o<c;o++)if(s=n[o],jr(s)&&qa(s),s.wv>e.wv)return!0}(!r||Ie!==null&&!_n)&&dt(e,at)}return!1}function ul(e,t,n=!0){var r=e.reactions;if(r!==null&&!sn?.includes(e))for(var o=0;o<r.length;o++){var s=r[o];(s.f&xt)!==0?ul(s,t,!1):t===s&&(n?dt(s,It):(s.f&at)!==0&&dt(s,nn),jn(s))}}function dl(e){var t=ht,n=Ct,r=Pt,o=Ee,s=_n,a=sn,l=Ge,c=Rt,u=Un,d=e.f;ht=null,Ct=0,Pt=null,_n=(d&Et)!==0&&(Rt||!cr||Ee===null),Ee=(d&(tn|bn))===0?e:null,sn=null,ir(e.ctx),Rt=!1,Un=++Pr,e.ac!==null&&($o(()=>{e.ac.abort(Mr)}),e.ac=null);try{e.f|=pi;var m=e.fn,f=m(),y=e.deps;if(ht!==null){var k;if(Io(e,Ct),y!==null&&Ct>0)for(y.length=Ct+ht.length,k=0;k<ht.length;k++)y[Ct+k]=ht[k];else e.deps=y=ht;if(!_n||(d&xt)!==0&&e.reactions!==null)for(k=Ct;k<y.length;k++)(y[k].reactions??=[]).push(e)}else y!==null&&Ct<y.length&&(Io(e,Ct),y.length=Ct);if(Lr()&&Pt!==null&&!Rt&&y!==null&&(e.f&(xt|nn|It))===0)for(k=0;k<Pt.length;k++)ul(Pt[k],e);return o!==null&&o!==e&&(Pr++,Pt!==null&&(r===null?r=Pt:r.push(...Pt))),(e.f&Nn)!==0&&(e.f^=Nn),f}catch(L){return La(L)}finally{e.f^=pi,ht=t,Ct=n,Pt=r,Ee=o,_n=s,sn=a,ir(l),Rt=c,Un=u}}function Cg(e,t){let n=t.reactions;if(n!==null){var r=Pm.call(n,e);if(r!==-1){var o=n.length-1;o===0?n=t.reactions=null:(n[r]=n[o],n.pop())}}n===null&&(t.f&xt)!==0&&(ht===null||!ht.includes(t))&&(dt(t,nn),(t.f&(Et|vo))===0&&(t.f^=vo),Da(t),Io(t,0))}function Io(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Cg(e,n[r])}function ur(e){var t=e.f;if((t&Mn)===0){dt(e,at);var n=Ie,r=cr;Ie=e,cr=!0;try{(t&zn)!==0?Sg(e):el(e),Xa(e);var o=dl(e);e.teardown=typeof o=="function"?o:null,e.wv=al;var s;Am&&km&&(e.f&It)!==0&&e.deps}finally{cr=r,Ie=n}}}async function zg(){await Promise.resolve(),je()}function i(e){var t=e.f,n=(t&xt)!==0;if(Ee!==null&&!Rt){var r=Ie!==null&&(Ie.f&Mn)!==0;if(!r&&!sn?.includes(e)){var o=Ee.deps;if((Ee.f&pi)!==0)e.rv<Pr&&(e.rv=Pr,ht===null&&o!==null&&o[Ct]===e?Ct++:ht===null?ht=[e]:(!_n||!ht.includes(e))&&ht.push(e));else{(Ee.deps??=[]).push(e);var s=e.reactions;s===null?e.reactions=[Ee]:s.includes(Ee)||s.push(Ee)}}}else if(n&&e.deps===null&&e.effects===null){var a=e,l=a.parent;l!==null&&(l.f&Et)===0&&(a.f^=Et)}if(Zn){if(yn.has(e))return yn.get(e);if(n){a=e;var c=a.v;return((a.f&at)===0&&a.reactions!==null||fl(a))&&(c=bi(a)),yn.set(a,c),c}}else n&&(a=e,jr(a)&&qa(a));if((e.f&Nn)!==0)throw e.v;return e.v}function fl(e){if(e.v===ot)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(yn.has(t)||(t.f&xt)!==0&&fl(t))return!0;return!1}function z(e){var t=Rt;try{return Rt=!0,e()}finally{Rt=t}}const Mg=-7169;function dt(e,t){e.f=e.f&Mg|t}function b(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Gt in e)$i(e);else if(!Array.isArray(e))for(let t in e){const n=e[t];typeof n=="object"&&n&&Gt in n&&$i(n)}}}function $i(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let r in e)try{$i(e[r],t)}catch{}const n=li(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=wa(n);for(let o in r){const s=r[o].get;if(s)try{s.call(e)}catch{}}}}}const pl=new Set,Si=new Set;function hl(e,t,n,r={}){function o(s){if(r.capture||Or.call(t,s),!s.cancelBubble)return $o(()=>n?.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?rn(()=>{t.addEventListener(e,o,r)}):t.addEventListener(e,o,r),o}function Ti(e,t,n,r,o){var s={capture:r,passive:o},a=hl(e,t,n,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&So(()=>{t.removeEventListener(e,a,s)})}function an(e){for(var t=0;t<e.length;t++)pl.add(e[t]);for(var n of Si)n(e)}let ml=null;function Or(e){var t=this,n=t.ownerDocument,r=e.type,o=e.composedPath?.()||[],s=o[0]||e.target;ml=e;var a=0,l=ml===e&&e.__root;if(l){var c=o.indexOf(l);if(c!==-1&&(t===document||t===window)){e.__root=t;return}var u=o.indexOf(t);if(u===-1)return;c<=u&&(a=c)}if(s=o[a]||e.target,s!==t){Cn(e,"currentTarget",{configurable:!0,get(){return s||n}});var d=Ee,m=Ie;St(null),At(null);try{for(var f,y=[];s!==null;){var k=s.assignedSlot||s.parentNode||s.host||null;try{var L=s["__"+r];if(L!=null&&(!s.disabled||e.target===s))if(ho(L)){var[$,...U]=L;$.apply(s,[e,...U])}else L.call(s,e)}catch(G){f?y.push(G):f=G}if(e.cancelBubble||k===t||k===null)break;s=k}if(f){for(let G of y)queueMicrotask(()=>{throw G});throw f}}finally{e.__root=t,delete e.currentTarget,St(d),At(m)}}}function gl(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("<!>","<!---->"),t.content}function ln(e,t){var n=Ie;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function V(e,t){var n=(t&zm)!==0,r=(t&Mm)!==0,o,s=!e.startsWith("<!>");return()=>{if($e)return ln(Me,null),Me;o===void 0&&(o=gl(s?e:"<!>"+e),n||(o=Zt(o)));var a=r||Qa?document.importNode(o,!0):o.cloneNode(!0);if(n){var l=Zt(a),c=a.lastChild;ln(l,c)}else ln(a,a);return a}}function Lg(e,t,n="svg"){var r=!e.startsWith("<!>"),o=`<${n}>${r?e:"<!>"+e}</${n}>`,s;return()=>{if($e)return ln(Me,null),Me;if(!s){var a=gl(o),l=Zt(a);s=Zt(l)}var c=s.cloneNode(!0);return ln(c,c),c}}function Ng(e,t){return Lg(e,t,"svg")}function De(){if($e)return ln(Me,null),Me;var e=document.createDocumentFragment(),t=document.createComment(""),n=on();return e.append(t,n),ln(t,n),e}function N(e,t){if($e){Ie.nodes_end=Me,En();return}e!==null&&e.before(t)}function Eg(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Ag=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Pg(e){return Ag.includes(e)}const jg={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 Og(e){return e=e.toLowerCase(),jg[e]??e}const Dg=["touchstart","touchmove"];function qg(e){return Dg.includes(e)}const Zg=["textarea","script","style","title"];function Ug(e){return Zg.includes(e)}function de(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function vl(e,t){return bl(e,t)}function Rg(e,t){yi(),t.intro=t.intro??!1;const n=t.target,r=$e,o=Me;try{for(var s=Zt(n);s&&(s.nodeType!==or||s.data!==ya);)s=Bt(s);if(!s)throw nr;pt(!0),lt(s);const a=bl(e,{...t,anchor:s});return pt(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
42
+ `).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==nr&&console.warn("Failed to hydrate: ",a),t.recover===!1&&Ym(),yi(),wi(n),pt(!1),vl(e,t)}finally{pt(r),lt(o)}}const dr=new Map;function bl(e,{target:t,anchor:n,props:r={},events:o,context:s,intro:a=!0}){yi();var l=new Set,c=m=>{for(var f=0;f<m.length;f++){var y=m[f];if(!l.has(y)){l.add(y);var k=qg(y);t.addEventListener(y,Or,{passive:k});var L=dr.get(y);L===void 0?(document.addEventListener(y,Or,{passive:k}),dr.set(y,1)):dr.set(y,L+1)}}};c(ai(pl)),Si.add(c);var u=void 0,d=xg(()=>{var m=n??t.appendChild(on());return lg(m,{pending:()=>{}},f=>{if(s){Xe({});var y=Ge;y.c=s}if(o&&(r.$$events=o),$e&&ln(f,null),u=e(f,r)||{},$e&&(Ie.nodes_end=Me,Me===null||Me.nodeType!==or||Me.data!==si))throw yo(),nr;s&&et()}),()=>{for(var f of l){t.removeEventListener(f,Or);var y=dr.get(f);--y===0?(document.removeEventListener(f,Or),dr.delete(f)):dr.set(f,y)}Si.delete(c),m!==n&&m.parentNode?.removeChild(m)}});return Ii.set(u,d),u}let Ii=new WeakMap;function Fg(e,t){const n=Ii.get(e);return n?(Ii.delete(e),n(t)):Promise.resolve()}function yl(e,t,...n){var r=e,o=Vt,s;Dn(()=>{o!==(o=t())&&(s&&(it(s),s=null),s=ut(()=>o(r,...n)))},rr),$e&&(r=Me)}function Rn(e){Ge===null&&Sa(),tr&&Ge.l!==null?Wg(Ge).m.push(e):ki(()=>{const t=z(e);if(typeof t=="function")return t})}function Co(e){Ge===null&&Sa(),Rn(()=>()=>z(e))}function Wg(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function K(e,t,n=!1){$e&&En();var r=e,o=null,s=null,a=ot,l=n?rr:0,c=!1;const u=(f,y=!0)=>{c=!0,m(y,f)};function d(){var f=a?o:s,y=a?s:o;f&&To(f),y&&qn(y,()=>{a?s=null:o=null})}const m=(f,y)=>{if(a===(a=f))return;let k=!1;if($e){const U=Ta(r)===po;!!a===U&&(r=wo(),lt(r),pt(!1),k=!0)}var L=gg(),$=r;a?o??=y&&ut(()=>y($)):s??=y&&ut(()=>y($)),L||d(),k&&pt(!0)};Dn(()=>{c=!1,t(u),c||m(null,null)},l),$e&&(r=Me)}function jt(e,t){return t}function Qg(e,t,n){for(var r=e.items,o=[],s=t.length,a=0;a<s;a++)xi(t[a].e,o,!0);var l=s>0&&o.length===0&&n!==null;if(l){var c=n.parentNode;wi(c),c.append(n),r.clear(),Ht(e,t[0].prev,t[s-1].next)}nl(o,()=>{for(var u=0;u<s;u++){var d=t[u];l||(r.delete(d.k),Ht(e,d.prev,d.next)),it(d.e,!l)}})}function zt(e,t,n,r,o,s=null){var a=e,l={flags:t,items:new Map,first:null},c=(t&va)!==0;if(c){var u=e;a=$e?lt(Zt(u)):u.appendChild(on())}$e&&En();var d=null,m=!1,f=new Map,y=Ue(()=>{var U=n();return ho(U)?U:U==null?[]:ai(U)}),k,L;function $(){Vg(L,k,l,f,a,o,t,r,n),s!==null&&(k.length===0?d?To(d):d=ut(()=>s(a)):d!==null&&qn(d,()=>{d=null}))}Dn(()=>{L??=Ie,k=i(y);var U=k.length;if(m&&U===0)return;m=U===0;let G=!1;if($e){var T=Ta(a)===po;T!==(U===0)&&(a=wo(),lt(a),pt(!1),G=!0)}if($e){for(var x=null,F,Z=0;Z<U;Z++){if(Me.nodeType===or&&Me.data===si){a=Me,G=!0,pt(!1);break}var B=k[Z],R=r(B,Z);F=wl(Me,l,x,null,B,R,Z,o,t,n),l.items.set(R,F),x=F}U>0&&lt(wo())}$e?U===0&&s&&(d=ut(()=>s(a))):$(),G&&pt(!0),i(y)}),$e&&(a=Me)}function Vg(e,t,n,r,o,s,a,l,c){var u=(a&xm)!==0,d=(a&(oi|ii))!==0,m=t.length,f=n.items,y=n.first,k=y,L,$=null,U,G=[],T=[],x,F,Z,B;if(u)for(B=0;B<m;B+=1)x=t[B],F=l(x,B),Z=f.get(F),Z!==void 0&&(Z.a?.measure(),(U??=new Set).add(Z));for(B=0;B<m;B+=1){if(x=t[B],F=l(x,B),Z=f.get(F),Z===void 0){var R=r.get(F);if(R!==void 0){r.delete(F),f.set(F,R);var ge=$?$.next:k;Ht(n,$,R),Ht(n,R,ge),Ci(R,ge,o),$=R}else{var he=k?k.e.nodes_start:o;$=wl(he,n,$,$===null?n.first:$.next,x,F,B,s,a,c)}f.set(F,$),G=[],T=[],k=$.next;continue}if(d&&Gg(Z,x,B,a),(Z.e.f&Dt)!==0&&(To(Z.e),u&&(Z.a?.unfix(),(U??=new Set).delete(Z))),Z!==k){if(L!==void 0&&L.has(Z)){if(G.length<T.length){var Te=T[0],ie;$=Te.prev;var le=G[0],Y=G[G.length-1];for(ie=0;ie<G.length;ie+=1)Ci(G[ie],Te,o);for(ie=0;ie<T.length;ie+=1)L.delete(T[ie]);Ht(n,le.prev,Y.next),Ht(n,$,le),Ht(n,Y,Te),k=Te,$=Y,B-=1,G=[],T=[]}else L.delete(Z),Ci(Z,k,o),Ht(n,Z.prev,Z.next),Ht(n,Z,$===null?n.first:$.next),Ht(n,$,Z),$=Z;continue}for(G=[],T=[];k!==null&&k.k!==F;)(k.e.f&Dt)===0&&(L??=new Set).add(k),T.push(k),k=k.next;if(k===null)continue;Z=k}G.push(Z),$=Z,k=Z.next}if(k!==null||L!==void 0){for(var E=L===void 0?[]:ai(L);k!==null;)(k.e.f&Dt)===0&&E.push(k),k=k.next;var A=E.length;if(A>0){var C=(a&va)!==0&&m===0?o:null;if(u){for(B=0;B<A;B+=1)E[B].a?.measure();for(B=0;B<A;B+=1)E[B].a?.fix()}Qg(n,E,C)}}u&&rn(()=>{if(U!==void 0)for(Z of U)Z.a?.apply()}),e.first=n.first&&n.first.e,e.last=$&&$.e;for(var p of r.values())it(p.e);r.clear()}function Gg(e,t,n,r){(r&oi)!==0&&ar(e.v,t),(r&ii)!==0?ar(e.i,n):e.i=n}function wl(e,t,n,r,o,s,a,l,c,u,d){var m=(c&oi)!==0,f=(c&$m)===0,y=m?f?Q(o,!1,!1):wn(o):o,k=(c&ii)===0?a:wn(a),L={i:k,v:y,k:s,a:null,e:null,prev:n,next:r};try{if(e===null){var $=document.createDocumentFragment();$.append(e=on())}return L.e=ut(()=>l(e,y,k,u),$e),L.e.prev=n&&n.e,L.e.next=r&&r.e,n===null?d||(t.first=L):(n.next=L,n.e.next=L.e),r!==null&&(r.prev=L,r.e.prev=L.e),L}finally{}}function Ci(e,t,n){for(var r=e.next?e.next.e.nodes_start:n,o=t?t.e.nodes_start:n,s=e.e.nodes_start;s!==null&&s!==r;){var a=Bt(s);o.before(s),s=a}}function Ht(e,t,n){t===null?e.first=n:(t.next=n,t.e.next=n&&n.e),n!==null&&(n.prev=t,n.e.prev=t&&t.e)}function cn(e,t,n,r,o){$e&&En();var s=t.$$slots?.[n],a=!1;s===!0&&(s=t.children,a=!0),s===void 0||s(e,a?()=>r:r)}function Yg(e,t,n,r,o,s){let a=$e;$e&&En();var l,c,u=null;$e&&Me.nodeType===Rm&&(u=Me,En());var d=$e?Me:e,m;Dn(()=>{const f=t()||null;var y=Nm;f!==l&&(m&&(f===null?qn(m,()=>{m=null,c=null}):f===c?To(m):it(m)),f&&f!==c&&(m=ut(()=>{if(u=$e?u:document.createElementNS(y,f),ln(u,u),r){$e&&Ug(f)&&u.append(document.createComment(""));var k=$e?Zt(u):u.appendChild(on());$e&&(k===null?pt(!1):lt(k)),r(u,k)}Ie.nodes_end=u,d.before(u)})),l=f,l&&(c=l))},rr),a&&(pt(!0),lt(d))}function Bg(e,t){var n=void 0,r;Dn(()=>{n!==(n=t())&&(r&&(it(r),r=null),n&&(r=ut(()=>{_i(()=>n(e))})))})}function kl(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=kl(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _l(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=kl(e))&&(r&&(r+=" "),r+=t);return r}function zi(e){return typeof e=="object"?_l(e):e??""}const xl=[...`
43
+ \r\f \v\uFEFF`];function Hg(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var o in n)if(n[o])r=r?r+" "+o:o;else if(r.length)for(var s=o.length,a=0;(a=r.indexOf(o,a))>=0;){var l=a+s;(a===0||xl.includes(r[a-1]))&&(l===r.length||xl.includes(r[l]))?r=(a===0?"":r.substring(0,a))+r.substring(l+1):a=l}}return r===""?null:r}function $l(e,t=!1){var n=t?" !important;":";",r="";for(var o in e){var s=e[o];s!=null&&s!==""&&(r+=" "+o+": "+s+n)}return r}function Mi(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function Jg(e,t){if(t){var n="",r,o;if(Array.isArray(t)?(r=t[0],o=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,l=!1,c=[];r&&c.push(...Object.keys(r).map(Mi)),o&&c.push(...Object.keys(o).map(Mi));var u=0,d=-1;const L=e.length;for(var m=0;m<L;m++){var f=e[m];if(l?f==="/"&&e[m-1]==="*"&&(l=!1):s?s===f&&(s=!1):f==="/"&&e[m+1]==="*"?l=!0:f==='"'||f==="'"?s=f:f==="("?a++:f===")"&&a--,!l&&s===!1&&a===0){if(f===":"&&d===-1)d=m;else if(f===";"||m===L-1){if(d!==-1){var y=Mi(e.substring(u,d).trim());if(!c.includes(y)){f!==";"&&m++;var k=e.substring(u,m).trim();n+=" "+k+";"}}u=m+1,d=-1}}}}return r&&(n+=$l(r)),o&&(n+=$l(o,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function te(e,t,n,r,o,s){var a=e.__className;if($e||a!==n||a===void 0){var l=Hg(n,r,s);(!$e||l!==e.getAttribute("class"))&&(l==null?e.removeAttribute("class"):t?e.className=l:e.setAttribute("class",l)),e.__className=n}else if(s&&o!==s)for(var c in s){var u=!!s[c];(o==null||u!==!!o[c])&&e.classList.toggle(c,u)}return s}function Li(e,t={},n,r){for(var o in n){var s=n[o];t[o]!==s&&(n[o]==null?e.style.removeProperty(o):e.style.setProperty(o,s,r))}}function fr(e,t,n,r){var o=e.__style;if($e||o!==t){var s=Jg(t,r);(!$e||s!==e.getAttribute("style"))&&(s==null?e.removeAttribute("style"):e.style.cssText=s),e.__style=t}else r&&(Array.isArray(r)?(Li(e,n?.[0],r[0]),Li(e,n?.[1],r[1],"important")):Li(e,n,r));return r}function Ni(e,t,n=!1){if(e.multiple){if(t==null)return;if(!ho(t))return eg();for(var r of e.options)r.selected=t.includes(Sl(r));return}for(r of e.options){var o=Sl(r);if(mg(o,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Kg(e){var t=new MutationObserver(()=>{Ni(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),So(()=>{t.disconnect()})}function Sl(e){return"__value"in e?e.__value:e.value}const Dr=Symbol("class"),qr=Symbol("style"),Tl=Symbol("is custom element"),Il=Symbol("is html");function Ei(e){if($e){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;Fn(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var o=e.checked;Fn(e,"checked",null),e.checked=o}}};e.__on_r=n,rn(n),Ba()}}function Cl(e,t){var n=zo(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!=="PROGRESS")||(e.value=t??"")}function zl(e,t){var n=zo(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Xg(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Fn(e,t,n,r){var o=zo(e);$e&&(o[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName==="LINK")||o[t]!==(o[t]=n)&&(t==="loading"&&(e[Um]=n),n==null?e.removeAttribute(t):typeof n!="string"&&Ll(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ev(e,t,n,r,o=!1,s=!1){if($e&&o&&e.tagName==="INPUT"){var a=e,l=a.type==="checkbox"?"defaultChecked":"defaultValue";l in n||Ei(a)}var c=zo(e),u=c[Tl],d=!c[Il];let m=$e&&u;m&&pt(!1);var f=t||{},y=e.tagName==="OPTION";for(var k in t)k in n||(n[k]=null);n.class?n.class=zi(n.class):n[Dr]&&(n.class=null),n[qr]&&(n.style??=null);var L=Ll(e);for(const Z in n){let B=n[Z];if(y&&Z==="value"&&B==null){e.value=e.__value="",f[Z]=B;continue}if(Z==="class"){var $=e.namespaceURI==="http://www.w3.org/1999/xhtml";te(e,$,B,r,t?.[Dr],n[Dr]),f[Z]=B,f[Dr]=n[Dr];continue}if(Z==="style"){fr(e,B,t?.[qr],n[qr]),f[Z]=B,f[qr]=n[qr];continue}var U=f[Z];if(!(B===U&&!(B===void 0&&e.hasAttribute(Z)))){f[Z]=B;var G=Z[0]+Z[1];if(G!=="$$")if(G==="on"){const R={},ge="$$"+Z;let he=Z.slice(2);var T=Pg(he);if(Eg(he)&&(he=he.slice(0,-7),R.capture=!0),!T&&U){if(B!=null)continue;e.removeEventListener(he,f[ge],R),f[ge]=null}if(B!=null)if(T)e[`__${he}`]=B,an([he]);else{let Te=function(ie){f[Z].call(this,ie)};f[ge]=hl(he,e,Te,R)}else T&&(e[`__${he}`]=void 0)}else if(Z==="style")Fn(e,Z,B);else if(Z==="autofocus")vg(e,!!B);else if(!u&&(Z==="__value"||Z==="value"&&B!=null))e.value=e.__value=B;else if(Z==="selected"&&y)Xg(e,B);else{var x=Z;d||(x=Og(x));var F=x==="defaultValue"||x==="defaultChecked";if(B==null&&!u&&!F)if(c[Z]=null,x==="value"||x==="checked"){let R=e;const ge=t===void 0;if(x==="value"){let he=R.defaultValue;R.removeAttribute(x),R.defaultValue=he,R.value=R.__value=ge?he:null}else{let he=R.defaultChecked;R.removeAttribute(x),R.defaultChecked=he,R.checked=ge?he:!1}}else e.removeAttribute(Z);else F||L.includes(x)&&(u||typeof B!="string")?(e[x]=B,x in c&&(c[x]=ot)):typeof B!="function"&&Fn(e,x,B)}}}return m&&pt(!0),f}function Wn(e,t,n=[],r=[],o,s=!1,a=!1){ja(n,r,l=>{var c=void 0,u={},d=e.nodeName==="SELECT",m=!1;if(Dn(()=>{var y=t(...l.map(i)),k=ev(e,c,y,o,s,a);m&&d&&"value"in y&&Ni(e,y.value);for(let $ of Object.getOwnPropertySymbols(u))y[$]||it(u[$]);for(let $ of Object.getOwnPropertySymbols(y)){var L=y[$];$.description===Em&&(!c||L!==c[$])&&(u[$]&&it(u[$]),u[$]=ut(()=>Bg(e,()=>L))),k[$]=L}c=k}),d){var f=e;_i(()=>{Ni(f,c.value,!0),Kg(f)})}m=!0})}function zo(e){return e.__attributes??={[Tl]:e.nodeName.includes("-"),[Il]:e.namespaceURI===Lm}}var Ml=new Map;function Ll(e){var t=e.getAttribute("is")||e.nodeName,n=Ml.get(t);if(n)return n;Ml.set(t,n=[]);for(var r,o=e,s=Element.prototype;s!==o;){r=wa(o);for(var a in r)r[a].set&&n.push(a);o=li(o)}return n}function Ai(e,t,n=t){var r=new WeakSet;Ha(e,"input",async o=>{var s=o?e.defaultValue:e.value;if(s=Pi(e)?ji(s):s,n(s),Je!==null&&r.add(Je),await zg(),s!==(s=t())){var a=e.selectionStart,l=e.selectionEnd,c=e.value.length;if(e.value=s??"",l!==null){var u=e.value.length;a===l&&l===c&&u>c?(e.selectionStart=u,e.selectionEnd=u):(e.selectionStart=a,e.selectionEnd=Math.min(l,u))}}}),($e&&e.defaultValue!==e.value||z(t)==null&&e.value)&&(n(Pi(e)?ji(e.value):e.value),Je!==null&&r.add(Je)),On(()=>{var o=t();if(e===document.activeElement){var s=_o??Je;if(r.has(s))return}Pi(e)&&o===ji(e.value)||e.type==="date"&&!o&&!e.value||o!==e.value&&(e.value=o??"")})}function Pi(e){var t=e.type;return t==="number"||t==="range"}function ji(e){return e===""?null:+e}function tv(e,t,n=t){Ha(e,"change",()=>{n(e.files)}),$e&&e.files&&n(e.files),On(()=>{e.files=t()})}function Nl(e,t){return e===t||e?.[Gt]===t}function pr(e={},t,n,r){return _i(()=>{var o,s;return On(()=>{o=s,s=[],z(()=>{e!==n(...s)&&(t(e,...s),o&&Nl(n(...o),e)&&t(null,...o))})}),()=>{rn(()=>{s&&Nl(n(...s),e)&&t(null,...s)})}}),e}function mt(e=!1){const t=Ge,n=t.l.u;if(!n)return;let r=()=>b(t.s);if(e){let o=0,s={};const a=Er(()=>{let l=!1;const c=t.s;for(const u in c)c[u]!==s[u]&&(s[u]=c[u],l=!0);return l&&o++,o});r=()=>i(a)}n.b.length&&kg(()=>{El(t,r),ci(n.b)}),ki(()=>{const o=z(()=>n.m.map(Dm));return()=>{for(const s of o)typeof s=="function"&&s()}}),n.a.length&&ki(()=>{El(t,r),ci(n.a)})}function El(e,t){if(e.l.s)for(const n of e.l.s)i(n);t()}function Al(e,t,n){if(e==null)return t(void 0),Vt;const r=z(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const hr=[];function nv(e,t=Vt){let n=null;const r=new Set;function o(l){if(Ca(e,l)&&(e=l,n)){const c=!hr.length;for(const u of r)u[1](),hr.push(u,e);if(c){for(let u=0;u<hr.length;u+=2)hr[u][0](hr[u+1]);hr.length=0}}}function s(l){o(l(e))}function a(l,c=Vt){const u=[l,c];return r.add(u),r.size===1&&(n=t(o,s)||Vt),l(e),()=>{r.delete(u),r.size===0&&n&&(n(),n=null)}}return{set:o,update:s,subscribe:a}}function Zr(e){let t;return Al(e,n=>t=n)(),t}let Mo=!1,Oi=Symbol();function rv(e,t,n){const r=n[t]??={store:null,source:Q(void 0),unsubscribe:Vt};if(r.store!==e&&!(Oi in n))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=Vt;else{var o=!0;r.unsubscribe=Al(e,s=>{o?r.source.v=s:h(r.source,s)}),o=!1}return e&&Oi in n?Zr(e):i(r.source)}function ov(){const e={};function t(){So(()=>{for(var n in e)e[n].unsubscribe();Cn(e,Oi,{enumerable:!1,value:!0})})}return[e,t]}function iv(e){var t=Mo;try{return Mo=!1,[e(),Mo]}finally{Mo=t}}const sv={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Di(e,t,n){return new Proxy({props:e,exclude:t},sv)}const av={get(e,t){if(!e.exclude.includes(t))return i(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,n){if(!(t in e.special)){var r=Ie;try{At(e.parent_effect),e.special[t]=w({get[t](){return e.props[t]}},t,ba)}finally{At(r)}}return e.special[t](n),Ua(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},deleteProperty(e,t){return e.exclude.includes(t)||(e.exclude.push(t),Ua(e.version)),!0},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function Jt(e,t){return new Proxy({props:e,exclude:t,special:{},version:wn(0),parent_effect:Ie},av)}const lv={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(zr(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let o=e.props[r];zr(o)&&(o=o());const s=en(o,t);if(s&&s.set)return s.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(zr(r)&&(r=r()),typeof r=="object"&&r!==null&&t in r){const o=en(r,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===Gt||t===hi)return!1;for(let n of e.props)if(zr(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){const t=[];for(let n of e.props)if(zr(n)&&(n=n()),!!n){for(const r in n)t.includes(r)||t.push(r);for(const r of Object.getOwnPropertySymbols(n))t.includes(r)||t.push(r)}return t}};function ft(...e){return new Proxy({props:e},lv)}function w(e,t,n,r){var o=!tr||(n&Tm)!==0,s=(n&Im)!==0,a=(n&Cm)!==0,l=r,c=!0,u=()=>(c&&(c=!1,l=a?z(r):r),l),d;if(s){var m=Gt in e||hi in e;d=en(e,t)?.set??(m&&t in e?T=>e[t]=T:void 0)}var f,y=!1;s?[f,y]=iv(()=>e[t]):f=e[t],f===void 0&&r!==void 0&&(f=u(),d&&(o&&Bm(),d(f)));var k;if(o?k=()=>{var T=e[t];return T===void 0?u():(c=!0,T)}:k=()=>{var T=e[t];return T!==void 0&&(l=void 0),T===void 0?l:T},o&&(n&ba)===0)return k;if(d){var L=e.$$legacy;return(function(T,x){return arguments.length>0?((!o||!x||L||y)&&d(x?k():T),T):k()})}var $=!1,U=((n&Sm)!==0?Er:Ue)(()=>($=!1,k()));s&&i(U);var G=Ie;return(function(T,x){if(arguments.length>0){const F=x?i(U):o&&s?lr(T):T;return h(U,F),$=!0,l!==void 0&&(l=F),T}return Zn&&$||(G.f&Mn)!==0?U.v:i(U)})}function cv(e){return new uv(e)}class uv{#t;#e;constructor(t){var n=new Map,r=(s,a)=>{var l=Q(a,!1,!1);return n.set(s,l),l};const o=new Proxy({...t.props||{},$$events:{}},{get(s,a){return i(n.get(a)??r(a,Reflect.get(s,a)))},has(s,a){return a===hi?!0:(i(n.get(a)??r(a,Reflect.get(s,a))),Reflect.has(s,a))},set(s,a,l){return h(n.get(a)??r(a,l),l),Reflect.set(s,a,l)}});this.#e=(t.hydrate?Rg:vl)(t.component,{target:t.target,anchor:t.anchor,props:o,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&je(),this.#t=o.$$events;for(const s of Object.keys(this.#e))s==="$set"||s==="$destroy"||s==="$on"||Cn(this,s,{get(){return this.#e[s]},set(a){this.#e[s]=a},enumerable:!0});this.#e.$set=s=>{Object.assign(o,s)},this.#e.$destroy=()=>{Fg(this.#e)}}$set(t){this.#e.$set(t)}$on(t,n){this.#t[t]=this.#t[t]||[];const r=(...o)=>n.call(this,...o);return this.#t[t].push(r),()=>{this.#t[t]=this.#t[t].filter(o=>o!==r)}}$destroy(){this.#e.$destroy()}}let Pl;typeof HTMLElement=="function"&&(Pl=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&this.attachShadow({mode:"open"})}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){const r=this.$$c.$on(e,t);this.$$l_u.set(t,r)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){const r=this.$$l_u.get(t);r&&(r(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(r){return o=>{const s=document.createElement("slot");r!=="default"&&(s.name=r),N(o,s)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const t={},n=dv(this);for(const r of this.$$s)r in n&&(r==="default"&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(const r of this.attributes){const o=this.$$g_p(r.name);o in this.$$d||(this.$$d[o]=Lo(o,r.value,this.$$p_d,"toProp"))}for(const r in this.$$p_d)!(r in this.$$d)&&this[r]!==void 0&&(this.$$d[r]=this[r],delete this[r]);this.$$c=cv({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=_g(()=>{On(()=>{this.$$r=!0;for(const r of mo(this.$$c)){if(!this.$$p_d[r]?.reflect)continue;this.$$d[r]=this.$$c[r];const o=Lo(r,this.$$d[r],this.$$p_d,"toAttribute");o==null?this.removeAttribute(this.$$p_d[r].attribute||r):this.setAttribute(this.$$p_d[r].attribute||r,o)}this.$$r=!1})});for(const r in this.$$l)for(const o of this.$$l[r]){const s=this.$$c.$on(r,o);this.$$l_u.set(o,s)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Lo(e,n,this.$$p_d,"toProp"),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return mo(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Lo(e,t,n,r){const o=n[e]?.type;if(t=o==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(o){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t??null;default:return t}else switch(o){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}function dv(e){const t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}function jl(e,t,n,r,o,s){let a=class extends Pl{constructor(){super(e,n,o),this.$$p_d=t}static get observedAttributes(){return mo(t).map(l=>(t[l].attribute||l).toLowerCase())}};return mo(t).forEach(l=>{Cn(a.prototype,l,{get(){return this.$$c&&l in this.$$c?this.$$c[l]:this.$$d[l]},set(c){c=Lo(l,c,t),this.$$d[l]=c;var u=this.$$c;if(u){var d=en(u,l)?.get;d?u[l]=c:u.$set({[l]:c})}}})}),r.forEach(l=>{Cn(a.prototype,l,{get(){return this.$$c?.[l]}})}),e.element=a,a}const fv={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 pv=Ng("<svg><!><!></svg>");function xn(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=Jt(n,["type","name","color","size","stroke","iconNode"]);Xe(t,!1);let o=w(t,"type",8),s=w(t,"name",8),a=w(t,"color",8,"currentColor"),l=w(t,"size",8,24),c=w(t,"stroke",8,2),u=w(t,"iconNode",8);mt();var d=pv();Wn(d,()=>({...fv[o()],...r,width:l(),height:l(),class:(b(s()),b(n),z(()=>`tabler-icon tabler-icon-${s()} ${n.class??""}`)),...o()==="filled"?{fill:a()}:{"stroke-width":c(),stroke:a()}}));var m=I(d);zt(m,1,u,jt,(y,k)=>{var L=pg(()=>qm(i(k),2));let $=()=>i(L)[0],U=()=>i(L)[1];var G=De(),T=Ne(G);Yg(T,$,!0,(x,F)=>{Wn(x,()=>({...U()}))}),N(y,G)});var f=oe(m);cn(f,t,"default",{}),S(d),N(e,d),et()}function Ol(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=[["path",{d:"M9 14l-4 -4l4 -4"}],["path",{d:"M5 10h11a4 4 0 1 1 0 8h-1"}]];xn(e,ft({type:"outline",name:"arrow-back-up"},()=>n,{get iconNode(){return r},children:(o,s)=>{var a=De(),l=Ne(a);cn(l,t,"default",{}),N(o,a)},$$slots:{default:!0}}))}function Dl(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=[["path",{d:"M5 12l5 5l10 -10"}]];xn(e,ft({type:"outline",name:"check"},()=>n,{get iconNode(){return r},children:(o,s)=>{var a=De(),l=Ne(a);cn(l,t,"default",{}),N(o,a)},$$slots:{default:!0}}))}function ql(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=[["path",{d:"M15 6l-6 6l6 6"}]];xn(e,ft({type:"outline",name:"chevron-left"},()=>n,{get iconNode(){return r},children:(o,s)=>{var a=De(),l=Ne(a);cn(l,t,"default",{}),N(o,a)},$$slots:{default:!0}}))}function No(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=[["path",{d:"M9 6l6 6l-6 6"}]];xn(e,ft({type:"outline",name:"chevron-right"},()=>n,{get iconNode(){return r},children:(o,s)=>{var a=De(),l=Ne(a);cn(l,t,"default",{}),N(o,a)},$$slots:{default:!0}}))}function hv(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=[["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"}]];xn(e,ft({type:"outline",name:"home-2"},()=>n,{get iconNode(){return r},children:(o,s)=>{var a=De(),l=Ne(a);cn(l,t,"default",{}),N(o,a)},$$slots:{default:!0}}))}function Zl(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=[["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"}]];xn(e,ft({type:"outline",name:"photo"},()=>n,{get iconNode(){return r},children:(o,s)=>{var a=De(),l=Ne(a);cn(l,t,"default",{}),N(o,a)},$$slots:{default:!0}}))}function Ul(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=[["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"}]];xn(e,ft({type:"outline",name:"wand"},()=>n,{get iconNode(){return r},children:(o,s)=>{var a=De(),l=Ne(a);cn(l,t,"default",{}),N(o,a)},$$slots:{default:!0}}))}function Rl(e,t){const n=Jt(t,["children","$$slots","$$events","$$legacy"]),r=[["path",{d:"M18 6l-12 12"}],["path",{d:"M6 6l12 12"}]];xn(e,ft({type:"outline",name:"x"},()=>n,{get iconNode(){return r},children:(o,s)=>{var a=De(),l=Ne(a);cn(l,t,"default",{}),N(o,a)},$$slots:{default:!0}}))}const mv={questions:[],questionsData:{}},Ft=nv(mv),gt=(e,t,n,r)=>{if((t==null||t===""||Array.isArray(t)&&t.length===0)&&!r){Zi(e);return}let o;switch(n){case"rating":o={rating:t};break;case"nps":o={nps:t};break;case"long_text":o={longText:t};break;case"short_answer":o={shortAnswer:t};break;case"single_choice":o={singleChoice:t};break;case"multiple_choice_multiple":o={multipleChoiceMultiple:Array.isArray(t)?t:[t]};break;case"nested_selection":o={nestedSelection:Array.isArray(t)?t:[t]};break;case"annotation":o={annotation:t};break;default:o=t}Ft.update(s=>{const a=s.questions.findIndex(l=>l.questionId===e);return a!==-1?{...s,questions:s.questions.map((l,c)=>c===a?{...l,answer:o,type:n,error:r}:l)}:{...s,questions:[...s.questions,{questionId:e,answer:o,type:n,error:r}]}})},mr=(e,t)=>{vv(e)&&Ft.update(n=>({...n,questions:n.questions.map(r=>r.questionId===e?{...r,error:t}:r)}))},gv=()=>{Ft.update(e=>({...e,questions:e.questions.map(t=>({...t,error:void 0}))}))},qi=()=>Zr(Ft).questions.some(e=>e.error!==void 0&&e.error!==null&&e.error!==""),Zi=e=>{Ft.update(t=>({...t,questions:t.questions.filter(n=>n.questionId!==e)}))},vv=e=>Zr(Ft).questions.find(t=>t.questionId===e),bv=()=>{Ft.update(e=>({...e,questions:[]}))},Fl=e=>{Ft.update(t=>({...t,questionsData:e}))},Wl=e=>Zr(Ft).questionsData[e];var yv=V("<div><span> </span></div>"),wv=V('<span class="required">*</span>'),kv=V("<div> </div>"),_v=(e,t,n)=>t(i(n)),xv=V('<button type="button"> </button>'),$v=V("<span> </span>"),Sv=V("<span> </span>"),Tv=V("<div> </div>"),Iv=V('<div><div class="question-header"><div class="question-title-row"><!> <div class="title-and-description"><label> <!></label> <!></div></div></div> <div class="scale-container"><div class="scale-buttons"></div> <div class="scale-labels"><!> <!></div></div> <!></div>');function Cv(e,t){Xe(t,!1);const n=Q(),r=Q();let o=w(t,"question",8),s=w(t,"value",24,()=>-1),a=w(t,"onChange",8),l=w(t,"error",8,void 0),c=w(t,"currentMode",8,void 0),u=w(t,"questionNumber",8,void 0);w(t,"themeSettings",8,void 0),w(t,"currentLanguage",8,void 0);let d=Q(s()??-1);function m(C){i(d)===C?(h(d,-1),a()(-1),Zi(o().id)):(h(d,C),a()(C),gt(o().id,C,xe.NPS))}ee(()=>b(c()),()=>{h(n,c()==="dark")}),ee(()=>b(s()),()=>{s()!==void 0&&h(d,s())}),ee(()=>b(o()),()=>{h(r,Array.from({length:(o().max??10)-(o().min??0)+1},(C,p)=>p+(o().min??0)))}),$t(),mt();var f=Iv(),y=I(f),k=I(y),L=I(k);{var $=C=>{var p=yv(),v=I(p),g=I(v);S(v),S(p),ae(()=>{te(p,1,`question-number ${i(n)?"dark-mode":""}`),de(g,`${u()??""}.`)}),N(C,p)};K(L,C=>{u()!==void 0&&C($)})}var U=oe(L,2),G=I(U),T=I(G),x=oe(T);{var F=C=>{var p=wv();N(C,p)};K(x,C=>{b(o()),z(()=>o().required)&&C(F)})}S(G);var Z=oe(G,2);{var B=C=>{var p=kv(),v=I(p,!0);S(p),ae(()=>{te(p,1,`description ${i(n)?"dark-mode":""}`),de(v,(b(o()),z(()=>o().description)))}),N(C,p)};K(Z,C=>{b(o()),z(()=>o().description)&&C(B)})}S(U),S(k),S(y);var R=oe(y,2),ge=I(R);zt(ge,5,()=>i(r),jt,(C,p)=>{var v=xv();v.__click=[_v,m,p];var g=I(v,!0);S(v),ae(()=>{te(v,1,`button-nps nps-scale-button ${i(d)===i(p)?"selected":""} ${i(n)?"dark-mode":""}`),de(g,i(p))}),N(C,v)}),S(ge);var he=oe(ge,2),Te=I(he);{var ie=C=>{var p=$v(),v=I(p,!0);S(p),ae(()=>{te(p,1,`rating-label nps-rating-label ${i(n)?"dark-mode":""}`),de(v,(b(o()),z(()=>o().minLabel)))}),N(C,p)};K(Te,C=>{b(o()),z(()=>o().minLabel)&&C(ie)})}var le=oe(Te,2);{var Y=C=>{var p=Sv(),v=I(p,!0);S(p),ae(()=>{te(p,1,`rating-label nps-rating-label ${i(n)?"dark-mode":""}`),de(v,(b(o()),z(()=>o().maxLabel)))}),N(C,p)};K(le,C=>{b(o()),z(()=>o().maxLabel)&&C(Y)})}S(he),S(R);var E=oe(R,2);{var A=C=>{var p=Tv(),v=I(p,!0);S(p),ae(()=>{te(p,1,`error ${i(n)?"dark-mode":""}`),de(v,l())}),N(C,p)};K(E,C=>{l()&&C(A)})}S(f),ae(()=>{te(f,1,`container ${i(n)?"dark-mode":""}`),te(G,1,`label ${i(n)?"dark-mode":""}`),de(T,`${b(o()),z(()=>o().title)??""} `)}),N(e,f),et()}an(["click"]);var zv=V("<div><span> </span></div>"),Mv=V('<span class="required">*</span>'),Lv=V("<div> </div>"),Nv=(e,t)=>e.key==="Enter"&&t(),Ev=(e,t,n)=>t(i(n).index),Av=(e,t,n)=>e.key==="Enter"&&t(i(n).index),Pv=V('<div class="breadcrumb-separator-container"><!> <span role="button" tabindex="0"> </span></div>'),jv=(e,t,n,r)=>t(i(n),[...i(r),i(n).value]),Ov=V('<button type="button"><span> </span> <!></button>'),Dv=V('<div class="empty-message">No options available</div>'),qv=V("<div> </div>"),Zv=V('<div><div class="question-header"><div class="question-title-row"><!> <div class="title-and-description"><label> <!></label> <!></div></div></div> <div><div class="breadcrumb-nav"><span role="button" tabindex="0"><!></span> <!></div> <div class="options-list"><!></div></div> <!></div>');function Uv(e,t){Xe(t,!1);const n=Q();let r=w(t,"question",8),o=w(t,"value",24,()=>[]),s=w(t,"onChange",8),a=w(t,"error",8,void 0),l=w(t,"currentMode",8,void 0),c=w(t,"questionNumber",8,void 0);w(t,"themeSettings",8,void 0),w(t,"currentLanguage",8,void 0);const u=o()?Array.isArray(o())?o():[o()]:[];let d=Q(u),m=Q(L()),f=Q(!1),y=Q([]),k=Q([]);function L(){return u.length===0?[]:u.slice(0,-1)}function $(re,X){console.log("handleChange called",{option:re,path:X,hasChildren:re.children&&re.children.length>0}),h(f,!0),re.children&&re.children.length>0?(console.log("Navigating to children, setting navPath to:",X),h(m,X),console.log("navPath is now:",i(m))):(console.log("Leaf node selected, setting selectedValue to:",X),h(d,X),s()(X))}function U(re){const X=i(d);return X.length!==re.length?!1:re.every((be,Se)=>X[Se]===be)}function G(re){console.log("getCurrentLevelOptions called with path:",re);let X=r().options;for(let be=0;be<re.length;be++){const Se=X.find(_e=>_e.value===re[be]);if(Se&&Se.children)X=Se.children;else return[]}return console.log("Returning options:",X),X}function T(re){console.log("getBreadcrumbs called with path:",re);const X=[];let be=r().options;for(let Se=0;Se<re.length;Se++){const _e=be.find(me=>me.value===re[Se]);_e&&(X.push({value:re[Se],label:_e.label,index:Se}),_e.children&&(be=_e.children))}return console.log("Returning breadcrumbs:",X),X}function x(re){h(f,!0),h(m,i(m).slice(0,re+1))}function F(){h(f,!0),h(m,[]),h(d,[]),s()([])}ee(()=>b(l()),()=>{h(n,l()==="dark")}),ee(()=>(b(o()),i(f)),()=>{if(o()!==void 0&&!i(f)){const re=Array.isArray(o())?o():[o()];h(d,re),re.length>0?h(m,re.slice(0,-1)):h(m,[])}else o()===void 0&&!i(f)&&(h(d,[]),h(m,[]))}),ee(()=>i(m),()=>{h(y,G(i(m)))}),ee(()=>i(m),()=>{h(k,T(i(m)))}),$t(),mt();var Z=Zv(),B=I(Z),R=I(B),ge=I(R);{var he=re=>{var X=zv(),be=I(X),Se=I(be);S(be),S(X),ae(()=>{te(X,1,`question-number ${i(n)?"dark-mode":""}`),de(Se,`${c()??""}.`)}),N(re,X)};K(ge,re=>{c()!==void 0&&re(he)})}var Te=oe(ge,2),ie=I(Te),le=I(ie),Y=oe(le);{var E=re=>{var X=Mv();N(re,X)};K(Y,re=>{b(r()),z(()=>r().required)&&re(E)})}S(ie);var A=oe(ie,2);{var C=re=>{var X=Lv(),be=I(X,!0);S(X),ae(()=>{te(X,1,`description ${i(n)?"dark-mode":""}`),de(be,(b(r()),z(()=>r().description)))}),N(re,X)};K(A,re=>{b(r()),z(()=>r().description)&&re(C)})}S(Te),S(R),S(B);var p=oe(B,2),v=I(p),g=I(v);g.__click=F,g.__keydown=[Nv,F];var j=I(g);hv(j,{size:16}),S(g);var q=oe(g,2);zt(q,1,()=>i(k),jt,(re,X)=>{var be=Pv(),Se=I(be);No(Se,{size:16});var _e=oe(Se,2);_e.__click=[Ev,x,X],_e.__keydown=[Av,x,X];var me=I(_e,!0);S(_e),S(be),ae(()=>{te(_e,1,`breadcrumb-item nested-dropdown-breadcrumb-item ${i(n)?"dark-mode":""}`),de(me,(i(X),z(()=>i(X).label)))}),N(re,be)}),S(v);var W=oe(v,2),H=I(W);{var ne=re=>{var X=De(),be=Ne(X);zt(be,1,()=>i(y),jt,(Se,_e)=>{var me=Ov();me.__click=[jv,$,_e,m];var He=I(me),vt=I(He,!0);S(He);var bt=oe(He,2);{var Ke=Ye=>{No(Ye,{size:16})},yt=Ye=>{var Qe=De(),wt=Ne(Qe);{var Wt=Mt=>{Dl(Mt,{size:16,color:"#22c55e"})};K(wt,Mt=>{i(m),i(_e),z(()=>U([...i(m),i(_e).value]))&&Mt(Wt)},!0)}N(Ye,Qe)};K(bt,Ye=>{i(_e),z(()=>i(_e).children&&i(_e).children.length>0)?Ye(Ke):Ye(yt,!1)})}S(me),ae(Ye=>{te(me,1,Ye),de(vt,(i(_e),z(()=>i(_e).label)))},[()=>(i(m),i(_e),i(n),z(()=>`nested-option nested-dropdown-option ${U([...i(m),i(_e).value])?"selected":""} ${i(n)?"dark-mode":""}`))]),N(Se,me)}),N(re,X)},ve=re=>{var X=Dv();N(re,X)};K(H,re=>{i(y),z(()=>i(y).length>0)?re(ne):re(ve,!1)})}S(W),S(p);var ue=oe(p,2);{var we=re=>{var X=qv(),be=I(X,!0);S(X),ae(()=>{te(X,1,`error-message ${i(n)?"dark-mode":""}`),de(be,a())}),N(re,X)};K(ue,re=>{a()&&re(we)})}S(Z),ae(()=>{te(Z,1,`container ${i(n)?"dark-mode":""}`),te(ie,1,`label ${i(n)?"dark-mode":""}`),de(le,`${b(r()),z(()=>r().title)??""} `),te(p,1,`nested-dropdown-container ${i(n)?"dark-mode":""}`),te(g,1,`breadcrumb-item home-item nested-dropdown-home-item ${i(n)?"dark-mode":""}`)}),N(e,Z),et()}an(["click","keydown"]);const Ui="-",Rv=e=>{const t=Wv(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const s=o.split(Ui);return s[0]===""&&s.length!==1&&s.shift(),Ql(s,t)||Fv(o)},getConflictingClassGroupIds:(o,s)=>{const a=n[o]||[];return s&&r[o]?[...a,...r[o]]:a}}},Ql=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ql(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Ui);return t.validators.find(({validator:a})=>a(s))?.classGroupId},Vl=/^\[(.+)\]$/,Fv=e=>{if(Vl.test(e)){const t=Vl.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Wv=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const o in n)Ri(n[o],r,o,t);return r},Ri=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Gl(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Qv(o)){Ri(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,a])=>{Ri(a,Gl(t,s),n,r)})})},Gl=(e,t)=>{let n=e;return t.split(Ui).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Qv=e=>e.isThemeGetter,Vv=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return o(s,a),a},set(s,a){n.has(s)?n.set(s,a):o(s,a)}}},Fi="!",Wi=":",Gv=Wi.length,Yv=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let a=0,l=0,c=0,u;for(let k=0;k<o.length;k++){let L=o[k];if(a===0&&l===0){if(L===Wi){s.push(o.slice(c,k)),c=k+Gv;continue}if(L==="/"){u=k;continue}}L==="["?a++:L==="]"?a--:L==="("?l++:L===")"&&l--}const d=s.length===0?o:o.substring(c),m=Bv(d),f=m!==d,y=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:y}};if(t){const o=t+Wi,s=r;r=a=>a.startsWith(o)?s(a.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:a,maybePostfixModifierPosition:void 0}}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},Bv=e=>e.endsWith(Fi)?e.substring(0,e.length-1):e.startsWith(Fi)?e.substring(1):e,Hv=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const r=[];let o=[];return n.forEach(s=>{s[0]==="["||t[s]?(r.push(...o.sort(),s),o=[]):o.push(s)}),r.push(...o.sort()),r}},Jv=e=>({cache:Vv(e.cacheSize),parseClassName:Yv(e),sortModifiers:Hv(e),...Rv(e)}),Kv=/\s+/,Xv=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,a=[],l=e.trim().split(Kv);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:m,modifiers:f,hasImportantModifier:y,baseClassName:k,maybePostfixModifierPosition:L}=n(d);if(m){c=d+(c.length>0?" "+c:c);continue}let $=!!L,U=r($?k.substring(0,L):k);if(!U){if(!$){c=d+(c.length>0?" "+c:c);continue}if(U=r(k),!U){c=d+(c.length>0?" "+c:c);continue}$=!1}const G=s(f).join(":"),T=y?G+Fi:G,x=T+U;if(a.includes(x))continue;a.push(x);const F=o(U,$);for(let Z=0;Z<F.length;++Z){const B=F[Z];a.push(T+B)}c=d+(c.length>0?" "+c:c)}return c};function eb(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Yl(t))&&(r&&(r+=" "),r+=n);return r}const Yl=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Yl(e[r]))&&(n&&(n+=" "),n+=t);return n};function Qi(e,...t){let n,r,o,s=a;function a(c){const u=t.reduce((d,m)=>m(d),e());return n=Jv(u),r=n.cache.get,o=n.cache.set,s=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=Xv(c,n);return o(c,d),d}return function(){return s(eb.apply(null,arguments))}}const rt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Bl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tb=/^\d+\/\d+$/,nb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rb=/\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$/,ob=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ib=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gr=e=>tb.test(e),ze=e=>!!e&&!Number.isNaN(Number(e)),$n=e=>!!e&&Number.isInteger(Number(e)),Vi=e=>e.endsWith("%")&&ze(e.slice(0,-1)),un=e=>nb.test(e),ab=()=>!0,lb=e=>rb.test(e)&&!ob.test(e),Jl=()=>!1,cb=e=>ib.test(e),ub=e=>sb.test(e),db=e=>!fe(e)&&!pe(e),fb=e=>vr(e,nc,Jl),fe=e=>Bl.test(e),Qn=e=>vr(e,rc,lb),Gi=e=>vr(e,vb,ze),Kl=e=>vr(e,ec,Jl),pb=e=>vr(e,tc,ub),Eo=e=>vr(e,oc,cb),pe=e=>Hl.test(e),Ur=e=>br(e,rc),hb=e=>br(e,bb),Xl=e=>br(e,ec),mb=e=>br(e,nc),gb=e=>br(e,tc),Ao=e=>br(e,oc,!0),vr=(e,t,n)=>{const r=Bl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},br=(e,t,n=!1)=>{const r=Hl.exec(e);return r?r[1]?t(r[1]):n:!1},ec=e=>e==="position"||e==="percentage",tc=e=>e==="image"||e==="url",nc=e=>e==="length"||e==="size"||e==="bg-size",rc=e=>e==="length",vb=e=>e==="number",bb=e=>e==="family-name",oc=e=>e==="shadow",Yi=()=>{const e=rt("color"),t=rt("font"),n=rt("text"),r=rt("font-weight"),o=rt("tracking"),s=rt("leading"),a=rt("breakpoint"),l=rt("container"),c=rt("spacing"),u=rt("radius"),d=rt("shadow"),m=rt("inset-shadow"),f=rt("text-shadow"),y=rt("drop-shadow"),k=rt("blur"),L=rt("perspective"),$=rt("aspect"),U=rt("ease"),G=rt("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...x(),pe,fe],Z=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],R=()=>[pe,fe,c],ge=()=>[gr,"full","auto",...R()],he=()=>[$n,"none","subgrid",pe,fe],Te=()=>["auto",{span:["full",$n,pe,fe]},$n,pe,fe],ie=()=>[$n,"auto",pe,fe],le=()=>["auto","min","max","fr",pe,fe],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],E=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...R()],C=()=>[gr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],p=()=>[e,pe,fe],v=()=>[...x(),Xl,Kl,{position:[pe,fe]}],g=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",mb,fb,{size:[pe,fe]}],q=()=>[Vi,Ur,Qn],W=()=>["","none","full",u,pe,fe],H=()=>["",ze,Ur,Qn],ne=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[ze,Vi,Xl,Kl],we=()=>["","none",k,pe,fe],re=()=>["none",ze,pe,fe],X=()=>["none",ze,pe,fe],be=()=>[ze,pe,fe],Se=()=>[gr,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[un],breakpoint:[un],color:[ab],container:[un],"drop-shadow":[un],ease:["in","out","in-out"],font:[db],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[un],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[un],shadow:[un],spacing:["px",ze],text:[un],"text-shadow":[un],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gr,fe,pe,$]}],container:["container"],columns:[{columns:[ze,fe,pe,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:F()}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ge()}],"inset-x":[{"inset-x":ge()}],"inset-y":[{"inset-y":ge()}],start:[{start:ge()}],end:[{end:ge()}],top:[{top:ge()}],right:[{right:ge()}],bottom:[{bottom:ge()}],left:[{left:ge()}],visibility:["visible","invisible","collapse"],z:[{z:[$n,"auto",pe,fe]}],basis:[{basis:[gr,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,gr,"auto","initial","none",fe]}],grow:[{grow:["",ze,pe,fe]}],shrink:[{shrink:["",ze,pe,fe]}],order:[{order:[$n,"first","last","none",pe,fe]}],"grid-cols":[{"grid-cols":he()}],"col-start-end":[{col:Te()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":he()}],"row-start-end":[{row:Te()}],"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":le()}],"auto-rows":[{"auto-rows":le()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...E(),"normal"]}],"justify-self":[{"justify-self":["auto",...E()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...E(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...E(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...E(),"baseline"]}],"place-self":[{"place-self":["auto",...E()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],w:[{w:[l,"screen",...C()]}],"min-w":[{"min-w":[l,"screen","none",...C()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[a]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",n,Ur,Qn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pe,Gi]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Vi,fe]}],"font-family":[{font:[hb,fe,t]}],"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:[o,pe,fe]}],"line-clamp":[{"line-clamp":[ze,"none",pe,Gi]}],leading:[{leading:[s,...R()]}],"list-image":[{"list-image":["none",pe,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:p()}],"text-color":[{text:p()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",pe,Qn]}],"text-decoration-color":[{decoration:p()}],"underline-offset":[{"underline-offset":[ze,"auto",pe,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,fe]}],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",pe,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:v()}],"bg-repeat":[{bg:g()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$n,pe,fe],radial:["",pe,fe],conic:[$n,pe,fe]},gb,pb]}],"bg-color":[{bg:p()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:p()}],"gradient-via":[{via:p()}],"gradient-to":[{to:p()}],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:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:p()}],"border-color-x":[{"border-x":p()}],"border-color-y":[{"border-y":p()}],"border-color-s":[{"border-s":p()}],"border-color-e":[{"border-e":p()}],"border-color-t":[{"border-t":p()}],"border-color-r":[{"border-r":p()}],"border-color-b":[{"border-b":p()}],"border-color-l":[{"border-l":p()}],"divide-color":[{divide:p()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,pe,fe]}],"outline-w":[{outline:["",ze,Ur,Qn]}],"outline-color":[{outline:p()}],shadow:[{shadow:["","none",d,Ao,Eo]}],"shadow-color":[{shadow:p()}],"inset-shadow":[{"inset-shadow":["none",m,Ao,Eo]}],"inset-shadow-color":[{"inset-shadow":p()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:p()}],"ring-offset-w":[{"ring-offset":[ze,Qn]}],"ring-offset-color":[{"ring-offset":p()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":p()}],"text-shadow":[{"text-shadow":["none",f,Ao,Eo]}],"text-shadow-color":[{"text-shadow":p()}],opacity:[{opacity:[ze,pe,fe]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"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":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":p()}],"mask-image-linear-to-color":[{"mask-linear-to":p()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":p()}],"mask-image-t-to-color":[{"mask-t-to":p()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":p()}],"mask-image-r-to-color":[{"mask-r-to":p()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":p()}],"mask-image-b-to-color":[{"mask-b-to":p()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":p()}],"mask-image-l-to-color":[{"mask-l-to":p()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":p()}],"mask-image-x-to-color":[{"mask-x-to":p()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":p()}],"mask-image-y-to-color":[{"mask-y-to":p()}],"mask-image-radial":[{"mask-radial":[pe,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":p()}],"mask-image-radial-to-color":[{"mask-radial-to":p()}],"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":x()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":p()}],"mask-image-conic-to-color":[{"mask-conic-to":p()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:v()}],"mask-repeat":[{mask:g()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,fe]}],filter:[{filter:["","none",pe,fe]}],blur:[{blur:we()}],brightness:[{brightness:[ze,pe,fe]}],contrast:[{contrast:[ze,pe,fe]}],"drop-shadow":[{"drop-shadow":["","none",y,Ao,Eo]}],"drop-shadow-color":[{"drop-shadow":p()}],grayscale:[{grayscale:["",ze,pe,fe]}],"hue-rotate":[{"hue-rotate":[ze,pe,fe]}],invert:[{invert:["",ze,pe,fe]}],saturate:[{saturate:[ze,pe,fe]}],sepia:[{sepia:["",ze,pe,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,fe]}],"backdrop-blur":[{"backdrop-blur":we()}],"backdrop-brightness":[{"backdrop-brightness":[ze,pe,fe]}],"backdrop-contrast":[{"backdrop-contrast":[ze,pe,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,pe,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,pe,fe]}],"backdrop-invert":[{"backdrop-invert":["",ze,pe,fe]}],"backdrop-opacity":[{"backdrop-opacity":[ze,pe,fe]}],"backdrop-saturate":[{"backdrop-saturate":[ze,pe,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,pe,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",pe,fe]}],ease:[{ease:["linear","initial",U,pe,fe]}],delay:[{delay:[ze,pe,fe]}],animate:[{animate:["none",G,pe,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[L,pe,fe]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[pe,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:p()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:p()}],"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",pe,fe]}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",pe,fe]}],fill:[{fill:["none",...p()]}],"stroke-w":[{stroke:[ze,Ur,Qn,Gi]}],stroke:[{stroke:["none",...p()]}],"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"]}},yb=(e,{cacheSize:t,prefix:n,experimentalParseClassName:r,extend:o={},override:s={}})=>(Rr(e,"cacheSize",t),Rr(e,"prefix",n),Rr(e,"experimentalParseClassName",r),Po(e.theme,s.theme),Po(e.classGroups,s.classGroups),Po(e.conflictingClassGroups,s.conflictingClassGroups),Po(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Rr(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),jo(e.theme,o.theme),jo(e.classGroups,o.classGroups),jo(e.conflictingClassGroups,o.conflictingClassGroups),jo(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),ic(e,o,"orderSensitiveModifiers"),e),Rr=(e,t,n)=>{n!==void 0&&(e[t]=n)},Po=(e,t)=>{if(t)for(const n in t)Rr(e,n,t[n])},jo=(e,t)=>{if(t)for(const n in t)ic(e,t,n)},ic=(e,t,n)=>{const r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},wb=(e,...t)=>typeof e=="function"?Qi(Yi,e,...t):Qi(()=>yb(Yi(),e),...t),sc=Qi(Yi);function Fr(...e){return sc(_l(e))}var kb=V("<textarea></textarea>");function _b(e,t){Xe(t,!0);let n=w(t,"ref",15,null),r=w(t,"value",15),o=w(t,"data-slot",3,"textarea"),s=Di(t,["$$slots","$$events","$$legacy","ref","value","class","data-slot"]);var a=kb();bg(a),Wn(a,l=>({"data-slot":o(),class:l,...s}),[()=>Fr("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",t.class)]),pr(a,l=>n(l),()=>n()),Ai(a,r),N(e,a),et()}function ac(e){if(!e)return{code:null,message:""};const t=e.split("|").map(n=>n.trim());if(t.length>=2){const n=t[0],r=t.slice(1).join("|").trim(),o=r.match(/(\d+)\s+seconds?/i),s=o?parseInt(o[1],10):void 0;return{code:n,message:r,seconds:s}}return{code:null,message:e}}function lc(e,t,n){let r=e;t(r);const o=setInterval(()=>{r--,t(r),r<=0&&(clearInterval(o),n())},1e3);return o}function cc(e,t,n,r){if(!n?.otherFields)return t;const{otherFields:o}=n;switch(e){case"1001":{const s=o.aiEnhancementCooldownErrorMessage||t;return r!==void 0?`${s} (${r}s)`:s}case"1002":return o.aiEnhancementMaxReachedErrorMessage||t;default:return t}}async function uc(e){return await window.encatch._internal.refineText({questionId:e.questionId,identifier:e.identifier,feedbackConfigurationId:e.feedbackConfigurationId,userText:e.userText})}async function xb(e,t,n,r,o,s,a,l,c,u,d,m,f,y,k,L,$){if(!t()||!n()||!r())return;const U=i(o);try{h(s,!0),h(a,null);const G=await uc({questionId:l().id,identifier:n(),feedbackConfigurationId:r(),userText:U});if(G?.data?.refinedText){const T=G.data.refinedText;h(c,u()?.otherFields?.aiEnhancementSuccessMessage||G.message||"Text refined successfully"),i(d)?(h(d,{original:i(d).original,enhanced:[...i(d).enhanced,T]}),h(m,i(d).enhanced.length)):(h(d,{original:U,enhanced:[T]}),h(m,1)),h(o,T),h(f,!0);const x=y(T);h(k,x),L()(T),gt(l().id,T,xe.LONG_TEXT,x)}else{if(G?.message){const{code:T,message:x,seconds:F}=ac(G.message);T==="1001"&&F!==void 0&&$(F),h(a,cc(T,x,u(),F))}h(f,!1)}}catch(G){console.error("Error enhancing text:",G),h(a,"An error occurred while enhancing text"),h(f,!1)}finally{h(s,!1)}}function $b(e,t,n,r,o,s,a,l){if(!i(t))return;const c=i(t).original;h(n,c),h(r,0);const u=o(c);h(s,u),a()(c),gt(l().id,c,xe.LONG_TEXT,u)}var Sb=V("<div><span> </span></div>"),Tb=V('<span class="required">*</span>'),Ib=V("<div> </div>"),Cb=V("<div> </div>"),zb=V("<div> </div>"),Mb=((e,t,n)=>{i(t)>0&&n(i(t)-1)}),Lb=(e,t,n,r)=>{const o=t();i(n)<o-1&&r(i(n)+1)},Nb=V('<div class="version-navigation"><button type="button" title="Previous version"><!></button> <button type="button" title="Next version"><!></button></div>'),Eb=V('<button type="button" title="Back to original text"><!></button>'),Ab=V("<!> <!>",1),Pb=V('<div class="refine-text-section"><div class="button-group"><button type="button" title="Enhance with AI"><!></button> <!></div></div>'),jb=V("<div> </div>"),Ob=V("<div> </div>"),Db=V('<div><div class="question-header"><div class="question-title-row"><!> <div class="title-and-description"><label> <!></label> <!></div></div> <!></div> <div class="textarea-container"><!> <!></div> <!> <!> <!></div>');function qb(e,t){Xe(t,!1);const n=Q(),r=Q(),o=Q(),s=Q(),a=Q(),l=Q(),c=Q(),u=Q();let d=w(t,"question",8),m=w(t,"value",8,""),f=w(t,"onChange",8),y=w(t,"error",8,void 0),k=w(t,"currentMode",8,void 0),L=w(t,"questionNumber",8,void 0);w(t,"themeSettings",8,void 0),w(t,"currentLanguage",8,void 0),w(t,"apiKey",8,void 0),w(t,"hostUrl",8,void 0);let $=w(t,"identifier",8,void 0),U=w(t,"feedbackConfigurationId",8,void 0),G=w(t,"otherConfigurationProperties",8,void 0),T=Q(m()??""),x=Q(null),F=Q(0),Z=Q(y()),B=Q(!1),R=Q(!1),ge=Q(!1),he=Q(null),Te=Q(null),ie=Q(!1),le=Q(!1),Y=Q(""),E=Q(0),A=null,C=Q(i(T));Rn(()=>{setTimeout(()=>{const M=v(i(T));h(Z,M),M&&mr(d().id,M),h(ie,!0)},0)}),Co(()=>{A!==null&&clearInterval(A)});function p(){i(B)||h(B,!0)}function v(M){if(d().required&&(!M||M.trim()===""))return d().errorMessage||"This field is required";if(d().maxCharacters!==void 0&&M.length>d().maxCharacters||d().minCharacters!==void 0&&M.length>0&&M.length<d().minCharacters)return d().errorMessage}function g(M){A!==null&&clearInterval(A),A=lc(M,O=>{h(E,O)},()=>{A=null,h(he,null)})}function j(M){if(!i(x))return;let O;if(M===0)O=i(x).original;else{const ke=M-1;if(ke>=i(x).enhanced.length)return;O=i(x).enhanced[ke]}h(T,O),h(F,M);const ce=v(O);h(Z,ce),f()(O),gt(d().id,O,xe.LONG_TEXT,ce)}function q(){return i(x)?i(x).enhanced.length+1:0}function W(){const M=i(T).trim();return M?d().minCharactersToEnhance!==void 0?M.length>=d().minCharactersToEnhance:!0:!1}ee(()=>b(k()),()=>{h(n,k()==="dark")}),ee(()=>(b(m()),i(T),i(B)),()=>{m()!==void 0&&m()!==i(T)&&!i(B)&&(h(T,m()),h(C,m()))}),ee(()=>i(T),()=>{h(r,i(T).length)}),ee(()=>b(d()),()=>{h(o,d().minCharacters)}),ee(()=>b(d()),()=>{h(s,d().maxCharacters)}),ee(()=>(i(s),i(r)),()=>{h(a,i(s)!==void 0&&i(r)>i(s))}),ee(()=>(i(o),i(r)),()=>{h(l,i(o)!==void 0&&i(r)<i(o)&&i(r)>0)}),ee(()=>(i(a),i(l)),()=>{h(c,i(a)||i(l))}),ee(()=>(i(o),i(s)),()=>{h(u,i(o)!==void 0||i(s)!==void 0)}),ee(()=>(i(T),b(d())),()=>{const M=i(T).trim();M?d().minCharactersToEnhance!==void 0?h(le,M.length>=d().minCharactersToEnhance):h(le,!0):h(le,!1)}),ee(()=>(i(o),i(s),i(r),b(d())),()=>{i(o)!==void 0&&i(s)!==void 0?h(Y,`${i(r)} / (${i(o)} - ${i(s)})`):i(s)!==void 0&&d().required?h(Y,`${i(r)} / (1 - ${i(s)})`):i(o)!==void 0?h(Y,`${i(r)} / (${i(o)} - 5000)`):h(Y,"")}),ee(()=>(i(E),b(G())),()=>{i(E)>0&&G()?.otherFields?.aiEnhancementCooldownErrorMessage&&h(he,`${G().otherFields.aiEnhancementCooldownErrorMessage} (${i(E)}s)`)}),ee(()=>b(y()),()=>{y()!==void 0&&h(Z,y())}),ee(()=>(i(ie),i(B),i(T),i(C),b(f()),b(d()),xe),()=>{if(i(ie)&&i(B)&&i(T)!==i(C)){h(C,i(T));const M=v(i(T));h(Z,M),f()(i(T)),gt(d().id,i(T),xe.LONG_TEXT,M)}}),$t(),mt();var H=Db(),ne=I(H),ve=I(ne),ue=I(ve);{var we=M=>{var O=Sb(),ce=I(O),ke=I(ce);S(ce),S(O),ae(()=>{te(O,1,`question-number ${i(n)?"dark-mode":""}`),de(ke,`${L()??""}.`)}),N(M,O)};K(ue,M=>{L()!==void 0&&M(we)})}var re=oe(ue,2),X=I(re),be=I(X),Se=oe(be);{var _e=M=>{var O=Tb();N(M,O)};K(Se,M=>{b(d()),z(()=>d().required)&&M(_e)})}S(X);var me=oe(X,2);{var He=M=>{var O=Ib(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`description ${i(n)?"dark-mode":""}`),de(ce,(b(d()),z(()=>d().description)))}),N(M,O)};K(me,M=>{b(d()),z(()=>d().description)&&M(He)})}S(re),S(ve);var vt=oe(ve,2);{var bt=M=>{var O=Cb(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`error ${i(n)?"dark-mode":""}`),de(ce,i(Z))}),N(M,O)};K(vt,M=>{i(Z)&&i(B)&&M(bt)})}S(ne);var Ke=oe(ne,2),yt=I(Ke);{let M=Ue(()=>`textarea long-answer-textarea ${i(u)?"with-char-count":""} ${i(n)?"dark-mode":""}`),O=Ue(()=>(b(d()),z(()=>d().rows||4)));_b(yt,{get class(){return i(M)},onfocus:p,get placeholder(){return b(d()),z(()=>d().placeholder)},get rows(){return i(O)},onblur:()=>{if(i(ie)){const ce=v(i(T));h(Z,ce),mr(d().id,ce)}},get value(){return i(T)},set value(ce){h(T,ce)},$$legacy:!0})}var Ye=oe(yt,2);{var Qe=M=>{var O=zb(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`inner-character-count ${i(n)?"dark-mode":""} ${i(c)?"error":""}`),de(ce,i(Y))}),N(M,O)};K(Ye,M=>{i(u)&&M(Qe)})}S(Ke);var wt=oe(Ke,2);{var Wt=M=>{var O=Pb(),ce=I(O),ke=I(ce);ke.__click=[xb,W,$,U,T,ge,he,d,Te,G,x,F,R,v,Z,f,g];var Ae=I(ke);Ul(Ae,{size:16}),S(ke);var kt=oe(ke,2);{var Qt=fn=>{var Gn=Ab(),Ot=Ne(Gn);{var yr=ct=>{var We=Nb(),nt=I(We);nt.__click=[Mb,F,j];var Gr=I(nt);ql(Gr,{size:12}),S(nt);var Lt=oe(nt,2);Lt.__click=[Lb,q,F,j];var Yr=I(Lt);No(Yr,{size:12}),S(Lt),S(We),ae(Kt=>{te(nt,1,`version-nav-button ${i(n)?"dark-mode":""}`),nt.disabled=i(F)===0,te(Lt,1,`version-nav-button ${i(n)?"dark-mode":""}`),Lt.disabled=Kt},[()=>(i(F),z(()=>i(F)>=q()-1))]),N(ct,We)};K(Ot,ct=>{i(x),z(()=>i(x)&&i(x).enhanced&&i(x).enhanced.length>1)&&ct(yr)})}var Qr=oe(Ot,2);{var Vr=ct=>{var We=Eb();We.__click=[$b,x,T,F,v,Z,f,d];var nt=I(We);Ol(nt,{size:16}),S(We),ae(()=>te(We,1,`rollback-button ${i(n)?"dark-mode":""}`)),N(ct,We)};K(Qr,ct=>{i(F)!==0&&ct(Vr)})}N(fn,Gn)};K(kt,fn=>{i(x)&&!i(ge)&&fn(Qt)})}S(ce),S(O),ae(()=>{te(ke,1,`refine-button ${i(n)?"dark-mode":""} ${i(ge)?"loading":""}`),ke.disabled=i(ge)||!i(le)}),N(M,O)};K(wt,M=>{b(d()),z(()=>d().enableEnhanceWithAi)&&M(Wt)})}var Mt=oe(wt,2);{var Vn=M=>{var O=jb(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`refine-success ${i(n)?"dark-mode":""}`),de(ce,i(Te))}),N(M,O)};K(Mt,M=>{i(R)&&!i(he)&&M(Vn)})}var P=oe(Mt,2);{var J=M=>{var O=Ob(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`refine-error ${i(n)?"dark-mode":""}`),de(ce,i(he))}),N(M,O)};K(P,M=>{i(he)&&M(J)})}S(H),ae(()=>{te(H,1,`container ${i(n)?"dark-mode":""}`),te(X,1,`label ${i(n)?"dark-mode":""}`),de(be,`${b(d()),z(()=>d().title)??""} `)}),N(e,H),et()}an(["click"]);var Zb=V("<input/>"),Ub=V("<input/>");function Rb(e,t){Xe(t,!0);let n=w(t,"ref",15,null),r=w(t,"value",15),o=w(t,"files",15),s=w(t,"data-slot",3,"input"),a=Di(t,["$$slots","$$events","$$legacy","ref","value","type","files","class","data-slot"]);var l=De(),c=Ne(l);{var u=m=>{var f=Zb();Wn(f,y=>({"data-slot":s(),class:y,type:"file",...a}),[()=>Fr("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",t.class)],void 0,void 0,!0),pr(f,y=>n(y),()=>n()),tv(f,o),Ai(f,r),N(m,f)},d=m=>{var f=Ub();Wn(f,y=>({"data-slot":s(),class:y,type:t.type,...a}),[()=>Fr("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",t.class)],void 0,void 0,!0),pr(f,y=>n(y),()=>n()),Ai(f,r),N(m,f)};K(c,m=>{t.type==="file"?m(u):m(d,!1)})}N(e,l),et()}async function Fb(e,t,n,r,o,s,a,l,c,u,d,m,f,y,k,L,$){if(!t())return;const U=i(n);try{h(r,!0),h(o,null);const G=await uc({questionId:s().id,identifier:a(),feedbackConfigurationId:l(),userText:U});if(G?.data?.refinedText){const T=G.data.refinedText;h(c,u()?.otherFields?.aiEnhancementSuccessMessage||G.message||"Text refined successfully"),i(d)?(h(d,{original:i(d).original,enhanced:[...i(d).enhanced,T]}),h(m,i(d).enhanced.length)):(h(d,{original:U,enhanced:[T]}),h(m,1)),h(n,T),h(f,!0);const x=y(T);h(k,x),L()(T),gt(s().id,T,xe.SHORT_ANSWER,x)}else{if(G?.message){const{code:T,message:x,seconds:F}=ac(G.message);T==="1001"&&F!==void 0&&$(F),h(o,cc(T,x,u(),F))}h(f,!1)}}catch(G){console.error("Error enhancing text:",G),h(o,"An error occurred while enhancing text!"),h(f,!1)}finally{h(r,!1)}}function Wb(e,t,n,r,o,s,a,l){if(!i(t))return;const c=i(t).original;h(n,c),h(r,0);const u=o(c);h(s,u),a()(c),gt(l().id,c,xe.SHORT_ANSWER,u)}var Qb=V("<div><span> </span></div>"),Vb=V('<span class="required">*</span>'),Gb=V("<div> </div>"),Yb=V("<div> </div>"),Bb=V("<div> </div>"),Hb=((e,t,n)=>{i(t)>0&&n(i(t)-1)}),Jb=(e,t,n,r)=>{const o=t();i(n)<o-1&&r(i(n)+1)},Kb=V('<div class="version-navigation"><button type="button" title="Previous version"><!></button> <button type="button" title="Next version"><!></button></div>'),Xb=V('<button type="button" title="Back to original text"><!></button>'),e0=V("<!> <!>",1),t0=V('<div class="refine-text-section"><div class="button-group"><button type="button" title="Enhance with AI"><!></button> <!></div></div>'),n0=V("<div> </div>"),r0=V("<div> </div>"),o0=V('<div><div class="question-header"><div class="question-title-row"><!> <div class="title-and-description"><label> <!></label> <!></div></div> <!></div> <div class="input-container"><!> <!></div> <!> <!> <!></div>');function i0(e,t){Xe(t,!1);const n=Q(),r=Q(),o=Q(),s=Q(),a=Q(),l=Q(),c=Q(),u=Q();let d=w(t,"question",8),m=w(t,"value",8,""),f=w(t,"onChange",8),y=w(t,"error",8,void 0),k=w(t,"currentMode",8,void 0),L=w(t,"questionNumber",8,void 0);w(t,"themeSettings",8,void 0),w(t,"currentLanguage",8,void 0),w(t,"apiKey",8,void 0),w(t,"hostUrl",8,void 0);let $=w(t,"identifier",8,void 0),U=w(t,"feedbackConfigurationId",8,void 0),G=w(t,"otherConfigurationProperties",8,void 0),T=Q(m()||""),x=Q(null),F=Q(0),Z=Q(y()),B=Q(!1),R=Q(!1),ge=Q(!1),he=Q(null),Te=Q(null),ie=Q(!1),le=Q(!1),Y=Q(""),E=Q(0),A=null,C=Q(i(T));Rn(()=>{setTimeout(()=>{const M=q(i(T));h(Z,M),M&&mr(d().id,M),h(ie,!0)},0)}),Co(()=>{A!==null&&clearInterval(A)});function p(){i(B)||h(B,!0)}function v(M){A!==null&&clearInterval(A),A=lc(M,O=>{h(E,O)},()=>{A=null,h(he,null)})}function g(M){if(!i(x))return;let O;if(M===0)O=i(x).original;else{const ke=M-1;if(ke>=i(x).enhanced.length)return;O=i(x).enhanced[ke]}h(T,O),h(F,M);const ce=q(O);h(Z,ce),f()(O),gt(d().id,O,xe.SHORT_ANSWER,ce)}function j(){return i(x)?i(x).enhanced.length+1:0}function q(M){if(d().required&&(!M||M.trim()===""))return d().errorMessage||"This field is required";if(d().maxCharacters!==void 0&&M.length>d().maxCharacters||d().minCharacters!==void 0&&M.length>0&&M.length<d().minCharacters)return d().errorMessage;if(d().enableRegexValidation&&d().regexPattern)try{const O=new RegExp(d().regexPattern);if(M.length>0&&!O.test(M))return d().errorMessage||"Input does not match required pattern"}catch{}}function W(){const M=i(T).trim();return M?d().minCharactersToEnhance!==void 0?M.length>=d().minCharactersToEnhance:!0:!1}ee(()=>b(k()),()=>{h(n,k()==="dark")}),ee(()=>(b(m()),i(T),i(B)),()=>{m()!==void 0&&m()!==i(T)&&!i(B)&&(h(T,m()),h(C,m()))}),ee(()=>i(T),()=>{h(r,i(T).length)}),ee(()=>b(d()),()=>{h(o,d().minCharacters)}),ee(()=>b(d()),()=>{h(s,d().maxCharacters)}),ee(()=>(i(s),i(r)),()=>{h(a,i(s)!==void 0&&i(r)>i(s))}),ee(()=>(i(o),i(r)),()=>{h(l,i(o)!==void 0&&i(r)<i(o)&&i(r)>0)}),ee(()=>(i(a),i(l)),()=>{h(c,i(a)||i(l))}),ee(()=>(i(o),i(s)),()=>{h(u,i(o)!==void 0||i(s)!==void 0)}),ee(()=>(i(T),b(d())),()=>{const M=i(T).trim();M?d().minCharactersToEnhance!==void 0?h(le,M.length>=d().minCharactersToEnhance):h(le,!0):h(le,!1)}),ee(()=>(i(o),i(s),i(r),b(d())),()=>{i(o)!==void 0&&i(s)!==void 0?h(Y,`${i(r)} / (${i(o)} - ${i(s)})`):i(s)!==void 0&&d().required?h(Y,`${i(r)} / (1 - ${i(s)})`):i(o)!==void 0?h(Y,`${i(r)} / (${i(o)} - 5000)`):h(Y,"")}),ee(()=>(i(E),b(G())),()=>{i(E)>0&&G()?.otherFields?.aiEnhancementCooldownErrorMessage&&h(he,`${G().otherFields.aiEnhancementCooldownErrorMessage} (${i(E)}s)`)}),ee(()=>b(y()),()=>{y()!==void 0&&h(Z,y())}),ee(()=>(i(ie),i(B),i(T),i(C),b(f()),b(d()),xe),()=>{if(i(ie)&&i(B)&&i(T)!==i(C)){h(C,i(T));const M=q(i(T));h(Z,M),f()(i(T)),gt(d().id,i(T),xe.SHORT_ANSWER,M)}}),$t(),mt();var H=o0(),ne=I(H),ve=I(ne),ue=I(ve);{var we=M=>{var O=Qb(),ce=I(O),ke=I(ce);S(ce),S(O),ae(()=>{te(O,1,`question-number ${i(n)?"dark-mode":""}`),de(ke,`${L()??""}.`)}),N(M,O)};K(ue,M=>{L()!==void 0&&M(we)})}var re=oe(ue,2),X=I(re),be=I(X),Se=oe(be);{var _e=M=>{var O=Vb();N(M,O)};K(Se,M=>{b(d()),z(()=>d().required)&&M(_e)})}S(X);var me=oe(X,2);{var He=M=>{var O=Gb(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`description ${i(n)?"dark-mode":""}`),de(ce,(b(d()),z(()=>d().description)))}),N(M,O)};K(me,M=>{b(d()),z(()=>d().description)&&M(He)})}S(re),S(ve);var vt=oe(ve,2);{var bt=M=>{var O=Yb(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`error ${i(n)?"dark-mode":""}`),de(ce,i(Z))}),N(M,O)};K(vt,M=>{i(Z)&&i(B)&&M(bt)})}S(ne);var Ke=oe(ne,2),yt=I(Ke);{let M=Ue(()=>`input shortanswer-input ${i(n)?"dark-mode":""} ${i(u)?"has-char-count":""}`);Rb(yt,{get class(){return i(M)},onfocus:p,get placeholder(){return b(d()),z(()=>d().placeholder)},onblur:()=>{if(i(ie)){const O=q(i(T));h(Z,O),mr(d().id,O)}},get value(){return i(T)},set value(O){h(T,O)},$$legacy:!0})}var Ye=oe(yt,2);{var Qe=M=>{var O=Bb(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`inner-character-count ${i(n)?"dark-mode":""} ${i(c)?"error":""}`),de(ce,i(Y))}),N(M,O)};K(Ye,M=>{i(u)&&M(Qe)})}S(Ke);var wt=oe(Ke,2);{var Wt=M=>{var O=t0(),ce=I(O),ke=I(ce);ke.__click=[Fb,W,T,ge,he,d,$,U,Te,G,x,F,R,q,Z,f,v];var Ae=I(ke);Ul(Ae,{size:16}),S(ke);var kt=oe(ke,2);{var Qt=fn=>{var Gn=e0(),Ot=Ne(Gn);{var yr=ct=>{var We=Kb(),nt=I(We);nt.__click=[Hb,F,g];var Gr=I(nt);ql(Gr,{size:12}),S(nt);var Lt=oe(nt,2);Lt.__click=[Jb,j,F,g];var Yr=I(Lt);No(Yr,{size:12}),S(Lt),S(We),ae(Kt=>{te(nt,1,`version-nav-button ${i(n)?"dark-mode":""}`),nt.disabled=i(F)===0,te(Lt,1,`version-nav-button ${i(n)?"dark-mode":""}`),Lt.disabled=Kt},[()=>(i(F),z(()=>i(F)>=j()-1))]),N(ct,We)};K(Ot,ct=>{i(x),z(()=>i(x)&&i(x).enhanced&&i(x).enhanced.length>1)&&ct(yr)})}var Qr=oe(Ot,2);{var Vr=ct=>{var We=Xb();We.__click=[Wb,x,T,F,q,Z,f,d];var nt=I(We);Ol(nt,{size:16}),S(We),ae(()=>te(We,1,`rollback-button ${i(n)?"dark-mode":""}`)),N(ct,We)};K(Qr,ct=>{i(F)!==0&&ct(Vr)})}N(fn,Gn)};K(kt,fn=>{i(x)&&!i(ge)&&fn(Qt)})}S(ce),S(O),ae(()=>{te(ke,1,`refine-button ${i(n)?"dark-mode":""} ${i(ge)?"loading":""}`),ke.disabled=i(ge)||!i(le)}),N(M,O)};K(wt,M=>{b(d()),z(()=>d().enableEnhanceWithAi)&&M(Wt)})}var Mt=oe(wt,2);{var Vn=M=>{var O=n0(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`refine-success ${i(n)?"dark-mode":""}`),de(ce,i(Te))}),N(M,O)};K(Mt,M=>{i(R)&&!i(he)&&M(Vn)})}var P=oe(Mt,2);{var J=M=>{var O=r0(),ce=I(O,!0);S(O),ae(()=>{te(O,1,`refine-error ${i(n)?"dark-mode":""}`),de(ce,i(he))}),N(M,O)};K(P,M=>{i(he)&&M(J)})}S(H),ae(()=>{te(H,1,`container ${i(n)?"dark-mode":""}`),te(X,1,`label ${i(n)?"dark-mode":""}`),de(be,`${b(d()),z(()=>d().title)??""} `)}),N(e,H),et()}an(["click"]);var s0=V("<div><span> </span></div>"),a0=V('<span class="required">*</span>'),l0=V("<div> </div>"),c0=(e,t,n)=>t(i(n).value),u0=V('<span class="radio__indicator"></span>'),d0=V('<div><label class="radio mc-single-radio-item"><input type="radio" style="display: none;"/> <span><!></span> <span> </span></label></div>'),f0=V('<div class="radio-group"></div>'),p0=(e,t,n)=>t(i(n).value),h0=V('<button type="button"> </button>'),m0=V('<div class="list-group"></div>'),g0=(e,t,n)=>t(i(n).value),v0=(e,t,n)=>e.key==="Enter"&&t(i(n).value),b0=V('<div role="button" tabindex="0"> </div>'),y0=V('<div class="list-options"></div>'),w0=V("<div> </div>"),k0=V('<div><div class="question-header"><div class="question-title-row"><!> <div class="title-and-description"><label> <!></label> <!></div></div></div> <!> <!></div>');function _0(e,t){Xe(t,!1);const n=Q();let r=w(t,"question",8),o=w(t,"value",8,""),s=w(t,"onChange",8),a=w(t,"error",8,void 0),l=w(t,"currentMode",8,void 0),c=w(t,"questionNumber",8,void 0);w(t,"themeSettings",8,void 0),w(t,"currentLanguage",8,void 0);let u=Q(o()||"");function d(ie){i(u)===ie?(h(u,""),s()("")):(h(u,ie),s()(ie))}ee(()=>b(l()),()=>{h(n,l()==="dark")}),ee(()=>b(o()),()=>{o()!==void 0&&h(u,o())}),$t(),mt();var m=k0(),f=I(m),y=I(f),k=I(y);{var L=ie=>{var le=s0(),Y=I(le),E=I(Y);S(Y),S(le),ae(()=>{te(le,1,`question-number ${i(n)?"dark-mode":""}`),de(E,`${c()??""}.`)}),N(ie,le)};K(k,ie=>{c()!==void 0&&ie(L)})}var $=oe(k,2),U=I($),G=I(U),T=oe(G);{var x=ie=>{var le=a0();N(ie,le)};K(T,ie=>{b(r()),z(()=>r().required)&&ie(x)})}S(U);var F=oe(U,2);{var Z=ie=>{var le=l0(),Y=I(le,!0);S(le),ae(()=>{te(le,1,`description ${i(n)?"dark-mode":""}`),de(Y,(b(r()),z(()=>r().description)))}),N(ie,le)};K(F,ie=>{b(r()),z(()=>r().description)&&ie(Z)})}S($),S(y),S(f);var B=oe(f,2);{var R=ie=>{var le=f0();zt(le,5,()=>(b(r()),z(()=>r().options)),jt,(Y,E)=>{var A=d0(),C=I(A),p=I(C);Ei(p),p.__change=[c0,d,E];var v=oe(p,2),g=I(v);{var j=H=>{var ne=u0();N(H,ne)};K(g,H=>{i(u),i(E),z(()=>i(u)===i(E).value)&&H(j)})}S(v);var q=oe(v,2),W=I(q,!0);S(q),S(C),S(A),ae(()=>{te(A,1,`${i(n)?"dark-mode":""}`),Fn(p,"name",(b(r()),z(()=>r().id))),Cl(p,(i(E),z(()=>i(E).value))),zl(p,(i(u),i(E),z(()=>i(u)===i(E).value))),te(v,1,(i(u),i(E),z(()=>`radio__control mc-single-radio-control ${i(u)===i(E).value?"selected":""}`))),te(q,1,`radio__label mc-single-radio-label${i(n)?" dark-mode":""}`),de(W,(i(E),z(()=>i(E).label)))}),N(Y,A)}),S(le),N(ie,le)},ge=ie=>{var le=De(),Y=Ne(le);{var E=C=>{var p=m0();zt(p,5,()=>(b(r()),z(()=>r().options)),jt,(v,g)=>{var j=h0();j.__click=[p0,d,g];var q=I(j,!0);S(j),ae(()=>{te(j,1,(i(u),i(g),i(n),z(()=>`list-item mc-single-chip-item ${i(u)===i(g).value?"selected":""} ${i(n)?"dark-mode":""}`))),de(q,(i(g),z(()=>i(g).label)))}),N(v,j)}),S(p),N(C,p)},A=C=>{var p=De(),v=Ne(p);{var g=j=>{var q=y0();zt(q,5,()=>(b(r()),z(()=>r().options)),jt,(W,H,ne)=>{var ve=b0();ve.__click=[g0,d,H],ve.__keydown=[v0,d,H];var ue=I(ve,!0);S(ve),ae(()=>{te(ve,1,(i(u),i(H),b(r()),i(n),z(()=>`mc-single-list-item ${i(u)===i(H).value?"selected":""} ${ne===r().options.length-1?"last-item":""} ${i(n)?"dark-mode":""}`))),de(ue,(i(H),z(()=>i(H).label)))}),N(W,ve)}),S(q),N(j,q)};K(v,j=>{b(r()),z(()=>r().displayStyle==="list")&&j(g)},!0)}N(C,p)};K(Y,C=>{b(r()),z(()=>r().displayStyle==="chip")?C(E):C(A,!1)},!0)}N(ie,le)};K(B,ie=>{b(r()),z(()=>r().displayStyle==="radio"||!r().displayStyle)?ie(R):ie(ge,!1)})}var he=oe(B,2);{var Te=ie=>{var le=w0(),Y=I(le,!0);S(le),ae(()=>{te(le,1,`error ${i(n)?"dark-mode":""}`),de(Y,a())}),N(ie,le)};K(he,ie=>{a()&&ie(Te)})}S(m),ae(()=>{te(m,1,`container ${i(n)?"dark-mode":""}`),te(U,1,`label ${i(n)?"dark-mode":""}`),de(G,`${b(r()),z(()=>r().title)??""} `)}),N(e,m),et()}an(["change","click","keydown"]);var x0=V("<div><span> </span></div>"),$0=V('<span class="required">*</span>'),S0=V("<div> </div>"),T0=(e,t,n)=>t(i(n)),I0=V('<button type="button" class="rating-button"><span> </span></button>'),C0=V("<span> </span>"),z0=V("<span> </span>"),M0=V('<div class="rating-labels"><!> <!></div>'),L0=V("<div> </div>"),N0=V('<div><div class="question-header"><div class="question-title-row"><!> <div class="title-and-description"><label> <!></label> <!></div></div></div> <div class="rating-container"><div class="rating-icons"></div> <!></div> <!></div>');function E0(e,t){Xe(t,!1);const n=Q(),r=Q();let o=w(t,"question",8),s=w(t,"value",8,0),a=w(t,"onChange",8),l=w(t,"error",8,void 0),c=w(t,"currentMode",8,void 0),u=w(t,"questionNumber",8,void 0),d=w(t,"themeSettings",8,void 0);w(t,"currentLanguage",8,void 0);let m=Q(s()??0),f=Q(s()??0),y=Q(0);function k(p){i(f)===p?(h(m,0),h(f,0),a()(0),Zi(o().id)):(h(m,p),h(f,p),a()(p))}function L(p,v,g){const{displayStyle:j="star",representationSize:q="medium",numberOfRatings:W=5,color:H}=o(),ne=v>=p,ve=v===p,ue=g===p,we=`rating-icon ${q}-size ${ne?"selected":""} ${i(n)?"dark-mode":""}`,re=j==="emoji"||j==="thumbs-up",X=H??i(r)?.brandColor??"var(--brand-color)";let be="";if(re){const _e=i(r)?.brandColor??"var(--brand-color)";be=`background-color: ${ve||ue?_e:""}; border: var(--rating-border-width) solid ${ve||ue?X:"transparent"}; transition: background-color 0.15s ease, border-color 0.15s ease;`}else be=`color: ${ne?X:i(n)?"#4b5563":"#d1d5db"}; transition: color 0.25s ease;`;if(j==="emoji"){const _e=["😡","😞","😕","😐","🙂","😊","😄","😁","🤩","😍"],me=Math.floor((p-1)*(_e.length/W)),He=Math.min(Math.max(me,0),_e.length-1);return{content:_e[He],type:"emoji",style:be,baseClass:`${we} rating-${j}-icon`}}const Se={star:"★",heart:"♥","thumbs-up":"👍",diamond:"◆"}[j];return Se?{content:Se,type:j,style:be,baseClass:`${we} rating-${j}-icon`}:null}ee(()=>b(c()),()=>{h(n,c()==="dark")}),ee(()=>(b(d()),b(c())),()=>{h(r,d()?.[c()==="dark"?"dark":"light"]||null)}),ee(()=>b(s()),()=>{s()!==void 0&&(h(m,s()),h(f,s()))}),$t(),mt();var $=N0(),U=I($),G=I(U),T=I(G);{var x=p=>{var v=x0(),g=I(v),j=I(g);S(g),S(v),ae(()=>{te(v,1,`question-number ${i(n)?"dark-mode":""}`),de(j,`${u()??""}.`)}),N(p,v)};K(T,p=>{u()!==void 0&&p(x)})}var F=oe(T,2),Z=I(F),B=I(Z),R=oe(B);{var ge=p=>{var v=$0();N(p,v)};K(R,p=>{b(o()),z(()=>o().required)&&p(ge)})}S(Z);var he=oe(Z,2);{var Te=p=>{var v=S0(),g=I(v,!0);S(v),ae(()=>{te(v,1,`description ${i(n)?"dark-mode":""}`),de(g,(b(o()),z(()=>o().description)))}),N(p,v)};K(he,p=>{b(o()),z(()=>o().description)&&p(Te)})}S(F),S(G),S(U);var ie=oe(U,2),le=I(ie);zt(le,5,()=>(b(o()),z(()=>Array.from({length:o().numberOfRatings??5},(p,v)=>v+1))),jt,(p,v)=>{const g=Ue(()=>(i(v),i(m),i(y),z(()=>L(i(v),i(m),i(y)))));var j=De(),q=Ne(j);{var W=H=>{var ne=I0();ne.__click=[T0,k,v];var ve=I(ne),ue=I(ve,!0);S(ve),S(ne),ae(()=>{te(ve,1,zi((b(i(g)),z(()=>i(g).baseClass)))),fr(ve,(b(i(g)),z(()=>i(g).style))),de(ue,(b(i(g)),z(()=>i(g).content)))}),Ti("mouseenter",ne,()=>{h(m,i(v)),h(y,i(v))}),Ti("mouseleave",ne,()=>{h(y,0),h(m,i(f))}),N(H,ne)};K(q,H=>{i(g)&&H(W)})}N(p,j)}),S(le);var Y=oe(le,2);{var E=p=>{var v=M0(),g=I(v);{var j=H=>{var ne=C0(),ve=I(ne,!0);S(ne),ae(()=>{te(ne,1,`rating-label ${i(n)?"dark-mode":""}`),de(ve,(b(o()),z(()=>o().minLabel)))}),N(H,ne)};K(g,H=>{b(o()),z(()=>o().minLabel)&&H(j)})}var q=oe(g,2);{var W=H=>{var ne=z0(),ve=I(ne,!0);S(ne),ae(()=>{te(ne,1,`rating-label ${i(n)?"dark-mode":""}`),de(ve,(b(o()),z(()=>o().maxLabel)))}),N(H,ne)};K(q,H=>{b(o()),z(()=>o().maxLabel)&&H(W)})}S(v),N(p,v)};K(Y,p=>{b(o()),z(()=>o().showLabels)&&p(E)})}S(ie);var A=oe(ie,2);{var C=p=>{var v=L0(),g=I(v,!0);S(v),ae(()=>{te(v,1,`error ${i(n)?"dark-mode":""}`),de(g,l())}),N(p,v)};K(A,p=>{l()&&p(C)})}S($),ae(()=>{te($,1,`container ${i(n)?"dark-mode":""}`),te(Z,1,`label ${i(n)?"dark-mode":""}`),de(B,`${b(o()),z(()=>o().title)??""} `)}),N(e,$),et()}an(["click"]);var A0=V("<div><span> </span></div>"),P0=V('<span class="required">*</span>'),j0=V("<div> </div>"),O0=V("<div> </div>"),D0=V("<div> </div>"),q0=(e,t,n)=>t(i(n).value),Z0=V('<label class="checkbox"><input type="checkbox" class="checkbox__input"/> <span><!></span> <span> </span></label>'),U0=V('<div class="checkbox-group"></div>'),R0=(e,t,n)=>t(i(n).value),F0=V('<button type="button"> </button>'),W0=V('<div class="list-group"></div>'),Q0=(e,t,n)=>t(i(n).value),V0=V('<button type="button"> </button>'),G0=V('<div class="list-options"></div>'),Y0=V('<div><div class="question-header"><div class="question-title-row"><!> <div class="title-and-description"><label> <!></label> <!></div></div> <!> <!></div> <!></div>');function B0(e,t){Xe(t,!1);const n=Q();let r=w(t,"question",8),o=w(t,"value",24,()=>[]),s=w(t,"onChange",8),a=w(t,"error",8,void 0),l=w(t,"currentMode",8,void 0),c=w(t,"questionNumber",8,void 0);w(t,"themeSettings",8,void 0),w(t,"currentLanguage",8,void 0);let u=Q(o()||[]),d=Q(a()),m=Q(void 0),f=!1,y=Q(!1);Rn(()=>{setTimeout(()=>{const v=k(i(u));h(d,v),v&&mr(r().id,v),f=!0},0)});function k(v){if(r().required&&(!v||v.length===0))return r().errorMessage;const g=r().maxSelections;if(g!==void 0&&v.length>g)return r().errorMessage;const j=r().minSelections;if(j!==void 0&&v.length>0&&v.length<j)return r().errorMessage}function L(v){if(!f)return;h(y,!0);const g=[...i(u)];if(g.includes(v)){const j=g.filter(W=>W!==v);h(u,j),s()(j),h(m,void 0);const q=k(j);h(d,q),gt(r().id,j,xe.MULTIPLE_CHOICE_MULTIPLE,q)}else{const j=r().maxSelections;if(j!==void 0&&g.length>=j){const q=r().errorMessage;h(m,q),gt(r().id,g,xe.MULTIPLE_CHOICE_MULTIPLE,void 0)}else{const q=[...g,v];h(u,q),s()(q),h(m,void 0);const W=k(q);h(d,W),gt(r().id,q,xe.MULTIPLE_CHOICE_MULTIPLE,W)}}}ee(()=>b(l()),()=>{h(n,l()==="dark")}),ee(()=>(b(o()),i(y)),()=>{o()!==void 0&&!i(y)&&h(u,o())}),ee(()=>b(a()),()=>{a()!==void 0&&h(d,a())}),$t(),mt();var $=Y0(),U=I($),G=I(U),T=I(G);{var x=v=>{var g=A0(),j=I(g),q=I(j);S(j),S(g),ae(()=>{te(g,1,`question-number ${i(n)?"dark-mode":""}`),de(q,`${c()??""}.`)}),N(v,g)};K(T,v=>{c()!==void 0&&v(x)})}var F=oe(T,2),Z=I(F),B=I(Z),R=oe(B);{var ge=v=>{var g=P0();N(v,g)};K(R,v=>{b(r()),z(()=>r().required)&&v(ge)})}S(Z);var he=oe(Z,2);{var Te=v=>{var g=j0(),j=I(g,!0);S(g),ae(()=>{te(g,1,`description ${i(n)?"dark-mode":""}`),de(j,(b(r()),z(()=>r().description)))}),N(v,g)};K(he,v=>{b(r()),z(()=>r().description)&&v(Te)})}S(F),S(G);var ie=oe(G,2);{var le=v=>{var g=O0(),j=I(g,!0);S(g),ae(()=>{te(g,1,`error ${i(n)?"dark-mode":""}`),de(j,i(d))}),N(v,g)};K(ie,v=>{i(d)&&v(le)})}var Y=oe(ie,2);{var E=v=>{var g=D0(),j=I(g,!0);S(g),ae(()=>{te(g,1,`error ${i(n)?"dark-mode":""}`),de(j,i(m))}),N(v,g)};K(Y,v=>{i(m)&&v(E)})}S(U);var A=oe(U,2);{var C=v=>{var g=U0();zt(g,5,()=>(b(r()),z(()=>r().options)),jt,(j,q)=>{var W=Z0(),H=I(W);Ei(H),H.__change=[q0,L,q];var ne=oe(H,2),ve=I(ne);{var ue=X=>{Dl(X,{size:16,color:"#fff"})};K(ve,X=>{i(u),i(q),z(()=>i(u).includes(i(q).value))&&X(ue)})}S(ne);var we=oe(ne,2),re=I(we,!0);S(we),S(W),ae((X,be)=>{Fn(H,"name",(b(r()),z(()=>r().id))),Cl(H,(i(q),z(()=>i(q).value))),zl(H,X),te(ne,1,be),te(we,1,`checkbox__label mc-multiple-checkbox-label ${i(n)?"dark-mode":""}`),de(re,(i(q),z(()=>i(q).label)))},[()=>(i(u),i(q),z(()=>i(u).includes(i(q).value))),()=>(i(u),i(q),z(()=>`checkbox__control ${i(u).includes(i(q).value)?"selected":""}`))]),N(j,W)}),S(g),N(v,g)},p=v=>{var g=De(),j=Ne(g);{var q=H=>{var ne=W0();zt(ne,5,()=>(b(r()),z(()=>r().options)),jt,(ve,ue)=>{var we=F0();we.__click=[R0,L,ue];var re=I(we,!0);S(we),ae(X=>{te(we,1,X),de(re,(i(ue),z(()=>i(ue).label)))},[()=>(i(u),i(ue),i(n),z(()=>`list-item mc-multiple-chip-item ${i(u).includes(i(ue).value)?"selected":""} ${i(n)?"dark-mode":""}`))]),N(ve,we)}),S(ne),N(H,ne)},W=H=>{var ne=De(),ve=Ne(ne);{var ue=we=>{var re=G0();zt(re,5,()=>(b(r()),z(()=>r().options)),jt,(X,be,Se)=>{var _e=V0();_e.__click=[Q0,L,be];var me=I(_e,!0);S(_e),ae(He=>{te(_e,1,He),de(me,(i(be),z(()=>i(be).label)))},[()=>(i(u),i(be),b(r()),i(n),z(()=>`list-option-button mc-multiple-list-item ${i(u).includes(i(be).value)?"selected":""} ${Se===r().options.length-1?"last-item":""} ${i(n)?"dark-mode":""}`))]),N(X,_e)}),S(re),N(we,re)};K(ve,we=>{b(r()),z(()=>r().displayStyle==="list")&&we(ue)},!0)}N(H,ne)};K(j,H=>{b(r()),z(()=>r().displayStyle==="chip")?H(q):H(W,!1)},!0)}N(v,g)};K(A,v=>{b(r()),z(()=>r().displayStyle==="checkbox"||!r().displayStyle)?v(C):v(p,!1)})}S($),ae(()=>{te($,1,`container ${i(n)?"dark-mode":""}`),te(Z,1,`label ${i(n)?"dark-mode":""}`),de(B,`${b(r()),z(()=>r().title)??""} `)}),N(e,$),et()}an(["change","click"]);function H0(e,t,n,r,o,s,a,l){i(t)||h(t,!0),h(n,!1),h(r,void 0),o()(void 0);const c=s(void 0);h(a,c),gt(l().id,void 0,xe.ANNOTATION,c)}var J0=V("<div><span> </span></div>"),K0=V('<span class="required">*</span>'),X0=V("<div> </div>"),ey=V("<div> </div>"),ty=V('<div><div class="annotation-content"><!> <span class="annotation-title"> </span></div></div>'),ny=V('<div><div class="annotation-content"><!> <span class="annotation-title"> </span></div> <button type="button" aria-label="Remove annotation"><!></button></div>'),ry=V('<div><div class="question-header"><div class="question-title-row"><!> <div class="title-and-description"><div> <!></div> <!></div></div> <!></div> <div class="annotation-upload-container"><!> <!></div></div>');function oy(e,t){Xe(t,!1);const n=Q();let r=w(t,"question",8),o=w(t,"value",8,void 0),s=w(t,"onChange",8),a=w(t,"error",8,void 0),l=w(t,"currentMode",8,void 0),c=w(t,"questionNumber",8,void 0);w(t,"themeSettings",8,void 0),w(t,"currentLanguage",8,void 0);let u=Q(!1),d=Q(void 0),m=Q(a()),f=Q(!1);Rn(()=>{const C=Zr(Ft).questions.find(p=>p.questionId===r().id);if(C?.answer&&"annotation"in C.answer){const p=C.answer.annotation;console.log("Found annotation data in store on mount for question:",r().id,p),h(d,p),h(u,!0),typeof p=="object"&&p!==null&&s()(p)}setTimeout(()=>{const p=i(d),v=y(p);h(m,v),v&&mr(r().id,v)},0)});function y(C){let p="";if(typeof C=="string"?p=C:C&&typeof C=="object"&&(p="has_annotation_data"),r().required&&(!p||p.trim()===""))return r().errorMessage??"This field is required"}ee(()=>b(l()),()=>{h(n,l()==="dark")}),ee(()=>(b(o()),b(s())),()=>{if(o()!==void 0){if(console.log("props.value changed:",o()),typeof o()=="string"){const C=o().trim()!=="";h(u,C),h(d,o())}else if(typeof o()=="object"&&o()!==null&&"annotation"in o()){const C=o().annotation;console.log("Extracted annotation from props.value:",C),h(u,!0),h(d,C),s()(C)}}else h(d,void 0),h(u,!1)}),ee(()=>b(a()),()=>{a()!==void 0&&h(m,a())}),$t(),mt();var k=ry(),L=I(k),$=I(L),U=I($);{var G=C=>{var p=J0(),v=I(p),g=I(v);S(v),S(p),ae(()=>{te(p,1,`question-number ${i(n)?"dark-mode":""}`),de(g,`${c()??""}.`)}),N(C,p)};K(U,C=>{c()!==void 0&&C(G)})}var T=oe(U,2),x=I(T),F=I(x),Z=oe(F);{var B=C=>{var p=K0();N(C,p)};K(Z,C=>{b(r()),z(()=>r().required)&&C(B)})}S(x);var R=oe(x,2);{var ge=C=>{var p=X0(),v=I(p,!0);S(p),ae(()=>{te(p,1,`description ${i(n)?"dark-mode":""}`),de(v,(b(r()),z(()=>r().description)))}),N(C,p)};K(R,C=>{b(r()),z(()=>r().description)&&C(ge)})}S(T),S($);var he=oe($,2);{var Te=C=>{var p=ey(),v=I(p,!0);S(p),ae(()=>{te(p,1,`error ${i(n)?"dark-mode":""}`),de(v,i(m))}),N(C,p)};K(he,C=>{i(m)&&i(f)&&C(Te)})}S(L);var ie=oe(L,2),le=I(ie);{var Y=C=>{var p=ty(),v=I(p),g=I(v);Zl(g,{size:20,class:"annotation-icon"});var j=oe(g,2),q=I(j,!0);S(j),S(v),S(p),ae(()=>{te(p,1,`annotation-box no-annotation ${i(n)?"dark-mode":""}`),de(q,(b(r()),z(()=>r().noAnnotationText??"No Annotation")))}),N(C,p)};K(le,C=>{i(u)||C(Y)})}var E=oe(le,2);{var A=C=>{var p=ny(),v=I(p),g=I(v);Zl(g,{size:20,class:"annotation-icon"});var j=oe(g,2),q=I(j,!0);S(j),S(v);var W=oe(v,2);W.__click=[H0,f,u,d,s,y,m,r];var H=I(W);Rl(H,{size:16}),S(W),S(p),ae(()=>{te(p,1,`annotation-box has-annotation ${i(n)?"dark-mode":""}`),de(q,(b(r()),z(()=>r().annotationText??"Annotation"))),te(W,1,`annotation-close-btn ${i(n)?"dark-mode":""}`)}),N(C,p)};K(E,C=>{i(u)&&C(A)})}S(ie),S(k),ae(()=>{te(k,1,`container ${i(n)?"dark-mode":""}`),te(x,1,`label ${i(n)?"dark-mode":""}`),de(F,`${b(r()),z(()=>r().title)??""} `)}),N(e,k),et()}an(["click"]);var iy=V("<p> </p>"),sy=V('<div><div class="welcome-content"><h2> </h2> <!></div></div>');function ay(e,t){Xe(t,!1);const n=Q(),r=Q();let o=w(t,"welcomeScreenProperties",8);w(t,"onStart",8,void 0);let s=w(t,"currentMode",8,void 0),a=w(t,"currentLanguage",8,void 0);w(t,"themeSettings",8,void 0),ee(()=>b(s()),()=>{h(n,s()==="dark")}),ee(()=>(b(o()),b(a())),()=>{h(r,o().translations&&a()&&o().translations[a()]?o().translations[a()]:o().welcomeFields??{title:"Welcome to our survey!",description:"We value your feedback and appreciate your time.",buttonLabel:"Start"})}),$t(),mt();var l=sy(),c=I(l),u=I(c),d=I(u,!0);S(u);var m=oe(u,2);{var f=y=>{var k=iy(),L=I(k,!0);S(k),ae(()=>{te(k,1,`welcome-description ${i(n)?"dark-mode":""}`),de(L,(i(r),z(()=>i(r).description)))}),N(y,k)};K(m,y=>{i(r),z(()=>i(r).description)&&y(f)})}S(c),S(l),ae(()=>{te(l,1,`container welcome-container ${i(n)?"dark-mode":""}`),te(u,1,`welcome-title ${i(n)?"dark-mode":""}`),de(d,(i(r),z(()=>i(r).title)))}),N(e,l),et()}var ly=V("<p> </p>"),cy=V("<div><div><h2> </h2> <!></div></div>");function uy(e,t){Xe(t,!1);const n=Q(),r=Q(),o=Q(),s=Q(),a=Q();let l=w(t,"endScreenProperties",8),c=w(t,"onExit",8,void 0),u=w(t,"currentMode",8,void 0),d=w(t,"currentLanguage",8,void 0);w(t,"themeSettings",8,void 0);let m=w(t,"isScreenVisible",8,void 0);console.log("isScreenVisible in end-screen :",m()===!0);let f=Q(null);Co(()=>{i(f)!==null&&(clearTimeout(i(f)),console.log("Cleared auto-dismiss timer on destroy"))}),ee(()=>b(u()),()=>{h(n,u()==="dark")}),ee(()=>(b(l()),b(d())),()=>{h(r,l().translations&&d()&&l().translations[d()]?l().translations[d()]:l().endFields??{title:"Thank you for participating!",message:"Your feedback is important to us.",buttonLabel:"Exit",dismissBehavior:"close",fadeDuration:300})}),ee(()=>b(m()),()=>{h(o,m()===!0)}),ee(()=>b(l()),()=>{h(s,l().endFields?.dismissBehavior)}),ee(()=>b(l()),()=>{h(a,l().endFields?.fadeDuration||0)}),ee(()=>(i(f),i(o),i(s),b(c()),i(a)),()=>{i(f)!==null&&(clearTimeout(i(f)),h(f,null),console.log("Cleared auto-dismiss timer")),i(o)&&i(s)==="fade"&&typeof c()=="function"&&i(a)>0?(console.log(`Setting up auto-dismiss timer for ${i(a)} seconds as user has reached end-screen with ${i(s)} behavior`),h(f,setTimeout(()=>{console.log("Auto-dismissing end screen"),c()?.()},i(a)*1e3))):console.log("Not setting up auto-dismiss timer - conditions not met:",{isScreenVisible:i(o),dismissBehavior:i(s),hasOnExit:typeof c()=="function",fadeDuration:i(a)})}),$t(),mt();var y=cy(),k=I(y),L=I(k),$=I(L,!0);S(L);var U=oe(L,2);{var G=T=>{var x=ly(),F=I(x,!0);S(x),ae(()=>{te(x,1,`end-description ${i(n)?"dark-mode":""}`),de(F,(i(r),z(()=>i(r).message)))}),N(T,x)};K(U,T=>{i(r),z(()=>i(r).message)&&T(G)})}S(k),S(y),ae(()=>{te(y,1,`container end-container ${i(n)?"dark-mode":""}`),te(k,1,`end-content ${i(n)?"dark-mode":""}`),te(L,1,`end-title ${i(n)?"dark-mode":""}`),de($,(i(r),z(()=>i(r).title)))}),N(e,y),et()}var dy=V("<h2> </h2>"),fy=V('<div class="question-wrapper"><div class="question-container"><!></div></div>'),py=V("<!> <!>",1),hy=V('<div id="section-container"><!> <!> <!></div>');function my(e,t){Xe(t,!1);const n=Q(),r=Q();let o=w(t,"questions",8),s=w(t,"sections",8),a=w(t,"formData",8),l=w(t,"errors",8),c=w(t,"onChange",8),u=w(t,"currentMode",8,void 0),d=w(t,"welcomeScreenProperties",8),m=w(t,"otherConfigurationProperties",8),f=w(t,"currentSectionIndex",8),y=w(t,"endScreenProperties",8,void 0),k=w(t,"currentLanguage",8,void 0),L=w(t,"themeSettings",8),$=w(t,"onClose",8,void 0),U=w(t,"isScreenVisible",8,void 0),G=w(t,"apiKey",8,void 0),T=w(t,"hostUrl",8,void 0),x=w(t,"identifier",8,void 0),F=w(t,"feedbackConfigurationId",8,void 0);function Z(E){return i(n).get(E)??-1}function B(E){switch(E){case xe.MULTIPLE_CHOICE_MULTIPLE:return[];case xe.NPS:case xe.RATING:return-1;case xe.SHORT_ANSWER:case xe.LONG_TEXT:case xe.SINGLE_CHOICE:return"";default:return}}function R(E){return Array.isArray(E)?E:typeof E=="object"&&E!==null?Object.values(E).filter(A=>A!==void 0):typeof E=="string"?[E]:[]}function ge(E){return typeof E=="number"?E:typeof E=="string"?Number(E):0}function he(E){return typeof E=="string"?E:String(typeof E=="object"&&E!==null?Object.values(E)[0]||"":E||"")}function Te(E,A){if(E==null){const C=B(A);return C!==void 0?C:E}switch(A){case xe.MULTIPLE_CHOICE_MULTIPLE:return R(E);case xe.NPS:case xe.RATING:return ge(E);case xe.SINGLE_CHOICE:return he(E);default:return E}}ee(()=>(b(o()),Fl),()=>{o()&&Object.keys(o()).length>0&&Fl(o())}),ee(()=>b(s()),()=>{h(n,(()=>{const E=new Map;let A=0;return s().forEach(C=>{C.id!=="welcome_screen"&&C.id!=="thankyou_screen"&&C.questionIds.forEach(p=>{E.set(p,A++)})}),E})())}),ee(()=>(b(s()),b(f())),()=>{h(r,s()[f()])}),ee(()=>(b(f()),i(r)),()=>{console.log("FormRenderer: currentSectionIndex =",f(),"section =",i(r)?.id)}),$t(),mt();var ie=De(),le=Ne(ie);{var Y=E=>{var A=De(),C=Ne(A);zt(C,1,()=>(b(s()),b(f()),z(()=>[s()[f()]])),p=>p.id,(p,v)=>{var g=hy(),j=I(g);{var q=ue=>{ay(ue,{get welcomeScreenProperties(){return d()},get currentMode(){return u()},get currentLanguage(){return k()},get themeSettings(){return L()}})};K(j,ue=>{i(v),z(()=>i(v).id==="welcome_screen")&&ue(q)})}var W=oe(j,2);{var H=ue=>{{let we=Ue(()=>y()?y():{});uy(ue,{get endScreenProperties(){return i(we)},get onExit(){return $()},get currentMode(){return u()},get currentLanguage(){return k()},get themeSettings(){return L()},get isScreenVisible(){return U()}})}};K(W,ue=>{i(v),z(()=>i(v).id==="thankyou_screen")&&ue(H)})}var ne=oe(W,2);{var ve=ue=>{var we=py(),re=Ne(we);{var X=Se=>{var _e=dy(),me=I(_e,!0);S(_e),ae(()=>{te(_e,1,`section-title ${u()==="dark"?"dark-mode":""}`),de(me,(i(v),z(()=>i(v).title)))}),N(Se,_e)};K(re,Se=>{b(m()),z(()=>m().isEnabled&&m().otherFields.pageTitle)&&Se(X)})}var be=oe(re,2);zt(be,1,()=>(i(v),z(()=>i(v).questionIds)),jt,(Se,_e)=>{const me=Ue(()=>(b(Wl),i(_e),z(()=>Wl(i(_e)))));var He=De(),vt=Ne(He);{var bt=Ke=>{const yt=Ue(()=>(b(m()),z(()=>m()?.isEnabled&&m().otherFields.questionNumber))),Ye=Ue(()=>(b(i(me)),z(()=>Z(i(me).id)))),Qe=Ue(()=>(b(i(me)),b(a()),b(c()),b(l()),b(u()),b(k()),b(L()),b(i(yt)),b(i(Ye)),z(()=>({question:i(me),value:Te(a()[i(me).id],i(me).type),onChange:J=>c()(i(me).id,J,i(me).type),error:l()[i(me).id],currentMode:u(),currentLanguage:k(),themeSettings:L(),questionNumber:i(yt)?i(Ye)+1:void 0}))));var wt=fy(),Wt=I(wt),Mt=I(Wt);{var Vn=J=>{Cv(J,ft(()=>i(Qe),{get question(){return i(me)}}))},P=J=>{var M=De(),O=Ne(M);{var ce=Ae=>{Uv(Ae,ft(()=>i(Qe),{get question(){return i(me)}}))},ke=Ae=>{var kt=De(),Qt=Ne(kt);{var fn=Ot=>{qb(Ot,ft(()=>i(Qe),{get question(){return i(me)},get apiKey(){return G()},get hostUrl(){return T()},get identifier(){return x()},get feedbackConfigurationId(){return F()},get otherConfigurationProperties(){return m()}}))},Gn=Ot=>{var yr=De(),Qr=Ne(yr);{var Vr=We=>{i0(We,ft(()=>i(Qe),{get question(){return i(me)},get apiKey(){return G()},get hostUrl(){return T()},get identifier(){return x()},get feedbackConfigurationId(){return F()},get otherConfigurationProperties(){return m()}}))},ct=We=>{var nt=De(),Gr=Ne(nt);{var Lt=Kt=>{_0(Kt,ft(()=>i(Qe),{get question(){return i(me)}}))},Yr=Kt=>{var yc=De(),Gy=Ne(yc);{var Yy=wr=>{E0(wr,ft(()=>i(Qe),{get question(){return i(me)}}))},By=wr=>{var wc=De(),Hy=Ne(wc);{var Jy=kr=>{B0(kr,ft(()=>i(Qe),{get question(){return i(me)}}))},Ky=kr=>{var kc=De(),Xy=Ne(kc);{var ew=Ki=>{oy(Ki,ft(()=>i(Qe),{get question(){return i(me)}}))};K(Xy,Ki=>{b(i(me)),b(xe),z(()=>i(me).type===xe.ANNOTATION)&&Ki(ew)},!0)}N(kr,kc)};K(Hy,kr=>{b(i(me)),b(xe),z(()=>i(me).type===xe.MULTIPLE_CHOICE_MULTIPLE)?kr(Jy):kr(Ky,!1)},!0)}N(wr,wc)};K(Gy,wr=>{b(i(me)),b(xe),z(()=>i(me).type===xe.RATING)?wr(Yy):wr(By,!1)},!0)}N(Kt,yc)};K(Gr,Kt=>{b(i(me)),b(xe),z(()=>i(me).type===xe.SINGLE_CHOICE)?Kt(Lt):Kt(Yr,!1)},!0)}N(We,nt)};K(Qr,We=>{b(i(me)),b(xe),z(()=>i(me).type===xe.SHORT_ANSWER)?We(Vr):We(ct,!1)},!0)}N(Ot,yr)};K(Qt,Ot=>{b(i(me)),b(xe),z(()=>i(me).type===xe.LONG_TEXT)?Ot(fn):Ot(Gn,!1)},!0)}N(Ae,kt)};K(O,Ae=>{b(i(me)),b(xe),z(()=>i(me).type===xe.NESTED_SELECTION)?Ae(ce):Ae(ke,!1)},!0)}N(J,M)};K(Mt,J=>{b(i(me)),b(xe),z(()=>i(me).type===xe.NPS)?J(Vn):J(P,!1)})}S(Wt),S(wt),N(Ke,wt)};K(vt,Ke=>{i(me)&&Ke(bt)})}N(Se,He)}),N(ue,we)};K(ne,ue=>{i(v),z(()=>i(v).id!=="welcome_screen"&&i(v).id!=="thankyou_screen")&&ue(ve)})}S(g),N(p,g)}),N(E,A)};K(le,E=>{b(f()),b(s()),z(()=>f()<s().length&&s().length>0)&&E(Y)})}N(e,ie),et()}var gy=/\s+/g,Bi=e=>typeof e!="string"||!e?e:e.replace(gy," ").trim(),Oo=(...e)=>{let t=[],n=r=>{if(!r&&r!==0&&r!==0n)return;if(Array.isArray(r)){for(let s=0,a=r.length;s<a;s++)n(r[s]);return}let o=typeof r;if(o==="string"||o==="number"||o==="bigint"){if(o==="number"&&r!==r)return;t.push(String(r))}else if(o==="object"){let s=Object.keys(r);for(let a=0,l=s.length;a<l;a++){let c=s[a];r[c]&&t.push(c)}}};for(let r=0,o=e.length;r<o;r++){let s=e[r];s!=null&&n(s)}return t.length>0?Bi(t.join(" ")):void 0},dc=e=>e===!1?"false":e===!0?"true":e===0?"0":e,Tt=e=>{if(!e||typeof e!="object")return!0;for(let t in e)return!1;return!0},vy=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++){let s=n[o];if(!r.includes(s)||e[s]!==t[s])return!1}return!0},fc=(e,t)=>{for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n];n in e?e[n]=Oo(e[n],r):e[n]=r}return e},pc=(e,t)=>{for(let n=0;n<e.length;n++){let r=e[n];Array.isArray(r)?pc(r,t):r&&t.push(r)}},hc=(...e)=>{let t=[];pc(e,t);let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},Hi=(e,t)=>{let n={};for(let r in e){let o=e[r];if(r in t){let s=t[r];Array.isArray(o)||Array.isArray(s)?n[r]=hc(s,o):typeof o=="object"&&typeof s=="object"&&o&&s?n[r]=Hi(o,s):n[r]=s+" "+o}else n[r]=o}for(let r in t)r in e||(n[r]=t[r]);return n},by={twMerge:!0,twMergeConfig:{},responsiveVariants:!1};function yy(){let e=null,t={},n=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(r){e=r},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(r){t=r},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(r){n=r},reset(){e=null,t={},n=!1}}}var dn=yy(),wy=e=>{let t=(n,r)=>{let{extend:o=null,slots:s={},variants:a={},compoundVariants:l=[],compoundSlots:c=[],defaultVariants:u={}}=n,d={...by,...r},m=o?.base?Oo(o.base,n?.base):n?.base,f=o?.variants&&!Tt(o.variants)?Hi(a,o.variants):a,y=o?.defaultVariants&&!Tt(o.defaultVariants)?{...o.defaultVariants,...u}:u;!Tt(d.twMergeConfig)&&!vy(d.twMergeConfig,dn.cachedTwMergeConfig)&&(dn.didTwMergeConfigChange=!0,dn.cachedTwMergeConfig=d.twMergeConfig);let k=Tt(o?.slots),L=Tt(s)?{}:{base:Oo(n?.base,k&&o?.base),...s},$=k?L:fc({...o?.slots},Tt(L)?{base:n?.base}:L),U=Tt(o?.compoundVariants)?l:hc(o?.compoundVariants,l),G=x=>{if(Tt(f)&&Tt(s)&&k)return e(m,x?.class,x?.className)(d);if(U&&!Array.isArray(U))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof U}`);if(c&&!Array.isArray(c))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof c}`);let F=(Y,E,A=[],C)=>{let p=A;if(typeof E=="string"){let v=Bi(E).split(" ");for(let g=0;g<v.length;g++)p.push(`${Y}:${v[g]}`)}else if(Array.isArray(E))for(let v=0;v<E.length;v++)p.push(`${Y}:${E[v]}`);else if(typeof E=="object"&&typeof C=="string"&&C in E){let v=E[C];if(v&&typeof v=="string"){let g=Bi(v).split(" "),j=[];for(let q=0;q<g.length;q++)j.push(`${Y}:${g[q]}`);p[C]=p[C]?p[C].concat(j):j}else if(Array.isArray(v)&&v.length>0){let g=[];for(let j=0;j<v.length;j++)g.push(`${Y}:${v[j]}`);p[C]=g}}return p},Z=(Y,E=f,A=null,C=null)=>{let p=E[Y];if(!p||Tt(p))return null;let v=C?.[Y]??x?.[Y];if(v===null)return null;let g=dc(v),j=Array.isArray(d.responsiveVariants)&&d.responsiveVariants.length>0||d.responsiveVariants===!0,q=y?.[Y],W=[];if(typeof g=="object"&&j)for(let[ve,ue]of Object.entries(g)){let we=p[ue];if(ve==="initial"){q=ue;continue}Array.isArray(d.responsiveVariants)&&!d.responsiveVariants.includes(ve)||(W=F(ve,we,W,A))}let H=g!=null&&typeof g!="object"?g:dc(q),ne=p[H||"false"];return typeof W=="object"&&typeof A=="string"&&W[A]?fc(W,ne):W.length>0?(W.push(ne),A==="base"?W.join(" "):W):ne},B=()=>{if(!f)return null;let Y=Object.keys(f),E=[];for(let A=0;A<Y.length;A++){let C=Z(Y[A],f);C&&E.push(C)}return E},R=(Y,E)=>{if(!f||typeof f!="object")return null;let A=[];for(let C in f){let p=Z(C,f,Y,E),v=Y==="base"&&typeof p=="string"?p:p&&p[Y];v&&A.push(v)}return A},ge={};for(let Y in x){let E=x[Y];E!==void 0&&(ge[Y]=E)}let he=(Y,E)=>{let A=typeof x?.[Y]=="object"?{[Y]:x[Y]?.initial}:{};return{...y,...ge,...A,...E}},Te=(Y=[],E)=>{let A=[],C=Y.length;for(let p=0;p<C;p++){let{class:v,className:g,...j}=Y[p],q=!0,W=he(null,E);for(let H in j){let ne=j[H],ve=W[H];if(Array.isArray(ne)){if(!ne.includes(ve)){q=!1;break}}else{if((ne==null||ne===!1)&&(ve==null||ve===!1))continue;if(ve!==ne){q=!1;break}}}q&&(v&&A.push(v),g&&A.push(g))}return A},ie=Y=>{let E=Te(U,Y);if(!Array.isArray(E))return E;let A={},C=e;for(let p=0;p<E.length;p++){let v=E[p];if(typeof v=="string")A.base=C(A.base,v)(d);else if(typeof v=="object")for(let g in v)A[g]=C(A[g],v[g])(d)}return A},le=Y=>{if(c.length<1)return null;let E={},A=he(null,Y);for(let C=0;C<c.length;C++){let{slots:p=[],class:v,className:g,...j}=c[C];if(!Tt(j)){let q=!0;for(let W in j){let H=A[W],ne=j[W];if(H===void 0||(Array.isArray(ne)?!ne.includes(H):ne!==H)){q=!1;break}}if(!q)continue}for(let q=0;q<p.length;q++){let W=p[q];E[W]||(E[W]=[]),E[W].push([v,g])}}return E};if(!Tt(s)||!k){let Y={};if(typeof $=="object"&&!Tt($)){let E=e;for(let A in $)Y[A]=C=>{let p=ie(C),v=le(C);return E($[A],R(A,C),p?p[A]:void 0,v?v[A]:void 0,C?.class,C?.className)(d)}}return Y}return e(m,B(),Te(U),x?.class,x?.className)(d)},T=()=>{if(!(!f||typeof f!="object"))return Object.keys(f)};return G.variantKeys=T(),G.extend=o,G.base=m,G.slots=$,G.variants=f,G.defaultVariants=y,G.compoundSlots=c,G.compoundVariants=U,G};return{tv:t,createTV:n=>(r,o)=>t(r,o?Hi(n,o):n)}},ky=e=>Tt(e)?sc:wb({...e,extend:{theme:e.theme,classGroups:e.classGroups,conflictingClassGroupModifiers:e.conflictingClassGroupModifiers,conflictingClassGroups:e.conflictingClassGroups,...e.extend}}),_y=(...e)=>t=>{let n=Oo(e);return!n||!t.twMerge?n:((!dn.cachedTwMerge||dn.didTwMergeConfigChange)&&(dn.didTwMergeConfigChange=!1,dn.cachedTwMerge=ky(dn.cachedTwMergeConfig)),dn.cachedTwMerge(n)||void 0)},{tv:xy}=wy(_y);const mc=xy({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 $y=V("<a><!></a>"),Sy=V("<button><!></button>");function Wr(e,t){Xe(t,!0);let n=w(t,"variant",3,"default"),r=w(t,"size",3,"default"),o=w(t,"ref",15,null),s=w(t,"href",3,void 0),a=w(t,"type",3,"button"),l=Di(t,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children","onclick"]);var c=De(),u=Ne(c);{var d=f=>{var y=$y();Wn(y,L=>({"data-slot":"button",class:L,href:t.disabled?void 0:s(),"aria-disabled":t.disabled,role:t.disabled?"link":void 0,tabindex:t.disabled?-1:void 0,...l}),[()=>Fr(mc({variant:n(),size:r()}),t.class)]);var k=I(y);yl(k,()=>t.children??Vt),S(y),pr(y,L=>o(L),()=>o()),N(f,y)},m=f=>{var y=Sy();Wn(y,L=>({"data-slot":"button",class:L,type:a(),disabled:t.disabled,onclick:t.onclick,...l}),[()=>Fr(mc({variant:n(),size:r()}),t.class)]);var k=I(y);yl(k,()=>t.children??Vt),S(y),pr(y,L=>o(L),()=>o()),N(f,y)};K(u,f=>{s()?f(d):f(m,!1)})}N(e,c),et()}var Ty=V('<span class="button-text svelte-a2vhnq"> </span>'),Iy=V('<div class="centered-button-container svelte-a2vhnq"><!></div>'),Cy=V('<span class="button-text svelte-a2vhnq"> </span>'),zy=V('<div class="centered-button-container svelte-a2vhnq"><!></div>'),My=V('<span class="button-text svelte-a2vhnq"> </span>'),Ly=V('<div class="button-loading-container svelte-a2vhnq"><div class="button-spinner svelte-a2vhnq"></div></div>'),Ny=V('<span class="button-text svelte-a2vhnq"> </span>'),Ey=V("<div><!></div>"),Ay=V('<span class="button-text svelte-a2vhnq"> </span>'),Py=V("<!> <!>",1),jy=V('<div class="navigation-buttons navigation-buttons-container svelte-a2vhnq"><!></div>');function Oy(e,t){Xe(t,!1);const n=Q(),r=Q(),o=Q(),s=Q(),a=Q(),l=Q();let c=w(t,"isWelcomeScreen",8),u=w(t,"isThankYouScreen",8),d=w(t,"isFirstSection",8),m=w(t,"isFirstPageAfterWelcome",8,!1),f=w(t,"isLastSection",8),y=w(t,"welcomeScreenProperties",8),k=w(t,"endScreenProperties",8,void 0),L=w(t,"otherConfigurationProperties",8),$=w(t,"currentMode",8),U=w(t,"currentLanguage",8),G=w(t,"handlePrevious",8),T=w(t,"handleNext",8),x=w(t,"handleSubmit",8),F=w(t,"onClose",8,void 0);w(t,"themeSettings",8);let Z=w(t,"nextButtonDisabled",8,!1),B=w(t,"submitButtonDisabled",8,!1),R=w(t,"isSinglePageSurvey",8,!1),ge=Q(!1);const he=()=>{console.log("Exit button clicked"),F()&&F()()},Te=()=>{if(!u()&&!k()?.isEnabled){h(ge,!0),window.setTimeout(()=>{h(ge,!1),F()&&F()()},3e3);try{x()()}catch(p){console.error("Error during form submission:",p)}}else x()()},ie=()=>{console.log("handlePreviousClick called"),gv(),G()()},le=()=>{console.log("handleNextClick called"),T()()};ee(()=>(b(L()),b(U())),()=>{h(n,(()=>{const p={previousButtonLabel:"Previous",nextButtonLabel:"Next",submitButtonLabel:"Submit"};return L().isEnabled?L().translations&&U()&&L().translations[U()]?L().translations[U()]:L().otherFields??p:p})())}),ee(()=>(b(y()),b(U())),()=>{h(r,y().translations&&U()&&y().translations[U()]?y().translations[U()]:y().welcomeFields??{title:"Welcome to our survey!",description:"We value your feedback and appreciate your time.",buttonLabel:"Start"})}),ee(()=>(b(k()),b(U())),()=>{h(o,k()?.translations&&U()&&k().translations[U()]?k().translations[U()]:k()?.endFields??{buttonLabel:"Exit",dismissBehavior:"close"})}),ee(()=>b($()),()=>{h(s,$()==="dark")}),ee(()=>b(Z()),()=>{h(a,qi()||Z())}),ee(()=>b(B()),()=>{h(l,qi()||B())}),ee(()=>(b(Z()),b(B()),i(a),i(l)),()=>{console.log("NavigationButtons disabled state:",{nextButtonDisabled:Z(),submitButtonDisabled:B(),hasValidationErrors:qi(),isNextDisabled:i(a),isSubmitDisabled:i(l)})}),ee(()=>(b(c()),b(u()),b(f())),()=>{console.log("NavigationButtons: isWelcomeScreen =",c(),"isThankYouScreen =",u(),"isLastSection =",f())}),$t(),mt();var Y=jy(),E=I(Y);{var A=p=>{var v=Iy(),g=I(v);Wr(g,{onclick:le,class:"custom-button nav-button-primary",children:(j,q)=>{var W=Ty(),H=I(W,!0);S(W),ae(()=>de(H,(i(r),z(()=>i(r).buttonLabel)))),N(j,W)},$$slots:{default:!0}}),S(v),N(p,v)},C=p=>{var v=De(),g=Ne(v);{var j=W=>{var H=zy(),ne=I(H);Wr(ne,{onclick:()=>he(),class:"custom-button nav-button-primary",children:(ve,ue)=>{var we=Cy(),re=I(we,!0);S(we),ae(()=>de(re,(i(o),z(()=>i(o).buttonLabel)))),N(ve,we)},$$slots:{default:!0}}),S(H),N(W,H)},q=W=>{var H=Py(),ne=Ne(H);{var ve=X=>{{let be=Ue(()=>d()||m()),Se=Ue(()=>`custom-button nav-button-secondary ${i(s)?"dark-mode":""}`);Wr(X,{onclick:()=>ie(),get disabled(){return i(be)},get class(){return i(Se)},children:(_e,me)=>{var He=My(),vt=I(He,!0);S(He),ae(()=>de(vt,(i(n),z(()=>i(n).previousButtonLabel)))),N(_e,He)},$$slots:{default:!0}})}};K(ne,X=>{R()||X(ve)})}var ue=oe(ne,2);{var we=X=>{var be=Ey(),Se=I(be);{let _e=Ue(()=>i(l)||i(ge));Wr(Se,{onclick:()=>Te(),get disabled(){return i(_e)},class:"custom-button nav-button-primary",children:(me,He)=>{var vt=De(),bt=Ne(vt);{var Ke=Ye=>{var Qe=Ly();N(Ye,Qe)},yt=Ye=>{var Qe=Ny(),wt=I(Qe,!0);S(Qe),ae(()=>de(wt,(i(n),z(()=>i(n).submitButtonLabel)))),N(Ye,Qe)};K(bt,Ye=>{i(ge)?Ye(Ke):Ye(yt,!1)})}N(me,vt)},$$slots:{default:!0}})}S(be),ae(()=>te(be,1,zi(R()?"centered-button-container":"right-aligned-button-container"),"svelte-a2vhnq")),N(X,be)},re=X=>{var be=De(),Se=Ne(be);{var _e=me=>{Wr(me,{onclick:le,get disabled(){return i(a)},class:"custom-button nav-button-primary",children:(He,vt)=>{var bt=Ay(),Ke=I(bt,!0);S(bt),ae(()=>de(Ke,(i(n),z(()=>i(n).nextButtonLabel)))),N(He,bt)},$$slots:{default:!0}})};K(Se,me=>{R()||me(_e)},!0)}N(X,be)};K(ue,X=>{f()?X(we):X(re,!1)})}N(W,H)};K(g,W=>{u()?W(j):W(q,!1)},!0)}N(p,v)};K(E,p=>{c()?p(A):p(C,!1)})}S(Y),N(e,Y),et()}var Dy=V('<div class="progress-container progress-container-styles"><div class="progress-bar progress-bar-styles"></div></div>');function qy(e,t){let n=w(t,"percentage",8);var r=Dy(),o=I(r);S(r),ae(()=>fr(o,`--progress-width: ${n()??""}%;`)),N(e,r)}var Zy=V('<div class="branding-container"><img alt="encatch Logo" class="branding-logo h-5 w-5"/> <p>Powered by encatch</p></div>'),Uy=V('<div id="encatch-form-id"><!> <div class="form-content-container custom-scrollbar"><!></div> <!> <!></div>');function Ji(e,t){Xe(t,!1);const n=()=>rv(Ft,"$formResponses",r),[r,o]=ov(),s=Q(),a=Q(),l=Q(),c=Q(),u=Q(),d=Q(),m=Q(),f=Q(),y=Q();let k=w(t,"theme",28,()=>({dark:{brandColor:"#000",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000"},light:{brandColor:"#fff",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff"}})),L=w(t,"currentMode",12,"light"),$=w(t,"currentLanguage",28,()=>({value:"en",label:"en"})),U=w(t,"questions",28,()=>({})),G=w(t,"questionLanguages",28,()=>[]),T=w(t,"otherConfigurationProperties",12,null),x=w(t,"welcomeScreenProperties",12,null),F=w(t,"endScreenProperties",12,null),Z=w(t,"translations",28,()=>({})),B=w(t,"sections",24,()=>[]),R=w(t,"themeSettings",12,null),ge=w(t,"onClose",12,void 0),he=w(t,"onSectionChange",8,void 0),Te=w(t,"apiKey",8,void 0),ie=w(t,"hostUrl",8,void 0),le=w(t,"feedbackConfigId",8,void 0),Y=w(t,"identifier",8,void 0),E=Q(0),A=Q(0),C=Q(!1),p=Q({}),v=Q((()=>{let P=[...B()||[]];const J=x()?.isEnabled??!0,M=F()?.isEnabled??!0;return J&&P.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),M&&P.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),P})()),g=Q(!1);const j=()=>{const P=window;return typeof window<"u"&&P.encatchAnnotate!==void 0&&typeof P.encatchAnnotate=="object"&&P.encatchAnnotate!==null&&typeof P.encatchAnnotate.getAnnotation=="function"},q=()=>{if(j()){const P=window;console.log("Encatch Annotate plugin is available",j());const J=P.encatchAnnotate?.getAnnotation?.();console.log("Annotation Data from App.tsx:",J),J?(console.log("Found annotation data in App.tsx:",J),Object.entries(U()).forEach(([M,O])=>{O.type===xe.ANNOTATION&&(console.log(`Updating annotation question ${M} with data:`,J),gt(M,J,xe.ANNOTATION))})):(console.log("No annotation data found in App.tsx"),console.log("Annotation Data:",J))}},W=(P,J,M,O,ce="")=>P.map(ke=>{let Ae=ce?`${ce}.children.${ke.id}.label`:`option.${ke.id}.label`,kt=O[J]?.[M]?.[Ae],Qt={...ke};return kt&&(Qt.label=kt),ke.children&&ke.children.length>0&&(Qt.children=W(ke.children,J,M,O,ce?`${ce}.children.${ke.id}`:`option.${ke.id}`)),Qt}),H=P=>{const J=Z()||{},M=Object.fromEntries(Object.entries(U()).map(([O,ce])=>{const ke=J[O]?.[P]||{};let Ae={...ce};return ke.title&&(Ae.title=ke.title),ke.description&&(Ae.description=ke.description),ke.errorMessage&&(Ae.errorMessage=ke.errorMessage),ke.placeholder&&(Ae.placeholder=ke.placeholder),ke.minLabel&&(Ae.minLabel=ke.minLabel),ke.maxLabel&&(Ae.maxLabel=ke.maxLabel),ke.annotationText&&(Ae.annotationText=ke.annotationText),ke.noAnnotationText&&(Ae.noAnnotationText=ke.noAnnotationText),ce.options&&Array.isArray(ce.options)&&(Ae.options=W(ce.options,O,P,J)),[O,Ae]}));U(M)},ne=()=>i(v).reduce((P,J)=>P+J.questionIds.length,0),ve=()=>n().questions.filter(P=>{try{if(P.type===xe.SHORT_ANSWER){if(!P.answer||typeof P.answer!="object")return!1;const J=P.answer.shortAnswer;if(J==null||typeof J=="string"&&J.trim()==="")return!1}if(P.type===xe.LONG_TEXT){if(!P.answer||typeof P.answer!="object")return!1;const J=P.answer.longText;if(J==null||typeof J=="string"&&J.trim()==="")return!1}return!0}catch(J){return console.error("Error checking answer:",P.questionId,J),!0}}).length,ue=()=>(console.log("answeredQuestions",ve(),"totalQuestions",ne()),ve()/ne()*100),we=(P,J,M)=>{let O=J;Array.isArray(J)&&(O=[...J]),gt(P,O,M),h(p,{...i(p),[P]:""})},re=()=>{if(i(A)>0){const P=i(A)-1;h(A,P),he()?.(P)}},X=()=>{if(console.log("handleNext called, currentSectionIndex:",i(A)),console.log("internalSections.length:",i(v).length),i(A)<i(v).length-1){const P=i(A)+1;console.log("Setting currentSectionIndex to:",P),h(A,P),console.log("After assignment, currentSectionIndex:",i(A)),he()?.(P)}else console.log("Cannot navigate next: already at last section")},be=()=>{console.log("Form submitted:",n().questions);const P=i(v).findIndex(J=>J.id==="thankyou_screen");P!==-1&&(h(A,P),he()?.(P)),h(C,!0),window.encatch?._internal?.submitFeedback?(console.log("$formResponses.questions:",JSON.stringify(n().questions,null,2)),console.log("First question answer:",n().questions[0]?.answer),window.encatch._internal.submitFeedback({response:{questions:n().questions},action:"S",feedbackConfigurationId:le()||"",feedbackIdentifier:Y()||"",duration:0})):console.error("window.encatch._internal.submitFeedback is not available")},Se=()=>{ge()?.()},_e=()=>n().questions.reduce((P,J)=>{if(J.answer)switch(J.type){case xe.RATING:P[J.questionId]=J.answer.rating;break;case xe.NPS:P[J.questionId]=J.answer.nps;break;case xe.LONG_TEXT:P[J.questionId]=J.answer.longText;break;case xe.SHORT_ANSWER:P[J.questionId]=J.answer.shortAnswer;break;case xe.SINGLE_CHOICE:P[J.questionId]=J.answer.singleChoice;break;case xe.MULTIPLE_CHOICE_MULTIPLE:P[J.questionId]=[...J.answer.multipleChoiceMultiple||[]];break;case xe.NESTED_SELECTION:P[J.questionId]=[...J.answer.nestedSelection||[]];break;default:P[J.questionId]=J.answer}else P[J.questionId]=null;return P},{}),me=()=>i(v)[i(A)]?.id==="thankyou_screen",He=()=>i(A)===0&&i(v)[0]?.id==="welcome_screen",vt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMDAgMTAwMDsiIAogIGhlaWdodD0iMjAiCiAgd2lkdGg9IjIwIgogIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMzODQ4OUQ7fQoJLnN0MXtmaWxsOiMxRjFCNEY7fQoJLnN0MntmaWxsOiNGN0I5Mjg7fQoJLnN0M3tmaWxsOiMwMEI4N0E7fQoJLnN0NHtmaWxsOiNFMDI0NUU7fQoJLnN0NXtmaWxsOiNGRkZGRkY7fQoJLnN0NntmaWxsOiNGOEZFRkY7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDUiIGQ9Ik00MDQuOCwyMTAuOEMzMDkuMSwyNDEuOSwyMzQsMzE3LjYsMjAzLjIsNDEzLjRjLTYxLjMsMTkwLjEsNDcuOSwzNjguNSwyMTIuNSw0MjBjNS43LDEuOCwxMS42LTIuNSwxMS42LTguNQoJCXYtNjkuN2MwLTMuNi0yLjItNi44LTUuNi04LjJDMzMyLjQsNzEwLjcsMjY5LjMsNjIzLDI2OS4zLDUyMC44YzAtMTM0LjcsMTA5LjYtMjQ0LjIsMjQ0LjItMjQ0LjJjMTE5LjMsMCwyMTguOCw4NS43LDIzOS45LDE5OC45CgkJYzAuMywxLjktMS4xLDMuNi0zLDMuNmgtMzcuNGMtOC44LDAtMTUuOSw3LjEtMTUuOSwxNS45djQ3LjJjMCwxMS4xLDMuOSwyMC42LDE1LDIwLjZsNDUuNi0wLjNoNDEuN3YtMC4yaDM0LjEKCQljNC4yLDAsNy42LTMuNCw3LjYtNy42di0zMy44Qzg0MS4xLDMwNC45LDYzMS40LDEzNy4yLDQwNC44LDIxMC44eiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTI2NSw3MTYuOGwtMTUuNCwxMTYuNmMtMC40LDIuOCwyLjUsNC45LDUsMy43TDM2OCw3ODUuN2MyLjYtMS4yLDIuOC00LjcsMC41LTYuMmwtOTcuOS02NS4yCgkJQzI2OC40LDcxMi44LDI2NS40LDcxNC4xLDI2NSw3MTYuOHoiLz4KCTxwYXRoIGNsYXNzPSJzdDUiIGQ9Ik02NjYuMyw1NjMuM2gtNzguNmMtMi41LDAtNC41LTItNC41LTQuNXYtNzguNmMwLTIuNSwyLTQuNSw0LjUtNC41aDc4LjZjMi41LDAsNC41LDIsNC41LDQuNXY3OC42CgkJQzY3MC45LDU2MS4yLDY2OC44LDU2My4zLDY2Ni4zLDU2My4zeiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTQ0NC4yLDU2My4zaC03Ni41Yy0zLjEsMC01LjUtMi41LTUuNS01LjV2LTc2LjVjMC0zLjEsMi41LTUuNSw1LjUtNS41aDc2LjVjMy4xLDAsNS41LDIuNSw1LjUsNS41djc2LjUKCQlDNDQ5LjcsNTYwLjgsNDQ3LjIsNTYzLjMsNDQ0LjIsNTYzLjN6Ii8+Cgk8cGF0aCBjbGFzcz0ic3Q1IiBkPSJNNTU1LjMsNTYzLjNoLTc3LjZjLTIuOCwwLTUtMi4zLTUtNXYtNzcuNmMwLTIuOCwyLjMtNSw1LTVoNzcuNmMyLjgsMCw1LDIuMyw1LDV2NzcuNgoJCUM1NjAuMyw1NjEsNTU4LDU2My4zLDU1NS4zLDU2My4zeiIvPgoJPHBhdGggY2xhc3M9InN0NSIgZD0iTTY4My45LDI1NC45Yy0xODMuOS0xMTMuMi00MzUuMi0zNi41LTQ5MS4zLDE5NWMtMjMuNyw5Ny44LDEuNSwyMDEuNCw2Ni45LDI3Ny45CgkJYzEyOS44LDE1MS44LDMzOSwxNTIuMyw0NjkuMSwzOS4xYzQuNS0zLjksMy45LTExLjItMS4yLTE0LjNsLTU5LjMtMzYuNWMtMy4xLTEuOS03LTEuNy05LjksMC41Yy03Ny43LDU3LTE4NS41LDY0LjgtMjcyLjUsMTEuMwoJCWMtMTE0LjgtNzAuNi0xNTAuNi0yMjEuMy04MC0zMzZjNjIuNS0xMDEuNiwxODcuNy0xNDEuNCwyOTUuMS0xMDAuMSIvPgo8L2c+Cjwvc3ZnPgo=",bt="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDEwMDAgMTAwMDsiIAogIGhlaWdodD0iMjAiCiAgd2lkdGg9IjIwIgogIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMzODQ4OUQ7fQoJLnN0MXtmaWxsOiMxRjFCNEY7fQoJLnN0MntmaWxsOiNGN0I5Mjg7fQoJLnN0M3tmaWxsOiMwMEI4N0E7fQoJLnN0NHtmaWxsOiNFMDI0NUU7fQoJLnN0NXtmaWxsOiNGRkZGRkY7fQoJLnN0NntmaWxsOiNGOEZFRkY7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0zODEuOSwxOTkuNmMtOTUuNywzMS4xLTE3MC44LDEwNi44LTIwMS43LDIwMi42Yy02MS4zLDE5MC4xLDQ3LjksMzY4LjUsMjEyLjUsNDIwYzUuNywxLjgsMTEuNi0yLjUsMTEuNi04LjUKCQlWNzQ0YzAtMy42LTIuMi02LjgtNS42LTguMmMtODkuMy0zNi4zLTE1Mi40LTEyNC4xLTE1Mi40LTIyNi4yYzAtMTM0LjcsMTA5LjYtMjQ0LjIsMjQ0LjItMjQ0LjJjMTE5LjMsMCwyMTguOCw4NS43LDIzOS45LDE5OC45CgkJYzAuMywxLjktMS4xLDMuNi0zLDMuNmgtMzcuNGMtOC44LDAtMTUuOSw3LjEtMTUuOSwxNS45VjUzMWMwLDExLjEsMy45LDIwLjYsMTUsMjAuNmw0NS42LTAuM2g0MS43di0wLjJoMzQuMQoJCWM0LjIsMCw3LjYtMy40LDcuNi03LjZ2LTMzLjhDODE4LjIsMjkzLjcsNjA4LjUsMTI2LDM4MS45LDE5OS42eiIvPgoJPHBhdGggY2xhc3M9InN0MSIgZD0iTTI0Mi4xLDcwNS42bC0xNS40LDExNi42Yy0wLjQsMi44LDIuNSw0LjksNSwzLjdMMzQ1LDc3NC41YzIuNi0xLjIsMi44LTQuNywwLjUtNi4yTDI0Ny42LDcwMwoJCUMyNDUuNCw3MDEuNiwyNDIuNCw3MDIuOSwyNDIuMSw3MDUuNnoiLz4KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik02NDMuNCw1NTIuMWgtNzguNmMtMi41LDAtNC41LTItNC41LTQuNXYtNzguNmMwLTIuNSwyLTQuNSw0LjUtNC41aDc4LjZjMi41LDAsNC41LDIsNC41LDQuNXY3OC42CgkJQzY0Ny45LDU1MCw2NDUuOSw1NTIuMSw2NDMuNCw1NTIuMXoiLz4KCTxwYXRoIGNsYXNzPSJzdDMiIGQ9Ik00MjEuMiw1NTIuMWgtNzYuNWMtMy4xLDAtNS41LTIuNS01LjUtNS41VjQ3MGMwLTMuMSwyLjUtNS41LDUuNS01LjVoNzYuNWMzLjEsMCw1LjUsMi41LDUuNSw1LjV2NzYuNQoJCUM0MjYuOCw1NDkuNiw0MjQuMyw1NTIuMSw0MjEuMiw1NTIuMXoiLz4KCTxwYXRoIGNsYXNzPSJzdDQiIGQ9Ik01MzIuMyw1NTIuMWgtNzcuNmMtMi44LDAtNS0yLjMtNS01di03Ny42YzAtMi44LDIuMy01LDUtNWg3Ny42YzIuOCwwLDUsMi4zLDUsNVY1NDcKCQlDNTM3LjQsNTQ5LjgsNTM1LjEsNTUyLjEsNTMyLjMsNTUyLjF6Ii8+Cgk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNNjYxLDI0My42Yy0xODMuOS0xMTMuMi00MzUuMi0zNi41LTQ5MS4zLDE5NWMtMjMuNyw5Ny44LDEuNSwyMDEuNCw2Ni45LDI3Ny45CgkJYzEyOS44LDE1MS44LDMzOSwxNTIuMyw0NjkuMSwzOS4xYzQuNS0zLjksMy45LTExLjItMS4yLTE0LjNsLTU5LjMtMzYuNWMtMy4xLTEuOS03LTEuNy05LjksMC41Yy03Ny43LDU3LTE4NS41LDY0LjgtMjcyLjUsMTEuMwoJCWMtMTE0LjgtNzAuNi0xNTAuNi0yMjEuMy04MC0zMzZDMzQ1LjIsMjc5LDQ3MC40LDIzOS4yLDU3Ny45LDI4MC41Ii8+CjwvZz4KPC9zdmc+Cg==";Rn(()=>{q(),window.updateEncatchForm=P=>{if(console.log("updateEncatchForm received props:",P),P.theme&&k(P.theme),P.currentMode&&L(P.currentMode),P.currentLanguage&&(console.log("currentLanguage at App.tsx",P.currentLanguage),$(P.currentLanguage),$()?.value&&H($().value)),P.questions&&U(P.questions),P.questionLanguages&&G(P.questionLanguages),P.otherConfigurationProperties&&T(P.otherConfigurationProperties),P.welcomeScreenProperties&&x(P.welcomeScreenProperties),P.endScreenProperties){const J=F()?.isEnabled,M=P.endScreenProperties.isEnabled;if(J&&!M){const O=i(v).findIndex(ce=>ce.id==="thankyou_screen");O===i(A)&&h(A,Math.max(0,O-1))}F(P.endScreenProperties)}if(P.sections){const J=[...P.sections],M=P.welcomeScreenProperties?.isEnabled??x()?.isEnabled??!0,O=P.endScreenProperties?.isEnabled??F()?.isEnabled??!0;M&&!J.some(ce=>ce.id==="welcome_screen")&&J.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),O&&!J.some(ce=>ce.id==="thankyou_screen")&&J.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),h(v,J),M&&i(A)===0&&h(A,0)}P.translations&&(Z(P.translations),$()?.value&&H($().value)),P.themeSettings&&R(P.themeSettings),P.onClose&&ge(P.onClose)}}),ee(()=>(b(R()),b(L())),()=>{if(R()&&R().themes&&L()&&R().themes[L()]){const P=document.documentElement,J=R().themes[L()];J&&(P.style.setProperty("--brand-color",J.brandColor||"#2563eb"),P.style.setProperty("--text-color",J.textColor||"#333"),P.style.setProperty("--background-color",J.backgroundColor||"#ffffff"))}}),ee(()=>b(L()),()=>{h(s,L()==="dark"?vt:bt)}),ee(()=>(b($()),b(x()),b(F()),b(T())),()=>{if($()&&$().value){const P=$().value;H(P),x()?.translations?.[P]&&x({...x(),welcomeFields:{...x().welcomeFields,...x().translations[P]}}),F()?.translations?.[P]&&F({...F(),endFields:{...F().endFields,...F().translations[P]}}),T()?.translations?.[P]&&T({...T(),otherFields:{...T().otherFields,...T().translations[P]}})}}),ee(()=>(b(B()),b(x()),b(F()),i(A),i(g),i(C)),()=>{const P=[...B()];let J=!1;const M=P.some(Ae=>Ae.id==="welcome_screen"),O=P.some(Ae=>Ae.id==="thankyou_screen"),ce=x()?.isEnabled??!0,ke=F()?.isEnabled??!0;if(ce&&!M)P.unshift({id:"welcome_screen",title:"Welcome",questionIds:[]}),J=!0;else if(!ce&&M){const Ae=P.filter(kt=>kt.id!=="welcome_screen");Ae.length!==P.length&&(h(v,Ae),J=!0)}if(ke&&!O)P.push({id:"thankyou_screen",title:"Thank You",questionIds:[]}),J=!0;else if(!ke&&O){const Ae=P.filter(kt=>kt.id!=="thankyou_screen");if(Ae.length!==P.length){const kt=P.findIndex(Qt=>Qt.id==="thankyou_screen");(i(A)===kt||i(A)>=Ae.length)&&h(A,Math.max(0,Ae.length-1)),h(v,Ae),J=!0}}J&&(console.log("REACTIVE BLOCK: sectionUpdated is true"),h(v,P),i(g)||(console.log("REACTIVE BLOCK: Initial setup, setting currentSectionIndex to 0"),!i(C)&&!(!ke&&O)&&h(A,0),h(g,!0)))}),ee(()=>(b(F()),i(A),i(v)),()=>{h(a,F()?.isEnabled&&i(A)===i(v).length-1)}),ee(()=>i(v),()=>{h(l,i(v).filter(P=>P.id!=="welcome_screen"&&P.id!=="thankyou_screen").length===1)}),ee(()=>(i(A),i(v)),()=>{h(c,i(A)===0&&i(v)[0]?.id==="welcome_screen")}),ee(()=>(i(v),i(A)),()=>{h(u,i(v)[i(A)]?.id==="thankyou_screen")}),ee(()=>i(A),()=>{h(d,i(A)===0)}),ee(()=>(i(v),i(A)),()=>{h(m,i(v)[0]?.id==="welcome_screen"&&i(A)===1)}),ee(()=>(i(v),i(A)),()=>{h(f,(()=>{const P=i(v).findIndex(J=>J.id==="thankyou_screen");return P!==-1?i(A)===P-1:i(A)===i(v).length-1})())}),ee(()=>(i(v),i(A),i(c),i(u),n(),b(U())),()=>{h(y,(()=>{const P=i(v)[i(A)];if(!P||i(c)||i(u))return!1;const J=P.questionIds||[],M=n().questions.reduce((O,ce)=>(O[ce.questionId]=ce,O),{});console.log("=== Validation Check ==="),console.log("Current section:",P.id,P.title),console.log("Question IDs in section:",J),console.log("All responses:",M),console.log("All form responses:",n().questions);for(const O of J){const ce=U()[O],ke=!!M[O];if(console.log(`Question ${O}:`,{title:ce?.title,required:ce?.required,hasResponse:ke,response:M[O]}),ce?.required&&!ke)return console.log(`❌ Required question not answered: ${O}`,ce?.title),!0}return console.log("✅ All required questions answered"),!1})())}),ee(()=>i(y),()=>{console.log("App.svelte: _hasUnansweredRequired =",i(y))}),ee(()=>i(A),()=>{console.log("REACTIVE: currentSectionIndex changed to:",i(A))}),ee(()=>n(),()=>{const P=ue();h(E,P),console.log("Form Responses Store Updated:",n()),console.log("Questions answered:",n().questions.length)}),ee(()=>b(U()),()=>{U()&&(console.log("Questions changed"),q())}),ee(()=>i(l),()=>{console.log("Is single page survey:",i(l))}),$t(),mt();var Ke=Uy(),yt=I(Ke);{var Ye=P=>{qy(P,{get percentage(){return i(E)}})};K(yt,P=>{b(R()),z(()=>R()?.featureSettings?.progressBar&&!He()&&!me())&&P(Ye)})}var Qe=oe(yt,2),wt=I(Qe);{let P=Ue(()=>z(_e)),J=Ue(()=>(b($()),z(()=>$()?.value||"en"))),M=Ue(()=>(b(R()),z(()=>R()?.themes||null))),O=Ue(()=>i(a)===!0);my(wt,{get questions(){return U()},get sections(){return i(v)},get formData(){return i(P)},get errors(){return i(p)},onChange:we,get currentMode(){return L()},get currentSectionIndex(){return i(A)},get otherConfigurationProperties(){return T()},get welcomeScreenProperties(){return x()},get endScreenProperties(){return F()},get currentLanguage(){return i(J)},get themeSettings(){return i(M)},onClose:Se,get isScreenVisible(){return i(O)},get apiKey(){return Te()},get feedbackConfigurationId(){return le()},get hostUrl(){return ie()},get identifier(){return Y()}})}S(Qe);var Wt=oe(Qe,2);{let P=Ue(()=>(b($()),z(()=>$()?.value||"en"))),J=Ue(()=>(b(R()),z(()=>R()?.themes||null)));Oy(Wt,{get isWelcomeScreen(){return i(c)},get isThankYouScreen(){return i(u)},get isFirstSection(){return i(d)},get isFirstPageAfterWelcome(){return i(m)},get isLastSection(){return i(f)},get welcomeScreenProperties(){return x()},get endScreenProperties(){return F()},get otherConfigurationProperties(){return T()},get currentMode(){return L()},get currentLanguage(){return i(P)},handlePrevious:re,handleNext:X,handleSubmit:be,onClose:Se,get themeSettings(){return i(J)},get nextButtonDisabled(){return i(y)},get submitButtonDisabled(){return i(y)},get isSinglePageSurvey(){return i(l)}})}var Mt=oe(Wt,2);{var Vn=P=>{var J=Zy(),M=I(J),O=oe(M,2);S(J),ae(()=>{Fn(M,"src",i(s)),te(O,1,`branding-text ${L()==="dark"?"dark-mode":""}`)}),N(P,J)};K(Mt,P=>{b(R()),z(()=>R()?.featureSettings?.showBranding)&&P(Vn)})}S(Ke),ae(()=>te(Ke,1,`encatch-form ${L()==="dark"?"theme-dark dark":"theme-light"}`)),N(e,Ke),et(),o()}var Ry=V('<div class="fixed inset-0 transition-opacity duration-300"></div>'),Fy=V('<button class="absolute top-3 right-3 bg-transparent border-none cursor-pointer z-10 p-2 flex items-center justify-center transition-opacity duration-200 hover:opacity-80 active:scale-95" aria-label="Close popup"><!></button>'),Wy=V('<!> <div id="encatch-feedback-popup" class="rounded-xl shadow-2xl overflow-hidden"><!> <!></div>',1),Qy=V('<link rel="stylesheet" href="http://127.0.0.1:5500/encatch-typescript/packages/web-sdk/public/web-form-engine-core.css"/> <!>',1);function gc(e,t){Xe(t,!1);const n=Q(),r=Q();let o=w(t,"themeMode",8,"light"),s=w(t,"feedbackConfiguration",8,null),a=w(t,"apiKey",8,""),l=w(t,"hostUrl",8,"");w(t,"deviceInfo",8,null),w(t,"sessionId",8,""),w(t,"userInfo",8,null);let c=w(t,"language",8,"en"),u=w(t,"configurationData",8,null),d=w(t,"onClose",8,void 0),m=w(t,"trackPopupHeight",8,void 0),f=w(t,"feedbackConfigId",8,void 0),y=w(t,"identifier",8,void 0),k=Q(document.documentElement.clientWidth),L=Q(!1),$=Q(null),U=!1,G=null,T=Q(),x;const F=()=>{if(i(T)){const le=i(T).querySelector("#section-container");if(le){const Y=window.innerHeight*.75,E=le.clientHeight,A=84,C=60,p=Math.min(E+A+C,Y);i(T).style.transition.includes("height")||Za(T,i(T).style.transition="height 0.5s cubic-bezier(0.4, 0, 0.2, 1)"),Za(T,i(T).style.height=`${p}px`),le.style.overflowY=E+A+C>Y?"auto":"hidden"}}},Z=()=>{h(k,document.documentElement.clientWidth)},B=()=>{bv(),h(L,!1),setTimeout(()=>{d()?.()},300)},R=le=>{const Y={position:"fixed",width:i(n),"max-width":i(n),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(le){case"top-left":return{...Y,top:"12px",left:"12px",transform:"translate(0, 0)"};case"top-center":return{...Y,top:"12px",left:"50%",transform:"translate(-50%, 0)"};case"top-right":return{...Y,top:"12px",right:"12px",transform:"translate(0, 0)"};case"center-left":return{...Y,top:"50%",left:"12px",transform:"translateY(-50%)"};case"center":return{...Y,top:"50%",left:"50%",transform:"translate(-50%, -50%) scale(1)"};case"center-right":return{...Y,top:"50%",right:"12px",transform:"translateY(-50%)"};case"bottom-left":return{...Y,bottom:"12px",left:"12px",transform:"translate(0, 0)"};case"bottom-center":return{...Y,bottom:"12px",left:"50%",transform:"translate(-50%, 0)"};case"bottom-right":return{...Y,bottom:"12px",right:"12px",transform:"translate(0, 0)"};case"bottom-full":return{...Y,bottom:"0",left:"50%",width:"100%","max-width":"100%",transform:"translate(-50%, 0)"};case"top-full":return{...Y,top:"0",left:"50%",width:"100%","max-width":"100%",transform:"translate(-50%, 0)"};case"full":return{...Y,top:"0",left:"0",width:"100%","max-width":"100%",height:"100%",transform:"translate(0, 0)"};default:return Y}},ge=le=>Object.entries(le).map(([Y,E])=>`${Y}: ${E}`).join("; ");Rn(()=>{console.log("[POPUP-UI] onMount called"),console.log("[POPUP-UI] Props on mount:",{feedbackConfiguration:s(),configurationData:u(),themeMode:o(),apiKey:a(),hostUrl:l(),hasAppearanceProperties:!!s()?.appearanceProperties,hasDetails:!!i($)}),window.addEventListener("resize",Z),setTimeout(()=>{h(L,!0),console.log("[POPUP-UI] isVisible set to true")},100),x=window.setInterval(F,5e3),m()&&m()(F),requestAnimationFrame(()=>{setTimeout(()=>F(),0)}),console.log("[POPUP-UI] loaded")}),Co(()=>{window.removeEventListener("resize",Z),x&&window.clearInterval(x)}),ee(()=>i(k),()=>{h(n,i(k)<=768?"95%":"600px")}),ee(()=>b(u()),()=>{h($,u())}),ee(()=>i($),()=>{i($)?.feedbackIdentifier&&console.log("[POPUP-UI] feedback identifier data",i($)?.feedbackIdentifier)}),ee(()=>i($),()=>{console.log("[POPUP-UI] Reactive update - details:",i($),"loading:",U,"error:",G)}),ee(()=>b(s()),()=>{console.log("[POPUP-UI] feedbackConfiguration:",s())}),ee(()=>b(u()),()=>{console.log("[POPUP-UI] configurationData:",u())}),ee(()=>b(s()),()=>{console.log("[POPUP-UI] feedbackConfiguration?.appearanceProperties:",s()?.appearanceProperties)}),ee(()=>(b(s()),i($)),()=>{console.log("[POPUP-UI] Render condition check:",{hasFeedbackConfiguration:!!s(),hasAppearanceProperties:!!s()?.appearanceProperties,hasDetails:!!i($),shouldRenderApp:!!(s()?.appearanceProperties&&i($))})}),ee(()=>b(s()),()=>{h(r,s()&&s().appearanceProperties&&s().appearanceProperties.selectedPosition?R(s().appearanceProperties.selectedPosition):{})}),ee(()=>i(L),()=>{console.log("Current visible state (reactive): ",i(L))}),$t(),mt();var he=Qy(),Te=oe(Ne(he),2);{var ie=le=>{var Y=Wy(),E=Ne(Y);{var A=q=>{var W=Ry();ae(()=>fr(W,`background-color: ${b(s()),b(o()),z(()=>s().appearanceProperties.themes[o()].overlayColor)??""}; z-index: 1000; opacity: ${i(L)?"0.4":"0"};`)),N(q,W)};K(E,q=>{b(s()),z(()=>s()?.appearanceProperties?.featureSettings?.darkOverlay)&&q(A)})}var C=oe(E,2),p=I(C);{var v=q=>{var W=Fy(),H=I(W);Rl(H,{size:20,stroke:2}),S(W),ae(()=>fr(W,`color: ${b(s()),b(o()),z(()=>s().appearanceProperties.themes[o()].brandColor)??""}; opacity: 0.4; background-color: rgba(0, 0, 0, 0.1); border-radius: 4px; width: 32px; height: 32px;`)),Ti("click",W,B),N(q,W)};K(p,q=>{b(s()),z(()=>s()?.appearanceProperties?.featureSettings?.closeButton)&&q(v)})}var g=oe(p,2);{var j=q=>{{let W=Ue(()=>({value:c(),label:c()})),H=Ue(()=>(i($),z(()=>i($)?.questionnaireFields.questions||{}))),ne=Ue(()=>(i($),z(()=>i($)?.questionnaireFields.selectedLanguages||[]))),ve=Ue(()=>(i($),z(()=>i($)?.questionnaireFields.translations||{}))),ue=Ue(()=>(i($),z(()=>i($)?.otherConfigurationProperties))),we=Ue(()=>(i($),z(()=>i($)?.welcomeScreenProperties))),re=Ue(()=>(i($),z(()=>i($)?.endScreenProperties))),X=Ue(()=>(i($),z(()=>i($)?.questionnaireFields.sections||[])));Ji(q,{get theme(){return b(s()),z(()=>s().appearanceProperties.themes)},get themeSettings(){return b(s()),z(()=>s().appearanceProperties)},get currentMode(){return o()},get currentLanguage(){return i(W)},get questions(){return i(H)},get questionLanguages(){return i(ne)},get translations(){return i(ve)},get otherConfigurationProperties(){return i(ue)},get welcomeScreenProperties(){return i(we)},get endScreenProperties(){return i(re)},get sections(){return i(X)},onSectionChange:()=>{requestAnimationFrame(()=>{setTimeout(()=>F(),0)})},onClose:B,get apiKey(){return a()},get hostUrl(){return l()},get feedbackConfigId(){return f()},get identifier(){return y()}})}};K(g,q=>{b(s()),i($),z(()=>s()?.appearanceProperties&&i($))&&q(j)})}S(C),pr(C,q=>h(T,q),()=>i(T)),ae(q=>fr(C,`${q??""}; background-color: ${b(s()),b(o()),z(()=>s()?.appearanceProperties?.themes?.[o()]?.overlayColor||"transparent")??""}; z-index: 1001;`),[()=>(i(r),z(()=>ge(i(r))))]),N(le,Y)};K(Te,le=>{le(ie)})}N(e,he),et()}function Vy(e,t){Xe(t,!1);let n=w(t,"themeMode",12,"light"),r=w(t,"feedbackConfiguration",12,null),o=w(t,"apiKey",12,""),s=w(t,"hostUrl",12,""),a=w(t,"deviceInfo",12,null),l=w(t,"sessionId",12,""),c=w(t,"userInfo",12,null),u=w(t,"language",12,"en"),d=w(t,"configurationData",12,null),m=w(t,"onClose",12,void 0),f=w(t,"trackPopupHeight",12,void 0),y=w(t,"feedbackConfigId",12,void 0),k=w(t,"identifier",12,void 0);console.log("[Encatch-Form] Props received:",{themeMode:n(),feedbackConfiguration:r(),apiKey:o(),hostUrl:s(),deviceInfo:a(),sessionId:l(),userInfo:c(),language:u(),configurationData:d(),feedbackConfigId:y(),identifier:k()});var L={get themeMode(){return n()},set themeMode($){n($),je()},get feedbackConfiguration(){return r()},set feedbackConfiguration($){r($),je()},get apiKey(){return o()},set apiKey($){o($),je()},get hostUrl(){return s()},set hostUrl($){s($),je()},get deviceInfo(){return a()},set deviceInfo($){a($),je()},get sessionId(){return l()},set sessionId($){l($),je()},get userInfo(){return c()},set userInfo($){c($),je()},get language(){return u()},set language($){u($),je()},get configurationData(){return d()},set configurationData($){d($),je()},get onClose(){return m()},set onClose($){m($),je()},get trackPopupHeight(){return f()},set trackPopupHeight($){f($),je()},get feedbackConfigId(){return y()},set feedbackConfigId($){y($),je()},get identifier(){return k()},set identifier($){k($),je()}};return gc(e,{get themeMode(){return n()},get feedbackConfiguration(){return r()},get apiKey(){return o()},get hostUrl(){return s()},get deviceInfo(){return a()},get sessionId(){return l()},get userInfo(){return c()},get language(){return u()},get configurationData(){return d()},get onClose(){return m()},get trackPopupHeight(){return f()},get feedbackConfigId(){return y()},get identifier(){return k()}}),et(L)}customElements.define("encatch-form",jl(Vy,{themeMode:{},feedbackConfiguration:{},apiKey:{},hostUrl:{},deviceInfo:{},sessionId:{},userInfo:{},language:{},configurationData:{},onClose:{},trackPopupHeight:{},feedbackConfigId:{},identifier:{}},[],[],!0));function vc(e,t){Xe(t,!1);let n=w(t,"theme",28,()=>({dark:{brandColor:"#000",overlayColor:"#000",textColor:"#fff",backgroundColor:"#000"},light:{brandColor:"#fff",overlayColor:"#fff",textColor:"#000",backgroundColor:"#fff"}})),r=w(t,"currentMode",12,"light"),o=w(t,"currentLanguage",28,()=>({value:"en",label:"en",isFixed:!0})),s=w(t,"questions",28,()=>({})),a=w(t,"questionLanguages",28,()=>[]),l=w(t,"otherConfigurationProperties",12,null),c=w(t,"welcomeScreenProperties",12,null),u=w(t,"endScreenProperties",12,null),d=w(t,"translations",28,()=>({})),m=w(t,"sections",28,()=>[]),f=w(t,"themeSettings",12,null),y=w(t,"onClose",12,void 0),k=w(t,"onSectionChange",12,void 0),L=w(t,"apiKey",12,void 0),$=w(t,"hostUrl",12,void 0),U=w(t,"feedbackConfigId",12,void 0),G=w(t,"identifier",12,void 0);console.log("[EncatchApp] Props received:",{theme:n(),currentMode:r(),currentLanguage:o(),questions:s(),questionLanguages:a(),otherConfigurationProperties:l(),welcomeScreenProperties:c(),endScreenProperties:u(),translations:d(),sections:m(),themeSettings:f(),feedbackConfigId:U(),identifier:G()});var T={get theme(){return n()},set theme(x){n(x),je()},get currentMode(){return r()},set currentMode(x){r(x),je()},get currentLanguage(){return o()},set currentLanguage(x){o(x),je()},get questions(){return s()},set questions(x){s(x),je()},get questionLanguages(){return a()},set questionLanguages(x){a(x),je()},get otherConfigurationProperties(){return l()},set otherConfigurationProperties(x){l(x),je()},get welcomeScreenProperties(){return c()},set welcomeScreenProperties(x){c(x),je()},get endScreenProperties(){return u()},set endScreenProperties(x){u(x),je()},get translations(){return d()},set translations(x){d(x),je()},get sections(){return m()},set sections(x){m(x),je()},get themeSettings(){return f()},set themeSettings(x){f(x),je()},get onClose(){return y()},set onClose(x){y(x),je()},get onSectionChange(){return k()},set onSectionChange(x){k(x),je()},get apiKey(){return L()},set apiKey(x){L(x),je()},get hostUrl(){return $()},set hostUrl(x){$(x),je()},get feedbackConfigId(){return U()},set feedbackConfigId(x){U(x),je()},get identifier(){return G()},set identifier(x){G(x),je()}};return Ji(e,{get theme(){return n()},get currentMode(){return r()},get currentLanguage(){return o()},get questions(){return s()},get questionLanguages(){return a()},get otherConfigurationProperties(){return l()},get welcomeScreenProperties(){return c()},get endScreenProperties(){return u()},get translations(){return d()},get sections(){return m()},get themeSettings(){return f()},get onClose(){return y()},get onSectionChange(){return k()},get apiKey(){return L()},get hostUrl(){return $()},get feedbackConfigId(){return U()},get identifier(){return G()}}),et(T)}customElements.define("encatch-app",jl(vc,{theme:{},currentMode:{},currentLanguage:{},questions:{},questionLanguages:{},otherConfigurationProperties:{},welcomeScreenProperties:{},endScreenProperties:{},translations:{},sections:{},themeSettings:{},onClose:{},onSectionChange:{},apiKey:{},hostUrl:{},feedbackConfigId:{},identifier:{}},[],[],!0));const bc=Object.freeze(Object.defineProperty({__proto__:null,App:Ji,EncatchAppElement:vc,PopupUi:gc},Symbol.toStringTag,{value:"Module"}));Sn.EncatchPreview=Tc,Object.defineProperty(Sn,Symbol.toStringTag,{value:"Module"})}));