slice-machine-ui 1.23.1-beta.2 → 1.23.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CustomTypeTable/changesPage.tsx +1 -0
- package/components/DeleteDocumentsDrawer/HardDeleteDocumentsDrawer.tsx +11 -23
- package/components/DeleteDocumentsDrawer/SoftDeleteDocumentsDrawer.tsx +11 -23
- package/components/DeleteDocumentsDrawer/index.tsx +0 -1
- package/components/SliceMachineDrawer/index.tsx +4 -6
- package/out/404.html +1 -1
- package/out/_next/static/{8aiH3LjdI_Vj38RRmPnNx → c66ozmNEqPsp5qxNPQX7V}/_buildManifest.js +1 -1
- package/out/_next/static/chunks/25-37d6fa7f064be04b.js +1 -0
- package/out/_next/static/chunks/{727-15cf3f2fea9a37e5.js → 727-2016e98f80ea6a62.js} +1 -1
- package/out/_next/static/chunks/{904-ccd8ca3368ce29fc.js → 904-4c4d0a2183ae9a27.js} +1 -1
- package/out/_next/static/chunks/pages/{_app-46cdcb7304fa805f.js → _app-d528dd2b96dccb97.js} +2 -2
- package/out/_next/static/chunks/pages/{changelog-68d115a14f1423d7.js → changelog-afd18276fe018b24.js} +1 -1
- package/out/_next/static/chunks/pages/changes-898f58035cfafe03.js +1 -0
- package/out/_next/static/chunks/pages/{labs-526bb7d60a1b90f4.js → labs-ee206005948f8e87.js} +1 -1
- package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/{[variation]-73dd999915509965.js → [variation]-b2a9d773ce5d7739.js} +1 -1
- package/out/_next/static/chunks/pages/{slices-7b09cb5130c63bb3.js → slices-e9c70c082ca3e3f9.js} +1 -1
- package/out/changelog.html +1 -1
- package/out/changes.html +1 -1
- package/out/custom-types/[customTypeId].html +1 -1
- package/out/custom-types.html +1 -1
- package/out/index.html +1 -1
- package/out/labs.html +1 -1
- package/out/page-types/[pageTypeId].html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
- package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
- package/out/slices.html +1 -1
- package/package.json +3 -3
- package/pages/changes.tsx +67 -28
- package/src/features/changes/actions/pushChanges.ts +66 -0
- package/src/{modules/pushChangesSaga → features/changes/actions}/trackPushChangesSuccess.ts +16 -12
- package/src/modules/loading/types.ts +0 -1
- package/src/modules/modal/types.ts +0 -3
- package/src/modules/useSliceMachineActions.ts +3 -18
- package/src/modules/userContext/index.ts +6 -3
- package/src/redux/reducer.ts +0 -2
- package/src/redux/saga.ts +0 -2
- package/src/redux/type.ts +0 -2
- package/components/DeleteDocumentsDrawer/ReferencesErrorDrawer.tsx +0 -92
- package/lib/models/common/TransactionalPush.ts +0 -10
- package/out/_next/static/chunks/25-8fedd33ad9b6de5b.js +0 -1
- package/out/_next/static/chunks/pages/changes-6a24f50da1a00688.js +0 -1
- package/src/modules/pushChangesSaga/index.ts +0 -191
- package/test/src/modules/pushChangesSaga.test.ts +0 -261
- /package/out/_next/static/{8aiH3LjdI_Vj38RRmPnNx → c66ozmNEqPsp5qxNPQX7V}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[477],{37782:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changelog",function(){return r(57825)}])},39576:function(e,n,r){"use strict";r.d(n,{Z:function(){return d}});var i=r(62230),s=r(52322);r(2784);var t=r(59326),a=r(75289),o=r(61183),c=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",c);var l=["javascript","bash","xml","html","json"],d=function(e){var n,r=e.children,c=e.lang,d=e.sx,g=e.codeStyle,x=e.codeClass,p=e.Header,u=(0,t.B7)().theme,h=c?o.Z.highlight(r,{language:"vue"===c?"html":c}).value:o.Z.highlightAuto(r,l).value;return(0,s.jsxs)(a.kC,{as:"pre",sx:d,children:[p?(0,s.jsx)(p,{}):null,(0,s.jsx)("code",{className:"hljs".concat(x?" ".concat(x):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=u.colors)||void 0===n?void 0:n.textClear)},g),dangerouslySetInnerHTML:{__html:h}})]})}},57825:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return H}});var i,s,t=r(52322),a=r(97729),o=r.n(a),c=r(22715),l=r(65077),d=r(75289),g=r(56580),x=r(39092),p=r(2784),u=r(62230),h=r(12170),v=function(e){var n=e.type,r=e.hasUpToDateVersions;return(0,t.jsx)(d.xv,{sx:(0,u.Z)({padding:"0px 4px",borderRadius:"2px",fontSize:"8px",fontWeight:600,lineHeight:"16px",textTransform:"uppercase"},(n===i.Latest||n===i.LatestNonBreaking)&&{bg:"grey02",color:"code.gray"},n===i.Current&&r&&{bg:"lightGreen",color:"code.green"},n===i.Current&&!r&&{bg:"lightOrange",color:"code.orange"}),children:n})},f=function(e){var n=e.isSelected,r=e.onClick,i=e.versionNumber,s=e.tags,a=e.hasUpToDateVersions;return(0,t.jsxs)(d.kC,{sx:(0,u.Z)({p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center"},n?{color:"purple",bg:(0,h.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}),onClick:r,children:[(0,t.jsx)(d.xv,{children:i}),(0,t.jsx)(d.kC,{sx:{gap:"8px"},children:s.map(function(e){return(0,t.jsx)(v,{type:e,hasUpToDateVersions:a},e)})})]})};(s=i||(i={})).Latest="LATEST",s.LatestNonBreaking="LATEST-NON-BREAKING",s.Current="CURRENT";var m=function(e){var n,r=e.changelog,s=e.selectedVersion,a=e.selectVersion,o=function(e){var n=[];return e===l?n.push(i.Latest):e===r.sliceMachine.latestNonBreakingVersion&&n.push(i.LatestNonBreaking),e===r.sliceMachine.currentVersion&&n.push(i.Current),n},l=null===(n=r.sliceMachine.versions[0])||void 0===n?void 0:n.versionNumber,g=!r.adapter.updateAvailable&&!r.sliceMachine.updateAvailable;return(0,t.jsxs)(d.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:c.TV.color.greyLight6,flexDirection:"column",paddingRight:"48px"},children:[(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,paddingBottom:"28px"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,t.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,t.jsx)(d.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:r.sliceMachine.versions.map(function(e,n){return(0,t.jsx)(f,{isSelected:(null==s?void 0:s.versionNumber)===e.versionNumber,onClick:function(){return a(e)},versionNumber:e.versionNumber,tags:o(e.versionNumber),hasUpToDateVersions:g},"versionBadge-".concat(e.versionNumber,"-").concat(n))})})]})},b={MAJOR:"MAJOR",MINOR:"MINOR",PATCH:"PATCH",FIRST:"FIRST"},j=function(e){var n=e.versionKind,r=(0,u.Z)({fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase"},n===b.MAJOR?{color:"purple",bg:(0,h.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"});return(0,t.jsx)(d.xv,{sx:r,children:n})},k=r(19870),C=function(e){var n=e.releaseNote;return(0,t.jsx)(d.xv,{sx:{"h1, h2, h3":{fontSize:"16px",fontWeight:600,lineHeight:"20px"},p:{fontSize:"14px",fontWeight:400,lineHeight:"20px"},b:{fontSize:"14px",fontWeight:600,lineHeight:"20px"},code:{color:"code.orange"},li:{listStyleType:"disc",marginLeft:"25px",paddingLeft:"5px"}},dangerouslySetInnerHTML:{__html:k.TU.parse(n)}})},N=r(951),y=r(39576),T=function(e){var n,r,i,s,a,o=e.changelog,c=e.selectedVersion,l=e.packageManager,g=c.versionNumber===o.sliceMachine.versions[0].versionNumber,x=(n={sliceMachineVersionToInstall:g?"latest":c.versionNumber,isLatestSliceMachineVersion:g,adapterName:o.adapter.name},r=n.sliceMachineVersionToInstall,i=n.isLatestSliceMachineVersion,s=n.adapterName,a=["slice-machine-ui@".concat(r)],i&&a.push("".concat(s,"@latest")),a),p=function(e,n){var r=n.join(" ");switch(e){case"bun":return"bun add --development ".concat(r);case"npm":return"npm install --save-dev ".concat(r);case"pnpm":case"pnpm@6":return"pnpm add --save-dev ".concat(r);case"yarn":case"yarn@berry":return"yarn add --dev ".concat(r)}}(l,x),u=o.adapter.updateAvailable&&!o.sliceMachine.updateAvailable;return(0,t.jsxs)(t.Fragment,{children:[u&&g&&(0,t.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},children:[(0,t.jsx)(N.CSE,{size:"24px"}),"It looks like you are using an outdated version of the adapter. Run this command to update your adapter:"]}),(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,t.jsxs)(d.kC,{sx:{gap:"8px"},children:[(0,t.jsx)(y.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:p}),(0,t.jsx)(d.zx,{variant:"secondary",onClick:function(){navigator.clipboard.writeText(p)},children:"Copy"})]})]})]})},S=function(){return(0,t.jsxs)("div",{children:["Could not fetch release notes."," ",(0,t.jsx)("a",{href:"https://github.com/prismicio/slice-machine/releases",target:"_blank",rel:"noopener noreferrer",children:"Find out more on GitHub"})]})},M=function(e){var n,r=e.changelog,i=e.selectedVersion,s=e.packageManager;return(0,t.jsxs)(d.kC,{sx:{flexDirection:"column"},children:[(0,t.jsxs)(d.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(i.versionNumber)}),!!i.kind&&(0,t.jsx)(j,{versionKind:i.kind})]}),(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null===(n=i.releaseNote)||void 0===n?void 0:n.includes("# Breaking Change"))&&(0,t.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},"data-testid":"breaking-changes-warning",children:[(0,t.jsx)(N.CSE,{size:"24px"}),"This update includes breaking changes. To update correctly, follow the steps below."]}),(0,t.jsx)(T,{changelog:r,selectedVersion:i,packageManager:s}),(null==i?void 0:i.releaseNote)?(0,t.jsx)(C,{releaseNote:i.releaseNote}):(0,t.jsx)(S,{})]})]})},L=r(32665),V=r(3098),R=r(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[477],{37782:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changelog",function(){return r(57825)}])},39576:function(e,n,r){"use strict";r.d(n,{Z:function(){return d}});var i=r(62230),s=r(52322);r(2784);var t=r(59326),a=r(75289),o=r(61183),c=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",c);var l=["javascript","bash","xml","html","json"],d=function(e){var n,r=e.children,c=e.lang,d=e.sx,g=e.codeStyle,x=e.codeClass,p=e.Header,u=(0,t.B7)().theme,h=c?o.Z.highlight(r,{language:"vue"===c?"html":c}).value:o.Z.highlightAuto(r,l).value;return(0,s.jsxs)(a.kC,{as:"pre",sx:d,children:[p?(0,s.jsx)(p,{}):null,(0,s.jsx)("code",{className:"hljs".concat(x?" ".concat(x):""),style:(0,i.Z)({overflowX:"auto",padding:"3px 5px",borderRadius:"6px",border:"1px solid",borderColor:String(null===(n=u.colors)||void 0===n?void 0:n.textClear)},g),dangerouslySetInnerHTML:{__html:h}})]})}},57825:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return H}});var i,s,t=r(52322),a=r(97729),o=r.n(a),c=r(22715),l=r(65077),d=r(75289),g=r(56580),x=r(39092),p=r(2784),u=r(62230),h=r(12170),v=function(e){var n=e.type,r=e.hasUpToDateVersions;return(0,t.jsx)(d.xv,{sx:(0,u.Z)({padding:"0px 4px",borderRadius:"2px",fontSize:"8px",fontWeight:600,lineHeight:"16px",textTransform:"uppercase"},(n===i.Latest||n===i.LatestNonBreaking)&&{bg:"grey02",color:"code.gray"},n===i.Current&&r&&{bg:"lightGreen",color:"code.green"},n===i.Current&&!r&&{bg:"lightOrange",color:"code.orange"}),children:n})},f=function(e){var n=e.isSelected,r=e.onClick,i=e.versionNumber,s=e.tags,a=e.hasUpToDateVersions;return(0,t.jsxs)(d.kC,{sx:(0,u.Z)({p:1,borderRadius:"4px",cursor:"pointer",transition:"200ms all",justifyContent:"space-between",alignItems:"center"},n?{color:"purple",bg:(0,h.DZ)("purple",.95)}:{"&:hover":{bg:"grey01"}}),onClick:r,children:[(0,t.jsx)(d.xv,{children:i}),(0,t.jsx)(d.kC,{sx:{gap:"8px"},children:s.map(function(e){return(0,t.jsx)(v,{type:e,hasUpToDateVersions:a},e)})})]})};(s=i||(i={})).Latest="LATEST",s.LatestNonBreaking="LATEST-NON-BREAKING",s.Current="CURRENT";var m=function(e){var n,r=e.changelog,s=e.selectedVersion,a=e.selectVersion,o=function(e){var n=[];return e===l?n.push(i.Latest):e===r.sliceMachine.latestNonBreakingVersion&&n.push(i.LatestNonBreaking),e===r.sliceMachine.currentVersion&&n.push(i.Current),n},l=null===(n=r.sliceMachine.versions[0])||void 0===n?void 0:n.versionNumber,g=!r.adapter.updateAvailable&&!r.sliceMachine.updateAvailable;return(0,t.jsxs)(d.kC,{sx:{minWidth:"228px",borderRight:"1px dashed",borderColor:c.TV.color.greyLight6,flexDirection:"column",paddingRight:"48px"},children:[(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,paddingBottom:"28px"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"20px",fontWeight:500,lineHeight:"32px"},children:"Changelog"}),(0,t.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"24px",marginTop:"28px"},children:"All versions"})]}),(0,t.jsx)(d.kC,{sx:{mt:"24px",flexDirection:"column",gap:"4px",overflow:"auto"},children:r.sliceMachine.versions.map(function(e,n){return(0,t.jsx)(f,{isSelected:(null==s?void 0:s.versionNumber)===e.versionNumber,onClick:function(){return a(e)},versionNumber:e.versionNumber,tags:o(e.versionNumber),hasUpToDateVersions:g},"versionBadge-".concat(e.versionNumber,"-").concat(n))})})]})},b={MAJOR:"MAJOR",MINOR:"MINOR",PATCH:"PATCH",FIRST:"FIRST"},j=function(e){var n=e.versionKind,r=(0,u.Z)({fontSize:"14px",padding:"2px 4px",borderRadius:"4px",textTransform:"uppercase"},n===b.MAJOR?{color:"purple",bg:(0,h.DZ)("purple",.85)}:{color:"grey05",bg:"grey02"});return(0,t.jsx)(d.xv,{sx:r,children:n})},k=r(19870),C=function(e){var n=e.releaseNote;return(0,t.jsx)(d.xv,{sx:{"h1, h2, h3":{fontSize:"16px",fontWeight:600,lineHeight:"20px"},p:{fontSize:"14px",fontWeight:400,lineHeight:"20px"},b:{fontSize:"14px",fontWeight:600,lineHeight:"20px"},code:{color:"code.orange"},li:{listStyleType:"disc",marginLeft:"25px",paddingLeft:"5px"}},dangerouslySetInnerHTML:{__html:k.TU.parse(n)}})},N=r(951),y=r(39576),T=function(e){var n,r,i,s,a,o=e.changelog,c=e.selectedVersion,l=e.packageManager,g=c.versionNumber===o.sliceMachine.versions[0].versionNumber,x=(n={sliceMachineVersionToInstall:g?"latest":c.versionNumber,isLatestSliceMachineVersion:g,adapterName:o.adapter.name},r=n.sliceMachineVersionToInstall,i=n.isLatestSliceMachineVersion,s=n.adapterName,a=["slice-machine-ui@".concat(r)],i&&a.push("".concat(s,"@latest")),a),p=function(e,n){var r=n.join(" ");switch(e){case"bun":return"bun add --development ".concat(r);case"npm":return"npm install --save-dev ".concat(r);case"pnpm":case"pnpm@6":return"pnpm add --save-dev ".concat(r);case"yarn":case"yarn@berry":return"yarn add --dev ".concat(r)}}(l,x),u=o.adapter.updateAvailable&&!o.sliceMachine.updateAvailable;return(0,t.jsxs)(t.Fragment,{children:[u&&g&&(0,t.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},children:[(0,t.jsx)(N.CSE,{size:"24px"}),"It looks like you are using an outdated version of the adapter. Run this command to update your adapter:"]}),(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",gap:"16px",padding:"16px",bg:"grey01"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"16px",fontWeight:500,lineHeight:"20px"},children:"How to install"}),(0,t.jsxs)(d.kC,{sx:{gap:"8px"},children:[(0,t.jsx)(y.Z,{codeStyle:{color:"white",flex:1,padding:"8px"},sx:{flex:1},children:p}),(0,t.jsx)(d.zx,{variant:"secondary",onClick:function(){navigator.clipboard.writeText(p)},children:"Copy"})]})]})]})},S=function(){return(0,t.jsxs)("div",{children:["Could not fetch release notes."," ",(0,t.jsx)("a",{href:"https://github.com/prismicio/slice-machine/releases",target:"_blank",rel:"noopener noreferrer",children:"Find out more on GitHub"})]})},M=function(e){var n,r=e.changelog,i=e.selectedVersion,s=e.packageManager;return(0,t.jsxs)(d.kC,{sx:{flexDirection:"column"},children:[(0,t.jsxs)(d.kC,{sx:{padding:"0px 0px 32px 32px",borderBottom:"1px dashed",borderColor:c.TV.color.greyLight6,justifyContent:"space-between",alignItems:"center"},children:[(0,t.jsx)(d.xv,{sx:{fontSize:"24px",fontWeight:600,lineHeight:"32px"},children:"Version ".concat(i.versionNumber)}),!!i.kind&&(0,t.jsx)(j,{versionKind:i.kind})]}),(0,t.jsxs)(d.kC,{sx:{flexDirection:"column",padding:"24px 0px 0px 32px",gap:"24px"},children:[(null===(n=i.releaseNote)||void 0===n?void 0:n.includes("# Breaking Change"))&&(0,t.jsxs)(d.kC,{sx:{padding:"16px",bg:"lightOrange",color:"darkOrange",fontSize:"13px",lineHeight:"24px",borderRadius:"4px",gap:"16px"},"data-testid":"breaking-changes-warning",children:[(0,t.jsx)(N.CSE,{size:"24px"}),"This update includes breaking changes. To update correctly, follow the steps below."]}),(0,t.jsx)(T,{changelog:r,selectedVersion:i,packageManager:s}),(null==i?void 0:i.releaseNote)?(0,t.jsx)(C,{releaseNote:i.releaseNote}):(0,t.jsx)(S,{})]})]})},L=r(32665),V=r(3098),R=r(29930);function w(){var e=(0,g.v9)(function(e){return{changelog:(0,x.Sx)(e),packageManager:(0,x.Ak)(e),isChangelogLoading:(0,L.hg)(e,V.z.CHANGELOG)}}),n=e.changelog,r=e.packageManager,i=e.isChangelogLoading,s=n.sliceMachine.versions[0],a=(0,p.useState)(s||void 0),o=a[0],u=a[1];(0,p.useEffect)(function(){u(s)},[s]);var h=0===n.sliceMachine.versions.length||!o;return(0,t.jsx)(R.LN,{children:(0,t.jsx)(R.RN,{children:(0,t.jsx)(l.xR,{sx:{display:"flex",minWidth:0},children:i?(0,t.jsx)(c._3,{}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m,{changelog:n,selectedVersion:o,selectVersion:function(e){return u(e)}}),h?(0,t.jsx)(d.kC,{sx:{paddingLeft:"32px"},children:(0,t.jsx)(S,{})}):(0,t.jsx)(M,{changelog:n,selectedVersion:o,packageManager:r})]})})})})}function H(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o(),{children:(0,t.jsx)("title",{children:"Changelog - Slice Machine"})}),(0,t.jsx)(w,{})]})}}},function(e){e.O(0,[898,183,870,774,888,179],function(){return e(e.s=37782)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return n(43723)}])},56577:function(e,t,n){"use strict";n.d(t,{z:function(){return u}});var s=n(62230),i=n(85244),r=n(98240),c=n(52322),o=n(2784),a=n(75289),l=function(e,t){return e?"".concat(e,"-").concat(t):""},d=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},u=(0,o.forwardRef)(function(e,t){var n=e.label,o=e.Icon,u=e.type,h=e.form,x=e.isLoading,m=void 0!==x&&x,f=e.disabled,p=e.onClick,g=e.sx,y=e.iconSize,j=void 0===y?16:y,v=e.iconFill,b=e.variant,C=void 0===b?"primary":b,_=(0,r.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,c.jsx)(a.zx,(0,i.Z)((0,s.Z)({ref:t,sx:(0,s.Z)((0,i.Z)((0,s.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),m?{cursor:"wait !important"}:{}),type:u,form:h,disabled:void 0!==f&&f||m,onClick:m?void 0:p,variant:C},_),{children:m?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(a.$j,{size:j,color:d(C),"data-cy":l(_["data-cy"],"spinner")}),o&&n]}):(0,c.jsxs)(c.Fragment,{children:[o&&(0,c.jsx)(o,{size:j,fill:v,"data-cy":l(_["data-cy"],"icon")}),n]})}))})},59469:function(e,t,n){"use strict";var s=n(62230),i=n(52322),r=n(75289);t.Z=function(e){var t=e.elems,n=e.renderElem,c=e.defineElementKey,o=e.gridTemplateMinPx,a=e.gridGap,l=e.sx;return(0,i.jsx)(r.xu,{as:"section",sx:(0,s.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===o?"320px":o,", 1fr))"),gridGap:void 0===a?"16px":a,pt:2},l),children:t.map(function(e,t){return e?(0,i.jsx)("span",{children:n(e,t)},"".concat(c(e),"-").concat(t+1)):null})})}},43723:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ea}});var s=n(22710),i=n(99267),r=n(52322),c=n(22715),o=n(2784),a=n(88932),l=n(97729),d=n.n(l),u=n(65077),h=n(29930),x=n(75289),m=n(951),f=function(e){var t=e.children;return(0,r.jsx)(x.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px"},children:t})},p=n(39097),g=n.n(p),y=n(7819),j=n(34728),v=n(67445),b=function(e){var t=e.ct,n=e.status,s=e.authStatus,i=e.isOnline;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.xu,{as:"td",style:{width:"40%"},children:(0,r.jsx)(x.xv,{sx:{fontWeight:500},children:t.label})}),(0,r.jsx)(x.xu,{as:"td",style:{width:"40%"},children:t.id}),(0,r.jsx)(x.xu,{as:"td",style:{width:"20%"},children:(0,r.jsx)(j.O,{authStatus:s,isOnline:i,modelStatus:n,modelType:"CustomType"})})]})},C=function(e){var t=e.customTypes,n=e.modelsStatuses,s=e.authStatus,i=e.isOnline;return(0,r.jsxs)(x.xu,{as:"table","data-legacy-component":!0,children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"transparent small",children:[(0,r.jsx)(x.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,r.jsx)(x.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,r.jsx)(x.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,r.jsx)("tbody",{children:t.map(function(e){return(0,y.TG)(e)?(0,r.jsx)(g(),{passHref:!0,href:v.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,r.jsx)("tr",{tabIndex:0,"data-cy":"custom-type-".concat(e.local.id),children:(0,r.jsx)(b,{ct:e.local,status:n.customTypes[e.local.id],authStatus:s,isOnline:i,modelsStatuses:n},e.local.id)})},e.local.id):(0,r.jsx)("tr",{tabIndex:0,className:"disabled","data-cy":"custom-type-".concat(e.remote.id),children:(0,r.jsx)(b,{ct:e.remote,status:n.customTypes[e.remote.id],authStatus:s,isOnline:i,modelsStatuses:n},e.remote.id)},e.remote.id)})})]})},_=n(59469),S=n(15836),T=n(5479),D=n(47731),Z=n(32681),w=n(71749),k=function(e){var t=e.unSyncedCustomTypes,n=e.unSyncedSlices,s=e.modelsStatuses,i=e.authStatus,c=e.isOnline,o=(0,D.H)(),a=o.modalPayload,l=o.onOpenModal,d=a.sliceFilterFn,u=a.defaultVariationSelector,h=n.filter(function(e){return s.slices[e.model.id]!==Z.G.Deleted});return(0,r.jsxs)(r.Fragment,{children:[t.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f,{children:(0,r.jsxs)(x.xu,{children:[(0,r.jsx)(x.xv,{variant:"heading",children:"Types"}),(0,r.jsx)(x.xv,{variant:"grey",sx:{ml:"8px"},children:t.length})]})}),(0,r.jsx)(C,{customTypes:t,modelsStatuses:s,authStatus:i,isOnline:c})]}),n.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.xu,{sx:{mb:"8px"},children:(0,r.jsxs)(f,{children:[(0,r.jsxs)(x.xu,{children:[(0,r.jsx)(x.xv,{variant:"heading",children:"Slices"}),(0,r.jsx)(x.xv,{variant:"grey",sx:{ml:"8px"},children:n.length})]}),(0,r.jsxs)(x.xu,{children:[n.some(function(e){return(0,T.cx)(e)>0&&s.slices[e.model.id]!==Z.G.Deleted})&&(0,r.jsxs)(x.xv,{sx:{mr:3,color:"warning02",fontSize:"12px",lineHeight:"16px",fontWeight:600},children:[(0,r.jsx)(m.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,r.jsxs)(x.zx,{variant:"darkSmall",onClick:function(){return l({sliceFilterFn:function(e){return e}})},children:[(0,r.jsx)(m.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,r.jsx)(_.Z,{gridGap:"32px 16px",elems:n,gridTemplateMinPx:"305px",defineElementKey:function(e){return e.model.name},renderElem:function(e){var t=s.slices[e.model.id];return(0,r.jsx)(w.b,{action:{type:"status",authStatus:i,isOnline:c,modelStatus:t},isDeleted:t===Z.G.Deleted,mode:"navigation",onUpdateScreenshot:function(){l({sliceFilterFn:function(t){return t.filter(function(t){return t.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,r.jsx)(S.Z,{slices:d(h),defaultVariationSelector:u})]})]})},z=n(91914),O=function(){return(0,r.jsx)(x.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,r.jsxs)(x.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,r.jsx)(z.wQ1,{size:48}),(0,r.jsx)(x.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px",textAlign:"center"},children:"No internet connection"}),(0,r.jsx)(x.xv,{sx:{fontSize:"13px",lineHeight:"24px",textAlign:"center"},children:"You need a stable internet connection to review and push changes"})]})})},N=n(90374),F=n(79096),I=function(e){var t=e.authStatus,n=(0,N.Z)().openLoginModal;return(0,r.jsxs)(c.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[t===F.t.FORBIDDEN?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xv,{variant:"h3",align:"center",children:"It seems like you are logged out"}),(0,r.jsx)(c.xv,{align:"center",children:"Log in to connect to your repository."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.xv,{variant:"h3",align:"center",children:"It seems like you don't have access to this repository"}),(0,r.jsx)(c.xv,{align:"center",children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,r.jsxs)(c.xv,{align:"center",children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,r.jsx)(c.hh,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),t===F.t.FORBIDDEN&&(0,r.jsx)(c.zx,{onClick:function(){return n()},children:"Log in to Prismic"})]})},E=n(5632),R=n.n(E),M=n(2754),A=n(34543),G=n(62230),H=n(85244),P=n(98240),W=n(6277);n(25977);var B={primary:"_1ecs97dbc8 _1ecs97dbjl _1ecs97dbc2 _1ecs97dbjf _1ecs97dbca _1ecs97dbjn",secondary:"_1ecs97daji _1ecs97dah3 _1ecs97dajc _1ecs97dagx _1ecs97dajk _1ecs97dah5"},L={normal:"ovkapw1",smallBold:"ovkapw2",inherit:"ovkapw3 _1ecs97df47"},V=function(e){var t=e.children,n=e.color,s=e.endIcon,i=e.href,a=e.textVariant,l=void 0===a?"smallBold":a,d=(0,P.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,r.jsxs)("a",(0,H.Z)((0,G.Z)({href:i,target:"_blank",rel:"noreferrer"},d),{className:(0,W.Z)("ovkapw0 _1ecs97dez0 _1ecs97df41 _1ecs97dez2 _1ecs97dez8",B[void 0===n?"primary":n]),children:[(0,r.jsx)(c.xv,{component:"span",color:"inherit",variant:l,children:t}),(0,o.isValidElement)(s)?(0,o.cloneElement)(s,{className:(0,W.Z)(s.props.className,"_1ecs97dfhw",L[l])}):null]}))},U=n(56580),X=n(39092),Y=function(){var e,t=(e=(0,U.v9)(function(e){return{repoName:(0,X.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,r.jsxs)(M.R$,{style:{alignSelf:"center",marginTop:c.TV.size[72]},children:[(0,r.jsx)(M.u2,{children:(0,r.jsx)(c.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,r.jsxs)(M.T9,{children:[(0,r.jsx)(M._T,{children:"Everything up-to-date"}),(0,r.jsx)(M.nf,{children:"You have no changes staged. Your changes appear here after you have saved them, while they're waiting to be pushed to the Page Builder. Ready to get going?"}),(0,r.jsxs)(M.Qj,{children:[(0,r.jsx)(c.zx,{onClick:function(){R().push("/")},children:"Create a page type"}),(0,r.jsx)(V,{endIcon:(0,r.jsx)(A.AlO,{}),textVariant:"normal",href:t,children:"Create content"})]})]})]})},K=n(67764),Q=n(56577),$=n(49471);n(78656);var q=function(e){var t=e.ctName,n=e.numberOfDocuments,s=e.link,i=e.isOverLimit;return(0,r.jsxs)(x.Zb,{sx:{mb:12},variant:"drawerCard","data-cy":"AssociatedDocumentsCard-".concat(t),children:[(0,r.jsxs)(x.kC,{sx:{flexDirection:"column"},children:[(0,r.jsx)(x.xv,{children:t}),(0,r.jsxs)(x.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[n," documents"]})]}),(0,r.jsx)(x.rU,{href:s,target:"_blank",variant:"cardSmall",sx:{color:void 0!==i&&i?"danger":"purple08"},children:"View documents"})]})},J=n(79797),ee=n(54132),et=function(e){var t=e.isOpen,n=e.title,s=e.footer,i=e.explanations,c=e.onClose;return(0,r.jsx)(J.Z,{placement:"right",open:t,level:null,onClose:c,width:496,children:(0,r.jsx)(ee.Z,{radius:"0px",bodySx:{bg:"white",padding:24,flex:1,display:"flex",flexDirection:"column",overflow:"scroll"},footerSx:{p:0},sx:{flexDirection:"column",display:"flex",height:"100%",border:"none"},borderFooter:!0,Header:function(){return(0,r.jsxs)(x.kC,{sx:{p:"16px",alignItems:"center",justifyContent:"space-between",borderBottom:function(e){var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.borders))}},children:[(0,r.jsx)(x.kC,{sx:{alignItems:"center"},children:(0,r.jsx)(x.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:n})}),(0,r.jsx)(x.x8,{type:"button",onClick:function(){return c()}})]})},Footer:function(){return(0,r.jsx)(x.kC,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"center",paddingRight:16,borderTop:function(e){var t;return"1px solid ".concat(String(null===(t=e.colors)||void 0===t?void 0:t.darkBorders))},backgroundColor:"white",padding:20},children:s})},children:i})})},en=function(e){var t=e.onToggle,n=e.isConfirmed,s=e.sx;return(0,r.jsxs)(x.kC,{sx:(0,G.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},s),children:[(0,r.jsx)(x.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,r.jsxs)(x.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,r.jsx)(x.XZ,{defaultChecked:n,onChange:t,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},es=function(e){var t=e.pushChanges,n=e.modalData,s=e.onClose,i=(0,o.useState)(!1),c=i[0],a=i[1],l=(0,U.v9)(function(e){return{remoteOnlyCustomTypes:(0,$.Ch)(e).filter(y.yp)}}).remoteOnlyCustomTypes;if((null==n?void 0:n.type)!=="SOFT")return null;var d=n.details.customTypes.map(function(e){var t,n=l.find(function(t){return(0,y.n5)(t)===e.id});return void 0===n?null:(0,r.jsx)(q,{isOverLimit:!0,ctName:null!==(t=n.remote.label)&&void 0!==t?t:n.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,r.jsx)(et,{isOpen:"SOFT"===n.type,title:"Confirm deletion",onClose:s,footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(en,{onToggle:function(){a(!c)},isConfirmed:c,sx:{mb:10}}),(0,r.jsx)(Q.z,{label:"Push changes",variant:"primary",onClick:function(){t(c)},disabled:!c,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,r.jsxs)(x.xv,{sx:{mb:24},children:[n.details.customTypes.length>1?"These types have":"This type has"," ","associated Documents, which will also be deleted. This might create broken links in your repository."]}),d]})})},ei=function(e){var t=e.pushChanges,n=e.modalData,s=e.onClose,i=(0,U.v9)(function(e){return{remoteOnlyCustomTypes:(0,$.Ch)(e).filter(y.yp)}}).remoteOnlyCustomTypes;if((null==n?void 0:n.type)!=="HARD")return null;var c=n.details.customTypes.map(function(e){var t,n=i.find(function(t){return(0,y.n5)(t)===e.id});return void 0===n?null:(0,r.jsx)(q,{isOverLimit:!0,ctName:null!==(t=n.remote.label)&&void 0!==t?t:n.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,r.jsx)(et,{isOpen:"HARD"===n.type,title:"Manual action required",onClose:s,footer:(0,r.jsx)(Q.z,{label:"Try again",variant:"primary",onClick:function(){t(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(x.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",n.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,r.jsxs)(x.xv,{sx:{mb:24},children:[n.details.customTypes.length>1?"These types have":"This type has"," ","too many associated Documents. Archive and delete these Documents manually and then try deleting the types again."]}),c]})})},er=n(81541),ec=n(82770);function eo(){return(eo=(0,s.Z)(function(e){var t,n,s,r,c,o,a,l,d;return(0,i.__generator)(this,function(i){switch(i.label){case 0:return t=e.changedSlices,n=e.changedCustomTypes,r=void 0!==(s=e.confirmDeleteDocuments)&&s,c=Date.now(),o=t.map(function(e){return{id:e.slice.model.id,type:"Slice",libraryID:e.slice.from,status:e.status}}),a=n.map(function(e){return{id:e.customType.id,type:"CustomType",status:e.status}}),l={confirmDeleteDocuments:r,changes:(0,er.Z)(o).concat((0,er.Z)(a))},[4,(0,ec.tI)(l)];case 1:var u,h,x,m,f,p,g,y,j,v;if(d=i.sent())return ec.Xe.track({event:"changes:limit-reach",limitType:d.type}),[2,d];return h=(u={changedCustomTypes:n,changedSlices:t,hasDeletedDocuments:r,startTime:c}).startTime,x=u.hasDeletedDocuments,m=u.changedCustomTypes,f=u.changedSlices,p=m.reduce(function(e,t){return t.status===Z.G.New?(0,H.Z)((0,G.Z)({},e),{customTypesCreated:e.customTypesCreated+1}):t.status===Z.G.Modified?(0,H.Z)((0,G.Z)({},e),{customTypesModified:e.customTypesModified+1}):t.status===Z.G.Deleted?(0,H.Z)((0,G.Z)({},e),{customTypesDeleted:e.customTypesDeleted+1}):e},{customTypesCreated:0,customTypesModified:0,customTypesDeleted:0}),g=f.reduce(function(e,t){return t.status===Z.G.New?(0,H.Z)((0,G.Z)({},e),{slicesCreated:e.slicesCreated+1}):t.status===Z.G.Modified?(0,H.Z)((0,G.Z)({},e),{slicesModified:e.slicesModified+1}):t.status===Z.G.Deleted?(0,H.Z)((0,G.Z)({},e),{slicesDeleted:e.slicesDeleted+1}):e},{slicesCreated:0,slicesModified:0,slicesDeleted:0}),y=f.length+m.length,j=f.reduce(function(e,t){return e+(0,T.cx)(t.slice)},0),v=Date.now()-h,ec.Xe.track((0,H.Z)((0,G.Z)({event:"changes:pushed"},p,g),{total:y,missingScreenshots:j,duration:v,hasDeletedDocuments:x,_includeEnvironmentKind:!0})),[2,void 0]}})})).apply(this,arguments)}var ea=function(){var e,t=(0,K.X)(),n=t.unSyncedSlices,l=t.unSyncedCustomTypes,x=t.modelsStatuses,m=t.authStatus,f=t.isOnline,p=(0,o.useMemo)(function(){var e;return{changedSlices:n.map(function(e){return{slice:e,status:x.slices[e.model.id]}}).filter(function(e){return K.O.includes(e.status)}),changedCustomTypes:l.map(function(e){return(0,y.TG)(e)?e.local:e.remote}).map(function(e){return{customType:e,status:x.customTypes[e.id]}}).filter(function(e){return K.O.includes(e.status)})}},[n,l,x]),g=p.changedSlices,j=p.changedCustomTypes,v=(0,N.Z)(),b=v.pushChangesSuccess,C=v.refreshState,_=(0,o.useState)(!1),S=_[0],T=_[1],D=(0,o.useState)(void 0),Z=D[0],w=D[1],z=n.length+l.length,E=(e=(0,s.Z)(function(e){var t,n,s;return(0,i.__generator)(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),T(!0),w(void 0),[4,function(e){return eo.apply(this,arguments)}({confirmDeleteDocuments:e,changedSlices:g,changedCustomTypes:j})];case 1:if(!(void 0!==(t=i.sent())))return[3,2];return w(t),[3,4];case 2:return[4,(0,ec.y0)()];case 3:C({env:(n=i.sent()).env,remoteCustomTypes:n.remoteCustomTypes,customTypes:n.customTypes,libraries:n.libraries,remoteSlices:n.remoteSlices,clientError:n.clientError}),b(),a.Am.success("All slices and types have been pushed"),i.label=4;case 4:return[3,6];case 5:return s=i.sent(),console.error("Something went wrong when manually pushing your changes",s),a.Am.error("Something went wrong when pushing your changes. Check your terminal logs."),[3,6];case 6:return T(!1),[2]}})}),function(t){return e.apply(this,arguments)}),R=(0,o.useMemo)(function(){return f?m===F.t.UNAUTHORIZED||m===F.t.FORBIDDEN?(0,r.jsx)(I,{authStatus:m}):0===z?(0,r.jsx)(Y,{}):(0,r.jsx)(k,{unSyncedSlices:n,unSyncedCustomTypes:l,modelsStatuses:x,authStatus:m,isOnline:f}):(0,r.jsx)(O,{})},[f,m,z,n,l,x,]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d(),{children:(0,r.jsx)("title",{children:"Changes - Slice Machine"})}),(0,r.jsxs)(h.LN,{children:[(0,r.jsxs)(h.wd,{children:[(0,r.jsx)(h.Cx,{folder:"Changes"}),(0,r.jsx)(h.K2,{children:(0,r.jsx)(c.zx,{onClick:function(){E(!1)},loading:S,disabled:0===z||!f||m===F.t.UNAUTHORIZED||m===F.t.FORBIDDEN||S,"data-cy":"push-changes",children:"Push Changes"})})]}),(0,r.jsx)(h.RN,{children:(0,r.jsxs)(u.xR,{sx:{display:"flex",flexDirection:"column"},children:[R,(0,r.jsx)(es,{pushChanges:function(e){E(e)},modalData:Z,onClose:function(){return w(void 0)}}),(0,r.jsx)(ei,{pushChanges:function(e){E(e)},modalData:Z,onClose:function(){return w(void 0)}})]})})]})]})}},2754:function(e,t,n){"use strict";n.d(t,{R$:function(){return d},Qj:function(){return f},T9:function(){return h},nf:function(){return m},u2:function(){return u},_T:function(){return x}});var s=n(67557),i=n(62230),r=n(85244),c=n(98240),o=n(52322),a=n(6277),l=n(22715);n(69143);var d=function(e){var t=e.backgroundImage,n=e.style,l=(0,c.Z)(e,["backgroundImage","style"]),d=void 0!==t;return(0,o.jsx)("article",(0,r.Z)((0,i.Z)({},l),{className:(0,a.Z)("_18bjhbz0 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dfiv _1ecs97dfix _1ecs97dfiz _1ecs97d3fg _1ecs97d3mt _1ecs97df0r _1ecs97df23 _1ecs97df2h _1ecs97dezp",(0,s.Z)({},"_18bjhbz1 _1ecs97dezx _1ecs97df4v",d)),style:(0,i.Z)({backgroundImage:d?"url(".concat(t,")"):void 0},n)}))},u=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97d6r8 _1ecs97d6yl _1ecs97df29 _1ecs97df2l _1ecs97dezp"}))},h=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz3 _1ecs97dez0 _1ecs97dez1 _1ecs97dez2 _1ecs97dezb _1ecs97dffv"}))},x=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz4"}))},m=function(e){return(0,o.jsx)(l.xv,(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz5",color:"grey11"}))},f=function(e){return(0,o.jsx)("div",(0,r.Z)((0,i.Z)({},e),{className:"_18bjhbz6 _1ecs97dez0 _1ecs97dez8 _1ecs97dez1 _1ecs97dez2 _1ecs97df95 _1ecs97dfdl",color:"grey"}))}},69143:function(){},25977:function(){}},function(e){e.O(0,[898,789,123,543,918,25,286,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[274],{41535:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/labs",function(){return r(8951)}])},8951:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return j}});var t=r(52322),i=r(2784),s=r(22715),a=r(97729),c=r.n(a),l=r(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[274],{41535:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/labs",function(){return r(8951)}])},8951:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return j}});var t=r(52322),i=r(2784),s=r(22715),a=r(97729),c=r.n(a),l=r(29930),o=r(22710),u=r(17064),d=r(99267),h=r(90374),f=r(40432),x=function(e){var n=e.title,r=e.enabled,i=e.onToggle,a=e.children;return(0,t.jsx)(s.Zb,{variant:"outlined",children:(0,t.jsxs)(s.xu,{gap:8,padding:16,children:[(0,t.jsx)(s.xu,{padding:{top:6},children:(0,t.jsx)(s.I5,{name:"viewDay",size:"medium",color:"grey11"})}),(0,t.jsxs)(s.xu,{flexDirection:"column",flexGrow:1,children:[(0,t.jsx)(s.xv,{variant:"h3",children:n}),(0,t.jsx)(s.xv,{variant:"normal",children:a})]}),(0,t.jsx)(s.xu,{width:128,justifyContent:"end",children:(0,t.jsx)(s.rs,{size:"medium",checked:r,onCheckedChange:function(e){return i(e)}})})]})})},g=r(65988),b=function(){var e,n,r,i,a,c,l,b=(0,u.Z)((e="legacySliceUpgrader",n="Legacy Slice Upgrader",i=(0,h.Z)().openToaster,a=(0,u.Z)((0,g.E)(e),2),c=a[0],l=a[1],[c,(r=(0,o.Z)(function(e){var r;return(0,d.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,l(e)];case 1:return t.sent(),i(e?"Labs: enabled ".concat(n):"Labs: disabled ".concat(n),f.Jf.SUCCESS),[3,3];case 2:return r=t.sent(),console.error(r),i(e?"Labs: failed to enable ".concat(n):"Labs: failed to disable ".concat(n),f.Jf.ERROR),[3,3];case 3:return[2]}})}),function(e){return r.apply(this,arguments)})]),2),j=b[0],p=b[1];return(0,t.jsxs)(s.xu,{flexDirection:"column",gap:32,children:[(0,t.jsx)("header",{children:(0,t.jsx)(s.xv,{variant:"normal",children:"Slice Machine Labs gives you early access to new features before they're widely released. Experimental features are works-in-progress and potentially unstable, so you may find some bugs and breaking changes along the way."})}),(0,t.jsx)(s.xu,{flexDirection:"column",gap:16,children:(0,t.jsxs)(x,{title:"Legacy Slice Upgrader",enabled:j.enabled,onToggle:function(e){p(e)},children:["The Legacy Slice Upgrader allows you to convert old slices (legacy and composite slices) to slices managed by Slice Machine (shared slices). This feature is experimental, and we strongly recommend that you test it with a"," ",(0,t.jsx)("a",{href:"https://prismic.io/docs/environments",target:"_blank",children:"Prismic environment"})," ","or you'll be at risk of losing past content."]})})]})},j=function(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c(),{children:(0,t.jsx)("title",{children:"Labs - Slice Machine"})}),(0,t.jsx)(s.SV,{renderError:function(){return(0,t.jsx)(p,{children:(0,t.jsx)(s.xu,{alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.Iq,{title:"Request failed",description:"An error occurred while fetching your labs configuration."})})})},children:(0,t.jsx)(i.Suspense,{fallback:(0,t.jsx)(p,{withHeader:!0,children:(0,t.jsx)(s._3,{})}),children:(0,t.jsx)(p,{withHeader:!0,children:(0,t.jsx)(b,{})})})})]})},p=function(e){var n=e.children,r=e.withHeader;return(0,t.jsxs)(l.LN,{children:[void 0!==r&&r?(0,t.jsx)(l.wd,{children:(0,t.jsx)(l.Cx,{folder:"Labs"})}):null,(0,t.jsx)(l.RN,{children:n})]})}},65988:function(e,n,r){"use strict";r.d(n,{E:function(){return h}});var t=r(22710),i=r(62230),s=r(85244),a=r(17064),c=r(99267),l=r(17329),o=r(81038);function u(){return d.apply(this,arguments)}function d(){return(d=(0,t.Z)(function(){return(0,c.__generator)(this,function(e){return[2,o.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}function h(e){var n,r,d,h,f,x,g=(0,a.Z)((n=(0,l.QT)(u,[]),r=(0,t.Z)(function(e){return(0,c.__generator)(this,function(n){switch(n.label){case 0:return[4,o.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,l.VA)(u,[],e),[2]}})}),[n,d=function(e){return r.apply(this,arguments)}]),2),b=g[0],j=g[1],p=(x=(0,t.Z)(function(n){var r;return(0,c.__generator)(this,function(t){switch(t.label){case 0:return r=(0,s.Z)((0,i.Z)({},b),{labs:(0,i.Z)({},b.labs)}),n?r.labs[e]=n:e in r.labs&&delete r.labs[e],0===Object.keys(r.labs).length&&delete r.labs,[4,j(r)];case 1:return t.sent(),[2]}})}),function(e){return x.apply(this,arguments)});return[{enabled:null!==(f=null==b?void 0:null===(h=b.labs)||void 0===h?void 0:h[e])&&void 0!==f&&f},p]}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=41535)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
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(79336)}])},38876:function(e,n,t){"use strict";t.d(n,{MP:function(){return o},T3:function(){return s},Ti:function(){return r},lV:function(){return c}});var i=/-(\w)/g;function r(e){return e.includes("-")?"['".concat(e,"']"):".".concat(e)}function o(e){return e?(e=e.replace(/_/g,"-").replace(i,function(e,n){return n?n.toUpperCase():""}))[0].toUpperCase()+e.slice(1):""}var a=/\B([A-Z])/g;function s(e){var n;return e.replace(a,"-$1").toLowerCase().replace(/-/g,"_")}var c=function(e){return e.trim().replace(/ /g,"_").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}},79336:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ew}});var i=t(52322),r=t(97729),o=t.n(r),a=t(5632),s=t(22715),c=t(28316),u=t(83462),l=t(38876),d=t(2353),f=t(44384),v=t(28173),p=t(53559),m=t(22710),h=t(62230),y=t(85244),x=t(99267),g=t(2784),j=t(74217),b=t(41072),w=t(82770),Z=t(90374),I=(0,g.createContext)(void 0);function S(e){var n=e.children,t=e.initialSlice,r=(0,a.useRouter)(),o=(0,g.useState)(t),s=o[0],c=o[1],u=(0,b.Q)({errorMessage:"Failed to save slice. Check your browser's console for more information."}),l=u.autoSaveStatus,d=u.setNextSave,f=(0,Z.Z)().saveSliceSuccess,v=(0,j.R9)(f),p=(0,g.useMemo)(function(){var e=r.query.variation,n=s.model.variations.find(function(n){return n.id===e});if(n)return n;throw Error("Variation not found")},[s,r]),S=(0,g.useCallback)(function(e){c(e),d((0,m.Z)(function(){var n,t,i,r,o;return(0,x.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,w.Ve)(e)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,w.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 v((0,y.Z)((0,h.Z)({},e),{mocks:o})),[2]}})}))},[d,v]),C=(0,g.useMemo)(function(){return{autoSaveStatus:l,slice:s,setSlice:S,variation:p}},[l,s,S,p]);return(0,i.jsx)(I.Provider,{value:C,children:"function"==typeof n?n(C):n})}function C(){var e=(0,g.useContext)(I);if(!e)throw Error("SliceBuilderProvider not found");return e}var k=t(5479),T=t(8482),F=t(4092),E=function(){var e=C(),n=e.slice,t=e.setSlice,r=e.variation,o=function(e){return function(i){var o=(0,k.AK)({slice:n,variationId:r.id,widgetArea:e,fieldId:i});t(o)}},a=function(e){return function(i){var o=i.apiId,a=i.newKey,s=i.value,c=(0,k.L4)({slice:n,variationId:r.id,widgetArea:e,previousFieldId:o,newFieldId:a,newField:s});t(c)}},s=function(e){return function(i){var o=i.id,a=i.label,s=i.widgetTypeName,c=d[s];c||console.log('Could not find widget with type name "'.concat(s,'". Please contact us!'));var u=c.create(a);if("Range"===u.type||"IntegrationFields"===u.type||"Separator"===u.type)throw Error("Unsupported Field Type: ".concat(u.type));try{d[u.type].schema.validateSync(u,{stripUnknown:!1})}catch(l){throw Error('Model is invalid for widget "'.concat(u.type,'".'))}var f=(0,k.xS)({slice:n,variationId:r.id,widgetArea:e,newFieldId:o,newField:u});t(f)}},m=function(e){return function(i){if(!(0,u.uS)(i)){var o=i.source,a=i.destination;if(a){var s=(0,k.gR)({slice:n,variationId:r.id,widgetArea:e,sourceIndex:o.index,destinationIndex:a.index});(0,c.flushSync)(function(){return t(s)})}}}};return(0,i.jsxs)(v.aV,{children:[(0,i.jsx)(T.Z,{zoneType:"slice",tabId:void 0,title:"Non-Repeatable Zone",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:r.primary,EditModal:F.Z,widgetsArray:f.Z,onDeleteItem:o(p.Rt.Primary),onSave:a(p.Rt.Primary),onSaveNewField:s(p.Rt.Primary),onDragEnd:m(p.Rt.Primary),poolOfFieldsToCheck:r.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,l.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,l.Ti)(e))},dataCy:"static-zone-content",isRepeatableCustomType:void 0}),(0,i.jsx)(T.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:f.Z,fields:r.items,EditModal:F.Z,onDeleteItem:o(p.Rt.Items),onSave:a(p.Rt.Items),onSaveNewField:s(p.Rt.Items),onDragEnd:m(p.Rt.Items),poolOfFieldsToCheck:r.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,l.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,l.Ti)(e))},dataCy:"slice-repeatable-zone",isRepeatableCustomType:void 0})]})},R=t(88932),A=t(36131),O=t(63397),_=t(75289),N=t(76635),L=t(25812),V=t(54132),D=function(e){var n=e.children,t=e.FooterContent,r=e.HeaderContent,o=e.close,a=e.sx,s=e.headerSx,c=void 0===s?{}:s;return(0,i.jsx)(V.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,h.Z)({border:"none"},void 0===a?{}:a),Header:function(e){var n=e.radius;return(0,i.jsxs)(_.kC,{sx:(0,h.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)(_.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(_.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(_.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},P=function(e){var n=e.msg;return(0,i.jsx)(_.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},z=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,o=e.initialVariation,a=e.variations,c=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,s=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,h.Z)({},r,o,s,c,u)},u=function(e){I((0,N.camelCase)(e))},l=function(e){E(e),C&&u(e)},d=function(e){k(!1),u(e)},f=function(){v(),t()},v=function(){I(""),E(""),b({}),k(!0),z({value:o.id,label:o.name})},p=(0,g.useState)({}),j=p[0],b=p[1],w=(0,g.useState)(""),Z=w[0],I=w[1],S=(0,g.useState)(!0),C=S[0],k=S[1],T=(0,g.useState)(""),F=T[0],E=T[1],R=(0,g.useState)({value:o.id,label:o.name}),V=R[0],z=R[1],M=(0,g.useState)(!1),K=M[0],B=M[1];function q(){return H.apply(this,arguments)}function H(){return(H=(0,m.Z)(function(){var e,n;return(0,x.__generator)(this,function(t){switch(t.label){case 0:if(!Object.keys(e=c({id:Z,name:F,origin:V})).length)return[3,1];return b(e),[3,3];case 1:if(!(n=a.find(function(e){return e.id===V.value})))return[3,3];return B(!0),[4,r(Z,F,n)];case 2:t.sent(),B(!1),f(),t.label=3;case 3:return[2]}})})).apply(this,arguments)}return(0,g.useEffect)(function(){v()},[o,n]),(0,i.jsx)(L.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return f()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(O.J9,{initialValues:{id:Z,name:F,origin:V},onSubmit:q,children:(0,i.jsx)(O.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),q())},children:(0,i.jsx)(s.xu,{children:(0,i.jsxs)(D,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(_.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(s.xu,{gap:16,alignItems:"center",children:[(0,i.jsx)(s.zx,{onClick:f,color:"grey",children:"Cancel"}),(0,i.jsx)(s.zx,{loading:K,children:"Submit"})]}),close:f,children:[(0,i.jsxs)(s.xu,{flexDirection:"column",padding:{block:16},children:[(0,i.jsxs)(_.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",j.name?(0,i.jsx)(P,{msg:j.name}):""]}),(0,i.jsx)(O.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:_.II,maxLength:30,value:F,onChange:function(e){return l(e.currentTarget.value)}}),(0,i.jsx)(_.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(s.xu,{flexDirection:"column",padding:{bottom:16},children:[(0,i.jsxs)(_.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",j.id?(0,i.jsx)(P,{msg:j.id}):""]}),(0,i.jsx)(O.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:_.II,maxLength:30,value:Z,onChange:function(e){return d(e.currentTarget.value)}}),(0,i.jsx)(_.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(s.xu,{flexDirection:"column",padding:{bottom:8},children:[(0,i.jsx)(_.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(A.ZP,{name:"origin",options:a.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&z(e)},defaultValue:V,maxMenuHeight:150,theme:function(e){return(0,y.Z)((0,h.Z)({},e),{colors:(0,y.Z)((0,h.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},M=t(49451);function K(){return(K=(0,m.Z)(function(e){var n,t,i,r,o,a,s,c,u,l,d,f;return(0,x.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),[4,(0,w.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,w.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,w.X$)(e.component.from,e.component.model.id)];case 3:if(a=(o=n.sent()).slice,(s=o.errors).length>0)throw s;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,w.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return c=n.sent().mocks,u=M.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:a.name,variationId:a.variations[0].id}),[4,e.router.replace(u)];case 5:return n.sent(),l=(0,y.Z)((0,h.Z)({},e.component),{model:a,mocks:c}),e.saveSliceSuccess(l),[2,l];case 6:throw d=n.sent(),f="Could not delete variation `".concat(e.variation.name,"`"),console.error(f,d),R.Am.error(f),d;case 7:return[2]}})})).apply(this,arguments)}var B=function(e){var n=e.isOpen,t=e.onClose,r=e.slice,o=e.variation,c=(0,a.useRouter)(),u=(0,g.useState)(!1),l=u[0],d=u[1],f=(0,Z.Z)().saveSliceSuccess,v=C().setSlice;return(0,i.jsxs)(s.Vq,{open:n,onOpenChange:function(e){return!e&&t()},size:{width:448,height:"auto"},children:[(0,i.jsx)(s.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(s.cZ,{children:(0,i.jsxs)(s.xu,{flexDirection:"column",children:[(0,i.jsxs)(s.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)(q,{children:"not"})," affect your documents until you ",(0,i.jsx)(q,{children:"edit"})," ","them manually."]}),(0,i.jsx)(s.kX,{ok:{text:"Delete",onClick:function(){o&&(0,m.Z)(function(){var e;return(0,x.__generator)(this,function(e){switch(e.label){case 0:d(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,function(e){return K.apply(this,arguments)}({component:r,router:c,saveSliceSuccess:f,variation:o})];case 2:return v(e.sent()),[3,4];case 3:return e.sent(),[3,4];case 4:return d(!1),t(),[2]}})})()},loading:l},cancel:{text:"Cancel"},size:"medium"})]})})]})},q=function(e){return(0,i.jsx)(s.xv,(0,y.Z)((0,h.Z)({},e),{color:"inherit",component:"span",variant:"bold"}))};function H(){return(H=(0,m.Z)(function(e){var n,t,i,r,o,a,s,c,u,l,d;return(0,x.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,(0,w.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,w.eH)(e.component,(0,y.Z)((0,h.Z)({},e.variation),{name:e.variationName}))];case 2:if((r=n.sent().errors).length>0)throw r;return[4,(0,w.X$)(e.component.from,e.component.model.id)];case 3:if(a=(o=n.sent()).slice,(s=o.errors).length>0)throw s;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,w.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return c=n.sent().mocks,u=(0,y.Z)((0,h.Z)({},e.component),{model:a,mocks:c}),e.saveSliceSuccess(u),[2,u];case 5:throw l=n.sent(),d="Could not rename variation `".concat(e.variation.name,"`"),console.error(d,l),R.Am.error(d),l;case 6:return[2]}})})).apply(this,arguments)}var X=function(e){var n,t,r=e.isOpen,o=e.onClose,a=e.slice,c=e.variation,u=(0,g.useState)(!1),l=u[0],d=u[1],f=C().setSlice,v=(0,Z.Z)().saveSliceSuccess;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(s.Vq,{open:r,onOpenChange:function(e){return!e&&o()},size:{width:448,height:"auto"},children:[(0,i.jsx)(s.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(s.cZ,{children:(0,i.jsx)(O.J9,{validateOnChange:!0,validateOnMount:!0,initialValues:{variationName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:""},validate:function(e){if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:(t=(0,m.Z)(function(e){var n;return(0,x.__generator)(this,function(n){switch(n.label){case 0:if(!c)return[2];d(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(e){return H.apply(this,arguments)}({component:a,saveSliceSuccess:v,variation:c,variationName:e.variationName.trim()})];case 2:return f(n.sent()),[3,4];case 3:return n.sent(),[3,4];case 4:return d(!1),o(),[2]}})}),function(e){return t.apply(this,arguments)}),children:function(e){return(0,i.jsxs)("form",{children:[(0,i.jsxs)(s.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(s.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)(s.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:"_1ecs97dez4 _1ecs97dez8 _1ecs97df90",children:[(0,i.jsx)(s.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(s.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(s.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)(s.kX,{ok:{text:"Rename",onClick:function(){e.submitForm()},loading:l,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})}})})]})})},U=t(15836),W=t(71749),G=t(47731),Q=function(){var e,n=C(),t=n.slice,r=n.variation,o=n.setSlice,c=(0,g.useState)(),u=c[0],l=c[1],d=(0,G.H)(),f=d.modalPayload,v=f.sliceFilterFn,p=f.defaultVariationSelector,h=f.onUploadSuccess,y=(0,a.useRouter)(),j=(0,Z.Z)().saveSliceSuccess;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.xu,{flexDirection:"column",gap:16,children:[t.model.variations.map(function(e){return(0,i.jsx)(W.b,{action:{type:"menu",onRename:function(){l({type:"RENAME_VARIATION",variation:e})},onRemove:function(){l({type:"DELETE_VARIATION",variation:e})},removeDisabled:t.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:function(){d.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.jsxs)(s.xu,{backgroundColor:"grey2",bottom:0,flexDirection:"column",padding:{bottom:40,inline:24},position:"sticky",style:{marginBottom:"-16px"},children:[(0,i.jsx)(s.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(s.zx,{onClick:function(){l({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},color:"grey",children:"Add a new variation"})]})]}),(0,i.jsx)(U.Z,{slices:v([t]),defaultVariationSelector:p,onUploadSuccess:h}),(0,i.jsx)(X,{isOpen:(null==u?void 0:u.type)==="RENAME_VARIATION",onClose:function(){l(void 0)},slice:t,variation:null==u?void 0:u.variation}),(0,i.jsx)(B,{isOpen:(null==u?void 0:u.type)==="DELETE_VARIATION",onClose:function(){l(void 0)},slice:t,variation:null==u?void 0:u.variation}),(0,i.jsx)(z,{initialVariation:r,isOpen:(null==u?void 0:u.type)==="ADD_VARIATION",onClose:function(){l(void 0)},onSubmit:(e=(0,m.Z)(function(e,n,i){var r,a,s,c,u,l;return(0,x.__generator)(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),a=(r=(0,k.Kp)({slice:t,id:e,name:n,copiedVariation:i})).slice,s=r.variation,[4,(0,w.Ve)(a)];case 1:return d.sent(),j(a),o(a),c=M.Y.getBuilderPagePathname({libraryName:a.href,sliceName:a.model.name,variationId:s.id}),y.replace(c),[3,3];case 2:return u=d.sent(),l="Could not add variation `".concat(n,"`"),console.error(l,u),R.Am.error(l),[3,3];case 3:return[2]}})}),function(n,t,i){return e.apply(this,arguments)}),variations:t.model.variations})]})},$=t(56580),J=t(75329),Y=t(33710),ee=t(42189),en=t(17036),et=t(39295),ei=t(22342),er=function(){return(0,i.jsx)(et.X,{children:(0,i.jsxs)(Y.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:[(0,i.jsx)(_.xv,{as:"b",children:"Framework not supported"}),(0,i.jsx)(_.xv,{as:"p",children:"Slice Simulator does not support your framework yet."})]})})},eo=function(e){var n=e.children,t=e.open,r=e.onClose;return(0,i.jsxs)(ei.zs,{open:t,trigger:n,onClose:r,children:[(0,i.jsx)(ei.Ev,{children:"Simulate your slices"}),(0,i.jsx)(ei.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:J.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){w.Xe.track({event:"open-video-tutorials",video:J.Sn})}}),(0,i.jsx)(ei.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(ei.Rp,{children:"Got it"})]})},ea=function(e){var n=e.isSimulatorAvailableForFramework,t=e.disabled,r=(0,a.useRouter)(),o=(0,g.useRef)(null),c=(0,Z.Z)().setSeenSimulatorToolTip,u=(0,$.v9)(function(e){return{hasSeenSimulatorTooltip:(0,en.bv)(e)}}).hasSeenSimulatorTooltip;(0,g.useEffect)(function(){var e=o.current;e&&n&&!u&&setTimeout(function(){return Y.Z.show(e)},5e3)},[n,u]);var l=function(){if(c(),o.current){var e=o.current;Y.Z.hide(e)}};return(0,i.jsxs)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:o,children:[(0,i.jsx)(eo,{open:n&&!u,onClose:l,children:(0,i.jsx)(s.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){l(),window.open("".concat(r.asPath,"/simulator"),J.pq)},disabled:t,renderStartIcon:function(){return(0,i.jsx)(ee.z,{color:s.TV.color.greyLight1,height:s.TV.size[24],style:{transform:"scale(calc(4 / 3))"},width:s.TV.size[24]})},children:"Simulate"})}),!1===n?(0,i.jsx)(er,{}):void 0]})},es=t(22337),ec=t(17329),eu=t(81038);function el(e){return ed.apply(this,arguments)}function ed(){return(ed=(0,m.Z)(function(e){var n,t,i;return(0,x.__generator)(this,function(r){switch(r.label){case 0:return[4,eu.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 ef=t(67445),ev=t(64722),ep=t(20812),em=function(e){return(0,i.jsxs)("svg",(0,y.Z)((0,h.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"})]}))},eh=function(){var e,n,t=(e=(0,ev.l)().source,n=(0,ef.Ag)(e.query),void 0!==n&&(0,ef.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(s.SV,{children:(0,i.jsx)(g.Suspense,{children:(0,i.jsx)(s.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(ey,{sourceCustomTypeId:t})})})}):null},ey=function(e){var n,t=(n=e.sourceCustomTypeId,(0,ec.QT)(el,[n])),r=(0,g.useState)(!0),o=r[0],c=r[1],u=(0,a.useRouter)();if(void 0===t||!o)return null;var l=t.format,d=t.id,f=ef.cd[l].getBuilderPagePathname(d);return(0,i.jsxs)(s.hE,{density:"compact",color:"dark",children:[(0,i.jsxs)(s.zx,{onClick:function(){u.push(f)},renderStartIcon:function(){return(0,i.jsx)(em,{})},children:["Return to ",t.label]}),(0,i.jsx)(s.zx,{onClick:function(){c(!1)},renderStartIcon:function(){return(0,i.jsx)(ep.T,{})}})]})},ex=t(39092),eg=t(47976),ej=function(){var e=C(),n=e.slice,t=e.autoSaveStatus,r=(0,$.v9)(ex.Ql);return(0,i.jsxs)(es.LN,{children:[(0,i.jsxs)(es.wd,{children:[(0,i.jsx)(es.Xq,{url:"/slices"}),(0,i.jsx)(es.Cx,{folder:"Slices",page:n.model.name}),(0,i.jsxs)(es.K2,{children:[(0,i.jsx)(eg.X,{status:t}),(0,i.jsx)(ea,{isSimulatorAvailableForFramework:r,disabled:"saved"!==t})]})]}),(0,i.jsxs)(es.RN,{children:[(0,i.jsxs)(s.xu,{alignItems:"flex-start",display:"grid",gap:16,gridTemplateColumns:"320px 1fr",children:[(0,i.jsx)(Q,{}),(0,i.jsx)(E,{})]}),(0,i.jsx)(eh,{})]})]})},eb=t(28684);function ew(){var e=(0,a.useRouter)(),n=(0,eb.Z)(),t=n.slice,r=n.variation;return void 0===t||void 0===r?(e.replace("/"),null):(0,i.jsx)(S,{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)(ej,{})]})}})}},91061:function(e,n,t){"use strict";t.d(n,{AK:function(){return b},E3:function(){return p},EN:function(){return m},F$:function(){return x},GA:function(){return k},HO:function(){return g},L4:function(){return w},Tr:function(){return v},gR:function(){return Z},j6:function(){return S},kQ:function(){return I},l9:function(){return C},mf:function(){return h},vB:function(){return y},xS:function(){return j},y6:function(){return u}});var i=t(67557),r=t(62230),o=t(85244),a=t(17064),s=t(88866),c=t(98863);function u(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function l(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,a.Z)(e,2);return(n[0],n[1]).type===s.SlicesFieldType})}function v(e,n){if(t=e,d=f(t,c=n),(v=(0,a.Z)(null!=d?d:[],2))[0],null!==(u=null==(p=v[1])?void 0:p.config)&&void 0!==u?u:void 0)return e;var t,c,u,d,v,p,m=function(e,n){var t,i=l(e),r=i.findIndex(function(e){return(0,a.Z)(e,1)[0]===n}),o=i.flatMap(function(e){var n=(0,a.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===s.SlicesFieldType})}),c=r;do t="slices".concat(0!==c?c.toString():""),c++;while(o.includes(t));return t}(e,n);return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,(0,o.Z)((0,r.Z)({},e.json[n]),(0,i.Z)({},m,{type:s.SlicesFieldType,fieldset:"Slice Zone"}))))})}function p(e,n){var t=d(e,n);if(void 0===t)return e;var a=Object.keys(t).find(function(e){return t[e].type===s.SlicesFieldType});if(void 0===a)return e;var u=(0,c.ud)(t,a);return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,u))})}function m(e){var n,t,a=e.customType,u=e.sectionId,l=e.sliceId,f=d(a,u);if(void 0===f)return a;var v=Object.keys(f).find(function(e){return f[e].type===s.SlicesFieldType});if(void 0===v)return a;var p=f[v];if(p.type!==s.SlicesFieldType)return a;var m=(0,c.ud)(null!==(t=null===(n=p.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},l);return(0,o.Z)((0,r.Z)({},a),{json:(0,o.Z)((0,r.Z)({},a.json),(0,i.Z)({},u,(0,o.Z)((0,r.Z)({},f),(0,i.Z)({},v,(0,o.Z)((0,r.Z)({},p),{config:(0,o.Z)((0,r.Z)({},p.config),{choices:m})})))))})}function h(e){var n,t=(0,o.Z)((0,r.Z)({},e),{format:"page"}),i=l(e)[0];if(i){var s=(0,a.Z)(i,1)[0];t=v(t,s)}return t}function y(e,n){return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,{}))})}function x(e,n){var t=(0,c.ud)(e.json,n);return(0,o.Z)((0,r.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var i=Object.keys(e.json).reduce(function(i,r){return r===n?i[t]=e.json[r]:i[r]=e.json[r],i},{});return(0,o.Z)((0,r.Z)({},e),{json:i})}function j(e){var n=e.customType,t=e.sectionId,a=e.newField,s=e.newFieldId;return T({customType:n,sectionId:t,updatedSection:(0,o.Z)((0,r.Z)({},n.json[t]),(0,i.Z)({},s,a))})}function b(e){var n=e.customType,t=e.sectionId,i=e.fieldId,r=(0,c.ud)(n.json[t],i);return T({customType:n,sectionId:t,updatedSection:r})}function w(e){var n=e.customType,t=e.sectionId,i=e.previousFieldId,r=e.newFieldId,o=e.newField,a=F({fields:n.json[t],previousFieldId:i,newFieldId:r,newField:o});return T({customType:n,sectionId:t,updatedSection:a})}function Z(e){var n=e.customType,t=e.sectionId,i=e.sourceIndex,r=e.destinationIndex,o=n.json[t],c=f(n,t),u=Object.fromEntries(Object.entries(o).filter(function(e){var n=(0,a.Z)(e,2);return(n[0],n[1]).type!==s.SlicesFieldType})),l=E({fields:u,sourceIndex:i,destinationIndex:r});if(void 0!==c){var d=(0,a.Z)(c,2),v=d[0],p=d[1];l[v]=p}return T({customType:n,sectionId:t,updatedSection:l})}function I(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.newField,u=e.newFieldId,l=R({customType:t,sectionId:a,groupFieldId:s}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l)return t;var f=A(l,(0,o.Z)((0,r.Z)({},d),(0,i.Z)({},u,c)));return T({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,f))})}function S(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,u=e.fieldId,l=R({customType:t,sectionId:a,groupFieldId:s}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=(0,c.ud)(d,u),v=A(l,f);return T({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,v))})}function C(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.previousFieldId,u=e.newFieldId,l=e.newField,d=R({customType:t,sectionId:a,groupFieldId:s}),f=null==d?void 0:null===(n=d.config)||void 0===n?void 0:n.fields;if(!d||!f)return t;var v=F({fields:f,previousFieldId:c,newFieldId:u,newField:l}),p=A(d,v);return T({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,p))})}function k(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.sourceIndex,u=e.destinationIndex,l=R({customType:t,sectionId:a,groupFieldId:s}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=E({fields:d,sourceIndex:c,destinationIndex:u}),v=A(l,f);return T({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,v))})}function T(e){var n=e.customType,t=e.sectionId,a=e.updatedSection;return(0,o.Z)((0,r.Z)({},n),{json:(0,o.Z)((0,r.Z)({},n.json),(0,i.Z)({},t,a))})}function F(e){var n=e.fields,t=e.previousFieldId,i=e.newFieldId,r=e.newField;return Object.entries(n).reduce(function(e,n){var o=(0,a.Z)(n,2),s=o[0],c=o[1];return s===t?e[i]=r:s!==i&&(e[s]=c),e},{})}function E(e){var n=e.fields,t=e.sourceIndex,i=e.destinationIndex,r=Object.entries(n),o=(0,a.Z)(r.splice(t,1),1)[0];return r.splice(i,0,o),Object.fromEntries(r)}function R(e){var n=e.customType,t=e.sectionId,i=e.groupFieldId,r=n.json[t][i];if(r.type===s.GroupFieldType)return r}function A(e,n){return(0,o.Z)((0,r.Z)({},e),{config:(0,o.Z)((0,r.Z)({},e.config),{fields:n})})}},28684:function(e,n,t){"use strict";var i=t(5632),r=t(56580),o=t(49222),a=function(){var e=(0,i.useRouter)(),n=(0,r.v9)(function(n){return{slice:(0,o.t)(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}:{}};n.Z=a},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return j}});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 s(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function c(e,n){return void 0===n&&(n=","),e.split(n)}function u(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return s(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([s(e.key),s(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&v([s(e.key),s(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){l.clear()});var l=new Set;function d(e){return Array.isArray(e)}function f(e){var n=Array.isArray(e)?e:[e];l.has("meta")&&l.forEach(function(e){var n;return!o.includes(e)&&l.delete(e.toLowerCase())}),n.forEach(function(e){return l.add(e.toLowerCase())})}function v(e){var n=Array.isArray(e)?e:[e];"meta"===e?l.clear():n.forEach(function(e){return l.delete(e.toLowerCase())})}function p(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 m=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,c=n.mod,u=n.shift,f=n.ctrl,v=n.keys,p=e.key,m=e.code,h=e.ctrlKey,y=e.metaKey,x=e.shiftKey,g=e.altKey,j=s(m),b=p.toLowerCase();if(!t){if(!g===o&&"alt"!==b||!x===u&&"shift"!==b)return!1;if(c){if(!y&&!h)return!1}else if(!y===a&&"meta"!==b&&"os"!==b||!h===f&&"ctrl"!==b&&"control"!==b)return!1}return!!(v&&1===v.length&&(v.includes(b)||v.includes(j)))||(v?(void 0===r&&(r=","),(d(i=v)?i:i.split(r)).every(function(e){return l.has(e.trim().toLowerCase())})):!v)},h=(0,i.createContext)(void 0),y=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),x=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function j(e,n,t,r){var o,a,l=(0,i.useRef)(null),j=(0,i.useRef)(!1),b=t instanceof Array?r instanceof Array?void 0:r:t,w=d(e)?e.join(null==b?void 0:b.splitKey):e,Z=t instanceof Array?t:r instanceof Array?r:void 0,I=(0,i.useCallback)(n,null!=Z?Z:[]),S=(0,i.useRef)(I);Z?S.current=I:S.current=n;var C=(!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,b)&&(a.current=b),a.current),k=(0,i.useContext)(y).enabledScopes,T=(0,i.useContext)(h);return g(function(){if((null==C?void 0:C.enabled)!==!1&&(e=k,n=null==C?void 0:C.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),!(p(e,["input","textarea","select"])&&!p(e,null==C?void 0:C.enableOnFormTags)||null!=C&&null!=C.ignoreEventWhen&&C.ignoreEventWhen(e))){if(null!==l.current&&document.activeElement!==l.current&&!l.current.contains(document.activeElement)){x(e);return}(null==(t=e.target)||!t.isContentEditable||null!=C&&C.enableOnContentEditable)&&c(w,null==C?void 0:C.splitKey).forEach(function(t){var i,r,o,a,s,c,l,d=u(t,null==C?void 0:C.combinationKey);if(m(e,d,null==C?void 0:C.ignoreModifiers)||null!=(l=d.keys)&&l.includes("*")){if(n&&j.current)return;if(i=e,r=d,("function"==typeof(o=null==C?void 0:C.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,s=d,"function"==typeof(c=null==C?void 0:C.enabled)?!c(a,s):!0!==c&&void 0!==c){x(e);return}S.current(e,d),n||(j.current=!0)}})}},i=function(e){void 0!==e.key&&(f(s(e.code)),((null==C?void 0:C.keydown)===void 0&&(null==C?void 0:C.keyup)!==!0||null!=C&&C.keydown)&&t(e))},r=function(e){void 0!==e.key&&(v(s(e.code)),j.current=!1,null!=C&&C.keyup&&t(e,!0))},o=l.current||(null==b?void 0:b.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),T&&c(w,null==C?void 0:C.splitKey).forEach(function(e){return T.addHotkey(u(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),T&&c(w,null==C?void 0:C.splitKey).forEach(function(e){return T.removeHotkey(u(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))})}}},[w,C,k]),l}}},function(e){e.O(0,[898,789,917,525,461,139,183,50,543,696,25,318,286,774,888,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);
|
|
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(79336)}])},38876:function(e,n,t){"use strict";t.d(n,{MP:function(){return o},T3:function(){return s},Ti:function(){return r},lV:function(){return c}});var i=/-(\w)/g;function r(e){return e.includes("-")?"['".concat(e,"']"):".".concat(e)}function o(e){return e?(e=e.replace(/_/g,"-").replace(i,function(e,n){return n?n.toUpperCase():""}))[0].toUpperCase()+e.slice(1):""}var a=/\B([A-Z])/g;function s(e){var n;return e.replace(a,"-$1").toLowerCase().replace(/-/g,"_")}var c=function(e){return e.trim().replace(/ /g,"_").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}},79336:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ew}});var i=t(52322),r=t(97729),o=t.n(r),a=t(5632),s=t(22715),c=t(28316),u=t(83462),l=t(38876),d=t(2353),f=t(44384),v=t(28173),p=t(53559),m=t(22710),h=t(62230),y=t(85244),x=t(99267),g=t(2784),j=t(74217),b=t(41072),w=t(82770),Z=t(90374),I=(0,g.createContext)(void 0);function S(e){var n=e.children,t=e.initialSlice,r=(0,a.useRouter)(),o=(0,g.useState)(t),s=o[0],c=o[1],u=(0,b.Q)({errorMessage:"Failed to save slice. Check your browser's console for more information."}),l=u.autoSaveStatus,d=u.setNextSave,f=(0,Z.Z)().saveSliceSuccess,v=(0,j.R9)(f),p=(0,g.useMemo)(function(){var e=r.query.variation,n=s.model.variations.find(function(n){return n.id===e});if(n)return n;throw Error("Variation not found")},[s,r]),S=(0,g.useCallback)(function(e){c(e),d((0,m.Z)(function(){var n,t,i,r,o;return(0,x.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,w.Ve)(e)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,w.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 v((0,y.Z)((0,h.Z)({},e),{mocks:o})),[2]}})}))},[d,v]),C=(0,g.useMemo)(function(){return{autoSaveStatus:l,slice:s,setSlice:S,variation:p}},[l,s,S,p]);return(0,i.jsx)(I.Provider,{value:C,children:"function"==typeof n?n(C):n})}function C(){var e=(0,g.useContext)(I);if(!e)throw Error("SliceBuilderProvider not found");return e}var k=t(5479),T=t(8482),F=t(4092),E=function(){var e=C(),n=e.slice,t=e.setSlice,r=e.variation,o=function(e){return function(i){var o=(0,k.AK)({slice:n,variationId:r.id,widgetArea:e,fieldId:i});t(o)}},a=function(e){return function(i){var o=i.apiId,a=i.newKey,s=i.value,c=(0,k.L4)({slice:n,variationId:r.id,widgetArea:e,previousFieldId:o,newFieldId:a,newField:s});t(c)}},s=function(e){return function(i){var o=i.id,a=i.label,s=i.widgetTypeName,c=d[s];c||console.log('Could not find widget with type name "'.concat(s,'". Please contact us!'));var u=c.create(a);if("Range"===u.type||"IntegrationFields"===u.type||"Separator"===u.type)throw Error("Unsupported Field Type: ".concat(u.type));try{d[u.type].schema.validateSync(u,{stripUnknown:!1})}catch(l){throw Error('Model is invalid for widget "'.concat(u.type,'".'))}var f=(0,k.xS)({slice:n,variationId:r.id,widgetArea:e,newFieldId:o,newField:u});t(f)}},m=function(e){return function(i){if(!(0,u.uS)(i)){var o=i.source,a=i.destination;if(a){var s=(0,k.gR)({slice:n,variationId:r.id,widgetArea:e,sourceIndex:o.index,destinationIndex:a.index});(0,c.flushSync)(function(){return t(s)})}}}};return(0,i.jsxs)(v.aV,{children:[(0,i.jsx)(T.Z,{zoneType:"slice",tabId:void 0,title:"Non-Repeatable Zone",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:r.primary,EditModal:F.Z,widgetsArray:f.Z,onDeleteItem:o(p.Rt.Primary),onSave:a(p.Rt.Primary),onSaveNewField:s(p.Rt.Primary),onDragEnd:m(p.Rt.Primary),poolOfFieldsToCheck:r.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,l.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,l.Ti)(e))},dataCy:"static-zone-content",isRepeatableCustomType:void 0}),(0,i.jsx)(T.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:f.Z,fields:r.items,EditModal:F.Z,onDeleteItem:o(p.Rt.Items),onSave:a(p.Rt.Items),onSaveNewField:s(p.Rt.Items),onDragEnd:m(p.Rt.Items),poolOfFieldsToCheck:r.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,l.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,l.Ti)(e))},dataCy:"slice-repeatable-zone",isRepeatableCustomType:void 0})]})},R=t(88932),A=t(36131),O=t(63397),_=t(75289),N=t(76635),L=t(25812),V=t(54132),D=function(e){var n=e.children,t=e.FooterContent,r=e.HeaderContent,o=e.close,a=e.sx,s=e.headerSx,c=void 0===s?{}:s;return(0,i.jsx)(V.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,h.Z)({border:"none"},void 0===a?{}:a),Header:function(e){var n=e.radius;return(0,i.jsxs)(_.kC,{sx:(0,h.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)(_.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(_.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(_.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},P=function(e){var n=e.msg;return(0,i.jsx)(_.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},z=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,o=e.initialVariation,a=e.variations,c=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,s=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,h.Z)({},r,o,s,c,u)},u=function(e){I((0,N.camelCase)(e))},l=function(e){E(e),C&&u(e)},d=function(e){k(!1),u(e)},f=function(){v(),t()},v=function(){I(""),E(""),b({}),k(!0),z({value:o.id,label:o.name})},p=(0,g.useState)({}),j=p[0],b=p[1],w=(0,g.useState)(""),Z=w[0],I=w[1],S=(0,g.useState)(!0),C=S[0],k=S[1],T=(0,g.useState)(""),F=T[0],E=T[1],R=(0,g.useState)({value:o.id,label:o.name}),V=R[0],z=R[1],M=(0,g.useState)(!1),K=M[0],B=M[1];function q(){return H.apply(this,arguments)}function H(){return(H=(0,m.Z)(function(){var e,n;return(0,x.__generator)(this,function(t){switch(t.label){case 0:if(!Object.keys(e=c({id:Z,name:F,origin:V})).length)return[3,1];return b(e),[3,3];case 1:if(!(n=a.find(function(e){return e.id===V.value})))return[3,3];return B(!0),[4,r(Z,F,n)];case 2:t.sent(),B(!1),f(),t.label=3;case 3:return[2]}})})).apply(this,arguments)}return(0,g.useEffect)(function(){v()},[o,n]),(0,i.jsx)(L.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return f()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(O.J9,{initialValues:{id:Z,name:F,origin:V},onSubmit:q,children:(0,i.jsx)(O.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),q())},children:(0,i.jsx)(s.xu,{children:(0,i.jsxs)(D,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(_.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(s.xu,{gap:16,alignItems:"center",children:[(0,i.jsx)(s.zx,{onClick:f,color:"grey",children:"Cancel"}),(0,i.jsx)(s.zx,{loading:K,children:"Submit"})]}),close:f,children:[(0,i.jsxs)(s.xu,{flexDirection:"column",padding:{block:16},children:[(0,i.jsxs)(_.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",j.name?(0,i.jsx)(P,{msg:j.name}):""]}),(0,i.jsx)(O.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:_.II,maxLength:30,value:F,onChange:function(e){return l(e.currentTarget.value)}}),(0,i.jsx)(_.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(s.xu,{flexDirection:"column",padding:{bottom:16},children:[(0,i.jsxs)(_.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",j.id?(0,i.jsx)(P,{msg:j.id}):""]}),(0,i.jsx)(O.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:_.II,maxLength:30,value:Z,onChange:function(e){return d(e.currentTarget.value)}}),(0,i.jsx)(_.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(s.xu,{flexDirection:"column",padding:{bottom:8},children:[(0,i.jsx)(_.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(A.ZP,{name:"origin",options:a.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&z(e)},defaultValue:V,maxMenuHeight:150,theme:function(e){return(0,y.Z)((0,h.Z)({},e),{colors:(0,y.Z)((0,h.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},M=t(49451);function K(){return(K=(0,m.Z)(function(e){var n,t,i,r,o,a,s,c,u,l,d,f;return(0,x.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),[4,(0,w.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,w.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,w.X$)(e.component.from,e.component.model.id)];case 3:if(a=(o=n.sent()).slice,(s=o.errors).length>0)throw s;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,w.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return c=n.sent().mocks,u=M.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:a.name,variationId:a.variations[0].id}),[4,e.router.replace(u)];case 5:return n.sent(),l=(0,y.Z)((0,h.Z)({},e.component),{model:a,mocks:c}),e.saveSliceSuccess(l),[2,l];case 6:throw d=n.sent(),f="Could not delete variation `".concat(e.variation.name,"`"),console.error(f,d),R.Am.error(f),d;case 7:return[2]}})})).apply(this,arguments)}var B=function(e){var n=e.isOpen,t=e.onClose,r=e.slice,o=e.variation,c=(0,a.useRouter)(),u=(0,g.useState)(!1),l=u[0],d=u[1],f=(0,Z.Z)().saveSliceSuccess,v=C().setSlice;return(0,i.jsxs)(s.Vq,{open:n,onOpenChange:function(e){return!e&&t()},size:{width:448,height:"auto"},children:[(0,i.jsx)(s.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(s.cZ,{children:(0,i.jsxs)(s.xu,{flexDirection:"column",children:[(0,i.jsxs)(s.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)(q,{children:"not"})," affect your documents until you ",(0,i.jsx)(q,{children:"edit"})," ","them manually."]}),(0,i.jsx)(s.kX,{ok:{text:"Delete",onClick:function(){o&&(0,m.Z)(function(){var e;return(0,x.__generator)(this,function(e){switch(e.label){case 0:d(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,function(e){return K.apply(this,arguments)}({component:r,router:c,saveSliceSuccess:f,variation:o})];case 2:return v(e.sent()),[3,4];case 3:return e.sent(),[3,4];case 4:return d(!1),t(),[2]}})})()},loading:l},cancel:{text:"Cancel"},size:"medium"})]})})]})},q=function(e){return(0,i.jsx)(s.xv,(0,y.Z)((0,h.Z)({},e),{color:"inherit",component:"span",variant:"bold"}))};function H(){return(H=(0,m.Z)(function(e){var n,t,i,r,o,a,s,c,u,l,d;return(0,x.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,(0,w.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,w.eH)(e.component,(0,y.Z)((0,h.Z)({},e.variation),{name:e.variationName}))];case 2:if((r=n.sent().errors).length>0)throw r;return[4,(0,w.X$)(e.component.from,e.component.model.id)];case 3:if(a=(o=n.sent()).slice,(s=o.errors).length>0)throw s;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,w.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return c=n.sent().mocks,u=(0,y.Z)((0,h.Z)({},e.component),{model:a,mocks:c}),e.saveSliceSuccess(u),[2,u];case 5:throw l=n.sent(),d="Could not rename variation `".concat(e.variation.name,"`"),console.error(d,l),R.Am.error(d),l;case 6:return[2]}})})).apply(this,arguments)}var X=function(e){var n,t,r=e.isOpen,o=e.onClose,a=e.slice,c=e.variation,u=(0,g.useState)(!1),l=u[0],d=u[1],f=C().setSlice,v=(0,Z.Z)().saveSliceSuccess;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(s.Vq,{open:r,onOpenChange:function(e){return!e&&o()},size:{width:448,height:"auto"},children:[(0,i.jsx)(s.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(s.cZ,{children:(0,i.jsx)(O.J9,{validateOnChange:!0,validateOnMount:!0,initialValues:{variationName:null!==(n=null==c?void 0:c.name)&&void 0!==n?n:""},validate:function(e){if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:(t=(0,m.Z)(function(e){var n;return(0,x.__generator)(this,function(n){switch(n.label){case 0:if(!c)return[2];d(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(e){return H.apply(this,arguments)}({component:a,saveSliceSuccess:v,variation:c,variationName:e.variationName.trim()})];case 2:return f(n.sent()),[3,4];case 3:return n.sent(),[3,4];case 4:return d(!1),o(),[2]}})}),function(e){return t.apply(this,arguments)}),children:function(e){return(0,i.jsxs)("form",{children:[(0,i.jsxs)(s.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(s.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)(s.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:"_1ecs97dez4 _1ecs97dez8 _1ecs97df90",children:[(0,i.jsx)(s.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(s.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(s.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)(s.kX,{ok:{text:"Rename",onClick:function(){e.submitForm()},loading:l,disabled:!e.isValid},cancel:{text:"Cancel"},size:"medium"})]})}})})]})})},U=t(15836),W=t(71749),G=t(47731),Q=function(){var e,n=C(),t=n.slice,r=n.variation,o=n.setSlice,c=(0,g.useState)(),u=c[0],l=c[1],d=(0,G.H)(),f=d.modalPayload,v=f.sliceFilterFn,p=f.defaultVariationSelector,h=f.onUploadSuccess,y=(0,a.useRouter)(),j=(0,Z.Z)().saveSliceSuccess;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.xu,{flexDirection:"column",gap:16,children:[t.model.variations.map(function(e){return(0,i.jsx)(W.b,{action:{type:"menu",onRename:function(){l({type:"RENAME_VARIATION",variation:e})},onRemove:function(){l({type:"DELETE_VARIATION",variation:e})},removeDisabled:t.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:function(){d.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.jsxs)(s.xu,{backgroundColor:"grey2",bottom:0,flexDirection:"column",padding:{bottom:40,inline:24},position:"sticky",style:{marginBottom:"-16px"},children:[(0,i.jsx)(s.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(s.zx,{onClick:function(){l({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},color:"grey",children:"Add a new variation"})]})]}),(0,i.jsx)(U.Z,{slices:v([t]),defaultVariationSelector:p,onUploadSuccess:h}),(0,i.jsx)(X,{isOpen:(null==u?void 0:u.type)==="RENAME_VARIATION",onClose:function(){l(void 0)},slice:t,variation:null==u?void 0:u.variation}),(0,i.jsx)(B,{isOpen:(null==u?void 0:u.type)==="DELETE_VARIATION",onClose:function(){l(void 0)},slice:t,variation:null==u?void 0:u.variation}),(0,i.jsx)(z,{initialVariation:r,isOpen:(null==u?void 0:u.type)==="ADD_VARIATION",onClose:function(){l(void 0)},onSubmit:(e=(0,m.Z)(function(e,n,i){var r,a,s,c,u,l;return(0,x.__generator)(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),a=(r=(0,k.Kp)({slice:t,id:e,name:n,copiedVariation:i})).slice,s=r.variation,[4,(0,w.Ve)(a)];case 1:return d.sent(),j(a),o(a),c=M.Y.getBuilderPagePathname({libraryName:a.href,sliceName:a.model.name,variationId:s.id}),y.replace(c),[3,3];case 2:return u=d.sent(),l="Could not add variation `".concat(n,"`"),console.error(l,u),R.Am.error(l),[3,3];case 3:return[2]}})}),function(n,t,i){return e.apply(this,arguments)}),variations:t.model.variations})]})},$=t(56580),J=t(75329),Y=t(33710),ee=t(42189),en=t(17036),et=t(39295),ei=t(22342),er=function(){return(0,i.jsx)(et.X,{children:(0,i.jsxs)(Y.Z,{clickable:!0,place:"bottom",effect:"solid",delayHide:500,id:"simulator-button-tooltip",children:[(0,i.jsx)(_.xv,{as:"b",children:"Framework not supported"}),(0,i.jsx)(_.xv,{as:"p",children:"Slice Simulator does not support your framework yet."})]})})},eo=function(e){var n=e.children,t=e.open,r=e.onClose;return(0,i.jsxs)(ei.zs,{open:t,trigger:n,onClose:r,children:[(0,i.jsx)(ei.Ev,{children:"Simulate your slices"}),(0,i.jsx)(ei.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:J.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){w.Xe.track({event:"open-video-tutorials",video:J.Sn})}}),(0,i.jsx)(ei.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(ei.Rp,{children:"Got it"})]})},ea=function(e){var n=e.isSimulatorAvailableForFramework,t=e.disabled,r=(0,a.useRouter)(),o=(0,g.useRef)(null),c=(0,Z.Z)().setSeenSimulatorToolTip,u=(0,$.v9)(function(e){return{hasSeenSimulatorTooltip:(0,en.bv)(e)}}).hasSeenSimulatorTooltip;(0,g.useEffect)(function(){var e=o.current;e&&n&&!u&&setTimeout(function(){return Y.Z.show(e)},5e3)},[n,u]);var l=function(){if(c(),o.current){var e=o.current;Y.Z.hide(e)}};return(0,i.jsxs)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:o,children:[(0,i.jsx)(eo,{open:n&&!u,onClose:l,children:(0,i.jsx)(s.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){l(),window.open("".concat(r.asPath,"/simulator"),J.pq)},disabled:t,renderStartIcon:function(){return(0,i.jsx)(ee.z,{color:s.TV.color.greyLight1,height:s.TV.size[24],style:{transform:"scale(calc(4 / 3))"},width:s.TV.size[24]})},children:"Simulate"})}),!1===n?(0,i.jsx)(er,{}):void 0]})},es=t(29930),ec=t(17329),eu=t(81038);function el(e){return ed.apply(this,arguments)}function ed(){return(ed=(0,m.Z)(function(e){var n,t,i;return(0,x.__generator)(this,function(r){switch(r.label){case 0:return[4,eu.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 ef=t(67445),ev=t(64722),ep=t(20812),em=function(e){return(0,i.jsxs)("svg",(0,y.Z)((0,h.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"})]}))},eh=function(){var e,n,t=(e=(0,ev.l)().source,n=(0,ef.Ag)(e.query),void 0!==n&&(0,ef.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(s.SV,{children:(0,i.jsx)(g.Suspense,{children:(0,i.jsx)(s.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(ey,{sourceCustomTypeId:t})})})}):null},ey=function(e){var n,t=(n=e.sourceCustomTypeId,(0,ec.QT)(el,[n])),r=(0,g.useState)(!0),o=r[0],c=r[1],u=(0,a.useRouter)();if(void 0===t||!o)return null;var l=t.format,d=t.id,f=ef.cd[l].getBuilderPagePathname(d);return(0,i.jsxs)(s.hE,{density:"compact",color:"dark",children:[(0,i.jsxs)(s.zx,{onClick:function(){u.push(f)},renderStartIcon:function(){return(0,i.jsx)(em,{})},children:["Return to ",t.label]}),(0,i.jsx)(s.zx,{onClick:function(){c(!1)},renderStartIcon:function(){return(0,i.jsx)(ep.T,{})}})]})},ex=t(39092),eg=t(47976),ej=function(){var e=C(),n=e.slice,t=e.autoSaveStatus,r=(0,$.v9)(ex.Ql);return(0,i.jsxs)(es.LN,{children:[(0,i.jsxs)(es.wd,{children:[(0,i.jsx)(es.Xq,{url:"/slices"}),(0,i.jsx)(es.Cx,{folder:"Slices",page:n.model.name}),(0,i.jsxs)(es.K2,{children:[(0,i.jsx)(eg.X,{status:t}),(0,i.jsx)(ea,{isSimulatorAvailableForFramework:r,disabled:"saved"!==t})]})]}),(0,i.jsxs)(es.RN,{children:[(0,i.jsxs)(s.xu,{alignItems:"flex-start",display:"grid",gap:16,gridTemplateColumns:"320px 1fr",children:[(0,i.jsx)(Q,{}),(0,i.jsx)(E,{})]}),(0,i.jsx)(eh,{})]})]})},eb=t(28684);function ew(){var e=(0,a.useRouter)(),n=(0,eb.Z)(),t=n.slice,r=n.variation;return void 0===t||void 0===r?(e.replace("/"),null):(0,i.jsx)(S,{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)(ej,{})]})}})}},91061:function(e,n,t){"use strict";t.d(n,{AK:function(){return b},E3:function(){return p},EN:function(){return m},F$:function(){return x},GA:function(){return k},HO:function(){return g},L4:function(){return w},Tr:function(){return v},gR:function(){return Z},j6:function(){return S},kQ:function(){return I},l9:function(){return C},mf:function(){return h},vB:function(){return y},xS:function(){return j},y6:function(){return u}});var i=t(67557),r=t(62230),o=t(85244),a=t(17064),s=t(88866),c=t(98863);function u(e){var n;return null!==(n=e.format)&&void 0!==n?n:"custom"}function l(e){return Object.entries(e.json)}function d(e,n){return e.json[n]}function f(e,n){var t=d(e,n);if(void 0!==t)return Object.entries(t).find(function(e){var n=(0,a.Z)(e,2);return(n[0],n[1]).type===s.SlicesFieldType})}function v(e,n){if(t=e,d=f(t,c=n),(v=(0,a.Z)(null!=d?d:[],2))[0],null!==(u=null==(p=v[1])?void 0:p.config)&&void 0!==u?u:void 0)return e;var t,c,u,d,v,p,m=function(e,n){var t,i=l(e),r=i.findIndex(function(e){return(0,a.Z)(e,1)[0]===n}),o=i.flatMap(function(e){var n=(0,a.Z)(e,2),t=(n[0],n[1]);return Object.keys(t).filter(function(e){return t[e].type===s.SlicesFieldType})}),c=r;do t="slices".concat(0!==c?c.toString():""),c++;while(o.includes(t));return t}(e,n);return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,(0,o.Z)((0,r.Z)({},e.json[n]),(0,i.Z)({},m,{type:s.SlicesFieldType,fieldset:"Slice Zone"}))))})}function p(e,n){var t=d(e,n);if(void 0===t)return e;var a=Object.keys(t).find(function(e){return t[e].type===s.SlicesFieldType});if(void 0===a)return e;var u=(0,c.ud)(t,a);return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,u))})}function m(e){var n,t,a=e.customType,u=e.sectionId,l=e.sliceId,f=d(a,u);if(void 0===f)return a;var v=Object.keys(f).find(function(e){return f[e].type===s.SlicesFieldType});if(void 0===v)return a;var p=f[v];if(p.type!==s.SlicesFieldType)return a;var m=(0,c.ud)(null!==(t=null===(n=p.config)||void 0===n?void 0:n.choices)&&void 0!==t?t:{},l);return(0,o.Z)((0,r.Z)({},a),{json:(0,o.Z)((0,r.Z)({},a.json),(0,i.Z)({},u,(0,o.Z)((0,r.Z)({},f),(0,i.Z)({},v,(0,o.Z)((0,r.Z)({},p),{config:(0,o.Z)((0,r.Z)({},p.config),{choices:m})})))))})}function h(e){var n,t=(0,o.Z)((0,r.Z)({},e),{format:"page"}),i=l(e)[0];if(i){var s=(0,a.Z)(i,1)[0];t=v(t,s)}return t}function y(e,n){return(0,o.Z)((0,r.Z)({},e),{json:(0,o.Z)((0,r.Z)({},e.json),(0,i.Z)({},n,{}))})}function x(e,n){var t=(0,c.ud)(e.json,n);return(0,o.Z)((0,r.Z)({},e),{json:t})}function g(e,n,t){if(n===t)return e;var i=Object.keys(e.json).reduce(function(i,r){return r===n?i[t]=e.json[r]:i[r]=e.json[r],i},{});return(0,o.Z)((0,r.Z)({},e),{json:i})}function j(e){var n=e.customType,t=e.sectionId,a=e.newField,s=e.newFieldId;return T({customType:n,sectionId:t,updatedSection:(0,o.Z)((0,r.Z)({},n.json[t]),(0,i.Z)({},s,a))})}function b(e){var n=e.customType,t=e.sectionId,i=e.fieldId,r=(0,c.ud)(n.json[t],i);return T({customType:n,sectionId:t,updatedSection:r})}function w(e){var n=e.customType,t=e.sectionId,i=e.previousFieldId,r=e.newFieldId,o=e.newField,a=F({fields:n.json[t],previousFieldId:i,newFieldId:r,newField:o});return T({customType:n,sectionId:t,updatedSection:a})}function Z(e){var n=e.customType,t=e.sectionId,i=e.sourceIndex,r=e.destinationIndex,o=n.json[t],c=f(n,t),u=Object.fromEntries(Object.entries(o).filter(function(e){var n=(0,a.Z)(e,2);return(n[0],n[1]).type!==s.SlicesFieldType})),l=E({fields:u,sourceIndex:i,destinationIndex:r});if(void 0!==c){var d=(0,a.Z)(c,2),v=d[0],p=d[1];l[v]=p}return T({customType:n,sectionId:t,updatedSection:l})}function I(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.newField,u=e.newFieldId,l=R({customType:t,sectionId:a,groupFieldId:s}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l)return t;var f=A(l,(0,o.Z)((0,r.Z)({},d),(0,i.Z)({},u,c)));return T({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,f))})}function S(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,u=e.fieldId,l=R({customType:t,sectionId:a,groupFieldId:s}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=(0,c.ud)(d,u),v=A(l,f);return T({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,v))})}function C(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.previousFieldId,u=e.newFieldId,l=e.newField,d=R({customType:t,sectionId:a,groupFieldId:s}),f=null==d?void 0:null===(n=d.config)||void 0===n?void 0:n.fields;if(!d||!f)return t;var v=F({fields:f,previousFieldId:c,newFieldId:u,newField:l}),p=A(d,v);return T({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,p))})}function k(e){var n,t=e.customType,a=e.sectionId,s=e.groupFieldId,c=e.sourceIndex,u=e.destinationIndex,l=R({customType:t,sectionId:a,groupFieldId:s}),d=null==l?void 0:null===(n=l.config)||void 0===n?void 0:n.fields;if(!l||!d)return t;var f=E({fields:d,sourceIndex:c,destinationIndex:u}),v=A(l,f);return T({customType:t,sectionId:a,updatedSection:(0,o.Z)((0,r.Z)({},t.json[a]),(0,i.Z)({},s,v))})}function T(e){var n=e.customType,t=e.sectionId,a=e.updatedSection;return(0,o.Z)((0,r.Z)({},n),{json:(0,o.Z)((0,r.Z)({},n.json),(0,i.Z)({},t,a))})}function F(e){var n=e.fields,t=e.previousFieldId,i=e.newFieldId,r=e.newField;return Object.entries(n).reduce(function(e,n){var o=(0,a.Z)(n,2),s=o[0],c=o[1];return s===t?e[i]=r:s!==i&&(e[s]=c),e},{})}function E(e){var n=e.fields,t=e.sourceIndex,i=e.destinationIndex,r=Object.entries(n),o=(0,a.Z)(r.splice(t,1),1)[0];return r.splice(i,0,o),Object.fromEntries(r)}function R(e){var n=e.customType,t=e.sectionId,i=e.groupFieldId,r=n.json[t][i];if(r.type===s.GroupFieldType)return r}function A(e,n){return(0,o.Z)((0,r.Z)({},e),{config:(0,o.Z)((0,r.Z)({},e.config),{fields:n})})}},28684:function(e,n,t){"use strict";var i=t(5632),r=t(56580),o=t(49222),a=function(){var e=(0,i.useRouter)(),n=(0,r.v9)(function(n){return{slice:(0,o.t)(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}:{}};n.Z=a},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return j}});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 s(e){return(a[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function c(e,n){return void 0===n&&(n=","),e.split(n)}function u(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return s(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([s(e.key),s(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&v([s(e.key),s(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){l.clear()});var l=new Set;function d(e){return Array.isArray(e)}function f(e){var n=Array.isArray(e)?e:[e];l.has("meta")&&l.forEach(function(e){var n;return!o.includes(e)&&l.delete(e.toLowerCase())}),n.forEach(function(e){return l.add(e.toLowerCase())})}function v(e){var n=Array.isArray(e)?e:[e];"meta"===e?l.clear():n.forEach(function(e){return l.delete(e.toLowerCase())})}function p(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 m=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,c=n.mod,u=n.shift,f=n.ctrl,v=n.keys,p=e.key,m=e.code,h=e.ctrlKey,y=e.metaKey,x=e.shiftKey,g=e.altKey,j=s(m),b=p.toLowerCase();if(!t){if(!g===o&&"alt"!==b||!x===u&&"shift"!==b)return!1;if(c){if(!y&&!h)return!1}else if(!y===a&&"meta"!==b&&"os"!==b||!h===f&&"ctrl"!==b&&"control"!==b)return!1}return!!(v&&1===v.length&&(v.includes(b)||v.includes(j)))||(v?(void 0===r&&(r=","),(d(i=v)?i:i.split(r)).every(function(e){return l.has(e.trim().toLowerCase())})):!v)},h=(0,i.createContext)(void 0),y=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),x=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function j(e,n,t,r){var o,a,l=(0,i.useRef)(null),j=(0,i.useRef)(!1),b=t instanceof Array?r instanceof Array?void 0:r:t,w=d(e)?e.join(null==b?void 0:b.splitKey):e,Z=t instanceof Array?t:r instanceof Array?r:void 0,I=(0,i.useCallback)(n,null!=Z?Z:[]),S=(0,i.useRef)(I);Z?S.current=I:S.current=n;var C=(!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,b)&&(a.current=b),a.current),k=(0,i.useContext)(y).enabledScopes,T=(0,i.useContext)(h);return g(function(){if((null==C?void 0:C.enabled)!==!1&&(e=k,n=null==C?void 0:C.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),!(p(e,["input","textarea","select"])&&!p(e,null==C?void 0:C.enableOnFormTags)||null!=C&&null!=C.ignoreEventWhen&&C.ignoreEventWhen(e))){if(null!==l.current&&document.activeElement!==l.current&&!l.current.contains(document.activeElement)){x(e);return}(null==(t=e.target)||!t.isContentEditable||null!=C&&C.enableOnContentEditable)&&c(w,null==C?void 0:C.splitKey).forEach(function(t){var i,r,o,a,s,c,l,d=u(t,null==C?void 0:C.combinationKey);if(m(e,d,null==C?void 0:C.ignoreModifiers)||null!=(l=d.keys)&&l.includes("*")){if(n&&j.current)return;if(i=e,r=d,("function"==typeof(o=null==C?void 0:C.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,s=d,"function"==typeof(c=null==C?void 0:C.enabled)?!c(a,s):!0!==c&&void 0!==c){x(e);return}S.current(e,d),n||(j.current=!0)}})}},i=function(e){void 0!==e.key&&(f(s(e.code)),((null==C?void 0:C.keydown)===void 0&&(null==C?void 0:C.keyup)!==!0||null!=C&&C.keydown)&&t(e))},r=function(e){void 0!==e.key&&(v(s(e.code)),j.current=!1,null!=C&&C.keyup&&t(e,!0))},o=l.current||(null==b?void 0:b.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),T&&c(w,null==C?void 0:C.splitKey).forEach(function(e){return T.addHotkey(u(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),T&&c(w,null==C?void 0:C.splitKey).forEach(function(e){return T.removeHotkey(u(e,null==C?void 0:C.combinationKey,null==C?void 0:C.description))})}}},[w,C,k]),l}}},function(e){e.O(0,[898,789,917,525,461,139,183,50,543,696,25,318,286,774,888,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);
|
package/out/_next/static/chunks/pages/{slices-7b09cb5130c63bb3.js → slices-e9c70c082ca3e3f9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{74600:function(e,n,t){var i=t(34311),r=t(23779),o=i(function(e,n,t){return e+(t?" ":"")+r(n)});e.exports=o},26688:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return t(12472)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),c=t(75289),s=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,a.forwardRef)(function(e,n){var t=e.label,a=e.Icon,d=e.type,f=e.form,m=e.isLoading,p=void 0!==m&&m,x=e.disabled,h=e.onClick,v=e.sx,y=e.iconSize,b=void 0===y?16:y,g=e.iconFill,j=e.variant,C=void 0===j?"primary":j,S=(0,o.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,l.jsx)(c.zx,(0,r.Z)((0,i.Z)({ref:n,sx:(0,i.Z)((0,r.Z)((0,i.Z)({},void 0===v?{}:v),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),p?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==x&&x||p,onClick:p?void 0:h,variant:C},S),{children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.$j,{size:b,color:u(C),"data-cy":s(S["data-cy"],"spinner")}),a&&t]}):(0,l.jsxs)(l.Fragment,{children:[a&&(0,l.jsx)(a,{size:b,fill:g,"data-cy":s(S["data-cy"],"icon")}),t]})}))})},45466:function(e,n,t){"use strict";t.d(n,{c:function(){return j}});var i=t(22710),r=t(62230),o=t(85244),l=t(99267),a=t(52322),c=t(75289),s=t(2784),u=t(36131),d=t(68780),f=t(88932),m=t(38876),p=t(81038),x=t(82770);function h(){return(h=(0,i.Z)(function(e){var n,t,i,r,o,a,c;return(0,l.__generator)(this,function(l){switch(l.label){case 0:var s;return l.trys.push([0,3,,4]),n=e.sliceName,t=e.libraryName,i=e.onSuccess,s=n,r={id:(0,m.T3)(s),type:"SharedSlice",name:s,description:s,variations:[{id:v,name:(0,m.MP)(v),docURL:"...",version:"initial",description:(0,m.MP)(v),imageUrl:""},]},[4,p.j.slices.createSlice({libraryID:t,model:r})];case 1:if((o=l.sent().errors).length>0)throw o;return x.Xe.track({event:"slice:created",id:(0,m.MP)(n),name:n,library:t}),[4,i(r)];case 2:return l.sent(),[3,4];case 3:return a=l.sent(),c="Internal Error: Slice not created",console.error(c,a),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v="default",y=t(90374),b=t(66443),g=t(70041),j=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,p=e.remoteSlices,v=(0,y.Z)().createSliceSuccess,j=(0,s.useState)(!1),C=j[0],S=j[1],k=(n=(0,i.Z)(function(e){var n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:var o;return n=e.sliceName,t=e.from,S(!0),[4,function(e){return h.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(o=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,x.y0)()];case 1:return v(n.sent().libraries),f(e,t),[2]}})}),function(e){return o.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,a.jsx)(d.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:C,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){k(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,b.h)(e,m,p)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,a.jsxs)(c.xu,{children:[(0,a.jsx)(g.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,dataCy:"slice-name-input"}),(0,a.jsx)(c.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,a.jsx)(u.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,o.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,o.Z)((0,r.Z)({},e),{colors:(0,o.Z)((0,r.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},70041:function(e,n,t){"use strict";t.d(n,{W:function(){return a}});var i=t(62230),r=t(52322);t(2784);var o=t(63397),l=t(75289),a=function(e){var n=e.name,t=e.label,a=e.placeholder,c=e.error,s=e.dataCy,u=e.onChange;return(0,r.jsxs)(l.xu,{mb:3,children:[(0,r.jsx)(l.__,{htmlFor:n,mb:2,children:t}),(0,r.jsx)(o.gN,(0,i.Z)({name:n,type:"text",placeholder:a,as:l.II,autoComplete:"off"},u?{onChange:u}:null,s?{"data-cy":s}:null)),c?(0,r.jsx)(l.xv,{"data-cy":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:c}):null]})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return s}});var i=t(81541),r=t(75329),o=t(96009),l=t.n(o),a=t(74600),c=t.n(a);function s(e,n,t){var o=e.sliceName;if(!o)return{sliceName:"Cannot be empty"};if(!r.xo.exec(o))return{sliceName:"No special characters allowed"};if(c()(l()(o)).replace(/\s/gm,"")!==o.trim())return{sliceName:"Value has to be PascalCased"};if(o.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(r.lS.includes(o))return{sliceName:"".concat(o," is reserved for Slice Machine use")};var a=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),s=t.map(function(e){return e.name});if((0,i.Z)(a).concat((0,i.Z)(s)).includes(o))return{sliceName:"Slice name is already taken."}}},59469:function(e,n,t){"use strict";var i=t(62230),r=t(52322),o=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,l=e.defineElementKey,a=e.gridTemplateMinPx,c=e.gridGap,s=e.sx;return(0,r.jsx)(o.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===a?"320px":a,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},s),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(l(e),"-").concat(n+1)):null})})}},68780:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),c=t(25812),s=t(63397),u=t(75289),d=t(56577),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,l=e.isOpen,m=e.formId,p=e.validate,x=e.onSubmit,h=e.widthInPx,v=e.initialValues,y=e.content.title,b=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,C=e.isLoading,S=void 0!==C&&C,k=e.buttonLabel,w=void 0===k?"Save":k,L=e.dataCy,I=e.actionMessage;return a().setAppElement("#__next"),(0,o.jsx)(c.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:y,style:{content:{width:null!=h?h:"900px"}},children:(0,o.jsx)(s.J9,{validateOnChange:!0,initialValues:v,validate:function(e){return p?p(e):void 0},onSubmit:function(e){x(e)},children:function(e){var l=e.isValid,a=e.isSubmitting,c=e.values,p=e.errors,x=e.touched,h=e.setFieldValue,v=e.setValues;return(0,o.jsx)(s.l0,(0,r.Z)((0,i.Z)({id:m},null!=L?{"data-cy":L}:null),{children:(0,o.jsx)(f.Z,(0,r.Z)((0,i.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},b),{Header:function(e){var n=e.radius;return(0,o.jsxs)(u.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,o.jsx)(u.X6,{sx:{fontSize:"20px"},children:y}),(0,o.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,o.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,o.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof I?I(e):I}),(0,o.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,o.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||S,children:"Cancel"}),(0,o.jsx)(d.z,{label:w,form:m,type:"submit",disabled:!l||a||S,isLoading:a||S,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:l,isSubmitting:a,values:c,errors:p,touched:x,setFieldValue:h,setValues:v})}))}))}})})}},38876:function(e,n,t){"use strict";t.d(n,{MP:function(){return o},T3:function(){return a},Ti:function(){return r},lV:function(){return c}});var i=/-(\w)/g;function r(e){return e.includes("-")?"['".concat(e,"']"):".".concat(e)}function o(e){return e?(e=e.replace(/_/g,"-").replace(i,function(e,n){return n?n.toUpperCase():""}))[0].toUpperCase()+e.slice(1):""}var l=/\B([A-Z])/g;function a(e){var n;return e.replace(l,"-$1").toLowerCase().replace(/-/g,"_")}var c=function(e){return e.trim().replace(/ /g,"_").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}},12472:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return V}});var i=t(81541),r=t(52322),o=t(22715),l=t(2784),a=t(97729),c=t.n(a),s=t(65077),u=t(75289),d=t(56580),f=t(5632),m=t(88932),p=t(75329),x=t(22337),h=t(45466),v=t(59469),y=t(36887),b=t(82770),g=function(e){var n=e.title,t=e.onCreateNew,i=e.buttonText,o=e.documentationComponent,l=e.videoPublicIdUrl;return(0,r.jsxs)(u.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},children:[(0,r.jsx)(u.xu,{sx:function(e){var n;return{display:"flex",flex:1,alignItems:"center",minWidth:"400px",maxWidth:"70%",border:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02)}},children:(0,r.jsx)(y.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:function(){b.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,r.jsxs)(u.xu,{sx:function(e){var n;return{bg:"white",display:"flex",flexDirection:"column",border:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02),flex:1,minWidth:"400px",maxWidth:"70%"}},children:[(0,r.jsxs)(u.xu,{sx:function(e){var n;return{display:"flex",flexDirection:"column",p:4,borderBottom:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02)}},children:[(0,r.jsx)(u.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:n}),(0,r.jsx)(u.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:o})]}),(0,r.jsxs)(u.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,r.jsx)(u.zx,{onClick:t,"data-cy":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:i}),(0,r.jsx)(u.xv,{sx:{fontSize:"12px",color:"grey04",maxWidth:"280px"},children:"It will be stored locally and you will be able to push it to your repository"})]})]})]})},j=t(15836),C=t(90374),S=t(68780),k=t(70041),w=t(77174),L=t(24340),I=t(75992),N=t(66443),E=function(e){var n=e.sliceName,t=e.sliceId,i=e.libName,o=(0,C.Z)(),l=o.renameSlice,a=o.closeModals,c=(0,d.v9)(function(e){return{isRenameSliceModalOpen:(0,w.gP)(e,L.q.RENAME_SLICE),localLibs:(0,I.Sd)(e),remoteLibs:(0,I.sT)(e)}}),s=c.isRenameSliceModalOpen,f=c.localLibs,m=c.remoteLibs,p=function(e){l(i,t,e.sliceName)};return(0,r.jsx)(S.Z,{dataCy:"rename-slice-modal",isOpen:s,widthInPx:"530px",formId:"rename-slice-modal-".concat(t),close:a,buttonLabel:"Rename",onSubmit:p,initialValues:{sliceName:n},content:{title:"Rename a slice"},validate:function(e){return(0,N.h)(e,f,m)},children:function(e){var n=e.touched,t=e.errors;return(0,r.jsx)(u.xu,{children:(0,r.jsx)(k.W,{name:"sliceName",label:"Slice Name","data-cy":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?t.sliceName:void 0,dataCy:"slice-name-input"})})}})},Z=t(25812),P=t(59326),R=t(54132),_=t(65186),O=t(56577),z=t(3098),F=t(32665),M=function(e){var n=e.sliceId,t=e.sliceName,i=e.libName,o=(0,d.v9)(function(e){return{isSliceModalOpen:(0,w.gP)(e,L.q.DELETE_SLICE),isDeletingSlice:(0,F.hg)(e,z.z.DELETE_SLICE)}}),l=o.isSliceModalOpen,a=o.isDeletingSlice,c=(0,C.Z)(),s=c.closeModals,f=c.deleteSlice,m=(0,P.B7)().theme;return(0,r.jsx)(Z.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:s,children:(0,r.jsx)(R.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},borderFooter:!0,Header:function(){var e;return(0,r.jsxs)(u.kC,{sx:{position:"sticky",background:"gray",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,r.jsxs)(u.kC,{sx:{alignItems:"center"},children:[(0,r.jsx)(_.$vK,{size:20,color:null===(e=m.colors)||void 0===e?void 0:e.greyIcon}),(0,r.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,r.jsx)(u.x8,{type:"button",onClick:s})]})},Footer:function(){return(0,r.jsxs)(u.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,r.jsx)(O.z,{label:"Cancel",variant:"secondary",onClick:function(){return s()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,r.jsx)(O.z,{label:"Delete",variant:"danger",isLoading:a,sx:{minHeight:39,minWidth:78},onClick:function(){return f(n,t,i)}})]})},children:(0,r.jsxs)(u.nv,{children:["This action will immediately make the following changes:",(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:["Delete the"," ",(0,r.jsxs)(u.xv,{sx:{fontWeight:"bold"},children:[i,"/",t,"/"]})," ","directory."]}),(0,r.jsx)("li",{children:"Remove the Slice from all Slice Zones that use it."})]}),"The next time you push your changes to Prismic, the following change will happen:",(0,r.jsx)("ul",{children:(0,r.jsx)("li",{children:"Remove the Slice from the list of available Slices to use in the Page Builder."})}),"You will need to manually remove the Slice from any Pages that currently use it."]})})})},T=t(47731),A=t(71749),D=t(49451),W=t(13858),V=function(){var e,n,t,a,y,b,S=(0,f.useRouter)(),k=(0,C.Z)(),w=k.openRenameSliceModal,L=k.openDeleteSliceModal,N=(0,T.H)(),Z=N.modalPayload,P=N.onOpenModal,R=Z.sliceFilterFn,_=Z.defaultVariationSelector,O=(0,d.v9)(function(e){return{remoteSlices:(0,I.sT)(e),libraries:(0,I.Sd)(e)}}),z=O.remoteSlices,F=O.libraries,V=(0,l.useState)(!1),K=V[0],B=V[1],H=F.filter(function(e){return e.isLocal}),U=F.map(function(e){return e.components=(0,i.Z)(e.components).sort(function(e,n){return e.model.name.localeCompare(n.model.name)}),e}),X=(F||[]).map(function(e){return e.components}).flat(),q=X.length,G=(0,l.useState)(),$=G[0],Y=G[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Slices - Slice Machine"})}),(0,r.jsxs)(x.LN,{children:[(0,r.jsxs)(x.wd,{children:[(0,r.jsx)(x.Cx,{folder:"Slices"}),(null==H?void 0:H.length)!==0&&0!==q?(0,r.jsx)(x.K2,{children:(0,r.jsx)(o.zx,{"data-testid":"create-slice","data-cy":"create-slice",onClick:function(){B(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,r.jsxs)(x.RN,{children:[(0,r.jsx)(s.xR,{sx:{display:"flex",flexDirection:"column"},children:U.length>0?(0,r.jsx)(u.kC,{sx:{flex:1,flexDirection:"column"},children:0===q?(0,r.jsx)(u.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(g,{title:"What are Slices?",onCreateNew:function(){B(!0)},buttonText:"Create one",videoPublicIdUrl:p.rd,documentationComponent:(0,r.jsxs)(r.Fragment,{children:['Slices are sections of your website. Prismic documents contain a dynamic "Slice Zone" that allows content creators to add, edit, and rearrange Slices to compose dynamic layouts for any page design.'," ",(0,r.jsx)(u.rU,{target:"_blank",href:"https://prismic.io/docs/core-concepts/slices",sx:function(e){var n;return{color:null==e?void 0:null===(n=e.colors)||void 0===n?void 0:n.primary}},children:"Learn more"}),"."]})})}):U.map(function(e){var n=e.name,t=e.isLocal,i=e.components;return(0,r.jsxs)(u.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,r.jsxs)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,r.jsx)(u.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,r.jsx)(u.xv,{children:n})}),!t&&(0,r.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,r.jsx)(v.Z,{elems:i,defineElementKey:function(e){return e.model.name},renderElem:function(e){return(0,r.jsx)(A.b,{action:{type:"menu",onRemove:function(){Y(e),L()},onRename:function(){Y(e),w()}},mode:"navigation",onUpdateScreenshot:function(){P({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})},gridGap:"32px 16px"})]},n)})}):void 0}),(null==H?void 0:H.length)>0&&(0,r.jsx)(j.Z,{slices:R(X),defaultVariationSelector:_}),(null==H?void 0:H.length)>0&&K&&(0,r.jsx)(h.c,{localLibraries:H,remoteSlices:z,onSuccess:function(e,n){var t=e.variations[0].id,i=D.Y.getBuilderPagePathname({libraryName:n,sliceName:e.name,variationId:t});S.push(i),m.Am.success((0,W.kQ)({path:"".concat(n,"/").concat(e.name,"/model.json")}))},onClose:function(){B(!1)}}),(0,r.jsx)(E,{sliceId:null!==(e=null==$?void 0:$.model.id)&&void 0!==e?e:"",sliceName:null!==(n=null==$?void 0:$.model.name)&&void 0!==n?n:"",libName:null!==(t=null==$?void 0:$.from)&&void 0!==t?t:"","data-cy":"rename-slice-modal"}),(0,r.jsx)(M,{sliceId:null!==(a=null==$?void 0:$.model.id)&&void 0!==a?a:"",sliceName:null!==(y=null==$?void 0:$.model.name)&&void 0!==y?y:"",libName:null!==(b=null==$?void 0:$.from)&&void 0!==b?b:""})]})]})]})}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return g}});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"],l={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 a(e){return(l[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function c(e,n){return void 0===n&&(n=","),e.split(n)}function s(e,n,t){void 0===n&&(n="+");var i,l=e.toLocaleLowerCase().split(n).map(function(e){return a(e)});return r({},{alt:l.includes("alt"),ctrl:l.includes("ctrl")||l.includes("control"),shift:l.includes("shift"),meta:l.includes("meta"),mod:l.includes("mod")},{keys:l.filter(function(e){return!o.includes(e)}),description:t})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([a(e.key),a(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([a(e.key),a(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 p(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 x=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,l=n.meta,c=n.mod,s=n.shift,f=n.ctrl,m=n.keys,p=e.key,x=e.code,h=e.ctrlKey,v=e.metaKey,y=e.shiftKey,b=e.altKey,g=a(x),j=p.toLowerCase();if(!t){if(!b===o&&"alt"!==j||!y===s&&"shift"!==j)return!1;if(c){if(!v&&!h)return!1}else if(!v===l&&"meta"!==j&&"os"!==j||!h===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(g)))||(m?(void 0===r&&(r=","),(d(i=m)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},h=(0,i.createContext)(void 0),v=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},b="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function g(e,n,t,r){var o,l,u=(0,i.useRef)(null),g=(0,i.useRef)(!1),j=t instanceof Array?r instanceof Array?void 0:r:t,C=d(e)?e.join(null==j?void 0:j.splitKey):e,S=t instanceof Array?t:r instanceof Array?r:void 0,k=(0,i.useCallback)(n,null!=S?S:[]),w=(0,i.useRef)(k);S?w.current=k:w.current=n;var L=(!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}((l=(0,i.useRef)(void 0)).current,j)&&(l.current=j),l.current),I=(0,i.useContext)(v).enabledScopes,N=(0,i.useContext)(h);return b(function(){if((null==L?void 0:L.enabled)!==!1&&(e=I,n=null==L?void 0:L.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),!(p(e,["input","textarea","select"])&&!p(e,null==L?void 0:L.enableOnFormTags)||null!=L&&null!=L.ignoreEventWhen&&L.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!=L&&L.enableOnContentEditable)&&c(C,null==L?void 0:L.splitKey).forEach(function(t){var i,r,o,l,a,c,u,d=s(t,null==L?void 0:L.combinationKey);if(x(e,d,null==L?void 0:L.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&g.current)return;if(i=e,r=d,("function"==typeof(o=null==L?void 0:L.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),l=e,a=d,"function"==typeof(c=null==L?void 0:L.enabled)?!c(l,a):!0!==c&&void 0!==c){y(e);return}w.current(e,d),n||(g.current=!0)}})}},i=function(e){void 0!==e.key&&(f(a(e.code)),((null==L?void 0:L.keydown)===void 0&&(null==L?void 0:L.keyup)!==!0||null!=L&&L.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(a(e.code)),g.current=!1,null!=L&&L.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),N&&c(C,null==L?void 0:L.splitKey).forEach(function(e){return N.addHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),N&&c(C,null==L?void 0:L.splitKey).forEach(function(e){return N.removeHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))})}}},[C,L,I]),u}}},function(e){e.O(0,[898,789,50,25,286,774,888,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[436],{74600:function(e,n,t){var i=t(34311),r=t(23779),o=i(function(e,n,t){return e+(t?" ":"")+r(n)});e.exports=o},26688:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/slices",function(){return t(12472)}])},56577:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var i=t(62230),r=t(85244),o=t(98240),l=t(52322),a=t(2784),c=t(75289),s=function(e,n){return e?"".concat(e,"-").concat(n):""},u=function(e){switch(e){case"white":case"secondaryMedium":case"secondarySmall":case"secondary":return"#1A1523";default:return"grey01"}},d=(0,a.forwardRef)(function(e,n){var t=e.label,a=e.Icon,d=e.type,f=e.form,m=e.isLoading,p=void 0!==m&&m,x=e.disabled,h=e.onClick,v=e.sx,y=e.iconSize,b=void 0===y?16:y,g=e.iconFill,j=e.variant,C=void 0===j?"primary":j,S=(0,o.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,l.jsx)(c.zx,(0,r.Z)((0,i.Z)({ref:n,sx:(0,i.Z)((0,r.Z)((0,i.Z)({},void 0===v?{}:v),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),p?{cursor:"wait !important"}:{}),type:d,form:f,disabled:void 0!==x&&x||p,onClick:p?void 0:h,variant:C},S),{children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.$j,{size:b,color:u(C),"data-cy":s(S["data-cy"],"spinner")}),a&&t]}):(0,l.jsxs)(l.Fragment,{children:[a&&(0,l.jsx)(a,{size:b,fill:g,"data-cy":s(S["data-cy"],"icon")}),t]})}))})},45466:function(e,n,t){"use strict";t.d(n,{c:function(){return j}});var i=t(22710),r=t(62230),o=t(85244),l=t(99267),a=t(52322),c=t(75289),s=t(2784),u=t(36131),d=t(68780),f=t(88932),m=t(38876),p=t(81038),x=t(82770);function h(){return(h=(0,i.Z)(function(e){var n,t,i,r,o,a,c;return(0,l.__generator)(this,function(l){switch(l.label){case 0:var s;return l.trys.push([0,3,,4]),n=e.sliceName,t=e.libraryName,i=e.onSuccess,s=n,r={id:(0,m.T3)(s),type:"SharedSlice",name:s,description:s,variations:[{id:v,name:(0,m.MP)(v),docURL:"...",version:"initial",description:(0,m.MP)(v),imageUrl:""},]},[4,p.j.slices.createSlice({libraryID:t,model:r})];case 1:if((o=l.sent().errors).length>0)throw o;return x.Xe.track({event:"slice:created",id:(0,m.MP)(n),name:n,library:t}),[4,i(r)];case 2:return l.sent(),[3,4];case 3:return a=l.sent(),c="Internal Error: Slice not created",console.error(c,a),f.Am.error(c),[3,4];case 4:return[2]}})})).apply(this,arguments)}var v="default",y=t(90374),b=t(66443),g=t(70041),j=function(e){var n,t=e.onClose,f=e.onSuccess,m=e.localLibraries,p=e.remoteSlices,v=(0,y.Z)().createSliceSuccess,j=(0,s.useState)(!1),C=j[0],S=j[1],k=(n=(0,i.Z)(function(e){var n,t;return(0,l.__generator)(this,function(r){switch(r.label){case 0:var o;return n=e.sliceName,t=e.from,S(!0),[4,function(e){return h.apply(this,arguments)}({sliceName:n,libraryName:t,onSuccess:(o=(0,i.Z)(function(e){var n;return(0,l.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,x.y0)()];case 1:return v(n.sent().libraries),f(e,t),[2]}})}),function(e){return o.apply(this,arguments)})})];case 1:return r.sent(),[2]}})}),function(e){return n.apply(this,arguments)});return(0,a.jsx)(d.Z,{dataCy:"create-slice-modal",isOpen:!0,widthInPx:"530px",isLoading:C,formId:"create-new-slice",close:t,buttonLabel:"Create",onSubmit:function(e){k(e)},initialValues:{sliceName:"",from:m[0].name},validate:function(e){return(0,b.h)(e,m,p)},content:{title:"Create a new slice"},children:function(e){var n=e.touched,t=e.values,i=e.setFieldValue,l=e.errors;return(0,a.jsxs)(c.xu,{children:[(0,a.jsx)(g.W,{name:"sliceName",label:"Slice Name",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?l.sliceName:void 0,dataCy:"slice-name-input"}),(0,a.jsx)(c.__,{htmlFor:"from",sx:{mb:2},children:"Target Library"}),(0,a.jsx)(u.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,o.Z)((0,r.Z)({},e),{color:"#161618"})}},theme:function(e){return(0,o.Z)((0,r.Z)({},e),{colors:(0,o.Z)((0,r.Z)({},e.colors),{primary:"#E9E8EA"})})},menuPortalTarget:document.body})]})}})}},70041:function(e,n,t){"use strict";t.d(n,{W:function(){return a}});var i=t(62230),r=t(52322);t(2784);var o=t(63397),l=t(75289),a=function(e){var n=e.name,t=e.label,a=e.placeholder,c=e.error,s=e.dataCy,u=e.onChange;return(0,r.jsxs)(l.xu,{mb:3,children:[(0,r.jsx)(l.__,{htmlFor:n,mb:2,children:t}),(0,r.jsx)(o.gN,(0,i.Z)({name:n,type:"text",placeholder:a,as:l.II,autoComplete:"off"},u?{onChange:u}:null,s?{"data-cy":s}:null)),c?(0,r.jsx)(l.xv,{"data-cy":s?"".concat(s,"-error"):"input-error",sx:{color:"error",mt:1},children:c}):null]})}},66443:function(e,n,t){"use strict";t.d(n,{h:function(){return s}});var i=t(81541),r=t(75329),o=t(96009),l=t.n(o),a=t(74600),c=t.n(a);function s(e,n,t){var o=e.sliceName;if(!o)return{sliceName:"Cannot be empty"};if(!r.xo.exec(o))return{sliceName:"No special characters allowed"};if(c()(l()(o)).replace(/\s/gm,"")!==o.trim())return{sliceName:"Value has to be PascalCased"};if(o.match(/^\d/))return{sliceName:"Value cannot start with a number"};if(r.lS.includes(o))return{sliceName:"".concat(o," is reserved for Slice Machine use")};var a=n.flatMap(function(e){return e.components.map(function(e){return e.model.name})}),s=t.map(function(e){return e.name});if((0,i.Z)(a).concat((0,i.Z)(s)).includes(o))return{sliceName:"Slice name is already taken."}}},59469:function(e,n,t){"use strict";var i=t(62230),r=t(52322),o=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,l=e.defineElementKey,a=e.gridTemplateMinPx,c=e.gridGap,s=e.sx;return(0,r.jsx)(o.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===a?"320px":a,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},s),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(l(e),"-").concat(n+1)):null})})}},68780:function(e,n,t){"use strict";var i=t(62230),r=t(85244),o=t(52322),l=t(37149),a=t.n(l),c=t(25812),s=t(63397),u=t(75289),d=t(56577),f=t(54132);n.Z=function(e){var n=e.children,t=e.close,l=e.isOpen,m=e.formId,p=e.validate,x=e.onSubmit,h=e.widthInPx,v=e.initialValues,y=e.content.title,b=e.cardProps,g=e.omitFooter,j=void 0!==g&&g,C=e.isLoading,S=void 0!==C&&C,k=e.buttonLabel,w=void 0===k?"Save":k,L=e.dataCy,I=e.actionMessage;return a().setAppElement("#__next"),(0,o.jsx)(c.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,onRequestClose:t,contentLabel:y,style:{content:{width:null!=h?h:"900px"}},children:(0,o.jsx)(s.J9,{validateOnChange:!0,initialValues:v,validate:function(e){return p?p(e):void 0},onSubmit:function(e){x(e)},children:function(e){var l=e.isValid,a=e.isSubmitting,c=e.values,p=e.errors,x=e.touched,h=e.setFieldValue,v=e.setValues;return(0,o.jsx)(s.l0,(0,r.Z)((0,i.Z)({id:m},null!=L?{"data-cy":L}:null),{children:(0,o.jsx)(f.Z,(0,r.Z)((0,i.Z)({borderFooter:!0,footerSx:{p:3,position:"sticky",bottom:0,background:"gray"},bodySx:{px:4,py:4},sx:{border:"none"}},b),{Header:function(e){var n=e.radius;return(0,o.jsxs)(u.kC,{sx:{position:"sticky",top:0,zIndex:1,p:"16px",pl:4,bg:"headSection",alignItems:"center",justifyContent:"space-between",borderTopLeftRadius:n,borderTopRightRadius:n,borderBottom:function(e){var n;return"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.borders)}},children:[(0,o.jsx)(u.X6,{sx:{fontSize:"20px"},children:y}),(0,o.jsx)(u.x8,{type:"button",onClick:t})]})},Footer:j?null:(0,o.jsxs)(u.kC,{sx:{alignItems:"space-between"},children:[(0,o.jsx)(u.kC,{sx:{fontSize:"14px",alignItems:"center"},children:"function"==typeof I?I(e):I}),(0,o.jsxs)(u.kC,{sx:{ml:"auto"},children:[(0,o.jsx)(u.zx,{mr:2,type:"button",onClick:t,variant:"secondary",disabled:a||S,children:"Cancel"}),(0,o.jsx)(d.z,{label:w,form:m,type:"submit",disabled:!l||a||S,isLoading:a||S,sx:{fontWeight:"400",paddingBlock:"8px",paddingInline:"16px",fontSize:"14px",borderRadius:"4px"}})]})]}),children:n({isValid:l,isSubmitting:a,values:c,errors:p,touched:x,setFieldValue:h,setValues:v})}))}))}})})}},38876:function(e,n,t){"use strict";t.d(n,{MP:function(){return o},T3:function(){return a},Ti:function(){return r},lV:function(){return c}});var i=/-(\w)/g;function r(e){return e.includes("-")?"['".concat(e,"']"):".".concat(e)}function o(e){return e?(e=e.replace(/_/g,"-").replace(i,function(e,n){return n?n.toUpperCase():""}))[0].toUpperCase()+e.slice(1):""}var l=/\B([A-Z])/g;function a(e){var n;return e.replace(l,"-$1").toLowerCase().replace(/-/g,"_")}var c=function(e){return e.trim().replace(/ /g,"_").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}},12472:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return V}});var i=t(81541),r=t(52322),o=t(22715),l=t(2784),a=t(97729),c=t.n(a),s=t(65077),u=t(75289),d=t(56580),f=t(5632),m=t(88932),p=t(75329),x=t(29930),h=t(45466),v=t(59469),y=t(36887),b=t(82770),g=function(e){var n=e.title,t=e.onCreateNew,i=e.buttonText,o=e.documentationComponent,l=e.videoPublicIdUrl;return(0,r.jsxs)(u.xu,{sx:{display:"flex",width:"80%",flexWrap:"wrap",justifyContent:"center"},children:[(0,r.jsx)(u.xu,{sx:function(e){var n;return{display:"flex",flex:1,alignItems:"center",minWidth:"400px",maxWidth:"70%",border:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02)}},children:(0,r.jsx)(y.nk,{cloudName:"dmtf1daqp",controls:!0,loop:!0,style:{maxWidth:"100%",objectFit:"contain"},publicId:l,onPlay:function(){b.Xe.track({event:"open-video-tutorials",video:l})}})}),(0,r.jsxs)(u.xu,{sx:function(e){var n;return{bg:"white",display:"flex",flexDirection:"column",border:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02),flex:1,minWidth:"400px",maxWidth:"70%"}},children:[(0,r.jsxs)(u.xu,{sx:function(e){var n;return{display:"flex",flexDirection:"column",p:4,borderBottom:"1px solid ".concat(null===(n=e.colors)||void 0===n?void 0:n.grey02)}},children:[(0,r.jsx)(u.X6,{as:"h3",variant:"heading",sx:{fontSize:"16px",lineHeight:"24px",mb:2},children:n}),(0,r.jsx)(u.xv,{variant:"xs",sx:{lineHeight:"24px",fontSize:"13px"},children:o})]}),(0,r.jsxs)(u.xu,{sx:{display:"flex",p:4,alignItems:"center"},children:[(0,r.jsx)(u.zx,{onClick:t,"data-cy":"empty-state-main-button",sx:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:0,mr:4},children:i}),(0,r.jsx)(u.xv,{sx:{fontSize:"12px",color:"grey04",maxWidth:"280px"},children:"It will be stored locally and you will be able to push it to your repository"})]})]})]})},j=t(15836),C=t(90374),S=t(68780),k=t(70041),w=t(77174),L=t(24340),I=t(75992),N=t(66443),E=function(e){var n=e.sliceName,t=e.sliceId,i=e.libName,o=(0,C.Z)(),l=o.renameSlice,a=o.closeModals,c=(0,d.v9)(function(e){return{isRenameSliceModalOpen:(0,w.gP)(e,L.q.RENAME_SLICE),localLibs:(0,I.Sd)(e),remoteLibs:(0,I.sT)(e)}}),s=c.isRenameSliceModalOpen,f=c.localLibs,m=c.remoteLibs,p=function(e){l(i,t,e.sliceName)};return(0,r.jsx)(S.Z,{dataCy:"rename-slice-modal",isOpen:s,widthInPx:"530px",formId:"rename-slice-modal-".concat(t),close:a,buttonLabel:"Rename",onSubmit:p,initialValues:{sliceName:n},content:{title:"Rename a slice"},validate:function(e){return(0,N.h)(e,f,m)},children:function(e){var n=e.touched,t=e.errors;return(0,r.jsx)(u.xu,{children:(0,r.jsx)(k.W,{name:"sliceName",label:"Slice Name","data-cy":"slice-name-input",placeholder:"Pascalised Slice API ID (e.g. TextBlock)",error:n.sliceName?t.sliceName:void 0,dataCy:"slice-name-input"})})}})},Z=t(25812),P=t(59326),R=t(54132),_=t(65186),O=t(56577),z=t(3098),F=t(32665),M=function(e){var n=e.sliceId,t=e.sliceName,i=e.libName,o=(0,d.v9)(function(e){return{isSliceModalOpen:(0,w.gP)(e,L.q.DELETE_SLICE),isDeletingSlice:(0,F.hg)(e,z.z.DELETE_SLICE)}}),l=o.isSliceModalOpen,a=o.isDeletingSlice,c=(0,C.Z)(),s=c.closeModals,f=c.deleteSlice,m=(0,P.B7)().theme;return(0,r.jsx)(Z.Z,{isOpen:l,shouldCloseOnOverlayClick:!0,style:{content:{maxWidth:612}},onRequestClose:s,children:(0,r.jsx)(R.Z,{bodySx:{p:0,bg:"white",position:"relative",height:"100%",padding:16},footerSx:{position:"sticky",bottom:0,p:0},sx:{border:"none"},borderFooter:!0,Header:function(){var e;return(0,r.jsxs)(u.kC,{sx:{position:"sticky",background:"gray",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,r.jsxs)(u.kC,{sx:{alignItems:"center"},children:[(0,r.jsx)(_.$vK,{size:20,color:null===(e=m.colors)||void 0===e?void 0:e.greyIcon}),(0,r.jsx)(u.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:"Delete Slice"})]}),(0,r.jsx)(u.x8,{type:"button",onClick:s})]})},Footer:function(){return(0,r.jsxs)(u.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,r.jsx)(O.z,{label:"Cancel",variant:"secondary",onClick:function(){return s()},sx:{mr:"10px",fontWeight:"bold",color:"grey12",borderRadius:6}}),(0,r.jsx)(O.z,{label:"Delete",variant:"danger",isLoading:a,sx:{minHeight:39,minWidth:78},onClick:function(){return f(n,t,i)}})]})},children:(0,r.jsxs)(u.nv,{children:["This action will immediately make the following changes:",(0,r.jsxs)("ul",{children:[(0,r.jsxs)("li",{children:["Delete the"," ",(0,r.jsxs)(u.xv,{sx:{fontWeight:"bold"},children:[i,"/",t,"/"]})," ","directory."]}),(0,r.jsx)("li",{children:"Remove the Slice from all Slice Zones that use it."})]}),"The next time you push your changes to Prismic, the following change will happen:",(0,r.jsx)("ul",{children:(0,r.jsx)("li",{children:"Remove the Slice from the list of available Slices to use in the Page Builder."})}),"You will need to manually remove the Slice from any Pages that currently use it."]})})})},T=t(47731),A=t(71749),D=t(49451),W=t(13858),V=function(){var e,n,t,a,y,b,S=(0,f.useRouter)(),k=(0,C.Z)(),w=k.openRenameSliceModal,L=k.openDeleteSliceModal,N=(0,T.H)(),Z=N.modalPayload,P=N.onOpenModal,R=Z.sliceFilterFn,_=Z.defaultVariationSelector,O=(0,d.v9)(function(e){return{remoteSlices:(0,I.sT)(e),libraries:(0,I.Sd)(e)}}),z=O.remoteSlices,F=O.libraries,V=(0,l.useState)(!1),K=V[0],B=V[1],H=F.filter(function(e){return e.isLocal}),U=F.map(function(e){return e.components=(0,i.Z)(e.components).sort(function(e,n){return e.model.name.localeCompare(n.model.name)}),e}),X=(F||[]).map(function(e){return e.components}).flat(),q=X.length,G=(0,l.useState)(),$=G[0],Y=G[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Slices - Slice Machine"})}),(0,r.jsxs)(x.LN,{children:[(0,r.jsxs)(x.wd,{children:[(0,r.jsx)(x.Cx,{folder:"Slices"}),(null==H?void 0:H.length)!==0&&0!==q?(0,r.jsx)(x.K2,{children:(0,r.jsx)(o.zx,{"data-testid":"create-slice","data-cy":"create-slice",onClick:function(){B(!0)},startIcon:"add",children:"Create"})}):void 0]}),(0,r.jsxs)(x.RN,{children:[(0,r.jsx)(s.xR,{sx:{display:"flex",flexDirection:"column"},children:U.length>0?(0,r.jsx)(u.kC,{sx:{flex:1,flexDirection:"column"},children:0===q?(0,r.jsx)(u.kC,{sx:{flex:1,justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(g,{title:"What are Slices?",onCreateNew:function(){B(!0)},buttonText:"Create one",videoPublicIdUrl:p.rd,documentationComponent:(0,r.jsxs)(r.Fragment,{children:['Slices are sections of your website. Prismic documents contain a dynamic "Slice Zone" that allows content creators to add, edit, and rearrange Slices to compose dynamic layouts for any page design.'," ",(0,r.jsx)(u.rU,{target:"_blank",href:"https://prismic.io/docs/core-concepts/slices",sx:function(e){var n;return{color:null==e?void 0:null===(n=e.colors)||void 0===n?void 0:n.primary}},children:"Learn more"}),"."]})})}):U.map(function(e){var n=e.name,t=e.isLocal,i=e.components;return(0,r.jsxs)(u.kC,{sx:{flexDirection:"column","&:not(:last-of-type)":{mb:4}},children:[(0,r.jsxs)(u.kC,{sx:{alignItems:"center",justifyContent:"space-between"},children:[(0,r.jsx)(u.kC,{sx:{alignItems:"center",fontSize:3,lineHeight:"48px",fontWeight:"heading",mb:1},children:(0,r.jsx)(u.xv,{children:n})}),!t&&(0,r.jsx)("p",{children:"⚠️ External libraries are read-only"})]}),(0,r.jsx)(v.Z,{elems:i,defineElementKey:function(e){return e.model.name},renderElem:function(e){return(0,r.jsx)(A.b,{action:{type:"menu",onRemove:function(){Y(e),L()},onRename:function(){Y(e),w()}},mode:"navigation",onUpdateScreenshot:function(){P({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})},gridGap:"32px 16px"})]},n)})}):void 0}),(null==H?void 0:H.length)>0&&(0,r.jsx)(j.Z,{slices:R(X),defaultVariationSelector:_}),(null==H?void 0:H.length)>0&&K&&(0,r.jsx)(h.c,{localLibraries:H,remoteSlices:z,onSuccess:function(e,n){var t=e.variations[0].id,i=D.Y.getBuilderPagePathname({libraryName:n,sliceName:e.name,variationId:t});S.push(i),m.Am.success((0,W.kQ)({path:"".concat(n,"/").concat(e.name,"/model.json")}))},onClose:function(){B(!1)}}),(0,r.jsx)(E,{sliceId:null!==(e=null==$?void 0:$.model.id)&&void 0!==e?e:"",sliceName:null!==(n=null==$?void 0:$.model.name)&&void 0!==n?n:"",libName:null!==(t=null==$?void 0:$.from)&&void 0!==t?t:"","data-cy":"rename-slice-modal"}),(0,r.jsx)(M,{sliceId:null!==(a=null==$?void 0:$.model.id)&&void 0!==a?a:"",sliceName:null!==(y=null==$?void 0:$.model.name)&&void 0!==y?y:"",libName:null!==(b=null==$?void 0:$.from)&&void 0!==b?b:""})]})]})]})}},76473:function(e,n,t){"use strict";t.d(n,{y1:function(){return g}});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"],l={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 a(e){return(l[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function c(e,n){return void 0===n&&(n=","),e.split(n)}function s(e,n,t){void 0===n&&(n="+");var i,l=e.toLocaleLowerCase().split(n).map(function(e){return a(e)});return r({},{alt:l.includes("alt"),ctrl:l.includes("ctrl")||l.includes("control"),shift:l.includes("shift"),meta:l.includes("meta"),mod:l.includes("mod")},{keys:l.filter(function(e){return!o.includes(e)}),description:t})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&f([a(e.key),a(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&m([a(e.key),a(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 p(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 x=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,l=n.meta,c=n.mod,s=n.shift,f=n.ctrl,m=n.keys,p=e.key,x=e.code,h=e.ctrlKey,v=e.metaKey,y=e.shiftKey,b=e.altKey,g=a(x),j=p.toLowerCase();if(!t){if(!b===o&&"alt"!==j||!y===s&&"shift"!==j)return!1;if(c){if(!v&&!h)return!1}else if(!v===l&&"meta"!==j&&"os"!==j||!h===f&&"ctrl"!==j&&"control"!==j)return!1}return!!(m&&1===m.length&&(m.includes(j)||m.includes(g)))||(m?(void 0===r&&(r=","),(d(i=m)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},h=(0,i.createContext)(void 0),v=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},b="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function g(e,n,t,r){var o,l,u=(0,i.useRef)(null),g=(0,i.useRef)(!1),j=t instanceof Array?r instanceof Array?void 0:r:t,C=d(e)?e.join(null==j?void 0:j.splitKey):e,S=t instanceof Array?t:r instanceof Array?r:void 0,k=(0,i.useCallback)(n,null!=S?S:[]),w=(0,i.useRef)(k);S?w.current=k:w.current=n;var L=(!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}((l=(0,i.useRef)(void 0)).current,j)&&(l.current=j),l.current),I=(0,i.useContext)(v).enabledScopes,N=(0,i.useContext)(h);return b(function(){if((null==L?void 0:L.enabled)!==!1&&(e=I,n=null==L?void 0:L.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),!(p(e,["input","textarea","select"])&&!p(e,null==L?void 0:L.enableOnFormTags)||null!=L&&null!=L.ignoreEventWhen&&L.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!=L&&L.enableOnContentEditable)&&c(C,null==L?void 0:L.splitKey).forEach(function(t){var i,r,o,l,a,c,u,d=s(t,null==L?void 0:L.combinationKey);if(x(e,d,null==L?void 0:L.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&g.current)return;if(i=e,r=d,("function"==typeof(o=null==L?void 0:L.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),l=e,a=d,"function"==typeof(c=null==L?void 0:L.enabled)?!c(l,a):!0!==c&&void 0!==c){y(e);return}w.current(e,d),n||(g.current=!0)}})}},i=function(e){void 0!==e.key&&(f(a(e.code)),((null==L?void 0:L.keydown)===void 0&&(null==L?void 0:L.keyup)!==!0||null!=L&&L.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(a(e.code)),g.current=!1,null!=L&&L.keyup&&t(e,!0))},o=u.current||(null==j?void 0:j.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),N&&c(C,null==L?void 0:L.splitKey).forEach(function(e){return N.addHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),N&&c(C,null==L?void 0:L.splitKey).forEach(function(e){return N.removeHotkey(s(e,null==L?void 0:L.combinationKey,null==L?void 0:L.description))})}}},[C,L,I]),u}}},function(e){e.O(0,[898,789,50,25,286,774,888,179],function(){return e(e.s=26688)}),_N_E=e.O()}]);
|
package/out/changelog.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d528dd2b96dccb97.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/183-4feb6bb3eddbc768.js" defer=""></script><script src="/_next/static/chunks/870-0c7a8a9622de78b7.js" defer=""></script><script src="/_next/static/chunks/pages/changelog-afd18276fe018b24.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_buildManifest.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/changelog","query":{},"buildId":"c66ozmNEqPsp5qxNPQX7V","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/changes.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/37153180c3b0dd66.css" as="style"/><link rel="stylesheet" href="/_next/static/css/37153180c3b0dd66.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/37153180c3b0dd66.css" as="style"/><link rel="stylesheet" href="/_next/static/css/37153180c3b0dd66.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d528dd2b96dccb97.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/8eec4907-b712959d9f984b68.js" defer=""></script><script src="/_next/static/chunks/543-f8766685f7f451e2.js" defer=""></script><script src="/_next/static/chunks/918-5bb55fb464e34768.js" defer=""></script><script src="/_next/static/chunks/25-37d6fa7f064be04b.js" defer=""></script><script src="/_next/static/chunks/286-ed90373e9a469944.js" defer=""></script><script src="/_next/static/chunks/pages/changes-898f58035cfafe03.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_buildManifest.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/changes","query":{},"buildId":"c66ozmNEqPsp5qxNPQX7V","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/72465cc1225f28a2.css" as="style"/><link rel="stylesheet" href="/_next/static/css/72465cc1225f28a2.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/72465cc1225f28a2.css" as="style"/><link rel="stylesheet" href="/_next/static/css/72465cc1225f28a2.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d528dd2b96dccb97.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js" defer=""></script><script src="/_next/static/chunks/4c744e84-e3161d754618373f.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-2c5b6c0367fcde86.js" defer=""></script><script src="/_next/static/chunks/183-4feb6bb3eddbc768.js" defer=""></script><script src="/_next/static/chunks/50-cfc2514205b86001.js" defer=""></script><script src="/_next/static/chunks/543-f8766685f7f451e2.js" defer=""></script><script src="/_next/static/chunks/696-b12edad30a3617e5.js" defer=""></script><script src="/_next/static/chunks/474-5a072e6fac61f703.js" defer=""></script><script src="/_next/static/chunks/25-37d6fa7f064be04b.js" defer=""></script><script src="/_next/static/chunks/731-501990ebe6a71b32.js" defer=""></script><script src="/_next/static/chunks/318-541db69860d31138.js" defer=""></script><script src="/_next/static/chunks/904-4c4d0a2183ae9a27.js" defer=""></script><script src="/_next/static/chunks/pages/custom-types/%5BcustomTypeId%5D-3f862ad6111a1fc0.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_buildManifest.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/custom-types/[customTypeId]","query":{},"buildId":"c66ozmNEqPsp5qxNPQX7V","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/custom-types.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/be1f49e49a5aa7eb.css" as="style"/><link rel="stylesheet" href="/_next/static/css/be1f49e49a5aa7eb.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/be1f49e49a5aa7eb.css" as="style"/><link rel="stylesheet" href="/_next/static/css/be1f49e49a5aa7eb.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d528dd2b96dccb97.js" defer=""></script><script src="/_next/static/chunks/731-501990ebe6a71b32.js" defer=""></script><script src="/_next/static/chunks/727-2016e98f80ea6a62.js" defer=""></script><script src="/_next/static/chunks/pages/custom-types-94b8f8dbf7727412.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_buildManifest.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/custom-types","query":{},"buildId":"c66ozmNEqPsp5qxNPQX7V","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/be1f49e49a5aa7eb.css" as="style"/><link rel="stylesheet" href="/_next/static/css/be1f49e49a5aa7eb.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/be1f49e49a5aa7eb.css" as="style"/><link rel="stylesheet" href="/_next/static/css/be1f49e49a5aa7eb.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d528dd2b96dccb97.js" defer=""></script><script src="/_next/static/chunks/731-501990ebe6a71b32.js" defer=""></script><script src="/_next/static/chunks/727-2016e98f80ea6a62.js" defer=""></script><script src="/_next/static/chunks/pages/index-64cfb8b0948ba8ef.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_buildManifest.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"c66ozmNEqPsp5qxNPQX7V","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
package/out/labs.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d528dd2b96dccb97.js" defer=""></script><script src="/_next/static/chunks/pages/labs-ee206005948f8e87.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_buildManifest.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/labs","query":{},"buildId":"c66ozmNEqPsp5qxNPQX7V","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/72465cc1225f28a2.css" as="style"/><link rel="stylesheet" href="/_next/static/css/72465cc1225f28a2.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><link rel="preload" href="/_next/static/css/72465cc1225f28a2.css" as="style"/><link rel="stylesheet" href="/_next/static/css/72465cc1225f28a2.css" data-n-p=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d528dd2b96dccb97.js" defer=""></script><script src="/_next/static/chunks/59b4e022-7a3b5554b806349f.js" defer=""></script><script src="/_next/static/chunks/f36c6662-03bb5e9d9aa0b0aa.js" defer=""></script><script src="/_next/static/chunks/4c744e84-e3161d754618373f.js" defer=""></script><script src="/_next/static/chunks/065a3ddb-9a38ca0d60f0bf2f.js" defer=""></script><script src="/_next/static/chunks/1cc2734a-2c5b6c0367fcde86.js" defer=""></script><script src="/_next/static/chunks/183-4feb6bb3eddbc768.js" defer=""></script><script src="/_next/static/chunks/50-cfc2514205b86001.js" defer=""></script><script src="/_next/static/chunks/543-f8766685f7f451e2.js" defer=""></script><script src="/_next/static/chunks/696-b12edad30a3617e5.js" defer=""></script><script src="/_next/static/chunks/474-5a072e6fac61f703.js" defer=""></script><script src="/_next/static/chunks/25-37d6fa7f064be04b.js" defer=""></script><script src="/_next/static/chunks/731-501990ebe6a71b32.js" defer=""></script><script src="/_next/static/chunks/318-541db69860d31138.js" defer=""></script><script src="/_next/static/chunks/904-4c4d0a2183ae9a27.js" defer=""></script><script src="/_next/static/chunks/pages/page-types/%5BpageTypeId%5D-d1ffca11c42f2603.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_buildManifest.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/page-types/[pageTypeId]","query":{},"buildId":"c66ozmNEqPsp5qxNPQX7V","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/_next/static/css/200244e3e0463c39.css" as="style"/><link rel="stylesheet" href="/_next/static/css/200244e3e0463c39.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-2f903acb0cccbf9e.js" defer=""></script><script src="/_next/static/chunks/framework-cdccea7a52cc6e81.js" defer=""></script><script src="/_next/static/chunks/main-5e6780279ca21cb9.js" defer=""></script><script src="/_next/static/chunks/pages/_app-d528dd2b96dccb97.js" defer=""></script><script src="/_next/static/chunks/c8eae200-966ce352f7b5d2b9.js" defer=""></script><script src="/_next/static/chunks/72585f70-28b4d7d5384b3703.js" defer=""></script><script src="/_next/static/chunks/18539003-5cc559566b738915.js" defer=""></script><script src="/_next/static/chunks/376-7e784d6069e01654.js" defer=""></script><script src="/_next/static/chunks/pages/slices/%5Blib%5D/%5BsliceName%5D/%5Bvariation%5D/simulator-897ca93c114a1435.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_buildManifest.js" defer=""></script><script src="/_next/static/c66ozmNEqPsp5qxNPQX7V/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/slices/[lib]/[sliceName]/[variation]/simulator","query":{},"buildId":"c66ozmNEqPsp5qxNPQX7V","runtimeConfig":{"sentryEnvironment":"beta"},"nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
|