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

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
- var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enumerable:!0})};import{jsx as e}from"@emotion/react";import*as k from"react";import{createContext as sr,useContext as cr,useState as dr}from"react";var Ee=sr(void 0),Me=({children:t})=>{let[n,o]=dr(),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 e(Ee.Provider,{value:r},t)},Ve=()=>{let t=cr(Ee);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function Co(){let{location:t}=Ve();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}}import{initializeUniformMeshSDK as lr}from"@uniformdev/mesh-sdk";import{useEffect as pr,useState as Te}from"react";var xo=({autoResizingDisabled:t}={})=>{let[n,o]=Te(),[r,a]=Te();return pr(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?lr({autoResizingDisabled:t}).then(s=>{a(s)}).catch(s=>{o(s)}):a(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};import{createContext as ur,useContext as mr}from"react";import{Theme as gr}from"@uniformdev/design-system";var Ie=ur(void 0),Do=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),e(Ie.Provider,{value:n},e(gr,null),e(Me,null,t))},De=()=>{let t=mr(Ie);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function Ao(){let{sdk:t}=De();return t}import Qe from"react";import yr,{useMemo as ae,useContext as br}from"react";import{css as J}from"@emotion/react";import{InputSelect as fr}from"@uniformdev/design-system";import Ge from"react";var ze=({value:t,text:n,loading:o})=>e(Ge.Fragment,null,!!n&&n,!n&&e(Ge.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var Ae=({id:t,label:n,loading:o,selectedValues:r,values:a,onAdd:s,onRemove:p})=>{var v;let f=(v=a==null?void 0:a.filter(i=>!(r!=null&&r.includes(i.id.toString()))))!=null?v:[],u=(i,g)=>{i.preventDefault(),p(g)};return e("div",null,e(fr,{id:t,name:t,label:n,onChange:i=>s(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...f.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(r)&&r.length>0?J`
1
+ var wr=Object.defineProperty;var Cr=(t,n)=>{for(var o in n)wr(t,o,{get:n[o],enumerable:!0})};import{jsx as e}from"@emotion/react";import*as P from"react";import{createContext as Pr,useContext as Rr,useState as Lr}from"react";var ze=Pr(void 0),Ue=({children:t})=>{let[n,o]=Lr(),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(i,l)=>{await a.setValue(i,l),o(window.UniformMeshSDK.getCurrentLocation())},setValidationResult:async i=>{await a.setValidationResult(i)}}}}return e(ze.Provider,{value:r},t)},Ge=()=>{let t=Rr(ze);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function No(){let{location:t}=Ge();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}}import{initializeUniformMeshSDK as kr}from"@uniformdev/mesh-sdk";import{useEffect as xr,useState as Ae}from"react";var Xo=({autoResizingDisabled:t}={})=>{let[n,o]=Ae(),[r,a]=Ae();return xr(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?kr({autoResizingDisabled:t}).then(i=>{a(i)}).catch(i=>{o(i)}):a(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};import{createContext as Ir,useContext as Er}from"react";import{Theme as Mr}from"@uniformdev/design-system";var Be=Ir(void 0),tn=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),e(Be.Provider,{value:n},e(Mr,null),e(Ue,null,t))},Oe=()=>{let t=Er(Be);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function nn(){let{sdk:t}=Oe();return t}import qe from"react";import zr,{useMemo as ce,useContext as Ur}from"react";import{css as te}from"@emotion/react";import{InputSelect as Tr}from"@uniformdev/design-system";import He from"react";var $e=({value:t,text:n,loading:o})=>e(He.Fragment,null,!!n&&n,!n&&e(He.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var Fe=({id:t,label:n,loading:o,selectedValues:r,values:a,onAdd:i,onRemove:l})=>{var f;let g=(f=a==null?void 0:a.filter(s=>!(r!=null&&r.includes(s.id.toString()))))!=null?f:[],u=(s,p)=>{s.preventDefault(),l(p)};return e("div",null,e(Tr,{id:t,name:t,label:n,onChange:s=>i(s.target.value),disabled:o,options:[{value:"",label:"Add..."},...g.map(s=>({value:s.id,label:s.name||s.id}))],value:"",css:Array.isArray(r)&&r.length>0?te`
2
2
  margin-bottom: var(--spacing-base);
3
- `:""}),r==null?void 0:r.map(i=>{var g;return e("div",{css:J`
3
+ `:""}),r==null?void 0:r.map(s=>{var p;return e("div",{css:te`
4
4
  font-size: var(--fs-sm);
5
5
  display: inline-flex;
6
6
  align-items: center;
@@ -9,67 +9,67 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
9
9
  border: 1px solid var(--gray-300);
10
10
  margin-bottom: var(--spacing-sm);
11
11
  margin-right: var(--spacing-sm);
12
- `,key:i},e("span",{css:J`
12
+ `,key:s},e("span",{css:te`
13
13
  padding: var(--spacing-3);
14
14
  color: var(--gray-800);
15
- `},e(ze,{value:i,loading:o,text:(g=a.find(S=>S.id===i))==null?void 0:g.name})),e("button",{css:J`
15
+ `},e($e,{value:s,loading:o,text:(p=a.find(h=>h.id===s))==null?void 0:p.name})),e("button",{css:te`
16
16
  padding: var(--spacing-3);
17
17
  border-left: 1px solid var(--gray-300);
18
- `,title:"remove",onClick:S=>u(S,i)},e("svg",{xmlns:"http://www.w3.org/2000/svg",css:J`
18
+ `,title:"remove",onClick:h=>u(h,s)},e("svg",{xmlns:"http://www.w3.org/2000/svg",css:te`
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"},e("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 vr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("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"})),oe=vr;var hr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})),ne=hr;import{useAsyncFn as Sr,useDebounce as wr}from"react-use";import{Input as Ue,InputSelect as ie,mq as se}from"@uniformdev/design-system";import{css as P}from"@emotion/react";var Oe={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},rn=({value:t,setValue:n,brands:o,categories:r,loading:a,categoriesLoading:s,brandsLoading:p,logoIcon:f,onGetProducts:u,sortOptions:v,sortOrderOptions:i,categoryLabel:g="Product Category",brandLabel:S="Brand",disableBrands:W,restrictToSingleCategory:z=!1})=>{var l,M,D;let b=async d=>{n({...Oe,...t||{},...d})},h=ae(()=>({...Oe,...t||{}}),[t]),[_,A]=Sr(async d=>await u(d),[u]);wr(async()=>{await A({brand:h.brand,categories:h.categories,keyword:h.keyword,sort:h.sort,sortOrder:h.sortOrder,count:h.count})},250,[h]);let F=ae(()=>{let d=[];return r==null||r.forEach(y=>{let T=He(y,void 0);d.push(...T)}),d},[r]),U=ae(()=>[{value:"",label:"All categories"},...F.map(d=>({label:d.name,value:d.id}))],[F]),O=ae(()=>(o==null?void 0:o.map(d=>({id:d.id.toString(),name:d.name})))||[],[o]),te=d=>{if(!d)return;let y=(t==null?void 0:t.categories)||[];b({categories:[...y,d]})},Z=d=>{var y;b({categories:(y=t==null?void 0:t.categories)==null?void 0:y.filter(T=>T!==d)})},B=d=>{b({brand:d.target.value})},C=d=>{b({count:d||1})};return a?e("div",null,"Loading..."):e($e.Provider,{value:{categories:r,logoIcon:f}},e("div",{css:P`
23
+ `,viewBox:"0 0 20 20",fill:"currentColor"},e("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 Vr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("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"})),ie=Vr;var Dr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})),se=Dr;import{useAsyncFn as Gr,useDebounce as Ar}from"react-use";import{Input as Ke,InputSelect as de,mq as le}from"@uniformdev/design-system";import{css as R}from"@emotion/react";var Ne={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Ln=({value:t,setValue:n,brands:o,categories:r,loading:a,categoriesLoading:i,brandsLoading:l,logoIcon:g,onGetProducts:u,sortOptions:f,sortOrderOptions:s,categoryLabel:p="Product Category",brandLabel:h="Brand",disableBrands:V,restrictToSingleCategory:O=!1})=>{var m,M,G;let S=async d=>{n({...Ne,...t||{},...d})},b=ce(()=>({...Ne,...t||{}}),[t]),[Y,H]=Gr(async d=>await u(d),[u]);Ar(async()=>{await H({brand:b.brand,categories:b.categories,keyword:b.keyword,sort:b.sort,sortOrder:b.sortOrder,count:b.count})},250,[b]);let _=ce(()=>{let d=[];return r==null||r.forEach(y=>{let D=We(y,void 0);d.push(...D)}),d},[r]),$=ce(()=>[{value:"",label:"All categories"},..._.map(d=>({label:d.name,value:d.id}))],[_]),F=ce(()=>(o==null?void 0:o.map(d=>({id:d.id.toString(),name:d.name})))||[],[o]),ne=d=>{if(!d)return;let y=(t==null?void 0:t.categories)||[];S({categories:[...y,d]})},J=d=>{var y;S({categories:(y=t==null?void 0:t.categories)==null?void 0:y.filter(D=>D!==d)})},K=d=>{S({brand:d.target.value})},C=d=>{S({count:d||1})};return a?e("div",null,"Loading..."):e(_e.Provider,{value:{categories:r,logoIcon:g}},e("div",{css:R`
24
24
  > :not(:last-child) {
25
25
  margin-bottom: var(--spacing-md);
26
26
  }
27
- `},z?e(ie,{id:"selection-field-product-category",label:g,disabled:a,value:(M=(l=h.categories)==null?void 0:l[0])!=null?M:"",options:U,onChange:d=>{b({categories:d.target.value===""?[]:[d.target.value]})}}):e(Ae,{loading:s||!1,id:"selection-field-product-category",label:g,onAdd:te,onRemove:Z,selectedValues:h.categories,values:F}),e("div",{css:P`
27
+ `},O?e(de,{id:"selection-field-product-category",label:p,disabled:a,value:(M=(m=b.categories)==null?void 0:m[0])!=null?M:"",options:$,onChange:d=>{S({categories:d.target.value===""?[]:[d.target.value]})}}):e(Fe,{loading:i||!1,id:"selection-field-product-category",label:p,onAdd:ne,onRemove:J,selectedValues:b.categories,values:_}),e("div",{css:R`
28
28
  display: flex;
29
29
  flex-wrap: wrap;
30
30
  column-gap: var(--spacing-lg);
31
31
  row-gap: var(--spacing-md);
32
- ${se("md")} {
32
+ ${le("md")} {
33
33
  flex-wrap: nowrap;
34
34
  }
35
- `},W?null:e("div",{css:P`
35
+ `},V?null:e("div",{css:R`
36
36
  width: 50%;
37
- `},e(ie,{id:"brand",name:"brand",label:S,disabled:p,value:h.brand,onChange:B,options:[{value:"",label:"Choose..."},...O.map(d=>({value:d.id,label:d.name}))]})),e("div",{css:P`
37
+ `},e(de,{id:"brand",name:"brand",label:h,disabled:l,value:b.brand,onChange:K,options:[{value:"",label:"Choose..."},...F.map(d=>({value:d.id,label:d.name}))]})),e("div",{css:R`
38
38
  flex-grow: 1;
39
39
  position: relative;
40
- `},e(Ue,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:h.keyword,placeholder:"Enter keyword",onChange:d=>b({keyword:d.target.value})}))),e("div",{css:P`
40
+ `},e(Ke,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:b.keyword,placeholder:"Enter keyword",onChange:d=>S({keyword:d.target.value})}))),e("div",{css:R`
41
41
  display: flex;
42
42
  flex-wrap: wrap;
43
43
  column-gap: var(--spacing-lg);
44
44
  row-gap: var(--spacing-md);
45
- ${se("md")} {
45
+ ${le("md")} {
46
46
  flex-wrap: nowrap;
47
47
  }
48
- `},e("div",{css:P`
48
+ `},e("div",{css:R`
49
49
  width: 100%;
50
- ${se("md")} {
50
+ ${le("md")} {
51
51
  width: 33.333333%;
52
52
  }
53
53
  position: relative;
54
- `},e(Ue,{id:"count",name:"count",type:"number",min:1,step:1,value:h.count,onChange:d=>C(d.target.valueAsNumber),label:"Count"}),e("div",{css:P`
54
+ `},e(Ke,{id:"count",name:"count",type:"number",min:1,step:1,value:b.count,onChange:d=>C(d.target.valueAsNumber),label:"Count"}),e("div",{css:R`
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
- `},e(Be,{onCountChange:()=>C(h.count-1),countIcon:"decrement",disabled:h.count===1}),e(Be,{onCountChange:()=>C(h.count+1),countIcon:"increment"}))),Array.isArray(v)&&v.length>0?e("div",{css:P`
60
+ `},e(Qe,{onCountChange:()=>C(b.count-1),countIcon:"decrement",disabled:b.count===1}),e(Qe,{onCountChange:()=>C(b.count+1),countIcon:"increment"}))),Array.isArray(f)&&f.length>0?e("div",{css:R`
61
61
  flex-grow: 1;
62
- ${se("md")} {
62
+ ${le("md")} {
63
63
  width: 33.333333%;
64
64
  }
65
- `},e(ie,{id:"sort",name:"sort",label:"Sort",value:h.sort,onChange:d=>b({sort:d.target.value}),options:[{value:"",label:"Select a sort"},...v.map(d=>({value:d.sortKey,label:d.name}))]})):null,Array.isArray(i)&&i.length>0?e("div",{css:P`
65
+ `},e(de,{id:"sort",name:"sort",label:"Sort",value:b.sort,onChange:d=>S({sort:d.target.value}),options:[{value:"",label:"Select a sort"},...f.map(d=>({value:d.sortKey,label:d.name}))]})):null,Array.isArray(s)&&s.length>0?e("div",{css:R`
66
66
  flex-grow: 1;
67
- `},e(ie,{id:"sort-order",name:"sort-order",label:"Sort Order",value:h.sortOrder,onChange:d=>b({sortOrder:d.target.value}),options:i.map(d=>({value:d.sortOrderKey,label:d.name}))})):null),e("div",null,e("h3",{css:P`
67
+ `},e(de,{id:"sort-order",name:"sort-order",label:"Sort Order",value:b.sortOrder,onChange:d=>S({sortOrder:d.target.value}),options:s.map(d=>({value:d.sortOrderKey,label:d.name}))})):null),e("div",null,e("h3",{css:R`
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"),e(Ke,{products:(D=_.value)==null?void 0:D.products}))))};function He(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 f=He(p,a);o.push(...f)}),o}function Be({onCountChange:t,countIcon:n,disabled:o}){return e("button",{css:P`
72
+ `},"Result Preview"),e(Xe,{products:(G=Y.value)==null?void 0:G.products}))))};function We(t,n){var i;let o=[],r=n?`${n.name} > `:"",a={id:t.id.toString(),name:`${r}${t.name}`};return o.push(a),(i=t.children)==null||i.forEach(l=>{let g=We(l,a);o.push(...g)}),o}function Qe({onCountChange:t,countIcon:n,disabled:o}){return e("button",{css:R`
73
73
  width: 2.25rem;
74
74
  height: 2.25rem;
75
75
  border: 1px solid var(--gray-300);
@@ -81,59 +81,59 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
81
81
  &:hover {
82
82
  background-color: var(--gray-200);
83
83
  }
84
- ${o?P`
84
+ ${o?R`
85
85
  cursor: not-allowed;
86
86
  opacity: 0.3;
87
87
  `:""}
88
- `,onClick:t,disabled:o},n==="increment"?e(oe,{css:P`
88
+ `,onClick:t,disabled:o},n==="increment"?e(ie,{css:R`
89
89
  width: 1rem;
90
90
  height: 1rem;
91
- `}):e(ne,{css:P`
91
+ `}):e(se,{css:R`
92
92
  width: 1rem;
93
93
  height: 1rem;
94
- `}))}var $e=yr.createContext(void 0),Fe=()=>{let t=br($e);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?e(r,{className:o}):e("img",{src:t,alt:n,className:o})}import{css as R}from"@emotion/react";import{scrollbarStyles as Cr}from"@uniformdev/design-system";var Ke=({products:t})=>{let{categories:n,logoIcon:o}=Fe();return e(Qe.Fragment,null,e("p",{css:R`
94
+ `}))}var _e=zr.createContext(void 0),Ze=()=>{let t=Ur(_e);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function z({src:t,alt:n,className:o}){let r=t&&typeof t!="string"?t:null;return r?e(r,{className:o}):e("img",{src:t,alt:n,className:o})}import{css as L}from"@emotion/react";import{scrollbarStyles as Br}from"@uniformdev/design-system";var Xe=({products:t})=>{let{categories:n,logoIcon:o}=Ze();return e(qe.Fragment,null,e("p",{css:L`
95
95
  margin-bottom: var(--spacing-base);
96
- `},"Matching ",(t==null?void 0:t.length)||0," products"),e("ul",{css:[R`
96
+ `},"Matching ",(t==null?void 0:t.length)||0," products"),e("ul",{css:[L`
97
97
  max-height: 24rem;
98
98
  overflow-x: auto;
99
- `,Cr]},t==null?void 0:t.map((r,a)=>{var f,u;let[s]=(r==null?void 0:r.categories)||[],p=typeof s=="undefined"||!n||(f=n.find(v=>v.id===s.id))==null?void 0:f.name;return e("li",{key:`product-${r.id}`,css:R`
99
+ `,Br]},t==null?void 0:t.map((r,a)=>{var g,u;let[i]=(r==null?void 0:r.categories)||[],l=typeof i=="undefined"||!n||(g=n.find(f=>f.id===i.id))==null?void 0:g.name;return e("li",{key:`product-${r.id}`,css:L`
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
- `},e("div",{css:R`
104
+ `},e("div",{css:L`
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?e("img",{src:r.thumbnailUrl,alt:typeof r.title=="string"?r.title:r.name||`Product ${a}`,css:R`
111
+ `},r.thumbnailUrl?e("img",{src:r.thumbnailUrl,alt:typeof r.title=="string"?r.title:r.name||`Product ${a}`,css:L`
112
112
  background-color: var(--gray-200);
113
113
  width: 3.5rem;
114
114
  height: 3.5rem;
115
115
  object-fit: cover;
116
- `}):e("div",{css:R`
116
+ `}):e("div",{css:L`
117
117
  height: 3.5rem;
118
118
  width: 3.5rem;
119
119
  background-color: var(--gray-100);
120
- `}),e("h4",{css:R`
120
+ `}),e("h4",{css:L`
121
121
  font-weight: var(--fw-bold);
122
122
  width: 33.333333%;
123
123
  font-size: var(--fs-sm);
124
124
  margin-top: 0px;
125
- `},r.title||r.name,p&&e("span",{css:R`
125
+ `},r.title||r.name,l&&e("span",{css:L`
126
126
  display: block;
127
127
  font-weight: var(--fw-regular);
128
- `},p)),r&&e(Qe.Fragment,null,e("p",{css:R`
128
+ `},l)),r&&e(qe.Fragment,null,e("p",{css:L`
129
129
  margin-right: var(--spacing-lg);
130
130
  font-size: var(--fs-sm);
131
- `},"SKU: ",r.sku||r.id,e("br",null)),r.price!==void 0?e("p",{css:R`
131
+ `},"SKU: ",r.sku||r.id,e("br",null)),r.price!==void 0?e("p",{css:L`
132
132
  margin-right: var(--spacing-lg);
133
133
  font-size: var(--fs-sm);
134
- `},e("span",{css:R`
134
+ `},e("span",{css:L`
135
135
  display: block;
136
- `},"Price: ",r.price)):null,r.editLink||r.url?e("a",{css:R`
136
+ `},"Price: ",r.price)):null,r.editLink||r.url?e("a",{css:L`
137
137
  display: inline-flex;
138
138
  justify-content: space-between;
139
139
  align-items: center;
@@ -145,19 +145,19 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
145
145
  &:hover {
146
146
  background-color: var(--gray-100);
147
147
  }
148
- `,href:(u=r.editLink)!=null?u:r.url,title:`Go to ${r.title||r.name}`,target:"_blank",rel:"noopener noreferrer"},e("span",{css:R`
148
+ `,href:(u=r.editLink)!=null?u:r.url,title:`Go to ${r.title||r.name}`,target:"_blank",rel:"noopener noreferrer"},e("span",{css:L`
149
149
  font-size: var(--fs-sm);
150
150
  margin-right: var(--spacing-sm);
151
- `},"Edit"),o?e($,{src:o,alt:"Logo",css:R`
151
+ `},"Edit"),o?e(z,{src:o,alt:"Logo",css:L`
152
152
  width: 2.25rem;
153
153
  height: 2.25rem;
154
- `}):null):null)))})))};import io,{useContext as so,useMemo as co,useRef as lo}from"react";import*as x from"react";var me={};ir(me,{Caution:()=>Ne,Checkmark:()=>ce,ChevronDown:()=>de,Close:()=>X,Danger:()=>We,ExclamationPoint:()=>_e,Info:()=>Y,Lightbulb:()=>Ze,MagnifyingGlass:()=>Xe,MaximizeAlt:()=>Ye,Minus:()=>ne,MoreVerticalAlt:()=>j,Plus:()=>oe});var Pr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},e("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"})),Ne=Pr;var Rr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("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"})),ce=Rr;var Lr=t=>e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},e("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"})),de=Lr;var kr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},e("g",{fillRule:"evenodd"},e("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"}),e("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"}))),X=kr;var xr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},e("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"})),We=xr;var Er=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},e("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"})),_e=Er;var Mr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("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"}),e("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"})),Y=Mr;var Vr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},e("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"})),Ze=Vr;var Tr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("g",{clipPath:"url(#magnifying-glass_svg__a)"},e("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"}),e("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"})),e("defs",null,e("clipPath",{id:"magnifying-glass_svg__a"},e("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),Xe=Tr;var Ir=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("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"})),Ye=Ir;var Dr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("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"})),j=Dr;import{useThrottle as Qr}from"react-use";import{v4 as Nr}from"uuid";import zr,{useState as Ar,useRef as st,useEffect as Ur}from"react";function qe(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}import{format as Or}from"timeago.js";import{css as V}from"@emotion/react";import{mq as Gr}from"@uniformdev/design-system";var Je=V`
154
+ `}):null):null)))})))};import Po,{useContext as Ro,useMemo as Lo,useRef as ko}from"react";import*as x from"react";var be={};Cr(be,{Caution:()=>Ye,Checkmark:()=>pe,ChevronDown:()=>me,Close:()=>Q,Danger:()=>Je,ExclamationPoint:()=>je,Info:()=>W,Lightbulb:()=>et,MagnifyingGlass:()=>tt,MaximizeAlt:()=>rt,Minus:()=>se,MoreVerticalAlt:()=>re,Plus:()=>ie});var Or=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},e("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"})),Ye=Or;var Hr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("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"})),pe=Hr;var $r=t=>e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},e("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"})),me=$r;var Fr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},e("g",{fillRule:"evenodd"},e("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"}),e("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"}))),Q=Fr;var Kr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},e("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"})),Je=Kr;var Nr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},e("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"})),je=Nr;var Qr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("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"}),e("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"})),W=Qr;var Wr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},e("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"})),et=Wr;var _r=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("g",{clipPath:"url(#magnifying-glass_svg__a)"},e("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"}),e("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"})),e("defs",null,e("clipPath",{id:"magnifying-glass_svg__a"},e("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),tt=_r;var Zr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("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"})),rt=Zr;var Xr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("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"})),re=Xr;import{useThrottle as io}from"react-use";import{v4 as so}from"uuid";import Yr,{useState as Jr,useRef as mt,useEffect as jr}from"react";function ue(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}import{format as eo}from"timeago.js";import{css as T}from"@emotion/react";import{mq as qr}from"@uniformdev/design-system";var ot=T`
155
155
  border: 1px solid var(--gray-200);
156
156
  background: var(--gray-50);
157
157
  border-radius: var(--rounded-base);
158
158
  display: flex;
159
159
  width: 100%;
160
- `,je=V`
160
+ `,nt=T`
161
161
  align-items: center;
162
162
  display: flex;
163
163
  flex-grow: 1;
@@ -165,25 +165,25 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
165
165
  margin-inline: 0 var(--spacing-sm);
166
166
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
167
167
  position: relative;
168
- `,et=V`
168
+ `,at=T`
169
169
  flex-grow: 1;
170
- `,tt=V`
170
+ `,it=T`
171
171
  align-items: start;
172
172
  display: inline-flex;
173
173
  position: relative;
174
- `,rt=V`
174
+ `,st=T`
175
175
  color: var(--brand-secondary-1);
176
176
  font-size: var(--fs-base);
177
177
  font-weight: var(--fw-bold);
178
178
  line-height: 1;
179
179
  margin: 0;
180
- `,ot=V`
180
+ `,ct=T`
181
181
  width: 1.5rem;
182
182
  height: 1.5rem;
183
- `,nt=V`
183
+ `,dt=T`
184
184
  width: 1rem;
185
185
  height: 1rem;
186
- `,at=V`
186
+ `,lt=T`
187
187
  background: var(--white);
188
188
  border-radius: var(--rounded-base);
189
189
  border-left: 4px solid var(--brand-secondary-3);
@@ -192,22 +192,22 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
192
192
  padding: var(--spacing-base);
193
193
  z-index: var(--z-10);
194
194
  width: max-content;
195
- `,K=V`
195
+ `,Z=T`
196
196
  font-size: var(--fs-sm);
197
- `,ee=V`
197
+ `,oe=T`
198
198
  font-weight: var(--fw-bold);
199
199
  margin-right: var(--spacing-sm);
200
- `,it=V`
200
+ `,pt=T`
201
201
  display: flex;
202
202
  flex-direction: column;
203
203
  gap: var(--spacing-sm);
204
204
 
205
- ${Gr("md")} {
205
+ ${qr("md")} {
206
206
  flex-direction: row;
207
207
  min-width: 200px;
208
208
  justify-content: end;
209
209
  }
210
- `,ge=V`
210
+ `,ye=T`
211
211
  align-items: center;
212
212
  background: var(--white);
213
213
  border-radius: var(--rounded-base);
@@ -220,41 +220,41 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
220
220
  &:hover {
221
221
  background: var(--gray-50);
222
222
  }
223
- `;import{css as G}from"@emotion/react";var ct=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var v;let a=st(null),s=st(null),[p,f]=Ar(!1);Ur(()=>{let i=S=>{a.current&&!a.current.contains(S.target)&&s.current&&!s.current.contains(S.target)&&f(!1)},g=()=>{f(!1)};return window.addEventListener("resize",g,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",g,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[s]);let u=()=>{var i;if(f(!p),s.current&&a.current){let g=(i=a==null?void 0:a.current)==null?void 0:i.getBoundingClientRect(),S=s.current.offsetWidth;s.current.style.top=`${g.top+30}px`,s.current.style.left=`${g.left-S+30}px`}};return e("div",{css:Je,key:t.id},e("div",{css:je},e("div",{css:et},e("div",{css:tt},e("h4",{css:[rt,t.popoverData?G`
223
+ `;import{css as A}from"@emotion/react";var ut=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var f;let a=mt(null),i=mt(null),[l,g]=Jr(!1);jr(()=>{let s=h=>{a.current&&!a.current.contains(h.target)&&i.current&&!i.current.contains(h.target)&&g(!1)},p=()=>{g(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",s,!0),document.addEventListener("mousedown",s),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",s,!0),document.removeEventListener("mousedown",s)}},[i]);let u=()=>{var s;if(g(!l),i.current&&a.current){let p=(s=a==null?void 0:a.current)==null?void 0:s.getBoundingClientRect(),h=i.current.offsetWidth;i.current.style.top=`${p.top+30}px`,i.current.style.left=`${p.left-h+30}px`}};return e("div",{css:ot,key:t.id},e("div",{css:nt},e("div",{css:at},e("div",{css:it},e("h4",{css:[st,t.popoverData?A`
224
224
  margin-bottom: var(--spacing-sm);
225
- `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?e(zr.Fragment,null,e("button",{type:"button",ref:a,css:G`
225
+ `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?e(Yr.Fragment,null,e("button",{type:"button",ref:a,css:A`
226
226
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
227
- `,"aria-controls":"path-details","aria-expanded":p,onClick:u},e(Y,{width:24,height:24,css:G`
227
+ `,"aria-controls":"path-details","aria-expanded":l,onClick:u},e(W,{width:24,height:24,css:A`
228
228
  color: var(--gray-400);
229
- `})),e("div",{id:"path-details","aria-hidden":!p,ref:s,css:[at,p?G`
229
+ `})),e("div",{id:"path-details","aria-hidden":!l,ref:i,css:[lt,l?A`
230
230
  visibility: visible;
231
- `:G`
231
+ `:A`
232
232
  visibility: hidden;
233
- `]},Object.entries(t.popoverData).map(([i,g],S)=>e("div",{css:K,key:S},e("span",{css:ee},i,":"),g)))):null),t.createdDate&&e("div",{css:K},e("span",{css:ee},"Created:"),Or((v=t.createdDate)!=null?v:0)),t.metadata?Object.entries(t.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,g])=>e("div",{css:[K,G`
233
+ `]},Object.entries(t.popoverData).map(([s,p],h)=>e("div",{css:Z,key:h},e("span",{css:oe},s,":"),p)))):null),t.createdDate&&e("div",{css:Z},e("span",{css:oe},"Created:"),eo((f=t.createdDate)!=null?f:0)),t.metadata?Object.entries(t.metadata).filter(([s])=>["type","status"].includes(s.toLocaleLowerCase())).map(([s,p])=>e("div",{css:[Z,A`
234
234
  order: 1;
235
- `],key:i},e("span",{css:ee},i,":"),g)):null,t.metadata?Object.entries(t.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,g])=>e("div",{css:[K,G`
235
+ `],key:s},e("span",{css:oe},s,":"),p)):null,t.metadata?Object.entries(t.metadata).filter(([s])=>!["type","status"].includes(s.toLocaleLowerCase())).map(([s,p])=>e("div",{css:[Z,A`
236
236
  order: 1;
237
- `],key:i},e("span",{css:[ee,G`
237
+ `],key:s},e("span",{css:[oe,A`
238
238
  order: 1;
239
- `]},i,":"),g)):null),e("div",{css:it},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{r&&(qe(i.currentTarget.href,()=>r(t)),i.preventDefault())},css:ge},e("span",{css:K},"Edit"),e($,{src:n,css:ot,alt:"Logo"})):null,e("button",{type:"button",onClick:()=>{o(t)},css:ge},e("span",{css:K},"Unlink"),e(X,{css:[nt,G`
239
+ `]},s,":"),p)):null),e("div",{css:pt},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:s=>{r&&(ue(s.currentTarget.href,()=>r(t)),s.preventDefault())},css:ye},e("span",{css:Z},"Edit"),e(z,{src:n,css:ct,alt:"Logo"})):null,e("button",{type:"button",onClick:()=>{o(t)},css:ye},e("span",{css:Z},"Unlink"),e(Q,{css:[dt,A`
240
240
  color: var(--brand-secondary-5);
241
- `]})))))};import Br,{useState as Hr,useRef as gt,useEffect as $r}from"react";import{css as Q}from"@emotion/react";var dt=Q`
241
+ `]})))))};import to,{useState as ro,useRef as yt,useEffect as oo}from"react";import{css as X}from"@emotion/react";var gt=X`
242
242
  cursor: pointer;
243
243
  padding: var(--spacing-sm);
244
244
  position: relative;
245
245
  transition: background-color var(--duration-fast) var(--timing-ease-out),
246
246
  color var(--duration-fast) var(--timing-ease-out);
247
- `,lt=Q`
247
+ `,ft=X`
248
248
  padding-right: var(--spacing-lg);
249
- `,pt=Q`
249
+ `,vt=X`
250
250
  background: var(--brand-secondary-3);
251
251
  color: var(--white);
252
- `,fe=Q`
252
+ `,Se=X`
253
253
  font-size: var(--fs-xs);
254
- `,ve=Q`
254
+ `,we=X`
255
255
  font-weight: var(--fw-bold);
256
256
  margin-right: var(--spacing-sm);
257
- `,ut=Q`
257
+ `,ht=X`
258
258
  background: var(--white);
259
259
  border-left: 4px solid var(--brand-secondary-3);
260
260
  border-radius: var(--rounded-base);
@@ -266,20 +266,20 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
266
266
  right: var(--spacing-xl);
267
267
  z-index: var(--z-10);
268
268
  width: max-content;
269
- `,mt=Q`
269
+ `,bt=X`
270
270
  position: absolute;
271
271
  inset: 0 var(--spacing-sm) 0 auto;
272
- `;import{css as ft}from"@emotion/react";var vt=({result:t,isSelected:n,triggerSelection:o})=>{let r=gt(null),a=gt(null),[s,p]=Hr(!1);$r(()=>{function u(v){r.current&&!r.current.contains(v.target)&&a.current&&!a.current.contains(v.target)&&p(!1)}return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[a]);let f=u=>{u.stopPropagation(),p(!s)};return e("div",{key:t.id,css:[dt,n?pt:void 0,t.popoverData?lt:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?e(Br.Fragment,null,e("button",{type:"button",ref:r,css:mt,"aria-controls":"path-details",onClick:u=>f(u),"aria-expanded":s},e(Y,{width:24,height:24})),e("div",{id:"path-details","aria-hidden":!s,ref:a,css:[ut,s?ft`
272
+ `;import{css as St}from"@emotion/react";var wt=({result:t,isSelected:n,triggerSelection:o})=>{let r=yt(null),a=yt(null),[i,l]=ro(!1);oo(()=>{function u(f){r.current&&!r.current.contains(f.target)&&a.current&&!a.current.contains(f.target)&&l(!1)}return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[a]);let g=u=>{u.stopPropagation(),l(!i)};return e("div",{key:t.id,css:[gt,n?vt:void 0,t.popoverData?ft:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?e(to.Fragment,null,e("button",{type:"button",ref:r,css:bt,"aria-controls":"path-details",onClick:u=>g(u),"aria-expanded":i},e(W,{width:24,height:24})),e("div",{id:"path-details","aria-hidden":!i,ref:a,css:[ht,i?St`
273
273
  visibility: visible;
274
- `:ft`
274
+ `:St`
275
275
  visibility: hidden;
276
- `]},t.metadata&&Object.entries(t.metadata).map(([u,v],i)=>e("div",{css:fe,key:i},e("span",{css:ve},u,":"),v)),Object.entries(t.popoverData).map(([u,v],i)=>e("div",{css:fe,key:i},e("span",{css:ve},u,":"),v)))):null)};import{Droppable as Wr,DragDropContext as _r,Draggable as Zr}from"react-beautiful-dnd";import{css as w}from"@emotion/react";var ht=w`
276
+ `]},t.metadata&&Object.entries(t.metadata).map(([u,f],s)=>e("div",{css:Se,key:s},e("span",{css:we},u,":"),f)),Object.entries(t.popoverData).map(([u,f],s)=>e("div",{css:Se,key:s},e("span",{css:we},u,":"),f)))):null)};import{Droppable as co,DragDropContext as lo,Draggable as po}from"react-beautiful-dnd";import{css as w}from"@emotion/react";var Ct=w`
277
277
  background: var(--white);
278
278
  border: 1px solid var(--gray-300);
279
279
  border-radius: var(--rounded-base);
280
280
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
281
281
  margin-bottom: var(--spacing-base);
282
- `,yt=w`
282
+ `,Pt=w`
283
283
  align-items: center;
284
284
  display: flex;
285
285
  position: relative;
@@ -287,7 +287,7 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
287
287
  width: 100%;
288
288
  background-color: transparent;
289
289
  border: 0;
290
- `,bt=w`
290
+ `,Rt=w`
291
291
  color: var(--brand-secondary-1);
292
292
  display: block;
293
293
  font-weight: var(--fw-bold);
@@ -303,15 +303,15 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
303
303
  background: var(--gray-100);
304
304
  outline: none;
305
305
  }
306
- `,St=w`
306
+ `,Lt=w`
307
307
  background: var(--white);
308
308
  border: 1px solid var(--gray-300);
309
309
  border-radius: var(--rounded-base);
310
310
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
311
311
  display: block;
312
- `,wt=w`
312
+ `,kt=w`
313
313
  display: none;
314
- `,Ct=w`
314
+ `,xt=w`
315
315
  overflow-y: auto;
316
316
  height: 16rem;
317
317
  margin-bottom: var(--spacing-base);
@@ -320,170 +320,170 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
320
320
  & > :not(:last-child) {
321
321
  border-bottom: 1px solid var(--gray-200);
322
322
  }
323
- `,ra=w`
323
+ `,Ra=w`
324
324
  background-color: var(--gray-50);
325
325
  max-width: 33.33%;
326
- `,Pt=w`
326
+ `,It=w`
327
327
  align-items: center;
328
328
  display: flex;
329
329
  position: absolute;
330
330
  inset: 0 0 0 auto;
331
331
  pointer-events: none;
332
332
  padding-right: var(--spacing-sm);
333
- `,Rt=w`
333
+ `,Et=w`
334
334
  color: var(--brand-secondary-1);
335
335
  width: 1.25rem;
336
336
  height: 1.25rem;
337
337
  transition: transform var(--duration-fast) var(--timing-ease-out);
338
338
  transform: rotate(0);
339
- `,oa=w`
339
+ `,La=w`
340
340
  background: var(--white);
341
341
  color: var(--brand-secondary-1);
342
- `,Lt=w`
342
+ `,Mt=w`
343
343
  position: relative;
344
344
  margin-block: var(--spacing-sm) 0;
345
345
 
346
346
  &:hover > span {
347
347
  opacity: 0.3;
348
348
  }
349
- `,kt=w`
349
+ `,Tt=w`
350
350
  align-items: center;
351
351
  display: flex;
352
352
  position: absolute;
353
353
  inset: 0 auto 0 0;
354
354
  margin-block: auto;
355
355
  opacity: 0;
356
- `,he=w`
356
+ `,Ce=w`
357
357
  color: var(--brand-secondary-1);
358
- `,xt=w`
358
+ `,Vt=w`
359
359
  position: absolute;
360
360
  left: 0.375rem;
361
- `,ye=w`
361
+ `,Pe=w`
362
362
  width: calc(var(--spacing-lg) + var(--spacing-xs));
363
363
  height: calc(var(--spacing-lg) + var(--spacing-xs));
364
- `;import{css as I}from"@emotion/react";import{InputSelect as Xr,scrollbarStyles as Yr,Button as be,Callout as qr,InputKeywordSearch as Jr,LoadingIndicator as jr,Menu as eo,MenuItem as to,LoadingOverlay as ro}from"@uniformdev/design-system";import{useState as Fr,useEffect as Et,useRef as Kr}from"react";function Mt(t,{delay:n=500,minDuration:o=200}={delay:500,minDuration:200}){let[r,a]=Fr("IDLE"),s=Kr(void 0);return Et(()=>{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]),Et(()=>()=>clearTimeout(s.current),[]),r==="DISPLAY"||r==="EXPIRE"}var oo=({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}'.`),e(qr,{type:"info"},o)},Vt=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:a,select:s,multiSelect:p,multiSelectId:f,rowComponent:u,selectedItemComponent:v,totalResults:i,resultsLoading:g,requireContentType:S,onAddNew:W,onEditClosed:z,onCancel:b,noResultsComponent:h,helpComponent:_,onSort:A,typeSelectorLabel:F="Content Type Select",typeSelectorAllTypesOptionText:U="All content types",loadingIndicatorDelay:O=1e3})=>{var Le,ke,xe;let Z=()=>S?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[B,C]=x.useState(""),[l,M]=x.useState(Z),[D,d]=x.useState(!1),[y,T]=x.useState([]),[Nt,we]=x.useState(!1),ue=x.useRef(`x${Nr()}`),re=Qr(B,750);x.useEffect(()=>{t(re,{count:5,offset:0,contentType:l==="any"?void 0:l})},[re,l]);let Wt=Mt(g,{delay:O}),_t=c=>{y.some(m=>m.id===c.id)?T(m=>m.filter(H=>H.id!==c.id)):T(p?m=>[...m,c]:[c])},Zt=r==null?void 0:r.map(c=>c.id+c.title).join(",");x.useEffect(()=>{Array.isArray(r)&&T(r)},[Zt]);let Xt=()=>{M(Z()),C(""),T(r!=null&&r.length?r:[])},Yt=()=>{d(c=>!c),D||Xt()},Ce=c=>{let m=(y==null?void 0:y.filter(H=>H.id!==c.id))||[];T(m),s(m,"")},qt=c=>{c.preventDefault(),s(y,l),d(!1)},Jt=c=>{c.preventDefault(),d(!1),b&&b()},jt=()=>{t(re,{count:5,offset:(n==null?void 0:n.length)||0,contentType:l==="any"?void 0:l}),we(!0);let c=setTimeout(()=>{we(!1)},750);return()=>clearTimeout(c)},er=!(r==null?void 0:r.length)||p,tr=u||vt,Pe=v||ct,rr=h||oo,Re=a&&typeof a!="string"?a:null,or=Re?e(Re,{css:ye}):e("img",{src:a,alt:"Logo",css:ye}),nr=c=>{var m,H;if(c.destination&&c.source.droppableId===((m=c.destination)==null?void 0:m.droppableId)){let L=[...r||[]],[q]=(H=L==null?void 0:L.splice(c.source.index,1))!=null?H:[];return L==null||L.splice(c.destination.index,0,q),A&&(T(L),A==null||A(L)),L}};return e("div",{css:I`
364
+ `;import{css as U}from"@emotion/react";import{InputSelect as mo,scrollbarStyles as uo,Button as Re,Callout as go,InputKeywordSearch as fo,LoadingIndicator as vo,Menu as ho,MenuItem as bo,LoadingOverlay as yo}from"@uniformdev/design-system";import{useState as no,useEffect as Dt,useRef as ao}from"react";function zt(t,{delay:n=500,minDuration:o=200}={delay:500,minDuration:200}){let[r,a]=no("IDLE"),i=ao(void 0);return Dt(()=>{t&&r==="IDLE"&&(clearTimeout(i.current),i.current=setTimeout(()=>{if(!t)return a("IDLE");i.current=setTimeout(()=>{a("EXPIRE")},o),a("DISPLAY")},n),a("DELAY")),!t&&r!=="DISPLAY"&&(clearTimeout(i.current),a("IDLE"))},[t,r,n,o]),Dt(()=>()=>clearTimeout(i.current),[]),r==="DISPLAY"||r==="EXPIRE"}var So=({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}'.`),e(go,{type:"info"},o)},Ut=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:a,select:i,multiSelect:l,multiSelectId:g,rowComponent:u,selectedItemComponent:f,totalResults:s,resultsLoading:p,requireContentType:h,onAddNew:V,onEditClosed:O,onCancel:S,noResultsComponent:b,helpComponent:Y,onSort:H,typeSelectorLabel:_="Content Type Select",typeSelectorAllTypesOptionText:$="All content types",loadingIndicatorDelay:F=1e3})=>{var Te,Ve,De;let J=()=>h?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[K,C]=x.useState(""),[m,M]=x.useState(J),[G,d]=x.useState(!1),[y,D]=x.useState([]),[sr,xe]=x.useState(!1),he=x.useRef(`x${so()}`),ae=io(K,750);x.useEffect(()=>{t(ae,{count:5,offset:0,contentType:m==="any"?void 0:m})},[ae,m]);let cr=zt(p,{delay:F}),dr=c=>{y.some(v=>v.id===c.id)?D(v=>v.filter(N=>N.id!==c.id)):D(l?v=>[...v,c]:[c])},lr=r==null?void 0:r.map(c=>c.id+c.title).join(",");x.useEffect(()=>{Array.isArray(r)&&D(r)},[lr]);let pr=()=>{M(J()),C(""),D(r!=null&&r.length?r:[])},mr=()=>{d(c=>!c),G||pr()},Ie=c=>{let v=(y==null?void 0:y.filter(N=>N.id!==c.id))||[];D(v),i(v,"")},ur=c=>{c.preventDefault(),i(y,m),d(!1)},gr=c=>{c.preventDefault(),d(!1),S&&S()},fr=()=>{t(ae,{count:5,offset:(n==null?void 0:n.length)||0,contentType:m==="any"?void 0:m}),xe(!0);let c=setTimeout(()=>{xe(!1)},750);return()=>clearTimeout(c)},vr=!(r==null?void 0:r.length)||l,hr=u||wt,Ee=f||ut,br=b||So,Me=a&&typeof a!="string"?a:null,yr=Me?e(Me,{css:Pe}):e("img",{src:a,alt:"Logo",css:Pe}),Sr=c=>{var v,N;if(c.destination&&c.source.droppableId===((v=c.destination)==null?void 0:v.droppableId)){let k=[...r||[]],[ee]=(N=k==null?void 0:k.splice(c.source.index,1))!=null?N:[];return k==null||k.splice(c.destination.index,0,ee),H&&(D(k),H==null||H(k)),k}};return e("div",{css:U`
365
365
  width: 100%;
366
- `},e("div",{css:I`
366
+ `},e("div",{css:U`
367
367
  position: relative;
368
368
  margin-block: var(--spacing-base);
369
- `},er?e(x.Fragment,null,e("div",{css:ht,"data-test-id":"component-search"},e("button",{css:yt,onClick:Yt,type:"button","aria-haspopup":!0,"aria-expanded":D,"aria-controls":`entry-search-config-${ue.current}`},or,e("span",{css:I`
369
+ `},vr?e(x.Fragment,null,e("div",{css:Ct,"data-test-id":"component-search"},e("button",{css:Pt,onClick:mr,type:"button","aria-haspopup":!0,"aria-expanded":G,"aria-controls":`entry-search-config-${he.current}`},yr,e("span",{css:U`
370
370
  margin-left: var(--spacing-base);
371
- `},"Select"),e("span",{css:Pt},e(de,{css:[Rt,D?I`
371
+ `},"Select"),e("span",{css:It},e(me,{css:[Et,G?U`
372
372
  transform: rotate(180deg);
373
- `:void 0]})))),e("div",{id:`entry-search-config-${ue.current}`,"aria-hidden":!D,css:[St,D?void 0:wt]},_||null,e("div",{css:I`
373
+ `:void 0]})))),e("div",{id:`entry-search-config-${he.current}`,"aria-hidden":!G,css:[Lt,G?void 0:kt]},Y||null,e("div",{css:U`
374
374
  display: flex;
375
375
  gap: calc(var(--spacing-base) - 0.25rem);
376
376
  margin-bottom: var(--spacing-base);
377
- `},e(Xr,{onChange:c=>M(c.target.value),value:l,label:F,showLabel:!1,options:[...S?[]:[{value:"any",label:U}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),e("div",{css:I`
377
+ `},e(mo,{onChange:c=>M(c.target.value),value:m,label:_,showLabel:!1,options:[...h?[]:[{value:"any",label:$}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),e("div",{css:U`
378
378
  flex-grow: 1;
379
- `},e(Jr,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:C,disabledFieldSubmission:!0,value:B}))),e("div",{css:[Ct,Yr],id:ue.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},e(ro,{isActive:Wt}),Array.isArray(n)&&n.length>0?n.map(c=>e(tr,{key:c.id,isSelected:y.some(m=>m.id===c.id),result:c,triggerSelection:()=>_t(c)})):e(rr,{searchText:re||B,selectedContentType:(ke=(Le=o==null?void 0:o.find(c=>c.id===l))==null?void 0:Le.name)!=null?ke:l}),!g&&typeof i!="undefined"&&n&&(n==null?void 0:n.length)<i&&e("button",{type:"button",css:bt,onClick:jt},Nt?e(jr,null):"Load More")),e("div",{css:I`
379
+ `},e(fo,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:C,disabledFieldSubmission:!0,value:K}))),e("div",{css:[xt,uo],id:he.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},e(yo,{isActive:cr}),Array.isArray(n)&&n.length>0?n.map(c=>e(hr,{key:c.id,isSelected:y.some(v=>v.id===c.id),result:c,triggerSelection:()=>dr(c)})):e(br,{searchText:ae||K,selectedContentType:(Ve=(Te=o==null?void 0:o.find(c=>c.id===m))==null?void 0:Te.name)!=null?Ve:m}),!p&&typeof s!="undefined"&&n&&(n==null?void 0:n.length)<s&&e("button",{type:"button",css:Rt,onClick:fr},sr?e(vo,null):"Load More")),e("div",{css:U`
380
380
  display: flex;
381
381
  justify-content: space-between;
382
- `},e("div",null,W&&((xe=o==null?void 0:o.length)!=null?xe:0)>0?e(eo,{menuLabel:"Add new menu",menuTrigger:e(be,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(c=>e(to,{key:c.id,css:I`
382
+ `},e("div",null,V&&((De=o==null?void 0:o.length)!=null?De:0)>0?e(ho,{menuLabel:"Add new menu",menuTrigger:e(Re,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(c=>e(bo,{key:c.id,css:U`
383
383
  background: var(--white);
384
384
  color: var(--brand-secondary-1);
385
- `,onClick:()=>W(c)},c.name))):null),e("div",{css:I`
385
+ `,onClick:()=>V(c)},c.name))):null),e("div",{css:U`
386
386
  display: flex;
387
387
  gap: var(--spacing-base);
388
- `},e(be,{buttonType:"unimportant",onClick:Jt},"Cancel"),e(be,{disabled:!y.length,onClick:qt,"data-test-id":"entry-accept-button"},"Accept"))))):null,D?null:p?e(_r,{onDragEnd:c=>nr(c)},e(Wr,{droppableId:f||"canvas-multi-select"},c=>e("div",{...c.droppableProps,ref:c.innerRef,css:I`
388
+ `},e(Re,{buttonType:"unimportant",onClick:gr},"Cancel"),e(Re,{disabled:!y.length,onClick:ur,"data-test-id":"entry-accept-button"},"Accept"))))):null,G?null:l?e(lo,{onDragEnd:c=>Sr(c)},e(co,{droppableId:g||"canvas-multi-select"},c=>e("div",{...c.droppableProps,ref:c.innerRef,css:U`
389
389
  margin-block: var(--spacing-sm) 0;
390
- `},y==null?void 0:y.map((m,H)=>{if(m!=null&&m.id)return e(Zr,{key:m.id,draggableId:m.id,index:H},L=>e("div",{css:Lt,ref:L.innerRef,...L.draggableProps,...L.dragHandleProps},e("span",{css:kt},e(j,{css:[he,xt],width:24,height:24}),e(j,{css:he,width:24,height:24})),e(Pe,{key:`selected-item-${m.id}`,logoIcon:a,selectedItem:m,onDeselect:q=>Ce(q),onEditClosed:z?q=>z(q):void 0})))}),c.placeholder))):y==null?void 0:y.map(c=>e(Pe,{key:`selected-item-${c.id}`,logoIcon:a,selectedItem:c,onDeselect:m=>Ce(m),onEditClosed:z?m=>z(m):void 0}))))};import{css as N}from"@emotion/react";var Tt=N`
390
+ `},y==null?void 0:y.map((v,N)=>{if(v!=null&&v.id)return e(po,{key:v.id,draggableId:v.id,index:N},k=>e("div",{css:Mt,ref:k.innerRef,...k.draggableProps,...k.dragHandleProps},e("span",{css:Tt},e(re,{css:[Ce,Vt],width:24,height:24}),e(re,{css:Ce,width:24,height:24})),e(Ee,{key:`selected-item-${v.id}`,logoIcon:a,selectedItem:v,onDeselect:ee=>Ie(ee),onEditClosed:O?ee=>O(ee):void 0})))}),c.placeholder))):y==null?void 0:y.map(c=>e(Ee,{key:`selected-item-${c.id}`,logoIcon:a,selectedItem:c,onDeselect:v=>Ie(v),onEditClosed:O?v=>O(v):void 0}))))};import{css as q}from"@emotion/react";var Gt=q`
391
391
  cursor: pointer;
392
392
  padding: var(--spacing-sm) 0;
393
393
  margin-right: var(--spacing-sm);
394
394
  position: relative;
395
395
  transition: background-color var(--duration-fast) var(--timing-ease-out),
396
396
  color var(--duration-fast) var(--timing-ease-out);
397
- `,It=N`
397
+ `,At=q`
398
398
  border: 2px solid transparent;
399
399
  border-radius: var(--rounded-base);
400
400
  display: flex;
401
401
  align-items: center;
402
402
  gap: var(--spacing-base);
403
403
  padding: var(--spacing-sm) var(--spacing-xs);
404
- `,Dt=N`
404
+ `,Bt=q`
405
405
  background-color: var(--green-50);
406
- `,Gt=N`
406
+ `,Ot=q`
407
407
  font-size: var(--fs-sm);
408
408
  font-weight: var(--fw-bold);
409
409
  width: 50%;
410
- `,zt=N`
410
+ `,Ht=q`
411
411
  font-weight: var(--fw-normal);
412
412
  display: block;
413
- `,At=N`
413
+ `,$t=q`
414
414
  font-size: var(--fs-sm);
415
415
  > * {
416
416
  display: block;
417
417
  }
418
- `,Ut=N`
418
+ `,Ft=q`
419
419
  display: block;
420
420
  height: 1.5rem;
421
421
  width: 1.5rem;
422
422
  color: var(--brand-secondary-3);
423
423
  margin-left: auto;
424
- `;import{css as Ot}from"@emotion/react";function Bt({result:t,isSelected:n,triggerSelection:o}){var f;let{categories:r,logoIcon:a}=le(),[s]=t.categories||[{id:"",name:""}],p=typeof s=="undefined"||!r||(f=r.find(u=>u.id===s.id))==null?void 0:f.name;return e("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Tt]},e("div",{css:[It,n?Dt:void 0]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:Ot`
424
+ `;import{css as Kt}from"@emotion/react";function Nt({result:t,isSelected:n,triggerSelection:o}){var g;let{categories:r,logoIcon:a}=ge(),[i]=t.categories||[{id:"",name:""}],l=typeof i=="undefined"||!r||(g=r.find(u=>u.id===i.id))==null?void 0:g.name;return e("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Gt]},e("div",{css:[At,n?Bt:void 0]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:Kt`
425
425
  background-color: var(--gray-200);
426
426
  width: 3rem;
427
427
  height: 3rem;
428
428
  object-fit: cover;
429
- `}):e($,{src:a,alt:"Logo",css:Ot`
429
+ `}):e(z,{src:a,alt:"Logo",css:Kt`
430
430
  height: 2.25rem;
431
431
  width: 2.25rem;
432
- `}),e("h4",{css:[Gt]},t.title,p?e("span",{css:[zt]},p):null),e("p",{css:[At]},"SKU: ",t.sku||t.id,t.price!==void 0?e("span",null,t.price):null),n?e(ce,{css:[Ut]}):null))}import{css as pe}from"@emotion/react";import{mq as no}from"@uniformdev/design-system";var Ht=pe`
432
+ `}),e("h4",{css:[Ot]},t.title,l?e("span",{css:[Ht]},l):null),e("p",{css:[$t]},"SKU: ",t.sku||t.id,t.price!==void 0?e("span",null,t.price):null),n?e(pe,{css:[Ft]}):null))}import{css as fe}from"@emotion/react";import{mq as wo}from"@uniformdev/design-system";var Qt=fe`
433
433
  display: flex;
434
434
  width: 100%;
435
435
  border: 1px solid var(--gray-300);
436
436
  border-radius: var(--rounded-base);
437
437
  background-color: var(--gray-100);
438
438
  margin: var(--spacing-base) 0;
439
- `,$t=pe`
439
+ `,Wt=fe`
440
440
  padding: var(--spacing-base) 0 var(--spacing-base) var(--spacing-lg);
441
441
  display: flex;
442
442
  flex-grow: 1;
443
443
  align-items: center;
444
444
  margin-right: var(--spacing-sm);
445
445
  gap: var(--spacing-base);
446
- `,Ft=pe`
446
+ `,_t=fe`
447
447
  display: flex;
448
448
  align-items: center;
449
449
  gap: var(--spacing-sm);
450
- ${no("lg")} {
450
+ ${wo("lg")} {
451
451
  width: 50%;
452
452
  margin-bottom: 0;
453
453
  }
454
- `,Se=pe`
454
+ `,Le=fe`
455
455
  background-color: var(--gray-200);
456
456
  width: 3.5rem;
457
457
  height: 3.5rem;
458
458
  object-fit: cover;
459
- `;import{css as E}from"@emotion/react";import{mq as ao}from"@uniformdev/design-system";function Kt({selectedItem:t,onDeselect:n}){var p;let{categories:o,logoIcon:r}=le(),[a]=t.categories||[{id:"",name:""}],s=typeof a=="undefined"||!o||(p=o.find(f=>f.id===a.id))==null?void 0:p.name;return e("div",{css:[Ht],key:t.id},e("article",{css:[$t]},e("div",{css:[Ft]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:s,css:[Se],loading:"lazy"}):e("div",{css:[Se]}),e("div",{css:E`
459
+ `;import{css as I}from"@emotion/react";import{mq as Co}from"@uniformdev/design-system";function Zt({selectedItem:t,onDeselect:n}){var l;let{categories:o,logoIcon:r}=ge(),[a]=t.categories||[{id:"",name:""}],i=typeof a=="undefined"||!o||(l=o.find(g=>g.id===a.id))==null?void 0:l.name;return e("div",{css:[Qt],key:t.id},e("article",{css:[Wt]},e("div",{css:[_t]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:i,css:[Le],loading:"lazy"}):e("div",{css:[Le]}),e("div",{css:I`
460
460
  > :not(:last-child) {
461
461
  margin-bottom: var(--spacing-xs);
462
462
  }
463
- `},e("h4",{css:E`
463
+ `},e("h4",{css:I`
464
464
  margin-top: 0px;
465
465
  font-weight: var(--fw-bold);
466
- `},t.title||t.id||"",s&&e("span",{css:E`
466
+ `},t.title||t.id||"",i&&e("span",{css:I`
467
467
  display: block;
468
468
  font-weight: var(--fw-regular);
469
- `},s)),e("ul",{css:E`
469
+ `},i)),e("ul",{css:I`
470
470
  font-size: var(--fs-sm);
471
471
  display: flex;
472
472
  gap: var(--spacing-base);
473
- `},e("li",null,e("span",{css:E`
473
+ `},e("li",null,e("span",{css:I`
474
474
  margin-right: var(--spacing-xs);
475
- `},"SKU:"),t.sku||t.id),t.price!==void 0?e("li",null,e("span",{css:E`
475
+ `},"SKU:"),t.sku||t.id),t.price!==void 0?e("li",null,e("span",{css:I`
476
476
  margin-right: var(--spacing-xs);
477
- `},"Price:"),e("span",null,t.price)):null))),e("div",{css:E`
477
+ `},"Price:"),e("span",null,t.price)):null))),e("div",{css:I`
478
478
  display: flex;
479
479
  flex-wrap: wrap;
480
480
  gap: var(--spacing-sm);
481
481
  justify-content: flex-end;
482
482
  margin-left: auto;
483
- ${ao("md")} {
483
+ ${Co("md")} {
484
484
  align-items: center;
485
485
  }
486
- `},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:E`
486
+ `},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:I`
487
487
  display: inline-flex;
488
488
  justify-content: space-between;
489
489
  align-items: center;
@@ -494,14 +494,14 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
494
494
  &:hover {
495
495
  background-color: var(--gray-100);
496
496
  }
497
- `},e("span",{css:E`
497
+ `},e("span",{css:I`
498
498
  margin-right: var(--spacing-sm);
499
499
  font-size: var(--fs-sm);
500
- `},"Edit"),e($,{src:r,alt:"Logo",css:E`
500
+ `},"Edit"),e(z,{src:r,alt:"Logo",css:I`
501
501
  width: 1.75rem;
502
502
  height: 1.75rem;
503
503
  display: block;
504
- `})):null,e("button",{type:"button",onClick:()=>{n==null||n(t)},css:E`
504
+ `})):null,e("button",{type:"button",onClick:()=>{n==null||n(t)},css:I`
505
505
  display: flex;
506
506
  justify-content: space-between;
507
507
  align-items: center;
@@ -514,8 +514,101 @@ var ar=Object.defineProperty;var ir=(t,n)=>{for(var o in n)ar(t,o,{get:n[o],enum
514
514
  &:hover {
515
515
  background-color: var(--gray-100);
516
516
  }
517
- `},e("span",{css:E`
517
+ `},e("span",{css:I`
518
518
  font-size: var(--fs-sm);
519
- `},"Unlink"),e(X,{css:E`
519
+ `},"Unlink"),e(Q,{css:I`
520
520
  color: var(--brand-secondary-5);
521
- `})))))}import{Callout as po}from"@uniformdev/design-system";import{useAsync as uo,useAsyncFn as mo}from"react-use";function Za({selectedProducts:t,setSelectedProducts:n,onGetCategories:o,onSearchProducts:r,logoIcon:a,multiSelect:s,multiSelectId:p,selectedItemComponent:f,rowComponent:u,errorComponent:v,helpComponent:i,noResultsComponent:g,onSort:S,typeSelectorAllTypesOptionText:W="All categories",typeSelectorLabel:z="Select Category"}){var B;let{value:b,loading:h,error:_}=uo(async()=>await o(),[o]),A=b==null?void 0:b.map(C=>C.id).join(","),F=co(()=>b?b.map(l=>({id:l.id,name:l.name})):void 0,[A]),U=lo(),[O,te]=mo(async(C,l)=>{let M=await r({text:C,options:{limit:l==null?void 0:l.count,offset:l==null?void 0:l.offset,categoryId:l==null?void 0:l.contentType}});return(l==null?void 0:l.offset)===0&&(U.current=[]),(U.current=U.current||[]).push(...M.products),M},[r]),Z=async C=>{await n(C)};return _||O.error?e(v||(({categoriesError:l,searchError:M})=>e(po,{type:"error"},"There was an error: ",(l==null?void 0:l.message)||(M==null?void 0:M.message))),{categoriesError:_,searchError:O.error}):e(Qt.Provider,{value:{categories:b,logoIcon:a}},e(Vt,{search:te,results:U.current,logoIcon:a,selectedItems:t,select:Z,multiSelectId:p||"product-search-multi-select",multiSelect:s,contentTypes:F,selectedItemComponent:f||Kt,rowComponent:u||Bt,totalResults:(B=O.value)==null?void 0:B.total,resultsLoading:O.loading||h,helpComponent:i,noResultsComponent:g,onSort:S,typeSelectorAllTypesOptionText:W,typeSelectorLabel:z}))}var Qt=io.createContext(void 0),le=()=>{let t=so(Qt);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};export*from"@uniformdev/mesh-sdk";import{Button as oi,Callout as ni,LoadingIndicator as ai,LoadingOverlay as ii,Menu as si,MenuItem as ci,Input as di,InputSelect as li,InputToggle as pi,Theme as ui,InputKeywordSearch as mi,Heading as gi,ScrollableList as fi,ScrollableListItem as vi,Textarea as hi,Switch as yi,Label as bi}from"@uniformdev/design-system";export{oi as Button,ni as Callout,vt as DefaultSearchRow,ct as DefaultSelectedItem,Vt as EntrySearch,gi as Heading,me as Icons,di as Input,li as InputSelect,pi as InputToggle,mi as KeywordSearchInput,bi as Label,ai as LoadingIndicator,ii as LoadingOverlay,si as Menu,ci as MenuItem,Ke as ProductPreviewList,rn as ProductQuery,$e as ProductQueryContext,Za as ProductSearch,Qt as ProductSearchContext,Bt as ProductSearchRow,Kt as ProductSelectedItem,ze as ResolvableLoadingValue,fi as ScrollableList,vi as ScrollableListItem,Ae as SelectionField,yi as Switch,hi as Textarea,ui as Theme,Ee as UniformMeshLocationContext,Me as UniformMeshLocationContextProvider,Ie as UniformMeshSdkContext,Do as UniformMeshSdkContextProvider,ye as badgeIcon,Lt as draggableContainer,he as draggableIcon,xt as draggableIconOffset,kt as draggableIconWrapper,yt as entrySearchBtn,St as entrySearchConfig,wt as entrySearchConfigHidden,bt as entrySearchLoadMoreBtn,Ct as entrySearchResultList,Pt as entrySearchSelectIcon,Rt as entrySearchSelectImg,ra as entrySearchSelectInput,oa as entrySearchSelectOption,ht as entrySearchWrapper,Ut as productSearchRowActiveIcon,zt as productSearchRowCategory,Tt as productSearchRowContainer,It as productSearchRowContent,Dt as productSearchRowContentActive,At as productSearchRowDetails,Gt as productSearchRowTitle,Ht as productSelectedItemContainer,Ft as productSelectedItemContent,$t as productSelectedItemDetails,Se as productSelectedItemImage,mt as searchRowBtn,dt as searchRowContainer,pt as searchRowContainerActive,lt as searchRowContainerWithPopover,ut as searchRowPopover,ve as searchRowText,fe as searchRowTextSmall,ge as selectItemLinkBtn,it as selectItemLinkContainer,at as selectItemPopover,ee as selectItemPopoverLabel,K as selectItemSmallText,nt as selectedItemCloseIcon,Je as selectedItemContainer,tt as selectedItemCopy,et as selectedItemDetails,ot as selectedItemIcon,je as selectedItemInner,rt as selectedItemTitle,xo as useInitializeUniformMeshSdk,Fe as useProductQueryContext,le as useProductSearchContext,Co as useUniformMeshLocation,Ve as useUniformMeshLocationContext,Ao as useUniformMeshSdk,De as useUniformMeshSdkContext};
521
+ `})))))}import{Callout as xo}from"@uniformdev/design-system";import{useAsync as Io,useAsyncFn as Eo}from"react-use";function vi({selectedProducts:t,setSelectedProducts:n,onGetCategories:o,onSearchProducts:r,logoIcon:a,multiSelect:i,multiSelectId:l,selectedItemComponent:g,rowComponent:u,errorComponent:f,helpComponent:s,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:V="All categories",typeSelectorLabel:O="Select Category"}){var K;let{value:S,loading:b,error:Y}=Io(async()=>await o(),[o]),H=S==null?void 0:S.map(C=>C.id).join(","),_=Lo(()=>S?S.map(m=>({id:m.id,name:m.name})):void 0,[H]),$=ko(),[F,ne]=Eo(async(C,m)=>{let M=await r({text:C,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&&($.current=[]),($.current=$.current||[]).push(...M.products),M},[r]),J=async C=>{await n(C)};return Y||F.error?e(f||(({categoriesError:m,searchError:M})=>e(xo,{type:"error"},"There was an error: ",(m==null?void 0:m.message)||(M==null?void 0:M.message))),{categoriesError:Y,searchError:F.error}):e(Xt.Provider,{value:{categories:S,logoIcon:a}},e(Ut,{search:ne,results:$.current,logoIcon:a,selectedItems:t,select:J,multiSelectId:l||"product-search-multi-select",multiSelect:i,contentTypes:_,selectedItemComponent:g||Zt,rowComponent:u||Nt,totalResults:(K=F.value)==null?void 0:K.total,resultsLoading:F.loading||b,helpComponent:s,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:V,typeSelectorLabel:O}))}var Xt=Po.createContext(void 0),ge=()=>{let t=Ro(Xt);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};import{css as E}from"@emotion/react";import{mq as Mo}from"@uniformdev/design-system";var qt=E`
522
+ border: 1px solid var(--gray-200);
523
+ background: var(--gray-50);
524
+ border-radius: var(--rounded-base);
525
+ display: flex;
526
+ width: 100%;
527
+ `,Yt=E`
528
+ align-items: center;
529
+ display: flex;
530
+ flex-grow: 1;
531
+ gap: var(--spacing-sm);
532
+ margin-inline: 0 var(--spacing-sm);
533
+ padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
534
+ position: relative;
535
+ `,Jt=E`
536
+ flex-grow: 1;
537
+ `,jt=E`
538
+ align-items: center;
539
+ display: flex;
540
+ position: relative;
541
+ `,er=E`
542
+ color: var(--brand-secondary-1);
543
+ font-size: var(--fs-base);
544
+ font-weight: var(--fw-bold);
545
+ line-height: 1;
546
+ margin: 0;
547
+ `,tr=E`
548
+ width: 1.5rem;
549
+ height: 1.5rem;
550
+ `,rr=E`
551
+ width: 1rem;
552
+ height: 1rem;
553
+ `,or=E`
554
+ background: var(--white);
555
+ border-radius: var(--rounded-base);
556
+ border-left: 4px solid var(--brand-secondary-3);
557
+ box-shadow: var(--shadow-base);
558
+ position: fixed;
559
+ padding: var(--spacing-base);
560
+ z-index: var(--z-10);
561
+ width: max-content;
562
+ `,j=E`
563
+ font-size: var(--fs-sm);
564
+ `,ve=E`
565
+ font-weight: var(--fw-bold);
566
+ margin-right: var(--spacing-sm);
567
+ `,nr=E`
568
+ display: flex;
569
+ flex-direction: column;
570
+ gap: var(--spacing-sm);
571
+
572
+ ${Mo("md")} {
573
+ flex-direction: row;
574
+ justify-content: end;
575
+ min-width: 200px;
576
+ }
577
+ `,ke=E`
578
+ align-items: center;
579
+ background: var(--white);
580
+ border-radius: var(--rounded-base);
581
+ border: 2px solid var(--gray-300);
582
+ display: flex;
583
+ gap: var(--spacing-sm);
584
+ padding: var(--spacing-sm) var(--spacing-base);
585
+ justify-content: space-between;
586
+
587
+ &:hover {
588
+ background: var(--gray-50);
589
+ }
590
+ `,ar=E`
591
+ display: flex;
592
+ margin-top: var(--spacing-sm);
593
+ `;import To,{useState as Vo,useRef as ir,useEffect as Do}from"react";import{format as zo}from"timeago.js";import{css as B}from"@emotion/react";function Ii({selectedItem:t,onDeselect:n,onEditClosed:o,logoIcon:r,itemDetailsRendererComponent:a}){let i=ir(null),l=ir(null),[g,u]=Vo(!1);Do(()=>{let p=V=>{i.current&&!i.current.contains(V.target)&&l.current&&!l.current.contains(V.target)&&u(!1)},h=()=>{u(!1)};return window.addEventListener("resize",h,!0),document.addEventListener("scroll",p,!0),document.addEventListener("mousedown",p),()=>{window.removeEventListener("resize",h,!0),document.removeEventListener("scroll",p,!0),document.removeEventListener("mousedown",p)}},[l]);let f=()=>{var p;if(u(!g),l.current&&i.current){let h=(p=i==null?void 0:i.current)==null?void 0:p.getBoundingClientRect();l.current.style.top=`${h.top+30}px`}},s=a!=null?a:Uo;return e("div",{css:[qt,B`
594
+ margin: 0 0 1rem 0;
595
+ `],key:t.id},e("div",{css:Yt},e("div",{css:Jt},e("div",{css:jt},e("h4",{css:[er],title:`ID: ${t.id}`,"data-test-id":"dam-selected-item"},t.title||t.id||""),t.popoverData?e(To.Fragment,null,e("button",{type:"button",ref:i,css:B`
596
+ background: none;
597
+ outline: none;
598
+ border: none;
599
+ margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
600
+ `,"aria-controls":"path-details","aria-expanded":g,onClick:f},e(W,{width:24,height:24,css:B`
601
+ color: var(--gray-400);
602
+ `})),e("div",{id:"path-details","aria-hidden":!g,ref:l,css:[or,g?B`
603
+ visibility: visible;
604
+ `:B`
605
+ visibility: hidden;
606
+ `]},Object.entries(t.popoverData).map(([p,h],V)=>e("div",{css:j,key:V},e("span",{css:ve},p,":"),h)))):null),e(s,{item:t})),e("div",{css:nr},t.editLink?typeof t.editLink=="string"?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:p=>{o&&(ue(p.currentTarget.href,()=>o(t)),p.preventDefault())},css:ke},e("span",{css:j},"Edit"),r?e(z,{src:r,css:tr,alt:"Logo"}):null):t.editLink:null,e("button",{type:"button",onClick:()=>{n(t)},css:ke},e("span",{css:j},"Unlink"),e(Q,{css:[rr,B`
607
+ color: var(--brand-secondary-5);
608
+ `]})))))}function Uo({item:t}){let n=null;return t.previewUrl&&typeof t.previewUrl=="string"?t.type==="image"?n=e("img",{src:t.previewUrl,alt:t.id,width:"200"}):t.type==="video"&&(n=e("video",{src:t.previewUrl,title:t.id,width:"200",controls:!0})):t.previewUrl&&typeof t.previewUrl!="string"&&(n=t.previewUrl),n||t.metadata?e("div",{css:ar},n?e("div",{css:B`
609
+ margin-right: var(--spacing-sm);
610
+ `},n):null,e("ul",null,t.metadata?Object.entries(t.metadata).map(([o,r])=>e("li",{css:[j,B`
611
+ order: 1;
612
+ `],key:o},e("span",{css:[ve,B`
613
+ order: 1;
614
+ `]},o,":"),r)):null,t.createdDate?e("li",{css:j},e("span",{css:ve},"Date:"),zo(t.createdDate)):null)):null}export*from"@uniformdev/mesh-sdk";import{Button as Ai,Callout as Bi,LoadingIndicator as Oi,LoadingOverlay as Hi,Menu as $i,MenuItem as Fi,Input as Ki,InputSelect as Ni,InputToggle as Qi,Theme as Wi,InputKeywordSearch as _i,Heading as Zi,ScrollableList as Xi,ScrollableListItem as qi,Textarea as Yi,Switch as Ji,Label as ji,AddListButton as es}from"@uniformdev/design-system";export{es as AddListButton,Ai as Button,Bi as Callout,Ii as DamSelectedItem,wt as DefaultSearchRow,ut as DefaultSelectedItem,Ut as EntrySearch,Zi as Heading,be as Icons,Ki as Input,Ni as InputSelect,Qi as InputToggle,_i as KeywordSearchInput,ji as Label,Oi as LoadingIndicator,Hi as LoadingOverlay,$i as Menu,Fi as MenuItem,Xe as ProductPreviewList,Ln as ProductQuery,_e as ProductQueryContext,vi as ProductSearch,Xt as ProductSearchContext,Nt as ProductSearchRow,Zt as ProductSelectedItem,$e as ResolvableLoadingValue,Xi as ScrollableList,qi as ScrollableListItem,Fe as SelectionField,Ji as Switch,Yi as Textarea,Wi as Theme,ze as UniformMeshLocationContext,Ue as UniformMeshLocationContextProvider,Be as UniformMeshSdkContext,tn as UniformMeshSdkContextProvider,Pe as badgeIcon,rr as damSelectedItemCloseIcon,qt as damSelectedItemContainer,jt as damSelectedItemCopy,Jt as damSelectedItemDetails,tr as damSelectedItemIcon,Yt as damSelectedItemInner,ke as damSelectedItemLinkBtn,nr as damSelectedItemLinkContainer,ar as damSelectedItemMediaContainer,or as damSelectedItemPopover,ve as damSelectedItemPopoverLabel,j as damSelectedItemSmallText,er as damSelectedItemTitle,Mt as draggableContainer,Ce as draggableIcon,Vt as draggableIconOffset,Tt as draggableIconWrapper,Pt as entrySearchBtn,Lt as entrySearchConfig,kt as entrySearchConfigHidden,Rt as entrySearchLoadMoreBtn,xt as entrySearchResultList,It as entrySearchSelectIcon,Et as entrySearchSelectImg,Ra as entrySearchSelectInput,La as entrySearchSelectOption,Ct as entrySearchWrapper,Ft as productSearchRowActiveIcon,Ht as productSearchRowCategory,Gt as productSearchRowContainer,At as productSearchRowContent,Bt as productSearchRowContentActive,$t as productSearchRowDetails,Ot as productSearchRowTitle,Qt as productSelectedItemContainer,_t as productSelectedItemContent,Wt as productSelectedItemDetails,Le as productSelectedItemImage,bt as searchRowBtn,gt as searchRowContainer,vt as searchRowContainerActive,ft as searchRowContainerWithPopover,ht as searchRowPopover,we as searchRowText,Se as searchRowTextSmall,ye as selectItemLinkBtn,pt as selectItemLinkContainer,lt as selectItemPopover,oe as selectItemPopoverLabel,Z as selectItemSmallText,dt as selectedItemCloseIcon,ot as selectedItemContainer,it as selectedItemCopy,at as selectedItemDetails,ct as selectedItemIcon,nt as selectedItemInner,st as selectedItemTitle,Xo as useInitializeUniformMeshSdk,Ze as useProductQueryContext,ge as useProductSearchContext,No as useUniformMeshLocation,Ge as useUniformMeshLocationContext,nn as useUniformMeshSdk,Oe as useUniformMeshSdkContext};