randmarcomps 1.273.0 → 1.274.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
|
@@ -67156,7 +67156,7 @@ function ProductCard({
|
|
|
67156
67156
|
/* @__PURE__ */ jsx(Eye, { className: "mr-2" }),
|
|
67157
67157
|
"View Product"
|
|
67158
67158
|
] }) }),
|
|
67159
|
-
((Ht = e.Distribution) == null ? void 0 : Ht.Inventory) && /* @__PURE__ */ jsx("div", { className: "mt-4", children: oe != null && oe.IsReseller && et <= 0 ? /* @__PURE__ */ jsxs(Dialog, { open: j, onOpenChange: F, children: [
|
|
67159
|
+
((Ht = e.Distribution) == null ? void 0 : Ht.Inventory) && /* @__PURE__ */ jsx("div", { className: "mt-4", children: oe != null && oe.IsReseller && et <= 0 && ze <= 0 ? /* @__PURE__ */ jsxs(Dialog, { open: j, onOpenChange: F, children: [
|
|
67160
67160
|
/* @__PURE__ */ jsx(DialogTrigger, { asChild: !0, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", className: "flex products-center text-sm reseller-theme text-primary", children: [
|
|
67161
67161
|
/* @__PURE__ */ jsx(Warehouse, { size: "16", className: "mr-2" }),
|
|
67162
67162
|
"Request to stock"
|
|
@@ -1065,7 +1065,7 @@ Defaulting to 2020, but this will stop working in the future.`)),e.ecmaVersion=1
|
|
|
1065
1065
|
`: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`
|
|
1066
1066
|
`;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:defaultOptions$1,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(),1),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);Xt(this,"ParsedChildren",null);gr(this,tr,n=>{const o=Parser.extend(AcornJSX.default({autoCloseVoidElements:this.props.autoCloseVoidElements})),l=`<root>${n}</root>`;let d=[];try{d=o.parse(l,{ecmaVersion:"latest"}),d=d.body[0].expression.children||[]}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}return d.map(f=>Jt(this,Yt).call(this,f)).filter(Boolean)});gr(this,Yt,(n,o)=>{var l,d;switch(n.type){case"JSXAttribute":return n.value===null?!0:Jt(this,Yt).call(this,n.value,o);case"JSXElement":case"JSXFragment":return Jt(this,Pr).call(this,n,o);case"JSXExpressionContainer":return Jt(this,Yt).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=>Jt(this,Yt).call(this,A,o));case"BinaryExpression":const g=Jt(this,Yt).call(this,n.left,o),b=Jt(this,Yt).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=Jt(this,Yt).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=>Jt(this,Yt).call(this,A,o)));case"ConditionalExpression":return Jt(this,Yt).call(this,n.test,o)?Jt(this,Yt).call(this,n.consequent,o):Jt(this,Yt).call(this,n.alternate,o);case"ExpressionStatement":return Jt(this,Yt).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=Jt(this,Yt).call(this,n.left,o);return n.operator==="||"&&R?R:n.operator==="&&"&&R||n.operator==="||"&&!R?Jt(this,Yt).call(this,n.right,o):!1;case"MemberExpression":return Jt(this,Ar).call(this,n,o);case"ChainExpression":return Jt(this,Er).call(this,n,o);case"ObjectExpression":const C={};return n.properties.forEach(A=>{C[A.key.name||A.key.value]=Jt(this,Yt).call(this,A.value,o)}),C;case"TemplateElement":return n.value.cooked;case"TemplateLiteral":return[...n.expressions,...n.quasis].sort((A,I)=>A.start<I.start?-1:1).map(A=>Jt(this,Yt).call(this,A,o)).join("");case"UnaryExpression":const E=Jt(this,Yt).call(this,n.argument,o);switch(n.operator){case"+":return+E;case"-":return-E;case"!":return!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 I={...o};return n.params.forEach((M,j)=>{I[M.name]=A[j]}),Jt(this,Yt).call(this,n.body,I)};default:this.props.onError(new Error(`The expression type '${n.type}' is not supported.`));return}});gr(this,Er,(n,o)=>{try{return Jt(this,Yt).call(this,n.expression,o)}catch(l){if(l instanceof NullishShortCircuit)return;throw l}});gr(this,Ar,(n,o)=>{const l=Jt(this,Yt).call(this,n.object,o);let d;if(n.computed)d=Jt(this,Yt).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});gr(this,yr,n=>n.type==="JSXIdentifier"?n.name:`${Jt(this,yr).call(this,n.object)}.${Jt(this,yr).call(this,n.property)}`);gr(this,Pr,(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"?Jt(this,yr).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=>Jt(this,Pr).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 I,M=n.type==="JSXElement"?resolvePath(d,R):React.Fragment;if(M||canHaveChildren(R)){if(I=b.map(Q=>Jt(this,Yt).call(this,Q,o)),R.includes(".")){const F=R.split(".").reduce((O,te)=>O?O[te]:d==null?void 0:d[te],null);F&&(M=F)}!M&&!canHaveWhitespace(R)&&(I=I.filter(Q=>typeof Q!="string"||!/^\s*$/.test(Q)));const z=I.find(Q=>typeof Q=="function");I.length===0?I=void 0:z?I=z:I.length===1?[I]=I:I.length>1&&!this.props.disableKeyGeneration&&(I=I.map((Q,F)=>Q!=null&&Q.type&&!(Q!=null&&Q.key)?{...Q,key:Q.key||F}:Q))}const j={key:this.props.disableKeyGeneration?void 0:randomHash()};S.forEach(z=>{if(z.type==="JSXAttribute"){const Q=z.name.name,F=attributeNames_default[Q]||Q,O=Jt(this,Yt).call(this,z,o);C.filter(ne=>ne.test(F)).length===0&&(j[F]=O)}else if(z.type==="JSXSpreadAttribute"&&z.argument.type==="Identifier"||z.argument.type==="MemberExpression"){const Q=Jt(this,Yt).call(this,z.argument,o);typeof Q=="object"&&Object.keys(Q).forEach(F=>{const O=attributeNames_default[F]||F;C.filter(ne=>ne.test(O)).length===0&&(j[O]=Q[F])})}}),typeof j.style=="string"&&(j.style=parseStyle(j.style));const q=R.toLowerCase();return q==="option"&&(I=I.props.children),React.createElement(M||q,j,I)})}render(){const n=(this.props.jsx||"").trim().replace(/<!DOCTYPE([^>]*)>/g,"");this.ParsedChildren=Jt(this,tr).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}}tr=new WeakMap,Yt=new WeakMap,Er=new WeakMap,Ar=new WeakMap,yr=new WeakMap,Pr=new WeakMap,Xt(JsxParser,"displayName","JsxParser"),Xt(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 it,st,Ue,Rt,Je,mt,$t,Dt,Ht,Vt,We,nt;const b=React.useRef(null),_=useIntersectionObserver({elementRef:b,threshold:.1,rootMargin:"100px",freezeOnceVisible:!0}),{toast:S}=useToast(),[R,C]=React.useState(1),[E,A]=React.useState(null),[I,M]=React.useState(0),[j,q]=React.useState(!1),[z,Q]=React.useState(!1),[F,O]=React.useState(!1),[te]=usePutV4ResellerByRouteResellerIdProductAndRandmarSkuRequisitionMutation(),[ne,ae]=React.useState(!1),[ge]=usePostV4ResellerByRouteResellerIdProductAndRandmarSkuShopifyMutation(),{data:oe,isLoading:je,isFetching:Ne}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:t},{skip:!t||!_}),Ae=((it=e==null?void 0:e.Distribution)==null?void 0:it.Cost)||0,$e=((st=e==null?void 0:e.Distribution)==null?void 0:st.RegularPrice)||0,Fe=((Ue=e==null?void 0:e.Distribution)==null?void 0:Ue.Price)||0,ze=React.useMemo(()=>{var Qe;return!((Qe=e==null?void 0:e.Distribution)!=null&&Qe.Inventory)||e.Distribution.Inventory.length===0?0:e.Distribution.Inventory.reduce((dt,pt)=>dt+(pt.PurchaseOrderQuantity||0),0)},[(Rt=e==null?void 0:e.Distribution)==null?void 0:Rt.Inventory]);React.useEffect(()=>{C(1),A(null),M(0),q(!1)},[e==null?void 0:e.RandmarSKU]),React.useEffect(()=>{var Qe;if(e&&o){const dt=(Qe=e.Opportunities)==null?void 0:Qe.find(pt=>pt.BidNumber==o);dt&&A(dt)}},[e,o]),React.useEffect(()=>{if(!e)return;const Qe=E!=null&&E.Price?E.Price:Fe;M($e>0?Math.round(($e-Qe)/$e*100):0)},[e,E,Fe,$e]),React.useEffect(()=>{d||C(1)},[d]);const Ve=Qe=>{if(Qe.Active!==!0)return!1;const dt=new Date().toISOString().split("T")[0];return!(Qe.EndDate&&Qe.EndDate.split("T")[0]<dt||Qe.StartDate&&Qe.StartDate.split("T")[0]>dt)};if(React.useEffect(()=>{d||C(1)},[d]),!e||je||Ne)return jsxRuntime.jsx(Card,{children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between products-start mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx("div",{className:"h-10 w-24 flex products-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 products-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 products-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 products-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 Be=(e==null?void 0:e.Opportunities)||[],qe=Be.length>0,Ke=()=>{if(R==null){C(1);return}R>1&&C(R-1)},He=()=>{if(R==null){C(1);return}C(R+1)},Xe=Qe=>{const dt=Number.parseInt(Qe.target.value,10);if(!isNaN(dt)&&dt>0){C(dt);return}C(void 0)},tt=()=>{(R==null||R<1)&&C(1)},Ye=()=>{z||!(oe!=null&&oe.IsReseller)||(Q(!0),te({routeResellerId:oe.ApplicationId??"",randmarSku:e.RandmarSKU??""}).then(Qe=>{if(Qe.error){console.error(Qe.error),S({title:"Error",description:"Error submitting your qualification.",variant:"destructive"});return}S({title:"Success",description:"Qualification successfully submitted.",variant:"success"}),O(!1)}).catch(Qe=>{console.error(Qe),S({title:"Error",description:"Error submitting your qualification.",variant:"destructive"})}).finally(()=>{Q(!1)}))},et=((mt=(Je=e.Distribution)==null?void 0:Je.Inventory)==null?void 0:mt.reduce((Qe,dt)=>Qe+(dt.AvailableQuantity||0),0))||0,Ze=Qe=>{try{return new Date(Qe).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(dt){return console.error(dt),Qe.split("T")[0]||"N/A"}},at=()=>{typeof l<"u"&&l({quantity:R??1,bidNumber:(E==null?void 0:E.BidNumber)??null})},rt=()=>{ne||!f||(ae(!0),ge({routeResellerId:t??"",randmarSku:e.RandmarSKU??"",shopifyHostName:f}).then(Qe=>{if(Qe.error){console.error("Error syncing to Shopify:",Qe.error),S({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"});return}S({title:"Product synced",description:"Product synced to Shopify successfully",variant:"success"})}).catch(Qe=>{console.error("Error syncing to Shopify:",Qe),S({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"})}).finally(()=>{ae(!1)}))};return jsxRuntime.jsx(Card,{className:"hover:shadow-lg transition-shadow",ref:b,children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between products-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 products-center justify-end ml-4",children:jsxRuntime.jsx(PartnerLogo,{id:e.ManufacturerId,name:e.ManufacturerName,width:96,height:40})})]}),jsxRuntime.jsxs("div",{className:"flex gap-6",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",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 ${($t=e.ManufacturerCategory)!=null&&$t.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"})," ",(Dt=e.ManufacturerCategory)!=null&&Dt.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",children:"Percentile"}),jsxRuntime.jsxs("div",{className:`font-medium flex products-center ${e.OverallPercentileRank>=80?"text-green-700":""}`,children:[formatNumber(Math.round(e.OverallPercentileRank))," Overall"]}),jsxRuntime.jsxs("div",{className:"font-light flex products-center text-sm",children:[formatNumber(Math.round(e.ManufacturerPercentileRank))," with Manufacturer"]})]}),e.CountryCodeOfOrigin&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),jsxRuntime.jsxs("div",{className:"font-medium flex products-center",children:[jsxRuntime.jsx(CountryFlag,{countryCode:e.CountryCodeOfOrigin,className:"mr-2"}),e.CountryCodeOfOrigin]})]})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx(ProductImage,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:qe&&e.Distribution&&jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx("div",{className:"flex products-center",children:"You have "+Be.length+(Be.length>1?" opportunities":" opportunity")+" for this product:"}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:Be.map((Qe,dt)=>jsxRuntime.jsxs("div",{className:`flex justify-between products-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted
|
|
1067
1067
|
${Qe.BidNumber==(E==null?void 0:E.BidNumber)?"cursor-pointer border-2 border-purple-900":Ve(Qe)?"hover:bg-purple-200 cursor-pointer":"!bg-neutral-50"}
|
|
1068
|
-
`,onClick:()=>{Ve(Qe)&&A(Qe.BidNumber!=(E==null?void 0:E.BidNumber)?Qe:null)},children:[jsxRuntime.jsx("div",{className:"flex products-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Qe.Opportunity}),jsxRuntime.jsxs("span",{className:"text-xs text-neutral-900",children:[Qe.BidNumber," ",!Ve(Qe)&&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 products-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Qe.Price??0)}),Qe.Rebate&&Qe.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Qe.Rebate)]}),Qe.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",Ze(Qe.EndDate)]})]})]},dt))})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col products-center",children:[n&&jsxRuntime.jsx(reactRouterDom.Link,{to:n,children:jsxRuntime.jsxs(Button,{variant:"secondary",children:[jsxRuntime.jsx(Eye,{className:"mr-2"}),"View Product"]})}),((Ht=e.Distribution)==null?void 0:Ht.Inventory)&&jsxRuntime.jsx("div",{className:"mt-4",children:oe!=null&&oe.IsReseller&&et<=0?jsxRuntime.jsxs(Dialog,{open:F,onOpenChange:O,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{variant:"ghost",className:"flex products-center text-sm reseller-theme text-primary",children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),"Request to stock"]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-md",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Request to stock"})}),jsxRuntime.jsx("p",{className:"py-4",children:"Are you sure you want to request this product to be stocked?"}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>O(!1),disabled:z,children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:Ye,disabled:z,children:z?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin mr-2"}),"Requesting..."]}):"Confirm"})]})]})]}):et<=0&&ze>0?jsxRuntime.jsxs(Dialog,{open:j,onOpenChange:q,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{variant:"ghost",className:"flex products-center text-sm manufacturer-theme text-primary",children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),formatNumber(ze)," Incoming"]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-4xl",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsxs(DialogTitle,{className:"flex products-center",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2",size:18}),"Inventory Information"]})}),jsxRuntime.jsx(ProductInventoryGrid,{inventory:e.Distribution.Inventory})]})]}):jsxRuntime.jsxs(Dialog,{open:j,onOpenChange:q,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{variant:"ghost",className:`flex products-center text-sm ${et>0?"text-green-700":"text-red-700"}`,children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),et>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[formatNumber(et)," in stock"]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Out of stock"})]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-4xl",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsxs(DialogTitle,{className:"flex products-center",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2",size:18}),"Inventory Information"]})}),jsxRuntime.jsx(ProductInventoryGrid,{inventory:e.Distribution.Inventory})]})]})})]})]}),e.Distribution&&jsxRuntime.jsxs("div",{className:"flex justify-between products-end mt-4",children:[jsxRuntime.jsx("div",{className:"flex-shrink-1 flex flex-col products-start gap-1",children:Ae>0?jsxRuntime.jsx("div",{className:"flex products-center",children:jsxRuntime.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:["Cost: ",formatMoney(Ae)]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex products-center flex-wrap",children:[jsxRuntime.jsx("span",{className:"text-2xl font-bold whitespace-nowrap",children:formatMoney((E?(We=(Vt=e.Opportunities)==null?void 0:Vt.find(Qe=>Qe.BidNumber==E.BidNumber))==null?void 0:We.Price:Fe)??0)}),I>0&&jsxRuntime.jsx("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:formatMoney($e)})]}),I>0&&jsxRuntime.jsx("div",{className:"flex products-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:[I,"% OFF"]}),((nt=e.InstantRebate)==null?void 0:nt.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(E==null?void 0:E.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",E.EndDate.split("T")[0]]})]})})]})}),jsxRuntime.jsxs("div",{className:"flex flex-shrink-0 gap-2 ml-4",children:[typeof l<"u"&&jsxRuntime.jsxs("div",{className:"flex products-center border rounded-md",children:[jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:Ke,disabled:typeof R<"u"&&(R<=1||!e.AvailableToBuy||d),children:"-"}),jsxRuntime.jsx("input",{value:R,onChange:Xe,onBlur:tt,onClick:Qe=>Qe.currentTarget.select(),className:`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,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:He,disabled:!e.AvailableToBuy||d,children:"+"})]}),typeof l<"u"&&jsxRuntime.jsx(Button,{className:"gap-2 whitespace-nowrap",onClick:at,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"]})}),f&&jsxRuntime.jsx(Button,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:rt,disabled:ne,children:ne?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]})]})]})})}const complexComponents=[`----
|
|
1068
|
+
`,onClick:()=>{Ve(Qe)&&A(Qe.BidNumber!=(E==null?void 0:E.BidNumber)?Qe:null)},children:[jsxRuntime.jsx("div",{className:"flex products-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Qe.Opportunity}),jsxRuntime.jsxs("span",{className:"text-xs text-neutral-900",children:[Qe.BidNumber," ",!Ve(Qe)&&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 products-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Qe.Price??0)}),Qe.Rebate&&Qe.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Qe.Rebate)]}),Qe.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",Ze(Qe.EndDate)]})]})]},dt))})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col products-center",children:[n&&jsxRuntime.jsx(reactRouterDom.Link,{to:n,children:jsxRuntime.jsxs(Button,{variant:"secondary",children:[jsxRuntime.jsx(Eye,{className:"mr-2"}),"View Product"]})}),((Ht=e.Distribution)==null?void 0:Ht.Inventory)&&jsxRuntime.jsx("div",{className:"mt-4",children:oe!=null&&oe.IsReseller&&et<=0&&ze<=0?jsxRuntime.jsxs(Dialog,{open:F,onOpenChange:O,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{variant:"ghost",className:"flex products-center text-sm reseller-theme text-primary",children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),"Request to stock"]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-md",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Request to stock"})}),jsxRuntime.jsx("p",{className:"py-4",children:"Are you sure you want to request this product to be stocked?"}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>O(!1),disabled:z,children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:Ye,disabled:z,children:z?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin mr-2"}),"Requesting..."]}):"Confirm"})]})]})]}):et<=0&&ze>0?jsxRuntime.jsxs(Dialog,{open:j,onOpenChange:q,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{variant:"ghost",className:"flex products-center text-sm manufacturer-theme text-primary",children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),formatNumber(ze)," Incoming"]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-4xl",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsxs(DialogTitle,{className:"flex products-center",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2",size:18}),"Inventory Information"]})}),jsxRuntime.jsx(ProductInventoryGrid,{inventory:e.Distribution.Inventory})]})]}):jsxRuntime.jsxs(Dialog,{open:j,onOpenChange:q,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{variant:"ghost",className:`flex products-center text-sm ${et>0?"text-green-700":"text-red-700"}`,children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),et>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[formatNumber(et)," in stock"]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Out of stock"})]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-4xl",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsxs(DialogTitle,{className:"flex products-center",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2",size:18}),"Inventory Information"]})}),jsxRuntime.jsx(ProductInventoryGrid,{inventory:e.Distribution.Inventory})]})]})})]})]}),e.Distribution&&jsxRuntime.jsxs("div",{className:"flex justify-between products-end mt-4",children:[jsxRuntime.jsx("div",{className:"flex-shrink-1 flex flex-col products-start gap-1",children:Ae>0?jsxRuntime.jsx("div",{className:"flex products-center",children:jsxRuntime.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:["Cost: ",formatMoney(Ae)]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex products-center flex-wrap",children:[jsxRuntime.jsx("span",{className:"text-2xl font-bold whitespace-nowrap",children:formatMoney((E?(We=(Vt=e.Opportunities)==null?void 0:Vt.find(Qe=>Qe.BidNumber==E.BidNumber))==null?void 0:We.Price:Fe)??0)}),I>0&&jsxRuntime.jsx("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:formatMoney($e)})]}),I>0&&jsxRuntime.jsx("div",{className:"flex products-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:[I,"% OFF"]}),((nt=e.InstantRebate)==null?void 0:nt.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",e.InstantRebate.EndDate.split("T")[0]]}),(E==null?void 0:E.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",E.EndDate.split("T")[0]]})]})})]})}),jsxRuntime.jsxs("div",{className:"flex flex-shrink-0 gap-2 ml-4",children:[typeof l<"u"&&jsxRuntime.jsxs("div",{className:"flex products-center border rounded-md",children:[jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:Ke,disabled:typeof R<"u"&&(R<=1||!e.AvailableToBuy||d),children:"-"}),jsxRuntime.jsx("input",{value:R,onChange:Xe,onBlur:tt,onClick:Qe=>Qe.currentTarget.select(),className:`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,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:He,disabled:!e.AvailableToBuy||d,children:"+"})]}),typeof l<"u"&&jsxRuntime.jsx(Button,{className:"gap-2 whitespace-nowrap",onClick:at,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"]})}),f&&jsxRuntime.jsx(Button,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:rt,disabled:ne,children:ne?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]})]})]})})}const complexComponents=[`----
|
|
1069
1069
|
PartnerCard: For data that fits this shape:
|
|
1070
1070
|
{ "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 }
|
|
1071
1071
|
Use <PartnerCard account={data} action={<></>}>`,`----
|