1"use strict";(self.webpackChunkclient=self.webpackChunkclient||[]).push([[6412],{6223:(e,t,o)=>{o.d(t,{A:()=>x});var i=o(65043),a=o(44134),n=o(43845),l=o(74605),r=o(51962),s=o(53193),d=o(79190),c=o(72221),u=o(32143),h=o(74050),m=o(48734),p=o(1547),v=o(16030),g=o(38945),y=o(77739),f=o(70579);const x=e=>{const{selectedLogistics:t,setSelectedLogistics:o,optionalEntityArray:x,setOptionalEntityArray:j,selectedItems:b,setSelectedItems:w,deliveryDays:A,setDeliveryDays:S,selectedBranch:C}=(0,i.useContext)(a.s),{isDesktop:k}=e,[I,P]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(null===t||void 0===t?void 0:t.value)===g.Bv&&!I&&x&&w&&(w(x),P(!0)),(null===t||void 0===t?void 0:t.value)!==g.Bv&&P(!1)},[I,P,x,w,j,t,C,A]);const B=(0,i.useCallback)(e=>e.value===g.ZD?"I\u2019d prefer to receive material directly from the farm for cost savings.":e.value===g.Gi?"I\u2019d prefer to receive material from my local branch.":e.value===g.yn?"I want to see material only from my selected branch.":e.value===g.Bv?"I want to filter to specific branches.":"",[]);if(void 0===t||void 0===o||void 0===x||void 0===j||void 0===A||void 0===S)return(0,f.jsx)(f.Fragment,{});const N=t=>{const o=t.target.value,i="string"===typeof o?o.split(","):o;w(i),e.multiSelect||j(i)};return(0,f.jsxs)("div",{style:e.style,children:[k?(0,f.jsx)(y.A,{title:"I need the material within three days.",children:(0,f.jsx)(n.A,{label:"Within Three Days",clickable:!0,color:A<4?"primary":"default",onClick:()=>{S(A>3?1:4)},style:{marginBottom:10,marginRight:8}},"deliveryDays")}):(0,f.jsx)(l.A,{style:{marginBottom:10,marginTop:0},control:(0,f.jsx)(r.A,{checked:A<4,onChange:()=>S(A>3?1:4)}),label:"I need this within three days."}),(()=>{return k?p.go.map(e=>(0,f.jsx)(y.A,{title:B(e),children:(0,f.jsx)(n.A,{label:"Farm Direct"===e.name||"Local Delivery"===e.name?"Prefer "+e.name:e.name,clickable:!0,color:t===e?"primary":"default",onClick:()=>{o&&o(e)},style:{marginBottom:10,marginRight:8}},e.value)},e.value)):(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",width:"100%",marginBottom:8},children:(0,f.jsxs)(s.A,{style:{width:300},children:[(0,f.jsx)(d.A,{id:"logistics-options-label",children:"Logistics Preference"}),(0,f.jsx)(c.A,{labelId:"logistics-options-label",id:"logistics-options",value:null!==(e=null===t||void 0===t?void 0:t.value)&&void 0!==e?e:"",label:"Logistics Preference",onChange:e=>{const t=p.go.find(t=>t.value===e.target.value);o&&t&&o(t)},size:"small",children:p.go.map(e=>(0,f.jsx)(u.A,{value:e.value,children:"Farm Direct"===e.name||"Local Delivery"===e.name?"Prefer "+e.name:e.name},e.value))})]})});var e})(),"Advanced"===(null===t||void 0===t?void 0:t.name)&&(()=>{var t,o;return e.multiSelect?(0,f.jsx)("div",{style:{marginLeft:k?5:0,marginRight:10,marginBottom:10},children:(0,f.jsxs)(s.A,{style:{width:300},fullWidth:!0,children:[(0,f.jsx)(d.A,{size:"small",id:"request-type-label",children:"Included Branches"}),(0,f.jsx)(c.A,{variant:"outlined",labelId:"request-type-label",id:"request-type",multiple:!0,size:"small",value:b,onChange:N,onClose:()=>{j(null!==b&&void 0!==b?b:[])},input:(0,f.jsx)(h.A,{style:{paddingTop:0},label:"Included Branches"}),renderValue:e=>e.join(", "),children:(0,v.dT)(null!==(t=null===C||void 0===C?void 0:C.entityName)&&void 0!==t?t:g.nU,A).map(e=>(0,f.jsxs)(u.A,{value:e,children:[(0,f.jsx)(r.A,{checked:(null!==b&&void 0!==b?b:[]).indexOf(e)>-1}),(0,f.jsx)(m.A,{primary:e})]},e))})]})}):(0,f.jsx)("div",{style:{marginRight:10,marginTop:5,marginBottom:10},children:(0,f.jsxs)(s.A,{style:{width:300},fullWidth:!0,children:[(0,f.jsx)(d.A,{size:"small",id:"request-type-label",children:"Add From Branch"}),(0,f.jsx)(c.A,{variant:"outlined",labelId:"request-type-label",id:"request-type",size:"small",value:b,onChange:N,input:(0,f.jsx)(h.A,{label:"Add From Branch"}),renderValue:e=>e.join(", "),children:(0,v.dT)(null!==(o=null===C||void 0===C?void 0:C.entityName)&&void 0!==o?o:g.nU,A).map(e=>(0,f.jsx)(u.A,{value:e,children:(0,f.jsx)(m.A,{primary:null!==e&&void 0!==e?e:""})},e))})]})})})()]})}},16412:(e,t,o)=>{o.r(t),o.d(t,{DEFAULT_PRODUCT:()=>G,Product:()=>Z});var i=o(65043),a=o(91688),n=o(26058),l=o(11906),r=o(26494),s=o(90889),d=o(86605),c=o(85865),u=o(66661),h=o(600),m=o(50707),p=o(58293),v=o(70579);const g=e=>{const t=e.photo,o=(0,i.useContext)(h.c).trustedInternalRole||!1,a=(0,m.p)(),g=()=>a?(0,v.jsx)("div",{style:{display:"flex",flexDirection:"row-reverse",marginLeft:10,marginRight:10,marginTop:10},children:(0,v.jsx)(l.A,{variant:"contained",color:"primary",onClick:()=>e.setHideItemBaseConfig(!1),children:"Edit Item Base Photos"})}):(0,v.jsx)(v.Fragment,{}),y=()=>{const e=t.note&&t.note.length>0?t.note:"Photo is representative of this plant. ";return(0,v.jsx)(r.A,{children:(0,u.r)("Note: ",e)})},f=()=>{var e;return(0,v.jsxs)(r.A,{children:[(0,u.r)("Date: ",null!==(e=t.uploadTime)&&void 0!==e?e:""),(0,u.r)("Branch: ",t.branch),(0,u.r)("Dimensions: ",t.dimensions),t.note?(0,u.r)("Note: ",t.note):""]})};return t!==n.BI&&e.pageReady?(0,v.jsxs)(s.A,{style:{marginLeft:10,marginRight:10},defaultExpanded:a,children:[(0,v.jsx)(d.A,{expandIcon:(0,v.jsx)(p.A,{}),children:(0,v.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:[(0,v.jsx)(c.A,{variant:"h6",component:"span",children:"Photo Information"}),o&&g()]})}),t.core?y():f()]}):(0,v.jsx)(v.Fragment,{children:o&&g()})};var y=o(40710),f=o(43845),x=o(67254),j=o(81e3),b=o(78185),w=o(11144),A=o(6223),S=o(16030),C=o(68443);const k=e=>{const t=(0,m.p)(),o=e.selectedProduct,i=S.Db[o.companyName],a=(e,t)=>{if(t){if("string"===typeof t){const o=t.charAt(0).toUpperCase()+t.slice(1);return(0,u.r)(e+" ",""+o)}return(0,u.r)(e+" ",""+t)}return""},n=()=>{var n,r,h,m;const g=e.advancedView?o.companyName+" Quantity:":"Local Quantity:";return(0,v.jsxs)(s.A,{style:{width:t?550:"auto",marginTop:t?10:void 0,marginLeft:10,marginRight:10},defaultExpanded:!0,children:[(0,v.jsx)(d.A,{expandIcon:(0,v.jsx)(p.A,{}),children:(0,v.jsx)(c.A,{variant:"h6",component:"span",children:"Product Information"})}),(0,v.jsxs)(y.A,{children:[(0,v.jsx)("div",{style:{display:"flex",flexDirection:t?"row":"column",justifyContent:"space-between",height:"100%"},children:(0,v.jsxs)("div",{children:[!e.advancedView&&(0,u.r)("Shopping At:",o.companyName),(0,u.r)(g,null!==(n=null===o||void 0===o?void 0:o.quantity)&&void 0!==n?n:"0"),e.includeShippable&&(0,u.r)("Shippable Quantity:",""+Math.max(Number(null!==(r=null===o||void 0===o?void 0:o.systemAvailability)&&void 0!==r?r:0),Number(null!==(h=null===o||void 0===o?void 0:o.quantity)&&void 0!==h?h:0))),(0,u.r)("In Production:",null!==(m=o.quantityOnPO)&&void 0!==m?m:"0"),(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,u.r)("Price:",(0,C.ae)(o.price)),o.featured&&(0,v.jsx)(f.A,{label:"Featured Price",size:"small",color:"primary",sx:{ml:1,backgroundColor:"#c2185b",color:"#fff"}}),"NO_TOUCH"===o.pricingHint?(0,v.jsx)(f.A,{label:"Farm Direct",size:"small",color:"primary",sx:{ml:1,backgroundColor:"#1976d2",color:"#fff"}}):i&&(0,v.jsx)(f.A,{label:i.localBranchRegion+" Avail",size:"small",color:"primary",sx:{ml:1,backgroundColor:"#4CAF50",color:"#fff"}})]}),(0,v.jsx)(A.A,{style:{marginTop:10},multiSelect:!1,isDesktop:null!==t&&void 0!==t&&t}),(0,v.jsx)(w.A,{product:o,listView:!1,width:t?void 0:"300px"})]})}),(0,v.jsx)("hr",{}),l(),(0,u.r)("Common Name:",null===o||void 0===o?void 0:o.commonName),(0,u.r)("Latin Name:",null===o||void 0===o?void 0:o.botanicalName),a("Category:",null===o||void 0===o?void 0:o.category),a("Leaf Type: ",null===o||void 0===o?void 0:o.leafType),a("Stem Type: ",null===o||void 0===o?void 0:o.stemType),a("Root Ball:",null===o||void 0===o?void 0:o.rootball),a("Growth Rate: ",null===o||void 0===o?void 0:o.growthRate),a("Min Zone: ",null===o||void 0===o?void 0:o.zoneMin),a("Max Zone: ",null===o||void 0===o?void 0:o.zoneMax),a("Mature Height (ft): ",null===o||void 0===o?void 0:o.matureHeightInFeet),a("Mature Spread (ft): ",null===o||void 0===o?void 0:o.matureSpreadInFeet),a("Bloom Start Month: ",null===o||void 0===o?void 0:o.bloomStartDate),a("Bloom End Month: ",null===o||void 0===o?void 0:o.bloomEndDate),a("Bloom Description: ",null===o||void 0===o?void 0:o.bloomDesc),a("Sun: ",null===o||void 0===o?void 0:o.sun),a("Water: ",null===o||void 0===o?void 0:o.water),a("Maintenance: ",null===o||void 0===o?void 0:o.maintenance),a("Suggested Use: ",null===o||void 0===o?void 0:o.suggestedUse),a("Color: ",null===o||void 0===o?void 0:o.color)]})]})},l=()=>{var e;return"BELGAURD"!==(null===o||void 0===o||null===(e=o.subCategory)||void 0===e?void 0:e.toUpperCase())?null:(0,v.jsxs)(x.A,{severity:"warning",variant:"standard",style:{marginBottom:10},children:[(0,v.jsx)("strong",{children:"Please note:"})," Product is subject to variation in color, texture, and pattern."]})};return e.ready?(0,v.jsxs)(v.Fragment,{children:[e.displayName&&(0,v.jsx)(c.A,{component:"h1",sx:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},children:e.displayName}),n()]}):(0,v.jsxs)(j.A,{sx:{width:t?550:"auto",marginTop:t?"10px":void 0,marginLeft:"10px",marginRight:"10px"},children:[(0,v.jsx)(b.A,{variant:"rounded",animation:"wave",height:56,sx:{mb:1}}),(0,v.jsx)(b.A,{variant:"rounded",animation:"wave",height:520})]})};var I=o(89379),P=o(64894),B=o(73158),N=o(17392),T=o(79958),D=o(63471),L=o(90324),_=o(24868),E=o(89441);const R=e=>e<=0,F=e=>{const{setHide:t,callRefresh:o}=e,{urlToFile:a}=(0,_.A)(),{rightsSources:n,labelFor:s,error:d}=(0,E.Ay)(!e.hide),[u,h]=(0,i.useState)([]),[m,p]=(0,i.useState)(!1),[g,y]=(0,i.useState)(!1),[f,j]=(0,i.useState)("");(0,i.useEffect)(()=>
1{if(e.hide)return;const t=e.photos.filter(e=>e.core);Promise.all(t.map(e=>a(e.url,e.shortItemCode,"image/jpeg"))).then(e=>{const o=e.map((e,o)=>{var i;return{id:t[o].id,preview:e,note:t[o].note,rank:t[o].rank>0?t[o].rank:o+1,rightsSourceId:null!==(i=t[o].rightsSourceId)&&void 0!==i?i:null,changed:t[o].rank<=0&&null!=t[o].rightsSourceId,imageChanged:!1,deleted:!1}});h(o)})},[e.photos,e.hide,a]),(0,i.useEffect)(()=>{m||f||(t(!0),o&&o())},[f,m,t,o]);const b=()=>{h([...u,{id:-u.length,preview:null,note:"",rank:u.length+1,rightsSourceId:null,changed:!0,imageChanged:!0,deleted:!1}])},w=e=>e.changed&&!e.deleted&&(!R(e.id)||!!e.preview),A=async()=>{const t=u.filter(w),o=u.filter(e=>e.changed&&e.deleted&&e.id>0),i=t.filter(e=>null==e.rightsSourceId);if(i.length>0)return y(!0),void j("Please pick a Source for the photo".concat(i.length>1?"s":""," at rank ")+i.map(e=>e.rank).join(", ")+" before saving.");p(!0),j(""),o.forEach(e=>C(e.id)),await Promise.all(t.map(t=>S(e.ALU,t.id,t.note,t.rank,t.rightsSourceId,t.imageChanged?t.preview:null))),p(!1)},S=async(e,t,o,i,a,n)=>{var l;const r=new FormData;n&&r.append("file",n,"photo.jpg"),r.append("id",""+t),r.append("note",o),r.append("core","true"),r.append("itemSpecific","false"),r.append("updateItemBase","true"),r.append("rank",""+i),r.append("rightsSourceId",""+a);const s=encodeURIComponent("Central"),d=await fetch("/api/products/".concat(s,"/").concat(e,"/photos"),{method:"PUT",body:r,headers:{Authorization:null!==(l=localStorage.getItem("token"))&&void 0!==l?l:void 0}});if(400===d.status){const e=await d.json();y(!0),j(e.message)}else d.ok||(y(!0),j("Failed to send POST request"))},C=async e=>{var t;return fetch("/api/products/photos/".concat(e),{method:"DELETE",headers:{Authorization:null!==(t=localStorage.getItem("token"))&&void 0!==t?t:void 0}})},k=()=>{y(!1)},F=[{field:"preview",headerName:"Preview",width:200,renderCell:e=>e.value&&(0,v.jsx)("img",{src:URL.createObjectURL(e.value),alt:"preview",width:"200",height:"267"}),editable:!1},{field:"upload",headerName:"Manage",width:110,renderCell:e=>(0,v.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:(0,v.jsxs)("label",{style:{display:"inline-block",padding:"6px 12px",cursor:"pointer",backgroundColor:"#3f51b5",color:"white",borderRadius:"4px"},children:["Select File",(0,v.jsx)("input",{type:"file",style:{display:"none"},onChange:t=>((e,t)=>{const o=e.target.files[0];h(u.map(e=>e.id===t?(0,I.A)((0,I.A)({},e),{},{preview:o,changed:!0,imageChanged:!0}):e))})(t,e.id)})]})})},{field:"note",headerName:"Optional Note",flex:1,editable:!0},{field:"rightsSourceId",headerName:"Source",width:170,editable:!0,type:"singleSelect",valueOptions:n.map(e=>({value:e.id,label:e.displayName})),renderCell:e=>{return(0,v.jsx)("div",{style:{whiteSpace:"normal",wordBreak:"break-word",lineHeight:1.4,width:"100%"},children:(t=e.value,o=e.row.id,null!=t?s(t):R(o)?"Select a source":E.oc)});var t,o}},{field:"rank",headerName:"Rank",width:50,editable:!0,valueFormatter:e=>{var t;return null!==(t=e.value)&&void 0!==t?t:""},valueParser:e=>parseInt(e)},{field:"delete",headerName:"Delete",width:70,renderCell:e=>(0,v.jsx)(N.A,{onClick:()=>h(u.map(t=>t.id===e.id?(0,I.A)((0,I.A)({},t),{},{deleted:!0,changed:!0}):t)),children:(0,v.jsx)(D.A,{})})}];return e.hide?(0,v.jsx)(v.Fragment,{}):(0,v.jsxs)("div",{style:{cursor:m?"wait":"default"},children:[(0,v.jsxs)(L.$,{children:[(0,v.jsx)(T.A,{title:"Edit Item Base Photos"}),(0,v.jsxs)(r.A,{children:[(0,v.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:15},children:[(0,v.jsx)(l.A,{variant:"contained",onClick:b,children:"Add Row"}),(0,v.jsx)("div",{children:"To set the main item base photo, please supply exactly one photo with a rank of 1."}),(0,v.jsxs)("div",{children:[(0,v.jsx)(l.A,{variant:"contained",color:"success",onClick:A,children:"Save"}),(0,v.jsx)(l.A,{style:{marginLeft:10},variant:"contained",color:"secondary",onClick:()=>{e.setHide(!0)},children:"Cancel"})]})]}),d&&(0,v.jsx)(c.A,{variant:"body2",color:"error",style:{marginBottom:15},children:d}),(0,v.jsx)(P.C,{style:{height:"380px"}
1,rows:u.filter(e=>!e.deleted),rowHeight:280,columns:F,hideFooter:!0,onCellEditCommit:e=>{"note"===e.field?h(u.map(t=>t.id===e.id?(0,I.A)((0,I.A)({},t),{},{note:e.value,changed:!0}):t)):"rank"===e.field?h(u.map(t=>t.id===e.id?(0,I.A)((0,I.A)({},t),{},{rank:e.value,changed:!0}):t)):"rightsSourceId"===e.field&&h(u.map(t=>t.id===e.id?(0,I.A)((0,I.A)({},t),{},{rightsSourceId:e.value,changed:!0}):t))}})]})]}),(0,v.jsx)(B.A,{autoHideDuration:5e3,open:g,onClose:k,children:(0,v.jsx)(x.A,{onClose:k,severity:"error",style:{width:"50%"},children:f})})]})};var z=o(38945),U=o(44134),H=o(56306),M=o(1547),O=o(2633),q=o(23371),$=o(91264),W=o(44957);var V=o(90566);const G={botanicalName:"",commonName:"",size:"",id:"",alu:"",quantity:"0",systemAvailability:"0",quantityOnPO:"0",yardPrice:0,companyName:"",itemCode:"",category:"",subCategory:"",leafType:"",stemType:"",rootball:"",growthRate:"",zoneMax:0,zoneMin:0,matureHeightInFeet:0,matureSpreadInFeet:0,bloomStartDate:"",bloomEndDate:"",bloomDesc:"",sun:"",water:"",maintenance:"",suggestedUse:"",tags:"",color:"",availabilityTimeframe:"",searchScore:0,imageLink:"",shipmentType:void 0,pricingHint:"",price:0},Z=()=>{var e,t,o;const{itemCode:l}=(0,a.g)(),r=(e=>{const t="undefined"!==typeof window?window.__PDP__:void 0;if(null!==t&&void 0!==t&&t.product&&e&&t.itemCode===e)return t.product})(l),[s,d]=(0,i.useState)(()=>{var e;return null!==(e=null===r||void 0===r?void 0:r.alu)&&void 0!==e?e:""}),[c,u]=(0,i.useState)(n.BI),[p,y]=(0,i.useState)(()=>null!=r),[f,x]=(0,i.useState)(!1),[j,b]=(0,i.useState)(!1),[w,A]=(0,i.useState)(!1),[C,I]=(0,i.useState)([]),[P,B]=(0,i.useState)(!0),[N,T]=(0,i.useState)(()=>null!==r&&void 0!==r?r:G),{selectedBranch:D,selectedLogistics:L,deliveryDays:_,optionalEntityArray:E,setOptionalEntityArray:R,setSelectedBranch:Z,setSelectedLogistics:Q}=(0,i.useContext)(U.s),X=(0,m.p)(),J=(0,W.jE)(),K=(0,i.useContext)(h.c),Y=(0,a.zy)(),ee=(0,i.useCallback)(e=>!localStorage.getItem("token")||!e.isTokenExpired||e.isTokenExpired(),[]),te=(0,i.useCallback)(e=>{var t,o,i;return ee(e)||void 0===(null===(t=e.user)||void 0===t||null===(o=t.customer)||void 0===o?void 0:o.entityName)?"unverified":null!==(i=localStorage.getItem(z.PZ))&&void 0!==i?i:"unverified"},[ee]),oe=(0,i.useCallback)(async(e,t,o,i,a,n,l)=>{var r,s;x(!1);const c=new URLSearchParams({entityName:null!==(r=null===i||void 0===i?void 0:i.entityName)&&void 0!==r?r:z.nU,selectedLogistics:null!==(s=null===o||void 0===o?void 0:o.value)&&void 0!==s?s:"",customerName:e,itemCode:t});(0,S.wz)(o,i,a,n).forEach(e=>{c.append("entities",e)}),fetch("/api/products/item?"+c,{headers:{authorization:localStorage.getItem("token"),Accept:"application/json","Content-Type":"application/json"},signal:l}).then(e=>{if(!e.ok)throw(0,V.m6)(e);return e.json()}).then(e=>{if(null===l||void 0===l||!l.aborted){if(!e)return x(!0),void y(!0);T(e),d(e.alu),y(!0),(0,H.w6)("event","view_item",{itemCode:e.itemCode,items:[{item_id:e.itemCode,item_name:e.botanicalName,affiliation:null===i||void 0===i?void 0:i.entityName,index:0,item_brand:"Google",item_category:e.category,item_category2:e.stemType,item_category3:e.leafType,item_category4:e.rootball,item_variant:e.size}]})}}).catch(e=>{null!==l&&void 0!==l&&l.aborted||((0,V.Z$)(e,"GET /api/products/item"),b(!0),x(!0),y(!0))})},[]);(0,i.useEffect)(()=>{const e=te(K),t=new AbortController;return oe(e,l,L,D,_,null!==E&&void 0!==E?E:[],t.signal),()=>t.abort()},[K,l,te,D,L,_,E,oe]),(0,i.useEffect)(()=>{A(C.length>0&&p)},[C.length,p]),(0,i.useEffect)(()=>{window.scrollTo(0,0)},[]),(0,i.useEffect)(()=>{(0,$.d)()},[l]),(0,i.useEffect)(()=>{p&&(0,$.k)()},[p]),(0,i.useEffect)(()=>{const e=new URLSearchParams(Y.search).get("entityName");e&&Z&&S.Db[e]&&Z(S.Db[e]),e&&R&&S.Db[e]&&R([e])},[Y.search,R,Z]),(0,i.useEffect)(()=>{const e=new URLSearchParams(Y.search).get("logistics");e&&Q&&M.jH[e]&&Q(M.jH[e])},[Y.search,Q]);const ie=(0,i.useCallback)(()=>{I([])},[I]),ae=Boolean(N.commonName||N.botanicalName),ne=N.commonName||N.botanicalName,le=(N.size||"").trim(),re=Boolean(le)&&!ne.trim().toLowerCase().endsWith(le.toLowerCase()),se=[ne,re?le:""].filter(
1Boolean).join(", "),de=(N.botanicalName||"").trim(),ce=(N.commonName||"").trim(),ue=de?ce&&ce.toLowerCase()!==de.toLowerCase()?"".concat(de," (").concat(ce,")"):de:ce||se,he=[N.category,N.zoneMin&&N.zoneMax?"hardiness zones ".concat(N.zoneMin,"-").concat(N.zoneMax):"",N.matureHeightInFeet?"matures to ".concat(N.matureHeightInFeet," ft"):"",N.suggestedUse].filter(Boolean).join(", "),me="".concat(ue).concat(he?" \u2014 ".concat(he,"."):"."," Wholesale at Tree Source."),pe=me.length>160?me.slice(0,160).replace(/[\s.,\u2014-]+$/,""):me,ve=null!=N.price&&N.price>0,ge=Number(null!==(e=N.quantity)&&void 0!==e?e:0)>0||Number(null!==(t=N.systemAvailability)&&void 0!==t?t:0)>0,ye=new Date(Date.now()+31536e6).toISOString().split("T")[0],fe=ve?{"@type":"Offer",price:N.price,priceCurrency:"USD",availability:ge?"https://schema.org/InStock":"https://schema.org/OutOfStock",priceValidUntil:ye,url:"".concat(window.location.origin).concat(Y.pathname)}:void 0,xe={"@context":"https://schema.org","@type":"Product",name:se,image:N.imageLink||void 0,description:pe||void 0,category:N.category||void 0,sku:N.itemCode||void 0,brand:{"@type":"Brand",name:"Tree Source"},offers:fe};return f?j?(0,v.jsx)(q.$,{errorHeader:"Something Went Wrong",errorMessage:"Sorry, we couldn't load this product right now. Please try again later."}):(0,v.jsx)(q.$,{errorHeader:"Product Not Available",errorMessage:"Sorry, this product isn't available. It may be sold out or not currently offered. Browse our catalog to find what you need."}):(0,v.jsxs)(v.Fragment,{children:[ae&&(0,v.jsx)(O.A,{title:"".concat(se," | Tree Source"),description:pe,image:N.imageLink||void 0,jsonLd:fe?xe:void 0,preloadImage:null===(o=C[0])||void 0===o?void 0:o.original}),X?(0,v.jsxs)("div",{style:{marginTop:J},children:[(0,v.jsx)(F,{ALU:s,hide:P,setHide:B,photos:C,callRefresh:ie}),(0,v.jsxs)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center"},children:[(0,v.jsx)("div",{style:{width:n.Xj,flexShrink:0},children:(0,v.jsx)(n.$0,{itemcode:l,selectedProduct:N,setSelectedPhoto:u,pageReady:w,photos:C,setPhotos:I})}),(0,v.jsxs)("div",{children:[(0,v.jsx)(k,{selectedProduct:N,displayName:se,includeShippable:(null===L||void 0===L?void 0:L.value)!==z.Bv&&(null===L||void 0===L?void 0:L.value)!==z.yn,advancedView:(null===L||void 0===L?void 0:L.value)===z.Bv,isLoggedOUt:ee(K),ready:p}),(0,v.jsx)(g,{photo:c,pageReady:w,setHideItemBaseConfig:B})]})]})]}):(0,v.jsxs)("div",{style:{marginTop:J,marginBottom:20},children:[(0,v.jsx)(n.$0,{itemcode:l,selectedProduct:N,setSelectedPhoto:u,pageReady:w,photos:C,setPhotos:I}),(0,v.jsx)(g,{photo:c,pageReady:w,setHideItemBaseConfig:B}),(0,v.jsx)(k,{selectedProduct:N,displayName:se,includeShippable:(null===L||void 0===L?void 0:L.value)!==z.Bv&&(null===L||void 0===L?void 0:L.value)!==z.yn,advancedView:(null===L||void 0===L?void 0:L.value)===z.Bv,isLoggedOUt:ee(K),ready:p})]})]})}},24868:(e,t,o)=>{o.d(t,{A:()=>r});var i=o(65043),a=o(26058),n=o(33238),l=o(83373);const r=()=>{const e=(0,i.useCallback)((e,t)=>{const o=encodeURIComponent(t.replaceAll(",","")),i="c_fill,g_auto,h_800,w_600/c_scale,g_south,h_60,l_black_bar,o_60,w_600,y_5/g_south,l_text:Arial_30_bold:".concat(o,",co_white,w_550,y_20");return(0,l.W)(e.replace("/upload/","/upload/".concat(i,"/")))},[]),t=(0,i.useCallback)(async(e,t,o)=>{const i=async e=>{const i=await fetch(e.replace("http://","https://"));if(!i.ok)throw new Error("image fetch returned ".concat(i.status));const a=await i.blob();return new File([a],t,{type:o})};try{return await i(e)}catch(l){n.yf.logger.error("Failed to fetch image",{url:e,error:String(l)});try{return await i(a.BI.url)}catch(r){return new File([],t,{type:o})}}},[]);return(0,i.useMemo)(()=>({scaleForPortrait:e,urlToFile:t}),[e,t])}},26058:(e,t,o)=>{o.d(t,{$0:()=>f,BI:()=>g,Xj:()=>y});var i=o(89379),a=o(65043),n=o(50222),l=o(81e3),r=o(78185),s=o(81637),d=o(90324),c=o(79507),u=o(24868),h=o(50707),m=o(83373),p=o(90566),v=o(70579);const g={id:-1,branch:"",core:!1,itemSpecific:!1,shortItemCode:"",itemId:"",original:"https://res.cloudinary.com/treesource-systems/image/upload/w_450,h_600,c_pad/v1661178206/BandB%20Trees/default_photo.png",note:"",dimensions:"",url:"https://res.cloudinary.com/treesource-systems/image/upload/v1661178206/BandB%20Trees/default_photo.png",rank:0,rightsSourceId:null},y=710,f=e=>{const t=(0,h.p)(),{scaleForPortrait:o}=(0,u.A)(),f=1===e.photos.length,[x,j]=(0,a.useState)(null),b=(0,a.useRef)(null);(0,a.useEffect)(()=>
1{if(e.photos.length>0)return;let t=!1;return fetch("/api/products/".concat(encodeURIComponent(e.itemcode),"/photos")).then(e=>{if(!e.ok)throw(0,p.m6)(e);return e.json()}).then(e=>{t||j(e)}).catch(e=>{(0,p.Z$)(e,"GET /api/products/:itemcode/photos"),t||j([])}),()=>{t=!0}},[e.itemcode,e.photos.length]),(0,a.useEffect)(()=>{if(x&&x!==b.current&&0===e.photos.length&&""!==e.selectedProduct.botanicalName){const t=x.map((t,a)=>{const n=t.core?"":t.branch,l=C(t.core,e.selectedProduct);return(0,i.A)((0,i.A)({},t),{},{original:o(t.url,l),thumbnail:A(t.url),thumbnailLabel:n,loading:0===a?"eager":"lazy"})});0===t.length&&t.push(g),b.current=x,e.setPhotos(t),e.setSelectedPhoto(t[0])}},[x,e.photos.length,e.selectedProduct.botanicalName]);const w=t=>{e.setSelectedPhoto(e.photos[t])},A=e=>(0,m.W)(e.replace("/upload/","/upload/".concat("w_90,h_120,c_pad","/"))),S=e=>e.match(/^[^\d#]*/)[0],C=(e,t)=>(e?S(t.botanicalName):t.botanicalName)+" - "+(e?S(t.commonName):t.commonName),k=()=>(0,v.jsx)(c.L,{label:e.selectedProduct.focusListChip,top:12,left:12,sx:{zIndex:4,pointerEvents:"none"}});return(0,v.jsx)(v.Fragment,{children:e.pageReady?(0,v.jsx)(d.$,{children:(0,v.jsx)("div",{style:{margin:f?13:0},children:(0,v.jsx)(n.A,{additionalClass:"pdp-gallery",showPlayButton:!1,disableSwipe:f,thumbnailPosition:f?"bottom":"left",showThumbnails:!f,disableThumbnailScroll:!0,useBrowserFullscreen:t,showFullscreenButton:!t,lazyLoad:!0,items:e.photos,onSlide:w,renderCustomControls:k})})}):(()=>{const e=t?800:377;return(0,v.jsx)(d.$,{children:(0,v.jsxs)(l.A,{sx:{position:"relative",width:t?y:"100%",maxWidth:"100%",mx:"auto"},children:[(0,v.jsx)(r.A,{variant:"rectangular",animation:"wave",sx:{width:"100%",height:e,borderRadius:1}}),(0,v.jsx)(s.A,{sx:{position:"absolute",top:"50%",left:"50%",mt:"-20px",ml:"-20px",color:"grey.400"}})]})})})()})}},89441:(e,t,o)=>{o.d(t,{Ay:()=>r,oc:()=>n});var i=o(65043),a=o(90566);const n="Unknown - pre-dates the rights gate",l="Could not load the list of photo sources. Please refresh the page.",r=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const[t,o]=(0,i.useState)([]),[n,r]=(0,i.useState)(null);(0,i.useEffect)(()=>{var t;e&&fetch("/api/products/rights-sources",{headers:{Authorization:null!==(t=localStorage.getItem("token"))&&void 0!==t?t:void 0}}).then(e=>{if(!e.ok)throw(0,a.m6)(e);return e.json()}).then(e=>{o(e),r(e.length>0?null:l)}).catch(e=>{(0,a.Z$)(e,"GET /api/products/rights-sources"),r(l)})},[e]);return{rightsSources:t,labelFor:e=>{var o,i;return null!==(o=null===(i=t.find(t=>t.id===e))||void 0===i?void 0:i.displayName)&&void 0!==o?o:""},error:n}}},90324:(e,t,o)=>{o.d(t,{$:()=>n});var i=o(58270),a=o(12110);const n=(0,i.A)(a.A)({margin:10})},91264:(e,t,o)=>{o.d(t,{d:()=>i,k:()=>a});const i=()=>{window.prerenderReady=!1},a=()=>{window.prerenderReady=!0}}}]); 2//# sourceMappingURL=6412.1ff22a2e.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.