@expedite-commerce/expedite-components 0.2.134 → 0.2.136
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.
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
query SalesforceActions($action: String!, $data: SalesforceData) {
|
|
143
143
|
salesforceActions(action: $action, data: $data)
|
|
144
144
|
}
|
|
145
|
-
`,ui={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 Ct({action:t,data:r,config:n={}}){var y,f;const o=ft(),a=n.accessToken??o.accessToken.value,i=n.salesforceOrgId??o.organizationId.value,l=n.userId??o.userId.value,s=n.orgType??o.composablesOrgType.value,u=n.baseUrl??o.composablesApiUrl.value,h=ui[n.pathKey]??ui[n.pathKey.split(".")[0]][n.pathKey.split(".")[1]];if(!h)throw new Error(`Invalid pathKey: ${n.pathKey}. Available keys: ${Object.keys(ui).join(", ")}`);const d=`${u}${h}`;if(!i&&n.pathKey!=="fetchAccessToken")throw new Error("salesforceOrgId is required. Provide it in config or set it via useComposableStore.updateConfig()");let m;t?m={action:t,data:r}:m=r;const c={"Content-Type":"application/json"};if(a&&(c.Authorization=`Bearer ${a}`),i&&(c["X-Salesforce-Org-Id"]=i),s&&(c["X-Salesforce-Org-Type"]=s),l&&(c["X-Salesforce-User-Id"]=l),!d)throw new Error("composablesApiUrl is required. Provide it in props or set it via useComposableStore.updateConfig()");try{console.log(`[COMPOSABLES_API:${t||"no-action"}] request`,JSON.stringify(m)),console.log(`[COMPOSABLES_API:${t||"no-action"}] headers`,c);const b=await Ue.post(d,m,{headers:c});if(console.log(`[COMPOSABLES_API:${t||"no-action"}] response`,b.data),!t&&((y=b.data)!=null&&y.data)&&typeof b.data.data=="string")try{b.data=JSON.parse(b.data.data)}catch(p){console.warn("[COMPOSABLES_API] Failed to parse data field:",p)}else if(!t&&((f=b.data)!=null&&f.data)&&typeof b.data.data=="object")try{b.data=b.data.data}catch(p){console.warn("[COMPOSABLES_API] Failed to parse content field:",p)}return b.data}catch(b){throw console.error(`[COMPOSABLES_API:${t||"no-action"}] error:`,b),b}}const Qn="https://d2pgvmpph8dmlo.cloudfront.net";function hc(t,r,n){return t?t==null?void 0:t.map(o=>d4(o,r,n)):[]}function d4(t,r,n){const{url:o,staticResource:a}=t;if(!o)return null;if(o.includes("/resource/")&&!o.includes("://")&&a){const i=o.split("/"),l=i[i.length-1];return`${Qn}/${n}/static/${l}.${r}`}else return o}const Co=it.defineStore("blockLegacy",()=>{const t=ft(),r=e.ref(null),n=e.ref(null),o=e.ref(!1),a=e.ref(null);async function i(d,m=!0){var f,b;if(console.info("fetchBlockInformation templateId:",d.templateId),!d.templateId)return;m&&(r.value=[],o.value=!1);const c={storefrontId:d.storefrontId,templateId:d.templateId};console.log("fetchBlockInformation variables",JSON.stringify(c)),console.log("fetchBlockInformation getTemplateBlock",dc);const y=await br(dc,c);if(console.log("fetchBlockInformation getTemplateBlockResponse",y),console.log("fetchBlockInformation pageBlocks",r.value),n.value=d.templateId,m)(f=y.content)!=null&&f.blocks?(r.value=l(JSON.parse(y.content.blocks)),console.log("fetchBlockInformation pageBlocks 1",r.value)):r.value=[],o.value=!0;else return((b=y==null?void 0:y.content)==null?void 0:b.blocks)||[]}function l(d){const m=t.organizationId.value;return d==null||d.forEach(c=>{c.blocks=c.blocks?JSON.parse(c.blocks):[],c.blocks.forEach(y=>{var f,b;Object.assign(y,JSON.parse(y.contentJSON)),y.contentJSON=null,y.id=y.blockId||y.Id,(y.componentName==="catalogBlock"||y.componentName==="relatedProducts")&&(s(y.fields.productCard.actions),y.fields.noFriendlyURL=!0,y.fields.productCard.friendlyURL=null,y.fields.productCard.friendlyURLFields=null,(f=y.configuration)!=null&&f.productTemplateId?y.fields.productCard.url="/product/"+((b=y.configuration)==null?void 0:b.productTemplateId):y.fields.productCard.url=null),y.componentName==="productSummary"&&(console.log("block.fields.actions",y.fields.actions),s(y.fields.actions)),y.customJS&&(y.customJS=hc(y.customJS,"js",m)),y.customCSS&&(y.customCSS=hc(y.customCSS,"css",m))})}),d}function s(d){d.forEach(m=>{m.action==="CUSTOM_ACTION"&&(m.action="CUSTOM",m.name=m.label.title,m.value=m.url.field||m.url.title,m.newTab=m.openInNewTab)})}async function u(d,m=!0){var c,y,f;if(console.info("fetchBlockInformationREST templateId:",d.templateId),!!d.templateId){m&&(r.value=[],o.value=!1);try{const b=await Ct({action:"retrieveBlock",data:{salesforceOrgId:t.organizationId.value,storefrontId:d.templateId,templateId:"wrapperDefault"},config:{pathKey:"retrieveBlock"}});n.value=d.templateId;const p=((y=(c=b==null?void 0:b.data)==null?void 0:c[0])==null?void 0:y.blocks)??((f=b==null?void 0:b.data)==null?void 0:f.blocks);if(console.log("fetchBlockInformationREST blocksData",p),m){if(p){const x=typeof p=="string"?JSON.parse(p):p;console.log("fetchBlockInformationREST parsedBlocks",x),r.value=l(x),console.log("fetchBlockInformationREST pageBlocks",r.value)}else console.log("fetchBlockInformationREST blocksData is null"),r.value=[];o.value=!0}else return p||[]}catch(b){throw console.error("fetchBlockInformationREST error:",b),m&&(r.value=[],o.value=!0),b}}}return{metaInfo:a,currentPageId:n,pageBlocks:r,blockLoaded:o,fetchBlockInformation:i,fetchBlockInformationREST:u,getFormattedSectionBlocks:d=>e.computed(()=>{const m=[];return r.value&&r.value.length>0&&r.value.forEach(c=>{const y=c.blocks;y&&y.length>0&&y.forEach(f=>{if(f.id=f.blockId,d){const b=["checkoutAccount","shippingAddress","shippingMethod","customForm","termsAndPayment","quoteSummary","customCode"];console.log("section.sectionName",c.sectionName,f.componentName),f&&f.configuration&&(b.includes(f.componentName)||f.configuration.isCheckoutBlock)&&m.push(f)}else f&&f.configuration&&!d&&m.push(f)})}),m})}}),qn=async(t,r=null,n="",o=!1)=>{const a=ft();console.log("appsyncHandler composableStore",a);const i=a.graphqlEndpoint.value,l=a.apiKey.value;let s=200,u;const h=a.hostName.value;console.log("appsyncHandler currentHostname",h);const d=fi();try{const m=r;let c="";d.activeStorefrontInfo&&d.activeStorefrontInfo.accountId&&!c&&(c=d.activeStorefrontInfo.accountId),m.data&&d.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&(m.data.userType=d.activeStorefrontInfo.userType,m.data.accountId=c,m.data.domain=h);const y=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l},body:JSON.stringify({query:t,variables:m})});if(u=await(y==null?void 0:y.json()),u=u.data,n)u=JSON.parse(u[n]),s=Number(u.statusCode),u=u.content,s===401&&console.info("401",t,JSON.stringify(r));else if(t.includes("SalesforceActions")){let f=u;f=JSON.parse(u.salesforceActions),f.statusCode==="401"&&console.info("401",t,JSON.stringify(r),u)}}catch(m){console.log(m),s=400,u=m}return{statusCode:s,response:u}},di=["Needs Configuration","Suggests Configuration","Upload Configuration"],f4=["Upload","Upload Add","Upload Configuration"],h4=["No Configuration","Suggests Configuration","Upload Add","",null,void 0],p4=["CONFIGURE","UPLOAD","ADD_TO_CART"],m4=new Map([["Full","Full"],["FULL","Full"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","Default"],["ECATALOG_ACCOUNT_CUSTOM","Alternate"],["ECATALOG_OVERRIDE","Override"]]),y4=new Map([["Full","Item"],["FULL","Item"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","eCatalog"],["ECATALOG_ACCOUNT_CUSTOM","eCatalog"],["ECATALOG_OVERRIDE","eCatalog"]]),Eo=(t,r,n=!1)=>{const o=Mt();let a,i,l;return n?(i=t.statusCode,l=t.content):(a=JSON.parse(t.response.salesforceActions),i=a.statusCode,l=a.content),Number(i)===200&&l&&l.message&&typeof l.message=="string"&&l.message.startsWith("ERROR:")?(o.handleError(l.message,"useExtractContent"),!1):Number(i)!==200||t.statusCode!==200||typeof l=="string"&&l.includes("ERROR:")||typeof l=="string"&&l.includes("Error:")||l.errorCode==="APEX_ERROR"?(l.errorCode==="APEX_ERROR"?o.handleError(l.message,"useExtractContent"):r||o.handleError(l,"useExtractContent"),!1):l},Zn=new Map;function Lt(t,r){return Zn.has(t)||Zn.set(t,new Set),Zn.get(t).add(r),()=>{g4(t,r)}}function g4(t,r){const n=Zn.get(t);n&&(n.delete(r),n.size===0&&Zn.delete(t))}function Et(t,r){const n=Zn.get(t);!n||n.size===0||Array.from(n).forEach(o=>{try{o(r)}catch{}})}const mn=it.defineStore("catalog",()=>{const t=ft(),r=e.ref(!1),n=e.ref(0),o=e.ref(null),a=e.ref(null),i=e.ref([]),l=e.ref({}),s=e.ref({}),u=e.ref(null),h=e.ref(null),d=e.ref(!1),m=e.ref({search:""}),c=e.ref({qliRecords:!0,quoteCreate:!1,quoteDetails:!1}),y=e.computed(()=>t.accountId.value),f=e.computed(()=>({domain:t.hostName.value,accountId:y.value,userType:t.userId.value})),b=e.computed(()=>{const $=Array.isArray(i.value)?i.value:[],X={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},W=N=>(N==null?void 0:N.XX_ORD1__SYS_Configuration_Status2__c)||(N==null?void 0:N.xx_ord1__sys_configuration_status2__c)||"",K=N=>N in X,P=$.filter(N=>K(W(N)));return P.sort((N,T)=>{const O=W(N),F=W(T);return(X[O]||99)-(X[F]||99)}),P});function p(){const $=b.value||[];return $.length?$[0]:null}function x($="true"){j0(`qreset-${o.value}`,$)}async function g($){try{const X={objectType:"XX_ORD1__Quote_Line_Item__c",qliIds:Array.isArray($)?$:[$]},W=await Ct({data:X,config:{pathKey:"catalog.deleteQuoteLine"}});return n.value=Math.max(0,(n.value||0)-1),v(!0),console.log("[CATALOG:deleteLineItems] success",W),x(),Et("catalog:line-deleted",{quoteId:(t==null?void 0:t.quoteId.value)||null,qliIds:X.qliIds,response:W}),W}catch(X){console.log("[CATALOG:deleteLineItems] error",X),x();return}}async function C($){var O,F;if(!$.qty)return;const X=t.quoteId.value;if(!X)return;$.retry=1;const W={...$,quoteid:X},K={action:"makeCall",data:{...f.value,callType:"POST",endpoint:"/services/apexrest/XX_ORD1/ecommerce?type=updateQLI&ut="+t.userId.value,payload:JSON.stringify(W)}},P=await qn(wn,K,void 0,!0),N=(F=(O=P.response)==null?void 0:O.salesforceActions)==null?void 0:F.toLowerCase();(N.includes("record currently unavailable")||N.includes("unable_to_lock_row"))&&$.retry<3&&setTimeout(()=>{$.retry+=1,C($)},500),Eo(P)&&v(!0),x()}async function _($){var K,P,N,T,O;const X=t==null?void 0:t.quoteId.value;Array.isArray($)&&($=$[0]);const W={itemId:$.itemID,eCatalogItemId:$.eCatalogItemID,quantity:$.qty,accountId:y.value,qtyTierAmt:($==null?void 0:$.qtyTierAmt)??null};X&&(W.quoteId=X);try{const F=await Ct({data:W,config:{pathKey:"catalog.saveItemToQuoteBlink"}}),q=(F==null?void 0:F.quoteId)||((K=F==null?void 0:F.data)==null?void 0:K.quoteId)||((N=(P=F==null?void 0:F.data)==null?void 0:P.quote)==null?void 0:N.Id);q&&q!==X&&(o.value=q,t.updateConfig({quoteId:q}));const M=((T=F==null?void 0:F.data)==null?void 0:T.QliId)||(F==null?void 0:F.QliId)||null,U=$==null?void 0:$.itemID,L=$==null?void 0:$.qty;if(M&&U){const j=s.value?s.value[U]:null;s.value={...s.value||{},[U]:{...j||{},Id:M,XX_ORD1__Item__c:U,XX_ORD1__QTY__c:typeof L=="number"?L:(j==null?void 0:j.XX_ORD1__QTY__c)||0}}}return v(!0),x(),Et("catalog:item-added",{itemId:W.itemId,eCatalogItemId:W.eCatalogItemId||null,quantity:W.quantity,quoteId:(t==null?void 0:t.quoteId.value)||q||null,qliId:((O=F==null?void 0:F.data)==null?void 0:O.QliId)||(F==null?void 0:F.QliId)||null,response:F}),F}catch(F){console.log("[CATALOG:saveItemToQuoteBlinkTxn] error",F),x();return}}async function E({itemId:$,qty:X,qliId:W,eCatalogItemId:K}={}){var T,O,F,q,M;if(console.log("updateQuoteLineQtyTxn",{itemId:$,qty:X,qliId:W,eCatalogItemId:K}),!X&&X!==0)return;let P=W||((O=(T=s.value)==null?void 0:T[$])==null?void 0:O.Id);if(P||(await S(!0),P=W||((q=(F=s.value)==null?void 0:F[$])==null?void 0:q.Id)),!P){if(X>0&&$&&K)return console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id, saving item first",{itemId:$,eCatalogItemId:K}),await _({itemID:$,eCatalogItemID:K,qty:X,qtyTierAmt:null});console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id for item",{itemId:$});return}const N={uniqueField:"",objectType:"XX_ORD1__Quote_Line_Item__c",records:[{fields:[{fieldName:"Id",fieldValue:P},{fieldName:"XX_ORD1__QTY__c",fieldValue:X}]}]};try{const U=await Ct({data:N,config:{pathKey:"catalog.updateLines"}});if($){const L=((M=s.value)==null?void 0:M[$])||{};s.value={...s.value||{},[$]:{...L,Id:P,XX_ORD1__Item__c:$,XX_ORD1__QTY__c:X}}}return v(!0),x(),Et("catalog:item-qty-updated",{itemId:$,qliId:P,quantity:X,eCatalogItemId:K||null,quoteId:(t==null?void 0:t.quoteId.value)||null,response:U}),U}catch(U){console.log("[CATALOG:updateQuoteLineQtyTxn] error",U),x();return}}async function A($,X,W){var F;const K=W==="Item",P=[],N=(($==null?void 0:$.searchText)||"").toString().trim(),T=Array.isArray($==null?void 0:$.fields)?$.fields:[];Array.isArray($==null?void 0:$.filters)&&$.filters,$==null||$.filterLogic;const O={searchPL:N,origin:"genesis_ai",userId:(t==null?void 0:t.userId.value)||"",orgId:(t==null?void 0:t.organizationId.value)||"",orgType:"Production",requestId:vn(),quoteId:(t==null?void 0:t.quoteId.value)||"",accountId:(t==null?void 0:t.accountId.value)||"",numberOfRecords:($==null?void 0:$.numberOfRecords)||($==null?void 0:$.rowLimit)||10,fields:T,filters:($==null?void 0:$.whereCondition)||[]};try{const q=await Ct({data:O,config:{pathKey:"catalog.getProductItems"}});if(!q||!q.selected_products||typeof q.selected_products!="object")return console.warn("[CATALOG:getProductItems] Invalid response structure",{responseObj:q}),{items:[],count:0};const M=q.selected_products,U=Object.values(M).map(j=>{var H;return(H=j==null?void 0:j.catalogResponse)==null?void 0:H.productInfo}).filter(Boolean);U.forEach(j=>{var ne,Q,ce,ue;const H=JSON.parse(JSON.stringify(X)),Z=We(j,K?"XX_ORD1__Friendly_URL__c":"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),te=We(j,K?"XX_ORD1__SYS_Requires_Configuration__c":"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");K?H.itemId=j.Id:(H.itemId=j.XX_ORD1__Item__c,H.catalogItemId=j.Id),H.thumbnail.value=H.thumbnail.field&&!H.thumbnail.isStatic?We(j,H.thumbnail.field):"",H.title.value=H.title.field&&!H.title.isStatic?We(j,H.title.field):"",H.description.value=H.description.field&&!H.description.isStatic?We(j,H.description.field):"",(ne=H.attributes)==null||ne.forEach(pe=>{pe.value.field&&(pe.value.value=We(j,pe.value.field,pe.value.dataType)||"-"),pe.label.field&&(pe.label.value=We(j,pe.label.field,pe.label.dataType)||"-")}),H.requiresConfiguration=te,H.actions=H.actions.filter(({action:pe})=>pe==="ADD_TO_CART"&&h4.includes(te)||pe==="CONFIGURE"&&di.includes(te)||pe==="UPLOAD"&&f4.includes(te)||!p4.includes(pe)),(Q=H.actions)==null||Q.forEach(pe=>{if(pe.action==="CUSTOM"){const{url:ie,label:de}=pe;ie.isStatic||(ie.value=We(j,ie.field)),de.isStatic||(de.value=We(j,de.field))}}),((ce=H.friendlyURLFields)==null?void 0:ce.length)>0&&Z?((ue=H.friendlyURLFields)==null||ue.forEach(pe=>{H.friendlyURL=H.friendlyURL.replace(`{!${pe}}`,We(j,pe))}),H.friendlyURL="/"+H.friendlyURL+"/"+Z):H.url&&(H.friendlyURL=H.url+"/"+j.Id),H.friendlyURL&&(H.friendlyURL=H.friendlyURL.replace(/\/{2,}/g,"/")),P.push(H)});const L=Number(((F=q==null?void 0:q.data)==null?void 0:F.totalCount)||U.length)||0;return{items:P,count:L>2e3?2e3:L}}catch(q){console.log("[CATALOG:getProductItems] new API error",q);return}}async function k($){var P;console.log("[CATALOG:getEcatalogDetails] jsonData",$),$.accountID=t.accountId.value;const X={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getEcatalogDetails&ut=${t.userId.value}`,payload:JSON.stringify($)}},W=await qn(wn,X),K=Eo(W);if(K!==!1)return(P=JSON.parse(K))==null?void 0:P.recordData}async function B($,X=()=>{}){$.accountID=t.accountId.value||"";const W={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify($)}},K=await qn(wn,W,void 0,!0),P=JSON.parse(JSON.parse(K.response.salesforceActions).content);return X(P),P}async function D($,X=()=>{}){const W={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogPicklistGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify($)}},K=await qn(wn,W,void 0,!0);return X(JSON.parse(JSON.parse(K.response.salesforceActions).content)),JSON.parse(JSON.parse(K.response.salesforceActions).content)}async function w(){var P,N,T,O,F,q;console.log("[CATALOG:getObjectDetails] start",{currentQuoteId:o.value,payload:f.value});const $=t.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 X={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",X.data.endpoint),c.quoteDetails=!0,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> true");const W=await qn(wn,X,void 0,!0);console.log("[CATALOG:getObjectDetails] response received",{hasResponse:!!(W!=null&&W.response),len:String(((P=W==null?void 0:W.response)==null?void 0:P.salesforceActions)||"").length});const K=Eo(W,!0);return console.log("[CATALOG:getObjectDetails] extracted content",{hasContent:!!K}),c.quoteDetails=!1,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> false"),K?(l.value=JSON.parse(K),console.log("[CATALOG:getObjectDetails] quoteRecord set",{id:(N=l.value)==null?void 0:N.Id,accountName:(T=l.value)==null?void 0:T.XX_ORD1__Account_Name__c,checkedOut:(O=l.value)==null?void 0:O.XX_ORD1__Checked_Out__c}),t.quoteAccount=(F=l.value)==null?void 0:F.XX_ORD1__Account_Name__c,l.value.XX_ORD1__Checked_Out__c?(console.warn("[CATALOG:getObjectDetails] Quote is already checked out, resetting quoteId"),r.value=!0,console.log("[CATALOG:getObjectDetails] end (checked out) -> false"),!1):(console.log("[CATALOG:getObjectDetails] end (success)",{id:(q=l.value)==null?void 0:q.Id}),l.value)):(console.warn("[CATALOG:getObjectDetails] no content returned, resetting quoteId",{qtId:$}),console.log("[CATALOG:getObjectDetails] end (no content) -> false"),!1)}const v=St(S,500);async function S($=!1){var K;console.log("[CATALOG:getQuoteItems] start",{noLoad:$}),c.value.qliRecords=!$;const X=t.quoteId.value;if(console.log("[CATALOG:getQuoteItems] qtId",X),!X){console.log("[CATALOG:getQuoteItems] No quote found!"),c.value.qliRecords=!1,console.warn("[CATALOG:getQuoteItems] No quote found, aborting");return}const W={objectId:X};try{const P=await Ct({data:JSON.stringify(W),config:{pathKey:"catalog.getLineItems"}}),N=((K=P==null?void 0:P.data)==null?void 0:K.products)||(P==null?void 0:P.products)||[],T=[],O={};N.forEach(F=>{const q=F==null?void 0:F.productLineItem;q&&(T.push(q),q.XX_ORD1__Item__c&&(O[q.XX_ORD1__Item__c]=q)),(Array.isArray(F==null?void 0:F.options)?F.options:[]).forEach(U=>{T.push(U),U.XX_ORD1__Item__c&&(O[U.XX_ORD1__Item__c]=U)})}),i.value=T,s.value=O,n.value=T.length,c.value.qliRecords=!1,console.log("[CATALOG:getQuoteItems] end (success)",{count:T.length}),Et("catalog:items-fetched",{quoteId:X,items:i.value,count:n.value})}catch(P){console.warn("[CATALOG:getQuoteItems] error",P),c.value.qliRecords=!1}}async function I($){console.log("[CATALOG:getSavedFilter] ecfr",$);const X={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getSavedFilter&ut=${t.userId.value}&ecfr=${$}`}},W=await qn(wn,X,void 0,!0),K=Eo(W);return K?(console.log("[CATALOG:getSavedFilter] Saved Filters",K),JSON.parse(K)):!1}async function R(){var K;console.log("[CATALOG:calculateAvaTax]"),h.value=null;const $=t.quoteId.value;if(!$)return;(K=l.value)!=null&&K.Id||await w();const X=l.value;if(X.XX_ORD1__Shipping_Address__c&&X.XX_ORD1__Shipping_City__c&&X.XX_ORD1__Shipping_Country__c&&X.XX_ORD1__Shipping_State__c&&X.XX_ORD1__Shipping_Zip__c){const P={recordId:$,isCommit:!1},N={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=calculateAvaTax&ut=${t.userId.value}`,payload:JSON.stringify(P)}};d.value=!0;const T=await qn(wn,N,void 0,!0),O=Eo(T);if(O)console.log("[CATALOG:calculateAvaTax] content",O);else{const F=JSON.parse(T.response.salesforceActions).content;h.value=F}d.value=!1}else console.log("[CATALOG:calculateAvaTax] Shipping address not found so tax can not be calculated")}function z($,X,W=!0){const K=X.qtyTiers;if(!K)return null;const P=K.find(N=>N.ev===null?$>=N.sv:$>=N.sv&&$<=N.ev);return P?W?P.formattedOfferPrice:P.originalPrice:null}return{quoteCheckedOut:r,avaTaxError:h,avaTaxLoading:d,cartCount:n,cartUpdated:x,quoteId:o,loading:c,filter:m,quoteRecord:l,secondQuoteId:a,qliRecords:i,savedItems:s,savedFilter:u,getObjectDetails:w,getSavedFilter:I,saveItemToQuoteBlinkTxn:_,updateQuoteLineQtyTxn:E,deleteLineItems:g,getPicklistFilterData:D,getQuoteItems:S,updateCart:C,getFilterData:B,getProductItems:A,calculateAvaTax:R,getEcatalogDetails:k,getVolumePrice:z,configurableItemsSorted:b,getTopConfigurableItem:p,getQuoteItems:S}}),fi=it.defineStore("composableCatalog",()=>{const t=Co();mn();const r=Mt(),n=ft(),o=e.ref(!0),a=e.ref({accountId:"",contactId:"",userType:"",domain:"",locale:"en-US"}),i=e.ref({}),l=e.ref(""),s=e.ref(""),u=e.ref(""),h=e.ref(""),d=e.ref(""),m=e.ref(""),c=e.ref(null),y=e.ref(!1),f=e.computed(()=>h.value+"::"+d.value);async function b(){c.value=null,y.value=!0;try{const B={domain:n.hostName.value,templateBlocksFilter:{templateId:{eq:"wrapperDefault"}}},D=Date.now().toString(),w=await Ue.post(`${n.graphqlEndpoint.value}?t=${D}`,{query:u4,variables:B},{headers:{"Content-Type":"application/json","x-api-key":n.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",w);const v=w&&w.data?w.data:null;console.log("[COMPOSABLECATALOG:fetchDomainDetails] payload",v);const S=v&&v.data&&v.data.dataByDomain&&Array.isArray(v.data.dataByDomain.items)?v.data.dataByDomain.items:[],I=S.length?S[0]:null;return console.log("[COMPOSABLECATALOG:fetchDomainDetails] item",I),console.log("[COMPOSABLECATALOG:fetchDomainDetails] storefrontDetails",i.value),i.value=I,a.value={accountId:I.guestAccountId,contactId:"",userType:"AWSGuest",domain:I.domain,locale:"en-US"},h.value=I.organization.salesforceOrgId,d.value=I.storefrontId,I}catch(B){throw console.info("[COMPOSABLECATALOG:fetchDomainDetails] Error fetching domain",B),c.value=B&&B.message?B.message:"Unknown error",B}finally{y.value=!1}}function p(B){s.value=(B==null?void 0:B.templateId)??"",u.value=(B==null?void 0:B.quoteId)??"",m.value=(B==null?void 0:B.userId)??""}function x(B){u.value=B}function g(B){i.value=B}async function C(){try{await t.fetchBlockInformation({templateId:s.value,storefrontId:d.value},!0)}catch(B){r.handleError(B,"getBlockInformation")}}const _=async()=>{var B,D;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!d.value)try{const w=await br(fc,{storefrontId:d.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",w),((D=(B=w.content)==null?void 0:B.items)==null?void 0:D[0])??null}catch(w){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",w)}},E=()=>{if(typeof document>"u")return;const B=h.value,D=d.value;if(!B||!D)return;const w=`${Qn}/${B}/${D}/css/theme_${D}.css`;let v=!1;if(typeof window<"u"&&window.VueExpediteComponents&&typeof window.VueExpediteComponents.applyThemeToShadows=="function")try{window.VueExpediteComponents.applyThemeToShadows(w),v=!0}catch($){console.warn("[COMPOSABLECATALOG:setThemeData] shadow injection failed; will inject in head",$)}let S="";try{S=new URL(n.graphqlEndpoint.value).origin}catch{}const I=typeof window<"u"?window.location.href:"",R=($,X={})=>{const W=document.head||document.getElementsByTagName("head")[0];if(!W)return;let K=document.getElementById($);K||(K=document.createElement("link"),K.id=$,W.appendChild(K)),Object.entries(X).forEach(([P,N])=>{N!=null&&K.setAttribute(P,String(N))})};(($,X,W=!0)=>{const K=document.head||document.getElementsByTagName("head")[0];if(!K||document.getElementById($))return;const P=document.createElement("script");P.id=$,P.src=X,W&&(P.async=!0),K.appendChild(P)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),R("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),S&&R("ec-preconnect-appsync",{rel:"preconnect",href:S}),v||R("ec-theme-stylesheet",{rel:"stylesheet",href:w}),R("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"}),I&&R("ec-canonical",{rel:"canonical",href:I}),R("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Qn}/expedite/Expedite_Favicon.ico`})};function A(){return!0}function k(){s.value="",u.value="",h.value="",d.value="",m.value=""}return{templateId:s,isLoading:o,activeStorefrontInfo:a,quoteAccount:l,storefrontDetails:i,salesforceOrgId:h,storefrontId:d,userId:m,orgWithStorefrontId:f,useVisiblity:A,fetchDomainDetails:b,setData:p,setQuoteId:x,setStorefrontDetails:g,getBlockInformation:C,getTheme:_,setThemeData:E,reset:k}}),b4=t=>{const r=t.match(/query\s+(\w+)/);return r?r[1]:null},x4=t=>t.replace(/[-_\s]+/g," ").trim().replace(/^(.)/,(r,n)=>n.toLowerCase()).replace(/\s(\w)/g,(r,n)=>n.toUpperCase()).replace(/\s/g,""),pc=t=>{try{JSON.parse(t)}catch{return!1}return!0},hi=new Map,br=async(t,r=null)=>{var s,u,h;const n=fi(),o=ft();let a=200,i,l;try{const d=r,m=o.accountId.value||"";d.data&&n.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("GetLoginInfo")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data.userType=((s=n.activeStorefrontInfo)==null?void 0:s.userType)||"",d.data.accountId=m||((u=n.activeStorefrontInfo)==null?void 0:u.accountId)||"",d.data.domain=o.hostName.value),!t.includes("GetLoginInfo")&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data={...d.data,domain:o.hostName.value});const c=c4([t,d,m]);if(hi.has(c))i=hi.get(c);else try{const b=await Ue.post(o.graphqlEndpoint.value,{query:t,variables:d},{headers:{"Content-Type":"application/json","x-api-key":o.apiKey.value}});if(!b.data)return{statusCode:500,content:"Error fetching data from AppSync."};i=b.data.data,hi.set(c,i)}catch(b){const p=((h=b==null?void 0:b.response)==null?void 0:h.status)||500;return p===401&&console.info("401",t,r),{statusCode:p,content:"Error fetching data from AppSync."}}const y=b4(t);if(!y)return{statusCode:404,content:"Query name not found, improper request."};const f=x4(y);i=i[f],pc(i)&&(i=JSON.parse(i)),i&&i.statusCode&&i.statusCode===401&&console.info("401",t,r),l=i!=null&&i.content?i.content:i,pc(l)&&(l=JSON.parse(l))}catch(d){a=400,l=d}return{statusCode:a,content:l}},xr=e.ref(""),mc=e.ref(""),pi=e.ref(""),yc=e.ref(""),mi=e.ref(""),ko=e.ref(""),vo=e.ref(""),gc=e.ref(""),bc=e.ref(""),xc=e.ref(""),_c=e.ref(""),yi=e.ref(""),Cc=e.ref(""),_4=e.ref(!1),C4=e.ref(null),E4=e.ref(null),Ec=e.ref(""),kc=e.ref(""),vc=e.ref(""),Ac=e.ref(""),wc=e.ref("");function ft(){function t(s){s.templateId!==void 0&&(xr.value=s.templateId),s.hostName!==void 0&&(mc.value=s.hostName),s.graphqlEndpoint!==void 0&&(pi.value=s.graphqlEndpoint),s.apiKey!==void 0&&(yc.value=s.apiKey),s.accountId!==void 0&&(mi.value=s.accountId),s.organizationId!==void 0&&(ko.value=s.organizationId),s.storefrontId!==void 0&&(vo.value=s.storefrontId),s.cid!==void 0&&(gc.value=s.cid),s.userId!==void 0&&(bc.value=s.userId),s.composablesApiUrl!==void 0&&(xc.value=s.composablesApiUrl),s.composablesApiKey!==void 0&&(_c.value=s.composablesApiKey),s.accessToken!==void 0&&(yi.value=s.accessToken),s.composablesOrgType!==void 0&&(Cc.value=s.composablesOrgType),s.isPreview!==void 0&&(_4.value=s.isPreview),s.sections!==void 0&&(C4.value=s.sections),s.theme!==void 0&&(E4.value=s.theme),s.quoteId!==void 0&&(Ec.value=s.quoteId),s.websocketUrl!==void 0&&(kc.value=s.websocketUrl),s.packageVersion!==void 0&&(vc.value=s.packageVersion),s.eCatalogId!==void 0&&(Ac.value=s.eCatalogId),s.accountId!==void 0&&(mi.value=s.accountId),s.siteUrl!==void 0&&(wc.value=s.siteUrl)}const r=async()=>{var s,u;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!vo.value)try{const h=await br(fc,{storefrontId:vo.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",h),((u=(s=h.content)==null?void 0:s.items)==null?void 0:u[0])??null}catch(h){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",h)}},n=async()=>{var s,u,h;try{const d=await Ct({action:"retrieveMeta",data:{salesforceOrgId:ko.value,storefrontId:xr.value,templateId:"wrapper",key:"theme"},config:{pathKey:"retrieveMeta"}}),m=((u=(s=d==null?void 0:d.data)==null?void 0:s[0])==null?void 0:u.value)??((h=d==null?void 0:d.data)==null?void 0:h.value);return console.log("[COMPOSABLECATALOG:fetchThemeREST] themeData",m),m??null}catch(d){throw console.log("[COMPOSABLECATALOG:fetchThemeREST] Error getting theme data",d),d}};return{hostName:mc,graphqlEndpoint:pi,apiKey:yc,accountId:mi,organizationId:ko,storefrontId:vo,cid:gc,userId:bc,composablesApiUrl:xc,composablesApiKey:_c,accessToken:yi,composablesOrgType:Cc,quoteId:Ec,websocketUrl:kc,packageVersion:vc,eCatalogId:Ac,siteUrl:wc,updateConfig:t,getTheme:r,fetchThemeREST:n,setThemeData:()=>{if(typeof document>"u")return;const s=ko.value,u=vo.value;if(!s||!u)return;const h=`${Qn}/${s}/${u}/css/theme_${u}.css`;let d="";try{d=new URL(pi.value).origin}catch{}const m=typeof window<"u"?window.location.href:"",c=(f,b={})=>{const p=document.head||document.getElementsByTagName("head")[0];if(!p)return;let x=document.getElementById(f);x||(x=document.createElement("link"),x.id=f,p.appendChild(x)),Object.entries(b).forEach(([g,C])=>{C!=null&&x.setAttribute(g,String(C))})};((f,b,p=!0)=>{const x=document.head||document.getElementsByTagName("head")[0];if(!x||document.getElementById(f))return;const g=document.createElement("script");g.id=f,g.src=b,p&&(g.async=!0),x.appendChild(g)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),c("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),d&&c("ec-preconnect-appsync",{rel:"preconnect",href:d}),c("ec-theme-stylesheet",{rel:"stylesheet",href:h}),c("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"}),m&&c("ec-canonical",{rel:"canonical",href:m}),c("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Qn}/expedite/Expedite_Favicon.ico`})},processSections:async(s,u)=>{const h=Co();if(s&&u)try{const d=typeof u=="string"?JSON.parse(u):u;h.pageBlocks=d}catch(d){console.error("[ExpediteCart] Error parsing sections:",d)}else s||await h.fetchBlockInformationREST({templateId:xr.value||xr.value})},processTheme:async(s,u)=>{if(console.log("[COMPOSABLECATALOG:processTheme] isPreview",s),console.log("[COMPOSABLECATALOG:processTheme] theme",u),s&&u)try{return JSON.parse(u)}catch(h){return console.error("[ExpediteCart] Error parsing theme:",h),null}else if(!s)try{return await n()}catch(h){return console.error("[ExpediteCart] Error fetching theme:",h),null}return null},fetchAccessToken:async(s,u)=>{try{const h=(u==null?void 0:u.organizationId)||ko.value||"",d=(s==null?void 0:s.version)||"",m=s==null?void 0:s.awsExternalMSBaseURL;if(!m)throw new Error("awsExternalMSBaseURL is required in awsConnectionInfo");const c=await Ct({data:{Org_Id:h,Version:d},config:{baseUrl:m,pathKey:"fetchAccessToken"}});return console.log("fetchAccessToken - Response:",c),c!=null&&c.Access_Token&&(yi.value=c.Access_Token),c}catch(h){throw console.error("getAccessToken catch ::",h),console.error("Error details:",{message:h.message,stack:h.stack,name:h.name}),h}}}}const k4=["href"],v4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons","data-name":"ec-material-icons"},null,-1),A4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Outlined","data-name":"ec-material-icons-outlined"},null,-1),w4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Round","data-name":"ec-material-icons-round"},null,-1),N4=e.createElementVNode("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),Nc={__name:"AtomThemeLoader",props:{organizationId:{type:String,required:!0},templateId:{type:String,required:!0},isPreview:{type:Boolean,required:!0},theme:{type:Object,required:!0}},setup(t){const r=t,n=ft(),o=e.ref(""),a=e.ref(""),i=async()=>{if(!(!r.organizationId||!r.templateId))try{const l=await n.processTheme(r.isPreview,r.theme);l&&(o.value=l),n.setThemeData();const s=Date.now(),u=`${Qn}/${r.organizationId}/${r.templateId}/css/theme_${r.templateId}.css?t=${s}`;console.log("[ATOMTHEMELOADER:loadTheme] styleURL",u),a.value=u}catch(l){console.error("[ATOMTHEMELOADER:loadTheme] Error loading theme",l)}};return e.onBeforeMount(()=>{i()}),e.watch(()=>[r.organizationId,r.templateId,r.isPreview,r.theme],()=>{i()},{deep:!0}),(l,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:0,"data-name":"template-theme"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]),_:1})):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("link",{key:1,rel:"stylesheet",href:a.value,"data-name":"ec-theme-stylesheet-link"},null,8,k4)):e.createCommentVNode("",!0),v4,A4,w4,N4],64))}},S4={KNOWLEDGE_DETAIL:"knowledgeDetail"},Sc={"Catalog Price":"XX_ORD1__Negotiated_Price__c","List Price":"XX_ORD1__List_Price2__c"},B4={name:"SkeletonLoader"},I4={class:"skeleton-loader"};function T4(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",I4)}const Qt=ve(B4,[["render",T4],["__scopeId","data-v-826b27ef"]]),Re=ve({__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(t){const r=t,n={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"},o=e.ref(!1),a=e.computed(()=>{if(r.text===null||r.text===void 0)return"";const u=String(r.text);return(u==null?void 0:u.replace(/\r\n|\n/g,"<br>"))||""}),i=e.computed(()=>{var h,d;const u=r.tag||((h=r.style)==null?void 0:h.tag)||((d=r.secStyle)==null?void 0:d.tag)||"p";return u==="large"||u==="strong"?"div":u}),l=e.computed(()=>{var h;const u=r.tag||((h=r.style)==null?void 0:h.tag)||"p";return n[u]||"ecb-text-regular"}),s=e.computed(()=>{var h,d;const u={};if(r.style&&((h=r.style)!=null&&h.overrite)){const{bold:m,color:c,italic:y,underline:f,strikethrough:b,strikeThrough:p,size:x,family:g,lineHeight:C}=r.style;m&&(u.fontWeight="700"),c&&(u.color=c),y&&(u.fontStyle="italic"),g&&(u.fontFamily=g),C&&(u.lineHeight=C),f?u.textDecoration="underline":(b||p)&&(u.textDecoration="line-through"),x&&(u.fontSize=x)}if(r.secStyle&&((d=r.secStyle)!=null&&d.overrite)){const{bold:m,color:c,italic:y,underline:f,strikethrough:b,strikeThrough:p,size:x,family:g,lineHeight:C}=r.secStyle;m&&(u.fontWeight="700"),c&&(u.color=c),y&&(u.fontStyle="italic"),g&&(u.fontFamily=g),C&&(u.lineHeight=C),f?u.textDecoration="underline":(b||p)&&(u.textDecoration="line-through"),x&&(u.fontSize=x)}for(const m of r.inherit)u[m]="inherit";return u});return(u,h)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(t.cssStyle),class:"custom-tag-skeletion"},[e.createVNode(Qt)],4)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),e.mergeProps({key:1},u.$attrs,{type:t.method,disabled:t.disabled,style:s.value,class:l.value,onMouseover:h[0]||(h[0]=d=>o.value=!0),onMouseout:h[1]||(h[1]=d=>o.value=!1),innerHTML:a.value}),null,16,["type","disabled","style","class","innerHTML"]))}},[["__scopeId","data-v-14a516b4"]]),O4={key:1,class:"field-label"},D4={class:"ect-flex ect-flex-col ect-justify-start"},V4={key:0,class:"ect-pr-5"},F4={key:1,class:"field-value ect-pr-5"},M4={key:1,class:"field-value"},Bc=ve({__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(t){const r=mn(),n=t,o=e.computed(()=>!1),a=e.computed(()=>{var c;return n.offer.offerValue.offerId&&n.offer.offerValue.formattedOfferPrice||n.offer.offerValue.rpId&&((c=n.offer.offerValue.qtyTiers)==null?void 0:c.length)>0?!!n.appliedOnOfferMatchingField:!1}),i=e.computed(()=>n.offer.offerDetails.styles.offerValue.textStyles.tag),l=e.computed(()=>n.offer.offerDetails.styles.offerDescription.textStyles),s=e.computed(()=>{var m,c;return(m=n.offer.offerValue)!=null&&m.qtyTiers?r.getVolumePrice(n.itemCount>0?n.itemCount:1,n.offer.offerValue):(c=n.offer.offerValue)==null?void 0:c.formattedOfferPrice}),u=e.computed(()=>({"ect-flex ect-line-through":o.value&&n.offer.offerValue&&a.value})),h=e.computed(()=>n.value&&(n.value.isStatic||!n.loading)),d=e.computed(()=>(o.value&&!n.isProductSummary||n.isProductSummary&&n.index===0)&&n.showOfferDescription&&n.appliedOnOfferMatchingField);return(m,c)=>{var y,f;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.field,"field ect-gap-1 ect-flex ect-flex-col"])},[t.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(y=t.label.style)==null?void 0:y.tag,text:t.label.value,style:e.normalizeStyle(t.label.style),class:e.normalizeClass(`${t.field}_label`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",O4,[e.createVNode(Qt)])),e.createElementVNode("div",D4,[o.value&&n.offer.offerValue&&a.value?(e.openBlock(),e.createElementBlock("div",V4,[e.createVNode(Re,{tag:i.value,text:s.value,style:e.normalizeStyle(t.offer.offerDetails.styles.offerValue.textStyles),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])])):o.value&&!n.offer.offerValue?(e.openBlock(),e.createElementBlock("div",F4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(u.value)},[h.value?(e.openBlock(),e.createBlock(Re,{key:0,tag:(f=t.value.style)==null?void 0:f.tag,text:t.value.value,style:e.normalizeStyle(t.value.style),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",M4,[e.createVNode(Qt)]))],2)]),d.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"field-description ect-left-0 ect-w-max ect-pt-2",style:e.normalizeStyle({maxWidth:t.parentWidth?t.parentWidth+"px":void 0})},[e.createVNode(Re,{tag:l.value.tag,text:n.offer.offerValue.offerDescShort,style:e.normalizeStyle(l.value),class:e.normalizeClass(t.field+"_value")},null,8,["tag","text","style","class"])],4)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b0e72386"]]),R4={key:1,class:"filter"},L4={class:"filter-title"},P4={key:0,class:"filter-desc"},q4={key:1,class:"filter-desc"},$4={key:2,class:"filter-desc"},Ic=ve({__name:"AtomProductText",props:{title:{type:Object,default:()=>({})},description:{type:Object,default:null},loading:{type:Boolean,default:!1},url:{type:String,default:null}},setup(t){const r=Ko(),n=t;function o(){n.url&&!n.loading&&r.push(n.url)}return(a,i)=>t.loading?(e.openBlock(),e.createElementBlock("div",R4,[e.createElementVNode("div",L4,[e.createVNode(Qt)]),t.description?(e.openBlock(),e.createElementBlock("div",P4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",q4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",$4,[e.createVNode(Qt)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.title?(e.openBlock(),e.createBlock(Re,{key:0,class:e.normalizeClass({"ect-cursor-pointer":t.url}),text:t.title.value,style:e.normalizeStyle(t.title.style),onClick:o},null,8,["class","text","style"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(Re,{key:1,text:t.description.value,style:e.normalizeStyle(t.description.style)},null,8,["text","style"])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-5b4d627e"]]),U4={name:"Spinner"},z4={class:"spinner"};function j4(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",z4)}const Ao=ve(U4,[["render",j4],["__scopeId","data-v-83f8c910"]]),H4={name:"AtomSkeletonWidget",components:{AtomSkeletonLoader:Qt,AtomSpinner:Ao},props:{rows:{type:Number,default:4},type:{type:String,default:"full"},className:{type:String,default:""}},data(){return{SKELETON_TYPE:S4}}},gi=t=>(e.pushScopeId("data-v-956cc081"),t=t(),e.popScopeId(),t),G4={key:0,class:"page"},K4=gi(()=>e.createElementVNode("div",{class:"page-header"},null,-1)),X4={class:"page-body"},W4={class:"page-body_board"},Q4={key:1,class:"field"},Z4={key:2,class:"filter"},J4={class:"filter-option_inner"},Y4={key:3,class:"full"},e9={key:4,class:"shuttle"},t9={class:"shuttle-full"},n9={class:"shuttle-full"},o9={class:"shuttle-half"},r9={class:"shuttle-half"},a9={class:"shuttle-button"},i9={key:5,class:"shuttle2"},l9={class:"shuttle2-full"},s9=gi(()=>e.createElementVNode("span",null,"Processing payment",-1)),c9={key:6,class:"shuttle2"},u9={class:"shuttle2-full"},d9=gi(()=>e.createElementVNode("span",null,"Processing order",-1)),f9={key:10,class:"skeleton-shipping"},h9={class:"skeleton-shipping-full"},p9={class:"skeleton-shipping-half"},m9={key:11,class:"skeleton-terms"},y9={class:"skeleton-terms-half"},g9={class:"skeleton-terms-full"},b9={class:"skeleton-terms-full"},x9={key:12,class:""},_9={class:"skeleton-terms-half"},C9={key:13,class:""},E9={class:"skeleton-terms-half"},k9={key:14,class:"product"},v9={class:"product-image"},A9={class:"product-texts"},w9={class:"product-description"},N9={class:"product-action"},S9={class:"product-button"},B9={key:15,class:""};function I9(t,r,n,o,a,i){const l=e.resolveComponent("AtomSkeletonLoader"),s=e.resolveComponent("AtomSpinner");return n.type==="page"?(e.openBlock(),e.createElementBlock("div",G4,[K4,e.createElementVNode("div",X4,[e.createElementVNode("div",W4,[e.createVNode(l)])])])):n.type==="fieldattribute"?(e.openBlock(),e.createElementBlock("div",Q4,[e.createVNode(l)])):n.type==="filteroptions"?(e.openBlock(),e.createElementBlock("div",Z4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,u=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"filter-option"},[e.createElementVNode("div",J4,[e.createVNode(l)])]))),128))])):n.type==="full"?(e.openBlock(),e.createElementBlock("div",Y4,[e.createVNode(l)])):n.type==="shuttle"?(e.openBlock(),e.createElementBlock("div",e9,[e.createElementVNode("div",t9,[e.createVNode(l)]),e.createElementVNode("div",n9,[e.createVNode(l)]),e.createElementVNode("div",o9,[e.createVNode(l)]),e.createElementVNode("div",r9,[e.createVNode(l)]),e.createElementVNode("div",a9,[e.createVNode(l)])])):n.type==="shuttle-done"?(e.openBlock(),e.createElementBlock("div",i9,[e.createElementVNode("div",l9,[e.createVNode(s,{class:"shuttle2-spinner"}),e.createTextVNode(),s9])])):n.type==="order-processing"?(e.openBlock(),e.createElementBlock("div",c9,[e.createElementVNode("div",u9,[e.createVNode(s,{class:"shuttle2-spinner"}),e.createTextVNode(),d9])])):n.type==="enhanceFilter"?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="offers"?(e.openBlock(),e.createElementBlock("div",{key:8,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="detailPage"?(e.openBlock(),e.createElementBlock("div",{key:9,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="shippingAddress"?(e.openBlock(),e.createElementBlock("div",f9,[e.createElementVNode("div",h9,[e.createVNode(l)]),e.createElementVNode("div",p9,[e.createVNode(l)])])):n.type==="termsAndPayment"?(e.openBlock(),e.createElementBlock("div",m9,[e.createElementVNode("div",y9,[e.createVNode(l)]),e.createElementVNode("div",g9,[e.createVNode(l)]),e.createElementVNode("div",b9,[e.createVNode(l)])])):n.type==="accordian-title"?(e.openBlock(),e.createElementBlock("div",x9,[e.createElementVNode("div",_9,[e.createVNode(l)])])):n.type==="imageDiv"?(e.openBlock(),e.createElementBlock("div",C9,[e.createElementVNode("div",E9,[e.createVNode(l)])])):n.type==="product-detail"?(e.openBlock(),e.createElementBlock("div",k9,[e.createElementVNode("div",v9,[e.createVNode(l)]),e.createElementVNode("div",A9,[e.createVNode(l)]),e.createElementVNode("div",w9,[e.createVNode(l)]),e.createElementVNode("div",N9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,u=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"product-action_item"},[e.createVNode(l)]))),128))]),e.createElementVNode("div",S9,[e.createVNode(l)])])):n.type===a.SKELETON_TYPE.KNOWLEDGE_DETAIL?(e.openBlock(),e.createElementBlock("div",B9,[e.createVNode(l,{class:e.normalizeClass(n.className)},null,8,["class"])])):e.createCommentVNode("",!0)}const yn=ve(H4,[["render",I9],["__scopeId","data-v-956cc081"]]),T9=["src"],bi={__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(t){const r=ft(),n=t,o=e.computed(()=>n.src.includes("/resource/")&&!n.src.includes("://")&&n.resourcesDomain?n.resourcesDomain+n.src:n.src.includes("/servlet/servlet.ImageServer")&&!n.src.includes("://")&&n.resourcesDomain?n.resourcesDomain+"/"+n.src:n.src.includes("/servlet/servlet.ImageServer")&&!n.src.includes("://")&&r.siteUrl?r.siteUrl.value+"/"+n.src:n.src);return(a,i)=>t.loading?(e.openBlock(),e.createBlock(yn,{key:0,type:"full"})):t.src?(e.openBlock(),e.createElementBlock("img",{key:1,src:o.value,placeholder:[30,20],class:"rounded",sizes:"props.sizes"},null,8,T9)):e.createCommentVNode("",!0)}},O9={class:"counter"},D9=["disabled"],V9={key:0,class:"counter-spinner"},F9=["max","disabled","value"],M9=["disabled"],_r=ve({__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(t,{emit:r}){const n=t,o=r,a=e.computed(()=>n.disabled||n.loading),i=St(function(h){const d=String(h??"");if(d==="")return;const m=Number(d);Number.isNaN(m)||o("update:modelValue",m)}),l=h=>{(h.key==="."||h.key==="e"||h.key==="E")&&!h.ctrlKey&&!h.metaKey&&n.decimal&&h.preventDefault()};function s(){n.modelValue<n.max&&o("update:modelValue",n.modelValue+1)}function u(){n.modelValue>n.min&&o("update:modelValue",n.modelValue-1)}return(h,d)=>(e.openBlock(),e.createElementBlock("div",O9,[e.createElementVNode("button",{disabled:t.modelValue<=t.min||a.value,onClick:u},[e.createVNode(Be,{icon:t.modelValue>1?"minus":"close",size:10},null,8,["icon"])],8,D9),t.loading?(e.openBlock(),e.createElementBlock("div",V9,[e.createVNode(Ao,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",min:"0",max:t.max,disabled:a.value,value:t.modelValue,step:"1",onInput:d[0]||(d[0]=m=>e.unref(i)(m.target.value)),onKeydown:l},null,40,F9)),e.createElementVNode("button",{disabled:t.modelValue>=t.max||a.value,onClick:s},[e.createVNode(Be,{class:"ect-transform ect-rotate-45",icon:"add",size:12})],8,M9)]))}},[["__scopeId","data-v-886bff8a"]]),Tc=e.ref(!1),Oc=e.ref(!1),Dc=e.ref(!1),Vc=e.ref(!1),xi=()=>{if(typeof window<"u"){const t=()=>{const r=window.innerWidth;Oc.value=r<768,Dc.value=r>=768&&r<1024,Vc.value=r>=1024};e.onMounted(()=>{Tc.value||(Tc.value=!0,window.addEventListener("resize",t),t())})}return{isMobile:Oc,isTablet:Dc,isDesktop:Vc}},R9=["disabled"],L9=["disabled"],P9={class:"ect-w-max"},q9={class:"button-header-icon"},$9=["onClick"],U9={key:0,class:"button-options_item-icon"},z9=["disabled"],j9={class:"ect-w-max"},H9={class:"button-header-icon"},G9=["onClick"],K9={key:0,class:"button-options_item-icon"},Fc=ve({__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(t,{emit:r}){const n=t,o=xi(),a=e.ref(!1),i=e.ref(null),l=e.ref({}),s=e.ref(!1),u=r;function h(b){b.stopPropagation(),a.value=!a.value}function d(b){b.stopPropagation(),a.value=!a.value,s.value=e.ref(a.value)}function m(b){u("selected",b),a.value=!1}function c(){!o.isMobile.value&&!n.disabled&&(a.value=!0)}function y(){!o.isMobile.value&&!s.value&&(a.value=!1)}function f(b){a.value&&(a.value=!1,s.value=!1)}return e.onMounted(()=>{document.addEventListener("click",f)}),e.onUnmounted(()=>{document.removeEventListener("click",f)}),(b,p)=>{var x;return t.options.length===1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:p[0]||(p[0]=g=>b.$emit("selected",t.options[0]))},[e.createElementVNode("span",null,e.toDisplayString(((x=t.options[0].label)==null?void 0:x.value)||t.options[0].name),1)],8,R9)):t.options.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(o).isMobile.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:e.withModifiers(h,["stop"])},[e.createElementVNode("span",P9,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",q9,[e.createVNode(Be,{icon:"arrow_drop_down",class:"ect-relative ect-top-0.5 ect-ml-2",color:"#ffffff",size:"14"})])],8,L9),!t.disabled&&t.options.length&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"button-options",onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"button-options_grow",onClick:p[1]||(p[1]=g=>a.value=!1)}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"button-options_item",onClick:C=>m(g)},[g.selected&&t.select?(e.openBlock(),e.createElementBlock("div",U9,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(g.name),1)],8,$9))),128))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"button-container",onMouseenter:c,onMouseleave:y},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",ref_key:"btnmenu",ref:i,disabled:t.disabled,onClick:e.withModifiers(d,["stop"])},[e.createElementVNode("span",j9,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",H9,[e.createVNode(Be,{class:"ect-relative ect-top-0.5 ect-ml-2",icon:"arrow_drop_down",color:"#ffffff",size:"14"})])],8,z9),!t.disabled&&t.options.length&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(l.value),class:"button-options",onClick:p[3]||(p[3]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>{var C;return e.openBlock(),e.createElementBlock("div",{key:g,class:"button-options_item",onClick:_=>b.$emit("selected",g)},[g.selected&&t.select?(e.openBlock(),e.createElementBlock("div",K9,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(((C=g.label)==null?void 0:C.value)||g.name),1)],8,G9)}),128))],4)):e.createCommentVNode("",!0)],32))],64)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-cfcf21a3"]]),X9={class:"ect-flex ect-flex-col ect-w-full"},W9={key:0,class:"ect-h-[20px] ect-w-[150px]"},Q9={key:1,class:"ect-flex ect-flex-col ect-gap-1"},Z9=ve({__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(t){var x,g;const r=fi(),n=mn(),o=t,a=e.ref(((g=(x=n.savedItems)==null?void 0:x[o.itemId])==null?void 0:g.XX_ORD1__QTY__c)||0),i=e.ref(!1),l=e.ref(null),s=e.ref(!1),u=e.ref(!1),h=e.computed(()=>o.actions&&o.actions.length>0),d=e.computed(()=>o.actions.some(C=>C.action==="ADD_TO_CART")),m=e.computed(()=>{var C,_,E;return(C=o.offer)!=null&&C.appliedOnField?Sc[(_=o.offer)==null?void 0:_.appliedOnField]===((E=o.offerSetting.value)==null?void 0:E.field):!0});e.watch(()=>n.savedItems,C=>{var _,E;C[o.itemId]&&!u.value&&((_=C[o.itemId])==null?void 0:_.XX_ORD1__QTY__c)!==a.value&&(a.value=((E=C[o.itemId])==null?void 0:E.XX_ORD1__QTY__c)||0,u.value=!0)},{deep:!0});function c(C){var _;u.value=!0,C===0&&((_=n.savedItems)!=null&&_[o.itemId])?f():p()}const y=C=>{var _;C.action==="ADD_TO_CART"?(u.value=!0,a.value=1,b()):C.action==="CONFIGURE"?Et("catalog:item-configure-clicked",{itemId:o.itemId,catalogItemId:o.catalogItemId,title:o.title,description:o.description,attributes:o.attributes,thumbnail:o.thumbnail,url:o.url,mode:o.mode,isPreview:o.isPreview}):C.action==="CUSTOM"?window.open(((_=C.url)==null?void 0:_.value)||C.value,C.newTab?"_blank":"_self"):C.action==="ORDER_PARTS"||C.action},f=async function(){i.value=!0,l.value=null;const C=[n.savedItems[o.itemId].Id];await n.deleteLineItems(C),i.value=!1},b=async function(){i.value=!0,l.value=null;const C={itemID:o.itemId,eCatalogItemID:o.catalogItemId,qty:a.value,qtyTierAmt:null};await n.saveItemToQuoteBlinkTxn(C),i.value=!1},p=St(async function(){console.log("updateToCart 1",a.value),s.value=!0,await n.updateQuoteLineQtyTxn({itemId:o.itemId,qty:a.value,eCatalogItemId:o.catalogItemId}),s.value=!1});return(C,_)=>{var E,A;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("item ecb-theme-card "+t.mode)},[e.createElementVNode("div",{class:e.normalizeClass(`item-image ${t.mode}-image`)},[e.createVNode(bi,{src:t.thumbnail.value,loading:t.loading,"resources-domain":e.unref(r).storefrontDetails.resourcesDomain},null,8,["src","loading","resources-domain"])],2),e.createElementVNode("div",{class:e.normalizeClass(`item-text ${t.mode}-text`)},[e.createVNode(Ic,{title:t.title,loading:t.loading,description:t.description},null,8,["title","loading","description"])],2),e.createElementVNode("div",X9,[e.createElementVNode("div",{class:e.normalizeClass(`item-attributes ${t.mode}-attributes`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.attributes,(k,B)=>(e.openBlock(),e.createBlock(Bc,{key:B,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:k.value,label:k.label,field:k.value.field,offer:{applyOffer:k.applyOffer,offerDetails:k.offerDetails,offerValue:o.offer},"item-count":a.value,"applied-on-offer-matching-field":m.value},null,8,["class","loading","value","label","field","offer","item-count","applied-on-offer-matching-field"]))),128))],2),o.offerSetting&&m.value&&((E=o.offer)!=null&&E.offerDescShort)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${t.mode}-offer-banner`)},[e.createVNode(Re,{tag:t.offerSetting.offerDetails.styles.offerDescription.textStyles.tag,text:(A=o.offer)==null?void 0:A.offerDescShort,style:e.normalizeStyle(t.offerSetting.offerDetails.styles.offerDescription.textStyles),class:e.normalizeClass(C.field+"_value")},null,8,["tag","text","style","class"])],2)):e.createCommentVNode("",!0)]),h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([`item-button ${t.mode}-button`,"ect-flex ect-flex-col ect-gap-2"])},[t.loading||t.applyOffer&&!o.offer?(e.openBlock(),e.createElementBlock("div",W9,[e.createVNode(Qt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.value?(e.openBlock(),e.createBlock(Ao,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",Q9,[a.value>0&&!t.loading&&d.value?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:a.value,"onUpdate:modelValue":[_[0]||(_[0]=k=>a.value=k),c],loading:s.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Fc,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:_[1]||(_[1]=k=>y(k))},null,8,["disabled","options"]))]))],64))],2)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-e3d55bd3"]]),J9={class:"item"},Y9={class:"item-text"},e8={class:"item-attributes"},t8={key:0,class:"item-button"},n8={key:1,class:"ect-flex ect-flex-col ect-gap-1"},o8=ve({__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(t){var b,p;const r=mn(),n=t,o=e.ref(((p=(b=r.savedItems)==null?void 0:b[n.itemId])==null?void 0:p.XX_ORD1__QTY__c)||0),a=e.ref(!1),i=e.ref(!1),l=e.ref(!1),s=e.computed(()=>n.actions&&n.actions.length>0),u=e.computed(()=>n.actions.some(x=>x.action==="ADD_TO_CART")),h=e.computed(()=>{var x,g,C;return(x=n.offer)!=null&&x.appliedOnField?Sc[(g=n.offer)==null?void 0:g.appliedOnField]===((C=n.offerSetting.value)==null?void 0:C.field):!0});e.watch(()=>r.savedItems,x=>{var g,C;x[n.itemId]&&!i.value&&((g=x[n.itemId])==null?void 0:g.XX_ORD1__QTY__c)!==o.value&&(o.value=((C=x[n.itemId])==null?void 0:C.XX_ORD1__QTY__c)||0,i.value=!0)},{deep:!0});function d(x){var g;i.value=!0,x===0&&((g=r.savedItems)!=null&&g[n.itemId])?c():f()}const m=x=>{var g;x.action==="ADD_TO_CART"?(i.value=!0,o.value=1,y()):x.action==="CONFIGURE"?Et("catalog:item-configure-clicked",{itemId:n.itemId,catalogItemId:n.catalogItemId,title:n.title,description:n.description,attributes:n.attributes,thumbnail:n.thumbnail,url:n.url,offer:n.offer,mode:n.mode,isPreview:n.isPreview}):x.action==="CUSTOM"?window.open(((g=x.url)==null?void 0:g.value)||x.value,x.newTab?"_blank":"_self"):x.action==="ORDER_PARTS"||x.action},c=async function(){a.value=!0;const x=[r.savedItems[n.itemId].Id];await r.deleteLineItems(x),delete r.savedItems[n.itemId],a.value=!1},y=async function(){a.value=!0;const x={itemID:n.itemId,eCatalogItemID:n.catalogItemId,qty:o.value,qtyTierAmt:null};await r.saveItemToQuoteBlinkTxn(x),a.value=!1},f=St(async function(){console.log("updateToCart 2",o.value),l.value=!0,await r.updateQuoteLineQtyTxn({itemId:n.itemId,qty:o.value,eCatalogItemId:n.catalogItemId}),l.value=!1},800);return(x,g)=>(e.openBlock(),e.createElementBlock("div",J9,[e.createElementVNode("div",Y9,[e.createVNode(Ic,{url:t.url,title:t.title,loading:t.loading},null,8,["url","title","loading"])]),e.createElementVNode("div",e8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.attributes,C=>{var _;return e.openBlock(),e.createBlock(Bc,{key:C.field,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:C.value,label:C.label,offer:{applyOffer:C.applyOffer,offerDetails:C.offerDetails,offerValue:n.offer},"item-count":o.value,"applied-on-offer-matching-field":h.value,"show-offer-description":!!((_=n.offer)!=null&&_.offerDescShort)},null,8,["class","loading","value","label","offer","item-count","applied-on-offer-matching-field","show-offer-description"])}),128))]),s.value?(e.openBlock(),e.createElementBlock("div",t8,[a.value?(e.openBlock(),e.createBlock(Ao,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",n8,[o.value>0&&!t.loading&&u.value?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:o.value,"onUpdate:modelValue":[g[0]||(g[0]=C=>o.value=C),d],loading:l.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Fc,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:g[1]||(g[1]=C=>m(C))},null,8,["disabled","options"]))]))])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-b679176d"]]),r8=["placeholder"],a8={key:0,class:"srch-error"},i8={class:"srch-option_lst-main"},l8={class:"italic"},s8={class:"srch-option_lst-sugg"},c8={class:"italic"},u8={class:"srch-option_lst-main"},d8={class:"italic"},f8={class:"srch-option_lst-sugg"},h8={class:"italic"},p8={class:"srch-option_lst-main"},m8={class:"italic"},y8={class:"srch-option_lst-sugg"},g8={class:"italic"},b8={key:1,class:"search1"},x8={class:"search-container_header"},_8={class:"search-container_header_input ectheme-input-box"},C8=["placeholder","value"],E8=ve({__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(t,{emit:r}){const n=r;let o;const a=e.ref(""),i=e.ref(!1),l=e.ref(!1),s=e.ref(null),u=()=>{s.value=null,a.value="",n("update:modelValue",""),n("enter")},h=b=>{a.value.length>1?(b.target.blur(),m(a.value+"*")):s.value="Search text must be more than one character.",i.value=!1},d=()=>{l.value||(s.value=null,a.value.length>1?m(a.value+"*"):a.value.length===1&&(s.value="Search text must be more than one character."),i.value=!1)},m=b=>{n("update:modelValue",b),i.value=!1,l.value=!1},c=b=>{const p=b.target.value;s.value=null,p.length||n("update:modelValue","")},y=()=>{n("enter")},f=b=>{var x;o&&(clearTimeout(o),o=null);const p=((x=b==null?void 0:b.target)==null?void 0:x.value)??"";o=setTimeout(()=>{n("update:modelValue",p)},500)};return(b,p)=>t.suggestion?(e.openBlock(),e.createElementBlock("div",{key:0,class:"srch",tabindex:"0",onFocusin:p[6]||(p[6]=x=>i.value=!0),onFocusout:d,onKeydown:e.withKeys(h,["enter"])},[e.createElementVNode("div",{class:e.normalizeClass(["srch-inp",{"srch-error-border":s.value}])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=x=>a.value=x),type:"search",placeholder:t.placeholder,onInput:c},null,40,r8),[[e.vModelText,a.value]]),e.createVNode(Be,{icon:a.value?"close":"search",size:14,color:s.value?"red":"#acacac",onClick:u},null,8,["icon","color"])],2),s.value?(e.openBlock(),e.createElementBlock("div",a8,[e.createElementVNode("span",null,e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0),a.value.length>1&&i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"srch-option",onMouseover:p[4]||(p[4]=x=>l.value=!0),onMouseout:p[5]||(p[5]=x=>l.value=!1)},[e.createElementVNode("div",{class:"srch-option_lst",onClick:p[1]||(p[1]=x=>m(a.value+"*"))},[e.createElementVNode("div",i8,[e.createTextVNode(" Search for "),e.createElementVNode("span",l8,e.toDisplayString(a.value)+"*",1)]),e.createElementVNode("div",s8,[e.createTextVNode(" word that starts with "),e.createElementVNode("span",c8,e.toDisplayString(a.value)+"*",1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:p[2]||(p[2]=x=>m(a.value))},[e.createElementVNode("div",u8,[e.createTextVNode(" Search for "),e.createElementVNode("span",d8,'"'+e.toDisplayString(a.value)+'"',1)]),e.createElementVNode("div",f8,[e.createTextVNode(" search exactly for "),e.createElementVNode("span",h8,'"'+e.toDisplayString(a.value)+'"',1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:p[3]||(p[3]=x=>m("*"+a.value+"*"))},[e.createElementVNode("div",p8,[e.createTextVNode(" Search for "),e.createElementVNode("span",m8,"*"+e.toDisplayString(a.value)+"*",1)]),e.createElementVNode("div",y8,[e.createTextVNode(" word that includes "),e.createElementVNode("span",g8,"*"+e.toDisplayString(a.value)+"*",1)])])],32)):e.createCommentVNode("",!0)],32)):(e.openBlock(),e.createElementBlock("div",b8,[e.createElementVNode("div",x8,[e.createElementVNode("div",_8,[e.createElementVNode("input",{class:"",type:"search",placeholder:t.placeholder,value:t.modelValue,onInput:f,onKeyup:e.withKeys(y,["enter"])},null,40,C8),t.loading?(e.openBlock(),e.createBlock(Ao,{key:0})):e.createCommentVNode("",!0),t.modelValue?(e.openBlock(),e.createBlock(Be,{key:1,icon:"close",size:12,color:"#acacac",onClick:u})):e.createCommentVNode("",!0),t.enableSearchClick||!t.modelValue?(e.openBlock(),e.createBlock(Be,{key:2,class:"ect-relative ect-top-[-1px]",icon:"search",size:14,color:"#acacac",onClick:y})):e.createCommentVNode("",!0)])])]))}},[["__scopeId","data-v-31366d17"]]),Mc=t=>(e.pushScopeId("data-v-01d2d3f1"),t=t(),e.popScopeId(),t),k8=["id"],v8={key:0,class:"product-search"},A8={key:1,class:"product-not-found"},w8=Mc(()=>e.createElementVNode("span",{class:"product-not-found_icon material-symbols-outlined"}," error ",-1)),N8=Mc(()=>e.createElementVNode("span",{class:"product-not-found_text"},"No results found",-1)),S8={key:2,class:"product-item"},B8=20,I8=ve({__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(t,{expose:r}){const n=ft(),o=["vertical","horizontal","square","table"],a=t,i=e.ref(Math.floor(Math.random()*1e9)),l=e.ref(null),s=mn(),u=e.ref(1),h=e.ref(!0),d=e.ref(!0),m=e.ref(!1);e.ref(!1);const c=e.ref([]),y=e.ref(0),f=e.ref(a.request);let b=200;const p=e.ref(a.searchText||""),x=e.computed(()=>a.initialItems||[]),g=e.computed(()=>!!(p.value||a.searchText));function C(N,T,O){const F=O==="Item",q=[];return N.forEach(M=>{var L,j;const U=JSON.parse(JSON.stringify(T));try{F?U.itemId=M.Id:(U.itemId=M.XX_ORD1__Item__c,U.catalogItemId=M.Id);const{description:H,thumbnail:Z,title:te,attributes:ne,actions:Q}=U;Z!=null&&Z.field&&!Z.isStatic&&(Z.value=We(M,Z.field)),te!=null&&te.field&&!te.isStatic&&(te.value=We(M,te.field)),H!=null&&H.field&&!H.isStatic&&(H.value=We(M,H.field)),(ne||[]).forEach(ue=>{var pe,ie;(pe=ue==null?void 0:ue.value)!=null&&pe.field&&!ue.value.isStatic&&(ue.value.value=We(M,ue.value.field,ue.value.dataType)||"-"),(ie=ue==null?void 0:ue.label)!=null&&ie.field&&!ue.label.isStatic&&(ue.label.value=We(M,ue.label.field,ue.label.dataType)||"-")}),(Q||[]).forEach(ue=>{ue.action==="CUSTOM"&&(ue.url&&!ue.url.isStatic&&(ue.url.value=We(M,ue.url.field)),ue.label&&!ue.label.isStatic&&(ue.label.value=We(M,ue.label.field)))});try{const ue=F?We(M,"XX_ORD1__SYS_Requires_Configuration__c"):We(M,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");U.requiresConfiguration=ue}catch{}const ce=F?We(M,"XX_ORD1__Friendly_URL__c"):We(M,"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c");((L=U.friendlyURLFields)==null?void 0:L.length)>0&&ce?((j=U.friendlyURLFields)==null||j.forEach(ue=>{U.friendlyURL=(U.friendlyURL||"").replace(`{!${ue}}`,We(M,ue))}),U.friendlyURL="/"+(U.friendlyURL||"")+"/"+ce):U.url&&(U.friendlyURL=U.url+"/"+((M==null?void 0:M.Id)||"")),U.friendlyURL&&(U.friendlyURL=U.friendlyURL.replace(/\/{2,}/g,"/"))}catch{}q.push(U)}),q}const _=e.ref(null),E=e.ref(null),A=e.computed(()=>{}),k=e.computed(()=>{var N;return(N=a.fields)==null?void 0:N.header});e.computed(()=>{var N;return((N=k.value)==null?void 0:N.mainHeading)||{}}),e.computed(()=>{var N;return((N=k.value)==null?void 0:N.subHeading)||{}});const B=e.computed(()=>{var N;return c.value.length>0?c.value:Array(D.value).fill((N=a.fields)==null?void 0:N.productCard)}),D=e.computed(()=>Number(a.configuration.displaySettings.itemsPerPage||B8)),w=e.computed(()=>Number(a.configuration.displaySettings.lazyLoadBatch)),v=e.computed(()=>{var N;return((N=a.configuration.productItemOrientation)==null?void 0:N.toLowerCase())||"vertical"}),S=e.ref(o.includes(v.value)?_.value||v.value:"vertical"),I=e.computed(()=>c.value.length<1&&!d.value),R=e.computed(()=>`product-${S.value} width-${E.value?E.value:a.configuration.displaySettings.columns||1}`),z=e.computed(()=>a.configuration.displaySettings.enableSearch),$=e.ref(null),X=e.ref(!1),W=e.ref({});e.watch(u,(N,T)=>{N!==T&&(console.log("[fetchProducts] 1"),K(!0))}),e.watch($,N=>{N!==null&&a.onCountUpdate&&a.onCountUpdate(N)}),e.watch(p,()=>{u.value=1,console.log("[fetchProducts] 2"),K(!0)}),e.watch(()=>a.searchText,(N,T)=>{N!==T&&(p.value=N||"")});const K=St(async function(N){var q;if(b=600,m.value=!0,x.value&&x.value.length>0&&!g.value){const M=C(x.value,(q=a.fields)==null?void 0:q.productCard,a.catalogType);c.value=M,$.value=M.length,d.value=!1,m.value=!1;try{Et("catalog:items-loaded",{items:M,count:M.length})}catch{}N&&l.value&&l.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});return}d.value=!0;let O=D.value;w.value<O&&w.value>0&&(O=w.value);const F={...f.value,accountID:a.accountId,rowLimit:O,searchText:p.value||a.searchText,rowOffSet:D.value*(u.value-1)};N&&l.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),n.quoteId.value?s.getQuoteItems(!0).then(M=>{m.value=!1}).catch(M=>{console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching line items",M),m.value=!1}).finally(()=>{m.value=!1}):m.value=!1;try{const M=await s.getProductItems(F,a.fields.productCard,a.catalogType);if(M){h.value=M.items.length===O,$.value=M.count,c.value=M.items,y.value=Math.ceil(M.count/D.value);try{Et("catalog:items-loaded",{items:M.items,count:M.count})}catch{}}console.log("[MOLECULEPRODUCTBLOCK:fetchProducts] prodData",M)}catch(M){console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching products",M)}finally{d.value=!1,m.value=!1}},b);async function P(){const{mainHeading:N,subHeading:T}=a.fields.header;if(!N.isStatic&&N.field||!T.isStatic&&T.field){const O=[];N.isStatic?N.value=N.title:O.push(N.field),T.isStatic?T.value=T.title:O.push(T.field);const F={...f.value,accountID:a.accountId,fields:O},q=await s.getEcatalogDetails(F);N.isStatic||(N.value=q[N.field],N.isStatic=!0),T.isStatic||(T.value=q[T.field],T.isStatic=!0)}else N.value=N.title,T.value=T.title}return r({currentPage:u,fetchProducts:K}),e.onMounted(()=>{K(),P()}),(N,T)=>(e.openBlock(),e.createElementBlock("div",{id:i.value,ref_key:"productBlock",ref:l,class:"product"},[z.value&&A.value===void 0&&!t.hideHeader?(e.openBlock(),e.createElementBlock("div",v8,[e.createVNode(E8,{modelValue:p.value,"onUpdate:modelValue":T[0]||(T[0]=O=>p.value=O),placeholder:"Search products..."},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.renderSlot(N.$slots,"default",{},void 0,!0),I.value?(e.openBlock(),e.createElementBlock("div",A8,[w8,e.createTextVNode(),N8])):(e.openBlock(),e.createElementBlock("div",S8,[S.value==="table"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.value,O=>(e.openBlock(),e.createElementBlock("div",{key:(O==null?void 0:O.catalogItemId)||(O==null?void 0:O.itemId),class:"product-item_table"},[e.createVNode(o8,{class:"ecb-theme-card","item-id":O==null?void 0:O.itemId,"catalog-item-id":O==null?void 0:O.catalogItemId,loading:d.value||m.value,mode:S.value,title:O==null?void 0:O.title,attributes:O==null?void 0:O.attributes,actions:O==null?void 0:O.actions,thumbnail:{value:O==null?void 0:O.thumbnail.value},description:O==null?void 0:O.description,url:O==null?void 0:O.friendlyURL,"template-id":t.configuration.productTemplateId,"apply-offer":X.value,"offer-setting":W.value,offer:O==null?void 0:O.offer,"is-preview":t.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)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,O=>(e.openBlock(),e.createElementBlock("div",{key:(O==null?void 0:O.catalogItemId)||(O==null?void 0:O.itemId),class:e.normalizeClass(["product-item_record",R.value])},[e.createVNode(Z9,{"item-id":O==null?void 0:O.itemId,"catalog-item-id":O==null?void 0:O.catalogItemId,loading:d.value||m.value,mode:S.value,title:O==null?void 0:O.title,attributes:O==null?void 0:O.attributes,actions:O==null?void 0:O.actions,thumbnail:{value:O==null?void 0:O.thumbnail.value},description:O==null?void 0:O.description,url:O==null?void 0:O.friendlyURL,"template-id":t.configuration.productTemplateId,"apply-offer":X.value,"offer-setting":W.value,offer:O==null?void 0:O.offer,"is-preview":t.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,k8))}},[["__scopeId","data-v-01d2d3f1"]]),Rc=t=>(e.pushScopeId("data-v-0eae07cd"),t=t(),e.popScopeId(),t),T8={class:"catalog ect-flex ect-flex-col ect-gap-0 md:ect-flex-row"},O8={class:"catalog-product md:ect-grow"},D8={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"},V8={class:"catalog-filter-mobile ect-flex ect-justify-between m-show"},F8=Rc(()=>e.createElementVNode("h3",null,"Filter Products",-1)),M8=Rc(()=>e.createElementVNode("span",null," OPEN FILTERS",-1)),R8=ve({__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(t){var y,f,b,p,x,g,C,_,E,A,k;const r=ft(),n=t,o=e.ref(!1),a=e.computed(()=>Array.isArray(n.initialItems)&&n.initialItems.length>0?"Search Results":"Catalog"),i=e.ref(((y=n.configuration.dynamicFilters)==null?void 0:y.length)>0&&((f=n.configuration.displaySettings)==null?void 0:f.displayDynamicFilters)&&!n.searchTerm),l=e.ref(n.configuration.displaySettings),s=e.computed(()=>y4.get(n.configuration.catalogType)),u=e.computed(()=>{let B=d.value.searchText;return B&&!B.endsWith("*")&&(B+="*"),B||""}),h=e.computed(()=>{var z;const B=[],{description:D,thumbnail:w,title:v,attributes:S,actions:I}=n.fields.productCard,R=[D,w,v];return S.forEach($=>{R.push($.value),R.push($.label)}),(I==null?void 0:I.length)>0&&I.forEach($=>{$.action==="CUSTOM"&&(R.push($.url),R.push($.label))}),R.forEach($=>{!$.isStatic&&$.field?B.push($.field):$.value=$.title||"-"}),s.value==="eCatalog"?(B.push("XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),B.push("XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c")):(B.push("XX_ORD1__Friendly_URL__c"),B.push("XX_ORD1__SYS_Requires_Configuration__c")),((z=n.fields.productCard.friendlyURLFields)==null?void 0:z.length)>0&&B.push(...n.fields.productCard.friendlyURLFields),B}),d=e.ref({blockId:n.id,catalogType:m4.get(n.configuration.catalogType)||"Full",checkcurrency:(b=l.value)==null?void 0:b.checkCurrency,eCatalogIDs:n.configuration.catalogType==="ECATALOG_OVERRIDE"&&n.configuration.catalogId?[n.configuration.catalogId]:null,fields:h.value,alternateFieldName:n.configuration.catalogCustomField,searchText:"",whereCondition:n.configuration.staticFilters,sortByField:((x=(p=n.configuration.sort)==null?void 0:p.primary)==null?void 0:x.field)||"Name",sortOrder:(C=(g=n.configuration.sort)==null?void 0:g.primary)==null?void 0:C.direction,secondarySortByField:(E=(_=n.configuration.sort)==null?void 0:_.secondary)==null?void 0:E.field,secondarySortOrder:(k=(A=n.configuration.sort)==null?void 0:A.secondary)==null?void 0:k.direction}),m=e.ref(null),c=e.ref(null);return e.watch(()=>o.value,B=>{B&&window.scrollTo(0,0)}),e.onMounted(()=>{d.value.searchText=n.searchTerm||""}),e.watch(d,B=>{c.value&&c.value.fetchFilterList(),m.value&&(m.value.currentPage=1,console.log("[fetchProducts] 4"),m.value.fetchProducts())},{deep:!0}),e.watch(()=>n.searchTerm,B=>{typeof B=="string"&&(d.value.searchText=B)}),(B,D)=>(e.openBlock(),e.createElementBlock("div",T8,[e.createElementVNode("div",O8,[e.createElementVNode("h2",D8,e.toDisplayString(a.value),1),e.createVNode(I8,{ref_key:"product",ref:m,"block-id":t.id,"account-id":e.unref(r).accountId,configuration:t.configuration,"catalog-type":s.value,request:d.value,fields:t.fields,"search-text":u.value,"initial-items":n.initialItems,"hide-header":!!n.searchTerm,"on-count-update":n.onCountUpdate,"is-preview":t.isPreview},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",V8,[F8,e.createElementVNode("div",{class:"ect-flex ect-items-center ect-gap-2 m-show",onClick:D[0]||(D[0]=w=>o.value=!0)},[e.createVNode(Be,{class:"filter-product_icon",icon:"tune",color:"#acacac",size:20}),M8])],512),[[e.vShow,!o.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"]]),L8={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 t="material-";return this.symbol?t+="symbols-":t+="icons-",this.rounded?t+="round":t+="outlined",t}}},P8=["width","height"],q8=["href"],$8=["width","height"],U8=["href"];function z8(t,r,n,o,a,i){const l=e.resolveComponent("AtomIcons"),s=e.resolveComponent("AtomTooltip");return n.tooltip?(e.openBlock(),e.createBlock(s,{key:0,content:n.tooltip,direction:n.direction,width:n.tooltipWidth},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:r[0]||(r[0]=u=>a.isHover=!0),onMouseleave:r[1]||(r[1]=u=>a.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(l),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:a.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:a.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,q8)],12,P8))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(i.mode),style:e.normalizeStyle(i.style)},e.toDisplayString(n.icon),7))],34)]),_:1},8,["content","direction","width"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:r[2]||(r[2]=u=>a.isHover=!0),onMouseleave:r[3]||(r[3]=u=>a.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(l),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:a.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:a.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,U8)],12,$8))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(i.mode),style:e.normalizeStyle(i.style)},e.toDisplayString(n.icon),7))],34))}const Cr=ve(L8,[["render",z8],["__scopeId","data-v-16108bca"]]);async function Lc(t,r,n,o={},a={}){let i=`/services/apexrest/${t}?type=${r}`;if(o&&Object.keys(o).length>0){const u=new URLSearchParams;Object.keys(o).forEach(d=>{const m=o[d];m!=null&&m!==""&&u.append(d,String(m))});const h=u.toString();h&&(i+=`&${h}`)}const l={action:"makeCall",data:{callType:n,endpoint:i,...n!=="GET"&&{payload:JSON.stringify(a)}}};return(await br(wn,l)).content}const Nn=it.defineStore("expediteCart",()=>{const t=e.ref(null),r=e.ref([]),n=e.ref(),o=e.ref({}),a=ft();async function i(f,b){let p=b?"cart.getGroupedQuoteProducts":"cart.getQuoteProducts";return await Ct({data:JSON.stringify(f),config:{pathKey:p}})}async function l(f){return await Ct({data:JSON.stringify({lineItemIds:f}),config:{pathKey:"common.getLineItemAttributes"}})}async function s(){const f=t.value?{quoteId:t.value}:{};return await Ct({data:JSON.stringify(f),config:{pathKey:"promocode.getPromoCodes"}})}async function u(){const f=t.value?{quoteId:t.value}:{},b=await Lc("XX_ORD1/ecommerce","getQLIsForPromoCode","POST",f,{});return n.value=b,r.value=b.qliIds,b}async function h(f,b,p){const x={promoCode:f,quoteId:t.value,qliIds:b,isLastBatch:p,originalTotalSalesPrice:f?n.value.originalTotalSalesPrice:null,isFromQLIUpdateOrDelete:"false"};return await Ct({data:JSON.stringify(x),config:{pathKey:"promocode.applyPromoCode"}})}async function d(f){const p={records:[{fields:f.fields.map(g=>({fieldName:g.fieldName,fieldValue:String(g.fieldValue)}))}],uniqueField:"Id",objectType:f.objectType};return await Ct({data:JSON.stringify(p),config:{pathKey:"update.upsertRecords"}})}async function m(f){return await Ct({data:JSON.stringify(f),config:{pathKey:"fetch.getRecord"}})}async function c(){const f=t.value;return f?await Ct({data:JSON.stringify({objectId:f,isCommit:!1}),config:{pathKey:"tax.calculateAvaTax"}}):void 0}async function y(f){const b=f||a.cid.value;return await Lc("XX_ORD1/ecommerce","startNewCart","POST",b?{cid:b}:{},{})}return{quoteId:t,qlisList:r,quoteRecord:o,getRowItems:i,getLineItemAttributesNG:l,getPromoCodeInfo:s,getQLIsForPromoCode:u,applyPromoCodeNG:h,updateRecord:d,getRecordFieldValue:m,calculateAvaTax:c,startNewCart:y}}),j8={name:"ModalApp",components:{AtomIcon:Cr},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"}},H8={key:0,class:"modal-mask"},G8={class:"modal-wrapper"},K8={key:0,class:"close-text"},X8={key:1,class:"modal-container__header"},W8={class:"ect-flex ect-flex-col ect-gap-2"},Q8={class:"widget-upload__heading"},Z8={key:0,class:"ect-text-[#5f5f5f] ect-text-[14px] ect-font-roboto ect-font-normal ect-leading-[20px]"},J8={class:"modal-container__content"},Y8={class:"modal-container__action"};function ey(t,r,n,o,a,i){const l=e.resolveComponent("AtomIcon");return e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[n.show?(e.openBlock(),e.createElementBlock("div",H8,[e.createElementVNode("div",G8,[e.createElementVNode("div",{class:"modal-container",style:e.normalizeStyle(`${n.maxWidth?"max-width: "+n.maxWidth+"px; width: 100%;":""}`)},[n.showCloseButton?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-container__close ect-gap-2",onClick:r[0]||(r[0]=s=>t.$emit("clicked"))},[e.createVNode(l,{icon:"close",size:16,color:"##0a0a0a",hover:"#000000"}),n.showCloseButtonText?(e.openBlock(),e.createElementBlock("span",K8," Close ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.title?(e.openBlock(),e.createElementBlock("span",X8,[e.createElementVNode("div",W8,[e.createElementVNode("p",Q8,e.toDisplayString(n.title),1),n.subTitle?(e.openBlock(),e.createElementBlock("span",Z8,e.toDisplayString(n.subTitle),1)):e.createCommentVNode("",!0)]),e.renderSlot(t.$slots,"header-action",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",J8,[e.renderSlot(t.$slots,"content",{},void 0,!0)]),e.createElementVNode("div",Y8,[e.renderSlot(t.$slots,"action",{},void 0,!0)])],4)])])):e.createCommentVNode("",!0)]),_:3})}const ty=ve(j8,[["render",ey],["__scopeId","data-v-f59dbab6"]]),ny={name:"AtomLoader"},oy={class:"loader"};function ry(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("span",oy)}const Pc=ve(ny,[["render",ry],["__scopeId","data-v-32b63014"]]),ay={name:"AtomButton",components:{AtomLoader:Pc},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 t=[];return this.btype?this.btype==="primary"?t.push("esg-btn-primary ect-bg-primary"):this.btype==="secondary"?t.push("esg-btn-secondary"):this.btype==="link"||this.btype==="ghost"?t.push("noborder"):this.btype==="plink"?t.push("esg-pcolor-fc"):this.btype==="error"&&t.push("esg-btn-error"):t.push("esg-btn-primary"),this.buttonStyle==="link"&&t.push("link-btn"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},iy={class:"loader"};function ly(t,r,n,o,a,i){const l=e.resolveComponent("AtomLoader");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button ect-uppercase ect-whitespace-nowrap",i.getBtnClass()],style:i.getBtnStyle(),onClick:r[0]||(r[0]=e.withModifiers(s=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({"text-loading":n.loading})},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)],!0)],2),e.createElementVNode("span",iy,[n.loading?(e.openBlock(),e.createBlock(l,{key:0})):e.createCommentVNode("",!0)])]),_:3},16,["type","class","style"])}const qc=ve(ay,[["render",ly],["__scopeId","data-v-ae1df853"]]),sy={components:{AppTooltip:ws,AppIcon:Be},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)}}},$c=t=>(e.pushScopeId("data-v-888eb5f4"),t=t(),e.popScopeId(),t),cy=["data-test-id"],uy=["data-test-id"],dy={key:0,width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fy=[$c(()=>e.createElementVNode("g",{id:"minus"},[e.createElementVNode("path",{id:"Icon",d:"M3 6H10",stroke:"white","stroke-width":"1.66666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],hy={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},py=[$c(()=>e.createElementVNode("g",{id:"check"},[e.createElementVNode("path",{id:"Icon",d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.6666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],my=["data-test-id"];function yy(t,r,n,o,a,i){const l=e.resolveComponent("AppIcon"),s=e.resolveComponent("AppTooltip");return e.openBlock(),e.createElementBlock("div",{class:"checkbox","data-test-id":n.dataTestId,onClick:r[0]||(r[0]=(...u)=>i.toggleChecked&&i.toggleChecked(...u))},[e.createElementVNode("div",{class:e.normalizeClass(["checkmark",{checked:n.modelValue&&!n.partial&&!n.disabled,disabled:n.disabled,partial:n.partial}]),"data-test-id":`${n.dataTestId}-checkmark`},[n.partial?(e.openBlock(),e.createElementBlock("svg",dy,fy)):n.modelValue?(e.openBlock(),e.createElementBlock("svg",hy,py)):e.createCommentVNode("",!0)],10,uy),n.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"label","data-test-id":`${n.dataTestId}-label`},e.toDisplayString(n.label),9,my)):e.createCommentVNode("",!0),n.info?(e.openBlock(),e.createBlock(s,{key:1,direction:"top",content:n.info,width:100,"data-test-id":`${n.dataTestId}-info-tooltip`},{default:e.withCtx(()=>[e.createVNode(l,{class:"ect-text-primary ect-pt-2 ect-pl-4",icon:"info","data-test-id":`${n.dataTestId}-info-icon`},null,8,["data-test-id"])]),_:1},8,["content","data-test-id"])):e.createCommentVNode("",!0)],8,cy)}const Er=ve(sy,[["render",yy],["__scopeId","data-v-888eb5f4"]]),gy={class:"m-content"},by={key:0,class:"attribute-input"},xy={key:1,class:"attribute-lookup"},_y={class:"attribute-lookup-main"},Cy={key:1},Ey={key:2,class:"attribute-input"},ky={key:2},vy={class:"m-footer"},Ay=ve({__name:"MoleculeAttributeModal",props:{data:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},emits:["close","update","reload"],setup(t,{emit:r}){const n=Nn(),o=t,a=r,i=e.ref([]),l=e.ref([]),s=e.ref({}),u=e.ref(!1);async function h(){u.value=!0;const f=[{fieldName:"Id",fieldValue:o.quoteId}];l.value.forEach(p=>{if(p.editable&&!p.apiName.includes(".")){let x=p.apiName;p.dataType==="REFERENCE"?(x=p.apiName.replace("__r","__c"),f.push({fieldName:x,fieldValue:p.referenceRecordId})):f.push({fieldName:x,fieldValue:p.value})}});const b={fields:f,objectType:"XX_ORD1__Quote_Line_Item__c"};console.log(b),await n.updateRecord(b),d(),a("reload",o.quoteId),a("close"),u.value=!1}function d(){const f={},b={};i.value.forEach(p=>{p.dataType==="REFERENCE"&&(b[p.apiName]=p.referenceRecordId),f[p.apiName]=p.value}),o.data.forEach(p=>{p.dataType==="REFERENCE"&&(p.referenceRecordId=b[p.apiName]),p.value=f[p.apiName]})}function m(f,b){if(f){const p=i.value.find(g=>g.label===b.firstLookup.replace("Copy from ",""));console.log("Parent",p);const x={};p.relatedFields.forEach(g=>{x[g.child]=g.value}),p&&(b.referenceRecordId=p.referenceRecordId,b.value=p.value,b.options=p.options,b.relatedFields.forEach(g=>{g.value=x[g.child]}))}else b.referenceRecordId=null,b.options=[],b.relatedFields.forEach(p=>{p.value=null})}function c(f,b){console.log(f,b);const p=b.options.find(x=>x.Id===f);f===null?(b.options=[],b.value=null,b.relatedFields.forEach(x=>{x.value=null})):(b.value=p.Name,b.relatedFields.forEach(x=>{x.value=p[x.child]}))}const y=St(async function(f,b){b.loading=!0;const p={lookupObjectApiName:b.referenceObject,searchTerm:f||"",fields:s.value[b.apiName]||[]},x=await n.getLookupRecords(p);console.log(x),b.options=x,b.loading=!1});return e.onBeforeMount(()=>{const f={};i.value=JSON.parse(JSON.stringify(o.data)),i.value.forEach(p=>{p.dataType==="REFERENCE"&&(s.value[p.apiName]=[],p.relatedFields=[],f[p.apiName]=p,p.options=[{Name:p.value||"",Id:p.referenceRecordId}]),p.editable=p.editable&&!p.apiName.includes(".")});let b=null;i.value.forEach(p=>{if(p.referenceObject==="XX_Base__Location__c"&&(b?p.firstLookup="Copy from "+b.label:b=p),p.apiName.includes(".")){const[x,g]=p.apiName.split(".");p.parent=x,p.child=g,s.value[x]!=null&&(s.value[x].push(g),f[x].relatedFields.push(p))}}),l.value=i.value.filter(p=>!p.apiName.includes(".")),console.log(l.value,f)}),(f,b)=>(e.openBlock(),e.createBlock(ty,{title:"Modify attributes",onClicked:b[1]||(b[1]=p=>f.$emit("close"))},{content:e.withCtx(()=>[e.createElementVNode("div",gy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,x)=>{var g;return e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[p.firstLookup?(e.openBlock(),e.createElementBlock("div",by,[e.createElementVNode("label",null,e.toDisplayString(p.firstLookup),1),e.createVNode(Er,{modelValue:p.same,"onUpdate:modelValue":[C=>p.same=C,C=>m(C,p)],class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),p.dataType==="REFERENCE"&&((g=p.relatedFields)==null?void 0:g.length)>0?(e.openBlock(),e.createElementBlock("div",xy,[e.createElementVNode("div",_y,[e.createVNode(rn,{modelValue:p.referenceRecordId,"onUpdate:modelValue":[C=>p.referenceRecordId=C,C=>c(C,p)],label:p.label,disabled:!p.editable||p.same,options:p.options,lookup:"",search:"",highlight:"",loading:p.loading,property:{key:"Id",value:"Name"},onSearch:C=>e.unref(y)(C,p)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.relatedFields,(C,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:"attribute-input"},[C.dataType==="PICKLIST"||C.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,label:C.label,disabled:!C.editable,options:C.picklistValues.map(E=>({label:E,value:E})),select:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):C.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",Cy,[e.createElementVNode("label",null,e.toDisplayString(C.label),1),e.createVNode(Er,{modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,disabled:!C.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Rn,{key:2,label:C.label,disabled:!C.editable,modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))),128))])):(e.openBlock(),e.createElementBlock("div",Ey,[p.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:p.referenceRecordId,"onUpdate:modelValue":[C=>p.referenceRecordId=C,C=>c(C,p)],label:p.label,disabled:!p.editable,options:p.options,lookup:"",search:"",highlight:"",loading:p.loading,property:{key:"Id",value:"Name"},onSearch:C=>e.unref(y)(C,p)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])):p.dataType==="PICKLIST"||p.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,label:p.label,disabled:!p.editable,options:p.picklistValues.map(C=>({label:C,value:C})),select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):p.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",ky,[e.createElementVNode("label",null,e.toDisplayString(p.label),1),e.createVNode(Er,{modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,disabled:!p.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Rn,{key:3,label:p.label,disabled:!p.editable,modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,highlight:"",class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))],64)}),128))])]),action:e.withCtx(()=>[e.createElementVNode("div",vy,[e.createVNode(qc,{text:"CANCEL",btype:"secondary",onClick:b[0]||(b[0]=p=>f.$emit("close"))}),e.createVNode(qc,{text:"SAVE",btype:"primary",loading:u.value,onClick:h},null,8,["loading"])])]),_:1}))}},[["__scopeId","data-v-d0648f18"]]),wy={class:"datatable"},Ny={class:"m-show"},Sy={key:0},By=["onClick"],Iy={key:1},Ty=["data-test-id","onClick"],Oy={class:"desktop d-show"},Dy={class:"datatable-skeletion"},Vy={class:"datatable-skeletion"},Fy={class:"datatable-skeletion"},My=["colspan"],Ry={style:{display:"flex",gap:"1rem",height:"40px"}},Ly=["onClick"],Py=["data-test-id","onClick"],qy={key:0},$y=["colspan"],Uy={style:{display:"flex",gap:"1rem",height:"40px"}},zy={key:1},jy=["colspan"],Hy={style:{display:"flex","flex-wrap":"wrap",padding:"1rem"}},Gy={key:0,class:"attribute",style:{width:"50%"}},Ky={key:0,class:"ect-flex ect-gap-2"},Xy={key:1,class:"ect-flex ect-gap-2"},Wy={key:1,class:"attribute",style:{width:"50%"}},Qy={key:0},Zy={key:2,class:"attribute",style:{width:"50%"}},Jy={key:0},Yy={key:1},kr=ve({__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(t,{emit:r}){const n=t,o=e.ref(null),a=e.ref(null),i=r,l=e.ref(null),s=e.ref({}),u=e.ref(null),h=e.computed(()=>n.disabled),d=function(_,E){return l.value&&l.value!==_+":"+E||n.delRecords.has(_)||h.value||u.value&&u.value!==_},m=e.computed(()=>{const{headerStyle:_,optionRow:E,productRow:A}=n.style;return{product:{backgroundColor:A.background,verticalAlign:A.verticalAlignment||"middle"},option:{backgroundColor:E.background,verticalAlign:E.verticalAlignment||"middle"},header:{backgroundColor:_.background,verticalAlign:_.verticalAlignment||"middle"}}}),c=e.computed(()=>{const{headerStyle:_,optionRow:E,productRow:A}=n.style;return{header:_.style||{},option:E.style||{},product:A.style||{}}}),y=e.computed(()=>200/n.cols.length+"px");function f(_,E,A){const k={},{table:B}=n.style;if(_){const{alignment:D,strikethrough:w}=_;D&&(k.textAlign=D),w&&(k.textDecoration="line-through")}if(E){const{width:D,minWidth:w}=E;D&&(k.width=`calc(${D.value+D.unit} - ${y.value})`),w&&(k.minWidth=w.value+w.unit)}return B.border!=="n"&&!A?(k.borderStyle="solid",k.borderColor=B.color,B.border==="b"?k.borderWidth=B.width:B.border==="x"?(k.borderTopWidth=B.width,k.borderBottomWidth=B.width,k.borderLeftWidth=0,k.borderRightWidth=0):B.border==="y"?(k.borderLeftWidth=B.width,k.borderRightWidth=B.width,k.borderTopWidth=0,k.borderBottomWidth=0):B.border==="bottom"||B.border==="default"?(k.borderTopWidth=0,k.borderBottomWidth=B.width,k.borderLeftWidth=0,k.borderRightWidth=0):B.border==="top"&&(k.borderTopWidth=B.width,k.borderBottomWidth=0,k.borderLeftWidth=0,k.borderRightWidth=0)):k.borderWidth="0px",k}function b(_,E){var k;if(E.dataType==="REFERENCE")return(k=_[E.content.replace("__c","__r")])==null?void 0:k.Name;const A=We(_,E.api,E.dataType);return A===""?A:E.dataType==="PERCENT"?A+"%":A}function p(_,E){_===0?i("delete",E):x(_,"XX_ORD1__QTY__c",E)}function x(_,E,A){u.value=A.Id,g(_,E,A)}const g=St(function(_,E,A){l.value=A.Id+":"+E,s.value.Id=A.Id,s.value[E]=_;const k=()=>{l.value=null,s.value={},u.value=null};i("update",{record:s.value,callback:k})},500),C=_=>_.content.picklist.map(E=>({label:E,value:E}));return(_,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value&&a.value?(e.openBlock(),e.createBlock(Ay,{key:0,data:o.value,"quote-id":a.value,onClose:E[0]||(E[0]=A=>(o.value=null,a.value=null)),onReload:E[1]||(E[1]=A=>_.$emit("reload",A))},null,8,["data","quote-id"])):e.createCommentVNode("",!0),e.createElementVNode("div",wy,[e.createElementVNode("div",Ny,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,A=>(e.openBlock(),e.createElementBlock("table",{key:A.Id,class:"mobile md:ect-hidden"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(k,B)=>{var D,w,v,S;return e.openBlock(),e.createElementBlock("tr",{key:B},[e.createElementVNode("th",{style:e.normalizeStyle({...f(k.header.style),...m.value.header})},[k.header?(e.openBlock(),e.createBlock(Re,{key:0,text:k.header.title,style:e.normalizeStyle(k.header.style),"sec-style":c.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4),e.createElementVNode("td",{style:e.normalizeStyle({...f(k.content.style),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[k.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>p(I,A)],disabled:d(A.Id,k.api),loading:A.Id+":"+k.api===l.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):k.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),options:C(k),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Rn,{key:2,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.dataType==="URL"?(e.openBlock(),e.createBlock(bi,{key:0,src:b(A,k)},null,8,["src"])):k.content.isStatic?(e.openBlock(),e.createBlock(Re,{key:1,tag:(D=k.content)==null?void 0:D.style.tag,text:k.content.content,style:e.normalizeStyle((w=k.content)==null?void 0:w.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(Re,{key:2,loading:t.loading.includes(k.dataType)&&(!t.loadingRowId||t.loadingRowId===A.Id),tag:(v=k.content)==null?void 0:v.style.tag,text:b(A,k),style:e.normalizeStyle((S=k.content)==null?void 0:S.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],4)])}),128)),t.del?(e.openBlock(),e.createElementBlock("tr",Sy,[e.createElementVNode("th",{style:e.normalizeStyle({...f(),...m.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...f(),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(A.Id)}]),onClick:k=>!d(A.Id)&&_.$emit("delete",A)},"REMOVE",10,By)],4)])):e.createCommentVNode("",!0),t.configure&&e.unref(di).includes(A.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("tr",Iy,[e.createElementVNode("th",{style:e.normalizeStyle({...f(),...m.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...f(),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("div",{class:e.normalizeClass(["datatable-configure",{disabled:d(A.Id)}]),"data-test-id":`expeditecart-list-button-configure-${A.Id}`,onClick:k=>!d(A.Id)&&_.$emit("configure",A)},"CONFIGURE",10,Ty)],4)])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("table",Oy,[t.hidecolumn?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,style:e.normalizeStyle(m.value.header)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,A=>{var k;return e.openBlock(),e.createElementBlock("th",{key:A.key,style:e.normalizeStyle(f((k=A.header)==null?void 0:k.style,A.style))},[A.header?(e.openBlock(),e.createBlock(Re,{key:0,text:A.header.title,style:e.normalizeStyle(A.header.style),"sec-style":c.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4)}),128)),t.del?(e.openBlock(),e.createElementBlock("th",{key:0,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0)],4)),t.rowLoading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},e.renderList(5,A=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,k=>(e.openBlock(),e.createElementBlock("td",{key:k.key,style:e.normalizeStyle(f(k.content.style,k.style))},[e.createElementVNode("div",Dy,[e.createVNode(yn)])],4))),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",Vy,[e.createVNode(yn)])],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",Fy,[e.createVNode(yn)])],4)):e.createCommentVNode("",!0)]),t.attribute?(e.openBlock(),e.createElementBlock("td",{key:0,colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Ry,[e.createVNode(yn),e.createVNode(yn)])],12,My)):e.createCommentVNode("",!0)],64))),64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.rows,A=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A.Id},[e.createElementVNode("tr",{style:e.normalizeStyle(m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(k,B)=>{var D,w,v,S;return e.openBlock(),e.createElementBlock("td",{key:B,style:e.normalizeStyle(f(k.content.style,k.style,!!A.Attributes)),class:e.normalizeClass({"padding-left":B==0&&A.XX_ORD1__Parent_QLI__c})},[k.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>p(I,A)],disabled:d(A.Id,k.api),loading:A.Id+":"+k.api===l.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):k.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),options:C(k),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Rn,{key:2,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.dataType==="URL"?(e.openBlock(),e.createBlock(bi,{key:0,src:b(A,k)},null,8,["src"])):k.content.isStatic?(e.openBlock(),e.createBlock(Re,{key:1,tag:(D=k.content)==null?void 0:D.style.tag,text:k.content.content,style:e.normalizeStyle((w=k.content)==null?void 0:w.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(Re,{key:2,loading:t.loading.includes(k.dataType)&&(!t.loadingRowId||t.loadingRowId===A.Id),tag:(v=k.content)==null?void 0:v.style.tag,text:b(A,k),style:e.normalizeStyle((S=k.content)==null?void 0:S.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],6)}),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...f(null,null,!!A.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(A.Id)}]),onClick:k=>!d(A.Id)&&_.$emit("delete",A)},"REMOVE",10,Ly)],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("td",{key:1,style:e.normalizeStyle({...f(null,null,!!A.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.unref(di).includes(A.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["datatable-configure",{disabled:d(A.Id)}]),"data-test-id":`expeditecart-list-button-configure-${A.Id}`,onClick:k=>!d(A.Id)&&_.$emit("configure",A)}," CONFIGURE ",10,Py)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],4),A.attributesLoading?(e.openBlock(),e.createElementBlock("tr",qy,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Uy,[e.createVNode(yn),e.createVNode(yn)])],12,$y)])):A.Attributes?(e.openBlock(),e.createElementBlock("tr",zy,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Hy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.Attributes,(k,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[k.value||k.existingValue||k.existingValueReferenceName?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.value&&(k.existingValue||k.existingValueReferenceName)?(e.openBlock(),e.createElementBlock("div",Gy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value!==k.existingValue&&k.value!==k.existingValueReferenceName?(e.openBlock(),e.createElementBlock("div",Ky,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"]),e.createVNode(Re,{text:k.existingValueReferenceName||k.existingValue,style:e.normalizeStyle(t.attribute.old.style)},null,8,["text","style"])])):(e.openBlock(),e.createElementBlock("div",Xy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])),t.attribute.edit&&k.editable&&A.XX_ORD1__QLI_Type__c!=="Remove"?(e.openBlock(),e.createBlock(Cr,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):k.value?(e.openBlock(),e.createElementBlock("div",Wy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value?(e.openBlock(),e.createElementBlock("div",Qy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&k.editable?(e.openBlock(),e.createBlock(Cr,{key:1,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):t.attribute.displayonlychanged?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value?(e.openBlock(),e.createElementBlock("div",Jy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):k.existingValue?(e.openBlock(),e.createElementBlock("div",Yy,[e.createVNode(Re,{text:k.existingValueReferenceName||k.existingValue,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&k.editable?(e.openBlock(),e.createBlock(Cr,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)]))],64)):e.createCommentVNode("",!0)],64))),128))])],12,jy)])):e.createCommentVNode("",!0)],64))),128))])])],64))}},[["__scopeId","data-v-3b714a31"]]),eg={key:0,class:"prodlist"},tg={class:"prodlist-header"},ng={key:0},og={key:1,class:"summary"},rg={key:1,class:"summary"},ag=ve({__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(t,{emit:r}){const n=Nn(),o=mn(),a=t,i=r,l=T=>T.toUpperCase()||"",s=e.computed(()=>{var T;return((T=a.fields)==null?void 0:T.styling)||{}}),u=e.computed(()=>{var T,O;return(O=(T=a.configuration)==null?void 0:T.allowedActions)==null?void 0:O.delete}),h=e.computed(()=>{var T,O;return(O=(T=a.configuration)==null?void 0:T.allowedActions)==null?void 0:O.configure}),d=e.computed(()=>{var T;return a.configuration.displayAttributes?(T=a.configuration)==null?void 0:T.attribute:!1}),m=e.computed(()=>{var T;return(T=a.configuration)==null?void 0:T.sort}),c=e.computed(()=>{var T;return(T=a.configuration)==null?void 0:T.group}),y=e.computed(()=>{const T=c.value.groupheader.style;return T?I(T):{}}),f=e.computed(()=>{const T=c.value.groupfooter.style;return T?I(T):{}}),b=e.computed(()=>{const T={},{border:O,color:F,width:q}=s.value.table;return O==="default"&&(T.borderStyle="solid",T.borderColor=F,T.borderWidth=q,T.borderTopWidth=0),T}),p=e.computed(()=>B.value?!1:!v.value||v.value.length===0?!0:v.value.every(T=>{const O=T.rows&&T.rows.length>0,F=T.options&&T.options.some(q=>q.rows&&q.rows.length>0);return!O&&!F}));Ko();const x=["CURRENCY","DOUBLE","PERCENT"],g=["CURRENCY","DOUBLE","PERCENT","DATE","DATETIME","TIME","BOOLEAN","STRING","TEXTAREA","REFERENCE","EMAIL","PHONE","URL","TEXTAREA","TEXTAREA"],C=e.ref(null),_=e.ref([]),E=e.ref([]),A=e.ref([]),k=e.ref(!1),B=e.ref(!1),D=e.ref(new Set),w=e.ref([]),v=e.ref([]),S=new Map;function I(T){let O={padding:"1.25rem 2rem"};const{overrite:F,backgroundColor:q,verticalAlignment:M,padding:U}=T;return F&&(O={backgroundColor:q,verticalAlign:M,padding:U||"1.25rem 2rem"}),O}const R=async function({record:T,callback:O}){const F=[];for(const M in T)F.push({fieldName:M,fieldValue:T[M]});const q={fields:F,objectType:a.configuration.objectType};await n.updateRecord(q),O(),T.XX_ORD1__QTY__c!==void 0&&(C.value=T.Id,await W("FIELD_RELOAD"),C.value=null)};async function z(T){C.value=T,await W("RELOAD_ALL_FIELDS"),C.value=null}const $=T=>{Et("expeditecart:configure-clicked",{itemId:T.XX_ORD1__Item__c,lineItemId:T.Id,quoteId:n.quoteId,isPreview:a.isPreview})},X=async function(T){D.value.add(T.Id),k.value=!0;const O=[T.Id];await o.deleteLineItems(O),await W("RELOAD"),k.value=!1,D.value.delete(T.Id)};async function W(T){T==="RELOAD"?B.value=!0:T==="FIELD_RELOAD"?A.value=x:T==="RELOAD_ALL_FIELDS"&&(A.value=g);const{groupby:O,grouplevel:F}=a.configuration.group,q=n.quoteId,M=a.footer.map(H=>({field:H.field,snippet:H.function||"SUM"})),U={filterObject:a.configuration.objectType,fieldsToDisplay:[...E.value,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c","XX_ORD1__Parent_QLI__c"],aggregateFields:M,filters:a.configuration.filters,parentObjectField:a.configuration.parentObjectField,objectId:q,groupby:O.field,grouplevel:F,primarysort:m.value.primary.field,secondarysort:m.value.secondary.field,primarysortdesc:m.value.primary.direction!=="asc",secondarysortdesc:m.value.secondary.direction!=="asc",filterlogic:a.configuration.filterlogic},L=O.field&&F,j=await n.getRowItems(U,L);L?N(j,F):P(j),a.configuration.displayAttributes&&K(),B.value=!1,A.value=[]}async function K(){const T=C.value,O=[];v.value.forEach(q=>{q.rows.forEach(M=>{M.attributes=S.get(M.Id),console.log("row.attributes",M.attributes),T?M.Attributes=S.get(M.Id):M.attributesLoading=!0,O.push(M.Id)})});const F=await n.getLineItemAttributesNG(O);v.value.forEach(q=>{q.rows.forEach(M=>{const U=F[M.Id];if(U==null?void 0:U.some(j=>j.value&&!d.value.displayonlychanged||j.value&&j.existingValue&&d.value.displayonlychanged)){const j=[],H=new Set;U.forEach(Z=>{H.has(Z.apiName)||(H.add(Z.apiName),j.push(Z))}),M.Attributes=j,S.set(M.Id,j)}M.attributesLoading=!1})}),console.log("attributesByIdMap",S)}function P(T){var M;const O=T.lstRecords,F=[],q=T.lstRecords&&((M=T.lstRecords)==null?void 0:M.length)>0;if(i("counts",q),T.lstAggregateField&&T.lstAggregateField.length>0){const U=new Map;T.lstAggregateField.forEach(L=>{U.set(L.fieldName,L.totalValue)}),a.footer.forEach(L=>{L.value=U.get(L.field),F.push(L)})}v.value=[{rows:O,summary:F}]}function N(T,O){const F=[];let q;T.forEach(M=>{var U;if(O==="option"){if((U=M.product)!=null&&U.thisobject){const L={name:"",rows:[M.product.thisobject],summary:[],isProduct:!0,options:[]};M.options.length>0&&M.options.forEach(j=>{const H={name:j.groupName,rows:[]},Z=[];j.options.forEach(te=>{H.rows.push(te.thisobject)}),j.groupTotals&&j.groupTotals.length>0&&j.groupTotals.forEach(te=>{var ne,Q;Z.push({label:H.name,value:te.amount,style:((Q=(ne=c.value)==null?void 0:ne.groupfooter)==null?void 0:Q.style)||{}})}),H.summary=Z,L.options.push(H)}),F.push(L)}}else{if(q={name:M.groupName,rows:[]},M.productRows.forEach(L=>{q.rows.push(L[O].thisobject),L.options.forEach(j=>{const H={...j.thisobject};H.isOption=!0,q.rows.push(H)})}),c.value.displaygroupfooter){const L=[];M.groupTotals&&M.groupTotals.length>0&&M.groupTotals.forEach(j=>{var H,Z;L.push({label:q.name,value:j.amount,style:((Z=(H=c.value)==null?void 0:H.groupfooter)==null?void 0:Z.style)||{}})}),q.summary=L}else q.summary=[];F.push(q)}}),v.value=F}return e.onBeforeMount(()=>{console.log("Product List - Block Before Mount"),w.value=JSON.parse(JSON.stringify(a.columns)),_.value=a.summary,w.value.forEach(T=>{T.content.dataType=l(T.content.dataType),T.editby=T.editable,T.editable=T.editable!=="not",T.dataType=T.content.dataType,T.api=T.content.field,E.value.push(T.content.field)}),E.value.includes("XX_ORD1__QLI_Type__c")||E.value.push("XX_ORD1__QLI_Type__c"),W("RELOAD")}),(T,O)=>{var F;return p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",eg,[e.createElementVNode("div",tg,[t.header.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(F=t.header.style)==null?void 0:F.tag,text:t.header.title,style:e.normalizeStyle(t.header.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)]),!c.value.repeatcolumheadings||B.value?(e.openBlock(),e.createElementBlock("div",ng,[e.createVNode(kr,{cols:w.value,rows:[],summary:[],style:e.normalizeStyle(s.value),loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[0]||(O[0]=q=>z(q))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(b.value)},[e.createVNode(kr,{hidecolumn:"",cols:w.value,rows:[],summary:[],style:e.normalizeStyle(s.value),"row-loading":!0,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[1]||(O[1]=q=>z(q))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])],4)):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(b.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,q=>(e.openBlock(),e.createElementBlock("div",{key:q.name,class:e.normalizeClass(["productlist",q.isProduct?"prodlist-product":"prodlist-option"])},[c.value.displaygroupheader&&q.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(y.value)},[e.createVNode(Re,{text:"Group: "+q.name,style:e.normalizeStyle(c.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(kr,{hidecolumn:!c.value.repeatcolumheadings,cols:w.value,rows:q.rows,style:e.normalizeStyle(s.value),"row-loading":B.value,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[2]||(O[2]=M=>z(M))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),q.summary.length>0?(e.openBlock(),e.createElementBlock("div",og,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.summary,(M,U)=>{var L,j,H;return e.openBlock(),e.createElementBlock("div",{key:U,class:"summary_row",style:e.normalizeStyle(f.value)},[e.createVNode(Re,{tag:(L=M==null?void 0:M.style)==null?void 0:L.tag,text:M.label+" : ",style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["tag","text","style"]),e.createTextVNode(" "),e.createVNode(Re,{loading:((j=A.value)==null?void 0:j.length)>0||B.value,tag:(H=M==null?void 0:M.style)==null?void 0:H.tag,text:M.value,style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0),q.options?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(q.options,M=>(e.openBlock(),e.createElementBlock("div",{key:M.name},[c.value.displaygroupheader&&M.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(y.value)},[e.createVNode(Re,{text:"Group: "+M.name,style:e.normalizeStyle(c.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(kr,{hidecolumn:!c.value.repeatcolumheadings,cols:w.value,rows:M.rows,style:e.normalizeStyle(s.value),"row-loading":B.value,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,"is-option":!0,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[3]||(O[3]=U=>z(U))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),M.summary.length>0?(e.openBlock(),e.createElementBlock("div",rg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.summary,(U,L)=>{var j,H,Z;return e.openBlock(),e.createElementBlock("div",{key:L,class:"summary_row",style:e.normalizeStyle(f.value)},[e.createVNode(Re,{tag:(j=U==null?void 0:U.style)==null?void 0:j.tag,text:U.label+" : ",style:e.normalizeStyle(U==null?void 0:U.style)},null,8,["tag","text","style"]),e.createTextVNode(" "),e.createVNode(Re,{loading:((H=A.value)==null?void 0:H.length)>0||B.value,tag:(Z=U==null?void 0:U.style)==null?void 0:Z.tag,text:U.value,style:e.normalizeStyle(U==null?void 0:U.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0)]))),128)):e.createCommentVNode("",!0)],2))),128))],4))]))}}},[["__scopeId","data-v-d933d5c5"]]),ig={class:"detail-section"},lg={key:0,class:"selectedtext sm:hidden"},sg={class:"expand material-icons-outlined"},cg={key:1,class:"detail-section_title"},ug={key:2,class:"detail-section_slot"},dg=ve({__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(t,{emit:r}){const n=t;return(o,a)=>{var i,l;return e.openBlock(),e.createElementBlock("div",ig,[n.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["detail-section_header ect-border-solid ect-border-border-db",{"ect-border-b-1":n.expand,"ect-border-b-0":!n.expand}]),onClick:a[0]||(a[0]=s=>!n.disabled&&o.$emit("expand",!n.expand))},[n.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(i=n.style)==null?void 0:i.tag,text:n.title,style:e.normalizeStyle(n.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createBlock(yn,{key:1,type:"accordian-title"})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[n.selectedText?(e.openBlock(),e.createElementBlock("span",lg,e.toDisplayString(n.selectedText),1)):e.createCommentVNode("",!0),e.createElementVNode("span",sg,e.toDisplayString(n.expand?"expand_more":"expand_less"),1)])],2)):(e.openBlock(),e.createElementBlock("div",cg,[t.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(l=t.style)==null?void 0:l.tag,text:t.title,style:e.normalizeStyle(t.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)])),n.expand?(e.openBlock(),e.createElementBlock("div",ug,[e.renderSlot(o.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-3796312d"]]);function fg(t,r,n){if(!r)return t;if(n.aliasName)return hg(t,r,n);{const a=r.split(".").reduce((i,l)=>i[l]||"",t)||"";return{original:a,value:a,metadata:n}}}function hg(t,r,n){var l;const o=r.split(".");let a=r;o.length>1&&(a=o.pop(),t=o.reduce((s,u)=>s[u]||{},t));let i=t[n.aliasName]||t[a]||"";return i&&n.dataType&&((l=n.dataType)==null?void 0:l.toUpperCase())==="CURRENCY"&&i.includes("(")&&(i=i.split("(")[0]),{value:i,original:t[a],metadata:n}}function pg(t){let r=t.replace(/[_.]/g,"")+"Formatted";return console.log("aliasName",r),r}const mg={class:"quote-summary"},yg={key:0,class:"qt-smuarry"},gg={class:"summary ect-mt-[1rem] md:ect-mt-[0]"},bg=ve({__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(t){const r=Nn(),n=t,o=xi(),a=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.header}),i=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.content}),l=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.footer}),s=e.ref(!1),u=e.ref(!1),h=e.ref(!1),d=e.ref([]),m=e.ref({}),c=e.computed(()=>{var b,p;return o.isMobile.value&&!s.value&&l.value&&l.value.length>0?`${l.value[0].label} ${((b=m.value[l.value[0].field])==null?void 0:b.value)||""}`:(p=a.value)==null?void 0:p.title});async function y(b){console.log("Quote Summary",b),u.value=!0,h.value&&await r.calculateAvaTax();const p=d.value.map(({field:x})=>x);m.value=await r.getRecordFieldValue({recordId:n.quoteId,lstFields:p}),d.value.forEach(({field:x,dataType:g})=>{m.value[x]=fg(m.value,x,{dataType:g,aliasName:pg(x)})}),u.value=!1}const f=()=>{o.isMobile.value?s.value=!s.value:s.value=!0};return e.onMounted(async()=>{var p,x,g,C,_,E,A,k,B;s.value=!o.isMobile.value;const b=(x=(p=document.querySelector(`[page-block-id="${n.id}"]`))==null?void 0:p.parentElement)==null?void 0:x.parentElement;b&&(b.style.display=o.isMobile.value?"none":"block"),h.value=n.tax||((g=i.value)==null?void 0:g.some(({field:D})=>D==="XX_ORD1__Taxes__c")),(n.quoteId||h.value)&&(d.value=(_=(C=n.fields)==null?void 0:C.content)==null?void 0:_.map(({field:D,dataType:w})=>({field:D,dataType:w})),((A=(E=n.fields)==null?void 0:E.footer)==null?void 0:A.length)>0&&((B=(k=n.fields)==null?void 0:k.footer)==null||B.forEach(({field:D,dataType:w})=>d.value.push({field:D,dataType:w}))),y())}),(b,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#qtsummary",disabled:!e.unref(o).isMobile.value},[e.createElementVNode("div",mg,[t.quoteId?(e.openBlock(),e.createElementBlock("div",yg,[e.createVNode(dg,{expand:s.value,title:c.value,style:e.normalizeStyle(a.value.style),header:e.unref(o).isMobile.value,onExpand:p[0]||(p[0]=x=>f())},{default:e.withCtx(()=>[e.createElementVNode("div",gg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,x=>{var g,C,_,E;return e.openBlock(),e.createElementBlock("div",{key:x.field,class:"summary-item"},[x.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(g=x.style)==null?void 0:g.tag,text:x.label,style:e.normalizeStyle(x.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(C=m.value[x.field])!=null&&C.value?(e.openBlock(),e.createBlock(Re,{key:1,loading:u.value,tag:(_=x.style)==null?void 0:_.tag,text:(E=m.value[x.field])==null?void 0:E.value,style:e.normalizeStyle(x.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,x=>{var g,C,_,E;return e.openBlock(),e.createElementBlock("div",{key:x.field,class:"summary-total"},[x.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(g=x.style)==null?void 0:g.tag,text:x.label,style:e.normalizeStyle(x.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(C=m.value[x.field])!=null&&C.value?(e.openBlock(),e.createBlock(Re,{key:1,loading:u.value,tag:(_=x.style)==null?void 0:_.tag,text:(E=m.value[x.field])==null?void 0:E.value,style:e.normalizeStyle(x.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128))])]),_:1},8,["expand","title","style","header"])])):e.createCommentVNode("",!0)])],8,["disabled"]))}},[["__scopeId","data-v-0821469a"]]),xg={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"}},_g={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 t=[];return!this.type||!xg[this.type]||this.type==="primary"?t.push("esg-btn-primary"):this.type==="secondary"?t.push("esg-btn-secondary"):(this.type==="link"||this.type==="ghost")&&t.push("noborder"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},Cg={key:0,class:"ect-flex ect-justify-center"},Eg={key:1};function kg(t,r,n,o,a,i){const l=e.resolveComponent("AtomSpinner");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button",i.getBtnClass()],style:i.getBtnStyle(),onClick:r[0]||(r[0]=e.withModifiers(s=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[n.showspinner?(e.openBlock(),e.createElementBlock("div",Cg,[e.createVNode(l,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("div",Eg,e.toDisplayString(n.text),1))],!0)]),_:3},16,["type","class","style"])}const vr=ve(_g,[["render",kg],["__scopeId","data-v-7428ebd4"]]),vg={class:"promocode-input"},Ag={class:"m-1"},wg=ve({__name:"OrganismsPromoCodeBlock",props:{fields:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})},id:{type:String,required:!0},isPreview:{type:Boolean,default:!1}},setup(t){const r=Nn(),n=t,o=e.computed(()=>n.fields.label),a=e.ref(!1),i=e.ref(""),l=e.ref(!1),s=e.ref(!1),u=e.ref(""),h=e.ref(null),d=async()=>{if(n.isPreview)return;l.value=!0,a.value=!0,s.value=!1,await r.getQLIsForPromoCode();const f=await m(!1);f.error||(u.value=f),l.value=!1},m=async f=>{const p=r.qlisList,x=Math.ceil(p.length/50);let g="";for(let C=0;C<x;C++){const _=C*50,E=_+50,A=C===x-1;if(g=await c(p.slice(_,E),A,f),g&&g.error)return s.value=g.error,h.value.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),l.value=!1,f||(a.value=!1,y(!0)),g}return g},c=async(f,b,p)=>await r.applyPromoCodeNG(p?"":i.value,f,b),y=async f=>{if(n.isPreview)return;l.value=!0,await r.getQLIsForPromoCode(),f!==!0&&(s.value=!1);const b=await m(!0);(!b||b&&!b.error)&&f!==!0&&(a.value=!1,u.value="",i.value=""),l.value=!1};return e.onMounted(async()=>{const f=await r.getPromoCodeInfo();console.log("Offer::",f),f!=null&&f.XX_ORD1__Promo_Code__c&&(i.value=f.XX_ORD1__Promo_Code__c,u.value=f.XX_ORD1__Short_Description__c,a.value=!0)}),(f,b)=>{var p,x,g,C,_,E,A;return e.openBlock(),e.createElementBlock("div",{ref_key:"promocodeRef",ref:h,class:"promocode"},[(p=o.value)!=null&&p.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(x=o.value)==null?void 0:x.title,style:e.normalizeStyle((g=o.value)==null?void 0:g.style)},null,8,["text","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",vg,[e.createVNode(Rn,{modelValue:i.value,"onUpdate:modelValue":[b[0]||(b[0]=k=>i.value=k),b[1]||(b[1]=k=>a.value=!1)],class:"promocode-input_box",disabled:a.value||t.isPreview,error:s.value},null,8,["modelValue","disabled","error"]),l.value?(e.openBlock(),e.createBlock(ya,{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createBlock(vr,{key:1,theme:(E=t.fields.removeButton)==null?void 0:E.style.theme,disabled:i.value.length<1,text:(A=t.fields.removeButton)==null?void 0:A.title,onClick:y},null,8,["theme","disabled","text"])):(e.openBlock(),e.createBlock(vr,{key:0,theme:(C=t.fields.applyButton)==null?void 0:C.style.theme,disabled:i.value.length<1,text:(_=t.fields.applyButton)==null?void 0:_.title,onClick:d},null,8,["theme","disabled","text"]))],64)),e.createElementVNode("span",Ag,e.toDisplayString(u.value),1)])],512)}}},[["__scopeId","data-v-861bd8dd"]]),Uc={"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 Ng(t){return Uc[t]||"dd/MM/yyyy"}function Sg(t,r){if((t==null?void 0:t.length)<6||!r)return null;const n=Uc[r]||"dd/MM/yyyy",o=n.includes("/")?"/":n.includes("-")?"-":".",a=n.split(o),i=t.split(o),l={};if(a.forEach((u,h)=>{l[u]=parseInt(i[h])}),l.yyyy>9999||l.yyyy<1e3||l.MM<0||l.MM>12||l.dd<0||l.dd>31)return null;const s=new Date(l.yyyy,l.MM-1,l.dd);return s!="Invalid Date"?s:null}const Ar=t=>(e.pushScopeId("data-v-13eaa242"),t=t(),e.popScopeId(),t),Bg=["data-test-id"],Ig=["for","data-test-id"],Tg=["data-test-id"],Og=["placeholder","data-test-id"],Dg=["data-test-id"],Vg=["data-test-id"],Fg=["data-test-id"],Mg=["data-test-id"],Rg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrows"},null,-1))],Lg=["data-test-id"],Pg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrow"},null,-1))],qg=["data-test-id"],$g=["data-test-id"],Ug=["data-test-id"],zg=["data-test-id"],jg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrow"},null,-1))],Hg=["data-test-id"],Gg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrows"},null,-1))],Kg=["data-test-id"],Xg={class:"c-container"},Wg={class:"cc-head"},Qg={class:"cc-body"},Zg={class:"cdc-day"},Jg=["onClick"],Yg=60*60*24*1e3,e7=ve({__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(t,{emit:r}){const n=t,o=r,a=Date.now()-Date.now()%Yg+new Date().getTimezoneOffset()*1e3*60,i=Q=>{if(!Q)return"";const[ce,ue,pe]=Q.split("-");return`${ue}/${pe}/${ce}`},l=Q=>{if(!Q)return"";const[ce,ue,pe]=Q.split("/");return`${pe}-${ce.padStart(2,"0")}-${ue.padStart(2,"0")}`},s=e.ref({year:new Date().getFullYear(),month:new Date().getMonth(),selectedDay:a,monthDetails:[]}),u=e.ref({position:"fixed",top:"0px",left:"0px",width:"0px"}),h=["SUN","MON","TUE","WED","THU","FRI","SAT"],d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"],c=e.ref(new Date(1e3,0,1)),y=e.ref(new Date(9999,0,1)),f=e.ref(!0),b=e.ref(!1),p=e.ref(""),x=e.ref(""),g=e.ref(!1),C=e.ref(""),_=e.ref(-1),E=e.computed(()=>Ng(n.locale)),A=e.computed(()=>c.value.getFullYear()<s.value.year),k=e.computed(()=>y.value.getFullYear()>s.value.year),B=e.computed(()=>A.value||c.value.getMonth()<s.value.month),D=e.computed(()=>k.value||y.value.getMonth()>s.value.month),w=e.computed(()=>{if(x.value){const Q=x.value.getTime();if(y.value.getTime()<Q)return"Max date can be "+y.value.toLocaleDateString(n.locale);if(c.value.getTime()>Q)return"Min date can be "+c.value.toLocaleDateString(n.locale)}return!1}),v=e.computed(()=>{let Q=n.error===""?!1:n.error===!0?`${n.label||"Field"} is required`:n.error;return f.value||(Q="Date format must be "+E.value),w.value&&(Q=w.value),o("error",Q),Q}),S=e.computed(()=>(C.value==""||C.value==null)&&(n.modelValue==""||n.modelValue==null)?!1:C.value!=n.modelValue);e.watch(()=>n.modelValue,Q=>{p.value=Q?i(Q):""}),e.watch(()=>n.min,Q=>{c.value=Q?new Date(Q):new Date(1e3,0,1)}),e.watch(()=>n.max,Q=>{y.value=Q?new Date(Q):new Date(9999,0,1)}),e.watch(p,Q=>{if(Q)try{const ce=Sg(Q,n.locale);if(x.value=ce||x.value,f.value=!!ce,f.value){const ue=l(Q);if(C.value===ue)return;o("update:modelValue",ue)}}catch(ce){console.info("[ERROR]: Date parsing error:",ce),f.value=!1}else f.value=!0,x.value=null,o("update:modelValue","")});const I=e.ref(null),R=e.ref(null),z=e.ref(null);e.onMounted(()=>{ne(),y.value=n.max?new Date(n.max):y.value,c.value=n.min?new Date(n.min):c.value,n.modelValue&&(p.value=i(n.modelValue),f.value=!!p.value),C.value=n.modelValue,window.addEventListener("resize",$),window.addEventListener("scroll",$,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)});const $=()=>{if(!z.value)return;const Q=z.value.getBoundingClientRect(),ce=334;u.value={position:"fixed",top:`${Q.bottom+4}px`,left:`${Q.left}px`,width:`${ce}px`,zIndex:9999}},X=()=>{g.value||(L(),g.value=!0,$(),o("focus-in"))},W=(Q=!1)=>{(!b.value||Q)&&setTimeout(()=>{_.value=-1,g.value=!1,o("focus-out",x.value)},100)},K=()=>{R.value&&R.value.focus()},P=Q=>{const ce=Q.index-Q.firstDay,ue=Q.index%7;let pe=Q.month-1,ie=Q.year;pe<0&&(pe=11,ie--);const de=N(ie,pe),_e=(ce<0?de+ce:ce%Q.numberOfDays)+1,xe=new Date(Q.year,Q.month,_e).getTime(),ye=ce<0||c.value.getTime()>xe?-1:ce>=Q.numberOfDays||y.value.getTime()<xe?1:0;return{date:_e,day:ue,month:ye,timestamp:xe,dayString:d[ue]}},N=(Q,ce)=>40-new Date(Q,ce,40).getDate(),T=(Q,ce)=>{const ue=new Date(Q,ce).getDay(),pe=N(Q,ce),ie=[],de=6;let _e=null,xe=0;const ye=7;for(let oe=0;oe<de;oe++)for(let le=0;le<ye;le++)_e=P({index:xe,numberOfDays:pe,firstDay:ue,year:Q,month:ce}),ie.push(_e),xe++;return ie},O=Q=>Q.timestamp===a,F=Q=>Q.timestamp===s.value.selectedDay,q=Q=>{if(!Q)return null;if(Q instanceof Date)return{year:Q.getFullYear(),month:Q.getMonth()+1,date:Q.getDate()};if(typeof Q=="string"&&Q.includes("/")){const[ce,ue,pe]=Q.split("/");return{year:parseInt(pe),month:parseInt(ce),date:parseInt(ue)}}return null},M=Q=>m[Math.max(Math.min(11,Q),0)]||"Month",U=Q=>{const ce=new Date(Q.year,Q.month-1,Q.date).getTime();s.value={selectedDay:ce}},L=()=>{ne();const Q=q(x.value);Q!==null&&(U(Q),s.value={year:Q.year,month:Q.month-1,monthDetails:T(Q.year,Q.month-1)})},j=Q=>{const ce=new Date(Q),ue=(ce.getMonth()+1).toString().padStart(2,"0"),pe=ce.getDate().toString().padStart(2,"0"),ie=ce.getFullYear();return p.value=`${ue}/${pe}/${ie}`,`${ie}-${ue}-${pe}`},H=Q=>{s.value={selectedDay:Q.timestamp};const ce=j(Q.timestamp);W(!0),o("update:modelValue",ce),R.value&&R.value.blur()},Z=Q=>{if(n.disableYear)return;const ce=s.value.year+Q;let ue=s.value.month;c.value.getFullYear()===ce&&c.value.getMonth()>ue&&(ue=c.value.getMonth()),y.value.getFullYear()===ce&&y.value.getMonth()<ue&&(ue=y.value.getMonth()),s.value={year:ce,month:ue,monthDetails:T(ce,ue)}},te=Q=>{if(n.disableMonth)return;let ce=s.value.year,ue=s.value.month+Q;ue===-1?(ue=11,ce--):ue===12&&(ue=0,ce++),s.value={year:ce,month:ue,monthDetails:T(ce,ue)}},ne=()=>{const Q=new Date,ce=Q.getFullYear(),ue=Q.getMonth();s.value={...s.value,year:ce,month:ue,selectedDay:a,monthDetails:T(ce,ue)}};return(Q,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"datePick",ref:I,class:"MyDatePicker","data-test-id":t.dataTestId,onMouseover:ce[2]||(ce[2]=ue=>b.value=!0),onMouseout:ce[3]||(ce[3]=ue=>b.value=!1)},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(["title_label",{error_color:!!v.value}]),for:t.label,"data-test-id":`${t.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!v.value})},"*",2)):e.createCommentVNode("",!0)],10,Ig)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerElement",ref:z,tabindex:"0",class:e.normalizeClass(["mdp-input ectheme-input-box ect-mb-0",{"mdp-input_focus":g.value,errorBorder_color:!!v.value,highlight:S.value&&t.highlight}]),"data-test-id":`${t.dataTestId}-input-wrapper`,onFocusin:X,onFocusout:ce[1]||(ce[1]=ue=>W(!1)),onClick:K},[e.withDirectives(e.createElementVNode("input",{id:"calendar",ref_key:"inputRef",ref:R,"onUpdate:modelValue":ce[0]||(ce[0]=ue=>p.value=ue),type:"text",autocomplete:"off",placeholder:E.value,"data-test-id":`${t.dataTestId}-input`},null,8,Og),[[e.vModelText,p.value]]),e.createVNode(Be,{icon:"calendar_today",size:18,for:"calendar","data-test-id":`${t.dataTestId}-calendar-icon`},null,8,["data-test-id"])],42,Tg),v.value?(e.openBlock(),e.createElementBlock("label",{key:1,class:"error_label","data-test-id":`${t.dataTestId}-error`},[e.createElementVNode("p",null,e.toDisplayString(v.value),1)],8,Dg)):e.createCommentVNode("",!0)],40,Bg),(e.openBlock(),e.createBlock(e.Teleport,{to:".dropdowntp"},[g.value&&!t.disabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mdp-container",style:e.normalizeStyle(u.value),"data-test-id":`${t.dataTestId}-calendar-popup`,onMousedown:ce[8]||(ce[8]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"mdpc-head","data-test-id":`${t.dataTestId}-calendar-header`},[e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!A.value||t.disableYear}]),onClick:ce[4]||(ce[4]=ue=>Z(-1))},Rg,2)],8,Mg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!B.value||t.disableMonth}]),onClick:ce[5]||(ce[5]=ue=>te(-1))},Pg,2)],8,Lg),e.createElementVNode("div",{class:"mdpch-container","data-test-id":`${t.dataTestId}-date-display`},[e.createElementVNode("div",{class:"mdpchc-year","data-test-id":`${t.dataTestId}-year-display`},e.toDisplayString(s.value.year),9,$g),e.createElementVNode("div",{class:"mdpchc-month","data-test-id":`${t.dataTestId}-month-display`},e.toDisplayString(M(s.value.month)),9,Ug)],8,qg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!D.value||t.disableMonth}]),onClick:ce[6]||(ce[6]=ue=>te(1))},jg,2)],8,zg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!k.value||t.disableYear}]),onClick:ce[7]||(ce[7]=ue=>Z(1))},Gg,2)],8,Hg)],8,Fg),e.createElementVNode("div",{class:"mdpc-body","data-test-id":`${t.dataTestId}-calendar-body`},[e.createElementVNode("div",Xg,[e.createElementVNode("div",Wg,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,(ue,pe)=>e.createElementVNode("div",{key:pe,class:"cch-name"},e.toDisplayString(ue),1)),64))]),e.createElementVNode("div",Qg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value.monthDetails,(ue,pe)=>(e.openBlock(),e.createElementBlock("div",{key:pe,class:e.normalizeClass(["c-day-container",{disabled:ue.month!==0,highlight:O(ue),"highlight-green":F(ue)}])},[e.createElementVNode("div",Zg,[e.createElementVNode("span",{onClick:ie=>H(ue)},e.toDisplayString(ue.date),9,Jg)])],2))),128))])])],8,Kg)],44,Vg)):e.createCommentVNode("",!0)]))],64))}},[["__scopeId","data-v-13eaa242"]]),zc=t=>(e.pushScopeId("data-v-9b473c8b"),t=t(),e.popScopeId(),t),t7=zc(()=>e.createElementVNode("div",{class:"dropdowntp"},null,-1)),n7={key:0,class:"custom-form_block"},o7={class:"custom-form_block-header"},r7={key:0,class:"custom-form_block-content"},a7={key:1,class:"custom-form_block-content"},i7={key:2,class:"custom-form_block-footer"},l7={key:3,class:"custom-form_block-action"},s7={key:1,class:"custom-form_success"},c7={class:"custom-form_success_message"},u7=zc(()=>e.createElementVNode("span",{class:"custom-form_success_message-icon material-icons-outlined"}," done ",-1)),d7=ve({__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(t,{expose:r}){var B;const n=Nn(),o=t,a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=e.ref({}),l=e.ref(!1),s=e.ref(!1),u=e.ref(!1),h=e.ref({}),d=e.ref({}),m=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.header}),c=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.footer}),y=e.computed(()=>o.fields&&o.fields.action&&o.fields.action.label?o.fields.action:!1),f=e.computed(()=>"en-US"),b=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.confirmation}),p=e.computed(()=>o.configuration),x=e.ref(JSON.parse(JSON.stringify((B=o.fields)==null?void 0:B.content))),g=D=>D?"custom-form_block-content_"+D.toLowerCase():"custom-form_block-content_full",C=()=>{u.value=!1,x.value.forEach(D=>{p.value.populate||(i.value[D.field]="")})},_=St(async function(D,w,v){x.value[v].loading=!0;const S={objectApiName:o.configuration.objectType,lookupFieldApiName:w,searchTerm:D||""},I=await n.getLookupRecords(S);console.log("Records:::",I),x.value[v].options=I,x.value[v].loading=!1}),E=St(()=>{!y.value&&!o.fields.isGuidance&&A(!0)},500),A=async D=>{console.log("handlerActionClick");let w=!1;if(x.value.forEach(v=>{v.isFormulaField||(v.dataType==="DATETIME"?i.value[v.field]=new Date().toISOString():v.required&&v.editable&&!i.value[v.field]&&v.dataType!=="BOOLEAN"?(v.error=!0,w=!0):(v.error=null,v.dataType==="EMAIL"&&i.value[v.field]&&!a.test(i.value[v.field])&&(v.error="Enter a valid email",w=!0)))}),!w){s.value=!0;const v=[];for(const I in i.value)(d.value[I]||I==="Id")&&v.push({fieldName:I,fieldValue:i.value[I]});const S={fields:v,objectType:o.configuration.objectType};if(o.options&&o.options.returnError){const I=await n.updateRecord(S,!0);if(!I||typeof I=="object"&&I.ERROR)return console.log("Error in saving",I),s.value=!1,I?I.ERROR:!1}else if(!await n.updateRecord(S))return s.value=!1,!1;return s.value=!1,D||(u.value=!0),!0}};async function k(){l.value=!0;const D=x.value.filter(v=>v.dataType!=="DATETIME").map(v=>v.field);let w={};if(p.value.populate&&o.quoteId&&D.length)try{w=await n.getRecordFieldValue({recordId:o.quoteId,lstFields:D})||{}}catch(v){console.error("[OrganismsCustomFormBlock] getRecordFieldValue failed",v)}x.value.forEach(v=>{var S,I,R;if(v.visiblity=v.dataType!=="DATETIME",p.value.populate&&o.quoteId)if(v.dataType==="BOOLEAN")i.value[v.field]=((S=w[v.field])==null?void 0:S.value)??!1;else if(v.dataType==="REFERENCE"){const z=v.field.replace("__c","__r"),$=(I=w[z])==null?void 0:I.value;$&&(i.value[v.field]=$.Id,v.options=[{Name:$.Name,Id:$.Id}])}else v.dataType==="DATE"?i.value[v.field]=((R=w[v.field])==null?void 0:R.value)??"":i.value[v.field]=We(w,v.field,v.dataType,!0,!0);v.editable&&v.dataType==="PICKLIST"&&(v.options=v.picklist.map(z=>({label:z,value:z})))}),l.value=!1}return e.onBeforeMount(async()=>{l.value=!0,h.value=JSON.parse(JSON.stringify(o.fields)),x.value=h.value.content,x.value.forEach(D=>{d.value[D.field]=D.editable&&!D.isFormulaField,D.size=g(D.size)}),h.value.request=i.value={Id:o.quoteId},o.quoteId&&await k()}),r({handlerActionClick:A}),(D,w)=>{var v,S,I,R,z,$,X;return e.openBlock(),e.createElementBlock(e.Fragment,null,[t7,u.value?(e.openBlock(),e.createElementBlock("div",s7,[e.createElementVNode("div",c7,[u7,e.createTextVNode(" "+e.toDisplayString((X=b.value)==null?void 0:X.label),1)]),b.value&&b.value.close?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:C},"click to close")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",n7,[e.createElementVNode("div",o7,[(v=m.value)!=null&&v.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(S=m.value)==null?void 0:S.title,style:e.normalizeStyle((I=m.value)==null?void 0:I.style)},null,8,["text","style"])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",r7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(W,K)=>(e.openBlock(),e.createElementBlock("div",{key:K,class:e.normalizeClass(["custom-form_block-content_skeletion",W.size])},[e.createVNode(Qt)],2))),128))])):l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",a7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(W,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K},[W.visiblity?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["custom-form_block-content_input",W.size])},[W.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],options:W.options,disabled:!W.editable,select:"",error:W.error,required:W.required,label:W.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label"])):W.dataType==="BOOLEAN"?(e.openBlock(),e.createBlock(Er,{key:1,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],label:W.label},null,8,["modelValue","onUpdate:modelValue","label"])):W.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(rn,{key:2,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],options:W.options,disabled:!W.editable,lookup:"",search:"",error:W.error,required:W.required,label:W.label,loading:W.loading,highlight:"",property:{key:"Id",value:"Name"},onSearch:P=>e.unref(_)(P,W.field,K)},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label","loading","onSearch"])):W.dataType==="DATE"?(e.openBlock(),e.createBlock(e7,{key:3,modelValue:i.value[W.field],"onUpdate:modelValue":P=>i.value[W.field]=P,label:W.label,required:W.required,disabled:!W.editable,error:W.error,locale:f.value,"data-test-id":`cart-customform-datepicker-${W.field}`,highlight:""},null,8,["modelValue","onUpdate:modelValue","label","required","disabled","error","locale","data-test-id"])):W.visiblity?(e.openBlock(),e.createBlock(Rn,{key:4,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],error:W.error,required:W.required,disabled:!W.editable,label:W.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","error","required","disabled","label"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))),128))])),c.value?(e.openBlock(),e.createElementBlock("div",i7,[(R=c.value)!=null&&R.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(z=c.value)==null?void 0:z.title,style:e.normalizeStyle(($=c.value)==null?void 0:$.style)},null,8,["text","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",l7,[s.value?(e.openBlock(),e.createBlock(ya,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createBlock(vr,{key:1,theme:y.value.style.theme,text:y.value.label,onClick:w[0]||(w[0]=W=>A(!1))},null,8,["theme","text"]))])):e.createCommentVNode("",!0)]))],64)}}},[["__scopeId","data-v-9b473c8b"]]),f7={class:"custom-button"},h7={class:"loader"},p7=ve({__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(t){const r=Nn(),n=mn(),o=e.ref(null),a=t,i=e.computed(()=>{var d;return!!((d=n.quoteRecord)!=null&&d.XX_ORD1__Active_Customer_Contact__c)||!0}),l=e.computed(()=>{var d,m;return(m=(d=a.fields)==null?void 0:d.actions)==null?void 0:m.filter(c=>i.value?c.action!=="ACTIVATE":c.action!=="SAVE_FOR_LATER")}),s=d=>d.key??`${d.action}-${d.label}`,u=d=>o.value===s(d),h=d=>{if(a.isPreview)return;const m=s(d);d.action==="SAVE_FOR_LATER"&&(o.value=m),Et("expeditecart:clicked",{action:d.action,label:d.label,targetTemplateId:d.targetTemplateId,quoteId:r.quoteId,isActive:i.value,isPreview:a.isPreview})};return(d,m)=>(e.openBlock(),e.createElementBlock("div",f7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(c,y)=>(e.openBlock(),e.createBlock(vr,{key:y,theme:c.style.theme,text:c.label,class:"custom-button_action",onClick:f=>h(c)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({"text-loading":u(c)})},e.toDisplayString(c.label),3),e.createElementVNode("span",h7,[u(c)?(e.openBlock(),e.createBlock(Pc,{key:0})):e.createCommentVNode("",!0)])]),_:2},1032,["theme","text","onClick"]))),128))]))}},[["__scopeId","data-v-3245ee72"]]),_i=function(t,r){const n={};n.sectionStyle={},n.blockStyle={};const{visiblity:o}=t;n.visibility=o;const{layout:a}=t;if(n.blockStyle=m7(a,r),a&&(a!=null&&a.padding)){const{top:s,bottom:u,left:h,right:d}=a.padding;s&&(n.sectionStyle.paddingTop=`${s}px`),u&&(n.sectionStyle.paddingBottom=`${u}px`),h&&(n.sectionStyle.paddingLeft=`${h}px`),d&&(n.sectionStyle.paddingRight=`${d}px`)}a!=null&&a.gap&&(n.sectionStyle.gap=`${a.gap}px`);const{styling:i}=t;i&&(i.verticalAlignment&&(n.sectionStyle.alignItems=i.verticalAlignment),i.radius&&(n.sectionStyle.borderRadius=i.radius),i.borderStyle&&(n.sectionStyle.borderStyle=i.borderStyle));const{Background:l}=t;return l&&l.style==="Solid"&&(n.sectionStyle.backgroundColor=l.color),l&&l.opacity==="100%"&&(n.sectionStyle.opacity=1),l&&l.image&&l.image!=="sampleImage.png"&&(n.sectionStyle.backgroundImage=`url(${l.image})`,l.imageSize&&(n.sectionStyle.backgroundSize=l.imageSize)),l&&l.repeat==="no-repeat"&&(n.sectionStyle.backgroundRepeat=l.repeat),l&&(l.horizontalAlignment||l.verticalAlignment)&&(n.sectionStyle.backgroundPosition=l.horizontalAlignment+" "+l.verticalAlignment),n};function m7(t,r){if(!t)return[{}];const{columnSize:n,columns:o}=t;if(r)return Array(o).fill({display:"flex",flexDirection:"column",width:"100%"});if(!n)return Array(o).fill({});const a=n.split("/");return typeof o=="string"&&a.length!==parseInt(o)?Array(o).fill({}):typeof o=="number"&&a.length!==o?Array(o).fill({}):a.map(i=>({flexBasis:`${i}`}))}const y7=["data-sid","data-sname"],g7=["data-bid","data-bname"],b7=["page-block-id"],x7=["page-block-id"],_7=["page-block-id"],C7=["page-block-id"],E7=["page-block-id"],k7=["page-block-id"],jc={__name:"TemplateRenderer",props:{onCatalogCountUpdate:{type:Function,default:null},initialCatalogItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1},quoteId:{type:String,default:null}},setup(t,{expose:r}){const n=t,o=Co(),a=Nn(),i=xi(),l=e.computed(()=>o.pageBlocks||[]),s=e.ref(0);r({refreshTemplate:()=>{s.value+=1}});const h=m=>!0,d=e.computed(()=>{var c,y,f,b;const m=[];return console.log("props.sections template renderer",l.value),console.log("props.isPreview",n.isPreview),n.isPreview&&((c=l.value)!=null&&c.content)?(f=(y=l.value)==null?void 0:y.content)==null||f.forEach(p=>{const x=[],g=p.section,C=JSON.parse(g.XX_ORD1__Content_JSON__c);let _={};C&&(_=_i(C,i.isMobile),g.styleObject=g.hideStyle?{}:_.sectionStyle,g.visibility=_.visibility),p.blocks.forEach(E=>{let A=E.XX_ORD1__Content_Block__r;const k=JSON.parse(A.XX_ORD1__Content_JSON__c);A={...A,...k};let B={};k&&(B=_i(k,i.isMobile),A.styleObject=A.hideStyle?{}:B.blockStyle),x.push(A)}),g.blocks=x,m.push(g)}):(b=l.value)==null||b.forEach(p=>{var _;const x={...p},g=typeof p.contentJSON=="string"?JSON.parse(p.contentJSON):p.contentJSON;let C={};g&&(C=_i(g,i.isMobile),x.styleObject=p.hideStyle?{}:C.sectionStyle,x.visibility=C.visibility,(_=x.blocks)==null||_.forEach((E,A)=>{E.styleObject=C.blockStyle[A]})),m.push(x)}),m});return(m,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(pa),(e.openBlock(),e.createElementBlock("div",{key:s.value,class:"contentRendered ectheme",style:{width:"100%","box-sizing":"border-box"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y.id},[h(y.visibility)?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(y.styleObject),class:"ect-flex ect-flex-col","data-sid":y.sectionId,"data-sname":y.sectionName},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.blocks,f=>(e.openBlock(),e.createElementBlock("div",{key:f.id,style:e.normalizeStyle(f.styleObject),class:"ect-w-full","data-bid":f.blockId,"data-bname":f.blockName},[f.componentName==="productList"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:0,"page-block-id":f.Id,class:"ect-m-auto ect-w-full"},[e.createVNode(ag,{id:f.Id,header:f.fields.header,columns:f.fields.columns,footer:f.fields.footer,fields:f.fields,configuration:f.configuration,"is-preview":t.isPreview},null,8,["id","header","columns","footer","fields","configuration","is-preview"])],8,b7)):f.componentName==="quoteSummary"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:1,"page-block-id":f.Id,class:""},[e.createVNode(bg,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":e.unref(a).quoteId},null,8,["id","configuration","fields","quote-id"])],8,x7)):f.componentName==="promoCode"?(e.openBlock(),e.createElementBlock("div",{key:2,"page-block-id":f.Id,class:""},[e.createVNode(wg,{id:f.Id,fields:f.fields,configuration:f.configuration,"is-preview":t.isPreview},null,8,["id","fields","configuration","is-preview"])],8,_7)):f.componentName==="customForm"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:3,"page-block-id":f.Id,class:"ect-w-full"},[e.createVNode(d7,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":e.unref(a).quoteId},null,8,["id","configuration","fields","quote-id"])],8,C7)):f.componentName==="customButtons"?(e.openBlock(),e.createElementBlock("div",{key:4,"page-block-id":f.Id,class:""},[e.createVNode(p7,{id:f.Id,configuration:f.configuration,fields:f.fields,"is-preview":t.isPreview},null,8,["id","configuration","fields","is-preview"])],8,E7)):f.componentName==="catalogBlock"?(e.openBlock(),e.createElementBlock("div",{key:5,"page-block-id":f.Id,class:""},[e.createVNode(R8,{id:f.Id,mode:"preview",configuration:f.configuration,fields:f.fields,"search-term":f.searchTerm,"on-count-update":t.onCatalogCountUpdate,"initial-items":t.initialCatalogItems,"is-preview":t.isPreview,"quote-id":t.quoteId},null,8,["id","configuration","fields","search-term","on-count-update","initial-items","is-preview","quote-id"])],8,k7)):e.createCommentVNode("",!0)],12,g7))),128))],12,y7)):e.createCommentVNode("",!0)],64))),128))]))],64))}},v7=t=>(e.pushScopeId("data-v-04b2bdef"),t=t(),e.popScopeId(),t),A7={class:"ect-composable-catalog-wrapper","data-test-id":"expose-expediteCatalog-wrapper"},w7={key:0,class:"ect-flex ect-items-center ect-justify-center ect-min-h-[50vh]","data-test-id":"expose-expediteCatalog-loader"},N7=[v7(()=>e.createElementVNode("div",{class:"ect-flex ect-flex-col ect-items-center ect-gap-3"},[e.createElementVNode("div",{class:"ect-spinner","aria-label":"Loading"}),e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500"},"Loading catalog…")],-1))],wr=ve({__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(t,{emit:r}){const n=ft(),o=mn(),a=Co(),i=t,l=e.ref(!1),s=e.ref(!1),u=e.ref(null),h=r,d=[],m=()=>{l.value=window.innerWidth<=768};return e.onBeforeMount(async()=>{var y,f,b,p,x,g,C,_,E,A,k,B,D;n.updateConfig({templateId:i.templateId,organizationId:(y=i.identity)==null?void 0:y.organizationId,hostName:i.hostName,graphqlEndpoint:i.graphqlEndpoint,apiKey:((f=i.security)==null?void 0:f.apiKey)||i.apiKey,accountId:(b=i.identity)==null?void 0:b.accountId,cid:(p=i.identity)==null?void 0:p.contactId,composablesApiUrl:(x=i.security)==null?void 0:x.baseUrl,accessToken:(g=i.security)==null?void 0:g.accessToken,composablesOrgType:i.composablesOrgType,isPreview:i.isPreview,quoteId:(C=i.session)==null?void 0:C.quoteId,userId:(_=i.identity)==null?void 0:_.userId,siteUrl:(E=i.resources)==null?void 0:E.siteUrl}),n.quoteId=(A=i.session)==null?void 0:A.quoteId,console.log("props.sections expedite catalog",i.sections),await n.processSections(i.isPreview,i.sections);const c=(D=(B=(k=a.pageBlocks[0])==null?void 0:k.blocks[0])==null?void 0:B.configuration)==null?void 0:D.catalogId;c&&h("catalog:id",c)}),e.onMounted(async()=>{window.addEventListener("resize",m),m(),d.push(Lt("catalog:item-added",c=>{h("catalog-item-added",c)})),d.push(Lt("catalog:item-qty-updated",c=>{h("catalog-item-qty-updated",c)})),d.push(Lt("catalog:line-deleted",c=>{h("catalog-line-deleted",c)})),d.push(Lt("catalog:items-fetched",c=>{h("catalog-items-fetched",c)})),d.push(Lt("catalog:item-configure-clicked",c=>{h("catalog-item-configure",c)})),d.push(Lt("catalog:items-loaded",c=>{h("catalog-items-loaded",c)}))}),e.watch(()=>i.session&&i.session.quoteId,c=>{c&&(n.updateConfig({quoteId:c}),n.quoteId=c,o.getQuoteItems(!0))}),e.watch(()=>i.sections,async(c,y)=>{c!==y&&(await n.processSections(i.isPreview,c),u.value&&u.value.refreshTemplate&&u.value.refreshTemplate())},{deep:!0}),e.onBeforeUnmount(()=>{d.forEach(c=>{try{c()}catch{}})}),(c,y)=>{var f,b;return e.openBlock(),e.createElementBlock("div",A7,[e.createVNode(Nc,{"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?(e.openBlock(),e.createElementBlock("div",w7,N7)):(e.openBlock(),e.createBlock(jc,{key:1,ref_key:"templateRendererRef",ref:u,"quote-id":(b=i.session)==null?void 0:b.quoteId,"is-preview":t.isPreview,"on-catalog-count-update":t.onCatalogCountUpdate,"initial-catalog-items":t.initialData},null,8,["quote-id","is-preview","on-catalog-count-update","initial-catalog-items"]))])}}},[["__scopeId","data-v-04b2bdef"]]),Nr={__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(t,{emit:r}){const n=ft(),o=Nn(),a=e.ref(null),i=r,l=t;e.onBeforeMount(async()=>{var u,h,d,m,c,y,f,b,p;n.updateConfig({templateId:l.templateId,organizationId:(u=l.identity)==null?void 0:u.organizationId,accountId:(h=l.identity)==null?void 0:h.accountId,cid:(d=l.identity)==null?void 0:d.contactId,userId:(m=l.identity)==null?void 0:m.userId,accessToken:(c=l.security)==null?void 0:c.accessToken,composablesApiUrl:(y=l.security)==null?void 0:y.baseUrl,quoteId:(f=l.session)==null?void 0:f.quoteId,composablesOrgType:"Production",hostName:l.hostName,isPreview:l.isPreview,siteUrl:(b=l.resources)==null?void 0:b.siteUrl}),o.quoteId=(p=l.session)==null?void 0:p.quoteId,await n.processSections(l.isPreview,l.sections)});const s=[];return e.onMounted(()=>{s.push(Lt("expeditecart:configure-clicked",u=>{i("expeditecart-item-configure",u)})),s.push(Lt("expeditecart:clicked",u=>{i("expeditecart-clicked",u)}))}),e.onBeforeUnmount(()=>{s.forEach(u=>{try{u()}catch{}})}),e.watch(()=>l.sections,async(u,h)=>{u!==h&&(await n.processSections(l.isPreview,u),a.value&&a.value.refreshTemplate&&a.value.refreshTemplate())},{deep:!0}),(u,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Nc,{"organization-id":l.identity.organizationId,"template-id":l.templateId,"is-preview":l.isPreview,theme:l.theme},null,8,["organization-id","template-id","is-preview","theme"]),e.createVNode(jc,{ref_key:"templateRendererRef",ref:a,"is-preview":t.isPreview},null,8,["is-preview"])],64))}},S7={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"}},Ci=it.defineStore("expediteConfigurator",()=>{const t=e.ref(null),r=e.ref(null),n=e.ref(null),o=e.ref([]);function a(){var h,d;console.info("[expediteConfiguratorStore] getPayload",{hasComp:!!t.value,hasGetConfig:!!((h=t.value)!=null&&h.getConfig)});const u=(d=t.value)==null?void 0:d.getConfig;return{productConfiguration:u!=null?[u]:[]}}function i(u,h){var d,m,c;console.info("[expediteConfiguratorStore] setPreConfigData",{hasData:!!u,hasProductConfiguration:!!((d=u==null?void 0:u.productConfiguration)!=null&&d.length),itemId:h}),r.value=u,((m=u==null?void 0:u.productConfiguration)==null?void 0:m.length)>0&&(n.value=u.productConfiguration.find(y=>{var b;return((y==null?void 0:y.itemId)||((b=y==null?void 0:y.product)==null?void 0:b.itemId))===h}),o.value=u.productConfiguration,console.info("[expediteConfiguratorStore] apply queued?",{hasQueueItem:!!n.value,ready:!!t.value}),n.value&&((c=t.value)!=null&&c.setConfig)&&t.value.setConfig(n.value,o.value))}function l(){var u;console.info("[expediteConfiguratorStore] refresh invoked"),(u=t.value)!=null&&u.refresh&&t.value.refresh()}function s(u){var h;console.info("[expediteConfiguratorStore] setExpediteConfigComp",{received:!!u}),t.value=u,n.value&&((h=t.value)!=null&&h.setConfig)&&(console.info("[expediteConfiguratorStore] applying queued configuration on ready"),t.value.setConfig(n.value,o.value),n.value=null)}return{preConfgData:r,expediteConfigComp:t,getPayload:a,refresh:l,setPreConfigData:i,setExpediteConfigComp:s}}),Ei=["Quote_Document"],Jn=it.defineStore("composablePlaybook",()=>{const t=Mt(),r=ft(),n=mn(),o=Ci(),a=e.ref(null),i=e.ref("full"),l=e.ref(null),s=e.ref(null),u=e.ref(!1),h=e.ref(!1),d=e.ref(null),m=e.ref(null);e.ref(null);const c=e.ref("");function y(S){c.value=S}const f=()=>({Authorization:`Bearer ${c.value}`,"X-Salesforce-Org-Id":r.organizationId.value||"","X-Salesforce-Org-Type":r.composablesOrgType.value||"","X-Salesforce-User-Id":r.userId.value||"","Content-Type":"application/json"});async function b(S,I="ACTIVE"){if(!S)throw new Error("getPlaybookByKey: 'key' is required");try{const R=`${r.composablesApiUrl.value}/playbooks/getPlaybookByKey/${S}?versionType=${I}`,z=await fetch(R,{method:"GET",headers:f()});if(!z.ok)throw new Error(`Playbook fetch failed: ${z.status}`);const $=await z.json();return l.value=$.data??null,console.log("[playbook] currentPlaybook",l.value),$}catch(R){if(console.warn("[playbook] Falling back to bundled DXP playbook due to fetch error:",(R==null?void 0:R.message)||R),S==="PB_DXP_001")return l.value=S7,l.value;throw R}}function p(S){h.value=!!S}function x(S){var R,z;if(!((z=(R=l.value)==null?void 0:R.playBookSteps)!=null&&z.length))return;l.value.playBookSteps.some($=>$.stepName===S||$.name===S)&&(s.value=S)}const g=e.computed(()=>{var I;return(((I=l.value)==null?void 0:I.playBookSteps)||[]).find(R=>R.stepName===s.value)||null});function C({stepName:S,data:I=null}){var W,K,P,N,T,O,F;if(console.log("[playbook:navigateToStep] called",{stepName:S,dataProvided:!!I,data:I}),!((K=(W=l.value)==null?void 0:W.playBookSteps)!=null&&K.length)){console.info("[navigateToStep] No playbook steps available, aborting navigation.");return}if(!S){console.info("[navigateToStep] No stepName provided, aborting navigation.");return}const R=l.value.playBookSteps;console.info("[navigateToStep] Steps available:",JSON.stringify(R.map(q=>q.stepName||q.name)));const z=R.findIndex(q=>q.stepName===S||q.name===S);if(z<0){console.info(`[Warn] [navigateToStep] No step found for stepName "${S}".`);return}const $=R[z];if(console.log("[playbook:navigateToStep] target step resolved",{targetIndex:z,targetStepName:($==null?void 0:$.stepName)||($==null?void 0:$.name),stepComponent:$==null?void 0:$.stepComponent}),$!=null&&$.stepComponent&&Ei.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 q=getPreviousValidStep($.stepName);q&&(console.info(`[navigateToStep] Valid step to return to: "${q}".`),setDataToLocalStorage({stepName:q,pbUniqueId:(P=l.value)==null?void 0:P.pbUniqueId}))}let X=!1;for(let q=z;q>=0;q--){const M=R[q],U=M==null?void 0:M.stepComponent;if(console.info(`[navigateToStep] Checking step[${q}]:`,M),!U){console.info(`[navigateToStep] Step[${q}] has no component, skipping.`);continue}if(Array.isArray(Ei)&&Ei.includes(U)){console.info(`[navigateToStep] Step[${q}] component "${U}" is in NON_COMPONENTS, skipping.`);continue}s.value=M.stepName??S,console.info(`[navigateToStep] Navigating to step[${q}] "${s.value}" with component "${U}".`);let L=I;const j=String(U||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),H=!!((T=(N=L==null?void 0:L.payload)==null?void 0:N.savedProducts)!=null&&T.length)||((F=(O=L==null?void 0:L.payload)==null?void 0:O.productConfiguration)==null?void 0:F.length)>0;if(j==="configurator"&&!H)try{const Z=typeof n.getTopConfigurableItem=="function"?n.getTopConfigurableItem():null;if(Z){const te=Z.XX_ORD1__Item__c||Z.xx_ord1__item__c||Z.itemId||"",ne=Z.Id||Z.id||"";te&&(L={payload:{savedProducts:[ne?{itemId:te,qliId:ne}:{itemId:te}]}})}}catch(Z){console.info("[navigateToStep] Unable to auto-select configurable item:",(Z==null?void 0:Z.message)||Z)}console.log("[playbook:navigateToStep] final navigation payload",{currentStepName:s.value,stepComponent:U,hasPayload:!!L,payload:L}),w({XX_ORD1__Completed_PB_Step_Number_EX__c:String(q),XX_ORD1__Playbook_Current_Step_Meta_EX__c:JSON.stringify(L)}),E(U,L),X=!0;break}X||console.info(`[Warn] [navigateToStep] Could not find a valid component step to navigate to starting from stepName "${S}".`),console.log("[playbook:navigateToStep] completed",{navigated:X,toStep:s.value})}function _(S){var X,W,K;const I=((X=l.value)==null?void 0:X.playBookSteps)||[];if(!I.length)return;const R=I.findIndex(P=>P.stepName===s.value);if(R<0)return;if(!(Array.isArray((W=I[R])==null?void 0:W.beans)&&I[R].beans.some(P=>(P==null?void 0:P.beanName)===S))){console.info(`[navigateToBean] Bean "${S}" not found in current step "${(K=I[R])==null?void 0:K.stepName}".`);return}const $=I[R+1];$!=null&&$.stepName&&C({stepName:$.stepName})}function E(S,I=null){var X,W,K,P,N,T,O,F,q,M,U,L,j,H,Z,te,ne;console.log("[playbook:loadComponent] called",{stepComponent:S,dataProvided:!!I,data:I});const R=A(S);console.log("[playbook:loadComponent] resolved route path",{path:R});function z(Q){try{return(typeof window<"u"&&window.location.hash||"").replace(/^#/,"")===Q}catch{return!1}}const $=String(S||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");if(h.value){console.log("[playbook:loadComponent] embeddedMode active, skipping route",{normalized:$,payloadProvided:!!I}),d.value=$,console.log("[playbook] activeComponentKey",d.value),console.log("[playbook] activeComponentData",I),m.value=I||null;return}if(R)try{if(((I==null?void 0:I.actionFunction)==="Reload"||R==="/quote-item")&&(console.info("[playbook] Reloading quote line items..."),console.log("Reloading configurator 4"),quoteStore.fetchAllQuoteLineItems().then(()=>{console.info("[playbook] Quote line items reloaded...")})),R==="/configurator")if(console.log("[playbook:loadComponent] navigating to configurator",{hasProductConfiguration:((W=(X=I==null?void 0:I.payload)==null?void 0:X.productConfiguration)==null?void 0:W.length)>0,hasSavedProducts:((P=(K=I==null?void 0:I.payload)==null?void 0:K.savedProducts)==null?void 0:P.length)>0,isReload:(I==null?void 0:I.actionFunction)==="Reload"}),((T=(N=I==null?void 0:I.payload)==null?void 0:N.productConfiguration)==null?void 0:T.length)>0){const Q=(O=I==null?void 0:I.payload)==null?void 0:O.productConfiguration[0],ce=(Q==null?void 0:Q.itemId)||((F=Q==null?void 0:Q.product)==null?void 0:F.itemId)||"";o.setPreConfigData(I==null?void 0:I.payload,ce);const ue=`/configurator/${ce}`;z(ue)||router.push(ue);return}else if(((M=(q=I==null?void 0:I.payload)==null?void 0:q.savedProducts)==null?void 0:M.length)>0){const Q=(U=I==null?void 0:I.payload)==null?void 0:U.savedProducts[0].itemId,ce=(L=I==null?void 0:I.payload)==null?void 0:L.savedProducts[0].qliId,ue=`/configurator/${Q}/${ce}`;z(ue)||router.push(ue);return}else if((I==null?void 0:I.actionFunction)==="Reload"){console.log("Reloading configurator 5"),o.refresh();return}else{const ue=[...((j=quoteStore.allQLIData)==null?void 0:j.lineItems)??[]].sort((pe,ie)=>{const de=_e=>_e.xx_ord1__sys_configuration_status2__c==="Needs Configuration"?1:_e.xx_ord1__sys_configuration_status2__c==="Suggests Configuration"?2:3;return de(pe)-de(ie)}).filter(pe=>pe.xx_ord1__sys_configuration_status2__c!=="No Configuration");if(ue.length){const pe=ue[0],ie=`/configurator/${pe.xx_ord1__item__c}${pe.id?`/${pe.id}`:""}`;z(ie)||router.push(ie)}else t.handleWarning("No items needing configuration");return}else R==="/adaptive-search"&&((H=I==null?void 0:I.payload)!=null&&H.adaptiveSearch)?(console.log("[playbook:loadComponent] navigating to adaptive-search",{hasPayload:!!((Z=I==null?void 0:I.payload)!=null&&Z.adaptiveSearch)}),adaptiveSearch.createLstItems(I==null?void 0:I.payload.adaptiveSearch)):R==="/quote-item"&&I?(console.log("[playbook:loadComponent] navigating to quote-item with data"),quoteStore.performAIAction(I)):R==="/match-records"&&((te=I==null?void 0:I.payload)!=null&&te.quickSelection)&&(console.log("[playbook:loadComponent] navigating to match-records",{hasQuickSelection:!!((ne=I==null?void 0:I.payload)!=null&&ne.quickSelection)}),quickSelectionStore.quickSelectionLayout=I.payload);z(R)||router.push(R),console.log("[playbook:loadComponent] route push called",{path:R})}catch(Q){t.handleError(Q,"playbookStore.loadComponent")}}function A(S){var z;const I=String(S||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),R={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(I==="quote_document"){const $=getPreviousValidStep(s.value);return $&&setDataToLocalStorage({stepName:$,pbUniqueId:(z=l.value)==null?void 0:z.pbUniqueId}),goToQuoteDocument(),null}return R[I]||"/quote-item"}function k(){var S;return((S=g.value)==null?void 0:S.beans)??[]}function B(){return k().map(I=>({action:`playbookNavigate:${I.beanName}`,label:I.beanName,disabled:!!I.disable}))}async function D(){var S;try{const I=((S=r.quoteId)==null?void 0:S.value)||"";if(!I)return console.info("getPlaybookInfoFromQuote: Missing Quote Id"),null;const R=`${r.composablesApiUrl.value}/platform/getHeaderRecord`,z={recordId:I,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(R,{method:"POST",headers:f(),body:JSON.stringify(z)})).json()).data}catch(I){return t.handleError(I,"playbookStore.getPlaybookInfoFromQuote"),null}}async function w(S={}){var I;try{const R=((I=r.quoteId)==null?void 0:I.value)||Jr("id")||"";if(!R)return console.info("addPlaybookInfoToQuote: Missing Quote Id"),null;const z={Id:R,...S},$=Object.entries(z).map(([N,T])=>({fieldName:N,fieldValue:T})),X=`${r.composablesApiUrl.value}/platform/upsertRecords`,W={objectType:"XX_ORD1__Quote__c",uniqueField:"Id",records:[{fields:$}]},P=await(await fetch(X,{method:"POST",headers:f(),body:JSON.stringify(W)})).json();return console.info("[playbook] addPlaybookInfoToQuote response:",JSON.stringify(P)),P}catch(R){return t.handleError(R,"playbookStore.addPlaybookInfoToQuote"),null}}async function v(){var S;try{const I=`${r.composablesApiUrl.value}/product-pricing/findCatalogInContext?accountId=${r.accountId.value}&catalogType=Primary&catalogLookupFieldName=Primary_Catalog__c`,z=await(await fetch(I,{method:"GET",headers:f()})).json();return(S=z==null?void 0:z.data)==null?void 0:S.catalogId}catch(I){return t.handleError(I,"playbookStore.getCatalogInContext"),null}}return{playbookData:a,currentPlaybook:l,currentStepName:s,currentStep:g,playbookStepsMode:i,showPlaybookSteps:u,embeddedMode:h,activeComponentKey:d,activeComponentData:m,setSecretKey:y,getPlaybookByKey:b,setCurrentStepName:x,navigateToStep:C,navigateToBean:_,loadComponent:E,setEmbeddedMode:p,getCurrentStepLinks:B,addPlaybookInfoToQuote:w,getPlaybookInfoFromQuote:D,getCatalogInContext:v}}),ki={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"},Hc={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"},B7=t=>{var n;let r=[];for(let o of t)if(o.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(o.includes(".")){let i=o.split(".")[0];i=i.slice(0,-1)+"c";const l=((n=ki[i==null?void 0:i.toLowerCase()])==null?void 0:n.trim())||"";l&&(r.includes(l)||r.push(l||""),r.push(o))}else r.includes(ki[o==null?void 0:o.toLowerCase()])||r.push(ki[o==null?void 0:o.toLowerCase()]||"");return r.filter(o=>o!=="")},Gc=it.defineStore("actions",()=>{const t=Un(),r=$n(),n=e.ref(!1);return{openAdaptiveSearch:(s,u=!1)=>{console.info("openAdaptiveSearch",s),t.chatHistory[t.chatHistory.length-1].links=[],t.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),n.value=u},openQuoteItem:s=>{console.info("openQuoteItem",s),t.chatHistory[t.chatHistory.length-1].links=[],t.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),t.chatHistory[t.chatHistory.length-1].links=[],t.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const h=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${r.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${$0(window.location.href)}${h}`},undo:()=>{const s=t==null?void 0:t.latestDMLRequest;t.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:n}}),Kc=it.defineStore("adaptiveSearch",()=>{const t=$n(),r=wo(),n=Un(),o=Gc(),a=e.ref(null),i=e.ref(null),l=e.ref(!1),s=e.ref(!1),u=e.ref([]),h=e.ref(""),d=e.ref(!1),m=e.ref(null),c=e.ref(!1),y=e.ref([]),f=Mt(),b=e.ref([]),p=e.ref(0),x=e.ref(!1),g=e.ref({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function C(){l.value=!0;try{const N=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let T={};return T=await window.salesforceConnector.getDynamicPageLayout(N),i.value=Cl(T,"Unable to find the Search Selection Layout for your user profile"),g.value.rowLimt=i.value.configuration.rowLimit||10,i.value.configuration.columns.forEach(O=>{!O.field&&O.label==="QTY"&&(O.field="xx_ord1__qty__c")}),l.value=!1,_(),T}catch(N){l.value=!1,f.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",N)}}function _(){var N,T,O;m.value=(O=(T=(N=i.value)==null?void 0:N.configuration)==null?void 0:T.dynamicFilters)==null?void 0:O.filters.map(F=>({...F,field:F.field.toLowerCase(),filtervalue:F.filtervalue||[],filtervaluefrom:F.filtervaluefrom||"",filtervalueTo:F.filtervalueTo||""}))}function E(){var T;let N=[];for(const O of i.value.configuration.columns){let F=O.field;if(N.includes(F)||N.push(F),F!=null&&F.includes(".")){let M=F.split(".")[0];M=M.slice(0,-1)+"c",N.includes(M)||N.push(M)}}return(T=i.value.configuration)!=null&&T.cardHeader&&N.push(i.value.configuration.cardHeader.imageField),i.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&N.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),N=N.filter(O=>!!O),N.filter(O=>O.toLowerCase()!=="xx_ord1__qty__c"&&O.toLowerCase()!=="xx_ord1__competitor_sku__c")}function A(N,T=!1){if(!N||N.includes("undefined"))return!1;const O=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(T){const F=Array.isArray(N)?N:N.split(",");for(const q of F){const M=q.trim();if(O.test(M))return f.handleError(`Invalid character found in value: ${M}`),!1}}else if(O.test(N))return f.handleError("Special characters are not allowed in filter values"),!1;return!0}function k(N,T){return{field:N.field,operator:N.operator||"contains",value:T,dataType:N.dataType.trim()}}function B(N){if(!N.filtervalue)return null;const T=Array.isArray(N.filtervalue),O=T?N.filtervalue.join(","):N.filtervalue.trim();return A(O,T)?O:null}function D(N){var q,M;const T=(q=N.filtervaluefrom)==null?void 0:q.trim(),O=(M=N.filtervalueTo)==null?void 0:M.trim();if(!T||!O)return null;const F=`${T}, ${O}`;return F!==", "&&A(F)?F:null}function w(N){const T=`${_l(N.filtervaluefrom)}, ${_l(N.filtervalueTo)}`;return T!==", "&&A(T)?T:null}function v(N){var O;const T=(O=N.filtervaluefrom)==null?void 0:O.trim();return A(T)?T:null}function S(N){const T=[];return N.forEach(O=>{const F=O.dataType.trim();let q=null;switch(F){case"PICKLIST":case"MULTIPICKLIST":q=B(O);break;case"DOUBLE":case"CURRENCY":q=D(O);break;case"DATETIME":case"DATE":q=w(O);break;default:q=v(O)}q&&T.push(k(O,q))}),y.value=T,T}async function I(N="",T=[],O=[]){var q,M,U,L,j,H,Z,te,ne,Q;let F=[];if(T.length&&(F=S(T)),!F.length&&N.trim()===""){u.value=[],d.value=!1;return}try{d.value=!1,s.value=!0;const ce=N.trim();O.length||(O=E());const ue={fields:O,...T.length?{dynamicFilters:F}:{},searchText:ce||h.value.trim(),accountId:r.accountId,...r.eCatalogId?{catalogId:r.eCatalogId}:{},...r.objectType==="opportunity"?{opportunityId:r.id}:{},...(M=(q=i.value)==null?void 0:q.configuration)!=null&&M.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:(L=(U=i.value)==null?void 0:U.configuration)==null?void 0:L.rowLimit,paging:(H=(j=i.value)==null?void 0:j.configuration)==null?void 0:H.paging,...((Z=g.value)==null?void 0:Z.offset)!==0?{offset:g.value.offset}:{},objectName:(ne=(te=i.value)==null?void 0:te.configuration)==null?void 0:ne.objectName,currencyCode:r.currencyCode},pe=await window.salesforceConnector.getItems(JSON.stringify(ue));if(pe!=null&&pe.errorMessage){f.handleError(pe.errorMessage);return}pe!=null&&pe.itemCount&&(g.value.totalPages=Math.ceil((pe==null?void 0:pe.itemCount)/g.value.rowLimt)),u.value=Xo(pe.lstItems,{xx_ord1__qty__c:"1"}),(Q=pe.lstItems)!=null&&Q.length||(d.value=!0),s.value=!1}catch(ce){f.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",ce)}}async function R(N){try{c.value=!0;const T=JSON.stringify({lstQLIRequest:z(N),quoteId:t.quoteId});let O=await window.salesforceConnector.createQLI(T);typeof O=="string"&&(O=JSON.parse(O));let F=!1;if((O==null?void 0:O.length)>0&&O.forEach(q=>{q.errorMessage&&(F=!0,f.handleError(q.errorMessage))}),c.value=!1,F){b.value=O;const q=b.value.reduce((M,U)=>(M[U.eCatalogItemId]=U.errorMessage,M),{});u.value=u.value.map(M=>({...M,backendError:q[M.Id]||""}));return}return O}catch(T){f.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",T)}}function z(N){const T=[];for(const O of N)if(!O.addedToQuote&&O.id){const F=$(O);p.value++,T.push({fields:F,recordId:O.id,...N.length===1?{maxSequenceNumber:p.value}:{}})}return T}function $(N){const T=[],O=X();return Object.keys(N).forEach(F=>{if(O.includes(F)){const q=Hc[F.toLowerCase()];q&&T.push({fieldname:q,value:N[F]})}}),T}function X(){const N=[];return i.value.configuration.columns.forEach(T=>{T.field&&!T.field.includes(".")&&T.isEditable&&T.visible&&N.push(T.field)}),N}function W(){var T,O;const N=[];return i.value.configuration.columns.forEach(F=>{const q=F.field.toLowerCase();N.includes(q)||N.push(q)}),(T=i.value.configuration)!=null&&T.dynamicFilters&&i.value.configuration.dynamicFilters.filters.forEach(F=>{const q=F.field.toLowerCase();N.includes(q)||N.push(q)}),(O=i.value.configuration)!=null&&O.cardHeader&&N.push(i.value.configuration.cardHeader.imageField),N}async function K(){var O;const N=W(),T=((O=i.value.configuration)==null?void 0:O.saveObjectName)||i.value.configuration.objectName;if(T==="xx_ord1__ecatalog_item__c"){const F=N.indexOf("xx_ord1__qty__c");F>-1&&N.splice(F,1)}await t.getFieldsData(N,T),t.fieldsData.xx_ord1__qty__c||t.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function P({searchTerm:N="",filters:T=[]}={}){if(x.value=!0,N&&(h.value=N),T.length&&(y.value=T),await C()){await K(),x.value=!1;const F=h.value;F&&(h.value=F,await I(F,t.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",o.isStaticActionCall),o.isStaticActionCall&&(o.isStaticActionCall=!1,n.chatHistory[n.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"}]})}x.value=!1}return{selectedItem:a,AdaptiveSearchLayout:i,searchText:h,loadingAdaptiveLayout:l,getAdaptiveSearchLayout:C,getItems:I,lstItems:u,rowItemsLoading:s,noSearchRecords:d,dynamicFilters:m,setDynamicFilters:_,createQliErrors:b,addToQuote:R,addingToQuote:c,getFieldsData:K,pagingData:g,appliedDynamicFilters:y,maxSequenceNumber:p,loadingAdaptiveSearch:x,initAdaptiveSearch:P}}),I7="XX_ORD1__Quote__c",T7="xxord1salespricec",Sr="xx_ord1__item__c",O7="xxord1productnrcc",D7=it.defineStore("cartStore",()=>{const t=$n(),r=Kc(),n=Mt(),o=e.ref(""),a=e.ref("$0"),i=e.ref("$0"),l=e.ref(null),s=e.ref({}),u=e.ref({}),h=e.ref({}),d=e.ref(""),m=e.ref(""),c=e.ref({}),y=e.ref(""),f=e.ref(""),b=e.ref({});async function p(){A()}async function x(){try{let D=await window.salesforceConnector.getProductCount(t.quoteId);if(D=Tt(D),D!=null&&D.errorMessage){n.handleError(D.errorMessage);return}return o.value=D,D}catch{n.handleError("Failed to get Product Count. Please try again.")}}async function g(){try{let D=await window.salesforceConnector.getQuoteTotal(t.quoteId);if(D=Tt(D),D!=null&&D.errorMessage){n.handleError(D.errorMessage);return}return i.value=D.monthlyTotal,a.value=D.onetimeTotal,D}catch{n.handleError("Failed to get Total Amount. Please try again.")}}async function C(D,w,v,S=""){if(!t.sectionDataMap.get(v).parentQLIs[w].removingItem){t.sectionDataMap.get(v).parentQLIs[w].removingItem=!0,f.value=D.id,await _(D.id)==="Success"&&(t.fetchAllQuoteLineItems(),S&&S(D,w,v));let R=t.sectionDataMap.get(v).parentQLIs.filter(z=>z[Sr]===D[Sr]).length;f.value="",r.lstItems.forEach(z=>{z[Sr]===D[Sr]&&(z.addedToQuote===!0&&(z.addedToQuote=!1),R===0&&(z.removedFromQuote=!0))})}}async function _(D){try{let w=await window.salesforceConnector.deleteQLI(D);if(w!=null&&w.errorMessage){n.handleError(w.errorMessage);return}return x(),g(),w}catch{n.handleError("Failed to remove Quote Item. Please try again.")}}function E(D){var S,I;const w=(S=D==null?void 0:D[O7])==null?void 0:S.match(/\.\d+/);w&&(w.value=w[0].length-1);const v=(I=D==null?void 0:D[T7])==null?void 0:I.match(/\.\d+/);return v&&(v.value=v[0].length-1),w||v}function A(D=!0){x(),g(),D&&t.fetchTemplates(I7).then(()=>{t.getFilteredListWithFields()})}function k(D){const w=t.sectionDataMap;for(const[,v]of w.entries())v.parentQLIs.forEach(S=>{S.id===D.id&&(v.columns.forEach(I=>{if(I.dataType==="CURRENCY"){const R=I.field.replace(/_/g,"");S[R]=B(S[R],D[I.field])}}),D!=null&&D.billingPeriodValue&&(D!=null&&D.formattedBillingPeriodValue)&&(S.formattedBillingPeriodValue=B(S.formattedBillingPeriodValue,D.billingPeriodValue)),D!=null&&D.oneTimeValue&&(D!=null&&D.formattedOneTimeValue)&&(S.formattedOneTimeValue=B(S.formattedOneTimeValue,D.oneTimeValue)))})}function B(D,w){const v=Number(w);if(isNaN(v))return D;const S=D.match(/(\d[\d,]*)(\.\d+)?/);if(!S)return D;const I=S[2]||"",R=I.length?I.length-1:0,z=v.toLocaleString("en-US",{minimumFractionDigits:R,maximumFractionDigits:R});return D.replace(S[1]+I,z)}return{initializeCart:p,loadCartState:A,productCount:o,onetimeTotal:a,monthlyTotal:i,filterCartItem:l,billingPeriodValue:d,hasOneTimeValue:m,hasBillingPeriodInList:s,oneTimeFieldAvailable:u,billingPeriodFieldAvailable:h,priceDecimalPrecision:c,cartItemUpdatingId:y,removingItemLoaderId:f,cartItemColumnsMap:b,getProductCount:x,getQuoteTotal:g,removeItem:C,removeQuoteItem:_,getDecimalPrecisionFromSalesPriceOrNRC:E,updateFormattedValues:k,formateCurrencyValue:B}}),V7=t=>[{title:"Apply Discount",subOptions:[...t.map(r=>`Apply Discount on ${r} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...t.map(r=>`Apply Discount on ${r} 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"]}],F7={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"}]},M7=[{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"]}],$n=it.defineStore("quote",()=>{const t=Mt(),r=D7(),n=wo(),o=e.ref(""),a=e.ref(""),i=e.ref(0),l=e.ref(""),s=e.ref([]),u=e.ref({template:!0,filteredList:!1}),h=e.ref(null),d=e.ref(new Map),m=e.ref({}),c=e.ref(!1),y=e.ref(!0),f=e.ref(!1),b=e.ref({text:"Hide Options",altText:"Show Options",handler:()=>{y.value=!y.value,B()},color:"#136E05",isActive:!1}),p=e.computed(()=>{const P=Array.from(d.value.values()).map(N=>N.sectionName);return V7(P)});e.watch(l,()=>{u.value.template||k()});function x(){const P=new Map,N=[];for(const[O,F]of d.value.entries())P.set(O,F.selected),N.push(F);const T=JSON.parse(JSON.stringify(N));return T.forEach(O=>{delete O.selected;const F=new Map,q=[];O.lineItems.forEach(M=>{M.Selected=P.get(O.tableId).get(M.id)||!1,M.xx_ord1__parent_qli__c?(F.has(M.xx_ord1__parent_qli__c)||F.set(M.xx_ord1__parent_qli__c,[]),F.get(M.xx_ord1__parent_qli__c).push(M)):q.push(M)}),O.lineItems=q.map(M=>({...M,options:F.get(M.id)||[]})),delete O.loading,delete O.parentQLIs,delete O.totalValues}),{showOptions:y.value,sections:T,templateId:l.value}}async function g(P){try{let N=await window.salesforceConnector.getPrimaryQuote(P);N=Tt(N),N!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(N)),o.value=N.recordId,console.info("quoteId",o.value),a.value=N.name,l.value=N==null?void 0:N.templateId,i.value=(N==null?void 0:N.lineItemsCount)||0)}catch(N){t.handleError(N.message),console.info("[ERROR]: getPrimaryQuote() error = ",N)}}async function C(P){var N,T;try{u.value.template=!0;let O=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[P],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));O=Tt(O);const F=O==null?void 0:O.templates[P];return l.value||(l.value=(N=F.find(q=>q.XX_ORD1__Default__c))==null?void 0:N.Id),l.value||(l.value=(T=F[0])==null?void 0:T.Id),s.value=F,u.value.template=!1,s.value}catch(O){t.handleError(O.message),console.info("[ERROR]: fetchTemplates() error = ",O)}}function _(P){if(!P)return null;const N=/\{!\$(\w+):([\w.]+)\}/,T=P.match(N);return T?{function:T[1],apiname:T[2].split(".")[1]}:null}async function E(P){try{const N={Id:o.value,XX_ORD1__Document_Template__c:P};return await window.salesforceConnector.updateQuote(JSON.stringify([N]))}catch(N){t.handleError(N.message),console.info("[ERROR]: updateQuote() error = ",N)}}async function A(){try{u.value.filteredList=!0;let P=await window.salesforceConnector.getQuoteEPageLayout();d.value.clear(),r.cartItemColumnsMap={},P=Tt(P);const N=P.map(O=>({label:O.fieldLabel,field:O.fieldName.toLowerCase(),isEditable:O.isEditable,dataType:O.dataType,...O.picklistValues?{picklistValues:O.picklistValues}:{}})),T=vn();return d.value.set(T,{loading:!0,lineItems:[],parentQLIs:[],columns:N,tableId:T,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),r.cartItemColumnsMap[T]=N,b.value.isActive=!1,y.value=!0,h.value={lstCB:[{columns:N,footer:null,title:"All Rows",sectionName:"All Rows",tableId:T,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},B(),u.value.filteredList=!1,P}catch(P){t.handleError(P.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",P)}}async function k(){if(s.value.length===0){A();return}try{u.value.filteredList=!0;let P=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:l.value}));E(l.value),P=Tt(P),console.info("res.lstCB = ",P.lstCB);const N=P==null?void 0:P.objectFieldsMap;return d.value.clear(),r.cartItemColumnsMap={},P.lstCB=P.lstCB.map(T=>{const{fields:O,filters:F,primarysort:q,primarysortdesc:M}=JSON.parse(T.XX_ORD1__Block_Properties__c),U=O.map(j=>{var H;return{label:(H=N[j.api])==null?void 0:H.label,field:j.api.toLowerCase(),isEditable:j.api.includes(".")?!1:N[j.api].isEditable,dataType:N[j.api].dataType,...N[j.api].picklistValues?{picklistValues:N[j.api].picklistValues}:{}}}),L=T.Id||vn();return d.value.set(L,{loading:!0,lineItems:[],parentQLIs:[],columns:U,tableId:L,sectionName:T.Name,selected:new Map,footer:_(T.XX_ORD1__Table_Footer_HTML__c),filters:F,primarysort:q,primarysortdesc:M}),r.cartItemColumnsMap[L]=U,b.value.isActive=!1,y.value=!0,{columns:U,footer:_(T.XX_ORD1__Table_Footer_HTML__c),title:T.Name,sectionName:T.Name,tableId:L,filters:F,primarysort:q,primarysortdesc:M}}),h.value=P,B(),u.value.filteredList=!1,P}catch(P){t.handleError(P.message),console.info("[ERROR]: getFilteredListWithFields() error = ",P)}}async function B(P=!0){const N=[];for(const[T]of d.value)N.push(v(T,P));return await Promise.all(N),r.getProductCount(),!0}function D(P,N){return d.value.get(P).columns.some(T=>T.field.toLowerCase()===N)||r.cartItemColumnsMap[P].some(T=>T.field.toLowerCase()===N)}function w(P,N){let T=Xo(P);const O=n.pricingSchema,F=D(N,"xx_ord1__nrc__c"),q=D(N,"xx_ord1__sales_price__c"),M=D(N,"xx_ord1__qty__c");return T=T.map(U=>{let L={};O==="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?L={...q?{billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}:{},...F?{oneTimeValue:(U==null?void 0:U.xx_ord1__nrc__c)===0?"0":(U==null?void 0:U.xx_ord1__nrc__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1nrcc}:{}}:O==="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)?q&&(L={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec}):O!=="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?q&&(L={billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}):O!=="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)&&q&&(L={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?0:(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec});const{xx_ord1__qty__c:j,xx_ord1__sales_price__c:H,xx_ord1__nrc__c:Z,...te}=U,ne={...te,id:U.id,description:(U==null?void 0:U.xx_ord1__line_description__c)||"",xx_ord1__billing_period__c:U==null?void 0:U.xx_ord1__billing_period__c,...M?{xx_ord1__qty__c:j}:{},xx_ord1__item__c:U==null?void 0:U.xx_ord1__item__c,"xx_ord1__item__r.xx_ord1__decimal_precision__c":U["xx_ord1__item__r.xx_ord1__decimal_precision__c"]||"0",...L};return ne!=null&&ne.billingPeriodValue&&(r.hasBillingPeriodInList[N]=!0,r.billingPeriodValue=ne==null?void 0:ne.xx_ord1__billing_period__c),"oneTimeValue"in ne&&(r.oneTimeFieldAvailable[N]=!0),"billingPeriodValue"in ne&&(r.billingPeriodFieldAvailable[N]=!0),(ne==null?void 0:ne.oneTimeValue)!==""&&(ne==null?void 0:ne.oneTimeValue)!==null&&(r.hasOneTimeValue=!0),ne}),T}async function v(P,N=!0){var T,O;try{const F=d.value.get(P);if(console.info("sectionData = ",F.sectionName),!F)return;F.loading=N,N&&(F.lineItems=[]);const{columns:q,filters:M,primarysort:U,primarysortdesc:L,footer:j}=F,H=q.map(pe=>pe.field.toLowerCase());H.includes("xx_ord1__parent_qli__c")||H.push("xx_ord1__parent_qli__c"),H.includes("xx_ord1__item__c")||H.push("xx_ord1__item__c"),H.includes("xx_ord1__sys_configuration_status2__c")||H.push("xx_ord1__sys_configuration_status2__c"),(T=r.cartItemColumnsMap[P])==null||T.forEach(pe=>{H.includes(pe.field)||H.push(pe.field)});const Z=await S({fields:H,recordId:o.value,filters:M||[],primarySortBy:U||"",primarySortOrder:L?"DESC":"ASC",includeOptions:y.value,totalFields:j?[j.apiname]:[]}),te=Z.lineItems,ne=new Map;let Q=[];const ce=(O=Z.fieldTotals)==null?void 0:O.map(pe=>pe.totalValue);te.forEach(pe=>{pe.XX_ORD1__Parent_QLI__c?ne.has(pe.XX_ORD1__Parent_QLI__c)?ne.get(pe.XX_ORD1__Parent_QLI__c).push(pe):ne.set(pe.XX_ORD1__Parent_QLI__c,[pe]):Q.push(pe)});const ue=[];return Q.forEach(pe=>{ue.push(pe),ne.has(pe.Id)&&ue.push(...ne.get(pe.Id))}),Q=w(Q,P),F.lineItems=Xo(ue),F.parentQLIs=Q,F.totalValues=ce,F.loading=!1,d.value=new Map(d.value),ue}catch(F){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",F.message);const q=d.value.get(P);q&&(q.loading=!1)}}async function S(P){try{let N=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(P));return N=Tt(N),N}catch(N){t.handleError(N.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",N)}}async function I(P){try{console.info("updateQli() payload = ",P);let N=await window.salesforceConnector.updateQli(JSON.stringify(P));return N=Tt(N),B(!1),N}catch(N){t.handleError(N.message),console.info("[ERROR]: updateQli() error = ",N)}}async function R(P){try{let N=await window.salesforceConnector.deleteQLI(P);return N=Tt(N),B(),N}catch(N){t.handleError(N.message),console.info("[ERROR]: deleteQLI() error = ",N)}}async function z(P,N){try{c.value=!0;const T={fields:P};N&&(T.objectName=N),P.includes("xx_ord1__qty__c")&&N==="xx_ord1__ecatalog_item__c"&&(T.fields=T.fields.filter(F=>F!=="xx_ord1__qty__c")),P.includes("xx_ord1__sales_price__c")&&N!=="xx_ord1__quote_line_item__c"&&(T.fields=T.fields.filter(F=>F!=="xx_ord1__sales_price__c"));let O=await window.salesforceConnector.getFieldsData(JSON.stringify(T));return typeof O=="string"&&(O=JSON.parse(O)),O!=null&&O.errorMessage?(t.handleError(O.errorMessage),null):(m.value={...m.value,...O},console.info("fieldsData.value = ",JSON.stringify(m.value)),O)}catch(T){return t.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",T),null}finally{c.value=!1}}function $(P=""){var N;return!P||P.includes(".")?!1:P.includes("xx_ord1__qty__c")?!0:((N=m.value[P])==null?void 0:N.isEditable)||!1}function X(){W(F7)}async function W(P){var N,T,O,F,q,M,U,L,j;if(P.payload){if((N=P.payload)!=null&&N.uiModification){const H=P.payload.uiModification;if(((T=H.addColumn)==null?void 0:T.length)>0)if(H.addColumn.forEach(Z=>{Z.columns.forEach(te=>{te.field=te.field.toLowerCase()})}),H.addColumn[0].sectionName==="all_section")for(const[Z,te]of d.value)te.columns=[...te.columns,...H.addColumn[0].columns];else H.addColumn.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).columns=[...d.value.get(Z.tableId).columns,...Z.columns])});if(((O=H.removeColumn)==null?void 0:O.length)>0)if(H.removeColumn.forEach(Z=>{Z.columns=Z.columns.map(te=>te.toLowerCase())}),H.removeColumn[0].sectionName==="all_section")for(const[Z,te]of d.value)te.columns=te.columns.filter(ne=>!H.removeColumn[0].columns.includes(ne.field));else H.removeColumn.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).columns=d.value.get(Z.tableId).columns.filter(te=>!Z.columns.includes(te.field)))});if(((F=H.filter)==null?void 0:F.length)>0)if(H.filter[0].sectionName==="all_section")for(const[Z,te]of d.value)te.filters=[...te.filters,...H.filter[0].filters];else H.filter.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).filters=[...d.value.get(Z.tableId).filters,...Z.filters])});if(((q=H.groupBy)==null?void 0:q.length)>0){const Z=((M=[...d.value.values()][0])==null?void 0:M.columns)||M7;d.value.clear(),r.cartItemColumnsMap={},H.groupBy.forEach(te=>{r.cartItemColumnsMap[te.tableId]=te.columns||Z,d.value.set(te.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:te.columns||Z,tableId:te.tableId,sectionName:te.sectionName,selected:new Map,footer:_(te.footer),filters:te.filters,primarysort:te.primarysort,primarysortdesc:te.primarysortdesc})})}H.showOptions!==void 0&&(y.value=H.showOptions)}if(((L=(U=P.payload)==null?void 0:U.sections)==null?void 0:L.length)>0){const H=(j=P.payload)==null?void 0:j.sections;d.value.clear(),H.forEach(Z=>{Z.tableId||(Z.tableId=vn()),Z.selected=new Map,d.value.set(Z.tableId,Z)}),B()}}P.actionFunction==="Reload"&&(console.log("Reloading configurator 3"),B(),console.info("Reloading quote line items"))}async function K(P){var N,T;try{const O=new Set;for(const F of d.value.keys())(N=d.value.get(F).lineItems)==null||N.forEach(M=>{M.attributes=null,O.add(M.id)});if(P){const F={lineItemIds:[...O]},q=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(F)}),M=JSON.parse(q.data);for(const U of d.value.keys())(T=d.value.get(U).lineItems)==null||T.forEach(j=>{j.attributes=M[j.id]||null})}}catch(O){console.info("[ERROR]: fetchAttributesData() error = ",O)}}return{showAttributes:f,quoteId:o,quoteName:a,templateId:l,templateOptions:s,loading:u,currentTemplateData:h,fieldsData:m,fieldsDataLoading:c,showOptionHeaderButton:b,sectionDataMap:d,promptSuggestions:p,lineItemsCount:i,addColumns:X,getQuoteEPageLayout:A,getPayload:x,getPrimaryQuote:g,fetchTemplates:C,getFilteredListWithFields:k,getQuoteLineItemsWithFilteredTable:S,updateQli:I,getFieldsData:z,deleteQLI:R,performAIAction:W,isEditableField:$,fetchQuoteLineItems:v,fetchAllQuoteLineItems:B,fetchAttributesData:K}}),wo=it.defineStore("comRoot",()=>{const t=Un(),r=Mt(),n=$n(),o=e.ref(""),a=e.ref(""),i=e.ref("Genesis AI"),l=e.ref(""),s=e.ref({}),u=e.ref(""),h=e.ref(""),d=e.ref(""),m=e.ref(""),c=e.ref({}),y=e.ref(""),f=e.ref(""),b=e.ref(""),p=e.ref(""),x=e.ref(""),g=e.ref(""),C=e.ref(""),_=e.ref("Single"),E=e.ref("closed"),A=e.computed(()=>n.quoteName),k=e.computed(()=>_.value==="Single");async function B(S){o.value=S||Jr("id"),a.value=Jr("origin"),await w(),await D()}async function D(){try{console.info("getRecordInfo",o.value);let S=await window.salesforceConnector.getRecordInfo(o.value);return S=Tt(S),S!==void 0&&(c.value=S,y.value=S.name,f.value=S.objectType,b.value=S.accountId,p.value=S.eCatalogId,x.value=S.currencyCode,g.value=S.userLocale,C.value=S.opportunityId),(S==null?void 0:S.objectType)==="XX_ORD1__Quote__c"?(n.quoteId=S==null?void 0:S.recordId,n.templateId=S==null?void 0:S.templateId,n.quoteName=S==null?void 0:S.name,n.lineItemsCount=(S==null?void 0:S.lineItemsCount)||0):(S==null?void 0:S.objectType)==="Opportunity"&&await n.getPrimaryQuote(S.recordId),S}catch(S){r.handleError(S.message)}}async function w(){var I,R;console.info("getOrgInformation",o.value);const S=await window.salesforceConnector.getOrgInformation();t.websocketUrl=S.websocketUrl,l.value=(I=S.locale)==null?void 0:I.replace("_","-"),s.value=S.user,u.value=S.orgName,h.value=S.orgId,d.value=S.orgType,m.value=S.packageVersion,_.value=(R=S==null?void 0:S.pricingSchema)==null?void 0:R.toLowerCase()}function v(S){i.value=S,z0(S)}return{id:o,origin:a,title:A,subTitle:i,locale:l,user:s,orgName:u,orgId:h,orgType:d,packageVersion:m,objectType:f,recordInfo:c,name:y,accountId:b,eCatalogId:p,currencyCode:x,userLocale:g,opportunityId:C,pricingSchema:_,isSinglePricingSchema:k,flyoutState:E,start:B,getRecordInfo:D,setSubTitle:v}}),R7=it.defineStore("quickSelection",()=>{const t=Mt(),r=wo(),n=$n(),o=e.ref(null),a=e.ref(!1),i=e.ref([]),l=e.ref([]),s=e.ref(!1),u=e.ref({}),h=e.ref({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),d=e.ref(!1);async function m(){a.value=!0;try{const E=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...r.objectType?{contextObject:r.objectType}:{}});let A={};A=await window.salesforceConnector.getDynamicPageLayout(E),o.value=Cl(A,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",o.value),h.value.rowLimit=o.value.configuration.rowLimit||10,o.value.data.columns.forEach(k=>{!k.field&&k.label==="QTY"&&(k.field="xx_ord1__qty__c")}),a.value=!1}catch(E){a.value=!1,t.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",E)}}function c(){const E=new Map;return o.value.data.columns.forEach(A=>{E.set(A.field,!0)}),o.value.data.searchResultColumns.forEach(A=>{E.set(A.field,!0)}),Array.from(E.keys())}async function y(E){var A,k;try{let B=await window.salesforceConnector.saveCompetitorSKU(E);if(B!=null&&B.errorMessage){t.handleError(B.errorMessage);return}if((A=B[0])!=null&&A.errorMessage){t.handleError((k=B[0])==null?void 0:k.errorMessage);return}return B}catch(B){t.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",B)}}async function f(E="",A=[]){try{let k=o.value.data,B=o.value.configuration;const D=E.trim();if(console.info("searchTextValue.trim() = ",E.trim()),!D)return[];let w=null;console.info("useMappings = ",d.value),d.value?w=B7(b()):w=b(),console.info("fields before filter = ",w),w=w.filter(R=>R!=="xx_ord1__qty__c"),console.info("fields after filter = ",w);const v={fields:w,...A.length?{dynamicFilters:n.getDynamicFilters(A)}:{},searchText:D,accountId:r.accountId,...r.eCatalogId?{catalogId:r.eCatalogId}:{},...r.objectType==="opportunity"?{opportunityId:r.id}:{},...k!=null&&k.sort?{primarySortBy:k.sort.primary.field,primarySortOrder:k.sort.primary.direction,secondarySortBy:k.sort.secondary.field,secondarySortOrder:k.sort.secondary.direction}:{},rowLimt:(B==null?void 0:B.rowLimit)||20,paging:(B==null?void 0:B.paging)||!1,...h.value.offset!==0?{offset:h.value.offset}:{},objectName:k.objectName,currencyCode:r.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(v));const S=await window.salesforceConnector.getItems(JSON.stringify(v));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(S)),S!=null&&S.errorMessage){t.handleError(S.errorMessage);return}return S!=null&&S.itemCount&&(h.value.totalPages=Math.ceil((S==null?void 0:S.itemCount)/h.value.rowLimit)),Xo(S.lstItems,{xx_ord1__qty__c:"1"})}catch(k){t.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",k)}}function b(){let E=[];for(const A of o.value.data.columns){let k=A.field;if(k!=null&&k.includes(".")){E.includes(k)||E.push(k);let D=k.split(".")[0];D=D.slice(0,-1)+"c",E.includes(D)||E.push(D)}else E.includes(k)||E.push(k)}return console.info("getAllQuickSelectionFields() fields = ",E),E.filter(A=>A.toLowerCase()!=="xx_ord1__qty__c")}async function p(E,A,k,B){console.info("searchText:",JSON.stringify(E)),console.info("row:",JSON.stringify(A)),console.info("rowIndex:",JSON.stringify(k)),console.info("column:",JSON.stringify(B));const D=k+(h.value.currentPage-1)*h.value.rowLimit;if(B.field.toLowerCase().includes("xx_ord1__item__r")){if(i.value[D].itemLookupLoading=!0,d.value=!0,l.value=await f(E),l.value.length>0){const w=[];for(let v=0;v<l.value.length;v++)i.value[D].itemDataRetrieved=!0,l.value[v].xx_ord1__item__c&&w.push({name:l.value[v]["xx_ord1__item__r.name"],value:l.value[v].xx_ord1__item__c,label:l.value[v][B.field.toLowerCase()]});i.value[D][B.field.toLowerCase()+"_options"]=w}i.value[D].itemLookupLoading=!1}else if(B.field.toLowerCase().includes("xx_ord1__competitor_item__r")){i.value[D].competitorLookupLoading=!0;const w=await x(E);w!=null&&w.items&&(i.value[D][B.field.toLowerCase()+"_options"]=w.items.map(v=>({name:v.fields[2].value,value:v.fields[1].value,label:v.fields[0].value}))),i.value[D].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",w)}}async function x(E){var k,B;console.info("getLookupData() searchText = ",E);const A={searchText:E,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let D=await window.salesforceConnector.getLookupData(JSON.stringify(A));if(typeof D=="string"&&(D=JSON.parse(D)),D!=null&&D.errorMessage){t.handleError(D.errorMessage);return}if((k=D[0])!=null&&k.errorMessage){t.handleError((B=D[0])==null?void 0:B.errorMessage);return}return D}catch(D){t.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",D)}}async function g(E,A){var B;console.info("Update Other Fields Value = ",E),console.info("Update Other Fields Row Index = ",A);const k=A+(h.value.currentPage-1)*h.value.rowLimit;console.info("actualRowIndex = ",k);try{if(E){const D=l.value.filter(w=>w.xx_ord1__item__c===E)[0];if(D){s.value=!0;const w=o.value.data.columns[1].field;i.value[k][w]&&await C(D,k),(B=i.value[k])!=null&&B.itemDataRetrieved&&(i.value[k].status="New Match Requested",i.value[k].noMatchCleared=!0),Object.keys(D).forEach(v=>{const S=Hc[v.toLowerCase()];console.info("Mapped Key = ",S),S&&(i.value[k][S]=D[v])}),s.value=!1}else i.value[k].status=""}else i.value[k].status="No Match"}catch(D){t.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",D)}}async function C(E,A){const k=i.value[A],B=o.value.data.columns[1].field,D=[{sku:k[B],name:k[B],productDescription:k.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:E.xx_ord1__item__c}];let w=await y(JSON.stringify(D));console.info("Match Item: ",JSON.stringify(w)),i.value[A][`${B}_options`]=[{value:w[0].competitorItemId,label:w[0].sku}],i.value[A][B]=w[0].competitorItemId}async function _(E){try{let A=await window.salesforceConnector.createQLI(JSON.stringify(E));typeof A=="string"&&(A=JSON.parse(A));let k=!1;if((A==null?void 0:A.length)>0)for(let B=0;B<A.length;B++)A[B].errorMessage&&(k=!0,A[B].errorMessage.includes("Line Description: data value too large")&&(A[B].errorMessage="Error: The description is too long—it must be under 200 characters."));if(k){A.forEach(B=>{u.value[B.eCatalogItemId]=B});return}else u.value=[];return A}catch(A){t.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",A)}}return{quickSelectionLayout:o,quickSelectionLayoutLoading:a,processedRecords:i,useMappings:d,currentSearchData:l,createQliErrors:u,getQuickSelectionLayout:m,getAllFieldsForQuickSelectionLayout:c,saveCompetitorSKU:y,getQuickSelectionItems:f,searchLookupHandler:p,updateOtherFields:g,addAllItemsToQuote:_}});function L7(t,r,n){const o=[];return t.templateId||o.push("AI_GUIDANCE_MISSING_TEMPLATE_ID"),t.composablesOrgType||o.push("AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE"),t.websocketUrl||o.push("AI_GUIDANCE_MISSING_WEBSOCKET_URL"),t.packageVersion||o.push("AI_GUIDANCE_MISSING_PACKAGE_VERSION"),n!=null&&n.accessToken||o.push("AI_GUIDANCE_MISSING_SECURITY_TOKEN"),r!=null&&r.organizationId||o.push("AI_GUIDANCE_MISSING_IDENTITY_ORG_ID"),r!=null&&r.userId||o.push("AI_GUIDANCE_MISSING_IDENTITY_USER_ID"),r!=null&&r.accountId||o.push("AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID"),o}function Xc(t){return t?!t.startsWith("ws://")&&!t.startsWith("wss://")?"WEBSOCKET_INVALID_URL_FORMAT":null:"WEBSOCKET_MISSING_URL"}function P7(t){var r,n,o,a,i,l;if(!t)return{playbookId:null,error:null};try{const s=(o=(n=(r=t==null?void 0:t[0])==null?void 0:r.blocks)==null?void 0:n[0])==null?void 0:o.playbookId,u=((i=(a=t==null?void 0:t.blocks)==null?void 0:a[0])==null?void 0:i.playbookId)||((l=t==null?void 0:t[0])==null?void 0:l.playbookId);return{playbookId:s||u||null,error:null}}catch(s){return console.error("[validation] Error validating block structure:",s),{playbookId:null,error:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID"}}}function q7(t,r){const n=[];t!=null&&t.currentPlaybook||n.push("COMPONENT_LOADER_MISSING_PLAYBOOK");const o=r;return o&&o!=="catalog"&&o!=="cart"&&o!=="configurator"&&o!==""&&n.push("COMPONENT_LOADER_INVALID_COMPONENT_KEY"),n}const No="Preparing Your Quote Please Wait...",vi={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"},$7=18e4,U7=2e3,z7={bgColor:"#EDF8EB",textColor:"#5F5F5F"};function j7({minDisplayMs:t=2e3}={}){const r=[];let n=null,o=!1,a=null,i=null,l=null;const s=new Set;function u(){const g={isActive:o,currentMessage:a?a.message:null,queuedCount:r.length};s.forEach(C=>{try{C(g)}catch{}})}function h(){n||(n=setInterval(m,100))}function d(){n&&(clearInterval(n),n=null)}function m(){if(o){if(!a&&r.length>0){a={...r.shift(),shownAt:Date.now()},u();return}if(a&&Date.now()-a.shownAt>=a.minDisplayMs){if(r.length>0)a={...r.shift(),shownAt:Date.now()},u();else if(a=null,o=!1,d(),u(),i&&l){const C=i,_=l;i=null,l=null;try{_(C)}catch{}}}}}function c(g,C={}){return r.push({message:g,minDisplayMs:C.minDisplayMs||t}),o||(o=!0,h(),u()),r.length}function y(g,C){if(i=g,typeof C=="function"&&(l=C),o)h();else{const _=l,E=i;if(i=null,l=null,_)try{_(E)}catch{}}}function f(g){return typeof g!="function"?()=>{}:(s.add(g),g({isActive:o,currentMessage:a?a.message:null,queuedCount:r.length}),()=>s.delete(g))}function b(){return a?a.message:null}function p(){return o}function x(){r.length=0,a=null,o=!1,i=null,l=null,d(),u()}return{getCurrentMessage:b,getIsActive:p,subscribe:f,enqueue:c,setSuccess:y,clear:x}}const Un=it.defineStore("ai",()=>{const t=wo(),r=$n();Kc(),R7();const n=Rt(),o=Ci(),a=ft(),i=Jn();(()=>{try{return L0()}catch{return{path:""}}})();const l=e.ref(""),s=e.ref([]),u=e.ref(""),h=e.ref([]),d=e.ref(!1),m=e.ref(null),c=e.ref({}),y=e.ref(null),f=e.ref(null),b=e.ref(null),p=e.ref(null),x=e.ref(!1),g=e.ref(!0),C=e.ref(null),_=e.ref(!1),E=e.ref(null),A=e.ref(No),k=j7({minDisplayMs:U7});k.subscribe(({isActive:oe,currentMessage:le})=>{oe&&(A.value=le||No)});const B=e.ref([]),D=e.computed(()=>z7),w=()=>{var Ce,J,se;const le=(se=(J=(((Ce=i.currentPlaybook)==null?void 0:Ce.playBookSteps)||[])[0])==null?void 0:J.uiSpecs)==null?void 0:se.customText;return{message:typeof le=="string"&&le.trim().length>0?le:vi==null?void 0:vi.message,type:"response"}},v=e.ref(vn()),S=e.computed(()=>{const oe=a.organizationId.value,le=a.userId.value,be=a.cid.value||v.value;return`${oe}_${le}_${be}`}),I=e.computed(()=>m.value.readyState==WebSocket.OPEN),R=e.computed(()=>a.websocketUrl.value||""),z=()=>{c.value={salesforceOrgId:a.organizationId.value,salesforceOrgType:a.composablesOrgType.value,salesforceUserId:a.userId.value,userType:"Salesforce",chatRoomId:S.value,chatId:null,requestId:"",prompt:"",initiatedFrom:t.origin||"Quote",internalCall:!1,contextObjectId:a.quoteId.value,contextObjectType:"Quote",payload:{lineItemsCount:r.lineItemsCount},origin:"DXP",defaultBatchSize:10,actionType:"",packageVersion:a.packageVersion.value,relatedIds:{accountId:a.accountId.value,eCatalogId:a.eCatalogId.value||"",contactId:a.cid.value||""}}},$=(oe,le={})=>{g.value&&Et("websocket:error",{errorCode:oe,isInitialization:!0,...le})};async function X(){const oe=Xc(R.value);if(oe)throw $(oe,{url:R.value}),new Error("WebSocket URL validation failed");g.value=!0;const le=1e4;C.value=setTimeout(()=>{if(m.value&&m.value.readyState!==WebSocket.OPEN&&($("WEBSOCKET_CONNECTION_TIMEOUT"),m.value))try{m.value.close()}catch{}},le);let be=!1;return new Promise((J,se)=>{var Se,De,Oe,He;const fe=(Ve,Ge)=>{be||(be=!0,Ve?se(Ve):J(Ge))},Y=()=>{W(),fe(null)},re=Ve=>{K(Ve),be||fe(new Error("WebSocket closed before open"))},me=Ve=>{P(Ve),be||fe((Ve==null?void 0:Ve.error)||new Error("WebSocket error"))};try{const Ve=R.value+"?chatRoomId="+S.value;m.value=new WebSocket(Ve),m.value.addEventListener("open",Y),m.value.addEventListener("message",N),m.value.addEventListener("close",re),m.value.addEventListener("error",me)}catch(Ve){C.value&&(clearTimeout(C.value),C.value=null),(Se=Ve.message)!=null&&Se.includes("network")||(De=Ve.message)!=null&&De.includes("Network")?$("WEBSOCKET_NETWORK_ERROR",{error:Ve.message}):(Oe=Ve.message)!=null&&Oe.includes("CORS")||(He=Ve.message)!=null&&He.includes("cors")?$("WEBSOCKET_CORS_ERROR",{error:Ve.message}):$("WEBSOCKET_CONNECTION_FAILED",{error:Ve.message}),fe(Ve)}})}const W=()=>{C.value&&(clearTimeout(C.value),C.value=null),g.value=!1,F(),U()},K=oe=>{if(C.value&&(clearTimeout(C.value),C.value=null),g.value){const le=(oe==null?void 0:oe.code)??1006,be=(oe==null?void 0:oe.reason)??"";switch(le){case 1e3:break;case 1001:case 1002:case 1003:case 1013:case 1014:$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:le,closeReason:be});break;case 1006:$("WEBSOCKET_ABNORMAL_CLOSURE",{closeCode:le,closeReason:be});break;case 1011:$("WEBSOCKET_SERVER_ERROR",{closeCode:le,closeReason:be});break;case 1012:$("WEBSOCKET_SERVICE_RESTART",{closeCode:le,closeReason:be});break;case 1015:$("WEBSOCKET_SSL_ERROR",{closeCode:le,closeReason:be});break;default:le!==1e3&&$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:le,closeReason:be})}}g.value=!1,_.value=!1,q()},P=oe=>{var le;if(C.value&&(clearTimeout(C.value),C.value=null),g.value){let be="WEBSOCKET_CONNECTION_FAILED";const Ce=(oe==null?void 0:oe.message)||((le=oe==null?void 0:oe.error)==null?void 0:le.message)||"Unknown websocket error";Ce.includes("network")||Ce.includes("Network")||Ce.includes("Failed to fetch")?be="WEBSOCKET_NETWORK_ERROR":Ce.includes("CORS")||Ce.includes("cors")?be="WEBSOCKET_CORS_ERROR":Ce.includes("SSL")||Ce.includes("TLS")||Ce.includes("certificate")?be="WEBSOCKET_SSL_ERROR":Ce.includes("refused")||Ce.includes("ECONNREFUSED")?be="WEBSOCKET_CONNECTION_REFUSED":(Ce.includes("auth")||Ce.includes("unauthorized")||Ce.includes("401"))&&(be="WEBSOCKET_AUTHENTICATION_FAILED"),$(be,{error:Ce})}_.value=!1,ce(),q()},N=oe=>{var Ce,J,se,fe;F();const le=JSON.parse(oe.data);le!=null&&le.chatId&&(c.value.chatId=le.chatId);const be=(le==null?void 0:le.contextObjectId)??((Ce=le==null?void 0:le.payload)==null?void 0:Ce.contextObjectId);if(be){const Y=c.value.contextObjectId||((J=a.quoteId)==null?void 0:J.value)||"",re=be;re&&re!==Y&&(c.value.contextObjectId=re,a.updateConfig({quoteId:re}),Et("quote-id:updated",{quoteId:re}))}if(O(le),le.status!=="ALIVE"){if((le==null?void 0:le.status)==="IN_PROGRESS"||(le==null?void 0:le.loading)===!0){const Y=(le==null?void 0:le.message)||(le==null?void 0:le.statusMessage)||(le==null?void 0:le.stepName)||No;k.enqueue(Y),A.value=k.getCurrentMessage()||Y;return}if((le==null?void 0:le.status)==="SUCCESS"){const Y=(le==null?void 0:le.message)||No;A.value=k.getCurrentMessage()||Y,k.setSuccess(le,re=>{T(re)});return}Array.isArray(le.messages)?(A.value=null,_.value=!1,s.value.push(w()),le.messages.length>0&&te(le.messages)):le.agentResponse&&(le.errorMessage&&(le.agentResponse.content=le.errorMessage,le.agentResponse.error=!0),A.value=null,s.value.push({message:le.agentResponse.content,type:le.agentResponse.role,requestId:le.requestId,epoch:le.agentResponse.epoch,error:le.agentResponse.error,isDML:le.agentResponse.isDML,...(se=le.agentResponse)!=null&&se.filesData?{filesData:(fe=le.agentResponse)==null?void 0:fe.filesData}:{}})),B.value=le.links||[],ie(le)}};function T(oe,le={}){var J,se,fe,Y;const{skipComponentLoad:be=!1}=le||{},Ce=(oe==null?void 0:oe.contextObjectId)??((J=oe==null?void 0:oe.payload)==null?void 0:J.contextObjectId);if(Ce){const re=c.value.contextObjectId||((se=a.quoteId)==null?void 0:se.value)||"",me=Ce;me&&me!==re&&(console.info("[ai] Updating quoteId from contextObjectId (SUCCESS):",{current:re,new:me}),c.value.contextObjectId=me,a.updateConfig({quoteId:me}),console.info("[ai] Emitting quote-id:updated event with quoteId (SUCCESS):",me),Et("quote-id:updated",{quoteId:me}))}if(oe!=null&&oe.loading){A.value=oe.message;return}else Array.isArray(oe==null?void 0:oe.messages)?(A.value=null,_.value=!1,s.value.push(w()),oe.messages.length>0&&te(oe.messages)):oe!=null&&oe.agentResponse?(oe.errorMessage&&(oe.agentResponse.content=oe.errorMessage,oe.agentResponse.error=!0),A.value=null,s.value.push({message:oe.agentResponse.content,type:oe.agentResponse.role,requestId:oe.requestId,epoch:oe.agentResponse.epoch,error:oe.agentResponse.error,isDML:oe.agentResponse.isDML,...(fe=oe.agentResponse)!=null&&fe.filesData?{filesData:(Y=oe.agentResponse)==null?void 0:Y.filesData}:{}})):A.value=null;B.value=(oe==null?void 0:oe.links)||[];try{Et("ai-response:success",oe)}catch{}be||ie(oe)}const O=oe=>{const le=oe==null?void 0:oe.eventType,be=(oe==null?void 0:oe.loading)===!0||le==="ResponseTextDeltaEvent",Ce=le==="ResponseTextDoneEvent"||Array.isArray(oe==null?void 0:oe.messages)||!!(oe!=null&&oe.agentResponse);if(be&&!Ce){x.value=!0;return}Ce&&(x.value=!1)},F=()=>{q(),y.value=setTimeout(()=>{if(I.value){const oe={action:"heartbeat"};m.value.send(JSON.stringify(oe)),F()}},$7)},q=()=>{y.value&&(clearInterval(y.value),y.value=null)};function M(oe){const le={...c.value};le.requestType="Action",le.actionType="Undo",le.undoRequestId=oe,le.requestId=vn(),Z(le)}function U(){_.value=!0;const oe={...c.value};oe.requestType="Action",oe.actionType="History",oe.requestId=vn(),Z(oe)}function L(oe){return console.info("[ai] isUnsavedChanges check",{activeKey:((i==null?void 0:i.activeComponentKey)||"").toLowerCase(),isChangedConfiguration:n.isChangedConfiguration}),((i==null?void 0:i.activeComponentKey)||"").toLowerCase()==="configurator"&&n.isChangedConfiguration&&console.warn("[ai] Unsaved configurator changes detected; not blocking send"),!1}function j(oe,le=!0,be=null){if(console.info("[ai] sendMessage",{messageLength:(oe||"").length,hasCustomPayload:!!be,addMessageToHistory:le}),L()){console.warn("[ai] sendMessage aborted: unsaved changes detected");return}if(oe.trim()){let Ce={...c.value};Ce.prompt=oe.trim(),Ce.requestType="Chat",Ce.requestId=vn(),Ce.internalCall=!1,Ce.payload=ne(),console.log("[ai] _payload.payload",Ce.payload),Ce.componentName=Q.value,Ce.templateId=r.templateId,Ce.payload.lineItemsCount=r.lineItemsCount,Ce.relatedIds.eCatalogId=a.eCatalogId.value||"",be&&(Ce={...Ce,...be}),ue(),le&&s.value.push({message:oe.trim(),type:"user",...E.value&&{fileData:[E.value]},requestId:Ce.requestId}),console.info("[ai] sending prompt",{requestId:Ce.requestId,requestType:Ce.requestType,componentName:Ce.componentName}),Z(Ce),F()}}const H=e.computed(()=>{var be,Ce,J;const oe=((be=i.currentPlaybook)==null?void 0:be.pbUniqueId)??((Ce=i.currentPlaybook)==null?void 0:Ce.vUniqueId)??null,le=i.currentStepName??((J=i.currentStep)==null?void 0:J.stepName)??null;return{pbUniqueId:oe,stepName:le}});function Z(oe){const le={...oe},{pbUniqueId:be,stepName:Ce}=H.value||{};console.log("[ai] activePlaybookContext",H.value),be&&(le.pbUniqueId=be),Ce&&(le.stepName=Ce);const J={action:"prompt",data:le};m.value.send(JSON.stringify(J))}const te=oe=>{const le=oe.filter(({content:be})=>!!be).map(be=>({message:be.content,type:be.role,requestId:be.requestId,epoch:be.epoch,isDML:be.isDML,undone:be.undone}));le.forEach((be,Ce)=>{be.isDML===!0&&Ce!==le.length-1&&(be.isDML=!1)}),s.value=[...s.value,...le]};function ne(){const oe=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return console.info("[ai] getRequestBody activeKey",oe),oe==="cart"||oe==="quote_item"?(console.info("[ai] getRequestBody → using quoteStore.getPayload()"),r.getPayload()):oe==="configurator"?o.getPayload():(console.info("[ai] getRequestBody → empty {}"),{})}const Q=e.computed(()=>{const oe=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return oe==="cart"||oe==="quote_item"?"QuoteItem":""}),ce=()=>{s.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},ue=()=>{s.value=s.value.map(oe=>({...oe,links:[]}))};function pe(oe){var le,be,Ce;try{const J=oe==null?void 0:oe.stepName;if(!J)return!1;const se=He=>String(He||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),fe=((le=i.currentPlaybook)==null?void 0:le.playBookSteps)||[],Y=fe.find(He=>He.stepName===J||He.name===J)||null,me=se(Y==null?void 0:Y.stepComponent)==="configurator"||se(J).includes("configure"),Se=!!((be=oe==null?void 0:oe.payload)!=null&&be.productConfiguration&&Array.isArray(oe.payload.productConfiguration)&&oe.payload.productConfiguration.length===0),Oe=se(i.currentStep&&i.currentStep.stepComponent||((Ce=fe.find(He=>He.stepName===(i.currentStepName||"")))==null?void 0:Ce.stepComponent)||i.activeComponentKey)==="configurator";return me&&Se&&Oe}catch{return!1}}function ie(oe){var Ce,J,se,fe;const le=(oe==null?void 0:oe.contextObjectId)??((Ce=oe==null?void 0:oe.payload)==null?void 0:Ce.contextObjectId);if(le){const Y=le,re=c.value.contextObjectId||((J=a.quoteId)==null?void 0:J.value)||"";Y&&Y!==re&&(c.value.contextObjectId=Y,a.updateConfig({quoteId:Y}),Et("quote-id:updated",{quoteId:Y}))}const be=oe==null?void 0:oe.stepName;if(be){if(be==="AI Guidance"||be==="ai_guidance"||be.toLowerCase()==="ai guidance"){console.info("[ai] Skipping navigation for AI Guidance step - side panel will remain in current state");return}if(pe(oe)){console.info("[ai] Skipping configurator update: empty productConfiguration and configurator already active"),(oe==null?void 0:oe.actionFunction)==="Reload"&&(console.log("Reloading configurator 2"),o.refresh());return}try{i.navigateToStep({stepName:be,data:oe})}catch(Y){console.info("navigateToStep failed, falling back to legacy component routing",Y)}return}else{if(i.currentStepName||i.currentStep&&i.currentStep.stepName||null)return;(fe=(se=i.currentPlaybook)==null?void 0:se.playBookSteps)!=null&&fe.length&&i.navigateToStep({stepName:i.currentPlaybook.playBookSteps[0].stepName});return}}function de(){if(I.value){const oe={action:"cancel",data:{requestId:c.value.requestId,chatRoomId:S.value}};m.value.send(JSON.stringify(oe))}}function _e(){try{if(C.value&&(clearTimeout(C.value),C.value=null),g.value=!1,m.value){try{m.value.removeEventListener("open",W)}catch{}try{m.value.removeEventListener("message",N)}catch{}try{m.value.removeEventListener("close",K)}catch{}try{m.value.removeEventListener("error",P)}catch{}try{m.value.close()}catch{}m.value=null}}finally{ye()}}function xe(){try{k.clear()}catch{}l.value="",s.value=[],u.value="",h.value=[],d.value=!1,B.value=[],E.value=null,x.value=!1,p.value=null,A.value=No,c.value={},q(),ye()}const ye=()=>{f.value&&(clearInterval(f.value),f.value=null),y.value&&(clearInterval(y.value),y.value=null),b.value&&(clearTimeout(b.value),b.value=null)};return e.onBeforeUnmount(()=>{ye()}),{unsavedChanges:p,loadingMessage:A,promptMessage:l,buttonLinks:B,websocketUrl:R,chatHistory:s,latestDMLRequest:u,strikethroughHistory:h,attachmentData:E,dataManuallyChanged:d,isThinkingMessage:x,isFetchingHistory:_,chatStyles:D,undoAction:M,connectSocket:X,sendMessage:j,setInitialPayload:z,cancelRequest:de,disconnectSocket:_e,resetState:xe}}),H7={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 G7(t,r={}){const n=H7[t];return n?{...n,details:r}:{code:"UNKNOWN_ERROR",message:`Unknown error: ${t}`,component:"aiGuidance",details:r}}function Wc(t,r="aiGuidance"){const n=(a,i={})=>{const l=G7(a,i);t("ai-guidance:error",l),console.error(`[${r}] Error:`,l)};return{emitError:n,emitErrors:(a,i={})=>{a.forEach(l=>n(l,i))}}}const K7={class:"chat-message-links"},X7=["href","redirect","data-test-id"],W7=ve({__name:"ChatMessageActions",props:{links:{type:Array,default:()=>[]},chatIndex:{type:Number,default:0}},emits:["perform-action"],setup(t){const r=(n,o,a)=>o;return(n,o)=>(e.openBlock(),e.createElementBlock("div",K7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.links,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.label},[a!=null&&a.action?(e.openBlock(),e.createBlock(xt,{key:0,btype:"playbook",text:a.label,disabled:a==null?void 0:a.disabled,"data-test-id":`chat-message-action-${a.label}`,onClick:l=>n.$emit("perform-action",a.action,t.chatIndex,a==null?void 0:a.isStatic)},null,8,["text","disabled","data-test-id","onClick"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:a.link,redirect:r(a.link,a.redirect),target:"_blank",class:"ai-links","data-test-id":`chat-message-action-${a.label}`},e.toDisplayString(a.label),9,X7))],64))),128))]))}},[["__scopeId","data-v-e0a9c744"]]),Q7={class:"a-icon"},Z7=["src"],J7={class:"a-name"},Y7={class:"a-size"},eb=ve({__name:"AppAttachment",props:{background:{type:String,default:"#f8f8f8"},info:{type:Object,required:!0,default:()=>({iconUrl:"",fileName:"",fileSize:""})},encodedString:{type:String,default:""}},emits:["download"],setup(t,{emit:r}){const n=t,o=r,a=i=>{try{const l=i.match(/^data:(.*?);base64,(.*)$/);if(!l||l.length!==3)throw new Error("Invalid Base64 file format");const s=l[1],u=l[2],h=document.createElement("a");h.href=i,h.download=n.info.fileName||"download",h.target="_blank",document.body.appendChild(h),h.click(),document.body.removeChild(h);const d=El(Math.floor(u.length*3/4));o("download",{name:n.info.fileName,size:d,url:i})}catch(l){console.info("[ERROR]: Error decoding Base64 file:",l)}};return(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:"attachment-wrapper",style:e.normalizeStyle(`background: ${t.background}`)},[e.createElementVNode("span",Q7,[e.createElementVNode("img",{src:t.info.iconUrl},null,8,Z7)]),e.createElementVNode("div",null,[e.createElementVNode("p",J7,e.toDisplayString(t.info.fileName),1),e.createElementVNode("p",Y7,e.toDisplayString(t.info.fileSize),1)]),t.encodedString?(e.openBlock(),e.createElementBlock("button",{key:0,class:"a-download",onClick:l[0]||(l[0]=s=>a(t.encodedString))},[e.createVNode(Be,{icon:"download",color:"#353535"})])):e.createCommentVNode("",!0)],4))}},[["__scopeId","data-v-4194a82b"]]),Qc="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",Zc="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",tb={name:"SkeletonLoader",props:{dataTestId:{type:String,default:""}}},nb=["data-test-id"];function ob(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",{class:"skeleton-loader","data-test-id":n.dataTestId},null,8,nb)}const So=ve(tb,[["render",ob],["__scopeId","data-v-17a86e07"]]),Jc={};function rb(t){let r=Jc[t];if(r)return r;r=Jc[t]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);r.push(o)}for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);r[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return r}function Yn(t,r){typeof r!="string"&&(r=Yn.defaultChars);const n=rb(r);return t.replace(/(%[a-f0-9]{2})+/gi,function(o){let a="";for(let i=0,l=o.length;i<l;i+=3){const s=parseInt(o.slice(i+1,i+3),16);if(s<128){a+=n[s];continue}if((s&224)===192&&i+3<l){const u=parseInt(o.slice(i+4,i+6),16);if((u&192)===128){const h=s<<6&1984|u&63;h<128?a+="��":a+=String.fromCharCode(h),i+=3;continue}}if((s&240)===224&&i+6<l){const u=parseInt(o.slice(i+4,i+6),16),h=parseInt(o.slice(i+7,i+9),16);if((u&192)===128&&(h&192)===128){const d=s<<12&61440|u<<6&4032|h&63;d<2048||d>=55296&&d<=57343?a+="���":a+=String.fromCharCode(d),i+=6;continue}}if((s&248)===240&&i+9<l){const u=parseInt(o.slice(i+4,i+6),16),h=parseInt(o.slice(i+7,i+9),16),d=parseInt(o.slice(i+10,i+12),16);if((u&192)===128&&(h&192)===128&&(d&192)===128){let m=s<<18&1835008|u<<12&258048|h<<6&4032|d&63;m<65536||m>1114111?a+="����":(m-=65536,a+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),i+=9;continue}}a+="�"}return a})}Yn.defaultChars=";/?:@&=+$,#",Yn.componentChars="";const Yc={};function ab(t){let r=Yc[t];if(r)return r;r=Yc[t]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?r.push(o):r.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)r[t.charCodeAt(n)]=t[n];return r}function Bo(t,r,n){typeof r!="string"&&(n=r,r=Bo.defaultChars),typeof n>"u"&&(n=!0);const o=ab(r);let a="";for(let i=0,l=t.length;i<l;i++){const s=t.charCodeAt(i);if(n&&s===37&&i+2<l&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3))){a+=t.slice(i,i+3),i+=2;continue}if(s<128){a+=o[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&i+1<l){const u=t.charCodeAt(i+1);if(u>=56320&&u<=57343){a+=encodeURIComponent(t[i]+t[i+1]),i++;continue}}a+="%EF%BF%BD";continue}a+=encodeURIComponent(t[i])}return a}Bo.defaultChars=";/?:@&=+$,-_.!~*'()#",Bo.componentChars="-_.!~*'()";function Ai(t){let r="";return r+=t.protocol||"",r+=t.slashes?"//":"",r+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?r+="["+t.hostname+"]":r+=t.hostname||"",r+=t.port?":"+t.port:"",r+=t.pathname||"",r+=t.search||"",r+=t.hash||"",r}function Br(){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 ib=/^([a-z0-9.+-]+:)/i,lb=/:[0-9]*$/,sb=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,cb=["<",">",'"',"`"," ","\r",`
|
|
145
|
+
`,ui={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 Ct({action:t,data:r,config:n={}}){var y,f;const o=ft(),a=n.accessToken??o.accessToken.value,i=n.salesforceOrgId??o.organizationId.value,l=n.userId??o.userId.value,s=n.orgType??o.composablesOrgType.value,u=n.baseUrl??o.composablesApiUrl.value,h=ui[n.pathKey]??ui[n.pathKey.split(".")[0]][n.pathKey.split(".")[1]];if(!h)throw new Error(`Invalid pathKey: ${n.pathKey}. Available keys: ${Object.keys(ui).join(", ")}`);const d=`${u}${h}`;if(!i&&n.pathKey!=="fetchAccessToken")throw new Error("salesforceOrgId is required. Provide it in config or set it via useComposableStore.updateConfig()");let m;t?m={action:t,data:r}:m=r;const c={"Content-Type":"application/json"};if(a&&(c.Authorization=`Bearer ${a}`),i&&(c["X-Salesforce-Org-Id"]=i),s&&(c["X-Salesforce-Org-Type"]=s),l&&(c["X-Salesforce-User-Id"]=l),!d)throw new Error("composablesApiUrl is required. Provide it in props or set it via useComposableStore.updateConfig()");try{console.log(`[COMPOSABLES_API:${t||"no-action"}] request`,JSON.stringify(m)),console.log(`[COMPOSABLES_API:${t||"no-action"}] headers`,c);const b=await Ue.post(d,m,{headers:c});if(console.log(`[COMPOSABLES_API:${t||"no-action"}] response`,b.data),!t&&((y=b.data)!=null&&y.data)&&typeof b.data.data=="string")try{b.data=JSON.parse(b.data.data)}catch(p){console.warn("[COMPOSABLES_API] Failed to parse data field:",p)}else if(!t&&((f=b.data)!=null&&f.data)&&typeof b.data.data=="object")try{b.data=b.data.data}catch(p){console.warn("[COMPOSABLES_API] Failed to parse content field:",p)}return b.data}catch(b){throw console.error(`[COMPOSABLES_API:${t||"no-action"}] error:`,b),b}}const Qn="https://d2pgvmpph8dmlo.cloudfront.net";function hc(t,r,n){return t?t==null?void 0:t.map(o=>d4(o,r,n)):[]}function d4(t,r,n){const{url:o,staticResource:a}=t;if(!o)return null;if(o.includes("/resource/")&&!o.includes("://")&&a){const i=o.split("/"),l=i[i.length-1];return`${Qn}/${n}/static/${l}.${r}`}else return o}const Co=it.defineStore("blockLegacy",()=>{const t=ft(),r=e.ref(null),n=e.ref(null),o=e.ref(!1),a=e.ref(null);async function i(d,m=!0){var f,b;if(console.info("fetchBlockInformation templateId:",d.templateId),!d.templateId)return;m&&(r.value=[],o.value=!1);const c={storefrontId:d.storefrontId,templateId:d.templateId};console.log("fetchBlockInformation variables",JSON.stringify(c)),console.log("fetchBlockInformation getTemplateBlock",dc);const y=await br(dc,c);if(console.log("fetchBlockInformation getTemplateBlockResponse",y),console.log("fetchBlockInformation pageBlocks",r.value),n.value=d.templateId,m)(f=y.content)!=null&&f.blocks?(r.value=l(JSON.parse(y.content.blocks)),console.log("fetchBlockInformation pageBlocks 1",r.value)):r.value=[],o.value=!0;else return((b=y==null?void 0:y.content)==null?void 0:b.blocks)||[]}function l(d){const m=t.organizationId.value;return d==null||d.forEach(c=>{c.blocks=c.blocks?JSON.parse(c.blocks):[],c.blocks.forEach(y=>{var f,b;Object.assign(y,JSON.parse(y.contentJSON)),y.contentJSON=null,y.id=y.blockId||y.Id,(y.componentName==="catalogBlock"||y.componentName==="relatedProducts")&&(s(y.fields.productCard.actions),y.fields.noFriendlyURL=!0,y.fields.productCard.friendlyURL=null,y.fields.productCard.friendlyURLFields=null,(f=y.configuration)!=null&&f.productTemplateId?y.fields.productCard.url="/product/"+((b=y.configuration)==null?void 0:b.productTemplateId):y.fields.productCard.url=null),y.componentName==="productSummary"&&(console.log("block.fields.actions",y.fields.actions),s(y.fields.actions)),y.customJS&&(y.customJS=hc(y.customJS,"js",m)),y.customCSS&&(y.customCSS=hc(y.customCSS,"css",m))})}),d}function s(d){d.forEach(m=>{m.action==="CUSTOM_ACTION"&&(m.action="CUSTOM",m.name=m.label.title,m.value=m.url.field||m.url.title,m.newTab=m.openInNewTab)})}async function u(d,m=!0){var c,y,f;if(console.info("fetchBlockInformationREST templateId:",d.templateId),!!d.templateId){m&&(r.value=[],o.value=!1);try{const b=await Ct({action:"retrieveBlock",data:{salesforceOrgId:t.organizationId.value,storefrontId:d.templateId,templateId:"wrapperDefault"},config:{pathKey:"retrieveBlock"}});n.value=d.templateId;const p=((y=(c=b==null?void 0:b.data)==null?void 0:c[0])==null?void 0:y.blocks)??((f=b==null?void 0:b.data)==null?void 0:f.blocks);if(console.log("fetchBlockInformationREST blocksData",p),m){if(p){const x=typeof p=="string"?JSON.parse(p):p;console.log("fetchBlockInformationREST parsedBlocks",x),r.value=l(x),console.log("fetchBlockInformationREST pageBlocks",r.value)}else console.log("fetchBlockInformationREST blocksData is null"),r.value=[];o.value=!0}else return p||[]}catch(b){throw console.error("fetchBlockInformationREST error:",b),m&&(r.value=[],o.value=!0),b}}}return{metaInfo:a,currentPageId:n,pageBlocks:r,blockLoaded:o,fetchBlockInformation:i,fetchBlockInformationREST:u,getFormattedSectionBlocks:d=>e.computed(()=>{const m=[];return r.value&&r.value.length>0&&r.value.forEach(c=>{const y=c.blocks;y&&y.length>0&&y.forEach(f=>{if(f.id=f.blockId,d){const b=["checkoutAccount","shippingAddress","shippingMethod","customForm","termsAndPayment","quoteSummary","customCode"];console.log("section.sectionName",c.sectionName,f.componentName),f&&f.configuration&&(b.includes(f.componentName)||f.configuration.isCheckoutBlock)&&m.push(f)}else f&&f.configuration&&!d&&m.push(f)})}),m})}}),qn=async(t,r=null,n="",o=!1)=>{const a=ft();console.log("appsyncHandler composableStore",a);const i=a.graphqlEndpoint.value,l=a.apiKey.value;let s=200,u;const h=a.hostName.value;console.log("appsyncHandler currentHostname",h);const d=fi();try{const m=r;let c="";d.activeStorefrontInfo&&d.activeStorefrontInfo.accountId&&!c&&(c=d.activeStorefrontInfo.accountId),m.data&&d.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&(m.data.userType=d.activeStorefrontInfo.userType,m.data.accountId=c,m.data.domain=h);const y=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l},body:JSON.stringify({query:t,variables:m})});if(u=await(y==null?void 0:y.json()),u=u.data,n)u=JSON.parse(u[n]),s=Number(u.statusCode),u=u.content,s===401&&console.info("401",t,JSON.stringify(r));else if(t.includes("SalesforceActions")){let f=u;f=JSON.parse(u.salesforceActions),f.statusCode==="401"&&console.info("401",t,JSON.stringify(r),u)}}catch(m){console.log(m),s=400,u=m}return{statusCode:s,response:u}},di=["Needs Configuration","Suggests Configuration","Upload Configuration"],f4=["Upload","Upload Add","Upload Configuration"],h4=["No Configuration","Suggests Configuration","Upload Add","",null,void 0],p4=["CONFIGURE","UPLOAD","ADD_TO_CART"],m4=new Map([["Full","Full"],["FULL","Full"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","Default"],["ECATALOG_ACCOUNT_CUSTOM","Alternate"],["ECATALOG_OVERRIDE","Override"]]),y4=new Map([["Full","Item"],["FULL","Item"],["INSTALL_BASE","InstallBase"],["ECATALOG_ACCOUNT_PRIMARY","eCatalog"],["ECATALOG_ACCOUNT_CUSTOM","eCatalog"],["ECATALOG_OVERRIDE","eCatalog"]]),Eo=(t,r,n=!1)=>{const o=Mt();let a,i,l;return n?(i=t.statusCode,l=t.content):(a=JSON.parse(t.response.salesforceActions),i=a.statusCode,l=a.content),Number(i)===200&&l&&l.message&&typeof l.message=="string"&&l.message.startsWith("ERROR:")?(o.handleError(l.message,"useExtractContent"),!1):Number(i)!==200||t.statusCode!==200||typeof l=="string"&&l.includes("ERROR:")||typeof l=="string"&&l.includes("Error:")||l.errorCode==="APEX_ERROR"?(l.errorCode==="APEX_ERROR"?o.handleError(l.message,"useExtractContent"):r||o.handleError(l,"useExtractContent"),!1):l},Zn=new Map;function Lt(t,r){return Zn.has(t)||Zn.set(t,new Set),Zn.get(t).add(r),()=>{g4(t,r)}}function g4(t,r){const n=Zn.get(t);n&&(n.delete(r),n.size===0&&Zn.delete(t))}function Et(t,r){const n=Zn.get(t);!n||n.size===0||Array.from(n).forEach(o=>{try{o(r)}catch{}})}const mn=it.defineStore("catalog",()=>{const t=ft(),r=e.ref(!1),n=e.ref(0),o=e.ref(null),a=e.ref(null),i=e.ref([]),l=e.ref({}),s=e.ref({}),u=e.ref(null),h=e.ref(null),d=e.ref(!1),m=e.ref({search:""}),c=e.ref({qliRecords:!0,quoteCreate:!1,quoteDetails:!1}),y=e.computed(()=>t.accountId.value),f=e.computed(()=>({domain:t.hostName.value,accountId:y.value,userType:t.userId.value})),b=e.computed(()=>{const $=Array.isArray(i.value)?i.value:[],X={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},W=N=>(N==null?void 0:N.XX_ORD1__SYS_Configuration_Status2__c)||(N==null?void 0:N.xx_ord1__sys_configuration_status2__c)||"",K=N=>N in X,P=$.filter(N=>K(W(N)));return P.sort((N,T)=>{const O=W(N),F=W(T);return(X[O]||99)-(X[F]||99)}),P});function p(){const $=b.value||[];return $.length?$[0]:null}function x($="true"){j0(`qreset-${o.value}`,$)}async function g($){try{const X={objectType:"XX_ORD1__Quote_Line_Item__c",qliIds:Array.isArray($)?$:[$]},W=await Ct({data:X,config:{pathKey:"catalog.deleteQuoteLine"}});return n.value=Math.max(0,(n.value||0)-1),v(!0),console.log("[CATALOG:deleteLineItems] success",W),x(),Et("catalog:line-deleted",{quoteId:(t==null?void 0:t.quoteId.value)||null,qliIds:X.qliIds,response:W}),W}catch(X){console.log("[CATALOG:deleteLineItems] error",X),x();return}}async function C($){var O,F;if(!$.qty)return;const X=t.quoteId.value;if(!X)return;$.retry=1;const W={...$,quoteid:X},K={action:"makeCall",data:{...f.value,callType:"POST",endpoint:"/services/apexrest/XX_ORD1/ecommerce?type=updateQLI&ut="+t.userId.value,payload:JSON.stringify(W)}},P=await qn(wn,K,void 0,!0),N=(F=(O=P.response)==null?void 0:O.salesforceActions)==null?void 0:F.toLowerCase();(N.includes("record currently unavailable")||N.includes("unable_to_lock_row"))&&$.retry<3&&setTimeout(()=>{$.retry+=1,C($)},500),Eo(P)&&v(!0),x()}async function _($){var K,P,N,T,O;const X=t==null?void 0:t.quoteId.value;Array.isArray($)&&($=$[0]);const W={itemId:$.itemID,eCatalogItemId:$.eCatalogItemID,quantity:$.qty,accountId:y.value,qtyTierAmt:($==null?void 0:$.qtyTierAmt)??null};X&&(W.quoteId=X);try{const F=await Ct({data:W,config:{pathKey:"catalog.saveItemToQuoteBlink"}}),q=(F==null?void 0:F.quoteId)||((K=F==null?void 0:F.data)==null?void 0:K.quoteId)||((N=(P=F==null?void 0:F.data)==null?void 0:P.quote)==null?void 0:N.Id);q&&q!==X&&(o.value=q,t.updateConfig({quoteId:q}));const M=((T=F==null?void 0:F.data)==null?void 0:T.QliId)||(F==null?void 0:F.QliId)||null,U=$==null?void 0:$.itemID,L=$==null?void 0:$.qty;if(M&&U){const j=s.value?s.value[U]:null;s.value={...s.value||{},[U]:{...j||{},Id:M,XX_ORD1__Item__c:U,XX_ORD1__QTY__c:typeof L=="number"?L:(j==null?void 0:j.XX_ORD1__QTY__c)||0}}}return v(!0),x(),Et("catalog:item-added",{itemId:W.itemId,eCatalogItemId:W.eCatalogItemId||null,quantity:W.quantity,quoteId:(t==null?void 0:t.quoteId.value)||q||null,qliId:((O=F==null?void 0:F.data)==null?void 0:O.QliId)||(F==null?void 0:F.QliId)||null,response:F}),F}catch(F){console.log("[CATALOG:saveItemToQuoteBlinkTxn] error",F),x();return}}async function E({itemId:$,qty:X,qliId:W,eCatalogItemId:K}={}){var T,O,F,q,M;if(console.log("updateQuoteLineQtyTxn",{itemId:$,qty:X,qliId:W,eCatalogItemId:K}),!X&&X!==0)return;let P=W||((O=(T=s.value)==null?void 0:T[$])==null?void 0:O.Id);if(P||(await S(!0),P=W||((q=(F=s.value)==null?void 0:F[$])==null?void 0:q.Id)),!P){if(X>0&&$&&K)return console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id, saving item first",{itemId:$,eCatalogItemId:K}),await _({itemID:$,eCatalogItemID:K,qty:X,qtyTierAmt:null});console.warn("[CATALOG:updateQuoteLineQtyTxn] Missing QLI Id for item",{itemId:$});return}const N={uniqueField:"",objectType:"XX_ORD1__Quote_Line_Item__c",records:[{fields:[{fieldName:"Id",fieldValue:P},{fieldName:"XX_ORD1__QTY__c",fieldValue:X}]}]};try{const U=await Ct({data:N,config:{pathKey:"catalog.updateLines"}});if($){const L=((M=s.value)==null?void 0:M[$])||{};s.value={...s.value||{},[$]:{...L,Id:P,XX_ORD1__Item__c:$,XX_ORD1__QTY__c:X}}}return v(!0),x(),Et("catalog:item-qty-updated",{itemId:$,qliId:P,quantity:X,eCatalogItemId:K||null,quoteId:(t==null?void 0:t.quoteId.value)||null,response:U}),U}catch(U){console.log("[CATALOG:updateQuoteLineQtyTxn] error",U),x();return}}async function A($,X,W){var F;const K=W==="Item",P=[],N=(($==null?void 0:$.searchText)||"").toString().trim(),T=Array.isArray($==null?void 0:$.fields)?$.fields:[];Array.isArray($==null?void 0:$.filters)&&$.filters,$==null||$.filterLogic;const O={searchPL:N,origin:"genesis_ai",userId:(t==null?void 0:t.userId.value)||"",orgId:(t==null?void 0:t.organizationId.value)||"",orgType:"Production",requestId:vn(),quoteId:(t==null?void 0:t.quoteId.value)||"",accountId:(t==null?void 0:t.accountId.value)||"",numberOfRecords:($==null?void 0:$.numberOfRecords)||($==null?void 0:$.rowLimit)||10,fields:T,filters:($==null?void 0:$.whereCondition)||[]};try{const q=await Ct({data:O,config:{pathKey:"catalog.getProductItems"}});if(!q||!q.selected_products||typeof q.selected_products!="object")return console.warn("[CATALOG:getProductItems] Invalid response structure",{responseObj:q}),{items:[],count:0};const M=q.selected_products,U=Object.values(M).map(j=>{var H;return(H=j==null?void 0:j.catalogResponse)==null?void 0:H.productInfo}).filter(Boolean);U.forEach(j=>{var ne,Q,ce,ue;const H=JSON.parse(JSON.stringify(X)),Z=We(j,K?"XX_ORD1__Friendly_URL__c":"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),te=We(j,K?"XX_ORD1__SYS_Requires_Configuration__c":"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");K?H.itemId=j.Id:(H.itemId=j.XX_ORD1__Item__c,H.catalogItemId=j.Id),H.thumbnail.value=H.thumbnail.field&&!H.thumbnail.isStatic?We(j,H.thumbnail.field):"",H.title.value=H.title.field&&!H.title.isStatic?We(j,H.title.field):"",H.description.value=H.description.field&&!H.description.isStatic?We(j,H.description.field):"",(ne=H.attributes)==null||ne.forEach(pe=>{pe.value.field&&(pe.value.value=We(j,pe.value.field,pe.value.dataType)||"-"),pe.label.field&&(pe.label.value=We(j,pe.label.field,pe.label.dataType)||"-")}),H.requiresConfiguration=te,H.actions=H.actions.filter(({action:pe})=>pe==="ADD_TO_CART"&&h4.includes(te)||pe==="CONFIGURE"&&di.includes(te)||pe==="UPLOAD"&&f4.includes(te)||!p4.includes(pe)),(Q=H.actions)==null||Q.forEach(pe=>{if(pe.action==="CUSTOM"){const{url:ie,label:de}=pe;ie.isStatic||(ie.value=We(j,ie.field)),de.isStatic||(de.value=We(j,de.field))}}),((ce=H.friendlyURLFields)==null?void 0:ce.length)>0&&Z?((ue=H.friendlyURLFields)==null||ue.forEach(pe=>{H.friendlyURL=H.friendlyURL.replace(`{!${pe}}`,We(j,pe))}),H.friendlyURL="/"+H.friendlyURL+"/"+Z):H.url&&(H.friendlyURL=H.url+"/"+j.Id),H.friendlyURL&&(H.friendlyURL=H.friendlyURL.replace(/\/{2,}/g,"/")),P.push(H)});const L=Number(((F=q==null?void 0:q.data)==null?void 0:F.totalCount)||U.length)||0;return{items:P,count:L>2e3?2e3:L}}catch(q){console.log("[CATALOG:getProductItems] new API error",q);return}}async function k($){var P;console.log("[CATALOG:getEcatalogDetails] jsonData",$),$.accountID=t.accountId.value;const X={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getEcatalogDetails&ut=${t.userId.value}`,payload:JSON.stringify($)}},W=await qn(wn,X),K=Eo(W);if(K!==!1)return(P=JSON.parse(K))==null?void 0:P.recordData}async function B($,X=()=>{}){$.accountID=t.accountId.value||"";const W={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify($)}},K=await qn(wn,W,void 0,!0),P=JSON.parse(JSON.parse(K.response.salesforceActions).content);return X(P),P}async function D($,X=()=>{}){const W={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getCatalogPicklistGroupCounts&ut=${t.userId.value}`,payload:JSON.stringify($)}},K=await qn(wn,W,void 0,!0);return X(JSON.parse(JSON.parse(K.response.salesforceActions).content)),JSON.parse(JSON.parse(K.response.salesforceActions).content)}async function w(){var P,N,T,O,F,q;console.log("[CATALOG:getObjectDetails] start",{currentQuoteId:o.value,payload:f.value});const $=t.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 X={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",X.data.endpoint),c.quoteDetails=!0,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> true");const W=await qn(wn,X,void 0,!0);console.log("[CATALOG:getObjectDetails] response received",{hasResponse:!!(W!=null&&W.response),len:String(((P=W==null?void 0:W.response)==null?void 0:P.salesforceActions)||"").length});const K=Eo(W,!0);return console.log("[CATALOG:getObjectDetails] extracted content",{hasContent:!!K}),c.quoteDetails=!1,console.log("[CATALOG:getObjectDetails] loading.quoteDetails -> false"),K?(l.value=JSON.parse(K),console.log("[CATALOG:getObjectDetails] quoteRecord set",{id:(N=l.value)==null?void 0:N.Id,accountName:(T=l.value)==null?void 0:T.XX_ORD1__Account_Name__c,checkedOut:(O=l.value)==null?void 0:O.XX_ORD1__Checked_Out__c}),t.quoteAccount=(F=l.value)==null?void 0:F.XX_ORD1__Account_Name__c,l.value.XX_ORD1__Checked_Out__c?(console.warn("[CATALOG:getObjectDetails] Quote is already checked out, resetting quoteId"),r.value=!0,console.log("[CATALOG:getObjectDetails] end (checked out) -> false"),!1):(console.log("[CATALOG:getObjectDetails] end (success)",{id:(q=l.value)==null?void 0:q.Id}),l.value)):(console.warn("[CATALOG:getObjectDetails] no content returned, resetting quoteId",{qtId:$}),console.log("[CATALOG:getObjectDetails] end (no content) -> false"),!1)}const v=St(S,500);async function S($=!1){var K;console.log("[CATALOG:getQuoteItems] start",{noLoad:$}),c.value.qliRecords=!$;const X=t.quoteId.value;if(console.log("[CATALOG:getQuoteItems] qtId",X),!X){console.log("[CATALOG:getQuoteItems] No quote found!"),c.value.qliRecords=!1,console.warn("[CATALOG:getQuoteItems] No quote found, aborting");return}const W={objectId:X};try{const P=await Ct({data:JSON.stringify(W),config:{pathKey:"catalog.getLineItems"}}),N=((K=P==null?void 0:P.data)==null?void 0:K.products)||(P==null?void 0:P.products)||[],T=[],O={};N.forEach(F=>{const q=F==null?void 0:F.productLineItem;q&&(T.push(q),q.XX_ORD1__Item__c&&(O[q.XX_ORD1__Item__c]=q)),(Array.isArray(F==null?void 0:F.options)?F.options:[]).forEach(U=>{T.push(U),U.XX_ORD1__Item__c&&(O[U.XX_ORD1__Item__c]=U)})}),i.value=T,s.value=O,n.value=T.length,c.value.qliRecords=!1,console.log("[CATALOG:getQuoteItems] end (success)",{count:T.length}),Et("catalog:items-fetched",{quoteId:X,items:i.value,count:n.value})}catch(P){console.warn("[CATALOG:getQuoteItems] error",P),c.value.qliRecords=!1}}async function I($){console.log("[CATALOG:getSavedFilter] ecfr",$);const X={action:"makeCall",data:{...f.value,callType:"GET",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=getSavedFilter&ut=${t.userId.value}&ecfr=${$}`}},W=await qn(wn,X,void 0,!0),K=Eo(W);return K?(console.log("[CATALOG:getSavedFilter] Saved Filters",K),JSON.parse(K)):!1}async function R(){var K;console.log("[CATALOG:calculateAvaTax]"),h.value=null;const $=t.quoteId.value;if(!$)return;(K=l.value)!=null&&K.Id||await w();const X=l.value;if(X.XX_ORD1__Shipping_Address__c&&X.XX_ORD1__Shipping_City__c&&X.XX_ORD1__Shipping_Country__c&&X.XX_ORD1__Shipping_State__c&&X.XX_ORD1__Shipping_Zip__c){const P={recordId:$,isCommit:!1},N={action:"makeCall",data:{...f.value,callType:"POST",endpoint:`/services/apexrest/XX_ORD1/ecommerce?type=calculateAvaTax&ut=${t.userId.value}`,payload:JSON.stringify(P)}};d.value=!0;const T=await qn(wn,N,void 0,!0),O=Eo(T);if(O)console.log("[CATALOG:calculateAvaTax] content",O);else{const F=JSON.parse(T.response.salesforceActions).content;h.value=F}d.value=!1}else console.log("[CATALOG:calculateAvaTax] Shipping address not found so tax can not be calculated")}function z($,X,W=!0){const K=X.qtyTiers;if(!K)return null;const P=K.find(N=>N.ev===null?$>=N.sv:$>=N.sv&&$<=N.ev);return P?W?P.formattedOfferPrice:P.originalPrice:null}return{quoteCheckedOut:r,avaTaxError:h,avaTaxLoading:d,cartCount:n,cartUpdated:x,quoteId:o,loading:c,filter:m,quoteRecord:l,secondQuoteId:a,qliRecords:i,savedItems:s,savedFilter:u,getObjectDetails:w,getSavedFilter:I,saveItemToQuoteBlinkTxn:_,updateQuoteLineQtyTxn:E,deleteLineItems:g,getPicklistFilterData:D,getQuoteItems:S,updateCart:C,getFilterData:B,getProductItems:A,calculateAvaTax:R,getEcatalogDetails:k,getVolumePrice:z,configurableItemsSorted:b,getTopConfigurableItem:p,getQuoteItems:S}}),fi=it.defineStore("composableCatalog",()=>{const t=Co();mn();const r=Mt(),n=ft(),o=e.ref(!0),a=e.ref({accountId:"",contactId:"",userType:"",domain:"",locale:"en-US"}),i=e.ref({}),l=e.ref(""),s=e.ref(""),u=e.ref(""),h=e.ref(""),d=e.ref(""),m=e.ref(""),c=e.ref(null),y=e.ref(!1),f=e.computed(()=>h.value+"::"+d.value);async function b(){c.value=null,y.value=!0;try{const B={domain:n.hostName.value,templateBlocksFilter:{templateId:{eq:"wrapperDefault"}}},D=Date.now().toString(),w=await Ue.post(`${n.graphqlEndpoint.value}?t=${D}`,{query:u4,variables:B},{headers:{"Content-Type":"application/json","x-api-key":n.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",w);const v=w&&w.data?w.data:null;console.log("[COMPOSABLECATALOG:fetchDomainDetails] payload",v);const S=v&&v.data&&v.data.dataByDomain&&Array.isArray(v.data.dataByDomain.items)?v.data.dataByDomain.items:[],I=S.length?S[0]:null;return console.log("[COMPOSABLECATALOG:fetchDomainDetails] item",I),console.log("[COMPOSABLECATALOG:fetchDomainDetails] storefrontDetails",i.value),i.value=I,a.value={accountId:I.guestAccountId,contactId:"",userType:"AWSGuest",domain:I.domain,locale:"en-US"},h.value=I.organization.salesforceOrgId,d.value=I.storefrontId,I}catch(B){throw console.info("[COMPOSABLECATALOG:fetchDomainDetails] Error fetching domain",B),c.value=B&&B.message?B.message:"Unknown error",B}finally{y.value=!1}}function p(B){s.value=(B==null?void 0:B.templateId)??"",u.value=(B==null?void 0:B.quoteId)??"",m.value=(B==null?void 0:B.userId)??""}function x(B){u.value=B}function g(B){i.value=B}async function C(){try{await t.fetchBlockInformation({templateId:s.value,storefrontId:d.value},!0)}catch(B){r.handleError(B,"getBlockInformation")}}const _=async()=>{var B,D;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!d.value)try{const w=await br(fc,{storefrontId:d.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",w),((D=(B=w.content)==null?void 0:B.items)==null?void 0:D[0])??null}catch(w){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",w)}},E=()=>{if(typeof document>"u")return;const B=h.value,D=d.value;if(!B||!D)return;const w=`${Qn}/${B}/${D}/css/theme_${D}.css`;let v=!1;if(typeof window<"u"&&window.VueExpediteComponents&&typeof window.VueExpediteComponents.applyThemeToShadows=="function")try{window.VueExpediteComponents.applyThemeToShadows(w),v=!0}catch($){console.warn("[COMPOSABLECATALOG:setThemeData] shadow injection failed; will inject in head",$)}let S="";try{S=new URL(n.graphqlEndpoint.value).origin}catch{}const I=typeof window<"u"?window.location.href:"",R=($,X={})=>{const W=document.head||document.getElementsByTagName("head")[0];if(!W)return;let K=document.getElementById($);K||(K=document.createElement("link"),K.id=$,W.appendChild(K)),Object.entries(X).forEach(([P,N])=>{N!=null&&K.setAttribute(P,String(N))})};(($,X,W=!0)=>{const K=document.head||document.getElementsByTagName("head")[0];if(!K||document.getElementById($))return;const P=document.createElement("script");P.id=$,P.src=X,W&&(P.async=!0),K.appendChild(P)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),R("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),S&&R("ec-preconnect-appsync",{rel:"preconnect",href:S}),v||R("ec-theme-stylesheet",{rel:"stylesheet",href:w}),R("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"}),I&&R("ec-canonical",{rel:"canonical",href:I}),R("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Qn}/expedite/Expedite_Favicon.ico`})};function A(){return!0}function k(){s.value="",u.value="",h.value="",d.value="",m.value=""}return{templateId:s,isLoading:o,activeStorefrontInfo:a,quoteAccount:l,storefrontDetails:i,salesforceOrgId:h,storefrontId:d,userId:m,orgWithStorefrontId:f,useVisiblity:A,fetchDomainDetails:b,setData:p,setQuoteId:x,setStorefrontDetails:g,getBlockInformation:C,getTheme:_,setThemeData:E,reset:k}}),b4=t=>{const r=t.match(/query\s+(\w+)/);return r?r[1]:null},x4=t=>t.replace(/[-_\s]+/g," ").trim().replace(/^(.)/,(r,n)=>n.toLowerCase()).replace(/\s(\w)/g,(r,n)=>n.toUpperCase()).replace(/\s/g,""),pc=t=>{try{JSON.parse(t)}catch{return!1}return!0},hi=new Map,br=async(t,r=null)=>{var s,u,h;const n=fi(),o=ft();let a=200,i,l;try{const d=r,m=o.accountId.value||"";d.data&&n.activeStorefrontInfo&&!t.includes("CognitoActions")&&!t.includes("GetLoginInfo")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data.userType=((s=n.activeStorefrontInfo)==null?void 0:s.userType)||"",d.data.accountId=m||((u=n.activeStorefrontInfo)==null?void 0:u.accountId)||"",d.data.domain=o.hostName.value),!t.includes("GetLoginInfo")&&!t.includes("CognitoActions")&&!t.includes("query listUsers")&&!t.includes("UserActivityLog")&&(d.data={...d.data,domain:o.hostName.value});const c=c4([t,d,m]);if(hi.has(c))i=hi.get(c);else try{const b=await Ue.post(o.graphqlEndpoint.value,{query:t,variables:d},{headers:{"Content-Type":"application/json","x-api-key":o.apiKey.value}});if(!b.data)return{statusCode:500,content:"Error fetching data from AppSync."};i=b.data.data,hi.set(c,i)}catch(b){const p=((h=b==null?void 0:b.response)==null?void 0:h.status)||500;return p===401&&console.info("401",t,r),{statusCode:p,content:"Error fetching data from AppSync."}}const y=b4(t);if(!y)return{statusCode:404,content:"Query name not found, improper request."};const f=x4(y);i=i[f],pc(i)&&(i=JSON.parse(i)),i&&i.statusCode&&i.statusCode===401&&console.info("401",t,r),l=i!=null&&i.content?i.content:i,pc(l)&&(l=JSON.parse(l))}catch(d){a=400,l=d}return{statusCode:a,content:l}},xr=e.ref(""),mc=e.ref(""),pi=e.ref(""),yc=e.ref(""),mi=e.ref(""),ko=e.ref(""),vo=e.ref(""),gc=e.ref(""),bc=e.ref(""),xc=e.ref(""),_c=e.ref(""),yi=e.ref(""),Cc=e.ref(""),_4=e.ref(!1),C4=e.ref(null),E4=e.ref(null),Ec=e.ref(""),kc=e.ref(""),vc=e.ref(""),Ac=e.ref(""),wc=e.ref("");function ft(){function t(s){s.templateId!==void 0&&(xr.value=s.templateId),s.hostName!==void 0&&(mc.value=s.hostName),s.graphqlEndpoint!==void 0&&(pi.value=s.graphqlEndpoint),s.apiKey!==void 0&&(yc.value=s.apiKey),s.accountId!==void 0&&(mi.value=s.accountId),s.organizationId!==void 0&&(ko.value=s.organizationId),s.storefrontId!==void 0&&(vo.value=s.storefrontId),s.cid!==void 0&&(gc.value=s.cid),s.userId!==void 0&&(bc.value=s.userId),s.composablesApiUrl!==void 0&&(xc.value=s.composablesApiUrl),s.composablesApiKey!==void 0&&(_c.value=s.composablesApiKey),s.accessToken!==void 0&&(yi.value=s.accessToken),s.composablesOrgType!==void 0&&(Cc.value=s.composablesOrgType),s.isPreview!==void 0&&(_4.value=s.isPreview),s.sections!==void 0&&(C4.value=s.sections),s.theme!==void 0&&(E4.value=s.theme),s.quoteId!==void 0&&(Ec.value=s.quoteId),s.websocketUrl!==void 0&&(kc.value=s.websocketUrl),s.packageVersion!==void 0&&(vc.value=s.packageVersion),s.eCatalogId!==void 0&&(Ac.value=s.eCatalogId),s.accountId!==void 0&&(mi.value=s.accountId),s.siteUrl!==void 0&&(wc.value=s.siteUrl)}const r=async()=>{var s,u;if(console.log("[COMPOSABLECATALOG:getTheme]"),!!vo.value)try{const h=await br(fc,{storefrontId:vo.value,filter:{key:{eq:"theme"},templateId:{eq:"wrapper"}}});return console.log("[COMPOSABLECATALOG:getTheme] themeData",h),((u=(s=h.content)==null?void 0:s.items)==null?void 0:u[0])??null}catch(h){console.log("[COMPOSABLECATALOG:getTheme] Error getting theme data",h)}},n=async()=>{var s,u,h;try{const d=await Ct({action:"retrieveMeta",data:{salesforceOrgId:ko.value,storefrontId:xr.value,templateId:"wrapper",key:"theme"},config:{pathKey:"retrieveMeta"}}),m=((u=(s=d==null?void 0:d.data)==null?void 0:s[0])==null?void 0:u.value)??((h=d==null?void 0:d.data)==null?void 0:h.value);return console.log("[COMPOSABLECATALOG:fetchThemeREST] themeData",m),m??null}catch(d){throw console.log("[COMPOSABLECATALOG:fetchThemeREST] Error getting theme data",d),d}};return{hostName:mc,graphqlEndpoint:pi,apiKey:yc,accountId:mi,organizationId:ko,storefrontId:vo,cid:gc,userId:bc,composablesApiUrl:xc,composablesApiKey:_c,accessToken:yi,composablesOrgType:Cc,quoteId:Ec,websocketUrl:kc,packageVersion:vc,eCatalogId:Ac,siteUrl:wc,updateConfig:t,getTheme:r,fetchThemeREST:n,setThemeData:()=>{if(typeof document>"u")return;const s=ko.value,u=vo.value;if(!s||!u)return;const h=`${Qn}/${s}/${u}/css/theme_${u}.css`;let d="";try{d=new URL(pi.value).origin}catch{}const m=typeof window<"u"?window.location.href:"",c=(f,b={})=>{const p=document.head||document.getElementsByTagName("head")[0];if(!p)return;let x=document.getElementById(f);x||(x=document.createElement("link"),x.id=f,p.appendChild(x)),Object.entries(b).forEach(([g,C])=>{C!=null&&x.setAttribute(g,String(C))})};((f,b,p=!0)=>{const x=document.head||document.getElementsByTagName("head")[0];if(!x||document.getElementById(f))return;const g=document.createElement("script");g.id=f,g.src=b,p&&(g.async=!0),x.appendChild(g)})("ec-webfont-loader","https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",!0),c("ec-preconnect-fonts",{rel:"preconnect",href:"https://fonts.gstatic.com"}),d&&c("ec-preconnect-appsync",{rel:"preconnect",href:d}),c("ec-theme-stylesheet",{rel:"stylesheet",href:h}),c("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"}),m&&c("ec-canonical",{rel:"canonical",href:m}),c("ec-favicon",{rel:"icon",type:"image/x-icon",href:`${Qn}/expedite/Expedite_Favicon.ico`})},processSections:async(s,u)=>{const h=Co();if(s&&u)try{const d=typeof u=="string"?JSON.parse(u):u;h.pageBlocks=d}catch(d){console.error("[ExpediteCart] Error parsing sections:",d)}else s||await h.fetchBlockInformationREST({templateId:xr.value||xr.value})},processTheme:async(s,u)=>{if(console.log("[COMPOSABLECATALOG:processTheme] isPreview",s),console.log("[COMPOSABLECATALOG:processTheme] theme",u),s&&u)try{return JSON.parse(u)}catch(h){return console.error("[ExpediteCart] Error parsing theme:",h),null}else if(!s)try{return await n()}catch(h){return console.error("[ExpediteCart] Error fetching theme:",h),null}return null},fetchAccessToken:async(s,u)=>{try{const h=(u==null?void 0:u.organizationId)||ko.value||"",d=(s==null?void 0:s.version)||"",m=s==null?void 0:s.awsExternalMSBaseURL;if(!m)throw new Error("awsExternalMSBaseURL is required in awsConnectionInfo");const c=await Ct({data:{Org_Id:h,Version:d},config:{baseUrl:m,pathKey:"fetchAccessToken"}});return console.log("fetchAccessToken - Response:",c),c!=null&&c.Access_Token&&(yi.value=c.Access_Token),c}catch(h){throw console.error("getAccessToken catch ::",h),console.error("Error details:",{message:h.message,stack:h.stack,name:h.name}),h}}}}const k4=["href"],v4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons","data-name":"ec-material-icons"},null,-1),A4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Outlined","data-name":"ec-material-icons-outlined"},null,-1),w4=e.createElementVNode("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/icon?family=Material+Icons+Round","data-name":"ec-material-icons-round"},null,-1),N4=e.createElementVNode("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),Nc={__name:"AtomThemeLoader",props:{organizationId:{type:String,required:!0},templateId:{type:String,required:!0},isPreview:{type:Boolean,required:!0},theme:{type:Object,required:!0}},setup(t){const r=t,n=ft(),o=e.ref(""),a=e.ref(""),i=async()=>{if(!(!r.organizationId||!r.templateId))try{const l=await n.processTheme(r.isPreview,r.theme);l&&(o.value=l),n.setThemeData();const s=Date.now(),u=`${Qn}/${r.organizationId}/${r.templateId}/css/theme_${r.templateId}.css?t=${s}`;console.log("[ATOMTHEMELOADER:loadTheme] styleURL",u),a.value=u}catch(l){console.error("[ATOMTHEMELOADER:loadTheme] Error loading theme",l)}};return e.onBeforeMount(()=>{i()}),e.watch(()=>[r.organizationId,r.templateId,r.isPreview,r.theme],()=>{i()},{deep:!0}),(l,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:0,"data-name":"template-theme"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value),1)]),_:1})):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("link",{key:1,rel:"stylesheet",href:a.value,"data-name":"ec-theme-stylesheet-link"},null,8,k4)):e.createCommentVNode("",!0),v4,A4,w4,N4],64))}},S4={KNOWLEDGE_DETAIL:"knowledgeDetail"},Sc={"Catalog Price":"XX_ORD1__Negotiated_Price__c","List Price":"XX_ORD1__List_Price2__c"},B4={name:"SkeletonLoader"},I4={class:"skeleton-loader"};function T4(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",I4)}const Qt=ve(B4,[["render",T4],["__scopeId","data-v-826b27ef"]]),Re=ve({__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(t){const r=t,n={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"},o=e.ref(!1),a=e.computed(()=>{if(r.text===null||r.text===void 0)return"";const u=String(r.text);return(u==null?void 0:u.replace(/\r\n|\n/g,"<br>"))||""}),i=e.computed(()=>{var h,d;const u=r.tag||((h=r.style)==null?void 0:h.tag)||((d=r.secStyle)==null?void 0:d.tag)||"p";return u==="large"||u==="strong"?"div":u}),l=e.computed(()=>{var h;const u=r.tag||((h=r.style)==null?void 0:h.tag)||"p";return n[u]||"ecb-text-regular"}),s=e.computed(()=>{var h,d;const u={};if(r.style&&((h=r.style)!=null&&h.overrite)){const{bold:m,color:c,italic:y,underline:f,strikethrough:b,strikeThrough:p,size:x,family:g,lineHeight:C}=r.style;m&&(u.fontWeight="700"),c&&(u.color=c),y&&(u.fontStyle="italic"),g&&(u.fontFamily=g),C&&(u.lineHeight=C),f?u.textDecoration="underline":(b||p)&&(u.textDecoration="line-through"),x&&(u.fontSize=x)}if(r.secStyle&&((d=r.secStyle)!=null&&d.overrite)){const{bold:m,color:c,italic:y,underline:f,strikethrough:b,strikeThrough:p,size:x,family:g,lineHeight:C}=r.secStyle;m&&(u.fontWeight="700"),c&&(u.color=c),y&&(u.fontStyle="italic"),g&&(u.fontFamily=g),C&&(u.lineHeight=C),f?u.textDecoration="underline":(b||p)&&(u.textDecoration="line-through"),x&&(u.fontSize=x)}for(const m of r.inherit)u[m]="inherit";return u});return(u,h)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(t.cssStyle),class:"custom-tag-skeletion"},[e.createVNode(Qt)],4)):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),e.mergeProps({key:1},u.$attrs,{type:t.method,disabled:t.disabled,style:s.value,class:l.value,onMouseover:h[0]||(h[0]=d=>o.value=!0),onMouseout:h[1]||(h[1]=d=>o.value=!1),innerHTML:a.value}),null,16,["type","disabled","style","class","innerHTML"]))}},[["__scopeId","data-v-14a516b4"]]),O4={key:1,class:"field-label"},D4={class:"ect-flex ect-flex-col ect-justify-start"},V4={key:0,class:"ect-pr-5"},F4={key:1,class:"field-value ect-pr-5"},M4={key:1,class:"field-value"},Bc=ve({__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(t){const r=mn(),n=t,o=e.computed(()=>!1),a=e.computed(()=>{var c;return n.offer.offerValue.offerId&&n.offer.offerValue.formattedOfferPrice||n.offer.offerValue.rpId&&((c=n.offer.offerValue.qtyTiers)==null?void 0:c.length)>0?!!n.appliedOnOfferMatchingField:!1}),i=e.computed(()=>n.offer.offerDetails.styles.offerValue.textStyles.tag),l=e.computed(()=>n.offer.offerDetails.styles.offerDescription.textStyles),s=e.computed(()=>{var m,c;return(m=n.offer.offerValue)!=null&&m.qtyTiers?r.getVolumePrice(n.itemCount>0?n.itemCount:1,n.offer.offerValue):(c=n.offer.offerValue)==null?void 0:c.formattedOfferPrice}),u=e.computed(()=>({"ect-flex ect-line-through":o.value&&n.offer.offerValue&&a.value})),h=e.computed(()=>n.value&&(n.value.isStatic||!n.loading)),d=e.computed(()=>(o.value&&!n.isProductSummary||n.isProductSummary&&n.index===0)&&n.showOfferDescription&&n.appliedOnOfferMatchingField);return(m,c)=>{var y,f;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.field,"field ect-gap-1 ect-flex ect-flex-col"])},[t.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(y=t.label.style)==null?void 0:y.tag,text:t.label.value,style:e.normalizeStyle(t.label.style),class:e.normalizeClass(`${t.field}_label`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",O4,[e.createVNode(Qt)])),e.createElementVNode("div",D4,[o.value&&n.offer.offerValue&&a.value?(e.openBlock(),e.createElementBlock("div",V4,[e.createVNode(Re,{tag:i.value,text:s.value,style:e.normalizeStyle(t.offer.offerDetails.styles.offerValue.textStyles),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])])):o.value&&!n.offer.offerValue?(e.openBlock(),e.createElementBlock("div",F4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(u.value)},[h.value?(e.openBlock(),e.createBlock(Re,{key:0,tag:(f=t.value.style)==null?void 0:f.tag,text:t.value.value,style:e.normalizeStyle(t.value.style),class:e.normalizeClass(`${t.field}_value`)},null,8,["tag","text","style","class"])):(e.openBlock(),e.createElementBlock("div",M4,[e.createVNode(Qt)]))],2)]),d.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"field-description ect-left-0 ect-w-max ect-pt-2",style:e.normalizeStyle({maxWidth:t.parentWidth?t.parentWidth+"px":void 0})},[e.createVNode(Re,{tag:l.value.tag,text:n.offer.offerValue.offerDescShort,style:e.normalizeStyle(l.value),class:e.normalizeClass(t.field+"_value")},null,8,["tag","text","style","class"])],4)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b0e72386"]]),R4={key:1,class:"filter"},L4={class:"filter-title"},P4={key:0,class:"filter-desc"},q4={key:1,class:"filter-desc"},$4={key:2,class:"filter-desc"},Ic=ve({__name:"AtomProductText",props:{title:{type:Object,default:()=>({})},description:{type:Object,default:null},loading:{type:Boolean,default:!1},url:{type:String,default:null}},setup(t){const r=Ko(),n=t;function o(){n.url&&!n.loading&&r.push(n.url)}return(a,i)=>t.loading?(e.openBlock(),e.createElementBlock("div",R4,[e.createElementVNode("div",L4,[e.createVNode(Qt)]),t.description?(e.openBlock(),e.createElementBlock("div",P4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",q4,[e.createVNode(Qt)])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("div",$4,[e.createVNode(Qt)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.title?(e.openBlock(),e.createBlock(Re,{key:0,class:e.normalizeClass({"ect-cursor-pointer":t.url}),text:t.title.value,style:e.normalizeStyle(t.title.style),onClick:o},null,8,["class","text","style"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(Re,{key:1,text:t.description.value,style:e.normalizeStyle(t.description.style)},null,8,["text","style"])):e.createCommentVNode("",!0)],64))}},[["__scopeId","data-v-5b4d627e"]]),U4={name:"Spinner"},z4={class:"spinner"};function j4(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",z4)}const Ao=ve(U4,[["render",j4],["__scopeId","data-v-83f8c910"]]),H4={name:"AtomSkeletonWidget",components:{AtomSkeletonLoader:Qt,AtomSpinner:Ao},props:{rows:{type:Number,default:4},type:{type:String,default:"full"},className:{type:String,default:""}},data(){return{SKELETON_TYPE:S4}}},gi=t=>(e.pushScopeId("data-v-956cc081"),t=t(),e.popScopeId(),t),G4={key:0,class:"page"},K4=gi(()=>e.createElementVNode("div",{class:"page-header"},null,-1)),X4={class:"page-body"},W4={class:"page-body_board"},Q4={key:1,class:"field"},Z4={key:2,class:"filter"},J4={class:"filter-option_inner"},Y4={key:3,class:"full"},e9={key:4,class:"shuttle"},t9={class:"shuttle-full"},n9={class:"shuttle-full"},o9={class:"shuttle-half"},r9={class:"shuttle-half"},a9={class:"shuttle-button"},i9={key:5,class:"shuttle2"},l9={class:"shuttle2-full"},s9=gi(()=>e.createElementVNode("span",null,"Processing payment",-1)),c9={key:6,class:"shuttle2"},u9={class:"shuttle2-full"},d9=gi(()=>e.createElementVNode("span",null,"Processing order",-1)),f9={key:10,class:"skeleton-shipping"},h9={class:"skeleton-shipping-full"},p9={class:"skeleton-shipping-half"},m9={key:11,class:"skeleton-terms"},y9={class:"skeleton-terms-half"},g9={class:"skeleton-terms-full"},b9={class:"skeleton-terms-full"},x9={key:12,class:""},_9={class:"skeleton-terms-half"},C9={key:13,class:""},E9={class:"skeleton-terms-half"},k9={key:14,class:"product"},v9={class:"product-image"},A9={class:"product-texts"},w9={class:"product-description"},N9={class:"product-action"},S9={class:"product-button"},B9={key:15,class:""};function I9(t,r,n,o,a,i){const l=e.resolveComponent("AtomSkeletonLoader"),s=e.resolveComponent("AtomSpinner");return n.type==="page"?(e.openBlock(),e.createElementBlock("div",G4,[K4,e.createElementVNode("div",X4,[e.createElementVNode("div",W4,[e.createVNode(l)])])])):n.type==="fieldattribute"?(e.openBlock(),e.createElementBlock("div",Q4,[e.createVNode(l)])):n.type==="filteroptions"?(e.openBlock(),e.createElementBlock("div",Z4,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,u=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"filter-option"},[e.createElementVNode("div",J4,[e.createVNode(l)])]))),128))])):n.type==="full"?(e.openBlock(),e.createElementBlock("div",Y4,[e.createVNode(l)])):n.type==="shuttle"?(e.openBlock(),e.createElementBlock("div",e9,[e.createElementVNode("div",t9,[e.createVNode(l)]),e.createElementVNode("div",n9,[e.createVNode(l)]),e.createElementVNode("div",o9,[e.createVNode(l)]),e.createElementVNode("div",r9,[e.createVNode(l)]),e.createElementVNode("div",a9,[e.createVNode(l)])])):n.type==="shuttle-done"?(e.openBlock(),e.createElementBlock("div",i9,[e.createElementVNode("div",l9,[e.createVNode(s,{class:"shuttle2-spinner"}),e.createTextVNode(),s9])])):n.type==="order-processing"?(e.openBlock(),e.createElementBlock("div",c9,[e.createElementVNode("div",u9,[e.createVNode(s,{class:"shuttle2-spinner"}),e.createTextVNode(),d9])])):n.type==="enhanceFilter"?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="offers"?(e.openBlock(),e.createElementBlock("div",{key:8,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="detailPage"?(e.openBlock(),e.createElementBlock("div",{key:9,class:e.normalizeClass(n.className)},[e.createVNode(l)],2)):n.type==="shippingAddress"?(e.openBlock(),e.createElementBlock("div",f9,[e.createElementVNode("div",h9,[e.createVNode(l)]),e.createElementVNode("div",p9,[e.createVNode(l)])])):n.type==="termsAndPayment"?(e.openBlock(),e.createElementBlock("div",m9,[e.createElementVNode("div",y9,[e.createVNode(l)]),e.createElementVNode("div",g9,[e.createVNode(l)]),e.createElementVNode("div",b9,[e.createVNode(l)])])):n.type==="accordian-title"?(e.openBlock(),e.createElementBlock("div",x9,[e.createElementVNode("div",_9,[e.createVNode(l)])])):n.type==="imageDiv"?(e.openBlock(),e.createElementBlock("div",C9,[e.createElementVNode("div",E9,[e.createVNode(l)])])):n.type==="product-detail"?(e.openBlock(),e.createElementBlock("div",k9,[e.createElementVNode("div",v9,[e.createVNode(l)]),e.createElementVNode("div",A9,[e.createVNode(l)]),e.createElementVNode("div",w9,[e.createVNode(l)]),e.createElementVNode("div",N9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.rows,u=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"product-action_item"},[e.createVNode(l)]))),128))]),e.createElementVNode("div",S9,[e.createVNode(l)])])):n.type===a.SKELETON_TYPE.KNOWLEDGE_DETAIL?(e.openBlock(),e.createElementBlock("div",B9,[e.createVNode(l,{class:e.normalizeClass(n.className)},null,8,["class"])])):e.createCommentVNode("",!0)}const yn=ve(H4,[["render",I9],["__scopeId","data-v-956cc081"]]),T9=["src"],bi={__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(t){const r=ft(),n=t,o=e.computed(()=>n.src.includes("/resource/")&&!n.src.includes("://")&&n.resourcesDomain?n.resourcesDomain+n.src:n.src.includes("/servlet/servlet.ImageServer")&&!n.src.includes("://")&&n.resourcesDomain?n.resourcesDomain+"/"+n.src:n.src.includes("/servlet/servlet.ImageServer")&&!n.src.includes("://")&&r.siteUrl?r.siteUrl.value+"/"+n.src:n.src);return(a,i)=>t.loading?(e.openBlock(),e.createBlock(yn,{key:0,type:"full"})):t.src?(e.openBlock(),e.createElementBlock("img",{key:1,src:o.value,placeholder:[30,20],class:"rounded",sizes:"props.sizes"},null,8,T9)):e.createCommentVNode("",!0)}},O9={class:"counter"},D9=["disabled"],V9={key:0,class:"counter-spinner"},F9=["max","disabled","value"],M9=["disabled"],_r=ve({__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(t,{emit:r}){const n=t,o=r,a=e.computed(()=>n.disabled||n.loading),i=St(function(h){const d=String(h??"");if(d==="")return;const m=Number(d);Number.isNaN(m)||o("update:modelValue",m)}),l=h=>{(h.key==="."||h.key==="e"||h.key==="E")&&!h.ctrlKey&&!h.metaKey&&n.decimal&&h.preventDefault()};function s(){n.modelValue<n.max&&o("update:modelValue",n.modelValue+1)}function u(){n.modelValue>n.min&&o("update:modelValue",n.modelValue-1)}return(h,d)=>(e.openBlock(),e.createElementBlock("div",O9,[e.createElementVNode("button",{disabled:t.modelValue<=t.min||a.value,onClick:u},[e.createVNode(Be,{icon:t.modelValue>1?"minus":"close",size:10},null,8,["icon"])],8,D9),t.loading?(e.openBlock(),e.createElementBlock("div",V9,[e.createVNode(Ao,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",min:"0",max:t.max,disabled:a.value,value:t.modelValue,step:"1",onInput:d[0]||(d[0]=m=>e.unref(i)(m.target.value)),onKeydown:l},null,40,F9)),e.createElementVNode("button",{disabled:t.modelValue>=t.max||a.value,onClick:s},[e.createVNode(Be,{class:"ect-transform ect-rotate-45",icon:"add",size:12})],8,M9)]))}},[["__scopeId","data-v-886bff8a"]]),Tc=e.ref(!1),Oc=e.ref(!1),Dc=e.ref(!1),Vc=e.ref(!1),xi=()=>{if(typeof window<"u"){const t=()=>{const r=window.innerWidth;Oc.value=r<768,Dc.value=r>=768&&r<1024,Vc.value=r>=1024};e.onMounted(()=>{Tc.value||(Tc.value=!0,window.addEventListener("resize",t),t())})}return{isMobile:Oc,isTablet:Dc,isDesktop:Vc}},R9=["disabled"],L9=["disabled"],P9={class:"ect-w-max"},q9={class:"button-header-icon"},$9=["onClick"],U9={key:0,class:"button-options_item-icon"},z9=["disabled"],j9={class:"ect-w-max"},H9={class:"button-header-icon"},G9=["onClick"],K9={key:0,class:"button-options_item-icon"},Fc=ve({__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(t,{emit:r}){const n=t,o=xi(),a=e.ref(!1),i=e.ref(null),l=e.ref({}),s=e.ref(!1),u=r;function h(b){b.stopPropagation(),a.value=!a.value}function d(b){b.stopPropagation(),a.value=!a.value,s.value=e.ref(a.value)}function m(b){u("selected",b),a.value=!1}function c(){!o.isMobile.value&&!n.disabled&&(a.value=!0)}function y(){!o.isMobile.value&&!s.value&&(a.value=!1)}function f(b){a.value&&(a.value=!1,s.value=!1)}return e.onMounted(()=>{document.addEventListener("click",f)}),e.onUnmounted(()=>{document.removeEventListener("click",f)}),(b,p)=>{var x;return t.options.length===1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:p[0]||(p[0]=g=>b.$emit("selected",t.options[0]))},[e.createElementVNode("span",null,e.toDisplayString(((x=t.options[0].label)==null?void 0:x.value)||t.options[0].name),1)],8,R9)):t.options.length>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(o).isMobile.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",disabled:t.disabled,onClick:e.withModifiers(h,["stop"])},[e.createElementVNode("span",P9,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",q9,[e.createVNode(Be,{icon:"arrow_drop_down",class:"ect-relative ect-top-0.5 ect-ml-2",color:"#ffffff",size:"14"})])],8,L9),!t.disabled&&t.options.length&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"button-options",onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"button-options_grow",onClick:p[1]||(p[1]=g=>a.value=!1)}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"button-options_item",onClick:C=>m(g)},[g.selected&&t.select?(e.openBlock(),e.createElementBlock("div",U9,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(g.name),1)],8,$9))),128))])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"button-container",onMouseenter:c,onMouseleave:y},[e.createElementVNode("button",{class:"button-menu esg-btn-primary ect-bg-primary ect-uppercase ect-whitespace-nowrap",ref_key:"btnmenu",ref:i,disabled:t.disabled,onClick:e.withModifiers(d,["stop"])},[e.createElementVNode("span",j9,e.toDisplayString(t.name||t.options[0].name),1),e.createElementVNode("div",H9,[e.createVNode(Be,{class:"ect-relative ect-top-0.5 ect-ml-2",icon:"arrow_drop_down",color:"#ffffff",size:"14"})])],8,z9),!t.disabled&&t.options.length&&a.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(l.value),class:"button-options",onClick:p[3]||(p[3]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>{var C;return e.openBlock(),e.createElementBlock("div",{key:g,class:"button-options_item",onClick:_=>b.$emit("selected",g)},[g.selected&&t.select?(e.openBlock(),e.createElementBlock("div",K9,[e.createVNode(Be,{icon:"done",size:20,color:"black"})])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(((C=g.label)==null?void 0:C.value)||g.name),1)],8,G9)}),128))],4)):e.createCommentVNode("",!0)],32))],64)):e.createCommentVNode("",!0)}}},[["__scopeId","data-v-cfcf21a3"]]),X9={class:"ect-flex ect-flex-col ect-w-full"},W9={key:0,class:"ect-h-[20px] ect-w-[150px]"},Q9={key:1,class:"ect-flex ect-flex-col ect-gap-1"},Z9=ve({__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(t){var x,g;const r=fi(),n=mn(),o=t,a=e.ref(((g=(x=n.savedItems)==null?void 0:x[o.itemId])==null?void 0:g.XX_ORD1__QTY__c)||0),i=e.ref(!1),l=e.ref(null),s=e.ref(!1),u=e.ref(!1),h=e.computed(()=>o.actions&&o.actions.length>0),d=e.computed(()=>o.actions.some(C=>C.action==="ADD_TO_CART")),m=e.computed(()=>{var C,_,E;return(C=o.offer)!=null&&C.appliedOnField?Sc[(_=o.offer)==null?void 0:_.appliedOnField]===((E=o.offerSetting.value)==null?void 0:E.field):!0});e.watch(()=>n.savedItems,C=>{var _,E;C[o.itemId]&&!u.value&&((_=C[o.itemId])==null?void 0:_.XX_ORD1__QTY__c)!==a.value&&(a.value=((E=C[o.itemId])==null?void 0:E.XX_ORD1__QTY__c)||0,u.value=!0)},{deep:!0});function c(C){var _;u.value=!0,C===0&&((_=n.savedItems)!=null&&_[o.itemId])?f():p()}const y=C=>{var _;C.action==="ADD_TO_CART"?(u.value=!0,a.value=1,b()):C.action==="CONFIGURE"?Et("catalog:item-configure-clicked",{itemId:o.itemId,catalogItemId:o.catalogItemId,title:o.title,description:o.description,attributes:o.attributes,thumbnail:o.thumbnail,url:o.url,mode:o.mode,isPreview:o.isPreview}):C.action==="CUSTOM"?window.open(((_=C.url)==null?void 0:_.value)||C.value,C.newTab?"_blank":"_self"):C.action==="ORDER_PARTS"||C.action},f=async function(){i.value=!0,l.value=null;const C=[n.savedItems[o.itemId].Id];await n.deleteLineItems(C),i.value=!1},b=async function(){i.value=!0,l.value=null;const C={itemID:o.itemId,eCatalogItemID:o.catalogItemId,qty:a.value,qtyTierAmt:null};await n.saveItemToQuoteBlinkTxn(C),i.value=!1},p=St(async function(){console.log("updateToCart 1",a.value),s.value=!0,await n.updateQuoteLineQtyTxn({itemId:o.itemId,qty:a.value,eCatalogItemId:o.catalogItemId}),s.value=!1});return(C,_)=>{var E,A;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("item ecb-theme-card "+t.mode)},[e.createElementVNode("div",{class:e.normalizeClass(`item-image ${t.mode}-image`)},[e.createVNode(bi,{src:t.thumbnail.value,loading:t.loading,"resources-domain":e.unref(r).storefrontDetails.resourcesDomain},null,8,["src","loading","resources-domain"])],2),e.createElementVNode("div",{class:e.normalizeClass(`item-text ${t.mode}-text`)},[e.createVNode(Ic,{title:t.title,loading:t.loading,description:t.description},null,8,["title","loading","description"])],2),e.createElementVNode("div",X9,[e.createElementVNode("div",{class:e.normalizeClass(`item-attributes ${t.mode}-attributes`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.attributes,(k,B)=>(e.openBlock(),e.createBlock(Bc,{key:B,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:k.value,label:k.label,field:k.value.field,offer:{applyOffer:k.applyOffer,offerDetails:k.offerDetails,offerValue:o.offer},"item-count":a.value,"applied-on-offer-matching-field":m.value},null,8,["class","loading","value","label","field","offer","item-count","applied-on-offer-matching-field"]))),128))],2),o.offerSetting&&m.value&&((E=o.offer)!=null&&E.offerDescShort)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${t.mode}-offer-banner`)},[e.createVNode(Re,{tag:t.offerSetting.offerDetails.styles.offerDescription.textStyles.tag,text:(A=o.offer)==null?void 0:A.offerDescShort,style:e.normalizeStyle(t.offerSetting.offerDetails.styles.offerDescription.textStyles),class:e.normalizeClass(C.field+"_value")},null,8,["tag","text","style","class"])],2)):e.createCommentVNode("",!0)]),h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([`item-button ${t.mode}-button`,"ect-flex ect-flex-col ect-gap-2"])},[t.loading||t.applyOffer&&!o.offer?(e.openBlock(),e.createElementBlock("div",W9,[e.createVNode(Qt)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.value?(e.openBlock(),e.createBlock(Ao,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",Q9,[a.value>0&&!t.loading&&d.value?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:a.value,"onUpdate:modelValue":[_[0]||(_[0]=k=>a.value=k),c],loading:s.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Fc,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:_[1]||(_[1]=k=>y(k))},null,8,["disabled","options"]))]))],64))],2)):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-e3d55bd3"]]),J9={class:"item"},Y9={class:"item-text"},e8={class:"item-attributes"},t8={key:0,class:"item-button"},n8={key:1,class:"ect-flex ect-flex-col ect-gap-1"},o8=ve({__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(t){var b,p;const r=mn(),n=t,o=e.ref(((p=(b=r.savedItems)==null?void 0:b[n.itemId])==null?void 0:p.XX_ORD1__QTY__c)||0),a=e.ref(!1),i=e.ref(!1),l=e.ref(!1),s=e.computed(()=>n.actions&&n.actions.length>0),u=e.computed(()=>n.actions.some(x=>x.action==="ADD_TO_CART")),h=e.computed(()=>{var x,g,C;return(x=n.offer)!=null&&x.appliedOnField?Sc[(g=n.offer)==null?void 0:g.appliedOnField]===((C=n.offerSetting.value)==null?void 0:C.field):!0});e.watch(()=>r.savedItems,x=>{var g,C;x[n.itemId]&&!i.value&&((g=x[n.itemId])==null?void 0:g.XX_ORD1__QTY__c)!==o.value&&(o.value=((C=x[n.itemId])==null?void 0:C.XX_ORD1__QTY__c)||0,i.value=!0)},{deep:!0});function d(x){var g;i.value=!0,x===0&&((g=r.savedItems)!=null&&g[n.itemId])?c():f()}const m=x=>{var g;x.action==="ADD_TO_CART"?(i.value=!0,o.value=1,y()):x.action==="CONFIGURE"?Et("catalog:item-configure-clicked",{itemId:n.itemId,catalogItemId:n.catalogItemId,title:n.title,description:n.description,attributes:n.attributes,thumbnail:n.thumbnail,url:n.url,offer:n.offer,mode:n.mode,isPreview:n.isPreview}):x.action==="CUSTOM"?window.open(((g=x.url)==null?void 0:g.value)||x.value,x.newTab?"_blank":"_self"):x.action==="ORDER_PARTS"||x.action},c=async function(){a.value=!0;const x=[r.savedItems[n.itemId].Id];await r.deleteLineItems(x),delete r.savedItems[n.itemId],a.value=!1},y=async function(){a.value=!0;const x={itemID:n.itemId,eCatalogItemID:n.catalogItemId,qty:o.value,qtyTierAmt:null};await r.saveItemToQuoteBlinkTxn(x),a.value=!1},f=St(async function(){console.log("updateToCart 2",o.value),l.value=!0,await r.updateQuoteLineQtyTxn({itemId:n.itemId,qty:o.value,eCatalogItemId:n.catalogItemId}),l.value=!1},800);return(x,g)=>(e.openBlock(),e.createElementBlock("div",J9,[e.createElementVNode("div",Y9,[e.createVNode(Ic,{url:t.url,title:t.title,loading:t.loading},null,8,["url","title","loading"])]),e.createElementVNode("div",e8,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.attributes,C=>{var _;return e.openBlock(),e.createBlock(Bc,{key:C.field,class:e.normalizeClass(`item-attributes_field ${t.mode}-attributes_field`),loading:t.loading,value:C.value,label:C.label,offer:{applyOffer:C.applyOffer,offerDetails:C.offerDetails,offerValue:n.offer},"item-count":o.value,"applied-on-offer-matching-field":h.value,"show-offer-description":!!((_=n.offer)!=null&&_.offerDescShort)},null,8,["class","loading","value","label","offer","item-count","applied-on-offer-matching-field","show-offer-description"])}),128))]),s.value?(e.openBlock(),e.createElementBlock("div",t8,[a.value?(e.openBlock(),e.createBlock(Ao,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createElementBlock("div",n8,[o.value>0&&!t.loading&&u.value?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:o.value,"onUpdate:modelValue":[g[0]||(g[0]=C=>o.value=C),d],loading:l.value,disabled:t.isPreview},null,8,["modelValue","loading","disabled"])):(e.openBlock(),e.createBlock(Fc,{key:1,icon:"arrow_drop_down",disabled:t.loading||t.isPreview,options:t.actions,onSelected:g[1]||(g[1]=C=>m(C))},null,8,["disabled","options"]))]))])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-b679176d"]]),r8=["placeholder"],a8={key:0,class:"srch-error"},i8={class:"srch-option_lst-main"},l8={class:"italic"},s8={class:"srch-option_lst-sugg"},c8={class:"italic"},u8={class:"srch-option_lst-main"},d8={class:"italic"},f8={class:"srch-option_lst-sugg"},h8={class:"italic"},p8={class:"srch-option_lst-main"},m8={class:"italic"},y8={class:"srch-option_lst-sugg"},g8={class:"italic"},b8={key:1,class:"search1"},x8={class:"search-container_header"},_8={class:"search-container_header_input ectheme-input-box"},C8=["placeholder","value"],E8=ve({__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(t,{emit:r}){const n=r;let o;const a=e.ref(""),i=e.ref(!1),l=e.ref(!1),s=e.ref(null),u=()=>{s.value=null,a.value="",n("update:modelValue",""),n("enter")},h=b=>{a.value.length>1?(b.target.blur(),m(a.value+"*")):s.value="Search text must be more than one character.",i.value=!1},d=()=>{l.value||(s.value=null,a.value.length>1?m(a.value+"*"):a.value.length===1&&(s.value="Search text must be more than one character."),i.value=!1)},m=b=>{n("update:modelValue",b),i.value=!1,l.value=!1},c=b=>{const p=b.target.value;s.value=null,p.length||n("update:modelValue","")},y=()=>{n("enter")},f=b=>{var x;o&&(clearTimeout(o),o=null);const p=((x=b==null?void 0:b.target)==null?void 0:x.value)??"";o=setTimeout(()=>{n("update:modelValue",p)},500)};return(b,p)=>t.suggestion?(e.openBlock(),e.createElementBlock("div",{key:0,class:"srch",tabindex:"0",onFocusin:p[6]||(p[6]=x=>i.value=!0),onFocusout:d,onKeydown:e.withKeys(h,["enter"])},[e.createElementVNode("div",{class:e.normalizeClass(["srch-inp",{"srch-error-border":s.value}])},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=x=>a.value=x),type:"search",placeholder:t.placeholder,onInput:c},null,40,r8),[[e.vModelText,a.value]]),e.createVNode(Be,{icon:a.value?"close":"search",size:14,color:s.value?"red":"#acacac",onClick:u},null,8,["icon","color"])],2),s.value?(e.openBlock(),e.createElementBlock("div",a8,[e.createElementVNode("span",null,e.toDisplayString(s.value),1)])):e.createCommentVNode("",!0),a.value.length>1&&i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"srch-option",onMouseover:p[4]||(p[4]=x=>l.value=!0),onMouseout:p[5]||(p[5]=x=>l.value=!1)},[e.createElementVNode("div",{class:"srch-option_lst",onClick:p[1]||(p[1]=x=>m(a.value+"*"))},[e.createElementVNode("div",i8,[e.createTextVNode(" Search for "),e.createElementVNode("span",l8,e.toDisplayString(a.value)+"*",1)]),e.createElementVNode("div",s8,[e.createTextVNode(" word that starts with "),e.createElementVNode("span",c8,e.toDisplayString(a.value)+"*",1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:p[2]||(p[2]=x=>m(a.value))},[e.createElementVNode("div",u8,[e.createTextVNode(" Search for "),e.createElementVNode("span",d8,'"'+e.toDisplayString(a.value)+'"',1)]),e.createElementVNode("div",f8,[e.createTextVNode(" search exactly for "),e.createElementVNode("span",h8,'"'+e.toDisplayString(a.value)+'"',1)])]),e.createElementVNode("div",{class:"srch-option_lst",onClick:p[3]||(p[3]=x=>m("*"+a.value+"*"))},[e.createElementVNode("div",p8,[e.createTextVNode(" Search for "),e.createElementVNode("span",m8,"*"+e.toDisplayString(a.value)+"*",1)]),e.createElementVNode("div",y8,[e.createTextVNode(" word that includes "),e.createElementVNode("span",g8,"*"+e.toDisplayString(a.value)+"*",1)])])],32)):e.createCommentVNode("",!0)],32)):(e.openBlock(),e.createElementBlock("div",b8,[e.createElementVNode("div",x8,[e.createElementVNode("div",_8,[e.createElementVNode("input",{class:"",type:"search",placeholder:t.placeholder,value:t.modelValue,onInput:f,onKeyup:e.withKeys(y,["enter"])},null,40,C8),t.loading?(e.openBlock(),e.createBlock(Ao,{key:0})):e.createCommentVNode("",!0),t.modelValue?(e.openBlock(),e.createBlock(Be,{key:1,icon:"close",size:12,color:"#acacac",onClick:u})):e.createCommentVNode("",!0),t.enableSearchClick||!t.modelValue?(e.openBlock(),e.createBlock(Be,{key:2,class:"ect-relative ect-top-[-1px]",icon:"search",size:14,color:"#acacac",onClick:y})):e.createCommentVNode("",!0)])])]))}},[["__scopeId","data-v-31366d17"]]),Mc=t=>(e.pushScopeId("data-v-01d2d3f1"),t=t(),e.popScopeId(),t),k8=["id"],v8={key:0,class:"product-search"},A8={key:1,class:"product-not-found"},w8=Mc(()=>e.createElementVNode("span",{class:"product-not-found_icon material-symbols-outlined"}," error ",-1)),N8=Mc(()=>e.createElementVNode("span",{class:"product-not-found_text"},"No results found",-1)),S8={key:2,class:"product-item"},B8=20,I8=ve({__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(t,{expose:r}){const n=ft(),o=["vertical","horizontal","square","table"],a=t,i=e.ref(Math.floor(Math.random()*1e9)),l=e.ref(null),s=mn(),u=e.ref(1),h=e.ref(!0),d=e.ref(!0),m=e.ref(!1);e.ref(!1);const c=e.ref([]),y=e.ref(0),f=e.ref(a.request);let b=200;const p=e.ref(a.searchText||""),x=e.computed(()=>a.initialItems||[]),g=e.computed(()=>!!(p.value||a.searchText));function C(N,T,O){const F=O==="Item",q=[];return N.forEach(M=>{var L,j;const U=JSON.parse(JSON.stringify(T));try{F?U.itemId=M.Id:(U.itemId=M.XX_ORD1__Item__c,U.catalogItemId=M.Id);const{description:H,thumbnail:Z,title:te,attributes:ne,actions:Q}=U;Z!=null&&Z.field&&!Z.isStatic&&(Z.value=We(M,Z.field)),te!=null&&te.field&&!te.isStatic&&(te.value=We(M,te.field)),H!=null&&H.field&&!H.isStatic&&(H.value=We(M,H.field)),(ne||[]).forEach(ue=>{var pe,ie;(pe=ue==null?void 0:ue.value)!=null&&pe.field&&!ue.value.isStatic&&(ue.value.value=We(M,ue.value.field,ue.value.dataType)||"-"),(ie=ue==null?void 0:ue.label)!=null&&ie.field&&!ue.label.isStatic&&(ue.label.value=We(M,ue.label.field,ue.label.dataType)||"-")}),(Q||[]).forEach(ue=>{ue.action==="CUSTOM"&&(ue.url&&!ue.url.isStatic&&(ue.url.value=We(M,ue.url.field)),ue.label&&!ue.label.isStatic&&(ue.label.value=We(M,ue.label.field)))});try{const ue=F?We(M,"XX_ORD1__SYS_Requires_Configuration__c"):We(M,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c");U.requiresConfiguration=ue}catch{}const ce=F?We(M,"XX_ORD1__Friendly_URL__c"):We(M,"XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c");((L=U.friendlyURLFields)==null?void 0:L.length)>0&&ce?((j=U.friendlyURLFields)==null||j.forEach(ue=>{U.friendlyURL=(U.friendlyURL||"").replace(`{!${ue}}`,We(M,ue))}),U.friendlyURL="/"+(U.friendlyURL||"")+"/"+ce):U.url&&(U.friendlyURL=U.url+"/"+((M==null?void 0:M.Id)||"")),U.friendlyURL&&(U.friendlyURL=U.friendlyURL.replace(/\/{2,}/g,"/"))}catch{}q.push(U)}),q}const _=e.ref(null),E=e.ref(null),A=e.computed(()=>{}),k=e.computed(()=>{var N;return(N=a.fields)==null?void 0:N.header});e.computed(()=>{var N;return((N=k.value)==null?void 0:N.mainHeading)||{}}),e.computed(()=>{var N;return((N=k.value)==null?void 0:N.subHeading)||{}});const B=e.computed(()=>{var N;return c.value.length>0?c.value:Array(D.value).fill((N=a.fields)==null?void 0:N.productCard)}),D=e.computed(()=>Number(a.configuration.displaySettings.itemsPerPage||B8)),w=e.computed(()=>Number(a.configuration.displaySettings.lazyLoadBatch)),v=e.computed(()=>{var N;return((N=a.configuration.productItemOrientation)==null?void 0:N.toLowerCase())||"vertical"}),S=e.ref(o.includes(v.value)?_.value||v.value:"vertical"),I=e.computed(()=>c.value.length<1&&!d.value),R=e.computed(()=>`product-${S.value} width-${E.value?E.value:a.configuration.displaySettings.columns||1}`),z=e.computed(()=>a.configuration.displaySettings.enableSearch),$=e.ref(null),X=e.ref(!1),W=e.ref({});e.watch(u,(N,T)=>{N!==T&&(console.log("[fetchProducts] 1"),K(!0))}),e.watch($,N=>{N!==null&&a.onCountUpdate&&a.onCountUpdate(N)}),e.watch(p,()=>{u.value=1,console.log("[fetchProducts] 2"),K(!0)}),e.watch(()=>a.searchText,(N,T)=>{N!==T&&(p.value=N||"")});const K=St(async function(N){var q;if(b=600,m.value=!0,x.value&&x.value.length>0&&!g.value){const M=C(x.value,(q=a.fields)==null?void 0:q.productCard,a.catalogType);c.value=M,$.value=M.length,d.value=!1,m.value=!1;try{Et("catalog:items-loaded",{items:M,count:M.length})}catch{}N&&l.value&&l.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"});return}d.value=!0;let O=D.value;w.value<O&&w.value>0&&(O=w.value);const F={...f.value,accountID:a.accountId,rowLimit:O,searchText:p.value||a.searchText,rowOffSet:D.value*(u.value-1)};N&&l.value.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),n.quoteId.value?s.getQuoteItems(!0).then(M=>{m.value=!1}).catch(M=>{console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching line items",M),m.value=!1}).finally(()=>{m.value=!1}):m.value=!1;try{const M=await s.getProductItems(F,a.fields.productCard,a.catalogType);if(M){h.value=M.items.length===O,$.value=M.count,c.value=M.items,y.value=Math.ceil(M.count/D.value);try{Et("catalog:items-loaded",{items:M.items,count:M.count})}catch{}}console.log("[MOLECULEPRODUCTBLOCK:fetchProducts] prodData",M)}catch(M){console.error("[MOLECULEPRODUCTBLOCK:fetchProducts] error fetching products",M)}finally{d.value=!1,m.value=!1}},b);async function P(){const{mainHeading:N,subHeading:T}=a.fields.header;if(!N.isStatic&&N.field||!T.isStatic&&T.field){const O=[];N.isStatic?N.value=N.title:O.push(N.field),T.isStatic?T.value=T.title:O.push(T.field);const F={...f.value,accountID:a.accountId,fields:O},q=await s.getEcatalogDetails(F);N.isStatic||(N.value=q[N.field],N.isStatic=!0),T.isStatic||(T.value=q[T.field],T.isStatic=!0)}else N.value=N.title,T.value=T.title}return r({currentPage:u,fetchProducts:K}),e.onMounted(()=>{K(),P()}),(N,T)=>(e.openBlock(),e.createElementBlock("div",{id:i.value,ref_key:"productBlock",ref:l,class:"product"},[z.value&&A.value===void 0&&!t.hideHeader?(e.openBlock(),e.createElementBlock("div",v8,[e.createVNode(E8,{modelValue:p.value,"onUpdate:modelValue":T[0]||(T[0]=O=>p.value=O),placeholder:"Search products..."},null,8,["modelValue"])])):e.createCommentVNode("",!0),e.renderSlot(N.$slots,"default",{},void 0,!0),I.value?(e.openBlock(),e.createElementBlock("div",A8,[w8,e.createTextVNode(),N8])):(e.openBlock(),e.createElementBlock("div",S8,[S.value==="table"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(B.value,O=>(e.openBlock(),e.createElementBlock("div",{key:(O==null?void 0:O.catalogItemId)||(O==null?void 0:O.itemId),class:"product-item_table"},[e.createVNode(o8,{class:"ecb-theme-card","item-id":O==null?void 0:O.itemId,"catalog-item-id":O==null?void 0:O.catalogItemId,loading:d.value||m.value,mode:S.value,title:O==null?void 0:O.title,attributes:O==null?void 0:O.attributes,actions:O==null?void 0:O.actions,thumbnail:{value:O==null?void 0:O.thumbnail.value},description:O==null?void 0:O.description,url:O==null?void 0:O.friendlyURL,"template-id":t.configuration.productTemplateId,"apply-offer":X.value,"offer-setting":W.value,offer:O==null?void 0:O.offer,"is-preview":t.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)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,O=>(e.openBlock(),e.createElementBlock("div",{key:(O==null?void 0:O.catalogItemId)||(O==null?void 0:O.itemId),class:e.normalizeClass(["product-item_record",R.value])},[e.createVNode(Z9,{"item-id":O==null?void 0:O.itemId,"catalog-item-id":O==null?void 0:O.catalogItemId,loading:d.value||m.value,mode:S.value,title:O==null?void 0:O.title,attributes:O==null?void 0:O.attributes,actions:O==null?void 0:O.actions,thumbnail:{value:O==null?void 0:O.thumbnail.value},description:O==null?void 0:O.description,url:O==null?void 0:O.friendlyURL,"template-id":t.configuration.productTemplateId,"apply-offer":X.value,"offer-setting":W.value,offer:O==null?void 0:O.offer,"is-preview":t.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,k8))}},[["__scopeId","data-v-01d2d3f1"]]),Rc=t=>(e.pushScopeId("data-v-0eae07cd"),t=t(),e.popScopeId(),t),T8={class:"catalog ect-flex ect-flex-col ect-gap-0 md:ect-flex-row"},O8={class:"catalog-product md:ect-grow"},D8={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"},V8={class:"catalog-filter-mobile ect-flex ect-justify-between m-show"},F8=Rc(()=>e.createElementVNode("h3",null,"Filter Products",-1)),M8=Rc(()=>e.createElementVNode("span",null," OPEN FILTERS",-1)),R8=ve({__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(t){var y,f,b,p,x,g,C,_,E,A,k;const r=ft(),n=t,o=e.ref(!1),a=e.computed(()=>Array.isArray(n.initialItems)&&n.initialItems.length>0?"Search Results":"Catalog"),i=e.ref(((y=n.configuration.dynamicFilters)==null?void 0:y.length)>0&&((f=n.configuration.displaySettings)==null?void 0:f.displayDynamicFilters)&&!n.searchTerm),l=e.ref(n.configuration.displaySettings),s=e.computed(()=>y4.get(n.configuration.catalogType)),u=e.computed(()=>{let B=d.value.searchText;return B&&!B.endsWith("*")&&(B+="*"),B||""}),h=e.computed(()=>{var z;const B=[],{description:D,thumbnail:w,title:v,attributes:S,actions:I}=n.fields.productCard,R=[D,w,v];return S.forEach($=>{R.push($.value),R.push($.label)}),(I==null?void 0:I.length)>0&&I.forEach($=>{$.action==="CUSTOM"&&(R.push($.url),R.push($.label))}),R.forEach($=>{!$.isStatic&&$.field?B.push($.field):$.value=$.title||"-"}),s.value==="eCatalog"?(B.push("XX_ORD1__Item__r.XX_ORD1__Friendly_URL__c"),B.push("XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c")):(B.push("XX_ORD1__Friendly_URL__c"),B.push("XX_ORD1__SYS_Requires_Configuration__c")),((z=n.fields.productCard.friendlyURLFields)==null?void 0:z.length)>0&&B.push(...n.fields.productCard.friendlyURLFields),B}),d=e.ref({blockId:n.id,catalogType:m4.get(n.configuration.catalogType)||"Full",checkcurrency:(b=l.value)==null?void 0:b.checkCurrency,eCatalogIDs:n.configuration.catalogType==="ECATALOG_OVERRIDE"&&n.configuration.catalogId?[n.configuration.catalogId]:null,fields:h.value,alternateFieldName:n.configuration.catalogCustomField,searchText:"",whereCondition:n.configuration.staticFilters,sortByField:((x=(p=n.configuration.sort)==null?void 0:p.primary)==null?void 0:x.field)||"Name",sortOrder:(C=(g=n.configuration.sort)==null?void 0:g.primary)==null?void 0:C.direction,secondarySortByField:(E=(_=n.configuration.sort)==null?void 0:_.secondary)==null?void 0:E.field,secondarySortOrder:(k=(A=n.configuration.sort)==null?void 0:A.secondary)==null?void 0:k.direction}),m=e.ref(null),c=e.ref(null);return e.watch(()=>o.value,B=>{B&&window.scrollTo(0,0)}),e.onMounted(()=>{d.value.searchText=n.searchTerm||""}),e.watch(d,B=>{c.value&&c.value.fetchFilterList(),m.value&&(m.value.currentPage=1,console.log("[fetchProducts] 4"),m.value.fetchProducts())},{deep:!0}),e.watch(()=>n.searchTerm,B=>{typeof B=="string"&&(d.value.searchText=B)}),(B,D)=>(e.openBlock(),e.createElementBlock("div",T8,[e.createElementVNode("div",O8,[e.createElementVNode("h2",D8,e.toDisplayString(a.value),1),e.createVNode(I8,{ref_key:"product",ref:m,"block-id":t.id,"account-id":e.unref(r).accountId,configuration:t.configuration,"catalog-type":s.value,request:d.value,fields:t.fields,"search-text":u.value,"initial-items":n.initialItems,"hide-header":!!n.searchTerm,"on-count-update":n.onCountUpdate,"is-preview":t.isPreview},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",V8,[F8,e.createElementVNode("div",{class:"ect-flex ect-items-center ect-gap-2 m-show",onClick:D[0]||(D[0]=w=>o.value=!0)},[e.createVNode(Be,{class:"filter-product_icon",icon:"tune",color:"#acacac",size:20}),M8])],512),[[e.vShow,!o.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"]]),L8={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 t="material-";return this.symbol?t+="symbols-":t+="icons-",this.rounded?t+="round":t+="outlined",t}}},P8=["width","height"],q8=["href"],$8=["width","height"],U8=["href"];function z8(t,r,n,o,a,i){const l=e.resolveComponent("AtomIcons"),s=e.resolveComponent("AtomTooltip");return n.tooltip?(e.openBlock(),e.createBlock(s,{key:0,content:n.tooltip,direction:n.direction,width:n.tooltipWidth},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:r[0]||(r[0]=u=>a.isHover=!0),onMouseleave:r[1]||(r[1]=u=>a.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(l),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:a.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:a.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,q8)],12,P8))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(i.mode),style:e.normalizeStyle(i.style)},e.toDisplayString(n.icon),7))],34)]),_:1},8,["content","direction","width"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["google-icon",{disabled:n.disabled}]),onMouseenter:r[2]||(r[2]=u=>a.isHover=!0),onMouseleave:r[3]||(r[3]=u=>a.isHover=!1)},[n.custom?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(l),(e.openBlock(),e.createElementBlock("svg",{width:n.size,height:n.size,style:e.normalizeStyle({fill:a.isHover&&n.hover&&!n.disabled?n.hover:n.color,color:a.isHover&&n.hover&&!n.disabled?n.hover:n.color})},[e.createElementVNode("use",{href:`#icon-${n.icon}`},null,8,U8)],12,$8))],64)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(i.mode),style:e.normalizeStyle(i.style)},e.toDisplayString(n.icon),7))],34))}const Cr=ve(L8,[["render",z8],["__scopeId","data-v-16108bca"]]);async function Lc(t,r,n,o={},a={}){let i=`/services/apexrest/${t}?type=${r}`;if(o&&Object.keys(o).length>0){const u=new URLSearchParams;Object.keys(o).forEach(d=>{const m=o[d];m!=null&&m!==""&&u.append(d,String(m))});const h=u.toString();h&&(i+=`&${h}`)}const l={action:"makeCall",data:{callType:n,endpoint:i,...n!=="GET"&&{payload:JSON.stringify(a)}}};return(await br(wn,l)).content}const Nn=it.defineStore("expediteCart",()=>{const t=e.ref(null),r=e.ref([]),n=e.ref(),o=e.ref({}),a=ft();async function i(f,b){let p=b?"cart.getGroupedQuoteProducts":"cart.getQuoteProducts";return await Ct({data:JSON.stringify(f),config:{pathKey:p}})}async function l(f){return await Ct({data:JSON.stringify({lineItemIds:f}),config:{pathKey:"common.getLineItemAttributes"}})}async function s(){const f=t.value?{quoteId:t.value}:{};return await Ct({data:JSON.stringify(f),config:{pathKey:"promocode.getPromoCodes"}})}async function u(){const f=t.value?{quoteId:t.value}:{},b=await Lc("XX_ORD1/ecommerce","getQLIsForPromoCode","POST",f,{});return n.value=b,r.value=b.qliIds,b}async function h(f,b,p){const x={promoCode:f,quoteId:t.value,qliIds:b,isLastBatch:p,originalTotalSalesPrice:f?n.value.originalTotalSalesPrice:null,isFromQLIUpdateOrDelete:"false"};return await Ct({data:JSON.stringify(x),config:{pathKey:"promocode.applyPromoCode"}})}async function d(f){const p={records:[{fields:f.fields.map(g=>({fieldName:g.fieldName,fieldValue:String(g.fieldValue)}))}],uniqueField:"Id",objectType:f.objectType};return await Ct({data:JSON.stringify(p),config:{pathKey:"update.upsertRecords"}})}async function m(f){return await Ct({data:JSON.stringify(f),config:{pathKey:"fetch.getRecord"}})}async function c(){const f=t.value;return f?await Ct({data:JSON.stringify({objectId:f,isCommit:!1}),config:{pathKey:"tax.calculateAvaTax"}}):void 0}async function y(f){const b=f||a.cid.value;return await Lc("XX_ORD1/ecommerce","startNewCart","POST",b?{cid:b}:{},{})}return{quoteId:t,qlisList:r,quoteRecord:o,getRowItems:i,getLineItemAttributesNG:l,getPromoCodeInfo:s,getQLIsForPromoCode:u,applyPromoCodeNG:h,updateRecord:d,getRecordFieldValue:m,calculateAvaTax:c,startNewCart:y}}),j8={name:"ModalApp",components:{AtomIcon:Cr},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"}},H8={key:0,class:"modal-mask"},G8={class:"modal-wrapper"},K8={key:0,class:"close-text"},X8={key:1,class:"modal-container__header"},W8={class:"ect-flex ect-flex-col ect-gap-2"},Q8={class:"widget-upload__heading"},Z8={key:0,class:"ect-text-[#5f5f5f] ect-text-[14px] ect-font-roboto ect-font-normal ect-leading-[20px]"},J8={class:"modal-container__content"},Y8={class:"modal-container__action"};function ey(t,r,n,o,a,i){const l=e.resolveComponent("AtomIcon");return e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[n.show?(e.openBlock(),e.createElementBlock("div",H8,[e.createElementVNode("div",G8,[e.createElementVNode("div",{class:"modal-container",style:e.normalizeStyle(`${n.maxWidth?"max-width: "+n.maxWidth+"px; width: 100%;":""}`)},[n.showCloseButton?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-container__close ect-gap-2",onClick:r[0]||(r[0]=s=>t.$emit("clicked"))},[e.createVNode(l,{icon:"close",size:16,color:"##0a0a0a",hover:"#000000"}),n.showCloseButtonText?(e.openBlock(),e.createElementBlock("span",K8," Close ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.title?(e.openBlock(),e.createElementBlock("span",X8,[e.createElementVNode("div",W8,[e.createElementVNode("p",Q8,e.toDisplayString(n.title),1),n.subTitle?(e.openBlock(),e.createElementBlock("span",Z8,e.toDisplayString(n.subTitle),1)):e.createCommentVNode("",!0)]),e.renderSlot(t.$slots,"header-action",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",J8,[e.renderSlot(t.$slots,"content",{},void 0,!0)]),e.createElementVNode("div",Y8,[e.renderSlot(t.$slots,"action",{},void 0,!0)])],4)])])):e.createCommentVNode("",!0)]),_:3})}const ty=ve(j8,[["render",ey],["__scopeId","data-v-f59dbab6"]]),ny={name:"AtomLoader"},oy={class:"loader"};function ry(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("span",oy)}const Pc=ve(ny,[["render",ry],["__scopeId","data-v-32b63014"]]),ay={name:"AtomButton",components:{AtomLoader:Pc},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 t=[];return this.btype?this.btype==="primary"?t.push("esg-btn-primary ect-bg-primary"):this.btype==="secondary"?t.push("esg-btn-secondary"):this.btype==="link"||this.btype==="ghost"?t.push("noborder"):this.btype==="plink"?t.push("esg-pcolor-fc"):this.btype==="error"&&t.push("esg-btn-error"):t.push("esg-btn-primary"),this.buttonStyle==="link"&&t.push("link-btn"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},iy={class:"loader"};function ly(t,r,n,o,a,i){const l=e.resolveComponent("AtomLoader");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button ect-uppercase ect-whitespace-nowrap",i.getBtnClass()],style:i.getBtnStyle(),onClick:r[0]||(r[0]=e.withModifiers(s=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({"text-loading":n.loading})},[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.text),1)],!0)],2),e.createElementVNode("span",iy,[n.loading?(e.openBlock(),e.createBlock(l,{key:0})):e.createCommentVNode("",!0)])]),_:3},16,["type","class","style"])}const qc=ve(ay,[["render",ly],["__scopeId","data-v-ae1df853"]]),sy={components:{AppTooltip:ws,AppIcon:Be},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)}}},$c=t=>(e.pushScopeId("data-v-888eb5f4"),t=t(),e.popScopeId(),t),cy=["data-test-id"],uy=["data-test-id"],dy={key:0,width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fy=[$c(()=>e.createElementVNode("g",{id:"minus"},[e.createElementVNode("path",{id:"Icon",d:"M3 6H10",stroke:"white","stroke-width":"1.66666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],hy={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},py=[$c(()=>e.createElementVNode("g",{id:"check"},[e.createElementVNode("path",{id:"Icon",d:"M10 3L4.5 8.5L2 6",stroke:"white","stroke-width":"1.6666","stroke-linecap":"round","stroke-linejoin":"round"})],-1))],my=["data-test-id"];function yy(t,r,n,o,a,i){const l=e.resolveComponent("AppIcon"),s=e.resolveComponent("AppTooltip");return e.openBlock(),e.createElementBlock("div",{class:"checkbox","data-test-id":n.dataTestId,onClick:r[0]||(r[0]=(...u)=>i.toggleChecked&&i.toggleChecked(...u))},[e.createElementVNode("div",{class:e.normalizeClass(["checkmark",{checked:n.modelValue&&!n.partial&&!n.disabled,disabled:n.disabled,partial:n.partial}]),"data-test-id":`${n.dataTestId}-checkmark`},[n.partial?(e.openBlock(),e.createElementBlock("svg",dy,fy)):n.modelValue?(e.openBlock(),e.createElementBlock("svg",hy,py)):e.createCommentVNode("",!0)],10,uy),n.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"label","data-test-id":`${n.dataTestId}-label`},e.toDisplayString(n.label),9,my)):e.createCommentVNode("",!0),n.info?(e.openBlock(),e.createBlock(s,{key:1,direction:"top",content:n.info,width:100,"data-test-id":`${n.dataTestId}-info-tooltip`},{default:e.withCtx(()=>[e.createVNode(l,{class:"ect-text-primary ect-pt-2 ect-pl-4",icon:"info","data-test-id":`${n.dataTestId}-info-icon`},null,8,["data-test-id"])]),_:1},8,["content","data-test-id"])):e.createCommentVNode("",!0)],8,cy)}const Er=ve(sy,[["render",yy],["__scopeId","data-v-888eb5f4"]]),gy={class:"m-content"},by={key:0,class:"attribute-input"},xy={key:1,class:"attribute-lookup"},_y={class:"attribute-lookup-main"},Cy={key:1},Ey={key:2,class:"attribute-input"},ky={key:2},vy={class:"m-footer"},Ay=ve({__name:"MoleculeAttributeModal",props:{data:{type:Object,default:()=>({})},quoteId:{type:String,default:""}},emits:["close","update","reload"],setup(t,{emit:r}){const n=Nn(),o=t,a=r,i=e.ref([]),l=e.ref([]),s=e.ref({}),u=e.ref(!1);async function h(){u.value=!0;const f=[{fieldName:"Id",fieldValue:o.quoteId}];l.value.forEach(p=>{if(p.editable&&!p.apiName.includes(".")){let x=p.apiName;p.dataType==="REFERENCE"?(x=p.apiName.replace("__r","__c"),f.push({fieldName:x,fieldValue:p.referenceRecordId})):f.push({fieldName:x,fieldValue:p.value})}});const b={fields:f,objectType:"XX_ORD1__Quote_Line_Item__c"};console.log(b),await n.updateRecord(b),d(),a("reload",o.quoteId),a("close"),u.value=!1}function d(){const f={},b={};i.value.forEach(p=>{p.dataType==="REFERENCE"&&(b[p.apiName]=p.referenceRecordId),f[p.apiName]=p.value}),o.data.forEach(p=>{p.dataType==="REFERENCE"&&(p.referenceRecordId=b[p.apiName]),p.value=f[p.apiName]})}function m(f,b){if(f){const p=i.value.find(g=>g.label===b.firstLookup.replace("Copy from ",""));console.log("Parent",p);const x={};p.relatedFields.forEach(g=>{x[g.child]=g.value}),p&&(b.referenceRecordId=p.referenceRecordId,b.value=p.value,b.options=p.options,b.relatedFields.forEach(g=>{g.value=x[g.child]}))}else b.referenceRecordId=null,b.options=[],b.relatedFields.forEach(p=>{p.value=null})}function c(f,b){console.log(f,b);const p=b.options.find(x=>x.Id===f);f===null?(b.options=[],b.value=null,b.relatedFields.forEach(x=>{x.value=null})):(b.value=p.Name,b.relatedFields.forEach(x=>{x.value=p[x.child]}))}const y=St(async function(f,b){b.loading=!0;const p={lookupObjectApiName:b.referenceObject,searchTerm:f||"",fields:s.value[b.apiName]||[]},x=await n.getLookupRecords(p);console.log(x),b.options=x,b.loading=!1});return e.onBeforeMount(()=>{const f={};i.value=JSON.parse(JSON.stringify(o.data)),i.value.forEach(p=>{p.dataType==="REFERENCE"&&(s.value[p.apiName]=[],p.relatedFields=[],f[p.apiName]=p,p.options=[{Name:p.value||"",Id:p.referenceRecordId}]),p.editable=p.editable&&!p.apiName.includes(".")});let b=null;i.value.forEach(p=>{if(p.referenceObject==="XX_Base__Location__c"&&(b?p.firstLookup="Copy from "+b.label:b=p),p.apiName.includes(".")){const[x,g]=p.apiName.split(".");p.parent=x,p.child=g,s.value[x]!=null&&(s.value[x].push(g),f[x].relatedFields.push(p))}}),l.value=i.value.filter(p=>!p.apiName.includes(".")),console.log(l.value,f)}),(f,b)=>(e.openBlock(),e.createBlock(ty,{title:"Modify attributes",onClicked:b[1]||(b[1]=p=>f.$emit("close"))},{content:e.withCtx(()=>[e.createElementVNode("div",gy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,x)=>{var g;return e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[p.firstLookup?(e.openBlock(),e.createElementBlock("div",by,[e.createElementVNode("label",null,e.toDisplayString(p.firstLookup),1),e.createVNode(Er,{modelValue:p.same,"onUpdate:modelValue":[C=>p.same=C,C=>m(C,p)],class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0),p.dataType==="REFERENCE"&&((g=p.relatedFields)==null?void 0:g.length)>0?(e.openBlock(),e.createElementBlock("div",xy,[e.createElementVNode("div",_y,[e.createVNode(rn,{modelValue:p.referenceRecordId,"onUpdate:modelValue":[C=>p.referenceRecordId=C,C=>c(C,p)],label:p.label,disabled:!p.editable||p.same,options:p.options,lookup:"",search:"",highlight:"",loading:p.loading,property:{key:"Id",value:"Name"},onSearch:C=>e.unref(y)(C,p)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.relatedFields,(C,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:"attribute-input"},[C.dataType==="PICKLIST"||C.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,label:C.label,disabled:!C.editable,options:C.picklistValues.map(E=>({label:E,value:E})),select:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):C.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",Cy,[e.createElementVNode("label",null,e.toDisplayString(C.label),1),e.createVNode(Er,{modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,disabled:!C.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Rn,{key:2,label:C.label,disabled:!C.editable,modelValue:C.value,"onUpdate:modelValue":E=>C.value=E,class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))),128))])):(e.openBlock(),e.createElementBlock("div",Ey,[p.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:p.referenceRecordId,"onUpdate:modelValue":[C=>p.referenceRecordId=C,C=>c(C,p)],label:p.label,disabled:!p.editable,options:p.options,lookup:"",search:"",highlight:"",loading:p.loading,property:{key:"Id",value:"Name"},onSearch:C=>e.unref(y)(C,p)},null,8,["modelValue","onUpdate:modelValue","label","disabled","options","loading","onSearch"])):p.dataType==="PICKLIST"||p.dataType==="MULTIPICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,label:p.label,disabled:!p.editable,options:p.picklistValues.map(C=>({label:C,value:C})),select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","label","disabled","options"])):p.dataType==="BOOLEAN"?(e.openBlock(),e.createElementBlock("div",ky,[e.createElementVNode("label",null,e.toDisplayString(p.label),1),e.createVNode(Er,{modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,disabled:!p.editable,class:"ect-pt-3 ect-mb-3"},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(e.openBlock(),e.createBlock(Rn,{key:3,label:p.label,disabled:!p.editable,modelValue:p.value,"onUpdate:modelValue":C=>p.value=C,highlight:"",class:"cart-promo_inp"},null,8,["label","disabled","modelValue","onUpdate:modelValue"]))]))],64)}),128))])]),action:e.withCtx(()=>[e.createElementVNode("div",vy,[e.createVNode(qc,{text:"CANCEL",btype:"secondary",onClick:b[0]||(b[0]=p=>f.$emit("close"))}),e.createVNode(qc,{text:"SAVE",btype:"primary",loading:u.value,onClick:h},null,8,["loading"])])]),_:1}))}},[["__scopeId","data-v-d0648f18"]]),wy={class:"datatable"},Ny={class:"m-show"},Sy={key:0},By=["onClick"],Iy={key:1},Ty=["data-test-id","onClick"],Oy={class:"desktop d-show"},Dy={class:"datatable-skeletion"},Vy={class:"datatable-skeletion"},Fy={class:"datatable-skeletion"},My=["colspan"],Ry={style:{display:"flex",gap:"1rem",height:"40px"}},Ly=["onClick"],Py=["data-test-id","onClick"],qy={key:0},$y=["colspan"],Uy={style:{display:"flex",gap:"1rem",height:"40px"}},zy={key:1},jy=["colspan"],Hy={style:{display:"flex","flex-wrap":"wrap",padding:"1rem"}},Gy={key:0,class:"attribute",style:{width:"50%"}},Ky={key:0,class:"ect-flex ect-gap-2"},Xy={key:1,class:"ect-flex ect-gap-2"},Wy={key:1,class:"attribute",style:{width:"50%"}},Qy={key:0},Zy={key:2,class:"attribute",style:{width:"50%"}},Jy={key:0},Yy={key:1},kr=ve({__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(t,{emit:r}){const n=t,o=e.ref(null),a=e.ref(null),i=r,l=e.ref(null),s=e.ref({}),u=e.ref(null),h=e.computed(()=>n.disabled),d=function(_,E){return l.value&&l.value!==_+":"+E||n.delRecords.has(_)||h.value||u.value&&u.value!==_},m=e.computed(()=>{const{headerStyle:_,optionRow:E,productRow:A}=n.style;return{product:{backgroundColor:A.background,verticalAlign:A.verticalAlignment||"middle"},option:{backgroundColor:E.background,verticalAlign:E.verticalAlignment||"middle"},header:{backgroundColor:_.background,verticalAlign:_.verticalAlignment||"middle"}}}),c=e.computed(()=>{const{headerStyle:_,optionRow:E,productRow:A}=n.style;return{header:_.style||{},option:E.style||{},product:A.style||{}}}),y=e.computed(()=>200/n.cols.length+"px");function f(_,E,A){const k={},{table:B}=n.style;if(_){const{alignment:D,strikethrough:w}=_;D&&(k.textAlign=D),w&&(k.textDecoration="line-through")}if(E){const{width:D,minWidth:w}=E;D&&(k.width=`calc(${D.value+D.unit} - ${y.value})`),w&&(k.minWidth=w.value+w.unit)}return B.border!=="n"&&!A?(k.borderStyle="solid",k.borderColor=B.color,B.border==="b"?k.borderWidth=B.width:B.border==="x"?(k.borderTopWidth=B.width,k.borderBottomWidth=B.width,k.borderLeftWidth=0,k.borderRightWidth=0):B.border==="y"?(k.borderLeftWidth=B.width,k.borderRightWidth=B.width,k.borderTopWidth=0,k.borderBottomWidth=0):B.border==="bottom"||B.border==="default"?(k.borderTopWidth=0,k.borderBottomWidth=B.width,k.borderLeftWidth=0,k.borderRightWidth=0):B.border==="top"&&(k.borderTopWidth=B.width,k.borderBottomWidth=0,k.borderLeftWidth=0,k.borderRightWidth=0)):k.borderWidth="0px",k}function b(_,E){var k;if(E.dataType==="REFERENCE")return(k=_[E.content.replace("__c","__r")])==null?void 0:k.Name;const A=We(_,E.api,E.dataType);return A===""?A:E.dataType==="PERCENT"?A+"%":A}function p(_,E){_===0?i("delete",E):x(_,"XX_ORD1__QTY__c",E)}function x(_,E,A){u.value=A.Id,g(_,E,A)}const g=St(function(_,E,A){l.value=A.Id+":"+E,s.value.Id=A.Id,s.value[E]=_;const k=()=>{l.value=null,s.value={},u.value=null};i("update",{record:s.value,callback:k})},500),C=_=>_.content.picklist.map(E=>({label:E,value:E}));return(_,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value&&a.value?(e.openBlock(),e.createBlock(Ay,{key:0,data:o.value,"quote-id":a.value,onClose:E[0]||(E[0]=A=>(o.value=null,a.value=null)),onReload:E[1]||(E[1]=A=>_.$emit("reload",A))},null,8,["data","quote-id"])):e.createCommentVNode("",!0),e.createElementVNode("div",wy,[e.createElementVNode("div",Ny,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.rows,A=>(e.openBlock(),e.createElementBlock("table",{key:A.Id,class:"mobile md:ect-hidden"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(k,B)=>{var D,w,v,S;return e.openBlock(),e.createElementBlock("tr",{key:B},[e.createElementVNode("th",{style:e.normalizeStyle({...f(k.header.style),...m.value.header})},[k.header?(e.openBlock(),e.createBlock(Re,{key:0,text:k.header.title,style:e.normalizeStyle(k.header.style),"sec-style":c.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4),e.createElementVNode("td",{style:e.normalizeStyle({...f(k.content.style),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[k.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>p(I,A)],disabled:d(A.Id,k.api),loading:A.Id+":"+k.api===l.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):k.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),options:C(k),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Rn,{key:2,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.dataType==="URL"?(e.openBlock(),e.createBlock(bi,{key:0,src:b(A,k)},null,8,["src"])):k.content.isStatic?(e.openBlock(),e.createBlock(Re,{key:1,tag:(D=k.content)==null?void 0:D.style.tag,text:k.content.content,style:e.normalizeStyle((w=k.content)==null?void 0:w.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(Re,{key:2,loading:t.loading.includes(k.dataType)&&(!t.loadingRowId||t.loadingRowId===A.Id),tag:(v=k.content)==null?void 0:v.style.tag,text:b(A,k),style:e.normalizeStyle((S=k.content)==null?void 0:S.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],4)])}),128)),t.del?(e.openBlock(),e.createElementBlock("tr",Sy,[e.createElementVNode("th",{style:e.normalizeStyle({...f(),...m.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...f(),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(A.Id)}]),onClick:k=>!d(A.Id)&&_.$emit("delete",A)},"REMOVE",10,By)],4)])):e.createCommentVNode("",!0),t.configure&&e.unref(di).includes(A.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("tr",Iy,[e.createElementVNode("th",{style:e.normalizeStyle({...f(),...m.value.header})},null,4),e.createElementVNode("td",{style:e.normalizeStyle({...f(),...m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"]})},[e.createElementVNode("div",{class:e.normalizeClass(["datatable-configure",{disabled:d(A.Id)}]),"data-test-id":`expeditecart-list-button-configure-${A.Id}`,onClick:k=>!d(A.Id)&&_.$emit("configure",A)},"CONFIGURE",10,Ty)],4)])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("table",Oy,[t.hidecolumn?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,style:e.normalizeStyle(m.value.header)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,A=>{var k;return e.openBlock(),e.createElementBlock("th",{key:A.key,style:e.normalizeStyle(f((k=A.header)==null?void 0:k.style,A.style))},[A.header?(e.openBlock(),e.createBlock(Re,{key:0,text:A.header.title,style:e.normalizeStyle(A.header.style),"sec-style":c.value.header},null,8,["text","style","sec-style"])):e.createCommentVNode("",!0)],4)}),128)),t.del?(e.openBlock(),e.createElementBlock("th",{key:0,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},null,4)):e.createCommentVNode("",!0)],4)),t.rowLoading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},e.renderList(5,A=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A},[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,k=>(e.openBlock(),e.createElementBlock("td",{key:k.key,style:e.normalizeStyle(f(k.content.style,k.style))},[e.createElementVNode("div",Dy,[e.createVNode(yn)])],4))),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",Vy,[e.createVNode(yn)])],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("th",{key:1,style:e.normalizeStyle({...f(),minWidth:"100px",maxWidth:"100px"})},[e.createElementVNode("div",Fy,[e.createVNode(yn)])],4)):e.createCommentVNode("",!0)]),t.attribute?(e.openBlock(),e.createElementBlock("td",{key:0,colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Ry,[e.createVNode(yn),e.createVNode(yn)])],12,My)):e.createCommentVNode("",!0)],64))),64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.rows,A=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:A.Id},[e.createElementVNode("tr",{style:e.normalizeStyle(m.value[A.XX_ORD1__Parent_QLI__c?"option":"product"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cols,(k,B)=>{var D,w,v,S;return e.openBlock(),e.createElementBlock("td",{key:B,style:e.normalizeStyle(f(k.content.style,k.style,!!A.Attributes)),class:e.normalizeClass({"padding-left":B==0&&A.XX_ORD1__Parent_QLI__c})},[k.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[k.api==="XX_ORD1__QTY__c"?(e.openBlock(),e.createBlock(_r,{key:0,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>p(I,A)],disabled:d(A.Id,k.api),loading:A.Id+":"+k.api===l.value},null,8,["modelValue","onUpdate:modelValue","disabled","loading"])):k.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:1,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),options:C(k),"use-fixed-position":!0,select:"",highlight:""},null,8,["modelValue","onUpdate:modelValue","disabled","options"])):(e.openBlock(),e.createBlock(Rn,{key:2,modelValue:A[k.api],"onUpdate:modelValue":[I=>A[k.api]=I,I=>x(I,k.api,A)],disabled:d(A.Id,k.api),highlight:"",class:"cart-promo_inp"},null,8,["modelValue","onUpdate:modelValue","disabled"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.dataType==="URL"?(e.openBlock(),e.createBlock(bi,{key:0,src:b(A,k)},null,8,["src"])):k.content.isStatic?(e.openBlock(),e.createBlock(Re,{key:1,tag:(D=k.content)==null?void 0:D.style.tag,text:k.content.content,style:e.normalizeStyle((w=k.content)==null?void 0:w.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["tag","text","style","sec-style"])):(e.openBlock(),e.createBlock(Re,{key:2,loading:t.loading.includes(k.dataType)&&(!t.loadingRowId||t.loadingRowId===A.Id),tag:(v=k.content)==null?void 0:v.style.tag,text:b(A,k),style:e.normalizeStyle((S=k.content)==null?void 0:S.style),"sec-style":A.XX_ORD1__Parent_QLI__c?c.value.option:c.value.product},null,8,["loading","tag","text","style","sec-style"]))],64))],6)}),128)),t.del?(e.openBlock(),e.createElementBlock("td",{key:0,style:e.normalizeStyle({...f(null,null,!!A.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.createElementVNode("span",{class:e.normalizeClass(["datatable-remove",{disabled:d(A.Id)}]),onClick:k=>!d(A.Id)&&_.$emit("delete",A)},"REMOVE",10,Ly)],4)):e.createCommentVNode("",!0),t.configure?(e.openBlock(),e.createElementBlock("td",{key:1,style:e.normalizeStyle({...f(null,null,!!A.Attributes),minWidth:"100px",maxWidth:"100px"}),class:"ect-min-w-[94px]"},[e.unref(di).includes(A.XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["datatable-configure",{disabled:d(A.Id)}]),"data-test-id":`expeditecart-list-button-configure-${A.Id}`,onClick:k=>!d(A.Id)&&_.$emit("configure",A)}," CONFIGURE ",10,Py)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],4),A.attributesLoading?(e.openBlock(),e.createElementBlock("tr",qy,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Uy,[e.createVNode(yn),e.createVNode(yn)])],12,$y)])):A.Attributes?(e.openBlock(),e.createElementBlock("tr",zy,[e.createElementVNode("td",{colspan:t.cols.length+2,style:e.normalizeStyle(f())},[e.createElementVNode("div",Hy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.Attributes,(k,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[k.value||k.existingValue||k.existingValueReferenceName?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.value&&(k.existingValue||k.existingValueReferenceName)?(e.openBlock(),e.createElementBlock("div",Gy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value!==k.existingValue&&k.value!==k.existingValueReferenceName?(e.openBlock(),e.createElementBlock("div",Ky,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"]),e.createVNode(Re,{text:k.existingValueReferenceName||k.existingValue,style:e.normalizeStyle(t.attribute.old.style)},null,8,["text","style"])])):(e.openBlock(),e.createElementBlock("div",Xy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])),t.attribute.edit&&k.editable&&A.XX_ORD1__QLI_Type__c!=="Remove"?(e.openBlock(),e.createBlock(Cr,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):k.value?(e.openBlock(),e.createElementBlock("div",Wy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value?(e.openBlock(),e.createElementBlock("div",Qy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&k.editable?(e.openBlock(),e.createBlock(Cr,{key:1,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)])):t.attribute.displayonlychanged?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zy,[e.createElementVNode("b",null,e.toDisplayString(k.label)+":",1),k.value?(e.openBlock(),e.createElementBlock("div",Jy,[e.createVNode(Re,{text:k.value,style:e.normalizeStyle(t.attribute.new.style)},null,8,["text","style"])])):k.existingValue?(e.openBlock(),e.createElementBlock("div",Yy,[e.createVNode(Re,{text:k.existingValueReferenceName||k.existingValue,style:e.normalizeStyle(t.attribute.regular.style)},null,8,["text","style"])])):e.createCommentVNode("",!0),t.attribute.edit&&k.editable?(e.openBlock(),e.createBlock(Cr,{key:2,class:"attribute-edit",icon:"edit",size:16,symbol:"",onClick:D=>(o.value=A.Attributes,a.value=A.Id)},null,8,["onClick"])):e.createCommentVNode("",!0)]))],64)):e.createCommentVNode("",!0)],64))),128))])],12,jy)])):e.createCommentVNode("",!0)],64))),128))])])],64))}},[["__scopeId","data-v-3b714a31"]]),eg={key:0,class:"prodlist"},tg={class:"prodlist-header"},ng={key:0},og={key:1,class:"summary"},rg={key:1,class:"summary"},ag=ve({__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(t,{emit:r}){const n=Nn(),o=mn(),a=t,i=r,l=T=>T.toUpperCase()||"",s=e.computed(()=>{var T;return((T=a.fields)==null?void 0:T.styling)||{}}),u=e.computed(()=>{var T,O;return(O=(T=a.configuration)==null?void 0:T.allowedActions)==null?void 0:O.delete}),h=e.computed(()=>{var T,O;return(O=(T=a.configuration)==null?void 0:T.allowedActions)==null?void 0:O.configure}),d=e.computed(()=>{var T;return a.configuration.displayAttributes?(T=a.configuration)==null?void 0:T.attribute:!1}),m=e.computed(()=>{var T;return(T=a.configuration)==null?void 0:T.sort}),c=e.computed(()=>{var T;return(T=a.configuration)==null?void 0:T.group}),y=e.computed(()=>{const T=c.value.groupheader.style;return T?I(T):{}}),f=e.computed(()=>{const T=c.value.groupfooter.style;return T?I(T):{}}),b=e.computed(()=>{const T={},{border:O,color:F,width:q}=s.value.table;return O==="default"&&(T.borderStyle="solid",T.borderColor=F,T.borderWidth=q,T.borderTopWidth=0),T}),p=e.computed(()=>B.value?!1:!v.value||v.value.length===0?!0:v.value.every(T=>{const O=T.rows&&T.rows.length>0,F=T.options&&T.options.some(q=>q.rows&&q.rows.length>0);return!O&&!F}));Ko();const x=["CURRENCY","DOUBLE","PERCENT"],g=["CURRENCY","DOUBLE","PERCENT","DATE","DATETIME","TIME","BOOLEAN","STRING","TEXTAREA","REFERENCE","EMAIL","PHONE","URL","TEXTAREA","TEXTAREA"],C=e.ref(null),_=e.ref([]),E=e.ref([]),A=e.ref([]),k=e.ref(!1),B=e.ref(!1),D=e.ref(new Set),w=e.ref([]),v=e.ref([]),S=new Map;function I(T){let O={padding:"1.25rem 2rem"};const{overrite:F,backgroundColor:q,verticalAlignment:M,padding:U}=T;return F&&(O={backgroundColor:q,verticalAlign:M,padding:U||"1.25rem 2rem"}),O}const R=async function({record:T,callback:O}){const F=[];for(const M in T)F.push({fieldName:M,fieldValue:T[M]});const q={fields:F,objectType:a.configuration.objectType};await n.updateRecord(q),O(),T.XX_ORD1__QTY__c!==void 0&&(C.value=T.Id,await W("FIELD_RELOAD"),C.value=null)};async function z(T){C.value=T,await W("RELOAD_ALL_FIELDS"),C.value=null}const $=T=>{Et("expeditecart:configure-clicked",{itemId:T.XX_ORD1__Item__c,lineItemId:T.Id,quoteId:n.quoteId,isPreview:a.isPreview})},X=async function(T){D.value.add(T.Id),k.value=!0;const O=[T.Id];await o.deleteLineItems(O),await W("RELOAD"),k.value=!1,D.value.delete(T.Id)};async function W(T){T==="RELOAD"?B.value=!0:T==="FIELD_RELOAD"?A.value=x:T==="RELOAD_ALL_FIELDS"&&(A.value=g);const{groupby:O,grouplevel:F}=a.configuration.group,q=n.quoteId,M=a.footer.map(H=>({field:H.field,snippet:H.function||"SUM"})),U={filterObject:a.configuration.objectType,fieldsToDisplay:[...E.value,"XX_ORD1__Item__r.XX_ORD1__SYS_Requires_Configuration__c","XX_ORD1__Parent_QLI__c"],aggregateFields:M,filters:a.configuration.filters,parentObjectField:a.configuration.parentObjectField,objectId:q,groupby:O.field,grouplevel:F,primarysort:m.value.primary.field,secondarysort:m.value.secondary.field,primarysortdesc:m.value.primary.direction!=="asc",secondarysortdesc:m.value.secondary.direction!=="asc",filterlogic:a.configuration.filterlogic},L=O.field&&F,j=await n.getRowItems(U,L);L?N(j,F):P(j),a.configuration.displayAttributes&&K(),B.value=!1,A.value=[]}async function K(){const T=C.value,O=[];v.value.forEach(q=>{q.rows.forEach(M=>{M.attributes=S.get(M.Id),console.log("row.attributes",M.attributes),T?M.Attributes=S.get(M.Id):M.attributesLoading=!0,O.push(M.Id)})});const F=await n.getLineItemAttributesNG(O);v.value.forEach(q=>{q.rows.forEach(M=>{const U=F[M.Id];if(U==null?void 0:U.some(j=>j.value&&!d.value.displayonlychanged||j.value&&j.existingValue&&d.value.displayonlychanged)){const j=[],H=new Set;U.forEach(Z=>{H.has(Z.apiName)||(H.add(Z.apiName),j.push(Z))}),M.Attributes=j,S.set(M.Id,j)}M.attributesLoading=!1})}),console.log("attributesByIdMap",S)}function P(T){var M;const O=T.lstRecords,F=[],q=T.lstRecords&&((M=T.lstRecords)==null?void 0:M.length)>0;if(i("counts",q),T.lstAggregateField&&T.lstAggregateField.length>0){const U=new Map;T.lstAggregateField.forEach(L=>{U.set(L.fieldName,L.totalValue)}),a.footer.forEach(L=>{L.value=U.get(L.field),F.push(L)})}v.value=[{rows:O,summary:F}]}function N(T,O){const F=[];let q;T.forEach(M=>{var U;if(O==="option"){if((U=M.product)!=null&&U.thisobject){const L={name:"",rows:[M.product.thisobject],summary:[],isProduct:!0,options:[]};M.options.length>0&&M.options.forEach(j=>{const H={name:j.groupName,rows:[]},Z=[];j.options.forEach(te=>{H.rows.push(te.thisobject)}),j.groupTotals&&j.groupTotals.length>0&&j.groupTotals.forEach(te=>{var ne,Q;Z.push({label:H.name,value:te.amount,style:((Q=(ne=c.value)==null?void 0:ne.groupfooter)==null?void 0:Q.style)||{}})}),H.summary=Z,L.options.push(H)}),F.push(L)}}else{if(q={name:M.groupName,rows:[]},M.productRows.forEach(L=>{q.rows.push(L[O].thisobject),L.options.forEach(j=>{const H={...j.thisobject};H.isOption=!0,q.rows.push(H)})}),c.value.displaygroupfooter){const L=[];M.groupTotals&&M.groupTotals.length>0&&M.groupTotals.forEach(j=>{var H,Z;L.push({label:q.name,value:j.amount,style:((Z=(H=c.value)==null?void 0:H.groupfooter)==null?void 0:Z.style)||{}})}),q.summary=L}else q.summary=[];F.push(q)}}),v.value=F}return e.onBeforeMount(()=>{console.log("Product List - Block Before Mount"),w.value=JSON.parse(JSON.stringify(a.columns)),_.value=a.summary,w.value.forEach(T=>{T.content.dataType=l(T.content.dataType),T.editby=T.editable,T.editable=T.editable!=="not",T.dataType=T.content.dataType,T.api=T.content.field,E.value.push(T.content.field)}),E.value.includes("XX_ORD1__QLI_Type__c")||E.value.push("XX_ORD1__QLI_Type__c"),W("RELOAD")}),(T,O)=>{var F;return p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",eg,[e.createElementVNode("div",tg,[t.header.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(F=t.header.style)==null?void 0:F.tag,text:t.header.title,style:e.normalizeStyle(t.header.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)]),!c.value.repeatcolumheadings||B.value?(e.openBlock(),e.createElementBlock("div",ng,[e.createVNode(kr,{cols:w.value,rows:[],summary:[],style:e.normalizeStyle(s.value),loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[0]||(O[0]=q=>z(q))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(b.value)},[e.createVNode(kr,{hidecolumn:"",cols:w.value,rows:[],summary:[],style:e.normalizeStyle(s.value),"row-loading":!0,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[1]||(O[1]=q=>z(q))},null,8,["cols","style","loading","del","configure","disabled","loading-row-id","del-records","attribute"])],4)):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(b.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,q=>(e.openBlock(),e.createElementBlock("div",{key:q.name,class:e.normalizeClass(["productlist",q.isProduct?"prodlist-product":"prodlist-option"])},[c.value.displaygroupheader&&q.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(y.value)},[e.createVNode(Re,{text:"Group: "+q.name,style:e.normalizeStyle(c.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(kr,{hidecolumn:!c.value.repeatcolumheadings,cols:w.value,rows:q.rows,style:e.normalizeStyle(s.value),"row-loading":B.value,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[2]||(O[2]=M=>z(M))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),q.summary.length>0?(e.openBlock(),e.createElementBlock("div",og,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.summary,(M,U)=>{var L,j,H;return e.openBlock(),e.createElementBlock("div",{key:U,class:"summary_row",style:e.normalizeStyle(f.value)},[e.createVNode(Re,{tag:(L=M==null?void 0:M.style)==null?void 0:L.tag,text:M.label+" : ",style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["tag","text","style"]),e.createTextVNode(" "),e.createVNode(Re,{loading:((j=A.value)==null?void 0:j.length)>0||B.value,tag:(H=M==null?void 0:M.style)==null?void 0:H.tag,text:M.value,style:e.normalizeStyle(M==null?void 0:M.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0),q.options?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(q.options,M=>(e.openBlock(),e.createElementBlock("div",{key:M.name},[c.value.displaygroupheader&&M.name?(e.openBlock(),e.createElementBlock("div",{key:0,class:"groupHeader",style:e.normalizeStyle(y.value)},[e.createVNode(Re,{text:"Group: "+M.name,style:e.normalizeStyle(c.value.groupheader.style)},null,8,["text","style"])],4)):e.createCommentVNode("",!0),e.createVNode(kr,{hidecolumn:!c.value.repeatcolumheadings,cols:w.value,rows:M.rows,style:e.normalizeStyle(s.value),"row-loading":B.value,loading:A.value,del:u.value,configure:h.value,disabled:k.value||t.isPreview,"loading-row-id":C.value,"del-records":D.value,attribute:d.value,"is-option":!0,onDelete:X,onConfigure:$,onUpdate:R,onReload:O[3]||(O[3]=U=>z(U))},null,8,["hidecolumn","cols","rows","style","row-loading","loading","del","configure","disabled","loading-row-id","del-records","attribute"]),M.summary.length>0?(e.openBlock(),e.createElementBlock("div",rg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.summary,(U,L)=>{var j,H,Z;return e.openBlock(),e.createElementBlock("div",{key:L,class:"summary_row",style:e.normalizeStyle(f.value)},[e.createVNode(Re,{tag:(j=U==null?void 0:U.style)==null?void 0:j.tag,text:U.label+" : ",style:e.normalizeStyle(U==null?void 0:U.style)},null,8,["tag","text","style"]),e.createTextVNode(" "),e.createVNode(Re,{loading:((H=A.value)==null?void 0:H.length)>0||B.value,tag:(Z=U==null?void 0:U.style)==null?void 0:Z.tag,text:U.value,style:e.normalizeStyle(U==null?void 0:U.style)},null,8,["loading","tag","text","style"])],4)}),128))])):e.createCommentVNode("",!0)]))),128)):e.createCommentVNode("",!0)],2))),128))],4))]))}}},[["__scopeId","data-v-d933d5c5"]]),ig={class:"detail-section"},lg={key:0,class:"selectedtext sm:hidden"},sg={class:"expand material-icons-outlined"},cg={key:1,class:"detail-section_title"},ug={key:2,class:"detail-section_slot"},dg=ve({__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(t,{emit:r}){const n=t;return(o,a)=>{var i,l;return e.openBlock(),e.createElementBlock("div",ig,[n.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["detail-section_header ect-border-solid ect-border-border-db",{"ect-border-b-1":n.expand,"ect-border-b-0":!n.expand}]),onClick:a[0]||(a[0]=s=>!n.disabled&&o.$emit("expand",!n.expand))},[n.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(i=n.style)==null?void 0:i.tag,text:n.title,style:e.normalizeStyle(n.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createBlock(yn,{key:1,type:"accordian-title"})):e.createCommentVNode("",!0),e.createElementVNode("div",null,[n.selectedText?(e.openBlock(),e.createElementBlock("span",lg,e.toDisplayString(n.selectedText),1)):e.createCommentVNode("",!0),e.createElementVNode("span",sg,e.toDisplayString(n.expand?"expand_more":"expand_less"),1)])],2)):(e.openBlock(),e.createElementBlock("div",cg,[t.title?(e.openBlock(),e.createBlock(Re,{key:0,tag:(l=t.style)==null?void 0:l.tag,text:t.title,style:e.normalizeStyle(t.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0)])),n.expand?(e.openBlock(),e.createElementBlock("div",ug,[e.renderSlot(o.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)])}}},[["__scopeId","data-v-3796312d"]]);function fg(t,r,n){if(!r)return t;if(n.aliasName)return hg(t,r,n);{const a=r.split(".").reduce((i,l)=>i[l]||"",t)||"";return{original:a,value:a,metadata:n}}}function hg(t,r,n){var l;const o=r.split(".");let a=r;o.length>1&&(a=o.pop(),t=o.reduce((s,u)=>s[u]||{},t));let i=t[n.aliasName]||t[a]||"";return i&&n.dataType&&((l=n.dataType)==null?void 0:l.toUpperCase())==="CURRENCY"&&i.includes("(")&&(i=i.split("(")[0]),{value:i,original:t[a],metadata:n}}function pg(t){let r=t.replace(/[_.]/g,"")+"Formatted";return console.log("aliasName",r),r}const mg={class:"quote-summary"},yg={key:0,class:"qt-smuarry"},gg={class:"summary ect-mt-[1rem] md:ect-mt-[0]"},bg=ve({__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(t){const r=Nn(),n=t,o=xi(),a=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.header}),i=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.content}),l=e.computed(()=>{var b;return(b=n.fields)==null?void 0:b.footer}),s=e.ref(!1),u=e.ref(!1),h=e.ref(!1),d=e.ref([]),m=e.ref({}),c=e.computed(()=>{var b,p;return o.isMobile.value&&!s.value&&l.value&&l.value.length>0?`${l.value[0].label} ${((b=m.value[l.value[0].field])==null?void 0:b.value)||""}`:(p=a.value)==null?void 0:p.title});async function y(b){console.log("Quote Summary",b),u.value=!0,h.value&&await r.calculateAvaTax();const p=d.value.map(({field:x})=>x);m.value=await r.getRecordFieldValue({recordId:n.quoteId,lstFields:p}),d.value.forEach(({field:x,dataType:g})=>{m.value[x]=fg(m.value,x,{dataType:g,aliasName:pg(x)})}),u.value=!1}const f=()=>{o.isMobile.value?s.value=!s.value:s.value=!0};return e.onMounted(async()=>{var p,x,g,C,_,E,A,k,B;s.value=!o.isMobile.value;const b=(x=(p=document.querySelector(`[page-block-id="${n.id}"]`))==null?void 0:p.parentElement)==null?void 0:x.parentElement;b&&(b.style.display=o.isMobile.value?"none":"block"),h.value=n.tax||((g=i.value)==null?void 0:g.some(({field:D})=>D==="XX_ORD1__Taxes__c")),(n.quoteId||h.value)&&(d.value=(_=(C=n.fields)==null?void 0:C.content)==null?void 0:_.map(({field:D,dataType:w})=>({field:D,dataType:w})),((A=(E=n.fields)==null?void 0:E.footer)==null?void 0:A.length)>0&&((B=(k=n.fields)==null?void 0:k.footer)==null||B.forEach(({field:D,dataType:w})=>d.value.push({field:D,dataType:w}))),y())}),(b,p)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"#qtsummary",disabled:!e.unref(o).isMobile.value},[e.createElementVNode("div",mg,[t.quoteId?(e.openBlock(),e.createElementBlock("div",yg,[e.createVNode(dg,{expand:s.value,title:c.value,style:e.normalizeStyle(a.value.style),header:e.unref(o).isMobile.value,onExpand:p[0]||(p[0]=x=>f())},{default:e.withCtx(()=>[e.createElementVNode("div",gg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,x=>{var g,C,_,E;return e.openBlock(),e.createElementBlock("div",{key:x.field,class:"summary-item"},[x.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(g=x.style)==null?void 0:g.tag,text:x.label,style:e.normalizeStyle(x.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(C=m.value[x.field])!=null&&C.value?(e.openBlock(),e.createBlock(Re,{key:1,loading:u.value,tag:(_=x.style)==null?void 0:_.tag,text:(E=m.value[x.field])==null?void 0:E.value,style:e.normalizeStyle(x.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,x=>{var g,C,_,E;return e.openBlock(),e.createElementBlock("div",{key:x.field,class:"summary-total"},[x.label?(e.openBlock(),e.createBlock(Re,{key:0,tag:(g=x.style)==null?void 0:g.tag,text:x.label,style:e.normalizeStyle(x.style)},null,8,["tag","text","style"])):e.createCommentVNode("",!0),(C=m.value[x.field])!=null&&C.value?(e.openBlock(),e.createBlock(Re,{key:1,loading:u.value,tag:(_=x.style)==null?void 0:_.tag,text:(E=m.value[x.field])==null?void 0:E.value,style:e.normalizeStyle(x.style)},null,8,["loading","tag","text","style"])):e.createCommentVNode("",!0)])}),128))])]),_:1},8,["expand","title","style","header"])])):e.createCommentVNode("",!0)])],8,["disabled"]))}},[["__scopeId","data-v-0821469a"]]),xg={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"}},_g={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 t=[];return!this.type||!xg[this.type]||this.type==="primary"?t.push("esg-btn-primary"):this.type==="secondary"?t.push("esg-btn-secondary"):(this.type==="link"||this.type==="ghost")&&t.push("noborder"),this.disabled&&t.push("disabled"),t},getBtnStyle(){return null}}},Cg={key:0,class:"ect-flex ect-justify-center"},Eg={key:1};function kg(t,r,n,o,a,i){const l=e.resolveComponent("AtomSpinner");return e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.tag),e.mergeProps(t.$attrs,{type:n.method,class:["rectangle-button",i.getBtnClass()],style:i.getBtnStyle(),onClick:r[0]||(r[0]=e.withModifiers(s=>t.$emit("clicked"),["prevent"]))}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[n.showspinner?(e.openBlock(),e.createElementBlock("div",Cg,[e.createVNode(l,{class:"item-button_spinner"})])):(e.openBlock(),e.createElementBlock("div",Eg,e.toDisplayString(n.text),1))],!0)]),_:3},16,["type","class","style"])}const vr=ve(_g,[["render",kg],["__scopeId","data-v-7428ebd4"]]),vg={class:"promocode-input"},Ag={class:"m-1"},wg=ve({__name:"OrganismsPromoCodeBlock",props:{fields:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})},id:{type:String,required:!0},isPreview:{type:Boolean,default:!1}},setup(t){const r=Nn(),n=t,o=e.computed(()=>n.fields.label),a=e.ref(!1),i=e.ref(""),l=e.ref(!1),s=e.ref(!1),u=e.ref(""),h=e.ref(null),d=async()=>{if(n.isPreview)return;l.value=!0,a.value=!0,s.value=!1,await r.getQLIsForPromoCode();const f=await m(!1);f.error||(u.value=f),l.value=!1},m=async f=>{const p=r.qlisList,x=Math.ceil(p.length/50);let g="";for(let C=0;C<x;C++){const _=C*50,E=_+50,A=C===x-1;if(g=await c(p.slice(_,E),A,f),g&&g.error)return s.value=g.error,h.value.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),l.value=!1,f||(a.value=!1,y(!0)),g}return g},c=async(f,b,p)=>await r.applyPromoCodeNG(p?"":i.value,f,b),y=async f=>{if(n.isPreview)return;l.value=!0,await r.getQLIsForPromoCode(),f!==!0&&(s.value=!1);const b=await m(!0);(!b||b&&!b.error)&&f!==!0&&(a.value=!1,u.value="",i.value=""),l.value=!1};return e.onMounted(async()=>{const f=await r.getPromoCodeInfo();console.log("Offer::",f),f!=null&&f.XX_ORD1__Promo_Code__c&&(i.value=f.XX_ORD1__Promo_Code__c,u.value=f.XX_ORD1__Short_Description__c,a.value=!0)}),(f,b)=>{var p,x,g,C,_,E,A;return e.openBlock(),e.createElementBlock("div",{ref_key:"promocodeRef",ref:h,class:"promocode"},[(p=o.value)!=null&&p.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(x=o.value)==null?void 0:x.title,style:e.normalizeStyle((g=o.value)==null?void 0:g.style)},null,8,["text","style"])):e.createCommentVNode("",!0),e.createElementVNode("div",vg,[e.createVNode(Rn,{modelValue:i.value,"onUpdate:modelValue":[b[0]||(b[0]=k=>i.value=k),b[1]||(b[1]=k=>a.value=!1)],class:"promocode-input_box",disabled:a.value||t.isPreview,error:s.value},null,8,["modelValue","disabled","error"]),l.value?(e.openBlock(),e.createBlock(ya,{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.value?(e.openBlock(),e.createBlock(vr,{key:1,theme:(E=t.fields.removeButton)==null?void 0:E.style.theme,disabled:i.value.length<1,text:(A=t.fields.removeButton)==null?void 0:A.title,onClick:y},null,8,["theme","disabled","text"])):(e.openBlock(),e.createBlock(vr,{key:0,theme:(C=t.fields.applyButton)==null?void 0:C.style.theme,disabled:i.value.length<1,text:(_=t.fields.applyButton)==null?void 0:_.title,onClick:d},null,8,["theme","disabled","text"]))],64)),e.createElementVNode("span",Ag,e.toDisplayString(u.value),1)])],512)}}},[["__scopeId","data-v-861bd8dd"]]),Uc={"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 Ng(t){return Uc[t]||"dd/MM/yyyy"}function Sg(t,r){if((t==null?void 0:t.length)<6||!r)return null;const n=Uc[r]||"dd/MM/yyyy",o=n.includes("/")?"/":n.includes("-")?"-":".",a=n.split(o),i=t.split(o),l={};if(a.forEach((u,h)=>{l[u]=parseInt(i[h])}),l.yyyy>9999||l.yyyy<1e3||l.MM<0||l.MM>12||l.dd<0||l.dd>31)return null;const s=new Date(l.yyyy,l.MM-1,l.dd);return s!="Invalid Date"?s:null}const Ar=t=>(e.pushScopeId("data-v-13eaa242"),t=t(),e.popScopeId(),t),Bg=["data-test-id"],Ig=["for","data-test-id"],Tg=["data-test-id"],Og=["placeholder","data-test-id"],Dg=["data-test-id"],Vg=["data-test-id"],Fg=["data-test-id"],Mg=["data-test-id"],Rg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrows"},null,-1))],Lg=["data-test-id"],Pg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-left-arrow"},null,-1))],qg=["data-test-id"],$g=["data-test-id"],Ug=["data-test-id"],zg=["data-test-id"],jg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrow"},null,-1))],Hg=["data-test-id"],Gg=[Ar(()=>e.createElementVNode("span",{class:"mdpchbi-right-arrows"},null,-1))],Kg=["data-test-id"],Xg={class:"c-container"},Wg={class:"cc-head"},Qg={class:"cc-body"},Zg={class:"cdc-day"},Jg=["onClick"],Yg=60*60*24*1e3,e7=ve({__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(t,{emit:r}){const n=t,o=r,a=Date.now()-Date.now()%Yg+new Date().getTimezoneOffset()*1e3*60,i=Q=>{if(!Q)return"";const[ce,ue,pe]=Q.split("-");return`${ue}/${pe}/${ce}`},l=Q=>{if(!Q)return"";const[ce,ue,pe]=Q.split("/");return`${pe}-${ce.padStart(2,"0")}-${ue.padStart(2,"0")}`},s=e.ref({year:new Date().getFullYear(),month:new Date().getMonth(),selectedDay:a,monthDetails:[]}),u=e.ref({position:"fixed",top:"0px",left:"0px",width:"0px"}),h=["SUN","MON","TUE","WED","THU","FRI","SAT"],d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"],c=e.ref(new Date(1e3,0,1)),y=e.ref(new Date(9999,0,1)),f=e.ref(!0),b=e.ref(!1),p=e.ref(""),x=e.ref(""),g=e.ref(!1),C=e.ref(""),_=e.ref(-1),E=e.computed(()=>Ng(n.locale)),A=e.computed(()=>c.value.getFullYear()<s.value.year),k=e.computed(()=>y.value.getFullYear()>s.value.year),B=e.computed(()=>A.value||c.value.getMonth()<s.value.month),D=e.computed(()=>k.value||y.value.getMonth()>s.value.month),w=e.computed(()=>{if(x.value){const Q=x.value.getTime();if(y.value.getTime()<Q)return"Max date can be "+y.value.toLocaleDateString(n.locale);if(c.value.getTime()>Q)return"Min date can be "+c.value.toLocaleDateString(n.locale)}return!1}),v=e.computed(()=>{let Q=n.error===""?!1:n.error===!0?`${n.label||"Field"} is required`:n.error;return f.value||(Q="Date format must be "+E.value),w.value&&(Q=w.value),o("error",Q),Q}),S=e.computed(()=>(C.value==""||C.value==null)&&(n.modelValue==""||n.modelValue==null)?!1:C.value!=n.modelValue);e.watch(()=>n.modelValue,Q=>{p.value=Q?i(Q):""}),e.watch(()=>n.min,Q=>{c.value=Q?new Date(Q):new Date(1e3,0,1)}),e.watch(()=>n.max,Q=>{y.value=Q?new Date(Q):new Date(9999,0,1)}),e.watch(p,Q=>{if(Q)try{const ce=Sg(Q,n.locale);if(x.value=ce||x.value,f.value=!!ce,f.value){const ue=l(Q);if(C.value===ue)return;o("update:modelValue",ue)}}catch(ce){console.info("[ERROR]: Date parsing error:",ce),f.value=!1}else f.value=!0,x.value=null,o("update:modelValue","")});const I=e.ref(null),R=e.ref(null),z=e.ref(null);e.onMounted(()=>{ne(),y.value=n.max?new Date(n.max):y.value,c.value=n.min?new Date(n.min):c.value,n.modelValue&&(p.value=i(n.modelValue),f.value=!!p.value),C.value=n.modelValue,window.addEventListener("resize",$),window.addEventListener("scroll",$,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)});const $=()=>{if(!z.value)return;const Q=z.value.getBoundingClientRect(),ce=334;u.value={position:"fixed",top:`${Q.bottom+4}px`,left:`${Q.left}px`,width:`${ce}px`,zIndex:9999}},X=()=>{g.value||(L(),g.value=!0,$(),o("focus-in"))},W=(Q=!1)=>{(!b.value||Q)&&setTimeout(()=>{_.value=-1,g.value=!1,o("focus-out",x.value)},100)},K=()=>{R.value&&R.value.focus()},P=Q=>{const ce=Q.index-Q.firstDay,ue=Q.index%7;let pe=Q.month-1,ie=Q.year;pe<0&&(pe=11,ie--);const de=N(ie,pe),_e=(ce<0?de+ce:ce%Q.numberOfDays)+1,xe=new Date(Q.year,Q.month,_e).getTime(),ye=ce<0||c.value.getTime()>xe?-1:ce>=Q.numberOfDays||y.value.getTime()<xe?1:0;return{date:_e,day:ue,month:ye,timestamp:xe,dayString:d[ue]}},N=(Q,ce)=>40-new Date(Q,ce,40).getDate(),T=(Q,ce)=>{const ue=new Date(Q,ce).getDay(),pe=N(Q,ce),ie=[],de=6;let _e=null,xe=0;const ye=7;for(let oe=0;oe<de;oe++)for(let le=0;le<ye;le++)_e=P({index:xe,numberOfDays:pe,firstDay:ue,year:Q,month:ce}),ie.push(_e),xe++;return ie},O=Q=>Q.timestamp===a,F=Q=>Q.timestamp===s.value.selectedDay,q=Q=>{if(!Q)return null;if(Q instanceof Date)return{year:Q.getFullYear(),month:Q.getMonth()+1,date:Q.getDate()};if(typeof Q=="string"&&Q.includes("/")){const[ce,ue,pe]=Q.split("/");return{year:parseInt(pe),month:parseInt(ce),date:parseInt(ue)}}return null},M=Q=>m[Math.max(Math.min(11,Q),0)]||"Month",U=Q=>{const ce=new Date(Q.year,Q.month-1,Q.date).getTime();s.value={selectedDay:ce}},L=()=>{ne();const Q=q(x.value);Q!==null&&(U(Q),s.value={year:Q.year,month:Q.month-1,monthDetails:T(Q.year,Q.month-1)})},j=Q=>{const ce=new Date(Q),ue=(ce.getMonth()+1).toString().padStart(2,"0"),pe=ce.getDate().toString().padStart(2,"0"),ie=ce.getFullYear();return p.value=`${ue}/${pe}/${ie}`,`${ie}-${ue}-${pe}`},H=Q=>{s.value={selectedDay:Q.timestamp};const ce=j(Q.timestamp);W(!0),o("update:modelValue",ce),R.value&&R.value.blur()},Z=Q=>{if(n.disableYear)return;const ce=s.value.year+Q;let ue=s.value.month;c.value.getFullYear()===ce&&c.value.getMonth()>ue&&(ue=c.value.getMonth()),y.value.getFullYear()===ce&&y.value.getMonth()<ue&&(ue=y.value.getMonth()),s.value={year:ce,month:ue,monthDetails:T(ce,ue)}},te=Q=>{if(n.disableMonth)return;let ce=s.value.year,ue=s.value.month+Q;ue===-1?(ue=11,ce--):ue===12&&(ue=0,ce++),s.value={year:ce,month:ue,monthDetails:T(ce,ue)}},ne=()=>{const Q=new Date,ce=Q.getFullYear(),ue=Q.getMonth();s.value={...s.value,year:ce,month:ue,selectedDay:a,monthDetails:T(ce,ue)}};return(Q,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"datePick",ref:I,class:"MyDatePicker","data-test-id":t.dataTestId,onMouseover:ce[2]||(ce[2]=ue=>b.value=!0),onMouseout:ce[3]||(ce[3]=ue=>b.value=!1)},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(["title_label",{error_color:!!v.value}]),for:t.label,"data-test-id":`${t.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!v.value})},"*",2)):e.createCommentVNode("",!0)],10,Ig)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"triggerElement",ref:z,tabindex:"0",class:e.normalizeClass(["mdp-input ectheme-input-box ect-mb-0",{"mdp-input_focus":g.value,errorBorder_color:!!v.value,highlight:S.value&&t.highlight}]),"data-test-id":`${t.dataTestId}-input-wrapper`,onFocusin:X,onFocusout:ce[1]||(ce[1]=ue=>W(!1)),onClick:K},[e.withDirectives(e.createElementVNode("input",{id:"calendar",ref_key:"inputRef",ref:R,"onUpdate:modelValue":ce[0]||(ce[0]=ue=>p.value=ue),type:"text",autocomplete:"off",placeholder:E.value,"data-test-id":`${t.dataTestId}-input`},null,8,Og),[[e.vModelText,p.value]]),e.createVNode(Be,{icon:"calendar_today",size:18,for:"calendar","data-test-id":`${t.dataTestId}-calendar-icon`},null,8,["data-test-id"])],42,Tg),v.value?(e.openBlock(),e.createElementBlock("label",{key:1,class:"error_label","data-test-id":`${t.dataTestId}-error`},[e.createElementVNode("p",null,e.toDisplayString(v.value),1)],8,Dg)):e.createCommentVNode("",!0)],40,Bg),(e.openBlock(),e.createBlock(e.Teleport,{to:".dropdowntp"},[g.value&&!t.disabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"mdp-container",style:e.normalizeStyle(u.value),"data-test-id":`${t.dataTestId}-calendar-popup`,onMousedown:ce[8]||(ce[8]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"mdpc-head","data-test-id":`${t.dataTestId}-calendar-header`},[e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!A.value||t.disableYear}]),onClick:ce[4]||(ce[4]=ue=>Z(-1))},Rg,2)],8,Mg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-prev-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!B.value||t.disableMonth}]),onClick:ce[5]||(ce[5]=ue=>te(-1))},Pg,2)],8,Lg),e.createElementVNode("div",{class:"mdpch-container","data-test-id":`${t.dataTestId}-date-display`},[e.createElementVNode("div",{class:"mdpchc-year","data-test-id":`${t.dataTestId}-year-display`},e.toDisplayString(s.value.year),9,$g),e.createElementVNode("div",{class:"mdpchc-month","data-test-id":`${t.dataTestId}-month-display`},e.toDisplayString(M(s.value.month)),9,Ug)],8,qg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-month-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!D.value||t.disableMonth}]),onClick:ce[6]||(ce[6]=ue=>te(1))},jg,2)],8,zg),e.createElementVNode("div",{class:"mdpch-button","data-test-id":`${t.dataTestId}-next-year-button`},[e.createElementVNode("div",{class:e.normalizeClass(["mdpchb-inner",{disabled:!k.value||t.disableYear}]),onClick:ce[7]||(ce[7]=ue=>Z(1))},Gg,2)],8,Hg)],8,Fg),e.createElementVNode("div",{class:"mdpc-body","data-test-id":`${t.dataTestId}-calendar-body`},[e.createElementVNode("div",Xg,[e.createElementVNode("div",Wg,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,(ue,pe)=>e.createElementVNode("div",{key:pe,class:"cch-name"},e.toDisplayString(ue),1)),64))]),e.createElementVNode("div",Qg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value.monthDetails,(ue,pe)=>(e.openBlock(),e.createElementBlock("div",{key:pe,class:e.normalizeClass(["c-day-container",{disabled:ue.month!==0,highlight:O(ue),"highlight-green":F(ue)}])},[e.createElementVNode("div",Zg,[e.createElementVNode("span",{onClick:ie=>H(ue)},e.toDisplayString(ue.date),9,Jg)])],2))),128))])])],8,Kg)],44,Vg)):e.createCommentVNode("",!0)]))],64))}},[["__scopeId","data-v-13eaa242"]]),zc=t=>(e.pushScopeId("data-v-9b473c8b"),t=t(),e.popScopeId(),t),t7=zc(()=>e.createElementVNode("div",{class:"dropdowntp"},null,-1)),n7={key:0,class:"custom-form_block"},o7={class:"custom-form_block-header"},r7={key:0,class:"custom-form_block-content"},a7={key:1,class:"custom-form_block-content"},i7={key:2,class:"custom-form_block-footer"},l7={key:3,class:"custom-form_block-action"},s7={key:1,class:"custom-form_success"},c7={class:"custom-form_success_message"},u7=zc(()=>e.createElementVNode("span",{class:"custom-form_success_message-icon material-icons-outlined"}," done ",-1)),d7=ve({__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(t,{expose:r}){var B;const n=Nn(),o=t,a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,i=e.ref({}),l=e.ref(!1),s=e.ref(!1),u=e.ref(!1),h=e.ref({}),d=e.ref({}),m=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.header}),c=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.footer}),y=e.computed(()=>o.fields&&o.fields.action&&o.fields.action.label?o.fields.action:!1),f=e.computed(()=>"en-US"),b=e.computed(()=>{var D;return(D=o.fields)==null?void 0:D.confirmation}),p=e.computed(()=>o.configuration),x=e.ref(JSON.parse(JSON.stringify((B=o.fields)==null?void 0:B.content))),g=D=>D?"custom-form_block-content_"+D.toLowerCase():"custom-form_block-content_full",C=()=>{u.value=!1,x.value.forEach(D=>{p.value.populate||(i.value[D.field]="")})},_=St(async function(D,w,v){x.value[v].loading=!0;const S={objectApiName:o.configuration.objectType,lookupFieldApiName:w,searchTerm:D||""},I=await n.getLookupRecords(S);console.log("Records:::",I),x.value[v].options=I,x.value[v].loading=!1}),E=St(()=>{!y.value&&!o.fields.isGuidance&&A(!0)},500),A=async D=>{console.log("handlerActionClick");let w=!1;if(x.value.forEach(v=>{v.isFormulaField||(v.dataType==="DATETIME"?i.value[v.field]=new Date().toISOString():v.required&&v.editable&&!i.value[v.field]&&v.dataType!=="BOOLEAN"?(v.error=!0,w=!0):(v.error=null,v.dataType==="EMAIL"&&i.value[v.field]&&!a.test(i.value[v.field])&&(v.error="Enter a valid email",w=!0)))}),!w){s.value=!0;const v=[];for(const I in i.value)(d.value[I]||I==="Id")&&v.push({fieldName:I,fieldValue:i.value[I]});const S={fields:v,objectType:o.configuration.objectType};if(o.options&&o.options.returnError){const I=await n.updateRecord(S,!0);if(!I||typeof I=="object"&&I.ERROR)return console.log("Error in saving",I),s.value=!1,I?I.ERROR:!1}else if(!await n.updateRecord(S))return s.value=!1,!1;return s.value=!1,D||(u.value=!0),!0}};async function k(){l.value=!0;const D=x.value.filter(v=>v.dataType!=="DATETIME").map(v=>v.field);let w={};if(p.value.populate&&o.quoteId&&D.length)try{w=await n.getRecordFieldValue({recordId:o.quoteId,lstFields:D})||{}}catch(v){console.error("[OrganismsCustomFormBlock] getRecordFieldValue failed",v)}x.value.forEach(v=>{var S,I,R;if(v.visiblity=v.dataType!=="DATETIME",p.value.populate&&o.quoteId)if(v.dataType==="BOOLEAN")i.value[v.field]=((S=w[v.field])==null?void 0:S.value)??!1;else if(v.dataType==="REFERENCE"){const z=v.field.replace("__c","__r"),$=(I=w[z])==null?void 0:I.value;$&&(i.value[v.field]=$.Id,v.options=[{Name:$.Name,Id:$.Id}])}else v.dataType==="DATE"?i.value[v.field]=((R=w[v.field])==null?void 0:R.value)??"":i.value[v.field]=We(w,v.field,v.dataType,!0,!0);v.editable&&v.dataType==="PICKLIST"&&(v.options=v.picklist.map(z=>({label:z,value:z})))}),l.value=!1}return e.onBeforeMount(async()=>{l.value=!0,h.value=JSON.parse(JSON.stringify(o.fields)),x.value=h.value.content,x.value.forEach(D=>{d.value[D.field]=D.editable&&!D.isFormulaField,D.size=g(D.size)}),h.value.request=i.value={Id:o.quoteId},o.quoteId&&await k()}),r({handlerActionClick:A}),(D,w)=>{var v,S,I,R,z,$,X;return e.openBlock(),e.createElementBlock(e.Fragment,null,[t7,u.value?(e.openBlock(),e.createElementBlock("div",s7,[e.createElementVNode("div",c7,[u7,e.createTextVNode(" "+e.toDisplayString((X=b.value)==null?void 0:X.label),1)]),b.value&&b.value.close?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:C},"click to close")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",n7,[e.createElementVNode("div",o7,[(v=m.value)!=null&&v.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(S=m.value)==null?void 0:S.title,style:e.normalizeStyle((I=m.value)==null?void 0:I.style)},null,8,["text","style"])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",r7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(W,K)=>(e.openBlock(),e.createElementBlock("div",{key:K,class:e.normalizeClass(["custom-form_block-content_skeletion",W.size])},[e.createVNode(Qt)],2))),128))])):l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",a7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(W,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K},[W.visiblity?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["custom-form_block-content_input",W.size])},[W.dataType==="PICKLIST"?(e.openBlock(),e.createBlock(rn,{key:0,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],options:W.options,disabled:!W.editable,select:"",error:W.error,required:W.required,label:W.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label"])):W.dataType==="BOOLEAN"?(e.openBlock(),e.createBlock(Er,{key:1,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],label:W.label},null,8,["modelValue","onUpdate:modelValue","label"])):W.dataType==="REFERENCE"?(e.openBlock(),e.createBlock(rn,{key:2,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],options:W.options,disabled:!W.editable,lookup:"",search:"",error:W.error,required:W.required,label:W.label,loading:W.loading,highlight:"",property:{key:"Id",value:"Name"},onSearch:P=>e.unref(_)(P,W.field,K)},null,8,["modelValue","onUpdate:modelValue","options","disabled","error","required","label","loading","onSearch"])):W.dataType==="DATE"?(e.openBlock(),e.createBlock(e7,{key:3,modelValue:i.value[W.field],"onUpdate:modelValue":P=>i.value[W.field]=P,label:W.label,required:W.required,disabled:!W.editable,error:W.error,locale:f.value,"data-test-id":`cart-customform-datepicker-${W.field}`,highlight:""},null,8,["modelValue","onUpdate:modelValue","label","required","disabled","error","locale","data-test-id"])):W.visiblity?(e.openBlock(),e.createBlock(Rn,{key:4,modelValue:i.value[W.field],"onUpdate:modelValue":[P=>i.value[W.field]=P,e.unref(E)],error:W.error,required:W.required,disabled:!W.editable,label:W.label,highlight:""},null,8,["modelValue","onUpdate:modelValue","error","required","disabled","label"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))),128))])),c.value?(e.openBlock(),e.createElementBlock("div",i7,[(R=c.value)!=null&&R.title?(e.openBlock(),e.createBlock(Re,{key:0,text:(z=c.value)==null?void 0:z.title,style:e.normalizeStyle(($=c.value)==null?void 0:$.style)},null,8,["text","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",l7,[s.value?(e.openBlock(),e.createBlock(ya,{key:0,class:"item-button_spinner"})):(e.openBlock(),e.createBlock(vr,{key:1,theme:y.value.style.theme,text:y.value.label,onClick:w[0]||(w[0]=W=>A(!1))},null,8,["theme","text"]))])):e.createCommentVNode("",!0)]))],64)}}},[["__scopeId","data-v-9b473c8b"]]),f7={class:"custom-button"},h7={class:"loader"},p7=ve({__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(t){const r=Nn(),n=mn(),o=e.ref(null),a=t,i=e.computed(()=>{var d;return!!((d=n.quoteRecord)!=null&&d.XX_ORD1__Active_Customer_Contact__c)||!0}),l=e.computed(()=>{var d,m;return(m=(d=a.fields)==null?void 0:d.actions)==null?void 0:m.filter(c=>i.value?c.action!=="ACTIVATE":c.action!=="SAVE_FOR_LATER")}),s=d=>d.key??`${d.action}-${d.label}`,u=d=>o.value===s(d),h=d=>{if(a.isPreview)return;const m=s(d);d.action==="SAVE_FOR_LATER"&&(o.value=m),Et("expeditecart:clicked",{action:d.action,label:d.label,targetTemplateId:d.targetTemplateId,quoteId:r.quoteId,isActive:i.value,isPreview:a.isPreview})};return(d,m)=>(e.openBlock(),e.createElementBlock("div",f7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(c,y)=>(e.openBlock(),e.createBlock(vr,{key:y,theme:c.style.theme,text:c.label,class:"custom-button_action",onClick:f=>h(c)},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass({"text-loading":u(c)})},e.toDisplayString(c.label),3),e.createElementVNode("span",h7,[u(c)?(e.openBlock(),e.createBlock(Pc,{key:0})):e.createCommentVNode("",!0)])]),_:2},1032,["theme","text","onClick"]))),128))]))}},[["__scopeId","data-v-3245ee72"]]),_i=function(t,r){const n={};n.sectionStyle={},n.blockStyle={};const{visiblity:o}=t;n.visibility=o;const{layout:a}=t;if(n.blockStyle=m7(a,r),a&&(a!=null&&a.padding)){const{top:s,bottom:u,left:h,right:d}=a.padding;s&&(n.sectionStyle.paddingTop=`${s}px`),u&&(n.sectionStyle.paddingBottom=`${u}px`),h&&(n.sectionStyle.paddingLeft=`${h}px`),d&&(n.sectionStyle.paddingRight=`${d}px`)}a!=null&&a.gap&&(n.sectionStyle.gap=`${a.gap}px`);const{styling:i}=t;i&&(i.verticalAlignment&&(n.sectionStyle.alignItems=i.verticalAlignment),i.radius&&(n.sectionStyle.borderRadius=i.radius),i.borderStyle&&(n.sectionStyle.borderStyle=i.borderStyle));const{Background:l}=t;return l&&l.style==="Solid"&&(n.sectionStyle.backgroundColor=l.color),l&&l.opacity==="100%"&&(n.sectionStyle.opacity=1),l&&l.image&&l.image!=="sampleImage.png"&&(n.sectionStyle.backgroundImage=`url(${l.image})`,l.imageSize&&(n.sectionStyle.backgroundSize=l.imageSize)),l&&l.repeat==="no-repeat"&&(n.sectionStyle.backgroundRepeat=l.repeat),l&&(l.horizontalAlignment||l.verticalAlignment)&&(n.sectionStyle.backgroundPosition=l.horizontalAlignment+" "+l.verticalAlignment),n};function m7(t,r){if(!t)return[{}];const{columnSize:n,columns:o}=t;if(r)return Array(o).fill({display:"flex",flexDirection:"column",width:"100%"});if(!n)return Array(o).fill({});const a=n.split("/");return typeof o=="string"&&a.length!==parseInt(o)?Array(o).fill({}):typeof o=="number"&&a.length!==o?Array(o).fill({}):a.map(i=>({flexBasis:`${i}`}))}const y7=["data-sid","data-sname"],g7=["data-bid","data-bname"],b7=["page-block-id"],x7=["page-block-id"],_7=["page-block-id"],C7=["page-block-id"],E7=["page-block-id"],k7=["page-block-id"],jc={__name:"TemplateRenderer",props:{onCatalogCountUpdate:{type:Function,default:null},initialCatalogItems:{type:Array,default:()=>[]},isPreview:{type:Boolean,default:!1},quoteId:{type:String,default:null}},setup(t,{expose:r}){const n=t,o=Co(),a=Nn(),i=xi(),l=e.computed(()=>o.pageBlocks||[]),s=e.ref(0);r({refreshTemplate:()=>{s.value+=1}});const h=m=>!0,d=e.computed(()=>{var c,y,f,b;const m=[];return console.log("props.sections template renderer",l.value),console.log("props.isPreview",n.isPreview),n.isPreview&&((c=l.value)!=null&&c.content)?(f=(y=l.value)==null?void 0:y.content)==null||f.forEach(p=>{const x=[],g=p.section,C=JSON.parse(g.XX_ORD1__Content_JSON__c);let _={};C&&(_=_i(C,i.isMobile),g.styleObject=g.hideStyle?{}:_.sectionStyle,g.visibility=_.visibility),p.blocks.forEach(E=>{let A=E.XX_ORD1__Content_Block__r;const k=JSON.parse(A.XX_ORD1__Content_JSON__c);A={...A,...k};let B={};k&&(B=_i(k,i.isMobile),A.styleObject=A.hideStyle?{}:B.blockStyle),x.push(A)}),g.blocks=x,m.push(g)}):(b=l.value)==null||b.forEach(p=>{var _;const x={...p},g=typeof p.contentJSON=="string"?JSON.parse(p.contentJSON):p.contentJSON;let C={};g&&(C=_i(g,i.isMobile),x.styleObject=p.hideStyle?{}:C.sectionStyle,x.visibility=C.visibility,(_=x.blocks)==null||_.forEach((E,A)=>{E.styleObject=C.blockStyle[A]})),m.push(x)}),m});return(m,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(pa),(e.openBlock(),e.createElementBlock("div",{key:s.value,class:"contentRendered ectheme",style:{width:"100%","box-sizing":"border-box"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y.id},[h(y.visibility)?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(y.styleObject),class:"ect-flex ect-flex-col","data-sid":y.sectionId,"data-sname":y.sectionName},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.blocks,f=>(e.openBlock(),e.createElementBlock("div",{key:f.id,style:e.normalizeStyle(f.styleObject),class:"ect-w-full","data-bid":f.blockId,"data-bname":f.blockName},[f.componentName==="productList"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:0,"page-block-id":f.Id,class:"ect-m-auto ect-w-full"},[e.createVNode(ag,{id:f.Id,header:f.fields.header,columns:f.fields.columns,footer:f.fields.footer,fields:f.fields,configuration:f.configuration,"is-preview":t.isPreview},null,8,["id","header","columns","footer","fields","configuration","is-preview"])],8,b7)):f.componentName==="quoteSummary"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:1,"page-block-id":f.Id,class:""},[e.createVNode(bg,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":e.unref(a).quoteId},null,8,["id","configuration","fields","quote-id"])],8,x7)):f.componentName==="promoCode"?(e.openBlock(),e.createElementBlock("div",{key:2,"page-block-id":f.Id,class:""},[e.createVNode(wg,{id:f.Id,fields:f.fields,configuration:f.configuration,"is-preview":t.isPreview},null,8,["id","fields","configuration","is-preview"])],8,_7)):f.componentName==="customForm"&&e.unref(a).quoteId?(e.openBlock(),e.createElementBlock("div",{key:3,"page-block-id":f.Id,class:"ect-w-full"},[e.createVNode(d7,{id:f.Id,configuration:f.configuration,fields:f.fields,"quote-id":e.unref(a).quoteId},null,8,["id","configuration","fields","quote-id"])],8,C7)):f.componentName==="customButtons"?(e.openBlock(),e.createElementBlock("div",{key:4,"page-block-id":f.Id,class:""},[e.createVNode(p7,{id:f.Id,configuration:f.configuration,fields:f.fields,"is-preview":t.isPreview},null,8,["id","configuration","fields","is-preview"])],8,E7)):f.componentName==="catalogBlock"?(e.openBlock(),e.createElementBlock("div",{key:5,"page-block-id":f.Id,class:""},[e.createVNode(R8,{id:f.Id,mode:"preview",configuration:f.configuration,fields:f.fields,"search-term":f.searchTerm,"on-count-update":t.onCatalogCountUpdate,"initial-items":t.initialCatalogItems,"is-preview":t.isPreview,"quote-id":t.quoteId},null,8,["id","configuration","fields","search-term","on-count-update","initial-items","is-preview","quote-id"])],8,k7)):e.createCommentVNode("",!0)],12,g7))),128))],12,y7)):e.createCommentVNode("",!0)],64))),128))]))],64))}},v7=t=>(e.pushScopeId("data-v-04b2bdef"),t=t(),e.popScopeId(),t),A7={class:"ect-composable-catalog-wrapper","data-test-id":"expose-expediteCatalog-wrapper"},w7={key:0,class:"ect-flex ect-items-center ect-justify-center ect-min-h-[50vh]","data-test-id":"expose-expediteCatalog-loader"},N7=[v7(()=>e.createElementVNode("div",{class:"ect-flex ect-flex-col ect-items-center ect-gap-3"},[e.createElementVNode("div",{class:"ect-spinner","aria-label":"Loading"}),e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500"},"Loading catalog…")],-1))],wr=ve({__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(t,{emit:r}){const n=ft(),o=mn(),a=Co(),i=t,l=e.ref(!1),s=e.ref(!1),u=e.ref(null),h=r,d=[],m=()=>{l.value=window.innerWidth<=768};return e.onBeforeMount(async()=>{var y,f,b,p,x,g,C,_,E,A,k,B,D;n.updateConfig({templateId:i.templateId,organizationId:(y=i.identity)==null?void 0:y.organizationId,hostName:i.hostName,graphqlEndpoint:i.graphqlEndpoint,apiKey:((f=i.security)==null?void 0:f.apiKey)||i.apiKey,accountId:(b=i.identity)==null?void 0:b.accountId,cid:(p=i.identity)==null?void 0:p.contactId,composablesApiUrl:(x=i.security)==null?void 0:x.baseUrl,accessToken:(g=i.security)==null?void 0:g.accessToken,composablesOrgType:i.composablesOrgType,isPreview:i.isPreview,quoteId:(C=i.session)==null?void 0:C.quoteId,userId:(_=i.identity)==null?void 0:_.userId,siteUrl:(E=i.resources)==null?void 0:E.siteUrl}),n.quoteId=(A=i.session)==null?void 0:A.quoteId,console.log("props.sections expedite catalog",i.sections),await n.processSections(i.isPreview,i.sections);const c=(D=(B=(k=a.pageBlocks[0])==null?void 0:k.blocks[0])==null?void 0:B.configuration)==null?void 0:D.catalogId;c&&h("catalog:id",c)}),e.onMounted(async()=>{window.addEventListener("resize",m),m(),d.push(Lt("catalog:item-added",c=>{h("catalog-item-added",c)})),d.push(Lt("catalog:item-qty-updated",c=>{h("catalog-item-qty-updated",c)})),d.push(Lt("catalog:line-deleted",c=>{h("catalog-line-deleted",c)})),d.push(Lt("catalog:items-fetched",c=>{h("catalog-items-fetched",c)})),d.push(Lt("catalog:item-configure-clicked",c=>{h("catalog-item-configure",c)})),d.push(Lt("catalog:items-loaded",c=>{h("catalog-items-loaded",c)}))}),e.watch(()=>i.session&&i.session.quoteId,c=>{c&&(n.updateConfig({quoteId:c}),n.quoteId=c,o.getQuoteItems(!0))}),e.watch(()=>i.sections,async(c,y)=>{c!==y&&(await n.processSections(i.isPreview,c),u.value&&u.value.refreshTemplate&&u.value.refreshTemplate())},{deep:!0}),e.onBeforeUnmount(()=>{d.forEach(c=>{try{c()}catch{}})}),(c,y)=>{var f,b;return e.openBlock(),e.createElementBlock("div",A7,[e.createVNode(Nc,{"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?(e.openBlock(),e.createElementBlock("div",w7,N7)):(e.openBlock(),e.createBlock(jc,{key:1,ref_key:"templateRendererRef",ref:u,"quote-id":(b=i.session)==null?void 0:b.quoteId,"is-preview":t.isPreview,"on-catalog-count-update":t.onCatalogCountUpdate,"initial-catalog-items":t.initialData},null,8,["quote-id","is-preview","on-catalog-count-update","initial-catalog-items"]))])}}},[["__scopeId","data-v-04b2bdef"]]),Nr={__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(t,{emit:r}){const n=ft(),o=Nn(),a=e.ref(null),i=r,l=t;e.onBeforeMount(async()=>{var u,h,d,m,c,y,f,b,p;n.updateConfig({templateId:l.templateId,organizationId:(u=l.identity)==null?void 0:u.organizationId,accountId:(h=l.identity)==null?void 0:h.accountId,cid:(d=l.identity)==null?void 0:d.contactId,userId:(m=l.identity)==null?void 0:m.userId,accessToken:(c=l.security)==null?void 0:c.accessToken,composablesApiUrl:(y=l.security)==null?void 0:y.baseUrl,quoteId:(f=l.session)==null?void 0:f.quoteId,composablesOrgType:"Production",hostName:l.hostName,isPreview:l.isPreview,siteUrl:(b=l.resources)==null?void 0:b.siteUrl}),o.quoteId=(p=l.session)==null?void 0:p.quoteId,await n.processSections(l.isPreview,l.sections)});const s=[];return e.onMounted(()=>{s.push(Lt("expeditecart:configure-clicked",u=>{i("expeditecart-item-configure",u)})),s.push(Lt("expeditecart:clicked",u=>{i("expeditecart-clicked",u)}))}),e.onBeforeUnmount(()=>{s.forEach(u=>{try{u()}catch{}})}),e.watch(()=>l.sections,async(u,h)=>{u!==h&&(await n.processSections(l.isPreview,u),a.value&&a.value.refreshTemplate&&a.value.refreshTemplate())},{deep:!0}),(u,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Nc,{"organization-id":l.identity.organizationId,"template-id":l.templateId,"is-preview":l.isPreview,theme:l.theme},null,8,["organization-id","template-id","is-preview","theme"]),e.createVNode(jc,{ref_key:"templateRendererRef",ref:a,"is-preview":t.isPreview},null,8,["is-preview"])],64))}},S7={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"}},Ci=it.defineStore("expediteConfigurator",()=>{const t=e.ref(null),r=e.ref(null),n=e.ref(null),o=e.ref([]);function a(){var h,d;console.info("[expediteConfiguratorStore] getPayload",{hasComp:!!t.value,hasGetConfig:!!((h=t.value)!=null&&h.getConfig)});const u=(d=t.value)==null?void 0:d.getConfig;return{productConfiguration:u!=null?[u]:[]}}function i(u,h){var d,m,c;console.info("[expediteConfiguratorStore] setPreConfigData",{hasData:!!u,hasProductConfiguration:!!((d=u==null?void 0:u.productConfiguration)!=null&&d.length),itemId:h}),r.value=u,((m=u==null?void 0:u.productConfiguration)==null?void 0:m.length)>0&&(n.value=u.productConfiguration.find(y=>{var b;return((y==null?void 0:y.itemId)||((b=y==null?void 0:y.product)==null?void 0:b.itemId))===h}),o.value=u.productConfiguration,console.info("[expediteConfiguratorStore] apply queued?",{hasQueueItem:!!n.value,ready:!!t.value}),n.value&&((c=t.value)!=null&&c.setConfig)&&t.value.setConfig(n.value,o.value))}function l(){var u;console.info("[expediteConfiguratorStore] refresh invoked"),(u=t.value)!=null&&u.refresh&&t.value.refresh()}function s(u){var h;console.info("[expediteConfiguratorStore] setExpediteConfigComp",{received:!!u}),t.value=u,n.value&&((h=t.value)!=null&&h.setConfig)&&(console.info("[expediteConfiguratorStore] applying queued configuration on ready"),t.value.setConfig(n.value,o.value),n.value=null)}return{preConfgData:r,expediteConfigComp:t,getPayload:a,refresh:l,setPreConfigData:i,setExpediteConfigComp:s}}),Ei=["Quote_Document"],Jn=it.defineStore("composablePlaybook",()=>{const t=Mt(),r=ft(),n=mn(),o=Ci(),a=e.ref(null),i=e.ref("full"),l=e.ref(null),s=e.ref(null),u=e.ref(!1),h=e.ref(!1),d=e.ref(null),m=e.ref(null);e.ref(null);const c=e.ref("");function y(S){c.value=S}const f=()=>({Authorization:`Bearer ${c.value}`,"X-Salesforce-Org-Id":r.organizationId.value||"","X-Salesforce-Org-Type":r.composablesOrgType.value||"","X-Salesforce-User-Id":r.userId.value||"","Content-Type":"application/json"});async function b(S,I="ACTIVE"){if(!S)throw new Error("getPlaybookByKey: 'key' is required");try{const R=`${r.composablesApiUrl.value}/playbooks/getPlaybookByKey/${S}?versionType=${I}`,z=await fetch(R,{method:"GET",headers:f()});if(!z.ok)throw new Error(`Playbook fetch failed: ${z.status}`);const $=await z.json();return l.value=$.data??null,console.log("[playbook] currentPlaybook",l.value),$}catch(R){if(console.warn("[playbook] Falling back to bundled DXP playbook due to fetch error:",(R==null?void 0:R.message)||R),S==="PB_DXP_001")return l.value=S7,l.value;throw R}}function p(S){h.value=!!S}function x(S){var R,z;if(!((z=(R=l.value)==null?void 0:R.playBookSteps)!=null&&z.length))return;l.value.playBookSteps.some($=>$.stepName===S||$.name===S)&&(s.value=S)}const g=e.computed(()=>{var I;return(((I=l.value)==null?void 0:I.playBookSteps)||[]).find(R=>R.stepName===s.value)||null});function C({stepName:S,data:I=null}){var W,K,P,N,T,O,F;if(console.log("[playbook:navigateToStep] called",{stepName:S,dataProvided:!!I,data:I}),!((K=(W=l.value)==null?void 0:W.playBookSteps)!=null&&K.length)){console.info("[navigateToStep] No playbook steps available, aborting navigation.");return}if(!S){console.info("[navigateToStep] No stepName provided, aborting navigation.");return}const R=l.value.playBookSteps;console.info("[navigateToStep] Steps available:",JSON.stringify(R.map(q=>q.stepName||q.name)));const z=R.findIndex(q=>q.stepName===S||q.name===S);if(z<0){console.info(`[Warn] [navigateToStep] No step found for stepName "${S}".`);return}const $=R[z];if(console.log("[playbook:navigateToStep] target step resolved",{targetIndex:z,targetStepName:($==null?void 0:$.stepName)||($==null?void 0:$.name),stepComponent:$==null?void 0:$.stepComponent}),$!=null&&$.stepComponent&&Ei.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 q=getPreviousValidStep($.stepName);q&&(console.info(`[navigateToStep] Valid step to return to: "${q}".`),setDataToLocalStorage({stepName:q,pbUniqueId:(P=l.value)==null?void 0:P.pbUniqueId}))}let X=!1;for(let q=z;q>=0;q--){const M=R[q],U=M==null?void 0:M.stepComponent;if(console.info(`[navigateToStep] Checking step[${q}]:`,M),!U){console.info(`[navigateToStep] Step[${q}] has no component, skipping.`);continue}if(Array.isArray(Ei)&&Ei.includes(U)){console.info(`[navigateToStep] Step[${q}] component "${U}" is in NON_COMPONENTS, skipping.`);continue}s.value=M.stepName??S,console.info(`[navigateToStep] Navigating to step[${q}] "${s.value}" with component "${U}".`);let L=I;const j=String(U||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),H=!!((T=(N=L==null?void 0:L.payload)==null?void 0:N.savedProducts)!=null&&T.length)||((F=(O=L==null?void 0:L.payload)==null?void 0:O.productConfiguration)==null?void 0:F.length)>0;if(j==="configurator"&&!H)try{const Z=typeof n.getTopConfigurableItem=="function"?n.getTopConfigurableItem():null;if(Z){const te=Z.XX_ORD1__Item__c||Z.xx_ord1__item__c||Z.itemId||"",ne=Z.Id||Z.id||"";te&&(L={payload:{savedProducts:[ne?{itemId:te,qliId:ne}:{itemId:te}]}})}}catch(Z){console.info("[navigateToStep] Unable to auto-select configurable item:",(Z==null?void 0:Z.message)||Z)}console.log("[playbook:navigateToStep] final navigation payload",{currentStepName:s.value,stepComponent:U,hasPayload:!!L,payload:L}),w({XX_ORD1__Completed_PB_Step_Number_EX__c:String(q),XX_ORD1__Playbook_Current_Step_Meta_EX__c:JSON.stringify(L)}),E(U,L),X=!0;break}X||console.info(`[Warn] [navigateToStep] Could not find a valid component step to navigate to starting from stepName "${S}".`),console.log("[playbook:navigateToStep] completed",{navigated:X,toStep:s.value})}function _(S){var X,W,K;const I=((X=l.value)==null?void 0:X.playBookSteps)||[];if(!I.length)return;const R=I.findIndex(P=>P.stepName===s.value);if(R<0)return;if(!(Array.isArray((W=I[R])==null?void 0:W.beans)&&I[R].beans.some(P=>(P==null?void 0:P.beanName)===S))){console.info(`[navigateToBean] Bean "${S}" not found in current step "${(K=I[R])==null?void 0:K.stepName}".`);return}const $=I[R+1];$!=null&&$.stepName&&C({stepName:$.stepName})}function E(S,I=null){var X,W,K,P,N,T,O,F,q,M,U,L,j,H,Z,te,ne;console.log("[playbook:loadComponent] called",{stepComponent:S,dataProvided:!!I,data:I});const R=A(S);console.log("[playbook:loadComponent] resolved route path",{path:R});function z(Q){try{return(typeof window<"u"&&window.location.hash||"").replace(/^#/,"")===Q}catch{return!1}}const $=String(S||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");if(h.value){console.log("[playbook:loadComponent] embeddedMode active, skipping route",{normalized:$,payloadProvided:!!I}),d.value=$,console.log("[playbook] activeComponentKey",d.value),console.log("[playbook] activeComponentData",I),m.value=I||null;return}if(R)try{if(((I==null?void 0:I.actionFunction)==="Reload"||R==="/quote-item")&&(console.info("[playbook] Reloading quote line items..."),console.log("Reloading configurator 4"),quoteStore.fetchAllQuoteLineItems().then(()=>{console.info("[playbook] Quote line items reloaded...")})),R==="/configurator")if(console.log("[playbook:loadComponent] navigating to configurator",{hasProductConfiguration:((W=(X=I==null?void 0:I.payload)==null?void 0:X.productConfiguration)==null?void 0:W.length)>0,hasSavedProducts:((P=(K=I==null?void 0:I.payload)==null?void 0:K.savedProducts)==null?void 0:P.length)>0,isReload:(I==null?void 0:I.actionFunction)==="Reload"}),((T=(N=I==null?void 0:I.payload)==null?void 0:N.productConfiguration)==null?void 0:T.length)>0){const Q=(O=I==null?void 0:I.payload)==null?void 0:O.productConfiguration[0],ce=(Q==null?void 0:Q.itemId)||((F=Q==null?void 0:Q.product)==null?void 0:F.itemId)||"";o.setPreConfigData(I==null?void 0:I.payload,ce);const ue=`/configurator/${ce}`;z(ue)||router.push(ue);return}else if(((M=(q=I==null?void 0:I.payload)==null?void 0:q.savedProducts)==null?void 0:M.length)>0){const Q=(U=I==null?void 0:I.payload)==null?void 0:U.savedProducts[0].itemId,ce=(L=I==null?void 0:I.payload)==null?void 0:L.savedProducts[0].qliId,ue=`/configurator/${Q}/${ce}`;z(ue)||router.push(ue);return}else if((I==null?void 0:I.actionFunction)==="Reload"){console.log("Reloading configurator 5"),o.refresh();return}else{const ue=[...((j=quoteStore.allQLIData)==null?void 0:j.lineItems)??[]].sort((pe,ie)=>{const de=_e=>_e.xx_ord1__sys_configuration_status2__c==="Needs Configuration"?1:_e.xx_ord1__sys_configuration_status2__c==="Suggests Configuration"?2:3;return de(pe)-de(ie)}).filter(pe=>pe.xx_ord1__sys_configuration_status2__c!=="No Configuration");if(ue.length){const pe=ue[0],ie=`/configurator/${pe.xx_ord1__item__c}${pe.id?`/${pe.id}`:""}`;z(ie)||router.push(ie)}else t.handleWarning("No items needing configuration");return}else R==="/adaptive-search"&&((H=I==null?void 0:I.payload)!=null&&H.adaptiveSearch)?(console.log("[playbook:loadComponent] navigating to adaptive-search",{hasPayload:!!((Z=I==null?void 0:I.payload)!=null&&Z.adaptiveSearch)}),adaptiveSearch.createLstItems(I==null?void 0:I.payload.adaptiveSearch)):R==="/quote-item"&&I?(console.log("[playbook:loadComponent] navigating to quote-item with data"),quoteStore.performAIAction(I)):R==="/match-records"&&((te=I==null?void 0:I.payload)!=null&&te.quickSelection)&&(console.log("[playbook:loadComponent] navigating to match-records",{hasQuickSelection:!!((ne=I==null?void 0:I.payload)!=null&&ne.quickSelection)}),quickSelectionStore.quickSelectionLayout=I.payload);z(R)||router.push(R),console.log("[playbook:loadComponent] route push called",{path:R})}catch(Q){t.handleError(Q,"playbookStore.loadComponent")}}function A(S){var z;const I=String(S||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),R={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(I==="quote_document"){const $=getPreviousValidStep(s.value);return $&&setDataToLocalStorage({stepName:$,pbUniqueId:(z=l.value)==null?void 0:z.pbUniqueId}),goToQuoteDocument(),null}return R[I]||"/quote-item"}function k(){var S;return((S=g.value)==null?void 0:S.beans)??[]}function B(){return k().map(I=>({action:`playbookNavigate:${I.beanName}`,label:I.beanName,disabled:!!I.disable}))}async function D(){var S;try{const I=((S=r.quoteId)==null?void 0:S.value)||"";if(!I)return console.info("getPlaybookInfoFromQuote: Missing Quote Id"),null;const R=`${r.composablesApiUrl.value}/platform/getHeaderRecord`,z={recordId:I,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(R,{method:"POST",headers:f(),body:JSON.stringify(z)})).json()).data}catch(I){return t.handleError(I,"playbookStore.getPlaybookInfoFromQuote"),null}}async function w(S={}){var I;try{const R=((I=r.quoteId)==null?void 0:I.value)||Jr("id")||"";if(!R)return console.info("addPlaybookInfoToQuote: Missing Quote Id"),null;const z={Id:R,...S},$=Object.entries(z).map(([N,T])=>({fieldName:N,fieldValue:T})),X=`${r.composablesApiUrl.value}/platform/upsertRecords`,W={objectType:"XX_ORD1__Quote__c",uniqueField:"Id",records:[{fields:$}]},P=await(await fetch(X,{method:"POST",headers:f(),body:JSON.stringify(W)})).json();return console.info("[playbook] addPlaybookInfoToQuote response:",JSON.stringify(P)),P}catch(R){return t.handleError(R,"playbookStore.addPlaybookInfoToQuote"),null}}async function v(){var S;try{const I=`${r.composablesApiUrl.value}/product-pricing/findCatalogInContext?accountId=${r.accountId.value}&catalogType=Primary&catalogLookupFieldName=Primary_Catalog__c`,z=await(await fetch(I,{method:"GET",headers:f()})).json();return(S=z==null?void 0:z.data)==null?void 0:S.catalogId}catch(I){return t.handleError(I,"playbookStore.getCatalogInContext"),null}}return{playbookData:a,currentPlaybook:l,currentStepName:s,currentStep:g,playbookStepsMode:i,showPlaybookSteps:u,embeddedMode:h,activeComponentKey:d,activeComponentData:m,setSecretKey:y,getPlaybookByKey:b,setCurrentStepName:x,navigateToStep:C,navigateToBean:_,loadComponent:E,setEmbeddedMode:p,getCurrentStepLinks:B,addPlaybookInfoToQuote:w,getPlaybookInfoFromQuote:D,getCatalogInContext:v}}),ki={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"},Hc={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"},B7=t=>{var n;let r=[];for(let o of t)if(o.trim()!=="xx_ord1__item__r.xx_ord1__decimal_precision__c")if(o.includes(".")){let i=o.split(".")[0];i=i.slice(0,-1)+"c";const l=((n=ki[i==null?void 0:i.toLowerCase()])==null?void 0:n.trim())||"";l&&(r.includes(l)||r.push(l||""),r.push(o))}else r.includes(ki[o==null?void 0:o.toLowerCase()])||r.push(ki[o==null?void 0:o.toLowerCase()]||"");return r.filter(o=>o!=="")},Gc=it.defineStore("actions",()=>{const t=Un(),r=$n(),n=e.ref(!1);return{openAdaptiveSearch:(s,u=!1)=>{console.info("openAdaptiveSearch",s),t.chatHistory[t.chatHistory.length-1].links=[],t.sendMessage("Open Adaptive Search",!1,{internalCall:!0}),n.value=u},openQuoteItem:s=>{console.info("openQuoteItem",s),t.chatHistory[t.chatHistory.length-1].links=[],t.sendMessage("Open Quote Item",!1,{internalCall:!0})},openQuoteDocument:s=>{console.info("openQuoteDocument",s),t.chatHistory[t.chatHistory.length-1].links=[],t.chatHistory.push({type:"response",message:"Opening quote document",loading:!0});const h=`/apex/XX_ORD1__Expedite_Commerce?scpq=true&oid=${r.quoteId}&atpverified=true&ecCache=false&origin=AI`;window.location.href=`${$0(window.location.href)}${h}`},undo:()=>{const s=t==null?void 0:t.latestDMLRequest;t.sendMessage(`UNDO-${s}`,!1,{internalCall:!0})},isStaticActionCall:n}}),Kc=it.defineStore("adaptiveSearch",()=>{const t=$n(),r=wo(),n=Un(),o=Gc(),a=e.ref(null),i=e.ref(null),l=e.ref(!1),s=e.ref(!1),u=e.ref([]),h=e.ref(""),d=e.ref(!1),m=e.ref(null),c=e.ref(!1),y=e.ref([]),f=Mt(),b=e.ref([]),p=e.ref(0),x=e.ref(!1),g=e.ref({rowLimt:10,paging:!0,offset:0,currentPage:1,totalPages:1});async function C(){l.value=!0;try{const N=JSON.stringify({layoutType:"Search Selection",layoutObject:"xx_ord1__ecatalog_item__c"});let T={};return T=await window.salesforceConnector.getDynamicPageLayout(N),i.value=Cl(T,"Unable to find the Search Selection Layout for your user profile"),g.value.rowLimt=i.value.configuration.rowLimit||10,i.value.configuration.columns.forEach(O=>{!O.field&&O.label==="QTY"&&(O.field="xx_ord1__qty__c")}),l.value=!1,_(),T}catch(N){l.value=!1,f.handleError("Failed to get Adaptive Search Layout. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",N)}}function _(){var N,T,O;m.value=(O=(T=(N=i.value)==null?void 0:N.configuration)==null?void 0:T.dynamicFilters)==null?void 0:O.filters.map(F=>({...F,field:F.field.toLowerCase(),filtervalue:F.filtervalue||[],filtervaluefrom:F.filtervaluefrom||"",filtervalueTo:F.filtervalueTo||""}))}function E(){var T;let N=[];for(const O of i.value.configuration.columns){let F=O.field;if(N.includes(F)||N.push(F),F!=null&&F.includes(".")){let M=F.split(".")[0];M=M.slice(0,-1)+"c",N.includes(M)||N.push(M)}}return(T=i.value.configuration)!=null&&T.cardHeader&&N.push(i.value.configuration.cardHeader.imageField),i.value.configuration.objectName.toLowerCase()==="xx_ord1__ecatalog_item__c"&&N.push("xx_ord1__item__r.xx_ord1__decimal_precision__c"),N=N.filter(O=>!!O),N.filter(O=>O.toLowerCase()!=="xx_ord1__qty__c"&&O.toLowerCase()!=="xx_ord1__competitor_sku__c")}function A(N,T=!1){if(!N||N.includes("undefined"))return!1;const O=/[!@#$%^&*()+=[\]{};':"\\|.<>/?]+/;if(T){const F=Array.isArray(N)?N:N.split(",");for(const q of F){const M=q.trim();if(O.test(M))return f.handleError(`Invalid character found in value: ${M}`),!1}}else if(O.test(N))return f.handleError("Special characters are not allowed in filter values"),!1;return!0}function k(N,T){return{field:N.field,operator:N.operator||"contains",value:T,dataType:N.dataType.trim()}}function B(N){if(!N.filtervalue)return null;const T=Array.isArray(N.filtervalue),O=T?N.filtervalue.join(","):N.filtervalue.trim();return A(O,T)?O:null}function D(N){var q,M;const T=(q=N.filtervaluefrom)==null?void 0:q.trim(),O=(M=N.filtervalueTo)==null?void 0:M.trim();if(!T||!O)return null;const F=`${T}, ${O}`;return F!==", "&&A(F)?F:null}function w(N){const T=`${_l(N.filtervaluefrom)}, ${_l(N.filtervalueTo)}`;return T!==", "&&A(T)?T:null}function v(N){var O;const T=(O=N.filtervaluefrom)==null?void 0:O.trim();return A(T)?T:null}function S(N){const T=[];return N.forEach(O=>{const F=O.dataType.trim();let q=null;switch(F){case"PICKLIST":case"MULTIPICKLIST":q=B(O);break;case"DOUBLE":case"CURRENCY":q=D(O);break;case"DATETIME":case"DATE":q=w(O);break;default:q=v(O)}q&&T.push(k(O,q))}),y.value=T,T}async function I(N="",T=[],O=[]){var q,M,U,L,j,H,Z,te,ne,Q;let F=[];if(T.length&&(F=S(T)),!F.length&&N.trim()===""){u.value=[],d.value=!1;return}try{d.value=!1,s.value=!0;const ce=N.trim();O.length||(O=E());const ue={fields:O,...T.length?{dynamicFilters:F}:{},searchText:ce||h.value.trim(),accountId:r.accountId,...r.eCatalogId?{catalogId:r.eCatalogId}:{},...r.objectType==="opportunity"?{opportunityId:r.id}:{},...(M=(q=i.value)==null?void 0:q.configuration)!=null&&M.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:(L=(U=i.value)==null?void 0:U.configuration)==null?void 0:L.rowLimit,paging:(H=(j=i.value)==null?void 0:j.configuration)==null?void 0:H.paging,...((Z=g.value)==null?void 0:Z.offset)!==0?{offset:g.value.offset}:{},objectName:(ne=(te=i.value)==null?void 0:te.configuration)==null?void 0:ne.objectName,currencyCode:r.currencyCode},pe=await window.salesforceConnector.getItems(JSON.stringify(ue));if(pe!=null&&pe.errorMessage){f.handleError(pe.errorMessage);return}pe!=null&&pe.itemCount&&(g.value.totalPages=Math.ceil((pe==null?void 0:pe.itemCount)/g.value.rowLimt)),u.value=Xo(pe.lstItems,{xx_ord1__qty__c:"1"}),(Q=pe.lstItems)!=null&&Q.length||(d.value=!0),s.value=!1}catch(ce){f.handleError("Failed to fetch Results. Please try again."),s.value=!1,console.info("[ERROR]: Adaptive Search getItems() error = ",ce)}}async function R(N){try{c.value=!0;const T=JSON.stringify({lstQLIRequest:z(N),quoteId:t.quoteId});let O=await window.salesforceConnector.createQLI(T);typeof O=="string"&&(O=JSON.parse(O));let F=!1;if((O==null?void 0:O.length)>0&&O.forEach(q=>{q.errorMessage&&(F=!0,f.handleError(q.errorMessage))}),c.value=!1,F){b.value=O;const q=b.value.reduce((M,U)=>(M[U.eCatalogItemId]=U.errorMessage,M),{});u.value=u.value.map(M=>({...M,backendError:q[M.Id]||""}));return}return O}catch(T){f.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addToQuote() error = ",T)}}function z(N){const T=[];for(const O of N)if(!O.addedToQuote&&O.id){const F=$(O);p.value++,T.push({fields:F,recordId:O.id,...N.length===1?{maxSequenceNumber:p.value}:{}})}return T}function $(N){const T=[],O=X();return Object.keys(N).forEach(F=>{if(O.includes(F)){const q=Hc[F.toLowerCase()];q&&T.push({fieldname:q,value:N[F]})}}),T}function X(){const N=[];return i.value.configuration.columns.forEach(T=>{T.field&&!T.field.includes(".")&&T.isEditable&&T.visible&&N.push(T.field)}),N}function W(){var T,O;const N=[];return i.value.configuration.columns.forEach(F=>{const q=F.field.toLowerCase();N.includes(q)||N.push(q)}),(T=i.value.configuration)!=null&&T.dynamicFilters&&i.value.configuration.dynamicFilters.filters.forEach(F=>{const q=F.field.toLowerCase();N.includes(q)||N.push(q)}),(O=i.value.configuration)!=null&&O.cardHeader&&N.push(i.value.configuration.cardHeader.imageField),N}async function K(){var O;const N=W(),T=((O=i.value.configuration)==null?void 0:O.saveObjectName)||i.value.configuration.objectName;if(T==="xx_ord1__ecatalog_item__c"){const F=N.indexOf("xx_ord1__qty__c");F>-1&&N.splice(F,1)}await t.getFieldsData(N,T),t.fieldsData.xx_ord1__qty__c||t.getFieldsData(["xx_ord1__qty__c"],"xx_ord1__quote_line_item__c")}async function P({searchTerm:N="",filters:T=[]}={}){if(x.value=!0,N&&(h.value=N),T.length&&(y.value=T),await C()){await K(),x.value=!1;const F=h.value;F&&(h.value=F,await I(F,t.dynamicFilters)),console.info("actionStore.isStaticActionCall = ",o.isStaticActionCall),o.isStaticActionCall&&(o.isStaticActionCall=!1,n.chatHistory[n.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"}]})}x.value=!1}return{selectedItem:a,AdaptiveSearchLayout:i,searchText:h,loadingAdaptiveLayout:l,getAdaptiveSearchLayout:C,getItems:I,lstItems:u,rowItemsLoading:s,noSearchRecords:d,dynamicFilters:m,setDynamicFilters:_,createQliErrors:b,addToQuote:R,addingToQuote:c,getFieldsData:K,pagingData:g,appliedDynamicFilters:y,maxSequenceNumber:p,loadingAdaptiveSearch:x,initAdaptiveSearch:P}}),I7="XX_ORD1__Quote__c",T7="xxord1salespricec",Sr="xx_ord1__item__c",O7="xxord1productnrcc",D7=it.defineStore("cartStore",()=>{const t=$n(),r=Kc(),n=Mt(),o=e.ref(""),a=e.ref("$0"),i=e.ref("$0"),l=e.ref(null),s=e.ref({}),u=e.ref({}),h=e.ref({}),d=e.ref(""),m=e.ref(""),c=e.ref({}),y=e.ref(""),f=e.ref(""),b=e.ref({});async function p(){A()}async function x(){try{let D=await window.salesforceConnector.getProductCount(t.quoteId);if(D=Tt(D),D!=null&&D.errorMessage){n.handleError(D.errorMessage);return}return o.value=D,D}catch{n.handleError("Failed to get Product Count. Please try again.")}}async function g(){try{let D=await window.salesforceConnector.getQuoteTotal(t.quoteId);if(D=Tt(D),D!=null&&D.errorMessage){n.handleError(D.errorMessage);return}return i.value=D.monthlyTotal,a.value=D.onetimeTotal,D}catch{n.handleError("Failed to get Total Amount. Please try again.")}}async function C(D,w,v,S=""){if(!t.sectionDataMap.get(v).parentQLIs[w].removingItem){t.sectionDataMap.get(v).parentQLIs[w].removingItem=!0,f.value=D.id,await _(D.id)==="Success"&&(t.fetchAllQuoteLineItems(),S&&S(D,w,v));let R=t.sectionDataMap.get(v).parentQLIs.filter(z=>z[Sr]===D[Sr]).length;f.value="",r.lstItems.forEach(z=>{z[Sr]===D[Sr]&&(z.addedToQuote===!0&&(z.addedToQuote=!1),R===0&&(z.removedFromQuote=!0))})}}async function _(D){try{let w=await window.salesforceConnector.deleteQLI(D);if(w!=null&&w.errorMessage){n.handleError(w.errorMessage);return}return x(),g(),w}catch{n.handleError("Failed to remove Quote Item. Please try again.")}}function E(D){var S,I;const w=(S=D==null?void 0:D[O7])==null?void 0:S.match(/\.\d+/);w&&(w.value=w[0].length-1);const v=(I=D==null?void 0:D[T7])==null?void 0:I.match(/\.\d+/);return v&&(v.value=v[0].length-1),w||v}function A(D=!0){x(),g(),D&&t.fetchTemplates(I7).then(()=>{t.getFilteredListWithFields()})}function k(D){const w=t.sectionDataMap;for(const[,v]of w.entries())v.parentQLIs.forEach(S=>{S.id===D.id&&(v.columns.forEach(I=>{if(I.dataType==="CURRENCY"){const R=I.field.replace(/_/g,"");S[R]=B(S[R],D[I.field])}}),D!=null&&D.billingPeriodValue&&(D!=null&&D.formattedBillingPeriodValue)&&(S.formattedBillingPeriodValue=B(S.formattedBillingPeriodValue,D.billingPeriodValue)),D!=null&&D.oneTimeValue&&(D!=null&&D.formattedOneTimeValue)&&(S.formattedOneTimeValue=B(S.formattedOneTimeValue,D.oneTimeValue)))})}function B(D,w){const v=Number(w);if(isNaN(v))return D;const S=D.match(/(\d[\d,]*)(\.\d+)?/);if(!S)return D;const I=S[2]||"",R=I.length?I.length-1:0,z=v.toLocaleString("en-US",{minimumFractionDigits:R,maximumFractionDigits:R});return D.replace(S[1]+I,z)}return{initializeCart:p,loadCartState:A,productCount:o,onetimeTotal:a,monthlyTotal:i,filterCartItem:l,billingPeriodValue:d,hasOneTimeValue:m,hasBillingPeriodInList:s,oneTimeFieldAvailable:u,billingPeriodFieldAvailable:h,priceDecimalPrecision:c,cartItemUpdatingId:y,removingItemLoaderId:f,cartItemColumnsMap:b,getProductCount:x,getQuoteTotal:g,removeItem:C,removeQuoteItem:_,getDecimalPrecisionFromSalesPriceOrNRC:E,updateFormattedValues:k,formateCurrencyValue:B}}),V7=t=>[{title:"Apply Discount",subOptions:[...t.map(r=>`Apply Discount on ${r} for `),"Show Maximum discount allowed","Apply Maximum Discount Allowed",...t.map(r=>`Apply Discount on ${r} 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"]}],F7={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"}]},M7=[{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"]}],$n=it.defineStore("quote",()=>{const t=Mt(),r=D7(),n=wo(),o=e.ref(""),a=e.ref(""),i=e.ref(0),l=e.ref(""),s=e.ref([]),u=e.ref({template:!0,filteredList:!1}),h=e.ref(null),d=e.ref(new Map),m=e.ref({}),c=e.ref(!1),y=e.ref(!0),f=e.ref(!1),b=e.ref({text:"Hide Options",altText:"Show Options",handler:()=>{y.value=!y.value,B()},color:"#136E05",isActive:!1}),p=e.computed(()=>{const P=Array.from(d.value.values()).map(N=>N.sectionName);return V7(P)});e.watch(l,()=>{u.value.template||k()});function x(){const P=new Map,N=[];for(const[O,F]of d.value.entries())P.set(O,F.selected),N.push(F);const T=JSON.parse(JSON.stringify(N));return T.forEach(O=>{delete O.selected;const F=new Map,q=[];O.lineItems.forEach(M=>{M.Selected=P.get(O.tableId).get(M.id)||!1,M.xx_ord1__parent_qli__c?(F.has(M.xx_ord1__parent_qli__c)||F.set(M.xx_ord1__parent_qli__c,[]),F.get(M.xx_ord1__parent_qli__c).push(M)):q.push(M)}),O.lineItems=q.map(M=>({...M,options:F.get(M.id)||[]})),delete O.loading,delete O.parentQLIs,delete O.totalValues}),{showOptions:y.value,sections:T,templateId:l.value}}async function g(P){try{let N=await window.salesforceConnector.getPrimaryQuote(P);N=Tt(N),N!==void 0&&(console.info("getPrimaryQuote",JSON.stringify(N)),o.value=N.recordId,console.info("quoteId",o.value),a.value=N.name,l.value=N==null?void 0:N.templateId,i.value=(N==null?void 0:N.lineItemsCount)||0)}catch(N){t.handleError(N.message),console.info("[ERROR]: getPrimaryQuote() error = ",N)}}async function C(P){var N,T;try{u.value.template=!0;let O=await window.salesforceConnector.fetchContentTemplates(JSON.stringify({lstObjectName:[P],templateType:"Document",templateId:null,fetchOnlyDefault:!1}));O=Tt(O);const F=O==null?void 0:O.templates[P];return l.value||(l.value=(N=F.find(q=>q.XX_ORD1__Default__c))==null?void 0:N.Id),l.value||(l.value=(T=F[0])==null?void 0:T.Id),s.value=F,u.value.template=!1,s.value}catch(O){t.handleError(O.message),console.info("[ERROR]: fetchTemplates() error = ",O)}}function _(P){if(!P)return null;const N=/\{!\$(\w+):([\w.]+)\}/,T=P.match(N);return T?{function:T[1],apiname:T[2].split(".")[1]}:null}async function E(P){try{const N={Id:o.value,XX_ORD1__Document_Template__c:P};return await window.salesforceConnector.updateQuote(JSON.stringify([N]))}catch(N){t.handleError(N.message),console.info("[ERROR]: updateQuote() error = ",N)}}async function A(){try{u.value.filteredList=!0;let P=await window.salesforceConnector.getQuoteEPageLayout();d.value.clear(),r.cartItemColumnsMap={},P=Tt(P);const N=P.map(O=>({label:O.fieldLabel,field:O.fieldName.toLowerCase(),isEditable:O.isEditable,dataType:O.dataType,...O.picklistValues?{picklistValues:O.picklistValues}:{}})),T=vn();return d.value.set(T,{loading:!0,lineItems:[],parentQLIs:[],columns:N,tableId:T,sectionName:"All Rows",selected:new Map,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}),r.cartItemColumnsMap[T]=N,b.value.isActive=!1,y.value=!0,h.value={lstCB:[{columns:N,footer:null,title:"All Rows",sectionName:"All Rows",tableId:T,filters:[],primarysort:"XX_ORD1__Sequence__c",primarysortdesc:""}]},B(),u.value.filteredList=!1,P}catch(P){t.handleError(P.message),console.info("[ERROR]: getQuoteEPageLayout() error = ",P)}}async function k(){if(s.value.length===0){A();return}try{u.value.filteredList=!0;let P=await window.salesforceConnector.getFilteredListWithFields(JSON.stringify({templateId:l.value}));E(l.value),P=Tt(P),console.info("res.lstCB = ",P.lstCB);const N=P==null?void 0:P.objectFieldsMap;return d.value.clear(),r.cartItemColumnsMap={},P.lstCB=P.lstCB.map(T=>{const{fields:O,filters:F,primarysort:q,primarysortdesc:M}=JSON.parse(T.XX_ORD1__Block_Properties__c),U=O.map(j=>{var H;return{label:(H=N[j.api])==null?void 0:H.label,field:j.api.toLowerCase(),isEditable:j.api.includes(".")?!1:N[j.api].isEditable,dataType:N[j.api].dataType,...N[j.api].picklistValues?{picklistValues:N[j.api].picklistValues}:{}}}),L=T.Id||vn();return d.value.set(L,{loading:!0,lineItems:[],parentQLIs:[],columns:U,tableId:L,sectionName:T.Name,selected:new Map,footer:_(T.XX_ORD1__Table_Footer_HTML__c),filters:F,primarysort:q,primarysortdesc:M}),r.cartItemColumnsMap[L]=U,b.value.isActive=!1,y.value=!0,{columns:U,footer:_(T.XX_ORD1__Table_Footer_HTML__c),title:T.Name,sectionName:T.Name,tableId:L,filters:F,primarysort:q,primarysortdesc:M}}),h.value=P,B(),u.value.filteredList=!1,P}catch(P){t.handleError(P.message),console.info("[ERROR]: getFilteredListWithFields() error = ",P)}}async function B(P=!0){const N=[];for(const[T]of d.value)N.push(v(T,P));return await Promise.all(N),r.getProductCount(),!0}function D(P,N){return d.value.get(P).columns.some(T=>T.field.toLowerCase()===N)||r.cartItemColumnsMap[P].some(T=>T.field.toLowerCase()===N)}function w(P,N){let T=Xo(P);const O=n.pricingSchema,F=D(N,"xx_ord1__nrc__c"),q=D(N,"xx_ord1__sales_price__c"),M=D(N,"xx_ord1__qty__c");return T=T.map(U=>{let L={};O==="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?L={...q?{billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}:{},...F?{oneTimeValue:(U==null?void 0:U.xx_ord1__nrc__c)===0?"0":(U==null?void 0:U.xx_ord1__nrc__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1nrcc}:{}}:O==="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)?q&&(L={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec}):O!=="nrc/mrc"&&(U!=null&&U.xx_ord1__billing_period__c)?q&&(L={billingPeriodValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?"0":(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedBillingPeriodValue:U==null?void 0:U.xxord1salespricec}):O!=="nrc/mrc"&&!(U!=null&&U.xx_ord1__billing_period__c)&&q&&(L={oneTimeValue:(U==null?void 0:U.xx_ord1__sales_price__c)===0?0:(U==null?void 0:U.xx_ord1__sales_price__c)||null,formattedOneTimeValue:U==null?void 0:U.xxord1salespricec});const{xx_ord1__qty__c:j,xx_ord1__sales_price__c:H,xx_ord1__nrc__c:Z,...te}=U,ne={...te,id:U.id,description:(U==null?void 0:U.xx_ord1__line_description__c)||"",xx_ord1__billing_period__c:U==null?void 0:U.xx_ord1__billing_period__c,...M?{xx_ord1__qty__c:j}:{},xx_ord1__item__c:U==null?void 0:U.xx_ord1__item__c,"xx_ord1__item__r.xx_ord1__decimal_precision__c":U["xx_ord1__item__r.xx_ord1__decimal_precision__c"]||"0",...L};return ne!=null&&ne.billingPeriodValue&&(r.hasBillingPeriodInList[N]=!0,r.billingPeriodValue=ne==null?void 0:ne.xx_ord1__billing_period__c),"oneTimeValue"in ne&&(r.oneTimeFieldAvailable[N]=!0),"billingPeriodValue"in ne&&(r.billingPeriodFieldAvailable[N]=!0),(ne==null?void 0:ne.oneTimeValue)!==""&&(ne==null?void 0:ne.oneTimeValue)!==null&&(r.hasOneTimeValue=!0),ne}),T}async function v(P,N=!0){var T,O;try{const F=d.value.get(P);if(console.info("sectionData = ",F.sectionName),!F)return;F.loading=N,N&&(F.lineItems=[]);const{columns:q,filters:M,primarysort:U,primarysortdesc:L,footer:j}=F,H=q.map(pe=>pe.field.toLowerCase());H.includes("xx_ord1__parent_qli__c")||H.push("xx_ord1__parent_qli__c"),H.includes("xx_ord1__item__c")||H.push("xx_ord1__item__c"),H.includes("xx_ord1__sys_configuration_status2__c")||H.push("xx_ord1__sys_configuration_status2__c"),(T=r.cartItemColumnsMap[P])==null||T.forEach(pe=>{H.includes(pe.field)||H.push(pe.field)});const Z=await S({fields:H,recordId:o.value,filters:M||[],primarySortBy:U||"",primarySortOrder:L?"DESC":"ASC",includeOptions:y.value,totalFields:j?[j.apiname]:[]}),te=Z.lineItems,ne=new Map;let Q=[];const ce=(O=Z.fieldTotals)==null?void 0:O.map(pe=>pe.totalValue);te.forEach(pe=>{pe.XX_ORD1__Parent_QLI__c?ne.has(pe.XX_ORD1__Parent_QLI__c)?ne.get(pe.XX_ORD1__Parent_QLI__c).push(pe):ne.set(pe.XX_ORD1__Parent_QLI__c,[pe]):Q.push(pe)});const ue=[];return Q.forEach(pe=>{ue.push(pe),ne.has(pe.Id)&&ue.push(...ne.get(pe.Id))}),Q=w(Q,P),F.lineItems=Xo(ue),F.parentQLIs=Q,F.totalValues=ce,F.loading=!1,d.value=new Map(d.value),ue}catch(F){console.info("[ERROR]: fetchQuoteLineItems()123 error = ",F.message);const q=d.value.get(P);q&&(q.loading=!1)}}async function S(P){try{let N=await window.salesforceConnector.getQuoteLineItemsWithFilteredTable(JSON.stringify(P));return N=Tt(N),N}catch(N){t.handleError(N.message),console.info("[ERROR]: getQuoteLineItemsWithFilteredTable() error = ",N)}}async function I(P){try{console.info("updateQli() payload = ",P);let N=await window.salesforceConnector.updateQli(JSON.stringify(P));return N=Tt(N),B(!1),N}catch(N){t.handleError(N.message),console.info("[ERROR]: updateQli() error = ",N)}}async function R(P){try{let N=await window.salesforceConnector.deleteQLI(P);return N=Tt(N),B(),N}catch(N){t.handleError(N.message),console.info("[ERROR]: deleteQLI() error = ",N)}}async function z(P,N){try{c.value=!0;const T={fields:P};N&&(T.objectName=N),P.includes("xx_ord1__qty__c")&&N==="xx_ord1__ecatalog_item__c"&&(T.fields=T.fields.filter(F=>F!=="xx_ord1__qty__c")),P.includes("xx_ord1__sales_price__c")&&N!=="xx_ord1__quote_line_item__c"&&(T.fields=T.fields.filter(F=>F!=="xx_ord1__sales_price__c"));let O=await window.salesforceConnector.getFieldsData(JSON.stringify(T));return typeof O=="string"&&(O=JSON.parse(O)),O!=null&&O.errorMessage?(t.handleError(O.errorMessage),null):(m.value={...m.value,...O},console.info("fieldsData.value = ",JSON.stringify(m.value)),O)}catch(T){return t.handleError("Failed to get Fields Data. Please try again."),console.info("[ERROR]: getFieldsData() error = ",T),null}finally{c.value=!1}}function $(P=""){var N;return!P||P.includes(".")?!1:P.includes("xx_ord1__qty__c")?!0:((N=m.value[P])==null?void 0:N.isEditable)||!1}function X(){W(F7)}async function W(P){var N,T,O,F,q,M,U,L,j;if(P.payload){if((N=P.payload)!=null&&N.uiModification){const H=P.payload.uiModification;if(((T=H.addColumn)==null?void 0:T.length)>0)if(H.addColumn.forEach(Z=>{Z.columns.forEach(te=>{te.field=te.field.toLowerCase()})}),H.addColumn[0].sectionName==="all_section")for(const[Z,te]of d.value)te.columns=[...te.columns,...H.addColumn[0].columns];else H.addColumn.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).columns=[...d.value.get(Z.tableId).columns,...Z.columns])});if(((O=H.removeColumn)==null?void 0:O.length)>0)if(H.removeColumn.forEach(Z=>{Z.columns=Z.columns.map(te=>te.toLowerCase())}),H.removeColumn[0].sectionName==="all_section")for(const[Z,te]of d.value)te.columns=te.columns.filter(ne=>!H.removeColumn[0].columns.includes(ne.field));else H.removeColumn.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).columns=d.value.get(Z.tableId).columns.filter(te=>!Z.columns.includes(te.field)))});if(((F=H.filter)==null?void 0:F.length)>0)if(H.filter[0].sectionName==="all_section")for(const[Z,te]of d.value)te.filters=[...te.filters,...H.filter[0].filters];else H.filter.forEach(Z=>{d.value.get(Z.tableId)&&(d.value.get(Z.tableId).filters=[...d.value.get(Z.tableId).filters,...Z.filters])});if(((q=H.groupBy)==null?void 0:q.length)>0){const Z=((M=[...d.value.values()][0])==null?void 0:M.columns)||M7;d.value.clear(),r.cartItemColumnsMap={},H.groupBy.forEach(te=>{r.cartItemColumnsMap[te.tableId]=te.columns||Z,d.value.set(te.tableId,{loading:!0,lineItems:[],parentQLIs:[],columns:te.columns||Z,tableId:te.tableId,sectionName:te.sectionName,selected:new Map,footer:_(te.footer),filters:te.filters,primarysort:te.primarysort,primarysortdesc:te.primarysortdesc})})}H.showOptions!==void 0&&(y.value=H.showOptions)}if(((L=(U=P.payload)==null?void 0:U.sections)==null?void 0:L.length)>0){const H=(j=P.payload)==null?void 0:j.sections;d.value.clear(),H.forEach(Z=>{Z.tableId||(Z.tableId=vn()),Z.selected=new Map,d.value.set(Z.tableId,Z)}),B()}}P.actionFunction==="Reload"&&(console.log("Reloading configurator 3"),B(),console.info("Reloading quote line items"))}async function K(P){var N,T;try{const O=new Set;for(const F of d.value.keys())(N=d.value.get(F).lineItems)==null||N.forEach(M=>{M.attributes=null,O.add(M.id)});if(P){const F={lineItemIds:[...O]},q=await window.productManagerController.getLineItemAttributes({request:JSON.stringify(F)}),M=JSON.parse(q.data);for(const U of d.value.keys())(T=d.value.get(U).lineItems)==null||T.forEach(j=>{j.attributes=M[j.id]||null})}}catch(O){console.info("[ERROR]: fetchAttributesData() error = ",O)}}return{showAttributes:f,quoteId:o,quoteName:a,templateId:l,templateOptions:s,loading:u,currentTemplateData:h,fieldsData:m,fieldsDataLoading:c,showOptionHeaderButton:b,sectionDataMap:d,promptSuggestions:p,lineItemsCount:i,addColumns:X,getQuoteEPageLayout:A,getPayload:x,getPrimaryQuote:g,fetchTemplates:C,getFilteredListWithFields:k,getQuoteLineItemsWithFilteredTable:S,updateQli:I,getFieldsData:z,deleteQLI:R,performAIAction:W,isEditableField:$,fetchQuoteLineItems:v,fetchAllQuoteLineItems:B,fetchAttributesData:K}}),wo=it.defineStore("comRoot",()=>{const t=Un(),r=Mt(),n=$n(),o=e.ref(""),a=e.ref(""),i=e.ref("Genesis AI"),l=e.ref(""),s=e.ref({}),u=e.ref(""),h=e.ref(""),d=e.ref(""),m=e.ref(""),c=e.ref({}),y=e.ref(""),f=e.ref(""),b=e.ref(""),p=e.ref(""),x=e.ref(""),g=e.ref(""),C=e.ref(""),_=e.ref("Single"),E=e.ref("closed"),A=e.computed(()=>n.quoteName),k=e.computed(()=>_.value==="Single");async function B(S){o.value=S||Jr("id"),a.value=Jr("origin"),await w(),await D()}async function D(){try{console.info("getRecordInfo",o.value);let S=await window.salesforceConnector.getRecordInfo(o.value);return S=Tt(S),S!==void 0&&(c.value=S,y.value=S.name,f.value=S.objectType,b.value=S.accountId,p.value=S.eCatalogId,x.value=S.currencyCode,g.value=S.userLocale,C.value=S.opportunityId),(S==null?void 0:S.objectType)==="XX_ORD1__Quote__c"?(n.quoteId=S==null?void 0:S.recordId,n.templateId=S==null?void 0:S.templateId,n.quoteName=S==null?void 0:S.name,n.lineItemsCount=(S==null?void 0:S.lineItemsCount)||0):(S==null?void 0:S.objectType)==="Opportunity"&&await n.getPrimaryQuote(S.recordId),S}catch(S){r.handleError(S.message)}}async function w(){var I,R;console.info("getOrgInformation",o.value);const S=await window.salesforceConnector.getOrgInformation();t.websocketUrl=S.websocketUrl,l.value=(I=S.locale)==null?void 0:I.replace("_","-"),s.value=S.user,u.value=S.orgName,h.value=S.orgId,d.value=S.orgType,m.value=S.packageVersion,_.value=(R=S==null?void 0:S.pricingSchema)==null?void 0:R.toLowerCase()}function v(S){i.value=S,z0(S)}return{id:o,origin:a,title:A,subTitle:i,locale:l,user:s,orgName:u,orgId:h,orgType:d,packageVersion:m,objectType:f,recordInfo:c,name:y,accountId:b,eCatalogId:p,currencyCode:x,userLocale:g,opportunityId:C,pricingSchema:_,isSinglePricingSchema:k,flyoutState:E,start:B,getRecordInfo:D,setSubTitle:v}}),R7=it.defineStore("quickSelection",()=>{const t=Mt(),r=wo(),n=$n(),o=e.ref(null),a=e.ref(!1),i=e.ref([]),l=e.ref([]),s=e.ref(!1),u=e.ref({}),h=e.ref({rowLimit:10,paging:!0,offset:0,currentPage:1,totalPages:1}),d=e.ref(!1);async function m(){a.value=!0;try{const E=JSON.stringify({layoutType:"Quick Selection",layoutObject:"xx_ord1__ecatalog_item__c",...r.objectType?{contextObject:r.objectType}:{}});let A={};A=await window.salesforceConnector.getDynamicPageLayout(E),o.value=Cl(A,"Unable to find the Quick Selection Layout for your user profile"),console.info("quickSelectionLayout.value = ",o.value),h.value.rowLimit=o.value.configuration.rowLimit||10,o.value.data.columns.forEach(k=>{!k.field&&k.label==="QTY"&&(k.field="xx_ord1__qty__c")}),a.value=!1}catch(E){a.value=!1,t.handleError("Failed to get Page structure data. Please try again."),console.info("[ERROR]: getAdaptiveSearchLayout() error = ",E)}}function c(){const E=new Map;return o.value.data.columns.forEach(A=>{E.set(A.field,!0)}),o.value.data.searchResultColumns.forEach(A=>{E.set(A.field,!0)}),Array.from(E.keys())}async function y(E){var A,k;try{let B=await window.salesforceConnector.saveCompetitorSKU(E);if(B!=null&&B.errorMessage){t.handleError(B.errorMessage);return}if((A=B[0])!=null&&A.errorMessage){t.handleError((k=B[0])==null?void 0:k.errorMessage);return}return B}catch(B){t.handleError("Failed to Match Item. Please try again."),console.info("[ERROR]: saveCompetitorSKU() error = ",B)}}async function f(E="",A=[]){try{let k=o.value.data,B=o.value.configuration;const D=E.trim();if(console.info("searchTextValue.trim() = ",E.trim()),!D)return[];let w=null;console.info("useMappings = ",d.value),d.value?w=B7(b()):w=b(),console.info("fields before filter = ",w),w=w.filter(R=>R!=="xx_ord1__qty__c"),console.info("fields after filter = ",w);const v={fields:w,...A.length?{dynamicFilters:n.getDynamicFilters(A)}:{},searchText:D,accountId:r.accountId,...r.eCatalogId?{catalogId:r.eCatalogId}:{},...r.objectType==="opportunity"?{opportunityId:r.id}:{},...k!=null&&k.sort?{primarySortBy:k.sort.primary.field,primarySortOrder:k.sort.primary.direction,secondarySortBy:k.sort.secondary.field,secondarySortOrder:k.sort.secondary.direction}:{},rowLimt:(B==null?void 0:B.rowLimit)||20,paging:(B==null?void 0:B.paging)||!1,...h.value.offset!==0?{offset:h.value.offset}:{},objectName:k.objectName,currencyCode:r.currencyCode};console.info("getQuickSelectionItems payload = ",JSON.stringify(v));const S=await window.salesforceConnector.getItems(JSON.stringify(v));if(console.info("getQuickSelectionItems Res = ",JSON.stringify(S)),S!=null&&S.errorMessage){t.handleError(S.errorMessage);return}return S!=null&&S.itemCount&&(h.value.totalPages=Math.ceil((S==null?void 0:S.itemCount)/h.value.rowLimit)),Xo(S.lstItems,{xx_ord1__qty__c:"1"})}catch(k){t.handleError("Failed to fetch Results. Please try again."),console.info("[ERROR]: getQuickSelectionItems() error = ",k)}}function b(){let E=[];for(const A of o.value.data.columns){let k=A.field;if(k!=null&&k.includes(".")){E.includes(k)||E.push(k);let D=k.split(".")[0];D=D.slice(0,-1)+"c",E.includes(D)||E.push(D)}else E.includes(k)||E.push(k)}return console.info("getAllQuickSelectionFields() fields = ",E),E.filter(A=>A.toLowerCase()!=="xx_ord1__qty__c")}async function p(E,A,k,B){console.info("searchText:",JSON.stringify(E)),console.info("row:",JSON.stringify(A)),console.info("rowIndex:",JSON.stringify(k)),console.info("column:",JSON.stringify(B));const D=k+(h.value.currentPage-1)*h.value.rowLimit;if(B.field.toLowerCase().includes("xx_ord1__item__r")){if(i.value[D].itemLookupLoading=!0,d.value=!0,l.value=await f(E),l.value.length>0){const w=[];for(let v=0;v<l.value.length;v++)i.value[D].itemDataRetrieved=!0,l.value[v].xx_ord1__item__c&&w.push({name:l.value[v]["xx_ord1__item__r.name"],value:l.value[v].xx_ord1__item__c,label:l.value[v][B.field.toLowerCase()]});i.value[D][B.field.toLowerCase()+"_options"]=w}i.value[D].itemLookupLoading=!1}else if(B.field.toLowerCase().includes("xx_ord1__competitor_item__r")){i.value[D].competitorLookupLoading=!0;const w=await x(E);w!=null&&w.items&&(i.value[D][B.field.toLowerCase()+"_options"]=w.items.map(v=>({name:v.fields[2].value,value:v.fields[1].value,label:v.fields[0].value}))),i.value[D].competitorLookupLoading=!1,console.info("getLookupData:: Search Lookup Handler Response = ",w)}}async function x(E){var k,B;console.info("getLookupData() searchText = ",E);const A={searchText:E,obj:"xx_ord1__competitor_item__c",filters:null,displayFields:["xx_ord1__sku__c"]};try{let D=await window.salesforceConnector.getLookupData(JSON.stringify(A));if(typeof D=="string"&&(D=JSON.parse(D)),D!=null&&D.errorMessage){t.handleError(D.errorMessage);return}if((k=D[0])!=null&&k.errorMessage){t.handleError((B=D[0])==null?void 0:B.errorMessage);return}return D}catch(D){t.handleError("Failed to Search For Item. Please try again."),console.info("[ERROR]: getLookupData() error = ",D)}}async function g(E,A){var B;console.info("Update Other Fields Value = ",E),console.info("Update Other Fields Row Index = ",A);const k=A+(h.value.currentPage-1)*h.value.rowLimit;console.info("actualRowIndex = ",k);try{if(E){const D=l.value.filter(w=>w.xx_ord1__item__c===E)[0];if(D){s.value=!0;const w=o.value.data.columns[1].field;i.value[k][w]&&await C(D,k),(B=i.value[k])!=null&&B.itemDataRetrieved&&(i.value[k].status="New Match Requested",i.value[k].noMatchCleared=!0),Object.keys(D).forEach(v=>{const S=Hc[v.toLowerCase()];console.info("Mapped Key = ",S),S&&(i.value[k][S]=D[v])}),s.value=!1}else i.value[k].status=""}else i.value[k].status="No Match"}catch(D){t.handleError("Unable to request a match for this item please try again."),console.info("Error in updateOtherFields = ",D)}}async function C(E,A){const k=i.value[A],B=o.value.data.columns[1].field,D=[{sku:k[B],name:k[B],productDescription:k.xx_ord1__line_description__c||"",productURL:null,status:"Match Requested",competitorAccountId:null,itemId:E.xx_ord1__item__c}];let w=await y(JSON.stringify(D));console.info("Match Item: ",JSON.stringify(w)),i.value[A][`${B}_options`]=[{value:w[0].competitorItemId,label:w[0].sku}],i.value[A][B]=w[0].competitorItemId}async function _(E){try{let A=await window.salesforceConnector.createQLI(JSON.stringify(E));typeof A=="string"&&(A=JSON.parse(A));let k=!1;if((A==null?void 0:A.length)>0)for(let B=0;B<A.length;B++)A[B].errorMessage&&(k=!0,A[B].errorMessage.includes("Line Description: data value too large")&&(A[B].errorMessage="Error: The description is too long—it must be under 200 characters."));if(k){A.forEach(B=>{u.value[B.eCatalogItemId]=B});return}else u.value=[];return A}catch(A){t.handleError("Failed to add item to Quote. Please try again."),console.info("[ERROR]: addAllItemsToQuote() error = ",A)}}return{quickSelectionLayout:o,quickSelectionLayoutLoading:a,processedRecords:i,useMappings:d,currentSearchData:l,createQliErrors:u,getQuickSelectionLayout:m,getAllFieldsForQuickSelectionLayout:c,saveCompetitorSKU:y,getQuickSelectionItems:f,searchLookupHandler:p,updateOtherFields:g,addAllItemsToQuote:_}});function L7(t,r,n){const o=[];return t.templateId||o.push("AI_GUIDANCE_MISSING_TEMPLATE_ID"),t.composablesOrgType||o.push("AI_GUIDANCE_MISSING_COMPOSABLES_ORG_TYPE"),t.websocketUrl||o.push("AI_GUIDANCE_MISSING_WEBSOCKET_URL"),t.packageVersion||o.push("AI_GUIDANCE_MISSING_PACKAGE_VERSION"),n!=null&&n.accessToken||o.push("AI_GUIDANCE_MISSING_SECURITY_TOKEN"),r!=null&&r.organizationId||o.push("AI_GUIDANCE_MISSING_IDENTITY_ORG_ID"),r!=null&&r.userId||o.push("AI_GUIDANCE_MISSING_IDENTITY_USER_ID"),r!=null&&r.accountId||o.push("AI_GUIDANCE_MISSING_IDENTITY_ACCOUNT_ID"),o}function Xc(t){return t?!t.startsWith("ws://")&&!t.startsWith("wss://")?"WEBSOCKET_INVALID_URL_FORMAT":null:"WEBSOCKET_MISSING_URL"}function P7(t){var r,n,o,a,i,l;if(!t)return{playbookId:null,error:null};try{const s=(o=(n=(r=t==null?void 0:t[0])==null?void 0:r.blocks)==null?void 0:n[0])==null?void 0:o.playbookId,u=((i=(a=t==null?void 0:t.blocks)==null?void 0:a[0])==null?void 0:i.playbookId)||((l=t==null?void 0:t[0])==null?void 0:l.playbookId);return{playbookId:s||u||null,error:null}}catch(s){return console.error("[validation] Error validating block structure:",s),{playbookId:null,error:"AI_GUIDANCE_BLOCK_STRUCTURE_INVALID"}}}function q7(t,r){const n=[];t!=null&&t.currentPlaybook||n.push("COMPONENT_LOADER_MISSING_PLAYBOOK");const o=r;return o&&o!=="catalog"&&o!=="cart"&&o!=="configurator"&&o!==""&&n.push("COMPONENT_LOADER_INVALID_COMPONENT_KEY"),n}const No="Preparing Your Quote Please Wait...",vi={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"},$7=18e4,U7=2e3,z7={bgColor:"#EDF8EB",textColor:"#5F5F5F"};function j7({minDisplayMs:t=2e3}={}){const r=[];let n=null,o=!1,a=null,i=null,l=null;const s=new Set;function u(){const g={isActive:o,currentMessage:a?a.message:null,queuedCount:r.length};s.forEach(C=>{try{C(g)}catch{}})}function h(){n||(n=setInterval(m,100))}function d(){n&&(clearInterval(n),n=null)}function m(){if(o){if(!a&&r.length>0){a={...r.shift(),shownAt:Date.now()},u();return}if(a&&Date.now()-a.shownAt>=a.minDisplayMs){if(r.length>0)a={...r.shift(),shownAt:Date.now()},u();else if(a=null,o=!1,d(),u(),i&&l){const C=i,_=l;i=null,l=null;try{_(C)}catch{}}}}}function c(g,C={}){return r.push({message:g,minDisplayMs:C.minDisplayMs||t}),o||(o=!0,h(),u()),r.length}function y(g,C){if(i=g,typeof C=="function"&&(l=C),o)h();else{const _=l,E=i;if(i=null,l=null,_)try{_(E)}catch{}}}function f(g){return typeof g!="function"?()=>{}:(s.add(g),g({isActive:o,currentMessage:a?a.message:null,queuedCount:r.length}),()=>s.delete(g))}function b(){return a?a.message:null}function p(){return o}function x(){r.length=0,a=null,o=!1,i=null,l=null,d(),u()}return{getCurrentMessage:b,getIsActive:p,subscribe:f,enqueue:c,setSuccess:y,clear:x}}const Un=it.defineStore("ai",()=>{const t=wo(),r=$n();Kc(),R7();const n=Rt(),o=Ci(),a=ft(),i=Jn();(()=>{try{return L0()}catch{return{path:""}}})();const l=e.ref(""),s=e.ref([]),u=e.ref(""),h=e.ref([]),d=e.ref(!1),m=e.ref(null),c=e.ref({}),y=e.ref(null),f=e.ref(null),b=e.ref(null),p=e.ref(null),x=e.ref(!1),g=e.ref(!0),C=e.ref(null),_=e.ref(!1),E=e.ref(null),A=e.ref(No),k=j7({minDisplayMs:U7});k.subscribe(({isActive:oe,currentMessage:le})=>{oe&&(A.value=le||No)});const B=e.ref([]),D=e.computed(()=>z7),w=()=>{var Ce,J,se;const le=(se=(J=(((Ce=i.currentPlaybook)==null?void 0:Ce.playBookSteps)||[])[0])==null?void 0:J.uiSpecs)==null?void 0:se.customText;return{message:typeof le=="string"&&le.trim().length>0?le:vi==null?void 0:vi.message,type:"response"}},v=e.ref(vn()),S=e.computed(()=>{const oe=a.organizationId.value,le=a.userId.value,be=a.quoteId.value||a.cid.value||v.value;return`${oe}_${le}_${be}`}),I=e.computed(()=>m.value.readyState==WebSocket.OPEN),R=e.computed(()=>a.websocketUrl.value||""),z=()=>{c.value={salesforceOrgId:a.organizationId.value,salesforceOrgType:a.composablesOrgType.value,salesforceUserId:a.userId.value,userType:"Salesforce",chatRoomId:S.value,chatId:null,requestId:"",prompt:"",initiatedFrom:t.origin||"Quote",internalCall:!1,contextObjectId:a.quoteId.value,contextObjectType:"Quote",payload:{lineItemsCount:r.lineItemsCount},origin:"DXP",defaultBatchSize:10,actionType:"",packageVersion:a.packageVersion.value,relatedIds:{accountId:a.accountId.value,eCatalogId:a.eCatalogId.value||"",contactId:a.cid.value||""}}},$=(oe,le={})=>{g.value&&Et("websocket:error",{errorCode:oe,isInitialization:!0,...le})};async function X(){const oe=Xc(R.value);if(oe)throw $(oe,{url:R.value}),new Error("WebSocket URL validation failed");g.value=!0;const le=1e4;C.value=setTimeout(()=>{if(m.value&&m.value.readyState!==WebSocket.OPEN&&($("WEBSOCKET_CONNECTION_TIMEOUT"),m.value))try{m.value.close()}catch{}},le);let be=!1;return new Promise((J,se)=>{var Se,De,Oe,He;const fe=(Ve,Ge)=>{be||(be=!0,Ve?se(Ve):J(Ge))},Y=()=>{W(),fe(null)},re=Ve=>{K(Ve),be||fe(new Error("WebSocket closed before open"))},me=Ve=>{P(Ve),be||fe((Ve==null?void 0:Ve.error)||new Error("WebSocket error"))};try{const Ve=R.value+"?chatRoomId="+S.value;m.value=new WebSocket(Ve),m.value.addEventListener("open",Y),m.value.addEventListener("message",N),m.value.addEventListener("close",re),m.value.addEventListener("error",me)}catch(Ve){C.value&&(clearTimeout(C.value),C.value=null),(Se=Ve.message)!=null&&Se.includes("network")||(De=Ve.message)!=null&&De.includes("Network")?$("WEBSOCKET_NETWORK_ERROR",{error:Ve.message}):(Oe=Ve.message)!=null&&Oe.includes("CORS")||(He=Ve.message)!=null&&He.includes("cors")?$("WEBSOCKET_CORS_ERROR",{error:Ve.message}):$("WEBSOCKET_CONNECTION_FAILED",{error:Ve.message}),fe(Ve)}})}const W=()=>{C.value&&(clearTimeout(C.value),C.value=null),g.value=!1,F(),U()},K=oe=>{if(C.value&&(clearTimeout(C.value),C.value=null),g.value){const le=(oe==null?void 0:oe.code)??1006,be=(oe==null?void 0:oe.reason)??"";switch(le){case 1e3:break;case 1001:case 1002:case 1003:case 1013:case 1014:$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:le,closeReason:be});break;case 1006:$("WEBSOCKET_ABNORMAL_CLOSURE",{closeCode:le,closeReason:be});break;case 1011:$("WEBSOCKET_SERVER_ERROR",{closeCode:le,closeReason:be});break;case 1012:$("WEBSOCKET_SERVICE_RESTART",{closeCode:le,closeReason:be});break;case 1015:$("WEBSOCKET_SSL_ERROR",{closeCode:le,closeReason:be});break;default:le!==1e3&&$("WEBSOCKET_UNEXPECTED_CLOSE",{closeCode:le,closeReason:be})}}g.value=!1,_.value=!1,q()},P=oe=>{var le;if(C.value&&(clearTimeout(C.value),C.value=null),g.value){let be="WEBSOCKET_CONNECTION_FAILED";const Ce=(oe==null?void 0:oe.message)||((le=oe==null?void 0:oe.error)==null?void 0:le.message)||"Unknown websocket error";Ce.includes("network")||Ce.includes("Network")||Ce.includes("Failed to fetch")?be="WEBSOCKET_NETWORK_ERROR":Ce.includes("CORS")||Ce.includes("cors")?be="WEBSOCKET_CORS_ERROR":Ce.includes("SSL")||Ce.includes("TLS")||Ce.includes("certificate")?be="WEBSOCKET_SSL_ERROR":Ce.includes("refused")||Ce.includes("ECONNREFUSED")?be="WEBSOCKET_CONNECTION_REFUSED":(Ce.includes("auth")||Ce.includes("unauthorized")||Ce.includes("401"))&&(be="WEBSOCKET_AUTHENTICATION_FAILED"),$(be,{error:Ce})}_.value=!1,ce(),q()},N=oe=>{var Ce,J,se,fe;F();const le=JSON.parse(oe.data);le!=null&&le.chatId&&(c.value.chatId=le.chatId);const be=(le==null?void 0:le.contextObjectId)??((Ce=le==null?void 0:le.payload)==null?void 0:Ce.contextObjectId);if(be){const Y=c.value.contextObjectId||((J=a.quoteId)==null?void 0:J.value)||"",re=be;re&&re!==Y&&(c.value.contextObjectId=re,a.updateConfig({quoteId:re}),Et("quote-id:updated",{quoteId:re}))}if(O(le),le.status!=="ALIVE"){if((le==null?void 0:le.status)==="IN_PROGRESS"||(le==null?void 0:le.loading)===!0){const Y=(le==null?void 0:le.message)||(le==null?void 0:le.statusMessage)||(le==null?void 0:le.stepName)||No;k.enqueue(Y),A.value=k.getCurrentMessage()||Y;return}if((le==null?void 0:le.status)==="SUCCESS"){const Y=(le==null?void 0:le.message)||No;A.value=k.getCurrentMessage()||Y,k.setSuccess(le,re=>{T(re)});return}Array.isArray(le.messages)?(A.value=null,_.value=!1,s.value.push(w()),le.messages.length>0&&te(le.messages)):le.agentResponse&&(le.errorMessage&&(le.agentResponse.content=le.errorMessage,le.agentResponse.error=!0),A.value=null,s.value.push({message:le.agentResponse.content,type:le.agentResponse.role,requestId:le.requestId,epoch:le.agentResponse.epoch,error:le.agentResponse.error,isDML:le.agentResponse.isDML,...(se=le.agentResponse)!=null&&se.filesData?{filesData:(fe=le.agentResponse)==null?void 0:fe.filesData}:{}})),B.value=le.links||[],ie(le)}};function T(oe,le={}){var J,se,fe,Y;const{skipComponentLoad:be=!1}=le||{},Ce=(oe==null?void 0:oe.contextObjectId)??((J=oe==null?void 0:oe.payload)==null?void 0:J.contextObjectId);if(Ce){const re=c.value.contextObjectId||((se=a.quoteId)==null?void 0:se.value)||"",me=Ce;me&&me!==re&&(console.info("[ai] Updating quoteId from contextObjectId (SUCCESS):",{current:re,new:me}),c.value.contextObjectId=me,a.updateConfig({quoteId:me}),console.info("[ai] Emitting quote-id:updated event with quoteId (SUCCESS):",me),Et("quote-id:updated",{quoteId:me}))}if(oe!=null&&oe.loading){A.value=oe.message;return}else Array.isArray(oe==null?void 0:oe.messages)?(A.value=null,_.value=!1,s.value.push(w()),oe.messages.length>0&&te(oe.messages)):oe!=null&&oe.agentResponse?(oe.errorMessage&&(oe.agentResponse.content=oe.errorMessage,oe.agentResponse.error=!0),A.value=null,s.value.push({message:oe.agentResponse.content,type:oe.agentResponse.role,requestId:oe.requestId,epoch:oe.agentResponse.epoch,error:oe.agentResponse.error,isDML:oe.agentResponse.isDML,...(fe=oe.agentResponse)!=null&&fe.filesData?{filesData:(Y=oe.agentResponse)==null?void 0:Y.filesData}:{}})):A.value=null;B.value=(oe==null?void 0:oe.links)||[];try{Et("ai-response:success",oe)}catch{}be||ie(oe)}const O=oe=>{const le=oe==null?void 0:oe.eventType,be=(oe==null?void 0:oe.loading)===!0||le==="ResponseTextDeltaEvent",Ce=le==="ResponseTextDoneEvent"||Array.isArray(oe==null?void 0:oe.messages)||!!(oe!=null&&oe.agentResponse);if(be&&!Ce){x.value=!0;return}Ce&&(x.value=!1)},F=()=>{q(),y.value=setTimeout(()=>{if(I.value){const oe={action:"heartbeat"};m.value.send(JSON.stringify(oe)),F()}},$7)},q=()=>{y.value&&(clearInterval(y.value),y.value=null)};function M(oe){const le={...c.value};le.requestType="Action",le.actionType="Undo",le.undoRequestId=oe,le.requestId=vn(),Z(le)}function U(){_.value=!0;const oe={...c.value};oe.requestType="Action",oe.actionType="History",oe.requestId=vn(),Z(oe)}function L(oe){return console.info("[ai] isUnsavedChanges check",{activeKey:((i==null?void 0:i.activeComponentKey)||"").toLowerCase(),isChangedConfiguration:n.isChangedConfiguration}),((i==null?void 0:i.activeComponentKey)||"").toLowerCase()==="configurator"&&n.isChangedConfiguration&&console.warn("[ai] Unsaved configurator changes detected; not blocking send"),!1}function j(oe,le=!0,be=null){if(console.info("[ai] sendMessage",{messageLength:(oe||"").length,hasCustomPayload:!!be,addMessageToHistory:le}),L()){console.warn("[ai] sendMessage aborted: unsaved changes detected");return}if(oe.trim()){let Ce={...c.value};Ce.prompt=oe.trim(),Ce.requestType="Chat",Ce.requestId=vn(),Ce.internalCall=!1,Ce.payload=ne(),console.log("[ai] _payload.payload",Ce.payload),Ce.componentName=Q.value,Ce.templateId=r.templateId,Ce.payload.lineItemsCount=r.lineItemsCount,Ce.relatedIds.eCatalogId=a.eCatalogId.value||"",be&&(Ce={...Ce,...be}),ue(),le&&s.value.push({message:oe.trim(),type:"user",...E.value&&{fileData:[E.value]},requestId:Ce.requestId}),console.info("[ai] sending prompt",{requestId:Ce.requestId,requestType:Ce.requestType,componentName:Ce.componentName}),Z(Ce),F()}}const H=e.computed(()=>{var be,Ce,J;const oe=((be=i.currentPlaybook)==null?void 0:be.pbUniqueId)??((Ce=i.currentPlaybook)==null?void 0:Ce.vUniqueId)??null,le=i.currentStepName??((J=i.currentStep)==null?void 0:J.stepName)??null;return{pbUniqueId:oe,stepName:le}});function Z(oe){const le={...oe},{pbUniqueId:be,stepName:Ce}=H.value||{};console.log("[ai] activePlaybookContext",H.value),be&&(le.pbUniqueId=be),Ce&&(le.stepName=Ce);const J={action:"prompt",data:le};m.value.send(JSON.stringify(J))}const te=oe=>{const le=oe.filter(({content:be})=>!!be).map(be=>({message:be.content,type:be.role,requestId:be.requestId,epoch:be.epoch,isDML:be.isDML,undone:be.undone}));le.forEach((be,Ce)=>{be.isDML===!0&&Ce!==le.length-1&&(be.isDML=!1)}),s.value=[...s.value,...le]};function ne(){const oe=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return console.info("[ai] getRequestBody activeKey",oe),oe==="cart"||oe==="quote_item"?(console.info("[ai] getRequestBody → using quoteStore.getPayload()"),r.getPayload()):oe==="configurator"?o.getPayload():(console.info("[ai] getRequestBody → empty {}"),{})}const Q=e.computed(()=>{const oe=((i==null?void 0:i.activeComponentKey)||"").toLowerCase();return oe==="cart"||oe==="quote_item"?"QuoteItem":""}),ce=()=>{s.value.push({type:"response",message:"Oops! Something went wrong while processing your request. Please try again later.",error:!0})},ue=()=>{s.value=s.value.map(oe=>({...oe,links:[]}))};function pe(oe){var le,be,Ce;try{const J=oe==null?void 0:oe.stepName;if(!J)return!1;const se=He=>String(He||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),fe=((le=i.currentPlaybook)==null?void 0:le.playBookSteps)||[],Y=fe.find(He=>He.stepName===J||He.name===J)||null,me=se(Y==null?void 0:Y.stepComponent)==="configurator"||se(J).includes("configure"),Se=!!((be=oe==null?void 0:oe.payload)!=null&&be.productConfiguration&&Array.isArray(oe.payload.productConfiguration)&&oe.payload.productConfiguration.length===0),Oe=se(i.currentStep&&i.currentStep.stepComponent||((Ce=fe.find(He=>He.stepName===(i.currentStepName||"")))==null?void 0:Ce.stepComponent)||i.activeComponentKey)==="configurator";return me&&Se&&Oe}catch{return!1}}function ie(oe){var Ce,J,se,fe;const le=(oe==null?void 0:oe.contextObjectId)??((Ce=oe==null?void 0:oe.payload)==null?void 0:Ce.contextObjectId);if(le){const Y=le,re=c.value.contextObjectId||((J=a.quoteId)==null?void 0:J.value)||"";Y&&Y!==re&&(c.value.contextObjectId=Y,a.updateConfig({quoteId:Y}),Et("quote-id:updated",{quoteId:Y}))}const be=oe==null?void 0:oe.stepName;if(be){if(be==="AI Guidance"||be==="ai_guidance"||be.toLowerCase()==="ai guidance"){console.info("[ai] Skipping navigation for AI Guidance step - side panel will remain in current state");return}if(pe(oe)){console.info("[ai] Skipping configurator update: empty productConfiguration and configurator already active"),(oe==null?void 0:oe.actionFunction)==="Reload"&&(console.log("Reloading configurator 2"),o.refresh());return}try{i.navigateToStep({stepName:be,data:oe})}catch(Y){console.info("navigateToStep failed, falling back to legacy component routing",Y)}return}else{if(i.currentStepName||i.currentStep&&i.currentStep.stepName||null)return;(fe=(se=i.currentPlaybook)==null?void 0:se.playBookSteps)!=null&&fe.length&&i.navigateToStep({stepName:i.currentPlaybook.playBookSteps[0].stepName});return}}function de(){if(I.value){const oe={action:"cancel",data:{requestId:c.value.requestId,chatRoomId:S.value}};m.value.send(JSON.stringify(oe))}}function _e(){try{if(C.value&&(clearTimeout(C.value),C.value=null),g.value=!1,m.value){try{m.value.removeEventListener("open",W)}catch{}try{m.value.removeEventListener("message",N)}catch{}try{m.value.removeEventListener("close",K)}catch{}try{m.value.removeEventListener("error",P)}catch{}try{m.value.close()}catch{}m.value=null}}finally{ye()}}function xe(){try{k.clear()}catch{}l.value="",s.value=[],u.value="",h.value=[],d.value=!1,B.value=[],E.value=null,x.value=!1,p.value=null,A.value=No,c.value={},q(),ye()}const ye=()=>{f.value&&(clearInterval(f.value),f.value=null),y.value&&(clearInterval(y.value),y.value=null),b.value&&(clearTimeout(b.value),b.value=null)};return e.onBeforeUnmount(()=>{ye()}),{unsavedChanges:p,loadingMessage:A,promptMessage:l,buttonLinks:B,websocketUrl:R,chatHistory:s,latestDMLRequest:u,strikethroughHistory:h,attachmentData:E,dataManuallyChanged:d,isThinkingMessage:x,isFetchingHistory:_,chatStyles:D,undoAction:M,connectSocket:X,sendMessage:j,setInitialPayload:z,cancelRequest:de,disconnectSocket:_e,resetState:xe}}),H7={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 G7(t,r={}){const n=H7[t];return n?{...n,details:r}:{code:"UNKNOWN_ERROR",message:`Unknown error: ${t}`,component:"aiGuidance",details:r}}function Wc(t,r="aiGuidance"){const n=(a,i={})=>{const l=G7(a,i);t("ai-guidance:error",l),console.error(`[${r}] Error:`,l)};return{emitError:n,emitErrors:(a,i={})=>{a.forEach(l=>n(l,i))}}}const K7={class:"chat-message-links"},X7=["href","redirect","data-test-id"],W7=ve({__name:"ChatMessageActions",props:{links:{type:Array,default:()=>[]},chatIndex:{type:Number,default:0}},emits:["perform-action"],setup(t){const r=(n,o,a)=>o;return(n,o)=>(e.openBlock(),e.createElementBlock("div",K7,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.links,(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.label},[a!=null&&a.action?(e.openBlock(),e.createBlock(xt,{key:0,btype:"playbook",text:a.label,disabled:a==null?void 0:a.disabled,"data-test-id":`chat-message-action-${a.label}`,onClick:l=>n.$emit("perform-action",a.action,t.chatIndex,a==null?void 0:a.isStatic)},null,8,["text","disabled","data-test-id","onClick"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:a.link,redirect:r(a.link,a.redirect),target:"_blank",class:"ai-links","data-test-id":`chat-message-action-${a.label}`},e.toDisplayString(a.label),9,X7))],64))),128))]))}},[["__scopeId","data-v-e0a9c744"]]),Q7={class:"a-icon"},Z7=["src"],J7={class:"a-name"},Y7={class:"a-size"},eb=ve({__name:"AppAttachment",props:{background:{type:String,default:"#f8f8f8"},info:{type:Object,required:!0,default:()=>({iconUrl:"",fileName:"",fileSize:""})},encodedString:{type:String,default:""}},emits:["download"],setup(t,{emit:r}){const n=t,o=r,a=i=>{try{const l=i.match(/^data:(.*?);base64,(.*)$/);if(!l||l.length!==3)throw new Error("Invalid Base64 file format");const s=l[1],u=l[2],h=document.createElement("a");h.href=i,h.download=n.info.fileName||"download",h.target="_blank",document.body.appendChild(h),h.click(),document.body.removeChild(h);const d=El(Math.floor(u.length*3/4));o("download",{name:n.info.fileName,size:d,url:i})}catch(l){console.info("[ERROR]: Error decoding Base64 file:",l)}};return(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:"attachment-wrapper",style:e.normalizeStyle(`background: ${t.background}`)},[e.createElementVNode("span",Q7,[e.createElementVNode("img",{src:t.info.iconUrl},null,8,Z7)]),e.createElementVNode("div",null,[e.createElementVNode("p",J7,e.toDisplayString(t.info.fileName),1),e.createElementVNode("p",Y7,e.toDisplayString(t.info.fileSize),1)]),t.encodedString?(e.openBlock(),e.createElementBlock("button",{key:0,class:"a-download",onClick:l[0]||(l[0]=s=>a(t.encodedString))},[e.createVNode(Be,{icon:"download",color:"#353535"})])):e.createCommentVNode("",!0)],4))}},[["__scopeId","data-v-4194a82b"]]),Qc="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",Zc="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",tb={name:"SkeletonLoader",props:{dataTestId:{type:String,default:""}}},nb=["data-test-id"];function ob(t,r,n,o,a,i){return e.openBlock(),e.createElementBlock("div",{class:"skeleton-loader","data-test-id":n.dataTestId},null,8,nb)}const So=ve(tb,[["render",ob],["__scopeId","data-v-17a86e07"]]),Jc={};function rb(t){let r=Jc[t];if(r)return r;r=Jc[t]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);r.push(o)}for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);r[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return r}function Yn(t,r){typeof r!="string"&&(r=Yn.defaultChars);const n=rb(r);return t.replace(/(%[a-f0-9]{2})+/gi,function(o){let a="";for(let i=0,l=o.length;i<l;i+=3){const s=parseInt(o.slice(i+1,i+3),16);if(s<128){a+=n[s];continue}if((s&224)===192&&i+3<l){const u=parseInt(o.slice(i+4,i+6),16);if((u&192)===128){const h=s<<6&1984|u&63;h<128?a+="��":a+=String.fromCharCode(h),i+=3;continue}}if((s&240)===224&&i+6<l){const u=parseInt(o.slice(i+4,i+6),16),h=parseInt(o.slice(i+7,i+9),16);if((u&192)===128&&(h&192)===128){const d=s<<12&61440|u<<6&4032|h&63;d<2048||d>=55296&&d<=57343?a+="���":a+=String.fromCharCode(d),i+=6;continue}}if((s&248)===240&&i+9<l){const u=parseInt(o.slice(i+4,i+6),16),h=parseInt(o.slice(i+7,i+9),16),d=parseInt(o.slice(i+10,i+12),16);if((u&192)===128&&(h&192)===128&&(d&192)===128){let m=s<<18&1835008|u<<12&258048|h<<6&4032|d&63;m<65536||m>1114111?a+="����":(m-=65536,a+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),i+=9;continue}}a+="�"}return a})}Yn.defaultChars=";/?:@&=+$,#",Yn.componentChars="";const Yc={};function ab(t){let r=Yc[t];if(r)return r;r=Yc[t]=[];for(let n=0;n<128;n++){const o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?r.push(o):r.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)r[t.charCodeAt(n)]=t[n];return r}function Bo(t,r,n){typeof r!="string"&&(n=r,r=Bo.defaultChars),typeof n>"u"&&(n=!0);const o=ab(r);let a="";for(let i=0,l=t.length;i<l;i++){const s=t.charCodeAt(i);if(n&&s===37&&i+2<l&&/^[0-9a-f]{2}$/i.test(t.slice(i+1,i+3))){a+=t.slice(i,i+3),i+=2;continue}if(s<128){a+=o[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&i+1<l){const u=t.charCodeAt(i+1);if(u>=56320&&u<=57343){a+=encodeURIComponent(t[i]+t[i+1]),i++;continue}}a+="%EF%BF%BD";continue}a+=encodeURIComponent(t[i])}return a}Bo.defaultChars=";/?:@&=+$,-_.!~*'()#",Bo.componentChars="-_.!~*'()";function Ai(t){let r="";return r+=t.protocol||"",r+=t.slashes?"//":"",r+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?r+="["+t.hostname+"]":r+=t.hostname||"",r+=t.port?":"+t.port:"",r+=t.pathname||"",r+=t.search||"",r+=t.hash||"",r}function Br(){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 ib=/^([a-z0-9.+-]+:)/i,lb=/:[0-9]*$/,sb=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,cb=["<",">",'"',"`"," ","\r",`
|
|
146
146
|
`," "],ub=["{","}","|","\\","^","`"].concat(cb),db=["'"].concat(ub),eu=["%","/","?",";","#"].concat(db),tu=["/","?","#"],fb=255,nu=/^[+a-z0-9A-Z_-]{0,63}$/,hb=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ou={javascript:!0,"javascript:":!0},ru={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function wi(t,r){if(t&&t instanceof Br)return t;const n=new Br;return n.parse(t,r),n}Br.prototype.parse=function(t,r){let n,o,a,i=t;if(i=i.trim(),!r&&t.split("#").length===1){const h=sb.exec(i);if(h)return this.pathname=h[1],h[2]&&(this.search=h[2]),this}let l=ib.exec(i);if(l&&(l=l[0],n=l.toLowerCase(),this.protocol=l,i=i.substr(l.length)),(r||l||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(a=i.substr(0,2)==="//",a&&!(l&&ou[l])&&(i=i.substr(2),this.slashes=!0)),!ou[l]&&(a||l&&!ru[l])){let h=-1;for(let f=0;f<tu.length;f++)o=i.indexOf(tu[f]),o!==-1&&(h===-1||o<h)&&(h=o);let d,m;h===-1?m=i.lastIndexOf("@"):m=i.lastIndexOf("@",h),m!==-1&&(d=i.slice(0,m),i=i.slice(m+1),this.auth=d),h=-1;for(let f=0;f<eu.length;f++)o=i.indexOf(eu[f]),o!==-1&&(h===-1||o<h)&&(h=o);h===-1&&(h=i.length),i[h-1]===":"&&h--;const c=i.slice(0,h);i=i.slice(h),this.parseHost(c),this.hostname=this.hostname||"";const y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y){const f=this.hostname.split(/\./);for(let b=0,p=f.length;b<p;b++){const x=f[b];if(x&&!x.match(nu)){let g="";for(let C=0,_=x.length;C<_;C++)x.charCodeAt(C)>127?g+="x":g+=x[C];if(!g.match(nu)){const C=f.slice(0,b),_=f.slice(b+1),E=x.match(hb);E&&(C.push(E[1]),_.unshift(E[2])),_.length&&(i=_.join(".")+i),this.hostname=C.join(".");break}}}}this.hostname.length>fb&&(this.hostname=""),y&&(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 u=i.indexOf("?");return u!==-1&&(this.search=i.substr(u),i=i.slice(0,u)),i&&(this.pathname=i),ru[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Br.prototype.parseHost=function(t){let r=lb.exec(t);r&&(r=r[0],r!==":"&&(this.port=r.substr(1)),t=t.substr(0,t.length-r.length)),t&&(this.hostname=t)};const pb=Object.freeze(Object.defineProperty({__proto__:null,decode:Yn,encode:Bo,format:Ai,parse:wi},Symbol.toStringTag,{value:"Module"})),au=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,iu=/[\0-\x1F\x7F-\x9F]/,mb=/[\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]/,Ni=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,lu=/[\$\+<->\^`\|~\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]/,su=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,yb=Object.freeze(Object.defineProperty({__proto__:null,Any:au,Cc:iu,Cf:mb,P:Ni,S:lu,Z:su},Symbol.toStringTag,{value:"Module"})),gb=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(t=>t.charCodeAt(0))),bb=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Si;const xb=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]]),_b=(Si=String.fromCodePoint)!==null&&Si!==void 0?Si:function(t){let r="";return t>65535&&(t-=65536,r+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),r+=String.fromCharCode(t),r};function Cb(t){var r;return t>=55296&&t<=57343||t>1114111?65533:(r=xb.get(t))!==null&&r!==void 0?r:t}var st;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(st||(st={}));const Eb=32;var Sn;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Sn||(Sn={}));function Bi(t){return t>=st.ZERO&&t<=st.NINE}function kb(t){return t>=st.UPPER_A&&t<=st.UPPER_F||t>=st.LOWER_A&&t<=st.LOWER_F}function vb(t){return t>=st.UPPER_A&&t<=st.UPPER_Z||t>=st.LOWER_A&&t<=st.LOWER_Z||Bi(t)}function Ab(t){return t===st.EQUALS||vb(t)}var ct;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(ct||(ct={}));var Bn;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Bn||(Bn={}));class wb{constructor(r,n,o){this.decodeTree=r,this.emitCodePoint=n,this.errors=o,this.state=ct.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Bn.Strict}startEntity(r){this.decodeMode=r,this.state=ct.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(r,n){switch(this.state){case ct.EntityStart:return r.charCodeAt(n)===st.NUM?(this.state=ct.NumericStart,this.consumed+=1,this.stateNumericStart(r,n+1)):(this.state=ct.NamedEntity,this.stateNamedEntity(r,n));case ct.NumericStart:return this.stateNumericStart(r,n);case ct.NumericDecimal:return this.stateNumericDecimal(r,n);case ct.NumericHex:return this.stateNumericHex(r,n);case ct.NamedEntity:return this.stateNamedEntity(r,n)}}stateNumericStart(r,n){return n>=r.length?-1:(r.charCodeAt(n)|Eb)===st.LOWER_X?(this.state=ct.NumericHex,this.consumed+=1,this.stateNumericHex(r,n+1)):(this.state=ct.NumericDecimal,this.stateNumericDecimal(r,n))}addToNumericResult(r,n,o,a){if(n!==o){const i=o-n;this.result=this.result*Math.pow(a,i)+parseInt(r.substr(n,i),a),this.consumed+=i}}stateNumericHex(r,n){const o=n;for(;n<r.length;){const a=r.charCodeAt(n);if(Bi(a)||kb(a))n+=1;else return this.addToNumericResult(r,o,n,16),this.emitNumericEntity(a,3)}return this.addToNumericResult(r,o,n,16),-1}stateNumericDecimal(r,n){const o=n;for(;n<r.length;){const a=r.charCodeAt(n);if(Bi(a))n+=1;else return this.addToNumericResult(r,o,n,10),this.emitNumericEntity(a,2)}return this.addToNumericResult(r,o,n,10),-1}emitNumericEntity(r,n){var o;if(this.consumed<=n)return(o=this.errors)===null||o===void 0||o.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(r===st.SEMI)this.consumed+=1;else if(this.decodeMode===Bn.Strict)return 0;return this.emitCodePoint(Cb(this.result),this.consumed),this.errors&&(r!==st.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(r,n){const{decodeTree:o}=this;let a=o[this.treeIndex],i=(a&Sn.VALUE_LENGTH)>>14;for(;n<r.length;n++,this.excess++){const l=r.charCodeAt(n);if(this.treeIndex=Nb(o,a,this.treeIndex+Math.max(1,i),l),this.treeIndex<0)return this.result===0||this.decodeMode===Bn.Attribute&&(i===0||Ab(l))?0:this.emitNotTerminatedNamedEntity();if(a=o[this.treeIndex],i=(a&Sn.VALUE_LENGTH)>>14,i!==0){if(l===st.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Bn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var r;const{result:n,decodeTree:o}=this,a=(o[n]&Sn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,a,this.consumed),(r=this.errors)===null||r===void 0||r.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(r,n,o){const{decodeTree:a}=this;return this.emitCodePoint(n===1?a[r]&~Sn.VALUE_LENGTH:a[r+1],o),n===3&&this.emitCodePoint(a[r+2],o),o}end(){var r;switch(this.state){case ct.NamedEntity:return this.result!==0&&(this.decodeMode!==Bn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ct.NumericDecimal:return this.emitNumericEntity(0,2);case ct.NumericHex:return this.emitNumericEntity(0,3);case ct.NumericStart:return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ct.EntityStart:return 0}}}function cu(t){let r="";const n=new wb(t,o=>r+=_b(o));return function(a,i){let l=0,s=0;for(;(s=a.indexOf("&",s))>=0;){r+=a.slice(l,s),n.startEntity(i);const h=n.write(a,s+1);if(h<0){l=s+n.end();break}l=s+h,s=h===0?l+1:l}const u=r+a.slice(l);return r="",u}}function Nb(t,r,n,o){const a=(r&Sn.BRANCH_LENGTH)>>7,i=r&Sn.JUMP_TABLE;if(a===0)return i!==0&&o===i?n:-1;if(i){const u=o-i;return u<0||u>=a?-1:t[n+u]-1}let l=n,s=l+a-1;for(;l<=s;){const u=l+s>>>1,h=t[u];if(h<o)l=u+1;else if(h>o)s=u-1;else return t[u+a]}return-1}const Sb=cu(gb);cu(bb);function uu(t,r=Bn.Legacy){return Sb(t,r)}function Bb(t){return Object.prototype.toString.call(t)}function Ii(t){return Bb(t)==="[object String]"}const Ib=Object.prototype.hasOwnProperty;function Tb(t,r){return Ib.call(t,r)}function Ir(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(o){t[o]=n[o]})}}),t}function du(t,r,n){return[].concat(t.slice(0,r),n,t.slice(r+1))}function Ti(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function Tr(t){if(t>65535){t-=65536;const r=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(r,n)}return String.fromCharCode(t)}const fu=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Ob=/&([a-z#][a-z0-9]{1,31});/gi,Db=new RegExp(fu.source+"|"+Ob.source,"gi"),Vb=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Fb(t,r){if(r.charCodeAt(0)===35&&Vb.test(r)){const o=r[1].toLowerCase()==="x"?parseInt(r.slice(2),16):parseInt(r.slice(1),10);return Ti(o)?Tr(o):t}const n=uu(t);return n!==t?n:t}function Mb(t){return t.indexOf("\\")<0?t:t.replace(fu,"$1")}function eo(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Db,function(r,n,o){return n||Fb(r,o)})}const Rb=/[&<>"]/,Lb=/[&<>"]/g,Pb={"&":"&","<":"<",">":">",'"':"""};function qb(t){return Pb[t]}function In(t){return Rb.test(t)?t.replace(Lb,qb):t}const $b=/[.?*+^$[\]\\(){}|-]/g;function Ub(t){return t.replace($b,"\\$&")}function je(t){switch(t){case 9:case 32:return!0}return!1}function Io(t){if(t>=8192&&t<=8202)return!0;switch(t){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 To(t){return Ni.test(t)||lu.test(t)}function Oo(t){switch(t){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 Or(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}const zb=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:du,assign:Ir,escapeHtml:In,escapeRE:Ub,fromCodePoint:Tr,has:Tb,isMdAsciiPunct:Oo,isPunctChar:To,isSpace:je,isString:Ii,isValidEntityCode:Ti,isWhiteSpace:Io,lib:{mdurl:pb,ucmicro:yb},normalizeReference:Or,unescapeAll:eo,unescapeMd:Mb},Symbol.toStringTag,{value:"Module"}));function jb(t,r,n){let o,a,i,l;const s=t.posMax,u=t.pos;for(t.pos=r+1,o=1;t.pos<s;){if(i=t.src.charCodeAt(t.pos),i===93&&(o--,o===0)){a=!0;break}if(l=t.pos,t.md.inline.skipToken(t),i===91){if(l===t.pos-1)o++;else if(n)return t.pos=u,-1}}let h=-1;return a&&(h=t.pos),t.pos=u,h}function Hb(t,r,n){let o,a=r;const i={ok:!1,pos:0,str:""};if(t.charCodeAt(a)===60){for(a++;a<n;){if(o=t.charCodeAt(a),o===10||o===60)return i;if(o===62)return i.pos=a+1,i.str=eo(t.slice(r+1,a)),i.ok=!0,i;if(o===92&&a+1<n){a+=2;continue}a++}return i}let l=0;for(;a<n&&(o=t.charCodeAt(a),!(o===32||o<32||o===127));){if(o===92&&a+1<n){if(t.charCodeAt(a+1)===32)break;a+=2;continue}if(o===40&&(l++,l>32))return i;if(o===41){if(l===0)break;l--}a++}return r===a||l!==0||(i.str=eo(t.slice(r,a)),i.pos=a,i.ok=!0),i}function Gb(t,r,n,o){let a,i=r;const l={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)l.str=o.str,l.marker=o.marker;else{if(i>=n)return l;let s=t.charCodeAt(i);if(s!==34&&s!==39&&s!==40)return l;r++,i++,s===40&&(s=41),l.marker=s}for(;i<n;){if(a=t.charCodeAt(i),a===l.marker)return l.pos=i+1,l.str+=eo(t.slice(r,i)),l.ok=!0,l;if(a===40&&l.marker===41)return l;a===92&&i+1<n&&i++,i++}return l.can_continue=!0,l.str+=eo(t.slice(r,i)),l}const Kb=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:Hb,parseLinkLabel:jb,parseLinkTitle:Gb},Symbol.toStringTag,{value:"Module"})),sn={};sn.code_inline=function(t,r,n,o,a){const i=t[r];return"<code"+a.renderAttrs(i)+">"+In(i.content)+"</code>"},sn.code_block=function(t,r,n,o,a){const i=t[r];return"<pre"+a.renderAttrs(i)+"><code>"+In(t[r].content)+`</code></pre>
|
|
147
147
|
`},sn.fence=function(t,r,n,o,a){const i=t[r],l=i.info?eo(i.info).trim():"";let s="",u="";if(l){const d=l.split(/(\s+)/g);s=d[0],u=d.slice(2).join("")}let h;if(n.highlight?h=n.highlight(i.content,s,u)||In(i.content):h=In(i.content),h.indexOf("<pre")===0)return h+`
|
|
148
148
|
`;if(l){const d=i.attrIndex("class"),m=i.attrs?i.attrs.slice():[];d<0?m.push(["class",n.langPrefix+s]):(m[d]=m[d].slice(),m[d][1]+=" "+n.langPrefix+s);const c={attrs:m};return`<pre><code${a.renderAttrs(c)}>${h}</code></pre>
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
`;break}return o},to.prototype.render=function(t,r,n){let o="";const a=this.rules;for(let i=0,l=t.length;i<l;i++){const s=t[i].type;s==="inline"?o+=this.renderInline(t[i].children,r,n):typeof a[s]<"u"?o+=a[s](t,i,r,n,this):o+=this.renderToken(t,i,r,n)}return o};function Ot(){this.__rules__=[],this.__cache__=null}Ot.prototype.__find__=function(t){for(let r=0;r<this.__rules__.length;r++)if(this.__rules__[r].name===t)return r;return-1},Ot.prototype.__compile__=function(){const t=this,r=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(o){r.indexOf(o)<0&&r.push(o)})}),t.__cache__={},r.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(o){o.enabled&&(n&&o.alt.indexOf(n)<0||t.__cache__[n].push(o.fn))})})},Ot.prototype.at=function(t,r,n){const o=this.__find__(t),a=n||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__[o].fn=r,this.__rules__[o].alt=a.alt||[],this.__cache__=null},Ot.prototype.before=function(t,r,n,o){const a=this.__find__(t),i=o||{};if(a===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(a,0,{name:r,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},Ot.prototype.after=function(t,r,n,o){const a=this.__find__(t),i=o||{};if(a===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(a+1,0,{name:r,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},Ot.prototype.push=function(t,r,n){const o=n||{};this.__rules__.push({name:t,enabled:!0,fn:r,alt:o.alt||[]}),this.__cache__=null},Ot.prototype.enable=function(t,r){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(o){const a=this.__find__(o);if(a<0){if(r)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[a].enabled=!0,n.push(o)},this),this.__cache__=null,n},Ot.prototype.enableOnly=function(t,r){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,r)},Ot.prototype.disable=function(t,r){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(o){const a=this.__find__(o);if(a<0){if(r)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[a].enabled=!1,n.push(o)},this),this.__cache__=null,n},Ot.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function Zt(t,r,n){this.type=t,this.tag=r,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Zt.prototype.attrIndex=function(r){if(!this.attrs)return-1;const n=this.attrs;for(let o=0,a=n.length;o<a;o++)if(n[o][0]===r)return o;return-1},Zt.prototype.attrPush=function(r){this.attrs?this.attrs.push(r):this.attrs=[r]},Zt.prototype.attrSet=function(r,n){const o=this.attrIndex(r),a=[r,n];o<0?this.attrPush(a):this.attrs[o]=a},Zt.prototype.attrGet=function(r){const n=this.attrIndex(r);let o=null;return n>=0&&(o=this.attrs[n][1]),o},Zt.prototype.attrJoin=function(r,n){const o=this.attrIndex(r);o<0?this.attrPush([r,n]):this.attrs[o][1]=this.attrs[o][1]+" "+n};function hu(t,r,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=r}hu.prototype.Token=Zt;const Xb=/\r\n?|\n/g,Wb=/\0/g;function Qb(t){let r;r=t.src.replace(Xb,`
|
|
159
159
|
`),r=r.replace(Wb,"�"),t.src=r}function Zb(t){let r;t.inlineMode?(r=new t.Token("inline","",0),r.content=t.src,r.map=[0,1],r.children=[],t.tokens.push(r)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function Jb(t){const r=t.tokens;for(let n=0,o=r.length;n<o;n++){const a=r[n];a.type==="inline"&&t.md.inline.parse(a.content,t.md,t.env,a.children)}}function Yb(t){return/^<a[>\s]/i.test(t)}function ex(t){return/^<\/a\s*>/i.test(t)}function tx(t){const r=t.tokens;if(t.md.options.linkify)for(let n=0,o=r.length;n<o;n++){if(r[n].type!=="inline"||!t.md.linkify.pretest(r[n].content))continue;let a=r[n].children,i=0;for(let l=a.length-1;l>=0;l--){const s=a[l];if(s.type==="link_close"){for(l--;a[l].level!==s.level&&a[l].type!=="link_open";)l--;continue}if(s.type==="html_inline"&&(Yb(s.content)&&i>0&&i--,ex(s.content)&&i++),!(i>0)&&s.type==="text"&&t.md.linkify.test(s.content)){const u=s.content;let h=t.md.linkify.match(u);const d=[];let m=s.level,c=0;h.length>0&&h[0].index===0&&l>0&&a[l-1].type==="text_special"&&(h=h.slice(1));for(let y=0;y<h.length;y++){const f=h[y].url,b=t.md.normalizeLink(f);if(!t.md.validateLink(b))continue;let p=h[y].text;h[y].schema?h[y].schema==="mailto:"&&!/^mailto:/i.test(p)?p=t.md.normalizeLinkText("mailto:"+p).replace(/^mailto:/,""):p=t.md.normalizeLinkText(p):p=t.md.normalizeLinkText("http://"+p).replace(/^http:\/\//,"");const x=h[y].index;if(x>c){const E=new t.Token("text","",0);E.content=u.slice(c,x),E.level=m,d.push(E)}const g=new t.Token("link_open","a",1);g.attrs=[["href",b]],g.level=m++,g.markup="linkify",g.info="auto",d.push(g);const C=new t.Token("text","",0);C.content=p,C.level=m,d.push(C);const _=new t.Token("link_close","a",-1);_.level=--m,_.markup="linkify",_.info="auto",d.push(_),c=h[y].lastIndex}if(c<u.length){const y=new t.Token("text","",0);y.content=u.slice(c),y.level=m,d.push(y)}r[n].children=a=du(a,l,d)}}}}const pu=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,nx=/\((c|tm|r)\)/i,ox=/\((c|tm|r)\)/ig,rx={c:"©",r:"®",tm:"™"};function ax(t,r){return rx[r.toLowerCase()]}function ix(t){let r=0;for(let n=t.length-1;n>=0;n--){const o=t[n];o.type==="text"&&!r&&(o.content=o.content.replace(ox,ax)),o.type==="link_open"&&o.info==="auto"&&r--,o.type==="link_close"&&o.info==="auto"&&r++}}function lx(t){let r=0;for(let n=t.length-1;n>=0;n--){const o=t[n];o.type==="text"&&!r&&pu.test(o.content)&&(o.content=o.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),o.type==="link_open"&&o.info==="auto"&&r--,o.type==="link_close"&&o.info==="auto"&&r++}}function sx(t){let r;if(t.md.options.typographer)for(r=t.tokens.length-1;r>=0;r--)t.tokens[r].type==="inline"&&(nx.test(t.tokens[r].content)&&ix(t.tokens[r].children),pu.test(t.tokens[r].content)&&lx(t.tokens[r].children))}const cx=/['"]/,mu=/['"]/g,yu="’";function Dr(t,r,n){return t.slice(0,r)+n+t.slice(r+1)}function ux(t,r){let n;const o=[];for(let a=0;a<t.length;a++){const i=t[a],l=t[a].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(o.length=n+1,i.type!=="text")continue;let s=i.content,u=0,h=s.length;e:for(;u<h;){mu.lastIndex=u;const d=mu.exec(s);if(!d)break;let m=!0,c=!0;u=d.index+1;const y=d[0]==="'";let f=32;if(d.index-1>=0)f=s.charCodeAt(d.index-1);else for(n=a-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){f=t[n].content.charCodeAt(t[n].content.length-1);break}let b=32;if(u<h)b=s.charCodeAt(u);else for(n=a+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){b=t[n].content.charCodeAt(0);break}const p=Oo(f)||To(String.fromCharCode(f)),x=Oo(b)||To(String.fromCharCode(b)),g=Io(f),C=Io(b);if(C?m=!1:x&&(g||p||(m=!1)),g?c=!1:p&&(C||x||(c=!1)),b===34&&d[0]==='"'&&f>=48&&f<=57&&(c=m=!1),m&&c&&(m=p,c=x),!m&&!c){y&&(i.content=Dr(i.content,d.index,yu));continue}if(c)for(n=o.length-1;n>=0;n--){let _=o[n];if(o[n].level<l)break;if(_.single===y&&o[n].level===l){_=o[n];let E,A;y?(E=r.md.options.quotes[2],A=r.md.options.quotes[3]):(E=r.md.options.quotes[0],A=r.md.options.quotes[1]),i.content=Dr(i.content,d.index,A),t[_.token].content=Dr(t[_.token].content,_.pos,E),u+=A.length-1,_.token===a&&(u+=E.length-1),s=i.content,h=s.length,o.length=n;continue e}}m?o.push({token:a,pos:d.index,single:y,level:l}):c&&y&&(i.content=Dr(i.content,d.index,yu))}}}function dx(t){if(t.md.options.typographer)for(let r=t.tokens.length-1;r>=0;r--)t.tokens[r].type!=="inline"||!cx.test(t.tokens[r].content)||ux(t.tokens[r].children,t)}function fx(t){let r,n;const o=t.tokens,a=o.length;for(let i=0;i<a;i++){if(o[i].type!=="inline")continue;const l=o[i].children,s=l.length;for(r=0;r<s;r++)l[r].type==="text_special"&&(l[r].type="text");for(r=n=0;r<s;r++)l[r].type==="text"&&r+1<s&&l[r+1].type==="text"?l[r+1].content=l[r].content+l[r+1].content:(r!==n&&(l[n]=l[r]),n++);r!==n&&(l.length=n)}}const Oi=[["normalize",Qb],["block",Zb],["inline",Jb],["linkify",tx],["replacements",sx],["smartquotes",dx],["text_join",fx]];function Di(){this.ruler=new Ot;for(let t=0;t<Oi.length;t++)this.ruler.push(Oi[t][0],Oi[t][1])}Di.prototype.process=function(t){const r=this.ruler.getRules("");for(let n=0,o=r.length;n<o;n++)r[n](t)},Di.prototype.State=hu;function cn(t,r,n,o){this.src=t,this.md=r,this.env=n,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const a=this.src;for(let i=0,l=0,s=0,u=0,h=a.length,d=!1;l<h;l++){const m=a.charCodeAt(l);if(!d)if(je(m)){s++,m===9?u+=4-u%4:u++;continue}else d=!0;(m===10||l===h-1)&&(m!==10&&l++,this.bMarks.push(i),this.eMarks.push(l),this.tShift.push(s),this.sCount.push(u),this.bsCount.push(0),d=!1,s=0,u=0,i=l+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}cn.prototype.push=function(t,r,n){const o=new Zt(t,r,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o},cn.prototype.isEmpty=function(r){return this.bMarks[r]+this.tShift[r]>=this.eMarks[r]},cn.prototype.skipEmptyLines=function(r){for(let n=this.lineMax;r<n&&!(this.bMarks[r]+this.tShift[r]<this.eMarks[r]);r++);return r},cn.prototype.skipSpaces=function(r){for(let n=this.src.length;r<n;r++){const o=this.src.charCodeAt(r);if(!je(o))break}return r},cn.prototype.skipSpacesBack=function(r,n){if(r<=n)return r;for(;r>n;)if(!je(this.src.charCodeAt(--r)))return r+1;return r},cn.prototype.skipChars=function(r,n){for(let o=this.src.length;r<o&&this.src.charCodeAt(r)===n;r++);return r},cn.prototype.skipCharsBack=function(r,n,o){if(r<=o)return r;for(;r>o;)if(n!==this.src.charCodeAt(--r))return r+1;return r},cn.prototype.getLines=function(r,n,o,a){if(r>=n)return"";const i=new Array(n-r);for(let l=0,s=r;s<n;s++,l++){let u=0;const h=this.bMarks[s];let d=h,m;for(s+1<n||a?m=this.eMarks[s]+1:m=this.eMarks[s];d<m&&u<o;){const c=this.src.charCodeAt(d);if(je(c))c===9?u+=4-(u+this.bsCount[s])%4:u++;else if(d-h<this.tShift[s])u++;else break;d++}u>o?i[l]=new Array(u-o+1).join(" ")+this.src.slice(d,m):i[l]=this.src.slice(d,m)}return i.join("")},cn.prototype.Token=Zt;const hx=65536;function Vi(t,r){const n=t.bMarks[r]+t.tShift[r],o=t.eMarks[r];return t.src.slice(n,o)}function gu(t){const r=[],n=t.length;let o=0,a=t.charCodeAt(o),i=!1,l=0,s="";for(;o<n;)a===124&&(i?(s+=t.substring(l,o-1),l=o):(r.push(s+t.substring(l,o)),s="",l=o+1)),i=a===92,o++,a=t.charCodeAt(o);return r.push(s+t.substring(l)),r}function px(t,r,n,o){if(r+2>n)return!1;let a=r+1;if(t.sCount[a]<t.blkIndent||t.sCount[a]-t.blkIndent>=4)return!1;let i=t.bMarks[a]+t.tShift[a];if(i>=t.eMarks[a])return!1;const l=t.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58||i>=t.eMarks[a])return!1;const s=t.src.charCodeAt(i++);if(s!==124&&s!==45&&s!==58&&!je(s)||l===45&&je(s))return!1;for(;i<t.eMarks[a];){const _=t.src.charCodeAt(i);if(_!==124&&_!==45&&_!==58&&!je(_))return!1;i++}let u=Vi(t,r+1),h=u.split("|");const d=[];for(let _=0;_<h.length;_++){const E=h[_].trim();if(!E){if(_===0||_===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(E))return!1;E.charCodeAt(E.length-1)===58?d.push(E.charCodeAt(0)===58?"center":"right"):E.charCodeAt(0)===58?d.push("left"):d.push("")}if(u=Vi(t,r).trim(),u.indexOf("|")===-1||t.sCount[r]-t.blkIndent>=4)return!1;h=gu(u),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop();const m=h.length;if(m===0||m!==d.length)return!1;if(o)return!0;const c=t.parentType;t.parentType="table";const y=t.md.block.ruler.getRules("blockquote"),f=t.push("table_open","table",1),b=[r,0];f.map=b;const p=t.push("thead_open","thead",1);p.map=[r,r+1];const x=t.push("tr_open","tr",1);x.map=[r,r+1];for(let _=0;_<h.length;_++){const E=t.push("th_open","th",1);d[_]&&(E.attrs=[["style","text-align:"+d[_]]]);const A=t.push("inline","",0);A.content=h[_].trim(),A.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let g,C=0;for(a=r+2;a<n&&!(t.sCount[a]<t.blkIndent);a++){let _=!1;for(let A=0,k=y.length;A<k;A++)if(y[A](t,a,n,!0)){_=!0;break}if(_||(u=Vi(t,a).trim(),!u)||t.sCount[a]-t.blkIndent>=4||(h=gu(u),h.length&&h[0]===""&&h.shift(),h.length&&h[h.length-1]===""&&h.pop(),C+=m-h.length,C>hx))break;if(a===r+2){const A=t.push("tbody_open","tbody",1);A.map=g=[r+2,0]}const E=t.push("tr_open","tr",1);E.map=[a,a+1];for(let A=0;A<m;A++){const k=t.push("td_open","td",1);d[A]&&(k.attrs=[["style","text-align:"+d[A]]]);const B=t.push("inline","",0);B.content=h[A]?h[A].trim():"",B.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return g&&(t.push("tbody_close","tbody",-1),g[1]=a),t.push("table_close","table",-1),b[1]=a,t.parentType=c,t.line=a,!0}function mx(t,r,n){if(t.sCount[r]-t.blkIndent<4)return!1;let o=r+1,a=o;for(;o<n;){if(t.isEmpty(o)){o++;continue}if(t.sCount[o]-t.blkIndent>=4){o++,a=o;continue}break}t.line=a;const i=t.push("code_block","code",0);return i.content=t.getLines(r,a,4+t.blkIndent,!1)+`
|
|
160
160
|
`,i.map=[r,t.line],!0}function yx(t,r,n,o){let a=t.bMarks[r]+t.tShift[r],i=t.eMarks[r];if(t.sCount[r]-t.blkIndent>=4||a+3>i)return!1;const l=t.src.charCodeAt(a);if(l!==126&&l!==96)return!1;let s=a;a=t.skipChars(a,l);let u=a-s;if(u<3)return!1;const h=t.src.slice(s,a),d=t.src.slice(a,i);if(l===96&&d.indexOf(String.fromCharCode(l))>=0)return!1;if(o)return!0;let m=r,c=!1;for(;m++,!(m>=n||(a=s=t.bMarks[m]+t.tShift[m],i=t.eMarks[m],a<i&&t.sCount[m]<t.blkIndent));)if(t.src.charCodeAt(a)===l&&!(t.sCount[m]-t.blkIndent>=4)&&(a=t.skipChars(a,l),!(a-s<u)&&(a=t.skipSpaces(a),!(a<i)))){c=!0;break}u=t.sCount[r],t.line=m+(c?1:0);const y=t.push("fence","code",0);return y.info=d,y.content=t.getLines(r+1,m,u,!0),y.markup=h,y.map=[r,t.line],!0}function gx(t,r,n,o){let a=t.bMarks[r]+t.tShift[r],i=t.eMarks[r];const l=t.lineMax;if(t.sCount[r]-t.blkIndent>=4||t.src.charCodeAt(a)!==62)return!1;if(o)return!0;const s=[],u=[],h=[],d=[],m=t.md.block.ruler.getRules("blockquote"),c=t.parentType;t.parentType="blockquote";let y=!1,f;for(f=r;f<n;f++){const C=t.sCount[f]<t.blkIndent;if(a=t.bMarks[f]+t.tShift[f],i=t.eMarks[f],a>=i)break;if(t.src.charCodeAt(a++)===62&&!C){let E=t.sCount[f]+1,A,k;t.src.charCodeAt(a)===32?(a++,E++,k=!1,A=!0):t.src.charCodeAt(a)===9?(A=!0,(t.bsCount[f]+E)%4===3?(a++,E++,k=!1):k=!0):A=!1;let B=E;for(s.push(t.bMarks[f]),t.bMarks[f]=a;a<i;){const D=t.src.charCodeAt(a);if(je(D))D===9?B+=4-(B+t.bsCount[f]+(k?1:0))%4:B++;else break;a++}y=a>=i,u.push(t.bsCount[f]),t.bsCount[f]=t.sCount[f]+1+(A?1:0),h.push(t.sCount[f]),t.sCount[f]=B-E,d.push(t.tShift[f]),t.tShift[f]=a-t.bMarks[f];continue}if(y)break;let _=!1;for(let E=0,A=m.length;E<A;E++)if(m[E](t,f,n,!0)){_=!0;break}if(_){t.lineMax=f,t.blkIndent!==0&&(s.push(t.bMarks[f]),u.push(t.bsCount[f]),d.push(t.tShift[f]),h.push(t.sCount[f]),t.sCount[f]-=t.blkIndent);break}s.push(t.bMarks[f]),u.push(t.bsCount[f]),d.push(t.tShift[f]),h.push(t.sCount[f]),t.sCount[f]=-1}const b=t.blkIndent;t.blkIndent=0;const p=t.push("blockquote_open","blockquote",1);p.markup=">";const x=[r,0];p.map=x,t.md.block.tokenize(t,r,f);const g=t.push("blockquote_close","blockquote",-1);g.markup=">",t.lineMax=l,t.parentType=c,x[1]=t.line;for(let C=0;C<d.length;C++)t.bMarks[C+r]=s[C],t.tShift[C+r]=d[C],t.sCount[C+r]=h[C],t.bsCount[C+r]=u[C];return t.blkIndent=b,!0}function bx(t,r,n,o){const a=t.eMarks[r];if(t.sCount[r]-t.blkIndent>=4)return!1;let i=t.bMarks[r]+t.tShift[r];const l=t.src.charCodeAt(i++);if(l!==42&&l!==45&&l!==95)return!1;let s=1;for(;i<a;){const h=t.src.charCodeAt(i++);if(h!==l&&!je(h))return!1;h===l&&s++}if(s<3)return!1;if(o)return!0;t.line=r+1;const u=t.push("hr","hr",0);return u.map=[r,t.line],u.markup=Array(s+1).join(String.fromCharCode(l)),!0}function bu(t,r){const n=t.eMarks[r];let o=t.bMarks[r]+t.tShift[r];const a=t.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==43)return-1;if(o<n){const i=t.src.charCodeAt(o);if(!je(i))return-1}return o}function xu(t,r){const n=t.bMarks[r]+t.tShift[r],o=t.eMarks[r];let a=n;if(a+1>=o)return-1;let i=t.src.charCodeAt(a++);if(i<48||i>57)return-1;for(;;){if(a>=o)return-1;if(i=t.src.charCodeAt(a++),i>=48&&i<=57){if(a-n>=10)return-1;continue}if(i===41||i===46)break;return-1}return a<o&&(i=t.src.charCodeAt(a),!je(i))?-1:a}function xx(t,r){const n=t.level+2;for(let o=r+2,a=t.tokens.length-2;o<a;o++)t.tokens[o].level===n&&t.tokens[o].type==="paragraph_open"&&(t.tokens[o+2].hidden=!0,t.tokens[o].hidden=!0,o+=2)}function _x(t,r,n,o){let a,i,l,s,u=r,h=!0;if(t.sCount[u]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]<t.blkIndent)return!1;let d=!1;o&&t.parentType==="paragraph"&&t.sCount[u]>=t.blkIndent&&(d=!0);let m,c,y;if((y=xu(t,u))>=0){if(m=!0,l=t.bMarks[u]+t.tShift[u],c=Number(t.src.slice(l,y-1)),d&&c!==1)return!1}else if((y=bu(t,u))>=0)m=!1;else return!1;if(d&&t.skipSpaces(y)>=t.eMarks[u])return!1;if(o)return!0;const f=t.src.charCodeAt(y-1),b=t.tokens.length;m?(s=t.push("ordered_list_open","ol",1),c!==1&&(s.attrs=[["start",c]])):s=t.push("bullet_list_open","ul",1);const p=[u,0];s.map=p,s.markup=String.fromCharCode(f);let x=!1;const g=t.md.block.ruler.getRules("list"),C=t.parentType;for(t.parentType="list";u<n;){i=y,a=t.eMarks[u];const _=t.sCount[u]+y-(t.bMarks[u]+t.tShift[u]);let E=_;for(;i<a;){const z=t.src.charCodeAt(i);if(z===9)E+=4-(E+t.bsCount[u])%4;else if(z===32)E++;else break;i++}const A=i;let k;A>=a?k=1:k=E-_,k>4&&(k=1);const B=_+k;s=t.push("list_item_open","li",1),s.markup=String.fromCharCode(f);const D=[u,0];s.map=D,m&&(s.info=t.src.slice(l,y-1));const w=t.tight,v=t.tShift[u],S=t.sCount[u],I=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=B,t.tight=!0,t.tShift[u]=A-t.bMarks[u],t.sCount[u]=E,A>=a&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,u,n,!0),(!t.tight||x)&&(h=!1),x=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=I,t.tShift[u]=v,t.sCount[u]=S,t.tight=w,s=t.push("list_item_close","li",-1),s.markup=String.fromCharCode(f),u=t.line,D[1]=u,u>=n||t.sCount[u]<t.blkIndent||t.sCount[u]-t.blkIndent>=4)break;let R=!1;for(let z=0,$=g.length;z<$;z++)if(g[z](t,u,n,!0)){R=!0;break}if(R)break;if(m){if(y=xu(t,u),y<0)break;l=t.bMarks[u]+t.tShift[u]}else if(y=bu(t,u),y<0)break;if(f!==t.src.charCodeAt(y-1))break}return m?s=t.push("ordered_list_close","ol",-1):s=t.push("bullet_list_close","ul",-1),s.markup=String.fromCharCode(f),p[1]=u,t.line=u,t.parentType=C,h&&xx(t,b),!0}function Cx(t,r,n,o){let a=t.bMarks[r]+t.tShift[r],i=t.eMarks[r],l=r+1;if(t.sCount[r]-t.blkIndent>=4||t.src.charCodeAt(a)!==91)return!1;function s(g){const C=t.lineMax;if(g>=C||t.isEmpty(g))return null;let _=!1;if(t.sCount[g]-t.blkIndent>3&&(_=!0),t.sCount[g]<0&&(_=!0),!_){const k=t.md.block.ruler.getRules("reference"),B=t.parentType;t.parentType="reference";let D=!1;for(let w=0,v=k.length;w<v;w++)if(k[w](t,g,C,!0)){D=!0;break}if(t.parentType=B,D)return null}const E=t.bMarks[g]+t.tShift[g],A=t.eMarks[g];return t.src.slice(E,A+1)}let u=t.src.slice(a,i+1);i=u.length;let h=-1;for(a=1;a<i;a++){const g=u.charCodeAt(a);if(g===91)return!1;if(g===93){h=a;break}else if(g===10){const C=s(l);C!==null&&(u+=C,i=u.length,l++)}else if(g===92&&(a++,a<i&&u.charCodeAt(a)===10)){const C=s(l);C!==null&&(u+=C,i=u.length,l++)}}if(h<0||u.charCodeAt(h+1)!==58)return!1;for(a=h+2;a<i;a++){const g=u.charCodeAt(a);if(g===10){const C=s(l);C!==null&&(u+=C,i=u.length,l++)}else if(!je(g))break}const d=t.md.helpers.parseLinkDestination(u,a,i);if(!d.ok)return!1;const m=t.md.normalizeLink(d.str);if(!t.md.validateLink(m))return!1;a=d.pos;const c=a,y=l,f=a;for(;a<i;a++){const g=u.charCodeAt(a);if(g===10){const C=s(l);C!==null&&(u+=C,i=u.length,l++)}else if(!je(g))break}let b=t.md.helpers.parseLinkTitle(u,a,i);for(;b.can_continue;){const g=s(l);if(g===null)break;u+=g,a=i,i=u.length,l++,b=t.md.helpers.parseLinkTitle(u,a,i,b)}let p;for(a<i&&f!==a&&b.ok?(p=b.str,a=b.pos):(p="",a=c,l=y);a<i;){const g=u.charCodeAt(a);if(!je(g))break;a++}if(a<i&&u.charCodeAt(a)!==10&&p)for(p="",a=c,l=y;a<i;){const g=u.charCodeAt(a);if(!je(g))break;a++}if(a<i&&u.charCodeAt(a)!==10)return!1;const x=Or(u.slice(1,h));return x?(o||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[x]>"u"&&(t.env.references[x]={title:p,href:m}),t.line=l),!0):!1}const Ex=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],kx="[a-zA-Z_:][a-zA-Z0-9:._-]*",vx="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",_u="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+kx+"(?:\\s*=\\s*"+vx+")?)")+"*\\s*\\/?>",Cu="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Ax="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",wx="<[?][\\s\\S]*?[?]>",Nx="<![A-Za-z][^>]*>",Sx="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",Bx=new RegExp("^(?:"+_u+"|"+Cu+"|"+Ax+"|"+wx+"|"+Nx+"|"+Sx+")"),Ix=new RegExp("^(?:"+_u+"|"+Cu+")"),no=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Ex.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Ix.source+"\\s*$"),/^$/,!1]];function Tx(t,r,n,o){let a=t.bMarks[r]+t.tShift[r],i=t.eMarks[r];if(t.sCount[r]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(a)!==60)return!1;let l=t.src.slice(a,i),s=0;for(;s<no.length&&!no[s][0].test(l);s++);if(s===no.length)return!1;if(o)return no[s][2];let u=r+1;if(!no[s][1].test(l)){for(;u<n&&!(t.sCount[u]<t.blkIndent);u++)if(a=t.bMarks[u]+t.tShift[u],i=t.eMarks[u],l=t.src.slice(a,i),no[s][1].test(l)){l.length!==0&&u++;break}}t.line=u;const h=t.push("html_block","",0);return h.map=[r,u],h.content=t.getLines(r,u,t.blkIndent,!0),!0}function Ox(t,r,n,o){let a=t.bMarks[r]+t.tShift[r],i=t.eMarks[r];if(t.sCount[r]-t.blkIndent>=4)return!1;let l=t.src.charCodeAt(a);if(l!==35||a>=i)return!1;let s=1;for(l=t.src.charCodeAt(++a);l===35&&a<i&&s<=6;)s++,l=t.src.charCodeAt(++a);if(s>6||a<i&&!je(l))return!1;if(o)return!0;i=t.skipSpacesBack(i,a);const u=t.skipCharsBack(i,35,a);u>a&&je(t.src.charCodeAt(u-1))&&(i=u),t.line=r+1;const h=t.push("heading_open","h"+String(s),1);h.markup="########".slice(0,s),h.map=[r,t.line];const d=t.push("inline","",0);d.content=t.src.slice(a,i).trim(),d.map=[r,t.line],d.children=[];const m=t.push("heading_close","h"+String(s),-1);return m.markup="########".slice(0,s),!0}function Dx(t,r,n){const o=t.md.block.ruler.getRules("paragraph");if(t.sCount[r]-t.blkIndent>=4)return!1;const a=t.parentType;t.parentType="paragraph";let i=0,l,s=r+1;for(;s<n&&!t.isEmpty(s);s++){if(t.sCount[s]-t.blkIndent>3)continue;if(t.sCount[s]>=t.blkIndent){let y=t.bMarks[s]+t.tShift[s];const f=t.eMarks[s];if(y<f&&(l=t.src.charCodeAt(y),(l===45||l===61)&&(y=t.skipChars(y,l),y=t.skipSpaces(y),y>=f))){i=l===61?1:2;break}}if(t.sCount[s]<0)continue;let c=!1;for(let y=0,f=o.length;y<f;y++)if(o[y](t,s,n,!0)){c=!0;break}if(c)break}if(!i)return!1;const u=t.getLines(r,s,t.blkIndent,!1).trim();t.line=s+1;const h=t.push("heading_open","h"+String(i),1);h.markup=String.fromCharCode(l),h.map=[r,t.line];const d=t.push("inline","",0);d.content=u,d.map=[r,t.line-1],d.children=[];const m=t.push("heading_close","h"+String(i),-1);return m.markup=String.fromCharCode(l),t.parentType=a,!0}function Vx(t,r,n){const o=t.md.block.ruler.getRules("paragraph"),a=t.parentType;let i=r+1;for(t.parentType="paragraph";i<n&&!t.isEmpty(i);i++){if(t.sCount[i]-t.blkIndent>3||t.sCount[i]<0)continue;let h=!1;for(let d=0,m=o.length;d<m;d++)if(o[d](t,i,n,!0)){h=!0;break}if(h)break}const l=t.getLines(r,i,t.blkIndent,!1).trim();t.line=i;const s=t.push("paragraph_open","p",1);s.map=[r,t.line];const u=t.push("inline","",0);return u.content=l,u.map=[r,t.line],u.children=[],t.push("paragraph_close","p",-1),t.parentType=a,!0}const Vr=[["table",px,["paragraph","reference"]],["code",mx],["fence",yx,["paragraph","reference","blockquote","list"]],["blockquote",gx,["paragraph","reference","blockquote","list"]],["hr",bx,["paragraph","reference","blockquote","list"]],["list",_x,["paragraph","reference","blockquote"]],["reference",Cx],["html_block",Tx,["paragraph","reference","blockquote"]],["heading",Ox,["paragraph","reference","blockquote"]],["lheading",Dx],["paragraph",Vx]];function Fr(){this.ruler=new Ot;for(let t=0;t<Vr.length;t++)this.ruler.push(Vr[t][0],Vr[t][1],{alt:(Vr[t][2]||[]).slice()})}Fr.prototype.tokenize=function(t,r,n){const o=this.ruler.getRules(""),a=o.length,i=t.md.options.maxNesting;let l=r,s=!1;for(;l<n&&(t.line=l=t.skipEmptyLines(l),!(l>=n||t.sCount[l]<t.blkIndent));){if(t.level>=i){t.line=n;break}const u=t.line;let h=!1;for(let d=0;d<a;d++)if(h=o[d](t,l,n,!1),h){if(u>=t.line)throw new Error("block rule didn't increment state.line");break}if(!h)throw new Error("none of the block rules matched");t.tight=!s,t.isEmpty(t.line-1)&&(s=!0),l=t.line,l<n&&t.isEmpty(l)&&(s=!0,l++,t.line=l)}},Fr.prototype.parse=function(t,r,n,o){if(!t)return;const a=new this.State(t,r,n,o);this.tokenize(a,a.line,a.lineMax)},Fr.prototype.State=cn;function Do(t,r,n,o){this.src=t,this.env=n,this.md=r,this.tokens=o,this.tokens_meta=Array(o.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Do.prototype.pushPending=function(){const t=new Zt("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},Do.prototype.push=function(t,r,n){this.pending&&this.pushPending();const o=new Zt(t,r,n);let a=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],a={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(a),o},Do.prototype.scanDelims=function(t,r){const n=this.posMax,o=this.src.charCodeAt(t),a=t>0?this.src.charCodeAt(t-1):32;let i=t;for(;i<n&&this.src.charCodeAt(i)===o;)i++;const l=i-t,s=i<n?this.src.charCodeAt(i):32,u=Oo(a)||To(String.fromCharCode(a)),h=Oo(s)||To(String.fromCharCode(s)),d=Io(a),m=Io(s),c=!m&&(!h||d||u),y=!d&&(!u||m||h);return{can_open:c&&(r||!y||u),can_close:y&&(r||!c||h),length:l}},Do.prototype.Token=Zt;function Fx(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Mx(t,r){let n=t.pos;for(;n<t.posMax&&!Fx(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(r||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const Rx=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Lx(t,r){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,o=t.posMax;if(n+3>o||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const a=t.pending.match(Rx);if(!a)return!1;const i=a[1],l=t.md.linkify.matchAtStart(t.src.slice(n-i.length));if(!l)return!1;let s=l.url;if(s.length<=i.length)return!1;s=s.replace(/\*+$/,"");const u=t.md.normalizeLink(s);if(!t.md.validateLink(u))return!1;if(!r){t.pending=t.pending.slice(0,-i.length);const h=t.push("link_open","a",1);h.attrs=[["href",u]],h.markup="linkify",h.info="auto";const d=t.push("text","",0);d.content=t.md.normalizeLinkText(s);const m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=s.length-i.length,!0}function Px(t,r){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const o=t.pending.length-1,a=t.posMax;if(!r)if(o>=0&&t.pending.charCodeAt(o)===32)if(o>=1&&t.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&t.pending.charCodeAt(i-1)===32;)i--;t.pending=t.pending.slice(0,i),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<a&&je(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const Fi=[];for(let t=0;t<256;t++)Fi.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){Fi[t.charCodeAt(0)]=1});function qx(t,r){let n=t.pos;const o=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=o))return!1;let a=t.src.charCodeAt(n);if(a===10){for(r||t.push("hardbreak","br",0),n++;n<o&&(a=t.src.charCodeAt(n),!!je(a));)n++;return t.pos=n,!0}let i=t.src[n];if(a>=55296&&a<=56319&&n+1<o){const s=t.src.charCodeAt(n+1);s>=56320&&s<=57343&&(i+=t.src[n+1],n++)}const l="\\"+i;if(!r){const s=t.push("text_special","",0);a<256&&Fi[a]!==0?s.content=i:s.content=l,s.markup=l,s.info="escape"}return t.pos=n+1,!0}function $x(t,r){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const a=n;n++;const i=t.posMax;for(;n<i&&t.src.charCodeAt(n)===96;)n++;const l=t.src.slice(a,n),s=l.length;if(t.backticksScanned&&(t.backticks[s]||0)<=a)return r||(t.pending+=l),t.pos+=s,!0;let u=n,h;for(;(h=t.src.indexOf("`",u))!==-1;){for(u=h+1;u<i&&t.src.charCodeAt(u)===96;)u++;const d=u-h;if(d===s){if(!r){const m=t.push("code_inline","code",0);m.markup=l,m.content=t.src.slice(n,h).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=u,!0}t.backticks[d]=h}return t.backticksScanned=!0,r||(t.pending+=l),t.pos+=s,!0}function Ux(t,r){const n=t.pos,o=t.src.charCodeAt(n);if(r||o!==126)return!1;const a=t.scanDelims(t.pos,!0);let i=a.length;const l=String.fromCharCode(o);if(i<2)return!1;let s;i%2&&(s=t.push("text","",0),s.content=l,i--);for(let u=0;u<i;u+=2)s=t.push("text","",0),s.content=l+l,t.delimiters.push({marker:o,length:0,token:t.tokens.length-1,end:-1,open:a.can_open,close:a.can_close});return t.pos+=a.length,!0}function Eu(t,r){let n;const o=[],a=r.length;for(let i=0;i<a;i++){const l=r[i];if(l.marker!==126||l.end===-1)continue;const s=r[l.end];n=t.tokens[l.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[s.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[s.token-1].type==="text"&&t.tokens[s.token-1].content==="~"&&o.push(s.token-1)}for(;o.length;){const i=o.pop();let l=i+1;for(;l<t.tokens.length&&t.tokens[l].type==="s_close";)l++;l--,i!==l&&(n=t.tokens[l],t.tokens[l]=t.tokens[i],t.tokens[i]=n)}}function zx(t){const r=t.tokens_meta,n=t.tokens_meta.length;Eu(t,t.delimiters);for(let o=0;o<n;o++)r[o]&&r[o].delimiters&&Eu(t,r[o].delimiters)}const ku={tokenize:Ux,postProcess:zx};function jx(t,r){const n=t.pos,o=t.src.charCodeAt(n);if(r||o!==95&&o!==42)return!1;const a=t.scanDelims(t.pos,o===42);for(let i=0;i<a.length;i++){const l=t.push("text","",0);l.content=String.fromCharCode(o),t.delimiters.push({marker:o,length:a.length,token:t.tokens.length-1,end:-1,open:a.can_open,close:a.can_close})}return t.pos+=a.length,!0}function vu(t,r){const n=r.length;for(let o=n-1;o>=0;o--){const a=r[o];if(a.marker!==95&&a.marker!==42||a.end===-1)continue;const i=r[a.end],l=o>0&&r[o-1].end===a.end+1&&r[o-1].marker===a.marker&&r[o-1].token===a.token-1&&r[a.end+1].token===i.token+1,s=String.fromCharCode(a.marker),u=t.tokens[a.token];u.type=l?"strong_open":"em_open",u.tag=l?"strong":"em",u.nesting=1,u.markup=l?s+s:s,u.content="";const h=t.tokens[i.token];h.type=l?"strong_close":"em_close",h.tag=l?"strong":"em",h.nesting=-1,h.markup=l?s+s:s,h.content="",l&&(t.tokens[r[o-1].token].content="",t.tokens[r[a.end+1].token].content="",o--)}}function Hx(t){const r=t.tokens_meta,n=t.tokens_meta.length;vu(t,t.delimiters);for(let o=0;o<n;o++)r[o]&&r[o].delimiters&&vu(t,r[o].delimiters)}const Au={tokenize:jx,postProcess:Hx};function Gx(t,r){let n,o,a,i,l="",s="",u=t.pos,h=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const d=t.pos,m=t.posMax,c=t.pos+1,y=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(y<0)return!1;let f=y+1;if(f<m&&t.src.charCodeAt(f)===40){for(h=!1,f++;f<m&&(n=t.src.charCodeAt(f),!(!je(n)&&n!==10));f++);if(f>=m)return!1;if(u=f,a=t.md.helpers.parseLinkDestination(t.src,f,t.posMax),a.ok){for(l=t.md.normalizeLink(a.str),t.md.validateLink(l)?f=a.pos:l="",u=f;f<m&&(n=t.src.charCodeAt(f),!(!je(n)&&n!==10));f++);if(a=t.md.helpers.parseLinkTitle(t.src,f,t.posMax),f<m&&u!==f&&a.ok)for(s=a.str,f=a.pos;f<m&&(n=t.src.charCodeAt(f),!(!je(n)&&n!==10));f++);}(f>=m||t.src.charCodeAt(f)!==41)&&(h=!0),f++}if(h){if(typeof t.env.references>"u")return!1;if(f<m&&t.src.charCodeAt(f)===91?(u=f+1,f=t.md.helpers.parseLinkLabel(t,f),f>=0?o=t.src.slice(u,f++):f=y+1):f=y+1,o||(o=t.src.slice(c,y)),i=t.env.references[Or(o)],!i)return t.pos=d,!1;l=i.href,s=i.title}if(!r){t.pos=c,t.posMax=y;const b=t.push("link_open","a",1),p=[["href",l]];b.attrs=p,s&&p.push(["title",s]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=f,t.posMax=m,!0}function Kx(t,r){let n,o,a,i,l,s,u,h,d="";const m=t.pos,c=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const y=t.pos+2,f=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(f<0)return!1;if(i=f+1,i<c&&t.src.charCodeAt(i)===40){for(i++;i<c&&(n=t.src.charCodeAt(i),!(!je(n)&&n!==10));i++);if(i>=c)return!1;for(h=i,s=t.md.helpers.parseLinkDestination(t.src,i,t.posMax),s.ok&&(d=t.md.normalizeLink(s.str),t.md.validateLink(d)?i=s.pos:d=""),h=i;i<c&&(n=t.src.charCodeAt(i),!(!je(n)&&n!==10));i++);if(s=t.md.helpers.parseLinkTitle(t.src,i,t.posMax),i<c&&h!==i&&s.ok)for(u=s.str,i=s.pos;i<c&&(n=t.src.charCodeAt(i),!(!je(n)&&n!==10));i++);else u="";if(i>=c||t.src.charCodeAt(i)!==41)return t.pos=m,!1;i++}else{if(typeof t.env.references>"u")return!1;if(i<c&&t.src.charCodeAt(i)===91?(h=i+1,i=t.md.helpers.parseLinkLabel(t,i),i>=0?a=t.src.slice(h,i++):i=f+1):i=f+1,a||(a=t.src.slice(y,f)),l=t.env.references[Or(a)],!l)return t.pos=m,!1;d=l.href,u=l.title}if(!r){o=t.src.slice(y,f);const b=[];t.md.inline.parse(o,t.md,t.env,b);const p=t.push("image","img",0),x=[["src",d],["alt",""]];p.attrs=x,p.children=b,p.content=o,u&&x.push(["title",u])}return t.pos=i,t.posMax=c,!0}const Xx=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Wx=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Qx(t,r){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const o=t.pos,a=t.posMax;for(;;){if(++n>=a)return!1;const l=t.src.charCodeAt(n);if(l===60)return!1;if(l===62)break}const i=t.src.slice(o+1,n);if(Wx.test(i)){const l=t.md.normalizeLink(i);if(!t.md.validateLink(l))return!1;if(!r){const s=t.push("link_open","a",1);s.attrs=[["href",l]],s.markup="autolink",s.info="auto";const u=t.push("text","",0);u.content=t.md.normalizeLinkText(i);const h=t.push("link_close","a",-1);h.markup="autolink",h.info="auto"}return t.pos+=i.length+2,!0}if(Xx.test(i)){const l=t.md.normalizeLink("mailto:"+i);if(!t.md.validateLink(l))return!1;if(!r){const s=t.push("link_open","a",1);s.attrs=[["href",l]],s.markup="autolink",s.info="auto";const u=t.push("text","",0);u.content=t.md.normalizeLinkText(i);const h=t.push("link_close","a",-1);h.markup="autolink",h.info="auto"}return t.pos+=i.length+2,!0}return!1}function Zx(t){return/^<a[>\s]/i.test(t)}function Jx(t){return/^<\/a\s*>/i.test(t)}function Yx(t){const r=t|32;return r>=97&&r<=122}function e_(t,r){if(!t.md.options.html)return!1;const n=t.posMax,o=t.pos;if(t.src.charCodeAt(o)!==60||o+2>=n)return!1;const a=t.src.charCodeAt(o+1);if(a!==33&&a!==63&&a!==47&&!Yx(a))return!1;const i=t.src.slice(o).match(Bx);if(!i)return!1;if(!r){const l=t.push("html_inline","",0);l.content=i[0],Zx(l.content)&&t.linkLevel++,Jx(l.content)&&t.linkLevel--}return t.pos+=i[0].length,!0}const t_=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,n_=/^&([a-z][a-z0-9]{1,31});/i;function o_(t,r){const n=t.pos,o=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=o)return!1;if(t.src.charCodeAt(n+1)===35){const i=t.src.slice(n).match(t_);if(i){if(!r){const l=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),s=t.push("text_special","",0);s.content=Ti(l)?Tr(l):Tr(65533),s.markup=i[0],s.info="entity"}return t.pos+=i[0].length,!0}}else{const i=t.src.slice(n).match(n_);if(i){const l=uu(i[0]);if(l!==i[0]){if(!r){const s=t.push("text_special","",0);s.content=l,s.markup=i[0],s.info="entity"}return t.pos+=i[0].length,!0}}}return!1}function wu(t){const r={},n=t.length;if(!n)return;let o=0,a=-2;const i=[];for(let l=0;l<n;l++){const s=t[l];if(i.push(0),(t[o].marker!==s.marker||a!==s.token-1)&&(o=l),a=s.token,s.length=s.length||0,!s.close)continue;r.hasOwnProperty(s.marker)||(r[s.marker]=[-1,-1,-1,-1,-1,-1]);const u=r[s.marker][(s.open?3:0)+s.length%3];let h=o-i[o]-1,d=h;for(;h>u;h-=i[h]+1){const m=t[h];if(m.marker===s.marker&&m.open&&m.end<0){let c=!1;if((m.close||s.open)&&(m.length+s.length)%3===0&&(m.length%3!==0||s.length%3!==0)&&(c=!0),!c){const y=h>0&&!t[h-1].open?i[h-1]+1:0;i[l]=l-h+y,i[h]=y,s.open=!1,m.end=l,m.close=!1,d=-1,a=-2;break}}}d!==-1&&(r[s.marker][(s.open?3:0)+(s.length||0)%3]=d)}}function r_(t){const r=t.tokens_meta,n=t.tokens_meta.length;wu(t.delimiters);for(let o=0;o<n;o++)r[o]&&r[o].delimiters&&wu(r[o].delimiters)}function a_(t){let r,n,o=0;const a=t.tokens,i=t.tokens.length;for(r=n=0;r<i;r++)a[r].nesting<0&&o--,a[r].level=o,a[r].nesting>0&&o++,a[r].type==="text"&&r+1<i&&a[r+1].type==="text"?a[r+1].content=a[r].content+a[r+1].content:(r!==n&&(a[n]=a[r]),n++);r!==n&&(a.length=n)}const Mi=[["text",Mx],["linkify",Lx],["newline",Px],["escape",qx],["backticks",$x],["strikethrough",ku.tokenize],["emphasis",Au.tokenize],["link",Gx],["image",Kx],["autolink",Qx],["html_inline",e_],["entity",o_]],Ri=[["balance_pairs",r_],["strikethrough",ku.postProcess],["emphasis",Au.postProcess],["fragments_join",a_]];function Vo(){this.ruler=new Ot;for(let t=0;t<Mi.length;t++)this.ruler.push(Mi[t][0],Mi[t][1]);this.ruler2=new Ot;for(let t=0;t<Ri.length;t++)this.ruler2.push(Ri[t][0],Ri[t][1])}Vo.prototype.skipToken=function(t){const r=t.pos,n=this.ruler.getRules(""),o=n.length,a=t.md.options.maxNesting,i=t.cache;if(typeof i[r]<"u"){t.pos=i[r];return}let l=!1;if(t.level<a){for(let s=0;s<o;s++)if(t.level++,l=n[s](t,!0),t.level--,l){if(r>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;l||t.pos++,i[r]=t.pos},Vo.prototype.tokenize=function(t){const r=this.ruler.getRules(""),n=r.length,o=t.posMax,a=t.md.options.maxNesting;for(;t.pos<o;){const i=t.pos;let l=!1;if(t.level<a){for(let s=0;s<n;s++)if(l=r[s](t,!1),l){if(i>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(l){if(t.pos>=o)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},Vo.prototype.parse=function(t,r,n,o){const a=new this.State(t,r,n,o);this.tokenize(a);const i=this.ruler2.getRules(""),l=i.length;for(let s=0;s<l;s++)i[s](a)},Vo.prototype.State=Do;function i_(t){const r={};t=t||{},r.src_Any=au.source,r.src_Cc=iu.source,r.src_Z=su.source,r.src_P=Ni.source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|");const n="[><|]";return r.src_pseudo_letter="(?:(?!"+n+"|"+r.src_ZPCc+")"+r.src_Any+")",r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth="(?:(?:(?!"+r.src_ZCc+"|[@/\\[\\]()]).)+@)?",r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator="(?=$|"+n+"|"+r.src_ZPCc+")(?!"+(t["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+r.src_ZPCc+"))",r.src_path="(?:[/?#](?:(?!"+r.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+r.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+r.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+r.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+r.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+r.src_ZCc+"|[']).)+\\'|\\'(?="+r.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+r.src_ZCc+"|[.]|$)|"+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+r.src_ZCc+"|$)|;(?!"+r.src_ZCc+"|$)|\\!+(?!"+r.src_ZCc+"|[!]|$)|\\?(?!"+r.src_ZCc+"|[?]|$))+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+r.src_pseudo_letter+"{1,63})",r.src_domain="(?:"+r.src_xn+"|(?:"+r.src_pseudo_letter+")|(?:"+r.src_pseudo_letter+"(?:-|"+r.src_pseudo_letter+"){0,61}"+r.src_pseudo_letter+"))",r.src_host="(?:(?:(?:(?:"+r.src_domain+")\\.)*"+r.src_domain+"))",r.tpl_host_fuzzy="(?:"+r.src_ip4+"|(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%)))",r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%))",r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+r.src_ZPCc+"|>|$))",r.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+r.src_ZCc+")("+r.src_email_name+"@"+r.tpl_host_fuzzy_strict+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_fuzzy_strict+r.src_path+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_no_ip_fuzzy_strict+r.src_path+")",r}function Li(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(o){t[o]=n[o]})}),t}function Mr(t){return Object.prototype.toString.call(t)}function l_(t){return Mr(t)==="[object String]"}function s_(t){return Mr(t)==="[object Object]"}function c_(t){return Mr(t)==="[object RegExp]"}function Nu(t){return Mr(t)==="[object Function]"}function u_(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Su={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function d_(t){return Object.keys(t||{}).reduce(function(r,n){return r||Su.hasOwnProperty(n)},!1)}const f_={"http:":{validate:function(t,r,n){const o=t.slice(r);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,r,n){const o=t.slice(r);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?r>=3&&t[r-3]===":"||r>=3&&t[r-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,r,n){const o=t.slice(r);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},h_="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",p_="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m_(t){t.__index__=-1,t.__text_cache__=""}function y_(t){return function(r,n){const o=r.slice(n);return t.test(o)?o.match(t)[0].length:0}}function Bu(){return function(t,r){r.normalize(t)}}function Rr(t){const r=t.re=i_(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(h_),n.push(r.src_xn),r.src_tlds=n.join("|");function o(s){return s.replace("%TLDS%",r.src_tlds)}r.email_fuzzy=RegExp(o(r.tpl_email_fuzzy),"i"),r.link_fuzzy=RegExp(o(r.tpl_link_fuzzy),"i"),r.link_no_ip_fuzzy=RegExp(o(r.tpl_link_no_ip_fuzzy),"i"),r.host_fuzzy_test=RegExp(o(r.tpl_host_fuzzy_test),"i");const a=[];t.__compiled__={};function i(s,u){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+u)}Object.keys(t.__schemas__).forEach(function(s){const u=t.__schemas__[s];if(u===null)return;const h={validate:null,link:null};if(t.__compiled__[s]=h,s_(u)){c_(u.validate)?h.validate=y_(u.validate):Nu(u.validate)?h.validate=u.validate:i(s,u),Nu(u.normalize)?h.normalize=u.normalize:u.normalize?i(s,u):h.normalize=Bu();return}if(l_(u)){a.push(s);return}i(s,u)}),a.forEach(function(s){t.__compiled__[t.__schemas__[s]]&&(t.__compiled__[s].validate=t.__compiled__[t.__schemas__[s]].validate,t.__compiled__[s].normalize=t.__compiled__[t.__schemas__[s]].normalize)}),t.__compiled__[""]={validate:null,normalize:Bu()};const l=Object.keys(t.__compiled__).filter(function(s){return s.length>0&&t.__compiled__[s]}).map(u_).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+r.src_ZPCc+"))("+l+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+r.src_ZPCc+"))("+l+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),m_(t)}function g_(t,r){const n=t.__index__,o=t.__last_index__,a=t.__text_cache__.slice(n,o);this.schema=t.__schema__.toLowerCase(),this.index=n+r,this.lastIndex=o+r,this.raw=a,this.text=a,this.url=a}function Pi(t,r){const n=new g_(t,r);return t.__compiled__[n.schema].normalize(n,t),n}function Pt(t,r){if(!(this instanceof Pt))return new Pt(t,r);r||d_(t)&&(r=t,t={}),this.__opts__=Li({},Su,r),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Li({},f_,t),this.__compiled__={},this.__tlds__=p_,this.__tlds_replaced__=!1,this.re={},Rr(this)}Pt.prototype.add=function(r,n){return this.__schemas__[r]=n,Rr(this),this},Pt.prototype.set=function(r){return this.__opts__=Li(this.__opts__,r),this},Pt.prototype.test=function(r){if(this.__text_cache__=r,this.__index__=-1,!r.length)return!1;let n,o,a,i,l,s,u,h,d;if(this.re.schema_test.test(r)){for(u=this.re.schema_search,u.lastIndex=0;(n=u.exec(r))!==null;)if(i=this.testSchemaAt(r,n[2],u.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(h=r.search(this.re.host_fuzzy_test),h>=0&&(this.__index__<0||h<this.__index__)&&(o=r.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(l=o.index+o[1].length,(this.__index__<0||l<this.__index__)&&(this.__schema__="",this.__index__=l,this.__last_index__=o.index+o[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(d=r.indexOf("@"),d>=0&&(a=r.match(this.re.email_fuzzy))!==null&&(l=a.index+a[1].length,s=a.index+a[0].length,(this.__index__<0||l<this.__index__||l===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=l,this.__last_index__=s))),this.__index__>=0},Pt.prototype.pretest=function(r){return this.re.pretest.test(r)},Pt.prototype.testSchemaAt=function(r,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(r,o,this):0},Pt.prototype.match=function(r){const n=[];let o=0;this.__index__>=0&&this.__text_cache__===r&&(n.push(Pi(this,o)),o=this.__last_index__);let a=o?r.slice(o):r;for(;this.test(a);)n.push(Pi(this,o)),a=a.slice(this.__last_index__),o+=this.__last_index__;return n.length?n:null},Pt.prototype.matchAtStart=function(r){if(this.__text_cache__=r,this.__index__=-1,!r.length)return null;const n=this.re.schema_at_start.exec(r);if(!n)return null;const o=this.testSchemaAt(r,n[2],n[0].length);return o?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o,Pi(this,0)):null},Pt.prototype.tlds=function(r,n){return r=Array.isArray(r)?r:[r],n?(this.__tlds__=this.__tlds__.concat(r).sort().filter(function(o,a,i){return o!==i[a-1]}).reverse(),Rr(this),this):(this.__tlds__=r.slice(),this.__tlds_replaced__=!0,Rr(this),this)},Pt.prototype.normalize=function(r){r.schema||(r.url="http://"+r.url),r.schema==="mailto:"&&!/^mailto:/i.test(r.url)&&(r.url="mailto:"+r.url)},Pt.prototype.onCompile=function(){};const oo=2147483647,un=36,qi=1,Fo=26,b_=38,x_=700,Iu=72,Tu=128,Ou="-",__=/^xn--/,C_=/[^\0-\x7F]/,E_=/[\x2E\u3002\uFF0E\uFF61]/g,k_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$i=un-qi,dn=Math.floor,Ui=String.fromCharCode;function Tn(t){throw new RangeError(k_[t])}function v_(t,r){const n=[];let o=t.length;for(;o--;)n[o]=r(t[o]);return n}function Du(t,r){const n=t.split("@");let o="";n.length>1&&(o=n[0]+"@",t=n[1]),t=t.replace(E_,".");const a=t.split("."),i=v_(a,r).join(".");return o+i}function Vu(t){const r=[];let n=0;const o=t.length;for(;n<o;){const a=t.charCodeAt(n++);if(a>=55296&&a<=56319&&n<o){const i=t.charCodeAt(n++);(i&64512)==56320?r.push(((a&1023)<<10)+(i&1023)+65536):(r.push(a),n--)}else r.push(a)}return r}const A_=t=>String.fromCodePoint(...t),w_=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:un},Fu=function(t,r){return t+22+75*(t<26)-((r!=0)<<5)},Mu=function(t,r,n){let o=0;for(t=n?dn(t/x_):t>>1,t+=dn(t/r);t>$i*Fo>>1;o+=un)t=dn(t/$i);return dn(o+($i+1)*t/(t+b_))},Ru=function(t){const r=[],n=t.length;let o=0,a=Tu,i=Iu,l=t.lastIndexOf(Ou);l<0&&(l=0);for(let s=0;s<l;++s)t.charCodeAt(s)>=128&&Tn("not-basic"),r.push(t.charCodeAt(s));for(let s=l>0?l+1:0;s<n;){const u=o;for(let d=1,m=un;;m+=un){s>=n&&Tn("invalid-input");const c=w_(t.charCodeAt(s++));c>=un&&Tn("invalid-input"),c>dn((oo-o)/d)&&Tn("overflow"),o+=c*d;const y=m<=i?qi:m>=i+Fo?Fo:m-i;if(c<y)break;const f=un-y;d>dn(oo/f)&&Tn("overflow"),d*=f}const h=r.length+1;i=Mu(o-u,h,u==0),dn(o/h)>oo-a&&Tn("overflow"),a+=dn(o/h),o%=h,r.splice(o++,0,a)}return String.fromCodePoint(...r)},Lu=function(t){const r=[];t=Vu(t);const n=t.length;let o=Tu,a=0,i=Iu;for(const u of t)u<128&&r.push(Ui(u));const l=r.length;let s=l;for(l&&r.push(Ou);s<n;){let u=oo;for(const d of t)d>=o&&d<u&&(u=d);const h=s+1;u-o>dn((oo-a)/h)&&Tn("overflow"),a+=(u-o)*h,o=u;for(const d of t)if(d<o&&++a>oo&&Tn("overflow"),d===o){let m=a;for(let c=un;;c+=un){const y=c<=i?qi:c>=i+Fo?Fo:c-i;if(m<y)break;const f=m-y,b=un-y;r.push(Ui(Fu(y+f%b,0))),m=dn(f/b)}r.push(Ui(Fu(m,0))),i=Mu(a,h,s===l),a=0,++s}++a,++o}return r.join("")},Pu={version:"2.3.1",ucs2:{decode:Vu,encode:A_},decode:Ru,encode:Lu,toASCII:function(t){return Du(t,function(r){return C_.test(r)?"xn--"+Lu(r):r})},toUnicode:function(t){return Du(t,function(r){return __.test(r)?Ru(r.slice(4).toLowerCase()):r})}},N_={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},S_=/^(vbscript|javascript|file|data):/,B_=/^data:image\/(gif|png|jpeg|webp);/;function I_(t){const r=t.trim().toLowerCase();return S_.test(r)?B_.test(r):!0}const qu=["http:","https:","mailto:"];function T_(t){const r=wi(t,!0);if(r.hostname&&(!r.protocol||qu.indexOf(r.protocol)>=0))try{r.hostname=Pu.toASCII(r.hostname)}catch{}return Bo(Ai(r))}function O_(t){const r=wi(t,!0);if(r.hostname&&(!r.protocol||qu.indexOf(r.protocol)>=0))try{r.hostname=Pu.toUnicode(r.hostname)}catch{}return Yn(Ai(r),Yn.defaultChars+"%")}function jt(t,r){if(!(this instanceof jt))return new jt(t,r);r||Ii(t)||(r=t||{},t="default"),this.inline=new Vo,this.block=new Fr,this.core=new Di,this.renderer=new to,this.linkify=new Pt,this.validateLink=I_,this.normalizeLink=T_,this.normalizeLinkText=O_,this.utils=zb,this.helpers=Ir({},Kb),this.options={},this.configure(t),r&&this.set(r)}jt.prototype.set=function(t){return Ir(this.options,t),this},jt.prototype.configure=function(t){const r=this;if(Ii(t)){const n=t;if(t=N_[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&r.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&r[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&r[n].ruler2.enableOnly(t.components[n].rules2)}),this},jt.prototype.enable=function(t,r){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(a){n=n.concat(this[a].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const o=t.filter(function(a){return n.indexOf(a)<0});if(o.length&&!r)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this},jt.prototype.disable=function(t,r){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(a){n=n.concat(this[a].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const o=t.filter(function(a){return n.indexOf(a)<0});if(o.length&&!r)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this},jt.prototype.use=function(t){const r=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,r),this},jt.prototype.parse=function(t,r){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,r);return this.core.process(n),n.tokens},jt.prototype.render=function(t,r){return r=r||{},this.renderer.render(this.parse(t,r),this.options,r)},jt.prototype.parseInline=function(t,r){const n=new this.core.State(t,this,r);return n.inlineMode=!0,this.core.process(n),n.tokens},jt.prototype.renderInline=function(t,r){return r=r||{},this.renderer.render(this.parseInline(t,r),this.options,r)};/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:$u,setPrototypeOf:Uu,isFrozen:D_,getPrototypeOf:V_,getOwnPropertyDescriptor:F_}=Object;let{freeze:kt,seal:Ht,create:zu}=Object,{apply:zi,construct:ji}=typeof Reflect<"u"&&Reflect;kt||(kt=function(r){return r}),Ht||(Ht=function(r){return r}),zi||(zi=function(r,n,o){return r.apply(n,o)}),ji||(ji=function(r,n){return new r(...n)});const Lr=At(Array.prototype.forEach),M_=At(Array.prototype.lastIndexOf),ju=At(Array.prototype.pop),Mo=At(Array.prototype.push),R_=At(Array.prototype.splice),Pr=At(String.prototype.toLowerCase),Hi=At(String.prototype.toString),Hu=At(String.prototype.match),Ro=At(String.prototype.replace),L_=At(String.prototype.indexOf),P_=At(String.prototype.trim),Jt=At(Object.prototype.hasOwnProperty),vt=At(RegExp.prototype.test),Lo=q_(TypeError);function At(t){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return zi(t,r,o)}}function q_(t){return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return ji(t,n)}}function Fe(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pr;Uu&&Uu(t,null);let o=r.length;for(;o--;){let a=r[o];if(typeof a=="string"){const i=n(a);i!==a&&(D_(r)||(r[o]=i),a=i)}t[a]=!0}return t}function $_(t){for(let r=0;r<t.length;r++)Jt(t,r)||(t[r]=null);return t}function gn(t){const r=zu(null);for(const[n,o]of $u(t))Jt(t,n)&&(Array.isArray(o)?r[n]=$_(o):o&&typeof o=="object"&&o.constructor===Object?r[n]=gn(o):r[n]=o);return r}function Po(t,r){for(;t!==null;){const o=F_(t,r);if(o){if(o.get)return At(o.get);if(typeof o.value=="function")return At(o.value)}t=V_(t)}function n(){return null}return n}const Gu=kt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Gi=kt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ki=kt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),U_=kt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Xi=kt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),z_=kt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ku=kt(["#text"]),Xu=kt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Wi=kt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wu=kt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),qr=kt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),j_=Ht(/\{\{[\w\W]*|[\w\W]*\}\}/gm),H_=Ht(/<%[\w\W]*|[\w\W]*%>/gm),G_=Ht(/\$\{[\w\W]*/gm),K_=Ht(/^data-[\-\w.\u00B7-\uFFFF]+$/),X_=Ht(/^aria-[\-\w]+$/),Qu=Ht(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W_=Ht(/^(?:\w+script|data):/i),Q_=Ht(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zu=Ht(/^html$/i),Z_=Ht(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ju=Object.freeze({__proto__:null,ARIA_ATTR:X_,ATTR_WHITESPACE:Q_,CUSTOM_ELEMENT:Z_,DATA_ATTR:K_,DOCTYPE_NAME:Zu,ERB_EXPR:H_,IS_ALLOWED_URI:Qu,IS_SCRIPT_OR_DATA:W_,MUSTACHE_EXPR:j_,TMPLIT_EXPR:G_});const qo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},J_=function(){return typeof window>"u"?null:window},Y_=function(r,n){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(o=n.getAttribute(a));const i="dompurify"+(o?"#"+o:"");try{return r.createPolicy(i,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Yu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function e0(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J_();const r=Ae=>e0(Ae);if(r.version="3.2.6",r.removed=[],!t||!t.document||t.document.nodeType!==qo.document||!t.Element)return r.isSupported=!1,r;let{document:n}=t;const o=n,a=o.currentScript,{DocumentFragment:i,HTMLTemplateElement:l,Node:s,Element:u,NodeFilter:h,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:m,DOMParser:c,trustedTypes:y}=t,f=u.prototype,b=Po(f,"cloneNode"),p=Po(f,"remove"),x=Po(f,"nextSibling"),g=Po(f,"childNodes"),C=Po(f,"parentNode");if(typeof l=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let _,E="";const{implementation:A,createNodeIterator:k,createDocumentFragment:B,getElementsByTagName:D}=n,{importNode:w}=o;let v=Yu();r.isSupported=typeof $u=="function"&&typeof C=="function"&&A&&A.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:S,ERB_EXPR:I,TMPLIT_EXPR:R,DATA_ATTR:z,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:W,CUSTOM_ELEMENT:K}=Ju;let{IS_ALLOWED_URI:P}=Ju,N=null;const T=Fe({},[...Gu,...Gi,...Ki,...Xi,...Ku]);let O=null;const F=Fe({},[...Xu,...Wi,...Wu,...qr]);let q=Object.seal(zu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),M=null,U=null,L=!0,j=!0,H=!1,Z=!0,te=!1,ne=!0,Q=!1,ce=!1,ue=!1,pe=!1,ie=!1,de=!1,_e=!0,xe=!1;const ye="user-content-";let oe=!0,le=!1,be={},Ce=null;const J=Fe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let se=null;const fe=Fe({},["audio","video","img","source","image","track"]);let Y=null;const re=Fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",Se="http://www.w3.org/2000/svg",De="http://www.w3.org/1999/xhtml";let Oe=De,He=!1,Ve=null;const Ge=Fe({},[me,Se,De],Hi);let qe=Fe({},["mi","mo","mn","ms","mtext"]),Ke=Fe({},["annotation-xml"]);const nt=Fe({},["title","style","font","a","script"]);let mt=null;const bn=["application/xhtml+xml","text/html"],Yt="text/html";let Xe=null,wt=null;const xn=n.createElement("form"),qt=function(ae){return ae instanceof RegExp||ae instanceof Function},en=function(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(wt&&wt===ae)){if((!ae||typeof ae!="object")&&(ae={}),ae=gn(ae),mt=bn.indexOf(ae.PARSER_MEDIA_TYPE)===-1?Yt:ae.PARSER_MEDIA_TYPE,Xe=mt==="application/xhtml+xml"?Hi:Pr,N=Jt(ae,"ALLOWED_TAGS")?Fe({},ae.ALLOWED_TAGS,Xe):T,O=Jt(ae,"ALLOWED_ATTR")?Fe({},ae.ALLOWED_ATTR,Xe):F,Ve=Jt(ae,"ALLOWED_NAMESPACES")?Fe({},ae.ALLOWED_NAMESPACES,Hi):Ge,Y=Jt(ae,"ADD_URI_SAFE_ATTR")?Fe(gn(re),ae.ADD_URI_SAFE_ATTR,Xe):re,se=Jt(ae,"ADD_DATA_URI_TAGS")?Fe(gn(fe),ae.ADD_DATA_URI_TAGS,Xe):fe,Ce=Jt(ae,"FORBID_CONTENTS")?Fe({},ae.FORBID_CONTENTS,Xe):J,M=Jt(ae,"FORBID_TAGS")?Fe({},ae.FORBID_TAGS,Xe):gn({}),U=Jt(ae,"FORBID_ATTR")?Fe({},ae.FORBID_ATTR,Xe):gn({}),be=Jt(ae,"USE_PROFILES")?ae.USE_PROFILES:!1,L=ae.ALLOW_ARIA_ATTR!==!1,j=ae.ALLOW_DATA_ATTR!==!1,H=ae.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=ae.ALLOW_SELF_CLOSE_IN_ATTR!==!1,te=ae.SAFE_FOR_TEMPLATES||!1,ne=ae.SAFE_FOR_XML!==!1,Q=ae.WHOLE_DOCUMENT||!1,pe=ae.RETURN_DOM||!1,ie=ae.RETURN_DOM_FRAGMENT||!1,de=ae.RETURN_TRUSTED_TYPE||!1,ue=ae.FORCE_BODY||!1,_e=ae.SANITIZE_DOM!==!1,xe=ae.SANITIZE_NAMED_PROPS||!1,oe=ae.KEEP_CONTENT!==!1,le=ae.IN_PLACE||!1,P=ae.ALLOWED_URI_REGEXP||Qu,Oe=ae.NAMESPACE||De,qe=ae.MATHML_TEXT_INTEGRATION_POINTS||qe,Ke=ae.HTML_INTEGRATION_POINTS||Ke,q=ae.CUSTOM_ELEMENT_HANDLING||{},ae.CUSTOM_ELEMENT_HANDLING&&qt(ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(q.tagNameCheck=ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ae.CUSTOM_ELEMENT_HANDLING&&qt(ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(q.attributeNameCheck=ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ae.CUSTOM_ELEMENT_HANDLING&&typeof ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(q.allowCustomizedBuiltInElements=ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),te&&(j=!1),ie&&(pe=!0),be&&(N=Fe({},Ku),O=[],be.html===!0&&(Fe(N,Gu),Fe(O,Xu)),be.svg===!0&&(Fe(N,Gi),Fe(O,Wi),Fe(O,qr)),be.svgFilters===!0&&(Fe(N,Ki),Fe(O,Wi),Fe(O,qr)),be.mathMl===!0&&(Fe(N,Xi),Fe(O,Wu),Fe(O,qr))),ae.ADD_TAGS&&(N===T&&(N=gn(N)),Fe(N,ae.ADD_TAGS,Xe)),ae.ADD_ATTR&&(O===F&&(O=gn(O)),Fe(O,ae.ADD_ATTR,Xe)),ae.ADD_URI_SAFE_ATTR&&Fe(Y,ae.ADD_URI_SAFE_ATTR,Xe),ae.FORBID_CONTENTS&&(Ce===J&&(Ce=gn(Ce)),Fe(Ce,ae.FORBID_CONTENTS,Xe)),oe&&(N["#text"]=!0),Q&&Fe(N,["html","head","body"]),N.table&&(Fe(N,["tbody"]),delete M.tbody),ae.TRUSTED_TYPES_POLICY){if(typeof ae.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ae.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=ae.TRUSTED_TYPES_POLICY,E=_.createHTML("")}else _===void 0&&(_=Y_(y,a)),_!==null&&typeof E=="string"&&(E=_.createHTML(""));kt&&kt(ae),wt=ae}},Dt=Fe({},[...Gi,...Ki,...U_]),_n=Fe({},[...Xi,...z_]),ot=function(ae){let Ee=C(ae);(!Ee||!Ee.tagName)&&(Ee={namespaceURI:Oe,tagName:"template"});const ke=Pr(ae.tagName),ze=Pr(Ee.tagName);return Ve[ae.namespaceURI]?ae.namespaceURI===Se?Ee.namespaceURI===De?ke==="svg":Ee.namespaceURI===me?ke==="svg"&&(ze==="annotation-xml"||qe[ze]):!!Dt[ke]:ae.namespaceURI===me?Ee.namespaceURI===De?ke==="math":Ee.namespaceURI===Se?ke==="math"&&Ke[ze]:!!_n[ke]:ae.namespaceURI===De?Ee.namespaceURI===Se&&!Ke[ze]||Ee.namespaceURI===me&&!qe[ze]?!1:!_n[ke]&&(nt[ke]||!Dt[ke]):!!(mt==="application/xhtml+xml"&&Ve[ae.namespaceURI]):!1},Qe=function(ae){Mo(r.removed,{element:ae});try{C(ae).removeChild(ae)}catch{p(ae)}},Vt=function(ae,Ee){try{Mo(r.removed,{attribute:Ee.getAttributeNode(ae),from:Ee})}catch{Mo(r.removed,{attribute:null,from:Ee})}if(Ee.removeAttribute(ae),ae==="is")if(pe||ie)try{Qe(Ee)}catch{}else try{Ee.setAttribute(ae,"")}catch{}},fn=function(ae){let Ee=null,ke=null;if(ue)ae="<remove></remove>"+ae;else{const Ze=Hu(ae,/^[\r\n\t ]+/);ke=Ze&&Ze[0]}mt==="application/xhtml+xml"&&Oe===De&&(ae='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ae+"</body></html>");const ze=_?_.createHTML(ae):ae;if(Oe===De)try{Ee=new c().parseFromString(ze,mt)}catch{}if(!Ee||!Ee.documentElement){Ee=A.createDocument(Oe,"template",null);try{Ee.documentElement.innerHTML=He?E:ze}catch{}}const et=Ee.body||Ee.documentElement;return ae&&ke&&et.insertBefore(n.createTextNode(ke),et.childNodes[0]||null),Oe===De?D.call(Ee,Q?"html":"body")[0]:Q?Ee.documentElement:et},Ye=function(ae){return k.call(ae.ownerDocument||ae,ae,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},zn=function(ae){return ae instanceof m&&(typeof ae.nodeName!="string"||typeof ae.textContent!="string"||typeof ae.removeChild!="function"||!(ae.attributes instanceof d)||typeof ae.removeAttribute!="function"||typeof ae.setAttribute!="function"||typeof ae.namespaceURI!="string"||typeof ae.insertBefore!="function"||typeof ae.hasChildNodes!="function")},ro=function(ae){return typeof s=="function"&&ae instanceof s};function $t(Ae,ae,Ee){Lr(Ae,ke=>{ke.call(r,ae,Ee,wt)})}const ao=function(ae){let Ee=null;if($t(v.beforeSanitizeElements,ae,null),zn(ae))return Qe(ae),!0;const ke=Xe(ae.nodeName);if($t(v.uponSanitizeElement,ae,{tagName:ke,allowedTags:N}),ne&&ae.hasChildNodes()&&!ro(ae.firstElementChild)&&vt(/<[/\w!]/g,ae.innerHTML)&&vt(/<[/\w!]/g,ae.textContent)||ae.nodeType===qo.progressingInstruction||ne&&ae.nodeType===qo.comment&&vt(/<[/\w]/g,ae.data))return Qe(ae),!0;if(!N[ke]||M[ke]){if(!M[ke]&&rt(ke)&&(q.tagNameCheck instanceof RegExp&&vt(q.tagNameCheck,ke)||q.tagNameCheck instanceof Function&&q.tagNameCheck(ke)))return!1;if(oe&&!Ce[ke]){const ze=C(ae)||ae.parentNode,et=g(ae)||ae.childNodes;if(et&&ze){const Ze=et.length;for(let ut=Ze-1;ut>=0;--ut){const Ut=b(et[ut],!0);Ut.__removalCount=(ae.__removalCount||0)+1,ze.insertBefore(Ut,x(ae))}}}return Qe(ae),!0}return ae instanceof u&&!ot(ae)||(ke==="noscript"||ke==="noembed"||ke==="noframes")&&vt(/<\/no(script|embed|frames)/i,ae.innerHTML)?(Qe(ae),!0):(te&&ae.nodeType===qo.text&&(Ee=ae.textContent,Lr([S,I,R],ze=>{Ee=Ro(Ee,ze," ")}),ae.textContent!==Ee&&(Mo(r.removed,{element:ae.cloneNode()}),ae.textContent=Ee)),$t(v.afterSanitizeElements,ae,null),!1)},io=function(ae,Ee,ke){if(_e&&(Ee==="id"||Ee==="name")&&(ke in n||ke in xn))return!1;if(!(j&&!U[Ee]&&vt(z,Ee))){if(!(L&&vt($,Ee))){if(!O[Ee]||U[Ee]){if(!(rt(ae)&&(q.tagNameCheck instanceof RegExp&&vt(q.tagNameCheck,ae)||q.tagNameCheck instanceof Function&&q.tagNameCheck(ae))&&(q.attributeNameCheck instanceof RegExp&&vt(q.attributeNameCheck,Ee)||q.attributeNameCheck instanceof Function&&q.attributeNameCheck(Ee))||Ee==="is"&&q.allowCustomizedBuiltInElements&&(q.tagNameCheck instanceof RegExp&&vt(q.tagNameCheck,ke)||q.tagNameCheck instanceof Function&&q.tagNameCheck(ke))))return!1}else if(!Y[Ee]){if(!vt(P,Ro(ke,W,""))){if(!((Ee==="src"||Ee==="xlink:href"||Ee==="href")&&ae!=="script"&&L_(ke,"data:")===0&&se[ae])){if(!(H&&!vt(X,Ro(ke,W,"")))){if(ke)return!1}}}}}}return!0},rt=function(ae){return ae!=="annotation-xml"&&Hu(ae,K)},lo=function(ae){$t(v.beforeSanitizeAttributes,ae,null);const{attributes:Ee}=ae;if(!Ee||zn(ae))return;const ke={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0};let ze=Ee.length;for(;ze--;){const et=Ee[ze],{name:Ze,namespaceURI:ut,value:Ut}=et,Gt=Xe(Ze),On=Ut;let Je=Ze==="value"?On:P_(On);if(ke.attrName=Gt,ke.attrValue=Je,ke.keepAttr=!0,ke.forceKeepAttr=void 0,$t(v.uponSanitizeAttribute,ae,ke),Je=ke.attrValue,xe&&(Gt==="id"||Gt==="name")&&(Vt(Ze,ae),Je=ye+Je),ne&&vt(/((--!?|])>)|<\/(style|title)/i,Je)){Vt(Ze,ae);continue}if(ke.forceKeepAttr)continue;if(!ke.keepAttr){Vt(Ze,ae);continue}if(!Z&&vt(/\/>/i,Je)){Vt(Ze,ae);continue}te&&Lr([S,I,R],Dn=>{Je=Ro(Je,Dn," ")});const zt=Xe(ae.nodeName);if(!io(zt,Gt,Je)){Vt(Ze,ae);continue}if(_&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!ut)switch(y.getAttributeType(zt,Gt)){case"TrustedHTML":{Je=_.createHTML(Je);break}case"TrustedScriptURL":{Je=_.createScriptURL(Je);break}}if(Je!==On)try{ut?ae.setAttributeNS(ut,Ze,Je):ae.setAttribute(Ze,Je),zn(ae)?Qe(ae):ju(r.removed)}catch{Vt(Ze,ae)}}$t(v.afterSanitizeAttributes,ae,null)},$o=function Ae(ae){let Ee=null;const ke=Ye(ae);for($t(v.beforeSanitizeShadowDOM,ae,null);Ee=ke.nextNode();)$t(v.uponSanitizeShadowNode,Ee,null),ao(Ee),lo(Ee),Ee.content instanceof i&&Ae(Ee.content);$t(v.afterSanitizeShadowDOM,ae,null)};return r.sanitize=function(Ae){let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ee=null,ke=null,ze=null,et=null;if(He=!Ae,He&&(Ae="<!-->"),typeof Ae!="string"&&!ro(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw Lo("dirty is not a string, aborting")}else throw Lo("toString is not a function");if(!r.isSupported)return Ae;if(ce||en(ae),r.removed=[],typeof Ae=="string"&&(le=!1),le){if(Ae.nodeName){const Ut=Xe(Ae.nodeName);if(!N[Ut]||M[Ut])throw Lo("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof s)Ee=fn("<!---->"),ke=Ee.ownerDocument.importNode(Ae,!0),ke.nodeType===qo.element&&ke.nodeName==="BODY"||ke.nodeName==="HTML"?Ee=ke:Ee.appendChild(ke);else{if(!pe&&!te&&!Q&&Ae.indexOf("<")===-1)return _&&de?_.createHTML(Ae):Ae;if(Ee=fn(Ae),!Ee)return pe?null:de?E:""}Ee&&ue&&Qe(Ee.firstChild);const Ze=Ye(le?Ae:Ee);for(;ze=Ze.nextNode();)ao(ze),lo(ze),ze.content instanceof i&&$o(ze.content);if(le)return Ae;if(pe){if(ie)for(et=B.call(Ee.ownerDocument);Ee.firstChild;)et.appendChild(Ee.firstChild);else et=Ee;return(O.shadowroot||O.shadowrootmode)&&(et=w.call(o,et,!0)),et}let ut=Q?Ee.outerHTML:Ee.innerHTML;return Q&&N["!doctype"]&&Ee.ownerDocument&&Ee.ownerDocument.doctype&&Ee.ownerDocument.doctype.name&&vt(Zu,Ee.ownerDocument.doctype.name)&&(ut="<!DOCTYPE "+Ee.ownerDocument.doctype.name+`>
|
|
161
|
-
`+ut),te&&Lr([S,I,R],Ut=>{ut=Ro(ut,Ut," ")}),_&&de?_.createHTML(ut):ut},r.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};en(Ae),ce=!0},r.clearConfig=function(){wt=null,ce=!1},r.isValidAttribute=function(Ae,ae,Ee){wt||en({});const ke=Xe(Ae),ze=Xe(ae);return io(ke,ze,Ee)},r.addHook=function(Ae,ae){typeof ae=="function"&&Mo(v[Ae],ae)},r.removeHook=function(Ae,ae){if(ae!==void 0){const Ee=M_(v[Ae],ae);return Ee===-1?void 0:R_(v[Ae],Ee,1)[0]}return ju(v[Ae])},r.removeHooks=function(Ae){v[Ae]=[]},r.removeAllHooks=function(){v=Yu()},r}var eC=e0();const tC=["innerHTML"],t0=ve({__name:"MarkdownRenderer",props:{source:{type:String,default:""},wrapperClass:{type:[String,Array,Object],default:""}},setup(t){const r=t,n=new jt({html:!1,linkify:!0,breaks:!0}),o=e.computed(()=>{const a=n.render(r.source||"");return eC.sanitize(a)});return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["markdown-renderer",t.wrapperClass]),innerHTML:o.value},null,10,tC))}},[["__scopeId","data-v-ecacea26"]]),nC={class:"message-content"},oC={key:0,class:"message-name"},rC={class:"ect-w-full"},aC={class:"message-content"},iC={class:"message-text ect-relative"},lC={class:"ect-pr-1"},sC={class:"loading-message-skeleton"},cC={key:1,class:"buttons-wrapper ect-mt-[-8px]"},uC=ve({__name:"chatMessages",props:{undoId:{type:String,default:""},strikethroughIds:{type:Array,default:()=>[]},messages:{type:Array,required:!0,default:()=>[]},chatIndex:{type:Number,default:0},dataChanged:{type:Boolean,default:!1},loadingMessage:{type:String,default:""},buttonLinks:{type:Array,default:()=>[]}},emits:["component-action"],setup(t,{emit:r}){const n=Gc(),o=e.ref(null),a=e.ref(null);$n();const i=Un(),l=Jn(),s=r,u=t,h=e.computed(()=>!(l!=null&&l.activeComponentKey)),d=()=>{o.value&&o.value.scrollTo({top:o.value.scrollHeight,behavior:"smooth"})};e.watchEffect(()=>{u.messages.length>0&&e.nextTick(()=>{d()})}),e.watchEffect(()=>{u.loadingMessage&&e.nextTick(()=>{d(),a.value&&(a.value.scrollTop=a.value.scrollHeight)})});const m=e.computed(()=>{var
|
|
161
|
+
`+ut),te&&Lr([S,I,R],Ut=>{ut=Ro(ut,Ut," ")}),_&&de?_.createHTML(ut):ut},r.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};en(Ae),ce=!0},r.clearConfig=function(){wt=null,ce=!1},r.isValidAttribute=function(Ae,ae,Ee){wt||en({});const ke=Xe(Ae),ze=Xe(ae);return io(ke,ze,Ee)},r.addHook=function(Ae,ae){typeof ae=="function"&&Mo(v[Ae],ae)},r.removeHook=function(Ae,ae){if(ae!==void 0){const Ee=M_(v[Ae],ae);return Ee===-1?void 0:R_(v[Ae],Ee,1)[0]}return ju(v[Ae])},r.removeHooks=function(Ae){v[Ae]=[]},r.removeAllHooks=function(){v=Yu()},r}var eC=e0();const tC=["innerHTML"],t0=ve({__name:"MarkdownRenderer",props:{source:{type:String,default:""},wrapperClass:{type:[String,Array,Object],default:""}},setup(t){const r=t,n=new jt({html:!1,linkify:!0,breaks:!0}),o=e.computed(()=>{const a=n.render(r.source||"");return eC.sanitize(a)});return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["markdown-renderer",t.wrapperClass]),innerHTML:o.value},null,10,tC))}},[["__scopeId","data-v-ecacea26"]]),nC={class:"message-content"},oC={key:0,class:"message-name"},rC={class:"ect-w-full"},aC={class:"message-content"},iC={class:"message-text ect-relative"},lC={class:"ect-pr-1"},sC={class:"loading-message-skeleton"},cC={key:1,class:"buttons-wrapper ect-mt-[-8px]"},uC=ve({__name:"chatMessages",props:{undoId:{type:String,default:""},strikethroughIds:{type:Array,default:()=>[]},messages:{type:Array,required:!0,default:()=>[]},chatIndex:{type:Number,default:0},dataChanged:{type:Boolean,default:!1},loadingMessage:{type:String,default:""},buttonLinks:{type:Array,default:()=>[]}},emits:["component-action"],setup(t,{emit:r}){const n=Gc(),o=e.ref(null),a=e.ref(null);$n();const i=Un(),l=Jn(),s=r,u=t,h=e.computed(()=>!(l!=null&&l.activeComponentKey)),d=()=>{o.value&&o.value.scrollTo({top:o.value.scrollHeight,behavior:"smooth"})};e.watchEffect(()=>{u.messages.length>0&&e.nextTick(()=>{d()})}),e.watchEffect(()=>{u.loadingMessage&&e.nextTick(()=>{d(),a.value&&(a.value.scrollTop=a.value.scrollHeight)})});const m=e.computed(()=>{var x;return(x=i.chatStyles)==null?void 0:x.bgColor}),c=e.computed(()=>`linear-gradient(180deg, ${m.value} 0%, transparent 100%)`),y=e.computed(()=>{var x;return(x=i.chatStyles)==null?void 0:x.textColor}),f=(x,g,C)=>{var k;const _=((k=l==null?void 0:l.currentPlaybook)==null?void 0:k.playBookSteps)||[],E=B=>String(B||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),A=_.findIndex(B=>{const D=E(B==null?void 0:B.stepComponent),w=String((B==null?void 0:B.stepName)||"").trim().toLowerCase();return x.includes(D)||g.some(v=>w.includes(v))});A>=0?l.navigateToStep({stepName:_[A].stepName}):l.loadComponent(C)},b=(x,g,C=!1)=>{if(console.info("performAction action",x),typeof x=="string"&&x.startsWith("playbookNavigate:")&&x!=="playbookNavigate:Checkout"&&x!=="playbookNavigate:Add Products"){const _=x.slice(17);l.navigateToBean(_);return}x==="addProducts"||x==="playbookNavigate:Add Products"?f(["catalog","adaptive_search"],["catalog","add products"],"catalog"):x==="quoteDocument"?n.openQuoteDocument(g.requestId):x==="quoteItem"?l.loadComponent("cart"):x==="Undo"?i.undoAction(g.requestId):x==="playbookNavigate:Checkout"&&s("component-action",{component:"chat",action:"checkout",details:{action:"CHECKOUT",label:"Checkout"}})},p=x=>{if(!x)return"";let g=x.replace(/\\r\\n/g,`
|
|
162
162
|
`).replace(/\\n/g,`
|
|
163
163
|
`).replace(/\\r/g,`
|
|
164
|
-
`);return x=x.replace(/^[ \t]*•[ \t]+/gm,"- "),x};return(p,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["chat-messages",{"root-path":h.value}])},[e.createElementVNode("div",{class:"chat-gradient",style:e.normalizeStyle({background:c.value})},null,4),e.createElementVNode("div",{ref_key:"chatMessagesRef",ref:o,class:"messages-wrapper"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList([...t.messages],(g,C)=>{var _;return e.openBlock(),e.createElementBlock("div",{key:C,class:e.normalizeClass(["message",{"user-message":g.type==="user"}])},[e.createElementVNode("div",nC,[g.name?(e.openBlock(),e.createElementBlock("div",oC,e.toDisplayString(g.name),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["message-text ect-relative",{"error-message":g.error,strikethrough:g.undone}]),style:e.normalizeStyle(g.type==="user"?{color:y.value,backgroundColor:m.value}:{})},[e.createElementVNode("div",rC,[e.createVNode(t0,{source:b(g.message)},null,8,["source"])]),((_=g==null?void 0:g.filesData)==null?void 0:_.length)>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(g==null?void 0:g.filesData,E=>(e.openBlock(),e.createBlock(eb,{key:E.name,info:{iconUrl:(E==null?void 0:E.type)==="csv"?e.unref(Qc):e.unref(Zc),fileName:E==null?void 0:E.name,fileSize:E==null?void 0:E.size},background:g.type=="user"?"#fff":"#f8f8f8","encoded-string":E==null?void 0:E.encodedString},null,8,["info","background","encoded-string"]))),128)):e.createCommentVNode("",!0)],6)])],2)}),128)),t.loadingMessage?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loading-message",{"thinking-message":e.unref(i).isThinkingMessage}])},[e.createElementVNode("div",{class:e.normalizeClass(["ect-flex ect-gap-3",{"ect-w-full":e.unref(i).isThinkingMessage}])},[e.createElementVNode("div",aC,[e.createElementVNode("div",iC,[e.createElementVNode("div",{ref_key:"loadingWindowRef",ref:a,class:"loading-window"},[e.createElementVNode("div",lC,[e.createVNode(t0,{source:b(t.loadingMessage)},null,8,["source"])])],512)]),e.createElementVNode("div",sC,[e.createVNode(So,{style:{height:"100%",width:"100%"}})])])],2)],2)):t.buttonLinks.length>0?(e.openBlock(),e.createElementBlock("div",cC,[e.createVNode(W7,{links:t.buttonLinks,onPerformAction:f},null,8,["links"])])):e.createCommentVNode("",!0)],512)],2))}},[["__scopeId","data-v-49c2843b"]]),dC={class:"ai-upload ect-flex-inline ect-items-center"},fC=ve({__name:"FileUpload",props:{resetFileInput:{type:Boolean,default:!1}},emits:["upload-status","error"],setup(t,{emit:r}){const n=t,o=r,a=e.ref(null),i=e.ref(""),l=e.ref(""),s=e.ref(!1);e.watch(()=>n.resetFileInput,m=>{m&&a.value&&(a.value.value="",i.value="",l.value="")});const u=m=>{const y=a.value.accept.split(",").map(b=>b.trim().toLowerCase()),f="."+m.name.split(".").pop().toLowerCase();return y.includes(f)||y.includes(m.type.toLowerCase())?!0:y.some(b=>{if(b.includes("*")){const p=b.split("*")[0];return m.type.toLowerCase().startsWith(p)}return!1})},h=async m=>{const c=m.target.files[0];if(console.info("File = ",c),c){if(!u(c)){a.value&&(a.value.value="");const f={message:"Invalid file type. Please upload a valid file type.",fileName:c.name,fileType:c.type};window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Upload Error",detail:f.message,life:5e3}),o("error",f);return}i.value=c.name,l.value=c.type.split("/").pop(),o("upload-status",{status:"uploading",fileName:i.value,fileType:l.value});const y=new FileReader;y.onload=async f=>{const b=new Blob([f.target.result],{type:c.type});console.info("Blob data:",b);try{const p=await U0(b),x={attachment:{name:c.name,data:p}};console.info("AIRequestPayload = ",x),o("upload-status",{status:"uploaded",fileName:i.value,fileType:l.value,size:El(c.size),fileData:x}),a.value&&(a.value.value="")}catch(p){console.info("[ERROR]: File upload error:",p),window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Processing Error",detail:"Error processing file: "+(p.message||"Unknown error"),life:5e3}),o("error",{message:"Error processing file",fileName:i.value,fileType:l.value,error:p.message}),o("upload-status",{status:"error",fileName:i.value,fileType:l.value})}},y.onerror=f=>{console.info("[ERROR]: FileReader error:",f),window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Reading Error",detail:"Could not read the selected file",life:5e3}),o("error",{message:"Error reading file",fileName:c.name,fileType:c.type,error:f})},setTimeout(()=>{y.readAsText(c)},100)}},d=()=>{a.value.click()};return(m,c)=>(e.openBlock(),e.createElementBlock("div",dC,[e.createElementVNode("input",{ref_key:"fileInput",ref:a,type:"file",accept:".csv, .xls, .xlsx, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",class:"ect-opacity-0 ect-h-0 ect-w-0 ect-absolute",onChange:h},null,544),e.createElementVNode("button",{class:"attachment-button",onClick:d,onMouseenter:c[0]||(c[0]=y=>s.value=!0),onMouseleave:c[1]||(c[1]=y=>s.value=!1)},[e.createVNode(Be,{icon:"attachment",size:"11",height:"17",color:s.value?"#198708":"#828282"},null,8,["color"])],32)]))}},[["__scopeId","data-v-7fbbb7c9"]]),hC=["width","height","data-test-id"],pC=[e.createStaticVNode('<g transform="translate(1 1)"><g fill="#57C046"><path d="M72.991 22.112v.119c0 .588-.051 1.162-.13 1.729h12.096c.049-.61.083-1.225.083-1.849v-.122c0-.432-.016-.861-.04-1.288H72.902c.052.466.089.934.089 1.411zM12.059 22.109v-.12c0-.435.027-.863.07-1.287H.05c-.03.466-.05.934-.05 1.407v.121c0 .583.029 1.158.073 1.729h12.136a12.162 12.162 0 0 1-.15-1.85z" vector-effect="non-scaling-stroke"></path></g><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="-737.86" y1="348.135" x2="-696.809" y2="348.135" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset=".3" style="stop-color:#57c046;"></stop><stop offset="1" style="stop-color:#1c8d0a;"></stop></linearGradient><path fill="url(#a)" d="M12.059 22.109v-.12c0-6.117 4.324-11.324 10.841-11.324 8.247 0 13.073 6.397 13.073 6.397l5.078-8.799C36.944 3.258 30.544.068 23.023.068 9.866.068 0 9.938 0 22.109v.121h12.065c-.001-.04-.006-.08-.006-.121z" vector-effect="non-scaling-stroke"></path><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="-693.833" y1="326.091" x2="-652.825" y2="326.091" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset="0" style="stop-color:#1c8d0a;"></stop><stop offset=".7" style="stop-color:#57c046;"></stop></linearGradient><path fill="url(#b)" d="M72.991 22.23c0 6.117-4.32 11.325-10.831 11.325-8.238 0-13.062-6.399-13.062-6.399l-5.071 8.802c4.103 5.003 10.497 8.194 18.01 8.194 13.101 0 22.934-9.805 22.997-21.921l-12.043-.001z" vector-effect="non-scaling-stroke"></path><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="-737.86" y1="337.172" x2="-652.822" y2="337.172" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset=".14" style="stop-color:#57c046;"></stop><stop offset=".37" style="stop-color:#97d952;"></stop><stop offset=".59" style="stop-color:#c3eb5b;"></stop><stop offset=".86" style="stop-color:#57c046;"></stop></linearGradient><path fill="url(#c)" d="m42.533 33.78.071-.028s9.631-16.844 10.384-18.051c2.378-3.72 5.028-5.034 9.05-5.034 6.511 0 10.952 5.329 10.952 11.445v.119h12.045c0-.04.003-.079.003-.119v-.122C85.038 9.819 75.303.072 62.161.072c-8.515 0-15.645 4.144-19.615 10.371l-.071.026s-9.641 16.845-10.394 18.052c-2.38 3.721-5.033 5.035-9.059 5.035-6.473 0-10.899-5.259-10.958-11.324H0c0 12.171 9.745 21.92 22.9 21.92 8.522-.001 15.659-4.147 19.633-10.372z" vector-effect="non-scaling-stroke"></path></g>',1)],mC={__name:"ExpediteLogo",props:{width:{type:Number,default:38},height:{type:Number,default:20},dataTestId:{type:String,default:""}},setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",overflow:"visible",preserveAspectRatio:"none",viewBox:"0 0 87.04 46.221",width:t.width,height:t.height,"data-test-id":t.dataTestId,"xml:space":"preserve"},pC,8,hC))}},yC={key:0,class:"suggestions-container"},gC={key:0,class:"logo-section"},bC={class:"help-text-section"},xC={key:0,class:"help-text"},_C={key:1,class:"sub-help-text"},CC=["onClick"],EC={key:2,class:"suggestions-list"},kC=["onClick"],vC=ve({__name:"AISuggestionsDropdown",props:{options:{type:Array,required:!0},helpText:{type:String,default:""},subHelpText:{type:String,default:""},showSuggestions:{type:Boolean,default:!1}},emits:["select","preview"],setup(t,{emit:r}){const n=t,o=r,a=e.ref(0),i=e.ref(0),l=e.ref(null),s=e.ref(null),u=c=>{l.value=c,i.value=0},h=()=>{l.value=null,a.value=0},d=c=>{o("select",c)},m=c=>{if(n.showSuggestions)switch(c.key){case"ArrowDown":c.preventDefault(),l.value?(i.value=(i.value+1)%l.value.subOptions.length,o("preview",l.value.subOptions[i.value])):(a.value=(a.value+1)%n.options.length,o("preview",n.options[a.value].title));break;case"ArrowUp":c.preventDefault(),l.value?(i.value=i.value-1<0?l.value.subOptions.length-1:i.value-1,o("preview",l.value.subOptions[i.value])):(a.value=a.value-1<0?n.options.length-1:a.value-1,o("preview",n.options[a.value].title));break;case"Enter":c.preventDefault(),l.value?d(l.value.subOptions[i.value]):u(n.options[a.value]);break;case"Escape":case"ArrowLeft":case"Backspace":l.value&&(c.preventDefault(),h());break}};return e.watch(()=>n.showSuggestions,c=>{c?(window.addEventListener("keydown",m),l.value=null,a.value=0,i.value=0):window.removeEventListener("keydown",m)}),(c,y)=>t.showSuggestions?(e.openBlock(),e.createElementBlock("div",yC,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gC,[e.createVNode(mC)])),e.createElementVNode("div",bC,[t.helpText&&!l.value?(e.openBlock(),e.createElementBlock("div",xC,e.toDisplayString(t.helpText),1)):e.createCommentVNode("",!0),t.subHelpText?(e.openBlock(),e.createElementBlock("div",_C,e.toDisplayString(t.subHelpText),1)):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",EC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.subOptions,(f,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:e.normalizeClass(["sub-option",{"sub-active":i.value===b}]),onClick:p=>d(f)},e.toDisplayString(f),11,kC))),128))])):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"suggestionsList",ref:s,class:"suggestions-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(f,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:e.normalizeClass(["suggestion-item",{active:a.value===b}]),onClick:p=>u(f)},e.toDisplayString(f.title),11,CC))),128))],512))])):e.createCommentVNode("",!0)}},[["__scopeId","data-v-bbb514b3"]]),AC={class:"chat-file-info"},wC={class:"ect-flex ect-gap-2 ect-items-center ect-self-stretch ect-my-auto ect-text-xs ect-font-medium ect-text-black"},NC=["src"],SC={class:"ect-self-stretch ect-my-auto"},BC={key:0,class:"ect-flex ect-gap-2 ect-justify-center ect-items-center ect-self-stretch ect-my-auto ect-w-4 ect-h-4"},IC=ve({__name:"ChatInputFileInfo",props:{fileInfo:{type:Object,required:!0}},emits:["cancel"],setup(t,{emit:r}){const n=r,o=()=>{n("cancel")};return(a,i)=>(e.openBlock(),e.createElementBlock("div",AC,[e.createElementVNode("div",wC,[e.createElementVNode("img",{loading:"lazy",src:t.fileInfo.fileType==="csv"?e.unref(Qc):e.unref(Zc),class:"ect-object-contain ect-shrink-0 ect-self-stretch ect-my-auto ect-w-7 ect-aspect-square",alt:""},null,8,NC),e.createElementVNode("div",SC,e.toDisplayString(t.fileInfo.fileName),1)]),t.fileInfo.status==="uploading"?(e.openBlock(),e.createElementBlock("div",BC,[e.createVNode(ma,{size:18})])):e.createCommentVNode("",!0),t.fileInfo.status==="uploaded"?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ect-flex ect-gap-2 ect-justify-center ect-items-center ect-self-stretch ect-my-auto ect-w-4 ect-h-4",onClick:o},[e.createVNode(Be,{icon:"close",size:"8"})])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-24d881bd"]]),TC={class:"chat-input-wrapper"},OC={class:"chat-input-inner"},DC={class:"input-row"},VC=["disabled","placeholder","onKeydown"],FC={key:1,class:"icon-wrapper"},MC={class:"icon-wrapper"},RC=ve({__name:"chatInput",props:{modelValue:{type:String,default:""},loading:{type:Boolean,default:!1},placeholder:{type:String,default:"Ask Genesis AI"},helpText:{type:String,default:"Here are few areas where I can help"},subHelpText:{type:String,default:"Suggestions by Genesis (Click to Apply)"},showFile:{type:Boolean,default:!1},showMic:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","submit","speak","file-upload-status"],setup(t,{emit:r}){const n=t,o=r;Un();const a=Mt(),i=Jn(),l=e.ref({}),s=e.ref(!1),u=e.ref(!1),h=e.ref(n.modelValue),d=e.ref(null),m=e.computed(()=>{const k=i.currentStep||null;return(Array.isArray(k==null?void 0:k.promptGuidance)?k.promptGuidance:[]).slice().sort((w,v)=>Number((w==null?void 0:w.sequenceNumber)??0)-Number((v==null?void 0:v.sequenceNumber)??0)).map(w=>{const S=(Array.isArray(w==null?void 0:w.relatedPG)?w.relatedPG:[]).slice().sort((I,R)=>Number((I==null?void 0:I.sequenceNumber)??0)-Number((R==null?void 0:R.sequenceNumber)??0)).map(I=>I.pgName);return{title:w.pgName,subOptions:S}})}),c=e.computed(()=>{var k;return(k=m.value)!=null&&k.length?m.value:[]}),y=e.computed(()=>{var k;return(k=m.value)!=null&&k.length?"Prompt Guidance":n.helpText});e.watch(()=>n.loading,async(k,B)=>{!k&&B&&(await e.nextTick(),d.value.focus())}),e.watch(h,k=>{o("update:modelValue",k),e.nextTick(()=>_())}),e.watch(()=>n.modelValue,k=>{h.value=k});const f=k=>{console.info("[ERROR]: File upload error:",k),a.handleError(k,"ChatInput")},b=()=>{h.value.trim()&&(u.value=!1,o("submit",h.value),h.value="",d.value&&(d.value.style.height="32px"),l.value=null)},p=k=>{h.value=k,u.value=!1,e.nextTick(()=>{_(),d.value&&(d.value.focus(),d.value.selectionStart=d.value.selectionEnd=h.value.length)})},x=k=>{h.value=k,e.nextTick(()=>_())},g=()=>{u.value=!1},C=k=>{console.info("handleFileUploadStatus event = ",k),k!=null&&k.fileName?(l.value=k,o("file-upload-status",k)):(l.value=null,s.value=!0,o("file-upload-status",null),setTimeout(()=>{s.value=!1},3e3))},_=()=>{const k=d.value;if(!k)return;k.style.height="auto";const w=Math.max(32,Math.min(k.scrollHeight,120));k.style.height=`${w}px`},E=()=>{console.info("removeFile"),l.value=null,s.value=!0,o("file-upload-status",null),setTimeout(()=>{s.value=!1},100)},A=()=>{u.value=!1,_()};return(k,B)=>{var w,v,S,I,R;const D=e.resolveDirective("click-outside");return e.withDirectives((e.openBlock(),e.createElementBlock("div",TC,[e.createVNode(vC,{options:c.value,"help-text":y.value,"sub-help-text":t.subHelpText,"show-suggestions":u.value,onSelect:p,onPreview:x},null,8,["options","help-text","sub-help-text","show-suggestions"]),e.createElementVNode("div",OC,[e.createElementVNode("div",DC,[e.createElementVNode("div",{class:e.normalizeClass(["icon-wrapper",{"active-suggestions":u.value,disabled:((w=c.value)==null?void 0:w.length)<=0}])},[e.createVNode(Be,{disabled:((v=c.value)==null?void 0:v.length)<=0||t.loading,color:((S=c.value)==null?void 0:S.length)<=0?"#DEDEDE":u.value?"#198708":"#828282",icon:"suggestions",size:"13",height:15,onClick:B[0]||(B[0]=z=>u.value=!u.value)},null,8,["disabled","color"])],2),e.withDirectives(e.createElementVNode("textarea",{ref_key:"textareaRef",ref:d,"onUpdate:modelValue":B[1]||(B[1]=z=>h.value=z),disabled:t.loading,placeholder:t.placeholder,rows:"1",onKeydown:e.withKeys(e.withModifiers(b,["exact","prevent"]),["enter"]),onInput:A},null,40,VC),[[e.vModelText,h.value]]),t.showFile?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["icon-wrapper",{"file-upload-disabled":t.loading}])},[e.createVNode(fC,{"reset-file-input":s.value,onUploadStatus:C,onError:f},null,8,["reset-file-input"])],2)):e.createCommentVNode("",!0),t.showMic?(e.openBlock(),e.createElementBlock("div",FC,[e.createVNode(Be,{color:"#828282",disabled:t.loading,icon:"mic",size:"13",height:15,onClick:B[2]||(B[2]=z=>k.$emit("speak"))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createElementVNode("div",MC,[(e.openBlock(),e.createBlock(Be,{key:1,disabled:t.loading,icon:"send",size:"20",onClick:b},null,8,["disabled"]))])]),((I=l.value)==null?void 0:I.status)==="uploading"||((R=l.value)==null?void 0:R.status)==="uploaded"?(e.openBlock(),e.createBlock(IC,{key:0,class:"ect-mt-3 ect-mb-0.5","file-info":l.value,onCancel:E},null,8,["file-info"])):e.createCommentVNode("",!0)])])),[[D,g]])}}},[["__scopeId","data-v-e205d71c"]]),LC=["data-test-id"],PC=["data-test-id"],qC=["data-test-id"],$C=ve({__name:"aiChat",props:{dataTestId:{type:String,required:!0},isExternalGuidance:{type:Boolean,required:!1,default:!1},styles:{type:Object,required:!1,default:()=>({}),validator:t=>typeof(t==null?void 0:t.height)=="string"}},emits:["component-action"],setup(t,{emit:r}){const n=Jn(),o=r,a=Un(),i=e.ref(null),l=e.computed(()=>{var m;return((m=n.getCurrentStepLinks)==null?void 0:m.call(n))||[]}),s=e.computed(()=>!0),u=m=>{console.info("[aiChat] handleSubmit",{hasFileData:!!i.value,messageLength:(m||"").length}),i.value?(console.info("[aiChat] sending with file attachment"),a.sendMessage(m,!0,i.value)):(console.info("[aiChat] sending without attachment"),a.sendMessage(m))},h=m=>{console.info("ChatScreen handleFileUploadStatus event = ",m),m!=null&&m.fileData?(i.value=m.fileData,a.attachmentData={size:m.size,type:m.fileType,name:m.fileName}):(i.value=null,a.attachmentData=null)},d=m=>{o("component-action",m)};return(m,c)=>(e.openBlock(),e.createElementBlock("div",{class:"chat-screen","data-test-id":t.dataTestId},[e.createElementVNode("div",{class:e.normalizeClass(["messages-container",{"playbook-steps-mode-hybrid":e.unref(n).playbookStepsMode==="hybrid","playbook-steps-mode-full":e.unref(n).playbookStepsMode==="full","dxp-guiddance":t.isExternalGuidance}]),style:e.normalizeStyle({maxHeight:`calc(${t.styles.height} - 72px)`,height:`calc(${t.styles.height} - 72px)`}),"data-test-id":`${t.dataTestId}-messages-container`},[e.createVNode(uC,{messages:e.unref(a).chatHistory,"loading-message":e.unref(a).loadingMessage,"undo-id":e.unref(a).latestDMLRequest,"button-links":l.value,"strikethrough-ids":e.unref(a).strikethroughHistory,"data-changed":e.unref(a).dataManuallyChanged,"data-test-id":`${t.dataTestId}-messages`,onComponentAction:d},null,8,["messages","loading-message","undo-id","button-links","strikethrough-ids","data-changed","data-test-id"])],14,PC),e.createElementVNode("div",{class:"input-container","data-test-id":`${t.dataTestId}-input-container`},[e.createVNode(RC,{modelValue:e.unref(a).promptMessage,"onUpdate:modelValue":c[0]||(c[0]=y=>e.unref(a).promptMessage=y),disabled:!s.value,"file-info":i.value,loading:!!e.unref(a).loadingMessage,"data-test-id":`${t.dataTestId}-input`,onSubmit:u,onFileUploadStatus:h},null,8,["modelValue","disabled","file-info","loading","data-test-id"])],8,qC)],8,LC))}},[["__scopeId","data-v-dcfc28bd"]]),UC={class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"configurator-not-found"},zC={class:"ect-max-w-[720px] ect-p-[50px] ect-border ect-rounded-lg ect-bg-white ect-shadow-sm"},jC={class:"ect-text-[40px] ect-leading-none ect-mb-3"},HC=e.createElementVNode("div",{class:"ect-text-[22px] ect-font-normal ect-leading-normal ect-mb-[12px] ect-capitalize ect-text-[#5F5F5F]","data-test-id":"configurator-not-found-title"}," Product Configurator Not Found ",-1),GC=e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500","data-test-id":"configurator-not-found-subtitle"}," Linked composable product configurator UI component for this screen is not found OR the composable product configurator UI component does not exist. Please create / connect one and try again. ",-1),KC={class:"ect-mt-4 ect-flex ect-items-center ect-justify-between ect-gap-6"},XC={__name:"MoleculeConfiguratorNotFound",emits:["return","go-cart"],setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",UC,[e.createElementVNode("div",zC,[e.createElementVNode("div",jC,[e.createVNode(Be,{icon:"error",size:48})]),HC,GC,e.createElementVNode("div",KC,[e.createElementVNode("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:n[0]||(n[0]=o=>r.$emit("return")),"data-test-id":"configurator-not-found-return"}," RETURN TO PRODUCT RESULTS "),e.createElementVNode("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:n[1]||(n[1]=o=>r.$emit("go-cart")),"data-test-id":"configurator-not-found-go-to-cart"}," GO TO CART ")])])]))}},n0=t=>(e.pushScopeId("data-v-bf75aa89"),t=t(),e.popScopeId(),t),WC={class:"ect-h-full ect-w-full ect-bg-white","data-test-id":"aiComponentLoader-wrapper"},QC={key:2,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"aiComponentLoader-cart-error"},ZC=[n0(()=>e.createElementVNode("div",{class:"ect-text-center"},[e.createElementVNode("div",{class:"ect-text-base ect-font-medium ect-text-red-600","data-test-id":"aiComponentLoader-cart-error-title"}," Quote Required "),e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-cart-error-message"}," A quote is required for the cart component to work. Please ensure a quoteId is provided in the session prop. ")],-1))],JC={key:5,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center"},YC={class:"ect-text-center"},eE=n0(()=>e.createElementVNode("div",{class:"ect-text-base ect-font-medium","data-test-id":"aiComponentLoader-fallback-title"}," No component to display for this step ",-1)),tE={class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-fallback-subtitle"},nE=ve({__name:"aiComponentLoader",props:{stepComponent:{type:String,default:null},identity:{type:Object,default:()=>({})},session:{type:Object,default:()=>({})},security:{type:Object,default:()=>({})},packageVersion:{type:String,default:""},composablesOrgType:{type:String,default:""},composablesApiKey:{type:String,default:""},templateId:{type:String,default:""},hostName:{type:String,default:""},graphqlEndpoint:{type:String,default:""},apiKey:{type:String,default:""},isPreview:{type:Boolean,default:!1},sections:{type:Array,default:()=>[]},theme:{type:Object,default:()=>({})},catalogPreviewData:{type:Object,default:()=>({})},catalogInitialData:{type:Array,default:()=>[]},catalogSearchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},cartSections:{type:String,default:""},configItemId:{type:String,default:""},configQliId:{type:String,default:""},configApiKey:{type:String,default:""},functions:{type:Object,default:()=>({})},resources:{type:Object,required:!1}},emits:["expeditecart-clicked","ai-guidance:error","catalog-quote-created","catalog-quote-updated","catalog-items-loaded","catalog-item-added","catalog-item-qty-updated","catalog-line-deleted","catalog-items-fetched","catalog-item-configure"],setup(t,{emit:r}){const n=r,o=t,a=Jn(),i=Ci(),l=ft(),s=e.computed(()=>{var j,H,Z,te,ne;const L=((j=o.session)==null?void 0:j.quoteId)||((H=l.quoteId)==null?void 0:H.value)||((Z=a==null?void 0:a.activeComponentData)==null?void 0:Z.contextObjectId)||((ne=(te=a==null?void 0:a.activeComponentData)==null?void 0:te.payload)==null?void 0:ne.contextObjectId);return{...o.session,...L&&{quoteId:L},qliId:p.value||o.configQliId||void 0,itemId:b.value}}),u=e.computed(()=>{const L=o.functions||{},j=L.createQuote;return typeof j!="function"?L:{...L,createQuote:async(...H)=>{const Z=await j(...H);return Z&&l.updateConfig({quoteId:Z}),Z}}}),h=e.computed(()=>{const L=a==null?void 0:a.activeComponentKey,j=o.stepComponent;return(L||j||"").toString().trim().toLowerCase().replace(/[^a-z0-9]+/g,"_")}),d=e.computed(()=>{var te,ne;const L=!!o.templateId,j=!!((te=o.identity)!=null&&te.organizationId),H=!!((ne=o.identity)!=null&&ne.accountId),Z=typeof o.cartSections=="string"&&o.cartSections.length>0;return L&&j&&H&&Z}),m=e.computed(()=>{var Z,te,ne,Q,ce;const L=(Z=o.session)==null?void 0:Z.quoteId,j=(te=l.quoteId)==null?void 0:te.value,H=((ne=a==null?void 0:a.activeComponentData)==null?void 0:ne.contextObjectId)||((ce=(Q=a==null?void 0:a.activeComponentData)==null?void 0:Q.payload)==null?void 0:ce.contextObjectId);return!!(L||j||H)}),c=e.computed(()=>{var j,H,Z,te,ne;const L=((j=o.session)==null?void 0:j.quoteId)||((H=l.quoteId)==null?void 0:H.value)||((Z=a==null?void 0:a.activeComponentData)==null?void 0:Z.contextObjectId)||((ne=(te=a==null?void 0:a.activeComponentData)==null?void 0:te.payload)==null?void 0:ne.contextObjectId);return{...o.session,...L&&{quoteId:L}}}),y=e.computed(()=>{var j;if(Array.isArray(o.catalogInitialData)&&o.catalogInitialData.length>0)return o.catalogInitialData;const L=((j=a==null?void 0:a.activeComponentData)==null?void 0:j.payload)||{};if(L.catalog&&typeof L.catalog=="object")try{const Z=Object.values(L.catalog).map(te=>{var ne;return(ne=te==null?void 0:te.catalogResponse)==null?void 0:ne.productInfo}).filter(Boolean);if(Z.length>0)return Z}catch{}return Array.isArray(L.initialData)&&L.initialData.length>0?L.initialData:Array.isArray(L.catalogInitialData)&&L.catalogInitialData.length>0?L.catalogInitialData:Array.isArray(L.items)&&L.items.length>0?L.items:[]}),f=e.computed(()=>{var j;const L=((j=a==null?void 0:a.activeComponentData)==null?void 0:j.payload)||{};return o.catalogSearchTerm||L.searchTerm||""}),b=e.computed(()=>{var H,Z,te,ne,Q,ce,ue,pe;const L=(te=(Z=(H=a==null?void 0:a.activeComponentData)==null?void 0:H.payload)==null?void 0:Z.productConfiguration)==null?void 0:te[0],j=((ue=(ce=(Q=(ne=a==null?void 0:a.activeComponentData)==null?void 0:ne.payload)==null?void 0:Q.savedProducts)==null?void 0:ce[0])==null?void 0:ue.itemId)||(L==null?void 0:L.itemId)||((pe=L==null?void 0:L.product)==null?void 0:pe.itemId)||"";return o.configItemId||j||""}),p=e.computed(()=>{var j,H,Z,te,ne,Q;const L=(te=(Z=(H=(j=a==null?void 0:a.activeComponentData)==null?void 0:j.payload)==null?void 0:H.savedProducts)==null?void 0:Z[0])==null?void 0:te.qliId;if(!L){const ce=(Q=(ne=a==null?void 0:a.activeComponentData)==null?void 0:ne.payload)==null?void 0:Q.productConfiguration,ue=Array.isArray(ce)&&ce.length>0?ce[0]:null;if(ue){const pe=ue==null?void 0:ue.product;if(pe!=null&&pe.qliId)return pe.qliId;if(ue!=null&&ue.qliId)return ue.qliId}}return L||""}),x=e.computed(()=>!!b.value),g=e.computed(()=>h.value==="configurator"&&!x.value?"Configurator requires an itemId (and optional qliId). Provide via playbook payload or props.":h.value==="catalog"?"Catalog step is active. Provide templateId/sections/theme when available.":h.value==="cart"?"Cart step is active.":"Awaiting playbook step selection."),C=e.computed(()=>{try{return JSON.stringify((a==null?void 0:a.activeComponentData)||{})}catch{return""}}),_=e.computed(()=>`catalog::${C.value}`),E=e.computed(()=>`cart::${C.value}`),A=e.computed(()=>{var L;try{return(((L=a==null?void 0:a.activeComponentData)==null?void 0:L.actionFunction)||"")==="Reload"}catch{return!1}}),k=e.computed(()=>{var j;const L=`configurator::${b.value||""}::${p.value||""}`;if(A.value){const H=((j=a==null?void 0:a.activeComponentData)==null?void 0:j.requestId)||"";return`${L}::${H}`}return L}),{emitError:B,emitErrors:D}=Wc(n,"aiComponentLoader"),w=()=>{const L=q7(a,h.value);D(L)},v=e.ref([]),S=e.ref(null),I=L=>{const j=Array.isArray(L)?L:Array.isArray(L==null?void 0:L.items)?L.items:[];if(!Array.isArray(j))return;const H={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},Z=Q=>(Q==null?void 0:Q.requiresConfiguration)||"",te=Q=>!!Q&&Q in H,ne=j.filter(Q=>te(Z(Q)));ne.sort((Q,ce)=>{const ue=Z(Q),pe=Z(ce);return(H[ue]||99)-(H[pe]||99)}),v.value=ne,S.value=ne.length?ne[0]:null},R=L=>{console.log("onQuoteCreated",L),n("catalog-quote-created",L)},z=L=>{console.log("onQuoteUpdated",L),n("catalog-quote-updated",L)},$=L=>{console.log("onItemAdded",L),n("catalog-item-added",L)},X=L=>{console.log("onItemQtyUpdated",L),n("catalog-item-qty-updated",L)},W=L=>{console.log("onLineDeleted",L),n("catalog-line-deleted",L)},K=L=>{console.log("onQuoteItemsFetched",L),n("catalog-items-fetched",L)};e.watch(()=>h.value,(L,j)=>{var H,Z,te,ne,Q,ce,ue,pe,ie,de;if(L==="configurator"){const _e=!!((te=(Z=(H=a==null?void 0:a.activeComponentData)==null?void 0:H.payload)==null?void 0:Z.savedProducts)!=null&&te.length),xe=((ce=(Q=(ne=a==null?void 0:a.activeComponentData)==null?void 0:ne.payload)==null?void 0:Q.productConfiguration)==null?void 0:ce.length)>0;if(!_e&&!xe&&S.value&&!b.value){const ye=((ue=S.value)==null?void 0:ue.itemId)||"";if(ye){const oe=((pe=a==null?void 0:a.currentPlaybook)==null?void 0:pe.playBookSteps)||[],le=se=>String(se||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");let be=null;const Ce=oe.findIndex(se=>se.stepName===(a==null?void 0:a.currentStepName));if(Ce>=0&&oe[Ce+1]&&le((ie=oe[Ce+1])==null?void 0:ie.stepComponent)==="configurator")be=oe[Ce+1].stepName;else{const se=oe.findIndex(fe=>le(fe==null?void 0:fe.stepComponent)==="configurator");be=se>=0?(de=oe[se])==null?void 0:de.stepName:null}const J={payload:{savedProducts:[{itemId:ye}]}};be?a.navigateToStep({stepName:be,data:J}):a.loadComponent("configurator",J)}}}});const P=()=>{var Z,te;const L=((Z=a==null?void 0:a.currentPlaybook)==null?void 0:Z.playBookSteps)||[],j=ne=>String(ne||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),H=L.findIndex(ne=>j(ne==null?void 0:ne.stepComponent)==="catalog"||j(ne==null?void 0:ne.stepName).includes("catalog"));if(H>=0){const ne=(te=L[H])==null?void 0:te.stepName;a.navigateToStep({stepName:ne})}else a.loadComponent("catalog")},N=()=>{var Z,te;const L=((Z=a==null?void 0:a.currentPlaybook)==null?void 0:Z.playBookSteps)||[],j=ne=>String(ne||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),H=L.findIndex(ne=>j(ne==null?void 0:ne.stepComponent)==="cart"||j(ne==null?void 0:ne.stepName).includes("cart"));if(H>=0){const ne=(te=L[H])==null?void 0:te.stepName;a.navigateToStep({stepName:ne})}else a.loadComponent("cart")},T=L=>{var j,H;console.log("onItemConfigureClicked",L),n("catalog-item-configure",L);try{const Z=(L==null?void 0:L.itemId)||"",te=(L==null?void 0:L.qliId)||(L==null?void 0:L.QliId)||"",ne=[];if(Z){const ie={itemId:Z};te&&(ie.qliId=te),ne.push(ie)}const Q={payload:{savedProducts:ne}},ce=((j=a==null?void 0:a.currentPlaybook)==null?void 0:j.playBookSteps)||[],ue=ie=>String(ie||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),pe=ce.findIndex(ie=>{const de=ue(ie==null?void 0:ie.stepComponent),_e=ue(ie==null?void 0:ie.stepName);return de==="configurator"||_e.includes("configure")});if(pe>=0){const ie=(H=ce[pe])==null?void 0:H.stepName;a.navigateToStep({stepName:ie,data:Q})}else a.loadComponent("configurator",Q)}catch(Z){console.warn("[aiComponentLoader] Failed to navigate to configurator from configure click:",Z),a.loadComponent("configurator",{payload:{}})}},O=L=>{console.log("onCartClicked",L),n("expeditecart-clicked",L)},F=L=>{var j,H;try{const Z=(L==null?void 0:L.itemId)||"",te=(L==null?void 0:L.lineItemId)||(L==null?void 0:L.qliId)||"",ne=[];if(Z){const ie={itemId:Z};te&&(ie.qliId=te),ne.push(ie)}const Q={payload:{savedProducts:ne}},ce=((j=a==null?void 0:a.currentPlaybook)==null?void 0:j.playBookSteps)||[],ue=ie=>String(ie||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),pe=ce.findIndex(ie=>{const de=ue(ie==null?void 0:ie.stepComponent),_e=ue(ie==null?void 0:ie.stepName);return de==="configurator"||_e.includes("configure")});if(pe>=0){const ie=(H=ce[pe])==null?void 0:H.stepName;a.navigateToStep({stepName:ie,data:Q})}else a.loadComponent("configurator",Q)}catch(Z){console.warn("[aiComponentLoader] Failed to navigate to configurator from cart configure click:",Z),a.loadComponent("configurator",{payload:{}})}},q=L=>{console.log("onCatalogIdReceived",L),l.updateConfig({eCatalogId:L})},M=L=>{console.log("Action",L),L.event==="add-to-quote"?n("configurator:add-to-quote",L.data):L.event==="save"&&n("configurator:save",L.data)},U=e.ref("");return e.watch(()=>a==null?void 0:a.activeComponentData,async L=>{var H,Z,te,ne;if(!L)return;console.log("activeComponentData Changed",L);const j=(L==null?void 0:L.requestId)||"";if(console.log("requestId",j),console.log("lastReloadRequestId",U.value),j&&j!==U.value)if(U.value=j,await e.nextTick(),((Z=(H=L==null?void 0:L.payload)==null?void 0:H.productConfiguration)==null?void 0:Z.length)>0){const Q=(te=L==null?void 0:L.payload)==null?void 0:te.productConfiguration[0],ce=(Q==null?void 0:Q.itemId)||((ne=Q==null?void 0:Q.product)==null?void 0:ne.itemId)||"";i.setPreConfigData(L==null?void 0:L.payload,ce)}else(L==null?void 0:L.actionFunction)==="Reload"&&(console.log("Reloading configurator 1"),i.refresh())},{deep:!0}),e.onMounted(()=>{e.nextTick(()=>{w()})}),(L,j)=>(e.openBlock(),e.createElementBlock("div",WC,[h.value==="catalog"?(e.openBlock(),e.createBlock(wr,{key:_.value,"data-test-id":"aiComponentLoader-catalog",class:"ect-h-full ect-w-full","template-id":t.templateId,identity:t.identity,session:t.session,security:t.security,"search-term":f.value,"on-catalog-count-update":t.onCatalogCountUpdate,"preview-data":t.catalogPreviewData,"initial-data":y.value,sections:t.sections,theme:t.theme,"composables-org-type":t.composablesOrgType,onCatalogQuoteCreated:R,onCatalogQuoteUpdated:z,onCatalogItemsLoaded:I,onCatalogItemAdded:$,onCatalogItemQtyUpdated:X,onCatalogLineDeleted:W,onCatalogItemsFetched:K,onCatalogItemConfigure:T,"onCatalog:id":q},null,8,["template-id","identity","session","security","search-term","on-catalog-count-update","preview-data","initial-data","sections","theme","composables-org-type"])):h.value==="cart"&&d.value&&m.value?(e.openBlock(),e.createBlock(Nr,{key:E.value,"data-test-id":"aiComponentLoader-cart",class:"ect-h-full ect-w-full","template-id":t.templateId,"host-name":t.hostName,"composables-org-type":t.composablesOrgType,security:t.security,identity:t.identity,session:c.value,onExpeditecartItemConfigure:F,onExpeditecartClicked:O},null,8,["template-id","host-name","composables-org-type","security","identity","session"])):h.value==="cart"&&d.value&&!m.value?(e.openBlock(),e.createElementBlock("div",QC,ZC)):h.value==="configurator"&&x.value?(e.openBlock(),e.createBlock(yr,{key:k.value,"data-test-id":"aiComponentLoader-configurator",class:"ect-h-full ect-w-full",security:t.security,identity:t.identity,resources:t.resources,"user-locale":L.userLocale,cart:!0,"composables-org-type":t.composablesOrgType,session:s.value,functions:u.value,onReady:e.unref(i).setExpediteConfigComp,onAction:M},null,8,["security","identity","resources","user-locale","composables-org-type","session","functions","onReady"])):h.value==="configurator"&&!x.value?(e.openBlock(),e.createBlock(XC,{key:4,onReturn:P,onGoCart:N})):(e.openBlock(),e.createElementBlock("div",JC,[e.createElementVNode("div",YC,[eE,e.createElementVNode("div",tE,e.toDisplayString(g.value),1)])]))]))}},[["__scopeId","data-v-bf75aa89"]]),oE={class:"ai-guidance-loader","data-test-id":"aiGuidance-loader-container"},rE={"data-test-id":"aiGuidance-loader-text"},aE={class:"aig-button","data-test-id":"aiGuidance-loader-button"},iE={class:"aig-input-box","data-test-id":"aiGuidance-loader-input"},lE=ve({__name:"AiGuidanceLoader",props:{errors:{type:Array,required:!1,default:()=>[]},chatBgColor:{type:String,required:!1,default:""}},setup(t){const r=t,n=e.computed(()=>`linear-gradient(180deg, ${r.chatBgColor} 0%, transparent 100%)`);return(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"chat-gradient",style:e.normalizeStyle({background:n.value})},null,4),e.createElementVNode("div",oE,[e.createElementVNode("div",rE,[e.createVNode(So,{style:{width:"100%",height:"16px","margin-bottom":"8px"}}),e.createVNode(So,{style:{width:"100%",height:"16px","margin-bottom":"32px","max-width":"481px"}})]),e.createElementVNode("div",aE,[e.createVNode(So,{style:{width:"100%",height:"24px"}})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.errors,i=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"aig-message-error","data-test-id":"aiGuidance-loader-error"},e.toDisplayString(i),1))),128)),e.createElementVNode("div",iE,[e.createVNode(So,{style:{height:"36px",width:"100%"}})])])],64))}},[["__scopeId","data-v-5e4a9913"]]),sE={class:"ai-guidance-wrapper","data-test-id":"aiGuidance-wrapper"},Qi=ve({__name:"aiGuidance",props:{templateId:{type:String,required:!1},playbookData:{type:Object,required:!1},composablesOrgType:{type:String,required:!0},identity:{type:Object,required:!1,default:()=>({})},session:{type:Object,required:!1,default:()=>({})},security:{type:Object,required:!1,default:()=>({})},functions:{type:Object,required:!1,default:()=>({})},websocketUrl:{type:String,required:!0},packageVersion:{type:String,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},isPreview:{type:Boolean,required:!1,default:!1},catalogSections:{type:Array,required:!1,default:()=>[]},cartSections:{type:String,required:!1,default:""},theme:{type:Object,required:!1,default:()=>({})},styles:{type:Object,required:!1,default:()=>({height:"100vh"}),validator:t=>typeof(t==null?void 0:t.height)=="string"},resources:{type:Object,required:!1,default:()=>({})}},emits:["expeditecart-item-configure","expeditecart-clicked","component-action","ai-response:success","quote-id:updated","ai-guidance:error"],setup(t,{emit:r}){const n=Jn(),o=ft(),a=Un(),i=Co(),l=r,s=e.ref(!0),u=e.ref(!1),h=e.ref(!0),d=e.ref(!0),m=e.ref(!1),c=e.ref([]),{emitError:y,emitErrors:f}=Wc(l,"aiGuidance"),b=t,{composablesOrgType:p,websocketUrl:x,packageVersion:g,identity:C,session:_,security:E,functions:A,templateId:k,hostName:B,graphqlEndpoint:D,apiKey:w,isPreview:v,catalogSections:S,cartSections:I,theme:R}=b,z=e.computed(()=>{var F,q,M;return{...b.session||{},quoteId:((F=b.session)==null?void 0:F.quoteId)||(((q=o.quoteId)==null?void 0:q.value)??""),eCatalogId:(M=o.eCatalogId)==null?void 0:M.value}});e.onBeforeMount(async()=>{var F;console.log("security",E),console.log("apiKey",w),o.updateConfig({userId:C==null?void 0:C.userId,organizationId:C==null?void 0:C.organizationId,accessToken:E==null?void 0:E.accessToken,composablesApiUrl:E==null?void 0:E.baseUrl,composablesOrgType:p,websocketUrl:x,quoteId:_==null?void 0:_.quoteId,packageVersion:g,accountId:C==null?void 0:C.accountId,templateId:k,hostName:B,graphqlEndpoint:D,apiKey:(E==null?void 0:E.apiKey)||w,cid:C==null?void 0:C.contactId,isPreview:v,siteUrl:(F=b.resources)==null?void 0:F.siteUrl})}),e.onMounted(async()=>{var j,H,Z,te;const F=L7(b,C,E);f(F);const q=Xc(x);if(q&&y(q),F.length>0||q){s.value=!1;return}n.setSecretKey(E==null?void 0:E.accessToken);let M=null,U,L;try{M=await n.getPlaybookInfoFromQuote(),U=(M==null?void 0:M.XX_ORD1__Completed_PB_Step_Number_EX__c)??void 0,L=(M==null?void 0:M.XX_ORD1__Playbook_Current_Step_Meta_EX__c)??void 0}catch(ne){console.error("[aiGuidance] Failed to get playbook info from quote:",ne),y("AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED",{error:ne.message})}if(L)try{L=JSON.parse(L)}catch(ne){console.error("[aiGuidance] Failed to parse currentStepMetaServer:",ne),y("AI_GUIDANCE_JSON_PARSE_ERROR",{error:ne.message,data:"currentStepMetaServer"}),L=void 0}if(console.info("sequenceNumberServer = ",U),b.templateId){s.value=!0;try{const Q=await n.getCatalogInContext();console.log("catalogInContext = ",Q),Q&&o.updateConfig({eCatalogId:Q})}catch(Q){console.error("[aiGuidance] Failed to get catalog in context:",Q),y("AI_GUIDANCE_CATALOG_FETCH_FAILED",{error:Q.message})}let ne=null;try{await i.fetchBlockInformationREST({templateId:b.templateId});const Q=P7(i.pageBlocks);ne=Q.playbookId,Q.error&&y(Q.error,{error:"Block structure validation failed"}),ne||y("AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING",{pageBlocks:i.pageBlocks})}catch(Q){console.error("[aiGuidance] Failed to fetch block information:",Q),y("AI_GUIDANCE_BLOCK_FETCH_FAILED",{error:Q.message})}if(console.log("playbookID",ne),ne?u.value=!0:c.value.push("No playbook ID found in template"),n.setEmbeddedMode(!0),ne)try{n.currentPlaybook=ne,await n.getPlaybookByKey(ne),n.showPlaybookSteps=!0}catch(Q){console.error("[aiGuidance] Failed to get playbook by key:",Q),y("AI_GUIDANCE_PLAYBOOK_FETCH_FAILED",{error:Q.message,playbookID:ne})}n.playbookStepsMode="full",a.setInitialPayload();try{await a.connectSocket()}catch(Q){console.error("[aiGuidance] Failed to connect socket:",Q),y("WEBSOCKET_CONNECTION_FAILED",{error:Q.message})}if(U!==void 0){n.navigateToStep({stepName:(H=(j=n.currentPlaybook)==null?void 0:j.playBookSteps[Number(U)])==null?void 0:H.stepName,data:L}),s.value=!1;return}(te=(Z=n.currentPlaybook)==null?void 0:Z.playBookSteps)!=null&&te.length&&n.setCurrentStepName(n.currentPlaybook.playBookSteps[0].stepName),s.value=!1}else c.value.push("templateId is required")});const $=e.computed(()=>{var M;const F=((M=n.currentPlaybook)==null?void 0:M.playBookSteps)||[],q=n.currentStepName;return F.find(U=>U.stepName===q)||F[0]||null}),X=e.computed(()=>{var F;return((F=$.value)==null?void 0:F.stepComponent)||null});e.watch(()=>n.activeComponentKey,F=>{F&&(h.value=!1)});const W=[];e.onMounted(()=>{W.push(Lt("expeditecart:configure-clicked",F=>{l("expeditecart-item-configure",F)})),W.push(Lt("expeditecart:clicked",F=>{l("expeditecart-clicked",F)})),W.push(Lt("ai-response:success",F=>{try{l("ai-response:success",F)}catch{}})),W.push(Lt("quote-id:updated",F=>{try{l("quote-id:updated",F)}catch(q){console.info("[aiGuidance] Error emitting quote-id:updated event:",q)}})),W.push(Lt("websocket:error",F=>{try{F!=null&&F.isInitialization&&y(F.errorCode||"WEBSOCKET_CONNECTION_FAILED",F)}catch(q){console.info("[aiGuidance] Error handling websocket error event:",q)}}))});const K=F=>{console.log("[aiGuidance] Received error from aiComponentLoader:",F),l("ai-guidance:error",F)},P=F=>{console.log("onExpediteCartClicked",F),l("component-action",{component:"cart",details:F})},N=(F,q)=>{var U;l("component-action",{component:"catalog",action:F,details:q});const M=(q==null?void 0:q.quoteId)??((U=q==null?void 0:q.response)==null?void 0:U.quoteId);if(M&&(F==="item-added"||F==="items-fetched"))try{l("quote-id:updated",{quoteId:M})}catch(L){console.info("[aiGuidance] Error emitting quote-id:updated from catalog event:",L)}},T=(F,q)=>{l("component-action",{component:"configurator",action:F,details:q})},O=F=>{l("component-action",F)};return e.onBeforeUnmount(()=>{try{a.cancelRequest()}catch{}try{a.disconnectSocket()}catch{}try{a.resetState()}catch{}try{n.setEmbeddedMode(!1),n.currentPlaybook=null,n.currentStepName=null,n.activeComponentKey=null,n.activeComponentData=null,n.showPlaybookSteps=!1,n.playbookStepsMode="full"}catch{}s.value=!1,u.value=!1,h.value=!0,d.value=!0,m.value=!1,c.value=[],W.forEach(F=>{try{F()}catch{}})}),(F,q)=>{var M;return e.openBlock(),e.createElementBlock("div",sE,[e.createVNode(pa,{icon:"logo",color:"#000000",size:"18.75",height:"16.25"}),s.value||e.unref(a).isFetchingHistory?(e.openBlock(),e.createBlock(lE,{key:0,errors:c.value,"data-test-id":"aiGuidance-loader"},null,8,["errors"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["ai-app",{"root-path":h.value,"playbook-steps-mode-full":e.unref(n).playbookStepsMode==="full","dxp-guiddance":u.value}]),style:e.normalizeStyle(t.styles)},[e.createElementVNode("div",{class:"ai-app-chat-wrapper",style:e.normalizeStyle({height:t.styles.height})},[e.createVNode($C,{"data-test-id":"chat-screen","is-external-guidance":u.value,styles:t.styles,onComponentAction:O},null,8,["is-external-guidance","styles"])],4),!h.value&&d.value&&!m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"component-loader-wrapper",style:e.normalizeStyle({height:t.styles.height,maxHeight:t.styles.height})},[e.unref(n).currentPlaybook?(e.openBlock(),e.createBlock(nE,{key:0,"template-id":((M=$.value)==null?void 0:M.templateId)||e.unref(k),"step-component":X.value,identity:e.unref(C),session:z.value,security:e.unref(E),functions:e.unref(A),"composables-org-type":e.unref(p),"package-version":e.unref(g),"host-name":e.unref(B),"graphql-endpoint":e.unref(D),"api-key":e.unref(w),"is-preview":e.unref(v),sections:e.unref(S),"cart-sections":e.unref(I),theme:e.unref(R),resources:t.resources,"data-test-id":"aiComponentLoader-mounted",onExpeditecartClicked:P,onCatalogQuoteCreated:q[0]||(q[0]=U=>N("quote-created",U)),onCatalogQuoteUpdated:q[1]||(q[1]=U=>N("quote-updated",U)),onCatalogItemsLoaded:q[2]||(q[2]=U=>N("items-loaded",U)),onCatalogItemAdded:q[3]||(q[3]=U=>N("item-added",U)),onCatalogItemQtyUpdated:q[4]||(q[4]=U=>N("item-qty-updated",U)),onCatalogLineDeleted:q[5]||(q[5]=U=>N("line-deleted",U)),onCatalogItemsFetched:q[6]||(q[6]=U=>N("items-fetched",U)),onCatalogItemConfigure:q[7]||(q[7]=U=>N("item-configure",U)),"onConfigurator:addToQuote":q[8]||(q[8]=U=>T("add-to-quote",U)),"onConfigurator:save":q[9]||(q[9]=U=>T("save",U)),"onAiGuidance:error":K},null,8,["template-id","step-component","identity","session","security","functions","composables-org-type","package-version","host-name","graphql-endpoint","api-key","is-preview","sections","cart-sections","theme","resources"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],6))])}}},[["__scopeId","data-v-7835e48c"]]),o0={ExpediteConfigurator:yr,ExpediteGPT:wa,ExpediteCatalog:wr,ExpediteCart:Nr,ExpediteAIGuidance:Qi},cE={install(t,r={}){t.component("ExpediteConfigurator",yr),t.component("ExpediteGPT",wa),t.component("ExpediteCatalog",wr),t.component("ExpediteCart",Nr),t.component("ExpediteAIGuidance",Qi)},...o0};bt.Components=o0,bt.ExpediteAIGuidance=Qi,bt.ExpediteCart=Nr,bt.ExpediteCatalog=wr,bt.ExpediteConfigurator=yr,bt.ExpediteGPT=wa,bt.default=cE,bt.useComRootStore=wo,Object.defineProperties(bt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
164
|
+
`);return g=g.replace(/^[ \t]*•[ \t]+/gm,"- "),g};return(x,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["chat-messages",{"root-path":h.value}])},[e.createElementVNode("div",{class:"chat-gradient",style:e.normalizeStyle({background:c.value})},null,4),e.createElementVNode("div",{ref_key:"chatMessagesRef",ref:o,class:"messages-wrapper"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList([...t.messages],(C,_)=>{var E;return e.openBlock(),e.createElementBlock("div",{key:_,class:e.normalizeClass(["message",{"user-message":C.type==="user"}])},[e.createElementVNode("div",nC,[C.name?(e.openBlock(),e.createElementBlock("div",oC,e.toDisplayString(C.name),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["message-text ect-relative",{"error-message":C.error,strikethrough:C.undone}]),style:e.normalizeStyle(C.type==="user"?{color:y.value,backgroundColor:m.value}:{})},[e.createElementVNode("div",rC,[e.createVNode(t0,{source:p(C.message)},null,8,["source"])]),((E=C==null?void 0:C.filesData)==null?void 0:E.length)>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(C==null?void 0:C.filesData,A=>(e.openBlock(),e.createBlock(eb,{key:A.name,info:{iconUrl:(A==null?void 0:A.type)==="csv"?e.unref(Qc):e.unref(Zc),fileName:A==null?void 0:A.name,fileSize:A==null?void 0:A.size},background:C.type=="user"?"#fff":"#f8f8f8","encoded-string":A==null?void 0:A.encodedString},null,8,["info","background","encoded-string"]))),128)):e.createCommentVNode("",!0)],6)])],2)}),128)),t.loadingMessage?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loading-message",{"thinking-message":e.unref(i).isThinkingMessage}])},[e.createElementVNode("div",{class:e.normalizeClass(["ect-flex ect-gap-3",{"ect-w-full":e.unref(i).isThinkingMessage}])},[e.createElementVNode("div",aC,[e.createElementVNode("div",iC,[e.createElementVNode("div",{ref_key:"loadingWindowRef",ref:a,class:"loading-window"},[e.createElementVNode("div",lC,[e.createVNode(t0,{source:p(t.loadingMessage)},null,8,["source"])])],512)]),e.createElementVNode("div",sC,[e.createVNode(So,{style:{height:"100%",width:"100%"}})])])],2)],2)):t.buttonLinks.length>0?(e.openBlock(),e.createElementBlock("div",cC,[e.createVNode(W7,{links:t.buttonLinks,onPerformAction:b},null,8,["links"])])):e.createCommentVNode("",!0)],512)],2))}},[["__scopeId","data-v-f47da80c"]]),dC={class:"ai-upload ect-flex-inline ect-items-center"},fC=ve({__name:"FileUpload",props:{resetFileInput:{type:Boolean,default:!1}},emits:["upload-status","error"],setup(t,{emit:r}){const n=t,o=r,a=e.ref(null),i=e.ref(""),l=e.ref(""),s=e.ref(!1);e.watch(()=>n.resetFileInput,m=>{m&&a.value&&(a.value.value="",i.value="",l.value="")});const u=m=>{const y=a.value.accept.split(",").map(b=>b.trim().toLowerCase()),f="."+m.name.split(".").pop().toLowerCase();return y.includes(f)||y.includes(m.type.toLowerCase())?!0:y.some(b=>{if(b.includes("*")){const p=b.split("*")[0];return m.type.toLowerCase().startsWith(p)}return!1})},h=async m=>{const c=m.target.files[0];if(console.info("File = ",c),c){if(!u(c)){a.value&&(a.value.value="");const f={message:"Invalid file type. Please upload a valid file type.",fileName:c.name,fileType:c.type};window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Upload Error",detail:f.message,life:5e3}),o("error",f);return}i.value=c.name,l.value=c.type.split("/").pop(),o("upload-status",{status:"uploading",fileName:i.value,fileType:l.value});const y=new FileReader;y.onload=async f=>{const b=new Blob([f.target.result],{type:c.type});console.info("Blob data:",b);try{const p=await U0(b),x={attachment:{name:c.name,data:p}};console.info("AIRequestPayload = ",x),o("upload-status",{status:"uploaded",fileName:i.value,fileType:l.value,size:El(c.size),fileData:x}),a.value&&(a.value.value="")}catch(p){console.info("[ERROR]: File upload error:",p),window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Processing Error",detail:"Error processing file: "+(p.message||"Unknown error"),life:5e3}),o("error",{message:"Error processing file",fileName:i.value,fileType:l.value,error:p.message}),o("upload-status",{status:"error",fileName:i.value,fileType:l.value})}},y.onerror=f=>{console.info("[ERROR]: FileReader error:",f),window&&window.$toast&&window.$toast.add({severity:"error",summary:"File Reading Error",detail:"Could not read the selected file",life:5e3}),o("error",{message:"Error reading file",fileName:c.name,fileType:c.type,error:f})},setTimeout(()=>{y.readAsText(c)},100)}},d=()=>{a.value.click()};return(m,c)=>(e.openBlock(),e.createElementBlock("div",dC,[e.createElementVNode("input",{ref_key:"fileInput",ref:a,type:"file",accept:".csv, .xls, .xlsx, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",class:"ect-opacity-0 ect-h-0 ect-w-0 ect-absolute",onChange:h},null,544),e.createElementVNode("button",{class:"attachment-button",onClick:d,onMouseenter:c[0]||(c[0]=y=>s.value=!0),onMouseleave:c[1]||(c[1]=y=>s.value=!1)},[e.createVNode(Be,{icon:"attachment",size:"11",height:"17",color:s.value?"#198708":"#828282"},null,8,["color"])],32)]))}},[["__scopeId","data-v-7fbbb7c9"]]),hC=["width","height","data-test-id"],pC=[e.createStaticVNode('<g transform="translate(1 1)"><g fill="#57C046"><path d="M72.991 22.112v.119c0 .588-.051 1.162-.13 1.729h12.096c.049-.61.083-1.225.083-1.849v-.122c0-.432-.016-.861-.04-1.288H72.902c.052.466.089.934.089 1.411zM12.059 22.109v-.12c0-.435.027-.863.07-1.287H.05c-.03.466-.05.934-.05 1.407v.121c0 .583.029 1.158.073 1.729h12.136a12.162 12.162 0 0 1-.15-1.85z" vector-effect="non-scaling-stroke"></path></g><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="-737.86" y1="348.135" x2="-696.809" y2="348.135" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset=".3" style="stop-color:#57c046;"></stop><stop offset="1" style="stop-color:#1c8d0a;"></stop></linearGradient><path fill="url(#a)" d="M12.059 22.109v-.12c0-6.117 4.324-11.324 10.841-11.324 8.247 0 13.073 6.397 13.073 6.397l5.078-8.799C36.944 3.258 30.544.068 23.023.068 9.866.068 0 9.938 0 22.109v.121h12.065c-.001-.04-.006-.08-.006-.121z" vector-effect="non-scaling-stroke"></path><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="-693.833" y1="326.091" x2="-652.825" y2="326.091" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset="0" style="stop-color:#1c8d0a;"></stop><stop offset=".7" style="stop-color:#57c046;"></stop></linearGradient><path fill="url(#b)" d="M72.991 22.23c0 6.117-4.32 11.325-10.831 11.325-8.238 0-13.062-6.399-13.062-6.399l-5.071 8.802c4.103 5.003 10.497 8.194 18.01 8.194 13.101 0 22.934-9.805 22.997-21.921l-12.043-.001z" vector-effect="non-scaling-stroke"></path><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="-737.86" y1="337.172" x2="-652.822" y2="337.172" gradientTransform="matrix(1 0 0 -1 737.86 359.283)" vector-effect="non-scaling-stroke"><stop offset=".14" style="stop-color:#57c046;"></stop><stop offset=".37" style="stop-color:#97d952;"></stop><stop offset=".59" style="stop-color:#c3eb5b;"></stop><stop offset=".86" style="stop-color:#57c046;"></stop></linearGradient><path fill="url(#c)" d="m42.533 33.78.071-.028s9.631-16.844 10.384-18.051c2.378-3.72 5.028-5.034 9.05-5.034 6.511 0 10.952 5.329 10.952 11.445v.119h12.045c0-.04.003-.079.003-.119v-.122C85.038 9.819 75.303.072 62.161.072c-8.515 0-15.645 4.144-19.615 10.371l-.071.026s-9.641 16.845-10.394 18.052c-2.38 3.721-5.033 5.035-9.059 5.035-6.473 0-10.899-5.259-10.958-11.324H0c0 12.171 9.745 21.92 22.9 21.92 8.522-.001 15.659-4.147 19.633-10.372z" vector-effect="non-scaling-stroke"></path></g>',1)],mC={__name:"ExpediteLogo",props:{width:{type:Number,default:38},height:{type:Number,default:20},dataTestId:{type:String,default:""}},setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",overflow:"visible",preserveAspectRatio:"none",viewBox:"0 0 87.04 46.221",width:t.width,height:t.height,"data-test-id":t.dataTestId,"xml:space":"preserve"},pC,8,hC))}},yC={key:0,class:"suggestions-container"},gC={key:0,class:"logo-section"},bC={class:"help-text-section"},xC={key:0,class:"help-text"},_C={key:1,class:"sub-help-text"},CC=["onClick"],EC={key:2,class:"suggestions-list"},kC=["onClick"],vC=ve({__name:"AISuggestionsDropdown",props:{options:{type:Array,required:!0},helpText:{type:String,default:""},subHelpText:{type:String,default:""},showSuggestions:{type:Boolean,default:!1}},emits:["select","preview"],setup(t,{emit:r}){const n=t,o=r,a=e.ref(0),i=e.ref(0),l=e.ref(null),s=e.ref(null),u=c=>{l.value=c,i.value=0},h=()=>{l.value=null,a.value=0},d=c=>{o("select",c)},m=c=>{if(n.showSuggestions)switch(c.key){case"ArrowDown":c.preventDefault(),l.value?(i.value=(i.value+1)%l.value.subOptions.length,o("preview",l.value.subOptions[i.value])):(a.value=(a.value+1)%n.options.length,o("preview",n.options[a.value].title));break;case"ArrowUp":c.preventDefault(),l.value?(i.value=i.value-1<0?l.value.subOptions.length-1:i.value-1,o("preview",l.value.subOptions[i.value])):(a.value=a.value-1<0?n.options.length-1:a.value-1,o("preview",n.options[a.value].title));break;case"Enter":c.preventDefault(),l.value?d(l.value.subOptions[i.value]):u(n.options[a.value]);break;case"Escape":case"ArrowLeft":case"Backspace":l.value&&(c.preventDefault(),h());break}};return e.watch(()=>n.showSuggestions,c=>{c?(window.addEventListener("keydown",m),l.value=null,a.value=0,i.value=0):window.removeEventListener("keydown",m)}),(c,y)=>t.showSuggestions?(e.openBlock(),e.createElementBlock("div",yC,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gC,[e.createVNode(mC)])),e.createElementVNode("div",bC,[t.helpText&&!l.value?(e.openBlock(),e.createElementBlock("div",xC,e.toDisplayString(t.helpText),1)):e.createCommentVNode("",!0),t.subHelpText?(e.openBlock(),e.createElementBlock("div",_C,e.toDisplayString(t.subHelpText),1)):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",EC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.subOptions,(f,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:e.normalizeClass(["sub-option",{"sub-active":i.value===b}]),onClick:p=>d(f)},e.toDisplayString(f),11,kC))),128))])):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"suggestionsList",ref:s,class:"suggestions-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(f,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:e.normalizeClass(["suggestion-item",{active:a.value===b}]),onClick:p=>u(f)},e.toDisplayString(f.title),11,CC))),128))],512))])):e.createCommentVNode("",!0)}},[["__scopeId","data-v-bbb514b3"]]),AC={class:"chat-file-info"},wC={class:"ect-flex ect-gap-2 ect-items-center ect-self-stretch ect-my-auto ect-text-xs ect-font-medium ect-text-black"},NC=["src"],SC={class:"ect-self-stretch ect-my-auto"},BC={key:0,class:"ect-flex ect-gap-2 ect-justify-center ect-items-center ect-self-stretch ect-my-auto ect-w-4 ect-h-4"},IC=ve({__name:"ChatInputFileInfo",props:{fileInfo:{type:Object,required:!0}},emits:["cancel"],setup(t,{emit:r}){const n=r,o=()=>{n("cancel")};return(a,i)=>(e.openBlock(),e.createElementBlock("div",AC,[e.createElementVNode("div",wC,[e.createElementVNode("img",{loading:"lazy",src:t.fileInfo.fileType==="csv"?e.unref(Qc):e.unref(Zc),class:"ect-object-contain ect-shrink-0 ect-self-stretch ect-my-auto ect-w-7 ect-aspect-square",alt:""},null,8,NC),e.createElementVNode("div",SC,e.toDisplayString(t.fileInfo.fileName),1)]),t.fileInfo.status==="uploading"?(e.openBlock(),e.createElementBlock("div",BC,[e.createVNode(ma,{size:18})])):e.createCommentVNode("",!0),t.fileInfo.status==="uploaded"?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ect-flex ect-gap-2 ect-justify-center ect-items-center ect-self-stretch ect-my-auto ect-w-4 ect-h-4",onClick:o},[e.createVNode(Be,{icon:"close",size:"8"})])):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-24d881bd"]]),TC={class:"chat-input-wrapper"},OC={class:"chat-input-inner"},DC={class:"input-row"},VC=["disabled","placeholder","onKeydown"],FC={key:1,class:"icon-wrapper"},MC={class:"icon-wrapper"},RC=ve({__name:"chatInput",props:{modelValue:{type:String,default:""},loading:{type:Boolean,default:!1},placeholder:{type:String,default:"Ask Genesis AI"},helpText:{type:String,default:"Here are few areas where I can help"},subHelpText:{type:String,default:"Suggestions by Genesis (Click to Apply)"},showFile:{type:Boolean,default:!1},showMic:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","submit","speak","file-upload-status"],setup(t,{emit:r}){const n=t,o=r;Un();const a=Mt(),i=Jn(),l=e.ref({}),s=e.ref(!1),u=e.ref(!1),h=e.ref(n.modelValue),d=e.ref(null),m=e.computed(()=>{const k=i.currentStep||null;return(Array.isArray(k==null?void 0:k.promptGuidance)?k.promptGuidance:[]).slice().sort((w,v)=>Number((w==null?void 0:w.sequenceNumber)??0)-Number((v==null?void 0:v.sequenceNumber)??0)).map(w=>{const S=(Array.isArray(w==null?void 0:w.relatedPG)?w.relatedPG:[]).slice().sort((I,R)=>Number((I==null?void 0:I.sequenceNumber)??0)-Number((R==null?void 0:R.sequenceNumber)??0)).map(I=>I.pgName);return{title:w.pgName,subOptions:S}})}),c=e.computed(()=>{var k;return(k=m.value)!=null&&k.length?m.value:[]}),y=e.computed(()=>{var k;return(k=m.value)!=null&&k.length?"Prompt Guidance":n.helpText});e.watch(()=>n.loading,async(k,B)=>{!k&&B&&(await e.nextTick(),d.value.focus())}),e.watch(h,k=>{o("update:modelValue",k),e.nextTick(()=>_())}),e.watch(()=>n.modelValue,k=>{h.value=k});const f=k=>{console.info("[ERROR]: File upload error:",k),a.handleError(k,"ChatInput")},b=()=>{h.value.trim()&&(u.value=!1,o("submit",h.value),h.value="",d.value&&(d.value.style.height="32px"),l.value=null)},p=k=>{h.value=k,u.value=!1,e.nextTick(()=>{_(),d.value&&(d.value.focus(),d.value.selectionStart=d.value.selectionEnd=h.value.length)})},x=k=>{h.value=k,e.nextTick(()=>_())},g=()=>{u.value=!1},C=k=>{console.info("handleFileUploadStatus event = ",k),k!=null&&k.fileName?(l.value=k,o("file-upload-status",k)):(l.value=null,s.value=!0,o("file-upload-status",null),setTimeout(()=>{s.value=!1},3e3))},_=()=>{const k=d.value;if(!k)return;k.style.height="auto";const w=Math.max(32,Math.min(k.scrollHeight,120));k.style.height=`${w}px`},E=()=>{console.info("removeFile"),l.value=null,s.value=!0,o("file-upload-status",null),setTimeout(()=>{s.value=!1},100)},A=()=>{u.value=!1,_()};return(k,B)=>{var w,v,S,I,R;const D=e.resolveDirective("click-outside");return e.withDirectives((e.openBlock(),e.createElementBlock("div",TC,[e.createVNode(vC,{options:c.value,"help-text":y.value,"sub-help-text":t.subHelpText,"show-suggestions":u.value,onSelect:p,onPreview:x},null,8,["options","help-text","sub-help-text","show-suggestions"]),e.createElementVNode("div",OC,[e.createElementVNode("div",DC,[e.createElementVNode("div",{class:e.normalizeClass(["icon-wrapper",{"active-suggestions":u.value,disabled:((w=c.value)==null?void 0:w.length)<=0}])},[e.createVNode(Be,{disabled:((v=c.value)==null?void 0:v.length)<=0||t.loading,color:((S=c.value)==null?void 0:S.length)<=0?"#DEDEDE":u.value?"#198708":"#828282",icon:"suggestions",size:"13",height:15,onClick:B[0]||(B[0]=z=>u.value=!u.value)},null,8,["disabled","color"])],2),e.withDirectives(e.createElementVNode("textarea",{ref_key:"textareaRef",ref:d,"onUpdate:modelValue":B[1]||(B[1]=z=>h.value=z),disabled:t.loading,placeholder:t.placeholder,rows:"1",onKeydown:e.withKeys(e.withModifiers(b,["exact","prevent"]),["enter"]),onInput:A},null,40,VC),[[e.vModelText,h.value]]),t.showFile?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["icon-wrapper",{"file-upload-disabled":t.loading}])},[e.createVNode(fC,{"reset-file-input":s.value,onUploadStatus:C,onError:f},null,8,["reset-file-input"])],2)):e.createCommentVNode("",!0),t.showMic?(e.openBlock(),e.createElementBlock("div",FC,[e.createVNode(Be,{color:"#828282",disabled:t.loading,icon:"mic",size:"13",height:15,onClick:B[2]||(B[2]=z=>k.$emit("speak"))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createElementVNode("div",MC,[(e.openBlock(),e.createBlock(Be,{key:1,disabled:t.loading,icon:"send",size:"20",onClick:b},null,8,["disabled"]))])]),((I=l.value)==null?void 0:I.status)==="uploading"||((R=l.value)==null?void 0:R.status)==="uploaded"?(e.openBlock(),e.createBlock(IC,{key:0,class:"ect-mt-3 ect-mb-0.5","file-info":l.value,onCancel:E},null,8,["file-info"])):e.createCommentVNode("",!0)])])),[[D,g]])}}},[["__scopeId","data-v-e205d71c"]]),LC=["data-test-id"],PC=["data-test-id"],qC=["data-test-id"],$C=ve({__name:"aiChat",props:{dataTestId:{type:String,required:!0},isExternalGuidance:{type:Boolean,required:!1,default:!1},styles:{type:Object,required:!1,default:()=>({}),validator:t=>typeof(t==null?void 0:t.height)=="string"}},emits:["component-action"],setup(t,{emit:r}){const n=Jn(),o=r,a=Un(),i=e.ref(null),l=e.computed(()=>{var m;return((m=n.getCurrentStepLinks)==null?void 0:m.call(n))||[]}),s=e.computed(()=>!0),u=m=>{console.info("[aiChat] handleSubmit",{hasFileData:!!i.value,messageLength:(m||"").length}),i.value?(console.info("[aiChat] sending with file attachment"),a.sendMessage(m,!0,i.value)):(console.info("[aiChat] sending without attachment"),a.sendMessage(m))},h=m=>{console.info("ChatScreen handleFileUploadStatus event = ",m),m!=null&&m.fileData?(i.value=m.fileData,a.attachmentData={size:m.size,type:m.fileType,name:m.fileName}):(i.value=null,a.attachmentData=null)},d=m=>{o("component-action",m)};return(m,c)=>(e.openBlock(),e.createElementBlock("div",{class:"chat-screen","data-test-id":t.dataTestId},[e.createElementVNode("div",{class:e.normalizeClass(["messages-container",{"playbook-steps-mode-hybrid":e.unref(n).playbookStepsMode==="hybrid","playbook-steps-mode-full":e.unref(n).playbookStepsMode==="full","dxp-guiddance":t.isExternalGuidance}]),style:e.normalizeStyle({maxHeight:`calc(${t.styles.height} - 72px)`,height:`calc(${t.styles.height} - 72px)`}),"data-test-id":`${t.dataTestId}-messages-container`},[e.createVNode(uC,{messages:e.unref(a).chatHistory,"loading-message":e.unref(a).loadingMessage,"undo-id":e.unref(a).latestDMLRequest,"button-links":l.value,"strikethrough-ids":e.unref(a).strikethroughHistory,"data-changed":e.unref(a).dataManuallyChanged,"data-test-id":`${t.dataTestId}-messages`,onComponentAction:d},null,8,["messages","loading-message","undo-id","button-links","strikethrough-ids","data-changed","data-test-id"])],14,PC),e.createElementVNode("div",{class:"input-container","data-test-id":`${t.dataTestId}-input-container`},[e.createVNode(RC,{modelValue:e.unref(a).promptMessage,"onUpdate:modelValue":c[0]||(c[0]=y=>e.unref(a).promptMessage=y),disabled:!s.value,"file-info":i.value,loading:!!e.unref(a).loadingMessage,"data-test-id":`${t.dataTestId}-input`,onSubmit:u,onFileUploadStatus:h},null,8,["modelValue","disabled","file-info","loading","data-test-id"])],8,qC)],8,LC))}},[["__scopeId","data-v-dcfc28bd"]]),UC={class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"configurator-not-found"},zC={class:"ect-max-w-[720px] ect-p-[50px] ect-border ect-rounded-lg ect-bg-white ect-shadow-sm"},jC={class:"ect-text-[40px] ect-leading-none ect-mb-3"},HC=e.createElementVNode("div",{class:"ect-text-[22px] ect-font-normal ect-leading-normal ect-mb-[12px] ect-capitalize ect-text-[#5F5F5F]","data-test-id":"configurator-not-found-title"}," Product Configurator Not Found ",-1),GC=e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500","data-test-id":"configurator-not-found-subtitle"}," Linked composable product configurator UI component for this screen is not found OR the composable product configurator UI component does not exist. Please create / connect one and try again. ",-1),KC={class:"ect-mt-4 ect-flex ect-items-center ect-justify-between ect-gap-6"},XC={__name:"MoleculeConfiguratorNotFound",emits:["return","go-cart"],setup(t){return(r,n)=>(e.openBlock(),e.createElementBlock("div",UC,[e.createElementVNode("div",zC,[e.createElementVNode("div",jC,[e.createVNode(Be,{icon:"error",size:48})]),HC,GC,e.createElementVNode("div",KC,[e.createElementVNode("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:n[0]||(n[0]=o=>r.$emit("return")),"data-test-id":"configurator-not-found-return"}," RETURN TO PRODUCT RESULTS "),e.createElementVNode("button",{type:"button",class:"ect-text-green-600 ect-text-sm ect-font-medium",onClick:n[1]||(n[1]=o=>r.$emit("go-cart")),"data-test-id":"configurator-not-found-go-to-cart"}," GO TO CART ")])])]))}},n0=t=>(e.pushScopeId("data-v-bf75aa89"),t=t(),e.popScopeId(),t),WC={class:"ect-h-full ect-w-full ect-bg-white","data-test-id":"aiComponentLoader-wrapper"},QC={key:2,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center","data-test-id":"aiComponentLoader-cart-error"},ZC=[n0(()=>e.createElementVNode("div",{class:"ect-text-center"},[e.createElementVNode("div",{class:"ect-text-base ect-font-medium ect-text-red-600","data-test-id":"aiComponentLoader-cart-error-title"}," Quote Required "),e.createElementVNode("div",{class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-cart-error-message"}," A quote is required for the cart component to work. Please ensure a quoteId is provided in the session prop. ")],-1))],JC={key:5,class:"ect-h-full ect-w-full ect-flex ect-items-center ect-justify-center"},YC={class:"ect-text-center"},eE=n0(()=>e.createElementVNode("div",{class:"ect-text-base ect-font-medium","data-test-id":"aiComponentLoader-fallback-title"}," No component to display for this step ",-1)),tE={class:"ect-text-sm ect-text-gray-500 ect-mt-2","data-test-id":"aiComponentLoader-fallback-subtitle"},nE=ve({__name:"aiComponentLoader",props:{stepComponent:{type:String,default:null},identity:{type:Object,default:()=>({})},session:{type:Object,default:()=>({})},security:{type:Object,default:()=>({})},packageVersion:{type:String,default:""},composablesOrgType:{type:String,default:""},composablesApiKey:{type:String,default:""},templateId:{type:String,default:""},hostName:{type:String,default:""},graphqlEndpoint:{type:String,default:""},apiKey:{type:String,default:""},isPreview:{type:Boolean,default:!1},sections:{type:Array,default:()=>[]},theme:{type:Object,default:()=>({})},catalogPreviewData:{type:Object,default:()=>({})},catalogInitialData:{type:Array,default:()=>[]},catalogSearchTerm:{type:String,default:""},onCatalogCountUpdate:{type:Function,default:null},cartSections:{type:String,default:""},configItemId:{type:String,default:""},configQliId:{type:String,default:""},configApiKey:{type:String,default:""},functions:{type:Object,default:()=>({})},resources:{type:Object,required:!1}},emits:["expeditecart-clicked","ai-guidance:error","catalog-quote-created","catalog-quote-updated","catalog-items-loaded","catalog-item-added","catalog-item-qty-updated","catalog-line-deleted","catalog-items-fetched","catalog-item-configure"],setup(t,{emit:r}){const n=r,o=t,a=Jn(),i=Ci(),l=ft(),s=e.computed(()=>{var j,H,Z,te,ne;const L=((j=o.session)==null?void 0:j.quoteId)||((H=l.quoteId)==null?void 0:H.value)||((Z=a==null?void 0:a.activeComponentData)==null?void 0:Z.contextObjectId)||((ne=(te=a==null?void 0:a.activeComponentData)==null?void 0:te.payload)==null?void 0:ne.contextObjectId);return{...o.session,...L&&{quoteId:L},qliId:p.value||o.configQliId||void 0,itemId:b.value}}),u=e.computed(()=>{const L=o.functions||{},j=L.createQuote;return typeof j!="function"?L:{...L,createQuote:async(...H)=>{const Z=await j(...H);return Z&&l.updateConfig({quoteId:Z}),Z}}}),h=e.computed(()=>{const L=a==null?void 0:a.activeComponentKey,j=o.stepComponent;return(L||j||"").toString().trim().toLowerCase().replace(/[^a-z0-9]+/g,"_")}),d=e.computed(()=>{var te,ne;const L=!!o.templateId,j=!!((te=o.identity)!=null&&te.organizationId),H=!!((ne=o.identity)!=null&&ne.accountId),Z=typeof o.cartSections=="string"&&o.cartSections.length>0;return L&&j&&H&&Z}),m=e.computed(()=>{var Z,te,ne,Q,ce;const L=(Z=o.session)==null?void 0:Z.quoteId,j=(te=l.quoteId)==null?void 0:te.value,H=((ne=a==null?void 0:a.activeComponentData)==null?void 0:ne.contextObjectId)||((ce=(Q=a==null?void 0:a.activeComponentData)==null?void 0:Q.payload)==null?void 0:ce.contextObjectId);return!!(L||j||H)}),c=e.computed(()=>{var j,H,Z,te,ne;const L=((j=o.session)==null?void 0:j.quoteId)||((H=l.quoteId)==null?void 0:H.value)||((Z=a==null?void 0:a.activeComponentData)==null?void 0:Z.contextObjectId)||((ne=(te=a==null?void 0:a.activeComponentData)==null?void 0:te.payload)==null?void 0:ne.contextObjectId);return{...o.session,...L&&{quoteId:L}}}),y=e.computed(()=>{var j;if(Array.isArray(o.catalogInitialData)&&o.catalogInitialData.length>0)return o.catalogInitialData;const L=((j=a==null?void 0:a.activeComponentData)==null?void 0:j.payload)||{};if(L.catalog&&typeof L.catalog=="object")try{const Z=Object.values(L.catalog).map(te=>{var ne;return(ne=te==null?void 0:te.catalogResponse)==null?void 0:ne.productInfo}).filter(Boolean);if(Z.length>0)return Z}catch{}return Array.isArray(L.initialData)&&L.initialData.length>0?L.initialData:Array.isArray(L.catalogInitialData)&&L.catalogInitialData.length>0?L.catalogInitialData:Array.isArray(L.items)&&L.items.length>0?L.items:[]}),f=e.computed(()=>{var j;const L=((j=a==null?void 0:a.activeComponentData)==null?void 0:j.payload)||{};return o.catalogSearchTerm||L.searchTerm||""}),b=e.computed(()=>{var H,Z,te,ne,Q,ce,ue,pe;const L=(te=(Z=(H=a==null?void 0:a.activeComponentData)==null?void 0:H.payload)==null?void 0:Z.productConfiguration)==null?void 0:te[0],j=((ue=(ce=(Q=(ne=a==null?void 0:a.activeComponentData)==null?void 0:ne.payload)==null?void 0:Q.savedProducts)==null?void 0:ce[0])==null?void 0:ue.itemId)||(L==null?void 0:L.itemId)||((pe=L==null?void 0:L.product)==null?void 0:pe.itemId)||"";return o.configItemId||j||""}),p=e.computed(()=>{var j,H,Z,te,ne,Q;const L=(te=(Z=(H=(j=a==null?void 0:a.activeComponentData)==null?void 0:j.payload)==null?void 0:H.savedProducts)==null?void 0:Z[0])==null?void 0:te.qliId;if(!L){const ce=(Q=(ne=a==null?void 0:a.activeComponentData)==null?void 0:ne.payload)==null?void 0:Q.productConfiguration,ue=Array.isArray(ce)&&ce.length>0?ce[0]:null;if(ue){const pe=ue==null?void 0:ue.product;if(pe!=null&&pe.qliId)return pe.qliId;if(ue!=null&&ue.qliId)return ue.qliId}}return L||""}),x=e.computed(()=>!!b.value),g=e.computed(()=>h.value==="configurator"&&!x.value?"Configurator requires an itemId (and optional qliId). Provide via playbook payload or props.":h.value==="catalog"?"Catalog step is active. Provide templateId/sections/theme when available.":h.value==="cart"?"Cart step is active.":"Awaiting playbook step selection."),C=e.computed(()=>{try{return JSON.stringify((a==null?void 0:a.activeComponentData)||{})}catch{return""}}),_=e.computed(()=>`catalog::${C.value}`),E=e.computed(()=>`cart::${C.value}`),A=e.computed(()=>{var L;try{return(((L=a==null?void 0:a.activeComponentData)==null?void 0:L.actionFunction)||"")==="Reload"}catch{return!1}}),k=e.computed(()=>{var j;const L=`configurator::${b.value||""}::${p.value||""}`;if(A.value){const H=((j=a==null?void 0:a.activeComponentData)==null?void 0:j.requestId)||"";return`${L}::${H}`}return L}),{emitError:B,emitErrors:D}=Wc(n,"aiComponentLoader"),w=()=>{const L=q7(a,h.value);D(L)},v=e.ref([]),S=e.ref(null),I=L=>{const j=Array.isArray(L)?L:Array.isArray(L==null?void 0:L.items)?L.items:[];if(!Array.isArray(j))return;const H={"Needs Configuration":1,"Suggests Configuration":2,"Fully Configured":3},Z=Q=>(Q==null?void 0:Q.requiresConfiguration)||"",te=Q=>!!Q&&Q in H,ne=j.filter(Q=>te(Z(Q)));ne.sort((Q,ce)=>{const ue=Z(Q),pe=Z(ce);return(H[ue]||99)-(H[pe]||99)}),v.value=ne,S.value=ne.length?ne[0]:null},R=L=>{console.log("onQuoteCreated",L),n("catalog-quote-created",L)},z=L=>{console.log("onQuoteUpdated",L),n("catalog-quote-updated",L)},$=L=>{console.log("onItemAdded",L),n("catalog-item-added",L)},X=L=>{console.log("onItemQtyUpdated",L),n("catalog-item-qty-updated",L)},W=L=>{console.log("onLineDeleted",L),n("catalog-line-deleted",L)},K=L=>{console.log("onQuoteItemsFetched",L),n("catalog-items-fetched",L)};e.watch(()=>h.value,(L,j)=>{var H,Z,te,ne,Q,ce,ue,pe,ie,de;if(L==="configurator"){const _e=!!((te=(Z=(H=a==null?void 0:a.activeComponentData)==null?void 0:H.payload)==null?void 0:Z.savedProducts)!=null&&te.length),xe=((ce=(Q=(ne=a==null?void 0:a.activeComponentData)==null?void 0:ne.payload)==null?void 0:Q.productConfiguration)==null?void 0:ce.length)>0;if(!_e&&!xe&&S.value&&!b.value){const ye=((ue=S.value)==null?void 0:ue.itemId)||"";if(ye){const oe=((pe=a==null?void 0:a.currentPlaybook)==null?void 0:pe.playBookSteps)||[],le=se=>String(se||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_");let be=null;const Ce=oe.findIndex(se=>se.stepName===(a==null?void 0:a.currentStepName));if(Ce>=0&&oe[Ce+1]&&le((ie=oe[Ce+1])==null?void 0:ie.stepComponent)==="configurator")be=oe[Ce+1].stepName;else{const se=oe.findIndex(fe=>le(fe==null?void 0:fe.stepComponent)==="configurator");be=se>=0?(de=oe[se])==null?void 0:de.stepName:null}const J={payload:{savedProducts:[{itemId:ye}]}};be?a.navigateToStep({stepName:be,data:J}):a.loadComponent("configurator",J)}}}});const P=()=>{var Z,te;const L=((Z=a==null?void 0:a.currentPlaybook)==null?void 0:Z.playBookSteps)||[],j=ne=>String(ne||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),H=L.findIndex(ne=>j(ne==null?void 0:ne.stepComponent)==="catalog"||j(ne==null?void 0:ne.stepName).includes("catalog"));if(H>=0){const ne=(te=L[H])==null?void 0:te.stepName;a.navigateToStep({stepName:ne})}else a.loadComponent("catalog")},N=()=>{var Z,te;const L=((Z=a==null?void 0:a.currentPlaybook)==null?void 0:Z.playBookSteps)||[],j=ne=>String(ne||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),H=L.findIndex(ne=>j(ne==null?void 0:ne.stepComponent)==="cart"||j(ne==null?void 0:ne.stepName).includes("cart"));if(H>=0){const ne=(te=L[H])==null?void 0:te.stepName;a.navigateToStep({stepName:ne})}else a.loadComponent("cart")},T=L=>{var j,H;console.log("onItemConfigureClicked",L),n("catalog-item-configure",L);try{const Z=(L==null?void 0:L.itemId)||"",te=(L==null?void 0:L.qliId)||(L==null?void 0:L.QliId)||"",ne=[];if(Z){const ie={itemId:Z};te&&(ie.qliId=te),ne.push(ie)}const Q={payload:{savedProducts:ne}},ce=((j=a==null?void 0:a.currentPlaybook)==null?void 0:j.playBookSteps)||[],ue=ie=>String(ie||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),pe=ce.findIndex(ie=>{const de=ue(ie==null?void 0:ie.stepComponent),_e=ue(ie==null?void 0:ie.stepName);return de==="configurator"||_e.includes("configure")});if(pe>=0){const ie=(H=ce[pe])==null?void 0:H.stepName;a.navigateToStep({stepName:ie,data:Q})}else a.loadComponent("configurator",Q)}catch(Z){console.warn("[aiComponentLoader] Failed to navigate to configurator from configure click:",Z),a.loadComponent("configurator",{payload:{}})}},O=L=>{console.log("onCartClicked",L),n("expeditecart-clicked",L)},F=L=>{var j,H;try{const Z=(L==null?void 0:L.itemId)||"",te=(L==null?void 0:L.lineItemId)||(L==null?void 0:L.qliId)||"",ne=[];if(Z){const ie={itemId:Z};te&&(ie.qliId=te),ne.push(ie)}const Q={payload:{savedProducts:ne}},ce=((j=a==null?void 0:a.currentPlaybook)==null?void 0:j.playBookSteps)||[],ue=ie=>String(ie||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_"),pe=ce.findIndex(ie=>{const de=ue(ie==null?void 0:ie.stepComponent),_e=ue(ie==null?void 0:ie.stepName);return de==="configurator"||_e.includes("configure")});if(pe>=0){const ie=(H=ce[pe])==null?void 0:H.stepName;a.navigateToStep({stepName:ie,data:Q})}else a.loadComponent("configurator",Q)}catch(Z){console.warn("[aiComponentLoader] Failed to navigate to configurator from cart configure click:",Z),a.loadComponent("configurator",{payload:{}})}},q=L=>{console.log("onCatalogIdReceived",L),l.updateConfig({eCatalogId:L})},M=L=>{console.log("Action",L),L.event==="add-to-quote"?n("configurator:add-to-quote",L.data):L.event==="save"&&n("configurator:save",L.data)},U=e.ref("");return e.watch(()=>a==null?void 0:a.activeComponentData,async L=>{var H,Z,te,ne;if(!L)return;console.log("activeComponentData Changed",L);const j=(L==null?void 0:L.requestId)||"";if(console.log("requestId",j),console.log("lastReloadRequestId",U.value),j&&j!==U.value)if(U.value=j,await e.nextTick(),((Z=(H=L==null?void 0:L.payload)==null?void 0:H.productConfiguration)==null?void 0:Z.length)>0){const Q=(te=L==null?void 0:L.payload)==null?void 0:te.productConfiguration[0],ce=(Q==null?void 0:Q.itemId)||((ne=Q==null?void 0:Q.product)==null?void 0:ne.itemId)||"";i.setPreConfigData(L==null?void 0:L.payload,ce)}else(L==null?void 0:L.actionFunction)==="Reload"&&(console.log("Reloading configurator 1"),i.refresh())},{deep:!0}),e.onMounted(()=>{e.nextTick(()=>{w()})}),(L,j)=>(e.openBlock(),e.createElementBlock("div",WC,[h.value==="catalog"?(e.openBlock(),e.createBlock(wr,{key:_.value,"data-test-id":"aiComponentLoader-catalog",class:"ect-h-full ect-w-full","template-id":t.templateId,identity:t.identity,session:t.session,security:t.security,"search-term":f.value,"on-catalog-count-update":t.onCatalogCountUpdate,"preview-data":t.catalogPreviewData,"initial-data":y.value,sections:t.sections,theme:t.theme,"composables-org-type":t.composablesOrgType,onCatalogQuoteCreated:R,onCatalogQuoteUpdated:z,onCatalogItemsLoaded:I,onCatalogItemAdded:$,onCatalogItemQtyUpdated:X,onCatalogLineDeleted:W,onCatalogItemsFetched:K,onCatalogItemConfigure:T,"onCatalog:id":q},null,8,["template-id","identity","session","security","search-term","on-catalog-count-update","preview-data","initial-data","sections","theme","composables-org-type"])):h.value==="cart"&&d.value&&m.value?(e.openBlock(),e.createBlock(Nr,{key:E.value,"data-test-id":"aiComponentLoader-cart",class:"ect-h-full ect-w-full","template-id":t.templateId,"host-name":t.hostName,"composables-org-type":t.composablesOrgType,security:t.security,identity:t.identity,session:c.value,onExpeditecartItemConfigure:F,onExpeditecartClicked:O},null,8,["template-id","host-name","composables-org-type","security","identity","session"])):h.value==="cart"&&d.value&&!m.value?(e.openBlock(),e.createElementBlock("div",QC,ZC)):h.value==="configurator"&&x.value?(e.openBlock(),e.createBlock(yr,{key:k.value,"data-test-id":"aiComponentLoader-configurator",class:"ect-h-full ect-w-full",security:t.security,identity:t.identity,resources:t.resources,"user-locale":L.userLocale,cart:!0,"composables-org-type":t.composablesOrgType,session:s.value,functions:u.value,onReady:e.unref(i).setExpediteConfigComp,onAction:M},null,8,["security","identity","resources","user-locale","composables-org-type","session","functions","onReady"])):h.value==="configurator"&&!x.value?(e.openBlock(),e.createBlock(XC,{key:4,onReturn:P,onGoCart:N})):(e.openBlock(),e.createElementBlock("div",JC,[e.createElementVNode("div",YC,[eE,e.createElementVNode("div",tE,e.toDisplayString(g.value),1)])]))]))}},[["__scopeId","data-v-bf75aa89"]]),oE={class:"ai-guidance-loader","data-test-id":"aiGuidance-loader-container"},rE={"data-test-id":"aiGuidance-loader-text"},aE={class:"aig-button","data-test-id":"aiGuidance-loader-button"},iE={class:"aig-input-box","data-test-id":"aiGuidance-loader-input"},lE=ve({__name:"AiGuidanceLoader",props:{errors:{type:Array,required:!1,default:()=>[]},chatBgColor:{type:String,required:!1,default:""}},setup(t){const r=t,n=e.computed(()=>`linear-gradient(180deg, ${r.chatBgColor} 0%, transparent 100%)`);return(o,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"chat-gradient",style:e.normalizeStyle({background:n.value})},null,4),e.createElementVNode("div",oE,[e.createElementVNode("div",rE,[e.createVNode(So,{style:{width:"100%",height:"16px","margin-bottom":"8px"}}),e.createVNode(So,{style:{width:"100%",height:"16px","margin-bottom":"32px","max-width":"481px"}})]),e.createElementVNode("div",aE,[e.createVNode(So,{style:{width:"100%",height:"24px"}})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.errors,i=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"aig-message-error","data-test-id":"aiGuidance-loader-error"},e.toDisplayString(i),1))),128)),e.createElementVNode("div",iE,[e.createVNode(So,{style:{height:"36px",width:"100%"}})])])],64))}},[["__scopeId","data-v-5e4a9913"]]),sE={class:"ai-guidance-wrapper","data-test-id":"aiGuidance-wrapper"},Qi=ve({__name:"aiGuidance",props:{templateId:{type:String,required:!1},playbookData:{type:Object,required:!1},composablesOrgType:{type:String,required:!0},identity:{type:Object,required:!1,default:()=>({})},session:{type:Object,required:!1,default:()=>({})},security:{type:Object,required:!1,default:()=>({})},functions:{type:Object,required:!1,default:()=>({})},websocketUrl:{type:String,required:!0},packageVersion:{type:String,required:!0},hostName:{type:String,required:!1},graphqlEndpoint:{type:String,required:!1},apiKey:{type:String,required:!1},isPreview:{type:Boolean,required:!1,default:!1},catalogSections:{type:Array,required:!1,default:()=>[]},cartSections:{type:String,required:!1,default:""},theme:{type:Object,required:!1,default:()=>({})},styles:{type:Object,required:!1,default:()=>({height:"100vh"}),validator:t=>typeof(t==null?void 0:t.height)=="string"},resources:{type:Object,required:!1,default:()=>({})}},emits:["expeditecart-item-configure","expeditecart-clicked","component-action","ai-response:success","quote-id:updated","ai-guidance:error"],setup(t,{emit:r}){const n=Jn(),o=ft(),a=Un(),i=Co(),l=r,s=e.ref(!0),u=e.ref(!1),h=e.ref(!0),d=e.ref(!0),m=e.ref(!1),c=e.ref([]),{emitError:y,emitErrors:f}=Wc(l,"aiGuidance"),b=t,{composablesOrgType:p,websocketUrl:x,packageVersion:g,identity:C,session:_,security:E,functions:A,templateId:k,hostName:B,graphqlEndpoint:D,apiKey:w,isPreview:v,catalogSections:S,cartSections:I,theme:R}=b,z=e.computed(()=>{var F,q,M;return{...b.session||{},quoteId:((F=b.session)==null?void 0:F.quoteId)||(((q=o.quoteId)==null?void 0:q.value)??""),eCatalogId:(M=o.eCatalogId)==null?void 0:M.value}});e.onBeforeMount(async()=>{var F;console.log("security",E),console.log("apiKey",w),o.updateConfig({userId:C==null?void 0:C.userId,organizationId:C==null?void 0:C.organizationId,accessToken:E==null?void 0:E.accessToken,composablesApiUrl:E==null?void 0:E.baseUrl,composablesOrgType:p,websocketUrl:x,quoteId:_==null?void 0:_.quoteId,packageVersion:g,accountId:C==null?void 0:C.accountId,templateId:k,hostName:B,graphqlEndpoint:D,apiKey:(E==null?void 0:E.apiKey)||w,cid:C==null?void 0:C.contactId,isPreview:v,siteUrl:(F=b.resources)==null?void 0:F.siteUrl})}),e.onMounted(async()=>{var j,H,Z,te;const F=L7(b,C,E);f(F);const q=Xc(x);if(q&&y(q),F.length>0||q){s.value=!1;return}n.setSecretKey(E==null?void 0:E.accessToken);let M=null,U,L;try{M=await n.getPlaybookInfoFromQuote(),U=(M==null?void 0:M.XX_ORD1__Completed_PB_Step_Number_EX__c)??void 0,L=(M==null?void 0:M.XX_ORD1__Playbook_Current_Step_Meta_EX__c)??void 0}catch(ne){console.error("[aiGuidance] Failed to get playbook info from quote:",ne),y("AI_GUIDANCE_PLAYBOOK_INFO_FETCH_FAILED",{error:ne.message})}if(L)try{L=JSON.parse(L)}catch(ne){console.error("[aiGuidance] Failed to parse currentStepMetaServer:",ne),y("AI_GUIDANCE_JSON_PARSE_ERROR",{error:ne.message,data:"currentStepMetaServer"}),L=void 0}if(console.info("sequenceNumberServer = ",U),b.templateId){s.value=!0;try{const Q=await n.getCatalogInContext();console.log("catalogInContext = ",Q),Q&&o.updateConfig({eCatalogId:Q})}catch(Q){console.error("[aiGuidance] Failed to get catalog in context:",Q),y("AI_GUIDANCE_CATALOG_FETCH_FAILED",{error:Q.message})}let ne=null;try{await i.fetchBlockInformationREST({templateId:b.templateId});const Q=P7(i.pageBlocks);ne=Q.playbookId,Q.error&&y(Q.error,{error:"Block structure validation failed"}),ne||y("AI_GUIDANCE_BLOCK_PLAYBOOK_ID_MISSING",{pageBlocks:i.pageBlocks})}catch(Q){console.error("[aiGuidance] Failed to fetch block information:",Q),y("AI_GUIDANCE_BLOCK_FETCH_FAILED",{error:Q.message})}if(console.log("playbookID",ne),ne?u.value=!0:c.value.push("No playbook ID found in template"),n.setEmbeddedMode(!0),ne)try{n.currentPlaybook=ne,await n.getPlaybookByKey(ne),n.showPlaybookSteps=!0}catch(Q){console.error("[aiGuidance] Failed to get playbook by key:",Q),y("AI_GUIDANCE_PLAYBOOK_FETCH_FAILED",{error:Q.message,playbookID:ne})}n.playbookStepsMode="full",a.setInitialPayload();try{await a.connectSocket()}catch(Q){console.error("[aiGuidance] Failed to connect socket:",Q),y("WEBSOCKET_CONNECTION_FAILED",{error:Q.message})}if(U!==void 0){n.navigateToStep({stepName:(H=(j=n.currentPlaybook)==null?void 0:j.playBookSteps[Number(U)])==null?void 0:H.stepName,data:L}),s.value=!1;return}(te=(Z=n.currentPlaybook)==null?void 0:Z.playBookSteps)!=null&&te.length&&n.setCurrentStepName(n.currentPlaybook.playBookSteps[0].stepName),s.value=!1}else c.value.push("templateId is required")});const $=e.computed(()=>{var M;const F=((M=n.currentPlaybook)==null?void 0:M.playBookSteps)||[],q=n.currentStepName;return F.find(U=>U.stepName===q)||F[0]||null}),X=e.computed(()=>{var F;return((F=$.value)==null?void 0:F.stepComponent)||null});e.watch(()=>n.activeComponentKey,F=>{F&&(h.value=!1)});const W=[];e.onMounted(()=>{W.push(Lt("expeditecart:configure-clicked",F=>{l("expeditecart-item-configure",F)})),W.push(Lt("expeditecart:clicked",F=>{l("expeditecart-clicked",F)})),W.push(Lt("ai-response:success",F=>{try{l("ai-response:success",F)}catch{}})),W.push(Lt("quote-id:updated",F=>{try{l("quote-id:updated",F)}catch(q){console.info("[aiGuidance] Error emitting quote-id:updated event:",q)}})),W.push(Lt("websocket:error",F=>{try{F!=null&&F.isInitialization&&y(F.errorCode||"WEBSOCKET_CONNECTION_FAILED",F)}catch(q){console.info("[aiGuidance] Error handling websocket error event:",q)}}))});const K=F=>{console.log("[aiGuidance] Received error from aiComponentLoader:",F),l("ai-guidance:error",F)},P=F=>{console.log("onExpediteCartClicked",F),l("component-action",{component:"cart",details:F})},N=(F,q)=>{var U;l("component-action",{component:"catalog",action:F,details:q});const M=(q==null?void 0:q.quoteId)??((U=q==null?void 0:q.response)==null?void 0:U.quoteId);if(M&&(F==="item-added"||F==="items-fetched"))try{l("quote-id:updated",{quoteId:M})}catch(L){console.info("[aiGuidance] Error emitting quote-id:updated from catalog event:",L)}},T=(F,q)=>{l("component-action",{component:"configurator",action:F,details:q})},O=F=>{l("component-action",F)};return e.onBeforeUnmount(()=>{try{a.cancelRequest()}catch{}try{a.disconnectSocket()}catch{}try{a.resetState()}catch{}try{n.setEmbeddedMode(!1),n.currentPlaybook=null,n.currentStepName=null,n.activeComponentKey=null,n.activeComponentData=null,n.showPlaybookSteps=!1,n.playbookStepsMode="full"}catch{}s.value=!1,u.value=!1,h.value=!0,d.value=!0,m.value=!1,c.value=[],W.forEach(F=>{try{F()}catch{}})}),(F,q)=>{var M;return e.openBlock(),e.createElementBlock("div",sE,[e.createVNode(pa,{icon:"logo",color:"#000000",size:"18.75",height:"16.25"}),s.value||e.unref(a).isFetchingHistory?(e.openBlock(),e.createBlock(lE,{key:0,errors:c.value,"data-test-id":"aiGuidance-loader"},null,8,["errors"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["ai-app",{"root-path":h.value,"playbook-steps-mode-full":e.unref(n).playbookStepsMode==="full","dxp-guiddance":u.value}]),style:e.normalizeStyle(t.styles)},[e.createElementVNode("div",{class:"ai-app-chat-wrapper",style:e.normalizeStyle({height:t.styles.height})},[e.createVNode($C,{"data-test-id":"chat-screen","is-external-guidance":u.value,styles:t.styles,onComponentAction:O},null,8,["is-external-guidance","styles"])],4),!h.value&&d.value&&!m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"component-loader-wrapper",style:e.normalizeStyle({height:t.styles.height,maxHeight:t.styles.height})},[e.unref(n).currentPlaybook?(e.openBlock(),e.createBlock(nE,{key:0,"template-id":((M=$.value)==null?void 0:M.templateId)||e.unref(k),"step-component":X.value,identity:e.unref(C),session:z.value,security:e.unref(E),functions:e.unref(A),"composables-org-type":e.unref(p),"package-version":e.unref(g),"host-name":e.unref(B),"graphql-endpoint":e.unref(D),"api-key":e.unref(w),"is-preview":e.unref(v),sections:e.unref(S),"cart-sections":e.unref(I),theme:e.unref(R),resources:t.resources,"data-test-id":"aiComponentLoader-mounted",onExpeditecartClicked:P,onCatalogQuoteCreated:q[0]||(q[0]=U=>N("quote-created",U)),onCatalogQuoteUpdated:q[1]||(q[1]=U=>N("quote-updated",U)),onCatalogItemsLoaded:q[2]||(q[2]=U=>N("items-loaded",U)),onCatalogItemAdded:q[3]||(q[3]=U=>N("item-added",U)),onCatalogItemQtyUpdated:q[4]||(q[4]=U=>N("item-qty-updated",U)),onCatalogLineDeleted:q[5]||(q[5]=U=>N("line-deleted",U)),onCatalogItemsFetched:q[6]||(q[6]=U=>N("items-fetched",U)),onCatalogItemConfigure:q[7]||(q[7]=U=>N("item-configure",U)),"onConfigurator:addToQuote":q[8]||(q[8]=U=>T("add-to-quote",U)),"onConfigurator:save":q[9]||(q[9]=U=>T("save",U)),"onAiGuidance:error":K},null,8,["template-id","step-component","identity","session","security","functions","composables-org-type","package-version","host-name","graphql-endpoint","api-key","is-preview","sections","cart-sections","theme","resources"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],6))])}}},[["__scopeId","data-v-7835e48c"]]),o0={ExpediteConfigurator:yr,ExpediteGPT:wa,ExpediteCatalog:wr,ExpediteCart:Nr,ExpediteAIGuidance:Qi},cE={install(t,r={}){t.component("ExpediteConfigurator",yr),t.component("ExpediteGPT",wa),t.component("ExpediteCatalog",wr),t.component("ExpediteCart",Nr),t.component("ExpediteAIGuidance",Qi)},...o0};bt.Components=o0,bt.ExpediteAIGuidance=Qi,bt.ExpediteCart=Nr,bt.ExpediteCatalog=wr,bt.ExpediteConfigurator=yr,bt.ExpediteGPT=wa,bt.default=cE,bt.useComRootStore=wo,Object.defineProperties(bt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|