@uniformdev/mesh-sdk-react 16.1.1-alpha.139 → 16.1.1-alpha.145

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
- var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDescriptor;var Er=Object.getOwnPropertyNames;var Mr=Object.getPrototypeOf,Vr=Object.prototype.hasOwnProperty;var Qt=(t,n)=>{for(var o in n)Se(t,o,{get:n[o],enumerable:!0})},be=(t,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Er(n))!Vr.call(t,a)&&a!==o&&Se(t,a,{get:()=>n[a],enumerable:!(r=xr(n,a))||r.enumerable});return t},A=(t,n,o)=>(be(t,n,"default"),o&&be(o,n,"default")),N=(t,n,o)=>(o=t!=null?kr(Mr(t)):{},be(n||!t||!t.__esModule?Se(o,"default",{value:t,enumerable:!0}):o,t)),Tr=t=>be(Se({},"__esModule",{value:!0}),t);var z={};Qt(z,{Button:()=>l.Button,Callout:()=>l.Callout,DefaultSearchRow:()=>lt,DefaultSelectedItem:()=>ot,EntrySearch:()=>Ct,Heading:()=>l.Heading,Icons:()=>xe,Input:()=>l.Input,InputSelect:()=>l.InputSelect,InputToggle:()=>l.InputToggle,KeywordSearchInput:()=>l.InputKeywordSearch,Label:()=>l.Label,LoadingIndicator:()=>l.LoadingIndicator,LoadingOverlay:()=>l.LoadingOverlay,Menu:()=>l.Menu,MenuItem:()=>l.MenuItem,ProductPreviewList:()=>_e,ProductQuery:()=>Or,ProductQueryContext:()=>Qe,ProductSearch:()=>jr,ProductSearchContext:()=>At,ProductSearchRow:()=>Tt,ProductSelectedItem:()=>zt,ResolvableLoadingValue:()=>Fe,ScrollableList:()=>l.ScrollableList,ScrollableListItem:()=>l.ScrollableListItem,SelectionField:()=>Ke,Switch:()=>l.Switch,Textarea:()=>l.Textarea,Theme:()=>l.Theme,UniformMeshLocationContext:()=>Ae,UniformMeshLocationContextProvider:()=>Ue,UniformMeshSdkContext:()=>Be,UniformMeshSdkContextProvider:()=>Gr,badgeIcon:()=>Ie,draggableContainer:()=>bt,draggableIcon:()=>Te,draggableIconOffset:()=>wt,draggableIconWrapper:()=>St,entrySearchBtn:()=>ut,entrySearchConfig:()=>gt,entrySearchConfigHidden:()=>ft,entrySearchLoadMoreBtn:()=>mt,entrySearchResultList:()=>vt,entrySearchSelectIcon:()=>ht,entrySearchSelectImg:()=>yt,entrySearchSelectInput:()=>Yr,entrySearchSelectOption:()=>qr,entrySearchWrapper:()=>pt,productSearchRowActiveIcon:()=>Mt,productSearchRowCategory:()=>xt,productSearchRowContainer:()=>Pt,productSearchRowContent:()=>Rt,productSearchRowContentActive:()=>Lt,productSearchRowDetails:()=>Et,productSearchRowTitle:()=>kt,productSelectedItemContainer:()=>It,productSelectedItemContent:()=>Gt,productSelectedItemDetails:()=>Dt,productSelectedItemImage:()=>De,searchRowBtn:()=>ct,searchRowContainer:()=>nt,searchRowContainerActive:()=>it,searchRowContainerWithPopover:()=>at,searchRowPopover:()=>st,searchRowText:()=>Ve,searchRowTextSmall:()=>Me,selectItemLinkBtn:()=>Ee,selectItemLinkContainer:()=>rt,selectItemPopover:()=>tt,selectItemPopoverLabel:()=>fe,selectItemSmallText:()=>W,selectedItemCloseIcon:()=>et,selectedItemContainer:()=>Ze,selectedItemCopy:()=>qe,selectedItemDetails:()=>Ye,selectedItemIcon:()=>je,selectedItemInner:()=>Xe,selectedItemTitle:()=>Je,useInitializeUniformMeshSdk:()=>Dr,useProductQueryContext:()=>Ne,useProductSearchContext:()=>ve,useUniformMeshLocation:()=>Ir,useUniformMeshLocationContext:()=>Oe,useUniformMeshSdk:()=>zr,useUniformMeshSdkContext:()=>He});module.exports=Tr(z);var e=require("@emotion/react"),V=N(require("react"));var ie=require("react"),Ae=(0,ie.createContext)(void 0),Ue=({children:t})=>{let[n,o]=(0,ie.useState)(),r;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let a=n||window.UniformMeshSDK.getCurrentLocation();r={location:{getValue:a.getValue,getMetadata:a.getMetadata,setValue:async(s,p)=>{await a.setValue(s,p),o(window.UniformMeshSDK.getCurrentLocation())},setValidationResult:async s=>{await a.setValidationResult(s)}}}}return(0,e.jsx)(Ae.Provider,{value:r},t)},Oe=()=>{let t=(0,ie.useContext)(Ae);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function Ir(){let{location:t}=Oe();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata(),setValidationResult:t==null?void 0:t.setValidationResult}}var Nt=require("@uniformdev/mesh-sdk"),me=require("react"),Dr=({autoResizingDisabled:t}={})=>{let[n,o]=(0,me.useState)(),[r,a]=(0,me.useState)();return(0,me.useEffect)(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?(0,Nt.initializeUniformMeshSDK)({autoResizingDisabled:t}).then(s=>{a(s)}).catch(s=>{o(s)}):a(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};var we=require("react");var _t=require("@uniformdev/design-system"),Be=(0,we.createContext)(void 0),Gr=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),(0,e.jsx)(Be.Provider,{value:n},(0,e.jsx)(_t.Theme,null),(0,e.jsx)(Ue,null,t))},He=()=>{let t=(0,we.useContext)(Be);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function zr(){let{sdk:t}=He();return t}var We=N(require("react"));var O=N(require("react"));var se=require("@emotion/react"),Wt=require("@uniformdev/design-system");var $e=N(require("react")),Fe=({value:t,text:n,loading:o})=>(0,e.jsx)($e.default.Fragment,null,!!n&&n,!n&&(0,e.jsx)($e.default.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var Ke=({id:t,label:n,loading:o,selectedValues:r,values:a,onAdd:s,onRemove:p})=>{var h;let v=(h=a==null?void 0:a.filter(c=>!(r!=null&&r.includes(c.id.toString()))))!=null?h:[],u=(c,f)=>{c.preventDefault(),p(f)};return(0,e.jsx)("div",null,(0,e.jsx)(Wt.InputSelect,{id:t,name:t,label:n,onChange:c=>s(c.target.value),disabled:o,options:[{value:"",label:"Add..."},...v.map(c=>({value:c.id,label:c.name||c.id}))],value:"",css:Array.isArray(r)&&r.length>0?se.css`
1
+ var xr=Object.create;var Se=Object.defineProperty;var Er=Object.getOwnPropertyDescriptor;var Mr=Object.getOwnPropertyNames;var Vr=Object.getPrototypeOf,Tr=Object.prototype.hasOwnProperty;var Qt=(t,n)=>{for(var o in n)Se(t,o,{get:n[o],enumerable:!0})},be=(t,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Mr(n))!Tr.call(t,a)&&a!==o&&Se(t,a,{get:()=>n[a],enumerable:!(r=Er(n,a))||r.enumerable});return t},U=(t,n,o)=>(be(t,n,"default"),o&&be(o,n,"default")),X=(t,n,o)=>(o=t!=null?xr(Vr(t)):{},be(n||!t||!t.__esModule?Se(o,"default",{value:t,enumerable:!0}):o,t)),Ir=t=>be(Se({},"__esModule",{value:!0}),t);var A={};Qt(A,{Button:()=>l.Button,Callout:()=>l.Callout,DefaultSearchRow:()=>lt,DefaultSelectedItem:()=>ot,EntrySearch:()=>Ct,Heading:()=>l.Heading,Icons:()=>xe,Input:()=>l.Input,InputSelect:()=>l.InputSelect,InputToggle:()=>l.InputToggle,KeywordSearchInput:()=>l.InputKeywordSearch,Label:()=>l.Label,LoadingIndicator:()=>l.LoadingIndicator,LoadingOverlay:()=>l.LoadingOverlay,Menu:()=>l.Menu,MenuItem:()=>l.MenuItem,ProductPreviewList:()=>We,ProductQuery:()=>Br,ProductQueryContext:()=>Qe,ProductSearch:()=>eo,ProductSearchContext:()=>At,ProductSearchRow:()=>Tt,ProductSelectedItem:()=>zt,ResolvableLoadingValue:()=>Fe,ScrollableList:()=>l.ScrollableList,ScrollableListItem:()=>l.ScrollableListItem,SelectionField:()=>Ke,Switch:()=>l.Switch,Textarea:()=>l.Textarea,Theme:()=>l.Theme,UniformMeshLocationContext:()=>Ae,UniformMeshLocationContextProvider:()=>Ue,UniformMeshSdkContext:()=>Be,UniformMeshSdkContextProvider:()=>zr,badgeIcon:()=>Ie,draggableContainer:()=>bt,draggableIcon:()=>Te,draggableIconOffset:()=>wt,draggableIconWrapper:()=>St,entrySearchBtn:()=>ut,entrySearchConfig:()=>gt,entrySearchConfigHidden:()=>ft,entrySearchLoadMoreBtn:()=>mt,entrySearchResultList:()=>vt,entrySearchSelectIcon:()=>ht,entrySearchSelectImg:()=>yt,entrySearchSelectInput:()=>qr,entrySearchSelectOption:()=>Jr,entrySearchWrapper:()=>pt,productSearchRowActiveIcon:()=>Mt,productSearchRowCategory:()=>xt,productSearchRowContainer:()=>Pt,productSearchRowContent:()=>Rt,productSearchRowContentActive:()=>Lt,productSearchRowDetails:()=>Et,productSearchRowTitle:()=>kt,productSelectedItemContainer:()=>It,productSelectedItemContent:()=>Gt,productSelectedItemDetails:()=>Dt,productSelectedItemImage:()=>De,searchRowBtn:()=>ct,searchRowContainer:()=>nt,searchRowContainerActive:()=>it,searchRowContainerWithPopover:()=>at,searchRowPopover:()=>st,searchRowText:()=>Ve,searchRowTextSmall:()=>Me,selectItemLinkBtn:()=>Ee,selectItemLinkContainer:()=>rt,selectItemPopover:()=>tt,selectItemPopoverLabel:()=>le,selectItemSmallText:()=>q,selectedItemCloseIcon:()=>et,selectedItemContainer:()=>Ze,selectedItemCopy:()=>qe,selectedItemDetails:()=>Ye,selectedItemIcon:()=>je,selectedItemInner:()=>Xe,selectedItemTitle:()=>Je,useInitializeUniformMeshSdk:()=>Gr,useProductQueryContext:()=>Ne,useProductSearchContext:()=>fe,useUniformMeshLocation:()=>Dr,useUniformMeshLocationContext:()=>Oe,useUniformMeshSdk:()=>Ar,useUniformMeshSdkContext:()=>He});module.exports=Ir(A);var e=require("@emotion/react"),M=X(require("react"));var ie=require("react"),Ae=(0,ie.createContext)(void 0),Ue=({children:t})=>{let[n,o]=(0,ie.useState)(),r;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let a=n||window.UniformMeshSDK.getCurrentLocation();r={location:{getValue:a.getValue,getMetadata:a.getMetadata,setValue:async(s,u)=>{await a.setValue(s,u),o(window.UniformMeshSDK.getCurrentLocation())},setValidationResult:async s=>{await a.setValidationResult(s)}}}}return(0,e.jsx)(Ae.Provider,{value:r},t)},Oe=()=>{let t=(0,ie.useContext)(Ae);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function Dr(){let{location:t}=Oe();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata(),setValidationResult:t==null?void 0:t.setValidationResult}}var Nt=require("@uniformdev/mesh-sdk"),me=require("react"),Gr=({autoResizingDisabled:t}={})=>{let[n,o]=(0,me.useState)(),[r,a]=(0,me.useState)();return(0,me.useEffect)(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?(0,Nt.initializeUniformMeshSDK)({autoResizingDisabled:t}).then(s=>{a(s)}).catch(s=>{o(s)}):a(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};var we=require("react");var Wt=require("@uniformdev/design-system"),Be=(0,we.createContext)(void 0),zr=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),(0,e.jsx)(Be.Provider,{value:n},(0,e.jsx)(Wt.Theme,null),(0,e.jsx)(Ue,null,t))},He=()=>{let t=(0,we.useContext)(Be);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function Ar(){let{sdk:t}=He();return t}var _e=X(require("react"));var H=X(require("react"));var se=require("@emotion/react"),_t=require("@uniformdev/design-system");var $e=X(require("react")),Fe=({value:t,text:n,loading:o})=>(0,e.jsx)($e.default.Fragment,null,!!n&&n,!n&&(0,e.jsx)($e.default.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var Ke=({id:t,label:n,loading:o,selectedValues:r,values:a,onAdd:s,onRemove:u})=>{var h;let v=(h=a==null?void 0:a.filter(i=>!(r!=null&&r.includes(i.id.toString()))))!=null?h:[],m=(i,f)=>{i.preventDefault(),u(f)};return(0,e.jsx)("div",null,(0,e.jsx)(_t.InputSelect,{id:t,name:t,label:n,onChange:i=>s(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...v.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(r)&&r.length>0?se.css`
2
2
  margin-bottom: var(--spacing-base);
3
- `:""}),r==null?void 0:r.map(c=>{var f;return(0,e.jsx)("div",{css:se.css`
3
+ `:""}),r==null?void 0:r.map(i=>{var f;return(0,e.jsx)("div",{css:se.css`
4
4
  font-size: var(--fs-sm);
5
5
  display: inline-flex;
6
6
  align-items: center;
@@ -9,67 +9,67 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
9
9
  border: 1px solid var(--gray-300);
10
10
  margin-bottom: var(--spacing-sm);
11
11
  margin-right: var(--spacing-sm);
12
- `,key:c},(0,e.jsx)("span",{css:se.css`
12
+ `,key:i},(0,e.jsx)("span",{css:se.css`
13
13
  padding: var(--spacing-3);
14
14
  color: var(--gray-800);
15
- `},(0,e.jsx)(Fe,{value:c,loading:o,text:(f=a.find(C=>C.id===c))==null?void 0:f.name})),(0,e.jsx)("button",{css:se.css`
15
+ `},(0,e.jsx)(Fe,{value:i,loading:o,text:(f=a.find(C=>C.id===i))==null?void 0:f.name})),(0,e.jsx)("button",{css:se.css`
16
16
  padding: var(--spacing-3);
17
17
  border-left: 1px solid var(--gray-300);
18
- `,title:"remove",onClick:C=>u(C,c)},(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",css:se.css`
18
+ `,title:"remove",onClick:C=>m(C,i)},(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",css:se.css`
19
19
  height: 1.25rem;
20
20
  width: 1.25rem;
21
21
  pointer-events: none;
22
22
  display: block;
23
- `,viewBox:"0 0 20 20",fill:"currentColor"},(0,e.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))))}))};var Ar=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{d:"M44.203 21.203H24.797V1.797a1.797 1.797 0 1 0-3.594 0v19.406H1.797a1.797 1.797 0 1 0 0 3.594h19.406v19.406a1.797 1.797 0 0 0 3.594 0V24.797h19.406a1.797 1.797 0 0 0 0-3.594Z"})),Ce=Ar;var Ur=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})),Pe=Ur;var Re=require("react-use"),T=require("@uniformdev/design-system"),k=require("@emotion/react"),Zt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Or=({value:t,setValue:n,brands:o,categories:r,loading:a,categoriesLoading:s,brandsLoading:p,logoIcon:v,onGetProducts:u,sortOptions:h,sortOrderOptions:c,categoryLabel:f="Product Category",brandLabel:C="Brand",disableBrands:re,restrictToSingleCategory:$=!1})=>{var m,P,ae;let w=async i=>{n({...Zt,...t||{},...i})},y=(0,O.useMemo)(()=>({...Zt,...t||{}}),[t]),[oe,F]=(0,Re.useAsyncFn)(async i=>await u(i),[u]);(0,Re.useDebounce)(async()=>{await F({brand:y.brand,categories:y.categories,keyword:y.keyword,sort:y.sort,sortOrder:y.sortOrder,count:y.count})},250,[y]);let q=(0,O.useMemo)(()=>{let i=[];return r==null||r.forEach(L=>{let pe=Yt(L,void 0);i.push(...pe)}),i},[r]),K=(0,O.useMemo)(()=>[{value:"",label:"All categories"},...q.map(i=>({label:i.name,value:i.id}))],[q]),J=(0,O.useMemo)(()=>(o==null?void 0:o.map(i=>({id:i.id.toString(),name:i.name})))||[],[o]),ne=i=>{if(!i)return;let L=(t==null?void 0:t.categories)||[];w({categories:[...L,i]})},j=i=>{var L;w({categories:(L=t==null?void 0:t.categories)==null?void 0:L.filter(pe=>pe!==i)})},ee=i=>{w({brand:i.target.value})},b=i=>{w({count:i||1})};return a?(0,e.jsx)("div",null,"Loading..."):(0,e.jsx)(Qe.Provider,{value:{categories:r,logoIcon:v}},(0,e.jsx)("div",{css:k.css`
23
+ `,viewBox:"0 0 20 20",fill:"currentColor"},(0,e.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))))}))};var Ur=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{d:"M44.203 21.203H24.797V1.797a1.797 1.797 0 1 0-3.594 0v19.406H1.797a1.797 1.797 0 1 0 0 3.594h19.406v19.406a1.797 1.797 0 0 0 3.594 0V24.797h19.406a1.797 1.797 0 0 0 0-3.594Z"})),Ce=Ur;var Or=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})),Pe=Or;var Re=require("react-use"),V=require("@uniformdev/design-system"),R=require("@emotion/react"),Zt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Br=({value:t,setValue:n,brands:o,categories:r,loading:a,categoriesLoading:s,brandsLoading:u,logoIcon:v,onGetProducts:m,sortOptions:h,sortOrderOptions:i,categoryLabel:f="Product Category",brandLabel:C="Brand",disableBrands:oe,restrictToSingleCategory:K=!1})=>{var p,D,B;let w=async d=>{n({...Zt,...t||{},...d})},y=(0,H.useMemo)(()=>({...Zt,...t||{}}),[t]),[ne,Q]=(0,Re.useAsyncFn)(async d=>await m(d),[m]);(0,Re.useDebounce)(async()=>{await Q({brand:y.brand,categories:y.categories,keyword:y.keyword,sort:y.sort,sortOrder:y.sortOrder,count:y.count})},250,[y]);let te=(0,H.useMemo)(()=>{let d=[];return r==null||r.forEach(b=>{let G=Yt(b,void 0);d.push(...G)}),d},[r]),N=(0,H.useMemo)(()=>[{value:"",label:"All categories"},...te.map(d=>({label:d.name,value:d.id}))],[te]),W=(0,H.useMemo)(()=>(o==null?void 0:o.map(d=>({id:d.id.toString(),name:d.name})))||[],[o]),he=d=>{if(!d)return;let b=(t==null?void 0:t.categories)||[];w({categories:[...b,d]})},ae=d=>{var b;w({categories:(b=t==null?void 0:t.categories)==null?void 0:b.filter(G=>G!==d)})},_=d=>{w({brand:d.target.value})},k=d=>{w({count:d||1})};return a?(0,e.jsx)("div",null,"Loading..."):(0,e.jsx)(Qe.Provider,{value:{categories:r,logoIcon:v}},(0,e.jsx)("div",{css:R.css`
24
24
  > :not(:last-child) {
25
25
  margin-bottom: var(--spacing-md);
26
26
  }
27
- `},$?(0,e.jsx)(T.InputSelect,{id:"selection-field-product-category",label:f,disabled:a,value:(P=(m=y.categories)==null?void 0:m[0])!=null?P:"",options:K,onChange:i=>{w({categories:i.target.value===""?[]:[i.target.value]})}}):(0,e.jsx)(Ke,{loading:s||!1,id:"selection-field-product-category",label:f,onAdd:ne,onRemove:j,selectedValues:y.categories,values:q}),(0,e.jsx)("div",{css:k.css`
27
+ `},K?(0,e.jsx)(V.InputSelect,{id:"selection-field-product-category",label:f,disabled:a,value:(D=(p=y.categories)==null?void 0:p[0])!=null?D:"",options:N,onChange:d=>{w({categories:d.target.value===""?[]:[d.target.value]})}}):(0,e.jsx)(Ke,{loading:s||!1,id:"selection-field-product-category",label:f,onAdd:he,onRemove:ae,selectedValues:y.categories,values:te}),(0,e.jsx)("div",{css:R.css`
28
28
  display: flex;
29
29
  flex-wrap: wrap;
30
30
  column-gap: var(--spacing-lg);
31
31
  row-gap: var(--spacing-md);
32
- ${(0,T.mq)("md")} {
32
+ ${(0,V.mq)("md")} {
33
33
  flex-wrap: nowrap;
34
34
  }
35
- `},re?null:(0,e.jsx)("div",{css:k.css`
35
+ `},oe?null:(0,e.jsx)("div",{css:R.css`
36
36
  width: 50%;
37
- `},(0,e.jsx)(T.InputSelect,{id:"brand",name:"brand",label:C,disabled:p,value:y.brand,onChange:ee,options:[{value:"",label:"Choose..."},...J.map(i=>({value:i.id,label:i.name}))]})),(0,e.jsx)("div",{css:k.css`
37
+ `},(0,e.jsx)(V.InputSelect,{id:"brand",name:"brand",label:C,disabled:u,value:y.brand,onChange:_,options:[{value:"",label:"Choose..."},...W.map(d=>({value:d.id,label:d.name}))]})),(0,e.jsx)("div",{css:R.css`
38
38
  flex-grow: 1;
39
39
  position: relative;
40
- `},(0,e.jsx)(T.Input,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:y.keyword,placeholder:"Enter keyword",onChange:i=>w({keyword:i.target.value})}))),(0,e.jsx)("div",{css:k.css`
40
+ `},(0,e.jsx)(V.Input,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:y.keyword,placeholder:"Enter keyword",onChange:d=>w({keyword:d.target.value})}))),(0,e.jsx)("div",{css:R.css`
41
41
  display: flex;
42
42
  flex-wrap: wrap;
43
43
  column-gap: var(--spacing-lg);
44
44
  row-gap: var(--spacing-md);
45
- ${(0,T.mq)("md")} {
45
+ ${(0,V.mq)("md")} {
46
46
  flex-wrap: nowrap;
47
47
  }
48
- `},(0,e.jsx)("div",{css:k.css`
48
+ `},(0,e.jsx)("div",{css:R.css`
49
49
  width: 100%;
50
- ${(0,T.mq)("md")} {
50
+ ${(0,V.mq)("md")} {
51
51
  width: 33.333333%;
52
52
  }
53
53
  position: relative;
54
- `},(0,e.jsx)(T.Input,{id:"count",name:"count",type:"number",min:1,step:1,value:y.count,onChange:i=>b(i.target.valueAsNumber),label:"Count"}),(0,e.jsx)("div",{css:k.css`
54
+ `},(0,e.jsx)(V.Input,{id:"count",name:"count",type:"number",min:1,step:1,value:y.count,onChange:d=>k(d.target.valueAsNumber),label:"Count"}),(0,e.jsx)("div",{css:R.css`
55
55
  position: absolute;
56
56
  bottom: var(--spacing-sm);
57
57
  right: var(--spacing-sm);
58
58
  display: flex;
59
59
  gap: var(--spacing-sm);
60
- `},(0,e.jsx)(Xt,{onCountChange:()=>b(y.count-1),countIcon:"decrement",disabled:y.count===1}),(0,e.jsx)(Xt,{onCountChange:()=>b(y.count+1),countIcon:"increment"}))),Array.isArray(h)&&h.length>0?(0,e.jsx)("div",{css:k.css`
60
+ `},(0,e.jsx)(Xt,{onCountChange:()=>k(y.count-1),countIcon:"decrement",disabled:y.count===1}),(0,e.jsx)(Xt,{onCountChange:()=>k(y.count+1),countIcon:"increment"}))),Array.isArray(h)&&h.length>0?(0,e.jsx)("div",{css:R.css`
61
61
  flex-grow: 1;
62
- ${(0,T.mq)("md")} {
62
+ ${(0,V.mq)("md")} {
63
63
  width: 33.333333%;
64
64
  }
65
- `},(0,e.jsx)(T.InputSelect,{id:"sort",name:"sort",label:"Sort",value:y.sort,onChange:i=>w({sort:i.target.value}),options:[{value:"",label:"Select a sort"},...h.map(i=>({value:i.sortKey,label:i.name}))]})):null,Array.isArray(c)&&c.length>0?(0,e.jsx)("div",{css:k.css`
65
+ `},(0,e.jsx)(V.InputSelect,{id:"sort",name:"sort",label:"Sort",value:y.sort,onChange:d=>w({sort:d.target.value}),options:[{value:"",label:"Select a sort"},...h.map(d=>({value:d.sortKey,label:d.name}))]})):null,Array.isArray(i)&&i.length>0?(0,e.jsx)("div",{css:R.css`
66
66
  flex-grow: 1;
67
- `},(0,e.jsx)(T.InputSelect,{id:"sort-order",name:"sort-order",label:"Sort Order",value:y.sortOrder,onChange:i=>w({sortOrder:i.target.value}),options:c.map(i=>({value:i.sortOrderKey,label:i.name}))})):null),(0,e.jsx)("div",null,(0,e.jsx)("h3",{css:k.css`
67
+ `},(0,e.jsx)(V.InputSelect,{id:"sort-order",name:"sort-order",label:"Sort Order",value:y.sortOrder,onChange:d=>w({sortOrder:d.target.value}),options:i.map(d=>({value:d.sortOrderKey,label:d.name}))})):null),(0,e.jsx)("div",null,(0,e.jsx)("h3",{css:R.css`
68
68
  font-size: var(--fs-md);
69
69
  line-height: var(--spacing-md);
70
70
  font-weight: var(--fw-bold);
71
71
  margin-bottom: var(--spacing-xs);
72
- `},"Result Preview"),(0,e.jsx)(_e,{products:(ae=oe.value)==null?void 0:ae.products}))))};function Yt(t,n){var s;let o=[],r=n?`${n.name} > `:"",a={id:t.id.toString(),name:`${r}${t.name}`};return o.push(a),(s=t.children)==null||s.forEach(p=>{let v=Yt(p,a);o.push(...v)}),o}function Xt({onCountChange:t,countIcon:n,disabled:o}){return(0,e.jsx)("button",{css:k.css`
72
+ `},"Result Preview"),(0,e.jsx)(We,{products:(B=ne.value)==null?void 0:B.products}))))};function Yt(t,n){var s;let o=[],r=n?`${n.name} > `:"",a={id:t.id.toString(),name:`${r}${t.name}`};return o.push(a),(s=t.children)==null||s.forEach(u=>{let v=Yt(u,a);o.push(...v)}),o}function Xt({onCountChange:t,countIcon:n,disabled:o}){return(0,e.jsx)("button",{css:R.css`
73
73
  width: 2.25rem;
74
74
  height: 2.25rem;
75
75
  border: 1px solid var(--gray-300);
@@ -81,58 +81,59 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
81
81
  &:hover {
82
82
  background-color: var(--gray-200);
83
83
  }
84
- ${o?k.css`
84
+ ${o?R.css`
85
85
  cursor: not-allowed;
86
86
  opacity: 0.3;
87
87
  `:""}
88
- `,onClick:t,disabled:o},n==="increment"?(0,e.jsx)(Ce,{css:k.css`
88
+ `,onClick:t,disabled:o},n==="increment"?(0,e.jsx)(Ce,{css:R.css`
89
89
  width: 1rem;
90
90
  height: 1rem;
91
- `}):(0,e.jsx)(Pe,{css:k.css`
91
+ `}):(0,e.jsx)(Pe,{css:R.css`
92
92
  width: 1rem;
93
93
  height: 1rem;
94
- `}))}var Qe=O.default.createContext(void 0),Ne=()=>{let t=(0,O.useContext)(Qe);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function _({src:t,alt:n,className:o}){let r=t&&typeof t!="string"?t:null;return r?(0,e.jsx)(r,{className:o}):(0,e.jsx)("img",{src:t,alt:n,className:o})}var x=require("@emotion/react"),qt=require("@uniformdev/design-system"),_e=({products:t})=>{let{categories:n,logoIcon:o}=Ne();return(0,e.jsx)(We.default.Fragment,null,(0,e.jsx)("p",{css:x.css`
94
+ `}))}var Qe=H.default.createContext(void 0),Ne=()=>{let t=(0,H.useContext)(Qe);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function Y({src:t,alt:n,className:o}){let r=t&&typeof t!="string"?t:null;return r?(0,e.jsx)(r,{className:o}):(0,e.jsx)("img",{src:t,alt:n,className:o})}var L=require("@emotion/react"),qt=require("@uniformdev/design-system"),We=({products:t})=>{let{categories:n,logoIcon:o}=Ne();return(0,e.jsx)(_e.default.Fragment,null,(0,e.jsx)("p",{css:L.css`
95
95
  margin-bottom: var(--spacing-base);
96
- `},"Matching ",(t==null?void 0:t.length)||0," products"),(0,e.jsx)("ul",{css:[x.css`
96
+ `},"Matching ",(t==null?void 0:t.length)||0," products"),(0,e.jsx)("ul",{css:[L.css`
97
97
  max-height: 24rem;
98
98
  overflow-x: auto;
99
- `,qt.scrollbarStyles]},t==null?void 0:t.map((r,a)=>{var v,u;let[s]=(r==null?void 0:r.categories)||[],p=typeof s=="undefined"||!n||(v=n.find(h=>h.id===s.id))==null?void 0:v.name;return(0,e.jsx)("li",{key:`product-${r.id}`,css:x.css`
99
+ `,qt.scrollbarStyles]},t==null?void 0:t.map((r,a)=>{var v,m;let[s]=(r==null?void 0:r.categories)||[],u=typeof s=="undefined"||!n||(v=n.find(h=>h.id===s.id))==null?void 0:v.name;return(0,e.jsx)("li",{key:`product-${r.id}`,css:L.css`
100
100
  border: 1px solid var(--gray-300);
101
101
  border-radius: var(--rounded-md);
102
102
  background-color: var(--gray-100);
103
103
  margin: var(--spacing-base) 0;
104
- `},(0,e.jsx)("div",{css:x.css`
104
+ `},(0,e.jsx)("div",{css:L.css`
105
105
  padding: var(--spacing-sm);
106
106
  display: flex;
107
107
  flex-grow: 1;
108
108
  margin-right: var(--spacing-sm);
109
109
  gap: var(--spacing-base);
110
110
  align-items: center;
111
- `},r.thumbnailUrl?(0,e.jsx)("img",{src:r.thumbnailUrl,alt:r.name||`Product ${a}`,css:x.css`
111
+ `},r.thumbnailUrl?(0,e.jsx)("img",{src:r.thumbnailUrl,alt:typeof r.title=="string"?r.title:r.name||`Product ${a}`,css:L.css`
112
112
  background-color: var(--gray-200);
113
113
  width: 3.5rem;
114
114
  height: 3.5rem;
115
115
  object-fit: cover;
116
- `}):(0,e.jsx)("div",{css:x.css`
116
+ `}):(0,e.jsx)("div",{css:L.css`
117
117
  height: 3.5rem;
118
118
  width: 3.5rem;
119
119
  background-color: var(--gray-100);
120
- `}),(0,e.jsx)("h4",{css:x.css`
120
+ `}),(0,e.jsx)("h4",{css:L.css`
121
121
  font-weight: var(--fw-bold);
122
122
  width: 33.333333%;
123
123
  font-size: var(--fs-sm);
124
- `},r.name,p&&(0,e.jsx)("span",{css:x.css`
124
+ margin-top: 0px;
125
+ `},r.title||r.name,u&&(0,e.jsx)("span",{css:L.css`
125
126
  display: block;
126
127
  font-weight: var(--fw-regular);
127
- `},p)),r&&(0,e.jsx)(We.default.Fragment,null,(0,e.jsx)("p",{css:x.css`
128
+ `},u)),r&&(0,e.jsx)(_e.default.Fragment,null,(0,e.jsx)("p",{css:L.css`
128
129
  margin-right: var(--spacing-lg);
129
130
  font-size: var(--fs-sm);
130
- `},"SKU: ",r.sku||r.id,(0,e.jsx)("br",null)),r.price!==void 0?(0,e.jsx)("p",{css:x.css`
131
+ `},"SKU: ",r.sku||r.id,(0,e.jsx)("br",null)),r.price!==void 0?(0,e.jsx)("p",{css:L.css`
131
132
  margin-right: var(--spacing-lg);
132
133
  font-size: var(--fs-sm);
133
- `},(0,e.jsx)("span",{css:x.css`
134
+ `},(0,e.jsx)("span",{css:L.css`
134
135
  display: block;
135
- `},"Price: ",r.price)):null,r.editLink||r.url?(0,e.jsx)("a",{css:x.css`
136
+ `},"Price: ",r.price)):null,r.editLink||r.url?(0,e.jsx)("a",{css:L.css`
136
137
  display: inline-flex;
137
138
  justify-content: space-between;
138
139
  align-items: center;
@@ -144,19 +145,19 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
144
145
  &:hover {
145
146
  background-color: var(--gray-100);
146
147
  }
147
- `,href:(u=r.editLink)!=null?u:r.url,title:`Goto ${r.name}`,target:"__blank",rel:"noopener"},(0,e.jsx)("span",{css:x.css`
148
+ `,href:(m=r.editLink)!=null?m:r.url,title:`Go to ${r.title||r.name}`,target:"_blank",rel:"noopener noreferrer"},(0,e.jsx)("span",{css:L.css`
148
149
  font-size: var(--fs-sm);
149
150
  margin-right: var(--spacing-sm);
150
- `},"Edit"),o?(0,e.jsx)(_,{src:o,alt:"Logo",css:x.css`
151
+ `},"Edit"),o?(0,e.jsx)(Y,{src:o,alt:"Logo",css:L.css`
151
152
  width: 2.25rem;
152
153
  height: 2.25rem;
153
- `}):null):null)))})))};var Y=N(require("react"));var D=N(require("react"));var xe={};Qt(xe,{Caution:()=>Jt,Checkmark:()=>Le,ChevronDown:()=>ke,Close:()=>ce,Danger:()=>jt,ExclamationPoint:()=>er,Info:()=>de,Lightbulb:()=>tr,MagnifyingGlass:()=>rr,MaximizeAlt:()=>or,Minus:()=>Pe,MoreVerticalAlt:()=>ge,Plus:()=>Ce});var Br=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),Jt=Br;var Hr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),Le=Hr;var $r=t=>(0,e.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},(0,e.jsx)("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),ke=$r;var Fr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},(0,e.jsx)("g",{fillRule:"evenodd"},(0,e.jsx)("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),(0,e.jsx)("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),ce=Fr;var Kr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),jt=Kr;var Qr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),er=Qr;var Nr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),de=Nr;var _r=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),tr=_r;var Wr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("g",{clipPath:"url(#magnifying-glass_svg__a)"},(0,e.jsx)("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),(0,e.jsx)("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),(0,e.jsx)("defs",null,(0,e.jsx)("clipPath",{id:"magnifying-glass_svg__a"},(0,e.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),rr=Wr;var Zr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),or=Zr;var Xr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),ge=Xr;var cr=require("react-use"),dr=require("uuid");var B=N(require("react"));function nr(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}var ir=require("timeago.js");var I=require("@emotion/react"),ar=require("@uniformdev/design-system"),Ze=I.css`
154
+ `}):null):null)))})))};var ee=X(require("react"));var I=X(require("react"));var xe={};Qt(xe,{Caution:()=>Jt,Checkmark:()=>Le,ChevronDown:()=>ke,Close:()=>ce,Danger:()=>jt,ExclamationPoint:()=>er,Info:()=>de,Lightbulb:()=>tr,MagnifyingGlass:()=>rr,MaximizeAlt:()=>or,Minus:()=>Pe,MoreVerticalAlt:()=>ge,Plus:()=>Ce});var Hr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),Jt=Hr;var $r=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),Le=$r;var Fr=t=>(0,e.jsx)("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},(0,e.jsx)("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),ke=Fr;var Kr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},(0,e.jsx)("g",{fillRule:"evenodd"},(0,e.jsx)("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),(0,e.jsx)("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),ce=Kr;var Qr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),jt=Qr;var Nr=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),er=Nr;var Wr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),de=Wr;var _r=t=>(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},(0,e.jsx)("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),tr=_r;var Zr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},(0,e.jsx)("g",{clipPath:"url(#magnifying-glass_svg__a)"},(0,e.jsx)("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),(0,e.jsx)("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),(0,e.jsx)("defs",null,(0,e.jsx)("clipPath",{id:"magnifying-glass_svg__a"},(0,e.jsx)("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),rr=Zr;var Xr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),or=Xr;var Yr=t=>(0,e.jsx)("svg",{width:"1em",height:"1em",fill:"currentColor",...t},(0,e.jsx)("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),ge=Yr;var cr=require("react-use"),dr=require("uuid");var $=X(require("react"));function nr(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}var ir=require("timeago.js");var T=require("@emotion/react"),ar=require("@uniformdev/design-system"),Ze=T.css`
154
155
  border: 1px solid var(--gray-200);
155
156
  background: var(--gray-50);
156
157
  border-radius: var(--rounded-base);
157
158
  display: flex;
158
159
  width: 100%;
159
- `,Xe=I.css`
160
+ `,Xe=T.css`
160
161
  align-items: center;
161
162
  display: flex;
162
163
  flex-grow: 1;
@@ -164,24 +165,25 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
164
165
  margin-inline: 0 var(--spacing-sm);
165
166
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
166
167
  position: relative;
167
- `,Ye=I.css`
168
+ `,Ye=T.css`
168
169
  flex-grow: 1;
169
- `,qe=I.css`
170
+ `,qe=T.css`
170
171
  align-items: start;
171
172
  display: inline-flex;
172
173
  position: relative;
173
- `,Je=I.css`
174
+ `,Je=T.css`
174
175
  color: var(--brand-secondary-1);
175
176
  font-size: var(--fs-base);
176
177
  font-weight: var(--fw-bold);
177
178
  line-height: 1;
178
- `,je=I.css`
179
+ margin: 0;
180
+ `,je=T.css`
179
181
  width: 1.5rem;
180
182
  height: 1.5rem;
181
- `,et=I.css`
183
+ `,et=T.css`
182
184
  width: 1rem;
183
185
  height: 1rem;
184
- `,tt=I.css`
186
+ `,tt=T.css`
185
187
  background: var(--white);
186
188
  border-radius: var(--rounded-base);
187
189
  border-left: 4px solid var(--brand-secondary-3);
@@ -190,12 +192,12 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
190
192
  padding: var(--spacing-base);
191
193
  z-index: var(--z-10);
192
194
  width: max-content;
193
- `,W=I.css`
195
+ `,q=T.css`
194
196
  font-size: var(--fs-sm);
195
- `,fe=I.css`
197
+ `,le=T.css`
196
198
  font-weight: var(--fw-bold);
197
199
  margin-right: var(--spacing-sm);
198
- `,rt=I.css`
200
+ `,rt=T.css`
199
201
  display: flex;
200
202
  flex-direction: column;
201
203
  gap: var(--spacing-sm);
@@ -203,8 +205,9 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
203
205
  ${(0,ar.mq)("md")} {
204
206
  flex-direction: row;
205
207
  min-width: 200px;
208
+ justify-content: end;
206
209
  }
207
- `,Ee=I.css`
210
+ `,Ee=T.css`
208
211
  align-items: center;
209
212
  background: var(--white);
210
213
  border-radius: var(--rounded-base);
@@ -217,42 +220,41 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
217
220
  &:hover {
218
221
  background: var(--gray-50);
219
222
  }
220
- `;var U=require("@emotion/react");var ot=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var h;let a=(0,B.useRef)(null),s=(0,B.useRef)(null),[p,v]=(0,B.useState)(!1);(0,B.useEffect)(()=>{let c=C=>{a.current&&!a.current.contains(C.target)&&s.current&&!s.current.contains(C.target)&&v(!1)},f=()=>{v(!1)};return window.addEventListener("resize",f,!0),document.addEventListener("scroll",c,!0),document.addEventListener("mousedown",c),()=>{window.removeEventListener("resize",f,!0),document.removeEventListener("scroll",c,!0),document.removeEventListener("mousedown",c)}},[s]);let u=()=>{var c;if(v(!p),s.current&&a.current){let f=(c=a==null?void 0:a.current)==null?void 0:c.getBoundingClientRect(),C=s.current.offsetWidth;s.current.style.top=`${f.top+30}px`,s.current.style.left=`${f.left-C+30}px`}};return(0,e.jsx)("div",{css:Ze,key:t.id},(0,e.jsx)("div",{css:Xe},(0,e.jsx)("div",{css:Ye},(0,e.jsx)("div",{css:qe},(0,e.jsx)("h4",{css:[Je,t.popoverData?U.css`
223
+ `;var O=require("@emotion/react");var ot=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var h;let a=(0,$.useRef)(null),s=(0,$.useRef)(null),[u,v]=(0,$.useState)(!1);(0,$.useEffect)(()=>{let i=C=>{a.current&&!a.current.contains(C.target)&&s.current&&!s.current.contains(C.target)&&v(!1)},f=()=>{v(!1)};return window.addEventListener("resize",f,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",f,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[s]);let m=()=>{var i;if(v(!u),s.current&&a.current){let f=(i=a==null?void 0:a.current)==null?void 0:i.getBoundingClientRect(),C=s.current.offsetWidth;s.current.style.top=`${f.top+30}px`,s.current.style.left=`${f.left-C+30}px`}};return(0,e.jsx)("div",{css:Ze,key:t.id},(0,e.jsx)("div",{css:Xe},(0,e.jsx)("div",{css:Ye},(0,e.jsx)("div",{css:qe},(0,e.jsx)("h4",{css:[Je,t.popoverData?O.css`
221
224
  margin-bottom: var(--spacing-sm);
222
- `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?(0,e.jsx)(B.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:a,css:U.css`
225
+ `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?(0,e.jsx)($.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:a,css:O.css`
223
226
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
224
- `,"aria-controls":"path-details","aria-expanded":p,onClick:u},(0,e.jsx)(de,{width:24,height:24,css:U.css`
227
+ `,"aria-controls":"path-details","aria-expanded":u,onClick:m},(0,e.jsx)(de,{width:24,height:24,css:O.css`
225
228
  color: var(--gray-400);
226
- `})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!p,ref:s,css:[tt,p?U.css`
229
+ `})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!u,ref:s,css:[tt,u?O.css`
227
230
  visibility: visible;
228
- `:U.css`
231
+ `:O.css`
229
232
  visibility: hidden;
230
- `]},Object.entries(t.popoverData).map(([c,f],C)=>(0,e.jsx)("div",{css:W,key:C},(0,e.jsx)("span",{css:fe},c,":"),f)))):null),t.createdDate&&(0,e.jsx)("div",{css:W},(0,e.jsx)("span",{css:fe},"Created:"),(0,ir.format)((h=t.createdDate)!=null?h:0)),(0,e.jsx)("div",{css:U.css`
231
- display: flex;
232
- gap: var(--spacing-base);
233
- `},t.metadata?Object.entries(t.metadata).filter(([c])=>["type","status"].includes(c.toLocaleLowerCase())).map(([c,f])=>(0,e.jsx)("span",{css:W,key:c},f)):null),t.metadata?Object.entries(t.metadata).filter(([c])=>!["type","status"].includes(c.toLocaleLowerCase())).map(([c,f])=>(0,e.jsx)("div",{css:[W,U.css`
233
+ `]},Object.entries(t.popoverData).map(([i,f],C)=>(0,e.jsx)("div",{css:q,key:C},(0,e.jsx)("span",{css:le},i,":"),f)))):null),t.createdDate&&(0,e.jsx)("div",{css:q},(0,e.jsx)("span",{css:le},"Created:"),(0,ir.format)((h=t.createdDate)!=null?h:0)),t.metadata?Object.entries(t.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,f])=>(0,e.jsx)("div",{css:[q,O.css`
234
+ order: 1;
235
+ `],key:i},(0,e.jsx)("span",{css:le},i,":"),f)):null,t.metadata?Object.entries(t.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,f])=>(0,e.jsx)("div",{css:[q,O.css`
234
236
  order: 1;
235
- `],key:c},(0,e.jsx)("span",{css:[fe,U.css`
237
+ `],key:i},(0,e.jsx)("span",{css:[le,O.css`
236
238
  order: 1;
237
- `]},c,":"),f)):null),(0,e.jsx)("div",{css:rt},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:c=>{r&&(nr(c.currentTarget.href,()=>r(t)),c.preventDefault())},css:Ee},(0,e.jsx)("span",{css:W},"Edit"),(0,e.jsx)(_,{src:n,css:je,alt:"Logo"})):null,(0,e.jsx)("button",{type:"button",onClick:()=>{o(t)},css:Ee},(0,e.jsx)("span",{css:W},"Unlink"),(0,e.jsx)(ce,{css:[et,U.css`
239
+ `]},i,":"),f)):null),(0,e.jsx)("div",{css:rt},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{r&&(nr(i.currentTarget.href,()=>r(t)),i.preventDefault())},css:Ee},(0,e.jsx)("span",{css:q},"Edit"),(0,e.jsx)(Y,{src:n,css:je,alt:"Logo"})):null,(0,e.jsx)("button",{type:"button",onClick:()=>{o(t)},css:Ee},(0,e.jsx)("span",{css:q},"Unlink"),(0,e.jsx)(ce,{css:[et,O.css`
238
240
  color: var(--brand-secondary-5);
239
- `]})))))};var H=N(require("react"));var Z=require("@emotion/react"),nt=Z.css`
241
+ `]})))))};var F=X(require("react"));var J=require("@emotion/react"),nt=J.css`
240
242
  cursor: pointer;
241
243
  padding: var(--spacing-sm);
242
244
  position: relative;
243
245
  transition: background-color var(--duration-fast) var(--timing-ease-out),
244
246
  color var(--duration-fast) var(--timing-ease-out);
245
- `,at=Z.css`
247
+ `,at=J.css`
246
248
  padding-right: var(--spacing-lg);
247
- `,it=Z.css`
249
+ `,it=J.css`
248
250
  background: var(--brand-secondary-3);
249
251
  color: var(--white);
250
- `,Me=Z.css`
252
+ `,Me=J.css`
251
253
  font-size: var(--fs-xs);
252
- `,Ve=Z.css`
254
+ `,Ve=J.css`
253
255
  font-weight: var(--fw-bold);
254
256
  margin-right: var(--spacing-sm);
255
- `,st=Z.css`
257
+ `,st=J.css`
256
258
  background: var(--white);
257
259
  border-left: 4px solid var(--brand-secondary-3);
258
260
  border-radius: var(--rounded-base);
@@ -264,20 +266,20 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
264
266
  right: var(--spacing-xl);
265
267
  z-index: var(--z-10);
266
268
  width: max-content;
267
- `,ct=Z.css`
269
+ `,ct=J.css`
268
270
  position: absolute;
269
271
  inset: 0 var(--spacing-sm) 0 auto;
270
- `;var dt=require("@emotion/react"),lt=({result:t,isSelected:n,triggerSelection:o})=>{let r=(0,H.useRef)(null),a=(0,H.useRef)(null),[s,p]=(0,H.useState)(!1);(0,H.useEffect)(()=>{function u(h){r.current&&!r.current.contains(h.target)&&a.current&&!a.current.contains(h.target)&&p(!1)}return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[a]);let v=u=>{u.stopPropagation(),p(!s)};return(0,e.jsx)("div",{key:t.id,css:[nt,n?it:void 0,t.popoverData?at:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?(0,e.jsx)(H.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:r,css:ct,"aria-controls":"path-details",onClick:u=>v(u),"aria-expanded":s},(0,e.jsx)(de,{width:24,height:24})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!s,ref:a,css:[st,s?dt.css`
272
+ `;var dt=require("@emotion/react"),lt=({result:t,isSelected:n,triggerSelection:o})=>{let r=(0,F.useRef)(null),a=(0,F.useRef)(null),[s,u]=(0,F.useState)(!1);(0,F.useEffect)(()=>{function m(h){r.current&&!r.current.contains(h.target)&&a.current&&!a.current.contains(h.target)&&u(!1)}return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[a]);let v=m=>{m.stopPropagation(),u(!s)};return(0,e.jsx)("div",{key:t.id,css:[nt,n?it:void 0,t.popoverData?at:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?(0,e.jsx)(F.default.Fragment,null,(0,e.jsx)("button",{type:"button",ref:r,css:ct,"aria-controls":"path-details",onClick:m=>v(m),"aria-expanded":s},(0,e.jsx)(de,{width:24,height:24})),(0,e.jsx)("div",{id:"path-details","aria-hidden":!s,ref:a,css:[st,s?dt.css`
271
273
  visibility: visible;
272
274
  `:dt.css`
273
275
  visibility: hidden;
274
- `]},t.metadata&&Object.entries(t.metadata).map(([u,h],c)=>(0,e.jsx)("div",{css:Me,key:c},(0,e.jsx)("span",{css:Ve},u,":"),h)),Object.entries(t.popoverData).map(([u,h],c)=>(0,e.jsx)("div",{css:Me,key:c},(0,e.jsx)("span",{css:Ve},u,":"),h)))):null)};var le=require("react-beautiful-dnd");var R=require("@emotion/react"),pt=R.css`
276
+ `]},t.metadata&&Object.entries(t.metadata).map(([m,h],i)=>(0,e.jsx)("div",{css:Me,key:i},(0,e.jsx)("span",{css:Ve},m,":"),h)),Object.entries(t.popoverData).map(([m,h],i)=>(0,e.jsx)("div",{css:Me,key:i},(0,e.jsx)("span",{css:Ve},m,":"),h)))):null)};var pe=require("react-beautiful-dnd");var P=require("@emotion/react"),pt=P.css`
275
277
  background: var(--white);
276
278
  border: 1px solid var(--gray-300);
277
279
  border-radius: var(--rounded-base);
278
280
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
279
281
  margin-bottom: var(--spacing-base);
280
- `,ut=R.css`
282
+ `,ut=P.css`
281
283
  align-items: center;
282
284
  display: flex;
283
285
  position: relative;
@@ -285,7 +287,7 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
285
287
  width: 100%;
286
288
  background-color: transparent;
287
289
  border: 0;
288
- `,mt=R.css`
290
+ `,mt=P.css`
289
291
  color: var(--brand-secondary-1);
290
292
  display: block;
291
293
  font-weight: var(--fw-bold);
@@ -301,15 +303,15 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
301
303
  background: var(--gray-100);
302
304
  outline: none;
303
305
  }
304
- `,gt=R.css`
306
+ `,gt=P.css`
305
307
  background: var(--white);
306
308
  border: 1px solid var(--gray-300);
307
309
  border-radius: var(--rounded-base);
308
310
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
309
311
  display: block;
310
- `,ft=R.css`
312
+ `,ft=P.css`
311
313
  display: none;
312
- `,vt=R.css`
314
+ `,vt=P.css`
313
315
  overflow-y: auto;
314
316
  height: 16rem;
315
317
  margin-bottom: var(--spacing-base);
@@ -318,130 +320,130 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
318
320
  & > :not(:last-child) {
319
321
  border-bottom: 1px solid var(--gray-200);
320
322
  }
321
- `,Yr=R.css`
323
+ `,qr=P.css`
322
324
  background-color: var(--gray-50);
323
325
  max-width: 33.33%;
324
- `,ht=R.css`
326
+ `,ht=P.css`
325
327
  align-items: center;
326
328
  display: flex;
327
329
  position: absolute;
328
330
  inset: 0 0 0 auto;
329
331
  pointer-events: none;
330
332
  padding-right: var(--spacing-sm);
331
- `,yt=R.css`
333
+ `,yt=P.css`
332
334
  color: var(--brand-secondary-1);
333
335
  width: 1.25rem;
334
336
  height: 1.25rem;
335
337
  transition: transform var(--duration-fast) var(--timing-ease-out);
336
338
  transform: rotate(0);
337
- `,qr=R.css`
339
+ `,Jr=P.css`
338
340
  background: var(--white);
339
341
  color: var(--brand-secondary-1);
340
- `,bt=R.css`
342
+ `,bt=P.css`
341
343
  position: relative;
342
344
  margin-block: var(--spacing-sm) 0;
343
345
 
344
346
  &:hover > span {
345
347
  opacity: 0.3;
346
348
  }
347
- `,St=R.css`
349
+ `,St=P.css`
348
350
  align-items: center;
349
351
  display: flex;
350
352
  position: absolute;
351
353
  inset: 0 auto 0 0;
352
354
  margin-block: auto;
353
355
  opacity: 0;
354
- `,Te=R.css`
356
+ `,Te=P.css`
355
357
  color: var(--brand-secondary-1);
356
- `,wt=R.css`
358
+ `,wt=P.css`
357
359
  position: absolute;
358
360
  left: 0.375rem;
359
- `,Ie=R.css`
361
+ `,Ie=P.css`
360
362
  width: calc(var(--spacing-lg) + var(--spacing-xs));
361
363
  height: calc(var(--spacing-lg) + var(--spacing-xs));
362
- `;var G=require("@emotion/react"),S=require("@uniformdev/design-system");var te=require("react");function sr(t,{delay:n=500,minDuration:o=200}={delay:500,minDuration:200}){let[r,a]=(0,te.useState)("IDLE"),s=(0,te.useRef)(void 0);return(0,te.useEffect)(()=>{t&&r==="IDLE"&&(clearTimeout(s.current),s.current=setTimeout(()=>{if(!t)return a("IDLE");s.current=setTimeout(()=>{a("EXPIRE")},o),a("DISPLAY")},n),a("DELAY")),!t&&r!=="DISPLAY"&&(clearTimeout(s.current),a("IDLE"))},[t,r,n,o]),(0,te.useEffect)(()=>()=>clearTimeout(s.current),[]),r==="DISPLAY"||r==="EXPIRE"}var Jr=({searchText:t,selectedContentType:n})=>{let o="No content found";return n&&n!=="any"&&(o=`No ${n} content was found`),t&&(o=`${o} for keyword '${t}'.`),(0,e.jsx)(S.Callout,{type:"info"},o)},Ct=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:a,select:s,multiSelect:p,multiSelectId:v,rowComponent:u,selectedItemComponent:h,totalResults:c,resultsLoading:f,requireContentType:C,onAddNew:re,onEditClosed:$,onCancel:w,noResultsComponent:y,helpComponent:oe,onSort:F,typeSelectorLabel:q="Content Type Select",typeSelectorAllTypesOptionText:K="All content types"})=>{var $t,Ft,Kt;let ne=()=>C?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[j,ee]=D.useState(""),[b,m]=D.useState(ne),[P,ae]=D.useState(!1),[i,L]=D.useState([]),[pe,Ut]=D.useState(!1),ze=D.useRef(`x${(0,dr.v4)()}`),ye=(0,cr.useThrottle)(j,750);D.useEffect(()=>{t(ye,{count:5,offset:0,contentType:b==="any"?void 0:b})},[ye,b]);let mr=sr(f,{delay:1e3}),gr=d=>{i.some(g=>g.id===d.id)?L(g=>g.filter(Q=>Q.id!==d.id)):L(p?g=>[...g,d]:[d])},fr=r==null?void 0:r.map(d=>d.id).join(",");D.useEffect(()=>{Array.isArray(r)&&L(r)},[fr]);let vr=()=>{m(ne()),ee(""),L(r!=null&&r.length?r:[])},hr=()=>{ae(d=>!d),P||vr()},Ot=d=>{let g=(i==null?void 0:i.filter(Q=>Q.id!==d.id))||[];L(g),s(g,"")},yr=d=>{d.preventDefault(),s(i,b),ae(!1)},br=d=>{d.preventDefault(),ae(!1),w&&w()},Sr=()=>{t(ye,{count:5,offset:(n==null?void 0:n.length)||0,contentType:b==="any"?void 0:b}),Ut(!0);let d=setTimeout(()=>{Ut(!1)},750);return()=>clearTimeout(d)},wr=!(r==null?void 0:r.length)||p,Cr=u||lt,Bt=h||ot,Pr=y||Jr,Ht=a&&typeof a!="string"?a:null,Rr=Ht?(0,e.jsx)(Ht,{css:Ie}):(0,e.jsx)("img",{src:a,alt:"Logo",css:Ie}),Lr=d=>{var g,Q;if(d.destination&&d.source.droppableId===((g=d.destination)==null?void 0:g.droppableId)){let M=[...r||[]],[ue]=(Q=M==null?void 0:M.splice(d.source.index,1))!=null?Q:[];return M==null||M.splice(d.destination.index,0,ue),F&&(L(M),F==null||F(M)),M}};return(0,e.jsx)("div",{css:G.css`
364
+ `;var z=require("@emotion/react"),S=require("@uniformdev/design-system");var re=require("react");function sr(t,{delay:n=500,minDuration:o=200}={delay:500,minDuration:200}){let[r,a]=(0,re.useState)("IDLE"),s=(0,re.useRef)(void 0);return(0,re.useEffect)(()=>{t&&r==="IDLE"&&(clearTimeout(s.current),s.current=setTimeout(()=>{if(!t)return a("IDLE");s.current=setTimeout(()=>{a("EXPIRE")},o),a("DISPLAY")},n),a("DELAY")),!t&&r!=="DISPLAY"&&(clearTimeout(s.current),a("IDLE"))},[t,r,n,o]),(0,re.useEffect)(()=>()=>clearTimeout(s.current),[]),r==="DISPLAY"||r==="EXPIRE"}var jr=({searchText:t,selectedContentType:n})=>{let o="No content found";return n&&n!=="any"&&(o=`No ${n} content was found`),t&&(o=`${o} for keyword '${t}'.`),(0,e.jsx)(S.Callout,{type:"info"},o)},Ct=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:a,select:s,multiSelect:u,multiSelectId:v,rowComponent:m,selectedItemComponent:h,totalResults:i,resultsLoading:f,requireContentType:C,onAddNew:oe,onEditClosed:K,onCancel:w,noResultsComponent:y,helpComponent:ne,onSort:Q,typeSelectorLabel:te="Content Type Select",typeSelectorAllTypesOptionText:N="All content types",loadingIndicatorDelay:W=1e3})=>{var $t,Ft,Kt;let ae=()=>C?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[_,k]=I.useState(""),[p,D]=I.useState(ae),[B,d]=I.useState(!1),[b,G]=I.useState([]),[mr,Ut]=I.useState(!1),ze=I.useRef(`x${(0,dr.v4)()}`),ye=(0,cr.useThrottle)(_,750);I.useEffect(()=>{t(ye,{count:5,offset:0,contentType:p==="any"?void 0:p})},[ye,p]);let gr=sr(f,{delay:W}),fr=c=>{b.some(g=>g.id===c.id)?G(g=>g.filter(Z=>Z.id!==c.id)):G(u?g=>[...g,c]:[c])},vr=r==null?void 0:r.map(c=>c.id+c.title).join(",");I.useEffect(()=>{Array.isArray(r)&&G(r)},[vr]);let hr=()=>{D(ae()),k(""),G(r!=null&&r.length?r:[])},yr=()=>{d(c=>!c),B||hr()},Ot=c=>{let g=(b==null?void 0:b.filter(Z=>Z.id!==c.id))||[];G(g),s(g,"")},br=c=>{c.preventDefault(),s(b,p),d(!1)},Sr=c=>{c.preventDefault(),d(!1),w&&w()},wr=()=>{t(ye,{count:5,offset:(n==null?void 0:n.length)||0,contentType:p==="any"?void 0:p}),Ut(!0);let c=setTimeout(()=>{Ut(!1)},750);return()=>clearTimeout(c)},Cr=!(r==null?void 0:r.length)||u,Pr=m||lt,Bt=h||ot,Rr=y||jr,Ht=a&&typeof a!="string"?a:null,Lr=Ht?(0,e.jsx)(Ht,{css:Ie}):(0,e.jsx)("img",{src:a,alt:"Logo",css:Ie}),kr=c=>{var g,Z;if(c.destination&&c.source.droppableId===((g=c.destination)==null?void 0:g.droppableId)){let E=[...r||[]],[ue]=(Z=E==null?void 0:E.splice(c.source.index,1))!=null?Z:[];return E==null||E.splice(c.destination.index,0,ue),Q&&(G(E),Q==null||Q(E)),E}};return(0,e.jsx)("div",{css:z.css`
363
365
  width: 100%;
364
- `},(0,e.jsx)("div",{css:G.css`
366
+ `},(0,e.jsx)("div",{css:z.css`
365
367
  position: relative;
366
368
  margin-block: var(--spacing-base);
367
- `},wr?(0,e.jsx)(D.Fragment,null,(0,e.jsx)("div",{css:pt,"data-test-id":"component-search"},(0,e.jsx)("button",{css:ut,onClick:hr,type:"button","aria-haspopup":!0,"aria-expanded":P,"aria-controls":`entry-search-config-${ze.current}`},Rr,(0,e.jsx)("span",{css:G.css`
369
+ `},Cr?(0,e.jsx)(I.Fragment,null,(0,e.jsx)("div",{css:pt,"data-test-id":"component-search"},(0,e.jsx)("button",{css:ut,onClick:yr,type:"button","aria-haspopup":!0,"aria-expanded":B,"aria-controls":`entry-search-config-${ze.current}`},Lr,(0,e.jsx)("span",{css:z.css`
368
370
  margin-left: var(--spacing-base);
369
- `},"Select"),(0,e.jsx)("span",{css:ht},(0,e.jsx)(ke,{css:[yt,P?G.css`
371
+ `},"Select"),(0,e.jsx)("span",{css:ht},(0,e.jsx)(ke,{css:[yt,B?z.css`
370
372
  transform: rotate(180deg);
371
- `:void 0]})))),(0,e.jsx)("div",{id:`entry-search-config-${ze.current}`,"aria-hidden":!P,css:[gt,P?void 0:ft]},oe||null,(0,e.jsx)("div",{css:G.css`
373
+ `:void 0]})))),(0,e.jsx)("div",{id:`entry-search-config-${ze.current}`,"aria-hidden":!B,css:[gt,B?void 0:ft]},ne||null,(0,e.jsx)("div",{css:z.css`
372
374
  display: flex;
373
375
  gap: calc(var(--spacing-base) - 0.25rem);
374
376
  margin-bottom: var(--spacing-base);
375
- `},(0,e.jsx)(S.InputSelect,{onChange:d=>m(d.target.value),value:b,label:q,showLabel:!1,options:[...C?[]:[{value:"any",label:K}],...o?o.map(d=>({value:d.id,label:d.name})):[]]}),(0,e.jsx)("div",{css:G.css`
377
+ `},(0,e.jsx)(S.InputSelect,{onChange:c=>D(c.target.value),value:p,label:te,showLabel:!1,options:[...C?[]:[{value:"any",label:N}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),(0,e.jsx)("div",{css:z.css`
376
378
  flex-grow: 1;
377
- `},(0,e.jsx)(S.InputKeywordSearch,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:ee,disabledFieldSubmission:!0,value:j}))),(0,e.jsx)("div",{css:[vt,S.scrollbarStyles],id:ze.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(0,e.jsx)(S.LoadingOverlay,{isActive:mr}),Array.isArray(n)&&n.length>0?n.map(d=>(0,e.jsx)(Cr,{key:d.id,isSelected:i.some(g=>g.id===d.id),result:d,triggerSelection:()=>gr(d)})):(0,e.jsx)(Pr,{searchText:ye||j,selectedContentType:(Ft=($t=o==null?void 0:o.find(d=>d.id===b))==null?void 0:$t.name)!=null?Ft:b}),!f&&typeof c!="undefined"&&n&&(n==null?void 0:n.length)<c&&(0,e.jsx)("button",{type:"button",css:mt,onClick:Sr},pe?(0,e.jsx)(S.LoadingIndicator,null):"Load More")),(0,e.jsx)("div",{css:G.css`
379
+ `},(0,e.jsx)(S.InputKeywordSearch,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:k,disabledFieldSubmission:!0,value:_}))),(0,e.jsx)("div",{css:[vt,S.scrollbarStyles],id:ze.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},(0,e.jsx)(S.LoadingOverlay,{isActive:gr}),Array.isArray(n)&&n.length>0?n.map(c=>(0,e.jsx)(Pr,{key:c.id,isSelected:b.some(g=>g.id===c.id),result:c,triggerSelection:()=>fr(c)})):(0,e.jsx)(Rr,{searchText:ye||_,selectedContentType:(Ft=($t=o==null?void 0:o.find(c=>c.id===p))==null?void 0:$t.name)!=null?Ft:p}),!f&&typeof i!="undefined"&&n&&(n==null?void 0:n.length)<i&&(0,e.jsx)("button",{type:"button",css:mt,onClick:wr},mr?(0,e.jsx)(S.LoadingIndicator,null):"Load More")),(0,e.jsx)("div",{css:z.css`
378
380
  display: flex;
379
381
  justify-content: space-between;
380
- `},(0,e.jsx)("div",null,re&&((Kt=o==null?void 0:o.length)!=null?Kt:0)>0?(0,e.jsx)(S.Menu,{menuLabel:"Add new menu",menuTrigger:(0,e.jsx)(S.Button,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(d=>(0,e.jsx)(S.MenuItem,{key:d.id,css:G.css`
382
+ `},(0,e.jsx)("div",null,oe&&((Kt=o==null?void 0:o.length)!=null?Kt:0)>0?(0,e.jsx)(S.Menu,{menuLabel:"Add new menu",menuTrigger:(0,e.jsx)(S.Button,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(c=>(0,e.jsx)(S.MenuItem,{key:c.id,css:z.css`
381
383
  background: var(--white);
382
384
  color: var(--brand-secondary-1);
383
- `,onClick:()=>re(d)},d.name))):null),(0,e.jsx)("div",{css:G.css`
385
+ `,onClick:()=>oe(c)},c.name))):null),(0,e.jsx)("div",{css:z.css`
384
386
  display: flex;
385
387
  gap: var(--spacing-base);
386
- `},(0,e.jsx)(S.Button,{buttonType:"unimportant",onClick:br},"Cancel"),(0,e.jsx)(S.Button,{disabled:!i.length,onClick:yr,"data-test-id":"entry-accept-button"},"Accept"))))):null,P?null:p?(0,e.jsx)(le.DragDropContext,{onDragEnd:d=>Lr(d)},(0,e.jsx)(le.Droppable,{droppableId:v||"canvas-multi-select"},d=>(0,e.jsx)("div",{...d.droppableProps,ref:d.innerRef,css:G.css`
388
+ `},(0,e.jsx)(S.Button,{buttonType:"unimportant",onClick:Sr},"Cancel"),(0,e.jsx)(S.Button,{disabled:!b.length,onClick:br,"data-test-id":"entry-accept-button"},"Accept"))))):null,B?null:u?(0,e.jsx)(pe.DragDropContext,{onDragEnd:c=>kr(c)},(0,e.jsx)(pe.Droppable,{droppableId:v||"canvas-multi-select"},c=>(0,e.jsx)("div",{...c.droppableProps,ref:c.innerRef,css:z.css`
387
389
  margin-block: var(--spacing-sm) 0;
388
- `},i==null?void 0:i.map((g,Q)=>{if(g!=null&&g.id)return(0,e.jsx)(le.Draggable,{key:g.id,draggableId:g.id,index:Q},M=>(0,e.jsx)("div",{css:bt,ref:M.innerRef,...M.draggableProps,...M.dragHandleProps},(0,e.jsx)("span",{css:St},(0,e.jsx)(ge,{css:[Te,wt],width:24,height:24}),(0,e.jsx)(ge,{css:Te,width:24,height:24})),(0,e.jsx)(Bt,{key:`selected-item-${g.id}`,logoIcon:a,selectedItem:g,onDeselect:ue=>Ot(ue),onEditClosed:$?ue=>$(ue):void 0})))}),d.placeholder))):i==null?void 0:i.map(d=>(0,e.jsx)(Bt,{key:`selected-item-${d.id}`,logoIcon:a,selectedItem:d,onDeselect:g=>Ot(g),onEditClosed:$?g=>$(g):void 0}))))};var X=require("@emotion/react"),Pt=X.css`
390
+ `},b==null?void 0:b.map((g,Z)=>{if(g!=null&&g.id)return(0,e.jsx)(pe.Draggable,{key:g.id,draggableId:g.id,index:Z},E=>(0,e.jsx)("div",{css:bt,ref:E.innerRef,...E.draggableProps,...E.dragHandleProps},(0,e.jsx)("span",{css:St},(0,e.jsx)(ge,{css:[Te,wt],width:24,height:24}),(0,e.jsx)(ge,{css:Te,width:24,height:24})),(0,e.jsx)(Bt,{key:`selected-item-${g.id}`,logoIcon:a,selectedItem:g,onDeselect:ue=>Ot(ue),onEditClosed:K?ue=>K(ue):void 0})))}),c.placeholder))):b==null?void 0:b.map(c=>(0,e.jsx)(Bt,{key:`selected-item-${c.id}`,logoIcon:a,selectedItem:c,onDeselect:g=>Ot(g),onEditClosed:K?g=>K(g):void 0}))))};var j=require("@emotion/react"),Pt=j.css`
389
391
  cursor: pointer;
390
392
  padding: var(--spacing-sm) 0;
391
393
  margin-right: var(--spacing-sm);
392
394
  position: relative;
393
395
  transition: background-color var(--duration-fast) var(--timing-ease-out),
394
396
  color var(--duration-fast) var(--timing-ease-out);
395
- `,Rt=X.css`
397
+ `,Rt=j.css`
396
398
  border: 2px solid transparent;
397
399
  border-radius: var(--rounded-base);
398
400
  display: flex;
399
401
  align-items: center;
400
402
  gap: var(--spacing-base);
401
403
  padding: var(--spacing-sm) var(--spacing-xs);
402
- `,Lt=X.css`
404
+ `,Lt=j.css`
403
405
  background-color: var(--green-50);
404
- `,kt=X.css`
406
+ `,kt=j.css`
405
407
  font-size: var(--fs-sm);
406
408
  font-weight: var(--fw-bold);
407
409
  width: 50%;
408
- `,xt=X.css`
410
+ `,xt=j.css`
409
411
  font-weight: var(--fw-normal);
410
412
  display: block;
411
- `,Et=X.css`
413
+ `,Et=j.css`
412
414
  font-size: var(--fs-sm);
413
415
  > * {
414
416
  display: block;
415
417
  }
416
- `,Mt=X.css`
418
+ `,Mt=j.css`
417
419
  display: block;
418
420
  height: 1.5rem;
419
421
  width: 1.5rem;
420
422
  color: var(--brand-secondary-3);
421
423
  margin-left: auto;
422
- `;var Vt=require("@emotion/react");function Tt({result:t,isSelected:n,triggerSelection:o}){var v;let{categories:r,logoIcon:a}=ve(),[s]=t.categories||[{id:"",name:""}],p=typeof s=="undefined"||!r||(v=r.find(u=>u.id===s.id))==null?void 0:v.name;return(0,e.jsx)("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Pt]},(0,e.jsx)("div",{css:[Rt,n?Lt:void 0]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:Vt.css`
424
+ `;var Vt=require("@emotion/react");function Tt({result:t,isSelected:n,triggerSelection:o}){var v;let{categories:r,logoIcon:a}=fe(),[s]=t.categories||[{id:"",name:""}],u=typeof s=="undefined"||!r||(v=r.find(m=>m.id===s.id))==null?void 0:v.name;return(0,e.jsx)("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Pt]},(0,e.jsx)("div",{css:[Rt,n?Lt:void 0]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:Vt.css`
423
425
  background-color: var(--gray-200);
424
426
  width: 3rem;
425
427
  height: 3rem;
426
428
  object-fit: cover;
427
- `}):(0,e.jsx)(_,{src:a,alt:"Logo",css:Vt.css`
429
+ `}):(0,e.jsx)(Y,{src:a,alt:"Logo",css:Vt.css`
428
430
  height: 2.25rem;
429
431
  width: 2.25rem;
430
- `}),(0,e.jsx)("h4",{css:[kt]},t.title,p?(0,e.jsx)("span",{css:[xt]},p):null),(0,e.jsx)("p",{css:[Et]},"SKU: ",t.sku||t.id,t.price!==void 0?(0,e.jsx)("span",null,t.price):null),n?(0,e.jsx)(Le,{css:[Mt]}):null))}var he=require("@emotion/react"),lr=require("@uniformdev/design-system"),It=he.css`
432
+ `}),(0,e.jsx)("h4",{css:[kt]},t.title,u?(0,e.jsx)("span",{css:[xt]},u):null),(0,e.jsx)("p",{css:[Et]},"SKU: ",t.sku||t.id,t.price!==void 0?(0,e.jsx)("span",null,t.price):null),n?(0,e.jsx)(Le,{css:[Mt]}):null))}var ve=require("@emotion/react"),lr=require("@uniformdev/design-system"),It=ve.css`
431
433
  display: flex;
432
434
  width: 100%;
433
435
  border: 1px solid var(--gray-300);
434
436
  border-radius: var(--rounded-base);
435
437
  background-color: var(--gray-100);
436
438
  margin: var(--spacing-base) 0;
437
- `,Dt=he.css`
439
+ `,Dt=ve.css`
438
440
  padding: var(--spacing-base) 0 var(--spacing-base) var(--spacing-lg);
439
441
  display: flex;
440
442
  flex-grow: 1;
441
443
  align-items: center;
442
444
  margin-right: var(--spacing-sm);
443
445
  gap: var(--spacing-base);
444
- `,Gt=he.css`
446
+ `,Gt=ve.css`
445
447
  display: flex;
446
448
  align-items: center;
447
449
  gap: var(--spacing-sm);
@@ -449,29 +451,30 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
449
451
  width: 50%;
450
452
  margin-bottom: 0;
451
453
  }
452
- `,De=he.css`
454
+ `,De=ve.css`
453
455
  background-color: var(--gray-200);
454
456
  width: 3.5rem;
455
457
  height: 3.5rem;
456
458
  object-fit: cover;
457
- `;var E=require("@emotion/react"),pr=require("@uniformdev/design-system");function zt({selectedItem:t,onDeselect:n}){var p;let{categories:o,logoIcon:r}=ve(),[a]=t.categories||[{id:"",name:""}],s=typeof a=="undefined"||!o||(p=o.find(v=>v.id===a.id))==null?void 0:p.name;return(0,e.jsx)("div",{css:[It],key:t.id},(0,e.jsx)("article",{css:[Dt]},(0,e.jsx)("div",{css:[Gt]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:s,css:[De],loading:"lazy"}):(0,e.jsx)("div",{css:[De]}),(0,e.jsx)("div",{css:E.css`
459
+ `;var x=require("@emotion/react"),pr=require("@uniformdev/design-system");function zt({selectedItem:t,onDeselect:n}){var u;let{categories:o,logoIcon:r}=fe(),[a]=t.categories||[{id:"",name:""}],s=typeof a=="undefined"||!o||(u=o.find(v=>v.id===a.id))==null?void 0:u.name;return(0,e.jsx)("div",{css:[It],key:t.id},(0,e.jsx)("article",{css:[Dt]},(0,e.jsx)("div",{css:[Gt]},t.thumbnailUrl?(0,e.jsx)("img",{src:t.thumbnailUrl,alt:s,css:[De],loading:"lazy"}):(0,e.jsx)("div",{css:[De]}),(0,e.jsx)("div",{css:x.css`
458
460
  > :not(:last-child) {
459
461
  margin-bottom: var(--spacing-xs);
460
462
  }
461
- `},(0,e.jsx)("h4",{css:E.css`
463
+ `},(0,e.jsx)("h4",{css:x.css`
464
+ margin-top: 0px;
462
465
  font-weight: var(--fw-bold);
463
- `},t.title||t.id||"",s&&(0,e.jsx)("span",{css:E.css`
466
+ `},t.title||t.id||"",s&&(0,e.jsx)("span",{css:x.css`
464
467
  display: block;
465
468
  font-weight: var(--fw-regular);
466
- `},s)),(0,e.jsx)("ul",{css:E.css`
469
+ `},s)),(0,e.jsx)("ul",{css:x.css`
467
470
  font-size: var(--fs-sm);
468
471
  display: flex;
469
472
  gap: var(--spacing-base);
470
- `},(0,e.jsx)("li",null,(0,e.jsx)("span",{css:E.css`
473
+ `},(0,e.jsx)("li",null,(0,e.jsx)("span",{css:x.css`
471
474
  margin-right: var(--spacing-xs);
472
- `},"SKU:"),t.sku||t.id),t.price!==void 0?(0,e.jsx)("li",null,(0,e.jsx)("span",{css:E.css`
475
+ `},"SKU:"),t.sku||t.id),t.price!==void 0?(0,e.jsx)("li",null,(0,e.jsx)("span",{css:x.css`
473
476
  margin-right: var(--spacing-xs);
474
- `},"Price:"),(0,e.jsx)("span",null,t.price)):null))),(0,e.jsx)("div",{css:E.css`
477
+ `},"Price:"),(0,e.jsx)("span",null,t.price)):null))),(0,e.jsx)("div",{css:x.css`
475
478
  display: flex;
476
479
  flex-wrap: wrap;
477
480
  gap: var(--spacing-sm);
@@ -480,7 +483,7 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
480
483
  ${(0,pr.mq)("md")} {
481
484
  align-items: center;
482
485
  }
483
- `},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",css:E.css`
486
+ `},t.editLink?(0,e.jsx)("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:x.css`
484
487
  display: inline-flex;
485
488
  justify-content: space-between;
486
489
  align-items: center;
@@ -491,14 +494,14 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
491
494
  &:hover {
492
495
  background-color: var(--gray-100);
493
496
  }
494
- `},(0,e.jsx)("span",{css:E.css`
497
+ `},(0,e.jsx)("span",{css:x.css`
495
498
  margin-right: var(--spacing-sm);
496
499
  font-size: var(--fs-sm);
497
- `},"Edit"),(0,e.jsx)(_,{src:r,alt:"Logo",css:E.css`
500
+ `},"Edit"),(0,e.jsx)(Y,{src:r,alt:"Logo",css:x.css`
498
501
  width: 1.75rem;
499
502
  height: 1.75rem;
500
503
  display: block;
501
- `})):null,(0,e.jsx)("button",{type:"button",onClick:()=>{n==null||n(t)},css:E.css`
504
+ `})):null,(0,e.jsx)("button",{type:"button",onClick:()=>{n==null||n(t)},css:x.css`
502
505
  display: flex;
503
506
  justify-content: space-between;
504
507
  align-items: center;
@@ -511,8 +514,8 @@ var kr=Object.create;var Se=Object.defineProperty;var xr=Object.getOwnPropertyDe
511
514
  &:hover {
512
515
  background-color: var(--gray-100);
513
516
  }
514
- `},(0,e.jsx)("span",{css:E.css`
517
+ `},(0,e.jsx)("span",{css:x.css`
515
518
  font-size: var(--fs-sm);
516
- `},"Unlink"),(0,e.jsx)(ce,{css:E.css`
519
+ `},"Unlink"),(0,e.jsx)(ce,{css:x.css`
517
520
  color: var(--brand-secondary-5);
518
- `})))))}var ur=require("@uniformdev/design-system"),Ge=require("react-use");function jr({selectedProducts:t,setSelectedProducts:n,onGetCategories:o,onSearchProducts:r,logoIcon:a,multiSelect:s,multiSelectId:p,selectedItemComponent:v,rowComponent:u,errorComponent:h,helpComponent:c,noResultsComponent:f,onSort:C,typeSelectorAllTypesOptionText:re="All categories",typeSelectorLabel:$="Select Category"}){var ee;let{value:w,loading:y,error:oe}=(0,Ge.useAsync)(async()=>await o(),[o]),F=w==null?void 0:w.map(b=>b.id).join(","),q=(0,Y.useMemo)(()=>w?w.map(m=>({id:m.id,name:m.name})):void 0,[F]),K=(0,Y.useRef)(),[J,ne]=(0,Ge.useAsyncFn)(async(b,m)=>{let P=await r({text:b,options:{limit:m==null?void 0:m.count,offset:m==null?void 0:m.offset,categoryId:m==null?void 0:m.contentType}});return(m==null?void 0:m.offset)===0&&(K.current=[]),(K.current=K.current||[]).push(...P.products),P},[r]),j=async b=>{await n(b)};return oe||J.error?(0,e.jsx)(h||(({categoriesError:m,searchError:P})=>(0,e.jsx)(ur.Callout,{type:"error"},"There was an error: ",(m==null?void 0:m.message)||(P==null?void 0:P.message))),{categoriesError:oe,searchError:J.error}):(0,e.jsx)(At.Provider,{value:{categories:w,logoIcon:a}},(0,e.jsx)(Ct,{search:ne,results:K.current,logoIcon:a,selectedItems:t,select:j,multiSelectId:p||"product-search-multi-select",multiSelect:s,contentTypes:q,selectedItemComponent:v||zt,rowComponent:u||Tt,totalResults:(ee=J.value)==null?void 0:ee.total,resultsLoading:J.loading||y,helpComponent:c,noResultsComponent:f,onSort:C,typeSelectorAllTypesOptionText:re,typeSelectorLabel:$}))}var At=Y.default.createContext(void 0),ve=()=>{let t=(0,Y.useContext)(At);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};A(z,require("@uniformdev/mesh-sdk"),module.exports);var l=require("@uniformdev/design-system");0&&(module.exports={Button,Callout,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputSelect,InputToggle,KeywordSearchInput,Label,LoadingIndicator,LoadingOverlay,Menu,MenuItem,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Switch,Textarea,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,badgeIcon,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemImage,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowContainerWithPopover,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemCloseIcon,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,useInitializeUniformMeshSdk,useProductQueryContext,useProductSearchContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});
521
+ `})))))}var ur=require("@uniformdev/design-system"),Ge=require("react-use");function eo({selectedProducts:t,setSelectedProducts:n,onGetCategories:o,onSearchProducts:r,logoIcon:a,multiSelect:s,multiSelectId:u,selectedItemComponent:v,rowComponent:m,errorComponent:h,helpComponent:i,noResultsComponent:f,onSort:C,typeSelectorAllTypesOptionText:oe="All categories",typeSelectorLabel:K="Select Category"}){var _;let{value:w,loading:y,error:ne}=(0,Ge.useAsync)(async()=>await o(),[o]),Q=w==null?void 0:w.map(k=>k.id).join(","),te=(0,ee.useMemo)(()=>w?w.map(p=>({id:p.id,name:p.name})):void 0,[Q]),N=(0,ee.useRef)(),[W,he]=(0,Ge.useAsyncFn)(async(k,p)=>{let D=await r({text:k,options:{limit:p==null?void 0:p.count,offset:p==null?void 0:p.offset,categoryId:p==null?void 0:p.contentType}});return(p==null?void 0:p.offset)===0&&(N.current=[]),(N.current=N.current||[]).push(...D.products),D},[r]),ae=async k=>{await n(k)};return ne||W.error?(0,e.jsx)(h||(({categoriesError:p,searchError:D})=>(0,e.jsx)(ur.Callout,{type:"error"},"There was an error: ",(p==null?void 0:p.message)||(D==null?void 0:D.message))),{categoriesError:ne,searchError:W.error}):(0,e.jsx)(At.Provider,{value:{categories:w,logoIcon:a}},(0,e.jsx)(Ct,{search:he,results:N.current,logoIcon:a,selectedItems:t,select:ae,multiSelectId:u||"product-search-multi-select",multiSelect:s,contentTypes:te,selectedItemComponent:v||zt,rowComponent:m||Tt,totalResults:(_=W.value)==null?void 0:_.total,resultsLoading:W.loading||y,helpComponent:i,noResultsComponent:f,onSort:C,typeSelectorAllTypesOptionText:oe,typeSelectorLabel:K}))}var At=ee.default.createContext(void 0),fe=()=>{let t=(0,ee.useContext)(At);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};U(A,require("@uniformdev/mesh-sdk"),module.exports);var l=require("@uniformdev/design-system");0&&(module.exports={Button,Callout,DefaultSearchRow,DefaultSelectedItem,EntrySearch,Heading,Icons,Input,InputSelect,InputToggle,KeywordSearchInput,Label,LoadingIndicator,LoadingOverlay,Menu,MenuItem,ProductPreviewList,ProductQuery,ProductQueryContext,ProductSearch,ProductSearchContext,ProductSearchRow,ProductSelectedItem,ResolvableLoadingValue,ScrollableList,ScrollableListItem,SelectionField,Switch,Textarea,Theme,UniformMeshLocationContext,UniformMeshLocationContextProvider,UniformMeshSdkContext,UniformMeshSdkContextProvider,badgeIcon,draggableContainer,draggableIcon,draggableIconOffset,draggableIconWrapper,entrySearchBtn,entrySearchConfig,entrySearchConfigHidden,entrySearchLoadMoreBtn,entrySearchResultList,entrySearchSelectIcon,entrySearchSelectImg,entrySearchSelectInput,entrySearchSelectOption,entrySearchWrapper,productSearchRowActiveIcon,productSearchRowCategory,productSearchRowContainer,productSearchRowContent,productSearchRowContentActive,productSearchRowDetails,productSearchRowTitle,productSelectedItemContainer,productSelectedItemContent,productSelectedItemDetails,productSelectedItemImage,searchRowBtn,searchRowContainer,searchRowContainerActive,searchRowContainerWithPopover,searchRowPopover,searchRowText,searchRowTextSmall,selectItemLinkBtn,selectItemLinkContainer,selectItemPopover,selectItemPopoverLabel,selectItemSmallText,selectedItemCloseIcon,selectedItemContainer,selectedItemCopy,selectedItemDetails,selectedItemIcon,selectedItemInner,selectedItemTitle,useInitializeUniformMeshSdk,useProductQueryContext,useProductSearchContext,useUniformMeshLocation,useUniformMeshLocationContext,useUniformMeshSdk,useUniformMeshSdkContext});