randmarcomps 1.459.0 → 1.461.0
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.
package/dist/randmarcomps.js
CHANGED
|
@@ -76297,7 +76297,7 @@ function ProductCard({
|
|
|
76297
76297
|
formatMoney(z)
|
|
76298
76298
|
] }) }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
76299
76299
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center flex-wrap", children: [
|
|
76300
|
-
/* @__PURE__ */ jsx("span", { className: "text-2xl font-bold whitespace-nowrap", children: formatMoney((E ? (et = (Qe = e.Opportunities) == null ? void 0 : Qe.find((Ze) => Ze.BidNumber == E.BidNumber)) == null ? void 0 : et.Price : V) ?? 0) }),
|
|
76300
|
+
Q > 0 && /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx("span", { className: "text-2xl font-bold whitespace-nowrap", children: formatMoney((E ? (et = (Qe = e.Opportunities) == null ? void 0 : Qe.find((Ze) => Ze.BidNumber == E.BidNumber)) == null ? void 0 : et.Price : V) ?? 0) }) }),
|
|
76301
76301
|
A > 0 && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground line-through ml-2 whitespace-nowrap", children: formatMoney(Q) })
|
|
76302
76302
|
] }),
|
|
76303
76303
|
A > 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center", children: /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap", children: [
|
|
@@ -1228,7 +1228,7 @@ Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=1
|
|
|
1228
1228
|
`;break;default:t+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},pp.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(types$1.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
|
|
1229
1229
|
`&&++this.pos;case`
|
|
1230
1230
|
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},pp.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`
|
|
1231
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var o=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(o,8);return l>255&&(o=o.slice(0,-1),l=parseInt(o,8)),this.pos+=o.length-1,e=this.input.charCodeAt(this.pos),(o!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-o.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return isNewLine(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}},pp.readHexChar=function(t){var e=this.pos,n=this.readInt(16,t);return n===null&&this.invalidStringToken(e,"Bad character escape sequence"),n},pp.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,n=this.pos,o=this.options.ecmaVersion>=6;this.pos<this.input.length;){var l=this.fullCharCodeAtPos();if(isIdentifierChar(l,o))this.pos+=l<=65535?1:2;else if(l===92){this.containsEsc=!0,t+=this.input.slice(n,this.pos);var d=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var f=this.readCodePoint();(e?isIdentifierStart:isIdentifierChar)(f,o)||this.invalidStringToken(d,"Invalid Unicode escape"),t+=codePointToString(f),n=this.pos}else break;e=!1}return t+this.input.slice(n,this.pos)},pp.readWord=function(){var t=this.readWord1(),e=types$1.name;return this.keywords.test(t)&&(e=keywords[t]),this.finishToken(e,t)};var version="8.12.1";Parser.acorn={Parser,version,defaultOptions,Position,SourceLocation,getLineInfo,Node:Node$3,TokenType,tokTypes:types$1,keywordTypes:keywords,TokContext,tokContexts:types,isIdentifierChar,isIdentifierStart,Token,isNewLine,lineBreak,lineBreakG,nonASCIIwhitespace};var AcornJSX=__toESM(require_acorn_jsx()),attributeNames_default={acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",colspan:"colSpan",contenteditable:"contentEditable",crossorigin:"crossOrigin",datetime:"dateTime",enctype:"encType",for:"htmlFor",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",httpequiv:"httpEquiv",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"},VOID_ELEMENTS=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],NO_WHITESPACE=["table","tbody","tfoot","thead","tr"];function canHaveChildren(t){return VOID_ELEMENTS.indexOf(t.toLowerCase())===-1}function canHaveWhitespace(t){return NO_WHITESPACE.indexOf(t.toLowerCase())!==-1}class NullishShortCircuit extends Error{constructor(e="Nullish value encountered"){super(e),this.name="NullishShortCircuit"}}var hash=(t="",e=16)=>{const n=String(t);let o=0;return n.split("").forEach(l=>{o=(o<<5)-o+l.charCodeAt(0),o&=o}),Math.abs(o).toString(e)},randomHash=()=>hash(Math.random().toString()),camelCase=t=>t.replace(/([A-Z])([A-Z])/g,"$1 $2").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-zA-Z\u00C0-\u00ff]/g," ").toLowerCase().split(" ").filter(e=>e).map((e,n)=>n>0?e[0].toUpperCase()+e.slice(1):e).join(""),parseStyle=t=>{switch(typeof t){case"string":return t.split(";").filter(e=>e).reduce((e,n)=>{const o=n.slice(0,n.indexOf(":")).trim(),l=n.slice(n.indexOf(":")+1).trim();return{...e,[camelCase(o)]:l}},{});case"object":return t;default:return}},pathToArrayPath=t=>t==null||t===""?[]:t.split("."),resolveArrayPath=(t,e)=>{const[n,...o]=e;if(!(t==null||n==null))return o.length===0?t[n]:resolveArrayPath(t[n],o)},resolvePath=(t,e)=>resolveArrayPath(t,pathToArrayPath(e));function handleNaN(t){return Number.isNaN(t)?"NaN":t}class JsxParser extends React.Component{constructor(){super(...arguments);Zt(this,"ParsedChildren",null);Un(this,un,n=>{const o=Parser.extend(AcornJSX.default({autoCloseVoidElements:this.props.autoCloseVoidElements})),l=`<root>${n}</root>`;let d=[];try{return d=o.parse(l,{ecmaVersion:"latest"}),d=d.body[0].expression.children||[],d.map(f=>an(this,nn).call(this,f)).filter(Boolean)}catch(f){return this.props.showWarnings&&console.warn(f),this.props.onError&&this.props.onError(f),this.props.renderError?this.props.renderError({error:String(f)}):null}});Un(this,nn,(n,o)=>{var l,d;switch(n.type){case"JSXAttribute":return n.value===null?!0:an(this,nn).call(this,n.value,o);case"JSXElement":case"JSXFragment":return an(this,Jn).call(this,n,o);case"JSXExpressionContainer":return an(this,nn).call(this,n.expression,o);case"JSXText":const f=this.props.disableKeyGeneration?void 0:randomHash();return this.props.disableFragments?n.value:React.createElement(React.Fragment,{key:f},n.value);case"ArrayExpression":return n.elements.map(A=>an(this,nn).call(this,A,o));case"BinaryExpression":const g=an(this,nn).call(this,n.left,o),b=an(this,nn).call(this,n.right,o);let _;switch(n.operator){case"-":_=g-b;break;case"!=":_=g!=b;break;case"!==":_=g!==b;break;case"*":_=g*b;break;case"**":_=g**b;break;case"/":_=g/b;break;case"%":_=g%b;break;case"+":_=g+b;break;case"<":_=g<b;break;case"<=":_=g<=b;break;case"==":_=g==b;break;case"===":_=g===b;break;case">":_=g>b;break;case">=":_=g>=b;break;default:this.props.onError(new Error(`Unsupported binary operator: ${n.operator}`));return}return handleNaN(_);case"CallExpression":const S=an(this,nn).call(this,n.callee,o);if(S===void 0){if(n.optional)throw new NullishShortCircuit;this.props.onError(new Error(`The expression '${n.callee}' could not be resolved, resulting in an undefined return value.`));return}return S(...n.arguments.map(A=>an(this,nn).call(this,A,o)));case"ConditionalExpression":return an(this,nn).call(this,n.test,o)?an(this,nn).call(this,n.consequent,o):an(this,nn).call(this,n.alternate,o);case"ExpressionStatement":return an(this,nn).call(this,n.expression,o);case"Identifier":return n.name==="Infinity"?1/0:n.name==="-Infinity"?-1/0:n.name==="NaN"?NaN:o&&n.name in o?handleNaN(o[n.name]):handleNaN((this.props.bindings||{})[n.name]);case"Literal":return n.value;case"LogicalExpression":const R=an(this,nn).call(this,n.left,o);return n.operator==="||"&&R?R:n.operator==="&&"&&R||n.operator==="||"&&!R?an(this,nn).call(this,n.right,o):!1;case"MemberExpression":return an(this,ir).call(this,n,o);case"ChainExpression":return an(this,rr).call(this,n,o);case"ObjectExpression":const C={};return n.properties.forEach(A=>{C[A.key.name||A.key.value]=an(this,nn).call(this,A.value,o)}),C;case"TemplateElement":return n.value.cooked;case"TemplateLiteral":return[...n.expressions,...n.quasis].sort((A,M)=>A.start<M.start?-1:1).map(A=>an(this,nn).call(this,A,o)).join("");case"UnaryExpression":const E=an(this,nn).call(this,n.argument,o);switch(n.operator){case"+":return+E;case"-":return-E;case"!":return!E;case"~":return~E;case"typeof":return typeof E}return;case"ArrowFunctionExpression":return(n.async||n.generator)&&((d=(l=this.props).onError)==null||d.call(l,new Error("Async and generator arrow functions are not supported."))),(...A)=>{const M={...o};return n.params.forEach((I,j)=>{M[I.name]=A[j]}),an(this,nn).call(this,n.body,M)};default:this.props.onError(new Error(`The expression type '${n.type}' is not supported.`));return}});Un(this,rr,(n,o)=>{try{return an(this,nn).call(this,n.expression,o)}catch(l){if(l instanceof NullishShortCircuit)return;throw l}});Un(this,ir,(n,o)=>{const l=an(this,nn).call(this,n.object,o);let d;if(n.computed)d=an(this,nn).call(this,n.property,o);else if(n.property.type==="Identifier")d=n.property.name;else{this.props.onError(new Error("Only simple MemberExpressions are supported."));return}if(l==null&&n.optional)throw new NullishShortCircuit;let f;try{f=l[d]}catch{this.props.onError(new Error(`The property '${d}' could not be resolved on the object '${l}'.`));return}return typeof f=="function"?f.bind(l):f});Un(this,Hn,n=>n.type==="JSXIdentifier"?n.name:`${an(this,Hn).call(this,n.object)}.${an(this,Hn).call(this,n.property)}`);Un(this,Jn,(n,o)=>{const{allowUnknownElements:l,components:d,componentsOnly:f,onError:g}=this.props,{children:b=[]}=n,_=n.type==="JSXElement"?n.openingElement:n.openingFragment,{attributes:S=[]}=_,R=n.type==="JSXElement"?an(this,Hn).call(this,_.name):"",C=(this.props.blacklistedAttrs||[]).map(z=>z instanceof RegExp?z:new RegExp(z,"i")),E=(this.props.blacklistedTags||[]).map(z=>z.trim().toLowerCase()).filter(Boolean);if(/^(html|head|body)$/i.test(R))return b.map(z=>an(this,Jn).call(this,z,o));const A=R.trim().toLowerCase();if(E.indexOf(A)!==-1)return g(new Error(`The tag <${R}> is blacklisted, and will not be rendered.`)),null;if(R!==""&&!resolvePath(d,R)){if(f)return g(new Error(`The component <${R}> is unrecognized, and will not be rendered.`)),this.props.renderUnrecognized(R);if(!l&&document.createElement(R)instanceof HTMLUnknownElement)return g(new Error(`The tag <${R}> is unrecognized in this browser, and will not be rendered.`)),this.props.renderUnrecognized(R)}let M,I=n.type==="JSXElement"?resolvePath(d,R):React.Fragment;if(I||canHaveChildren(R)){if(M=b.map(Q=>an(this,nn).call(this,Q,o)),R.includes(".")){const O=R.split(".").reduce((V,te)=>V?V[te]:d==null?void 0:d[te],null);O&&(I=O)}!I&&!canHaveWhitespace(R)&&(M=M.filter(Q=>typeof Q!="string"||!/^\s*$/.test(Q)));const z=M.find(Q=>typeof Q=="function");M.length===0?M=void 0:z?M=z:M.length===1?[M]=M:M.length>1&&!this.props.disableKeyGeneration&&(M=M.map((Q,O)=>Q!=null&&Q.type&&!(Q!=null&&Q.key)?{...Q,key:Q.key||O}:Q))}const j={key:this.props.disableKeyGeneration?void 0:randomHash()};S.forEach(z=>{if(z.type==="JSXAttribute"){const Q=z.name.name,O=attributeNames_default[Q]||Q,V=an(this,nn).call(this,z,o);C.filter(ne=>ne.test(O)).length===0&&(j[O]=V)}else if(z.type==="JSXSpreadAttribute"&&z.argument.type==="Identifier"||z.argument.type==="MemberExpression"){const Q=an(this,nn).call(this,z.argument,o);typeof Q=="object"&&Object.keys(Q).forEach(O=>{const V=attributeNames_default[O]||O;C.filter(ne=>ne.test(V)).length===0&&(j[V]=Q[O])})}}),typeof j.style=="string"&&(j.style=parseStyle(j.style));const F=R.toLowerCase();return F==="option"&&(M=M.props.children),React.createElement(I||F,j,M)})}render(){const n=(this.props.jsx||"").trim().replace(/<!DOCTYPE([^>]*)>/g,"");this.ParsedChildren=an(this,un).call(this,n);const o=[...new Set(["jsx-parser",...String(this.props.className).split(" ")])].filter(Boolean).join(" ");return this.props.renderInWrapper?React.createElement("div",{className:o},this.ParsedChildren):this.ParsedChildren}}un=new WeakMap,nn=new WeakMap,rr=new WeakMap,ir=new WeakMap,Hn=new WeakMap,Jn=new WeakMap,Zt(JsxParser,"displayName","JsxParser"),Zt(JsxParser,"defaultProps",{allowUnknownElements:!0,autoCloseVoidElements:!1,bindings:{},blacklistedAttrs:[/^on.+/i],blacklistedTags:["script"],className:"",components:{},componentsOnly:!1,disableFragments:!1,disableKeyGeneration:!1,jsx:"",onError:()=>{},showWarnings:!1,renderError:void 0,renderInWrapper:!0,renderUnrecognized:()=>null});var source_default=JsxParser;const CountryFlag=({countryCode:t,className:e=""})=>{const[n,o]=React.useState(null),[l,d]=React.useState(!1);return React.useEffect(()=>{if(!t)return;const g=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${t.toUpperCase()}.svg`;fetch(g,{method:"HEAD"}).then(b=>{b.ok?(o(g),d(!1)):d(!0)}).catch(()=>{d(!0)})},[t]),l||!n?jsxRuntime.jsx("span",{className:e,children:t}):jsxRuntime.jsx("img",{src:n,alt:`${t} flag`,className:`inline-block ${e}`,style:{width:"24px",height:"auto"}})};function ProductCard({applicationId:t,product:e,viewProductLink:n,defaultOpportunityNumber:o="",onAddToCart:l,addingToCart:d=!1,shopifyHostname:f,customAction:g=jsxRuntime.jsx(jsxRuntime.Fragment,{})}){var Fe,Oe,Be,Ue,ze,He,Qe,et,Je;const b=reactRouterDom.useNavigate(),{toast:_}=useToast(),[S,R]=React.useState(1),[C,E]=React.useState(null),[A,M]=React.useState(0),[I,j]=React.useState(!1),[F]=usePostV4ResellerByRouteResellerIdProductAndRandmarSkuShopifyMutation(),z=((Fe=e==null?void 0:e.Distribution)==null?void 0:Fe.Cost)||0,Q=((Oe=e==null?void 0:e.Distribution)==null?void 0:Oe.RegularPrice)||0,O=((Be=e==null?void 0:e.Distribution)==null?void 0:Be.Price)||0;React.useEffect(()=>{R(1),E(null),M(0)},[e==null?void 0:e.RandmarSKU]),React.useEffect(()=>{var Ze;if(e&&o){const Ke=(Ze=e.Opportunities)==null?void 0:Ze.find(at=>at.BidNumber==o);Ke&&V(Ke)&&E(Ke)}},[e,o]),React.useEffect(()=>{if(!e)return;const Ze=C!=null&&C.Price?C.Price:O;M(Q>0?Math.round((Q-Ze)/Q*100):0)},[e,C,O,Q]),React.useEffect(()=>{d||R(1)},[d]);const V=Ze=>{if(Ze.Active!==!0)return!1;const Ke=new Date().toISOString().split("T")[0];return!(Ze.EndDate&&Ze.EndDate.split("T")[0]<Ke||Ze.StartDate&&Ze.StartDate.split("T")[0]>Ke)},te=Ze=>Ze>=90?{label:"Top 10% Bestseller",color:"text-purple-950",bgColor:"bg-purple-200"}:Ze>=75?{label:"Bestseller",color:"text-blue-700",bgColor:"bg-blue-50"}:Ze>=33?{label:"Popular",color:"text-green-700",bgColor:"bg-green-50"}:{label:"Rising",color:"text-gray-700",bgColor:"bg-white"};if(!e)return jsxRuntime.jsx(Card,{children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-28 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex gap-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx("div",{className:"w-60 h-40",children:jsxRuntime.jsx(Skeleton,{className:"w-full h-full rounded-lg"})})})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-24 mb-3"}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-full rounded-md"})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-32 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24 mt-4"})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-10 flex-1 rounded-md"})]})]})]})});const ne=(e==null?void 0:e.Opportunities)||[],ae=ne.length>0,$e=()=>{if(S==null){R(1);return}S>1&&R(S-1)},ge=()=>{if(S==null){R(1);return}R(S+1)},se=Ze=>{const Ke=Number.parseInt(Ze.target.value,10);if(!isNaN(Ke)&&Ke>0){R(Ke);return}R(void 0)},je=()=>{(S==null||S<1)&&R(1)},Ae=Ze=>{try{return new Date(Ze).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(Ke){return console.error(Ke),Ze.split("T")[0]||"N/A"}},Ne=()=>{typeof l<"u"&&l({quantity:S??1,bidNumber:(C==null?void 0:C.BidNumber)??null})},Ve=()=>{I||!f||(j(!0),F({routeResellerId:t??"",randmarSku:e.RandmarSKU??"",shopifyHostName:f}).then(Ze=>{if(Ze.error){console.error("Error syncing to Shopify:",Ze.error),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"});return}_({title:"Product synced",description:"Product synced to Shopify successfully",variant:"success"})}).catch(Ze=>{console.error("Error syncing to Shopify:",Ze),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"})}).finally(()=>{j(!1)}))};return jsxRuntime.jsx(Card,{className:"w-full hover:shadow-lg transition-shadow @container",children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex items-center justify-end ml-4 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:e.ManufacturerId,name:e.ManufacturerName,width:96,height:40},`partner_logo_${e.ManufacturerId}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6",children:[jsxRuntime.jsxs("div",{className:"flex-1 @[36rem]:order-1 order-2 flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-center @[36rem]:items-start @[36rem]:justify-start",children:[e.State&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Check,{size:"12",className:"mr-1.5"})," ",e.State]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[jsxRuntime.jsx(QrCode,{size:"12",className:"mr-1.5"})," ",e.SerialNumber?"Serialized":"Unserialized"]}),e.TransparencyCode&&jsxRuntime.jsxs(Badge,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[jsxRuntime.jsx(CircleDashed,{size:"12",className:"mr-1.5"})," Transparency Code"]}),e.AvailableToBuy!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(ShoppingCart,{size:"12",className:"mr-1.5"})," ",e.AvailableToBuy?"Available":"Unavailable"]}),e.ManufacturerCategory!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${(Ue=e.ManufacturerCategory)!=null&&Ue.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[jsxRuntime.jsx(ShieldCheck,{size:"12",className:"mr-1.5"})," ",(ze=e.ManufacturerCategory)!=null&&ze.QualificationRequired?"Qualified Only":"Available to all"]}),e.ManufacturerId&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(RefreshCw,{size:"12",className:"mr-1.5"})," ",e.AutoUpdate?`Automatic Reorder (${e.MasterCarton})`:"Manually Reorders"]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.BodyHTML&&e.Title&&e.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Store,{size:"12",className:"mr-1.5"})," ",e.BodyHTML&&e.Title&&e.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.UnitWeight?`${formatNumber(e.UnitWeight)} lbs`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["MAP",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),"MSRP"]}),jsxRuntime.jsxs("div",{className:"font-medium",children:[e.MAP?formatMoney(e.MAP):"N/A",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),e.MSRP?formatMoney(e.MSRP):"N/A"]})]}),!!e.OverallPercentileRank&&!!e.ManufacturerPercentileRank&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Bestseller Status"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{children:"Global: "}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${te(e.OverallPercentileRank).bgColor} ${te(e.OverallPercentileRank).color} hover:${te(e.OverallPercentileRank).bgColor}`,children:te(e.OverallPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",e.OverallPercentileRank]})})]})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("span",{children:[e.ManufacturerName,": "]}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${te(e.ManufacturerPercentileRank).bgColor} ${te(e.ManufacturerPercentileRank).color} hover:${te(e.ManufacturerPercentileRank).bgColor}`,children:te(e.ManufacturerPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",e.ManufacturerPercentileRank]})})]})})]})]})]}),e.CountryCodeOfOrigin&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),jsxRuntime.jsxs("div",{className:"font-medium flex items-center",children:[jsxRuntime.jsx(CountryFlag,{countryCode:e.CountryCodeOfOrigin,className:"mr-2"}),e.CountryCodeOfOrigin]})]})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:order-2 order-1 items-center",children:jsxRuntime.jsx(ProductImage,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""},`product_image_${e.RandmarSKU}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-row @[36rem]:flex-col gap-4 justify-center @[36rem]:justify-start @[36rem]:order-2 order-1",children:[n&&jsxRuntime.jsx(reactRouterDom.Link,{to:n,children:jsxRuntime.jsxs(Button$1,{variant:"secondary",children:[jsxRuntime.jsx(Eye,{className:"mr-2"}),"View Product"]})}),jsxRuntime.jsx(ProductInventoryButton,{applicationId:t??"",randmarSku:e.RandmarSKU??"",inventory:(He=e.Distribution)==null?void 0:He.Inventory})]}),jsxRuntime.jsx("div",{className:"flex flex-1 @[36rem]:order-1 order-2",children:ae&&e.Distribution&&jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx("div",{className:"flex items-center",children:"You have "+ne.length+(ne.length>1?" opportunities":" opportunity")+" for this product:"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:ne.map((Ze,Ke)=>V(Ze)?jsxRuntime.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 border border-muted cursor-pointer ${Ze.BidNumber==(C==null?void 0:C.BidNumber)?"bg-purple-100 border-2 border-purple-900":"bg-white border-1 border-purple-600 hover:bg-purple-200"}`,onClick:()=>{E(Ze.BidNumber!==(C==null?void 0:C.BidNumber)?Ze:null)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsx("span",{className:"text-xs text-neutral-900",children:Ze.BidNumber})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",Ae(Ze.EndDate)]})]})]},Ke):jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted cursor-pointer !bg-neutral-50 hover:bg-neutral-100",onClick:()=>{Ze.BidNumber&&b(`/${t}/Opportunity/${Ze.ManufacturerId}/${Ze.BidNumber}`)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsxs("span",{className:"text-xs text-neutral-900",children:[Ze.BidNumber," ",jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",Ae(Ze.EndDate)]})]})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"View Opportunity"})})]},Ke))})})]})})]}),jsxRuntime.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end mt-4 gap-4",children:[e.Distribution&&jsxRuntime.jsx("div",{className:"flex-shrink-1 flex flex-col gap-1",children:z>0?jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:["Cost: ",formatMoney(z)]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap",children:[jsxRuntime.jsx("span",{className:"text-2xl font-bold whitespace-nowrap",children:formatMoney((C?(et=(Qe=e.Opportunities)==null?void 0:Qe.find(Ze=>Ze.BidNumber==C.BidNumber))==null?void 0:et.Price:O)??0)}),A>0&&jsxRuntime.jsx("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:formatMoney(Q)})]}),A>0&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Badge,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[jsxRuntime.jsxs("span",{children:[A,"% OFF"]}),((Je=e.InstantRebate)==null?void 0:Je.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(C==null?void 0:C.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",C.EndDate.split("T")[0]]})]})})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col justify-center @[36rem]:justify-end items-end gap-2 w-full",children:[f&&jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:Ve,disabled:I,children:I?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Sync to Shopify"]})}),g,typeof l<"u"&&jsxRuntime.jsxs("div",{className:"flex gap-2 whitespace-nowrap",children:[jsxRuntime.jsxs("div",{className:"flex items-center border rounded-md",children:[jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:$e,disabled:typeof S<"u"&&(S<=1||!e.AvailableToBuy||d),children:"-"}),jsxRuntime.jsx("input",{value:S,onChange:se,onBlur:je,onClick:Ze=>Ze.currentTarget.select(),className:`w-6 @[36rem]:w-12 text-center border-0 focus:ring-0 focus:outline-none ${!e.AvailableToBuy||d?"text-gray-400":""}`,disabled:!e.AvailableToBuy||d}),jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:ge,disabled:!e.AvailableToBuy||d,children:"+"})]}),jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap",onClick:Ne,disabled:!e.AvailableToBuy||d,children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Add to Cart"]})})]})]})]})]})})}const complexComponents=[`----
|
|
1231
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var o=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(o,8);return l>255&&(o=o.slice(0,-1),l=parseInt(o,8)),this.pos+=o.length-1,e=this.input.charCodeAt(this.pos),(o!=="0"||e===56||e===57)&&(this.strict||t)&&this.invalidStringToken(this.pos-1-o.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return isNewLine(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}},pp.readHexChar=function(t){var e=this.pos,n=this.readInt(16,t);return n===null&&this.invalidStringToken(e,"Bad character escape sequence"),n},pp.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,n=this.pos,o=this.options.ecmaVersion>=6;this.pos<this.input.length;){var l=this.fullCharCodeAtPos();if(isIdentifierChar(l,o))this.pos+=l<=65535?1:2;else if(l===92){this.containsEsc=!0,t+=this.input.slice(n,this.pos);var d=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var f=this.readCodePoint();(e?isIdentifierStart:isIdentifierChar)(f,o)||this.invalidStringToken(d,"Invalid Unicode escape"),t+=codePointToString(f),n=this.pos}else break;e=!1}return t+this.input.slice(n,this.pos)},pp.readWord=function(){var t=this.readWord1(),e=types$1.name;return this.keywords.test(t)&&(e=keywords[t]),this.finishToken(e,t)};var version="8.12.1";Parser.acorn={Parser,version,defaultOptions,Position,SourceLocation,getLineInfo,Node:Node$3,TokenType,tokTypes:types$1,keywordTypes:keywords,TokContext,tokContexts:types,isIdentifierChar,isIdentifierStart,Token,isNewLine,lineBreak,lineBreakG,nonASCIIwhitespace};var AcornJSX=__toESM(require_acorn_jsx()),attributeNames_default={acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",colspan:"colSpan",contenteditable:"contentEditable",crossorigin:"crossOrigin",datetime:"dateTime",enctype:"encType",for:"htmlFor",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",httpequiv:"httpEquiv",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"},VOID_ELEMENTS=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],NO_WHITESPACE=["table","tbody","tfoot","thead","tr"];function canHaveChildren(t){return VOID_ELEMENTS.indexOf(t.toLowerCase())===-1}function canHaveWhitespace(t){return NO_WHITESPACE.indexOf(t.toLowerCase())!==-1}class NullishShortCircuit extends Error{constructor(e="Nullish value encountered"){super(e),this.name="NullishShortCircuit"}}var hash=(t="",e=16)=>{const n=String(t);let o=0;return n.split("").forEach(l=>{o=(o<<5)-o+l.charCodeAt(0),o&=o}),Math.abs(o).toString(e)},randomHash=()=>hash(Math.random().toString()),camelCase=t=>t.replace(/([A-Z])([A-Z])/g,"$1 $2").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-zA-Z\u00C0-\u00ff]/g," ").toLowerCase().split(" ").filter(e=>e).map((e,n)=>n>0?e[0].toUpperCase()+e.slice(1):e).join(""),parseStyle=t=>{switch(typeof t){case"string":return t.split(";").filter(e=>e).reduce((e,n)=>{const o=n.slice(0,n.indexOf(":")).trim(),l=n.slice(n.indexOf(":")+1).trim();return{...e,[camelCase(o)]:l}},{});case"object":return t;default:return}},pathToArrayPath=t=>t==null||t===""?[]:t.split("."),resolveArrayPath=(t,e)=>{const[n,...o]=e;if(!(t==null||n==null))return o.length===0?t[n]:resolveArrayPath(t[n],o)},resolvePath=(t,e)=>resolveArrayPath(t,pathToArrayPath(e));function handleNaN(t){return Number.isNaN(t)?"NaN":t}class JsxParser extends React.Component{constructor(){super(...arguments);Zt(this,"ParsedChildren",null);Un(this,un,n=>{const o=Parser.extend(AcornJSX.default({autoCloseVoidElements:this.props.autoCloseVoidElements})),l=`<root>${n}</root>`;let d=[];try{return d=o.parse(l,{ecmaVersion:"latest"}),d=d.body[0].expression.children||[],d.map(f=>an(this,nn).call(this,f)).filter(Boolean)}catch(f){return this.props.showWarnings&&console.warn(f),this.props.onError&&this.props.onError(f),this.props.renderError?this.props.renderError({error:String(f)}):null}});Un(this,nn,(n,o)=>{var l,d;switch(n.type){case"JSXAttribute":return n.value===null?!0:an(this,nn).call(this,n.value,o);case"JSXElement":case"JSXFragment":return an(this,Jn).call(this,n,o);case"JSXExpressionContainer":return an(this,nn).call(this,n.expression,o);case"JSXText":const f=this.props.disableKeyGeneration?void 0:randomHash();return this.props.disableFragments?n.value:React.createElement(React.Fragment,{key:f},n.value);case"ArrayExpression":return n.elements.map(A=>an(this,nn).call(this,A,o));case"BinaryExpression":const g=an(this,nn).call(this,n.left,o),b=an(this,nn).call(this,n.right,o);let _;switch(n.operator){case"-":_=g-b;break;case"!=":_=g!=b;break;case"!==":_=g!==b;break;case"*":_=g*b;break;case"**":_=g**b;break;case"/":_=g/b;break;case"%":_=g%b;break;case"+":_=g+b;break;case"<":_=g<b;break;case"<=":_=g<=b;break;case"==":_=g==b;break;case"===":_=g===b;break;case">":_=g>b;break;case">=":_=g>=b;break;default:this.props.onError(new Error(`Unsupported binary operator: ${n.operator}`));return}return handleNaN(_);case"CallExpression":const S=an(this,nn).call(this,n.callee,o);if(S===void 0){if(n.optional)throw new NullishShortCircuit;this.props.onError(new Error(`The expression '${n.callee}' could not be resolved, resulting in an undefined return value.`));return}return S(...n.arguments.map(A=>an(this,nn).call(this,A,o)));case"ConditionalExpression":return an(this,nn).call(this,n.test,o)?an(this,nn).call(this,n.consequent,o):an(this,nn).call(this,n.alternate,o);case"ExpressionStatement":return an(this,nn).call(this,n.expression,o);case"Identifier":return n.name==="Infinity"?1/0:n.name==="-Infinity"?-1/0:n.name==="NaN"?NaN:o&&n.name in o?handleNaN(o[n.name]):handleNaN((this.props.bindings||{})[n.name]);case"Literal":return n.value;case"LogicalExpression":const R=an(this,nn).call(this,n.left,o);return n.operator==="||"&&R?R:n.operator==="&&"&&R||n.operator==="||"&&!R?an(this,nn).call(this,n.right,o):!1;case"MemberExpression":return an(this,ir).call(this,n,o);case"ChainExpression":return an(this,rr).call(this,n,o);case"ObjectExpression":const C={};return n.properties.forEach(A=>{C[A.key.name||A.key.value]=an(this,nn).call(this,A.value,o)}),C;case"TemplateElement":return n.value.cooked;case"TemplateLiteral":return[...n.expressions,...n.quasis].sort((A,M)=>A.start<M.start?-1:1).map(A=>an(this,nn).call(this,A,o)).join("");case"UnaryExpression":const E=an(this,nn).call(this,n.argument,o);switch(n.operator){case"+":return+E;case"-":return-E;case"!":return!E;case"~":return~E;case"typeof":return typeof E}return;case"ArrowFunctionExpression":return(n.async||n.generator)&&((d=(l=this.props).onError)==null||d.call(l,new Error("Async and generator arrow functions are not supported."))),(...A)=>{const M={...o};return n.params.forEach((I,j)=>{M[I.name]=A[j]}),an(this,nn).call(this,n.body,M)};default:this.props.onError(new Error(`The expression type '${n.type}' is not supported.`));return}});Un(this,rr,(n,o)=>{try{return an(this,nn).call(this,n.expression,o)}catch(l){if(l instanceof NullishShortCircuit)return;throw l}});Un(this,ir,(n,o)=>{const l=an(this,nn).call(this,n.object,o);let d;if(n.computed)d=an(this,nn).call(this,n.property,o);else if(n.property.type==="Identifier")d=n.property.name;else{this.props.onError(new Error("Only simple MemberExpressions are supported."));return}if(l==null&&n.optional)throw new NullishShortCircuit;let f;try{f=l[d]}catch{this.props.onError(new Error(`The property '${d}' could not be resolved on the object '${l}'.`));return}return typeof f=="function"?f.bind(l):f});Un(this,Hn,n=>n.type==="JSXIdentifier"?n.name:`${an(this,Hn).call(this,n.object)}.${an(this,Hn).call(this,n.property)}`);Un(this,Jn,(n,o)=>{const{allowUnknownElements:l,components:d,componentsOnly:f,onError:g}=this.props,{children:b=[]}=n,_=n.type==="JSXElement"?n.openingElement:n.openingFragment,{attributes:S=[]}=_,R=n.type==="JSXElement"?an(this,Hn).call(this,_.name):"",C=(this.props.blacklistedAttrs||[]).map(z=>z instanceof RegExp?z:new RegExp(z,"i")),E=(this.props.blacklistedTags||[]).map(z=>z.trim().toLowerCase()).filter(Boolean);if(/^(html|head|body)$/i.test(R))return b.map(z=>an(this,Jn).call(this,z,o));const A=R.trim().toLowerCase();if(E.indexOf(A)!==-1)return g(new Error(`The tag <${R}> is blacklisted, and will not be rendered.`)),null;if(R!==""&&!resolvePath(d,R)){if(f)return g(new Error(`The component <${R}> is unrecognized, and will not be rendered.`)),this.props.renderUnrecognized(R);if(!l&&document.createElement(R)instanceof HTMLUnknownElement)return g(new Error(`The tag <${R}> is unrecognized in this browser, and will not be rendered.`)),this.props.renderUnrecognized(R)}let M,I=n.type==="JSXElement"?resolvePath(d,R):React.Fragment;if(I||canHaveChildren(R)){if(M=b.map(Q=>an(this,nn).call(this,Q,o)),R.includes(".")){const O=R.split(".").reduce((V,te)=>V?V[te]:d==null?void 0:d[te],null);O&&(I=O)}!I&&!canHaveWhitespace(R)&&(M=M.filter(Q=>typeof Q!="string"||!/^\s*$/.test(Q)));const z=M.find(Q=>typeof Q=="function");M.length===0?M=void 0:z?M=z:M.length===1?[M]=M:M.length>1&&!this.props.disableKeyGeneration&&(M=M.map((Q,O)=>Q!=null&&Q.type&&!(Q!=null&&Q.key)?{...Q,key:Q.key||O}:Q))}const j={key:this.props.disableKeyGeneration?void 0:randomHash()};S.forEach(z=>{if(z.type==="JSXAttribute"){const Q=z.name.name,O=attributeNames_default[Q]||Q,V=an(this,nn).call(this,z,o);C.filter(ne=>ne.test(O)).length===0&&(j[O]=V)}else if(z.type==="JSXSpreadAttribute"&&z.argument.type==="Identifier"||z.argument.type==="MemberExpression"){const Q=an(this,nn).call(this,z.argument,o);typeof Q=="object"&&Object.keys(Q).forEach(O=>{const V=attributeNames_default[O]||O;C.filter(ne=>ne.test(V)).length===0&&(j[V]=Q[O])})}}),typeof j.style=="string"&&(j.style=parseStyle(j.style));const F=R.toLowerCase();return F==="option"&&(M=M.props.children),React.createElement(I||F,j,M)})}render(){const n=(this.props.jsx||"").trim().replace(/<!DOCTYPE([^>]*)>/g,"");this.ParsedChildren=an(this,un).call(this,n);const o=[...new Set(["jsx-parser",...String(this.props.className).split(" ")])].filter(Boolean).join(" ");return this.props.renderInWrapper?React.createElement("div",{className:o},this.ParsedChildren):this.ParsedChildren}}un=new WeakMap,nn=new WeakMap,rr=new WeakMap,ir=new WeakMap,Hn=new WeakMap,Jn=new WeakMap,Zt(JsxParser,"displayName","JsxParser"),Zt(JsxParser,"defaultProps",{allowUnknownElements:!0,autoCloseVoidElements:!1,bindings:{},blacklistedAttrs:[/^on.+/i],blacklistedTags:["script"],className:"",components:{},componentsOnly:!1,disableFragments:!1,disableKeyGeneration:!1,jsx:"",onError:()=>{},showWarnings:!1,renderError:void 0,renderInWrapper:!0,renderUnrecognized:()=>null});var source_default=JsxParser;const CountryFlag=({countryCode:t,className:e=""})=>{const[n,o]=React.useState(null),[l,d]=React.useState(!1);return React.useEffect(()=>{if(!t)return;const g=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${t.toUpperCase()}.svg`;fetch(g,{method:"HEAD"}).then(b=>{b.ok?(o(g),d(!1)):d(!0)}).catch(()=>{d(!0)})},[t]),l||!n?jsxRuntime.jsx("span",{className:e,children:t}):jsxRuntime.jsx("img",{src:n,alt:`${t} flag`,className:`inline-block ${e}`,style:{width:"24px",height:"auto"}})};function ProductCard({applicationId:t,product:e,viewProductLink:n,defaultOpportunityNumber:o="",onAddToCart:l,addingToCart:d=!1,shopifyHostname:f,customAction:g=jsxRuntime.jsx(jsxRuntime.Fragment,{})}){var Fe,Oe,Be,Ue,ze,He,Qe,et,Je;const b=reactRouterDom.useNavigate(),{toast:_}=useToast(),[S,R]=React.useState(1),[C,E]=React.useState(null),[A,M]=React.useState(0),[I,j]=React.useState(!1),[F]=usePostV4ResellerByRouteResellerIdProductAndRandmarSkuShopifyMutation(),z=((Fe=e==null?void 0:e.Distribution)==null?void 0:Fe.Cost)||0,Q=((Oe=e==null?void 0:e.Distribution)==null?void 0:Oe.RegularPrice)||0,O=((Be=e==null?void 0:e.Distribution)==null?void 0:Be.Price)||0;React.useEffect(()=>{R(1),E(null),M(0)},[e==null?void 0:e.RandmarSKU]),React.useEffect(()=>{var Ze;if(e&&o){const Ke=(Ze=e.Opportunities)==null?void 0:Ze.find(at=>at.BidNumber==o);Ke&&V(Ke)&&E(Ke)}},[e,o]),React.useEffect(()=>{if(!e)return;const Ze=C!=null&&C.Price?C.Price:O;M(Q>0?Math.round((Q-Ze)/Q*100):0)},[e,C,O,Q]),React.useEffect(()=>{d||R(1)},[d]);const V=Ze=>{if(Ze.Active!==!0)return!1;const Ke=new Date().toISOString().split("T")[0];return!(Ze.EndDate&&Ze.EndDate.split("T")[0]<Ke||Ze.StartDate&&Ze.StartDate.split("T")[0]>Ke)},te=Ze=>Ze>=90?{label:"Top 10% Bestseller",color:"text-purple-950",bgColor:"bg-purple-200"}:Ze>=75?{label:"Bestseller",color:"text-blue-700",bgColor:"bg-blue-50"}:Ze>=33?{label:"Popular",color:"text-green-700",bgColor:"bg-green-50"}:{label:"Rising",color:"text-gray-700",bgColor:"bg-white"};if(!e)return jsxRuntime.jsx(Card,{children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-28 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex gap-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx("div",{className:"w-60 h-40",children:jsxRuntime.jsx(Skeleton,{className:"w-full h-full rounded-lg"})})})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-24 mb-3"}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-full rounded-md"})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-32 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24 mt-4"})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-10 flex-1 rounded-md"})]})]})]})});const ne=(e==null?void 0:e.Opportunities)||[],ae=ne.length>0,$e=()=>{if(S==null){R(1);return}S>1&&R(S-1)},ge=()=>{if(S==null){R(1);return}R(S+1)},se=Ze=>{const Ke=Number.parseInt(Ze.target.value,10);if(!isNaN(Ke)&&Ke>0){R(Ke);return}R(void 0)},je=()=>{(S==null||S<1)&&R(1)},Ae=Ze=>{try{return new Date(Ze).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(Ke){return console.error(Ke),Ze.split("T")[0]||"N/A"}},Ne=()=>{typeof l<"u"&&l({quantity:S??1,bidNumber:(C==null?void 0:C.BidNumber)??null})},Ve=()=>{I||!f||(j(!0),F({routeResellerId:t??"",randmarSku:e.RandmarSKU??"",shopifyHostName:f}).then(Ze=>{if(Ze.error){console.error("Error syncing to Shopify:",Ze.error),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"});return}_({title:"Product synced",description:"Product synced to Shopify successfully",variant:"success"})}).catch(Ze=>{console.error("Error syncing to Shopify:",Ze),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"})}).finally(()=>{j(!1)}))};return jsxRuntime.jsx(Card,{className:"w-full hover:shadow-lg transition-shadow @container",children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-xl",children:e.Title||e.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex items-center justify-end ml-4 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:e.ManufacturerId,name:e.ManufacturerName,width:96,height:40},`partner_logo_${e.ManufacturerId}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6",children:[jsxRuntime.jsxs("div",{className:"flex-1 @[36rem]:order-1 order-2 flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-center @[36rem]:items-start @[36rem]:justify-start",children:[e.State&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Check,{size:"12",className:"mr-1.5"})," ",e.State]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[jsxRuntime.jsx(QrCode,{size:"12",className:"mr-1.5"})," ",e.SerialNumber?"Serialized":"Unserialized"]}),e.TransparencyCode&&jsxRuntime.jsxs(Badge,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[jsxRuntime.jsx(CircleDashed,{size:"12",className:"mr-1.5"})," Transparency Code"]}),e.AvailableToBuy!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(ShoppingCart,{size:"12",className:"mr-1.5"})," ",e.AvailableToBuy?"Available":"Unavailable"]}),e.ManufacturerCategory!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${(Ue=e.ManufacturerCategory)!=null&&Ue.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[jsxRuntime.jsx(ShieldCheck,{size:"12",className:"mr-1.5"})," ",(ze=e.ManufacturerCategory)!=null&&ze.QualificationRequired?"Qualified Only":"Available to all"]}),e.ManufacturerId&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(RefreshCw,{size:"12",className:"mr-1.5"})," ",e.AutoUpdate?`Automatic Reorder (${e.MasterCarton})`:"Manually Reorders"]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${e.BodyHTML&&e.Title&&e.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Store,{size:"12",className:"mr-1.5"})," ",e.BodyHTML&&e.Title&&e.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.MPN||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.UPC||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.UnitWeight?`${formatNumber(e.UnitWeight)} lbs`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["MAP",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),"MSRP"]}),jsxRuntime.jsxs("div",{className:"font-medium",children:[e.MAP?formatMoney(e.MAP):"N/A",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),e.MSRP?formatMoney(e.MSRP):"N/A"]})]}),!!e.OverallPercentileRank&&!!e.ManufacturerPercentileRank&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Bestseller Status"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{children:"Global: "}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${te(e.OverallPercentileRank).bgColor} ${te(e.OverallPercentileRank).color} hover:${te(e.OverallPercentileRank).bgColor}`,children:te(e.OverallPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",e.OverallPercentileRank]})})]})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("span",{children:[e.ManufacturerName,": "]}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${te(e.ManufacturerPercentileRank).bgColor} ${te(e.ManufacturerPercentileRank).color} hover:${te(e.ManufacturerPercentileRank).bgColor}`,children:te(e.ManufacturerPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",e.ManufacturerPercentileRank]})})]})})]})]})]}),e.CountryCodeOfOrigin&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),jsxRuntime.jsxs("div",{className:"font-medium flex items-center",children:[jsxRuntime.jsx(CountryFlag,{countryCode:e.CountryCodeOfOrigin,className:"mr-2"}),e.CountryCodeOfOrigin]})]})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:order-2 order-1 items-center",children:jsxRuntime.jsx(ProductImage,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""},`product_image_${e.RandmarSKU}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-row @[36rem]:flex-col gap-4 justify-center @[36rem]:justify-start @[36rem]:order-2 order-1",children:[n&&jsxRuntime.jsx(reactRouterDom.Link,{to:n,children:jsxRuntime.jsxs(Button$1,{variant:"secondary",children:[jsxRuntime.jsx(Eye,{className:"mr-2"}),"View Product"]})}),jsxRuntime.jsx(ProductInventoryButton,{applicationId:t??"",randmarSku:e.RandmarSKU??"",inventory:(He=e.Distribution)==null?void 0:He.Inventory})]}),jsxRuntime.jsx("div",{className:"flex flex-1 @[36rem]:order-1 order-2",children:ae&&e.Distribution&&jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx("div",{className:"flex items-center",children:"You have "+ne.length+(ne.length>1?" opportunities":" opportunity")+" for this product:"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:ne.map((Ze,Ke)=>V(Ze)?jsxRuntime.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 border border-muted cursor-pointer ${Ze.BidNumber==(C==null?void 0:C.BidNumber)?"bg-purple-100 border-2 border-purple-900":"bg-white border-1 border-purple-600 hover:bg-purple-200"}`,onClick:()=>{E(Ze.BidNumber!==(C==null?void 0:C.BidNumber)?Ze:null)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsx("span",{className:"text-xs text-neutral-900",children:Ze.BidNumber})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",Ae(Ze.EndDate)]})]})]},Ke):jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted cursor-pointer !bg-neutral-50 hover:bg-neutral-100",onClick:()=>{Ze.BidNumber&&b(`/${t}/Opportunity/${Ze.ManufacturerId}/${Ze.BidNumber}`)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsxs("span",{className:"text-xs text-neutral-900",children:[Ze.BidNumber," ",jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",Ae(Ze.EndDate)]})]})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"View Opportunity"})})]},Ke))})})]})})]}),jsxRuntime.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end mt-4 gap-4",children:[e.Distribution&&jsxRuntime.jsx("div",{className:"flex-shrink-1 flex flex-col gap-1",children:z>0?jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:["Cost: ",formatMoney(z)]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap",children:[Q>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("span",{className:"text-2xl font-bold whitespace-nowrap",children:formatMoney((C?(et=(Qe=e.Opportunities)==null?void 0:Qe.find(Ze=>Ze.BidNumber==C.BidNumber))==null?void 0:et.Price:O)??0)})}),A>0&&jsxRuntime.jsx("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:formatMoney(Q)})]}),A>0&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Badge,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[jsxRuntime.jsxs("span",{children:[A,"% OFF"]}),((Je=e.InstantRebate)==null?void 0:Je.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(C==null?void 0:C.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",C.EndDate.split("T")[0]]})]})})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col justify-center @[36rem]:justify-end items-end gap-2 w-full",children:[f&&jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:Ve,disabled:I,children:I?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Sync to Shopify"]})}),g,typeof l<"u"&&jsxRuntime.jsxs("div",{className:"flex gap-2 whitespace-nowrap",children:[jsxRuntime.jsxs("div",{className:"flex items-center border rounded-md",children:[jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:$e,disabled:typeof S<"u"&&(S<=1||!e.AvailableToBuy||d),children:"-"}),jsxRuntime.jsx("input",{value:S,onChange:se,onBlur:je,onClick:Ze=>Ze.currentTarget.select(),className:`w-6 @[36rem]:w-12 text-center border-0 focus:ring-0 focus:outline-none ${!e.AvailableToBuy||d?"text-gray-400":""}`,disabled:!e.AvailableToBuy||d}),jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:ge,disabled:!e.AvailableToBuy||d,children:"+"})]}),jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap",onClick:Ne,disabled:!e.AvailableToBuy||d,children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Add to Cart"]})})]})]})]})]})})}const complexComponents=[`----
|
|
1232
1232
|
PartnerCard: For data that fits this shape:
|
|
1233
1233
|
{ "ApplicationId": "19022", "PublicName": "BiOSS", "VoiceName": null, "VoiceStyle": null, "About": "example", "SceneName": "Kitchen Counter", "IsReseller": true, "IsManufacturer": true, "IsSalesAgency": false, "Socials": [ { "ApplicationId": "19022", "SocialNetwork": "Facebook", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "Instagram", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "LinkedIn", "Tag": "@biossinc" }, { "ApplicationId": "19022", "SocialNetwork": "Youtube", "Tag": "@biosssolutionssanitairessa4095" } ], "Manufacturer": null, "Reseller": null }
|
|
1234
1234
|
Use <PartnerCard account={data} action={<></>}>`,`----
|