slice-machine-ui 2.10.2-alpha.repeatable-link.1 → 2.10.2-alpha.repeatable-link.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-394859e52aee6d6f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-1b183d3cf5ea03f9.js" defer=""></script><script src="/_next/static/tdN8WBOW_IIAE6kTn9YD8/_buildManifest.js" defer=""></script><script src="/_next/static/tdN8WBOW_IIAE6kTn9YD8/_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":"tdN8WBOW_IIAE6kTn9YD8","runtimeConfig":{"sentryEnvironment":"alpha"},"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-968e072396287053.js" defer=""></script><script src="/_next/static/chunks/pages/_error-1b183d3cf5ea03f9.js" defer=""></script><script src="/_next/static/9xYC5E-bkIUIDDNYnFHNC/_buildManifest.js" defer=""></script><script src="/_next/static/9xYC5E-bkIUIDDNYnFHNC/_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":"9xYC5E-bkIUIDDNYnFHNC","runtimeConfig":{"sentryEnvironment":"alpha"},"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,u,d,b,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,u,d,b,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,u,d,b,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,u,d,b,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-5368d04fcad7a3f7.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-880d2f3e70a143e9.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,f,u,d,b,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,u,d,b,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,u,d,b,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,u,d,b,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-5368d04fcad7a3f7.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-2e57f16251594bd2.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([[882],{80775:function(e,t,n){"use strict";n.d(t,{aV:function(){return s},Bu:function(){return d}});var i=n(52322),l=n(33760),r=n(6277),o=n(13938),a=n.n(o);let s=e=>{let{border:t=!0,...n}=e;return(0,i.jsx)("div",{...n,className:(0,r.Z)(a().root,t&&a()["root-border"])})},d=e=>{let{actions:t,children:n,toggle:r,...o}=e;return(0,i.jsxs)("div",{...o,className:a().header,children:[(0,i.jsx)(l.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:n}),r,t?(0,i.jsx)("div",{className:a().headerActions,children:t}):null]})}},87782:function(e,t,n){"use strict";n.d(t,{J9:function(){return i},U:function(){return r},XU:function(){return a},fF:function(){return l}});let i=[{name:"Image",description:"A responsive image.",icon:"image",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295520/DEV_TOOLS/SM_FIELDS/Type_Image_zyatxy.png",type:"Image"},{name:"Text",description:"A text string without formatting.",icon:"title",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295529/DEV_TOOLS/SM_FIELDS/Type_Key_Text_xrqf45.png",type:"Text"},{name:"Rich Text",description:"Text with formatting options.",icon:"textFields",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295530/DEV_TOOLS/SM_FIELDS/Type_Rich_Text_fxdyar.png",type:"StructuredText"},{name:"Boolean",description:"A true or false toggle.",icon:"toggleOff",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295526/DEV_TOOLS/SM_FIELDS/Type_Boolean_cbwg8k.png",type:"Boolean"},{name:"Number",description:"An integer or float.",icon:"pin",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295522/DEV_TOOLS/SM_FIELDS/Type_Number_o3olop.png",type:"Number"},{name:"Select",description:"A dropdown of options.",icon:"arrowDropDownCircle",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295527/DEV_TOOLS/SM_FIELDS/Type_Select_bedjei.png",type:"Select"},{name:"Link",description:"A link to a website, asset, or document.",icon:"link",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295528/DEV_TOOLS/SM_FIELDS/Type_Link_bgslgy.png",type:"Link"},{name:"Link To Media",description:"A link to a media asset.",icon:"attachFile",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295519/DEV_TOOLS/SM_FIELDS/Type_LinkToMedia_m2p0ce.png",type:"Link",variant:"LinkToMedia"},{name:"Color",description:"A color in hex format.",icon:"colorLens",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295521/DEV_TOOLS/SM_FIELDS/Type_Color_nyoeit.png",type:"Color"},{name:"Date",description:"A date without time.",icon:"dateRange",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295525/DEV_TOOLS/SM_FIELDS/Type_Date_dsuaeq.png",type:"Date"},{name:"Timestamp",description:"A date and time.",icon:"schedule",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295524/DEV_TOOLS/SM_FIELDS/Type_Timestamp_fkr5iw.png",type:"Timestamp"},{name:"Embed",description:"A video, song, or oEmbed link.",icon:"code",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295523/DEV_TOOLS/SM_FIELDS/Type_Embed_wwssvd.png",type:"Embed"},{name:"Geopoint",description:"A geographical coordinate.",icon:"place",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295522/DEV_TOOLS/SM_FIELDS/Type_GeoPoint_lpq0sm.png",type:"GeoPoint"},{name:"Content Relationship",description:"A reference to a Prismic document.",icon:"settingsEthernet",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295527/DEV_TOOLS/SM_FIELDS/Type_Content_RelationShip_s4z4nh.png",type:"Link",variant:"ContentRelationship"}],l={name:"UID",description:"Unique Identifier",icon:"tag",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721295519/DEV_TOOLS/SM_FIELDS/Type_UID_hrwzug.png",type:"UID"},r={name:"Repeatable Group",description:"A set of fields that editors can repeat.",icon:"createNewFolder",thumbnail:"https://res.cloudinary.com/dmtf1daqp/image/upload/v1721314577/DEV_TOOLS/SM_FIELDS/Type_Group_uwwco0.png",type:"Group"},o={...r,variant:"NestedGroup"},a=[...i,l,r,o]},6697:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});var i=n(52322),l=n(33760);let r=e=>{let t;let{status:n}=e;switch(n){case"pending":t={icon:(0,i.jsx)(l._3,{color:"grey11"}),text:"Saving..."};break;case"failed":t={icon:(0,i.jsx)(l.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":t={icon:(0,i.jsx)(l.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(l.xu,{gap:8,alignItems:"center",children:[t.icon,(0,i.jsx)(l.xv,{color:"grey11",children:t.text})]})}},81271:function(e,t,n){"use strict";n.d(t,{S:function(){return o}});var i=n(52322),l=n(33760),r=n(87782);function o(e){let{open:t,onOpenChange:n,disabled:o=!1,onSelectField:s,fields:d,triggerDataTestId:c="add-field",trigger:u}=e,p=d.filter(e=>r.J9.some(t=>t.name===e.name)||e.name===r.fF.name),m=d.find(e=>e.name===r.U.name);return(0,i.jsxs)(l.h_,{open:t,onOpenChange:n,children:[(0,i.jsx)(l.$F,{disabled:o,children:null!=u?u:(0,i.jsx)(l.zx,{startIcon:"add",color:"grey","data-testid":c,children:"Add a field"})}),(0,i.jsxs)(l.AW,{align:"end",maxHeight:400,collisionPadding:8,children:[(0,i.jsx)(l.Ju,{children:"Single fields"}),p.map(e=>(0,i.jsx)(a,{field:e,onSelectField:s},e.name)),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Ju,{children:"Set of fields"}),(0,i.jsx)(a,{field:m,onSelectField:s})]})]})]})}function a(e){let{field:t,onSelectField:n}=e,{type:r,variant:o,name:a,icon:s,description:d,thumbnail:c}=t;return(0,i.jsx)(l.Xi,{startIcon:(0,i.jsx)(l.I5,{name:s,size:"large"}),description:d,onSelect:()=>n(null!=o?o:r),renderTooltip:e=>(0,i.jsx)(l.u,{visible:!0,variant:"custom",content:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.Ee,{src:c,borderRadius:4,sx:{height:170,width:278},animateOnLoad:!1}),(0,i.jsx)(l.xv,{color:"white",children:"How it will look for content editors."})]}),align:"start",side:"left",sideOffset:4,animation:"none",children:e}),children:a},"".concat(r).concat(o?"-".concat(o):""))}},47760:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var i=n(52322),l=n(61183);n(2784);var r=n(59326),o=n(75289);l.Z.registerLanguage("svelte",e=>({subLanguage:"xml",contains:[e.COMMENT("<!--","-->",{relevance:10}),{begin:/^(\s*)(<script(\s*context="module")?>)/gm,end:/^(\s*)(<\/script>)/gm,subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,contains:[{begin:/^(\s*)(\$:)/gm,end:/(\s*)/gm,className:"keyword"}]},{begin:/^(\s*)(<style.*>)/gm,end:/^(\s*)(<\/style>)/gm,subLanguage:"css",excludeBegin:!0,excludeEnd:!0},{begin:/\{/gm,end:/\}/gm,subLanguage:"javascript",contains:[{begin:/[\{]/,end:/[\}]/,skip:!0},{begin:/([#:\/@])(if|else|each|await|then|catch|debug|html)/gm,className:"keyword",relevance:10}]}]}));let a=["javascript","bash","xml","html","json"];var s=e=>{var t;let{children:n,lang:s,sx:d,codeStyle:c,codeClass:u,Header:p}=e,{theme:m}=(0,r.B7)(),x=s?l.Z.highlight(n,{language:"vue"===s?"html":s}).value:l.Z.highlightAuto(n,a).value;return(0,i.jsxs)(o.kC,{as:"pre",sx:d,children:[p?(0,i.jsx)(p,{}):null,(0,i.jsx)("code",{className:"hljs".concat(u?" ".concat(u):""),style:{overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(t=m.colors)||void 0===t?void 0:t.textClear),...c},dangerouslySetInnerHTML:{__html:x}})]})}},28325:function(e,t,n){"use strict";n.d(t,{J:function(){return o},k:function(){return r}});var i=n(52322);n(2784);var l=n(75289);let r=e=>{let{children:t,sx:n,...r}=e;return(0,i.jsx)(l.xu,{sx:{display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between",...n},...r,children:t})},o=e=>{let{children:t,cols:n=2}=e;return(0,i.jsx)(l.xu,{sx:{flex:"0 ".concat(100/n-1,"%"),mb:1},children:t})}},81699:function(e,t,n){"use strict";n.d(t,{kp:function(){return d},sP:function(){return c},w8:function(){return u},Hq:function(){return m}});var i,l,r=n(52322),o=n(63397),a=n(2784),s=n(75289),d=e=>{let{field:t,meta:n,fieldName:i,label:l,focusOnNewEntry:d=!0,inputPlaceholder:c,buttonLabel:u}=e,[p,m]=(0,a.useState)(n.value.length),x=(0,a.useRef)(Array(n.value.length));return(0,a.useEffect)(()=>{x.current=x.current.slice(0,n.value.length)},[n.value.length]),(0,a.useEffect)(()=>{let e=x.current.length;d&&e>p&&x.current[e-1].focus(),m(e)},[x.current.length,d,p]),(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)(s.__,{variant:"label.primary",htmlFor:i,children:[l,n.touched&&n.error?(0,r.jsx)(s.xv,{as:"span",variant:"text.labelError",children:n.error}):null]}),(0,r.jsx)(o.F2,{name:i,id:i,...t,render:e=>(0,r.jsxs)("div",{children:[t.value&&t.value.length>0?t.value.map((t,n)=>(0,r.jsxs)(s.kC,{my:2,children:[(0,r.jsx)(s.II,{placeholder:c,name:"".concat(i,".").concat(n),value:t,ref:e=>x.current[n]=e,onChange:t=>{let{target:{value:i}}=t;return e.replace(n,i)}}),(0,r.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:()=>e.remove(n),children:"-"})]},"".concat(i,"-").concat(+n+1))):null,(0,r.jsx)(s.zx,{type:"button",onClick:()=>e.insert(t.value.length,""),children:u})]})})]})},c=e=>{let{initialValues:t,meta:n,label:i,fieldName:l,onChange:a,...d}=e;return(0,r.jsxs)(s.__,{variant:"label.border",...d,children:[(0,r.jsx)(o.gN,{as:s.XZ,type:"checkbox",name:l,onChange:()=>a(!n.value),checked:n.value}),i]})},u=e=>{let{field:t,label:n,defaultValue:i,onChange:l,controlledValue:o,setControlledValue:s,buildControlledValue:d}=e,[u,p]=(0,a.useState)(i||t.defaultValue||!1);return(0,a.useEffect)(()=>{d?s(d(o,u)):s(d)},[u,o,d]),(0,r.jsx)(c,{meta:{value:u},fieldName:t.name,onChange:e=>p(e)&&l&&l(e),label:"function"==typeof n?n(o,u):n})};(i=l||(l={}))[i.ERROR=0]="ERROR",i[i.DISABLED=1]="DISABLED",i[i.WARNING=2]="WARNING";let p=e=>{let t={"&::placeholder":{color:"#C9D0D8"}};switch(e){case 1:return{...t,border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"};case 0:return{...t,border:"1px solid #E26049","&:focus":{outline:"none",borderColor:"#E26049",boxShadow:"0 0 0 3px rgba(226, 96, 73, 0.2), inset 0 1px 2px rgba(226, 96, 73, 0.2)"}};case 2:return{...t,border:"1px solid orange","&:focus":{outline:"none",borderColor:"orange",boxShadow:"0 0 0 3px rgba(255, 165, 0, 0.2), inset 0 1px 2px rgba(255, 165, 0, 0.2)"}};default:return t}},m=e=>{let{sx:t={},field:n,meta:i,formField:l,fieldName:a,fields:d,initialValues:c,isDisabled:u,autoFocus:m}=e,x=i.error?0:u||l.disabled?1:void 0;return(0,r.jsxs)(s.xu,{sx:t,children:[(0,r.jsxs)(s.__,{variant:"label.primary",htmlFor:a,children:[l.label||a,i.touched&&i.error?(0,r.jsx)(s.xv,{as:"span",variant:"text.labelError",children:i.error}):null]}),(0,r.jsx)(o.gN,{id:a,name:a,type:"text",placeholder:l.placeholder||l.label||a,...l.fieldLevelValidation&&c?{validate:e=>l.fieldLevelValidation&&l.fieldLevelValidation({value:e,fields:d,initialId:c.id})}:null,...n,as:s.II,sx:p(x),disabled:u||l.disabled,autoFocus:null!=m?m:l.autoFocus})]})}},89753:function(e,t,n){"use strict";var i=n(52322),l=n(2784),r=n(75289);let o=(0,l.forwardRef)((e,t)=>{let{children:n,Component:l=r.kC,sx:o={},...a}=e;return(0,i.jsx)(l,{as:"li",sx:{p:3,mx:3,alignItems:"center",variant:"styles.listItem",...o},ref:t,...a,children:n})});t.Z=o},4687:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var i=n(52322),l=n(5446),r=n(2784),o=n(40023),a=n(951),s=n(8799),d=n(18978),c=n(59326),u=n(75289),p=n(89753),m=n(96666),x=n(33710),h=n(28316),f=n(65077);let g=e=>{let{children:t}=e;return(0,h.createPortal)((0,i.jsx)(f.xR,{children:t}),document.body)},v=e=>{let{text:t,as:n,sx:l={},...o}=e,a=(0,r.useRef)(null),[s,d]=(0,r.useState)(null),c=()=>{d(a.current&&a.current.offsetWidth<a.current.scrollWidth)};return(0,r.useEffect)(()=>(c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.xv,{"data-for":t,"data-tip":!0,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...l},as:n,ref:a,...o,children:t}),s&&(0,i.jsx)(g,{children:(0,i.jsx)(x.Z,{id:t,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:t})})]})};var b=e=>{var t,n;let{text:l,sliceFieldName:r,theme:o,WidgetIcon:a}=e;return(0,i.jsxs)(u.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,i.jsx)(a,{size:28,style:{color:null===(t=o.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=o.colors)||void 0===n?void 0:n.primary}}),(0,i.jsx)(v,{text:l,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,i.jsx)(u.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},y=function(e){let{item:t,index:n,deleteItem:x,enterEditMode:h,modelFieldName:f,renderFieldAccessor:g,HintElement:v,CustomEditElement:y,CustomEditElements:j,widget:_,draggableId:k,testId:S,isRepeatableCustomType:I,children:F}=e,{theme:T}=(0,c.B7)(),{key:E,value:{config:C,type:w}}=t;return(0,i.jsx)(r.Fragment,{children:(0,i.jsx)(o._l,{draggableId:k,index:n,children:e=>{var o,c,k,L,M;return(0,i.jsx)(r.Fragment,{children:(0,i.jsxs)(p.Z,{"data-testid":S,ref:e.innerRef,...e.draggableProps,Component:u.xu,sx:{p:0,mx:0,my:3},children:[(0,i.jsxs)(u.kC,{sx:{width:"100%"},children:[(0,i.jsx)(m.Z,{label:"Reorder slice field (drag and drop)",Icon:d.Fm7,color:null===(o=T.colors)||void 0===o?void 0:o.icons,mr:1,mt:3,...e.dragHandleProps}),(0,i.jsxs)(u.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:e=>{var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,i.jsxs)(u.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,i.jsx)(b,{theme:T,text:(null==C?void 0:C.label)||E,sliceFieldName:g&&g(E),WidgetIcon:_.Meta.icon}),(0,i.jsxs)(u.kC,{children:[j||null,y||(0,i.jsx)(m.Z,{size:22,Icon:a.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(c=T.colors)||void 0===c?void 0:c.icons},onClick:()=>h([E,t.value],f,n)}),!(!0===I&&"UID"==w)&&(0,i.jsxs)(l.v2,{children:[(0,i.jsx)(l.j2,{className:"sliceMenuButton","data-testid":"field-menu-button",style:{padding:"0",cursor:"pointer",width:"32px",height:"32px",border:"none",background:"transparent",outline:"0"},children:(0,i.jsx)(s.FQA,{size:20,color:null===(k=T.colors)||void 0===k?void 0:k.icons,style:{pointerEvents:"none"}})}),(0,i.jsx)(l.qy,{style:{background:null===(L=T.colors)||void 0===L?void 0:L.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(M=T.colors)||void 0===M?void 0:M.borders,outline:"0"},children:(0,i.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:()=>x(E),children:"Delete field"})})]})]})]}),v||null]})]}),F]})})}})})}},96666:function(e,t,n){"use strict";var i=n(52322),l=n(75289);let r=(e,t)=>t?{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.error)}}:e?{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.primary)}}:{border:e=>{let{colors:t}=e;return"1px solid ".concat(t.borders)}};t.Z=e=>{let{sx:t=null,onClick:n=()=>null,label:o,Icon:a,error:s=null,size:d=16,fitButton:c=!1,active:u=!1,useActive:p=!1,activeSx:m=r,...x}=e;return(0,i.jsx)(l.hU,{onClick:n,"aria-label":o,type:"button",sx:{...c?{width:d,height:d}:null,...p&&m(u,s),...t},...x,children:(0,i.jsx)(a,{size:d})})}},4205:function(e,t,n){"use strict";var i=n(52322),l=n(63397),r=n(2784),o=n(75289),a=n(81699),s=n(1646);t.Z=e=>{let{fieldName:t,formField:n,fields:d,initialValues:c,autoFocus:u}=e,[p,m,x]=(0,l.U$)(t),h=n.component;return(0,i.jsx)(o.xu,{sx:{mt:2,alignItems:"center",...n.type===s.h.CHECKBOX?{display:"flex",height:"130%"}:null},children:h?(0,i.jsx)(h,{meta:m,field:p,helpers:x,fieldName:t,formField:n,initialValues:c}):(0,i.jsxs)(r.Fragment,{children:[n.type===s.h.INPUT?(0,i.jsx)(a.Hq,{meta:m,field:p,fields:d,formField:n,fieldName:t,initialValues:c,autoFocus:u}):null,n.type===s.h.CHECKBOX&&(0,i.jsx)(a.sP,{meta:m,label:n.label,fieldName:t,initialValues:c,onChange:e=>x.setValue(e)})]})})}},64602:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var i=n(52322),l=n(37149),r=n.n(l),o=n(59326),a=n(75289),s=n(65413),d=n(76805),c=n(2784),u=n(92928);let p=e=>{let{children:t,...n}=e;return(0,i.jsx)(a.xu,{as:"ul",sx:{p:0,m:0,px:e=>"calc(".concat(e.space[3],"px + 8px)"),borderBottom:"1px solid #DFE1E5",position:"relative"},...n,children:t})};p.tabsRole="TabList";let m=e=>{let{children:t,...n}=e,{theme:l}=(0,o.B7)();return(0,i.jsx)(u.OK,{...n,style:{margin:"0 32px 0 0",top:"0",padding:"8px 0px",border:"none",bottom:"-1px",opacity:"0.8",transition:"all 150ms cubic-bezier(0.215,0.60,0.355,1)",borderRadius:"0",...n.selected?{borderBottom:"3px solid ".concat(l.colors.primary),color:l.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}},children:t})};m.tabsRole="Tab";var x=(0,c.memo)(e=>{let{children:t,Footer:n,Header:l,tabs:r,bodySx:o,footerSx:s,defaultIndex:x=0}=e,[h,f]=(0,c.useState)(x);return(0,i.jsx)(d.Z,{borderFooter:!0,footerSx:{p:0,...s},bodySx:{p:0,...o},sx:{border:"none"},Header:l,Footer:n,children:(0,i.jsxs)(u.mQ,{defaultIndex:x,onSelect:e=>f(e),children:[(0,i.jsx)(p,{children:(r||[]).map(e=>(0,i.jsx)(m,{children:e},e))}),c.Children.map(t,(e,t)=>(0,i.jsx)(a.xu,{sx:{p:e=>"calc(".concat(e.space[3],"px + 8px)"),display:t===h?"block":"none"},children:(0,i.jsx)(u.x4,{children:e})}))]})})}),h=n(28325),f=e=>{var t,n;let{text:l,sliceFieldName:r,theme:o,WidgetIcon:s}=e;return(0,i.jsxs)(a.kC,{sx:{alignItems:"center"},children:[(0,i.jsx)(s,{size:28,style:{color:null===(t=o.colors)||void 0===t?void 0:t.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(n=o.colors)||void 0===n?void 0:n.primary}}),(0,i.jsx)(a.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:l}),(0,i.jsx)(a.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},g=n(11104),v=n(22863),b=n(5632),y=n(65186),j=n(17186);let _=()=>{let e=(0,b.useRouter)();return(0,i.jsxs)(a.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,i.jsx)(y.wr$,{size:48,color:"#C9D0D8"}),(0,i.jsx)(a.xu,{sx:{height:"12px"}}),(0,i.jsx)(a.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,i.jsx)(a.xu,{sx:{height:"8px"}}),(0,i.jsx)(a.xv,{color:"text",sx:{fontWeight:400,fontSize:"14px",lineHeight:"24px",textAlign:"center"},children:"You can now edit directly your mock data in the new Slice Simulator."}),(0,i.jsx)(a.xu,{sx:{height:"24px"}}),(0,i.jsx)(a.zx,{onClick:t=>{t.preventDefault(),window.open("".concat(e.asPath,"/simulator"),j.pq)},children:"Go to the Slice Simulator"})]})};var k=n(67875),S=n(85357),I=n(38369),F=n(4205),T=n(63397),E=n(99510);function C(){let[{value:e}]=(0,T.U$)("config.label"),[{value:t},n,i]=(0,T.U$)("id"),l=(0,c.useRef)(null!=n.initialValue&&n.initialValue.length>0);(0,c.useEffect)(()=>{l.current||null==e||i.setValue((0,E.lV)(e),!1)},[e]),(0,c.useEffect)(()=>{let n=null==t||0===t.length;if(l.current){if(!n)return;l.current=!1}else n||null!=e&&t===(0,E.lV)(e)||(l.current=!0)},[t])}var w=(0,c.memo)(e=>{let{formId:t,initialValues:n,validationSchema:l,onSave:r,FormFields:o,children:s}=e;return(0,i.jsx)(a.xu,{children:(0,i.jsx)(T.J9,{initialValues:n,validationSchema:l,onSubmit:(e,t)=>{let{id:n,...i}=e;r({newKey:n,value:Object.entries(i).reduce((e,t)=>{let[n,i]=t;if(typeof i!==Boolean&&!i){var l;let t=null===(l=o[n])||void 0===l?void 0:l.defaultValue;if(void 0!==t)return{...e,[n]:t}}return{...e,[n]:i}},{})})},children:e=>(0,i.jsxs)(T.l0,{id:t,children:[(0,i.jsx)(C,{}),s({...e,initialValues:n})]})})})});function L(e){let{children:t}=e,n=(0,d.W)();return(0,i.jsx)(a.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n},children:t})}r().setAppElement("#__next");var M=e=>{let{close:t,data:n,fields:l,onSave:r,zoneType:d}=e,{theme:c}=(0,o.B7)();if(!n.isOpen)return null;let{field:[u,p]}=n,m=(0,I.t)(k.C,p.config,p.type);if(!m)return(0,i.jsxs)("div",{children:[p.type," not found"]});let{Meta:{icon:b},FormFields:y,Form:j,schema:T}=m,E={...(0,v.f7)((0,S.B9)(y,"id")),...m.prepareInitialValues?m.prepareInitialValues(p.config):p.config},{res:C,err:M}=(()=>{try{return{res:T.validateSync({type:p.type,config:E},{stripUnknown:!0})}}catch(e){return{err:e}}})();M&&(console.error("[EditModal] Failed to validate field of type ".concat(p.type,".\n Please update model.json accordingly.")),console.error(M));let O={id:u,config:C?C.config:E},[N,A]=y.id.validate.matches,D=s.object().shape({id:s.string().matches(N,A).min(3).max(35).required(),config:T.fields.config}),q="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,i.jsx)(g.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,i.jsx)(w,{apiId:u,formId:q,initialValues:O,validationSchema:D,FormFields:y,onSave:e=>{let{newKey:n,value:i}=e;r({apiId:u,newKey:n,value:{...p,...i}}),t()},children:e=>{let{values:{id:n,config:{label:r}},isValid:o,isSubmitting:s,initialValues:p}=e,m=j?(0,i.jsx)(j,{...e,fields:l},"field-model-tab-content"):(0,i.jsx)(h.k,{children:Object.entries(y).map(e=>{let[t,n]=e;return(0,i.jsx)(h.J,{children:(0,i.jsx)(F.Z,{fieldName:(0,v.lm)(t),formField:n,fields:l,initialValues:p,autoFocus:""===u&&void 0})},t)})},"field-model-tab-content"),g=["Field Model"],k=[m];if("slice"===d){let e=(0,i.jsx)(a.xu,{children:(0,i.jsx)(_,{})},"mock-data-tab-content");g.push("Mock Data"),k.push(e)}return(0,i.jsx)(x,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:g,Header:(0,i.jsxs)(L,{children:[(0,i.jsx)(f,{theme:c,text:r||n,WidgetIcon:b}),(0,i.jsx)(a.x8,{onClick:t,type:"button"})]}),Footer:(0,i.jsxs)(a.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(a.xu,{sx:{ml:"auto"}}),(0,i.jsx)(a.zx,{mr:2,type:"button",onClick:t,variant:"secondary",children:"Cancel"}),(0,i.jsx)(a.zx,{form:q,type:"submit",disabled:!o&&s,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:k})}})})}},56309:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var i=n(52322),l=n(2784),r=n(49857),o=n(70647),a=n(77245),s=n(8799),d=n(65186),c=n(59326),u=n(75289),p=n(47760);let m={position:"relative",top:"3px"};var x=e=>{var t,n,r;let{code:o,lang:x}=e,{theme:h}=(0,c.B7)(),[f,g]=(0,l.useState)(!1);return o?(0,i.jsxs)(u.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,i.jsxs)(u.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,i.jsx)(s.vcz,{size:26,color:null==h?void 0:null===(t=h.colors)||void 0===t?void 0:t.icons,style:{border:"1px solid",borderColor:null==h?void 0:null===(n=h.colors)||void 0===n?void 0:n.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,i.jsx)(p.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:x,children:o})]}),(0,i.jsx)(u.xu,{children:(0,i.jsxs)(u.zx,{"aria-label":f?"Code snippet copied":"Copy code snippet",onClick:()=>{o&&navigator.clipboard.writeText(o).then(()=>{g(!0),setTimeout(()=>{g(!1)},1200)})},variant:"textButton",children:[f?(0,i.jsx)(d.HhX,{size:16,color:null==h?void 0:null===(r=h.colors)||void 0===r?void 0:r.success,style:m}):(0,i.jsx)(a.LhG,{size:16,style:m}),(0,i.jsx)(u.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},h=e=>{let{show:t,renderHintBase:n,item:l,hintItemName:a}=e,s=n({item:l}),d=[s];if("Link"===l.value.type){var c,u,p,m;null!==(p=null===(c=l.value.config)||void 0===c?void 0:c.allowText)&&void 0!==p&&p&&d.push("allowText"),null!==(m=null===(u=l.value.config)||void 0===u?void 0:u.repeat)&&void 0!==m&&m&&d.push("repeat")}let{data:h,error:f}=(0,r.ZP)(d.join("$"),async()=>await o.managerClient.snippets.readSnippets({fieldPath:s.split("."),model:l.value,itemName:a}));if(f&&console.error(f),!h||f)return null;let g=h.snippets||[];return g[0]?(0,i.jsx)("div",{style:{display:t?"initial":"none"},children:(0,i.jsx)(x,{code:g[0].code,lang:g[0].language})}):null}},18183:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var i=n(52322),l=n(33760),r=n(13980),o=n(2784),a=n(65077),s=n(93188),d=n(80775),c=n(87782),u=n(81271);function p(e){let{open:t,onOpenChange:n,onConfirm:r}=e;return(0,i.jsxs)(l.Vq,{open:t,onOpenChange:n,size:"small",children:[(0,i.jsx)(l.fK,{title:"Static zone"}),(0,i.jsx)(l.cZ,{children:(0,i.jsx)(l.xr,{children:(0,i.jsxs)(l.xu,{as:"article",flexDirection:"column",padding:16,gap:4,children:[(0,i.jsx)(l.xv,{sx:{marginBottom:4},color:"purple9",variant:"smallBold",children:"About"}),(0,i.jsx)(l.xv,{variant:"h3",children:"What is the static zone?"}),(0,i.jsx)(l.xv,{color:"grey11",children:"The static zone in Prismic page types contain fields that are always present on the page. Use it for essential information like a page's title, page design settings, or metadata. Unlike slices, which can be added or removed, static zone fields remain fixed."}),(0,i.jsx)(l.nk,{src:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1723540305/DEV_TOOLS/STATES/Explication_vide%CC%81o_zone_statique_phibeq.mp4",sizing:"contain",autoPlay:!0,loop:!0})]})})}),(0,i.jsx)(l.kX,{children:(0,i.jsx)(l._d,{size:"medium",sx:{flexGrow:1},onClick:()=>{r(),n(!1)},children:"Got it"})})]})}var m=n(4315);let x=(0,o.forwardRef)((e,t)=>{var n;return(0,i.jsx)(l.zx,{...e,ref:t,startIcon:"add",color:"grey","aria-label":"Add a field","data-testid":null!==(n=e["data-testid"])&&void 0!==n?n:"add-field"})});function h(e){let{zoneTypeFormat:t,...n}=e;return"page"===t?(0,i.jsx)(g,{...n}):(0,i.jsx)(v,{...n})}let f=(0,i.jsx)("div",{style:{position:"absolute",bottom:0,right:0}});function g(e){let{disabled:t,fields:n,triggerDataTestId:r,onSelectField:a}=e,[s,d]=(0,o.useState)(!1),[c,h]=(0,o.useState)(!1),[g,v]=(0,m.V)("staticFieldsInfoDialogDismissed",!1);return(0,i.jsxs)(l.xu,{position:"relative",children:[(0,i.jsx)(x,{onClick:()=>{g?d(!0):h(!0)},"data-testid":r}),(0,i.jsx)(p,{open:c,onOpenChange:e=>{h(e),e||d(!0)},onConfirm:()=>v(!0)}),(0,i.jsx)(u.S,{open:s,onOpenChange:d,disabled:t,onSelectField:a,fields:n,trigger:f})]})}function v(e){let{disabled:t,fields:n,triggerDataTestId:l,onSelectField:r}=e;return(0,i.jsx)(u.S,{disabled:t,onSelectField:r,fields:n,trigger:(0,i.jsx)(x,{"data-testid":l})})}var b=n(67875),y=n(46622),j=n(40023),_=n(75289),k=n(89753),S=n(4687),I=n(38369),F=n(56309),T=e=>{let{fields:t,title:n,tabId:l,enterEditMode:r,enterSelectMode:o,onDragEnd:a,renderFieldAccessor:s,onDeleteItem:d,onSave:c,showHints:u,renderHintBase:p,isRepeatable:m,testId:x,isRepeatableCustomType:h}=e;return(0,i.jsx)(j.Z5,{onDragEnd:a,children:(0,i.jsx)(j.bK,{droppableId:n,children:(e,n)=>(0,i.jsxs)(_.xu,{as:"ul",ref:e.innerRef,...e.droppableProps,"data-testid":x,sx:{paddingInline:"16px !important"},children:[t.map((e,t)=>{let{value:{config:a,type:x}}=e,f=(0,I.t)(b.C,a,x);if(!f)return(0,i.jsx)(k.Z,{children:(0,i.jsxs)(_.xv,{children:['Field type "',x,'" not supported']})});let g={item:e,index:t,tabId:l,widget:f,showHints:u,key:e.key,enterSelectMode:o,renderFieldAccessor:s,enterEditMode:r,parentSnapshot:n,deleteItem:d,saveItem:c,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:h,testId:"list-item-".concat(e.key)},v=(0,i.jsx)(F.Z,{item:e,show:u,isRepeatable:m,renderHintBase:p,hintItemName:f.hintItemName,Widgets:b.C,typeName:f.CUSTOM_NAME||f.TYPE_NAME});if(f.CustomListItem){let{CustomListItem:e}=f;return(0,i.jsx)(e,{...g,HintElement:v})}return(0,i.jsx)(S.Z,{...g,HintElement:v})}),e.placeholder]})})})},E=n(83288),C=n.n(E);let w=e=>{let{zoneType:t,heading:n="Your ".concat(t," has no fields yet"),action:r}=e;return(0,i.jsxs)("div",{className:C().root,children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(l.xv,{variant:"bold",children:n}),(0,i.jsx)(l.xv,{color:"grey11",children:"A field is an input for content (e.g. text, images, links)."})]}),r]})},L=e=>{let t,{zoneType:n,zoneTypeFormat:r,tabId:p,title:m,fields:x,poolOfFieldsToCheck:f,widgetsArray:g,isRepeatable:v,onDeleteItem:j,onDragEnd:_,EditModal:k,onSave:S,dataTip:I,renderHintBase:F,renderFieldAccessor:E,testId:C,isRepeatableCustomType:L,emptyStateHeading:M}=e,O=(()=>{let e=!!Object.entries(f).find(e=>{let[,{value:t}]=e;return"UID"===t.type}),t=g.filter(e=>{let{TYPE_NAME:t}=e;return"UID"!==t});return e?t:[...t,g.find(e=>{let{TYPE_NAME:t}=e;return"UID"===t})]})(),[N,A]=(0,o.useState)(!1),[D,q]=(0,o.useState)({isOpen:!1}),R={onSelectField:e=>{q({isOpen:!0,field:["",b.C[e].create("")]})},fields:O.filter(Boolean).map(e=>{let{TYPE_NAME:t,CUSTOM_NAME:n}=e;return c.XU.find(e=>e.type===t&&(void 0===n||e.variant===n))}),triggerDataTestId:v?"add-field-in-items":void 0};return"slice"===n&&x.length>0?t=(0,i.jsx)(u.S,{...R}):"customType"===n&&(t=(0,i.jsx)(h,{...R,zoneTypeFormat:r})),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.Bu,{actions:(0,i.jsxs)(i.Fragment,{children:[x.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,i.jsx)(l.rs,{checked:N,onCheckedChange:A,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"})]}),t]}),children:m}),0===x.length&&"slice"===n?(0,i.jsx)(w,{zoneType:"customType"===n?"page"===r?"page type":"custom type":n,heading:M,action:(0,i.jsx)(u.S,{...R})}):x.length>0?(0,i.jsx)(a.xR,{children:(0,i.jsx)(T,{tabId:p,isRepeatable:v,fields:x,showHints:N,dataTip:I,title:m,renderFieldAccessor:E,renderHintBase:F,enterEditMode:e=>{q({isOpen:!0,field:e});let[t,n]=e;s.Xe.track({event:"field:settings-opened",id:t,name:n.config.label,type:n.type,isInAGroup:!1,contentType:(0,y.T)(window.location.pathname)})},onDragEnd:_,onDeleteItem:j,onSave:S,testId:C,isRepeatableCustomType:L})}):void 0,(0,i.jsx)(k,{data:D,close:()=>{q({isOpen:!1})},onSave:S,fields:f,zoneType:n})]})};L.propTypes={isRepeatable:r.bool,title:r.string.isRequired,dataTip:r.string.isRequired,onSave:r.func.isRequired,onDragEnd:r.func.isRequired,onDeleteItem:r.func.isRequired,poolOfFieldsToCheck:(0,r.arrayOf)((0,r.shape)({key:r.string,value:r.object})),renderHintBase:r.func.isRequired,renderFieldAccessor:r.func.isRequired,widgetsArray:r.array.isRequired,fields:(0,r.arrayOf)((0,r.shape)({key:r.string.isRequired,value:(0,r.shape)({config:r.object,fields:r.array,type:r.string.isRequired})}))};var M=L},38369:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var i=n(59050);let l=(e,t,n)=>{if("Link"===n)switch(null==t?void 0:t.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}if(n===i.GroupFieldType){var l;return null!==(l=e.Group)&&void 0!==l?l:e.NestedGroup}return e[n]}},25273:function(e,t,n){"use strict";n.d(t,{Jp:function(){return o},OR:function(){return r}});var i=n(17186),l=n(37429);let r={label:(0,l.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)",!0),id:(0,l.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},e=>{let{value:t,fields:n,initialId:i}=e;return t?n.find(e=>{let{key:n}=e;return n===t})&&t!==i?'Field "'.concat(t,'" already exists.'):void 0:"Field is required"},void 0,"A unique identifier for the field (e.g. buttonLink)")},o={...r,placeholder:(0,l.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},37429:function(e,t,n){"use strict";n.d(t,{II:function(){return d},Jg:function(){return r}});var i=n(22863),l=n(1646);let r=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:l.h.CHECKBOX,validate:{required:(0,i.MJ)(t,s)},required:t,label:e,defaultValue:n,yupType:"boolean"}},o=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:o,max:a,required:s},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],{min:u,max:p,required:m,matches:x}=t||{};return{type:l.h.INPUT,label:e,validate:{required:(0,i.MJ)(m,s),min:(0,i.MJ)(u,o),max:(0,i.MJ)(p,a),matches:x},defaultValue:r,fieldLevelValidation:n,yupType:"string",placeholder:d,autoFocus:c}}},22863:function(e,t,n){"use strict";n.d(t,{MJ:function(){return a},f7:function(){return s},gc:function(){return d},lm:function(){return o}});var i=n(65413),l=n(1646);let r=e=>null===e.defaultValue?void 0:void 0!==e.defaultValue?e.defaultValue:e.type===l.h.CHECKBOX||(e.type===l.h.INPUT?"":e.type===l.h.SELECT?[]:void 0),o=e=>"id"===e?"id":"config.".concat(e),a=(e,t)=>Array.isArray(e)?e:"boolean"==typeof e&&e?t:null,s=e=>Object.entries(e).reduce((e,t)=>{let[n,i]=t,l=r(i);return void 0!==l?{...e,[n]:l}:e},{}),d=e=>i.object().shape(Object.entries(e).filter(e=>e).reduce((e,t)=>{let[n,l]=t,{validate:r,yupType:o}=l;if(!r)return e;if("function"==typeof r)return{...e,[n]:r(n,l)};let a=i[o]();return Object.entries(r).filter(e=>e&&e[1]).forEach(e=>{let[t,i]=e;if(i&&a[t]){a=a[t](...Array.isArray(i)?i:[i]);return}console.warn('Invalid Yup validator for field "'.concat(n,'"'))}),{...e,[n]:a}},{})).required().default(void 0).noUnknown(!0)},1646:function(e,t,n){"use strict";var i,l;n.d(t,{h:function(){return i}}),(l=i||(i={})).CHECKBOX="checkbox",l.INPUT="input",l.SELECT="select"},67875:function(e,t,n){"use strict";n.d(t,{C:function(){return ta}});var i=n(52322),l=n(53085),r=n(65186),o=n(65413),a=n(75289),s=n(28325),d=n(4205),c=n(22863),u=n(25273),p=n(37429);let m={...u.OR,repeat:(0,p.Jg)("Repeatable",!1,!0)};var x=e=>{let{initialValues:t,fields:n,values:l,setFieldValue:r}=e,{config:{repeat:o}}=l;return(0,i.jsxs)(s.k,{children:[Object.entries(m).filter(e=>{let[t]=e;return"repeat"!==t}).map(e=>{let[l,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(l),formField:r,fields:n,initialValues:t})},l)}),(0,i.jsx)(s.J,{children:(0,i.jsx)(a.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,i.jsxs)(a.__,{variant:"label.border",sx:{mb:0},children:[(0,i.jsx)(a.XZ,{checked:o,onChange:()=>r("config.repeat",!o)}),"Repeatable"]})})})]})};let h={icon:r.iy3},f=e=>o.object().shape({type:o.string().matches(e,{excludeEmptyString:!0}).required(),config:o.object().shape({fields:o.array(),label:o.string(),repeat:o.boolean().optional()})});function g(e){let{schemaTypeRegex:t,customListItem:n,customName:i,hintItemName:l}=e;return{Meta:h,Form:x,FormFields:m,schema:f(t),create:e=>({type:"Group",config:{label:e,repeat:!0,fields:[]}}),CustomListItem:n,TYPE_NAME:"Group",CUSTOM_NAME:i,hintItemName:l}}var v=n(59050),b=n(2784),y=n(40023),j=n(28316),_=n(93188),k=n(87782),S=n(81271),I=n(4687),F=n(64602),T=n(56309),E=n(38369),C=n(2439),w=n(85357),L=n(99510),M=n(46622);let O=e=>{let{tabId:t,widget:n,Widgets:l,widgetsArray:r,hintBase:o,parentSnapshot:s,showHints:d,isRepeatable:c,item:u,draggableId:p,saveItem:m,HintElement:x,...h}=e,[f,g]=(0,b.useState)({isOpen:!1}),O=e=>{var t,n;let{apiId:i,value:l}=e,r=null===(t=l.config)||void 0===t?void 0:t.label,o=function(e){var t,n,i;let l=structuredClone(e.group);return null!==(n=l.config)&&void 0!==n||(l.config={}),null!==(i=(t=l.config).fields)&&void 0!==i||(t.fields={}),l.config.fields[e.fieldId]=e.field,l}({group:C.Fl.fromSM(u.value),fieldId:i,field:l});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(o),isNewGroupField:!0}),_.Xe.track({event:"field:added",id:i,name:r,type:l.type,isInAGroup:!0,contentType:(0,M.T)(window.location.pathname),..."Link"===l.type&&{allowText:null===(n=l.config)||void 0===n?void 0:n.allowText}})},N=e=>{let{apiId:t,newKey:n,value:i}=e,l=function(e){var t,n;let i=structuredClone(e.group);if(!(null===(t=i.config)||void 0===t?void 0:t.fields)||!(null===(n=e.group.config)||void 0===n?void 0:n.fields))return i;for(let t in i.config.fields={},e.group.config.fields)t===e.previousFieldId?i.config.fields[e.newFieldId]=e.field:i.config.fields[t]=e.group.config.fields[t];return i}({group:C.Fl.fromSM(u.value),previousFieldId:t,newFieldId:n,field:i.type===v.GroupFieldType?C.Fl.fromSM(i):i});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(l)})},A=e=>{let t=function(e){var t,n;let i=structuredClone(e.group);return null===(n=i.config)||void 0===n||null===(t=n.fields)||void 0===t||delete t[e.fieldId],i}({group:C.Fl.fromSM(u.value),fieldId:e});m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(t)})},D=e=>{g({isOpen:!0,field:e});let[t,n]=e;_.Xe.track({event:"field:settings-opened",id:t,name:n.config.label,type:n.type,isInAGroup:!0,contentType:(0,M.T)(window.location.pathname)})};return(0,i.jsxs)(b.Fragment,{children:[(0,i.jsx)(I.Z,{item:u,widget:n,draggableId:p,...h,HintElement:x,CustomEditElements:[(0,i.jsx)(S.S,{onSelectField:e=>{g({isOpen:!0,field:["",l[e].create("")]})},fields:r.filter(Boolean).map(e=>{let{TYPE_NAME:t,CUSTOM_NAME:n}=e,i=k.XU.find(e=>e.type===t&&(void 0===n||e.variant===n));if(!i)throw Error("Field not found for widget: ".concat(t," - ").concat(n));return i})},"add-field-dropdown")],children:(0,i.jsx)(a.xu,{sx:{ml:4},children:(0,i.jsx)(y.Z5,{onDragEnd:e=>{if((0,w.uS)(e))return;let{source:t,destination:n}=e;if(!n)return;let{index:i}=t,{index:l}=n,r=function(e){var t;let n=structuredClone(e.group);if(!(null===(t=n.config)||void 0===t?void 0:t.fields))return n;let i=Object.entries(n.config.fields),[l]=i.splice(e.sourceIndex,1);return i.splice(e.destinationIndex,0,l),n.config.fields=Object.fromEntries(i),n}({group:C.Fl.fromSM(u.value),sourceIndex:i,destinationIndex:l});(0,j.flushSync)(()=>{m({apiId:u.key,newKey:u.key,value:C.Fl.toSM(r)})})},children:(0,i.jsx)(y.bK,{droppableId:"".concat(t,"-").concat(u.key,"-zone"),children:e=>(0,i.jsxs)("ul",{ref:e.innerRef,...e.droppableProps,children:[u.value.config.fields.map((e,t)=>{let{value:{config:n,type:r}}=e,a=(0,E.t)(l,n,r);if(!a)return null;let s={item:e,index:t,widget:a,key:e.key,enterEditMode:D,deleteItem:A,saveItem:N,showHints:d,renderFieldAccessor:t=>"item".concat((0,L.Ti)(e.key)),draggableId:"group-".concat(u.key,"-").concat(e.key,"-").concat(t),testId:"list-item-group-".concat(u.key,"-").concat(e.key)},p=(0,i.jsx)(T.Z,{item:e,show:d,isRepeatable:c,renderHintBase:e=>{let{item:t}=e;return"".concat(o).concat((0,L.Ti)(t.key))},hintItemName:a.hintItemName,Widgets:l,typeName:a.CUSTOM_NAME||a.TYPE_NAME});if(a.CustomListItem){let{CustomListItem:e}=a;return(0,i.jsx)(e,{...s,HintElement:p})}return(0,i.jsx)(I.Z,{...s,HintElement:p})}),e.placeholder]})})})})}),(0,i.jsx)(F.Z,{data:f,close:()=>{g({isOpen:!1})},onSave:e=>""===e.apiId?O({...e,apiId:e.newKey}):N(e),fields:u.value.config.fields})]})},N={icon:r.hs8},A={label:u.Jp.label,id:u.Jp.id,placeholder_false:(0,p.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,p.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,p.Jg)("Default to true")},D=o.object().shape({type:o.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(A,"id"))}),q={icon:r.U8L},{TYPE_NAME:R,FormFields:z,schema:B}=(0,w.zg)("Color");var V=n(56580),P=n(1744),J=n(40572),Z=n(33760);function G(e){let{checked:t,height:n=130,setFieldValue:l}=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(a.kC,{sx:{mt:2,alignItems:"center",height:"".concat(n,"%")},children:(0,i.jsx)(a.__,{variant:"label.border",children:(0,i.jsxs)(Z.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",children:[(0,i.jsxs)(a.kC,{children:[(0,i.jsx)(a.XZ,{checked:t,onChange:e=>{l("config.allowText",e.target.checked)}}),"Allow display text"]}),(0,i.jsx)(Z.u,{content:"Allow editors to customize the link display text",align:"end",zIndexHack:!0,children:(0,i.jsx)(Z.I5,{name:"alert",size:"medium",color:"grey11"})})]})})})})}function U(e){let{checked:t,height:n,setFieldValue:l}=e;return(0,i.jsx)(s.J,{children:(0,i.jsxs)(a.kC,{sx:{mt:2,flexDirection:"column",height:n?"".concat(n,"%"):void 0},children:[(0,i.jsx)(a.__,{htmlFor:"repeat",variant:"label.primary",sx:{display:"flex",alignItems:"center"},children:"Repeatable"}),(0,i.jsx)(a.__,{variant:"label.border",children:(0,i.jsxs)(Z.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",children:[(0,i.jsxs)(a.kC,{children:[(0,i.jsx)(a.XZ,{name:"repeat",checked:t,onChange:e=>{l("config.repeat",e.target.checked)}}),"Make this link repeatable"]}),(0,i.jsx)(Z.u,{content:"Allow editors to create lists of links",align:"end",zIndexHack:!0,children:(0,i.jsx)(Z.I5,{name:"alert",size:"medium",color:"grey11"})})]})})]})})}let H={...u.Jp},W={icon:r.$l_},$=o.object().shape({label:o.string().optional(),useAsTitle:o.boolean().optional(),placeholder:o.string().optional(),select:o.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:o.array(o.string()).strict().optional(),masks:o.array(o.string()).optional(),tags:o.array(o.string()).optional(),allowTargetBlank:o.boolean().strict().optional(),allowText:o.boolean().strict().optional(),repeat:o.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),K=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:$.optional()});var Y=n(36131);let X={label:u.Jp.label,id:u.Jp.id,customtypes:{validate:()=>o.array().of(o.string())}},Q={icon:r.I2R},ee=$.shape({label:o.string().max(35,"String is too long. Max: 35"),select:o.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:o.array(o.string()).strict().optional()}),et=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:ee}),{FormFields:en,schema:ei}=(0,w.zg)("Date"),el={icon:r.f$3},{FormFields:er,schema:eo}=(0,w.zg)("Embed"),ea={icon:r.xoN},es={label:u.Jp.label,id:u.Jp.id},ed=o.object().shape({type:o.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:o.object().shape({label:o.string()}).required().default(void 0).noUnknown(!0)}),ec={icon:r.lPv};var eu=n(63397),ep=n(8799),em=n(81699),ex=n(96666);let eh=e=>{let{onClick:t,error:n,onDelete:l,active:o,text:s,sx:d}=e;return(0,i.jsx)(ex.Z,{useActive:!0,fitButton:!0,error:n,onClick:t,active:o,sx:{position:"relative",width:"64px",height:"64px",...d},Icon:()=>(0,i.jsxs)(b.Fragment,{children:[(0,i.jsxs)(a.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,i.jsx)(ep.jnY,{size:22}),(0,i.jsx)(a.xv,{mt:1,children:s})]}),l?(0,i.jsx)(a.Ct,{onClick:l,variant:"circle-right",children:(0,i.jsx)(r.B4e,{})}):null]})})},ef=e=>{let{onClick:t}=e;return(0,i.jsx)(ex.Z,{fitButton:!0,onClick:t,sx:{width:"64px",height:"64px",border:e=>{let{colors:t}=e;return"1px solid ".concat(String(null==t?void 0:t.borders))}},Icon:()=>(0,i.jsx)(a.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,i.jsx)(ep.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})})},eg=e=>{let{prefix:t,required:n=!1,display:l}=e,[r,o]=(0,eu.U$)(t),a=n?"*":"";return l?(0,i.jsxs)(b.Fragment,{children:[(0,i.jsx)(ev,{name:"".concat(t,".name"),label:"Name".concat(a),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===t,meta:o}),(0,i.jsx)(eb,{name:"".concat(t,".width"),label:"Width (px)".concat(a),placeholder:" ",sx:{mb:3}}),(0,i.jsx)(eb,{name:"".concat(t,".height"),label:"Height (px)".concat(a),placeholder:" "})]}):null},ev=e=>{let{name:t,label:n,placeholder:l,meta:r,isConstraint:o,...a}=e,[s]=(0,eu.U$)(t);return(0,i.jsx)(em.Hq,{...a,fieldName:t,meta:r,formField:{label:n,placeholder:l},field:o?{value:"main",readOnly:!0}:{value:s.value},variant:o?"disabled":"primary"})},eb=e=>{let{name:t,label:n,placeholder:l,...r}=e,[o,a]=(0,eu.U$)(t);return(0,i.jsx)(em.Hq,{...r,fieldName:t,formField:{label:n,placeholder:l},meta:a,field:{min:0,type:"number",value:o.value||"",onKeyDown:e=>{("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}})},ey=()=>o.number().nullable().transform((e,t)=>""===t?null:e),ej={label:u.Jp.label,id:u.Jp.id,constraint:{validate:()=>o.object().defined().shape({width:ey(),height:ey()})},thumbnails:{validate:()=>o.array().defined().of(o.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;let t="number"==typeof e.width&&e.width,n="number"==typeof e.height&&e.height;return e.name&&(t||n)}}))}},e_={name:"",width:"",height:""},ek=function(){let{width:e,height:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!n||e||t?e||t?"".concat(e||"auto","x").concat(t||"auto"):"...":"auto"},eS=o.object().shape({type:o.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(ej,"id"))}),eI={icon:r.Fwj},eF={...u.Jp},eT={icon:r._b$},eE=$.shape({select:o.string().required().matches(/^media$/,{excludeEmptyString:!0})}),eC=o.object().shape({type:o.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:eE.optional()}),{FormFields:ew,schema:eL}=(0,w.zg)("Number"),eM={icon:r.KZU};var eO=n(1646);let eN=e=>"use first value as default ".concat(e?'("'.concat(e,'")'):""),eA=(e,t)=>t?e:void 0,eD={...u.Jp,default_value:{type:eO.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return o.string().test({name:"default_value",message:'Default value is not part of field "options" in Select',test:function(e){return void 0===e||this.parent&&this.parent.options&&this.parent.options.find(t=>t===e)}})},component:e=>{var t;let{values:n}=(0,eu.u6)(),l=null===(t=n.config)||void 0===t?void 0:t.options[0];return(0,i.jsx)(em.w8,{...e,defaultValue:e.field.value,controlledValue:l,setControlledValue:e.helpers.setValue,buildControlledValue:eA,label:eN})}},options:{yupType:"array",defaultValue:["1","2"],validate:{required:["Select requires a minimum of 2 options"],min:[2,"Choose at least 2 options"],test:{name:"non-empty values",message:"Values cannot be empty",test:e=>!e.some(e=>!e||!e.length)}},component:e=>(0,i.jsx)(em.kp,{label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option",...e})}},eq={icon:r.nwY},eR=o.object().shape({type:o.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(eD,"id"))});var ez=n(47927),eB=n(29259),eV=n.n(eB),eP=n(85505),eJ=n.n(eP),eZ=n(34543);let eG=e=>t=>{let{size:n}=t;return(0,i.jsx)("span",{style:{fontSize:n},children:e})},eU=[{value:"paragraph",label:"P",icon:eG("p")},{value:"preformatted",label:"PRE",icon:eG("pre")},{value:"heading1",label:"H1",icon:eG("h1")},{value:"heading2",label:"H2",icon:eG("h2")},{value:"heading3",label:"H3",icon:eG("h3")},{value:"heading4",label:"H4",icon:eG("h4")},{value:"heading5",label:"H5",icon:eG("h5")},{value:"heading6",label:"H6",icon:eG("h6")},{value:"strong",label:"Strong",icon:eG((0,i.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:eG((0,i.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:eG((0,i.jsx)(eZ.eR7,{}))},{value:"image",label:"image",icon:eG((0,i.jsx)(eZ.LFN,{}))},{value:"embed",label:"embed",icon:eG((0,i.jsx)(eZ.xqv,{}))},{value:"list-item",label:"list",icon:eG((0,i.jsx)(eZ.SnF,{}))},{value:"o-list-item",label:"o",icon:eG((0,i.jsx)(ep.KyO,{}))},{value:"rtl",label:"rtl",icon:eG("rtl")}],eH=eU.map(e=>e.value),eW=e=>!eH.find(t=>!e.includes(t)),e$=e=>{let t=e.split(",");return eU.reduce((e,n)=>{let{value:i}=n;return t.includes(i)?[...e,i]:e},[])};function eK(e,t){return(0,ez.has)("parent",e)&&eV()(e.parent)&&(0,ez.has)(t,e.parent)&&eJ()(e.parent[t])?e.parent[t]:null}function eY(e){return()=>o.string().test({name:e,message:"Options cannot be empty",test:function(t,n){let i="single"===e?"multi":"single",l=eK(n,e),r=eK(n,i);return!!r&&"string"==typeof r||!("string"!=typeof l||(!l||!l.length)&&(!r||!r.length)||l.split(",").find(e=>!eH.includes(e)))}})}let eX={...u.Jp,allowTargetBlank:(0,p.Jg)("Allow target blank for links"),single:{validate:eY("single")},multi:{validate:eY("multi")}},eQ=["config.single","config.multi"],e0={icon:r.BAW},e1=o.object().shape({type:o.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)({...eX,labels:{yupType:"array",validate:{}}},"id"))}),e2=u.Jp,e3=o.object().shape({type:o.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(e2,"id"))}),e5={icon:r.SQS},e6=u.Jp,e7=o.object().shape({type:o.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(e6,"id"))}),e8={icon:r.k71},e9={label:u.Jp.label,id:{...u.Jp.id,validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0},placeholder:u.Jp.placeholder},e4=o.object().shape({type:o.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,c.gc)((0,w.B9)(e9,"id"))}),te={Boolean:{TYPE_NAME:"Boolean",create:e=>({type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}),Meta:N,schema:D,FormFields:A},Color:{create:e=>({type:"Color",config:{label:e,placeholder:""}}),FormFields:z,TYPE_NAME:R,schema:B,Meta:q},ContentRelationship:{create:e=>({type:"Link",config:{label:e,select:"document",repeat:!1}}),Meta:Q,schema:et,TYPE_NAME:"Link",FormFields:X,CUSTOM_NAME:"ContentRelationship",Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,o=(0,V.v9)(J.Ch).filter(P.TG),u=o.map(e=>({value:e.local.id,label:e.local.label})),p=n.config.customtypes?n.config.customtypes.map(e=>{let t=o.find(t=>t.local.id===e);return{value:null==t?void 0:t.local.id,label:null==t?void 0:t.local.label}}):null;return(0,i.jsxs)(s.k,{children:[Object.entries(X).filter(e=>"customtypes"!==e[0]).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)(s.J,{children:(0,i.jsxs)(a.xu,{sx:{mt:2,alignItems:"center"},children:[(0,i.jsx)(a.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,i.jsx)(Y.ZP,{isMulti:!0,name:"origin",options:u,onChange:e=>{e&&r("config.customtypes",e.map(e=>{let{value:t}=e;return t}))},value:p,theme:e=>({...e,colors:{...e.colors,text:"text",primary:"background"}})})]})})]})},prepareInitialValues:e=>{let t=(0,V.v9)(J.Ch).filter(P.TG);return(null==e?void 0:e.customtypes)?{...e,customtypes:e.customtypes.filter(e=>t.find(t=>t.local.id===e))}:e}},Date:{create:e=>({type:"Date",config:{label:e,placeholder:""}}),FormFields:en,TYPE_NAME:"Date",schema:ei,Meta:el},Embed:{create:e=>({type:"Embed",config:{label:e,placeholder:""}}),FormFields:er,TYPE_NAME:"Embed",schema:eo,Meta:ea},GeoPoint:{create:e=>({type:"GeoPoint",config:{label:e}}),FormFields:es,TYPE_NAME:"GeoPoint",schema:ed,Meta:ec},Image:{Meta:eI,Form:e=>{let{initialValues:t,values:n,errors:l,fields:r,touched:o}=e,[u,p]=(0,b.useState)(0),{config:{thumbnails:m,constraint:x}}=n;return(0,b.useEffect)(()=>{p(m.length)},[m.length]),(0,i.jsxs)(s.k,{children:[Object.entries(ej).map(e=>{let[n,l]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:l,fields:r,initialValues:t})},n)}),(0,i.jsxs)(s.J,{children:[(0,i.jsx)(a.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,i.jsx)(a.Zb,{p:3,children:(0,i.jsx)(eu.F2,{name:"config.thumbnails",render:t=>{let{push:n,remove:r}=t;return(0,i.jsxs)(b.Fragment,{children:[(0,i.jsxs)(a.kC,{mb:3,children:[(0,i.jsx)(eh,{active:0===u,text:ek(x,!0),sx:{mr:2},onClick:()=>p(0)}),m.map((e,t)=>(0,i.jsx)(eh,{sx:{mr:3},active:u===+t+1,text:ek(e),error:!!l.thumbnails&&!!o.thumbnails&&!!o.thumbnails[t]&&!!l.thumbnails&&!!l.thumbnails[t],onDelete:()=>r(t),onClick:()=>p(+t+1)},"thumbnail-button-".concat(+t+1))),(0,i.jsx)(ef,{onClick:()=>{n(e_)}})]}),(0,i.jsx)(eg,{...e,display:0===u,prefix:"config.constraint"}),m.map((t,n)=>(0,b.createElement)(eg,{...e,required:!0,key:"thumbnail-".concat(+n+1),display:u===+n+1,prefix:"config.thumbnails[".concat(n,"]")}))]})}})})]})]})},schema:eS,create:e=>({type:"Image",config:{label:e,constraint:{},thumbnails:[]}}),FormFields:ej,TYPE_NAME:"Image"},Link:{Meta:W,FormFields:H,schema:K,Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,{config:{allowText:o,repeat:u}}=n;return(0,i.jsxs)(s.k,{children:[Object.entries(H).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)(s.J,{}),(0,i.jsx)(s.J,{children:(0,i.jsxs)(a.xu,{sx:{mt:2},children:[(0,i.jsx)(a.__,{htmlFor:"allowTargetBlank",variant:"label.primary",sx:{display:"flex",alignItems:"center"},children:"Link properties"}),(0,i.jsx)(d.Z,{fieldName:(0,c.lm)("allowTargetBlank"),formField:(0,p.Jg)("Allow target blank",!1,!0),fields:l,initialValues:t})]})},"allowTargetBlank"),(0,i.jsx)(G,{checked:o,height:127,setFieldValue:r}),(0,i.jsx)(U,{checked:u,setFieldValue:r})]})},create:e=>({type:"Link",config:{label:e,placeholder:"",select:null,allowTargetBlank:!0,allowText:!0,repeat:!1}}),TYPE_NAME:"Link"},LinkToMedia:{Meta:eT,FormFields:eF,schema:eC,Form:e=>{let{initialValues:t,values:n,fields:l,setFieldValue:r}=e,{config:{allowText:o,repeat:a}}=n;return(0,i.jsxs)(s.k,{children:[Object.entries(eF).map(e=>{let[n,r]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(n),formField:r,fields:l,initialValues:t})},n)}),(0,i.jsx)(G,{checked:o,setFieldValue:r}),(0,i.jsx)(U,{checked:a,setFieldValue:r})]})},create:e=>({type:"Link",config:{label:e,placeholder:"",select:"media",allowText:!0,repeat:!1}}),TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"},Number:{create:e=>({type:"Number",config:{label:e,placeholder:""}}),FormFields:ew,TYPE_NAME:"Number",schema:eL,Meta:eM},Select:{FormFields:eD,create:e=>({type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}),schema:eR,Meta:eq,TYPE_NAME:"Select"},StructuredText:{create:e=>({type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:eH.join(",")}}),FormFields:eX,Meta:e0,schema:e1,TYPE_NAME:"StructuredText",Form:e=>{var t;let{initialValues:n,values:l,errors:r,fields:o,setFieldValue:u}=e,{config:{single:p,multi:m}}=l,x=p?e$(p):m?e$(m):eH,[h,f]=(0,b.useState)(!p),[g,v]=(0,b.useState)(x);return(0,b.useEffect)(()=>{let e=h?1:0;u(eQ[e],g.join(",")),setTimeout(()=>{u(eQ[1-e],void 0)},100)},[h,g]),(0,i.jsxs)(s.k,{children:[Object.entries(eX).map(e=>{let[t,l]=e;return(0,i.jsx)(s.J,{children:(0,i.jsx)(d.Z,{fieldName:(0,c.lm)(t),formField:l,fields:o,initialValues:n})},t)}),(0,i.jsxs)(s.J,{children:[(0,i.jsxs)(a.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,i.jsx)(a.zx,{type:"button",variant:"buttons.textButton",onClick:()=>{if(eW(g))return v([]);v(eH)},children:eW(g)?"Unselect All":"Select all"})]}),eU.map(e=>(0,i.jsx)(ex.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:g.includes(e.value),onClick:()=>{if(g.find(t=>t===e.value))return v(g.filter(t=>t!==e.value));v([...g,e.value])}},e.value)),(null===(t=r.config)||void 0===t?void 0:t[h?"multi":"single"])?(0,i.jsx)(a.xu,{sx:{position:"absolute"},children:(0,i.jsx)(a.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[h?"multi":"single"]})}):null]}),(0,i.jsx)(s.J,{children:(0,i.jsx)(a.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,i.jsxs)(a.__,{variant:"label.border",children:[(0,i.jsx)(a.XZ,{checked:h,onChange:()=>f(!h)}),"Allow multiple paragraphs"]})})})]})}},Text:{create:e=>({type:"Text",config:{label:e,placeholder:""}}),Meta:e5,schema:e3,TYPE_NAME:"Text",FormFields:e2},Timestamp:{create:e=>({type:"Timestamp",config:{label:e,placeholder:""}}),schema:e7,FormFields:e6,TYPE_NAME:"Timestamp",Meta:e8},UID:{create:e=>({type:"UID",config:{label:e,placeholder:""}}),Meta:{icon:r.XN7},schema:e4,TYPE_NAME:"UID",FormFields:e9}},tt=[te.Image,te.Text,te.StructuredText,te.Link,te.Select,te.Boolean,te.Number,te.Color,te.Date,te.Embed,te.Timestamp,te.GeoPoint,te.ContentRelationship,te.LinkToMedia],tn="subItem",ti=g({schemaTypeRegex:/^NestedGroup$/,customListItem:e=>(0,i.jsx)(O,{Widgets:te,widgetsArray:tt,hintBase:tn,...e}),customName:"NestedGroup",hintItemName:tn}),tl={...te,NestedGroup:ti},tr=[tl.Image,tl.Text,tl.StructuredText,tl.Link,tl.Select,tl.Boolean,tl.Number,tl.Color,tl.Date,tl.Embed,tl.Timestamp,tl.GeoPoint,tl.ContentRelationship,tl.LinkToMedia,tl.NestedGroup],to="item",ta={Group:g({schemaTypeRegex:/^Group$/,customListItem:e=>{let t=function(){let e=(0,l.L)("slicemachine-nested-groups");return{eligible:(null==e?void 0:e.value)==="on"}}().eligible?tr:tr.filter(e=>"NestedGroup"!==e.CUSTOM_NAME);return(0,i.jsx)(O,{Widgets:tl,widgetsArray:t,hintBase:to,...e})},hintItemName:to}),NestedGroup:ti,...te}},85357:function(e,t,n){"use strict";n.d(t,{B9:function(){return o},Ss:function(){return s},uS:function(){return a},zg:function(){return d}});var i=n(65413),l=n(22863),r=n(25273);let o=(e,t)=>{let{[t]:n,...i}=e;return i},a=e=>!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId,s=(e,t)=>!e[t]&&(console.log('Could not find widget with type name "'.concat(t,'".')),!0),d=e=>({TYPE_NAME:e,FormFields:r.Jp,schema:i.object().shape({type:i.string().test({name:"type",test:function(t){return t===e}}),config:(0,l.gc)(o(r.Jp,"id"))}),create:()=>({type:e,config:(0,l.f7)(o(r.Jp,"id"))})})},46622:function(e,t,n){"use strict";function i(e){if(e.startsWith("/slices/"))return"slice";if(e.startsWith("/custom-types/"))return"custom type";if(e.startsWith("/page-types/"))return"page type";throw Error("Did not detect a content type from: ".concat(e))}n.d(t,{T:function(){return i}})},13938:function(e){e.exports={flex:"List_flex__b6acG",row:"List_row__zKnOI List_flex__b6acG",root:"List_root__m_SiQ List_flex__b6acG","root-border":"List_root-border__UW3vp",child:"List_child__MJ49i List_row__zKnOI List_flex__b6acG",header:"List_header__T0WM5 List_child__MJ49i List_row__zKnOI List_flex__b6acG",headerActions:"List_headerActions__mNgLY List_row__zKnOI List_flex__b6acG",item:"List_item__LMBx4 List_child__MJ49i List_row__zKnOI List_flex__b6acG"}},83288:function(e){e.exports={root:"ZoneEmptyState_root__DAfG2"}}}]);