expedite-components 0.5.4 → 0.5.5
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.
|
@@ -6446,6 +6446,7 @@ const jt = lt("comConfigurator", () => {
|
|
|
6446
6446
|
if (!g.value)
|
|
6447
6447
|
return {};
|
|
6448
6448
|
const P = (V) => !V || !Array.isArray(V) ? [] : V.map((te) => ({
|
|
6449
|
+
label: te.label,
|
|
6449
6450
|
field: te.apiName,
|
|
6450
6451
|
dataType: te.dataType,
|
|
6451
6452
|
picklistValues: te.picklistValues,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(i){return i instanceof this?i:new this(i)}static concat(i,...n){const r=new this(i);return n.forEach(o=>r.set(o)),r}static accessor(i){const r=(this[Ha]=this[Ha]={accessors:{}}).accessors,o=this.prototype;function c(u){const y=mn(u);r[y]||(k0(o,u),r[y]=!0)}return te.isArray(i)?i.forEach(c):c(i),this}}$n.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors($n.prototype,({value:t},i)=>{let n=i[0].toUpperCase()+i.slice(1);return{get:()=>t,set(r){this[n]=r}}}),te.freezeMethods($n);const nt=$n;function Ar(t,i){const n=this||Nr,r=i||n,o=nt.from(r.headers);let c=r.data;return te.forEach(t,function(y){c=y.call(n,c,o.normalize(),i?i.status:void 0)}),o.normalize(),c}function Ua(t){return!!(t&&t.__CANCEL__)}function tn(t,i,n){xe.call(this,t??"canceled",xe.ERR_CANCELED,i,n),this.name="CanceledError"}te.inherits(tn,xe,{__CANCEL__:!0});function za(t,i,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):i(new xe("Request failed with status code "+n.status,[xe.ERR_BAD_REQUEST,xe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function w0(t){const i=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return i&&i[1]||""}function N0(t,i){t=t||10;const n=new Array(t),r=new Array(t);let o=0,c=0,u;return i=i!==void 0?i:1e3,function(x){const f=Date.now(),s=r[c];u||(u=f),n[o]=x,r[o]=f;let _=c,a=0;for(;_!==o;)a+=n[_++],_=_%t;if(o=(o+1)%t,o===c&&(c=(c+1)%t),f-u<i)return;const h=s&&f-s;return h?Math.round(a*1e3/h):void 0}}function B0(t,i){let n=0,r=1e3/i,o,c;const u=(f,s=Date.now())=>{n=s,o=null,c&&(clearTimeout(c),c=null),t(...f)};return[(...f)=>{const s=Date.now(),_=s-n;_>=r?u(f,s):(o=f,c||(c=setTimeout(()=>{c=null,u(o)},r-_)))},()=>o&&u(o)]}const jn=(t,i,n=3)=>{let r=0;const o=N0(50,250);return B0(c=>{const u=c.loaded,y=c.lengthComputable?c.total:void 0,x=u-r,f=o(x),s=u<=y;r=u;const _={loaded:u,total:y,progress:y?u/y:void 0,bytes:x,rate:f||void 0,estimated:f&&y&&s?(y-u)/f:void 0,event:c,lengthComputable:y!=null,[i?"download":"upload"]:!0};t(_)},n)},Xa=(t,i)=>{const n=t!=null;return[r=>i[0]({lengthComputable:n,total:t,loaded:r}),i[1]]},Ka=t=>(...i)=>te.asap(()=>t(...i)),A0=Pe.hasStandardBrowserEnv?((t,i)=>n=>(n=new URL(n,Pe.origin),t.protocol===n.protocol&&t.host===n.host&&(i||t.port===n.port)))(new URL(Pe.origin),Pe.navigator&&/(msie|trident)/i.test(Pe.navigator.userAgent)):()=>!0,S0=Pe.hasStandardBrowserEnv?{write(t,i,n,r,o,c,u){if(typeof document>"u")return;const y=[`${t}=${encodeURIComponent(i)}`];te.isNumber(n)&&y.push(`expires=${new Date(n).toUTCString()}`),te.isString(r)&&y.push(`path=${r}`),te.isString(o)&&y.push(`domain=${o}`),c===!0&&y.push("secure"),te.isString(u)&&y.push(`SameSite=${u}`),document.cookie=y.join("; ")},read(t){if(typeof document>"u")return null;const i=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return i?decodeURIComponent(i[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function O0(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function I0(t,i){return i?t.replace(/\/?\/$/,"")+"/"+i.replace(/^\/+/,""):t}function Qa(t,i,n){let r=!O0(i);return t&&(r||n==!1)?I0(t,i):i}const Za=t=>t instanceof nt?{...t}:t;function Rt(t,i){i=i||{};const n={};function r(f,s,_,a){return te.isPlainObject(f)&&te.isPlainObject(s)?te.merge.call({caseless:a},f,s):te.isPlainObject(s)?te.merge({},s):te.isArray(s)?s.slice():s}function o(f,s,_,a){if(te.isUndefined(s)){if(!te.isUndefined(f))return r(void 0,f,_,a)}else return r(f,s,_,a)}function c(f,s){if(!te.isUndefined(s))return r(void 0,s)}function u(f,s){if(te.isUndefined(s)){if(!te.isUndefined(f))return r(void 0,f)}else return r(void 0,s)}function y(f,s,_){if(_ in i)return r(f,s);if(_ in t)return r(void 0,f)}const x={url:c,method:c,data:c,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:y,headers:(f,s,_)=>o(Za(f),Za(s),_,!0)};return te.forEach(Object.keys({...t,...i}),function(s){const _=x[s]||o,a=_(t[s],i[s],s);te.isUndefined(a)&&_!==y||(n[s]=a)}),n}const Ga=t=>{const i=Rt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:c,headers:u,auth:y}=i;if(i.headers=u=nt.from(u),i.url=Ma(Qa(i.baseURL,i.url,i.allowAbsoluteUrls),t.params,t.paramsSerializer),y&&u.set("Authorization","Basic "+btoa((y.username||"")+":"+(y.password?unescape(encodeURIComponent(y.password)):""))),te.isFormData(n)){if(Pe.hasStandardBrowserEnv||Pe.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(te.isFunction(n.getHeaders)){const x=n.getHeaders(),f=["content-type","content-length"];Object.entries(x).forEach(([s,_])=>{f.includes(s.toLowerCase())&&u.set(s,_)})}}if(Pe.hasStandardBrowserEnv&&(r&&te.isFunction(r)&&(r=r(i)),r||r!==!1&&A0(i.url))){const x=o&&c&&S0.read(c);x&&u.set(o,x)}return i},T0=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=Ga(t);let c=o.data;const u=nt.from(o.headers).normalize();let{responseType:y,onUploadProgress:x,onDownloadProgress:f}=o,s,_,a,h,d;function p(){h&&h(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(s),o.signal&&o.signal.removeEventListener("abort",s)}let l=new XMLHttpRequest;l.open(o.method.toUpperCase(),o.url,!0),l.timeout=o.timeout;function g(){if(!l)return;const b=nt.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),C={data:!y||y==="text"||y==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:b,config:t,request:l};za(function(w){n(w),p()},function(w){r(w),p()},C),l=null}"onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(r(new xe("Request aborted",xe.ECONNABORTED,t,l)),l=null)},l.onerror=function(v){const C=v&&v.message?v.message:"Network Error",A=new xe(C,xe.ERR_NETWORK,t,l);A.event=v||null,r(A),l=null},l.ontimeout=function(){let v=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const C=o.transitional||$a;o.timeoutErrorMessage&&(v=o.timeoutErrorMessage),r(new xe(v,C.clarifyTimeoutError?xe.ETIMEDOUT:xe.ECONNABORTED,t,l)),l=null},c===void 0&&u.setContentType(null),"setRequestHeader"in l&&te.forEach(u.toJSON(),function(v,C){l.setRequestHeader(C,v)}),te.isUndefined(o.withCredentials)||(l.withCredentials=!!o.withCredentials),y&&y!=="json"&&(l.responseType=o.responseType),f&&([a,d]=jn(f,!0),l.addEventListener("progress",a)),x&&l.upload&&([_,h]=jn(x),l.upload.addEventListener("progress",_),l.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(s=b=>{l&&(r(!b||b.type?new tn(null,t,l):b),l.abort(),l=null)},o.cancelToken&&o.cancelToken.subscribe(s),o.signal&&(o.signal.aborted?s():o.signal.addEventListener("abort",s)));const m=w0(o.url);if(m&&Pe.protocols.indexOf(m)===-1){r(new xe("Unsupported protocol "+m+":",xe.ERR_BAD_REQUEST,t));return}l.send(c||null)})},V0=(t,i)=>{const{length:n}=t=t?t.filter(Boolean):[];if(i||n){let r=new AbortController,o;const c=function(f){if(!o){o=!0,y();const s=f instanceof Error?f:this.reason;r.abort(s instanceof xe?s:new tn(s instanceof Error?s.message:s))}};let u=i&&setTimeout(()=>{u=null,c(new xe(`timeout ${i} of ms exceeded`,xe.ETIMEDOUT))},i);const y=()=>{t&&(u&&clearTimeout(u),u=null,t.forEach(f=>{f.unsubscribe?f.unsubscribe(c):f.removeEventListener("abort",c)}),t=null)};t.forEach(f=>f.addEventListener("abort",c));const{signal:x}=r;return x.unsubscribe=()=>te.asap(y),x}},D0=function*(t,i){let n=t.byteLength;if(!i||n<i){yield t;return}let r=0,o;for(;r<n;)o=r+i,yield t.slice(r,o),r=o},L0=async function*(t,i){for await(const n of R0(t))yield*D0(n,i)},R0=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const i=t.getReader();try{for(;;){const{done:n,value:r}=await i.read();if(n)break;yield r}}finally{await i.cancel()}},Wa=(t,i,n,r)=>{const o=L0(t,i);let c=0,u,y=x=>{u||(u=!0,r&&r(x))};return new ReadableStream({async pull(x){try{const{done:f,value:s}=await o.next();if(f){y(),x.close();return}let _=s.byteLength;if(n){let a=c+=_;n(a)}x.enqueue(new Uint8Array(s))}catch(f){throw y(f),f}},cancel(x){return y(x),o.return()}},{highWaterMark:2})},Ja=64*1024,{isFunction:Hn}=te,F0=(({Request:t,Response:i})=>({Request:t,Response:i}))(te.global),{ReadableStream:Ya,TextEncoder:ei}=te.global,ti=(t,...i)=>{try{return!!t(...i)}catch{return!1}},P0=t=>{t=te.merge.call({skipUndefined:!0},F0,t);const{fetch:i,Request:n,Response:r}=t,o=i?Hn(i):typeof fetch=="function",c=Hn(n),u=Hn(r);if(!o)return!1;const y=o&&Hn(Ya),x=o&&(typeof ei=="function"?(d=>p=>d.encode(p))(new ei):async d=>new Uint8Array(await new n(d).arrayBuffer())),f=c&&y&&ti(()=>{let d=!1;const p=new n(Pe.origin,{body:new Ya,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!p}),s=u&&y&&ti(()=>te.isReadableStream(new r("").body)),_={stream:s&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!_[d]&&(_[d]=(p,l)=>{let g=p&&p[d];if(g)return g.call(p);throw new xe(`Response type '${d}' is not supported`,xe.ERR_NOT_SUPPORT,l)})});const a=async d=>{if(d==null)return 0;if(te.isBlob(d))return d.size;if(te.isSpecCompliantForm(d))return(await new n(Pe.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(te.isArrayBufferView(d)||te.isArrayBuffer(d))return d.byteLength;if(te.isURLSearchParams(d)&&(d=d+""),te.isString(d))return(await x(d)).byteLength},h=async(d,p)=>{const l=te.toFiniteNumber(d.getContentLength());return l??a(p)};return async d=>{let{url:p,method:l,data:g,signal:m,cancelToken:b,timeout:v,onDownloadProgress:C,onUploadProgress:A,responseType:w,headers:S,withCredentials:I="same-origin",fetchOptions:B}=Ga(d),k=i||fetch;w=w?(w+"").toLowerCase():"text";let N=V0([m,b&&b.toAbortSignal()],v),V=null;const L=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let M;try{if(A&&f&&l!=="get"&&l!=="head"&&(M=await h(S,g))!==0){let E=new n(p,{method:"POST",body:g,duplex:"half"}),T;if(te.isFormData(g)&&(T=E.headers.get("content-type"))&&S.setContentType(T),E.body){const[D,P]=Xa(M,jn(Ka(A)));g=Wa(E.body,Ja,D,P)}}te.isString(I)||(I=I?"include":"omit");const Q=c&&"credentials"in n.prototype,G={...B,signal:N,method:l.toUpperCase(),headers:S.normalize().toJSON(),body:g,duplex:"half",credentials:Q?I:void 0};V=c&&new n(p,G);let ee=await(c?k(V,B):k(p,G));const X=s&&(w==="stream"||w==="response");if(s&&(C||X&&L)){const E={};["status","statusText","headers"].forEach(z=>{E[z]=ee[z]});const T=te.toFiniteNumber(ee.headers.get("content-length")),[D,P]=C&&Xa(T,jn(Ka(C),!0))||[];ee=new r(Wa(ee.body,Ja,D,()=>{P&&P(),L&&L()}),E)}w=w||"text";let R=await _[te.findKey(_,w)||"text"](ee,d);return!X&&L&&L(),await new Promise((E,T)=>{za(E,T,{data:R,headers:nt.from(ee.headers),status:ee.status,statusText:ee.statusText,config:d,request:V})})}catch(Q){throw L&&L(),Q&&Q.name==="TypeError"&&/Load failed|fetch/i.test(Q.message)?Object.assign(new xe("Network Error",xe.ERR_NETWORK,d,V),{cause:Q.cause||Q}):xe.from(Q,Q&&Q.code,d,V)}}},M0=new Map,ni=t=>{let i=t&&t.env||{};const{fetch:n,Request:r,Response:o}=i,c=[r,o,n];let u=c.length,y=u,x,f,s=M0;for(;y--;)x=c[y],f=s.get(x),f===void 0&&s.set(x,f=y?new Map:P0(i)),s=f;return f};ni();const Sr={http:l0,xhr:T0,fetch:{get:ni}};te.forEach(Sr,(t,i)=>{if(t){try{Object.defineProperty(t,"name",{value:i})}catch{}Object.defineProperty(t,"adapterName",{value:i})}});const ri=t=>`- ${t}`,q0=t=>te.isFunction(t)||t===null||t===!1;function $0(t,i){t=te.isArray(t)?t:[t];const{length:n}=t;let r,o;const c={};for(let u=0;u<n;u++){r=t[u];let y;if(o=r,!q0(r)&&(o=Sr[(y=String(r)).toLowerCase()],o===void 0))throw new xe(`Unknown adapter '${y}'`);if(o&&(te.isFunction(o)||(o=o.get(i))))break;c[y||"#"+u]=o}if(!o){const u=Object.entries(c).map(([x,f])=>`adapter ${x} `+(f===!1?"is not supported by the environment":"is not available in the build"));let y=n?u.length>1?`since :
|
|
8
8
|
`+u.map(ri).join(`
|
|
9
9
|
`):" "+ri(u[0]):"as no adapter specified";throw new xe("There is no suitable adapter to dispatch the request "+y,"ERR_NOT_SUPPORT")}return o}const oi={getAdapter:$0,adapters:Sr};function Or(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tn(null,t)}function ai(t){return Or(t),t.headers=nt.from(t.headers),t.data=Ar.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),oi.getAdapter(t.adapter||Nr.adapter,t)(t).then(function(r){return Or(t),r.data=Ar.call(t,t.transformResponse,r),r.headers=nt.from(r.headers),r},function(r){return Ua(r)||(Or(t),r&&r.response&&(r.response.data=Ar.call(t,t.transformResponse,r.response),r.response.headers=nt.from(r.response.headers))),Promise.reject(r)})}const ii="1.13.2",Un={};["object","boolean","number","function","string","symbol"].forEach((t,i)=>{Un[t]=function(r){return typeof r===t||"a"+(i<1?"n ":" ")+t}});const li={};Un.transitional=function(i,n,r){function o(c,u){return"[Axios v"+ii+"] Transitional option '"+c+"'"+u+(r?". "+r:"")}return(c,u,y)=>{if(i===!1)throw new xe(o(u," has been removed"+(n?" in "+n:"")),xe.ERR_DEPRECATED);return n&&!li[u]&&(li[u]=!0,console.warn(o(u," has been deprecated since v"+n+" and will be removed in the near future"))),i?i(c,u,y):!0}},Un.spelling=function(i){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${i}`),!0)};function j0(t,i,n){if(typeof t!="object")throw new xe("options must be an object",xe.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const c=r[o],u=i[c];if(u){const y=t[c],x=y===void 0||u(y,c,t);if(x!==!0)throw new xe("option "+c+" must be "+x,xe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new xe("Unknown option "+c,xe.ERR_BAD_OPTION)}}const zn={assertOptions:j0,validators:Un},st=zn.validators;class Xn{constructor(i){this.defaults=i||{},this.interceptors={request:new qa,response:new qa}}async request(i,n){try{return await this._request(i,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const c=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?c&&!String(r.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
10
|
-
`+c):r.stack=c}catch{}}throw r}}_request(i,n){typeof i=="string"?(n=n||{},n.url=i):n=i||{},n=Rt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:c}=n;r!==void 0&&zn.assertOptions(r,{silentJSONParsing:st.transitional(st.boolean),forcedJSONParsing:st.transitional(st.boolean),clarifyTimeoutError:st.transitional(st.boolean)},!1),o!=null&&(te.isFunction(o)?n.paramsSerializer={serialize:o}:zn.assertOptions(o,{encode:st.function,serialize:st.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zn.assertOptions(n,{baseUrl:st.spelling("baseURL"),withXsrfToken:st.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=c&&te.merge(c.common,c[n.method]);c&&te.forEach(["delete","get","head","post","put","patch","common"],d=>{delete c[d]}),n.headers=nt.concat(u,c);const y=[];let x=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(n)===!1||(x=x&&p.synchronous,y.unshift(p.fulfilled,p.rejected))});const f=[];this.interceptors.response.forEach(function(p){f.push(p.fulfilled,p.rejected)});let s,_=0,a;if(!x){const d=[ai.bind(this),void 0];for(d.unshift(...y),d.push(...f),a=d.length,s=Promise.resolve(n);_<a;)s=s.then(d[_++],d[_++]);return s}a=y.length;let h=n;for(;_<a;){const d=y[_++],p=y[_++];try{h=d(h)}catch(l){p.call(this,l);break}}try{s=ai.call(this,h)}catch(d){return Promise.reject(d)}for(_=0,a=f.length;_<a;)s=s.then(f[_++],f[_++]);return s}getUri(i){i=Rt(this.defaults,i);const n=Qa(i.baseURL,i.url,i.allowAbsoluteUrls);return Ma(n,i.params,i.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(i){Xn.prototype[i]=function(n,r){return this.request(Rt(r||{},{method:i,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(i){function n(r){return function(c,u,y){return this.request(Rt(y||{},{method:i,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:u}))}}Xn.prototype[i]=n(),Xn.prototype[i+"Form"]=n(!0)});const Kn=Xn;class Ir{constructor(i){if(typeof i!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(c){n=c});const r=this;this.promise.then(o=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](o);r._listeners=null}),this.promise.then=o=>{let c;const u=new Promise(y=>{r.subscribe(y),c=y}).then(o);return u.cancel=function(){r.unsubscribe(c)},u},i(function(c,u,y){r.reason||(r.reason=new tn(c,u,y),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const n=this._listeners.indexOf(i);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const i=new AbortController,n=r=>{i.abort(r)};return this.subscribe(n),i.signal.unsubscribe=()=>this.unsubscribe(n),i.signal}static source(){let i;return{token:new Ir(function(o){i=o}),cancel:i}}}const H0=Ir;function U0(t){return function(n){return t.apply(null,n)}}function z0(t){return te.isObject(t)&&t.isAxiosError===!0}const Tr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Tr).forEach(([t,i])=>{Tr[i]=t});const X0=Tr;function si(t){const i=new Kn(t),n=ka(Kn.prototype.request,i);return te.extend(n,Kn.prototype,i,{allOwnKeys:!0}),te.extend(n,i,null,{allOwnKeys:!0}),n.create=function(o){return si(Rt(t,o))},n}const Ne=si(Nr);Ne.Axios=Kn,Ne.CanceledError=tn,Ne.CancelToken=H0,Ne.isCancel=Ua,Ne.VERSION=ii,Ne.toFormData=Mn,Ne.AxiosError=xe,Ne.Cancel=Ne.CanceledError,Ne.all=function(i){return Promise.all(i)},Ne.spread=U0,Ne.isAxiosError=z0,Ne.mergeConfig=Rt,Ne.AxiosHeaders=nt,Ne.formToJSON=t=>ja(te.isHTMLForm(t)?new FormData(t):t),Ne.getAdapter=oi.getAdapter,Ne.HttpStatusCode=X0,Ne.default=Ne;class K0{constructor(i,n,r,o){this.awsURL="https://ec-apigw.blink.expedite1.com",this.headers={"x-api-key":i,"X-Salesforce-Org-Type":n,"X-Salesforce-Org-Id":r,"X-Salesforce-User-Id":o,"Content-Type":"application/json"}}}const ci=je.defineStore("comShare",()=>{const t=e.ref(""),i=e.ref(""),n=e.ref(""),r=e.ref(""),o=e.ref(""),c=e.ref(""),u=e.ref(""),y=e.ref("Single"),x=e.computed(()=>y.value==="Single");async function f(s){t.value=s.orgType||"Production",i.value=s.orgId||"",n.value=s.userId||"",r.value=s.accountId||"",o.value=s.opportunityId||"",u.value=s.userLocale||"en_US",y.value=s.pricingSchema||"Single"}return{orgType:t,orgId:i,userId:n,accountId:r,opportunityId:o,userLocale:u,pricingSchema:y,quoteId:c,isSinglePricingSchema:x,setSetupData:f}});function Q0(t){return t.offerData.pricingTypes.forEach(i=>{i.appliedOnField==="Catalog Price"?(t.catalogPrice=i,t.salesPrice=i.offerPrice,t.price=i.offerPrice):i.appliedOnField==="MRC"?(t.mrcPrice=i,t.mrc=i.offerPrice):i.appliedOnField==="YRC"&&(t.yrcPrice=i,t.yrc=i.offerPrice)}),t}function Z0(t){const i=n=>Math.min(...n.options.map(r=>r.relationshipInfo.primarySortOrder));return t.forEach(n=>{n.itemTypes.forEach(r=>{r.options.sort((o,c)=>o.relationshipInfo.primarySortOrder-c.relationshipInfo.primarySortOrder||o.itemName.localeCompare(c.itemName))}),n.itemTypes.sort((r,o)=>i(r)-i(o)||r.itemTypeName.localeCompare(o.itemTypeName))}),t.sort((n,r)=>{const o=Math.min(...n.itemTypes.map(i)),c=Math.min(...r.itemTypes.map(i));return o-c||n.category.localeCompare(r.category)}),t}const G0=(t,i)=>{const n=(r,o)=>typeof o=="function"?void 0:o;return JSON.stringify(t,n)===JSON.stringify(i,n)};class W0 extends K0{constructor(i,n,r,o){super(i,n,r,o)}async getAvailableConfiguration(i){return(await Ne.post(`${this.awsURL}/product-pricing/getAvailableConfiguration`,i,{headers:this.headers})).data}async getLineItems({request:i}){const n=await Ne.post(`${this.awsURL}/quoting/getConfiguredLineItems`,i,{headers:this.headers});return console.info("getLineItems:response",n.data),n.data}async maintainQuoteConfiguration({request:i}){const n=await Ne.post(`${this.awsURL}/transactions/maintainConfiguration`,i,{headers:this.headers});return console.info("maintainQuoteConfiguration:response",n.data),n.data}async getProductCrossSells({objectId:i,productItemId:n}){const r=await Ne.get(`${this.awsURL}/pricing/getProductCrossSells?productItemId=${n}&objectId=${i}`,{headers:this.headers});return console.info("getProductCrossSells:response",r.data),r.data}async addLines({request:i}){const n=await Ne.post(`${this.awsURL}/transactions/addLines`,i,{headers:this.headers});return console.info("addLines:response",n.data),n.data}async evaluateConfigurationSelection({request:i}){const n=await Ne.post("https://api-svc.blink.expedite1.com/api/product-pricing/evaluateConfigurationSelection",i,{headers:this.headers});return console.info("evaluateConfigurationSelection:response",n.data),n.data}}const ct=je.defineStore("comConfigurator",()=>{const t=e.ref(null),i=et(),n=ci(),r=dn(),o=e.ref(null),c=e.ref(null),u=e.ref(null),y=e.ref(null),x=e.ref(null),f=e.ref([]),s=e.ref(null),_=e.ref([]),a=e.ref([]),h=e.ref(null),d=e.ref(new Map),p=e.ref(!1),l=e.ref({init:!1,configuration:!1,lineItem:!1,productOptionsPricing:!1,bestOfferPrice:!1,lineItemAttributes:!1,save:!1}),g=e.ref(!1),m=e.computed(()=>b.value&&!n.isSinglePricingSchema),b=e.computed(()=>{var Y;if(!y.value||!((Y=y.value.categoryOptions)!=null&&Y.length)>0)return!1;let F=!0,$=!0,K=!0,j=null,J=!1;for(const se of y.value.categoryOptions)for(const de of se.itemTypes)for(const ce of de.options)ce.billingPeriod&&(j&&j!==ce.billingPeriod&&(K=!1),j=ce.billingPeriod,!ce.yrcPrice&&ce.billingPeriod==="Monthly"&&(F=!1),!ce.mrcPrice&&ce.billingPeriod==="Yearly"&&($=!1),J=!0);return F&&$&&K&&J}),v=e.computed(()=>!G0(y.value,x.value)),C=e.computed(()=>{var $;const F=(($=y.value)==null?void 0:$.categoryOptions)||[];return F.forEach(K=>{K.itemTypes.forEach(j=>{j.selectedOptions=j.options.filter(J=>j.selected.includes(J.itemId)),j.totalPrice=function(){return j.selectedOptions.reduce((J,Y)=>J+Y.price*Y.qty,0)||0},j.oneTimePrice=function(){return j.selectedOptions.filter(J=>!J.billingPeriod).reduce((J,Y)=>J+Y.price*Y.qty,0)||0},j.recurringPrice=function(){return j.selectedOptions.filter(J=>J.billingPeriod).reduce((J,Y)=>J+Y.price*Y.qty,0)||0}}),K.selectedItemTypes=K.itemTypes.filter(j=>j.selected.length>0),K.totalPrice=function(){return K.itemTypes.reduce((j,J)=>j+J.totalPrice(),0)},K.oneTimePrice=function(){return K.itemTypes.reduce((j,J)=>j+J.oneTimePrice(),0)},K.recurringPrice=function(){return K.itemTypes.reduce((j,J)=>j+J.recurringPrice(),0)}}),F.filter(K=>K.itemTypes.filter(j=>j.selected.length>0).length>0)}),A=e.computed(()=>C.value.reduce((F,$)=>F+$.totalPrice(),0)),w=e.computed(()=>{if(!y.value)return{basePrice:0,addOns:0,oneTimePrice:0,recurringPrice:0,total:0};const F=C.value.reduce((j,J)=>j+J.totalPrice(),0);let $=C.value.reduce((j,J)=>j+J.oneTimePrice(),0),K=C.value.reduce((j,J)=>j+J.recurringPrice(),0);return y.value.billingPeriod?K=(K+y.value.price)*y.value.qty:$=($+y.value.price)*y.value.qty,{basePrice:y.value.price,addOns:F,oneTimePrice:$,recurringPrice:K,total:y.value.price*y.value.qty+F*y.value.qty+$+K}}),S=e.computed(()=>{var $,K,j,J;const F=new Map;return($=s.value)!=null&&$.productLineItem&&F.set((K=s.value)==null?void 0:K.productLineItem.XX_ORD1__Item__c,(j=s.value)==null?void 0:j.productLineItem),(J=s.value)==null||J.options.forEach(Y=>{F.set(Y.XX_ORD1__Item__c,Y)}),F}),I=e.computed(()=>{var $;const F=new Map;return y.value&&(($=y.value.categoryOptions)==null?void 0:$.length)>0&&y.value.categoryOptions.forEach(K=>{K.itemTypes.forEach(j=>{j.options.forEach(J=>{F.set(J.publishKey,J)})})}),F}),B=e.computed(()=>{if(!y.value)return{};const F=j=>!j||!Array.isArray(j)?[]:j.map(J=>({field:J.apiName,dataType:J.dataType,picklistValues:J.picklistValues,isEditable:J.editable,defaultValue:J.defaultValue,value:J.dataType==="BOOLEAN"?J.value?"true":"false":J.dataType==="REFERENCE"?J.referenceRecordId||J.value||"":J.value||""})),$={itemId:y.value.itemId,qliId:y.value.qliId||null,name:y.value.itemName,qty:y.value.qty||1,salesPrice:y.value.price||0,mrc:y.value.mrc||null,yrc:y.value.yrc||null,attributes:F(y.value.attributes)},K=[];return y.value.categoryOptions.forEach(j=>{j.itemTypes.forEach(J=>{J.options.forEach(Y=>{J.selected.includes(Y.itemId)&&K.push({itemId:Y.itemId,qliId:Y.qliId||null,name:Y.itemName,qty:Y.qty||1,salesPrice:Y.price||0,mrc:Y.mrc||null,yrc:Y.yrc||null,attributes:F(Y.attributes)})})})}),{[y.value.itemId]:{product:$,options:K}}}),k=(F,$)=>{if(!F||!Array.isArray(F))return[];const K=new Map;return $.forEach(j=>{K.set(j.fieldAPIName,j.value)}),F.map(j=>(j.value=K.get(j.fieldAPIName)||null,j))};function N(F,$){console.log("updateCurrentConfiguration:newConfiguration",JSON.stringify(F)),console.log("updateCurrentConfiguration:suggestedConfigurations",JSON.stringify($)),$&&(a.value=$.filter(j=>j.product.itemId!==F.product.itemId));const K=new Map;F.options.forEach(j=>{K.set(j.itemId,j)}),y.value.itemName=F.product.name,y.value.qty=F.product.qty,y.value.price=F.product.salesPrice,y.value.attributes=k(y.value.attributes,F.product.attributes),y.value.categoryOptions.forEach(j=>{j.itemTypes.forEach(J=>{J.selected=[],J.options.forEach(Y=>{K.has(Y.itemId)&&(Y.itemName=K.get(Y.itemId).name,Y.qty=K.get(Y.itemId).qty,Y.price=K.get(Y.itemId).salesPrice,Y.qliId=K.get(Y.itemId).qliId,Y.attributes=k(Y.attributes,K.get(Y.itemId).attributes),J.selected.push(Y.itemId))})})}),y.value={...y.value}}function V(){return{get getConfig(){return B.value},setConfig:N}}function L(F){y.value.qliId&&(y.value.qliBillingPeriod==="Monthly"&&!F?y.value.price=y.value.salesPrice||y.value.mrc:y.value.qliBillingPeriod==="Yearly"&&F&&(y.value.price=y.value.salesPrice)),y.value.categoryOptions.forEach($=>{$.itemTypes.forEach(K=>{K.options.forEach(j=>{j.billingPeriod&&(j.price=(F?j.yrcPrice.offerPrice:j.mrcPrice.offerPrice)||j.price,j.qliId&&(j.qliBillingPeriod==="Monthly"&&!F?j.price=j.salesPrice||j.mrc:j.qliBillingPeriod==="Yearly"&&F&&(j.price=j.salesPrice)))})})})}function M(){y.value=null,x.value=null,f.value=[],u.value=null,s.value=null,h.value=null,d.value=new Map,p.value=!1,l.value.configuration=!1,l.value.lineItem=!1,l.value.productOptionsPricing=!1,l.value.bestOfferPrice=!1,l.value.lineItemAttributes=!1,l.value.save=!1}function Q(F,$,K,j){t.value=new W0(F,$,K,j)}async function G(F,$,K){l.value.init=!0,console.time("CONFIGURATOR INIT CONFIGURATOR"),M(),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","1"),c.value=F,u.value=$,o.value=K||n.quoteId;const j=await ee();console.timeLog("CONFIGURATOR INIT CONFIGURATOR","2"),y.value=X(j),u.value?(await E(),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","3"),R(y.value),y.value.categoryOptions.forEach(J=>{J.itemTypes.forEach(Y=>{Y.options.forEach(se=>{R(se),(S.value.has(se.itemId)||se.relationshipInfo.relationship==="Kit")&&Y.selected.push(se.itemId)})})}),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","4")):E(),x.value=JSON.parse(JSON.stringify(y.value)),console.timeEnd("CONFIGURATOR INIT CONFIGURATOR"),l.value.init=!1}async function ee(){try{const F={accountId:n.accountId,objectId:o.value,itemId:c.value,configScope:"BASIC",fields:[],pricePreference:"Lowest Price"},$=await t.value.getAvailableConfiguration(F);console.info("getAvailableConfiguration:result",$);const K=$.data.productConfiguration;return K.categoryOptions=Z0(K.categoryOptions),K}catch(F){return console.info("error",F.message),!1}}function X(F){d.value.set(u.value,F.attributes),f.value=F.configRules;const $=new Set;return f.value.forEach(K=>{const j=JSON.parse(K.ruleJson);j.optionSelected.forEach(J=>{$.add(J)}),j.affectedOptions.forEach(J=>{$.add(J)})}),console.info("rulesByPublishKey",$),R(F),F.categoryOptions.forEach(K=>{K.key=K.category.toLowerCase().replace(/\s+/g,"-").replace(/[&]/g,""),K.itemTypes.forEach(j=>{j.selected=[],j.numberOfColumns||(j.numberOfColumns=1),j.numberOfColumns>1&&(j.lightboxAttributes=!0),j.maxNumber||(j.maxNumber=100),j.minNumber||(j.minNumber=0),j.maxQuantity||(j.maxQuantity=1e4),j.minQuantity||(j.minQuantity=1),j.maxNumber===1?(j.isRadio=!0,j.minMessage="Please select 1 option",j.maxMessage="",j.isKit=j.options.some(J=>J.relationshipInfo.relationship==="Kit")):(j.minMessage=`Minimum of ${j.minNumber} selection${j.minNumber!==1?"s":""} required`,j.maxMessage=`Maximum of ${j.maxNumber} selection${j.maxNumber!==1?"s":""} allowed`),j.options.forEach(J=>{K.showImage=K.showImage||!!J.defaultImageURL,J.showAttributesModal=!1,J.calculateRules=$.has("option."+J.publishKey),console.info("option.calculateRules",J.calculateRules),J.qty=j.minQuantity||1,J.getTags=()=>(J.attributes=J.attributes||[],J.attributes.filter(Y=>Y.value!==null&&Y.value!=="").map(Y=>({label:Y.label,value:Y.value}))),Object.defineProperty(J,"isDisabled",{get:function(){return J.relationshipInfo.relationship==="Kit"||(j.isRadio?j.isKit:!j.selected.includes(J.itemId)&&j.maxNumber===j.selected.length)}}),R(J)})})}),F}function R(F){F.isAttributes=F.attributes&&F.attributes.length>0;const $=F.catalogItem;if(S.value.has(F.itemId)){const K=S.value.get(F.itemId);F.qliId=K.Id,F.qty=K.XX_ORD1__QTY__c,F.itemName=K.XX_ORD1__Line_Description__c,F.billingPeriod=K.XX_ORD1__Billing_Period__c,F.price=K.XX_ORD1__Sales_Price__c,F.billingPeriod?F.price=K.XX_ORD1__Sales_Price__c||K.XX_ORD1__MRC__c:F.price=K.XX_ORD1__NRC__c||K.XX_ORD1__Sales_Price__c,F.salesPrice=K.XX_ORD1__Sales_Price__c,F.nrc=K.XX_ORD1__NRC__c,F.mrc=K.XX_ORD1__MRC__c,F.qliBillingPeriod=K.XX_ORD1__Billing_Period__c,d.value.set(F.qliId,F.attributes)}else F.itemName=$.XX_ORD1__Line_Description__c||F.itemName,F.price=$.XX_ORD1__Negotiated_Price__c||$.XX_ORD1__NRC_for_New__c,F.nrcPrice=$.XX_ORD1__NRC_for_New__c,F.qty=F.qty||1,Q0(F)}async function E(){l.value.lineItem=!0,console.info("getLineItems",o.value,u.value);try{const F={objectId:o.value,filters:{},additionalFields:["Name","XX_ORD1__Line_Description__c","XX_ORD1__SYS_Configuration_Status2__c"],primarySort:{field:"CreatedDate",direction:"DESC"},productPage:{limit:200,offset:0,productLineItemId:u.value}},$=await t.value.getLineItems({request:JSON.stringify(F)});return($.data.products||[]).forEach(j=>{const J=j.productLineItem;J.Id===u.value?s.value=j:_.value.push(J)}),console.info("lineItem.value",s.value),console.info("configurableLineItems.value",_.value),l.value.lineItem=!1,$}catch(F){return console.info("error",F.message),l.value.lineItem=!1,!1}}async function T(F){console.info("getRecords");try{const $=await window.productManagerController.getRecords({request:JSON.stringify(F)});return console.info("getRecords:result",$),JSON.parse($.data)}catch($){return console.info("error",$.message),!1}}async function D(){p.value=!0,l.value.save=!0,console.info("maintainQuoteConfiguration");const F=[],$=[];y.value.categoryOptions.forEach(J=>{J.itemTypes.forEach(Y=>{Y.options.forEach(se=>{Y.selected.includes(se.itemId)?F.push(P(se)):se.qliId&&$.push(se.qliId)})})});const K={objectId:o.value,eCatalogId:n.eCatalogId,isGenesisAI:!0,blinkUser:!1,optionsToRemove:$,grandFatheredOptionsToRemove:[],productLineItem:{...P(y.value),optionLineItems:F}};console.info("maintainQuoteConfiguration:request",K);const j=await t.value.maintainQuoteConfiguration({request:JSON.stringify(K)});if(console.info("maintainQuoteConfiguration:result",j),j!=null&&j.error){const J={title:"Unable to Save Configuration",description:j.error,button:{label:"Back to Configuration",action:()=>{p.value=!1}},cancel:{label:"Quote List",action:()=>{r.push("/quote-item?id="+o.value)}}};i.errorPopup=J}else if(x.value=JSON.parse(JSON.stringify(y.value)),console.info("maintainQuoteConfiguration:result",j),l.value.save=!1,!u.value)return y.value.qliId=j.data.productLineItem.lineItemId,u.value=j.data.productLineItem.lineItemId,j.data.productLineItem.lineItemId;l.value.save=!1}function P(F){const $={};F.isAttributes&&F.attributes.forEach(j=>{!j.apiName.includes(".")&&j.value!==null&&j.value!==void 0&&(j.dataType==="BOOLEAN"?$[j.apiName]=j.value?"true":"false":j.dataType==="REFERENCE"?$[j.apiName]=j.referenceRecordId:$[j.apiName]=j.value)});const K={attributes:$,itemId:F.itemId,lineItemId:F.qliId,lineDescription:F.itemName,qty:F.qty,billingPeriod:F.billingPeriod,...F.offer};return F.billingPeriod&&b.value&&!n.isSinglePricingSchema&&(K.billingPeriod=g.value?"Yearly":"Monthly"),!n.isSinglePricingSchema&&!F.billingPeriod?K.nrcPrice=F.price:(K.applyOnField="Catalog Price",K.salesPrice=F.price,K.nrcPrice=F.nrcPrice),K}async function z(){const F={objectId:n.accountId,productItemId:c.value};try{let $=await t.value.getProductCrossSells(F);const{crossSells:K,offerResult:j}=$.data;if(K.length===0)return[];const J=new Map;return j.forEach(Y=>{J.set(Y.eCatalogItemId,{...Y,...Y.pricingTypes[0]})}),K.forEach(Y=>{Y.loading=!1,Y.Name=Y.XX_ORD1__Line_Description__c||Y.XX_ORD1__Item__r.Name,Y.Description=Y.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,J.has(Y.Id)?(Y.Price=J.get(Y.Id).offerPrice,Y.priceFormatted=J.get(Y.Id).formattedOfferPrice,Y.offer={offerDiscount:J.get(Y.Id).offerDiscount,offerId:J.get(Y.Id).offerId,offerType:J.get(Y.Id).offerType}):(Y.Price=Y.XX_ORD1__List_Price2__c,Y.priceFormatted=Y.XX_ORD1__List_Price2__c,Y.offer={offerDiscount:0,offerId:null,offerType:null})}),K}catch($){return console.info("error",$.message),!1}}const q=F=>!F||!Array.isArray(F)?[]:F.filter($=>$.apiName&&$.value!==null&&$.value!==void 0&&$.value!=="").map($=>({attrName:$.apiName,attrValue:$.dataType==="BOOLEAN"?$.value:$.value||"",dataType:$.dataType}));async function U(F,$){const K={product:{publishKey:y.value.publishKey,attributes:q(y.value.attributes),lineDescription:y.value.itemName,meta:{XX_ORD1__Sales_Price__c:y.value.price,XX_ORD1__MRC__c:y.value.mrc,XX_ORD1__NRC__c:y.value.nrc,XX_ORD1__YRC__c:y.value.yrc,quantity:y.value.qty}},options:[]};y.value.categoryOptions.forEach(Y=>{Y.itemTypes.forEach(se=>{se.options.forEach(de=>{se.selected.includes(de.itemId)&&K.options.push({publishKey:de.publishKey,attributes:q(de.attributes),lineDescription:de.itemName,meta:{XX_ORD1__Sales_Price__c:de.price,XX_ORD1__MRC__c:de.mrc,XX_ORD1__NRC__c:de.nrc,XX_ORD1__YRC__c:de.yrc,quantity:de.qty}})})})}),console.info("evaluateConfigSelection:currentConfig.options",K.options);const j={itemId:c.value,currentConfig:K,selected:F?{publishKey:F==null?void 0:F.publishKey,attributes:q(F.attributes),lineDescription:F.itemName}:{},unselected:$?{publishKey:$==null?void 0:$.publishKey,attributes:q($.attributes),lineDescription:$.itemName}:{}};return await t.value.evaluateConfigurationSelection({request:JSON.stringify(j)})}async function Z(F){const $={objectId:o.value,lstLIRequest:[{eCatalogItemId:F.Id,quantity:1,offerApplicable:F.offer}]};try{const K=await t.value.addLines({request:JSON.stringify($)});console.info("addLines:result",K)}catch(K){return console.info("error",K.message),!1}}return{itemId:c,configuration:y,_configurationCopy:x,lineItem:s,savedScreen:p,loading:l,summary:C,addOns:A,summaryPrices:w,optionByItemId:S,attributesByQLIId:d,optionByPublishKey:I,showYearlyPricing:g,isYearlyPricingExist:b,isChangedConfiguration:v,isRecurringPricingSchema:m,configurableLineItems:_,suggestedConfigurations:a,initializeController:Q,exposeProperties:V,updateCurrentConfiguration:N,changePricingScheme:L,addLines:Z,resetConfigurator:M,getRecords:T,getProductCrossSells:z,initConfigurator:G,maintainQuoteConfiguration:D,evaluateConfigSelection:U}}),J0={class:"ect-p-4 ect-flex ect-gap-2 ect-items-center ect-justify-between ect-border-b ect-border-gray-200"},Y0={class:"ect-flex ect-items-center ect-gap-3"},ed={class:"ect-text-xl ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},td={key:0,class:"ect-flex ect-gap-1.5 ect-items-center"},nd=e.createElementVNode("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Saving configuration...",-1),rd={key:1,class:"ect-flex ect-gap-1.5 ect-items-center"},od=e.createElementVNode("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Configuration Saved Successfully",-1),ad={key:1,class:"ect-flex ect-flex-col ect-gap-4 ect-flex-1 ect-overflow-y-auto ect-mb-16"},id=e.createElementVNode("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},"You may consider these products",-1),ld={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},sd=["data-test-id"],cd={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},dd={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},ud={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},fd={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},hd={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},pd={key:2,class:"ect-flex ect-flex-col ect-gap-4 ect-m-4 ect-flex-1 ect-overflow-y-auto"},md=e.createElementVNode("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},"What do you want to do next?",-1),gd={class:"ect-flex ect-flex-col ect-gap-4"},yd=["data-test-id","onClick"],xd={class:"ect-flex ect-items-center ect-justify-center"},vd={class:"ect-flex ect-flex-col ect-items-center ect-gap-2 ect-w-full"},_d=["data-test-id"],bd=["data-test-id"],Cd={__name:"ConfiguratorRecommend",setup(t){const i=ct();dn();const n=e.computed(()=>i.configuration),r=e.ref(!0),o=e.ref(""),c=e.ref([{icon:"configuration",title:"Back to current Product Configuration",description:"Returns to the active product configuration page.",link:"/item/overview",action:"backToConfiguration"}]),u=e.ref(null),y=e.ref([]),x=async d=>{d.loading=!0,await i.addLines(d),d.disabled=!0,d.loading=!1},f=e.computed(()=>{var d;if(((d=i.suggestedConfigurations)==null?void 0:d.length)>0){const p=i.suggestedConfigurations[0];return{Name:p.product.name,Description:p.product.description,Price:p.product.salesPrice,XX_ORD1__Item__c:p.product.itemId}}return null}),s=d=>{d.action==="backToConfiguration"&&(i.savedScreen=!1)};async function _(){const d=i.configurableLineItems,p=d.filter(g=>g.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration").length;o.value=`(${d.length-p}/${d.length})`;const l=d.find(g=>g.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration"&&g.Id!=i.qliId);return u.value=l?{Name:l.XX_ORD1__Line_Description__c,Description:l.XX_ORD1__Product_Description__c,Price:l.XX_ORD1__Sales_Price__c,XX_ORD1__Item__c:l.XX_ORD1__Item__c,Id:l.Id}:null,d}async function a(){i.resetConfigurator(),await i.initConfigurator(f.value.XX_ORD1__Item__c,null),i.updateCurrentConfiguration(i.suggestedConfigurations[0],i.suggestedConfigurations)}async function h(){i.resetConfigurator(),i.initConfigurator(u.value.XX_ORD1__Item__c,u.value.Id)}return e.onBeforeMount(async()=>{r.value=!0;const d=await _(),p=await i.getProductCrossSells(),l=new Set;d.forEach(g=>{l.add(g.XX_ORD1__Item__c)}),p.forEach(g=>{g.disabled=l.has(g.XX_ORD1__Item__c)}),y.value=p||[],r.value=!1}),(d,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",J0,[e.createElementVNode("div",Y0,[e.createVNode(we,{icon:"arrow",symbol:"",size:12,onClick:p[0]||(p[0]=l=>e.unref(i).savedScreen=!1)}),e.createElementVNode("h2",ed,e.toDisplayString(n.value.itemName),1)]),e.unref(i).loading.save?(e.openBlock(),e.createElementBlock("div",td,[e.createVNode(xa,{svg:""}),nd])):(e.openBlock(),e.createElementBlock("div",rd,[e.createVNode(we,{icon:"check",color:"#136E05",size:14,"data-test-id":"item-tabs-before-button-icon"}),od]))]),r.value?(e.openBlock(),e.createBlock(ga,{key:0,type:"recommendations",rows:4})):y.value.length>0?(e.openBlock(),e.createElementBlock("div",ad,[id,e.createElementVNode("div",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,g)=>(e.openBlock(),e.createElementBlock("div",{key:l.Id||g,class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":`configurator-recommend-card-${l.Id||g}`},[e.createElementVNode("div",cd,[e.createElementVNode("h4",dd,e.toDisplayString(l.Name),1),e.createElementVNode("p",ud,e.toDisplayString(l.Description),1)]),e.createElementVNode("div",fd,[e.createElementVNode("div",hd,e.toDisplayString(e.unref(Ge)(l.Price)),1),e.createVNode(Je,{btype:l.disabled?"secondary":"primary","button-style":l.disabled?"normal":"outlined",size:"medium",class:e.normalizeClass({"ect-w-[120px]":l.loading}),loading:l.loading,disabled:l.disabled||l.loading,"data-test-id":`configurator-recommend-button-add-${l.Id||g}`,onClick:m=>x(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.loading?"":l.disabled?"Added to Quote":"Add to Quote"),1)]),_:2},1032,["btype","button-style","class","loading","disabled","data-test-id","onClick"])])],8,sd))),128))])])):(e.openBlock(),e.createElementBlock("div",pd,[md,e.createElementVNode("div",gd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,g)=>(e.openBlock(),e.createElementBlock("div",{key:l.title||g,class:"ect-bg-white ect-border ect-border-[#DEDEDE] ect-rounded-xl ect-p-4 md:ect-p-5 lg:ect-p-6 ect-flex ect-flex-col ect-items-center ect-gap-4 md:ect-gap-6 lg:ect-gap-8 ect-cursor-pointer ect-transition-all ect-duration-200 hover:ect-shadow-md hover:ect-border-gray-400","data-test-id":`configurator-recommend-redirect-card-${g}`,onClick:m=>s(l)},[e.createElementVNode("div",xd,[e.createVNode(we,{icon:l.icon,size:20,color:"#000000","data-test-id":`configurator-recommend-redirect-icon-${g}`},null,8,["icon","data-test-id"])]),e.createElementVNode("div",vd,[e.createElementVNode("h4",{class:"ect-text-sm ect-font-semibold ect-text-[#5F5F5F] ect-text-center ect-leading-[1.43]","data-test-id":`configurator-recommend-redirect-title-${g}`},e.toDisplayString(l.title),9,_d),e.createElementVNode("p",{class:"ect-text-sm ect-font-normal ect-text-[#828282] ect-text-center ect-leading-[1.71]","data-test-id":`configurator-recommend-redirect-description-${g}`},e.toDisplayString(l.description),9,bd)])],8,yd))),128))])])),f.value?(e.openBlock(),e.createBlock(ya,{key:3,title:"Configuere next AI suggested product","configuered-product":f.value,"count-configued-product-string":o.value,onConfigureNextProduct:a},null,8,["configuered-product","count-configued-product-string"])):(e.openBlock(),e.createBlock(ya,{key:4,title:`Configuere next product from your quote ${o.value}`,"configuered-product":u.value,"count-configued-product-string":o.value,onConfigureNextProduct:h},null,8,["title","configuered-product","count-configued-product-string"]))],64))}},Ed=["data-test-id"],kd=ye({__name:"AppPill",props:{variant:{type:String,default:"",validator:t=>["success","error",""].includes(t)},dataTestId:{type:String,default:""}},setup(t){return(i,n)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["ect-pill",{"ect-pill-success":t.variant==="success","ect-pill-error":t.variant==="error","ect-pill-default":!t.variant}]),"data-test-id":t.dataTestId},[e.renderSlot(i.$slots,"default",{},void 0,!0)],10,Ed))}},[["__scopeId","data-v-c7f05fa0"]]),wd=["data-test-id"],Nd=["data-test-id"],Bd=["data-test-id","onClick"],Ad=["data-test-id"],Sd=ye({__name:"AppTabsV2",props:{showTabs:{type:Boolean,default:!0},modelValue:{type:String,default:""},border:{type:Boolean,default:!1},tabs:{type:Array,required:!0,validator:t=>t.every(i=>typeof i=="object"&&i.title&&i.key&&(i.sections===void 0||Array.isArray(i.sections)))},dataTestId:{type:String,required:!0}},emits:["update:modelValue","tab-change"],setup(t,{emit:i}){const n=t,r=i,o=e.computed(()=>{var u;return n.modelValue||((u=n.tabs[0])==null?void 0:u.key)||""}),c=u=>{r("update:modelValue",u),r("tab-change",u)};return(u,y)=>(e.openBlock(),e.createElementBlock("div",{class:"ect-page-tabs","data-test-id":t.dataTestId},[t.showTabs?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ect-page-tabs-header",[{"ect-tab-border":t.border}]]),"data-test-id":`${t.dataTestId}-header`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,x=>(e.openBlock(),e.createElementBlock("button",{key:x.key,class:e.normalizeClass(["ect-page-tab-button",`ect-page-tab-button${o.value===x.key?"-active":""} ${x.tabClass||""}`]),"data-test-id":`${t.dataTestId}-tab-${x.key}`,onClick:f=>c(x.key)},[e.createTextVNode(e.toDisplayString(x.title)+" ",1),x.pill!==void 0&&x.pill!==null?(e.openBlock(),e.createBlock(kd,{key:0,class:"ect-ml-2",variant:x.pillStyle,"data-test-id":`${t.dataTestId}-tab-${x.key}-pill`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.pill),1)]),_:2},1032,["variant","data-test-id"])):e.createCommentVNode("",!0)],10,Bd))),128))],10,Nd)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"ect-page-tab-content","data-test-id":`${t.dataTestId}-content`},null,8,Ad)],8,wd))}},[["__scopeId","data-v-f22cb1ed"]]),Od=["data-test-id"],Id=["disabled","data-test-id"],Td=["value","disabled","data-test-id"],Vd=["disabled","data-test-id"],Qn={__name:"CounterButton",props:{value:{type:Number,required:!0,default:null},min:{type:Number,default:1},max:{type:Number,default:999},empty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:value","change"],setup(t,{emit:i}){const n=t,r=i,o=e.computed(()=>n.min==null?0:n.min),c=e.computed(()=>n.max==null?999:n.max),u=(v,C,A)=>Math.min(Math.max(v,C),A),y=v=>{if(v==null||v==="")return NaN;const C=Number(v);return Number.isFinite(C)?C:NaN},x=e.ref(null),f=e.ref(n.value??o.value),s=v=>{f.value=u(v,o.value,c.value)};n.value!==null&&s(n.value);const _=e.computed(()=>f.value),a=e.computed(()=>x.value!=null?x.value:String(_.value)),h=e.computed(()=>n.disabled||_.value<=o.value),d=e.computed(()=>n.disabled||_.value>=c.value);function p(v){v!==n.value&&(f.value=v,r("update:value",v),r("change",v))}function l(){if(h.value)return;const v=u(_.value-1,o.value,c.value);x.value=null,p(v)}function g(){if(d.value)return;const v=u(_.value+1,o.value,c.value);x.value=null,p(v)}function m(v){const A=String(v.target.value??"").replace(/\D+/g,"");x.value=A}function b(){const v=y(x.value),C=o.value,A=u(Number.isNaN(v)?C:v,o.value,c.value);x.value=null,p(A)}return(v,C)=>(e.openBlock(),e.createElementBlock("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":t.dataTestId},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":h.value,"ect-cursor-not-allowed":h.value}]),disabled:h.value,"data-test-id":`${t.dataTestId}-decrement`,onClick:l}," - ",10,Id),e.createElementVNode("input",{type:"text",inputmode:"numeric",pattern:"[0-9]*",value:t.empty?"":a.value,disabled:t.disabled,class:"ect-h-7 ect-w-[48px] ect-px-2 ect-border ect-border-gray ect-rounded-md ect-text-center ect-text-sm ect-font-medium ect-text-gray-900 focus:ect-outline-none focus:ect-border-gray-400 ect-bg-white","data-test-id":`${t.dataTestId}-input`,onInput:m,onBlur:b},null,40,Td),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":d.value,"ect-cursor-not-allowed":d.value}]),disabled:d.value,"data-test-id":`${t.dataTestId}-increment`,onClick:g}," + ",10,Vd)],8,Od))}},Dd={class:"ect-flex ect-justify-end ect-items-center ect-gap-2.5 ect-px-6 ect-py-4 ect-bg-white ect-border-t ect-border-gray-300 ect-shadow-[0_-2px_4px_0px_rgba(0,0,0,0.11)]","data-test-id":"configurator-footer"},Ld={"data-test-id":"configurator-footer-quantity"},Rd={class:"ect-flex ect-justify-end ect-items-center ect-gap-6 ect-px-8 ect-py-0 ect-flex-1","data-test-id":"configurator-footer-prices"},Fd=["data-test-id"],Pd=["data-test-id"],Md=["data-test-id"],qd=["data-test-id"],$d={__name:"ConfiguratorFooter",props:{item:{type:Object,required:!0,default:()=>{}},disabled:{type:Boolean,default:!1},btnText:{type:String,default:"Save"}},emits:["update:qty","continue"],setup(t,{emit:i}){const n=ct(),r=t,o=e.ref(r.item),c=e.computed(()=>{const x=n.summaryPrices,f=[];return n.isRecurringPricingSchema?(f.push({label:"One Time Price",value:x.oneTimePrice,highlight:!1}),f.push({label:n.showYearlyPricing?"Yearly Price":"Monthly Price",value:x.recurringPrice,highlight:!1})):(f.push({label:"Base Price",value:x.basePrice,highlight:!1}),f.push({label:"Add Ons",value:x.addOns,highlight:!1}),f.push({label:"Total Price",value:x.total,highlight:!1})),f}),u=i,y=()=>{r.disabled||u("continue")};return(x,f)=>(e.openBlock(),e.createElementBlock("footer",Dd,[e.createElementVNode("div",Ld,[e.createVNode(Qn,{value:o.value.qty,"onUpdate:value":f[0]||(f[0]=s=>o.value.qty=s),min:1,max:999,disabled:t.disabled,"is-selected":!0,"data-test-id":"configurator-footer-counter-button"},null,8,["value","disabled"])]),e.createElementVNode("div",Rd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(s,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:_},[e.createElementVNode("div",{class:"ect-flex ect-flex-col ect-justify-center","data-test-id":`configurator-footer-price-${_}`},[e.createElementVNode("span",{class:"ect-text-xs ect-font-normal ect-text-gray-500 ect-text-left","data-test-id":`configurator-footer-price-label-${_}`},e.toDisplayString(s.label),9,Pd),e.createElementVNode("span",{class:e.normalizeClass(["ect-text-left",s.highlight?"ect-text-lg ect-font-bold ect-text-green-700":"ect-text-sm ect-font-medium ect-text-gray-800 "]),"data-test-id":`configurator-footer-price-value-${_}`},e.toDisplayString(e.unref(Ge)(s.value)),11,Md)],8,Fd),_<c.value.length-1?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ect-w-0 ect-h-5 ect-border-l ect-border-gray-400","data-test-id":`configurator-footer-divider-${_}`},null,8,qd)):e.createCommentVNode("",!0)],64))),128))]),e.createVNode(Je,{class:"ect-min-w-[100px]",btype:t.disabled?"secondary":"primary",disabled:t.disabled,"button-style":"primary",size:"medium","data-test-id":"configurator-footer-button-continue",onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.btnText),1)]),_:1},8,["btype","disabled"])]))}},jd={class:"ect-w-full ect-bg-white ect-mb-4","data-test-id":"configurator-type-section"},Hd={class:"ect-sticky ect-top-0 ect-z-30 ect-bg-white ect-shadow-sm ect-p-3 ect-px-4 ect-border-b ect-border-gray-200 ect-flex ect-justify-between ect-items-center","data-test-id":"configurator-type-header-sticky"},Ud={class:"ect-flex ect-flex-col"},zd={class:"ect-font-bold ect-text-text-success ect-leading-tight"},Xd=["innerHTML"],Kd={key:0,class:"ect-flex ect-items-center ect-gap-2 ect-px-2 ect-py-1","data-test-id":"configurator-type-message"},Qd={class:"ect-text-xs ect-font-medium ect-text-gray-600 ect-leading-tight ect-min-w-[190px]"},Zd={class:"ect-divide-y ect-divide-gray-100 ect-overflow-y-auto"},Gd={__name:"ConfiguratorType",props:{title:{type:String,required:!0},description:{type:String,default:""},message:{type:String,default:""}},setup(t){return(i,n)=>(e.openBlock(),e.createElementBlock("section",jd,[e.createElementVNode("header",Hd,[e.createElementVNode("div",Ud,[e.createElementVNode("h2",zd,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"ect-mt-1 ect-text-xs ect-text-gray-500 ect-leading-tight",innerHTML:t.description},null,8,Xd)):e.createCommentVNode("",!0)]),t.message?(e.openBlock(),e.createElementBlock("div",Kd,[e.createVNode(we,{icon:"info",symbol:"",color:"#198708",size:14,"data-test-id":"configurator-type-message-icon"}),e.createElementVNode("span",Qd,e.toDisplayString(t.message),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zd,[e.renderSlot(i.$slots,"default")])]))}},Wd={__name:"ShadowDisplay",props:{content:{type:String,required:!0}},setup(t){const i=t,n=e.ref(null);let r=null;return e.onMounted(()=>{n.value&&!r&&(r=n.value.attachShadow({mode:"open"}),r.innerHTML=i.content)}),e.watch(()=>i.content,o=>{r&&(r.innerHTML=o)}),(o,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"host",ref:n},null,512))}},Jd=["data-test-id"],Yd=["data-test-id"],e1=["data-test-id"],t1=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("g",{id:"Group"},[e.createElementVNode("path",{id:"Vector",d:"M7 1.3125V12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{id:"Vector_2",d:"M1.3125 7H12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)],n1=["data-test-id"],r1=["data-test-id"],o1=["data-test-id"],a1=["data-test-id"],i1=["data-test-id"],l1=["data-test-id","innerHTML"],dt={__name:"Tag",props:{label:{type:String,default:""},value:{type:String,default:""},addButton:{type:Boolean,default:!1},editButton:{type:Boolean,default:!1},dataTestId:{type:String,default:""}},setup(t){const i=t,n=e.computed(()=>{const r=i.value;if(typeof r!="string")return!1;const o=new DOMParser().parseFromString(r,"text/html");return Array.from(o.body.childNodes).some(c=>c.nodeType===1)});return(r,o)=>t.addButton?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ect-bg-orange-4 ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-orange-secondary","data-test-id":t.dataTestId},[e.createElementVNode("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-orange-secondary ect-flex ect-items-center ect-gap-1","data-test-id":`${t.dataTestId}-content`},[e.createElementVNode("div",{"data-test-id":`${t.dataTestId}-add-icon`},t1,8,e1),e.createTextVNode(" "+e.toDisplayString(t.label),1)],8,Yd)],8,Jd)):t.editButton?(e.openBlock(),e.createElementBlock("div",{key:1,class:"ect-bg-white ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-success","data-test-id":t.dataTestId},[e.createElementVNode("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-success ect-flex ect-items-center ect-gap-1","data-test-id":`${t.dataTestId}-content`},e.toDisplayString(t.label),9,r1)],8,n1)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"ect-bg-white ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-rounded-md ect-border ect-border-solid ect-border-neutral-200","data-test-id":t.dataTestId},[e.createElementVNode("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${t.dataTestId}-label`},e.toDisplayString(t.label),9,a1),t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${t.dataTestId}-separator`}," : ",8,i1)):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(Wd,{key:1,content:t.value},null,8,["content"])):t.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-neutral-700","data-test-id":`${t.dataTestId}-value`,innerHTML:t.value},null,8,l1)):e.createCommentVNode("",!0)],8,o1))}},s1=["data-test-id"],c1=["data-test-id"],d1=["data-test-id"],u1=["type","step","min","data-test-id"],Vr=ye({__name:"InputEdit",props:{modelValue:{type:[String,Number],required:!0},type:{type:String,default:"string",validator:t=>["string","number","currency"].includes(t)},tag:{type:String,default:"span"},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","change"],setup(t,{expose:i,emit:n}){const r=t,o=n,c=e.ref(!1),u=e.ref(!1),y=e.ref(""),x=e.ref(null),f=e.computed(()=>r.type==="currency"?g(r.modelValue):r.type==="number"?m(r.modelValue):r.modelValue),s=e.computed(()=>r.type==="string"?"text":"number"),_=e.computed(()=>r.type==="currency"?"0.01":void 0),a=e.computed(()=>r.type==="currency"?"0":void 0),h=()=>{r.disabled||(r.type==="currency"?y.value=parseFloat(r.modelValue)||"0.00":r.type==="number"?y.value=parseFloat(r.modelValue)||"0":y.value=r.modelValue,c.value=!0,e.nextTick(()=>{x.value&&(x.value.focus(),x.value.select())}))},d=()=>{let b=y.value;if(r.type==="number"||r.type==="currency"){const v=parseFloat(y.value);isNaN(v)?b=r.modelValue:b=r.type==="currency"?v.toFixed(2):v.toString()}b!==r.modelValue&&(o("update:modelValue",b),o("change",b)),c.value=!1},p=()=>{y.value=r.modelValue,c.value=!1},l=()=>{c.value&&d()},g=b=>!b||isNaN(b)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(parseFloat(b)),m=b=>!b||isNaN(b)?"0":new Intl.NumberFormat("en-US").format(parseFloat(b));return e.watch(()=>r.modelValue,b=>{c.value||(y.value=b)}),i({startEditing:h,saveChanges:d,cancelEditing:p}),(b,v)=>{const C=e.resolveDirective("click-outside");return e.openBlock(),e.createElementBlock("div",{class:"ect-relative ect-inline-block ect-min-w-[60px] ect-h-[30px]","data-test-id":t.dataTestId,onMouseenter:v[1]||(v[1]=A=>u.value=!0),onMouseleave:v[2]||(v[2]=A=>u.value=!1)},[c.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:1,class:"ect-w-full ect-h-full","data-test-id":`${t.dataTestId}-input-wrapper`},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:x,"onUpdate:modelValue":v[0]||(v[0]=A=>y.value=A),type:s.value,step:_.value,min:a.value,class:e.normalizeClass(["ect-w-full ect-h-full ect-px-3 ect-bg-white ect-border ect-border-green-500 ect-rounded-sm ect-text-gray-700 ect-text-base ect-font-sans ect-outline-none ect-duration-200",b.$attrs.class]),"data-test-id":`${t.dataTestId}-input`,onKeyup:[e.withKeys(d,["enter"]),e.withKeys(p,["esc"])],onBlur:d},null,42,u1),[[e.vModelDynamic,y.value]])],8,d1)),[[C,l]]):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ect-flex ect-items-center ect-gap-2 ect-rounded ect-transition-colors ect-duration-200",{"ect-cursor-pointer":!t.disabled}]),"data-test-id":`${t.dataTestId}-display`,onClick:h},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps(b.$attrs,{class:"ect-m-0 ect-text-inherit","data-test-id":`${t.dataTestId}-text`}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value)+" ",1),e.createVNode(we,{class:e.normalizeClass(u.value&&!t.disabled?"ect-visible":"ect-invisible"),icon:"edit",size:"12",color:"#828282","data-test-id":`${t.dataTestId}-edit-icon`},null,8,["class","data-test-id"])]),_:1},16,["data-test-id"]))],10,c1))],40,s1)}}},[["__scopeId","data-v-5cd60070"]]),di=t=>(e.pushScopeId("data-v-b9675cf1"),t=t(),e.popScopeId(),t),f1=["data-test-id","data-publish-key"],h1={key:0,class:"ect-text-xs ect-text-gray-500 ect-text-white ect-font-medium ect-leading-tight ect-absolute ect-top-[-.7rem] ect-left-[-1rem] ect-bg-text-success ect-rounded-xl ect-px-2 ect-py-1"},p1={key:1,class:"ect-flex ect-items-start ect-gap-4 ect-p-3 ect-px-4"},m1={key:0,class:"ect-w-16 ect-h-16 ect-flex ect-items-center ect-justify-center ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0"},g1=["src","alt"],y1={class:"ect-flex-1 ect-min-w-0"},x1={class:"ect-flex ect-gap-4 ect-items-center ect-justify-between"},v1={class:"ect-flex ect-flex-row ect-gap-3"},_1=di(()=>e.createElementVNode("div",{class:"ect-w-px ect-h-auto ect-bg-gray-200 ect-mx-2"},null,-1)),b1={class:"ect-flex ect-flex-col ect-max-w-[125px]"},C1={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},E1=["innerHTML"],k1={key:0,class:"ect-flex ect-flex-wrap ect-gap-2.5 ect-mt-2"},w1=["data-test-id"],N1=["data-test-id"],B1={key:1,class:"ect-inline-block ect-mb-2"},A1={key:2,class:"ect-flex ect-flex-col ect-gap-3 ect-p-3 ect-h-full ect-justify-between"},S1={class:"ect-flex ect-items-start ect-gap-2"},O1={key:0,class:"ect-w-16 ect-h-16 ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0 ect-overflow-hidden"},I1=["src","alt"],T1={class:"ect-flex-1 ect-min-w-0"},V1={class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},D1=["innerHTML"],L1={class:"temp-hidden"},R1={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},F1={key:0,class:"ect-flex ect-flex-wrap ect-gap-1.5"},P1=["data-test-id"],M1=["data-test-id"],q1={key:1,class:"ect-inline-block ect-mb-2"},$1={class:"ect-flex ect-justify-between ect-items-center"},j1={class:"ect-flex ect-flex-col"},H1=di(()=>e.createElementVNode("p",{class:"ect-text-xs ect-text-gray-500 ect-font-medium ect-leading-tight"},"Price",-1)),U1={key:3,"data-test-id":"configurator-item-slot-details",class:"ect-bg-white ect-rounded-md"},z1=ye({__name:"ConfiguratorItem",props:{item:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},imageUrl:{type:String,default:""},price:{type:Number,required:!0},quantity:{type:Number,default:1},selected:{type:Boolean,default:!1},tags:{type:Array,default:()=>[]},attributes:{type:Array,default:()=>[]},size:{type:Number,default:1},minQuantity:{type:Number,default:null},maxQuantity:{type:Number,default:null},showImage:{type:Boolean,default:!1},option:{type:Object,default:null},isAttributes:{type:Boolean,default:!1},showAttributes:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:quantity","update:name","edit-attributes"],setup(t,{emit:i}){const n=t,r=i,o=e.ref(null),c=e.ref(0),u=e.ref(n.item),y=e.computed(()=>u.value.relationshipInfo.relationship==="Kit"?"ect-bg-green-3 ect-border-gray-200 ect-border-success":n.disabled?"ect-bg-light-bg-x ect-border-gray-200":n.selected?"ect-bg-green-3 ect-border-gray-200 ect-border-success":"ect-bg-white ect-border-gray-200 hover:ect-border-success"),x=e.computed({get:()=>n.quantity,set:d=>r("update:quantity",d)}),f=e.computed({get:()=>n.name,set:d=>r("update:name",d)}),s=d=>{r("update:quantity",d)},_=e.computed(()=>{if(c.value===0)return n.tags;const p=Math.floor(c.value/120);return n.tags.slice(0,Math.max(1,p))}),a=e.computed(()=>Math.max(0,n.tags.length-_.value.length)),h=()=>{if(o.value){const d=o.value,p=80,l=120,g=32,m=64;c.value=d.offsetWidth-p-l-g-m}};return e.onMounted(()=>{e.nextTick(()=>{h()})}),e.watch(()=>n.tags,()=>{e.nextTick(()=>{h()})},{deep:!0}),e.onMounted(()=>{window.addEventListener("resize",h)}),(d,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:o,class:e.normalizeClass(["ect-w-full ect-rounded-md ect-border-1 ect-transition-colors ect-relative",y.value]),"data-test-id":`configurator-item-${t.item.itemId}`,"data-publish-key":t.item.publishKey},[t.item.relationshipInfo.relationship==="Kit"?(e.openBlock(),e.createElementBlock("div",h1," KIT ")):e.createCommentVNode("",!0),t.size===1?(e.openBlock(),e.createElementBlock("div",p1,[t.showImage?(e.openBlock(),e.createElementBlock("div",m1,[t.imageUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.imageUrl,alt:f.value,class:"ect-w-full ect-h-full ect-object-cover"},null,8,g1)):(e.openBlock(),e.createBlock(we,{key:1,disabled:"",icon:"image",symbol:"",size:20,color:"#ACACAC"}))])):e.createCommentVNode("",!0),e.createElementVNode("div",y1,[e.createElementVNode("div",x1,[e.createVNode(Vr,{modelValue:f.value,"onUpdate:modelValue":p[0]||(p[0]=l=>f.value=l),tag:"h3","data-test-id":"itemId"+t.item.itemId,class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},null,8,["modelValue","data-test-id"]),e.createElementVNode("div",v1,[e.createElementVNode("div",{onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Qn,{value:x.value,"onUpdate:value":p[1]||(p[1]=l=>x.value=l),min:t.minQuantity,max:t.maxQuantity,"data-test-id":`configurator-item-counter-${t.item.itemId}`,onChange:s},null,8,["value","min","max","data-test-id"])]),_1,e.createElementVNode("div",b1,[e.createVNode(Vr,{modelValue:u.value.price,"onUpdate:modelValue":p[3]||(p[3]=l=>u.value.price=l),tag:"p",type:"currency","data-test-id":"itemId"+t.item.itemId,class:"ect-text-base ect-font-bold"},null,8,["modelValue","data-test-id"])]),e.createElementVNode("div",C1,[e.renderSlot(d.$slots,"selection-control",{},void 0,!0)])])]),e.createElementVNode("p",{class:"ect-mt-2 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:t.description},null,8,E1),t.isAttributes&&t.showAttributes&&t.selected?(e.openBlock(),e.createElementBlock("div",k1,[u.value.getTags().length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(l,g)=>(e.openBlock(),e.createElementBlock("span",{key:g,class:"ect-inline-block"},[e.createVNode(dt,{label:l.label,value:l.value},null,8,["label","value"])]))),128)),a.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${t.item.itemId}`,onClick:p[4]||(p[4]=e.withModifiers(()=>{},["stop"]))}," +"+e.toDisplayString(a.value)+" more ",9,w1)):e.createCommentVNode("",!0),t.selected?(e.openBlock(),e.createElementBlock("button",{key:1,"data-test-id":`configurator-item-button-edit-attributes-${t.item.itemId}`,onClick:p[5]||(p[5]=l=>r("edit-attributes"))},[e.createVNode(dt,{label:"Edit attributes","edit-button":""})],8,N1)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("span",B1,[e.createElementVNode("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:p[6]||(p[6]=l=>r("edit-attributes"))},[e.createVNode(dt,{label:"Add attributes","add-button":""})])]))])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",A1,[e.createElementVNode("div",S1,[t.showImage?(e.openBlock(),e.createElementBlock("div",O1,[t.imageUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.imageUrl,alt:t.name,class:"ect-w-full ect-h-full ect-object-cover"},null,8,I1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",T1,[e.createElementVNode("h3",V1,e.toDisplayString(t.name),1),e.createElementVNode("p",{class:"ect-mt-1 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:t.description},null,8,D1),e.createElementVNode("p",L1,e.toDisplayString(t.item.publishKey)+" :: "+e.toDisplayString(t.item.calculateRules),1)]),e.createElementVNode("div",R1,[e.renderSlot(d.$slots,"selection-control",{},void 0,!0)])]),t.isAttributes&&t.showAttributes&&t.selected?(e.openBlock(),e.createElementBlock("div",F1,[u.value.getTags().length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(l,g)=>(e.openBlock(),e.createElementBlock("span",{key:g,class:"ect-inline-block"},[e.createVNode(dt,{label:l.label,value:l.value},null,8,["label","value"])]))),128)),a.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${t.item.itemId}`,onClick:p[7]||(p[7]=e.withModifiers(()=>{},["stop"]))}," +"+e.toDisplayString(a.value)+" more ",9,P1)):e.createCommentVNode("",!0),t.selected?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ect-ml-auto","data-test-id":`configurator-item-button-edit-attributes-${t.item.itemId}`,onClick:p[8]||(p[8]=l=>r("edit-attributes"))},[e.createVNode(dt,{label:"Edit attributes","edit-button":""})],8,M1)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("span",q1,[e.createElementVNode("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:p[9]||(p[9]=l=>r("edit-attributes"))},[e.createVNode(dt,{label:"Add attributes","add-button":""})])]))])):e.createCommentVNode("",!0),e.createElementVNode("div",$1,[e.createElementVNode("div",{onClick:p[11]||(p[11]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Qn,{value:x.value,"onUpdate:value":p[10]||(p[10]=l=>x.value=l),min:t.minQuantity,max:t.maxQuantity,"data-test-id":`configurator-item-counter-${t.item.itemId}`,onChange:s},null,8,["value","min","max","data-test-id"])]),e.createElementVNode("div",j1,[H1,e.createVNode(Vr,{modelValue:u.value.price,"onUpdate:modelValue":p[12]||(p[12]=l=>u.value.price=l),tag:"p",type:"currency","data-test-id":"itemId"+t.item.itemId,class:"ect-w-[125px] ect-text-base ect-font-bold"},null,8,["modelValue","data-test-id"])])])])),t.selected&&t.isAttributes?(e.openBlock(),e.createElementBlock("div",U1,[e.renderSlot(d.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],10,f1))}},[["__scopeId","data-v-b9675cf1"]]),X1={"af-ZA":",","sq-AL":",","ar-DZ":",","ar-BH":"٫","ar-EG":"٫","ar-IQ":"٫","ar-JO":"٫","ar-KW":"٫","ar-LB":"٫","ar-LY":",","ar-MA":",","ar-OM":"٫","ar-QA":"٫","ar-SA":"٫","ar-SD":"٫","ar-SY":"٫","ar-TN":",","ar-AE":"٫","ar-YE":"٫","hy-AM":",","az-AZ":",","bn-BD":".","bn-IN":".","eu-ES":",","be-BY":",","bs-BA":",","bg-BG":",","my-MM":".","ca-ES":",","ca-ES-EURO":",","zh-CN":".","zh-CN-PINYIN":".","zh-CN-STROKE":".","zh-HK":".","zh-HK-STROKE":".","zh-MO":".","zh-SG":".","zh-TW":".","zh-TW-STROKE":".","hr-HR":",","cs-CZ":",","da-DK":",","nl-AW":",","nl-BE":",","nl-NL":",","nl-SR":",","dz-BT":".","en-AG":".","en-AU":".","en-BS":".","en-BB":".","en-BZ":".","en-BM":".","en-BW":".","en-CM":".","en-CA":".","en-DE":",","en-KY":".","en-ER":".","en-FK":".","en-FJ":".","en-GM":".","en-GH":".","en-GI":".","en-GY":".","en-HK":".","en-IN":".","en-ID":".","en-IE":".","en-IE-EURO":".","en-JM":".","en-KE":".","en-LR":".","en-MG":".","en-MW":".","en-MY":".","en-MU":".","en-NA":".","en-NZ":".","en-NG":".","en-PK":".","en-PG":".","en-PH":".","en-RW":".","en-WS":".","en-SC":".","en-SL":".","en-SG":".","en-SX":".","en-SB":".","en-ZA":",","en-SH":".","en-SZ":".","en-TZ":".","en-TO":".","en-TT":".","en-UG":".","en-GB":".","en-US":".","en-VU":".","et-EE":",","fi-FI":",","fi-FI-EURO":",","fr-BE":",","fr-CA":",","fr-KM":",","fr-FR":",","fr-FR-EURO":",","fr-GN":",","fr-HT":",","fr-LU":",","fr-MR":",","fr-MC":",","fr-CH":",","fr-WF":",","ka-GE":",","de-AT":",","de-AT-EURO":",","de-BE":",","de-DE":",","de-DE-EURO":",","de-LU":",","de-LU-EURO":",","de-CH":".","el-GR":",","gu-IN":".","iw-IL":".","hi-IN":".","hu-HU":",","is-IS":",","in-ID":",","ga-IE":".","it-IT":",","it-CH":".","ja-JP":".","kn-IN":".","kk-KZ":",","km-KH":",","ko-KP":".","ko-KR":".","ky-KG":",","lo-LA":",","lv-LV":",","lt-LT":",","lu-CD":",","lb-LU":",","mk-MK":",","ms-BN":",","ms-MY":".","ml-IN":".","mt-MT":".","mi-NZ":".","mr-IN":".","ne-NP":".","no-NO":",","ps-AF":"٫","fa-IR":"٫","pl-PL":",","pt-AO":",","pt-BR":",","pt-CV":",","pt-MZ":",","pt-PT":",","pt-ST":",","ro-MD":",","ro-RO":",","rm-CH":".","rn-BI":",","ru-KZ":",","ru-RU":",","sr-BA":",","sr-RS":",","sh-BA":",","sh-ME":",","sh-ME-USD":",","sh-CS":",","sk-SK":",","sl-SI":",","so-DJ":".","so-SO":".","es-AR":",","es-BO":",","es-CL":",","es-CO":",","es-CR":",","es-CU":".","es-DO":".","es-EC":",","es-SV":".","es-GT":".","es-HN":".","es-MX":".","es-NI":".","es-PA":".","es-PY":",","es-PE":".","es-PR":".","es-ES":",","es-ES-EURO":",","es-US":".","es-UY":",","es-VE":",","sw-KE":".","sv-SE":",","tl-PH":".","tg-TJ":",","ta-IN":".","ta-LK":".","te-IN":".","th-TH":".","ti-ET":".","tr-TR":",","uk-UA":",","ur-PK":".","uz-LATN-UZ":",","vi-VN":",","cy-GB":".","xh-ZA":".","yo-BJ":".","zu-ZA":"."},K1={name:"CustomInput",components:{AppIcon:we},props:{editMode:{type:Boolean,default:!0},type:{type:String,default:"text"},max:{type:Number,default:500},label:{type:String,default:""},name:{type:String,default:""},showLabel:{type:Boolean,default:!0},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},highlight:{type:Boolean,default:!1},placeholder:{type:String,default:""},error:{type:[Boolean,String],default:!1},cssClass:{type:Object,default:()=>({})},tooltip:{type:String,default:null},locale:{type:String,default:"en-US"},icon:{type:String,default:null},itooltip:{type:String,default:null},icolor:{type:String,default:"#7d7d7d"},ihover:{type:String,default:"#57c046"},icustom:{type:Boolean,default:!1},idisabled:{type:Boolean,default:!1},height:{type:Number,default:32},textAlignment:{type:String,default:"left"},decimalPrecision:{type:Number,default:0},allowNegatives:{type:Boolean,default:!1},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["update:modelValue","iclick","blur"],data(){return{initialValue:"",decimalSeprator:".",ctrl:!1}},computed:{getValue(){return this.modelValue?this.type==="currency"?String(this.modelValue).replace(".",this.decimalSeprator):String(this.modelValue):""},error_message(){return typeof this.error=="string"?this.error:this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},isHighlight(){return(this.initialValue===""||this.initialValue===null)&&(this.modelValue===""||this.modelValue===null)?!1:this.initialValue!==this.modelValue}},created(){this.initialValue=this.modelValue,this.decimalSeprator=this.type==="currency"?X1[this.locale]:"."},methods:{handlerInput(t){const i=t.target.value;this.type==="currency"?this.$emit("update:modelValue",i.replace(this.decimalSeprator,".")):this.$emit("update:modelValue",i)},preventNonNumeric(t){if(this.type==="number"){const i=this.decimalPrecision,n=t.target.value,r=t.key;if(["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(r)||this.allowNegatives&&r==="-")return;if(r==="."&&i===0){t.preventDefault();return}if(r==="."&&n.includes(".")){t.preventDefault();return}if(r==="."||n.includes(".")&&!n.endsWith(".")&&r!=="Backspace"){const o=n.split(".");if(o.length>1&&o[1].length>=i){t.preventDefault();return}}if(isNaN(r)&&![".","Backspace","Tab"].includes(r)){t.preventDefault();return}}if(t.key==="Backspace"||this.ctrl)return!0;if(t.key==="Control"&&(this.ctrl=!0),this.type==="currency"||this.type==="number"){if(!this.getValue.includes(this.decimalSeprator)&&t.key===this.decimalSeprator)return!0;/[\deE+\-]/.test(t.key)||t.preventDefault()}return!0},handlerKeyup(t){t.key==="Control"&&(this.ctrl=!1)}}},Q1=["data-test-id"],Z1=["for","data-test-id"],G1=["data-test-id"],W1=["id","type","name","disabled","placeholder","value","maxlength","readonly","data-test-id"],J1=["data-test-id"],Y1=["data-test-id"];function eu(t,i,n,r,o,c){const u=e.resolveComponent("AppIcon");return e.openBlock(),e.createElementBlock("div",{class:"input","data-test-id":n.dataTestId},[n.label&&n.showLabel?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass({error_color:!!n.error}),for:n.label,"data-test-id":`${n.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(n.label)+" ",1),n.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!n.error})},"*",2)):e.createCommentVNode("",!0)],10,Z1)):e.createCommentVNode("",!0),n.editMode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["input-wrapper ect-w-full",{errorBorder_color:!!n.error,highlight:c.isHighlight&&n.highlight}]),"data-test-id":`${n.dataTestId}-wrapper`},[n.icon?(e.openBlock(),e.createBlock(u,{key:0,class:"input-wrapper_icon",icon:n.icon,hover:n.ihover,color:n.icolor,size:19,disabled:n.idisabled,custom:n.icustom,tooltip:n.itooltip,"data-test-id":`${n.dataTestId}-icon`,direction:"top-right",onClick:i[0]||(i[0]=y=>t.$emit("iclick"))},null,8,["icon","hover","color","disabled","custom","tooltip","data-test-id"])):e.createCommentVNode("",!0),e.createElementVNode("input",{id:n.label,class:e.normalizeClass(`ectheme-input-box ${n.size}`),type:n.type,style:e.normalizeStyle({width:n.icon?"calc(100% - 36px)":"100%",height:`${n.height}px`,textAlign:n.textAlignment}),name:n.name,disabled:n.disabled,placeholder:n.placeholder,value:c.getValue,maxlength:n.max,readonly:n.isReadOnly,"data-test-id":`${n.dataTestId}-input`,onInput:i[1]||(i[1]=(...y)=>c.handlerInput&&c.handlerInput(...y)),onKeydown:i[2]||(i[2]=(...y)=>c.preventNonNumeric&&c.preventNonNumeric(...y)),onKeyup:i[3]||(i[3]=(...y)=>c.handlerKeyup&&c.handlerKeyup(...y)),onBlur:i[4]||(i[4]=y=>t.$emit("blur"))},null,46,W1)],10,G1)):e.createCommentVNode("",!0),n.editMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",{key:2,class:"value","data-test-id":`${n.dataTestId}-value`},e.toDisplayString(c.getValue),9,J1)),c.error_message?(e.openBlock(),e.createElementBlock("div",{key:3,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},e.toDisplayString(c.error_message),9,Y1)):e.createCommentVNode("",!0)],8,Q1)}const tu=ye(K1,[["render",eu],["__scopeId","data-v-032ca141"]]),nu={name:"AtomSpinner",props:{dataTestId:{type:String,default:""}}},ru=["data-test-id"];function ou(t,i,n,r,o,c){return e.openBlock(),e.createElementBlock("div",{class:"spinner","data-test-id":n.dataTestId},null,8,ru)}const au={name:"CustomDropdown",components:{AppIcon:we,AtomSpinner:ye(nu,[["render",ou],["__scopeId","data-v-771ed032"]])},props:{label:{type:String,default:""},placeholder:{type:String,default:""},options:{type:Array,default:()=>[]},display:{type:Array,default:()=>[]},modelValue:{type:String,default:""},error:{type:[Boolean,String],default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},select:{type:Boolean,default:!1},lookup:{type:Boolean,default:!1},search:{type:Boolean,default:!1},badge:{type:String,default:void 0},highlight:{type:Boolean,default:!1},property:{type:Object,default:()=>({key:"value",value:"label",assigned:"assigned"})},dropdownTheme:{type:String,default:"light"},icon:{type:String,default:""},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["search","focus-in","focus-out","update:modelValue"],data:()=>({inputFocused:!1,value:"",isHover:!1,highlightedIndex:-1,initialValue:"",teleportStyle:{position:"absolute",top:"0px",left:"0px",width:"0px"}}),computed:{isHighlight(){return(this.initialValue===""||this.initialValue==null)&&(this.modelValue===""||this.modelValue==null)?!1:this.initialValue!==this.modelValue},error_message(){return this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},getOptions(){if(this.select&&this.search){const t=this.value.toLowerCase();return this.options.filter(i=>JSON.stringify(i).toLowerCase().includes(t))}else return this.options},getSelected(){let t=null;if(this.modelValue)t=this.options.find(i=>i[this.property.key]===this.modelValue);else if(!this.search){const i=this.options.find(n=>n[this.property.key]==="");i?t=i:this.placeholder?t={[this.property.value]:this.placeholder,[this.property.key]:""}:t={[this.property.value]:"--Select--",[this.property.key]:""}}return t||{[this.property.value]:this.placeholder||"--Select--",[this.property.key]:""}},shouldShowAbove(){if(!this.$refs.triggerElement)return!1;const t=this.$refs.triggerElement.getBoundingClientRect(),i=250,n=window.innerHeight-t.bottom,r=t.top;return n<i&&r>i},dropdownStyle(){if(!this.$refs.triggerElement)return{};const t=this.$refs.triggerElement.getBoundingClientRect(),i=250,n=window.innerHeight-t.bottom,r=t.top,o=n<i&&r>i;return{position:"absolute",top:o?"auto":"100%",bottom:o?"100%":"auto",left:"0",width:"100%",zIndex:1e3}}},created(){this.initialValue=this.modelValue},mounted(){window.addEventListener("resize",this.updateDropdownPosition),window.addEventListener("scroll",this.updateDropdownPosition,!0)},beforeUnmount(){window.removeEventListener("resize",this.updateDropdownPosition),window.removeEventListener("scroll",this.updateDropdownPosition,!0)},methods:{updateDropdownPosition(){if(!this.$refs.triggerElement)return;const t=this.$refs.triggerElement.getBoundingClientRect(),i=200,n=window.innerHeight-t.bottom,r=t.top,o=n<i&&r>i;this.teleportStyle={position:"absolute",top:`${o?t.top-i:t.bottom}px`,left:`${t.left}px`,width:`${t.width}px`,zIndex:9999}},subFieldsText(t){if(!this.display||this.display.length<1)return"";const i=[];return this.display.forEach(n=>{const r=this.subField(t,n);r&&i.push(r)}),i.join(" | ")},subField(t,i){return i?i.split(".").reduce((o,c)=>o[c]||"",t):t},lookupSearchHandler:Vt(function(t){this.value=t,this.search&&!this.select&&this.$emit("search",t)}),handlerFocusIn(){!(this.modelValue&&this.search)&&!this.disabled&&(this.inputFocused=!0,this.updateDropdownPosition(),this.$emit("focus-in"))},updateSelected(t){t&&(this.value="",this.$emit("update:modelValue",t[this.property.key]),this.search&&!this.select&&!this.lookup&&this.$emit("search",""),this.onInputFocusedOut(!0))},clear(){this.disabled||(this.value="",this.$emit("update:modelValue",null),this.search&&!this.select&&!this.lookup&&this.$emit("search",""))},onInputFocusedOut(t=!1){(!this.isHover||t)&&!this.disabled&&(t?(this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")):setTimeout(()=>{this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")},100))},highlightNextOption(){this.highlightedIndex<this.options.length-1&&this.highlightedIndex++},highlightPreviousOption(){this.highlightedIndex>0&&this.highlightedIndex--}}},iu=["data-test-id"],lu=["for","data-test-id"],su={class:"input-container-box ect-grow ect-w-full"},cu=["data-test-id"],du=["placeholder","disabled","data-test-id"],uu=["data-test-id"],fu=["title","data-test-id"],hu=["data-test-id"],pu=["data-test-id"],mu=["data-test-id"],gu=["data-test-id"],yu=["data-test-id","onClick"],xu=["data-test-id"],vu={class:"ect-text-font-clr-light ect-flex ect-gap-2 ect-items-center ect-justify-between ect-w-full"},_u=["data-test-id"],bu=["data-test-id"],Cu=["data-test-id"],Eu=["title","data-test-id"],ku=["data-test-id"];function wu(t,i,n,r,o,c){const u=e.resolveComponent("AppIcon"),y=e.resolveComponent("AtomSpinner");return e.openBlock(),e.createElementBlock("div",{ref:"dropdownWrapper",class:e.normalizeClass(["customdropdown input-container",{dark:n.dropdownTheme==="dark"}]),"data-test-id":n.dataTestId,onMouseenter:i[7]||(i[7]=x=>t.isHover=!0),onMouseleave:i[8]||(i[8]=x=>t.isHover=!1)},[n.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(["title_label",{error_color:!!n.error}]),for:n.label,"data-test-id":`${n.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(n.label)+" ",1),n.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!n.error})},"*",2)):e.createCommentVNode("",!0)],10,lu)):e.createCommentVNode("",!0),e.createElementVNode("div",su,[e.createElementVNode("div",{ref:"triggerElement",class:e.normalizeClass(["input-wrapper ectheme-input-box ect-w-full",{disabled:n.disabled,"input-error":n.error,highlight:c.isHighlight&&n.highlight,"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-trigger`,tabindex:"0",onFocusin:i[2]||(i[2]=(...x)=>c.handlerFocusIn&&c.handlerFocusIn(...x)),onFocusout:i[3]||(i[3]=x=>c.onInputFocusedOut(!1)),onKeydown:[i[4]||(i[4]=e.withKeys(x=>c.updateSelected(n.options[t.highlightedIndex]),["enter"])),i[5]||(i[5]=e.withKeys(e.withModifiers((...x)=>c.highlightPreviousOption&&c.highlightPreviousOption(...x),["prevent"]),["up"])),i[6]||(i[6]=e.withKeys(e.withModifiers((...x)=>c.highlightNextOption&&c.highlightNextOption(...x),["prevent"]),["down"]))]},[!n.modelValue&&n.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref:"searchInput","onUpdate:modelValue":i[0]||(i[0]=x=>t.value=x),type:"text",name:"search",placeholder:n.placeholder,autocomplete:"off",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-input`,onInput:i[1]||(i[1]=e.withModifiers(x=>c.lookupSearchHandler(x.target.value),["prevent"]))},null,40,du)),[[e.vModelText,t.value]]):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["selection-name ect-text-text-primary-dark ect-flex ect-justify-between ect-items-center",{"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-selection`},[c.getSelected?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{title:c.getSelected[n.property.value],class:e.normalizeClass(["ect-flex ect-items-center ect-gap-2 ect-font-medium",{"ect-text-font-clr-light":!n.modelValue}]),"data-test-id":`${n.dataTestId}-selection-value`},[n.icon?(e.openBlock(),e.createBlock(u,{key:0,class:"ect-mr-0",icon:n.icon,size:14,color:"#5F5F5F","data-test-id":`${n.dataTestId}-selection-icon`},null,8,["icon","data-test-id"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(c.getSelected[n.property.value]),1)],10,fu),n.badge&&c.getSelected[n.badge]?(e.openBlock(),e.createElementBlock("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-selection-badge`},e.toDisplayString(c.getSelected[n.badge]),9,hu)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],10,uu)),n.search?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n.loading?(e.openBlock(),e.createBlock(y,{key:0,class:"spinner","data-test-id":`${n.dataTestId}-loading-spinner`},null,8,["data-test-id"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"clear-button","data-test-id":`${n.dataTestId}-action-button`},[t.value||n.modelValue?(e.openBlock(),e.createBlock(u,{key:0,disabled:n.disabled,icon:"close",color:"#acacac",size:10,"data-test-id":`${n.dataTestId}-clear-button`,onClick:c.clear},null,8,["disabled","data-test-id","onClick"])):(e.openBlock(),e.createBlock(u,{key:1,icon:"search",size:14,color:"#acacac",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-button`},null,8,["disabled","data-test-id"]))],8,pu))],64)):(e.openBlock(),e.createBlock(u,{key:3,class:"clear-button",color:c.error_message?"#ff6a6a":"#acacac",icon:"arrow_drop_up",size:12,disabled:n.disabled,"data-test-id":`${n.dataTestId}-dropdown-arrow`},null,8,["color","disabled","data-test-id"]))],42,cu),c.error_message?(e.openBlock(),e.createElementBlock("div",{key:0,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},e.toDisplayString(c.error_message),9,mu)):e.createCommentVNode("",!0),c.getOptions&&t.inputFocused&&!n.disabled&&(n.select||n.lookup)?(e.openBlock(),e.createElementBlock("div",{key:1,ref:"dropdown",class:e.normalizeClass(["dropdown",{"dropdown-above":c.shouldShowAbove}]),style:e.normalizeStyle(c.dropdownStyle),"data-test-id":`${n.dataTestId}-dropdown`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.getOptions,(x,f)=>(e.openBlock(),e.createElementBlock("div",{key:x[n.property.key],class:e.normalizeClass(["dropdown-item",{highlighted:f===t.highlightedIndex,"ect-pointer-events-none":x[n.property.assigned]}]),"data-test-id":`${n.dataTestId}-option-${f}`,onClick:s=>c.updateSelected(x)},[e.createElementVNode("div",{class:"name ect-items-center","data-test-id":`${n.dataTestId}-option-${f}-name`},[e.createElementVNode("span",vu,[e.createElementVNode("span",{class:e.normalizeClass({"ect-text-zinc-400":x[n.property.assigned]}),"data-test-id":`${n.dataTestId}-option-${f}-value`},e.toDisplayString(x[n.property.value]==null?"Key and Value is Wrong":x[n.property.value]),11,_u),x[n.property.assigned]?(e.openBlock(),e.createElementBlock("span",{key:0,class:"ect-text-xs ect-leading-4 ect-text-zinc-600","data-test-id":`${n.dataTestId}-option-${f}-assigned`},"Assigned",8,bu)):e.createCommentVNode("",!0)]),n.badge?(e.openBlock(),e.createElementBlock("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-option-${f}-badge`},e.toDisplayString(x[n.badge]),9,Cu)):e.createCommentVNode("",!0)],8,xu),e.createElementVNode("div",{class:"info",title:c.subFieldsText(x),"data-test-id":`${n.dataTestId}-option-${f}-info`},[e.createElementVNode("span",null,e.toDisplayString(c.subFieldsText(x)),1)],8,Eu)],10,yu))),128)),!c.getOptions.length&&!n.loading&&(t.value||n.select)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"no-items-found","data-test-id":`${n.dataTestId}-no-options`}," no options found ",8,ku)):e.createCommentVNode("",!0)],14,gu)):e.createCommentVNode("",!0)])],42,iu)}const ui=ye(au,[["render",wu],["__scopeId","data-v-5ae4f6dc"]]);var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Nu(t){if(t.__esModule)return t;var i=t.default;if(typeof i=="function"){var n=function r(){return this instanceof r?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};n.prototype=i.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var fi={exports:{}};/*!
|
|
10
|
+
`+c):r.stack=c}catch{}}throw r}}_request(i,n){typeof i=="string"?(n=n||{},n.url=i):n=i||{},n=Rt(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:c}=n;r!==void 0&&zn.assertOptions(r,{silentJSONParsing:st.transitional(st.boolean),forcedJSONParsing:st.transitional(st.boolean),clarifyTimeoutError:st.transitional(st.boolean)},!1),o!=null&&(te.isFunction(o)?n.paramsSerializer={serialize:o}:zn.assertOptions(o,{encode:st.function,serialize:st.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),zn.assertOptions(n,{baseUrl:st.spelling("baseURL"),withXsrfToken:st.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=c&&te.merge(c.common,c[n.method]);c&&te.forEach(["delete","get","head","post","put","patch","common"],d=>{delete c[d]}),n.headers=nt.concat(u,c);const y=[];let x=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(n)===!1||(x=x&&p.synchronous,y.unshift(p.fulfilled,p.rejected))});const f=[];this.interceptors.response.forEach(function(p){f.push(p.fulfilled,p.rejected)});let s,_=0,a;if(!x){const d=[ai.bind(this),void 0];for(d.unshift(...y),d.push(...f),a=d.length,s=Promise.resolve(n);_<a;)s=s.then(d[_++],d[_++]);return s}a=y.length;let h=n;for(;_<a;){const d=y[_++],p=y[_++];try{h=d(h)}catch(l){p.call(this,l);break}}try{s=ai.call(this,h)}catch(d){return Promise.reject(d)}for(_=0,a=f.length;_<a;)s=s.then(f[_++],f[_++]);return s}getUri(i){i=Rt(this.defaults,i);const n=Qa(i.baseURL,i.url,i.allowAbsoluteUrls);return Ma(n,i.params,i.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(i){Xn.prototype[i]=function(n,r){return this.request(Rt(r||{},{method:i,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(i){function n(r){return function(c,u,y){return this.request(Rt(y||{},{method:i,headers:r?{"Content-Type":"multipart/form-data"}:{},url:c,data:u}))}}Xn.prototype[i]=n(),Xn.prototype[i+"Form"]=n(!0)});const Kn=Xn;class Ir{constructor(i){if(typeof i!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(c){n=c});const r=this;this.promise.then(o=>{if(!r._listeners)return;let c=r._listeners.length;for(;c-- >0;)r._listeners[c](o);r._listeners=null}),this.promise.then=o=>{let c;const u=new Promise(y=>{r.subscribe(y),c=y}).then(o);return u.cancel=function(){r.unsubscribe(c)},u},i(function(c,u,y){r.reason||(r.reason=new tn(c,u,y),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const n=this._listeners.indexOf(i);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const i=new AbortController,n=r=>{i.abort(r)};return this.subscribe(n),i.signal.unsubscribe=()=>this.unsubscribe(n),i.signal}static source(){let i;return{token:new Ir(function(o){i=o}),cancel:i}}}const H0=Ir;function U0(t){return function(n){return t.apply(null,n)}}function z0(t){return te.isObject(t)&&t.isAxiosError===!0}const Tr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Tr).forEach(([t,i])=>{Tr[i]=t});const X0=Tr;function si(t){const i=new Kn(t),n=ka(Kn.prototype.request,i);return te.extend(n,Kn.prototype,i,{allOwnKeys:!0}),te.extend(n,i,null,{allOwnKeys:!0}),n.create=function(o){return si(Rt(t,o))},n}const Ne=si(Nr);Ne.Axios=Kn,Ne.CanceledError=tn,Ne.CancelToken=H0,Ne.isCancel=Ua,Ne.VERSION=ii,Ne.toFormData=Mn,Ne.AxiosError=xe,Ne.Cancel=Ne.CanceledError,Ne.all=function(i){return Promise.all(i)},Ne.spread=U0,Ne.isAxiosError=z0,Ne.mergeConfig=Rt,Ne.AxiosHeaders=nt,Ne.formToJSON=t=>ja(te.isHTMLForm(t)?new FormData(t):t),Ne.getAdapter=oi.getAdapter,Ne.HttpStatusCode=X0,Ne.default=Ne;class K0{constructor(i,n,r,o){this.awsURL="https://ec-apigw.blink.expedite1.com",this.headers={"x-api-key":i,"X-Salesforce-Org-Type":n,"X-Salesforce-Org-Id":r,"X-Salesforce-User-Id":o,"Content-Type":"application/json"}}}const ci=je.defineStore("comShare",()=>{const t=e.ref(""),i=e.ref(""),n=e.ref(""),r=e.ref(""),o=e.ref(""),c=e.ref(""),u=e.ref(""),y=e.ref("Single"),x=e.computed(()=>y.value==="Single");async function f(s){t.value=s.orgType||"Production",i.value=s.orgId||"",n.value=s.userId||"",r.value=s.accountId||"",o.value=s.opportunityId||"",u.value=s.userLocale||"en_US",y.value=s.pricingSchema||"Single"}return{orgType:t,orgId:i,userId:n,accountId:r,opportunityId:o,userLocale:u,pricingSchema:y,quoteId:c,isSinglePricingSchema:x,setSetupData:f}});function Q0(t){return t.offerData.pricingTypes.forEach(i=>{i.appliedOnField==="Catalog Price"?(t.catalogPrice=i,t.salesPrice=i.offerPrice,t.price=i.offerPrice):i.appliedOnField==="MRC"?(t.mrcPrice=i,t.mrc=i.offerPrice):i.appliedOnField==="YRC"&&(t.yrcPrice=i,t.yrc=i.offerPrice)}),t}function Z0(t){const i=n=>Math.min(...n.options.map(r=>r.relationshipInfo.primarySortOrder));return t.forEach(n=>{n.itemTypes.forEach(r=>{r.options.sort((o,c)=>o.relationshipInfo.primarySortOrder-c.relationshipInfo.primarySortOrder||o.itemName.localeCompare(c.itemName))}),n.itemTypes.sort((r,o)=>i(r)-i(o)||r.itemTypeName.localeCompare(o.itemTypeName))}),t.sort((n,r)=>{const o=Math.min(...n.itemTypes.map(i)),c=Math.min(...r.itemTypes.map(i));return o-c||n.category.localeCompare(r.category)}),t}const G0=(t,i)=>{const n=(r,o)=>typeof o=="function"?void 0:o;return JSON.stringify(t,n)===JSON.stringify(i,n)};class W0 extends K0{constructor(i,n,r,o){super(i,n,r,o)}async getAvailableConfiguration(i){return(await Ne.post(`${this.awsURL}/product-pricing/getAvailableConfiguration`,i,{headers:this.headers})).data}async getLineItems({request:i}){const n=await Ne.post(`${this.awsURL}/quoting/getConfiguredLineItems`,i,{headers:this.headers});return console.info("getLineItems:response",n.data),n.data}async maintainQuoteConfiguration({request:i}){const n=await Ne.post(`${this.awsURL}/transactions/maintainConfiguration`,i,{headers:this.headers});return console.info("maintainQuoteConfiguration:response",n.data),n.data}async getProductCrossSells({objectId:i,productItemId:n}){const r=await Ne.get(`${this.awsURL}/pricing/getProductCrossSells?productItemId=${n}&objectId=${i}`,{headers:this.headers});return console.info("getProductCrossSells:response",r.data),r.data}async addLines({request:i}){const n=await Ne.post(`${this.awsURL}/transactions/addLines`,i,{headers:this.headers});return console.info("addLines:response",n.data),n.data}async evaluateConfigurationSelection({request:i}){const n=await Ne.post("https://api-svc.blink.expedite1.com/api/product-pricing/evaluateConfigurationSelection",i,{headers:this.headers});return console.info("evaluateConfigurationSelection:response",n.data),n.data}}const ct=je.defineStore("comConfigurator",()=>{const t=e.ref(null),i=et(),n=ci(),r=dn(),o=e.ref(null),c=e.ref(null),u=e.ref(null),y=e.ref(null),x=e.ref(null),f=e.ref([]),s=e.ref(null),_=e.ref([]),a=e.ref([]),h=e.ref(null),d=e.ref(new Map),p=e.ref(!1),l=e.ref({init:!1,configuration:!1,lineItem:!1,productOptionsPricing:!1,bestOfferPrice:!1,lineItemAttributes:!1,save:!1}),g=e.ref(!1),m=e.computed(()=>b.value&&!n.isSinglePricingSchema),b=e.computed(()=>{var Y;if(!y.value||!((Y=y.value.categoryOptions)!=null&&Y.length)>0)return!1;let F=!0,$=!0,K=!0,j=null,J=!1;for(const se of y.value.categoryOptions)for(const de of se.itemTypes)for(const ce of de.options)ce.billingPeriod&&(j&&j!==ce.billingPeriod&&(K=!1),j=ce.billingPeriod,!ce.yrcPrice&&ce.billingPeriod==="Monthly"&&(F=!1),!ce.mrcPrice&&ce.billingPeriod==="Yearly"&&($=!1),J=!0);return F&&$&&K&&J}),v=e.computed(()=>!G0(y.value,x.value)),C=e.computed(()=>{var $;const F=(($=y.value)==null?void 0:$.categoryOptions)||[];return F.forEach(K=>{K.itemTypes.forEach(j=>{j.selectedOptions=j.options.filter(J=>j.selected.includes(J.itemId)),j.totalPrice=function(){return j.selectedOptions.reduce((J,Y)=>J+Y.price*Y.qty,0)||0},j.oneTimePrice=function(){return j.selectedOptions.filter(J=>!J.billingPeriod).reduce((J,Y)=>J+Y.price*Y.qty,0)||0},j.recurringPrice=function(){return j.selectedOptions.filter(J=>J.billingPeriod).reduce((J,Y)=>J+Y.price*Y.qty,0)||0}}),K.selectedItemTypes=K.itemTypes.filter(j=>j.selected.length>0),K.totalPrice=function(){return K.itemTypes.reduce((j,J)=>j+J.totalPrice(),0)},K.oneTimePrice=function(){return K.itemTypes.reduce((j,J)=>j+J.oneTimePrice(),0)},K.recurringPrice=function(){return K.itemTypes.reduce((j,J)=>j+J.recurringPrice(),0)}}),F.filter(K=>K.itemTypes.filter(j=>j.selected.length>0).length>0)}),A=e.computed(()=>C.value.reduce((F,$)=>F+$.totalPrice(),0)),w=e.computed(()=>{if(!y.value)return{basePrice:0,addOns:0,oneTimePrice:0,recurringPrice:0,total:0};const F=C.value.reduce((j,J)=>j+J.totalPrice(),0);let $=C.value.reduce((j,J)=>j+J.oneTimePrice(),0),K=C.value.reduce((j,J)=>j+J.recurringPrice(),0);return y.value.billingPeriod?K=(K+y.value.price)*y.value.qty:$=($+y.value.price)*y.value.qty,{basePrice:y.value.price,addOns:F,oneTimePrice:$,recurringPrice:K,total:y.value.price*y.value.qty+F*y.value.qty+$+K}}),S=e.computed(()=>{var $,K,j,J;const F=new Map;return($=s.value)!=null&&$.productLineItem&&F.set((K=s.value)==null?void 0:K.productLineItem.XX_ORD1__Item__c,(j=s.value)==null?void 0:j.productLineItem),(J=s.value)==null||J.options.forEach(Y=>{F.set(Y.XX_ORD1__Item__c,Y)}),F}),I=e.computed(()=>{var $;const F=new Map;return y.value&&(($=y.value.categoryOptions)==null?void 0:$.length)>0&&y.value.categoryOptions.forEach(K=>{K.itemTypes.forEach(j=>{j.options.forEach(J=>{F.set(J.publishKey,J)})})}),F}),B=e.computed(()=>{if(!y.value)return{};const F=j=>!j||!Array.isArray(j)?[]:j.map(J=>({label:J.label,field:J.apiName,dataType:J.dataType,picklistValues:J.picklistValues,isEditable:J.editable,defaultValue:J.defaultValue,value:J.dataType==="BOOLEAN"?J.value?"true":"false":J.dataType==="REFERENCE"?J.referenceRecordId||J.value||"":J.value||""})),$={itemId:y.value.itemId,qliId:y.value.qliId||null,name:y.value.itemName,qty:y.value.qty||1,salesPrice:y.value.price||0,mrc:y.value.mrc||null,yrc:y.value.yrc||null,attributes:F(y.value.attributes)},K=[];return y.value.categoryOptions.forEach(j=>{j.itemTypes.forEach(J=>{J.options.forEach(Y=>{J.selected.includes(Y.itemId)&&K.push({itemId:Y.itemId,qliId:Y.qliId||null,name:Y.itemName,qty:Y.qty||1,salesPrice:Y.price||0,mrc:Y.mrc||null,yrc:Y.yrc||null,attributes:F(Y.attributes)})})})}),{[y.value.itemId]:{product:$,options:K}}}),k=(F,$)=>{if(!F||!Array.isArray(F))return[];const K=new Map;return $.forEach(j=>{K.set(j.fieldAPIName,j.value)}),F.map(j=>(j.value=K.get(j.fieldAPIName)||null,j))};function N(F,$){console.log("updateCurrentConfiguration:newConfiguration",JSON.stringify(F)),console.log("updateCurrentConfiguration:suggestedConfigurations",JSON.stringify($)),$&&(a.value=$.filter(j=>j.product.itemId!==F.product.itemId));const K=new Map;F.options.forEach(j=>{K.set(j.itemId,j)}),y.value.itemName=F.product.name,y.value.qty=F.product.qty,y.value.price=F.product.salesPrice,y.value.attributes=k(y.value.attributes,F.product.attributes),y.value.categoryOptions.forEach(j=>{j.itemTypes.forEach(J=>{J.selected=[],J.options.forEach(Y=>{K.has(Y.itemId)&&(Y.itemName=K.get(Y.itemId).name,Y.qty=K.get(Y.itemId).qty,Y.price=K.get(Y.itemId).salesPrice,Y.qliId=K.get(Y.itemId).qliId,Y.attributes=k(Y.attributes,K.get(Y.itemId).attributes),J.selected.push(Y.itemId))})})}),y.value={...y.value}}function V(){return{get getConfig(){return B.value},setConfig:N}}function L(F){y.value.qliId&&(y.value.qliBillingPeriod==="Monthly"&&!F?y.value.price=y.value.salesPrice||y.value.mrc:y.value.qliBillingPeriod==="Yearly"&&F&&(y.value.price=y.value.salesPrice)),y.value.categoryOptions.forEach($=>{$.itemTypes.forEach(K=>{K.options.forEach(j=>{j.billingPeriod&&(j.price=(F?j.yrcPrice.offerPrice:j.mrcPrice.offerPrice)||j.price,j.qliId&&(j.qliBillingPeriod==="Monthly"&&!F?j.price=j.salesPrice||j.mrc:j.qliBillingPeriod==="Yearly"&&F&&(j.price=j.salesPrice)))})})})}function M(){y.value=null,x.value=null,f.value=[],u.value=null,s.value=null,h.value=null,d.value=new Map,p.value=!1,l.value.configuration=!1,l.value.lineItem=!1,l.value.productOptionsPricing=!1,l.value.bestOfferPrice=!1,l.value.lineItemAttributes=!1,l.value.save=!1}function Q(F,$,K,j){t.value=new W0(F,$,K,j)}async function G(F,$,K){l.value.init=!0,console.time("CONFIGURATOR INIT CONFIGURATOR"),M(),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","1"),c.value=F,u.value=$,o.value=K||n.quoteId;const j=await ee();console.timeLog("CONFIGURATOR INIT CONFIGURATOR","2"),y.value=X(j),u.value?(await E(),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","3"),R(y.value),y.value.categoryOptions.forEach(J=>{J.itemTypes.forEach(Y=>{Y.options.forEach(se=>{R(se),(S.value.has(se.itemId)||se.relationshipInfo.relationship==="Kit")&&Y.selected.push(se.itemId)})})}),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","4")):E(),x.value=JSON.parse(JSON.stringify(y.value)),console.timeEnd("CONFIGURATOR INIT CONFIGURATOR"),l.value.init=!1}async function ee(){try{const F={accountId:n.accountId,objectId:o.value,itemId:c.value,configScope:"BASIC",fields:[],pricePreference:"Lowest Price"},$=await t.value.getAvailableConfiguration(F);console.info("getAvailableConfiguration:result",$);const K=$.data.productConfiguration;return K.categoryOptions=Z0(K.categoryOptions),K}catch(F){return console.info("error",F.message),!1}}function X(F){d.value.set(u.value,F.attributes),f.value=F.configRules;const $=new Set;return f.value.forEach(K=>{const j=JSON.parse(K.ruleJson);j.optionSelected.forEach(J=>{$.add(J)}),j.affectedOptions.forEach(J=>{$.add(J)})}),console.info("rulesByPublishKey",$),R(F),F.categoryOptions.forEach(K=>{K.key=K.category.toLowerCase().replace(/\s+/g,"-").replace(/[&]/g,""),K.itemTypes.forEach(j=>{j.selected=[],j.numberOfColumns||(j.numberOfColumns=1),j.numberOfColumns>1&&(j.lightboxAttributes=!0),j.maxNumber||(j.maxNumber=100),j.minNumber||(j.minNumber=0),j.maxQuantity||(j.maxQuantity=1e4),j.minQuantity||(j.minQuantity=1),j.maxNumber===1?(j.isRadio=!0,j.minMessage="Please select 1 option",j.maxMessage="",j.isKit=j.options.some(J=>J.relationshipInfo.relationship==="Kit")):(j.minMessage=`Minimum of ${j.minNumber} selection${j.minNumber!==1?"s":""} required`,j.maxMessage=`Maximum of ${j.maxNumber} selection${j.maxNumber!==1?"s":""} allowed`),j.options.forEach(J=>{K.showImage=K.showImage||!!J.defaultImageURL,J.showAttributesModal=!1,J.calculateRules=$.has("option."+J.publishKey),console.info("option.calculateRules",J.calculateRules),J.qty=j.minQuantity||1,J.getTags=()=>(J.attributes=J.attributes||[],J.attributes.filter(Y=>Y.value!==null&&Y.value!=="").map(Y=>({label:Y.label,value:Y.value}))),Object.defineProperty(J,"isDisabled",{get:function(){return J.relationshipInfo.relationship==="Kit"||(j.isRadio?j.isKit:!j.selected.includes(J.itemId)&&j.maxNumber===j.selected.length)}}),R(J)})})}),F}function R(F){F.isAttributes=F.attributes&&F.attributes.length>0;const $=F.catalogItem;if(S.value.has(F.itemId)){const K=S.value.get(F.itemId);F.qliId=K.Id,F.qty=K.XX_ORD1__QTY__c,F.itemName=K.XX_ORD1__Line_Description__c,F.billingPeriod=K.XX_ORD1__Billing_Period__c,F.price=K.XX_ORD1__Sales_Price__c,F.billingPeriod?F.price=K.XX_ORD1__Sales_Price__c||K.XX_ORD1__MRC__c:F.price=K.XX_ORD1__NRC__c||K.XX_ORD1__Sales_Price__c,F.salesPrice=K.XX_ORD1__Sales_Price__c,F.nrc=K.XX_ORD1__NRC__c,F.mrc=K.XX_ORD1__MRC__c,F.qliBillingPeriod=K.XX_ORD1__Billing_Period__c,d.value.set(F.qliId,F.attributes)}else F.itemName=$.XX_ORD1__Line_Description__c||F.itemName,F.price=$.XX_ORD1__Negotiated_Price__c||$.XX_ORD1__NRC_for_New__c,F.nrcPrice=$.XX_ORD1__NRC_for_New__c,F.qty=F.qty||1,Q0(F)}async function E(){l.value.lineItem=!0,console.info("getLineItems",o.value,u.value);try{const F={objectId:o.value,filters:{},additionalFields:["Name","XX_ORD1__Line_Description__c","XX_ORD1__SYS_Configuration_Status2__c"],primarySort:{field:"CreatedDate",direction:"DESC"},productPage:{limit:200,offset:0,productLineItemId:u.value}},$=await t.value.getLineItems({request:JSON.stringify(F)});return($.data.products||[]).forEach(j=>{const J=j.productLineItem;J.Id===u.value?s.value=j:_.value.push(J)}),console.info("lineItem.value",s.value),console.info("configurableLineItems.value",_.value),l.value.lineItem=!1,$}catch(F){return console.info("error",F.message),l.value.lineItem=!1,!1}}async function T(F){console.info("getRecords");try{const $=await window.productManagerController.getRecords({request:JSON.stringify(F)});return console.info("getRecords:result",$),JSON.parse($.data)}catch($){return console.info("error",$.message),!1}}async function D(){p.value=!0,l.value.save=!0,console.info("maintainQuoteConfiguration");const F=[],$=[];y.value.categoryOptions.forEach(J=>{J.itemTypes.forEach(Y=>{Y.options.forEach(se=>{Y.selected.includes(se.itemId)?F.push(P(se)):se.qliId&&$.push(se.qliId)})})});const K={objectId:o.value,eCatalogId:n.eCatalogId,isGenesisAI:!0,blinkUser:!1,optionsToRemove:$,grandFatheredOptionsToRemove:[],productLineItem:{...P(y.value),optionLineItems:F}};console.info("maintainQuoteConfiguration:request",K);const j=await t.value.maintainQuoteConfiguration({request:JSON.stringify(K)});if(console.info("maintainQuoteConfiguration:result",j),j!=null&&j.error){const J={title:"Unable to Save Configuration",description:j.error,button:{label:"Back to Configuration",action:()=>{p.value=!1}},cancel:{label:"Quote List",action:()=>{r.push("/quote-item?id="+o.value)}}};i.errorPopup=J}else if(x.value=JSON.parse(JSON.stringify(y.value)),console.info("maintainQuoteConfiguration:result",j),l.value.save=!1,!u.value)return y.value.qliId=j.data.productLineItem.lineItemId,u.value=j.data.productLineItem.lineItemId,j.data.productLineItem.lineItemId;l.value.save=!1}function P(F){const $={};F.isAttributes&&F.attributes.forEach(j=>{!j.apiName.includes(".")&&j.value!==null&&j.value!==void 0&&(j.dataType==="BOOLEAN"?$[j.apiName]=j.value?"true":"false":j.dataType==="REFERENCE"?$[j.apiName]=j.referenceRecordId:$[j.apiName]=j.value)});const K={attributes:$,itemId:F.itemId,lineItemId:F.qliId,lineDescription:F.itemName,qty:F.qty,billingPeriod:F.billingPeriod,...F.offer};return F.billingPeriod&&b.value&&!n.isSinglePricingSchema&&(K.billingPeriod=g.value?"Yearly":"Monthly"),!n.isSinglePricingSchema&&!F.billingPeriod?K.nrcPrice=F.price:(K.applyOnField="Catalog Price",K.salesPrice=F.price,K.nrcPrice=F.nrcPrice),K}async function z(){const F={objectId:n.accountId,productItemId:c.value};try{let $=await t.value.getProductCrossSells(F);const{crossSells:K,offerResult:j}=$.data;if(K.length===0)return[];const J=new Map;return j.forEach(Y=>{J.set(Y.eCatalogItemId,{...Y,...Y.pricingTypes[0]})}),K.forEach(Y=>{Y.loading=!1,Y.Name=Y.XX_ORD1__Line_Description__c||Y.XX_ORD1__Item__r.Name,Y.Description=Y.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,J.has(Y.Id)?(Y.Price=J.get(Y.Id).offerPrice,Y.priceFormatted=J.get(Y.Id).formattedOfferPrice,Y.offer={offerDiscount:J.get(Y.Id).offerDiscount,offerId:J.get(Y.Id).offerId,offerType:J.get(Y.Id).offerType}):(Y.Price=Y.XX_ORD1__List_Price2__c,Y.priceFormatted=Y.XX_ORD1__List_Price2__c,Y.offer={offerDiscount:0,offerId:null,offerType:null})}),K}catch($){return console.info("error",$.message),!1}}const q=F=>!F||!Array.isArray(F)?[]:F.filter($=>$.apiName&&$.value!==null&&$.value!==void 0&&$.value!=="").map($=>({attrName:$.apiName,attrValue:$.dataType==="BOOLEAN"?$.value:$.value||"",dataType:$.dataType}));async function U(F,$){const K={product:{publishKey:y.value.publishKey,attributes:q(y.value.attributes),lineDescription:y.value.itemName,meta:{XX_ORD1__Sales_Price__c:y.value.price,XX_ORD1__MRC__c:y.value.mrc,XX_ORD1__NRC__c:y.value.nrc,XX_ORD1__YRC__c:y.value.yrc,quantity:y.value.qty}},options:[]};y.value.categoryOptions.forEach(Y=>{Y.itemTypes.forEach(se=>{se.options.forEach(de=>{se.selected.includes(de.itemId)&&K.options.push({publishKey:de.publishKey,attributes:q(de.attributes),lineDescription:de.itemName,meta:{XX_ORD1__Sales_Price__c:de.price,XX_ORD1__MRC__c:de.mrc,XX_ORD1__NRC__c:de.nrc,XX_ORD1__YRC__c:de.yrc,quantity:de.qty}})})})}),console.info("evaluateConfigSelection:currentConfig.options",K.options);const j={itemId:c.value,currentConfig:K,selected:F?{publishKey:F==null?void 0:F.publishKey,attributes:q(F.attributes),lineDescription:F.itemName}:{},unselected:$?{publishKey:$==null?void 0:$.publishKey,attributes:q($.attributes),lineDescription:$.itemName}:{}};return await t.value.evaluateConfigurationSelection({request:JSON.stringify(j)})}async function Z(F){const $={objectId:o.value,lstLIRequest:[{eCatalogItemId:F.Id,quantity:1,offerApplicable:F.offer}]};try{const K=await t.value.addLines({request:JSON.stringify($)});console.info("addLines:result",K)}catch(K){return console.info("error",K.message),!1}}return{itemId:c,configuration:y,_configurationCopy:x,lineItem:s,savedScreen:p,loading:l,summary:C,addOns:A,summaryPrices:w,optionByItemId:S,attributesByQLIId:d,optionByPublishKey:I,showYearlyPricing:g,isYearlyPricingExist:b,isChangedConfiguration:v,isRecurringPricingSchema:m,configurableLineItems:_,suggestedConfigurations:a,initializeController:Q,exposeProperties:V,updateCurrentConfiguration:N,changePricingScheme:L,addLines:Z,resetConfigurator:M,getRecords:T,getProductCrossSells:z,initConfigurator:G,maintainQuoteConfiguration:D,evaluateConfigSelection:U}}),J0={class:"ect-p-4 ect-flex ect-gap-2 ect-items-center ect-justify-between ect-border-b ect-border-gray-200"},Y0={class:"ect-flex ect-items-center ect-gap-3"},ed={class:"ect-text-xl ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},td={key:0,class:"ect-flex ect-gap-1.5 ect-items-center"},nd=e.createElementVNode("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Saving configuration...",-1),rd={key:1,class:"ect-flex ect-gap-1.5 ect-items-center"},od=e.createElementVNode("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Configuration Saved Successfully",-1),ad={key:1,class:"ect-flex ect-flex-col ect-gap-4 ect-flex-1 ect-overflow-y-auto ect-mb-16"},id=e.createElementVNode("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},"You may consider these products",-1),ld={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},sd=["data-test-id"],cd={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},dd={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},ud={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},fd={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},hd={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},pd={key:2,class:"ect-flex ect-flex-col ect-gap-4 ect-m-4 ect-flex-1 ect-overflow-y-auto"},md=e.createElementVNode("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},"What do you want to do next?",-1),gd={class:"ect-flex ect-flex-col ect-gap-4"},yd=["data-test-id","onClick"],xd={class:"ect-flex ect-items-center ect-justify-center"},vd={class:"ect-flex ect-flex-col ect-items-center ect-gap-2 ect-w-full"},_d=["data-test-id"],bd=["data-test-id"],Cd={__name:"ConfiguratorRecommend",setup(t){const i=ct();dn();const n=e.computed(()=>i.configuration),r=e.ref(!0),o=e.ref(""),c=e.ref([{icon:"configuration",title:"Back to current Product Configuration",description:"Returns to the active product configuration page.",link:"/item/overview",action:"backToConfiguration"}]),u=e.ref(null),y=e.ref([]),x=async d=>{d.loading=!0,await i.addLines(d),d.disabled=!0,d.loading=!1},f=e.computed(()=>{var d;if(((d=i.suggestedConfigurations)==null?void 0:d.length)>0){const p=i.suggestedConfigurations[0];return{Name:p.product.name,Description:p.product.description,Price:p.product.salesPrice,XX_ORD1__Item__c:p.product.itemId}}return null}),s=d=>{d.action==="backToConfiguration"&&(i.savedScreen=!1)};async function _(){const d=i.configurableLineItems,p=d.filter(g=>g.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration").length;o.value=`(${d.length-p}/${d.length})`;const l=d.find(g=>g.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration"&&g.Id!=i.qliId);return u.value=l?{Name:l.XX_ORD1__Line_Description__c,Description:l.XX_ORD1__Product_Description__c,Price:l.XX_ORD1__Sales_Price__c,XX_ORD1__Item__c:l.XX_ORD1__Item__c,Id:l.Id}:null,d}async function a(){i.resetConfigurator(),await i.initConfigurator(f.value.XX_ORD1__Item__c,null),i.updateCurrentConfiguration(i.suggestedConfigurations[0],i.suggestedConfigurations)}async function h(){i.resetConfigurator(),i.initConfigurator(u.value.XX_ORD1__Item__c,u.value.Id)}return e.onBeforeMount(async()=>{r.value=!0;const d=await _(),p=await i.getProductCrossSells(),l=new Set;d.forEach(g=>{l.add(g.XX_ORD1__Item__c)}),p.forEach(g=>{g.disabled=l.has(g.XX_ORD1__Item__c)}),y.value=p||[],r.value=!1}),(d,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",J0,[e.createElementVNode("div",Y0,[e.createVNode(we,{icon:"arrow",symbol:"",size:12,onClick:p[0]||(p[0]=l=>e.unref(i).savedScreen=!1)}),e.createElementVNode("h2",ed,e.toDisplayString(n.value.itemName),1)]),e.unref(i).loading.save?(e.openBlock(),e.createElementBlock("div",td,[e.createVNode(xa,{svg:""}),nd])):(e.openBlock(),e.createElementBlock("div",rd,[e.createVNode(we,{icon:"check",color:"#136E05",size:14,"data-test-id":"item-tabs-before-button-icon"}),od]))]),r.value?(e.openBlock(),e.createBlock(ga,{key:0,type:"recommendations",rows:4})):y.value.length>0?(e.openBlock(),e.createElementBlock("div",ad,[id,e.createElementVNode("div",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,g)=>(e.openBlock(),e.createElementBlock("div",{key:l.Id||g,class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":`configurator-recommend-card-${l.Id||g}`},[e.createElementVNode("div",cd,[e.createElementVNode("h4",dd,e.toDisplayString(l.Name),1),e.createElementVNode("p",ud,e.toDisplayString(l.Description),1)]),e.createElementVNode("div",fd,[e.createElementVNode("div",hd,e.toDisplayString(e.unref(Ge)(l.Price)),1),e.createVNode(Je,{btype:l.disabled?"secondary":"primary","button-style":l.disabled?"normal":"outlined",size:"medium",class:e.normalizeClass({"ect-w-[120px]":l.loading}),loading:l.loading,disabled:l.disabled||l.loading,"data-test-id":`configurator-recommend-button-add-${l.Id||g}`,onClick:m=>x(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.loading?"":l.disabled?"Added to Quote":"Add to Quote"),1)]),_:2},1032,["btype","button-style","class","loading","disabled","data-test-id","onClick"])])],8,sd))),128))])])):(e.openBlock(),e.createElementBlock("div",pd,[md,e.createElementVNode("div",gd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,g)=>(e.openBlock(),e.createElementBlock("div",{key:l.title||g,class:"ect-bg-white ect-border ect-border-[#DEDEDE] ect-rounded-xl ect-p-4 md:ect-p-5 lg:ect-p-6 ect-flex ect-flex-col ect-items-center ect-gap-4 md:ect-gap-6 lg:ect-gap-8 ect-cursor-pointer ect-transition-all ect-duration-200 hover:ect-shadow-md hover:ect-border-gray-400","data-test-id":`configurator-recommend-redirect-card-${g}`,onClick:m=>s(l)},[e.createElementVNode("div",xd,[e.createVNode(we,{icon:l.icon,size:20,color:"#000000","data-test-id":`configurator-recommend-redirect-icon-${g}`},null,8,["icon","data-test-id"])]),e.createElementVNode("div",vd,[e.createElementVNode("h4",{class:"ect-text-sm ect-font-semibold ect-text-[#5F5F5F] ect-text-center ect-leading-[1.43]","data-test-id":`configurator-recommend-redirect-title-${g}`},e.toDisplayString(l.title),9,_d),e.createElementVNode("p",{class:"ect-text-sm ect-font-normal ect-text-[#828282] ect-text-center ect-leading-[1.71]","data-test-id":`configurator-recommend-redirect-description-${g}`},e.toDisplayString(l.description),9,bd)])],8,yd))),128))])])),f.value?(e.openBlock(),e.createBlock(ya,{key:3,title:"Configuere next AI suggested product","configuered-product":f.value,"count-configued-product-string":o.value,onConfigureNextProduct:a},null,8,["configuered-product","count-configued-product-string"])):(e.openBlock(),e.createBlock(ya,{key:4,title:`Configuere next product from your quote ${o.value}`,"configuered-product":u.value,"count-configued-product-string":o.value,onConfigureNextProduct:h},null,8,["title","configuered-product","count-configued-product-string"]))],64))}},Ed=["data-test-id"],kd=ye({__name:"AppPill",props:{variant:{type:String,default:"",validator:t=>["success","error",""].includes(t)},dataTestId:{type:String,default:""}},setup(t){return(i,n)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["ect-pill",{"ect-pill-success":t.variant==="success","ect-pill-error":t.variant==="error","ect-pill-default":!t.variant}]),"data-test-id":t.dataTestId},[e.renderSlot(i.$slots,"default",{},void 0,!0)],10,Ed))}},[["__scopeId","data-v-c7f05fa0"]]),wd=["data-test-id"],Nd=["data-test-id"],Bd=["data-test-id","onClick"],Ad=["data-test-id"],Sd=ye({__name:"AppTabsV2",props:{showTabs:{type:Boolean,default:!0},modelValue:{type:String,default:""},border:{type:Boolean,default:!1},tabs:{type:Array,required:!0,validator:t=>t.every(i=>typeof i=="object"&&i.title&&i.key&&(i.sections===void 0||Array.isArray(i.sections)))},dataTestId:{type:String,required:!0}},emits:["update:modelValue","tab-change"],setup(t,{emit:i}){const n=t,r=i,o=e.computed(()=>{var u;return n.modelValue||((u=n.tabs[0])==null?void 0:u.key)||""}),c=u=>{r("update:modelValue",u),r("tab-change",u)};return(u,y)=>(e.openBlock(),e.createElementBlock("div",{class:"ect-page-tabs","data-test-id":t.dataTestId},[t.showTabs?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ect-page-tabs-header",[{"ect-tab-border":t.border}]]),"data-test-id":`${t.dataTestId}-header`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,x=>(e.openBlock(),e.createElementBlock("button",{key:x.key,class:e.normalizeClass(["ect-page-tab-button",`ect-page-tab-button${o.value===x.key?"-active":""} ${x.tabClass||""}`]),"data-test-id":`${t.dataTestId}-tab-${x.key}`,onClick:f=>c(x.key)},[e.createTextVNode(e.toDisplayString(x.title)+" ",1),x.pill!==void 0&&x.pill!==null?(e.openBlock(),e.createBlock(kd,{key:0,class:"ect-ml-2",variant:x.pillStyle,"data-test-id":`${t.dataTestId}-tab-${x.key}-pill`},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.pill),1)]),_:2},1032,["variant","data-test-id"])):e.createCommentVNode("",!0)],10,Bd))),128))],10,Nd)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"ect-page-tab-content","data-test-id":`${t.dataTestId}-content`},null,8,Ad)],8,wd))}},[["__scopeId","data-v-f22cb1ed"]]),Od=["data-test-id"],Id=["disabled","data-test-id"],Td=["value","disabled","data-test-id"],Vd=["disabled","data-test-id"],Qn={__name:"CounterButton",props:{value:{type:Number,required:!0,default:null},min:{type:Number,default:1},max:{type:Number,default:999},empty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:value","change"],setup(t,{emit:i}){const n=t,r=i,o=e.computed(()=>n.min==null?0:n.min),c=e.computed(()=>n.max==null?999:n.max),u=(v,C,A)=>Math.min(Math.max(v,C),A),y=v=>{if(v==null||v==="")return NaN;const C=Number(v);return Number.isFinite(C)?C:NaN},x=e.ref(null),f=e.ref(n.value??o.value),s=v=>{f.value=u(v,o.value,c.value)};n.value!==null&&s(n.value);const _=e.computed(()=>f.value),a=e.computed(()=>x.value!=null?x.value:String(_.value)),h=e.computed(()=>n.disabled||_.value<=o.value),d=e.computed(()=>n.disabled||_.value>=c.value);function p(v){v!==n.value&&(f.value=v,r("update:value",v),r("change",v))}function l(){if(h.value)return;const v=u(_.value-1,o.value,c.value);x.value=null,p(v)}function g(){if(d.value)return;const v=u(_.value+1,o.value,c.value);x.value=null,p(v)}function m(v){const A=String(v.target.value??"").replace(/\D+/g,"");x.value=A}function b(){const v=y(x.value),C=o.value,A=u(Number.isNaN(v)?C:v,o.value,c.value);x.value=null,p(A)}return(v,C)=>(e.openBlock(),e.createElementBlock("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":t.dataTestId},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":h.value,"ect-cursor-not-allowed":h.value}]),disabled:h.value,"data-test-id":`${t.dataTestId}-decrement`,onClick:l}," - ",10,Id),e.createElementVNode("input",{type:"text",inputmode:"numeric",pattern:"[0-9]*",value:t.empty?"":a.value,disabled:t.disabled,class:"ect-h-7 ect-w-[48px] ect-px-2 ect-border ect-border-gray ect-rounded-md ect-text-center ect-text-sm ect-font-medium ect-text-gray-900 focus:ect-outline-none focus:ect-border-gray-400 ect-bg-white","data-test-id":`${t.dataTestId}-input`,onInput:m,onBlur:b},null,40,Td),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":d.value,"ect-cursor-not-allowed":d.value}]),disabled:d.value,"data-test-id":`${t.dataTestId}-increment`,onClick:g}," + ",10,Vd)],8,Od))}},Dd={class:"ect-flex ect-justify-end ect-items-center ect-gap-2.5 ect-px-6 ect-py-4 ect-bg-white ect-border-t ect-border-gray-300 ect-shadow-[0_-2px_4px_0px_rgba(0,0,0,0.11)]","data-test-id":"configurator-footer"},Ld={"data-test-id":"configurator-footer-quantity"},Rd={class:"ect-flex ect-justify-end ect-items-center ect-gap-6 ect-px-8 ect-py-0 ect-flex-1","data-test-id":"configurator-footer-prices"},Fd=["data-test-id"],Pd=["data-test-id"],Md=["data-test-id"],qd=["data-test-id"],$d={__name:"ConfiguratorFooter",props:{item:{type:Object,required:!0,default:()=>{}},disabled:{type:Boolean,default:!1},btnText:{type:String,default:"Save"}},emits:["update:qty","continue"],setup(t,{emit:i}){const n=ct(),r=t,o=e.ref(r.item),c=e.computed(()=>{const x=n.summaryPrices,f=[];return n.isRecurringPricingSchema?(f.push({label:"One Time Price",value:x.oneTimePrice,highlight:!1}),f.push({label:n.showYearlyPricing?"Yearly Price":"Monthly Price",value:x.recurringPrice,highlight:!1})):(f.push({label:"Base Price",value:x.basePrice,highlight:!1}),f.push({label:"Add Ons",value:x.addOns,highlight:!1}),f.push({label:"Total Price",value:x.total,highlight:!1})),f}),u=i,y=()=>{r.disabled||u("continue")};return(x,f)=>(e.openBlock(),e.createElementBlock("footer",Dd,[e.createElementVNode("div",Ld,[e.createVNode(Qn,{value:o.value.qty,"onUpdate:value":f[0]||(f[0]=s=>o.value.qty=s),min:1,max:999,disabled:t.disabled,"is-selected":!0,"data-test-id":"configurator-footer-counter-button"},null,8,["value","disabled"])]),e.createElementVNode("div",Rd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(s,_)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:_},[e.createElementVNode("div",{class:"ect-flex ect-flex-col ect-justify-center","data-test-id":`configurator-footer-price-${_}`},[e.createElementVNode("span",{class:"ect-text-xs ect-font-normal ect-text-gray-500 ect-text-left","data-test-id":`configurator-footer-price-label-${_}`},e.toDisplayString(s.label),9,Pd),e.createElementVNode("span",{class:e.normalizeClass(["ect-text-left",s.highlight?"ect-text-lg ect-font-bold ect-text-green-700":"ect-text-sm ect-font-medium ect-text-gray-800 "]),"data-test-id":`configurator-footer-price-value-${_}`},e.toDisplayString(e.unref(Ge)(s.value)),11,Md)],8,Fd),_<c.value.length-1?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ect-w-0 ect-h-5 ect-border-l ect-border-gray-400","data-test-id":`configurator-footer-divider-${_}`},null,8,qd)):e.createCommentVNode("",!0)],64))),128))]),e.createVNode(Je,{class:"ect-min-w-[100px]",btype:t.disabled?"secondary":"primary",disabled:t.disabled,"button-style":"primary",size:"medium","data-test-id":"configurator-footer-button-continue",onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.btnText),1)]),_:1},8,["btype","disabled"])]))}},jd={class:"ect-w-full ect-bg-white ect-mb-4","data-test-id":"configurator-type-section"},Hd={class:"ect-sticky ect-top-0 ect-z-30 ect-bg-white ect-shadow-sm ect-p-3 ect-px-4 ect-border-b ect-border-gray-200 ect-flex ect-justify-between ect-items-center","data-test-id":"configurator-type-header-sticky"},Ud={class:"ect-flex ect-flex-col"},zd={class:"ect-font-bold ect-text-text-success ect-leading-tight"},Xd=["innerHTML"],Kd={key:0,class:"ect-flex ect-items-center ect-gap-2 ect-px-2 ect-py-1","data-test-id":"configurator-type-message"},Qd={class:"ect-text-xs ect-font-medium ect-text-gray-600 ect-leading-tight ect-min-w-[190px]"},Zd={class:"ect-divide-y ect-divide-gray-100 ect-overflow-y-auto"},Gd={__name:"ConfiguratorType",props:{title:{type:String,required:!0},description:{type:String,default:""},message:{type:String,default:""}},setup(t){return(i,n)=>(e.openBlock(),e.createElementBlock("section",jd,[e.createElementVNode("header",Hd,[e.createElementVNode("div",Ud,[e.createElementVNode("h2",zd,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:"ect-mt-1 ect-text-xs ect-text-gray-500 ect-leading-tight",innerHTML:t.description},null,8,Xd)):e.createCommentVNode("",!0)]),t.message?(e.openBlock(),e.createElementBlock("div",Kd,[e.createVNode(we,{icon:"info",symbol:"",color:"#198708",size:14,"data-test-id":"configurator-type-message-icon"}),e.createElementVNode("span",Qd,e.toDisplayString(t.message),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zd,[e.renderSlot(i.$slots,"default")])]))}},Wd={__name:"ShadowDisplay",props:{content:{type:String,required:!0}},setup(t){const i=t,n=e.ref(null);let r=null;return e.onMounted(()=>{n.value&&!r&&(r=n.value.attachShadow({mode:"open"}),r.innerHTML=i.content)}),e.watch(()=>i.content,o=>{r&&(r.innerHTML=o)}),(o,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"host",ref:n},null,512))}},Jd=["data-test-id"],Yd=["data-test-id"],e1=["data-test-id"],t1=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("g",{id:"Group"},[e.createElementVNode("path",{id:"Vector",d:"M7 1.3125V12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{id:"Vector_2",d:"M1.3125 7H12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)],n1=["data-test-id"],r1=["data-test-id"],o1=["data-test-id"],a1=["data-test-id"],i1=["data-test-id"],l1=["data-test-id","innerHTML"],dt={__name:"Tag",props:{label:{type:String,default:""},value:{type:String,default:""},addButton:{type:Boolean,default:!1},editButton:{type:Boolean,default:!1},dataTestId:{type:String,default:""}},setup(t){const i=t,n=e.computed(()=>{const r=i.value;if(typeof r!="string")return!1;const o=new DOMParser().parseFromString(r,"text/html");return Array.from(o.body.childNodes).some(c=>c.nodeType===1)});return(r,o)=>t.addButton?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ect-bg-orange-4 ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-orange-secondary","data-test-id":t.dataTestId},[e.createElementVNode("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-orange-secondary ect-flex ect-items-center ect-gap-1","data-test-id":`${t.dataTestId}-content`},[e.createElementVNode("div",{"data-test-id":`${t.dataTestId}-add-icon`},t1,8,e1),e.createTextVNode(" "+e.toDisplayString(t.label),1)],8,Yd)],8,Jd)):t.editButton?(e.openBlock(),e.createElementBlock("div",{key:1,class:"ect-bg-white ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-success","data-test-id":t.dataTestId},[e.createElementVNode("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-success ect-flex ect-items-center ect-gap-1","data-test-id":`${t.dataTestId}-content`},e.toDisplayString(t.label),9,r1)],8,n1)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"ect-bg-white ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-rounded-md ect-border ect-border-solid ect-border-neutral-200","data-test-id":t.dataTestId},[e.createElementVNode("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${t.dataTestId}-label`},e.toDisplayString(t.label),9,a1),t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${t.dataTestId}-separator`}," : ",8,i1)):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createBlock(Wd,{key:1,content:t.value},null,8,["content"])):t.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-neutral-700","data-test-id":`${t.dataTestId}-value`,innerHTML:t.value},null,8,l1)):e.createCommentVNode("",!0)],8,o1))}},s1=["data-test-id"],c1=["data-test-id"],d1=["data-test-id"],u1=["type","step","min","data-test-id"],Vr=ye({__name:"InputEdit",props:{modelValue:{type:[String,Number],required:!0},type:{type:String,default:"string",validator:t=>["string","number","currency"].includes(t)},tag:{type:String,default:"span"},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","change"],setup(t,{expose:i,emit:n}){const r=t,o=n,c=e.ref(!1),u=e.ref(!1),y=e.ref(""),x=e.ref(null),f=e.computed(()=>r.type==="currency"?g(r.modelValue):r.type==="number"?m(r.modelValue):r.modelValue),s=e.computed(()=>r.type==="string"?"text":"number"),_=e.computed(()=>r.type==="currency"?"0.01":void 0),a=e.computed(()=>r.type==="currency"?"0":void 0),h=()=>{r.disabled||(r.type==="currency"?y.value=parseFloat(r.modelValue)||"0.00":r.type==="number"?y.value=parseFloat(r.modelValue)||"0":y.value=r.modelValue,c.value=!0,e.nextTick(()=>{x.value&&(x.value.focus(),x.value.select())}))},d=()=>{let b=y.value;if(r.type==="number"||r.type==="currency"){const v=parseFloat(y.value);isNaN(v)?b=r.modelValue:b=r.type==="currency"?v.toFixed(2):v.toString()}b!==r.modelValue&&(o("update:modelValue",b),o("change",b)),c.value=!1},p=()=>{y.value=r.modelValue,c.value=!1},l=()=>{c.value&&d()},g=b=>!b||isNaN(b)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(parseFloat(b)),m=b=>!b||isNaN(b)?"0":new Intl.NumberFormat("en-US").format(parseFloat(b));return e.watch(()=>r.modelValue,b=>{c.value||(y.value=b)}),i({startEditing:h,saveChanges:d,cancelEditing:p}),(b,v)=>{const C=e.resolveDirective("click-outside");return e.openBlock(),e.createElementBlock("div",{class:"ect-relative ect-inline-block ect-min-w-[60px] ect-h-[30px]","data-test-id":t.dataTestId,onMouseenter:v[1]||(v[1]=A=>u.value=!0),onMouseleave:v[2]||(v[2]=A=>u.value=!1)},[c.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:1,class:"ect-w-full ect-h-full","data-test-id":`${t.dataTestId}-input-wrapper`},[e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:x,"onUpdate:modelValue":v[0]||(v[0]=A=>y.value=A),type:s.value,step:_.value,min:a.value,class:e.normalizeClass(["ect-w-full ect-h-full ect-px-3 ect-bg-white ect-border ect-border-green-500 ect-rounded-sm ect-text-gray-700 ect-text-base ect-font-sans ect-outline-none ect-duration-200",b.$attrs.class]),"data-test-id":`${t.dataTestId}-input`,onKeyup:[e.withKeys(d,["enter"]),e.withKeys(p,["esc"])],onBlur:d},null,42,u1),[[e.vModelDynamic,y.value]])],8,d1)),[[C,l]]):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ect-flex ect-items-center ect-gap-2 ect-rounded ect-transition-colors ect-duration-200",{"ect-cursor-pointer":!t.disabled}]),"data-test-id":`${t.dataTestId}-display`,onClick:h},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps(b.$attrs,{class:"ect-m-0 ect-text-inherit","data-test-id":`${t.dataTestId}-text`}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value)+" ",1),e.createVNode(we,{class:e.normalizeClass(u.value&&!t.disabled?"ect-visible":"ect-invisible"),icon:"edit",size:"12",color:"#828282","data-test-id":`${t.dataTestId}-edit-icon`},null,8,["class","data-test-id"])]),_:1},16,["data-test-id"]))],10,c1))],40,s1)}}},[["__scopeId","data-v-5cd60070"]]),di=t=>(e.pushScopeId("data-v-b9675cf1"),t=t(),e.popScopeId(),t),f1=["data-test-id","data-publish-key"],h1={key:0,class:"ect-text-xs ect-text-gray-500 ect-text-white ect-font-medium ect-leading-tight ect-absolute ect-top-[-.7rem] ect-left-[-1rem] ect-bg-text-success ect-rounded-xl ect-px-2 ect-py-1"},p1={key:1,class:"ect-flex ect-items-start ect-gap-4 ect-p-3 ect-px-4"},m1={key:0,class:"ect-w-16 ect-h-16 ect-flex ect-items-center ect-justify-center ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0"},g1=["src","alt"],y1={class:"ect-flex-1 ect-min-w-0"},x1={class:"ect-flex ect-gap-4 ect-items-center ect-justify-between"},v1={class:"ect-flex ect-flex-row ect-gap-3"},_1=di(()=>e.createElementVNode("div",{class:"ect-w-px ect-h-auto ect-bg-gray-200 ect-mx-2"},null,-1)),b1={class:"ect-flex ect-flex-col ect-max-w-[125px]"},C1={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},E1=["innerHTML"],k1={key:0,class:"ect-flex ect-flex-wrap ect-gap-2.5 ect-mt-2"},w1=["data-test-id"],N1=["data-test-id"],B1={key:1,class:"ect-inline-block ect-mb-2"},A1={key:2,class:"ect-flex ect-flex-col ect-gap-3 ect-p-3 ect-h-full ect-justify-between"},S1={class:"ect-flex ect-items-start ect-gap-2"},O1={key:0,class:"ect-w-16 ect-h-16 ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0 ect-overflow-hidden"},I1=["src","alt"],T1={class:"ect-flex-1 ect-min-w-0"},V1={class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},D1=["innerHTML"],L1={class:"temp-hidden"},R1={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},F1={key:0,class:"ect-flex ect-flex-wrap ect-gap-1.5"},P1=["data-test-id"],M1=["data-test-id"],q1={key:1,class:"ect-inline-block ect-mb-2"},$1={class:"ect-flex ect-justify-between ect-items-center"},j1={class:"ect-flex ect-flex-col"},H1=di(()=>e.createElementVNode("p",{class:"ect-text-xs ect-text-gray-500 ect-font-medium ect-leading-tight"},"Price",-1)),U1={key:3,"data-test-id":"configurator-item-slot-details",class:"ect-bg-white ect-rounded-md"},z1=ye({__name:"ConfiguratorItem",props:{item:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},imageUrl:{type:String,default:""},price:{type:Number,required:!0},quantity:{type:Number,default:1},selected:{type:Boolean,default:!1},tags:{type:Array,default:()=>[]},attributes:{type:Array,default:()=>[]},size:{type:Number,default:1},minQuantity:{type:Number,default:null},maxQuantity:{type:Number,default:null},showImage:{type:Boolean,default:!1},option:{type:Object,default:null},isAttributes:{type:Boolean,default:!1},showAttributes:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:quantity","update:name","edit-attributes"],setup(t,{emit:i}){const n=t,r=i,o=e.ref(null),c=e.ref(0),u=e.ref(n.item),y=e.computed(()=>u.value.relationshipInfo.relationship==="Kit"?"ect-bg-green-3 ect-border-gray-200 ect-border-success":n.disabled?"ect-bg-light-bg-x ect-border-gray-200":n.selected?"ect-bg-green-3 ect-border-gray-200 ect-border-success":"ect-bg-white ect-border-gray-200 hover:ect-border-success"),x=e.computed({get:()=>n.quantity,set:d=>r("update:quantity",d)}),f=e.computed({get:()=>n.name,set:d=>r("update:name",d)}),s=d=>{r("update:quantity",d)},_=e.computed(()=>{if(c.value===0)return n.tags;const p=Math.floor(c.value/120);return n.tags.slice(0,Math.max(1,p))}),a=e.computed(()=>Math.max(0,n.tags.length-_.value.length)),h=()=>{if(o.value){const d=o.value,p=80,l=120,g=32,m=64;c.value=d.offsetWidth-p-l-g-m}};return e.onMounted(()=>{e.nextTick(()=>{h()})}),e.watch(()=>n.tags,()=>{e.nextTick(()=>{h()})},{deep:!0}),e.onMounted(()=>{window.addEventListener("resize",h)}),(d,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:o,class:e.normalizeClass(["ect-w-full ect-rounded-md ect-border-1 ect-transition-colors ect-relative",y.value]),"data-test-id":`configurator-item-${t.item.itemId}`,"data-publish-key":t.item.publishKey},[t.item.relationshipInfo.relationship==="Kit"?(e.openBlock(),e.createElementBlock("div",h1," KIT ")):e.createCommentVNode("",!0),t.size===1?(e.openBlock(),e.createElementBlock("div",p1,[t.showImage?(e.openBlock(),e.createElementBlock("div",m1,[t.imageUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.imageUrl,alt:f.value,class:"ect-w-full ect-h-full ect-object-cover"},null,8,g1)):(e.openBlock(),e.createBlock(we,{key:1,disabled:"",icon:"image",symbol:"",size:20,color:"#ACACAC"}))])):e.createCommentVNode("",!0),e.createElementVNode("div",y1,[e.createElementVNode("div",x1,[e.createVNode(Vr,{modelValue:f.value,"onUpdate:modelValue":p[0]||(p[0]=l=>f.value=l),tag:"h3","data-test-id":"itemId"+t.item.itemId,class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},null,8,["modelValue","data-test-id"]),e.createElementVNode("div",v1,[e.createElementVNode("div",{onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Qn,{value:x.value,"onUpdate:value":p[1]||(p[1]=l=>x.value=l),min:t.minQuantity,max:t.maxQuantity,"data-test-id":`configurator-item-counter-${t.item.itemId}`,onChange:s},null,8,["value","min","max","data-test-id"])]),_1,e.createElementVNode("div",b1,[e.createVNode(Vr,{modelValue:u.value.price,"onUpdate:modelValue":p[3]||(p[3]=l=>u.value.price=l),tag:"p",type:"currency","data-test-id":"itemId"+t.item.itemId,class:"ect-text-base ect-font-bold"},null,8,["modelValue","data-test-id"])]),e.createElementVNode("div",C1,[e.renderSlot(d.$slots,"selection-control",{},void 0,!0)])])]),e.createElementVNode("p",{class:"ect-mt-2 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:t.description},null,8,E1),t.isAttributes&&t.showAttributes&&t.selected?(e.openBlock(),e.createElementBlock("div",k1,[u.value.getTags().length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(l,g)=>(e.openBlock(),e.createElementBlock("span",{key:g,class:"ect-inline-block"},[e.createVNode(dt,{label:l.label,value:l.value},null,8,["label","value"])]))),128)),a.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${t.item.itemId}`,onClick:p[4]||(p[4]=e.withModifiers(()=>{},["stop"]))}," +"+e.toDisplayString(a.value)+" more ",9,w1)):e.createCommentVNode("",!0),t.selected?(e.openBlock(),e.createElementBlock("button",{key:1,"data-test-id":`configurator-item-button-edit-attributes-${t.item.itemId}`,onClick:p[5]||(p[5]=l=>r("edit-attributes"))},[e.createVNode(dt,{label:"Edit attributes","edit-button":""})],8,N1)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("span",B1,[e.createElementVNode("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:p[6]||(p[6]=l=>r("edit-attributes"))},[e.createVNode(dt,{label:"Add attributes","add-button":""})])]))])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",A1,[e.createElementVNode("div",S1,[t.showImage?(e.openBlock(),e.createElementBlock("div",O1,[t.imageUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.imageUrl,alt:t.name,class:"ect-w-full ect-h-full ect-object-cover"},null,8,I1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",T1,[e.createElementVNode("h3",V1,e.toDisplayString(t.name),1),e.createElementVNode("p",{class:"ect-mt-1 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:t.description},null,8,D1),e.createElementVNode("p",L1,e.toDisplayString(t.item.publishKey)+" :: "+e.toDisplayString(t.item.calculateRules),1)]),e.createElementVNode("div",R1,[e.renderSlot(d.$slots,"selection-control",{},void 0,!0)])]),t.isAttributes&&t.showAttributes&&t.selected?(e.openBlock(),e.createElementBlock("div",F1,[u.value.getTags().length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(l,g)=>(e.openBlock(),e.createElementBlock("span",{key:g,class:"ect-inline-block"},[e.createVNode(dt,{label:l.label,value:l.value},null,8,["label","value"])]))),128)),a.value>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${t.item.itemId}`,onClick:p[7]||(p[7]=e.withModifiers(()=>{},["stop"]))}," +"+e.toDisplayString(a.value)+" more ",9,P1)):e.createCommentVNode("",!0),t.selected?(e.openBlock(),e.createElementBlock("button",{key:1,class:"ect-ml-auto","data-test-id":`configurator-item-button-edit-attributes-${t.item.itemId}`,onClick:p[8]||(p[8]=l=>r("edit-attributes"))},[e.createVNode(dt,{label:"Edit attributes","edit-button":""})],8,M1)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("span",q1,[e.createElementVNode("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:p[9]||(p[9]=l=>r("edit-attributes"))},[e.createVNode(dt,{label:"Add attributes","add-button":""})])]))])):e.createCommentVNode("",!0),e.createElementVNode("div",$1,[e.createElementVNode("div",{onClick:p[11]||(p[11]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Qn,{value:x.value,"onUpdate:value":p[10]||(p[10]=l=>x.value=l),min:t.minQuantity,max:t.maxQuantity,"data-test-id":`configurator-item-counter-${t.item.itemId}`,onChange:s},null,8,["value","min","max","data-test-id"])]),e.createElementVNode("div",j1,[H1,e.createVNode(Vr,{modelValue:u.value.price,"onUpdate:modelValue":p[12]||(p[12]=l=>u.value.price=l),tag:"p",type:"currency","data-test-id":"itemId"+t.item.itemId,class:"ect-w-[125px] ect-text-base ect-font-bold"},null,8,["modelValue","data-test-id"])])])])),t.selected&&t.isAttributes?(e.openBlock(),e.createElementBlock("div",U1,[e.renderSlot(d.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],10,f1))}},[["__scopeId","data-v-b9675cf1"]]),X1={"af-ZA":",","sq-AL":",","ar-DZ":",","ar-BH":"٫","ar-EG":"٫","ar-IQ":"٫","ar-JO":"٫","ar-KW":"٫","ar-LB":"٫","ar-LY":",","ar-MA":",","ar-OM":"٫","ar-QA":"٫","ar-SA":"٫","ar-SD":"٫","ar-SY":"٫","ar-TN":",","ar-AE":"٫","ar-YE":"٫","hy-AM":",","az-AZ":",","bn-BD":".","bn-IN":".","eu-ES":",","be-BY":",","bs-BA":",","bg-BG":",","my-MM":".","ca-ES":",","ca-ES-EURO":",","zh-CN":".","zh-CN-PINYIN":".","zh-CN-STROKE":".","zh-HK":".","zh-HK-STROKE":".","zh-MO":".","zh-SG":".","zh-TW":".","zh-TW-STROKE":".","hr-HR":",","cs-CZ":",","da-DK":",","nl-AW":",","nl-BE":",","nl-NL":",","nl-SR":",","dz-BT":".","en-AG":".","en-AU":".","en-BS":".","en-BB":".","en-BZ":".","en-BM":".","en-BW":".","en-CM":".","en-CA":".","en-DE":",","en-KY":".","en-ER":".","en-FK":".","en-FJ":".","en-GM":".","en-GH":".","en-GI":".","en-GY":".","en-HK":".","en-IN":".","en-ID":".","en-IE":".","en-IE-EURO":".","en-JM":".","en-KE":".","en-LR":".","en-MG":".","en-MW":".","en-MY":".","en-MU":".","en-NA":".","en-NZ":".","en-NG":".","en-PK":".","en-PG":".","en-PH":".","en-RW":".","en-WS":".","en-SC":".","en-SL":".","en-SG":".","en-SX":".","en-SB":".","en-ZA":",","en-SH":".","en-SZ":".","en-TZ":".","en-TO":".","en-TT":".","en-UG":".","en-GB":".","en-US":".","en-VU":".","et-EE":",","fi-FI":",","fi-FI-EURO":",","fr-BE":",","fr-CA":",","fr-KM":",","fr-FR":",","fr-FR-EURO":",","fr-GN":",","fr-HT":",","fr-LU":",","fr-MR":",","fr-MC":",","fr-CH":",","fr-WF":",","ka-GE":",","de-AT":",","de-AT-EURO":",","de-BE":",","de-DE":",","de-DE-EURO":",","de-LU":",","de-LU-EURO":",","de-CH":".","el-GR":",","gu-IN":".","iw-IL":".","hi-IN":".","hu-HU":",","is-IS":",","in-ID":",","ga-IE":".","it-IT":",","it-CH":".","ja-JP":".","kn-IN":".","kk-KZ":",","km-KH":",","ko-KP":".","ko-KR":".","ky-KG":",","lo-LA":",","lv-LV":",","lt-LT":",","lu-CD":",","lb-LU":",","mk-MK":",","ms-BN":",","ms-MY":".","ml-IN":".","mt-MT":".","mi-NZ":".","mr-IN":".","ne-NP":".","no-NO":",","ps-AF":"٫","fa-IR":"٫","pl-PL":",","pt-AO":",","pt-BR":",","pt-CV":",","pt-MZ":",","pt-PT":",","pt-ST":",","ro-MD":",","ro-RO":",","rm-CH":".","rn-BI":",","ru-KZ":",","ru-RU":",","sr-BA":",","sr-RS":",","sh-BA":",","sh-ME":",","sh-ME-USD":",","sh-CS":",","sk-SK":",","sl-SI":",","so-DJ":".","so-SO":".","es-AR":",","es-BO":",","es-CL":",","es-CO":",","es-CR":",","es-CU":".","es-DO":".","es-EC":",","es-SV":".","es-GT":".","es-HN":".","es-MX":".","es-NI":".","es-PA":".","es-PY":",","es-PE":".","es-PR":".","es-ES":",","es-ES-EURO":",","es-US":".","es-UY":",","es-VE":",","sw-KE":".","sv-SE":",","tl-PH":".","tg-TJ":",","ta-IN":".","ta-LK":".","te-IN":".","th-TH":".","ti-ET":".","tr-TR":",","uk-UA":",","ur-PK":".","uz-LATN-UZ":",","vi-VN":",","cy-GB":".","xh-ZA":".","yo-BJ":".","zu-ZA":"."},K1={name:"CustomInput",components:{AppIcon:we},props:{editMode:{type:Boolean,default:!0},type:{type:String,default:"text"},max:{type:Number,default:500},label:{type:String,default:""},name:{type:String,default:""},showLabel:{type:Boolean,default:!0},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},highlight:{type:Boolean,default:!1},placeholder:{type:String,default:""},error:{type:[Boolean,String],default:!1},cssClass:{type:Object,default:()=>({})},tooltip:{type:String,default:null},locale:{type:String,default:"en-US"},icon:{type:String,default:null},itooltip:{type:String,default:null},icolor:{type:String,default:"#7d7d7d"},ihover:{type:String,default:"#57c046"},icustom:{type:Boolean,default:!1},idisabled:{type:Boolean,default:!1},height:{type:Number,default:32},textAlignment:{type:String,default:"left"},decimalPrecision:{type:Number,default:0},allowNegatives:{type:Boolean,default:!1},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["update:modelValue","iclick","blur"],data(){return{initialValue:"",decimalSeprator:".",ctrl:!1}},computed:{getValue(){return this.modelValue?this.type==="currency"?String(this.modelValue).replace(".",this.decimalSeprator):String(this.modelValue):""},error_message(){return typeof this.error=="string"?this.error:this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},isHighlight(){return(this.initialValue===""||this.initialValue===null)&&(this.modelValue===""||this.modelValue===null)?!1:this.initialValue!==this.modelValue}},created(){this.initialValue=this.modelValue,this.decimalSeprator=this.type==="currency"?X1[this.locale]:"."},methods:{handlerInput(t){const i=t.target.value;this.type==="currency"?this.$emit("update:modelValue",i.replace(this.decimalSeprator,".")):this.$emit("update:modelValue",i)},preventNonNumeric(t){if(this.type==="number"){const i=this.decimalPrecision,n=t.target.value,r=t.key;if(["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(r)||this.allowNegatives&&r==="-")return;if(r==="."&&i===0){t.preventDefault();return}if(r==="."&&n.includes(".")){t.preventDefault();return}if(r==="."||n.includes(".")&&!n.endsWith(".")&&r!=="Backspace"){const o=n.split(".");if(o.length>1&&o[1].length>=i){t.preventDefault();return}}if(isNaN(r)&&![".","Backspace","Tab"].includes(r)){t.preventDefault();return}}if(t.key==="Backspace"||this.ctrl)return!0;if(t.key==="Control"&&(this.ctrl=!0),this.type==="currency"||this.type==="number"){if(!this.getValue.includes(this.decimalSeprator)&&t.key===this.decimalSeprator)return!0;/[\deE+\-]/.test(t.key)||t.preventDefault()}return!0},handlerKeyup(t){t.key==="Control"&&(this.ctrl=!1)}}},Q1=["data-test-id"],Z1=["for","data-test-id"],G1=["data-test-id"],W1=["id","type","name","disabled","placeholder","value","maxlength","readonly","data-test-id"],J1=["data-test-id"],Y1=["data-test-id"];function eu(t,i,n,r,o,c){const u=e.resolveComponent("AppIcon");return e.openBlock(),e.createElementBlock("div",{class:"input","data-test-id":n.dataTestId},[n.label&&n.showLabel?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass({error_color:!!n.error}),for:n.label,"data-test-id":`${n.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(n.label)+" ",1),n.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!n.error})},"*",2)):e.createCommentVNode("",!0)],10,Z1)):e.createCommentVNode("",!0),n.editMode?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["input-wrapper ect-w-full",{errorBorder_color:!!n.error,highlight:c.isHighlight&&n.highlight}]),"data-test-id":`${n.dataTestId}-wrapper`},[n.icon?(e.openBlock(),e.createBlock(u,{key:0,class:"input-wrapper_icon",icon:n.icon,hover:n.ihover,color:n.icolor,size:19,disabled:n.idisabled,custom:n.icustom,tooltip:n.itooltip,"data-test-id":`${n.dataTestId}-icon`,direction:"top-right",onClick:i[0]||(i[0]=y=>t.$emit("iclick"))},null,8,["icon","hover","color","disabled","custom","tooltip","data-test-id"])):e.createCommentVNode("",!0),e.createElementVNode("input",{id:n.label,class:e.normalizeClass(`ectheme-input-box ${n.size}`),type:n.type,style:e.normalizeStyle({width:n.icon?"calc(100% - 36px)":"100%",height:`${n.height}px`,textAlign:n.textAlignment}),name:n.name,disabled:n.disabled,placeholder:n.placeholder,value:c.getValue,maxlength:n.max,readonly:n.isReadOnly,"data-test-id":`${n.dataTestId}-input`,onInput:i[1]||(i[1]=(...y)=>c.handlerInput&&c.handlerInput(...y)),onKeydown:i[2]||(i[2]=(...y)=>c.preventNonNumeric&&c.preventNonNumeric(...y)),onKeyup:i[3]||(i[3]=(...y)=>c.handlerKeyup&&c.handlerKeyup(...y)),onBlur:i[4]||(i[4]=y=>t.$emit("blur"))},null,46,W1)],10,G1)):e.createCommentVNode("",!0),n.editMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",{key:2,class:"value","data-test-id":`${n.dataTestId}-value`},e.toDisplayString(c.getValue),9,J1)),c.error_message?(e.openBlock(),e.createElementBlock("div",{key:3,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},e.toDisplayString(c.error_message),9,Y1)):e.createCommentVNode("",!0)],8,Q1)}const tu=ye(K1,[["render",eu],["__scopeId","data-v-032ca141"]]),nu={name:"AtomSpinner",props:{dataTestId:{type:String,default:""}}},ru=["data-test-id"];function ou(t,i,n,r,o,c){return e.openBlock(),e.createElementBlock("div",{class:"spinner","data-test-id":n.dataTestId},null,8,ru)}const au={name:"CustomDropdown",components:{AppIcon:we,AtomSpinner:ye(nu,[["render",ou],["__scopeId","data-v-771ed032"]])},props:{label:{type:String,default:""},placeholder:{type:String,default:""},options:{type:Array,default:()=>[]},display:{type:Array,default:()=>[]},modelValue:{type:String,default:""},error:{type:[Boolean,String],default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},select:{type:Boolean,default:!1},lookup:{type:Boolean,default:!1},search:{type:Boolean,default:!1},badge:{type:String,default:void 0},highlight:{type:Boolean,default:!1},property:{type:Object,default:()=>({key:"value",value:"label",assigned:"assigned"})},dropdownTheme:{type:String,default:"light"},icon:{type:String,default:""},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["search","focus-in","focus-out","update:modelValue"],data:()=>({inputFocused:!1,value:"",isHover:!1,highlightedIndex:-1,initialValue:"",teleportStyle:{position:"absolute",top:"0px",left:"0px",width:"0px"}}),computed:{isHighlight(){return(this.initialValue===""||this.initialValue==null)&&(this.modelValue===""||this.modelValue==null)?!1:this.initialValue!==this.modelValue},error_message(){return this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},getOptions(){if(this.select&&this.search){const t=this.value.toLowerCase();return this.options.filter(i=>JSON.stringify(i).toLowerCase().includes(t))}else return this.options},getSelected(){let t=null;if(this.modelValue)t=this.options.find(i=>i[this.property.key]===this.modelValue);else if(!this.search){const i=this.options.find(n=>n[this.property.key]==="");i?t=i:this.placeholder?t={[this.property.value]:this.placeholder,[this.property.key]:""}:t={[this.property.value]:"--Select--",[this.property.key]:""}}return t||{[this.property.value]:this.placeholder||"--Select--",[this.property.key]:""}},shouldShowAbove(){if(!this.$refs.triggerElement)return!1;const t=this.$refs.triggerElement.getBoundingClientRect(),i=250,n=window.innerHeight-t.bottom,r=t.top;return n<i&&r>i},dropdownStyle(){if(!this.$refs.triggerElement)return{};const t=this.$refs.triggerElement.getBoundingClientRect(),i=250,n=window.innerHeight-t.bottom,r=t.top,o=n<i&&r>i;return{position:"absolute",top:o?"auto":"100%",bottom:o?"100%":"auto",left:"0",width:"100%",zIndex:1e3}}},created(){this.initialValue=this.modelValue},mounted(){window.addEventListener("resize",this.updateDropdownPosition),window.addEventListener("scroll",this.updateDropdownPosition,!0)},beforeUnmount(){window.removeEventListener("resize",this.updateDropdownPosition),window.removeEventListener("scroll",this.updateDropdownPosition,!0)},methods:{updateDropdownPosition(){if(!this.$refs.triggerElement)return;const t=this.$refs.triggerElement.getBoundingClientRect(),i=200,n=window.innerHeight-t.bottom,r=t.top,o=n<i&&r>i;this.teleportStyle={position:"absolute",top:`${o?t.top-i:t.bottom}px`,left:`${t.left}px`,width:`${t.width}px`,zIndex:9999}},subFieldsText(t){if(!this.display||this.display.length<1)return"";const i=[];return this.display.forEach(n=>{const r=this.subField(t,n);r&&i.push(r)}),i.join(" | ")},subField(t,i){return i?i.split(".").reduce((o,c)=>o[c]||"",t):t},lookupSearchHandler:Vt(function(t){this.value=t,this.search&&!this.select&&this.$emit("search",t)}),handlerFocusIn(){!(this.modelValue&&this.search)&&!this.disabled&&(this.inputFocused=!0,this.updateDropdownPosition(),this.$emit("focus-in"))},updateSelected(t){t&&(this.value="",this.$emit("update:modelValue",t[this.property.key]),this.search&&!this.select&&!this.lookup&&this.$emit("search",""),this.onInputFocusedOut(!0))},clear(){this.disabled||(this.value="",this.$emit("update:modelValue",null),this.search&&!this.select&&!this.lookup&&this.$emit("search",""))},onInputFocusedOut(t=!1){(!this.isHover||t)&&!this.disabled&&(t?(this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")):setTimeout(()=>{this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")},100))},highlightNextOption(){this.highlightedIndex<this.options.length-1&&this.highlightedIndex++},highlightPreviousOption(){this.highlightedIndex>0&&this.highlightedIndex--}}},iu=["data-test-id"],lu=["for","data-test-id"],su={class:"input-container-box ect-grow ect-w-full"},cu=["data-test-id"],du=["placeholder","disabled","data-test-id"],uu=["data-test-id"],fu=["title","data-test-id"],hu=["data-test-id"],pu=["data-test-id"],mu=["data-test-id"],gu=["data-test-id"],yu=["data-test-id","onClick"],xu=["data-test-id"],vu={class:"ect-text-font-clr-light ect-flex ect-gap-2 ect-items-center ect-justify-between ect-w-full"},_u=["data-test-id"],bu=["data-test-id"],Cu=["data-test-id"],Eu=["title","data-test-id"],ku=["data-test-id"];function wu(t,i,n,r,o,c){const u=e.resolveComponent("AppIcon"),y=e.resolveComponent("AtomSpinner");return e.openBlock(),e.createElementBlock("div",{ref:"dropdownWrapper",class:e.normalizeClass(["customdropdown input-container",{dark:n.dropdownTheme==="dark"}]),"data-test-id":n.dataTestId,onMouseenter:i[7]||(i[7]=x=>t.isHover=!0),onMouseleave:i[8]||(i[8]=x=>t.isHover=!1)},[n.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(["title_label",{error_color:!!n.error}]),for:n.label,"data-test-id":`${n.dataTestId}-label`},[e.createTextVNode(e.toDisplayString(n.label)+" ",1),n.required?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass({error_color:!!n.error})},"*",2)):e.createCommentVNode("",!0)],10,lu)):e.createCommentVNode("",!0),e.createElementVNode("div",su,[e.createElementVNode("div",{ref:"triggerElement",class:e.normalizeClass(["input-wrapper ectheme-input-box ect-w-full",{disabled:n.disabled,"input-error":n.error,highlight:c.isHighlight&&n.highlight,"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-trigger`,tabindex:"0",onFocusin:i[2]||(i[2]=(...x)=>c.handlerFocusIn&&c.handlerFocusIn(...x)),onFocusout:i[3]||(i[3]=x=>c.onInputFocusedOut(!1)),onKeydown:[i[4]||(i[4]=e.withKeys(x=>c.updateSelected(n.options[t.highlightedIndex]),["enter"])),i[5]||(i[5]=e.withKeys(e.withModifiers((...x)=>c.highlightPreviousOption&&c.highlightPreviousOption(...x),["prevent"]),["up"])),i[6]||(i[6]=e.withKeys(e.withModifiers((...x)=>c.highlightNextOption&&c.highlightNextOption(...x),["prevent"]),["down"]))]},[!n.modelValue&&n.search?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref:"searchInput","onUpdate:modelValue":i[0]||(i[0]=x=>t.value=x),type:"text",name:"search",placeholder:n.placeholder,autocomplete:"off",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-input`,onInput:i[1]||(i[1]=e.withModifiers(x=>c.lookupSearchHandler(x.target.value),["prevent"]))},null,40,du)),[[e.vModelText,t.value]]):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["selection-name ect-text-text-primary-dark ect-flex ect-justify-between ect-items-center",{"size-large":n.size==="large","size-medium":n.size==="medium"||n.size==="small"}]),"data-test-id":`${n.dataTestId}-selection`},[c.getSelected?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{title:c.getSelected[n.property.value],class:e.normalizeClass(["ect-flex ect-items-center ect-gap-2 ect-font-medium",{"ect-text-font-clr-light":!n.modelValue}]),"data-test-id":`${n.dataTestId}-selection-value`},[n.icon?(e.openBlock(),e.createBlock(u,{key:0,class:"ect-mr-0",icon:n.icon,size:14,color:"#5F5F5F","data-test-id":`${n.dataTestId}-selection-icon`},null,8,["icon","data-test-id"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(c.getSelected[n.property.value]),1)],10,fu),n.badge&&c.getSelected[n.badge]?(e.openBlock(),e.createElementBlock("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-selection-badge`},e.toDisplayString(c.getSelected[n.badge]),9,hu)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],10,uu)),n.search?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n.loading?(e.openBlock(),e.createBlock(y,{key:0,class:"spinner","data-test-id":`${n.dataTestId}-loading-spinner`},null,8,["data-test-id"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"clear-button","data-test-id":`${n.dataTestId}-action-button`},[t.value||n.modelValue?(e.openBlock(),e.createBlock(u,{key:0,disabled:n.disabled,icon:"close",color:"#acacac",size:10,"data-test-id":`${n.dataTestId}-clear-button`,onClick:c.clear},null,8,["disabled","data-test-id","onClick"])):(e.openBlock(),e.createBlock(u,{key:1,icon:"search",size:14,color:"#acacac",disabled:n.disabled,"data-test-id":`${n.dataTestId}-search-button`},null,8,["disabled","data-test-id"]))],8,pu))],64)):(e.openBlock(),e.createBlock(u,{key:3,class:"clear-button",color:c.error_message?"#ff6a6a":"#acacac",icon:"arrow_drop_up",size:12,disabled:n.disabled,"data-test-id":`${n.dataTestId}-dropdown-arrow`},null,8,["color","disabled","data-test-id"]))],42,cu),c.error_message?(e.openBlock(),e.createElementBlock("div",{key:0,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${n.dataTestId}-error`},e.toDisplayString(c.error_message),9,mu)):e.createCommentVNode("",!0),c.getOptions&&t.inputFocused&&!n.disabled&&(n.select||n.lookup)?(e.openBlock(),e.createElementBlock("div",{key:1,ref:"dropdown",class:e.normalizeClass(["dropdown",{"dropdown-above":c.shouldShowAbove}]),style:e.normalizeStyle(c.dropdownStyle),"data-test-id":`${n.dataTestId}-dropdown`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.getOptions,(x,f)=>(e.openBlock(),e.createElementBlock("div",{key:x[n.property.key],class:e.normalizeClass(["dropdown-item",{highlighted:f===t.highlightedIndex,"ect-pointer-events-none":x[n.property.assigned]}]),"data-test-id":`${n.dataTestId}-option-${f}`,onClick:s=>c.updateSelected(x)},[e.createElementVNode("div",{class:"name ect-items-center","data-test-id":`${n.dataTestId}-option-${f}-name`},[e.createElementVNode("span",vu,[e.createElementVNode("span",{class:e.normalizeClass({"ect-text-zinc-400":x[n.property.assigned]}),"data-test-id":`${n.dataTestId}-option-${f}-value`},e.toDisplayString(x[n.property.value]==null?"Key and Value is Wrong":x[n.property.value]),11,_u),x[n.property.assigned]?(e.openBlock(),e.createElementBlock("span",{key:0,class:"ect-text-xs ect-leading-4 ect-text-zinc-600","data-test-id":`${n.dataTestId}-option-${f}-assigned`},"Assigned",8,bu)):e.createCommentVNode("",!0)]),n.badge?(e.openBlock(),e.createElementBlock("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${n.dataTestId}-option-${f}-badge`},e.toDisplayString(x[n.badge]),9,Cu)):e.createCommentVNode("",!0)],8,xu),e.createElementVNode("div",{class:"info",title:c.subFieldsText(x),"data-test-id":`${n.dataTestId}-option-${f}-info`},[e.createElementVNode("span",null,e.toDisplayString(c.subFieldsText(x)),1)],8,Eu)],10,yu))),128)),!c.getOptions.length&&!n.loading&&(t.value||n.select)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"no-items-found","data-test-id":`${n.dataTestId}-no-options`}," no options found ",8,ku)):e.createCommentVNode("",!0)],14,gu)):e.createCommentVNode("",!0)])],42,iu)}const ui=ye(au,[["render",wu],["__scopeId","data-v-5ae4f6dc"]]);var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Nu(t){if(t.__esModule)return t;var i=t.default;if(typeof i=="function"){var n=function r(){return this instanceof r?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};n.prototype=i.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var fi={exports:{}};/*!
|
|
11
11
|
* Quill Editor v1.3.7
|
|
12
12
|
* https://quilljs.com/
|
|
13
13
|
* Copyright (c) 2014, Jason Chen
|
|
@@ -10741,6 +10741,7 @@ const xn = Et("comConfigurator", () => {
|
|
|
10741
10741
|
if (!s.value)
|
|
10742
10742
|
return {};
|
|
10743
10743
|
const M = (z) => !z || !Array.isArray(z) ? [] : z.map((F) => ({
|
|
10744
|
+
label: F.label,
|
|
10744
10745
|
field: F.apiName,
|
|
10745
10746
|
dataType: F.dataType,
|
|
10746
10747
|
picklistValues: F.picklistValues,
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...t){const r=new this(n);return t.forEach(i=>r.set(i)),r}static accessor(n){const r=(this[h0]=this[h0]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=vi(a);r[s]||(N9(i,a),r[s]=!0)}return de.isArray(n)?n.forEach(o):o(n),this}}Ao.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),de.reduceDescriptors(Ao.prototype,({value:e},n)=>{let t=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(r){this[t]=r}}}),de.freezeMethods(Ao);const Jt=Ao;function as(e,n){const t=this||is,r=n||t,i=Jt.from(r.headers);let o=r.data;return de.forEach(e,function(s){o=s.call(t,o,i.normalize(),n?n.status:void 0)}),i.normalize(),o}function p0(e){return!!(e&&e.__CANCEL__)}function Pr(e,n,t){Le.call(this,e??"canceled",Le.ERR_CANCELED,n,t),this.name="CanceledError"}de.inherits(Pr,Le,{__CANCEL__:!0});function v0(e,n,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?e(t):n(new Le("Request failed with status code "+t.status,[Le.ERR_BAD_REQUEST,Le.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function F9(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}function P9(e,n){e=e||10;const t=new Array(e),r=new Array(e);let i=0,o=0,a;return n=n!==void 0?n:1e3,function(u){const f=Date.now(),c=r[o];a||(a=f),t[i]=u,r[i]=f;let v=o,l=0;for(;v!==i;)l+=t[v++],v=v%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),f-a<n)return;const h=c&&f-c;return h?Math.round(l*1e3/h):void 0}}function M9(e,n){let t=0,r=1e3/n,i,o;const a=(f,c=Date.now())=>{t=c,i=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const c=Date.now(),v=c-t;v>=r?a(f,c):(i=f,o||(o=setTimeout(()=>{o=null,a(i)},r-v)))},()=>i&&a(i)]}const ko=(e,n,t=3)=>{let r=0;const i=P9(50,250);return M9(o=>{const a=o.loaded,s=o.lengthComputable?o.total:void 0,u=a-r,f=i(u),c=a<=s;r=a;const v={loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:f||void 0,estimated:f&&s&&c?(s-a)/f:void 0,event:o,lengthComputable:s!=null,[n?"download":"upload"]:!0};e(v)},t)},g0=(e,n)=>{const t=e!=null;return[r=>n[0]({lengthComputable:t,total:e,loaded:r}),n[1]]},m0=e=>(...n)=>de.asap(()=>e(...n)),q9=yt.hasStandardBrowserEnv?((e,n)=>t=>(t=new URL(t,yt.origin),e.protocol===t.protocol&&e.host===t.host&&(n||e.port===t.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0,$9=yt.hasStandardBrowserEnv?{write(e,n,t,r,i,o,a){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(n)}`];de.isNumber(t)&&s.push(`expires=${new Date(t).toUTCString()}`),de.isString(r)&&s.push(`path=${r}`),de.isString(i)&&s.push(`domain=${i}`),o===!0&&s.push("secure"),de.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function j9(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function H9(e,n){return n?e.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):e}function y0(e,n,t){let r=!j9(n);return e&&(r||t==!1)?H9(e,n):n}const x0=e=>e instanceof Jt?{...e}:e;function lr(e,n){n=n||{};const t={};function r(f,c,v,l){return de.isPlainObject(f)&&de.isPlainObject(c)?de.merge.call({caseless:l},f,c):de.isPlainObject(c)?de.merge({},c):de.isArray(c)?c.slice():c}function i(f,c,v,l){if(de.isUndefined(c)){if(!de.isUndefined(f))return r(void 0,f,v,l)}else return r(f,c,v,l)}function o(f,c){if(!de.isUndefined(c))return r(void 0,c)}function a(f,c){if(de.isUndefined(c)){if(!de.isUndefined(f))return r(void 0,f)}else return r(void 0,c)}function s(f,c,v){if(v in n)return r(f,c);if(v in e)return r(void 0,f)}const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(f,c,v)=>i(x0(f),x0(c),v,!0)};return de.forEach(Object.keys({...e,...n}),function(c){const v=u[c]||i,l=v(e[c],n[c],c);de.isUndefined(l)&&v!==s||(t[c]=l)}),t}const _0=e=>{const n=lr({},e);let{data:t,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:s}=n;if(n.headers=a=Jt.from(a),n.url=c0(y0(n.baseURL,n.url,n.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),de.isFormData(t)){if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(de.isFunction(t.getHeaders)){const u=t.getHeaders(),f=["content-type","content-length"];Object.entries(u).forEach(([c,v])=>{f.includes(c.toLowerCase())&&a.set(c,v)})}}if(yt.hasStandardBrowserEnv&&(r&&de.isFunction(r)&&(r=r(n)),r||r!==!1&&q9(n.url))){const u=i&&o&&$9.read(o);u&&a.set(i,u)}return n},V9=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(t,r){const i=_0(e);let o=i.data;const a=Jt.from(i.headers).normalize();let{responseType:s,onUploadProgress:u,onDownloadProgress:f}=i,c,v,l,h,p;function g(){h&&h(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let d=new XMLHttpRequest;d.open(i.method.toUpperCase(),i.url,!0),d.timeout=i.timeout;function m(){if(!d)return;const _=Jt.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),b={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:_,config:e,request:d};v0(function(A){t(A),g()},function(A){r(A),g()},b),d=null}"onloadend"in d?d.onloadend=m:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(m)},d.onabort=function(){d&&(r(new Le("Request aborted",Le.ECONNABORTED,e,d)),d=null)},d.onerror=function(x){const b=x&&x.message?x.message:"Network Error",S=new Le(b,Le.ERR_NETWORK,e,d);S.event=x||null,r(S),d=null},d.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||f0;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),r(new Le(x,b.clarifyTimeoutError?Le.ETIMEDOUT:Le.ECONNABORTED,e,d)),d=null},o===void 0&&a.setContentType(null),"setRequestHeader"in d&&de.forEach(a.toJSON(),function(x,b){d.setRequestHeader(b,x)}),de.isUndefined(i.withCredentials)||(d.withCredentials=!!i.withCredentials),s&&s!=="json"&&(d.responseType=i.responseType),f&&([l,p]=ko(f,!0),d.addEventListener("progress",l)),u&&d.upload&&([v,h]=ko(u),d.upload.addEventListener("progress",v),d.upload.addEventListener("loadend",h)),(i.cancelToken||i.signal)&&(c=_=>{d&&(r(!_||_.type?new Pr(null,e,d):_),d.abort(),d=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const y=F9(i.url);if(y&&yt.protocols.indexOf(y)===-1){r(new Le("Unsupported protocol "+y+":",Le.ERR_BAD_REQUEST,e));return}d.send(o||null)})},U9=(e,n)=>{const{length:t}=e=e?e.filter(Boolean):[];if(n||t){let r=new AbortController,i;const o=function(f){if(!i){i=!0,s();const c=f instanceof Error?f:this.reason;r.abort(c instanceof Le?c:new Pr(c instanceof Error?c.message:c))}};let a=n&&setTimeout(()=>{a=null,o(new Le(`timeout ${n} of ms exceeded`,Le.ETIMEDOUT))},n);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:u}=r;return u.unsubscribe=()=>de.asap(s),u}},z9=function*(e,n){let t=e.byteLength;if(!n||t<n){yield e;return}let r=0,i;for(;r<t;)i=r+n,yield e.slice(r,i),r=i},K9=async function*(e,n){for await(const t of X9(e))yield*z9(t,n)},X9=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const n=e.getReader();try{for(;;){const{done:t,value:r}=await n.read();if(t)break;yield r}}finally{await n.cancel()}},b0=(e,n,t,r)=>{const i=K9(e,n);let o=0,a,s=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:f,value:c}=await i.next();if(f){s(),u.close();return}let v=c.byteLength;if(t){let l=o+=v;t(l)}u.enqueue(new Uint8Array(c))}catch(f){throw s(f),f}},cancel(u){return s(u),i.return()}},{highWaterMark:2})},C0=64*1024,{isFunction:Oo}=de,W9=(({Request:e,Response:n})=>({Request:e,Response:n}))(de.global),{ReadableStream:w0,TextEncoder:E0}=de.global,A0=(e,...n)=>{try{return!!e(...n)}catch{return!1}},G9=e=>{e=de.merge.call({skipUndefined:!0},W9,e);const{fetch:n,Request:t,Response:r}=e,i=n?Oo(n):typeof fetch=="function",o=Oo(t),a=Oo(r);if(!i)return!1;const s=i&&Oo(w0),u=i&&(typeof E0=="function"?(p=>g=>p.encode(g))(new E0):async p=>new Uint8Array(await new t(p).arrayBuffer())),f=o&&s&&A0(()=>{let p=!1;const g=new t(yt.origin,{body:new w0,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),c=a&&s&&A0(()=>de.isReadableStream(new r("").body)),v={stream:c&&(p=>p.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!v[p]&&(v[p]=(g,d)=>{let m=g&&g[p];if(m)return m.call(g);throw new Le(`Response type '${p}' is not supported`,Le.ERR_NOT_SUPPORT,d)})});const l=async p=>{if(p==null)return 0;if(de.isBlob(p))return p.size;if(de.isSpecCompliantForm(p))return(await new t(yt.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(de.isArrayBufferView(p)||de.isArrayBuffer(p))return p.byteLength;if(de.isURLSearchParams(p)&&(p=p+""),de.isString(p))return(await u(p)).byteLength},h=async(p,g)=>{const d=de.toFiniteNumber(p.getContentLength());return d??l(g)};return async p=>{let{url:g,method:d,data:m,signal:y,cancelToken:_,timeout:x,onDownloadProgress:b,onUploadProgress:S,responseType:A,headers:I,withCredentials:B="same-origin",fetchOptions:O}=_0(p),E=n||fetch;A=A?(A+"").toLowerCase():"text";let k=U9([y,_&&_.toAbortSignal()],x),R=null;const N=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let q;try{if(S&&f&&d!=="get"&&d!=="head"&&(q=await h(I,m))!==0){let w=new t(g,{method:"POST",body:m,duplex:"half"}),D;if(de.isFormData(m)&&(D=w.headers.get("content-type"))&&I.setContentType(D),w.body){const[L,$]=g0(q,ko(m0(S)));m=b0(w.body,C0,L,$)}}de.isString(B)||(B=B?"include":"omit");const G=o&&"credentials"in t.prototype,Y={...O,signal:k,method:d.toUpperCase(),headers:I.normalize().toJSON(),body:m,duplex:"half",credentials:G?B:void 0};R=o&&new t(g,Y);let ne=await(o?E(R,O):E(g,Y));const Q=c&&(A==="stream"||A==="response");if(c&&(b||Q&&N)){const w={};["status","statusText","headers"].forEach(W=>{w[W]=ne[W]});const D=de.toFiniteNumber(ne.headers.get("content-length")),[L,$]=b&&g0(D,ko(m0(b),!0))||[];ne=new r(b0(ne.body,C0,L,()=>{$&&$(),N&&N()}),w)}A=A||"text";let P=await v[de.findKey(v,A)||"text"](ne,p);return!Q&&N&&N(),await new Promise((w,D)=>{v0(w,D,{data:P,headers:Jt.from(ne.headers),status:ne.status,statusText:ne.statusText,config:p,request:R})})}catch(G){throw N&&N(),G&&G.name==="TypeError"&&/Load failed|fetch/i.test(G.message)?Object.assign(new Le("Network Error",Le.ERR_NETWORK,p,R),{cause:G.cause||G}):Le.from(G,G&&G.code,p,R)}}},Q9=new Map,k0=e=>{let n=e&&e.env||{};const{fetch:t,Request:r,Response:i}=n,o=[r,i,t];let a=o.length,s=a,u,f,c=Q9;for(;s--;)u=o[s],f=c.get(u),f===void 0&&c.set(u,f=s?new Map:G9(n)),c=f;return f};k0();const ss={http:y9,xhr:V9,fetch:{get:k0}};de.forEach(ss,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{value:n})}catch{}Object.defineProperty(e,"adapterName",{value:n})}});const O0=e=>`- ${e}`,Z9=e=>de.isFunction(e)||e===null||e===!1;function J9(e,n){e=de.isArray(e)?e:[e];const{length:t}=e;let r,i;const o={};for(let a=0;a<t;a++){r=e[a];let s;if(i=r,!Z9(r)&&(i=ss[(s=String(r)).toLowerCase()],i===void 0))throw new Le(`Unknown adapter '${s}'`);if(i&&(de.isFunction(i)||(i=i.get(n))))break;o[s||"#"+a]=i}if(!i){const a=Object.entries(o).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let s=t?a.length>1?`since :
|
|
31
31
|
`+a.map(O0).join(`
|
|
32
32
|
`):" "+O0(a[0]):"as no adapter specified";throw new Le("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const S0={getAdapter:J9,adapters:ss};function ls(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pr(null,e)}function I0(e){return ls(e),e.headers=Jt.from(e.headers),e.data=as.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),S0.getAdapter(e.adapter||is.adapter,e)(e).then(function(r){return ls(e),r.data=as.call(e,e.transformResponse,r),r.headers=Jt.from(r.headers),r},function(r){return p0(r)||(ls(e),r&&r.response&&(r.response.data=as.call(e,e.transformResponse,r.response),r.response.headers=Jt.from(r.response.headers))),Promise.reject(r)})}const T0="1.13.2",So={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{So[e]=function(r){return typeof r===e||"a"+(n<1?"n ":" ")+e}});const B0={};So.transitional=function(n,t,r){function i(o,a){return"[Axios v"+T0+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,s)=>{if(n===!1)throw new Le(i(a," has been removed"+(t?" in "+t:"")),Le.ERR_DEPRECATED);return t&&!B0[a]&&(B0[a]=!0,console.warn(i(a," has been deprecated since v"+t+" and will be removed in the near future"))),n?n(o,a,s):!0}},So.spelling=function(n){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${n}`),!0)};function Y9(e,n,t){if(typeof e!="object")throw new Le("options must be an object",Le.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=n[o];if(a){const s=e[o],u=s===void 0||a(s,o,e);if(u!==!0)throw new Le("option "+o+" must be "+u,Le.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Le("Unknown option "+o,Le.ERR_BAD_OPTION)}}const Io={assertOptions:Y9,validators:So},fn=Io.validators;class To{constructor(n){this.defaults=n||{},this.interceptors={request:new u0,response:new u0}}async request(n,t){try{return await this._request(n,t)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
33
|
-
`+o):r.stack=o}catch{}}throw r}}_request(n,t){typeof n=="string"?(t=t||{},t.url=n):t=n||{},t=lr(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:o}=t;r!==void 0&&Io.assertOptions(r,{silentJSONParsing:fn.transitional(fn.boolean),forcedJSONParsing:fn.transitional(fn.boolean),clarifyTimeoutError:fn.transitional(fn.boolean)},!1),i!=null&&(de.isFunction(i)?t.paramsSerializer={serialize:i}:Io.assertOptions(i,{encode:fn.function,serialize:fn.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Io.assertOptions(t,{baseUrl:fn.spelling("baseURL"),withXsrfToken:fn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&de.merge(o.common,o[t.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),t.headers=Jt.concat(a,o);const s=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(u=u&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const f=[];this.interceptors.response.forEach(function(g){f.push(g.fulfilled,g.rejected)});let c,v=0,l;if(!u){const p=[I0.bind(this),void 0];for(p.unshift(...s),p.push(...f),l=p.length,c=Promise.resolve(t);v<l;)c=c.then(p[v++],p[v++]);return c}l=s.length;let h=t;for(;v<l;){const p=s[v++],g=s[v++];try{h=p(h)}catch(d){g.call(this,d);break}}try{c=I0.call(this,h)}catch(p){return Promise.reject(p)}for(v=0,l=f.length;v<l;)c=c.then(f[v++],f[v++]);return c}getUri(n){n=lr(this.defaults,n);const t=y0(n.baseURL,n.url,n.allowAbsoluteUrls);return c0(t,n.params,n.paramsSerializer)}}de.forEach(["delete","get","head","options"],function(n){To.prototype[n]=function(t,r){return this.request(lr(r||{},{method:n,url:t,data:(r||{}).data}))}}),de.forEach(["post","put","patch"],function(n){function t(r){return function(o,a,s){return this.request(lr(s||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}To.prototype[n]=t(),To.prototype[n+"Form"]=t(!0)});const Bo=To;class cs{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},n(function(o,a,s){r.reason||(r.reason=new Pr(o,a,s),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const t=this._listeners.indexOf(n);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const n=new AbortController,t=r=>{n.abort(r)};return this.subscribe(t),n.signal.unsubscribe=()=>this.unsubscribe(t),n.signal}static source(){let n;return{token:new cs(function(i){n=i}),cancel:n}}}const e4=cs;function t4(e){return function(t){return e.apply(null,t)}}function n4(e){return de.isObject(e)&&e.isAxiosError===!0}const us={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(us).forEach(([e,n])=>{us[n]=e});const r4=us;function D0(e){const n=new Bo(e),t=Wu(Bo.prototype.request,n);return de.extend(t,Bo.prototype,n,{allOwnKeys:!0}),de.extend(t,n,null,{allOwnKeys:!0}),t.create=function(i){return D0(lr(e,i))},t}const Ge=D0(is);Ge.Axios=Bo,Ge.CanceledError=Pr,Ge.CancelToken=e4,Ge.isCancel=p0,Ge.VERSION=T0,Ge.toFormData=wo,Ge.AxiosError=Le,Ge.Cancel=Ge.CanceledError,Ge.all=function(n){return Promise.all(n)},Ge.spread=t4,Ge.isAxiosError=n4,Ge.mergeConfig=lr,Ge.AxiosHeaders=Jt,Ge.formToJSON=e=>d0(de.isHTMLForm(e)?new FormData(e):e),Ge.getAdapter=S0.getAdapter,Ge.HttpStatusCode=r4,Ge.default=Ge;class i4{constructor(n,t,r,i){this.awsURL="https://ec-apigw.blink.expedite1.com",this.headers={"x-api-key":n,"X-Salesforce-Org-Type":t,"X-Salesforce-Org-Id":r,"X-Salesforce-User-Id":i,"Content-Type":"application/json"}}}const R0=wt("comShare",()=>{const e=te(""),n=te(""),t=te(""),r=te(""),i=te(""),o=te(""),a=te(""),s=te("Single"),u=me(()=>s.value==="Single");async function f(c){e.value=c.orgType||"Production",n.value=c.orgId||"",t.value=c.userId||"",r.value=c.accountId||"",i.value=c.opportunityId||"",a.value=c.userLocale||"en_US",s.value=c.pricingSchema||"Single"}return{orgType:e,orgId:n,userId:t,accountId:r,opportunityId:i,userLocale:a,pricingSchema:s,quoteId:o,isSinglePricingSchema:u,setSetupData:f}});function o4(e){return e.offerData.pricingTypes.forEach(n=>{n.appliedOnField==="Catalog Price"?(e.catalogPrice=n,e.salesPrice=n.offerPrice,e.price=n.offerPrice):n.appliedOnField==="MRC"?(e.mrcPrice=n,e.mrc=n.offerPrice):n.appliedOnField==="YRC"&&(e.yrcPrice=n,e.yrc=n.offerPrice)}),e}function a4(e){const n=t=>Math.min(...t.options.map(r=>r.relationshipInfo.primarySortOrder));return e.forEach(t=>{t.itemTypes.forEach(r=>{r.options.sort((i,o)=>i.relationshipInfo.primarySortOrder-o.relationshipInfo.primarySortOrder||i.itemName.localeCompare(o.itemName))}),t.itemTypes.sort((r,i)=>n(r)-n(i)||r.itemTypeName.localeCompare(i.itemTypeName))}),e.sort((t,r)=>{const i=Math.min(...t.itemTypes.map(n)),o=Math.min(...r.itemTypes.map(n));return i-o||t.category.localeCompare(r.category)}),e}const s4=(e,n)=>{const t=(r,i)=>typeof i=="function"?void 0:i;return JSON.stringify(e,t)===JSON.stringify(n,t)};class l4 extends i4{constructor(n,t,r,i){super(n,t,r,i)}async getAvailableConfiguration(n){return(await Ge.post(`${this.awsURL}/product-pricing/getAvailableConfiguration`,n,{headers:this.headers})).data}async getLineItems({request:n}){const t=await Ge.post(`${this.awsURL}/quoting/getConfiguredLineItems`,n,{headers:this.headers});return console.info("getLineItems:response",t.data),t.data}async maintainQuoteConfiguration({request:n}){const t=await Ge.post(`${this.awsURL}/transactions/maintainConfiguration`,n,{headers:this.headers});return console.info("maintainQuoteConfiguration:response",t.data),t.data}async getProductCrossSells({objectId:n,productItemId:t}){const r=await Ge.get(`${this.awsURL}/pricing/getProductCrossSells?productItemId=${t}&objectId=${n}`,{headers:this.headers});return console.info("getProductCrossSells:response",r.data),r.data}async addLines({request:n}){const t=await Ge.post(`${this.awsURL}/transactions/addLines`,n,{headers:this.headers});return console.info("addLines:response",t.data),t.data}async evaluateConfigurationSelection({request:n}){const t=await Ge.post("https://api-svc.blink.expedite1.com/api/product-pricing/evaluateConfigurationSelection",n,{headers:this.headers});return console.info("evaluateConfigurationSelection:response",t.data),t.data}}const dn=wt("comConfigurator",()=>{const e=te(null),n=Qt(),t=R0(),r=fi(),i=te(null),o=te(null),a=te(null),s=te(null),u=te(null),f=te([]),c=te(null),v=te([]),l=te([]),h=te(null),p=te(new Map),g=te(!1),d=te({init:!1,configuration:!1,lineItem:!1,productOptionsPricing:!1,bestOfferPrice:!1,lineItemAttributes:!1,save:!1}),m=te(!1),y=me(()=>_.value&&!t.isSinglePricingSchema),_=me(()=>{var j;if(!s.value||!((j=s.value.categoryOptions)!=null&&j.length)>0)return!1;let M=!0,U=!0,Z=!0,z=null,F=!1;for(const se of s.value.categoryOptions)for(const fe of se.itemTypes)for(const ce of fe.options)ce.billingPeriod&&(z&&z!==ce.billingPeriod&&(Z=!1),z=ce.billingPeriod,!ce.yrcPrice&&ce.billingPeriod==="Monthly"&&(M=!1),!ce.mrcPrice&&ce.billingPeriod==="Yearly"&&(U=!1),F=!0);return M&&U&&Z&&F}),x=me(()=>!s4(s.value,u.value)),b=me(()=>{var U;const M=((U=s.value)==null?void 0:U.categoryOptions)||[];return M.forEach(Z=>{Z.itemTypes.forEach(z=>{z.selectedOptions=z.options.filter(F=>z.selected.includes(F.itemId)),z.totalPrice=function(){return z.selectedOptions.reduce((F,j)=>F+j.price*j.qty,0)||0},z.oneTimePrice=function(){return z.selectedOptions.filter(F=>!F.billingPeriod).reduce((F,j)=>F+j.price*j.qty,0)||0},z.recurringPrice=function(){return z.selectedOptions.filter(F=>F.billingPeriod).reduce((F,j)=>F+j.price*j.qty,0)||0}}),Z.selectedItemTypes=Z.itemTypes.filter(z=>z.selected.length>0),Z.totalPrice=function(){return Z.itemTypes.reduce((z,F)=>z+F.totalPrice(),0)},Z.oneTimePrice=function(){return Z.itemTypes.reduce((z,F)=>z+F.oneTimePrice(),0)},Z.recurringPrice=function(){return Z.itemTypes.reduce((z,F)=>z+F.recurringPrice(),0)}}),M.filter(Z=>Z.itemTypes.filter(z=>z.selected.length>0).length>0)}),S=me(()=>b.value.reduce((M,U)=>M+U.totalPrice(),0)),A=me(()=>{if(!s.value)return{basePrice:0,addOns:0,oneTimePrice:0,recurringPrice:0,total:0};const M=b.value.reduce((z,F)=>z+F.totalPrice(),0);let U=b.value.reduce((z,F)=>z+F.oneTimePrice(),0),Z=b.value.reduce((z,F)=>z+F.recurringPrice(),0);return s.value.billingPeriod?Z=(Z+s.value.price)*s.value.qty:U=(U+s.value.price)*s.value.qty,{basePrice:s.value.price,addOns:M,oneTimePrice:U,recurringPrice:Z,total:s.value.price*s.value.qty+M*s.value.qty+U+Z}}),I=me(()=>{var U,Z,z,F;const M=new Map;return(U=c.value)!=null&&U.productLineItem&&M.set((Z=c.value)==null?void 0:Z.productLineItem.XX_ORD1__Item__c,(z=c.value)==null?void 0:z.productLineItem),(F=c.value)==null||F.options.forEach(j=>{M.set(j.XX_ORD1__Item__c,j)}),M}),B=me(()=>{var U;const M=new Map;return s.value&&((U=s.value.categoryOptions)==null?void 0:U.length)>0&&s.value.categoryOptions.forEach(Z=>{Z.itemTypes.forEach(z=>{z.options.forEach(F=>{M.set(F.publishKey,F)})})}),M}),O=me(()=>{if(!s.value)return{};const M=z=>!z||!Array.isArray(z)?[]:z.map(F=>({field:F.apiName,dataType:F.dataType,picklistValues:F.picklistValues,isEditable:F.editable,defaultValue:F.defaultValue,value:F.dataType==="BOOLEAN"?F.value?"true":"false":F.dataType==="REFERENCE"?F.referenceRecordId||F.value||"":F.value||""})),U={itemId:s.value.itemId,qliId:s.value.qliId||null,name:s.value.itemName,qty:s.value.qty||1,salesPrice:s.value.price||0,mrc:s.value.mrc||null,yrc:s.value.yrc||null,attributes:M(s.value.attributes)},Z=[];return s.value.categoryOptions.forEach(z=>{z.itemTypes.forEach(F=>{F.options.forEach(j=>{F.selected.includes(j.itemId)&&Z.push({itemId:j.itemId,qliId:j.qliId||null,name:j.itemName,qty:j.qty||1,salesPrice:j.price||0,mrc:j.mrc||null,yrc:j.yrc||null,attributes:M(j.attributes)})})})}),{[s.value.itemId]:{product:U,options:Z}}}),E=(M,U)=>{if(!M||!Array.isArray(M))return[];const Z=new Map;return U.forEach(z=>{Z.set(z.fieldAPIName,z.value)}),M.map(z=>(z.value=Z.get(z.fieldAPIName)||null,z))};function k(M,U){console.log("updateCurrentConfiguration:newConfiguration",JSON.stringify(M)),console.log("updateCurrentConfiguration:suggestedConfigurations",JSON.stringify(U)),U&&(l.value=U.filter(z=>z.product.itemId!==M.product.itemId));const Z=new Map;M.options.forEach(z=>{Z.set(z.itemId,z)}),s.value.itemName=M.product.name,s.value.qty=M.product.qty,s.value.price=M.product.salesPrice,s.value.attributes=E(s.value.attributes,M.product.attributes),s.value.categoryOptions.forEach(z=>{z.itemTypes.forEach(F=>{F.selected=[],F.options.forEach(j=>{Z.has(j.itemId)&&(j.itemName=Z.get(j.itemId).name,j.qty=Z.get(j.itemId).qty,j.price=Z.get(j.itemId).salesPrice,j.qliId=Z.get(j.itemId).qliId,j.attributes=E(j.attributes,Z.get(j.itemId).attributes),F.selected.push(j.itemId))})})}),s.value={...s.value}}function R(){return{get getConfig(){return O.value},setConfig:k}}function N(M){s.value.qliId&&(s.value.qliBillingPeriod==="Monthly"&&!M?s.value.price=s.value.salesPrice||s.value.mrc:s.value.qliBillingPeriod==="Yearly"&&M&&(s.value.price=s.value.salesPrice)),s.value.categoryOptions.forEach(U=>{U.itemTypes.forEach(Z=>{Z.options.forEach(z=>{z.billingPeriod&&(z.price=(M?z.yrcPrice.offerPrice:z.mrcPrice.offerPrice)||z.price,z.qliId&&(z.qliBillingPeriod==="Monthly"&&!M?z.price=z.salesPrice||z.mrc:z.qliBillingPeriod==="Yearly"&&M&&(z.price=z.salesPrice)))})})})}function q(){s.value=null,u.value=null,f.value=[],a.value=null,c.value=null,h.value=null,p.value=new Map,g.value=!1,d.value.configuration=!1,d.value.lineItem=!1,d.value.productOptionsPricing=!1,d.value.bestOfferPrice=!1,d.value.lineItemAttributes=!1,d.value.save=!1}function G(M,U,Z,z){e.value=new l4(M,U,Z,z)}async function Y(M,U,Z){d.value.init=!0,console.time("CONFIGURATOR INIT CONFIGURATOR"),q(),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","1"),o.value=M,a.value=U,i.value=Z||t.quoteId;const z=await ne();console.timeLog("CONFIGURATOR INIT CONFIGURATOR","2"),s.value=Q(z),a.value?(await w(),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","3"),P(s.value),s.value.categoryOptions.forEach(F=>{F.itemTypes.forEach(j=>{j.options.forEach(se=>{P(se),(I.value.has(se.itemId)||se.relationshipInfo.relationship==="Kit")&&j.selected.push(se.itemId)})})}),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","4")):w(),u.value=JSON.parse(JSON.stringify(s.value)),console.timeEnd("CONFIGURATOR INIT CONFIGURATOR"),d.value.init=!1}async function ne(){try{const M={accountId:t.accountId,objectId:i.value,itemId:o.value,configScope:"BASIC",fields:[],pricePreference:"Lowest Price"},U=await e.value.getAvailableConfiguration(M);console.info("getAvailableConfiguration:result",U);const Z=U.data.productConfiguration;return Z.categoryOptions=a4(Z.categoryOptions),Z}catch(M){return console.info("error",M.message),!1}}function Q(M){p.value.set(a.value,M.attributes),f.value=M.configRules;const U=new Set;return f.value.forEach(Z=>{const z=JSON.parse(Z.ruleJson);z.optionSelected.forEach(F=>{U.add(F)}),z.affectedOptions.forEach(F=>{U.add(F)})}),console.info("rulesByPublishKey",U),P(M),M.categoryOptions.forEach(Z=>{Z.key=Z.category.toLowerCase().replace(/\s+/g,"-").replace(/[&]/g,""),Z.itemTypes.forEach(z=>{z.selected=[],z.numberOfColumns||(z.numberOfColumns=1),z.numberOfColumns>1&&(z.lightboxAttributes=!0),z.maxNumber||(z.maxNumber=100),z.minNumber||(z.minNumber=0),z.maxQuantity||(z.maxQuantity=1e4),z.minQuantity||(z.minQuantity=1),z.maxNumber===1?(z.isRadio=!0,z.minMessage="Please select 1 option",z.maxMessage="",z.isKit=z.options.some(F=>F.relationshipInfo.relationship==="Kit")):(z.minMessage=`Minimum of ${z.minNumber} selection${z.minNumber!==1?"s":""} required`,z.maxMessage=`Maximum of ${z.maxNumber} selection${z.maxNumber!==1?"s":""} allowed`),z.options.forEach(F=>{Z.showImage=Z.showImage||!!F.defaultImageURL,F.showAttributesModal=!1,F.calculateRules=U.has("option."+F.publishKey),console.info("option.calculateRules",F.calculateRules),F.qty=z.minQuantity||1,F.getTags=()=>(F.attributes=F.attributes||[],F.attributes.filter(j=>j.value!==null&&j.value!=="").map(j=>({label:j.label,value:j.value}))),Object.defineProperty(F,"isDisabled",{get:function(){return F.relationshipInfo.relationship==="Kit"||(z.isRadio?z.isKit:!z.selected.includes(F.itemId)&&z.maxNumber===z.selected.length)}}),P(F)})})}),M}function P(M){M.isAttributes=M.attributes&&M.attributes.length>0;const U=M.catalogItem;if(I.value.has(M.itemId)){const Z=I.value.get(M.itemId);M.qliId=Z.Id,M.qty=Z.XX_ORD1__QTY__c,M.itemName=Z.XX_ORD1__Line_Description__c,M.billingPeriod=Z.XX_ORD1__Billing_Period__c,M.price=Z.XX_ORD1__Sales_Price__c,M.billingPeriod?M.price=Z.XX_ORD1__Sales_Price__c||Z.XX_ORD1__MRC__c:M.price=Z.XX_ORD1__NRC__c||Z.XX_ORD1__Sales_Price__c,M.salesPrice=Z.XX_ORD1__Sales_Price__c,M.nrc=Z.XX_ORD1__NRC__c,M.mrc=Z.XX_ORD1__MRC__c,M.qliBillingPeriod=Z.XX_ORD1__Billing_Period__c,p.value.set(M.qliId,M.attributes)}else M.itemName=U.XX_ORD1__Line_Description__c||M.itemName,M.price=U.XX_ORD1__Negotiated_Price__c||U.XX_ORD1__NRC_for_New__c,M.nrcPrice=U.XX_ORD1__NRC_for_New__c,M.qty=M.qty||1,o4(M)}async function w(){d.value.lineItem=!0,console.info("getLineItems",i.value,a.value);try{const M={objectId:i.value,filters:{},additionalFields:["Name","XX_ORD1__Line_Description__c","XX_ORD1__SYS_Configuration_Status2__c"],primarySort:{field:"CreatedDate",direction:"DESC"},productPage:{limit:200,offset:0,productLineItemId:a.value}},U=await e.value.getLineItems({request:JSON.stringify(M)});return(U.data.products||[]).forEach(z=>{const F=z.productLineItem;F.Id===a.value?c.value=z:v.value.push(F)}),console.info("lineItem.value",c.value),console.info("configurableLineItems.value",v.value),d.value.lineItem=!1,U}catch(M){return console.info("error",M.message),d.value.lineItem=!1,!1}}async function D(M){console.info("getRecords");try{const U=await window.productManagerController.getRecords({request:JSON.stringify(M)});return console.info("getRecords:result",U),JSON.parse(U.data)}catch(U){return console.info("error",U.message),!1}}async function L(){g.value=!0,d.value.save=!0,console.info("maintainQuoteConfiguration");const M=[],U=[];s.value.categoryOptions.forEach(F=>{F.itemTypes.forEach(j=>{j.options.forEach(se=>{j.selected.includes(se.itemId)?M.push($(se)):se.qliId&&U.push(se.qliId)})})});const Z={objectId:i.value,eCatalogId:t.eCatalogId,isGenesisAI:!0,blinkUser:!1,optionsToRemove:U,grandFatheredOptionsToRemove:[],productLineItem:{...$(s.value),optionLineItems:M}};console.info("maintainQuoteConfiguration:request",Z);const z=await e.value.maintainQuoteConfiguration({request:JSON.stringify(Z)});if(console.info("maintainQuoteConfiguration:result",z),z!=null&&z.error){const F={title:"Unable to Save Configuration",description:z.error,button:{label:"Back to Configuration",action:()=>{g.value=!1}},cancel:{label:"Quote List",action:()=>{r.push("/quote-item?id="+i.value)}}};n.errorPopup=F}else if(u.value=JSON.parse(JSON.stringify(s.value)),console.info("maintainQuoteConfiguration:result",z),d.value.save=!1,!a.value)return s.value.qliId=z.data.productLineItem.lineItemId,a.value=z.data.productLineItem.lineItemId,z.data.productLineItem.lineItemId;d.value.save=!1}function $(M){const U={};M.isAttributes&&M.attributes.forEach(z=>{!z.apiName.includes(".")&&z.value!==null&&z.value!==void 0&&(z.dataType==="BOOLEAN"?U[z.apiName]=z.value?"true":"false":z.dataType==="REFERENCE"?U[z.apiName]=z.referenceRecordId:U[z.apiName]=z.value)});const Z={attributes:U,itemId:M.itemId,lineItemId:M.qliId,lineDescription:M.itemName,qty:M.qty,billingPeriod:M.billingPeriod,...M.offer};return M.billingPeriod&&_.value&&!t.isSinglePricingSchema&&(Z.billingPeriod=m.value?"Yearly":"Monthly"),!t.isSinglePricingSchema&&!M.billingPeriod?Z.nrcPrice=M.price:(Z.applyOnField="Catalog Price",Z.salesPrice=M.price,Z.nrcPrice=M.nrcPrice),Z}async function W(){const M={objectId:t.accountId,productItemId:o.value};try{let U=await e.value.getProductCrossSells(M);const{crossSells:Z,offerResult:z}=U.data;if(Z.length===0)return[];const F=new Map;return z.forEach(j=>{F.set(j.eCatalogItemId,{...j,...j.pricingTypes[0]})}),Z.forEach(j=>{j.loading=!1,j.Name=j.XX_ORD1__Line_Description__c||j.XX_ORD1__Item__r.Name,j.Description=j.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,F.has(j.Id)?(j.Price=F.get(j.Id).offerPrice,j.priceFormatted=F.get(j.Id).formattedOfferPrice,j.offer={offerDiscount:F.get(j.Id).offerDiscount,offerId:F.get(j.Id).offerId,offerType:F.get(j.Id).offerType}):(j.Price=j.XX_ORD1__List_Price2__c,j.priceFormatted=j.XX_ORD1__List_Price2__c,j.offer={offerDiscount:0,offerId:null,offerType:null})}),Z}catch(U){return console.info("error",U.message),!1}}const H=M=>!M||!Array.isArray(M)?[]:M.filter(U=>U.apiName&&U.value!==null&&U.value!==void 0&&U.value!=="").map(U=>({attrName:U.apiName,attrValue:U.dataType==="BOOLEAN"?U.value:U.value||"",dataType:U.dataType}));async function X(M,U){const Z={product:{publishKey:s.value.publishKey,attributes:H(s.value.attributes),lineDescription:s.value.itemName,meta:{XX_ORD1__Sales_Price__c:s.value.price,XX_ORD1__MRC__c:s.value.mrc,XX_ORD1__NRC__c:s.value.nrc,XX_ORD1__YRC__c:s.value.yrc,quantity:s.value.qty}},options:[]};s.value.categoryOptions.forEach(j=>{j.itemTypes.forEach(se=>{se.options.forEach(fe=>{se.selected.includes(fe.itemId)&&Z.options.push({publishKey:fe.publishKey,attributes:H(fe.attributes),lineDescription:fe.itemName,meta:{XX_ORD1__Sales_Price__c:fe.price,XX_ORD1__MRC__c:fe.mrc,XX_ORD1__NRC__c:fe.nrc,XX_ORD1__YRC__c:fe.yrc,quantity:fe.qty}})})})}),console.info("evaluateConfigSelection:currentConfig.options",Z.options);const z={itemId:o.value,currentConfig:Z,selected:M?{publishKey:M==null?void 0:M.publishKey,attributes:H(M.attributes),lineDescription:M.itemName}:{},unselected:U?{publishKey:U==null?void 0:U.publishKey,attributes:H(U.attributes),lineDescription:U.itemName}:{}};return await e.value.evaluateConfigurationSelection({request:JSON.stringify(z)})}async function ee(M){const U={objectId:i.value,lstLIRequest:[{eCatalogItemId:M.Id,quantity:1,offerApplicable:M.offer}]};try{const Z=await e.value.addLines({request:JSON.stringify(U)});console.info("addLines:result",Z)}catch(Z){return console.info("error",Z.message),!1}}return{itemId:o,configuration:s,_configurationCopy:u,lineItem:c,savedScreen:g,loading:d,summary:b,addOns:S,summaryPrices:A,optionByItemId:I,attributesByQLIId:p,optionByPublishKey:B,showYearlyPricing:m,isYearlyPricingExist:_,isChangedConfiguration:x,isRecurringPricingSchema:y,configurableLineItems:v,suggestedConfigurations:l,initializeController:G,exposeProperties:R,updateCurrentConfiguration:k,changePricingScheme:N,addLines:ee,resetConfigurator:q,getRecords:D,getProductCrossSells:W,initConfigurator:Y,maintainQuoteConfiguration:L,evaluateConfigSelection:X}}),c4={class:"ect-p-4 ect-flex ect-gap-2 ect-items-center ect-justify-between ect-border-b ect-border-gray-200"},u4={class:"ect-flex ect-items-center ect-gap-3"},f4={class:"ect-text-xl ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},d4={key:0,class:"ect-flex ect-gap-1.5 ect-items-center"},h4=C("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Saving configuration...",-1),p4={key:1,class:"ect-flex ect-gap-1.5 ect-items-center"},v4=C("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Configuration Saved Successfully",-1),g4={key:1,class:"ect-flex ect-flex-col ect-gap-4 ect-flex-1 ect-overflow-y-auto ect-mb-16"},m4=C("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},"You may consider these products",-1),y4={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},x4=["data-test-id"],_4={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},b4={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},C4={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},w4={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},E4={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},A4={key:2,class:"ect-flex ect-flex-col ect-gap-4 ect-m-4 ect-flex-1 ect-overflow-y-auto"},k4=C("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},"What do you want to do next?",-1),O4={class:"ect-flex ect-flex-col ect-gap-4"},S4=["data-test-id","onClick"],I4={class:"ect-flex ect-items-center ect-justify-center"},T4={class:"ect-flex ect-flex-col ect-items-center ect-gap-2 ect-w-full"},B4=["data-test-id"],D4=["data-test-id"],R4={__name:"ConfiguratorRecommend",setup(e){const n=dn();fi();const t=me(()=>n.configuration),r=te(!0),i=te(""),o=te([{icon:"configuration",title:"Back to current Product Configuration",description:"Returns to the active product configuration page.",link:"/item/overview",action:"backToConfiguration"}]),a=te(null),s=te([]),u=async p=>{p.loading=!0,await n.addLines(p),p.disabled=!0,p.loading=!1},f=me(()=>{var p;if(((p=n.suggestedConfigurations)==null?void 0:p.length)>0){const g=n.suggestedConfigurations[0];return{Name:g.product.name,Description:g.product.description,Price:g.product.salesPrice,XX_ORD1__Item__c:g.product.itemId}}return null}),c=p=>{p.action==="backToConfiguration"&&(n.savedScreen=!1)};async function v(){const p=n.configurableLineItems,g=p.filter(m=>m.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration").length;i.value=`(${p.length-g}/${p.length})`;const d=p.find(m=>m.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration"&&m.Id!=n.qliId);return a.value=d?{Name:d.XX_ORD1__Line_Description__c,Description:d.XX_ORD1__Product_Description__c,Price:d.XX_ORD1__Sales_Price__c,XX_ORD1__Item__c:d.XX_ORD1__Item__c,Id:d.Id}:null,p}async function l(){n.resetConfigurator(),await n.initConfigurator(f.value.XX_ORD1__Item__c,null),n.updateCurrentConfiguration(n.suggestedConfigurations[0],n.suggestedConfigurations)}async function h(){n.resetConfigurator(),n.initConfigurator(a.value.XX_ORD1__Item__c,a.value.Id)}return qn(async()=>{r.value=!0;const p=await v(),g=await n.getProductCrossSells(),d=new Set;p.forEach(m=>{d.add(m.XX_ORD1__Item__c)}),g.forEach(m=>{m.disabled=d.has(m.XX_ORD1__Item__c)}),s.value=g||[],r.value=!1}),(p,g)=>(V(),J(be,null,[C("div",c4,[C("div",u4,[he(We,{icon:"arrow",symbol:"",size:12,onClick:g[0]||(g[0]=d=>Ne(n).savedScreen=!1)}),C("h2",f4,xe(t.value.itemName),1)]),Ne(n).loading.save?(V(),J("div",d4,[he(Hu,{svg:""}),h4])):(V(),J("div",p4,[he(We,{icon:"check",color:"#136E05",size:14,"data-test-id":"item-tabs-before-button-icon"}),v4]))]),r.value?(V(),Ee($u,{key:0,type:"recommendations",rows:4})):s.value.length>0?(V(),J("div",g4,[m4,C("div",y4,[(V(!0),J(be,null,Me(s.value,(d,m)=>(V(),J("div",{key:d.Id||m,class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":`configurator-recommend-card-${d.Id||m}`},[C("div",_4,[C("h4",b4,xe(d.Name),1),C("p",C4,xe(d.Description),1)]),C("div",w4,[C("div",E4,xe(Ne(Pt)(d.Price)),1),he(Ut,{btype:d.disabled?"secondary":"primary","button-style":d.disabled?"normal":"outlined",size:"medium",class:we({"ect-w-[120px]":d.loading}),loading:d.loading,disabled:d.disabled||d.loading,"data-test-id":`configurator-recommend-button-add-${d.Id||m}`,onClick:y=>u(d)},{default:Ve(()=>[Fe(xe(d.loading?"":d.disabled?"Added to Quote":"Add to Quote"),1)]),_:2},1032,["btype","button-style","class","loading","disabled","data-test-id","onClick"])])],8,x4))),128))])])):(V(),J("div",A4,[k4,C("div",O4,[(V(!0),J(be,null,Me(o.value,(d,m)=>(V(),J("div",{key:d.title||m,class:"ect-bg-white ect-border ect-border-[#DEDEDE] ect-rounded-xl ect-p-4 md:ect-p-5 lg:ect-p-6 ect-flex ect-flex-col ect-items-center ect-gap-4 md:ect-gap-6 lg:ect-gap-8 ect-cursor-pointer ect-transition-all ect-duration-200 hover:ect-shadow-md hover:ect-border-gray-400","data-test-id":`configurator-recommend-redirect-card-${m}`,onClick:y=>c(d)},[C("div",I4,[he(We,{icon:d.icon,size:20,color:"#000000","data-test-id":`configurator-recommend-redirect-icon-${m}`},null,8,["icon","data-test-id"])]),C("div",T4,[C("h4",{class:"ect-text-sm ect-font-semibold ect-text-[#5F5F5F] ect-text-center ect-leading-[1.43]","data-test-id":`configurator-recommend-redirect-title-${m}`},xe(d.title),9,B4),C("p",{class:"ect-text-sm ect-font-normal ect-text-[#828282] ect-text-center ect-leading-[1.71]","data-test-id":`configurator-recommend-redirect-description-${m}`},xe(d.description),9,D4)])],8,S4))),128))])])),f.value?(V(),Ee(ju,{key:3,title:"Configuere next AI suggested product","configuered-product":f.value,"count-configued-product-string":i.value,onConfigureNextProduct:l},null,8,["configuered-product","count-configued-product-string"])):(V(),Ee(ju,{key:4,title:`Configuere next product from your quote ${i.value}`,"configuered-product":a.value,"count-configued-product-string":i.value,onConfigureNextProduct:h},null,8,["title","configuered-product","count-configued-product-string"]))],64))}},L4=["data-test-id"],N4=Re({__name:"AppPill",props:{variant:{type:String,default:"",validator:e=>["success","error",""].includes(e)},dataTestId:{type:String,default:""}},setup(e){return(n,t)=>(V(),J("span",{class:we(["ect-pill",{"ect-pill-success":e.variant==="success","ect-pill-error":e.variant==="error","ect-pill-default":!e.variant}]),"data-test-id":e.dataTestId},[Je(n.$slots,"default",{},void 0,!0)],10,L4))}},[["__scopeId","data-v-c7f05fa0"]]),F4=["data-test-id"],P4=["data-test-id"],M4=["data-test-id","onClick"],q4=["data-test-id"],$4=Re({__name:"AppTabsV2",props:{showTabs:{type:Boolean,default:!0},modelValue:{type:String,default:""},border:{type:Boolean,default:!1},tabs:{type:Array,required:!0,validator:e=>e.every(n=>typeof n=="object"&&n.title&&n.key&&(n.sections===void 0||Array.isArray(n.sections)))},dataTestId:{type:String,required:!0}},emits:["update:modelValue","tab-change"],setup(e,{emit:n}){const t=e,r=n,i=me(()=>{var a;return t.modelValue||((a=t.tabs[0])==null?void 0:a.key)||""}),o=a=>{r("update:modelValue",a),r("tab-change",a)};return(a,s)=>(V(),J("div",{class:"ect-page-tabs","data-test-id":e.dataTestId},[e.showTabs?(V(),J("div",{key:0,class:we(["ect-page-tabs-header",[{"ect-tab-border":e.border}]]),"data-test-id":`${e.dataTestId}-header`},[(V(!0),J(be,null,Me(e.tabs,u=>(V(),J("button",{key:u.key,class:we(["ect-page-tab-button",`ect-page-tab-button${i.value===u.key?"-active":""} ${u.tabClass||""}`]),"data-test-id":`${e.dataTestId}-tab-${u.key}`,onClick:f=>o(u.key)},[Fe(xe(u.title)+" ",1),u.pill!==void 0&&u.pill!==null?(V(),Ee(N4,{key:0,class:"ect-ml-2",variant:u.pillStyle,"data-test-id":`${e.dataTestId}-tab-${u.key}-pill`},{default:Ve(()=>[Fe(xe(u.pill),1)]),_:2},1032,["variant","data-test-id"])):ge("",!0)],10,M4))),128))],10,P4)):ge("",!0),C("div",{class:"ect-page-tab-content","data-test-id":`${e.dataTestId}-content`},null,8,q4)],8,F4))}},[["__scopeId","data-v-f22cb1ed"]]),j4=["data-test-id"],H4=["disabled","data-test-id"],V4=["value","disabled","data-test-id"],U4=["disabled","data-test-id"],Do={__name:"CounterButton",props:{value:{type:Number,required:!0,default:null},min:{type:Number,default:1},max:{type:Number,default:999},empty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:value","change"],setup(e,{emit:n}){const t=e,r=n,i=me(()=>t.min==null?0:t.min),o=me(()=>t.max==null?999:t.max),a=(x,b,S)=>Math.min(Math.max(x,b),S),s=x=>{if(x==null||x==="")return NaN;const b=Number(x);return Number.isFinite(b)?b:NaN},u=te(null),f=te(t.value??i.value),c=x=>{f.value=a(x,i.value,o.value)};t.value!==null&&c(t.value);const v=me(()=>f.value),l=me(()=>u.value!=null?u.value:String(v.value)),h=me(()=>t.disabled||v.value<=i.value),p=me(()=>t.disabled||v.value>=o.value);function g(x){x!==t.value&&(f.value=x,r("update:value",x),r("change",x))}function d(){if(h.value)return;const x=a(v.value-1,i.value,o.value);u.value=null,g(x)}function m(){if(p.value)return;const x=a(v.value+1,i.value,o.value);u.value=null,g(x)}function y(x){const S=String(x.target.value??"").replace(/\D+/g,"");u.value=S}function _(){const x=s(u.value),b=i.value,S=a(Number.isNaN(x)?b:x,i.value,o.value);u.value=null,g(S)}return(x,b)=>(V(),J("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":e.dataTestId},[C("button",{type:"button",class:we(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":h.value,"ect-cursor-not-allowed":h.value}]),disabled:h.value,"data-test-id":`${e.dataTestId}-decrement`,onClick:d}," - ",10,H4),C("input",{type:"text",inputmode:"numeric",pattern:"[0-9]*",value:e.empty?"":l.value,disabled:e.disabled,class:"ect-h-7 ect-w-[48px] ect-px-2 ect-border ect-border-gray ect-rounded-md ect-text-center ect-text-sm ect-font-medium ect-text-gray-900 focus:ect-outline-none focus:ect-border-gray-400 ect-bg-white","data-test-id":`${e.dataTestId}-input`,onInput:y,onBlur:_},null,40,V4),C("button",{type:"button",class:we(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":p.value,"ect-cursor-not-allowed":p.value}]),disabled:p.value,"data-test-id":`${e.dataTestId}-increment`,onClick:m}," + ",10,U4)],8,j4))}},z4={class:"ect-flex ect-justify-end ect-items-center ect-gap-2.5 ect-px-6 ect-py-4 ect-bg-white ect-border-t ect-border-gray-300 ect-shadow-[0_-2px_4px_0px_rgba(0,0,0,0.11)]","data-test-id":"configurator-footer"},K4={"data-test-id":"configurator-footer-quantity"},X4={class:"ect-flex ect-justify-end ect-items-center ect-gap-6 ect-px-8 ect-py-0 ect-flex-1","data-test-id":"configurator-footer-prices"},W4=["data-test-id"],G4=["data-test-id"],Q4=["data-test-id"],Z4=["data-test-id"],J4={__name:"ConfiguratorFooter",props:{item:{type:Object,required:!0,default:()=>{}},disabled:{type:Boolean,default:!1},btnText:{type:String,default:"Save"}},emits:["update:qty","continue"],setup(e,{emit:n}){const t=dn(),r=e,i=te(r.item),o=me(()=>{const u=t.summaryPrices,f=[];return t.isRecurringPricingSchema?(f.push({label:"One Time Price",value:u.oneTimePrice,highlight:!1}),f.push({label:t.showYearlyPricing?"Yearly Price":"Monthly Price",value:u.recurringPrice,highlight:!1})):(f.push({label:"Base Price",value:u.basePrice,highlight:!1}),f.push({label:"Add Ons",value:u.addOns,highlight:!1}),f.push({label:"Total Price",value:u.total,highlight:!1})),f}),a=n,s=()=>{r.disabled||a("continue")};return(u,f)=>(V(),J("footer",z4,[C("div",K4,[he(Do,{value:i.value.qty,"onUpdate:value":f[0]||(f[0]=c=>i.value.qty=c),min:1,max:999,disabled:e.disabled,"is-selected":!0,"data-test-id":"configurator-footer-counter-button"},null,8,["value","disabled"])]),C("div",X4,[(V(!0),J(be,null,Me(o.value,(c,v)=>(V(),J(be,{key:v},[C("div",{class:"ect-flex ect-flex-col ect-justify-center","data-test-id":`configurator-footer-price-${v}`},[C("span",{class:"ect-text-xs ect-font-normal ect-text-gray-500 ect-text-left","data-test-id":`configurator-footer-price-label-${v}`},xe(c.label),9,G4),C("span",{class:we(["ect-text-left",c.highlight?"ect-text-lg ect-font-bold ect-text-green-700":"ect-text-sm ect-font-medium ect-text-gray-800 "]),"data-test-id":`configurator-footer-price-value-${v}`},xe(Ne(Pt)(c.value)),11,Q4)],8,W4),v<o.value.length-1?(V(),J("div",{key:0,class:"ect-w-0 ect-h-5 ect-border-l ect-border-gray-400","data-test-id":`configurator-footer-divider-${v}`},null,8,Z4)):ge("",!0)],64))),128))]),he(Ut,{class:"ect-min-w-[100px]",btype:e.disabled?"secondary":"primary",disabled:e.disabled,"button-style":"primary",size:"medium","data-test-id":"configurator-footer-button-continue",onClick:s},{default:Ve(()=>[Fe(xe(e.btnText),1)]),_:1},8,["btype","disabled"])]))}},Y4={class:"ect-w-full ect-bg-white ect-mb-4","data-test-id":"configurator-type-section"},e6={class:"ect-sticky ect-top-0 ect-z-30 ect-bg-white ect-shadow-sm ect-p-3 ect-px-4 ect-border-b ect-border-gray-200 ect-flex ect-justify-between ect-items-center","data-test-id":"configurator-type-header-sticky"},t6={class:"ect-flex ect-flex-col"},n6={class:"ect-font-bold ect-text-text-success ect-leading-tight"},r6=["innerHTML"],i6={key:0,class:"ect-flex ect-items-center ect-gap-2 ect-px-2 ect-py-1","data-test-id":"configurator-type-message"},o6={class:"ect-text-xs ect-font-medium ect-text-gray-600 ect-leading-tight ect-min-w-[190px]"},a6={class:"ect-divide-y ect-divide-gray-100 ect-overflow-y-auto"},s6={__name:"ConfiguratorType",props:{title:{type:String,required:!0},description:{type:String,default:""},message:{type:String,default:""}},setup(e){return(n,t)=>(V(),J("section",Y4,[C("header",e6,[C("div",t6,[C("h2",n6,xe(e.title),1),e.description?(V(),J("p",{key:0,class:"ect-mt-1 ect-text-xs ect-text-gray-500 ect-leading-tight",innerHTML:e.description},null,8,r6)):ge("",!0)]),e.message?(V(),J("div",i6,[he(We,{icon:"info",symbol:"",color:"#198708",size:14,"data-test-id":"configurator-type-message-icon"}),C("span",o6,xe(e.message),1)])):ge("",!0)]),C("div",a6,[Je(n.$slots,"default")])]))}},l6={__name:"ShadowDisplay",props:{content:{type:String,required:!0}},setup(e){const n=e,t=te(null);let r=null;return Ft(()=>{t.value&&!r&&(r=t.value.attachShadow({mode:"open"}),r.innerHTML=n.content)}),Ye(()=>n.content,i=>{r&&(r.innerHTML=i)}),(i,o)=>(V(),J("div",{ref_key:"host",ref:t},null,512))}},c6=["data-test-id"],u6=["data-test-id"],f6=["data-test-id"],d6=[C("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[C("g",{id:"Group"},[C("path",{id:"Vector",d:"M7 1.3125V12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"}),C("path",{id:"Vector_2",d:"M1.3125 7H12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)],h6=["data-test-id"],p6=["data-test-id"],v6=["data-test-id"],g6=["data-test-id"],m6=["data-test-id"],y6=["data-test-id","innerHTML"],hn={__name:"Tag",props:{label:{type:String,default:""},value:{type:String,default:""},addButton:{type:Boolean,default:!1},editButton:{type:Boolean,default:!1},dataTestId:{type:String,default:""}},setup(e){const n=e,t=me(()=>{const r=n.value;if(typeof r!="string")return!1;const i=new DOMParser().parseFromString(r,"text/html");return Array.from(i.body.childNodes).some(o=>o.nodeType===1)});return(r,i)=>e.addButton?(V(),J("div",{key:0,class:"ect-bg-orange-4 ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-orange-secondary","data-test-id":e.dataTestId},[C("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-orange-secondary ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},[C("div",{"data-test-id":`${e.dataTestId}-add-icon`},d6,8,f6),Fe(" "+xe(e.label),1)],8,u6)],8,c6)):e.editButton?(V(),J("div",{key:1,class:"ect-bg-white ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-success","data-test-id":e.dataTestId},[C("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-success ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},xe(e.label),9,p6)],8,h6)):(V(),J("div",{key:2,class:"ect-bg-white ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-rounded-md ect-border ect-border-solid ect-border-neutral-200","data-test-id":e.dataTestId},[C("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-label`},xe(e.label),9,g6),e.value?(V(),J("span",{key:0,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-separator`}," : ",8,m6)):ge("",!0),t.value?(V(),Ee(l6,{key:1,content:e.value},null,8,["content"])):e.value?(V(),J("span",{key:2,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-neutral-700","data-test-id":`${e.dataTestId}-value`,innerHTML:e.value},null,8,y6)):ge("",!0)],8,v6))}},x6=["data-test-id"],_6=["data-test-id"],b6=["data-test-id"],C6=["type","step","min","data-test-id"],fs=Re({__name:"InputEdit",props:{modelValue:{type:[String,Number],required:!0},type:{type:String,default:"string",validator:e=>["string","number","currency"].includes(e)},tag:{type:String,default:"span"},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","change"],setup(e,{expose:n,emit:t}){const r=e,i=t,o=te(!1),a=te(!1),s=te(""),u=te(null),f=me(()=>r.type==="currency"?m(r.modelValue):r.type==="number"?y(r.modelValue):r.modelValue),c=me(()=>r.type==="string"?"text":"number"),v=me(()=>r.type==="currency"?"0.01":void 0),l=me(()=>r.type==="currency"?"0":void 0),h=()=>{r.disabled||(r.type==="currency"?s.value=parseFloat(r.modelValue)||"0.00":r.type==="number"?s.value=parseFloat(r.modelValue)||"0":s.value=r.modelValue,o.value=!0,sn(()=>{u.value&&(u.value.focus(),u.value.select())}))},p=()=>{let _=s.value;if(r.type==="number"||r.type==="currency"){const x=parseFloat(s.value);isNaN(x)?_=r.modelValue:_=r.type==="currency"?x.toFixed(2):x.toString()}_!==r.modelValue&&(i("update:modelValue",_),i("change",_)),o.value=!1},g=()=>{s.value=r.modelValue,o.value=!1},d=()=>{o.value&&p()},m=_=>!_||isNaN(_)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(parseFloat(_)),y=_=>!_||isNaN(_)?"0":new Intl.NumberFormat("en-US").format(parseFloat(_));return Ye(()=>r.modelValue,_=>{o.value||(s.value=_)}),n({startEditing:h,saveChanges:p,cancelEditing:g}),(_,x)=>{const b=l1("click-outside");return V(),J("div",{class:"ect-relative ect-inline-block ect-min-w-[60px] ect-h-[30px]","data-test-id":e.dataTestId,onMouseenter:x[1]||(x[1]=S=>a.value=!0),onMouseleave:x[2]||(x[2]=S=>a.value=!1)},[o.value?ln((V(),J("div",{key:1,class:"ect-w-full ect-h-full","data-test-id":`${e.dataTestId}-input-wrapper`},[ln(C("input",{ref_key:"inputRef",ref:u,"onUpdate:modelValue":x[0]||(x[0]=S=>s.value=S),type:c.value,step:v.value,min:l.value,class:we(["ect-w-full ect-h-full ect-px-3 ect-bg-white ect-border ect-border-green-500 ect-rounded-sm ect-text-gray-700 ect-text-base ect-font-sans ect-outline-none ect-duration-200",_.$attrs.class]),"data-test-id":`${e.dataTestId}-input`,onKeyup:[ir(p,["enter"]),ir(g,["esc"])],onBlur:p},null,42,C6),[[Oh,s.value]])],8,b6)),[[b,d]]):(V(),J("div",{key:0,class:we(["ect-flex ect-items-center ect-gap-2 ect-rounded ect-transition-colors ect-duration-200",{"ect-cursor-pointer":!e.disabled}]),"data-test-id":`${e.dataTestId}-display`,onClick:h},[(V(),Ee(Wi(e.tag),ao(_.$attrs,{class:"ect-m-0 ect-text-inherit","data-test-id":`${e.dataTestId}-text`}),{default:Ve(()=>[Fe(xe(f.value)+" ",1),he(We,{class:we(a.value&&!e.disabled?"ect-visible":"ect-invisible"),icon:"edit",size:"12",color:"#828282","data-test-id":`${e.dataTestId}-edit-icon`},null,8,["class","data-test-id"])]),_:1},16,["data-test-id"]))],10,_6))],40,x6)}}},[["__scopeId","data-v-5cd60070"]]),L0=e=>(jt("data-v-b9675cf1"),e=e(),Ht(),e),w6=["data-test-id","data-publish-key"],E6={key:0,class:"ect-text-xs ect-text-gray-500 ect-text-white ect-font-medium ect-leading-tight ect-absolute ect-top-[-.7rem] ect-left-[-1rem] ect-bg-text-success ect-rounded-xl ect-px-2 ect-py-1"},A6={key:1,class:"ect-flex ect-items-start ect-gap-4 ect-p-3 ect-px-4"},k6={key:0,class:"ect-w-16 ect-h-16 ect-flex ect-items-center ect-justify-center ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0"},O6=["src","alt"],S6={class:"ect-flex-1 ect-min-w-0"},I6={class:"ect-flex ect-gap-4 ect-items-center ect-justify-between"},T6={class:"ect-flex ect-flex-row ect-gap-3"},B6=L0(()=>C("div",{class:"ect-w-px ect-h-auto ect-bg-gray-200 ect-mx-2"},null,-1)),D6={class:"ect-flex ect-flex-col ect-max-w-[125px]"},R6={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},L6=["innerHTML"],N6={key:0,class:"ect-flex ect-flex-wrap ect-gap-2.5 ect-mt-2"},F6=["data-test-id"],P6=["data-test-id"],M6={key:1,class:"ect-inline-block ect-mb-2"},q6={key:2,class:"ect-flex ect-flex-col ect-gap-3 ect-p-3 ect-h-full ect-justify-between"},$6={class:"ect-flex ect-items-start ect-gap-2"},j6={key:0,class:"ect-w-16 ect-h-16 ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0 ect-overflow-hidden"},H6=["src","alt"],V6={class:"ect-flex-1 ect-min-w-0"},U6={class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},z6=["innerHTML"],K6={class:"temp-hidden"},X6={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},W6={key:0,class:"ect-flex ect-flex-wrap ect-gap-1.5"},G6=["data-test-id"],Q6=["data-test-id"],Z6={key:1,class:"ect-inline-block ect-mb-2"},J6={class:"ect-flex ect-justify-between ect-items-center"},Y6={class:"ect-flex ect-flex-col"},e8=L0(()=>C("p",{class:"ect-text-xs ect-text-gray-500 ect-font-medium ect-leading-tight"},"Price",-1)),t8={key:3,"data-test-id":"configurator-item-slot-details",class:"ect-bg-white ect-rounded-md"},n8=Re({__name:"ConfiguratorItem",props:{item:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},imageUrl:{type:String,default:""},price:{type:Number,required:!0},quantity:{type:Number,default:1},selected:{type:Boolean,default:!1},tags:{type:Array,default:()=>[]},attributes:{type:Array,default:()=>[]},size:{type:Number,default:1},minQuantity:{type:Number,default:null},maxQuantity:{type:Number,default:null},showImage:{type:Boolean,default:!1},option:{type:Object,default:null},isAttributes:{type:Boolean,default:!1},showAttributes:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:quantity","update:name","edit-attributes"],setup(e,{emit:n}){const t=e,r=n,i=te(null),o=te(0),a=te(t.item),s=me(()=>a.value.relationshipInfo.relationship==="Kit"?"ect-bg-green-3 ect-border-gray-200 ect-border-success":t.disabled?"ect-bg-light-bg-x ect-border-gray-200":t.selected?"ect-bg-green-3 ect-border-gray-200 ect-border-success":"ect-bg-white ect-border-gray-200 hover:ect-border-success"),u=me({get:()=>t.quantity,set:p=>r("update:quantity",p)}),f=me({get:()=>t.name,set:p=>r("update:name",p)}),c=p=>{r("update:quantity",p)},v=me(()=>{if(o.value===0)return t.tags;const g=Math.floor(o.value/120);return t.tags.slice(0,Math.max(1,g))}),l=me(()=>Math.max(0,t.tags.length-v.value.length)),h=()=>{if(i.value){const p=i.value,g=80,d=120,m=32,y=64;o.value=p.offsetWidth-g-d-m-y}};return Ft(()=>{sn(()=>{h()})}),Ye(()=>t.tags,()=>{sn(()=>{h()})},{deep:!0}),Ft(()=>{window.addEventListener("resize",h)}),(p,g)=>(V(),J("div",{ref_key:"containerRef",ref:i,class:we(["ect-w-full ect-rounded-md ect-border-1 ect-transition-colors ect-relative",s.value]),"data-test-id":`configurator-item-${e.item.itemId}`,"data-publish-key":e.item.publishKey},[e.item.relationshipInfo.relationship==="Kit"?(V(),J("div",E6," KIT ")):ge("",!0),e.size===1?(V(),J("div",A6,[e.showImage?(V(),J("div",k6,[e.imageUrl?(V(),J("img",{key:0,src:e.imageUrl,alt:f.value,class:"ect-w-full ect-h-full ect-object-cover"},null,8,O6)):(V(),Ee(We,{key:1,disabled:"",icon:"image",symbol:"",size:20,color:"#ACACAC"}))])):ge("",!0),C("div",S6,[C("div",I6,[he(fs,{modelValue:f.value,"onUpdate:modelValue":g[0]||(g[0]=d=>f.value=d),tag:"h3","data-test-id":"itemId"+e.item.itemId,class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},null,8,["modelValue","data-test-id"]),C("div",T6,[C("div",{onClick:g[2]||(g[2]=mt(()=>{},["stop"]))},[he(Do,{value:u.value,"onUpdate:value":g[1]||(g[1]=d=>u.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),B6,C("div",D6,[he(fs,{modelValue:a.value.price,"onUpdate:modelValue":g[3]||(g[3]=d=>a.value.price=d),tag:"p",type:"currency","data-test-id":"itemId"+e.item.itemId,class:"ect-text-base ect-font-bold"},null,8,["modelValue","data-test-id"])]),C("div",R6,[Je(p.$slots,"selection-control",{},void 0,!0)])])]),C("p",{class:"ect-mt-2 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:e.description},null,8,L6),e.isAttributes&&e.showAttributes&&e.selected?(V(),J("div",N6,[a.value.getTags().length>0?(V(),J(be,{key:0},[(V(!0),J(be,null,Me(v.value,(d,m)=>(V(),J("span",{key:m,class:"ect-inline-block"},[he(hn,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),l.value>0?(V(),J("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:g[4]||(g[4]=mt(()=>{},["stop"]))}," +"+xe(l.value)+" more ",9,F6)):ge("",!0),e.selected?(V(),J("button",{key:1,"data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:g[5]||(g[5]=d=>r("edit-attributes"))},[he(hn,{label:"Edit attributes","edit-button":""})],8,P6)):ge("",!0)],64)):(V(),J("span",M6,[C("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:g[6]||(g[6]=d=>r("edit-attributes"))},[he(hn,{label:"Add attributes","add-button":""})])]))])):ge("",!0)])])):(V(),J("div",q6,[C("div",$6,[e.showImage?(V(),J("div",j6,[e.imageUrl?(V(),J("img",{key:0,src:e.imageUrl,alt:e.name,class:"ect-w-full ect-h-full ect-object-cover"},null,8,H6)):ge("",!0)])):ge("",!0),C("div",V6,[C("h3",U6,xe(e.name),1),C("p",{class:"ect-mt-1 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:e.description},null,8,z6),C("p",K6,xe(e.item.publishKey)+" :: "+xe(e.item.calculateRules),1)]),C("div",X6,[Je(p.$slots,"selection-control",{},void 0,!0)])]),e.isAttributes&&e.showAttributes&&e.selected?(V(),J("div",W6,[a.value.getTags().length>0?(V(),J(be,{key:0},[(V(!0),J(be,null,Me(v.value,(d,m)=>(V(),J("span",{key:m,class:"ect-inline-block"},[he(hn,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),l.value>0?(V(),J("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:g[7]||(g[7]=mt(()=>{},["stop"]))}," +"+xe(l.value)+" more ",9,G6)):ge("",!0),e.selected?(V(),J("button",{key:1,class:"ect-ml-auto","data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:g[8]||(g[8]=d=>r("edit-attributes"))},[he(hn,{label:"Edit attributes","edit-button":""})],8,Q6)):ge("",!0)],64)):(V(),J("span",Z6,[C("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:g[9]||(g[9]=d=>r("edit-attributes"))},[he(hn,{label:"Add attributes","add-button":""})])]))])):ge("",!0),C("div",J6,[C("div",{onClick:g[11]||(g[11]=mt(()=>{},["stop"]))},[he(Do,{value:u.value,"onUpdate:value":g[10]||(g[10]=d=>u.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),C("div",Y6,[e8,he(fs,{modelValue:a.value.price,"onUpdate:modelValue":g[12]||(g[12]=d=>a.value.price=d),tag:"p",type:"currency","data-test-id":"itemId"+e.item.itemId,class:"ect-w-[125px] ect-text-base ect-font-bold"},null,8,["modelValue","data-test-id"])])])])),e.selected&&e.isAttributes?(V(),J("div",t8,[Je(p.$slots,"default",{},void 0,!0)])):ge("",!0)],10,w6))}},[["__scopeId","data-v-b9675cf1"]]),r8={"af-ZA":",","sq-AL":",","ar-DZ":",","ar-BH":"٫","ar-EG":"٫","ar-IQ":"٫","ar-JO":"٫","ar-KW":"٫","ar-LB":"٫","ar-LY":",","ar-MA":",","ar-OM":"٫","ar-QA":"٫","ar-SA":"٫","ar-SD":"٫","ar-SY":"٫","ar-TN":",","ar-AE":"٫","ar-YE":"٫","hy-AM":",","az-AZ":",","bn-BD":".","bn-IN":".","eu-ES":",","be-BY":",","bs-BA":",","bg-BG":",","my-MM":".","ca-ES":",","ca-ES-EURO":",","zh-CN":".","zh-CN-PINYIN":".","zh-CN-STROKE":".","zh-HK":".","zh-HK-STROKE":".","zh-MO":".","zh-SG":".","zh-TW":".","zh-TW-STROKE":".","hr-HR":",","cs-CZ":",","da-DK":",","nl-AW":",","nl-BE":",","nl-NL":",","nl-SR":",","dz-BT":".","en-AG":".","en-AU":".","en-BS":".","en-BB":".","en-BZ":".","en-BM":".","en-BW":".","en-CM":".","en-CA":".","en-DE":",","en-KY":".","en-ER":".","en-FK":".","en-FJ":".","en-GM":".","en-GH":".","en-GI":".","en-GY":".","en-HK":".","en-IN":".","en-ID":".","en-IE":".","en-IE-EURO":".","en-JM":".","en-KE":".","en-LR":".","en-MG":".","en-MW":".","en-MY":".","en-MU":".","en-NA":".","en-NZ":".","en-NG":".","en-PK":".","en-PG":".","en-PH":".","en-RW":".","en-WS":".","en-SC":".","en-SL":".","en-SG":".","en-SX":".","en-SB":".","en-ZA":",","en-SH":".","en-SZ":".","en-TZ":".","en-TO":".","en-TT":".","en-UG":".","en-GB":".","en-US":".","en-VU":".","et-EE":",","fi-FI":",","fi-FI-EURO":",","fr-BE":",","fr-CA":",","fr-KM":",","fr-FR":",","fr-FR-EURO":",","fr-GN":",","fr-HT":",","fr-LU":",","fr-MR":",","fr-MC":",","fr-CH":",","fr-WF":",","ka-GE":",","de-AT":",","de-AT-EURO":",","de-BE":",","de-DE":",","de-DE-EURO":",","de-LU":",","de-LU-EURO":",","de-CH":".","el-GR":",","gu-IN":".","iw-IL":".","hi-IN":".","hu-HU":",","is-IS":",","in-ID":",","ga-IE":".","it-IT":",","it-CH":".","ja-JP":".","kn-IN":".","kk-KZ":",","km-KH":",","ko-KP":".","ko-KR":".","ky-KG":",","lo-LA":",","lv-LV":",","lt-LT":",","lu-CD":",","lb-LU":",","mk-MK":",","ms-BN":",","ms-MY":".","ml-IN":".","mt-MT":".","mi-NZ":".","mr-IN":".","ne-NP":".","no-NO":",","ps-AF":"٫","fa-IR":"٫","pl-PL":",","pt-AO":",","pt-BR":",","pt-CV":",","pt-MZ":",","pt-PT":",","pt-ST":",","ro-MD":",","ro-RO":",","rm-CH":".","rn-BI":",","ru-KZ":",","ru-RU":",","sr-BA":",","sr-RS":",","sh-BA":",","sh-ME":",","sh-ME-USD":",","sh-CS":",","sk-SK":",","sl-SI":",","so-DJ":".","so-SO":".","es-AR":",","es-BO":",","es-CL":",","es-CO":",","es-CR":",","es-CU":".","es-DO":".","es-EC":",","es-SV":".","es-GT":".","es-HN":".","es-MX":".","es-NI":".","es-PA":".","es-PY":",","es-PE":".","es-PR":".","es-ES":",","es-ES-EURO":",","es-US":".","es-UY":",","es-VE":",","sw-KE":".","sv-SE":",","tl-PH":".","tg-TJ":",","ta-IN":".","ta-LK":".","te-IN":".","th-TH":".","ti-ET":".","tr-TR":",","uk-UA":",","ur-PK":".","uz-LATN-UZ":",","vi-VN":",","cy-GB":".","xh-ZA":".","yo-BJ":".","zu-ZA":"."},i8={name:"CustomInput",components:{AppIcon:We},props:{editMode:{type:Boolean,default:!0},type:{type:String,default:"text"},max:{type:Number,default:500},label:{type:String,default:""},name:{type:String,default:""},showLabel:{type:Boolean,default:!0},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},highlight:{type:Boolean,default:!1},placeholder:{type:String,default:""},error:{type:[Boolean,String],default:!1},cssClass:{type:Object,default:()=>({})},tooltip:{type:String,default:null},locale:{type:String,default:"en-US"},icon:{type:String,default:null},itooltip:{type:String,default:null},icolor:{type:String,default:"#7d7d7d"},ihover:{type:String,default:"#57c046"},icustom:{type:Boolean,default:!1},idisabled:{type:Boolean,default:!1},height:{type:Number,default:32},textAlignment:{type:String,default:"left"},decimalPrecision:{type:Number,default:0},allowNegatives:{type:Boolean,default:!1},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["update:modelValue","iclick","blur"],data(){return{initialValue:"",decimalSeprator:".",ctrl:!1}},computed:{getValue(){return this.modelValue?this.type==="currency"?String(this.modelValue).replace(".",this.decimalSeprator):String(this.modelValue):""},error_message(){return typeof this.error=="string"?this.error:this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},isHighlight(){return(this.initialValue===""||this.initialValue===null)&&(this.modelValue===""||this.modelValue===null)?!1:this.initialValue!==this.modelValue}},created(){this.initialValue=this.modelValue,this.decimalSeprator=this.type==="currency"?r8[this.locale]:"."},methods:{handlerInput(e){const n=e.target.value;this.type==="currency"?this.$emit("update:modelValue",n.replace(this.decimalSeprator,".")):this.$emit("update:modelValue",n)},preventNonNumeric(e){if(this.type==="number"){const n=this.decimalPrecision,t=e.target.value,r=e.key;if(["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(r)||this.allowNegatives&&r==="-")return;if(r==="."&&n===0){e.preventDefault();return}if(r==="."&&t.includes(".")){e.preventDefault();return}if(r==="."||t.includes(".")&&!t.endsWith(".")&&r!=="Backspace"){const i=t.split(".");if(i.length>1&&i[1].length>=n){e.preventDefault();return}}if(isNaN(r)&&![".","Backspace","Tab"].includes(r)){e.preventDefault();return}}if(e.key==="Backspace"||this.ctrl)return!0;if(e.key==="Control"&&(this.ctrl=!0),this.type==="currency"||this.type==="number"){if(!this.getValue.includes(this.decimalSeprator)&&e.key===this.decimalSeprator)return!0;/[\deE+\-]/.test(e.key)||e.preventDefault()}return!0},handlerKeyup(e){e.key==="Control"&&(this.ctrl=!1)}}},o8=["data-test-id"],a8=["for","data-test-id"],s8=["data-test-id"],l8=["id","type","name","disabled","placeholder","value","maxlength","readonly","data-test-id"],c8=["data-test-id"],u8=["data-test-id"];function f8(e,n,t,r,i,o){const a=er("AppIcon");return V(),J("div",{class:"input","data-test-id":t.dataTestId},[t.label&&t.showLabel?(V(),J("label",{key:0,class:we({error_color:!!t.error}),for:t.label,"data-test-id":`${t.dataTestId}-label`},[Fe(xe(t.label)+" ",1),t.required?(V(),J("span",{key:0,class:we({error_color:!!t.error})},"*",2)):ge("",!0)],10,a8)):ge("",!0),t.editMode?(V(),J("div",{key:1,class:we(["input-wrapper ect-w-full",{errorBorder_color:!!t.error,highlight:o.isHighlight&&t.highlight}]),"data-test-id":`${t.dataTestId}-wrapper`},[t.icon?(V(),Ee(a,{key:0,class:"input-wrapper_icon",icon:t.icon,hover:t.ihover,color:t.icolor,size:19,disabled:t.idisabled,custom:t.icustom,tooltip:t.itooltip,"data-test-id":`${t.dataTestId}-icon`,direction:"top-right",onClick:n[0]||(n[0]=s=>e.$emit("iclick"))},null,8,["icon","hover","color","disabled","custom","tooltip","data-test-id"])):ge("",!0),C("input",{id:t.label,class:we(`ectheme-input-box ${t.size}`),type:t.type,style:ze({width:t.icon?"calc(100% - 36px)":"100%",height:`${t.height}px`,textAlign:t.textAlignment}),name:t.name,disabled:t.disabled,placeholder:t.placeholder,value:o.getValue,maxlength:t.max,readonly:t.isReadOnly,"data-test-id":`${t.dataTestId}-input`,onInput:n[1]||(n[1]=(...s)=>o.handlerInput&&o.handlerInput(...s)),onKeydown:n[2]||(n[2]=(...s)=>o.preventNonNumeric&&o.preventNonNumeric(...s)),onKeyup:n[3]||(n[3]=(...s)=>o.handlerKeyup&&o.handlerKeyup(...s)),onBlur:n[4]||(n[4]=s=>e.$emit("blur"))},null,46,l8)],10,s8)):ge("",!0),t.editMode?ge("",!0):(V(),J("p",{key:2,class:"value","data-test-id":`${t.dataTestId}-value`},xe(o.getValue),9,c8)),o.error_message?(V(),J("div",{key:3,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${t.dataTestId}-error`},xe(o.error_message),9,u8)):ge("",!0)],8,o8)}const d8=Re(i8,[["render",f8],["__scopeId","data-v-032ca141"]]),h8={name:"AtomSpinner",props:{dataTestId:{type:String,default:""}}},p8=["data-test-id"];function v8(e,n,t,r,i,o){return V(),J("div",{class:"spinner","data-test-id":t.dataTestId},null,8,p8)}const g8={name:"CustomDropdown",components:{AppIcon:We,AtomSpinner:Re(h8,[["render",v8],["__scopeId","data-v-771ed032"]])},props:{label:{type:String,default:""},placeholder:{type:String,default:""},options:{type:Array,default:()=>[]},display:{type:Array,default:()=>[]},modelValue:{type:String,default:""},error:{type:[Boolean,String],default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},select:{type:Boolean,default:!1},lookup:{type:Boolean,default:!1},search:{type:Boolean,default:!1},badge:{type:String,default:void 0},highlight:{type:Boolean,default:!1},property:{type:Object,default:()=>({key:"value",value:"label",assigned:"assigned"})},dropdownTheme:{type:String,default:"light"},icon:{type:String,default:""},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["search","focus-in","focus-out","update:modelValue"],data:()=>({inputFocused:!1,value:"",isHover:!1,highlightedIndex:-1,initialValue:"",teleportStyle:{position:"absolute",top:"0px",left:"0px",width:"0px"}}),computed:{isHighlight(){return(this.initialValue===""||this.initialValue==null)&&(this.modelValue===""||this.modelValue==null)?!1:this.initialValue!==this.modelValue},error_message(){return this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},getOptions(){if(this.select&&this.search){const e=this.value.toLowerCase();return this.options.filter(n=>JSON.stringify(n).toLowerCase().includes(e))}else return this.options},getSelected(){let e=null;if(this.modelValue)e=this.options.find(n=>n[this.property.key]===this.modelValue);else if(!this.search){const n=this.options.find(t=>t[this.property.key]==="");n?e=n:this.placeholder?e={[this.property.value]:this.placeholder,[this.property.key]:""}:e={[this.property.value]:"--Select--",[this.property.key]:""}}return e||{[this.property.value]:this.placeholder||"--Select--",[this.property.key]:""}},shouldShowAbove(){if(!this.$refs.triggerElement)return!1;const e=this.$refs.triggerElement.getBoundingClientRect(),n=250,t=window.innerHeight-e.bottom,r=e.top;return t<n&&r>n},dropdownStyle(){if(!this.$refs.triggerElement)return{};const e=this.$refs.triggerElement.getBoundingClientRect(),n=250,t=window.innerHeight-e.bottom,r=e.top,i=t<n&&r>n;return{position:"absolute",top:i?"auto":"100%",bottom:i?"100%":"auto",left:"0",width:"100%",zIndex:1e3}}},created(){this.initialValue=this.modelValue},mounted(){window.addEventListener("resize",this.updateDropdownPosition),window.addEventListener("scroll",this.updateDropdownPosition,!0)},beforeUnmount(){window.removeEventListener("resize",this.updateDropdownPosition),window.removeEventListener("scroll",this.updateDropdownPosition,!0)},methods:{updateDropdownPosition(){if(!this.$refs.triggerElement)return;const e=this.$refs.triggerElement.getBoundingClientRect(),n=200,t=window.innerHeight-e.bottom,r=e.top,i=t<n&&r>n;this.teleportStyle={position:"absolute",top:`${i?e.top-n:e.bottom}px`,left:`${e.left}px`,width:`${e.width}px`,zIndex:9999}},subFieldsText(e){if(!this.display||this.display.length<1)return"";const n=[];return this.display.forEach(t=>{const r=this.subField(e,t);r&&n.push(r)}),n.join(" | ")},subField(e,n){return n?n.split(".").reduce((i,o)=>i[o]||"",e):e},lookupSearchHandler:or(function(e){this.value=e,this.search&&!this.select&&this.$emit("search",e)}),handlerFocusIn(){!(this.modelValue&&this.search)&&!this.disabled&&(this.inputFocused=!0,this.updateDropdownPosition(),this.$emit("focus-in"))},updateSelected(e){e&&(this.value="",this.$emit("update:modelValue",e[this.property.key]),this.search&&!this.select&&!this.lookup&&this.$emit("search",""),this.onInputFocusedOut(!0))},clear(){this.disabled||(this.value="",this.$emit("update:modelValue",null),this.search&&!this.select&&!this.lookup&&this.$emit("search",""))},onInputFocusedOut(e=!1){(!this.isHover||e)&&!this.disabled&&(e?(this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")):setTimeout(()=>{this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")},100))},highlightNextOption(){this.highlightedIndex<this.options.length-1&&this.highlightedIndex++},highlightPreviousOption(){this.highlightedIndex>0&&this.highlightedIndex--}}},m8=["data-test-id"],y8=["for","data-test-id"],x8={class:"input-container-box ect-grow ect-w-full"},_8=["data-test-id"],b8=["placeholder","disabled","data-test-id"],C8=["data-test-id"],w8=["title","data-test-id"],E8=["data-test-id"],A8=["data-test-id"],k8=["data-test-id"],O8=["data-test-id"],S8=["data-test-id","onClick"],I8=["data-test-id"],T8={class:"ect-text-font-clr-light ect-flex ect-gap-2 ect-items-center ect-justify-between ect-w-full"},B8=["data-test-id"],D8=["data-test-id"],R8=["data-test-id"],L8=["title","data-test-id"],N8=["data-test-id"];function F8(e,n,t,r,i,o){const a=er("AppIcon"),s=er("AtomSpinner");return V(),J("div",{ref:"dropdownWrapper",class:we(["customdropdown input-container",{dark:t.dropdownTheme==="dark"}]),"data-test-id":t.dataTestId,onMouseenter:n[7]||(n[7]=u=>e.isHover=!0),onMouseleave:n[8]||(n[8]=u=>e.isHover=!1)},[t.label?(V(),J("label",{key:0,class:we(["title_label",{error_color:!!t.error}]),for:t.label,"data-test-id":`${t.dataTestId}-label`},[Fe(xe(t.label)+" ",1),t.required?(V(),J("span",{key:0,class:we({error_color:!!t.error})},"*",2)):ge("",!0)],10,y8)):ge("",!0),C("div",x8,[C("div",{ref:"triggerElement",class:we(["input-wrapper ectheme-input-box ect-w-full",{disabled:t.disabled,"input-error":t.error,highlight:o.isHighlight&&t.highlight,"size-large":t.size==="large","size-medium":t.size==="medium"||t.size==="small"}]),"data-test-id":`${t.dataTestId}-trigger`,tabindex:"0",onFocusin:n[2]||(n[2]=(...u)=>o.handlerFocusIn&&o.handlerFocusIn(...u)),onFocusout:n[3]||(n[3]=u=>o.onInputFocusedOut(!1)),onKeydown:[n[4]||(n[4]=ir(u=>o.updateSelected(t.options[e.highlightedIndex]),["enter"])),n[5]||(n[5]=ir(mt((...u)=>o.highlightPreviousOption&&o.highlightPreviousOption(...u),["prevent"]),["up"])),n[6]||(n[6]=ir(mt((...u)=>o.highlightNextOption&&o.highlightNextOption(...u),["prevent"]),["down"]))]},[!t.modelValue&&t.search?ln((V(),J("input",{key:0,ref:"searchInput","onUpdate:modelValue":n[0]||(n[0]=u=>e.value=u),type:"text",name:"search",placeholder:t.placeholder,autocomplete:"off",disabled:t.disabled,"data-test-id":`${t.dataTestId}-search-input`,onInput:n[1]||(n[1]=mt(u=>o.lookupSearchHandler(u.target.value),["prevent"]))},null,40,b8)),[[li,e.value]]):(V(),J("div",{key:1,class:we(["selection-name ect-text-text-primary-dark ect-flex ect-justify-between ect-items-center",{"size-large":t.size==="large","size-medium":t.size==="medium"||t.size==="small"}]),"data-test-id":`${t.dataTestId}-selection`},[o.getSelected?(V(),J(be,{key:0},[C("span",{title:o.getSelected[t.property.value],class:we(["ect-flex ect-items-center ect-gap-2 ect-font-medium",{"ect-text-font-clr-light":!t.modelValue}]),"data-test-id":`${t.dataTestId}-selection-value`},[t.icon?(V(),Ee(a,{key:0,class:"ect-mr-0",icon:t.icon,size:14,color:"#5F5F5F","data-test-id":`${t.dataTestId}-selection-icon`},null,8,["icon","data-test-id"])):ge("",!0),Fe(" "+xe(o.getSelected[t.property.value]),1)],10,w8),t.badge&&o.getSelected[t.badge]?(V(),J("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${t.dataTestId}-selection-badge`},xe(o.getSelected[t.badge]),9,E8)):ge("",!0)],64)):ge("",!0)],10,C8)),t.search?(V(),J(be,{key:2},[t.loading?(V(),Ee(s,{key:0,class:"spinner","data-test-id":`${t.dataTestId}-loading-spinner`},null,8,["data-test-id"])):(V(),J("div",{key:1,class:"clear-button","data-test-id":`${t.dataTestId}-action-button`},[e.value||t.modelValue?(V(),Ee(a,{key:0,disabled:t.disabled,icon:"close",color:"#acacac",size:10,"data-test-id":`${t.dataTestId}-clear-button`,onClick:o.clear},null,8,["disabled","data-test-id","onClick"])):(V(),Ee(a,{key:1,icon:"search",size:14,color:"#acacac",disabled:t.disabled,"data-test-id":`${t.dataTestId}-search-button`},null,8,["disabled","data-test-id"]))],8,A8))],64)):(V(),Ee(a,{key:3,class:"clear-button",color:o.error_message?"#ff6a6a":"#acacac",icon:"arrow_drop_up",size:12,disabled:t.disabled,"data-test-id":`${t.dataTestId}-dropdown-arrow`},null,8,["color","disabled","data-test-id"]))],42,_8),o.error_message?(V(),J("div",{key:0,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${t.dataTestId}-error`},xe(o.error_message),9,k8)):ge("",!0),o.getOptions&&e.inputFocused&&!t.disabled&&(t.select||t.lookup)?(V(),J("div",{key:1,ref:"dropdown",class:we(["dropdown",{"dropdown-above":o.shouldShowAbove}]),style:ze(o.dropdownStyle),"data-test-id":`${t.dataTestId}-dropdown`},[(V(!0),J(be,null,Me(o.getOptions,(u,f)=>(V(),J("div",{key:u[t.property.key],class:we(["dropdown-item",{highlighted:f===e.highlightedIndex,"ect-pointer-events-none":u[t.property.assigned]}]),"data-test-id":`${t.dataTestId}-option-${f}`,onClick:c=>o.updateSelected(u)},[C("div",{class:"name ect-items-center","data-test-id":`${t.dataTestId}-option-${f}-name`},[C("span",T8,[C("span",{class:we({"ect-text-zinc-400":u[t.property.assigned]}),"data-test-id":`${t.dataTestId}-option-${f}-value`},xe(u[t.property.value]==null?"Key and Value is Wrong":u[t.property.value]),11,B8),u[t.property.assigned]?(V(),J("span",{key:0,class:"ect-text-xs ect-leading-4 ect-text-zinc-600","data-test-id":`${t.dataTestId}-option-${f}-assigned`},"Assigned",8,D8)):ge("",!0)]),t.badge?(V(),J("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${t.dataTestId}-option-${f}-badge`},xe(u[t.badge]),9,R8)):ge("",!0)],8,I8),C("div",{class:"info",title:o.subFieldsText(u),"data-test-id":`${t.dataTestId}-option-${f}-info`},[C("span",null,xe(o.subFieldsText(u)),1)],8,L8)],10,S8))),128)),!o.getOptions.length&&!t.loading&&(e.value||t.select)?(V(),J("div",{key:0,class:"no-items-found","data-test-id":`${t.dataTestId}-no-options`}," no options found ",8,N8)):ge("",!0)],14,O8)):ge("",!0)])],42,m8)}const N0=Re(g8,[["render",F8],["__scopeId","data-v-5ae4f6dc"]]);var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ds(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function P8(e){if(e.__esModule)return e;var n=e.default;if(typeof n=="function"){var t=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),t}var F0={exports:{}};/*!
|
|
33
|
+
`+o):r.stack=o}catch{}}throw r}}_request(n,t){typeof n=="string"?(t=t||{},t.url=n):t=n||{},t=lr(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:o}=t;r!==void 0&&Io.assertOptions(r,{silentJSONParsing:fn.transitional(fn.boolean),forcedJSONParsing:fn.transitional(fn.boolean),clarifyTimeoutError:fn.transitional(fn.boolean)},!1),i!=null&&(de.isFunction(i)?t.paramsSerializer={serialize:i}:Io.assertOptions(i,{encode:fn.function,serialize:fn.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Io.assertOptions(t,{baseUrl:fn.spelling("baseURL"),withXsrfToken:fn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&de.merge(o.common,o[t.method]);o&&de.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),t.headers=Jt.concat(a,o);const s=[];let u=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(u=u&&g.synchronous,s.unshift(g.fulfilled,g.rejected))});const f=[];this.interceptors.response.forEach(function(g){f.push(g.fulfilled,g.rejected)});let c,v=0,l;if(!u){const p=[I0.bind(this),void 0];for(p.unshift(...s),p.push(...f),l=p.length,c=Promise.resolve(t);v<l;)c=c.then(p[v++],p[v++]);return c}l=s.length;let h=t;for(;v<l;){const p=s[v++],g=s[v++];try{h=p(h)}catch(d){g.call(this,d);break}}try{c=I0.call(this,h)}catch(p){return Promise.reject(p)}for(v=0,l=f.length;v<l;)c=c.then(f[v++],f[v++]);return c}getUri(n){n=lr(this.defaults,n);const t=y0(n.baseURL,n.url,n.allowAbsoluteUrls);return c0(t,n.params,n.paramsSerializer)}}de.forEach(["delete","get","head","options"],function(n){To.prototype[n]=function(t,r){return this.request(lr(r||{},{method:n,url:t,data:(r||{}).data}))}}),de.forEach(["post","put","patch"],function(n){function t(r){return function(o,a,s){return this.request(lr(s||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}To.prototype[n]=t(),To.prototype[n+"Form"]=t(!0)});const Bo=To;class cs{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},n(function(o,a,s){r.reason||(r.reason=new Pr(o,a,s),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const t=this._listeners.indexOf(n);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const n=new AbortController,t=r=>{n.abort(r)};return this.subscribe(t),n.signal.unsubscribe=()=>this.unsubscribe(t),n.signal}static source(){let n;return{token:new cs(function(i){n=i}),cancel:n}}}const e4=cs;function t4(e){return function(t){return e.apply(null,t)}}function n4(e){return de.isObject(e)&&e.isAxiosError===!0}const us={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(us).forEach(([e,n])=>{us[n]=e});const r4=us;function D0(e){const n=new Bo(e),t=Wu(Bo.prototype.request,n);return de.extend(t,Bo.prototype,n,{allOwnKeys:!0}),de.extend(t,n,null,{allOwnKeys:!0}),t.create=function(i){return D0(lr(e,i))},t}const Ge=D0(is);Ge.Axios=Bo,Ge.CanceledError=Pr,Ge.CancelToken=e4,Ge.isCancel=p0,Ge.VERSION=T0,Ge.toFormData=wo,Ge.AxiosError=Le,Ge.Cancel=Ge.CanceledError,Ge.all=function(n){return Promise.all(n)},Ge.spread=t4,Ge.isAxiosError=n4,Ge.mergeConfig=lr,Ge.AxiosHeaders=Jt,Ge.formToJSON=e=>d0(de.isHTMLForm(e)?new FormData(e):e),Ge.getAdapter=S0.getAdapter,Ge.HttpStatusCode=r4,Ge.default=Ge;class i4{constructor(n,t,r,i){this.awsURL="https://ec-apigw.blink.expedite1.com",this.headers={"x-api-key":n,"X-Salesforce-Org-Type":t,"X-Salesforce-Org-Id":r,"X-Salesforce-User-Id":i,"Content-Type":"application/json"}}}const R0=wt("comShare",()=>{const e=te(""),n=te(""),t=te(""),r=te(""),i=te(""),o=te(""),a=te(""),s=te("Single"),u=me(()=>s.value==="Single");async function f(c){e.value=c.orgType||"Production",n.value=c.orgId||"",t.value=c.userId||"",r.value=c.accountId||"",i.value=c.opportunityId||"",a.value=c.userLocale||"en_US",s.value=c.pricingSchema||"Single"}return{orgType:e,orgId:n,userId:t,accountId:r,opportunityId:i,userLocale:a,pricingSchema:s,quoteId:o,isSinglePricingSchema:u,setSetupData:f}});function o4(e){return e.offerData.pricingTypes.forEach(n=>{n.appliedOnField==="Catalog Price"?(e.catalogPrice=n,e.salesPrice=n.offerPrice,e.price=n.offerPrice):n.appliedOnField==="MRC"?(e.mrcPrice=n,e.mrc=n.offerPrice):n.appliedOnField==="YRC"&&(e.yrcPrice=n,e.yrc=n.offerPrice)}),e}function a4(e){const n=t=>Math.min(...t.options.map(r=>r.relationshipInfo.primarySortOrder));return e.forEach(t=>{t.itemTypes.forEach(r=>{r.options.sort((i,o)=>i.relationshipInfo.primarySortOrder-o.relationshipInfo.primarySortOrder||i.itemName.localeCompare(o.itemName))}),t.itemTypes.sort((r,i)=>n(r)-n(i)||r.itemTypeName.localeCompare(i.itemTypeName))}),e.sort((t,r)=>{const i=Math.min(...t.itemTypes.map(n)),o=Math.min(...r.itemTypes.map(n));return i-o||t.category.localeCompare(r.category)}),e}const s4=(e,n)=>{const t=(r,i)=>typeof i=="function"?void 0:i;return JSON.stringify(e,t)===JSON.stringify(n,t)};class l4 extends i4{constructor(n,t,r,i){super(n,t,r,i)}async getAvailableConfiguration(n){return(await Ge.post(`${this.awsURL}/product-pricing/getAvailableConfiguration`,n,{headers:this.headers})).data}async getLineItems({request:n}){const t=await Ge.post(`${this.awsURL}/quoting/getConfiguredLineItems`,n,{headers:this.headers});return console.info("getLineItems:response",t.data),t.data}async maintainQuoteConfiguration({request:n}){const t=await Ge.post(`${this.awsURL}/transactions/maintainConfiguration`,n,{headers:this.headers});return console.info("maintainQuoteConfiguration:response",t.data),t.data}async getProductCrossSells({objectId:n,productItemId:t}){const r=await Ge.get(`${this.awsURL}/pricing/getProductCrossSells?productItemId=${t}&objectId=${n}`,{headers:this.headers});return console.info("getProductCrossSells:response",r.data),r.data}async addLines({request:n}){const t=await Ge.post(`${this.awsURL}/transactions/addLines`,n,{headers:this.headers});return console.info("addLines:response",t.data),t.data}async evaluateConfigurationSelection({request:n}){const t=await Ge.post("https://api-svc.blink.expedite1.com/api/product-pricing/evaluateConfigurationSelection",n,{headers:this.headers});return console.info("evaluateConfigurationSelection:response",t.data),t.data}}const dn=wt("comConfigurator",()=>{const e=te(null),n=Qt(),t=R0(),r=fi(),i=te(null),o=te(null),a=te(null),s=te(null),u=te(null),f=te([]),c=te(null),v=te([]),l=te([]),h=te(null),p=te(new Map),g=te(!1),d=te({init:!1,configuration:!1,lineItem:!1,productOptionsPricing:!1,bestOfferPrice:!1,lineItemAttributes:!1,save:!1}),m=te(!1),y=me(()=>_.value&&!t.isSinglePricingSchema),_=me(()=>{var j;if(!s.value||!((j=s.value.categoryOptions)!=null&&j.length)>0)return!1;let M=!0,U=!0,Z=!0,z=null,F=!1;for(const se of s.value.categoryOptions)for(const fe of se.itemTypes)for(const ce of fe.options)ce.billingPeriod&&(z&&z!==ce.billingPeriod&&(Z=!1),z=ce.billingPeriod,!ce.yrcPrice&&ce.billingPeriod==="Monthly"&&(M=!1),!ce.mrcPrice&&ce.billingPeriod==="Yearly"&&(U=!1),F=!0);return M&&U&&Z&&F}),x=me(()=>!s4(s.value,u.value)),b=me(()=>{var U;const M=((U=s.value)==null?void 0:U.categoryOptions)||[];return M.forEach(Z=>{Z.itemTypes.forEach(z=>{z.selectedOptions=z.options.filter(F=>z.selected.includes(F.itemId)),z.totalPrice=function(){return z.selectedOptions.reduce((F,j)=>F+j.price*j.qty,0)||0},z.oneTimePrice=function(){return z.selectedOptions.filter(F=>!F.billingPeriod).reduce((F,j)=>F+j.price*j.qty,0)||0},z.recurringPrice=function(){return z.selectedOptions.filter(F=>F.billingPeriod).reduce((F,j)=>F+j.price*j.qty,0)||0}}),Z.selectedItemTypes=Z.itemTypes.filter(z=>z.selected.length>0),Z.totalPrice=function(){return Z.itemTypes.reduce((z,F)=>z+F.totalPrice(),0)},Z.oneTimePrice=function(){return Z.itemTypes.reduce((z,F)=>z+F.oneTimePrice(),0)},Z.recurringPrice=function(){return Z.itemTypes.reduce((z,F)=>z+F.recurringPrice(),0)}}),M.filter(Z=>Z.itemTypes.filter(z=>z.selected.length>0).length>0)}),S=me(()=>b.value.reduce((M,U)=>M+U.totalPrice(),0)),A=me(()=>{if(!s.value)return{basePrice:0,addOns:0,oneTimePrice:0,recurringPrice:0,total:0};const M=b.value.reduce((z,F)=>z+F.totalPrice(),0);let U=b.value.reduce((z,F)=>z+F.oneTimePrice(),0),Z=b.value.reduce((z,F)=>z+F.recurringPrice(),0);return s.value.billingPeriod?Z=(Z+s.value.price)*s.value.qty:U=(U+s.value.price)*s.value.qty,{basePrice:s.value.price,addOns:M,oneTimePrice:U,recurringPrice:Z,total:s.value.price*s.value.qty+M*s.value.qty+U+Z}}),I=me(()=>{var U,Z,z,F;const M=new Map;return(U=c.value)!=null&&U.productLineItem&&M.set((Z=c.value)==null?void 0:Z.productLineItem.XX_ORD1__Item__c,(z=c.value)==null?void 0:z.productLineItem),(F=c.value)==null||F.options.forEach(j=>{M.set(j.XX_ORD1__Item__c,j)}),M}),B=me(()=>{var U;const M=new Map;return s.value&&((U=s.value.categoryOptions)==null?void 0:U.length)>0&&s.value.categoryOptions.forEach(Z=>{Z.itemTypes.forEach(z=>{z.options.forEach(F=>{M.set(F.publishKey,F)})})}),M}),O=me(()=>{if(!s.value)return{};const M=z=>!z||!Array.isArray(z)?[]:z.map(F=>({label:F.label,field:F.apiName,dataType:F.dataType,picklistValues:F.picklistValues,isEditable:F.editable,defaultValue:F.defaultValue,value:F.dataType==="BOOLEAN"?F.value?"true":"false":F.dataType==="REFERENCE"?F.referenceRecordId||F.value||"":F.value||""})),U={itemId:s.value.itemId,qliId:s.value.qliId||null,name:s.value.itemName,qty:s.value.qty||1,salesPrice:s.value.price||0,mrc:s.value.mrc||null,yrc:s.value.yrc||null,attributes:M(s.value.attributes)},Z=[];return s.value.categoryOptions.forEach(z=>{z.itemTypes.forEach(F=>{F.options.forEach(j=>{F.selected.includes(j.itemId)&&Z.push({itemId:j.itemId,qliId:j.qliId||null,name:j.itemName,qty:j.qty||1,salesPrice:j.price||0,mrc:j.mrc||null,yrc:j.yrc||null,attributes:M(j.attributes)})})})}),{[s.value.itemId]:{product:U,options:Z}}}),E=(M,U)=>{if(!M||!Array.isArray(M))return[];const Z=new Map;return U.forEach(z=>{Z.set(z.fieldAPIName,z.value)}),M.map(z=>(z.value=Z.get(z.fieldAPIName)||null,z))};function k(M,U){console.log("updateCurrentConfiguration:newConfiguration",JSON.stringify(M)),console.log("updateCurrentConfiguration:suggestedConfigurations",JSON.stringify(U)),U&&(l.value=U.filter(z=>z.product.itemId!==M.product.itemId));const Z=new Map;M.options.forEach(z=>{Z.set(z.itemId,z)}),s.value.itemName=M.product.name,s.value.qty=M.product.qty,s.value.price=M.product.salesPrice,s.value.attributes=E(s.value.attributes,M.product.attributes),s.value.categoryOptions.forEach(z=>{z.itemTypes.forEach(F=>{F.selected=[],F.options.forEach(j=>{Z.has(j.itemId)&&(j.itemName=Z.get(j.itemId).name,j.qty=Z.get(j.itemId).qty,j.price=Z.get(j.itemId).salesPrice,j.qliId=Z.get(j.itemId).qliId,j.attributes=E(j.attributes,Z.get(j.itemId).attributes),F.selected.push(j.itemId))})})}),s.value={...s.value}}function R(){return{get getConfig(){return O.value},setConfig:k}}function N(M){s.value.qliId&&(s.value.qliBillingPeriod==="Monthly"&&!M?s.value.price=s.value.salesPrice||s.value.mrc:s.value.qliBillingPeriod==="Yearly"&&M&&(s.value.price=s.value.salesPrice)),s.value.categoryOptions.forEach(U=>{U.itemTypes.forEach(Z=>{Z.options.forEach(z=>{z.billingPeriod&&(z.price=(M?z.yrcPrice.offerPrice:z.mrcPrice.offerPrice)||z.price,z.qliId&&(z.qliBillingPeriod==="Monthly"&&!M?z.price=z.salesPrice||z.mrc:z.qliBillingPeriod==="Yearly"&&M&&(z.price=z.salesPrice)))})})})}function q(){s.value=null,u.value=null,f.value=[],a.value=null,c.value=null,h.value=null,p.value=new Map,g.value=!1,d.value.configuration=!1,d.value.lineItem=!1,d.value.productOptionsPricing=!1,d.value.bestOfferPrice=!1,d.value.lineItemAttributes=!1,d.value.save=!1}function G(M,U,Z,z){e.value=new l4(M,U,Z,z)}async function Y(M,U,Z){d.value.init=!0,console.time("CONFIGURATOR INIT CONFIGURATOR"),q(),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","1"),o.value=M,a.value=U,i.value=Z||t.quoteId;const z=await ne();console.timeLog("CONFIGURATOR INIT CONFIGURATOR","2"),s.value=Q(z),a.value?(await w(),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","3"),P(s.value),s.value.categoryOptions.forEach(F=>{F.itemTypes.forEach(j=>{j.options.forEach(se=>{P(se),(I.value.has(se.itemId)||se.relationshipInfo.relationship==="Kit")&&j.selected.push(se.itemId)})})}),console.timeLog("CONFIGURATOR INIT CONFIGURATOR","4")):w(),u.value=JSON.parse(JSON.stringify(s.value)),console.timeEnd("CONFIGURATOR INIT CONFIGURATOR"),d.value.init=!1}async function ne(){try{const M={accountId:t.accountId,objectId:i.value,itemId:o.value,configScope:"BASIC",fields:[],pricePreference:"Lowest Price"},U=await e.value.getAvailableConfiguration(M);console.info("getAvailableConfiguration:result",U);const Z=U.data.productConfiguration;return Z.categoryOptions=a4(Z.categoryOptions),Z}catch(M){return console.info("error",M.message),!1}}function Q(M){p.value.set(a.value,M.attributes),f.value=M.configRules;const U=new Set;return f.value.forEach(Z=>{const z=JSON.parse(Z.ruleJson);z.optionSelected.forEach(F=>{U.add(F)}),z.affectedOptions.forEach(F=>{U.add(F)})}),console.info("rulesByPublishKey",U),P(M),M.categoryOptions.forEach(Z=>{Z.key=Z.category.toLowerCase().replace(/\s+/g,"-").replace(/[&]/g,""),Z.itemTypes.forEach(z=>{z.selected=[],z.numberOfColumns||(z.numberOfColumns=1),z.numberOfColumns>1&&(z.lightboxAttributes=!0),z.maxNumber||(z.maxNumber=100),z.minNumber||(z.minNumber=0),z.maxQuantity||(z.maxQuantity=1e4),z.minQuantity||(z.minQuantity=1),z.maxNumber===1?(z.isRadio=!0,z.minMessage="Please select 1 option",z.maxMessage="",z.isKit=z.options.some(F=>F.relationshipInfo.relationship==="Kit")):(z.minMessage=`Minimum of ${z.minNumber} selection${z.minNumber!==1?"s":""} required`,z.maxMessage=`Maximum of ${z.maxNumber} selection${z.maxNumber!==1?"s":""} allowed`),z.options.forEach(F=>{Z.showImage=Z.showImage||!!F.defaultImageURL,F.showAttributesModal=!1,F.calculateRules=U.has("option."+F.publishKey),console.info("option.calculateRules",F.calculateRules),F.qty=z.minQuantity||1,F.getTags=()=>(F.attributes=F.attributes||[],F.attributes.filter(j=>j.value!==null&&j.value!=="").map(j=>({label:j.label,value:j.value}))),Object.defineProperty(F,"isDisabled",{get:function(){return F.relationshipInfo.relationship==="Kit"||(z.isRadio?z.isKit:!z.selected.includes(F.itemId)&&z.maxNumber===z.selected.length)}}),P(F)})})}),M}function P(M){M.isAttributes=M.attributes&&M.attributes.length>0;const U=M.catalogItem;if(I.value.has(M.itemId)){const Z=I.value.get(M.itemId);M.qliId=Z.Id,M.qty=Z.XX_ORD1__QTY__c,M.itemName=Z.XX_ORD1__Line_Description__c,M.billingPeriod=Z.XX_ORD1__Billing_Period__c,M.price=Z.XX_ORD1__Sales_Price__c,M.billingPeriod?M.price=Z.XX_ORD1__Sales_Price__c||Z.XX_ORD1__MRC__c:M.price=Z.XX_ORD1__NRC__c||Z.XX_ORD1__Sales_Price__c,M.salesPrice=Z.XX_ORD1__Sales_Price__c,M.nrc=Z.XX_ORD1__NRC__c,M.mrc=Z.XX_ORD1__MRC__c,M.qliBillingPeriod=Z.XX_ORD1__Billing_Period__c,p.value.set(M.qliId,M.attributes)}else M.itemName=U.XX_ORD1__Line_Description__c||M.itemName,M.price=U.XX_ORD1__Negotiated_Price__c||U.XX_ORD1__NRC_for_New__c,M.nrcPrice=U.XX_ORD1__NRC_for_New__c,M.qty=M.qty||1,o4(M)}async function w(){d.value.lineItem=!0,console.info("getLineItems",i.value,a.value);try{const M={objectId:i.value,filters:{},additionalFields:["Name","XX_ORD1__Line_Description__c","XX_ORD1__SYS_Configuration_Status2__c"],primarySort:{field:"CreatedDate",direction:"DESC"},productPage:{limit:200,offset:0,productLineItemId:a.value}},U=await e.value.getLineItems({request:JSON.stringify(M)});return(U.data.products||[]).forEach(z=>{const F=z.productLineItem;F.Id===a.value?c.value=z:v.value.push(F)}),console.info("lineItem.value",c.value),console.info("configurableLineItems.value",v.value),d.value.lineItem=!1,U}catch(M){return console.info("error",M.message),d.value.lineItem=!1,!1}}async function D(M){console.info("getRecords");try{const U=await window.productManagerController.getRecords({request:JSON.stringify(M)});return console.info("getRecords:result",U),JSON.parse(U.data)}catch(U){return console.info("error",U.message),!1}}async function L(){g.value=!0,d.value.save=!0,console.info("maintainQuoteConfiguration");const M=[],U=[];s.value.categoryOptions.forEach(F=>{F.itemTypes.forEach(j=>{j.options.forEach(se=>{j.selected.includes(se.itemId)?M.push($(se)):se.qliId&&U.push(se.qliId)})})});const Z={objectId:i.value,eCatalogId:t.eCatalogId,isGenesisAI:!0,blinkUser:!1,optionsToRemove:U,grandFatheredOptionsToRemove:[],productLineItem:{...$(s.value),optionLineItems:M}};console.info("maintainQuoteConfiguration:request",Z);const z=await e.value.maintainQuoteConfiguration({request:JSON.stringify(Z)});if(console.info("maintainQuoteConfiguration:result",z),z!=null&&z.error){const F={title:"Unable to Save Configuration",description:z.error,button:{label:"Back to Configuration",action:()=>{g.value=!1}},cancel:{label:"Quote List",action:()=>{r.push("/quote-item?id="+i.value)}}};n.errorPopup=F}else if(u.value=JSON.parse(JSON.stringify(s.value)),console.info("maintainQuoteConfiguration:result",z),d.value.save=!1,!a.value)return s.value.qliId=z.data.productLineItem.lineItemId,a.value=z.data.productLineItem.lineItemId,z.data.productLineItem.lineItemId;d.value.save=!1}function $(M){const U={};M.isAttributes&&M.attributes.forEach(z=>{!z.apiName.includes(".")&&z.value!==null&&z.value!==void 0&&(z.dataType==="BOOLEAN"?U[z.apiName]=z.value?"true":"false":z.dataType==="REFERENCE"?U[z.apiName]=z.referenceRecordId:U[z.apiName]=z.value)});const Z={attributes:U,itemId:M.itemId,lineItemId:M.qliId,lineDescription:M.itemName,qty:M.qty,billingPeriod:M.billingPeriod,...M.offer};return M.billingPeriod&&_.value&&!t.isSinglePricingSchema&&(Z.billingPeriod=m.value?"Yearly":"Monthly"),!t.isSinglePricingSchema&&!M.billingPeriod?Z.nrcPrice=M.price:(Z.applyOnField="Catalog Price",Z.salesPrice=M.price,Z.nrcPrice=M.nrcPrice),Z}async function W(){const M={objectId:t.accountId,productItemId:o.value};try{let U=await e.value.getProductCrossSells(M);const{crossSells:Z,offerResult:z}=U.data;if(Z.length===0)return[];const F=new Map;return z.forEach(j=>{F.set(j.eCatalogItemId,{...j,...j.pricingTypes[0]})}),Z.forEach(j=>{j.loading=!1,j.Name=j.XX_ORD1__Line_Description__c||j.XX_ORD1__Item__r.Name,j.Description=j.XX_ORD1__Item__r.XX_ORD1__Product_Description__c,F.has(j.Id)?(j.Price=F.get(j.Id).offerPrice,j.priceFormatted=F.get(j.Id).formattedOfferPrice,j.offer={offerDiscount:F.get(j.Id).offerDiscount,offerId:F.get(j.Id).offerId,offerType:F.get(j.Id).offerType}):(j.Price=j.XX_ORD1__List_Price2__c,j.priceFormatted=j.XX_ORD1__List_Price2__c,j.offer={offerDiscount:0,offerId:null,offerType:null})}),Z}catch(U){return console.info("error",U.message),!1}}const H=M=>!M||!Array.isArray(M)?[]:M.filter(U=>U.apiName&&U.value!==null&&U.value!==void 0&&U.value!=="").map(U=>({attrName:U.apiName,attrValue:U.dataType==="BOOLEAN"?U.value:U.value||"",dataType:U.dataType}));async function X(M,U){const Z={product:{publishKey:s.value.publishKey,attributes:H(s.value.attributes),lineDescription:s.value.itemName,meta:{XX_ORD1__Sales_Price__c:s.value.price,XX_ORD1__MRC__c:s.value.mrc,XX_ORD1__NRC__c:s.value.nrc,XX_ORD1__YRC__c:s.value.yrc,quantity:s.value.qty}},options:[]};s.value.categoryOptions.forEach(j=>{j.itemTypes.forEach(se=>{se.options.forEach(fe=>{se.selected.includes(fe.itemId)&&Z.options.push({publishKey:fe.publishKey,attributes:H(fe.attributes),lineDescription:fe.itemName,meta:{XX_ORD1__Sales_Price__c:fe.price,XX_ORD1__MRC__c:fe.mrc,XX_ORD1__NRC__c:fe.nrc,XX_ORD1__YRC__c:fe.yrc,quantity:fe.qty}})})})}),console.info("evaluateConfigSelection:currentConfig.options",Z.options);const z={itemId:o.value,currentConfig:Z,selected:M?{publishKey:M==null?void 0:M.publishKey,attributes:H(M.attributes),lineDescription:M.itemName}:{},unselected:U?{publishKey:U==null?void 0:U.publishKey,attributes:H(U.attributes),lineDescription:U.itemName}:{}};return await e.value.evaluateConfigurationSelection({request:JSON.stringify(z)})}async function ee(M){const U={objectId:i.value,lstLIRequest:[{eCatalogItemId:M.Id,quantity:1,offerApplicable:M.offer}]};try{const Z=await e.value.addLines({request:JSON.stringify(U)});console.info("addLines:result",Z)}catch(Z){return console.info("error",Z.message),!1}}return{itemId:o,configuration:s,_configurationCopy:u,lineItem:c,savedScreen:g,loading:d,summary:b,addOns:S,summaryPrices:A,optionByItemId:I,attributesByQLIId:p,optionByPublishKey:B,showYearlyPricing:m,isYearlyPricingExist:_,isChangedConfiguration:x,isRecurringPricingSchema:y,configurableLineItems:v,suggestedConfigurations:l,initializeController:G,exposeProperties:R,updateCurrentConfiguration:k,changePricingScheme:N,addLines:ee,resetConfigurator:q,getRecords:D,getProductCrossSells:W,initConfigurator:Y,maintainQuoteConfiguration:L,evaluateConfigSelection:X}}),c4={class:"ect-p-4 ect-flex ect-gap-2 ect-items-center ect-justify-between ect-border-b ect-border-gray-200"},u4={class:"ect-flex ect-items-center ect-gap-3"},f4={class:"ect-text-xl ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},d4={key:0,class:"ect-flex ect-gap-1.5 ect-items-center"},h4=C("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Saving configuration...",-1),p4={key:1,class:"ect-flex ect-gap-1.5 ect-items-center"},v4=C("span",{class:"ect-text-sm ect-text-gray-700 ect-leading-relaxed"},"Configuration Saved Successfully",-1),g4={key:1,class:"ect-flex ect-flex-col ect-gap-4 ect-flex-1 ect-overflow-y-auto ect-mb-16"},m4=C("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed ect-p-4 ect-pb-0"},"You may consider these products",-1),y4={class:"ect-flex ect-flex-col ect-gap-4 ect-p-4 ect-pt-0 ect-overflow-y-auto"},x4=["data-test-id"],_4={class:"ect-flex-1 ect-flex ect-flex-col ect-gap-2"},b4={class:"ect-text-sm ect-font-semibold ect-text-gray-800 ect-leading-tight"},C4={class:"ect-text-sm ect-font-medium ect-text-gray-600 ect-leading-relaxed ect-line-clamp-2"},w4={class:"ect-flex ect-flex-row ect-justify-between ect-items-center"},E4={class:"ect-text-sm ect-font-semibold ect-text-gray-800"},A4={key:2,class:"ect-flex ect-flex-col ect-gap-4 ect-m-4 ect-flex-1 ect-overflow-y-auto"},k4=C("h3",{class:"ect-text-lg ect-font-semibold ect-text-gray-700 ect-leading-relaxed"},"What do you want to do next?",-1),O4={class:"ect-flex ect-flex-col ect-gap-4"},S4=["data-test-id","onClick"],I4={class:"ect-flex ect-items-center ect-justify-center"},T4={class:"ect-flex ect-flex-col ect-items-center ect-gap-2 ect-w-full"},B4=["data-test-id"],D4=["data-test-id"],R4={__name:"ConfiguratorRecommend",setup(e){const n=dn();fi();const t=me(()=>n.configuration),r=te(!0),i=te(""),o=te([{icon:"configuration",title:"Back to current Product Configuration",description:"Returns to the active product configuration page.",link:"/item/overview",action:"backToConfiguration"}]),a=te(null),s=te([]),u=async p=>{p.loading=!0,await n.addLines(p),p.disabled=!0,p.loading=!1},f=me(()=>{var p;if(((p=n.suggestedConfigurations)==null?void 0:p.length)>0){const g=n.suggestedConfigurations[0];return{Name:g.product.name,Description:g.product.description,Price:g.product.salesPrice,XX_ORD1__Item__c:g.product.itemId}}return null}),c=p=>{p.action==="backToConfiguration"&&(n.savedScreen=!1)};async function v(){const p=n.configurableLineItems,g=p.filter(m=>m.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration").length;i.value=`(${p.length-g}/${p.length})`;const d=p.find(m=>m.XX_ORD1__SYS_Configuration_Status2__c=="Needs Configuration"&&m.Id!=n.qliId);return a.value=d?{Name:d.XX_ORD1__Line_Description__c,Description:d.XX_ORD1__Product_Description__c,Price:d.XX_ORD1__Sales_Price__c,XX_ORD1__Item__c:d.XX_ORD1__Item__c,Id:d.Id}:null,p}async function l(){n.resetConfigurator(),await n.initConfigurator(f.value.XX_ORD1__Item__c,null),n.updateCurrentConfiguration(n.suggestedConfigurations[0],n.suggestedConfigurations)}async function h(){n.resetConfigurator(),n.initConfigurator(a.value.XX_ORD1__Item__c,a.value.Id)}return qn(async()=>{r.value=!0;const p=await v(),g=await n.getProductCrossSells(),d=new Set;p.forEach(m=>{d.add(m.XX_ORD1__Item__c)}),g.forEach(m=>{m.disabled=d.has(m.XX_ORD1__Item__c)}),s.value=g||[],r.value=!1}),(p,g)=>(V(),J(be,null,[C("div",c4,[C("div",u4,[he(We,{icon:"arrow",symbol:"",size:12,onClick:g[0]||(g[0]=d=>Ne(n).savedScreen=!1)}),C("h2",f4,xe(t.value.itemName),1)]),Ne(n).loading.save?(V(),J("div",d4,[he(Hu,{svg:""}),h4])):(V(),J("div",p4,[he(We,{icon:"check",color:"#136E05",size:14,"data-test-id":"item-tabs-before-button-icon"}),v4]))]),r.value?(V(),Ee($u,{key:0,type:"recommendations",rows:4})):s.value.length>0?(V(),J("div",g4,[m4,C("div",y4,[(V(!0),J(be,null,Me(s.value,(d,m)=>(V(),J("div",{key:d.Id||m,class:"ect-bg-white ect-border ect-border-gray-300 ect-rounded-md ect-p-3 ect-flex ect-flex-col","data-test-id":`configurator-recommend-card-${d.Id||m}`},[C("div",_4,[C("h4",b4,xe(d.Name),1),C("p",C4,xe(d.Description),1)]),C("div",w4,[C("div",E4,xe(Ne(Pt)(d.Price)),1),he(Ut,{btype:d.disabled?"secondary":"primary","button-style":d.disabled?"normal":"outlined",size:"medium",class:we({"ect-w-[120px]":d.loading}),loading:d.loading,disabled:d.disabled||d.loading,"data-test-id":`configurator-recommend-button-add-${d.Id||m}`,onClick:y=>u(d)},{default:Ve(()=>[Fe(xe(d.loading?"":d.disabled?"Added to Quote":"Add to Quote"),1)]),_:2},1032,["btype","button-style","class","loading","disabled","data-test-id","onClick"])])],8,x4))),128))])])):(V(),J("div",A4,[k4,C("div",O4,[(V(!0),J(be,null,Me(o.value,(d,m)=>(V(),J("div",{key:d.title||m,class:"ect-bg-white ect-border ect-border-[#DEDEDE] ect-rounded-xl ect-p-4 md:ect-p-5 lg:ect-p-6 ect-flex ect-flex-col ect-items-center ect-gap-4 md:ect-gap-6 lg:ect-gap-8 ect-cursor-pointer ect-transition-all ect-duration-200 hover:ect-shadow-md hover:ect-border-gray-400","data-test-id":`configurator-recommend-redirect-card-${m}`,onClick:y=>c(d)},[C("div",I4,[he(We,{icon:d.icon,size:20,color:"#000000","data-test-id":`configurator-recommend-redirect-icon-${m}`},null,8,["icon","data-test-id"])]),C("div",T4,[C("h4",{class:"ect-text-sm ect-font-semibold ect-text-[#5F5F5F] ect-text-center ect-leading-[1.43]","data-test-id":`configurator-recommend-redirect-title-${m}`},xe(d.title),9,B4),C("p",{class:"ect-text-sm ect-font-normal ect-text-[#828282] ect-text-center ect-leading-[1.71]","data-test-id":`configurator-recommend-redirect-description-${m}`},xe(d.description),9,D4)])],8,S4))),128))])])),f.value?(V(),Ee(ju,{key:3,title:"Configuere next AI suggested product","configuered-product":f.value,"count-configued-product-string":i.value,onConfigureNextProduct:l},null,8,["configuered-product","count-configued-product-string"])):(V(),Ee(ju,{key:4,title:`Configuere next product from your quote ${i.value}`,"configuered-product":a.value,"count-configued-product-string":i.value,onConfigureNextProduct:h},null,8,["title","configuered-product","count-configued-product-string"]))],64))}},L4=["data-test-id"],N4=Re({__name:"AppPill",props:{variant:{type:String,default:"",validator:e=>["success","error",""].includes(e)},dataTestId:{type:String,default:""}},setup(e){return(n,t)=>(V(),J("span",{class:we(["ect-pill",{"ect-pill-success":e.variant==="success","ect-pill-error":e.variant==="error","ect-pill-default":!e.variant}]),"data-test-id":e.dataTestId},[Je(n.$slots,"default",{},void 0,!0)],10,L4))}},[["__scopeId","data-v-c7f05fa0"]]),F4=["data-test-id"],P4=["data-test-id"],M4=["data-test-id","onClick"],q4=["data-test-id"],$4=Re({__name:"AppTabsV2",props:{showTabs:{type:Boolean,default:!0},modelValue:{type:String,default:""},border:{type:Boolean,default:!1},tabs:{type:Array,required:!0,validator:e=>e.every(n=>typeof n=="object"&&n.title&&n.key&&(n.sections===void 0||Array.isArray(n.sections)))},dataTestId:{type:String,required:!0}},emits:["update:modelValue","tab-change"],setup(e,{emit:n}){const t=e,r=n,i=me(()=>{var a;return t.modelValue||((a=t.tabs[0])==null?void 0:a.key)||""}),o=a=>{r("update:modelValue",a),r("tab-change",a)};return(a,s)=>(V(),J("div",{class:"ect-page-tabs","data-test-id":e.dataTestId},[e.showTabs?(V(),J("div",{key:0,class:we(["ect-page-tabs-header",[{"ect-tab-border":e.border}]]),"data-test-id":`${e.dataTestId}-header`},[(V(!0),J(be,null,Me(e.tabs,u=>(V(),J("button",{key:u.key,class:we(["ect-page-tab-button",`ect-page-tab-button${i.value===u.key?"-active":""} ${u.tabClass||""}`]),"data-test-id":`${e.dataTestId}-tab-${u.key}`,onClick:f=>o(u.key)},[Fe(xe(u.title)+" ",1),u.pill!==void 0&&u.pill!==null?(V(),Ee(N4,{key:0,class:"ect-ml-2",variant:u.pillStyle,"data-test-id":`${e.dataTestId}-tab-${u.key}-pill`},{default:Ve(()=>[Fe(xe(u.pill),1)]),_:2},1032,["variant","data-test-id"])):ge("",!0)],10,M4))),128))],10,P4)):ge("",!0),C("div",{class:"ect-page-tab-content","data-test-id":`${e.dataTestId}-content`},null,8,q4)],8,F4))}},[["__scopeId","data-v-f22cb1ed"]]),j4=["data-test-id"],H4=["disabled","data-test-id"],V4=["value","disabled","data-test-id"],U4=["disabled","data-test-id"],Do={__name:"CounterButton",props:{value:{type:Number,required:!0,default:null},min:{type:Number,default:1},max:{type:Number,default:999},empty:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:value","change"],setup(e,{emit:n}){const t=e,r=n,i=me(()=>t.min==null?0:t.min),o=me(()=>t.max==null?999:t.max),a=(x,b,S)=>Math.min(Math.max(x,b),S),s=x=>{if(x==null||x==="")return NaN;const b=Number(x);return Number.isFinite(b)?b:NaN},u=te(null),f=te(t.value??i.value),c=x=>{f.value=a(x,i.value,o.value)};t.value!==null&&c(t.value);const v=me(()=>f.value),l=me(()=>u.value!=null?u.value:String(v.value)),h=me(()=>t.disabled||v.value<=i.value),p=me(()=>t.disabled||v.value>=o.value);function g(x){x!==t.value&&(f.value=x,r("update:value",x),r("change",x))}function d(){if(h.value)return;const x=a(v.value-1,i.value,o.value);u.value=null,g(x)}function m(){if(p.value)return;const x=a(v.value+1,i.value,o.value);u.value=null,g(x)}function y(x){const S=String(x.target.value??"").replace(/\D+/g,"");u.value=S}function _(){const x=s(u.value),b=i.value,S=a(Number.isNaN(x)?b:x,i.value,o.value);u.value=null,g(S)}return(x,b)=>(V(),J("div",{class:"ect-flex ect-items-center ect-gap-1","data-test-id":e.dataTestId},[C("button",{type:"button",class:we(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":h.value,"ect-cursor-not-allowed":h.value}]),disabled:h.value,"data-test-id":`${e.dataTestId}-decrement`,onClick:d}," - ",10,H4),C("input",{type:"text",inputmode:"numeric",pattern:"[0-9]*",value:e.empty?"":l.value,disabled:e.disabled,class:"ect-h-7 ect-w-[48px] ect-px-2 ect-border ect-border-gray ect-rounded-md ect-text-center ect-text-sm ect-font-medium ect-text-gray-900 focus:ect-outline-none focus:ect-border-gray-400 ect-bg-white","data-test-id":`${e.dataTestId}-input`,onInput:y,onBlur:_},null,40,V4),C("button",{type:"button",class:we(["ect-h-7 ect-w-7 ect-border ect-border-gray ect-rounded-md ect-flex ect-items-center ect-justify-center ect-text-gray-700 ect-text-sm hover:ect-border-gray-400 ect-transition-colors ect-bg-white",{"ect-opacity-50":p.value,"ect-cursor-not-allowed":p.value}]),disabled:p.value,"data-test-id":`${e.dataTestId}-increment`,onClick:m}," + ",10,U4)],8,j4))}},z4={class:"ect-flex ect-justify-end ect-items-center ect-gap-2.5 ect-px-6 ect-py-4 ect-bg-white ect-border-t ect-border-gray-300 ect-shadow-[0_-2px_4px_0px_rgba(0,0,0,0.11)]","data-test-id":"configurator-footer"},K4={"data-test-id":"configurator-footer-quantity"},X4={class:"ect-flex ect-justify-end ect-items-center ect-gap-6 ect-px-8 ect-py-0 ect-flex-1","data-test-id":"configurator-footer-prices"},W4=["data-test-id"],G4=["data-test-id"],Q4=["data-test-id"],Z4=["data-test-id"],J4={__name:"ConfiguratorFooter",props:{item:{type:Object,required:!0,default:()=>{}},disabled:{type:Boolean,default:!1},btnText:{type:String,default:"Save"}},emits:["update:qty","continue"],setup(e,{emit:n}){const t=dn(),r=e,i=te(r.item),o=me(()=>{const u=t.summaryPrices,f=[];return t.isRecurringPricingSchema?(f.push({label:"One Time Price",value:u.oneTimePrice,highlight:!1}),f.push({label:t.showYearlyPricing?"Yearly Price":"Monthly Price",value:u.recurringPrice,highlight:!1})):(f.push({label:"Base Price",value:u.basePrice,highlight:!1}),f.push({label:"Add Ons",value:u.addOns,highlight:!1}),f.push({label:"Total Price",value:u.total,highlight:!1})),f}),a=n,s=()=>{r.disabled||a("continue")};return(u,f)=>(V(),J("footer",z4,[C("div",K4,[he(Do,{value:i.value.qty,"onUpdate:value":f[0]||(f[0]=c=>i.value.qty=c),min:1,max:999,disabled:e.disabled,"is-selected":!0,"data-test-id":"configurator-footer-counter-button"},null,8,["value","disabled"])]),C("div",X4,[(V(!0),J(be,null,Me(o.value,(c,v)=>(V(),J(be,{key:v},[C("div",{class:"ect-flex ect-flex-col ect-justify-center","data-test-id":`configurator-footer-price-${v}`},[C("span",{class:"ect-text-xs ect-font-normal ect-text-gray-500 ect-text-left","data-test-id":`configurator-footer-price-label-${v}`},xe(c.label),9,G4),C("span",{class:we(["ect-text-left",c.highlight?"ect-text-lg ect-font-bold ect-text-green-700":"ect-text-sm ect-font-medium ect-text-gray-800 "]),"data-test-id":`configurator-footer-price-value-${v}`},xe(Ne(Pt)(c.value)),11,Q4)],8,W4),v<o.value.length-1?(V(),J("div",{key:0,class:"ect-w-0 ect-h-5 ect-border-l ect-border-gray-400","data-test-id":`configurator-footer-divider-${v}`},null,8,Z4)):ge("",!0)],64))),128))]),he(Ut,{class:"ect-min-w-[100px]",btype:e.disabled?"secondary":"primary",disabled:e.disabled,"button-style":"primary",size:"medium","data-test-id":"configurator-footer-button-continue",onClick:s},{default:Ve(()=>[Fe(xe(e.btnText),1)]),_:1},8,["btype","disabled"])]))}},Y4={class:"ect-w-full ect-bg-white ect-mb-4","data-test-id":"configurator-type-section"},e6={class:"ect-sticky ect-top-0 ect-z-30 ect-bg-white ect-shadow-sm ect-p-3 ect-px-4 ect-border-b ect-border-gray-200 ect-flex ect-justify-between ect-items-center","data-test-id":"configurator-type-header-sticky"},t6={class:"ect-flex ect-flex-col"},n6={class:"ect-font-bold ect-text-text-success ect-leading-tight"},r6=["innerHTML"],i6={key:0,class:"ect-flex ect-items-center ect-gap-2 ect-px-2 ect-py-1","data-test-id":"configurator-type-message"},o6={class:"ect-text-xs ect-font-medium ect-text-gray-600 ect-leading-tight ect-min-w-[190px]"},a6={class:"ect-divide-y ect-divide-gray-100 ect-overflow-y-auto"},s6={__name:"ConfiguratorType",props:{title:{type:String,required:!0},description:{type:String,default:""},message:{type:String,default:""}},setup(e){return(n,t)=>(V(),J("section",Y4,[C("header",e6,[C("div",t6,[C("h2",n6,xe(e.title),1),e.description?(V(),J("p",{key:0,class:"ect-mt-1 ect-text-xs ect-text-gray-500 ect-leading-tight",innerHTML:e.description},null,8,r6)):ge("",!0)]),e.message?(V(),J("div",i6,[he(We,{icon:"info",symbol:"",color:"#198708",size:14,"data-test-id":"configurator-type-message-icon"}),C("span",o6,xe(e.message),1)])):ge("",!0)]),C("div",a6,[Je(n.$slots,"default")])]))}},l6={__name:"ShadowDisplay",props:{content:{type:String,required:!0}},setup(e){const n=e,t=te(null);let r=null;return Ft(()=>{t.value&&!r&&(r=t.value.attachShadow({mode:"open"}),r.innerHTML=n.content)}),Ye(()=>n.content,i=>{r&&(r.innerHTML=i)}),(i,o)=>(V(),J("div",{ref_key:"host",ref:t},null,512))}},c6=["data-test-id"],u6=["data-test-id"],f6=["data-test-id"],d6=[C("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[C("g",{id:"Group"},[C("path",{id:"Vector",d:"M7 1.3125V12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"}),C("path",{id:"Vector_2",d:"M1.3125 7H12.6875",stroke:"#A86200","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)],h6=["data-test-id"],p6=["data-test-id"],v6=["data-test-id"],g6=["data-test-id"],m6=["data-test-id"],y6=["data-test-id","innerHTML"],hn={__name:"Tag",props:{label:{type:String,default:""},value:{type:String,default:""},addButton:{type:Boolean,default:!1},editButton:{type:Boolean,default:!1},dataTestId:{type:String,default:""}},setup(e){const n=e,t=me(()=>{const r=n.value;if(typeof r!="string")return!1;const i=new DOMParser().parseFromString(r,"text/html");return Array.from(i.body.childNodes).some(o=>o.nodeType===1)});return(r,i)=>e.addButton?(V(),J("div",{key:0,class:"ect-bg-orange-4 ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-orange-secondary","data-test-id":e.dataTestId},[C("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-orange-secondary ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},[C("div",{"data-test-id":`${e.dataTestId}-add-icon`},d6,8,f6),Fe(" "+xe(e.label),1)],8,u6)],8,c6)):e.editButton?(V(),J("div",{key:1,class:"ect-bg-white ect-flex ect-gap-1 ect-justify-center ect-items-center ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-text-center ect-rounded-md ect-border ect-border-solid ect-border-success","data-test-id":e.dataTestId},[C("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-success ect-flex ect-items-center ect-gap-1","data-test-id":`${e.dataTestId}-content`},xe(e.label),9,p6)],8,h6)):(V(),J("div",{key:2,class:"ect-bg-white ect-px-2 ect-py-0.5 ect-text-xs ect-font-medium ect-rounded-md ect-border ect-border-solid ect-border-neutral-200","data-test-id":e.dataTestId},[C("span",{class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-label`},xe(e.label),9,g6),e.value?(V(),J("span",{key:0,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-zinc-500","data-test-id":`${e.dataTestId}-separator`}," : ",8,m6)):ge("",!0),t.value?(V(),Ee(l6,{key:1,content:e.value},null,8,["content"])):e.value?(V(),J("span",{key:2,class:"ect-self-stretch ect-my-auto ect-text-xs ect-leading-5 ect-text-neutral-700","data-test-id":`${e.dataTestId}-value`,innerHTML:e.value},null,8,y6)):ge("",!0)],8,v6))}},x6=["data-test-id"],_6=["data-test-id"],b6=["data-test-id"],C6=["type","step","min","data-test-id"],fs=Re({__name:"InputEdit",props:{modelValue:{type:[String,Number],required:!0},type:{type:String,default:"string",validator:e=>["string","number","currency"].includes(e)},tag:{type:String,default:"span"},disabled:{type:Boolean,default:!1},dataTestId:{type:String,required:!0}},emits:["update:modelValue","change"],setup(e,{expose:n,emit:t}){const r=e,i=t,o=te(!1),a=te(!1),s=te(""),u=te(null),f=me(()=>r.type==="currency"?m(r.modelValue):r.type==="number"?y(r.modelValue):r.modelValue),c=me(()=>r.type==="string"?"text":"number"),v=me(()=>r.type==="currency"?"0.01":void 0),l=me(()=>r.type==="currency"?"0":void 0),h=()=>{r.disabled||(r.type==="currency"?s.value=parseFloat(r.modelValue)||"0.00":r.type==="number"?s.value=parseFloat(r.modelValue)||"0":s.value=r.modelValue,o.value=!0,sn(()=>{u.value&&(u.value.focus(),u.value.select())}))},p=()=>{let _=s.value;if(r.type==="number"||r.type==="currency"){const x=parseFloat(s.value);isNaN(x)?_=r.modelValue:_=r.type==="currency"?x.toFixed(2):x.toString()}_!==r.modelValue&&(i("update:modelValue",_),i("change",_)),o.value=!1},g=()=>{s.value=r.modelValue,o.value=!1},d=()=>{o.value&&p()},m=_=>!_||isNaN(_)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(parseFloat(_)),y=_=>!_||isNaN(_)?"0":new Intl.NumberFormat("en-US").format(parseFloat(_));return Ye(()=>r.modelValue,_=>{o.value||(s.value=_)}),n({startEditing:h,saveChanges:p,cancelEditing:g}),(_,x)=>{const b=l1("click-outside");return V(),J("div",{class:"ect-relative ect-inline-block ect-min-w-[60px] ect-h-[30px]","data-test-id":e.dataTestId,onMouseenter:x[1]||(x[1]=S=>a.value=!0),onMouseleave:x[2]||(x[2]=S=>a.value=!1)},[o.value?ln((V(),J("div",{key:1,class:"ect-w-full ect-h-full","data-test-id":`${e.dataTestId}-input-wrapper`},[ln(C("input",{ref_key:"inputRef",ref:u,"onUpdate:modelValue":x[0]||(x[0]=S=>s.value=S),type:c.value,step:v.value,min:l.value,class:we(["ect-w-full ect-h-full ect-px-3 ect-bg-white ect-border ect-border-green-500 ect-rounded-sm ect-text-gray-700 ect-text-base ect-font-sans ect-outline-none ect-duration-200",_.$attrs.class]),"data-test-id":`${e.dataTestId}-input`,onKeyup:[ir(p,["enter"]),ir(g,["esc"])],onBlur:p},null,42,C6),[[Oh,s.value]])],8,b6)),[[b,d]]):(V(),J("div",{key:0,class:we(["ect-flex ect-items-center ect-gap-2 ect-rounded ect-transition-colors ect-duration-200",{"ect-cursor-pointer":!e.disabled}]),"data-test-id":`${e.dataTestId}-display`,onClick:h},[(V(),Ee(Wi(e.tag),ao(_.$attrs,{class:"ect-m-0 ect-text-inherit","data-test-id":`${e.dataTestId}-text`}),{default:Ve(()=>[Fe(xe(f.value)+" ",1),he(We,{class:we(a.value&&!e.disabled?"ect-visible":"ect-invisible"),icon:"edit",size:"12",color:"#828282","data-test-id":`${e.dataTestId}-edit-icon`},null,8,["class","data-test-id"])]),_:1},16,["data-test-id"]))],10,_6))],40,x6)}}},[["__scopeId","data-v-5cd60070"]]),L0=e=>(jt("data-v-b9675cf1"),e=e(),Ht(),e),w6=["data-test-id","data-publish-key"],E6={key:0,class:"ect-text-xs ect-text-gray-500 ect-text-white ect-font-medium ect-leading-tight ect-absolute ect-top-[-.7rem] ect-left-[-1rem] ect-bg-text-success ect-rounded-xl ect-px-2 ect-py-1"},A6={key:1,class:"ect-flex ect-items-start ect-gap-4 ect-p-3 ect-px-4"},k6={key:0,class:"ect-w-16 ect-h-16 ect-flex ect-items-center ect-justify-center ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0"},O6=["src","alt"],S6={class:"ect-flex-1 ect-min-w-0"},I6={class:"ect-flex ect-gap-4 ect-items-center ect-justify-between"},T6={class:"ect-flex ect-flex-row ect-gap-3"},B6=L0(()=>C("div",{class:"ect-w-px ect-h-auto ect-bg-gray-200 ect-mx-2"},null,-1)),D6={class:"ect-flex ect-flex-col ect-max-w-[125px]"},R6={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},L6=["innerHTML"],N6={key:0,class:"ect-flex ect-flex-wrap ect-gap-2.5 ect-mt-2"},F6=["data-test-id"],P6=["data-test-id"],M6={key:1,class:"ect-inline-block ect-mb-2"},q6={key:2,class:"ect-flex ect-flex-col ect-gap-3 ect-p-3 ect-h-full ect-justify-between"},$6={class:"ect-flex ect-items-start ect-gap-2"},j6={key:0,class:"ect-w-16 ect-h-16 ect-rounded-lg ect-bg-gray-200 ect-flex-shrink-0 ect-overflow-hidden"},H6=["src","alt"],V6={class:"ect-flex-1 ect-min-w-0"},U6={class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},z6=["innerHTML"],K6={class:"temp-hidden"},X6={class:"ect-flex ect-items-start ect-justify-center ect-ml-2 ect-mt-0"},W6={key:0,class:"ect-flex ect-flex-wrap ect-gap-1.5"},G6=["data-test-id"],Q6=["data-test-id"],Z6={key:1,class:"ect-inline-block ect-mb-2"},J6={class:"ect-flex ect-justify-between ect-items-center"},Y6={class:"ect-flex ect-flex-col"},e8=L0(()=>C("p",{class:"ect-text-xs ect-text-gray-500 ect-font-medium ect-leading-tight"},"Price",-1)),t8={key:3,"data-test-id":"configurator-item-slot-details",class:"ect-bg-white ect-rounded-md"},n8=Re({__name:"ConfiguratorItem",props:{item:{type:Object,required:!0},name:{type:String,required:!0},description:{type:String,default:""},imageUrl:{type:String,default:""},price:{type:Number,required:!0},quantity:{type:Number,default:1},selected:{type:Boolean,default:!1},tags:{type:Array,default:()=>[]},attributes:{type:Array,default:()=>[]},size:{type:Number,default:1},minQuantity:{type:Number,default:null},maxQuantity:{type:Number,default:null},showImage:{type:Boolean,default:!1},option:{type:Object,default:null},isAttributes:{type:Boolean,default:!1},showAttributes:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:quantity","update:name","edit-attributes"],setup(e,{emit:n}){const t=e,r=n,i=te(null),o=te(0),a=te(t.item),s=me(()=>a.value.relationshipInfo.relationship==="Kit"?"ect-bg-green-3 ect-border-gray-200 ect-border-success":t.disabled?"ect-bg-light-bg-x ect-border-gray-200":t.selected?"ect-bg-green-3 ect-border-gray-200 ect-border-success":"ect-bg-white ect-border-gray-200 hover:ect-border-success"),u=me({get:()=>t.quantity,set:p=>r("update:quantity",p)}),f=me({get:()=>t.name,set:p=>r("update:name",p)}),c=p=>{r("update:quantity",p)},v=me(()=>{if(o.value===0)return t.tags;const g=Math.floor(o.value/120);return t.tags.slice(0,Math.max(1,g))}),l=me(()=>Math.max(0,t.tags.length-v.value.length)),h=()=>{if(i.value){const p=i.value,g=80,d=120,m=32,y=64;o.value=p.offsetWidth-g-d-m-y}};return Ft(()=>{sn(()=>{h()})}),Ye(()=>t.tags,()=>{sn(()=>{h()})},{deep:!0}),Ft(()=>{window.addEventListener("resize",h)}),(p,g)=>(V(),J("div",{ref_key:"containerRef",ref:i,class:we(["ect-w-full ect-rounded-md ect-border-1 ect-transition-colors ect-relative",s.value]),"data-test-id":`configurator-item-${e.item.itemId}`,"data-publish-key":e.item.publishKey},[e.item.relationshipInfo.relationship==="Kit"?(V(),J("div",E6," KIT ")):ge("",!0),e.size===1?(V(),J("div",A6,[e.showImage?(V(),J("div",k6,[e.imageUrl?(V(),J("img",{key:0,src:e.imageUrl,alt:f.value,class:"ect-w-full ect-h-full ect-object-cover"},null,8,O6)):(V(),Ee(We,{key:1,disabled:"",icon:"image",symbol:"",size:20,color:"#ACACAC"}))])):ge("",!0),C("div",S6,[C("div",I6,[he(fs,{modelValue:f.value,"onUpdate:modelValue":g[0]||(g[0]=d=>f.value=d),tag:"h3","data-test-id":"itemId"+e.item.itemId,class:"ect-text-sm ect-font-semibold ect-text-gray-900 ect-leading-tight"},null,8,["modelValue","data-test-id"]),C("div",T6,[C("div",{onClick:g[2]||(g[2]=mt(()=>{},["stop"]))},[he(Do,{value:u.value,"onUpdate:value":g[1]||(g[1]=d=>u.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),B6,C("div",D6,[he(fs,{modelValue:a.value.price,"onUpdate:modelValue":g[3]||(g[3]=d=>a.value.price=d),tag:"p",type:"currency","data-test-id":"itemId"+e.item.itemId,class:"ect-text-base ect-font-bold"},null,8,["modelValue","data-test-id"])]),C("div",R6,[Je(p.$slots,"selection-control",{},void 0,!0)])])]),C("p",{class:"ect-mt-2 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:e.description},null,8,L6),e.isAttributes&&e.showAttributes&&e.selected?(V(),J("div",N6,[a.value.getTags().length>0?(V(),J(be,{key:0},[(V(!0),J(be,null,Me(v.value,(d,m)=>(V(),J("span",{key:m,class:"ect-inline-block"},[he(hn,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),l.value>0?(V(),J("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:g[4]||(g[4]=mt(()=>{},["stop"]))}," +"+xe(l.value)+" more ",9,F6)):ge("",!0),e.selected?(V(),J("button",{key:1,"data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:g[5]||(g[5]=d=>r("edit-attributes"))},[he(hn,{label:"Edit attributes","edit-button":""})],8,P6)):ge("",!0)],64)):(V(),J("span",M6,[C("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:g[6]||(g[6]=d=>r("edit-attributes"))},[he(hn,{label:"Add attributes","add-button":""})])]))])):ge("",!0)])])):(V(),J("div",q6,[C("div",$6,[e.showImage?(V(),J("div",j6,[e.imageUrl?(V(),J("img",{key:0,src:e.imageUrl,alt:e.name,class:"ect-w-full ect-h-full ect-object-cover"},null,8,H6)):ge("",!0)])):ge("",!0),C("div",V6,[C("h3",U6,xe(e.name),1),C("p",{class:"ect-mt-1 ect-text-sm ect-text-gray-700 ect-leading-tight",innerHTML:e.description},null,8,z6),C("p",K6,xe(e.item.publishKey)+" :: "+xe(e.item.calculateRules),1)]),C("div",X6,[Je(p.$slots,"selection-control",{},void 0,!0)])]),e.isAttributes&&e.showAttributes&&e.selected?(V(),J("div",W6,[a.value.getTags().length>0?(V(),J(be,{key:0},[(V(!0),J(be,null,Me(v.value,(d,m)=>(V(),J("span",{key:m,class:"ect-inline-block"},[he(hn,{label:d.label,value:d.value},null,8,["label","value"])]))),128)),l.value>0?(V(),J("button",{key:0,type:"button",class:"ect-text-xs ect-text-gray-700 ect-border ect-border-gray-300 ect-rounded-md ect-px-2 ect-py-0.5","data-test-id":`configurator-item-button-more-tags-${e.item.itemId}`,onClick:g[7]||(g[7]=mt(()=>{},["stop"]))}," +"+xe(l.value)+" more ",9,G6)):ge("",!0),e.selected?(V(),J("button",{key:1,class:"ect-ml-auto","data-test-id":`configurator-item-button-edit-attributes-${e.item.itemId}`,onClick:g[8]||(g[8]=d=>r("edit-attributes"))},[he(hn,{label:"Edit attributes","edit-button":""})],8,Q6)):ge("",!0)],64)):(V(),J("span",Z6,[C("button",{"data-test-id":"configurator-info-button-add-attributes",onClick:g[9]||(g[9]=d=>r("edit-attributes"))},[he(hn,{label:"Add attributes","add-button":""})])]))])):ge("",!0),C("div",J6,[C("div",{onClick:g[11]||(g[11]=mt(()=>{},["stop"]))},[he(Do,{value:u.value,"onUpdate:value":g[10]||(g[10]=d=>u.value=d),min:e.minQuantity,max:e.maxQuantity,"data-test-id":`configurator-item-counter-${e.item.itemId}`,onChange:c},null,8,["value","min","max","data-test-id"])]),C("div",Y6,[e8,he(fs,{modelValue:a.value.price,"onUpdate:modelValue":g[12]||(g[12]=d=>a.value.price=d),tag:"p",type:"currency","data-test-id":"itemId"+e.item.itemId,class:"ect-w-[125px] ect-text-base ect-font-bold"},null,8,["modelValue","data-test-id"])])])])),e.selected&&e.isAttributes?(V(),J("div",t8,[Je(p.$slots,"default",{},void 0,!0)])):ge("",!0)],10,w6))}},[["__scopeId","data-v-b9675cf1"]]),r8={"af-ZA":",","sq-AL":",","ar-DZ":",","ar-BH":"٫","ar-EG":"٫","ar-IQ":"٫","ar-JO":"٫","ar-KW":"٫","ar-LB":"٫","ar-LY":",","ar-MA":",","ar-OM":"٫","ar-QA":"٫","ar-SA":"٫","ar-SD":"٫","ar-SY":"٫","ar-TN":",","ar-AE":"٫","ar-YE":"٫","hy-AM":",","az-AZ":",","bn-BD":".","bn-IN":".","eu-ES":",","be-BY":",","bs-BA":",","bg-BG":",","my-MM":".","ca-ES":",","ca-ES-EURO":",","zh-CN":".","zh-CN-PINYIN":".","zh-CN-STROKE":".","zh-HK":".","zh-HK-STROKE":".","zh-MO":".","zh-SG":".","zh-TW":".","zh-TW-STROKE":".","hr-HR":",","cs-CZ":",","da-DK":",","nl-AW":",","nl-BE":",","nl-NL":",","nl-SR":",","dz-BT":".","en-AG":".","en-AU":".","en-BS":".","en-BB":".","en-BZ":".","en-BM":".","en-BW":".","en-CM":".","en-CA":".","en-DE":",","en-KY":".","en-ER":".","en-FK":".","en-FJ":".","en-GM":".","en-GH":".","en-GI":".","en-GY":".","en-HK":".","en-IN":".","en-ID":".","en-IE":".","en-IE-EURO":".","en-JM":".","en-KE":".","en-LR":".","en-MG":".","en-MW":".","en-MY":".","en-MU":".","en-NA":".","en-NZ":".","en-NG":".","en-PK":".","en-PG":".","en-PH":".","en-RW":".","en-WS":".","en-SC":".","en-SL":".","en-SG":".","en-SX":".","en-SB":".","en-ZA":",","en-SH":".","en-SZ":".","en-TZ":".","en-TO":".","en-TT":".","en-UG":".","en-GB":".","en-US":".","en-VU":".","et-EE":",","fi-FI":",","fi-FI-EURO":",","fr-BE":",","fr-CA":",","fr-KM":",","fr-FR":",","fr-FR-EURO":",","fr-GN":",","fr-HT":",","fr-LU":",","fr-MR":",","fr-MC":",","fr-CH":",","fr-WF":",","ka-GE":",","de-AT":",","de-AT-EURO":",","de-BE":",","de-DE":",","de-DE-EURO":",","de-LU":",","de-LU-EURO":",","de-CH":".","el-GR":",","gu-IN":".","iw-IL":".","hi-IN":".","hu-HU":",","is-IS":",","in-ID":",","ga-IE":".","it-IT":",","it-CH":".","ja-JP":".","kn-IN":".","kk-KZ":",","km-KH":",","ko-KP":".","ko-KR":".","ky-KG":",","lo-LA":",","lv-LV":",","lt-LT":",","lu-CD":",","lb-LU":",","mk-MK":",","ms-BN":",","ms-MY":".","ml-IN":".","mt-MT":".","mi-NZ":".","mr-IN":".","ne-NP":".","no-NO":",","ps-AF":"٫","fa-IR":"٫","pl-PL":",","pt-AO":",","pt-BR":",","pt-CV":",","pt-MZ":",","pt-PT":",","pt-ST":",","ro-MD":",","ro-RO":",","rm-CH":".","rn-BI":",","ru-KZ":",","ru-RU":",","sr-BA":",","sr-RS":",","sh-BA":",","sh-ME":",","sh-ME-USD":",","sh-CS":",","sk-SK":",","sl-SI":",","so-DJ":".","so-SO":".","es-AR":",","es-BO":",","es-CL":",","es-CO":",","es-CR":",","es-CU":".","es-DO":".","es-EC":",","es-SV":".","es-GT":".","es-HN":".","es-MX":".","es-NI":".","es-PA":".","es-PY":",","es-PE":".","es-PR":".","es-ES":",","es-ES-EURO":",","es-US":".","es-UY":",","es-VE":",","sw-KE":".","sv-SE":",","tl-PH":".","tg-TJ":",","ta-IN":".","ta-LK":".","te-IN":".","th-TH":".","ti-ET":".","tr-TR":",","uk-UA":",","ur-PK":".","uz-LATN-UZ":",","vi-VN":",","cy-GB":".","xh-ZA":".","yo-BJ":".","zu-ZA":"."},i8={name:"CustomInput",components:{AppIcon:We},props:{editMode:{type:Boolean,default:!0},type:{type:String,default:"text"},max:{type:Number,default:500},label:{type:String,default:""},name:{type:String,default:""},showLabel:{type:Boolean,default:!0},modelValue:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},highlight:{type:Boolean,default:!1},placeholder:{type:String,default:""},error:{type:[Boolean,String],default:!1},cssClass:{type:Object,default:()=>({})},tooltip:{type:String,default:null},locale:{type:String,default:"en-US"},icon:{type:String,default:null},itooltip:{type:String,default:null},icolor:{type:String,default:"#7d7d7d"},ihover:{type:String,default:"#57c046"},icustom:{type:Boolean,default:!1},idisabled:{type:Boolean,default:!1},height:{type:Number,default:32},textAlignment:{type:String,default:"left"},decimalPrecision:{type:Number,default:0},allowNegatives:{type:Boolean,default:!1},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["update:modelValue","iclick","blur"],data(){return{initialValue:"",decimalSeprator:".",ctrl:!1}},computed:{getValue(){return this.modelValue?this.type==="currency"?String(this.modelValue).replace(".",this.decimalSeprator):String(this.modelValue):""},error_message(){return typeof this.error=="string"?this.error:this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},isHighlight(){return(this.initialValue===""||this.initialValue===null)&&(this.modelValue===""||this.modelValue===null)?!1:this.initialValue!==this.modelValue}},created(){this.initialValue=this.modelValue,this.decimalSeprator=this.type==="currency"?r8[this.locale]:"."},methods:{handlerInput(e){const n=e.target.value;this.type==="currency"?this.$emit("update:modelValue",n.replace(this.decimalSeprator,".")):this.$emit("update:modelValue",n)},preventNonNumeric(e){if(this.type==="number"){const n=this.decimalPrecision,t=e.target.value,r=e.key;if(["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(r)||this.allowNegatives&&r==="-")return;if(r==="."&&n===0){e.preventDefault();return}if(r==="."&&t.includes(".")){e.preventDefault();return}if(r==="."||t.includes(".")&&!t.endsWith(".")&&r!=="Backspace"){const i=t.split(".");if(i.length>1&&i[1].length>=n){e.preventDefault();return}}if(isNaN(r)&&![".","Backspace","Tab"].includes(r)){e.preventDefault();return}}if(e.key==="Backspace"||this.ctrl)return!0;if(e.key==="Control"&&(this.ctrl=!0),this.type==="currency"||this.type==="number"){if(!this.getValue.includes(this.decimalSeprator)&&e.key===this.decimalSeprator)return!0;/[\deE+\-]/.test(e.key)||e.preventDefault()}return!0},handlerKeyup(e){e.key==="Control"&&(this.ctrl=!1)}}},o8=["data-test-id"],a8=["for","data-test-id"],s8=["data-test-id"],l8=["id","type","name","disabled","placeholder","value","maxlength","readonly","data-test-id"],c8=["data-test-id"],u8=["data-test-id"];function f8(e,n,t,r,i,o){const a=er("AppIcon");return V(),J("div",{class:"input","data-test-id":t.dataTestId},[t.label&&t.showLabel?(V(),J("label",{key:0,class:we({error_color:!!t.error}),for:t.label,"data-test-id":`${t.dataTestId}-label`},[Fe(xe(t.label)+" ",1),t.required?(V(),J("span",{key:0,class:we({error_color:!!t.error})},"*",2)):ge("",!0)],10,a8)):ge("",!0),t.editMode?(V(),J("div",{key:1,class:we(["input-wrapper ect-w-full",{errorBorder_color:!!t.error,highlight:o.isHighlight&&t.highlight}]),"data-test-id":`${t.dataTestId}-wrapper`},[t.icon?(V(),Ee(a,{key:0,class:"input-wrapper_icon",icon:t.icon,hover:t.ihover,color:t.icolor,size:19,disabled:t.idisabled,custom:t.icustom,tooltip:t.itooltip,"data-test-id":`${t.dataTestId}-icon`,direction:"top-right",onClick:n[0]||(n[0]=s=>e.$emit("iclick"))},null,8,["icon","hover","color","disabled","custom","tooltip","data-test-id"])):ge("",!0),C("input",{id:t.label,class:we(`ectheme-input-box ${t.size}`),type:t.type,style:ze({width:t.icon?"calc(100% - 36px)":"100%",height:`${t.height}px`,textAlign:t.textAlignment}),name:t.name,disabled:t.disabled,placeholder:t.placeholder,value:o.getValue,maxlength:t.max,readonly:t.isReadOnly,"data-test-id":`${t.dataTestId}-input`,onInput:n[1]||(n[1]=(...s)=>o.handlerInput&&o.handlerInput(...s)),onKeydown:n[2]||(n[2]=(...s)=>o.preventNonNumeric&&o.preventNonNumeric(...s)),onKeyup:n[3]||(n[3]=(...s)=>o.handlerKeyup&&o.handlerKeyup(...s)),onBlur:n[4]||(n[4]=s=>e.$emit("blur"))},null,46,l8)],10,s8)):ge("",!0),t.editMode?ge("",!0):(V(),J("p",{key:2,class:"value","data-test-id":`${t.dataTestId}-value`},xe(o.getValue),9,c8)),o.error_message?(V(),J("div",{key:3,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${t.dataTestId}-error`},xe(o.error_message),9,u8)):ge("",!0)],8,o8)}const d8=Re(i8,[["render",f8],["__scopeId","data-v-032ca141"]]),h8={name:"AtomSpinner",props:{dataTestId:{type:String,default:""}}},p8=["data-test-id"];function v8(e,n,t,r,i,o){return V(),J("div",{class:"spinner","data-test-id":t.dataTestId},null,8,p8)}const g8={name:"CustomDropdown",components:{AppIcon:We,AtomSpinner:Re(h8,[["render",v8],["__scopeId","data-v-771ed032"]])},props:{label:{type:String,default:""},placeholder:{type:String,default:""},options:{type:Array,default:()=>[]},display:{type:Array,default:()=>[]},modelValue:{type:String,default:""},error:{type:[Boolean,String],default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},select:{type:Boolean,default:!1},lookup:{type:Boolean,default:!1},search:{type:Boolean,default:!1},badge:{type:String,default:void 0},highlight:{type:Boolean,default:!1},property:{type:Object,default:()=>({key:"value",value:"label",assigned:"assigned"})},dropdownTheme:{type:String,default:"light"},icon:{type:String,default:""},size:{type:String,default:"medium"},dataTestId:{type:String,required:!0}},emits:["search","focus-in","focus-out","update:modelValue"],data:()=>({inputFocused:!1,value:"",isHover:!1,highlightedIndex:-1,initialValue:"",teleportStyle:{position:"absolute",top:"0px",left:"0px",width:"0px"}}),computed:{isHighlight(){return(this.initialValue===""||this.initialValue==null)&&(this.modelValue===""||this.modelValue==null)?!1:this.initialValue!==this.modelValue},error_message(){return this.error===""?!1:this.error===!0?`${this.label||"Field"} is required`:this.error},getOptions(){if(this.select&&this.search){const e=this.value.toLowerCase();return this.options.filter(n=>JSON.stringify(n).toLowerCase().includes(e))}else return this.options},getSelected(){let e=null;if(this.modelValue)e=this.options.find(n=>n[this.property.key]===this.modelValue);else if(!this.search){const n=this.options.find(t=>t[this.property.key]==="");n?e=n:this.placeholder?e={[this.property.value]:this.placeholder,[this.property.key]:""}:e={[this.property.value]:"--Select--",[this.property.key]:""}}return e||{[this.property.value]:this.placeholder||"--Select--",[this.property.key]:""}},shouldShowAbove(){if(!this.$refs.triggerElement)return!1;const e=this.$refs.triggerElement.getBoundingClientRect(),n=250,t=window.innerHeight-e.bottom,r=e.top;return t<n&&r>n},dropdownStyle(){if(!this.$refs.triggerElement)return{};const e=this.$refs.triggerElement.getBoundingClientRect(),n=250,t=window.innerHeight-e.bottom,r=e.top,i=t<n&&r>n;return{position:"absolute",top:i?"auto":"100%",bottom:i?"100%":"auto",left:"0",width:"100%",zIndex:1e3}}},created(){this.initialValue=this.modelValue},mounted(){window.addEventListener("resize",this.updateDropdownPosition),window.addEventListener("scroll",this.updateDropdownPosition,!0)},beforeUnmount(){window.removeEventListener("resize",this.updateDropdownPosition),window.removeEventListener("scroll",this.updateDropdownPosition,!0)},methods:{updateDropdownPosition(){if(!this.$refs.triggerElement)return;const e=this.$refs.triggerElement.getBoundingClientRect(),n=200,t=window.innerHeight-e.bottom,r=e.top,i=t<n&&r>n;this.teleportStyle={position:"absolute",top:`${i?e.top-n:e.bottom}px`,left:`${e.left}px`,width:`${e.width}px`,zIndex:9999}},subFieldsText(e){if(!this.display||this.display.length<1)return"";const n=[];return this.display.forEach(t=>{const r=this.subField(e,t);r&&n.push(r)}),n.join(" | ")},subField(e,n){return n?n.split(".").reduce((i,o)=>i[o]||"",e):e},lookupSearchHandler:or(function(e){this.value=e,this.search&&!this.select&&this.$emit("search",e)}),handlerFocusIn(){!(this.modelValue&&this.search)&&!this.disabled&&(this.inputFocused=!0,this.updateDropdownPosition(),this.$emit("focus-in"))},updateSelected(e){e&&(this.value="",this.$emit("update:modelValue",e[this.property.key]),this.search&&!this.select&&!this.lookup&&this.$emit("search",""),this.onInputFocusedOut(!0))},clear(){this.disabled||(this.value="",this.$emit("update:modelValue",null),this.search&&!this.select&&!this.lookup&&this.$emit("search",""))},onInputFocusedOut(e=!1){(!this.isHover||e)&&!this.disabled&&(e?(this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")):setTimeout(()=>{this.highlightedIndex=-1,this.inputFocused=!1,this.$emit("focus-out")},100))},highlightNextOption(){this.highlightedIndex<this.options.length-1&&this.highlightedIndex++},highlightPreviousOption(){this.highlightedIndex>0&&this.highlightedIndex--}}},m8=["data-test-id"],y8=["for","data-test-id"],x8={class:"input-container-box ect-grow ect-w-full"},_8=["data-test-id"],b8=["placeholder","disabled","data-test-id"],C8=["data-test-id"],w8=["title","data-test-id"],E8=["data-test-id"],A8=["data-test-id"],k8=["data-test-id"],O8=["data-test-id"],S8=["data-test-id","onClick"],I8=["data-test-id"],T8={class:"ect-text-font-clr-light ect-flex ect-gap-2 ect-items-center ect-justify-between ect-w-full"},B8=["data-test-id"],D8=["data-test-id"],R8=["data-test-id"],L8=["title","data-test-id"],N8=["data-test-id"];function F8(e,n,t,r,i,o){const a=er("AppIcon"),s=er("AtomSpinner");return V(),J("div",{ref:"dropdownWrapper",class:we(["customdropdown input-container",{dark:t.dropdownTheme==="dark"}]),"data-test-id":t.dataTestId,onMouseenter:n[7]||(n[7]=u=>e.isHover=!0),onMouseleave:n[8]||(n[8]=u=>e.isHover=!1)},[t.label?(V(),J("label",{key:0,class:we(["title_label",{error_color:!!t.error}]),for:t.label,"data-test-id":`${t.dataTestId}-label`},[Fe(xe(t.label)+" ",1),t.required?(V(),J("span",{key:0,class:we({error_color:!!t.error})},"*",2)):ge("",!0)],10,y8)):ge("",!0),C("div",x8,[C("div",{ref:"triggerElement",class:we(["input-wrapper ectheme-input-box ect-w-full",{disabled:t.disabled,"input-error":t.error,highlight:o.isHighlight&&t.highlight,"size-large":t.size==="large","size-medium":t.size==="medium"||t.size==="small"}]),"data-test-id":`${t.dataTestId}-trigger`,tabindex:"0",onFocusin:n[2]||(n[2]=(...u)=>o.handlerFocusIn&&o.handlerFocusIn(...u)),onFocusout:n[3]||(n[3]=u=>o.onInputFocusedOut(!1)),onKeydown:[n[4]||(n[4]=ir(u=>o.updateSelected(t.options[e.highlightedIndex]),["enter"])),n[5]||(n[5]=ir(mt((...u)=>o.highlightPreviousOption&&o.highlightPreviousOption(...u),["prevent"]),["up"])),n[6]||(n[6]=ir(mt((...u)=>o.highlightNextOption&&o.highlightNextOption(...u),["prevent"]),["down"]))]},[!t.modelValue&&t.search?ln((V(),J("input",{key:0,ref:"searchInput","onUpdate:modelValue":n[0]||(n[0]=u=>e.value=u),type:"text",name:"search",placeholder:t.placeholder,autocomplete:"off",disabled:t.disabled,"data-test-id":`${t.dataTestId}-search-input`,onInput:n[1]||(n[1]=mt(u=>o.lookupSearchHandler(u.target.value),["prevent"]))},null,40,b8)),[[li,e.value]]):(V(),J("div",{key:1,class:we(["selection-name ect-text-text-primary-dark ect-flex ect-justify-between ect-items-center",{"size-large":t.size==="large","size-medium":t.size==="medium"||t.size==="small"}]),"data-test-id":`${t.dataTestId}-selection`},[o.getSelected?(V(),J(be,{key:0},[C("span",{title:o.getSelected[t.property.value],class:we(["ect-flex ect-items-center ect-gap-2 ect-font-medium",{"ect-text-font-clr-light":!t.modelValue}]),"data-test-id":`${t.dataTestId}-selection-value`},[t.icon?(V(),Ee(a,{key:0,class:"ect-mr-0",icon:t.icon,size:14,color:"#5F5F5F","data-test-id":`${t.dataTestId}-selection-icon`},null,8,["icon","data-test-id"])):ge("",!0),Fe(" "+xe(o.getSelected[t.property.value]),1)],10,w8),t.badge&&o.getSelected[t.badge]?(V(),J("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${t.dataTestId}-selection-badge`},xe(o.getSelected[t.badge]),9,E8)):ge("",!0)],64)):ge("",!0)],10,C8)),t.search?(V(),J(be,{key:2},[t.loading?(V(),Ee(s,{key:0,class:"spinner","data-test-id":`${t.dataTestId}-loading-spinner`},null,8,["data-test-id"])):(V(),J("div",{key:1,class:"clear-button","data-test-id":`${t.dataTestId}-action-button`},[e.value||t.modelValue?(V(),Ee(a,{key:0,disabled:t.disabled,icon:"close",color:"#acacac",size:10,"data-test-id":`${t.dataTestId}-clear-button`,onClick:o.clear},null,8,["disabled","data-test-id","onClick"])):(V(),Ee(a,{key:1,icon:"search",size:14,color:"#acacac",disabled:t.disabled,"data-test-id":`${t.dataTestId}-search-button`},null,8,["disabled","data-test-id"]))],8,A8))],64)):(V(),Ee(a,{key:3,class:"clear-button",color:o.error_message?"#ff6a6a":"#acacac",icon:"arrow_drop_up",size:12,disabled:t.disabled,"data-test-id":`${t.dataTestId}-dropdown-arrow`},null,8,["color","disabled","data-test-id"]))],42,_8),o.error_message?(V(),J("div",{key:0,class:"error_tooltip error_tooltip-bottom-right","data-test-id":`${t.dataTestId}-error`},xe(o.error_message),9,k8)):ge("",!0),o.getOptions&&e.inputFocused&&!t.disabled&&(t.select||t.lookup)?(V(),J("div",{key:1,ref:"dropdown",class:we(["dropdown",{"dropdown-above":o.shouldShowAbove}]),style:ze(o.dropdownStyle),"data-test-id":`${t.dataTestId}-dropdown`},[(V(!0),J(be,null,Me(o.getOptions,(u,f)=>(V(),J("div",{key:u[t.property.key],class:we(["dropdown-item",{highlighted:f===e.highlightedIndex,"ect-pointer-events-none":u[t.property.assigned]}]),"data-test-id":`${t.dataTestId}-option-${f}`,onClick:c=>o.updateSelected(u)},[C("div",{class:"name ect-items-center","data-test-id":`${t.dataTestId}-option-${f}-name`},[C("span",T8,[C("span",{class:we({"ect-text-zinc-400":u[t.property.assigned]}),"data-test-id":`${t.dataTestId}-option-${f}-value`},xe(u[t.property.value]==null?"Key and Value is Wrong":u[t.property.value]),11,B8),u[t.property.assigned]?(V(),J("span",{key:0,class:"ect-text-xs ect-leading-4 ect-text-zinc-600","data-test-id":`${t.dataTestId}-option-${f}-assigned`},"Assigned",8,D8)):ge("",!0)]),t.badge?(V(),J("span",{key:0,class:"badge ect-bg-btn ect-rounded-[5px] ect-py-[2px] ect-px-[10px] ect-text-white","data-test-id":`${t.dataTestId}-option-${f}-badge`},xe(u[t.badge]),9,R8)):ge("",!0)],8,I8),C("div",{class:"info",title:o.subFieldsText(u),"data-test-id":`${t.dataTestId}-option-${f}-info`},[C("span",null,xe(o.subFieldsText(u)),1)],8,L8)],10,S8))),128)),!o.getOptions.length&&!t.loading&&(e.value||t.select)?(V(),J("div",{key:0,class:"no-items-found","data-test-id":`${t.dataTestId}-no-options`}," no options found ",8,N8)):ge("",!0)],14,O8)):ge("",!0)])],42,m8)}const N0=Re(g8,[["render",F8],["__scopeId","data-v-5ae4f6dc"]]);var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ds(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function P8(e){if(e.__esModule)return e;var n=e.default;if(typeof n=="function"){var t=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),t}var F0={exports:{}};/*!
|
|
34
34
|
* Quill Editor v1.3.7
|
|
35
35
|
* https://quilljs.com/
|
|
36
36
|
* Copyright (c) 2014, Jason Chen
|