slice-machine-ui 2.10.2-beta.1 → 2.10.2-beta.3

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/6523b5bbc256dae9.css" as="style"/><link rel="stylesheet" href="/_next/static/css/6523b5bbc256dae9.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-65ba1b821fc09e9d.js" defer=""></script><script src="/_next/static/chunks/pages/_error-1b183d3cf5ea03f9.js" defer=""></script><script src="/_next/static/gyQaLaGQ56tNIv8VprG9H/_buildManifest.js" defer=""></script><script src="/_next/static/gyQaLaGQ56tNIv8VprG9H/_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":"gyQaLaGQ56tNIv8VprG9H","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/6523b5bbc256dae9.css" as="style"/><link rel="stylesheet" href="/_next/static/css/6523b5bbc256dae9.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-a31bc948075f7bde.js" defer=""></script><script src="/_next/static/chunks/main-8e15d66b38d840e9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-f426f088e0f7a065.js" defer=""></script><script src="/_next/static/chunks/pages/_error-1b183d3cf5ea03f9.js" defer=""></script><script src="/_next/static/QwTkQ4X0gFhCFi0fPMUbd/_buildManifest.js" defer=""></script><script src="/_next/static/QwTkQ4X0gFhCFi0fPMUbd/_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":"QwTkQ4X0gFhCFi0fPMUbd","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,f,b,u,d,h,l,p,k,j,g,o){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[a,p,k,"static/chunks/pages/index-17f953c11b46cb20.js"],"/_error":["static/chunks/pages/_error-1b183d3cf5ea03f9.js"],"/changelog":[s,e,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-365aa7a2d23e3fdf.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-38ab72e6ee071fec.js",c,n,"static/css/9d17b7d9f44c5c5d.css","static/chunks/pages/changes-9e1acd7a02b2cbcb.js"],"/custom-types":[a,p,k,"static/chunks/pages/custom-types-ddc20cfdd8049c04.js"],"/custom-types/[customTypeId]":[s,f,b,u,d,e,i,h,j,c,a,l,g,o,"static/chunks/pages/custom-types/[customTypeId]-2eb64c9ea82fcd0a.js"],"/labs":["static/chunks/pages/labs-1a00abe937ba05e7.js"],"/page-types/[pageTypeId]":[s,f,b,u,d,e,i,h,j,c,a,l,g,o,"static/chunks/pages/page-types/[pageTypeId]-e5a5e6b345081e0a.js"],"/settings":["static/css/e5f781f20e24a5ea.css","static/chunks/pages/settings-8f999bb96b738ab6.js"],"/slices":[s,t,i,c,n,"static/css/b5323377600915db.css","static/chunks/pages/slices-6cfac30e3c77980d.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,f,b,u,d,e,i,h,c,l,n,"static/css/9740e73b8aa87666.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-5acaf1fca398a36c.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/429-6b3405d9cee75624.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-d5df6446669f32d9.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-8e544a511d670317.js","static/chunks/772-936f6233f8a2b1f1.js","static/chunks/372-92310a383394bd51.js","static/chunks/183-b1a9f55f45cb8d8e.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/50-586dc7ab5e584e76.js","static/chunks/639-424b570eee9a37fb.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-642bc2ece03445a4.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/349-6ad3cca7ea294292.js","static/chunks/882-e9ccd4aa9d3ac48a.js","static/chunks/764-30e2601a1647371a.js","static/css/4e475d945cf8a890.css","static/chunks/479-6205c85aa978fc0b.js","static/chunks/150-57d904e6c95df911.js","static/css/850c81be38195a0f.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
1
+ self.__BUILD_MANIFEST=function(s,c,a,e,t,i,n,u,f,b,d,h,l,p,k,j,g,o){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[a,p,k,"static/chunks/pages/index-17f953c11b46cb20.js"],"/_error":["static/chunks/pages/_error-1b183d3cf5ea03f9.js"],"/changelog":[s,e,"static/chunks/870-a72b74312773efea.js","static/chunks/pages/changelog-365aa7a2d23e3fdf.js"],"/changes":[s,t,"static/chunks/8eec4907-b712959d9f984b68.js","static/chunks/918-38ab72e6ee071fec.js",c,n,"static/css/9d17b7d9f44c5c5d.css","static/chunks/pages/changes-9e1acd7a02b2cbcb.js"],"/custom-types":[a,p,k,"static/chunks/pages/custom-types-ddc20cfdd8049c04.js"],"/custom-types/[customTypeId]":[s,u,f,b,d,e,i,h,j,c,a,l,g,o,"static/chunks/pages/custom-types/[customTypeId]-2eb64c9ea82fcd0a.js"],"/labs":["static/chunks/pages/labs-1a00abe937ba05e7.js"],"/page-types/[pageTypeId]":[s,u,f,b,d,e,i,h,j,c,a,l,g,o,"static/chunks/pages/page-types/[pageTypeId]-e5a5e6b345081e0a.js"],"/settings":["static/css/e5f781f20e24a5ea.css","static/chunks/pages/settings-8f999bb96b738ab6.js"],"/slices":[s,t,i,c,n,"static/css/b5323377600915db.css","static/chunks/pages/slices-6cfac30e3c77980d.js"],"/slices/[lib]/[sliceName]/[variation]":[s,t,u,f,b,d,e,i,h,c,l,n,"static/css/9740e73b8aa87666.css","static/chunks/pages/slices/[lib]/[sliceName]/[variation]-5acaf1fca398a36c.js"],"/slices/[lib]/[sliceName]/[variation]/simulator":[t,"static/chunks/72585f70-28b4d7d5384b3703.js","static/chunks/429-6b3405d9cee75624.js","static/chunks/pages/slices/[lib]/[sliceName]/[variation]/simulator-d5df6446669f32d9.js"],sortedPages:["/","/_app","/_error","/changelog","/changes","/custom-types","/custom-types/[customTypeId]","/labs","/page-types/[pageTypeId]","/settings","/slices","/slices/[lib]/[sliceName]/[variation]","/slices/[lib]/[sliceName]/[variation]/simulator"]}}("static/chunks/59b4e022-8e544a511d670317.js","static/chunks/772-936f6233f8a2b1f1.js","static/chunks/372-1608c5e5b72cce7b.js","static/chunks/183-b1a9f55f45cb8d8e.js","static/chunks/c8eae200-966ce352f7b5d2b9.js","static/chunks/50-586dc7ab5e584e76.js","static/chunks/639-424b570eee9a37fb.js","static/chunks/f36c6662-1f3a854183168b10.js","static/chunks/4c744e84-642bc2ece03445a4.js","static/chunks/065a3ddb-9a38ca0d60f0bf2f.js","static/chunks/1cc2734a-09fb3b997ad1eb70.js","static/chunks/349-6ad3cca7ea294292.js","static/chunks/882-e9ccd4aa9d3ac48a.js","static/chunks/764-30e2601a1647371a.js","static/css/4e475d945cf8a890.css","static/chunks/479-6205c85aa978fc0b.js","static/chunks/150-57d904e6c95df911.js","static/css/850c81be38195a0f.css"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[372],{28574:function(e,t,n){"use strict";n.d(t,{R$:function(){return s},Qj:function(){return f},T9:function(){return u},nf:function(){return m},u2:function(){return c},_T:function(){return d}});var r=n(52322),o=n(33760),i=n(6277),l=n(43217),a=n.n(l);let s=e=>{let{backgroundImage:t,style:n,...o}=e,l=void 0!==t;return(0,r.jsx)("article",{...o,className:(0,i.W)(a().root,{[a().withBackground]:l}),style:{backgroundImage:l?"url(".concat(t,")"):void 0,...n}})},c=e=>(0,r.jsx)("div",{...e,className:a().image}),u=e=>(0,r.jsx)("div",{...e,className:a().content}),d=e=>(0,r.jsx)(o.xv,{...e,variant:"h3"}),m=e=>(0,r.jsx)(o.xv,{...e,color:"grey11"}),f=e=>(0,r.jsx)("div",{...e,className:a().actions,color:"grey"})},93216:function(e,t,n){"use strict";n.d(t,{AK:function(){return v},E3:function(){return m},EN:function(){return f},F$:function(){return j},H8:function(){return S},HO:function(){return y},L4:function(){return g},N3:function(){return c},Tr:function(){return d},Ue:function(){return I},eK:function(){return k},gR:function(){return b},j5:function(){return s},mf:function(){return p},vB:function(){return x},xS:function(){return h},y6:function(){return i}});var r=n(98863),o=n(88866);function i(e){var t;return null!==(t=e.format)&&void 0!==t?t:"custom"}function l(e){return Object.entries(e.json)}function a(e){return l(e).find(e=>{let[t,n]=e;return Object.values(n).some(e=>"UID"===e.type)})}function s(e){var t;let[n,r]=null!==(t=a(e))&&void 0!==t?t:[];return Object.entries(null!=r?r:{}).find(e=>{let[t,n]=e;return"UID"===n.type})}function c(e){var t,n;return null!==(n=null==e?void 0:null===(t=e.config)||void 0===t?void 0:t.label)&&void 0!==n?n:void 0}function u(e,t){let n=e.json[t];if(void 0!==n)return Object.entries(n).find(e=>{let[t,n]=e;return n.type===o.SlicesFieldType})}function d(e,t){if(function(e,t){var n;let r=u(e,t),[o,i]=null!=r?r:[];return null!==(n=null==i?void 0:i.config)&&void 0!==n?n:void 0}(e,t))return e;let n=function(e,t){let n;let r=l(e),i=r.findIndex(e=>{let[n]=e;return n===t}),a=r.flatMap(e=>{let[t,n]=e;return Object.keys(n).filter(e=>n[e].type===o.SlicesFieldType)}),s=i;do n="slices".concat(0!==s?s.toString():""),s++;while(a.includes(n));return n}(e,t);return{...e,json:{...e.json,[t]:{...e.json[t],[n]:{type:o.SlicesFieldType,fieldset:"Slice Zone"}}}}}function m(e,t){let n=e.json[t];if(void 0===n)return e;let i=Object.keys(n).find(e=>n[e].type===o.SlicesFieldType);if(void 0===i)return e;let l=(0,r.ud)(n,i);return{...e,json:{...e.json,[t]:l}}}function f(e){var t,n;let{customType:i,sectionId:l,sliceId:a}=e,s=i.json[l];if(void 0===s)return i;let c=Object.keys(s).find(e=>s[e].type===o.SlicesFieldType);if(void 0===c)return i;let u=s[c];if(u.type!==o.SlicesFieldType)return i;let d=(0,r.ud)(null!==(n=null===(t=u.config)||void 0===t?void 0:t.choices)&&void 0!==n?n:{},a);return{...i,json:{...i.json,[l]:{...s,[c]:{...u,config:{...u.config,choices:d}}}}}}function p(e){let t={...e,format:"page"},n=l(e)[0];if(n){let[e]=n;t=d(t,e)}return t}function x(e,t){return{...e,json:{...e.json,[t]:{}}}}function j(e,t){let n=(0,r.ud)(e.json,t);return{...e,json:n}}function y(e,t,n){if(t===n)return e;let r=Object.keys(e.json).reduce((r,o)=>(o===t?r[n]=e.json[o]:r[o]=e.json[o],r),{});return{...e,json:r}}function h(e){let{customType:t,sectionId:n,newField:r,newFieldId:i}=e,l=t.json[n],a=u(t,n),s={...Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return n.type!==o.SlicesFieldType})),[i]:r};if(void 0!==a){let[e,t]=a;s[e]=t}return _({customType:t,sectionId:n,updatedSection:s})}function v(e){let{customType:t,sectionId:n,fieldId:o}=e,i=(0,r.ud)(t.json[n],o);return _({customType:t,sectionId:n,updatedSection:i})}function g(e){let{customType:t,sectionId:n,previousFieldId:r,newFieldId:o,newField:i}=e,l=C({fields:t.json[n],previousFieldId:r,newFieldId:o,newField:i});return _({customType:t,sectionId:n,updatedSection:l})}function b(e){let{customType:t,sectionId:n,sourceIndex:r,destinationIndex:i}=e,l=t.json[n],a=u(t,n),s=Object.fromEntries(Object.entries(l).filter(e=>{let[t,n]=e;return n.type!==o.SlicesFieldType})),c="page"===t.format&&t.repeatable,d=Object.fromEntries(Object.entries(s).filter(e=>{let[t,n]=e;return"UID"!==n.type})),m=function(e){let{fields:t,sourceIndex:n,destinationIndex:r}=e,o=Object.entries(t),[i]=o.splice(n,1);return o.splice(r,0,i),Object.fromEntries(o)}({fields:c?d:s,sourceIndex:r,destinationIndex:i});if(void 0!==a){let[e,t]=a;m[e]=t}let f=Object.entries(m),p=Object.entries(s).find(e=>{let[t,n]=e;return"UID"===n.type});p&&f.unshift(p);let x=Object.fromEntries(f);return _({customType:t,sectionId:n,updatedSection:c?x:m})}function S(e,t){let n=l(t)[0],[r]=null!=n?n:[];return void 0===r?t:h({customType:t,sectionId:r,newField:{type:"UID",config:{label:e}},newFieldId:"uid"})}function k(e,t){var n,r;let[o]=null!==(n=a(t))&&void 0!==n?n:[],[i,l]=null!==(r=s(t))&&void 0!==r?r:[];if(!l||void 0===i||void 0===o)return t;let c=C({fields:t.json[o],previousFieldId:i,newFieldId:i,newField:{...l,config:{...l.config,label:e}}});return _({customType:t,sectionId:o,updatedSection:c})}function _(e){let{customType:t,sectionId:n,updatedSection:r}=e;return{...t,json:{...t.json,[n]:r}}}function C(e){let{fields:t,previousFieldId:n,newFieldId:r,newField:o}=e;return Object.entries(t).reduce((e,t)=>{let[i,l]=t;return i===n?e[r]=o:i!==r&&(e[i]=l),e},{})}function I(e){let{id:t,label:n,repeatable:r,format:o}=e,i=!1===r&&"page"===o?{...T,...B}:!1===r?w:"page"===o?{...F,...B}:O;return{format:o,id:t,json:i,label:n,repeatable:r,status:!0}}let w={Main:{}},T={Main:{slices:{config:{choices:{}},fieldset:"Slice Zone",type:"Slices"}}},O={Main:{uid:{type:"UID",config:{label:"UID"}}}},F={Main:{...O.Main,...T.Main}},B={"SEO & Metadata":{meta_title:{config:{label:"Meta Title",placeholder:"A title of the page used for social media and search engines"},type:"Text"},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"}}}},64910:function(e,t,n){"use strict";n.d(t,{_:function(){return F}});var r=n(52322),o=n(33760),i=n(5632),l=n(2784),a=n(65186),s=n(59326),c=n(75289),u=n(88932),d=n(70647),m=n(77507);async function f(e){let{customType:t,onSuccess:n}=e,r=m.$[t.format];try{let{errors:e}=await d.managerClient.customTypes.deleteCustomType({id:t.id});if(e.length>0)throw e;n(),u.Am.success("".concat(r.name({start:!0,plural:!1})," deleted"))}catch(t){let e="Internal Error: ".concat(r.name({start:!0,plural:!1})," could not be deleted");console.error(e,t),u.Am.error(e)}}var p=n(47861),x=n(76805),j=n(11104),y=n(41067);let h=e=>{var t;let{customType:n,format:o,onClose:i,onDeleteCustomTypeSuccess:u}=e,d=m.$[o],[h,v]=(0,l.useState)(!1),{deleteCustomTypeSuccess:g}=(0,y.Z)(),b=async()=>{v(!0),await f({customType:n,onSuccess:()=>g(n.id)}),u()},{theme:S}=(0,s.B7)();return(0,r.jsx)(j.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:()=>i(),children:(0,r.jsx)(x.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:(0,r.jsxs)(c.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,r.jsxs)(c.kC,{sx:{alignItems:"center"},children:[(0,r.jsx)(a.$vK,{size:20,color:null===(t=S.colors)||void 0===t?void 0:t.greyIcon}),(0,r.jsxs)(c.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:["Delete"," ",d.name({start:!1,plural:!1})]})]}),(0,r.jsx)(c.x8,{type:"button",onClick:()=>i()})]}),Footer:()=>(0,r.jsxs)(c.kC,{sx:{justifyContent:"flex-end",height:64,alignItems:"center",paddingRight:16,borderTop:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"gray"},children:[(0,r.jsx)(p.z,{label:"Cancel",variant:"secondary",onClick:()=>i(),sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),void 0!==n&&(0,r.jsx)(p.z,{label:"Delete",variant:"danger",isLoading:h,onClick:()=>void b(),sx:{minHeight:39,minWidth:78}})]}),children:(0,r.jsxs)("div",{children:["This action will immediately make the following change:",(0,r.jsx)("ul",{children:(0,r.jsxs)("li",{children:["Delete the"," ",(0,r.jsxs)(c.xv,{sx:{fontWeight:"bold"},children:["customtypes/",null==n?void 0:n.id,"/"]})," ","directory."]})}),"The next time you push your changes to Prismic, the following change will happen:",(0,r.jsx)("ul",{children:(0,r.jsxs)("li",{children:["Remove the"," ",d.name({start:!1,plural:!1})," and any associated Documents from your repository."]})})]})})})};var v=n(56580);async function g(e){let{model:t,newLabel:n,onSuccess:r}=e,o=m.$[t.format];try{let e={...t,label:n},{errors:i}=await d.managerClient.customTypes.renameCustomType({model:e});if(i.length>0)throw i;r(e),u.Am.success("".concat(o.name({start:!0,plural:!1})," renamed"))}catch(t){let e="Internal Error: ".concat(o.name({start:!0,plural:!1})," could not be renamed");console.error(e,t),u.Am.error(e)}}var b=n(80546),S=n(40572),k=n(1490),_=n(28801);let C=e=>{var t,n;let{isChangesLocal:o,customType:i,format:a,onClose:s,setLocalCustomType:u}=e,d=null!==(t=null==i?void 0:i.label)&&void 0!==t?t:"",f=null!==(n=null==i?void 0:i.id)&&void 0!==n?n:"",{renameCustomTypeSuccess:p}=(0,y.Z)(),{syncChanges:x}=(0,b.g)(),[j,h]=(0,l.useState)(!1),C=async e=>{h(!0),o&&u?u({...i,label:e.customTypeName}):await g({model:i,newLabel:e.customTypeName,onSuccess:e=>{p(e),x()}}),h(!1),s()},{customTypeLabels:I}=(0,v.v9)(e=>({customTypeLabels:(0,S.YS)(e)})),w=m.$[a];return(0,r.jsx)(k.Z,{isOpen:!0,testId:"rename-custom-type-modal",widthInPx:"530px",formId:"rename-custom-type-modal-".concat(f),buttonLabel:"Rename",close:s,onSubmit:e=>void C(e),initialValues:{customTypeName:d},isLoading:j,content:{title:"Rename a ".concat(w.name({start:!1,plural:!1}))},validate:e=>{let{customTypeName:t}=e,n={};return t&&t.length||(n.customTypeName="Cannot be empty."),void 0!=n.customTypeName&&I.includes(t)&&d!==t&&(n.customTypeName="".concat(w.name({start:!0,plural:!1})," name is already taken.")),Object.keys(n).length>0?n:void 0},children:e=>{let{errors:t}=e;return(0,r.jsx)(c.xu,{children:(0,r.jsx)(_.W,{name:"customTypeName",label:"".concat(w.name({start:!0,plural:!1})," Name"),placeholder:"A display name for the ".concat(w.name({start:!1,plural:!1})),error:t.customTypeName,testId:"custom-type-name-input"})})}})};var I=n(93188),w=n(93216);async function T(e,t){let n=m.$[e.format];try{let r=(0,w.mf)(e),{errors:o}=await (0,I.KA)(r);if(o.length>0)throw o;t(r),u.Am.success("".concat(n.name({start:!0,plural:!1})," converted to page type"))}catch(t){let e="Internal Error: ".concat(n.name({start:!0,plural:!1})," not converted to page type");console.error(e,t),u.Am.error(e)}}var O=n(63447);let F=e=>{let{format:t,customType:n,isChangesLocal:a,setLocalCustomType:s}=e,c=(0,i.useRouter)(),{saveCustomTypeSuccess:u}=(0,y.Z)(),[d,m]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!1),[x,j]=(0,l.useState)(!1),v=async()=>{j(!0),await T(n,u);let e=O.cd.custom.getBuilderPagePathname(n.id);if(c.asPath===e){let e=O.cd.page.getBuilderPagePathname(n.id);c.replace(e),j(!1)}else j(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.h_,{modal:!0,children:[(0,r.jsx)(o.$F,{disabled:x,children:(0,r.jsx)(o.hU,{color:"grey","data-testid":"editDropdown",hiddenLabel:"Custom type actions",icon:"moreVert",loading:x,variant:"solid"})}),(0,r.jsxs)(o.AW,{align:"end",children:[(0,r.jsx)(o.Xi,{startIcon:(0,r.jsx)(o.I5,{name:"edit"}),onSelect:()=>{p(!0)},children:"Rename"}),"custom"===t&&!a&&(0,r.jsx)(o.Xi,{startIcon:(0,r.jsx)(o.I5,{name:"driveFileMove"}),onSelect:()=>void v(),children:"Convert to page type"}),(0,r.jsx)(o.Xi,{color:"tomato",startIcon:(0,r.jsx)(o.I5,{name:"delete"}),onSelect:()=>{m(!0)},children:"Remove"})]})]}),d?(0,r.jsx)(h,{format:t,customType:n,onClose:()=>m(!1),onDeleteCustomTypeSuccess:()=>{var e;let{tablePagePathname:t}=O.cd[null!==(e=n.format)&&void 0!==e?e:"custom"];c.asPath!==t?c.replace(t):m(!1)}}):null,f?(0,r.jsx)(C,{format:t,customType:n,isChangesLocal:a,onClose:()=>p(!1),setLocalCustomType:s}):null]})}},47861:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var r=n(52322),o=n(2784),i=n(75289);let l=(e,t)=>e?"".concat(e,"-").concat(t):"",a=e=>{switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},s=(0,o.forwardRef)((e,t)=>{let{label:n,Icon:o,type:s,form:c,isLoading:u=!1,disabled:d=!1,onClick:m,sx:f={},iconSize:p=16,iconFill:x,variant:j="primary",...y}=e;return(0,r.jsx)(i.zx,{ref:t,sx:{...f,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",...u?{cursor:"wait !important"}:{}},type:s,form:c,disabled:d||u,onClick:u?void 0:m,variant:j,...y,children:u?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.$j,{size:p,color:a(j),"data-testid":l(y["data-testid"],"spinner")}),o&&n]}):(0,r.jsxs)(r.Fragment,{children:[o&&(0,r.jsx)(o,{size:p,fill:x,"data-testid":l(y["data-testid"],"icon")}),n]})})})},28801:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var r=n(52322),o=n(63397);n(2784);var i=n(75289);let l=e=>{let{name:t,label:n,placeholder:l,error:a,testId:s,onChange:c}=e;return(0,r.jsxs)(i.xu,{mb:3,children:[(0,r.jsx)(i.__,{htmlFor:t,mb:2,children:n}),(0,r.jsx)(o.gN,{name:t,type:"text",placeholder:l,as:i.II,autoComplete:"off",...c?{onChange:c}:null,...s?{"data-testid":s}:null}),a?(0,r.jsx)(i.xv,{"data-testid":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:a}):null]})}},1490:function(e,t,n){"use strict";var r=n(52322),o=n(63397),i=n(37149),l=n.n(i),a=n(75289),s=n(47861),c=n(11104),u=n(76805);function d(e){let{children:t}=e,n=(0,u.W)();return(0,r.jsx)(a.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:e=>{var t;return"1px solid ".concat(null===(t=e.colors)||void 0===t?void 0:t.borders)}},children:t})}t.Z=function(e){let{children:t,close:n,isOpen:i,formId:m,validate:f,onSubmit:p,widthInPx:x,initialValues:j,content:{title:y},cardProps:h,omitFooter:v=!1,isLoading:g=!1,buttonLabel:b="Save",testId:S,actionMessage:k}=e;return l().setAppElement("#__next"),(0,r.jsx)(c.Z,{isOpen:i,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:y,style:{content:{width:null!=x?x:"900px"}},children:(0,r.jsx)(o.J9,{initialValues:j,validate:e=>f?f(e):void 0,onSubmit:e=>{p(e)},children:e=>{let{isValid:i,isSubmitting:l,values:c,errors:f,touched:p,setFieldValue:x,setValues:j}=e;return(0,r.jsx)(o.l0,{id:m,...null!=S?{"data-testid":S}:null,children:(0,r.jsx)(u.Z,{borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"},...h,Header:(0,r.jsxs)(d,{children:[(0,r.jsx)(a.X6,{sx:{fontSize:"20px"},children:y}),(0,r.jsx)(a.x8,{type:"button",onClick:n})]}),Footer:v?null:(0,r.jsxs)(a.kC,{sx:{alignItems:"space-between"},children:[(0,r.jsx)(a.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof k?k(e):k}),(0,r.jsxs)(a.kC,{sx:{ml:"auto"},children:[(0,r.jsx)(a.zx,{mr:2,type:"button",onClick:n,variant:"secondary",disabled:l||g,children:"Cancel"}),(0,r.jsx)(s.z,{label:b,form:m,type:"submit",disabled:!i||l||g,isLoading:l||g,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:t({isValid:i,isSubmitting:l,values:c,errors:f,touched:p,setFieldValue:x,setValues:j})})})}})})}},43217:function(e){e.exports={column:"BlankSlate_column__genEe",root:"BlankSlate_root__CmSqW BlankSlate_column__genEe",fadeIn:"BlankSlate_fadeIn__mAfi5",withBackground:"BlankSlate_withBackground__mLYij",image:"BlankSlate_image__Jn90S BlankSlate_column__genEe",content:"BlankSlate_content__0Yt2d BlankSlate_column__genEe",desc:"BlankSlate_desc___Dl7e",actions:"BlankSlate_actions__OYRj4"}}}]);