PageSourceSearch

https://app.marketplacemaximizer.com/chunk-T3ZZUEE2.js

js marketplacemaximizer.com collected 2026-10-08 01:59:03 UTC 7,139 bytes, 1 lines download raw bytes

1import{Fb as x,M as I,S as v,a as L,dc as T,e as D,f as y,h as S,ha as O,ic as o,jc as h,lc as A,mc as C,p as d}from"./chunk-IWGG67GH.js";var U=(()=>{let s=class s{static getSystemLogo(t){return t&&t.logo?t.logo:""}static getName(t,e=!0,i=!1){return!i&&t&&t.name?t.name:this.getSystemName(t?t.system||t._system:void 0,e)}static getLogo(t){return this.getSystemLogo(t?t.system||t._system:void 0)}static isOauth(t){let e=t?t.system||t._system:null;return e?e.authType==="oauth":!1}static getSystemName(t,e=!0){let i=t?t.name:"";return e&&t&&t.country&&(i+=" "+t.country),i}static getLinkKey(t){let e=t.systemId;return t.name&&(e+="_"+t.name),e}static isAppUninstalled(t){return!!t?.meta?.appUninstalled}static getDestination(t){return c.destination?.integrations.find(e=>e.syncType===t)}static isDestinationPending(t){return this.getDestination(t)?.systemSettings?.status==="pending"}static getDestinationName(t=null,e=!1,i=!0){let a=t?c.destination?.integrations.find(l=>l.syncType===t):c.destination?.integrations?.[0];return e&&a?this.getSystemName(a.system,i):this.getName(a,i)}static getSource(t){return c.source?.integrations.find(e=>e.syncType===t)}static getSourceName(t=null,e=!1,i=!0){let a=t?c.source?.integrations.find(l=>l.syncType===t):c.source?.integrations?.[0];return e&&a?this.getSystemName(a.system,i):this.getName(a,i)}static getSourceSyncTypes(){let t=c.source?.integrations.map(e=>e.syncType)||[];return g.labels(t)}static getDestinationSyncTypes(){let t=c.destination?.integrations.map(e=>e.syncType);return g.labels(t||[])}static getNameFromId(t,e=!0,i=!1){return this.getName(this.getFromId(t),e,i)}static getFromId(t){return this.integrations?.find(e=>e.integrationId===t)}static checkStatus(t){return s.isPending(t.data.integrations)?"pending":s.isActive(t.data.integrations)?"active":"inactive"}static isActive(t){return t.every(e=>e.active)}static isPending(t){return t.some(e=>e?.system?.settings?.status==="pending"&&e.active)}};s.statusBtnClasses={active:{class:"bg-green-700",label:"Active"},inactive:{class:"bg-red-700",label:"Inactive"},pending:{class:"bg-yellow-400",label:"Staged (Pending Approval)"}};let u=s;return u})();var c=(()=>{let s=class s{static clearCache(){A.clear("systems")}static cacheOptions(t){return{useCache:t,cacheDuration:300,key:"systems"}}static setDestination(t){this.destination=t,this.setDestinationKey(t.key)}static setDestinationKey(t){localStorage.setItem("destination",t)}static removeDestination(){this.destination=void 0,localStorage.removeItem("destination")}static setSource(t){this.source=t}static getDestination(){return localStorage.getItem("destination")||null}static getDestinationTaxonomyId(t="products"){let e=U.getDestination(t);try{return e?e.system.settings.taxonomyId:null}catch{return null}}static supportsStatusSync(t){return t?.settings?.global?.supportStatusSync||t?.settings?.supportStatusSync}constructor(t,e){this.http=t,this.alertService=e,this.systems={},this.systemsLoaded=new L,this.systemsLoading=O(!1)}list(t,e=null,i=!0){return e&&(t.includes=e),this.http.get("@cresco/systems",{params:o.buildParams(t),observe:"response",context:o.buildCache(s.cacheOptions(i))}).pipe(d(a=>(this.alertService.httpError(a),y(()=>a))))}get(t,e=!0,i=!0){let a={merged:e};return this.http.get("@cresco/systems/"+t,{params:o.buildParams(a),context:o.buildCache(s.cacheOptions(i))})}load(t){let e=new Set(t.filter(i=>!this.systems[i]));if(e.size!==0){this.systemsLoading.set(!0);let i={systemId:Array.from(e),limit:e.size};this.list(i).subscribe({next:a=>{a.body.reduce((l,p)=>Object.assign(this.systems,{[p.systemId]:p}),{}),this.systemsLoaded.next(!0),this.systemsLoading.set(!1)},error:a=>this.systemsLoading.set(!1)})}else this.systemsLoaded.next(!0)}getFeed(t,e){let i="@cresco/"+o.buildUrl("services",t,"feeds");return this.http.get(i,{params:{feedId:e},observe:"response"})}getSettings(t,e,i=null,a="integration",l=!0){let p={level:a};e&&(p.syncType=e),i&&(p.action=i.join(","));let f="@cresco/systems/"+o.buildUrl(t,"auth"),m=s.cacheOptions(l);return this.http.get(f,{params:o.buildParams(p),context:o.buildCache(m)}).pipe(S(n=>n.response),d(n=>(this.alertService.httpError(n),y(()=>n))))}getSystemsDoc(t,e=!0){let i="@cresco/"+o.buildUrl("systems",t,"documentation","urls"),a=s.cacheOptions(e);return this.http.get(i,{context:o.buildCache(a)}).pipe(d(l=>(this.alertService.httpError(l),y(()=>
1l))))}createAuth(t){let e="@cresco/systems/"+o.buildUrl(t,"auth");return this.http.post(e,{})}testConnection(t,e,i={},a={},l=!0){let p="@cresco/systems/"+o.buildUrl(t,"syncs",e,"test"),f=s.cacheOptions(l);return this.http.post(p,i,{params:o.buildParams(a),context:o.buildCache(f)}).pipe(S(m=>{let n="";return m.success?n="Connection successful":(n=m?.response,Array.isArray(n)?n=n.filter(b=>typeof b=="string")[0]:typeof n=="object"&&!Array.isArray(n)&&(n=Object.values(n).filter(b=>typeof b=="string")[0]),(!n||typeof n!="string")&&(n="Test connection failed")),{success:m.success,message:n}}),d(m=>D({success:!1,message:"Test connection failed"})))}};s.\u0275fac=function(e){return new(e||s)(v(x),v(T))},s.\u0275prov=I({token:s,factory:s.\u0275fac,providedIn:"root"});let u=s;return u})();var g=class{static types(){let s=[{value:"products",pluralLabel:"Products",singularLabel:"Product",pluralVariantLabel:"SKUs",singularVariantLabel:"SKU",icon:"tag",headerAttribute:"title"},{value:"stock",pluralLabel:"Stocks",singularLabel:"Stock",pluralVariantLabel:"SKUs",singularVariantLabel:"SKU",icon:"tag",headerAttribute:"title"},{value:"orders",pluralLabel:"Orders",singularLabel:"Order",biDirectionalLabel:"Order Status Updates",biDirectionalSingularLabel:"Order Status Update",biDirectionalValue:"order_status_updates",pluralVariantLabel:"Order Items",singularVariantLabel:"Order Item",icon:"shopping-cart",biDirectionalIcon:"checklist-doc",headerAttribute:"systemOrderNumber"}],r=[],t=c.source?.integrations.map(e=>e.syncType)||[];return t.length>0?r=t:localStorage.getItem("app-sync-type")?r=C.getJsonArray("app-sync-type"):r=h.supportedSyncTypes,s.filter(e=>r.indexOf(e.value)>-1)}static label(s,r="pluralLabel"){if(!s)return r.includes("singular")?"Record":"Records";if(s==="custom")return"Custom";let t=this.types().find(e=>e.value===s)?.[r];if(!t){let e=this.types().find(i=>i.biDirectionalValue===s);e&&(t=r.includes("singular")?e.biDirectionalSingularLabel:e.biDirectionalLabel)}return t||'Custom "'+s+'"'}static labels(s){let r=s.map(e=>this.label(e)),t=r.pop();return r.length>0?r.join(", ")+" and "+t:t||""}static value(s){let r=this.types().find(t=>t.value===s)?.value;return r||(r=this.types().find(t=>t.biDirectionalValue===s)?.value),r||s}static hasSyncType(s){return this.types().find(r=>r.value===s)!==void 0}static biDirectional(s){return this.types().find(r=>r.biDirectionalValue===s)}static icon(s){return(this.types().filter(r=>r.value===s)[0]||{}).icon}static statuses(){return[{label:"Approved",value:"approved"},{label:"Pending",value:"pending"}]}static allowMappings(s){return h.supportMappingsSyncTypes.indexOf(s)>-1&&c.getDestinationTaxonomyId(s)}static allowRules(s){return h.supportRulesSyncTypes.indexOf(s)>-1}};export{g as a,U as b,c};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.