1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`1.141.5`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`42556721-3881-452d-8ff1-854ce3710d12`,e._sentryDebugIdIdentifier=`sentry-dbid-42556721-3881-452d-8ff1-854ce3710d12`)}catch{}})();import{n as e,o as t}from"./DVxm0iIO.js";import{t as n}from"./BeLPFg17.js";import{Gt as r,Io as i,Ur as a,rs as o}from"./sdMpotc1.js";import{n as ee}from"./DQ2he8Zs.js";import{Fo as te,Ko as ne,To as re,hf as ie,jf as ae,js as oe,ko as se,t as ce}from"./CwcG1ssT.js";import{st as le}from"./CVI2_Qp4.js";import{O as ue}from"./OPiOTCoO.js";import{On as de,r as fe}from"./CT1CL1ga.js";import{o as s,r as pe,u as me}from"./D8A-IX_r.js";import{Dt as c,ct as he,dt as ge,n as l}from"./CceByRE7.js";import{t as _e}from"./BGb-qFk8.js";import{H as u,R as ve,V as ye,t as be,z as xe}from"./9z9MAU_y.js";import{o as d,t as f}from"./D97MF7Np2.js";import{A as p,j as m}from"./DpgLWo1i2.js";import{c as h,l as g}from"./ByxeecLR2.js";import{A as _,C as Se,D as Ce,N as we,O as v,T as y,_ as Te,h as Ee,j as De,k as b,o as x,t as Oe,x as S,y as ke}from"./C-Pnoa8M2.js";var C,w=e((()=>{ie(),C=()=>{let{brandId:e}=ae();return{brandId:e?Number(e):void 0}}})),T,E,D=e((()=>{r(),g(),S(),T=o(),E=()=>{let{data:e,isLoading:t}=y(),n=e.map(({id:e,icon:t,name:n})=>({value:Number(e),name:n,label:(0,T.jsxs)(a,{gap:1.5,children:[(0,T.jsx)(h,{boxSize:`1.125rem`,src:t,fallbackSize:18}),(0,T.jsx)(i,{children:n})]})}));return{options:n,allOptionsValue:n.map(({value:e})=>e),isLoading:t}}})),O,k,Ae=e((()=>{O=t(n()),S(),k=({brandsFilter:e,setBrandsFilter:t})=>{let{data:n}=y(),r=n.map(({id:e})=>e);(0,O.useEffect)(()=>{n.length&&e.length&&(e.every(e=>r.includes(e))||t([]))},[r,n,e,t])}})),A,j,M,N=e((()=>{A=t(n()),_e(),_(),Ae(),j=De.brands,M=()=>{let{getFilter:e,setFilter:t}=le(),{value:{brands:n=[]}}=e(j,{defaultValue:{brands:[]}}),r=(0,A.useCallback)(e=>{t(j,{brands:e})},[t]);return k({brandsFilter:n,setBrandsFilter:r}),{brands:n,setBrands:r}}})),P=e((()=>{N()}));function je(){let{t:e}=b(),{options:t,allOptionsValue:n,isLoading:r}=E(),{brands:i,setBrands:a}=M(),o=i?.length===t.length;return(0,F.jsx)(te,{isLoading:r,type:`skeleton`,minH:8,flexGrow:0,children:!!t.length&&(0,F.jsxs)(u,{children:[(0,F.jsxs)(u.Item,{isActive:o,onClick:()=>a(o?[]:n),children:[(0,F.jsx)(re,{}),e(`filters.allBrands`)]}),(0,F.jsx)(xe,{value:i,onChange:a,options:t})]})})}var F,I=e((()=>{se(),ce(),ve(),ye(),v(),D(),P(),F=o()})),Me=e((()=>{I()})),L,R=e((()=>{L=function(e){return e.BRAND_ID=`brandId`,e}({})})),z,B,V=e((()=>{x(),S(),z=o(),B={path:`edit`,Component:()=>{let{canManage:e}=Ce();return(0,z.jsx)(Te,{closeButtonLink:`../..`,isReadOnly:!e})}}})),H,U,W,G,K,q=e((()=>{f(),x(),m(),R(),H=o(),V(),{t:U}=d(),W={path:`brands`,handle:{breadcrumb:()=>(0,H.jsx)(H.Fragment,{children:U(`navigation.brands`)})}},G={path:`:${L.BRAND_ID}`},K={path:`add`,handle:{access:p.manage},element:(0,H.jsx)(Ee,{children:(0,H.jsx)(ke,{})})}}));function Ne(){let{brandId:e}=C(),{brand:t,isLoading:n}=Se(e),{name:r}=t||{};return(0,J.jsx)(oe,{isLoaded:!n,children:r})}var J,Y=e((()=>{ne(),w(),S(),J=o()})),Pe=e((()=>{Y()})),X,Z,Q=e((()=>{f(),m(),{t:X}=d(),Z={label:()=>X(`navigation.brands`),to:`/settings/brands`,key:`brands`,access:p.viewPage}})),Fe=e((()=>{Q()})),Ie,Le=e((()=>{me(),Ie=pe().of(s().required()).default([])}));function Re({filter:e,...t}){let{t:n}=b(),{withPartnerId:r}=ue();return(0,ze.jsx)(c,{title:n(`filters.title`),name:`brandIds`,as:ge,searchPlaceholder:n(`filters.searchPlaceholder`),...he({queryKeysFunc:we.list,query:de,dto:{filter:r(e)}}),...t})}var ze,Be=e((()=>{fe(),l(),_(),be(),v(),ze=o()})),Ve=e((()=>{Le(),Be()})),He=e((()=>{Ve()})),Ue=e((()=>{He()}));function We({brands:e,...t}){let{t:n}=b(),r=e.map(({id:e,name:t,icon:n})=>({id:String(t),value:Number(e),label:(0,$.jsxs)(a,{children:[(0,$.jsx)(h,{fallbackSize:20,boxSize:`1.25rem`,src:n}),(0,$.jsx)(i,{children:t})]})}));return(0,$.jsx)(c,{name:`brandId`,label:n(`fields.brandId.label`),placeholder:n(`fields.brandId.placeholder`),as:ee,isRequired:!0,options:r,filterOption:(e,t)=>String(e?.data?.id).toLowerCase().includes(t.toLowerCase()),...t})}var $,Ge=e((()=>{r(),l(),g(),v(),$=o()})),Ke,qe=e((()=>{me(),Ke=s().required()})),Je=e((()=>{Ge(),qe()})),Ye=e((()=>{_(),Me(),P(),q(),Pe(),Oe(),Fe(),Ue(),Je(),S()}));export{C as A,I as C,D,M as E,E as O,je as S,N as T,q as _,Ge as a,L as b,Ie as c,Q as d,Ne as f,W as g,G as h,We as i,w as k,Le as l,K as m,qe as n,Re as o,Y as p,Ke as r,Be as s,Ye as t,Z as u,B as v,P as w,R as x,V as y}; 2//# sourceMappingURL=CCdfSErU2.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.