slice-machine-ui 1.26.1-beta.21 → 1.26.1-beta.23

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.
Files changed (50) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/{jEpmnNgSaQQGEtlMfn4ek → Vr0X6Ewe6GS3TTyqUTJnQ}/_buildManifest.js +1 -1
  3. package/out/_next/static/chunks/188-7dba8514be013ee7.js +1 -0
  4. package/out/_next/static/chunks/661-78c8c89d258133b8.js +1 -0
  5. package/out/_next/static/chunks/pages/{_app-b18f49d5323fa9eb.js → _app-80990a659a16d46c.js} +1 -1
  6. package/out/_next/static/chunks/pages/custom-types/{[customTypeId]-ff73a06702296c34.js → [customTypeId]-982ecf1d799b6bcf.js} +1 -1
  7. package/out/_next/static/chunks/pages/page-types/{[pageTypeId]-30d471f6127ebed7.js → [pageTypeId]-886fc28240831dae.js} +1 -1
  8. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-d3e157cc3a540dd4.js +1 -0
  9. package/out/_next/static/css/60ed39436ce152a9.css +1 -0
  10. package/out/_next/static/css/{c47241940651ef2f.css → cb5dbae3d23ccce1.css} +1 -1
  11. package/out/_next/static/css/e8547bf6e08b50ac.css +1 -0
  12. package/out/changelog.html +1 -1
  13. package/out/changes.html +1 -1
  14. package/out/custom-types/[customTypeId].html +1 -1
  15. package/out/custom-types.html +1 -1
  16. package/out/index.html +1 -1
  17. package/out/labs.html +1 -1
  18. package/out/page-types/[pageTypeId].html +1 -1
  19. package/out/settings.html +1 -1
  20. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  21. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  22. package/out/slices.html +1 -1
  23. package/package.json +3 -3
  24. package/src/components/BaseHoverCard/BaseHoverCard.module.css +18 -0
  25. package/src/components/BaseHoverCard/BaseHoverCard.module.css.d.ts +7 -0
  26. package/src/components/BaseHoverCard/BaseHoverCard.tsx +1 -1
  27. package/src/components/List/List.css.ts +4 -2
  28. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.module.css +8 -0
  29. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.module.css.d.ts +5 -0
  30. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.tsx +1 -1
  31. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.module.css +11 -0
  32. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.module.css.d.ts +6 -0
  33. package/src/features/documentation/MarkdownRenderer/index.tsx +1 -1
  34. package/src/legacy/lib/builders/CustomTypeBuilder/TabZone/index.tsx +2 -0
  35. package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +8 -0
  36. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.module.css +12 -0
  37. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.module.css.d.ts +5 -0
  38. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/ZoneEmptyState.tsx +39 -0
  39. package/src/legacy/lib/builders/common/Zone/components/ZoneEmptyState/index.tsx +1 -0
  40. package/src/legacy/lib/builders/common/Zone/index.jsx +30 -9
  41. package/out/_next/static/chunks/127-6451528762141246.js +0 -1
  42. package/out/_next/static/chunks/96-d28e81d2b1c10a08.js +0 -1
  43. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-c431bb8d59974559.js +0 -1
  44. package/out/_next/static/css/a686f7612f1943ed.css +0 -1
  45. package/out/_next/static/css/dc201720b301472d.css +0 -1
  46. package/src/components/BaseHoverCard/BaseHoverCard.css.ts +0 -25
  47. package/src/features/customTypes/customTypesBuilder/PageSnippetDialog/PageSnippetDialog.css.ts +0 -12
  48. package/src/features/documentation/MarkdownRenderer/MarkdownRenderer.css.ts +0 -13
  49. package/src/legacy/lib/builders/common/Zone/components/EmptyState/index.tsx +0 -33
  50. /package/out/_next/static/{jEpmnNgSaQQGEtlMfn4ek → Vr0X6Ewe6GS3TTyqUTJnQ}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[127],{8127:function(e,n,t){"use strict";t.d(n,{H:function(){return nv}});var i=t(52322),r=t(22715),a=t(97729),l=t.n(a),o=t(5632),s=t(2784),c=t(56580),d=t(41730),u=t(91061),f=t(47976),m=t(67445),h=t(76478),v=t(62230),x=t(85244),p=t(98240),y=t(50002),b=t(73844);t(45158);var j="_1k08lzu5 _1ecs97dffi _1ecs97dffk _1ecs97dfft _1ecs97d32 _1ecs97daf _1ecs97dfhd",g=function(e){return(0,i.jsx)("div",(0,x.Z)((0,v.Z)({},e),{className:"_1k08lzu2 _1ecs97dffi _1ecs97dffk _1ecs97dfft _1ecs97d1u _1ecs97d97 _1ecs97d3j4 _1ecs97d3qh _1ecs97dfh9 _1ecs97dfil _1ecs97dfiz _1ecs97dfg9"}))},C=function(e){return(0,i.jsx)("div",(0,x.Z)((0,v.Z)({},e),{className:"_1k08lzu3 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dffq _1ecs97dfy4",children:(0,i.jsxs)("div",{className:"_1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dfpl",children:[(0,i.jsx)("span",{className:j}),(0,i.jsx)("span",{className:j}),(0,i.jsx)("span",{className:j})]})}))},_=function(e){return(0,i.jsx)(b.fC,(0,x.Z)((0,v.Z)({},e),{activationMode:"manual",className:"_1k08lzu6 _1ecs97dffi _1ecs97dffk _1ecs97dfft _1ecs97dffv"}))},S=function(e){var n=e.children,t=e.onAddNewTab,a=(0,p.Z)(e,["children","onAddNewTab"]);return(0,i.jsxs)(b.aV,(0,x.Z)((0,v.Z)({},a),{className:"_1k08lzu7 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dfg8",children:[n,(0,i.jsx)("div",{className:"_1k08lzuc _1k08lzu8 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dffq _1ecs97dfxh _1ecs97d1u _1ecs97d97 _1ecs97dfy1 _1ecs97dfge _1ecs97dfsk",children:(0,i.jsx)(r.hU,{icon:"add",onClick:t,hiddenLabel:"Add new tab"})})]}))},I=function(e){var n=e.children,t=e.menu,a=e.value,l=(0,p.Z)(e,["children","menu","value"]);return(0,i.jsx)(b.xz,(0,x.Z)((0,v.Z)({},l),{"aria-label":a,asChild:!0,onMouseDown:function(e){var n=e.target,t=(0,y.JY)(n);t!==e.currentTarget&&t!==e.currentTarget.parentElement&&e.preventDefault(),n===e.currentTarget&&n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},value:a,children:(0,i.jsxs)("div",{className:"_1k08lzu9 _1k08lzu8 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dffq _1ecs97dfxh _1ecs97dffj _1ecs97dah2 _1ecs97daof _1ecs97dfkk _1ecs97dfpl _1ecs97dfy4 _1ecs97dfgd",children:[(0,i.jsx)(r.xv,{className:"_1ecs97dfgd _1ecs97dffv",color:"inherit",component:"span",noWrap:!0,variant:"emphasized",children:n}),Boolean(t)?(0,i.jsx)("div",{className:"_1k08lzub _1ecs97dfgd _1ecs97dfh0",children:(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.hU,{icon:"moreVert",hiddenLabel:"tab-".concat(a,"-menu-button")})}),(0,i.jsx)(r.AW,{align:"start",children:t})]})}):void 0]})}))},k=function(e){return(0,i.jsx)(b.VY,(0,x.Z)((0,v.Z)({},e),{className:"_1k08lzud _1ecs97dffi _1ecs97d18 _1ecs97d8l _1ecs97dffl _1ecs97dffv"}))},w=t(22710),Z=t(99267),T=t(74217),D=t(82770),N=t(50950),L=t(26921),V=t(90374),M=t(78656),F=(0,s.createContext)(void 0);function A(e){var n=e.children,t=e.initialCustomType,r=(0,s.useState)(t),a=r[0],l=r[1],o=(0,u.y6)(a),c=M.$[o],d=(0,L.c)({errorMessage:c.autoSaveFailed}),f=d.actionQueueStatus,m=d.setNextAction,h=(0,V.Z)().saveCustomTypeSuccess,v=(0,T.R9)(h),x=(0,N.g)().syncChanges,p=(0,s.useCallback)(function(e){l(e),m((0,w.Z)(function(){var n;return(0,Z.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,D.KA)(e)];case 1:if((n=t.sent().errors).length>0)throw n;return v(e),x(),[2]}})}))},[m,v,x]),y=(0,s.useMemo)(function(){return{actionQueueStatus:f,customType:a,setCustomType:p}},[f,a,p]);return(0,i.jsx)(F.Provider,{value:y,children:"function"==typeof n?n(y):n})}function E(){var e=(0,s.useContext)(F);if(!e)throw Error("CustomTypeProvider not found");return e}var z=t(15354),P=t(6134),H=t(63397),B=t(75289),R=function(e){var n=e.name,t=e.label,r=e.placeholder,a=e.error,l=(0,p.Z)(e,["name","label","placeholder","error"]);return(0,i.jsxs)(B.xu,{mb:3,children:[(0,i.jsx)(B.__,{htmlFor:n,mb:2,children:t}),(0,i.jsx)(H.gN,(0,v.Z)({name:n,type:"text",placeholder:r,as:B.II,autoComplete:"off"},l)),a?(0,i.jsx)(B.xv,{sx:{color:"error",mt:1},children:a}):null]})},O=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,a=e.tabIds;return(0,i.jsx)(P.Z,{isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,onSubmit:function(e){t(e),r()},initialValues:{id:""},validate:function(e){var n=e.id;return n?a.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Add Tab"},children:function(e){var n=e.errors;return(0,i.jsx)(R,{name:"id",label:"New Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id})}})},K=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close;return(0,i.jsx)(P.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{},content:{title:"Remove Tab"},children:function(){return(0,i.jsxs)(B.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(B.X6,{as:"h4",children:"Remove this tab?"}),(0,i.jsx)(B.xv,{as:"p",color:"textClear",sx:{mt:2},children:"This action cannot be undone."}),(0,i.jsx)(B.zx,{type:"button",variant:"buttons.actionDelete",sx:{mt:3},onClick:function(){t({}),r()},children:"Yes, remove tab"})]})}})},U=function(e){var n=e.isOpen,t=e.onSubmit,r=e.close,a=e.tabIds,l=e.initialTabKey;return(0,i.jsx)(P.Z,{omitFooter:!0,isOpen:n,widthInPx:"530px",formId:"create-tab",close:r,cardProps:{bodySx:{p:0}},onSubmit:function(e){t(e),r()},initialValues:{id:l},validate:function(e){var n=e.id;return n?a.includes(n.toLowerCase())?{id:"Tab exists already"}:void 0:{id:"Tab ID is required"}},content:{title:"Rename Tab"},children:function(e){var n=e.errors,a=e.values,l=e.setFieldValue,o=e.isValid;return(0,i.jsxs)(B.xu,{sx:{px:4,py:4},children:[(0,i.jsx)(R,{name:"id",label:"Rename Tab ID",placeholder:"A label for selecting the tab (i.e. not used in the API)",error:n.id,onBlur:function(e){a.id!==e.target.value&&l("id",e.target.value.trim())},onChange:function(e){l("id",e.target.value)}}),(0,i.jsx)(B.zx,{type:"button",sx:{mt:3,width:"100%"},disabled:!o,onClick:function(){a.id&&a.id.length&&t({id:a.id.trim()}),r()},children:"Save"})]})}})},X=t(81541),q=t(28316),W=t(28173),Q=t(8564),Y=t(52586),G=[Y.UID,Y.Group,Y.StructuredText,Y.Image,Y.Link,Y.LinkToMedia,Y.ContentRelationship,Y.Select,Y.Boolean,Y.Date,Y.Timestamp,Y.Embed,Y.Number,Y.GeoPoint,Y.Color,Y.Text,],$=t(13302),J=t(17384),ee=t(9461),en=t(73393),et=t(18645),ei=t(88932),er=t(65077),ea=t(82032),el=function(e){return(0,i.jsxs)("svg",(0,x.Z)((0,v.Z)({width:"127",height:"98",viewBox:"0 0 127 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,i.jsx)("path",{d:"M73.5 44.5H85",stroke:"#17151F",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M35 68.5H40.5H92C93.1046 68.5 94 67.6046 94 66.5V39C94 37.8954 93.1046 37 92 37H35C33.8954 37 33 37.8954 33 39V66.5C33 67.6046 33.8954 68.5 35 68.5Z",fill:"#F4F2F4",stroke:"#17151F"}),(0,i.jsx)("path",{d:"M38 60.5H41.0381H89C89.5523 60.5 90 60.0523 90 59.5V52C90 51.4477 89.5523 51 89 51H38C37.4477 51 37 51.4477 37 52V59.5C37 60.0523 37.4477 60.5 38 60.5Z",fill:"#6E56CF",stroke:"#17151F"}),(0,i.jsx)("circle",{cx:"89.5",cy:"44.5",r:"0.5",fill:"#17151F"}),(0,i.jsx)("path",{d:"M40.5 97.5V56H86V97.5H40.5Z",fill:"#F9F8F9",stroke:"#17151F"}),(0,i.jsx)("rect",{x:"47",y:"75",width:"33",height:"16",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M48 57H52V70C52 71.1046 51.1046 72 50 72V72C48.8954 72 48 71.1046 48 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M55 57H59V70C59 71.1046 58.1046 72 57 72V72C55.8954 72 55 71.1046 55 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("path",{d:"M62 57H66V70C66 71.1046 65.1046 72 64 72V72C62.8954 72 62 71.1046 62 70V57Z",fill:"#E4E2E4"}),(0,i.jsx)("line",{x1:"0.353553",y1:"35.9856",x2:"15.5467",y2:"51.1787",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"42.1959",y1:"0.87059",x2:"47.7569",y2:"21.6248",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"99.5522",y1:"8.4091",x2:"87.2281",y2:"26.0097",stroke:"#C8C7CB"}),(0,i.jsx)("line",{x1:"126.408",y1:"41.0849",x2:"108.807",y2:"53.4089",stroke:"#C8C7CB"}),(0,i.jsx)("path",{d:"M39.8713 47C38.7657 47 38.0627 46.4554 38.0033 45.6337L38 45.5875H38.8251L38.8284 45.6205C38.868 46.0198 39.2937 46.2838 39.8977 46.2838C40.4719 46.2838 40.8746 46 40.8746 45.5908V45.5875C40.8746 45.2442 40.6271 45.0363 40.0132 44.9043L39.5017 44.7987C38.5281 44.5941 38.1056 44.1386 38.1056 43.429V43.4257C38.1056 42.5743 38.8383 42 39.868 42C40.9241 42 41.5809 42.5776 41.6403 43.3432L41.6436 43.3861H40.8284L40.8218 43.3465C40.7624 42.9769 40.4092 42.7129 39.8647 42.7162C39.3366 42.7162 38.9604 42.9637 38.9604 43.3696V43.3729C38.9604 43.7096 39.2013 43.9208 39.7954 44.0462L40.3069 44.1551C41.3102 44.3663 41.7294 44.769 41.7294 45.4884V45.4917C41.7294 46.4191 41.0132 47 39.8713 47Z",fill:"black"}),(0,i.jsx)("path",{d:"M42.6865 46.8812V42.1188H43.6634L45.0957 45.7822H45.1518L46.5809 42.1188H47.5578V46.8812H46.7921V43.495H46.7327L45.4125 46.8812H44.8317L43.5116 43.495H43.4554V46.8812H42.6865Z",fill:"black"})]}))},eo=function(e){var n=e.openCreateSliceModal,t=e.openUpdateSliceZoneModal,a=e.openSlicesTemplatesModal,l=e.projectHasAvailableSlices,o=e.isSlicesTemplatesSupported;return(0,i.jsx)(r.xu,{flexGrow:1,justifyContent:"center","data-testid":"slice-zone-blank-slate",children:(0,i.jsx)(ea.R$,{backgroundImage:"/blank-slate-slice-zone.png",children:(0,i.jsxs)(ea.T9,{children:[(0,i.jsx)(r.xu,{justifyContent:"center",padding:{bottom:16},children:(0,i.jsx)(el,{})}),(0,i.jsx)(ea._T,{children:"Add slices"}),(0,i.jsx)(ea.nf,{children:"Slices are website sections that you can reuse on different pages with different content. Each slice has its own component in your code."}),(0,i.jsx)(ea.Qj,{children:(0,i.jsxs)(r.S0,{children:[(0,i.jsx)(r.F8,{startIcon:"add",onClick:n,description:"Start from scratch.",children:"Create new"}),o?(0,i.jsx)(r.F8,{startIcon:"contentCopy",onClick:a,description:"Select from premade examples.",endAdornment:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,l?(0,i.jsx)(r.F8,{startIcon:"folder",onClick:t,description:"Select from your own slices.",children:"Select existing"}):void 0]})})]})})})};function es(e){var n=e.customType,t=e.tabId,i=e.slices,r=(0,v.Z)({},n);return i.forEach(function(e){r=(0,x.Z)((0,v.Z)({},r),{tabs:r.tabs.map(function(n){return n.key===t&&n.sliceZone?(0,x.Z)((0,v.Z)({},n),{sliceZone:{key:n.sliceZone.key,value:[{key:e.id,value:e},].concat((0,X.Z)(n.sliceZone.value))}}):n})})}),D.Xe.track({event:"custom-type:slice-zone-updated",customTypeId:n.id}),r}var ec=t(17064),ed=t(18566),eu=t(81038);function ef(){return em.apply(this,arguments)}function em(){return(em=(0,w.Z)(function(){var e,n,t;return(0,Z.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,eu.j.sliceTemplateLibrary.readLibrary({})];case 1:if(n=(e=i.sent()).templates,(t=e.errors).length>0)throw t;return[2,n.map(function(e){return{model:e.model,screenshots:Object.fromEntries(Object.entries(e.screenshots).map(function(e){var n=(0,ec.Z)(e,2),t=n[0],i=n[1];return[t,URL.createObjectURL(i),]}))}})];case 2:return i.sent(),[2,[]];case 3:return[2]}})})).apply(this,arguments)}var eh=t(56054),ev=t(6777),ex=t(95200),ep=t(34226),ey=t(98898),eb=t(83399),ej=function(e){var n=e.deleteSliceZone,t=e.closeDeleteSliceZoneModal;return(0,i.jsx)(eb.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:t,children:(0,i.jsx)(ey.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(){return(0,i.jsxs)(B.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.jsx)(B.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Do you really want to delete Slice Zone?"}),(0,i.jsx)(B.x8,{type:"button",onClick:t})]})},Footer:function(){return(0,i.jsxs)(B.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)(ep.z,{label:"Cancel",variant:"secondary",onClick:t,sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,i.jsx)(ep.z,{label:"Delete",variant:"danger",onClick:n,sx:{minHeight:39,minWidth:78}})]})},children:(0,i.jsx)(B.nv,{children:"You're about to delete Slice Zone."})})})},eg=t(63269),eC=t(24804),e_=t(5479),eS=t(98235),eI=t(86251),ek=t.n(eI),ew=function(e){var n,t=e.isOpen,a=e.close,l=e.onSubmit,o=e.isLoading,s=e.slice,d=e.libraries,u=(0,c.v9)(function(e){return{remoteSlices:(0,ex.sT)(e)}}).remoteSlices;return(0,i.jsxs)(r.Vq,{open:t,onOpenChange:function(e){return!e&&a()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Upgrade slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(H.J9,{validateOnMount:!0,initialValues:{from:null===(n=d[0])||void 0===n?void 0:n.name,sliceName:(0,J.MP)(s.key)},validate:function(e){return(0,eS.h)(e,d,u)},onSubmit:function(e){l({libraryID:e.from,sliceID:e.sliceName})},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-slice-dialog",children:(0,i.jsxs)(r.xu,{flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ek().scrollArea,style:{width:448},children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"This will create a new slice with the same fields. The new slice will replace the legacy slice in all of your types, and the existing slice content will be re-mapped to the new slice."}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"This will not migrate your component. You will need to do that manually."}),(0,i.jsxs)(r.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Display name*"}),"string"==typeof e.errors.sliceName?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.sliceName}):null]}),(0,i.jsx)(r.yt,{placeholder:"Pascalised Slice API ID (e.g. ".concat((0,J.MP)(s.key),")"),error:"string"==typeof e.errors.sliceName,value:e.values.sliceName,onValueChange:function(n){e.setFieldValue("sliceName",n.slice(0,30))},"data-testid":"slice-name-input"}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"A display name for the slice"})]}),(0,i.jsxs)(r.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Slice library*"}),"string"==typeof e.errors.from?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.from}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"folder",flexContent:!0,value:e.values.from,onValueChange:function(n){return n?void e.setFieldValue("from",n):null},children:d.map(function(e){return(0,i.jsx)(r.Ql,{value:e.name,children:e.name},e.name)})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"The library where we'll store your slice"})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Upgrade",onClick:function(){e.submitForm()},loading:o,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eZ=t(76635),eT=function(e){var n,t,a=e.isOpen,l=e.close,o=e.onSubmit,c=e.isLoading,d=e.slice,u=e.sliceName,f=e.libraries,m=e.localSharedSlices,h=(0,s.useState)(!0),p=h[0],y=h[1];return(0,i.jsxs)(r.Vq,{open:a,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Convert to slice variation"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(H.J9,{initialValues:{libraryID:null===(n=m[0])||void 0===n?void 0:n.from,sliceID:null===(t=m[0])||void 0===t?void 0:t.model.id,variationID:(0,eZ.camelCase)(d.key),variationName:u},validate:function(e){return eD(e,f)},onSubmit:function(e){o(e)},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-as-new-variation-dialog",children:(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ek().scrollArea,style:{width:448},children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"If you have multiple slices that are similar, you can combine them as variations of the same slice."}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.libraryID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.libraryID}):null,"string"==typeof e.errors.sliceID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.sliceID}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:"".concat(e.values.libraryID,"::").concat(e.values.sliceID),onValueChange:function(n){if(n){var t=(0,ec.Z)(n.split("::"),2),i=t[0],r=t[1];e.setFieldValue("libraryID",i),e.setFieldValue("sliceID",r)}},children:m.map(function(e){return(0,i.jsxs)(r.Ql,{value:"".concat(e.from,"::").concat(e.model.id),children:[e.from," ",">"," ",e.model.name," (",e.model.id,")"]},"".concat(e.from,"::").concat(e.model.id))})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"Choose the slice to which you would like to add this variation."})]}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(r.yt,{placeholder:u,error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:function(n){var t=(0,x.Z)((0,v.Z)({},e.values),{variationName:n.slice(0,30)});p&&(t.variationID=(0,eZ.camelCase)(t.variationName)),e.setValues(t,!0)},"data-testid":"variation-name-input"})]}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"ID*"}),"string"==typeof e.errors.variationID?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.variationID}):null]}),(0,i.jsx)(r.yt,{placeholder:(0,eZ.camelCase)(d.key),error:"string"==typeof e.errors.variationID,value:e.values.variationID,onValueChange:function(n){y(!1),e.setFieldValue("variationID",(0,eZ.camelCase)(n.slice(0,30)))},"data-testid":"variation-id-input"})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Convert",onClick:function(){e.submitForm()},loading:c,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eD=function(e,n){var t,i={};e.libraryID||(i.libraryID="Cannot be empty.");var r=n.find(function(n){return n.path===e.libraryID});i.libraryID||r||(i.libraryID="Does not exist."),e.sliceID||(i.sliceID="Cannot be empty.");var a=null==r?void 0:r.components.find(function(n){return n.model.id===e.sliceID});return(i.sliceID||a||(i.sliceID="Does not exist."),e.variationName||(i.variationName="Cannot be empty."),e.variationID)?(null!==(t=null==a?void 0:a.model.variations.map(function(e){return e.id}))&&void 0!==t?t:[]).includes(e.variationID)&&(i.variationID="Slice variation ID is already taken."):i.variationID="Cannot be empty.",i},eN=function(e){var n,t,a=e.isOpen,l=e.close,o=e.onSubmit,s=e.isLoading,c=e.identicalSlices;return(0,i.jsxs)(r.Vq,{open:a,onOpenChange:function(e){return!e&&l()},size:{width:448,height:"auto"},children:[(0,i.jsx)(r.fK,{title:"Merge with an existing slice"}),(0,i.jsx)(r.cZ,{children:(0,i.jsx)(H.J9,{initialValues:{path:null!==(t=null===(n=c[0])||void 0===n?void 0:n.path)&&void 0!==t?t:""},validate:function(e){if(!e.path)return{path:"Cannot be empty."}},onSubmit:function(e){var n,t=(0,ec.Z)(e.path.split("::"),3),i=t[0];o({libraryID:i,sliceID:t[1],variationID:t[2]})},children:function(e){return(0,i.jsx)("form",{id:"convert-legacy-slice-merge-with-identical-dialog",children:(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",children:[(0,i.jsxs)(r.xr,{className:ek().scrollArea,children:[(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"If you have multiple identical slices, you can merge them. All of your content will be remapped to the target slice."}),(0,i.jsxs)(r.xu,{display:"flex",flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ek().label,children:[(0,i.jsx)(r.xv,{variant:"bold",children:"Target slice*"}),"string"==typeof e.errors.path?(0,i.jsx)(r.xv,{variant:"small",color:"tomato10",children:e.errors.path}):null]}),(0,i.jsx)(r.Ph,{size:"medium",color:"grey",startIcon:"viewDay",flexContent:!0,value:e.values.path,onValueChange:function(n){n&&e.setFieldValue("path",n)},children:c.map(function(e){return(0,i.jsx)(r.Ql,{value:e.path,children:e.path.split("::").join(" > ")},e.path)})}),(0,i.jsx)(r.xv,{variant:"normal",color:"grey11",children:"Choose a slice that you would like to merge this into."})]})]}),(0,i.jsx)(r.kX,{ok:{text:"Merge",onClick:function(){e.submitForm()},loading:s,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})})}})})]})},eL=function(e){var n,t,a=e.slice,l=e.path,o=(0,V.Z)().refreshState,d=(0,s.useState)(!1),u=d[0],f=d[1],m=(0,s.useState)(),h=m[0],p=m[1],y=E().setCustomType,b=(0,c.v9)(function(e){return{libraries:(0,ex.Sd)(e)}}).libraries,j="Slice"===a.value.type&&null!==(n=a.value.fieldset)&&void 0!==n?n:a.key,g=b.filter(function(e){return e.isLocal}),C=g.map(function(e){return e.components}).flat(),_=eV(a,j,C),S=(t=(0,w.Z)(function(e){var n,t,i,r,s,c,d,u;return(0,Z.__generator)(this,function(u){switch(u.label){case 0:if(!h)return[2];return f(!0),D.Xe.track({event:"legacy-slice:converted",id:e.sliceID,variation:null!==(n=e.variationID)&&void 0!==n?n:"default",library:e.libraryID,conversionType:h}),[4,eu.j.slices.convertLegacySliceToSharedSlice({model:a.value,src:(0,x.Z)((0,v.Z)({},l),{sliceID:a.key}),dest:{libraryID:e.libraryID,sliceID:e.sliceID,variationName:null!==(t=e.variationName)&&void 0!==t?t:"Default",variationID:null!==(i=e.variationID)&&void 0!==i?i:"default"}})];case 1:if((r=u.sent().errors).length)throw console.error("Could not convert slice `".concat(j,"`"),r),ei.Am.error("Could not convert slice `".concat(j,"`")),r;return[4,eu.j.customTypes.readCustomType({id:l.customTypeID})];case 2:if(c=(s=u.sent()).model,(d=s.errors).length||!c)return console.error("Could not refresh custom type view `".concat(l.customTypeID,"`"),d),ei.Am.error("Could not refresh custom type view `".concat(l.customTypeID,"`")),[2];return[4,(0,D.y0)()];case 3:switch(o(u.sent()),f(!1),p(void 0),h){case"as_new_slice":ei.Am.success("".concat(j," has been upgraded to a new slice ").concat(e.libraryID," > ").concat(e.sliceID));break;case"as_new_variation":ei.Am.success("".concat(j," has been converted as a variation of ").concat(e.libraryID," > ").concat(e.sliceID));break;default:ei.Am.success("".concat(j," has been merged with ").concat(e.libraryID," > ").concat(e.sliceID))}return y(c),[2]}})}),function(e){return t.apply(this,arguments)}),I={path:l,slice:a,sliceName:j,libraries:g,localSharedSlices:C,identicalSlices:_,close:function(){return p(void 0)},onSubmit:S,isLoading:u};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{"data-testid":"convert-legacy-slice",startIcon:"refresh",endIcon:"arrowDropDown",size:"medium",color:"grey",children:"Migrate legacy slice"})}),(0,i.jsxs)(r.AW,{align:"start",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"folder",size:"large"}),description:"Use it with new types",onSelect:function(){return p("as_new_slice")},children:"Upgrade slice"}),(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"viewDay",size:"large"}),description:"Add it to another slice",onSelect:function(){return p("as_new_variation")},disabled:!C.length,children:"Convert to slice variation"}),(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"driveFileMove",size:"large"}),description:"Combine identical slices",onSelect:function(){return p("merge_with_identical")},disabled:!_.length,children:"Merge with another slice"})]})]}),(0,i.jsx)(ew,(0,x.Z)((0,v.Z)({},I),{isOpen:"as_new_slice"===h})),(0,i.jsx)(eT,(0,x.Z)((0,v.Z)({},I),{isOpen:"as_new_variation"===h})),(0,i.jsx)(eN,(0,x.Z)((0,v.Z)({},I),{isOpen:"merge_with_identical"===h}))]})},eV=function(e,n,t){return(0,s.useMemo)(function(){var i=[],r=(0,e_.ux)(e.value,n),a=!0,l=!1,o=void 0;try{for(var s,c=t[Symbol.iterator]();!(a=(s=c.next()).done);a=!0){var d=s.value,u=!0,f=!1,m=void 0;try{for(var h,v=d.model.variations[Symbol.iterator]();!(u=(h=v.next()).done);u=!0){var x=h.value,p=(0,e_.ux)(x,d.model.name);r.primary===p.primary&&r.items===p.items&&i.push({libraryID:d.from,sliceID:d.model.id,variationID:x.id,path:"".concat(d.from,"::").concat(d.model.id,"::").concat(x.id)})}}catch(y){f=!0,m=y}finally{try{u||null==v.return||v.return()}finally{if(f)throw m}}}}catch(b){l=!0,o=b}finally{try{a||null==c.return||c.return()}finally{if(l)throw o}}return i},[e,n,t])},eM=function(e){var n=e.slice,t=e.path,a=(0,ec.Z)((0,eg.E)("legacySliceUpgrader"),1)[0],l=a.enabled?"This Slice was created with the Legacy Builder. It needs to be converted first to be used within Slice Machine.":"This Slice was created with the Legacy Builder, and is incompatible with Slice Machine. You cannot edit, push, or delete it in Slice Machine. In order to proceed, manually remove the Slice from your type model. Then create a new Slice with the same fields using Slice Machine.";return(0,i.jsxs)(eC.Zb,{children:[(0,i.jsx)(eC.ZB,{component:"div",children:(0,i.jsx)(r.xu,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(r.xv,{color:"grey11",component:"span",children:"No screenshot available"})})}),(0,i.jsxs)(eC.T$,{children:[(0,i.jsx)(r.u,{content:l,side:"bottom",children:(0,i.jsx)(r.Ct,{color:"purple",title:"Legacy Slice"})}),a.enabled?(0,i.jsx)(eL,{slice:n,path:t}):null]}),(0,i.jsx)(eC.eW,{subtitle:"1 variation",title:(0,e_.Dj)(n.value)})]})},eF=t(56319),eA=t(53420),eE=function(e){var n=e.slices,t=e.format,r=e.path,a=e.onRemoveSharedSlice,l=n.some(function(e){return"SharedSlice"!==e.type}),o=M.$[t],c=(0,ec.Z)((0,eg.E)("legacySliceUpgrader"),1)[0];return(0,s.useEffect)(function(){l&&(c.enabled?ei.Am.info("This ".concat(o.name({start:!1,plural:!1})," contains legacy slices that can be upgraded.")):ei.Am.warning("This ".concat(o.name({start:!1,plural:!1})," contains slices that are incompatible.")))},[l]),(0,i.jsx)(eA.Z,{elems:n,defineElementKey:function(e){return"SharedSlice"!==e.type?e.payload.key:e.payload.model.name},renderElem:function(e){if("SharedSlice"!==e.type){var n=e.payload;return(0,i.jsx)(eM,{slice:n,path:r})}var t=e.payload;return(0,i.jsx)(eF.b,{action:{type:"remove",onRemove:function(){a(t.model.id)}},mode:"navigation",slice:t,variant:"solid"})},sx:{padding:"16px"}})},ez=t(67557);function eP(){return(eP=(0,w.Z)(function(e){var n,t,i,r,a,l,o,s;return(0,Z.__generator)(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),n=e.templateIDs,t=e.localLibrariesNames,i=e.onSuccess,[4,eu.j.sliceTemplateLibrary.createSlices({templateIDs:n})];case 1:if(a=(r=c.sent()).data,(l=r.errors).length>0||void 0===a)throw l;return a.sliceIDs.forEach(function(e,i){D.Xe.track({event:"slice:created",id:e,name:e,library:t[0],sliceTemplate:n[i]})}),[4,i(a.sliceIDs)];case 2:return c.sent(),[3,4];case 3:return o=c.sent(),s="Internal Error: Slice(s) not created",console.error(s,o),ei.Am.error(s),[3,4];case 4:return[2]}})})).apply(this,arguments)}var eH=t(23373),eB=[{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:{id:"video_highlights",name:"VideoHighlights",type:"SharedSlice",variations:[{description:"",docURL:"",id:"default",name:"Default",version:"sktwi1xtmkfgx8626"},]},screenshots:{default:{url:"/videoHighlights.png"}}},],eR=function(e){var n=e.availableSlices,t=e.values,r=e.placeholderSlices;return(0,i.jsx)(H.F2,{name:"sliceKeys",render:function(e){return(0,i.jsx)(eA.Z,{gridTemplateMinPx:"200px",elems:n,defineElementKey:function(e){return"".concat(e.from,"-").concat(e.model.name)},renderElem:function(n){var a,l=null!==(a=null==r?void 0:r.some(function(e){return e.model.id===n.model.id}))&&void 0!==a&&a,o=t.sliceKeys.includes(n.model.id);return(0,i.jsx)(eF.b,{action:{type:"checkbox"},isComingSoon:l,mode:"selection",onSelectedChange:function(i){i?e.push(n.model.id):e.remove(t.sliceKeys.indexOf(n.model.id))},selected:o,slice:n,variant:"outlined"})}})}})},eO=function(e){var n=e.formId,t=e.close,r=e.onSuccess,a=e.availableSlicesTemplates,l=e.localLibraries,o=(0,V.Z)().createSliceSuccess;return(0,i.jsx)(P.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){var n;!function(e){return eP.apply(this,arguments)}({templateIDs:e.sliceKeys,localLibrariesNames:l.map(function(e){return e.name}),onSuccess:(n=(0,w.Z)(function(e){var n,t;return(0,Z.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,D.y0)()];case 1:var t;return o(n.sent().libraries),[4,Promise.all(e.map((t=(0,w.Z)(function(e){var n;return(0,Z.__generator)(this,function(n){switch(n.label){case 0:return[4,eu.j.slices.readSlice({libraryID:l[0].name,sliceID:e})];case 1:return[2,n.sent().model]}})}),function(e){return t.apply(this,arguments)})).filter(function(e){return void 0!==e}))];case 2:return r(n.sent()),[2]}})}),function(e){return n.apply(this,arguments)})})},initialValues:{sliceKeys:[]},content:{title:"Use template slices"},validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one template to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(B.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eR,{values:n,placeholderSlices:eB,availableSlices:(0,X.Z)(a.map(function(e){return{extension:"",fileName:"",from:"",href:"",pathToSlice:"",model:eH.id.toSM(e.model),screenshots:Object.entries(e.screenshots).reduce(function(e,n){return(0,x.Z)((0,v.Z)({},e),(0,ez.Z)({},n[0],{url:n[1]}))},{})}})).concat((0,X.Z)(eB))})}})},eK=function(e){var n=e.formId,t=e.close,r=e.onSubmit,a=e.availableSlices;return(0,i.jsx)(P.Z,{isOpen:!0,buttonLabel:"Add",formId:n,close:t,onSubmit:function(e){r(e.sliceKeys.map(function(e){var n;return null===(n=a.find(function(n){return n.model.id===e}))||void 0===n?void 0:n.model}).filter(function(e){return void 0!==e}))},initialValues:{sliceKeys:[]},content:{title:"Select existing slices"},testId:"update-slices-modal",validate:function(e){if(0===e.sliceKeys.length)return{sliceKeys:"Select at least one slice to add"}},actionMessage:function(e){var n=e.errors;return void 0!==n.sliceKeys?(0,i.jsx)(B.xv,{sx:{color:"error"},children:n.sliceKeys}):void 0},children:function(e){var n=e.values;return(0,i.jsx)(eR,{values:n,availableSlices:a})}})},eU=function(e,n){var t,i=(n||[]).reduce(function(e,n){return(0,X.Z)(e).concat((0,X.Z)(n.components))},[]),r=e.value.reduce(function(e,n){var t=n.key,r=n.value;if("SharedSlice"===r.type){var a=i.find(function(e){return e.model.id===t});return a?(0,x.Z)((0,v.Z)({},e),{slicesInSliceZone:(0,X.Z)(e.slicesInSliceZone).concat([{type:"SharedSlice",payload:a},])}):(0,x.Z)((0,v.Z)({},e),{notFound:(0,X.Z)(e.notFound).concat([{key:t}])})}return(0,x.Z)((0,v.Z)({},e),{slicesInSliceZone:(0,X.Z)(e.slicesInSliceZone).concat([{type:"Slice",payload:{key:t,value:r}},])})},{slicesInSliceZone:[],notFound:[]});return{availableSlices:i,slicesInSliceZone:r.slicesInSliceZone,notFound:r.notFound}},eX=function(e){var n,t=e.customType,a=e.onCreateSliceZone,l=e.onDeleteSliceZone,d=e.onRemoveSharedSlice,u=e.sliceZone,f=e.tabId,m=(0,o.useRouter)(),h=m.query,v=m.replace,x=m.pathname,p=(0,ed.QT)(ef,[]),y=(0,s.useState)(!1),b=y[0],j=y[1],g=(0,s.useState)(!1),C=g[0],_=g[1],S=(0,s.useState)(!1),I=S[0],k=S[1],w=(0,c.v9)(function(e){return{remoteSlices:(0,ex.sT)(e),libraries:(0,ex.Sd)(e),slices:(0,ex.xC)(e)}}),Z=w.remoteSlices,T=w.libraries,N=E().setCustomType,L=T.filter(function(e){return e.isLocal}),V=(0,s.useMemo)(function(){return u?eU(u,T):{availableSlices:[],slicesInSliceZone:[],notFound:[]}},[u,T]),M=V.availableSlices,F=V.slicesInSliceZone,A=V.notFound,P=(0,s.useState)(!1),H=P[0],B=P[1];(0,s.useEffect)(function(){(null==A?void 0:A.length)&&A.forEach(function(e){d(e.key)})},[A]);var R=F.filter(function(e){return"SharedSlice"===e.type}).map(function(e){return e.payload}),O=M.filter(function(e){return!R.some(function(n){return n.model.id===e.model.id})}),K=function(){_(!0)},U=function(){k(!0)},X=function(){j(!0),D.Xe.track({event:"custom-type:open-add-from-templates",customTypeId:t.id,customTypeFormat:t.format})},q=function(){"true"===h.newPageType&&v({pathname:x,query:{pageTypeId:h.pageTypeId}},void 0,{shallow:!0})},Q=function(){_(!1)},Y=function(){k(!1)},G=function(){j(!1)};return(0,i.jsxs)(i.Fragment,{children:[void 0===h.newPageType?(0,i.jsx)(W.Bu,{actions:u?(0,i.jsxs)(r.h_,{children:[(0,i.jsx)(r.$F,{children:(0,i.jsx)(r.zx,{color:"grey",startIcon:"add",children:"Add slices"})}),(0,i.jsxs)(r.AW,{align:"end",children:[(0,i.jsx)(r.Xi,{startIcon:(0,i.jsx)(r.I5,{name:"add",size:"large"}),onSelect:U,description:"Start from scratch.",children:"Create new"}),p.length>0?(0,i.jsx)(r.Xi,{onSelect:X,startIcon:(0,i.jsx)(r.I5,{name:"contentCopy",size:"large"}),description:"Select from premade examples.",shortcut:(0,i.jsx)(r.Ct,{color:"purple",title:"New"}),children:"Use template"}):void 0,O.length>0?(0,i.jsx)(r.Xi,{onSelect:K,startIcon:(0,i.jsx)(r.I5,{name:"folder",size:"large"}),description:"Select from your own slices.",children:"Select existing"}):void 0]})]}):void 0,toggle:"page"!==t.format||"Main"!==f?(0,i.jsx)(r.rs,{checked:!!u,onCheckedChange:function(e){e?a():B(!0)},size:"small","data-testid":"slice-zone-switch"}):void 0,children:"Slice Zone"}):void 0,u?F.length>0?(0,i.jsx)(er.xR,{children:(0,i.jsx)(eE,{slices:F,format:t.format,path:{customTypeID:t.id,tabID:f,sliceZoneID:null!==(n=null==u?void 0:u.key)&&void 0!==n?n:""},onRemoveSharedSlice:d})}):(0,i.jsx)(eo,{openUpdateSliceZoneModal:K,openCreateSliceModal:U,openSlicesTemplatesModal:X,projectHasAvailableSlices:O.length>0,isSlicesTemplatesSupported:p.length>0}):void 0,C&&(0,i.jsx)(eK,{formId:"tab-slicezone-form-".concat(f),availableSlices:O,onSubmit:function(e){var n=es({customType:t,tabId:f,slices:e});N(z.Dc.fromSM(n)),Q(),q(),ei.Am.success("Slice(s) added to slice zone")},close:Q}),b&&(0,i.jsx)(eO,{formId:"tab-slicezone-form-".concat(f),availableSlicesTemplates:p,localLibraries:L,onSuccess:function(e){var n=es({customType:t,tabId:f,slices:e});N(z.Dc.fromSM(n)),G(),q(),ei.Am.success((0,i.jsx)(ev.GX,{message:"Slice template(s) added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},close:G}),H&&(0,i.jsx)(ej,{closeDeleteSliceZoneModal:function(){B(!1)},deleteSliceZone:function(){l(),B(!1)}}),(null==L?void 0:L.length)!==0&&I&&(0,i.jsx)(eh.c,{onSuccess:function(e){var n=es({customType:t,tabId:f,slices:[e]});N(z.Dc.fromSM(n)),Y(),q(),ei.Am.success((0,i.jsx)(ev.GX,{message:"New slice added to slice zone and created at: ",path:"".concat(L[0].name,"/")}))},localLibraries:L,remoteSlices:Z,onClose:Y})]})},eq=function(e){var n,t,a,l=e.tabId,c=E(),d=c.customType,f=c.setCustomType,m=z.Dc.toSM(d),h=null===(n=m.tabs.find(function(e){return e.key===l}))||void 0===n?void 0:n.sliceZone,v=null!==(a=null===(t=m.tabs.find(function(e){return e.key===l}))||void 0===t?void 0:t.value)&&void 0!==a?a:[],x=(0,o.useRouter)().query,p=m.tabs.reduce(function(e,n){return(0,X.Z)(e).concat((0,X.Z)(n.value))},[]),y=function(e){var n=(0,u.AK)({customType:d,fieldId:e,sectionId:l});f(n)},b=function(e){var n=e.id,t=e.label,i=e.widgetTypeName;if(!(0,$.Ss)(Y,i)){var r=Y[i].create(t);if("Range"===r.type||"IntegrationFields"===r.type||"Separator"===r.type)throw Error("Unsupported Field Type: ".concat(r.type));var a=Y[r.type];try{a.schema.validateSync(r,{stripUnknown:!1})}catch(o){throw Error('Add field: Model is invalid for field "'.concat(r.type,'".'))}var s=z.L$.fromSM(r),c=(0,u.xS)({customType:d,newField:s,newFieldId:n,sectionId:l});f(c),D.Xe.track({event:"field:added",id:n,name:t,type:s.type,isInAGroup:!1,contentType:(0,ee.T)(window.location.pathname)})}},j=function(e){if(!(0,$.uS)(e)){var n=e.source,t=e.destination;if(t){var i=(0,u.gR)({customType:d,sourceIndex:n.index,destinationIndex:t.index,sectionId:l});(0,q.flushSync)(function(){return f(i)})}}},g=function(e){var n=e.apiId,t=e.newKey,i=e.value;if(!(0,$.Ss)(Y,i.type)){var r=z.L$.fromSM(i),a=(0,u.L4)({customType:d,previousFieldId:n,newFieldId:t,newField:r,sectionId:l});f(a)}},C=function(){var e=(0,u.Tr)(d,l);f(e)},_=function(){var e=(0,u.E3)(d,l);f(e)},S=function(e){var n=(0,u.EN)({customType:d,sectionId:l,sliceId:e});f(n)};return(0,i.jsx)(Q.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(r.xu,{padding:32,children:(0,i.jsx)(r._3,{})}),children:(0,i.jsxs)(W.aV,{style:{flexGrow:1},children:[void 0===x.newPageType?(0,i.jsx)(et.Z,{zoneType:"customType",tabId:l,title:"Static Zone",dataTip:"",fields:v,poolOfFieldsToCheck:p,showHints:!0,EditModal:en.Z,widgetsArray:G,onDeleteItem:y,onSave:g,onSaveNewField:b,onDragEnd:j,renderHintBase:function(e){var n=e.item;return"data".concat((0,J.Ti)(n.key))},renderFieldAccessor:function(e){return"data".concat((0,J.Ti)(e))},testId:"static-zone-content",isRepeatableCustomType:d.repeatable}):void 0,(0,i.jsx)(eX,{customType:m,tabId:l,sliceZone:h,onRemoveSharedSlice:S,onCreateSliceZone:C,onDeleteSliceZone:_})]})})})},eW=function(){var e,n,t,a=E(),l=a.customType,c=a.setCustomType,d=z.Dc.toSM(l),f=(0,s.useState)(null===(e=d.tabs[0])||void 0===e?void 0:e.key),m=f[0],h=f[1],v=(0,s.useState)(),x=v[0],p=v[1],y=(0,o.useRouter)().query,b=(null===(n=d.tabs.find(function(e){return e.key===m}))||void 0===n?void 0:null===(t=n.sliceZone)||void 0===t?void 0:t.value.length)===0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(g,{style:b?{flexGrow:1}:void 0,children:["page"===l.format?(0,i.jsx)(C,{}):void 0,"true"===y.newPageType?(0,i.jsx)(eq,{tabId:d.tabs[0].key}):(0,i.jsxs)(_,{onValueChange:h,value:m,children:[(0,i.jsx)(S,{onAddNewTab:function(){p({type:"CREATE_CUSTOM_TYPE_TAB"})},children:d.tabs.map(function(e){return(0,i.jsx)(I,{menu:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Xi,{onSelect:function(){p({type:"UPDATE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"edit"}),children:"Rename"}),(0,i.jsx)(r.Xi,{color:"tomato",disabled:d.tabs.length<=1,onSelect:function(){p({type:"DELETE_CUSTOM_TYPE_TAB",tabKey:e.key})},startIcon:(0,i.jsx)(r.I5,{name:"delete"}),children:"Remove"})]}),value:e.key,children:e.key},e.key)})}),d.tabs.map(function(e){return(0,i.jsx)(k,{value:e.key,children:(0,i.jsx)(eq,{tabId:e.key})},e.key)})]})]}),(null==x?void 0:x.type)==="CREATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(O,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(e){var n=e.id;c((0,u.vB)(l,n)),h(n)},tabIds:d.tabs.map(function(e){return e.key.toLowerCase()})}):void 0,(null==x?void 0:x.type)==="UPDATE_CUSTOM_TYPE_TAB"?(0,i.jsx)(U,{close:function(){p(void 0)},initialTabKey:x.tabKey,isOpen:!0,onSubmit:function(e){var n=e.id;c((0,u.HO)(l,x.tabKey,n)),m===x.tabKey&&h(n)},tabIds:d.tabs.filter(function(e){return e.key!==x.tabKey}).map(function(e){return e.key.toLowerCase()})}):void 0,(null==x?void 0:x.type)==="DELETE_CUSTOM_TYPE_TAB"?(0,i.jsx)(K,{close:function(){p(void 0)},isOpen:!0,onSubmit:function(){if(c((0,u.F$)(l,x.tabKey)),m===x.tabKey){var e,n=null===(e=d.tabs.find(function(e){return e.key!==x.tabKey}))||void 0===e?void 0:e.key;void 0!==n&&h(n)}}}):void 0]})},eQ=t(52312),eY=t(28849),eG=t(54845),e$=t(13230),eJ=t.n(e$),e0=function(e){var n=e.tabs,t=(0,p.Z)(e,["tabs"]);return(0,i.jsxs)(b.fC,(0,x.Z)((0,v.Z)({},t),{className:eJ().root,defaultValue:n[0].label,orientation:"vertical",children:[(0,i.jsx)(b.aV,{className:eJ().list,"aria-label":"content tabs",children:n.map(function(e,n){var t=e.label;return(0,i.jsx)(b.xz,{className:eJ().trigger,value:t,children:(0,i.jsx)(r.xv,{className:eJ().triggerText,component:"span",color:"inherit",children:t})},"".concat(t,"-trig").concat(n+1))})}),n.map(function(e,n){var t=e.label,a=e.content;return(0,i.jsx)(b.VY,{className:eJ().content,value:t,children:(0,i.jsx)(r.xr,{className:eJ().scrollArea,children:a})},"".concat(t,"-content").concat(n+1))})]}))},e1=t(82205),e2=t(88241),e7=t(8857),e4=t(72757),e8=t(49109),e9=t(25145),e6=function(){return(0,i.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.1707 19.1237C17.9629 19.3056 17.9419 19.6214 18.1237 19.8293C18.3056 20.0371 18.6214 20.0581 18.8293 19.8763L22.8293 16.3763C22.9378 16.2814 23 16.1442 23 16C23 15.8558 22.9378 15.7187 22.8293 15.6237L18.8293 12.1237C18.6214 11.9419 18.3056 11.9629 18.1237 12.1708C17.9419 12.3786 17.9629 12.6945 18.1707 12.8763L21.7407 16L18.1707 19.1237ZM13.8293 12.8763C14.0371 12.6945 14.0581 12.3786 13.8763 12.1708C13.6944 11.9629 13.3786 11.9419 13.1707 12.1237L9.17075 15.6237C9.06224 15.7187 9 15.8558 9 16C9 16.1442 9.06224 16.2814 9.17075 16.3763L13.1707 19.8763C13.3786 20.0581 13.6944 20.0371 13.8763 19.8293C14.0581 19.6214 14.0371 19.3056 13.8293 19.1237L10.2593 16L13.8293 12.8763Z",fill:"#6F6E77"})})},e3=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{d:"M21.2388 10H10.7623C10.3415 10 10 10.3415 10 10.7623V21.2377C10 21.6585 10.3415 22 10.7623 22H21.2377C21.6585 22 22 21.6585 22 21.2388V10.7623C22 10.3415 21.6585 10 21.2388 10ZM16.5714 19.1953C16.5714 20.3371 15.9018 20.8571 14.9241 20.8571C14.0402 20.8571 13.4029 20.2645 13.1429 19.7143L14.0413 19.1708C14.2143 19.4777 14.4777 19.7143 14.8571 19.7143C15.2199 19.7143 15.4286 19.5725 15.4286 19.0212V15.4286H16.5714V19.1953ZM19.0502 20.8571C18.0379 20.8571 17.4632 20.3471 17.1429 19.7143L18 19.1429C18.2333 19.5246 18.4877 19.8895 19.0257 19.8895C19.4777 19.8895 19.7143 19.6641 19.7143 19.3516C19.7143 18.9788 19.4688 18.846 18.9721 18.6283L18.6998 18.5112C17.9129 18.1763 17.3895 17.7567 17.3895 16.8683C17.3895 16.0513 18.0134 15.4286 18.9866 15.4286C19.6797 15.4286 20.1775 15.6696 20.5368 16.3013L19.6886 16.8471C19.5011 16.5112 19.3002 16.3795 18.9866 16.3795C18.6674 16.3795 18.4654 16.5826 18.4654 16.8471C18.4654 17.1741 18.6674 17.3058 19.135 17.5089L19.4074 17.6261C20.3348 18.0223 20.8571 18.4275 20.8571 19.3382C20.8571 20.3192 20.0859 20.8571 19.0502 20.8571Z",fill:"#6F6E77"})})},e5=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,children:(0,i.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,i.jsx)("path",{d:"M0 0h32v32H0z"}),(0,i.jsx)("path",{fill:"#6F6E77",fillRule:"nonzero",d:"M15.45 10.534c1.592-1.013 3.794-.542 4.908 1.054.533.747.742 1.679.585 2.584a3.2 3.2 0 0 1-.48 1.197c.35.664.466 1.427.333 2.167a3.205 3.205 0 0 1-1.449 2.148l-2.795 1.782c-1.593 1.013-3.792.542-4.908-1.054a3.413 3.413 0 0 1-.585-2.584c.075-.425.24-.834.48-1.197a3.374 3.374 0 0 1-.334-2.167 3.205 3.205 0 0 1 1.449-2.148Zm3.756 1.785a2.224 2.224 0 0 0-2.383-.883 2.053 2.053 0 0 0-.57.249l-2.794 1.782c-.46.29-.778.759-.873 1.292a2.06 2.06 0 0 0 .352 1.555 2.224 2.224 0 0 0 2.384.883c.203-.054.393-.138.569-.249l1.064-.68a.567.567 0 0 1 .171-.076.67.67 0 0 1 .718.266.613.613 0 0 1 .106.468.582.582 0 0 1-.263.39L14.89 19.1a.567.567 0 0 1-.17.076.67.67 0 0 1-.718-.266.612.612 0 0 1-.114-.414l.011-.103-.103-.033a3.608 3.608 0 0 1-1.094-.547l-.144-.106-.051.16c-.03.084-.052.17-.068.26a2.06 2.06 0 0 0 .352 1.555 2.224 2.224 0 0 0 2.384.883c.2-.054.393-.138.569-.249l2.795-1.782c.46-.29.777-.759.872-1.292a2.06 2.06 0 0 0-.352-1.555 2.224 2.224 0 0 0-2.384-.883 2.053 2.053 0 0 0-.568.249l-1.065.68a.567.567 0 0 1-.17.076.67.67 0 0 1-.718-.266.613.613 0 0 1-.106-.468.582.582 0 0 1 .263-.39l2.795-1.783a.567.567 0 0 1 .17-.076.67.67 0 0 1 .719.266c.086.119.127.268.113.414l-.01.103.102.033c.393.119.764.303 1.095.547l.143.106.052-.16c.03-.084.051-.17.068-.26a2.06 2.06 0 0 0-.353-1.555Z"})]})})},ne=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.1719 10H20.8281C21.4753 10 22 10.5247 22 11.1719V20.8281C22 21.4753 21.4753 22 20.8281 22H11.1719C10.5247 22 10 21.4753 10 20.8281V11.1719C10 10.5247 10.5247 10 11.1719 10ZM17.4283 20.7223V19.549C17.641 19.7275 17.8721 19.8613 18.1215 19.9505C18.371 20.0397 18.6228 20.0843 18.8771 20.0843C19.0263 20.0843 19.1565 20.0709 19.2678 20.044C19.3791 20.0171 19.472 19.9798 19.5466 19.9322C19.6211 19.8845 19.6768 19.8283 19.7135 19.7635C19.7501 19.6987 19.7685 19.6285 19.7685 19.5527C19.7685 19.45 19.7391 19.3583 19.6805 19.2777C19.6217 19.197 19.5417 19.1225 19.4402 19.054C19.3387 18.9856 19.2183 18.9196 19.0789 18.856C18.9395 18.7925 18.7891 18.7277 18.6277 18.6617C18.2169 18.4906 17.9106 18.2816 17.7089 18.0347C17.5071 17.7878 17.4062 17.4896 17.4062 17.1401C17.4062 16.8663 17.4613 16.631 17.5713 16.4343C17.6814 16.2375 17.8311 16.0756 18.0206 15.9484C18.2102 15.8213 18.4296 15.7278 18.6791 15.668C18.9285 15.6081 19.1926 15.5781 19.4714 15.5781C19.7452 15.5781 19.988 15.5946 20.1995 15.6276C20.411 15.6606 20.606 15.7113 20.7845 15.7798V16.8761C20.6965 16.815 20.6005 16.7612 20.4966 16.7148C20.3927 16.6683 20.2857 16.6298 20.1756 16.5992C20.0656 16.5687 19.9562 16.5461 19.8473 16.5314C19.7385 16.5168 19.6352 16.5094 19.5374 16.5094C19.4029 16.5094 19.2806 16.5223 19.1706 16.5479C19.0605 16.5736 18.9676 16.6097 18.8918 16.6561C18.816 16.7025 18.7573 16.7581 18.7157 16.8229C18.6742 16.8877 18.6534 16.9604 18.6534 17.0411C18.6534 17.1291 18.6766 17.2079 18.7231 17.2776C18.7695 17.3472 18.8356 17.4132 18.9212 17.4756C19.0068 17.5379 19.1107 17.599 19.2329 17.6589C19.3552 17.7188 19.4934 17.7805 19.6474 17.8441C19.8577 17.932 20.0466 18.0255 20.2142 18.1245C20.3817 18.2235 20.5253 18.3354 20.6451 18.46C20.765 18.5847 20.8567 18.7271 20.9203 18.8872C20.9838 19.0473 21.0156 19.2337 21.0156 19.4463C21.0156 19.7397 20.96 19.9859 20.8487 20.1851C20.7375 20.3844 20.5865 20.5457 20.3957 20.6691C20.205 20.7926 19.9831 20.8812 19.73 20.935C19.4769 20.9887 19.2097 21.0156 18.9285 21.0156C18.6399 21.0156 18.3655 20.9912 18.105 20.9423C17.8446 20.8934 17.619 20.8201 17.4283 20.7223ZM16.9609 16.6582H15.4558V20.9453H14.2634V16.6582H12.7656V15.6953H16.9609V16.6582Z",fill:"#6F6E77"})})},nn=function(){return(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,i.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.031 11L15.7584 17.8336L16.0831 18.4288L16.4077 17.8336L20.1352 11H22L16.0831 21.4347L10 11H12.031ZM19.2924 11.0006L16.0831 16.8843L12.8737 11.0005L14.2612 11.0001L14.727 11L15.2777 11.9497L16.1319 13.4226L16.9886 11.9512L17.542 11.0006H17.9881H19.2924Z",fill:"#6F6E77"})})},nt=t(69537),ni=t.n(nt);e7.Z.registerLanguage("tsx",e8.Z),e7.Z.registerLanguage("markup",e4.Z),e7.Z.alias("markup","vue"),e7.Z.alias("markup","svelte");var nr=function(e){var n,t=(null!==(n=e.fileName.match(/\.([^\.]*)$/))&&void 0!==n?n:[])[1];return function(){switch(t){case"ts":case"tsx":return(0,i.jsx)(ne,{});case"js":case"jsx":return(0,i.jsx)(e3,{});case"vue":return(0,i.jsx)(nn,{});case"svelte":return(0,i.jsx)(e5,{});default:return(0,i.jsx)(e6,{})}}()},na=function(e){var n=e.code,t=e.onCopy,a=(0,s.useState)(!1),l=a[0],o=a[1];(0,s.useEffect)(function(){if(l){var e=setTimeout(function(){o(!1)},1200);return function(){clearTimeout(e)}}},[l]);var c=function(){navigator.clipboard.writeText(n).then(function(){o(!0),void 0!==t&&t()})};return(0,i.jsx)(r.hU,{size:"small",onClick:c,icon:l?"check":"contentCopy",hiddenLabel:l?"Code successfully copied":"Copy code"})},nl=function(e){var n=e.fileInfo,t=e.className,a=e.copy,l=e.code,o=e.onCopy,s=/language-(\w+)/.exec(null!=t?t:"");return(0,i.jsxs)("div",{className:ni().root,children:[(0,i.jsxs)("div",{className:ni().header,children:[void 0!==n?(0,i.jsxs)("div",{className:ni().fileInfo,children:[(0,i.jsx)(nr,{fileName:n.fileName}),(0,i.jsx)(r.xv,{className:ni().fileName,color:"grey11",children:n.fileName})]}):(0,i.jsx)("span",{}),!0===a?(0,i.jsx)(na,{onCopy:o,code:String(l)}):null]}),null!==s&&s[1]?(0,i.jsx)(e7.Z,{showLineNumbers:!0,customStyle:{margin:0,border:"none",fontSize:"12px",lineHeight:"18px",borderRadius:"none",backgroundColor:"#FFF",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"},children:String(l).replace(/\n$/,""),style:e9.MS,language:s[1],PreTag:"div"}):l]})},no=t(36065),ns="_1ecs97dfxo",nc=function(e){var n=(0,no.p)();if(!0===e.inline)return(0,i.jsx)("code",(0,x.Z)((0,v.Z)({},e),{className:"_1ecs97dfkp _1ecs97d18 _1ecs97d8l _1ecs97dfh9 _1ecs97dfwm _1ecs97dfxz"}));var t=function(){var n,t;if((null===(n=e.node)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.meta)!==void 0){var i,r,a,l=null===(i=e.node)||void 0===i?void 0:null===(r=i.data)||void 0===r?void 0:r.meta;return{fileName:l.substring(1,l.length-1),language:null===(a=e.className)||void 0===a?void 0:a.split("-")[1]}}return null}(),r=function(){D.Xe.track({event:"page-type:copy-snippet",framework:n})};return(0,i.jsx)(nl,(0,v.Z)((0,x.Z)((0,v.Z)({copy:!0},e),{onCopy:r,code:e.children}),null!==t?{fileInfo:t}:{}))},nd=function(e){var n=e.markdown;return(0,i.jsx)(e1.D,{children:n,linkTarget:"_blank",remarkPlugins:[e2.Z],components:{code:function(e){return(0,i.jsx)(nc,(0,v.Z)({},e))},h1:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h1",variant:"h1"})},h2:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h2",variant:"h2"})},h3:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h3",variant:"h3"})},h4:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},h5:function(e){return(0,i.jsx)(r.xv,{children:e.children,component:"h4",variant:"h4"})},p:function(e){return(0,i.jsx)(r.xv,{className:ns,children:e.children,component:"p",variant:"normal"})},pre:function(e){return(0,i.jsx)(r.xv,{className:ns,children:e.children,component:"pre",variant:"normal"})}}})};function nu(e){return nf.apply(this,arguments)}function nf(){return(nf=(0,w.Z)(function(e){var n,t,i,r;return(0,Z.__generator)(this,function(a){switch(a.label){case 0:return n=JSON.parse(e),[4,eu.j.documentation.read({kind:n.kind,data:n.data})];case 1:if(i=(t=a.sent()).errors,r=t.documentation,i.length>0)throw i;return[2,r]}})})).apply(this,arguments)}t(75317);var nm=function(e){var n,t=e.model,a=(0,no.p)(),l=(0,ed.QT)(nu,[JSON.stringify({kind:"PageSnippet",data:{model:t}})]);if(0===l.length)return null;var o=function(){D.Xe.track({event:"page-type:open-snippet",framework:a})};return(0,i.jsxs)(r.Vq,{size:"small",trigger:(0,i.jsx)(r.zx,{color:"grey",onClick:o,startIcon:"code",children:"Page snippet"}),children:[(0,i.jsx)(r.fK,{icon:"code",title:"Page snippet"}),(0,i.jsx)("section",{className:"_3uvawd0 _1ecs97dffk _1ecs97dfft _1ecs97dfnw _1ecs97dfpn",children:l.length>1?(0,i.jsx)(e0,{style:{flex:1},tabs:l.map(function(e,n){var t=e.label,r=e.content;return{label:null!=t?t:"Tab ".concat(n+1),content:(0,i.jsx)(nd,{markdown:r})}})}):(0,i.jsx)(r.xr,{style:{flex:1,padding:16},children:(0,i.jsx)(nd,{markdown:l[0].content})})})]})},nh=function(e){var n=e.model;return(0,i.jsx)("div",{children:(0,i.jsx)(Q.S,{children:(0,i.jsx)(s.Suspense,{fallback:(0,i.jsx)(r.zx,{color:"grey",startIcon:"code",children:"Page snippet"}),children:(0,i.jsx)(nm,{model:n})})})})},nv=function(){var e=(0,o.useRouter)(),n=(0,c.v9)(function(n){return{selectedCustomType:(0,eY.Jk)(n,(0,m.Ag)(e.query))}}).selectedCustomType;return((0,s.useEffect)(function(){n&&(0,eQ.TG)(n)||e.replace("/")},[n,e]),n&&(0,eQ.TG)(n))?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l(),{children:(0,i.jsxs)("title",{children:[n.local.label," - Slice Machine"]})}),(0,i.jsx)(nx,{customType:n.local})]}):(0,i.jsx)(h.LN,{})},nx=function(e){var n=e.customType;return null===n?(0,i.jsx)(h.LN,{}):(0,i.jsx)(h.LN,{children:(0,i.jsx)(A,{initialCustomType:z.Dc.fromSM(n),children:function(e){var t,a=e.actionQueueStatus,l=e.customType,o=e.setCustomType,s=(0,u.y6)(l),c=m.cd[n.format],v=M.$[n.format];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(h.wd,{children:[(0,i.jsx)(h.Xq,{url:c.tablePagePathname}),(0,i.jsxs)(h.Cx,{children:[(0,i.jsx)(d.g,{children:v.name({start:!0,plural:!0})}),(0,i.jsx)(d.g,{active:!0,children:null!==(t=l.label)&&void 0!==t?t:l.id})]}),(0,i.jsxs)(h.K2,{children:[(0,i.jsx)(f.X,{status:a}),"page"===l.format?(0,i.jsx)(nh,{model:l}):void 0,(0,i.jsx)(eG._,{isChangesLocal:!0,format:s,customType:l,setLocalCustomType:o})]})]}),(0,i.jsx)(h.RN,{children:(0,i.jsx)(r.xu,{flexDirection:"column",minWidth:0,children:(0,i.jsx)(eW,{})})})]})}})})}},63269:function(e,n,t){"use strict";t.d(n,{E:function(){return c}});var i=t(22710),r=t(62230),a=t(85244),l=t(17064),o=t(99267),s=t(19334);function c(e){var n,t,c,d=(0,l.Z)((0,s.f)(),2),u=d[0],f=d[1],m=(c=(0,i.Z)(function(n){var t;return(0,o.__generator)(this,function(i){switch(i.label){case 0:return t=(0,a.Z)((0,r.Z)({},u),{labs:(0,r.Z)({},u.labs)}),n?t.labs[e]=n:e in t.labs&&delete t.labs[e],0===Object.keys(t.labs).length&&delete t.labs,[4,f(t)];case 1:return i.sent(),[2]}})}),function(e){return c.apply(this,arguments)});return[{enabled:null!==(t=null==u?void 0:null===(n=u.labs)||void 0===n?void 0:n[e])&&void 0!==t&&t},m]}},19334:function(e,n,t){"use strict";t.d(n,{f:function(){return o}});var i=t(22710),r=t(99267),a=t(18566),l=t(81038);function o(){var e,n=(0,a.QT)(s,[]),t=(e=(0,i.Z)(function(e){return(0,r.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,a.VA)(s,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function s(){return c.apply(this,arguments)}function c(){return(c=(0,i.Z)(function(){return(0,r.__generator)(this,function(e){return[2,l.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},56054:function(e,n,t){"use strict";t.d(n,{c:function(){return C}});var i=t(22710),r=t(62230),a=t(85244),l=t(99267),o=t(52322),s=t(2784),c=t(36131),d=t(75289),u=t(82770),f=t(88932),m=t(5479),h=t(17384),v=t(81038);function x(){return(x=(0,i.Z)(function(e){var n,t,i,r,a,o,s;return(0,l.__generator)(this,function(l){switch(l.label){case 0:n=e.sliceName,t=e.libraryName,i=e.onSuccess,l.label=1;case 1:return l.trys.push([1,4,,5]),r=(0,m.fo)(n),[4,v.j.slices.createSlice({libraryID:t,model:r})];case 2:if((a=l.sent().errors).length>0)throw a;return u.Xe.track({event:"slice:created",id:(0,h.MP)(n),name:n,library:t}),[4,i(r)];case 3:return l.sent(),[3,5];case 4:return o=l.sent(),s="An unexpected error happened while creating slice ".concat(n,"."),console.error(s,o),f.Am.error(s),[3,5];case 5:return[2]}})})).apply(this,arguments)}var p=t(50950),y=t(6134),b=t(90374),j=t(36960),g=t(98235),C=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,h=e.remoteSlices,v=(0,b.Z)().createSliceSuccess,C=(0,s.useState)(!1),_=C[0],S=C[1],I=(0,p.g)().syncChanges,k=(n=(0,i.Z)(function(e){var n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:var a;return n=e.sliceName,t=e.from,S(!0),[4,function(e){return x.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(a=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,u.y0)()];case 1:return v(n.sent().libraries),f(e,t),I(),[2]}})}),function(e){return a.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,o.jsx)(y.Z,{testId:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:_,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){k(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,g.h)(e,m,h)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,o.jsxs)(d.xu,{children:[(0,o.jsx)(j.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,testId:"slice-name-input"}),(0,o.jsx)(d.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,o.jsx)(c.ZP,{name:"from",options:m.map(function(e){return{value:e.name,label:e.name}}),onChange:function(e){return e?void i("from",e.value):null},defaultValue:{value:t.from,label:t.from},styles:{option:function(e){return(0,a.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,a.Z)((0,r.Z)({},e),{colors:(0,a.Z)((0,r.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},98235:function(e,n,t){"use strict";t.d(n,{h:function(){return c}});var i=t(81541),r=t(96009),a=t.n(r),l=t(74600),o=t.n(l),s=t(63094);function c(e,n,t){var r=e.sliceName;if(!r)return{sliceName:"Cannot be empty"};if(!s.xo.exec(r))return{sliceName:"No special characters allowed"};if(o()(a()(r)).replace(/\s/gm,"")!==r.trim())return{sliceName:"Value has to be PascalCased"};if(r.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(s.lS.includes(r))return{sliceName:"".concat(r," is reserved for Slice Machine use")};var l=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),c=t.map(function(e){return e.name});if((0,i.Z)(l).concat((0,i.Z)(c)).includes(r))return{sliceName:"Slice name is already taken."}}},53420:function(e,n,t){"use strict";var i=t(62230),r=t(52322),a=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,l=e.defineElementKey,o=e.gridTemplateMinPx,s=e.gridGap,c=e.sx;return(0,r.jsx)(a.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===o?"320px":o,", 1fr))"),gridGap:void 0===s?"16px":s,pt:2},c),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(l(e),"-").concat(n+1)):null})})}},75317:function(){},69537:function(e){e.exports={block:"CodeBlock_block__ljak4",blockWithDisplayRevert:"CodeBlock_blockWithDisplayRevert__zM3Ns CodeBlock_block__ljak4",root:"CodeBlock_root__3ZYFL CodeBlock_blockWithDisplayRevert__zM3Ns CodeBlock_block__ljak4",header:"CodeBlock_header__kLT1f CodeBlock_block__ljak4",fileInfo:"CodeBlock_fileInfo__ocLpL CodeBlock_block__ljak4",fileName:"CodeBlock_fileName__jmuEV CodeBlock_blockWithDisplayRevert__zM3Ns CodeBlock_block__ljak4"}},13230:function(e){e.exports={flex:"ContentTabs_flex__kAimf",column:"ContentTabs_column__x5QZL ContentTabs_flex__kAimf",root:"ContentTabs_root__GPtve ContentTabs_column__x5QZL ContentTabs_flex__kAimf",list:"ContentTabs_list__XarTi ContentTabs_flex__kAimf",trigger:"ContentTabs_trigger__8hs6H ContentTabs_column__x5QZL ContentTabs_flex__kAimf",triggerText:"ContentTabs_triggerText__ka3DD",content:"ContentTabs_content__mMr1s ContentTabs_column__x5QZL ContentTabs_flex__kAimf",scrollArea:"ContentTabs_scrollArea__ZBVHa"}},86251:function(e){e.exports={scrollArea:"ConvertLegacySliceButton_scrollArea__gW7L4",label:"ConvertLegacySliceButton_label__yP2Pt"}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[96],{28173:function(e,n,t){"use strict";t.d(n,{aV:function(){return s},Bu:function(){return c}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715);t(45158),t(23425);var s=function(e){return(0,l.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_2a96i71 _1ecs97dffi _1ecs97dffk _1ecs97d3j4 _1ecs97d3qh _1ecs97dfh9 _1ecs97dfil _1ecs97dfiz _1ecs97dfft _1ecs97dfg9"}))},c=function(e){var n=e.actions,t=e.children,s=e.toggle,c=(0,o.Z)(e,["actions","children","toggle"]);return(0,l.jsxs)("div",(0,r.Z)((0,i.Z)({},c),{className:"_2a96i73 _2a96i72 _1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dffq _1ecs97d6yk _1ecs97d75x _1ecs97dfj3 _1ecs97dffj _1ecs97dfnk _1ecs97dfyx _1ecs97d18 _1ecs97d8l _1ecs97dfir _1ecs97dfpl _1ecs97dfyk",children:[(0,l.jsx)(a.xv,{color:"grey11",component:"span",noWrap:!0,variant:"bold",children:t}),s,Boolean(n)?(0,l.jsx)("div",{className:"_1ecs97dffi _1ecs97dffk _1ecs97dffu _1ecs97dffq _1ecs97dffv _1ecs97dfpl _1ecs97dfg1 _1ecs97dflk",children:n}):null]}))}},47976:function(e,n,t){"use strict";t.d(n,{X:function(){return o}});var i=t(52322),r=t(22715),o=function(e){var n,t=e.status;switch(t){case"pending":n={icon:(0,i.jsx)(r._3,{color:"grey11"}),text:"Saving..."};break;case"failed":n={icon:(0,i.jsx)(r.I5,{name:"close",color:"tomato11",size:"medium"}),text:"Failed to save"};break;case"done":n={icon:(0,i.jsx)(r.I5,{name:"check",color:"green11",size:"medium"}),text:"Auto-saved"}}return(0,i.jsxs)(r.xu,{gap:8,alignItems:"center",children:[n.icon,(0,i.jsx)(r.xv,{color:"grey11",children:n.text})]})}},57899:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var i=t(62230),r=t(52322),o=t(61183);t(2784);var l=t(59326),a=t(75289),s=function(e){return{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},]},]}};o.Z.registerLanguage("svelte",s);var c=["javascript","bash","xml","html","json"],d=function(e){var n,t=e.children,s=e.lang,d=e.sx,u=e.codeStyle,f=e.codeClass,p=e.Header,x=(0,l.B7)().theme,m=s?o.Z.highlight(t,{language:"vue"===s?"html":s}).value:o.Z.highlightAuto(t,c).value;return(0,r.jsxs)(a.kC,{as:"pre",sx:d,children:[p?(0,r.jsx)(p,{}):null,(0,r.jsx)("code",{className:"hljs".concat(f?" ".concat(f):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=x.colors)||void 0===n?void 0:n.textClear)},u),dangerouslySetInnerHTML:{__html:m}})]})}},74757:function(e,n,t){"use strict";t.d(n,{J:function(){return c},k:function(){return s}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322);t(2784);var a=t(75289),s=function(e){var n=e.children,t=e.sx,s=(0,o.Z)(e,["children","sx"]);return(0,l.jsx)(a.xu,(0,r.Z)((0,i.Z)({sx:(0,i.Z)({display:["block","block","flex"],flexWrap:"wrap",justifyContent:"space-between"},t)},s),{children:n}))},c=function(e){var n=e.children,t=e.cols;return(0,l.jsx)(a.xu,{sx:{flex:"0 ".concat(100/(void 0===t?2:t)-1,"%"),mb:1},children:n})}},46577:function(e,n,t){"use strict";t.d(n,{$w:function(){return i},Hq:function(){return u},tM:function(){return d}});var i,r=t(62230),o=t(85244),l=t(52322),a=t(63397);t(2784);var s,c=t(75289);(s=i||(i={}))[s.ERROR=0]="ERROR",s[s.DISABLED=1]="DISABLED",s[s.WARNING=2]="WARNING";var d=function(e){var n={"&::placeholder":{color:"#C9D0D8"}};switch(e){case i.DISABLED:return(0,o.Z)((0,r.Z)({},n),{border:"1px solid #E6E6EA",backgroundColor:"#F3F5F7"});case i.ERROR:return(0,o.Z)((0,r.Z)({},n),{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 i.WARNING:return(0,o.Z)((0,r.Z)({},n),{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 n}},u=function(e){var n=e.sx,t=e.field,s=e.meta,u=e.formField,f=e.fieldName,p=e.fields,x=e.initialValues,m=e.isDisabled,h=s.error?i.ERROR:m||u.disabled?i.DISABLED:void 0;return(0,l.jsxs)(c.xu,{sx:void 0===n?{}:n,children:[(0,l.jsxs)(c.__,{variant:"label.primary",htmlFor:f,children:[u.label||f,s.touched&&s.error?(0,l.jsx)(c.xv,{as:"span",variant:"text.labelError",children:s.error}):null]}),(0,l.jsx)(a.gN,(0,o.Z)((0,r.Z)({id:f,name:f,type:"text",placeholder:u.placeholder||u.label||f},u.fieldLevelValidation&&x?{validate:function(e){return u.fieldLevelValidation&&u.fieldLevelValidation({value:e,fields:p,initialId:x.id})}}:null,t),{as:c.II,sx:d(h),disabled:m||u.disabled}))]})}},3402:function(e,n,t){"use strict";t.d(n,{kp:function(){return c},sP:function(){return u},w8:function(){return f},Hq:function(){return p.Hq}});var i=t(62230),r=t(85244),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=function(e){var n=e.field,t=e.meta,c=e.fieldName,d=e.label,u=e.focusOnNewEntry,f=void 0===u||u,p=e.inputPlaceholder,x=e.buttonLabel,m=(0,a.useState)(t.value.length),h=m[0],g=m[1],v=(0,a.useRef)(Array(t.value.length));return(0,a.useEffect)(function(){v.current=v.current.slice(0,t.value.length)},[t.value.length]),(0,a.useEffect)(function(){var e=v.current.length;f&&e>h&&v.current[e-1].focus(),g(e)},[v.current.length,f,h]),(0,o.jsxs)(a.Fragment,{children:[(0,o.jsxs)(s.__,{variant:"label.primary",htmlFor:c,children:[d,t.touched&&t.error?(0,o.jsx)(s.xv,{as:"span",variant:"text.labelError",children:t.error}):null]}),(0,o.jsx)(l.F2,(0,r.Z)((0,i.Z)({name:c,id:c},n),{render:function(e){return(0,o.jsxs)("div",{children:[n.value&&n.value.length>0?n.value.map(function(n,t){return(0,o.jsxs)(s.kC,{my:2,children:[(0,o.jsx)(s.II,{placeholder:p,name:"".concat(c,".").concat(t),value:n,ref:function(e){return v.current[t]=e},onChange:function(n){var i=n.target.value;return e.replace(t,i)}}),(0,o.jsx)(s.zx,{ml:2,type:"button",variant:"secondary",onClick:function(){return e.remove(t)},children:"-"})]},"".concat(c,"-").concat(+t+1))}):null,(0,o.jsx)(s.zx,{type:"button",onClick:function(){return e.insert(n.value.length,"")},children:x})]})}}))]})},d=t(98240),u=function(e){e.initialValues;var n=e.meta,t=e.label,a=e.fieldName,c=e.onChange,u=(0,d.Z)(e,["initialValues","meta","label","fieldName","onChange"]);return(0,o.jsxs)(s.__,(0,r.Z)((0,i.Z)({variant:"label.border"},u),{children:[(0,o.jsx)(l.gN,{as:s.XZ,type:"checkbox",name:a,onChange:function(){return c(!n.value)},checked:n.value}),t]}))},f=function(e){var n=e.field,t=e.label,i=e.defaultValue,r=e.onChange,l=e.controlledValue,s=e.setControlledValue,c=e.buildControlledValue,d=(0,a.useState)(i||n.defaultValue||!1),f=d[0],p=d[1];return(0,a.useEffect)(function(){c?s(c(l,f)):s(c)},[f,l,c]),(0,o.jsx)(u,{meta:{value:f},fieldName:n.name,onChange:function(e){return p(e)&&r&&r(e)},label:"function"==typeof t?t(l,f):t})},p=t(46577)},12374:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),s=t(75289),c=(0,a.forwardRef)(function(e,n){var t=e.children,a=e.Component,c=void 0===a?s.kC:a,d=e.sx,u=(0,o.Z)(e,["children","Component","sx"]);return(0,l.jsx)(c,(0,r.Z)((0,i.Z)({as:"li",sx:(0,i.Z)({p:3,mx:3,alignItems:"center",variant:"styles.listItem"},void 0===d?{}:d),ref:n},u),{children:t}))});n.Z=c},97470:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var i=t(62230),r=t(85244),o=t(52322),l=t(5446),a=t(2784),s=t(40023),c=t(951),d=t(8799),u=t(18978),f=t(59326),p=t(75289),x=t(12374),m=t(89363),h=t(98240),g=t(33710),v=t(82119),b=function(e){var n=e.text,t=e.as,l=e.sx,s=(0,h.Z)(e,["text","as","sx"]),c=(0,a.useRef)(null),d=(0,a.useState)(null),u=d[0],f=d[1],x=function(){f(c.current&&c.current.offsetWidth<c.current.scrollWidth)};return(0,a.useEffect)(function(){return x(),window.addEventListener("resize",x),function(){window.removeEventListener("resize",x)}},[]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.xv,(0,r.Z)((0,i.Z)({"data-for":n,"data-tip":!0,sx:(0,i.Z)({flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},void 0===l?{}:l),as:t,ref:c},s),{children:n})),u&&(0,o.jsx)(v.X,{children:(0,o.jsx)(g.Z,{id:n,type:"dark",multiline:!0,border:!0,borderColor:"black",place:"bottom",effect:"solid",children:n})})]})},y=function(e){var n,t,i=e.text,r=e.sliceFieldName,l=e.theme,a=e.WidgetIcon;return(0,o.jsxs)(p.kC,{sx:{alignItems:"center",position:"relative"},children:[(0,o.jsx)(a,{size:28,style:{color:null===(n=l.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=l.colors)||void 0===t?void 0:t.primary}}),(0,o.jsx)(b,{text:i,as:"p",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},"data-testid":"field-name"}),(0,o.jsx)(p.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},"data-testid":"field-id",children:r})]})},j=function(e){var n=e.item,t=e.index,h=e.deleteItem,g=e.enterEditMode,v=e.modelFieldName,b=e.renderFieldAccessor,j=e.HintElement,Z=e.CustomEditElement,k=e.CustomEditElements,C=e.widget,I=e.draggableId,S=e.testId,E=e.isRepeatableCustomType,F=e.children,w=(0,f.B7)().theme,T=n.key,A=n.value,N=A.config,R=A.type;return(0,o.jsx)(a.Fragment,{children:(0,o.jsx)(s._l,{draggableId:I,index:t,children:function(e){var s,f,I,A,M;return(0,o.jsx)(a.Fragment,{children:(0,o.jsxs)(x.Z,(0,r.Z)((0,i.Z)({"data-testid":S,ref:e.innerRef},e.draggableProps),{Component:p.xu,sx:{p:0,mx:0,my:3},children:[(0,o.jsxs)(p.kC,{sx:{width:"100%"},children:[(0,o.jsx)(m.Z,(0,i.Z)({label:"Reorder slice field (drag and drop)",Icon:u.Fm7,color:null===(s=w.colors)||void 0===s?void 0:s.icons,mr:1,mt:3},e.dragHandleProps)),(0,o.jsxs)(p.xu,{sx:{bg:"headSection",width:"100%",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(String(null===(n=e.colors)||void 0===n?void 0:n.borders))}},children:[(0,o.jsxs)(p.kC,{sx:{p:3,alignItems:"center",justifyContent:"space-between",width:"100%"},children:[(0,o.jsx)(y,{theme:w,text:(null==N?void 0:N.label)||T,sliceFieldName:b&&b(T),WidgetIcon:C.Meta.icon}),(0,o.jsxs)(p.kC,{children:[k||null,Z||(0,o.jsx)(m.Z,{size:22,Icon:c.$iz,label:"Edit field",sx:{cursor:"pointer",color:null===(f=w.colors)||void 0===f?void 0:f.icons},onClick:function(){return g([T,n.value],v,t)}}),!(!0===E&&"UID"==R)&&(0,o.jsxs)(l.v2,{children:[(0,o.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,o.jsx)(d.FQA,{size:20,color:null===(I=w.colors)||void 0===I?void 0:I.icons,style:{pointerEvents:"none"}})}),(0,o.jsx)(l.qy,{style:{background:null===(A=w.colors)||void 0===A?void 0:A.gray,border:"1px solid",borderRadius:"3px",borderColor:null===(M=w.colors)||void 0===M?void 0:M.borders,outline:"0"},children:(0,o.jsx)(l.sN,{style:{padding:"6px",cursor:"pointer"},onSelect:function(){return h(T)},children:"Delete field"})})]})]})]}),j||null]})]}),F]}))})}})})}},89363:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(75289),s=function(e,n){return n?{border:function(e){var n=e.colors;return"1px solid ".concat(n.error)}}:e?{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)}}:{border:function(e){var n=e.colors;return"1px solid ".concat(n.borders)}}},c=function(e){var n=e.sx,t=e.onClick,c=e.label,d=e.Icon,u=e.error,f=e.size,p=void 0===f?16:f,x=e.fitButton,m=e.active,h=e.useActive,g=e.activeSx,v=(0,o.Z)(e,["sx","onClick","label","Icon","error","size","fitButton","active","useActive","activeSx"]);return(0,l.jsx)(a.hU,(0,r.Z)((0,i.Z)({onClick:void 0===t?function(){return null}:t,"aria-label":c,type:"button",sx:(0,i.Z)({},void 0!==x&&x?{width:p,height:p}:null,void 0!==h&&h&&(void 0===g?s:g)(void 0!==m&&m,void 0===u?null:u),void 0===n?null:n)},v),{children:(0,l.jsx)(d,{size:p})}))};n.Z=c},46784:function(e,n,t){"use strict";var i=t(62230),r=t(17064),o=t(52322),l=t(63397),a=t(2784),s=t(75289),c=t(3402),d=t(98079),u=function(e){var n=e.fieldName,t=e.formField,u=e.fields,f=e.initialValues,p=(0,r.Z)((0,l.U$)(n),3),x=p[0],m=p[1],h=p[2],g=t.component;return(0,o.jsx)(s.xu,{sx:(0,i.Z)({mt:2,alignItems:"center"},t.type===d.h.CHECKBOX?{display:"flex",height:"130%"}:null),children:g?(0,o.jsx)(g,{meta:m,field:x,helpers:h,fieldName:n,formField:t,initialValues:f}):(0,o.jsxs)(a.Fragment,{children:[t.type===d.h.INPUT?(0,o.jsx)(c.Hq,{meta:m,field:x,fields:u,formField:t,fieldName:n,initialValues:f}):null,t.type===d.h.CHECKBOX&&(0,o.jsx)(c.sP,{meta:m,label:t.label,fieldName:n,initialValues:f,onChange:function(e){return h.setValue(e)}})]})})};n.Z=u},73393:function(e,n,t){"use strict";t.d(n,{Z:function(){return B}});var i=t(62230),r=t(85244),o=t(17064),l=t(52322),a=t(37149),s=t.n(a),c=t(59326),d=t(75289),u=t(65413),f=t(2784),p=t(92928),x=t(98898),m=t(98240),h=function(e){var n=e.children,t=(0,m.Z)(e,["children"]);return(0,l.jsx)(d.xu,(0,r.Z)((0,i.Z)({as:"ul",sx:{p:0,m:0,px:function(e){return"calc(".concat(e.space[3],"px + 8px)")},borderBottom:"1px solid #DFE1E5",position:"relative"}},t),{children:n}))};h.tabsRole="TabList";var g=function(e){var n=e.children,t=(0,m.Z)(e,["children"]),o=(0,c.B7)().theme;return(0,l.jsx)(p.OK,(0,r.Z)((0,i.Z)({},t),{style:(0,i.Z)({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"},t.selected?{borderBottom:"3px solid ".concat(o.colors.primary),color:o.colors.text,fontWeight:"500",opacity:"1",backgroundColor:"transparent"}:{borderBottom:"3px solid transparent"}),children:n}))};g.tabsRole="Tab";var v=function(e){var n=e.children,t=e.Footer,r=e.Header,o=e.tabs,a=e.bodySx,s=e.footerSx,c=e.defaultIndex,u=void 0===c?0:c,m=(0,f.useState)(u),v=m[0],b=m[1];return(0,l.jsx)(x.Z,{borderFooter:!0,footerSx:(0,i.Z)({p:0},s),bodySx:(0,i.Z)({p:0},a),sx:{border:"none"},Header:r,Footer:t,children:(0,l.jsxs)(p.mQ,{defaultIndex:u,onSelect:function(e){return b(e)},children:[(0,l.jsx)(h,{children:(o||[]).map(function(e){return(0,l.jsx)(g,{children:e},e)})}),f.Children.map(n,function(e,n){return(0,l.jsx)(d.xu,{sx:{p:function(e){return"calc(".concat(e.space[3],"px + 8px)")},display:n===v?"block":"none"},children:(0,l.jsx)(p.x4,{children:e})})})]})})},b=(0,f.memo)(v),y=t(74757),j=function(e){var n,t,i=e.text,r=e.sliceFieldName,o=e.theme,a=e.WidgetIcon;return(0,l.jsxs)(d.kC,{sx:{alignItems:"center"},children:[(0,l.jsx)(a,{size:28,style:{color:null===(n=o.colors)||void 0===n?void 0:n.primary,marginRight:"8px",borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(t=o.colors)||void 0===t?void 0:t.primary}}),(0,l.jsx)(d.xv,{as:"p","data-testid":"item-header-text",sx:{py:0,px:1,fontWeight:"label",fontSize:"15px"},children:i}),(0,l.jsx)(d.xv,{as:"p",sx:{display:["none","none","initial"],fontSize:"14px",ml:1,color:"textClear"},children:r})]})},Z=t(83399),k=t(77495),C=t(5632),I=t(65186),S=t(63094),E=function(){var e=(0,C.useRouter)();return(0,l.jsxs)(d.xu,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"60px"},children:[(0,l.jsx)(I.wr$,{size:48,color:"#C9D0D8"}),(0,l.jsx)(d.xu,{sx:{height:"12px"}}),(0,l.jsx)(d.xv,{color:"text",sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",textAlign:"center"},children:"Your mock data has moved"}),(0,l.jsx)(d.xu,{sx:{height:"8px"}}),(0,l.jsx)(d.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,l.jsx)(d.xu,{sx:{height:"24px"}}),(0,l.jsx)(d.zx,{onClick:function(n){n.preventDefault(),window.open("".concat(e.asPath,"/simulator"),S.pq)},children:"Go to the Slice Simulator"})]})},F=t(52586),w=t(13302),T=t(8830),A=t(46784),N=t(67557),R=t(77033),M=t(63397),_=function(e){var n=e.formId,t=e.initialValues,a=e.validationSchema,s=e.onSave,c=e.FormFields,u=e.children;return(0,l.jsx)(d.xu,{children:(0,l.jsx)(M.J9,{initialValues:t,validationSchema:a,onSubmit:function(e,n){var t;s({newKey:e.id,value:Object.entries((0,m.Z)(e,["id"])).reduce(function(e,n){var t=(0,o.Z)(n,2),l=t[0],a=t[1];if((void 0===a?"undefined":(0,R.Z)(a))!==Boolean&&!a){var s,d=null===(s=c[l])||void 0===s?void 0:s.defaultValue;if(void 0!==d)return(0,r.Z)((0,i.Z)({},e),(0,N.Z)({},l,d))}return(0,r.Z)((0,i.Z)({},e),(0,N.Z)({},l,a))},{})})},children:function(e){return(0,l.jsx)(M.l0,{id:n,children:u((0,r.Z)((0,i.Z)({},e),{initialValues:t}))})}})})},q=(0,f.memo)(_);s().setAppElement("#__next");var B=function(e){var n=e.close,t=e.data,a=e.fields,s=e.onSave,f=e.zoneType,p=(0,c.B7)().theme;if(!t.isOpen)return null;var x=(0,o.Z)(t.field,2),m=x[0],h=x[1],g=(0,T.t)(F,h.config,h.type);if(!g)return(0,l.jsxs)("div",{children:[h.type," not found"]});var v=g.Meta.icon,C=g.FormFields,I=g.Form,S=g.schema,N=(0,i.Z)({},(0,k.f7)((0,w.B9)(C,"id")),g.prepareInitialValues?g.prepareInitialValues(h.config):h.config),R=function(){try{return{res:S.validateSync({type:h.type,config:N},{stripUnknown:!0})}}catch(e){return{err:e}}}(),M=R.res,_=R.err;_&&(console.error("[EditModal] Failed to validate field of type ".concat(h.type,".\n Please update model.json accordingly.")),console.error(_));var B={id:m,config:M?M.config:N},D=(0,o.Z)(C.id.validate.matches,2),O=D[0],z=D[1],V=u.object().shape({id:u.string().matches(O,z).min(3).max(35).required(),config:S.fields.config}),L="".concat("edit-modal-form","-").concat(Math.random().toString());return(0,l.jsx)(Z.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:n,contentLabel:"Widget Form Modal",children:(0,l.jsx)(q,{apiId:m,formId:L,initialValues:B,validationSchema:V,FormFields:C,onSave:function(e){var t=e.newKey,r=e.value;s({apiId:m,newKey:t,value:(0,i.Z)({},h,r)}),n()},children:function(e){var t=e.values,s=t.id,c=t.config.label,u=e.isValid,x=e.isSubmitting,m=e.initialValues,h=I?(0,l.jsx)(I,(0,r.Z)((0,i.Z)({},e),{fields:a}),"field-model-tab-content"):(0,l.jsx)(y.k,{children:Object.entries(C).map(function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return(0,l.jsx)(y.J,{children:(0,l.jsx)(A.Z,{fieldName:(0,k.lm)(t),formField:i,fields:a,initialValues:m})},t)})},"field-model-tab-content"),g=["Field Model"],Z=[h];if("slice"===f){var S=(0,l.jsx)(d.xu,{children:(0,l.jsx)(E,{})},"mock-data-tab-content");g.push("Mock Data"),Z.push(S)}return(0,l.jsx)(b,{borderFooter:!0,footerSx:{position:"sticky",bottom:0,p:0},tabs:g,Header:function(e){var t=e.radius;return(0,l.jsxs)(d.kC,{sx:{position:"sticky",zIndex:1,top:0,p:3,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:t,borderTopRightRadius:t},children:[(0,l.jsx)(j,{theme:p,text:c||s,WidgetIcon:v}),(0,l.jsx)(d.x8,{onClick:n,type:"button"})]})},Footer:(0,l.jsxs)(d.kC,{sx:{position:"sticky",bottom:0,alignItems:"space-between",bg:"headSection",p:3},children:[(0,l.jsx)(d.xu,{sx:{ml:"auto"}}),(0,l.jsx)(d.zx,{mr:2,type:"button",onClick:n,variant:"secondary",children:"Cancel"}),(0,l.jsx)(d.zx,{form:L,type:"submit",disabled:!u&&x,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"},children:"Done"})]}),children:Z})}})})}},35308:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),s=t(75289),c=t(98898),d=t(74757),u=t(83399),f=t(59326),p=function(e){var n=e.title,t=e.description,i=e.icon,r=e.onSelect,l=(0,f.B7)().theme;return(0,o.jsxs)(s.kC,{sx:{p:3,my:2,alignItems:"center",cursor:"pointer",borderRadius:"3px",border:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)},"&:hover":{border:function(e){var n=e.colors;return"1px solid ".concat(n.primary)},boxShadow:"0 0 0 3px rgba(81, 99, 186, 0.2)"}},"data-testid":n,onClick:r,children:[(0,o.jsx)(i,{label:'Select field of type "'.concat(n,'"'),style:{color:l.colors.primary,marginRight:"8px",borderRadius:"4px",padding:"5px",border:"2px solid",borderColor:l.colors.primary},size:32}),(0,o.jsxs)(s.xu,{ml:1,children:[(0,o.jsx)(s.X6,{as:"h4",sx:{fontSize:1},children:(0,o.jsx)("b",{children:n})}),(0,o.jsx)(s.xv,{as:"p",variant:"xs",children:t})]})]})};a().setAppElement("#__next");var x=function(e){var n=e.data,t=e.close,l=e.onSelect,a=e.widgetsArray;return n.isOpen?(0,o.jsx)(u.Z,{isOpen:!0,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:"Widget Form Modal",children:(0,o.jsx)(c.Z,{borderFooter:!0,footerSx:{p:3},bodySx:{pt:2,pb:4,px:4},sx:{border:"none"},Header:function(e){var n=e.radius;return(0,o.jsxs)(s.kC,{sx:{position:"sticky",top:0,zIndex:1,p:3,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,o.jsx)(s.X6,{children:"Add a new field"}),(0,o.jsx)(s.x8,{onClick:t})]})},children:(0,o.jsx)(d.k,{children:a.filter(function(e){return e}).map(function(e){var n=e.Meta,t=e.TYPE_NAME,a=e.CUSTOM_NAME;return(0,o.jsx)(d.J,{children:(0,o.jsx)(p,(0,r.Z)((0,i.Z)({},n),{onSelect:function(){return l(a||t)}}))},a||t)})})})}):null}},13166:function(e,n,t){"use strict";t.d(n,{Z:function(){return g}});var i=t(22710),r=t(99267),o=t(52322),l=t(2784),a=t(49857),s=t(81038),c=t(77245),d=t(8799),u=t(65186),f=t(59326),p=t(75289),x=t(57899),m={position:"relative",top:"3px"},h=function(e){var n,t,i,r=e.code,a=e.lang,s=(0,f.B7)().theme,h=(0,l.useState)(!1),g=h[0],v=h[1],b=function(){r&&navigator.clipboard.writeText(r).then(function(){v(!0),setTimeout(function(){v(!1)},1200)})};return r?(0,o.jsxs)(p.kC,{sx:{p:2,px:3,alignItems:"center",borderTop:"1px solid",borderColor:"borders",justifyContent:"space-between"},children:[(0,o.jsxs)(p.kC,{sx:{alignItems:"center",display:["none","none","flex"],maxWidth:"80%"},children:[(0,o.jsx)(d.vcz,{size:26,color:null==s?void 0:null===(n=s.colors)||void 0===n?void 0:n.icons,style:{border:"1px solid",borderColor:null==s?void 0:null===(t=s.colors)||void 0===t?void 0:t.borders,borderRadius:"3px",padding:"4px",marginRight:"2px"}}),(0,o.jsx)(x.Z,{sx:{margin:"0px 8px",border:"none",borderRadius:"3px",fontSize:"13px"},lang:a,children:r})]}),(0,o.jsx)(p.xu,{children:(0,o.jsxs)(p.zx,{"aria-label":g?"Code snippet copied":"Copy code snippet",onClick:b,variant:"textButton",children:[g?(0,o.jsx)(u.HhX,{size:16,color:null==s?void 0:null===(i=s.colors)||void 0===i?void 0:i.success,style:m}):(0,o.jsx)(c.LhG,{size:16,style:m}),(0,o.jsx)(p.xv,{as:"span",sx:{display:["none","inline","none","inline"]},children:"\xa0Copy"})]})})]}):null},g=function(e){var n=e.show,t=e.renderHintBase,l=e.item,c=t({item:l}),d=(0,a.ZP)(c,(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,s.j.snippets.readSnippets({fieldPath:c.split("."),model:l.value})];case 1:return[2,e.sent()]}})})),u=d.data,f=d.error;if(f&&console.error(f),!u||f)return null;var p=u.snippets||[];return p[0]?(0,o.jsx)("div",{style:{display:n?"initial":"none"},children:(0,o.jsx)(h,{code:p[0].code,lang:p[0].language})}):null}},76167:function(e,n,t){"use strict";t.d(n,{Z:function(){return Z}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(22715),s=t(63397),c=t(2784),d=t(75289),u=t(59326),f=t(46577),p=t(77495),x=t(77735),m=t(52586),h=t(17384),g=t(18978),v=t(33710),b=t(82119),y=function(e){var n=e.error;return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b.X,{children:(0,l.jsx)(v.Z,{type:"light",multiline:!0,border:!0,borderColor:"tomato"})}),(0,l.jsx)(g.Zlu,{color:"tomato","data-tip":n,style:{position:"absolute",right:"8px"},size:16})]}):null},j=function(e){var n=e.innerRef,t=(0,o.Z)(e,["innerRef"]);return(0,l.jsx)(d.II,(0,r.Z)((0,i.Z)({},t),{ref:n}))},Z=function(e){var n=e.widgetTypeName,t=e.fields,o=e.onSave,g=e.onCancelNewField,v=(0,c.useRef)(null),b=(0,u.B7)().theme,Z=(0,c.useState)(!0),k=Z[0],C=Z[1];(0,c.useEffect)(function(){v.current&&v.current.focus()},[v]);var I=m[n];if(!I)return console.error('Widget of type "'.concat(n,'" not found. This is a problem on our side!')),(0,l.jsx)("div",{children:"Unexpected error. Contact us for more info."});var S=I.FormFields,E=I.Meta.icon,F={id:S.id,label:S.label},w=(0,r.Z)((0,i.Z)({},(0,p.f7)(F),"UID"===n?{id:"uid"}:{}),{widgetTypeName:n}),T=(0,p.gc)(F),A=function(e,n,t){t(k&&!F.id.disabled?(0,r.Z)((0,i.Z)({},n),{label:e.target.value,id:(0,h.lV)(e.target.value)}):(0,r.Z)((0,i.Z)({},n),{label:e.target.value}))},N=function(e,n){n("id",e.target.value),C(!1)};return(0,l.jsx)(s.J9,{onSubmit:o,validationSchema:T,initialValues:w,children:function(e){var n,o,c=e.errors,u=e.values,p=e.setValues,m=e.setFieldValue,h=e.submitForm;return(0,l.jsx)(s.l0,{"data-testid":"new-field-form",children:(0,l.jsxs)(d.kC,{as:"li",sx:{bg:"white",p:3,px:3,mx:0,ml:"34px",alignItems:"center",variant:"styles.listItem",border:function(e){var n,t;return"1px solid ".concat((null===(n=e.colors)||void 0===n?void 0:null===(t=n.borders)||void 0===t?void 0:t.toString())||"")},flexWrap:"wrap",gap:"12px",justifyContent:"flex-start"},children:[(0,l.jsx)(E,{style:{color:null===(n=b.colors)||void 0===n?void 0:n.primary,borderRadius:"4px",padding:"4px",border:"2px solid",borderColor:null===(o=b.colors)||void 0===o?void 0:o.primary},size:28}),(0,l.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field Name"}),(0,l.jsx)(s.gN,{onChange:function(e){return A(e,u,p)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"label",placeholder:"Field Name",type:"text",validate:function(e){if(!e.length)return"This field is required"},as:j,innerRef:v,sx:(0,r.Z)((0,i.Z)({},(0,f.tM)(F.label.disabled?f.$w.DISABLED:c.label?f.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"aria-label":"label-input","data-testid":"new-field-name-input"}),(0,l.jsx)(y,{error:c.label})]}),(0,l.jsxs)(d.kC,{sx:{alignItems:"center",flexGrow:1,gap:2,position:"relative"},children:[(0,l.jsx)(d.xv,{as:"p",sx:{fontWeight:500,whiteSpace:"nowrap"},children:"Field ID"}),(0,l.jsx)(s.gN,{onChange:function(e){return N(e,m)},onKeyDown:function(e){"Enter"===e.key&&h()},name:"id",placeholder:"e.g. buttonLink",type:"text",disabled:F.id.disabled,validate:function(e){return(0,x.u)({value:e,fields:t,initialId:null})},as:j,sx:(0,r.Z)((0,i.Z)({},(0,f.tM)(F.id.disabled?f.$w.DISABLED:c.id?f.$w.ERROR:void 0)),{flexGrow:1,minWidth:"128px",width:"initial"}),"data-testid":"new-field-id-input"}),(0,l.jsx)(y,{error:c.id})]}),(0,l.jsxs)(d.kC,{sx:{gap:2},children:[(0,l.jsx)(a.zx,{onClick:g,color:"grey",children:"Cancel"}),(0,l.jsx)(a.zx,{onClick:function(){h()},children:"Add"})]})]})})}})}},18645:function(e,n,t){"use strict";t.d(n,{Z:function(){return E}});var i=t(62230),r=t(85244),o=t(17064),l=t(81541),a=t(52322),s=t(22715),c=t(13980),d=t(2784),u=t(65077),f=t(82770),p=t(28173),x=t(9461),m=t(35308),h=t(40023),g=t(75289),v=t(12374),b=t(97470),y=t(52586),j=t(8830),Z=t(13166),k=function(e){var n=e.fields,t=e.title,o=e.tabId,l=e.enterEditMode,s=e.enterSelectMode,c=e.onDragEnd,d=e.renderFieldAccessor,u=e.onDeleteItem,f=e.onSave,p=e.showHints,x=e.newField,m=e.renderHintBase,k=e.isRepeatable,C=e.testId,I=e.isRepeatableCustomType;return(0,a.jsx)(h.Z5,{onDragEnd:c,children:(0,a.jsx)(h.bK,{droppableId:t,children:function(e,t){return(0,a.jsxs)(g.xu,(0,r.Z)((0,i.Z)({as:"ul",ref:e.innerRef},e.droppableProps),{"data-testid":C,sx:{paddingInline:"16px !important"},children:[n.map(function(e,n){var c=e.value,x=c.config,h=c.type,C=(0,j.t)(y,x,h);if(!C)return(0,a.jsx)(v.Z,{children:(0,a.jsxs)(g.xv,{children:['Field type "',h,'" not supported']})});var S={item:e,index:n,tabId:o,widget:C,showHints:p,key:e.key,enterSelectMode:s,renderFieldAccessor:d,enterEditMode:l,parentSnapshot:t,deleteItem:u,saveItem:f,draggableId:"list-item-".concat(e.key),isRepeatableCustomType:I,testId:"list-item-".concat(e.key)},E=(0,a.jsx)(Z.Z,{item:e,show:p,isRepeatable:k,renderHintBase:m,Widgets:y,typeName:C.CUSTOM_NAME||C.TYPE_NAME});if(C.CustomListItem){var F=C.CustomListItem;return(0,a.jsx)(F,(0,r.Z)((0,i.Z)({},S),{HintElement:E}))}return(0,a.jsx)(b.Z,(0,r.Z)((0,i.Z)({},S),{HintElement:E}))}),e.placeholder,x]}))}})})},C=t(76167),I=function(e){var n=e.onEnterSelectMode,t=e.zoneName;return(0,a.jsxs)(g.xu,{sx:{textAlign:"center",my:4},children:[(0,a.jsx)(g.X6,{as:"h5",children:"Add a new field here"}),(0,a.jsx)(g.xu,{sx:{my:2},children:(0,a.jsx)(g.xv,{sx:{color:"textClear"},children:"Fields are inputs for content (e.g. text, images, links)."})}),(0,a.jsx)(g.xu,{sx:{display:"flex",justifyContent:"center",marginTop:16},children:(0,a.jsx)(s.zx,{color:"grey",onClick:function(){return n()},"data-testid":"add-".concat(t,"-field"),startIcon:"add",children:"Add a new field"})})]})},S=function(e){var n=e.zoneType,t=e.tabId,c=e.title,h=e.fields,g=e.poolOfFieldsToCheck,v=e.widgetsArray,b=e.isRepeatable,y=e.onDeleteItem,j=e.onSaveNewField,Z=e.onDragEnd,S=e.EditModal,E=e.onSave,F=e.dataTip,w=e.renderHintBase,T=e.renderFieldAccessor,A=e.testId,N=e.isRepeatableCustomType,R=Object.entries(g).find(function(e){return"UID"===(0,o.Z)(e,2)[1].value.type})?v.filter(function(e){return"UID"!==e.TYPE_NAME}):v,M=(0,d.useState)(!1),_=M[0],q=M[1],B=(0,d.useState)({isOpen:!1}),D=B[0],O=B[1],z=(0,d.useState)({isOpen:!1}),V=z[0],L=z[1],P=(0,d.useState)(null),J=P[0],H=P[1],W=function(e){O({isOpen:!0,field:e});var n=(0,o.Z)(e,2),t=n[0],i=n[1];f.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!1,contentType:(0,x.T)(window.location.pathname)})},U=function(){L({isOpen:!0})},$=function(){O({isOpen:!1})},G=function(){return L({isOpen:!1})},Y=function(e){H({widgetTypeName:e,fields:h}),L({isOpen:!1})},K=function(){return H(null)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.Bu,{actions:h.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.xv,{color:"grey11",component:"span",noWrap:!0,children:"Show code snippets?"}),(0,a.jsx)(s.rs,{checked:_,onCheckedChange:q,size:"small",style:{flexShrink:0},"data-testid":"code-snippets-switch"}),(0,a.jsx)(s.zx,{"data-testid":"add-".concat(b?"Repeatable":"Static","-field"),onClick:U,startIcon:"add",color:"grey",disabled:null!==J,children:"Add a new field"})]}):void 0,children:c}),0!==h.length||J?h.length>0||J?(0,a.jsx)(u.xR,{children:(0,a.jsx)(k,{tabId:t,isRepeatable:b,fields:h,showHints:_,dataTip:F,title:c,renderFieldAccessor:T,renderHintBase:w,enterEditMode:W,enterSelectMode:U,onDragEnd:Z,onDeleteItem:y,onSave:E,testId:A,isRepeatableCustomType:N,newField:J&&(0,a.jsx)(C.Z,(0,r.Z)((0,i.Z)({},J),{fields:g||h,onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];j.apply(void 0,(0,l.Z)(n)),H(null)},onCancelNewField:K}))})}):void 0:(0,a.jsx)(u.xR,{children:(0,a.jsx)(I,{onEnterSelectMode:function(){return U()},zoneName:b?"Repeatable":"Static"})}),(0,a.jsx)(S,{data:D,close:$,onSave:E,fields:g,zoneType:n}),(0,a.jsx)(m.Z,{data:V,close:G,onSelect:Y,widgetsArray:R})]})};S.propTypes={isRepeatable:c.bool,title:c.string.isRequired,dataTip:c.string.isRequired,onSave:c.func.isRequired,onSaveNewField:c.func.isRequired,onDragEnd:c.func.isRequired,onDeleteItem:c.func.isRequired,poolOfFieldsToCheck:(0,c.arrayOf)((0,c.shape)({key:c.string,value:c.object})),renderHintBase:c.func.isRequired,renderFieldAccessor:c.func.isRequired,widgetsArray:c.array.isRequired,fields:(0,c.arrayOf)((0,c.shape)({key:c.string.isRequired,value:(0,c.shape)({config:c.object,fields:c.array,type:c.string.isRequired})}))};var E=S},8830:function(e,n,t){"use strict";t.d(n,{t:function(){return i}});var i=function(e,n,t){if("Link"===t)switch(null==n?void 0:n.select){case"document":return e.ContentRelationship;case"media":return e.LinkToMedia;default:return e.Link}return e[t]}},77735:function(e,n,t){"use strict";t.d(n,{J:function(){return l},u:function(){return o}});var i=t(63094),r=t(43947),o=function(e){var n=e.value,t=e.fields,i=e.initialId;return n?t.find(function(e){return e.key===n})&&n!==i?'Field "'.concat(n,'" already exists.'):void 0:"Field is required"},l={label:(0,r.II)("Label",{required:"This field is required",max:!0},void 0,void 0,"Label for content creators (defaults to field type)"),id:(0,r.II)("API ID*",{min:!0,max:!0,required:"This field is required",matches:[i.xo,"No special characters allowed (except _)"]},o,void 0,"A unique identifier for the field (e.g. buttonLink)"),placeholder:(0,r.II)("Placeholder",{required:"This field is required",max:[100,"String is too long. Max: 100"]},void 0,void 0,"Placeholder text for content creators")}},43947:function(e,n,t){"use strict";t.d(n,{II:function(){return c},Jg:function(){return o}});var i=t(77495),r=t(98079),o=function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],t=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return{type:r.h.CHECKBOX,validate:{required:(0,i.MJ)(n,s)},required:n,label:e,defaultValue:t,yupType:"boolean"}},l=[3,"String is too short. Min: 3"],a=[35,"String is too long. Max: 35"],s=["Field is required"],c=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{min:l,max:a,required:s},t=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0,d=n||{},u=d.min,f=d.max,p=d.required,x=d.matches;return{type:r.h.INPUT,label:e,validate:{required:(0,i.MJ)(p,s),min:(0,i.MJ)(u,l),max:(0,i.MJ)(f,a),matches:x},defaultValue:o,fieldLevelValidation:t,yupType:"string",placeholder:c}}},77495:function(e,n,t){"use strict";t.d(n,{MJ:function(){return u},f7:function(){return f},gc:function(){return p},lm:function(){return d}});var i=t(67557),r=t(62230),o=t(85244),l=t(17064),a=t(81541),s=t(65413),c=t(98079),d=function(e){return"id"===e?"id":"config.".concat(e)},u=function(e,n){return Array.isArray(e)?e:"boolean"==typeof e&&e?n:null},f=function(e){return Object.entries(e).reduce(function(e,n){var t,a=(0,l.Z)(n,2),s=a[0],d=null===(t=a[1]).defaultValue?void 0:void 0!==t.defaultValue?t.defaultValue:t.type===c.h.CHECKBOX||(t.type===c.h.INPUT?"":t.type===c.h.SELECT?[]:void 0);return void 0!==d?(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},s,d)):e},{})},p=function(e){return s.object().shape(Object.entries(e).filter(function(e){return e}).reduce(function(e,n){var t=(0,l.Z)(n,2),c=t[0],d=t[1],u=d.validate,f=d.yupType;if(!u)return e;if("function"==typeof u)return(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,u(c,d)));var p=s[f]();return Object.entries(u).filter(function(e){return e&&e[1]}).forEach(function(e){var n,t=(0,l.Z)(e,2),i=t[0],r=t[1];if(r&&p[i]){p=(n=p)[i].apply(n,(0,a.Z)(Array.isArray(r)?r:[r]));return}console.warn('Invalid Yup validator for field "'.concat(c,'"'))}),(0,o.Z)((0,r.Z)({},e),(0,i.Z)({},c,p))},{})).required().default(void 0).noUnknown(!0)}},98079:function(e,n,t){"use strict";var i,r;t.d(n,{h:function(){return i}}),(r=i||(i={})).CHECKBOX="checkbox",r.INPUT="input",r.SELECT="select"},36195:function(e,n,t){"use strict";var i=t(89150);n.Z=[i.StructuredText,i.Image,i.Link,i.LinkToMedia,i.ContentRelationship,i.Select,i.Boolean,i.Date,i.Timestamp,i.Embed,i.Number,i.GeoPoint,i.Color,i.Text,]},89150:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return g},Color:function(){return Z},ContentRelationship:function(){return H},Date:function(){return $},Embed:function(){return K},GeoPoint:function(){return Q},Image:function(){return eh},Link:function(){return B},LinkToMedia:function(){return ej},Number:function(){return eI},Select:function(){return eN},StructuredText:function(){return eG},Text:function(){return eX},Timestamp:function(){return e0},UID:function(){return e7}});var i,r,o,l,a,s=t(8799),c=t(65413),d=t(77495),u=t(77735),f=t(43947),p=t(13302),x={icon:s.XGl,title:"Boolean",description:"An input that is either true or false"},m={label:u.J.label,id:u.J.id,placeholder_false:(0,f.II)("False Placeholder",{required:!1},null,"false","Value the content creator sees (Output as 'false' in the API)."),placeholder_true:(0,f.II)("True Placeholder",{required:!1},null,"true","Value the content creator sees (Output as 'true' in the API)"),default_value:(0,f.Jg)("Default to true")},h=c.object().shape({type:c.string().matches(/^Boolean$/,{excludeEmptyString:!0}).required(),config:(0,d.gc)((0,p.B9)(m,"id"))}),g={TYPE_NAME:"Boolean",create:function(e){return{type:"Boolean",config:{label:e,default_value:!1,placeholder_true:"true",placeholder_false:"false"}}},Meta:x,schema:h,FormFields:m},v=t(65186),b={icon:v.jqW,title:"Color",description:"A color picker"},y=(0,p.zg)("Color"),j=y.TYPE_NAME,Z={create:function(e){return{type:"Color",config:{label:e,placeholder:""}}},FormFields:y.FormFields,TYPE_NAME:j,schema:y.schema,Meta:b},k=t(62230),C=t(85244),I=t(56580),S=t(52312),E=t(28849),F=t(34543),w=t(17064),T=t(52322),A=t(74757),N=t(46784),R=(0,C.Z)((0,k.Z)({},u.J),{allowTargetBlank:(0,f.Jg)("Allow target blank",!1,!1)}),M=function(e){var n=e.initialValues,t=e.fields;return(0,T.jsx)(A.k,{children:Object.entries(R).map(function(e){var i=(0,w.Z)(e,2),r=i[0],o=i[1];return(0,T.jsx)(A.J,{children:(0,T.jsx)(N.Z,{fieldName:(0,d.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},_={icon:F.eR7,title:"Link",description:"A link to web, media or Prismic document"},q=c.object().shape({label:c.string().optional(),useAsTitle:c.boolean().optional(),placeholder:c.string().optional(),select:c.string().optional().oneOf(["media","document","web",null]).nullable(),customtypes:c.array(c.string()).strict().optional(),masks:c.array(c.string()).optional(),tags:c.array(c.string()).optional(),allowTargetBlank:c.boolean().strict().optional()}).required().default(void 0).noUnknown(!0),B={Meta:_,FormFields:R,schema:c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:q.optional()}),Form:M,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:null}}},TYPE_NAME:"Link"},D=t(36131),O=t(75289),z={label:u.J.label,id:u.J.id,customtypes:{validate:function(){return c.array().of(c.string())}}},V=function(e){var n=e.initialValues,t=e.values,i=e.fields,r=e.setFieldValue,o=(0,I.v9)(E.Ch).filter(S.TG),l=o.map(function(e){return{value:e.local.id,label:e.local.label}}),a=t.config.customtypes?t.config.customtypes.map(function(e){var n=o.find(function(n){return n.local.id===e});return{value:null==n?void 0:n.local.id,label:null==n?void 0:n.local.label}}):null;return(0,T.jsxs)(A.k,{children:[Object.entries(z).filter(function(e){return"customtypes"!==e[0]}).map(function(e){var t=(0,w.Z)(e,2),r=t[0],o=t[1];return(0,T.jsx)(A.J,{children:(0,T.jsx)(N.Z,{fieldName:(0,d.lm)(r),formField:o,fields:i,initialValues:n})},r)}),(0,T.jsx)(A.J,{children:(0,T.jsxs)(O.xu,{sx:{mt:2,alignItems:"center"},children:[(0,T.jsx)(O.__,{htmlFor:"origin",mb:"1",children:"Types"}),(0,T.jsx)(D.ZP,{isMulti:!0,name:"origin",options:l,onChange:function(e){e&&r("config.customtypes",e.map(function(e){return e.value}))},value:a,theme:function(e){return(0,C.Z)((0,k.Z)({},e),{colors:(0,C.Z)((0,k.Z)({},e.colors),{text:"text",primary:"background"})})}})]})})]})},L={icon:v.I2R,title:"Content Relationship",description:"Define content relations & internal links"},P=q.shape({label:c.string().max(35,"String is too long. Max: 35"),select:c.string().required().matches(/^document$/,{excludeEmptyString:!0}),customtypes:c.array(c.string()).strict().optional()}),J=c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:P}),H={create:function(e){return{type:"Link",config:{label:e,select:"document"}}},Meta:L,schema:J,TYPE_NAME:"Link",FormFields:z,CUSTOM_NAME:"ContentRelationship",Form:V,prepareInitialValues:function(e){var n=(0,I.v9)(E.Ch).filter(S.TG);return(null==e?void 0:e.customtypes)?(0,C.Z)((0,k.Z)({},e),{customtypes:e.customtypes.filter(function(e){return n.find(function(n){return n.local.id===e})})}):e}},W=(0,p.zg)("Date"),U=W.FormFields,$={create:function(e){return{type:"Date",config:{label:e,placeholder:""}}},FormFields:U,TYPE_NAME:"Date",schema:W.schema,Meta:{icon:v.f$3,title:"Date",description:"A calendar date picker"}},G=(0,p.zg)("Embed"),Y=G.FormFields,K={create:function(e){return{type:"Embed",config:{label:e,placeholder:""}}},FormFields:Y,TYPE_NAME:"Embed",schema:G.schema,Meta:{icon:F.xqv,title:"Embed",description:"Embed videos, songs, tweets, slides, …"}},X={label:u.J.label,id:u.J.id},Q={create:function(e){return{type:"GeoPoint",config:{label:e}}},FormFields:X,TYPE_NAME:"GeoPoint",schema:c.object().shape({type:c.string().matches(/^GeoPoint$/,{excludeEmptyString:!0}).required(),config:c.object().shape({label:c.string()}).required().default(void 0).noUnknown(!0)}),Meta:{icon:v.c7Z,title:"GeoPoint",description:"A field for storing geo-coordinates"}},ee=t(2784),en=t(63397),et=t(98240),ei=t(3402),er=t(89363),eo=function(e){var n=e.onClick,t=e.error,i=e.onDelete,r=e.active,o=e.text,l=e.sx;return(0,T.jsx)(er.Z,{useActive:!0,fitButton:!0,error:t,onClick:n,active:r,sx:(0,k.Z)({position:"relative",width:"64px",height:"64px"},l),Icon:function(){return(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsxs)(O.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[(0,T.jsx)(s.jnY,{size:22}),(0,T.jsx)(O.xv,{mt:1,children:o})]}),i?(0,T.jsx)(O.Ct,{onClick:i,variant:"circle-right",children:(0,T.jsx)(v.B4e,{})}):null]})}})},el=function(e){var n=e.onClick;return(0,T.jsx)(er.Z,{fitButton:!0,onClick:n,sx:{width:"64px",height:"64px",border:function(e){var n=e.colors;return"1px solid ".concat(String(null==n?void 0:n.borders))}},Icon:function(){return(0,T.jsx)(O.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center"},children:(0,T.jsx)(s.iTs,{size:34,color:"#5263BA","aria-label":"Add a thumbnail"})})}})},ea=function(e){var n=e.prefix,t=e.required,i=e.display,r=(0,w.Z)((0,en.U$)(n),2),o=(r[0],r[1]),l=void 0!==t&&t?"*":"";return i?(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsx)(es,{name:"".concat(n,".name"),label:"Name".concat(l),placeholder:"main",sx:{mb:3},isConstraint:"config.constraint"===n,meta:o}),(0,T.jsx)(ec,{name:"".concat(n,".width"),label:"Width (px)".concat(l),placeholder:" ",sx:{mb:3}}),(0,T.jsx)(ec,{name:"".concat(n,".height"),label:"Height (px)".concat(l),placeholder:" "})]}):null},es=function(e){var n=e.name,t=e.label,i=e.placeholder,r=e.meta,o=e.isConstraint,l=(0,et.Z)(e,["name","label","placeholder","meta","isConstraint"]),a=(0,w.Z)((0,en.U$)(n),1)[0];return(0,T.jsx)(ei.Hq,(0,C.Z)((0,k.Z)({},l),{fieldName:n,meta:r,formField:{label:t,placeholder:i},field:o?{value:"main",readOnly:!0}:{value:a.value},variant:o?"disabled":"primary"}))},ec=function(e){var n=e.name,t=e.label,i=e.placeholder,r=(0,et.Z)(e,["name","label","placeholder"]),o=(0,w.Z)((0,en.U$)(n),2),l=o[0],a=o[1];return(0,T.jsx)(ei.Hq,(0,C.Z)((0,k.Z)({},r),{fieldName:n,formField:{label:t,placeholder:i},meta:a,field:{min:0,type:"number",value:l.value||"",onKeyDown:function(e){("e"===e.key||"-"===e.key||"+"===e.key)&&e.preventDefault()}}}))},ed=function(){return c.number().nullable().transform(function(e,n){return""===n?null:e})},eu={label:u.J.label,id:u.J.id,constraint:{validate:function(){return c.object().defined().shape({width:ed(),height:ed()})}},thumbnails:{validate:function(){return c.array().defined().of(c.object().test({name:"Thumbnails",message:"Must set name and width or height at minimum",test:function(e){if(!e.name)return!1;var n="number"==typeof e.width&&e.width,t="number"==typeof e.height&&e.height;return e.name&&(n||t)}}))}}},ef={name:"",width:"",height:""},ep=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width,t=e.height,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!i||n||t?n||t?"".concat(n||"auto","x").concat(t||"auto"):"...":"auto"},ex=function(e){var n=e.initialValues,t=e.values,i=e.errors,r=e.fields,o=e.touched,l=(0,ee.useState)(0),a=l[0],s=l[1],c=t.config,u=c.thumbnails,f=c.constraint;return(0,ee.useEffect)(function(){s(u.length)},[u.length]),(0,T.jsxs)(A.k,{children:[Object.entries(eu).map(function(e){var t=(0,w.Z)(e,2),i=t[0],o=t[1];return(0,T.jsx)(A.J,{children:(0,T.jsx)(N.Z,{fieldName:(0,d.lm)(i),formField:o,fields:r,initialValues:n})},i)}),(0,T.jsxs)(A.J,{children:[(0,T.jsx)(O.__,{htmlFor:"thumbnails",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:"Responsive views*"}),(0,T.jsx)(O.Zb,{p:3,children:(0,T.jsx)(en.F2,{name:"config.thumbnails",render:function(n){var t=n.push,r=n.remove;return(0,T.jsxs)(ee.Fragment,{children:[(0,T.jsxs)(O.kC,{mb:3,children:[(0,T.jsx)(eo,{active:0===a,text:ep(f,!0),sx:{mr:2},onClick:function(){return s(0)}}),u.map(function(e,n){return(0,T.jsx)(eo,{sx:{mr:3},active:a===+n+1,text:ep(e),error:!!i.thumbnails&&!!o.thumbnails&&!!o.thumbnails[n]&&!!i.thumbnails&&!!i.thumbnails[n],onDelete:function(){return r(n)},onClick:function(){return s(+n+1)}},"thumbnail-button-".concat(+n+1))}),(0,T.jsx)(el,{onClick:function(){t(ef)}})]}),(0,T.jsx)(ea,(0,C.Z)((0,k.Z)({},e),{display:0===a,prefix:"config.constraint"})),u.map(function(n,t){return(0,ee.createElement)(ea,(0,C.Z)((0,k.Z)({},e),{required:!0,key:"thumbnail-".concat(+t+1),display:a===+t+1,prefix:"config.thumbnails[".concat(t,"]")}))})]})}})})]})]})},em=c.object().shape({type:c.string().matches(/^Image$/,{excludeEmptyString:!0}).required(),config:(0,d.gc)((0,p.B9)(eu,"id"))}),eh={Meta:{icon:s.jnY,title:"Image",description:"A responsive image field with constraints"},Form:ex,schema:em,create:function(e){return{type:"Image",config:{label:e,constraint:{},thumbnails:[]}}},FormFields:eu,TYPE_NAME:"Image"},eg=(0,k.Z)({},u.J),ev=function(e){var n=e.initialValues,t=e.fields;return(0,T.jsx)(A.k,{children:Object.entries(eg).map(function(e){var i=(0,w.Z)(e,2),r=i[0],o=i[1];return(0,T.jsx)(A.J,{children:(0,T.jsx)(N.Z,{fieldName:(0,d.lm)(r),formField:o,fields:t,initialValues:n})},r)})})},eb={icon:v.x2k,title:"Link to media",description:"A link to files, document and media"},ey=q.shape({select:c.string().required().matches(/^media$/,{excludeEmptyString:!0})}),ej={Meta:eb,FormFields:eg,schema:c.object().shape({type:c.string().matches(/^Link$/,{excludeEmptyString:!0}).required(),config:ey.optional()}),Form:ev,create:function(e){return{type:"Link",config:{label:e,placeholder:"",select:"media"}}},TYPE_NAME:"Link",CUSTOM_NAME:"LinkToMedia"},eZ=t(951),ek=(0,p.zg)("Number"),eC=ek.FormFields,eI={create:function(e){return{type:"Number",config:{label:e,placeholder:""}}},FormFields:eC,TYPE_NAME:"Number",schema:ek.schema,Meta:{icon:eZ.JUs,title:"Number",description:"A number input field"}},eS=t(98079),eE=function(e){return"use first value as default ".concat(e?'("'.concat(e,'")'):"")},eF=function(e,n){return n?e:void 0},ew=(0,C.Z)((0,k.Z)({},u.J),{default_value:{type:eS.h.CHECKBOX,yupType:"string",defaultValue:null,validate:function(){return c.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(function(n){return n===e})}})},component:function(e){var n,t=null===(n=(0,en.u6)().values.config)||void 0===n?void 0:n.options[0];return(0,T.jsx)(ei.w8,(0,C.Z)((0,k.Z)({},e),{defaultValue:e.field.value,controlledValue:t,setControlledValue:e.helpers.setValue,buildControlledValue:eF,label:eE}))}},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:function(e){return!e.some(function(e){return!e||!e.length})}}},component:function(e){return(0,T.jsx)(ei.kp,(0,k.Z)({label:"Options",inputPlaceholder:"Select option output in API (e.g. 'blueTheme')",buttonLabel:"Add option"},e))}}}),eT={icon:v.dzP,title:"Select",description:"A dropdown field of options for content creators."},eA=c.object().shape({type:c.string().matches(/^Select$/,{excludeEmptyString:!0}).required(),config:(0,d.gc)((0,p.B9)(ew,"id"))}),eN={FormFields:ew,create:function(e){return{type:"Select",config:{label:e,placeholder:"",options:["1","2"]}}},schema:eA,Meta:eT,TYPE_NAME:"Select"},eR=t(81541),eM=t(47927),e_=t(76635),eq=function(e){return function(n){var t=n.size;return(0,T.jsx)("span",{style:{fontSize:t},children:e})}},eB=[{value:"paragraph",label:"P",icon:eq("p")},{value:"preformatted",label:"PRE",icon:eq("pre")},{value:"heading1",label:"H1",icon:eq("h1")},{value:"heading2",label:"H2",icon:eq("h2")},{value:"heading3",label:"H3",icon:eq("h3")},{value:"heading4",label:"H4",icon:eq("h4")},{value:"heading5",label:"H5",icon:eq("h5")},{value:"heading6",label:"H6",icon:eq("h6")},{value:"strong",label:"Strong",icon:eq((0,T.jsx)("b",{children:"b"}))},{value:"em",label:"em",icon:eq((0,T.jsx)("em",{style:{fontFamily:"serif"},children:"I"}))},{value:"hyperlink",label:"hyperlink",icon:eq((0,T.jsx)(F.eR7,{}))},{value:"image",label:"image",icon:eq((0,T.jsx)(F.LFN,{}))},{value:"embed",label:"embed",icon:eq((0,T.jsx)(F.xqv,{}))},{value:"list-item",label:"list",icon:eq((0,T.jsx)(F.SnF,{}))},{value:"o-list-item",label:"o",icon:eq((0,T.jsx)(s.KyO,{}))},{value:"rtl",label:"rtl",icon:eq("rtl")},],eD=eB.map(function(e){return e.value}),eO=function(e){return!eD.find(function(n){return!e.includes(n)})},ez=function(e){var n=e.split(",");return eB.reduce(function(e,t){var i=t.value;return n.includes(i)?(0,eR.Z)(e).concat([i]):e},[])};function eV(e,n){return(0,eM.has)("parent",e)&&(0,e_.isObject)(e.parent)&&(0,eM.has)(n,e.parent)&&(0,e_.isString)(e.parent[n])?e.parent[n]:null}function eL(e){return function(){return c.string().test({name:e,message:"Options cannot be empty",test:function(n,t){var i=eV(t,e),r=eV(t,"single"===e?"multi":"single");return!!r&&"string"==typeof r||"string"==typeof i&&(!!i&&!!i.length||!!r&&!!r.length)&&!i.split(",").find(function(e){return!eD.includes(e)})}})}}var eP,eJ=(0,C.Z)((0,k.Z)({},u.J),{allowTargetBlank:(0,f.Jg)("Allow target blank for links"),single:{validate:eL("single")},multi:{validate:eL("multi")}}),eH=["config.single","config.multi"],eW=function(e){var n,t=e.initialValues,i=e.values,r=e.errors,o=e.fields,l=e.setFieldValue,a=i.config,s=a.single,c=a.multi,u=s?ez(s):c&&ez(c)||eD,f=(0,ee.useState)(!s),p=f[0],x=f[1],m=(0,ee.useState)(u),h=m[0],g=m[1];return(0,ee.useEffect)(function(){var e=p?1:0;l(eH[e],h.join(",")),setTimeout(function(){l(eH[1-e],void 0)},100)},[p,h]),(0,T.jsxs)(A.k,{children:[Object.entries(eJ).map(function(e){var n=(0,w.Z)(e,2),i=n[0],r=n[1];return(0,T.jsx)(A.J,{children:(0,T.jsx)(N.Z,{fieldName:(0,d.lm)(i),formField:r,fields:o,initialValues:t})},i)}),(0,T.jsxs)(A.J,{children:[(0,T.jsxs)(O.__,{htmlFor:"accept",variant:"label.primary",sx:{mt:1,display:"flex",alignItems:"center"},children:["Accept*",(0,T.jsx)(O.zx,{type:"button",variant:"buttons.textButton",onClick:function(){if(eO(h))return g([]);g(eD)},children:eO(h)?"Unselect All":"Select all"})]}),eB.map(function(e){return(0,T.jsx)(er.Z,{fitButton:!0,useActive:!0,label:e.label,size:14,Icon:e.icon,sx:{p:"16px",mb:2,mr:2,variant:"buttons.selectIcon"},active:h.includes(e.value),onClick:function(){if(h.find(function(n){return n===e.value}))return g(h.filter(function(n){return n!==e.value}));g((0,eR.Z)(h).concat([e.value]))}},e.value)}),(null===(n=r.config)||void 0===n?void 0:n[p?"multi":"single"])?(0,T.jsx)(O.xu,{sx:{position:"absolute"},children:(0,T.jsx)(O.xv,{as:"span",variant:"text.labelError",pl:0,children:r.config[p?"multi":"single"]})}):null]}),(0,T.jsx)(A.J,{children:(0,T.jsx)(O.kC,{sx:{mt:2,alignItems:"center",height:"100%"},children:(0,T.jsxs)(O.__,{variant:"label.border",children:[(0,T.jsx)(O.XZ,{checked:p,onChange:function(){return x(!p)}}),"Allow multiple paragraphs"]})})})]})},eU={icon:v.BAW,title:"Rich Text",description:"A rich text field with formatting options"},e$=c.object().shape({type:c.string().matches(/^StructuredText$/,{excludeEmptyString:!0}).required(),config:(0,d.gc)((0,p.B9)((0,k.Z)({},eJ,{labels:{yupType:"array",validate:{}}}),"id"))}),eG={create:function(e){return{type:"StructuredText",config:{label:e,placeholder:"",allowTargetBlank:!0,multi:eD.join(",")}}},FormFields:eJ,Meta:eU,schema:e$,TYPE_NAME:"StructuredText",Form:eW},eY=u.J,eK=c.object().shape({type:c.string().matches(/^Text$/,{excludeEmptyString:!0}).required(),config:(0,d.gc)((0,p.B9)(eY,"id"))}),eX={create:function(e){return{type:"Text",config:{label:e,placeholder:""}}},Meta:{icon:v.SQS,title:"Key Text",description:"A simple text string field"},schema:eK,TYPE_NAME:"Text",FormFields:eY},eQ=u.J,e0={create:function(e){return{type:"Timestamp",config:{label:e,placeholder:""}}},schema:c.object().shape({type:c.string().matches(/^Timestamp$/,{excludeEmptyString:!0}).required(),config:(0,d.gc)((0,p.B9)(eQ,"id"))}),FormFields:eQ,TYPE_NAME:"Timestamp",Meta:{icon:v.f$3,title:"Timestamp",description:"A calendar date picker with time"}},e2={label:u.J.label,id:(0,C.Z)((0,k.Z)({},u.J.id),{validate:{required:"This field is required",matches:[/^uid$/,"Api ID must be 'uid' for this field."]},disabled:!0}),placeholder:u.J.placeholder},e1=c.object().shape({type:c.string().matches(/^UID$/,{excludeEmptyString:!0}).required(),config:(0,d.gc)((0,p.B9)(e2,"id"))}),e7={create:function(e){return{type:"UID",config:{label:e,placeholder:""}}},Meta:{icon:v.izl,title:"UID",description:"Unique Identifier"},schema:e1,TYPE_NAME:"UID",FormFields:e2}},52586:function(e,n,t){"use strict";t.r(n),t.d(n,{Boolean:function(){return l.Boolean},Color:function(){return l.Color},ContentRelationship:function(){return l.ContentRelationship},Date:function(){return l.Date},Embed:function(){return l.Embed},GeoPoint:function(){return l.GeoPoint},Group:function(){return O},Image:function(){return l.Image},Link:function(){return l.Link},LinkToMedia:function(){return l.LinkToMedia},Number:function(){return l.Number},Select:function(){return l.Select},StructuredText:function(){return l.StructuredText},Text:function(){return l.Text},Timestamp:function(){return l.Timestamp},UID:function(){return l.UID}});var i,r,o,l=t(89150),a=t(65186),s=t(65413),c=t(62230),d=t(85244),u=t(17064),f=t(52322),p=t(75289),x=t(74757),m=t(46784),h=t(77495),g=t(77735),v=t(43947),b=(0,d.Z)((0,c.Z)({},g.J),{repeat:(0,v.Jg)("Repeatable",!1,!0)}),y=function(e){var n=e.initialValues,t=e.fields,i=e.values,r=e.setFieldValue,o=i.config.repeat;return(0,f.jsxs)(x.k,{children:[Object.entries(b).filter(function(e){return"repeat"!==(0,u.Z)(e,1)[0]}).map(function(e){var i=(0,u.Z)(e,2),r=i[0],o=i[1];return(0,f.jsx)(x.J,{children:(0,f.jsx)(m.Z,{fieldName:(0,h.lm)(r),formField:o,fields:t,initialValues:n})},r)}),(0,f.jsx)(x.J,{children:(0,f.jsx)(p.xu,{sx:{mt:2,alignItems:"center",display:"flex",height:"130%"},children:(0,f.jsxs)(p.__,{variant:"label.border",sx:{mb:0},children:[(0,f.jsx)(p.XZ,{checked:o,onChange:function(){return r("config.repeat",!o)}}),"Repeatable"]})})})]})},j=t(98240),Z=t(81541),k=t(2784),C=t(40023),I=t(28316),S=t(82770),E=t(97470),F=t(73393),w=t(35308),T=t(13166),A=t(76167),N=t(8830),R=t(24244),M=t(36195),_=t(13302),q=t(17384),B=t(9461),D=function(e){var n=e.tabId,t=e.widget,o=(e.parentSnapshot,e.showHints),a=e.isRepeatable,s=e.item,x=e.draggableId,m=e.saveItem,h=e.HintElement,g=(0,j.Z)(e,["tabId","widget","parentSnapshot","showHints","isRepeatable","item","draggableId","saveItem","HintElement"]),v=(0,k.useState)(!1),b=v[0],y=v[1],D=(0,k.useState)(null),O=D[0],z=D[1],V=(0,k.useState)({isOpen:!1}),L=V[0],P=V[1],J=function(e){z({widgetTypeName:e}),y(!1)},H=function(){z(null)},W=function(){P({isOpen:!1})},U=function(e){var n,t,o,a,c=e.id,d=e.label,u=l[e.widgetTypeName].create(d),f=(n={group:R.Fl.fromSM(s.value),fieldId:c,field:u},null!==(t=(i=a=structuredClone(n.group)).config)&&void 0!==t||(i.config={}),null!==(o=(r=a.config).fields)&&void 0!==o||(r.fields={}),a.config.fields[n.fieldId]=n.field,a);m({apiId:s.key,newKey:s.key,value:R.Fl.toSM(f)}),S.Xe.track({event:"field:added",id:c,name:d,type:u.type,isInAGroup:!0,contentType:(0,B.T)(window.location.pathname)})},$=function(e){var n=e.apiId,t=e.newKey,i=e.value,r=function(e){var n,t,i=structuredClone(e.group);if(!(null===(n=i.config)||void 0===n?void 0:n.fields)||!(null===(t=e.group.config)||void 0===t?void 0:t.fields))return i;for(var r in i.config.fields={},e.group.config.fields)r===e.previousFieldId?i.config.fields[e.newFieldId]=e.field:i.config.fields[r]=e.group.config.fields[r];return i}({group:R.Fl.fromSM(s.value),previousFieldId:n,newFieldId:t,field:i});m({apiId:s.key,newKey:s.key,value:R.Fl.toSM(r)})},G=function(e){if(!(0,_.uS)(e)){var n=e.source,t=e.destination;if(t){var i=n.index,r=t.index,o=function(e){var n,t=structuredClone(e.group);if(!(null===(n=t.config)||void 0===n?void 0:n.fields))return t;var i=Object.entries(t.config.fields),r=(0,u.Z)(i.splice(e.sourceIndex,1),1)[0];return i.splice(e.destinationIndex,0,r),t.config.fields=Object.fromEntries(i),t}({group:R.Fl.fromSM(s.value),sourceIndex:i,destinationIndex:r});(0,I.flushSync)(function(){m({apiId:s.key,newKey:s.key,value:R.Fl.toSM(o)})})}}},Y=function(e){var n,t,i,r,o=(n={group:R.Fl.fromSM(s.value),fieldId:e},null===(t=(r=structuredClone(n.group)).config)||void 0===t||null===(i=t.fields)||void 0===i||delete i[n.fieldId],r);m({apiId:s.key,newKey:s.key,value:R.Fl.toSM(o)})},K=function(e){P({isOpen:!0,field:e});var n=(0,u.Z)(e,2),t=n[0],i=n[1];S.Xe.track({event:"field:settings-opened",id:t,name:i.config.label,type:i.type,isInAGroup:!0,contentType:(0,B.T)(window.location.pathname)})};return(0,f.jsxs)(k.Fragment,{children:[(0,f.jsx)(E.Z,(0,d.Z)((0,c.Z)({item:s,widget:t,draggableId:x},g),{HintElement:h,CustomEditElements:[(0,f.jsx)(p.zx,{mr:2,variant:"buttons.darkSmall",onClick:function(){return y(!0)},children:"Add Field"},"custom-edit-element-".concat(s.key)),],children:(0,f.jsx)(p.xu,{sx:{ml:4},children:(0,f.jsx)(C.Z5,{onDragEnd:G,children:(0,f.jsx)(C.bK,{droppableId:"".concat(n,"-").concat(s.key,"-zone"),children:function(e){return(0,f.jsxs)("ul",(0,d.Z)((0,c.Z)({ref:e.innerRef},e.droppableProps),{children:[s.value.config.fields.map(function(e,n){var t=e.value,i=t.config,r=t.type,u=(0,N.t)(l,i,r);if(!u)return null;var p={item:e,index:n,widget:u,key:e.key,enterEditMode:K,deleteItem:Y,renderFieldAccessor:function(n){return"item".concat((0,q.Ti)(e.key))},draggableId:"group-".concat(s.key,"-").concat(e.key,"-").concat(n),testId:"list-item-group-".concat(s.key,"-").concat(e.key)},x=(0,f.jsx)(T.Z,{item:e,show:o,isRepeatable:a,renderHintBase:function(e){var n=e.item;return"item".concat((0,q.Ti)(n.key))},Widgets:l,typeName:u.CUSTOM_NAME||u.TYPE_NAME});return(0,f.jsx)(E.Z,(0,d.Z)((0,c.Z)({},p),{HintElement:x}))}),e.placeholder,O&&(0,f.jsx)(A.Z,(0,d.Z)((0,c.Z)({},O),{fields:s.value.config.fields||[],onSave:function(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];U.apply(void 0,(0,Z.Z)(n)),z(null)},onCancelNewField:H}))]}))}})})})})),(0,f.jsx)(w.Z,{data:{isOpen:b},close:function(){return y(!1)},onSelect:J,widgetsArray:M.Z}),(0,f.jsx)(F.Z,{data:L,close:W,onSave:$,fields:s.value.config.fields})]})},O={Meta:{icon:a.cC1,title:"Group",description:"A repeatable set of fields"},Form:y,FormFields:b,schema:s.object().shape({type:s.string().matches(/^Group$/,{excludeEmptyString:!0}).required(),config:s.object().shape({fields:s.array(),label:s.string(),placeholder:s.string(),repeat:s.boolean().optional()})}),create:function(e){return{type:"Group",config:{label:e,repeat:!0,fields:[]}}},CustomListItem:D,TYPE_NAME:"Group"}},13302:function(e,n,t){"use strict";t.d(n,{B9:function(){return s},Ss:function(){return d},uS:function(){return c},zg:function(){return u}});var i=t(98240),r=t(9849),o=t(65413),l=t(77495),a=t(77735),s=function(e,n){return e[n],(0,i.Z)(e,[n].map(r.Z))},c=function(e){return!e.destination||e.source.index===e.destination.index||e.source.droppableId!==e.destination.droppableId},d=function(e,n){return!e[n]&&(console.log('Could not find widget with type name "'.concat(n,'".')),!0)},u=function(e){return{TYPE_NAME:e,FormFields:a.J,schema:o.object().shape({type:o.string().test({name:"type",test:function(n){return n===e}}),config:(0,l.gc)(s(a.J,"id"))}),create:function(){return{type:e,config:(0,l.f7)(s(a.J,"id"))}}}}},9461:function(e,n,t){"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))}t.d(n,{T:function(){return i}})},23425:function(){},45158:function(){}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[136],{31314:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices/[lib]/[sliceName]/[variation]",function(){return t(54350)}])},25998:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var i=t(5632),r=t(56580),o=t(95200),a=function(e,n,t){var i,r=null===(i=(0,o.Sd)(e))||void 0===i?void 0:i.find(function(e){return e.name.replace(/\//g,"--")===n});return null==r?void 0:r.components.find(function(e){return e.model.name===t})},l=function(){var e=(0,i.useRouter)(),n=(0,r.v9)(function(n){return{slice:a(n,e.query.lib,e.query.sliceName)}}).slice;if(!n)return{};var t=n.model.variations.find(function(n){return n.id===e.query.variation});return t?{slice:n,variation:t}:{}}},54350:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return eR}});var i=t(52322),r=t(97729),o=t.n(r),a=t(5632),l=t(22710),s=t(62230),c=t(85244),u=t(99267),d=t(74217),f=t(2784),m=t(82770),v=t(50950),h=t(26921),p=t(90374),x=(0,f.createContext)(void 0);function y(e){var n=e.children,t=e.initialSlice,r=(0,a.useRouter)(),o=(0,f.useState)(t),y=o[0],g=o[1],b=(0,h.c)({errorMessage:"Failed to save slice. Check your browser's console for more information."}),j=b.actionQueueStatus,w=b.setNextAction,S=(0,p.Z)().saveSliceSuccess,C=(0,d.R9)(S),k=(0,v.g)().syncChanges,I=(0,f.useMemo)(function(){var e=r.query.variation,n=y.model.variations.find(function(n){return n.id===e});if(n)return n;throw Error("Variation not found")},[y,r]),T=(0,f.useCallback)(function(e){g(e),w((0,l.Z)(function(){var n,t,i,r,o;return(0,u.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,m.Ve)(e)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,m.pL)({libraryID:e.from,sliceID:e.model.id})];case 2:if(r=(i=n.sent()).errors,o=i.mocks,r.length>0)throw r;return C((0,c.Z)((0,s.Z)({},e),{mocks:o})),k(),[2]}})}))},[w,C,k]),E=(0,f.useMemo)(function(){return{actionQueueStatus:j,slice:y,setSlice:T,variation:I}},[j,y,T,I]);return(0,i.jsx)(x.Provider,{value:E,children:"function"==typeof n?n(E):n})}function g(){var e=(0,f.useContext)(x);if(!e)throw Error("SliceBuilderProvider not found");return e}var b=t(25998),j=t(22715),w=t(41730),S=t(47976),C=t(8564),k=t(18566),I=t(81038);function T(e){return E.apply(this,arguments)}function E(){return(E=(0,l.Z)(function(e){var n,t,i;return(0,u.__generator)(this,function(r){switch(r.label){case 0:return[4,I.j.customTypes.readCustomType({id:e})];case 1:if(t=(n=r.sent()).errors,i=n.model,t.length>0)throw t;return[2,i]}})})).apply(this,arguments)}var R=t(67445),Z=t(64722),A=t(20812),L=function(e){return(0,i.jsxs)("svg",(0,c.Z)((0,s.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:[(0,i.jsx)("path",{d:"M9.5 12L6 9.5L9.5 7V9.5V12Z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M6 9.5H11C14.3 9.5 17 12.2 17 15.5V17.5M6 9.5L9.5 12V9.5V7L6 9.5Z",stroke:"currentColor",strokeLinecap:"round"})]}))},N=function(){var e,n,t=(e=(0,Z.l)().source,n=(0,R.Ag)(e.query),void 0!==n&&(0,R.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(C.S,{children:(0,i.jsx)(f.Suspense,{children:(0,i.jsx)(j.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(_,{sourceCustomTypeId:t})})})}):null},_=function(e){var n,t=(n=e.sourceCustomTypeId,(0,k.QT)(T,[n])),r=(0,f.useState)(!0),o=r[0],l=r[1],s=(0,a.useRouter)();if(void 0===t||!o)return null;var c=t.format,u=t.id,d=R.cd[c].getBuilderPagePathname(u);return(0,i.jsxs)(j.hE,{density:"compact",color:"dark",children:[(0,i.jsxs)(j.zx,{onClick:function(){s.push(d)},renderStartIcon:function(){return(0,i.jsx)(L,{})},children:["Return to ",t.label]}),(0,i.jsx)(j.zx,{onClick:function(){l(!1)},renderStartIcon:function(){return(0,i.jsx)(A.T,{})}})]})},D=t(76478),V=t(56580),O=t(33710),F=t(76283),P=t(42189),z=t(63094),M=t(17036),K=function(e){var n=e.children,t=e.open,r=e.onClose;return(0,i.jsxs)(F.zs,{open:t,trigger:n,onClose:r,children:[(0,i.jsx)(F.Ev,{children:"Simulate your slices"}),(0,i.jsx)(F.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:z.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){m.Xe.track({event:"open-video-tutorials",video:z.Sn})}}),(0,i.jsx)(F.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(F.Rp,{children:"Got it"})]})},q=function(e){var n=e.disabled,t=(0,a.useRouter)(),r=(0,f.useRef)(null),o=(0,p.Z)().setSeenSimulatorToolTip,l=(0,V.v9)(function(e){return{hasSeenSimulatorTooltip:(0,M.bv)(e)}}).hasSeenSimulatorTooltip;(0,f.useEffect)(function(){var e=r.current;e&&!l&&setTimeout(function(){return O.Z.show(e)},5e3)},[l]);var s=function(){if(o(),r.current){var e=r.current;O.Z.hide(e)}};return(0,i.jsx)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:r,children:(0,i.jsx)(K,{open:!l,onClose:s,children:(0,i.jsx)(j.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){s(),window.open("".concat(t.asPath,"/simulator"),z.pq)},disabled:n,renderStartIcon:function(){return(0,i.jsx)(P.z,{color:j.TV.color.greyLight1,height:j.TV.size[24],style:{transform:"scale(calc(4 / 3))"},width:j.TV.size[24]})},children:"Simulate"})})})},B=t(88866),H=t(28316),X=t(28173),W=t(5479),G=t(11563),U=t(73393),Q=t(18645),Y=t(24244),J=t(23373),$=t(36195),ee=t(52586),en=[ee.Group,ee.StructuredText,ee.Image,ee.Link,ee.LinkToMedia,ee.ContentRelationship,ee.Select,ee.Boolean,ee.Date,ee.Timestamp,ee.Embed,ee.Number,ee.GeoPoint,ee.Color,ee.Text,],et=t(13302),ei=t(17384),er=t(9461),eo=function(){var e,n=g(),t=n.slice,r=n.setSlice,o=n.variation,a=(0,f.useState)(!1),l=a[0],s=a[1],c={eligible:(null==(e=(0,G.L)("slicemachine-groups-in-slices"))?void 0:e.value)==="on"},u=Boolean(o.items&&Object.keys(o.items).length>0),d=function(e){return function(n){if(c.eligible&&e===J.Rt.Items&&o.items&&Object.keys(o.items).length<=1){s(!0);return}var i=(0,W.AK)({slice:t,variationId:o.id,widgetArea:e,fieldId:n});r(i)}},v=function(e){return function(n){var i=n.apiId,a=n.newKey,l=n.value,s=(0,W.L4)({slice:t,variationId:o.id,widgetArea:e,previousFieldId:i,newFieldId:a,newField:l});r(s)}},h=function(e){return function(n){var i=n.id,a=n.label,l=n.widgetTypeName,s=en.find(function(e){return e.CUSTOM_NAME===l||e.TYPE_NAME===l});if(!s)throw Error("Unsupported Field Type: ".concat(l));var c=s.create(a);try{s.schema.validateSync(c,{stripUnknown:!1})}catch(u){throw Error('Model is invalid for widget "'.concat(c.type,'".'))}var d=(0,W.xS)({slice:t,variationId:o.id,widgetArea:e,newFieldId:i,newField:c.type===B.GroupFieldType?Y.Fl.fromSM(c):c});r(d),m.Xe.track({event:"field:added",id:i,name:a,type:c.type,isInAGroup:!1,contentType:(0,er.T)(window.location.pathname)})}},p=function(e){return function(n){if(!(0,et.uS)(n)){var i=n.source,a=n.destination;if(a){var l=(0,W.gR)({slice:t,variationId:o.id,widgetArea:e,sourceIndex:i.index,destinationIndex:a.index});(0,H.flushSync)(function(){return r(l)})}}}},x=function(){var e=(0,W.Oh)({slice:t,variationId:o.id});r(e),s(!1)};return(0,i.jsxs)(X.aV,{children:[(0,i.jsx)(Q.Z,{zoneType:"slice",tabId:void 0,title:"Fields",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:o.primary,EditModal:U.Z,widgetsArray:c.eligible?en:$.Z,onDeleteItem:d(J.Rt.Primary),onSave:v(J.Rt.Primary),onSaveNewField:h(J.Rt.Primary),onDragEnd:p(J.Rt.Primary),poolOfFieldsToCheck:o.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,ei.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,ei.Ti)(e))},testId:"static-zone-content",isRepeatableCustomType:void 0}),!c.eligible||u?(0,i.jsx)(Q.Z,{zoneType:"slice",tabId:void 0,isRepeatable:!0,title:"Repeatable Zone",dataTip:"The repeatable zone is for a group<br/>\n of fields that you want to be able to repeat an<br/>\n indeterminate number of times, like FAQs",widgetsArray:$.Z,fields:o.items,EditModal:U.Z,onDeleteItem:d(J.Rt.Items),onSave:v(J.Rt.Items),onSaveNewField:h(J.Rt.Items),onDragEnd:p(J.Rt.Items),poolOfFieldsToCheck:o.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,ei.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,ei.Ti)(e))},testId:"slice-repeatable-zone",isRepeatableCustomType:void 0}):null,(0,i.jsxs)(j.Vq,{size:"small",open:l,onOpenChange:function(e){return s(e)},children:[(0,i.jsx)(j.fK,{icon:"delete",title:"Delete field"}),(0,i.jsxs)(j.cZ,{children:[(0,i.jsxs)(j.xu,{padding:24,gap:12,flexDirection:"column",children:[(0,i.jsxs)("strong",{children:["This action will permanently remove the repeatable zone from the"," ",t.model.name," slice."]}),(0,i.jsx)("div",{children:"To reimplement repeatable fields later, use a group field instead of the repeatable zone."})]}),(0,i.jsx)(j.kX,{ok:{text:"Delete",color:"tomato",onClick:function(){return x()}},cancel:{text:"Cancel"}})]})]})]})},ea=t(88932),el=t(56319),es=t(49451),ec=t(47731);function eu(){return(eu=(0,l.Z)(function(e){var n,t,i,r,o,a,l,d,f,v,h,p;return(0,u.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),[4,(0,m.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,m.Xi)({libraryID:e.component.from,sliceID:e.component.model.id,variationID:e.variation.id})];case 2:if((r=n.sent().errors).length>0)throw r;return[4,(0,m.X$)(e.component.from,e.component.model.id)];case 3:if(a=(o=n.sent()).slice,(l=o.errors).length>0)throw l;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,m.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return d=n.sent().mocks,f=es.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:a.name,variationId:a.variations[0].id}),[4,e.router.replace(f)];case 5:return n.sent(),v=(0,c.Z)((0,s.Z)({},e.component),{model:a,mocks:d}),e.saveSliceSuccess(v),[2,v];case 6:throw h=n.sent(),p="Could not delete variation `".concat(e.variation.name,"`"),console.error(p,h),ea.Am.error(p),h;case 7:return[2]}})})).apply(this,arguments)}var ed=function(e){var n=e.isOpen,t=e.onClose,r=e.slice,o=e.variation,s=(0,a.useRouter)(),c=(0,f.useState)(!1),d=c[0],m=c[1],v=(0,p.Z)().saveSliceSuccess,h=g().setSlice;return(0,i.jsxs)(j.Vq,{open:n,onOpenChange:function(e){return!e&&t()},size:{width:448,height:"auto"},children:[(0,i.jsx)(j.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(j.cZ,{children:(0,i.jsxs)(j.xu,{flexDirection:"column",children:[(0,i.jsxs)(j.xv,{color:"grey11",sx:{marginBlock:16,marginInline:16},children:["This action will remove the variation from the slice model and delete associated files. When you push your changes, the variation will disappear from your repository. This update will"," ",(0,i.jsx)(ef,{children:"not"})," affect your documents until you ",(0,i.jsx)(ef,{children:"edit"})," ","them manually."]}),(0,i.jsx)(j.kX,{ok:{text:"Delete",color:"tomato",onClick:function(){o&&(0,l.Z)(function(){var e;return(0,u.__generator)(this,function(e){switch(e.label){case 0:m(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,function(e){return eu.apply(this,arguments)}({component:r,router:s,saveSliceSuccess:v,variation:o})];case 2:return h(e.sent()),[3,4];case 3:return e.sent(),[3,4];case 4:return m(!1),t(),[2]}})})()},loading:d},cancel:{text:"Cancel"},size:"medium"})]})})]})},ef=function(e){return(0,i.jsx)(j.xv,(0,c.Z)((0,s.Z)({},e),{color:"inherit",component:"span",variant:"bold"}))},em=t(63397);function ev(){return(ev=(0,l.Z)(function(e){var n,t,i,r,o,a,l,d,f,v,h;return(0,u.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,(0,m.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,m.eH)(e.component,(0,c.Z)((0,s.Z)({},e.variation),{name:e.variationName}))];case 2:if((r=n.sent().errors).length>0)throw r;return[4,(0,m.X$)(e.component.from,e.component.model.id)];case 3:if(a=(o=n.sent()).slice,(l=o.errors).length>0)throw l;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,m.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return d=n.sent().mocks,f=(0,c.Z)((0,s.Z)({},e.component),{model:a,mocks:d}),e.saveSliceSuccess(f),[2,f];case 5:throw v=n.sent(),h="Could not rename variation `".concat(e.variation.name,"`"),console.error(h,v),ea.Am.error(h),v;case 6:return[2]}})})).apply(this,arguments)}var eh=t(83576),ep=t.n(eh),ex=function(e){var n,t,r=e.isOpen,o=e.onClose,a=e.slice,s=e.variation,c=(0,f.useState)(!1),d=c[0],m=c[1],v=g().setSlice,h=(0,p.Z)().saveSliceSuccess;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(j.Vq,{open:r,onOpenChange:function(e){return!e&&o()},size:{width:448,height:"auto"},children:[(0,i.jsx)(j.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(j.cZ,{children:(0,i.jsx)(em.J9,{validateOnMount:!0,initialValues:{variationName:null!==(n=null==s?void 0:s.name)&&void 0!==n?n:""},validate:function(e){if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:(t=(0,l.Z)(function(e){var n;return(0,u.__generator)(this,function(n){switch(n.label){case 0:if(!s)return[2];m(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(e){return ev.apply(this,arguments)}({component:a,saveSliceSuccess:h,variation:s,variationName:e.variationName.trim()})];case 2:return v(n.sent()),[3,4];case 3:return n.sent(),[3,4];case 4:return m(!1),o(),[2]}})}),function(e){return t.apply(this,arguments)}),children:function(e){return(0,i.jsxs)("form",{children:[(0,i.jsxs)(j.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(j.xv,{variant:"normal",color:"grey11",children:"This action will rename the variation in the slice model. When you push your changes, the variation will be renamed in your repository."}),(0,i.jsxs)(j.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ep().label,children:[(0,i.jsx)(j.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(j.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(j.yt,{placeholder:"Variation name",error:"string"==typeof e.errors.variationName,value:e.values.variationName,onValueChange:function(n){e.setFieldValue("variationName",n.slice(0,30))}})]})]}),(0,i.jsx)(j.kX,{ok:{text:"Rename",onClick:function(){e.submitForm()},loading:d,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})}})})]})})},ey=t(12773),eg=t(76635),eb=t(36131),ej=t(75289),ew=t(98898),eS=function(e){var n=e.children,t=e.FooterContent,r=e.HeaderContent,o=e.close,a=e.sx,l=e.headerSx,c=void 0===l?{}:l;return(0,i.jsx)(ew.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,s.Z)({border:"none"},void 0===a?{}:a),Header:function(e){var n=e.radius;return(0,i.jsxs)(ej.kC,{sx:(0,s.Z)({p:3,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)}},c),children:[r,o?(0,i.jsx)(ej.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(ej.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(ej.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},eC=t(83399),ek=function(e){var n=e.msg;return(0,i.jsx)(ej.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},eI=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,o=e.initialVariation,a=e.variations,d=function(e){var n=e.id,t=e.name,i=e.origin,r=n&&n.length?null:{id:"Required!"},o=a.find(function(e){return e.id===n})?{id:"This id already exists!"}:null,l=t&&t.length?null:{name:"Required!"},c=i.value.length&&a.find(function(e){return e.id===i.value})?null:{id:"You must select an existing variation!"},u=n&&n.length&&!/^[A-Za-z0-9]+([A-Za-z0-9]+)*$/.exec(n)&&{id:"No special characters allowed"};return(0,s.Z)({},r,o,l,c,u)},m=function(e){C((0,eg.camelCase)(e))},v=function(e){Z(e),I&&m(e)},h=function(e){T(!1),m(e)},p=function(){x(),t()},x=function(){C(""),Z(""),b({}),T(!0),N({value:o.id,label:o.name})},y=(0,f.useState)({}),g=y[0],b=y[1],w=(0,f.useState)(""),S=w[0],C=w[1],k=(0,f.useState)(!0),I=k[0],T=k[1],E=(0,f.useState)(""),R=E[0],Z=E[1],A=(0,f.useState)({value:o.id,label:o.name}),L=A[0],N=A[1],_=(0,f.useState)(!1),D=_[0],V=_[1];function O(){return F.apply(this,arguments)}function F(){return(F=(0,l.Z)(function(){var e,n;return(0,u.__generator)(this,function(t){switch(t.label){case 0:if(!Object.keys(e=d({id:S,name:R,origin:L})).length)return[3,1];return b(e),[3,3];case 1:if(!(n=a.find(function(e){return e.id===L.value})))return[3,3];return V(!0),[4,r(S,R,n)];case 2:t.sent(),V(!1),p(),t.label=3;case 3:return[2]}})})).apply(this,arguments)}return(0,f.useEffect)(function(){x()},[o,n]),(0,i.jsx)(eC.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return p()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(em.J9,{initialValues:{id:S,name:R,origin:L},onSubmit:O,children:(0,i.jsx)(em.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),O())},children:(0,i.jsx)(j.xu,{children:(0,i.jsxs)(eS,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(ej.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(j.xu,{gap:16,alignItems:"center",children:[(0,i.jsx)(j.zx,{onClick:p,color:"grey",children:"Cancel"}),(0,i.jsx)(j.zx,{loading:D,children:"Submit"})]}),close:p,children:[(0,i.jsxs)(j.xu,{flexDirection:"column",padding:{block:16},children:[(0,i.jsxs)(ej.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",g.name?(0,i.jsx)(ek,{msg:g.name}):""]}),(0,i.jsx)(em.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:ej.II,maxLength:30,value:R,onChange:function(e){return v(e.currentTarget.value)}}),(0,i.jsx)(ej.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(j.xu,{flexDirection:"column",padding:{bottom:16},children:[(0,i.jsxs)(ej.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",g.id?(0,i.jsx)(ek,{msg:g.id}):""]}),(0,i.jsx)(em.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:ej.II,maxLength:30,value:S,onChange:function(e){return h(e.currentTarget.value)}}),(0,i.jsx)(ej.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(j.xu,{flexDirection:"column",padding:{bottom:8},children:[(0,i.jsx)(ej.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(eb.ZP,{name:"origin",options:a.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&N(e)},defaultValue:L,maxMenuHeight:150,theme:function(e){return(0,c.Z)((0,s.Z)({},e),{colors:(0,c.Z)((0,s.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},eT=function(){var e,n=g(),t=n.slice,r=n.variation,o=n.setSlice,s=(0,f.useState)(),c=s[0],d=s[1],v=(0,ec.H)(),h=v.modalPayload,x=h.sliceFilterFn,y=h.defaultVariationSelector,b=h.onUploadSuccess,w=(0,a.useRouter)(),S=(0,p.Z)().saveSliceSuccess;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(j.xu,{flexDirection:"column",gap:16,children:[t.model.variations.map(function(e){return(0,i.jsx)(el.b,{action:{type:"menu",onRename:function(){d({type:"RENAME_VARIATION",variation:e})},onRemove:function(){d({type:"DELETE_VARIATION",variation:e})},removeDisabled:t.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:function(){v.onOpenModal({sliceFilterFn:function(e){return e},defaultVariationSelector:{sliceID:t.model.id,variationID:e.id},onUploadSuccess:function(e){o(e)}})},replace:!0,selected:e.id===r.id,slice:t,variant:"outlined",variationId:e.id},e.id)}),(0,i.jsx)("div",{style:{bottom:j.rS.space[0],marginBottom:"-".concat(j.rS.space[16]),position:"sticky"},children:(0,i.jsxs)(j.xu,{backgroundColor:"grey2",flexDirection:"column",padding:{bottom:40,inline:24},children:[(0,i.jsx)(j.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(j.zx,{color:"grey",onClick:function(){d({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},children:"Add a new variation"})]})})]}),(0,i.jsx)(ey.Z,{slices:x([t]),defaultVariationSelector:y,onUploadSuccess:b}),(0,i.jsx)(ex,{isOpen:(null==c?void 0:c.type)==="RENAME_VARIATION",onClose:function(){d(void 0)},slice:t,variation:null==c?void 0:c.variation}),(0,i.jsx)(ed,{isOpen:(null==c?void 0:c.type)==="DELETE_VARIATION",onClose:function(){d(void 0)},slice:t,variation:null==c?void 0:c.variation}),(0,i.jsx)(eI,{initialVariation:r,isOpen:(null==c?void 0:c.type)==="ADD_VARIATION",onClose:function(){d(void 0)},onSubmit:(e=(0,l.Z)(function(e,n,i){var r,a,l,s,c,d;return(0,u.__generator)(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),a=(r=(0,W.Kp)({slice:t,id:e,name:n,copiedVariation:i})).slice,l=r.variation,[4,(0,m.Ve)(a)];case 1:return u.sent(),S(a),o(a),s=es.Y.getBuilderPagePathname({libraryName:a.href,sliceName:a.model.name,variationId:l.id}),w.replace(s),[3,3];case 2:return c=u.sent(),d="Could not add variation `".concat(n,"`"),console.error(d,c),ea.Am.error(d),[3,3];case 3:return[2]}})}),function(n,t,i){return e.apply(this,arguments)}),variations:t.model.variations})]})},eE=function(){var e=g(),n=e.slice,t=e.actionQueueStatus;return(0,i.jsxs)(D.LN,{children:[(0,i.jsxs)(D.wd,{children:[(0,i.jsx)(D.Xq,{url:"/slices"}),(0,i.jsxs)(D.Cx,{children:[(0,i.jsx)(w.g,{children:"Slices"}),(0,i.jsx)(w.g,{active:!0,children:n.model.name})]}),(0,i.jsxs)(D.K2,{children:[(0,i.jsx)(S.X,{status:t}),(0,i.jsx)(q,{disabled:"done"!==t})]})]}),(0,i.jsxs)(D.RN,{children:[(0,i.jsxs)(j.xu,{alignItems:"flex-start",display:"grid",gap:16,gridTemplateColumns:"320px 1fr",children:[(0,i.jsx)(eT,{}),(0,i.jsx)(eo,{})]}),(0,i.jsx)(N,{})]})]})};function eR(){var e=(0,a.useRouter)(),n=(0,b.Z)(),t=n.slice,r=n.variation;return void 0===t||void 0===r?(e.replace("/"),null):(0,i.jsx)(y,{initialSlice:t,children:function(e){var n=e.slice;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{children:(0,i.jsxs)("title",{children:[n.model.name," - Slice Machine"]})}),(0,i.jsx)(eE,{})]})}})}},83576:function(e){e.exports={label:"RenameVariationModal_label__SLsVs"}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return b}});var i=t(2784);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}t(52322);var o=["shift","alt","meta","mod","ctrl"],a={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function l(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function s(e,n){return void 0===n&&(n=","),e.split(n)}function c(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return l(e)});return r({},{alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod")},{keys:a.filter(function(e){return!o.includes(e)}),description:t})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([l(e.key),l(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([l(e.key),l(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){u.clear()});var u=new Set;function d(e){return Array.isArray(e)}function f(e){var n=Array.isArray(e)?e:[e];u.has("meta")&&u.forEach(function(e){var n;return!o.includes(e)&&u.delete(e.toLowerCase())}),n.forEach(function(e){return u.add(e.toLowerCase())})}function m(e){var n=Array.isArray(e)?e:[e];"meta"===e?u.clear():n.forEach(function(e){return u.delete(e.toLowerCase())})}function v(e,n){var t=e.target;void 0===n&&(n=!1);var i=t&&t.tagName;return d(n)?Boolean(i&&n&&n.some(function(e){return e.toLowerCase()===i.toLowerCase()})):Boolean(i&&n&&!0===n)}var h=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,s=n.mod,c=n.shift,f=n.ctrl,m=n.keys,v=e.key,h=e.code,p=e.ctrlKey,x=e.metaKey,y=e.shiftKey,g=e.altKey,b=l(h),j=v.toLowerCase();if(!t){if(!g===o&&"alt"!==j||!y===c&&"shift"!==j)return!1;if(s){if(!x&&!p)return!1}else if(!x===a&&"meta"!==j&&"os"!==j||!p===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(b)))||(m?(void 0===r&&(r=","),(d(i=m)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},p=(0,i.createContext)(void 0),x=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function b(e,n,t,r){var o,a,u=(0,i.useRef)(null),b=(0,i.useRef)(!1),j=t instanceof Array?r instanceof Array?void 0:r:t,w=d(e)?e.join(null==j?void 0:j.splitKey):e,S=t instanceof Array?t:r instanceof Array?r:void 0,C=(0,i.useCallback)(n,null!=S?S:[]),k=(0,i.useRef)(C);S?k.current=C:k.current=n;var I=(!function e(n,t){return n&&t&&"object"==typeof n&&"object"==typeof t?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).reduce(function(i,r){return i&&e(n[r],t[r])},!0):n===t}((a=(0,i.useRef)(void 0)).current,j)&&(a.current=j),a.current),T=(0,i.useContext)(x).enabledScopes,E=(0,i.useContext)(p);return g(function(){if((null==I?void 0:I.enabled)!==!1&&(e=T,n=null==I?void 0:I.scopes,0===e.length&&n?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!n||e.some(function(e){return n.includes(e)})||e.includes("*")))){var e,n,t=function(e,n){var t,i;if(void 0===n&&(n=!1),!(v(e,["input","textarea","select"])&&!v(e,null==I?void 0:I.enableOnFormTags)||null!=I&&null!=I.ignoreEventWhen&&I.ignoreEventWhen(e))){if(null!==u.current&&document.activeElement!==u.current&&!u.current.contains(document.activeElement)){y(e);return}(null==(t=e.target)||!t.isContentEditable||null!=I&&I.enableOnContentEditable)&&s(w,null==I?void 0:I.splitKey).forEach(function(t){var i,r,o,a,l,s,u,d=c(t,null==I?void 0:I.combinationKey);if(h(e,d,null==I?void 0:I.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&b.current)return;if(i=e,r=d,("function"==typeof(o=null==I?void 0:I.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,l=d,"function"==typeof(s=null==I?void 0:I.enabled)?!s(a,l):!0!==s&&void 0!==s){y(e);return}k.current(e,d),n||(b.current=!0)}})}},i=function(e){void 0!==e.key&&(f(l(e.code)),((null==I?void 0:I.keydown)===void 0&&(null==I?void 0:I.keyup)!==!0||null!=I&&I.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(l(e.code)),b.current=!1,null!=I&&I.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),E&&s(w,null==I?void 0:I.splitKey).forEach(function(e){return E.addHotkey(c(e,null==I?void 0:I.combinationKey,null==I?void 0:I.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),E&&s(w,null==I?void 0:I.splitKey).forEach(function(e){return E.removeHotkey(c(e,null==I?void 0:I.combinationKey,null==I?void 0:I.description))})}}},[w,I,T]),u}}},function(e){e.O(0,[898,789,917,525,461,139,183,50,543,696,614,96,90,774,888,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- ._1k08lzu3{height:calc(var(--_7j49md4m) - var(--_7j49mdh))}._1k08lzu5{height:calc(var(--_7j49md4b) - var(--_7j49md47));width:calc(var(--_7j49md4b) - var(--_7j49md47))}._1k08lzu7{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d);height:calc(var(--_7j49md4m) - var(--_7j49mdh));-ms-overflow-style:none;scrollbar-width:none}._1k08lzu7::-webkit-scrollbar{display:none}._1k08lzu3+._1k08lzu6>._1k08lzu7{padding-top:var(--_7j49mdh)}._1k08lzu8:last-child:before,:not(:is(:focus,:hover,[data-state=active]))+._1k08lzu8:before{content:"";background-color:var(--_7j49md1e);bottom:var(--_7j49md53);height:var(--_7j49md4i);left:calc(-1 * var(--_7j49md4z));position:absolute;width:var(--_7j49mdh)}._1k08lzu9{max-width:256px}._1k08lzu9[data-state=active]{color:var(--_7j49md1j)}._1k08lzu9:is(:focus,:hover,[data-state=active]):before{content:"";background-color:var(--_7j49md19);border-color:var(--_7j49md1d);border-top-left-radius:var(--_7j49md7);border-top-right-radius:var(--_7j49md7);border-style:var(--_7j49mdf) var(--_7j49mdf) var(--_7j49mdd);border-width:var(--_7j49mdh);box-sizing:border-box;height:calc(var(--_7j49md4s) + var(--_7j49mdh));left:calc(-1 * var(--_7j49mdh));position:absolute;top:calc(-1 * var(--_7j49mdh));width:calc(var(--_7j49md4s) + var(--_7j49mdh))}._1k08lzub{margin-right:calc(-1 * var(--_7j49md53))}:is(:focus,:hover,[data-state=active])>._1k08lzub{visibility:visible}._1k08lzub:has(>[data-state=open]){visibility:visible}._1k08lzuc{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d),0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1a)}._1k08lzud[data-state=inactive]{display:none}:is(._1k08lzu2,._1k08lzud)>._2a96i71{border-radius:var(--_7j49md3);border-style:var(--_7j49mdd)}._2a96i72:last-child{border-bottom-color:var(--_7j49md3m)}._1k08lzud>._2a96i71>._2a96i73:not(:first-child){margin-top:var(--_7j49md56)}.BlankSlate_column__ysDb2{all:unset;box-sizing:border-box;display:flex;flex-direction:column}.BlankSlate_root__DJ7wC{max-width:498px;min-height:400px;animation:BlankSlate_fadeIn__KMuKu ease-in-out 300;border-color:var(--grey6);border-radius:6px;border-style:solid;border-width:1px;overflow:hidden;background-color:var(--light-grey1)}.BlankSlate_withBackground___V5y5{width:100%;max-width:100%;height:100%;text-align:center;background-size:cover;background-color:transparent;border-radius:0;border-style:none}.BlankSlate_image__rOe9w{border-bottom:1px solid var(--grey6);overflow:hidden}.BlankSlate_content__wmOAI{padding:32px}.BlankSlate_withBackground___V5y5 .BlankSlate_content__wmOAI{padding:64px}.BlankSlate_title__5oTre{font-size:18px;font-weight:600;line-height:32px}.BlankSlate_desc__f6ZWf{font-weight:400;line-height:24px}.BlankSlate_withBackground___V5y5 .BlankSlate_desc__f6ZWf{max-width:464px;align-self:center}.BlankSlate_actions__6zYZr{all:unset;align-items:center;box-sizing:border-box;display:flex;gap:16px;margin-top:16px}.BlankSlate_withBackground___V5y5 .BlankSlate_actions__6zYZr{justify-content:center}.kedahr2{height:240px}.kedahr3{height:320px}.kedahr6:focus-visible{box-shadow:0 0 0 4px rgba(123,101,220,.1)}.kedahr6[data-disabled]{opacity:var(--_7j49md42)}.kedahr6:not([data-disabled]){cursor:var(--_7j49md3q)}.kedahr7{order:0}.kedahr4>.kedahr7{padding:calc(var(--_7j49md58) - var(--_7j49mdh))}.kedahr5>.kedahr7{background-color:var(--_7j49md1a);margin-inline:calc(var(--_7j49md56) - var(--_7j49mdh));margin-top:calc(var(--_7j49md56) - var(--_7j49mdh));padding:var(--_7j49md56)}.kedahr9:not([src]){visibility:hidden}.kedahra:before{content:"";background-color:var(--_7j49md1j);inset:var(--_7j49md4y);opacity:var(--_7j49md40);position:absolute}.kedahr6:focus-visible .kedahra,.kedahr6:not([data-disabled]) .kedahr7:hover>.kedahra{visibility:visible}.kedahr6:not([data-disabled]) .kedahra:has(:focus-visible){visibility:visible}.kedahr4>.kedahrb{background-color:var(--_7j49md18)}.kedahr4>.kedahrb:not(:first-child){border-top-color:var(--_7j49md1d);border-top-style:inherit;border-top-width:inherit}.kedahrc{order:1}.kedahr4>.kedahrc{padding-left:calc(var(--_7j49md55) - var(--_7j49mdh));padding-right:calc(var(--_7j49md53) - var(--_7j49mdh))}.kedahr5>.kedahrc{padding-inline:calc(var(--_7j49md56) - var(--_7j49mdh))}.kedahrd{order:2}.kedahr4>.kedahrd{padding-inline:calc(var(--_7j49md55) - var(--_7j49mdh))}.kedahr5>.kedahrd{padding-inline:calc(var(--_7j49md56) - var(--_7j49mdh))}.kedahre{margin-bottom:calc((1.5rem - 1rem) / 2)}.kedahrf{background-color:#ebe7fe;color:#5746af}.ConvertLegacySliceButton_scrollArea__gW7L4{width:448px;height:100%;display:flex;gap:8px;padding-inline:16px;padding-block:16px}.ConvertLegacySliceButton_label__yP2Pt{display:inline-flex;align-items:center;gap:4px}.ContentTabs_flex__kAimf{all:unset;display:flex}.ContentTabs_column__x5QZL{flex-direction:column}.ContentTabs_root__GPtve{background-color:var(--grey1);min-height:0}.ContentTabs_list__XarTi{border-bottom:1px solid var(--grey5);padding-inline:16px}.ContentTabs_trigger__8hs6H{color:var(--grey11);cursor:pointer;padding-block:8px}.ContentTabs_trigger__8hs6H:not(:last-child){margin-right:16px}.ContentTabs_trigger__8hs6H[data-state=active]{box-shadow:inset 0 -1px 0 0 currentColor,0 1px 0 0 currentColor;color:var(--purple9)}.ContentTabs_triggerText__ka3DD{line-height:32px}.ContentTabs_content__mMr1s{min-height:0;outline:none;flex:1 1}.ContentTabs_content__mMr1s[data-state=inactive]{display:none}.ContentTabs_scrollArea__ZBVHa{padding:16px}.CodeBlock_block__ljak4{all:unset;box-sizing:border-box;font-family:var(--font-family-body)}.CodeBlock_blockWithDisplayRevert__zM3Ns{display:revert}.CodeBlock_root__3ZYFL{border-width:1px;border-radius:6px;border-style:solid;border-color:var(--grey6)}.CodeBlock_header__kLT1f{border-top-right-radius:4px;border-top-left-radius:4px;background-color:var(--grey2);border-bottom:1px solid var(--grey6);padding-block:4px;padding-right:4px}.CodeBlock_fileInfo__ocLpL,.CodeBlock_header__kLT1f{display:flex;align-items:center;justify-content:space-between}.CodeBlock_fileName__jmuEV{font-size:calc(14rem / 16);line-height:calc(32rem / 16)}._3uvawd0{grid-area:content;overflow:hidden}
@@ -1 +0,0 @@
1
- ._1k08lzu3{height:calc(var(--_7j49md4m) - var(--_7j49mdh))}._1k08lzu5{height:calc(var(--_7j49md4b) - var(--_7j49md47));width:calc(var(--_7j49md4b) - var(--_7j49md47))}._1k08lzu7{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d);height:calc(var(--_7j49md4m) - var(--_7j49mdh));-ms-overflow-style:none;scrollbar-width:none}._1k08lzu7::-webkit-scrollbar{display:none}._1k08lzu3+._1k08lzu6>._1k08lzu7{padding-top:var(--_7j49mdh)}._1k08lzu8:last-child:before,:not(:is(:focus,:hover,[data-state=active]))+._1k08lzu8:before{content:"";background-color:var(--_7j49md1e);bottom:var(--_7j49md53);height:var(--_7j49md4i);left:calc(-1 * var(--_7j49md4z));position:absolute;width:var(--_7j49mdh)}._1k08lzu9{max-width:256px}._1k08lzu9[data-state=active]{color:var(--_7j49md1j)}._1k08lzu9:is(:focus,:hover,[data-state=active]):before{content:"";background-color:var(--_7j49md19);border-color:var(--_7j49md1d);border-top-left-radius:var(--_7j49md7);border-top-right-radius:var(--_7j49md7);border-style:var(--_7j49mdf) var(--_7j49mdf) var(--_7j49mdd);border-width:var(--_7j49mdh);box-sizing:border-box;height:calc(var(--_7j49md4s) + var(--_7j49mdh));left:calc(-1 * var(--_7j49mdh));position:absolute;top:calc(-1 * var(--_7j49mdh));width:calc(var(--_7j49md4s) + var(--_7j49mdh))}._1k08lzub{margin-right:calc(-1 * var(--_7j49md53))}:is(:focus,:hover,[data-state=active])>._1k08lzub{visibility:visible}._1k08lzub:has(>[data-state=open]){visibility:visible}._1k08lzuc{box-shadow:inset 0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1d),0 calc(-1 * var(--_7j49mdh)) 0 0 var(--_7j49md1a)}._1k08lzud[data-state=inactive]{display:none}:is(._1k08lzu2,._1k08lzud)>._2a96i71{border-radius:var(--_7j49md3);border-style:var(--_7j49mdd)}._2a96i72:last-child{border-bottom-color:var(--_7j49md3m)}._1k08lzud>._2a96i71>._2a96i73:not(:first-child){margin-top:var(--_7j49md56)}.kedahr2{height:240px}.kedahr3{height:320px}.kedahr6:focus-visible{box-shadow:0 0 0 4px rgba(123,101,220,.1)}.kedahr6[data-disabled]{opacity:var(--_7j49md42)}.kedahr6:not([data-disabled]){cursor:var(--_7j49md3q)}.kedahr7{order:0}.kedahr4>.kedahr7{padding:calc(var(--_7j49md58) - var(--_7j49mdh))}.kedahr5>.kedahr7{background-color:var(--_7j49md1a);margin-inline:calc(var(--_7j49md56) - var(--_7j49mdh));margin-top:calc(var(--_7j49md56) - var(--_7j49mdh));padding:var(--_7j49md56)}.kedahr9:not([src]){visibility:hidden}.kedahra:before{content:"";background-color:var(--_7j49md1j);inset:var(--_7j49md4y);opacity:var(--_7j49md40);position:absolute}.kedahr6:focus-visible .kedahra,.kedahr6:not([data-disabled]) .kedahr7:hover>.kedahra{visibility:visible}.kedahr6:not([data-disabled]) .kedahra:has(:focus-visible){visibility:visible}.kedahr4>.kedahrb{background-color:var(--_7j49md18)}.kedahr4>.kedahrb:not(:first-child){border-top-color:var(--_7j49md1d);border-top-style:inherit;border-top-width:inherit}.kedahrc{order:1}.kedahr4>.kedahrc{padding-left:calc(var(--_7j49md55) - var(--_7j49mdh));padding-right:calc(var(--_7j49md53) - var(--_7j49mdh))}.kedahr5>.kedahrc{padding-inline:calc(var(--_7j49md56) - var(--_7j49mdh))}.kedahrd{order:2}.kedahr4>.kedahrd{padding-inline:calc(var(--_7j49md55) - var(--_7j49mdh))}.kedahr5>.kedahrd{padding-inline:calc(var(--_7j49md56) - var(--_7j49mdh))}.kedahre{margin-bottom:calc((1.5rem - 1rem) / 2)}.kedahrf{background-color:#ebe7fe;color:#5746af}.RenameVariationModal_label__SLsVs{display:inline-flex;align-items:center;gap:4px}.Kbd_root__nBos2{background-color:var(--grey2);border-color:var(--grey6);border-radius:3px;border-style:solid;border-width:1px;color:var(--grey11);padding-inline:4px}
@@ -1,25 +0,0 @@
1
- import { colors, sprinkles } from "@prismicio/editor-ui";
2
- import { style } from "@vanilla-extract/css";
3
-
4
- const reset = sprinkles({
5
- all: "unset",
6
- boxSizing: "border-box",
7
- display: "revert",
8
- fontFamily: "body",
9
- });
10
-
11
- export const container = style([
12
- reset,
13
- sprinkles({
14
- backgroundColor: colors.grey1,
15
- borderRadius: 6,
16
- boxShadow: 3,
17
- }),
18
- ]);
19
-
20
- export const arrow = style([
21
- reset,
22
- sprinkles({
23
- fill: colors.grey1,
24
- }),
25
- ]);
@@ -1,12 +0,0 @@
1
- import { sprinkles } from "@prismicio/editor-ui";
2
- import { style } from "@vanilla-extract/css";
3
-
4
- export const content = style([
5
- sprinkles({
6
- display: "flex",
7
- flexDirection: "column",
8
- minHeight: 0,
9
- gap: 12,
10
- }),
11
- { gridArea: "content", overflow: "hidden" },
12
- ]);
@@ -1,13 +0,0 @@
1
- import { colors, sprinkles } from "@prismicio/editor-ui";
2
-
3
- export const section = sprinkles({
4
- paddingBottom: 16,
5
- });
6
-
7
- export const inlineCode = sprinkles({
8
- fontFamily: "code",
9
- backgroundColor: colors.grey2,
10
- borderRadius: 6,
11
- paddingBlock: 2,
12
- paddingInline: 4,
13
- });
@@ -1,33 +0,0 @@
1
- import { Button } from "@prismicio/editor-ui";
2
- import { Box, Heading, Text } from "theme-ui";
3
-
4
- const ZoneEmptyState = ({
5
- onEnterSelectMode,
6
- zoneName,
7
- }: {
8
- // eslint-disable-next-line @typescript-eslint/ban-types
9
- onEnterSelectMode: Function;
10
- zoneName: string;
11
- }) => (
12
- <Box sx={{ textAlign: "center", my: 4 }}>
13
- <Heading as="h5">Add a new field here</Heading>
14
- <Box sx={{ my: 2 }}>
15
- <Text sx={{ color: "textClear" }}>
16
- Fields are inputs for content (e.g. text, images, links).
17
- </Text>
18
- </Box>
19
- <Box sx={{ display: "flex", justifyContent: "center", marginTop: 16 }}>
20
- <Button
21
- color="grey"
22
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
23
- onClick={() => onEnterSelectMode()}
24
- data-testid={`add-${zoneName}-field`}
25
- startIcon="add"
26
- >
27
- Add a new field
28
- </Button>
29
- </Box>
30
- </Box>
31
- );
32
-
33
- export default ZoneEmptyState;