1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5331],{8335:function(e,t,a){var l,i,r,n,o,s,d,c,u,E,p,m,C,T,I,A,h,f,v,g,R,_,S,x,D,y,N,P=a(67294);function M(){return(M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e}).apply(null,arguments)}t.Z=function(e){return P.createElement("svg",M({xmlns:"http://www.w3.org/2000/svg",width:302,height:229,fill:"none"},e),l||(l=P.createElement("path",{fill:"#E8EAF6",d:"M48.746 22.224h206.499v187.075a19.3 19.3 0 0 1-11.924 17.838 19.3 19.3 0 0 1-7.395 1.47H68.066a19.32 19.32 0 0 1-13.661-5.655 19.31 19.31 0 0 1-5.659-13.653z"})),i||(i=P.createElement("path",{fill:"#FF324B",d:"M59.314 0h185.363a10.565 10.565 0 0 1 10.568 10.562v11.662H48.746V10.562a10.56 10.56 0 0 1 3.095-7.468A10.57 10.57 0 0 1 59.314 0"})),r||(r=P.createElement("path",{fill:"#FFBE9D",d:"M183.668 154.927h-56.64v27.491h56.64zM146.788 63.725l-4.031 28.088s-1.058 3.728 3.638 4.292c4.697.564 14.71-.697 18.286-4.506s2.326-5.696 2.326-5.696l-7.585-30.487z"})),n||(n=P.createElement("path",{fill:"#FFBE9D",d:"M135.632 29.03s-8.459 19.865-4.05 33.48c2.875 8.88 9.136 10.476 23.476 3.822 13.148-6.101 16.563-10.716 16.563-10.716l1.939-22.145s-29.337-22.147-37.928-4.44M191.831 193.113l-5.761-18.836 2.926-31.076-4.256-11.526 21.779-2.605c2.216 11.681 3.04 10.859 1.932 17.95-5.318 25.927-11.847 35.129-16.62 46.093"})),o||(o=P.createElement("path",{fill:"#212121",fillRule:"evenodd",d:"M149.62 41.467c-8.179-4.676-8.714-14.325-8.714-14.325-4.458 6.979-5.993 5.902-5.993 5.902l-3.674 11.034s-6.439-7.4.455-19.798c8.065-14.503 23.381-9.215 23.381-9.215 3.082-.394 16.119 2.84 21.781 12.355 3.033-2.29 8.594-5.492 16.59-6.175 12.735-1.088 16.546 10.06 16.001 16.908-.231 2.912-2.168 7.144-4.166 11.506-2.7 5.897-5.51 12.034-4.362 15.474 1.996 5.985-7.39 3.083-8.413-8.887-.966-11.298-4.415-26.797-13.498-23.467q.115.498.204 1.012c3.119 18.07-4.838 34.358-16.151 38.391-4.928-9.878-2.929-14.212.391-15.433 4.884-1.797 8.437-12.749 1.213-12.871-4.254-.072-3.727 6.73-3.727 6.73-8.926-1.74-11.318-9.141-11.318-9.141",clipRule:"evenodd"})),s||(s=P.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M64.418 13.8a2.689 2.689 0 1 0 .002-5.377 2.689 2.689 0 0 0-.002 5.377m10.862 0a2.689 2.689 0 1 0 .002-5.377 2.689 2.689 0 0 0-.002 5.377m12.896-2.688a2.689 2.689 0 1 1-5.377-.001 2.689 2.689 0 0 1 5.377 0",clipRule:"evenodd"})),d||(d=P.createElement("path",{fill:"#FF324B",d:"M4.7 10.782C15.512 20 44.028 41.012 80.244 42.017a2.846 2.846 0 0 1 2.762 2.848v57.352a2.85 2.85 0 0 1-2.71 2.847c-10.89.542-52.18.479-79.54-28.797A2.83 2.83 0 0 1 0 74.333V12.954a2.85 2.85 0 0 1 3.238-2.825c.54.074 1.047.3 1.462.653"})),c||(c=P.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"m9.924 36.524.005.004.02.02.094.085q.128.115.384.34c.34.299.85.735 1.51 1.272a76 76 0 0 0 5.65 4.164c4.813 3.224 11.474 6.917 18.96 8.909A1.647 1.647 0 1 1 35.7 54.5c-7.961-2.118-14.961-6.016-19.947-9.355A80 80 0 0 1 9.86 40.8a58 58 0 0 1-2.026-1.724l-.112-.102-.03-.028-.009-.008-.003-.004L8.8 37.73l-1.123 1.205a1.647 1.647 0 0 1 2.246-2.41",clipRule:"evenodd",opacity:.4})),u||(u=P.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M7.62 26.536a1.647 1.647 0 0 1 2.328-.035l-1.147 1.182-1.147 1.182a1.647 1.647 0 0 1-.034-2.33M8.8 27.683l1.148-1.
1181.002.002.016.015.066.063.275.258c.246.226.613.56 1.092.977a76 76 0 0 0 4.119 3.339c3.527 2.667 8.465 5.948 14.143 8.454a1.647 1.647 0 1 1-1.33 3.013c-5.985-2.64-11.146-6.076-14.8-8.84A80 80 0 0 1 9.234 30.3a56 56 0 0 1-1.548-1.404l-.023-.02-.006-.007-.003-.003zm-1.769 46.78V50.507l8.404 6.01v24.535zm14.184-7.389v17.068l8.404 4.828V72.097z",clipRule:"evenodd"})),E||(E=P.createElement("path",{fill:"#7985CB",d:"M25.746 129.622c10.813 7.935 39.329 28.642 75.545 25.353a2.477 2.477 0 0 1 2.761 2.521v57.352a3.3 3.3 0 0 1-2.71 3.169c-10.89 1.832-56.176.928-79.54-22.443a2.58 2.58 0 0 1-.755-1.845v-61.378c0-2.431 2.849-4.088 4.7-2.729"})),p||(p=P.createElement("path",{fill:"#fff",d:"m65.173 163.62-1.213 33.814a1.96 1.96 0 0 1-.79 1.507c-.236.176-.51.296-.799.353s-.587.046-.872-.028c-6.113-1.601-22.64-6.187-32.99-11.528a1.96 1.96 0 0 1-1.057-1.816l1.181-32.93c.009-.329.103-.65.274-.934.167-.283.403-.52.689-.687a1.969 1.969 0 0 1 1.885-.065c5.769 2.911 19.655 9.316 31.898 10.286a1.96 1.96 0 0 1 1.794 2.028"})),m||(m=P.createElement("path",{fill:"#3F51B5",d:"m62.632 191.936-.127 3.557a1.752 1.752 0 0 1-2.274 1.609l-18.26-5.7a1.74 1.74 0 0 1-1.18-1.253 1.74 1.74 0 0 1 .014-.888c.081-.291.236-.555.446-.769l10.27-10.276a1.75 1.75 0 0 1 2.151-.258c.223.136.413.32.556.538l8.12 12.419c.198.303.297.66.284 1.021"})),C||(C=P.createElement("path",{fill:"#3F51B5",d:"m44.131 182.92-5.745 5.67a1.3 1.3 0 0 1-1.43.269c-1.612-.696-5.233-2.271-7.063-3.137a1.3 1.3 0 0 1-.554-.499 1.3 1.3 0 0 1-.187-.723l.198-5.499c.01-.28.112-.55.286-.768l8.153-10.138a1.312 1.312 0 0 1 1.868-.17c.176.152.307.349.383.57l4.41 13.083a1.296 1.296 0 0 1-.319 1.342",opacity:.6})),T||(T=P.createElement("path",{fill:"#FF324B",d:"M49.317 173.931a2.97 2.97 0 0 1-2.864-3.076 2.972 2.972 0 0 1 5.943.214 2.97 2.97 0 0 1-3.079 2.862"})),I||(I=P.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M75.302 173.503a1.773 1.773 0 0 1 2.072-1.411l12.478 2.37a1.772 1.772 0 1 1-.661 3.483l-12.478-2.37a1.773 1.773 0 0 1-1.411-2.072m0 19.54a1.773 1.773 0 0 1 2.072-1.411l12.478 2.37a1.773 1.773 0 0 1-.662 3.484l-12.478-2.37a1.773 1.773 0 0 1-1.41-2.073m2.072-10.982a1.772 1.772 0 1 0-.662 3.483l17.927 3.405a1.773 1.773 0 1 0 .662-3.483z",clipRule:"evenodd"})),A||(A=P.createElement("path",{fill:"#FDC9D3",d:"M296.695 6.247c-10.814 7.935-30.593 27.944-73.763 34.592-3.305.509-4.543 2.86-4.543 5.456V101a3.306 3.306 0 0 0 2.711 3.168c10.889 1.832 52.824-8.859 77.901-30.383 2.395-2.056 2.395-5.505 2.395-6.221V8.976c0-2.43-2.85-4.087-4.701-2.73"})),h||(h=P.createElement("path",{fill:"#fff",d:"M224.097 50.587v33.836a1.97 1.97 0 0 0 .736 1.535 1.97 1.97 0 0 0 1.658.384c6.167-1.38 22.847-5.371 33.381-10.338a1.947 1.947 0 0 0 1.122-1.777v-32.95a1.9 1.9 0 0 0-.239-.944 1.94 1.94 0 0 0-.665-.712 1.95 1.95 0 0 0-1.881-.131c-5.87 2.702-19.976 8.604-32.246 9.135a1.96 1.96 0 0 0-1.866 1.962"})),f||(f=P.createElement("path",{fill:"#3F51B5",d:"M225.621 78.977v3.559a1.75 1.75 0 0 0 .689 1.392 1.76 1.76 0 0 0 1.526.297l18.452-5.041a1.746 1.746 0 0 0 1.242-2.099 1.8 1.8 0 0 0-.418-.783l-9.894-10.638a1.755 1.755 0 0 0-2.716.182l-8.56 12.12a1.75 1.75 0 0 0-.321 1.01"})),v||(v=P.createElement("path",{fill:"#3F51B5",d:"m244.434 70.63 5.538 5.872a1.3 1.3 0 0 0 1.42.32c1.636-.638 5.31-2.082 7.17-2.881.234-.101.431-.268.572-.48.138-.212.212-.461.212-.715v-5.503c0-.28-.092-.554-.258-.778l-7.785-10.423a1.307 1.307 0 0 0-1.86-.238c-.182.146-.32.338-.403.557l-4.877 12.916a1.297 1.297 0 0 0 .271 1.352",opacity:.6})),g||(g=P.createElement("path",{fill:"#FF324B",d:"M239.573 61.46a2.972 2.972 0 1 0 0-5.941 2.972 2.972 0 1 0 0 5.941"})),R||(R=P.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M292.856 27.076a2.297 2.297 0 0 0-2.641-3.76 177 177 0 0 1-21.687 13.02 2.298 2.298 0 0 0 2.077 4.099 181 181 0 0 0 22.251-13.36m-10.239 19.513a2.297 2.297 0 1 0-2.383-3.929 183 183 0 0 1-8.395 4.797 134 134 0 0 1-3.068 1.593l-.161.08-.039.02-.011.004a2.298 2.298 0 0 0 2.013 4.131l.019-.009.047-.023.18-.09q.235-.116.679-.341c.589-.3 1.442-.742 2.511-1.315a188 188 0 0 0 8.608-4.918m-13.05 4.63 1.006 2.066zm23.848-1.962a2.297 2.297 0 0 1-.559 3.2 181.4 181.4 0 0 1-22.251 13.36 2.298 2.298 0 0 1-2.077-4.099 177 177 0 0 0 21.687-13.02 2.297 2.297 0 0 1 3.2.559m-.559 17.288a2.297 2.297 0 0 0-2.641-3.76 177 177 0 0 1-21.687 13.02 2.298 2.298 0 0 0 2.077 4.1 181.4 181.4 0 0 0 22.251-13.36M260.994 84.149a2.713 2.713 0 1 1-5.429 0 2.715 2.715 0 0 1 5.429 0m-16.913 7.561a2.716 2.716 0 0 0 2.715-2.713 2.716 2.716 0 0 0-5.43 0 2.713 2.713 0 0 0 2.715 2.713m-15.744 4.39a2.714 2.714 0 1 0 .001-5.429 2.714 2.714 0 0 0-.001 5.43",clipRule:"evenodd"})),_||(_=P.createElement("path",{fill:"#3F51B5",fillRule:"evenodd",d:"m169.63 83.163 21.079 4.855a14.33 14.33 0 0 1 11.242 11.09c2.687 9.725 5.809 24.155 6.597 31.233a2.404 2.404 0 0 1-2.204 2.609l-20.649 1.762c-.61 9.464-.851 19.433-.357 28.937h-59.362s1.658-17.611-3.218-24.539c-1.325-1.882-2.349-3.605-3.114-5.217a1565 1565 0 0 1-3.453 2.766 2.42 2.42 0 0 1-1.789.474 2.418 2.418 0 0 1-1.596-.936l-13.81-18.146a3.45 3.45 0 0 1 .474-4.723l26.749-23.053.044.016a14.3 14.3 0 0 1 5.478-2.91c2.615-1.134 6.682-2.396 9.052-3.098.044-.283.87-5.441 3.36-5.814l.06-.009c2.736-.41 18.169-2.72 20.585-1.702 1.794.755 3.867 4.493 4.832 6.405",clipRule:"evenodd"})),S||(S=P.createElement("path",{fill:"#FFBE9D",d:"m98.27 146.038-12.513-16.56 11.846-9.191 1.857-1.494 12.98 16.965-2.26 1.625z"}
1)),x||(x=P.createElement("path",{fill:"#FFBE9D",d:"M91.824 148.335c5.74 0 10.394-4.651 10.394-10.389s-4.653-10.389-10.394-10.389-10.395 4.651-10.395 10.389 4.654 10.389 10.395 10.389"})),D||(D=P.createElement("path",{fill:"#FFBE9D",d:"M100.625 132.357S67.094 83.142 65.544 78.963c-1.509-4.082-9.429 5.74-9.429 5.74l25.952 56.588z"})),y||(y=P.createElement("path",{fill:"#FFBE9D",d:"m57.54 87.936-3.302-6.333s-11.68-6.677-13.032-9.091c-1.354-2.414-1.886-9.307.51-11.072 0 0-9.318-6.995-7.732-8.412C35.565 51.508 53.872 65.1 53.872 65.1s-2.229-10.013 1.159-10.482a35.1 35.1 0 0 0 4.648 10.931c3.566 5.51 4.005 10.446 4.005 10.446l4.203 8.062z"})),N||(N=P.createElement("path",{fill:"#212121",d:"M126.379 171.872c-6.364 6.553-8.868 38.829-8.532 56.918h75.757s-.136-39.447-5.879-52.74c-5.282-12.225-14.062 5.808-61.346-4.178"})))}},68861:function(e,t,a){a.d(t,{D:function(){return y},i:function(){return M}});var l={};a.r(l),a.d(l,{useActivity:function(){return p}});var i=a(85893),r=a(97365),n=a(79440),o=a(275),s=a(48187),d=a(4638),c=a(72266),u=a(93902);let E={audience:"/v2/audience",creative:"/v2/creative",deal:"/v2/deal",geolist:"/v2/geolist","publisher-list":"/v2/publishers/list"},p=e=>{let{type:t,id:a,...l}=e;return(0,c.ZP)({url:a?"".concat(E[t],"/").concat(a,"/activity"):void 0,params:a?(0,u.rz)(l):void 0})};var m=a(62803),C={header:{display:"flex",flexDirection:"column",gap:e=>{let{spacing:t}=e;return t(2)},px:3,pt:3},content:{display:"flex",flexDirection:"column",flex:1,minHeight:0},datagridContainer:{flex:1,minHeight:0},datagrid:{border:0,backgroundColor:"background.paper",".MuiDataGrid-root":{border:0,backgroundColor:"background.paper"},".MuiDataGrid-columnHeaders":{backgroundColor:"background.paper"},".MuiDataGrid-main":{minHeight:0,backgroundColor:"background.paper"},".MuiDataGrid-virtualScroller":{minHeight:0,backgroundColor:"background.paper"},".MuiDataGrid-footerContainer":{backgroundColor:"background.paper"}},stateChip:{borderRadius:4,minWidth:88},resourceName:{fontWeight:600},actionButton:{fontSize:12},strategyName:{width:"100%"},missingStrategyCell:{display:"flex",justifyContent:"center",width:"100%"},missingStrategyIcon:{fontSize:20},gridTitle:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:e=>{let{spacing:t}=e;return t(1)}}},T=a(79328),I=a(60281),A=a(32702);let h=(0,I.Z)(A.Z);var f=a(56819),v=a(77745),g=a(938);let R=e=>e||"-",_=e=>{let t=R(e);return"-"===t?t:t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},S=e=>e||"-",x=[{field:"campaignname",headerName:"Campaign name",flex:1,minWidth:T.C.DATA_GRID.WIDTH.LARGE,sortable:!1,filterable:!1,disableColumnMenu:!0,valueGetter:e=>{let{value:t}=e;return S(t)}},{field:"strategyname",headerName:"Strategy name",flex:1,minWidth:T.C.DATA_GRID.WIDTH.LARGE,sortable:!1,filterable:!1,disableColumnMenu:!0,renderCell:e=>{let{value:t}=e;return t?(0,i.jsx)(m.ZP,{noWrap:!0,sx:C.strategyName,tooltipTitle:t,noMarginBottom:!0,children:t}):(0,i.jsx)(r.Z,{sx:C.missingStrategyCell,children:(0,i.jsx)(h,{color:"warning",sx:C.missingStrategyIcon,tooltipTitle:"This resource has not been added to the strategies"})})}},{field:"strategyid",headerName:"Strategy ID",flex:1,minWidth:T.C.DATA_GRID.WIDTH.LARGE,sortable:!1,filterable:!1,disableColumnMenu:!0,valueGetter:e=>{let{value:t}=e;return S(t)}},{field:"view",headerName:"",width:T.C.DATA_GRID.WIDTH.LARGE,sortable:!1,filterable:!1,disableColumnMenu:!0,align:"center",headerAlign:"center",renderCell:e=>{let{row:t}=e,a=t.strategyid||t.campaignid;return(0,i.jsx)(f.Z,{tertiary:!0,size:"small",sx:C.actionButton,href:"/campaign/".concat(a,"/properties"),children:"VIEW"})}},{field:"state",headerName:"Strategy state",width:T.C.DATA_GRID.WIDTH.LARGE,sortable:!1,filterable:!1,disableColumnMenu:!0,renderCell:e=>{let{value:t}=e,a=_(t),l=(null==t?void 0:t.toLowerCase())==="active",r=l?(0,i.jsx)(v.Z,{fontSize:"small"}):(0,i.jsx)(g.Z,{fontSize:"small"});return(0,i.jsx)(n.Z,{label:a,icon:"-"===a?void 0:r,size:"small",variant:"outlined",color:l?"success":"default",sx:C.stateChip})}}],D={audience:"Audience",creative:"Creative",deal:"Deal",geolist:"Geolist","publisher-list":"Publisher list"};var y=e=>{let{id:t,name:a,open:c,type:u,onClose:E}=e,{page:p,search:T,filter:I,handlePageChange:A,handleSearchChange:h,resetNavigation:f}=(0,o.z)(),v=(0,d.Z)(T,600),{data:g,isLoading:R}=l.useActivity({type:u,id:t,page:p+1,search:v,filter:I}),_=()=>{f(),E()};return(0,i.jsx)(s.ZP,{open:c,onClose:_,actions:[{label:"OK",onClick:_}
1],fullWidth:!0,maxWidth:"lg",PaperProps:{sx:{display:"flex",flexDirection:"column",height:"80vh",maxHeight:"80vh"}},sxDialogContent:{display:"flex",flexDirection:"column",flex:1,minHeight:0,overflow:"hidden"},Header:(0,i.jsx)(r.Z,{sx:C.header,children:(0,i.jsx)(m.ZP,{textvariant:"h6",noMarginBottom:!0,children:"Activity"})}),content:(0,i.jsx)(r.Z,{sx:C.content,children:(0,i.jsx)(r.Z,{sx:C.datagridContainer,children:(0,i.jsx)(o.Z,{datagridHeight:"100%",getRowId:e=>e.strategyid||e.campaignid,title:(0,i.jsxs)(r.Z,{sx:C.gridTitle,children:[(0,i.jsx)(n.Z,{label:D[u],color:"primary",size:"small"}),(0,i.jsx)(m.ZP,{textvariant:"subtitle1",sx:C.resourceName,noMarginBottom:!0,children:a})]}),hideToolbarColumnsButton:!0,hideToolbarFiltersButton:!0,rows:null!=g?g:[],columns:x,search:T,searchPlaceholder:"Search",loading:R,onSearchChange:h,onPaginationModelChange:A,pagination:!0,paginationMode:"server",paginationModel:{page:p,pageSize:5},sx:C.datagrid})})})})},N=a(76258);let P={button:{fontSize:12}};var M=e=>{let{type:t,onOpenDetails:a}=e;return{field:"details",headerName:"Activity",width:N.default.DATA_GRID.WIDTH.LARGE,sortable:!1,filterable:!1,editable:!1,disableColumnMenu:!0,align:"center",headerAlign:"center",renderCell:e=>{let{row:l}=e;return l.activity&&a?(0,i.jsx)(f.Z,{tertiary:!0,size:"small",sx:P.button,onClick:()=>a({id:l.id,name:l.name,type:t}),children:"DETAILS"}):(0,i.jsx)(m.ZP,{noMarginBottom:!0,children:"-"})}}}},20947:function(e,t,a){var l=a(85893),i=a(76258),r=a(52458),n=a(19663),o=a(45329),s=a(66628),d=a(65389),c=a(42042),u=a(94974);let{DIALOG:E,DIALOGS:p}=i.default,{CREATIVES:{PIXEL_EDITION:{REPEATED_URLS:m}}}=r.default,{CAMPAIGN_CREATIVE_BULK_EDIT:C}=n.default.DIALOGS,T=p.CAMPAIGN_CREATIVE_BULK_EDIT,I=[s.default.templates.url({name:"click_url",label:"Click URL",pattern:i.default.REGEXP.CREATIVE_URL,validationErrorMessage:C.ERROR_MESSAGE,size:12}),s.default.templates.impressionUrls({name:"impression_urls",inputLabel:"Impression URL",showDefaultInput:!0,size:12})];t.Z=e=>{let{onSubmit:t,onCancel:a,initialValues:i}=e,r=(0,c.D)(),s=()=>d.default.closeDialog(p.CAMPAIGN_CREATIVE_BULK_EDIT),A=[{label:n.default.COMMON.EDIT,form:T,type:E.ACTIONS.TYPE.SUBMIT},{label:n.default.COMMON.CANCEL,onClick:()=>{null==a||a(),s()},type:E.ACTIONS.TYPE.RESET}];return(0,l.jsx)(u.Z,{title:C.TITLE,description:C.DESCRIPTION,actions:A,formContent:I,fullWidth:!0,formId:T,onSubmit:(e,a)=>{if((0,o.JP)(e.impression_urls)){r.error({message:m});return}s(),t(e),a.resetForm()},initialValues:i})}},55331:function(e,t,a){a.d(t,{uN:function(){return tL},rX:function(){return t1}});var l=a(85893),i=a(79328),r=a(97365),n=a(55157),o=a(96988),s=a(25784),d=a(54453),c=a(67294),u=a(80592),E=a(95381),p=a(76258),m=a(19663),C=a(43384),T=a(80210),I=a(61100),A=a(48917),h=a(94974),f=a(39351),v=a(91808),g=a(65389),R=a(42042),_=a(36288),S=a(19738),x=a(62803),D=a(54315),y="name",N="click_url",P="impression_urls",M="file",b="_creative_type",L="_tag_creation_type",O="tags_file";let Z={marginTop:2,padding:2,border:"1px solid rgba(0, 0, 0, 0.12)",overflowY:"auto"},G=(0,c.createContext)([]),V=(0,c.createContext)(()=>void 0),U=e=>{let{children:t}=e,[a,i]=(0,c.useState)([]);return t?(0,l.jsx)(G.Provider,{value:a,children:(0,l.jsx)(V.Provider,{value:i,children:t})}):null},j=()=>{let e=(0,c.useContext)(G),{values:t}=(0,S.Gc)(),a=(0,S.NA)(L,t)===i.C.CREATIVE.TAG_CREATION_TYPE.BULK,o=(0,S.NA)(O,t);return a&&e.length&&o?(0,l.jsxs)(r.Z,{sx:Z,children:[(0,l.jsx)(x.ZP,{textvariant:"body2",fontWeight:500,component:"div",children:i.T.CREATIVES.NEW_CREATIVES.ERRORS_TAGS_DESCRIPTION}),e.map(e=>{let{errors:t,row:a}=e;return(0,l.jsxs)(r.Z,{children:[(0,l.jsxs)(r.Z,{py:2,children:[(0,l.jsx)(x.ZP,{textvariant:"body2",fontWeight:300,overflow:"hidden",textOverflow:"ellipsis",component:"div",children:"The line ".concat(a," is not correct:")}),(0,l.jsx)(D.ZP,{disablePadding:!0,dense:!0,children:t.map(e=>(0,l.jsx)(D.ZP.Item,{children:(0,l.jsx)(x.ZP,{textvariant:"body2",fontWeight:300,component:"div",children:"\xb7 ".concat(e)})},e))})]}),(0,l.jsx)(n.Z,{})]},a)})]}):null};var z=a(66628);let{REGEXP:w,PREFIXES:k,HTML5_MEDIA_FORMATS:F}=p.default,{NEW_CAMPAIGN_CREATIVE:B}=m.default.DIALOGS,W=[{name:y,type:S.FIELD_TYPES.INPUT,label:"Creative name",lgSize:7,mdSize:7,smSize:12,required:!0,pattern:w.CREATIVE_NAME,validationErrorMessage:B.ERROR_NAME},z.default.templates.url({name:N,label:"Click URL",placeholder:k.HTTPS,pattern:w.CREATIVE_URL,validationErrorMessage:B.ERROR_URL,size:12}),z.default.templates.impressionUrlSingle({name:P,label:"Impression Pixel",size:12}),{name:M,type:S.FIELD_TYPES.UPLOAD_INPUT,description:B.AUDIO_UPLOAD_PLACEHOLDER,text:"Upload",size:12,required:!0,format:F.AUDIO}],{REGEXP:Y,FORMATS:H}=p.default,{NEW_CAMPAIGN_CREATIVE:q}=m.default.DIALOGS,X=[{name:y,type:S.FIELD_TYPES.INPUT,label:"Name",lgSize:7,mdSize:7,smSize:12,required:!0,pattern:Y.CREATIVE_NAME,validationErrorMessage:q.ERROR_NAME},z.default.templates.url({name:N,label:"Click URL",pattern:Y.CREATIVE_URL,validationErrorMessage:q.ERROR_URL,size:12}),z.default.templates.impressionUrlSingle({name:P,label:"Impression Pixel",size:12}
1),{name:M,type:S.FIELD_TYPES.UPLOAD_INPUT,description:q.IMAGE_UPLOAD_PLACEHOLDER,text:"Upload",multiple:!0,size:12,required:!0,format:H.IMAGE}];var K=a(74850),J=a(40213),Q=a(38296),$=a(2081),ee=a(41886);let{REGEXP:et}=i.C,{NEW_CAMPAIGN_CREATIVE:ea}=i.T.DIALOGS,{TAGS_HTML_MARKUP:el}=i.T.CREATIVES,ei={dependencies:[L],parse:(e,t)=>({...e,hidden:(0,S.NA)(L,t)===i.C.CREATIVE.TAG_CREATION_TYPE.BULK})},er=[{name:y,type:S.FIELD_TYPES.INPUT,label:"Name",lgSize:7,mdSize:7,smSize:12,required:!0,pattern:et.CREATIVE_NAME,validationErrorMessage:ea.ERROR_NAME,parser:ei},z.default.templates.url({name:N,label:"Click URL",pattern:et.CREATIVE_URL,validationErrorMessage:ea.ERROR_URL,size:12,parser:ei}),z.default.templates.impressionUrlSingle({name:P,label:"Impression Pixel",size:12,parser:ei}),{name:"attributes",type:S.FIELD_TYPES.SELECT,label:"Attributes",required:!0,options:(0,ee.Z)(Q.creative_attributes),mode:"multiple",size:6,parser:ei},{name:"responsive_sizes",type:S.FIELD_TYPES.SELECT,label:"Sizes",required:!0,options:()=>{let e=$.ZP.getCreativeSizes()||[];return z.default.helpers.creativeSizeToOption(e)},mode:"multiple",allowSelectAll:!0,size:6,parser:ei},{name:"html",type:S.FIELD_TYPES.TEXT_AREA,label:"HTML Markup",required:!0,maxCharacters:4e3,pattern:et.HTML_MARKUP,validationErrorMessage:el,size:12,parser:ei}];var en=a(68151);let{UPLOAD_TAGS_DESCRIPTION:eo}=i.T.CREATIVES.NEW_CREATIVES,{FORMATS:es}=i.C,ed=(0,l.jsxs)(l.Fragment,{children:[eo," ",(0,l.jsx)(en.Z,{color:"secondary",href:"/documents/bulk-tags-template.xlsx",target:"_blank",underline:"hover",children:"Use this template"})]}),ec=[{name:O,type:S.FIELD_TYPES.UPLOAD_INPUT,description:ed,text:"Upload",required:!0,size:12,parser:{dependencies:[L],parse:(e,t)=>({...e,hidden:(0,S.NA)(L,t)===i.C.CREATIVE.TAG_CREATION_TYPE.SINGLE})},format:es.XLSX}],{DOWNLOAD_TAG_TEMPLATE_BUTTON:eu}=i.T.CREATIVES.NEW_CREATIVES,eE=[{name:L,type:S.FIELD_TYPES.RADIO_GROUP,options:[{label:"Only one",value:i.C.CREATIVE.TAG_CREATION_TYPE.SINGLE},{label:"In bulk",value:i.C.CREATIVE.TAG_CREATION_TYPE.BULK}],row:!0,defaultValue:i.C.CREATIVE.TAG_CREATION_TYPE.SINGLE,size:6},{name:"download_template",type:S.FIELD_TYPES.CUSTOM,Component:()=>(0,l.jsx)(C.Z,{style:{display:"flex",justifyContent:"flex-end"},children:(0,l.jsx)(J.Z,{href:"/documents/bulk-tags-template.xlsx",startIcon:(0,l.jsx)(K.Z,{}),tertiary:!0,target:"_blank",rel:"noopener noreferrer",children:eu})}),size:6,parser:{dependencies:[L],parse:(e,t)=>({...e,hidden:(0,S.NA)(L,t)!==i.C.CREATIVE.TAG_CREATION_TYPE.BULK})}},...er,...ec],{REGEXP:ep,FORMATS:em}=p.default,{NEW_CAMPAIGN_CREATIVE:eC}=m.default.DIALOGS,eT=[{name:y,type:S.FIELD_TYPES.INPUT,label:"Name",lgSize:7,mdSize:7,smSize:12,pattern:ep.CREATIVE_NAME,validationErrorMessage:eC.ERROR_NAME},{name:"boxing_allowed",label:eC.BOXING_ALLOWED,type:S.FIELD_TYPES.SWITCH,lgSize:5,mdSize:5,smSize:12,defaultValue:!0},z.default.templates.url({name:N,label:"Click URL",pattern:ep.CREATIVE_URL,validationErrorMessage:eC.ERROR_URL,size:12}),z.default.templates.impressionUrlSingle({name:P,label:"Impression Pixel",size:12}),{name:M,type:S.FIELD_TYPES.UPLOAD_INPUT,description:eC.VIDEO_UPLOAD_PLACEHOLDER,text:"Upload",multiple:!0,size:12,required:!0,format:em.VIDEO}],{REGEXP:eI,PREFIXES:eA}=p.default,{NEW_CAMPAIGN_CREATIVE:eh}=m.default.DIALOGS,ef=[{name:y,type:S.FIELD_TYPES.INPUT,label:"Name",required:!0,lgSize:6,mdSize:6,smSize:12,pattern:eI.CREATIVE_NAME,validationErrorMessage:eh.ERROR_NAME},{name:"vast_wrapper.duration",type:S.FIELD_TYPES.NUMBER,label:"Duration in seconds",lgSize:6,mdSize:6,smSize:12},z.default.templates.url({name:N,label:"Click URL",pattern:eI.CREATIVE_URL,validationErrorMessage:eh.ERROR_URL,size:12}),z.default.templates.impressionUrlSingle({name:P,label:"Impression Pixel",size:12}),{name:"vast_wrapper.url",type:S.FIELD_TYPES.INPUT,label:"VAST URL",pattern:eI.CREATIVE_URL,required:!0,validationErrorMessage:eh.ERROR_URL,placeholder:eA.HTTPS,size:12}];var ev=a(38920),eg=a(52458),eR=a(26696),e_=a(6315),eS=a(72914);let{REGEXP:ex,CREATIVE:{TYPE:eD},HTML5_MEDIA_FORMATS:ey}=p.default,{DIALOGS:{NEW_NATIVE_CAMPAIGN_CREATIVE:eN,NEW_CAMPAIGN_CREATIVE:eP}}=m.default,eM=[{label:"Image",value:eD.IMAGE},{label:"Video",value:eD.VIDEO}],eb=[{name:y,type:S.FIELD_TYPES.INPUT,label:"Name",lgSize:7,mdSize:7,smSize:12,required:!0,pattern:ex.CREATIVE_NAME,validationErrorMessage:eP.ERROR_NAME},z.default.templates.url({name:N,label:"Click URL",pattern:ex.CREATIVE_URL,validationErrorMessage:eP.ERROR_URL,size:12}),z.default.templates.impressionUrlSingle({name:P,label:"Impression Pixel",size:12}),{name:"_customize_the_ad",Icon:ev.Z,label:"Customize the Ad",lgSize:12,mdSize:12,smSize:12,type:S.FIELD_TYPES.TITLE,tooltipTitle:(0,l.jsx)(e_.Z,{})},{name:"native_settings.title",type:S.FIELD_TYPES.INPUT,label:"Title",required:!0,size:6,maxLength:25},{name:"native_settings.action",type:S.FIELD_TYPES.INPUT,label:"Call to action",required:!0,size:6,maxLength:15},{name:"native_settings.text",type:S.FIELD_TYPES.TEXT_AREA,label:"Description",required:!0,size:12,maxCharacters:90,rows:1}
1,{name:"native_settings.icon300x300",description:eN.ICON_INFO,type:S.FIELD_TYPES.UPLOAD_INPUT,label:"Icon Ad",text:"Upload",size:12,required:!0,format:ey.IMAGE},{name:b,type:S.FIELD_TYPES.RADIO_GROUP,label:"Creative type",options:eM,defaultValue:eD.IMAGE,required:!0,row:!0,size:3,mdSize:3,xsSize:12},{name:"native_settings.video",type:S.FIELD_TYPES.UPLOAD_INPUT,description:"MP4 or FLV format and with a duration of 1â30 seconds. Recommended aspect ratios: 16:9 (1280\xd7720 or 720\xd71280) or 1:1.",required:!0,format:ey.VIDEO,text:"Upload",size:8,xsSize:12,smSize:6,parser:{dependencies:[b],parse:(e,t)=>{let a=(0,S.NA)(b,t)!==eD.VIDEO;return{...e,hidden:a}}}},{name:"native_settings.images",type:S.FIELD_TYPES.CUSTOM,Component:eS.U,validationErrorMessage:eg.default.field.required,defaultValue:[],size:12,parser:{dependencies:[b],parse:(e,t)=>{let a=(0,S.NA)(b,t)!==eD.IMAGE;return{...e,hidden:a,validator:eR.j}}}}];var eL=e=>({...e,impression_urls:e.impression_urls?[e.impression_urls]:void 0}),eO=e=>{let t=eL(e),{images:a,...l}=t.native_settings||{},i=null==a?void 0:a.reduce((e,t)=>{let{file:a,size:l}=t;return l?{...e,[l]:a}:e},{});return{...t,native_settings:{...l,...i}}};let{COMMON:eZ,DIALOGS:{NEW_CAMPAIGN_CREATIVE:eG}}=i.T,{DIALOG:{ACTIONS:eV},DIALOGS:eU}=i.C,ej=eU.NEW_CAMPAIGN_CREATIVE,ez=e=>({audio:eL,external_video:eL,image:eL,native:eO,rich_media:eL,tag:eL,video:eL,default:eL})[e],ew={audio:W,external_video:ef,image:X,native:eb,tag:eE,video:eT},ek={audio:eG.AUDIO_TITLE,external_video:eG.EXTERNAL_VIDEO_TITLE,image:eG.IMAGE_TITLE,native:eG.NATIVE_TITLE,tag:eG.TAG_TITLE,video:eG.VIDEO_TITLE},eF=e=>{var t,a;let{onAddCreative:r,type:n}=e,o=(0,R.D)(),s=(0,c.useContext)(V),d=(0,f.DA)(i.C.DIALOGS.NEW_CAMPAIGN_CREATIVE,"type"),u=null!=n?n:d;if(!u)return null;let E=async e=>{try{var t,a,l;let i=ez(u||"default")(e),n=(null===(t=e.file)||void 0===t?void 0:t.length)&&(null===(a=e.file)||void 0===a?void 0:a.length)>1,d=i.tags_file,c=n||d?v.Z.addBulk:v.Z.add,E=await c({...i,type:u});g.default.closeDialog(ej),o.success({message:eG.SUCCESS}),!Array.isArray(E)&&(null===(l=E.status_observations)||void 0===l?void 0:l.warning)&&o.warning({message:E.status_observations.warning}),s&&s([]),null==r||r(E)}catch(e){if(e instanceof _.Dh&&Array.isArray(e.data)){"tag"===u?s(e.data):e.data.forEach(e=>o.error({message:"".concat(e.payload,": ").concat((0,A.Z)(e.error))}));return}o.error({error:e})}},p=[{label:eZ.CREATE,form:ej,type:eV.TYPE.SUBMIT},{label:eZ.CANCEL,onClick:()=>{s([]),g.default.closeDialog(ej)},type:eV.TYPE.RESET}],m=null!==(t=ew[u])&&void 0!==t?t:[],C=null!==(a=ek[u])&&void 0!==a?a:eG.TITLE;return(0,l.jsx)(h.Z,{maxWidth:"md",title:C,actions:p,formContent:m,formId:ej,onSubmit:E,children:(0,l.jsx)(j,{})})};var eB=e=>(0,l.jsx)(U,{children:(0,l.jsx)(eF,{...e})}),eW=a(4638),eY=a(91039),eH=a(68861),eq=a(75381),eX=a(9374),eK=a(26603),eJ=a(52137),eQ=a(44198),e$=a(40308);let e1=(0,e$.TC)(eQ.Z);var e0=()=>(0,l.jsx)(C.Z,{sx:{width:"80px",justifyContent:"center",display:"flex",alignItems:"center",height:"100%"},children:(0,l.jsx)(e1,{color:"warning",tooltipTitle:m.default.CREATIVES.PROCESSING})}),e2=a(7369);let e3=(0,e$.TC)(e2.Z);var e7=()=>(0,l.jsx)(C.Z,{sx:{width:"60px",justifyContent:"center",display:"flex",alignItems:"center",height:"100%"},children:(0,l.jsx)(e3,{color:"primary",tooltipTitle:m.default.CREATIVES.PROCESSING_ERROR})});let{TYPE:{AUDIO:e6}}=i.C.CREATIVE,e5=e=>i.R.CREATIVE(e),e8=e=>{var t,a;let{creative:r,onAddClick:n,hasViewButton:o,value:d}=e,c=(0,R.D)(),{isDesktop:u}=(0,s.Z)(),p=v.Z.canBePreviewed(r),m=v.Z.isProcessingTranscoding(r),C=v.Z.isErrorTranscoded(r),T=e5("".concat(null==r?void 0:r.id)),I="string"==typeof d?d:i.C.DATA_GRID.DEFAULT_VALUE,A=(null==r?void 0:r.type)===e6,h="string"==typeof(null==r?void 0:r.thumbnail_url)&&!(null==r?void 0:r.thumbnail_url.includes("cloudfront.net")),f=A||h||!(null==r?void 0:r.thumbnail_url)?"/whitelabel/favicon.ico":null==r?void 0:r.thumbnail_url,_=[...(null==r?void 0:null===(a=r.rich_media)||void 0===a?void 0:null===(t=a.nexd)||void 0===t?void 0:t.id)&&u?[{onClick:()=>g.default.openDialog(i.C.DIALOGS.CREATIVE_STUDIO,{creative:r}),children:i.T.DIALOGS.CREATIVE_STUDIO.TITLE,key:i.T.DIALOGS.CREATIVE_STUDIO.TITLE,secondary:!0}]:[],...p&&!C?[{onClick:()=>{try{v.Z.preview(r)}catch(e){e instanceof Error?c.error({message:e.message}):c.error({message:"Something went wrong"})}}
1,children:i.T.COMMON.PREVIEW,key:i.T.COMMON.PREVIEW,tertiary:!0,sx:{flexShrink:0}}]:[],...m&&!C?[{Component:e0,key:"processing_creative"}]:[],...C?[{Component:e7,key:"processing_creative"}]:[],...o?[eJ.templates.viewAction({path:T})]:[],...n&&!C?[{children:i.T.COMMON.ADD,key:i.T.COMMON.ADD,secondary:!0,onClick:()=>{m&&c.warning({message:i.T.CREATIVES.WARNING_PROCESS_ADD}),n(r)},sx:{flexShrink:0}}]:[]];return(0,l.jsx)(E.Z,{text:I,actions:_,avatar:f})};var e4=e=>{let{value:t,row:a,colDef:{renderCellProps:i}}=e;if(!i)return null;let{hasViewButton:r,onAddClick:n}=i;return(0,l.jsx)(e8,{hasViewButton:r,onAddClick:n,value:t,creative:a})},e9=a(53216);let{WIDTH:{MEDIUM:te,X_LARGE:tt,LARGE:ta,XX_LARGE:tl}}=p.default.DATA_GRID;var ti=e=>{let{creativeNameDetailsRenderCellProps:t,onOpenDetails:a}=e;return[{field:"name",headerName:"Creative name",editable:!0,minWidth:tl,renderCell:e4,renderCellProps:t},{field:"click_url",headerName:"Creative Click URL",editable:!0,width:ta,valueGetter:e=>{let{value:t,row:a}=e;return t||a.click_url},filterable:!1},{field:"impression_urls",headerName:"Creative Impression Pixel",editable:!0,minWidth:tt,valueGetter:e=>{var t;let{value:a,row:l}=e;return a||(null===(t=l.creative)||void 0===t?void 0:t.impression_urls)},valueSetter:e=>{let{value:t,row:a}=e;return{...a,impression_urls:t}},valueFormatter:e=>{let{value:t}=e;return t?t.join(", "):t},renderEditCell:e=>(0,l.jsx)(eX.LN,{...e}),filterable:!1},{field:"type",headerName:"Type",type:"singleSelect",width:te,valueOptions:(0,ee.Z)(Q.creatives_types),valueGetter:e=>{let{row:t}=e;return(0,eq.n5)({value:t.type,dictionary:Q.creatives_types})},renderCell:eX.rx},...a?[(0,eH.i)({type:"creative",onOpenDetails:a})]:[],{...eK.stateTemplateCell,field:"state",headerName:"State",width:ta,type:"singleSelect",editable:v.Z.canEditState(),valueOptions:(0,ee.Z)(p.default.CREATIVE.STATES),valueGetter:e9.Z},{field:"width",headerName:"Size",width:te,valueGetter:e=>{let{row:t}=e,{height:a,width:l,type:i}=t||{};return a&&l?"".concat(t.width,"x").concat(t.height):i===p.default.CREATIVE.TYPE.NATIVE?"0x0":"-"},filterable:!1},{...eK.dateTemplateCell,renderEditCell:eX.sz,field:"created_at",width:te,headerName:"Created",filterable:!1},{...eK.dateTemplateCell,field:"updated_at",headerName:"Last updated",filterable:!1}]},tr=a(58450),tn=a(29480);let{DATA_GRID:{WIDTH:{XX_LARGE:to,MEDIUM:ts,LARGE:td}}}=p.default,{dateTemplateCell:tc,stateTemplateCell:tu}=eJ.templates,tE=(0,tr.Z)(["rich_media"],Q.creatives_types);var tp=e=>{let{creativeNameDetailsRenderCellProps:t,creativesType:a}=e;return[{field:"name",headerName:"Creative name",width:to,renderCell:e4,renderCellProps:t},{field:"type",headerName:"Type",width:ts,type:"singleSelect",valueGetter:e=>{let{value:t}=e;return(0,eq.n5)({value:t,dictionary:Q.creatives_types})},valueOptions:a?a.map(e=>({value:e,label:Q.creatives_types[e]})):(0,ee.Z)(tE),renderCell:tn.Z},{...tu,field:"state",headerName:"State",width:td,valueGetter:e9.Z},{field:"width",headerName:"Size",width:ts,valueGetter:e=>{let{value:t,row:a}=e;return t&&a.height?"".concat(t,"x").concat(a.height):"-"}},{...tc,field:"created_at",width:ts,headerName:"Created"},{...tc,field:"updated_at",headerName:"Last updated",filterable:!1}]},tm=a(71105);let{video:tC,image:tT,tag:tI,audio:tA,external_video:th,native:tf}=Q.creatives_types,{CREATIVE:{TYPE:tv},DIALOGS:tg}=p.default,tR=[{Component:tm.c,propsComponent:{label:tC,key:tv.VIDEO,onClick:()=>{g.default.openDialog(tg.NEW_CAMPAIGN_CREATIVE,{type:tv.VIDEO})}}},{Component:tm.c,propsComponent:{label:tT,key:tv.IMAGE,onClick:()=>{g.default.openDialog(tg.NEW_CAMPAIGN_CREATIVE,{type:tv.IMAGE})}}},{Component:tm.c,propsComponent:{label:tI,key:tv.TAG,onClick:()=>{g.default.openDialog(tg.NEW_CAMPAIGN_CREATIVE,{type:tv.TAG})}}},{Component:tm.c,propsComponent:{label:tA,key:tv.AUDIO,onClick:()=>{g.default.openDialog(tg.NEW_CAMPAIGN_CREATIVE,{type:tv.AUDIO})}}},{Component:tm.c,propsComponent:{label:th,key:p.default.CREATIVE.TYPE.EXTERNAL_VIDEO,onClick:()=>{g.default.openDialog(tg.NEW_CAMPAIGN_CREATIVE,{type:p.default.CREATIVE.TYPE.EXTERNAL_VIDEO})}}},{Component:tm.c,propsComponent:{label:tf,key:p.default.CREATIVE.TYPE.NATIVE,onClick:()=>{g.default.openDialog(tg.NEW_CAMPAIGN_CREATIVE,{type:p.default.CREATIVE.TYPE.NATIVE}
1)}}}];var t_=a(56819),tS=e=>{let{options:t,isSecondary:a}=e,[i,n]=(0,c.useState)(!1),o=(0,c.useRef)(null);return(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(t_.Z,{secondary:a,onClick:()=>n(!0),ref:o,children:"Upload"}),(0,l.jsx)(tm.Z,{options:t,open:i,anchorRef:o,onClose:()=>n(!1),popoverProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"}}})]})},tx=e=>{let t=tR.filter(t=>!e||(null==e?void 0:e.includes(null==t?void 0:t.propsComponent.key)));return[{Component:()=>(0,l.jsx)(t_.Z,{onClick:()=>g.default.openDialog(i.C.DIALOGS.CREATIVE_STUDIO),children:"Creative Studio"}),key:"creative-studio"},1===t.length?{Component:()=>{var e;return(0,l.jsx)(t_.Z,{secondary:!0,onClick:null===(e=t[0])||void 0===e?void 0:e.propsComponent.onClick,children:i.T.COMMON.UPLOAD})},key:"upload"}:{Component:()=>(0,l.jsx)(tS,{isSecondary:!0,options:t}),key:"upload"}]};let{SEARCH_CREATIVES:tD}=m.default.CREATIVES.CREATIVES_DATAGRID,{PAGINATION:ty}=p.default.DATA_GRID;var tN=e=>{let{selectedCreatives:t,onAddCreative:a,creativesType:i}=e,{search:r,filter:n,page:o,handleSearchChange:s,handleFilterChange:d,handlePageChange:c}=(0,T.zn)(),u=(0,eW.Z)(r),{data:E,isLoading:p,response:m}=v.Z.useListCreatives({filter:n,search:u,page:o+1,...i&&{type:i}}),A=tx(i),h=tp({creativesType:i,creativeNameDetailsRenderCellProps:{onAddClick:a}}),f=null==E?void 0:E.filter(e=>!t.includes(e)),g=m?eY.ZP.getTotalCount(m):0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C.Z,{style:{height:"55vh",width:"100%"},children:(0,l.jsx)(T.ZP,{datagridHeight:"calc(100% - 2.2rem)",columns:h,rows:null!=f?f:[],loading:p,actions:A,searchPlaceholder:tD,onSearchChange:s,onFilterChange:d,pagination:!0,paginationModel:{page:o,pageSize:ty.PAGE_SIZE},paginationMode:ty.MODE.SERVER,filterMode:"server",onPaginationModelChange:c,rowCount:g,hideToolbarColumnsButton:!0,initialState:{sorting:{sortModel:[{field:"updated_at",sort:"desc"}]}}})}),(0,l.jsx)(eB,{onAddCreative:e=>{a(e)}}),(0,l.jsx)(I.Z,{})]})};let tP={border:"1px solid",borderColor:"neutral.border",borderRadius:1,boxSizing:"border-box",overflow:"hidden",width:"100%",height:148},tM={boxSizing:"border-box",height:"100%",overflowY:"auto",paddingBottom:0,paddingLeft:.5,paddingRight:1,paddingTop:.5,width:"100%"},tb={minWidth:0,paddingTop:0};var tL=e=>{let{value:t,onChange:a,creativesType:p,isPercentageDistribution:m}=e,{isDesktop:C}=(0,s.Z)(),T=(0,c.useCallback)(e=>{a(t.concat(e))},[a,t]),I=e=>{a(t.filter(t=>e!==t.id))},A=e=>[{key:"remove",children:(0,l.jsx)(d.Z,{}),onClick:()=>{I(e)},tertiary:!0,sx:{color:e=>e.palette.text.secondary}}],h=e=>C?e+2<t.length:e+1<t.length;return(0,l.jsxs)(l.Fragment,{children:[m&&(0,l.jsx)(r.Z,{marginBottom:2,children:(0,l.jsx)(u.Z,{severity:"warning",sx:{justifyContent:"start"},children:i.T.DIALOGS.ADD_MORE_CREATIVES.DISTRIBUTION_WARNING})}),(0,l.jsxs)(r.Z,{sx:{paddingBottom:e=>{let{spacing:t}=e;return t(2)}},children:[(null==t?void 0:t.length)>0&&(0,l.jsx)(r.Z,{sx:tP,children:(0,l.jsx)(r.Z,{sx:tM,children:(0,l.jsx)(o.default.Container,{sx:{margin:0,width:"100%"},children:t.map((e,t)=>(0,l.jsx)(o.default.Item,{xs:12,md:6,lg:6,xl:6,sx:{paddingTop:"0 !important"},children:(0,l.jsxs)(r.Z,{children:[(0,l.jsx)(r.Z,{sx:{...tb,paddingBottom:h(t)?.5:0},children:(0,l.jsx)(E.Z,{text:e.name,avatar:e.thumbnail_url,actions:A(e.id),textStyles:{minWidth:0}})}),h(t)&&(0,l.jsx)(n.Z,{})]})},e.id))})})}),(0,l.jsx)(tN,{selectedCreatives:t,onAddCreative:T,creativesType:p})]})]})},tO=a(61635),tZ=a(53066),tG=a(55299),tV=a(85940),tU=a(8335);let{NO_CREATIVES:tj}=i.T.CREATIVES,{TITLE:tz,DESCRIPTION:tw,BUTTON_TEXT:tk,ACTIONS:tF,ADDITIONAL_BUTTONS:tB}={TITLE:tj.TITLE,DESCRIPTION:tj.DESCRIPTION,BUTTON_TEXT:tj.BUTTON_TEXT,ACTIONS:tR.map(e=>{let{propsComponent:t}=e;return{text:t.label,onClick:t.onClick}}),ADDITIONAL_BUTTONS:[(0,l.jsx)(J.Z,{onClick:()=>g.default.openDialog(i.C.DIALOGS.CREATIVE_STUDIO),children:"Creative Studio"},"creative-studio")]};var tW=()=>(0,l.jsx)(tV.Z,{image:(0,l.jsx)(tU.Z,{}),title:tz,description:tw,buttonText:tk,actions:tF,additionalButtons:tB,buttonVariant:"secondary"}),tY=a(34279),tH=a(66374),tq=a(38189),tX=a(20947),tK=e=>{let{creatives:t,mutate:a}=e,r=(0,c.useRef)({}),[n,o]=(0,c.useState)(!1),s=(0,c.useRef)([]),u=(0,R.D)(),{handleCommitEdit:E,editedRows:p,resetEdition:m}=(0,eJ.Uz)(t),{updateItems:C}=(0,T.Ki)({mutate:a,editedItems:p,serviceUpdate:v.Z.update,serviceUpdateMany:v.Z.updateMany,singleItemName:i.T.CREATIVE_ITEM_NAME,multipleItemName:i.T.CREATIVES_ITEM_NAME}),{removeItems:I}=(0,T.v6)({mutate:a,selectedItems:s,serviceRemove:v.Z.remove,serviceRemoveMany:v.Z.removeMany,singleItemName:i.T.CREATIVE_ITEM_NAME,multipleItemName:i.T.CREATIVES_ITEM_NAME}),A=async()=>{await C(),m(r,t)},h=async e=>{s.current=e.current.state.rowSelection;let l=t.find(e=>{let{id:t}=e;return t===s.current[0]});if(l)try{await v.Z.duplicate(l),u.success({message:i.T.CREATIVES.CREATIVE_PAGE.SNACKBARS.DUPLICATE.SUCCESS}),r.current.setRowSelectionModel([]),setTimeout(()=>a(),1e3)}catch(e){u.error({error:e})}},f=async e=>{let{impression_urls:l,click_url:n}=e,o=s.current.reduce((e,a)=>{let i=t.find(e=>{let{id:t}=e;return t===a});if(!i)return e;let r=l.filter(e=>""!==e).map(e=>e.trim());return[...e,{...i,...r.length&&{impression_urls:r},...n&&{click_url:n.trim()}}]},[]);try{await v.Z.updateMany(o),u.success({message:i.T.CREATIVES.SUCCESS_BULK_EDIT}),r.current.setRowSelectionModel([]),setTimeout(()=>a(),1e3)}catch(e){u.error({error:e})}},_=async()=>{await I(),o(!1),s.current=[]};return{datagridProps:{toolbarActions:[{icon:(0,l.jsx)(d.Z,{}),text:i.T.COMMON.DELETE,onClick:e=>{o("remove"),s.current=e.current.state.rowSelection},multiple:!0},{icon:(0,l.jsx)(tH.Z,{}),text:i.T.COMMON.DUPLICATE,onClick:h},{icon:(0,l.jsx)(tY.Z,{}),text:i.T.COMMON.BULK_EDIT,onClick:e=>{g.default.openDialog(i.C.DIALOGS.CAMPAIGN_CREATIVE_BULK_EDIT),s.current=e.current.state.rowSelection},multiple:!0,siblings:()=>(0,l.jsx)(tX.Z,{onSubmit:f})}],handleCommitEdit:E,handleCommitError:e=>{tq.ZP.error(e),u.error({message:"An error occurred"})},handleCancelEdit:()=>{m(r,t)},handleSubmitEdit:A,shouldAppearConfirmation:!!p.length,apiRef:r},dialogProps:{remove:{open:"remove"===n,onConfirm:_,onClose:()=>o(!1),title:i.T.DIALOGS.BACKOFFICE.DELETE_DIALOG.TITLE(!0,i.C.DIALOGS.CREATIVE)}}}};let tJ={display:"flex",flexDirection:"column",gap:e=>{let{spacing:t}=e;return t(3)},height:"100%"},tQ=()=>(0,l.jsx)(tS,{isSecondary:!0,options:tR}),t$=()=>{let{isDesktop:e}=(0,s.Z)();return e?(0,l.jsx)(t_.Z,{onClick:()=>g.default.openDialog(p.default.DIALOGS.CREATIVE_STUDIO),children:"Creative Studio"}):null};var t1=()=>{var e,t,a;let{page:i,search:n,filter:o,handlePageChange:s,handleFilterChange:d,handleSearchChange:u}=(0,T.zn)(),E=(0,eW.Z)(n,600),[m,C]=(0,c.useState)(null),{data:I=[],isLoading:A,response:h,mutate:f}=v.Z.useListCreatives({page:i+1,search:E,filter:o}),{datagridProps:{toolbarActions:g,shouldAppearConfirmation:R,handleSubmitEdit:_,handleCancelEdit:S,apiRef:x,handleCommitEdit:D,handleCommitError:y},dialogProps:N}=tK({creatives:I,mutate:f}),P=E||o,M=!(I&&I.length)&&!A,b=h?eY.ZP.getTotalCount(h):0;return(0,l.jsxs)(r.Z,{sx:tJ,children:[!P&&M?(0,l.jsx)(tW,{}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(T.ZP,{search:n,rows:null!=I?I:[],rowCount:b,loading:A,actions:[{Component:t$,key:"creative-studio"},{Component:tQ,key:"upload"}],columns:ti({creativeNameDetailsRenderCellProps:{hasViewButton:!0},onOpenDetails:C}),searchPlaceholder:"Search creatives",filterMode:"server",paginationMode:"server",paginationModel:{page:i,pageSize:p.default.DATA_GRID.PAGINATION.PAGE_SIZE},multipleSelection:!0,pagination:!0,onPaginationModelChange:s,onSearchChange:u,onFilterChange:d,isEditionConfirmation:R,toolbarActions:g,onSubmitEdit:_,onCancelEdit:S,apiRef:x,processRowUpdate:D,onProcessRowUpdateError:y,isCellEditable:e=>
1!("name"===e.field&&e.row.type===p.default.CREATIVE.TYPE.RICH_MEDIA),initialState:{sorting:{sortModel:[{field:"updated_at",sort:"desc"}]}}}),(0,l.jsx)(tZ.Z,{...N.remove}),(0,l.jsx)(tO.Z,{onContinue:()=>{}})]}),(0,l.jsx)(eH.D,{id:null!==(e=null==m?void 0:m.id)&&void 0!==e?e:"",name:null!==(t=null==m?void 0:m.name)&&void 0!==t?t:"",open:!!m,type:null!==(a=null==m?void 0:m.type)&&void 0!==a?a:"creative",onClose:()=>C(null)}),(0,l.jsx)(eB,{onAddCreative:()=>f()}),(0,l.jsx)(tG.Z,{})]})}},275:function(e,t,a){a.d(t,{Z:function(){return C},z:function(){return l.Z}});var l=a(1478),i=a(85893),r=a(67294),n=a(35428),o=a(80210),s=a(60747),d=a(58450),c=a(53066),u=a(38189);let E=e=>{n.ZP.dispatch(n.Nw.unsavedChangesModal.setShouldNavigate(["datagrid",e]))},p=(e,t)=>{var a;let l=(0,r.useRef)({});return e.length&&(null===(a=t.current)||void 0===a?void 0:a.getRowId)&&!Object.keys(l.current).length&&(l.current=e.reduce((e,a)=>{let l=t.current.getRowId(a);return{...e,[l]:a}},{})),l},m=(e,t,a)=>null==e?void 0:e.map(e=>({...e,onClick:l=>{var i;null===(i=e.onClick)||void 0===i||i.call(e,l,{editedRows:t,initialRows:a})}}));var C=e=>{let{rows:t,processRowUpdate:a,onSave:l,onCancel:n,toolbarActions:C,confirmDiscardChanges:T=!1,...I}=e,A=(0,s.A)(),h=p(t,A),[f,v]=(0,r.useState)({}),[g,R]=(0,r.useState)(!1),_=m(C,f,h.current),S=async(e,t)=>{var l;let i=null!==(l=await (null==a?void 0:a(e,t)))&&void 0!==l?l:e,r=A.current.getRowId(i),n=JSON.stringify(i)===JSON.stringify(t)?(0,d.Z)([String(r)],f):{...f,[r]:i};return v(n),E(Object.keys(n).length>0),i},x=()=>{null==n||n({apiRef:A,editedRows:f,initialRows:h.current}),v({}),E(!1),R(!1),A.current.setRows(Object.values(h.current))},D=async()=>{try{await (null==l?void 0:l({apiRef:A,editedRows:f,initialRows:h.current})),v({}),E(!1)}catch(e){u.ZP.error(e.message)}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.ZP,{apiRef:A,rows:t,onSubmitEdit:D,onCancelEdit:()=>{if(T){R(!0);return}x()},processRowUpdate:S,isEditionConfirmation:Object.keys(f).length>0,toolbarActions:_,...I}),(0,i.jsx)(c.Z,{title:"Discard changes",open:g,onClose:()=>R(!1),onConfirm:x})]})}}}]);
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.