1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8596],{71968:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_internal/contentful-apps/page-builder",function(){return n(91343)}])},91343:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__N_SSP:()=>ec,default:()=>eu});var i=n(6029),a=n(56598),r=n(37925),s=n(28833),l=n(67279),o=n(55729);let d=[{label:"None (disabled)",value:""},{label:"Local",value:"https://drop-local.dx.ea.com"},{label:"Dev",value:"https://drop-dev.dx.ea.com"},{label:"Stage",value:"https://drop-stage.dx.ea.com"},{label:"Prod",value:"https://drop-prod.dx.ea.com"}],c=new Set(d.map(e=>{let{value:t}=e;return t})),u=e=>{if("object"!=typeof e||null===e||!("appHostOverride"in e)||"string"!=typeof e.appHostOverride)return"";let t=e.appHostOverride.trim();return c.has(t)?t:""};var p=n(99899),h=n(99096);n(18384);var f=n(35339),g=n(80552),m=n(54102),y=n(6240),v=n(54502),A=n(72441),x=n(13470),b=n(83845);let w=["16x9","1x1","2x1","2x3","3x1","3x4","4x3","9x16"],j=async(e,t)=>{if(e){var n;return null!=(n=await t.asset.get({assetId:e}))?n:void 0}},S=async(e,t)=>{if(e){var n;return null!=(n=await t.entry.get({entryId:e}))?n:void 0}},E=async(e,t)=>{var n,i,a,r,s,l,o,d;let c=await j(null==(n=e.fields.image.en)?void 0:n.sys.id,t),u={},p=await Promise.all(null!=(l=null==(a=e.fields.aspectRatios)||null==(i=a.en)?void 0:i.map(async e=>S(e.sys.id,t)))?l:[]);for(let e of w){let n=p.find(e=>{null==e||e.fields.aspectRatio.en}),i=await j(null==n||null==(o=n.fields.image.en)?void 0:o.sys.id,t),a=null==i||null==(d=i.fields.file.en)?void 0:d.url;a&&(u[e]="https".concat(a))}return{alt:(null==(r=e.fields.alternateText)?void 0:r.en)||"",name:(null==(s=e.fields.name)?void 0:s.en)||"",overrides:u,src:(0,b.g)((null==c?void 0:c.fields.file.en.url)?"https:".concat(c.fields.file.en.url):"")}},T=async(e,t)=>{var n,i,a,r;let s=await j(null==(n=e.fields.asset.en)?void 0:n.sys.id,t),l=null==s||null==(i=s.fields.file.en)?void 0:i.url,o="";return l&&(o=l.startsWith("//")?"https:".concat(l):l),{alt:(null==(a=e.fields.alternateText)?void 0:a.en)||"",name:(null==(r=e.fields.title)?void 0:r.en)||"",overrides:{},preserveSrc:!0,src:(0,b.g)(o)}},k={PAGE_BUILDER_TRANSLATION:"pageBuilderTranslation"};var R=n(75445);n(89657);var L=n(70263);let C={blockquote:L.nA.QUOTE,h1:L.nA.HEADING_1,h2:L.nA.HEADING_2,h3:L.nA.HEADING_3,h4:L.nA.HEADING_4,h5:L.nA.HEADING_5,h6:L.nA.HEADING_6,hr:L.nA.HR,li:L.nA.LIST_ITEM,ol:L.nA.OL_LIST,p:L.nA.PARAGRAPH,table:L.nA.TABLE,td:L.nA.TABLE_CELL,th:L.nA.TABLE_HEADER_CELL,tr:L.nA.TABLE_ROW,ul:L.nA.UL_LIST},I={b:L.j7.BOLD,code:L.j7.CODE,em:L.j7.ITALIC,i:L.j7.ITALIC,s:L.j7.STRIKETHROUGH,strong:L.j7.BOLD,sub:L.j7.SUBSCRIPT,sup:L.j7.SUPERSCRIPT,u:L.j7.UNDERLINE};function _(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{content:t,data:n,nodeType:e}}function D(e,t){return{data:{},marks:t,nodeType:"text",value:e}}function P(e,t){let n=[];for(let r of Array.from(e.childNodes)){var i,a;if(3===r.nodeType){let e=null!=(i=r.textContent)?i:"";e&&n.push(D(e,t))}else if(1===r.nodeType&&r instanceof HTMLElement){let e=r.tagName.toLowerCase();if("a"===e){let e=null!=(a=r.getAttribute("href"))?a:"";n.push(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{content:t,data:n,nodeType:e}}(L.XD.HYPERLINK,P(r,t),{uri:e}))}else if("br"===e)n.push(D("\n",t));else{let i=I[e],a=i?[...t,{type:i}]:t;n.push(...P(r,a))}}}return n}function H(e){return e.length>0?e:[D("",[])]}function N(e){return e.nodeType!==L.nA.LIST_ITEM}L.nA.PARAGRAPH,L.nA.HEADING_1,L.nA.HEADING_2,L.nA.HEADING_3,L.nA.HEADING_4,L.nA.HEADING_5,L.nA.HEADING_6,L.nA.HEADING_1,L.nA.HEADING_2,L.nA.HEADING_3,L.nA.HEADING_4,L.nA.HEADING_5,L.nA.HEADING_6,L.nA.PARAGRAPH;var M=n(98646);let O=(0,h.RC)(),G={h1:"0",h2:"var(--drop-spacing-16)",h3:"var(--drop-spacing-32)",h4:"var(--drop-spacing-48)"},B=()=>{let e=O(e=>e.appState.data),t=(0,o.useMemo)(()=>(0,R.ks)(e),[e]);return(0,i.jsxs)(s.so,{flexDirection:"column",gap:"spacingS",padding:"spacingS",children:[(0,i.jsx)(r.EY,{fontWeight:"fontWeightMedium",children:"Page heading"}),(0,i.jsx)(r.EY,{fontSize:"fontSizeS",children:"The first titled block is the page H1. Other blocks keep their built-in levels."}),0===t.length?(0,i.jsx)(M.L,{title:"Missing page title",variant:"warning",children:"Add a title to a supported block to create the page H1."}):(0,i.jsx)(s.so,{flexDirection:"column",gap:"spacingXs",children:t.map(e=>(0,i.jsxs)(s.so,{alignItems:"center",gap:"spacingS",style:{marginInlineStart:G[e.headingLevel]},children:[(0,i.jsx)(r.EY,{fontSize:"fontSizeS",fontWeight:"fontWeightMedium",children:e.headingLevel.toUpperCase()}),(0,i.jsxs)(r.EY,{fontSize:"fontSizeS",children:[e.componentLabel,": ",e.title]})]},"".concat(e.blockId,":").concat(e.componentLabel)))})]})},F={addRemoveRearrange:"Keep the page easy to scan by adding only what supports your page goal, then reorder blocks until the story flows naturally.\n\n- Add only the blocks you need for this specific page.\n- Move blocks up or down to improve reading order.\n- Remove extra blocks to keep the experience focused.\n",componentConfiguration:"After selecting a block, use the field panel to edit content and configuration without touching code.\n\n- Click a block in the canvas to open its settings.\n- Update content first, then tune presentation details.\n- Check the canvas after each edit so issues are easy to catch.\n\n### Config: localization and manual updates\n\nUse this process for translatable content and direct translation corrections.\n\n- Fields ending with `_intl` are translatable.\n- Save after updating `_intl` fields so translation sync runs.\n- Open the target locale and verify translated content appears.\n- If a translation needs direct correction, update the linked `pageBuilderTranslation` entry:\n - Use `textValue` for plain text.\n - Use `richTextValue` for rich text.\n- If translation is missing, the page falls back to the default locale value.\n",dragAndDrop:"Build the page visually by dragging blocks from the component list into the canvas.\n\n- Start with the larger layout blocks first.\n- Drop each block where you want it to appear.\n- Use viewport previews while arranging blocks to validate responsiveness.\n",overview:"This page builder helps you create and update page layouts directly in Contentful with immediate visual feedback.\n\n- Build page structure in the editor canvas.\n- Edit block content from the settings panel.\n- Save and publish through your normal Contentful workflow.\n",savingAndPublishing:"Treat save and publish as a final qual
1ity pass so the page is complete before it goes live.\n\n- Confirm path and meta values before publishing.\n- Confirm the path starts with `/`, is lowercase, and does not include the full domain.\n- Check for path collisions with existing pages.\n- Verify required locale content is present.\n- Check content in at least one mobile and one desktop viewport.\n- Publish only when structure, copy, and locale coverage are final.\n"},U=["overview","dragAndDrop","addRemoveRearrange","componentConfiguration","savingAndPublishing"],z={contextualHints:{configureComponent:{message:"Select a block first, then edit its fields in the left panel. Your changes appear right away.",title:"Editing block settings"},deletePage:{message:"Deleting here also removes linked translation and meta entries, so there is less manual cleanup.",title:"Deleting a page"},dragComponent:{message:"Drag a block from the library into the canvas. Move it again at any time to refine the layout.",title:"Adding blocks"},metaSelection:{message:"Pick a meta entry to control SEO title and description for this page.",title:"Meta setup"},pathSetup:{message:"Path sets the page URL. Use a unique route that starts with /, keep it lowercase, use hyphens between words, and do not include the full domain (for example /about or /events).",title:"Path setup"},publishChecklist:{message:"Before publishing, verify path, meta, locale content, and final copy in your selected viewport previews.",title:"Publish checklist"},saveReminder:{message:"The editor syncs as you work, but always confirm your Contentful entry is ready before publishing.",title:"Saving reminders"},undoRedo:{message:"Use undo and redo to quickly move through recent changes while refining your page.",title:"Undo and redo"}},sections:{addRemoveRearrange:{markdown:F.addRemoveRearrange,title:"Add, remove, and rearrange"},componentConfiguration:{markdown:F.componentConfiguration,title:"Configure each block"},dragAndDrop:{markdown:F.dragAndDrop,title:"Drag and drop basics"},overview:{markdown:F.overview,title:"Page builder overview"},savingAndPublishing:{markdown:F.savingAndPublishing,title:"Saving and publishing"}}},W=e=>z.contextualHints[e];var J=n(49695),V=n(22708),K=n(85506),Y=n(40715);let q=e=>{var t;let{sectionIds:n,title:a}=e,l=(0,o.useMemo)(()=>n.map(e=>{let t=z.sections[e];return{id:e,markdown:t.markdown,title:t.title}}),[n]),[d,c]=(0,o.useState)(""),[u,h]=(0,o.useState)(null==(t=l[0])?void 0:t.id),f=(0,o.useMemo)(()=>{let e=d.trim().toLowerCase();return e?l.filter(t=>"".concat(t.title," ").concat(t.markdown).toLowerCase().includes(e)):l},[d,l]);return(0,o.useEffect)(()=>{h(e=>{var t;return f.some(t=>t.id===e)?e:null==(t=f[0])?void 0:t.id})},[f]),(0,i.jsx)("section",{"aria-label":"Page builder help panel",children:(0,i.jsxs)(s.so,{flexDirection:"column",gap:"spacingM",padding:"spacingS",children:[(0,i.jsxs)(s.so,{flexDirection:"column",gap:"spacingXs",padding:"spacingS",style:{background:"linear-gradient(135deg, #f8fbff 0%, #eef4ff 100%)",border:"1px solid #dfe7f6",borderRadius:"12px"},children:[(0,i.jsx)(r.w,{children:a}),(0,i.jsx)(r.fz,{marginBottom:"none",children:"Build faster with guided steps. Search a topic, jump to a section, and keep editing without losing context."}),(0,i.jsxs)(r.fz,{marginBottom:"none",children:["Showing ",f.length," of ",l.length," sections"]})]}),(0,i.jsxs)(s.so,{flexDirection:"column",gap:"spacingS",padding:"spacingS",style:{border:"1px solid #dfe7f6",borderRadius:"12px"},children:[(0,i.jsx)(r.R2,{as:"h3",children:"Find guidance"}),(0,i.jsx)(p.ks,{"aria-label":"Search help sections",onChange:e=>c(e.target.value),placeholder:"Search by topic, for example path, localization, publish",value:d})]}),(0,i.jsxs)(s.so,{flexDirection:"column",gap:"spacingS",padding:"spacingS",style:{border:"1px solid #dfe7f6",borderRadius:"12px"},children:[(0,i.jsx)(r.R2,{as:"h3",children:"Quick jump"}),(0,i.jsxs)(s.so,{flexDirection:"row",gap:"spacing2Xs",style:{flexWrap:"wrap"},children:[f.map(e=>(0,i.jsx)(J.$n,{onClick:()=>h(e.id),variant:u===e.id?"primary":"secondary",children:e.title},e.id)),!!d&&(0,i.jsx)(J.$n,{onClick:()=>c(""),variant:"transparent",children:"Clear search"})]})]}),(0,i.jsx)(s.so,{flexDirection:"column",gap:"spacingS",padding:"spacingS",style:{border:"1px solid #dfe7f6",borderRadius:"12px"},children:(0,i.jsx)(V.nD,{children:f.map(e=>(0,i.jsx)(V.nD.Item,{isExpanded:u===e.id,onCollapse:()=>h(void 0),onExpand:()=>h(e.id),title:(0,i.jsx)(r.R2,{as:"h3",children:e.title}),children:(0,i.jsx)(s.so,{flexDirection:"column",gap:"spacingS",paddingBottom:"spacingXs",paddingTop:"spacingXs",style:{borderLeft:"2px s
1olid #c8d4ee",paddingLeft:"12px"},children:(0,i.jsx)(Y.rp,{children:e.markdown})})},e.id))})}),0===f.length&&(0,i.jsxs)(s.so,{alignItems:"center",flexDirection:"column",gap:"spacingXs",padding:"spacingM",style:{border:"1px dashed #c7d3eb",borderRadius:"10px"},children:[(0,i.jsx)(r.R2,{as:"h3",children:"No matching sections"}),(0,i.jsx)(r.fz,{marginBottom:"none",children:"Try a different keyword or clear search."}),(0,i.jsx)(J.$n,{onClick:()=>c(""),variant:"secondary",children:"Reset search"})]})]})})},X=function(){let{sectionIds:e=U,title:t="Page builder help"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{icon:(0,i.jsx)(K.A,{"aria-hidden":"true",size:18}),label:"Help",mobilePanelHeight:"toggle",name:"help",render:()=>(0,i.jsx)(q,{sectionIds:e,title:t})}},$=async(e,t)=>{var n,i;if(e){if("asset"in e.fields)return null!=(n=await T(e,t))?n:void 0;if("image"in e.fields)return null!=(i=await E(e,t))?i:void 0}},Q=new Set(Object.entries(A.u.components).flatMap(e=>{var t;let[n,i]=e;return Object.entries(null!=(t=i.fields)?t:{}).filter(e=>{let[,t]=e;return(null==t?void 0:t.type)==="richtext"}).map(e=>{let[t]=e;return"".concat(n,".").concat(t)})}));function Z(e){let t=new Map;return(0,h.Ir)(e,A.u,e=>{for(let n of e){let e=n.props.id;if("string"==typeof e){for(let[i,a]of Object.entries(n.props))if(i.endsWith("_intl")&&"string"==typeof a&&t.set("".concat(e,"_").concat(i),{type:Q.has("".concat(n.type,".").concat(i))?"richtext":"text",value:a}),Array.isArray(a))for(let r=0;r<a.length;r++){let s=a[r];if(s&&"object"==typeof s)for(let[a,l]of Object.entries(s))a.endsWith("_intl")&&"string"==typeof l&&t.set("".concat(e,"_").concat(i,"_").concat(r,"_").concat(a),{type:Q.has("".concat(n.type,".").concat(a))?"richtext":"text",value:l})}}}}),t}let ee=(0,h.RC)(),et=()=>{let e=ee(e=>e.history.back),t=ee(e=>e.history.forward),n=ee(e=>e.history.hasPast),a=ee(e=>e.history.hasFuture),r=W("undoRedo");return(0,i.jsxs)(s.so,{justifyContent:"center",style:{position:"absolute",zIndex:"9999",width:"var(--puck-side-nav-width)"},children:[(0,i.jsx)(h.K0,{disabled:!n,onClick:e,title:r.message,type:"button",children:(0,i.jsx)(g.A,{size:21})}),(0,i.jsx)(h.K0,{disabled:!a,onClick:t,title:r.message,type:"button",children:(0,i.jsx)(m.A,{size:21})})]})},en=e=>{let{document:t,children:n}=e;return(0,o.useEffect)(()=>{t&&t.body.setAttribute("style","--puck-font-family: Arial;")},[t]),(0,i.jsx)(o.Fragment,{children:n},"iframe-override")},ei=e=>{let t=(0,l.useSDK)();return[(0,o.useCallback)(()=>t.entry.fields[e].getValue(),[t,e]),(0,o.useCallback)(n=>{t.entry.fields[e].setValue(n).catch(console.error)},[e,t.entry.fields])]},ea=e=>{let[t]=ei("assets"),n=ee(e=>e.appState.data),[a,r]=(0,o.useState)(new Map),s=(0,l.useSDK)(),d=(0,o.useMemo)(()=>{var e;return(0,f.createClient)({apiAdapter:s.cmaAdapter},{type:"plain",defaults:{environmentId:null!=(e=s.ids.environmentAlias)?e:s.ids.environment,spaceId:s.ids.space,releaseId:s.ids.release}})},[s.cmaAdapter,s.ids.environmentAlias,s.ids.environment,s.ids.space,s.ids.release]);return(0,o.useEffect)(()=>{(async()=>{var e,n;return new Map((await Promise.all(null!=(n=null==(e=t())?void 0:e.map(async e=>{let t=await S(e.sys.id,d),n=await $(t,d);if(n)return[e.sys.id,n]}))?n:[])).filter(Boolean))})().then(e=>{r(e)}).catch(e=>{console.error("root",e)})},[n,d,t]),(0,i.jsx)(y.F,{...e,value:a})};var er=n(92400),es=n(38620);let el=e=>{let{hintId:t}=e,n=W(t);return(0,i.jsx)("span",{children:n.message})},eo={[a.locations.LOCATION_APP_CONFIG]:()=>{let e=(0,l.useSDK)(),[t,n]=(0,o.useState)("");return(0,o.useEffect)(()=>{(async()=>{n(u(await e.app.getParameters())),await e.app.setReady()})()},[e]),(0,o.useEffect)(()=>e.app.onConfigure(async()=>({parameters:{appHostOverride:t},targetState:await e.app.getCurrentState()})),[t,e]),(0,i.jsxs)(p.lV,{style:{padding:"0.25rem 1.5rem 0px"},children:[(0,i.jsx)(r.DZ,{children:"Page Builder Configuration"}),(0,i.jsx)(r.fz,{children:"Set an optional host override for this app. When provided, the entry editor and sidebar locations redirect to this host while keeping the current path and query parameters."}),(0,i.jsxs)(p.MJ,{children:[(0,i.jsx)(p.MJ.Label,{htmlFor:"app-host-override",children:"App host override"}),(0,i.jsx)(p.l6,{id:"app-host-override",name:"appHostOverride",onChange:e=>{n(e.target.value)},value:t,children:d.map(e=>{let{label:t,value:n}=e;return(0,i.jsx)(p.l6.Option,{value:n,children:t},n)})}),(0,i.jsx)(p.MJ.HelpText,{children:'Select "None" to disable the override.'})]})]})},[a.locations.LOCATION_ENTRY_EDITOR]:()=>{let e=(0,l.useSDK)(),[,t]=ei("assets"),[n,a]=ei("editorOutput"),r=(e=>{let[,t]=ei("translations"),n=(0,o.useRef)(e?Z(e):new Map),i=(0,l.useSDK)(),a=(0,o.useMemo)(()=>{var e;return(0,f.createClient)({apiAdapter:i.cmaAdapter},{type:"plain",defaults:{environmentId:null!=(e=i.ids.environmentAlias)?e:i.ids.environment,spaceId:i.ids.space,releaseId:i.ids.release}})},[i.cmaAdapter,i.ids.environmentAlias,i.ids.environment,i.ids.space,i.ids.release]);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=(0,o.useRef)(void 0);return function(){for(var i=arguments.length,a=Array(i),r=0;r<i;r++)a[r]=arguments[r];return clearTimeout(n.current),new Promise((i,r)=>{n.current=setTimeout(()=>{Promise.resolve(e(...a)).then(i).catch(r)},t)})}}((0,o.useCallback)(async e=>{let i=Z(e),{changed:r,removed:s,added:l}=function(e,t){let n={added:new Map,changed:new Map,removed:new Map};for(let[i,a]of e.entries()){let e=t.get(i);e?JSON.stringify(e)!==JSON.stringify(a)&&n.changed.set(i,{newValue:a,previousValue:e}):n.added.set(i,a)}for(let[i,a]of t.entries())e.has(i)||n.removed.set(i,a);return n}(i,n.current);if(0===l.size&&0===r.size&&0===s.size){n.current=i;return}let o=new Set([...i.keys(),...n.current.keys()]),{items:d}=await a.entry.getMany({query:{content_type:k.PAGE_BUILDER_TRANSLATION,"fields.key.en[in]":[...o].join(","),limit:1e3}}),c=new Set(d.map(e=>e.sys.id)),u=(e,t)=>
1({key:{en:e},..."richtext"===t.type?{richTextValue:{en:function(e){let t=new DOMParser().parseFromString(e,"text/html"),n=[];for(let e of Array.from(t.body.childNodes)){var i;e instanceof HTMLElement?n.push(...function e(t){let n=C[t.tagName.toLowerCase()],i=function(e){let t=e.style.textAlign;return t&&"left"!==t&&"start"!==t?{align:t}:{}}(t);if(!n)return[_(L.nA.PARAGRAPH,H(P(t,[])),i)];if(n===L.nA.HR)return[_(L.nA.HR,[])];if(n===L.nA.LIST_ITEM)return[function(t){let n=Array.from(t.childNodes);if(n.some(e=>e instanceof HTMLElement&&C[e.tagName.toLowerCase()])){let t=[];for(let a of n){var i;if(a instanceof HTMLElement)if(C[a.tagName.toLowerCase()])t.push(...e(a));else{let e=P(a,[]);e.length>0&&t.push(_(L.nA.PARAGRAPH,e))}else 3===a.nodeType&&(null==(i=a.textContent)?void 0:i.trim())&&t.push(_(L.nA.PARAGRAPH,[D(a.textContent,[])]))}return _(L.nA.LIST_ITEM,t)}return _(L.nA.LIST_ITEM,[_(L.nA.PARAGRAPH,H(P(t,[])))])}(t)];if(n===L.nA.UL_LIST||n===L.nA.OL_LIST){let i=[];for(let n of Array.from(t.children))n instanceof HTMLElement&&i.push(...e(n));return[_(n,i)]}if(n===L.nA.TABLE){let n=[];for(let i of Array.from(t.children)){if(!(i instanceof HTMLElement))continue;let t=i.tagName.toLowerCase();if("tbody"===t||"thead"===t||"tfoot"===t){for(let t of Array.from(i.children))t instanceof HTMLElement&&n.push(...e(t));continue}n.push(...e(i))}return[_(L.nA.TABLE,n)]}if(n===L.nA.TABLE_ROW){let n=[];for(let i of Array.from(t.children))i instanceof HTMLElement&&n.push(...e(i));return[_(L.nA.TABLE_ROW,n)]}if(n===L.nA.TABLE_CELL||n===L.nA.TABLE_HEADER_CELL){let i=[];for(let n of Array.from(t.childNodes)){var a;if(n instanceof HTMLElement)if(C[n.tagName.toLowerCase()])i.push(...e(n));else{let e=P(n,[]);e.length>0&&i.push(_(L.nA.PARAGRAPH,e))}else 3===n.nodeType&&(null==(a=n.textContent)?void 0:a.trim())&&i.push(_(L.nA.PARAGRAPH,[D(n.textContent,[])]))}return 0===i.length&&i.push(_(L.nA.PARAGRAPH,[D("",[])])),[_(n,i)]}return[_(n,H(P(t,[])),i)]}(e)):3===e.nodeType&&(null==(i=e.textContent)?void 0:i.trim())&&n.push(_(L.nA.PARAGRAPH,[D(e.textContent,[])]))}return 0===n.length&&n.push(_(L.nA.PARAGRAPH,[D("",[])])),{content:n.filter(N),data:{},nodeType:L.nA.DOCUMENT}}(t.value)}}:{textValue:{en:t.value}}});for(let[e,t]of l){let n=await a.entry.create({contentTypeId:k.PAGE_BUILDER_TRANSLATION},{fields:u(e,t)});c.add(n.sys.id)}for(let[e,{newValue:t}]of r){let n=d.find(t=>{var n;return(null==(n=t.fields.key)?void 0:n.en)===e});n&&await a.entry.update({entryId:n.sys.id},{...n,fields:{...n.fields,...u(e,t)}})}for(let[e]of s){let t=d.find(t=>{var n;return(null==(n=t.fields.key)?void 0:n.en)===e});t&&(c.delete(t.sys.id),t.sys.publishedVersion&&await a.entry.unpublish({entryId:t.sys.id}),await a.entry.delete({entryId:t.sys.id}))}t([...c].map(e=>({sys:{type:"Link",linkType:"Entry",id:e}}))),n.current=i},[a,t]),1500)})(n()),s=n();return(0,i.jsx)("div",{style:{height:"100vh","--puck-font-family":"Arial"},children:(0,i.jsx)(h.Ci,{config:A.u,data:s?(0,R.Qw)(s):{},iframe:{waitForStyles:!1},onChange:i=>{let s=(0,R.L2)(i);JSON.stringify(n())!==JSON.stringify(s)&&Promise.allSettled([a(s),t((0,x.Z)(s).map(e=>({sys:{type:"Link",linkType:"Entry",id:e}}))),r(s)]).then(t=>{let n=[];for(let e of t)"rejected"===e.status&&n.push(e.reason);0!==n.length&&(console.error("Failed to sync some Page Builder updates.",n),e.notifier.error("Some Page Builder changes could not be synced. Check linked translations and retry publish."))}).catch(console.error)},overrides:{header:()=>(0,i.jsx)(et,{}),iframe:en,outline:e=>{let{children:t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(B,{}),t]})}},plugins:[(0,h.VD)({desktopSideBar:"left"}),X()],ui:{plugin:{current:"fields"}},viewports:[{width:v.l.sm.preview,height:"auto",icon:"Smartphone",label:"Smartphone"},{width:v.l.md.preview,height:"auto",icon:"Tablet",label:"Tablet"},{width:v.l.xl.preview,height:"auto",icon:"Monitor",label:"Desktop"},{width:"100%",height:"auto",icon:"FullWidth",label:"Full-width"}],children:(0,i.jsx)(ea,{children:(0,i.jsx)(h.Ci.Layout,{})})})})},[a.locations.LOCATION_ENTRY_SIDEBAR]:()=>{var e;let t=(0,l.useSDK)(),[n,a]=(0,l.useFieldValue)("path"),[r,d]=(0,l.useFieldValue)("meta"),[c]=(0,l.useFieldValue)("translations"),[u,h]=(0,o.useState)(),[f,g]=(0,o.useState)(!1),[m,y]=(0,o.useState)(!1);(0,l.useAutoResizer)();let v=async()=>{let e=await t.dialogs.selectSingleEntry({contentTypes:["meta"]});(null==e?void 0:e.sys.id)&&d({sys:{type:"Link",linkType:"Entry",id:e.sys.id}})},A=async e=>{(await t.cma.entry.get({entryId:e})).sys.publishedVersion&&await t.cma.entry.unpublish({entryId:e}),await t.cma.entry.delete({entryId:e})},x=async()=>{y(!0);let e=[];for(let t of[...(null!=c?c:[]).map(e=>e.sys.id),...(null==r?void 0:r.sys.id)?[r.sys.id]:[]])try{await A(t)}catch(n){e.push(t)}try{await A(t.entry.getSys().id)}catch(n){e.push(t.entry.getSys().id)}e.length>0?(t.notifier.error("Failed to delete ".concat(e.length," entry(s). They may require manual cleanup.")),y(!1),g(!1)):(t.notifier.success("Entry and all linked entries deleted."),t.navigator.openEntriesList())};return(0,o.useEffect)(()=>{(async()=>{(null==r?void 0:r.sys.id)?h(await t.cma.entry.get({entryId:null==r?void 0:r.sys.id})):h(void 0)})()},[r,t.cma.entry]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(p.MJ,{children:[(0,i.jsx)(p.MJ.Label,{isRequired:!0,children:"Path"}),(0,i.jsx)(p.ks,{onChange:e=>{a(e.target.value)},placeholder:"e.g. /about",value:n}),(0,i.jsx)(p.MJ.HelpText,{children:(0,i.jsx)(el,{hintId:"pathSetup"})})]}),(0,i.jsxs)(p.MJ,{children:[(0,i.jsx)(p.MJ.Label,{children:"Meta"}),u?(0,i.jsx)(er.ZQ,{actions:[(0,i.jsx)(es.Dr,{onClick:()=>void d(void 0),children:"Remove"},"copy")],contentType:"Meta",description:u.fields.description.en,status:null==(e=u.sys.fieldStatus)?void 0:e["*"].en,title:u.fields.title.en}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(J.$n,{isFullWidth:!0,onClick:()=>void v(),variant:"secondary",children:"Select"}),(0,i.jsx)(p.MJ.HelpText,{children:(0,i.jsx)(el,{hintId:"metaSelection"})})]})]}),f?(0,i.jsxs)(s.so,{flexDirection:"column",gap:"spacingS",children:[(0,i.jsx)(M.L,{variant:"negative",children:"This will permanently delete this entry and all linked translation and meta entries. This action cannot be undone."}),(0,i.jsx)(J.$n,{isFullWidth:!0,isLoading:m,onClick:()=>void x(),variant:"negative",children:"Yes, delete page"}),(0,i.jsx)(J.$n,{isDisabled:m,isFullWidth:!0,onClick:()=>g(!1),variant:"secondary",children:"Cancel"})]}):(0,i.jsxs)(p.MJ,{children:[(0,i.jsx)(J.$n,{isFullWidth:!0,onClick:()=>g(!0),variant:"negative",children:"Delete Page"}),(0,i.jsx)(p.MJ.HelpText,{children:(0,i.jsx)(el,{hintId:"deletePage"})})]})]})}},ed=()=>{let e=(0,l.useSDK)(),[t,n]=(0,o.useState)(!1),s=(0,o.useMemo)(()=>{for(let[t,n]of Object.entries(eo))if(e.location.is(t))return n},[e.location]);return((0,o.useEffect)(()=>
1{if(e.location.is(a.locations.LOCATION_ENTRY_EDITOR)||e.location.is(a.locations.LOCATION_ENTRY_SIDEBAR))try{let t=new URL(window.location.href),i=new URL(u(e.parameters.installation));t.origin!==i.origin&&(t.host=i.host,t.protocol=i.protocol,n(!0),window.location.replace(t.toString()))}catch(e){}},[e]),t)?(0,i.jsx)(r.fz,{children:"Redirecting to configured app host..."}):s?(0,i.jsx)(s,{}):null};var ec=!0;let eu=()=>(0,i.jsxs)(l.SDKProvider,{children:[(0,i.jsx)(s.kH,{}),(0,i.jsx)(ed,{})]})}},e=>{e.O(0,[8515,4377,8635,8213,2703,9698,5575,4779,7196,7548,3707,7328,3996,9732,1543,3625,637,182,2320,5898,636,6593,8792],()=>e(e.s=71968)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.