(self.webpackChunk_digicommerce_cms_admin=self.webpackChunk_digicommerce_cms_admin||[]).push([[5905],{70404:function(G,X,a){(function(n,s){G.exports=s(a(32735))})(this,function(n){return function(s){var v={};function c(r){if(v[r])return v[r].exports;var i=v[r]={i:r,l:!1,exports:{}};return s[r].call(i.exports,i,i.exports,c),i.l=!0,i.exports}return c.m=s,c.c=v,c.d=function(r,i,f){c.o(r,i)||Object.defineProperty(r,i,{enumerable:!0,get:f})},c.r=function(r){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},c.t=function(r,i){if(1&i&&(r=c(r)),8&i||4&i&&typeof r=="object"&&r&&r.__esModule)return r;var f=Object.create(null);if(c.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:r}),2&i&&typeof r!="string")for(var x in r)c.d(f,x,function(O){return r[O]}.bind(null,x));return f},c.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return c.d(i,"a",i),i},c.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},c.p="",c(c.s=103)}({0:function(s,v){s.exports=n},103:function(s,v,c){"use strict";c.r(v);var r=c(0);function i(){return(i=Object.assign||function(f){for(var x=1;x<arguments.length;x++){var O=arguments[x];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(f[S]=O[S])}return f}).apply(this,arguments)}v.default=function(f){return r.createElement("svg",i({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f),r.createElement("path",{d:"M4.8.2c0-.11.09-.2.2-.2h18.8c.11 0 .2.09.2.2v4.4a.2.2 0 01-.2.2H5a.2.2 0 01-.2-.2V.2zM0 9.8c0-.11.09-.2.2-.2H19c.11 0 .2.09.2.2v4.4a.2.2 0 01-.2.2H.2a.2.2 0 01-.2-.2V9.8zM5 19.2a.2.2 0 00-.2.2v4.4c0 .11.09.2.2.2h18.8a.2.2 0 00.2-.2v-4.4a.2.2 0 00-.2-.2H5z",fill:"#212134"}))}}})})},33970:function(G,X,a){(function(n,s){G.exports=s(a(32735))})(this,function(n){return function(s){var v={};function c(r){if(v[r])return v[r].exports;var i=v[r]={i:r,l:!1,exports:{}};return s[r].call(i.exports,i,i.exports,c),i.l=!0,i.exports}return c.m=s,c.c=v,c.d=function(r,i,f){c.o(r,i)||Object.defineProperty(r,i,{enumerable:!0,get:f})},c.r=function(r){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},c.t=function(r,i){if(1&i&&(r=c(r)),8&i||4&i&&typeof r=="object"&&r&&r.__esModule)return r;var f=Object.create(null);if(c.r(f),Object.defineProperty(f,"default",{enumerable:!0,value:r}),2&i&&typeof r!="string")for(var x in r)c.d(f,x,function(O){return r[O]}.bind(null,x));return f},c.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return c.d(i,"a",i),i},c.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},c.p="",c(c.s=109)}({0:function(s,v){s.exports=n},109:function(s,v,c){"use strict";c.r(v);var r=c(0);function i(){return(i=Object.assign||function(f){for(var x=1;x<arguments.length;x++){var O=arguments[x];for(var S in O)Object.prototype.hasOwnProperty.call(O,S)&&(f[S]=O[S])}return f}).apply(this,arguments)}v.default=function(f){return r.createElement("svg",i({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f),r.createElement("path",{d:"M19 10h1a1 1 0 011 1v10a1 1 0 01-1 1H4a1 1 0 01-1-1V11a1 1 0 011-1h1V9a7 7 0 0114 0v1zm-2 0V9A5 5 0 007 9v1h10zm-6 4v4h2v-4h-2z",fill:"#8E8EA9"}))}}})})},2863:(G,X,a)=>{"use strict";a.r(X),a.d(X,{default:()=>Qt});var n=a(32735),s=a(88425),v=a(59290),c=a.n(v),r=a(98599),i=a.n(r),f=a(88677),x=a.n(f),O=a(95717),S=a.n(O),H=a(44526),_=a(19192),Z=a(90662),P=a(9808),ce=a(11856),Ze=a(33795),L=a.n(Ze),Ae=a(23973),Fe=a.n(Ae),ke=a(89793),de=a.n(ke),Ne=a(23940),pe=a.n(Ne),K=a(5636),ee=a(5141),Ve=a(60216),l=a.n(Ve),$=a(95602),M=a(53214),ue=a(32237),V=a(198),E=a(19615),w=a(92318),ze=a(94009),Ue=a.n(ze),We=a(16925);const me=(0,E.default)(We.G)`
  width: ${(0,s.pxToRem)(32)} !important;
  height: ${(0,s.pxToRem)(32)} !important;
  padding: ${(0,s.pxToRem)(9)};
  border-radius: ${(0,s.pxToRem)(64)};
  background: ${({theme:e})=>e.colors.neutral150};
  path {
    fill: ${({theme:e})=>e.colors.neutral500};
  }
`,fe=E.default.div`
  position: absolute;
  display: none;
  top: 5px;
  right: ${(0,s.pxToRem)(8)};

  svg {
    width: ${(0,s.pxToRem)(10)};
    height: ${(0,s.pxToRem)(10)};
    path {
      fill: ${({theme:e})=>e.colors.primary600};
    }
  }
`,He=(0,E.default)(P.Box)`
  flex-shrink: 0;
  width: ${(0,s.pxToRem)(140)};
  height: ${(0,s.pxToRem)(80)};
  position: relative;
  border: 1px solid ${({theme:e})=>e.colors.neutral200};
  background: ${({theme:e})=>e.colors.neutral100};
  border-radius: ${({theme:e})=>e.borderRadius};
  display: flex;
  justify-content: center;
  align-items: center;

  &.active,
  &:hover {
    border: 1px solid ${({theme:e})=>e.colors.primary200};
    background: ${({theme:e})=>e.colors.primary100};

    ${fe} {
      display: block;
    }

    ${me} {
      background: ${({theme:e})=>e.colors.primary200};
      path {
        fill: ${({theme:e})=>e.colors.primary600};
      }
    }

    ${$.Typography} {
      color: ${({theme:e})=>e.colors.primary600};
    }
  }
`,Ke=(0,E.default)(Z.Stack)`
  align-items: center;
`;function te({component:e,dzName:t,index:o,isActive:p,isInDevelopmentMode:u,onClick:m}){const{modifiedData:h,removeComponentFromDynamicZone:T}=(0,V.Z)(),{schema:{icon:y,displayName:b}}=L()(h,["components",e],{schema:{icon:null}}),C=d=>{d.stopPropagation(),T(t,o)};return n.createElement("button",{type:"button",onClick:m},n.createElement(He,{className:p?"active":"",borderRadius:"borderRadius",paddingLeft:4,paddingRight:4},n.createElement(Ke,{spacing:1},n.createElement(me,{icon:y||"dice-d6"}),n.createElement(P.Box,{maxWidth:`calc(${(0,s.pxToRem)(140)} - 32px)`},n.createElement($.Typography,{variant:"pi",fontWeight:"bold",ellipsis:!0},b))),u&&n.createElement(fe,{role:"button",tabIndex:0,onKeyDown:d=>(d.key==="Enter"||d.key===" ")&&C(d),onClick:C},n.createElement(Ue(),null))))}te.defaultProps={component:null,isActive:!1,isInDevelopmentMode:!1,onClick:()=>{}},te.propTypes={component:l().string,dzName:l().string.isRequired,index:l().number.isRequired,isActive:l().bool,isInDevelopmentMode:l().bool,onClick:l().func};const Ge=te,ge=E.default.tr`
  &.component-row,
  &.dynamiczone-row {
    position: relative;
    border-top: none !important;

    table tr:first-child {
      border-top: none;
    }

    > td:first-of-type {
      padding: 0 0 0 ${(0,s.pxToRem)(20)};
      position: relative;

      &::before {
        content: '';
        width: ${(0,s.pxToRem)(4)};
        height: calc(100% - 40px);
        position: absolute;
        top: -7px;
        left: 1.625rem;
        border-radius: 4px;

        ${({isFromDynamicZone:e,isChildOfDynamicZone:t,theme:o})=>t?`background-color: ${o.colors.primary200};`:e?`background-color: ${o.colors.primary200};`:`background: ${o.colors.neutral150};`}
      }
    }
  }

  &.dynamiczone-row > td:first-of-type {
    padding: 0;
  }
`;function ne({customRowComponent:e,component:t,isFromDynamicZone:o,isNestedInDZComponent:p,firstLoopComponentUid:u}){const{modifiedData:m}=(0,V.Z)(),{schema:{attributes:h}}=L()(m,["components",t],{schema:{attributes:[]}});return n.createElement(ge,{isChildOfDynamicZone:o,className:"component-row"},n.createElement("td",{colSpan:12},n.createElement(Pe,{customRowComponent:e,items:h,targetUid:t,firstLoopComponentUid:u||t,editTarget:"components",isFromDynamicZone:o,isNestedInDZComponent:p,isSub:!0,secondLoopComponentUid:u?t:null})))}ne.defaultProps={component:null,customRowComponent:null,firstLoopComponentUid:null,isFromDynamicZone:!1,isNestedInDZComponent:!1},ne.propTypes={component:l().string,customRowComponent:l().func,firstLoopComponentUid:l().string,isFromDynamicZone:l().bool,isNestedInDZComponent:l().bool};const ye=ne;var Xe=Object.defineProperty,Je=Object.defineProperties,Qe=Object.getOwnPropertyDescriptors,ve=Object.getOwnPropertySymbols,Ye=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,he=(e,t,o)=>t in e?Xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,_e=(e,t)=>{for(var o in t||(t={}))Ye.call(t,o)&&he(e,o,t[o]);if(ve)for(var o of ve(t))qe.call(t,o)&&he(e,o,t[o]);return e},et=(e,t)=>Je(e,Qe(t));const tt=(0,E.default)(c())`
  width: ${(0,s.pxToRem)(32)};
  height: ${(0,s.pxToRem)(32)};
  padding: ${(0,s.pxToRem)(9)};
  border-radius: ${(0,s.pxToRem)(64)};
  background: ${({theme:e})=>e.colors.primary100};
  path {
    fill: ${({theme:e})=>e.colors.primary600};
  }
`,nt=(0,E.default)(P.Box)`
  height: ${(0,s.pxToRem)(90)};
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
`,ot=(0,E.default)(Z.Stack)`
  width: 100%;
  overflow-x: auto;
`,rt=(0,E.default)(P.Box)`
  padding-top: ${(0,s.pxToRem)(90)};
`,at=(0,E.default)(Z.Stack)`
  flex-shrink: 0;
  width: ${(0,s.pxToRem)(140)};
  height: ${(0,s.pxToRem)(80)};
  justify-content: center;
  align-items: center;
`;function oe({customRowComponent:e,components:t,addComponent:o,name:p,targetUid:u}){const{isInDevelopmentMode:m}=(0,V.Z)(),[h,T]=(0,n.useState)(0),{formatMessage:y}=(0,K.useIntl)(),b=d=>{h!==d&&T(d)},C=()=>{o(p)};return n.createElement(ge,{className:"dynamiczone-row",isFromDynamicZone:!0},n.createElement("td",{colSpan:12},n.createElement(nt,{paddingLeft:8},n.createElement(ot,{horizontal:!0,spacing:2},m&&n.createElement("button",{type:"button",onClick:C},n.createElement(at,{spacing:1},n.createElement(tt,null),n.createElement($.Typography,{variant:"pi",fontWeight:"bold",textColor:"primary600"},y({id:(0,w.Z)("button.component.add"),formatMessage:"Add a component"})))),t.map((d,g)=>n.createElement(Ge,{key:d,dzName:p,index:g,component:d,isActive:h===g,isInDevelopmentMode:m,onClick:()=>b(g)})))),n.createElement(rt,null,t.map((d,g)=>{const I={customRowComponent:e,component:d};return n.createElement(P.Box,{tabId:`${g}`,key:d,style:{display:h===g?"block":"none"}},n.createElement("table",null,n.createElement("tbody",null,n.createElement(ye,et(_e({},I),{isFromDynamicZone:!0,targetUid:u,key:d})))))}))))}oe.defaultProps={addComponent:()=>{},components:[],customRowComponent:null,name:null},oe.propTypes={addComponent:l().func,components:l().instanceOf(Array),customRowComponent:l().func,name:l().string,targetUid:l().string.isRequired};const lt=oe,it=(0,E.default)(P.Box)`
  table {
    width: 100%;
    white-space: nowrap;
  }

  thead {
    border-bottom: 1px solid ${({theme:e})=>e.colors.neutral150};

    tr {
      border-top: 0;
    }
  }

  tr {
    border-top: 1px solid ${({theme:e})=>e.colors.neutral150};

    & td,
    & th {
      padding: ${({theme:e})=>e.spaces[4]};
    }

    & td:first-of-type,
    & th:first-of-type {
      padding: 0 ${({theme:e})=>e.spaces[1]};
    }
  }

  th,
  td {
    vertical-align: middle;
    text-align: left;
    color: ${({theme:e})=>e.colors.neutral600};
    outline-offset: -4px;
  }
`;var st=Object.defineProperty,J=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Te=(e,t,o)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ct=(e,t)=>{for(var o in t||(t={}))be.call(t,o)&&Te(e,o,t[o]);if(J)for(var o of J(t))Ee.call(t,o)&&Te(e,o,t[o]);return e},dt=(e,t)=>{var o={};for(var p in e)be.call(e,p)&&t.indexOf(p)<0&&(o[p]=e[p]);if(e!=null&&J)for(var p of J(e))t.indexOf(p)<0&&Ee.call(e,p)&&(o[p]=e[p]);return o};const pt=(0,E.default)(P.Box)`
  height: ${24/16}rem;
  width: ${24/16}rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;

  svg {
    height: ${10/16}rem;
    width: ${10/16}rem;
  }

  svg path {
    fill: ${({theme:e,color:t})=>e.colors[`${t}600`]};
  }
`,ut=(0,E.default)(P.Box)`
  border-radius: 0 0 ${({theme:e})=>e.borderRadius} ${({theme:e})=>e.borderRadius};
  display: block;
  width: 100%;
  border: none;
  position: relative;
  left: -0.25rem;
`,Ce=e=>{var t=e,{children:o,icon:p,color:u}=t,m=dt(t,["children","icon","color"]);return n.createElement(ut,ct({paddingBottom:4,paddingTop:4,as:"button",type:"button"},m),n.createElement(_.Flex,null,n.createElement(pt,{color:u,"aria-hidden":!0,background:`${u}200`},p),n.createElement(P.Box,{paddingLeft:3},n.createElement($.Typography,{variant:"pi",fontWeight:"bold",textColor:`${u}600`},o))))};Ce.propTypes={color:l().string.isRequired,children:l().string.isRequired,icon:l().node.isRequired};const mt=Ce;var ft=Object.defineProperty,gt=Object.defineProperties,yt=Object.getOwnPropertyDescriptors,xe=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable,we=(e,t,o)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Q=(e,t)=>{for(var o in t||(t={}))vt.call(t,o)&&we(e,o,t[o]);if(xe)for(var o of xe(t))ht.call(t,o)&&we(e,o,t[o]);return e},re=(e,t)=>gt(e,yt(t));function ae({addComponentToDZ:e,customRowComponent:t,editTarget:o,firstLoopComponentUid:p,isFromDynamicZone:u,isMain:m,isNestedInDZComponent:h,isSub:T,items:y,secondLoopComponentUid:b,targetUid:C}){const{formatMessage:d}=(0,K.useIntl)(),{trackUsage:g}=(0,s.useTracking)(),{isInDevelopmentMode:I,modifiedData:B,isInContentTypeView:D}=(0,V.Z)(),{onOpenModalAddField:A}=(0,ue.Z)(),F=()=>{g("hasClickedCTBAddFieldBanner"),A({forTarget:o,targetUid:C})};return C?y.length===0&&m?n.createElement(M.Table,{colCount:2,rowCount:2},n.createElement(M.Thead,null,n.createElement(M.Tr,null,n.createElement(M.Th,null,n.createElement($.Typography,{variant:"sigma",textColor:"neutral600"},d({id:"global.name",defaultMessage:"Name"}))),n.createElement(M.Th,null,n.createElement($.Typography,{variant:"sigma",textColor:"neutral600"},d({id:"global.type",defaultMessage:"Type"}))))),n.createElement(s.EmptyBodyTable,{action:n.createElement(H.Button,{onClick:F,size:"L",startIcon:n.createElement(c(),null),variant:"secondary"},d({id:(0,w.Z)("table.button.no-fields"),defaultMessage:"Add new field"})),colSpan:2,content:D?{id:(0,w.Z)("table.content.no-fields.collection-type"),defaultMessage:"Add your first field to this Collection-Type"}:{id:(0,w.Z)("table.content.no-fields.component"),defaultMessage:"Add your first field to this component"}})):n.createElement(n.Fragment,null,n.createElement(it,null,n.createElement(P.Box,Q({paddingLeft:6,paddingRight:m?6:0},m&&{style:{overflowX:"auto"}}),n.createElement("table",null,m&&n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",null,n.createElement($.Typography,{variant:"sigma",textColor:"neutral600"},d({id:"global.name",defaultMessage:"Name"}))),n.createElement("th",{colSpan:"2"},n.createElement($.Typography,{variant:"sigma",textColor:"neutral600"},d({id:"global.type",defaultMessage:"Type"}))))),n.createElement("tbody",null,y.map(R=>{const{type:k}=R,z=t;return n.createElement(n.Fragment,{key:R.name},n.createElement(z,re(Q({},R),{isNestedInDZComponent:h,targetUid:C,editTarget:o,firstLoopComponentUid:p,isFromDynamicZone:u,secondLoopComponentUid:b})),k==="component"&&n.createElement(ye,re(Q({},R),{customRowComponent:t,targetUid:C,isNestedInDZComponent:u,editTarget:o,firstLoopComponentUid:p})),k==="dynamiczone"&&n.createElement(lt,re(Q({},R),{customRowComponent:t,addComponent:e,targetUid:C})))})))),m&&I&&n.createElement(M.TFooter,{icon:n.createElement(c(),null),onClick:F},d({id:(0,w.Z)(`form.button.add.field.to.${B.contentType?B.contentType.schema.kind:o||"collectionType"}`),defaultMessage:"Add another field"})),T&&I&&n.createElement(mt,{icon:n.createElement(c(),null),onClick:F,color:u?"primary":"neutral"},d({id:(0,w.Z)("form.button.add.field.to.component"),defaultMessage:"Add another field"})))):n.createElement(M.Table,{colCount:2,rowCount:2},n.createElement(M.Thead,null,n.createElement(M.Tr,null,n.createElement(M.Th,null,n.createElement($.Typography,{variant:"sigma",textColor:"neutral600"},d({id:"global.name",defaultMessage:"Name"}))),n.createElement(M.Th,null,n.createElement($.Typography,{variant:"sigma",textColor:"neutral600"},d({id:"global.type",defaultMessage:"Type"}))))),n.createElement(s.EmptyBodyTable,{colSpan:2,content:{id:(0,w.Z)("table.content.create-first-content-type"),defaultMessage:"Create your first Collection-Type"}}))}ae.defaultProps={addComponentToDZ:()=>{},customRowComponent:null,firstLoopComponentUid:null,isFromDynamicZone:!1,isNestedInDZComponent:!1,isMain:!1,isSub:!1,items:[],secondLoopComponentUid:null,targetUid:null},ae.propTypes={addComponentToDZ:l().func,customRowComponent:l().func,editTarget:l().string.isRequired,firstLoopComponentUid:l().string,isFromDynamicZone:l().bool,isNestedInDZComponent:l().bool,isMain:l().bool,items:l().instanceOf(Array),secondLoopComponentUid:l().string,targetUid:l().string,isSub:l().bool};const Pe=ae;var Oe=a(20763),bt=a(33970),Et=a.n(bt),Tt=a(76470),Ct=a.n(Tt),xt=Object.defineProperty,$e=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable,Le=(e,t,o)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Ot=(e,t)=>{for(var o in t||(t={}))wt.call(t,o)&&Le(e,o,t[o]);if($e)for(var o of $e(t))Pt.call(t,o)&&Le(e,o,t[o]);return e};const $t=(0,E.default)(P.Box)`
  position: absolute;
  left: -1.125rem;
  top: 0px;

  &:before {
    content: '';
    width: ${4/16}rem;
    height: ${12/16}rem;
    background: ${({theme:e,color:t})=>e.colors[t]};
    display: block;
  }
`,Lt=E.default.svg`
  position: relative;
  flex-shrink: 0;
  transform: translate(-0.5px, -1px);

  * {
    fill: ${({theme:e,color:t})=>e.colors[t]};
  }
`,Me=e=>n.createElement($t,null,n.createElement(Lt,Ot({width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.02477 14.7513C8.65865 17.0594 11.6046 18.6059 17.5596 18.8856C18.6836 18.9384 19.5976 19.8435 19.5976 20.9688V20.9688C19.5976 22.0941 18.6841 23.0125 17.5599 22.9643C10.9409 22.6805 6.454 20.9387 3.75496 17.1258C0.937988 13.1464 0.486328 7.39309 0.486328 0.593262H4.50974C4.50974 7.54693 5.06394 11.9813 7.02477 14.7513Z"})));Me.propTypes={color:l().string.isRequired};const Mt=Me,le=({content:e})=>pe()(e);le.defaultProps={content:null},le.propTypes={content:l().string};const Rt=le,St=(0,E.default)(P.Box)`
  position: relative;
`;var Bt=a(25747),Dt=Object.defineProperty,Re=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,Se=(e,t,o)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Be=(e,t)=>{for(var o in t||(t={}))It.call(t,o)&&Se(e,o,t[o]);if(Re)for(var o of Re(t))jt.call(t,o)&&Se(e,o,t[o]);return e};function ie({configurable:e,editTarget:t,firstLoopComponentUid:o,isFromDynamicZone:p,name:u,onClick:m,relation:h,repeatable:T,secondLoopComponentUid:y,target:b,targetUid:C,type:d}){const{contentTypes:g,isInDevelopmentMode:I,removeAttribute:B}=(0,V.Z)(),{formatMessage:D}=(0,K.useIntl)(),A=d==="relation"&&h.includes("morph"),F=["integer","biginteger","float","decimal"].includes(d)?"number":d;let R=d;["integer","biginteger","float","decimal"].includes(d)?R="number":["string"].includes(d)&&(R="text");const k=L()(g,[b],{}),z=L()(k,["schema","displayName"],""),Y=L()(k,"plugin"),q=b?"relation":F,U=()=>{A||e!==!1&&m(t,y||o||C,u,d)};let W;return y&&o?W=2:o?W=1:W=0,n.createElement(St,Be({as:"tr"},(0,s.onRowClick)({fn:U,condition:I&&e&&!A})),n.createElement("td",{style:{position:"relative"}},W!==0&&n.createElement(Mt,{color:p?"primary200":"neutral150"}),n.createElement(Z.Stack,{paddingLeft:2,spacing:4,horizontal:!0},n.createElement(Bt.Z,{key:q,type:q}),n.createElement($.Typography,{fontWeight:"bold"},u))),n.createElement("td",null,b?n.createElement($.Typography,null,D({id:(0,w.Z)(`modelPage.attribute.${A?"relation-polymorphic":"relationWith"}`),defaultMessage:"Relation with"}),"\xA0",n.createElement("span",{style:{fontStyle:"italic"}},n.createElement(Rt,{content:z}),"\xA0",Y&&`(${D({id:(0,w.Z)("from"),defaultMessage:"from"})}: ${Y})`)):n.createElement($.Typography,null,D({id:(0,w.Z)(`attribute.${R}`),defaultMessage:d}),"\xA0",T&&D({id:(0,w.Z)("component.repeatable"),defaultMessage:"(repeatable)"}))),n.createElement("td",null,I?n.createElement(_.Flex,Be({justifyContent:"flex-end"},s.stopPropagation),e?n.createElement(Z.Stack,{horizontal:!0,spacing:1},!A&&n.createElement(Oe.IconButton,{onClick:U,label:`${D({id:"app.utils.edit",defaultMessage:"Edit"})} ${u}`,noBorder:!0,icon:n.createElement(S(),null)}),n.createElement(Oe.IconButton,{onClick:N=>{N.stopPropagation(),B(t,u,y||o||"")},label:`${D({id:"global.delete",defaultMessage:"Delete"})} ${u}`,noBorder:!0,icon:n.createElement(Ct(),null)})):n.createElement(Et(),null)):n.createElement(P.Box,{height:(0,s.pxToRem)(32)})))}ie.defaultProps={configurable:!0,firstLoopComponentUid:null,isFromDynamicZone:!1,onClick:()=>{},relation:"",repeatable:!1,secondLoopComponentUid:null,target:null,targetUid:null,type:null},ie.propTypes={configurable:l().bool,editTarget:l().string.isRequired,firstLoopComponentUid:l().string,isFromDynamicZone:l().bool,name:l().string.isRequired,onClick:l().func,relation:l().string,repeatable:l().bool,secondLoopComponentUid:l().string,target:l().string,targetUid:l().string,type:l().string};const Zt=(0,n.memo)(ie),At=e=>{let t;switch(e){case"date":case"datetime":case"time":case"timestamp":t="date";break;case"integer":case"biginteger":case"decimal":case"float":t="number";break;case"string":case"text":t="text";break;case"":t="relation";break;default:t=e}return t};var Ft=a(70404),kt=a.n(Ft);const Nt={collectionTypesConfigurations:[{action:"plugin::content-manager.collection-types.configure-view",subject:null}],componentsConfigurations:[{action:"plugin::content-manager.components.configure-layout",subject:null}],singleTypesConfigurations:[{action:"plugin::content-manager.single-types.configure-view",subject:null}]},se=({disabled:e,isTemporary:t,isInContentTypeView:o,contentTypeKind:p,targetUid:u})=>{const{formatMessage:m}=(0,K.useIntl)(),{push:h}=(0,ee.useHistory)(),{collectionTypesConfigurations:T,componentsConfigurations:y,singleTypesConfigurations:b}=Nt,C=m({id:"content-type-builder.form.button.configure-view"});let d=T;const g=()=>(t||h(o?`/content-manager/collectionType/${u}/configurations/edit`:`/content-manager/components/${u}/configurations/edit`),!1);return o&&p==="singleType"&&(d=b),o||(d=y),n.createElement(s.CheckPermissions,{permissions:d},n.createElement(H.Button,{startIcon:n.createElement(kt(),null),variant:"tertiary",onClick:g,disabled:t||e},C))};se.defaultProps={contentTypeKind:"collectionType",isInContentTypeView:!0,isTemporary:!1,targetUid:""},se.propTypes={disabled:l().bool.isRequired,contentTypeKind:l().string,isInContentTypeView:l().bool,isTemporary:l().bool,targetUid:l().string};const Vt=(0,n.memo)(se);var zt=Object.defineProperty,Ut=Object.defineProperties,Wt=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable,Ie=(e,t,o)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Gt=(e,t)=>{for(var o in t||(t={}))Ht.call(t,o)&&Ie(e,o,t[o]);if(De)for(var o of De(t))Kt.call(t,o)&&Ie(e,o,t[o]);return e},Xt=(e,t)=>Ut(e,Wt(t)),Jt=(e,t,o)=>new Promise((p,u)=>{var m=y=>{try{T(o.next(y))}catch(b){u(b)}},h=y=>{try{T(o.throw(y))}catch(b){u(b)}},T=y=>y.done?p(y.value):Promise.resolve(y.value).then(m,h);T((o=o.apply(e,t)).next())});const Qt=()=>{const{initialData:e,modifiedData:t,isInDevelopmentMode:o,isInContentTypeView:p,submitData:u}=(0,V.Z)(),{formatMessage:m}=(0,K.useIntl)(),{trackUsage:h}=(0,s.useTracking)(),T=(0,ee.useRouteMatch)("/plugins/content-type-builder/:kind/:currentUID"),{onOpenModalAddComponentsToDZ:y,onOpenModalAddField:b,onOpenModalEditField:C,onOpenModalEditSchema:d}=(0,ue.Z)(),g=p?"contentType":"component",I=[g,"schema","attributes"],B=L()(t,[g,"uid"]),D=L()(t,[g,"isTemporary"],!1),A=L()(t,[g,"schema","kind"],null),F=L()(t,I,[]),R=Fe()(e,[g,"plugin"]),k=!de()(t,e),z=p?"contentType":"component",Y=j=>{y({dynamicZoneTarget:j,targetUid:B})},q=(j,qt,_t,je)=>Jt(void 0,null,function*(){const en=At(je);C({forTarget:j,targetUid:qt,attributeName:_t,attributeType:en,step:je==="component"?"2":null})});let U=L()(t,[g,"schema","displayName"],"");const W=L()(t,[g,"schema","kind"],""),N=(T==null?void 0:T.params.currentUID)==="create-content-type";!U&&N&&(U=m({id:(0,w.Z)("button.model.create"),defaultMessage:"Create new collection type"}));const Yt=()=>{const j=W||g;j==="collectionType"&&h("willEditNameOfContentType"),j==="singleType"&&h("willEditNameOfSingleType"),d({modalType:g,forTarget:g,targetUid:B,kind:j})};return n.createElement(n.Fragment,null,n.createElement(ee.Prompt,{message:m({id:(0,w.Z)("prompt.unsaved")}),when:k}),n.createElement(ce.HeaderLayout,{id:"title",primaryAction:o&&n.createElement(Z.Stack,{horizontal:!0,spacing:2},!N&&n.createElement(H.Button,{startIcon:n.createElement(c(),null),variant:"secondary",onClick:()=>{b({forTarget:z,targetUid:B})}},m({id:(0,w.Z)("button.attributes.add.another")})),n.createElement(H.Button,{startIcon:n.createElement(x(),null),onClick:()=>u(),type:"submit",disabled:de()(t,e)},m({id:"global.save",defaultMessage:"Save"}))),secondaryAction:o&&!R&&!N&&n.createElement(H.Button,{startIcon:n.createElement(S(),null),variant:"tertiary",onClick:Yt},m({id:"app.utils.edit",defaultMessage:"Edit"})),title:pe()(U),subtitle:m({id:(0,w.Z)("listView.headerLayout.description"),defaultMessage:"Build the data architecture of your content"}),navigationAction:n.createElement(s.Link,{startIcon:n.createElement(i(),null),to:"/plugins/content-type-builder/"},m({id:"global.back",defaultMessage:"Back"}))}),n.createElement(ce.ContentLayout,null,n.createElement(Z.Stack,{spacing:4},n.createElement(_.Flex,{justifyContent:"flex-end"},n.createElement(Z.Stack,{horizontal:!0,spacing:2},n.createElement(Vt,{key:"link-to-cm-settings-view",targetUid:B,isTemporary:D,isInContentTypeView:p,contentTypeKind:A,disabled:N}))),n.createElement(P.Box,{background:"neutral0",shadow:"filterShadow",hasRadius:!0},n.createElement(Pe,{items:F,customRowComponent:j=>n.createElement(Zt,Xt(Gt({},j),{onClick:q})),addComponentToDZ:Y,targetUid:B,editTarget:z,isMain:!0})))))}}}]);
