slice-machine-ui 2.3.1-beta.7 → 2.3.1-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/out/404.html +1 -1
  2. package/out/_next/static/{qBIKwMGCCngU7ltrCgjdx → 0ETE5dlTEPuCz59mfdi2V}/_buildManifest.js +1 -1
  3. package/out/_next/static/chunks/{18539003-059b491c0b76757a.js → 18539003-8429c4c48ccee432.js} +15 -15
  4. package/out/_next/static/chunks/448-04106caae9b8c06f.js +1 -0
  5. package/out/_next/static/chunks/574-05cd6a55733bfa63.js +1 -0
  6. package/out/_next/static/chunks/pages/{_app-3f5ee8a060fdd43e.js → _app-1ff22f216b873334.js} +64 -64
  7. package/out/_next/static/chunks/pages/{changes-feef2813ba80b777.js → changes-b8bf02c66be6ae1f.js} +1 -1
  8. package/out/_next/static/chunks/pages/{settings-3e0fc87452053a17.js → settings-450b9f78216aa406.js} +1 -1
  9. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-ce1390f846a94d24.js +1 -0
  10. package/out/_next/static/css/df83243fff0d6412.css +1 -0
  11. package/out/changelog.html +1 -1
  12. package/out/changes.html +1 -1
  13. package/out/custom-types/[customTypeId].html +1 -1
  14. package/out/custom-types.html +1 -1
  15. package/out/index.html +1 -1
  16. package/out/labs.html +1 -1
  17. package/out/page-types/[pageTypeId].html +1 -1
  18. package/out/settings.html +1 -1
  19. package/out/slices/[lib]/[sliceName]/[variation]/simulator.html +1 -1
  20. package/out/slices/[lib]/[sliceName]/[variation].html +1 -1
  21. package/out/slices.html +1 -1
  22. package/package.json +6 -6
  23. package/src/features/builder/AddFieldDropdown.tsx +5 -1
  24. package/src/features/inAppGuide/InAppGuideDialog.tsx +5 -2
  25. package/src/features/onboarding/OnboardingStepDialog/OnboardingStepDialog.tsx +8 -5
  26. package/src/features/settings/git/GitRepositoryConnectDialog.tsx +19 -15
  27. package/src/features/settings/git/GitRepositoryDisconnectDialog.tsx +14 -12
  28. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewSliceDialog.tsx +13 -10
  29. package/src/features/slices/convertLegacySlice/ConvertLegacySliceAsNewVariationDialog.tsx +15 -10
  30. package/src/features/slices/convertLegacySlice/ConvertLegacySliceMergeWithIdenticalDialog.tsx +13 -10
  31. package/src/legacy/components/ChangesItems/DevCollaborationExperiment.tsx +12 -9
  32. package/src/legacy/components/DeleteVariationModal/index.tsx +14 -11
  33. package/src/legacy/components/Forms/RenameVariationModal/RenameVariationModal.tsx +13 -10
  34. package/src/legacy/lib/builders/SliceBuilder/FieldZones/index.tsx +8 -8
  35. package/out/_next/static/chunks/448-703cda73b6039a88.js +0 -1
  36. package/out/_next/static/chunks/574-1a2168b3d4479624.js +0 -1
  37. package/out/_next/static/chunks/pages/slices/[lib]/[sliceName]/[variation]-cc3c69bbc0168169.js +0 -1
  38. package/out/_next/static/css/c1b9dfb59bc111e1.css +0 -1
  39. /package/out/_next/static/{qBIKwMGCCngU7ltrCgjdx → 0ETE5dlTEPuCz59mfdi2V}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return t(995)}])},9502:function(e,n,t){"use strict";t.d(n,{R$:function(){return h},Qj:function(){return g},T9:function(){return f},nf:function(){return p},u2:function(){return x},_T:function(){return m}});var i=t(67557),r=t(62230),s=t(85244),o=t(98240),l=t(52322),c=t(37577),a=t(6277),u=t(98484),d=t.n(u),h=function(e){var n=e.backgroundImage,t=e.style,c=(0,o.Z)(e,["backgroundImage","style"]),u=void 0!==n;return(0,l.jsx)("article",(0,s.Z)((0,r.Z)({},c),{className:(0,a.W)(d().root,(0,i.Z)({},d().withBackground,u)),style:(0,r.Z)({backgroundImage:u?"url(".concat(n,")"):void 0},t)}))},x=function(e){return(0,l.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:d().image}))},f=function(e){return(0,l.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:d().content}))},m=function(e){return(0,l.jsx)(c.xv,(0,s.Z)((0,r.Z)({},e),{className:d().title}))},p=function(e){return(0,l.jsx)(c.xv,(0,s.Z)((0,r.Z)({},e),{className:d().desc,color:"grey11"}))},g=function(e){return(0,l.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:d().actions,color:"grey"}))}},95120:function(e,n,t){"use strict";t.d(n,{Q:function(){return x}});var i=t(22710),r=t(99267);let s={GitHub:"gitHub"};var o=t(62230),l=t(85244),c=t(52322),a=function(e){return(0,c.jsx)("svg",(0,l.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}))},u=function(e){return(0,c.jsx)("svg",(0,l.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,c.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}))},d=function(e){return(0,c.jsx)("svg",(0,l.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}))},h=t(7604),x={gitHub:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("gitHub")];case 1:return[2,e.sent()]}})}),Icon:u,name:"GitHub",supported:p("gitHub")},bitbucket:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("bitbucket")];case 1:return[2,e.sent()]}})}),Icon:a,name:"Bitbucket",supported:p("bitbucket")},gitLab:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("gitLab")];case 1:return[2,e.sent()]}})}),Icon:d,name:"GitLab",supported:p("gitLab")}};function f(e){return m.apply(this,arguments)}function m(){return(m=(0,i.Z)(function(e){var n;return(0,r.__generator)(this,function(t){switch(t.label){case 0:if(!p(e))throw Error("Not implemented.");return[4,h.j.git.getProviderAppInstallURL({provider:e})];case 1:return n=t.sent(),window.open(n,"git-provider-app-installation"),[2]}})})).apply(this,arguments)}function p(e){return Boolean(Object.values(s).includes(e))}},46200:function(e,n,t){"use strict";t.d(n,{G:function(){return a}});var i=t(22710),r=t(17064),s=t(99267),o=t(18566),l=t(39374),c=t(7604);function a(){var e,n,t=(0,r.Z)((0,l.f)(),1)[0];return{linkedGitRepos:(0,o.QT)(u,[t.repositoryName]),linkRepo:(e=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.git.linkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,o.gw)(u,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(n){return e.apply(this,arguments)}),unlinkRepo:(n=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.git.unlinkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,o.gw)(u,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(e){return n.apply(this,arguments)})}}function u(e){return d.apply(this,arguments)}function d(){return(d=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.git.fetchLinkedRepos({prismic:{domain:e}})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}},39374:function(e,n,t){"use strict";t.d(n,{f:function(){return l}});var i=t(22710),r=t(99267),s=t(18566),o=t(7604);function l(){var e,n=(0,s.QT)(c,[]),t=(e=(0,i.Z)(function(e){return(0,r.__generator)(this,function(n){switch(n.label){case 0:return[4,o.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,s.VA)(c,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function c(){return a.apply(this,arguments)}function a(){return(a=(0,i.Z)(function(){return(0,r.__generator)(this,function(e){return[2,o.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},61107:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var i=t(62230),r=t(85244),s=t(98240),o=t(52322),l=t(2784),c=t(75289),a=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,l.forwardRef)(function(e,n){var t=e.label,l=e.Icon,d=e.type,h=e.form,x=e.isLoading,f=void 0!==x&&x,m=e.disabled,p=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,C=void 0===b?"primary":b,_=(0,s.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,o.jsx)(c.zx,(0,r.Z)((0,i.Z)({ref:n,sx:(0,i.Z)((0,r.Z)((0,i.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),f?{cursor:"wait !important"}:{}),type:d,form:h,disabled:void 0!==m&&m||f,onClick:f?void 0:p,variant:C},_),{children:f?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.$j,{size:v,color:u(C),"data-testid":a(_["data-testid"],"spinner")}),l&&t]}):(0,o.jsxs)(o.Fragment,{children:[l&&(0,o.jsx)(l,{size:v,fill:y,"data-testid":a(_["data-testid"],"icon")}),t]})}))})},26574:function(e,n,t){"use strict";var i=t(62230),r=t(52322),s=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,o=e.defineElementKey,l=e.gridTemplateMinPx,c=e.gridGap,a=e.sx;return(0,r.jsx)(s.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===l?"320px":l,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},a),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(o(e),"-").concat(n+1)):null})})}},995:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return e_}});var i=t(22710),r=t(99267),s=t(52322),o=t(97729),l=t.n(o),c=t(5632),a=t.n(c),u=t(2784),d=t(88932),h=t(65077),x=t(12189),f=t(42770),m=t(37577),p=t(34543),g=t(56580),j=t(9502),v=t(62230),y=t(85244),b=t(98240),C=t(6277),_=t(49888),w=t.n(_),k=function(e){var n=e.children,t=e.color,i=e.endIcon,r=e.href,o=e.textVariant,l=void 0===o?"smallBold":o,c=(0,b.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,y.Z)((0,v.Z)({href:r,target:"_blank",rel:"noreferrer"},c),{className:(0,C.W)(w().root,w()["color-".concat(void 0===t?"primary":t)]),children:[(0,s.jsx)(m.xv,{component:"span",color:"inherit",variant:l,children:n}),(0,u.isValidElement)(i)?(0,u.cloneElement)(i,{className:(0,C.W)(i.props.className,w().endIcon,w()["icon-".concat(l)])}):null]}))},S=t(79536),Z=function(){var e,n=(e=(0,g.v9)(function(e){return{repoName:(0,S.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(j.R$,{style:{alignSelf:"center",marginTop:m.rS.space[72]},children:[(0,s.jsx)(j.u2,{children:(0,s.jsx)(m.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(j.T9,{children:[(0,s.jsx)(j._T,{children:"Everything up-to-date"}),(0,s.jsx)(j.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,s.jsxs)(j.Qj,{children:[(0,s.jsx)(m.zx,{onClick:function(){a().push("/")},children:"Create a page type"}),(0,s.jsx)(k,{endIcon:(0,s.jsx)(p.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},T=t(16991),D=t(95120),L=t(31799),O=t(46200),I=function(e){return(0,s.jsx)(T.S,{renderError:F,children:(0,s.jsx)(u.Suspense,{fallback:(0,s.jsx)(H,{}),children:(0,s.jsx)(N,(0,v.Z)({},e))})})},N=function(e){return(0,L.M)().eligible?(0,s.jsx)(R,(0,v.Z)({},e)):(0,s.jsx)(B,(0,v.Z)({},e))},R=function(e){var n=(0,O.G)().linkedGitRepos;if(!(n.length>0))return(0,s.jsx)(B,(0,v.Z)({},e));var t=D.Q[n[0].provider];return(0,s.jsx)(m.u,{content:"This project uses the Git workflow. Update Prismic by pushing your changes to ".concat(t.name,"."),side:"bottom",children:(0,s.jsx)(B,{disabled:!0})})},B=(0,u.forwardRef)(function(e,n){return(0,s.jsx)(m.zx,(0,y.Z)((0,v.Z)({},e),{ref:n,startIcon:"upload",children:"Push"}))});function F(){return(0,s.jsx)(m.u,{content:"An error occurred while fetching the list of connected Git repositories.",side:"bottom",children:(0,s.jsx)(B,{disabled:!0})})}var H=function(){return(0,s.jsx)(m.Od,{height:32,width:71.32})},z=t(76570),E=t(35393),M=t(87161),A=t(13325),G=t(14787),W=t(83981),P=t(72797),U=t(7342),V=function(e){var n=e.authStatus,t=(0,U.Z)().openLoginModal;return(0,s.jsxs)(m.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[n===P.t.FORBIDDEN?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.xv,{variant:"h3",align:"center",children:"It seems like you are logged out"}),(0,s.jsx)(m.xv,{align:"center",children:"Log in to connect to your repository."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.xv,{variant:"h3",align:"center",children:"It seems like you don't have access to this repository"}),(0,s.jsx)(m.xv,{align:"center",children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,s.jsxs)(m.xv,{align:"center",children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,s.jsx)(m.xv,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),n===P.t.FORBIDDEN&&(0,s.jsx)(m.zx,{onClick:function(){return t()},children:"Log in to Prismic"})]})},X=t(91914),Q=t(75289),K=function(){return(0,s.jsx)(Q.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(Q.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(X.wQ1,{size:48}),(0,s.jsx)(Q.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px",textAlign:"center"},children:"No internet connection"}),(0,s.jsx)(Q.xv,{sx:{fontSize:"13px",lineHeight:"24px",textAlign:"center"},children:"Connect to the internet to sync your changes."})]})})},Y=t(951),J=t(74029),$=t(88201),q=t(63815),ee=function(e){var n=e.children;return(0,s.jsx)(Q.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px",width:"100%"},children:n})},en=t(39097),et=t.n(en),ei=t(39122),er=t(99526),es=t(93290),eo=function(e){var n=e.ct,t=e.status,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Q.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(Q.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(Q.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(Q.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(ei.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},el=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(Q.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(Q.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(Q.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(Q.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,es.TG)(e)?(0,s.jsx)(et(),{passHref:!0,href:er.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,"data-testid":"custom-type-".concat(e.local.id),children:(0,s.jsx)(eo,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled","data-testid":"custom-type-".concat(e.remote.id),children:(0,s.jsx)(eo,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r},e.remote.id)},e.remote.id)})})]})},ec=t(26574),ea=t(97461),eu=t(42356),ed=t(13002);function eh(){var e=(0,ed.L)("slicemachine-dev-collaboration"),n=(0,u.useState)(!1),t=n[0],i=n[1],r=null==e?void 0:e.payload;return((0,u.useEffect)(function(){(null==e?void 0:e.value)==="on"&&void 0!==r&&x.Xe.track({event:"dev-collab:workflow-stub-displayed"})},[e,r]),(null==e?void 0:e.value)!=="on"||void 0===r)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(m.xu,{alignItems:"flex-start",border:{bottom:!0,left:!0,right:!0,top:!0},borderRadius:6,borderStyle:"dashed",flexDirection:"column",flexShrink:0,gap:8,padding:16,width:320,children:[(0,s.jsxs)(m.xu,{flexDirection:"column",gap:2,children:[(0,s.jsx)(m.xv,{variant:"smallBold",children:r.cardTitle}),(0,s.jsx)(m.xv,{color:"grey11",variant:"small",children:r.cardDescription})]}),(0,s.jsx)(m.zx,{color:"grey",onClick:function(){x.Xe.track({event:"dev-collab:set-up-workflow-opened"}),i(!0)},children:r.cardButtonLabel})]}),(0,s.jsxs)(m.Vq,{onOpenChange:function(e){e||i(!1)},open:t,size:{height:"auto",width:448},children:[(0,s.jsx)(m.fK,{title:r.dialogTitle}),(0,s.jsx)(m.cZ,{children:(0,s.jsxs)(m.xu,{flexDirection:"column",children:[(0,s.jsx)(m.xu,{flexDirection:"column",padding:16,children:(0,s.jsx)(m.xv,{children:r.dialogDescription})}),(0,s.jsx)(m.kX,{cancel:{text:"Cancel"},ok:{text:r.dialogButtonLabel,onClick:function(){x.Xe.track({event:"dev-collab:join-beta-clicked"}),window.open(r.dialogButtonLink,"_blank"),i(!1)}},size:"medium"})]})})]})]})}var ex=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,o=e.isOnline,l=(0,q.H)(),c=l.modalPayload,a=l.onOpenModal,d=c.sliceFilterFn,h=c.defaultVariationSelector,x=t.filter(function(e){return i.slices[e.model.id]!==eu.GJ.Deleted});return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(m.xu,{gap:16,alignItems:"flex-start",children:[(0,s.jsxs)(m.xu,{flexDirection:"column",flexGrow:1,children:[n.length>0&&(0,s.jsxs)(m.xu,{flexDirection:"column",children:[(0,s.jsx)(ee,{children:(0,s.jsxs)(m.xu,{children:[(0,s.jsx)(m.xv,{variant:"h5",children:"Types"}),(0,s.jsx)(m.xv,{variant:"h5",sx:{marginLeft:8},children:n.length})]})}),(0,s.jsx)(el,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:o})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.xu,{padding:{bottom:8},children:(0,s.jsxs)(ee,{children:[(0,s.jsxs)(m.xu,{children:[(0,s.jsx)(m.xv,{variant:"h5",children:"Slices"}),(0,s.jsx)(m.xv,{variant:"h5",sx:{marginLeft:8},children:t.length})]}),(0,s.jsxs)(m.xu,{children:[t.some(function(e){return(0,J.cx)(e)>0&&i.slices[e.model.id]!==eu.GJ.Deleted})&&(0,s.jsxs)(m.xv,{color:"amber11",sx:{marginRight:8,alignSelf:"center"},children:[(0,s.jsx)(Y.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(m.zx,{color:"dark",onClick:function(){return a({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(Y.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(ec.Z,{gridGap:"32px 16px",elems:t,gridTemplateMinPx:"305px",defineElementKey:function(e){return e.model.name},renderElem:function(e){var n=i.slices[e.model.id];return(0,s.jsx)($.b,{action:{type:"status",authStatus:r,isOnline:o,modelStatus:n},isDeleted:n===eu.GJ.Deleted,mode:"navigation",onUpdateScreenshot:function(){a({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(ea.Z,{slices:d(x),defaultVariationSelector:h})]})]}),(0,s.jsx)(T.S,{children:(0,s.jsx)(u.Suspense,{children:(0,s.jsx)(eh,{})})})]})})},ef=t(61107),em=t(79797),ep=t(2978),eg=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,o=e.onClose;return(0,s.jsx)(em.Z,{placement:"right",open:n,level:null,onClose:o,width:496,children:(0,s.jsx)(ep.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,s.jsxs)(Q.kC,{sx:{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,s.jsx)(Q.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(Q.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(Q.x8,{type:"button",onClick:function(){return o()}})]})},Footer:function(){return(0,s.jsx)(Q.kC,{sx:{flexDirection:"column",justifyContent:"center",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:"white",padding:20},children:i})},children:r})})},ej=t(7781);t(64837);var ev=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(Q.Zb,{sx:{mb:12},variant:"drawerCard","data-testid":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(Q.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(Q.xv,{children:n}),(0,s.jsxs)(Q.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(Q.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},ey=function(e){var n=e.pushChanges,t=e.modalData,i=e.onClose,r=(0,g.v9)(function(e){return{remoteOnlyCustomTypes:(0,ej.Ch)(e).filter(es.yp)}}).remoteOnlyCustomTypes;if((null==t?void 0:t.type)!=="HARD")return null;var o=t.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,es.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(ev,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(eg,{isOpen:"HARD"===t.type,title:"Manual action required",onClose:i,footer:(0,s.jsx)(ef.z,{label:"Try again",variant:"primary",onClick:function(){n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Q.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",t.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(Q.xv,{sx:{mb:24},children:[t.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."]}),o]})})},eb=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(Q.kC,{sx:(0,v.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(Q.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(Q.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(Q.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},eC=function(e){var n=e.pushChanges,t=e.modalData,i=e.onClose,r=(0,u.useState)(!1),o=r[0],l=r[1],c=(0,g.v9)(function(e){return{remoteOnlyCustomTypes:(0,ej.Ch)(e).filter(es.yp)}}).remoteOnlyCustomTypes;if((null==t?void 0:t.type)!=="SOFT")return null;var a=t.details.customTypes.map(function(e){var n,t=c.find(function(n){return(0,es.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(ev,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(eg,{isOpen:"SOFT"===t.type,title:"Confirm deletion",onClose:i,footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eb,{onToggle:function(){l(!o)},isConfirmed:o,sx:{mb:10}}),(0,s.jsx)(ef.z,{label:"Push changes",variant:"primary",onClick:function(){n(o)},disabled:!o,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Q.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(Q.xv,{sx:{mb:24},children:[t.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."]}),a]})})},e_=function(){var e,n=(0,M.X)(),t=n.unSyncedSlices,o=n.unSyncedCustomTypes,a=n.changedCustomTypes,m=n.changedSlices,p=n.modelsStatuses,g=(0,G.L)(),j=(0,A.n)(),v=(0,U.Z)(),y=v.pushChangesSuccess,b=v.refreshState,C=(0,u.useState)(!1),_=C[0],w=C[1],k=(0,u.useState)(void 0),S=k[0],T=k[1],D=(0,E.g)().autoSyncStatus,L=(0,c.useRouter)(),O=t.length+o.length;(0,u.useEffect)(function(){("synced"===D||"failed"===D||"syncing"===D)&&L.push("/")},[D,L]);var N=(e=(0,i.Z)(function(e){var n,t,i;return(0,r.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,5,,6]),w(!0),T(void 0),[4,(0,z.t)({confirmDeleteDocuments:e,changedCustomTypes:a,changedSlices:m})];case 1:if(!(void 0!==(n=t.sent())))return[3,2];return T(n),[3,4];case 2:return[4,(0,x.y0)()];case 3:b(t.sent()),y(),d.Am.success("All slices and types have been pushed"),t.label=4;case 4:return[3,6];case 5:return i=t.sent(),console.error("Something went wrong when manually pushing your changes",i),d.Am.error("Something went wrong when pushing your changes. Check your terminal logs."),[3,6];case 6:return w(!1),[2]}})}),function(n){return e.apply(this,arguments)}),R=(0,u.useMemo)(function(){return g?j===P.t.UNAUTHORIZED||j===P.t.FORBIDDEN?(0,s.jsx)(V,{authStatus:j}):0===O?(0,s.jsx)(Z,{}):(0,s.jsx)(ex,{unSyncedSlices:t,unSyncedCustomTypes:o,modelsStatuses:p,authStatus:j,isOnline:g}):(0,s.jsx)(K,{})},[g,j,O,t,o,p,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(W.LN,{children:[(0,s.jsxs)(W.wd,{children:[(0,s.jsx)(W.Cx,{children:(0,s.jsx)(f.g,{children:"Changes"})}),(0,s.jsx)(W.K2,{children:(0,s.jsx)(I,{disabled:0===O||!g||j===P.t.UNAUTHORIZED||j===P.t.FORBIDDEN||_,loading:_,onClick:function(){N(!1)}})})]}),(0,s.jsx)(W.RN,{children:(0,s.jsxs)(h.xR,{sx:{display:"flex",flexDirection:"column"},children:[R,(0,s.jsx)(eC,{pushChanges:function(e){N(e)},modalData:S,onClose:function(){return T(void 0)}}),(0,s.jsx)(ey,{pushChanges:function(e){N(e)},modalData:S,onClose:function(){return T(void 0)}})]})})]})]})}},98484:function(e){e.exports={column:"BlankSlate_column__ysDb2",root:"BlankSlate_root__DJ7wC BlankSlate_column__ysDb2",fadeIn:"BlankSlate_fadeIn__KMuKu",withBackground:"BlankSlate_withBackground___V5y5",image:"BlankSlate_image__rOe9w BlankSlate_column__ysDb2",content:"BlankSlate_content__wmOAI BlankSlate_column__ysDb2",title:"BlankSlate_title__5oTre",desc:"BlankSlate_desc__f6ZWf",actions:"BlankSlate_actions__6zYZr"}},49888:function(e){e.exports={root:"TextLink_root__lUIIv","color-primary":"TextLink_color-primary__WDK3_","color-secondary":"TextLink_color-secondary__mlUMF",endIcon:"TextLink_endIcon__f687_","icon-normal":"TextLink_icon-normal__CXnLk","icon-smallBold":"TextLink_icon-smallBold__Hp6aU","icon-inherit":"TextLink_icon-inherit__gbJsO"}}},function(e){e.O(0,[898,789,123,543,918,816,152,774,888,179],function(){return e(e.s=21985)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[849],{21985:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/changes",function(){return t(995)}])},9502:function(e,n,t){"use strict";t.d(n,{R$:function(){return h},Qj:function(){return g},T9:function(){return f},nf:function(){return p},u2:function(){return x},_T:function(){return m}});var i=t(67557),r=t(62230),s=t(85244),o=t(98240),l=t(52322),c=t(37577),a=t(6277),u=t(98484),d=t.n(u),h=function(e){var n=e.backgroundImage,t=e.style,c=(0,o.Z)(e,["backgroundImage","style"]),u=void 0!==n;return(0,l.jsx)("article",(0,s.Z)((0,r.Z)({},c),{className:(0,a.W)(d().root,(0,i.Z)({},d().withBackground,u)),style:(0,r.Z)({backgroundImage:u?"url(".concat(n,")"):void 0},t)}))},x=function(e){return(0,l.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:d().image}))},f=function(e){return(0,l.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:d().content}))},m=function(e){return(0,l.jsx)(c.xv,(0,s.Z)((0,r.Z)({},e),{className:d().title}))},p=function(e){return(0,l.jsx)(c.xv,(0,s.Z)((0,r.Z)({},e),{className:d().desc,color:"grey11"}))},g=function(e){return(0,l.jsx)("div",(0,s.Z)((0,r.Z)({},e),{className:d().actions,color:"grey"}))}},95120:function(e,n,t){"use strict";t.d(n,{Q:function(){return x}});var i=t(22710),r=t(99267);let s={GitHub:"gitHub"};var o=t(62230),l=t(85244),c=t(52322),a=function(e){return(0,c.jsx)("svg",(0,l.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}))},u=function(e){return(0,c.jsx)("svg",(0,l.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,c.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}))},d=function(e){return(0,c.jsx)("svg",(0,l.Z)((0,o.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,c.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}))},h=t(7604),x={gitHub:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("gitHub")];case 1:return[2,e.sent()]}})}),Icon:u,name:"GitHub",supported:p("gitHub")},bitbucket:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("bitbucket")];case 1:return[2,e.sent()]}})}),Icon:a,name:"Bitbucket",supported:p("bitbucket")},gitLab:{connect:(0,i.Z)(function(){return(0,r.__generator)(this,function(e){switch(e.label){case 0:return[4,f("gitLab")];case 1:return[2,e.sent()]}})}),Icon:d,name:"GitLab",supported:p("gitLab")}};function f(e){return m.apply(this,arguments)}function m(){return(m=(0,i.Z)(function(e){var n;return(0,r.__generator)(this,function(t){switch(t.label){case 0:if(!p(e))throw Error("Not implemented.");return[4,h.j.git.getProviderAppInstallURL({provider:e})];case 1:return n=t.sent(),window.open(n,"git-provider-app-installation"),[2]}})})).apply(this,arguments)}function p(e){return Boolean(Object.values(s).includes(e))}},46200:function(e,n,t){"use strict";t.d(n,{G:function(){return a}});var i=t(22710),r=t(17064),s=t(99267),o=t(18566),l=t(39374),c=t(7604);function a(){var e,n,t=(0,r.Z)((0,l.f)(),1)[0];return{linkedGitRepos:(0,o.QT)(u,[t.repositoryName]),linkRepo:(e=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.git.linkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,o.gw)(u,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(n){return e.apply(this,arguments)}),unlinkRepo:(n=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.git.unlinkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,o.gw)(u,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(e){return n.apply(this,arguments)})}}function u(e){return d.apply(this,arguments)}function d(){return(d=(0,i.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.git.fetchLinkedRepos({prismic:{domain:e}})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}},39374:function(e,n,t){"use strict";t.d(n,{f:function(){return l}});var i=t(22710),r=t(99267),s=t(18566),o=t(7604);function l(){var e,n=(0,s.QT)(c,[]),t=(e=(0,i.Z)(function(e){return(0,r.__generator)(this,function(n){switch(n.label){case 0:return[4,o.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,s.VA)(c,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function c(){return a.apply(this,arguments)}function a(){return(a=(0,i.Z)(function(){return(0,r.__generator)(this,function(e){return[2,o.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},61107:function(e,n,t){"use strict";t.d(n,{z:function(){return d}});var i=t(62230),r=t(85244),s=t(98240),o=t(52322),l=t(2784),c=t(75289),a=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,l.forwardRef)(function(e,n){var t=e.label,l=e.Icon,d=e.type,h=e.form,x=e.isLoading,f=void 0!==x&&x,m=e.disabled,p=e.onClick,g=e.sx,j=e.iconSize,v=void 0===j?16:j,y=e.iconFill,b=e.variant,C=void 0===b?"primary":b,_=(0,s.Z)(e,["label","Icon","type","form","isLoading","disabled","onClick","sx","iconSize","iconFill","variant"]);return(0,o.jsx)(c.zx,(0,r.Z)((0,i.Z)({ref:n,sx:(0,i.Z)((0,r.Z)((0,i.Z)({},void 0===g?{}:g),{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}),f?{cursor:"wait !important"}:{}),type:d,form:h,disabled:void 0!==m&&m||f,onClick:f?void 0:p,variant:C},_),{children:f?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.$j,{size:v,color:u(C),"data-testid":a(_["data-testid"],"spinner")}),l&&t]}):(0,o.jsxs)(o.Fragment,{children:[l&&(0,o.jsx)(l,{size:v,fill:y,"data-testid":a(_["data-testid"],"icon")}),t]})}))})},26574:function(e,n,t){"use strict";var i=t(62230),r=t(52322),s=t(75289);n.Z=function(e){var n=e.elems,t=e.renderElem,o=e.defineElementKey,l=e.gridTemplateMinPx,c=e.gridGap,a=e.sx;return(0,r.jsx)(s.xu,{as:"section",sx:(0,i.Z)({display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(".concat(void 0===l?"320px":l,", 1fr))"),gridGap:void 0===c?"16px":c,pt:2},a),children:n.map(function(e,n){return e?(0,r.jsx)("span",{children:t(e,n)},"".concat(o(e),"-").concat(n+1)):null})})}},995:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return e_}});var i=t(22710),r=t(99267),s=t(52322),o=t(97729),l=t.n(o),c=t(5632),a=t.n(c),u=t(2784),d=t(88932),h=t(65077),x=t(12189),f=t(42770),m=t(37577),p=t(34543),g=t(56580),j=t(9502),v=t(62230),y=t(85244),b=t(98240),C=t(6277),_=t(49888),w=t.n(_),k=function(e){var n=e.children,t=e.color,i=e.endIcon,r=e.href,o=e.textVariant,l=void 0===o?"smallBold":o,c=(0,b.Z)(e,["children","color","endIcon","href","textVariant"]);return(0,s.jsxs)("a",(0,y.Z)((0,v.Z)({href:r,target:"_blank",rel:"noreferrer"},c),{className:(0,C.W)(w().root,w()["color-".concat(void 0===t?"primary":t)]),children:[(0,s.jsx)(m.xv,{component:"span",color:"inherit",variant:l,children:n}),(0,u.isValidElement)(i)?(0,u.cloneElement)(i,{className:(0,C.W)(i.props.className,w().endIcon,w()["icon-".concat(l)])}):null]}))},S=t(79536),Z=function(){var e,n=(e=(0,g.v9)(function(e){return{repoName:(0,S.MY)(e)}}).repoName,"https://".concat(e,".prismic.io/documents/working"));return(0,s.jsxs)(j.R$,{style:{alignSelf:"center",marginTop:m.rS.space[72]},children:[(0,s.jsx)(j.u2,{children:(0,s.jsx)(m.Ee,{src:"/blank-slate-changes-uptodate.png",sizing:"cover"})}),(0,s.jsxs)(j.T9,{children:[(0,s.jsx)(j._T,{children:"Everything up-to-date"}),(0,s.jsx)(j.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,s.jsxs)(j.Qj,{children:[(0,s.jsx)(m.zx,{onClick:function(){a().push("/")},children:"Create a page type"}),(0,s.jsx)(k,{endIcon:(0,s.jsx)(p.AlO,{}),textVariant:"normal",href:n,children:"Create content"})]})]})]})},T=t(16991),D=t(95120),L=t(31799),O=t(46200),I=function(e){return(0,s.jsx)(T.S,{renderError:F,children:(0,s.jsx)(u.Suspense,{fallback:(0,s.jsx)(H,{}),children:(0,s.jsx)(N,(0,v.Z)({},e))})})},N=function(e){return(0,L.M)().eligible?(0,s.jsx)(R,(0,v.Z)({},e)):(0,s.jsx)(B,(0,v.Z)({},e))},R=function(e){var n=(0,O.G)().linkedGitRepos;if(!(n.length>0))return(0,s.jsx)(B,(0,v.Z)({},e));var t=D.Q[n[0].provider];return(0,s.jsx)(m.u,{content:"This project uses the Git workflow. Update Prismic by pushing your changes to ".concat(t.name,"."),side:"bottom",children:(0,s.jsx)(B,{disabled:!0})})},B=(0,u.forwardRef)(function(e,n){return(0,s.jsx)(m.zx,(0,y.Z)((0,v.Z)({},e),{ref:n,startIcon:"upload",children:"Push"}))});function F(){return(0,s.jsx)(m.u,{content:"An error occurred while fetching the list of connected Git repositories.",side:"bottom",children:(0,s.jsx)(B,{disabled:!0})})}var H=function(){return(0,s.jsx)(m.Od,{height:32,width:71.32})},z=t(76570),E=t(35393),M=t(87161),A=t(13325),G=t(14787),P=t(83981),W=t(72797),U=t(7342),V=function(e){var n=e.authStatus,t=(0,U.Z)().openLoginModal;return(0,s.jsxs)(m.xu,{flexDirection:"column",height:"100%",alignItems:"center",justifyContent:"center",gap:8,children:[n===W.t.FORBIDDEN?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.xv,{variant:"h3",align:"center",children:"It seems like you are logged out"}),(0,s.jsx)(m.xv,{align:"center",children:"Log in to connect to your repository."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.xv,{variant:"h3",align:"center",children:"It seems like you don't have access to this repository"}),(0,s.jsx)(m.xv,{align:"center",children:"Check that the repository name is correct, then contact your repository administrator."})]}),(0,s.jsxs)(m.xv,{align:"center",children:["If that doesn't work, it's possible that Slice Machine is having trouble accessing Prismic's servers."," ",(0,s.jsx)(m.xv,{href:"https://community.prismic.io/",children:"Contact our support team"}),"."]}),n===W.t.FORBIDDEN&&(0,s.jsx)(m.zx,{onClick:function(){return t()},children:"Log in to Prismic"})]})},X=t(91914),Q=t(75289),K=function(){return(0,s.jsx)(Q.kC,{sx:{justifyContent:"center",alignItems:"center",flex:1},children:(0,s.jsxs)(Q.kC,{sx:{flexDirection:"column",alignItems:"center",transform:"translateY(-50%)"},children:[(0,s.jsx)(X.wQ1,{size:48}),(0,s.jsx)(Q.xv,{sx:{fontWeight:600,fontSize:"24px",lineHeight:"32px",mb:"8px",mt:"2px",textAlign:"center"},children:"No internet connection"}),(0,s.jsx)(Q.xv,{sx:{fontSize:"13px",lineHeight:"24px",textAlign:"center"},children:"Connect to the internet to sync your changes."})]})})},Y=t(951),J=t(74029),$=t(88201),q=t(63815),ee=function(e){var n=e.children;return(0,s.jsx)(Q.kC,{sx:{alignItems:"center",justifyContent:"space-between",mt:"8px",bg:"grey02",borderRadius:4,padding:"12px 16px",width:"100%"},children:n})},en=t(39097),et=t.n(en),ei=t(39122),er=t(99526),es=t(93290),eo=function(e){var n=e.ct,t=e.status,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Q.xu,{as:"td",style:{width:"40%"},children:(0,s.jsx)(Q.xv,{sx:{fontWeight:500},children:n.label})}),(0,s.jsx)(Q.xu,{as:"td",style:{width:"40%"},children:n.id}),(0,s.jsx)(Q.xu,{as:"td",style:{width:"20%"},children:(0,s.jsx)(ei.O,{authStatus:i,isOnline:r,modelStatus:t,modelType:"CustomType"})})]})},el=function(e){var n=e.customTypes,t=e.modelsStatuses,i=e.authStatus,r=e.isOnline;return(0,s.jsxs)(Q.xu,{as:"table","data-legacy-component":!0,children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"transparent small",children:[(0,s.jsx)(Q.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"Name"}),(0,s.jsx)(Q.xu,{as:"th",sx:{width:"40%",fontWeight:600},children:"API ID"}),(0,s.jsx)(Q.xu,{as:"th",sx:{width:"20%",fontWeight:600},children:"Status"})]})}),(0,s.jsx)("tbody",{children:n.map(function(e){return(0,es.TG)(e)?(0,s.jsx)(et(),{passHref:!0,href:er.cd[e.local.format].getBuilderPagePathname(e.local.id),legacyBehavior:!0,children:(0,s.jsx)("tr",{tabIndex:0,"data-testid":"custom-type-".concat(e.local.id),children:(0,s.jsx)(eo,{ct:e.local,status:t.customTypes[e.local.id],authStatus:i,isOnline:r},e.local.id)})},e.local.id):(0,s.jsx)("tr",{tabIndex:0,className:"disabled","data-testid":"custom-type-".concat(e.remote.id),children:(0,s.jsx)(eo,{ct:e.remote,status:t.customTypes[e.remote.id],authStatus:i,isOnline:r},e.remote.id)},e.remote.id)})})]})},ec=t(26574),ea=t(97461),eu=t(42356),ed=t(13002);function eh(){var e=(0,ed.L)("slicemachine-dev-collaboration"),n=(0,u.useState)(!1),t=n[0],i=n[1],r=null==e?void 0:e.payload;return((0,u.useEffect)(function(){(null==e?void 0:e.value)==="on"&&void 0!==r&&x.Xe.track({event:"dev-collab:workflow-stub-displayed"})},[e,r]),(null==e?void 0:e.value)!=="on"||void 0===r)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(m.xu,{alignItems:"flex-start",border:{bottom:!0,left:!0,right:!0,top:!0},borderRadius:6,borderStyle:"dashed",flexDirection:"column",flexShrink:0,gap:8,padding:16,width:320,children:[(0,s.jsxs)(m.xu,{flexDirection:"column",gap:2,children:[(0,s.jsx)(m.xv,{variant:"smallBold",children:r.cardTitle}),(0,s.jsx)(m.xv,{color:"grey11",variant:"small",children:r.cardDescription})]}),(0,s.jsx)(m.zx,{color:"grey",onClick:function(){x.Xe.track({event:"dev-collab:set-up-workflow-opened"}),i(!0)},children:r.cardButtonLabel})]}),(0,s.jsxs)(m.Vq,{onOpenChange:function(e){e||i(!1)},open:t,size:{height:"auto",width:448},children:[(0,s.jsx)(m.fK,{title:r.dialogTitle}),(0,s.jsx)(m.cZ,{children:(0,s.jsxs)(m.xu,{flexDirection:"column",children:[(0,s.jsx)(m.xu,{flexDirection:"column",padding:16,children:(0,s.jsx)(m.xv,{children:r.dialogDescription})}),(0,s.jsxs)(m.kX,{children:[(0,s.jsx)(m.PO,{size:"medium"}),(0,s.jsx)(m._d,{size:"medium",onClick:function(){x.Xe.track({event:"dev-collab:join-beta-clicked"}),window.open(r.dialogButtonLink,"_blank"),i(!1)},children:r.dialogButtonLabel})]})]})})]})]})}var ex=function(e){var n=e.unSyncedCustomTypes,t=e.unSyncedSlices,i=e.modelsStatuses,r=e.authStatus,o=e.isOnline,l=(0,q.H)(),c=l.modalPayload,a=l.onOpenModal,d=c.sliceFilterFn,h=c.defaultVariationSelector,x=t.filter(function(e){return i.slices[e.model.id]!==eu.GJ.Deleted});return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(m.xu,{gap:16,alignItems:"flex-start",children:[(0,s.jsxs)(m.xu,{flexDirection:"column",flexGrow:1,children:[n.length>0&&(0,s.jsxs)(m.xu,{flexDirection:"column",children:[(0,s.jsx)(ee,{children:(0,s.jsxs)(m.xu,{children:[(0,s.jsx)(m.xv,{variant:"h5",children:"Types"}),(0,s.jsx)(m.xv,{variant:"h5",sx:{marginLeft:8},children:n.length})]})}),(0,s.jsx)(el,{customTypes:n,modelsStatuses:i,authStatus:r,isOnline:o})]}),t.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.xu,{padding:{bottom:8},children:(0,s.jsxs)(ee,{children:[(0,s.jsxs)(m.xu,{children:[(0,s.jsx)(m.xv,{variant:"h5",children:"Slices"}),(0,s.jsx)(m.xv,{variant:"h5",sx:{marginLeft:8},children:t.length})]}),(0,s.jsxs)(m.xu,{children:[t.some(function(e){return(0,J.cx)(e)>0&&i.slices[e.model.id]!==eu.GJ.Deleted})&&(0,s.jsxs)(m.xv,{color:"amber11",sx:{marginRight:8,alignSelf:"center"},children:[(0,s.jsx)(Y.sQg,{size:16,style:{marginRight:"4px",position:"relative",top:"3px"}}),"Missing Screenshots"]}),(0,s.jsxs)(m.zx,{color:"dark",onClick:function(){return a({sliceFilterFn:function(e){return e}})},children:[(0,s.jsx)(Y.hOO,{style:{color:"#FFF",fontSize:"15px",position:"relative",top:"3px",marginRight:"4px"}})," ","Update all screenshots"]})]})]})}),(0,s.jsx)(ec.Z,{gridGap:"32px 16px",elems:t,gridTemplateMinPx:"305px",defineElementKey:function(e){return e.model.name},renderElem:function(e){var n=i.slices[e.model.id];return(0,s.jsx)($.b,{action:{type:"status",authStatus:r,isOnline:o,modelStatus:n},isDeleted:n===eu.GJ.Deleted,mode:"navigation",onUpdateScreenshot:function(){a({sliceFilterFn:function(n){return n.filter(function(n){return n.model.id===e.model.id})}})},slice:e,variant:"solid"})}}),(0,s.jsx)(ea.Z,{slices:d(x),defaultVariationSelector:h})]})]}),(0,s.jsx)(T.S,{children:(0,s.jsx)(u.Suspense,{children:(0,s.jsx)(eh,{})})})]})})},ef=t(61107),em=t(79797),ep=t(2978),eg=function(e){var n=e.isOpen,t=e.title,i=e.footer,r=e.explanations,o=e.onClose;return(0,s.jsx)(em.Z,{placement:"right",open:n,level:null,onClose:o,width:496,children:(0,s.jsx)(ep.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,s.jsxs)(Q.kC,{sx:{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,s.jsx)(Q.kC,{sx:{alignItems:"center"},children:(0,s.jsx)(Q.X6,{sx:{fontSize:"14px",fontWeight:"bold",ml:1},children:t})}),(0,s.jsx)(Q.x8,{type:"button",onClick:function(){return o()}})]})},Footer:function(){return(0,s.jsx)(Q.kC,{sx:{flexDirection:"column",justifyContent:"center",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:"white",padding:20},children:i})},children:r})})},ej=t(7781);t(64837);var ev=function(e){var n=e.ctName,t=e.numberOfDocuments,i=e.link,r=e.isOverLimit;return(0,s.jsxs)(Q.Zb,{sx:{mb:12},variant:"drawerCard","data-testid":"AssociatedDocumentsCard-".concat(n),children:[(0,s.jsxs)(Q.kC,{sx:{flexDirection:"column"},children:[(0,s.jsx)(Q.xv,{children:n}),(0,s.jsxs)(Q.xv,{sx:{color:"textClear",fontSize:"12px",lineHeight:"16px"},children:[t," documents"]})]}),(0,s.jsx)(Q.rU,{href:i,target:"_blank",variant:"cardSmall",sx:{color:void 0!==r&&r?"danger":"purple08"},children:"View documents"})]})},ey=function(e){var n=e.pushChanges,t=e.modalData,i=e.onClose,r=(0,g.v9)(function(e){return{remoteOnlyCustomTypes:(0,ej.Ch)(e).filter(es.yp)}}).remoteOnlyCustomTypes;if((null==t?void 0:t.type)!=="HARD")return null;var o=t.details.customTypes.map(function(e){var n,t=r.find(function(n){return(0,es.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(ev,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(eg,{isOpen:"HARD"===t.type,title:"Manual action required",onClose:i,footer:(0,s.jsx)(ef.z,{label:"Try again",variant:"primary",onClick:function(){n(!1)},sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Q.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:["Your type",t.details.customTypes.length>1&&"s"," cannot be deleted."]}),(0,s.jsxs)(Q.xv,{sx:{mb:24},children:[t.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."]}),o]})})},eb=function(e){var n=e.onToggle,t=e.isConfirmed,i=e.sx;return(0,s.jsxs)(Q.kC,{sx:(0,v.Z)({borderRadius:6,flexDirection:"column",backgroundColor:"grey03",padding:12,width:"100%"},i),children:[(0,s.jsx)(Q.xv,{sx:{fontWeight:"bold",mb:2},children:"Are you sure to proceed?"}),(0,s.jsxs)(Q.__,{sx:{mt:"4px",py:1},variant:"large",children:[(0,s.jsx)(Q.XZ,{defaultChecked:t,onChange:n,variant:"forms.checkbox.dark"}),"Delete these Documents"]})]})},eC=function(e){var n=e.pushChanges,t=e.modalData,i=e.onClose,r=(0,u.useState)(!1),o=r[0],l=r[1],c=(0,g.v9)(function(e){return{remoteOnlyCustomTypes:(0,ej.Ch)(e).filter(es.yp)}}).remoteOnlyCustomTypes;if((null==t?void 0:t.type)!=="SOFT")return null;var a=t.details.customTypes.map(function(e){var n,t=c.find(function(n){return(0,es.n5)(n)===e.id});return void 0===t?null:(0,s.jsx)(ev,{isOverLimit:!0,ctName:null!==(n=t.remote.label)&&void 0!==n?n:t.remote.id,link:e.url,numberOfDocuments:e.numberOfDocuments},e.id)});return(0,s.jsx)(eg,{isOpen:"SOFT"===t.type,title:"Confirm deletion",onClose:i,footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eb,{onToggle:function(){l(!o)},isConfirmed:o,sx:{mb:10}}),(0,s.jsx)(ef.z,{label:"Push changes",variant:"primary",onClick:function(){n(o)},disabled:!o,sx:{fontWeight:"bold",color:"white",borderRadius:6,width:"100%"}})]}),explanations:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Q.xv,{sx:{fontWeight:"bold",mb:1,lineHeight:"24px"},children:"This action will also delete Documents."}),(0,s.jsxs)(Q.xv,{sx:{mb:24},children:[t.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."]}),a]})})},e_=function(){var e,n=(0,M.X)(),t=n.unSyncedSlices,o=n.unSyncedCustomTypes,a=n.changedCustomTypes,m=n.changedSlices,p=n.modelsStatuses,g=(0,G.L)(),j=(0,A.n)(),v=(0,U.Z)(),y=v.pushChangesSuccess,b=v.refreshState,C=(0,u.useState)(!1),_=C[0],w=C[1],k=(0,u.useState)(void 0),S=k[0],T=k[1],D=(0,E.g)().autoSyncStatus,L=(0,c.useRouter)(),O=t.length+o.length;(0,u.useEffect)(function(){("synced"===D||"failed"===D||"syncing"===D)&&L.push("/")},[D,L]);var N=(e=(0,i.Z)(function(e){var n,t,i;return(0,r.__generator)(this,function(t){switch(t.label){case 0:return t.trys.push([0,5,,6]),w(!0),T(void 0),[4,(0,z.t)({confirmDeleteDocuments:e,changedCustomTypes:a,changedSlices:m})];case 1:if(!(void 0!==(n=t.sent())))return[3,2];return T(n),[3,4];case 2:return[4,(0,x.y0)()];case 3:b(t.sent()),y(),d.Am.success("All slices and types have been pushed"),t.label=4;case 4:return[3,6];case 5:return i=t.sent(),console.error("Something went wrong when manually pushing your changes",i),d.Am.error("Something went wrong when pushing your changes. Check your terminal logs."),[3,6];case 6:return w(!1),[2]}})}),function(n){return e.apply(this,arguments)}),R=(0,u.useMemo)(function(){return g?j===W.t.UNAUTHORIZED||j===W.t.FORBIDDEN?(0,s.jsx)(V,{authStatus:j}):0===O?(0,s.jsx)(Z,{}):(0,s.jsx)(ex,{unSyncedSlices:t,unSyncedCustomTypes:o,modelsStatuses:p,authStatus:j,isOnline:g}):(0,s.jsx)(K,{})},[g,j,O,t,o,p,]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l(),{children:(0,s.jsx)("title",{children:"Changes - Slice Machine"})}),(0,s.jsxs)(P.LN,{children:[(0,s.jsxs)(P.wd,{children:[(0,s.jsx)(P.Cx,{children:(0,s.jsx)(f.g,{children:"Changes"})}),(0,s.jsx)(P.K2,{children:(0,s.jsx)(I,{disabled:0===O||!g||j===W.t.UNAUTHORIZED||j===W.t.FORBIDDEN||_,loading:_,onClick:function(){N(!1)}})})]}),(0,s.jsx)(P.RN,{children:(0,s.jsxs)(h.xR,{sx:{display:"flex",flexDirection:"column"},children:[R,(0,s.jsx)(eC,{pushChanges:function(e){N(e)},modalData:S,onClose:function(){return T(void 0)}}),(0,s.jsx)(ey,{pushChanges:function(e){N(e)},modalData:S,onClose:function(){return T(void 0)}})]})})]})]})}},98484:function(e){e.exports={column:"BlankSlate_column__ysDb2",root:"BlankSlate_root__DJ7wC BlankSlate_column__ysDb2",fadeIn:"BlankSlate_fadeIn__KMuKu",withBackground:"BlankSlate_withBackground___V5y5",image:"BlankSlate_image__rOe9w BlankSlate_column__ysDb2",content:"BlankSlate_content__wmOAI BlankSlate_column__ysDb2",title:"BlankSlate_title__5oTre",desc:"BlankSlate_desc__f6ZWf",actions:"BlankSlate_actions__6zYZr"}},49888:function(e){e.exports={root:"TextLink_root__lUIIv","color-primary":"TextLink_color-primary__WDK3_","color-secondary":"TextLink_color-secondary__mlUMF",endIcon:"TextLink_endIcon__f687_","icon-normal":"TextLink_icon-normal__CXnLk","icon-smallBold":"TextLink_icon-smallBold__Hp6aU","icon-inherit":"TextLink_icon-inherit__gbJsO"}}},function(e){e.O(0,[898,789,123,543,918,816,152,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([[662],{24994:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return t(65615)}])},95120:function(e,n,t){"use strict";t.d(n,{Q:function(){return f}});var r=t(22710),i=t(99267);let o={GitHub:"gitHub"};var c=t(62230),s=t(85244),l=t(52322),u=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}))},a=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}))},d=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}))},h=t(7604),f={gitHub:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("gitHub")];case 1:return[2,e.sent()]}})}),Icon:a,name:"GitHub",supported:_("gitHub")},bitbucket:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("bitbucket")];case 1:return[2,e.sent()]}})}),Icon:u,name:"Bitbucket",supported:_("bitbucket")},gitLab:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("gitLab")];case 1:return[2,e.sent()]}})}),Icon:d,name:"GitLab",supported:_("gitLab")}};function x(e){return p.apply(this,arguments)}function p(){return(p=(0,r.Z)(function(e){var n;return(0,i.__generator)(this,function(t){switch(t.label){case 0:if(!_(e))throw Error("Not implemented.");return[4,h.j.git.getProviderAppInstallURL({provider:e})];case 1:return n=t.sent(),window.open(n,"git-provider-app-installation"),[2]}})})).apply(this,arguments)}function _(e){return Boolean(Object.values(o).includes(e))}},46200:function(e,n,t){"use strict";t.d(n,{G:function(){return u}});var r=t(22710),i=t(17064),o=t(99267),c=t(18566),s=t(39374),l=t(7604);function u(){var e,n,t=(0,i.Z)((0,s.f)(),1)[0];return{linkedGitRepos:(0,c.QT)(a,[t.repositoryName]),linkRepo:(e=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.linkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,c.gw)(a,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(n){return e.apply(this,arguments)}),unlinkRepo:(n=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.unlinkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,c.gw)(a,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(e){return n.apply(this,arguments)})}}function a(e){return d.apply(this,arguments)}function d(){return(d=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.fetchLinkedRepos({prismic:{domain:e}})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}},39374:function(e,n,t){"use strict";t.d(n,{f:function(){return s}});var r=t(22710),i=t(99267),o=t(18566),c=t(7604);function s(){var e,n=(0,o.QT)(l,[]),t=(e=(0,r.Z)(function(e){return(0,i.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,o.VA)(l,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function l(){return u.apply(this,arguments)}function u(){return(u=(0,r.Z)(function(){return(0,i.__generator)(this,function(e){return[2,c.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},65615:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ef}});var r=t(52322),i=t(37577),o=t(97729),c=t.n(o),s=t(5632),l=t(2784),u=t(42770),a=t(37792),d=t(62230),h=t(85244),f=t(98240),x=t(52475),p=t.n(x),_=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().root}))},g=function(e){var n=e.children,t=(0,f.Z)(e,["children"]);return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},t),{className:p().legend,children:(0,r.jsx)(i.xv,{color:"grey11",component:"span",noWrap:!0,variant:"smallBold",children:n})}))},m=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().header}))},j=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().content}))},v=function(e){return(0,r.jsx)("ul",(0,h.Z)((0,d.Z)({},e),{className:p().list}))},w=function(e){var n=e.action,t=e.children,o=(0,f.Z)(e,["action","children"]);return(0,r.jsxs)("li",(0,h.Z)((0,d.Z)({},o),{className:p().listItem,children:[(0,r.jsx)(i.xv,{className:p().listItemText,component:"span",noWrap:!0,variant:"bold",children:t}),n]}))},y=function(e){var n=e.action,t=e.children,o=(0,f.Z)(e,["action","children"]);return(0,r.jsxs)("div",(0,h.Z)((0,d.Z)({},o),{className:p().footer,children:[(0,r.jsx)(i.xv,{className:p().footerText,color:"grey11",component:"span",noWrap:!0,variant:"small",children:t}),n]}))},b=t(16991),C=function(e){var n=e.title,t=e.description,o=e.action;return(0,r.jsxs)(i.xu,{flexDirection:"column",padding:{block:72,inline:100},children:[(0,r.jsx)(i.xv,{align:"center",variant:"emphasized",children:n}),(0,r.jsx)(i.xv,{align:"center",color:"grey11",children:t}),Boolean(o)?(0,r.jsx)(i.hE,{sx:{alignSelf:"center",marginTop:8},children:o}):void 0]})},S=t(22710),k=t(99267),Z=t(98863),F=t(88932),L=t(95120),N=function(){return(0,r.jsx)(i.hE,{children:(0,Z.XP)(L.Q).map(function(e){return(0,r.jsx)(I,{provider:e,sx:{flexBasis:0,flexGrow:1}},e)})})},I=function(e){var n=e.provider,t=e.sx,o=L.Q[n],c=o.connect,s=o.Icon,u=o.name,a=o.supported,d=(0,l.useState)(!1),h=d[0],f=d[1];return(0,r.jsxs)(i.zx,{color:"grey",disabled:!a,loading:h,onClick:function(){(0,S.Z)(function(){var e,n;return(0,k.__generator)(this,function(t){switch(t.label){case 0:f(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,c()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),n="Could not connect to ".concat(u),console.error(n,e),F.Am.error(n),f(!1),[3,4];case 4:return[2]}})})()},renderStartIcon:function(){return(0,r.jsx)(s,{color:i.rS.color.grey11})},sx:t,children:[u,a?void 0:(0,r.jsx)(i.xv,{color:"inherit",variant:"small",children:" (soon)"})]})},T=t(81541),R=function(e){var n=e.date,t=(0,f.Z)(e,["date"]);return(0,r.jsx)(i.xv,(0,h.Z)((0,d.Z)({},t),{color:"inherit",variant:"inherit",children:function(e){var n,t,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return P.format((n=e,t=o,r=q(n),i=q(t),Math.round((+r-+i)/864e5)),"day")}(n)}))},P=new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"narrow"});function q(e){var n=new Date(e);return n.setHours(0,0,0,0),n}var A=t(63397),H=t(17064),G=t(39374),D=t(7604),E=t(23875),Q=function(e){var n,t,o,c,s=e.linkRepo,l=e.repo,u=e.trigger,a=L.Q[l.provider],d=(n={git:l},t=(0,H.Z)((0,G.f)(),1)[0],{updateToken:(o=(0,S.Z)(function(e){return(0,k.__generator)(this,function(r){switch(r.label){case 0:return[4,D.j.git.updateWriteAPIToken({prismic:{domain:t.repositoryName},git:n.git,token:e})];case 1:return r.sent(),[2]}})}),function(e){return o.apply(this,arguments)})}).updateToken,h=(0,E.U)().repositoryUrl;return(0,r.jsxs)(i.Vq,{size:{width:448,height:"auto"},trigger:u,children:[(0,r.jsx)(i.fK,{title:"Prismic Write API token required"}),(0,r.jsx)(i.cZ,{children:(0,r.jsx)(A.J9,{initialValues:{writeAPIToken:""},validate:function(e){if(0===e.writeAPIToken.length)return{writeAPIToken:"Cannot be empty"}},onSubmit:(c=(0,S.Z)(function(e){var n,t;return(0,k.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,s(l)];case 1:return r.sent(),[4,d(e.writeAPIToken)];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),t="Could not connect to ".concat(l.name),console.error(t,n),F.Am.error(t),[3,4];case 4:return[2]}})}),function(e){return c.apply(this,arguments)}),children:function(e){return(0,r.jsxs)("form",{onSubmit:e.handleSubmit,children:[(0,r.jsxs)(i.xu,{flexDirection:"column",gap:4,padding:16,children:[(0,r.jsx)(i.yt,{disabled:e.isSubmitting,error:"string"==typeof e.errors.writeAPIToken,label:"Paste your Write API token",onValueChange:function(n){e.setFieldValue("writeAPIToken",n)},placeholder:"Write API token",value:e.values.writeAPIToken}),(0,r.jsxs)(i.xv,{color:"grey11",children:["Required to sync models from ",a.name," to Prismic."]})]}),(0,r.jsx)(i.kX,{cancel:{text:"Cancel"},link:(0,r.jsx)(i.xv,{href:new URL("/settings/apps",h).href,children:"Create a Prismic Write API token"}),ok:{disabled:!e.isValid,loading:e.isSubmitting,onClick:function(){e.submitForm()},text:"Save Token"},size:"medium"})]})}})})]})},B=function(e){var n=e.repo,t=e.trigger,o=e.unlinkRepo,c=(0,l.useState)(!1),s=c[0],u=c[1];return(0,r.jsxs)(i.Vq,{size:{width:448,height:"auto"},trigger:t,children:[(0,r.jsx)(i.fK,{title:"Remove Git Connection"}),(0,r.jsx)(i.cZ,{children:(0,r.jsx)(i.xu,{flexDirection:"column",padding:16,children:(0,r.jsx)(i.xv,{children:"You will not be able to push your code alongside your models anymore. Note that you can reconnect your Git repository at any time. Are you sure you want to continue?"})})}),(0,r.jsx)(i.kX,{asFooter:!0,cancel:{text:"Cancel"},ok:{color:"tomato",loading:s,onClick:function(){(0,S.Z)(function(){var e,t;return(0,k.__generator)(this,function(r){switch(r.label){case 0:u(!0),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o(n)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),t="Could not disconnect from ".concat(n.name),console.error(t,e),F.Am.error(t),[3,4];case 4:return u(!1),[2]}})})()},text:"Disconnect"},size:"medium"})]})},M=t(46200),O=function(e){var n=e.mode,t=e.repos,o=(0,M.G)(),c=o.linkRepo,s=o.unlinkRepo;return(0,r.jsx)(v,{children:"link"===n?t.map(function(e){return(0,r.jsxs)(w,{action:(0,r.jsx)(Q,{linkRepo:c,repo:e,trigger:(0,r.jsx)(i.zx,{color:"grey",children:"Connect"})}),children:[e.name,(0,r.jsxs)(i.xv,{color:"grey11",children:[" • ",(0,r.jsx)(R,{date:e.pushedAt})]})]},"".concat(e.provider,"@").concat(e.id))}):t.map(function(e){return(0,r.jsx)(w,{action:(0,r.jsx)(B,{repo:e,trigger:(0,r.jsx)(i.zx,{color:"grey",children:"Disconnect"}),unlinkRepo:s}),children:e.name},"".concat(e.provider,"@").concat(e.owner,"/").concat(e.name))})})},z=function(){return(0,r.jsx)(v,{children:(0,T.Z)([,,,,].keys()).map(function(e){return(0,r.jsx)(w,{action:(0,r.jsx)(i.Od,{height:32,width:67.59}),children:(0,r.jsx)(i.Od,{height:24,sx:{verticalAlign:"middle"},width:129.92})},e)})})},W=function(e){var n=e.disabled,t=e.owners,o=void 0===t?[]:t,c=e.selectedOwner,s=e.onSelectedOwnerChange,l=e.sx;return(0,r.jsx)(i.Ph,{color:"grey",constrainContentWidth:!0,disabled:n,flexContent:!0,onValueChange:function(e){var n,t=(0,H.Z)((n=e,n.split("@")),2),r=t[0],i=t[1],c=o.find(function(e){return e.provider===r&&e.id===i});c&&(null==s||s(c))},placeholder:"Owner",renderStartIcon:function(){return(0,r.jsx)(V,{owner:c})},size:"large",sx:l,value:c?K(c):void 0,children:o.map(function(e){return(0,r.jsx)(i.Ql,{renderStartIcon:function(){return(0,r.jsx)(V,{owner:e})},size:"large",value:K(e),children:e.name},K(e))})})},V=function(e){var n,t=e.owner,o=L.Q[null!==(n=null==t?void 0:t.provider)&&void 0!==n?n:"gitHub"].Icon;return(0,r.jsx)(o,{color:i.rS.color.grey11})};function K(e){return"".concat(e.provider,"@").concat(e.id)}var U=t(18566);function X(e,n,t,r){return J.apply(this,arguments)}function J(){return(J=(0,S.Z)(function(e,n,t,r){return(0,k.__generator)(this,function(i){switch(i.label){case 0:return[4,D.j.git.fetchRepos({provider:e,owner:n,query:t,page:r})];case 1:return[2,i.sent()]}})})).apply(this,arguments)}var Y=function(e){var n=e.owners,t=(0,l.useState)(n[0]),i=t[0],o=t[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m,{children:(0,r.jsx)(W,{owners:n,selectedOwner:i,onSelectedOwnerChange:o,sx:{width:"calc(50% - 8px)"}})}),(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(ee,{gitOwnerSelect:!1}),children:(0,r.jsx)($,{owner:i})})]})},$=function(e){var n,t=e.owner,i=(n={provider:t.provider,owner:t.name},(0,U.QT)(X,[n.provider,n.owner,n.query,n.page,]));return i.length>0?(0,r.jsx)(O,{mode:"link",repos:i}):(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"No Results Found",description:"Try selecting a different Git account or organization on the top left."})})},ee=function(e){var n=e.gitOwnerSelect;return(0,r.jsxs)(r.Fragment,{children:[n?(0,r.jsx)(m,{children:(0,r.jsx)(W,{disabled:!0,sx:{width:"calc(50% - 8px)"}})}):void 0,(0,r.jsx)(z,{})]})};function en(){return et.apply(this,arguments)}function et(){return(et=(0,S.Z)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return[4,D.j.git.fetchOwners()];case 1:return[2,e.sent()]}})})).apply(this,arguments)}var er=t(7342),ei=function(){return(0,r.jsxs)(_,{children:[(0,r.jsx)(g,{children:"Connected Git Repository"}),(0,r.jsx)(b.S,{renderError:es,children:(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(ee,{gitOwnerSelect:!0}),children:(0,r.jsx)(eo,{})})}),(0,r.jsx)(y,{action:(0,r.jsx)(i.u,{content:"Documentation is coming soon.",side:"bottom",children:(0,r.jsx)(i.hU,{disabled:!0,icon:"openInNew"})}),children:"Learn more about Prismic for Git"})]})},eo=function(){var e=(0,M.G)().linkedGitRepos;return e.length>0?(0,r.jsx)(O,{mode:"unlink",repos:e}):(0,r.jsx)(ec,{})},ec=function(){var e=(0,U.QT)(en,[]);return e.length>0?(0,r.jsx)(Y,{owners:e}):(0,r.jsx)(j,{children:(0,r.jsx)(N,{})})};function es(e,n){return(0,a.ff)(e)?(0,r.jsx)(el,{}):(0,a.TW)(e)?(0,r.jsx)(eu,{}):(0,r.jsx)(ea,{reset:n})}var el=function(){var e=(0,er.Z)().openLoginModal;return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"It seems like you are logged out",description:"Log in to connect a Git repository.",action:(0,r.jsx)(i.zx,{onClick:e,children:"Log in to Prismic"})})})},eu=function(){return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"It seems like you do not have permission",description:"An owner or admin is required to connect a Git repository."})})},ea=function(e){var n=e.reset;return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"Unable to fetch data",description:"An error occurred while fetching the list of connected Git repositories.",action:(0,r.jsx)(i.zx,{color:"grey",onClick:n,children:"Retry"})})})},ed=t(31799),eh=t(83981),ef=function(){var e=(0,ed.M)(),n=(0,s.useRouter)();return((0,l.useEffect)(function(){e.eligible||n.replace("/")},[e.eligible,n]),e.eligible)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Settings - Slice Machine"})}),(0,r.jsxs)(eh.LN,{children:[(0,r.jsx)(eh.wd,{children:(0,r.jsx)(eh.Cx,{children:(0,r.jsx)(u.g,{children:"Settings"})})}),(0,r.jsx)(eh.RN,{children:(0,r.jsx)(i.xu,{flexDirection:"column",maxWidth:600,children:(0,r.jsx)(ei,{})})})]})]}):null}},52475:function(e){e.exports={flex:"FieldSet_flex__qy2tm",column:"FieldSet_column__NS4qQ FieldSet_flex__qy2tm",root:"FieldSet_root__XVbMv FieldSet_column__NS4qQ FieldSet_flex__qy2tm",row:"FieldSet_row__END9k FieldSet_flex__qy2tm",borderBottom:"FieldSet_borderBottom__L01vK",legend:"FieldSet_legend__JjRCM FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",header:"FieldSet_header__0Q7YD FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",content:"FieldSet_content__PDj3t FieldSet_column__NS4qQ FieldSet_flex__qy2tm",list:"FieldSet_list__HoMpl FieldSet_column__NS4qQ FieldSet_flex__qy2tm",listItem:"FieldSet_listItem__P0SKW FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",listItemText:"FieldSet_listItemText__J0_Fr",borderTop:"FieldSet_borderTop__qyC9U",footer:"FieldSet_footer__thBWh FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderTop__qyC9U",footerText:"FieldSet_footerText__mKIv2"}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=24994)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{24994:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return t(65615)}])},95120:function(e,n,t){"use strict";t.d(n,{Q:function(){return f}});var r=t(22710),i=t(99267);let o={GitHub:"gitHub"};var c=t(62230),s=t(85244),l=t(52322),u=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.77596 5.47599C4.84147 5.44648 4.91265 5.43167 4.9845 5.4326L19.3525 5.43506C19.4243 5.43413 19.4955 5.44894 19.561 5.47845C19.6265 5.50796 19.6848 5.55146 19.7317 5.60588C19.7786 5.6603 19.8131 5.72433 19.8326 5.79348C19.8521 5.86262 19.8563 5.93521 19.8448 6.00614L19.1802 10.0751H9.71803L10.5722 14.6018H11.1162L11.1162 14.6018H13.7846L14.56 10.0751H19.1803L17.7575 18.8357C17.7387 18.9522 17.6786 19.058 17.5882 19.1339C17.4979 19.2098 17.3832 19.2507 17.2652 19.2492H7.23692C7.2134 19.249 7.19001 19.2476 7.16682 19.2449C7.03392 19.2298 6.90803 19.175 6.80603 19.0868C6.68704 18.9851 6.60772 18.8448 6.58203 18.6904L4.49219 6.00367C4.48069 5.93275 4.48485 5.86016 4.50438 5.79102C4.52392 5.72187 4.55835 5.65784 4.60527 5.60342C4.65218 5.54899 4.71044 5.5055 4.77596 5.47599Z",fill:"currentColor"})}))},a=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{d:"M12 4C7.57486 4 4 7.57486 4 12C4 15.5246 6.30057 18.5257 9.47429 19.6C9.87429 19.6754 10.0251 19.4251 10.0251 19.2251V17.8754C7.8 18.3497 7.32457 16.8 7.32457 16.8C6.94971 15.8743 6.42514 15.6251 6.42514 15.6251C5.70057 15.1246 6.47543 15.1497 6.47543 15.1497C7.27543 15.2 7.69943 15.9749 7.69943 15.9749C8.42514 17.2 9.57486 16.8503 10.0251 16.6491C10.1006 16.1246 10.2994 15.7749 10.5246 15.5749C8.74971 15.3749 6.87543 14.6754 6.87543 11.6251C6.87543 10.7497 7.17486 10.0503 7.69943 9.47543C7.62514 9.27543 7.34971 8.45029 7.77486 7.34971C7.77486 7.34971 8.44914 7.12457 9.97486 8.17486C10.6266 7.99627 11.2991 7.90405 11.9749 7.90057C12.6491 7.90057 13.3497 8 13.9749 8.17486C15.5006 7.14971 16.1749 7.34971 16.1749 7.34971C16.6 8.45029 16.3246 9.27543 16.2503 9.47543C16.776 10.024 17.0754 10.7497 17.0754 11.624C17.0754 14.6994 15.2 15.3749 13.4251 15.5749C13.6994 15.8251 13.9749 16.2994 13.9749 17.0491V19.2503C13.9749 19.4754 14.1246 19.7246 14.5246 19.6251C17.7006 18.5246 20 15.5246 20 12C20 7.57486 16.4251 4 12 4Z",fill:"currentColor"})}))},d=function(e){return(0,l.jsx)("svg",(0,s.Z)((0,c.Z)({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),{children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7881 10.5954L16.5431 5.20756C16.6328 4.93081 17.0594 4.93081 17.1492 5.20756L18.9076 10.5954H14.7881ZM6.6192 5.20756L4.86353 10.5954H8.97968L7.22468 5.20756C7.1349 4.93081 6.70898 4.93081 6.6192 5.20756ZM4.0299 13.2981L4.86352 10.5954H4.86353H8.979H14.7881H18.9076L19.7392 13.2981C19.7796 13.4207 19.7802 13.553 19.7408 13.676C19.7014 13.799 19.624 13.9063 19.5198 13.9826L11.893 19.5257L11.8879 19.5319L11.8923 19.5378L11.8865 19.5336L11.8835 19.5371L11.8852 19.5326L4.24927 13.9826C4.0299 13.8246 3.95092 13.5458 4.0299 13.2981Z",fill:"currentColor"})}))},h=t(7604),f={gitHub:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("gitHub")];case 1:return[2,e.sent()]}})}),Icon:a,name:"GitHub",supported:_("gitHub")},bitbucket:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("bitbucket")];case 1:return[2,e.sent()]}})}),Icon:u,name:"Bitbucket",supported:_("bitbucket")},gitLab:{connect:(0,r.Z)(function(){return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,x("gitLab")];case 1:return[2,e.sent()]}})}),Icon:d,name:"GitLab",supported:_("gitLab")}};function x(e){return p.apply(this,arguments)}function p(){return(p=(0,r.Z)(function(e){var n;return(0,i.__generator)(this,function(t){switch(t.label){case 0:if(!_(e))throw Error("Not implemented.");return[4,h.j.git.getProviderAppInstallURL({provider:e})];case 1:return n=t.sent(),window.open(n,"git-provider-app-installation"),[2]}})})).apply(this,arguments)}function _(e){return Boolean(Object.values(o).includes(e))}},46200:function(e,n,t){"use strict";t.d(n,{G:function(){return u}});var r=t(22710),i=t(17064),o=t(99267),c=t(18566),s=t(39374),l=t(7604);function u(){var e,n,t=(0,i.Z)((0,s.f)(),1)[0];return{linkedGitRepos:(0,c.QT)(a,[t.repositoryName]),linkRepo:(e=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.linkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,c.gw)(a,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(n){return e.apply(this,arguments)}),unlinkRepo:(n=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.unlinkRepo({prismic:{domain:t.repositoryName},git:e})];case 1:return n.sent(),[4,(0,c.gw)(a,[t.repositoryName])];case 2:return n.sent(),[2]}})}),function(e){return n.apply(this,arguments)})}}function a(e){return d.apply(this,arguments)}function d(){return(d=(0,r.Z)(function(e){return(0,o.__generator)(this,function(n){switch(n.label){case 0:return[4,l.j.git.fetchLinkedRepos({prismic:{domain:e}})];case 1:return[2,n.sent()]}})})).apply(this,arguments)}},39374:function(e,n,t){"use strict";t.d(n,{f:function(){return s}});var r=t(22710),i=t(99267),o=t(18566),c=t(7604);function s(){var e,n=(0,o.QT)(l,[]),t=(e=(0,r.Z)(function(e){return(0,i.__generator)(this,function(n){switch(n.label){case 0:return[4,c.j.project.writeSliceMachineConfig({config:e})];case 1:return n.sent(),(0,o.VA)(l,[],e),[2]}})}),function(n){return e.apply(this,arguments)});return[n,t]}function l(){return u.apply(this,arguments)}function u(){return(u=(0,r.Z)(function(){return(0,i.__generator)(this,function(e){return[2,c.j.project.getSliceMachineConfig()]})})).apply(this,arguments)}},65615:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ef}});var r=t(52322),i=t(37577),o=t(97729),c=t.n(o),s=t(5632),l=t(2784),u=t(42770),a=t(37792),d=t(62230),h=t(85244),f=t(98240),x=t(52475),p=t.n(x),_=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().root}))},g=function(e){var n=e.children,t=(0,f.Z)(e,["children"]);return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},t),{className:p().legend,children:(0,r.jsx)(i.xv,{color:"grey11",component:"span",noWrap:!0,variant:"smallBold",children:n})}))},m=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().header}))},j=function(e){return(0,r.jsx)("div",(0,h.Z)((0,d.Z)({},e),{className:p().content}))},v=function(e){return(0,r.jsx)("ul",(0,h.Z)((0,d.Z)({},e),{className:p().list}))},w=function(e){var n=e.action,t=e.children,o=(0,f.Z)(e,["action","children"]);return(0,r.jsxs)("li",(0,h.Z)((0,d.Z)({},o),{className:p().listItem,children:[(0,r.jsx)(i.xv,{className:p().listItemText,component:"span",noWrap:!0,variant:"bold",children:t}),n]}))},y=function(e){var n=e.action,t=e.children,o=(0,f.Z)(e,["action","children"]);return(0,r.jsxs)("div",(0,h.Z)((0,d.Z)({},o),{className:p().footer,children:[(0,r.jsx)(i.xv,{className:p().footerText,color:"grey11",component:"span",noWrap:!0,variant:"small",children:t}),n]}))},b=t(16991),C=function(e){var n=e.title,t=e.description,o=e.action;return(0,r.jsxs)(i.xu,{flexDirection:"column",padding:{block:72,inline:100},children:[(0,r.jsx)(i.xv,{align:"center",variant:"emphasized",children:n}),(0,r.jsx)(i.xv,{align:"center",color:"grey11",children:t}),Boolean(o)?(0,r.jsx)(i.hE,{sx:{alignSelf:"center",marginTop:8},children:o}):void 0]})},S=t(22710),k=t(99267),Z=t(98863),F=t(88932),L=t(95120),N=function(){return(0,r.jsx)(i.hE,{children:(0,Z.XP)(L.Q).map(function(e){return(0,r.jsx)(I,{provider:e,sx:{flexBasis:0,flexGrow:1}},e)})})},I=function(e){var n=e.provider,t=e.sx,o=L.Q[n],c=o.connect,s=o.Icon,u=o.name,a=o.supported,d=(0,l.useState)(!1),h=d[0],f=d[1];return(0,r.jsxs)(i.zx,{color:"grey",disabled:!a,loading:h,onClick:function(){(0,S.Z)(function(){var e,n;return(0,k.__generator)(this,function(t){switch(t.label){case 0:f(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,c()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),n="Could not connect to ".concat(u),console.error(n,e),F.Am.error(n),f(!1),[3,4];case 4:return[2]}})})()},renderStartIcon:function(){return(0,r.jsx)(s,{color:i.rS.color.grey11})},sx:t,children:[u,a?void 0:(0,r.jsx)(i.xv,{color:"inherit",variant:"small",children:" (soon)"})]})},T=t(81541),R=function(e){var n=e.date,t=(0,f.Z)(e,["date"]);return(0,r.jsx)(i.xv,(0,h.Z)((0,d.Z)({},t),{color:"inherit",variant:"inherit",children:function(e){var n,t,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;return P.format((n=e,t=o,r=q(n),i=q(t),Math.round((+r-+i)/864e5)),"day")}(n)}))},P=new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"narrow"});function q(e){var n=new Date(e);return n.setHours(0,0,0,0),n}var A=t(63397),H=t(17064),G=t(39374),D=t(7604),O=t(23875),z=function(e){var n,t,o,c,s=e.linkRepo,l=e.repo,u=e.trigger,a=L.Q[l.provider],d=(n={git:l},t=(0,H.Z)((0,G.f)(),1)[0],{updateToken:(o=(0,S.Z)(function(e){return(0,k.__generator)(this,function(r){switch(r.label){case 0:return[4,D.j.git.updateWriteAPIToken({prismic:{domain:t.repositoryName},git:n.git,token:e})];case 1:return r.sent(),[2]}})}),function(e){return o.apply(this,arguments)})}).updateToken,h=(0,O.U)().repositoryUrl;return(0,r.jsxs)(i.Vq,{size:{width:448,height:"auto"},trigger:u,children:[(0,r.jsx)(i.fK,{title:"Prismic Write API token required"}),(0,r.jsx)(i.cZ,{children:(0,r.jsx)(A.J9,{initialValues:{writeAPIToken:""},validate:function(e){if(0===e.writeAPIToken.length)return{writeAPIToken:"Cannot be empty"}},onSubmit:(c=(0,S.Z)(function(e){var n,t;return(0,k.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,s(l)];case 1:return r.sent(),[4,d(e.writeAPIToken)];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),t="Could not connect to ".concat(l.name),console.error(t,n),F.Am.error(t),[3,4];case 4:return[2]}})}),function(e){return c.apply(this,arguments)}),children:function(e){return(0,r.jsxs)("form",{onSubmit:e.handleSubmit,children:[(0,r.jsxs)(i.xu,{flexDirection:"column",gap:4,padding:16,children:[(0,r.jsx)(i.yt,{disabled:e.isSubmitting,error:"string"==typeof e.errors.writeAPIToken,label:"Paste your Write API token",onValueChange:function(n){e.setFieldValue("writeAPIToken",n)},placeholder:"Write API token",value:e.values.writeAPIToken}),(0,r.jsxs)(i.xv,{color:"grey11",children:["Required to sync models from ",a.name," to Prismic."]})]}),(0,r.jsxs)(i.kX,{children:[(0,r.jsx)(i.Bb,{href:new URL("/settings/apps",h).href,children:"Create a Prismic Write API token"}),(0,r.jsx)(i.PO,{size:"medium"}),(0,r.jsx)(i._d,{disabled:!e.isValid,loading:e.isSubmitting,onClick:function(){e.submitForm()},size:"medium",children:"Save Token"})]})]})}})})]})},B=function(e){var n=e.repo,t=e.trigger,o=e.unlinkRepo,c=(0,l.useState)(!1),s=c[0],u=c[1];return(0,r.jsxs)(i.Vq,{size:{width:448,height:"auto"},trigger:t,children:[(0,r.jsx)(i.fK,{title:"Remove Git Connection"}),(0,r.jsx)(i.cZ,{children:(0,r.jsx)(i.xu,{flexDirection:"column",padding:16,children:(0,r.jsx)(i.xv,{children:"You will not be able to push your code alongside your models anymore. Note that you can reconnect your Git repository at any time. Are you sure you want to continue?"})})}),(0,r.jsxs)(i.kX,{children:[(0,r.jsx)(i.PO,{size:"medium"}),(0,r.jsx)(i._d,{size:"medium",color:"tomato",loading:s,onClick:function(){(0,S.Z)(function(){var e,t;return(0,k.__generator)(this,function(r){switch(r.label){case 0:u(!0),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o(n)];case 2:return r.sent(),[3,4];case 3:return e=r.sent(),t="Could not disconnect from ".concat(n.name),console.error(t,e),F.Am.error(t),[3,4];case 4:return u(!1),[2]}})})()},children:"Disconnect"})]})]})},E=t(46200),Q=function(e){var n=e.mode,t=e.repos,o=(0,E.G)(),c=o.linkRepo,s=o.unlinkRepo;return(0,r.jsx)(v,{children:"link"===n?t.map(function(e){return(0,r.jsxs)(w,{action:(0,r.jsx)(z,{linkRepo:c,repo:e,trigger:(0,r.jsx)(i.zx,{color:"grey",children:"Connect"})}),children:[e.name,(0,r.jsxs)(i.xv,{color:"grey11",children:[" • ",(0,r.jsx)(R,{date:e.pushedAt})]})]},"".concat(e.provider,"@").concat(e.id))}):t.map(function(e){return(0,r.jsx)(w,{action:(0,r.jsx)(B,{repo:e,trigger:(0,r.jsx)(i.zx,{color:"grey",children:"Disconnect"}),unlinkRepo:s}),children:e.name},"".concat(e.provider,"@").concat(e.owner,"/").concat(e.name))})})},M=function(){return(0,r.jsx)(v,{children:(0,T.Z)([,,,,].keys()).map(function(e){return(0,r.jsx)(w,{action:(0,r.jsx)(i.Od,{height:32,width:67.59}),children:(0,r.jsx)(i.Od,{height:24,sx:{verticalAlign:"middle"},width:129.92})},e)})})},W=function(e){var n=e.disabled,t=e.owners,o=void 0===t?[]:t,c=e.selectedOwner,s=e.onSelectedOwnerChange,l=e.sx;return(0,r.jsx)(i.Ph,{color:"grey",constrainContentWidth:!0,disabled:n,flexContent:!0,onValueChange:function(e){var n,t=(0,H.Z)((n=e,n.split("@")),2),r=t[0],i=t[1],c=o.find(function(e){return e.provider===r&&e.id===i});c&&(null==s||s(c))},placeholder:"Owner",renderStartIcon:function(){return(0,r.jsx)(V,{owner:c})},size:"large",sx:l,value:c?K(c):void 0,children:o.map(function(e){return(0,r.jsx)(i.Ql,{renderStartIcon:function(){return(0,r.jsx)(V,{owner:e})},size:"large",value:K(e),children:e.name},K(e))})})},V=function(e){var n,t=e.owner,o=L.Q[null!==(n=null==t?void 0:t.provider)&&void 0!==n?n:"gitHub"].Icon;return(0,r.jsx)(o,{color:i.rS.color.grey11})};function K(e){return"".concat(e.provider,"@").concat(e.id)}var U=t(18566);function X(e,n,t,r){return J.apply(this,arguments)}function J(){return(J=(0,S.Z)(function(e,n,t,r){return(0,k.__generator)(this,function(i){switch(i.label){case 0:return[4,D.j.git.fetchRepos({provider:e,owner:n,query:t,page:r})];case 1:return[2,i.sent()]}})})).apply(this,arguments)}var Y=function(e){var n=e.owners,t=(0,l.useState)(n[0]),i=t[0],o=t[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m,{children:(0,r.jsx)(W,{owners:n,selectedOwner:i,onSelectedOwnerChange:o,sx:{width:"calc(50% - 8px)"}})}),(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(ee,{gitOwnerSelect:!1}),children:(0,r.jsx)($,{owner:i})})]})},$=function(e){var n,t=e.owner,i=(n={provider:t.provider,owner:t.name},(0,U.QT)(X,[n.provider,n.owner,n.query,n.page,]));return i.length>0?(0,r.jsx)(Q,{mode:"link",repos:i}):(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"No Results Found",description:"Try selecting a different Git account or organization on the top left."})})},ee=function(e){var n=e.gitOwnerSelect;return(0,r.jsxs)(r.Fragment,{children:[n?(0,r.jsx)(m,{children:(0,r.jsx)(W,{disabled:!0,sx:{width:"calc(50% - 8px)"}})}):void 0,(0,r.jsx)(M,{})]})};function en(){return et.apply(this,arguments)}function et(){return(et=(0,S.Z)(function(){return(0,k.__generator)(this,function(e){switch(e.label){case 0:return[4,D.j.git.fetchOwners()];case 1:return[2,e.sent()]}})})).apply(this,arguments)}var er=t(7342),ei=function(){return(0,r.jsxs)(_,{children:[(0,r.jsx)(g,{children:"Connected Git Repository"}),(0,r.jsx)(b.S,{renderError:es,children:(0,r.jsx)(l.Suspense,{fallback:(0,r.jsx)(ee,{gitOwnerSelect:!0}),children:(0,r.jsx)(eo,{})})}),(0,r.jsx)(y,{action:(0,r.jsx)(i.u,{content:"Documentation is coming soon.",side:"bottom",children:(0,r.jsx)(i.hU,{disabled:!0,icon:"openInNew"})}),children:"Learn more about Prismic for Git"})]})},eo=function(){var e=(0,E.G)().linkedGitRepos;return e.length>0?(0,r.jsx)(Q,{mode:"unlink",repos:e}):(0,r.jsx)(ec,{})},ec=function(){var e=(0,U.QT)(en,[]);return e.length>0?(0,r.jsx)(Y,{owners:e}):(0,r.jsx)(j,{children:(0,r.jsx)(N,{})})};function es(e,n){return(0,a.ff)(e)?(0,r.jsx)(el,{}):(0,a.TW)(e)?(0,r.jsx)(eu,{}):(0,r.jsx)(ea,{reset:n})}var el=function(){var e=(0,er.Z)().openLoginModal;return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"It seems like you are logged out",description:"Log in to connect a Git repository.",action:(0,r.jsx)(i.zx,{onClick:e,children:"Log in to Prismic"})})})},eu=function(){return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"It seems like you do not have permission",description:"An owner or admin is required to connect a Git repository."})})},ea=function(e){var n=e.reset;return(0,r.jsx)(j,{children:(0,r.jsx)(C,{title:"Unable to fetch data",description:"An error occurred while fetching the list of connected Git repositories.",action:(0,r.jsx)(i.zx,{color:"grey",onClick:n,children:"Retry"})})})},ed=t(31799),eh=t(83981),ef=function(){var e=(0,ed.M)(),n=(0,s.useRouter)();return((0,l.useEffect)(function(){e.eligible||n.replace("/")},[e.eligible,n]),e.eligible)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c(),{children:(0,r.jsx)("title",{children:"Settings - Slice Machine"})}),(0,r.jsxs)(eh.LN,{children:[(0,r.jsx)(eh.wd,{children:(0,r.jsx)(eh.Cx,{children:(0,r.jsx)(u.g,{children:"Settings"})})}),(0,r.jsx)(eh.RN,{children:(0,r.jsx)(i.xu,{flexDirection:"column",maxWidth:600,children:(0,r.jsx)(ei,{})})})]})]}):null}},52475:function(e){e.exports={flex:"FieldSet_flex__qy2tm",column:"FieldSet_column__NS4qQ FieldSet_flex__qy2tm",root:"FieldSet_root__XVbMv FieldSet_column__NS4qQ FieldSet_flex__qy2tm",row:"FieldSet_row__END9k FieldSet_flex__qy2tm",borderBottom:"FieldSet_borderBottom__L01vK",legend:"FieldSet_legend__JjRCM FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",header:"FieldSet_header__0Q7YD FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",content:"FieldSet_content__PDj3t FieldSet_column__NS4qQ FieldSet_flex__qy2tm",list:"FieldSet_list__HoMpl FieldSet_column__NS4qQ FieldSet_flex__qy2tm",listItem:"FieldSet_listItem__P0SKW FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderBottom__L01vK",listItemText:"FieldSet_listItemText__J0_Fr",borderTop:"FieldSet_borderTop__qyC9U",footer:"FieldSet_footer__thBWh FieldSet_row__END9k FieldSet_flex__qy2tm FieldSet_borderTop__qyC9U",footerText:"FieldSet_footerText__mKIv2"}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=24994)}),_N_E=e.O()}]);
@@ -0,0 +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(98239)}])},57054:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var i=t(5632),r=t(56580),o=t(15933),a=function(e,n,t){var i,r=null===(i=(0,o.Sd)(e))||void 0===i?void 0:i.find(function(e){return e.name.replace(/\//g,"--")===n});return null==r?void 0:r.components.find(function(e){return e.model.name===t})},s=function(){var e=(0,i.useRouter)(),n=(0,r.v9)(function(n){return{slice:a(n,e.query.lib,e.query.sliceName)}}).slice;if(!n)return{};var t=n.model.variations.find(function(n){return n.id===e.query.variation});return t?{slice:n,variation:t}:{}}},98239:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return eD}});var i=t(52322),r=t(97729),o=t.n(r),a=t(5632),s=t(22710),l=t(62230),c=t(85244),u=t(99267),d=t(74217),f=t(2784),m=t(12189),h=t(35393),v=t(8794),p=t(7342),x=(0,f.createContext)(void 0);function y(e){var n=e.children,t=e.initialSlice,r=(0,a.useRouter)(),o=(0,f.useState)(t),y=o[0],g=o[1],j=(0,v.c)({errorMessage:"Failed to save slice. Check your browser's console for more information."}),b=j.actionQueueStatus,w=j.setNextAction,S=(0,p.Z)().saveSliceSuccess,C=(0,d.R9)(S),k=(0,h.g)().syncChanges,I=(0,f.useMemo)(function(){var e=r.query.variation,n=y.model.variations.find(function(n){return n.id===e});if(n)return n;throw Error("Variation not found")},[y,r]),T=(0,f.useCallback)(function(e){g(e),w((0,s.Z)(function(){var n,t,i,r,o;return(0,u.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,m.Ve)(e)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,m.pL)({libraryID:e.from,sliceID:e.model.id})];case 2:if(r=(i=n.sent()).errors,o=i.mocks,r.length>0)throw r;return C((0,c.Z)((0,l.Z)({},e),{mocks:o})),k(),[2]}})}))},[w,C,k]),R=(0,f.useMemo)(function(){return{actionQueueStatus:b,slice:y,setSlice:T,variation:I}},[b,y,T,I]);return(0,i.jsx)(x.Provider,{value:R,children:"function"==typeof n?n(R):n})}function g(){var e=(0,f.useContext)(x);if(!e)throw Error("SliceBuilderProvider not found");return e}var j=t(57054),b=t(37577),w=t(42770),S=t(90104),C=t(16991),k=t(18566),I=t(7604);function T(e){return R.apply(this,arguments)}function R(){return(R=(0,s.Z)(function(e){var n,t,i;return(0,u.__generator)(this,function(r){switch(r.label){case 0:return[4,I.j.customTypes.readCustomType({id:e})];case 1:if(t=(n=r.sent()).errors,i=n.model,t.length>0)throw t;return[2,i]}})})).apply(this,arguments)}var A=t(99526),E=t(15732),Z=t(25132),_=function(e){return(0,i.jsxs)("svg",(0,c.Z)((0,l.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"})]}))},D=function(){var e,n,t=(e=(0,E.l)().source,n=(0,A.Ag)(e.query),void 0!==n&&(0,A.ne)(e.asPath,n)?n:void 0);return void 0!==t?(0,i.jsx)(C.S,{children:(0,i.jsx)(f.Suspense,{children:(0,i.jsx)(b.xu,{bottom:32,justifyContent:"center",position:"fixed",right:0,width:"100vw",children:(0,i.jsx)(N,{sourceCustomTypeId:t})})})}):null},N=function(e){var n,t=(n=e.sourceCustomTypeId,(0,k.QT)(T,[n])),r=(0,f.useState)(!0),o=r[0],s=r[1],l=(0,a.useRouter)();if(void 0===t||!o)return null;var c=t.format,u=t.id,d=A.cd[c].getBuilderPagePathname(u);return(0,i.jsxs)(b.hE,{density:"compact",color:"dark",children:[(0,i.jsxs)(b.zx,{onClick:function(){l.push(d)},renderStartIcon:function(){return(0,i.jsx)(_,{})},children:["Return to ",t.label]}),(0,i.jsx)(b.zx,{onClick:function(){s(!1)},renderStartIcon:function(){return(0,i.jsx)(Z.T,{})}})]})},O=t(83981),L=t(56580),F=t(33710),V=t(93067),z=t(16131),P=t(25978),M=t(13309),K=function(e){var n=e.children,t=e.open,r=e.onClose;return(0,i.jsxs)(V.zs,{open:t,trigger:n,onClose:r,children:[(0,i.jsx)(V.Ev,{children:"Simulate your slices"}),(0,i.jsx)(V.LB,{component:"video",cloudName:"dmtf1daqp",loop:!1,autoPlay:!1,publicId:P.Sn,poster:"/simulator-video-thumbnail.png",controls:!0,onPlay:function(){m.Xe.track({event:"open-video-tutorials",video:P.Sn})}}),(0,i.jsx)(V.OJ,{children:"Minimize context-switching by previewing your Slice components in the simulator."}),(0,i.jsx)(V.Rp,{children:"Got it"})]})},q=function(e){var n=e.disabled,t=(0,a.useRouter)(),r=(0,f.useRef)(null),o=(0,p.Z)().setSeenSimulatorToolTip,s=(0,L.v9)(function(e){return{hasSeenSimulatorTooltip:(0,M.bv)(e)}}).hasSeenSimulatorTooltip;(0,f.useEffect)(function(){var e=r.current;e&&!s&&setTimeout(function(){return F.Z.show(e)},5e3)},[s]);var l=function(){if(o(),r.current){var e=r.current;F.Z.hide(e)}};return(0,i.jsx)("span",{"data-tip":!0,"data-tip-disable":!1,"data-for":"simulator-button-tooltip",ref:r,children:(0,i.jsx)(K,{open:!s,onClose:l,children:(0,i.jsx)(b.zx,{"data-tip":!0,"data-testid":"simulator-open-button",onClick:function(){l(),window.open("".concat(t.asPath,"/simulator"),P.pq)},disabled:n,renderStartIcon:function(){return(0,i.jsx)(z.z,{color:b.rS.color.grey1,height:"24px",style:{transform:"scale(calc(4 / 3))"},width:"24px"})},children:"Simulate"})})})},B=t(81541),H=t(88866),X=t(28316),W=t(85513),G=t(74029),U=t(1411),Q=t(75843),Y=t(63987),J=t(37806),$=t(58514),ee=t(50535),en=t(55197),et=t(21112),ei=[$.C.Image,$.C.Text,$.C.StructuredText,$.C.Link,$.C.Select,$.C.Boolean,$.C.Number,$.C.Color,$.C.Date,$.C.Embed,$.C.Timestamp,$.C.GeoPoint,$.C.ContentRelationship,$.C.LinkToMedia,],er=[$.C.Group].concat((0,B.Z)(ei)),eo=function(){var e=g(),n=e.slice,t=e.setSlice,r=e.variation,o=(0,f.useState)(!1),a=o[0],s=o[1],l=Boolean(r.items&&Object.keys(r.items).length>0),c=function(e){return function(i){if(e===J.Rt.Items&&r.items&&Object.keys(r.items).length<=1){s(!0);return}var o=(0,G.AK)({slice:n,variationId:r.id,widgetArea:e,fieldId:i});t(o)}},u=function(e){return function(i){var o=i.apiId,a=i.newKey,s=i.value,l=(0,G.L4)({slice:n,variationId:r.id,widgetArea:e,previousFieldId:o,newFieldId:a,newField:s});t(l)}},d=function(e){return function(i){var o=i.id,a=i.label,s=i.widgetTypeName,l=er.find(function(e){return e.CUSTOM_NAME===s||e.TYPE_NAME===s});if(!l)throw Error("Unsupported Field Type: ".concat(s));var c=l.create(a);try{l.schema.validateSync(c,{stripUnknown:!1})}catch(u){throw Error('Model is invalid for widget "'.concat(c.type,'".'))}var d=(0,G.xS)({slice:n,variationId:r.id,widgetArea:e,newFieldId:o,newField:c.type===H.GroupFieldType?Y.Fl.fromSM(c):c});t(d),m.Xe.track({event:"field:added",id:o,name:a,type:c.type,isInAGroup:!1,contentType:(0,et.T)(window.location.pathname)})}},h=function(e){return function(i){if(!(0,ee.uS)(i)){var o=i.source,a=i.destination;if(a){var s=(0,G.gR)({slice:n,variationId:r.id,widgetArea:e,sourceIndex:o.index,destinationIndex:a.index});(0,X.flushSync)(function(){return t(s)})}}}},v=function(){var e=(0,G.Oh)({slice:n,variationId:r.id});t(e),s(!1)};return(0,i.jsxs)(W.aV,{children:[(0,i.jsx)(Q.Z,{zoneType:"slice",zoneTypeFormat:void 0,tabId:void 0,title:"Fields",dataTip:" The non-repeatable zone\n is for fields<br/> that should appear once, like a<br/>\n section title.\n",fields:r.primary,EditModal:U.Z,widgetsArray:er,onDeleteItem:c(J.Rt.Primary),onSave:u(J.Rt.Primary),onSaveNewField:d(J.Rt.Primary),onDragEnd:h(J.Rt.Primary),poolOfFieldsToCheck:r.primary||[],renderHintBase:function(e){var n=e.item;return"slice.primary".concat((0,en.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.primary".concat((0,en.Ti)(e))},testId:"static-zone-content",isRepeatableCustomType:void 0,emptyStateHeading:void 0}),l?(0,i.jsx)(Q.Z,{zoneType:"slice",zoneTypeFormat:void 0,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:ei,fields:r.items,EditModal:U.Z,onDeleteItem:c(J.Rt.Items),onSave:u(J.Rt.Items),onSaveNewField:d(J.Rt.Items),onDragEnd:h(J.Rt.Items),poolOfFieldsToCheck:r.items||[],renderHintBase:function(e){var n=e.item;return"item".concat((0,en.Ti)(n.key))},renderFieldAccessor:function(e){return"slice.items[i]".concat((0,en.Ti)(e))},testId:"slice-repeatable-zone",isRepeatableCustomType:void 0,emptyStateHeading:"No fields"}):null,(0,i.jsxs)(b.Vq,{size:"small",open:a,onOpenChange:function(e){return s(e)},children:[(0,i.jsx)(b.fK,{icon:"delete",title:"Delete field"}),(0,i.jsxs)(b.cZ,{children:[(0,i.jsx)(b.xu,{padding:24,gap:12,flexDirection:"column",children:n.model.variations.length>1?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("strong",{children:["This action will permanently remove the repeatable zone from the ",n.model.name," slice ",r.name," variation."]}),(0,i.jsx)("div",{children:"Other variations will be left untouched. To reimplement repeatable fields later, use a group field instead of the repeatable zone."})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("strong",{children:["This action will permanently remove the repeatable zone from the ",n.model.name,"."]}),(0,i.jsx)("div",{children:"To reimplement repeatable fields later, use a group field instead of the repeatable zone."})]})}),(0,i.jsxs)(b.kX,{children:[(0,i.jsx)(b.PO,{}),(0,i.jsx)(b._d,{color:"tomato",onClick:v,children:"Delete"})]})]})]})]})},ea=t(88932),es=t(86670),el=t(88201),ec=t(72484),eu=t(63815);function ed(){return(ed=(0,s.Z)(function(e){var n,t,i,r,o,a,s,d,f,h,v,p;return(0,u.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),[4,(0,m.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,m.Xi)({libraryID:e.component.from,sliceID:e.component.model.id,variationID:e.variation.id})];case 2:if((r=n.sent().errors).length>0)throw r;return[4,(0,m.X$)(e.component.from,e.component.model.id)];case 3:if(a=(o=n.sent()).slice,(s=o.errors).length>0)throw s;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,m.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return d=n.sent().mocks,f=ec.Y.getBuilderPagePathname({libraryName:e.component.href,sliceName:a.name,variationId:a.variations[0].id}),[4,e.router.replace(f)];case 5:return n.sent(),h=(0,c.Z)((0,l.Z)({},e.component),{model:a,mocks:d}),e.saveSliceSuccess(h),[2,h];case 6:throw v=n.sent(),p="Could not delete variation `".concat(e.variation.name,"`"),console.error(p,v),ea.Am.error(p),v;case 7:return[2]}})})).apply(this,arguments)}var ef=function(e){var n=e.isOpen,t=e.onClose,r=e.slice,o=e.variation,l=(0,a.useRouter)(),c=(0,f.useState)(!1),d=c[0],m=c[1],h=(0,p.Z)().saveSliceSuccess,v=g().setSlice;return(0,i.jsxs)(b.Vq,{open:n,onOpenChange:function(e){return!e&&t()},size:{width:448,height:"auto"},children:[(0,i.jsx)(b.fK,{icon:"delete",title:"Delete variation"}),(0,i.jsx)(b.cZ,{children:(0,i.jsxs)(b.xu,{flexDirection:"column",children:[(0,i.jsxs)(b.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)(em,{children:"not"})," affect your documents until you ",(0,i.jsx)(em,{children:"edit"})," ","them manually."]}),(0,i.jsxs)(b.kX,{children:[(0,i.jsx)(b.PO,{size:"medium"}),(0,i.jsx)(b._d,{size:"medium",color:"tomato",onClick:function(){o&&(0,s.Z)(function(){var e;return(0,u.__generator)(this,function(e){switch(e.label){case 0:m(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,function(e){return ed.apply(this,arguments)}({component:r,router:l,saveSliceSuccess:h,variation:o})];case 2:return v(e.sent()),[3,4];case 3:return e.sent(),[3,4];case 4:return m(!1),t(),[2]}})})()},loading:d,children:"Delete"})]})]})})]})},em=function(e){return(0,i.jsx)(b.xv,(0,c.Z)((0,l.Z)({},e),{color:"inherit",component:"span",variant:"bold"}))},eh=t(63397);function ev(){return(ev=(0,s.Z)(function(e){var n,t,i,r,o,a,s,d,f,h,v;return(0,u.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,(0,m.Ve)(e.component)];case 1:if((t=n.sent().errors).length>0)throw t;return[4,(0,m.eH)(e.component,(0,c.Z)((0,l.Z)({},e.variation),{name:e.variationName}))];case 2:if((r=n.sent().errors).length>0)throw r;return[4,(0,m.X$)(e.component.from,e.component.model.id)];case 3:if(a=(o=n.sent()).slice,(s=o.errors).length>0)throw s;if(!a)throw Error("Could not read variation `".concat(e.variation.name,"`"));return[4,(0,m.pL)({libraryID:e.component.from,sliceID:e.component.model.id})];case 4:return d=n.sent().mocks,f=(0,c.Z)((0,l.Z)({},e.component),{model:a,mocks:d}),e.saveSliceSuccess(f),[2,f];case 5:throw h=n.sent(),v="Could not rename variation `".concat(e.variation.name,"`"),console.error(v,h),ea.Am.error(v),h;case 6:return[2]}})})).apply(this,arguments)}var ep=t(61926),ex=t.n(ep),ey=function(e){var n,t,r=e.isOpen,o=e.onClose,a=e.slice,l=e.variation,c=(0,f.useState)(!1),d=c[0],m=c[1],h=g().setSlice,v=(0,p.Z)().saveSliceSuccess;return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(b.Vq,{open:r,onOpenChange:function(e){return!e&&o()},size:{width:448,height:"auto"},children:[(0,i.jsx)(b.fK,{icon:"edit",title:"Rename variation"}),(0,i.jsx)(b.cZ,{children:(0,i.jsx)(eh.J9,{validateOnMount:!0,initialValues:{variationName:null!==(n=null==l?void 0:l.name)&&void 0!==n?n:""},validate:function(e){if(0===e.variationName.length)return{variationName:"Cannot be empty"}},onSubmit:(t=(0,s.Z)(function(e){var n;return(0,u.__generator)(this,function(n){switch(n.label){case 0:if(!l)return[2];m(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,function(e){return ev.apply(this,arguments)}({component:a,saveSliceSuccess:v,variation:l,variationName:e.variationName.trim()})];case 2:return h(n.sent()),[3,4];case 3:return n.sent(),[3,4];case 4:return m(!1),o(),[2]}})}),function(e){return t.apply(this,arguments)}),children:function(e){return(0,i.jsxs)("form",{children:[(0,i.jsxs)(b.xu,{flexDirection:"column",gap:8,padding:16,children:[(0,i.jsx)(b.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)(b.xu,{flexDirection:"column",gap:4,children:[(0,i.jsxs)("label",{className:ex().label,children:[(0,i.jsx)(b.xv,{variant:"bold",children:"Variation name*"}),"string"==typeof e.errors.variationName?(0,i.jsx)(b.xv,{variant:"small",color:"tomato10",children:e.errors.variationName}):null]}),(0,i.jsx)(b.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.jsxs)(b.kX,{children:[(0,i.jsx)(b.PO,{size:"medium"}),(0,i.jsx)(b._d,{size:"medium",onClick:function(){e.submitForm()},loading:d,disabled:!e.isValid,children:"Rename"})]})]})}})})]})})},eg=t(97461),ej=t(76635),eb=t(36131),ew=t(75289),eS=t(2978),eC=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)(eS.Z,{borderFooter:!0,footerSx:{p:0},bodySx:{pt:2,pb:4,px:4},sx:(0,l.Z)({border:"none"},void 0===a?{}:a),Header:function(e){var n=e.radius;return(0,i.jsxs)(ew.kC,{sx:(0,l.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)(ew.x8,{onClick:o,type:"button"}):null]})},Footer:t?(0,i.jsxs)(ew.kC,{sx:{alignItems:"space-between",bg:"headSection",p:3},children:[(0,i.jsx)(ew.xu,{sx:{ml:"auto"}}),t]}):null,children:n})},ek=t(28199),eI=function(e){var n=e.msg;return(0,i.jsx)(ew.xv,{as:"span",sx:{fontSize:12,color:"error",mt:"5px",ml:2},children:n||"Error!"})},eT=function(e){var n=e.isOpen,t=e.onClose,r=e.onSubmit,o=e.initialVariation,a=e.variations,d=function(e){var n=e.id,t=e.name,i=e.origin,r=n&&n.length?null:{id:"Required!"},o=a.find(function(e){return e.id===n})?{id:"This id already exists!"}:null,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,l.Z)({},r,o,s,c,u)},m=function(e){C((0,ej.camelCase)(e))},h=function(e){E(e),I&&m(e)},v=function(e){T(!1),m(e)},p=function(){x(),t()},x=function(){C(""),E(""),j({}),T(!0),D({value:o.id,label:o.name})},y=(0,f.useState)({}),g=y[0],j=y[1],w=(0,f.useState)(""),S=w[0],C=w[1],k=(0,f.useState)(!0),I=k[0],T=k[1],R=(0,f.useState)(""),A=R[0],E=R[1],Z=(0,f.useState)({value:o.id,label:o.name}),_=Z[0],D=Z[1],N=(0,f.useState)(!1),O=N[0],L=N[1];function F(){return V.apply(this,arguments)}function V(){return(V=(0,s.Z)(function(){var e,n;return(0,u.__generator)(this,function(t){switch(t.label){case 0:if(!Object.keys(e=d({id:S,name:A,origin:_})).length)return[3,1];return j(e),[3,3];case 1:if(!(n=a.find(function(e){return e.id===_.value})))return[3,3];return L(!0),[4,r(S,A,n)];case 2:t.sent(),L(!1),p(),t.label=3;case 3:return[2]}})})).apply(this,arguments)}return(0,f.useEffect)(function(){x()},[o,n]),(0,i.jsx)(ek.Z,{isOpen:n,shouldCloseOnOverlayClick:!0,onRequestClose:function(){return p()},contentLabel:"Widget Form Modal",style:{content:{maxWidth:"700px"}},children:(0,i.jsx)(eh.J9,{initialValues:{id:S,name:A,origin:_},onSubmit:F,children:(0,i.jsx)(eh.l0,{id:"variation-add",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),F())},children:(0,i.jsx)(b.xu,{children:(0,i.jsxs)(eC,{sx:{textAlign:"left"},HeaderContent:(0,i.jsx)(ew.xv,{as:"h2",children:"Add new Variation"}),FooterContent:(0,i.jsxs)(b.xu,{gap:16,alignItems:"center",children:[(0,i.jsx)(b.zx,{onClick:p,color:"grey",children:"Cancel"}),(0,i.jsx)(b.zx,{loading:O,children:"Submit"})]}),close:p,children:[(0,i.jsxs)(b.xu,{flexDirection:"column",padding:{block:16},children:[(0,i.jsxs)(ew.__,{htmlFor:"name",sx:{mb:1},children:["Variation name*",g.name?(0,i.jsx)(eI,{msg:g.name}):""]}),(0,i.jsx)(eh.gN,{autoComplete:"off",id:"name",name:"name",placeholder:"e.g. Grid - With Icon",as:ew.II,maxLength:30,value:A,onChange:function(e){return h(e.currentTarget.value)}}),(0,i.jsx)(ew.xv,{children:"It will appear here in Slice Machine, and in the page editor in Prismic"})]}),(0,i.jsxs)(b.xu,{flexDirection:"column",padding:{bottom:16},children:[(0,i.jsxs)(ew.__,{htmlFor:"id",sx:{mb:1},children:["Variation ID*",g.id?(0,i.jsx)(eI,{msg:g.id}):""]}),(0,i.jsx)(eh.gN,{autoComplete:"off",id:"id",name:"id",placeholder:"e.g. GridWithIcon",as:ew.II,maxLength:30,value:S,onChange:function(e){return v(e.currentTarget.value)}}),(0,i.jsx)(ew.xv,{children:"It's generated automatically based on the variation name and will appear in the API responses."})]}),(0,i.jsxs)(b.xu,{flexDirection:"column",padding:{bottom:8},children:[(0,i.jsx)(ew.__,{htmlFor:"origin",sx:{mb:1},children:"Duplicate from"}),(0,i.jsx)(eb.ZP,{name:"origin",options:a.map(function(e){return{value:e.id,label:e.name}}),onChange:function(e){e&&D(e)},defaultValue:_,maxMenuHeight:150,theme:function(e){return(0,c.Z)((0,l.Z)({},e),{colors:(0,c.Z)((0,l.Z)({},e.colors),{text:"text",primary:"background"})})}})]})]})})})})})},eR=t(87647),eA=t.n(eR),eE=function(e){var n,t=e.horizontalScroll,r=g(),o=r.slice,l=r.variation,c=r.setSlice,d=(0,f.useState)(),h=d[0],v=d[1],x=(0,eu.H)(),y=x.modalPayload,j=y.sliceFilterFn,w=y.defaultVariationSelector,S=y.onUploadSuccess,C=(0,a.useRouter)(),k=(0,p.Z)().saveSliceSuccess,I=o.model.variations.length;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(b.xu,{flexDirection:"column",gap:16,children:void 0!==t&&t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(es.i,{variant:"edgeFaded",color:"grey6"}),(0,i.jsxs)(b.xu,{justifyContent:"space-between",children:[(0,i.jsxs)(b.xv,{color:"grey11",children:[I," variation",1!==I&&"s"]}),(0,i.jsx)(b.zx,{onClick:function(){v({type:"ADD_VARIATION"})},startIcon:"add",color:"grey",children:"Add a variation"})]}),(0,i.jsx)("div",{className:eA().hideScrollbar,style:{height:"240px",position:"relative",marginRight:"-32px",overflowX:"scroll",scrollSnapType:"x mandatory"},children:(0,i.jsx)("div",{style:{position:"absolute",paddingRight:"32px"},children:(0,i.jsx)(b.xu,{flexDirection:"row",gap:16,children:(0,i.jsx)(eZ,{screenshotChangesModal:x,setDialog:v,width:320})})})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eZ,{screenshotChangesModal:x,setDialog:v}),(0,i.jsx)("div",{style:{bottom:b.rS.space[0],marginBottom:"-".concat(b.rS.space[16]),position:"sticky"},children:(0,i.jsxs)(b.xu,{backgroundColor:"grey2",flexDirection:"column",padding:{bottom:40,inline:24},children:[(0,i.jsx)(b.ph,{sx:{left:0,position:"absolute",right:0}}),(0,i.jsx)(b.zx,{color:"grey",onClick:function(){v({type:"ADD_VARIATION"})},startIcon:"add",sx:{position:"relative"},children:"Add a variation"})]})})]})}),(0,i.jsx)(eg.Z,{slices:j([o]),defaultVariationSelector:w,onUploadSuccess:S}),(0,i.jsx)(ey,{isOpen:(null==h?void 0:h.type)==="RENAME_VARIATION",onClose:function(){v(void 0)},slice:o,variation:null==h?void 0:h.variation}),(0,i.jsx)(ef,{isOpen:(null==h?void 0:h.type)==="DELETE_VARIATION",onClose:function(){v(void 0)},slice:o,variation:null==h?void 0:h.variation}),(0,i.jsx)(eT,{initialVariation:l,isOpen:(null==h?void 0:h.type)==="ADD_VARIATION",onClose:function(){v(void 0)},onSubmit:(n=(0,s.Z)(function(e,n,t){var i,r,a,s,l,d;return(0,u.__generator)(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),r=(i=(0,G.Kp)({slice:o,id:e,name:n,copiedVariation:t})).slice,a=i.variation,[4,(0,m.Ve)(r)];case 1:return u.sent(),k(r),c(r),s=ec.Y.getBuilderPagePathname({libraryName:r.href,sliceName:r.model.name,variationId:a.id}),C.replace(s),[3,3];case 2:return l=u.sent(),d="Could not add variation `".concat(n,"`"),console.error(d,l),ea.Am.error(d),[3,3];case 3:return[2]}})}),function(e,t,i){return n.apply(this,arguments)}),variations:o.model.variations})]})},eZ=function(e){var n=e.screenshotChangesModal,t=e.setDialog,r=e.width,o=g(),a=o.slice,s=o.variation,u=o.setSlice,d={scrollSnapAlign:"start"};return(0,i.jsx)(i.Fragment,{children:a.model.variations.map(function(e){return(0,i.jsx)("div",{style:void 0!==r?(0,c.Z)((0,l.Z)({},d),{width:r}):d,children:(0,i.jsx)(el.b,{action:{type:"menu",onRename:function(){t({type:"RENAME_VARIATION",variation:e})},onRemove:function(){t({type:"DELETE_VARIATION",variation:e})},removeDisabled:a.model.variations.length<=1},mode:"navigation",onUpdateScreenshot:function(){n.onOpenModal({sliceFilterFn:function(e){return e},defaultVariationSelector:{sliceID:a.model.id,variationID:e.id},onUploadSuccess:function(e){u(e)}})},replace:!0,selected:e.id===s.id,slice:a,variant:"outlined",variationId:e.id},e.id)},e.id)})})},e_=function(){var e=g(),n=e.slice,t=e.actionQueueStatus,r=(0,b.ac)({max:"large"});return(0,i.jsxs)(O.LN,{children:[(0,i.jsxs)(O.wd,{children:[(0,i.jsx)(O.Xq,{url:"/slices"}),(0,i.jsxs)(O.Cx,{children:[(0,i.jsx)(w.g,{children:"Slices"}),(0,i.jsx)(w.g,{active:!0,children:n.model.name})]}),(0,i.jsxs)(O.K2,{children:[(0,i.jsx)(S.X,{status:t}),(0,i.jsx)(q,{disabled:"done"!==t})]})]}),(0,i.jsxs)(O.RN,{children:[(0,i.jsxs)(b.xu,(0,c.Z)((0,l.Z)({display:"grid",alignItems:"flex-start",gap:16},r?{gridTemplateRows:"304px 1fr"}:{gridTemplateColumns:"320px 1fr"}),{children:[(0,i.jsx)(eE,{horizontalScroll:r}),(0,i.jsx)(eo,{})]})),(0,i.jsx)(D,{})]})]})};function eD(){var e=(0,a.useRouter)(),n=(0,j.Z)(),t=n.slice,r=n.variation;return void 0===t||void 0===r?(e.replace("/"),null):(0,i.jsx)(y,{initialSlice:t,children:function(e){var n=e.slice;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o(),{children:(0,i.jsxs)("title",{children:[n.model.name," - Slice Machine"]})}),(0,i.jsx)(e_,{})]})}})}},61926:function(e){e.exports={label:"RenameVariationModal_label__SLsVs"}},87647:function(e){e.exports={hideScrollbar:"VariationsList_hideScrollbar__kRAKE"}},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 l(e,n){return void 0===n&&(n=","),e.split(n)}function c(e,n,t){void 0===n&&(n="+");var i,a=e.toLocaleLowerCase().split(n).map(function(e){return 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&&m([s(e.key),s(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 h(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 v=function(e,n,t){void 0===t&&(t=!1);var i,r,o=n.alt,a=n.meta,l=n.mod,c=n.shift,f=n.ctrl,m=n.keys,h=e.key,v=e.code,p=e.ctrlKey,x=e.metaKey,y=e.shiftKey,g=e.altKey,j=s(v),b=h.toLowerCase();if(!t){if(!g===o&&"alt"!==b||!y===c&&"shift"!==b)return!1;if(l){if(!x&&!p)return!1}else if(!x===a&&"meta"!==b&&"os"!==b||!p===f&&"ctrl"!==b&&"control"!==b)return!1}return!!(m&&1===m.length&&(m.includes(b)||m.includes(j)))||(m?(void 0===r&&(r=","),(d(i=m)?i:i.split(r)).every(function(e){return u.has(e.trim().toLowerCase())})):!m)},p=(0,i.createContext)(void 0),x=(0,i.createContext)({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),y=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},g="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;function j(e,n,t,r){var o,a,u=(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,S=t instanceof Array?t:r instanceof Array?r:void 0,C=(0,i.useCallback)(n,null!=S?S:[]),k=(0,i.useRef)(C);S?k.current=C:k.current=n;var I=(!function e(n,t){return n&&t&&"object"==typeof n&&"object"==typeof t?Object.keys(n).length===Object.keys(t).length&&Object.keys(n).reduce(function(i,r){return i&&e(n[r],t[r])},!0):n===t}((a=(0,i.useRef)(void 0)).current,b)&&(a.current=b),a.current),T=(0,i.useContext)(x).enabledScopes,R=(0,i.useContext)(p);return g(function(){if((null==I?void 0:I.enabled)!==!1&&(e=T,n=null==I?void 0:I.scopes,0===e.length&&n?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):!!(!n||e.some(function(e){return n.includes(e)})||e.includes("*")))){var e,n,t=function(e,n){var t,i;if(void 0===n&&(n=!1),!(h(e,["input","textarea","select"])&&!h(e,null==I?void 0:I.enableOnFormTags)||null!=I&&null!=I.ignoreEventWhen&&I.ignoreEventWhen(e))){if(null!==u.current&&document.activeElement!==u.current&&!u.current.contains(document.activeElement)){y(e);return}(null==(t=e.target)||!t.isContentEditable||null!=I&&I.enableOnContentEditable)&&l(w,null==I?void 0:I.splitKey).forEach(function(t){var i,r,o,a,s,l,u,d=c(t,null==I?void 0:I.combinationKey);if(v(e,d,null==I?void 0:I.ignoreModifiers)||null!=(u=d.keys)&&u.includes("*")){if(n&&j.current)return;if(i=e,r=d,("function"==typeof(o=null==I?void 0:I.preventDefault)&&o(i,r)||!0===o)&&i.preventDefault(),a=e,s=d,"function"==typeof(l=null==I?void 0:I.enabled)?!l(a,s):!0!==l&&void 0!==l){y(e);return}k.current(e,d),n||(j.current=!0)}})}},i=function(e){void 0!==e.key&&(f(s(e.code)),((null==I?void 0:I.keydown)===void 0&&(null==I?void 0:I.keyup)!==!0||null!=I&&I.keydown)&&t(e))},r=function(e){void 0!==e.key&&(m(s(e.code)),j.current=!1,null!=I&&I.keyup&&t(e,!0))},o=u.current||(null==b?void 0:b.document)||document;return o.addEventListener("keyup",r),o.addEventListener("keydown",i),R&&l(w,null==I?void 0:I.splitKey).forEach(function(e){return R.addHotkey(c(e,null==I?void 0:I.combinationKey,null==I?void 0:I.description))}),function(){o.removeEventListener("keyup",r),o.removeEventListener("keydown",i),R&&l(w,null==I?void 0:I.splitKey).forEach(function(e){return R.removeHotkey(c(e,null==I?void 0:I.combinationKey,null==I?void 0:I.description))})}}},[w,I,T]),u}}},function(e){e.O(0,[898,789,917,525,461,139,183,50,543,696,816,574,152,774,888,179],function(){return e(e.s=31314)}),_N_E=e.O()}]);