@expedite-commerce/expedite-components 0.2.135 → 0.2.137
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.
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* vue-router-lwc v1.0.4
|
|
26
26
|
* (c) 2024 Eduardo San Martin Morote
|
|
27
27
|
* @license MIT
|
|
28
|
-
*/var _f;(function(e){e.pop="pop",e.push="push"})(_f||(_f={}));var xf;(function(e){e.back="back",e.forward="forward",e.unknown=""})(xf||(xf={}));var Cf;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Cf||(Cf={}));const N3=Symbol(""),L3=Symbol("");function Va(){return Pr(N3)}function P3(){return Pr(L3)}function pn(e,n,t){let r;return function(...i){const a=()=>{r=null,t||e.apply(this,i)},s=t&&!r;clearTimeout(r),r=setTimeout(a,n||500),s&&e.apply(this,i)}}function Gl(e,n=window.location.href){const t=n.match(new RegExp(`[?&]${e}=([^&]+)`));return t?decodeURIComponent(t[1]):null}function za(e,n={},t=!0){const r=(o,i="")=>{let a={};for(let s in o){const l=t?s.toLowerCase():s,u=i?`${i}.${l}`:l,c=o[s];typeof c=="object"&&c!==null&&!Array.isArray(c)?Object.assign(a,r(c,u)):Array.isArray(c)?a[u]=c.map(h=>typeof h=="object"&&h!==null?r(h):h):a[u]=c}return{...a,...n}};return Array.isArray(e)?e.map(o=>r(o)):r(e)}function q3(e,n){var r;let t="";return typeof e=="string"?t=e:(r=e.body)!=null&&r.message?t=e.body.message:e.message?t=e.message:t=JSON.stringify(e),{message:t,variant:"error",mode:n||"dismissable"}}function $3(e,n){var r;let t="";return typeof e=="string"?t=e:(r=e.body)!=null&&r.message?t=e.body.message:e.message?t=e.message:t=JSON.stringify(e),{message:t,variant:"success",mode:n||"dismissable"}}function U3(e){try{const n=new URL(e),t=n.protocol,r=n.hostname,o=n.port?":"+n.port:"";return t+"//"+r+o}catch{return null}}function Ef(e){if(!e)return;const n=e.split("/"),t=n[0],r=n[1],o=n[2];return new Date(`${o}-${t}-${r}`).toISOString().split("T")[0]}function j3(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsDataURL(e),r.onloadend=()=>{n(r.result)},r.onerror=t})}function Kr(){let e=Date.now().toString();return"xxxxxxxxxxxxxxxxxx".replace(/[x]/g,()=>{const t=(parseInt(e.slice(-1))+Math.random()*16)%16|0;return e=Math.floor(parseInt(e)/16).toString(),t.toString(16)})}function kf(e,n){if(typeof e=="string"&&(e=JSON.parse(e)),e!=null&&e.XX_ORD1__Layout_JSON__c&&(typeof e.XX_ORD1__Layout_JSON__c=="string"?e=JSON.parse(e.XX_ORD1__Layout_JSON__c):e=e.XX_ORD1__Layout_JSON__c),e!=null&&e.errorMessage)throw new Error(e.errorMessage);if(e==null||e==="null"||e==="undefined"||e==="")throw new Error(n);return e}const Af=e=>e>=1024*1024?(e/(1024*1024)).toFixed(2)+" MB":(e/1024).toFixed(2)+" KB",H3=e=>{document.title=e},V3=(e,n,t)=>{if(typeof localStorage<"u"){const r=t?JSON.stringify(n):n;localStorage.setItem(e,r)}};function vt(e,n,t,r=!1,o=!1){if(!n)return e;if(t&&(t==null?void 0:t.toUpperCase())==="CURRENCY"&&!r){const s=n.split("."),l=s[s.length-1],u=s.slice(0,-1).reduce((p,f)=>(p==null?void 0:p[f])??{},e);let c=l.replace(/[_.]/g,"");o&&(c=c.toLowerCase());let h=c+"Formatted";o&&(h=h.toLowerCase());let d;if(n.includes("XX_ORD1__Item__r")){let p=n.replace(/[_.]/g,"")+"Formatted";o&&(p=p.toLowerCase()),d=(u==null?void 0:u[p])??(u==null?void 0:u[h])??(u==null?void 0:u[c])??(u==null?void 0:u[l])}else d=(u==null?void 0:u[h])??(u==null?void 0:u[c])??(u==null?void 0:u[l]);return typeof d=="string"&&d&&d[0]!=="("&&(d=d.split("(")[0]),d??""}return n.split(".").reduce((s,l)=>(s==null?void 0:s[l])??"",e)}const wn=Lt("error",{state:()=>({toast:{message:"",variant:"",mode:""},errorPopup:null}),actions:{handleError(e,n){this.toast=q3(e),n&&console.info("[ERROR]: from = ",n),console.info("[ERROR]: error = ",e)},handleSuccess(e){this.toast=$3(e)},handleWarning(e){this.toast={message:e,variant:"warning",mode:""}},setDefaultErrorPopup(e){this.errorPopup={title:"Error",description:e,button:{label:"OK",action:function(){this.errorPopup=null}}}}}}),wf=Lt("comShare",()=>{const e=G({}),n=G(""),t=G(""),r=G(""),o=G(""),i=G(""),a=G(""),s=G(""),l=G(""),u=G("Single"),c=G({}),h=be(()=>u.value==="Single"),d=G({});function p(g){var m;return!g||g.includes("http")||g.includes("://")||!((m=d.value)!=null&&m.siteUrl)?g:`${d.value.siteUrl}${g}`}async function f(g,m,v,y){n.value=g.orgType||"Production",t.value=g.orgId||"",r.value=g.userId||"",o.value=g.accountId||"",i.value=g.opportunityId||"",l.value=g.userLocale||"en_US",u.value=g.pricingSchema||"Single",e.value=m||{},c.value=v||{},d.value=y||{}}return{orgType:n,orgId:t,userId:r,accountId:o,opportunityId:i,userLocale:l,pricingSchema:u,quoteId:a,eCatalogId:s,isSinglePricingSchema:h,securityContext:e,functions:c,setSetupData:f,getFullUrl:p}});function Xl(e){if(!e)return{};const n=o=>!o||!Array.isArray(o)?[]:o.map(i=>({label:i.label,value:i.value})),t={name:e.itemName,qty:e.qty||1,salesPrice:e.price||0,attributes:n(e.attributes)},r=[];return e.categoryOptions.forEach(o=>{o.itemTypes.forEach(i=>{i.options.forEach(a=>{i.selected.includes(a.itemId)&&r.push({name:a.itemName,qty:a.qty||1,salesPrice:a.price||0,attributes:n(a.attributes)})})})}),JSON.stringify({product:t,options:r})}function If(e){if(!e)return{};const n=o=>!o||!Array.isArray(o)?[]:JSON.parse(JSON.stringify(o)),t=new Map,r=new Map;return t.set(e.itemId,{itemName:e.itemName,qty:e.qty,price:e.price,attributes:n(e.attributes)}),e.categoryOptions.forEach(o=>{o.itemTypes.forEach(i=>{r.set(i.itemTypeId,JSON.parse(JSON.stringify(i.selected))),i.options.forEach(a=>{t.set(a.itemId,{itemName:a.itemName,qty:a.qty,price:a.price,attributes:n(a.attributes)})})})}),{itemMapById:t,selectedItemsByTypeMap:r}}function Sf(e,n){return function(){return e.apply(n,arguments)}}const{toString:z3}=Object.prototype,{getPrototypeOf:Wl}=Object,{iterator:Ka,toStringTag:Of}=Symbol,Ga=(e=>n=>{const t=z3.call(n);return e[t]||(e[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Vn=e=>(e=e.toLowerCase(),n=>Ga(n)===e),Xa=e=>n=>typeof n===e,{isArray:Po}=Array,qo=Xa("undefined");function Ai(e){return e!==null&&!qo(e)&&e.constructor!==null&&!qo(e.constructor)&&mn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Tf=Vn("ArrayBuffer");function K3(e){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&Tf(e.buffer),n}const G3=Xa("string"),mn=Xa("function"),Df=Xa("number"),wi=e=>e!==null&&typeof e=="object",X3=e=>e===!0||e===!1,Wa=e=>{if(Ga(e)!=="object")return!1;const n=Wl(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Of in e)&&!(Ka in e)},W3=e=>{if(!wi(e)||Ai(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Q3=Vn("Date"),Z3=Vn("File"),J3=Vn("Blob"),Y3=Vn("FileList"),e4=e=>wi(e)&&mn(e.pipe),t4=e=>{let n;return e&&(typeof FormData=="function"&&e instanceof FormData||mn(e.append)&&((n=Ga(e))==="formdata"||n==="object"&&mn(e.toString)&&e.toString()==="[object FormData]"))},n4=Vn("URLSearchParams"),[r4,o4,i4,a4]=["ReadableStream","Request","Response","Headers"].map(Vn),s4=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ii(e,n,{allOwnKeys:t=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Po(e))for(r=0,o=e.length;r<o;r++)n.call(null,e[r],r,e);else{if(Ai(e))return;const i=t?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let s;for(r=0;r<a;r++)s=i[r],n.call(null,e[s],s,e)}}function Rf(e,n){if(Ai(e))return null;n=n.toLowerCase();const t=Object.keys(e);let r=t.length,o;for(;r-- >0;)if(o=t[r],n===o.toLowerCase())return o;return null}const mo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Mf=e=>!qo(e)&&e!==mo;function Ql(){const{caseless:e,skipUndefined:n}=Mf(this)&&this||{},t={},r=(o,i)=>{const a=e&&Rf(t,i)||i;Wa(t[a])&&Wa(o)?t[a]=Ql(t[a],o):Wa(o)?t[a]=Ql({},o):Po(o)?t[a]=o.slice():(!n||!qo(o))&&(t[a]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&Ii(arguments[o],r);return t}const l4=(e,n,t,{allOwnKeys:r}={})=>(Ii(n,(o,i)=>{t&&mn(o)?e[i]=Sf(o,t):e[i]=o},{allOwnKeys:r}),e),u4=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),c4=(e,n,t,r)=>{e.prototype=Object.create(n.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),t&&Object.assign(e.prototype,t)},d4=(e,n,t,r)=>{let o,i,a;const s={};if(n=n||{},e==null)return n;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],(!r||r(a,e,n))&&!s[a]&&(n[a]=e[a],s[a]=!0);e=t!==!1&&Wl(e)}while(e&&(!t||t(e,n))&&e!==Object.prototype);return n},f4=(e,n,t)=>{e=String(e),(t===void 0||t>e.length)&&(t=e.length),t-=n.length;const r=e.indexOf(n,t);return r!==-1&&r===t},h4=e=>{if(!e)return null;if(Po(e))return e;let n=e.length;if(!Df(n))return null;const t=new Array(n);for(;n-- >0;)t[n]=e[n];return t},p4=(e=>n=>e&&n instanceof e)(typeof Uint8Array<"u"&&Wl(Uint8Array)),m4=(e,n)=>{const r=(e&&e[Ka]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;n.call(e,i[0],i[1])}},g4=(e,n)=>{let t;const r=[];for(;(t=e.exec(n))!==null;)r.push(t);return r},y4=Vn("HTMLFormElement"),v4=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,o){return r.toUpperCase()+o}),Ff=(({hasOwnProperty:e})=>(n,t)=>e.call(n,t))(Object.prototype),b4=Vn("RegExp"),Bf=(e,n)=>{const t=Object.getOwnPropertyDescriptors(e),r={};Ii(t,(o,i)=>{let a;(a=n(o,i,e))!==!1&&(r[i]=a||o)}),Object.defineProperties(e,r)},_4=e=>{Bf(e,(n,t)=>{if(mn(e)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=e[t];if(mn(r)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},x4=(e,n)=>{const t={},r=o=>{o.forEach(i=>{t[i]=!0})};return Po(e)?r(e):r(String(e).split(n)),t},C4=()=>{},E4=(e,n)=>e!=null&&Number.isFinite(e=+e)?e:n;function k4(e){return!!(e&&mn(e.append)&&e[Of]==="FormData"&&e[Ka])}const A4=e=>{const n=new Array(10),t=(r,o)=>{if(wi(r)){if(n.indexOf(r)>=0)return;if(Ai(r))return r;if(!("toJSON"in r)){n[o]=r;const i=Po(r)?[]:{};return Ii(r,(a,s)=>{const l=t(a,o+1);!qo(l)&&(i[s]=l)}),n[o]=void 0,i}}return r};return t(e,0)},w4=Vn("AsyncFunction"),I4=e=>e&&(wi(e)||mn(e))&&mn(e.then)&&mn(e.catch),Nf=((e,n)=>e?setImmediate:n?((t,r)=>(mo.addEventListener("message",({source:o,data:i})=>{o===mo&&i===t&&r.length&&r.shift()()},!1),o=>{r.push(o),mo.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",mn(mo.postMessage)),S4=typeof queueMicrotask<"u"?queueMicrotask.bind(mo):typeof process<"u"&&process.nextTick||Nf,we={isArray:Po,isArrayBuffer:Tf,isBuffer:Ai,isFormData:t4,isArrayBufferView:K3,isString:G3,isNumber:Df,isBoolean:X3,isObject:wi,isPlainObject:Wa,isEmptyObject:W3,isReadableStream:r4,isRequest:o4,isResponse:i4,isHeaders:a4,isUndefined:qo,isDate:Q3,isFile:Z3,isBlob:J3,isRegExp:b4,isFunction:mn,isStream:e4,isURLSearchParams:n4,isTypedArray:p4,isFileList:Y3,forEach:Ii,merge:Ql,extend:l4,trim:s4,stripBOM:u4,inherits:c4,toFlatObject:d4,kindOf:Ga,kindOfTest:Vn,endsWith:f4,toArray:h4,forEachEntry:m4,matchAll:g4,isHTMLForm:y4,hasOwnProperty:Ff,hasOwnProp:Ff,reduceDescriptors:Bf,freezeMethods:_4,toObjectSet:x4,toCamelCase:v4,noop:C4,toFiniteNumber:E4,findKey:Rf,global:mo,isContextDefined:Mf,isSpecCompliantForm:k4,toJSONObject:A4,isAsyncFn:w4,isThenable:I4,setImmediate:Nf,asap:S4,isIterable:e=>e!=null&&mn(e[Ka])};function Je(e,n,t,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",n&&(this.code=n),t&&(this.config=t),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}we.inherits(Je,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:we.toJSONObject(this.config),code:this.code,status:this.status}}});const Lf=Je.prototype,Pf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Pf[e]={value:e}}),Object.defineProperties(Je,Pf),Object.defineProperty(Lf,"isAxiosError",{value:!0}),Je.from=(e,n,t,r,o,i)=>{const a=Object.create(Lf);we.toFlatObject(e,a,function(c){return c!==Error.prototype},u=>u!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=n==null&&e?e.code:n;return Je.call(a,s,l,t,r,o),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const O4=null;function Zl(e){return we.isPlainObject(e)||we.isArray(e)}function qf(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function $f(e,n,t){return e?e.concat(n).map(function(o,i){return o=qf(o),!t&&i?"["+o+"]":o}).join(t?".":""):n}function T4(e){return we.isArray(e)&&!e.some(Zl)}const D4=we.toFlatObject(we,{},null,function(n){return/^is[A-Z]/.test(n)});function Qa(e,n,t){if(!we.isObject(e))throw new TypeError("target must be an object");n=n||new FormData,t=we.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!we.isUndefined(m[g])});const r=t.metaTokens,o=t.visitor||c,i=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&we.isSpecCompliantForm(n);if(!we.isFunction(o))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(we.isDate(f))return f.toISOString();if(we.isBoolean(f))return f.toString();if(!l&&we.isBlob(f))throw new Je("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(f)||we.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,g,m){let v=f;if(f&&!m&&typeof f=="object"){if(we.endsWith(g,"{}"))g=r?g:g.slice(0,-2),f=JSON.stringify(f);else if(we.isArray(f)&&T4(f)||(we.isFileList(f)||we.endsWith(g,"[]"))&&(v=we.toArray(f)))return g=qf(g),v.forEach(function(b,_){!(we.isUndefined(b)||b===null)&&n.append(a===!0?$f([g],_,i):a===null?g:g+"[]",u(b))}),!1}return Zl(f)?!0:(n.append($f(m,g,i),u(f)),!1)}const h=[],d=Object.assign(D4,{defaultVisitor:c,convertValue:u,isVisitable:Zl});function p(f,g){if(!we.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));h.push(f),we.forEach(f,function(v,y){(!(we.isUndefined(v)||v===null)&&o.call(n,v,we.isString(y)?y.trim():y,g,d))===!0&&p(v,g?g.concat(y):[y])}),h.pop()}}if(!we.isObject(e))throw new TypeError("data must be an object");return p(e),n}function Uf(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return n[r]})}function Jl(e,n){this._pairs=[],e&&Qa(e,this,n)}const jf=Jl.prototype;jf.append=function(n,t){this._pairs.push([n,t])},jf.toString=function(n){const t=n?function(r){return n.call(this,r,Uf)}:Uf;return this._pairs.map(function(o){return t(o[0])+"="+t(o[1])},"").join("&")};function R4(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Hf(e,n,t){if(!n)return e;const r=t&&t.encode||R4;we.isFunction(t)&&(t={serialize:t});const o=t&&t.serialize;let i;if(o?i=o(n,t):i=we.isURLSearchParams(n)?n.toString():new Jl(n,t).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Vf{constructor(){this.handlers=[]}use(n,t,r){return this.handlers.push({fulfilled:n,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){we.forEach(this.handlers,function(r){r!==null&&n(r)})}}const zf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},M4={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Jl,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Yl=typeof window<"u"&&typeof document<"u",eu=typeof navigator=="object"&&navigator||void 0,F4=Yl&&(!eu||["ReactNative","NativeScript","NS"].indexOf(eu.product)<0),B4=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",N4=Yl&&window.location.href||"http://localhost",Kt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Yl,hasStandardBrowserEnv:F4,hasStandardBrowserWebWorkerEnv:B4,navigator:eu,origin:N4},Symbol.toStringTag,{value:"Module"})),...M4};function L4(e,n){return Qa(e,new Kt.classes.URLSearchParams,{visitor:function(t,r,o,i){return Kt.isNode&&we.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...n})}function P4(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map(n=>n[0]==="[]"?"":n[1]||n[0])}function q4(e){const n={},t=Object.keys(e);let r;const o=t.length;let i;for(r=0;r<o;r++)i=t[r],n[i]=e[i];return n}function Kf(e){function n(t,r,o,i){let a=t[i++];if(a==="__proto__")return!0;const s=Number.isFinite(+a),l=i>=t.length;return a=!a&&we.isArray(o)?o.length:a,l?(we.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!s):((!o[a]||!we.isObject(o[a]))&&(o[a]=[]),n(t,r,o[a],i)&&we.isArray(o[a])&&(o[a]=q4(o[a])),!s)}if(we.isFormData(e)&&we.isFunction(e.entries)){const t={};return we.forEachEntry(e,(r,o)=>{n(P4(r),o,t,0)}),t}return null}function $4(e,n,t){if(we.isString(e))try{return(n||JSON.parse)(e),we.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(e)}const tu={transitional:zf,adapter:["xhr","http","fetch"],transformRequest:[function(n,t){const r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=we.isObject(n);if(i&&we.isHTMLForm(n)&&(n=new FormData(n)),we.isFormData(n))return o?JSON.stringify(Kf(n)):n;if(we.isArrayBuffer(n)||we.isBuffer(n)||we.isStream(n)||we.isFile(n)||we.isBlob(n)||we.isReadableStream(n))return n;if(we.isArrayBufferView(n))return n.buffer;if(we.isURLSearchParams(n))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return L4(n,this.formSerializer).toString();if((s=we.isFileList(n))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Qa(s?{"files[]":n}:n,l&&new l,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),$4(n)):n}],transformResponse:[function(n){const t=this.transitional||tu.transitional,r=t&&t.forcedJSONParsing,o=this.responseType==="json";if(we.isResponse(n)||we.isReadableStream(n))return n;if(n&&we.isString(n)&&(r&&!this.responseType||o)){const a=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(n,this.parseReviver)}catch(s){if(a)throw s.name==="SyntaxError"?Je.from(s,Je.ERR_BAD_RESPONSE,this,null,this.response):s}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kt.classes.FormData,Blob:Kt.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],e=>{tu.headers[e]={}});const nu=tu,U4=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),j4=e=>{const n={};let t,r,o;return e&&e.split(`
|
|
28
|
+
*/var _f;(function(e){e.pop="pop",e.push="push"})(_f||(_f={}));var xf;(function(e){e.back="back",e.forward="forward",e.unknown=""})(xf||(xf={}));var Cf;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Cf||(Cf={}));const N3=Symbol(""),L3=Symbol("");function Va(){return Pr(N3)}function P3(){return Pr(L3)}function pn(e,n,t){let r;return function(...i){const a=()=>{r=null,t||e.apply(this,i)},s=t&&!r;clearTimeout(r),r=setTimeout(a,n||500),s&&e.apply(this,i)}}function Gl(e,n=window.location.href){const t=n.match(new RegExp(`[?&]${e}=([^&]+)`));return t?decodeURIComponent(t[1]):null}function za(e,n={},t=!0){const r=(o,i="")=>{let a={};for(let s in o){const l=t?s.toLowerCase():s,u=i?`${i}.${l}`:l,c=o[s];typeof c=="object"&&c!==null&&!Array.isArray(c)?Object.assign(a,r(c,u)):Array.isArray(c)?a[u]=c.map(h=>typeof h=="object"&&h!==null?r(h):h):a[u]=c}return{...a,...n}};return Array.isArray(e)?e.map(o=>r(o)):r(e)}function q3(e,n){var r;let t="";return typeof e=="string"?t=e:(r=e.body)!=null&&r.message?t=e.body.message:e.message?t=e.message:t=JSON.stringify(e),{message:t,variant:"error",mode:n||"dismissable"}}function $3(e,n){var r;let t="";return typeof e=="string"?t=e:(r=e.body)!=null&&r.message?t=e.body.message:e.message?t=e.message:t=JSON.stringify(e),{message:t,variant:"success",mode:n||"dismissable"}}function U3(e){try{const n=new URL(e),t=n.protocol,r=n.hostname,o=n.port?":"+n.port:"";return t+"//"+r+o}catch{return null}}function Ef(e){if(!e)return;const n=e.split("/"),t=n[0],r=n[1],o=n[2];return new Date(`${o}-${t}-${r}`).toISOString().split("T")[0]}function j3(e){return new Promise((n,t)=>{const r=new FileReader;r.readAsDataURL(e),r.onloadend=()=>{n(r.result)},r.onerror=t})}function Kr(){let e=Date.now().toString();return"xxxxxxxxxxxxxxxxxx".replace(/[x]/g,()=>{const t=(parseInt(e.slice(-1))+Math.random()*16)%16|0;return e=Math.floor(parseInt(e)/16).toString(),t.toString(16)})}function kf(e,n){if(typeof e=="string"&&(e=JSON.parse(e)),e!=null&&e.XX_ORD1__Layout_JSON__c&&(typeof e.XX_ORD1__Layout_JSON__c=="string"?e=JSON.parse(e.XX_ORD1__Layout_JSON__c):e=e.XX_ORD1__Layout_JSON__c),e!=null&&e.errorMessage)throw new Error(e.errorMessage);if(e==null||e==="null"||e==="undefined"||e==="")throw new Error(n);return e}const Af=e=>e>=1024*1024?(e/(1024*1024)).toFixed(2)+" MB":(e/1024).toFixed(2)+" KB",H3=e=>{document.title=e},V3=(e,n,t)=>{if(typeof localStorage<"u"){const r=t?JSON.stringify(n):n;localStorage.setItem(e,r)}};function vt(e,n,t,r=!1,o=!1){if(!n)return e;if(t&&(t==null?void 0:t.toUpperCase())==="CURRENCY"&&!r){const s=n.split("."),l=s[s.length-1],u=s.slice(0,-1).reduce((p,f)=>(p==null?void 0:p[f])??{},e);let c=l.replace(/[_.]/g,"");o&&(c=c.toLowerCase());let h=c+"Formatted";o&&(h=h.toLowerCase());let d;if(n.includes("XX_ORD1__Item__r")){let p=n.replace(/[_.]/g,"")+"Formatted";o&&(p=p.toLowerCase()),d=(u==null?void 0:u[p])??(u==null?void 0:u[h])??(u==null?void 0:u[c])??(u==null?void 0:u[l])}else d=(u==null?void 0:u[h])??(u==null?void 0:u[c])??(u==null?void 0:u[l]);return typeof d=="string"&&d&&d[0]!=="("&&(d=d.split("(")[0]),d??""}return n.split(".").reduce((s,l)=>(s==null?void 0:s[l])??"",e)}const wn=Lt("error",{state:()=>({toast:{message:"",variant:"",mode:""},errorPopup:null}),actions:{handleError(e,n){this.toast=q3(e),n&&console.info("[ERROR]: from = ",n),console.info("[ERROR]: error = ",e)},handleSuccess(e){this.toast=$3(e)},handleWarning(e){this.toast={message:e,variant:"warning",mode:""}},setDefaultErrorPopup(e){this.errorPopup={title:"Error",description:e,button:{label:"OK",action:function(){this.errorPopup=null}}}}}}),wf=Lt("comShare",()=>{const e=G({}),n=G(""),t=G(""),r=G(""),o=G(""),i=G(""),a=G(""),s=G(""),l=G(""),u=G("Single"),c=G({}),h=be(()=>u.value==="Single"),d=G({});function p(g){var y;if(!g||g.includes("://")||!((y=d.value)!=null&&y.siteUrl))return g;if(/^[\w-]+(\.[\w-]+)+\//.test(g))return`https://${g}`;const m=d.value.siteUrl.replace(/\/+$/,""),v=g.replace(/^(?:\.\.?\/)+/,"").replace(/^\/+/,"");return`${m}/${v}`}async function f(g,m,v,y){n.value=g.orgType||"Production",t.value=g.orgId||"",r.value=g.userId||"",o.value=g.accountId||"",i.value=g.opportunityId||"",l.value=g.userLocale||"en_US",u.value=g.pricingSchema||"Single",e.value=m||{},c.value=v||{},d.value=y||{}}return{orgType:n,orgId:t,userId:r,accountId:o,opportunityId:i,userLocale:l,pricingSchema:u,quoteId:a,eCatalogId:s,isSinglePricingSchema:h,securityContext:e,functions:c,setSetupData:f,getFullUrl:p}});function Xl(e){if(!e)return{};const n=o=>!o||!Array.isArray(o)?[]:o.map(i=>({label:i.label,value:i.value})),t={name:e.itemName,qty:e.qty||1,salesPrice:e.price||0,attributes:n(e.attributes)},r=[];return e.categoryOptions.forEach(o=>{o.itemTypes.forEach(i=>{i.options.forEach(a=>{i.selected.includes(a.itemId)&&r.push({name:a.itemName,qty:a.qty||1,salesPrice:a.price||0,attributes:n(a.attributes)})})})}),JSON.stringify({product:t,options:r})}function If(e){if(!e)return{};const n=o=>!o||!Array.isArray(o)?[]:JSON.parse(JSON.stringify(o)),t=new Map,r=new Map;return t.set(e.itemId,{itemName:e.itemName,qty:e.qty,price:e.price,attributes:n(e.attributes)}),e.categoryOptions.forEach(o=>{o.itemTypes.forEach(i=>{r.set(i.itemTypeId,JSON.parse(JSON.stringify(i.selected))),i.options.forEach(a=>{t.set(a.itemId,{itemName:a.itemName,qty:a.qty,price:a.price,attributes:n(a.attributes)})})})}),{itemMapById:t,selectedItemsByTypeMap:r}}function Sf(e,n){return function(){return e.apply(n,arguments)}}const{toString:z3}=Object.prototype,{getPrototypeOf:Wl}=Object,{iterator:Ka,toStringTag:Of}=Symbol,Ga=(e=>n=>{const t=z3.call(n);return e[t]||(e[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Vn=e=>(e=e.toLowerCase(),n=>Ga(n)===e),Xa=e=>n=>typeof n===e,{isArray:Po}=Array,qo=Xa("undefined");function Ai(e){return e!==null&&!qo(e)&&e.constructor!==null&&!qo(e.constructor)&&mn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Tf=Vn("ArrayBuffer");function K3(e){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&Tf(e.buffer),n}const G3=Xa("string"),mn=Xa("function"),Df=Xa("number"),wi=e=>e!==null&&typeof e=="object",X3=e=>e===!0||e===!1,Wa=e=>{if(Ga(e)!=="object")return!1;const n=Wl(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Of in e)&&!(Ka in e)},W3=e=>{if(!wi(e)||Ai(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Q3=Vn("Date"),Z3=Vn("File"),J3=Vn("Blob"),Y3=Vn("FileList"),e4=e=>wi(e)&&mn(e.pipe),t4=e=>{let n;return e&&(typeof FormData=="function"&&e instanceof FormData||mn(e.append)&&((n=Ga(e))==="formdata"||n==="object"&&mn(e.toString)&&e.toString()==="[object FormData]"))},n4=Vn("URLSearchParams"),[r4,o4,i4,a4]=["ReadableStream","Request","Response","Headers"].map(Vn),s4=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ii(e,n,{allOwnKeys:t=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Po(e))for(r=0,o=e.length;r<o;r++)n.call(null,e[r],r,e);else{if(Ai(e))return;const i=t?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let s;for(r=0;r<a;r++)s=i[r],n.call(null,e[s],s,e)}}function Rf(e,n){if(Ai(e))return null;n=n.toLowerCase();const t=Object.keys(e);let r=t.length,o;for(;r-- >0;)if(o=t[r],n===o.toLowerCase())return o;return null}const mo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Mf=e=>!qo(e)&&e!==mo;function Ql(){const{caseless:e,skipUndefined:n}=Mf(this)&&this||{},t={},r=(o,i)=>{const a=e&&Rf(t,i)||i;Wa(t[a])&&Wa(o)?t[a]=Ql(t[a],o):Wa(o)?t[a]=Ql({},o):Po(o)?t[a]=o.slice():(!n||!qo(o))&&(t[a]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&Ii(arguments[o],r);return t}const l4=(e,n,t,{allOwnKeys:r}={})=>(Ii(n,(o,i)=>{t&&mn(o)?e[i]=Sf(o,t):e[i]=o},{allOwnKeys:r}),e),u4=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),c4=(e,n,t,r)=>{e.prototype=Object.create(n.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:n.prototype}),t&&Object.assign(e.prototype,t)},d4=(e,n,t,r)=>{let o,i,a;const s={};if(n=n||{},e==null)return n;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],(!r||r(a,e,n))&&!s[a]&&(n[a]=e[a],s[a]=!0);e=t!==!1&&Wl(e)}while(e&&(!t||t(e,n))&&e!==Object.prototype);return n},f4=(e,n,t)=>{e=String(e),(t===void 0||t>e.length)&&(t=e.length),t-=n.length;const r=e.indexOf(n,t);return r!==-1&&r===t},h4=e=>{if(!e)return null;if(Po(e))return e;let n=e.length;if(!Df(n))return null;const t=new Array(n);for(;n-- >0;)t[n]=e[n];return t},p4=(e=>n=>e&&n instanceof e)(typeof Uint8Array<"u"&&Wl(Uint8Array)),m4=(e,n)=>{const r=(e&&e[Ka]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;n.call(e,i[0],i[1])}},g4=(e,n)=>{let t;const r=[];for(;(t=e.exec(n))!==null;)r.push(t);return r},y4=Vn("HTMLFormElement"),v4=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,o){return r.toUpperCase()+o}),Ff=(({hasOwnProperty:e})=>(n,t)=>e.call(n,t))(Object.prototype),b4=Vn("RegExp"),Bf=(e,n)=>{const t=Object.getOwnPropertyDescriptors(e),r={};Ii(t,(o,i)=>{let a;(a=n(o,i,e))!==!1&&(r[i]=a||o)}),Object.defineProperties(e,r)},_4=e=>{Bf(e,(n,t)=>{if(mn(e)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=e[t];if(mn(r)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},x4=(e,n)=>{const t={},r=o=>{o.forEach(i=>{t[i]=!0})};return Po(e)?r(e):r(String(e).split(n)),t},C4=()=>{},E4=(e,n)=>e!=null&&Number.isFinite(e=+e)?e:n;function k4(e){return!!(e&&mn(e.append)&&e[Of]==="FormData"&&e[Ka])}const A4=e=>{const n=new Array(10),t=(r,o)=>{if(wi(r)){if(n.indexOf(r)>=0)return;if(Ai(r))return r;if(!("toJSON"in r)){n[o]=r;const i=Po(r)?[]:{};return Ii(r,(a,s)=>{const l=t(a,o+1);!qo(l)&&(i[s]=l)}),n[o]=void 0,i}}return r};return t(e,0)},w4=Vn("AsyncFunction"),I4=e=>e&&(wi(e)||mn(e))&&mn(e.then)&&mn(e.catch),Nf=((e,n)=>e?setImmediate:n?((t,r)=>(mo.addEventListener("message",({source:o,data:i})=>{o===mo&&i===t&&r.length&&r.shift()()},!1),o=>{r.push(o),mo.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",mn(mo.postMessage)),S4=typeof queueMicrotask<"u"?queueMicrotask.bind(mo):typeof process<"u"&&process.nextTick||Nf,we={isArray:Po,isArrayBuffer:Tf,isBuffer:Ai,isFormData:t4,isArrayBufferView:K3,isString:G3,isNumber:Df,isBoolean:X3,isObject:wi,isPlainObject:Wa,isEmptyObject:W3,isReadableStream:r4,isRequest:o4,isResponse:i4,isHeaders:a4,isUndefined:qo,isDate:Q3,isFile:Z3,isBlob:J3,isRegExp:b4,isFunction:mn,isStream:e4,isURLSearchParams:n4,isTypedArray:p4,isFileList:Y3,forEach:Ii,merge:Ql,extend:l4,trim:s4,stripBOM:u4,inherits:c4,toFlatObject:d4,kindOf:Ga,kindOfTest:Vn,endsWith:f4,toArray:h4,forEachEntry:m4,matchAll:g4,isHTMLForm:y4,hasOwnProperty:Ff,hasOwnProp:Ff,reduceDescriptors:Bf,freezeMethods:_4,toObjectSet:x4,toCamelCase:v4,noop:C4,toFiniteNumber:E4,findKey:Rf,global:mo,isContextDefined:Mf,isSpecCompliantForm:k4,toJSONObject:A4,isAsyncFn:w4,isThenable:I4,setImmediate:Nf,asap:S4,isIterable:e=>e!=null&&mn(e[Ka])};function Je(e,n,t,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",n&&(this.code=n),t&&(this.config=t),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}we.inherits(Je,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:we.toJSONObject(this.config),code:this.code,status:this.status}}});const Lf=Je.prototype,Pf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Pf[e]={value:e}}),Object.defineProperties(Je,Pf),Object.defineProperty(Lf,"isAxiosError",{value:!0}),Je.from=(e,n,t,r,o,i)=>{const a=Object.create(Lf);we.toFlatObject(e,a,function(c){return c!==Error.prototype},u=>u!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=n==null&&e?e.code:n;return Je.call(a,s,l,t,r,o),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};const O4=null;function Zl(e){return we.isPlainObject(e)||we.isArray(e)}function qf(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function $f(e,n,t){return e?e.concat(n).map(function(o,i){return o=qf(o),!t&&i?"["+o+"]":o}).join(t?".":""):n}function T4(e){return we.isArray(e)&&!e.some(Zl)}const D4=we.toFlatObject(we,{},null,function(n){return/^is[A-Z]/.test(n)});function Qa(e,n,t){if(!we.isObject(e))throw new TypeError("target must be an object");n=n||new FormData,t=we.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!we.isUndefined(m[g])});const r=t.metaTokens,o=t.visitor||c,i=t.dots,a=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&we.isSpecCompliantForm(n);if(!we.isFunction(o))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(we.isDate(f))return f.toISOString();if(we.isBoolean(f))return f.toString();if(!l&&we.isBlob(f))throw new Je("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(f)||we.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,g,m){let v=f;if(f&&!m&&typeof f=="object"){if(we.endsWith(g,"{}"))g=r?g:g.slice(0,-2),f=JSON.stringify(f);else if(we.isArray(f)&&T4(f)||(we.isFileList(f)||we.endsWith(g,"[]"))&&(v=we.toArray(f)))return g=qf(g),v.forEach(function(b,_){!(we.isUndefined(b)||b===null)&&n.append(a===!0?$f([g],_,i):a===null?g:g+"[]",u(b))}),!1}return Zl(f)?!0:(n.append($f(m,g,i),u(f)),!1)}const h=[],d=Object.assign(D4,{defaultVisitor:c,convertValue:u,isVisitable:Zl});function p(f,g){if(!we.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));h.push(f),we.forEach(f,function(v,y){(!(we.isUndefined(v)||v===null)&&o.call(n,v,we.isString(y)?y.trim():y,g,d))===!0&&p(v,g?g.concat(y):[y])}),h.pop()}}if(!we.isObject(e))throw new TypeError("data must be an object");return p(e),n}function Uf(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return n[r]})}function Jl(e,n){this._pairs=[],e&&Qa(e,this,n)}const jf=Jl.prototype;jf.append=function(n,t){this._pairs.push([n,t])},jf.toString=function(n){const t=n?function(r){return n.call(this,r,Uf)}:Uf;return this._pairs.map(function(o){return t(o[0])+"="+t(o[1])},"").join("&")};function R4(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Hf(e,n,t){if(!n)return e;const r=t&&t.encode||R4;we.isFunction(t)&&(t={serialize:t});const o=t&&t.serialize;let i;if(o?i=o(n,t):i=we.isURLSearchParams(n)?n.toString():new Jl(n,t).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Vf{constructor(){this.handlers=[]}use(n,t,r){return this.handlers.push({fulfilled:n,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){we.forEach(this.handlers,function(r){r!==null&&n(r)})}}const zf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},M4={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Jl,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Yl=typeof window<"u"&&typeof document<"u",eu=typeof navigator=="object"&&navigator||void 0,F4=Yl&&(!eu||["ReactNative","NativeScript","NS"].indexOf(eu.product)<0),B4=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",N4=Yl&&window.location.href||"http://localhost",Kt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Yl,hasStandardBrowserEnv:F4,hasStandardBrowserWebWorkerEnv:B4,navigator:eu,origin:N4},Symbol.toStringTag,{value:"Module"})),...M4};function L4(e,n){return Qa(e,new Kt.classes.URLSearchParams,{visitor:function(t,r,o,i){return Kt.isNode&&we.isBuffer(t)?(this.append(r,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...n})}function P4(e){return we.matchAll(/\w+|\[(\w*)]/g,e).map(n=>n[0]==="[]"?"":n[1]||n[0])}function q4(e){const n={},t=Object.keys(e);let r;const o=t.length;let i;for(r=0;r<o;r++)i=t[r],n[i]=e[i];return n}function Kf(e){function n(t,r,o,i){let a=t[i++];if(a==="__proto__")return!0;const s=Number.isFinite(+a),l=i>=t.length;return a=!a&&we.isArray(o)?o.length:a,l?(we.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!s):((!o[a]||!we.isObject(o[a]))&&(o[a]=[]),n(t,r,o[a],i)&&we.isArray(o[a])&&(o[a]=q4(o[a])),!s)}if(we.isFormData(e)&&we.isFunction(e.entries)){const t={};return we.forEachEntry(e,(r,o)=>{n(P4(r),o,t,0)}),t}return null}function $4(e,n,t){if(we.isString(e))try{return(n||JSON.parse)(e),we.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(e)}const tu={transitional:zf,adapter:["xhr","http","fetch"],transformRequest:[function(n,t){const r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=we.isObject(n);if(i&&we.isHTMLForm(n)&&(n=new FormData(n)),we.isFormData(n))return o?JSON.stringify(Kf(n)):n;if(we.isArrayBuffer(n)||we.isBuffer(n)||we.isStream(n)||we.isFile(n)||we.isBlob(n)||we.isReadableStream(n))return n;if(we.isArrayBufferView(n))return n.buffer;if(we.isURLSearchParams(n))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return L4(n,this.formSerializer).toString();if((s=we.isFileList(n))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Qa(s?{"files[]":n}:n,l&&new l,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),$4(n)):n}],transformResponse:[function(n){const t=this.transitional||tu.transitional,r=t&&t.forcedJSONParsing,o=this.responseType==="json";if(we.isResponse(n)||we.isReadableStream(n))return n;if(n&&we.isString(n)&&(r&&!this.responseType||o)){const a=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(n,this.parseReviver)}catch(s){if(a)throw s.name==="SyntaxError"?Je.from(s,Je.ERR_BAD_RESPONSE,this,null,this.response):s}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kt.classes.FormData,Blob:Kt.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch"],e=>{tu.headers[e]={}});const nu=tu,U4=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),j4=e=>{const n={};let t,r,o;return e&&e.split(`
|
|
29
29
|
`).forEach(function(a){o=a.indexOf(":"),t=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!t||n[t]&&U4[t])&&(t==="set-cookie"?n[t]?n[t].push(r):n[t]=[r]:n[t]=n[t]?n[t]+", "+r:r)}),n},Gf=Symbol("internals");function Si(e){return e&&String(e).trim().toLowerCase()}function Za(e){return e===!1||e==null?e:we.isArray(e)?e.map(Za):String(e)}function H4(e){const n=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(e);)n[r[1]]=r[2];return n}const V4=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ru(e,n,t,r,o){if(we.isFunction(r))return r.call(this,n,t);if(o&&(n=t),!!we.isString(n)){if(we.isString(r))return n.indexOf(r)!==-1;if(we.isRegExp(r))return r.test(n)}}function z4(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,t,r)=>t.toUpperCase()+r)}function K4(e,n){const t=we.toCamelCase(" "+n);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+t,{value:function(o,i,a){return this[r].call(this,n,o,i,a)},configurable:!0})})}class Ja{constructor(n){n&&this.set(n)}set(n,t,r){const o=this;function i(s,l,u){const c=Si(l);if(!c)throw new Error("header name must be a non-empty string");const h=we.findKey(o,c);(!h||o[h]===void 0||u===!0||u===void 0&&o[h]!==!1)&&(o[h||l]=Za(s))}const a=(s,l)=>we.forEach(s,(u,c)=>i(u,c,l));if(we.isPlainObject(n)||n instanceof this.constructor)a(n,t);else if(we.isString(n)&&(n=n.trim())&&!V4(n))a(j4(n),t);else if(we.isObject(n)&&we.isIterable(n)){let s={},l,u;for(const c of n){if(!we.isArray(c))throw TypeError("Object iterator must return a key-value pair");s[u=c[0]]=(l=s[u])?we.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}a(s,t)}else n!=null&&i(t,n,r);return this}get(n,t){if(n=Si(n),n){const r=we.findKey(this,n);if(r){const o=this[r];if(!t)return o;if(t===!0)return H4(o);if(we.isFunction(t))return t.call(this,o,r);if(we.isRegExp(t))return t.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,t){if(n=Si(n),n){const r=we.findKey(this,n);return!!(r&&this[r]!==void 0&&(!t||ru(this,this[r],r,t)))}return!1}delete(n,t){const r=this;let o=!1;function i(a){if(a=Si(a),a){const s=we.findKey(r,a);s&&(!t||ru(r,r[s],s,t))&&(delete r[s],o=!0)}}return we.isArray(n)?n.forEach(i):i(n),o}clear(n){const t=Object.keys(this);let r=t.length,o=!1;for(;r--;){const i=t[r];(!n||ru(this,this[i],i,n,!0))&&(delete this[i],o=!0)}return o}normalize(n){const t=this,r={};return we.forEach(this,(o,i)=>{const a=we.findKey(r,i);if(a){t[a]=Za(o),delete t[i];return}const s=n?z4(i):String(i).trim();s!==i&&delete t[i],t[s]=Za(o),r[s]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const t=Object.create(null);return we.forEach(this,(r,o)=>{r!=null&&r!==!1&&(t[o]=n&&we.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,t])=>n+": "+t).join(`
|
|
30
30
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...t){const r=new this(n);return t.forEach(o=>r.set(o)),r}static accessor(n){const r=(this[Gf]=this[Gf]={accessors:{}}).accessors,o=this.prototype;function i(a){const s=Si(a);r[s]||(K4(o,a),r[s]=!0)}return we.isArray(n)?n.forEach(i):i(n),this}}Ja.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),we.reduceDescriptors(Ja.prototype,({value:e},n)=>{let t=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(r){this[t]=r}}}),we.freezeMethods(Ja);const zn=Ja;function ou(e,n){const t=this||nu,r=n||t,o=zn.from(r.headers);let i=r.data;return we.forEach(e,function(s){i=s.call(t,i,o.normalize(),n?n.status:void 0)}),o.normalize(),i}function Xf(e){return!!(e&&e.__CANCEL__)}function $o(e,n,t){Je.call(this,e??"canceled",Je.ERR_CANCELED,n,t),this.name="CanceledError"}we.inherits($o,Je,{__CANCEL__:!0});function Wf(e,n,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?e(t):n(new Je("Request failed with status code "+t.status,[Je.ERR_BAD_REQUEST,Je.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function G4(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}function X4(e,n){e=e||10;const t=new Array(e),r=new Array(e);let o=0,i=0,a;return n=n!==void 0?n:1e3,function(l){const u=Date.now(),c=r[i];a||(a=u),t[o]=l,r[o]=u;let h=i,d=0;for(;h!==o;)d+=t[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-a<n)return;const p=c&&u-c;return p?Math.round(d*1e3/p):void 0}}function W4(e,n){let t=0,r=1e3/n,o,i;const a=(u,c=Date.now())=>{t=c,o=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const c=Date.now(),h=c-t;h>=r?a(u,c):(o=u,i||(i=setTimeout(()=>{i=null,a(o)},r-h)))},()=>o&&a(o)]}const Ya=(e,n,t=3)=>{let r=0;const o=X4(50,250);return W4(i=>{const a=i.loaded,s=i.lengthComputable?i.total:void 0,l=a-r,u=o(l),c=a<=s;r=a;const h={loaded:a,total:s,progress:s?a/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&c?(s-a)/u:void 0,event:i,lengthComputable:s!=null,[n?"download":"upload"]:!0};e(h)},t)},Qf=(e,n)=>{const t=e!=null;return[r=>n[0]({lengthComputable:t,total:e,loaded:r}),n[1]]},Zf=e=>(...n)=>we.asap(()=>e(...n)),Q4=Kt.hasStandardBrowserEnv?((e,n)=>t=>(t=new URL(t,Kt.origin),e.protocol===t.protocol&&e.host===t.host&&(n||e.port===t.port)))(new URL(Kt.origin),Kt.navigator&&/(msie|trident)/i.test(Kt.navigator.userAgent)):()=>!0,Z4=Kt.hasStandardBrowserEnv?{write(e,n,t,r,o,i,a){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(n)}`];we.isNumber(t)&&s.push(`expires=${new Date(t).toUTCString()}`),we.isString(r)&&s.push(`path=${r}`),we.isString(o)&&s.push(`domain=${o}`),i===!0&&s.push("secure"),we.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function J4(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Y4(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}function Jf(e,n,t){let r=!J4(n);return e&&(r||t==!1)?Y4(e,n):n}const Yf=e=>e instanceof zn?{...e}:e;function go(e,n){n=n||{};const t={};function r(u,c,h,d){return we.isPlainObject(u)&&we.isPlainObject(c)?we.merge.call({caseless:d},u,c):we.isPlainObject(c)?we.merge({},c):we.isArray(c)?c.slice():c}function o(u,c,h,d){if(we.isUndefined(c)){if(!we.isUndefined(u))return r(void 0,u,h,d)}else return r(u,c,h,d)}function i(u,c){if(!we.isUndefined(c))return r(void 0,c)}function a(u,c){if(we.isUndefined(c)){if(!we.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function s(u,c,h){if(h in n)return r(u,c);if(h in e)return r(void 0,u)}const l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(u,c,h)=>o(Yf(u),Yf(c),h,!0)};return we.forEach(Object.keys({...e,...n}),function(c){const h=l[c]||o,d=h(e[c],n[c],c);we.isUndefined(d)&&h!==s||(t[c]=d)}),t}const e1=e=>{const n=go({},e);let{data:t,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=n;if(n.headers=a=zn.from(a),n.url=Hf(Jf(n.baseURL,n.url,n.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),we.isFormData(t)){if(Kt.hasStandardBrowserEnv||Kt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(we.isFunction(t.getHeaders)){const l=t.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,h])=>{u.includes(c.toLowerCase())&&a.set(c,h)})}}if(Kt.hasStandardBrowserEnv&&(r&&we.isFunction(r)&&(r=r(n)),r||r!==!1&&Q4(n.url))){const l=o&&i&&Z4.read(i);l&&a.set(o,l)}return n},e9=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(t,r){const o=e1(e);let i=o.data;const a=zn.from(o.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=o,c,h,d,p,f;function g(){p&&p(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let m=new XMLHttpRequest;m.open(o.method.toUpperCase(),o.url,!0),m.timeout=o.timeout;function v(){if(!m)return;const b=zn.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),C={data:!s||s==="text"||s==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:b,config:e,request:m};Wf(function(E){t(E),g()},function(E){r(E),g()},C),m=null}"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(v)},m.onabort=function(){m&&(r(new Je("Request aborted",Je.ECONNABORTED,e,m)),m=null)},m.onerror=function(_){const C=_&&_.message?_.message:"Network Error",k=new Je(C,Je.ERR_NETWORK,e,m);k.event=_||null,r(k),m=null},m.ontimeout=function(){let _=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||zf;o.timeoutErrorMessage&&(_=o.timeoutErrorMessage),r(new Je(_,C.clarifyTimeoutError?Je.ETIMEDOUT:Je.ECONNABORTED,e,m)),m=null},i===void 0&&a.setContentType(null),"setRequestHeader"in m&&we.forEach(a.toJSON(),function(_,C){m.setRequestHeader(C,_)}),we.isUndefined(o.withCredentials)||(m.withCredentials=!!o.withCredentials),s&&s!=="json"&&(m.responseType=o.responseType),u&&([d,f]=Ya(u,!0),m.addEventListener("progress",d)),l&&m.upload&&([h,p]=Ya(l),m.upload.addEventListener("progress",h),m.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(c=b=>{m&&(r(!b||b.type?new $o(null,e,m):b),m.abort(),m=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));const y=G4(o.url);if(y&&Kt.protocols.indexOf(y)===-1){r(new Je("Unsupported protocol "+y+":",Je.ERR_BAD_REQUEST,e));return}m.send(i||null)})},t9=(e,n)=>{const{length:t}=e=e?e.filter(Boolean):[];if(n||t){let r=new AbortController,o;const i=function(u){if(!o){o=!0,s();const c=u instanceof Error?u:this.reason;r.abort(c instanceof Je?c:new $o(c instanceof Error?c.message:c))}};let a=n&&setTimeout(()=>{a=null,i(new Je(`timeout ${n} of ms exceeded`,Je.ETIMEDOUT))},n);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>we.asap(s),l}},n9=function*(e,n){let t=e.byteLength;if(!n||t<n){yield e;return}let r=0,o;for(;r<t;)o=r+n,yield e.slice(r,o),r=o},r9=async function*(e,n){for await(const t of o9(e))yield*n9(t,n)},o9=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const n=e.getReader();try{for(;;){const{done:t,value:r}=await n.read();if(t)break;yield r}}finally{await n.cancel()}},t1=(e,n,t,r)=>{const o=r9(e,n);let i=0,a,s=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await o.next();if(u){s(),l.close();return}let h=c.byteLength;if(t){let d=i+=h;t(d)}l.enqueue(new Uint8Array(c))}catch(u){throw s(u),u}},cancel(l){return s(l),o.return()}},{highWaterMark:2})},n1=64*1024,{isFunction:es}=we,i9=(({Request:e,Response:n})=>({Request:e,Response:n}))(we.global),{ReadableStream:r1,TextEncoder:o1}=we.global,i1=(e,...n)=>{try{return!!e(...n)}catch{return!1}},a9=e=>{e=we.merge.call({skipUndefined:!0},i9,e);const{fetch:n,Request:t,Response:r}=e,o=n?es(n):typeof fetch=="function",i=es(t),a=es(r);if(!o)return!1;const s=o&&es(r1),l=o&&(typeof o1=="function"?(f=>g=>f.encode(g))(new o1):async f=>new Uint8Array(await new t(f).arrayBuffer())),u=i&&s&&i1(()=>{let f=!1;const g=new t(Kt.origin,{body:new r1,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!g}),c=a&&s&&i1(()=>we.isReadableStream(new r("").body)),h={stream:c&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!h[f]&&(h[f]=(g,m)=>{let v=g&&g[f];if(v)return v.call(g);throw new Je(`Response type '${f}' is not supported`,Je.ERR_NOT_SUPPORT,m)})});const d=async f=>{if(f==null)return 0;if(we.isBlob(f))return f.size;if(we.isSpecCompliantForm(f))return(await new t(Kt.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(we.isArrayBufferView(f)||we.isArrayBuffer(f))return f.byteLength;if(we.isURLSearchParams(f)&&(f=f+""),we.isString(f))return(await l(f)).byteLength},p=async(f,g)=>{const m=we.toFiniteNumber(f.getContentLength());return m??d(g)};return async f=>{let{url:g,method:m,data:v,signal:y,cancelToken:b,timeout:_,onDownloadProgress:C,onUploadProgress:k,responseType:E,headers:S,withCredentials:D="same-origin",fetchOptions:I}=e1(f),A=n||fetch;E=E?(E+"").toLowerCase():"text";let w=t9([y,b&&b.toAbortSignal()],_),T=null;const P=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let X;try{if(k&&u&&m!=="get"&&m!=="head"&&(X=await p(S,v))!==0){let O=new t(g,{method:"POST",body:v,duplex:"half"}),R;if(we.isFormData(v)&&(R=O.headers.get("content-type"))&&S.setContentType(R),O.body){const[M,N]=Qf(X,Ya(Zf(k)));v=t1(O.body,n1,M,N)}}we.isString(D)||(D=D?"include":"omit");const $=i&&"credentials"in t.prototype,J={...I,signal:w,method:m.toUpperCase(),headers:S.normalize().toJSON(),body:v,duplex:"half",credentials:$?D:void 0};T=i&&new t(g,J);let ee=await(i?A(T,I):A(g,J));const Y=c&&(E==="stream"||E==="response");if(c&&(C||Y&&P)){const O={};["status","statusText","headers"].forEach(H=>{O[H]=ee[H]});const R=we.toFiniteNumber(ee.headers.get("content-length")),[M,N]=C&&Qf(R,Ya(Zf(C),!0))||[];ee=new r(t1(ee.body,n1,M,()=>{N&&N(),P&&P()}),O)}E=E||"text";let U=await h[we.findKey(h,E)||"text"](ee,f);return!Y&&P&&P(),await new Promise((O,R)=>{Wf(O,R,{data:U,headers:zn.from(ee.headers),status:ee.status,statusText:ee.statusText,config:f,request:T})})}catch($){throw P&&P(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new Je("Network Error",Je.ERR_NETWORK,f,T),{cause:$.cause||$}):Je.from($,$&&$.code,f,T)}}},s9=new Map,a1=e=>{let n=e&&e.env||{};const{fetch:t,Request:r,Response:o}=n,i=[r,o,t];let a=i.length,s=a,l,u,c=s9;for(;s--;)l=i[s],u=c.get(l),u===void 0&&c.set(l,u=s?new Map:a9(n)),c=u;return u};a1();const iu={http:O4,xhr:e9,fetch:{get:a1}};we.forEach(iu,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch{}Object.defineProperty(e,"adapterName",{value:n})}});const s1=e=>`- ${e}`,l9=e=>we.isFunction(e)||e===null||e===!1;function u9(e,n){e=we.isArray(e)?e:[e];const{length:t}=e;let r,o;const i={};for(let a=0;a<t;a++){r=e[a];let s;if(o=r,!l9(r)&&(o=iu[(s=String(r)).toLowerCase()],o===void 0))throw new Je(`Unknown adapter '${s}'`);if(o&&(we.isFunction(o)||(o=o.get(n))))break;i[s||"#"+a]=o}if(!o){const a=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=t?a.length>1?`since :
|
|
31
31
|
`+a.map(s1).join(`
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
query SalesforceActions($action: String!, $data: SalesforceData) {
|
|
166
166
|
salesforceActions(action: $action, data: $data)
|
|
167
167
|
}
|
|
168
|
-
`,oc={retrieveBlock:"/composables/retrieveComposableConfig",retrieveMeta:"/composables/retrieveComposableConfig",fetchAccessToken:"/int/auth",cart:{getQuoteProducts:"/transactions/getQuoteProducts",getGroupedQuoteProducts:"/transactions/getGroupedQuoteProducts"},catalog:{getProductItems:"/getCatalogProducts",saveItemToQuoteBlink:"/transactions/saveItemToQuoteBlink",updateLines:"/transactions/updateLines",deleteQuoteLine:"/quoting/deleteQuoteLine",getLineItems:"/quoting/getConfiguredLineItems"},promocode:{getPromoCodes:"/promotions/getPromoCodes",applyPromoCode:"/promotions/applyPromocode"},fetch:{getRecord:"/platform/getHeaderRecord"},update:{upsertRecords:"/platform/upsertRecords"},tax:{calculateAvaTax:"/transactions/calculateTax"},common:{getLineItemAttributes:"/product-pricing/getLineItemAttributes"}};async function nn({action:e,data:n,config:t={}}){var p,f;const r=Ht(),o=t.accessToken??r.accessToken.value,i=t.salesforceOrgId??r.organizationId.value,a=t.userId??r.userId.value,s=t.orgType??r.composablesOrgType.value,l=t.baseUrl??r.composablesApiUrl.value,u=oc[t.pathKey]??oc[t.pathKey.split(".")[0]][t.pathKey.split(".")[1]];if(!u)throw new Error(`Invalid pathKey: ${t.pathKey}. Available keys: ${Object.keys(oc).join(", ")}`);const c=`${l}${u}`;if(!i&&t.pathKey!=="fetchAccessToken")throw new Error("salesforceOrgId is required. Provide it in config or set it via useComposableStore.updateConfig()");let h;e?h={action:e,data:n}:h=n;const d={"Content-Type":"application/json"};if(o&&(d.Authorization=`Bearer ${o}`),i&&(d["X-Salesforce-Org-Id"]=i),s&&(d["X-Salesforce-Org-Type"]=s),a&&(d["X-Salesforce-User-Id"]=a),!c)throw new Error("composablesApiUrl is required. Provide it in props or set it via useComposableStore.updateConfig()");try{console.log(`[COMPOSABLES_API:${e||"no-action"}] request`,JSON.stringify(h)),console.log(`[COMPOSABLES_API:${e||"no-action"}] headers`,d);const g=await dt.post(c,h,{headers:d});if(console.log(`[COMPOSABLES_API:${e||"no-action"}] response`,g.data),!e&&((p=g.data)!=null&&p.data)&&typeof g.data.data=="string")try{g.data=JSON.parse(g.data.data)}catch(m){console.warn("[COMPOSABLES_API] Failed to parse data field:",m)}else if(!e&&((f=g.data)!=null&&f.data)&&typeof g.data.data=="object")try{g.data=g.data.data}catch(m){console.warn("[COMPOSABLES_API] Failed to parse content field:",m)}return g.data}catch(g){throw console.error(`[COMPOSABLES_API:${e||"no-action"}] error:`,g),g}}const Uo="https://d2pgvmpph8dmlo.cloudfront.net";function y2(e,n,t){return e?e==null?void 0:e.map(r=>dx(r,n,t)):[]}function dx(e,n,t){const{url:r,staticResource:o}=e;if(!r)return null;if(r.includes("/resource/")&&!r.includes("://")&&o){const i=r.split("/"),a=i[i.length-1];return`${Uo}/${t}/static/${a}.${n}`}else return r}const Fi=Lt("blockLegacy",()=>{const e=Ht(),n=G(null),t=G(null),r=G(!1),o=G(null);async function i(c,h=!0){var f,g;if(console.info("fetchBlockInformation templateId:",c.templateId),!c.templateId)return;h&&(n.value=[],r.value=!1);const d={storefrontId:c.storefrontId,templateId:c.templateId};console.log("fetchBlockInformation variables",JSON.stringify(d)),console.log("fetchBlockInformation getTemplateBlock",m2);const p=await ps(m2,d);if(console.log("fetchBlockInformation getTemplateBlockResponse",p),console.log("fetchBlockInformation pageBlocks",n.value),t.value=c.templateId,h)(f=p.content)!=null&&f.blocks?(n.value=a(JSON.parse(p.content.blocks)),console.log("fetchBlockInformation pageBlocks 1",n.value)):n.value=[],r.value=!0;else return((g=p==null?void 0:p.content)==null?void 0:g.blocks)||[]}function a(c){const h=e.organizationId.value;return c==null||c.forEach(d=>{d.blocks=d.blocks?JSON.parse(d.blocks):[],d.blocks.forEach(p=>{var f,g;Object.assign(p,JSON.parse(p.contentJSON)),p.contentJSON=null,p.id=p.blockId||p.Id,(p.componentName==="catalogBlock"||p.componentName==="relatedProducts")&&(s(p.fields.productCard.actions),p.fields.noFriendlyURL=!0,p.fields.productCard.friendlyURL=null,p.fields.productCard.friendlyURLFields=null,(f=p.configuration)!=null&&f.productTemplateId?p.fields.productCard.url="/product/"+((g=p.configuration)==null?void 0:g.productTemplateId):p.fields.productCard.url=null),p.componentName==="productSummary"&&(console.log("block.fields.actions",p.fields.actions),s(p.fields.actions)),p.customJS&&(p.customJS=y2(p.customJS,"js",h)),p.customCSS&&(p.customCSS=y2(p.customCSS,"css",h))})}),c}function s(c){c.forEach(h=>{h.action==="CUSTOM_ACTION"&&(h.action="CUSTOM",h.name=h.label.title,h.value=h.url.field||h.url.title,h.newTab=h.openInNewTab)})}async function l(c,h=!0){var d,p,f;if(console.info("fetchBlockInformationREST templateId:",c.templateId),!!c.templateId){h&&(n.value=[],r.value=!1);try{const g=await nn({action:"retrieveBlock",data:{salesforceOrgId:e.organizationId.value,storefrontId:c.templateId,templateId:"wrapperDefault"},config:{pathKey:"retrieveBlock"}});t.value=c.templateId;const m=((p=(d=g==null?void 0:g.data)==null?void 0:d[0])==null?void 0:p.blocks)??((f=g==null?void 0:g.data)==null?void 0:f.blocks);if(console.log("fetchBlockInformationREST blocksData",m),h){if(m){const v=typeof m=="string"?JSON.parse(m):m;console.log("fetchBlockInformationREST parsedBlocks",v),n.value=a(v),console.log("fetchBlockInformationREST pageBlocks",n.value)}else console.log("fetchBlockInformationREST blocksData is null"),n.value=[];r.value=!0}else return m||[]}catch(g){throw console.error("fetchBlockInformationREST error:",g),h&&(n.value=[],r.value=!0),g}}}return{metaInfo:o,currentPageId:t,pageBlocks:n,blockLoaded:r,fetchBlockInformation:i,fetchBlockInformationREST:l,getFormattedSectionBlocks:c=>be(()=>{const h=[];return n.value&&n.value.length>0&&n.value.forEach(d=>{const p=d.blocks;p&&p.length>0&&p.forEach(f=>{if(f.id=f.blockId,c){const g=["checkoutAccount","shippingAddress","shippingMethod","customForm","termsAndPayment","quoteSummary","customCode"];console.log("section.sectionName",d.sectionName,f.componentName),f&&f.configuration&&(g.includes(f.componentName)||f.configuration.isCheckoutBlock)&&h.push(f)}else f&&f.configuration&&!c&&h.push(f)})}),h})}}),_o=async(e,n=null,t="",r=!1)=>{const o=Ht();console.log("appsyncHandler composableStore",o);const i=o.graphqlEndpoint.value,a=o.apiKey.value;let s=200,l;const u=o.hostName.value;console.log("appsyncHandler currentHostname",u);const c=ac();try{const h=n;let d="";c.activeStorefrontInfo&&c.activeStorefrontInfo.accountId&&!d&&(d=c.activeStorefrontInfo.accountId),h.data&&c.activeStorefrontInfo&&!e.includes("CognitoActions")&&!e.includes("query listUsers")&&(h.data.userType=c.activeStorefrontInfo.userType,h.data.accountId=d,h.data.domain=u);const p=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":a},body:JSON.stringify({query:e,variables:h})});if(l=await(p==null?void 0:p.json()),l=l.data,t)l=JSON.parse(l[t]),s=Number(l.statusCode),l=l.content,s===401&&console.info("401",e,JSON.stringify(n));else if(e.includes("SalesforceActions")){let f=l;f=JSON.parse(l.salesforceActions),f.statusCode==="401"&&console.info("401",e,JSON.stringify(n),l)}}catch(h){console.log(h),s=400,l=h}return{statusCode:s,response:l}},ic=["Needs Configuration","Suggests Configuration","Upload Configuration"],fx=["Upload","Upload Add","Upload Configuration"],hx=["No Configuration","Suggests Configuration","Upload Add","",null,void 0],px=["CONFIGURE","UPLOAD","ADD_TO_CART"],mx=new Map([["Full","Full"],["FULL","Full"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","Default"],["ECATALOG_ACCOUNT_CUSTOM","Alternate"],["ECATALOG_OVERRIDE","Override"]]),gx=new Map([["Full","Item"],["FULL","Item"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","eCatalog"],["ECATALOG_ACCOUNT_CUSTOM","eCatalog"],["ECATALOG_OVERRIDE","eCatalog"]]),Bi=(e,n,t=!1)=>{const r=wn();let o,i,a;return t?(i=e.statusCode,a=e.content):(o=JSON.parse(e.response.salesforceActions),i=o.statusCode,a=o.content),Number(i)===200&&a&&a.message&&typeof a.message=="string"&&a.message.startsWith("ERROR:")?(r.handleError(a.message,"useExtractContent"),!1):Number(i)!==200||e.statusCode!==200||typeof a=="string"&&a.includes("ERROR:")||typeof a=="string"&&a.includes("Error:")||a.errorCode==="APEX_ERROR"?(a.errorCode==="APEX_ERROR"?r.handleError(a.message,"useExtractContent"):n||r.handleError(a,"useExtractContent"),!1):a},jo=new Map;function Sn(e,n){return jo.has(e)||jo.set(e,new Set),jo.get(e).add(n),()=>{yx(e,n)}}function yx(e,n){const t=jo.get(e);t&&(t.delete(n),t.size===0&&jo.delete(e))}function rn(e,n){const t=jo.get(e);!t||t.size===0||Array.from(t).forEach(r=>{try{r(n)}catch{}})}const _r=Lt("catalog",()=>{const e=Ht(),n=G(!1),t=G(0),r=G(null),o=G(null),i=G([]),a=G({}),s=G({}),l=G(null),u=G(null),c=G(!1),h=G({search:""}),d=G({qliRecords:!0,quoteCreate:!1,quoteDetails:!1}),p=be(()=>e.accountId.value),f=be(()=>({domain:e.hostName.value,accountId:p.value,userType:e.userId.value})),g=be(()=>{const $=Array.isArray(i.value)?i.value:[],J={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},ee=O=>(O==null?void 0:O.XX_ORD1__SYS_Configuration_Status2__c)||(O==null?void 0:O.xx_ord1__sys_configuration_status2__c)||"",Y=O=>O in J,U=$.filter(O=>Y(ee(O)));return U.sort((O,R)=>{const M=ee(O),N=ee(R);return(J[M]||99)-(J[N]||99)}),U});function m(){const $=g.value||[];return $.length?$[0]:null}function v($="true"){V3(`qreset-${r.value}`,$)}async function y($){try{const J={objectType:"XX_ORD1__Quote_Line_Item__c",qliIds:Array.isArray($)?$:[$]},ee=await nn({data:J,config:{pathKey:"catalog.deleteQuoteLine"}});return t.value=Math.max(0,(t.value||0)-1),A(!0),console.log("[CATALOG:deleteLineItems] success",ee),v(),rn("catalog:line-deleted",{quoteId:(e==null?void 0:e.quoteId.value)||null,qliIds:J.qliIds,response:ee}),ee}catch(J){console.log("[CATALOG:deleteLineItems] error",J),v();return}}async function b($){var M,N;if(!$.qty)return;const J=e.quoteId.value;if(!J)return;$.retry=1;const ee={...$,quoteid:J},Y={action:"makeCall",data:{...f.value,callType:"POST",endpoint:"/services/apexrest/XX_ORD1/ecommerce?type=updateQLI&ut="+e.userId.value,payload:JSON.stringify(ee)}},U=await _o(Xr,Y,void 0,!0),O=(N=(M=U.response)==null?void 0:M.salesforceActions)==null?void 0:N.toLowerCase();(O.includes("record currently unavailable")||O.includes("unable_to_lock_row"))&&$.retry<3&&setTimeout(()=>{$.retry+=1,b($)},500),Bi(U)&&A(!0),v()}async function _($){var Y,U,O,R,M;const J=e==null?void 0:e.quoteId.value;Array.isArray($)&&($=$[0]);const ee={itemId:$.itemID,eCatalogItemId:$.eCatalogItemID,quantity:$.qty,accountId:p.value,qtyTierAmt:($==null?void 0:$.qtyTierAmt)??null};J&&(ee.quoteId=J);try{const N=await nn({data:ee,config:{pathKey:"catalog.saveItemToQuoteBlink"}}),H=(N==null?void 0:N.quoteId)||((Y=N==null?void 0:N.data)==null?void 0:Y.quoteId)||((O=(U=N==null?void 0:N.data)==null?void 0:U.quote)==null?void 0:O.Id);H&&H!==J&&(r.value=H,e.updateConfig({quoteId:H}));const L=((R=N==null?void 0:N.data)==null?void 0:R.QliId)||(N==null?void 0:N.QliId)||null,z=$==null?void 0:$.itemID,j=$==null?void 0:$.qty;if(L&&z){const W=s.value?s.value[z]:null;s.value={...s.value||{},[z]:{...W||{},Id:L,XX_ORD1__Item__c:z,XX_ORD1__QTY__c:typeof j=="number"?j:(W==null?void 0:W.XX_ORD1__QTY__c)||0}}}return A(!0),v(),rn("catalog:item-added",{itemId:ee.itemId,eCatalogItemId:ee.eCatalogItemId||null,quantity:ee.quantity,quoteId:(e==null?void 0:e.quoteId.value)||H||null,qliId:((M=N==null?void 0:N.data)==null?void 0:M.QliId)||(N==null?void 0:N.QliId)||null,response:N}),N}catch(N){console.log("[CATALOG:saveItemToQuoteBlinkTxn] error",N),v();return}}async function C({itemId:$,qty:J,qliId:ee,eCatalogItemId:Y}={}){var R,M,N,H,L;if(console.log("updateQuoteLineQtyTxn",{itemId:$,qty:J,qliId:ee,eCatalogItemId:Y}),!J&&J!==0)return;let U=ee||((M=(R=s.value)==null?void 0:R[$])==null?void 0:M.Id);if(U||(await w(!0),U=ee||((H=(N=s.value)==null?void 0:N[$])==null?void 0:H.Id)),!U){if(J>0&&$&&Y)return console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id, saving item first",{itemId:$,eCatalogItemId:Y}),await _({itemID:$,eCatalogItemID:Y,qty:J,qtyTierAmt:null});console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id for item",{itemId:$});return}const O={uniqueField:"",objectType:"XX_ORD1__Quote_Line_Item__c",records:[{fields:[{fieldName:"Id",fieldValue:U},{fieldName:"XX_ORD1__QTY__c",fieldValue:J}]}]};try{const z=await nn({data:O,config:{pathKey:"catalog.updateLines"}});if($){const j=((L=s.value)==null?void 0:L[$])||{};s.value={...s.value||{},[$]:{...j,Id:U,XX_ORD1__Item__c:$,XX_ORD1__QTY__c:J}}}return A(!0),v(),rn("catalog:item-qty-updated",{itemId:$,qliId:U,quantity:J,eCatalogItemId:Y||null,quoteId:(e==null?void 0:e.quoteId.value)||null,response:z}),z}catch(z){console.log("[CATALOG:updateQuoteLineQtyTxn] error",z),v();return}}async function k($,J,ee){var N;const Y=ee==="Item",U=[],O=(($==null?void 0:$.searchText)||"").toString().trim(),R=Array.isArray($==null?void 0:$.fields)?$.fields:[];Array.isArray($==null?void 0:$.filters)&&$.filters,$==null||$.filterLogic;const M={searchPL:O,origin:"genesis_ai",userId:(e==null?void 0:e.userId.value)||"",orgId:(e==null?void 0:e.organizationId.value)||"",orgType:"Production",requestId:Kr(),quoteId:(e==null?void 0:e.quoteId.value)||"",accountId:(e==null?void 0:e.accountId.value)||"",numberOfRecords:($==null?void 0:$.numberOfRecords)||($==null?void 0:$.rowLimit)||10,fields:R,filters:($==null?void 0:$.whereCondition)||[]};try{const H=await nn({data:M,config:{pathKey:"catalog.getProductItems"}});if(!H||!H.selected_products||typeof H.selected_products!="object")return console.warn("[CATALOG:getProductItems] Invalid response structure",{responseObj:H}),{items:[],count:0};const L=H.selected_products,z=Object.values(L).map(W=>{var Q;return(Q=W==null?void 0:W.catalogResponse)==null?void 0:Q.productInfo}).filter(Boolean);z.forEach(W=>{var K,V,te,oe;const Q=JSON.parse(JSON.stringify(J)),ae=vt(W,Y?"XX_ORD1__Friendly_URL__c":"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),fe=vt(W,Y?"XX_ORD1__SYS_Requires_Configuration__c":"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");Y?Q.itemId=W.Id:(Q.itemId=W.XX_ORD1__Item__c,Q.catalogItemId=W.Id),Q.thumbnail.value=Q.thumbnail.field&&!Q.thumbnail.isStatic?vt(W,Q.thumbnail.field):"",Q.title.value=Q.title.field&&!Q.title.isStatic?vt(W,Q.title.field):"",Q.description.value=Q.description.field&&!Q.description.isStatic?vt(W,Q.description.field):"",(K=Q.attributes)==null||K.forEach(le=>{le.value.field&&(le.value.value=vt(W,le.value.field,le.value.dataType)||"-"),le.label.field&&(le.label.value=vt(W,le.label.field,le.label.dataType)||"-")}),Q.requiresConfiguration=fe,Q.actions=Q.actions.filter(({action:le})=>le==="ADD_TO_CART"&&hx.includes(fe)||le==="CONFIGURE"&&ic.includes(fe)||le==="UPLOAD"&&fx.includes(fe)||!px.includes(le)),(V=Q.actions)==null||V.forEach(le=>{if(le.action==="CUSTOM"){const{url:ne,label:de}=le;ne.isStatic||(ne.value=vt(W,ne.field)),de.isStatic||(de.value=vt(W,de.field))}}),((te=Q.friendlyURLFields)==null?void 0:te.length)>0&&ae?((oe=Q.friendlyURLFields)==null||oe.forEach(le=>{Q.friendlyURL=Q.friendlyURL.replace(`{!${le}}`,vt(W,le))}),Q.friendlyURL="/"+Q.friendlyURL+"/"+ae):Q.url&&(Q.friendlyURL=Q.url+"/"+W.Id),Q.friendlyURL&&(Q.friendlyURL=Q.friendlyURL.replace(/\/{2,}/g,"/")),U.push(Q)});const j=Number(((N=H==null?void 0:H.data)==null?void 0:N.totalCount)||z.length)||0;return{items:U,count:j>2e3?2e3:j}}catch(H){console.log("[CATALOG:getProductItems] new API error",H);return}}async function E($){var U;console.log("[CATALOG:getEcatalogDetails] jsonData",$),$.accountID=e.accountId.value;const J={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getEcatalogDetails&ut=${e.userId.value}`,payload:JSON.stringify($)}},ee=await _o(Xr,J),Y=Bi(ee);if(Y!==!1)return(U=JSON.parse(Y))==null?void 0:U.recordData}async function S($,J=()=>{}){$.accountID=e.accountId.value||"";const ee={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogGroupCounts&ut=${e.userId.value}`,payload:JSON.stringify($)}},Y=await _o(Xr,ee,void 0,!0),U=JSON.parse(JSON.parse(Y.response.salesforceActions).content);return J(U),U}async function D($,J=()=>{}){const ee={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogPicklistGroupCounts&ut=${e.userId.value}`,payload:JSON.stringify($)}},Y=await _o(Xr,ee,void 0,!0);return J(JSON.parse(JSON.parse(Y.response.salesforceActions).content)),JSON.parse(JSON.parse(Y.response.salesforceActions).content)}async function I(){var U,O,R,M,N,H;console.log("[CATALOG:getObjectDetails] start",{currentQuoteId:r.value,payload:f.value});const $=e.quoteId.value;if(console.log("[CATALOG:getObjectDetails] qtId",$),$)console.log("[CATALOG:getObjectDetails] Quote found!"+$),console.log("[CATALOG:getObjectDetails] Quote found",$);else{console.log("[CATALOG:getObjectDetails] No quote found!"),console.warn("[CATALOG:getObjectDetails] No quote found, aborting");return}const J={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getFormattedObjectDetails&objectapi=XX_ORD1__Quote__c&objectid=${$}`}};console.log("[CATALOG:getObjectDetails] request",J.data.endpoint),d.quoteDetails=!0,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> true");const ee=await _o(Xr,J,void 0,!0);console.log("[CATALOG:getObjectDetails] response received",{hasResponse:!!(ee!=null&&ee.response),len:String(((U=ee==null?void 0:ee.response)==null?void 0:U.salesforceActions)||"").length});const Y=Bi(ee,!0);return console.log("[CATALOG:getObjectDetails] extracted content",{hasContent:!!Y}),d.quoteDetails=!1,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> false"),Y?(a.value=JSON.parse(Y),console.log("[CATALOG:getObjectDetails] quoteRecord set",{id:(O=a.value)==null?void 0:O.Id,accountName:(R=a.value)==null?void 0:R.XX_ORD1__Account_Name__c,checkedOut:(M=a.value)==null?void 0:M.XX_ORD1__Checked_Out__c}),e.quoteAccount=(N=a.value)==null?void 0:N.XX_ORD1__Account_Name__c,a.value.XX_ORD1__Checked_Out__c?(console.warn("[CATALOG:getObjectDetails] Quote is already checked out, resetting quoteId"),n.value=!0,console.log("[CATALOG:getObjectDetails] end (checked out) -> false"),!1):(console.log("[CATALOG:getObjectDetails] end (success)",{id:(H=a.value)==null?void 0:H.Id}),a.value)):(console.warn("[CATALOG:getObjectDetails] no content returned, resetting quoteId",{qtId:$}),console.log("[CATALOG:getObjectDetails] end (no content) -> false"),!1)}const A=pn(w,500);async function w($=!1){var Y;console.log("[CATALOG:getQuoteItems] start",{noLoad:$}),d.value.qliRecords=!$;const J=e.quoteId.value;if(console.log("[CATALOG:getQuoteItems] qtId",J),!J){console.log("[CATALOG:getQuoteItems] No quote found!"),d.value.qliRecords=!1,console.warn("[CATALOG:getQuoteItems] No quote found, aborting");return}const ee={objectId:J};try{const U=await nn({data:JSON.stringify(ee),config:{pathKey:"catalog.getLineItems"}}),O=((Y=U==null?void 0:U.data)==null?void 0:Y.products)||(U==null?void 0:U.products)||[],R=[],M={};O.forEach(N=>{const H=N==null?void 0:N.productLineItem;H&&(R.push(H),H.XX_ORD1__Item__c&&(M[H.XX_ORD1__Item__c]=H)),(Array.isArray(N==null?void 0:N.options)?N.options:[]).forEach(z=>{R.push(z),z.XX_ORD1__Item__c&&(M[z.XX_ORD1__Item__c]=z)})}),i.value=R,s.value=M,t.value=R.length,d.value.qliRecords=!1,console.log("[CATALOG:getQuoteItems] end (success)",{count:R.length}),rn("catalog:items-fetched",{quoteId:J,items:i.value,count:t.value})}catch(U){console.warn("[CATALOG:getQuoteItems] error",U),d.value.qliRecords=!1}}async function T($){console.log("[CATALOG:getSavedFilter] ecfr",$);const J={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getSavedFilter&ut=${e.userId.value}&ecfr=${$}`}},ee=await _o(Xr,J,void 0,!0),Y=Bi(ee);return Y?(console.log("[CATALOG:getSavedFilter] Saved Filters",Y),JSON.parse(Y)):!1}async function P(){var Y;console.log("[CATALOG:calculateAvaTax]"),u.value=null;const $=e.quoteId.value;if(!$)return;(Y=a.value)!=null&&Y.Id||await I();const J=a.value;if(J.XX_ORD1__Shipping_Address__c&&J.XX_ORD1__Shipping_City__c&&J.XX_ORD1__Shipping_Country__c&&J.XX_ORD1__Shipping_State__c&&J.XX_ORD1__Shipping_Zip__c){const U={recordId:$,isCommit:!1},O={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=calculateAvaTax&ut=${e.userId.value}`,payload:JSON.stringify(U)}};c.value=!0;const R=await _o(Xr,O,void 0,!0),M=Bi(R);if(M)console.log("[CATALOG:calculateAvaTax] content",M);else{const N=JSON.parse(R.response.salesforceActions).content;u.value=N}c.value=!1}else console.log("[CATALOG:calculateAvaTax] Shipping address not found so tax can not be calculated")}function X($,J,ee=!0){const Y=J.qtyTiers;if(!Y)return null;const U=Y.find(O=>O.ev===null?$>=O.sv:$>=O.sv&&$<=O.ev);return U?ee?U.formattedOfferPrice:U.originalPrice:null}return{quoteCheckedOut:n,avaTaxError:u,avaTaxLoading:c,cartCount:t,cartUpdated:v,quoteId:r,loading:d,filter:h,quoteRecord:a,secondQuoteId:o,qliRecords:i,savedItems:s,savedFilter:l,getObjectDetails:I,getSavedFilter:T,saveItemToQuoteBlinkTxn:_,updateQuoteLineQtyTxn:C,deleteLineItems:y,getPicklistFilterData:D,getQuoteItems:w,updateCart:b,getFilterData:S,getProductItems:k,calculateAvaTax:P,getEcatalogDetails:E,getVolumePrice:X,configurableItemsSorted:g,getTopConfigurableItem:m,getQuoteItems:w}}),ac=Lt("composableCatalog",()=>{const e=Fi();_r();const n=wn(),t=Ht(),r=G(!0),o=G({accountId:"",contactId:"",userType:"",domain:"",locale:"en-US"}),i=G({}),a=G(""),s=G(""),l=G(""),u=G(""),c=G(""),h=G(""),d=G(null),p=G(!1),f=be(()=>u.value+"::"+c.value);async function g(){d.value=null,p.value=!0;try{const S={domain:t.hostName.value,templateBlocksFilter:{templateId:{eq:"wrapperDefault"}}},D=Date.now().toString(),I=await dt.post(`${t.graphqlEndpoint.value}?t=${D}`,{query:cx,variables:S},{headers:{"Content-Type":"application/json","x-api-key":t.apiKey.value,"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0","X-Cache-Bust":D},withCredentials:!1});console.log("[COMPOSABLECATALOG:fetchDomainDetails] response",I);const A=I&&I.data?I.data:null;console.log("[COMPOSABLECATALOG:fetchDomainDetails] payload",A);const w=A&&A.data&&A.data.dataByDomain&&Array.isArray(A.data.dataByDomain.items)?A.data.dataByDomain.items:[],T=w.length?w[0]:null;return console.log("[COMPOSABLECATALOG:fetchDomainDetails] item",T),console.log("[COMPOSABLECATALOG:fetchDomainDetails] storefrontDetails",i.value),i.value=T,o.value={accountId:T.guestAccountId,contactId:"",userType:"AWSGuest",domain:T.domain,locale:"en-US"},u.value=T.organization.salesforceOrgId,c.value=T.storefrontId,T}catch(S){throw console.info("[COMPOSABLECATALOG:fetchDomainDetails] Error fetching domain",S),d.value=S&&S.message?S.message:"Unknown error",S}finally{p.value=!1}}function m(S){s.value=(S==null?void 0:S.templateId)??"",l.value=(S==null?void 0:S.quoteId)??"",h.value=(S==null?void 0:S.userId)??""}function v(S){l.value=S}function y(S){i.value=S}async function b(){try{await e.fetchBlockInformation({templateId:s.value,storefrontId:c.value},!0)}catch(S){n.handleError(S,"getBlockInformation")}}const _=async()=>{var S,D;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!c.value)try{const I=await ps(g2,{storefrontId:c.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",I),((D=(S=I.content)==null?void 0:S.items)==null?void 0:D[0])??null}catch(I){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",I)}},C=()=>{if(typeof document>"u")return;const S=u.value,D=c.value;if(!S||!D)return;const I=`${Uo}/${S}/${D}/css/theme_${D}.css`;let A=!1;if(typeof window<"u"&&window.VueExpediteComponents&&typeof window.VueExpediteComponents.applyThemeToShadows=="function")try{window.VueExpediteComponents.applyThemeToShadows(I),A=!0}catch($){console.warn("[COMPOSABLECATALOG:setThemeData] shadow injection failed; will inject in head",$)}let w="";try{w=new URL(t.graphqlEndpoint.value).origin}catch{}const T=typeof window<"u"?window.location.href:"",P=($,J={})=>{const ee=document.head||document.getElementsByTagName("head")[0];if(!ee)return;let Y=document.getElementById($);Y||(Y=document.createElement("link"),Y.id=$,ee.appendChild(Y)),Object.entries(J).forEach(([U,O])=>{O!=null&&Y.setAttribute(U,String(O))})};(($,J,ee=!0)=>{const Y=document.head||document.getElementsByTagName("head")[0];if(!Y||document.getElementById($))return;const U=document.createElement("script");U.id=$,U.src=J,ee&&(U.async=!0),Y.appendChild(U)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),P("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),w&&P("ec-preconnect-appsync",{rel:"preconnect",href:w}),A||P("ec-theme-stylesheet",{rel:"stylesheet",href:I}),P("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),T&&P("ec-canonical",{rel:"canonical",href:T}),P("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Uo}/expedite/Expedite_Favicon.ico`})};function k(){return!0}function E(){s.value="",l.value="",u.value="",c.value="",h.value=""}return{templateId:s,isLoading:r,activeStorefrontInfo:o,quoteAccount:a,storefrontDetails:i,salesforceOrgId:u,storefrontId:c,userId:h,orgWithStorefrontId:f,useVisiblity:k,fetchDomainDetails:g,setData:m,setQuoteId:v,setStorefrontDetails:y,getBlockInformation:b,getTheme:_,setThemeData:C,reset:E}}),vx=e=>{const n=e.match(/query\s+(\w+)/);return n?n[1]:null},bx=e=>e.replace(/[-_\s]+/g," ").trim().replace(/^(.)/,(n,t)=>t.toLowerCase()).replace(/\s(\w)/g,(n,t)=>t.toUpperCase()).replace(/\s/g,""),v2=e=>{try{JSON.parse(e)}catch{return!1}return!0},sc=new Map,ps=async(e,n=null)=>{var s,l,u;const t=ac(),r=Ht();let o=200,i,a;try{const c=n,h=r.accountId.value||"";c.data&&t.activeStorefrontInfo&&!e.includes("CognitoActions")&&!e.includes("GetLoginInfo")&&!e.includes("query listUsers")&&!e.includes("UserActivityLog")&&(c.data.userType=((s=t.activeStorefrontInfo)==null?void 0:s.userType)||"",c.data.accountId=h||((l=t.activeStorefrontInfo)==null?void 0:l.accountId)||"",c.data.domain=r.hostName.value),!e.includes("GetLoginInfo")&&!e.includes("CognitoActions")&&!e.includes("query listUsers")&&!e.includes("UserActivityLog")&&(c.data={...c.data,domain:r.hostName.value});const d=ux([e,c,h]);if(sc.has(d))i=sc.get(d);else try{const g=await dt.post(r.graphqlEndpoint.value,{query:e,variables:c},{headers:{"Content-Type":"application/json","x-api-key":r.apiKey.value}});if(!g.data)return{statusCode:500,content:"Error fetching data from AppSync."};i=g.data.data,sc.set(d,i)}catch(g){const m=((u=g==null?void 0:g.response)==null?void 0:u.status)||500;return m===401&&console.info("401",e,n),{statusCode:m,content:"Error fetching data from AppSync."}}const p=vx(e);if(!p)return{statusCode:404,content:"Query name not found, improper request."};const f=bx(p);i=i[f],v2(i)&&(i=JSON.parse(i)),i&&i.statusCode&&i.statusCode===401&&console.info("401",e,n),a=i!=null&&i.content?i.content:i,v2(a)&&(a=JSON.parse(a))}catch(c){o=400,a=c}return{statusCode:o,content:a}},ms=G(""),b2=G(""),lc=G(""),_2=G(""),uc=G(""),Ni=G(""),Li=G(""),x2=G(""),C2=G(""),E2=G(""),k2=G(""),cc=G(""),A2=G(""),_x=G(!1),xx=G(null),Cx=G(null),w2=G(""),I2=G(""),S2=G(""),O2=G(""),T2=G("");function Ht(){function e(s){s.templateId!==void 0&&(ms.value=s.templateId),s.hostName!==void 0&&(b2.value=s.hostName),s.graphqlEndpoint!==void 0&&(lc.value=s.graphqlEndpoint),s.apiKey!==void 0&&(_2.value=s.apiKey),s.accountId!==void 0&&(uc.value=s.accountId),s.organizationId!==void 0&&(Ni.value=s.organizationId),s.storefrontId!==void 0&&(Li.value=s.storefrontId),s.cid!==void 0&&(x2.value=s.cid),s.userId!==void 0&&(C2.value=s.userId),s.composablesApiUrl!==void 0&&(E2.value=s.composablesApiUrl),s.composablesApiKey!==void 0&&(k2.value=s.composablesApiKey),s.accessToken!==void 0&&(cc.value=s.accessToken),s.composablesOrgType!==void 0&&(A2.value=s.composablesOrgType),s.isPreview!==void 0&&(_x.value=s.isPreview),s.sections!==void 0&&(xx.value=s.sections),s.theme!==void 0&&(Cx.value=s.theme),s.quoteId!==void 0&&(w2.value=s.quoteId),s.websocketUrl!==void 0&&(I2.value=s.websocketUrl),s.packageVersion!==void 0&&(S2.value=s.packageVersion),s.eCatalogId!==void 0&&(O2.value=s.eCatalogId),s.accountId!==void 0&&(uc.value=s.accountId),s.siteUrl!==void 0&&(T2.value=s.siteUrl)}const n=async()=>{var s,l;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!Li.value)try{const u=await ps(g2,{storefrontId:Li.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",u),((l=(s=u.content)==null?void 0:s.items)==null?void 0:l[0])??null}catch(u){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",u)}},t=async()=>{var s,l,u;try{const c=await nn({action:"retrieveMeta",data:{salesforceOrgId:Ni.value,storefrontId:ms.value,templateId:"wrapper",key:"theme"},config:{pathKey:"retrieveMeta"}}),h=((l=(s=c==null?void 0:c.data)==null?void 0:s[0])==null?void 0:l.value)??((u=c==null?void 0:c.data)==null?void 0:u.value);return console.log("[COMPOSABLECATALOG:fetchThemeREST] themeData",h),h??null}catch(c){throw console.log("[COMPOSABLECATALOG:fetchThemeREST] Error getting theme data",c),c}};return{hostName:b2,graphqlEndpoint:lc,apiKey:_2,accountId:uc,organizationId:Ni,storefrontId:Li,cid:x2,userId:C2,composablesApiUrl:E2,composablesApiKey:k2,accessToken:cc,composablesOrgType:A2,quoteId:w2,websocketUrl:I2,packageVersion:S2,eCatalogId:O2,siteUrl:T2,updateConfig:e,getTheme:n,fetchThemeREST:t,setThemeData:()=>{if(typeof document>"u")return;const s=Ni.value,l=Li.value;if(!s||!l)return;const u=`${Uo}/${s}/${l}/css/theme_${l}.css`;let c="";try{c=new URL(lc.value).origin}catch{}const h=typeof window<"u"?window.location.href:"",d=(f,g={})=>{const m=document.head||document.getElementsByTagName("head")[0];if(!m)return;let v=document.getElementById(f);v||(v=document.createElement("link"),v.id=f,m.appendChild(v)),Object.entries(g).forEach(([y,b])=>{b!=null&&v.setAttribute(y,String(b))})};((f,g,m=!0)=>{const v=document.head||document.getElementsByTagName("head")[0];if(!v||document.getElementById(f))return;const y=document.createElement("script");y.id=f,y.src=g,m&&(y.async=!0),v.appendChild(y)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),d("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),c&&d("ec-preconnect-appsync",{rel:"preconnect",href:c}),d("ec-theme-stylesheet",{rel:"stylesheet",href:u}),d("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),h&&d("ec-canonical",{rel:"canonical",href:h}),d("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Uo}/expedite/Expedite_Favicon.ico`})},processSections:async(s,l)=>{const u=Fi();if(s&&l)try{const c=typeof l=="string"?JSON.parse(l):l;u.pageBlocks=c}catch(c){console.error("[ExpediteCart] Error parsing sections:",c)}else s||await u.fetchBlockInformationREST({templateId:ms.value||ms.value})},processTheme:async(s,l)=>{if(console.log("[COMPOSABLECATALOG:processTheme] isPreview",s),console.log("[COMPOSABLECATALOG:processTheme] theme",l),s&&l)try{return JSON.parse(l)}catch(u){return console.error("[ExpediteCart] Error parsing theme:",u),null}else if(!s)try{return await t()}catch(u){return console.error("[ExpediteCart] Error fetching theme:",u),null}return null},fetchAccessToken:async(s,l)=>{try{const u=(l==null?void 0:l.organizationId)||Ni.value||"",c=(s==null?void 0:s.version)||"",h=s==null?void 0:s.awsExternalMSBaseURL;if(!h)throw new Error("awsExternalMSBaseURL is required in awsConnectionInfo");const d=await nn({data:{Org_Id:u,Version:c},config:{baseUrl:h,pathKey:"fetchAccessToken"}});return console.log("fetchAccessToken - Response:",d),d!=null&&d.Access_Token&&(cc.value=d.Access_Token),d}catch(u){throw console.error("getAccessToken catch ::",u),console.error("Error details:",{message:u.message,stack:u.stack,name:u.name}),u}}}}const Ex=["href"],kx=x("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons","data-name":"ec-material-icons"},null,-1),Ax=x("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Outlined","data-name":"ec-material-icons-outlined"},null,-1),wx=x("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Round","data-name":"ec-material-icons-round"},null,-1),Ix=x("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200","data-name":"ec-material-symbols-outlined"},null,-1),D2={__name:"AtomThemeLoader",props:{organizationId:{type:String,required:!0},templateId:{type:String,required:!0},isPreview:{type:Boolean,required:!0},theme:{type:Object,required:!0}},setup(e){const n=e,t=Ht(),r=G(""),o=G(""),i=async()=>{if(!(!n.organizationId||!n.templateId))try{const a=await t.processTheme(n.isPreview,n.theme);a&&(r.value=a),t.setThemeData();const s=Date.now(),l=`${Uo}/${n.organizationId}/${n.templateId}/css/theme_${n.templateId}.css?t=${s}`;console.log("[ATOMTHEMELOADER:loadTheme] styleURL",l),o.value=l}catch(a){console.error("[ATOMTHEMELOADER:loadTheme] Error loading theme",a)}};return Jt(()=>{i()}),We(()=>[n.organizationId,n.templateId,n.isPreview,n.theme],()=>{i()},{deep:!0}),(a,s)=>(F(),q(De,null,[r.value?(F(),Oe(Mo("style"),{key:0,"data-name":"template-theme"},{default:ze(()=>[Ve(ke(r.value),1)]),_:1})):me("",!0),o.value?(F(),q("link",{key:1,rel:"stylesheet",href:o.value,"data-name":"ec-theme-stylesheet-link"},null,8,Ex)):me("",!0),kx,Ax,wx,Ix],64))}},Sx={KNOWLEDGE_DETAIL:"knowledgeDetail"},R2={"Catalog Price":"XX_ORD1__Negotiated_Price__c","List Price":"XX_ORD1__List_Price2__c"},Ox={name:"SkeletonLoader"},Tx={class:"skeleton-loader"};function Dx(e,n,t,r,o,i){return F(),q("div",Tx)}const Gn=Ne(Ox,[["render",Dx],["__scopeId","data-v-826b27ef"]]),rt=Ne({__name:"AtomCustomTag",props:{tag:{type:String,default:null},text:{type:[String,Number,Boolean],default:"-"},type:{type:String,default:null},method:{type:String,default:null},style:{type:Object,default:()=>({})},secStyle:{type:Object,default:()=>({})},cssStyle:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},inherit:{type:[Array,String],default:()=>[]}},setup(e){const n=e,t={h1:"ecb-header-lvl-1",h2:"ecb-header-lvl-2",h3:"ecb-header-lvl-3",h4:"ecb-header-lvl-4",h5:"ecb-header-lvl-5",h6:"ecb-header-lvl-6",p:"ecb-text-regular",span:"ecb-text-small",strong:"ecb-text-strong",large:"ecb-text-large"},r=G(!1),o=be(()=>{if(n.text===null||n.text===void 0)return"";const l=String(n.text);return(l==null?void 0:l.replace(/\r\n|\n/g,"<br>"))||""}),i=be(()=>{var u,c;const l=n.tag||((u=n.style)==null?void 0:u.tag)||((c=n.secStyle)==null?void 0:c.tag)||"p";return l==="large"||l==="strong"?"div":l}),a=be(()=>{var u;const l=n.tag||((u=n.style)==null?void 0:u.tag)||"p";return t[l]||"ecb-text-regular"}),s=be(()=>{var u,c;const l={};if(n.style&&((u=n.style)!=null&&u.overrite)){const{bold:h,color:d,italic:p,underline:f,strikethrough:g,strikeThrough:m,size:v,family:y,lineHeight:b}=n.style;h&&(l.fontWeight="700"),d&&(l.color=d),p&&(l.fontStyle="italic"),y&&(l.fontFamily=y),b&&(l.lineHeight=b),f?l.textDecoration="underline":(g||m)&&(l.textDecoration="line-through"),v&&(l.fontSize=v)}if(n.secStyle&&((c=n.secStyle)!=null&&c.overrite)){const{bold:h,color:d,italic:p,underline:f,strikethrough:g,strikeThrough:m,size:v,family:y,lineHeight:b}=n.secStyle;h&&(l.fontWeight="700"),d&&(l.color=d),p&&(l.fontStyle="italic"),y&&(l.fontFamily=y),b&&(l.lineHeight=b),f?l.textDecoration="underline":(g||m)&&(l.textDecoration="line-through"),v&&(l.fontSize=v)}for(const h of n.inherit)l[h]="inherit";return l});return(l,u)=>e.loading?(F(),q("div",{key:0,style:Re(e.cssStyle),class:"custom-tag-skeletion"},[pe(Gn)],4)):(F(),Oe(Mo(i.value),Bo({key:1},l.$attrs,{type:e.method,disabled:e.disabled,style:s.value,class:a.value,onMouseover:u[0]||(u[0]=c=>r.value=!0),onMouseout:u[1]||(u[1]=c=>r.value=!1),innerHTML:o.value}),null,16,["type","disabled","style","class","innerHTML"]))}},[["__scopeId","data-v-14a516b4"]]),Rx={key:1,class:"field-label"},Mx={class:"ect-flex ect-flex-col ect-justify-start"},Fx={key:0,class:"ect-pr-5"},Bx={key:1,class:"field-value ect-pr-5"},Nx={key:1,class:"field-value"},M2=Ne({__name:"AtomFieldAttribute",props:{tag:{type:String,default:"span"},field:{type:String,default:""},value:{type:Object,default:()=>({})},label:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},offer:{type:Object,default:()=>({})},itemCount:{type:Number,default:1},appliedOnOfferMatchingField:{type:Boolean,default:!1},showOfferDescription:{type:Boolean,default:!1},isProductSummary:{type:Boolean,default:!1},index:{type:Number,default:0},parentWidth:{type:Number,default:0}},setup(e){const n=_r(),t=e,r=be(()=>!1),o=be(()=>{var d;return t.offer.offerValue.offerId&&t.offer.offerValue.formattedOfferPrice||t.offer.offerValue.rpId&&((d=t.offer.offerValue.qtyTiers)==null?void 0:d.length)>0?!!t.appliedOnOfferMatchingField:!1}),i=be(()=>t.offer.offerDetails.styles.offerValue.textStyles.tag),a=be(()=>t.offer.offerDetails.styles.offerDescription.textStyles),s=be(()=>{var h,d;return(h=t.offer.offerValue)!=null&&h.qtyTiers?n.getVolumePrice(t.itemCount>0?t.itemCount:1,t.offer.offerValue):(d=t.offer.offerValue)==null?void 0:d.formattedOfferPrice}),l=be(()=>({"ect-flex ect-line-through":r.value&&t.offer.offerValue&&o.value})),u=be(()=>t.value&&(t.value.isStatic||!t.loading)),c=be(()=>(r.value&&!t.isProductSummary||t.isProductSummary&&t.index===0)&&t.showOfferDescription&&t.appliedOnOfferMatchingField);return(h,d)=>{var p,f;return F(),q("div",{class:Me([e.field,"field ect-gap-1 ect-flex ect-flex-col"])},[e.label?(F(),Oe(rt,{key:0,tag:(p=e.label.style)==null?void 0:p.tag,text:e.label.value,style:Re(e.label.style),class:Me(`${e.field}_label`)},null,8,["tag","text","style","class"])):(F(),q("div",Rx,[pe(Gn)])),x("div",Mx,[r.value&&t.offer.offerValue&&o.value?(F(),q("div",Fx,[pe(rt,{tag:i.value,text:s.value,style:Re(e.offer.offerDetails.styles.offerValue.textStyles),class:Me(`${e.field}_value`)},null,8,["tag","text","style","class"])])):r.value&&!t.offer.offerValue?(F(),q("div",Bx,[pe(Gn)])):me("",!0),x("div",{class:Me(l.value)},[u.value?(F(),Oe(rt,{key:0,tag:(f=e.value.style)==null?void 0:f.tag,text:e.value.value,style:Re(e.value.style),class:Me(`${e.field}_value`)},null,8,["tag","text","style","class"])):(F(),q("div",Nx,[pe(Gn)]))],2)]),c.value?(F(),q("div",{key:2,class:"field-description ect-left-0 ect-w-max ect-pt-2",style:Re({maxWidth:e.parentWidth?e.parentWidth+"px":void 0})},[pe(rt,{tag:a.value.tag,text:t.offer.offerValue.offerDescShort,style:Re(a.value),class:Me(e.field+"_value")},null,8,["tag","text","style","class"])],4)):me("",!0)],2)}}},[["__scopeId","data-v-b0e72386"]]),Lx={key:1,class:"filter"},Px={class:"filter-title"},qx={key:0,class:"filter-desc"},$x={key:1,class:"filter-desc"},Ux={key:2,class:"filter-desc"},F2=Ne({__name:"AtomProductText",props:{title:{type:Object,default:()=>({})},description:{type:Object,default:null},loading:{type:Boolean,default:!1},url:{type:String,default:null}},setup(e){const n=Va(),t=e;function r(){t.url&&!t.loading&&n.push(t.url)}return(o,i)=>e.loading?(F(),q("div",Lx,[x("div",Px,[pe(Gn)]),e.description?(F(),q("div",qx,[pe(Gn)])):me("",!0),e.description?(F(),q("div",$x,[pe(Gn)])):me("",!0),e.description?(F(),q("div",Ux,[pe(Gn)])):me("",!0)])):(F(),q(De,{key:0},[e.title?(F(),Oe(rt,{key:0,class:Me({"ect-cursor-pointer":e.url}),text:e.title.value,style:Re(e.title.style),onClick:r},null,8,["class","text","style"])):me("",!0),e.description?(F(),Oe(rt,{key:1,text:e.description.value,style:Re(e.description.style)},null,8,["text","style"])):me("",!0)],64))}},[["__scopeId","data-v-5b4d627e"]]),jx={name:"Spinner"},Hx={class:"spinner"};function Vx(e,n,t,r,o,i){return F(),q("div",Hx)}const Pi=Ne(jx,[["render",Vx],["__scopeId","data-v-83f8c910"]]),zx={name:"AtomSkeletonWidget",components:{AtomSkeletonLoader:Gn,AtomSpinner:Pi},props:{rows:{type:Number,default:4},type:{type:String,default:"full"},className:{type:String,default:""}},data(){return{SKELETON_TYPE:Sx}}},dc=e=>(Qt("data-v-956cc081"),e=e(),Zt(),e),Kx={key:0,class:"page"},Gx=dc(()=>x("div",{class:"page-header"},null,-1)),Xx={class:"page-body"},Wx={class:"page-body_board"},Qx={key:1,class:"field"},Zx={key:2,class:"filter"},Jx={class:"filter-option_inner"},Yx={key:3,class:"full"},eC={key:4,class:"shuttle"},tC={class:"shuttle-full"},nC={class:"shuttle-full"},rC={class:"shuttle-half"},oC={class:"shuttle-half"},iC={class:"shuttle-button"},aC={key:5,class:"shuttle2"},sC={class:"shuttle2-full"},lC=dc(()=>x("span",null,"Processing payment",-1)),uC={key:6,class:"shuttle2"},cC={class:"shuttle2-full"},dC=dc(()=>x("span",null,"Processing order",-1)),fC={key:10,class:"skeleton-shipping"},hC={class:"skeleton-shipping-full"},pC={class:"skeleton-shipping-half"},mC={key:11,class:"skeleton-terms"},gC={class:"skeleton-terms-half"},yC={class:"skeleton-terms-full"},vC={class:"skeleton-terms-full"},bC={key:12,class:""},_C={class:"skeleton-terms-half"},xC={key:13,class:""},CC={class:"skeleton-terms-half"},EC={key:14,class:"product"},kC={class:"product-image"},AC={class:"product-texts"},wC={class:"product-description"},IC={class:"product-action"},SC={class:"product-button"},OC={key:15,class:""};function TC(e,n,t,r,o,i){const a=fn("AtomSkeletonLoader"),s=fn("AtomSpinner");return t.type==="page"?(F(),q("div",Kx,[Gx,x("div",Xx,[x("div",Wx,[pe(a)])])])):t.type==="fieldattribute"?(F(),q("div",Qx,[pe(a)])):t.type==="filteroptions"?(F(),q("div",Zx,[(F(!0),q(De,null,Le(t.rows,l=>(F(),q("div",{key:l,class:"filter-option"},[x("div",Jx,[pe(a)])]))),128))])):t.type==="full"?(F(),q("div",Yx,[pe(a)])):t.type==="shuttle"?(F(),q("div",eC,[x("div",tC,[pe(a)]),x("div",nC,[pe(a)]),x("div",rC,[pe(a)]),x("div",oC,[pe(a)]),x("div",iC,[pe(a)])])):t.type==="shuttle-done"?(F(),q("div",aC,[x("div",sC,[pe(s,{class:"shuttle2-spinner"}),Ve(),lC])])):t.type==="order-processing"?(F(),q("div",uC,[x("div",cC,[pe(s,{class:"shuttle2-spinner"}),Ve(),dC])])):t.type==="enhanceFilter"?(F(),q("div",{key:7,class:Me(t.className)},[pe(a)],2)):t.type==="offers"?(F(),q("div",{key:8,class:Me(t.className)},[pe(a)],2)):t.type==="detailPage"?(F(),q("div",{key:9,class:Me(t.className)},[pe(a)],2)):t.type==="shippingAddress"?(F(),q("div",fC,[x("div",hC,[pe(a)]),x("div",pC,[pe(a)])])):t.type==="termsAndPayment"?(F(),q("div",mC,[x("div",gC,[pe(a)]),x("div",yC,[pe(a)]),x("div",vC,[pe(a)])])):t.type==="accordian-title"?(F(),q("div",bC,[x("div",_C,[pe(a)])])):t.type==="imageDiv"?(F(),q("div",xC,[x("div",CC,[pe(a)])])):t.type==="product-detail"?(F(),q("div",EC,[x("div",kC,[pe(a)]),x("div",AC,[pe(a)]),x("div",wC,[pe(a)]),x("div",IC,[(F(!0),q(De,null,Le(t.rows,l=>(F(),q("div",{key:l,class:"product-action_item"},[pe(a)]))),128))]),x("div",SC,[pe(a)])])):t.type===o.SKELETON_TYPE.KNOWLEDGE_DETAIL?(F(),q("div",OC,[pe(a,{class:Me(t.className)},null,8,["class"])])):me("",!0)}const xr=Ne(zx,[["render",TC],["__scopeId","data-v-956cc081"]]),DC=["src"],fc={__name:"AtomImage",props:{src:{type:String,default:""},resourcesDomain:{type:String,default:""},placeholder:{type:String,default:""},height:{type:Number,default:200},width:{type:Number,default:200},loading:{type:Boolean,default:!1},sizes:{type:String}},setup(e){const n=Ht(),t=e,r=be(()=>t.src.includes("/resource/")&&!t.src.includes("://")&&t.resourcesDomain?t.resourcesDomain+t.src:t.src.includes("/servlet/servlet.ImageServer")&&!t.src.includes("://")&&t.resourcesDomain?t.resourcesDomain+"/"+t.src:t.src.includes("/servlet/servlet.ImageServer")&&!t.src.includes("://")&&n.siteUrl?n.siteUrl.value+"/"+t.src:t.src);return(o,i)=>e.loading?(F(),Oe(xr,{key:0,type:"full"})):e.src?(F(),q("img",{key:1,src:r.value,placeholder:[30,20],class:"rounded",sizes:"props.sizes"},null,8,DC)):me("",!0)}},RC={class:"counter"},MC=["disabled"],FC={key:0,class:"counter-spinner"},BC=["max","disabled","value"],NC=["disabled"],gs=Ne({__name:"AtomButtonCounter",props:{min:{type:Number,default:0},max:{type:Number,default:999},modelValue:{type:Number,default:1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},decimal:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(e,{emit:n}){const t=e,r=n,o=be(()=>t.disabled||t.loading),i=pn(function(u){const c=String(u??"");if(c==="")return;const h=Number(c);Number.isNaN(h)||r("update:modelValue",h)}),a=u=>{(u.key==="."||u.key==="e"||u.key==="E")&&!u.ctrlKey&&!u.metaKey&&t.decimal&&u.preventDefault()};function s(){t.modelValue<t.max&&r("update:modelValue",t.modelValue+1)}function l(){t.modelValue>t.min&&r("update:modelValue",t.modelValue-1)}return(u,c)=>(F(),q("div",RC,[x("button",{disabled:e.modelValue<=e.min||o.value,onClick:l},[pe(Ge,{icon:e.modelValue>1?"minus":"close",size:10},null,8,["icon"])],8,MC),e.loading?(F(),q("div",FC,[pe(Pi,{class:"item-button_spinner"})])):(F(),q("input",{key:1,type:"number",min:"0",max:e.max,disabled:o.value,value:e.modelValue,step:"1",onInput:c[0]||(c[0]=h=>Te(i)(h.target.value)),onKeydown:a},null,40,BC)),x("button",{disabled:e.modelValue>=e.max||o.value,onClick:s},[pe(Ge,{class:"ect-transform ect-rotate-45",icon:"add",size:12})],8,NC)]))}},[["__scopeId","data-v-886bff8a"]]),B2=G(!1),N2=G(!1),L2=G(!1),P2=G(!1),hc=()=>{if(typeof window<"u"){const e=()=>{const n=window.innerWidth;N2.value=n<768,L2.value=n>=768&&n<1024,P2.value=n>=1024};Et(()=>{B2.value||(B2.value=!0,window.addEventListener("resize",e),e())})}return{isMobile:N2,isTablet:L2,isDesktop:P2}},LC=["disabled"],PC=["disabled"],qC={class:"ect-w-max"},$C={class:"button-header-icon"},UC=["onClick"],jC={key:0,class:"button-options_item-icon"},HC=["disabled"],VC={class:"ect-w-max"},zC={class:"button-header-icon"},KC=["onClick"],GC={key:0,class:"button-options_item-icon"},q2=Ne({__name:"AtomButtonMenu",props:{icon:{type:String,default:null},select:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:{type:String,default:null},options:{type:Array,default:()=>[]}},emits:["selected"],setup(e,{emit:n}){const t=e,r=hc(),o=G(!1),i=G(null),a=G({}),s=G(!1),l=n;function u(g){g.stopPropagation(),o.value=!o.value}function c(g){g.stopPropagation(),o.value=!o.value,s.value=G(o.value)}function h(g){l("selected",g),o.value=!1}function d(){!r.isMobile.value&&!t.disabled&&(o.value=!0)}function p(){!r.isMobile.value&&!s.value&&(o.value=!1)}function f(g){o.value&&(o.value=!1,s.value=!1)}return Et(()=>{document.addEventListener("click",f)}),Oa(()=>{document.removeEventListener("click",f)}),(g,m)=>{var v;return e.options.length===1?(F(),q("button",{key:0,class:"esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:e.disabled,onClick:m[0]||(m[0]=y=>g.$emit("selected",e.options[0]))},[x("span",null,ke(((v=e.options[0].label)==null?void 0:v.value)||e.options[0].name),1)],8,LC)):e.options.length>1?(F(),q(De,{key:1},[Te(r).isMobile.value?(F(),q(De,{key:0},[x("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:e.disabled,onClick:kt(u,["stop"])},[x("span",qC,ke(e.name||e.options[0].name),1),x("div",$C,[pe(Ge,{icon:"arrow_drop_down",class:"ect-relative ect-top-0.5 ect-ml-2",color:"#ffffff",size:"14"})])],8,PC),!e.disabled&&e.options.length&&o.value?(F(),q("div",{key:0,class:"button-options",onClick:m[2]||(m[2]=kt(()=>{},["stop"]))},[x("div",{class:"button-options_grow",onClick:m[1]||(m[1]=y=>o.value=!1)}),(F(!0),q(De,null,Le(e.options,y=>(F(),q("div",{key:y,class:"button-options_item",onClick:b=>h(y)},[y.selected&&e.select?(F(),q("div",jC,[pe(Ge,{icon:"done",size:20,color:"black"})])):me("",!0),Ve(" "+ke(y.name),1)],8,UC))),128))])):me("",!0)],64)):(F(),q("div",{key:1,class:"button-container",onMouseenter:d,onMouseleave:p},[x("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",ref_key:"btnmenu",ref:i,disabled:e.disabled,onClick:kt(c,["stop"])},[x("span",VC,ke(e.name||e.options[0].name),1),x("div",zC,[pe(Ge,{class:"ect-relative ect-top-0.5 ect-ml-2",icon:"arrow_drop_down",color:"#ffffff",size:"14"})])],8,HC),!e.disabled&&e.options.length&&o.value?(F(),q("div",{key:0,style:Re(a.value),class:"button-options",onClick:m[3]||(m[3]=kt(()=>{},["stop"]))},[(F(!0),q(De,null,Le(e.options,y=>{var b;return F(),q("div",{key:y,class:"button-options_item",onClick:_=>g.$emit("selected",y)},[y.selected&&e.select?(F(),q("div",GC,[pe(Ge,{icon:"done",size:20,color:"black"})])):me("",!0),Ve(" "+ke(((b=y.label)==null?void 0:b.value)||y.name),1)],8,KC)}),128))],4)):me("",!0)],32))],64)):me("",!0)}}},[["__scopeId","data-v-cfcf21a3"]]),XC={class:"ect-flex ect-flex-col ect-w-full"},WC={key:0,class:"ect-h-[20px] ect-w-[150px]"},QC={key:1,class:"ect-flex ect-flex-col ect-gap-1"},ZC=Ne({__name:"MoleculeProductItem",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(e){var v,y;const n=ac(),t=_r(),r=e,o=G(((y=(v=t.savedItems)==null?void 0:v[r.itemId])==null?void 0:y.XX_ORD1__QTY__c)||0),i=G(!1),a=G(null),s=G(!1),l=G(!1),u=be(()=>r.actions&&r.actions.length>0),c=be(()=>r.actions.some(b=>b.action==="ADD_TO_CART")),h=be(()=>{var b,_,C;return(b=r.offer)!=null&&b.appliedOnField?R2[(_=r.offer)==null?void 0:_.appliedOnField]===((C=r.offerSetting.value)==null?void 0:C.field):!0});We(()=>t.savedItems,b=>{var _,C;b[r.itemId]&&!l.value&&((_=b[r.itemId])==null?void 0:_.XX_ORD1__QTY__c)!==o.value&&(o.value=((C=b[r.itemId])==null?void 0:C.XX_ORD1__QTY__c)||0,l.value=!0)},{deep:!0});function d(b){var _;l.value=!0,b===0&&((_=t.savedItems)!=null&&_[r.itemId])?f():m()}const p=b=>{var _;b.action==="ADD_TO_CART"?(l.value=!0,o.value=1,g()):b.action==="CONFIGURE"?rn("catalog:item-configure-clicked",{itemId:r.itemId,catalogItemId:r.catalogItemId,title:r.title,description:r.description,attributes:r.attributes,thumbnail:r.thumbnail,url:r.url,mode:r.mode,isPreview:r.isPreview}):b.action==="CUSTOM"?window.open(((_=b.url)==null?void 0:_.value)||b.value,b.newTab?"_blank":"_self"):b.action==="ORDER_PARTS"||b.action},f=async function(){i.value=!0,a.value=null;const b=[t.savedItems[r.itemId].Id];await t.deleteLineItems(b),i.value=!1},g=async function(){i.value=!0,a.value=null;const b={itemID:r.itemId,eCatalogItemID:r.catalogItemId,qty:o.value,qtyTierAmt:null};await t.saveItemToQuoteBlinkTxn(b),i.value=!1},m=pn(async function(){console.log("updateToCart 1",o.value),s.value=!0,await t.updateQuoteLineQtyTxn({itemId:r.itemId,qty:o.value,eCatalogItemId:r.catalogItemId}),s.value=!1});return(b,_)=>{var C,k;return F(),q("div",{class:Me("item ecb-theme-card "+e.mode)},[x("div",{class:Me(`item-image ${e.mode}-image`)},[pe(fc,{src:e.thumbnail.value,loading:e.loading,"resources-domain":Te(n).storefrontDetails.resourcesDomain},null,8,["src","loading","resources-domain"])],2),x("div",{class:Me(`item-text ${e.mode}-text`)},[pe(F2,{title:e.title,loading:e.loading,description:e.description},null,8,["title","loading","description"])],2),x("div",XC,[x("div",{class:Me(`item-attributes ${e.mode}-attributes`)},[(F(!0),q(De,null,Le(r.attributes,(E,S)=>(F(),Oe(M2,{key:S,class:Me(`item-attributes_field ${e.mode}-attributes_field`),loading:e.loading,value:E.value,label:E.label,field:E.value.field,offer:{applyOffer:E.applyOffer,offerDetails:E.offerDetails,offerValue:r.offer},"item-count":o.value,"applied-on-offer-matching-field":h.value},null,8,["class","loading","value","label","field","offer","item-count","applied-on-offer-matching-field"]))),128))],2),r.offerSetting&&h.value&&((C=r.offer)!=null&&C.offerDescShort)?(F(),q("div",{key:0,class:Me(`${e.mode}-offer-banner`)},[pe(rt,{tag:e.offerSetting.offerDetails.styles.offerDescription.textStyles.tag,text:(k=r.offer)==null?void 0:k.offerDescShort,style:Re(e.offerSetting.offerDetails.styles.offerDescription.textStyles),class:Me(b.field+"_value")},null,8,["tag","text","style","class"])],2)):me("",!0)]),u.value?(F(),q("div",{key:0,class:Me([`item-button ${e.mode}-button`,"ect-flex ect-flex-col ect-gap-2"])},[e.loading||e.applyOffer&&!r.offer?(F(),q("div",WC,[pe(Gn)])):(F(),q(De,{key:1},[i.value?(F(),Oe(Pi,{key:0,class:"item-button_spinner"})):(F(),q("div",QC,[o.value>0&&!e.loading&&c.value?(F(),Oe(gs,{key:0,modelValue:o.value,"onUpdate:modelValue":[_[0]||(_[0]=E=>o.value=E),d],loading:s.value,disabled:e.isPreview},null,8,["modelValue","loading","disabled"])):(F(),Oe(q2,{key:1,icon:"arrow_drop_down",disabled:e.loading||e.isPreview,options:e.actions,onSelected:_[1]||(_[1]=E=>p(E))},null,8,["disabled","options"]))]))],64))],2)):me("",!0)],2)}}},[["__scopeId","data-v-e3d55bd3"]]),JC={class:"item"},YC={class:"item-text"},eE={class:"item-attributes"},tE={key:0,class:"item-button"},nE={key:1,class:"ect-flex ect-flex-col ect-gap-1"},rE=Ne({__name:"MoleculeProductItemTable",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},offer:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(e){var g,m;const n=_r(),t=e,r=G(((m=(g=n.savedItems)==null?void 0:g[t.itemId])==null?void 0:m.XX_ORD1__QTY__c)||0),o=G(!1),i=G(!1),a=G(!1),s=be(()=>t.actions&&t.actions.length>0),l=be(()=>t.actions.some(v=>v.action==="ADD_TO_CART")),u=be(()=>{var v,y,b;return(v=t.offer)!=null&&v.appliedOnField?R2[(y=t.offer)==null?void 0:y.appliedOnField]===((b=t.offerSetting.value)==null?void 0:b.field):!0});We(()=>n.savedItems,v=>{var y,b;v[t.itemId]&&!i.value&&((y=v[t.itemId])==null?void 0:y.XX_ORD1__QTY__c)!==r.value&&(r.value=((b=v[t.itemId])==null?void 0:b.XX_ORD1__QTY__c)||0,i.value=!0)},{deep:!0});function c(v){var y;i.value=!0,v===0&&((y=n.savedItems)!=null&&y[t.itemId])?d():f()}const h=v=>{var y;v.action==="ADD_TO_CART"?(i.value=!0,r.value=1,p()):v.action==="CONFIGURE"?rn("catalog:item-configure-clicked",{itemId:t.itemId,catalogItemId:t.catalogItemId,title:t.title,description:t.description,attributes:t.attributes,thumbnail:t.thumbnail,url:t.url,offer:t.offer,mode:t.mode,isPreview:t.isPreview}):v.action==="CUSTOM"?window.open(((y=v.url)==null?void 0:y.value)||v.value,v.newTab?"_blank":"_self"):v.action==="ORDER_PARTS"||v.action},d=async function(){o.value=!0;const v=[n.savedItems[t.itemId].Id];await n.deleteLineItems(v),delete n.savedItems[t.itemId],o.value=!1},p=async function(){o.value=!0;const v={itemID:t.itemId,eCatalogItemID:t.catalogItemId,qty:r.value,qtyTierAmt:null};await n.saveItemToQuoteBlinkTxn(v),o.value=!1},f=pn(async function(){console.log("updateToCart 2",r.value),a.value=!0,await n.updateQuoteLineQtyTxn({itemId:t.itemId,qty:r.value,eCatalogItemId:t.catalogItemId}),a.value=!1},800);return(v,y)=>(F(),q("div",JC,[x("div",YC,[pe(F2,{url:e.url,title:e.title,loading:e.loading},null,8,["url","title","loading"])]),x("div",eE,[(F(!0),q(De,null,Le(t.attributes,b=>{var _;return F(),Oe(M2,{key:b.field,class:Me(`item-attributes_field ${e.mode}-attributes_field`),loading:e.loading,value:b.value,label:b.label,offer:{applyOffer:b.applyOffer,offerDetails:b.offerDetails,offerValue:t.offer},"item-count":r.value,"applied-on-offer-matching-field":u.value,"show-offer-description":!!((_=t.offer)!=null&&_.offerDescShort)},null,8,["class","loading","value","label","offer","item-count","applied-on-offer-matching-field","show-offer-description"])}),128))]),s.value?(F(),q("div",tE,[o.value?(F(),Oe(Pi,{key:0,class:"item-button_spinner"})):(F(),q("div",nE,[r.value>0&&!e.loading&&l.value?(F(),Oe(gs,{key:0,modelValue:r.value,"onUpdate:modelValue":[y[0]||(y[0]=b=>r.value=b),c],loading:a.value,disabled:e.isPreview},null,8,["modelValue","loading","disabled"])):(F(),Oe(q2,{key:1,icon:"arrow_drop_down",disabled:e.loading||e.isPreview,options:e.actions,onSelected:y[1]||(y[1]=b=>h(b))},null,8,["disabled","options"]))]))])):me("",!0)]))}},[["__scopeId","data-v-b679176d"]]),oE=["placeholder"],iE={key:0,class:"srch-error"},aE={class:"srch-option_lst-main"},sE={class:"italic"},lE={class:"srch-option_lst-sugg"},uE={class:"italic"},cE={class:"srch-option_lst-main"},dE={class:"italic"},fE={class:"srch-option_lst-sugg"},hE={class:"italic"},pE={class:"srch-option_lst-main"},mE={class:"italic"},gE={class:"srch-option_lst-sugg"},yE={class:"italic"},vE={key:1,class:"search1"},bE={class:"search-container_header"},_E={class:"search-container_header_input ectheme-input-box"},xE=["placeholder","value"],CE=Ne({__name:"BlinkMoleculeSearch",props:{placeholder:{type:String,default:""},modelValue:{type:String,default:""},suggestion:{type:Boolean,default:!1},showSearchIconAlways:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},enableSearchClick:{type:Boolean,default:!1}},emits:["update:modelValue","enter"],setup(e,{emit:n}){const t=n;let r;const o=G(""),i=G(!1),a=G(!1),s=G(null),l=()=>{s.value=null,o.value="",t("update:modelValue",""),t("enter")},u=g=>{o.value.length>1?(g.target.blur(),h(o.value+"*")):s.value="Search text must be more than one character.",i.value=!1},c=()=>{a.value||(s.value=null,o.value.length>1?h(o.value+"*"):o.value.length===1&&(s.value="Search text must be more than one character."),i.value=!1)},h=g=>{t("update:modelValue",g),i.value=!1,a.value=!1},d=g=>{const m=g.target.value;s.value=null,m.length||t("update:modelValue","")},p=()=>{t("enter")},f=g=>{var v;r&&(clearTimeout(r),r=null);const m=((v=g==null?void 0:g.target)==null?void 0:v.value)??"";r=setTimeout(()=>{t("update:modelValue",m)},500)};return(g,m)=>e.suggestion?(F(),q("div",{key:0,class:"srch",tabindex:"0",onFocusin:m[6]||(m[6]=v=>i.value=!0),onFocusout:c,onKeydown:Hn(u,["enter"])},[x("div",{class:Me(["srch-inp",{"srch-error-border":s.value}])},[An(x("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>o.value=v),type:"search",placeholder:e.placeholder,onInput:d},null,40,oE),[[po,o.value]]),pe(Ge,{icon:o.value?"close":"search",size:14,color:s.value?"red":"#acacac",onClick:l},null,8,["icon","color"])],2),s.value?(F(),q("div",iE,[x("span",null,ke(s.value),1)])):me("",!0),o.value.length>1&&i.value?(F(),q("div",{key:1,class:"srch-option",onMouseover:m[4]||(m[4]=v=>a.value=!0),onMouseout:m[5]||(m[5]=v=>a.value=!1)},[x("div",{class:"srch-option_lst",onClick:m[1]||(m[1]=v=>h(o.value+"*"))},[x("div",aE,[Ve(" Search for "),x("span",sE,ke(o.value)+"*",1)]),x("div",lE,[Ve(" word that starts with "),x("span",uE,ke(o.value)+"*",1)])]),x("div",{class:"srch-option_lst",onClick:m[2]||(m[2]=v=>h(o.value))},[x("div",cE,[Ve(" Search for "),x("span",dE,'"'+ke(o.value)+'"',1)]),x("div",fE,[Ve(" search exactly for "),x("span",hE,'"'+ke(o.value)+'"',1)])]),x("div",{class:"srch-option_lst",onClick:m[3]||(m[3]=v=>h("*"+o.value+"*"))},[x("div",pE,[Ve(" Search for "),x("span",mE,"*"+ke(o.value)+"*",1)]),x("div",gE,[Ve(" word that includes "),x("span",yE,"*"+ke(o.value)+"*",1)])])],32)):me("",!0)],32)):(F(),q("div",vE,[x("div",bE,[x("div",_E,[x("input",{class:"",type:"search",placeholder:e.placeholder,value:e.modelValue,onInput:f,onKeyup:Hn(p,["enter"])},null,40,xE),e.loading?(F(),Oe(Pi,{key:0})):me("",!0),e.modelValue?(F(),Oe(Ge,{key:1,icon:"close",size:12,color:"#acacac",onClick:l})):me("",!0),e.enableSearchClick||!e.modelValue?(F(),Oe(Ge,{key:2,class:"ect-relative ect-top-[-1px]",icon:"search",size:14,color:"#acacac",onClick:p})):me("",!0)])])]))}},[["__scopeId","data-v-31366d17"]]),$2=e=>(Qt("data-v-01d2d3f1"),e=e(),Zt(),e),EE=["id"],kE={key:0,class:"product-search"},AE={key:1,class:"product-not-found"},wE=$2(()=>x("span",{class:"product-not-found_icon material-symbols-outlined"}," error ",-1)),IE=$2(()=>x("span",{class:"product-not-found_text"},"No results found",-1)),SE={key:2,class:"product-item"},OE=20,TE=Ne({__name:"MoleculeProductBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},request:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},catalogType:{type:String,required:!0},blockId:{type:String,default:""},accountId:{type:String,default:null},searchText:{type:String,default:""},onCountUpdate:{type:Function,default:null},hideHeader:{type:Boolean,default:!1},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(e,{expose:n}){const t=Ht(),r=["vertical","horizontal","square","table"],o=e,i=G(Math.floor(Math.random()*1e9)),a=G(null),s=_r(),l=G(1),u=G(!0),c=G(!0),h=G(!1);G(!1);const d=G([]),p=G(0),f=G(o.request);let g=200;const m=G(o.searchText||""),v=be(()=>o.initialItems||[]),y=be(()=>!!(m.value||o.searchText));function b(O,R,M){const N=M==="Item",H=[];return O.forEach(L=>{var j,W;const z=JSON.parse(JSON.stringify(R));try{N?z.itemId=L.Id:(z.itemId=L.XX_ORD1__Item__c,z.catalogItemId=L.Id);const{description:Q,thumbnail:ae,title:fe,attributes:K,actions:V}=z;ae!=null&&ae.field&&!ae.isStatic&&(ae.value=vt(L,ae.field)),fe!=null&&fe.field&&!fe.isStatic&&(fe.value=vt(L,fe.field)),Q!=null&&Q.field&&!Q.isStatic&&(Q.value=vt(L,Q.field)),(K||[]).forEach(oe=>{var le,ne;(le=oe==null?void 0:oe.value)!=null&&le.field&&!oe.value.isStatic&&(oe.value.value=vt(L,oe.value.field,oe.value.dataType)||"-"),(ne=oe==null?void 0:oe.label)!=null&&ne.field&&!oe.label.isStatic&&(oe.label.value=vt(L,oe.label.field,oe.label.dataType)||"-")}),(V||[]).forEach(oe=>{oe.action==="CUSTOM"&&(oe.url&&!oe.url.isStatic&&(oe.url.value=vt(L,oe.url.field)),oe.label&&!oe.label.isStatic&&(oe.label.value=vt(L,oe.label.field)))});try{const oe=N?vt(L,"XX_ORD1__SYS_Requires_Configuration__c"):vt(L,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");z.requiresConfiguration=oe}catch{}const te=N?vt(L,"XX_ORD1__Friendly_URL__c"):vt(L,"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c");((j=z.friendlyURLFields)==null?void 0:j.length)>0&&te?((W=z.friendlyURLFields)==null||W.forEach(oe=>{z.friendlyURL=(z.friendlyURL||"").replace(`{!${oe}}`,vt(L,oe))}),z.friendlyURL="/"+(z.friendlyURL||"")+"/"+te):z.url&&(z.friendlyURL=z.url+"/"+((L==null?void 0:L.Id)||"")),z.friendlyURL&&(z.friendlyURL=z.friendlyURL.replace(/\/{2,}/g,"/"))}catch{}H.push(z)}),H}const _=G(null),C=G(null),k=be(()=>{}),E=be(()=>{var O;return(O=o.fields)==null?void 0:O.header});be(()=>{var O;return((O=E.value)==null?void 0:O.mainHeading)||{}}),be(()=>{var O;return((O=E.value)==null?void 0:O.subHeading)||{}});const S=be(()=>{var O;return d.value.length>0?d.value:Array(D.value).fill((O=o.fields)==null?void 0:O.productCard)}),D=be(()=>Number(o.configuration.displaySettings.itemsPerPage||OE)),I=be(()=>Number(o.configuration.displaySettings.lazyLoadBatch)),A=be(()=>{var O;return((O=o.configuration.productItemOrientation)==null?void 0:O.toLowerCase())||"vertical"}),w=G(r.includes(A.value)?_.value||A.value:"vertical"),T=be(()=>d.value.length<1&&!c.value),P=be(()=>`product-${w.value} width-${C.value?C.value:o.configuration.displaySettings.columns||1}`),X=be(()=>o.configuration.displaySettings.enableSearch),$=G(null),J=G(!1),ee=G({});We(l,(O,R)=>{O!==R&&(console.log("[fetchProducts] 1"),Y(!0))}),We($,O=>{O!==null&&o.onCountUpdate&&o.onCountUpdate(O)}),We(m,()=>{l.value=1,console.log("[fetchProducts] 2"),Y(!0)}),We(()=>o.searchText,(O,R)=>{O!==R&&(m.value=O||"")});const Y=pn(async function(O){var H;if(g=600,h.value=!0,v.value&&v.value.length>0&&!y.value){const L=b(v.value,(H=o.fields)==null?void 0:H.productCard,o.catalogType);d.value=L,$.value=L.length,c.value=!1,h.value=!1;try{rn("catalog:items-loaded",{items:L,count:L.length})}catch{}O&&a.value&&a.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});return}c.value=!0;let M=D.value;I.value<M&&I.value>0&&(M=I.value);const N={...f.value,accountID:o.accountId,rowLimit:M,searchText:m.value||o.searchText,rowOffSet:D.value*(l.value-1)};O&&a.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),t.quoteId.value?s.getQuoteItems(!0).then(L=>{h.value=!1}).catch(L=>{console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching line items",L),h.value=!1}).finally(()=>{h.value=!1}):h.value=!1;try{const L=await s.getProductItems(N,o.fields.productCard,o.catalogType);if(L){u.value=L.items.length===M,$.value=L.count,d.value=L.items,p.value=Math.ceil(L.count/D.value);try{rn("catalog:items-loaded",{items:L.items,count:L.count})}catch{}}console.log("[MOLECULEPRODUCTBLOCK:fetchProducts] prodData",L)}catch(L){console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching products",L)}finally{c.value=!1,h.value=!1}},g);async function U(){const{mainHeading:O,subHeading:R}=o.fields.header;if(!O.isStatic&&O.field||!R.isStatic&&R.field){const M=[];O.isStatic?O.value=O.title:M.push(O.field),R.isStatic?R.value=R.title:M.push(R.field);const N={...f.value,accountID:o.accountId,fields:M},H=await s.getEcatalogDetails(N);O.isStatic||(O.value=H[O.field],O.isStatic=!0),R.isStatic||(R.value=H[R.field],R.isStatic=!0)}else O.value=O.title,R.value=R.title}return n({currentPage:l,fetchProducts:Y}),Et(()=>{Y(),U()}),(O,R)=>(F(),q("div",{id:i.value,ref_key:"productBlock",ref:a,class:"product"},[X.value&&k.value===void 0&&!e.hideHeader?(F(),q("div",kE,[pe(CE,{modelValue:m.value,"onUpdate:modelValue":R[0]||(R[0]=M=>m.value=M),placeholder:"Search products..."},null,8,["modelValue"])])):me("",!0),lt(O.$slots,"default",{},void 0,!0),T.value?(F(),q("div",AE,[wE,Ve(),IE])):(F(),q("div",SE,[w.value==="table"?(F(!0),q(De,{key:0},Le(S.value,M=>(F(),q("div",{key:(M==null?void 0:M.catalogItemId)||(M==null?void 0:M.itemId),class:"product-item_table"},[pe(rE,{class:"ecb-theme-card","item-id":M==null?void 0:M.itemId,"catalog-item-id":M==null?void 0:M.catalogItemId,loading:c.value||h.value,mode:w.value,title:M==null?void 0:M.title,attributes:M==null?void 0:M.attributes,actions:M==null?void 0:M.actions,thumbnail:{value:M==null?void 0:M.thumbnail.value},description:M==null?void 0:M.description,url:M==null?void 0:M.friendlyURL,"template-id":e.configuration.productTemplateId,"apply-offer":J.value,"offer-setting":ee.value,offer:M==null?void 0:M.offer,"is-preview":e.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","apply-offer","offer-setting","offer","is-preview"])]))),128)):(F(!0),q(De,{key:1},Le(S.value,M=>(F(),q("div",{key:(M==null?void 0:M.catalogItemId)||(M==null?void 0:M.itemId),class:Me(["product-item_record",P.value])},[pe(ZC,{"item-id":M==null?void 0:M.itemId,"catalog-item-id":M==null?void 0:M.catalogItemId,loading:c.value||h.value,mode:w.value,title:M==null?void 0:M.title,attributes:M==null?void 0:M.attributes,actions:M==null?void 0:M.actions,thumbnail:{value:M==null?void 0:M.thumbnail.value},description:M==null?void 0:M.description,url:M==null?void 0:M.friendlyURL,"template-id":e.configuration.productTemplateId,"apply-offer":J.value,"offer-setting":ee.value,offer:M==null?void 0:M.offer,"is-preview":e.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","apply-offer","offer-setting","offer","is-preview"])],2))),128))]))],8,EE))}},[["__scopeId","data-v-01d2d3f1"]]),U2=e=>(Qt("data-v-0eae07cd"),e=e(),Zt(),e),DE={class:"catalog ect-flex ect-flex-col ect-gap-0 md:ect-flex-row"},RE={class:"catalog-product md:ect-grow"},ME={class:"ect-px-2 ect-text-[#0A0A0A] ect-[font-family:var(--font-family-Font-3,_Montserrat)] ect-text-[18px] md:ect-text-[22px] lg:ect-text-[22px] ect-font-bold ect-leading-normal ect-mb-6","data-test-id":"catalog-block-heading-title"},FE={class:"catalog-filter-mobile ect-flex ect-justify-between m-show"},BE=U2(()=>x("h3",null,"Filter Products",-1)),NE=U2(()=>x("span",null," OPEN FILTERS",-1)),LE=Ne({__name:"OrganismsCatalogBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},searchTerm:{type:String,default:""},onCountUpdate:{type:Function,default:null},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(e){var p,f,g,m,v,y,b,_,C,k,E;const n=Ht(),t=e,r=G(!1),o=be(()=>Array.isArray(t.initialItems)&&t.initialItems.length>0?"Search Results":"Catalog"),i=G(((p=t.configuration.dynamicFilters)==null?void 0:p.length)>0&&((f=t.configuration.displaySettings)==null?void 0:f.displayDynamicFilters)&&!t.searchTerm),a=G(t.configuration.displaySettings),s=be(()=>gx.get(t.configuration.catalogType)),l=be(()=>{let S=c.value.searchText;return S&&!S.endsWith("*")&&(S+="*"),S||""}),u=be(()=>{var X;const S=[],{description:D,thumbnail:I,title:A,attributes:w,actions:T}=t.fields.productCard,P=[D,I,A];return w.forEach($=>{P.push($.value),P.push($.label)}),(T==null?void 0:T.length)>0&&T.forEach($=>{$.action==="CUSTOM"&&(P.push($.url),P.push($.label))}),P.forEach($=>{!$.isStatic&&$.field?S.push($.field):$.value=$.title||"-"}),s.value==="eCatalog"?(S.push("XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),S.push("XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c")):(S.push("XX_ORD1__Friendly_URL__c"),S.push("XX_ORD1__SYS_Requires_Configuration__c")),((X=t.fields.productCard.friendlyURLFields)==null?void 0:X.length)>0&&S.push(...t.fields.productCard.friendlyURLFields),S}),c=G({blockId:t.id,catalogType:mx.get(t.configuration.catalogType)||"Full",checkcurrency:(g=a.value)==null?void 0:g.checkCurrency,eCatalogIDs:t.configuration.catalogType==="ECATALOG_OVERRIDE"&&t.configuration.catalogId?[t.configuration.catalogId]:null,fields:u.value,alternateFieldName:t.configuration.catalogCustomField,searchText:"",whereCondition:t.configuration.staticFilters,sortByField:((v=(m=t.configuration.sort)==null?void 0:m.primary)==null?void 0:v.field)||"Name",sortOrder:(b=(y=t.configuration.sort)==null?void 0:y.primary)==null?void 0:b.direction,secondarySortByField:(C=(_=t.configuration.sort)==null?void 0:_.secondary)==null?void 0:C.field,secondarySortOrder:(E=(k=t.configuration.sort)==null?void 0:k.secondary)==null?void 0:E.direction}),h=G(null),d=G(null);return We(()=>r.value,S=>{S&&window.scrollTo(0,0)}),Et(()=>{c.value.searchText=t.searchTerm||""}),We(c,S=>{d.value&&d.value.fetchFilterList(),h.value&&(h.value.currentPage=1,console.log("[fetchProducts] 4"),h.value.fetchProducts())},{deep:!0}),We(()=>t.searchTerm,S=>{typeof S=="string"&&(c.value.searchText=S)}),(S,D)=>(F(),q("div",DE,[x("div",RE,[x("h2",ME,ke(o.value),1),pe(TE,{ref_key:"product",ref:h,"block-id":e.id,"account-id":Te(n).accountId,configuration:e.configuration,"catalog-type":s.value,request:c.value,fields:e.fields,"search-text":l.value,"initial-items":t.initialItems,"hide-header":!!t.searchTerm,"on-count-update":t.onCountUpdate,"is-preview":e.isPreview},{default:ze(()=>[An(x("div",FE,[BE,x("div",{class:"ect-flex ect-items-center ect-gap-2 m-show",onClick:D[0]||(D[0]=I=>r.value=!0)},[pe(Ge,{class:"filter-product_icon",icon:"tune",color:"#acacac",size:20}),NE])],512),[[tf,!r.value&&i.value]])]),_:1},8,["block-id","account-id","configuration","catalog-type","request","fields","search-text","initial-items","hide-header","on-count-update","is-preview"])])]))}},[["__scopeId","data-v-0eae07cd"]]),PE={name:"AtomIcon",props:{icon:{type:String,default:"edit"},tooltipWidth:{type:Number,default:130},color:{type:String,default:"#acacac"},hover:{type:String,default:null},size:{type:Number,default:20},disabled:{type:Boolean,default:!1},tooltip:{type:String,default:""},direction:{type:String,default:"top-right"},symbol:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},custom:{type:Boolean,default:!1},removeDefaultColor:{type:Boolean,default:!1},margin:{type:String,default:"0px"}},data(){return{isHover:!1}},computed:{style(){return{color:this.removeDefaultColor?"":this.isHover&&this.hover?this.hover:this.color,fontSize:this.size+"px",margin:this.margin}},mode(){let e="material-";return this.symbol?e+="symbols-":e+="icons-",this.rounded?e+="round":e+="outlined",e}}},qE=["width","height"],$E=["href"],UE=["width","height"],jE=["href"];function HE(e,n,t,r,o,i){const a=fn("AtomIcons"),s=fn("AtomTooltip");return t.tooltip?(F(),Oe(s,{key:0,content:t.tooltip,direction:t.direction,width:t.tooltipWidth},{default:ze(()=>[x("div",{class:Me(["google-icon",{disabled:t.disabled}]),onMouseenter:n[0]||(n[0]=l=>o.isHover=!0),onMouseleave:n[1]||(n[1]=l=>o.isHover=!1)},[t.custom?(F(),q(De,{key:1},[pe(a),(F(),q("svg",{width:t.size,height:t.size,style:Re({fill:o.isHover&&t.hover&&!t.disabled?t.hover:t.color,color:o.isHover&&t.hover&&!t.disabled?t.hover:t.color})},[x("use",{href:`#icon-${t.icon}`},null,8,$E)],12,qE))],64)):(F(),q("span",{key:0,class:Me(i.mode),style:Re(i.style)},ke(t.icon),7))],34)]),_:1},8,["content","direction","width"])):(F(),q("div",{key:1,class:Me(["google-icon",{disabled:t.disabled}]),onMouseenter:n[2]||(n[2]=l=>o.isHover=!0),onMouseleave:n[3]||(n[3]=l=>o.isHover=!1)},[t.custom?(F(),q(De,{key:1},[pe(a),(F(),q("svg",{width:t.size,height:t.size,style:Re({fill:o.isHover&&t.hover&&!t.disabled?t.hover:t.color,color:o.isHover&&t.hover&&!t.disabled?t.hover:t.color})},[x("use",{href:`#icon-${t.icon}`},null,8,jE)],12,UE))],64)):(F(),q("span",{key:0,class:Me(i.mode),style:Re(i.style)},ke(t.icon),7))],34))}const ys=Ne(PE,[["render",HE],["__scopeId","data-v-16108bca"]]);async function j2(e,n,t,r={},o={}){let i=`/services/apexrest/${e}?type=${n}`;if(r&&Object.keys(r).length>0){const l=new URLSearchParams;Object.keys(r).forEach(c=>{const h=r[c];h!=null&&h!==""&&l.append(c,String(h))});const u=l.toString();u&&(i+=`&${u}`)}const a={action:"makeCall",data:{callType:t,endpoint:i,...t!=="GET"&&{payload:JSON.stringify(o)}}};return(await ps(Xr,a)).content}const Wr=Lt("expediteCart",()=>{const e=G(null),n=G([]),t=G(),r=G({}),o=Ht();async function i(f,g){let m=g?"cart.getGroupedQuoteProducts":"cart.getQuoteProducts";return await nn({data:JSON.stringify(f),config:{pathKey:m}})}async function a(f){return await nn({data:JSON.stringify({lineItemIds:f}),config:{pathKey:"common.getLineItemAttributes"}})}async function s(){const f=e.value?{quoteId:e.value}:{};return await nn({data:JSON.stringify(f),config:{pathKey:"promocode.getPromoCodes"}})}async function l(){const f=e.value?{quoteId:e.value}:{},g=await j2("XX_ORD1/ecommerce","getQLIsForPromoCode","POST",f,{});return t.value=g,n.value=g.qliIds,g}async function u(f,g,m){const v={promoCode:f,quoteId:e.value,qliIds:g,isLastBatch:m,originalTotalSalesPrice:f?t.value.originalTotalSalesPrice:null,isFromQLIUpdateOrDelete:"false"};return await nn({data:JSON.stringify(v),config:{pathKey:"promocode.applyPromoCode"}})}async function c(f){const m={records:[{fields:f.fields.map(y=>({fieldName:y.fieldName,fieldValue:String(y.fieldValue)}))}],uniqueField:"Id",objectType:f.objectType};return await nn({data:JSON.stringify(m),config:{pathKey:"update.upsertRecords"}})}async function h(f){return await nn({data:JSON.stringify(f),config:{pathKey:"fetch.getRecord"}})}async function d(){const f=e.value;return f?await nn({data:JSON.stringify({objectId:f,isCommit:!1}),config:{pathKey:"tax.calculateAvaTax"}}):void 0}async function p(f){const g=f||o.cid.value;return await j2("XX_ORD1/ecommerce","startNewCart","POST",g?{cid:g}:{},{})}return{quoteId:e,qlisList:n,quoteRecord:r,getRowItems:i,getLineItemAttributesNG:a,getPromoCodeInfo:s,getQLIsForPromoCode:l,applyPromoCodeNG:u,updateRecord:c,getRecordFieldValue:h,calculateAvaTax:d,startNewCart:p}}),VE={name:"ModalApp",components:{AtomIcon:ys},props:{show:{type:Boolean,default:!0},title:{type:String,default:""},subTitle:{type:String,default:""},maxWidth:{type:String,default:""},showCloseButtonText:{type:Boolean,default:!1},showCloseButton:{type:Boolean,default:!0}},emits:["clicked"],mounted(){document.querySelector("body").style.overflow="hidden"},unmounted(){document.querySelector("body").style.overflow="auto"}},zE={key:0,class:"modal-mask"},KE={class:"modal-wrapper"},GE={key:0,class:"close-text"},XE={key:1,class:"modal-container__header"},WE={class:"ect-flex ect-flex-col ect-gap-2"},QE={class:"widget-upload__heading"},ZE={key:0,class:"ect-text-[#5f5f5f] ect-text-[14px] ect-font-roboto ect-font-normal ect-leading-[20px]"},JE={class:"modal-container__content"},YE={class:"modal-container__action"};function ek(e,n,t,r,o,i){const a=fn("AtomIcon");return F(),Oe(Nl,null,{default:ze(()=>[t.show?(F(),q("div",zE,[x("div",KE,[x("div",{class:"modal-container",style:Re(`${t.maxWidth?"max-width: "+t.maxWidth+"px; width: 100%;":""}`)},[t.showCloseButton?(F(),q("div",{key:0,class:"modal-container__close ect-gap-2",onClick:n[0]||(n[0]=s=>e.$emit("clicked"))},[pe(a,{icon:"close",size:16,color:"##0a0a0a",hover:"#000000"}),t.showCloseButtonText?(F(),q("span",GE," Close ")):me("",!0)])):me("",!0),t.title?(F(),q("span",XE,[x("div",WE,[x("p",QE,ke(t.title),1),t.subTitle?(F(),q("span",ZE,ke(t.subTitle),1)):me("",!0)]),lt(e.$slots,"header-action",{},void 0,!0)])):me("",!0),x("div",JE,[lt(e.$slots,"content",{},void 0,!0)]),x("div",YE,[lt(e.$slots,"action",{},void 0,!0)])],4)])])):me("",!0)]),_:3})}const tk=Ne(VE,[["render",ek],["__scopeId","data-v-f59dbab6"]]),nk={name:"AtomLoader"},rk={class:"loader"};function ok(e,n,t,r,o,i){return F(),q("span",rk)}const H2=Ne(nk,[["render",ok],["__scopeId","data-v-32b63014"]]),ik={name:"AtomButton",components:{AtomLoader:H2},props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},btype:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},buttonStyle:{type:String,default:"button"},loading:{type:Boolean,default:!1}},emits:["clicked"],data(){return{isHover:!1}},methods:{getBtnClass(){const e=[];return this.btype?this.btype==="primary"?e.push("esg-btn-primary ect-bg-primary"):this.btype==="secondary"?e.push("esg-btn-secondary"):this.btype==="link"||this.btype==="ghost"?e.push("noborder"):this.btype==="plink"?e.push("esg-pcolor-fc"):this.btype==="error"&&e.push("esg-btn-error"):e.push("esg-btn-primary"),this.buttonStyle==="link"&&e.push("link-btn"),this.disabled&&e.push("disabled"),e},getBtnStyle(){return null}}},ak={class:"loader"};function sk(e,n,t,r,o,i){const a=fn("AtomLoader");return F(),Oe(Mo(t.tag),Bo(e.$attrs,{type:t.method,class:["rectangle-button ect-uppercase ect-whitespace-nowrap",i.getBtnClass()],style:i.getBtnStyle(),onClick:n[0]||(n[0]=kt(s=>e.$emit("clicked"),["prevent"]))}),{default:ze(()=>[x("span",{class:Me({"text-loading":t.loading})},[lt(e.$slots,"default",{},()=>[Ve(ke(t.text),1)],!0)],2),x("span",ak,[t.loading?(F(),Oe(a,{key:0})):me("",!0)])]),_:3},16,["type","class","style"])}const V2=Ne(ik,[["render",sk],["__scopeId","data-v-ae1df853"]]),lk={components:{AppTooltip:O1,AppIcon:Ge},props:{label:{type:String,default:""},modelValue:{type:Boolean,default:!1},partial:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},info:{type:String,default:null},dataTestId:{type:String,default:""}},emits:["update:modelValue"],methods:{toggleChecked(){this.disabled||this.$emit("update:modelValue",!this.modelValue)}}},z2=e=>(Qt("data-v-888eb5f4"),e=e(),Zt(),e),uk=["data-test-id"],ck=["data-test-id"],dk={key:0,width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fk=[z2(()=>x("g",{id:"minus"},[x("path",{id:"Icon",d:"M3 6H10",stroke:"white","stroke-width":"1.66666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],hk={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pk=[z2(()=>x("g",{id:"check"},[x("path",{id:"Icon",d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.6666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],mk=["data-test-id"];function gk(e,n,t,r,o,i){const a=fn("AppIcon"),s=fn("AppTooltip");return F(),q("div",{class:"checkbox","data-test-id":t.dataTestId,onClick:n[0]||(n[0]=(...l)=>i.toggleChecked&&i.toggleChecked(...l))},[x("div",{class:Me(["checkmark",{checked:t.modelValue&&!t.partial&&!t.disabled,disabled:t.disabled,partial:t.partial}]),"data-test-id":`${t.dataTestId}-checkmark`},[t.partial?(F(),q("svg",dk,fk)):t.modelValue?(F(),q("svg",hk,pk)):me("",!0)],10,ck),t.label?(F(),q("div",{key:0,class:"label","data-test-id":`${t.dataTestId}-label`},ke(t.label),9,mk)):me("",!0),t.info?(F(),Oe(s,{key:1,direction:"top",content:t.info,width:100,"data-test-id":`${t.dataTestId}-info-tooltip`},{default:ze(()=>[pe(a,{class:"ect-text-primary ect-pt-2 ect-pl-4",icon:"info","data-test-id":`${t.dataTestId}-info-icon`},null,8,["data-test-id"])]),_:1},8,["content","data-test-id"])):me("",!0)],8,uk)}const vs=Ne(lk,[["render",gk],["__scopeId","data-v-888eb5f4"]]),yk={class:"m-content"},vk={key:0,class:"attribute-input"},bk={key:1,class:"attribute-lookup"},_k={class:"attribute-lookup-main"},xk={key:1},Ck={key:2,class:"attribute-input"},Ek={key:2},kk={class:"m-footer"},Ak=Ne({__name:"MoleculeAttributeModal",props:{data:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},emits:["close","update","reload"],setup(e,{emit:n}){const t=Wr(),r=e,o=n,i=G([]),a=G([]),s=G({}),l=G(!1);async function u(){l.value=!0;const f=[{fieldName:"Id",fieldValue:r.quoteId}];a.value.forEach(m=>{if(m.editable&&!m.apiName.includes(".")){let v=m.apiName;m.dataType==="REFERENCE"?(v=m.apiName.replace("__r","__c"),f.push({fieldName:v,fieldValue:m.referenceRecordId})):f.push({fieldName:v,fieldValue:m.value})}});const g={fields:f,objectType:"XX_ORD1__Quote_Line_Item__c"};console.log(g),await t.updateRecord(g),c(),o("reload",r.quoteId),o("close"),l.value=!1}function c(){const f={},g={};i.value.forEach(m=>{m.dataType==="REFERENCE"&&(g[m.apiName]=m.referenceRecordId),f[m.apiName]=m.value}),r.data.forEach(m=>{m.dataType==="REFERENCE"&&(m.referenceRecordId=g[m.apiName]),m.value=f[m.apiName]})}function h(f,g){if(f){const m=i.value.find(y=>y.label===g.firstLookup.replace("Copy from ",""));console.log("Parent",m);const v={};m.relatedFields.forEach(y=>{v[y.child]=y.value}),m&&(g.referenceRecordId=m.referenceRecordId,g.value=m.value,g.options=m.options,g.relatedFields.forEach(y=>{y.value=v[y.child]}))}else g.referenceRecordId=null,g.options=[],g.relatedFields.forEach(m=>{m.value=null})}function d(f,g){console.log(f,g);const m=g.options.find(v=>v.Id===f);f===null?(g.options=[],g.value=null,g.relatedFields.forEach(v=>{v.value=null})):(g.value=m.Name,g.relatedFields.forEach(v=>{v.value=m[v.child]}))}const p=pn(async function(f,g){g.loading=!0;const m={lookupObjectApiName:g.referenceObject,searchTerm:f||"",fields:s.value[g.apiName]||[]},v=await t.getLookupRecords(m);console.log(v),g.options=v,g.loading=!1});return Jt(()=>{const f={};i.value=JSON.parse(JSON.stringify(r.data)),i.value.forEach(m=>{m.dataType==="REFERENCE"&&(s.value[m.apiName]=[],m.relatedFields=[],f[m.apiName]=m,m.options=[{Name:m.value||"",Id:m.referenceRecordId}]),m.editable=m.editable&&!m.apiName.includes(".")});let g=null;i.value.forEach(m=>{if(m.referenceObject==="XX_Base__Location__c"&&(g?m.firstLookup="Copy from "+g.label:g=m),m.apiName.includes(".")){const[v,y]=m.apiName.split(".");m.parent=v,m.child=y,s.value[v]!=null&&(s.value[v].push(y),f[v].relatedFields.push(m))}}),a.value=i.value.filter(m=>!m.apiName.includes(".")),console.log(a.value,f)}),(f,g)=>(F(),Oe(tk,{title:"Modify attributes",onClicked:g[1]||(g[1]=m=>f.$emit("close"))},{content:ze(()=>[x("div",yk,[(F(!0),q(De,null,Le(a.value,(m,v)=>{var y;return F(),q(De,{key:v},[m.firstLookup?(F(),q("div",vk,[x("label",null,ke(m.firstLookup),1),pe(vs,{modelValue:m.same,"onUpdate:modelValue":[b=>m.same=b,b=>h(b,m)],class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue"])])):me("",!0),m.dataType==="REFERENCE"&&((y=m.relatedFields)==null?void 0:y.length)>0?(F(),q("div",bk,[x("div",_k,[pe(ar,{modelValue:m.referenceRecordId,"onUpdate:modelValue":[b=>m.referenceRecordId=b,b=>d(b,m)],label:m.label,disabled:!m.editable||m.same,options:m.options,lookup:"",search:"",highlight:"",loading:m.loading,property:{key:"Id",value:"Name"},onSearch:b=>Te(p)(b,m)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])]),(F(!0),q(De,null,Le(m.relatedFields,(b,_)=>(F(),q("div",{key:_,class:"attribute-input"},[b.dataType==="PICKLIST"||b.dataType==="MULTIPICKLIST"?(F(),Oe(ar,{key:0,modelValue:b.value,"onUpdate:modelValue":C=>b.value=C,label:b.label,disabled:!b.editable,options:b.picklistValues.map(C=>({label:C,value:C})),select:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):b.dataType==="BOOLEAN"?(F(),q("div",xk,[x("label",null,ke(b.label),1),pe(vs,{modelValue:b.value,"onUpdate:modelValue":C=>b.value=C,disabled:!b.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(F(),Oe(yo,{key:2,label:b.label,disabled:!b.editable,modelValue:b.value,"onUpdate:modelValue":C=>b.value=C,class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))),128))])):(F(),q("div",Ck,[m.dataType==="REFERENCE"?(F(),Oe(ar,{key:0,modelValue:m.referenceRecordId,"onUpdate:modelValue":[b=>m.referenceRecordId=b,b=>d(b,m)],label:m.label,disabled:!m.editable,options:m.options,lookup:"",search:"",highlight:"",loading:m.loading,property:{key:"Id",value:"Name"},onSearch:b=>Te(p)(b,m)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])):m.dataType==="PICKLIST"||m.dataType==="MULTIPICKLIST"?(F(),Oe(ar,{key:1,modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,label:m.label,disabled:!m.editable,options:m.picklistValues.map(b=>({label:b,value:b})),select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):m.dataType==="BOOLEAN"?(F(),q("div",Ek,[x("label",null,ke(m.label),1),pe(vs,{modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,disabled:!m.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(F(),Oe(yo,{key:3,label:m.label,disabled:!m.editable,modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,highlight:"",class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))],64)}),128))])]),action:ze(()=>[x("div",kk,[pe(V2,{text:"CANCEL",btype:"secondary",onClick:g[0]||(g[0]=m=>f.$emit("close"))}),pe(V2,{text:"SAVE",btype:"primary",loading:l.value,onClick:u},null,8,["loading"])])]),_:1}))}},[["__scopeId","data-v-d0648f18"]]),wk={class:"datatable"},Ik={class:"m-show"},Sk={key:0},Ok=["onClick"],Tk={key:1},Dk=["data-test-id","onClick"],Rk={class:"desktop d-show"},Mk={class:"datatable-skeletion"},Fk={class:"datatable-skeletion"},Bk={class:"datatable-skeletion"},Nk=["colspan"],Lk={style:{display:"flex",gap:"1rem",height:"40px"}},Pk=["onClick"],qk=["data-test-id","onClick"],$k={key:0},Uk=["colspan"],jk={style:{display:"flex",gap:"1rem",height:"40px"}},Hk={key:1},Vk=["colspan"],zk={style:{display:"flex","flex-wrap":"wrap",padding:"1rem"}},Kk={key:0,class:"attribute",style:{width:"50%"}},Gk={key:0,class:"ect-flex ect-gap-2"},Xk={key:1,class:"ect-flex ect-gap-2"},Wk={key:1,class:"attribute",style:{width:"50%"}},Qk={key:0},Zk={key:2,class:"attribute",style:{width:"50%"}},Jk={key:0},Yk={key:1},bs=Ne({__name:"MoleculeDataTable",props:{rows:{type:Array,default:()=>[]},cols:{type:Array,default:()=>[]},loading:{type:Array,default:()=>[]},style:{type:Object,default:()=>({})},delRecords:{type:Set,default:()=>new Set},rowLoading:{type:Boolean,default:!1},loadingRowId:{type:String,default:null},del:{type:Boolean,default:!1},configure:{type:Boolean,default:!1},hidecolumn:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},isOption:{type:Boolean,default:!1},attribute:{type:[Object,Boolean],default:()=>({})}},emits:["delete","update","configure","reload"],setup(e,{emit:n}){const t=e,r=G(null),o=G(null),i=n,a=G(null),s=G({}),l=G(null),u=be(()=>t.disabled),c=function(_,C){return a.value&&a.value!==_+":"+C||t.delRecords.has(_)||u.value||l.value&&l.value!==_},h=be(()=>{const{headerStyle:_,optionRow:C,productRow:k}=t.style;return{product:{backgroundColor:k.background,verticalAlign:k.verticalAlignment||"middle"},option:{backgroundColor:C.background,verticalAlign:C.verticalAlignment||"middle"},header:{backgroundColor:_.background,verticalAlign:_.verticalAlignment||"middle"}}}),d=be(()=>{const{headerStyle:_,optionRow:C,productRow:k}=t.style;return{header:_.style||{},option:C.style||{},product:k.style||{}}}),p=be(()=>200/t.cols.length+"px");function f(_,C,k){const E={},{table:S}=t.style;if(_){const{alignment:D,strikethrough:I}=_;D&&(E.textAlign=D),I&&(E.textDecoration="line-through")}if(C){const{width:D,minWidth:I}=C;D&&(E.width=`calc(${D.value+D.unit} - ${p.value})`),I&&(E.minWidth=I.value+I.unit)}return S.border!=="n"&&!k?(E.borderStyle="solid",E.borderColor=S.color,S.border==="b"?E.borderWidth=S.width:S.border==="x"?(E.borderTopWidth=S.width,E.borderBottomWidth=S.width,E.borderLeftWidth=0,E.borderRightWidth=0):S.border==="y"?(E.borderLeftWidth=S.width,E.borderRightWidth=S.width,E.borderTopWidth=0,E.borderBottomWidth=0):S.border==="bottom"||S.border==="default"?(E.borderTopWidth=0,E.borderBottomWidth=S.width,E.borderLeftWidth=0,E.borderRightWidth=0):S.border==="top"&&(E.borderTopWidth=S.width,E.borderBottomWidth=0,E.borderLeftWidth=0,E.borderRightWidth=0)):E.borderWidth="0px",E}function g(_,C){var E;if(C.dataType==="REFERENCE")return(E=_[C.content.replace("__c","__r")])==null?void 0:E.Name;const k=vt(_,C.api,C.dataType);return k===""?k:C.dataType==="PERCENT"?k+"%":k}function m(_,C){_===0?i("delete",C):v(_,"XX_ORD1__QTY__c",C)}function v(_,C,k){l.value=k.Id,y(_,C,k)}const y=pn(function(_,C,k){a.value=k.Id+":"+C,s.value.Id=k.Id,s.value[C]=_;const E=()=>{a.value=null,s.value={},l.value=null};i("update",{record:s.value,callback:E})},500),b=_=>_.content.picklist.map(C=>({label:C,value:C}));return(_,C)=>(F(),q(De,null,[r.value&&o.value?(F(),Oe(Ak,{key:0,data:r.value,"quote-id":o.value,onClose:C[0]||(C[0]=k=>(r.value=null,o.value=null)),onReload:C[1]||(C[1]=k=>_.$emit("reload",k))},null,8,["data","quote-id"])):me("",!0),x("div",wk,[x("div",Ik,[(F(!0),q(De,null,Le(e.rows,k=>(F(),q("table",{key:k.Id,class:"mobile md:ect-hidden"},[(F(!0),q(De,null,Le(e.cols,(E,S)=>{var D,I,A,w;return F(),q("tr",{key:S},[x("th",{style:Re({...f(E.header.style),...h.value.header})},[E.header?(F(),Oe(rt,{key:0,text:E.header.title,style:Re(E.header.style),"sec-style":d.value.header},null,8,["text","style","sec-style"])):me("",!0)],4),x("td",{style:Re({...f(E.content.style),...h.value[k.XX_ORD1__Parent_QLI__c?"option":"product"]})},[E.editable?(F(),q(De,{key:1},[E.api==="XX_ORD1__QTY__c"?(F(),Oe(gs,{key:0,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>m(T,k)],disabled:c(k.Id,E.api),loading:k.Id+":"+E.api===a.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):E.dataType==="PICKLIST"?(F(),Oe(ar,{key:1,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>v(T,E.api,k)],disabled:c(k.Id,E.api),options:b(E),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(F(),Oe(yo,{key:2,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>v(T,E.api,k)],disabled:c(k.Id,E.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(F(),q(De,{key:0},[E.dataType==="URL"?(F(),Oe(fc,{key:0,src:g(k,E)},null,8,["src"])):E.content.isStatic?(F(),Oe(rt,{key:1,tag:(D=E.content)==null?void 0:D.style.tag,text:E.content.content,style:Re((I=E.content)==null?void 0:I.style),"sec-style":k.XX_ORD1__Parent_QLI__c?d.value.option:d.value.product},null,8,["tag","text","style","sec-style"])):(F(),Oe(rt,{key:2,loading:e.loading.includes(E.dataType)&&(!e.loadingRowId||e.loadingRowId===k.Id),tag:(A=E.content)==null?void 0:A.style.tag,text:g(k,E),style:Re((w=E.content)==null?void 0:w.style),"sec-style":k.XX_ORD1__Parent_QLI__c?d.value.option:d.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],4)])}),128)),e.del?(F(),q("tr",Sk,[x("th",{style:Re({...f(),...h.value.header})},null,4),x("td",{style:Re({...f(),...h.value[k.XX_ORD1__Parent_QLI__c?"option":"product"]})},[x("span",{class:Me(["datatable-remove",{disabled:c(k.Id)}]),onClick:E=>!c(k.Id)&&_.$emit("delete",k)},"REMOVE",10,Ok)],4)])):me("",!0),e.configure&&Te(ic).includes(k.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(F(),q("tr",Tk,[x("th",{style:Re({...f(),...h.value.header})},null,4),x("td",{style:Re({...f(),...h.value[k.XX_ORD1__Parent_QLI__c?"option":"product"]})},[x("div",{class:Me(["datatable-configure",{disabled:c(k.Id)}]),"data-test-id":`expeditecart-list-button-configure-${k.Id}`,onClick:E=>!c(k.Id)&&_.$emit("configure",k)},"CONFIGURE",10,Dk)],4)])):me("",!0)]))),128))]),x("table",Rk,[e.hidecolumn?me("",!0):(F(),q("tr",{key:0,style:Re(h.value.header)},[(F(!0),q(De,null,Le(e.cols,k=>{var E;return F(),q("th",{key:k.key,style:Re(f((E=k.header)==null?void 0:E.style,k.style))},[k.header?(F(),Oe(rt,{key:0,text:k.header.title,style:Re(k.header.style),"sec-style":d.value.header},null,8,["text","style","sec-style"])):me("",!0)],4)}),128)),e.del?(F(),q("th",{key:0,style:Re({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):me("",!0),e.configure?(F(),q("th",{key:1,style:Re({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):me("",!0)],4)),e.rowLoading?(F(),q(De,{key:1},Le(5,k=>(F(),q(De,{key:k},[x("tr",null,[(F(!0),q(De,null,Le(e.cols,E=>(F(),q("td",{key:E.key,style:Re(f(E.content.style,E.style))},[x("div",Mk,[pe(xr)])],4))),128)),e.del?(F(),q("td",{key:0,style:Re({...f(),minWidth:"100px",maxWidth:"100px"})},[x("div",Fk,[pe(xr)])],4)):me("",!0),e.configure?(F(),q("th",{key:1,style:Re({...f(),minWidth:"100px",maxWidth:"100px"})},[x("div",Bk,[pe(xr)])],4)):me("",!0)]),e.attribute?(F(),q("td",{key:0,colspan:e.cols.length+2,style:Re(f())},[x("div",Lk,[pe(xr),pe(xr)])],12,Nk)):me("",!0)],64))),64)):(F(!0),q(De,{key:2},Le(e.rows,k=>(F(),q(De,{key:k.Id},[x("tr",{style:Re(h.value[k.XX_ORD1__Parent_QLI__c?"option":"product"])},[(F(!0),q(De,null,Le(e.cols,(E,S)=>{var D,I,A,w;return F(),q("td",{key:S,style:Re(f(E.content.style,E.style,!!k.Attributes)),class:Me({"padding-left":S==0&&k.XX_ORD1__Parent_QLI__c})},[E.editable?(F(),q(De,{key:1},[E.api==="XX_ORD1__QTY__c"?(F(),Oe(gs,{key:0,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>m(T,k)],disabled:c(k.Id,E.api),loading:k.Id+":"+E.api===a.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):E.dataType==="PICKLIST"?(F(),Oe(ar,{key:1,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>v(T,E.api,k)],disabled:c(k.Id,E.api),options:b(E),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(F(),Oe(yo,{key:2,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>v(T,E.api,k)],disabled:c(k.Id,E.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(F(),q(De,{key:0},[E.dataType==="URL"?(F(),Oe(fc,{key:0,src:g(k,E)},null,8,["src"])):E.content.isStatic?(F(),Oe(rt,{key:1,tag:(D=E.content)==null?void 0:D.style.tag,text:E.content.content,style:Re((I=E.content)==null?void 0:I.style),"sec-style":k.XX_ORD1__Parent_QLI__c?d.value.option:d.value.product},null,8,["tag","text","style","sec-style"])):(F(),Oe(rt,{key:2,loading:e.loading.includes(E.dataType)&&(!e.loadingRowId||e.loadingRowId===k.Id),tag:(A=E.content)==null?void 0:A.style.tag,text:g(k,E),style:Re((w=E.content)==null?void 0:w.style),"sec-style":k.XX_ORD1__Parent_QLI__c?d.value.option:d.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],6)}),128)),e.del?(F(),q("td",{key:0,style:Re({...f(null,null,!!k.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[x("span",{class:Me(["datatable-remove",{disabled:c(k.Id)}]),onClick:E=>!c(k.Id)&&_.$emit("delete",k)},"REMOVE",10,Pk)],4)):me("",!0),e.configure?(F(),q("td",{key:1,style:Re({...f(null,null,!!k.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[Te(ic).includes(k.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(F(),q("span",{key:0,class:Me(["datatable-configure",{disabled:c(k.Id)}]),"data-test-id":`expeditecart-list-button-configure-${k.Id}`,onClick:E=>!c(k.Id)&&_.$emit("configure",k)}," CONFIGURE ",10,qk)):me("",!0)],4)):me("",!0)],4),k.attributesLoading?(F(),q("tr",$k,[x("td",{colspan:e.cols.length+2,style:Re(f())},[x("div",jk,[pe(xr),pe(xr)])],12,Uk)])):k.Attributes?(F(),q("tr",Hk,[x("td",{colspan:e.cols.length+2,style:Re(f())},[x("div",zk,[(F(!0),q(De,null,Le(k.Attributes,(E,S)=>(F(),q(De,{key:S},[E.value||E.existingValue||E.existingValueReferenceName?(F(),q(De,{key:0},[E.value&&(E.existingValue||E.existingValueReferenceName)?(F(),q("div",Kk,[x("b",null,ke(E.label)+":",1),E.value!==E.existingValue&&E.value!==E.existingValueReferenceName?(F(),q("div",Gk,[pe(rt,{text:E.value,style:Re(e.attribute.new.style)},null,8,["text","style"]),pe(rt,{text:E.existingValueReferenceName||E.existingValue,style:Re(e.attribute.old.style)},null,8,["text","style"])])):(F(),q("div",Xk,[pe(rt,{text:E.value,style:Re(e.attribute.regular.style)},null,8,["text","style"])])),e.attribute.edit&&E.editable&&k.XX_ORD1__QLI_Type__c!=="Remove"?(F(),Oe(ys,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(r.value=k.Attributes,o.value=k.Id)},null,8,["onClick"])):me("",!0)])):E.value?(F(),q("div",Wk,[x("b",null,ke(E.label)+":",1),E.value?(F(),q("div",Qk,[pe(rt,{text:E.value,style:Re(e.attribute.new.style)},null,8,["text","style"])])):me("",!0),e.attribute.edit&&E.editable?(F(),Oe(ys,{key:1,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(r.value=k.Attributes,o.value=k.Id)},null,8,["onClick"])):me("",!0)])):e.attribute.displayonlychanged?me("",!0):(F(),q("div",Zk,[x("b",null,ke(E.label)+":",1),E.value?(F(),q("div",Jk,[pe(rt,{text:E.value,style:Re(e.attribute.new.style)},null,8,["text","style"])])):E.existingValue?(F(),q("div",Yk,[pe(rt,{text:E.existingValueReferenceName||E.existingValue,style:Re(e.attribute.regular.style)},null,8,["text","style"])])):me("",!0),e.attribute.edit&&E.editable?(F(),Oe(ys,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(r.value=k.Attributes,o.value=k.Id)},null,8,["onClick"])):me("",!0)]))],64)):me("",!0)],64))),128))])],12,Vk)])):me("",!0)],64))),128))])])],64))}},[["__scopeId","data-v-3b714a31"]]),eA={key:0,class:"prodlist"},tA={class:"prodlist-header"},nA={key:0},rA={key:1,class:"summary"},oA={key:1,class:"summary"},iA=Ne({__name:"OrganismsProductListBlock",props:{header:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},footer:{type:Array,default:()=>[]},configuration:{type:Object,default:()=>({})},fields:{type:Object,default:()=>({})},id:{type:String,required:!1},isPreview:{type:Boolean,default:!1}},emits:["counts"],setup(e,{emit:n}){const t=Wr(),r=_r(),o=e,i=n,a=R=>R.toUpperCase()||"",s=be(()=>{var R;return((R=o.fields)==null?void 0:R.styling)||{}}),l=be(()=>{var R,M;return(M=(R=o.configuration)==null?void 0:R.allowedActions)==null?void 0:M.delete}),u=be(()=>{var R,M;return(M=(R=o.configuration)==null?void 0:R.allowedActions)==null?void 0:M.configure}),c=be(()=>{var R;return o.configuration.displayAttributes?(R=o.configuration)==null?void 0:R.attribute:!1}),h=be(()=>{var R;return(R=o.configuration)==null?void 0:R.sort}),d=be(()=>{var R;return(R=o.configuration)==null?void 0:R.group}),p=be(()=>{const R=d.value.groupheader.style;return R?T(R):{}}),f=be(()=>{const R=d.value.groupfooter.style;return R?T(R):{}}),g=be(()=>{const R={},{border:M,color:N,width:H}=s.value.table;return M==="default"&&(R.borderStyle="solid",R.borderColor=N,R.borderWidth=H,R.borderTopWidth=0),R}),m=be(()=>S.value?!1:!A.value||A.value.length===0?!0:A.value.every(R=>{const M=R.rows&&R.rows.length>0,N=R.options&&R.options.some(H=>H.rows&&H.rows.length>0);return!M&&!N}));Va();const v=["CURRENCY","DOUBLE","PERCENT"],y=["CURRENCY","DOUBLE","PERCENT","DATE","DATETIME","TIME","BOOLEAN","STRING","TEXTAREA","REFERENCE","EMAIL","PHONE","URL","TEXTAREA","TEXTAREA"],b=G(null),_=G([]),C=G([]),k=G([]),E=G(!1),S=G(!1),D=G(new Set),I=G([]),A=G([]),w=new Map;function T(R){let M={padding:"1.25rem 2rem"};const{overrite:N,backgroundColor:H,verticalAlignment:L,padding:z}=R;return N&&(M={backgroundColor:H,verticalAlign:L,padding:z||"1.25rem 2rem"}),M}const P=async function({record:R,callback:M}){const N=[];for(const L in R)N.push({fieldName:L,fieldValue:R[L]});const H={fields:N,objectType:o.configuration.objectType};await t.updateRecord(H),M(),R.XX_ORD1__QTY__c!==void 0&&(b.value=R.Id,await ee("FIELD_RELOAD"),b.value=null)};async function X(R){b.value=R,await ee("RELOAD_ALL_FIELDS"),b.value=null}const $=R=>{rn("expeditecart:configure-clicked",{itemId:R.XX_ORD1__Item__c,lineItemId:R.Id,quoteId:t.quoteId,isPreview:o.isPreview})},J=async function(R){D.value.add(R.Id),E.value=!0;const M=[R.Id];await r.deleteLineItems(M),await ee("RELOAD"),E.value=!1,D.value.delete(R.Id)};async function ee(R){R==="RELOAD"?S.value=!0:R==="FIELD_RELOAD"?k.value=v:R==="RELOAD_ALL_FIELDS"&&(k.value=y);const{groupby:M,grouplevel:N}=o.configuration.group,H=t.quoteId,L=o.footer.map(Q=>({field:Q.field,snippet:Q.function||"SUM"})),z={filterObject:o.configuration.objectType,fieldsToDisplay:[...C.value,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c","XX_ORD1__Parent_QLI__c"],aggregateFields:L,filters:o.configuration.filters,parentObjectField:o.configuration.parentObjectField,objectId:H,groupby:M.field,grouplevel:N,primarysort:h.value.primary.field,secondarysort:h.value.secondary.field,primarysortdesc:h.value.primary.direction!=="asc",secondarysortdesc:h.value.secondary.direction!=="asc",filterlogic:o.configuration.filterlogic},j=M.field&&N,W=await t.getRowItems(z,j);j?O(W,N):U(W),o.configuration.displayAttributes&&Y(),S.value=!1,k.value=[]}async function Y(){const R=b.value,M=[];A.value.forEach(H=>{H.rows.forEach(L=>{L.attributes=w.get(L.Id),console.log("row.attributes",L.attributes),R?L.Attributes=w.get(L.Id):L.attributesLoading=!0,M.push(L.Id)})});const N=await t.getLineItemAttributesNG(M);A.value.forEach(H=>{H.rows.forEach(L=>{const z=N[L.Id];if(z==null?void 0:z.some(W=>W.value&&!c.value.displayonlychanged||W.value&&W.existingValue&&c.value.displayonlychanged)){const W=[],Q=new Set;z.forEach(ae=>{Q.has(ae.apiName)||(Q.add(ae.apiName),W.push(ae))}),L.Attributes=W,w.set(L.Id,W)}L.attributesLoading=!1})}),console.log("attributesByIdMap",w)}function U(R){var L;const M=R.lstRecords,N=[],H=R.lstRecords&&((L=R.lstRecords)==null?void 0:L.length)>0;if(i("counts",H),R.lstAggregateField&&R.lstAggregateField.length>0){const z=new Map;R.lstAggregateField.forEach(j=>{z.set(j.fieldName,j.totalValue)}),o.footer.forEach(j=>{j.value=z.get(j.field),N.push(j)})}A.value=[{rows:M,summary:N}]}function O(R,M){const N=[];let H;R.forEach(L=>{var z;if(M==="option"){if((z=L.product)!=null&&z.thisobject){const j={name:"",rows:[L.product.thisobject],summary:[],isProduct:!0,options:[]};L.options.length>0&&L.options.forEach(W=>{const Q={name:W.groupName,rows:[]},ae=[];W.options.forEach(fe=>{Q.rows.push(fe.thisobject)}),W.groupTotals&&W.groupTotals.length>0&&W.groupTotals.forEach(fe=>{var K,V;ae.push({label:Q.name,value:fe.amount,style:((V=(K=d.value)==null?void 0:K.groupfooter)==null?void 0:V.style)||{}})}),Q.summary=ae,j.options.push(Q)}),N.push(j)}}else{if(H={name:L.groupName,rows:[]},L.productRows.forEach(j=>{H.rows.push(j[M].thisobject),j.options.forEach(W=>{const Q={...W.thisobject};Q.isOption=!0,H.rows.push(Q)})}),d.value.displaygroupfooter){const j=[];L.groupTotals&&L.groupTotals.length>0&&L.groupTotals.forEach(W=>{var Q,ae;j.push({label:H.name,value:W.amount,style:((ae=(Q=d.value)==null?void 0:Q.groupfooter)==null?void 0:ae.style)||{}})}),H.summary=j}else H.summary=[];N.push(H)}}),A.value=N}return Jt(()=>{console.log("Product List - Block Before Mount"),I.value=JSON.parse(JSON.stringify(o.columns)),_.value=o.summary,I.value.forEach(R=>{R.content.dataType=a(R.content.dataType),R.editby=R.editable,R.editable=R.editable!=="not",R.dataType=R.content.dataType,R.api=R.content.field,C.value.push(R.content.field)}),C.value.includes("XX_ORD1__QLI_Type__c")||C.value.push("XX_ORD1__QLI_Type__c"),ee("RELOAD")}),(R,M)=>{var N;return m.value?me("",!0):(F(),q("div",eA,[x("div",tA,[e.header.title?(F(),Oe(rt,{key:0,tag:(N=e.header.style)==null?void 0:N.tag,text:e.header.title,style:Re(e.header.style)},null,8,["tag","text","style"])):me("",!0)]),!d.value.repeatcolumheadings||S.value?(F(),q("div",nA,[pe(bs,{cols:I.value,rows:[],summary:[],style:Re(s.value),loading:k.value,del:l.value,configure:u.value,disabled:E.value||e.isPreview,"loading-row-id":b.value,"del-records":D.value,attribute:c.value,onDelete:J,onConfigure:$,onUpdate:P,onReload:M[0]||(M[0]=H=>X(H))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])])):me("",!0),S.value?(F(),q("div",{key:1,style:Re(g.value)},[pe(bs,{hidecolumn:"",cols:I.value,rows:[],summary:[],style:Re(s.value),"row-loading":!0,loading:k.value,del:l.value,configure:u.value,disabled:E.value||e.isPreview,"loading-row-id":b.value,"del-records":D.value,attribute:c.value,onDelete:J,onConfigure:$,onUpdate:P,onReload:M[1]||(M[1]=H=>X(H))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])],4)):me("",!0),S.value?me("",!0):(F(),q("div",{key:2,style:Re(g.value)},[(F(!0),q(De,null,Le(A.value,H=>(F(),q("div",{key:H.name,class:Me(["productlist",H.isProduct?"prodlist-product":"prodlist-option"])},[d.value.displaygroupheader&&H.name?(F(),q("div",{key:0,class:"groupHeader",style:Re(p.value)},[pe(rt,{text:"Group: "+H.name,style:Re(d.value.groupheader.style)},null,8,["text","style"])],4)):me("",!0),pe(bs,{hidecolumn:!d.value.repeatcolumheadings,cols:I.value,rows:H.rows,style:Re(s.value),"row-loading":S.value,loading:k.value,del:l.value,configure:u.value,disabled:E.value||e.isPreview,"loading-row-id":b.value,"del-records":D.value,attribute:c.value,onDelete:J,onConfigure:$,onUpdate:P,onReload:M[2]||(M[2]=L=>X(L))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),H.summary.length>0?(F(),q("div",rA,[(F(!0),q(De,null,Le(H.summary,(L,z)=>{var j,W,Q;return F(),q("div",{key:z,class:"summary_row",style:Re(f.value)},[pe(rt,{tag:(j=L==null?void 0:L.style)==null?void 0:j.tag,text:L.label+" : ",style:Re(L==null?void 0:L.style)},null,8,["tag","text","style"]),Ve(" "),pe(rt,{loading:((W=k.value)==null?void 0:W.length)>0||S.value,tag:(Q=L==null?void 0:L.style)==null?void 0:Q.tag,text:L.value,style:Re(L==null?void 0:L.style)},null,8,["loading","tag","text","style"])],4)}),128))])):me("",!0),H.options?(F(!0),q(De,{key:2},Le(H.options,L=>(F(),q("div",{key:L.name},[d.value.displaygroupheader&&L.name?(F(),q("div",{key:0,class:"groupHeader",style:Re(p.value)},[pe(rt,{text:"Group: "+L.name,style:Re(d.value.groupheader.style)},null,8,["text","style"])],4)):me("",!0),pe(bs,{hidecolumn:!d.value.repeatcolumheadings,cols:I.value,rows:L.rows,style:Re(s.value),"row-loading":S.value,loading:k.value,del:l.value,configure:u.value,disabled:E.value||e.isPreview,"loading-row-id":b.value,"del-records":D.value,attribute:c.value,"is-option":!0,onDelete:J,onConfigure:$,onUpdate:P,onReload:M[3]||(M[3]=z=>X(z))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),L.summary.length>0?(F(),q("div",oA,[(F(!0),q(De,null,Le(L.summary,(z,j)=>{var W,Q,ae;return F(),q("div",{key:j,class:"summary_row",style:Re(f.value)},[pe(rt,{tag:(W=z==null?void 0:z.style)==null?void 0:W.tag,text:z.label+" : ",style:Re(z==null?void 0:z.style)},null,8,["tag","text","style"]),Ve(" "),pe(rt,{loading:((Q=k.value)==null?void 0:Q.length)>0||S.value,tag:(ae=z==null?void 0:z.style)==null?void 0:ae.tag,text:z.value,style:Re(z==null?void 0:z.style)},null,8,["loading","tag","text","style"])],4)}),128))])):me("",!0)]))),128)):me("",!0)],2))),128))],4))]))}}},[["__scopeId","data-v-d933d5c5"]]),aA={class:"detail-section"},sA={key:0,class:"selectedtext sm:hidden"},lA={class:"expand material-icons-outlined"},uA={key:1,class:"detail-section_title"},cA={key:2,class:"detail-section_slot"},dA=Ne({__name:"AtomDetailSection",props:{title:{type:String,required:!0},style:{type:Object,default:()=>({})},expand:{type:Boolean,default:!1},header:{type:Boolean,default:!1},selectedText:{type:String,default:""},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["expand"],setup(e,{emit:n}){const t=e;return(r,o)=>{var i,a;return F(),q("div",aA,[t.header?(F(),q("div",{key:0,class:Me(["detail-section_header ect-border-solid ect-border-border-db",{"ect-border-b-1":t.expand,"ect-border-b-0":!t.expand}]),onClick:o[0]||(o[0]=s=>!t.disabled&&r.$emit("expand",!t.expand))},[t.title?(F(),Oe(rt,{key:0,tag:(i=t.style)==null?void 0:i.tag,text:t.title,style:Re(t.style)},null,8,["tag","text","style"])):me("",!0),t.loading?(F(),Oe(xr,{key:1,type:"accordian-title"})):me("",!0),x("div",null,[t.selectedText?(F(),q("span",sA,ke(t.selectedText),1)):me("",!0),x("span",lA,ke(t.expand?"expand_more":"expand_less"),1)])],2)):(F(),q("div",uA,[e.title?(F(),Oe(rt,{key:0,tag:(a=e.style)==null?void 0:a.tag,text:e.title,style:Re(e.style)},null,8,["tag","text","style"])):me("",!0)])),t.expand?(F(),q("div",cA,[lt(r.$slots,"default",{},void 0,!0)])):me("",!0)])}}},[["__scopeId","data-v-3796312d"]]);function fA(e,n,t){if(!n)return e;if(t.aliasName)return hA(e,n,t);{const o=n.split(".").reduce((i,a)=>i[a]||"",e)||"";return{original:o,value:o,metadata:t}}}function hA(e,n,t){var a;const r=n.split(".");let o=n;r.length>1&&(o=r.pop(),e=r.reduce((s,l)=>s[l]||{},e));let i=e[t.aliasName]||e[o]||"";return i&&t.dataType&&((a=t.dataType)==null?void 0:a.toUpperCase())==="CURRENCY"&&i.includes("(")&&(i=i.split("(")[0]),{value:i,original:e[o],metadata:t}}function pA(e){let n=e.replace(/[_.]/g,"")+"Formatted";return console.log("aliasName",n),n}const mA={class:"quote-summary"},gA={key:0,class:"qt-smuarry"},yA={class:"summary ect-mt-[1rem] md:ect-mt-[0]"},vA=Ne({__name:"OrganismsQuoteSummaryBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},tax:{type:Boolean,default:!1},quoteId:{type:String,default:""}},setup(e){const n=Wr(),t=e,r=hc(),o=be(()=>{var g;return(g=t.fields)==null?void 0:g.header}),i=be(()=>{var g;return(g=t.fields)==null?void 0:g.content}),a=be(()=>{var g;return(g=t.fields)==null?void 0:g.footer}),s=G(!1),l=G(!1),u=G(!1),c=G([]),h=G({}),d=be(()=>{var g,m;return r.isMobile.value&&!s.value&&a.value&&a.value.length>0?`${a.value[0].label} ${((g=h.value[a.value[0].field])==null?void 0:g.value)||""}`:(m=o.value)==null?void 0:m.title});async function p(g){console.log("Quote Summary",g),l.value=!0,u.value&&await n.calculateAvaTax();const m=c.value.map(({field:v})=>v);h.value=await n.getRecordFieldValue({recordId:t.quoteId,lstFields:m}),c.value.forEach(({field:v,dataType:y})=>{h.value[v]=fA(h.value,v,{dataType:y,aliasName:pA(v)})}),l.value=!1}const f=()=>{r.isMobile.value?s.value=!s.value:s.value=!0};return Et(async()=>{var m,v,y,b,_,C,k,E,S;s.value=!r.isMobile.value;const g=(v=(m=document.querySelector(`[page-block-id="${t.id}"]`))==null?void 0:m.parentElement)==null?void 0:v.parentElement;g&&(g.style.display=r.isMobile.value?"none":"block"),u.value=t.tax||((y=i.value)==null?void 0:y.some(({field:D})=>D==="XX_ORD1__Taxes__c")),(t.quoteId||u.value)&&(c.value=(_=(b=t.fields)==null?void 0:b.content)==null?void 0:_.map(({field:D,dataType:I})=>({field:D,dataType:I})),((k=(C=t.fields)==null?void 0:C.footer)==null?void 0:k.length)>0&&((S=(E=t.fields)==null?void 0:E.footer)==null||S.forEach(({field:D,dataType:I})=>c.value.push({field:D,dataType:I}))),p())}),(g,m)=>(F(),Oe(Md,{to:"#qtsummary",disabled:!Te(r).isMobile.value},[x("div",mA,[e.quoteId?(F(),q("div",gA,[pe(dA,{expand:s.value,title:d.value,style:Re(o.value.style),header:Te(r).isMobile.value,onExpand:m[0]||(m[0]=v=>f())},{default:ze(()=>[x("div",yA,[(F(!0),q(De,null,Le(i.value,v=>{var y,b,_,C;return F(),q("div",{key:v.field,class:"summary-item"},[v.label?(F(),Oe(rt,{key:0,tag:(y=v.style)==null?void 0:y.tag,text:v.label,style:Re(v.style)},null,8,["tag","text","style"])):me("",!0),(b=h.value[v.field])!=null&&b.value?(F(),Oe(rt,{key:1,loading:l.value,tag:(_=v.style)==null?void 0:_.tag,text:(C=h.value[v.field])==null?void 0:C.value,style:Re(v.style)},null,8,["loading","tag","text","style"])):me("",!0)])}),128)),(F(!0),q(De,null,Le(a.value,v=>{var y,b,_,C;return F(),q("div",{key:v.field,class:"summary-total"},[v.label?(F(),Oe(rt,{key:0,tag:(y=v.style)==null?void 0:y.tag,text:v.label,style:Re(v.style)},null,8,["tag","text","style"])):me("",!0),(b=h.value[v.field])!=null&&b.value?(F(),Oe(rt,{key:1,loading:l.value,tag:(_=v.style)==null?void 0:_.tag,text:(C=h.value[v.field])==null?void 0:C.value,style:Re(v.style)},null,8,["loading","tag","text","style"])):me("",!0)])}),128))])]),_:1},8,["expand","title","style","header"])])):me("",!0)])],8,["disabled"]))}},[["__scopeId","data-v-0821469a"]]),bA={primary:{bgColor:"#57c046",textColor:"#ffffff"},secondary:{bgColor:"#acacac",textColor:"#ffffff"},secondaryDark:{bgColor:"#5f5f5f",textColor:"#ffffff"},delete:{bgColor:"#ff6a6a",textColor:"#ffffff"},link:{bgColor:"#ffffff",textColor:"#57c046"},ghost:{bgColor:"#ffffff",textColor:"#5f5f5f"}},_A={name:"ThemeAlt",props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},type:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},showspinner:{type:Boolean,default:!1}},emits:["clicked"],methods:{getBtnClass(){const e=[];return!this.type||!bA[this.type]||this.type==="primary"?e.push("esg-btn-primary"):this.type==="secondary"?e.push("esg-btn-secondary"):(this.type==="link"||this.type==="ghost")&&e.push("noborder"),this.disabled&&e.push("disabled"),e},getBtnStyle(){return null}}},xA={key:0,class:"ect-flex ect-justify-center"},CA={key:1};function EA(e,n,t,r,o,i){const a=fn("AtomSpinner");return F(),Oe(Mo(t.tag),Bo(e.$attrs,{type:t.method,class:["rectangle-button",i.getBtnClass()],style:i.getBtnStyle(),onClick:n[0]||(n[0]=kt(s=>e.$emit("clicked"),["prevent"]))}),{default:ze(()=>[lt(e.$slots,"default",{},()=>[t.showspinner?(F(),q("div",xA,[pe(a,{class:"item-button_spinner"})])):(F(),q("div",CA,ke(t.text),1))],!0)]),_:3},16,["type","class","style"])}const _s=Ne(_A,[["render",EA],["__scopeId","data-v-7428ebd4"]]),kA={class:"promocode-input"},AA={class:"m-1"},wA=Ne({__name:"OrganismsPromoCodeBlock",props:{fields:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})},id:{type:String,required:!0},isPreview:{type:Boolean,default:!1}},setup(e){const n=Wr(),t=e,r=be(()=>t.fields.label),o=G(!1),i=G(""),a=G(!1),s=G(!1),l=G(""),u=G(null),c=async()=>{if(t.isPreview)return;a.value=!0,o.value=!0,s.value=!1,await n.getQLIsForPromoCode();const f=await h(!1);f.error||(l.value=f),a.value=!1},h=async f=>{const m=n.qlisList,v=Math.ceil(m.length/50);let y="";for(let b=0;b<v;b++){const _=b*50,C=_+50,k=b===v-1;if(y=await d(m.slice(_,C),k,f),y&&y.error)return s.value=y.error,u.value.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),a.value=!1,f||(o.value=!1,p(!0)),y}return y},d=async(f,g,m)=>await n.applyPromoCodeNG(m?"":i.value,f,g),p=async f=>{if(t.isPreview)return;a.value=!0,await n.getQLIsForPromoCode(),f!==!0&&(s.value=!1);const g=await h(!0);(!g||g&&!g.error)&&f!==!0&&(o.value=!1,l.value="",i.value=""),a.value=!1};return Et(async()=>{const f=await n.getPromoCodeInfo();console.log("Offer::",f),f!=null&&f.XX_ORD1__Promo_Code__c&&(i.value=f.XX_ORD1__Promo_Code__c,l.value=f.XX_ORD1__Short_Description__c,o.value=!0)}),(f,g)=>{var m,v,y,b,_,C,k;return F(),q("div",{ref_key:"promocodeRef",ref:u,class:"promocode"},[(m=r.value)!=null&&m.title?(F(),Oe(rt,{key:0,text:(v=r.value)==null?void 0:v.title,style:Re((y=r.value)==null?void 0:y.style)},null,8,["text","style"])):me("",!0),x("div",kA,[pe(yo,{modelValue:i.value,"onUpdate:modelValue":[g[0]||(g[0]=E=>i.value=E),g[1]||(g[1]=E=>o.value=!1)],class:"promocode-input_box",disabled:o.value||e.isPreview,error:s.value},null,8,["modelValue","disabled","error"]),a.value?(F(),Oe(du,{key:0})):(F(),q(De,{key:1},[o.value?(F(),Oe(_s,{key:1,theme:(C=e.fields.removeButton)==null?void 0:C.style.theme,disabled:i.value.length<1,text:(k=e.fields.removeButton)==null?void 0:k.title,onClick:p},null,8,["theme","disabled","text"])):(F(),Oe(_s,{key:0,theme:(b=e.fields.applyButton)==null?void 0:b.style.theme,disabled:i.value.length<1,text:(_=e.fields.applyButton)==null?void 0:_.title,onClick:c},null,8,["theme","disabled","text"]))],64)),x("span",AA,ke(l.value),1)])],512)}}},[["__scopeId","data-v-861bd8dd"]]),K2={"af-ZA":"yyyy/MM/dd","am-ET":"dd/MM/yyyy","ar-AE":"dd/MM/yyyy","ar-BH":"dd/MM/yyyy","ar-DZ":"dd-MM-yyyy","ar-EG":"dd/MM/yyyy","ar-IQ":"dd/MM/yyyy","ar-JO":"dd/MM/yyyy","ar-KW":"dd/MM/yyyy","ar-LB":"dd/MM/yyyy","ar-LY":"dd/MM/yyyy","ar-MA":"dd-MM-yyyy","ar-OM":"dd/MM/yyyy","ar-QA":"dd/MM/yyyy","ar-SA":"dd/MM/yyyy","ar-SY":"dd/MM/yyyy","ar-TN":"dd-MM-yyyy","ar-YE":"dd/MM/yyyy","arn-CL":"dd-MM-yyyy","as-IN":"dd-MM-yyyy","ba-RU":"dd.MM.yyyy","de-BE":"dd.MM.yyyy","be-BY":"dd.MM.yyyy","bg-BG":"dd.MM.yyyy","bn-BD":"dd-MM-yyyy","bs-BA":"yyyy-MM-dd","bn-IN":"dd-MM-yyyy","bo-CN":"yyyy/MM/dd","br-FR":"dd/MM/yyyy","ca-ES":"dd/MM/yyyy","co-FR":"dd/MM/yyyy","cs-CZ":"dd.MM.yyyy","cy-GB":"dd/MM/yyyy","da-DK":"dd.MM.yyyy","de-AT":"dd.MM.yyyy","de-CH":"dd.MM.yyyy","de-DE":"dd.MM.yyyy","de-LI":"dd.MM.yyyy","de-LU":"dd.MM.yyyy","dsb-DE":"dd.MM.yyyy","dv-MV":"dd/MM/yyyy","el-GR":"dd/MM/yyyy","en-029":"MM/dd/yyyy","en-AU":"dd/MM/yyyy","en-BZ":"dd/MM/yyyy","en-CA":"yyyy-MM-dd","en-GB":"dd/MM/yyyy","en-IE":"dd/MM/yyyy","en-ID":"dd/MM/yyyy","en-IN":"dd/MM/yyyy","lu-CD":"dd/MM/yyyy","en-JM":"dd/MM/yyyy","en-HK":"dd/MM/yyyy","en-MY":"dd/MM/yyyy","en-NZ":"dd/MM/yyyy","en-PH":"MM/dd/yyyy","en-SG":"dd/MM/yyyy","en-TT":"dd/MM/yyyy","en-US":"MM/dd/yyyy","en-ZA":"yyyy/MM/dd","en-ZW":"MM/dd/yyyy","es-AR":"dd/MM/yyyy","es-BO":"dd/MM/yyyy","es-CL":"dd-MM-yyyy","es-CO":"dd/MM/yyyy","es-CR":"dd/MM/yyyy","es-DO":"dd/MM/yyyy","es-EC":"dd/MM/yyyy","es-ES":"dd/MM/yyyy","es-GT":"dd/MM/yyyy","es-HN":"dd/MM/yyyy","es-MX":"dd/MM/yyyy","es-NI":"dd/MM/yyyy","es-PA":"MM/dd/yyyy","es-PE":"dd/MM/yyyy","es-PR":"dd/MM/yyyy","es-PY":"dd/MM/yyyy","es-SV":"dd/MM/yyyy","es-US":"MM/dd/yyyy","es-UY":"dd/MM/yyyy","es-VE":"dd/MM/yyyy","et-EE":"dd.MM.yyyy","eu-ES":"yyyy/MM/dd","fa-IR":"MM/dd/yyyy","fi-FI":"dd.MM.yyyy","fil-PH":"MM/dd/yyyy","fo-FO":"dd-MM-yyyy","fr-BE":"dd/MM/yyyy","fr-CA":"yyyy-MM-dd","fr-CH":"dd.MM.yyyy","fr-FR":"dd/MM/yyyy","fr-LU":"dd/MM/yyyy","fr-MC":"dd/MM/yyyy","fy-NL":"dd-MM-yyyy","ga-IE":"dd/MM/yyyy","gd-GB":"dd/MM/yyyy","gl-ES":"dd/MM/yyyy","gsw-FR":"dd/MM/yyyy","gu-IN":"dd-MM-yyyy","ha-Latn-NG":"dd/MM/yyyy","he-IL":"dd/MM/yyyy","hi-IN":"dd/MM/yyyy","hr-BA":"dd.MM.yyyy.","hr-HR":"dd.MM.yyyy","hsb-DE":"dd.MM.yyyy","hu-HU":"yyyy.MM.dd.","hy-AM":"dd.MM.yyyy","ib-LU":"dd.MM.yyyy","id-ID":"dd/MM/yyyy","ig-NG":"dd/MM/yyyy","ii-CN":"yyyy/MM/dd","in-ID":"dd/MM/yyyy","is-IS":"dd.MM.yyyy","it-CH":"dd.MM.yyyy","it-IT":"dd/MM/yyyy","iu-Cans-CA":"dd/MM/yyyy","iu-Latn-CA":"dd/MM/yyyy","ja-JP":"yyyy/MM/dd","ka-GE":"dd.MM.yyyy","kk-KZ":"dd.MM.yyyy","kl-GL":"dd-MM-yyyy","km-KH":"dd/MM/yyyy","kn-IN":"dd-MM-yyyy","ko-KR":"yyyy.MM.dd","kok-IN":"dd-MM-yyyy","ky-KG":"dd.MM.yyyy","lb-LU":"dd/MM/yyyy","lo-LA":"dd/MM/yyyy","lt-LT":"yyyy.MM.dd","lv-LV":"yyyy.MM.dd.","mi-NZ":"dd/MM/yyyy","mk-MK":"dd.MM.yyyy","ml-IN":"dd-MM-yyyy","mn-MN":"yyyy.MM.dd","mn-Mong-CN":"yyyy/MM/dd","moh-CA":"MM/dd/yyyy","mr-IN":"dd-MM-yyyy","ms-BN":"dd/MM/yyyy","ms-MY":"dd/MM/yyyy","mt-MT":"dd/MM/yyyy","nb-NO":"dd.MM.yyyy","ne-NP":"MM/dd/yyyy","nl-BE":"dd/MM/yyyy","nl-NL":"dd-MM-yyyy","nn-NO":"dd.MM.yyyy","nso-ZA":"yyyy/MM/dd","oc-FR":"dd/MM/yyyy","or-IN":"dd-MM-yyyy","pa-IN":"dd-MM-yyyy","pl-PL":"dd.MM.yyyy","prs-AF":"dd/MM/yyyy","ps-AF":"dd/MM/yyyy","pt-BR":"dd/MM/yyyy","pt-PT":"dd/MM/yyyy","qut-GT":"dd/MM/yyyy","quz-BO":"dd/MM/yyyy","quz-EC":"dd/MM/yyyy","quz-PE":"dd/MM/yyyy","rm-CH":"dd/MM/yyyy","ro-RO":"dd.MM.yyyy","ru-RU":"dd.MM.yyyy","rw-RW":"MM/dd/yyyy","sa-IN":"dd-MM-yyyy","sah-RU":"MM.dd.yyyy","sh-CS":"dd.MM.yyyy","sr-CS":"dd.MM.yyyy","se-FI":"dd.MM.yyyy","se-NO":"dd.MM.yyyy","se-SE":"yyyy-MM-dd","si-LK":"yyyy-MM-dd","sk-SK":"dd.MM.yyyy","sl-SI":"dd.MM.yyyy","sma-NO":"dd.MM.yyyy","sma-SE":"yyyy-MM-dd","smj-NO":"dd.MM.yyyy","smj-SE":"yyyy-MM-dd","smn-FI":"dd.MM.yyyy","sms-FI":"dd.MM.yyyy","sq-AL":"yyyy-MM-dd","sr-Cyrl-BA":"dd.MM.yyyy","sr-Cyrl-CS":"dd.MM.yyyy","sr-Cyrl-ME":"dd.MM.yyyy","sr-Cyrl-RS":"dd.MM.yyyy","sr-Latn-BA":"dd.MM.yyyy","sr-Latn-CS":"dd.MM.yyyy","sr-Latn-ME":"dd.MM.yyyy","sr-Latn-RS":"dd.MM.yyyy","sv-FI":"dd.MM.yyyy","sv-SE":"yyyy-MM-dd","sw-KE":"MM/dd/yyyy","syr-SY":"dd/MM/yyyy","ta-IN":"dd-MM-yyyy","te-IN":"dd-MM-yyyy","tg-Cyrl-TJ":"dd.MM.yyyy","th-TH":"dd/MM/yyyy","tk-TM":"dd.MM.yyyy","tn-ZA":"yyyy/MM/dd","tr-TR":"dd.MM.yyyy","tt-RU":"dd.MM.yyyy","tzm-Latn-DZ":"dd-MM-yyyy","ug-CN":"yyyy-MM-dd","uk-UA":"dd.MM.yyyy","ur-PK":"dd/MM/yyyy","uz-Cyrl-UZ":"dd.MM.yyyy","uz-Latn-UZ":"dd/MM yyyy","vi-VN":"dd/MM/yyyy","wo-SN":"dd/MM/yyyy","xh-ZA":"yyyy/MM/dd","yo-NG":"dd/MM/yyyy","zh-CN":"yyyy/MM/dd","zh-HK":"dd/MM/yyyy","zh-MO":"dd/MM/yyyy","zh-SG":"dd/MM/yyyy","zh-TW":"yyyy/MM/dd","zu-ZA":"MM/dd/yyyy"};function IA(e){return K2[e]||"dd/MM/yyyy"}function SA(e,n){if((e==null?void 0:e.length)<6||!n)return null;const t=K2[n]||"dd/MM/yyyy",r=t.includes("/")?"/":t.includes("-")?"-":".",o=t.split(r),i=e.split(r),a={};if(o.forEach((l,u)=>{a[l]=parseInt(i[u])}),a.yyyy>9999||a.yyyy<1e3||a.MM<0||a.MM>12||a.dd<0||a.dd>31)return null;const s=new Date(a.yyyy,a.MM-1,a.dd);return s!="Invalid Date"?s:null}const xs=e=>(Qt("data-v-13eaa242"),e=e(),Zt(),e),OA=["data-test-id"],TA=["for","data-test-id"],DA=["data-test-id"],RA=["placeholder","data-test-id"],MA=["data-test-id"],FA=["data-test-id"],BA=["data-test-id"],NA=["data-test-id"],LA=[xs(()=>x("span",{class:"mdpchbi-left-arrows"},null,-1))],PA=["data-test-id"],qA=[xs(()=>x("span",{class:"mdpchbi-left-arrow"},null,-1))],$A=["data-test-id"],UA=["data-test-id"],jA=["data-test-id"],HA=["data-test-id"],VA=[xs(()=>x("span",{class:"mdpchbi-right-arrow"},null,-1))],zA=["data-test-id"],KA=[xs(()=>x("span",{class:"mdpchbi-right-arrows"},null,-1))],GA=["data-test-id"],XA={class:"c-container"},WA={class:"cc-head"},QA={class:"cc-body"},ZA={class:"cdc-day"},JA=["onClick"],YA=60*60*24*1e3,ew=Ne({__name:"InputDatepicker",props:{locale:{type:String,default:"en-US"},max:{type:[Date,String]},min:{type:[Date,String]},label:{type:String,default:""},error:{type:[Boolean,String]},required:{type:Boolean,default:!1},modelValue:{type:String},highlight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},refrence:{type:Object},disableYear:{type:Boolean,default:!1},disableMonth:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","focus-in","focus-out","error"],setup(e,{emit:n}){const t=e,r=n,o=Date.now()-Date.now()%YA+new Date().getTimezoneOffset()*1e3*60,i=V=>{if(!V)return"";const[te,oe,le]=V.split("-");return`${oe}/${le}/${te}`},a=V=>{if(!V)return"";const[te,oe,le]=V.split("/");return`${le}-${te.padStart(2,"0")}-${oe.padStart(2,"0")}`},s=G({year:new Date().getFullYear(),month:new Date().getMonth(),selectedDay:o,monthDetails:[]}),l=G({position:"fixed",top:"0px",left:"0px",width:"0px"}),u=["SUN","MON","TUE","WED","THU","FRI","SAT"],c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"],d=G(new Date(1e3,0,1)),p=G(new Date(9999,0,1)),f=G(!0),g=G(!1),m=G(""),v=G(""),y=G(!1),b=G(""),_=G(-1),C=be(()=>IA(t.locale)),k=be(()=>d.value.getFullYear()<s.value.year),E=be(()=>p.value.getFullYear()>s.value.year),S=be(()=>k.value||d.value.getMonth()<s.value.month),D=be(()=>E.value||p.value.getMonth()>s.value.month),I=be(()=>{if(v.value){const V=v.value.getTime();if(p.value.getTime()<V)return"Max date can be "+p.value.toLocaleDateString(t.locale);if(d.value.getTime()>V)return"Min date can be "+d.value.toLocaleDateString(t.locale)}return!1}),A=be(()=>{let V=t.error===""?!1:t.error===!0?`${t.label||"Field"} is required`:t.error;return f.value||(V="Date format must be "+C.value),I.value&&(V=I.value),r("error",V),V}),w=be(()=>(b.value==""||b.value==null)&&(t.modelValue==""||t.modelValue==null)?!1:b.value!=t.modelValue);We(()=>t.modelValue,V=>{m.value=V?i(V):""}),We(()=>t.min,V=>{d.value=V?new Date(V):new Date(1e3,0,1)}),We(()=>t.max,V=>{p.value=V?new Date(V):new Date(9999,0,1)}),We(m,V=>{if(V)try{const te=SA(V,t.locale);if(v.value=te||v.value,f.value=!!te,f.value){const oe=a(V);if(b.value===oe)return;r("update:modelValue",oe)}}catch(te){console.info("[ERROR]: Date parsing error:",te),f.value=!1}else f.value=!0,v.value=null,r("update:modelValue","")});const T=G(null),P=G(null),X=G(null);Et(()=>{K(),p.value=t.max?new Date(t.max):p.value,d.value=t.min?new Date(t.min):d.value,t.modelValue&&(m.value=i(t.modelValue),f.value=!!m.value),b.value=t.modelValue,window.addEventListener("resize",$),window.addEventListener("scroll",$,!0)}),tr(()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)});const $=()=>{if(!X.value)return;const V=X.value.getBoundingClientRect(),te=334;l.value={position:"fixed",top:`${V.bottom+4}px`,left:`${V.left}px`,width:`${te}px`,zIndex:9999}},J=()=>{y.value||(j(),y.value=!0,$(),r("focus-in"))},ee=(V=!1)=>{(!g.value||V)&&setTimeout(()=>{_.value=-1,y.value=!1,r("focus-out",v.value)},100)},Y=()=>{P.value&&P.value.focus()},U=V=>{const te=V.index-V.firstDay,oe=V.index%7;let le=V.month-1,ne=V.year;le<0&&(le=11,ne--);const de=O(ne,le),ve=(te<0?de+te:te%V.numberOfDays)+1,xe=new Date(V.year,V.month,ve).getTime(),ce=te<0||d.value.getTime()>xe?-1:te>=V.numberOfDays||p.value.getTime()<xe?1:0;return{date:ve,day:oe,month:ce,timestamp:xe,dayString:c[oe]}},O=(V,te)=>40-new Date(V,te,40).getDate(),R=(V,te)=>{const oe=new Date(V,te).getDay(),le=O(V,te),ne=[],de=6;let ve=null,xe=0;const ce=7;for(let re=0;re<de;re++)for(let ue=0;ue<ce;ue++)ve=U({index:xe,numberOfDays:le,firstDay:oe,year:V,month:te}),ne.push(ve),xe++;return ne},M=V=>V.timestamp===o,N=V=>V.timestamp===s.value.selectedDay,H=V=>{if(!V)return null;if(V instanceof Date)return{year:V.getFullYear(),month:V.getMonth()+1,date:V.getDate()};if(typeof V=="string"&&V.includes("/")){const[te,oe,le]=V.split("/");return{year:parseInt(le),month:parseInt(te),date:parseInt(oe)}}return null},L=V=>h[Math.max(Math.min(11,V),0)]||"Month",z=V=>{const te=new Date(V.year,V.month-1,V.date).getTime();s.value={selectedDay:te}},j=()=>{K();const V=H(v.value);V!==null&&(z(V),s.value={year:V.year,month:V.month-1,monthDetails:R(V.year,V.month-1)})},W=V=>{const te=new Date(V),oe=(te.getMonth()+1).toString().padStart(2,"0"),le=te.getDate().toString().padStart(2,"0"),ne=te.getFullYear();return m.value=`${oe}/${le}/${ne}`,`${ne}-${oe}-${le}`},Q=V=>{s.value={selectedDay:V.timestamp};const te=W(V.timestamp);ee(!0),r("update:modelValue",te),P.value&&P.value.blur()},ae=V=>{if(t.disableYear)return;const te=s.value.year+V;let oe=s.value.month;d.value.getFullYear()===te&&d.value.getMonth()>oe&&(oe=d.value.getMonth()),p.value.getFullYear()===te&&p.value.getMonth()<oe&&(oe=p.value.getMonth()),s.value={year:te,month:oe,monthDetails:R(te,oe)}},fe=V=>{if(t.disableMonth)return;let te=s.value.year,oe=s.value.month+V;oe===-1?(oe=11,te--):oe===12&&(oe=0,te++),s.value={year:te,month:oe,monthDetails:R(te,oe)}},K=()=>{const V=new Date,te=V.getFullYear(),oe=V.getMonth();s.value={...s.value,year:te,month:oe,selectedDay:o,monthDetails:R(te,oe)}};return(V,te)=>(F(),q(De,null,[x("div",{ref_key:"datePick",ref:T,class:"MyDatePicker","data-test-id":e.dataTestId,onMouseover:te[2]||(te[2]=oe=>g.value=!0),onMouseout:te[3]||(te[3]=oe=>g.value=!1)},[e.label?(F(),q("label",{key:0,class:Me(["title_label",{error_color:!!A.value}]),for:e.label,"data-test-id":`${e.dataTestId}-label`},[Ve(ke(e.label)+" ",1),e.required?(F(),q("span",{key:0,class:Me({error_color:!!A.value})},"*",2)):me("",!0)],10,TA)):me("",!0),x("div",{ref_key:"triggerElement",ref:X,tabindex:"0",class:Me(["mdp-input ectheme-input-box ect-mb-0",{"mdp-input_focus":y.value,errorBorder_color:!!A.value,highlight:w.value&&e.highlight}]),"data-test-id":`${e.dataTestId}-input-wrapper`,onFocusin:J,onFocusout:te[1]||(te[1]=oe=>ee(!1)),onClick:Y},[An(x("input",{id:"calendar",ref_key:"inputRef",ref:P,"onUpdate:modelValue":te[0]||(te[0]=oe=>m.value=oe),type:"text",autocomplete:"off",placeholder:C.value,"data-test-id":`${e.dataTestId}-input`},null,8,RA),[[po,m.value]]),pe(Ge,{icon:"calendar_today",size:18,for:"calendar","data-test-id":`${e.dataTestId}-calendar-icon`},null,8,["data-test-id"])],42,DA),A.value?(F(),q("label",{key:1,class:"error_label","data-test-id":`${e.dataTestId}-error`},[x("p",null,ke(A.value),1)],8,MA)):me("",!0)],40,OA),(F(),Oe(Md,{to:".dropdowntp"},[y.value&&!e.disabled?(F(),q("div",{key:0,class:"mdp-container",style:Re(l.value),"data-test-id":`${e.dataTestId}-calendar-popup`,onMousedown:te[8]||(te[8]=kt(()=>{},["prevent"]))},[x("div",{class:"mdpc-head","data-test-id":`${e.dataTestId}-calendar-header`},[x("div",{class:"mdpch-button","data-test-id":`${e.dataTestId}-prev-year-button`},[x("div",{class:Me(["mdpchb-inner",{disabled:!k.value||e.disableYear}]),onClick:te[4]||(te[4]=oe=>ae(-1))},LA,2)],8,NA),x("div",{class:"mdpch-button","data-test-id":`${e.dataTestId}-prev-month-button`},[x("div",{class:Me(["mdpchb-inner",{disabled:!S.value||e.disableMonth}]),onClick:te[5]||(te[5]=oe=>fe(-1))},qA,2)],8,PA),x("div",{class:"mdpch-container","data-test-id":`${e.dataTestId}-date-display`},[x("div",{class:"mdpchc-year","data-test-id":`${e.dataTestId}-year-display`},ke(s.value.year),9,UA),x("div",{class:"mdpchc-month","data-test-id":`${e.dataTestId}-month-display`},ke(L(s.value.month)),9,jA)],8,$A),x("div",{class:"mdpch-button","data-test-id":`${e.dataTestId}-next-month-button`},[x("div",{class:Me(["mdpchb-inner",{disabled:!D.value||e.disableMonth}]),onClick:te[6]||(te[6]=oe=>fe(1))},VA,2)],8,HA),x("div",{class:"mdpch-button","data-test-id":`${e.dataTestId}-next-year-button`},[x("div",{class:Me(["mdpchb-inner",{disabled:!E.value||e.disableYear}]),onClick:te[7]||(te[7]=oe=>ae(1))},KA,2)],8,zA)],8,BA),x("div",{class:"mdpc-body","data-test-id":`${e.dataTestId}-calendar-body`},[x("div",XA,[x("div",WA,[(F(),q(De,null,Le(u,(oe,le)=>x("div",{key:le,class:"cch-name"},ke(oe),1)),64))]),x("div",QA,[(F(!0),q(De,null,Le(s.value.monthDetails,(oe,le)=>(F(),q("div",{key:le,class:Me(["c-day-container",{disabled:oe.month!==0,highlight:M(oe),"highlight-green":N(oe)}])},[x("div",ZA,[x("span",{onClick:ne=>Q(oe)},ke(oe.date),9,JA)])],2))),128))])])],8,GA)],44,FA)):me("",!0)]))],64))}},[["__scopeId","data-v-13eaa242"]]),G2=e=>(Qt("data-v-9b473c8b"),e=e(),Zt(),e),tw=G2(()=>x("div",{class:"dropdowntp"},null,-1)),nw={key:0,class:"custom-form_block"},rw={class:"custom-form_block-header"},ow={key:0,class:"custom-form_block-content"},iw={key:1,class:"custom-form_block-content"},aw={key:2,class:"custom-form_block-footer"},sw={key:3,class:"custom-form_block-action"},lw={key:1,class:"custom-form_success"},uw={class:"custom-form_success_message"},cw=G2(()=>x("span",{class:"custom-form_success_message-icon material-icons-outlined"}," done ",-1)),dw=Ne({__name:"OrganismsCustomFormBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},options:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},setup(e,{expose:n}){var S;const t=Wr(),r=e,o=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=G({}),a=G(!1),s=G(!1),l=G(!1),u=G({}),c=G({}),h=be(()=>{var D;return(D=r.fields)==null?void 0:D.header}),d=be(()=>{var D;return(D=r.fields)==null?void 0:D.footer}),p=be(()=>r.fields&&r.fields.action&&r.fields.action.label?r.fields.action:!1),f=be(()=>"en-US"),g=be(()=>{var D;return(D=r.fields)==null?void 0:D.confirmation}),m=be(()=>r.configuration),v=G(JSON.parse(JSON.stringify((S=r.fields)==null?void 0:S.content))),y=D=>D?"custom-form_block-content_"+D.toLowerCase():"custom-form_block-content_full",b=()=>{l.value=!1,v.value.forEach(D=>{m.value.populate||(i.value[D.field]="")})},_=pn(async function(D,I,A){v.value[A].loading=!0;const w={objectApiName:r.configuration.objectType,lookupFieldApiName:I,searchTerm:D||""},T=await t.getLookupRecords(w);console.log("Records:::",T),v.value[A].options=T,v.value[A].loading=!1}),C=pn(()=>{!p.value&&!r.fields.isGuidance&&k(!0)},500),k=async D=>{console.log("handlerActionClick");let I=!1;if(v.value.forEach(A=>{A.isFormulaField||(A.dataType==="DATETIME"?i.value[A.field]=new Date().toISOString():A.required&&A.editable&&!i.value[A.field]&&A.dataType!=="BOOLEAN"?(A.error=!0,I=!0):(A.error=null,A.dataType==="EMAIL"&&i.value[A.field]&&!o.test(i.value[A.field])&&(A.error="Enter a valid email",I=!0)))}),!I){s.value=!0;const A=[];for(const T in i.value)(c.value[T]||T==="Id")&&A.push({fieldName:T,fieldValue:i.value[T]});const w={fields:A,objectType:r.configuration.objectType};if(r.options&&r.options.returnError){const T=await t.updateRecord(w,!0);if(!T||typeof T=="object"&&T.ERROR)return console.log("Error in saving",T),s.value=!1,T?T.ERROR:!1}else if(!await t.updateRecord(w))return s.value=!1,!1;return s.value=!1,D||(l.value=!0),!0}};async function E(){a.value=!0;const D=v.value.filter(A=>A.dataType!=="DATETIME").map(A=>A.field);let I={};if(m.value.populate&&r.quoteId&&D.length)try{I=await t.getRecordFieldValue({recordId:r.quoteId,lstFields:D})||{}}catch(A){console.error("[OrganismsCustomFormBlock] getRecordFieldValue failed",A)}v.value.forEach(A=>{var w,T,P;if(A.visiblity=A.dataType!=="DATETIME",m.value.populate&&r.quoteId)if(A.dataType==="BOOLEAN")i.value[A.field]=((w=I[A.field])==null?void 0:w.value)??!1;else if(A.dataType==="REFERENCE"){const X=A.field.replace("__c","__r"),$=(T=I[X])==null?void 0:T.value;$&&(i.value[A.field]=$.Id,A.options=[{Name:$.Name,Id:$.Id}])}else A.dataType==="DATE"?i.value[A.field]=((P=I[A.field])==null?void 0:P.value)??"":i.value[A.field]=vt(I,A.field,A.dataType,!0,!0);A.editable&&A.dataType==="PICKLIST"&&(A.options=A.picklist.map(X=>({label:X,value:X})))}),a.value=!1}return Jt(async()=>{a.value=!0,u.value=JSON.parse(JSON.stringify(r.fields)),v.value=u.value.content,v.value.forEach(D=>{c.value[D.field]=D.editable&&!D.isFormulaField,D.size=y(D.size)}),u.value.request=i.value={Id:r.quoteId},r.quoteId&&await E()}),n({handlerActionClick:k}),(D,I)=>{var A,w,T,P,X,$,J;return F(),q(De,null,[tw,l.value?(F(),q("div",lw,[x("div",uw,[cw,Ve(" "+ke((J=g.value)==null?void 0:J.label),1)]),g.value&&g.value.close?(F(),q("a",{key:0,onClick:b},"click to close")):me("",!0)])):(F(),q("div",nw,[x("div",rw,[(A=h.value)!=null&&A.title?(F(),Oe(rt,{key:0,text:(w=h.value)==null?void 0:w.title,style:Re((T=h.value)==null?void 0:T.style)},null,8,["text","style"])):me("",!0)]),a.value?(F(),q("div",ow,[(F(!0),q(De,null,Le(v.value,(ee,Y)=>(F(),q("div",{key:Y,class:Me(["custom-form_block-content_skeletion",ee.size])},[pe(Gn)],2))),128))])):a.value?me("",!0):(F(),q("div",iw,[(F(!0),q(De,null,Le(v.value,(ee,Y)=>(F(),q(De,{key:Y},[ee.visiblity?(F(),q("div",{key:0,class:Me(["custom-form_block-content_input",ee.size])},[ee.dataType==="PICKLIST"?(F(),Oe(ar,{key:0,modelValue:i.value[ee.field],"onUpdate:modelValue":[U=>i.value[ee.field]=U,Te(C)],options:ee.options,disabled:!ee.editable,select:"",error:ee.error,required:ee.required,label:ee.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label"])):ee.dataType==="BOOLEAN"?(F(),Oe(vs,{key:1,modelValue:i.value[ee.field],"onUpdate:modelValue":[U=>i.value[ee.field]=U,Te(C)],label:ee.label},null,8,["modelValue","onUpdate:modelValue","label"])):ee.dataType==="REFERENCE"?(F(),Oe(ar,{key:2,modelValue:i.value[ee.field],"onUpdate:modelValue":[U=>i.value[ee.field]=U,Te(C)],options:ee.options,disabled:!ee.editable,lookup:"",search:"",error:ee.error,required:ee.required,label:ee.label,loading:ee.loading,highlight:"",property:{key:"Id",value:"Name"},onSearch:U=>Te(_)(U,ee.field,Y)},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label","loading","onSearch"])):ee.dataType==="DATE"?(F(),Oe(ew,{key:3,modelValue:i.value[ee.field],"onUpdate:modelValue":U=>i.value[ee.field]=U,label:ee.label,required:ee.required,disabled:!ee.editable,error:ee.error,locale:f.value,"data-test-id":`cart-customform-datepicker-${ee.field}`,highlight:""},null,8,["modelValue","onUpdate:modelValue","label","required","disabled","error","locale","data-test-id"])):ee.visiblity?(F(),Oe(yo,{key:4,modelValue:i.value[ee.field],"onUpdate:modelValue":[U=>i.value[ee.field]=U,Te(C)],error:ee.error,required:ee.required,disabled:!ee.editable,label:ee.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","error","required","disabled","label"])):me("",!0)],2)):me("",!0)],64))),128))])),d.value?(F(),q("div",aw,[(P=d.value)!=null&&P.title?(F(),Oe(rt,{key:0,text:(X=d.value)==null?void 0:X.title,style:Re(($=d.value)==null?void 0:$.style)},null,8,["text","style"])):me("",!0)])):me("",!0),p.value?(F(),q("div",sw,[s.value?(F(),Oe(du,{key:0,class:"item-button_spinner"})):(F(),Oe(_s,{key:1,theme:p.value.style.theme,text:p.value.label,onClick:I[0]||(I[0]=ee=>k(!1))},null,8,["theme","text"]))])):me("",!0)]))],64)}}},[["__scopeId","data-v-9b473c8b"]]),fw={class:"custom-button"},hw={class:"loader"},pw=Ne({__name:"OrganismsCustomButtonBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},isPreview:{type:Boolean,default:!1}},setup(e){const n=Wr(),t=_r(),r=G(null),o=e,i=be(()=>{var c;return!!((c=t.quoteRecord)!=null&&c.XX_ORD1__Active_Customer_Contact__c)||!0}),a=be(()=>{var c,h;return(h=(c=o.fields)==null?void 0:c.actions)==null?void 0:h.filter(d=>i.value?d.action!=="ACTIVATE":d.action!=="SAVE_FOR_LATER")}),s=c=>c.key??`${c.action}-${c.label}`,l=c=>r.value===s(c),u=c=>{if(o.isPreview)return;const h=s(c);c.action==="SAVE_FOR_LATER"&&(r.value=h),rn("expeditecart:clicked",{action:c.action,label:c.label,targetTemplateId:c.targetTemplateId,quoteId:n.quoteId,isActive:i.value,isPreview:o.isPreview})};return(c,h)=>(F(),q("div",fw,[(F(!0),q(De,null,Le(a.value,(d,p)=>(F(),Oe(_s,{key:p,theme:d.style.theme,text:d.label,class:"custom-button_action",onClick:f=>u(d)},{default:ze(()=>[x("span",{class:Me({"text-loading":l(d)})},ke(d.label),3),x("span",hw,[l(d)?(F(),Oe(H2,{key:0})):me("",!0)])]),_:2},1032,["theme","text","onClick"]))),128))]))}},[["__scopeId","data-v-3245ee72"]]),pc=function(e,n){const t={};t.sectionStyle={},t.blockStyle={};const{visiblity:r}=e;t.visibility=r;const{layout:o}=e;if(t.blockStyle=mw(o,n),o&&(o!=null&&o.padding)){const{top:s,bottom:l,left:u,right:c}=o.padding;s&&(t.sectionStyle.paddingTop=`${s}px`),l&&(t.sectionStyle.paddingBottom=`${l}px`),u&&(t.sectionStyle.paddingLeft=`${u}px`),c&&(t.sectionStyle.paddingRight=`${c}px`)}o!=null&&o.gap&&(t.sectionStyle.gap=`${o.gap}px`);const{styling:i}=e;i&&(i.verticalAlignment&&(t.sectionStyle.alignItems=i.verticalAlignment),i.radius&&(t.sectionStyle.borderRadius=i.radius),i.borderStyle&&(t.sectionStyle.borderStyle=i.borderStyle));const{Background:a}=e;return a&&a.style==="Solid"&&(t.sectionStyle.backgroundColor=a.color),a&&a.opacity==="100%"&&(t.sectionStyle.opacity=1),a&&a.image&&a.image!=="sampleImage.png"&&(t.sectionStyle.backgroundImage=`url(${a.image})`,a.imageSize&&(t.sectionStyle.backgroundSize=a.imageSize)),a&&a.repeat==="no-repeat"&&(t.sectionStyle.backgroundRepeat=a.repeat),a&&(a.horizontalAlignment||a.verticalAlignment)&&(t.sectionStyle.backgroundPosition=a.horizontalAlignment+" "+a.verticalAlignment),t};function mw(e,n){if(!e)return[{}];const{columnSize:t,columns:r}=e;if(n)return Array(r).fill({display:"flex",flexDirection:"column",width:"100%"});if(!t)return Array(r).fill({});const o=t.split("/");return typeof r=="string"&&o.length!==parseInt(r)?Array(r).fill({}):typeof r=="number"&&o.length!==r?Array(r).fill({}):o.map(i=>({flexBasis:`${i}`}))}const gw=["data-sid","data-sname"],yw=["data-bid","data-bname"],vw=["page-block-id"],bw=["page-block-id"],_w=["page-block-id"],xw=["page-block-id"],Cw=["page-block-id"],Ew=["page-block-id"],X2={__name:"TemplateRenderer",props:{onCatalogCountUpdate:{type:Function,default:null},initialCatalogItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1},quoteId:{type:String,default:null}},setup(e,{expose:n}){const t=e,r=Fi(),o=Wr(),i=hc(),a=be(()=>r.pageBlocks||[]),s=G(0);n({refreshTemplate:()=>{s.value+=1}});const u=h=>!0,c=be(()=>{var d,p,f,g;const h=[];return console.log("props.sections template renderer",a.value),console.log("props.isPreview",t.isPreview),t.isPreview&&((d=a.value)!=null&&d.content)?(f=(p=a.value)==null?void 0:p.content)==null||f.forEach(m=>{const v=[],y=m.section,b=JSON.parse(y.XX_ORD1__Content_JSON__c);let _={};b&&(_=pc(b,i.isMobile),y.styleObject=y.hideStyle?{}:_.sectionStyle,y.visibility=_.visibility),m.blocks.forEach(C=>{let k=C.XX_ORD1__Content_Block__r;const E=JSON.parse(k.XX_ORD1__Content_JSON__c);k={...k,...E};let S={};E&&(S=pc(E,i.isMobile),k.styleObject=k.hideStyle?{}:S.blockStyle),v.push(k)}),y.blocks=v,h.push(y)}):(g=a.value)==null||g.forEach(m=>{var _;const v={...m},y=typeof m.contentJSON=="string"?JSON.parse(m.contentJSON):m.contentJSON;let b={};y&&(b=pc(y,i.isMobile),v.styleObject=m.hideStyle?{}:b.sectionStyle,v.visibility=b.visibility,(_=v.blocks)==null||_.forEach((C,k)=>{C.styleObject=b.blockStyle[k]})),h.push(v)}),h});return(h,d)=>(F(),q(De,null,[pe(uu),(F(),q("div",{key:s.value,class:"contentRendered ectheme",style:{width:"100%","box-sizing":"border-box"}},[(F(!0),q(De,null,Le(c.value,p=>(F(),q(De,{key:p.id},[u(p.visibility)?(F(),q("div",{key:0,style:Re(p.styleObject),class:"ect-flex ect-flex-col","data-sid":p.sectionId,"data-sname":p.sectionName},[(F(!0),q(De,null,Le(p.blocks,f=>(F(),q("div",{key:f.id,style:Re(f.styleObject),class:"ect-w-full","data-bid":f.blockId,"data-bname":f.blockName},[f.componentName==="productList"&&Te(o).quoteId?(F(),q("div",{key:0,"page-block-id":f.Id,class:"ect-m-auto ect-w-full"},[pe(iA,{id:f.Id,header:f.fields.header,columns:f.fields.columns,footer:f.fields.footer,fields:f.fields,configuration:f.configuration,"is-preview":e.isPreview},null,8,["id","header","columns","footer","fields","configuration","is-preview"])],8,vw)):f.componentName==="quoteSummary"&&Te(o).quoteId?(F(),q("div",{key:1,"page-block-id":f.Id,class:""},[pe(vA,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":Te(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,bw)):f.componentName==="promoCode"?(F(),q("div",{key:2,"page-block-id":f.Id,class:""},[pe(wA,{id:f.Id,fields:f.fields,configuration:f.configuration,"is-preview":e.isPreview},null,8,["id","fields","configuration","is-preview"])],8,_w)):f.componentName==="customForm"&&Te(o).quoteId?(F(),q("div",{key:3,"page-block-id":f.Id,class:"ect-w-full"},[pe(dw,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":Te(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,xw)):f.componentName==="customButtons"?(F(),q("div",{key:4,"page-block-id":f.Id,class:""},[pe(pw,{id:f.Id,configuration:f.configuration,fields:f.fields,"is-preview":e.isPreview},null,8,["id","configuration","fields","is-preview"])],8,Cw)):f.componentName==="catalogBlock"?(F(),q("div",{key:5,"page-block-id":f.Id,class:""},[pe(LE,{id:f.Id,mode:"preview",configuration:f.configuration,fields:f.fields,"search-term":f.searchTerm,"on-count-update":e.onCatalogCountUpdate,"initial-items":e.initialCatalogItems,"is-preview":e.isPreview,"quote-id":e.quoteId},null,8,["id","configuration","fields","search-term","on-count-update","initial-items","is-preview","quote-id"])],8,Ew)):me("",!0)],12,yw))),128))],12,gw)):me("",!0)],64))),128))]))],64))}},kw=e=>(Qt("data-v-04b2bdef"),e=e(),Zt(),e),Aw={class:"ect-composable-catalog-wrapper","data-test-id":"expose-expediteCatalog-wrapper"},ww={key:0,class:"ect-flex ect-items-center ect-justify-center ect-min-h-[50vh]","data-test-id":"expose-expediteCatalog-loader"},Iw=[kw(()=>x("div",{class:"ect-flex ect-flex-col ect-items-center ect-gap-3"},[x("div",{class:"ect-spinner","aria-label":"Loading"}),x("div",{class:"ect-text-sm ect-text-gray-500"},"Loading catalog…")],-1))],W2=Ne({__name:"ExpediteCatalog",props:{templateId:{type:String,required:!0},identity:{type:Object,required:!1,default:()=>({})},session:{type:Object,required:!1,default:()=>({})},security:{type:Object,required:!1,default:()=>({})},resources:{type:Object,required:!1,default:()=>({})},searchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},previewData:{type:Object,default:()=>({})},initialData:{type:Array,default:()=>[]},isPreview:{type:Boolean,required:!0},sections:{type:Array,required:!0},theme:{type:Object,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},composablesOrgType:{type:String,required:!1},composablesApiKey:{type:String,required:!1}},emits:["catalog-item-added","catalog-item-qty-updated","catalog-line-deleted","catalog-items-fetched","catalog-item-configure","catalog-items-loaded","catalog:id"],setup(e,{emit:n}){const t=Ht(),r=_r(),o=Fi(),i=e,a=G(!1),s=G(!1),l=G(null),u=n,c=[],h=()=>{a.value=window.innerWidth<=768};return Jt(async()=>{var p,f,g,m,v,y,b,_,C,k,E,S,D;t.updateConfig({templateId:i.templateId,organizationId:(p=i.identity)==null?void 0:p.organizationId,hostName:i.hostName,graphqlEndpoint:i.graphqlEndpoint,apiKey:((f=i.security)==null?void 0:f.apiKey)||i.apiKey,accountId:(g=i.identity)==null?void 0:g.accountId,cid:(m=i.identity)==null?void 0:m.contactId,composablesApiUrl:(v=i.security)==null?void 0:v.baseUrl,accessToken:(y=i.security)==null?void 0:y.accessToken,composablesOrgType:i.composablesOrgType,isPreview:i.isPreview,quoteId:(b=i.session)==null?void 0:b.quoteId,userId:(_=i.identity)==null?void 0:_.userId,siteUrl:(C=i.resources)==null?void 0:C.siteUrl}),t.quoteId=(k=i.session)==null?void 0:k.quoteId,console.log("props.sections expedite catalog",i.sections),await t.processSections(i.isPreview,i.sections);const d=(D=(S=(E=o.pageBlocks[0])==null?void 0:E.blocks[0])==null?void 0:S.configuration)==null?void 0:D.catalogId;d&&u("catalog:id",d)}),Et(async()=>{window.addEventListener("resize",h),h(),c.push(Sn("catalog:item-added",d=>{u("catalog-item-added",d)})),c.push(Sn("catalog:item-qty-updated",d=>{u("catalog-item-qty-updated",d)})),c.push(Sn("catalog:line-deleted",d=>{u("catalog-line-deleted",d)})),c.push(Sn("catalog:items-fetched",d=>{u("catalog-items-fetched",d)})),c.push(Sn("catalog:item-configure-clicked",d=>{u("catalog-item-configure",d)})),c.push(Sn("catalog:items-loaded",d=>{u("catalog-items-loaded",d)}))}),We(()=>i.session&&i.session.quoteId,d=>{d&&(t.updateConfig({quoteId:d}),t.quoteId=d,r.getQuoteItems(!0))}),We(()=>i.sections,async(d,p)=>{d!==p&&(await t.processSections(i.isPreview,d),l.value&&l.value.refreshTemplate&&l.value.refreshTemplate())},{deep:!0}),tr(()=>{c.forEach(d=>{try{d()}catch{}})}),(d,p)=>{var f,g;return F(),q("div",Aw,[pe(D2,{"organization-id":(f=i.identity)==null?void 0:f.organizationId,"template-id":i.templateId,"is-preview":i.isPreview,theme:i.theme},null,8,["organization-id","template-id","is-preview","theme"]),s.value?(F(),q("div",ww,Iw)):(F(),Oe(X2,{key:1,ref_key:"templateRendererRef",ref:l,"quote-id":(g=i.session)==null?void 0:g.quoteId,"is-preview":e.isPreview,"on-catalog-count-update":e.onCatalogCountUpdate,"initial-catalog-items":e.initialData},null,8,["quote-id","is-preview","on-catalog-count-update","initial-catalog-items"]))])}}},[["__scopeId","data-v-04b2bdef"]]),Q2={__name:"ExpediteCart",props:{templateId:{type:String,required:!0},hostName:{type:String,required:!1},composablesOrgType:{type:String,required:!1},sections:{type:String,required:!1},theme:{type:Object,required:!1},isPreview:{type:Boolean,required:!1},security:{type:Object,required:!1},identity:{type:Object,required:!1},session:{type:Object,required:!1},resources:{type:Object,required:!1}},emits:["expeditecart-item-configure","expeditecart-clicked"],setup(e,{emit:n}){const t=Ht(),r=Wr(),o=G(null),i=n,a=e;Jt(async()=>{var l,u,c,h,d,p,f,g,m;t.updateConfig({templateId:a.templateId,organizationId:(l=a.identity)==null?void 0:l.organizationId,accountId:(u=a.identity)==null?void 0:u.accountId,cid:(c=a.identity)==null?void 0:c.contactId,userId:(h=a.identity)==null?void 0:h.userId,accessToken:(d=a.security)==null?void 0:d.accessToken,composablesApiUrl:(p=a.security)==null?void 0:p.baseUrl,quoteId:(f=a.session)==null?void 0:f.quoteId,composablesOrgType:"Production",hostName:a.hostName,isPreview:a.isPreview,siteUrl:(g=a.resources)==null?void 0:g.siteUrl}),r.quoteId=(m=a.session)==null?void 0:m.quoteId,await t.processSections(a.isPreview,a.sections)});const s=[];return Et(()=>{s.push(Sn("expeditecart:configure-clicked",l=>{i("expeditecart-item-configure",l)})),s.push(Sn("expeditecart:clicked",l=>{i("expeditecart-clicked",l)}))}),tr(()=>{s.forEach(l=>{try{l()}catch{}})}),We(()=>a.sections,async(l,u)=>{l!==u&&(await t.processSections(a.isPreview,l),o.value&&o.value.refreshTemplate&&o.value.refreshTemplate())},{deep:!0}),(l,u)=>(F(),q(De,null,[pe(D2,{"organization-id":a.identity.organizationId,"template-id":a.templateId,"is-preview":a.isPreview,theme:a.theme},null,8,["organization-id","template-id","is-preview","theme"]),pe(X2,{ref_key:"templateRendererRef",ref:o,"is-preview":e.isPreview},null,8,["is-preview"])],64))}},Sw={pbUniqueId:"PB_DXP_001",vUniqueId:"V_1",versionType:"ACTIVE",playBookName:"DXP AI Guidance",description:"Three-step flow to showcase in-panel component loading via playbook steps.",pbObject:"Opportunity",mode:"FULL",type:null,appliesTo:{},playBookSteps:[{stepID:"PB_DXP_001_V_1_00",stepName:"AI Guidance",stepType:"UI_COMPONENT",stepComponent:"ai-guidance",sequenceNumber:"0",description:"AI Guidance entry step. Presents chat and initial actions.",aiGuidance:"Start here to receive guidance and choose your next action.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Browse Catalog",sequenceNumber:"1",disable:!1}],templateId:"a1RKb000003C3PkMAK"},{stepID:"PB_DXP_001_V_1_0",stepName:"Browse Catalog",stepType:"UI_COMPONENT",stepComponent:"catalog",sequenceNumber:"1",description:"Browse or search the catalog and add items as needed.",aiGuidance:"Use the catalog to discover and add products. Proceed to configuration when ready.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Configure Products",sequenceNumber:"1",disable:!1}],templateId:"a1RKb000003C3PkMAK"},{stepID:"PB_DXP_001_V_1_1",stepName:"Configure Products",stepType:"UI_COMPONENT",stepComponent:"configurator",sequenceNumber:"2",description:"Configure selected products and adjust options as needed.",aiGuidance:"Fine-tune product options. When done, proceed to review your cart.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Review Cart",sequenceNumber:"2",disable:!1}]},{stepID:"PB_DXP_001_V_1_2",stepName:"Review Cart",stepType:"UI_COMPONENT",stepComponent:"cart",sequenceNumber:"3",description:"Review all quote line items before finalizing.",aiGuidance:"Validate quantities and pricing. Return to previous steps if adjustments are required.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[],templateId:"a1RKb000003C0ryMAC"}],metadata:{s3PathKey:"ec-playbooks/00DA0000000cDUJMA2/PB_DXP_001/V_1/playbook.json",createdAt:"2025-12-29T09:05:53.163365+00:00",updatedAt:"2025-12-29T09:05:53.163365+00:00",createdBy:"0052G00000AtQQ9QAN"}},mc=Lt("expediteConfigurator",()=>{const e=G(null),n=G(null),t=G(null),r=G([]);function o(){var u,c;console.info("[expediteConfiguratorStore] getPayload",{hasComp:!!e.value,hasGetConfig:!!((u=e.value)!=null&&u.getConfig)});const l=(c=e.value)==null?void 0:c.getConfig;return{productConfiguration:l!=null?[l]:[]}}function i(l,u){var c,h,d;console.info("[expediteConfiguratorStore] setPreConfigData",{hasData:!!l,hasProductConfiguration:!!((c=l==null?void 0:l.productConfiguration)!=null&&c.length),itemId:u}),n.value=l,((h=l==null?void 0:l.productConfiguration)==null?void 0:h.length)>0&&(t.value=l.productConfiguration.find(p=>{var g;return((p==null?void 0:p.itemId)||((g=p==null?void 0:p.product)==null?void 0:g.itemId))===u}),r.value=l.productConfiguration,console.info("[expediteConfiguratorStore] apply queued?",{hasQueueItem:!!t.value,ready:!!e.value}),t.value&&((d=e.value)!=null&&d.setConfig)&&e.value.setConfig(t.value,r.value))}function a(){var l;console.info("[expediteConfiguratorStore] refresh invoked"),(l=e.value)!=null&&l.refresh&&e.value.refresh()}function s(l){var u;console.info("[expediteConfiguratorStore] setExpediteConfigComp",{received:!!l}),e.value=l,t.value&&((u=e.value)!=null&&u.setConfig)&&(console.info("[expediteConfiguratorStore] applying queued configuration on ready"),e.value.setConfig(t.value,r.value),t.value=null)}return{preConfgData:n,expediteConfigComp:e,getPayload:o,refresh:a,setPreConfigData:i,setExpediteConfigComp:s}}),gc=["Quote_Document"],Ho=Lt("composablePlaybook",()=>{const e=wn(),n=Ht(),t=_r(),r=mc(),o=G(null),i=G("full"),a=G(null),s=G(null),l=G(!1),u=G(!1),c=G(null),h=G(null);G(null);const d=G("");function p(w){d.value=w}const f=()=>({Authorization:`Bearer ${d.value}`,"X-Salesforce-Org-Id":n.organizationId.value||"","X-Salesforce-Org-Type":n.composablesOrgType.value||"","X-Salesforce-User-Id":n.userId.value||"","Content-Type":"application/json"});async function g(w,T="ACTIVE"){if(!w)throw new Error("getPlaybookByKey: 'key' is required");try{const P=`${n.composablesApiUrl.value}/playbooks/getPlaybookByKey/${w}?versionType=${T}`,X=await fetch(P,{method:"GET",headers:f()});if(!X.ok)throw new Error(`Playbook fetch failed: ${X.status}`);const $=await X.json();return a.value=$.data??null,console.log("[playbook] currentPlaybook",a.value),$}catch(P){if(console.warn("[playbook] Falling back to bundled DXP playbook due to fetch error:",(P==null?void 0:P.message)||P),w==="PB_DXP_001")return a.value=Sw,a.value;throw P}}function m(w){u.value=!!w}function v(w){var P,X;if(!((X=(P=a.value)==null?void 0:P.playBookSteps)!=null&&X.length))return;a.value.playBookSteps.some($=>$.stepName===w||$.name===w)&&(s.value=w)}const y=be(()=>{var T;return(((T=a.value)==null?void 0:T.playBookSteps)||[]).find(P=>P.stepName===s.value)||null});function b({stepName:w,data:T=null}){var ee,Y,U,O,R,M,N;if(console.log("[playbook:navigateToStep] called",{stepName:w,dataProvided:!!T,data:T}),!((Y=(ee=a.value)==null?void 0:ee.playBookSteps)!=null&&Y.length)){console.info("[navigateToStep] No playbook steps available, aborting navigation.");return}if(!w){console.info("[navigateToStep] No stepName provided, aborting navigation.");return}const P=a.value.playBookSteps;console.info("[navigateToStep] Steps available:",JSON.stringify(P.map(H=>H.stepName||H.name)));const X=P.findIndex(H=>H.stepName===w||H.name===w);if(X<0){console.info(`[Warn] [navigateToStep] No step found for stepName "${w}".`);return}const $=P[X];if(console.log("[playbook:navigateToStep] target step resolved",{targetIndex:X,targetStepName:($==null?void 0:$.stepName)||($==null?void 0:$.name),stepComponent:$==null?void 0:$.stepComponent}),$!=null&&$.stepComponent&&gc.includes($.stepComponent)){console.info(`[navigateToStep] Target step "${$.stepName}" is a NON_COMPONENT (${$.stepComponent}), storing data in localStorage and searching for a valid component step above.`);const H=getPreviousValidStep($.stepName);H&&(console.info(`[navigateToStep] Valid step to return to: "${H}".`),setDataToLocalStorage({stepName:H,pbUniqueId:(U=a.value)==null?void 0:U.pbUniqueId}))}let J=!1;for(let H=X;H>=0;H--){const L=P[H],z=L==null?void 0:L.stepComponent;if(console.info(`[navigateToStep] Checking step[${H}]:`,L),!z){console.info(`[navigateToStep] Step[${H}] has no component, skipping.`);continue}if(Array.isArray(gc)&&gc.includes(z)){console.info(`[navigateToStep] Step[${H}] component "${z}" is in NON_COMPONENTS, skipping.`);continue}s.value=L.stepName??w,console.info(`[navigateToStep] Navigating to step[${H}] "${s.value}" with component "${z}".`);let j=T;const W=String(z||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),Q=!!((R=(O=j==null?void 0:j.payload)==null?void 0:O.savedProducts)!=null&&R.length)||((N=(M=j==null?void 0:j.payload)==null?void 0:M.productConfiguration)==null?void 0:N.length)>0;if(W==="configurator"&&!Q)try{const ae=typeof t.getTopConfigurableItem=="function"?t.getTopConfigurableItem():null;if(ae){const fe=ae.XX_ORD1__Item__c||ae.xx_ord1__item__c||ae.itemId||"",K=ae.Id||ae.id||"";fe&&(j={payload:{savedProducts:[K?{itemId:fe,qliId:K}:{itemId:fe}]}})}}catch(ae){console.info("[navigateToStep] Unable to auto-select configurable item:",(ae==null?void 0:ae.message)||ae)}console.log("[playbook:navigateToStep] final navigation payload",{currentStepName:s.value,stepComponent:z,hasPayload:!!j,payload:j}),I({XX_ORD1__Completed_PB_Step_Number_EX__c:String(H),XX_ORD1__Playbook_Current_Step_Meta_EX__c:JSON.stringify(j)}),C(z,j),J=!0;break}J||console.info(`[Warn] [navigateToStep] Could not find a valid component step to navigate to starting from stepName "${w}".`),console.log("[playbook:navigateToStep] completed",{navigated:J,toStep:s.value})}function _(w){var J,ee,Y;const T=((J=a.value)==null?void 0:J.playBookSteps)||[];if(!T.length)return;const P=T.findIndex(U=>U.stepName===s.value);if(P<0)return;if(!(Array.isArray((ee=T[P])==null?void 0:ee.beans)&&T[P].beans.some(U=>(U==null?void 0:U.beanName)===w))){console.info(`[navigateToBean] Bean "${w}" not found in current step "${(Y=T[P])==null?void 0:Y.stepName}".`);return}const $=T[P+1];$!=null&&$.stepName&&b({stepName:$.stepName})}function C(w,T=null){var J,ee,Y,U,O,R,M,N,H,L,z,j,W,Q,ae,fe,K;console.log("[playbook:loadComponent] called",{stepComponent:w,dataProvided:!!T,data:T});const P=k(w);console.log("[playbook:loadComponent] resolved route path",{path:P});function X(V){try{return(typeof window<"u"&&window.location.hash||"").replace(/^#/,"")===V}catch{return!1}}const $=String(w||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");if(u.value){console.log("[playbook:loadComponent] embeddedMode active, skipping route",{normalized:$,payloadProvided:!!T}),c.value=$,console.log("[playbook] activeComponentKey",c.value),console.log("[playbook] activeComponentData",T),h.value=T||null;return}if(P)try{if(((T==null?void 0:T.actionFunction)==="Reload"||P==="/quote-item")&&(console.info("[playbook] Reloading quote line items..."),console.log("Reloading configurator 4"),quoteStore.fetchAllQuoteLineItems().then(()=>{console.info("[playbook] Quote line items reloaded...")})),P==="/configurator")if(console.log("[playbook:loadComponent] navigating to configurator",{hasProductConfiguration:((ee=(J=T==null?void 0:T.payload)==null?void 0:J.productConfiguration)==null?void 0:ee.length)>0,hasSavedProducts:((U=(Y=T==null?void 0:T.payload)==null?void 0:Y.savedProducts)==null?void 0:U.length)>0,isReload:(T==null?void 0:T.actionFunction)==="Reload"}),((R=(O=T==null?void 0:T.payload)==null?void 0:O.productConfiguration)==null?void 0:R.length)>0){const V=(M=T==null?void 0:T.payload)==null?void 0:M.productConfiguration[0],te=(V==null?void 0:V.itemId)||((N=V==null?void 0:V.product)==null?void 0:N.itemId)||"";r.setPreConfigData(T==null?void 0:T.payload,te);const oe=`/configurator/${te}`;X(oe)||router.push(oe);return}else if(((L=(H=T==null?void 0:T.payload)==null?void 0:H.savedProducts)==null?void 0:L.length)>0){const V=(z=T==null?void 0:T.payload)==null?void 0:z.savedProducts[0].itemId,te=(j=T==null?void 0:T.payload)==null?void 0:j.savedProducts[0].qliId,oe=`/configurator/${V}/${te}`;X(oe)||router.push(oe);return}else if((T==null?void 0:T.actionFunction)==="Reload"){console.log("Reloading configurator 5"),r.refresh();return}else{const oe=[...((W=quoteStore.allQLIData)==null?void 0:W.lineItems)??[]].sort((le,ne)=>{const de=ve=>ve.xx_ord1__sys_configuration_status2__c==="Needs Configuration"?1:ve.xx_ord1__sys_configuration_status2__c==="Suggests Configuration"?2:3;return de(le)-de(ne)}).filter(le=>le.xx_ord1__sys_configuration_status2__c!=="No Configuration");if(oe.length){const le=oe[0],ne=`/configurator/${le.xx_ord1__item__c}${le.id?`/${le.id}`:""}`;X(ne)||router.push(ne)}else e.handleWarning("No items needing configuration");return}else P==="/adaptive-search"&&((Q=T==null?void 0:T.payload)!=null&&Q.adaptiveSearch)?(console.log("[playbook:loadComponent] navigating to adaptive-search",{hasPayload:!!((ae=T==null?void 0:T.payload)!=null&&ae.adaptiveSearch)}),adaptiveSearch.createLstItems(T==null?void 0:T.payload.adaptiveSearch)):P==="/quote-item"&&T?(console.log("[playbook:loadComponent] navigating to quote-item with data"),quoteStore.performAIAction(T)):P==="/match-records"&&((fe=T==null?void 0:T.payload)!=null&&fe.quickSelection)&&(console.log("[playbook:loadComponent] navigating to match-records",{hasQuickSelection:!!((K=T==null?void 0:T.payload)!=null&&K.quickSelection)}),quickSelectionStore.quickSelectionLayout=T.payload);X(P)||router.push(P),console.log("[playbook:loadComponent] route push called",{path:P})}catch(V){e.handleError(V,"playbookStore.loadComponent")}}function k(w){var X;const T=String(w||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),P={chat_screen:"/",ai_guidance:"/",catalog:"/catalog",adaptive_search:"/adaptive-search",configurator:"/configurator",quote_item:"/quote-item",cart:"/cart",quick_selection:"/match-records",quote_document:null};if(T==="quote_document"){const $=getPreviousValidStep(s.value);return $&&setDataToLocalStorage({stepName:$,pbUniqueId:(X=a.value)==null?void 0:X.pbUniqueId}),goToQuoteDocument(),null}return P[T]||"/quote-item"}function E(){var w;return((w=y.value)==null?void 0:w.beans)??[]}function S(){return E().map(T=>({action:`playbookNavigate:${T.beanName}`,label:T.beanName,disabled:!!T.disable}))}async function D(){var w;try{const T=((w=n.quoteId)==null?void 0:w.value)||"";if(!T)return console.info("getPlaybookInfoFromQuote: Missing Quote Id"),null;const P=`${n.composablesApiUrl.value}/platform/getHeaderRecord`,X={recordId:T,lstFields:["XX_ORD1__Playbook_Id_EX__c","XX_ORD1__Playbook_Version_Id_EX__c","XX_ORD1__Completed_PB_Step_Number_EX__c","XX_ORD1__Playbook_Current_Step_Meta_EX__c"]};return(await(await fetch(P,{method:"POST",headers:f(),body:JSON.stringify(X)})).json()).data}catch(T){return e.handleError(T,"playbookStore.getPlaybookInfoFromQuote"),null}}async function I(w={}){var T;try{const P=((T=n.quoteId)==null?void 0:T.value)||Gl("id")||"";if(!P)return console.info("addPlaybookInfoToQuote: Missing Quote Id"),null;const X={Id:P,...w},$=Object.entries(X).map(([O,R])=>({fieldName:O,fieldValue:R})),J=`${n.composablesApiUrl.value}/platform/upsertRecords`,ee={objectType:"XX_ORD1__Quote__c",uniqueField:"Id",records:[{fields:$}]},U=await(await fetch(J,{method:"POST",headers:f(),body:JSON.stringify(ee)})).json();return console.info("[playbook] addPlaybookInfoToQuote response:",JSON.stringify(U)),U}catch(P){return e.handleError(P,"playbookStore.addPlaybookInfoToQuote"),null}}async function A(){var w;try{const T=`${n.composablesApiUrl.value}/product-pricing/findCatalogInContext?accountId=${n.accountId.value}&catalogType=Primary&catalogLookupFieldName=Primary_Catalog__c`,X=await(await fetch(T,{method:"GET",headers:f()})).json();return(w=X==null?void 0:X.data)==null?void 0:w.catalogId}catch(T){return e.handleError(T,"playbookStore.getCatalogInContext"),null}}return{playbookData:o,currentPlaybook:a,currentStepName:s,currentStep:y,playbookStepsMode:i,showPlaybookSteps:l,embeddedMode:u,activeComponentKey:c,activeComponentData:h,setSecretKey:p,getPlaybookByKey:g,setCurrentStepName:v,navigateToStep:b,navigateToBean:_,loadComponent:C,setEmbeddedMode:m,getCurrentStepLinks:S,addPlaybookInfoToQuote:I,getPlaybookInfoFromQuote:D,getCatalogInContext:A}}),yc={xx_ord1__item__c:"xx_ord1__item__c",xx_ord1__sales_price__c:"xx_ord1__negotiated_price__c",xx_ord1__nrc__c:"xx_ord1__nrc_for_new__c",xx_ord1__line_description__c:"xx_ord1__line_description__c",xx_ord1__list_price__c:"xx_ord1__list_price2__c",xx_ord1__cost__c:"xx_ord1__cost2__c",xx_ord1__rate_plan__c:"xx_ord1__rate_plan__c",xx_ord1__allowed_discount__c:"xx_ord1__allowed_discount__c",xx_ord1__billing_period__c:"xx_ord1__billing_period__c",xx_ord1__ship_to_account__c:"xx_ord1__ship_to_account__c",xx_ord1__erp_item_number__c:"xx_ord1__erp_item_number__c",xx_ord1__mrc__c:"xx_ord1__mrc__c",xx_ord1__qty__c:"xx_ord1__qty__c",id:"id"},Z2={xx_ord1__item__c:"xx_ord1__item__c",xx_ord1__negotiated_price__c:"xx_ord1__sales_price__c",xx_ord1__nrc_for_new__c:"xx_ord1__nrc__c",xx_ord1__line_description__c:"xx_ord1__line_description__c",xx_ord1__list_price2__c:"xx_ord1__list_price__c",xx_ord1__cost2__c:"xx_ord1__cost__c",xx_ord1__rate_plan__c:"xx_ord1__rate_plan__c",xx_ord1__allowed_discount__c:"xx_ord1__allowed_discount__c",xx_ord1__billing_period__c:"xx_ord1__billing_period__c",xx_ord1__ship_to_account__c:"xx_ord1__ship_to_account__c",xx_ord1__erp_item_number__c:"xx_ord1__erp_item_number__c",xx_ord1__mrc__c:"xx_ord1__mrc__c",xx_ord1__qty__c:"xx_ord1__qty__c",id:"id"},Ow=e=>{var t;let n=[];for(let r of e)if(r.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(r.includes(".")){let i=r.split(".")[0];i=i.slice(0,-1)+"c";const a=((t=yc[i==null?void 0:i.toLowerCase()])==null?void 0:t.trim())||"";a&&(n.includes(a)||n.push(a||""),n.push(r))}else n.includes(yc[r==null?void 0:r.toLowerCase()])||n.push(yc[r==null?void 0:r.toLowerCase()]||"");return n.filter(r=>r!=="")},J2=Lt("actions",()=>{const e=Co(),n=xo(),t=G(!1);return{openAdaptiveSearch:(s,l=!1)=>{console.info("openAdaptiveSearch",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),t.value=l},openQuoteItem:s=>{console.info("openQuoteItem",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),e.chatHistory[e.chatHistory.length-1].links=[],e.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const u=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${n.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${U3(window.location.href)}${u}`},undo:()=>{const s=e==null?void 0:e.latestDMLRequest;e.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:t}}),Y2=Lt("adaptiveSearch",()=>{const e=xo(),n=Es(),t=Co(),r=J2(),o=G(null),i=G(null),a=G(!1),s=G(!1),l=G([]),u=G(""),c=G(!1),h=G(null),d=G(!1),p=G([]),f=wn(),g=G([]),m=G(0),v=G(!1),y=G({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function b(){a.value=!0;try{const O=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let R={};return R=await window.salesforceConnector.getDynamicPageLayout(O),i.value=kf(R,"Unable to find the Search Selection Layout for your user profile"),y.value.rowLimt=i.value.configuration.rowLimit||10,i.value.configuration.columns.forEach(M=>{!M.field&&M.label==="QTY"&&(M.field="xx_ord1__qty__c")}),a.value=!1,_(),R}catch(O){a.value=!1,f.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",O)}}function _(){var O,R,M;h.value=(M=(R=(O=i.value)==null?void 0:O.configuration)==null?void 0:R.dynamicFilters)==null?void 0:M.filters.map(N=>({...N,field:N.field.toLowerCase(),filtervalue:N.filtervalue||[],filtervaluefrom:N.filtervaluefrom||"",filtervalueTo:N.filtervalueTo||""}))}function C(){var R;let O=[];for(const M of i.value.configuration.columns){let N=M.field;if(O.includes(N)||O.push(N),N!=null&&N.includes(".")){let L=N.split(".")[0];L=L.slice(0,-1)+"c",O.includes(L)||O.push(L)}}return(R=i.value.configuration)!=null&&R.cardHeader&&O.push(i.value.configuration.cardHeader.imageField),i.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&O.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),O=O.filter(M=>!!M),O.filter(M=>M.toLowerCase()!=="xx_ord1__qty__c"&&M.toLowerCase()!=="xx_ord1__competitor_sku__c")}function k(O,R=!1){if(!O||O.includes("undefined"))return!1;const M=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(R){const N=Array.isArray(O)?O:O.split(",");for(const H of N){const L=H.trim();if(M.test(L))return f.handleError(`Invalid character found in value: ${L}`),!1}}else if(M.test(O))return f.handleError("Special characters are not allowed in filter values"),!1;return!0}function E(O,R){return{field:O.field,operator:O.operator||"contains",value:R,dataType:O.dataType.trim()}}function S(O){if(!O.filtervalue)return null;const R=Array.isArray(O.filtervalue),M=R?O.filtervalue.join(","):O.filtervalue.trim();return k(M,R)?M:null}function D(O){var H,L;const R=(H=O.filtervaluefrom)==null?void 0:H.trim(),M=(L=O.filtervalueTo)==null?void 0:L.trim();if(!R||!M)return null;const N=`${R}, ${M}`;return N!==", "&&k(N)?N:null}function I(O){const R=`${Ef(O.filtervaluefrom)}, ${Ef(O.filtervalueTo)}`;return R!==", "&&k(R)?R:null}function A(O){var M;const R=(M=O.filtervaluefrom)==null?void 0:M.trim();return k(R)?R:null}function w(O){const R=[];return O.forEach(M=>{const N=M.dataType.trim();let H=null;switch(N){case"PICKLIST":case"MULTIPICKLIST":H=S(M);break;case"DOUBLE":case"CURRENCY":H=D(M);break;case"DATETIME":case"DATE":H=I(M);break;default:H=A(M)}H&&R.push(E(M,H))}),p.value=R,R}async function T(O="",R=[],M=[]){var H,L,z,j,W,Q,ae,fe,K,V;let N=[];if(R.length&&(N=w(R)),!N.length&&O.trim()===""){l.value=[],c.value=!1;return}try{c.value=!1,s.value=!0;const te=O.trim();M.length||(M=C());const oe={fields:M,...R.length?{dynamicFilters:N}:{},searchText:te||u.value.trim(),accountId:n.accountId,...n.eCatalogId?{catalogId:n.eCatalogId}:{},...n.objectType==="opportunity"?{opportunityId:n.id}:{},...(L=(H=i.value)==null?void 0:H.configuration)!=null&&L.sort?{primarySortBy:i.value.configuration.sort.primary.field,primarySortOrder:i.value.configuration.sort.primary.direction,secondarySortBy:i.value.configuration.sort.secondary.field,secondarySortOrder:i.value.configuration.sort.secondary.direction}:{},rowLimt:(j=(z=i.value)==null?void 0:z.configuration)==null?void 0:j.rowLimit,paging:(Q=(W=i.value)==null?void 0:W.configuration)==null?void 0:Q.paging,...((ae=y.value)==null?void 0:ae.offset)!==0?{offset:y.value.offset}:{},objectName:(K=(fe=i.value)==null?void 0:fe.configuration)==null?void 0:K.objectName,currencyCode:n.currencyCode},le=await window.salesforceConnector.getItems(JSON.stringify(oe));if(le!=null&&le.errorMessage){f.handleError(le.errorMessage);return}le!=null&&le.itemCount&&(y.value.totalPages=Math.ceil((le==null?void 0:le.itemCount)/y.value.rowLimt)),l.value=za(le.lstItems,{xx_ord1__qty__c:"1"}),(V=le.lstItems)!=null&&V.length||(c.value=!0),s.value=!1}catch(te){f.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",te)}}async function P(O){try{d.value=!0;const R=JSON.stringify({lstQLIRequest:X(O),quoteId:e.quoteId});let M=await window.salesforceConnector.createQLI(R);typeof M=="string"&&(M=JSON.parse(M));let N=!1;if((M==null?void 0:M.length)>0&&M.forEach(H=>{H.errorMessage&&(N=!0,f.handleError(H.errorMessage))}),d.value=!1,N){g.value=M;const H=g.value.reduce((L,z)=>(L[z.eCatalogItemId]=z.errorMessage,L),{});l.value=l.value.map(L=>({...L,backendError:H[L.Id]||""}));return}return M}catch(R){f.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",R)}}function X(O){const R=[];for(const M of O)if(!M.addedToQuote&&M.id){const N=$(M);m.value++,R.push({fields:N,recordId:M.id,...O.length===1?{maxSequenceNumber:m.value}:{}})}return R}function $(O){const R=[],M=J();return Object.keys(O).forEach(N=>{if(M.includes(N)){const H=Z2[N.toLowerCase()];H&&R.push({fieldname:H,value:O[N]})}}),R}function J(){const O=[];return i.value.configuration.columns.forEach(R=>{R.field&&!R.field.includes(".")&&R.isEditable&&R.visible&&O.push(R.field)}),O}function ee(){var R,M;const O=[];return i.value.configuration.columns.forEach(N=>{const H=N.field.toLowerCase();O.includes(H)||O.push(H)}),(R=i.value.configuration)!=null&&R.dynamicFilters&&i.value.configuration.dynamicFilters.filters.forEach(N=>{const H=N.field.toLowerCase();O.includes(H)||O.push(H)}),(M=i.value.configuration)!=null&&M.cardHeader&&O.push(i.value.configuration.cardHeader.imageField),O}async function Y(){var M;const O=ee(),R=((M=i.value.configuration)==null?void 0:M.saveObjectName)||i.value.configuration.objectName;if(R==="xx_ord1__ecatalog_item__c"){const N=O.indexOf("xx_ord1__qty__c");N>-1&&O.splice(N,1)}await e.getFieldsData(O,R),e.fieldsData.xx_ord1__qty__c||e.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function U({searchTerm:O="",filters:R=[]}={}){if(v.value=!0,O&&(u.value=O),R.length&&(p.value=R),await b()){await Y(),v.value=!1;const N=u.value;N&&(u.value=N,await T(N,e.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",r.isStaticActionCall),r.isStaticActionCall&&(r.isStaticActionCall=!1,t.chatHistory[t.chatHistory.length-1]={type:"response",message:"Adaptive search is now open. Please search for the products you require and add it quote",loading:!1,links:[{action:"quoteItem",label:"Quote Item"},{action:"quoteDocument",label:"Quote Document"}]})}v.value=!1}return{selectedItem:o,AdaptiveSearchLayout:i,searchText:u,loadingAdaptiveLayout:a,getAdaptiveSearchLayout:b,getItems:T,lstItems:l,rowItemsLoading:s,noSearchRecords:c,dynamicFilters:h,setDynamicFilters:_,createQliErrors:g,addToQuote:P,addingToQuote:d,getFieldsData:Y,pagingData:y,appliedDynamicFilters:p,maxSequenceNumber:m,loadingAdaptiveSearch:v,initAdaptiveSearch:U}}),Tw="XX_ORD1__Quote__c",Dw="xxord1salespricec",Cs="xx_ord1__item__c",Rw="xxord1productnrcc",Mw=Lt("cartStore",()=>{const e=xo(),n=Y2(),t=wn(),r=G(""),o=G("$0"),i=G("$0"),a=G(null),s=G({}),l=G({}),u=G({}),c=G(""),h=G(""),d=G({}),p=G(""),f=G(""),g=G({});async function m(){k()}async function v(){try{let D=await window.salesforceConnector.getProductCount(e.quoteId);if(D=yn(D),D!=null&&D.errorMessage){t.handleError(D.errorMessage);return}return r.value=D,D}catch{t.handleError("Failed to get Product Count. Please try again.")}}async function y(){try{let D=await window.salesforceConnector.getQuoteTotal(e.quoteId);if(D=yn(D),D!=null&&D.errorMessage){t.handleError(D.errorMessage);return}return i.value=D.monthlyTotal,o.value=D.onetimeTotal,D}catch{t.handleError("Failed to get Total Amount. Please try again.")}}async function b(D,I,A,w=""){if(!e.sectionDataMap.get(A).parentQLIs[I].removingItem){e.sectionDataMap.get(A).parentQLIs[I].removingItem=!0,f.value=D.id,await _(D.id)==="Success"&&(e.fetchAllQuoteLineItems(),w&&w(D,I,A));let P=e.sectionDataMap.get(A).parentQLIs.filter(X=>X[Cs]===D[Cs]).length;f.value="",n.lstItems.forEach(X=>{X[Cs]===D[Cs]&&(X.addedToQuote===!0&&(X.addedToQuote=!1),P===0&&(X.removedFromQuote=!0))})}}async function _(D){try{let I=await window.salesforceConnector.deleteQLI(D);if(I!=null&&I.errorMessage){t.handleError(I.errorMessage);return}return v(),y(),I}catch{t.handleError("Failed to remove Quote Item. Please try again.")}}function C(D){var w,T;const I=(w=D==null?void 0:D[Rw])==null?void 0:w.match(/\.\d+/);I&&(I.value=I[0].length-1);const A=(T=D==null?void 0:D[Dw])==null?void 0:T.match(/\.\d+/);return A&&(A.value=A[0].length-1),I||A}function k(D=!0){v(),y(),D&&e.fetchTemplates(Tw).then(()=>{e.getFilteredListWithFields()})}function E(D){const I=e.sectionDataMap;for(const[,A]of I.entries())A.parentQLIs.forEach(w=>{w.id===D.id&&(A.columns.forEach(T=>{if(T.dataType==="CURRENCY"){const P=T.field.replace(/_/g,"");w[P]=S(w[P],D[T.field])}}),D!=null&&D.billingPeriodValue&&(D!=null&&D.formattedBillingPeriodValue)&&(w.formattedBillingPeriodValue=S(w.formattedBillingPeriodValue,D.billingPeriodValue)),D!=null&&D.oneTimeValue&&(D!=null&&D.formattedOneTimeValue)&&(w.formattedOneTimeValue=S(w.formattedOneTimeValue,D.oneTimeValue)))})}function S(D,I){const A=Number(I);if(isNaN(A))return D;const w=D.match(/(\d[\d,]*)(\.\d+)?/);if(!w)return D;const T=w[2]||"",P=T.length?T.length-1:0,X=A.toLocaleString("en-US",{minimumFractionDigits:P,maximumFractionDigits:P});return D.replace(w[1]+T,X)}return{initializeCart:m,loadCartState:k,productCount:r,onetimeTotal:o,monthlyTotal:i,filterCartItem:a,billingPeriodValue:c,hasOneTimeValue:h,hasBillingPeriodInList:s,oneTimeFieldAvailable:l,billingPeriodFieldAvailable:u,priceDecimalPrecision:d,cartItemUpdatingId:p,removingItemLoaderId:f,cartItemColumnsMap:g,getProductCount:v,getQuoteTotal:y,removeItem:b,removeQuoteItem:_,getDecimalPrecisionFromSalesPriceOrNRC:C,updateFormattedValues:E,formateCurrencyValue:S}}),Fw=e=>[{title:"Apply Discount",subOptions:[...e.map(n=>`Apply Discount on ${n} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...e.map(n=>`Apply Discount on ${n} for a specific total`)]},{title:"Update Fields",subOptions:["Update the price of","Update the quantity of","Update the term start date to","Update the term end date to","Update the line description for"]},{title:"Price Ramp",subOptions:["Add a price ramp for"]}],Bw={salesforceUserLocale:"en_US",chatRoomId:"00DA0000000cDUJMA2__0052G00000AHBNAQA5__a0jKb000004VSaMIAW",status:"SUCCESS",statusCode:200,requestId:"9b1d1f0a9f07aa6cdc",errorMessage:"",payload:{uiModification:{addColumn:[],removeColumn:[],filter:[],groupBy:[{sectionName:"MRC $50 and Above",filters:[{datatype:"currency",field:"XX_ORD1__MRC__c",operator:"greater or equal",value:"50"}],tableId:"4vIEgoK5CbSPrLYPbq"},{sectionName:"MRC Below $50",filters:[{datatype:"currency",field:"XX_ORD1__MRC__c",operator:"less than",value:"50"}],tableId:"BlOPCp7eLBCZ84nDT2"}],showOptions:!0}},agentResponse:{role:"agent",requestId:"9b1d1f0a9f07aa6cdc",content:"Grouped the quote items into two sections: one for MRC $50 and above, and another for MRC below $50.",error:!1,epoch:1759936160464,isDML:!1},redirectObjects:{qliId:"",itemId:"",componentName:"QuoteItem"},actionFunction:"Reload",links:[{action:"quoteDocument",label:"Quote Document"},{action:"addProducts",label:"Add Products"}]},Nw=[{label:"Line Description",field:"xx_ord1__line_description__c",isEditable:!0,dataType:"STRING"},{label:"QTY",field:"xx_ord1__qty__c",isEditable:!0,dataType:"DOUBLE"},{label:"Extended Price",field:"xx_ord1__extended_price__c",isEditable:!1,dataType:"CURRENCY"},{label:"Billing Period",field:"xx_ord1__billing_period__c",isEditable:!0,dataType:"PICKLIST",picklistValues:["Monthly","Quarterly","Yearly"]}],xo=Lt("quote",()=>{const e=wn(),n=Mw(),t=Es(),r=G(""),o=G(""),i=G(0),a=G(""),s=G([]),l=G({template:!0,filteredList:!1}),u=G(null),c=G(new Map),h=G({}),d=G(!1),p=G(!0),f=G(!1),g=G({text:"Hide Options",altText:"Show Options",handler:()=>{p.value=!p.value,S()},color:"#136E05",isActive:!1}),m=be(()=>{const U=Array.from(c.value.values()).map(O=>O.sectionName);return Fw(U)});We(a,()=>{l.value.template||E()});function v(){const U=new Map,O=[];for(const[M,N]of c.value.entries())U.set(M,N.selected),O.push(N);const R=JSON.parse(JSON.stringify(O));return R.forEach(M=>{delete M.selected;const N=new Map,H=[];M.lineItems.forEach(L=>{L.Selected=U.get(M.tableId).get(L.id)||!1,L.xx_ord1__parent_qli__c?(N.has(L.xx_ord1__parent_qli__c)||N.set(L.xx_ord1__parent_qli__c,[]),N.get(L.xx_ord1__parent_qli__c).push(L)):H.push(L)}),M.lineItems=H.map(L=>({...L,options:N.get(L.id)||[]})),delete M.loading,delete M.parentQLIs,delete M.totalValues}),{showOptions:p.value,sections:R,templateId:a.value}}async function y(U){try{let O=await window.salesforceConnector.getPrimaryQuote(U);O=yn(O),O!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(O)),r.value=O.recordId,console.info("quoteId",r.value),o.value=O.name,a.value=O==null?void 0:O.templateId,i.value=(O==null?void 0:O.lineItemsCount)||0)}catch(O){e.handleError(O.message),console.info("[ERROR]: getPrimaryQuote() error = ",O)}}async function b(U){var O,R;try{l.value.template=!0;let M=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[U],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));M=yn(M);const N=M==null?void 0:M.templates[U];return a.value||(a.value=(O=N.find(H=>H.XX_ORD1__Default__c))==null?void 0:O.Id),a.value||(a.value=(R=N[0])==null?void 0:R.Id),s.value=N,l.value.template=!1,s.value}catch(M){e.handleError(M.message),console.info("[ERROR]: fetchTemplates() error = ",M)}}function _(U){if(!U)return null;const O=/\{!\$(\w+):([\w.]+)\}/,R=U.match(O);return R?{function:R[1],apiname:R[2].split(".")[1]}:null}async function C(U){try{const O={Id:r.value,XX_ORD1__Document_Template__c:U};return await window.salesforceConnector.updateQuote(JSON.stringify([O]))}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQuote() error = ",O)}}async function k(){try{l.value.filteredList=!0;let U=await window.salesforceConnector.getQuoteEPageLayout();c.value.clear(),n.cartItemColumnsMap={},U=yn(U);const O=U.map(M=>({label:M.fieldLabel,field:M.fieldName.toLowerCase(),isEditable:M.isEditable,dataType:M.dataType,...M.picklistValues?{picklistValues:M.picklistValues}:{}})),R=Kr();return c.value.set(R,{loading:!0,lineItems:[],parentQLIs:[],columns:O,tableId:R,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),n.cartItemColumnsMap[R]=O,g.value.isActive=!1,p.value=!0,u.value={lstCB:[{columns:O,footer:null,title:"All Rows",sectionName:"All Rows",tableId:R,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},S(),l.value.filteredList=!1,U}catch(U){e.handleError(U.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",U)}}async function E(){if(s.value.length===0){k();return}try{l.value.filteredList=!0;let U=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:a.value}));C(a.value),U=yn(U),console.info("res.lstCB = ",U.lstCB);const O=U==null?void 0:U.objectFieldsMap;return c.value.clear(),n.cartItemColumnsMap={},U.lstCB=U.lstCB.map(R=>{const{fields:M,filters:N,primarysort:H,primarysortdesc:L}=JSON.parse(R.XX_ORD1__Block_Properties__c),z=M.map(W=>{var Q;return{label:(Q=O[W.api])==null?void 0:Q.label,field:W.api.toLowerCase(),isEditable:W.api.includes(".")?!1:O[W.api].isEditable,dataType:O[W.api].dataType,...O[W.api].picklistValues?{picklistValues:O[W.api].picklistValues}:{}}}),j=R.Id||Kr();return c.value.set(j,{loading:!0,lineItems:[],parentQLIs:[],columns:z,tableId:j,sectionName:R.Name,selected:new Map,footer:_(R.XX_ORD1__Table_Footer_HTML__c),filters:N,primarysort:H,primarysortdesc:L}),n.cartItemColumnsMap[j]=z,g.value.isActive=!1,p.value=!0,{columns:z,footer:_(R.XX_ORD1__Table_Footer_HTML__c),title:R.Name,sectionName:R.Name,tableId:j,filters:N,primarysort:H,primarysortdesc:L}}),u.value=U,S(),l.value.filteredList=!1,U}catch(U){e.handleError(U.message),console.info("[ERROR]: getFilteredListWithFields() error = ",U)}}async function S(U=!0){const O=[];for(const[R]of c.value)O.push(A(R,U));return await Promise.all(O),n.getProductCount(),!0}function D(U,O){return c.value.get(U).columns.some(R=>R.field.toLowerCase()===O)||n.cartItemColumnsMap[U].some(R=>R.field.toLowerCase()===O)}function I(U,O){let R=za(U);const M=t.pricingSchema,N=D(O,"xx_ord1__nrc__c"),H=D(O,"xx_ord1__sales_price__c"),L=D(O,"xx_ord1__qty__c");return R=R.map(z=>{let j={};M==="nrc/mrc"&&(z!=null&&z.xx_ord1__billing_period__c)?j={...H?{billingPeriodValue:(z==null?void 0:z.xx_ord1__sales_price__c)===0?"0":(z==null?void 0:z.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:z==null?void 0:z.xxord1salespricec}:{},...N?{oneTimeValue:(z==null?void 0:z.xx_ord1__nrc__c)===0?"0":(z==null?void 0:z.xx_ord1__nrc__c)||null,formattedOneTimeValue:z==null?void 0:z.xxord1nrcc}:{}}:M==="nrc/mrc"&&!(z!=null&&z.xx_ord1__billing_period__c)?H&&(j={oneTimeValue:(z==null?void 0:z.xx_ord1__sales_price__c)===0?"0":(z==null?void 0:z.xx_ord1__sales_price__c)||null,formattedOneTimeValue:z==null?void 0:z.xxord1salespricec}):M!=="nrc/mrc"&&(z!=null&&z.xx_ord1__billing_period__c)?H&&(j={billingPeriodValue:(z==null?void 0:z.xx_ord1__sales_price__c)===0?"0":(z==null?void 0:z.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:z==null?void 0:z.xxord1salespricec}):M!=="nrc/mrc"&&!(z!=null&&z.xx_ord1__billing_period__c)&&H&&(j={oneTimeValue:(z==null?void 0:z.xx_ord1__sales_price__c)===0?0:(z==null?void 0:z.xx_ord1__sales_price__c)||null,formattedOneTimeValue:z==null?void 0:z.xxord1salespricec});const{xx_ord1__qty__c:W,xx_ord1__sales_price__c:Q,xx_ord1__nrc__c:ae,...fe}=z,K={...fe,id:z.id,description:(z==null?void 0:z.xx_ord1__line_description__c)||"",xx_ord1__billing_period__c:z==null?void 0:z.xx_ord1__billing_period__c,...L?{xx_ord1__qty__c:W}:{},xx_ord1__item__c:z==null?void 0:z.xx_ord1__item__c,"xx_ord1__item__r.xx_ord1__decimal_precision__c":z["xx_ord1__item__r.xx_ord1__decimal_precision__c"]||"0",...j};return K!=null&&K.billingPeriodValue&&(n.hasBillingPeriodInList[O]=!0,n.billingPeriodValue=K==null?void 0:K.xx_ord1__billing_period__c),"oneTimeValue"in K&&(n.oneTimeFieldAvailable[O]=!0),"billingPeriodValue"in K&&(n.billingPeriodFieldAvailable[O]=!0),(K==null?void 0:K.oneTimeValue)!==""&&(K==null?void 0:K.oneTimeValue)!==null&&(n.hasOneTimeValue=!0),K}),R}async function A(U,O=!0){var R,M;try{const N=c.value.get(U);if(console.info("sectionData = ",N.sectionName),!N)return;N.loading=O,O&&(N.lineItems=[]);const{columns:H,filters:L,primarysort:z,primarysortdesc:j,footer:W}=N,Q=H.map(le=>le.field.toLowerCase());Q.includes("xx_ord1__parent_qli__c")||Q.push("xx_ord1__parent_qli__c"),Q.includes("xx_ord1__item__c")||Q.push("xx_ord1__item__c"),Q.includes("xx_ord1__sys_configuration_status2__c")||Q.push("xx_ord1__sys_configuration_status2__c"),(R=n.cartItemColumnsMap[U])==null||R.forEach(le=>{Q.includes(le.field)||Q.push(le.field)});const ae=await w({fields:Q,recordId:r.value,filters:L||[],primarySortBy:z||"",primarySortOrder:j?"DESC":"ASC",includeOptions:p.value,totalFields:W?[W.apiname]:[]}),fe=ae.lineItems,K=new Map;let V=[];const te=(M=ae.fieldTotals)==null?void 0:M.map(le=>le.totalValue);fe.forEach(le=>{le.XX_ORD1__Parent_QLI__c?K.has(le.XX_ORD1__Parent_QLI__c)?K.get(le.XX_ORD1__Parent_QLI__c).push(le):K.set(le.XX_ORD1__Parent_QLI__c,[le]):V.push(le)});const oe=[];return V.forEach(le=>{oe.push(le),K.has(le.Id)&&oe.push(...K.get(le.Id))}),V=I(V,U),N.lineItems=za(oe),N.parentQLIs=V,N.totalValues=te,N.loading=!1,c.value=new Map(c.value),oe}catch(N){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",N.message);const H=c.value.get(U);H&&(H.loading=!1)}}async function w(U){try{let O=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(U));return O=yn(O),O}catch(O){e.handleError(O.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",O)}}async function T(U){try{console.info("updateQli() payload = ",U);let O=await window.salesforceConnector.updateQli(JSON.stringify(U));return O=yn(O),S(!1),O}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQli() error = ",O)}}async function P(U){try{let O=await window.salesforceConnector.deleteQLI(U);return O=yn(O),S(),O}catch(O){e.handleError(O.message),console.info("[ERROR]: deleteQLI() error = ",O)}}async function X(U,O){try{d.value=!0;const R={fields:U};O&&(R.objectName=O),U.includes("xx_ord1__qty__c")&&O==="xx_ord1__ecatalog_item__c"&&(R.fields=R.fields.filter(N=>N!=="xx_ord1__qty__c")),U.includes("xx_ord1__sales_price__c")&&O!=="xx_ord1__quote_line_item__c"&&(R.fields=R.fields.filter(N=>N!=="xx_ord1__sales_price__c"));let M=await window.salesforceConnector.getFieldsData(JSON.stringify(R));return typeof M=="string"&&(M=JSON.parse(M)),M!=null&&M.errorMessage?(e.handleError(M.errorMessage),null):(h.value={...h.value,...M},console.info("fieldsData.value = ",JSON.stringify(h.value)),M)}catch(R){return e.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",R),null}finally{d.value=!1}}function $(U=""){var O;return!U||U.includes(".")?!1:U.includes("xx_ord1__qty__c")?!0:((O=h.value[U])==null?void 0:O.isEditable)||!1}function J(){ee(Bw)}async function ee(U){var O,R,M,N,H,L,z,j,W;if(U.payload){if((O=U.payload)!=null&&O.uiModification){const Q=U.payload.uiModification;if(((R=Q.addColumn)==null?void 0:R.length)>0)if(Q.addColumn.forEach(ae=>{ae.columns.forEach(fe=>{fe.field=fe.field.toLowerCase()})}),Q.addColumn[0].sectionName==="all_section")for(const[ae,fe]of c.value)fe.columns=[...fe.columns,...Q.addColumn[0].columns];else Q.addColumn.forEach(ae=>{c.value.get(ae.tableId)&&(c.value.get(ae.tableId).columns=[...c.value.get(ae.tableId).columns,...ae.columns])});if(((M=Q.removeColumn)==null?void 0:M.length)>0)if(Q.removeColumn.forEach(ae=>{ae.columns=ae.columns.map(fe=>fe.toLowerCase())}),Q.removeColumn[0].sectionName==="all_section")for(const[ae,fe]of c.value)fe.columns=fe.columns.filter(K=>!Q.removeColumn[0].columns.includes(K.field));else Q.removeColumn.forEach(ae=>{c.value.get(ae.tableId)&&(c.value.get(ae.tableId).columns=c.value.get(ae.tableId).columns.filter(fe=>!ae.columns.includes(fe.field)))});if(((N=Q.filter)==null?void 0:N.length)>0)if(Q.filter[0].sectionName==="all_section")for(const[ae,fe]of c.value)fe.filters=[...fe.filters,...Q.filter[0].filters];else Q.filter.forEach(ae=>{c.value.get(ae.tableId)&&(c.value.get(ae.tableId).filters=[...c.value.get(ae.tableId).filters,...ae.filters])});if(((H=Q.groupBy)==null?void 0:H.length)>0){const ae=((L=[...c.value.values()][0])==null?void 0:L.columns)||Nw;c.value.clear(),n.cartItemColumnsMap={},Q.groupBy.forEach(fe=>{n.cartItemColumnsMap[fe.tableId]=fe.columns||ae,c.value.set(fe.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:fe.columns||ae,tableId:fe.tableId,sectionName:fe.sectionName,selected:new Map,footer:_(fe.footer),filters:fe.filters,primarysort:fe.primarysort,primarysortdesc:fe.primarysortdesc})})}Q.showOptions!==void 0&&(p.value=Q.showOptions)}if(((j=(z=U.payload)==null?void 0:z.sections)==null?void 0:j.length)>0){const Q=(W=U.payload)==null?void 0:W.sections;c.value.clear(),Q.forEach(ae=>{ae.tableId||(ae.tableId=Kr()),ae.selected=new Map,c.value.set(ae.tableId,ae)}),S()}}U.actionFunction==="Reload"&&(console.log("Reloading configurator 3"),S(),console.info("Reloading quote line items"))}async function Y(U){var O,R;try{const M=new Set;for(const N of c.value.keys())(O=c.value.get(N).lineItems)==null||O.forEach(L=>{L.attributes=null,M.add(L.id)});if(U){const N={lineItemIds:[...M]},H=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(N)}),L=JSON.parse(H.data);for(const z of c.value.keys())(R=c.value.get(z).lineItems)==null||R.forEach(W=>{W.attributes=L[W.id]||null})}}catch(M){console.info("[ERROR]: fetchAttributesData() error = ",M)}}return{showAttributes:f,quoteId:r,quoteName:o,templateId:a,templateOptions:s,loading:l,currentTemplateData:u,fieldsData:h,fieldsDataLoading:d,showOptionHeaderButton:g,sectionDataMap:c,promptSuggestions:m,lineItemsCount:i,addColumns:J,getQuoteEPageLayout:k,getPayload:v,getPrimaryQuote:y,fetchTemplates:b,getFilteredListWithFields:E,getQuoteLineItemsWithFilteredTable:w,updateQli:T,getFieldsData:X,deleteQLI:P,performAIAction:ee,isEditableField:$,fetchQuoteLineItems:A,fetchAllQuoteLineItems:S,fetchAttributesData:Y}}),Es=Lt("comRoot",()=>{const e=Co(),n=wn(),t=xo(),r=G(""),o=G(""),i=G("Genesis AI"),a=G(""),s=G({}),l=G(""),u=G(""),c=G(""),h=G(""),d=G({}),p=G(""),f=G(""),g=G(""),m=G(""),v=G(""),y=G(""),b=G(""),_=G("Single"),C=G("closed"),k=be(()=>t.quoteName),E=be(()=>_.value==="Single");async function S(w){r.value=w||Gl("id"),o.value=Gl("origin"),await I(),await D()}async function D(){try{console.info("getRecordInfo",r.value);let w=await window.salesforceConnector.getRecordInfo(r.value);return w=yn(w),w!==void 0&&(d.value=w,p.value=w.name,f.value=w.objectType,g.value=w.accountId,m.value=w.eCatalogId,v.value=w.currencyCode,y.value=w.userLocale,b.value=w.opportunityId),(w==null?void 0:w.objectType)==="XX_ORD1__Quote__c"?(t.quoteId=w==null?void 0:w.recordId,t.templateId=w==null?void 0:w.templateId,t.quoteName=w==null?void 0:w.name,t.lineItemsCount=(w==null?void 0:w.lineItemsCount)||0):(w==null?void 0:w.objectType)==="Opportunity"&&await t.getPrimaryQuote(w.recordId),w}catch(w){n.handleError(w.message)}}async function I(){var T,P;console.info("getOrgInformation",r.value);const w=await window.salesforceConnector.getOrgInformation();e.websocketUrl=w.websocketUrl,a.value=(T=w.locale)==null?void 0:T.replace("_","-"),s.value=w.user,l.value=w.orgName,u.value=w.orgId,c.value=w.orgType,h.value=w.packageVersion,_.value=(P=w==null?void 0:w.pricingSchema)==null?void 0:P.toLowerCase()}function A(w){i.value=w,H3(w)}return{id:r,origin:o,title:k,subTitle:i,locale:a,user:s,orgName:l,orgId:u,orgType:c,packageVersion:h,objectType:f,recordInfo:d,name:p,accountId:g,eCatalogId:m,currencyCode:v,userLocale:y,opportunityId:b,pricingSchema:_,isSinglePricingSchema:E,flyoutState:C,start:S,getRecordInfo:D,setSubTitle:A}}),Lw=Lt("quickSelection",()=>{const e=wn(),n=Es(),t=xo(),r=G(null),o=G(!1),i=G([]),a=G([]),s=G(!1),l=G({}),u=G({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),c=G(!1);async function h(){o.value=!0;try{const C=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...n.objectType?{contextObject:n.objectType}:{}});let k={};k=await window.salesforceConnector.getDynamicPageLayout(C),r.value=kf(k,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",r.value),u.value.rowLimit=r.value.configuration.rowLimit||10,r.value.data.columns.forEach(E=>{!E.field&&E.label==="QTY"&&(E.field="xx_ord1__qty__c")}),o.value=!1}catch(C){o.value=!1,e.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",C)}}function d(){const C=new Map;return r.value.data.columns.forEach(k=>{C.set(k.field,!0)}),r.value.data.searchResultColumns.forEach(k=>{C.set(k.field,!0)}),Array.from(C.keys())}async function p(C){var k,E;try{let S=await window.salesforceConnector.saveCompetitorSKU(C);if(S!=null&&S.errorMessage){e.handleError(S.errorMessage);return}if((k=S[0])!=null&&k.errorMessage){e.handleError((E=S[0])==null?void 0:E.errorMessage);return}return S}catch(S){e.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",S)}}async function f(C="",k=[]){try{let E=r.value.data,S=r.value.configuration;const D=C.trim();if(console.info("searchTextValue.trim() = ",C.trim()),!D)return[];let I=null;console.info("useMappings = ",c.value),c.value?I=Ow(g()):I=g(),console.info("fields before filter = ",I),I=I.filter(P=>P!=="xx_ord1__qty__c"),console.info("fields after filter = ",I);const A={fields:I,...k.length?{dynamicFilters:t.getDynamicFilters(k)}:{},searchText:D,accountId:n.accountId,...n.eCatalogId?{catalogId:n.eCatalogId}:{},...n.objectType==="opportunity"?{opportunityId:n.id}:{},...E!=null&&E.sort?{primarySortBy:E.sort.primary.field,primarySortOrder:E.sort.primary.direction,secondarySortBy:E.sort.secondary.field,secondarySortOrder:E.sort.secondary.direction}:{},rowLimt:(S==null?void 0:S.rowLimit)||20,paging:(S==null?void 0:S.paging)||!1,...u.value.offset!==0?{offset:u.value.offset}:{},objectName:E.objectName,currencyCode:n.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(A));const w=await window.salesforceConnector.getItems(JSON.stringify(A));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(w)),w!=null&&w.errorMessage){e.handleError(w.errorMessage);return}return w!=null&&w.itemCount&&(u.value.totalPages=Math.ceil((w==null?void 0:w.itemCount)/u.value.rowLimit)),za(w.lstItems,{xx_ord1__qty__c:"1"})}catch(E){e.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",E)}}function g(){let C=[];for(const k of r.value.data.columns){let E=k.field;if(E!=null&&E.includes(".")){C.includes(E)||C.push(E);let D=E.split(".")[0];D=D.slice(0,-1)+"c",C.includes(D)||C.push(D)}else C.includes(E)||C.push(E)}return console.info("getAllQuickSelectionFields() fields = ",C),C.filter(k=>k.toLowerCase()!=="xx_ord1__qty__c")}async function m(C,k,E,S){console.info("searchText:",JSON.stringify(C)),console.info("row:",JSON.stringify(k)),console.info("rowIndex:",JSON.stringify(E)),console.info("column:",JSON.stringify(S));const D=E+(u.value.currentPage-1)*u.value.rowLimit;if(S.field.toLowerCase().includes("xx_ord1__item__r")){if(i.value[D].itemLookupLoading=!0,c.value=!0,a.value=await f(C),a.value.length>0){const I=[];for(let A=0;A<a.value.length;A++)i.value[D].itemDataRetrieved=!0,a.value[A].xx_ord1__item__c&&I.push({name:a.value[A]["xx_ord1__item__r.name"],value:a.value[A].xx_ord1__item__c,label:a.value[A][S.field.toLowerCase()]});i.value[D][S.field.toLowerCase()+"_options"]=I}i.value[D].itemLookupLoading=!1}else if(S.field.toLowerCase().includes("xx_ord1__competitor_item__r")){i.value[D].competitorLookupLoading=!0;const I=await v(C);I!=null&&I.items&&(i.value[D][S.field.toLowerCase()+"_options"]=I.items.map(A=>({name:A.fields[2].value,value:A.fields[1].value,label:A.fields[0].value}))),i.value[D].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",I)}}async function v(C){var E,S;console.info("getLookupData() searchText = ",C);const k={searchText:C,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let D=await window.salesforceConnector.getLookupData(JSON.stringify(k));if(typeof D=="string"&&(D=JSON.parse(D)),D!=null&&D.errorMessage){e.handleError(D.errorMessage);return}if((E=D[0])!=null&&E.errorMessage){e.handleError((S=D[0])==null?void 0:S.errorMessage);return}return D}catch(D){e.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",D)}}async function y(C,k){var S;console.info("Update Other Fields Value = ",C),console.info("Update Other Fields Row Index = ",k);const E=k+(u.value.currentPage-1)*u.value.rowLimit;console.info("actualRowIndex = ",E);try{if(C){const D=a.value.filter(I=>I.xx_ord1__item__c===C)[0];if(D){s.value=!0;const I=r.value.data.columns[1].field;i.value[E][I]&&await b(D,E),(S=i.value[E])!=null&&S.itemDataRetrieved&&(i.value[E].status="New Match Requested",i.value[E].noMatchCleared=!0),Object.keys(D).forEach(A=>{const w=Z2[A.toLowerCase()];console.info("Mapped Key = ",w),w&&(i.value[E][w]=D[A])}),s.value=!1}else i.value[E].status=""}else i.value[E].status="No Match"}catch(D){e.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",D)}}async function b(C,k){const E=i.value[k],S=r.value.data.columns[1].field,D=[{sku:E[S],name:E[S],productDescription:E.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:C.xx_ord1__item__c}];let I=await p(JSON.stringify(D));console.info("Match Item: ",JSON.stringify(I)),i.value[k][`${S}_options`]=[{value:I[0].competitorItemId,label:I[0].sku}],i.value[k][S]=I[0].competitorItemId}async function _(C){try{let k=await window.salesforceConnector.createQLI(JSON.stringify(C));typeof k=="string"&&(k=JSON.parse(k));let E=!1;if((k==null?void 0:k.length)>0)for(let S=0;S<k.length;S++)k[S].errorMessage&&(E=!0,k[S].errorMessage.includes("Line Description: data value too large")&&(k[S].errorMessage="Error: The description is too long—it must be under 200 characters."));if(E){k.forEach(S=>{l.value[S.eCatalogItemId]=S});return}else l.value=[];return k}catch(k){e.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",k)}}return{quickSelectionLayout:r,quickSelectionLayoutLoading:o,processedRecords:i,useMappings:c,currentSearchData:a,createQliErrors:l,getQuickSelectionLayout:h,getAllFieldsForQuickSelectionLayout:d,saveCompetitorSKU:p,getQuickSelectionItems:f,searchLookupHandler:m,updateOtherFields:y,addAllItemsToQuote:_}});function Pw(e,n,t){const r=[];return e.templateId||r.push("AI_GUIDANCE_MISSING_TEMPLATE_ID"),e.composablesOrgType||r.push("AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE"),e.websocketUrl||r.push("AI_GUIDANCE_MISSING_WEBSOCKET_URL"),e.packageVersion||r.push("AI_GUIDANCE_MISSING_PACKAGE_VERSION"),t!=null&&t.accessToken||r.push("AI_GUIDANCE_MISSING_SECURITY_TOKEN"),n!=null&&n.organizationId||r.push("AI_GUIDANCE_MISSING_IDENTITY_ORG_ID"),n!=null&&n.userId||r.push("AI_GUIDANCE_MISSING_IDENTITY_USER_ID"),n!=null&&n.accountId||r.push("AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID"),r}function eh(e){return e?!e.startsWith("ws://")&&!e.startsWith("wss://")?"WEBSOCKET_INVALID_URL_FORMAT":null:"WEBSOCKET_MISSING_URL"}function qw(e){var n,t,r,o,i,a;if(!e)return{playbookId:null,error:null};try{const s=(r=(t=(n=e==null?void 0:e[0])==null?void 0:n.blocks)==null?void 0:t[0])==null?void 0:r.playbookId,l=((i=(o=e==null?void 0:e.blocks)==null?void 0:o[0])==null?void 0:i.playbookId)||((a=e==null?void 0:e[0])==null?void 0:a.playbookId);return{playbookId:s||l||null,error:null}}catch(s){return console.error("[validation] Error validating block structure:",s),{playbookId:null,error:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID"}}}function $w(e,n){const t=[];e!=null&&e.currentPlaybook||t.push("COMPONENT_LOADER_MISSING_PLAYBOOK");const r=n;return r&&r!=="catalog"&&r!=="cart"&&r!=="configurator"&&r!==""&&t.push("COMPONENT_LOADER_INVALID_COMPONENT_KEY"),t}const qi="Preparing Your Quote Please Wait...",vc={message:"Your quote is ready! Click 'Add Products' to browse Products, or enter a prompt and AI will do the work for you.",type:"response",requestId:"no-request-id"},Uw=18e4,jw=2e3,Hw={bgColor:"#EDF8EB",textColor:"#5F5F5F"};function Vw({minDisplayMs:e=2e3}={}){const n=[];let t=null,r=!1,o=null,i=null,a=null;const s=new Set;function l(){const y={isActive:r,currentMessage:o?o.message:null,queuedCount:n.length};s.forEach(b=>{try{b(y)}catch{}})}function u(){t||(t=setInterval(h,100))}function c(){t&&(clearInterval(t),t=null)}function h(){if(r){if(!o&&n.length>0){o={...n.shift(),shownAt:Date.now()},l();return}if(o&&Date.now()-o.shownAt>=o.minDisplayMs){if(n.length>0)o={...n.shift(),shownAt:Date.now()},l();else if(o=null,r=!1,c(),l(),i&&a){const b=i,_=a;i=null,a=null;try{_(b)}catch{}}}}}function d(y,b={}){return n.push({message:y,minDisplayMs:b.minDisplayMs||e}),r||(r=!0,u(),l()),n.length}function p(y,b){if(i=y,typeof b=="function"&&(a=b),r)u();else{const _=a,C=i;if(i=null,a=null,_)try{_(C)}catch{}}}function f(y){return typeof y!="function"?()=>{}:(s.add(y),y({isActive:r,currentMessage:o?o.message:null,queuedCount:n.length}),()=>s.delete(y))}function g(){return o?o.message:null}function m(){return r}function v(){n.length=0,o=null,r=!1,i=null,a=null,c(),l()}return{getCurrentMessage:g,getIsActive:m,subscribe:f,enqueue:d,setSuccess:p,clear:v}}const Co=Lt("ai",()=>{const e=Es(),n=xo();Y2(),Lw();const t=In(),r=mc(),o=Ht(),i=Ho();(()=>{try{return P3()}catch{return{path:""}}})();const a=G(""),s=G([]),l=G(""),u=G([]),c=G(!1),h=G(null),d=G({}),p=G(null),f=G(null),g=G(null),m=G(null),v=G(!1),y=G(!0),b=G(null),_=G(!1),C=G(null),k=G(qi),E=Vw({minDisplayMs:jw});E.subscribe(({isActive:re,currentMessage:ue})=>{re&&(k.value=ue||qi)});const S=G([]),D=be(()=>Hw),I=()=>{var Ie,ie,ye;const ue=(ye=(ie=(((Ie=i.currentPlaybook)==null?void 0:Ie.playBookSteps)||[])[0])==null?void 0:ie.uiSpecs)==null?void 0:ye.customText;return{message:typeof ue=="string"&&ue.trim().length>0?ue:vc==null?void 0:vc.message,type:"response"}},A=G(Kr()),w=be(()=>{const re=o.organizationId.value,ue=o.userId.value,Ce=o.cid.value||A.value;return`${re}_${ue}_${Ce}`}),T=be(()=>h.value.readyState==WebSocket.OPEN),P=be(()=>o.websocketUrl.value||""),X=()=>{d.value={salesforceOrgId:o.organizationId.value,salesforceOrgType:o.composablesOrgType.value,salesforceUserId:o.userId.value,userType:"Salesforce",chatRoomId:w.value,chatId:null,requestId:"",prompt:"",initiatedFrom:e.origin||"Quote",internalCall:!1,contextObjectId:o.quoteId.value,contextObjectType:"Quote",payload:{lineItemsCount:n.lineItemsCount},origin:"DXP",defaultBatchSize:10,actionType:"",packageVersion:o.packageVersion.value,relatedIds:{accountId:o.accountId.value,eCatalogId:o.eCatalogId.value||"",contactId:o.cid.value||""}}},$=(re,ue={})=>{y.value&&rn("websocket:error",{errorCode:re,isInitialization:!0,...ue})};async function J(){const re=eh(P.value);if(re)throw $(re,{url:P.value}),new Error("WebSocket URL validation failed");y.value=!0;const ue=1e4;b.value=setTimeout(()=>{if(h.value&&h.value.readyState!==WebSocket.OPEN&&($("WEBSOCKET_CONNECTION_TIMEOUT"),h.value))try{h.value.close()}catch{}},ue);let Ce=!1;return new Promise((ie,ye)=>{var je,Ke,Xe,Ye;const Ee=(He,ct)=>{Ce||(Ce=!0,He?ye(He):ie(ct))},se=()=>{ee(),Ee(null)},ge=He=>{Y(He),Ce||Ee(new Error("WebSocket closed before open"))},Ae=He=>{U(He),Ce||Ee((He==null?void 0:He.error)||new Error("WebSocket error"))};try{const He=P.value+"?chatRoomId="+w.value;h.value=new WebSocket(He),h.value.addEventListener("open",se),h.value.addEventListener("message",O),h.value.addEventListener("close",ge),h.value.addEventListener("error",Ae)}catch(He){b.value&&(clearTimeout(b.value),b.value=null),(je=He.message)!=null&&je.includes("network")||(Ke=He.message)!=null&&Ke.includes("Network")?$("WEBSOCKET_NETWORK_ERROR",{error:He.message}):(Xe=He.message)!=null&&Xe.includes("CORS")||(Ye=He.message)!=null&&Ye.includes("cors")?$("WEBSOCKET_CORS_ERROR",{error:He.message}):$("WEBSOCKET_CONNECTION_FAILED",{error:He.message}),Ee(He)}})}const ee=()=>{b.value&&(clearTimeout(b.value),b.value=null),y.value=!1,N(),z()},Y=re=>{if(b.value&&(clearTimeout(b.value),b.value=null),y.value){const ue=(re==null?void 0:re.code)??1006,Ce=(re==null?void 0:re.reason)??"";switch(ue){case 1e3:break;case 1001:case 1002:case 1003:case 1013:case 1014:$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:ue,closeReason:Ce});break;case 1006:$("WEBSOCKET_ABNORMAL_CLOSURE",{closeCode:ue,closeReason:Ce});break;case 1011:$("WEBSOCKET_SERVER_ERROR",{closeCode:ue,closeReason:Ce});break;case 1012:$("WEBSOCKET_SERVICE_RESTART",{closeCode:ue,closeReason:Ce});break;case 1015:$("WEBSOCKET_SSL_ERROR",{closeCode:ue,closeReason:Ce});break;default:ue!==1e3&&$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:ue,closeReason:Ce})}}y.value=!1,_.value=!1,H()},U=re=>{var ue;if(b.value&&(clearTimeout(b.value),b.value=null),y.value){let Ce="WEBSOCKET_CONNECTION_FAILED";const Ie=(re==null?void 0:re.message)||((ue=re==null?void 0:re.error)==null?void 0:ue.message)||"Unknown websocket error";Ie.includes("network")||Ie.includes("Network")||Ie.includes("Failed to fetch")?Ce="WEBSOCKET_NETWORK_ERROR":Ie.includes("CORS")||Ie.includes("cors")?Ce="WEBSOCKET_CORS_ERROR":Ie.includes("SSL")||Ie.includes("TLS")||Ie.includes("certificate")?Ce="WEBSOCKET_SSL_ERROR":Ie.includes("refused")||Ie.includes("ECONNREFUSED")?Ce="WEBSOCKET_CONNECTION_REFUSED":(Ie.includes("auth")||Ie.includes("unauthorized")||Ie.includes("401"))&&(Ce="WEBSOCKET_AUTHENTICATION_FAILED"),$(Ce,{error:Ie})}_.value=!1,te(),H()},O=re=>{var Ie,ie,ye,Ee;N();const ue=JSON.parse(re.data);ue!=null&&ue.chatId&&(d.value.chatId=ue.chatId);const Ce=(ue==null?void 0:ue.contextObjectId)??((Ie=ue==null?void 0:ue.payload)==null?void 0:Ie.contextObjectId);if(Ce){const se=d.value.contextObjectId||((ie=o.quoteId)==null?void 0:ie.value)||"",ge=Ce;ge&&ge!==se&&(d.value.contextObjectId=ge,o.updateConfig({quoteId:ge}),rn("quote-id:updated",{quoteId:ge}))}if(M(ue),ue.status!=="ALIVE"){if((ue==null?void 0:ue.status)==="IN_PROGRESS"||(ue==null?void 0:ue.loading)===!0){const se=(ue==null?void 0:ue.message)||(ue==null?void 0:ue.statusMessage)||(ue==null?void 0:ue.stepName)||qi;E.enqueue(se),k.value=E.getCurrentMessage()||se;return}if((ue==null?void 0:ue.status)==="SUCCESS"){const se=(ue==null?void 0:ue.message)||qi;k.value=E.getCurrentMessage()||se,E.setSuccess(ue,ge=>{R(ge)});return}Array.isArray(ue.messages)?(k.value=null,_.value=!1,s.value.push(I()),ue.messages.length>0&&fe(ue.messages)):ue.agentResponse&&(ue.errorMessage&&(ue.agentResponse.content=ue.errorMessage,ue.agentResponse.error=!0),k.value=null,s.value.push({message:ue.agentResponse.content,type:ue.agentResponse.role,requestId:ue.requestId,epoch:ue.agentResponse.epoch,error:ue.agentResponse.error,isDML:ue.agentResponse.isDML,...(ye=ue.agentResponse)!=null&&ye.filesData?{filesData:(Ee=ue.agentResponse)==null?void 0:Ee.filesData}:{}})),S.value=ue.links||[],ne(ue)}};function R(re,ue={}){var ie,ye,Ee,se;const{skipComponentLoad:Ce=!1}=ue||{},Ie=(re==null?void 0:re.contextObjectId)??((ie=re==null?void 0:re.payload)==null?void 0:ie.contextObjectId);if(Ie){const ge=d.value.contextObjectId||((ye=o.quoteId)==null?void 0:ye.value)||"",Ae=Ie;Ae&&Ae!==ge&&(console.info("[ai] Updating quoteId from contextObjectId (SUCCESS):",{current:ge,new:Ae}),d.value.contextObjectId=Ae,o.updateConfig({quoteId:Ae}),console.info("[ai] Emitting quote-id:updated event with quoteId (SUCCESS):",Ae),rn("quote-id:updated",{quoteId:Ae}))}if(re!=null&&re.loading){k.value=re.message;return}else Array.isArray(re==null?void 0:re.messages)?(k.value=null,_.value=!1,s.value.push(I()),re.messages.length>0&&fe(re.messages)):re!=null&&re.agentResponse?(re.errorMessage&&(re.agentResponse.content=re.errorMessage,re.agentResponse.error=!0),k.value=null,s.value.push({message:re.agentResponse.content,type:re.agentResponse.role,requestId:re.requestId,epoch:re.agentResponse.epoch,error:re.agentResponse.error,isDML:re.agentResponse.isDML,...(Ee=re.agentResponse)!=null&&Ee.filesData?{filesData:(se=re.agentResponse)==null?void 0:se.filesData}:{}})):k.value=null;S.value=(re==null?void 0:re.links)||[];try{rn("ai-response:success",re)}catch{}Ce||ne(re)}const M=re=>{const ue=re==null?void 0:re.eventType,Ce=(re==null?void 0:re.loading)===!0||ue==="ResponseTextDeltaEvent",Ie=ue==="ResponseTextDoneEvent"||Array.isArray(re==null?void 0:re.messages)||!!(re!=null&&re.agentResponse);if(Ce&&!Ie){v.value=!0;return}Ie&&(v.value=!1)},N=()=>{H(),p.value=setTimeout(()=>{if(T.value){const re={action:"heartbeat"};h.value.send(JSON.stringify(re)),N()}},Uw)},H=()=>{p.value&&(clearInterval(p.value),p.value=null)};function L(re){const ue={...d.value};ue.requestType="Action",ue.actionType="Undo",ue.undoRequestId=re,ue.requestId=Kr(),ae(ue)}function z(){_.value=!0;const re={...d.value};re.requestType="Action",re.actionType="History",re.requestId=Kr(),ae(re)}function j(re){return console.info("[ai] isUnsavedChanges check",{activeKey:((i==null?void 0:i.activeComponentKey)||"").toLowerCase(),isChangedConfiguration:t.isChangedConfiguration}),((i==null?void 0:i.activeComponentKey)||"").toLowerCase()==="configurator"&&t.isChangedConfiguration&&console.warn("[ai] Unsaved configurator changes detected; not blocking send"),!1}function W(re,ue=!0,Ce=null){if(console.info("[ai] sendMessage",{messageLength:(re||"").length,hasCustomPayload:!!Ce,addMessageToHistory:ue}),j()){console.warn("[ai] sendMessage aborted: unsaved changes detected");return}if(re.trim()){let Ie={...d.value};Ie.prompt=re.trim(),Ie.requestType="Chat",Ie.requestId=Kr(),Ie.internalCall=!1,Ie.payload=K(),console.log("[ai] _payload.payload",Ie.payload),Ie.componentName=V.value,Ie.templateId=n.templateId,Ie.payload.lineItemsCount=n.lineItemsCount,Ie.relatedIds.eCatalogId=o.eCatalogId.value||"",Ce&&(Ie={...Ie,...Ce}),oe(),ue&&s.value.push({message:re.trim(),type:"user",...C.value&&{fileData:[C.value]},requestId:Ie.requestId}),console.info("[ai] sending prompt",{requestId:Ie.requestId,requestType:Ie.requestType,componentName:Ie.componentName}),ae(Ie),N()}}const Q=be(()=>{var Ce,Ie,ie;const re=((Ce=i.currentPlaybook)==null?void 0:Ce.pbUniqueId)??((Ie=i.currentPlaybook)==null?void 0:Ie.vUniqueId)??null,ue=i.currentStepName??((ie=i.currentStep)==null?void 0:ie.stepName)??null;return{pbUniqueId:re,stepName:ue}});function ae(re){const ue={...re},{pbUniqueId:Ce,stepName:Ie}=Q.value||{};console.log("[ai] activePlaybookContext",Q.value),Ce&&(ue.pbUniqueId=Ce),Ie&&(ue.stepName=Ie);const ie={action:"prompt",data:ue};h.value.send(JSON.stringify(ie))}const fe=re=>{const ue=re.filter(({content:Ce})=>!!Ce).map(Ce=>({message:Ce.content,type:Ce.role,requestId:Ce.requestId,epoch:Ce.epoch,isDML:Ce.isDML,undone:Ce.undone}));ue.forEach((Ce,Ie)=>{Ce.isDML===!0&&Ie!==ue.length-1&&(Ce.isDML=!1)}),s.value=[...s.value,...ue]};function K(){const re=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return console.info("[ai] getRequestBody activeKey",re),re==="cart"||re==="quote_item"?(console.info("[ai] getRequestBody → using quoteStore.getPayload()"),n.getPayload()):re==="configurator"?r.getPayload():(console.info("[ai] getRequestBody → empty {}"),{})}const V=be(()=>{const re=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return re==="cart"||re==="quote_item"?"QuoteItem":""}),te=()=>{s.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},oe=()=>{s.value=s.value.map(re=>({...re,links:[]}))};function le(re){var ue,Ce,Ie;try{const ie=re==null?void 0:re.stepName;if(!ie)return!1;const ye=Ye=>String(Ye||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),Ee=((ue=i.currentPlaybook)==null?void 0:ue.playBookSteps)||[],se=Ee.find(Ye=>Ye.stepName===ie||Ye.name===ie)||null,Ae=ye(se==null?void 0:se.stepComponent)==="configurator"||ye(ie).includes("configure"),je=!!((Ce=re==null?void 0:re.payload)!=null&&Ce.productConfiguration&&Array.isArray(re.payload.productConfiguration)&&re.payload.productConfiguration.length===0),Xe=ye(i.currentStep&&i.currentStep.stepComponent||((Ie=Ee.find(Ye=>Ye.stepName===(i.currentStepName||"")))==null?void 0:Ie.stepComponent)||i.activeComponentKey)==="configurator";return Ae&&je&&Xe}catch{return!1}}function ne(re){var Ie,ie,ye,Ee;const ue=(re==null?void 0:re.contextObjectId)??((Ie=re==null?void 0:re.payload)==null?void 0:Ie.contextObjectId);if(ue){const se=ue,ge=d.value.contextObjectId||((ie=o.quoteId)==null?void 0:ie.value)||"";se&&se!==ge&&(d.value.contextObjectId=se,o.updateConfig({quoteId:se}),rn("quote-id:updated",{quoteId:se}))}const Ce=re==null?void 0:re.stepName;if(Ce){if(Ce==="AI Guidance"||Ce==="ai_guidance"||Ce.toLowerCase()==="ai guidance"){console.info("[ai] Skipping navigation for AI Guidance step - side panel will remain in current state");return}if(le(re)){console.info("[ai] Skipping configurator update: empty productConfiguration and configurator already active"),(re==null?void 0:re.actionFunction)==="Reload"&&(console.log("Reloading configurator 2"),r.refresh());return}try{i.navigateToStep({stepName:Ce,data:re})}catch(se){console.info("navigateToStep failed, falling back to legacy component routing",se)}return}else{if(i.currentStepName||i.currentStep&&i.currentStep.stepName||null)return;(Ee=(ye=i.currentPlaybook)==null?void 0:ye.playBookSteps)!=null&&Ee.length&&i.navigateToStep({stepName:i.currentPlaybook.playBookSteps[0].stepName});return}}function de(){if(T.value){const re={action:"cancel",data:{requestId:d.value.requestId,chatRoomId:w.value}};h.value.send(JSON.stringify(re))}}function ve(){try{if(b.value&&(clearTimeout(b.value),b.value=null),y.value=!1,h.value){try{h.value.removeEventListener("open",ee)}catch{}try{h.value.removeEventListener("message",O)}catch{}try{h.value.removeEventListener("close",Y)}catch{}try{h.value.removeEventListener("error",U)}catch{}try{h.value.close()}catch{}h.value=null}}finally{ce()}}function xe(){try{E.clear()}catch{}a.value="",s.value=[],l.value="",u.value=[],c.value=!1,S.value=[],C.value=null,v.value=!1,m.value=null,k.value=qi,d.value={},H(),ce()}const ce=()=>{f.value&&(clearInterval(f.value),f.value=null),p.value&&(clearInterval(p.value),p.value=null),g.value&&(clearTimeout(g.value),g.value=null)};return tr(()=>{ce()}),{unsavedChanges:m,loadingMessage:k,promptMessage:a,buttonLinks:S,websocketUrl:P,chatHistory:s,latestDMLRequest:l,strikethroughHistory:u,attachmentData:C,dataManuallyChanged:c,isThinkingMessage:v,isFetchingHistory:_,chatStyles:D,undoAction:L,connectSocket:J,sendMessage:W,setInitialPayload:X,cancelRequest:de,disconnectSocket:ve,resetState:xe}}),zw={AI_GUIDANCE_MISSING_TEMPLATE_ID:{code:"AI_GUIDANCE_MISSING_TEMPLATE_ID",message:"Template ID is required for AI Guidance to initialize",component:"aiGuidance"},AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE:{code:"AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE",message:"Composables organization type is required",component:"aiGuidance"},AI_GUIDANCE_MISSING_WEBSOCKET_URL:{code:"AI_GUIDANCE_MISSING_WEBSOCKET_URL",message:"WebSocket URL is required for AI Guidance to connect",component:"aiGuidance"},AI_GUIDANCE_MISSING_PACKAGE_VERSION:{code:"AI_GUIDANCE_MISSING_PACKAGE_VERSION",message:"Package version is required",component:"aiGuidance"},AI_GUIDANCE_MISSING_SECURITY_TOKEN:{code:"AI_GUIDANCE_MISSING_SECURITY_TOKEN",message:"Security access token is required for authentication",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_ORG_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_ORG_ID",message:"Organization ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_USER_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_USER_ID",message:"User ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID",message:"Account ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED:{code:"AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED",message:"Failed to fetch playbook information from quote",component:"aiGuidance"},AI_GUIDANCE_PLAYBOOK_FETCH_FAILED:{code:"AI_GUIDANCE_PLAYBOOK_FETCH_FAILED",message:"Failed to fetch playbook data",component:"aiGuidance"},AI_GUIDANCE_CATALOG_FETCH_FAILED:{code:"AI_GUIDANCE_CATALOG_FETCH_FAILED",message:"Failed to fetch catalog in context",component:"aiGuidance"},AI_GUIDANCE_BLOCK_FETCH_FAILED:{code:"AI_GUIDANCE_BLOCK_FETCH_FAILED",message:"Failed to fetch block information from template",component:"aiGuidance"},AI_GUIDANCE_BLOCK_STRUCTURE_INVALID:{code:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID",message:"Invalid block structure - unable to parse blocks data",component:"aiGuidance"},AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING:{code:"AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING",message:"Playbook ID not found in block structure",component:"aiGuidance"},AI_GUIDANCE_JSON_PARSE_ERROR:{code:"AI_GUIDANCE_JSON_PARSE_ERROR",message:"Failed to parse JSON data from server",component:"aiGuidance"},WEBSOCKET_MISSING_URL:{code:"WEBSOCKET_MISSING_URL",message:"WebSocket URL is missing or empty",component:"aiGuidance"},WEBSOCKET_INVALID_URL_FORMAT:{code:"WEBSOCKET_INVALID_URL_FORMAT",message:"WebSocket URL must start with ws:// or wss://",component:"aiGuidance"},WEBSOCKET_CONNECTION_TIMEOUT:{code:"WEBSOCKET_CONNECTION_TIMEOUT",message:"WebSocket connection timed out during initialization",component:"aiGuidance"},WEBSOCKET_CONNECTION_REFUSED:{code:"WEBSOCKET_CONNECTION_REFUSED",message:"WebSocket connection was refused by the server",component:"aiGuidance"},WEBSOCKET_NETWORK_ERROR:{code:"WEBSOCKET_NETWORK_ERROR",message:"Network error occurred while connecting to WebSocket",component:"aiGuidance"},WEBSOCKET_AUTHENTICATION_FAILED:{code:"WEBSOCKET_AUTHENTICATION_FAILED",message:"WebSocket authentication failed",component:"aiGuidance"},WEBSOCKET_UNEXPECTED_CLOSE:{code:"WEBSOCKET_UNEXPECTED_CLOSE",message:"WebSocket connection closed unexpectedly during initialization",component:"aiGuidance"},WEBSOCKET_ABNORMAL_CLOSURE:{code:"WEBSOCKET_ABNORMAL_CLOSURE",message:"WebSocket connection closed abnormally (no close frame received)",component:"aiGuidance"},WEBSOCKET_SERVER_ERROR:{code:"WEBSOCKET_SERVER_ERROR",message:"WebSocket server error occurred during connection",component:"aiGuidance"},WEBSOCKET_SERVICE_RESTART:{code:"WEBSOCKET_SERVICE_RESTART",message:"WebSocket service is restarting",component:"aiGuidance"},WEBSOCKET_CORS_ERROR:{code:"WEBSOCKET_CORS_ERROR",message:"CORS error prevented WebSocket connection",component:"aiGuidance"},WEBSOCKET_SSL_ERROR:{code:"WEBSOCKET_SSL_ERROR",message:"SSL/TLS handshake failed for secure WebSocket connection",component:"aiGuidance"},WEBSOCKET_CONNECTION_FAILED:{code:"WEBSOCKET_CONNECTION_FAILED",message:"WebSocket connection failed during initialization",component:"aiGuidance"},COMPONENT_LOADER_MISSING_PLAYBOOK:{code:"COMPONENT_LOADER_MISSING_PLAYBOOK",message:"Current playbook is missing - cannot load component",component:"aiComponentLoader"},COMPONENT_LOADER_INVALID_COMPONENT_KEY:{code:"COMPONENT_LOADER_INVALID_COMPONENT_KEY",message:"Invalid or unknown component key",component:"aiComponentLoader"}};function Kw(e,n={}){const t=zw[e];return t?{...t,details:n}:{code:"UNKNOWN_ERROR",message:`Unknown error: ${e}`,component:"aiGuidance",details:n}}function th(e,n="aiGuidance"){const t=(o,i={})=>{const a=Kw(o,i);e("ai-guidance:error",a),console.error(`[${n}] Error:`,a)};return{emitError:t,emitErrors:(o,i={})=>{o.forEach(a=>t(a,i))}}}const Gw={class:"chat-message-links"},Xw=["href","redirect","data-test-id"],Ww=Ne({__name:"ChatMessageActions",props:{links:{type:Array,default:()=>[]},chatIndex:{type:Number,default:0}},emits:["perform-action"],setup(e){const n=(t,r,o)=>r;return(t,r)=>(F(),q("div",Gw,[(F(!0),q(De,null,Le(e.links,(o,i)=>(F(),q(De,{key:o.label},[o!=null&&o.action?(F(),Oe(en,{key:0,btype:"playbook",text:o.label,disabled:o==null?void 0:o.disabled,"data-test-id":`chat-message-action-${o.label}`,onClick:a=>t.$emit("perform-action",o.action,e.chatIndex,o==null?void 0:o.isStatic)},null,8,["text","disabled","data-test-id","onClick"])):(F(),q("a",{key:1,href:o.link,redirect:n(o.link,o.redirect),target:"_blank",class:"ai-links","data-test-id":`chat-message-action-${o.label}`},ke(o.label),9,Xw))],64))),128))]))}},[["__scopeId","data-v-e0a9c744"]]),Qw={class:"a-icon"},Zw=["src"],Jw={class:"a-name"},Yw={class:"a-size"},eI=Ne({__name:"AppAttachment",props:{background:{type:String,default:"#f8f8f8"},info:{type:Object,required:!0,default:()=>({iconUrl:"",fileName:"",fileSize:""})},encodedString:{type:String,default:""}},emits:["download"],setup(e,{emit:n}){const t=e,r=n,o=i=>{try{const a=i.match(/^data:(.*?);base64,(.*)$/);if(!a||a.length!==3)throw new Error("Invalid Base64 file format");const s=a[1],l=a[2],u=document.createElement("a");u.href=i,u.download=t.info.fileName||"download",u.target="_blank",document.body.appendChild(u),u.click(),document.body.removeChild(u);const c=Af(Math.floor(l.length*3/4));r("download",{name:t.info.fileName,size:c,url:i})}catch(a){console.info("[ERROR]: Error decoding Base64 file:",a)}};return(i,a)=>(F(),q("div",{class:"attachment-wrapper",style:Re(`background: ${e.background}`)},[x("span",Qw,[x("img",{src:e.info.iconUrl},null,8,Zw)]),x("div",null,[x("p",Jw,ke(e.info.fileName),1),x("p",Yw,ke(e.info.fileSize),1)]),e.encodedString?(F(),q("button",{key:0,class:"a-download",onClick:a[0]||(a[0]=s=>o(e.encodedString))},[pe(Ge,{icon:"download",color:"#353535"})])):me("",!0)],4))}},[["__scopeId","data-v-4194a82b"]]),nh="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%204C7.75%202.20508%209.20508%200.75%2011%200.75H27C27.1212%200.75%2027.2375%200.798159%2027.3232%200.883885L38.1161%2011.6768C38.2018%2011.7625%2038.25%2011.8788%2038.25%2012V36C38.25%2037.7949%2036.7949%2039.25%2035%2039.25H11C9.20507%2039.25%207.75%2037.7949%207.75%2036V4Z'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3cpath%20d='M27%200.5V8C27%2010.2091%2028.7909%2012%2031%2012H38.5'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3crect%20x='1'%20y='18'%20width='28'%20height='16'%20rx='2'%20fill='%23198708'/%3e%3cpath%20d='M11.2726%2025.2734H9.71724C9.68883%2025.0722%209.63083%2024.8935%209.54324%2024.7372C9.45564%2024.5786%209.34319%2024.4437%209.20588%2024.3324C9.06857%2024.2211%208.90995%2024.1359%208.73002%2024.0767C8.55247%2024.0175%208.35952%2023.9879%208.15119%2023.9879C7.77477%2023.9879%207.44688%2024.0814%207.16752%2024.2685C6.88817%2024.4531%206.67155%2024.723%206.51767%2025.0781C6.36378%2025.4309%206.28684%2025.8594%206.28684%2026.3636C6.28684%2026.8821%206.36378%2027.3177%206.51767%2027.6705C6.67392%2028.0232%206.89172%2028.2895%207.17108%2028.4695C7.45043%2028.6494%207.77359%2028.7393%208.14054%2028.7393C8.3465%2028.7393%208.53708%2028.7121%208.71227%2028.6577C8.88983%2028.6032%209.04726%2028.5239%209.18457%2028.4197C9.32188%2028.3132%209.43552%2028.1842%209.52548%2028.0327C9.61781%2027.8812%209.68173%2027.7083%209.71724%2027.5142L11.2726%2027.5213C11.2324%2027.8551%2011.1318%2028.1771%2010.9708%2028.4872C10.8122%2028.795%2010.5979%2029.0708%2010.328%2029.3146C10.0605%2029.5561%209.74092%2029.7479%209.36923%2029.8899C8.99991%2030.0296%208.58206%2030.0994%208.11568%2030.0994C7.467%2030.0994%206.88699%2029.9527%206.37562%2029.6591C5.86663%2029.3655%205.46416%2028.9406%205.16824%2028.3842C4.87467%2027.8279%204.72789%2027.1544%204.72789%2026.3636C4.72789%2025.5705%204.87704%2024.8958%205.17534%2024.3395C5.47363%2023.7831%205.87846%2023.3594%206.38983%2023.0682C6.90119%2022.7746%207.47647%2022.6278%208.11568%2022.6278C8.53708%2022.6278%208.9277%2022.687%209.28755%2022.8054C9.64977%2022.9238%209.97056%2023.0966%2010.2499%2023.3239C10.5293%2023.5488%2010.7565%2023.8246%2010.9317%2024.1513C11.1093%2024.478%2011.2229%2024.852%2011.2726%2025.2734ZM16.3206%2024.8189C16.2922%2024.5324%2016.1702%2024.3099%2015.9548%2024.1513C15.7394%2023.9927%2015.447%2023.9134%2015.0777%2023.9134C14.8267%2023.9134%2014.6148%2023.9489%2014.442%2024.0199C14.2692%2024.0885%2014.1366%2024.1844%2014.0443%2024.3075C13.9543%2024.4306%2013.9094%2024.5703%2013.9094%2024.7266C13.9046%2024.8568%2013.9318%2024.9704%2013.991%2025.0675C14.0526%2025.1645%2014.1366%2025.2486%2014.2432%2025.3196C14.3497%2025.3883%2014.4728%2025.4486%2014.6125%2025.5007C14.7522%2025.5504%2014.9013%2025.593%2015.0599%2025.6286L15.7133%2025.7848C16.0306%2025.8558%2016.3218%2025.9505%2016.5869%2026.0689C16.8521%2026.1873%2017.0817%2026.3329%2017.2758%2026.5057C17.47%2026.6785%2017.6203%2026.8821%2017.7268%2027.1165C17.8357%2027.3509%2017.8914%2027.6196%2017.8937%2027.9226C17.8914%2028.3677%2017.7777%2028.7536%2017.5528%2029.0803C17.3303%2029.4046%2017.0083%2029.6567%2016.5869%2029.8366C16.1679%2030.0142%2015.6624%2030.103%2015.0706%2030.103C14.4835%2030.103%2013.9721%2030.013%2013.5365%2029.8331C13.1032%2029.6532%2012.7647%2029.3868%2012.5209%2029.0341C12.2794%2028.679%2012.1527%2028.2398%2012.1409%2027.7166H13.6288C13.6454%2027.9605%2013.7152%2028.1641%2013.8383%2028.3274C13.9638%2028.4884%2014.1307%2028.6103%2014.339%2028.6932C14.5497%2028.7737%2014.7877%2028.8139%2015.0528%2028.8139C15.3132%2028.8139%2015.5393%2028.776%2015.7311%2028.7003C15.9252%2028.6245%2016.0756%2028.5192%2016.1821%2028.3842C16.2886%2028.2493%2016.3419%2028.0942%2016.3419%2027.919C16.3419%2027.7557%2016.2934%2027.6184%2016.1963%2027.5071C16.1016%2027.3958%2015.9619%2027.3011%2015.7773%2027.223C15.595%2027.1449%2015.3712%2027.0739%2015.1061%2027.0099L14.3142%2026.8111C13.701%2026.6619%2013.2169%2026.4287%2012.8618%2026.1115C12.5067%2025.7943%2012.3303%2025.367%2012.3327%2024.8295C12.3303%2024.3892%2012.4475%2024.0045%2012.6842%2023.6754C12.9233%2023.3464%2013.2512%2023.0895%2013.6679%2022.9048C14.0845%2022.7202%2014.558%2022.6278%2015.0883%2022.6278C15.6281%2022.6278%2016.0992%2022.7202%2016.5017%2022.9048C16.9065%2023.0895%2017.2214%2023.3464%2017.4463%2023.6754C17.6712%2024.0045%2017.7872%2024.3857%2017.7943%2024.8189H16.3206ZM20.2419%2022.7273L21.9997%2028.2528H22.0672L23.8286%2022.7273H25.5331L23.026%2030H21.0445L18.5338%2022.7273H20.2419Z'%20fill='white'/%3e%3c/svg%3e",rh="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%204C7.75%202.20508%209.20508%200.75%2011%200.75H27C27.1212%200.75%2027.2375%200.798159%2027.3232%200.883885L38.1161%2011.6768C38.2018%2011.7625%2038.25%2011.8788%2038.25%2012V36C38.25%2037.7949%2036.7949%2039.25%2035%2039.25H11C9.20507%2039.25%207.75%2037.7949%207.75%2036V4Z'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3cpath%20d='M27%200.5V8C27%2010.2091%2028.7909%2012%2031%2012H38.5'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3crect%20x='2'%20y='18.5'%20width='24'%20height='15'%20rx='2'%20fill='%23198708'/%3e%3cpath%20d='M7.14773%2022.9545L8.46768%2025.1854H8.51882L9.84517%2022.9545H11.408L9.41051%2026.2273L11.4528%2029.5H9.86115L8.51882%2027.266H8.46768L7.12536%2029.5H5.54013L7.58878%2026.2273L5.57848%2022.9545H7.14773ZM12.2837%2029.5V22.9545H13.6676V28.359H16.4737V29.5H12.2837ZM20.941%2024.837C20.9154%2024.5792%2020.8057%2024.3789%2020.6118%2024.2362C20.4179%2024.0934%2020.1547%2024.022%2019.8224%2024.022C19.5965%2024.022%2019.4058%2024.054%2019.2503%2024.1179C19.0947%2024.1797%2018.9754%2024.266%2018.8923%2024.3768C18.8113%2024.4876%2018.7709%2024.6133%2018.7709%2024.7539C18.7666%2024.8711%2018.7911%2024.9734%2018.8444%2025.0607C18.8998%2025.1481%2018.9754%2025.2237%2019.0713%2025.2876C19.1672%2025.3494%2019.278%2025.4038%2019.4037%2025.4506C19.5294%2025.4954%2019.6636%2025.5337%2019.8064%2025.5657L20.3944%2025.7063C20.68%2025.7702%2020.942%2025.8555%2021.1807%2025.962C21.4193%2026.0685%2021.626%2026.1996%2021.8007%2026.3551C21.9754%2026.5107%2022.1107%2026.6939%2022.2066%2026.9048C22.3046%2027.1158%2022.3547%2027.3576%2022.3568%2027.6303C22.3547%2028.0309%2022.2524%2028.3782%2022.05%2028.6722C21.8497%2028.9641%2021.5599%2029.1911%2021.1807%2029.353C20.8035%2029.5128%2020.3486%2029.5927%2019.816%2029.5927C19.2876%2029.5927%2018.8273%2029.5117%2018.4353%2029.3498C18.0454%2029.1879%2017.7407%2028.9482%2017.5212%2028.6307C17.3039%2028.3111%2017.1899%2027.9158%2017.1792%2027.445H18.5184C18.5333%2027.6644%2018.5961%2027.8477%2018.7069%2027.9947C18.8199%2028.1396%2018.9701%2028.2493%2019.1576%2028.3239C19.3472%2028.3963%2019.5613%2028.4325%2019.8%2028.4325C20.0344%2028.4325%2020.2378%2028.3984%2020.4104%2028.3303C20.5851%2028.2621%2020.7204%2028.1673%2020.8163%2028.0458C20.9122%2027.9244%2020.9601%2027.7848%2020.9601%2027.6271C20.9601%2027.4801%2020.9165%2027.3565%2020.8291%2027.2564C20.7439%2027.1562%2020.6182%2027.071%2020.452%2027.0007C20.2879%2026.9304%2020.0866%2026.8665%2019.8479%2026.8089L19.1352%2026.63C18.5834%2026.4957%2018.1476%2026.2859%2017.828%2026.0004C17.5084%2025.7148%2017.3497%2025.3303%2017.3518%2024.8466C17.3497%2024.4503%2017.4552%2024.104%2017.6682%2023.8079C17.8834%2023.5117%2018.1785%2023.2805%2018.5535%2023.1143C18.9285%2022.9482%2019.3547%2022.8651%2019.8319%2022.8651C20.3177%2022.8651%2020.7417%2022.9482%2021.104%2023.1143C21.4683%2023.2805%2021.7517%2023.5117%2021.9541%2023.8079C22.1565%2024.104%2022.2609%2024.4471%2022.2673%2024.837H20.941Z'%20fill='white'/%3e%3c/svg%3e",tI={name:"SkeletonLoader",props:{dataTestId:{type:String,default:""}}},nI=["data-test-id"];function rI(e,n,t,r,o,i){return F(),q("div",{class:"skeleton-loader","data-test-id":t.dataTestId},null,8,nI)}const $i=Ne(tI,[["render",rI],["__scopeId","data-v-17a86e07"]]),oh={};function oI(e){let n=oh[e];if(n)return n;n=oh[e]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);n.push(r)}for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);n[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return n}function Vo(e,n){typeof n!="string"&&(n=Vo.defaultChars);const t=oI(n);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let i=0,a=r.length;i<a;i+=3){const s=parseInt(r.slice(i+1,i+3),16);if(s<128){o+=t[s];continue}if((s&224)===192&&i+3<a){const l=parseInt(r.slice(i+4,i+6),16);if((l&192)===128){const u=s<<6&1984|l&63;u<128?o+="��":o+=String.fromCharCode(u),i+=3;continue}}if((s&240)===224&&i+6<a){const l=parseInt(r.slice(i+4,i+6),16),u=parseInt(r.slice(i+7,i+9),16);if((l&192)===128&&(u&192)===128){const c=s<<12&61440|l<<6&4032|u&63;c<2048||c>=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),i+=6;continue}}if((s&248)===240&&i+9<a){const l=parseInt(r.slice(i+4,i+6),16),u=parseInt(r.slice(i+7,i+9),16),c=parseInt(r.slice(i+10,i+12),16);if((l&192)===128&&(u&192)===128&&(c&192)===128){let h=s<<18&1835008|l<<12&258048|u<<6&4032|c&63;h<65536||h>1114111?o+="����":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),i+=9;continue}}o+="�"}return o})}Vo.defaultChars=";/?:@&=+$,#",Vo.componentChars="";const ih={};function iI(e){let n=ih[e];if(n)return n;n=ih[e]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);/^[0-9a-z]$/i.test(r)?n.push(r):n.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let t=0;t<e.length;t++)n[e.charCodeAt(t)]=e[t];return n}function Ui(e,n,t){typeof n!="string"&&(t=n,n=Ui.defaultChars),typeof t>"u"&&(t=!0);const r=iI(n);let o="";for(let i=0,a=e.length;i<a;i++){const s=e.charCodeAt(i);if(t&&s===37&&i+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(s<128){o+=r[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&i+1<a){const l=e.charCodeAt(i+1);if(l>=56320&&l<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}Ui.defaultChars=";/?:@&=+$,-_.!~*'()#",Ui.componentChars="-_.!~*'()";function bc(e){let n="";return n+=e.protocol||"",n+=e.slashes?"//":"",n+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?n+="["+e.hostname+"]":n+=e.hostname||"",n+=e.port?":"+e.port:"",n+=e.pathname||"",n+=e.search||"",n+=e.hash||"",n}function ks(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const aI=/^([a-z0-9.+-]+:)/i,sI=/:[0-9]*$/,lI=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,uI=["<",">",'"',"`"," ","\r",`
|
|
168
|
+
`,oc={retrieveBlock:"/composables/retrieveComposableConfig",retrieveMeta:"/composables/retrieveComposableConfig",fetchAccessToken:"/int/auth",cart:{getQuoteProducts:"/transactions/getQuoteProducts",getGroupedQuoteProducts:"/transactions/getGroupedQuoteProducts"},catalog:{getProductItems:"/getCatalogProducts",saveItemToQuoteBlink:"/transactions/saveItemToQuoteBlink",updateLines:"/transactions/updateLines",deleteQuoteLine:"/quoting/deleteQuoteLine",getLineItems:"/quoting/getConfiguredLineItems"},promocode:{getPromoCodes:"/promotions/getPromoCodes",applyPromoCode:"/promotions/applyPromocode"},fetch:{getRecord:"/platform/getHeaderRecord"},update:{upsertRecords:"/platform/upsertRecords"},tax:{calculateAvaTax:"/transactions/calculateTax"},common:{getLineItemAttributes:"/product-pricing/getLineItemAttributes"}};async function nn({action:e,data:n,config:t={}}){var p,f;const r=Ht(),o=t.accessToken??r.accessToken.value,i=t.salesforceOrgId??r.organizationId.value,a=t.userId??r.userId.value,s=t.orgType??r.composablesOrgType.value,l=t.baseUrl??r.composablesApiUrl.value,u=oc[t.pathKey]??oc[t.pathKey.split(".")[0]][t.pathKey.split(".")[1]];if(!u)throw new Error(`Invalid pathKey: ${t.pathKey}. Available keys: ${Object.keys(oc).join(", ")}`);const c=`${l}${u}`;if(!i&&t.pathKey!=="fetchAccessToken")throw new Error("salesforceOrgId is required. Provide it in config or set it via useComposableStore.updateConfig()");let h;e?h={action:e,data:n}:h=n;const d={"Content-Type":"application/json"};if(o&&(d.Authorization=`Bearer ${o}`),i&&(d["X-Salesforce-Org-Id"]=i),s&&(d["X-Salesforce-Org-Type"]=s),a&&(d["X-Salesforce-User-Id"]=a),!c)throw new Error("composablesApiUrl is required. Provide it in props or set it via useComposableStore.updateConfig()");try{console.log(`[COMPOSABLES_API:${e||"no-action"}] request`,JSON.stringify(h)),console.log(`[COMPOSABLES_API:${e||"no-action"}] headers`,d);const g=await dt.post(c,h,{headers:d});if(console.log(`[COMPOSABLES_API:${e||"no-action"}] response`,g.data),!e&&((p=g.data)!=null&&p.data)&&typeof g.data.data=="string")try{g.data=JSON.parse(g.data.data)}catch(m){console.warn("[COMPOSABLES_API] Failed to parse data field:",m)}else if(!e&&((f=g.data)!=null&&f.data)&&typeof g.data.data=="object")try{g.data=g.data.data}catch(m){console.warn("[COMPOSABLES_API] Failed to parse content field:",m)}return g.data}catch(g){throw console.error(`[COMPOSABLES_API:${e||"no-action"}] error:`,g),g}}const Uo="https://d2pgvmpph8dmlo.cloudfront.net";function y2(e,n,t){return e?e==null?void 0:e.map(r=>dx(r,n,t)):[]}function dx(e,n,t){const{url:r,staticResource:o}=e;if(!r)return null;if(r.includes("/resource/")&&!r.includes("://")&&o){const i=r.split("/"),a=i[i.length-1];return`${Uo}/${t}/static/${a}.${n}`}else return r}const Fi=Lt("blockLegacy",()=>{const e=Ht(),n=G(null),t=G(null),r=G(!1),o=G(null);async function i(c,h=!0){var f,g;if(console.info("fetchBlockInformation templateId:",c.templateId),!c.templateId)return;h&&(n.value=[],r.value=!1);const d={storefrontId:c.storefrontId,templateId:c.templateId};console.log("fetchBlockInformation variables",JSON.stringify(d)),console.log("fetchBlockInformation getTemplateBlock",m2);const p=await ps(m2,d);if(console.log("fetchBlockInformation getTemplateBlockResponse",p),console.log("fetchBlockInformation pageBlocks",n.value),t.value=c.templateId,h)(f=p.content)!=null&&f.blocks?(n.value=a(JSON.parse(p.content.blocks)),console.log("fetchBlockInformation pageBlocks 1",n.value)):n.value=[],r.value=!0;else return((g=p==null?void 0:p.content)==null?void 0:g.blocks)||[]}function a(c){const h=e.organizationId.value;return c==null||c.forEach(d=>{d.blocks=d.blocks?JSON.parse(d.blocks):[],d.blocks.forEach(p=>{var f,g;Object.assign(p,JSON.parse(p.contentJSON)),p.contentJSON=null,p.id=p.blockId||p.Id,(p.componentName==="catalogBlock"||p.componentName==="relatedProducts")&&(s(p.fields.productCard.actions),p.fields.noFriendlyURL=!0,p.fields.productCard.friendlyURL=null,p.fields.productCard.friendlyURLFields=null,(f=p.configuration)!=null&&f.productTemplateId?p.fields.productCard.url="/product/"+((g=p.configuration)==null?void 0:g.productTemplateId):p.fields.productCard.url=null),p.componentName==="productSummary"&&(console.log("block.fields.actions",p.fields.actions),s(p.fields.actions)),p.customJS&&(p.customJS=y2(p.customJS,"js",h)),p.customCSS&&(p.customCSS=y2(p.customCSS,"css",h))})}),c}function s(c){c.forEach(h=>{h.action==="CUSTOM_ACTION"&&(h.action="CUSTOM",h.name=h.label.title,h.value=h.url.field||h.url.title,h.newTab=h.openInNewTab)})}async function l(c,h=!0){var d,p,f;if(console.info("fetchBlockInformationREST templateId:",c.templateId),!!c.templateId){h&&(n.value=[],r.value=!1);try{const g=await nn({action:"retrieveBlock",data:{salesforceOrgId:e.organizationId.value,storefrontId:c.templateId,templateId:"wrapperDefault"},config:{pathKey:"retrieveBlock"}});t.value=c.templateId;const m=((p=(d=g==null?void 0:g.data)==null?void 0:d[0])==null?void 0:p.blocks)??((f=g==null?void 0:g.data)==null?void 0:f.blocks);if(console.log("fetchBlockInformationREST blocksData",m),h){if(m){const v=typeof m=="string"?JSON.parse(m):m;console.log("fetchBlockInformationREST parsedBlocks",v),n.value=a(v),console.log("fetchBlockInformationREST pageBlocks",n.value)}else console.log("fetchBlockInformationREST blocksData is null"),n.value=[];r.value=!0}else return m||[]}catch(g){throw console.error("fetchBlockInformationREST error:",g),h&&(n.value=[],r.value=!0),g}}}return{metaInfo:o,currentPageId:t,pageBlocks:n,blockLoaded:r,fetchBlockInformation:i,fetchBlockInformationREST:l,getFormattedSectionBlocks:c=>be(()=>{const h=[];return n.value&&n.value.length>0&&n.value.forEach(d=>{const p=d.blocks;p&&p.length>0&&p.forEach(f=>{if(f.id=f.blockId,c){const g=["checkoutAccount","shippingAddress","shippingMethod","customForm","termsAndPayment","quoteSummary","customCode"];console.log("section.sectionName",d.sectionName,f.componentName),f&&f.configuration&&(g.includes(f.componentName)||f.configuration.isCheckoutBlock)&&h.push(f)}else f&&f.configuration&&!c&&h.push(f)})}),h})}}),_o=async(e,n=null,t="",r=!1)=>{const o=Ht();console.log("appsyncHandler composableStore",o);const i=o.graphqlEndpoint.value,a=o.apiKey.value;let s=200,l;const u=o.hostName.value;console.log("appsyncHandler currentHostname",u);const c=ac();try{const h=n;let d="";c.activeStorefrontInfo&&c.activeStorefrontInfo.accountId&&!d&&(d=c.activeStorefrontInfo.accountId),h.data&&c.activeStorefrontInfo&&!e.includes("CognitoActions")&&!e.includes("query listUsers")&&(h.data.userType=c.activeStorefrontInfo.userType,h.data.accountId=d,h.data.domain=u);const p=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":a},body:JSON.stringify({query:e,variables:h})});if(l=await(p==null?void 0:p.json()),l=l.data,t)l=JSON.parse(l[t]),s=Number(l.statusCode),l=l.content,s===401&&console.info("401",e,JSON.stringify(n));else if(e.includes("SalesforceActions")){let f=l;f=JSON.parse(l.salesforceActions),f.statusCode==="401"&&console.info("401",e,JSON.stringify(n),l)}}catch(h){console.log(h),s=400,l=h}return{statusCode:s,response:l}},ic=["Needs Configuration","Suggests Configuration","Upload Configuration"],fx=["Upload","Upload Add","Upload Configuration"],hx=["No Configuration","Suggests Configuration","Upload Add","",null,void 0],px=["CONFIGURE","UPLOAD","ADD_TO_CART"],mx=new Map([["Full","Full"],["FULL","Full"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","Default"],["ECATALOG_ACCOUNT_CUSTOM","Alternate"],["ECATALOG_OVERRIDE","Override"]]),gx=new Map([["Full","Item"],["FULL","Item"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","eCatalog"],["ECATALOG_ACCOUNT_CUSTOM","eCatalog"],["ECATALOG_OVERRIDE","eCatalog"]]),Bi=(e,n,t=!1)=>{const r=wn();let o,i,a;return t?(i=e.statusCode,a=e.content):(o=JSON.parse(e.response.salesforceActions),i=o.statusCode,a=o.content),Number(i)===200&&a&&a.message&&typeof a.message=="string"&&a.message.startsWith("ERROR:")?(r.handleError(a.message,"useExtractContent"),!1):Number(i)!==200||e.statusCode!==200||typeof a=="string"&&a.includes("ERROR:")||typeof a=="string"&&a.includes("Error:")||a.errorCode==="APEX_ERROR"?(a.errorCode==="APEX_ERROR"?r.handleError(a.message,"useExtractContent"):n||r.handleError(a,"useExtractContent"),!1):a},jo=new Map;function Sn(e,n){return jo.has(e)||jo.set(e,new Set),jo.get(e).add(n),()=>{yx(e,n)}}function yx(e,n){const t=jo.get(e);t&&(t.delete(n),t.size===0&&jo.delete(e))}function rn(e,n){const t=jo.get(e);!t||t.size===0||Array.from(t).forEach(r=>{try{r(n)}catch{}})}const _r=Lt("catalog",()=>{const e=Ht(),n=G(!1),t=G(0),r=G(null),o=G(null),i=G([]),a=G({}),s=G({}),l=G(null),u=G(null),c=G(!1),h=G({search:""}),d=G({qliRecords:!0,quoteCreate:!1,quoteDetails:!1}),p=be(()=>e.accountId.value),f=be(()=>({domain:e.hostName.value,accountId:p.value,userType:e.userId.value})),g=be(()=>{const $=Array.isArray(i.value)?i.value:[],J={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},ee=O=>(O==null?void 0:O.XX_ORD1__SYS_Configuration_Status2__c)||(O==null?void 0:O.xx_ord1__sys_configuration_status2__c)||"",Y=O=>O in J,U=$.filter(O=>Y(ee(O)));return U.sort((O,R)=>{const M=ee(O),N=ee(R);return(J[M]||99)-(J[N]||99)}),U});function m(){const $=g.value||[];return $.length?$[0]:null}function v($="true"){V3(`qreset-${r.value}`,$)}async function y($){try{const J={objectType:"XX_ORD1__Quote_Line_Item__c",qliIds:Array.isArray($)?$:[$]},ee=await nn({data:J,config:{pathKey:"catalog.deleteQuoteLine"}});return t.value=Math.max(0,(t.value||0)-1),A(!0),console.log("[CATALOG:deleteLineItems] success",ee),v(),rn("catalog:line-deleted",{quoteId:(e==null?void 0:e.quoteId.value)||null,qliIds:J.qliIds,response:ee}),ee}catch(J){console.log("[CATALOG:deleteLineItems] error",J),v();return}}async function b($){var M,N;if(!$.qty)return;const J=e.quoteId.value;if(!J)return;$.retry=1;const ee={...$,quoteid:J},Y={action:"makeCall",data:{...f.value,callType:"POST",endpoint:"/services/apexrest/XX_ORD1/ecommerce?type=updateQLI&ut="+e.userId.value,payload:JSON.stringify(ee)}},U=await _o(Xr,Y,void 0,!0),O=(N=(M=U.response)==null?void 0:M.salesforceActions)==null?void 0:N.toLowerCase();(O.includes("record currently unavailable")||O.includes("unable_to_lock_row"))&&$.retry<3&&setTimeout(()=>{$.retry+=1,b($)},500),Bi(U)&&A(!0),v()}async function _($){var Y,U,O,R,M;const J=e==null?void 0:e.quoteId.value;Array.isArray($)&&($=$[0]);const ee={itemId:$.itemID,eCatalogItemId:$.eCatalogItemID,quantity:$.qty,accountId:p.value,qtyTierAmt:($==null?void 0:$.qtyTierAmt)??null};J&&(ee.quoteId=J);try{const N=await nn({data:ee,config:{pathKey:"catalog.saveItemToQuoteBlink"}}),H=(N==null?void 0:N.quoteId)||((Y=N==null?void 0:N.data)==null?void 0:Y.quoteId)||((O=(U=N==null?void 0:N.data)==null?void 0:U.quote)==null?void 0:O.Id);H&&H!==J&&(r.value=H,e.updateConfig({quoteId:H}));const L=((R=N==null?void 0:N.data)==null?void 0:R.QliId)||(N==null?void 0:N.QliId)||null,z=$==null?void 0:$.itemID,j=$==null?void 0:$.qty;if(L&&z){const W=s.value?s.value[z]:null;s.value={...s.value||{},[z]:{...W||{},Id:L,XX_ORD1__Item__c:z,XX_ORD1__QTY__c:typeof j=="number"?j:(W==null?void 0:W.XX_ORD1__QTY__c)||0}}}return A(!0),v(),rn("catalog:item-added",{itemId:ee.itemId,eCatalogItemId:ee.eCatalogItemId||null,quantity:ee.quantity,quoteId:(e==null?void 0:e.quoteId.value)||H||null,qliId:((M=N==null?void 0:N.data)==null?void 0:M.QliId)||(N==null?void 0:N.QliId)||null,response:N}),N}catch(N){console.log("[CATALOG:saveItemToQuoteBlinkTxn] error",N),v();return}}async function C({itemId:$,qty:J,qliId:ee,eCatalogItemId:Y}={}){var R,M,N,H,L;if(console.log("updateQuoteLineQtyTxn",{itemId:$,qty:J,qliId:ee,eCatalogItemId:Y}),!J&&J!==0)return;let U=ee||((M=(R=s.value)==null?void 0:R[$])==null?void 0:M.Id);if(U||(await w(!0),U=ee||((H=(N=s.value)==null?void 0:N[$])==null?void 0:H.Id)),!U){if(J>0&&$&&Y)return console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id, saving item first",{itemId:$,eCatalogItemId:Y}),await _({itemID:$,eCatalogItemID:Y,qty:J,qtyTierAmt:null});console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id for item",{itemId:$});return}const O={uniqueField:"",objectType:"XX_ORD1__Quote_Line_Item__c",records:[{fields:[{fieldName:"Id",fieldValue:U},{fieldName:"XX_ORD1__QTY__c",fieldValue:J}]}]};try{const z=await nn({data:O,config:{pathKey:"catalog.updateLines"}});if($){const j=((L=s.value)==null?void 0:L[$])||{};s.value={...s.value||{},[$]:{...j,Id:U,XX_ORD1__Item__c:$,XX_ORD1__QTY__c:J}}}return A(!0),v(),rn("catalog:item-qty-updated",{itemId:$,qliId:U,quantity:J,eCatalogItemId:Y||null,quoteId:(e==null?void 0:e.quoteId.value)||null,response:z}),z}catch(z){console.log("[CATALOG:updateQuoteLineQtyTxn] error",z),v();return}}async function k($,J,ee){var N;const Y=ee==="Item",U=[],O=(($==null?void 0:$.searchText)||"").toString().trim(),R=Array.isArray($==null?void 0:$.fields)?$.fields:[];Array.isArray($==null?void 0:$.filters)&&$.filters,$==null||$.filterLogic;const M={searchPL:O,origin:"genesis_ai",userId:(e==null?void 0:e.userId.value)||"",orgId:(e==null?void 0:e.organizationId.value)||"",orgType:"Production",requestId:Kr(),quoteId:(e==null?void 0:e.quoteId.value)||"",accountId:(e==null?void 0:e.accountId.value)||"",numberOfRecords:($==null?void 0:$.numberOfRecords)||($==null?void 0:$.rowLimit)||10,fields:R,filters:($==null?void 0:$.whereCondition)||[]};try{const H=await nn({data:M,config:{pathKey:"catalog.getProductItems"}});if(!H||!H.selected_products||typeof H.selected_products!="object")return console.warn("[CATALOG:getProductItems] Invalid response structure",{responseObj:H}),{items:[],count:0};const L=H.selected_products,z=Object.values(L).map(W=>{var Q;return(Q=W==null?void 0:W.catalogResponse)==null?void 0:Q.productInfo}).filter(Boolean);z.forEach(W=>{var K,V,te,oe;const Q=JSON.parse(JSON.stringify(J)),ae=vt(W,Y?"XX_ORD1__Friendly_URL__c":"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),fe=vt(W,Y?"XX_ORD1__SYS_Requires_Configuration__c":"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");Y?Q.itemId=W.Id:(Q.itemId=W.XX_ORD1__Item__c,Q.catalogItemId=W.Id),Q.thumbnail.value=Q.thumbnail.field&&!Q.thumbnail.isStatic?vt(W,Q.thumbnail.field):"",Q.title.value=Q.title.field&&!Q.title.isStatic?vt(W,Q.title.field):"",Q.description.value=Q.description.field&&!Q.description.isStatic?vt(W,Q.description.field):"",(K=Q.attributes)==null||K.forEach(le=>{le.value.field&&(le.value.value=vt(W,le.value.field,le.value.dataType)||"-"),le.label.field&&(le.label.value=vt(W,le.label.field,le.label.dataType)||"-")}),Q.requiresConfiguration=fe,Q.actions=Q.actions.filter(({action:le})=>le==="ADD_TO_CART"&&hx.includes(fe)||le==="CONFIGURE"&&ic.includes(fe)||le==="UPLOAD"&&fx.includes(fe)||!px.includes(le)),(V=Q.actions)==null||V.forEach(le=>{if(le.action==="CUSTOM"){const{url:ne,label:de}=le;ne.isStatic||(ne.value=vt(W,ne.field)),de.isStatic||(de.value=vt(W,de.field))}}),((te=Q.friendlyURLFields)==null?void 0:te.length)>0&&ae?((oe=Q.friendlyURLFields)==null||oe.forEach(le=>{Q.friendlyURL=Q.friendlyURL.replace(`{!${le}}`,vt(W,le))}),Q.friendlyURL="/"+Q.friendlyURL+"/"+ae):Q.url&&(Q.friendlyURL=Q.url+"/"+W.Id),Q.friendlyURL&&(Q.friendlyURL=Q.friendlyURL.replace(/\/{2,}/g,"/")),U.push(Q)});const j=Number(((N=H==null?void 0:H.data)==null?void 0:N.totalCount)||z.length)||0;return{items:U,count:j>2e3?2e3:j}}catch(H){console.log("[CATALOG:getProductItems] new API error",H);return}}async function E($){var U;console.log("[CATALOG:getEcatalogDetails] jsonData",$),$.accountID=e.accountId.value;const J={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getEcatalogDetails&ut=${e.userId.value}`,payload:JSON.stringify($)}},ee=await _o(Xr,J),Y=Bi(ee);if(Y!==!1)return(U=JSON.parse(Y))==null?void 0:U.recordData}async function S($,J=()=>{}){$.accountID=e.accountId.value||"";const ee={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogGroupCounts&ut=${e.userId.value}`,payload:JSON.stringify($)}},Y=await _o(Xr,ee,void 0,!0),U=JSON.parse(JSON.parse(Y.response.salesforceActions).content);return J(U),U}async function D($,J=()=>{}){const ee={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogPicklistGroupCounts&ut=${e.userId.value}`,payload:JSON.stringify($)}},Y=await _o(Xr,ee,void 0,!0);return J(JSON.parse(JSON.parse(Y.response.salesforceActions).content)),JSON.parse(JSON.parse(Y.response.salesforceActions).content)}async function I(){var U,O,R,M,N,H;console.log("[CATALOG:getObjectDetails] start",{currentQuoteId:r.value,payload:f.value});const $=e.quoteId.value;if(console.log("[CATALOG:getObjectDetails] qtId",$),$)console.log("[CATALOG:getObjectDetails] Quote found!"+$),console.log("[CATALOG:getObjectDetails] Quote found",$);else{console.log("[CATALOG:getObjectDetails] No quote found!"),console.warn("[CATALOG:getObjectDetails] No quote found, aborting");return}const J={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getFormattedObjectDetails&objectapi=XX_ORD1__Quote__c&objectid=${$}`}};console.log("[CATALOG:getObjectDetails] request",J.data.endpoint),d.quoteDetails=!0,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> true");const ee=await _o(Xr,J,void 0,!0);console.log("[CATALOG:getObjectDetails] response received",{hasResponse:!!(ee!=null&&ee.response),len:String(((U=ee==null?void 0:ee.response)==null?void 0:U.salesforceActions)||"").length});const Y=Bi(ee,!0);return console.log("[CATALOG:getObjectDetails] extracted content",{hasContent:!!Y}),d.quoteDetails=!1,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> false"),Y?(a.value=JSON.parse(Y),console.log("[CATALOG:getObjectDetails] quoteRecord set",{id:(O=a.value)==null?void 0:O.Id,accountName:(R=a.value)==null?void 0:R.XX_ORD1__Account_Name__c,checkedOut:(M=a.value)==null?void 0:M.XX_ORD1__Checked_Out__c}),e.quoteAccount=(N=a.value)==null?void 0:N.XX_ORD1__Account_Name__c,a.value.XX_ORD1__Checked_Out__c?(console.warn("[CATALOG:getObjectDetails] Quote is already checked out, resetting quoteId"),n.value=!0,console.log("[CATALOG:getObjectDetails] end (checked out) -> false"),!1):(console.log("[CATALOG:getObjectDetails] end (success)",{id:(H=a.value)==null?void 0:H.Id}),a.value)):(console.warn("[CATALOG:getObjectDetails] no content returned, resetting quoteId",{qtId:$}),console.log("[CATALOG:getObjectDetails] end (no content) -> false"),!1)}const A=pn(w,500);async function w($=!1){var Y;console.log("[CATALOG:getQuoteItems] start",{noLoad:$}),d.value.qliRecords=!$;const J=e.quoteId.value;if(console.log("[CATALOG:getQuoteItems] qtId",J),!J){console.log("[CATALOG:getQuoteItems] No quote found!"),d.value.qliRecords=!1,console.warn("[CATALOG:getQuoteItems] No quote found, aborting");return}const ee={objectId:J};try{const U=await nn({data:JSON.stringify(ee),config:{pathKey:"catalog.getLineItems"}}),O=((Y=U==null?void 0:U.data)==null?void 0:Y.products)||(U==null?void 0:U.products)||[],R=[],M={};O.forEach(N=>{const H=N==null?void 0:N.productLineItem;H&&(R.push(H),H.XX_ORD1__Item__c&&(M[H.XX_ORD1__Item__c]=H)),(Array.isArray(N==null?void 0:N.options)?N.options:[]).forEach(z=>{R.push(z),z.XX_ORD1__Item__c&&(M[z.XX_ORD1__Item__c]=z)})}),i.value=R,s.value=M,t.value=R.length,d.value.qliRecords=!1,console.log("[CATALOG:getQuoteItems] end (success)",{count:R.length}),rn("catalog:items-fetched",{quoteId:J,items:i.value,count:t.value})}catch(U){console.warn("[CATALOG:getQuoteItems] error",U),d.value.qliRecords=!1}}async function T($){console.log("[CATALOG:getSavedFilter] ecfr",$);const J={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getSavedFilter&ut=${e.userId.value}&ecfr=${$}`}},ee=await _o(Xr,J,void 0,!0),Y=Bi(ee);return Y?(console.log("[CATALOG:getSavedFilter] Saved Filters",Y),JSON.parse(Y)):!1}async function P(){var Y;console.log("[CATALOG:calculateAvaTax]"),u.value=null;const $=e.quoteId.value;if(!$)return;(Y=a.value)!=null&&Y.Id||await I();const J=a.value;if(J.XX_ORD1__Shipping_Address__c&&J.XX_ORD1__Shipping_City__c&&J.XX_ORD1__Shipping_Country__c&&J.XX_ORD1__Shipping_State__c&&J.XX_ORD1__Shipping_Zip__c){const U={recordId:$,isCommit:!1},O={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=calculateAvaTax&ut=${e.userId.value}`,payload:JSON.stringify(U)}};c.value=!0;const R=await _o(Xr,O,void 0,!0),M=Bi(R);if(M)console.log("[CATALOG:calculateAvaTax] content",M);else{const N=JSON.parse(R.response.salesforceActions).content;u.value=N}c.value=!1}else console.log("[CATALOG:calculateAvaTax] Shipping address not found so tax can not be calculated")}function X($,J,ee=!0){const Y=J.qtyTiers;if(!Y)return null;const U=Y.find(O=>O.ev===null?$>=O.sv:$>=O.sv&&$<=O.ev);return U?ee?U.formattedOfferPrice:U.originalPrice:null}return{quoteCheckedOut:n,avaTaxError:u,avaTaxLoading:c,cartCount:t,cartUpdated:v,quoteId:r,loading:d,filter:h,quoteRecord:a,secondQuoteId:o,qliRecords:i,savedItems:s,savedFilter:l,getObjectDetails:I,getSavedFilter:T,saveItemToQuoteBlinkTxn:_,updateQuoteLineQtyTxn:C,deleteLineItems:y,getPicklistFilterData:D,getQuoteItems:w,updateCart:b,getFilterData:S,getProductItems:k,calculateAvaTax:P,getEcatalogDetails:E,getVolumePrice:X,configurableItemsSorted:g,getTopConfigurableItem:m,getQuoteItems:w}}),ac=Lt("composableCatalog",()=>{const e=Fi();_r();const n=wn(),t=Ht(),r=G(!0),o=G({accountId:"",contactId:"",userType:"",domain:"",locale:"en-US"}),i=G({}),a=G(""),s=G(""),l=G(""),u=G(""),c=G(""),h=G(""),d=G(null),p=G(!1),f=be(()=>u.value+"::"+c.value);async function g(){d.value=null,p.value=!0;try{const S={domain:t.hostName.value,templateBlocksFilter:{templateId:{eq:"wrapperDefault"}}},D=Date.now().toString(),I=await dt.post(`${t.graphqlEndpoint.value}?t=${D}`,{query:cx,variables:S},{headers:{"Content-Type":"application/json","x-api-key":t.apiKey.value,"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0","X-Cache-Bust":D},withCredentials:!1});console.log("[COMPOSABLECATALOG:fetchDomainDetails] response",I);const A=I&&I.data?I.data:null;console.log("[COMPOSABLECATALOG:fetchDomainDetails] payload",A);const w=A&&A.data&&A.data.dataByDomain&&Array.isArray(A.data.dataByDomain.items)?A.data.dataByDomain.items:[],T=w.length?w[0]:null;return console.log("[COMPOSABLECATALOG:fetchDomainDetails] item",T),console.log("[COMPOSABLECATALOG:fetchDomainDetails] storefrontDetails",i.value),i.value=T,o.value={accountId:T.guestAccountId,contactId:"",userType:"AWSGuest",domain:T.domain,locale:"en-US"},u.value=T.organization.salesforceOrgId,c.value=T.storefrontId,T}catch(S){throw console.info("[COMPOSABLECATALOG:fetchDomainDetails] Error fetching domain",S),d.value=S&&S.message?S.message:"Unknown error",S}finally{p.value=!1}}function m(S){s.value=(S==null?void 0:S.templateId)??"",l.value=(S==null?void 0:S.quoteId)??"",h.value=(S==null?void 0:S.userId)??""}function v(S){l.value=S}function y(S){i.value=S}async function b(){try{await e.fetchBlockInformation({templateId:s.value,storefrontId:c.value},!0)}catch(S){n.handleError(S,"getBlockInformation")}}const _=async()=>{var S,D;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!c.value)try{const I=await ps(g2,{storefrontId:c.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",I),((D=(S=I.content)==null?void 0:S.items)==null?void 0:D[0])??null}catch(I){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",I)}},C=()=>{if(typeof document>"u")return;const S=u.value,D=c.value;if(!S||!D)return;const I=`${Uo}/${S}/${D}/css/theme_${D}.css`;let A=!1;if(typeof window<"u"&&window.VueExpediteComponents&&typeof window.VueExpediteComponents.applyThemeToShadows=="function")try{window.VueExpediteComponents.applyThemeToShadows(I),A=!0}catch($){console.warn("[COMPOSABLECATALOG:setThemeData] shadow injection failed; will inject in head",$)}let w="";try{w=new URL(t.graphqlEndpoint.value).origin}catch{}const T=typeof window<"u"?window.location.href:"",P=($,J={})=>{const ee=document.head||document.getElementsByTagName("head")[0];if(!ee)return;let Y=document.getElementById($);Y||(Y=document.createElement("link"),Y.id=$,ee.appendChild(Y)),Object.entries(J).forEach(([U,O])=>{O!=null&&Y.setAttribute(U,String(O))})};(($,J,ee=!0)=>{const Y=document.head||document.getElementsByTagName("head")[0];if(!Y||document.getElementById($))return;const U=document.createElement("script");U.id=$,U.src=J,ee&&(U.async=!0),Y.appendChild(U)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),P("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),w&&P("ec-preconnect-appsync",{rel:"preconnect",href:w}),A||P("ec-theme-stylesheet",{rel:"stylesheet",href:I}),P("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),T&&P("ec-canonical",{rel:"canonical",href:T}),P("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Uo}/expedite/Expedite_Favicon.ico`})};function k(){return!0}function E(){s.value="",l.value="",u.value="",c.value="",h.value=""}return{templateId:s,isLoading:r,activeStorefrontInfo:o,quoteAccount:a,storefrontDetails:i,salesforceOrgId:u,storefrontId:c,userId:h,orgWithStorefrontId:f,useVisiblity:k,fetchDomainDetails:g,setData:m,setQuoteId:v,setStorefrontDetails:y,getBlockInformation:b,getTheme:_,setThemeData:C,reset:E}}),vx=e=>{const n=e.match(/query\s+(\w+)/);return n?n[1]:null},bx=e=>e.replace(/[-_\s]+/g," ").trim().replace(/^(.)/,(n,t)=>t.toLowerCase()).replace(/\s(\w)/g,(n,t)=>t.toUpperCase()).replace(/\s/g,""),v2=e=>{try{JSON.parse(e)}catch{return!1}return!0},sc=new Map,ps=async(e,n=null)=>{var s,l,u;const t=ac(),r=Ht();let o=200,i,a;try{const c=n,h=r.accountId.value||"";c.data&&t.activeStorefrontInfo&&!e.includes("CognitoActions")&&!e.includes("GetLoginInfo")&&!e.includes("query listUsers")&&!e.includes("UserActivityLog")&&(c.data.userType=((s=t.activeStorefrontInfo)==null?void 0:s.userType)||"",c.data.accountId=h||((l=t.activeStorefrontInfo)==null?void 0:l.accountId)||"",c.data.domain=r.hostName.value),!e.includes("GetLoginInfo")&&!e.includes("CognitoActions")&&!e.includes("query listUsers")&&!e.includes("UserActivityLog")&&(c.data={...c.data,domain:r.hostName.value});const d=ux([e,c,h]);if(sc.has(d))i=sc.get(d);else try{const g=await dt.post(r.graphqlEndpoint.value,{query:e,variables:c},{headers:{"Content-Type":"application/json","x-api-key":r.apiKey.value}});if(!g.data)return{statusCode:500,content:"Error fetching data from AppSync."};i=g.data.data,sc.set(d,i)}catch(g){const m=((u=g==null?void 0:g.response)==null?void 0:u.status)||500;return m===401&&console.info("401",e,n),{statusCode:m,content:"Error fetching data from AppSync."}}const p=vx(e);if(!p)return{statusCode:404,content:"Query name not found, improper request."};const f=bx(p);i=i[f],v2(i)&&(i=JSON.parse(i)),i&&i.statusCode&&i.statusCode===401&&console.info("401",e,n),a=i!=null&&i.content?i.content:i,v2(a)&&(a=JSON.parse(a))}catch(c){o=400,a=c}return{statusCode:o,content:a}},ms=G(""),b2=G(""),lc=G(""),_2=G(""),uc=G(""),Ni=G(""),Li=G(""),x2=G(""),C2=G(""),E2=G(""),k2=G(""),cc=G(""),A2=G(""),_x=G(!1),xx=G(null),Cx=G(null),w2=G(""),I2=G(""),S2=G(""),O2=G(""),T2=G("");function Ht(){function e(s){s.templateId!==void 0&&(ms.value=s.templateId),s.hostName!==void 0&&(b2.value=s.hostName),s.graphqlEndpoint!==void 0&&(lc.value=s.graphqlEndpoint),s.apiKey!==void 0&&(_2.value=s.apiKey),s.accountId!==void 0&&(uc.value=s.accountId),s.organizationId!==void 0&&(Ni.value=s.organizationId),s.storefrontId!==void 0&&(Li.value=s.storefrontId),s.cid!==void 0&&(x2.value=s.cid),s.userId!==void 0&&(C2.value=s.userId),s.composablesApiUrl!==void 0&&(E2.value=s.composablesApiUrl),s.composablesApiKey!==void 0&&(k2.value=s.composablesApiKey),s.accessToken!==void 0&&(cc.value=s.accessToken),s.composablesOrgType!==void 0&&(A2.value=s.composablesOrgType),s.isPreview!==void 0&&(_x.value=s.isPreview),s.sections!==void 0&&(xx.value=s.sections),s.theme!==void 0&&(Cx.value=s.theme),s.quoteId!==void 0&&(w2.value=s.quoteId),s.websocketUrl!==void 0&&(I2.value=s.websocketUrl),s.packageVersion!==void 0&&(S2.value=s.packageVersion),s.eCatalogId!==void 0&&(O2.value=s.eCatalogId),s.accountId!==void 0&&(uc.value=s.accountId),s.siteUrl!==void 0&&(T2.value=s.siteUrl)}const n=async()=>{var s,l;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!Li.value)try{const u=await ps(g2,{storefrontId:Li.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",u),((l=(s=u.content)==null?void 0:s.items)==null?void 0:l[0])??null}catch(u){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",u)}},t=async()=>{var s,l,u;try{const c=await nn({action:"retrieveMeta",data:{salesforceOrgId:Ni.value,storefrontId:ms.value,templateId:"wrapper",key:"theme"},config:{pathKey:"retrieveMeta"}}),h=((l=(s=c==null?void 0:c.data)==null?void 0:s[0])==null?void 0:l.value)??((u=c==null?void 0:c.data)==null?void 0:u.value);return console.log("[COMPOSABLECATALOG:fetchThemeREST] themeData",h),h??null}catch(c){throw console.log("[COMPOSABLECATALOG:fetchThemeREST] Error getting theme data",c),c}};return{hostName:b2,graphqlEndpoint:lc,apiKey:_2,accountId:uc,organizationId:Ni,storefrontId:Li,cid:x2,userId:C2,composablesApiUrl:E2,composablesApiKey:k2,accessToken:cc,composablesOrgType:A2,quoteId:w2,websocketUrl:I2,packageVersion:S2,eCatalogId:O2,siteUrl:T2,updateConfig:e,getTheme:n,fetchThemeREST:t,setThemeData:()=>{if(typeof document>"u")return;const s=Ni.value,l=Li.value;if(!s||!l)return;const u=`${Uo}/${s}/${l}/css/theme_${l}.css`;let c="";try{c=new URL(lc.value).origin}catch{}const h=typeof window<"u"?window.location.href:"",d=(f,g={})=>{const m=document.head||document.getElementsByTagName("head")[0];if(!m)return;let v=document.getElementById(f);v||(v=document.createElement("link"),v.id=f,m.appendChild(v)),Object.entries(g).forEach(([y,b])=>{b!=null&&v.setAttribute(y,String(b))})};((f,g,m=!0)=>{const v=document.head||document.getElementsByTagName("head")[0];if(!v||document.getElementById(f))return;const y=document.createElement("script");y.id=f,y.src=g,m&&(y.async=!0),v.appendChild(y)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),d("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),c&&d("ec-preconnect-appsync",{rel:"preconnect",href:c}),d("ec-theme-stylesheet",{rel:"stylesheet",href:u}),d("ec-google-fonts",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Symbols+Outlined|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Montserrat:300,400,500,600,700,800|Roboto:300,400,500,600,700,800|Abel|Caveat:400,700|Titillium+Web:400,600,700"}),h&&d("ec-canonical",{rel:"canonical",href:h}),d("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Uo}/expedite/Expedite_Favicon.ico`})},processSections:async(s,l)=>{const u=Fi();if(s&&l)try{const c=typeof l=="string"?JSON.parse(l):l;u.pageBlocks=c}catch(c){console.error("[ExpediteCart] Error parsing sections:",c)}else s||await u.fetchBlockInformationREST({templateId:ms.value||ms.value})},processTheme:async(s,l)=>{if(console.log("[COMPOSABLECATALOG:processTheme] isPreview",s),console.log("[COMPOSABLECATALOG:processTheme] theme",l),s&&l)try{return JSON.parse(l)}catch(u){return console.error("[ExpediteCart] Error parsing theme:",u),null}else if(!s)try{return await t()}catch(u){return console.error("[ExpediteCart] Error fetching theme:",u),null}return null},fetchAccessToken:async(s,l)=>{try{const u=(l==null?void 0:l.organizationId)||Ni.value||"",c=(s==null?void 0:s.version)||"",h=s==null?void 0:s.awsExternalMSBaseURL;if(!h)throw new Error("awsExternalMSBaseURL is required in awsConnectionInfo");const d=await nn({data:{Org_Id:u,Version:c},config:{baseUrl:h,pathKey:"fetchAccessToken"}});return console.log("fetchAccessToken - Response:",d),d!=null&&d.Access_Token&&(cc.value=d.Access_Token),d}catch(u){throw console.error("getAccessToken catch ::",u),console.error("Error details:",{message:u.message,stack:u.stack,name:u.name}),u}}}}const Ex=["href"],kx=x("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons","data-name":"ec-material-icons"},null,-1),Ax=x("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Outlined","data-name":"ec-material-icons-outlined"},null,-1),wx=x("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Round","data-name":"ec-material-icons-round"},null,-1),Ix=x("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200","data-name":"ec-material-symbols-outlined"},null,-1),D2={__name:"AtomThemeLoader",props:{organizationId:{type:String,required:!0},templateId:{type:String,required:!0},isPreview:{type:Boolean,required:!0},theme:{type:Object,required:!0}},setup(e){const n=e,t=Ht(),r=G(""),o=G(""),i=async()=>{if(!(!n.organizationId||!n.templateId))try{const a=await t.processTheme(n.isPreview,n.theme);a&&(r.value=a),t.setThemeData();const s=Date.now(),l=`${Uo}/${n.organizationId}/${n.templateId}/css/theme_${n.templateId}.css?t=${s}`;console.log("[ATOMTHEMELOADER:loadTheme] styleURL",l),o.value=l}catch(a){console.error("[ATOMTHEMELOADER:loadTheme] Error loading theme",a)}};return Jt(()=>{i()}),We(()=>[n.organizationId,n.templateId,n.isPreview,n.theme],()=>{i()},{deep:!0}),(a,s)=>(F(),q(De,null,[r.value?(F(),Oe(Mo("style"),{key:0,"data-name":"template-theme"},{default:ze(()=>[Ve(ke(r.value),1)]),_:1})):me("",!0),o.value?(F(),q("link",{key:1,rel:"stylesheet",href:o.value,"data-name":"ec-theme-stylesheet-link"},null,8,Ex)):me("",!0),kx,Ax,wx,Ix],64))}},Sx={KNOWLEDGE_DETAIL:"knowledgeDetail"},R2={"Catalog Price":"XX_ORD1__Negotiated_Price__c","List Price":"XX_ORD1__List_Price2__c"},Ox={name:"SkeletonLoader"},Tx={class:"skeleton-loader"};function Dx(e,n,t,r,o,i){return F(),q("div",Tx)}const Gn=Ne(Ox,[["render",Dx],["__scopeId","data-v-826b27ef"]]),rt=Ne({__name:"AtomCustomTag",props:{tag:{type:String,default:null},text:{type:[String,Number,Boolean],default:"-"},type:{type:String,default:null},method:{type:String,default:null},style:{type:Object,default:()=>({})},secStyle:{type:Object,default:()=>({})},cssStyle:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},inherit:{type:[Array,String],default:()=>[]}},setup(e){const n=e,t={h1:"ecb-header-lvl-1",h2:"ecb-header-lvl-2",h3:"ecb-header-lvl-3",h4:"ecb-header-lvl-4",h5:"ecb-header-lvl-5",h6:"ecb-header-lvl-6",p:"ecb-text-regular",span:"ecb-text-small",strong:"ecb-text-strong",large:"ecb-text-large"},r=G(!1),o=be(()=>{if(n.text===null||n.text===void 0)return"";const l=String(n.text);return(l==null?void 0:l.replace(/\r\n|\n/g,"<br>"))||""}),i=be(()=>{var u,c;const l=n.tag||((u=n.style)==null?void 0:u.tag)||((c=n.secStyle)==null?void 0:c.tag)||"p";return l==="large"||l==="strong"?"div":l}),a=be(()=>{var u;const l=n.tag||((u=n.style)==null?void 0:u.tag)||"p";return t[l]||"ecb-text-regular"}),s=be(()=>{var u,c;const l={};if(n.style&&((u=n.style)!=null&&u.overrite)){const{bold:h,color:d,italic:p,underline:f,strikethrough:g,strikeThrough:m,size:v,family:y,lineHeight:b}=n.style;h&&(l.fontWeight="700"),d&&(l.color=d),p&&(l.fontStyle="italic"),y&&(l.fontFamily=y),b&&(l.lineHeight=b),f?l.textDecoration="underline":(g||m)&&(l.textDecoration="line-through"),v&&(l.fontSize=v)}if(n.secStyle&&((c=n.secStyle)!=null&&c.overrite)){const{bold:h,color:d,italic:p,underline:f,strikethrough:g,strikeThrough:m,size:v,family:y,lineHeight:b}=n.secStyle;h&&(l.fontWeight="700"),d&&(l.color=d),p&&(l.fontStyle="italic"),y&&(l.fontFamily=y),b&&(l.lineHeight=b),f?l.textDecoration="underline":(g||m)&&(l.textDecoration="line-through"),v&&(l.fontSize=v)}for(const h of n.inherit)l[h]="inherit";return l});return(l,u)=>e.loading?(F(),q("div",{key:0,style:Re(e.cssStyle),class:"custom-tag-skeletion"},[pe(Gn)],4)):(F(),Oe(Mo(i.value),Bo({key:1},l.$attrs,{type:e.method,disabled:e.disabled,style:s.value,class:a.value,onMouseover:u[0]||(u[0]=c=>r.value=!0),onMouseout:u[1]||(u[1]=c=>r.value=!1),innerHTML:o.value}),null,16,["type","disabled","style","class","innerHTML"]))}},[["__scopeId","data-v-14a516b4"]]),Rx={key:1,class:"field-label"},Mx={class:"ect-flex ect-flex-col ect-justify-start"},Fx={key:0,class:"ect-pr-5"},Bx={key:1,class:"field-value ect-pr-5"},Nx={key:1,class:"field-value"},M2=Ne({__name:"AtomFieldAttribute",props:{tag:{type:String,default:"span"},field:{type:String,default:""},value:{type:Object,default:()=>({})},label:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},offer:{type:Object,default:()=>({})},itemCount:{type:Number,default:1},appliedOnOfferMatchingField:{type:Boolean,default:!1},showOfferDescription:{type:Boolean,default:!1},isProductSummary:{type:Boolean,default:!1},index:{type:Number,default:0},parentWidth:{type:Number,default:0}},setup(e){const n=_r(),t=e,r=be(()=>!1),o=be(()=>{var d;return t.offer.offerValue.offerId&&t.offer.offerValue.formattedOfferPrice||t.offer.offerValue.rpId&&((d=t.offer.offerValue.qtyTiers)==null?void 0:d.length)>0?!!t.appliedOnOfferMatchingField:!1}),i=be(()=>t.offer.offerDetails.styles.offerValue.textStyles.tag),a=be(()=>t.offer.offerDetails.styles.offerDescription.textStyles),s=be(()=>{var h,d;return(h=t.offer.offerValue)!=null&&h.qtyTiers?n.getVolumePrice(t.itemCount>0?t.itemCount:1,t.offer.offerValue):(d=t.offer.offerValue)==null?void 0:d.formattedOfferPrice}),l=be(()=>({"ect-flex ect-line-through":r.value&&t.offer.offerValue&&o.value})),u=be(()=>t.value&&(t.value.isStatic||!t.loading)),c=be(()=>(r.value&&!t.isProductSummary||t.isProductSummary&&t.index===0)&&t.showOfferDescription&&t.appliedOnOfferMatchingField);return(h,d)=>{var p,f;return F(),q("div",{class:Me([e.field,"field ect-gap-1 ect-flex ect-flex-col"])},[e.label?(F(),Oe(rt,{key:0,tag:(p=e.label.style)==null?void 0:p.tag,text:e.label.value,style:Re(e.label.style),class:Me(`${e.field}_label`)},null,8,["tag","text","style","class"])):(F(),q("div",Rx,[pe(Gn)])),x("div",Mx,[r.value&&t.offer.offerValue&&o.value?(F(),q("div",Fx,[pe(rt,{tag:i.value,text:s.value,style:Re(e.offer.offerDetails.styles.offerValue.textStyles),class:Me(`${e.field}_value`)},null,8,["tag","text","style","class"])])):r.value&&!t.offer.offerValue?(F(),q("div",Bx,[pe(Gn)])):me("",!0),x("div",{class:Me(l.value)},[u.value?(F(),Oe(rt,{key:0,tag:(f=e.value.style)==null?void 0:f.tag,text:e.value.value,style:Re(e.value.style),class:Me(`${e.field}_value`)},null,8,["tag","text","style","class"])):(F(),q("div",Nx,[pe(Gn)]))],2)]),c.value?(F(),q("div",{key:2,class:"field-description ect-left-0 ect-w-max ect-pt-2",style:Re({maxWidth:e.parentWidth?e.parentWidth+"px":void 0})},[pe(rt,{tag:a.value.tag,text:t.offer.offerValue.offerDescShort,style:Re(a.value),class:Me(e.field+"_value")},null,8,["tag","text","style","class"])],4)):me("",!0)],2)}}},[["__scopeId","data-v-b0e72386"]]),Lx={key:1,class:"filter"},Px={class:"filter-title"},qx={key:0,class:"filter-desc"},$x={key:1,class:"filter-desc"},Ux={key:2,class:"filter-desc"},F2=Ne({__name:"AtomProductText",props:{title:{type:Object,default:()=>({})},description:{type:Object,default:null},loading:{type:Boolean,default:!1},url:{type:String,default:null}},setup(e){const n=Va(),t=e;function r(){t.url&&!t.loading&&n.push(t.url)}return(o,i)=>e.loading?(F(),q("div",Lx,[x("div",Px,[pe(Gn)]),e.description?(F(),q("div",qx,[pe(Gn)])):me("",!0),e.description?(F(),q("div",$x,[pe(Gn)])):me("",!0),e.description?(F(),q("div",Ux,[pe(Gn)])):me("",!0)])):(F(),q(De,{key:0},[e.title?(F(),Oe(rt,{key:0,class:Me({"ect-cursor-pointer":e.url}),text:e.title.value,style:Re(e.title.style),onClick:r},null,8,["class","text","style"])):me("",!0),e.description?(F(),Oe(rt,{key:1,text:e.description.value,style:Re(e.description.style)},null,8,["text","style"])):me("",!0)],64))}},[["__scopeId","data-v-5b4d627e"]]),jx={name:"Spinner"},Hx={class:"spinner"};function Vx(e,n,t,r,o,i){return F(),q("div",Hx)}const Pi=Ne(jx,[["render",Vx],["__scopeId","data-v-83f8c910"]]),zx={name:"AtomSkeletonWidget",components:{AtomSkeletonLoader:Gn,AtomSpinner:Pi},props:{rows:{type:Number,default:4},type:{type:String,default:"full"},className:{type:String,default:""}},data(){return{SKELETON_TYPE:Sx}}},dc=e=>(Qt("data-v-956cc081"),e=e(),Zt(),e),Kx={key:0,class:"page"},Gx=dc(()=>x("div",{class:"page-header"},null,-1)),Xx={class:"page-body"},Wx={class:"page-body_board"},Qx={key:1,class:"field"},Zx={key:2,class:"filter"},Jx={class:"filter-option_inner"},Yx={key:3,class:"full"},eC={key:4,class:"shuttle"},tC={class:"shuttle-full"},nC={class:"shuttle-full"},rC={class:"shuttle-half"},oC={class:"shuttle-half"},iC={class:"shuttle-button"},aC={key:5,class:"shuttle2"},sC={class:"shuttle2-full"},lC=dc(()=>x("span",null,"Processing payment",-1)),uC={key:6,class:"shuttle2"},cC={class:"shuttle2-full"},dC=dc(()=>x("span",null,"Processing order",-1)),fC={key:10,class:"skeleton-shipping"},hC={class:"skeleton-shipping-full"},pC={class:"skeleton-shipping-half"},mC={key:11,class:"skeleton-terms"},gC={class:"skeleton-terms-half"},yC={class:"skeleton-terms-full"},vC={class:"skeleton-terms-full"},bC={key:12,class:""},_C={class:"skeleton-terms-half"},xC={key:13,class:""},CC={class:"skeleton-terms-half"},EC={key:14,class:"product"},kC={class:"product-image"},AC={class:"product-texts"},wC={class:"product-description"},IC={class:"product-action"},SC={class:"product-button"},OC={key:15,class:""};function TC(e,n,t,r,o,i){const a=fn("AtomSkeletonLoader"),s=fn("AtomSpinner");return t.type==="page"?(F(),q("div",Kx,[Gx,x("div",Xx,[x("div",Wx,[pe(a)])])])):t.type==="fieldattribute"?(F(),q("div",Qx,[pe(a)])):t.type==="filteroptions"?(F(),q("div",Zx,[(F(!0),q(De,null,Le(t.rows,l=>(F(),q("div",{key:l,class:"filter-option"},[x("div",Jx,[pe(a)])]))),128))])):t.type==="full"?(F(),q("div",Yx,[pe(a)])):t.type==="shuttle"?(F(),q("div",eC,[x("div",tC,[pe(a)]),x("div",nC,[pe(a)]),x("div",rC,[pe(a)]),x("div",oC,[pe(a)]),x("div",iC,[pe(a)])])):t.type==="shuttle-done"?(F(),q("div",aC,[x("div",sC,[pe(s,{class:"shuttle2-spinner"}),Ve(),lC])])):t.type==="order-processing"?(F(),q("div",uC,[x("div",cC,[pe(s,{class:"shuttle2-spinner"}),Ve(),dC])])):t.type==="enhanceFilter"?(F(),q("div",{key:7,class:Me(t.className)},[pe(a)],2)):t.type==="offers"?(F(),q("div",{key:8,class:Me(t.className)},[pe(a)],2)):t.type==="detailPage"?(F(),q("div",{key:9,class:Me(t.className)},[pe(a)],2)):t.type==="shippingAddress"?(F(),q("div",fC,[x("div",hC,[pe(a)]),x("div",pC,[pe(a)])])):t.type==="termsAndPayment"?(F(),q("div",mC,[x("div",gC,[pe(a)]),x("div",yC,[pe(a)]),x("div",vC,[pe(a)])])):t.type==="accordian-title"?(F(),q("div",bC,[x("div",_C,[pe(a)])])):t.type==="imageDiv"?(F(),q("div",xC,[x("div",CC,[pe(a)])])):t.type==="product-detail"?(F(),q("div",EC,[x("div",kC,[pe(a)]),x("div",AC,[pe(a)]),x("div",wC,[pe(a)]),x("div",IC,[(F(!0),q(De,null,Le(t.rows,l=>(F(),q("div",{key:l,class:"product-action_item"},[pe(a)]))),128))]),x("div",SC,[pe(a)])])):t.type===o.SKELETON_TYPE.KNOWLEDGE_DETAIL?(F(),q("div",OC,[pe(a,{class:Me(t.className)},null,8,["class"])])):me("",!0)}const xr=Ne(zx,[["render",TC],["__scopeId","data-v-956cc081"]]),DC=["src"],fc={__name:"AtomImage",props:{src:{type:String,default:""},resourcesDomain:{type:String,default:""},placeholder:{type:String,default:""},height:{type:Number,default:200},width:{type:Number,default:200},loading:{type:Boolean,default:!1},sizes:{type:String}},setup(e){const n=Ht(),t=e,r=be(()=>t.src.includes("/resource/")&&!t.src.includes("://")&&t.resourcesDomain?t.resourcesDomain+t.src:t.src.includes("/servlet/servlet.ImageServer")&&!t.src.includes("://")&&t.resourcesDomain?t.resourcesDomain+"/"+t.src:t.src.includes("/servlet/servlet.ImageServer")&&!t.src.includes("://")&&n.siteUrl?n.siteUrl.value+"/"+t.src:t.src);return(o,i)=>e.loading?(F(),Oe(xr,{key:0,type:"full"})):e.src?(F(),q("img",{key:1,src:r.value,placeholder:[30,20],class:"rounded",sizes:"props.sizes"},null,8,DC)):me("",!0)}},RC={class:"counter"},MC=["disabled"],FC={key:0,class:"counter-spinner"},BC=["max","disabled","value"],NC=["disabled"],gs=Ne({__name:"AtomButtonCounter",props:{min:{type:Number,default:0},max:{type:Number,default:999},modelValue:{type:Number,default:1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},decimal:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(e,{emit:n}){const t=e,r=n,o=be(()=>t.disabled||t.loading),i=pn(function(u){const c=String(u??"");if(c==="")return;const h=Number(c);Number.isNaN(h)||r("update:modelValue",h)}),a=u=>{(u.key==="."||u.key==="e"||u.key==="E")&&!u.ctrlKey&&!u.metaKey&&t.decimal&&u.preventDefault()};function s(){t.modelValue<t.max&&r("update:modelValue",t.modelValue+1)}function l(){t.modelValue>t.min&&r("update:modelValue",t.modelValue-1)}return(u,c)=>(F(),q("div",RC,[x("button",{disabled:e.modelValue<=e.min||o.value,onClick:l},[pe(Ge,{icon:e.modelValue>1?"minus":"close",size:10},null,8,["icon"])],8,MC),e.loading?(F(),q("div",FC,[pe(Pi,{class:"item-button_spinner"})])):(F(),q("input",{key:1,type:"number",min:"0",max:e.max,disabled:o.value,value:e.modelValue,step:"1",onInput:c[0]||(c[0]=h=>Te(i)(h.target.value)),onKeydown:a},null,40,BC)),x("button",{disabled:e.modelValue>=e.max||o.value,onClick:s},[pe(Ge,{class:"ect-transform ect-rotate-45",icon:"add",size:12})],8,NC)]))}},[["__scopeId","data-v-886bff8a"]]),B2=G(!1),N2=G(!1),L2=G(!1),P2=G(!1),hc=()=>{if(typeof window<"u"){const e=()=>{const n=window.innerWidth;N2.value=n<768,L2.value=n>=768&&n<1024,P2.value=n>=1024};Et(()=>{B2.value||(B2.value=!0,window.addEventListener("resize",e),e())})}return{isMobile:N2,isTablet:L2,isDesktop:P2}},LC=["disabled"],PC=["disabled"],qC={class:"ect-w-max"},$C={class:"button-header-icon"},UC=["onClick"],jC={key:0,class:"button-options_item-icon"},HC=["disabled"],VC={class:"ect-w-max"},zC={class:"button-header-icon"},KC=["onClick"],GC={key:0,class:"button-options_item-icon"},q2=Ne({__name:"AtomButtonMenu",props:{icon:{type:String,default:null},select:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:{type:String,default:null},options:{type:Array,default:()=>[]}},emits:["selected"],setup(e,{emit:n}){const t=e,r=hc(),o=G(!1),i=G(null),a=G({}),s=G(!1),l=n;function u(g){g.stopPropagation(),o.value=!o.value}function c(g){g.stopPropagation(),o.value=!o.value,s.value=G(o.value)}function h(g){l("selected",g),o.value=!1}function d(){!r.isMobile.value&&!t.disabled&&(o.value=!0)}function p(){!r.isMobile.value&&!s.value&&(o.value=!1)}function f(g){o.value&&(o.value=!1,s.value=!1)}return Et(()=>{document.addEventListener("click",f)}),Oa(()=>{document.removeEventListener("click",f)}),(g,m)=>{var v;return e.options.length===1?(F(),q("button",{key:0,class:"esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:e.disabled,onClick:m[0]||(m[0]=y=>g.$emit("selected",e.options[0]))},[x("span",null,ke(((v=e.options[0].label)==null?void 0:v.value)||e.options[0].name),1)],8,LC)):e.options.length>1?(F(),q(De,{key:1},[Te(r).isMobile.value?(F(),q(De,{key:0},[x("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:e.disabled,onClick:kt(u,["stop"])},[x("span",qC,ke(e.name||e.options[0].name),1),x("div",$C,[pe(Ge,{icon:"arrow_drop_down",class:"ect-relative ect-top-0.5 ect-ml-2",color:"#ffffff",size:"14"})])],8,PC),!e.disabled&&e.options.length&&o.value?(F(),q("div",{key:0,class:"button-options",onClick:m[2]||(m[2]=kt(()=>{},["stop"]))},[x("div",{class:"button-options_grow",onClick:m[1]||(m[1]=y=>o.value=!1)}),(F(!0),q(De,null,Le(e.options,y=>(F(),q("div",{key:y,class:"button-options_item",onClick:b=>h(y)},[y.selected&&e.select?(F(),q("div",jC,[pe(Ge,{icon:"done",size:20,color:"black"})])):me("",!0),Ve(" "+ke(y.name),1)],8,UC))),128))])):me("",!0)],64)):(F(),q("div",{key:1,class:"button-container",onMouseenter:d,onMouseleave:p},[x("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",ref_key:"btnmenu",ref:i,disabled:e.disabled,onClick:kt(c,["stop"])},[x("span",VC,ke(e.name||e.options[0].name),1),x("div",zC,[pe(Ge,{class:"ect-relative ect-top-0.5 ect-ml-2",icon:"arrow_drop_down",color:"#ffffff",size:"14"})])],8,HC),!e.disabled&&e.options.length&&o.value?(F(),q("div",{key:0,style:Re(a.value),class:"button-options",onClick:m[3]||(m[3]=kt(()=>{},["stop"]))},[(F(!0),q(De,null,Le(e.options,y=>{var b;return F(),q("div",{key:y,class:"button-options_item",onClick:_=>g.$emit("selected",y)},[y.selected&&e.select?(F(),q("div",GC,[pe(Ge,{icon:"done",size:20,color:"black"})])):me("",!0),Ve(" "+ke(((b=y.label)==null?void 0:b.value)||y.name),1)],8,KC)}),128))],4)):me("",!0)],32))],64)):me("",!0)}}},[["__scopeId","data-v-cfcf21a3"]]),XC={class:"ect-flex ect-flex-col ect-w-full"},WC={key:0,class:"ect-h-[20px] ect-w-[150px]"},QC={key:1,class:"ect-flex ect-flex-col ect-gap-1"},ZC=Ne({__name:"MoleculeProductItem",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(e){var v,y;const n=ac(),t=_r(),r=e,o=G(((y=(v=t.savedItems)==null?void 0:v[r.itemId])==null?void 0:y.XX_ORD1__QTY__c)||0),i=G(!1),a=G(null),s=G(!1),l=G(!1),u=be(()=>r.actions&&r.actions.length>0),c=be(()=>r.actions.some(b=>b.action==="ADD_TO_CART")),h=be(()=>{var b,_,C;return(b=r.offer)!=null&&b.appliedOnField?R2[(_=r.offer)==null?void 0:_.appliedOnField]===((C=r.offerSetting.value)==null?void 0:C.field):!0});We(()=>t.savedItems,b=>{var _,C;b[r.itemId]&&!l.value&&((_=b[r.itemId])==null?void 0:_.XX_ORD1__QTY__c)!==o.value&&(o.value=((C=b[r.itemId])==null?void 0:C.XX_ORD1__QTY__c)||0,l.value=!0)},{deep:!0});function d(b){var _;l.value=!0,b===0&&((_=t.savedItems)!=null&&_[r.itemId])?f():m()}const p=b=>{var _;b.action==="ADD_TO_CART"?(l.value=!0,o.value=1,g()):b.action==="CONFIGURE"?rn("catalog:item-configure-clicked",{itemId:r.itemId,catalogItemId:r.catalogItemId,title:r.title,description:r.description,attributes:r.attributes,thumbnail:r.thumbnail,url:r.url,mode:r.mode,isPreview:r.isPreview}):b.action==="CUSTOM"?window.open(((_=b.url)==null?void 0:_.value)||b.value,b.newTab?"_blank":"_self"):b.action==="ORDER_PARTS"||b.action},f=async function(){i.value=!0,a.value=null;const b=[t.savedItems[r.itemId].Id];await t.deleteLineItems(b),i.value=!1},g=async function(){i.value=!0,a.value=null;const b={itemID:r.itemId,eCatalogItemID:r.catalogItemId,qty:o.value,qtyTierAmt:null};await t.saveItemToQuoteBlinkTxn(b),i.value=!1},m=pn(async function(){console.log("updateToCart 1",o.value),s.value=!0,await t.updateQuoteLineQtyTxn({itemId:r.itemId,qty:o.value,eCatalogItemId:r.catalogItemId}),s.value=!1});return(b,_)=>{var C,k;return F(),q("div",{class:Me("item ecb-theme-card "+e.mode)},[x("div",{class:Me(`item-image ${e.mode}-image`)},[pe(fc,{src:e.thumbnail.value,loading:e.loading,"resources-domain":Te(n).storefrontDetails.resourcesDomain},null,8,["src","loading","resources-domain"])],2),x("div",{class:Me(`item-text ${e.mode}-text`)},[pe(F2,{title:e.title,loading:e.loading,description:e.description},null,8,["title","loading","description"])],2),x("div",XC,[x("div",{class:Me(`item-attributes ${e.mode}-attributes`)},[(F(!0),q(De,null,Le(r.attributes,(E,S)=>(F(),Oe(M2,{key:S,class:Me(`item-attributes_field ${e.mode}-attributes_field`),loading:e.loading,value:E.value,label:E.label,field:E.value.field,offer:{applyOffer:E.applyOffer,offerDetails:E.offerDetails,offerValue:r.offer},"item-count":o.value,"applied-on-offer-matching-field":h.value},null,8,["class","loading","value","label","field","offer","item-count","applied-on-offer-matching-field"]))),128))],2),r.offerSetting&&h.value&&((C=r.offer)!=null&&C.offerDescShort)?(F(),q("div",{key:0,class:Me(`${e.mode}-offer-banner`)},[pe(rt,{tag:e.offerSetting.offerDetails.styles.offerDescription.textStyles.tag,text:(k=r.offer)==null?void 0:k.offerDescShort,style:Re(e.offerSetting.offerDetails.styles.offerDescription.textStyles),class:Me(b.field+"_value")},null,8,["tag","text","style","class"])],2)):me("",!0)]),u.value?(F(),q("div",{key:0,class:Me([`item-button ${e.mode}-button`,"ect-flex ect-flex-col ect-gap-2"])},[e.loading||e.applyOffer&&!r.offer?(F(),q("div",WC,[pe(Gn)])):(F(),q(De,{key:1},[i.value?(F(),Oe(Pi,{key:0,class:"item-button_spinner"})):(F(),q("div",QC,[o.value>0&&!e.loading&&c.value?(F(),Oe(gs,{key:0,modelValue:o.value,"onUpdate:modelValue":[_[0]||(_[0]=E=>o.value=E),d],loading:s.value,disabled:e.isPreview},null,8,["modelValue","loading","disabled"])):(F(),Oe(q2,{key:1,icon:"arrow_drop_down",disabled:e.loading||e.isPreview,options:e.actions,onSelected:_[1]||(_[1]=E=>p(E))},null,8,["disabled","options"]))]))],64))],2)):me("",!0)],2)}}},[["__scopeId","data-v-e3d55bd3"]]),JC={class:"item"},YC={class:"item-text"},eE={class:"item-attributes"},tE={key:0,class:"item-button"},nE={key:1,class:"ect-flex ect-flex-col ect-gap-1"},rE=Ne({__name:"MoleculeProductItemTable",props:{title:{type:Object,default:()=>({})},actions:{type:Array,default:()=>[]},description:{type:Object,default:()=>({})},thumbnail:{type:Object,default:()=>({})},attributes:{type:Array,default:()=>[]},itemId:{type:String,default:null},mode:{type:String,default:"vertical"},catalogItemId:{type:String,default:null},loading:{type:Boolean,default:!1},templateId:{type:String,default:null},url:{type:String,default:null},applyOffer:{type:Boolean,default:!1},offerSetting:{type:Object,default:null},offer:{type:Object,default:null},isPreview:{type:Boolean,default:!1}},setup(e){var g,m;const n=_r(),t=e,r=G(((m=(g=n.savedItems)==null?void 0:g[t.itemId])==null?void 0:m.XX_ORD1__QTY__c)||0),o=G(!1),i=G(!1),a=G(!1),s=be(()=>t.actions&&t.actions.length>0),l=be(()=>t.actions.some(v=>v.action==="ADD_TO_CART")),u=be(()=>{var v,y,b;return(v=t.offer)!=null&&v.appliedOnField?R2[(y=t.offer)==null?void 0:y.appliedOnField]===((b=t.offerSetting.value)==null?void 0:b.field):!0});We(()=>n.savedItems,v=>{var y,b;v[t.itemId]&&!i.value&&((y=v[t.itemId])==null?void 0:y.XX_ORD1__QTY__c)!==r.value&&(r.value=((b=v[t.itemId])==null?void 0:b.XX_ORD1__QTY__c)||0,i.value=!0)},{deep:!0});function c(v){var y;i.value=!0,v===0&&((y=n.savedItems)!=null&&y[t.itemId])?d():f()}const h=v=>{var y;v.action==="ADD_TO_CART"?(i.value=!0,r.value=1,p()):v.action==="CONFIGURE"?rn("catalog:item-configure-clicked",{itemId:t.itemId,catalogItemId:t.catalogItemId,title:t.title,description:t.description,attributes:t.attributes,thumbnail:t.thumbnail,url:t.url,offer:t.offer,mode:t.mode,isPreview:t.isPreview}):v.action==="CUSTOM"?window.open(((y=v.url)==null?void 0:y.value)||v.value,v.newTab?"_blank":"_self"):v.action==="ORDER_PARTS"||v.action},d=async function(){o.value=!0;const v=[n.savedItems[t.itemId].Id];await n.deleteLineItems(v),delete n.savedItems[t.itemId],o.value=!1},p=async function(){o.value=!0;const v={itemID:t.itemId,eCatalogItemID:t.catalogItemId,qty:r.value,qtyTierAmt:null};await n.saveItemToQuoteBlinkTxn(v),o.value=!1},f=pn(async function(){console.log("updateToCart 2",r.value),a.value=!0,await n.updateQuoteLineQtyTxn({itemId:t.itemId,qty:r.value,eCatalogItemId:t.catalogItemId}),a.value=!1},800);return(v,y)=>(F(),q("div",JC,[x("div",YC,[pe(F2,{url:e.url,title:e.title,loading:e.loading},null,8,["url","title","loading"])]),x("div",eE,[(F(!0),q(De,null,Le(t.attributes,b=>{var _;return F(),Oe(M2,{key:b.field,class:Me(`item-attributes_field ${e.mode}-attributes_field`),loading:e.loading,value:b.value,label:b.label,offer:{applyOffer:b.applyOffer,offerDetails:b.offerDetails,offerValue:t.offer},"item-count":r.value,"applied-on-offer-matching-field":u.value,"show-offer-description":!!((_=t.offer)!=null&&_.offerDescShort)},null,8,["class","loading","value","label","offer","item-count","applied-on-offer-matching-field","show-offer-description"])}),128))]),s.value?(F(),q("div",tE,[o.value?(F(),Oe(Pi,{key:0,class:"item-button_spinner"})):(F(),q("div",nE,[r.value>0&&!e.loading&&l.value?(F(),Oe(gs,{key:0,modelValue:r.value,"onUpdate:modelValue":[y[0]||(y[0]=b=>r.value=b),c],loading:a.value,disabled:e.isPreview},null,8,["modelValue","loading","disabled"])):(F(),Oe(q2,{key:1,icon:"arrow_drop_down",disabled:e.loading||e.isPreview,options:e.actions,onSelected:y[1]||(y[1]=b=>h(b))},null,8,["disabled","options"]))]))])):me("",!0)]))}},[["__scopeId","data-v-b679176d"]]),oE=["placeholder"],iE={key:0,class:"srch-error"},aE={class:"srch-option_lst-main"},sE={class:"italic"},lE={class:"srch-option_lst-sugg"},uE={class:"italic"},cE={class:"srch-option_lst-main"},dE={class:"italic"},fE={class:"srch-option_lst-sugg"},hE={class:"italic"},pE={class:"srch-option_lst-main"},mE={class:"italic"},gE={class:"srch-option_lst-sugg"},yE={class:"italic"},vE={key:1,class:"search1"},bE={class:"search-container_header"},_E={class:"search-container_header_input ectheme-input-box"},xE=["placeholder","value"],CE=Ne({__name:"BlinkMoleculeSearch",props:{placeholder:{type:String,default:""},modelValue:{type:String,default:""},suggestion:{type:Boolean,default:!1},showSearchIconAlways:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},enableSearchClick:{type:Boolean,default:!1}},emits:["update:modelValue","enter"],setup(e,{emit:n}){const t=n;let r;const o=G(""),i=G(!1),a=G(!1),s=G(null),l=()=>{s.value=null,o.value="",t("update:modelValue",""),t("enter")},u=g=>{o.value.length>1?(g.target.blur(),h(o.value+"*")):s.value="Search text must be more than one character.",i.value=!1},c=()=>{a.value||(s.value=null,o.value.length>1?h(o.value+"*"):o.value.length===1&&(s.value="Search text must be more than one character."),i.value=!1)},h=g=>{t("update:modelValue",g),i.value=!1,a.value=!1},d=g=>{const m=g.target.value;s.value=null,m.length||t("update:modelValue","")},p=()=>{t("enter")},f=g=>{var v;r&&(clearTimeout(r),r=null);const m=((v=g==null?void 0:g.target)==null?void 0:v.value)??"";r=setTimeout(()=>{t("update:modelValue",m)},500)};return(g,m)=>e.suggestion?(F(),q("div",{key:0,class:"srch",tabindex:"0",onFocusin:m[6]||(m[6]=v=>i.value=!0),onFocusout:c,onKeydown:Hn(u,["enter"])},[x("div",{class:Me(["srch-inp",{"srch-error-border":s.value}])},[An(x("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>o.value=v),type:"search",placeholder:e.placeholder,onInput:d},null,40,oE),[[po,o.value]]),pe(Ge,{icon:o.value?"close":"search",size:14,color:s.value?"red":"#acacac",onClick:l},null,8,["icon","color"])],2),s.value?(F(),q("div",iE,[x("span",null,ke(s.value),1)])):me("",!0),o.value.length>1&&i.value?(F(),q("div",{key:1,class:"srch-option",onMouseover:m[4]||(m[4]=v=>a.value=!0),onMouseout:m[5]||(m[5]=v=>a.value=!1)},[x("div",{class:"srch-option_lst",onClick:m[1]||(m[1]=v=>h(o.value+"*"))},[x("div",aE,[Ve(" Search for "),x("span",sE,ke(o.value)+"*",1)]),x("div",lE,[Ve(" word that starts with "),x("span",uE,ke(o.value)+"*",1)])]),x("div",{class:"srch-option_lst",onClick:m[2]||(m[2]=v=>h(o.value))},[x("div",cE,[Ve(" Search for "),x("span",dE,'"'+ke(o.value)+'"',1)]),x("div",fE,[Ve(" search exactly for "),x("span",hE,'"'+ke(o.value)+'"',1)])]),x("div",{class:"srch-option_lst",onClick:m[3]||(m[3]=v=>h("*"+o.value+"*"))},[x("div",pE,[Ve(" Search for "),x("span",mE,"*"+ke(o.value)+"*",1)]),x("div",gE,[Ve(" word that includes "),x("span",yE,"*"+ke(o.value)+"*",1)])])],32)):me("",!0)],32)):(F(),q("div",vE,[x("div",bE,[x("div",_E,[x("input",{class:"",type:"search",placeholder:e.placeholder,value:e.modelValue,onInput:f,onKeyup:Hn(p,["enter"])},null,40,xE),e.loading?(F(),Oe(Pi,{key:0})):me("",!0),e.modelValue?(F(),Oe(Ge,{key:1,icon:"close",size:12,color:"#acacac",onClick:l})):me("",!0),e.enableSearchClick||!e.modelValue?(F(),Oe(Ge,{key:2,class:"ect-relative ect-top-[-1px]",icon:"search",size:14,color:"#acacac",onClick:p})):me("",!0)])])]))}},[["__scopeId","data-v-31366d17"]]),$2=e=>(Qt("data-v-01d2d3f1"),e=e(),Zt(),e),EE=["id"],kE={key:0,class:"product-search"},AE={key:1,class:"product-not-found"},wE=$2(()=>x("span",{class:"product-not-found_icon material-symbols-outlined"}," error ",-1)),IE=$2(()=>x("span",{class:"product-not-found_text"},"No results found",-1)),SE={key:2,class:"product-item"},OE=20,TE=Ne({__name:"MoleculeProductBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},request:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},catalogType:{type:String,required:!0},blockId:{type:String,default:""},accountId:{type:String,default:null},searchText:{type:String,default:""},onCountUpdate:{type:Function,default:null},hideHeader:{type:Boolean,default:!1},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(e,{expose:n}){const t=Ht(),r=["vertical","horizontal","square","table"],o=e,i=G(Math.floor(Math.random()*1e9)),a=G(null),s=_r(),l=G(1),u=G(!0),c=G(!0),h=G(!1);G(!1);const d=G([]),p=G(0),f=G(o.request);let g=200;const m=G(o.searchText||""),v=be(()=>o.initialItems||[]),y=be(()=>!!(m.value||o.searchText));function b(O,R,M){const N=M==="Item",H=[];return O.forEach(L=>{var j,W;const z=JSON.parse(JSON.stringify(R));try{N?z.itemId=L.Id:(z.itemId=L.XX_ORD1__Item__c,z.catalogItemId=L.Id);const{description:Q,thumbnail:ae,title:fe,attributes:K,actions:V}=z;ae!=null&&ae.field&&!ae.isStatic&&(ae.value=vt(L,ae.field)),fe!=null&&fe.field&&!fe.isStatic&&(fe.value=vt(L,fe.field)),Q!=null&&Q.field&&!Q.isStatic&&(Q.value=vt(L,Q.field)),(K||[]).forEach(oe=>{var le,ne;(le=oe==null?void 0:oe.value)!=null&&le.field&&!oe.value.isStatic&&(oe.value.value=vt(L,oe.value.field,oe.value.dataType)||"-"),(ne=oe==null?void 0:oe.label)!=null&&ne.field&&!oe.label.isStatic&&(oe.label.value=vt(L,oe.label.field,oe.label.dataType)||"-")}),(V||[]).forEach(oe=>{oe.action==="CUSTOM"&&(oe.url&&!oe.url.isStatic&&(oe.url.value=vt(L,oe.url.field)),oe.label&&!oe.label.isStatic&&(oe.label.value=vt(L,oe.label.field)))});try{const oe=N?vt(L,"XX_ORD1__SYS_Requires_Configuration__c"):vt(L,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");z.requiresConfiguration=oe}catch{}const te=N?vt(L,"XX_ORD1__Friendly_URL__c"):vt(L,"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c");((j=z.friendlyURLFields)==null?void 0:j.length)>0&&te?((W=z.friendlyURLFields)==null||W.forEach(oe=>{z.friendlyURL=(z.friendlyURL||"").replace(`{!${oe}}`,vt(L,oe))}),z.friendlyURL="/"+(z.friendlyURL||"")+"/"+te):z.url&&(z.friendlyURL=z.url+"/"+((L==null?void 0:L.Id)||"")),z.friendlyURL&&(z.friendlyURL=z.friendlyURL.replace(/\/{2,}/g,"/"))}catch{}H.push(z)}),H}const _=G(null),C=G(null),k=be(()=>{}),E=be(()=>{var O;return(O=o.fields)==null?void 0:O.header});be(()=>{var O;return((O=E.value)==null?void 0:O.mainHeading)||{}}),be(()=>{var O;return((O=E.value)==null?void 0:O.subHeading)||{}});const S=be(()=>{var O;return d.value.length>0?d.value:Array(D.value).fill((O=o.fields)==null?void 0:O.productCard)}),D=be(()=>Number(o.configuration.displaySettings.itemsPerPage||OE)),I=be(()=>Number(o.configuration.displaySettings.lazyLoadBatch)),A=be(()=>{var O;return((O=o.configuration.productItemOrientation)==null?void 0:O.toLowerCase())||"vertical"}),w=G(r.includes(A.value)?_.value||A.value:"vertical"),T=be(()=>d.value.length<1&&!c.value),P=be(()=>`product-${w.value} width-${C.value?C.value:o.configuration.displaySettings.columns||1}`),X=be(()=>o.configuration.displaySettings.enableSearch),$=G(null),J=G(!1),ee=G({});We(l,(O,R)=>{O!==R&&(console.log("[fetchProducts] 1"),Y(!0))}),We($,O=>{O!==null&&o.onCountUpdate&&o.onCountUpdate(O)}),We(m,()=>{l.value=1,console.log("[fetchProducts] 2"),Y(!0)}),We(()=>o.searchText,(O,R)=>{O!==R&&(m.value=O||"")});const Y=pn(async function(O){var H;if(g=600,h.value=!0,v.value&&v.value.length>0&&!y.value){const L=b(v.value,(H=o.fields)==null?void 0:H.productCard,o.catalogType);d.value=L,$.value=L.length,c.value=!1,h.value=!1;try{rn("catalog:items-loaded",{items:L,count:L.length})}catch{}O&&a.value&&a.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});return}c.value=!0;let M=D.value;I.value<M&&I.value>0&&(M=I.value);const N={...f.value,accountID:o.accountId,rowLimit:M,searchText:m.value||o.searchText,rowOffSet:D.value*(l.value-1)};O&&a.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),t.quoteId.value?s.getQuoteItems(!0).then(L=>{h.value=!1}).catch(L=>{console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching line items",L),h.value=!1}).finally(()=>{h.value=!1}):h.value=!1;try{const L=await s.getProductItems(N,o.fields.productCard,o.catalogType);if(L){u.value=L.items.length===M,$.value=L.count,d.value=L.items,p.value=Math.ceil(L.count/D.value);try{rn("catalog:items-loaded",{items:L.items,count:L.count})}catch{}}console.log("[MOLECULEPRODUCTBLOCK:fetchProducts] prodData",L)}catch(L){console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching products",L)}finally{c.value=!1,h.value=!1}},g);async function U(){const{mainHeading:O,subHeading:R}=o.fields.header;if(!O.isStatic&&O.field||!R.isStatic&&R.field){const M=[];O.isStatic?O.value=O.title:M.push(O.field),R.isStatic?R.value=R.title:M.push(R.field);const N={...f.value,accountID:o.accountId,fields:M},H=await s.getEcatalogDetails(N);O.isStatic||(O.value=H[O.field],O.isStatic=!0),R.isStatic||(R.value=H[R.field],R.isStatic=!0)}else O.value=O.title,R.value=R.title}return n({currentPage:l,fetchProducts:Y}),Et(()=>{Y(),U()}),(O,R)=>(F(),q("div",{id:i.value,ref_key:"productBlock",ref:a,class:"product"},[X.value&&k.value===void 0&&!e.hideHeader?(F(),q("div",kE,[pe(CE,{modelValue:m.value,"onUpdate:modelValue":R[0]||(R[0]=M=>m.value=M),placeholder:"Search products..."},null,8,["modelValue"])])):me("",!0),lt(O.$slots,"default",{},void 0,!0),T.value?(F(),q("div",AE,[wE,Ve(),IE])):(F(),q("div",SE,[w.value==="table"?(F(!0),q(De,{key:0},Le(S.value,M=>(F(),q("div",{key:(M==null?void 0:M.catalogItemId)||(M==null?void 0:M.itemId),class:"product-item_table"},[pe(rE,{class:"ecb-theme-card","item-id":M==null?void 0:M.itemId,"catalog-item-id":M==null?void 0:M.catalogItemId,loading:c.value||h.value,mode:w.value,title:M==null?void 0:M.title,attributes:M==null?void 0:M.attributes,actions:M==null?void 0:M.actions,thumbnail:{value:M==null?void 0:M.thumbnail.value},description:M==null?void 0:M.description,url:M==null?void 0:M.friendlyURL,"template-id":e.configuration.productTemplateId,"apply-offer":J.value,"offer-setting":ee.value,offer:M==null?void 0:M.offer,"is-preview":e.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","apply-offer","offer-setting","offer","is-preview"])]))),128)):(F(!0),q(De,{key:1},Le(S.value,M=>(F(),q("div",{key:(M==null?void 0:M.catalogItemId)||(M==null?void 0:M.itemId),class:Me(["product-item_record",P.value])},[pe(ZC,{"item-id":M==null?void 0:M.itemId,"catalog-item-id":M==null?void 0:M.catalogItemId,loading:c.value||h.value,mode:w.value,title:M==null?void 0:M.title,attributes:M==null?void 0:M.attributes,actions:M==null?void 0:M.actions,thumbnail:{value:M==null?void 0:M.thumbnail.value},description:M==null?void 0:M.description,url:M==null?void 0:M.friendlyURL,"template-id":e.configuration.productTemplateId,"apply-offer":J.value,"offer-setting":ee.value,offer:M==null?void 0:M.offer,"is-preview":e.isPreview},null,8,["item-id","catalog-item-id","loading","mode","title","attributes","actions","thumbnail","description","url","template-id","apply-offer","offer-setting","offer","is-preview"])],2))),128))]))],8,EE))}},[["__scopeId","data-v-01d2d3f1"]]),U2=e=>(Qt("data-v-0eae07cd"),e=e(),Zt(),e),DE={class:"catalog ect-flex ect-flex-col ect-gap-0 md:ect-flex-row"},RE={class:"catalog-product md:ect-grow"},ME={class:"ect-px-2 ect-text-[#0A0A0A] ect-[font-family:var(--font-family-Font-3,_Montserrat)] ect-text-[18px] md:ect-text-[22px] lg:ect-text-[22px] ect-font-bold ect-leading-normal ect-mb-6","data-test-id":"catalog-block-heading-title"},FE={class:"catalog-filter-mobile ect-flex ect-justify-between m-show"},BE=U2(()=>x("h3",null,"Filter Products",-1)),NE=U2(()=>x("span",null," OPEN FILTERS",-1)),LE=Ne({__name:"OrganismsCatalogBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},searchTerm:{type:String,default:""},onCountUpdate:{type:Function,default:null},initialItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1}},setup(e){var p,f,g,m,v,y,b,_,C,k,E;const n=Ht(),t=e,r=G(!1),o=be(()=>Array.isArray(t.initialItems)&&t.initialItems.length>0?"Search Results":"Catalog"),i=G(((p=t.configuration.dynamicFilters)==null?void 0:p.length)>0&&((f=t.configuration.displaySettings)==null?void 0:f.displayDynamicFilters)&&!t.searchTerm),a=G(t.configuration.displaySettings),s=be(()=>gx.get(t.configuration.catalogType)),l=be(()=>{let S=c.value.searchText;return S&&!S.endsWith("*")&&(S+="*"),S||""}),u=be(()=>{var X;const S=[],{description:D,thumbnail:I,title:A,attributes:w,actions:T}=t.fields.productCard,P=[D,I,A];return w.forEach($=>{P.push($.value),P.push($.label)}),(T==null?void 0:T.length)>0&&T.forEach($=>{$.action==="CUSTOM"&&(P.push($.url),P.push($.label))}),P.forEach($=>{!$.isStatic&&$.field?S.push($.field):$.value=$.title||"-"}),s.value==="eCatalog"?(S.push("XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),S.push("XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c")):(S.push("XX_ORD1__Friendly_URL__c"),S.push("XX_ORD1__SYS_Requires_Configuration__c")),((X=t.fields.productCard.friendlyURLFields)==null?void 0:X.length)>0&&S.push(...t.fields.productCard.friendlyURLFields),S}),c=G({blockId:t.id,catalogType:mx.get(t.configuration.catalogType)||"Full",checkcurrency:(g=a.value)==null?void 0:g.checkCurrency,eCatalogIDs:t.configuration.catalogType==="ECATALOG_OVERRIDE"&&t.configuration.catalogId?[t.configuration.catalogId]:null,fields:u.value,alternateFieldName:t.configuration.catalogCustomField,searchText:"",whereCondition:t.configuration.staticFilters,sortByField:((v=(m=t.configuration.sort)==null?void 0:m.primary)==null?void 0:v.field)||"Name",sortOrder:(b=(y=t.configuration.sort)==null?void 0:y.primary)==null?void 0:b.direction,secondarySortByField:(C=(_=t.configuration.sort)==null?void 0:_.secondary)==null?void 0:C.field,secondarySortOrder:(E=(k=t.configuration.sort)==null?void 0:k.secondary)==null?void 0:E.direction}),h=G(null),d=G(null);return We(()=>r.value,S=>{S&&window.scrollTo(0,0)}),Et(()=>{c.value.searchText=t.searchTerm||""}),We(c,S=>{d.value&&d.value.fetchFilterList(),h.value&&(h.value.currentPage=1,console.log("[fetchProducts] 4"),h.value.fetchProducts())},{deep:!0}),We(()=>t.searchTerm,S=>{typeof S=="string"&&(c.value.searchText=S)}),(S,D)=>(F(),q("div",DE,[x("div",RE,[x("h2",ME,ke(o.value),1),pe(TE,{ref_key:"product",ref:h,"block-id":e.id,"account-id":Te(n).accountId,configuration:e.configuration,"catalog-type":s.value,request:c.value,fields:e.fields,"search-text":l.value,"initial-items":t.initialItems,"hide-header":!!t.searchTerm,"on-count-update":t.onCountUpdate,"is-preview":e.isPreview},{default:ze(()=>[An(x("div",FE,[BE,x("div",{class:"ect-flex ect-items-center ect-gap-2 m-show",onClick:D[0]||(D[0]=I=>r.value=!0)},[pe(Ge,{class:"filter-product_icon",icon:"tune",color:"#acacac",size:20}),NE])],512),[[tf,!r.value&&i.value]])]),_:1},8,["block-id","account-id","configuration","catalog-type","request","fields","search-text","initial-items","hide-header","on-count-update","is-preview"])])]))}},[["__scopeId","data-v-0eae07cd"]]),PE={name:"AtomIcon",props:{icon:{type:String,default:"edit"},tooltipWidth:{type:Number,default:130},color:{type:String,default:"#acacac"},hover:{type:String,default:null},size:{type:Number,default:20},disabled:{type:Boolean,default:!1},tooltip:{type:String,default:""},direction:{type:String,default:"top-right"},symbol:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},custom:{type:Boolean,default:!1},removeDefaultColor:{type:Boolean,default:!1},margin:{type:String,default:"0px"}},data(){return{isHover:!1}},computed:{style(){return{color:this.removeDefaultColor?"":this.isHover&&this.hover?this.hover:this.color,fontSize:this.size+"px",margin:this.margin}},mode(){let e="material-";return this.symbol?e+="symbols-":e+="icons-",this.rounded?e+="round":e+="outlined",e}}},qE=["width","height"],$E=["href"],UE=["width","height"],jE=["href"];function HE(e,n,t,r,o,i){const a=fn("AtomIcons"),s=fn("AtomTooltip");return t.tooltip?(F(),Oe(s,{key:0,content:t.tooltip,direction:t.direction,width:t.tooltipWidth},{default:ze(()=>[x("div",{class:Me(["google-icon",{disabled:t.disabled}]),onMouseenter:n[0]||(n[0]=l=>o.isHover=!0),onMouseleave:n[1]||(n[1]=l=>o.isHover=!1)},[t.custom?(F(),q(De,{key:1},[pe(a),(F(),q("svg",{width:t.size,height:t.size,style:Re({fill:o.isHover&&t.hover&&!t.disabled?t.hover:t.color,color:o.isHover&&t.hover&&!t.disabled?t.hover:t.color})},[x("use",{href:`#icon-${t.icon}`},null,8,$E)],12,qE))],64)):(F(),q("span",{key:0,class:Me(i.mode),style:Re(i.style)},ke(t.icon),7))],34)]),_:1},8,["content","direction","width"])):(F(),q("div",{key:1,class:Me(["google-icon",{disabled:t.disabled}]),onMouseenter:n[2]||(n[2]=l=>o.isHover=!0),onMouseleave:n[3]||(n[3]=l=>o.isHover=!1)},[t.custom?(F(),q(De,{key:1},[pe(a),(F(),q("svg",{width:t.size,height:t.size,style:Re({fill:o.isHover&&t.hover&&!t.disabled?t.hover:t.color,color:o.isHover&&t.hover&&!t.disabled?t.hover:t.color})},[x("use",{href:`#icon-${t.icon}`},null,8,jE)],12,UE))],64)):(F(),q("span",{key:0,class:Me(i.mode),style:Re(i.style)},ke(t.icon),7))],34))}const ys=Ne(PE,[["render",HE],["__scopeId","data-v-16108bca"]]);async function j2(e,n,t,r={},o={}){let i=`/services/apexrest/${e}?type=${n}`;if(r&&Object.keys(r).length>0){const l=new URLSearchParams;Object.keys(r).forEach(c=>{const h=r[c];h!=null&&h!==""&&l.append(c,String(h))});const u=l.toString();u&&(i+=`&${u}`)}const a={action:"makeCall",data:{callType:t,endpoint:i,...t!=="GET"&&{payload:JSON.stringify(o)}}};return(await ps(Xr,a)).content}const Wr=Lt("expediteCart",()=>{const e=G(null),n=G([]),t=G(),r=G({}),o=Ht();async function i(f,g){let m=g?"cart.getGroupedQuoteProducts":"cart.getQuoteProducts";return await nn({data:JSON.stringify(f),config:{pathKey:m}})}async function a(f){return await nn({data:JSON.stringify({lineItemIds:f}),config:{pathKey:"common.getLineItemAttributes"}})}async function s(){const f=e.value?{quoteId:e.value}:{};return await nn({data:JSON.stringify(f),config:{pathKey:"promocode.getPromoCodes"}})}async function l(){const f=e.value?{quoteId:e.value}:{},g=await j2("XX_ORD1/ecommerce","getQLIsForPromoCode","POST",f,{});return t.value=g,n.value=g.qliIds,g}async function u(f,g,m){const v={promoCode:f,quoteId:e.value,qliIds:g,isLastBatch:m,originalTotalSalesPrice:f?t.value.originalTotalSalesPrice:null,isFromQLIUpdateOrDelete:"false"};return await nn({data:JSON.stringify(v),config:{pathKey:"promocode.applyPromoCode"}})}async function c(f){const m={records:[{fields:f.fields.map(y=>({fieldName:y.fieldName,fieldValue:String(y.fieldValue)}))}],uniqueField:"Id",objectType:f.objectType};return await nn({data:JSON.stringify(m),config:{pathKey:"update.upsertRecords"}})}async function h(f){return await nn({data:JSON.stringify(f),config:{pathKey:"fetch.getRecord"}})}async function d(){const f=e.value;return f?await nn({data:JSON.stringify({objectId:f,isCommit:!1}),config:{pathKey:"tax.calculateAvaTax"}}):void 0}async function p(f){const g=f||o.cid.value;return await j2("XX_ORD1/ecommerce","startNewCart","POST",g?{cid:g}:{},{})}return{quoteId:e,qlisList:n,quoteRecord:r,getRowItems:i,getLineItemAttributesNG:a,getPromoCodeInfo:s,getQLIsForPromoCode:l,applyPromoCodeNG:u,updateRecord:c,getRecordFieldValue:h,calculateAvaTax:d,startNewCart:p}}),VE={name:"ModalApp",components:{AtomIcon:ys},props:{show:{type:Boolean,default:!0},title:{type:String,default:""},subTitle:{type:String,default:""},maxWidth:{type:String,default:""},showCloseButtonText:{type:Boolean,default:!1},showCloseButton:{type:Boolean,default:!0}},emits:["clicked"],mounted(){document.querySelector("body").style.overflow="hidden"},unmounted(){document.querySelector("body").style.overflow="auto"}},zE={key:0,class:"modal-mask"},KE={class:"modal-wrapper"},GE={key:0,class:"close-text"},XE={key:1,class:"modal-container__header"},WE={class:"ect-flex ect-flex-col ect-gap-2"},QE={class:"widget-upload__heading"},ZE={key:0,class:"ect-text-[#5f5f5f] ect-text-[14px] ect-font-roboto ect-font-normal ect-leading-[20px]"},JE={class:"modal-container__content"},YE={class:"modal-container__action"};function ek(e,n,t,r,o,i){const a=fn("AtomIcon");return F(),Oe(Nl,null,{default:ze(()=>[t.show?(F(),q("div",zE,[x("div",KE,[x("div",{class:"modal-container",style:Re(`${t.maxWidth?"max-width: "+t.maxWidth+"px; width: 100%;":""}`)},[t.showCloseButton?(F(),q("div",{key:0,class:"modal-container__close ect-gap-2",onClick:n[0]||(n[0]=s=>e.$emit("clicked"))},[pe(a,{icon:"close",size:16,color:"##0a0a0a",hover:"#000000"}),t.showCloseButtonText?(F(),q("span",GE," Close ")):me("",!0)])):me("",!0),t.title?(F(),q("span",XE,[x("div",WE,[x("p",QE,ke(t.title),1),t.subTitle?(F(),q("span",ZE,ke(t.subTitle),1)):me("",!0)]),lt(e.$slots,"header-action",{},void 0,!0)])):me("",!0),x("div",JE,[lt(e.$slots,"content",{},void 0,!0)]),x("div",YE,[lt(e.$slots,"action",{},void 0,!0)])],4)])])):me("",!0)]),_:3})}const tk=Ne(VE,[["render",ek],["__scopeId","data-v-f59dbab6"]]),nk={name:"AtomLoader"},rk={class:"loader"};function ok(e,n,t,r,o,i){return F(),q("span",rk)}const H2=Ne(nk,[["render",ok],["__scopeId","data-v-32b63014"]]),ik={name:"AtomButton",components:{AtomLoader:H2},props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},btype:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},buttonStyle:{type:String,default:"button"},loading:{type:Boolean,default:!1}},emits:["clicked"],data(){return{isHover:!1}},methods:{getBtnClass(){const e=[];return this.btype?this.btype==="primary"?e.push("esg-btn-primary ect-bg-primary"):this.btype==="secondary"?e.push("esg-btn-secondary"):this.btype==="link"||this.btype==="ghost"?e.push("noborder"):this.btype==="plink"?e.push("esg-pcolor-fc"):this.btype==="error"&&e.push("esg-btn-error"):e.push("esg-btn-primary"),this.buttonStyle==="link"&&e.push("link-btn"),this.disabled&&e.push("disabled"),e},getBtnStyle(){return null}}},ak={class:"loader"};function sk(e,n,t,r,o,i){const a=fn("AtomLoader");return F(),Oe(Mo(t.tag),Bo(e.$attrs,{type:t.method,class:["rectangle-button ect-uppercase ect-whitespace-nowrap",i.getBtnClass()],style:i.getBtnStyle(),onClick:n[0]||(n[0]=kt(s=>e.$emit("clicked"),["prevent"]))}),{default:ze(()=>[x("span",{class:Me({"text-loading":t.loading})},[lt(e.$slots,"default",{},()=>[Ve(ke(t.text),1)],!0)],2),x("span",ak,[t.loading?(F(),Oe(a,{key:0})):me("",!0)])]),_:3},16,["type","class","style"])}const V2=Ne(ik,[["render",sk],["__scopeId","data-v-ae1df853"]]),lk={components:{AppTooltip:O1,AppIcon:Ge},props:{label:{type:String,default:""},modelValue:{type:Boolean,default:!1},partial:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},info:{type:String,default:null},dataTestId:{type:String,default:""}},emits:["update:modelValue"],methods:{toggleChecked(){this.disabled||this.$emit("update:modelValue",!this.modelValue)}}},z2=e=>(Qt("data-v-888eb5f4"),e=e(),Zt(),e),uk=["data-test-id"],ck=["data-test-id"],dk={key:0,width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fk=[z2(()=>x("g",{id:"minus"},[x("path",{id:"Icon",d:"M3 6H10",stroke:"white","stroke-width":"1.66666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],hk={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pk=[z2(()=>x("g",{id:"check"},[x("path",{id:"Icon",d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.6666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],mk=["data-test-id"];function gk(e,n,t,r,o,i){const a=fn("AppIcon"),s=fn("AppTooltip");return F(),q("div",{class:"checkbox","data-test-id":t.dataTestId,onClick:n[0]||(n[0]=(...l)=>i.toggleChecked&&i.toggleChecked(...l))},[x("div",{class:Me(["checkmark",{checked:t.modelValue&&!t.partial&&!t.disabled,disabled:t.disabled,partial:t.partial}]),"data-test-id":`${t.dataTestId}-checkmark`},[t.partial?(F(),q("svg",dk,fk)):t.modelValue?(F(),q("svg",hk,pk)):me("",!0)],10,ck),t.label?(F(),q("div",{key:0,class:"label","data-test-id":`${t.dataTestId}-label`},ke(t.label),9,mk)):me("",!0),t.info?(F(),Oe(s,{key:1,direction:"top",content:t.info,width:100,"data-test-id":`${t.dataTestId}-info-tooltip`},{default:ze(()=>[pe(a,{class:"ect-text-primary ect-pt-2 ect-pl-4",icon:"info","data-test-id":`${t.dataTestId}-info-icon`},null,8,["data-test-id"])]),_:1},8,["content","data-test-id"])):me("",!0)],8,uk)}const vs=Ne(lk,[["render",gk],["__scopeId","data-v-888eb5f4"]]),yk={class:"m-content"},vk={key:0,class:"attribute-input"},bk={key:1,class:"attribute-lookup"},_k={class:"attribute-lookup-main"},xk={key:1},Ck={key:2,class:"attribute-input"},Ek={key:2},kk={class:"m-footer"},Ak=Ne({__name:"MoleculeAttributeModal",props:{data:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},emits:["close","update","reload"],setup(e,{emit:n}){const t=Wr(),r=e,o=n,i=G([]),a=G([]),s=G({}),l=G(!1);async function u(){l.value=!0;const f=[{fieldName:"Id",fieldValue:r.quoteId}];a.value.forEach(m=>{if(m.editable&&!m.apiName.includes(".")){let v=m.apiName;m.dataType==="REFERENCE"?(v=m.apiName.replace("__r","__c"),f.push({fieldName:v,fieldValue:m.referenceRecordId})):f.push({fieldName:v,fieldValue:m.value})}});const g={fields:f,objectType:"XX_ORD1__Quote_Line_Item__c"};console.log(g),await t.updateRecord(g),c(),o("reload",r.quoteId),o("close"),l.value=!1}function c(){const f={},g={};i.value.forEach(m=>{m.dataType==="REFERENCE"&&(g[m.apiName]=m.referenceRecordId),f[m.apiName]=m.value}),r.data.forEach(m=>{m.dataType==="REFERENCE"&&(m.referenceRecordId=g[m.apiName]),m.value=f[m.apiName]})}function h(f,g){if(f){const m=i.value.find(y=>y.label===g.firstLookup.replace("Copy from ",""));console.log("Parent",m);const v={};m.relatedFields.forEach(y=>{v[y.child]=y.value}),m&&(g.referenceRecordId=m.referenceRecordId,g.value=m.value,g.options=m.options,g.relatedFields.forEach(y=>{y.value=v[y.child]}))}else g.referenceRecordId=null,g.options=[],g.relatedFields.forEach(m=>{m.value=null})}function d(f,g){console.log(f,g);const m=g.options.find(v=>v.Id===f);f===null?(g.options=[],g.value=null,g.relatedFields.forEach(v=>{v.value=null})):(g.value=m.Name,g.relatedFields.forEach(v=>{v.value=m[v.child]}))}const p=pn(async function(f,g){g.loading=!0;const m={lookupObjectApiName:g.referenceObject,searchTerm:f||"",fields:s.value[g.apiName]||[]},v=await t.getLookupRecords(m);console.log(v),g.options=v,g.loading=!1});return Jt(()=>{const f={};i.value=JSON.parse(JSON.stringify(r.data)),i.value.forEach(m=>{m.dataType==="REFERENCE"&&(s.value[m.apiName]=[],m.relatedFields=[],f[m.apiName]=m,m.options=[{Name:m.value||"",Id:m.referenceRecordId}]),m.editable=m.editable&&!m.apiName.includes(".")});let g=null;i.value.forEach(m=>{if(m.referenceObject==="XX_Base__Location__c"&&(g?m.firstLookup="Copy from "+g.label:g=m),m.apiName.includes(".")){const[v,y]=m.apiName.split(".");m.parent=v,m.child=y,s.value[v]!=null&&(s.value[v].push(y),f[v].relatedFields.push(m))}}),a.value=i.value.filter(m=>!m.apiName.includes(".")),console.log(a.value,f)}),(f,g)=>(F(),Oe(tk,{title:"Modify attributes",onClicked:g[1]||(g[1]=m=>f.$emit("close"))},{content:ze(()=>[x("div",yk,[(F(!0),q(De,null,Le(a.value,(m,v)=>{var y;return F(),q(De,{key:v},[m.firstLookup?(F(),q("div",vk,[x("label",null,ke(m.firstLookup),1),pe(vs,{modelValue:m.same,"onUpdate:modelValue":[b=>m.same=b,b=>h(b,m)],class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue"])])):me("",!0),m.dataType==="REFERENCE"&&((y=m.relatedFields)==null?void 0:y.length)>0?(F(),q("div",bk,[x("div",_k,[pe(ar,{modelValue:m.referenceRecordId,"onUpdate:modelValue":[b=>m.referenceRecordId=b,b=>d(b,m)],label:m.label,disabled:!m.editable||m.same,options:m.options,lookup:"",search:"",highlight:"",loading:m.loading,property:{key:"Id",value:"Name"},onSearch:b=>Te(p)(b,m)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])]),(F(!0),q(De,null,Le(m.relatedFields,(b,_)=>(F(),q("div",{key:_,class:"attribute-input"},[b.dataType==="PICKLIST"||b.dataType==="MULTIPICKLIST"?(F(),Oe(ar,{key:0,modelValue:b.value,"onUpdate:modelValue":C=>b.value=C,label:b.label,disabled:!b.editable,options:b.picklistValues.map(C=>({label:C,value:C})),select:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):b.dataType==="BOOLEAN"?(F(),q("div",xk,[x("label",null,ke(b.label),1),pe(vs,{modelValue:b.value,"onUpdate:modelValue":C=>b.value=C,disabled:!b.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(F(),Oe(yo,{key:2,label:b.label,disabled:!b.editable,modelValue:b.value,"onUpdate:modelValue":C=>b.value=C,class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))),128))])):(F(),q("div",Ck,[m.dataType==="REFERENCE"?(F(),Oe(ar,{key:0,modelValue:m.referenceRecordId,"onUpdate:modelValue":[b=>m.referenceRecordId=b,b=>d(b,m)],label:m.label,disabled:!m.editable,options:m.options,lookup:"",search:"",highlight:"",loading:m.loading,property:{key:"Id",value:"Name"},onSearch:b=>Te(p)(b,m)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])):m.dataType==="PICKLIST"||m.dataType==="MULTIPICKLIST"?(F(),Oe(ar,{key:1,modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,label:m.label,disabled:!m.editable,options:m.picklistValues.map(b=>({label:b,value:b})),select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):m.dataType==="BOOLEAN"?(F(),q("div",Ek,[x("label",null,ke(m.label),1),pe(vs,{modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,disabled:!m.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(F(),Oe(yo,{key:3,label:m.label,disabled:!m.editable,modelValue:m.value,"onUpdate:modelValue":b=>m.value=b,highlight:"",class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))],64)}),128))])]),action:ze(()=>[x("div",kk,[pe(V2,{text:"CANCEL",btype:"secondary",onClick:g[0]||(g[0]=m=>f.$emit("close"))}),pe(V2,{text:"SAVE",btype:"primary",loading:l.value,onClick:u},null,8,["loading"])])]),_:1}))}},[["__scopeId","data-v-d0648f18"]]),wk={class:"datatable"},Ik={class:"m-show"},Sk={key:0},Ok=["onClick"],Tk={key:1},Dk=["data-test-id","onClick"],Rk={class:"desktop d-show"},Mk={class:"datatable-skeletion"},Fk={class:"datatable-skeletion"},Bk={class:"datatable-skeletion"},Nk=["colspan"],Lk={style:{display:"flex",gap:"1rem",height:"40px"}},Pk=["onClick"],qk=["data-test-id","onClick"],$k={key:0},Uk=["colspan"],jk={style:{display:"flex",gap:"1rem",height:"40px"}},Hk={key:1},Vk=["colspan"],zk={style:{display:"flex","flex-wrap":"wrap",padding:"1rem"}},Kk={key:0,class:"attribute",style:{width:"50%"}},Gk={key:0,class:"ect-flex ect-gap-2"},Xk={key:1,class:"ect-flex ect-gap-2"},Wk={key:1,class:"attribute",style:{width:"50%"}},Qk={key:0},Zk={key:2,class:"attribute",style:{width:"50%"}},Jk={key:0},Yk={key:1},bs=Ne({__name:"MoleculeDataTable",props:{rows:{type:Array,default:()=>[]},cols:{type:Array,default:()=>[]},loading:{type:Array,default:()=>[]},style:{type:Object,default:()=>({})},delRecords:{type:Set,default:()=>new Set},rowLoading:{type:Boolean,default:!1},loadingRowId:{type:String,default:null},del:{type:Boolean,default:!1},configure:{type:Boolean,default:!1},hidecolumn:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},isOption:{type:Boolean,default:!1},attribute:{type:[Object,Boolean],default:()=>({})}},emits:["delete","update","configure","reload"],setup(e,{emit:n}){const t=e,r=G(null),o=G(null),i=n,a=G(null),s=G({}),l=G(null),u=be(()=>t.disabled),c=function(_,C){return a.value&&a.value!==_+":"+C||t.delRecords.has(_)||u.value||l.value&&l.value!==_},h=be(()=>{const{headerStyle:_,optionRow:C,productRow:k}=t.style;return{product:{backgroundColor:k.background,verticalAlign:k.verticalAlignment||"middle"},option:{backgroundColor:C.background,verticalAlign:C.verticalAlignment||"middle"},header:{backgroundColor:_.background,verticalAlign:_.verticalAlignment||"middle"}}}),d=be(()=>{const{headerStyle:_,optionRow:C,productRow:k}=t.style;return{header:_.style||{},option:C.style||{},product:k.style||{}}}),p=be(()=>200/t.cols.length+"px");function f(_,C,k){const E={},{table:S}=t.style;if(_){const{alignment:D,strikethrough:I}=_;D&&(E.textAlign=D),I&&(E.textDecoration="line-through")}if(C){const{width:D,minWidth:I}=C;D&&(E.width=`calc(${D.value+D.unit} - ${p.value})`),I&&(E.minWidth=I.value+I.unit)}return S.border!=="n"&&!k?(E.borderStyle="solid",E.borderColor=S.color,S.border==="b"?E.borderWidth=S.width:S.border==="x"?(E.borderTopWidth=S.width,E.borderBottomWidth=S.width,E.borderLeftWidth=0,E.borderRightWidth=0):S.border==="y"?(E.borderLeftWidth=S.width,E.borderRightWidth=S.width,E.borderTopWidth=0,E.borderBottomWidth=0):S.border==="bottom"||S.border==="default"?(E.borderTopWidth=0,E.borderBottomWidth=S.width,E.borderLeftWidth=0,E.borderRightWidth=0):S.border==="top"&&(E.borderTopWidth=S.width,E.borderBottomWidth=0,E.borderLeftWidth=0,E.borderRightWidth=0)):E.borderWidth="0px",E}function g(_,C){var E;if(C.dataType==="REFERENCE")return(E=_[C.content.replace("__c","__r")])==null?void 0:E.Name;const k=vt(_,C.api,C.dataType);return k===""?k:C.dataType==="PERCENT"?k+"%":k}function m(_,C){_===0?i("delete",C):v(_,"XX_ORD1__QTY__c",C)}function v(_,C,k){l.value=k.Id,y(_,C,k)}const y=pn(function(_,C,k){a.value=k.Id+":"+C,s.value.Id=k.Id,s.value[C]=_;const E=()=>{a.value=null,s.value={},l.value=null};i("update",{record:s.value,callback:E})},500),b=_=>_.content.picklist.map(C=>({label:C,value:C}));return(_,C)=>(F(),q(De,null,[r.value&&o.value?(F(),Oe(Ak,{key:0,data:r.value,"quote-id":o.value,onClose:C[0]||(C[0]=k=>(r.value=null,o.value=null)),onReload:C[1]||(C[1]=k=>_.$emit("reload",k))},null,8,["data","quote-id"])):me("",!0),x("div",wk,[x("div",Ik,[(F(!0),q(De,null,Le(e.rows,k=>(F(),q("table",{key:k.Id,class:"mobile md:ect-hidden"},[(F(!0),q(De,null,Le(e.cols,(E,S)=>{var D,I,A,w;return F(),q("tr",{key:S},[x("th",{style:Re({...f(E.header.style),...h.value.header})},[E.header?(F(),Oe(rt,{key:0,text:E.header.title,style:Re(E.header.style),"sec-style":d.value.header},null,8,["text","style","sec-style"])):me("",!0)],4),x("td",{style:Re({...f(E.content.style),...h.value[k.XX_ORD1__Parent_QLI__c?"option":"product"]})},[E.editable?(F(),q(De,{key:1},[E.api==="XX_ORD1__QTY__c"?(F(),Oe(gs,{key:0,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>m(T,k)],disabled:c(k.Id,E.api),loading:k.Id+":"+E.api===a.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):E.dataType==="PICKLIST"?(F(),Oe(ar,{key:1,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>v(T,E.api,k)],disabled:c(k.Id,E.api),options:b(E),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(F(),Oe(yo,{key:2,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>v(T,E.api,k)],disabled:c(k.Id,E.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(F(),q(De,{key:0},[E.dataType==="URL"?(F(),Oe(fc,{key:0,src:g(k,E)},null,8,["src"])):E.content.isStatic?(F(),Oe(rt,{key:1,tag:(D=E.content)==null?void 0:D.style.tag,text:E.content.content,style:Re((I=E.content)==null?void 0:I.style),"sec-style":k.XX_ORD1__Parent_QLI__c?d.value.option:d.value.product},null,8,["tag","text","style","sec-style"])):(F(),Oe(rt,{key:2,loading:e.loading.includes(E.dataType)&&(!e.loadingRowId||e.loadingRowId===k.Id),tag:(A=E.content)==null?void 0:A.style.tag,text:g(k,E),style:Re((w=E.content)==null?void 0:w.style),"sec-style":k.XX_ORD1__Parent_QLI__c?d.value.option:d.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],4)])}),128)),e.del?(F(),q("tr",Sk,[x("th",{style:Re({...f(),...h.value.header})},null,4),x("td",{style:Re({...f(),...h.value[k.XX_ORD1__Parent_QLI__c?"option":"product"]})},[x("span",{class:Me(["datatable-remove",{disabled:c(k.Id)}]),onClick:E=>!c(k.Id)&&_.$emit("delete",k)},"REMOVE",10,Ok)],4)])):me("",!0),e.configure&&Te(ic).includes(k.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(F(),q("tr",Tk,[x("th",{style:Re({...f(),...h.value.header})},null,4),x("td",{style:Re({...f(),...h.value[k.XX_ORD1__Parent_QLI__c?"option":"product"]})},[x("div",{class:Me(["datatable-configure",{disabled:c(k.Id)}]),"data-test-id":`expeditecart-list-button-configure-${k.Id}`,onClick:E=>!c(k.Id)&&_.$emit("configure",k)},"CONFIGURE",10,Dk)],4)])):me("",!0)]))),128))]),x("table",Rk,[e.hidecolumn?me("",!0):(F(),q("tr",{key:0,style:Re(h.value.header)},[(F(!0),q(De,null,Le(e.cols,k=>{var E;return F(),q("th",{key:k.key,style:Re(f((E=k.header)==null?void 0:E.style,k.style))},[k.header?(F(),Oe(rt,{key:0,text:k.header.title,style:Re(k.header.style),"sec-style":d.value.header},null,8,["text","style","sec-style"])):me("",!0)],4)}),128)),e.del?(F(),q("th",{key:0,style:Re({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):me("",!0),e.configure?(F(),q("th",{key:1,style:Re({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):me("",!0)],4)),e.rowLoading?(F(),q(De,{key:1},Le(5,k=>(F(),q(De,{key:k},[x("tr",null,[(F(!0),q(De,null,Le(e.cols,E=>(F(),q("td",{key:E.key,style:Re(f(E.content.style,E.style))},[x("div",Mk,[pe(xr)])],4))),128)),e.del?(F(),q("td",{key:0,style:Re({...f(),minWidth:"100px",maxWidth:"100px"})},[x("div",Fk,[pe(xr)])],4)):me("",!0),e.configure?(F(),q("th",{key:1,style:Re({...f(),minWidth:"100px",maxWidth:"100px"})},[x("div",Bk,[pe(xr)])],4)):me("",!0)]),e.attribute?(F(),q("td",{key:0,colspan:e.cols.length+2,style:Re(f())},[x("div",Lk,[pe(xr),pe(xr)])],12,Nk)):me("",!0)],64))),64)):(F(!0),q(De,{key:2},Le(e.rows,k=>(F(),q(De,{key:k.Id},[x("tr",{style:Re(h.value[k.XX_ORD1__Parent_QLI__c?"option":"product"])},[(F(!0),q(De,null,Le(e.cols,(E,S)=>{var D,I,A,w;return F(),q("td",{key:S,style:Re(f(E.content.style,E.style,!!k.Attributes)),class:Me({"padding-left":S==0&&k.XX_ORD1__Parent_QLI__c})},[E.editable?(F(),q(De,{key:1},[E.api==="XX_ORD1__QTY__c"?(F(),Oe(gs,{key:0,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>m(T,k)],disabled:c(k.Id,E.api),loading:k.Id+":"+E.api===a.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):E.dataType==="PICKLIST"?(F(),Oe(ar,{key:1,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>v(T,E.api,k)],disabled:c(k.Id,E.api),options:b(E),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(F(),Oe(yo,{key:2,modelValue:k[E.api],"onUpdate:modelValue":[T=>k[E.api]=T,T=>v(T,E.api,k)],disabled:c(k.Id,E.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(F(),q(De,{key:0},[E.dataType==="URL"?(F(),Oe(fc,{key:0,src:g(k,E)},null,8,["src"])):E.content.isStatic?(F(),Oe(rt,{key:1,tag:(D=E.content)==null?void 0:D.style.tag,text:E.content.content,style:Re((I=E.content)==null?void 0:I.style),"sec-style":k.XX_ORD1__Parent_QLI__c?d.value.option:d.value.product},null,8,["tag","text","style","sec-style"])):(F(),Oe(rt,{key:2,loading:e.loading.includes(E.dataType)&&(!e.loadingRowId||e.loadingRowId===k.Id),tag:(A=E.content)==null?void 0:A.style.tag,text:g(k,E),style:Re((w=E.content)==null?void 0:w.style),"sec-style":k.XX_ORD1__Parent_QLI__c?d.value.option:d.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],6)}),128)),e.del?(F(),q("td",{key:0,style:Re({...f(null,null,!!k.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[x("span",{class:Me(["datatable-remove",{disabled:c(k.Id)}]),onClick:E=>!c(k.Id)&&_.$emit("delete",k)},"REMOVE",10,Pk)],4)):me("",!0),e.configure?(F(),q("td",{key:1,style:Re({...f(null,null,!!k.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[Te(ic).includes(k.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(F(),q("span",{key:0,class:Me(["datatable-configure",{disabled:c(k.Id)}]),"data-test-id":`expeditecart-list-button-configure-${k.Id}`,onClick:E=>!c(k.Id)&&_.$emit("configure",k)}," CONFIGURE ",10,qk)):me("",!0)],4)):me("",!0)],4),k.attributesLoading?(F(),q("tr",$k,[x("td",{colspan:e.cols.length+2,style:Re(f())},[x("div",jk,[pe(xr),pe(xr)])],12,Uk)])):k.Attributes?(F(),q("tr",Hk,[x("td",{colspan:e.cols.length+2,style:Re(f())},[x("div",zk,[(F(!0),q(De,null,Le(k.Attributes,(E,S)=>(F(),q(De,{key:S},[E.value||E.existingValue||E.existingValueReferenceName?(F(),q(De,{key:0},[E.value&&(E.existingValue||E.existingValueReferenceName)?(F(),q("div",Kk,[x("b",null,ke(E.label)+":",1),E.value!==E.existingValue&&E.value!==E.existingValueReferenceName?(F(),q("div",Gk,[pe(rt,{text:E.value,style:Re(e.attribute.new.style)},null,8,["text","style"]),pe(rt,{text:E.existingValueReferenceName||E.existingValue,style:Re(e.attribute.old.style)},null,8,["text","style"])])):(F(),q("div",Xk,[pe(rt,{text:E.value,style:Re(e.attribute.regular.style)},null,8,["text","style"])])),e.attribute.edit&&E.editable&&k.XX_ORD1__QLI_Type__c!=="Remove"?(F(),Oe(ys,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(r.value=k.Attributes,o.value=k.Id)},null,8,["onClick"])):me("",!0)])):E.value?(F(),q("div",Wk,[x("b",null,ke(E.label)+":",1),E.value?(F(),q("div",Qk,[pe(rt,{text:E.value,style:Re(e.attribute.new.style)},null,8,["text","style"])])):me("",!0),e.attribute.edit&&E.editable?(F(),Oe(ys,{key:1,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(r.value=k.Attributes,o.value=k.Id)},null,8,["onClick"])):me("",!0)])):e.attribute.displayonlychanged?me("",!0):(F(),q("div",Zk,[x("b",null,ke(E.label)+":",1),E.value?(F(),q("div",Jk,[pe(rt,{text:E.value,style:Re(e.attribute.new.style)},null,8,["text","style"])])):E.existingValue?(F(),q("div",Yk,[pe(rt,{text:E.existingValueReferenceName||E.existingValue,style:Re(e.attribute.regular.style)},null,8,["text","style"])])):me("",!0),e.attribute.edit&&E.editable?(F(),Oe(ys,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(r.value=k.Attributes,o.value=k.Id)},null,8,["onClick"])):me("",!0)]))],64)):me("",!0)],64))),128))])],12,Vk)])):me("",!0)],64))),128))])])],64))}},[["__scopeId","data-v-3b714a31"]]),eA={key:0,class:"prodlist"},tA={class:"prodlist-header"},nA={key:0},rA={key:1,class:"summary"},oA={key:1,class:"summary"},iA=Ne({__name:"OrganismsProductListBlock",props:{header:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},footer:{type:Array,default:()=>[]},configuration:{type:Object,default:()=>({})},fields:{type:Object,default:()=>({})},id:{type:String,required:!1},isPreview:{type:Boolean,default:!1}},emits:["counts"],setup(e,{emit:n}){const t=Wr(),r=_r(),o=e,i=n,a=R=>R.toUpperCase()||"",s=be(()=>{var R;return((R=o.fields)==null?void 0:R.styling)||{}}),l=be(()=>{var R,M;return(M=(R=o.configuration)==null?void 0:R.allowedActions)==null?void 0:M.delete}),u=be(()=>{var R,M;return(M=(R=o.configuration)==null?void 0:R.allowedActions)==null?void 0:M.configure}),c=be(()=>{var R;return o.configuration.displayAttributes?(R=o.configuration)==null?void 0:R.attribute:!1}),h=be(()=>{var R;return(R=o.configuration)==null?void 0:R.sort}),d=be(()=>{var R;return(R=o.configuration)==null?void 0:R.group}),p=be(()=>{const R=d.value.groupheader.style;return R?T(R):{}}),f=be(()=>{const R=d.value.groupfooter.style;return R?T(R):{}}),g=be(()=>{const R={},{border:M,color:N,width:H}=s.value.table;return M==="default"&&(R.borderStyle="solid",R.borderColor=N,R.borderWidth=H,R.borderTopWidth=0),R}),m=be(()=>S.value?!1:!A.value||A.value.length===0?!0:A.value.every(R=>{const M=R.rows&&R.rows.length>0,N=R.options&&R.options.some(H=>H.rows&&H.rows.length>0);return!M&&!N}));Va();const v=["CURRENCY","DOUBLE","PERCENT"],y=["CURRENCY","DOUBLE","PERCENT","DATE","DATETIME","TIME","BOOLEAN","STRING","TEXTAREA","REFERENCE","EMAIL","PHONE","URL","TEXTAREA","TEXTAREA"],b=G(null),_=G([]),C=G([]),k=G([]),E=G(!1),S=G(!1),D=G(new Set),I=G([]),A=G([]),w=new Map;function T(R){let M={padding:"1.25rem 2rem"};const{overrite:N,backgroundColor:H,verticalAlignment:L,padding:z}=R;return N&&(M={backgroundColor:H,verticalAlign:L,padding:z||"1.25rem 2rem"}),M}const P=async function({record:R,callback:M}){const N=[];for(const L in R)N.push({fieldName:L,fieldValue:R[L]});const H={fields:N,objectType:o.configuration.objectType};await t.updateRecord(H),M(),R.XX_ORD1__QTY__c!==void 0&&(b.value=R.Id,await ee("FIELD_RELOAD"),b.value=null)};async function X(R){b.value=R,await ee("RELOAD_ALL_FIELDS"),b.value=null}const $=R=>{rn("expeditecart:configure-clicked",{itemId:R.XX_ORD1__Item__c,lineItemId:R.Id,quoteId:t.quoteId,isPreview:o.isPreview})},J=async function(R){D.value.add(R.Id),E.value=!0;const M=[R.Id];await r.deleteLineItems(M),await ee("RELOAD"),E.value=!1,D.value.delete(R.Id)};async function ee(R){R==="RELOAD"?S.value=!0:R==="FIELD_RELOAD"?k.value=v:R==="RELOAD_ALL_FIELDS"&&(k.value=y);const{groupby:M,grouplevel:N}=o.configuration.group,H=t.quoteId,L=o.footer.map(Q=>({field:Q.field,snippet:Q.function||"SUM"})),z={filterObject:o.configuration.objectType,fieldsToDisplay:[...C.value,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c","XX_ORD1__Parent_QLI__c"],aggregateFields:L,filters:o.configuration.filters,parentObjectField:o.configuration.parentObjectField,objectId:H,groupby:M.field,grouplevel:N,primarysort:h.value.primary.field,secondarysort:h.value.secondary.field,primarysortdesc:h.value.primary.direction!=="asc",secondarysortdesc:h.value.secondary.direction!=="asc",filterlogic:o.configuration.filterlogic},j=M.field&&N,W=await t.getRowItems(z,j);j?O(W,N):U(W),o.configuration.displayAttributes&&Y(),S.value=!1,k.value=[]}async function Y(){const R=b.value,M=[];A.value.forEach(H=>{H.rows.forEach(L=>{L.attributes=w.get(L.Id),console.log("row.attributes",L.attributes),R?L.Attributes=w.get(L.Id):L.attributesLoading=!0,M.push(L.Id)})});const N=await t.getLineItemAttributesNG(M);A.value.forEach(H=>{H.rows.forEach(L=>{const z=N[L.Id];if(z==null?void 0:z.some(W=>W.value&&!c.value.displayonlychanged||W.value&&W.existingValue&&c.value.displayonlychanged)){const W=[],Q=new Set;z.forEach(ae=>{Q.has(ae.apiName)||(Q.add(ae.apiName),W.push(ae))}),L.Attributes=W,w.set(L.Id,W)}L.attributesLoading=!1})}),console.log("attributesByIdMap",w)}function U(R){var L;const M=R.lstRecords,N=[],H=R.lstRecords&&((L=R.lstRecords)==null?void 0:L.length)>0;if(i("counts",H),R.lstAggregateField&&R.lstAggregateField.length>0){const z=new Map;R.lstAggregateField.forEach(j=>{z.set(j.fieldName,j.totalValue)}),o.footer.forEach(j=>{j.value=z.get(j.field),N.push(j)})}A.value=[{rows:M,summary:N}]}function O(R,M){const N=[];let H;R.forEach(L=>{var z;if(M==="option"){if((z=L.product)!=null&&z.thisobject){const j={name:"",rows:[L.product.thisobject],summary:[],isProduct:!0,options:[]};L.options.length>0&&L.options.forEach(W=>{const Q={name:W.groupName,rows:[]},ae=[];W.options.forEach(fe=>{Q.rows.push(fe.thisobject)}),W.groupTotals&&W.groupTotals.length>0&&W.groupTotals.forEach(fe=>{var K,V;ae.push({label:Q.name,value:fe.amount,style:((V=(K=d.value)==null?void 0:K.groupfooter)==null?void 0:V.style)||{}})}),Q.summary=ae,j.options.push(Q)}),N.push(j)}}else{if(H={name:L.groupName,rows:[]},L.productRows.forEach(j=>{H.rows.push(j[M].thisobject),j.options.forEach(W=>{const Q={...W.thisobject};Q.isOption=!0,H.rows.push(Q)})}),d.value.displaygroupfooter){const j=[];L.groupTotals&&L.groupTotals.length>0&&L.groupTotals.forEach(W=>{var Q,ae;j.push({label:H.name,value:W.amount,style:((ae=(Q=d.value)==null?void 0:Q.groupfooter)==null?void 0:ae.style)||{}})}),H.summary=j}else H.summary=[];N.push(H)}}),A.value=N}return Jt(()=>{console.log("Product List - Block Before Mount"),I.value=JSON.parse(JSON.stringify(o.columns)),_.value=o.summary,I.value.forEach(R=>{R.content.dataType=a(R.content.dataType),R.editby=R.editable,R.editable=R.editable!=="not",R.dataType=R.content.dataType,R.api=R.content.field,C.value.push(R.content.field)}),C.value.includes("XX_ORD1__QLI_Type__c")||C.value.push("XX_ORD1__QLI_Type__c"),ee("RELOAD")}),(R,M)=>{var N;return m.value?me("",!0):(F(),q("div",eA,[x("div",tA,[e.header.title?(F(),Oe(rt,{key:0,tag:(N=e.header.style)==null?void 0:N.tag,text:e.header.title,style:Re(e.header.style)},null,8,["tag","text","style"])):me("",!0)]),!d.value.repeatcolumheadings||S.value?(F(),q("div",nA,[pe(bs,{cols:I.value,rows:[],summary:[],style:Re(s.value),loading:k.value,del:l.value,configure:u.value,disabled:E.value||e.isPreview,"loading-row-id":b.value,"del-records":D.value,attribute:c.value,onDelete:J,onConfigure:$,onUpdate:P,onReload:M[0]||(M[0]=H=>X(H))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])])):me("",!0),S.value?(F(),q("div",{key:1,style:Re(g.value)},[pe(bs,{hidecolumn:"",cols:I.value,rows:[],summary:[],style:Re(s.value),"row-loading":!0,loading:k.value,del:l.value,configure:u.value,disabled:E.value||e.isPreview,"loading-row-id":b.value,"del-records":D.value,attribute:c.value,onDelete:J,onConfigure:$,onUpdate:P,onReload:M[1]||(M[1]=H=>X(H))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])],4)):me("",!0),S.value?me("",!0):(F(),q("div",{key:2,style:Re(g.value)},[(F(!0),q(De,null,Le(A.value,H=>(F(),q("div",{key:H.name,class:Me(["productlist",H.isProduct?"prodlist-product":"prodlist-option"])},[d.value.displaygroupheader&&H.name?(F(),q("div",{key:0,class:"groupHeader",style:Re(p.value)},[pe(rt,{text:"Group: "+H.name,style:Re(d.value.groupheader.style)},null,8,["text","style"])],4)):me("",!0),pe(bs,{hidecolumn:!d.value.repeatcolumheadings,cols:I.value,rows:H.rows,style:Re(s.value),"row-loading":S.value,loading:k.value,del:l.value,configure:u.value,disabled:E.value||e.isPreview,"loading-row-id":b.value,"del-records":D.value,attribute:c.value,onDelete:J,onConfigure:$,onUpdate:P,onReload:M[2]||(M[2]=L=>X(L))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),H.summary.length>0?(F(),q("div",rA,[(F(!0),q(De,null,Le(H.summary,(L,z)=>{var j,W,Q;return F(),q("div",{key:z,class:"summary_row",style:Re(f.value)},[pe(rt,{tag:(j=L==null?void 0:L.style)==null?void 0:j.tag,text:L.label+" : ",style:Re(L==null?void 0:L.style)},null,8,["tag","text","style"]),Ve(" "),pe(rt,{loading:((W=k.value)==null?void 0:W.length)>0||S.value,tag:(Q=L==null?void 0:L.style)==null?void 0:Q.tag,text:L.value,style:Re(L==null?void 0:L.style)},null,8,["loading","tag","text","style"])],4)}),128))])):me("",!0),H.options?(F(!0),q(De,{key:2},Le(H.options,L=>(F(),q("div",{key:L.name},[d.value.displaygroupheader&&L.name?(F(),q("div",{key:0,class:"groupHeader",style:Re(p.value)},[pe(rt,{text:"Group: "+L.name,style:Re(d.value.groupheader.style)},null,8,["text","style"])],4)):me("",!0),pe(bs,{hidecolumn:!d.value.repeatcolumheadings,cols:I.value,rows:L.rows,style:Re(s.value),"row-loading":S.value,loading:k.value,del:l.value,configure:u.value,disabled:E.value||e.isPreview,"loading-row-id":b.value,"del-records":D.value,attribute:c.value,"is-option":!0,onDelete:J,onConfigure:$,onUpdate:P,onReload:M[3]||(M[3]=z=>X(z))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),L.summary.length>0?(F(),q("div",oA,[(F(!0),q(De,null,Le(L.summary,(z,j)=>{var W,Q,ae;return F(),q("div",{key:j,class:"summary_row",style:Re(f.value)},[pe(rt,{tag:(W=z==null?void 0:z.style)==null?void 0:W.tag,text:z.label+" : ",style:Re(z==null?void 0:z.style)},null,8,["tag","text","style"]),Ve(" "),pe(rt,{loading:((Q=k.value)==null?void 0:Q.length)>0||S.value,tag:(ae=z==null?void 0:z.style)==null?void 0:ae.tag,text:z.value,style:Re(z==null?void 0:z.style)},null,8,["loading","tag","text","style"])],4)}),128))])):me("",!0)]))),128)):me("",!0)],2))),128))],4))]))}}},[["__scopeId","data-v-d933d5c5"]]),aA={class:"detail-section"},sA={key:0,class:"selectedtext sm:hidden"},lA={class:"expand material-icons-outlined"},uA={key:1,class:"detail-section_title"},cA={key:2,class:"detail-section_slot"},dA=Ne({__name:"AtomDetailSection",props:{title:{type:String,required:!0},style:{type:Object,default:()=>({})},expand:{type:Boolean,default:!1},header:{type:Boolean,default:!1},selectedText:{type:String,default:""},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["expand"],setup(e,{emit:n}){const t=e;return(r,o)=>{var i,a;return F(),q("div",aA,[t.header?(F(),q("div",{key:0,class:Me(["detail-section_header ect-border-solid ect-border-border-db",{"ect-border-b-1":t.expand,"ect-border-b-0":!t.expand}]),onClick:o[0]||(o[0]=s=>!t.disabled&&r.$emit("expand",!t.expand))},[t.title?(F(),Oe(rt,{key:0,tag:(i=t.style)==null?void 0:i.tag,text:t.title,style:Re(t.style)},null,8,["tag","text","style"])):me("",!0),t.loading?(F(),Oe(xr,{key:1,type:"accordian-title"})):me("",!0),x("div",null,[t.selectedText?(F(),q("span",sA,ke(t.selectedText),1)):me("",!0),x("span",lA,ke(t.expand?"expand_more":"expand_less"),1)])],2)):(F(),q("div",uA,[e.title?(F(),Oe(rt,{key:0,tag:(a=e.style)==null?void 0:a.tag,text:e.title,style:Re(e.style)},null,8,["tag","text","style"])):me("",!0)])),t.expand?(F(),q("div",cA,[lt(r.$slots,"default",{},void 0,!0)])):me("",!0)])}}},[["__scopeId","data-v-3796312d"]]);function fA(e,n,t){if(!n)return e;if(t.aliasName)return hA(e,n,t);{const o=n.split(".").reduce((i,a)=>i[a]||"",e)||"";return{original:o,value:o,metadata:t}}}function hA(e,n,t){var a;const r=n.split(".");let o=n;r.length>1&&(o=r.pop(),e=r.reduce((s,l)=>s[l]||{},e));let i=e[t.aliasName]||e[o]||"";return i&&t.dataType&&((a=t.dataType)==null?void 0:a.toUpperCase())==="CURRENCY"&&i.includes("(")&&(i=i.split("(")[0]),{value:i,original:e[o],metadata:t}}function pA(e){let n=e.replace(/[_.]/g,"")+"Formatted";return console.log("aliasName",n),n}const mA={class:"quote-summary"},gA={key:0,class:"qt-smuarry"},yA={class:"summary ect-mt-[1rem] md:ect-mt-[0]"},vA=Ne({__name:"OrganismsQuoteSummaryBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},tax:{type:Boolean,default:!1},quoteId:{type:String,default:""}},setup(e){const n=Wr(),t=e,r=hc(),o=be(()=>{var g;return(g=t.fields)==null?void 0:g.header}),i=be(()=>{var g;return(g=t.fields)==null?void 0:g.content}),a=be(()=>{var g;return(g=t.fields)==null?void 0:g.footer}),s=G(!1),l=G(!1),u=G(!1),c=G([]),h=G({}),d=be(()=>{var g,m;return r.isMobile.value&&!s.value&&a.value&&a.value.length>0?`${a.value[0].label} ${((g=h.value[a.value[0].field])==null?void 0:g.value)||""}`:(m=o.value)==null?void 0:m.title});async function p(g){console.log("Quote Summary",g),l.value=!0,u.value&&await n.calculateAvaTax();const m=c.value.map(({field:v})=>v);h.value=await n.getRecordFieldValue({recordId:t.quoteId,lstFields:m}),c.value.forEach(({field:v,dataType:y})=>{h.value[v]=fA(h.value,v,{dataType:y,aliasName:pA(v)})}),l.value=!1}const f=()=>{r.isMobile.value?s.value=!s.value:s.value=!0};return Et(async()=>{var m,v,y,b,_,C,k,E,S;s.value=!r.isMobile.value;const g=(v=(m=document.querySelector(`[page-block-id="${t.id}"]`))==null?void 0:m.parentElement)==null?void 0:v.parentElement;g&&(g.style.display=r.isMobile.value?"none":"block"),u.value=t.tax||((y=i.value)==null?void 0:y.some(({field:D})=>D==="XX_ORD1__Taxes__c")),(t.quoteId||u.value)&&(c.value=(_=(b=t.fields)==null?void 0:b.content)==null?void 0:_.map(({field:D,dataType:I})=>({field:D,dataType:I})),((k=(C=t.fields)==null?void 0:C.footer)==null?void 0:k.length)>0&&((S=(E=t.fields)==null?void 0:E.footer)==null||S.forEach(({field:D,dataType:I})=>c.value.push({field:D,dataType:I}))),p())}),(g,m)=>(F(),Oe(Md,{to:"#qtsummary",disabled:!Te(r).isMobile.value},[x("div",mA,[e.quoteId?(F(),q("div",gA,[pe(dA,{expand:s.value,title:d.value,style:Re(o.value.style),header:Te(r).isMobile.value,onExpand:m[0]||(m[0]=v=>f())},{default:ze(()=>[x("div",yA,[(F(!0),q(De,null,Le(i.value,v=>{var y,b,_,C;return F(),q("div",{key:v.field,class:"summary-item"},[v.label?(F(),Oe(rt,{key:0,tag:(y=v.style)==null?void 0:y.tag,text:v.label,style:Re(v.style)},null,8,["tag","text","style"])):me("",!0),(b=h.value[v.field])!=null&&b.value?(F(),Oe(rt,{key:1,loading:l.value,tag:(_=v.style)==null?void 0:_.tag,text:(C=h.value[v.field])==null?void 0:C.value,style:Re(v.style)},null,8,["loading","tag","text","style"])):me("",!0)])}),128)),(F(!0),q(De,null,Le(a.value,v=>{var y,b,_,C;return F(),q("div",{key:v.field,class:"summary-total"},[v.label?(F(),Oe(rt,{key:0,tag:(y=v.style)==null?void 0:y.tag,text:v.label,style:Re(v.style)},null,8,["tag","text","style"])):me("",!0),(b=h.value[v.field])!=null&&b.value?(F(),Oe(rt,{key:1,loading:l.value,tag:(_=v.style)==null?void 0:_.tag,text:(C=h.value[v.field])==null?void 0:C.value,style:Re(v.style)},null,8,["loading","tag","text","style"])):me("",!0)])}),128))])]),_:1},8,["expand","title","style","header"])])):me("",!0)])],8,["disabled"]))}},[["__scopeId","data-v-0821469a"]]),bA={primary:{bgColor:"#57c046",textColor:"#ffffff"},secondary:{bgColor:"#acacac",textColor:"#ffffff"},secondaryDark:{bgColor:"#5f5f5f",textColor:"#ffffff"},delete:{bgColor:"#ff6a6a",textColor:"#ffffff"},link:{bgColor:"#ffffff",textColor:"#57c046"},ghost:{bgColor:"#ffffff",textColor:"#5f5f5f"}},_A={name:"ThemeAlt",props:{tag:{type:String,default:"button"},text:{type:String,default:"text",required:!0},type:{type:String,default:"text"},method:{type:String,default:"button"},disabled:{type:Boolean,default:!1},showspinner:{type:Boolean,default:!1}},emits:["clicked"],methods:{getBtnClass(){const e=[];return!this.type||!bA[this.type]||this.type==="primary"?e.push("esg-btn-primary"):this.type==="secondary"?e.push("esg-btn-secondary"):(this.type==="link"||this.type==="ghost")&&e.push("noborder"),this.disabled&&e.push("disabled"),e},getBtnStyle(){return null}}},xA={key:0,class:"ect-flex ect-justify-center"},CA={key:1};function EA(e,n,t,r,o,i){const a=fn("AtomSpinner");return F(),Oe(Mo(t.tag),Bo(e.$attrs,{type:t.method,class:["rectangle-button",i.getBtnClass()],style:i.getBtnStyle(),onClick:n[0]||(n[0]=kt(s=>e.$emit("clicked"),["prevent"]))}),{default:ze(()=>[lt(e.$slots,"default",{},()=>[t.showspinner?(F(),q("div",xA,[pe(a,{class:"item-button_spinner"})])):(F(),q("div",CA,ke(t.text),1))],!0)]),_:3},16,["type","class","style"])}const _s=Ne(_A,[["render",EA],["__scopeId","data-v-7428ebd4"]]),kA={class:"promocode-input"},AA={class:"m-1"},wA=Ne({__name:"OrganismsPromoCodeBlock",props:{fields:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})},id:{type:String,required:!0},isPreview:{type:Boolean,default:!1}},setup(e){const n=Wr(),t=e,r=be(()=>t.fields.label),o=G(!1),i=G(""),a=G(!1),s=G(!1),l=G(""),u=G(null),c=async()=>{if(t.isPreview)return;a.value=!0,o.value=!0,s.value=!1,await n.getQLIsForPromoCode();const f=await h(!1);f.error||(l.value=f),a.value=!1},h=async f=>{const m=n.qlisList,v=Math.ceil(m.length/50);let y="";for(let b=0;b<v;b++){const _=b*50,C=_+50,k=b===v-1;if(y=await d(m.slice(_,C),k,f),y&&y.error)return s.value=y.error,u.value.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),a.value=!1,f||(o.value=!1,p(!0)),y}return y},d=async(f,g,m)=>await n.applyPromoCodeNG(m?"":i.value,f,g),p=async f=>{if(t.isPreview)return;a.value=!0,await n.getQLIsForPromoCode(),f!==!0&&(s.value=!1);const g=await h(!0);(!g||g&&!g.error)&&f!==!0&&(o.value=!1,l.value="",i.value=""),a.value=!1};return Et(async()=>{const f=await n.getPromoCodeInfo();console.log("Offer::",f),f!=null&&f.XX_ORD1__Promo_Code__c&&(i.value=f.XX_ORD1__Promo_Code__c,l.value=f.XX_ORD1__Short_Description__c,o.value=!0)}),(f,g)=>{var m,v,y,b,_,C,k;return F(),q("div",{ref_key:"promocodeRef",ref:u,class:"promocode"},[(m=r.value)!=null&&m.title?(F(),Oe(rt,{key:0,text:(v=r.value)==null?void 0:v.title,style:Re((y=r.value)==null?void 0:y.style)},null,8,["text","style"])):me("",!0),x("div",kA,[pe(yo,{modelValue:i.value,"onUpdate:modelValue":[g[0]||(g[0]=E=>i.value=E),g[1]||(g[1]=E=>o.value=!1)],class:"promocode-input_box",disabled:o.value||e.isPreview,error:s.value},null,8,["modelValue","disabled","error"]),a.value?(F(),Oe(du,{key:0})):(F(),q(De,{key:1},[o.value?(F(),Oe(_s,{key:1,theme:(C=e.fields.removeButton)==null?void 0:C.style.theme,disabled:i.value.length<1,text:(k=e.fields.removeButton)==null?void 0:k.title,onClick:p},null,8,["theme","disabled","text"])):(F(),Oe(_s,{key:0,theme:(b=e.fields.applyButton)==null?void 0:b.style.theme,disabled:i.value.length<1,text:(_=e.fields.applyButton)==null?void 0:_.title,onClick:c},null,8,["theme","disabled","text"]))],64)),x("span",AA,ke(l.value),1)])],512)}}},[["__scopeId","data-v-861bd8dd"]]),K2={"af-ZA":"yyyy/MM/dd","am-ET":"dd/MM/yyyy","ar-AE":"dd/MM/yyyy","ar-BH":"dd/MM/yyyy","ar-DZ":"dd-MM-yyyy","ar-EG":"dd/MM/yyyy","ar-IQ":"dd/MM/yyyy","ar-JO":"dd/MM/yyyy","ar-KW":"dd/MM/yyyy","ar-LB":"dd/MM/yyyy","ar-LY":"dd/MM/yyyy","ar-MA":"dd-MM-yyyy","ar-OM":"dd/MM/yyyy","ar-QA":"dd/MM/yyyy","ar-SA":"dd/MM/yyyy","ar-SY":"dd/MM/yyyy","ar-TN":"dd-MM-yyyy","ar-YE":"dd/MM/yyyy","arn-CL":"dd-MM-yyyy","as-IN":"dd-MM-yyyy","ba-RU":"dd.MM.yyyy","de-BE":"dd.MM.yyyy","be-BY":"dd.MM.yyyy","bg-BG":"dd.MM.yyyy","bn-BD":"dd-MM-yyyy","bs-BA":"yyyy-MM-dd","bn-IN":"dd-MM-yyyy","bo-CN":"yyyy/MM/dd","br-FR":"dd/MM/yyyy","ca-ES":"dd/MM/yyyy","co-FR":"dd/MM/yyyy","cs-CZ":"dd.MM.yyyy","cy-GB":"dd/MM/yyyy","da-DK":"dd.MM.yyyy","de-AT":"dd.MM.yyyy","de-CH":"dd.MM.yyyy","de-DE":"dd.MM.yyyy","de-LI":"dd.MM.yyyy","de-LU":"dd.MM.yyyy","dsb-DE":"dd.MM.yyyy","dv-MV":"dd/MM/yyyy","el-GR":"dd/MM/yyyy","en-029":"MM/dd/yyyy","en-AU":"dd/MM/yyyy","en-BZ":"dd/MM/yyyy","en-CA":"yyyy-MM-dd","en-GB":"dd/MM/yyyy","en-IE":"dd/MM/yyyy","en-ID":"dd/MM/yyyy","en-IN":"dd/MM/yyyy","lu-CD":"dd/MM/yyyy","en-JM":"dd/MM/yyyy","en-HK":"dd/MM/yyyy","en-MY":"dd/MM/yyyy","en-NZ":"dd/MM/yyyy","en-PH":"MM/dd/yyyy","en-SG":"dd/MM/yyyy","en-TT":"dd/MM/yyyy","en-US":"MM/dd/yyyy","en-ZA":"yyyy/MM/dd","en-ZW":"MM/dd/yyyy","es-AR":"dd/MM/yyyy","es-BO":"dd/MM/yyyy","es-CL":"dd-MM-yyyy","es-CO":"dd/MM/yyyy","es-CR":"dd/MM/yyyy","es-DO":"dd/MM/yyyy","es-EC":"dd/MM/yyyy","es-ES":"dd/MM/yyyy","es-GT":"dd/MM/yyyy","es-HN":"dd/MM/yyyy","es-MX":"dd/MM/yyyy","es-NI":"dd/MM/yyyy","es-PA":"MM/dd/yyyy","es-PE":"dd/MM/yyyy","es-PR":"dd/MM/yyyy","es-PY":"dd/MM/yyyy","es-SV":"dd/MM/yyyy","es-US":"MM/dd/yyyy","es-UY":"dd/MM/yyyy","es-VE":"dd/MM/yyyy","et-EE":"dd.MM.yyyy","eu-ES":"yyyy/MM/dd","fa-IR":"MM/dd/yyyy","fi-FI":"dd.MM.yyyy","fil-PH":"MM/dd/yyyy","fo-FO":"dd-MM-yyyy","fr-BE":"dd/MM/yyyy","fr-CA":"yyyy-MM-dd","fr-CH":"dd.MM.yyyy","fr-FR":"dd/MM/yyyy","fr-LU":"dd/MM/yyyy","fr-MC":"dd/MM/yyyy","fy-NL":"dd-MM-yyyy","ga-IE":"dd/MM/yyyy","gd-GB":"dd/MM/yyyy","gl-ES":"dd/MM/yyyy","gsw-FR":"dd/MM/yyyy","gu-IN":"dd-MM-yyyy","ha-Latn-NG":"dd/MM/yyyy","he-IL":"dd/MM/yyyy","hi-IN":"dd/MM/yyyy","hr-BA":"dd.MM.yyyy.","hr-HR":"dd.MM.yyyy","hsb-DE":"dd.MM.yyyy","hu-HU":"yyyy.MM.dd.","hy-AM":"dd.MM.yyyy","ib-LU":"dd.MM.yyyy","id-ID":"dd/MM/yyyy","ig-NG":"dd/MM/yyyy","ii-CN":"yyyy/MM/dd","in-ID":"dd/MM/yyyy","is-IS":"dd.MM.yyyy","it-CH":"dd.MM.yyyy","it-IT":"dd/MM/yyyy","iu-Cans-CA":"dd/MM/yyyy","iu-Latn-CA":"dd/MM/yyyy","ja-JP":"yyyy/MM/dd","ka-GE":"dd.MM.yyyy","kk-KZ":"dd.MM.yyyy","kl-GL":"dd-MM-yyyy","km-KH":"dd/MM/yyyy","kn-IN":"dd-MM-yyyy","ko-KR":"yyyy.MM.dd","kok-IN":"dd-MM-yyyy","ky-KG":"dd.MM.yyyy","lb-LU":"dd/MM/yyyy","lo-LA":"dd/MM/yyyy","lt-LT":"yyyy.MM.dd","lv-LV":"yyyy.MM.dd.","mi-NZ":"dd/MM/yyyy","mk-MK":"dd.MM.yyyy","ml-IN":"dd-MM-yyyy","mn-MN":"yyyy.MM.dd","mn-Mong-CN":"yyyy/MM/dd","moh-CA":"MM/dd/yyyy","mr-IN":"dd-MM-yyyy","ms-BN":"dd/MM/yyyy","ms-MY":"dd/MM/yyyy","mt-MT":"dd/MM/yyyy","nb-NO":"dd.MM.yyyy","ne-NP":"MM/dd/yyyy","nl-BE":"dd/MM/yyyy","nl-NL":"dd-MM-yyyy","nn-NO":"dd.MM.yyyy","nso-ZA":"yyyy/MM/dd","oc-FR":"dd/MM/yyyy","or-IN":"dd-MM-yyyy","pa-IN":"dd-MM-yyyy","pl-PL":"dd.MM.yyyy","prs-AF":"dd/MM/yyyy","ps-AF":"dd/MM/yyyy","pt-BR":"dd/MM/yyyy","pt-PT":"dd/MM/yyyy","qut-GT":"dd/MM/yyyy","quz-BO":"dd/MM/yyyy","quz-EC":"dd/MM/yyyy","quz-PE":"dd/MM/yyyy","rm-CH":"dd/MM/yyyy","ro-RO":"dd.MM.yyyy","ru-RU":"dd.MM.yyyy","rw-RW":"MM/dd/yyyy","sa-IN":"dd-MM-yyyy","sah-RU":"MM.dd.yyyy","sh-CS":"dd.MM.yyyy","sr-CS":"dd.MM.yyyy","se-FI":"dd.MM.yyyy","se-NO":"dd.MM.yyyy","se-SE":"yyyy-MM-dd","si-LK":"yyyy-MM-dd","sk-SK":"dd.MM.yyyy","sl-SI":"dd.MM.yyyy","sma-NO":"dd.MM.yyyy","sma-SE":"yyyy-MM-dd","smj-NO":"dd.MM.yyyy","smj-SE":"yyyy-MM-dd","smn-FI":"dd.MM.yyyy","sms-FI":"dd.MM.yyyy","sq-AL":"yyyy-MM-dd","sr-Cyrl-BA":"dd.MM.yyyy","sr-Cyrl-CS":"dd.MM.yyyy","sr-Cyrl-ME":"dd.MM.yyyy","sr-Cyrl-RS":"dd.MM.yyyy","sr-Latn-BA":"dd.MM.yyyy","sr-Latn-CS":"dd.MM.yyyy","sr-Latn-ME":"dd.MM.yyyy","sr-Latn-RS":"dd.MM.yyyy","sv-FI":"dd.MM.yyyy","sv-SE":"yyyy-MM-dd","sw-KE":"MM/dd/yyyy","syr-SY":"dd/MM/yyyy","ta-IN":"dd-MM-yyyy","te-IN":"dd-MM-yyyy","tg-Cyrl-TJ":"dd.MM.yyyy","th-TH":"dd/MM/yyyy","tk-TM":"dd.MM.yyyy","tn-ZA":"yyyy/MM/dd","tr-TR":"dd.MM.yyyy","tt-RU":"dd.MM.yyyy","tzm-Latn-DZ":"dd-MM-yyyy","ug-CN":"yyyy-MM-dd","uk-UA":"dd.MM.yyyy","ur-PK":"dd/MM/yyyy","uz-Cyrl-UZ":"dd.MM.yyyy","uz-Latn-UZ":"dd/MM yyyy","vi-VN":"dd/MM/yyyy","wo-SN":"dd/MM/yyyy","xh-ZA":"yyyy/MM/dd","yo-NG":"dd/MM/yyyy","zh-CN":"yyyy/MM/dd","zh-HK":"dd/MM/yyyy","zh-MO":"dd/MM/yyyy","zh-SG":"dd/MM/yyyy","zh-TW":"yyyy/MM/dd","zu-ZA":"MM/dd/yyyy"};function IA(e){return K2[e]||"dd/MM/yyyy"}function SA(e,n){if((e==null?void 0:e.length)<6||!n)return null;const t=K2[n]||"dd/MM/yyyy",r=t.includes("/")?"/":t.includes("-")?"-":".",o=t.split(r),i=e.split(r),a={};if(o.forEach((l,u)=>{a[l]=parseInt(i[u])}),a.yyyy>9999||a.yyyy<1e3||a.MM<0||a.MM>12||a.dd<0||a.dd>31)return null;const s=new Date(a.yyyy,a.MM-1,a.dd);return s!="Invalid Date"?s:null}const xs=e=>(Qt("data-v-13eaa242"),e=e(),Zt(),e),OA=["data-test-id"],TA=["for","data-test-id"],DA=["data-test-id"],RA=["placeholder","data-test-id"],MA=["data-test-id"],FA=["data-test-id"],BA=["data-test-id"],NA=["data-test-id"],LA=[xs(()=>x("span",{class:"mdpchbi-left-arrows"},null,-1))],PA=["data-test-id"],qA=[xs(()=>x("span",{class:"mdpchbi-left-arrow"},null,-1))],$A=["data-test-id"],UA=["data-test-id"],jA=["data-test-id"],HA=["data-test-id"],VA=[xs(()=>x("span",{class:"mdpchbi-right-arrow"},null,-1))],zA=["data-test-id"],KA=[xs(()=>x("span",{class:"mdpchbi-right-arrows"},null,-1))],GA=["data-test-id"],XA={class:"c-container"},WA={class:"cc-head"},QA={class:"cc-body"},ZA={class:"cdc-day"},JA=["onClick"],YA=60*60*24*1e3,ew=Ne({__name:"InputDatepicker",props:{locale:{type:String,default:"en-US"},max:{type:[Date,String]},min:{type:[Date,String]},label:{type:String,default:""},error:{type:[Boolean,String]},required:{type:Boolean,default:!1},modelValue:{type:String},highlight:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},refrence:{type:Object},disableYear:{type:Boolean,default:!1},disableMonth:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","focus-in","focus-out","error"],setup(e,{emit:n}){const t=e,r=n,o=Date.now()-Date.now()%YA+new Date().getTimezoneOffset()*1e3*60,i=V=>{if(!V)return"";const[te,oe,le]=V.split("-");return`${oe}/${le}/${te}`},a=V=>{if(!V)return"";const[te,oe,le]=V.split("/");return`${le}-${te.padStart(2,"0")}-${oe.padStart(2,"0")}`},s=G({year:new Date().getFullYear(),month:new Date().getMonth(),selectedDay:o,monthDetails:[]}),l=G({position:"fixed",top:"0px",left:"0px",width:"0px"}),u=["SUN","MON","TUE","WED","THU","FRI","SAT"],c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"],d=G(new Date(1e3,0,1)),p=G(new Date(9999,0,1)),f=G(!0),g=G(!1),m=G(""),v=G(""),y=G(!1),b=G(""),_=G(-1),C=be(()=>IA(t.locale)),k=be(()=>d.value.getFullYear()<s.value.year),E=be(()=>p.value.getFullYear()>s.value.year),S=be(()=>k.value||d.value.getMonth()<s.value.month),D=be(()=>E.value||p.value.getMonth()>s.value.month),I=be(()=>{if(v.value){const V=v.value.getTime();if(p.value.getTime()<V)return"Max date can be "+p.value.toLocaleDateString(t.locale);if(d.value.getTime()>V)return"Min date can be "+d.value.toLocaleDateString(t.locale)}return!1}),A=be(()=>{let V=t.error===""?!1:t.error===!0?`${t.label||"Field"} is required`:t.error;return f.value||(V="Date format must be "+C.value),I.value&&(V=I.value),r("error",V),V}),w=be(()=>(b.value==""||b.value==null)&&(t.modelValue==""||t.modelValue==null)?!1:b.value!=t.modelValue);We(()=>t.modelValue,V=>{m.value=V?i(V):""}),We(()=>t.min,V=>{d.value=V?new Date(V):new Date(1e3,0,1)}),We(()=>t.max,V=>{p.value=V?new Date(V):new Date(9999,0,1)}),We(m,V=>{if(V)try{const te=SA(V,t.locale);if(v.value=te||v.value,f.value=!!te,f.value){const oe=a(V);if(b.value===oe)return;r("update:modelValue",oe)}}catch(te){console.info("[ERROR]: Date parsing error:",te),f.value=!1}else f.value=!0,v.value=null,r("update:modelValue","")});const T=G(null),P=G(null),X=G(null);Et(()=>{K(),p.value=t.max?new Date(t.max):p.value,d.value=t.min?new Date(t.min):d.value,t.modelValue&&(m.value=i(t.modelValue),f.value=!!m.value),b.value=t.modelValue,window.addEventListener("resize",$),window.addEventListener("scroll",$,!0)}),tr(()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)});const $=()=>{if(!X.value)return;const V=X.value.getBoundingClientRect(),te=334;l.value={position:"fixed",top:`${V.bottom+4}px`,left:`${V.left}px`,width:`${te}px`,zIndex:9999}},J=()=>{y.value||(j(),y.value=!0,$(),r("focus-in"))},ee=(V=!1)=>{(!g.value||V)&&setTimeout(()=>{_.value=-1,y.value=!1,r("focus-out",v.value)},100)},Y=()=>{P.value&&P.value.focus()},U=V=>{const te=V.index-V.firstDay,oe=V.index%7;let le=V.month-1,ne=V.year;le<0&&(le=11,ne--);const de=O(ne,le),ve=(te<0?de+te:te%V.numberOfDays)+1,xe=new Date(V.year,V.month,ve).getTime(),ce=te<0||d.value.getTime()>xe?-1:te>=V.numberOfDays||p.value.getTime()<xe?1:0;return{date:ve,day:oe,month:ce,timestamp:xe,dayString:c[oe]}},O=(V,te)=>40-new Date(V,te,40).getDate(),R=(V,te)=>{const oe=new Date(V,te).getDay(),le=O(V,te),ne=[],de=6;let ve=null,xe=0;const ce=7;for(let re=0;re<de;re++)for(let ue=0;ue<ce;ue++)ve=U({index:xe,numberOfDays:le,firstDay:oe,year:V,month:te}),ne.push(ve),xe++;return ne},M=V=>V.timestamp===o,N=V=>V.timestamp===s.value.selectedDay,H=V=>{if(!V)return null;if(V instanceof Date)return{year:V.getFullYear(),month:V.getMonth()+1,date:V.getDate()};if(typeof V=="string"&&V.includes("/")){const[te,oe,le]=V.split("/");return{year:parseInt(le),month:parseInt(te),date:parseInt(oe)}}return null},L=V=>h[Math.max(Math.min(11,V),0)]||"Month",z=V=>{const te=new Date(V.year,V.month-1,V.date).getTime();s.value={selectedDay:te}},j=()=>{K();const V=H(v.value);V!==null&&(z(V),s.value={year:V.year,month:V.month-1,monthDetails:R(V.year,V.month-1)})},W=V=>{const te=new Date(V),oe=(te.getMonth()+1).toString().padStart(2,"0"),le=te.getDate().toString().padStart(2,"0"),ne=te.getFullYear();return m.value=`${oe}/${le}/${ne}`,`${ne}-${oe}-${le}`},Q=V=>{s.value={selectedDay:V.timestamp};const te=W(V.timestamp);ee(!0),r("update:modelValue",te),P.value&&P.value.blur()},ae=V=>{if(t.disableYear)return;const te=s.value.year+V;let oe=s.value.month;d.value.getFullYear()===te&&d.value.getMonth()>oe&&(oe=d.value.getMonth()),p.value.getFullYear()===te&&p.value.getMonth()<oe&&(oe=p.value.getMonth()),s.value={year:te,month:oe,monthDetails:R(te,oe)}},fe=V=>{if(t.disableMonth)return;let te=s.value.year,oe=s.value.month+V;oe===-1?(oe=11,te--):oe===12&&(oe=0,te++),s.value={year:te,month:oe,monthDetails:R(te,oe)}},K=()=>{const V=new Date,te=V.getFullYear(),oe=V.getMonth();s.value={...s.value,year:te,month:oe,selectedDay:o,monthDetails:R(te,oe)}};return(V,te)=>(F(),q(De,null,[x("div",{ref_key:"datePick",ref:T,class:"MyDatePicker","data-test-id":e.dataTestId,onMouseover:te[2]||(te[2]=oe=>g.value=!0),onMouseout:te[3]||(te[3]=oe=>g.value=!1)},[e.label?(F(),q("label",{key:0,class:Me(["title_label",{error_color:!!A.value}]),for:e.label,"data-test-id":`${e.dataTestId}-label`},[Ve(ke(e.label)+" ",1),e.required?(F(),q("span",{key:0,class:Me({error_color:!!A.value})},"*",2)):me("",!0)],10,TA)):me("",!0),x("div",{ref_key:"triggerElement",ref:X,tabindex:"0",class:Me(["mdp-input ectheme-input-box ect-mb-0",{"mdp-input_focus":y.value,errorBorder_color:!!A.value,highlight:w.value&&e.highlight}]),"data-test-id":`${e.dataTestId}-input-wrapper`,onFocusin:J,onFocusout:te[1]||(te[1]=oe=>ee(!1)),onClick:Y},[An(x("input",{id:"calendar",ref_key:"inputRef",ref:P,"onUpdate:modelValue":te[0]||(te[0]=oe=>m.value=oe),type:"text",autocomplete:"off",placeholder:C.value,"data-test-id":`${e.dataTestId}-input`},null,8,RA),[[po,m.value]]),pe(Ge,{icon:"calendar_today",size:18,for:"calendar","data-test-id":`${e.dataTestId}-calendar-icon`},null,8,["data-test-id"])],42,DA),A.value?(F(),q("label",{key:1,class:"error_label","data-test-id":`${e.dataTestId}-error`},[x("p",null,ke(A.value),1)],8,MA)):me("",!0)],40,OA),(F(),Oe(Md,{to:".dropdowntp"},[y.value&&!e.disabled?(F(),q("div",{key:0,class:"mdp-container",style:Re(l.value),"data-test-id":`${e.dataTestId}-calendar-popup`,onMousedown:te[8]||(te[8]=kt(()=>{},["prevent"]))},[x("div",{class:"mdpc-head","data-test-id":`${e.dataTestId}-calendar-header`},[x("div",{class:"mdpch-button","data-test-id":`${e.dataTestId}-prev-year-button`},[x("div",{class:Me(["mdpchb-inner",{disabled:!k.value||e.disableYear}]),onClick:te[4]||(te[4]=oe=>ae(-1))},LA,2)],8,NA),x("div",{class:"mdpch-button","data-test-id":`${e.dataTestId}-prev-month-button`},[x("div",{class:Me(["mdpchb-inner",{disabled:!S.value||e.disableMonth}]),onClick:te[5]||(te[5]=oe=>fe(-1))},qA,2)],8,PA),x("div",{class:"mdpch-container","data-test-id":`${e.dataTestId}-date-display`},[x("div",{class:"mdpchc-year","data-test-id":`${e.dataTestId}-year-display`},ke(s.value.year),9,UA),x("div",{class:"mdpchc-month","data-test-id":`${e.dataTestId}-month-display`},ke(L(s.value.month)),9,jA)],8,$A),x("div",{class:"mdpch-button","data-test-id":`${e.dataTestId}-next-month-button`},[x("div",{class:Me(["mdpchb-inner",{disabled:!D.value||e.disableMonth}]),onClick:te[6]||(te[6]=oe=>fe(1))},VA,2)],8,HA),x("div",{class:"mdpch-button","data-test-id":`${e.dataTestId}-next-year-button`},[x("div",{class:Me(["mdpchb-inner",{disabled:!E.value||e.disableYear}]),onClick:te[7]||(te[7]=oe=>ae(1))},KA,2)],8,zA)],8,BA),x("div",{class:"mdpc-body","data-test-id":`${e.dataTestId}-calendar-body`},[x("div",XA,[x("div",WA,[(F(),q(De,null,Le(u,(oe,le)=>x("div",{key:le,class:"cch-name"},ke(oe),1)),64))]),x("div",QA,[(F(!0),q(De,null,Le(s.value.monthDetails,(oe,le)=>(F(),q("div",{key:le,class:Me(["c-day-container",{disabled:oe.month!==0,highlight:M(oe),"highlight-green":N(oe)}])},[x("div",ZA,[x("span",{onClick:ne=>Q(oe)},ke(oe.date),9,JA)])],2))),128))])])],8,GA)],44,FA)):me("",!0)]))],64))}},[["__scopeId","data-v-13eaa242"]]),G2=e=>(Qt("data-v-9b473c8b"),e=e(),Zt(),e),tw=G2(()=>x("div",{class:"dropdowntp"},null,-1)),nw={key:0,class:"custom-form_block"},rw={class:"custom-form_block-header"},ow={key:0,class:"custom-form_block-content"},iw={key:1,class:"custom-form_block-content"},aw={key:2,class:"custom-form_block-footer"},sw={key:3,class:"custom-form_block-action"},lw={key:1,class:"custom-form_success"},uw={class:"custom-form_success_message"},cw=G2(()=>x("span",{class:"custom-form_success_message-icon material-icons-outlined"}," done ",-1)),dw=Ne({__name:"OrganismsCustomFormBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},options:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},setup(e,{expose:n}){var S;const t=Wr(),r=e,o=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=G({}),a=G(!1),s=G(!1),l=G(!1),u=G({}),c=G({}),h=be(()=>{var D;return(D=r.fields)==null?void 0:D.header}),d=be(()=>{var D;return(D=r.fields)==null?void 0:D.footer}),p=be(()=>r.fields&&r.fields.action&&r.fields.action.label?r.fields.action:!1),f=be(()=>"en-US"),g=be(()=>{var D;return(D=r.fields)==null?void 0:D.confirmation}),m=be(()=>r.configuration),v=G(JSON.parse(JSON.stringify((S=r.fields)==null?void 0:S.content))),y=D=>D?"custom-form_block-content_"+D.toLowerCase():"custom-form_block-content_full",b=()=>{l.value=!1,v.value.forEach(D=>{m.value.populate||(i.value[D.field]="")})},_=pn(async function(D,I,A){v.value[A].loading=!0;const w={objectApiName:r.configuration.objectType,lookupFieldApiName:I,searchTerm:D||""},T=await t.getLookupRecords(w);console.log("Records:::",T),v.value[A].options=T,v.value[A].loading=!1}),C=pn(()=>{!p.value&&!r.fields.isGuidance&&k(!0)},500),k=async D=>{console.log("handlerActionClick");let I=!1;if(v.value.forEach(A=>{A.isFormulaField||(A.dataType==="DATETIME"?i.value[A.field]=new Date().toISOString():A.required&&A.editable&&!i.value[A.field]&&A.dataType!=="BOOLEAN"?(A.error=!0,I=!0):(A.error=null,A.dataType==="EMAIL"&&i.value[A.field]&&!o.test(i.value[A.field])&&(A.error="Enter a valid email",I=!0)))}),!I){s.value=!0;const A=[];for(const T in i.value)(c.value[T]||T==="Id")&&A.push({fieldName:T,fieldValue:i.value[T]});const w={fields:A,objectType:r.configuration.objectType};if(r.options&&r.options.returnError){const T=await t.updateRecord(w,!0);if(!T||typeof T=="object"&&T.ERROR)return console.log("Error in saving",T),s.value=!1,T?T.ERROR:!1}else if(!await t.updateRecord(w))return s.value=!1,!1;return s.value=!1,D||(l.value=!0),!0}};async function E(){a.value=!0;const D=v.value.filter(A=>A.dataType!=="DATETIME").map(A=>A.field);let I={};if(m.value.populate&&r.quoteId&&D.length)try{I=await t.getRecordFieldValue({recordId:r.quoteId,lstFields:D})||{}}catch(A){console.error("[OrganismsCustomFormBlock] getRecordFieldValue failed",A)}v.value.forEach(A=>{var w,T,P;if(A.visiblity=A.dataType!=="DATETIME",m.value.populate&&r.quoteId)if(A.dataType==="BOOLEAN")i.value[A.field]=((w=I[A.field])==null?void 0:w.value)??!1;else if(A.dataType==="REFERENCE"){const X=A.field.replace("__c","__r"),$=(T=I[X])==null?void 0:T.value;$&&(i.value[A.field]=$.Id,A.options=[{Name:$.Name,Id:$.Id}])}else A.dataType==="DATE"?i.value[A.field]=((P=I[A.field])==null?void 0:P.value)??"":i.value[A.field]=vt(I,A.field,A.dataType,!0,!0);A.editable&&A.dataType==="PICKLIST"&&(A.options=A.picklist.map(X=>({label:X,value:X})))}),a.value=!1}return Jt(async()=>{a.value=!0,u.value=JSON.parse(JSON.stringify(r.fields)),v.value=u.value.content,v.value.forEach(D=>{c.value[D.field]=D.editable&&!D.isFormulaField,D.size=y(D.size)}),u.value.request=i.value={Id:r.quoteId},r.quoteId&&await E()}),n({handlerActionClick:k}),(D,I)=>{var A,w,T,P,X,$,J;return F(),q(De,null,[tw,l.value?(F(),q("div",lw,[x("div",uw,[cw,Ve(" "+ke((J=g.value)==null?void 0:J.label),1)]),g.value&&g.value.close?(F(),q("a",{key:0,onClick:b},"click to close")):me("",!0)])):(F(),q("div",nw,[x("div",rw,[(A=h.value)!=null&&A.title?(F(),Oe(rt,{key:0,text:(w=h.value)==null?void 0:w.title,style:Re((T=h.value)==null?void 0:T.style)},null,8,["text","style"])):me("",!0)]),a.value?(F(),q("div",ow,[(F(!0),q(De,null,Le(v.value,(ee,Y)=>(F(),q("div",{key:Y,class:Me(["custom-form_block-content_skeletion",ee.size])},[pe(Gn)],2))),128))])):a.value?me("",!0):(F(),q("div",iw,[(F(!0),q(De,null,Le(v.value,(ee,Y)=>(F(),q(De,{key:Y},[ee.visiblity?(F(),q("div",{key:0,class:Me(["custom-form_block-content_input",ee.size])},[ee.dataType==="PICKLIST"?(F(),Oe(ar,{key:0,modelValue:i.value[ee.field],"onUpdate:modelValue":[U=>i.value[ee.field]=U,Te(C)],options:ee.options,disabled:!ee.editable,select:"",error:ee.error,required:ee.required,label:ee.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label"])):ee.dataType==="BOOLEAN"?(F(),Oe(vs,{key:1,modelValue:i.value[ee.field],"onUpdate:modelValue":[U=>i.value[ee.field]=U,Te(C)],label:ee.label},null,8,["modelValue","onUpdate:modelValue","label"])):ee.dataType==="REFERENCE"?(F(),Oe(ar,{key:2,modelValue:i.value[ee.field],"onUpdate:modelValue":[U=>i.value[ee.field]=U,Te(C)],options:ee.options,disabled:!ee.editable,lookup:"",search:"",error:ee.error,required:ee.required,label:ee.label,loading:ee.loading,highlight:"",property:{key:"Id",value:"Name"},onSearch:U=>Te(_)(U,ee.field,Y)},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label","loading","onSearch"])):ee.dataType==="DATE"?(F(),Oe(ew,{key:3,modelValue:i.value[ee.field],"onUpdate:modelValue":U=>i.value[ee.field]=U,label:ee.label,required:ee.required,disabled:!ee.editable,error:ee.error,locale:f.value,"data-test-id":`cart-customform-datepicker-${ee.field}`,highlight:""},null,8,["modelValue","onUpdate:modelValue","label","required","disabled","error","locale","data-test-id"])):ee.visiblity?(F(),Oe(yo,{key:4,modelValue:i.value[ee.field],"onUpdate:modelValue":[U=>i.value[ee.field]=U,Te(C)],error:ee.error,required:ee.required,disabled:!ee.editable,label:ee.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","error","required","disabled","label"])):me("",!0)],2)):me("",!0)],64))),128))])),d.value?(F(),q("div",aw,[(P=d.value)!=null&&P.title?(F(),Oe(rt,{key:0,text:(X=d.value)==null?void 0:X.title,style:Re(($=d.value)==null?void 0:$.style)},null,8,["text","style"])):me("",!0)])):me("",!0),p.value?(F(),q("div",sw,[s.value?(F(),Oe(du,{key:0,class:"item-button_spinner"})):(F(),Oe(_s,{key:1,theme:p.value.style.theme,text:p.value.label,onClick:I[0]||(I[0]=ee=>k(!1))},null,8,["theme","text"]))])):me("",!0)]))],64)}}},[["__scopeId","data-v-9b473c8b"]]),fw={class:"custom-button"},hw={class:"loader"},pw=Ne({__name:"OrganismsCustomButtonBlock",props:{configuration:{type:Object,required:!0,default:()=>({})},fields:{type:Object,required:!0,default:()=>({})},id:{type:String,default:""},isPreview:{type:Boolean,default:!1}},setup(e){const n=Wr(),t=_r(),r=G(null),o=e,i=be(()=>{var c;return!!((c=t.quoteRecord)!=null&&c.XX_ORD1__Active_Customer_Contact__c)||!0}),a=be(()=>{var c,h;return(h=(c=o.fields)==null?void 0:c.actions)==null?void 0:h.filter(d=>i.value?d.action!=="ACTIVATE":d.action!=="SAVE_FOR_LATER")}),s=c=>c.key??`${c.action}-${c.label}`,l=c=>r.value===s(c),u=c=>{if(o.isPreview)return;const h=s(c);c.action==="SAVE_FOR_LATER"&&(r.value=h),rn("expeditecart:clicked",{action:c.action,label:c.label,targetTemplateId:c.targetTemplateId,quoteId:n.quoteId,isActive:i.value,isPreview:o.isPreview})};return(c,h)=>(F(),q("div",fw,[(F(!0),q(De,null,Le(a.value,(d,p)=>(F(),Oe(_s,{key:p,theme:d.style.theme,text:d.label,class:"custom-button_action",onClick:f=>u(d)},{default:ze(()=>[x("span",{class:Me({"text-loading":l(d)})},ke(d.label),3),x("span",hw,[l(d)?(F(),Oe(H2,{key:0})):me("",!0)])]),_:2},1032,["theme","text","onClick"]))),128))]))}},[["__scopeId","data-v-3245ee72"]]),pc=function(e,n){const t={};t.sectionStyle={},t.blockStyle={};const{visiblity:r}=e;t.visibility=r;const{layout:o}=e;if(t.blockStyle=mw(o,n),o&&(o!=null&&o.padding)){const{top:s,bottom:l,left:u,right:c}=o.padding;s&&(t.sectionStyle.paddingTop=`${s}px`),l&&(t.sectionStyle.paddingBottom=`${l}px`),u&&(t.sectionStyle.paddingLeft=`${u}px`),c&&(t.sectionStyle.paddingRight=`${c}px`)}o!=null&&o.gap&&(t.sectionStyle.gap=`${o.gap}px`);const{styling:i}=e;i&&(i.verticalAlignment&&(t.sectionStyle.alignItems=i.verticalAlignment),i.radius&&(t.sectionStyle.borderRadius=i.radius),i.borderStyle&&(t.sectionStyle.borderStyle=i.borderStyle));const{Background:a}=e;return a&&a.style==="Solid"&&(t.sectionStyle.backgroundColor=a.color),a&&a.opacity==="100%"&&(t.sectionStyle.opacity=1),a&&a.image&&a.image!=="sampleImage.png"&&(t.sectionStyle.backgroundImage=`url(${a.image})`,a.imageSize&&(t.sectionStyle.backgroundSize=a.imageSize)),a&&a.repeat==="no-repeat"&&(t.sectionStyle.backgroundRepeat=a.repeat),a&&(a.horizontalAlignment||a.verticalAlignment)&&(t.sectionStyle.backgroundPosition=a.horizontalAlignment+" "+a.verticalAlignment),t};function mw(e,n){if(!e)return[{}];const{columnSize:t,columns:r}=e;if(n)return Array(r).fill({display:"flex",flexDirection:"column",width:"100%"});if(!t)return Array(r).fill({});const o=t.split("/");return typeof r=="string"&&o.length!==parseInt(r)?Array(r).fill({}):typeof r=="number"&&o.length!==r?Array(r).fill({}):o.map(i=>({flexBasis:`${i}`}))}const gw=["data-sid","data-sname"],yw=["data-bid","data-bname"],vw=["page-block-id"],bw=["page-block-id"],_w=["page-block-id"],xw=["page-block-id"],Cw=["page-block-id"],Ew=["page-block-id"],X2={__name:"TemplateRenderer",props:{onCatalogCountUpdate:{type:Function,default:null},initialCatalogItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1},quoteId:{type:String,default:null}},setup(e,{expose:n}){const t=e,r=Fi(),o=Wr(),i=hc(),a=be(()=>r.pageBlocks||[]),s=G(0);n({refreshTemplate:()=>{s.value+=1}});const u=h=>!0,c=be(()=>{var d,p,f,g;const h=[];return console.log("props.sections template renderer",a.value),console.log("props.isPreview",t.isPreview),t.isPreview&&((d=a.value)!=null&&d.content)?(f=(p=a.value)==null?void 0:p.content)==null||f.forEach(m=>{const v=[],y=m.section,b=JSON.parse(y.XX_ORD1__Content_JSON__c);let _={};b&&(_=pc(b,i.isMobile),y.styleObject=y.hideStyle?{}:_.sectionStyle,y.visibility=_.visibility),m.blocks.forEach(C=>{let k=C.XX_ORD1__Content_Block__r;const E=JSON.parse(k.XX_ORD1__Content_JSON__c);k={...k,...E};let S={};E&&(S=pc(E,i.isMobile),k.styleObject=k.hideStyle?{}:S.blockStyle),v.push(k)}),y.blocks=v,h.push(y)}):(g=a.value)==null||g.forEach(m=>{var _;const v={...m},y=typeof m.contentJSON=="string"?JSON.parse(m.contentJSON):m.contentJSON;let b={};y&&(b=pc(y,i.isMobile),v.styleObject=m.hideStyle?{}:b.sectionStyle,v.visibility=b.visibility,(_=v.blocks)==null||_.forEach((C,k)=>{C.styleObject=b.blockStyle[k]})),h.push(v)}),h});return(h,d)=>(F(),q(De,null,[pe(uu),(F(),q("div",{key:s.value,class:"contentRendered ectheme",style:{width:"100%","box-sizing":"border-box"}},[(F(!0),q(De,null,Le(c.value,p=>(F(),q(De,{key:p.id},[u(p.visibility)?(F(),q("div",{key:0,style:Re(p.styleObject),class:"ect-flex ect-flex-col","data-sid":p.sectionId,"data-sname":p.sectionName},[(F(!0),q(De,null,Le(p.blocks,f=>(F(),q("div",{key:f.id,style:Re(f.styleObject),class:"ect-w-full","data-bid":f.blockId,"data-bname":f.blockName},[f.componentName==="productList"&&Te(o).quoteId?(F(),q("div",{key:0,"page-block-id":f.Id,class:"ect-m-auto ect-w-full"},[pe(iA,{id:f.Id,header:f.fields.header,columns:f.fields.columns,footer:f.fields.footer,fields:f.fields,configuration:f.configuration,"is-preview":e.isPreview},null,8,["id","header","columns","footer","fields","configuration","is-preview"])],8,vw)):f.componentName==="quoteSummary"&&Te(o).quoteId?(F(),q("div",{key:1,"page-block-id":f.Id,class:""},[pe(vA,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":Te(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,bw)):f.componentName==="promoCode"?(F(),q("div",{key:2,"page-block-id":f.Id,class:""},[pe(wA,{id:f.Id,fields:f.fields,configuration:f.configuration,"is-preview":e.isPreview},null,8,["id","fields","configuration","is-preview"])],8,_w)):f.componentName==="customForm"&&Te(o).quoteId?(F(),q("div",{key:3,"page-block-id":f.Id,class:"ect-w-full"},[pe(dw,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":Te(o).quoteId},null,8,["id","configuration","fields","quote-id"])],8,xw)):f.componentName==="customButtons"?(F(),q("div",{key:4,"page-block-id":f.Id,class:""},[pe(pw,{id:f.Id,configuration:f.configuration,fields:f.fields,"is-preview":e.isPreview},null,8,["id","configuration","fields","is-preview"])],8,Cw)):f.componentName==="catalogBlock"?(F(),q("div",{key:5,"page-block-id":f.Id,class:""},[pe(LE,{id:f.Id,mode:"preview",configuration:f.configuration,fields:f.fields,"search-term":f.searchTerm,"on-count-update":e.onCatalogCountUpdate,"initial-items":e.initialCatalogItems,"is-preview":e.isPreview,"quote-id":e.quoteId},null,8,["id","configuration","fields","search-term","on-count-update","initial-items","is-preview","quote-id"])],8,Ew)):me("",!0)],12,yw))),128))],12,gw)):me("",!0)],64))),128))]))],64))}},kw=e=>(Qt("data-v-04b2bdef"),e=e(),Zt(),e),Aw={class:"ect-composable-catalog-wrapper","data-test-id":"expose-expediteCatalog-wrapper"},ww={key:0,class:"ect-flex ect-items-center ect-justify-center ect-min-h-[50vh]","data-test-id":"expose-expediteCatalog-loader"},Iw=[kw(()=>x("div",{class:"ect-flex ect-flex-col ect-items-center ect-gap-3"},[x("div",{class:"ect-spinner","aria-label":"Loading"}),x("div",{class:"ect-text-sm ect-text-gray-500"},"Loading catalog…")],-1))],W2=Ne({__name:"ExpediteCatalog",props:{templateId:{type:String,required:!0},identity:{type:Object,required:!1,default:()=>({})},session:{type:Object,required:!1,default:()=>({})},security:{type:Object,required:!1,default:()=>({})},resources:{type:Object,required:!1,default:()=>({})},searchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},previewData:{type:Object,default:()=>({})},initialData:{type:Array,default:()=>[]},isPreview:{type:Boolean,required:!0},sections:{type:Array,required:!0},theme:{type:Object,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},composablesOrgType:{type:String,required:!1},composablesApiKey:{type:String,required:!1}},emits:["catalog-item-added","catalog-item-qty-updated","catalog-line-deleted","catalog-items-fetched","catalog-item-configure","catalog-items-loaded","catalog:id"],setup(e,{emit:n}){const t=Ht(),r=_r(),o=Fi(),i=e,a=G(!1),s=G(!1),l=G(null),u=n,c=[],h=()=>{a.value=window.innerWidth<=768};return Jt(async()=>{var p,f,g,m,v,y,b,_,C,k,E,S,D;t.updateConfig({templateId:i.templateId,organizationId:(p=i.identity)==null?void 0:p.organizationId,hostName:i.hostName,graphqlEndpoint:i.graphqlEndpoint,apiKey:((f=i.security)==null?void 0:f.apiKey)||i.apiKey,accountId:(g=i.identity)==null?void 0:g.accountId,cid:(m=i.identity)==null?void 0:m.contactId,composablesApiUrl:(v=i.security)==null?void 0:v.baseUrl,accessToken:(y=i.security)==null?void 0:y.accessToken,composablesOrgType:i.composablesOrgType,isPreview:i.isPreview,quoteId:(b=i.session)==null?void 0:b.quoteId,userId:(_=i.identity)==null?void 0:_.userId,siteUrl:(C=i.resources)==null?void 0:C.siteUrl}),t.quoteId=(k=i.session)==null?void 0:k.quoteId,console.log("props.sections expedite catalog",i.sections),await t.processSections(i.isPreview,i.sections);const d=(D=(S=(E=o.pageBlocks[0])==null?void 0:E.blocks[0])==null?void 0:S.configuration)==null?void 0:D.catalogId;d&&u("catalog:id",d)}),Et(async()=>{window.addEventListener("resize",h),h(),c.push(Sn("catalog:item-added",d=>{u("catalog-item-added",d)})),c.push(Sn("catalog:item-qty-updated",d=>{u("catalog-item-qty-updated",d)})),c.push(Sn("catalog:line-deleted",d=>{u("catalog-line-deleted",d)})),c.push(Sn("catalog:items-fetched",d=>{u("catalog-items-fetched",d)})),c.push(Sn("catalog:item-configure-clicked",d=>{u("catalog-item-configure",d)})),c.push(Sn("catalog:items-loaded",d=>{u("catalog-items-loaded",d)}))}),We(()=>i.session&&i.session.quoteId,d=>{d&&(t.updateConfig({quoteId:d}),t.quoteId=d,r.getQuoteItems(!0))}),We(()=>i.sections,async(d,p)=>{d!==p&&(await t.processSections(i.isPreview,d),l.value&&l.value.refreshTemplate&&l.value.refreshTemplate())},{deep:!0}),tr(()=>{c.forEach(d=>{try{d()}catch{}})}),(d,p)=>{var f,g;return F(),q("div",Aw,[pe(D2,{"organization-id":(f=i.identity)==null?void 0:f.organizationId,"template-id":i.templateId,"is-preview":i.isPreview,theme:i.theme},null,8,["organization-id","template-id","is-preview","theme"]),s.value?(F(),q("div",ww,Iw)):(F(),Oe(X2,{key:1,ref_key:"templateRendererRef",ref:l,"quote-id":(g=i.session)==null?void 0:g.quoteId,"is-preview":e.isPreview,"on-catalog-count-update":e.onCatalogCountUpdate,"initial-catalog-items":e.initialData},null,8,["quote-id","is-preview","on-catalog-count-update","initial-catalog-items"]))])}}},[["__scopeId","data-v-04b2bdef"]]),Q2={__name:"ExpediteCart",props:{templateId:{type:String,required:!0},hostName:{type:String,required:!1},composablesOrgType:{type:String,required:!1},sections:{type:String,required:!1},theme:{type:Object,required:!1},isPreview:{type:Boolean,required:!1},security:{type:Object,required:!1},identity:{type:Object,required:!1},session:{type:Object,required:!1},resources:{type:Object,required:!1}},emits:["expeditecart-item-configure","expeditecart-clicked"],setup(e,{emit:n}){const t=Ht(),r=Wr(),o=G(null),i=n,a=e;Jt(async()=>{var l,u,c,h,d,p,f,g,m;t.updateConfig({templateId:a.templateId,organizationId:(l=a.identity)==null?void 0:l.organizationId,accountId:(u=a.identity)==null?void 0:u.accountId,cid:(c=a.identity)==null?void 0:c.contactId,userId:(h=a.identity)==null?void 0:h.userId,accessToken:(d=a.security)==null?void 0:d.accessToken,composablesApiUrl:(p=a.security)==null?void 0:p.baseUrl,quoteId:(f=a.session)==null?void 0:f.quoteId,composablesOrgType:"Production",hostName:a.hostName,isPreview:a.isPreview,siteUrl:(g=a.resources)==null?void 0:g.siteUrl}),r.quoteId=(m=a.session)==null?void 0:m.quoteId,await t.processSections(a.isPreview,a.sections)});const s=[];return Et(()=>{s.push(Sn("expeditecart:configure-clicked",l=>{i("expeditecart-item-configure",l)})),s.push(Sn("expeditecart:clicked",l=>{i("expeditecart-clicked",l)}))}),tr(()=>{s.forEach(l=>{try{l()}catch{}})}),We(()=>a.sections,async(l,u)=>{l!==u&&(await t.processSections(a.isPreview,l),o.value&&o.value.refreshTemplate&&o.value.refreshTemplate())},{deep:!0}),(l,u)=>(F(),q(De,null,[pe(D2,{"organization-id":a.identity.organizationId,"template-id":a.templateId,"is-preview":a.isPreview,theme:a.theme},null,8,["organization-id","template-id","is-preview","theme"]),pe(X2,{ref_key:"templateRendererRef",ref:o,"is-preview":e.isPreview},null,8,["is-preview"])],64))}},Sw={pbUniqueId:"PB_DXP_001",vUniqueId:"V_1",versionType:"ACTIVE",playBookName:"DXP AI Guidance",description:"Three-step flow to showcase in-panel component loading via playbook steps.",pbObject:"Opportunity",mode:"FULL",type:null,appliesTo:{},playBookSteps:[{stepID:"PB_DXP_001_V_1_00",stepName:"AI Guidance",stepType:"UI_COMPONENT",stepComponent:"ai-guidance",sequenceNumber:"0",description:"AI Guidance entry step. Presents chat and initial actions.",aiGuidance:"Start here to receive guidance and choose your next action.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Browse Catalog",sequenceNumber:"1",disable:!1}],templateId:"a1RKb000003C3PkMAK"},{stepID:"PB_DXP_001_V_1_0",stepName:"Browse Catalog",stepType:"UI_COMPONENT",stepComponent:"catalog",sequenceNumber:"1",description:"Browse or search the catalog and add items as needed.",aiGuidance:"Use the catalog to discover and add products. Proceed to configuration when ready.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Configure Products",sequenceNumber:"1",disable:!1}],templateId:"a1RKb000003C3PkMAK"},{stepID:"PB_DXP_001_V_1_1",stepName:"Configure Products",stepType:"UI_COMPONENT",stepComponent:"configurator",sequenceNumber:"2",description:"Configure selected products and adjust options as needed.",aiGuidance:"Fine-tune product options. When done, proceed to review your cart.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[{beanName:"Review Cart",sequenceNumber:"2",disable:!1}]},{stepID:"PB_DXP_001_V_1_2",stepName:"Review Cart",stepType:"UI_COMPONENT",stepComponent:"cart",sequenceNumber:"3",description:"Review all quote line items before finalizing.",aiGuidance:"Validate quantities and pricing. Return to previous steps if adjustments are required.",uiSpecs:{renderType:"Card",rowHeaderField:"",rowHeaderImageUrl:"",cardFields:[],listFields:[]},promptGuidance:[],beans:[],templateId:"a1RKb000003C0ryMAC"}],metadata:{s3PathKey:"ec-playbooks/00DA0000000cDUJMA2/PB_DXP_001/V_1/playbook.json",createdAt:"2025-12-29T09:05:53.163365+00:00",updatedAt:"2025-12-29T09:05:53.163365+00:00",createdBy:"0052G00000AtQQ9QAN"}},mc=Lt("expediteConfigurator",()=>{const e=G(null),n=G(null),t=G(null),r=G([]);function o(){var u,c;console.info("[expediteConfiguratorStore] getPayload",{hasComp:!!e.value,hasGetConfig:!!((u=e.value)!=null&&u.getConfig)});const l=(c=e.value)==null?void 0:c.getConfig;return{productConfiguration:l!=null?[l]:[]}}function i(l,u){var c,h,d;console.info("[expediteConfiguratorStore] setPreConfigData",{hasData:!!l,hasProductConfiguration:!!((c=l==null?void 0:l.productConfiguration)!=null&&c.length),itemId:u}),n.value=l,((h=l==null?void 0:l.productConfiguration)==null?void 0:h.length)>0&&(t.value=l.productConfiguration.find(p=>{var g;return((p==null?void 0:p.itemId)||((g=p==null?void 0:p.product)==null?void 0:g.itemId))===u}),r.value=l.productConfiguration,console.info("[expediteConfiguratorStore] apply queued?",{hasQueueItem:!!t.value,ready:!!e.value}),t.value&&((d=e.value)!=null&&d.setConfig)&&e.value.setConfig(t.value,r.value))}function a(){var l;console.info("[expediteConfiguratorStore] refresh invoked"),(l=e.value)!=null&&l.refresh&&e.value.refresh()}function s(l){var u;console.info("[expediteConfiguratorStore] setExpediteConfigComp",{received:!!l}),e.value=l,t.value&&((u=e.value)!=null&&u.setConfig)&&(console.info("[expediteConfiguratorStore] applying queued configuration on ready"),e.value.setConfig(t.value,r.value),t.value=null)}return{preConfgData:n,expediteConfigComp:e,getPayload:o,refresh:a,setPreConfigData:i,setExpediteConfigComp:s}}),gc=["Quote_Document"],Ho=Lt("composablePlaybook",()=>{const e=wn(),n=Ht(),t=_r(),r=mc(),o=G(null),i=G("full"),a=G(null),s=G(null),l=G(!1),u=G(!1),c=G(null),h=G(null);G(null);const d=G("");function p(w){d.value=w}const f=()=>({Authorization:`Bearer ${d.value}`,"X-Salesforce-Org-Id":n.organizationId.value||"","X-Salesforce-Org-Type":n.composablesOrgType.value||"","X-Salesforce-User-Id":n.userId.value||"","Content-Type":"application/json"});async function g(w,T="ACTIVE"){if(!w)throw new Error("getPlaybookByKey: 'key' is required");try{const P=`${n.composablesApiUrl.value}/playbooks/getPlaybookByKey/${w}?versionType=${T}`,X=await fetch(P,{method:"GET",headers:f()});if(!X.ok)throw new Error(`Playbook fetch failed: ${X.status}`);const $=await X.json();return a.value=$.data??null,console.log("[playbook] currentPlaybook",a.value),$}catch(P){if(console.warn("[playbook] Falling back to bundled DXP playbook due to fetch error:",(P==null?void 0:P.message)||P),w==="PB_DXP_001")return a.value=Sw,a.value;throw P}}function m(w){u.value=!!w}function v(w){var P,X;if(!((X=(P=a.value)==null?void 0:P.playBookSteps)!=null&&X.length))return;a.value.playBookSteps.some($=>$.stepName===w||$.name===w)&&(s.value=w)}const y=be(()=>{var T;return(((T=a.value)==null?void 0:T.playBookSteps)||[]).find(P=>P.stepName===s.value)||null});function b({stepName:w,data:T=null}){var ee,Y,U,O,R,M,N;if(console.log("[playbook:navigateToStep] called",{stepName:w,dataProvided:!!T,data:T}),!((Y=(ee=a.value)==null?void 0:ee.playBookSteps)!=null&&Y.length)){console.info("[navigateToStep] No playbook steps available, aborting navigation.");return}if(!w){console.info("[navigateToStep] No stepName provided, aborting navigation.");return}const P=a.value.playBookSteps;console.info("[navigateToStep] Steps available:",JSON.stringify(P.map(H=>H.stepName||H.name)));const X=P.findIndex(H=>H.stepName===w||H.name===w);if(X<0){console.info(`[Warn] [navigateToStep] No step found for stepName "${w}".`);return}const $=P[X];if(console.log("[playbook:navigateToStep] target step resolved",{targetIndex:X,targetStepName:($==null?void 0:$.stepName)||($==null?void 0:$.name),stepComponent:$==null?void 0:$.stepComponent}),$!=null&&$.stepComponent&&gc.includes($.stepComponent)){console.info(`[navigateToStep] Target step "${$.stepName}" is a NON_COMPONENT (${$.stepComponent}), storing data in localStorage and searching for a valid component step above.`);const H=getPreviousValidStep($.stepName);H&&(console.info(`[navigateToStep] Valid step to return to: "${H}".`),setDataToLocalStorage({stepName:H,pbUniqueId:(U=a.value)==null?void 0:U.pbUniqueId}))}let J=!1;for(let H=X;H>=0;H--){const L=P[H],z=L==null?void 0:L.stepComponent;if(console.info(`[navigateToStep] Checking step[${H}]:`,L),!z){console.info(`[navigateToStep] Step[${H}] has no component, skipping.`);continue}if(Array.isArray(gc)&&gc.includes(z)){console.info(`[navigateToStep] Step[${H}] component "${z}" is in NON_COMPONENTS, skipping.`);continue}s.value=L.stepName??w,console.info(`[navigateToStep] Navigating to step[${H}] "${s.value}" with component "${z}".`);let j=T;const W=String(z||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),Q=!!((R=(O=j==null?void 0:j.payload)==null?void 0:O.savedProducts)!=null&&R.length)||((N=(M=j==null?void 0:j.payload)==null?void 0:M.productConfiguration)==null?void 0:N.length)>0;if(W==="configurator"&&!Q)try{const ae=typeof t.getTopConfigurableItem=="function"?t.getTopConfigurableItem():null;if(ae){const fe=ae.XX_ORD1__Item__c||ae.xx_ord1__item__c||ae.itemId||"",K=ae.Id||ae.id||"";fe&&(j={payload:{savedProducts:[K?{itemId:fe,qliId:K}:{itemId:fe}]}})}}catch(ae){console.info("[navigateToStep] Unable to auto-select configurable item:",(ae==null?void 0:ae.message)||ae)}console.log("[playbook:navigateToStep] final navigation payload",{currentStepName:s.value,stepComponent:z,hasPayload:!!j,payload:j}),I({XX_ORD1__Completed_PB_Step_Number_EX__c:String(H),XX_ORD1__Playbook_Current_Step_Meta_EX__c:JSON.stringify(j)}),C(z,j),J=!0;break}J||console.info(`[Warn] [navigateToStep] Could not find a valid component step to navigate to starting from stepName "${w}".`),console.log("[playbook:navigateToStep] completed",{navigated:J,toStep:s.value})}function _(w){var J,ee,Y;const T=((J=a.value)==null?void 0:J.playBookSteps)||[];if(!T.length)return;const P=T.findIndex(U=>U.stepName===s.value);if(P<0)return;if(!(Array.isArray((ee=T[P])==null?void 0:ee.beans)&&T[P].beans.some(U=>(U==null?void 0:U.beanName)===w))){console.info(`[navigateToBean] Bean "${w}" not found in current step "${(Y=T[P])==null?void 0:Y.stepName}".`);return}const $=T[P+1];$!=null&&$.stepName&&b({stepName:$.stepName})}function C(w,T=null){var J,ee,Y,U,O,R,M,N,H,L,z,j,W,Q,ae,fe,K;console.log("[playbook:loadComponent] called",{stepComponent:w,dataProvided:!!T,data:T});const P=k(w);console.log("[playbook:loadComponent] resolved route path",{path:P});function X(V){try{return(typeof window<"u"&&window.location.hash||"").replace(/^#/,"")===V}catch{return!1}}const $=String(w||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");if(u.value){console.log("[playbook:loadComponent] embeddedMode active, skipping route",{normalized:$,payloadProvided:!!T}),c.value=$,console.log("[playbook] activeComponentKey",c.value),console.log("[playbook] activeComponentData",T),h.value=T||null;return}if(P)try{if(((T==null?void 0:T.actionFunction)==="Reload"||P==="/quote-item")&&(console.info("[playbook] Reloading quote line items..."),console.log("Reloading configurator 4"),quoteStore.fetchAllQuoteLineItems().then(()=>{console.info("[playbook] Quote line items reloaded...")})),P==="/configurator")if(console.log("[playbook:loadComponent] navigating to configurator",{hasProductConfiguration:((ee=(J=T==null?void 0:T.payload)==null?void 0:J.productConfiguration)==null?void 0:ee.length)>0,hasSavedProducts:((U=(Y=T==null?void 0:T.payload)==null?void 0:Y.savedProducts)==null?void 0:U.length)>0,isReload:(T==null?void 0:T.actionFunction)==="Reload"}),((R=(O=T==null?void 0:T.payload)==null?void 0:O.productConfiguration)==null?void 0:R.length)>0){const V=(M=T==null?void 0:T.payload)==null?void 0:M.productConfiguration[0],te=(V==null?void 0:V.itemId)||((N=V==null?void 0:V.product)==null?void 0:N.itemId)||"";r.setPreConfigData(T==null?void 0:T.payload,te);const oe=`/configurator/${te}`;X(oe)||router.push(oe);return}else if(((L=(H=T==null?void 0:T.payload)==null?void 0:H.savedProducts)==null?void 0:L.length)>0){const V=(z=T==null?void 0:T.payload)==null?void 0:z.savedProducts[0].itemId,te=(j=T==null?void 0:T.payload)==null?void 0:j.savedProducts[0].qliId,oe=`/configurator/${V}/${te}`;X(oe)||router.push(oe);return}else if((T==null?void 0:T.actionFunction)==="Reload"){console.log("Reloading configurator 5"),r.refresh();return}else{const oe=[...((W=quoteStore.allQLIData)==null?void 0:W.lineItems)??[]].sort((le,ne)=>{const de=ve=>ve.xx_ord1__sys_configuration_status2__c==="Needs Configuration"?1:ve.xx_ord1__sys_configuration_status2__c==="Suggests Configuration"?2:3;return de(le)-de(ne)}).filter(le=>le.xx_ord1__sys_configuration_status2__c!=="No Configuration");if(oe.length){const le=oe[0],ne=`/configurator/${le.xx_ord1__item__c}${le.id?`/${le.id}`:""}`;X(ne)||router.push(ne)}else e.handleWarning("No items needing configuration");return}else P==="/adaptive-search"&&((Q=T==null?void 0:T.payload)!=null&&Q.adaptiveSearch)?(console.log("[playbook:loadComponent] navigating to adaptive-search",{hasPayload:!!((ae=T==null?void 0:T.payload)!=null&&ae.adaptiveSearch)}),adaptiveSearch.createLstItems(T==null?void 0:T.payload.adaptiveSearch)):P==="/quote-item"&&T?(console.log("[playbook:loadComponent] navigating to quote-item with data"),quoteStore.performAIAction(T)):P==="/match-records"&&((fe=T==null?void 0:T.payload)!=null&&fe.quickSelection)&&(console.log("[playbook:loadComponent] navigating to match-records",{hasQuickSelection:!!((K=T==null?void 0:T.payload)!=null&&K.quickSelection)}),quickSelectionStore.quickSelectionLayout=T.payload);X(P)||router.push(P),console.log("[playbook:loadComponent] route push called",{path:P})}catch(V){e.handleError(V,"playbookStore.loadComponent")}}function k(w){var X;const T=String(w||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),P={chat_screen:"/",ai_guidance:"/",catalog:"/catalog",adaptive_search:"/adaptive-search",configurator:"/configurator",quote_item:"/quote-item",cart:"/cart",quick_selection:"/match-records",quote_document:null};if(T==="quote_document"){const $=getPreviousValidStep(s.value);return $&&setDataToLocalStorage({stepName:$,pbUniqueId:(X=a.value)==null?void 0:X.pbUniqueId}),goToQuoteDocument(),null}return P[T]||"/quote-item"}function E(){var w;return((w=y.value)==null?void 0:w.beans)??[]}function S(){return E().map(T=>({action:`playbookNavigate:${T.beanName}`,label:T.beanName,disabled:!!T.disable}))}async function D(){var w;try{const T=((w=n.quoteId)==null?void 0:w.value)||"";if(!T)return console.info("getPlaybookInfoFromQuote: Missing Quote Id"),null;const P=`${n.composablesApiUrl.value}/platform/getHeaderRecord`,X={recordId:T,lstFields:["XX_ORD1__Playbook_Id_EX__c","XX_ORD1__Playbook_Version_Id_EX__c","XX_ORD1__Completed_PB_Step_Number_EX__c","XX_ORD1__Playbook_Current_Step_Meta_EX__c"]};return(await(await fetch(P,{method:"POST",headers:f(),body:JSON.stringify(X)})).json()).data}catch(T){return e.handleError(T,"playbookStore.getPlaybookInfoFromQuote"),null}}async function I(w={}){var T;try{const P=((T=n.quoteId)==null?void 0:T.value)||Gl("id")||"";if(!P)return console.info("addPlaybookInfoToQuote: Missing Quote Id"),null;const X={Id:P,...w},$=Object.entries(X).map(([O,R])=>({fieldName:O,fieldValue:R})),J=`${n.composablesApiUrl.value}/platform/upsertRecords`,ee={objectType:"XX_ORD1__Quote__c",uniqueField:"Id",records:[{fields:$}]},U=await(await fetch(J,{method:"POST",headers:f(),body:JSON.stringify(ee)})).json();return console.info("[playbook] addPlaybookInfoToQuote response:",JSON.stringify(U)),U}catch(P){return e.handleError(P,"playbookStore.addPlaybookInfoToQuote"),null}}async function A(){var w;try{const T=`${n.composablesApiUrl.value}/product-pricing/findCatalogInContext?accountId=${n.accountId.value}&catalogType=Primary&catalogLookupFieldName=Primary_Catalog__c`,X=await(await fetch(T,{method:"GET",headers:f()})).json();return(w=X==null?void 0:X.data)==null?void 0:w.catalogId}catch(T){return e.handleError(T,"playbookStore.getCatalogInContext"),null}}return{playbookData:o,currentPlaybook:a,currentStepName:s,currentStep:y,playbookStepsMode:i,showPlaybookSteps:l,embeddedMode:u,activeComponentKey:c,activeComponentData:h,setSecretKey:p,getPlaybookByKey:g,setCurrentStepName:v,navigateToStep:b,navigateToBean:_,loadComponent:C,setEmbeddedMode:m,getCurrentStepLinks:S,addPlaybookInfoToQuote:I,getPlaybookInfoFromQuote:D,getCatalogInContext:A}}),yc={xx_ord1__item__c:"xx_ord1__item__c",xx_ord1__sales_price__c:"xx_ord1__negotiated_price__c",xx_ord1__nrc__c:"xx_ord1__nrc_for_new__c",xx_ord1__line_description__c:"xx_ord1__line_description__c",xx_ord1__list_price__c:"xx_ord1__list_price2__c",xx_ord1__cost__c:"xx_ord1__cost2__c",xx_ord1__rate_plan__c:"xx_ord1__rate_plan__c",xx_ord1__allowed_discount__c:"xx_ord1__allowed_discount__c",xx_ord1__billing_period__c:"xx_ord1__billing_period__c",xx_ord1__ship_to_account__c:"xx_ord1__ship_to_account__c",xx_ord1__erp_item_number__c:"xx_ord1__erp_item_number__c",xx_ord1__mrc__c:"xx_ord1__mrc__c",xx_ord1__qty__c:"xx_ord1__qty__c",id:"id"},Z2={xx_ord1__item__c:"xx_ord1__item__c",xx_ord1__negotiated_price__c:"xx_ord1__sales_price__c",xx_ord1__nrc_for_new__c:"xx_ord1__nrc__c",xx_ord1__line_description__c:"xx_ord1__line_description__c",xx_ord1__list_price2__c:"xx_ord1__list_price__c",xx_ord1__cost2__c:"xx_ord1__cost__c",xx_ord1__rate_plan__c:"xx_ord1__rate_plan__c",xx_ord1__allowed_discount__c:"xx_ord1__allowed_discount__c",xx_ord1__billing_period__c:"xx_ord1__billing_period__c",xx_ord1__ship_to_account__c:"xx_ord1__ship_to_account__c",xx_ord1__erp_item_number__c:"xx_ord1__erp_item_number__c",xx_ord1__mrc__c:"xx_ord1__mrc__c",xx_ord1__qty__c:"xx_ord1__qty__c",id:"id"},Ow=e=>{var t;let n=[];for(let r of e)if(r.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(r.includes(".")){let i=r.split(".")[0];i=i.slice(0,-1)+"c";const a=((t=yc[i==null?void 0:i.toLowerCase()])==null?void 0:t.trim())||"";a&&(n.includes(a)||n.push(a||""),n.push(r))}else n.includes(yc[r==null?void 0:r.toLowerCase()])||n.push(yc[r==null?void 0:r.toLowerCase()]||"");return n.filter(r=>r!=="")},J2=Lt("actions",()=>{const e=Co(),n=xo(),t=G(!1);return{openAdaptiveSearch:(s,l=!1)=>{console.info("openAdaptiveSearch",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),t.value=l},openQuoteItem:s=>{console.info("openQuoteItem",s),e.chatHistory[e.chatHistory.length-1].links=[],e.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),e.chatHistory[e.chatHistory.length-1].links=[],e.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const u=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${n.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${U3(window.location.href)}${u}`},undo:()=>{const s=e==null?void 0:e.latestDMLRequest;e.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:t}}),Y2=Lt("adaptiveSearch",()=>{const e=xo(),n=Es(),t=Co(),r=J2(),o=G(null),i=G(null),a=G(!1),s=G(!1),l=G([]),u=G(""),c=G(!1),h=G(null),d=G(!1),p=G([]),f=wn(),g=G([]),m=G(0),v=G(!1),y=G({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function b(){a.value=!0;try{const O=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let R={};return R=await window.salesforceConnector.getDynamicPageLayout(O),i.value=kf(R,"Unable to find the Search Selection Layout for your user profile"),y.value.rowLimt=i.value.configuration.rowLimit||10,i.value.configuration.columns.forEach(M=>{!M.field&&M.label==="QTY"&&(M.field="xx_ord1__qty__c")}),a.value=!1,_(),R}catch(O){a.value=!1,f.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",O)}}function _(){var O,R,M;h.value=(M=(R=(O=i.value)==null?void 0:O.configuration)==null?void 0:R.dynamicFilters)==null?void 0:M.filters.map(N=>({...N,field:N.field.toLowerCase(),filtervalue:N.filtervalue||[],filtervaluefrom:N.filtervaluefrom||"",filtervalueTo:N.filtervalueTo||""}))}function C(){var R;let O=[];for(const M of i.value.configuration.columns){let N=M.field;if(O.includes(N)||O.push(N),N!=null&&N.includes(".")){let L=N.split(".")[0];L=L.slice(0,-1)+"c",O.includes(L)||O.push(L)}}return(R=i.value.configuration)!=null&&R.cardHeader&&O.push(i.value.configuration.cardHeader.imageField),i.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&O.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),O=O.filter(M=>!!M),O.filter(M=>M.toLowerCase()!=="xx_ord1__qty__c"&&M.toLowerCase()!=="xx_ord1__competitor_sku__c")}function k(O,R=!1){if(!O||O.includes("undefined"))return!1;const M=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(R){const N=Array.isArray(O)?O:O.split(",");for(const H of N){const L=H.trim();if(M.test(L))return f.handleError(`Invalid character found in value: ${L}`),!1}}else if(M.test(O))return f.handleError("Special characters are not allowed in filter values"),!1;return!0}function E(O,R){return{field:O.field,operator:O.operator||"contains",value:R,dataType:O.dataType.trim()}}function S(O){if(!O.filtervalue)return null;const R=Array.isArray(O.filtervalue),M=R?O.filtervalue.join(","):O.filtervalue.trim();return k(M,R)?M:null}function D(O){var H,L;const R=(H=O.filtervaluefrom)==null?void 0:H.trim(),M=(L=O.filtervalueTo)==null?void 0:L.trim();if(!R||!M)return null;const N=`${R}, ${M}`;return N!==", "&&k(N)?N:null}function I(O){const R=`${Ef(O.filtervaluefrom)}, ${Ef(O.filtervalueTo)}`;return R!==", "&&k(R)?R:null}function A(O){var M;const R=(M=O.filtervaluefrom)==null?void 0:M.trim();return k(R)?R:null}function w(O){const R=[];return O.forEach(M=>{const N=M.dataType.trim();let H=null;switch(N){case"PICKLIST":case"MULTIPICKLIST":H=S(M);break;case"DOUBLE":case"CURRENCY":H=D(M);break;case"DATETIME":case"DATE":H=I(M);break;default:H=A(M)}H&&R.push(E(M,H))}),p.value=R,R}async function T(O="",R=[],M=[]){var H,L,z,j,W,Q,ae,fe,K,V;let N=[];if(R.length&&(N=w(R)),!N.length&&O.trim()===""){l.value=[],c.value=!1;return}try{c.value=!1,s.value=!0;const te=O.trim();M.length||(M=C());const oe={fields:M,...R.length?{dynamicFilters:N}:{},searchText:te||u.value.trim(),accountId:n.accountId,...n.eCatalogId?{catalogId:n.eCatalogId}:{},...n.objectType==="opportunity"?{opportunityId:n.id}:{},...(L=(H=i.value)==null?void 0:H.configuration)!=null&&L.sort?{primarySortBy:i.value.configuration.sort.primary.field,primarySortOrder:i.value.configuration.sort.primary.direction,secondarySortBy:i.value.configuration.sort.secondary.field,secondarySortOrder:i.value.configuration.sort.secondary.direction}:{},rowLimt:(j=(z=i.value)==null?void 0:z.configuration)==null?void 0:j.rowLimit,paging:(Q=(W=i.value)==null?void 0:W.configuration)==null?void 0:Q.paging,...((ae=y.value)==null?void 0:ae.offset)!==0?{offset:y.value.offset}:{},objectName:(K=(fe=i.value)==null?void 0:fe.configuration)==null?void 0:K.objectName,currencyCode:n.currencyCode},le=await window.salesforceConnector.getItems(JSON.stringify(oe));if(le!=null&&le.errorMessage){f.handleError(le.errorMessage);return}le!=null&&le.itemCount&&(y.value.totalPages=Math.ceil((le==null?void 0:le.itemCount)/y.value.rowLimt)),l.value=za(le.lstItems,{xx_ord1__qty__c:"1"}),(V=le.lstItems)!=null&&V.length||(c.value=!0),s.value=!1}catch(te){f.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",te)}}async function P(O){try{d.value=!0;const R=JSON.stringify({lstQLIRequest:X(O),quoteId:e.quoteId});let M=await window.salesforceConnector.createQLI(R);typeof M=="string"&&(M=JSON.parse(M));let N=!1;if((M==null?void 0:M.length)>0&&M.forEach(H=>{H.errorMessage&&(N=!0,f.handleError(H.errorMessage))}),d.value=!1,N){g.value=M;const H=g.value.reduce((L,z)=>(L[z.eCatalogItemId]=z.errorMessage,L),{});l.value=l.value.map(L=>({...L,backendError:H[L.Id]||""}));return}return M}catch(R){f.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",R)}}function X(O){const R=[];for(const M of O)if(!M.addedToQuote&&M.id){const N=$(M);m.value++,R.push({fields:N,recordId:M.id,...O.length===1?{maxSequenceNumber:m.value}:{}})}return R}function $(O){const R=[],M=J();return Object.keys(O).forEach(N=>{if(M.includes(N)){const H=Z2[N.toLowerCase()];H&&R.push({fieldname:H,value:O[N]})}}),R}function J(){const O=[];return i.value.configuration.columns.forEach(R=>{R.field&&!R.field.includes(".")&&R.isEditable&&R.visible&&O.push(R.field)}),O}function ee(){var R,M;const O=[];return i.value.configuration.columns.forEach(N=>{const H=N.field.toLowerCase();O.includes(H)||O.push(H)}),(R=i.value.configuration)!=null&&R.dynamicFilters&&i.value.configuration.dynamicFilters.filters.forEach(N=>{const H=N.field.toLowerCase();O.includes(H)||O.push(H)}),(M=i.value.configuration)!=null&&M.cardHeader&&O.push(i.value.configuration.cardHeader.imageField),O}async function Y(){var M;const O=ee(),R=((M=i.value.configuration)==null?void 0:M.saveObjectName)||i.value.configuration.objectName;if(R==="xx_ord1__ecatalog_item__c"){const N=O.indexOf("xx_ord1__qty__c");N>-1&&O.splice(N,1)}await e.getFieldsData(O,R),e.fieldsData.xx_ord1__qty__c||e.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function U({searchTerm:O="",filters:R=[]}={}){if(v.value=!0,O&&(u.value=O),R.length&&(p.value=R),await b()){await Y(),v.value=!1;const N=u.value;N&&(u.value=N,await T(N,e.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",r.isStaticActionCall),r.isStaticActionCall&&(r.isStaticActionCall=!1,t.chatHistory[t.chatHistory.length-1]={type:"response",message:"Adaptive search is now open. Please search for the products you require and add it quote",loading:!1,links:[{action:"quoteItem",label:"Quote Item"},{action:"quoteDocument",label:"Quote Document"}]})}v.value=!1}return{selectedItem:o,AdaptiveSearchLayout:i,searchText:u,loadingAdaptiveLayout:a,getAdaptiveSearchLayout:b,getItems:T,lstItems:l,rowItemsLoading:s,noSearchRecords:c,dynamicFilters:h,setDynamicFilters:_,createQliErrors:g,addToQuote:P,addingToQuote:d,getFieldsData:Y,pagingData:y,appliedDynamicFilters:p,maxSequenceNumber:m,loadingAdaptiveSearch:v,initAdaptiveSearch:U}}),Tw="XX_ORD1__Quote__c",Dw="xxord1salespricec",Cs="xx_ord1__item__c",Rw="xxord1productnrcc",Mw=Lt("cartStore",()=>{const e=xo(),n=Y2(),t=wn(),r=G(""),o=G("$0"),i=G("$0"),a=G(null),s=G({}),l=G({}),u=G({}),c=G(""),h=G(""),d=G({}),p=G(""),f=G(""),g=G({});async function m(){k()}async function v(){try{let D=await window.salesforceConnector.getProductCount(e.quoteId);if(D=yn(D),D!=null&&D.errorMessage){t.handleError(D.errorMessage);return}return r.value=D,D}catch{t.handleError("Failed to get Product Count. Please try again.")}}async function y(){try{let D=await window.salesforceConnector.getQuoteTotal(e.quoteId);if(D=yn(D),D!=null&&D.errorMessage){t.handleError(D.errorMessage);return}return i.value=D.monthlyTotal,o.value=D.onetimeTotal,D}catch{t.handleError("Failed to get Total Amount. Please try again.")}}async function b(D,I,A,w=""){if(!e.sectionDataMap.get(A).parentQLIs[I].removingItem){e.sectionDataMap.get(A).parentQLIs[I].removingItem=!0,f.value=D.id,await _(D.id)==="Success"&&(e.fetchAllQuoteLineItems(),w&&w(D,I,A));let P=e.sectionDataMap.get(A).parentQLIs.filter(X=>X[Cs]===D[Cs]).length;f.value="",n.lstItems.forEach(X=>{X[Cs]===D[Cs]&&(X.addedToQuote===!0&&(X.addedToQuote=!1),P===0&&(X.removedFromQuote=!0))})}}async function _(D){try{let I=await window.salesforceConnector.deleteQLI(D);if(I!=null&&I.errorMessage){t.handleError(I.errorMessage);return}return v(),y(),I}catch{t.handleError("Failed to remove Quote Item. Please try again.")}}function C(D){var w,T;const I=(w=D==null?void 0:D[Rw])==null?void 0:w.match(/\.\d+/);I&&(I.value=I[0].length-1);const A=(T=D==null?void 0:D[Dw])==null?void 0:T.match(/\.\d+/);return A&&(A.value=A[0].length-1),I||A}function k(D=!0){v(),y(),D&&e.fetchTemplates(Tw).then(()=>{e.getFilteredListWithFields()})}function E(D){const I=e.sectionDataMap;for(const[,A]of I.entries())A.parentQLIs.forEach(w=>{w.id===D.id&&(A.columns.forEach(T=>{if(T.dataType==="CURRENCY"){const P=T.field.replace(/_/g,"");w[P]=S(w[P],D[T.field])}}),D!=null&&D.billingPeriodValue&&(D!=null&&D.formattedBillingPeriodValue)&&(w.formattedBillingPeriodValue=S(w.formattedBillingPeriodValue,D.billingPeriodValue)),D!=null&&D.oneTimeValue&&(D!=null&&D.formattedOneTimeValue)&&(w.formattedOneTimeValue=S(w.formattedOneTimeValue,D.oneTimeValue)))})}function S(D,I){const A=Number(I);if(isNaN(A))return D;const w=D.match(/(\d[\d,]*)(\.\d+)?/);if(!w)return D;const T=w[2]||"",P=T.length?T.length-1:0,X=A.toLocaleString("en-US",{minimumFractionDigits:P,maximumFractionDigits:P});return D.replace(w[1]+T,X)}return{initializeCart:m,loadCartState:k,productCount:r,onetimeTotal:o,monthlyTotal:i,filterCartItem:a,billingPeriodValue:c,hasOneTimeValue:h,hasBillingPeriodInList:s,oneTimeFieldAvailable:l,billingPeriodFieldAvailable:u,priceDecimalPrecision:d,cartItemUpdatingId:p,removingItemLoaderId:f,cartItemColumnsMap:g,getProductCount:v,getQuoteTotal:y,removeItem:b,removeQuoteItem:_,getDecimalPrecisionFromSalesPriceOrNRC:C,updateFormattedValues:E,formateCurrencyValue:S}}),Fw=e=>[{title:"Apply Discount",subOptions:[...e.map(n=>`Apply Discount on ${n} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...e.map(n=>`Apply Discount on ${n} for a specific total`)]},{title:"Update Fields",subOptions:["Update the price of","Update the quantity of","Update the term start date to","Update the term end date to","Update the line description for"]},{title:"Price Ramp",subOptions:["Add a price ramp for"]}],Bw={salesforceUserLocale:"en_US",chatRoomId:"00DA0000000cDUJMA2__0052G00000AHBNAQA5__a0jKb000004VSaMIAW",status:"SUCCESS",statusCode:200,requestId:"9b1d1f0a9f07aa6cdc",errorMessage:"",payload:{uiModification:{addColumn:[],removeColumn:[],filter:[],groupBy:[{sectionName:"MRC $50 and Above",filters:[{datatype:"currency",field:"XX_ORD1__MRC__c",operator:"greater or equal",value:"50"}],tableId:"4vIEgoK5CbSPrLYPbq"},{sectionName:"MRC Below $50",filters:[{datatype:"currency",field:"XX_ORD1__MRC__c",operator:"less than",value:"50"}],tableId:"BlOPCp7eLBCZ84nDT2"}],showOptions:!0}},agentResponse:{role:"agent",requestId:"9b1d1f0a9f07aa6cdc",content:"Grouped the quote items into two sections: one for MRC $50 and above, and another for MRC below $50.",error:!1,epoch:1759936160464,isDML:!1},redirectObjects:{qliId:"",itemId:"",componentName:"QuoteItem"},actionFunction:"Reload",links:[{action:"quoteDocument",label:"Quote Document"},{action:"addProducts",label:"Add Products"}]},Nw=[{label:"Line Description",field:"xx_ord1__line_description__c",isEditable:!0,dataType:"STRING"},{label:"QTY",field:"xx_ord1__qty__c",isEditable:!0,dataType:"DOUBLE"},{label:"Extended Price",field:"xx_ord1__extended_price__c",isEditable:!1,dataType:"CURRENCY"},{label:"Billing Period",field:"xx_ord1__billing_period__c",isEditable:!0,dataType:"PICKLIST",picklistValues:["Monthly","Quarterly","Yearly"]}],xo=Lt("quote",()=>{const e=wn(),n=Mw(),t=Es(),r=G(""),o=G(""),i=G(0),a=G(""),s=G([]),l=G({template:!0,filteredList:!1}),u=G(null),c=G(new Map),h=G({}),d=G(!1),p=G(!0),f=G(!1),g=G({text:"Hide Options",altText:"Show Options",handler:()=>{p.value=!p.value,S()},color:"#136E05",isActive:!1}),m=be(()=>{const U=Array.from(c.value.values()).map(O=>O.sectionName);return Fw(U)});We(a,()=>{l.value.template||E()});function v(){const U=new Map,O=[];for(const[M,N]of c.value.entries())U.set(M,N.selected),O.push(N);const R=JSON.parse(JSON.stringify(O));return R.forEach(M=>{delete M.selected;const N=new Map,H=[];M.lineItems.forEach(L=>{L.Selected=U.get(M.tableId).get(L.id)||!1,L.xx_ord1__parent_qli__c?(N.has(L.xx_ord1__parent_qli__c)||N.set(L.xx_ord1__parent_qli__c,[]),N.get(L.xx_ord1__parent_qli__c).push(L)):H.push(L)}),M.lineItems=H.map(L=>({...L,options:N.get(L.id)||[]})),delete M.loading,delete M.parentQLIs,delete M.totalValues}),{showOptions:p.value,sections:R,templateId:a.value}}async function y(U){try{let O=await window.salesforceConnector.getPrimaryQuote(U);O=yn(O),O!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(O)),r.value=O.recordId,console.info("quoteId",r.value),o.value=O.name,a.value=O==null?void 0:O.templateId,i.value=(O==null?void 0:O.lineItemsCount)||0)}catch(O){e.handleError(O.message),console.info("[ERROR]: getPrimaryQuote() error = ",O)}}async function b(U){var O,R;try{l.value.template=!0;let M=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[U],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));M=yn(M);const N=M==null?void 0:M.templates[U];return a.value||(a.value=(O=N.find(H=>H.XX_ORD1__Default__c))==null?void 0:O.Id),a.value||(a.value=(R=N[0])==null?void 0:R.Id),s.value=N,l.value.template=!1,s.value}catch(M){e.handleError(M.message),console.info("[ERROR]: fetchTemplates() error = ",M)}}function _(U){if(!U)return null;const O=/\{!\$(\w+):([\w.]+)\}/,R=U.match(O);return R?{function:R[1],apiname:R[2].split(".")[1]}:null}async function C(U){try{const O={Id:r.value,XX_ORD1__Document_Template__c:U};return await window.salesforceConnector.updateQuote(JSON.stringify([O]))}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQuote() error = ",O)}}async function k(){try{l.value.filteredList=!0;let U=await window.salesforceConnector.getQuoteEPageLayout();c.value.clear(),n.cartItemColumnsMap={},U=yn(U);const O=U.map(M=>({label:M.fieldLabel,field:M.fieldName.toLowerCase(),isEditable:M.isEditable,dataType:M.dataType,...M.picklistValues?{picklistValues:M.picklistValues}:{}})),R=Kr();return c.value.set(R,{loading:!0,lineItems:[],parentQLIs:[],columns:O,tableId:R,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),n.cartItemColumnsMap[R]=O,g.value.isActive=!1,p.value=!0,u.value={lstCB:[{columns:O,footer:null,title:"All Rows",sectionName:"All Rows",tableId:R,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},S(),l.value.filteredList=!1,U}catch(U){e.handleError(U.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",U)}}async function E(){if(s.value.length===0){k();return}try{l.value.filteredList=!0;let U=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:a.value}));C(a.value),U=yn(U),console.info("res.lstCB = ",U.lstCB);const O=U==null?void 0:U.objectFieldsMap;return c.value.clear(),n.cartItemColumnsMap={},U.lstCB=U.lstCB.map(R=>{const{fields:M,filters:N,primarysort:H,primarysortdesc:L}=JSON.parse(R.XX_ORD1__Block_Properties__c),z=M.map(W=>{var Q;return{label:(Q=O[W.api])==null?void 0:Q.label,field:W.api.toLowerCase(),isEditable:W.api.includes(".")?!1:O[W.api].isEditable,dataType:O[W.api].dataType,...O[W.api].picklistValues?{picklistValues:O[W.api].picklistValues}:{}}}),j=R.Id||Kr();return c.value.set(j,{loading:!0,lineItems:[],parentQLIs:[],columns:z,tableId:j,sectionName:R.Name,selected:new Map,footer:_(R.XX_ORD1__Table_Footer_HTML__c),filters:N,primarysort:H,primarysortdesc:L}),n.cartItemColumnsMap[j]=z,g.value.isActive=!1,p.value=!0,{columns:z,footer:_(R.XX_ORD1__Table_Footer_HTML__c),title:R.Name,sectionName:R.Name,tableId:j,filters:N,primarysort:H,primarysortdesc:L}}),u.value=U,S(),l.value.filteredList=!1,U}catch(U){e.handleError(U.message),console.info("[ERROR]: getFilteredListWithFields() error = ",U)}}async function S(U=!0){const O=[];for(const[R]of c.value)O.push(A(R,U));return await Promise.all(O),n.getProductCount(),!0}function D(U,O){return c.value.get(U).columns.some(R=>R.field.toLowerCase()===O)||n.cartItemColumnsMap[U].some(R=>R.field.toLowerCase()===O)}function I(U,O){let R=za(U);const M=t.pricingSchema,N=D(O,"xx_ord1__nrc__c"),H=D(O,"xx_ord1__sales_price__c"),L=D(O,"xx_ord1__qty__c");return R=R.map(z=>{let j={};M==="nrc/mrc"&&(z!=null&&z.xx_ord1__billing_period__c)?j={...H?{billingPeriodValue:(z==null?void 0:z.xx_ord1__sales_price__c)===0?"0":(z==null?void 0:z.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:z==null?void 0:z.xxord1salespricec}:{},...N?{oneTimeValue:(z==null?void 0:z.xx_ord1__nrc__c)===0?"0":(z==null?void 0:z.xx_ord1__nrc__c)||null,formattedOneTimeValue:z==null?void 0:z.xxord1nrcc}:{}}:M==="nrc/mrc"&&!(z!=null&&z.xx_ord1__billing_period__c)?H&&(j={oneTimeValue:(z==null?void 0:z.xx_ord1__sales_price__c)===0?"0":(z==null?void 0:z.xx_ord1__sales_price__c)||null,formattedOneTimeValue:z==null?void 0:z.xxord1salespricec}):M!=="nrc/mrc"&&(z!=null&&z.xx_ord1__billing_period__c)?H&&(j={billingPeriodValue:(z==null?void 0:z.xx_ord1__sales_price__c)===0?"0":(z==null?void 0:z.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:z==null?void 0:z.xxord1salespricec}):M!=="nrc/mrc"&&!(z!=null&&z.xx_ord1__billing_period__c)&&H&&(j={oneTimeValue:(z==null?void 0:z.xx_ord1__sales_price__c)===0?0:(z==null?void 0:z.xx_ord1__sales_price__c)||null,formattedOneTimeValue:z==null?void 0:z.xxord1salespricec});const{xx_ord1__qty__c:W,xx_ord1__sales_price__c:Q,xx_ord1__nrc__c:ae,...fe}=z,K={...fe,id:z.id,description:(z==null?void 0:z.xx_ord1__line_description__c)||"",xx_ord1__billing_period__c:z==null?void 0:z.xx_ord1__billing_period__c,...L?{xx_ord1__qty__c:W}:{},xx_ord1__item__c:z==null?void 0:z.xx_ord1__item__c,"xx_ord1__item__r.xx_ord1__decimal_precision__c":z["xx_ord1__item__r.xx_ord1__decimal_precision__c"]||"0",...j};return K!=null&&K.billingPeriodValue&&(n.hasBillingPeriodInList[O]=!0,n.billingPeriodValue=K==null?void 0:K.xx_ord1__billing_period__c),"oneTimeValue"in K&&(n.oneTimeFieldAvailable[O]=!0),"billingPeriodValue"in K&&(n.billingPeriodFieldAvailable[O]=!0),(K==null?void 0:K.oneTimeValue)!==""&&(K==null?void 0:K.oneTimeValue)!==null&&(n.hasOneTimeValue=!0),K}),R}async function A(U,O=!0){var R,M;try{const N=c.value.get(U);if(console.info("sectionData = ",N.sectionName),!N)return;N.loading=O,O&&(N.lineItems=[]);const{columns:H,filters:L,primarysort:z,primarysortdesc:j,footer:W}=N,Q=H.map(le=>le.field.toLowerCase());Q.includes("xx_ord1__parent_qli__c")||Q.push("xx_ord1__parent_qli__c"),Q.includes("xx_ord1__item__c")||Q.push("xx_ord1__item__c"),Q.includes("xx_ord1__sys_configuration_status2__c")||Q.push("xx_ord1__sys_configuration_status2__c"),(R=n.cartItemColumnsMap[U])==null||R.forEach(le=>{Q.includes(le.field)||Q.push(le.field)});const ae=await w({fields:Q,recordId:r.value,filters:L||[],primarySortBy:z||"",primarySortOrder:j?"DESC":"ASC",includeOptions:p.value,totalFields:W?[W.apiname]:[]}),fe=ae.lineItems,K=new Map;let V=[];const te=(M=ae.fieldTotals)==null?void 0:M.map(le=>le.totalValue);fe.forEach(le=>{le.XX_ORD1__Parent_QLI__c?K.has(le.XX_ORD1__Parent_QLI__c)?K.get(le.XX_ORD1__Parent_QLI__c).push(le):K.set(le.XX_ORD1__Parent_QLI__c,[le]):V.push(le)});const oe=[];return V.forEach(le=>{oe.push(le),K.has(le.Id)&&oe.push(...K.get(le.Id))}),V=I(V,U),N.lineItems=za(oe),N.parentQLIs=V,N.totalValues=te,N.loading=!1,c.value=new Map(c.value),oe}catch(N){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",N.message);const H=c.value.get(U);H&&(H.loading=!1)}}async function w(U){try{let O=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(U));return O=yn(O),O}catch(O){e.handleError(O.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",O)}}async function T(U){try{console.info("updateQli() payload = ",U);let O=await window.salesforceConnector.updateQli(JSON.stringify(U));return O=yn(O),S(!1),O}catch(O){e.handleError(O.message),console.info("[ERROR]: updateQli() error = ",O)}}async function P(U){try{let O=await window.salesforceConnector.deleteQLI(U);return O=yn(O),S(),O}catch(O){e.handleError(O.message),console.info("[ERROR]: deleteQLI() error = ",O)}}async function X(U,O){try{d.value=!0;const R={fields:U};O&&(R.objectName=O),U.includes("xx_ord1__qty__c")&&O==="xx_ord1__ecatalog_item__c"&&(R.fields=R.fields.filter(N=>N!=="xx_ord1__qty__c")),U.includes("xx_ord1__sales_price__c")&&O!=="xx_ord1__quote_line_item__c"&&(R.fields=R.fields.filter(N=>N!=="xx_ord1__sales_price__c"));let M=await window.salesforceConnector.getFieldsData(JSON.stringify(R));return typeof M=="string"&&(M=JSON.parse(M)),M!=null&&M.errorMessage?(e.handleError(M.errorMessage),null):(h.value={...h.value,...M},console.info("fieldsData.value = ",JSON.stringify(h.value)),M)}catch(R){return e.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",R),null}finally{d.value=!1}}function $(U=""){var O;return!U||U.includes(".")?!1:U.includes("xx_ord1__qty__c")?!0:((O=h.value[U])==null?void 0:O.isEditable)||!1}function J(){ee(Bw)}async function ee(U){var O,R,M,N,H,L,z,j,W;if(U.payload){if((O=U.payload)!=null&&O.uiModification){const Q=U.payload.uiModification;if(((R=Q.addColumn)==null?void 0:R.length)>0)if(Q.addColumn.forEach(ae=>{ae.columns.forEach(fe=>{fe.field=fe.field.toLowerCase()})}),Q.addColumn[0].sectionName==="all_section")for(const[ae,fe]of c.value)fe.columns=[...fe.columns,...Q.addColumn[0].columns];else Q.addColumn.forEach(ae=>{c.value.get(ae.tableId)&&(c.value.get(ae.tableId).columns=[...c.value.get(ae.tableId).columns,...ae.columns])});if(((M=Q.removeColumn)==null?void 0:M.length)>0)if(Q.removeColumn.forEach(ae=>{ae.columns=ae.columns.map(fe=>fe.toLowerCase())}),Q.removeColumn[0].sectionName==="all_section")for(const[ae,fe]of c.value)fe.columns=fe.columns.filter(K=>!Q.removeColumn[0].columns.includes(K.field));else Q.removeColumn.forEach(ae=>{c.value.get(ae.tableId)&&(c.value.get(ae.tableId).columns=c.value.get(ae.tableId).columns.filter(fe=>!ae.columns.includes(fe.field)))});if(((N=Q.filter)==null?void 0:N.length)>0)if(Q.filter[0].sectionName==="all_section")for(const[ae,fe]of c.value)fe.filters=[...fe.filters,...Q.filter[0].filters];else Q.filter.forEach(ae=>{c.value.get(ae.tableId)&&(c.value.get(ae.tableId).filters=[...c.value.get(ae.tableId).filters,...ae.filters])});if(((H=Q.groupBy)==null?void 0:H.length)>0){const ae=((L=[...c.value.values()][0])==null?void 0:L.columns)||Nw;c.value.clear(),n.cartItemColumnsMap={},Q.groupBy.forEach(fe=>{n.cartItemColumnsMap[fe.tableId]=fe.columns||ae,c.value.set(fe.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:fe.columns||ae,tableId:fe.tableId,sectionName:fe.sectionName,selected:new Map,footer:_(fe.footer),filters:fe.filters,primarysort:fe.primarysort,primarysortdesc:fe.primarysortdesc})})}Q.showOptions!==void 0&&(p.value=Q.showOptions)}if(((j=(z=U.payload)==null?void 0:z.sections)==null?void 0:j.length)>0){const Q=(W=U.payload)==null?void 0:W.sections;c.value.clear(),Q.forEach(ae=>{ae.tableId||(ae.tableId=Kr()),ae.selected=new Map,c.value.set(ae.tableId,ae)}),S()}}U.actionFunction==="Reload"&&(console.log("Reloading configurator 3"),S(),console.info("Reloading quote line items"))}async function Y(U){var O,R;try{const M=new Set;for(const N of c.value.keys())(O=c.value.get(N).lineItems)==null||O.forEach(L=>{L.attributes=null,M.add(L.id)});if(U){const N={lineItemIds:[...M]},H=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(N)}),L=JSON.parse(H.data);for(const z of c.value.keys())(R=c.value.get(z).lineItems)==null||R.forEach(W=>{W.attributes=L[W.id]||null})}}catch(M){console.info("[ERROR]: fetchAttributesData() error = ",M)}}return{showAttributes:f,quoteId:r,quoteName:o,templateId:a,templateOptions:s,loading:l,currentTemplateData:u,fieldsData:h,fieldsDataLoading:d,showOptionHeaderButton:g,sectionDataMap:c,promptSuggestions:m,lineItemsCount:i,addColumns:J,getQuoteEPageLayout:k,getPayload:v,getPrimaryQuote:y,fetchTemplates:b,getFilteredListWithFields:E,getQuoteLineItemsWithFilteredTable:w,updateQli:T,getFieldsData:X,deleteQLI:P,performAIAction:ee,isEditableField:$,fetchQuoteLineItems:A,fetchAllQuoteLineItems:S,fetchAttributesData:Y}}),Es=Lt("comRoot",()=>{const e=Co(),n=wn(),t=xo(),r=G(""),o=G(""),i=G("Genesis AI"),a=G(""),s=G({}),l=G(""),u=G(""),c=G(""),h=G(""),d=G({}),p=G(""),f=G(""),g=G(""),m=G(""),v=G(""),y=G(""),b=G(""),_=G("Single"),C=G("closed"),k=be(()=>t.quoteName),E=be(()=>_.value==="Single");async function S(w){r.value=w||Gl("id"),o.value=Gl("origin"),await I(),await D()}async function D(){try{console.info("getRecordInfo",r.value);let w=await window.salesforceConnector.getRecordInfo(r.value);return w=yn(w),w!==void 0&&(d.value=w,p.value=w.name,f.value=w.objectType,g.value=w.accountId,m.value=w.eCatalogId,v.value=w.currencyCode,y.value=w.userLocale,b.value=w.opportunityId),(w==null?void 0:w.objectType)==="XX_ORD1__Quote__c"?(t.quoteId=w==null?void 0:w.recordId,t.templateId=w==null?void 0:w.templateId,t.quoteName=w==null?void 0:w.name,t.lineItemsCount=(w==null?void 0:w.lineItemsCount)||0):(w==null?void 0:w.objectType)==="Opportunity"&&await t.getPrimaryQuote(w.recordId),w}catch(w){n.handleError(w.message)}}async function I(){var T,P;console.info("getOrgInformation",r.value);const w=await window.salesforceConnector.getOrgInformation();e.websocketUrl=w.websocketUrl,a.value=(T=w.locale)==null?void 0:T.replace("_","-"),s.value=w.user,l.value=w.orgName,u.value=w.orgId,c.value=w.orgType,h.value=w.packageVersion,_.value=(P=w==null?void 0:w.pricingSchema)==null?void 0:P.toLowerCase()}function A(w){i.value=w,H3(w)}return{id:r,origin:o,title:k,subTitle:i,locale:a,user:s,orgName:l,orgId:u,orgType:c,packageVersion:h,objectType:f,recordInfo:d,name:p,accountId:g,eCatalogId:m,currencyCode:v,userLocale:y,opportunityId:b,pricingSchema:_,isSinglePricingSchema:E,flyoutState:C,start:S,getRecordInfo:D,setSubTitle:A}}),Lw=Lt("quickSelection",()=>{const e=wn(),n=Es(),t=xo(),r=G(null),o=G(!1),i=G([]),a=G([]),s=G(!1),l=G({}),u=G({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),c=G(!1);async function h(){o.value=!0;try{const C=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...n.objectType?{contextObject:n.objectType}:{}});let k={};k=await window.salesforceConnector.getDynamicPageLayout(C),r.value=kf(k,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",r.value),u.value.rowLimit=r.value.configuration.rowLimit||10,r.value.data.columns.forEach(E=>{!E.field&&E.label==="QTY"&&(E.field="xx_ord1__qty__c")}),o.value=!1}catch(C){o.value=!1,e.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",C)}}function d(){const C=new Map;return r.value.data.columns.forEach(k=>{C.set(k.field,!0)}),r.value.data.searchResultColumns.forEach(k=>{C.set(k.field,!0)}),Array.from(C.keys())}async function p(C){var k,E;try{let S=await window.salesforceConnector.saveCompetitorSKU(C);if(S!=null&&S.errorMessage){e.handleError(S.errorMessage);return}if((k=S[0])!=null&&k.errorMessage){e.handleError((E=S[0])==null?void 0:E.errorMessage);return}return S}catch(S){e.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",S)}}async function f(C="",k=[]){try{let E=r.value.data,S=r.value.configuration;const D=C.trim();if(console.info("searchTextValue.trim() = ",C.trim()),!D)return[];let I=null;console.info("useMappings = ",c.value),c.value?I=Ow(g()):I=g(),console.info("fields before filter = ",I),I=I.filter(P=>P!=="xx_ord1__qty__c"),console.info("fields after filter = ",I);const A={fields:I,...k.length?{dynamicFilters:t.getDynamicFilters(k)}:{},searchText:D,accountId:n.accountId,...n.eCatalogId?{catalogId:n.eCatalogId}:{},...n.objectType==="opportunity"?{opportunityId:n.id}:{},...E!=null&&E.sort?{primarySortBy:E.sort.primary.field,primarySortOrder:E.sort.primary.direction,secondarySortBy:E.sort.secondary.field,secondarySortOrder:E.sort.secondary.direction}:{},rowLimt:(S==null?void 0:S.rowLimit)||20,paging:(S==null?void 0:S.paging)||!1,...u.value.offset!==0?{offset:u.value.offset}:{},objectName:E.objectName,currencyCode:n.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(A));const w=await window.salesforceConnector.getItems(JSON.stringify(A));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(w)),w!=null&&w.errorMessage){e.handleError(w.errorMessage);return}return w!=null&&w.itemCount&&(u.value.totalPages=Math.ceil((w==null?void 0:w.itemCount)/u.value.rowLimit)),za(w.lstItems,{xx_ord1__qty__c:"1"})}catch(E){e.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",E)}}function g(){let C=[];for(const k of r.value.data.columns){let E=k.field;if(E!=null&&E.includes(".")){C.includes(E)||C.push(E);let D=E.split(".")[0];D=D.slice(0,-1)+"c",C.includes(D)||C.push(D)}else C.includes(E)||C.push(E)}return console.info("getAllQuickSelectionFields() fields = ",C),C.filter(k=>k.toLowerCase()!=="xx_ord1__qty__c")}async function m(C,k,E,S){console.info("searchText:",JSON.stringify(C)),console.info("row:",JSON.stringify(k)),console.info("rowIndex:",JSON.stringify(E)),console.info("column:",JSON.stringify(S));const D=E+(u.value.currentPage-1)*u.value.rowLimit;if(S.field.toLowerCase().includes("xx_ord1__item__r")){if(i.value[D].itemLookupLoading=!0,c.value=!0,a.value=await f(C),a.value.length>0){const I=[];for(let A=0;A<a.value.length;A++)i.value[D].itemDataRetrieved=!0,a.value[A].xx_ord1__item__c&&I.push({name:a.value[A]["xx_ord1__item__r.name"],value:a.value[A].xx_ord1__item__c,label:a.value[A][S.field.toLowerCase()]});i.value[D][S.field.toLowerCase()+"_options"]=I}i.value[D].itemLookupLoading=!1}else if(S.field.toLowerCase().includes("xx_ord1__competitor_item__r")){i.value[D].competitorLookupLoading=!0;const I=await v(C);I!=null&&I.items&&(i.value[D][S.field.toLowerCase()+"_options"]=I.items.map(A=>({name:A.fields[2].value,value:A.fields[1].value,label:A.fields[0].value}))),i.value[D].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",I)}}async function v(C){var E,S;console.info("getLookupData() searchText = ",C);const k={searchText:C,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let D=await window.salesforceConnector.getLookupData(JSON.stringify(k));if(typeof D=="string"&&(D=JSON.parse(D)),D!=null&&D.errorMessage){e.handleError(D.errorMessage);return}if((E=D[0])!=null&&E.errorMessage){e.handleError((S=D[0])==null?void 0:S.errorMessage);return}return D}catch(D){e.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",D)}}async function y(C,k){var S;console.info("Update Other Fields Value = ",C),console.info("Update Other Fields Row Index = ",k);const E=k+(u.value.currentPage-1)*u.value.rowLimit;console.info("actualRowIndex = ",E);try{if(C){const D=a.value.filter(I=>I.xx_ord1__item__c===C)[0];if(D){s.value=!0;const I=r.value.data.columns[1].field;i.value[E][I]&&await b(D,E),(S=i.value[E])!=null&&S.itemDataRetrieved&&(i.value[E].status="New Match Requested",i.value[E].noMatchCleared=!0),Object.keys(D).forEach(A=>{const w=Z2[A.toLowerCase()];console.info("Mapped Key = ",w),w&&(i.value[E][w]=D[A])}),s.value=!1}else i.value[E].status=""}else i.value[E].status="No Match"}catch(D){e.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",D)}}async function b(C,k){const E=i.value[k],S=r.value.data.columns[1].field,D=[{sku:E[S],name:E[S],productDescription:E.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:C.xx_ord1__item__c}];let I=await p(JSON.stringify(D));console.info("Match Item: ",JSON.stringify(I)),i.value[k][`${S}_options`]=[{value:I[0].competitorItemId,label:I[0].sku}],i.value[k][S]=I[0].competitorItemId}async function _(C){try{let k=await window.salesforceConnector.createQLI(JSON.stringify(C));typeof k=="string"&&(k=JSON.parse(k));let E=!1;if((k==null?void 0:k.length)>0)for(let S=0;S<k.length;S++)k[S].errorMessage&&(E=!0,k[S].errorMessage.includes("Line Description: data value too large")&&(k[S].errorMessage="Error: The description is too long—it must be under 200 characters."));if(E){k.forEach(S=>{l.value[S.eCatalogItemId]=S});return}else l.value=[];return k}catch(k){e.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",k)}}return{quickSelectionLayout:r,quickSelectionLayoutLoading:o,processedRecords:i,useMappings:c,currentSearchData:a,createQliErrors:l,getQuickSelectionLayout:h,getAllFieldsForQuickSelectionLayout:d,saveCompetitorSKU:p,getQuickSelectionItems:f,searchLookupHandler:m,updateOtherFields:y,addAllItemsToQuote:_}});function Pw(e,n,t){const r=[];return e.templateId||r.push("AI_GUIDANCE_MISSING_TEMPLATE_ID"),e.composablesOrgType||r.push("AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE"),e.websocketUrl||r.push("AI_GUIDANCE_MISSING_WEBSOCKET_URL"),e.packageVersion||r.push("AI_GUIDANCE_MISSING_PACKAGE_VERSION"),t!=null&&t.accessToken||r.push("AI_GUIDANCE_MISSING_SECURITY_TOKEN"),n!=null&&n.organizationId||r.push("AI_GUIDANCE_MISSING_IDENTITY_ORG_ID"),n!=null&&n.userId||r.push("AI_GUIDANCE_MISSING_IDENTITY_USER_ID"),n!=null&&n.accountId||r.push("AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID"),r}function eh(e){return e?!e.startsWith("ws://")&&!e.startsWith("wss://")?"WEBSOCKET_INVALID_URL_FORMAT":null:"WEBSOCKET_MISSING_URL"}function qw(e){var n,t,r,o,i,a;if(!e)return{playbookId:null,error:null};try{const s=(r=(t=(n=e==null?void 0:e[0])==null?void 0:n.blocks)==null?void 0:t[0])==null?void 0:r.playbookId,l=((i=(o=e==null?void 0:e.blocks)==null?void 0:o[0])==null?void 0:i.playbookId)||((a=e==null?void 0:e[0])==null?void 0:a.playbookId);return{playbookId:s||l||null,error:null}}catch(s){return console.error("[validation] Error validating block structure:",s),{playbookId:null,error:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID"}}}function $w(e,n){const t=[];e!=null&&e.currentPlaybook||t.push("COMPONENT_LOADER_MISSING_PLAYBOOK");const r=n;return r&&r!=="catalog"&&r!=="cart"&&r!=="configurator"&&r!==""&&t.push("COMPONENT_LOADER_INVALID_COMPONENT_KEY"),t}const qi="Preparing Your Quote Please Wait...",vc={message:"Your quote is ready! Click 'Add Products' to browse Products, or enter a prompt and AI will do the work for you.",type:"response",requestId:"no-request-id"},Uw=18e4,jw=2e3,Hw={bgColor:"#EDF8EB",textColor:"#5F5F5F"};function Vw({minDisplayMs:e=2e3}={}){const n=[];let t=null,r=!1,o=null,i=null,a=null;const s=new Set;function l(){const y={isActive:r,currentMessage:o?o.message:null,queuedCount:n.length};s.forEach(b=>{try{b(y)}catch{}})}function u(){t||(t=setInterval(h,100))}function c(){t&&(clearInterval(t),t=null)}function h(){if(r){if(!o&&n.length>0){o={...n.shift(),shownAt:Date.now()},l();return}if(o&&Date.now()-o.shownAt>=o.minDisplayMs){if(n.length>0)o={...n.shift(),shownAt:Date.now()},l();else if(o=null,r=!1,c(),l(),i&&a){const b=i,_=a;i=null,a=null;try{_(b)}catch{}}}}}function d(y,b={}){return n.push({message:y,minDisplayMs:b.minDisplayMs||e}),r||(r=!0,u(),l()),n.length}function p(y,b){if(i=y,typeof b=="function"&&(a=b),r)u();else{const _=a,C=i;if(i=null,a=null,_)try{_(C)}catch{}}}function f(y){return typeof y!="function"?()=>{}:(s.add(y),y({isActive:r,currentMessage:o?o.message:null,queuedCount:n.length}),()=>s.delete(y))}function g(){return o?o.message:null}function m(){return r}function v(){n.length=0,o=null,r=!1,i=null,a=null,c(),l()}return{getCurrentMessage:g,getIsActive:m,subscribe:f,enqueue:d,setSuccess:p,clear:v}}const Co=Lt("ai",()=>{const e=Es(),n=xo();Y2(),Lw();const t=In(),r=mc(),o=Ht(),i=Ho();(()=>{try{return P3()}catch{return{path:""}}})();const a=G(""),s=G([]),l=G(""),u=G([]),c=G(!1),h=G(null),d=G({}),p=G(null),f=G(null),g=G(null),m=G(null),v=G(!1),y=G(!0),b=G(null),_=G(!1),C=G(null),k=G(qi),E=Vw({minDisplayMs:jw});E.subscribe(({isActive:re,currentMessage:ue})=>{re&&(k.value=ue||qi)});const S=G([]),D=be(()=>Hw),I=()=>{var Ie,ie,ye;const ue=(ye=(ie=(((Ie=i.currentPlaybook)==null?void 0:Ie.playBookSteps)||[])[0])==null?void 0:ie.uiSpecs)==null?void 0:ye.customText;return{message:typeof ue=="string"&&ue.trim().length>0?ue:vc==null?void 0:vc.message,type:"response"}},A=G(Kr()),w=be(()=>{const re=o.organizationId.value,ue=o.userId.value,Ce=o.quoteId.value||o.cid.value||A.value;return`${re}_${ue}_${Ce}`}),T=be(()=>h.value.readyState==WebSocket.OPEN),P=be(()=>o.websocketUrl.value||""),X=()=>{d.value={salesforceOrgId:o.organizationId.value,salesforceOrgType:o.composablesOrgType.value,salesforceUserId:o.userId.value,userType:"Salesforce",chatRoomId:w.value,chatId:null,requestId:"",prompt:"",initiatedFrom:e.origin||"Quote",internalCall:!1,contextObjectId:o.quoteId.value,contextObjectType:"Quote",payload:{lineItemsCount:n.lineItemsCount},origin:"DXP",defaultBatchSize:10,actionType:"",packageVersion:o.packageVersion.value,relatedIds:{accountId:o.accountId.value,eCatalogId:o.eCatalogId.value||"",contactId:o.cid.value||""}}},$=(re,ue={})=>{y.value&&rn("websocket:error",{errorCode:re,isInitialization:!0,...ue})};async function J(){const re=eh(P.value);if(re)throw $(re,{url:P.value}),new Error("WebSocket URL validation failed");y.value=!0;const ue=1e4;b.value=setTimeout(()=>{if(h.value&&h.value.readyState!==WebSocket.OPEN&&($("WEBSOCKET_CONNECTION_TIMEOUT"),h.value))try{h.value.close()}catch{}},ue);let Ce=!1;return new Promise((ie,ye)=>{var je,Ke,Xe,Ye;const Ee=(He,ct)=>{Ce||(Ce=!0,He?ye(He):ie(ct))},se=()=>{ee(),Ee(null)},ge=He=>{Y(He),Ce||Ee(new Error("WebSocket closed before open"))},Ae=He=>{U(He),Ce||Ee((He==null?void 0:He.error)||new Error("WebSocket error"))};try{const He=P.value+"?chatRoomId="+w.value;h.value=new WebSocket(He),h.value.addEventListener("open",se),h.value.addEventListener("message",O),h.value.addEventListener("close",ge),h.value.addEventListener("error",Ae)}catch(He){b.value&&(clearTimeout(b.value),b.value=null),(je=He.message)!=null&&je.includes("network")||(Ke=He.message)!=null&&Ke.includes("Network")?$("WEBSOCKET_NETWORK_ERROR",{error:He.message}):(Xe=He.message)!=null&&Xe.includes("CORS")||(Ye=He.message)!=null&&Ye.includes("cors")?$("WEBSOCKET_CORS_ERROR",{error:He.message}):$("WEBSOCKET_CONNECTION_FAILED",{error:He.message}),Ee(He)}})}const ee=()=>{b.value&&(clearTimeout(b.value),b.value=null),y.value=!1,N(),z()},Y=re=>{if(b.value&&(clearTimeout(b.value),b.value=null),y.value){const ue=(re==null?void 0:re.code)??1006,Ce=(re==null?void 0:re.reason)??"";switch(ue){case 1e3:break;case 1001:case 1002:case 1003:case 1013:case 1014:$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:ue,closeReason:Ce});break;case 1006:$("WEBSOCKET_ABNORMAL_CLOSURE",{closeCode:ue,closeReason:Ce});break;case 1011:$("WEBSOCKET_SERVER_ERROR",{closeCode:ue,closeReason:Ce});break;case 1012:$("WEBSOCKET_SERVICE_RESTART",{closeCode:ue,closeReason:Ce});break;case 1015:$("WEBSOCKET_SSL_ERROR",{closeCode:ue,closeReason:Ce});break;default:ue!==1e3&&$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:ue,closeReason:Ce})}}y.value=!1,_.value=!1,H()},U=re=>{var ue;if(b.value&&(clearTimeout(b.value),b.value=null),y.value){let Ce="WEBSOCKET_CONNECTION_FAILED";const Ie=(re==null?void 0:re.message)||((ue=re==null?void 0:re.error)==null?void 0:ue.message)||"Unknown websocket error";Ie.includes("network")||Ie.includes("Network")||Ie.includes("Failed to fetch")?Ce="WEBSOCKET_NETWORK_ERROR":Ie.includes("CORS")||Ie.includes("cors")?Ce="WEBSOCKET_CORS_ERROR":Ie.includes("SSL")||Ie.includes("TLS")||Ie.includes("certificate")?Ce="WEBSOCKET_SSL_ERROR":Ie.includes("refused")||Ie.includes("ECONNREFUSED")?Ce="WEBSOCKET_CONNECTION_REFUSED":(Ie.includes("auth")||Ie.includes("unauthorized")||Ie.includes("401"))&&(Ce="WEBSOCKET_AUTHENTICATION_FAILED"),$(Ce,{error:Ie})}_.value=!1,te(),H()},O=re=>{var Ie,ie,ye,Ee;N();const ue=JSON.parse(re.data);ue!=null&&ue.chatId&&(d.value.chatId=ue.chatId);const Ce=(ue==null?void 0:ue.contextObjectId)??((Ie=ue==null?void 0:ue.payload)==null?void 0:Ie.contextObjectId);if(Ce){const se=d.value.contextObjectId||((ie=o.quoteId)==null?void 0:ie.value)||"",ge=Ce;ge&&ge!==se&&(d.value.contextObjectId=ge,o.updateConfig({quoteId:ge}),rn("quote-id:updated",{quoteId:ge}))}if(M(ue),ue.status!=="ALIVE"){if((ue==null?void 0:ue.status)==="IN_PROGRESS"||(ue==null?void 0:ue.loading)===!0){const se=(ue==null?void 0:ue.message)||(ue==null?void 0:ue.statusMessage)||(ue==null?void 0:ue.stepName)||qi;E.enqueue(se),k.value=E.getCurrentMessage()||se;return}if((ue==null?void 0:ue.status)==="SUCCESS"){const se=(ue==null?void 0:ue.message)||qi;k.value=E.getCurrentMessage()||se,E.setSuccess(ue,ge=>{R(ge)});return}Array.isArray(ue.messages)?(k.value=null,_.value=!1,s.value.push(I()),ue.messages.length>0&&fe(ue.messages)):ue.agentResponse&&(ue.errorMessage&&(ue.agentResponse.content=ue.errorMessage,ue.agentResponse.error=!0),k.value=null,s.value.push({message:ue.agentResponse.content,type:ue.agentResponse.role,requestId:ue.requestId,epoch:ue.agentResponse.epoch,error:ue.agentResponse.error,isDML:ue.agentResponse.isDML,...(ye=ue.agentResponse)!=null&&ye.filesData?{filesData:(Ee=ue.agentResponse)==null?void 0:Ee.filesData}:{}})),S.value=ue.links||[],ne(ue)}};function R(re,ue={}){var ie,ye,Ee,se;const{skipComponentLoad:Ce=!1}=ue||{},Ie=(re==null?void 0:re.contextObjectId)??((ie=re==null?void 0:re.payload)==null?void 0:ie.contextObjectId);if(Ie){const ge=d.value.contextObjectId||((ye=o.quoteId)==null?void 0:ye.value)||"",Ae=Ie;Ae&&Ae!==ge&&(console.info("[ai] Updating quoteId from contextObjectId (SUCCESS):",{current:ge,new:Ae}),d.value.contextObjectId=Ae,o.updateConfig({quoteId:Ae}),console.info("[ai] Emitting quote-id:updated event with quoteId (SUCCESS):",Ae),rn("quote-id:updated",{quoteId:Ae}))}if(re!=null&&re.loading){k.value=re.message;return}else Array.isArray(re==null?void 0:re.messages)?(k.value=null,_.value=!1,s.value.push(I()),re.messages.length>0&&fe(re.messages)):re!=null&&re.agentResponse?(re.errorMessage&&(re.agentResponse.content=re.errorMessage,re.agentResponse.error=!0),k.value=null,s.value.push({message:re.agentResponse.content,type:re.agentResponse.role,requestId:re.requestId,epoch:re.agentResponse.epoch,error:re.agentResponse.error,isDML:re.agentResponse.isDML,...(Ee=re.agentResponse)!=null&&Ee.filesData?{filesData:(se=re.agentResponse)==null?void 0:se.filesData}:{}})):k.value=null;S.value=(re==null?void 0:re.links)||[];try{rn("ai-response:success",re)}catch{}Ce||ne(re)}const M=re=>{const ue=re==null?void 0:re.eventType,Ce=(re==null?void 0:re.loading)===!0||ue==="ResponseTextDeltaEvent",Ie=ue==="ResponseTextDoneEvent"||Array.isArray(re==null?void 0:re.messages)||!!(re!=null&&re.agentResponse);if(Ce&&!Ie){v.value=!0;return}Ie&&(v.value=!1)},N=()=>{H(),p.value=setTimeout(()=>{if(T.value){const re={action:"heartbeat"};h.value.send(JSON.stringify(re)),N()}},Uw)},H=()=>{p.value&&(clearInterval(p.value),p.value=null)};function L(re){const ue={...d.value};ue.requestType="Action",ue.actionType="Undo",ue.undoRequestId=re,ue.requestId=Kr(),ae(ue)}function z(){_.value=!0;const re={...d.value};re.requestType="Action",re.actionType="History",re.requestId=Kr(),ae(re)}function j(re){return console.info("[ai] isUnsavedChanges check",{activeKey:((i==null?void 0:i.activeComponentKey)||"").toLowerCase(),isChangedConfiguration:t.isChangedConfiguration}),((i==null?void 0:i.activeComponentKey)||"").toLowerCase()==="configurator"&&t.isChangedConfiguration&&console.warn("[ai] Unsaved configurator changes detected; not blocking send"),!1}function W(re,ue=!0,Ce=null){if(console.info("[ai] sendMessage",{messageLength:(re||"").length,hasCustomPayload:!!Ce,addMessageToHistory:ue}),j()){console.warn("[ai] sendMessage aborted: unsaved changes detected");return}if(re.trim()){let Ie={...d.value};Ie.prompt=re.trim(),Ie.requestType="Chat",Ie.requestId=Kr(),Ie.internalCall=!1,Ie.payload=K(),console.log("[ai] _payload.payload",Ie.payload),Ie.componentName=V.value,Ie.templateId=n.templateId,Ie.payload.lineItemsCount=n.lineItemsCount,Ie.relatedIds.eCatalogId=o.eCatalogId.value||"",Ce&&(Ie={...Ie,...Ce}),oe(),ue&&s.value.push({message:re.trim(),type:"user",...C.value&&{fileData:[C.value]},requestId:Ie.requestId}),console.info("[ai] sending prompt",{requestId:Ie.requestId,requestType:Ie.requestType,componentName:Ie.componentName}),ae(Ie),N()}}const Q=be(()=>{var Ce,Ie,ie;const re=((Ce=i.currentPlaybook)==null?void 0:Ce.pbUniqueId)??((Ie=i.currentPlaybook)==null?void 0:Ie.vUniqueId)??null,ue=i.currentStepName??((ie=i.currentStep)==null?void 0:ie.stepName)??null;return{pbUniqueId:re,stepName:ue}});function ae(re){const ue={...re},{pbUniqueId:Ce,stepName:Ie}=Q.value||{};console.log("[ai] activePlaybookContext",Q.value),Ce&&(ue.pbUniqueId=Ce),Ie&&(ue.stepName=Ie);const ie={action:"prompt",data:ue};h.value.send(JSON.stringify(ie))}const fe=re=>{const ue=re.filter(({content:Ce})=>!!Ce).map(Ce=>({message:Ce.content,type:Ce.role,requestId:Ce.requestId,epoch:Ce.epoch,isDML:Ce.isDML,undone:Ce.undone}));ue.forEach((Ce,Ie)=>{Ce.isDML===!0&&Ie!==ue.length-1&&(Ce.isDML=!1)}),s.value=[...s.value,...ue]};function K(){const re=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return console.info("[ai] getRequestBody activeKey",re),re==="cart"||re==="quote_item"?(console.info("[ai] getRequestBody → using quoteStore.getPayload()"),n.getPayload()):re==="configurator"?r.getPayload():(console.info("[ai] getRequestBody → empty {}"),{})}const V=be(()=>{const re=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return re==="cart"||re==="quote_item"?"QuoteItem":""}),te=()=>{s.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},oe=()=>{s.value=s.value.map(re=>({...re,links:[]}))};function le(re){var ue,Ce,Ie;try{const ie=re==null?void 0:re.stepName;if(!ie)return!1;const ye=Ye=>String(Ye||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),Ee=((ue=i.currentPlaybook)==null?void 0:ue.playBookSteps)||[],se=Ee.find(Ye=>Ye.stepName===ie||Ye.name===ie)||null,Ae=ye(se==null?void 0:se.stepComponent)==="configurator"||ye(ie).includes("configure"),je=!!((Ce=re==null?void 0:re.payload)!=null&&Ce.productConfiguration&&Array.isArray(re.payload.productConfiguration)&&re.payload.productConfiguration.length===0),Xe=ye(i.currentStep&&i.currentStep.stepComponent||((Ie=Ee.find(Ye=>Ye.stepName===(i.currentStepName||"")))==null?void 0:Ie.stepComponent)||i.activeComponentKey)==="configurator";return Ae&&je&&Xe}catch{return!1}}function ne(re){var Ie,ie,ye,Ee;const ue=(re==null?void 0:re.contextObjectId)??((Ie=re==null?void 0:re.payload)==null?void 0:Ie.contextObjectId);if(ue){const se=ue,ge=d.value.contextObjectId||((ie=o.quoteId)==null?void 0:ie.value)||"";se&&se!==ge&&(d.value.contextObjectId=se,o.updateConfig({quoteId:se}),rn("quote-id:updated",{quoteId:se}))}const Ce=re==null?void 0:re.stepName;if(Ce){if(Ce==="AI Guidance"||Ce==="ai_guidance"||Ce.toLowerCase()==="ai guidance"){console.info("[ai] Skipping navigation for AI Guidance step - side panel will remain in current state");return}if(le(re)){console.info("[ai] Skipping configurator update: empty productConfiguration and configurator already active"),(re==null?void 0:re.actionFunction)==="Reload"&&(console.log("Reloading configurator 2"),r.refresh());return}try{i.navigateToStep({stepName:Ce,data:re})}catch(se){console.info("navigateToStep failed, falling back to legacy component routing",se)}return}else{if(i.currentStepName||i.currentStep&&i.currentStep.stepName||null)return;(Ee=(ye=i.currentPlaybook)==null?void 0:ye.playBookSteps)!=null&&Ee.length&&i.navigateToStep({stepName:i.currentPlaybook.playBookSteps[0].stepName});return}}function de(){if(T.value){const re={action:"cancel",data:{requestId:d.value.requestId,chatRoomId:w.value}};h.value.send(JSON.stringify(re))}}function ve(){try{if(b.value&&(clearTimeout(b.value),b.value=null),y.value=!1,h.value){try{h.value.removeEventListener("open",ee)}catch{}try{h.value.removeEventListener("message",O)}catch{}try{h.value.removeEventListener("close",Y)}catch{}try{h.value.removeEventListener("error",U)}catch{}try{h.value.close()}catch{}h.value=null}}finally{ce()}}function xe(){try{E.clear()}catch{}a.value="",s.value=[],l.value="",u.value=[],c.value=!1,S.value=[],C.value=null,v.value=!1,m.value=null,k.value=qi,d.value={},H(),ce()}const ce=()=>{f.value&&(clearInterval(f.value),f.value=null),p.value&&(clearInterval(p.value),p.value=null),g.value&&(clearTimeout(g.value),g.value=null)};return tr(()=>{ce()}),{unsavedChanges:m,loadingMessage:k,promptMessage:a,buttonLinks:S,websocketUrl:P,chatHistory:s,latestDMLRequest:l,strikethroughHistory:u,attachmentData:C,dataManuallyChanged:c,isThinkingMessage:v,isFetchingHistory:_,chatStyles:D,undoAction:L,connectSocket:J,sendMessage:W,setInitialPayload:X,cancelRequest:de,disconnectSocket:ve,resetState:xe}}),zw={AI_GUIDANCE_MISSING_TEMPLATE_ID:{code:"AI_GUIDANCE_MISSING_TEMPLATE_ID",message:"Template ID is required for AI Guidance to initialize",component:"aiGuidance"},AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE:{code:"AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE",message:"Composables organization type is required",component:"aiGuidance"},AI_GUIDANCE_MISSING_WEBSOCKET_URL:{code:"AI_GUIDANCE_MISSING_WEBSOCKET_URL",message:"WebSocket URL is required for AI Guidance to connect",component:"aiGuidance"},AI_GUIDANCE_MISSING_PACKAGE_VERSION:{code:"AI_GUIDANCE_MISSING_PACKAGE_VERSION",message:"Package version is required",component:"aiGuidance"},AI_GUIDANCE_MISSING_SECURITY_TOKEN:{code:"AI_GUIDANCE_MISSING_SECURITY_TOKEN",message:"Security access token is required for authentication",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_ORG_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_ORG_ID",message:"Organization ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_USER_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_USER_ID",message:"User ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID:{code:"AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID",message:"Account ID is required in identity context",component:"aiGuidance"},AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED:{code:"AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED",message:"Failed to fetch playbook information from quote",component:"aiGuidance"},AI_GUIDANCE_PLAYBOOK_FETCH_FAILED:{code:"AI_GUIDANCE_PLAYBOOK_FETCH_FAILED",message:"Failed to fetch playbook data",component:"aiGuidance"},AI_GUIDANCE_CATALOG_FETCH_FAILED:{code:"AI_GUIDANCE_CATALOG_FETCH_FAILED",message:"Failed to fetch catalog in context",component:"aiGuidance"},AI_GUIDANCE_BLOCK_FETCH_FAILED:{code:"AI_GUIDANCE_BLOCK_FETCH_FAILED",message:"Failed to fetch block information from template",component:"aiGuidance"},AI_GUIDANCE_BLOCK_STRUCTURE_INVALID:{code:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID",message:"Invalid block structure - unable to parse blocks data",component:"aiGuidance"},AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING:{code:"AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING",message:"Playbook ID not found in block structure",component:"aiGuidance"},AI_GUIDANCE_JSON_PARSE_ERROR:{code:"AI_GUIDANCE_JSON_PARSE_ERROR",message:"Failed to parse JSON data from server",component:"aiGuidance"},WEBSOCKET_MISSING_URL:{code:"WEBSOCKET_MISSING_URL",message:"WebSocket URL is missing or empty",component:"aiGuidance"},WEBSOCKET_INVALID_URL_FORMAT:{code:"WEBSOCKET_INVALID_URL_FORMAT",message:"WebSocket URL must start with ws:// or wss://",component:"aiGuidance"},WEBSOCKET_CONNECTION_TIMEOUT:{code:"WEBSOCKET_CONNECTION_TIMEOUT",message:"WebSocket connection timed out during initialization",component:"aiGuidance"},WEBSOCKET_CONNECTION_REFUSED:{code:"WEBSOCKET_CONNECTION_REFUSED",message:"WebSocket connection was refused by the server",component:"aiGuidance"},WEBSOCKET_NETWORK_ERROR:{code:"WEBSOCKET_NETWORK_ERROR",message:"Network error occurred while connecting to WebSocket",component:"aiGuidance"},WEBSOCKET_AUTHENTICATION_FAILED:{code:"WEBSOCKET_AUTHENTICATION_FAILED",message:"WebSocket authentication failed",component:"aiGuidance"},WEBSOCKET_UNEXPECTED_CLOSE:{code:"WEBSOCKET_UNEXPECTED_CLOSE",message:"WebSocket connection closed unexpectedly during initialization",component:"aiGuidance"},WEBSOCKET_ABNORMAL_CLOSURE:{code:"WEBSOCKET_ABNORMAL_CLOSURE",message:"WebSocket connection closed abnormally (no close frame received)",component:"aiGuidance"},WEBSOCKET_SERVER_ERROR:{code:"WEBSOCKET_SERVER_ERROR",message:"WebSocket server error occurred during connection",component:"aiGuidance"},WEBSOCKET_SERVICE_RESTART:{code:"WEBSOCKET_SERVICE_RESTART",message:"WebSocket service is restarting",component:"aiGuidance"},WEBSOCKET_CORS_ERROR:{code:"WEBSOCKET_CORS_ERROR",message:"CORS error prevented WebSocket connection",component:"aiGuidance"},WEBSOCKET_SSL_ERROR:{code:"WEBSOCKET_SSL_ERROR",message:"SSL/TLS handshake failed for secure WebSocket connection",component:"aiGuidance"},WEBSOCKET_CONNECTION_FAILED:{code:"WEBSOCKET_CONNECTION_FAILED",message:"WebSocket connection failed during initialization",component:"aiGuidance"},COMPONENT_LOADER_MISSING_PLAYBOOK:{code:"COMPONENT_LOADER_MISSING_PLAYBOOK",message:"Current playbook is missing - cannot load component",component:"aiComponentLoader"},COMPONENT_LOADER_INVALID_COMPONENT_KEY:{code:"COMPONENT_LOADER_INVALID_COMPONENT_KEY",message:"Invalid or unknown component key",component:"aiComponentLoader"}};function Kw(e,n={}){const t=zw[e];return t?{...t,details:n}:{code:"UNKNOWN_ERROR",message:`Unknown error: ${e}`,component:"aiGuidance",details:n}}function th(e,n="aiGuidance"){const t=(o,i={})=>{const a=Kw(o,i);e("ai-guidance:error",a),console.error(`[${n}] Error:`,a)};return{emitError:t,emitErrors:(o,i={})=>{o.forEach(a=>t(a,i))}}}const Gw={class:"chat-message-links"},Xw=["href","redirect","data-test-id"],Ww=Ne({__name:"ChatMessageActions",props:{links:{type:Array,default:()=>[]},chatIndex:{type:Number,default:0}},emits:["perform-action"],setup(e){const n=(t,r,o)=>r;return(t,r)=>(F(),q("div",Gw,[(F(!0),q(De,null,Le(e.links,(o,i)=>(F(),q(De,{key:o.label},[o!=null&&o.action?(F(),Oe(en,{key:0,btype:"playbook",text:o.label,disabled:o==null?void 0:o.disabled,"data-test-id":`chat-message-action-${o.label}`,onClick:a=>t.$emit("perform-action",o.action,e.chatIndex,o==null?void 0:o.isStatic)},null,8,["text","disabled","data-test-id","onClick"])):(F(),q("a",{key:1,href:o.link,redirect:n(o.link,o.redirect),target:"_blank",class:"ai-links","data-test-id":`chat-message-action-${o.label}`},ke(o.label),9,Xw))],64))),128))]))}},[["__scopeId","data-v-e0a9c744"]]),Qw={class:"a-icon"},Zw=["src"],Jw={class:"a-name"},Yw={class:"a-size"},eI=Ne({__name:"AppAttachment",props:{background:{type:String,default:"#f8f8f8"},info:{type:Object,required:!0,default:()=>({iconUrl:"",fileName:"",fileSize:""})},encodedString:{type:String,default:""}},emits:["download"],setup(e,{emit:n}){const t=e,r=n,o=i=>{try{const a=i.match(/^data:(.*?);base64,(.*)$/);if(!a||a.length!==3)throw new Error("Invalid Base64 file format");const s=a[1],l=a[2],u=document.createElement("a");u.href=i,u.download=t.info.fileName||"download",u.target="_blank",document.body.appendChild(u),u.click(),document.body.removeChild(u);const c=Af(Math.floor(l.length*3/4));r("download",{name:t.info.fileName,size:c,url:i})}catch(a){console.info("[ERROR]: Error decoding Base64 file:",a)}};return(i,a)=>(F(),q("div",{class:"attachment-wrapper",style:Re(`background: ${e.background}`)},[x("span",Qw,[x("img",{src:e.info.iconUrl},null,8,Zw)]),x("div",null,[x("p",Jw,ke(e.info.fileName),1),x("p",Yw,ke(e.info.fileSize),1)]),e.encodedString?(F(),q("button",{key:0,class:"a-download",onClick:a[0]||(a[0]=s=>o(e.encodedString))},[pe(Ge,{icon:"download",color:"#353535"})])):me("",!0)],4))}},[["__scopeId","data-v-4194a82b"]]),nh="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%204C7.75%202.20508%209.20508%200.75%2011%200.75H27C27.1212%200.75%2027.2375%200.798159%2027.3232%200.883885L38.1161%2011.6768C38.2018%2011.7625%2038.25%2011.8788%2038.25%2012V36C38.25%2037.7949%2036.7949%2039.25%2035%2039.25H11C9.20507%2039.25%207.75%2037.7949%207.75%2036V4Z'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3cpath%20d='M27%200.5V8C27%2010.2091%2028.7909%2012%2031%2012H38.5'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3crect%20x='1'%20y='18'%20width='28'%20height='16'%20rx='2'%20fill='%23198708'/%3e%3cpath%20d='M11.2726%2025.2734H9.71724C9.68883%2025.0722%209.63083%2024.8935%209.54324%2024.7372C9.45564%2024.5786%209.34319%2024.4437%209.20588%2024.3324C9.06857%2024.2211%208.90995%2024.1359%208.73002%2024.0767C8.55247%2024.0175%208.35952%2023.9879%208.15119%2023.9879C7.77477%2023.9879%207.44688%2024.0814%207.16752%2024.2685C6.88817%2024.4531%206.67155%2024.723%206.51767%2025.0781C6.36378%2025.4309%206.28684%2025.8594%206.28684%2026.3636C6.28684%2026.8821%206.36378%2027.3177%206.51767%2027.6705C6.67392%2028.0232%206.89172%2028.2895%207.17108%2028.4695C7.45043%2028.6494%207.77359%2028.7393%208.14054%2028.7393C8.3465%2028.7393%208.53708%2028.7121%208.71227%2028.6577C8.88983%2028.6032%209.04726%2028.5239%209.18457%2028.4197C9.32188%2028.3132%209.43552%2028.1842%209.52548%2028.0327C9.61781%2027.8812%209.68173%2027.7083%209.71724%2027.5142L11.2726%2027.5213C11.2324%2027.8551%2011.1318%2028.1771%2010.9708%2028.4872C10.8122%2028.795%2010.5979%2029.0708%2010.328%2029.3146C10.0605%2029.5561%209.74092%2029.7479%209.36923%2029.8899C8.99991%2030.0296%208.58206%2030.0994%208.11568%2030.0994C7.467%2030.0994%206.88699%2029.9527%206.37562%2029.6591C5.86663%2029.3655%205.46416%2028.9406%205.16824%2028.3842C4.87467%2027.8279%204.72789%2027.1544%204.72789%2026.3636C4.72789%2025.5705%204.87704%2024.8958%205.17534%2024.3395C5.47363%2023.7831%205.87846%2023.3594%206.38983%2023.0682C6.90119%2022.7746%207.47647%2022.6278%208.11568%2022.6278C8.53708%2022.6278%208.9277%2022.687%209.28755%2022.8054C9.64977%2022.9238%209.97056%2023.0966%2010.2499%2023.3239C10.5293%2023.5488%2010.7565%2023.8246%2010.9317%2024.1513C11.1093%2024.478%2011.2229%2024.852%2011.2726%2025.2734ZM16.3206%2024.8189C16.2922%2024.5324%2016.1702%2024.3099%2015.9548%2024.1513C15.7394%2023.9927%2015.447%2023.9134%2015.0777%2023.9134C14.8267%2023.9134%2014.6148%2023.9489%2014.442%2024.0199C14.2692%2024.0885%2014.1366%2024.1844%2014.0443%2024.3075C13.9543%2024.4306%2013.9094%2024.5703%2013.9094%2024.7266C13.9046%2024.8568%2013.9318%2024.9704%2013.991%2025.0675C14.0526%2025.1645%2014.1366%2025.2486%2014.2432%2025.3196C14.3497%2025.3883%2014.4728%2025.4486%2014.6125%2025.5007C14.7522%2025.5504%2014.9013%2025.593%2015.0599%2025.6286L15.7133%2025.7848C16.0306%2025.8558%2016.3218%2025.9505%2016.5869%2026.0689C16.8521%2026.1873%2017.0817%2026.3329%2017.2758%2026.5057C17.47%2026.6785%2017.6203%2026.8821%2017.7268%2027.1165C17.8357%2027.3509%2017.8914%2027.6196%2017.8937%2027.9226C17.8914%2028.3677%2017.7777%2028.7536%2017.5528%2029.0803C17.3303%2029.4046%2017.0083%2029.6567%2016.5869%2029.8366C16.1679%2030.0142%2015.6624%2030.103%2015.0706%2030.103C14.4835%2030.103%2013.9721%2030.013%2013.5365%2029.8331C13.1032%2029.6532%2012.7647%2029.3868%2012.5209%2029.0341C12.2794%2028.679%2012.1527%2028.2398%2012.1409%2027.7166H13.6288C13.6454%2027.9605%2013.7152%2028.1641%2013.8383%2028.3274C13.9638%2028.4884%2014.1307%2028.6103%2014.339%2028.6932C14.5497%2028.7737%2014.7877%2028.8139%2015.0528%2028.8139C15.3132%2028.8139%2015.5393%2028.776%2015.7311%2028.7003C15.9252%2028.6245%2016.0756%2028.5192%2016.1821%2028.3842C16.2886%2028.2493%2016.3419%2028.0942%2016.3419%2027.919C16.3419%2027.7557%2016.2934%2027.6184%2016.1963%2027.5071C16.1016%2027.3958%2015.9619%2027.3011%2015.7773%2027.223C15.595%2027.1449%2015.3712%2027.0739%2015.1061%2027.0099L14.3142%2026.8111C13.701%2026.6619%2013.2169%2026.4287%2012.8618%2026.1115C12.5067%2025.7943%2012.3303%2025.367%2012.3327%2024.8295C12.3303%2024.3892%2012.4475%2024.0045%2012.6842%2023.6754C12.9233%2023.3464%2013.2512%2023.0895%2013.6679%2022.9048C14.0845%2022.7202%2014.558%2022.6278%2015.0883%2022.6278C15.6281%2022.6278%2016.0992%2022.7202%2016.5017%2022.9048C16.9065%2023.0895%2017.2214%2023.3464%2017.4463%2023.6754C17.6712%2024.0045%2017.7872%2024.3857%2017.7943%2024.8189H16.3206ZM20.2419%2022.7273L21.9997%2028.2528H22.0672L23.8286%2022.7273H25.5331L23.026%2030H21.0445L18.5338%2022.7273H20.2419Z'%20fill='white'/%3e%3c/svg%3e",rh="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75%204C7.75%202.20508%209.20508%200.75%2011%200.75H27C27.1212%200.75%2027.2375%200.798159%2027.3232%200.883885L38.1161%2011.6768C38.2018%2011.7625%2038.25%2011.8788%2038.25%2012V36C38.25%2037.7949%2036.7949%2039.25%2035%2039.25H11C9.20507%2039.25%207.75%2037.7949%207.75%2036V4Z'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3cpath%20d='M27%200.5V8C27%2010.2091%2028.7909%2012%2031%2012H38.5'%20stroke='%23DEDEDE'%20stroke-width='1.5'/%3e%3crect%20x='2'%20y='18.5'%20width='24'%20height='15'%20rx='2'%20fill='%23198708'/%3e%3cpath%20d='M7.14773%2022.9545L8.46768%2025.1854H8.51882L9.84517%2022.9545H11.408L9.41051%2026.2273L11.4528%2029.5H9.86115L8.51882%2027.266H8.46768L7.12536%2029.5H5.54013L7.58878%2026.2273L5.57848%2022.9545H7.14773ZM12.2837%2029.5V22.9545H13.6676V28.359H16.4737V29.5H12.2837ZM20.941%2024.837C20.9154%2024.5792%2020.8057%2024.3789%2020.6118%2024.2362C20.4179%2024.0934%2020.1547%2024.022%2019.8224%2024.022C19.5965%2024.022%2019.4058%2024.054%2019.2503%2024.1179C19.0947%2024.1797%2018.9754%2024.266%2018.8923%2024.3768C18.8113%2024.4876%2018.7709%2024.6133%2018.7709%2024.7539C18.7666%2024.8711%2018.7911%2024.9734%2018.8444%2025.0607C18.8998%2025.1481%2018.9754%2025.2237%2019.0713%2025.2876C19.1672%2025.3494%2019.278%2025.4038%2019.4037%2025.4506C19.5294%2025.4954%2019.6636%2025.5337%2019.8064%2025.5657L20.3944%2025.7063C20.68%2025.7702%2020.942%2025.8555%2021.1807%2025.962C21.4193%2026.0685%2021.626%2026.1996%2021.8007%2026.3551C21.9754%2026.5107%2022.1107%2026.6939%2022.2066%2026.9048C22.3046%2027.1158%2022.3547%2027.3576%2022.3568%2027.6303C22.3547%2028.0309%2022.2524%2028.3782%2022.05%2028.6722C21.8497%2028.9641%2021.5599%2029.1911%2021.1807%2029.353C20.8035%2029.5128%2020.3486%2029.5927%2019.816%2029.5927C19.2876%2029.5927%2018.8273%2029.5117%2018.4353%2029.3498C18.0454%2029.1879%2017.7407%2028.9482%2017.5212%2028.6307C17.3039%2028.3111%2017.1899%2027.9158%2017.1792%2027.445H18.5184C18.5333%2027.6644%2018.5961%2027.8477%2018.7069%2027.9947C18.8199%2028.1396%2018.9701%2028.2493%2019.1576%2028.3239C19.3472%2028.3963%2019.5613%2028.4325%2019.8%2028.4325C20.0344%2028.4325%2020.2378%2028.3984%2020.4104%2028.3303C20.5851%2028.2621%2020.7204%2028.1673%2020.8163%2028.0458C20.9122%2027.9244%2020.9601%2027.7848%2020.9601%2027.6271C20.9601%2027.4801%2020.9165%2027.3565%2020.8291%2027.2564C20.7439%2027.1562%2020.6182%2027.071%2020.452%2027.0007C20.2879%2026.9304%2020.0866%2026.8665%2019.8479%2026.8089L19.1352%2026.63C18.5834%2026.4957%2018.1476%2026.2859%2017.828%2026.0004C17.5084%2025.7148%2017.3497%2025.3303%2017.3518%2024.8466C17.3497%2024.4503%2017.4552%2024.104%2017.6682%2023.8079C17.8834%2023.5117%2018.1785%2023.2805%2018.5535%2023.1143C18.9285%2022.9482%2019.3547%2022.8651%2019.8319%2022.8651C20.3177%2022.8651%2020.7417%2022.9482%2021.104%2023.1143C21.4683%2023.2805%2021.7517%2023.5117%2021.9541%2023.8079C22.1565%2024.104%2022.2609%2024.4471%2022.2673%2024.837H20.941Z'%20fill='white'/%3e%3c/svg%3e",tI={name:"SkeletonLoader",props:{dataTestId:{type:String,default:""}}},nI=["data-test-id"];function rI(e,n,t,r,o,i){return F(),q("div",{class:"skeleton-loader","data-test-id":t.dataTestId},null,8,nI)}const $i=Ne(tI,[["render",rI],["__scopeId","data-v-17a86e07"]]),oh={};function oI(e){let n=oh[e];if(n)return n;n=oh[e]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);n.push(r)}for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);n[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return n}function Vo(e,n){typeof n!="string"&&(n=Vo.defaultChars);const t=oI(n);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let i=0,a=r.length;i<a;i+=3){const s=parseInt(r.slice(i+1,i+3),16);if(s<128){o+=t[s];continue}if((s&224)===192&&i+3<a){const l=parseInt(r.slice(i+4,i+6),16);if((l&192)===128){const u=s<<6&1984|l&63;u<128?o+="��":o+=String.fromCharCode(u),i+=3;continue}}if((s&240)===224&&i+6<a){const l=parseInt(r.slice(i+4,i+6),16),u=parseInt(r.slice(i+7,i+9),16);if((l&192)===128&&(u&192)===128){const c=s<<12&61440|l<<6&4032|u&63;c<2048||c>=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),i+=6;continue}}if((s&248)===240&&i+9<a){const l=parseInt(r.slice(i+4,i+6),16),u=parseInt(r.slice(i+7,i+9),16),c=parseInt(r.slice(i+10,i+12),16);if((l&192)===128&&(u&192)===128&&(c&192)===128){let h=s<<18&1835008|l<<12&258048|u<<6&4032|c&63;h<65536||h>1114111?o+="����":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),i+=9;continue}}o+="�"}return o})}Vo.defaultChars=";/?:@&=+$,#",Vo.componentChars="";const ih={};function iI(e){let n=ih[e];if(n)return n;n=ih[e]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);/^[0-9a-z]$/i.test(r)?n.push(r):n.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let t=0;t<e.length;t++)n[e.charCodeAt(t)]=e[t];return n}function Ui(e,n,t){typeof n!="string"&&(t=n,n=Ui.defaultChars),typeof t>"u"&&(t=!0);const r=iI(n);let o="";for(let i=0,a=e.length;i<a;i++){const s=e.charCodeAt(i);if(t&&s===37&&i+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(s<128){o+=r[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&i+1<a){const l=e.charCodeAt(i+1);if(l>=56320&&l<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}Ui.defaultChars=";/?:@&=+$,-_.!~*'()#",Ui.componentChars="-_.!~*'()";function bc(e){let n="";return n+=e.protocol||"",n+=e.slashes?"//":"",n+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?n+="["+e.hostname+"]":n+=e.hostname||"",n+=e.port?":"+e.port:"",n+=e.pathname||"",n+=e.search||"",n+=e.hash||"",n}function ks(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const aI=/^([a-z0-9.+-]+:)/i,sI=/:[0-9]*$/,lI=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,uI=["<",">",'"',"`"," ","\r",`
|
|
169
169
|
`," "],cI=["{","}","|","\\","^","`"].concat(uI),dI=["'"].concat(cI),ah=["%","/","?",";","#"].concat(dI),sh=["/","?","#"],fI=255,lh=/^[+a-z0-9A-Z_-]{0,63}$/,hI=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,uh={javascript:!0,"javascript:":!0},ch={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function _c(e,n){if(e&&e instanceof ks)return e;const t=new ks;return t.parse(e,n),t}ks.prototype.parse=function(e,n){let t,r,o,i=e;if(i=i.trim(),!n&&e.split("#").length===1){const u=lI.exec(i);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let a=aI.exec(i);if(a&&(a=a[0],t=a.toLowerCase(),this.protocol=a,i=i.substr(a.length)),(n||a||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(a&&uh[a])&&(i=i.substr(2),this.slashes=!0)),!uh[a]&&(o||a&&!ch[a])){let u=-1;for(let f=0;f<sh.length;f++)r=i.indexOf(sh[f]),r!==-1&&(u===-1||r<u)&&(u=r);let c,h;u===-1?h=i.lastIndexOf("@"):h=i.lastIndexOf("@",u),h!==-1&&(c=i.slice(0,h),i=i.slice(h+1),this.auth=c),u=-1;for(let f=0;f<ah.length;f++)r=i.indexOf(ah[f]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=i.length),i[u-1]===":"&&u--;const d=i.slice(0,u);i=i.slice(u),this.parseHost(d),this.hostname=this.hostname||"";const p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){const f=this.hostname.split(/\./);for(let g=0,m=f.length;g<m;g++){const v=f[g];if(v&&!v.match(lh)){let y="";for(let b=0,_=v.length;b<_;b++)v.charCodeAt(b)>127?y+="x":y+=v[b];if(!y.match(lh)){const b=f.slice(0,g),_=f.slice(g+1),C=v.match(hI);C&&(b.push(C[1]),_.unshift(C[2])),_.length&&(i=_.join(".")+i),this.hostname=b.join(".");break}}}}this.hostname.length>fI&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=i.indexOf("#");s!==-1&&(this.hash=i.substr(s),i=i.slice(0,s));const l=i.indexOf("?");return l!==-1&&(this.search=i.substr(l),i=i.slice(0,l)),i&&(this.pathname=i),ch[t]&&this.hostname&&!this.pathname&&(this.pathname=""),this},ks.prototype.parseHost=function(e){let n=sI.exec(e);n&&(n=n[0],n!==":"&&(this.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(this.hostname=e)};const pI=Object.freeze(Object.defineProperty({__proto__:null,decode:Vo,encode:Ui,format:bc,parse:_c},Symbol.toStringTag,{value:"Module"})),dh=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,fh=/[\0-\x1F\x7F-\x9F]/,mI=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,xc=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,hh=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,ph=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,gI=Object.freeze(Object.defineProperty({__proto__:null,Any:dh,Cc:fh,Cf:mI,P:xc,S:hh,Z:ph},Symbol.toStringTag,{value:"Module"})),yI=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),vI=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Cc;const bI=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),_I=(Cc=String.fromCodePoint)!==null&&Cc!==void 0?Cc:function(e){let n="";return e>65535&&(e-=65536,n+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),n+=String.fromCharCode(e),n};function xI(e){var n;return e>=55296&&e<=57343||e>1114111?65533:(n=bI.get(e))!==null&&n!==void 0?n:e}var qt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(qt||(qt={}));const CI=32;var Qr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Qr||(Qr={}));function Ec(e){return e>=qt.ZERO&&e<=qt.NINE}function EI(e){return e>=qt.UPPER_A&&e<=qt.UPPER_F||e>=qt.LOWER_A&&e<=qt.LOWER_F}function kI(e){return e>=qt.UPPER_A&&e<=qt.UPPER_Z||e>=qt.LOWER_A&&e<=qt.LOWER_Z||Ec(e)}function AI(e){return e===qt.EQUALS||kI(e)}var $t;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})($t||($t={}));var Zr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Zr||(Zr={}));class wI{constructor(n,t,r){this.decodeTree=n,this.emitCodePoint=t,this.errors=r,this.state=$t.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Zr.Strict}startEntity(n){this.decodeMode=n,this.state=$t.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(n,t){switch(this.state){case $t.EntityStart:return n.charCodeAt(t)===qt.NUM?(this.state=$t.NumericStart,this.consumed+=1,this.stateNumericStart(n,t+1)):(this.state=$t.NamedEntity,this.stateNamedEntity(n,t));case $t.NumericStart:return this.stateNumericStart(n,t);case $t.NumericDecimal:return this.stateNumericDecimal(n,t);case $t.NumericHex:return this.stateNumericHex(n,t);case $t.NamedEntity:return this.stateNamedEntity(n,t)}}stateNumericStart(n,t){return t>=n.length?-1:(n.charCodeAt(t)|CI)===qt.LOWER_X?(this.state=$t.NumericHex,this.consumed+=1,this.stateNumericHex(n,t+1)):(this.state=$t.NumericDecimal,this.stateNumericDecimal(n,t))}addToNumericResult(n,t,r,o){if(t!==r){const i=r-t;this.result=this.result*Math.pow(o,i)+parseInt(n.substr(t,i),o),this.consumed+=i}}stateNumericHex(n,t){const r=t;for(;t<n.length;){const o=n.charCodeAt(t);if(Ec(o)||EI(o))t+=1;else return this.addToNumericResult(n,r,t,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(n,r,t,16),-1}stateNumericDecimal(n,t){const r=t;for(;t<n.length;){const o=n.charCodeAt(t);if(Ec(o))t+=1;else return this.addToNumericResult(n,r,t,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(n,r,t,10),-1}emitNumericEntity(n,t){var r;if(this.consumed<=t)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(n===qt.SEMI)this.consumed+=1;else if(this.decodeMode===Zr.Strict)return 0;return this.emitCodePoint(xI(this.result),this.consumed),this.errors&&(n!==qt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(n,t){const{decodeTree:r}=this;let o=r[this.treeIndex],i=(o&Qr.VALUE_LENGTH)>>14;for(;t<n.length;t++,this.excess++){const a=n.charCodeAt(t);if(this.treeIndex=II(r,o,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Zr.Attribute&&(i===0||AI(a))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],i=(o&Qr.VALUE_LENGTH)>>14,i!==0){if(a===qt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Zr.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var n;const{result:t,decodeTree:r}=this,o=(r[t]&Qr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,o,this.consumed),(n=this.errors)===null||n===void 0||n.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(n,t,r){const{decodeTree:o}=this;return this.emitCodePoint(t===1?o[n]&~Qr.VALUE_LENGTH:o[n+1],r),t===3&&this.emitCodePoint(o[n+2],r),r}end(){var n;switch(this.state){case $t.NamedEntity:return this.result!==0&&(this.decodeMode!==Zr.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $t.NumericDecimal:return this.emitNumericEntity(0,2);case $t.NumericHex:return this.emitNumericEntity(0,3);case $t.NumericStart:return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $t.EntityStart:return 0}}}function mh(e){let n="";const t=new wI(e,r=>n+=_I(r));return function(o,i){let a=0,s=0;for(;(s=o.indexOf("&",s))>=0;){n+=o.slice(a,s),t.startEntity(i);const u=t.write(o,s+1);if(u<0){a=s+t.end();break}a=s+u,s=u===0?a+1:a}const l=n+o.slice(a);return n="",l}}function II(e,n,t,r){const o=(n&Qr.BRANCH_LENGTH)>>7,i=n&Qr.JUMP_TABLE;if(o===0)return i!==0&&r===i?t:-1;if(i){const l=r-i;return l<0||l>=o?-1:e[t+l]-1}let a=t,s=a+o-1;for(;a<=s;){const l=a+s>>>1,u=e[l];if(u<r)a=l+1;else if(u>r)s=l-1;else return e[l+o]}return-1}const SI=mh(yI);mh(vI);function gh(e,n=Zr.Legacy){return SI(e,n)}function OI(e){return Object.prototype.toString.call(e)}function kc(e){return OI(e)==="[object String]"}const TI=Object.prototype.hasOwnProperty;function DI(e,n){return TI.call(e,n)}function As(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!="object")throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){e[r]=t[r]})}}),e}function yh(e,n,t){return[].concat(e.slice(0,n),t,e.slice(n+1))}function Ac(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function ws(e){if(e>65535){e-=65536;const n=55296+(e>>10),t=56320+(e&1023);return String.fromCharCode(n,t)}return String.fromCharCode(e)}const vh=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,RI=/&([a-z#][a-z0-9]{1,31});/gi,MI=new RegExp(vh.source+"|"+RI.source,"gi"),FI=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function BI(e,n){if(n.charCodeAt(0)===35&&FI.test(n)){const r=n[1].toLowerCase()==="x"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return Ac(r)?ws(r):e}const t=gh(e);return t!==e?t:e}function NI(e){return e.indexOf("\\")<0?e:e.replace(vh,"$1")}function zo(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(MI,function(n,t,r){return t||BI(n,r)})}const LI=/[&<>"]/,PI=/[&<>"]/g,qI={"&":"&","<":"<",">":">",'"':"""};function $I(e){return qI[e]}function Jr(e){return LI.test(e)?e.replace(PI,$I):e}const UI=/[.?*+^$[\]\\(){}|-]/g;function jI(e){return e.replace(UI,"\\$&")}function mt(e){switch(e){case 9:case 32:return!0}return!1}function ji(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Hi(e){return xc.test(e)||hh.test(e)}function Vi(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Is(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const HI=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:yh,assign:As,escapeHtml:Jr,escapeRE:jI,fromCodePoint:ws,has:DI,isMdAsciiPunct:Vi,isPunctChar:Hi,isSpace:mt,isString:kc,isValidEntityCode:Ac,isWhiteSpace:ji,lib:{mdurl:pI,ucmicro:gI},normalizeReference:Is,unescapeAll:zo,unescapeMd:NI},Symbol.toStringTag,{value:"Module"}));function VI(e,n,t){let r,o,i,a;const s=e.posMax,l=e.pos;for(e.pos=n+1,r=1;e.pos<s;){if(i=e.src.charCodeAt(e.pos),i===93&&(r--,r===0)){o=!0;break}if(a=e.pos,e.md.inline.skipToken(e),i===91){if(a===e.pos-1)r++;else if(t)return e.pos=l,-1}}let u=-1;return o&&(u=e.pos),e.pos=l,u}function zI(e,n,t){let r,o=n;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<t;){if(r=e.charCodeAt(o),r===10||r===60)return i;if(r===62)return i.pos=o+1,i.str=zo(e.slice(n+1,o)),i.ok=!0,i;if(r===92&&o+1<t){o+=2;continue}o++}return i}let a=0;for(;o<t&&(r=e.charCodeAt(o),!(r===32||r<32||r===127));){if(r===92&&o+1<t){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(r===40&&(a++,a>32))return i;if(r===41){if(a===0)break;a--}o++}return n===o||a!==0||(i.str=zo(e.slice(n,o)),i.pos=o,i.ok=!0),i}function KI(e,n,t,r){let o,i=n;const a={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)a.str=r.str,a.marker=r.marker;else{if(i>=t)return a;let s=e.charCodeAt(i);if(s!==34&&s!==39&&s!==40)return a;n++,i++,s===40&&(s=41),a.marker=s}for(;i<t;){if(o=e.charCodeAt(i),o===a.marker)return a.pos=i+1,a.str+=zo(e.slice(n,i)),a.ok=!0,a;if(o===40&&a.marker===41)return a;o===92&&i+1<t&&i++,i++}return a.can_continue=!0,a.str+=zo(e.slice(n,i)),a}const GI=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:zI,parseLinkLabel:VI,parseLinkTitle:KI},Symbol.toStringTag,{value:"Module"})),ur={};ur.code_inline=function(e,n,t,r,o){const i=e[n];return"<code"+o.renderAttrs(i)+">"+Jr(i.content)+"</code>"},ur.code_block=function(e,n,t,r,o){const i=e[n];return"<pre"+o.renderAttrs(i)+"><code>"+Jr(e[n].content)+`</code></pre>
|
|
170
170
|
`},ur.fence=function(e,n,t,r,o){const i=e[n],a=i.info?zo(i.info).trim():"";let s="",l="";if(a){const c=a.split(/(\s+)/g);s=c[0],l=c.slice(2).join("")}let u;if(t.highlight?u=t.highlight(i.content,s,l)||Jr(i.content):u=Jr(i.content),u.indexOf("<pre")===0)return u+`
|
|
171
171
|
`;if(a){const c=i.attrIndex("class"),h=i.attrs?i.attrs.slice():[];c<0?h.push(["class",t.langPrefix+s]):(h[c]=h[c].slice(),h[c][1]+=" "+t.langPrefix+s);const d={attrs:h};return`<pre><code${o.renderAttrs(d)}>${u}</code></pre>
|