slice-machine-ui 1.23.2-beta.8 → 1.23.2-beta.9

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/out/404.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e31adcf75e9176d3.js" defer=""></script><script src="/_next/static/chunks/pages/_error-69b4f498bafdd188.js" defer=""></script><script src="/_next/static/vxOhh_oqUIQ5PTSKUKgMR/_buildManifest.js" defer=""></script><script src="/_next/static/vxOhh_oqUIQ5PTSKUKgMR/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"vxOhh_oqUIQ5PTSKUKgMR","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-9448839a9d20924d.js" defer=""></script><script src="/_next/static/chunks/pages/_error-69b4f498bafdd188.js" defer=""></script><script src="/_next/static/sysU54bHKiGDh8pmVpi41/_buildManifest.js" defer=""></script><script src="/_next/static/sysU54bHKiGDh8pmVpi41/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"sysU54bHKiGDh8pmVpi41","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[799],{56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var r=t(62230),o=t(85244),i=t(98240),s=t(52322),c=t(2784),a=t(75289),u=function(e,n){return e?"".concat(e,"-").concat(n):""},l=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,c.forwardRef)(function(e,n){var t=e.label,c=e.Icon,d=e.type,f=e.form,p=e.isLoading,m=void 0!==p&&p,v=e.disabled,y=e.onClick,h=e.sx,x=e.iconSize,g=void 0===x?16:x,Z=e.iconFill,b=e.variant,j=void 0===b?"primary":b,I=(0,i.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,s.jsx)(a.zx,(0,o.Z)((0,r.Z)({ref:n,sx:(0,r.Z)((0,o.Z)((0,r.Z)({},void 0===h?{}:h),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==v&&v||m,onClick:m?void 0:y,variant:j},I),{children:m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.$j,{size:g,color:l(j),"data-cy":u(I["data-cy"],"spinner")}),c&&t]}):(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)(c,{size:g,fill:Z,"data-cy":u(I["data-cy"],"icon")}),t]})}))})},70041:function(e,n,t){"use strict";t.d(n,{W:function(){return c}});var r=t(62230),o=t(52322);t(2784);var i=t(63397),s=t(75289),c=function(e){var n=e.name,t=e.label,c=e.placeholder,a=e.error,u=e.dataCy,l=e.onChange;return(0,o.jsxs)(s.xu,{mb:3,children:[(0,o.jsx)(s.__,{htmlFor:n,mb:2,children:t}),(0,o.jsx)(i.gN,(0,r.Z)({name:n,type:"text",placeholder:c,as:s.II,autoComplete:"off"},l?{onChange:l}:null,u?{"data-cy":u}:null)),a?(0,o.jsx)(s.xv,{"data-cy":u?"".concat(u,"-error"):"input-error",sx:{color:"error",mt:1},children:a}):null]})}},68780:function(e,n,t){"use strict";var r=t(62230),o=t(85244),i=t(52322),s=t(37149),c=t.n(s),a=t(25812),u=t(63397),l=t(75289),d=t(56577),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,s=e.isOpen,p=e.formId,m=e.validate,v=e.onSubmit,y=e.widthInPx,h=e.initialValues,x=e.content.title,g=e.cardProps,Z=e.omitFooter,b=void 0!==Z&&Z,j=e.isLoading,I=void 0!==j&&j,T=e.buttonLabel,_=void 0===T?"Save":T,S=e.dataCy,C=e.actionMessage;return c().setAppElement("#__next"),(0,i.jsx)(a.Z,{isOpen:s,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:x,style:{content:{width:null!=y?y:"900px"}},children:(0,i.jsx)(u.J9,{validateOnChange:!0,initialValues:h,validate:function(e){return m?m(e):void 0},onSubmit:function(e){v(e)},children:function(e){var s=e.isValid,c=e.isSubmitting,a=e.values,m=e.errors,v=e.touched,y=e.setFieldValue,h=e.setValues;return(0,i.jsx)(u.l0,(0,o.Z)((0,r.Z)({id:p},null!=S?{"data-cy":S}:null),{children:(0,i.jsx)(f.Z,(0,o.Z)((0,r.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},g),{Header:function(e){var n=e.radius;return(0,i.jsxs)(l.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,i.jsx)(l.X6,{sx:{fontSize:"20px"},children:x}),(0,i.jsx)(l.x8,{type:"button",onClick:t})]})},Footer:b?null:(0,i.jsxs)(l.kC,{sx:{alignItems:"space-between"},children:[(0,i.jsx)(l.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof C?C(e):C}),(0,i.jsxs)(l.kC,{sx:{ml:"auto"},children:[(0,i.jsx)(l.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:c||I,children:"Cancel"}),(0,i.jsx)(d.z,{label:_,form:p,type:"submit",disabled:!s||c||I,isLoading:c||I,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:s,isSubmitting:c,values:a,errors:m,touched:v,setFieldValue:y,setValues:h})}))}))}})})}},2754:function(e,n,t){"use strict";t.d(n,{R$:function(){return l},Qj:function(){return v},T9:function(){return f},nf:function(){return m},u2:function(){return d},_T:function(){return p}});var r=t(67557),o=t(62230),i=t(85244),s=t(98240),c=t(52322),a=t(6277),u=t(22715);t(69143);var l=function(e){var n=e.backgroundImage,t=e.style,u=(0,s.Z)(e,["backgroundImage","style"]),l=void 0!==n;return(0,c.jsx)("article",(0,i.Z)((0,o.Z)({},u),{className:(0,a.Z)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,r.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",l)),style:(0,o.Z)({backgroundImage:l?"url(".concat(n,")"):void 0},t)}))},d=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},f=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},p=function(e){return(0,c.jsx)(u.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,c.jsx)(u.xv,(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},v=function(e){return(0,c.jsx)("div",(0,i.Z)((0,o.Z)({},e),{className:"_18bjhbz6 _1ecs97dez0 _1ecs97dez8 _1ecs97dez1 _1ecs97dez2 _1ecs97df95 _1ecs97dfdl",color:"grey"}))}},91061:function(e,n,t){"use strict";t.d(n,{AK:function(){return b},E3:function(){return m},EN:function(){return v},F$:function(){return x},GA:function(){return C},HO:function(){return g},L4:function(){return j},Tr:function(){return p},Ue:function(){return L},gR:function(){return I},j6:function(){return _},kQ:function(){return T},l9:function(){return S},mf:function(){return y},vB:function(){return h},xS:function(){return Z},y6:function(){return u}});var r=t(67557),o=t(62230),i=t(85244),s=t(17064),c=t(88866),a=t(98863);function u(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function l(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type===c.SlicesFieldType})}function p(e,n){if(t=e,d=f(t,a=n),(p=(0,s.Z)(null!=d?d:[],2))[0],null!==(u=null==(m=p[1])?void 0:m.config)&&void 0!==u?u:void 0)return e;var t,a,u,d,p,m,v=function(e,n){var t,r=l(e),o=r.findIndex(function(e){return(0,s.Z)(e,1)[0]===n}),i=r.flatMap(function(e){var n=(0,s.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===c.SlicesFieldType})}),a=o;do t="slices".concat(0!==a?a.toString():""),a++;while(i.includes(t));return t}(e,n);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,(0,i.Z)((0,o.Z)({},e.json[n]),(0,r.Z)({},v,{type:c.SlicesFieldType,fieldset:"Slice Zone"}))))})}function m(e,n){var t=d(e,n);if(void 0===t)return e;var s=Object.keys(t).find(function(e){return t[e].type===c.SlicesFieldType});if(void 0===s)return e;var u=(0,a.ud)(t,s);return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,u))})}function v(e){var n,t,s=e.customType,u=e.sectionId,l=e.sliceId,f=d(s,u);if(void 0===f)return s;var p=Object.keys(f).find(function(e){return f[e].type===c.SlicesFieldType});if(void 0===p)return s;var m=f[p];if(m.type!==c.SlicesFieldType)return s;var v=(0,a.ud)(null!==(t=null===(n=m.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},l);return(0,i.Z)((0,o.Z)({},s),{json:(0,i.Z)((0,o.Z)({},s.json),(0,r.Z)({},u,(0,i.Z)((0,o.Z)({},f),(0,r.Z)({},p,(0,i.Z)((0,o.Z)({},m),{config:(0,i.Z)((0,o.Z)({},m.config),{choices:v})})))))})}function y(e){var n,t=(0,i.Z)((0,o.Z)({},e),{format:"page"}),r=l(e)[0];if(r){var c=(0,s.Z)(r,1)[0];t=p(t,c)}return t}function h(e,n){return(0,i.Z)((0,o.Z)({},e),{json:(0,i.Z)((0,o.Z)({},e.json),(0,r.Z)({},n,{}))})}function x(e,n){var t=(0,a.ud)(e.json,n);return(0,i.Z)((0,o.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var r=Object.keys(e.json).reduce(function(r,o){return o===n?r[t]=e.json[o]:r[o]=e.json[o],r},{});return(0,i.Z)((0,o.Z)({},e),{json:r})}function Z(e){var n=e.customType,t=e.sectionId,a=e.newField,u=e.newFieldId,l=n.json[t],d=f(n,t),p=Object.fromEntries(Object.entries(l).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),m=(0,i.Z)((0,o.Z)({},p),(0,r.Z)({},u,a));if(void 0!==d){var v=(0,s.Z)(d,2),y=v[0],h=v[1];m[y]=h}return F({customType:n,sectionId:t,updatedSection:m})}function b(e){var n=e.customType,t=e.sectionId,r=e.fieldId,o=(0,a.ud)(n.json[t],r);return F({customType:n,sectionId:t,updatedSection:o})}function j(e){var n=e.customType,t=e.sectionId,r=e.previousFieldId,o=e.newFieldId,i=e.newField,s=w({fields:n.json[t],previousFieldId:r,newFieldId:o,newField:i});return F({customType:n,sectionId:t,updatedSection:s})}function I(e){var n=e.customType,t=e.sectionId,r=e.sourceIndex,o=e.destinationIndex,i=n.json[t],a=f(n,t),u=Object.fromEntries(Object.entries(i).filter(function(e){var n=(0,s.Z)(e,2);return(n[0],n[1]).type!==c.SlicesFieldType})),l=z({fields:u,sourceIndex:r,destinationIndex:o});if(void 0!==a){var d=(0,s.Z)(a,2),p=d[0],m=d[1];l[p]=m}return F({customType:n,sectionId:t,updatedSection:l})}function T(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,a=e.newField,u=e.newFieldId,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l)return t;var f=O(l,(0,i.Z)((0,o.Z)({},d),(0,r.Z)({},u,a)));return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,f))})}function _(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,u=e.fieldId,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=(0,a.ud)(d,u),p=O(l,f);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,p))})}function S(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,a=e.previousFieldId,u=e.newFieldId,l=e.newField,d=k({customType:t,sectionId:s,groupFieldId:c}),f=null==d?void 0:null===(n=d.config)||void 0===n?void 0:n.fields;if(!d||!f)return t;var p=w({fields:f,previousFieldId:a,newFieldId:u,newField:l}),m=O(d,p);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,m))})}function C(e){var n,t=e.customType,s=e.sectionId,c=e.groupFieldId,a=e.sourceIndex,u=e.destinationIndex,l=k({customType:t,sectionId:s,groupFieldId:c}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=z({fields:d,sourceIndex:a,destinationIndex:u}),p=O(l,f);return F({customType:t,sectionId:s,updatedSection:(0,i.Z)((0,o.Z)({},t.json[s]),(0,r.Z)({},c,p))})}function F(e){var n=e.customType,t=e.sectionId,s=e.updatedSection;return(0,i.Z)((0,o.Z)({},n),{json:(0,i.Z)((0,o.Z)({},n.json),(0,r.Z)({},t,s))})}function w(e){var n=e.fields,t=e.previousFieldId,r=e.newFieldId,o=e.newField;return Object.entries(n).reduce(function(e,n){var i=(0,s.Z)(n,2),c=i[0],a=i[1];return c===t?e[r]=o:c!==r&&(e[c]=a),e},{})}function z(e){var n=e.fields,t=e.sourceIndex,r=e.destinationIndex,o=Object.entries(n),i=(0,s.Z)(o.splice(t,1),1)[0];return o.splice(r,0,i),Object.fromEntries(o)}function k(e){var n=e.customType,t=e.sectionId,r=e.groupFieldId,o=n.json[t][r];if(o.type===c.GroupFieldType)return o}function O(e,n){return(0,i.Z)((0,o.Z)({},e),{config:(0,i.Z)((0,o.Z)({},e.config),{fields:n})})}function L(e){var n,t,r=e.id,i=e.label,s=e.repeatable,c=e.format,a=(n=s,t=c,!1===n&&"page"===t?(0,o.Z)({},R,E):!1===n?N:"page"===t?(0,o.Z)({},M,E):A);return{format:c,id:r,json:a,label:i,repeatable:s,status:!0}}var N={Main:{}},R={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},A={Main:{uid:{config:{label:"UID"},type:"UID"}}},M={Main:(0,o.Z)({},A.Main,R.Main)},E={"SEO & Metadata":{meta_description:{config:{label:"Meta Description",placeholder:"A brief summary of the page"},type:"Text"},meta_image:{config:{constraint:{height:1260,width:2400},label:"Meta Image",thumbnails:[]},type:"Image"},meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"}}}},19345:function(e,n,t){"use strict";t.d(n,{_:function(){return L}});var r=t(22710),o=t(99267),i=t(52322),s=t(2784),c=t(22715),a=t(5632),u=t(90374),l=t(88932),d=t(91061),f=t(82770),p=t(78656);function m(){return(m=(0,r.Z)(function(e,n){var t,r,i,s,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:t=p.$[e.format],o.label=1;case 1:return o.trys.push([1,3,,4]),r=(0,d.mf)(e),[4,(0,f.KA)(r)];case 2:if((i=o.sent().errors).length>0)throw i;return n(r),l.Am.success("".concat(t.name({start:!0,plural:!1})," converted to page type")),[3,4];case 3:return s=o.sent(),c="Internal Error: ".concat(t.name({start:!0,plural:!1})," not converted to page type"),console.error(c,s),l.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v=t(67445),y=t(62230),h=t(85244),x=t(75289),g=t(68780),Z=t(70041),b=t(56580),j=t(31667),I=t(81038);function T(){return(T=(0,r.Z)(function(e){var n,t,r,i,s,c,a,u;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.model,t=e.newLabel,r=e.onSuccess,i=p.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),s=(0,h.Z)((0,y.Z)({},n),{label:t}),[4,I.j.customTypes.renameCustomType({model:s})];case 2:if((c=o.sent().errors).length>0)throw c;return r(s),l.Am.success("".concat(i.name({start:!0,plural:!1})," renamed")),[3,4];case 3:return a=o.sent(),u="Internal Error: ".concat(i.name({start:!0,plural:!1})," could not be renamed"),console.error(u,a),l.Am.error(u),[3,4];case 4:return[2]}})})).apply(this,arguments)}var _=function(e){var n,t,c,a=e.isChangesLocal,l=e.customType,d=e.format,f=e.onClose,m=e.setLocalCustomType,v=null!==(n=null==l?void 0:l.label)&&void 0!==n?n:"",I=null!==(t=null==l?void 0:l.id)&&void 0!==t?t:"",_=(0,u.Z)().renameCustomTypeSuccess,S=(0,s.useState)(!1),C=S[0],F=S[1],w=(c=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:if(F(!0),!(a&&m))return[3,1];return m((0,h.Z)((0,y.Z)({},l),{label:e.customTypeName})),[3,3];case 1:return[4,function(e){return T.apply(this,arguments)}({model:l,newLabel:e.customTypeName,onSuccess:_})];case 2:n.sent(),n.label=3;case 3:return F(!1),f(),[2]}})}),function(e){return c.apply(this,arguments)}),z=(0,b.v9)(function(e){return{customTypeLabels:(0,j.YS)(e)}}).customTypeLabels,k=p.$[d];return(0,i.jsx)(g.Z,{isOpen:!0,dataCy:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(I),buttonLabel:"Rename",close:f,onSubmit:function(e){w(e)},initialValues:{customTypeName:v},isLoading:C,content:{title:"Rename a ".concat(k.name({start:!1,plural:!1}))},validate:function(e){var n=e.customTypeName,t={};return n&&n.length||(t.customTypeName="Cannot be empty."),void 0!=t.customTypeName&&z.includes(n)&&v!==n&&(t.customTypeName="".concat(k.name({start:!0,plural:!1})," name is already taken.")),Object.keys(t).length>0?t:void 0},children:function(e){var n=e.errors;return(0,i.jsx)(x.xu,{children:(0,i.jsx)(Z.W,{name:"customTypeName",label:"".concat(k.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(k.name({start:!1,plural:!1})),error:n.customTypeName,dataCy:"custom-type-name-input"})})}})},S=t(25812),C=t(59326),F=t(54132),w=t(65186),z=t(56577);function k(){return(k=(0,r.Z)(function(e){var n,t,r,i,s,c;return(0,o.__generator)(this,function(o){switch(o.label){case 0:n=e.customType,t=e.onSuccess,r=p.$[n.format],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,I.j.customTypes.deleteCustomType({id:n.id})];case 2:if((i=o.sent().errors).length>0)throw i;return t(),l.Am.success("".concat(r.name({start:!0,plural:!1})," deleted")),[3,4];case 3:return s=o.sent(),c="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted"),console.error(c,s),l.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var O=function(e){var n,t=e.customType,c=e.format,a=e.onClose,l=e.onDeleteCustomTypeSuccess,d=p.$[c],f=(0,s.useState)(!1),m=f[0],v=f[1],y=(0,u.Z)().deleteCustomTypeSuccess,h=(n=(0,r.Z)(function(){return(0,o.__generator)(this,function(e){switch(e.label){case 0:return v(!0),[4,function(e){return k.apply(this,arguments)}({customType:t,onSuccess:function(){return y(t.id)}})];case 1:return e.sent(),l(),[2]}})}),function(){return n.apply(this,arguments)}),g=(0,C.B7)().theme;return(0,i.jsx)(S.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:function(){return a()},children:(0,i.jsx)(F.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none",overflow:"hidden"},borderFooter:!0,Header:function(){var e;return(0,i.jsxs)(x.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,i.jsxs)(x.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(w.$vK,{size:20,color:null===(e=g.colors)||void 0===e?void 0:e.greyIcon}),(0,i.jsxs)(x.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",d.name({start:!1,plural:!1})]})]}),(0,i.jsx)(x.x8,{type:"button",onClick:function(){return a()}})]})},Footer:function(){return(0,i.jsxs)(x.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.darkBorders))},backgroundColor:"gray"},children:[(0,i.jsx)(z.z,{label:"Cancel",variant:"secondary",onClick:function(){return a()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==t&&(0,i.jsx)(z.z,{label:"Delete",variant:"danger",isLoading:m,onClick:function(){h()},sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsxs)("div",{children:["This action will immediately make the following change:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Delete the"," ",(0,i.jsxs)(x.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==t?void 0:t.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,i.jsx)("ul",{children:(0,i.jsxs)("li",{children:["Remove the"," ",d.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})},L=function(e){var n,t=e.format,l=e.customType,d=e.isChangesLocal,f=e.setLocalCustomType,p=(0,a.useRouter)(),y=(0,u.Z)().saveCustomTypeSuccess,h=(0,s.useState)(!1),x=h[0],g=h[1],Z=(0,s.useState)(!1),b=Z[0],j=Z[1],I=(0,s.useState)(!1),T=I[0],S=I[1],C=(n=(0,r.Z)(function(){var e,n;return(0,o.__generator)(this,function(t){switch(t.label){case 0:return S(!0),[4,function(e,n){return m.apply(this,arguments)}(l,y)];case 1:return t.sent(),e=v.cd.custom.getBuilderPagePathname(l.id),p.asPath===e&&(n=v.cd.page.getBuilderPagePathname(l.id),p.replace(n)),S(!1),[2]}})}),function(){return n.apply(this,arguments)}),F=function(){var e,n=v.cd[null!==(e=l.format)&&void 0!==e?e:"custom"].tablePagePathname;p.asPath!==n?p.replace(n):g(!1)};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(c.h_,{modal:!0,children:[(0,i.jsx)(c.$F,{disabled:T,children:(0,i.jsx)(c.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:T,variant:"solid"})}),(0,i.jsxs)(c.AW,{align:"end",children:[(0,i.jsx)(c.Xi,{startIcon:(0,i.jsx)(c.I5,{name:"edit"}),onSelect:function(){j(!0)},children:"Rename"}),"custom"===t&&!d&&(0,i.jsx)(c.Xi,{startIcon:(0,i.jsx)(c.I5,{name:"driveFileMove"}),onSelect:function(){C()},children:"Convert to page type"}),(0,i.jsx)(c.Xi,{color:"tomato",startIcon:(0,i.jsx)(c.I5,{name:"delete"}),onSelect:function(){g(!0)},children:"Remove"})]})]}),x?(0,i.jsx)(O,{format:t,customType:l,onClose:function(){return g(!1)},onDeleteCustomTypeSuccess:F}):null,b?(0,i.jsx)(_,{format:t,customType:l,isChangesLocal:d,onClose:function(){return j(!1)},setLocalCustomType:f}):null]})}},69143:function(){}}]);