@gengage/assistant-fe 0.2.6 → 0.2.7

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.
Files changed (42) hide show
  1. package/dist/assistant-fe.css +1 -1
  2. package/dist/chat.cjs +1 -1
  3. package/dist/chat.iife.js +2 -2
  4. package/dist/chat.iife.js.map +1 -1
  5. package/dist/chat.js +2 -2
  6. package/dist/common/theme-utils.d.ts.map +1 -1
  7. package/dist/common.cjs +1 -1
  8. package/dist/common.cjs.map +1 -1
  9. package/dist/common.js +30 -28
  10. package/dist/common.js.map +1 -1
  11. package/dist/index-6hAto23F.cjs +13 -0
  12. package/dist/{index-BwBJkYGY.cjs.map → index-6hAto23F.cjs.map} +1 -1
  13. package/dist/{index-BLq9Phmq.js → index-BXXXyQzR.js} +3 -3
  14. package/dist/{index-BLq9Phmq.js.map → index-BXXXyQzR.js.map} +1 -1
  15. package/dist/{index-BeP3ETm1.cjs → index-CjQUfIYI.cjs} +2 -2
  16. package/dist/{index-BeP3ETm1.cjs.map → index-CjQUfIYI.cjs.map} +1 -1
  17. package/dist/{index-ZO_kMfUR.js → index-DJUtLUPL.js} +3 -3
  18. package/dist/{index-ZO_kMfUR.js.map → index-DJUtLUPL.js.map} +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +3 -3
  21. package/dist/native.cjs +1 -1
  22. package/dist/native.iife.js +2 -2
  23. package/dist/native.iife.js.map +1 -1
  24. package/dist/native.js +1 -1
  25. package/dist/qna.cjs +1 -1
  26. package/dist/qna.css +1 -1
  27. package/dist/qna.iife.js +1 -1
  28. package/dist/qna.iife.js.map +1 -1
  29. package/dist/qna.js +1 -1
  30. package/dist/{schemas-DR_GaPQj.js → schemas-5lXjLjwW.js} +4 -4
  31. package/dist/schemas-5lXjLjwW.js.map +1 -0
  32. package/dist/{schemas-CaaT5BuE.cjs → schemas-DqUVzVDf.cjs} +2 -2
  33. package/dist/schemas-DqUVzVDf.cjs.map +1 -0
  34. package/dist/simrel.cjs +1 -1
  35. package/dist/simrel.css +1 -1
  36. package/dist/simrel.iife.js +1 -1
  37. package/dist/simrel.iife.js.map +1 -1
  38. package/dist/simrel.js +1 -1
  39. package/package.json +2 -2
  40. package/dist/index-BwBJkYGY.cjs +0 -13
  41. package/dist/schemas-CaaT5BuE.cjs.map +0 -1
  42. package/dist/schemas-DR_GaPQj.js.map +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const at=({element:e,renderElement:t})=>{if(!e.children||e.children.length===0)return null;const n=document.createElement("div");for(const r of e.children){const o=t(r);o&&n.appendChild(o)}return n};function pn(e){const t=document.createElement("div");if(t.className=e.containerClassName,!e.spec.elements[e.spec.root])return t;const r=e.unknownRenderer??at,o=s=>{const a=e.spec.elements[s];if(!a)return null;const c=e.registry[a.type];return c?c({elementId:s,element:a,spec:e.spec,context:e.context,renderElement:o}):r({elementId:s,element:a,spec:e.spec,context:e.context,renderElement:o})},i=o(e.spec.root);return i&&t.appendChild(i),t}function gn(e,t){if(!t)return e;const n={...e};for(const[r,o]of Object.entries(t))o&&(n[r]=o);return n}function hn(e,t){const n={event_name:"stream.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{endpoint:t.endpoint,request_id:t.request_id}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),t.widget!==void 0&&(n.widget=t.widget),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function mn(e,t){const n={request_id:t.request_id,chunk_index:t.chunk_index};t.latency_ms!==void 0&&(n.latency_ms=t.latency_ms);const r={event_name:"stream.chunk",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:n};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),t.widget!==void 0&&(r.widget=t.widget),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function _n(e,t){const n={event_name:"stream.ui_spec",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,chunk_index:t.chunk_index,component_type:t.component_type}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),t.widget!==void 0&&(n.widget=t.widget),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function yn(e,t){const n={event_name:"stream.done",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,latency_ms:t.latency_ms,chunk_count:t.chunk_count}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),t.widget!==void 0&&(n.widget=t.widget),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function vn(e,t){const n={event_name:"stream.error",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,error_code:t.error_code,error_message:t.error_message}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),t.widget!==void 0&&(n.widget=t.widget),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function wn(e,t){const n={model:t.model,prompt_tokens:t.prompt_tokens,completion_tokens:t.completion_tokens,total_tokens:t.total_tokens};t.provider!==void 0&&(n.provider=t.provider);const r={event_name:"llm.usage",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:n};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function bn(e,t){const n={event_name:"metering.increment",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{meter_key:t.meter_key,quantity:t.quantity,unit:t.unit}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function ct(e,t){const n={event_name:"metering.summary",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{meter_key:t.meter_key,quantity:t.quantity,unit:t.unit}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function kn(e,t){const n={event_name:"chat.history.snapshot",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{message_count:t.message_count,history_ref:t.history_ref,redaction_level:t.redaction_level}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function zn(e,t){const n={event_name:"widget.history.snapshot",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.widget,payload:{message_count:t.message_count,history_ref:t.history_ref,redaction_level:t.redaction_level}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function Sn(e,t){const n={event_name:"basket.add",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items,sku:t.sku}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function ut(e,t){const n={event_name:"checkout.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function dt(e,t){const n={event_name:"checkout.complete",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}const En=new Set(["p","br","a","strong","b","em","i","u","ul","ol","li","h1","h2","h3","h4","h5","h6","span","div","table","thead","tbody","tr","th","td","hr","code","pre","blockquote","img","sup","sub"]),$n=new Set(["script","iframe","object","embed","form","input","textarea","select","button","style","link","meta","template","noscript"]),Ne={"*":new Set(["class"]),a:new Set(["href","target","rel"]),img:new Set(["src","alt","width","height"]),div:new Set(["style"]),span:new Set(["style"]),p:new Set(["style"])};function Tn(e){return/^\s*javascript\s*:/i.test(e)}const Zn=new Set(["color","background-color","font-size","font-weight","font-style","font-family","text-align","text-decoration","line-height","letter-spacing","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-top","border-right","border-bottom","border-left","border-radius","border-color","border-width","border-style","width","max-width","min-width","height","max-height","min-height","display","vertical-align","white-space","word-break","overflow","opacity","visibility","list-style","list-style-type","text-transform","text-indent","text-overflow","box-sizing","flex","flex-direction","flex-wrap","justify-content","align-items","gap"]),In=/url\s*\(|expression\s*\(|javascript\s*:|\bimport\b|-moz-binding|behavior\s*:/i;function On(e){const t=[];for(const n of e.split(";")){const r=n.trim();if(!r)continue;const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim().toLowerCase(),s=r.slice(o+1).trim();Zn.has(i)&&(In.test(s)||t.push(r))}return t.join("; ")}function _e(e,t){if(e.nodeType===Node.TEXT_NODE)return;if(e.nodeType!==Node.ELEMENT_NODE){e.parentNode?.removeChild(e);return}const n=e,r=n.tagName.toLowerCase();if($n.has(r)){n.parentNode?.removeChild(n);return}if(!En.has(r)){const c=Array.from(n.childNodes);for(const u of c)t.insertBefore(u,n);t.removeChild(n);for(const u of c)_e(u,t);return}const o=Ne["*"]??new Set,i=Ne[r]??new Set,s=Array.from(n.attributes);for(const c of s){const u=c.name.toLowerCase();if(!o.has(u)&&!i.has(u)){n.removeAttribute(c.name);continue}if(Tn(c.value)){n.removeAttribute(c.name);continue}if(u==="style"){const l=On(c.value);l?n.setAttribute("style",l):n.removeAttribute("style");continue}}if(r==="a"){const c=n.getAttribute("href");if(c!==null){const u=c.trim().toLowerCase();!u.startsWith("http://")&&!u.startsWith("https://")&&!u.startsWith("mailto:")&&n.removeAttribute("href")}n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer")}if(r==="img"){const c=n.getAttribute("src");c!==null&&(c.trim().toLowerCase().startsWith("https://")||n.removeAttribute("src"))}const a=Array.from(n.childNodes);for(const c of a)_e(c,n)}const lt=["http:","https:"];function An(e){try{return lt.includes(new URL(e).protocol)}catch{return!1}}function Se(e){if(e.startsWith("/")&&!e.startsWith("//"))return!0;try{const t=new URL(e);return lt.includes(t.protocol)}catch{return!1}}function Pn(e,t,n){(t==="href"||t==="src")&&!Se(n)||e.setAttribute(t,n)}function Cn(e){if(!e)return"";const n=new DOMParser().parseFromString(e,"text/html").body,r=Array.from(n.childNodes);for(const o of r)_e(o,n);return n.innerHTML}function Nn(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!1}))}function B(e,t){const n=r=>{t(r.detail)};return window.addEventListener(e,n),()=>window.removeEventListener(e,n)}function Rn(e){if(e.type!=="user_message"&&e.type!=="inputText")return null;if(typeof e.payload=="string"&&e.payload.trim().length>0)return e.payload.trim();if(typeof e.payload=="object"&&e.payload!==null){const t=e.payload;if(typeof t.text=="string"){const n=t.text.trim();if(n.length>0)return n}}return typeof e.title=="string"&&e.title.trim().length>0?e.title.trim():null}function Dn(e){let t=!1;const n=[];let r=0,o=null,i=0;const s=100,a=5e3;function c(){return window.gengage?.chat??null}function u(){t||(console.warn("[gengage] QNA tried to open chat, but chat widget is not initialized. Ensure GengageChat is initialized before calling wireQNAToChat()."),t=!0),e?.onChatUnavailable?.()}function l(m,b){const Z=Rn(b);if(Z&&m.sendMessage){m.open?.(),m.sendMessage(Z);return}m.openWithAction?.(b)}function f(){o!==null&&(window.clearInterval(o),o=null)}function p(){const m=c();if(!m)return!1;if(r>0&&(m.open?.(),r=0),n.length>0){const b=n.splice(0,n.length);for(const Z of b)l(m,Z)}return f(),!0}function g(){o===null&&(i=Date.now(),o=window.setInterval(()=>{p()||Date.now()-i>=a&&(n.length=0,r=0,f())},s))}const y=B("gengage:qna:action",m=>{const b=c();if(b){l(b,m);return}u(),n.length>=20&&n.shift(),n.push(m),g()}),_=B("gengage:qna:open-chat",()=>{const m=c();if(m){m.open?.();return}u(),r+=1,g()});return()=>{y(),_(),n.length=0,r=0,f()}}function jn(){return B("gengage:similar:product-click",({sku:e,url:t,sessionId:n})=>{n&&window.gengage?.chat?.saveSession(n,e),Se(t)&&(window.location.href=t)})}function ft(){const t=window.__gengageSessionId??sessionStorage.getItem("gengage_session_id")??null??crypto.randomUUID();return window.__gengageSessionId=t,sessionStorage.setItem("gengage_session_id",t),window.gengage||(window.gengage={}),window.gengage.sessionId=t,t}function Ln(){return window.gengage?.pageContext??null}function Un(e){window.gengage||(window.gengage={}),window.gengage.pageContext={pageType:"other",...window.gengage.pageContext,...e},window.dispatchEvent(new CustomEvent("gengage:context:update",{detail:e}))}function pt(e){return{sessionId:e?.sessionId??ft(),...e}}const ye={"--gengage-chat-offset":"20px","--gengage-chat-launcher-size":"56px","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"12px","--gengage-chat-header-height":"60px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"860px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"14px","--gengage-simrel-card-radius":"14px"};function gt(e){return e?{...ye,...e}:{...ye}}const L="gengage-global-toast-root",Re="gengage-global-toast-style",Ee="gengage-global-toast-root--visible",Mn=4200,xn=1500,Fn=15e3;let De=!1,J=null;function Jn(e){return typeof e=="string"&&e.toLowerCase().startsWith("tr")?"Bağlantı sorunu oluştu. Lütfen tekrar deneyin.":"Connection issue. Please try again."}function ht(){De||typeof window>"u"||typeof document>"u"||(De=!0,B("gengage:global:error",e=>{mt(e)}))}function mt(e){if(typeof document>"u")return;const t=e.message.trim();if(!t)return;Gn();const n=Wn();n.innerHTML="";const r=document.createElement("section");r.className="gengage-global-toast gengage-global-toast--error",r.setAttribute("role","status"),r.setAttribute("aria-live","polite");const o=document.createElement("div");o.className="gengage-global-toast-title",o.textContent=qn(e.source);const i=document.createElement("div");i.className="gengage-global-toast-message",i.textContent=t,r.appendChild(o),r.appendChild(i),n.appendChild(r),n.classList.add(Ee),J&&(clearTimeout(J),J=null),J=setTimeout(()=>{_t()},Vn(e.durationMs))}function _t(){if(typeof document>"u")return;const e=document.getElementById(L);e&&(e.classList.remove(Ee),e.innerHTML="",J&&(clearTimeout(J),J=null))}function qn(e){switch(e){case"chat":return"Chat warning";case"qna":return"QnA warning";case"simrel":return"Widget warning";default:return"Connection warning"}}function Wn(){const e=document.getElementById(L);if(e instanceof HTMLElement)return e;const t=document.createElement("div");return t.id=L,t.className="gengage-global-toast-root",document.body.appendChild(t),t}function Vn(e){return typeof e!="number"||!Number.isFinite(e)?Mn:Math.min(Fn,Math.max(xn,Math.round(e)))}function Gn(){if(document.getElementById(Re))return;const e=document.createElement("style");e.id=Re,e.textContent=`
1
+ "use strict";const at=({element:e,renderElement:t})=>{if(!e.children||e.children.length===0)return null;const n=document.createElement("div");for(const r of e.children){const o=t(r);o&&n.appendChild(o)}return n};function pn(e){const t=document.createElement("div");if(t.className=e.containerClassName,!e.spec.elements[e.spec.root])return t;const r=e.unknownRenderer??at,o=s=>{const a=e.spec.elements[s];if(!a)return null;const c=e.registry[a.type];return c?c({elementId:s,element:a,spec:e.spec,context:e.context,renderElement:o}):r({elementId:s,element:a,spec:e.spec,context:e.context,renderElement:o})},i=o(e.spec.root);return i&&t.appendChild(i),t}function gn(e,t){if(!t)return e;const n={...e};for(const[r,o]of Object.entries(t))o&&(n[r]=o);return n}function hn(e,t){const n={event_name:"stream.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{endpoint:t.endpoint,request_id:t.request_id}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),t.widget!==void 0&&(n.widget=t.widget),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function mn(e,t){const n={request_id:t.request_id,chunk_index:t.chunk_index};t.latency_ms!==void 0&&(n.latency_ms=t.latency_ms);const r={event_name:"stream.chunk",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:n};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),t.widget!==void 0&&(r.widget=t.widget),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function _n(e,t){const n={event_name:"stream.ui_spec",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,chunk_index:t.chunk_index,component_type:t.component_type}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),t.widget!==void 0&&(n.widget=t.widget),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function yn(e,t){const n={event_name:"stream.done",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,latency_ms:t.latency_ms,chunk_count:t.chunk_count}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),t.widget!==void 0&&(n.widget=t.widget),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function vn(e,t){const n={event_name:"stream.error",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{request_id:t.request_id,error_code:t.error_code,error_message:t.error_message}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),t.widget!==void 0&&(n.widget=t.widget),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function wn(e,t){const n={model:t.model,prompt_tokens:t.prompt_tokens,completion_tokens:t.completion_tokens,total_tokens:t.total_tokens};t.provider!==void 0&&(n.provider=t.provider);const r={event_name:"llm.usage",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:n};return e.view_id!==void 0&&(r.view_id=e.view_id),e.user_id!==void 0&&(r.user_id=e.user_id),e.page_type!==void 0&&(r.page_type=e.page_type),e.sku!==void 0&&(r.sku=e.sku),r}function bn(e,t){const n={event_name:"metering.increment",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{meter_key:t.meter_key,quantity:t.quantity,unit:t.unit}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function ct(e,t){const n={event_name:"metering.summary",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{meter_key:t.meter_key,quantity:t.quantity,unit:t.unit}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function kn(e,t){const n={event_name:"chat.history.snapshot",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,payload:{message_count:t.message_count,history_ref:t.history_ref,redaction_level:t.redaction_level}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function zn(e,t){const n={event_name:"widget.history.snapshot",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.widget,payload:{message_count:t.message_count,history_ref:t.history_ref,redaction_level:t.redaction_level}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function Sn(e,t){const n={event_name:"basket.add",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items,sku:t.sku}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function ut(e,t){const n={event_name:"checkout.start",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}function dt(e,t){const n={event_name:"checkout.complete",account_id:e.account_id,session_id:e.session_id,correlation_id:e.correlation_id,widget:t.attribution_source,payload:{attribution_source:t.attribution_source,attribution_action_id:t.attribution_action_id,cart_value:t.cart_value,currency:t.currency,line_items:t.line_items}};return e.view_id!==void 0&&(n.view_id=e.view_id),e.user_id!==void 0&&(n.user_id=e.user_id),e.page_type!==void 0&&(n.page_type=e.page_type),e.sku!==void 0&&(n.sku=e.sku),n}const En=new Set(["p","br","a","strong","b","em","i","u","ul","ol","li","h1","h2","h3","h4","h5","h6","span","div","table","thead","tbody","tr","th","td","hr","code","pre","blockquote","img","sup","sub"]),$n=new Set(["script","iframe","object","embed","form","input","textarea","select","button","style","link","meta","template","noscript"]),Ne={"*":new Set(["class"]),a:new Set(["href","target","rel"]),img:new Set(["src","alt","width","height"]),div:new Set(["style"]),span:new Set(["style"]),p:new Set(["style"])};function Tn(e){return/^\s*javascript\s*:/i.test(e)}const Zn=new Set(["color","background-color","font-size","font-weight","font-style","font-family","text-align","text-decoration","line-height","letter-spacing","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-top","border-right","border-bottom","border-left","border-radius","border-color","border-width","border-style","width","max-width","min-width","height","max-height","min-height","display","vertical-align","white-space","word-break","overflow","opacity","visibility","list-style","list-style-type","text-transform","text-indent","text-overflow","box-sizing","flex","flex-direction","flex-wrap","justify-content","align-items","gap"]),In=/url\s*\(|expression\s*\(|javascript\s*:|\bimport\b|-moz-binding|behavior\s*:/i;function On(e){const t=[];for(const n of e.split(";")){const r=n.trim();if(!r)continue;const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim().toLowerCase(),s=r.slice(o+1).trim();Zn.has(i)&&(In.test(s)||t.push(r))}return t.join("; ")}function _e(e,t){if(e.nodeType===Node.TEXT_NODE)return;if(e.nodeType!==Node.ELEMENT_NODE){e.parentNode?.removeChild(e);return}const n=e,r=n.tagName.toLowerCase();if($n.has(r)){n.parentNode?.removeChild(n);return}if(!En.has(r)){const c=Array.from(n.childNodes);for(const u of c)t.insertBefore(u,n);t.removeChild(n);for(const u of c)_e(u,t);return}const o=Ne["*"]??new Set,i=Ne[r]??new Set,s=Array.from(n.attributes);for(const c of s){const u=c.name.toLowerCase();if(!o.has(u)&&!i.has(u)){n.removeAttribute(c.name);continue}if(Tn(c.value)){n.removeAttribute(c.name);continue}if(u==="style"){const l=On(c.value);l?n.setAttribute("style",l):n.removeAttribute("style");continue}}if(r==="a"){const c=n.getAttribute("href");if(c!==null){const u=c.trim().toLowerCase();!u.startsWith("http://")&&!u.startsWith("https://")&&!u.startsWith("mailto:")&&n.removeAttribute("href")}n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer")}if(r==="img"){const c=n.getAttribute("src");c!==null&&(c.trim().toLowerCase().startsWith("https://")||n.removeAttribute("src"))}const a=Array.from(n.childNodes);for(const c of a)_e(c,n)}const lt=["http:","https:"];function An(e){try{return lt.includes(new URL(e).protocol)}catch{return!1}}function Se(e){if(e.startsWith("/")&&!e.startsWith("//"))return!0;try{const t=new URL(e);return lt.includes(t.protocol)}catch{return!1}}function Pn(e,t,n){(t==="href"||t==="src")&&!Se(n)||e.setAttribute(t,n)}function Cn(e){if(!e)return"";const n=new DOMParser().parseFromString(e,"text/html").body,r=Array.from(n.childNodes);for(const o of r)_e(o,n);return n.innerHTML}function Nn(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!1}))}function B(e,t){const n=r=>{t(r.detail)};return window.addEventListener(e,n),()=>window.removeEventListener(e,n)}function Rn(e){if(e.type!=="user_message"&&e.type!=="inputText")return null;if(typeof e.payload=="string"&&e.payload.trim().length>0)return e.payload.trim();if(typeof e.payload=="object"&&e.payload!==null){const t=e.payload;if(typeof t.text=="string"){const n=t.text.trim();if(n.length>0)return n}}return typeof e.title=="string"&&e.title.trim().length>0?e.title.trim():null}function Dn(e){let t=!1;const n=[];let r=0,o=null,i=0;const s=100,a=5e3;function c(){return window.gengage?.chat??null}function u(){t||(console.warn("[gengage] QNA tried to open chat, but chat widget is not initialized. Ensure GengageChat is initialized before calling wireQNAToChat()."),t=!0),e?.onChatUnavailable?.()}function l(m,b){const Z=Rn(b);if(Z&&m.sendMessage){m.open?.(),m.sendMessage(Z);return}m.openWithAction?.(b)}function f(){o!==null&&(window.clearInterval(o),o=null)}function p(){const m=c();if(!m)return!1;if(r>0&&(m.open?.(),r=0),n.length>0){const b=n.splice(0,n.length);for(const Z of b)l(m,Z)}return f(),!0}function g(){o===null&&(i=Date.now(),o=window.setInterval(()=>{p()||Date.now()-i>=a&&(n.length=0,r=0,f())},s))}const y=B("gengage:qna:action",m=>{const b=c();if(b){l(b,m);return}u(),n.length>=20&&n.shift(),n.push(m),g()}),_=B("gengage:qna:open-chat",()=>{const m=c();if(m){m.open?.();return}u(),r+=1,g()});return()=>{y(),_(),n.length=0,r=0,f()}}function jn(){return B("gengage:similar:product-click",({sku:e,url:t,sessionId:n})=>{n&&window.gengage?.chat?.saveSession(n,e),Se(t)&&(window.location.href=t)})}function ft(){const t=window.__gengageSessionId??sessionStorage.getItem("gengage_session_id")??null??crypto.randomUUID();return window.__gengageSessionId=t,sessionStorage.setItem("gengage_session_id",t),window.gengage||(window.gengage={}),window.gengage.sessionId=t,t}function Ln(){return window.gengage?.pageContext??null}function Un(e){window.gengage||(window.gengage={}),window.gengage.pageContext={pageType:"other",...window.gengage.pageContext,...e},window.dispatchEvent(new CustomEvent("gengage:context:update",{detail:e}))}function pt(e){return{sessionId:e?.sessionId??ft(),...e}}const ye={"--gengage-chat-offset":"20px","--gengage-chat-launcher-size":"56px","--gengage-chat-width":"400px","--gengage-chat-shell-radius":"1rem","--gengage-chat-header-height":"60px","--gengage-chat-conversation-width":"396px","--gengage-chat-panel-min-width":"320px","--gengage-chat-panel-max-width":"860px","--gengage-chat-input-height":"48px","--gengage-qna-pill-radius":"999px","--gengage-qna-input-radius":"0.75rem","--gengage-simrel-card-radius":"0.75rem"};function gt(e){return e?{...ye,...e}:{...ye}}const L="gengage-global-toast-root",Re="gengage-global-toast-style",Ee="gengage-global-toast-root--visible",Mn=4200,xn=1500,Fn=15e3;let De=!1,J=null;function Jn(e){return typeof e=="string"&&e.toLowerCase().startsWith("tr")?"Bağlantı sorunu oluştu. Lütfen tekrar deneyin.":"Connection issue. Please try again."}function ht(){De||typeof window>"u"||typeof document>"u"||(De=!0,B("gengage:global:error",e=>{mt(e)}))}function mt(e){if(typeof document>"u")return;const t=e.message.trim();if(!t)return;Gn();const n=Wn();n.innerHTML="";const r=document.createElement("section");r.className="gengage-global-toast gengage-global-toast--error",r.setAttribute("role","status"),r.setAttribute("aria-live","polite");const o=document.createElement("div");o.className="gengage-global-toast-title",o.textContent=qn(e.source);const i=document.createElement("div");i.className="gengage-global-toast-message",i.textContent=t,r.appendChild(o),r.appendChild(i),n.appendChild(r),n.classList.add(Ee),J&&(clearTimeout(J),J=null),J=setTimeout(()=>{_t()},Vn(e.durationMs))}function _t(){if(typeof document>"u")return;const e=document.getElementById(L);e&&(e.classList.remove(Ee),e.innerHTML="",J&&(clearTimeout(J),J=null))}function qn(e){switch(e){case"chat":return"Chat warning";case"qna":return"QnA warning";case"simrel":return"Widget warning";default:return"Connection warning"}}function Wn(){const e=document.getElementById(L);if(e instanceof HTMLElement)return e;const t=document.createElement("div");return t.id=L,t.className="gengage-global-toast-root",document.body.appendChild(t),t}function Vn(e){return typeof e!="number"||!Number.isFinite(e)?Mn:Math.min(Fn,Math.max(xn,Math.round(e)))}function Gn(){if(document.getElementById(Re))return;const e=document.createElement("style");e.id=Re,e.textContent=`
2
2
  #${L} {
3
3
  position: fixed;
4
4
  top: 16px;
@@ -83,4 +83,4 @@
83
83
  `)}g.write("payload.value = newResult;"),g.write("return payload;");const Z=g.compile();return(N,O)=>Z(p,N,O)};let i;const s=ae,a=!Ct.jitless,u=a&&uo.value,l=t.catchall;let f;e._zod.parse=(p,g)=>{f??(f=r.value);const y=p.value;return s(y)?a&&u&&g?.async===!1&&g.jitless!==!0?(i||(i=o(t.shape)),p=i(p,g),l?Ht([],y,p,g,f,e):p):n(p,g):(p.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),p)}});function qe(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!W(i));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(i=>i.issues.map(s=>M(s,r,U())))}),t)}const Hi=d("$ZodUnion",(e,t)=>{z.init(e,t),v(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),v(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),v(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),v(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Ie(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},i);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(c=>qe(c,o,e,i)):qe(a,o,e,i)}}),Yi=d("$ZodIntersection",(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>We(n,c,u)):We(n,i,s)}});function be(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(K(e)&&K(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=be(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.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],i=t[r],s=be(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function We(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&o&&e.issues.push({...o,keys:i}),W(e))return e;const s=be(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Qi=d("$ZodRecord",(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!K(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const l=t.valueType._zod.run({value:o[u],issues:[]},r);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&n.issues.push(...V(u,f.issues)),n.value[u]=f.value})):(l.issues.length&&n.issues.push(...V(u,l.issues)),n.value[u]=l.value)}let c;for(const u in o)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Jt.test(a)&&c.issues.length){const f=t.keyType._zod.run({value:Number(a),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>M(f,r,U())),input:a,path:[a],inst:e});continue}const l=t.valueType._zod.run({value:o[a],issues:[]},r);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&n.issues.push(...V(a,f.issues)),n.value[c.value]=f.value})):(l.issues.length&&n.issues.push(...V(a,l.issues)),n.value[c.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Xi=d("$ZodEnum",(e,t)=>{z.init(e,t);const n=Nt(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>lo.has(typeof o)).map(o=>typeof o=="string"?H(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const s=o.value;return r.has(s)||o.issues.push({code:"invalid_value",values:n,input:s,inst:e}),o}}),es=d("$ZodLiteral",(e,t)=>{if(z.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?H(r):r?H(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),ts=d("$ZodTransform",(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Pt(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new G;return n.value=o,n}});function Ve(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Yt=d("$ZodOptional",(e,t)=>{z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",v(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),v(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ie(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(i=>Ve(i,n.value)):Ve(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),ns=d("$ZodExactOptional",(e,t)=>{Yt.init(e,t),v(e._zod,"values",()=>t.innerType._zod.values),v(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),rs=d("$ZodNullable",(e,t)=>{z.init(e,t),v(e._zod,"optin",()=>t.innerType._zod.optin),v(e._zod,"optout",()=>t.innerType._zod.optout),v(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ie(n.source)}|null)$`):void 0}),v(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)}),os=d("$ZodDefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",v(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(i=>Ge(i,t)):Ge(o,t)}});function Ge(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const is=d("$ZodPrefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",v(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))}),ss=d("$ZodNonOptional",(e,t)=>{z.init(e,t),v(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(i=>Be(i,e)):Be(o,e)}});function Be(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 as=d("$ZodCatch",(e,t)=>{z.init(e,t),v(e._zod,"optin",()=>t.innerType._zod.optin),v(e._zod,"optout",()=>t.innerType._zod.optout),v(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(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>M(s,r,U()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>M(i,r,U()))},input:n.value}),n.issues=[]),n)}}),cs=d("$ZodPipe",(e,t)=>{z.init(e,t),v(e._zod,"values",()=>t.in._zod.values),v(e._zod,"optin",()=>t.in._zod.optin),v(e._zod,"optout",()=>t.out._zod.optout),v(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>oe(s,t.in,r)):oe(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>oe(i,t.out,r)):oe(o,t.out,r)}});function oe(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const us=d("$ZodReadonly",(e,t)=>{z.init(e,t),v(e._zod,"propValues",()=>t.innerType._zod.propValues),v(e._zod,"values",()=>t.innerType._zod.values),v(e._zod,"optin",()=>t.innerType?._zod?.optin),v(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(Ke):Ke(o)}});function Ke(e){return e.value=Object.freeze(e.value),e}const ds=d("$ZodCustom",(e,t)=>{A.init(e,t),z.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(i=>He(i,n,r,e));He(o,n,r,e)}});function He(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(ne(o))}}var Ye;class ls{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),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 fs(){return new ls}(Ye=globalThis).__zod_globalRegistry??(Ye.__zod_globalRegistry=fs());const te=globalThis.__zod_globalRegistry;function ps(e,t){return new e({type:"string",...h(t)})}function gs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...h(t)})}function Qe(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...h(t)})}function hs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...h(t)})}function ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...h(t)})}function _s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...h(t)})}function ys(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...h(t)})}function vs(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...h(t)})}function ws(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...h(t)})}function bs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...h(t)})}function ks(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...h(t)})}function zs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...h(t)})}function Ss(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...h(t)})}function Es(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...h(t)})}function $s(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...h(t)})}function Ts(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...h(t)})}function Zs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...h(t)})}function Is(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...h(t)})}function Os(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...h(t)})}function As(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...h(t)})}function Ps(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...h(t)})}function Cs(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...h(t)})}function Ns(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...h(t)})}function Rs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...h(t)})}function Ds(e,t){return new e({type:"string",format:"date",check:"string_format",...h(t)})}function js(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...h(t)})}function Ls(e,t){return new e({type:"string",format:"duration",check:"string_format",...h(t)})}function Us(e,t){return new e({type:"number",checks:[],...h(t)})}function Ms(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...h(t)})}function xs(e,t){return new e({type:"boolean",...h(t)})}function Fs(e){return new e({type:"unknown"})}function Js(e,t){return new e({type:"never",...h(t)})}function Xe(e,t){return new Wt({check:"less_than",...h(t),value:e,inclusive:!1})}function he(e,t){return new Wt({check:"less_than",...h(t),value:e,inclusive:!0})}function et(e,t){return new Vt({check:"greater_than",...h(t),value:e,inclusive:!1})}function me(e,t){return new Vt({check:"greater_than",...h(t),value:e,inclusive:!0})}function tt(e,t){return new oi({check:"multiple_of",...h(t),value:e})}function Qt(e,t){return new si({check:"max_length",...h(t),maximum:e})}function ue(e,t){return new ai({check:"min_length",...h(t),minimum:e})}function Xt(e,t){return new ci({check:"length_equals",...h(t),length:e})}function qs(e,t){return new ui({check:"string_format",format:"regex",...h(t),pattern:e})}function Ws(e){return new di({check:"string_format",format:"lowercase",...h(e)})}function Vs(e){return new li({check:"string_format",format:"uppercase",...h(e)})}function Gs(e,t){return new fi({check:"string_format",format:"includes",...h(t),includes:e})}function Bs(e,t){return new pi({check:"string_format",format:"starts_with",...h(t),prefix:e})}function Ks(e,t){return new gi({check:"string_format",format:"ends_with",...h(t),suffix:e})}function Y(e){return new hi({check:"overwrite",tx:e})}function Hs(e){return Y(t=>t.normalize(e))}function Ys(){return Y(e=>e.trim())}function Qs(){return Y(e=>e.toLowerCase())}function Xs(){return Y(e=>e.toUpperCase())}function ea(){return Y(e=>co(e))}function ta(e,t,n){return new e({type:"array",element:t,...h(n)})}function na(e,t,n){return new e({type:"custom",check:"custom",fn:t,...h(n)})}function ra(e){const t=oa(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ne(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(ne(o))}},e(n.value,n)));return t}function oa(e,t){const n=new A({check:"custom",...h(t)});return n._zod.check=e,n}function en(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??te,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function $(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{const p=s.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,p,l)}const f=e._zod.parent;f&&(s.ref||(s.ref=f),$(f,t,l),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&I(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function tn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const c=r.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const f=e.external.registry.get(s[0])?.id,p=e.external.uri??(y=>y);if(f)return{ref:p(f)};const g=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=g,{defId:g,ref:`${p("__shared")}#/${a}/${g}`}}if(s[1]===n)return{ref:"#"};const u=`#/${a}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);const l=a.schema;for(const f in l)delete l[f];l.$ref=c};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
84
84
 
85
85
  Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function nn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=s=>{const a=e.seen.get(s);if(a.ref===null)return;const c=a.def??a.schema,u={...c},l=a.ref;if(a.ref=null,l){r(l);const p=e.seen.get(l),g=p.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(g)):Object.assign(c,g),Object.assign(c,u),s._zod.parent===l)for(const _ in c)_==="$ref"||_==="allOf"||_ in u||delete c[_];if(g.$ref&&p.def)for(const _ in c)_==="$ref"||_==="allOf"||_ in p.def&&JSON.stringify(c[_])===JSON.stringify(p.def[_])&&delete c[_]}const f=s._zod.parent;if(f&&f!==l){r(f);const p=e.seen.get(f);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(const g in c)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(c[g])===JSON.stringify(p.def[g])&&delete c[g]}e.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(const s of[...e.seen.entries()].reverse())r(s[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(s)}Object.assign(o,n.def??n.schema);const i=e.external?.defs??{};for(const s of e.seen.entries()){const a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const s=JSON.parse(JSON.stringify(o));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:de(t,"input",e.processors),output:de(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function I(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return I(r.element,n);if(r.type==="set")return I(r.valueType,n);if(r.type==="lazy")return I(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return I(r.innerType,n);if(r.type==="intersection")return I(r.left,n)||I(r.right,n);if(r.type==="record"||r.type==="map")return I(r.keyType,n)||I(r.valueType,n);if(r.type==="pipe")return I(r.in,n)||I(r.out,n);if(r.type==="object"){for(const o in r.shape)if(I(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(I(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(I(o,n))return!0;return!!(r.rest&&I(r.rest,n))}return!1}const ia=(e,t={})=>n=>{const r=en({...n,processors:t});return $(e,r),tn(r,e),nn(r,e)},de=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=en({...o??{},target:i,io:t,processors:n});return $(e,s),tn(s,e),nn(s,e)},sa={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},aa=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=sa[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},ca=(e,t,n,r)=>{const o=n,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l),typeof i=="number"&&(o.minimum=i,typeof l=="number"&&t.target!=="draft-04"&&(l>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof s=="number"&&(o.maximum=s,typeof u=="number"&&t.target!=="draft-04"&&(u<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},ua=(e,t,n,r)=>{n.type="boolean"},da=(e,t,n,r)=>{n.not={}},la=(e,t,n,r)=>{},fa=(e,t,n,r)=>{const o=e._zod.def,i=Nt(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},pa=(e,t,n,r)=>{const o=e._zod.def,i=[];for(const s of o.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){const s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},ga=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ha=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ma=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=$(i.element,t,{...r,path:[...r.path,"items"]})},_a=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const u in s)o.properties[u]=$(s[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{const l=i.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=$(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},ya=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>$(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=s:n.anyOf=s},va=(e,t,n,r)=>{const o=e._zod.def,i=$(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=$(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c},wa=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,c=s._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){const l=$(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const f of c)o.patternProperties[f.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=$(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=$(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=s._zod.values;if(u){const l=[...u].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(o.required=l)}},ba=(e,t,n,r)=>{const o=e._zod.def,i=$(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},ka=(e,t,n,r)=>{const o=e._zod.def;$(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},za=(e,t,n,r)=>{const o=e._zod.def;$(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Sa=(e,t,n,r)=>{const o=e._zod.def;$(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Ea=(e,t,n,r)=>{const o=e._zod.def;$(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},$a=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;$(i,t,r);const s=t.seen.get(e);s.ref=i},Ta=(e,t,n,r)=>{const o=e._zod.def;$(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},rn=(e,t,n,r)=>{const o=e._zod.def;$(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},Za=d("ZodISODateTime",(e,t)=>{Ii.init(e,t),E.init(e,t)});function Ia(e){return Rs(Za,e)}const Oa=d("ZodISODate",(e,t)=>{Oi.init(e,t),E.init(e,t)});function Aa(e){return Ds(Oa,e)}const Pa=d("ZodISOTime",(e,t)=>{Ai.init(e,t),E.init(e,t)});function Ca(e){return js(Pa,e)}const Na=d("ZodISODuration",(e,t)=>{Pi.init(e,t),E.init(e,t)});function Ra(e){return Ls(Na,e)}const Da=(e,t)=>{Lt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ko(e,n)},flatten:{value:n=>bo(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,we,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,we,2)}},isEmpty:{get(){return e.issues.length===0}}})},P=d("ZodError",Da,{Parent:Error}),ja=Ae(P),La=Pe(P),Ua=le(P),Ma=fe(P),xa=Eo(P),Fa=$o(P),Ja=To(P),qa=Zo(P),Wa=Io(P),Va=Oo(P),Ga=Ao(P),Ba=Po(P),S=d("ZodType",(e,t)=>(z.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:de(e,"input"),output:de(e,"output")}}),e.toJSONSchema=ia(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(x(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>F(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>ja(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Ua(e,n,r),e.parseAsync=async(n,r)=>La(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Ma(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>xa(e,n,r),e.decode=(n,r)=>Fa(e,n,r),e.encodeAsync=async(n,r)=>Ja(e,n,r),e.decodeAsync=async(n,r)=>qa(e,n,r),e.safeEncode=(n,r)=>Wa(e,n,r),e.safeDecode=(n,r)=>Va(e,n,r),e.safeEncodeAsync=async(n,r)=>Ga(e,n,r),e.safeDecodeAsync=async(n,r)=>Ba(e,n,r),e.refine=(n,r)=>e.check(Gc(n,r)),e.superRefine=n=>e.check(Bc(n)),e.overwrite=n=>e.check(Y(n)),e.optional=()=>ot(e),e.exactOptional=()=>Nc(e),e.nullable=()=>it(e),e.nullish=()=>ot(it(e)),e.nonoptional=n=>Mc(e,n),e.array=()=>an(e),e.or=n=>cn([e,n]),e.and=n=>$c(e,n),e.transform=n=>st(e,Pc(n)),e.default=n=>jc(e,n),e.prefault=n=>Uc(e,n),e.catch=n=>Fc(e,n),e.pipe=n=>st(e,n),e.readonly=()=>Wc(e),e.describe=n=>{const r=e.clone();return te.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return te.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return te.get(e);const r=e.clone();return te.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),on=d("_ZodString",(e,t)=>{Ce.init(e,t),S.init(e,t),e._zod.processJSONSchema=(r,o,i)=>aa(e,r,o);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(qs(...r)),e.includes=(...r)=>e.check(Gs(...r)),e.startsWith=(...r)=>e.check(Bs(...r)),e.endsWith=(...r)=>e.check(Ks(...r)),e.min=(...r)=>e.check(ue(...r)),e.max=(...r)=>e.check(Qt(...r)),e.length=(...r)=>e.check(Xt(...r)),e.nonempty=(...r)=>e.check(ue(1,...r)),e.lowercase=r=>e.check(Ws(r)),e.uppercase=r=>e.check(Vs(r)),e.trim=()=>e.check(Ys()),e.normalize=(...r)=>e.check(Hs(...r)),e.toLowerCase=()=>e.check(Qs()),e.toUpperCase=()=>e.check(Xs()),e.slugify=()=>e.check(ea())}),Ka=d("ZodString",(e,t)=>{Ce.init(e,t),on.init(e,t),e.email=n=>e.check(gs(Ya,n)),e.url=n=>e.check(vs(Qa,n)),e.jwt=n=>e.check(Ns(pc,n)),e.emoji=n=>e.check(ws(Xa,n)),e.guid=n=>e.check(Qe(nt,n)),e.uuid=n=>e.check(hs(ie,n)),e.uuidv4=n=>e.check(ms(ie,n)),e.uuidv6=n=>e.check(_s(ie,n)),e.uuidv7=n=>e.check(ys(ie,n)),e.nanoid=n=>e.check(bs(ec,n)),e.guid=n=>e.check(Qe(nt,n)),e.cuid=n=>e.check(ks(tc,n)),e.cuid2=n=>e.check(zs(nc,n)),e.ulid=n=>e.check(Ss(rc,n)),e.base64=n=>e.check(As(dc,n)),e.base64url=n=>e.check(Ps(lc,n)),e.xid=n=>e.check(Es(oc,n)),e.ksuid=n=>e.check($s(ic,n)),e.ipv4=n=>e.check(Ts(sc,n)),e.ipv6=n=>e.check(Zs(ac,n)),e.cidrv4=n=>e.check(Is(cc,n)),e.cidrv6=n=>e.check(Os(uc,n)),e.e164=n=>e.check(Cs(fc,n)),e.datetime=n=>e.check(Ia(n)),e.date=n=>e.check(Aa(n)),e.time=n=>e.check(Ca(n)),e.duration=n=>e.check(Ra(n))});function Ha(e){return ps(Ka,e)}const E=d("ZodStringFormat",(e,t)=>{k.init(e,t),on.init(e,t)}),Ya=d("ZodEmail",(e,t)=>{wi.init(e,t),E.init(e,t)}),nt=d("ZodGUID",(e,t)=>{yi.init(e,t),E.init(e,t)}),ie=d("ZodUUID",(e,t)=>{vi.init(e,t),E.init(e,t)}),Qa=d("ZodURL",(e,t)=>{bi.init(e,t),E.init(e,t)}),Xa=d("ZodEmoji",(e,t)=>{ki.init(e,t),E.init(e,t)}),ec=d("ZodNanoID",(e,t)=>{zi.init(e,t),E.init(e,t)}),tc=d("ZodCUID",(e,t)=>{Si.init(e,t),E.init(e,t)}),nc=d("ZodCUID2",(e,t)=>{Ei.init(e,t),E.init(e,t)}),rc=d("ZodULID",(e,t)=>{$i.init(e,t),E.init(e,t)}),oc=d("ZodXID",(e,t)=>{Ti.init(e,t),E.init(e,t)}),ic=d("ZodKSUID",(e,t)=>{Zi.init(e,t),E.init(e,t)}),sc=d("ZodIPv4",(e,t)=>{Ci.init(e,t),E.init(e,t)}),ac=d("ZodIPv6",(e,t)=>{Ni.init(e,t),E.init(e,t)}),cc=d("ZodCIDRv4",(e,t)=>{Ri.init(e,t),E.init(e,t)}),uc=d("ZodCIDRv6",(e,t)=>{Di.init(e,t),E.init(e,t)}),dc=d("ZodBase64",(e,t)=>{ji.init(e,t),E.init(e,t)}),lc=d("ZodBase64URL",(e,t)=>{Ui.init(e,t),E.init(e,t)}),fc=d("ZodE164",(e,t)=>{Mi.init(e,t),E.init(e,t)}),pc=d("ZodJWT",(e,t)=>{Fi.init(e,t),E.init(e,t)}),sn=d("ZodNumber",(e,t)=>{Bt.init(e,t),S.init(e,t),e._zod.processJSONSchema=(r,o,i)=>ca(e,r,o),e.gt=(r,o)=>e.check(et(r,o)),e.gte=(r,o)=>e.check(me(r,o)),e.min=(r,o)=>e.check(me(r,o)),e.lt=(r,o)=>e.check(Xe(r,o)),e.lte=(r,o)=>e.check(he(r,o)),e.max=(r,o)=>e.check(he(r,o)),e.int=r=>e.check(rt(r)),e.safe=r=>e.check(rt(r)),e.positive=r=>e.check(et(0,r)),e.nonnegative=r=>e.check(me(0,r)),e.negative=r=>e.check(Xe(0,r)),e.nonpositive=r=>e.check(he(0,r)),e.multipleOf=(r,o)=>e.check(tt(r,o)),e.step=(r,o)=>e.check(tt(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 gc(e){return Us(sn,e)}const hc=d("ZodNumberFormat",(e,t)=>{Ji.init(e,t),sn.init(e,t)});function rt(e){return Ms(hc,e)}const mc=d("ZodBoolean",(e,t)=>{qi.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ua(e,n,r)});function _c(e){return xs(mc,e)}const yc=d("ZodUnknown",(e,t)=>{Wi.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>la()});function ke(){return Fs(yc)}const vc=d("ZodNever",(e,t)=>{Vi.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>da(e,n,r)});function wc(e){return Js(vc,e)}const bc=d("ZodArray",(e,t)=>{Gi.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ma(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(ue(n,r)),e.nonempty=n=>e.check(ue(1,n)),e.max=(n,r)=>e.check(Qt(n,r)),e.length=(n,r)=>e.check(Xt(n,r)),e.unwrap=()=>e.element});function an(e,t){return ta(bc,e,t)}const kc=d("ZodObject",(e,t)=>{Ki.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_a(e,n,r,o),v(e,"shape",()=>t.shape),e.keyof=()=>un(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ke()}),e.loose=()=>e.clone({...e._zod.def,catchall:ke()}),e.strict=()=>e.clone({...e._zod.def,catchall:wc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>mo(e,n),e.safeExtend=n=>_o(e,n),e.merge=n=>yo(e,n),e.pick=n=>go(e,n),e.omit=n=>ho(e,n),e.partial=(...n)=>vo(dn,e,n[0]),e.required=(...n)=>wo(ln,e,n[0])});function zc(e,t){const n={type:"object",shape:e??{},...h(t)};return new kc(n)}const Sc=d("ZodUnion",(e,t)=>{Hi.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ya(e,n,r,o),e.options=t.options});function cn(e,t){return new Sc({type:"union",options:e,...h(t)})}const Ec=d("ZodIntersection",(e,t)=>{Yi.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>va(e,n,r,o)});function $c(e,t){return new Ec({type:"intersection",left:e,right:t})}const Tc=d("ZodRecord",(e,t)=>{Qi.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wa(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Zc(e,t,n){return new Tc({type:"record",keyType:e,valueType:t,...h(n)})}const ze=d("ZodEnum",(e,t)=>{Xi.init(e,t),S.init(e,t),e._zod.processJSONSchema=(r,o,i)=>fa(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ze({...t,checks:[],...h(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new ze({...t,checks:[],...h(o),entries:i})}});function un(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ze({type:"enum",entries:n,...h(t)})}const Ic=d("ZodLiteral",(e,t)=>{es.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pa(e,n,r),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 Oc(e,t){return new Ic({type:"literal",values:Array.isArray(e)?e:[e],...h(t)})}const Ac=d("ZodTransform",(e,t)=>{ts.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ha(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Pt(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(ne(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(ne(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function Pc(e){return new Ac({type:"transform",transform:e})}const dn=d("ZodOptional",(e,t)=>{Yt.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rn(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ot(e){return new dn({type:"optional",innerType:e})}const Cc=d("ZodExactOptional",(e,t)=>{ns.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rn(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Nc(e){return new Cc({type:"optional",innerType:e})}const Rc=d("ZodNullable",(e,t)=>{rs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ba(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function it(e){return new Rc({type:"nullable",innerType:e})}const Dc=d("ZodDefault",(e,t)=>{os.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>za(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jc(e,t){return new Dc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Dt(t)}})}const Lc=d("ZodPrefault",(e,t)=>{is.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sa(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Uc(e,t){return new Lc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Dt(t)}})}const ln=d("ZodNonOptional",(e,t)=>{ss.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ka(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Mc(e,t){return new ln({type:"nonoptional",innerType:e,...h(t)})}const xc=d("ZodCatch",(e,t)=>{as.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ea(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fc(e,t){return new xc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Jc=d("ZodPipe",(e,t)=>{cs.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$a(e,n,r,o),e.in=t.in,e.out=t.out});function st(e,t){return new Jc({type:"pipe",in:e,out:t})}const qc=d("ZodReadonly",(e,t)=>{us.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ta(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Wc(e){return new qc({type:"readonly",innerType:e})}const Vc=d("ZodCustom",(e,t)=>{ds.init(e,t),S.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ga(e,n)});function Gc(e,t={}){return na(Vc,e,t)}function Bc(e){return ra(e)}exports.BaseWidget=Kn;exports.DEFAULT_WIDGET_THEME_TOKENS=ye;exports._enum=un;exports.adaptBackendEvent=tr;exports.array=an;exports.basketAddEvent=Sn;exports.boolean=_c;exports.bootstrapSession=ft;exports.buildChatEndpointUrl=Wr;exports.chatHistorySnapshotEvent=kn;exports.checkoutCompleteEvent=dt;exports.checkoutStartEvent=ut;exports.consumeStream=yt;exports.debugLog=se;exports.defaultUnknownUISpecRenderer=at;exports.dismissGlobalErrorToast=_t;exports.dispatch=Nn;exports.getGlobalErrorMessage=Jn;exports.getSuggestedSearchKeywords=vt;exports.getSuggestedSearchKeywordsText=wt;exports.getWindowPageContext=Ln;exports.isSafeImageUrl=An;exports.isSafeUrl=Se;exports.listen=B;exports.literal=Oc;exports.llmUsageEvent=wn;exports.mergeUISpecRegistry=gn;exports.meteringIncrementEvent=bn;exports.meteringSummaryEvent=ct;exports.normalizeMiddlewareUrl=$t;exports.normalizeProductGroupingsResponse=Jr;exports.normalizeSimilarProductsResponse=Fr;exports.number=gc;exports.object=zc;exports.productToNormalized=j;exports.record=Zc;exports.registerGlobalErrorToastListener=ht;exports.renderUISpecWithRegistry=pn;exports.resolveSession=pt;exports.safeSetAttribute=Pn;exports.sanitizeHtml=Cn;exports.showGlobalErrorToast=mt;exports.streamChunkEvent=mn;exports.streamDoneEvent=yn;exports.streamErrorEvent=vn;exports.streamPost=Qn;exports.streamStartEvent=hn;exports.streamUiSpecEvent=_n;exports.string=Ha;exports.trackCartAdd=Ot;exports.trackCompareClear=Yr;exports.trackComparePreselection=Kr;exports.trackCompareReceived=Qr;exports.trackCompareSelected=Hr;exports.trackConversationStart=oo;exports.trackFindSimilars=Br;exports.trackInit=Tt;exports.trackLikeList=eo;exports.trackLikeProduct=Xr;exports.trackMessageReceived=ro;exports.trackMessageSent=no;exports.trackProductDetail=It;exports.trackSearch=to;exports.trackShow=ve;exports.trackSuggestedQuestion=Zt;exports.trackVoiceInput=At;exports.union=cn;exports.unknown=ke;exports.updatePageContext=Un;exports.widgetHistorySnapshotEvent=zn;exports.wireGADataLayer=so;exports.wireQNAToChat=Dn;exports.wireSimilarToChat=jn;exports.withDefaultWidgetTheme=gt;
86
- //# sourceMappingURL=schemas-CaaT5BuE.cjs.map
86
+ //# sourceMappingURL=schemas-DqUVzVDf.cjs.map