PageSourceSearch

https://www.thechristmasshop.co.uk/static/editor-e450545a26a7c9e3125d.js

js thechristmasshop.co.uk collected 2026-09-26 12:01:51 UTC 654,097 bytes, 3,893 lines download raw bytes

1/*! For license information please see editor-e450545a26a7c9e3125d.js.LICENSE.txt */
2(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[6008],{85636:(e,t,n)=>{"use strict"
3n.d(t,{FN:()=>i,Mk:()=>r})
4n(12740)
5function a(e,t,n){const a={...e}
6return t.top+e.y<=n.top?a.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(a.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?a.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(a.x=n.left+n.width-t.right),a}const r=e=>{let{draggingNodeRect:t,transform:n,scrollableAncestorRects:r}=e
7const i=r[0]
8return t&&i?a(n,t,i):n},i=e=>{let{transform:t}=e
9return{...t,x:0}}},83807:(e,t,n)=>{"use strict"
10n.r(t),n.d(t,{ImageEditor:()=>I})
11var a=n(48431),r=n(84507),i=n(7134),o=n(42295)
12function s({image:e,aspectRatio:t,zoomFactor:n,offset:r,onUpdate:i,canvasRef:s,style:l}){const[c,u]=(0,a.useState)(null)
13return(0,a.useEffect)((()=>{const a=c?.getContext("2d")
14if(c&&a){const o=t??e.width/e.height
15let s=e.width,l=s/o
16l>e.height&&(l=e.height,s=l*o),c.width=s,c.height=l
17const{offset:u,maxOffset:d}=function(e,t,n,a){const r=e.canvas,i=Math.min(r.width/t.width,r.height/t.height)
18let o=t.width*i,s=t.height*i,l=1
19o<r.width&&(l=r.width/o)
20Math.abs(l-1)<1e-14&&s<r.height&&(l=r.height/s)
21o*=l*a,s*=l*a
22let c=t.width/(o/r.width),u=t.height/(s/r.height)
23const d=t.width-(c>t.width?t.width:Number(c.toPrecision(12))),p=t.height-(u>t.height?t.height:Number(u.toPrecision(12))),h=Math.min(Math.max(n[0],-d),d),g=Math.min(Math.max(n[1],-p),p)
24let f=.5*(t.width-c-h),m=.5*(t.height-u-g)
25c>t.width&&(c=t.width)
26u>t.height&&(u=t.height)
27f<0&&(f=0)
28m<0&&(m=0)
29return e.clearRect(0,0,r.width,r.height),e.drawImage(t,f,m,c,u,0,0,r.width,r.height),{offset:[h,g],maxOffset:[d,p]}}(a,e,r,n)
30i?.(u,d)}}),[e,c,t,n,r,i]),(0,a.useEffect)((()=>{s&&s(c)}),[c,s]),(0,o.jsx)("canvas",{ref:u,style:{...l,display:l?.display??"block",width:"100%",aspectRatio:t??e.width/e.height}})}n(76881)
31var l=n(91121),c=n(38169),u=n(30202),d=n(17312)
32n(39155),n(98456)
33async function p(e){const t=await fetch(e),n=await t.blob()
34return new File([n],function(e){const t=new URL(e,window.location.origin)
35let n=t.searchParams.has("remote")?t.searchParams.get("remote").split("/").pop():decodeURIComponent(t.pathname.split("/").pop())
36try{n=decodeURIComponent(n)}catch{}return n}(e),{type:t.headers.get("Content-Type")})}function h(e,t,n){return e/(1/t*(n||t))}function g(e){return parseFloat(e.toFixed(1))}const f=["fileSizeTooLarge","unsupportedMediaType","gifHasTooManyFrames","imageResolutionTooBig","unknown"]
37function m(e){const{response:t}=e
38switch(t?.status){case 413:return t?.data?.message.startsWith("Animated image has too many frames.")?"gifHasTooManyFrames":t?.data?.message.startsWith("Uploaded image resolution across all frames is too big.")?"imageResolutionTooBig":"fileSizeTooLarge"
39case 415:return"unsupportedMediaType"
40default:return e instanceof Error&&f.includes(e.message)?e.message:"unknown"}}function v(e,t,n=!0){const r=(0,a.useRef)(n);(0,a.useEffect)((()=>{r.current=n}),[n]),(0,a.useEffect)((()=>{const n=e=>{r.current&&(e.preventDefault(),t((t=>{let n=t
41return e.deltaY>0&&t>1&&(n=g(t-w)),e.deltaY<0&&t<D&&(n=g(t+w)),n})))}
42return e?.addEventListener("wheel",n,{passive:!1}),()=>{e?.removeEventListener("wheel",n)}}),[e,t])}var b,y,x,C=n(81909)
43const D=5,w=.1
44function A({t:e,referenceElement:t,disabled:n,aspectRatio:r,aspectRatioOptions:i,zoomFactor:s,onZoomFactorChange:p,onAspectRatioChange:h,onFileChange:f,onCancel:m,onSave:x}){const A=(0,a.useRef)(null),[j,B]=(0,a.useState)(!1),[k,S]=(0,a.useState)(null)
45function N(e){p(g(e))}return v(k,p,!n),(0,o.jsx)(u.A,{side:"top",sideOffset:30,virtualRef:{current:t},className:"ep-image-editor-menu-popover",open:!0,usePortal:!0,hideArrow:!0,avoidCollisions:!0,children:(0,o.jsxs)("fieldset",{"data-ep-editor":!0,className:"ep-image-editor-menu",disabled:n,children:[(0,o.jsx)("legend",{className:"visually-hidden",children:e("imageEditOptions.accessibilityLabel")}),(0,o.jsxs)("div",{className:"ep-image-editor-menu-range-input",children:[(0,o.jsx)("button",{title:e("imageZoomOutButton.tooltip"),type:"button",onClick:()=>N(s-w),disabled:1===s}),(0,o.jsxs)("label",{children:[(0,o.jsx)("span",{className:"visually-hidden",children:e("imageZoomLevelSlider.accessibilityLabel")}),(0,o.jsx)("input",{ref:S,type:"range",min:1,max:D,style:{"--min":1,"--max":D,"--val":s},step:w,value:s,onChange:e=>N(parseFloat(e.target.value))})]}),(0,o.jsx)("button",{title:e("imageZoomInButton.tooltip"),type:"button",onClick:()=>N(s+w),disabled:s===D})]}),b||(b=(0,o.jsx)("div",{className:"ep-image-editor-menu-seperator"})),(0,o.jsx)(c.S,{onUnsplashSelect:e=>f(e),onUploadClick:()=>A.current?.click(),buttonTooltip:e("changeImageButton.tooltip"),buttonAriaLabel:e("changeImageButton.accessibilityLabel"),buttonClassName:"ep-image-button-change",side:"top",imageSearchSideOffset:0,optionsPop
45overSideOffset:12}),(0,o.jsx)("input",{ref:A,type:"file",hidden:!0,accept:d.m_.join(","),onChange:e=>{const t=e.target.files?.[0]
46t&&(f(t),e.target.value="")}}),(0,o.jsx)(u.A,{side:"top",sideOffset:12,onOpenChange:B,avoidCollisions:!0,trigger:(0,o.jsx)("button",{title:e("aspectRatioButton.tooltip"),"aria-label":e("aspectRatioButton.tooltip"),type:"button",className:(0,l.A)(["ep-image-button-aspect-ratio",j&&"active"])}),children:(0,o.jsx)(E,{t:e,aspectRatio:r,aspectRatioOptions:i,onAspectRatioChange:h})}),y||(y=(0,o.jsx)("div",{className:"ep-image-editor-menu-seperator"})),(0,o.jsxs)("div",{children:[(0,o.jsx)(C.A,{type:"button",variant:"outline",onClick:m,children:e("cancelButton.label")}),(0,o.jsx)(C.A,{type:"button",onClick:x,children:e("saveButton.label")})]})]})})}function E({t:e,aspectRatio:t,aspectRatioOptions:n,onAspectRatioChange:r}){const i=Object.entries(n),s=(0,a.useId)(),l=(0,a.useRef)(null)
47return(0,a.useEffect)((()=>{l.current?.focus()}),[]),(0,o.jsxs)("fieldset",{role:"radiogroup",className:"ep-image-editor-menu-aspect-ratio",children:[(0,o.jsx)("legend",{className:"visually-hidden",children:e("aspectRatioMenu.accessibilityLabel")}),i.map((([n,a])=>(0,o.jsxs)("div",{children:[(0,o.jsx)("input",{type:"radio",name:`image-editor-${s}-aspectRatio`,id:`image-editor-${s}-aspectRatio-${n}`,value:a,checked:a===t.value&&n===t.label,onChange:e=>{r({label:n,value:parseFloat(e.target.value)})},ref:a===t.value&&n===t.label?l:null}),(0,o.jsxs)("label",{htmlFor:`image-editor-${s}-aspectRatio-${n}`,children:[x||(x=(0,o.jsx)("span",{})),n.includes(":")?n:e(`aspectRatioMenu.aspectRatioOptions.${n}.label`)]})]},n)))]})}function j({controls:e,t}){return(0,o.jsxs)("fieldset",{className:"ep-image-editor-move-controls",children:[(0,o.jsx)("legend",{className:"visually-hidden",children:t("imageMoveControls.accessibilityLabel")}),(0,o.jsx)(B,{...e.up,label:t("imageMoveControls.moveUpButton.tooltip")}),(0,o.jsx)(B,{...e.down,label:t("imageMoveControls.moveDownButton.tooltip")}),(0,o.jsx)(B,{...e.left,label:t("imageMoveControls.moveLeftButton.tooltip")}),(0,o.jsx)(B,{...e.right,label:t("imageMoveControls.moveRightButton.tooltip")})]})}function B({direction:e,disabled:t,onClick:n,label:a}){return(0,o.jsx)("div",{className:"ep-image-editor-move-control","data-direction":e,children:(0,o.jsx)("button",{type:"button",disabled:t,onClick:n,"aria-label":a,title:a})})}var k=n(12086),S=n(26172)
48function N(e){const[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),o=(0,a.useRef)(e);(0,a.useEffect)((()=>{o.current=e}),[e])
49const s=(0,a.useCallback)((async e=>{const t=await(0,S.A)(e)
50if(!t)throw new F("unsupportedMediaType")
51const a=function(e,t){const n=Object.keys(d.Px).find((e=>d.Px[e]===t)),a=e.name.lastIndexOf("."),r=e.name.substring(0,a<0?e.name.length:a)+`.${n}`
52return new File([e],r,{type:t})}(e,t)
53if(a.size>2e7)throw new F("fileSizeTooLarge")
54const r=await new Promise(((e,t)=>{const n=new FileReader
55n.onload=()=>{const a=new Image
56a.src=n.result,a.onload=()=>e(a),a.onerror=()=>t(new F("unknown"))},n.readAsDataURL(a)}))
57if(r.width*r.height>5e7)throw new F("imageResolutionTooBig")
58n(r),i(a),o.current?.(r,a)}),[])
59return[t,r,s]}class F extends Error{constructor(e){super(e),this.name="ImageNotSupported"}}var O,M=n(557),P=n(75655)
60function T({src:e,previewSrc:t,aspectRatioMap:n,edit:l,initial:c,onInit:u,onChange:d,onStateChange:g,onCancel:f},b){const[y,x]=(0,a.useTransition)(),[C,D]=(0,a.useState)(!1),[w,E]=(0,a.useState)(null),[B,S]=(0,a.useState)(null),[F,T]=(0,a.useState)(null),I=(0,a.useRef)(!1),R=(0,a.useRef)(null),L=I.current&&!y,_=(0,M.WD)("interface","components.imageEditorComponent"),$=(0,r.wA)(),[z,W]=(0,a.useState)(l.zoom),[U,V]=(0,a.useState)(l.aspectRatio),[H,K]=(0,a.useState)([0,0]),[q,G,Y,J,X]=function(e,t,n,r=!0){const i=(0,a.useRef)(r);(0,a.useEffect)((()=>{i.current=r}),[r])
61const[o,s]=(0,a.useState)(t),[l,c]=(0,a.useState)(!1),u=(0,a.useRef)(t);(0,a.useEffect)((()=>{u.current=o}),[o]),(0,a.useEffect)((()=>{let t,n,a,r,o=!1
62const l=e=>{o=!0,t=e.offsetX,n=e.offsetY,a=u.current[0],r=u.current[1],c(!0)},d=l=>{if(i.current&&e&&o){const i=h(l.offsetX-t,e.width,e.clientWidth),o=h(l.offsetY-n,e.height,e.clientHeight)
63s([a+i,r+o])}},p=()=>{o=!1,c(!1)},g=()=>{o=!1,c(!1)}
64return e&&(e.addEventListener("mousedown",l),e.addEventListener("mousemove",d),e.addEventListener("mouseup",p),e.addEventListener("mouseleave",g)),()=>{e&&(e.removeEventListener("mousedown",l),e.removeEventListener("mousemove",d),e.removeEventListener("mouseup",p),e.removeEventListener("mouseleave",g))}}),[e])
65const d={up:{direction:"up",disabled:!r||l||o[1]===-n[1],onClick:()=>s([o[0],o[1]-h(10,e.height,e.clientHeight)])},down:{direction:"down",disabled:!r||l||o[1]===n[1],onClick:()=>s([o[0],o[1]+h(10,e.height,e.clientHeight)])},left:{direction:"left",disabled:!r||l||o[0]===-n[0],onClick:()=>s([o[0]-h(10,e.width,e.clientWidth),o[1]])},right:{direction:"right",disabled:!r||l||o[0]===n[0],onClick:()=>s([o[0]+h(10,e.width,e.clientWidth),o[1]])}},p=r&&(o[0]!==n[0]||o[0]!==-n[0]||o[1]!==n[1]||o[1]!==-n[1])
66return[o,s,d,p,l]}(w,l.offset,H,L)
67v(B,W,L)
68const Q=z!==l.zoom||U.label!==l.aspectRatio.label||q[0]!==l.offset[0]||q[1]!==l.offset[1];(0,a.useEffect)((()=>{Q&&(D(!0),g?.({aspectRatio:U,offset:q,zoom:z}))}),[Q,U,q,z,g])
69const Z="original"===U.label&&1===z&&0===q[0]&&0===q[1],[ee,te]=(0,a.useState)(null),[ne,ae]=ee?.split(":")??[];(0,a.useEffect)((()=>{te(null)}),[U,q,z])
70const re=(0,P.A)("IMAGE_FORMATS"),ie="unsupportedMediaType"===ae,[oe,se]=function(){const[e,t]=(0,a.useState)(!1),[n,r]=(0,a.useState)()
71return(0,a.useEffect)((()=>
71{if(n){const e=setTimeout((()=>{t(!0)}),500)
72return n.finally((()=>{clearTimeout(e),t(!1)})),()=>clearTimeout(e)}}),[n]),[e,r]}(),[le,ce]=(0,a.useState)(!1),ue=(0,a.useCallback)(((e,t)=>{V((n=>{const a="image/gif"===t.type&&(c||le)
73return"original"===n.label||a?{label:"original",value:e.width/e.height}:n}))}),[c,le]),[de,pe,he]=N(ue);(0,a.useEffect)((()=>{const t=p(e).then(he).catch((()=>{$((0,k.Dsh)("error","generic")),f()}))
74se(t),x((async()=>{await t}))}),[e,he,se])
75const ge=(0,a.useCallback)((e=>{ce(!0)
76const t=he(e).then((()=>{W(1),G([0,0]),D(!0)}),(e=>{ce(!1),te(`couldNotUseImage:${m(e)}`)}))
77se(t),x((async()=>{await t}))}),[he,se]);(0,a.useImperativeHandle)(b,(()=>({changeImage:e=>{I.current?ge(e):R.current=e}})),[ge])
78const[fe,me]=(0,a.useState)(!1),ve=(0,a.useCallback)(((e,t=!1)=>{if(w&&pe){const n=new Promise(((n,a)=>{(t?Promise.resolve(pe):async function(e,t){const n="image/gif"===t.type?"image/png":t.type,a="image/gif"===t.type?t.name.replace(/\.gif$/,".png"):t.name,r=await new Promise((t=>{e.toBlob((e=>t(e)),n)}))
79return new File([r],a,{type:n})}(w,pe)).then((async t=>{const a={aspectRatio:U,offset:q,zoom:z},r=le?pe:void 0
80me(!0)
81try{await e(a,t,r),ce(!1)}catch(e){te(`couldNotSaveImage:${m(e)}`)}finally{me(!1),n()}}),(e=>{te(`couldNotSaveImage:${m(e)}`),a(e)}))}))
82return se(n),x((async()=>{await n})),n}return Promise.resolve()}),[w,pe,se,le,U,q,z])
83return(0,a.useEffect)((()=>{if(!I.current&&w&&pe){(async()=>{if(await ve(u,Z),I.current=!0,R.current){const e=R.current
84R.current=null,ge(e)}})()}}),[ve,u,w,pe,Z,ge]),(0,o.jsxs)(i.y,{onCancel:f,title:_("spotlightDialog.accessibilityLabel"),children:[(0,o.jsx)("span",{role:"status",className:"visually-hidden",children:_(`editorStatus.${L?"ready":fe?"saving":"loading"}.accessibilityLabel`)}),(0,o.jsxs)("div",{ref:T,className:"ep-image-editor","aria-busy":!L,"data-can-drag":J||null,"data-is-dragging":X||null,"data-is-saving":fe||null,children:[ne&&ae&&(0,o.jsxs)("div",{className:"ep-notification-danger",role:"alert",children:[_(`errorMessages.${ne}`,{reason:_(`errorMessages.reasons.${ae}`,{maxMbFileSize:20})}),ie&&(0,o.jsx)("a",{href:re,target:"_blank",className:"ep-form-row-text-external-link",rel:"noreferrer",children:_("errorMessages.helpCenterLink")})]}),(0,o.jsx)(A,{t:_,referenceElement:F,disabled:!L,aspectRatio:U,aspectRatioOptions:{...n,original:de?de.width/de.height:void 0},zoomFactor:z,onZoomFactorChange:W,onAspectRatioChange:V,onFileChange:ge,onCancel:f,onSave:()=>{C?ve(d,Z):f()}}),(0,o.jsxs)("div",{ref:S,className:"ep-image-editor-canvas-container",style:{aspectRatio:U.value,clipPath:"circle"===U.label?"circle(50% at center)":""},children:[(0,o.jsx)(j,{controls:Y,t:_}),de&&(0,o.jsx)(s,{style:{display:Z?"none":void 0},canvasRef:E,image:de,aspectRatio:U.value,zoomFactor:z,offset:q,onUpdate:(e,t)=>{q[0]===e[0]&&q[1]===e[1]||G(e),H[0]===t[0]&&H[1]===t[1]||K(t)}}),de&&Z&&(0,o.jsx)("img",{src:de.src,style:{width:"100%"},alt:""}),oe&&(O||(O=(0,o.jsx)("span",{className:"ep-image-editor-loading-spinner"}))),!de&&t&&(0,o.jsx)("img",{className:"ep-image-editor-loading-preview-image",src:t,alt:""})]})]})]})}T.displayName="ImageEditor"
85const I=(0,a.forwardRef)(T)},11469:(e,t,n)=>{"use strict"
86n.d(t,{A:()=>ve,B:()=>me})
87n(7121),n(39155),n(16120),n(98357),n(98456),n(76672),n(76881),n(61529),n(79826)
88var a,r=n(12259),i=n(48431),o=n(32174),s=n(84507),l=n(14953),c=n.n(l),u=n(91121),d=n(85263),p=n(12086),h=n(557),g=n(81909),f=n(81715),m=n(9926),v=n(51769),b=n(42295)
89function y(){const e=(0,h.WD)("interface","components.bottomBar.footerSettings.copyright"),t=(0,s.d4)((e=>e.getIn(["shop","userSettings","copyright","active"]))),n=(0,s.d4)((e=>e.getIn(["shop","userSettings","copyright","text"])))
90return(0,b.jsxs)("div",{className:"dali-settingslayer-element ep-settingslayer-footer-settings-copyright",children:[(0,b.jsx)("div",{className:"ep-form-row",children:e("description")}),(0,b.jsxs)("div",{className:"ep-form-row",children:[(0,b.jsx)(r.FormValueScope,{name:"copyright",children:(0,b.jsx)(v.A,{name:"active",className:"ep-form-row-no-margin",label:e("label"),info:e("tooltip"),tagName:"label",labelAfterComponent:!0,children:a||(a=(0,b.jsx)(m.A,{name:"active"}))})}),(0,b.jsx)("input",{name:"text",type:"text",className:"ep-form-text-field",value:n,readOnly:!0,disabled:!t})]})]})}y.defaultValue={copyright:c().fromJS({active:!1})}
91var x,C,D=n(51546),w=n(75655)
92const A=["row","column"]
93function E(){const e=(0,w.A)("FOOTER_LAYOUT"),t=(0,h.WD)("interface","components.bottomBar.footerSettings.layout")
94return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"dali-settingslayer
94-element small",children:(0,h.fN)(t)("description",{link:(0,b.jsx)("a",{className:(0,u.A)(["ep-form-row-text-external-link"]),href:e,target:"_blank",rel:"noopener noreferrer",children:t("linkText")})})}),(0,b.jsx)("div",{className:"dali-settingslayer-element",children:(0,b.jsx)(r.FormValueScope,{name:"footerLayout",children:(0,b.jsx)(D.A,{name:"variant",children:(e,n)=>A.map((a=>(0,b.jsxs)("div",{className:"ep-form-row",children:[(0,b.jsx)(v.A,{name:"layoutType",className:"ep-footer-layout-settings-form",label:t(`layoutTypes.${a}s.label`),info:t(`layoutTypes.${a}s.tooltip`),tagName:"label",labelAfterComponent:!0,children:(0,b.jsx)("input",{type:"radio",name:"layoutType",value:a,checked:e===a,onChange:()=>{n(a)}})}),(0,b.jsx)("button",{type:"button",className:(0,u.A)(["ep-footer-layout-scheme",[`ep-footer-layout-scheme-${a}`]]),onClick:()=>{n(a)},children:"row"===a?x||(x=(0,b.jsxs)("div",{className:"flex",children:[(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"})]}),(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"})]}),(0,b.jsxs)("div",{className:"row row-logo",children:[(0,b.jsx)("div",{className:"logo"}),(0,b.jsx)("div",{className:"logo"}),(0,b.jsx)("div",{className:"logo"}),(0,b.jsx)("div",{className:"logo"})]})]})):C||(C=(0,b.jsxs)("div",{className:"flex",children:[(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)("div",{className:"headline"}),(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"})]}),(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)("div",{className:"headline"}),(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"}),(0,b.jsx)("div",{className:"page"})]}),(0,b.jsxs)("div",{className:"row row-logo",children:[(0,b.jsx)("div",{className:"headline"}),(0,b.jsx)("div",{className:"logo"}),(0,b.jsx)("div",{className:"logo"}),(0,b.jsx)("div",{className:"logo"}),(0,b.jsx)("div",{className:"logo"})]})]}))})]},a)))})})})]})}E.defaultValue={footerLayout:c().fromJS({variant:"row"})}
95var j=n(30202),B=n(64948),k=n(38868)
96function S({fieldsetRef:e}){const t=(0,h.WD)("interface","components.bottomBar.footerSettings.sections.popovers.contactSelection")
97return(0,b.jsx)(r.FormValueScope,{name:"contact",children:(0,b.jsxs)("fieldset",{ref:e,children:[(0,b.jsx)("legend",{children:t("title")}),(0,b.jsxs)("div",{className:"ep-footer-sections-settings-popover-column ep-footer-sections-settings-popover-contact",children:[(0,b.jsx)(r.SelectableInputField,{type:"tel",name:"phone",title:t("contact.phoneInputField.tooltip"),"aria-label":t("contact.phoneInputField.ariaLabel"),label:t("contact.phoneInputField.checkBoxAccessibilityLabel")}),(0,b.jsx)(r.SelectableInputField,{type:"email",name:"email","data-testid":"contact-popover-email-field",title:t("contact.emailInputField.tooltip"),"aria-label":t("contact.emailInputField.ariaLabel"),label:t("contact.emailInputField.checkBoxAccessibilityLabel")}),(0,b.jsx)(r.SelectableInputField,{name:"address",title:t("contact.addressInputField.tooltip"),"aria-label":t("contact.addressInputField.ariaLabel"),label:t("contact.addressInputField.checkBoxAccessibilityLabel")})]})]})})}
97S.defaultValue=c().fromJS({phone:"",phoneSelected:!1,email:"",emailSelected:!1,address:"",addressSelected:!1})
98var N=n(11318),F=n(64580),O=n(85636),M=n(12740)
99function P({index:e,name:t,id:n}){var a
100const{attributes:r,listeners:i,setNodeRef:o,transform:l,transition:c}=(0,F.gl)({id:n}),u={transform:M.Ks.Transform.toString(l?{...l,scaleX:1,scaleY:1}:null),transition:c},d=(0,s.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),p=(0,h.WD)("shop"),g=(0,h.WD)("interface","components.bottomBar.footerSettings.sections.popovers.pageSelection")
101return(0,b.jsx)(D.A,{name:t,children:(t,s)=>{const l=function(e){return e.set("title",d?p(e.get("title")):e.get("title"))}(t.get(e))
102return(0,b.jsxs)("div",{id:n,ref:o,style:u,...r,...i,className:"ep-footer-sections-settings-popover-item ep-footer-sections-settings-popover-pages-item",children:[a||(a=(0,b.jsx)(k.b4,{id:n})),(0,b.jsx)("input",{onKeyDown:e=>e.stopPropagation(),type:"checkbox",checked:l.get("isVisible"),title:l.get("isVisible")?g("hideItemButton.tooltip"):g("showItemButton.tooltip"),onChange:function(){s(t.set(e,l.update("isVisible",(e=>!e)).set("isPreview",!0)))},"data-testid":`toggle-${l.get("id")}`}),(0,b.jsx)("span",{className:"ep-footer-sections-settings-text",children:l.get("title")})]})}})}function T({draggableRef:e}){var t
103const n=(0,h.WD)("interface","components.bottomBar.footerSettings.sections.popovers.pageSelection"),a=(0,i.useContext)(r.BaseField.contextType)?.instance?.getValue("footerPages")?.toJS(),o=(0,k.Ww)(n,(e=>a.find((({id:t})=>t===e))?.title||"")),s=(0,k.T)()
104return(0,b.jsx)(D.A,{name:"footerPages",children:(a,r)=>(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:n("title")}),(0,b.jsx)("scroll-shadow",{children:(0,b.jsx)("div",{className:"ep-footer-sections-settings-popover-column",children:(0,b.jsx)(N.Mp,{accessibility:o,sensors:s,modifiers:[O.Mk,O.FN],onDragEnd:function({active:e,over:t}){if(!t||t.id===e.id)return
105const n=a.findIndex((t=>t.get("id")===e.id)),i=a.findIndex((e=>e.get("id")===t.id))
106r(a.remove(n).splice(i,0,a.get(n)))},children:(0,b.jsxs)(F.gB,{items:a.map((e=>e.get("id"))).toArray(),strategy:F._G,children:[t||(t=(0,b.jsx)(k.or,{draggableRef:e})),a.map(((e,t)=>(0,b.jsx)(P,{id:e.get("id"),index:t,name:"footerPages"},e.get("id")))).toArray()]})})})})]})})}function I({draggableRef:e}){var t
107const n=(0,h.WD)("interface","components.bottomBar.footerSettings.sections.popovers.pageSelection"),a=(0,s.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),o=(0,h.WD)("shop"),l=(0,i.useContext)(r.BaseField.contextType)?.instance?.getValue("legalPages")?.toJS(),c=(0,k.Ww)(n,(e=>{return t=l.find((({id:t})=>t===e))?.title||"",a?o(t):t
108var t})),u=(0,k.T)()
109return(0,b.jsx)(D.A,{name:"legalPages",children:(a,r)=>(0,b.jsx)(N.Mp,{accessibility:c,sensors:u,modifiers:[O.Mk,O.FN],onDragEnd:function({active:e,over:t}){if(!t||t.id===e.id)return
110const n=a.findIndex((t=>t.get("id")===e.id)),i=a.findIndex((e=>e.get("id")===t.id))
111r(a.remove(n).splice(i,0,a.get(n)))},children:(0,b.jsxs)(F.gB,{items:a.map((e=>e.get("id"))).toArray(),strategy:F._G,children:[t||(t=(0,b.jsx)(k.or,{draggableRef:e})),(0,b.jsx)("div",{className:"ep-footer-menu",children:(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:n("title")}),(0,b.jsx)("scroll-shadow",{children:(0,b.jsx)("div",{className:"ep-footer-sections-settings-popover-column",children:a.map(((e,t)=>(0,b.jsx)(P,{id:e.get("id"),index:t,name:"legalPages"},e.get("id")))).toArray()})})]})})]})})})}T.defaultValue={},I.defaultValue={}
112var R,L,_=n(46288),$=n(17312),z=n(62929),W=n(22732)
113function U({path:e,setPath:t,onUploadSuccess:n,onError:a}){const r=(0,s.Pj)(),o=(0,i.useRef)(null),l=(0,W.u_)(r.api)
114return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{onClick:()=>o.current?.click(),className:"ep-custom-settings-item-upload-image",children:(0,b.jsx)("img",{src:e})}),(0,b.jsx)("input",{ref:o,type:"file","data-testid":"fileInput",accept:$.m_.join(","),onChange:e=>{return e.target.files?.[0]&&(i=e.target.files[0],void l(i).then((e=>{n(),t((0,W.b8)(r.getState().getIn(["shop","slug"]))(e.absoluteDownloadUrl))}),a))
115var i}}),(0,b.jsx)("input",{type:"hidden",name:"path",value:e})]})}function V({t:e,logo:t,onClick:n,onUploadSuccess:a,onError:i}){const o=!t.get("active")
116return(0,b.jsxs)("div",{className:(0,u.A)(["ep-form-row","ep-custom-sett
116ings-item",{disabled:o}]),children:[R||(R=(0,b.jsx)(m.A,{name:"active"})),(0,b.jsxs)("div",{className:"ep-custom-settings-item-upload",children:[(0,b.jsx)(D.A,{name:"path",children:(e,t)=>(0,b.jsx)(U,{path:e,setPath:t,onUploadSuccess:a,onError:i})}),(0,b.jsx)(r.InputField,{name:"title",disabled:o,required:!0}),(0,b.jsx)("button",{type:"button",className:"ep-custom-settings-item-upload-delete",onClick:n,title:e("customLogos.deleteButton.tooltip")})]})]})}function H({t:e,logo:t,index:n}){return(0,b.jsx)(r.FormValueScope,{name:n,children:(0,b.jsx)("div",{className:(0,u.A)(["ep-footer-sections-settings-popover-item",{disabled:!t.get("active")}]),children:(0,b.jsxs)("label",{children:[L||(L=(0,b.jsx)(m.A,{name:"active"})),t.get("title")||e(`paymentNames.${t.get("id")}`)]})})},n)}const K=(0,l.fromJS)({active:!0,title:"",id:"custom",path:""})
117function q({scope:e,updatePopoverPosition:t,fieldsetRef:n}){const a=(0,s.Pj)(),[o,l]=(0,i.useState)(null),c=(0,w.A)("IMAGE_FORMATS"),u=415===o?.response?.status,d=(0,i.useRef)(null),p=(0,i.useRef)(void 0),g=(0,h.WD)("interface"),f=(e,...t)=>g(`components.bottomBar.footerSettings.sections.popovers.logoSelection.${e}`,...t);(0,i.useEffect)((()=>{o&&t()}),[o,t])
118return(0,b.jsxs)(b.Fragment,{children:[o&&(0,b.jsx)("div",{className:"dali-settingslayer-element",children:(0,b.jsxs)("div",{className:"dali-notification-danger",children:[g("components.imageUploadComponent.imageField.errorMessages.messageWithoutOldImage",{reason:(0,z.k_)(o,g)}),u&&(0,b.jsx)("a",{href:c,target:"_blank",className:"ep-form-row-text-external-link",rel:"noreferrer noopener",children:g("components.imageUploadComponent.imageField.errorMessages.helpCenterLink")})]})}),(0,b.jsxs)("fieldset",{ref:n,children:[(0,b.jsx)("legend",{children:f("title")}),(0,b.jsx)("scroll-shadow",{children:(0,b.jsx)("div",{ref:e=>{p.current=e},className:"ep-footer-sections-settings-popover-column",children:(0,b.jsx)(D.A,{name:e,children:(t,n)=>{const a=t.filter((e=>!e.has("path"))),i=t.filter((e=>e.has("path")))
119return(0,b.jsx)(r.FormValueScope,{name:e,children:(0,b.jsxs)(b.Fragment,{children:[a.map(((e,n)=>(0,b.jsx)(H,{t:f,logo:e,index:t.indexOf(e)},n))).toArray(),i.map(((e,a)=>(0,b.jsx)(r.FormValueScope,{name:t.indexOf(e),children:(0,b.jsx)(V,{logo:e,t:f,onUploadSuccess:()=>o&&l(null),onClick:()=>(e=>{l(null),n(t.remove(e))})(t.indexOf(e)),onError:e=>l(e)})},a))).toArray()]})})}})})})]}),(0,b.jsx)(D.A,{name:e,children:(e,t)=>{const n=(0,W.u_)(a.api),r=r=>{n(r).then((n=>{var r
120l(null),r=(0,W.b8)(a.getState().getIn(["shop","slug"]))(n.absoluteDownloadUrl),t(e.push(K.set("path",r).set("id","custom-"+(0,_.A)()))),p.current&&(p.current.scrollTop=p.current.scrollHeight)}),(e=>l(e)))}
121return(0,b.jsxs)("div",{children:[(0,b.jsx)("button",{type:"button",className:"ep-custom-settings-add",onClick:()=>d.current?.click(),children:f("customLogos.createButton.label")}),(0,b.jsx)("input",{ref:d,type:"file","aria-label":f("logoUpload.label"),accept:$.m_.join(","),onChange:({target:e})=>e.files&&r(e.files[0]),value:""})]})}})]})}function G({updatePopoverPosition:e,fieldsetRef:t}){return(0,b.jsx)(q,{scope:"paymentLogos",updatePopoverPosition:e,fieldsetRef:t})}G.defaultValue=({shopResellerName:e,taxCountry:t})=>{const n=X[e]?.[t]||X[e]?.all||X[e]||J
122return c().fromJS(n.map((function(e){return{id:e,title:Y[e],active:!1}})))}
123const Y={directDebit:null,invoice:null,payInAdvance:null,maestro:"Maestro",visa:"Visa",paypal:"PayPal",americanExpress:"American Express",klarna:"Klarna",mastercard:"MasterCard",applePay:"Apple Pay",googlePay:"Google Pay",amazonPay:"Amazon Pay",redsys:"Redsys",giropay:"Giropay",vpay:"VPay",diners:"Diners",discover:"Discover",payNow:"PayNow (SOFORT)",bancontact:"Bancontact",ideal:"iDEAL",eps:"EPS",twint:"TWINT",postFinanceCard:"PostFinance Card",postFinanceEfinance:"PostFinance eFinance"},J=["directDebit","invoice","payInAdvance","maestro","visa","paypal","americanExpress","klarna","mastercard","applePay","googlePay","amazonPay","redsys","giropay"],X={payone:["paypal","visa","mastercard","directDebit","invoice","payInAdvance","giropay"],"s-payment":["paypal","visa","mastercard","directDebit","invoice","payInAdvance","giropay"],vrpayment:["directDebit","invoice","payInAdvance","maestro","visa","paypal","americanExpress","klarna","mastercard","amazonPay","redsys"],worldlinesix:{CH:["visa","vpay","mastercard","maestro","diners","discover","applePay","twint","americanExpress","payNow","paypal","postFinanceCard","postFinanceEfinance"],DE:["visa","vpay","mastercard","maestro","diners","discover","applePay","americanExpress","payNow","paypal"],AT:["visa","vpay","mastercard","maestro","diners","discover","applePay","americanExpress","payNow","paypal","eps"],all:["visa","vpay","mastercard","maestro","diners","discover","payNow","paypal","americanExpress"]}}
124function Q({updatePopoverPosition:e,fieldsetRef:t}){return(0,b.jsx)(q,{scope:"shippingLogos",updatePopoverPosition:e,fieldsetRef:t})}function Z(e,t=e,n="svg"){return{id:e,title:t,filename:`${(0,o.A)(e)}-logo.${n}`,active:!1}}function ee(e,t){return Z(e,t,"png")}Q.defaultValue=({shopLocale:e})=>{const[,t]=e.replace("_","-").split("-")
125return c().fromJS([...te,...ne[t]||[]])}
126const te=[Z("dhl","DHL"),Z("dpd"),ee("gls","GLS"),Z("tntExpress","TNT Express"),Z("ups","UPS")],ne={DE:[Z("hermes","Hermes"),ee("keavo")],FR:[ee("chronopost"),Z("colissimo"),ee("mondialRelay","mondial relay")],IT:[Z("posteItaliane","Poste Italiane"),ee("brtCorriereEspresso","BRT Corriere Espresso"),Z("nexive")],AT:[Z("oesterreichischePost","Österreichische Post")],CH:[Z("schweizerischePost","Die Schweizerische Post")],ES:[ee("mrw","MRW"),ee("zeleris","Zeleris"),ee("correosExpress","Correos Express"),Z("correos","Correos"),Z("envialia"),Z("seur","SEUR")],US:[ee("fedex","FedEx"),ee("usps","USPS")],CA:[ee("fedex","FedEx"),Z("canadaPost","Canada Post")],NL:[Z("postNl","PostNL")],BE:[Z("bpost")],GB:[Z("royalMail","Royal Mail")]}
127var ae,re,ie=n(71652),oe=n.n(ie)
128function se(){const e=(0,h.WD)("interface","components.bottomBar.footerSettings.sections.popovers")
129return(0,b.jsx)(r.FormValueScope,{name:"socialNetworks",children:(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:e("logoSelection.title")}),(0,b.jsx)("scroll-shadow",{children:(0,b.jsxs)("div",{className:"ep-footer-sections-settings-popover-column ep-footer-sections-settings-popover-social-media",children:[(0,b.jsx)(oe(),{name:"facebookUrl",title:e("socialMediaSelection.facebook.tooltip"),"aria-label":e("socialMediaSelection.facebook.ariaLabel"),label:e("socialMediaSelection.facebook.checkBoxAccessibilityLabel")}),(0,b.jsx)(oe(),{name:"twitterUrl",title:e("socialMediaSelection.twitter.tooltip"),"aria-label":e("socialMediaSelection.twitter.ariaLabel"),label:e("socialMediaSelection.twitter.checkBoxAccessibilityLabel")}),(0,b.jsx)(oe(),{name:"pinterestUrl",title:e("socialMediaSelection.pinterest.tooltip"),"aria-label":e("socialMediaSelection.pinterest.ariaLabel"),label:e("socialMediaSelection.pinterest.checkBoxAccessibilityLabel")}),(0,b.jsx)(oe(),{name:"instagramUrl",title:e("socialMediaSelection.instagram.tooltip"),"aria-label":e("socialMediaSelection.instagram.ariaLabel"),label:e("socialMediaSelection.instagram.checkBoxAccessibilityLabel")}),(0,b.jsx)(oe(),{name:"youtubeUrl",title:e("socialMediaSelection.youtube.tooltip"),"aria-label":e("socialMediaSelection.youtube.ariaLabel"),label:e("socialMediaSelection.youtube.checkBoxAccessibilityLabel")}),(0,b.jsx)(oe(),{name:"whatsappUrl",title:e("socialMediaSelection.whatsapp.tooltip"),"aria-label":e("socialMediaSelection.whatsapp.ariaLabel"),label:e("socialMediaSelection.whatsapp.checkBoxAccessibilityLabel")}),(0,b.jsx)(oe(),{name:"tiktokUrl",title:e("socialMediaSelection.tiktok.tooltip"),"aria-label":e("socialMediaSelection.tiktok.ariaLabel"),label:e("socialMediaSelection.tiktok.checkBoxAccessibilityLabel")}),(0,b.jsx)(oe(),{name:"linkedinUrl",title:e("socialMediaSelection.linkedin.tooltip"),"aria-label":e("socialMediaSelection.linkedin.ariaLabel"),label:e("socialMediaSelection.linkedin.checkBoxAccessibilityLabel")})]})})]})})}se.defaultValue=(0,l.fromJS)({facebookUrl:"",facebookUrlSelected:!0,twitterUrl:"",twitterUrlSelected:!0,pinterestUrl:"",pinterestUrlSelected:!0,instagramUrl:"",instagramUrlSelected:!0,youtubeUrl:"",youtubeUrlSelected:!0,whatsappUrl:"",whatsappUrlSelected:!0,tiktokUrl:"",tiktokUrlSelected:!0,linkedinUrl:"",linkedinUrlSelected:!0})
130const le={footerPages:T,legalPages:I,payments:G,shipping:Q,socialMedia:se,contact:S}
131function ce({showSocialMedia:e=!1}){const[t,n]=(0,i.useState)(null),a=(0,h.WD)("interface","components.bottomBar.footerSettings.sections"),r=(0,s.d4)((e=>e.getIn(["shop","userSettings","footerLayout","variant"]))),o=(0,s.d4)((e=>e.get("footerPages")?.size>0)),l=(0,i.useRef)(null),c=()=>{l.current?.focus({preventScroll:!0})},u=(0,i.useRef)(null)
132return(0,i.useEffect)((()=>{e&&u.current?.click()}),[e]),(0,b.jsxs)("div",{className:"ep-footer-sections-settings",ref:l,tabIndex:-1,children:[(0,b.jsx)("div",{className:"dali-settingslayer-element small",children:a(`description.${r}Layout`)}),(0,b.jsxs)("div",{className:"dali-settingslayer-element",children:["column"===r&&(0,b.jsx)("h3",{children:a("columnTitle",{number:1})}),(0,b.jsx)(de,{name:"legalPages",isActive:"legalPages"===t,onActivate:n,onFocus:c,t:a}),"column"===r&&(0,b.jsx)("h3",{children:a("columnTitle",{number:2})}),(0,b.jsx)(de,{name:"footerPages",isActive:"footerPages"===t,onActivate:n,onFocus:c,t:a,hasFooterPages:o}),"column"===r&&(0,b.jsx)("h3",{children:a("columnTitle",{number:3})}),(0,b.jsx)(de,{name:"payments",isActive:"payments"===t,onActivate:n,onFocus:c,t:a}),(0,b.jsx)(de,{name:"shipping",isActive:"shipping"===t,onActivate:n,onFocus:c,t:a}),"column"===r&&(0,b.jsx)("h3",{children:a("columnTitle",{number:4})}),(0,b.jsx)(de,{name:"socialMedia",buttonRef:u,isActive:"socialMedia"===t,onActivate:n,onFocus:c,t:a}),(0,b.jsx)(de,{name:"contact",isActive:"contact"===t,onActivate:n,onFocus:c,t:a})]}),(0,b.jsx)(ue,{t:a})]})}function ue({t:e}
132){return(0,b.jsx)("div",{className:"dali-settingslayer-element",children:(0,b.jsx)(r.FormValueScope,{name:"orderWithdrawal",children:(0,b.jsx)(v.A,{name:"active",className:"ep-form-row-no-margin",label:e("orderWithdrawal.label"),info:e("orderWithdrawal.tooltip"),tagName:"label",labelAfterComponent:!0,children:ae||(ae=(0,b.jsx)(m.A,{name:"active"}))})})})}function de({t:e,name:t,buttonRef:n,isActive:a,onActivate:r,onFocus:l,hasFooterPages:c}){const d=(0,s.d4)((e=>e.getIn(["shop","userSettings","footerLayout","variant"]))),p=(0,s.d4)((e=>e.getIn(["shop","userSettings","footerLayout","footerSections"]))),h="contact"===t?!0!==p?.getIn([t,"isVisible"]):!1===p?.getIn([t,"isVisible"]),g=!1===c?{"aria-label":e("footerPages.tooltip")}:{},f=(0,i.useRef)(null),m=(0,i.useRef)(null),v=(0,i.useRef)(null),y=(0,i.useCallback)((e=>{if(a&&!v.current?.isDragging())if(e.buttons<2&&e.target.classList.contains("ep-button-outline"))r(null)
133else{for(const t of Array.from(m.current?.elements||[]))if(!t.checkValidity())return t.scrollIntoView({behavior:"instant",block:"start"}),t.reportValidity(),e.preventDefault(),void e.stopPropagation()
134r(null),l()}}),[a,r,l]);(0,i.useEffect)((()=>{if(!a)return
135const e=e=>{const t=e.target?.closest(".ep-footer-sections-settings-popover")
136t||m.current?.contains(e.target)||y(e)}
137return document.addEventListener("click",e,{capture:!0}),()=>{document.removeEventListener("click",e,{capture:!0})}}),[y,a])
138const x=(0,b.jsxs)("div",{ref:f,...g,className:(0,u.A)(["ep-footer-sections-settings-section",{"ep-footer-sections-settings-no-footer-pages":!1===c}]),children:[(0,b.jsx)("span",{className:(0,u.A)([`ep-footer-sections-settings-icon-${(0,o.A)(t)}`,{"ep-footer-sections-settings-hide-section":h}])}),(0,b.jsx)("span",{className:(0,u.A)(["ep-footer-sections-settings-text",{"ep-footer-sections-settings-hide-section":h}]),children:e(`${t}.defaultTitle`)}),(0,b.jsx)("button",{ref:n,className:"ep-footer-sections-settings-icon-gearwheel","aria-label":e("editButton.tooltip"),title:e("editButton.tooltip"),type:"button",onClick:()=>{"footerPages"===t&&!1===c||r(t)}})]})
139return(0,b.jsxs)(b.Fragment,{children:[!1===c?(0,b.jsx)("div",{className:"ep-footer-sections-settings-tooltip",children:(0,b.jsx)(B.m,{sideOffset:10,hideIcon:!0,trigger:x,content:e("footerPages.tooltip")})}):x,(0,b.jsx)(j.A,{open:a,side:"right",sideOffset:30,className:"ep-footer-sections-settings-popover",onEscapeKeyDown:(0,k.RZ)(y),avoidCollisions:!0,keepOpenOnClick:!0,usePortal:!0,virtualRef:f,children:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(pe,{t:e,activePopover:t}),"column"===d&&(0,b.jsx)(he,{t:e,activePopover:t}),(0,i.createElement)(le[t],{draggableRef:v,fieldsetRef:m})]})})]})}function pe({t:e,activePopover:t}){return(0,b.jsx)(r.FormValueScope,{name:`footerLayout.footerSections.${t}`,children:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(v.A,{name:"isVisible",className:"ep-form-row",label:e("popovers.hideSection.label"),tagName:"label",labelAfterComponent:!0,children:(0,b.jsx)(D.A,{name:"isVisible",children:(e,t)=>(0,b.jsxs)("div",{className:"ep-flip-switch",children:[(0,b.jsx)("input",{type:"checkbox",checked:!1===e,onChange:()=>t(!(e??1)),className:"ep-flip-switch-checkbox"}),re||(re=(0,b.jsx)("span",{className:"ep-flip-switch-label"}))]})})}),(0,b.jsx)("p",{className:"ep-form-row",children:e("popovers.description")})]})})}function he({t:e,activePopover:t}){return(0,b.jsx)("div",{className:"ep-form-row ep-footer-sections-settings-popover-headline",children:(0,b.jsx)(r.FormValueScope,{name:`footerLayout.footerSections.${t}`,children:(0,b.jsx)(r.SelectableInputField,{type:"text",name:"title",label:e("popovers.sectionHeadline.title"),"aria-label":e("popovers.sectionHeadline.title")})})})}ce.defaultValue=e=>{const{userSettings:t,shopLocale:n,footerPages:a,shopResellerName:r,taxCountry:i,t:o}=e
140return{footerPages:c().List(),legalPages:c().List(),paymentLogos:G.defaultValue({shopResellerName:r,taxCountry:i}),shippingLogos:Q.defaultValue({shopLocale:n}),socialNetworks:se.defaultValue,contact:S.defaultValue,orderWithdrawal:c().fromJS({active:!1}),footerLayout:c().fromJS({footerSections:{legalPages:{isVisible:!0,title:o("sections.legalPages.defaultTitle"),titleSelected:!1},footerPages:{isVisible:a?.size,title:o("sections.footerPages.defaultTitle"),titleSelected:!1},payments:{isVisible:t?.get("payments")?.size,title:o("sections.payments.defaultTitle"),titleSelected:!1},shipping:{isVisible:t?.get("shipping")?.size,title:o("sections.shipping.defaultTitle"),titleSelected:!1},socialMedia:{isVisible:!0,title:o("sections.socialMedia.defaultTitle"),titleSelected:!1},contact:{isVisible:!1,title:o("sections.contact.defaultTitle"),titleSelected:!1}}})}}
141var ge=n(58219)
142const fe={layout:E,sections:ce,copyright:y}
143function me(e,[t,{defaultValue:n,displayName:a}]){return c().Map({[t]:"function"==typeof n?n(e):n})}function ve({active:e,onToggle:t}){const[n,a]=(0,i.useState)("string"==typeof e&&fe[e]?e:Object.keys(fe)[0]),l="socialNetworks"===e,m=(0,s.wA)(),v=(0,s.d4)((e=>e.get("footerPages"))),y=(0,s.d4)((e=>e.get("legalPages"))),x=(0,s.d4)((e=>e.getIn(["shop","locale"]))),C=(0,s.d4)((e=>e.getIn(["tax","country"]))),D=(0,s.d4)((e=>e.get("resellerName"))),w=(0,s.d4)((e=>e.getIn(["shop","userSettings"]).delete("googleAnalytics"))),A=(0,s.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),E=(0,i.useRef)(w),j=(0,i.useRef)(v),B=(0,i.useRef)(y),
143k=(0,i.useCallback)((()=>{m((0,p.qAZ)(j.current.map((e=>{const t=j.current.find((t=>t.get("id")===e.get("id")))
144return t.get("isPreview")?e:t})).toList())),m((0,p.A7U)(B.current))}),[m]);(0,i.useEffect)((()=>(e&&(E.current=w,j.current=v,B.current=y),()=>{e&&k()})),[e,k]),(0,i.useEffect)((()=>{if(v.size>j.current.size)j.current=j.current.push(v.get(-1))
145else if(v.size<j.current.size){const e=j.current.findIndex((e=>v.every((t=>t.get("id")!==e.get("id")))))
146j.current=j.current.delete(e)}}),[v]),(0,i.useEffect)((()=>{"string"==typeof e&&a(l?"sections":e)}),[e,l])
147const S=(0,h.WD)("interface","components.bottomBar.footerSettings"),N=(0,h.WD)("shop","components.bottomBar.footerSettings"),F={userSettings:w,shopLocale:x,footerPages:v,shopResellerName:D,taxCountry:C,t:N},O=Object.values(fe).reduce(((e,t)=>e.mergeDeep(me(F,["key",t]).get("key"))),c().Map()).entrySeq().map((([e,t])=>c().Map([[e,t]]))).toArray()
148async function M(e){const n=e.delete("footerPages").delete("legalPages"),a=e.get("footerPages"),r=e.get("legalPages"),i=n.updateIn(["socialNetworks"],(e=>e.map(((e,t)=>{if(t.endsWith("Url")&&e){return(0,d.$)(e)}return e}))))
149m((0,p.Hz9)(i.toJS())),await m((0,p.bR2)(a)),a.filter((e=>j.current.find((t=>t.get("id")===e.get("id"))).get("isVisible")!==e.get("isVisible"))).forEach((async e=>{await m((0,p.gi2)(e.set("oldPageSlug",e.get("slug")).set("newPageSlug",e.get("slug")).toJS()))})),m((0,p.V7p)(r)),r.filter((e=>B.current.find((t=>t.get("id")===e.get("id"))).get("isVisible")!==e.get("isVisible"))).forEach((e=>m((0,p.k5o)(e.toJS())))),n.get("socialNetworks").equals(E.current.get("socialNetworks"))||window.parent?.postMessage({type:"CHECKLIST",payload:{websiteOnly:"contentSection.socialMedia"}},A),E.current=n,j.current=a,B.current=r,t({submit:!0})}function P(){k(),t()}function T(e){const t=e.mergeDeep(...O,e)
150return O.reduce(((t,n)=>{
151// key = footerPages | paymentLogos | shippingLogos | socialNetworks | footerLayout | copyright
152const[a,r]=n.entrySeq().first()
153let i=t.get(a)
154if(c().List.isList(r)&&c().Map.isMap(r.first())&&r.first().has("id")){const t=i.filter((e=>e.has("path")))
155i=r.map((t=>{const n=e.get(a).find((e=>e.get("id")===t.get("id")&&e.get("active")!==t.get("active")))
156return t.merge(n)})).concat(t)}return t.set(a,i)}),t)}return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{className:(0,u.A)(["ep-bottom-bar-button","ep-bottom-bar-button-footer-settings",{active:e}]),title:S("title"),onClick:()=>t()}),(0,b.jsx)(ge.default,{className:(0,u.A)(["ep-settingslayer-footer-settings",`${(0,o.A)(n)}-active`]),onEscapeKeyDown:P,open:!!e,side:"top",align:"center",children:({renderLayout:e})=>(0,b.jsx)(r.Form,{name:"userSettings",value:w.set("footerPages",v).set("legalPages",y),prepare:T,onChange:e=>(requestAnimationFrame((()=>{m((0,p.HhZ)(e.delete("footerPages").delete("legalPages"))),m((0,p.qAZ)(e.get("footerPages"))),m((0,p.A7U)(e.get("legalPages")))})),null),onSubmit:M,children:e({title:S(`${n}.title`),tabs:Object.keys(fe).map((e=>({name:e,title:S(`${e}.title`),active:n===e,onClick:e=>a(e)}))),body:(0,i.createElement)(fe[n],{showSocialMedia:l}),footer:(0,b.jsxs)(f.A,{children:[(0,b.jsx)(g.A,{type:"button",variant:"outline",onClick:P,children:S("cancelButton.label")}),(0,b.jsx)(g.A,{type:"submit",children:S("applyButton.label")})]})})})})]})}},62738:(e,t,n)=>{"use strict"
157n.d(t,{_:()=>ot,A:()=>lt})
158n(39155),n(98357),n(76881)
159var a=n(12259),r=n(48431),i=n(14953),o=n.n(i),s=n(79673),l=n(74581),c=n(9366)
160const u=c.A&&new c.A
161const d=u?function(e,t){return u.set(e,t),e}:l.A
162var p=n(40147),h=n(64892)
163const g=function(e){return function(){var t=arguments
164switch(t.length){case 0:return new e
165case 1:return new e(t[0])
166case 2:return new e(t[0],t[1])
167case 3:return new e(t[0],t[1],t[2])
168case 4:return new e(t[0],t[1],t[2],t[3])
169case 5:return new e(t[0],t[1],t[2],t[3],t[4])
170case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5])
171case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=(0,p.A)(e.prototype),a=e.apply(n,t)
172return(0,h.A)(a)?a:n}}
173var f=n(25486)
174const m=function(e,t,n){var a=1&t,r=g(e)
175return function t(){return(this&&this!==f.A&&this instanceof t?r:e).apply(a?n:this,arguments)}}
176var v=n(67728),b=Math.max
177const y=function(e,t,n,a){for(var r=-1,i=e.length,o=n.length,s=-1,l=t.length,c=b(i-o,0),u=Array(l+c),d=!a;++s<l;)u[s]=t[s]
178for(;++r<o;)(d||r<i)&&(u[n[r]]=e[r])
179for(;c--;)u[s++]=e[r++]
180return u}
181var x=Math.max
182const C=function(e,t,n,a){for(var r=-1,i=e.length,o=-1,s=n.length,l=-1,c=t.length,u=x(i-s,0),d=Array(u+c),p=!a;++r<u;)d[r]=e[r]
183for(var h=r;++l<c;)d[h+l]=t[l]
184for(;++o<s;)(p||r<i)&&(d[h+n[o]]=e[r++])
185return d}
186const D=function(e,t){for(var n=e.length,a=0;n--;)e[n]===t&&++a
187return a}
188const w=function(){}
189function A(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}A.prototype=(0,p.A)(w.prototype),A.prototype.constructor=A
190const E=A
191var j=n(43343)
192const B=u?function(e){return u.get(e)}:j.A
193const k={}
194var S=Object.prototype.hasOwnProperty
195const N=function(e){for(var t=e.name+"",n=k[t],a=S.call(k,t)?n.length:0;a--;){var r=n[a],i=r.func
196if(null==i||i==e)return r.name}return t}
197function F(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}F.prototype=(0,p.A)(w.prototype),F.prototype.constructor=F
198const O=F
199var M=n(29350),P=n(92339),T=n(26898)
200const I=function(e){if(e instanceof E)return e.clone()
201var t=new O(e.__wrapped__,e.__chain__)
202return t.__actions__=(0,T.A)(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}
203var R=Object.prototype.hasOwnProperty
204function L(e){if((0,P.A)(e)&&!(0,M.A)(e)&&!(e instanceof E)){if(e instanceof O)return e
205if(R.call(e,"__wrapped__"))return I(e)}return new O(e)}L.prototype=w.prototype,L.prototype.constructor=L
206const _=L
207const $=function(e){var t=N(e),n=_[t]
208if("function"!=typeof n||!(t in E.prototype))return!1
209if(e===n)return!0
210var a=B(n)
211return!!a&&e===a[0]}
212const z=(0,n(29924).A)(d)
213var W=/\{\n\/\* \[wrapped with (.+)\] \*/,U=/,? & /
214const V=function(e){var t=e.match(W)
215return t?t[1].split(U):[]}
216var H=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/
217const K=function(e,t){var n=t.length
218if(!n)return e
219var a=n-1
220return t[a]=(n>1?"& ":"")+t[a],t=t.join(n>2?", ":" "),e.replace(H,"{\n/* [wrapped with "+t+"] */\n")}
221var q=n(52513),G=n(19376),Y=n(22460),J=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]]
222const X=function(e,t){return(0,G.A)(J,(function(n){var a="_."+n[0]
223t&n[1]&&!(0,Y.A)(e,a)&&e.push(a)})),e.sort()}
224const Q=function(e,t,n){var a=t+""
225return(0,q.A)(e,K(a,X(V(a),n)))}
226const Z=function(e,t,n,a,r,i,o,s,l,c){var u=8&t
227t|=u?32:64,4&(t&=~(u?64:32))||(t&=-4)
228var d=[e,t,r,u?i:void 0,u?o:void 0,u?void 0:i,u?void 0:o,s,l,c],p=n.apply(void 0,d)
229return $(e)&&z(p,d),p.placeholder=a,Q(p,e,t)}
230const ee=function(e){return e.placeholder}
231var te=n(57264),ne=Math.min
232const ae=function(e,t){for(var n=e.length,a=ne(t.length,n),r=(0,T.A)(e);a--;){var i=t[a]
233e[a]=(0,te.A)(i,n)?r[i]:void 0}return e}
234var re="__lodash_placeholder__"
235const ie=function(e,t){for(var n=-1,a=e.length,r=0,i=[];++n<a;){var o=e[n]
236o!==t&&o!==re||(e[n]=re,i[r++]=n)}return i}
237const oe=function e(t,n,a,r,i,o,s,l,c,u){var d=128&n,p=1&n,h=2&n,m=24&n,v=512&n,b=h?void 0:g(t)
238return function x(){for(var w=arguments.length,A=Array(w),E=w;E--;)A[E]=arguments[E]
239if(m)var j=ee(x),B=D(A,j)
240if(r&&(A=y(A,r,i,m)),o&&(A=C(A,o,s,m)),w-=B,m&&w<u){var k=ie(A,j)
241return Z(t,n,e,x.placeholder,a,A,k,l,c,u-w)}var S=p?a:this,N=h?S[t]:t
242return w=A.length,l?A=ae(A,l):v&&w>1&&A.reverse(),d&&c<w&&(A.length=c),this&&this!==f.A&&this instanceof x&&(N=b||g(N)),N.apply(S,A)}}
243const se=function(e,t,n){var a=g(e)
244return function r(){for(var i=arguments.length,o=Array(i),s=i,l=ee(r);s--;)o[s]=arguments[s]
245var c=i<3&&o[0]!==l&&o[i-1]!==l?[]:ie(o,l)
246if((i-=c.length)<n)return Z(e,t,oe,r.placeholder,void 0,o,c,void 0,void 0,n-i)
247var u=this&&this!==f.A&&this instanceof r?a:e
248return(0,v.A)(u,this,o)}}
249const le=function(e,t,n,a){var r=1&t,i=g(e)
250return function t(){for(var o=-1,s=arguments.length,l=-1,c=a.length,u=Array(c+s),d=this&&this!==f.A&&this instanceof t?i:e;++l<c;)u[l]=a[l]
251for(;s--;)u[l++]=arguments[++o]
252return(0,v.A)(d,r?n:this,u)}}
253var ce="__lodash_placeholder__",ue=128,de=Math.min
254const pe=function(e,t){var n=e[1],a=t[1],r=n|a,i=r<131,o=a==ue&&8==n||a==ue&&256==n&&e[7].length<=t[8]||384==a&&t[7].length<=t[8]&&8==n
255if(!i&&!o)return e
2561&a&&(e[2]=t[2],r|=1&n?0:4)
257var s=t[3]
258if(s){var l=e[3]
259e[3]=l?y(l,s,t[4]):s,e[4]=l?ie(e[3],ce):t[4]}return(s=t[5])&&(l=e[5],e[5]=l?C(l,s,t[6]):s,e[6]=l?ie(e[5],ce):t[6]),(s=t[7])&&(e[7]=s),a&ue&&(e[8]=null==e[8]?t[8]:de(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r,e}
260var he=n(77002),ge=Math.max
261const fe=function(e,t,n,a,r,i,o,s){var l=2&t
262if(!l&&"function"!=typeof e)throw new TypeError("Expected a function")
263var c=a?a.length:0
264if(c||(t&=-97,a=r=void 0),o=void 0===o?o:ge((0,he.A)(o),0),s=void 0===s?s:(0,he.A)(s),c-=r?r.length:0,64&t){var u=a,p=r
265a=r=void 0}var h=l?void 0:B(e),g=[e,t,n,a,r,u,p,i,o,s]
266if(h&&pe(g,h),e=g[0],t=g[1],n=g[2],a=g[3],r=g[4],!(s=g[9]=void 0===g[9]?l?0:e.length:ge(g[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?se(e,t,s):32!=t&&33!=t||r.length?oe.apply(void 0,g):le(e,t,n,a)
267else var f=m(e,t,n)
268return Q((h?d:z)(f,g),e,t)}
269var me=(0,s.A)((function(e,t){var n=ie(t,ee(me))
270return fe(e,32,void 0,t,n)}))
271me.placeholder={}
272const ve=me
273var be=n(32174),ye=n(84507),xe=n(91121),Ce=n(85263),De=n(11469),we=n(12086),Ae=n(557),Ee=n(81909),je=n(81715),Be=(n(28383),n(19956)),ke=n(44420),Se=n(65736),Ne=n(83241),Fe=n(51769),Oe=n(40212),Me=n(75655),Pe=n(42295)
274const Te=(0,a.formField)()(Be.O)
275function Ie(){const e=(0,ye.d4)((e=>e.get("defaultThemeSettings"))),t=(0,ye.d4)((e=>e.getIn(["shop","theme","name"],"").replace(".","_"))),[n]=t.split(ke.ko),a=(0,Ae.WD)("interface","components.bottomBar.headerSettings.headerAnnouncement"),r=(0,Se.L0)((e=>a(`:components.colorFieldComponent.popover.colorPresets.${e}.tooltip`)),(e=>a(`:themes:${n}.settings.${e}`))),i=(0,ye.d4)((e=>e.getIn(["shop","userSettings","headerAnnouncement","active"],!1))),o=(0,ye.d4)((e=>e.getIn(["shop","userSettings","headerUsps"]))).some((e=>e?.get("active"))),s=i&&o,l=(0,Me.A)("ANNOUNCEMENT_BAR")
276return(0,Pe.jsxs)("div",{className:"dali-settingslayer-header-announcement",children:[(0,Pe.jsx)("div",{className:"dali-settingslayer-element",children:(0,Ae.fN)(a)("description",{link:(0,Pe.jsx)("a",{className:"ep-form-row-text-external-link",href:l,target:"_blank",rel:"noopener noreferrer",children:a("helpCenterLink")})})}),s&&(0,Pe.jsx)("div",{className:"dali-settingslayer-element",children:(0,Pe.jsx)("p",{className:"ep-notification-info",children:a("infoBox.description")})}),(0,Pe.jsx)(Fe.A,{label:a("visibilitySection.title"),name:"headerAnnouncement.active",children:(0,Pe.jsx)(Oe.A,{buttons:[{label:a("visibilitySection.yesRadioButtonLabel"),value:!0},{label:a("visibilitySection.noRadioButtonLabel"),value:!1}]})}),(0,Pe.jsx)(Fe.A,{label:a("announcementInputField.label"),name:"headerAnnouncement.announcementHtml",children:(0,Pe.jsx)(Te,{toolbarButtons:["bold","link|unlink"],restrictToSingleLine:!0,maxCharacters:80})}),(0,Pe.jsx)(Fe.A,{labelAfterComponent:!0,name:"headerAnnouncement.backgroundColor",label:a("colorPicker.label"),className:"ep-color-field-item",children:(0,Pe.jsx)(Ne.default,{name:"headerAnnouncement.backgroundColor",className:"ep-color-field-box",presetColors:r.toJS(),resetValue:e.getIn(["headerAnnouncement","backgroundColor"]),side:"left",align:"end"})})]})}Ie.defaultValue={}
277n(98456)
278var Re,Le,_e,$e,ze,We,Ue,Ve=n(95110),He=n(64948),Ke=n(9926),qe=n(77472),Ge=n(51546)
279function Ye({className:e,onClick:t}){return(0,Pe.jsxs)("div",{className:e,onClick:t,"data-testid":"headerPreview",children:[Re||(Re=(0,Pe.jsx)("div",{className:"space"})),Le||(Le=(0,Pe.jsx)("div",{className:"logo"})),_e||(_e=(0,Pe.jsx)("div",{className:"burger-menu"})),$e||($e=(0,Pe.jsx)("div",{className:"menu"})),ze||(ze=(0,Pe.jsx)("div",{className:"search"})),We||(We=(0,Pe.jsx)("div",{className:"customer"})),Ue||(Ue=(0,Pe.jsx)("div",{className:"cart"}))]})}function Je(){const e=(0,Ae.WD)("interface","components.bottomBar.headerSettings.themeHeader"),t=(0,ye.d4)((e=>Boolean(e.getIn(["shop","attributes"]).find((e=>"ecommerce:disabled"===e.get("name")&&"true"===e.get("value")))))),n=(e,t)=>e.get("themeSettingsSchema").toJS().find((e=>"themeHeader"===e.name)).settings.find((e=>e.name===t)),r=(0,ye.d4)((e=>n(e,"headerType"))),i=(0,ye.d4)((e=>!0===e.getIn(["themeMeta","hasStickyHeader"]))),s=(0,ye.d4)((e=>e.getIn(["shop","themeSettings","themeHeader","stickyHeaderEnabled"],!1))),l=(0,ye.d4)((e=>n(e,"stickyHeaderBehavior"))),c=o().List(l.options.map((t=>({value:t,label:e(`stickyHeader.stickyHeaderBehaviorDropdown.options.${t}`)})))),u=`/editor/themes?themeFilter=${encodeURIComponent("headerDesign:fullWidth")}`
280return(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("div",{className:"dali-settingslayer
280-element",children:e("description")}),(0,Pe.jsxs)(a.FormValueScope,{name:"themeHeader",children:[(0,Pe.jsx)("div",{className:"dali-settingslayer-element",children:(0,Pe.jsx)(Ge.A,{name:"headerType",children:(n,a)=>r.options.map((r=>(0,Pe.jsxs)("div",{className:"ep-header-types-settings",children:[(0,Pe.jsx)(Fe.A,{name:"headerType",className:"ep-header-types-settings-form",label:e(`headerTypes.${r}.label`),tagName:"label",labelAfterComponent:!0,children:(0,Pe.jsx)("input",{type:"radio",name:"headerType",value:r,checked:n===r,onChange:e=>a(e.target.value)})}),(0,Pe.jsx)("div",{className:"ep-header-types-settings-tooltip",children:(0,Pe.jsx)(He.m,{hideIcon:!0,sideOffset:10,trigger:(0,Pe.jsx)(Ye,{className:(0,xe.A)({[`header-type-${(0,be.A)(r)}`]:!0,"hide-grid-items":t}),onClick:()=>a(r)}),content:e(`headerTypes.${r}.explanation`)})})]},r)))})}),!i&&(0,Pe.jsx)("div",{className:"dali-settingslayer-element",children:(0,Pe.jsx)("p",{className:"ep-notification-info",children:(0,Ae.fN)(e)("stickyHeader.disabledStickyHeaderInfoBox.description",{link:(0,Pe.jsx)(Ve.N_,{className:"ep-form-row-text-link",to:u,children:e("stickyHeader.disabledStickyHeaderInfoBox.themeManagerLink")})})})}),(0,Pe.jsx)("div",{className:"dali-settingslayer-element",children:(0,Pe.jsx)(Fe.A,{name:"stickyHeaderEnabled",className:(0,xe.A)({disabled:!i}),label:e("stickyHeader.enableStickyHeaderCheckbox.label"),tagName:"label",labelAfterComponent:!0,children:(0,Pe.jsx)(Ke.A,{name:"stickyHeaderEnabled",disabled:!i})})}),(0,Pe.jsx)("div",{className:"ep-sticky-header-behavior",children:(0,Pe.jsx)(Fe.A,{name:"stickyHeaderBehavior",className:(0,xe.A)({disabled:!s||!i}),label:e("stickyHeader.stickyHeaderBehaviorDropdown.label"),tagName:"label",children:(0,Pe.jsx)(Ge.A,{children:(e,t)=>(0,Pe.jsx)(qe.A,{name:"stickyHeaderBehavior",className:"ep-sticky-header-behavior-select",selectedIndex:c.findIndex((t=>t?.value===e)),options:c,onChange:e=>t(c.get(e).value),disabled:!s||!i,renderOption:e=>(0,Pe.jsx)("span",{className:"ep-custom-select-label",children:e.label})})})})})]})]})}Je.defaultValue={},Je.prepare=e=>e.set("headerType",(0,ke.TA)(e.get("headerType")))
281var Xe,Qe=n(30202),Ze=n(86148),et=n(81671),tt=n(34990)
282function nt(){const e=(0,r.useRef)([]),t=(0,ye.d4)((e=>e.get("defaultThemeSettings"))),n=(0,ye.d4)((e=>e.getIn(["shop","theme","name"],"").replace(".","_"))),[i]=n.split(ke.ko),s=(0,Ae.WD)("interface","components.bottomBar.headerSettings.headerUsps"),l=(0,Se.L0)((e=>s(`:components.colorFieldComponent.popover.colorPresets.${e}.tooltip`)),(e=>s(`:themes:${i}.settings.${e}`)))
283return(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("div",{className:"dali-settingslayer-element",children:s("description")}),(0,Pe.jsx)(a.IteratorField,{className:"dali-settingslayer-element",name:"headerUsps",children:(t,n)=>{const a=!t.get("active"),r=!t.get("link")
284return(0,Pe.jsx)("div",{className:(0,xe.A)(["ep-header-usps-settings",{disabled:a,"icon-hidden":!t.getIn(["icon","show"])}]),children:(0,Pe.jsxs)("div",{className:"ep-header-usps-settings-button",children:[(0,Pe.jsx)("span",{className:"icon-container body",children:(0,Pe.jsx)("span",{"data-testid":"header-usp-icon",className:`ep-${t.getIn(["icon","name"])}-icon`})}),(0,Pe.jsxs)(Qe.A,{anchor:(0,Pe.jsxs)("div",{className:"ep-header-usps-settings-form",children:[(0,Pe.jsx)(Ke.A,{name:"active",onInput:()=>e.current[n].focus()}),(0,Pe.jsx)(et.A,{name:"text",disabled:a,ref:t=>e.current[n]=t})]}),trigger:(0,Pe.jsx)("button",{className:"ep-header-usps-settings-button-change",type:"button",disabled:a,children:s("configureUspButton.label")}),className:"ep-icon-picker ep-header-usps-settings-icon-picker",side:"left",align:"end",sideOffset:50,alignOffset:0,usePortal:!0,avoidCollisions:!0,children:[(0,Pe.jsx)(Ge.A,{name:"icon",children:(e,t)=>(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ze.A,{icon:e.get("name"),setIcon:e=>t(o().Map({name:e,show:!0})),className:(0,xe.A)([{"icon-hidden":!e.get("show")}])}),(0,Pe.jsxs)("label",{className:"ep-usp-icon-picker-switch-button",children:[(0,Pe.jsxs)("div",{className:"ep-flip-switch",children:[(0,Pe.jsx)("input",{type:"checkbox",name:"ep-flip-switch",className:"ep-flip-switch-checkbox",id:"hide-icon",checked:!e.get("show"),onChange:n=>t(o().Map({name:e.get("name"),show:!n.target.checked}))}
284),Xe||(Xe=(0,Pe.jsx)("span",{className:"ep-flip-switch-label"}))]}),(0,Pe.jsx)("span",{children:s("configureUspPopover.hideIconSwitch.label")})]})]})}),(0,Pe.jsx)(Ge.A,{name:"link",children:(e,t)=>(0,Pe.jsx)(tt.A,{t:s,link:e,setLink:t,label:"configureUspPopover.linkInputField.label"})}),(0,Pe.jsx)(Fe.A,{className:(0,xe.A)([{disabled:r},"ep-form-row-no-margin"]),name:"openInNewTab",tagName:"label",label:s("configureUspPopover.openLinkInNewTabCheckbox.label"),labelAfterComponent:!0,children:(0,Pe.jsx)(Ke.A,{name:"openInNewTab",disabled:r})})]})]})})}}),(0,Pe.jsx)(Fe.A,{labelAfterComponent:!0,name:"headerUspBar.backgroundColor",label:s("colorPicker.label"),className:"ep-color-field-item",children:(0,Pe.jsx)(Ne.default,{name:"headerUspBar.backgroundColor",className:"ep-color-field-box",presetColors:l.toJS(),resetValue:t.getIn(["headerUspBar","backgroundColor"]),side:"left",align:"end"})})]})}function at({switchTab:e}){const t=(0,Ae.WD)("interface","components.bottomBar.headerSettings.headerMenu"),n=(0,Me.A)("MENU_TYPE"),r=(0,ye.d4)((e=>e.get("themeSettingsSchema").toJS().find((e=>"themeHeader"===e.name)).settings.find((e=>"menuType"===e.name)))),i="oneRow"===(0,ye.d4)((e=>e.getIn(["shop","themeSettings","themeHeader","headerType"])))
285return(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("div",{className:"dali-settingslayer-element small",children:(0,Ae.fN)(t)("description",{link:(0,Pe.jsx)("a",{className:"ep-form-row-text-external-link",href:n,target:"_blank",rel:"noopener noreferrer",children:t("helpCenterLink")})})}),i&&(0,Pe.jsx)("div",{className:"dali-settingslayer-element",children:(0,Pe.jsx)("p",{className:"ep-notification-info",children:(0,Ae.fN)(t)("disabledMenuInfoBox.description",{link:(0,Pe.jsx)("button",{type:"button",className:"ep-simple-notification-button",onClick:()=>e("themeHeader"),children:t("disabledMenuInfoBox.link")})})})}),(0,Pe.jsx)("div",{className:"dali-settingslayer-element",children:(0,Pe.jsx)(a.FormValueScope,{name:"themeHeader",children:(0,Pe.jsx)(Ge.A,{name:"menuType",children:(e,n)=>r.options.map((a=>(0,Pe.jsxs)("div",{className:(0,xe.A)(["ep-form-row ep-menu-type-settings",i&&"disabled"]),children:[(0,Pe.jsx)(Fe.A,{name:"menuType",className:"ep-menu-type-settings-form",label:t(`menuTypes.${a}.label`),info:t(`menuTypes.${a}.tooltip`),tagName:"label",labelAfterComponent:!0,children:(0,Pe.jsx)("input",{type:"radio",name:"menuType",value:a,disabled:i,checked:e===a,onChange:()=>n(a)})},a),(0,Pe.jsx)("div",{className:(0,xe.A)(["ep-menu-type-scheme",[`ep-menu-type-scheme-${(0,be.A)(a)}`]]),onClick:()=>{i||n(a)}})]},a)))})})})]})}nt.defaultValue=o().fromJS([{active:!1,icon:{show:!0,name:"headphones"},text:"",link:"",openInNewTab:!1},{active:!1,icon:{show:!0,name:"shipping"},text:"",link:"",openInNewTab:!1},{active:!1,icon:{show:!0,name:"change"},text:"",link:"",openInNewTab:!1},{active:!1,icon:{show:!0,name:"clock-24"},text:"",link:"",openInNewTab:!1},{active:!1,icon:{show:!0,name:"gift"},text:"",link:"",openInNewTab:!1}]),at.defaultValue={}
286var rt=n(58219)
287const it={themeHeader:Je,headerMenu:at,shopLogo:n(95756).A,headerUsps:nt,headerAnnouncement:Ie},ot=e=>Math.round((e-20)/1.8),st=e=>Math.floor(1.8*e)+20
288function lt({active:e,onToggle:t}){const[n,o]=(0,r.useState)("string"==typeof e?e:"shopLogo"),s=(0,Ae.WD)("interface"),l=(0,ye.wA)(),c=(0,ye.d4)((e=>e.getIn(["shop","themeSettings"]))),u=(0,ye.d4)((e=>e.get("defaultThemeSettings"))),d=(0,ye.d4)((e=>e.getIn(["shop","theme","id"]))),p=(0,ye.d4)((e=>e.getIn(["shop","locale"]))),h=(0,ye.d4)((e=>e.getIn(["tax","country"]))),g=(0,ye.d4)((e=>e.get("resellerName"))),f=(0,ye.d4)((e=>e.getIn(["shop","userSettings"]).delete("googleAnalytics"))),m=c?.get("logoAdjustments")||u.get("logoAdjustments"),v=(0,ye.d4)((e=>(0,i.fromJS)({shouldHideLogo:e.getIn(["shop","shouldHideLogo"])||Boolean(!e.getIn(["shop","logoUrl"])),imageData:{src:e.getIn(["shop","logoUrl"]),width:e.getIn(["shop","logoWidth"]),height:e.getIn(["shop","logoHeight"])},themeSettings:{logoAdjustments:m}}))),b=c?.get("themeHeader")||u.get("themeHeader"),y=(0,i.fromJS)({announcementHtml:f.getIn(["headerAnnouncement","announcementHtml"]),active:f.getIn(["headerAnnouncement","active"]),backgroundColor:c?.getIn(["headerAnnouncement","backgroundColor"])||u.getIn(["headerAnnouncement","backgroundColor"])}),x=(0,i.fromJS)({backgroundColor:c?.getIn(["headerUspBar","backgroundColor"])||u.getIn(["headerUspBar","backgroundColor"])}),C=(0,ye.d4)((e=>e.getIn(["view","busy"]))),D=(0,r.useRef)(v),w=(0,r.useCallback)((()=>{const e=D.current.get("imageData"),t=D.current.get("shouldHideLogo")
289l((0,we._4Y)({logoUrl:e.get("src"),logoWidth:e.get("width"),logoHeight:e.get("height"),shouldHideLogo:t}))}),[l]);(0,r.useEffect)((()=>()=>{e&&w()}),[e,w]),(0,r.useEffect)((()=>{"string"==typeof e&&o(e)}),[e])
290const A=(e,...t)=>s("components.bottomBar.headerSettings."+e,...t),E={shopLocale:p,shopResellerName:g,taxCountry:h},j=Object.entries(it).map(ve(De.B,E)).filter((e=>!e.has("headerMenu"))),B=(0,ye.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),k=async e=>{const n=e.delete("shopLogo").delete("themeHeader").deleteIn(["headerAnnouncement","backgroundColor"]).deleteIn(["headerUspBar","backgroundColor"]).updateIn(["headerUsps"],(e=>e.map((e=>{const t=e.get("link")
291return t?e.set("link",(0,Ce.$)(t)):e}))))
292await l((0,we.Hz9)(n.toJS()))
293const a=e.getIn(["shopLogo","imageData"])
294await l((0,we.wFR)({logoUrl:a.get("src"),logoWidth:a.get("width"),logoHeight:a.get("height"),shouldHideLogo:e.getIn(["shopLogo","
294shouldHideLogo"])}))
295const r=c.set("logoAdjustments",e.getIn(["shopLogo","themeSettings","logoAdjustments"])).set("themeHeader",e.get("themeHeader")).setIn(["headerAnnouncement","backgroundColor"],e.getIn(["headerAnnouncement","backgroundColor"])).setIn(["headerUspBar","backgroundColor"],e.getIn(["headerUspBar","backgroundColor"]))
296await l((0,we.Tbf)(d,r)),window.parent?.postMessage({type:"HEADER_SETTINGS",payload:{logoUrl:a.get("src"),shouldHideLogo:e.getIn(["shopLogo","shouldHideLogo"])}},B),v.equals(D.current)||window.parent?.postMessage({type:"CHECKLIST",payload:{websiteOnly:"designSettings.logoUpload",regularShop:"designSettings.logoUpload"}},B),D.current=v,t({submit:!0})},S=()=>{const e=c.set("logoAdjustments",D.current.getIn(["themeSettings","logoAdjustments"]))
297w(),l((0,we.h8q)(e)),t()},N=e=>{const t=M(e),a=t.delete("shopLogo").delete("themeHeader").deleteIn(["headerAnnouncement","backgroundColor"]).deleteIn(["headerUspBar","backgroundColor"])
298return requestAnimationFrame((()=>{if("headerUsps"===n){const t=c.setIn(["headerUspBar","backgroundColor"],e.getIn(["headerUspBar","backgroundColor"]))
299l((0,we.h8q)(t)),l((0,we.HhZ)(a))}if("headerAnnouncement"===n){const t=c.setIn(["headerAnnouncement","backgroundColor"],e.getIn(["headerAnnouncement","backgroundColor"]))
300l((0,we.h8q)(t)),l((0,we.HhZ)(a))}if("themeHeader"===n||"headerMenu"===n){const t=c.set("themeHeader",e.get("themeHeader"))
301l((0,we.h8q)(t))}if("shopLogo"===n){const e=t.getIn(["shopLogo"]).delete("themeSettings").delete("themeHeader")
302if(v.delete("themeSettings").equals(e)){const e=c.set("logoAdjustments",t.getIn(["shopLogo","themeSettings","logoAdjustments"]))
303l((0,we.h8q)(e))}else{const t=e.get("imageData")
304l((0,we._4Y)({logoUrl:t.get("src"),logoWidth:t.get("width"),logoHeight:t.get("height"),shouldHideLogo:e.get("shouldHideLogo")}))}}})),null},F=(e,t=!0)=>{const n={},a=e.getIn(["shopLogo","shouldHideLogo"])
305if(e.getIn(["shopLogo","imageData"]).get("src")||a||(n.shopLogo=n.shopLogo||{},n.shopLogo.imageData={src:A("errors.noImage")}),t)return Object.keys(n).length>0?(0,i.fromJS)(n):void 0},O=e=>e.mergeDeep(...j,e).updateIn(["shopLogo","themeSettings","logoAdjustments","sizing"],(e=>ot(e))).updateIn(["themeHeader"],Je.prepare),M=e=>e.updateIn(["shopLogo","themeSettings","logoAdjustments","sizing"],(e=>st(e))),P=f.set("shopLogo",v).set("themeHeader",b).set("headerAnnouncement",y).set("headerUspBar",x)
306return(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("button",{className:(0,xe.A)(["ep-bottom-bar-button","ep-bottom-bar-button-header-settings",{active:e}]),title:A("title"),onClick:()=>t()}),(0,Pe.jsx)(rt.default,{className:(0,xe.A)(["ep-settingslayer-header-settings",`${(0,be.A)(n)}-active`]),onEscapeKeyDown:S,open:!!e,side:"top",align:"center",children:({renderLayout:e})=>(0,Pe.jsx)(a.Form,{name:"headerSettings",value:P,prepare:O,normalize:M,onChange:N,onSubmit:k,validate:F,children:e({title:A(`${n}.title`),tabs:Object.keys(it).map((e=>({name:e,title:A(`${e}.title`),active:n===e,onClick:e=>o(e)}))),body:(0,r.createElement)(it[n],{switchTab:o}),footer:(0,Pe.jsxs)(je.A,{children:[(0,Pe.jsx)(Ee.A,{disabled:C,type:"button",variant:"outline",onClick:S,children:A("cancelButton.label")}),(0,Pe.jsx)(Ee.A,{disabled:C,type:"submit",children:A("applyButton.label")})]})})})})]})}},10531:(e,t,n)=>{"use strict"
307n.r(t),n.d(t,{LogoCropSettingsRaw:()=>w,default:()=>A})
308n(76881),n(29068)
309var a,r,i=n(48431),o=n(61085),s=n(60594),l=n.n(s),c=n(14953),u=n.n(c),d=(n(24430),n(91121)),p=n(62929),h=n(17312),g=n(81909),f=n(81715),m=n(48311),v=n(557),b=n(82348),y=n(42295)
310const x={"1:1":1,"2:3":2/3,"4:3":4/3,"16:9":16/9,"3:2":1.5},C=x["3:2"]
311function D(e){const t=Number(e.replace(",",".")),n=t?Math.round(t):e.replace(/[^0-9]/g,"")
312return Number(n)}class w extends i.Component{state={canCrop:!1,cropAspectRatio:C,cropHeight:0,cropWidth:0,errorMessage:null,isCropperReady:!1,isCropperDestroyed:!1,lockAspectRatioOnSizeInputFieldChange:!0}
313t=(e,...t)=>this.props.t(`components.imageElementComponent.cropModal.${e}`,...t)
314componentDidMount(){this.cropper=new(l())(this.cropperNode,{viewMode:1,dragMode:"move",toggleDragModeOnDblclick:!1,aspectRatio:C,responsive:!1,restore:!1,checkCrossOrigin:!1,guides:!1,autoCrop:!0,wheelZoomRatio:.1,ready:this.handleCropperReady,crop:this.handleCropperCrop}),this.htmlId=(0,o.A)("image-crop-")}componentWillUnmount(){this.cropper.destroy(),this.setState({isCropperDestroyed:!0})}setRef=e=>{this.cropperNode=e}
315handleSaveButtonClick=async()=>{const{onSave:e,data:t,config:{storeFile:n},t:a}=this.props
316this.setState({canCrop:!1,errorMessage:null}),this.cropper.disable()
317const r=function(e){const t=decodeURI(e)
318if(e.startsWith("/storage/images/image?remote="))return t.split("storage/images/image?remote=").pop().split("/").pop().replace(/\?.+/,"").split("&")[0]
319return t.split("/").pop().replace(/\?.+/,"")}(t.get("src")),i=h.Px[r.toLowerCase().split(".").pop()],o=function(e,t){const n=atob(e.split(",")[1]),a=new ArrayBuffer(n.length),r=new 
319Uint8Array(a)
320for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e)
321return new Blob([a],{type:t})}(this.cropper.getCroppedCanvas().toDataURL(i),i),s=navigator.msSaveBlob?Object.assign(o,{name:r}):new File([o],r,{type:o.type})
322try{const{absoluteDownloadUrl:a,width:r,height:i}=await n(s)
323e(t.merge(u().Map({src:a,width:r,height:i})))}catch(e){this.setState({canCrop:!0,errorMessage:a("components.imageUploadComponent.imageField.errorMessages.messageWithOldImage",{reason:(0,p.k_)(e,a)})}),this.cropper.enable()}}
324handleCancelButtonClick=()=>this.props.onCancel()
325handleZoomButtonClick=e=>()=>this.cropper.zoom(.1*e)
326handleMoveButtonClick=(e,t)=>()=>this.cropper.move(e,t)
327handleAspectRatioInputChange=e=>{const t=Number(e.target.value),{width:n,height:a}=this.cropper.setAspectRatio(t).getData(!0)
328this.setState({cropWidth:n,cropHeight:a,cropAspectRatio:t})}
329handleCropWidthInputChange=e=>{const t={width:D(e.target.value)}
330if(this.state.lockAspectRatioOnSizeInputFieldChange){const{naturalWidth:e,naturalHeight:n}=this.cropper.getImageData()
331t.height=Math.round(t.width*n/e)}this.cropper.setData(t)}
332handleCropHeightInputChange=e=>{const t={height:D(e.target.value)}
333if(this.state.lockAspectRatioOnSizeInputFieldChange){const{naturalWidth:e,naturalHeight:n}=this.cropper.getImageData()
334t.width=Math.round(t.height*e/n)}this.cropper.setData(t)}
335handleAutoAdjustSizeInputAspectRatioToggle=e=>{"click"!==e.type&&" "!==e.key||this.setState({lockAspectRatioOnSizeInputFieldChange:!this.state.lockAspectRatioOnSizeInputFieldChange})}
336handleCropperReady=()=>{this.state.isCropperDestroyed||this.setState({isCropperReady:!0,canCrop:!0})}
337handleCropperCrop=e=>{const t=Math.round(e.detail.width),n=Math.round(e.detail.height)
338this.state.cropWidth===t&&this.state.cropHeight===n||this.setState({cropWidth:t,cropHeight:n})}
339get body(){const{config:e,data:t}=this.props,{lockAspectRatioOnSizeInputFieldChange:n,cropWidth:o,cropHeight:s,cropAspectRatio:l,errorMessage:c}=this.state,u=Boolean(this.state.cropAspectRatio),p=e.imageUrl?e.imageUrl(t.get("src")):t.get("src")
340return(0,y.jsxs)(y.Fragment,{children:[c&&(0,y.jsx)("div",{className:"dali-notification-danger",children:c}),(0,y.jsxs)("div",{className:"dali-settingslayer-image-crop-container",children:[(0,y.jsx)("div",{className:"dali-settingslayer-image-crop-cropper","data-cropper-ready":this.state.isCropperReady||null,children:(0,y.jsx)("img",{ref:this.setRef,src:p,alt:t.get("alt")})}),(0,y.jsxs)("div",{className:"dali-settingslayer-image-crop-navigation",children:[(0,y.jsx)("button",{type:"button",className:"zoom-in",onClick:this.handleZoomButtonClick(1),title:this.t("zoomInButton.tooltip"),children:(0,y.jsx)("span",{children:this.t("zoomInButton.label")})}),(0,y.jsx)("button",{type:"button",className:"zoom-out",onClick:this.handleZoomButtonClick(-1),title:this.t("zoomOutButton.tooltip"),children:(0,y.jsx)("span",{children:this.t("zoomOutButton.label")})}),(0,y.jsx)("button",{type:"button",className:"move-left",onClick:this.handleMoveButtonClick(-1,0),title:this.t("moveLeftButton.tooltip"),children:(0,y.jsx)("span",{children:this.t("moveLeftButton.label")})}),(0,y.jsx)("button",{type:"button",className:"move-right",onClick:this.handleMoveButtonClick(1,0),title:this.t("moveRightButton.tooltip"),children:(0,y.jsx)("span",{children:this.t("moveRightButton.label")})}),(0,y.jsx)("button",{type:"button",className:"move-up",onClick:this.handleMoveButtonClick(0,-1),title:this.t("moveUpButton.tooltip"),children:(0,y.jsx)("span",{children:this.t("moveUpButton.label")})}),(0,y.jsx)("button",{type:"button",className:"move-down",onClick:this.handleMoveButtonClick(0,1),title:this.t("moveDownButton.tooltip"),children:(0,y.jsx)("span",{children:this.t("moveDownButton.label")})})]})]}),(0,y.jsxs)("div",{className:"dali-settingslayer-image-crop-settings",children:[Object.keys(x).map((e=>(0,y.jsxs)(i.Fragment,{children:[(0,y.jsx)("input",{type:"radio",name:`${this.htmlId}-aspectRatio`,id:`${this.htmlId}-aspectRatio-${e}`,value:x[e],checked:l===x[e],onChange:this.handleAspectRatioInputChange}),(0,y.jsx)("label",{htmlFor:`${this.htmlId}-aspectRatio-${e}`,"aria-label":this.t("aspectRatioButton.label",{aspectRatio:e}),children:a||(a=(0,y.jsx)("span",{}))})]},e))),(0,y.jsx)("input",{type:"radio",name:"aspectRatio",id:"aspectRatio-free",checked:!u,onChange:this.handleAspectRatioInputChange}),(0,y.jsx)("label",{htmlFor:"aspectRatio-free","aria-label":this.t("freeRatioButton.label"),children:r||(r=(0,y.jsx)("span",{}))}
340),(0,y.jsxs)("div",{className:(0,d.A)(["dali-settingslayer-image-crop-settings-free-ratio",{disabled:u}]),children:[(0,y.jsxs)("label",{children:[(0,y.jsx)("input",{type:"text",value:o,disabled:u,onChange:this.handleCropWidthInputChange}),this.t("widthInputField.label")]}),(0,y.jsx)("span",{className:"auto-adjust-toggle",role:"checkbox",title:this.t("lockAspectRatioInputField.label"),"aria-label":this.t("lockAspectRatioInputField.label"),"aria-checked":n,"aria-disabled":u,tabIndex:u?"-1":"0",onClick:this.handleAutoAdjustSizeInputAspectRatioToggle,onKeyUp:this.handleAutoAdjustSizeInputAspectRatioToggle}),(0,y.jsxs)("label",{children:[(0,y.jsx)("input",{type:"text",value:s,disabled:u,onChange:this.handleCropHeightInputChange}),this.t("heightInputField.label")]})]})]})]})}get footer(){return(0,y.jsxs)(f.A,{children:[(0,y.jsx)(g.A,{type:"button",variant:"outline",onClick:this.handleCancelButtonClick,children:this.t("cancelButton.label")}),(0,y.jsx)(g.A,{type:"button",onClick:this.handleSaveButtonClick,disabled:!this.state.canCrop,children:this.t("saveButton.label")})]})}render(){return this.props.renderLayout({title:this.t("title"),body:this.body,footer:this.footer,onCancel:this.handleCancelButtonClick})}}const A=(0,m.A)((0,b.A)("interface"),(0,v.Ay)())(w)},83458:(e,t,n)=>{"use strict"
341n.d(t,{A:()=>h})
342n(39155),n(98456)
343var a=n(12259),r=n(48431),i=n(84507),o=n(91121),s=n(62738),l=n(557),c=n(51546),u=n(84475),d=n(75655),p=n(42295)
344function h({disabled:e,linkDisabled:t}){const n=(0,i.d4)((e=>e.get("themeSettingsSchema").find((e=>"logoAdjustments"===e.get("name"))))),h=(0,i.d4)((e=>e.getIn(["shop","themeSettings"]))),g=(0,i.d4)((e=>e.get("defaultThemeSettings"))),f=(0,d.A)("SHOP_LOGO"),m=(0,l.WD)("interface","components.bottomBar.headerSettings.shopLogo.shopLogoAdjustments"),v="themeSettings",b=g.get("logoAdjustments"),y=n,x=(0,r.useMemo)((()=>(0,u.A)(m,h,g)[y.get("type")]({setting:y,isTopLevel:!0,disabled:e})),[m,h,g,y,e])
345return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(a.FormValueScope,{name:v,children:(0,p.jsxs)("fieldset",{children:[(0,p.jsx)("legend",{children:m("title")}),(0,p.jsx)("div",{className:"dali-settingslayer-element",children:(0,l.fN)(m)("infoText",{link:(0,p.jsx)("a",{className:(0,o.A)(["ep-form-row-text-external-link",{disabled:t}]),href:f,target:"_blank",rel:"noopener noreferrer",children:m("linkText")})})}),x]})}),(0,p.jsx)(c.A,{name:`${v}.logoAdjustments`,children:(t,n)=>(0,p.jsx)("button",{type:"button",disabled:e,className:"dali-settingslayer-logo-adjustments-reset-button",onClick:()=>n(b.updateIn(["sizing"],(e=>(0,s._)(e)))),children:m("resetButton.label")})})]})}},95756:(e,t,n)=>{"use strict"
346n.d(t,{A:()=>j})
347var a=n(12259),r=n.n(a),i=n(48431),o=n(84507),s=n(14953),l=n.n(s),c=n(96422),u=n(22732),d=n(557),p=n(81909),h=n(51546),g=n(18494),f=n(62929),m=n(83458),v=n(58219),b=n(75655),y=n(42295)
348const x=(0,c.Ay)({resolved:{},chunkName:()=>"editor",isReady(e){const t=this.resolve(e)
349return!0===this.resolved[t]&&!!n.m[t]},importAsync:()=>Promise.all([n.e(8840),n.e(6008)]).then(n.bind(n,10531)),requireAsync(e){const t=this.resolve(e)
350return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e)
351return n(t)},resolve(){return 10531}}),C=200,D=200
352function w({t:e,name:t,checked:n,onChange:a}){return(0,y.jsxs)("label",{children:[(0,y.jsx)("input",{type:"radio",name:t,checked:n,onChange:a}),e(`${t}.label`)]})}const A=(0,i.forwardRef)((({t:e,config:t,toggleCropSettings:n,hasImage:a,disabled:r},o)=>{const[s,l]=(0,i.useState)(null),c=(0,b.A)("IMAGE_FORMATS"),u=415===s?.code
353return(0,y.jsxs)("fieldset",{disabled:r,children:[s&&(0,y.jsxs)("div",{className:"dali-notification-danger",children:[s.message,u&&(0,y.jsx)("a",{href:c,target:"_blank",className:"ep-form-row-text-external-link",rel:"noreferrer noopener",children:e(":components.imageUploadComponent.imageField.errorMessages.helpCenterLink")})]}),(0,y.jsx)(g.A,{name:"imageData.src",children:e=>e?(0,y.jsx)("div",{className:"dali-notification-danger",children:e}):null}),(0,y.jsx)("div",{className:"ep-form-row",children:(0,y.jsx)("div",{className:"dali-settingslayer
353-element",children:(0,y.jsx)("div",{className:"dali-settingslayer-hint",children:e("shopLogoRadioButton.imageInfo",{recommendedImageWidth:C,recommendedImageHeight:D})})})}),(0,y.jsx)("div",{className:"ep-form-row",ref:o,children:(0,y.jsx)(f.Ay,{name:"imageData",storeFile:t.storeFile,imageUrl:t.imageUrl,previewUrl:t.previewUrl,onError:e=>l(e),onChange:()=>l(null),renderCropButton:()=>(0,y.jsx)(p.A,{type:"button",variant:"circular",icon:"crop",disabled:r,title:e("cropButton.label"),onClick:()=>n()})})}),(0,y.jsx)("div",{className:"ep-form-row",children:(0,y.jsx)("div",{className:"dali-settingslayer-logo-adjustments",children:(0,y.jsx)(m.A,{disabled:!a||r,linkDisabled:r})})})]})}))
354function E({config:e,value:t,onSaveCropResult:n,onCancelCrop:a,isOpen:r}){return(0,y.jsx)(v.default,{open:r,onEscapeKeyDown:a,className:"dali-settingslayer-image-crop",side:"top",align:"center",children:({renderLayout:r})=>(0,y.jsx)(x,{data:t,onCancel:a,onSave:n,renderLayout:r,config:e})})}function j(e){const t=(0,o.Pj)(),n=(0,o.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),r=(0,o.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),s=(0,o.d4)((e=>e.getIn(["shop","slug"]))),l=(0,d.WD)("interface","components.bottomBar.headerSettings.shopLogo"),c={storeFile:(0,u.u_)(t.api),imageUrl:(0,u.b8)(s),previewUrl:(0,u.Ss)(680)},[p,g]=(0,i.useState)(!1),f=()=>{g(!p)},m=n?`${r}/settings/website`:`${r}?ViewAction=UnityMBO-ViewStatusGeneral`
355return(0,y.jsx)(h.A,{name:"shopLogo",children:(e,t)=>{const n=e.get("shouldHideLogo")
356return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(E,{value:e.get("imageData"),isOpen:p,config:c,onSaveCropResult:n=>{t(e.setIn(["imageData"],n)),g(!1)},onCancelCrop:()=>{g(!1)}}),(0,y.jsx)("div",{className:"dali-settingslayer-element",children:l("description")}),(0,y.jsx)(w,{name:"shopNameRadioButton",t:l,checked:n,onChange:()=>t(e.set("shouldHideLogo",!0))}),(0,y.jsx)("div",{className:"ep-form-row","data-disabled":!n||null,children:(0,y.jsx)("div",{className:"dali-settingslayer-element",children:(0,d.fN)(l)("shopNameRadioButton.infoText",{link:(0,y.jsx)("a",{className:"ep-form-row-text-link",href:m,target:"_parent",children:l("shopNameRadioButton.linkText")})})})}),(0,y.jsx)(w,{name:"shopLogoRadioButton",t:l,checked:!n,onChange:()=>t(e.set("shouldHideLogo",!1))}),(0,y.jsx)(a.FormValueScope,{name:"shopLogo",children:(0,y.jsx)(A,{t:l,hasImage:Boolean(e.getIn(["imageData","src"])),disabled:n,config:c,toggleCropSettings:f})})]})}})}A.displayName="ImageLogoSettings",j.defaultValue=l().fromJS({imageData:{},shouldHideLogo:!1})},84475:(e,t,n)=>{"use strict"
357n.d(t,{A:()=>z})
358n(7121),n(39155),n(76881),n(61529)
359var a=n(12259),r=n(28321),i=n(9926),o=n(83241),s=n(48431),l=n(35255),c=n.n(l),u=(n(98357),n(14953)),d=n.n(u),p=n(42716),h=n(44420),g=n(42295)
360function f({value:e,onChange:t,onChangeComplete:n,colorGroup:a,className:r}){e&&"string"!=typeof e||(e=d().Map({base:"color1",variant:500}))
361const i=a.get(e.get("base")),o=e.get("variant"),s=100,l=`linear-gradient(to right, ${[100,300,500,700,900].map((e=>(0,h.Nt)(i,e))).join(", ")})`,c=e=>(e-s)/800,u=(0,h.Nt)(i,o),f=c(o),m={base:r,track:`${r}-track`,marker:`${r}-marker`,ticks:`${r}-ticks`,tickButton:`${r}-tick-button`,tickLabel:`${r}-tick-label`,info:`${r}-info`,preview:`${r}-preview`},v=[{variant:100,label:"Lighter"},{variant:300,label:"Light"},{variant:500,label:"Base"},{variant:700,label:"Dark"},{variant:900,label:"Darker"}],b=v.reduce(((e,t)=>Math.abs(o-t.variant)<Math.abs(o-e.variant)?t:e)),y=a.filter((e=>null!==e&&"string"==typeof e)).toJS()
362return(0,g.jsxs)("div",{className:m.base,style:{padding:10},children:[(0,g.jsx)("div",{style:{display:"flex",gap:10,marginBottom:10},children:Object.entries(y).map((([a,r])=>(0,g.jsx)("button",{type:"button",style:{width:20,height:20,backgroundColor:r,border:"2px solid #e0e0e0",borderColor:e.get("base")===a?"#333":"#e0e0e0"},onClick:()=>(e=>{const a=d().Map({base:e,variant:o})
363t(a),n&&n(a)})(a),title:a,children:(0,g.jsxs)("span",{className:"visually-hidden",children:["Use ",a]})},a)))}),(0,g.jsx)(p.v,{onChange:([a],r)=>{const i=(o=a,Math.round(s+800*o))
364var o
365const l=d().Map({base:e.get("base"),variant:i})
366t(l),r&&n&&n(l)},className:m.track,width:220,height:30,coords:[f,.5],style:{background:l,borderRadius:"4px",position:"relative",curs
366or:"pointer"},children:({x:e})=>(0,g.jsx)("div",{className:m.marker,style:{position:"absolute",left:Math.round(e),top:"50%",transform:"translate(-50%, -50%)",width:30,height:30,borderRadius:"50%",border:"3px solid white",boxShadow:"0 2px 4px rgba(0,0,0,0.3)",backgroundColor:u,pointerEvents:"none"}})}),(0,g.jsx)("div",{className:m.ticks,style:{position:"relative",width:220,height:"60px",marginTop:"8px"},children:v.map((({variant:a,label:r})=>{const o=c(a),s=b.variant===a,l=(0,h.Nt)(i,a)
367return(0,g.jsxs)("button",{type:"button",className:m.tickButton,onClick:()=>(a=>{const r=d().Map({base:e.get("base"),variant:a})
368t(r),n&&n(r)})(a),style:{position:"absolute",left:100*o+"%",transform:"translateX(-50%)",textAlign:"center",background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[(0,g.jsx)("div",{style:{width:s?"22px":"18px",height:s?"22px":"18px",borderRadius:"50%",backgroundColor:l,border:s?"3px solid #333":"2px solid #999",transition:"all 0.2s ease",boxShadow:s?"0 2px 8px rgba(0,0,0,0.3)":"0 1px 3px rgba(0,0,0,0.2)"}}),(0,g.jsx)("div",{style:{width:"2px",height:"8px",backgroundColor:s?"#333":"#999",transition:"background-color 0.2s ease"}}),(0,g.jsx)("div",{className:m.tickLabel,style:{fontSize:"11px",color:s?"#333":"#666",fontWeight:s?600:400,whiteSpace:"nowrap",transition:"all 0.2s ease"},children:r})]},a)}))}),(0,g.jsxs)("div",{className:m.info,style:{display:"flex",alignItems:"center",gap:"12px",marginTop:"8px"},children:[(0,g.jsx)("div",{className:m.preview,style:{width:"40px",height:"40px",borderRadius:"4px",backgroundColor:u,border:"2px solid #e0e0e0"}}),(0,g.jsxs)("div",{children:[(0,g.jsxs)("div",{style:{fontSize:"14px",fontWeight:500},children:["Variant: ",o]}),(0,g.jsx)("div",{style:{fontSize:"12px",color:"#666"},children:u})]})]})]})}var m=n(30202),v=n(557)
369const b=(0,s.forwardRef)(((e,t)=>{const{value:n,onChange:a,className:r,resetValue:i,side:o,align:l,offsetDistance:c=40,colorGroup:u}
369=e,[d,p]=(0,s.useState)(!1),[b,y]=(0,s.useState)(null),x=(0,v.WD)("interface"),C=()=>{p(!1),y(null)}
370return(0,g.jsx)(m.A,{avoidCollisions:!0,className:"ep-color-settings",side:o,align:l,sideOffset:c,trigger:(0,g.jsx)("span",{"data-testid":"color-field-trigger",className:r,style:{backgroundColor:n&&"string"!=typeof n?(0,h.Nt)(u.get(n.get("base")),n.get("variant")):"transparent"}}),open:d,onOpenChange:p,onEscapeKeyDown:C,onKeyDown:e=>{"Enter"===e.key&&C()},children:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(f,{className:"colorpicker",value:b||n,colorGroup:u,onChangeComplete:()=>{y(null)},onChange:e=>{y(e),a(e)}}),i&&(0,g.jsx)("button",{"data-testid":"color-field-reset",type:"button",className:"ep-color-settings-reset-button",onClick:()=>{y(null),a(i)},children:x("components.colorFieldComponent.popover.resetButton.label")})]})})}))
371b.displayName="ColorVariantFieldRaw"
372const y=c()((0,a.formField)()(b),b)
373var x=n(43343),C=n(25312),D=n(99044),w=n.n(D),A=n(90141)
374const E={lineNumbers:!0,lineWrapping:!0,mode:"css",theme:"base16-light",viewportMargin:1/0},j=(0,s.forwardRef)((({value:e,onChange:t,onInput:n=x.A,onInfoText:a},r)=>{const[i,o]=(0,s.useState)(e),[l,c]=(0,s.useState)(!1),u=(0,v.WD)("interface");(0,s.useEffect)((()=>{a(u("components.customCssFieldComponent.explanation"))}),[a,u])
375const d=(0,C.A)((e=>{try{w().parse(e,{from:void 0}),c(!1),t(e)}catch{c(!0)}}),500)
376return(0,g.jsx)(A.A,{value:i,resetValue:"",invalid:l,className:"ep-custom-css-field",warningDismissKey:"customCssWarningDismissed",tScoped:(e,...t)=>u(`components.customCssFieldComponent.${e}`,...t),onChange:e=>{o(e),n(e),d(e)},codeMirrorOptions:E})})),B=(0,a.formField)()(j)
377n(79826)
378var k=n(66153)
379function S(e){const t=/"?([^,"]+)"?/.exec(e)
380return t?.[1]??null}function N(e,t){return[/\s/.test(e)?`"${e}"`:e,t.get("genericName")].join(",")}const F=(0,s.forwardRef)((({fonts:e,onChange:t,scopedName:n,value:a,resetValue:r},i)=>{const o=(0,v.WD)("interface"),[l,c]=(0,s.useState)(""),u=e=>o(`components.fontFieldComponent.${e}
380`),[d,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(a),b=l?.length>1?e.map((e=>e.update("fonts",(e=>e.filter((e=>e.toLowerCase().includes(l.toLowerCase()))))))).filter((e=>e.get("fonts").size>0)):e
381return(0,g.jsx)("div",{className:"ep-font-field",children:(0,g.jsx)(m.A,{avoidCollisions:!0,className:"ep-font-settings",side:"left",sideOffset:40,open:d,onOpenChange:e=>{e&&f(a),p(e)},onEscapeKeyDown:()=>{t(h),p(!1)},onKeyDown:e=>{"Enter"===e.key&&p(!1)},anchor:(0,g.jsxs)("div",{className:"ep-font-field-preview",children:[(0,g.jsx)("div",{children:u("preview")}),(0,g.jsx)("div",{className:"ep-font-field-preview-selected",style:{fontFamily:a},children:u("previewText")}),(0,g.jsxs)("div",{children:[(0,g.jsxs)("span",{children:[u("font")," "]}),(0,g.jsx)("span",{children:S(a)})]})]}),trigger:(0,g.jsx)("div",{className:"ep-font-field-settings-button",children:(0,g.jsx)("button",{className:"ep-font-field-settings-button-change",type:"button",children:u("changeFontButton.label")})}),children:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:"ep-font-search-input-wrapper",children:(0,g.jsx)("input",{className:"ep-form-text-field ep-font-search-input",value:l,onChange:e=>c(e.target.value),placeholder:u("fontSelectionPopover.searchInputField.placeholder")})}),0===b.size?(0,g.jsx)("div",{className:"ep-font-search-no-result",children:u("fontSelectionPopover.searchInputField.noFontsText")}):(0,g.jsx)("scroll-shadow",{children:(0,g.jsx)("div",{className:"ep-font-settings-select",children:b.toArray().map((e=>(0,g.jsxs)("fieldset",{children:[(0,g.jsx)("legend",{children:u(`fontSelectionPopover.fontTypes.${(0,k.A)(e.get("group"))}`)}),e.get("fonts").map((r=>{const i=`${n}-${e.get("group")}-${r}`
382return(0,g.jsxs)(s.Fragment,{children:[(0,g.jsx)("input",{id:i,name:n,type:"radio",value:r,checked:r===S(a),onChange:()=>t(N(r,e))}),(0,g.jsx)("label",{htmlFor:i,style:{fontFamily:N(r,e)},children:r})]},`font-${r}`)}))]},`font-group-${e.get("group")}`)))})}),r&&b.size>0&&(0,g.jsx)("button",{className:"ep-font-settings-reset-button",type:"button",onClick:()=>r&&t(r),children:u("fontSelectionPopover.resetButton.label")})]})})})}))
383F.displayName="FontFieldRaw"
384const O=(0,a.formField)()(F)
385var M=n(51769),P=n(51546),T=n(81671)
386const I=(0,a.withClassName)("ep-form-selectable-input")(a.SelectableInputField)
387var R,L,_
388const $={group:function({t:e,setting:t,scopedName:n,isTopLevel:r,...i}){return(0,g.jsxs)("div",{className:"ep-theme-settings-group",children:[!r&&(0,g.jsx)("h4",{className:"ep-theme-settings-group-heading",children:e(t.get("name"))}),t.has("description")&&(0,g.jsx)("p",{className:"ep-theme-settings-group-description",children:e(t.get("description"))}),(0,g.jsx)(a.FormValueScope,{name:t.get("name"),children:(0,g.jsx)(g.Fragment,{children:t.get("settings").map((a=>$[a.get("type")]({setting:a,scopedName:n?`${n}.${t.get("name")}`:t.get("name"),t:e,...i})))})})]},t.get("name"))},colorGroup:function({t:e,setting:t,scopedName:n,isTopLevel:r,themeSettings:i,defaultThemeSettings:s}){const l=(t.get("variants")??[]).reduce(((e,t)=>{const n=t.get("fieldset")
389return e[n]||(e[n]=[]),e[n].push(t),e}),{})
390return(0,g.jsxs)("div",{className:"ep-theme-settings-group",children:[!r&&(0,g.jsx)("h4",{className:"ep-theme-settings-group-heading",children:e(t.get("name"))}),(0,g.jsxs)(a.FormValueScope,{name:t.get("name"),children:[(0,g.jsxs)("fieldset",{children:[R||(R=(0,g.jsx)("legend",{children:"Website colors"})),t.get("colors").map((t=>(0,g.jsx)(M.A,{labelAfterComponent:!0,name:t,label:e(t),className:"ep-color-field-item",children:(0,g.jsx)(o.default,{name:t,side:"left",className:"ep-color-field-box",resetValue:s.getIn(`${n}.${t}`.split("."))})},t)))]}),t.has("additionalColors")&&(0,g.jsxs)("fieldset",{children:[L||(L=(0,g.jsx)("legend",{children:"Additional website colors"})),t.get("additionalColors").map((t=>(0,g.jsx)(M.A,{labelAfterComponent:!0,name:t,label:e(t),className:"ep-color-field-item",children:(0,g.jsx)(o.default,{name:t,side:"left",className:"ep-color-field-box",resetValue:s.getIn(`${n}.${t}`.split("."))})},t)))]}),t.has("variants")&&(0,g.jsxs)("fieldset",{children:[_||(_=(0,g.jsx)("legend",{children:"Advanced color options"})),Object.keys(l).map((n=>(0,g.jsxs)("fieldset",{children:[(0,g.jsx)("legend",{children:e(n)}),l[n].map((n=>(0,g.jsx)(M.A,{labelAfterComponent:!0,name:n.get("name"),label:e(n.get("name")),className:"ep-color-field-item",children:(0,g.jsx)(y,{colorGroup:i.get(t.get("name")),name:n.get("name"),side:"left",className:"ep-color-field-box"})},n.get("name"))))]},n)))]})]})]},t.get("name"))},fontGroup:function({t:e,setting:t,scopedName:n,isTopLevel:r,...i}){const o=(t.get("settings")??[]).reduce(((e,t)=>{const n=t.get("fieldset")
391return e[n]||(e[n]=[]),e[n].push(t),e}),{})
392return(0,g.jsxs)("div",{className:"ep-theme-settings-group",children:[!r&&(0,g.jsx)("h4",{className:"ep-theme-settings-group-heading",children:e(t.get("name"))}),t.has("description")&&(0,g.jsx)("p",{className:"ep-theme-settings-group-description",children:e(t.get("description"))}),(0,g.jsx)(a.FormValueScope,{name:t.get("name"),children:Object.keys(o).map((a=>(0,g.jsxs)("fieldset",{children:[(0,g.jsx)("legend",{children:e(a)}),o[a].map((a=>$[a.get("type")]({setting:a,scopedName:n?`${n}.${t.get("name")}`:t.get("name"),t:e,...i})))]},a)))})]},t.get("name"))},selection:function({setting:e,...t}){return(0,g.jsx)("div",{children:(0,g.jsx)(a.FormValueScope,{name:e.get("name"),children:(0,g.jsx)(g.Fragment,{children:e.get("options").map((n=>$[n.get("type")]({setting:n,parent:e,...t})))})})},e.get("name"))},input:function({t:e,setting:t,parent:n}){const a="selection"===n?.get("type"),r=t.get("name"),i=(0,g.jsx)("div",{className:"ep-form-row",children:(0,g.jsx)(I,{name:r,label:e(r)})},r),o=(0,g.jsx)(M.A,{name:r,tagName:"label",label:e(r),children:(0,g.jsx)(T.A,{name:r})},r)
393return a?i:o},checkbox:function({t:e,setting:t}){const n=t.get("name")
394return(0,g.jsx)(M.A,{name:n,tagName:"label",label:e(n),labelAfterComponent:!0,children:(0,g.jsx)(i.A,{name:n})},n)},color:function({t:e,setting:t,scopedName:n,defaultThemeSettings:a}){const r=t.get("name")
395return(0,g.jsx)(M.A,{labelAfterComponent:!0,name:r,label:e(r),className:"ep-color-field-item",children:(0,g.jsx)(o.default,{name:r,side:"left",className:"ep-color-field-box",resetValue:a.getIn(`${n}.${r}`.split("."))})},r)},font:function({t:e,setting:t,scopedName:n,defaultThemeSettings:a}){const r=t.get("name")
396return(0,g.jsx)(M.A,{name:r,label:e(r),labelClassName:"ep-font-style",children:(0,g.jsx)(O,{fonts:t.get("fonts"),resetValue:a.getIn(`${n}.${r}`.split("."))})},r)},customCss:function({setting:e,scopedName:t,defaultThemeSettings:n,onCustomCssInfoText:a}){const r=e.get("name")
397return(0,g.jsx)("div",{className:"ep-form-row",children:(0,g.jsx)(B,{name:r,resetValue:n.getIn(`${t}.${r}`.split(".")),onInfoText:a})},r)},radioButtons:function({t:e,setting:t,scopedName:n,disabled:r}){const i=t.get("name"),o=t.get("options").map((t=>({value:t,label:e(`${i}.options.${t}`)})))
398return(0,g.jsx)(M.A,{name:i,className:r?"disabled":"",label:e(`${i}.label`),children:(0,g.jsx)(a.RadioButtonField,{className:"dali-settingslayer
398-logo-alignment",name:i,buttons:o.toJS(),disabled:r})},`${n}.${i}`)},rangeWithInput:function({t:e,setting:t,scopedName:n,disabled:a}){const i=t.get("name")
399return(0,g.jsx)(P.A,{name:i,children:(t,n)=>(0,g.jsx)(r.D,{label:e(`${i}.label`),name:i,value:t,setValue:n,disabled:a})},`${n}.${i}`)}}
400function z(e,t,n,a){return Object.entries($).reduce(((r,[i,o])=>({[i]:r=>o({t:e,themeSettings:t,defaultThemeSettings:n,...r,...a}),...r})),{})}},9926:(e,t,n)=>{"use strict"
401n.d(t,{A:()=>r})
402var a=n(12259)
403const r=(0,a.withClassName)("ep-form-row-checkbox")(a.CheckboxField)},90141:(e,t,n)=>{"use strict"
404n.d(t,{A:()=>h})
405n(76881)
406var a=n(48431),r=n(91121),i=n(23435),o=n(557),s=n(42295)
407function l({message:e,onDismiss:t}){const n=(0,o.WD)("interface")
408return(0,s.jsxs)("p",{className:"ep-notification-warning",children:[e,t&&(0,s.jsx)("span",{title:n("components.warningMessageComponent.dismissButton.label"),className:"ep-simple-notification-close",onClick:t})]})}var c,u=n(71521)
409const d=(0,a.lazy)((()=>n.e(8597).then(n.bind(n,60585))))
410function p(e){switch(e){case i.U.DOCUMENT_STRUCTURE:return"validationMessages.documentStructure"
411case i.U.HEAD_METADATA:return"validationMessages.headMetadata"
412case i.U.UNCLOSED_COMMENT:return"validationMessages.unclosedComment"
413default:return"validationMessages.invalidCode"}}function h({value:e,resetValue:t,warningDismissKey:n,onChange:i,onLint:o,className:h,codeMirrorOptions:g,tScoped:f,invalid:m,errorCategories:v=[]}){const[b,y]=(0,a.useState)((()=>Boolean(u.A.getItem(n)))),x=m&&0===v.length,C=v.length>0
414return(0,s.jsxs)("div",{className:(0,r.A)(["ep-code-editor",h]),children:[!b&&(0,s.jsx)(l,{message:f("warningMessage"),onDismiss:()=>{y(!0),u.A.setItem(n,"1")}}),(0,s.jsx)(a.Suspense,{fallback:c||(c=(0,s.jsx)("div",{className:"ep-code-editor-field"})),children:(0,s.jsx)(d,{className:"ep-code-editor-field",onChange:i,onLint:o,options:g,value:e,resizable:!0})}),m&&(0,s.jsxs)("div",{className:"ep-code-editor-invalid-message",children:[x&&(0,s.jsx)("span",{className:"ep-code-editor-invalid-message-text",children:f("validationMessages.invalidCode")}),C&&v.map((e=>(0,s.jsx)("span",{className:"ep-code-editor-invalid-message-text",children:f(p(e))},e)))]}),(0,s.jsx)("button",{className:"ep-code-editor-reset-button",onClick:()=>i(t),type:"button",children:f("resetButton.label")})]})}},83241:(e,t,n)=>{"use strict"
415n.r(t),n.d(t,{ColorFieldRaw:()=>f,FormikColorField:()=>b,default:()=>m})
416var a=n(12259),r=n(48431),i=n(24727),o=n.n(i),s=n(35255),l=n.n(s),c=n(30202),u=n(557),d=n(42716),p=n(92016),h=n(42295)
417const g={width:220,height:200,hueWidth:14,spacing:7},f=(0,r.forwardRef)(((e,t)=>{const{value:n,onChange:a,className:i,resetValue:o,side:s,align:l,offsetDistance:p=40,presetColors:f=[]}=e,[m,v]=(0,r.useState)(!1),[b,y]=(0,r.useState)(null),x=(0,u.WD)("interface"),C=()=>{v(!1),y(null)}
418return(0,h.jsx)(c.A,{avoidCollisions:!0,className:"ep-color-settings",side:s,align:l,sideOffset:p,trigger:(0,h.jsx)("span",{"data-testid":"color-field-trigger",className:i,style:{backgroundColor:n}}),open:m,onOpenChange:v,onEscapeKeyDown:C,onKeyDown:e=>{"Enter"===e.key&&C()},children:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.A,{className:"colorpicker",dimensions:g,value:b||n,onChangeComplete:()=>{y(null)},onChange:e=>{y(e),a(e)},presetColors:f}),o&&(0,h.jsx)("button",{"data-testid":"color-field-reset",type:"button",className:"ep-color-settings-reset-button",onClick:()=>{y(null),a(o)},children:x("components.colorFieldComponent.popover.resetButton.label")})]})})}))
419f.displayName="ColorFieldRaw"
420const m=l()((0,a.formField)()(f),f)
421function v({name:e,withHexInput:t=!1,className:n="",...a}){const[i,s]=(0,r.useState)(null)
422return(0,h.jsx)(p.A,{name:e,children:(e,r)=>(0,h.jsxs)("div",{className:`${n} ${t?"ep-color-field-with-input-wrapper":""}`,children:[(0,h.jsx)(f,{value:e,onChange:r,className:"ep-color-field-box",...a}),t&&(0,h.jsx)("input",{type:"text",className:"ep-form-text-field",value:i??("transparent"===e?"":o()(e).hex()),onBlur:()=>{s(null)},onChange:e=>{s(e.target.value)
423try{r(o()(e.target.value).hsl().round().string())}catch{}}})]})})}const b=l()(v,v)},42716:(e,t,n)=>{"use strict"
424n.d(t,{A:()=>h,v:()=>p})
425n(76881)
426var a=n(41788),r=n(48431),i=n(24727),o=n.n(i),s=n(79655),l=n(42295)
427function c(e){try{return o()(e),!0}catch{return!1}}const u=(e,t)=>
427`linear-gradient(${e}, transparent 0%, ${t} 100%)`,d={width:300,height:300,hueWidth:20,spacing:5}
428function p({coords:e,children:t,width:n,height:i,style:o,className:c,onChange:u}){const d=(0,r.useRef)(!1),p=(0,r.useRef)(null);(0,s.A)("mousemove",(e=>{d.current&&h(e)})),(0,s.A)("mouseup",(e=>{d.current&&(d.current=!1,h(e,!0))}))
429const h=({clientX:e,clientY:t},r)=>{const{top:o,left:s}=p.current.getBoundingClientRect(),l=(0,a.A)((e-s)/n,0,.99),c=(0,a.A)((t-o)/i,0,.99)
430u([l,c],r)},[g,f]=e
431return(0,l.jsx)("div",{ref:p,className:c,style:{...o,width:n,height:i},onTouchMove:e=>h(e),onMouseDown:e=>{e.preventDefault(),d.current=!0},children:t({x:g*n,y:f*i,rx:g,ry:f,width:n,height:i})})}const h=function({value:e,onChange:t,onChangeComplete:n,className:a,dimensions:{width:i,height:s,hueWidth:h,spacing:g}=d,presetColors:f=[]}){const[m,v]=(0,r.useState)(null),b=o()(e).hsv(),{h:y,s:x,v:C}=b.object(),D=(e,a=!1)=>{c(e.string())&&requestAnimationFrame((()=>{const r=e.hue(Math.round(e.hue())).hsl().alpha(1).string()
432t(r),a&&n&&n(r)}))},w={base:a,baseSaturationValue:`${a}-saturation-value-canvas`,baseHue:`${a}-hue`,baseHexInput:`${a}-hex-input`,saturation:`${a}-saturation`,value:`${a}-value`,marker:"marker",presets:`${a}-color-presets`},A=b.saturationv(100).value(100).hex(),E=m??b.hex()
433return(0,l.jsxs)("div",{className:w.base,"data-testid":"colorpicker-field",children:[(0,l.jsx)(p,{onChange:([e,t],n)=>{v(null),D(b.saturationv(100*e).value(100-100*t),n)},className:w.baseSaturationValue,width:i-(h+g),height:s,coords:[x/100,C/100],children:({x:e,y:t,height:n})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:w.saturation,style:{background:u("to right",A)}}),(0,l.jsx)("div",{className:w.value,style:{background:u("to bottom","#000")}}),(0,l.jsx)("div",{className:w.marker,style:{left:Math.round(e),top:Math.round(n-t)}})]})}),(0,l.jsx)(p,{onChange:([,e],t)=>{v(null),D(b.hue(360*e),t)},className:w.baseHue,coords:[0,y/360],width:h,height:s,style:{background:"linear-gradient(to bottom, #ff0000 0%, #ffff00 20%, #00ff00 35%, #00ffff 50%, #0000ff 65%, #ff00ff 80%, #ff0000 100%)"},children:({y:e})=>(0,l.jsx)("div",{className:w.marker,style:{top:Math.round(e)}})}),f?.length>0&&(0,l.jsx)("div",{className:w.presets,children:f.map((e=>(0,l.jsx)("button",{type:"button",title:e.name,style:{backgroundColor:e.value},onClick:()=>D(o()(e.value),!0)},e.name)))}),(0,l.jsx)("input",{"data-testid":"colorpicker-hex-input",className:w.baseHexInput,type:"text",value:E,onBlur:()=>
433{v(null),n&&n(e)},onChange:e=>{v(e.target.value),c(e.target.value)&&t(o()(e.target.value).hsl().round().string())}})]})}},51546:(e,t,n)=>{"use strict"
434n.d(t,{A:()=>i})
435var a=n(12259),r=n(48431)
436class i extends r.Component{static contextType=a.BaseField.contextType
437render(){const e=this.context.instance,{name:t,children:n}=this.props
438return n(e.getValue(t),(n=>e.setValue(t,n)))}}},18494:(e,t,n)=>{"use strict"
439n.d(t,{A:()=>l})
440var a=n(12259),r=n(48431),i=n(97465),o=n.n(i)
441function s({name:e,children:t}){return t((0,r.useContext)(a.BaseField.contextType).instance.getError(e))}s.propTypes={...a.BaseField.propTypes,children:o().func.isRequired}
442const l=s},93020:(e,t,n)=>{"use strict"
443n.d(t,{A:()=>o})
444n(76881)
445var a=n(61720),r=n(48431),i=n(42295)
446function o({name:e,options:t,disabled:n=!1}){const o=(0,r.useId)()
447return(0,i.jsx)("div",{children:t.map((t=>(0,i.jsxs)("span",{children:[(0,i.jsx)(a.D0,{id:`${o}.${e}.${t.value}`,type:"radio",name:e,value:t.value,disabled:n}),(0,i.jsx)("label",{htmlFor:`${o}.${e}.${t.value}`,children:t.label})]},t.value)))})}},86148:(e,t,n)=>{"use strict"
448n.d(t,{A:()=>s})
449n(76881)
450var a=n(48431),r=n(91121)
451const i=JSON.parse('[["house-chimney","house-circle-check","house-laptop","house-chimney-user","person-shelter","people-roof","door-open","couch","chair","rug","bed"],["gift","gift-02","gift-03","gift-card","gifts"],["cubes-stacked","puzzle-piece","dice","chess","chess-knight-01","chess-knight-02","gamepad-01","gamepad-02","gamepad-03","gamepad-04","gamepad-05","gamepad-06","gamepad-07","gamepad-08","gamepad-09","ghost","table-tennis-paddle-ball","baseball-bat-ball","golf-ball-tee","football","baseball","basketball","bowling-ball","futbol","volleyball"],["mitten","briefcase","hat-cowboy","glasses","top-01","top-02","t-shirt-01","t-shirt-02","t-shirt-03","shirt-01","shirt-02","dress-01","dress-02","pullover-01","pullover-02","vest","jacket-01","jacket-02","shorts-01","shorts-02","trousers-01","trousers-02","socks"],["cookie-bite","ice-cream","cheese","apple-whole","lemon-01","lemon-02","carrot","pepper-hot","wheat-awn","egg","shrimp","drumstick-bite","hotdog","pizza-slice","burger","bowl-food","jar-wheat","jar","bottle-water","bottle-droplet","wine-bottle","mug-saucer","mug-hot","martini-glass","martini-glass-citrus","wine-glass","wine-glass-empty","beer-mug-empty","glass-water-droplet","glass-water","spoon","utensils","kitchen-set"],["hand-holding-medical","suitcase-medical","house-chimney-medical","house-medical-circle-check","truck-medical","hospital-01","hospital-02","user-doctor","stethoscope","pills","heart-pulse","mask-face","syringe","virus-covid","bandage","pump-soap","soap","hands-bubbles","hand-sparkles","sink","faucet-drip","bath","shower","water","water-ladder","spa","hot-tub-person"],["palette","fill-drip","swatchbook","scissors","ruler-combined","pen-ruler","tape","splotch","droplet","pen-to-square-01","pen-to-square-02","pen-nib","pen-fancy","pencil","marker","highlighter","brush","eye-01","eye-02"],["dog","shield-dog","paw","bone","cat","shield-cat","horse-head","horse","fish-fins","dove","crow","feather","cow"],["person-pregnant","person-breastfeeding","hands-holding-child","baby","baby-carriage","children","child-reaching","child-dress","child","shapes"],["gem-01","gem-02","ring","diamond-01","diamond-02","diamond-03","diamond-04","diamond-05","diamond-06"],["bucket","paint-roller","paintbrush","fan","tree-city","tree","mountain-sun","clover","cloud-sun","sun-01","sun-02"],["person-biking","person-hiking","person-running","person-skiing","person-snowboarding","person-swimming","dumbbell","car-side","motorcycle","bicycle","sailboat","umbrella-beach","suitcase-rolling","person-walking-luggage","book-open-reader","book-bookmark","guitar","music","drum","compact-disc","ticket","film","photo-film","image-01","image-02"],["headphones-02","headphones-03","radio","camera","camera-retro","video","laptop","desktop","tv","computer","keyboard-01","keyboard-02","print","smartphone-02","smartphone","mobile-retro","sim-card","sd-card","microchip","satellite-dish","robot","car-battery","plug","plug-circle-plus","plug-circle-minus","plug-circle-bolt","plug-circle-check","plug-circle-exclamation","lightbulb-01","lightbulb-02","power-off","bolt-01","bolt-02"],["compass-drafting","screwdriver","wrench","screwdriver-wrench","hammer","trowel","trowel-bricks","toolbox","helmet-safety","city","industry","gears","fire-flame-curved","warehouse","person-digging","road-barrier","trailer","truck-pickup","tractor"],["chart
451-line","chart-area","chart-column","chart-simple","ranking-star","gauge-high","rocket","flag-checkered","trophy","thumbs-up","thumbs-up-02","thumbs-up-03","thumbs-down-01","thumbs-down-02"],["coins-02","coin","money-bill","money-bill-wave","money-bills","banknote","money","wallet","piggy-bank","euro-sign","cash-register","credit-card-01","credit-card-02","money-check","tag","tags","receipt","file-invoice"],["hand-holding-heart","hand-holding-droplet","hand-holding-hand","hands-holding-circle","leaf","seedling","recycle"],["face-smile-01","face-smile-02","face-smile-wink-01","face-grin-wink-02","face-laugh-wink-01","face-smile-wink-02","face-grin-beam-01","face-grin-beam-02","face-grin-hearts-01","face-grin-hearts-02","face-grin-stars-01","face-grin-stars-02","hands-clapping","hand-peace-01","hand-peace-02","wand-magic-sparkles","heart-circle-check","heart-circle-plus"],["check-01","check-02","check-circle-01","check-circle-02","check-square","wheelchair","universal-access","eye-low-vision","eye-slash","ear-deaf","person-cane","person-walking-with-cane","plus","minus","xmark","user-01","user-02","circle-user-01","circle-user-02","person-circle-plus","person-circle-question","person-circle-check","user-group","users","users-line","people-group","document","file-circle-check","rectangle-list-01","rectangle-list-02","list"],["box-open","boxes-packing","shipping","delivery","people-carry-box","truck-ramp-box","truck-01","truck-02","route","return","back","change","moon","moon-02"],["star","star-half-stroke","star-02","crown","certificate-02","medal","award","message-01","message-02","comment-01","comment-02","comment-dots-01","comment-dots-02","comments-01","comments-02","quote-left","quote-right"],["user-lock","user-shield","user-secret","handshake","handshake-02","file-shield","shield","shield-halved","shield-heart","building-columns","building-shield","building-lock","scale-balanced","section","gavel","lock","umbrella","key"],["percent","percent-02","certificate","bell-01","bell-02","bullhorn"],["location-arrow","location-crosshairs","map-pin","map-marker","magnifying-glass-location","map","map-location-dot","map-02","map-03","language","flag-01","flag-02","globe","earth-europe"],["phone","telephone","headphones","headset","clock-03","clock-01","clock-02","clock-24","stopwatch","calendar-check-02","calendar-check-01","calendar-day","calendar-02","calender","shop","store","sign-hanging"],["shopping-bag-01","shopping-bag-02","shopping-bag-03","shopping-basket-01","shopping-basket-02","shopping-basket-03","shopping-basket-04","shopping-basket-05","shopping-cart-01","shopping-cart-02","cart-plus","shopping-cart-03"],["heart-01","heart-02","share","share-from-square-01","share-from-square-02","share-nodes","hashtag","facebook","x-twitter","pinterest","instagram","youtube","whatsapp","tiktok","linkedin"],["envelope","envelope-02","envelope-circle-check","envelope-open-01","envelope-open-02","envelope-open-text","envelopes-bulk","paper-plane","paper-plane-02","email"],["cake-candles","champagne-glasses","candy-cane","christmas-tree-01","christmas-tree-02","sleigh","snowflake","snowman","easter-basket","easter-bunny","easter-egg-01","easter-egg-02"],["info-03","info-02","info-01","question-03","question-02","question-01","clipboard-question","signs-post"]]')
452var o=n(42295)
453function s({icon:e,setIcon:t,className:n}){const s=(0,a.useRef)(void 0)
454return(0,a.useEffect)((()=>{s.current?.scrollIntoView({block:"nearest"})}),[]),(0,o.jsx)("scroll-shadow",{children:(0,o.jsx)("div",{className:(0,r.A)(["ep-icon-picker-wrapper",n]),children:i.map(((n,a)=>(0,o.jsx)("div",{className:"ep-icon-picker-category",children:n.map((n=>(0,o.jsx)("div",{className:"body",children:(0,o.jsx)("button",{type:"button","data-testid":`icon-picker-${n}-icon`,className:(0,r.A)([`ep-${n}-icon`,{selected:n===e}]),ref:t=>{n===e&&(s.current=t)},onClick:()=>t(n)})},n)))},a)))})})}},81671:(e,t,n)=>{"use strict"
455n.d(t,{A:()=>r})
456var a=n(12259)
457const r=(0,a.withClassName)("ep-form-text-field",["focus"])(a.InputField)},40212:(e,t,n)=>{"use strict"
458n.d(t,{A:()=>r})
459var a=n(12259)
460const r=(0,a.withClassName)("ep-form-row-radio-group")(a.RadioButtonField)},19956:(e,t,n)=>{"use strict"
461n.d(t,{O:()=>y})
462n(76881)
463var a=n(53835),r=n(52763),i=n(48431),o=n(41871),s=n(77702),l=n(16277),c=n(557),u=n(85519),d=n(1421),p=n(79390),h=n(19736),g=n(62420),f=n(63171),m=n(1425),v=n(6443),b=n(42295)
464const y=(0,i.forwardRef)((({value:e,onChange:t,toolbarButtons:n=[],placeholderText:y,restrictToSingleLine:x,maxCharacters:C},D)=>{const w=(0,c.WD)("interface","components.richTextComponent"),A=(0,i.useRef)(null),[E,j]=(0,i.useState)((0,l.ZC)(e)),[B,k]=(0,i.useState)(0),S=(0,i.useMemo)((()=>{const e=(0,d.G)((0,o.$k)((0,u.q9)((0,l.Fj)((0,a.o$)((0,r.ie)())))))
465return x&&(0,d.n)(e),e}),[x]);(0,i.useEffect)((()=>{const e=r.KE.string(S,[]).length
466k(e)}),[S]),(0,i.useEffect)((()=>{const n=(0,l.lK)(E)
467n!==e&&t(n)}),[e,t,E])
468const N=(0,i.useCallback)((e=>(0,b.jsx)(p.A,{...e})),[]),F=(0,i.useCallback)((e=>(0,b.jsx)(h.A,{...e})),[]),O=(0,i.useCallback)((e=>{const t=r.KE.string(S,[]).length
469j([...e]),k(t)}),[S]);(0,i.useEffect)((()=>{S.children=E,r.KE.normalize(S,{force:!0}),j(S.children)}),[E,S])
470const[M,P]=(0,i.useReducer)(s.toolbarReducer,s.initialToolbarState),T=(0,i.useMemo)((()=>[M,P]),[M]),I=S.selection,R=B-(I?r.KE.string(S,I).length:0)
471return(0,b.jsxs)(b.Fragment,{children:[C&&(0,b.jsx)("span",{className:"ep-form-row-label-counter",children:w("characterCounter",{length:B,limit:C})}),(0,b.jsx)(s.ToolbarContext.Provider,{value:T,children:(0,b.jsx)("div",{className:"ep-text-editor",tabIndex:-1,children:(0,b.jsxs)(a.A,{editor:S,initialValue:E,onChange:O,children:[n.length>0&&(0,b.jsx)("div",{className:"ep-text-editor-toolbar",children:n.map((e=>(0,b.jsxs)(i.Fragment,{children:["bold"===e&&(0,b.jsx)(f.A,{title:w("boldButton.tooltip"),format:"bold"}),"link|unlink"===e&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.A,{title:w("linkButton.tooltip"),format:"link"}),(0,b.jsx)(g.A,{title:w("removeHyperlinkButton.tooltip"),format:"unlink"})]})]},e)))}),(0,b.jsxs)("div",{ref:A,children:[(0,b.jsx)(a.Fo,{className:"ep-text-editor-main",renderLeaf:F,renderElement:N,placeholder:y??w("textInputField.standardPlaceholder"),onDOMBeforeInput:e=>{const t=e.inputType
472if(C&&"insertText"===t){const t=e.data?.length||0
473R+t>C&&e.preventDefault()}},onPaste:e=>{if(C){e.preventDefault()
474const t=e.clipboardData.getData("text"),n=t.length
475if(R+n>C){const e=t.substring(0,C-R)
476r.KE.insertText(S,e)}else r.KE.insertText(S,t)}}}),(0,b.jsx)(v.Ay,{children:(0,b.jsx)(m.A,{sideOffset:0,side:"top",editableRef:A})})]})]})})})]})}))
477y.displayName="RichTextField"},58219:(e,t,n)=>{"use strict"
478n.r(t),n.d(t,{SettingsLayerLayout:()=>y,default:()=>x})
479n(76881)
480var a=n(48431),r=n(32174),i=n(91121),o=n(25312),s=n(61085),l=n(75269),c=n.n(l),u=n(42295)
481function d(e,t,n={checkBottom:!0}){const a=e.top<t.elementMinTop,r=!!n.checkBottom&&e.bottom>window.innerHeight,i=e.left<t.elementMaxLeftShift,o=e.width<window.innerWidth&&e.right>t.elementMaxRightShift
482return!!(a||r||i||o)&&{top:a,bottom:r,left:i,right:o}}function p(e,t){const{innerHeight:n,innerWidth:a}=window,r=t.offsetTop+t.clientHeight,i=e.clientWidth-(t.offsetLeft+t.clientWidth)
483return{elementMaxTop:n-r,elementMinTop:-t.offsetTop,elementMaxLeftShift:-t.offsetLeft,elementMaxRightShift:a+i}}function h(e,t,n){let a=0
484t.right&&e.width<window.innerWidth?a=n.elementMaxRightShift-e.right:t.left&&(a=n.elementMaxLeftShift-e.left)
485let r=0
486return t.top?r=n.elementMinTop-e.top:t.bottom&&(r=window.innerHeight-e.bottom),{x:a,y:r}}function g({children:e,dragAnchorRef:t}){const[n,r]=(0,a.useState)(null),[i,l]=(0,a.useState)({x:0,y:0}),g=(0,a.useRef)(!1),f=(0,a.useRef)(null),m=(0,a.useCallback)(((e,n)=>{if(!e||!t.current)return
487const a=p(e,t.current)
488r(a),n?.(e)}),[t]),v=(0,a.useCallback)((()=>{if(g.current||!f.current||!t.current||!n)return
489const e=f.current.getBoundingClientRect(),a=d(e,n,{checkBottom:!0})
490if(a){const{x:t,y:r}=h(e,a,n)
491l((e=>({x:e.x+t,y:e.y+r})))}}),[n,t]),b=(0,a.useCallback)(((e,t)=>{g.current=!0,m(t.node)}),[m]),y=(0,a.useCallback)(((e,t)=>{if(g.current=!1,!t.node||!n)return
492const a=t.node.getBoundingClientRect(),r=d(a,n,{checkBottom:!1})
493if(r){const{x:e,y:i}=h(a,r,n)
494l({x:t.x+(t.deltaX||0)+e,y:t.y+(t.deltaY||0)+i})}}),[n]),x=(0,a.useCallback)(((e,t)=>l({x:t.x,y:t.y})),[])
495return(0,a.useEffect)((()=>{const e=(0,o.A)((()=>{m(f.current,(e=>{y(null,{node:e,x:i.x,y:i.y,deltaX:0,deltaY:0,lastX:i.x,lastY:i.y})})),g.current=!1}),200,{leading:!1,trailing:!0}),t=()=>{g.current=!0,e()}
496return window.addEventListener("resize",t),()=>{e.cancel(),window.removeEventListener("resize",t)}}),[m,y,i]),(0,a.useEffect)((()=>{const e=t.current
497if(!e)return
498let n=!1
499const a=(0,o.A)((()=>{n=!1}),150),i=()=>{n=!0,a()},s=new ResizeObserver((()=>
499{if(n)return
500if(!f.current)return
501const t=p(f.current,e)
502r(t)}))
503return window.addEventListener("scroll",i,!0),s.observe(e),()=>{window.removeEventListener("scroll",i,!0),a.cancel(),s.unobserve(e)}}),[n,t]),(0,a.useEffect)((()=>{const e=new ResizeObserver(v),t=f.current
504return t&&e.observe(t),()=>{t&&e.unobserve(t)}}),[v]),(0,a.useEffect)((()=>{t.current&&(t.current.id||=(0,s.A)("drag-anchor-"))}),[t]),(0,a.useEffect)((()=>{const e=setTimeout((()=>{if(f.current&&t.current){const e=f.current.getBoundingClientRect(),n=p(f.current,t.current)
505if(r(n),e.bottom>window.innerHeight)l({x:0,y:window.innerHeight-e.bottom})
506else{const t=d(e,n)
507if(t){const{x:a,y:r}=h(e,t,n)
508l({x:a,y:r})}}}}),10)
509return()=>clearTimeout(e)}),[t]),(0,u.jsx)(c(),{handle:t.current?.id?`#${t.current.id}`:void 0,position:i,onStart:b,onStop:y,onDrag:x,children:(0,u.jsx)("div",{ref:f,children:e})})}var f=n(30202),m=n(64948),v=n(61678)
510function b(e){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"dali-settingslayer-title",ref:e.forwardedRef,onDragOverCapture:v.A,children:(0,u.jsxs)("span",{children:[e.title,e.explanation?(0,u.jsx)(m.m,{content:e.explanation}):null]})}),(0,u.jsxs)("div",{className:"dali-settingslayer-main",onDragOverCapture:v.A,children:[e.tabs&&(0,u.jsx)("div",{className:"dali-settingslayer-tabs",children:e.tabs.map((e=>(0,u.jsx)("button",{type:"button",className:(0,i.A)([`dali-settingslayer-tabs-${(0,r.A)(e.name)}`,{active:e.active}]),"data-testid":`settings-layer-tab-${(0,r.A)(e.name)}`,title:e.title,onClick:()=>e.onClick(e.name)},e.name)))}),e.tabs?(0,u.jsx)("scroll-shadow",{children:(0,u.jsx)("div",{className:"dali-settingslayer-main-content",children:e.body})}):e.body]}),e.footer&&(0,u.jsx)("div",{className:"dali-settingslayer-footer",onDragOverCapture:v.A,children:e.footer})]})}const y=(0,a.forwardRef)(((e,t)=>(0,u.jsx)(b,{...e,forwardedRef:t})))
511function x({onActiveStateChange:e,children:t,className:n,onEscapeKeyDown:r,hideArrow:o=!0,virtualRef:s,open:l,side:c,align:d="start",draggable:p=!0,sideOffset:h=40}){const m=(0,a.useRef)(null),[v,b]=(0,a.useState)(!1),x=(0,a.useRef)(null);(0,a.useEffect)((()=>{const t=t=>{if(x.current){!x.current.contains(t.target)&&(b(!1),e?.(!1))}}
512return b(!!l),e?.(!!l),window.addEventListener("mousedown",t),()=>window.removeEventListener("mousedown",t)}),[l,e])
513const C=(0,u.jsx)("div",{ref:x,className:(0,i.A)(["dali-settingslayer-container",{"dali-settingslayer-active":v}]),onMouseDown:()=>{b(!0),e?.(!0)},children:(0,u.jsx)("div",{className:(0,i.A)(["dali-settingslayer"]),children:"function"==typeof t?t({renderLayout:({title:e,explanation:t,tabs:n,body:a,footer:r}={})=>(0,u.jsx)(y,{ref:m,title:e,explanation:t,tabs:n,body:a,footer:r})}):t})})
514return(0,u.jsx)(f.A,{open:l,className:n,side:c,align:d,virtualRef:s,sideOffset:h,hideArrow:o,onEscapeKeyDown:e=>{r?.(e)},draggable:p,usePortal:!0,zIndex:0,children:p?(0,u.jsx)(g,{dragAnchorRef:m,children:C}):C})}y.displayName="SettingsLayerLayout"},64982:(e,t,n)=>{"use strict"
515n.r(t),n.d(t,{default:()=>m})
516n(39155),n(98357),n(76881)
517var a=n(12259),r=n(84507),i=n(48431),o=n(14953),s=n.n(o),l=n(51769),c=n(42295)
518var u=n(12086),d=n(557),p=n(81909),h=n(81715)
519const g={collectionIdSettings:function({t:e,categoryOptions:t}){const n=[{value:"",label:e("collectionDropdown.loadingPlaceholder")}]
520return(0,c.jsx)(l.A,{name:"categoryId",tagName:"label",label:e("collectionDropdown.label"),children:(0,c.jsx)(a.DropDownField,{name:"categoryId",options:t||n,className:"ep-form-select"})})},collectionProductSizeSettings:function({t:e}){const t=[{label:e("imageSize.options.S"),value:"S"},{label:e("imageSize.options.M"),value:"M"},{label:e("imageSize.options.L"),value:"L"}]
521return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"ep-form-row",children:(0,c.jsx)("span",{children:e("imageSize.explanation")})}),(0,c.jsx)(l.A,{name:"imageSize",label:e("imageSize.label"),children:(0,c.jsx)(a.RadioButtonField,{className:"dali-settingslayer-category-image-size",name:"imageSize",buttons:t})})]})}},f=e=>t=>{e(t.set("pageSize","S"===t.get("imageSize")?15:12))}
522function m({data:e,onCancel:t,onSave:n,onDataChange:o,renderLayout:l}){const m=(0,d.WD)("interface"),v=e=>
522m(`components.collectionComponent.settingsModal.${e}`),b=(0,r.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),y=(0,r.wA)();(0,i.useEffect)((()=>{b&&y((0,u.d4c)())}),[y,b])
523const x=(0,r.d4)((e=>e.get("categoriesList"))),C=x.size?x.valueSeq().map((e=>{const t=e.get("type")?`${e.get("name")} (${e.get("type")})`:e.get("name")
524return{value:e.get("id"),label:t}})).toJS():null,D=e.set("imageSize",e.get("imageSize","M")).set("categoryId",C?e.get("categoryId"):"")
525C&&!e.get("categoryId")&&C.unshift({value:"",label:v("collectionDropdown.defaultOption")})
526const[w,A]=(0,i.useState)(b?Object.keys(g)[0]:"collectionProductSizeSettings"),E=g[w]
527return(0,c.jsx)(a.Form,{name:"pluginCategory",value:D,validate:e=>s().fromJS({categoryId:b?!e.get("categoryId")&&v("collectionDropdown.validationMessage"):null}),onSubmit:f(n),onChange:f(o),children:l({title:w===Object.keys(g)[0]?e.get("categoryId")?v("title.onEdit"):v("title.onCreate"):v(`${w}.title`),tabs:Object.keys(g).filter((e=>b||"collectionProductSizeSettings"===e)).map((e=>({name:e,title:v(`${e}.title`),active:w===e,onClick:e=>A(e)}))),body:(0,c.jsx)(E,{t:v,categoryOptions:C}),footer:(0,c.jsxs)(h.A,{children:[(0,c.jsx)(p.A,{variant:"outline",type:"button",onClick:t,children:v("cancelButton.label")}),(0,c.jsx)(p.A,{children:v("saveButton.label")})]})})})}},77472:(e,t,n)=>{"use strict"
528n.d(t,{A:()=>s})
529n(39155),n(76881),n(79826)
530var a=n(48431),r=n(91121),i=n(30202),o=n(42295)
531function s({selectedIndex:e=0,defaultIndex:t=0,options:n,renderOption:s,showSelectedInList:l=!1,renderSelectedOption:c=null,disabled:u=!1,onChange:d=()=>null,name:p=null,className:h}){const[g,f]=(0,a.useState)(!1),m=(0,a.useRef)(null);(0,a.useEffect)((()=>{if(!g||!m.current)return
532let e=m.current.parentElement
533for(;e;){const{overflowY:t}=window.getComputedStyle(e)
534if("auto"===t||"scroll"===t){const t=e,n=()=>f(!1)
535return t.addEventListener("scroll",n),window.addEventListener("resize",n),()=>{t.removeEventListener("scroll",n),window.removeEventListener("resize",n)}}e=e.parentElement}}),[g])
536const v=()=>{f(!1)},b=!u&&g,y=n.get(e,n.get(t)),x=c&&"function"==typeof c?c:s,C=(0,o.jsxs)("button",{type:"button",className:"ep-custom-select",disabled:u,children:[(0,o.jsx)("div",{className:"ep-custom-select-alignment",children:x(y)}),(0,o.jsx)("span",{className:(0,r.A)({open:g})})]})
537return(0,o.jsx)("div",{ref:m,"data-name":p,className:h,children:(0,o.jsx)(i.A,{trigger:C,open:g,onOpenChange:e=>f(e),side:"bottom",align:"start",className:"ep-custom-select-options",sideOffset:0,hideArrow:!0,children:b&&(0,o.jsx)("ul",{className:"ep-custom-select-list",children:n.map(s).toArray().map(((t,n)=>(l||n!==e)&&t?(0,o.jsx)("li",{className:"ep-custom-select-list-item",role:"option","aria-selected":e===n,onClick:e=>{e.preventDefault(),d(n),v()},tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d(n),v())},children:(0,o.jsx)("button",{className:"ep-custom-select-option",children:t})},n):null))})})})}},58075:(e,t,n)=>{"use strict"
538n.d(t,{A:()=>H})
539n(39155),n(98357),n(76672),n(76881)
540var a=n(14953),r=n(12259),i=n(48431),o=n(43081),s=n(73025),l=n(22460),c=n(73348),u=n(70640),d=n(82096),p=n(43343),h=n(10964)
541const g=d.A&&1/(0,h.A)(new d.A([,-0]))[1]==1/0?function(e){return new d.A(e)}:p.A
542const f=function(e,t,n){var a=-1,r=l.A,i=e.length,o=!0,d=[],p=d
543if(n)o=!1,r=c.A
544else if(i>=200){var f=t?null:g(e)
545if(f)return(0,h.A)(f)
546o=!1,r=u.A,p=new s.A}else p=t?[]:d
547e:for(;++a<i;){var m=e[a],v=t?t(m):m
548if(m=n||0!==m?m:0,o&&v==v){for(var b=p.length;b--;)if(p[b]===v)continue e
549t&&p.push(v),d.push(m)}else r(p,v,n)||(p!==d&&p.push(v),d.push(m))}return d}
550const m=function(e){return e&&e.length?f(e):[]}
551var v=n(86521),b=n(79673),y=n(43182),x=n(13655)
552const C=(0,b.A)((function(e){var t=(0,x.A)(e)
553return t="function"==typeof t?t:void 0,f((0,v.A)(e,1,y.A,!0),void 0,t)}))
554var D=n(91121),w=(n(7121),n(98456),n(46288)),A=n(80142)
555async function E(e){return new Promise((function(t,n){try{const a=document.createElement("img")
556a.onload=function(){const e=document.createElement("canvas"),n=e.getContext("2d")
557e.width=240,e.height=e.width*a.height/a.width,n?.drawImage(a,0,0,e.width,e.height),t(e.toDataURL())},a.onerror=n,a.src=URL.createObjectURL(e)}catch(e){n(e)}}))}const j={files:{pending:[],uploading:[],completed:[]},isProcessing:!1,messages:[]}
558let B=function(e){return e.PENDING="PENDING",e.UPLOADING="UPLOADING",e.COMPLETED="COMPLETED",e}({})
559var k=function(e){return e.ADD_FILES="ADD_FILES",e.EDIT_FILE="EDIT_FILE",e.SET_PROCESSING="SET_PROCESSING",e.UPDATE_UPLOADING_FILE="UPDATE_UPLOADING_FILE",e.UPDATE_FILE_PERCENTAGE="UPDATE_FILE_PERCENTAGE",e.MOVE_TO_LOADING="MOVE_TO_LOADING",e.MOVE_TO_COMPLETED="MOVE_TO_COMPLETED",e.DELETE_FILE="DELETE_FILE",e.ADD_MESSAGE="ADD_MESSAGE",e}(k||{})
560const S=(e,t)=>{switch(t.type){case k.ADD_MESSAGE:return{...e,messages:[...e.messages,t.value]}
561case k.EDIT_FILE:{const n=e=>e.id===t.value.get("id")?t.value.toJS():e
562return{...e,files:{pending:e.files.pending.map(n),uploading:e.files.uploading.map(n),completed:e.files.completed.map(n)}}}case k.DELETE_FILE:{const n=e=>e.id!==t.value
563return{...e,files:{pending:e.files.pending.filter(n),uploading:e.files.uploading.filter(n),completed:e.files.completed.filter(n)}}}case k.ADD_FILES:return{...e,files:{...e.files,pending:e.files.pending.concat(t.value)}}
564case k.SET_PROCESSING:return{...e,isProcessing:t.value}
565case k.UPDATE_UPLOADING_FILE:{const n=e.files.uploading.map((e=>e.id===t.value.id?t.value:e))
566return{...e,files:{...e.files,uploading:n}}}case k.UPDATE_FILE_PERCENTAGE:{const n=e.files.uploading.map((e=>(e.id===t.value.id&&(e.percentage=t.value.percentage),e)))
567return{...e,files:{...e.files,uploading:n}}}case k.MOVE_TO_LOADING:{const n=e.files.pending.find((e=>e.id===t.value))
568if(!n)return e
569n.status=B.UPLOADING
570const a=e.files.pending.filter((e=>
570e.id!==n.id)),r=e.files.uploading.concat([n])
571return{...e,files:{...e.files,pending:a,uploading:r}}}case k.MOVE_TO_COMPLETED:{const n=e.files.uploading.find((e=>e.id===t.value))
572if(!n)return e
573n.status=B.COMPLETED
574const a=e.files.uploading.filter((e=>e.id!==n.id)),r=e.files.completed.concat([n])
575return{...e,files:{...e.files,uploading:a,completed:r}}}}},N=e=>{const[t,n]=(0,i.useReducer)(S,j),a=(0,i.useRef)(void 0);(0,i.useEffect)((()=>{t.files.pending.length&&t.files.uploading.length<4&&o(t.files.pending[0])}),[t])
576const r=async(e,t)=>{const n=A.A.CancelToken.source()
577return{id:(0,w.A)(),position:Date.now()+t,originalFile:e,localPreview:await E(e).catch((()=>{})),fileName:e.name,mediaType:e.type,percentage:0,status:B.PENDING,cancelToken:n,alt:"",link:"",opentab:!1}},o=async t=>{n({type:k.MOVE_TO_LOADING,value:t.id})
578const a={onUploadProgress:e=>{const a=Math.round(100*e.loaded/e.total)
579a-t.percentage>10&&n({type:k.UPDATE_FILE_PERCENTAGE,value:{id:t.id,percentage:a}})},cancelToken:t.cancelToken.token}
580try{const r=await e(t.originalFile,a),i=Object.assign({},t,r)
581i.src=r.absoluteDownloadUrl,n({type:k.UPDATE_UPLOADING_FILE,value:i}),n({type:k.MOVE_TO_COMPLETED,value:t.id})}catch(e){n({type:k.ADD_MESSAGE,value:{fileName:t.fileName,err:e}}),n({type:k.DELETE_FILE,value:t.id})}}
582return[t.files,async e=>{a.current=window.setTimeout((()=>{n({type:k.SET_PROCESSING,value:!0})}),500)
583const t=[]
584for(const n of e){const a=await r(n,e.indexOf(n))
585t.push(a)}n({type:k.ADD_FILES,value:t}),a.current&&(clearTimeout(a.current),a.current=0,n({type:k.SET_PROCESSING,value:!1}))},t.isProcessing,t.messages,e=>n({type:k.DELETE_FILE,value:e}),e=>n({type:k.EDIT_FILE,value:e})]}
586var F=n(38169),O=n(30202),M=n(17312),P=n(81909),T=n(47430),I=n(42295)
587function R(e){const{percentage:t,color:n="white",radius:a=30,strokeWidth:r=4}=e,i=(0,T.g)({style:"percent"}).format(t/100),o=2*a*Math.PI,s=o-t/100*o
588return(0,I.jsxs)("svg",{className:"progress-ring",width:"90",height:"90",children:[(0,I.jsx)("circle",{className:"progress-ring-background",fill:"none",stroke:"grey",strokeWidth:r,r:a,cx:"45",cy:"45"}),(0,I.jsx)("circle",{className:"progress-ring-front",fill:"none",stroke:n,strokeWidth:r,strokeDasharray:o+" "+o,strokeDashoffset:s,r:a,cx:"45",cy:"45"}),(0,I.jsx)("text",{x:"50%",y:"50%",dy:"5",fill:n,textAnchor:"middle",children:i})]})}var L,_=n(75655),$=n(90700)
589const z={413:"requestEntityTooLarge",415:"unsupportedMediaType"}
590function W({t:e,errors:t,helpCenterUrl:n}){const a={}
591return t.forEach((e=>{const t=(e=>{if(!e)return"unknown"
592if((0,o.FZ)(e))return"requestCanceled"
593const t=e
594return t.response?.data?.message?.startsWith("Animated image has too many frames.")?"gifHasTooManyFrames":t.response?.data?.message?.startsWith("Uploaded image resolution across all frames is too big.")?"imageResolutionTooBig":t.response&&z[t.response?.status]||"unknown"})(e.err)
595"requestCanceled"!==t&&(a[t]=m([...a[t]||[],e.fileName]))})),0===Object.keys(a).length?null:(0,I.jsx)("scroll-shadow",{class:"dali-settingslayer-error-shadow",children:(0,I.jsx)("div",{className:"dali-settingslayer-error",role:"alert",children:Object.keys(a).map((t=>(0,I.jsxs)("div",{children:[(0,I.jsxs)("p",{children:[e("errorMessages.message",{reason:e(`errorMessages.reason.${t}`)}),"gifHasTooManyFrames"!==t&&"imageResolutionTooBig"!==t&&(0,I.jsx)("a",{href:n,target:"_blank",className:"ep-form-row-text-external-link",rel:"noreferrer noopener",children:e("errorMessages.helpCenterLink")})]}),(0,I.jsx)("ul",{children:a[t].map((e=>(0,I.jsx)("li",{children:e},e)))})]},t)))})})}function U(e,t){return!(!e.id&&!t.id)&&e.id===t.id}const V=(0,i.forwardRef)(((e,t)=>{var n,r,o
596const{data:s,setFooterInfo:l,setIsSaveDisabled:c,onBusyStateChange:u,onChange:d,storeFile:p,imageUrl:h,previewUrl:g,maximumNumberOfImages:f,EditPopoverComponent:m,popoverClassName:v,t:b}=e,y=(0,i.useRef)(new Map),x=(0,_.A)("IMAGE_GALLERY"),[w,A,E,j,k,S]=N(p),T=function(e){return e.get("images",(0,a.List)()).toJS().filter((e=>void 0===e.id))}(s),z=T.concat(w.pending,w.uploading,w.completed).sort(((e,t)=>e.position-t.position)),V=(0,$.A)(w.completed),[H,K]=(0,i.useState)(null),q=w.pending.length>0||w.uploading.length>0,G=(0,i.useRef)(null);(0,i.useEffect)((()=>{u(q),w.completed.length===V?.length||q||d(s.set("images",(0,a.fromJS)(C(T,w.completed,U))))}),[w,q,T,V,s,d,u]),(0,i.useEffect)((()=>{const e=z.length||0
597c(q||e>f)}),[q,z.length,c,f])
598const Y=e=>{e.preventDefault()
599const t=Array.from(e.dataTransfer?.files||e.target.files)
600A(t)},J=e=>{const t=s.update("images",(t=>t.map((t=>t.get("position")===H?e:t))))
601S(e),d(t),K(null)},X=()=>{K(null)},Q=e=>{const t=e.dataTransfer?.items?.[0],n=void 0===e.dataTransfer?.items,a=window.dali.globalDragData
602e.preventDefault(),e.dataTransfer.dropEffect=n&&!a||t&&!(0,M.Df)(t)?"copy":"none"},Z=e=>{e.target.src.includes("&reload=1")||(e.target.src=`${e.target.src}&reload=1`)},ee=e=>{const t=e.localPreview?e.localPreview:e.src?g(h(e.src)):"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
603return(0,I.jsx)("div",{children:(0,I.jsxs)("div",{className:"image-preview",ref:t=>{t?y.current.set(e.position,t):y.current.delete(e.position)},children:[(0,I.jsx)("img",{src:t,alt:e.alt,onError:Z}),(0,I.jsxs)("div",{className:"image-button-wrapper",children:[(0,I.jsx)(P.A,{type:"button",variant:"circular",icon:"edit",title:b("editImageButton.tooltip"),onClick:()=>{return t=e.position,void K(t)
604var t}}),(0,I.jsx)(P.A,{variant:"circular",icon:"delete",title:b("deleteImageButton.tooltip"),onClick:()=>(e=>{const t=s.get("images").filter((t=>t.get("position")!==e.position))
605d(s.set("images",t)),k(e.id),l("delete")})(e),type:"button"})]}
605),(e.status===B.PENDING||e.status===B.UPLOADING)&&(0,I.jsxs)("div",{className:"image-loading-indicator",children:[(0,I.jsx)(R,{percentage:e.percentage}),(0,I.jsx)("button",{onClick:()=>e.cancelToken.cancel(),type:"button",children:b("cancelUpload.label")})]}),(0,I.jsx)(O.A,{open:H===e.position,onOpenChange:e=>{e||X()},className:v,side:"left",align:"start",sideOffset:-5,virtualRef:{current:y.current.get(e.position)},avoidCollisions:!0,usePortal:!0,children:H&&(r||(r=(0,I.jsx)(m,{data:s,selectedImagePosition:H,storeFile:p,imageUrl:h,previewUrl:g,onApply:J,onCancel:X,helpCenterUrl:x})))})]})},e.position)}
606return(0,I.jsxs)("div",{className:"image-field-multiple",children:[E?L||(L=(0,I.jsx)("div",{className:"image-busy-indicator",children:(0,I.jsx)("span",{className:"image-spinner"})})):z.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("scroll-shadow",{children:(0,I.jsx)("div",{className:"grid",children:z.map(ee)})}),(0,I.jsx)("div",{className:"footer",children:(0,I.jsx)(F.S,{onUnsplashSelect:e=>A([e]),onUploadClick:()=>G.current?.click(),buttonContent:(0,I.jsx)("span",{children:b("addImagesButton.label")}),buttonClassName:"upload-button"})}),o||(o=(0,I.jsx)(W,{t:b,errors:j,helpCenterUrl:x}))]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"image-default image-dropzone",onDragOver:Q,onDrop:Y,children:[(0,I.jsx)("span",{className:(0,D.A)(["dali-grid-element-placeholder-icon","LogoEditPopover"===m.name?"dali-plugin-logo-placeholder-icon":"dali-plugin-image-placeholder-icon"])}),(0,I.jsx)("div",{className:"dali-grid-element-placeholder-info",children:b("explanation")}),(0,I.jsx)(F.S,{onUnsplashSelect:e=>A([e]),onUploadClick:()=>G.current?.click(),buttonContent:(0,I.jsx)("span",{children:b("addImagesButton.label")}),buttonClassName:"ep-button ep-button-primary"})]}),n||(n=(0,I.jsx)(W,{t:b,errors:j,helpCenterUrl:x}))]}),(0,I.jsx)("input",{ref:G,type:"file",multiple:!0,accept:M.m_.join(","),onChange:Y,value:"","data-testid":"uploadField"})]})}))
607V.displayName="ImageFieldMultipleRaw"
608const H=(0,r.formField)()(V)},34097:(e,t,n)=>{"use strict"
609n.d(t,{A:()=>u})
610var a=n(12259),r=n(91121),i=n(557),o=n(51769),s=n(62929),l=n(81671),c=n(42295)
611function u({config:e,handleError:t,imageInfo:n}){var u
612const d=Boolean(n?.isSlider),p=d?"contentSliderComponent":"imageElementComponent",h=!n?.src,g=(0,i.WD)("interface",`components.${p}.settingsModal`),f=d&&[{label:g("imageAlignment.options.top"),value:"top"},{label:g("imageAlignment.options.bottom"),value:"bottom"},{label:g("imageAlignment.options.center"),value:"center"}]
613return(0,c.jsxs)(c.Fragment,{children:[d&&(0,c.jsx)("div",{className:"ep-form-row",children:(0,c.jsx)(s.Ay,{name:"imageData",storeFile:e.storeFile,imageUrl:e.imageUrl,previewUrl:e.previewUrl,onError:e=>t({error:e}),onChange:()=>t({error:null})||!0,showDeleteButton:d,className:(0,r.A)([{"dali-settingslayer-element":d}])})}),f?(0,c.jsx)(o.A,{name:"alignment",label:g("imageAlignment.label"),className:(0,r.A)([{disabled:h}]),children:u||(u=(0,c.jsx)(a.RadioButtonField,{className:"dali-settingslayer-contentslider-image-alignment",name:"alignment",buttons:f,disabled:h}))}):null,(0,c.jsx)(o.A,{info:g("alternativeTextInputField.explanation"),name:"alt",tagName:"label",label:g("alternativeTextInputField.label"),className:(0,r.A)([{disabled:h}]),disabled:h,children:(0,c.jsx)(l.A,{autoFocus:!0,name:"alt",type:"text",disabled:h})})]})}},28321:(e,t,n)=>{"use strict"
614n.d(t,{A:()=>y,D:()=>b})
615n(39155),n(28383)
616var a=n(12259),r=n(84507),i=n(91121),o=n(65736),s=n(44420),l=n(557),c=n(9926),u=n(77472),d=n(51769),p=n(51546),h=n(42295)
617const g=["textColor","buttonColor","backgroundColor"],f={textColor:["text","headline"],buttonColor:["buttontext"],backgroundColor:["text","headline","buttontext"]},m=(e,t)=>!f[e]?.some((e=>t.get(e)))
618function v({color:e}){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{className:"ep-custom-color-field",style:{backgroundColor:e.get("value")}}),(0,h.jsx)("label",{className:"ep-custom-select-label",children:e.get("name")})]})}function b({value:e,name:t,setValue:n,disabled:r,min:o=0,max:s=100,step:l=1,label:c=""}){const u={"--min":o,"--max":s,"--val":e},d=`${t}-input`
619return(0,h.jsxs)("div",{className:(0,i.A)(["ep-form-row",{disabled:r}]),children:[c&&(0,h.jsx)("label",{htmlFor:d,className:"dali-settingslayer
619-label",children:c}),(0,h.jsxs)("div",{className:"dali-range-input-with-numeric",children:[(0,h.jsx)(a.RangeField,{className:"dali-range-input",min:o,name:t,max:s,step:l,disabled:r,value:e,style:u}),(0,h.jsx)("input",{id:d,type:"number",className:"dali-range-output",min:o,max:s,step:l,disabled:r,value:e,onChange:e=>n(Number(e.target.value))})]})]})}function y({imageInfo:e,textPersistanceInfo:t,componentName:n}){const a=!e?.src||!t.some((e=>Boolean(e))),[f]=(0,r.d4)((e=>e.getIn(["shop","theme","name"]).split(s.ko))),y=(0,l.WD)("interface"),x=(e,...t)=>y(`components.${n}.settingsModal${"heroImageElementComponent"===n?".imageTextColorSettings":""}.${e}`,...t),C=(0,o.L0)(x,((e,...t)=>y(`themes:${f.replace(".","_")}.settings.${e}`,...t)))
620return(0,h.jsxs)(h.Fragment,{children:[g.map((e=>(0,h.jsx)(d.A,{className:(0,i.A)({disabled:a||m(e,t)}),name:`${e}Index`,tagName:"label",label:x(e),children:(0,h.jsx)(p.A,{children:(n,r)=>(0,h.jsx)(u.A,{name:e,className:"ep-image-text-color-select",selectedIndex:n,defaultIndex:o.xK.get(`${e}Index`),options:C,onChange:r,disabled:a||m(e,t),renderOption:e=>(0,h.jsx)(v,{color:e})})})},e))),(0,h.jsx)(p.A,{name:"overlayOpacity",children:(e,t)=>(0,h.jsx)(b,{name:"overlayOpacity",label:x("overlayOpacityInputField.label"),value:e,setValue:t,disabled:a})}),"heroImageElementComponent"===n&&(0,h.jsxs)("div",{className:(0,i.A)(["ep-form-row",a&&"disabled"]),children:[(0,h.jsx)(p.A,{name:"overlayBlur",children:(e,t)=>(0,h.jsx)(c.A,{id:"overlayBlur",name:"overlayBlur",value:e,setValue:t,disabled:a})}),(0,h.jsx)("label",{className:"dali-settingslayer-label",htmlFor:"overlayBlur",children:y("components.heroImageElementComponent.settingsModal.imageTextColorSettings.overlayBlurCheckbox.label")})]})]})}},94420:(e,t,n)=>{"use strict"
621n.d(t,{A:()=>d})
622var a=n(91121),r=n(557),i=n(9926),o=n(51769),s=n(51546),l=n(81671),c=n(34990),u=n(42295)
623function d({imageInfo:e,componentName:t}){const n=!e?.src,d=(0,r.WD)("interface",`components.${t}.settingsModal${"heroImageElementComponent"===t?".imageTextSettings":""}`)
624return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(o.A,{className:(0,a.A)([{disabled:n}]),name:"headline",tagName:"label",label:d("headlineInputField.label"),children:(0,u.jsx)(l.A,{autoFocus:!0,name:"headline",type:"text",disabled:n})}),(0,u.jsx)(o.A,{className:(0,a.A)([{disabled:n}]),name:"text",tagName:"label",label:d("textInputField.label"),children:(0,u.jsx)(l.A,{name:"text",type:"text",disabled:n})}),(0,u.jsx)(s.A,{name:"link",children:(e,t)=>{const r=Boolean(e)
625return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(c.A,{t:d,link:e,setLink:t,label:"linkInputField.label",disabled:n}),(0,u.jsx)(o.A,{className:(0,a.A)(["ep-form-row-min-margin",{disabled:!r||n}]),name:"opentab",tagName:"label",label:d("openLinkInNewTabCheckbox.label"),labelAfterComponent:!0,children:(0,u.jsx)(i.A,{name:"opentab",disabled:!r||n})}),(0,u.jsx)(s.A,{name:"buttonenabled",children:e=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(o.A,{className:(0,a.A)([{disabled:!r||n}]),name:"buttonenabled",tagName:"label",label:d("buttonenabledInputFieldCheckbox.label"),labelAfterComponent:!0,children:(0,u.jsx)(i.A,{name:"buttonenabled",disabled:!r||n})}),(0,u.jsx)(o.A,{className:(0,a.A)({disabled:!e}),name:"buttontext",tagName:"label",label:d("buttonTextInputField.label"),children:(0,u.jsx)(l.A,{name:"buttontext",type:"text",disabled:!e})})]})})]})}})]})}},29259:(e,t,n)=>{"use strict"
626n.d(t,{HV:()=>o,S_:()=>p,Sn:()=>i,Sv:()=>r,U3:()=>c,aL:()=>s,en:()=>a,l:()=>u,n6:()=>l,ue:()=>d})
627const a="Pages",r="Products",i="SET_IS_VIEW_MODE",o="SET_LINK_DETAILS",s="SET_CATEGORY_STATE",l="SET_IS_EDITING",c="SET_ERROR_STATE",u={selectedCategory:null,showCategories:!0,searchCategory:null},d={url:"",title:"",type:"",inputValue:"",searchTerm:"",isExternalLink:!1,isViewMode:!1,isEditing:!1},p={hasError:!1}},56641:(e,t,n)=>{"use strict"
628n.d(t,{MP:()=>ae,LV:()=>oe,a$:()=>ne,j:()=>le,SW:()=>re,dY:()=>se,J3:()=>ce})
629n(7121),n(39155),n(76672),n(76881),n(61529)
630var a=n(52763),r=n(53835),i=n(48225),o=n(25312),s=n(48431)
631
632;/**
633 * Fuse.js v7.1.0 - Lightweight fuzzy-search (http://fusejs.io)
634 *
635 * Copyright (c) 2025 Kiro Risk (http://kiro.me)
636 * All Rights Reserved. Apache Software License 2.0
637 *
638 * http://www.apache.org/licenses/LICENSE-2.0
639 */
640function l(e){return Array.isArray?Array.isArray(e):"[object Array]"===f(e)}function c(e){return"string"==typeof e}function u(e){return"number"==typeof e}function d(e){return!0===e||!1===e||function(e){return p(e)&&null!==e}(e)&&"[object Boolean]"==f(e)}function p(e){return"object"==typeof e}function h(e){return null!=e}function g(e){return!e.trim().length}
640function f(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const m=Object.prototype.hasOwnProperty
641class v{constructor(e){this._keys=[],this._keyMap={}
642let t=0
643e.forEach((e=>{let n=b(e)
644this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function b(e){let t=null,n=null,a=null,r=1,i=null
645if(c(e)||l(e))a=e,t=y(e),n=x(e)
646else{if(!m.call(e,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"))
647const o=e.name
648if(a=o,m.call(e,"weight")&&(r=e.weight,r<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(o))
649t=y(o),n=x(o),i=e.getFn}return{path:t,id:n,weight:r,src:a,getFn:i}}function y(e){return l(e)?e:e.split(".")}function x(e){return l(e)?e.join("."):e}var C={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(e,t){let n=[],a=!1
650const r=(e,t,i)=>{if(h(e))if(t[i]){const o=e[t[i]]
651if(!h(o))return
652if(i===t.length-1&&(c(o)||u(o)||d(o)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e
653let t=e+""
654return"0"==t&&1/e==-1/0?"-0":t}(e)}(o))
655else if(l(o)){a=!0
656for(let e=0,n=o.length;e<n;e+=1)r(o[e],t,i+1)}else t.length&&r(o,t,i+1)}else n.push(e)}
657return r(e,c(t)?t.split("."):t,0),a?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}}
658const D=/[^ ]+/g
659class w{constructor({getFn:e=C.getFn,fieldNormWeight:t=C.fieldNormWeight}={}){this.norm=function(e=1,t=3){const n=new Map,a=Math.pow(10,t)
660return{get(t){const r=t.match(D).length
661if(n.has(r))return n.get(r)
662const i=1/Math.pow(r,.5*e),o=parseFloat(Math.round(i*a)/a)
663return n.set(r,o),o},clear(){n.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,c(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size()
664c(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1)
665for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!h(e)||g(e))return
666let n={v:e,i:t,n:this.norm.get(e)}
667this.records.push(n)}_addObject(e,t){let n={i:t,$:{}}
668this.keys.forEach(((t,a)=>{let r=t.getFn?t.getFn(e):this.getFn(e,t.path)
669if(h(r))if(l(r)){let e=[]
670const t=[{nestedArrIndex:-1,value:r}]
671for(;t.length;){const{nestedArrIndex:n,value:a}=t.pop()
672if(h(a))if(c(a)&&!g(a)){let t={v:a,i:n,n:this.norm.get(a)}
673e.push(t)}else l(a)&&a.forEach(((e,n)=>{t.push({nestedArrIndex:n,value:e})}))}n.$[a]=e}else if(c(r)&&!g(r)){let e={v:r,n:this.norm.get(r)}
674n.$[a]=e}})),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function A(e,t,{getFn:n=C.getFn,fieldNormWeight:a=C.fieldNormWeight}={}){const r=new w({getFn:n,fieldNormWeight:a})
675return r.setKeys(e.map(b)),r.setSources(t),r.create(),r}function E(e,{errors:t=0,currentLocation:n=0,expectedLocation:a=0,distance:r=C.distance,ignoreLocation:i=C.ignoreLocation}={}){const o=t/e.length
676if(i)return o
677const s=Math.abs(a-n)
678return r?o+s/r:s?1:o}const j=32
679function B(e,t,n,{location:a=C.location,distance:r=C.distance,threshold:i=C.threshold,findAllMatches:o=C.findAllMatches,minMatchCharLength:s=C.minMatchCharLength,includeMatches:l=C.includeMatches,ignoreLocation:c=C.ignoreLocation}={}){if(t.length>j)throw new Error(`Pattern length exceeds max of ${j}.`)
680const u=t.length,d=e.length,p=Math.max(0,Math.min(a,d))
681let h=i,g=p
682const f=s>1||l,m=f?Array(d):[]
683let v
684for(;(v=e.indexOf(t,g))>-1;){let e=E(t,{currentLocation:v,expectedLocation:p,distance:r,ignoreLocation:c})
685if(h=Math.min(e,h),g=v+u,f){let e=0
686for(;e<u;)m[v+e]=1,e+=1}}g=-1
687let b=[],y=1,x=u+d
688const D=1<<u-1
689for(let a=0;a<u;a+=1){let i=0,s=x
690for(;i<s;){E(t,{errors:a,currentLocation:p+s,expectedLocation:p,distance:r,ignoreLocation:c})<=h?i=s:x=s,s=Math.floor((x-i)/2+i)}x=s
691let l=Math.max(1,p-s+1),v=o?d:Math.min(p+s,d)+u,C=Array(v+2)
692C[v+1]=(1<<a)-1
693for(let i=v;i>=l;i-=1){let o=i-1,s=n[e.charAt(o)]
694if(f&&(m[o]=+!!s),C[i]=(C[i+1]<<1|1)&s,a&&(C[i]|=(b[i+1]|b[i])<<1|1|b[i+1]),C[i]&D&&(y=E(t,{errors:a,currentLocation:o,expectedLocation:p,distance:r,ignoreLocation:c}),y<=h)){if(h=y,g=o,g<=p)break
695l=Math.max(1,2*p-g)}}if(E(t,{errors:a+1,currentLocation:p,expectedLocation:p,distance:r,ignoreLocation:c})>h)break
696b=C}const w={isMatch:g>=0,score:Math.max(.001,y)}
697if(f){const e=function(e=[],t=C.minMatchCharLength){let n=[],a=-1,r=-1,i=0
698for(let o=e.length;i<o;i+=1){let o=e[i]
699o&&-1===a?a=i:o||-1===a||(r=i-1,r-a+1>=t&&n.push([a,r]),a=-1)}return e[i-1]&&i-a>=t&&n.push([a,i-1]),n}(m,s)
700e.length?l&&(w.indices=e):w.isMatch=!1}return w}function k(e){let t={}
701for(let n=0,a=e.length;n<a;n+=1){const r=e.charAt(n)
702t[r]=(t[r]||0)|1<<a-n-1}return t}const S=String.prototype.normalize?e=>
702e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e
703class N{constructor(e,{location:t=C.location,threshold:n=C.threshold,distance:a=C.distance,includeMatches:r=C.includeMatches,findAllMatches:i=C.findAllMatches,minMatchCharLength:o=C.minMatchCharLength,isCaseSensitive:s=C.isCaseSensitive,ignoreDiacritics:l=C.ignoreDiacritics,ignoreLocation:c=C.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:a,includeMatches:r,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:l,ignoreLocation:c},e=s?e:e.toLowerCase(),e=l?S(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return
704const u=(e,t)=>{this.chunks.push({pattern:e,alphabet:k(e),startIndex:t})},d=this.pattern.length
705if(d>j){let e=0
706const t=d%j,n=d-t
707for(;e<n;)u(this.pattern.substr(e,j),e),e+=j
708if(t){const e=d-j
709u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:a}=this.options
710if(e=t?e:e.toLowerCase(),e=n?S(e):e,this.pattern===e){let t={isMatch:!0,score:0}
711return a&&(t.indices=[[0,e.length-1]]),t}const{location:r,distance:i,threshold:o,findAllMatches:s,minMatchCharLength:l,ignoreLocation:c}=this.options
712let u=[],d=0,p=!1
713this.chunks.forEach((({pattern:t,alphabet:n,startIndex:h})=>{const{isMatch:g,score:f,indices:m}=B(e,t,n,{location:r+h,distance:i,threshold:o,findAllMatches:s,minMatchCharLength:l,includeMatches:a,ignoreLocation:c})
714g&&(p=!0),d+=f,g&&m&&(u=[...u,...m])}))
715let h={isMatch:p,score:p?d/this.chunks.length:1}
716return p&&a&&(h.indices=u),h}}class F{constructor(e){this.pattern=e}static isMultiMatch(e){return O(e,this.multiRegex)}static isSingleMatch(e){return O(e,this.singleRegex)}search(){}}function O(e,t){const n=e.match(t)
717return n?n[1]:null}class M extends F{constructor(e,{location:t=C.location,threshold:n=C.threshold,distance:a=C.distance,includeMatches:r=C.includeMatches,findAllMatches:i=C.findAllMatches,minMatchCharLength:o=C.minMatchCharLength,isCaseSensitive:s=C.isCaseSensitive,ignoreDiacritics:l=C.ignoreDiacritics,ignoreLocation:c=C.ignoreLocation}={}){super(e),this._bitapSearch=new N(e,{location:t,threshold:n,distance:a,includeMatches:r,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class P extends F{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,n=0
718const a=[],r=this.pattern.length
719for(;(t=e.indexOf(this.pattern,n))>-1;)n=t+r,a.push([t,n-1])
720const i=!!a.length
721return{isMatch:i,score:i?0:1,indices:a}}}const T=[class extends F{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}
721search(e){const t=e===this.pattern
722return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},P,class extends F{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern)
723return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends F{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern)
724return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends F{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern)
725return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends F{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern)
726return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends F{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern)
727return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},M],I=T.length,R=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/
728const L=new Set([M.type,P.type])
729class _{constructor(e,{isCaseSensitive:t=C.isCaseSensitive,ignoreDiacritics:n=C.ignoreDiacritics,includeMatches:a=C.includeMatches,minMatchCharLength:r=C.minMatchCharLength,ignoreLocation:i=C.ignoreLocation,findAllMatches:o=C.findAllMatches,location:s=C.location,threshold:l=C.threshold,distance:c=C.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:a,minMatchCharLength:r,findAllMatches:o,ignoreLocation:i,location:s,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=n?S(e):e,this.pattern=e,this.query=function(e,t={}){return e.split("|").map((e=>{let n=e.trim().split(R).filter((e=>e&&!!e.trim())),a=[]
730for(let e=0,r=n.length;e<r;e+=1){const r=n[e]
731let i=!1,o=-1
732for(;!i&&++o<I;){const e=T[o]
733let n=e.isMultiMatch(r)
734n&&(a.push(new e(n,t)),i=!0)}if(!i)for(o=-1;++o<I;){const e=T[o]
735let n=e.isSingleMatch(r)
736if(n){a.push(new e(n,t))
737break}}}return a}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query
738if(!t)return{isMatch:!1,score:1}
739const{includeMatches:n,isCaseSensitive:a,ignoreDiacritics:r}=this.options
740e=a?e:e.toLowerCase(),e=r?S(e):e
741let i=0,o=[],s=0
742for(let a=0,r=t.length;a<r;a+=1){const r=t[a]
743o.length=0,i=0
744for(let t=0,a=r.length;t<a;t+=1){const a=r[t],{isMatch:l,indices:c,score:u}=a.search(e)
745if(!l){s=0,i=0,o.length=0
746break}if(i+=1,s+=u,n){const e=a.constructor.type
747L.has(e)?o=[...o,...c]:o.push(c)}}if(i){let e={isMatch:!0,score:s/i}
748return n&&(e.indices=o),e}}return{isMatch:!1,score:1}}}const $=[]
749function z(e,t){for(let n=0,a=$.length;n<a;n+=1){let a=$[n]
750if(a.condition(e,t))return new a(e,t)}return new N(e,t)}const W="$and",U="$or",V="$path",H="$val",K=e=>!(!e[W]&&!e[U]),q=e=>({[W]:Object.keys(e).map((t=>({[t]:e[t]})))})
751function G(e,t,{auto:n=!0}={}){const a=e=>{let r=Object.keys(e)
752const i=(e=>!!e[V])(e)
753if(!i&&r.length>1&&!K(e))return a(q(e))
754if((e=>!l(e)&&p(e)&&!K(e))(e)){const a=i?e[V]:r[0],o=i?e[H]:e[a]
755if(!c(o))throw new Error((e=>`Invalid value for key ${e}`)(a))
756const s={keyId:x(a),pattern:o}
757return n&&(s.searcher=z(o,t)),s}let o={children:[],operator:r[0]}
758return r.forEach((t=>{const n=e[t]
759l(n)&&n.forEach((e=>{o.children.push(a(e))}))})),o}
760return K(e)||(e=q(e)),a(e)}function Y(e,t){const n=e.matches
761t.matches=[],h(n)&&n.forEach((e=>{if(!h(e.indices)||!e.indices.length)return
762const{indices:n,value:a}=e
763let r={indices:n,value:a}
764e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}))}function J(e,t){t.score=e.score}class X{constructor(e,t={},n){this.options={...C,...t},this.options.useExtendedSearch,this._keyStore=new v(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof w))throw new Error("Incorrect 'index' type")
765this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){h(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[]
766for(let n=0,a=this._docs.length;n<a;n+=1){const r=this._docs[n]
767e(r,n)&&(this.removeAt(n),n-=1,a-=1,t.push(r))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}
767){const{includeMatches:n,includeScore:a,shouldSort:r,sortFn:i,ignoreFieldNorm:o}=this.options
768let s=c(e)?c(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e)
769return function(e,{ignoreFieldNorm:t=C.ignoreFieldNorm}){e.forEach((e=>{let n=1
770e.matches.forEach((({key:e,norm:a,score:r})=>{const i=e?e.weight:null
771n*=Math.pow(0===r&&i?Number.EPSILON:r,(i||1)*(t?1:a))})),e.score=n}))}(s,{ignoreFieldNorm:o}),r&&s.sort(i),u(t)&&t>-1&&(s=s.slice(0,t)),function(e,t,{includeMatches:n=C.includeMatches,includeScore:a=C.includeScore}={}){const r=[]
772return n&&r.push(Y),a&&r.push(J),e.map((e=>{const{idx:n}=e,a={item:t[n],refIndex:n}
773return r.length&&r.forEach((t=>{t(e,a)})),a}))}(s,this._docs,{includeMatches:n,includeScore:a})}_searchStringList(e){const t=z(e,this.options),{records:n}=this._myIndex,a=[]
774return n.forEach((({v:e,i:n,n:r})=>{if(!h(e))return
775const{isMatch:i,score:o,indices:s}=t.searchIn(e)
776i&&a.push({item:e,idx:n,matches:[{score:o,value:e,norm:r,indices:s}]})})),a}_searchLogical(e){const t=G(e,this.options),n=(e,t,a)=>{if(!e.children){const{keyId:n,searcher:r}=e,i=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:r})
777return i&&i.length?[{idx:a,item:t,matches:i}]:[]}const r=[]
778for(let i=0,o=e.children.length;i<o;i+=1){const o=e.children[i],s=n(o,t,a)
779if(s.length)r.push(...s)
780else if(e.operator===W)return[]}return r},a=this._myIndex.records,r={},i=[]
781return a.forEach((({$:e,i:a})=>{if(h(e)){let o=n(t,e,a)
782o.length&&(r[a]||(r[a]={idx:a,item:e,matches:[]},i.push(r[a])),o.forEach((({matches:e})=>{r[a].matches.push(...e)})))}})),i}_searchObjectList(e){const t=z(e,this.options),{keys:n,records:a}=this._myIndex,r=[]
783return a.forEach((({$:e,i:a})=>{if(!h(e))return
784let i=[]
785n.forEach(((n,a)=>{i.push(...this._findMatches({key:n,value:e[a],searcher:t}))})),i.length&&r.push({idx:a,item:e,matches:i})})),r}_findMatches({key:e,value:t,searcher:n}){if(!h(t))return[]
786let a=[]
787if(l(t))t.forEach((({v:t,i:r,n:i})=>{if(!h(t))return
788const{isMatch:o,score:s,indices:l}=n.searchIn(t)
789o&&a.push({score:s,key:e,value:t,idx:r,norm:i,indices:l})}))
790else{const{v:r,n:i}=t,{isMatch:o,score:s,indices:l}=n.searchIn(r)
791o&&a.push({score:s,key:e,value:r,norm:i,indices:l})}return a}}X.version="7.1.0",X.createIndex=A,X.parseIndex=function(e,{getFn:t=C.getFn,fieldNormWeight:n=C.fieldNormWeight}={}){const{keys:a,records:r}=e,i=new w({getFn:t,fieldNormWeight:n})
792return i.setKeys(a),i.setIndexRecords(r),i},X.config=C,X.parseQuery=G,function(...e){$.push(...e)}(_)
793var Q=n(29259),Z=n(85263),ee=n(93795),te=n(85519)
794function ne(e,t,n){return Array.isArray(e)?e.reduce(((e,a)=>{const r={}
795return t.forEach((e=>{r[e]="title"===e&&n?n(a[e]):a[e]})),Array.isArray(a.children)&&e.push(...ne(a.children,t,n)),e.push(r),e}),[]):[]}function ae(e){const t={product:"p/",content:"i/",footer:"i/",legal:"l/",category:"c/"},n=e=>e.replace(/\/+/g,"/").replace(/\/$/,"")||"/"
796return function(a,r){const i=t[r]??"",o=/^\/(\w{2})(\/|$)/.exec(e),s=o?`/${o[1]}`:""
797return"/"===a.href?n(s):n(`${s}/${i}${a.slug??""}`)}}function re(e,t){return e.map((({items:e,id:n,titleKey:a,type:r})=>Array.isArray(e)?e.map((e=>({id:e[n],title:e[a],slug:e.slug??"",type:"/"===e.href?"home":r,link:t(e,r)}))).sort(((e,t)=>e.title?.localeCompare(t.title))):[]))}const ie={keys:["title"],includeScore:!0,threshold:.45}
798function oe(e,t){return t.trim()?e.map((e=>new X(e,ie).search(t).map((e=>e.item)))):e}function se(e){const[t,n]=(0,i.A)(e,(e=>"home"===e.type))
799return[...t,...n]}function le(e,t,n,i,o,s){if(t.current&&a.gB.select(e,t.current),r.rL.focus(e),!(0,te.wr)(n.url))return void o({type:Q.U3,payload:{hasError:!0}})
800const l=(0,Z.$)(n.url),c=(0,te.Pq)(l)
801if(s?(0,ee.ok)(e):(0,te.kC)(e)){const[t,n]=s?(0,ee.vq)(e):(0,te.TE)(e)
802a.gB.setNodes(e,{...t,isExternal:c,url:l},{at:n}),a.gB.select(e,n),i({type:Q.Sn,payload:!0})}else s?(0,ee.QN)(e,n.url):(0,te.Ck)(e,n.url)
803e.selection&&a.Q6.isCollapsed(e.selection)||window.requestAnimationFrame((()=>{i({type:Q.Sn,payload:!0})})),window.requestAnimationFrame((()=>{i({type:Q.Sn,payload:!0})}))}function ce(e,t,n,a,i,l,c,u,d){(0,s.useEffect)((()=>{const s=(0,o.A)((()=>
803{if(r.rL.isFocused(e)){if(l(e)){const[r]=c(e)
804t&&r.url===n.url||(i({type:u}),a({type:Q.HV,payload:{url:r.url,isExternalLink:r.isExternal,isViewMode:!0}}))}!l(e)&&t&&(i({type:d}),a({type:Q.Sn,payload:!1}))}}),50)
805return s(),()=>s.cancel()}),[e,e.selection,l,t,n,c,i,d,u,a])}},6443:(e,t,n)=>{"use strict"
806n.d(t,{Ay:()=>v,EB:()=>g,L2:()=>f,i8:()=>y,pA:()=>b,sV:()=>h})
807var a=n(48431),r=n(48225),i=n(95110),o=n(84507),s=n(29259),l=n(77702),c=n(56641),u=n(94539),d=n(557),p=n(42295)
808const h=(e,t)=>t.type===s.aL?{...e,...t.payload}:e,g=(e,t)=>{switch(t.type){case s.Sn:return{...e,isViewMode:t.payload}
809case s.HV:return{...e,...t.payload}
810case s.n6:return{...e,isEditing:t.payload}
811default:return e}},f=(e,t)=>t.type===s.U3?{...e,hasError:t.payload.hasError}:e,m=(0,a.createContext)(void 0)
812function v({children:e}){const[{isLinkTooltipOpen:t,isButtonLinkTooltipOpen:n}]=(0,a.useContext)(l.ToolbarContext),[r,i]=(0,a.useReducer)(g,s.ue),[o,c]=(0,a.useReducer)(h,s.l),[u,v]=(0,a.useReducer)(f,s.S_),y=(0,d.WD)("shop"),x=(0,a.useMemo)((()=>({linkTooltipState:s.ue,linkTooltipDispatch:i,categoryState:s.l,categoryDispatch:c,errorState:s.S_,errorDispatch:v,pages:[],products:[],t:y})),[i,c,v,y])
813return(0,a.useEffect)((function(){t||n||(c({type:s.aL,payload:s.l}),i({type:s.HV,payload:s.ue}),u.hasError&&v({type:s.U3,payload:{hasError:!1}}))}),[u.hasError,n,t]),t||n?(0,p.jsx)(b,{t:y,linkTooltipState:r,linkTooltipDispatch:i,categoryState:o,categoryDispatch:c,errorState:u,errorDispatch:v,children:e}):(0,p.jsx)(m.Provider,{value:x,children:e})}function b({children:e,linkTooltipState:t,linkTooltipDispatch:n,categoryState:l,categoryDispatch:d,errorState:h,errorDispatch:g,t:f}){const v=(0,i.zy)().pathname.replace(/^\/editor/,""),b=(0,a.useMemo)((()=>(0,c.MP)(v)),[v]),y=t.isEditing&&l.selectedCategory!==s.en,x=(0,u.u)(t.searchTerm,y),{contentPagesState:C,footerPagesState:D,legalPagesState:w}=(0,o.d4)((e=>({contentPagesState:e.getIn(["navigation","storefront"]),footerPagesState:e.get("footerPages"),legalPagesState:e.get("legalPages")}))),[A,E,j,B]=(0,a.useMemo)((()=>{const[e,t]=(0,r.A)(C?.toJS(),(e=>"category"===e.type)),n=["id","title","slug","href"],a=(0,c.a$)(e,n),i=(0,c.a$)(t,n),o=(0,c.a$)(w?.toJS(),n,(e=>f(e))),s=[{items:a,id:"id",titleKey:"title",type:"category"},{items:i,id:"id",titleKey:"title",type:"content"},{items:(0,c.a$)(D?.toJS(),n),id:"id",titleKey:"title",type:"footer"},{items:o,id:"id",titleKey:"title",type:"legal"}]
814return(0,c.SW)(s,b)}),[C,w,D,b,f]),k=(0,a.useMemo)((()=>(0,c.SW)([{items:x,id:"productId",titleKey:"name",type:"product"}],b)[0]),[x,b]),[S,N,F,O]=(0,c.LV)([A,E,j,B],t.searchTerm),M=(0,a.useMemo)((()=>[...S,...N,...F,...O]),[S,N,F,O]),P=(0,a.useMemo)((()=>({linkTooltipState:t,linkTooltipDispatch:n,categoryState:l,categoryDispatch:d,errorState:h,errorDispatch:g,pages:M,products:k,t:f})),[t,n,l,d,h,g,M,k,f])
815return(0,p.jsx)(m.Provider,{value:P,children:e})}const y=()=>{const e=(0,a.useContext)(m)
816if(!e)throw new Error("useTooltipState must be used within a TooltipStateProvider")
817return e}},34990:(e,t,n)=>{"use strict"
818n.d(t,{A:()=>f})
819var a=n(48431),r=n(91121),i=n(29259),o=n(85263),s=n(85519),l=n(6443),c=n(82457),u=n(557),d=n(42295)
820function p({children:e}){const[t,n]=(0,a.useReducer)(l.EB,i.ue),[r,o]=(0,a.useReducer)(l.sV,i.l),[s,c]=(0,a.useReducer)(l.L2,i.S_),p=(0,u.WD)("shop")
821return(0,d.jsx)(l.pA,{t:p,linkTooltipState:t,linkTooltipDispatch:n,categoryState:r,categoryDispatch:o,errorState:s,errorDispatch:c,children:e})}var h=n(62148)
822function g({link:e,setLink:t,isSettingsLayer:n,disabled:r}){const{linkTooltipState:u,linkTooltipDispatch:p,categoryDispatch:g,errorState:f,errorDispatch:m}=(0,l.i8)(),{isViewMode:v}=u,b=(0,a.useRef)(null)
823return(0,a.useEffect)((()=>{e&&p({type:i.HV,payload:{url:e,isViewMode:!0}})}),[e,p]),(0,d.jsx)("div",{className:"settingslayer-link-tooltip",ref:b,children:v?(0,d.jsx)(h.A,{isSettingsLayer:n,setLink:t}):(0,d.jsx)(c.A,{handleInsert:function(){if(!(0,s.wr)(u.url))return void m({type:i.U3,payload:{hasError:!0}})
824const e=(0,o.$)(u.url),n=(0,s.Pq)(e)
825t(e),p({type:i.HV,payload:{isViewMode:!0,isExternalLink:n}})},isSettingsLayer:n,handleClickOutside:function(){p({type:i.n6,payload:!1}),f.hasError&&m({type:i.U3,payload:{hasError:!1}}),e||(p({type:i.HV,payload:{url:"",inputValue:"",searchTerm:"",isViewMode:!1}}),g({type:i.aL,payload:i.l})),e&&p({type:i.HV,payload:{url:e,inputValue:e,isViewMode:!0}})},disabled:r})})}function f({t:e,link:t,setLink:n,label:a,disabled:i}){return(0,d.jsx)(p,{children:(0,d.jsx)("div",{className:(0,r.A)(["ep-form-row ep-form-row-min-margin",{disabled:i}]),children:(0,d.jsxs)("label",{className:"ep-form-row-label",children:[(0,d.jsx)("span",{className:"ep-form-row-label-text",children:e(a)}),(0,d.jsx)(g,{link:t,setLink:n,isSettingsLayer:!0,disabled:i})]})})})}},1425:(e,t,n)=>{"use strict"
826n.d(t,{A:()=>g})
827var a=n(48431),r=n(53835),i=n(30202),o=n(77702),s=n(85519),l=n(56641),c=n(6443),u=n(82457),d=n(62148),p=n(50707),h=n(42295)
828function g({sideOffset:e,side:t,editableRef:n}
828){const g=(0,r.RV)(),{linkTooltipState:f,linkTooltipDispatch:m,errorDispatch:v}=(0,c.i8)(),[{isLinkTooltipOpen:b},y]=(0,a.useContext)(o.ToolbarContext),x=g.useLastSelection(g),[C,D]=(0,p.A)();(0,l.J3)(g,b,f,m,y,s.kC,s.TE,"open_link_tooltip","close_link_tooltip")
829const w={current:D}
830return(0,h.jsx)(i.A,{open:b,virtualRef:w,side:t,className:"dali-plugin-link-tooltip",usePortal:!0,avoidCollisions:!0,sideOffset:e,onMouseDown:e=>{e.stopPropagation()},onPointerDownOutside:()=>{y({type:"close_link_tooltip"})},onOpenAutoFocus:e=>{f.isViewMode&&e.preventDefault()},children:f.isViewMode?(0,h.jsx)(d.A,{lastSelection:x,editor:g,unlink:s.y1}):(0,h.jsx)(u.A,{inputRef:C,handleInsert:function(){(0,l.j)(g,x,f,m,v,!1)}})})}},82457:(e,t,n)=>{"use strict"
831n.d(t,{A:()=>f})
832var a=n(48431),r=n(91121),i=n(29259),o=n(30202),s=n(85263),l=n(6443),c=n(557),u=(n(39155),n(98357),n(98456),n(76881),n(61529),n(56641)),d=n(42295)
833const p=function({inputRef:e,categories:t,onItemClick:n,searchTerm:o,isSettingsLayer:s}){const{categoryState:c,linkTooltipDispatch:p,categoryDispatch:f}=(0,l.i8)(),m=()=>{f({type:i.aL,payload:i.l}),p({type:i.HV,payload:{searchTerm:""}})},v=e=>{n(e)},b=(0,a.useMemo)((()=>o?t.filter((e=>!c.searchCategory||e.name===c.searchCategory)).reduce(((e,t)=>e.concat(t.items)),[]):[]),[t,o,c.searchCategory])
834if(c.showCategories&&!o)return(0,d.jsx)("div",{className:(0,r.A)(["dali-plugin-link-tooltip-search-results-dropdown",{top:s}]),"data-testid":"search-form-suggestions",children:t.map((t=>(0,d.jsx)(h,{name:t.name,onClick:()=>{return n=t.name,f({type:i.aL,payload:{selectedCategory:n,searchCategory:n,showCategories:!1}}),void e?.current?.focus()
835var n}},t.name)))})
836if(!c.showCategories&&!o&&c.selectedCategory){const e=t.find((e=>e.name===c.selectedCategory))?.items||[],n=(0,u.dY)(e)
837return(0,d.jsxs)("div",{className:(0,r.A)(["dali-plugin-link-tooltip-search-results-dropdown",{top:s}]),"data-testid":"search-form-suggestions",children:[(0,d.jsx)(h,{name:c.selectedCategory,onClick:m,isBackButton:!0}),(0,d.jsx)("div",{className:"scrollable-container",children:n.map((e=>(0,d.jsx)(g,{item:e,onClick:t=>{t.preventDefault(),t.stopPropagation(),v(e)}},e.id)))})]})}return o?(0,d.jsxs)("div",{className:(0,r.A)(["dali-plugin-link-tooltip-search-results-dropdown",{top:s}]),"data-testid":"search-form-suggestions",children:[c.selectedCategory&&b.length>0&&(0,d.jsx)(h,{name:c.selectedCategory,onClick:m,isBackButton:!0}),(0,d.jsx)("div",{className:"scrollable-container",children:b.map((e=>(0,d.jsx)(g,{item:e,onClick:t=>{t.preventDefault(),t.stopPropagation(),v(e)}},e.id)))})]}):null}
838function h({name:e,onClick:t,isBackButton:n}){const a=(0,c.WD)("shop","components.richTextComponent.linkInputField.dropdownCategory"),r=e.toLowerCase(),i="dali-plugin-link-tooltip-item "+(n?"dali-plugin-link-tooltip-content-type-category-border":`dali-plugin-link-tooltip-content-type-category-${r}`)
839return(0,d.jsx)("button",{className:i,"data-testid":"search-form-suggestions-category",onClick:t,"aria-label":a(n?"back":r),children:(0,d.jsx)("span",{className:n?"dali-plugin-link-tooltip-category-left-arrow":"dali-plugin-link-tooltip-category-right-arrow",children:a(r)})})}function g({item:e,onClick:t}){return(0,d.jsx)("button",{title:e.link,className:`dali-plugin-link-tooltip-item dali-plugin-link-tooltip-content-type-${e.type}`,"data-testid":"search-form-suggestions-item",onClick:t,"aria-label":e.title,children:(0,d.jsx)("span",{className:"dali-plugin-link-tooltip-item-text",children:e.title})})}function f({inputRef:e,handleInsert:t,isSettingsLayer:n,handleClickOutside:u,disabled:h}){const{categoryState:g,linkTooltipState:f,pages:v,products:b,errorState:y}=(0,l.i8)(),{inputValue:x,url:C,searchTerm:D,isEditing:w}=f,A=(0,a.useRef)(null),E=e||A,[j,B]=(0,a.useState)(!1),{handleItemClick:k,handleInputChange:S,handleInputFocus:N,handleClearButtonClick:F,handleInsertClick:O,handleAddLinkOnEnterKeyPress:M}=function(e,t){const{linkTooltipState:n,linkTooltipDispatch:a,errorState:r,errorDispatch:o}=(0,l.i8)()
840function c(t){r.hasError&&o({type:i.U3,payload:{hasError:!1}}),a({type:i.HV,payload:{inputValue:t.title,url:t.link,title:"",type:t.type}}),e?.current?.focus()}function u(e){a({type:i.HV,payload:{inputValue:e,url:e,searchTerm:e}}),r.hasError&&o({type:i.U3,payload:{hasError:!1}})}function d(e){u(e.target.value)}function p(){a({type:i.n6,payload:!0})}function h(){u(""),e?.current?.focus()}function g(){a((0,s.$)(n.url)),t()}function f(e){"Enter"===e.key&&(e.preventDefault(),g())}
840return{handleItemClick:c,handleInputChange:d,handleInputFocus:p,handleClearButtonClick:h,handleInsertClick:g,handleAddLinkOnEnterKeyPress:f}}(E,t),P=(0,c.WD)("interface","components.richTextComponent"),T=[{name:i.en,items:v},{name:i.Sv,items:b}]
841return(0,a.useEffect)((()=>{w&&E.current&&E.current.focus()}),[E,w]),(0,a.useEffect)((()=>{B(w)}),[w]),(0,a.useEffect)((()=>{y.hasError&&E.current&&E.current.focus()}),[y.hasError,E]),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("input",{type:"text",className:(0,r.A)(["dali-plugin-link-tooltip-input",{"dali-plugin-link-tooltip-input-edit-mode":!n||w}]),"data-testid":"link-tooltip-edit-mode",placeholder:!n||w?m(g.selectedCategory,P):void 0,ref:E,value:x,title:C,"aria-label":P("linkInputField.ariaLabel"),onChange:S,onKeyDown:M,onFocus:N,disabled:h}),!n||w?(0,d.jsxs)(d.Fragment,{children:[x&&(0,d.jsx)("button",{type:"button",className:"dali-plugin-link-tooltip-clear","data-testid":"link-tooltip-edit-mode-clear-button","aria-label":P("linkInputField.clearButton.ariaLabel"),onClick:F}),(0,d.jsx)("button",{type:"button",className:"dali-plugin-text-tooltip-check","aria-label":P("linkInputField.insertButton.ariaLabel"),onClick:e=>{e.preventDefault(),O()}}),n?(0,d.jsx)(o.A,{open:j,virtualRef:E,className:"dali-plugin-link-tooltip-popover",sideOffset:1,align:"start",onPointerDownOutside:e=>{const t=e.target
842t.matches(".dali-plugin-link-tooltip-input")||t.matches(".dali-plugin-link-tooltip-clear")||t.matches(".dali-plugin-text-tooltip-check")||u&&u()},hideArrow:!0,children:(0,d.jsxs)(d.Fragment,{children:[y.hasError?(0,d.jsx)("div",{className:"dali-plugin-link-tooltip-error-message",children:(0,d.jsx)("span",{children:P("linkInputField.invalidUrlError")})}):null,(0,d.jsx)(p,{inputRef:E,categories:T,onItemClick:k,searchTerm:D,isSettingsLayer:n})]})}):(0,d.jsxs)(d.Fragment,{children:[y.hasError?(0,d.jsx)("div",{className:"dali-plugin-link-tooltip-error-message",children:(0,d.jsx)("span",{children:P("linkInputField.invalidUrlError")})}):null,(0,d.jsx)(p,{inputRef:E,categories:T,onItemClick:k,searchTerm:D,isSettingsLayer:n})]})]}):null]})}function m(e,t){return e===i.en?t("linkInputField.placeholder.pages"):e===i.Sv?t("linkInputField.placeholder.products"):t("linkInputField.placeholder.default")}},62148:(e,t,n)=>{"use strict"
843n.d(t,{A:()=>h})
844n(7121),n(39155),n(98456),n(61529)
845var a=n(53835),r=n(52763),i=n(48431),o=n(84507),s=n(91121),l=n(29259),c=n(32659),u=n(6443),d=n(557),p=n(42295)
846function h({lastSelection:e,editor:t,unlink:n,setLink:h,isSettingsLayer:f}){const m=(0,c.gf)(),v=(0,o.d4)((e=>e.getIn(["shop","locale"]))),b=(0,o.d4)((e=>e.getIn(["shop","defaultLocale"]))),y=(0,o.d4)((e=>e.getIn(["shop","locales"]).reduce(((e,t)=>(t.get("identifier")!==t&&e.push(t.get("identifier").substring(0,2)),e)),[]))),x=(0,d.WD)("interface","components.richTextComponent"),C=new RegExp(`^(/editor)?/(${v})/`),D=new RegExp(`^(/editor)?/(?<lang>${y.join("|")})/`),{linkTooltipState:{url:w,title:A,type:E,isExternalLink:j},linkTooltipDispatch:B,categoryDispatch:k,pages:S}=(0,u.i8)(),N=(0,o.d4)((e=>e.getIn(["shop","locationBase","origin"]))),F=function(e){return g[/^\/(?<languagePrefix>\w{2}\/)?(?<typePrefix>[clip])\//.exec(e)?.groups?.typePrefix??"else"]}(w),[O,M]=(0,i.useState)(!1);(0,i.useEffect)((()=>{"product"===F&&async function(){try{const{data:e}=await m.get(`/api/v2/products/${w.split("/").pop()}?locale=${v}`)
847B({type:l.HV,payload:{title:e.name,type:"product"}})}catch{M(!0)}}()}),[w,F,B,m,v]),(0,i.useEffect)((()=>{if(M(!1),"product"!==F){const e=S.find((e=>e.link===w.replace(`${N}/editor`,"")))
848e?B({type:l.HV,payload:{title:e.title,type:e.type}}):j||!["category","content","legal"].includes(F)||w?.startsWith("javascript:")?B({type:l.HV,payload:{title:"",type:"external"}}):(async()=>{try{const e=D.exec(w)?.groups?.lang||!C.test(w)&&b||v,{data:t}="category"===F?await m.get(`/api/v2/categories/${w.split("/c/")[1]}?locale=${e}`):"legal"===F?await m.get(`/api/v2/legal/${w.split("/l/")[1]}?locale=${e}`):await m.get(`/api/v2/pages/${w.split("/").pop()}?locale=${e}`)
849B({type:l.HV,payload:{title:t.title,type:{main:"content",footer:"footer",legal:"legal",null:"category"}[t.navigation]}})}catch{B({type:l.HV,payload:{title:""}}),M(!0)}})()}}),[F,w,j,v,S.length,N,m])
850const P=(0,i.useMemo)((()=>(0,s.A)({[`dali-plugin-link-tooltip-content-type-${E||"external"}`]:!O,"dali-plugin-link-tooltip-broken-link":O&&!j})),[E,O,j])
851return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("a",{href:w.startsWith("javascript:")?void 0:w,target:"_blank",rel:"noopener noreferrer",title:O?x("linkInputField.tooltips.brokenLink"):w,"data-testid":"link-tooltip-view-mode",className:P,children:A||w}),(0,p.jsx)("button",{type:"button",className:"dali-plugin-text-tooltip-edit","aria-label":x("linkInputField.editButton.ariaLabel"),"data-testid":"link-tooltip-view-mode-edit-button",onClick:()=>{B({type:l.HV,payload:{inputValue:A||w,searchTerm:A||w,isViewMode:!1,isEditing:!0}})}}),(0,p.jsx)("button",{type:"button",className:"dali-plugin-text-tooltip-delete","aria-label":x("linkInputField.deleteButton.ariaLabel"),"data-testid":"link-tooltip-view-mode-
851delete-button",onClick:()=>{t&&e&&n&&(r.gB.select(t,e.current),a.rL.focus(t),n(t)),f&&(h?.(""),B({type:l.HV,payload:l.ue}),k({type:l.aL,payload:l.l}))}})]})}const g={c:"category",l:"legal",i:"content",p:"product",else:"home"}},53016:(e,t,n)=>{"use strict"
852n.r(t),n.d(t,{default:()=>d})
853var a,r=n(61720),i=n(14953),o=n(557),s=n(81909),l=n(81715),c=n(16230),u=n(42295)
854function d({data:e,onSave:t,onCancel:n,onDataChange:d,renderLayout:p}){const h=(0,o.WD)("interface","components.contactFormComponent.settingsModal"),g=e.toJS(),f=h("title.onEdit"),m=h("title.explanation"),v=(0,u.jsx)(c.A,{tagName:"label",className:"ep-form-row-group",name:"showPrivacyCheckbox",label:h("showPrivacyCheckbox.label"),labelAfterComponent:!0,children:a||(a=(0,u.jsx)(r.D0,{type:"checkbox",name:"showPrivacyCheckbox",className:"ep-form-row-checkbox"}))}),b=(0,u.jsxs)(l.A,{children:[(0,u.jsx)(s.A,{type:"button",variant:"outline",onClick:n,children:h("cancelButton.label")}),(0,u.jsx)(s.A,{type:"submit",children:h("saveButton.label")})]})
855return(0,u.jsx)(r.l1,{initialValues:g,onSubmit:e=>{t((0,i.fromJS)(e))},validate:e=>{d((0,i.fromJS)(e))},children:(0,u.jsx)(r.lV,{translate:"no",children:p({title:f,body:v,footer:b,explanation:m})})})}},54320:(e,t,n)=>{"use strict"
856n.r(t),n.d(t,{default:()=>M})
857n(39155),n(98357),n(76672),n(76881)
858var a=n(12259),r=n(48431),i=n(32174),o=n(84507),s=n(14953),l=n.n(s),c=n(91121),u=n(85263),d=n(72392),p=n(63640),h=n(65736),g=n(37406),f=n(557),m=n(62929),v=n(81909),b=n(81715),y=n(51769),x=n(51546),C=n(34097),D=n(28321),w=n(94420),A=n(75655),E=n(42295)
859const j=l().fromJS({src:"",width:null,height:null,alt:"",opentab:!1,alignment:"center"}),B=l().Map({link:"",text:"",buttontext:"",headline:"",buttonenabled:!1})
860function k(e){return e.filter((e=>e.getIn(["imageData","src"])))}const S={imageSettings:C.A,imageTextSettings:w.A,imageTextColorSettings:D.A},N=[{value:1.5,name:"3:2"},{value:16/9,name:"16:9"},{value:21/9,name:"21:9"},{value:3,name:"3:1"},{value:20/6,name:"20:6"}],F=1.5,O=3.34
861function M({selectedIndex:e,config:t,data:n,onSelectionChange:s,onDataChange:C,onSave:D,onCancel:w,renderLayout:M}){const[P,T]=(0,r.useState)(null),[I,R]=(0,r.useState)("imageSettings"),[L,_]=(0,r.useState)(null),[$,z]=(0,r.useState)(!1),W=(0,r.useRef)(!1),U=(0,r.useRef)(null),V=(0,A.A)("IMAGE_FORMATS"),H=415===P?.code,K=t?.previewUrl||(e=>e),q=e=>e.getIn(["imageData","src"]),G=e=>!q(e),Y=(0,o.d4)((e=>e.getIn(["themeMeta","recommendedImageDimensions"],l().Map()))),J=Y.getIn(["imageSlider",0],1280
861)/Y.getIn(["imageSlider",1],720),X=(0,r.useCallback)(((e,t)=>{if(null==e)return null
862for(const n of N)if(Math.abs(e-n.value)<t)return n.value
863return Math.abs(e-J)<.005?null:e}),[J]),Q=(0,f.WD)("interface","components.contentSliderComponent.settingsModal"),Z=(0,r.useMemo)((()=>{const e=L??J
864return Math.abs(e-1.5)<.01?{type:"dual",ratio:Q("sliderAspectRatioRangeInput.hints.3/2.ratio"),pixels:Q("sliderAspectRatioRangeInput.hints.3/2.pixels")}:Math.abs(e-16/9)<.01?{type:"dual",ratio:Q("sliderAspectRatioRangeInput.hints.16/9.ratio"),pixels:Q("sliderAspectRatioRangeInput.hints.16/9.pixels")}:Math.abs(e-21/9)<.01?{type:"dual",ratio:Q("sliderAspectRatioRangeInput.hints.21/9.ratio"),pixels:Q("sliderAspectRatioRangeInput.hints.21/9.pixels")}:Math.abs(e-3)<.01?{type:"dual",ratio:Q("sliderAspectRatioRangeInput.hints.3/1.ratio"),pixels:Q("sliderAspectRatioRangeInput.hints.3/1.pixels")}:Math.abs(e-20/6)<.01?{type:"dual",ratio:Q("sliderAspectRatioRangeInput.hints.20/6.ratio"),pixels:Q("sliderAspectRatioRangeInput.hints.20/6.pixels")}:{type:"single",text:Q("sliderAspectRatioRangeInput.hints.custom",{ratio:e.toFixed(2)+":1"})}}),[L,J,Q]);(0,r.useEffect)((()=>{if(W.current)return
865const e=n.get("aspectRatio")
866z(null!=e),_(null!=e?X(e,.06):null)}),[n,X,J]),(0,r.useEffect)((()=>{const e=()=>{W.current=!1}
867return window.addEventListener("mouseup",e),window.addEventListener("touchend",e),()=>{window.removeEventListener("mouseup",e),window.removeEventListener("touchend",e)}}),[]),(0,r.useEffect)((()=>{U.current?.querySelectorAll(".sort-field > div").forEach(((t,n)=>{t.classList.toggle("selected-item",e===n)}))}),[e])
868const ee=()=>{const e=F+O-(L??J)
869return(0,E.jsxs)("div",{id:"aspect-ratio-slider-wrapper",style:{transform:"rotateY(180deg)"},children:[(0,E.jsx)("label",{className:"sr-only",htmlFor:"aspect-ratio-slider",children:Q("sliderAspectRatioRangeInput.accessibilityLabel")}),(0,E.jsx)("input",{type:"range",id:"aspect-ratio-slider",className:"dali-range-input",min:F,max:O,step:.01,value:e,disabled:!$,onMouseDown:()=>W.current=!0,onMouseUp:()=>W.current=!1,onTouchStart:()=>W.current=!0,onTouchEnd:()=>W.current=!1,onChange:e=>{const t=parseFloat(e.target.value),a=X(F+O-t,.06)
870_(a),C(n.set("aspectRatio",a))},style:{transform:"rotateY(180deg)","--min":F,"--max":O,"--val":e},"aria-valuetext":"single"===Z.type?Z.text:`${Z.ratio} ${Z.pixels}`})]})},te=o=>(0,E.jsxs)(E.Fragment,{children:[P&&(0,E.jsx)("div",{className:"dali-settingslayer-element",children:(0,E.jsxs)("div",{className:"dali-notification-danger",children:[P.message," ",H&&(0,E.jsx)("a",{href:V,target:"_blank",className:"ep-form-row-text-external-link",rel:"noreferrer noopener",children:Q(":components.imageUploadComponent.imageField.errorMessages.helpCenterLink")})]})}),(0,E.jsx)("div",{ref:U,className:"dali-settingslayer-element dali-settingslayer-select-image",children:(0,E.jsx)(a.SortField,{className:"sort-field",name:"images",onReorder:(e,t)=>s(t),orientation:"horizontal",itemSize:60,crossAxisItemSize:33,itemSpacing:13,itemCount:5,validate:e=>e.takeWhile(q).count()===e.filter(q).count(),disabled:(e,t,n)=>G(e)&&t>0&&G(n.get(t-1)),children:(n,a)=>{const r=n.getIn(["imageData","src"]),i=!r?.trim()?.length,o=n.get("__isDisabled"),l=e===a,u=n.get("__isTarget")
871return(0,E.jsx)("div",{onClick:()=>!o&&s(a),style:{pointerEvents:n.get("__isDragging")&&!n.get("__isSource")?"none":"auto"},className:(0,c.A)(["dali-settingslayer-select-image-item",{empty:i,disabled:o,selected:l,"dragged-over":u}]),children:(0,E.jsx)("div",{style:{backgroundImage:t?.imageUrl&&!i?`url("${K(t.imageUrl(r))}")`:null}})})}})}),(0,E.jsx)("div",{className:"dali-settingslayer-tabs",children:Object.keys(S).map((e=>(0,E.jsx)("button",{type:"button",className:(0,c.A)([`dali-settingslayer-tabs-${(0,i.A)(e)}`,{active:I===e}]),title:(0,p.L)({tab:e,tScoped:Q,isEditActive:n.get("images").size>0}),onClick:()=>R(e)},e)))}),(0,E.jsx)("scroll-shadow",{children:(0,E.jsx)("div",{className:"dali-settingslayer-main-content",children:(0,E.jsx)(a.IteratorField,{name:"images",skip:e,take:1,children:e=>(e=>{const n={config:t,handleError:e=>{T(e.error)},imageInfo:{isSlider:!0,src:e.getIn(["imageData","src"])},textPersistanceInfo:(0,d.getTextPersistanceInfo)(e),componentName:"contentSliderComponent"}
872return(0,r.createElement)(S[I],n)})(e)})})}
872),(0,E.jsx)("div",{className:"dali-settingslayer-contentslider-slide-interval",children:(0,E.jsxs)("label",{className:"dali-settingslayer-label",children:[Q("slideDurationRangeInput.label",{count:o.get("slideInterval")/1e3}),(0,E.jsx)(x.A,{name:"slideInterval",children:e=>(0,E.jsx)(a.RangeField,{className:"dali-range-input",name:"slideInterval",min:1e3,max:1e4,step:1e3,style:{"--min":1e3,"--max":1e4,"--val":e}})})]})}),(0,E.jsxs)("fieldset",{className:"dali-settingslayer-contentslider-aspect-ratio",children:[(0,E.jsxs)("legend",{className:"ep-form-row-label",children:[Q("sliderAspectRatioRangeInput.label")," ","single"===Z.type?(0,E.jsx)("span",{className:"dali-settingslayer-contentslider-aspect-ratio-hint-fade",children:Z.text},"custom"):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("span",{className:"dali-settingslayer-contentslider-aspect-ratio-hint-fade",children:Z.ratio},"ratio"),(0,E.jsx)("span",{className:"dali-settingslayer-contentslider-aspect-ratio-pixels dali-settingslayer-contentslider-aspect-ratio-hint-fade",children:Z.pixels},"pixels")]})]}),(0,E.jsx)(y.A,{name:"enableCustomAspectRatio",label:Q("sliderAspectRatioRangeInput.enableCustomAspectRatio.label"),info:Q("sliderAspectRatioRangeInput.enableCustomAspectRatio.tooltip"),tagName:"label",labelAfterComponent:!0,className:"dali-settingslayer-contentslider-aspect-ratio-enable",children:(0,E.jsx)("input",{type:"checkbox",checked:$,onChange:e=>{const t=e.target.checked
873if(z(t),t){const e=Math.max(F,Math.min(O,J)),t=X(e,.2)
874_(t),C(n.set("aspectRatio",t))}else _(null),C(n.set("aspectRatio",null))},name:"enableCustomAspectRatio",className:"ep-form-row-checkbox","aria-controls":"aspect-ratio-slider-wrapper"})}),ee()]})]}),ne=(0,E.jsxs)(b.A,{children:[(0,E.jsx)(v.A,{type:"button",variant:"outline",onClick:w,children:Q("cancelButton.label")}),(0,E.jsx)(v.A,{children:Q("saveButton.label")})]}),ae=n.update("images",(e=>e.map((e=>(0,m.qp)((0,d.normalizeButtonState)(j.merge(e)))))))
875return(0,E.jsx)(a.Form,{value:ae,name:"pluginContentSliderSettings",onSubmit:D,onChange:e=>C(e.update("images",(e=>k(e).map((e=>(0,m.O5)((0,d.normalizeButtonState)(e))))))),prepare:e=>e.update("aspectRatio",(e=>null==e?null:X(e,.06))).update("images",(e=>function(e){return e.map((e=>e.mergeDeep(B,h.xK,e)))}(function(e){return e.concat(l().Repeat(j,5-e.count()))}(k(e))).map(m.qp))),normalize:e=>e.update("aspectRatio",(e=>X(e,.06))).update("images",(e=>k(e.map(m.O5)).map((e=>(0,g.V)(e).update("link",u.$).remove("imageData"))))),children:({value:e})=>M({title:(0,p.L)({tab:I,tScoped:Q,isEditActive:n.get("images").size>0}),explanation:"imageSettings"===I?Q("explanation"):void 0,body:te(e),footer:ne})})}},41444:(e,t,n)=>{"use strict"
876n.r(t),n.d(t,{default:()=>h})
877var a=n(12259),r=n(14953),i=n.n(r),o=n(557),s=n(81909),l=n(81715),c=n(77472),u=n(51769),d=n(51546),p=n(42295)
878function h({data:e,onDataChange:t,onCancel:n,onSave:r,renderLayout:h}){const g=(0,o.WD)("interface","components.dividerElementComponent.settingsModal"),f=g("title.onEdit"),m=i().List([{value:"solid",label:g("selectBox.option.solid")},{value:"dashed",label:g("selectBox.option.dashed")},{value:"dotted",label:g("selectBox.option.dotted")}]),v=(0,p.jsx)(u.A,{name:"dividerType",tagName:"label",label:g("selectBox.label"),children:(0,p.jsx)(d.A,{children:(e,t)=>(0,p.jsx)(c.A,{className:"ep-divider-settings-select",options:m,renderOption:e=>(0,p.jsxs)("span",{className:"ep-custom-divider",children:[(0,p.jsx)("label",{className:"visually-hidden",children:e.label}),(0,p.jsx)("hr",{style:{borderStyle:e.value}})]}),selectedIndex:m.findIndex((t=>t.value===e)),onChange:e=>t(m.get(e).value)})})}),b=(0,p.jsxs)(l.A,{children:[(0,p.jsx)(s.A,{variant:"outline",type:"button",onClick:n,children:g("cancelButton.label")}),(0,p.jsx)(s.A,{children:g("saveButton.label")})]})
879return(0,p.jsx)(a.Form,{name:"pluginDividerSettings",value:e,onChange:t,onSubmit:r,children:h({title:f,body:v,footer:b})})}},43960:(e,t,n)=>{"use strict"
880n.r(t),n.d(t,{default:()=>w})
881n(7121),n(39155),n(98456),n(76672),n(76881)
882var a=n(12740),r=n(11318),i=n(61720),o=n(64580),s=n(14953),l=n(46288),c=n(18725),u=n(85636),d=n(48431),p=n(26035),h=n(30202),g=n(19956),f=n(38868),m=n(557),v=n(81909),b=n(81715),y=n(16230),x=n(92016),C=n(42295)
883const D={title:"",detailsHtml:""}
884function w({data:e,onCancel:t,onDataChange:n,onSave:a,renderLayout:r}){const o=(0,m.WD)("interface","components.expanderElementComponent.settingsModal"),u=e.toJS()
8850===u.entries.length&&u.entries.push(D),u.entries.forEach((e=>{e.draggableId=(0,l.A)()}))
886const d=o("title"),h=(0,C.jsx)(A,{t:o}),g=(0,C.jsxs)(b.A,{children:[(0,C.jsx)(v.A,{variant:"outline",type:"button",onClick:t,children:o("cancelButton.label")}),(0,C.jsx)(v.A,{type:"submit",children:o("saveButton.label")})]})
887return(0,C.jsx)(i.l1,{initialValues:u,onSubmit:e=>a((0,s.fromJS)({entries:e.entries.map((e=>(0,c.A)(e,["draggableId"])))})),children:(0,C.jsxs)(i.lV,{translate:"no",children:[(0,C.jsx)(p.FormikOnChange,{onChange:e=>n((0,s.fromJS)(e))}),r({title:d,body:h,footer:g})]})})}function A({t:e}){const t=(0,d.useRef)(new Map).current,[n,a]=(0,d.useState)(null),s=()=>{const e=t.get(n)
888e?.focus(),a(null)},[{value:c}]=(0,i.Mt)("entries"),p=(0,f.T)(),m=(0,f.Ww)(e,(t=>c.find((e=>e.draggableId===t))?.title||e("expandableEntry.headlinePlaceholder")))
889return(0,C.jsx)(i.ED,{name:"entries",children:d=>(0,C.jsxs)("div",{className:"dali-settingslayer-main-content",tabIndex:-1,children:[(0,C.jsx)("scroll-shadow",{children:(0,C.jsx)(r.Mp,{accessibility:m,modifiers:[u.Mk,u.FN],sensors:p,onDragEnd:function({active:e,over:t}){if(!t||t.id===e.id)return
890const n=c.findIndex((t=>t.draggableId===e.id)),a=c.findIndex((e=>e.draggableId===t.id))
891d.move(n,a)},children:(0,C.jsx)(o.gB,{items:c.map((e=>e.draggableId)),strategy:o._G,children:(0,C.jsx)("div",{className:"scroller",children:c.map(((r,o)=>(0,C.jsxs)("div",{ref:e=>{e?t.set(o,e):t.delete(o)},tabIndex:-1,children:[(0,C.jsx)(E,{t:e,index:o,id:r.draggableId,onDeleteButtonClick:()=>d.remove(o),onEditButtonClick:()=>a(o)}),(0,C.jsxs)(h.A,{open:n===o,virtualRef:{current:t.get(o)},side:"left",align:"center",className:"dali-settingslayer-expander-popover",onEscapeKeyDown:s,onPointerDownOutside:s,avoidCollisions:!0,usePortal:!0,children:[(0,C.jsx)(y.A,{tagName:"label",label:e("expandableEntry.editPopover.headlineInputField.label"),name:`entries.${o}.title`,children:(0,C.jsx)(i.D0,{name:`entries.${o}.title`,className:"ep-form-text-field",type:"text",placeholder:e("expandableEntry.editPopover.headlineInputField.placeholder"),required:!0})}),(0,C.jsx)(y.A,{className:"dali-settingslayer-expander-popover-editor-wrapper",label:e("expandableEntry.editPopover.textInputField.label"),name:`entries.${o}.detailsHtml`,children:(0,C.jsx)(x.A,{name:`entries.${o}.detailsHtml`,children:(t,n)=>(0,C.jsx)(g.O,{value:t,onChange:n,toolbarButtons:["bold","link|unlink"],placeholderText:e("expandableEntry.editPopover.textInputField.placeholder")})})})]})]},r.draggableId)))})})})}),(0,C.jsx)("button",{type:"button",onClick:()=>d.push({...D,draggableId:(0,l.A)()}),className:"dali-settingslayer-expander-add",children:e("addButton.label")})]})})}function E({t:e,id:t,index:n,onEditButtonClick:r=()=>null,onDeleteButtonClick:s=()=>null}){const[{value:l}]=(0,i.Mt)(`entries.${n}.title`),[{value:c}]=(0,i.Mt)(`entries.${n}.detailsHtml`),{attributes:u,listeners:d,setNodeRef:p,transform:h,transition:g}=(0,o.gl)({id:t,attributes:{roleDescription:e("expandableEntry.ariaRoleDescription")}}),m={transform:a.Ks.Transform.toString(h),transition:g}
892return(0,C.jsxs)("div",{ref:p,style:m,...u,...d,className:"dali-settingslayer-expander-item",id:t,children:[(0,C.jsx)(f.b4,{id:t}),(0,C.jsxs)("div",{className:"dali-settingslayer-expander-item-text",children:[(0,C.jsx)("span",{className:"dali-settingslayer-expander-item-headline",children:l||(0,C.jsx)("i",{children:e("expandableEntry.headlinePlaceholder")})}),(0,C.jsx)("span",{className:"htmlPreview",dangerouslySetInnerHTML:{__html:["<p></p>",""].includes(c)?`<i>${e("expandableEntry.textPlaceholder")}</i>`:c}})]}),(0,C.jsx)("button",{onKeyDown:e=>e.stopPropagation(),type:"button","aria-label":e("expandableEntry.editButton.tooltip"),title:e("expandableEntry.editButton.tooltip"),onClick:r,className:"dali-settingslayer-expander-edit-button"}),(0,C.jsx)("button",{onKeyDown:e=>e.stopPropagation(),type:"button","aria-label":e("expandableEntry.deleteButton.tooltip"),title:e("expandableEntry.deleteButton.tooltip"),onClick:s,className:"dali-settingslayer-expander-delete-button"})]})}},39698:(e,t,n)=>{"use strict"
893n.r(t),n.d(t,{default:()=>f})
894var a,r=n(12259),i=n(14953),o=n(48431),s=n(94635),l=n(557),c=n(81909),u=n(81715),d=n(51769),p=n(81671),h=n(42295)
895function g(e){return e.update("iframe",(e=>e?e.trim():""))}function f({data:e,onSave:t,onCancel:n,renderLayout:f,onDataChange:m}){const v=(0,l.WD)("interface","components.gmapsElementComponent.settingsModal"),b=(0,o.useRef)(void 0),y=e.get("iframe")?v("title.onEdit"):v("title.onCreate"),x=(0,h.jsx)(d.A,{name:"iframe",tagName:"label",label:v("embedded.label"),info:v("embedded.info"),children:a||(a=(0,h.jsx)(p.A,{autoFocus:!0,name:"iframe",type:"text"}))}),C=(0,h.jsxs)(u.A,{children:[(0,h.jsx)(c.A,{type:"button",variant:"outline",onClick:n,children:v("cancelButton.label")}),(0,h.jsx)(c.A,{type:"submit",children:v("saveButton.label")})]})
896return(0,h.jsx)(r.Form,{name:"pluginGoogleMapsSettings",value:e,onCh
896ange:e=>{const t=(0,s.c)(e.get("iframe"))
897t&&t!==b.current&&(b.current=t,m(e))},onSubmit:t,validate:(e,t)=>function(e,t,n=!0){const a=t.get("iframe"),r=(0,s.c)(a)
898return n&&(0,i.fromJS)({iframe:Boolean(a)&&!r?e("urlInputField.validationMessages.invalidURL"):null})}(v,e,t),normalize:g,children:f({title:y,body:x,footer:C})})}},3607:(e,t,n)=>{"use strict"
899n.r(t),n.d(t,{default:()=>N,getTextPersistanceInfo:()=>B,normalizeButtonState:()=>A})
900n(76881)
901var a,r=n(12259),i=n(48431),o=n(14953),s=n.n(o),l=n(85263),c=n(63640),u=n(65736),d=n(37406),p=n(557),h=n(62929),g=n(81909),f=n(81715),m=n(51769),v=n(81671),b=n(42295)
902n(39155),n(28383)
903var y,x=n(91121),C=n(28321),D=n(51546)
904function w(e){return(0,h.O5)((0,d.V)(e).update("link",l.$)).remove("imageData")}function A(e){return e.get("link")?e:e.set("buttonenabled",!1).set("opentab",!1)}const E={imageTextSettings:n(94420).A,layoutSettings:function({imageInfo:e,textPersistanceInfo:t}){const n=(0,p.WD)("interface","components.heroImageElementComponent.settingsModal.layoutSettings"),a=!e?.src||!t.some((e=>Boolean(e))),i=[{label:n("layout.options.overlay.label"),value:"overlay"},{label:n("layout.options.overlapping.label"),value:"overlapping"},{label:n("layout.options.diagonal.label"),value:"diagonal"},{label:n("layout.options.sidebyside.label"),value:"sidebyside"}],o=[{label:n("layoutSide.options.left.label"),value:"left"},{label:n("layoutSide.options.right.label"),value:"right"}]
905return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("fieldset",{className:(0,x.A)(["ep-form-row",a&&"disabled"]),children:[(0,b.jsx)("legend",{children:n("layout.label")}),(0,b.jsx)(D.A,{name:"layout",children:(e,t)=>i.map((n=>(0,b.jsxs)("label",{className:"ep-form-row-label",children:[(0,b.jsx)("input",{type:"radio",name:"layout",value:n.value,checked:e===n.value,onChange:()=>{t(n.value)},disabled:a}),(0,b.jsx)("span",{className:"ep-form-row-label-text",children:n.label}),(0,b.jsx)("button",{type:"button",className:(0,x.A)(["layout-scheme",[`layout-scheme-${n.value}`]]),onClick:()=>{t(n.value)},disabled:a,children:y||(y=(0,b.jsxs)("div",{className:"image",children:[(0,b.jsxs)("svg",{width:"100%",xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 39.3 22.4",children:[(0,b.jsx)("path",{className:"image-background",d:"M0,.5C0,.2.3,0,.7,0h37.8c.5,0,.8.2.8.5v21.4c0,.3-.3.5-.7.5H.9c-.5,0-.8-.2-.8-.5V.5h0Z"}),(0,b.jsx)("path",{className:"image-elements",d:"M9.5,8.5c2,0,3.4-1.6,3.4-3.4s-1.4-3.4-3.4-3.4-3.4,1.5-3.4,3.4,1.5,3.4,3.4,3.4Z"}),(0,b.jsx)("polygon",{className:"image-elements",points:"36.5 12.2 26.5 5.1 14.4 14.1 10.6 11.3 3 16.9 3 20.1 36.5 20.1 36.5 12.2 36.5 12.2"})]}),(0,b.jsxs)("div",{className:"overlay",children:[(0,b.jsx)("div",{className:"line line-1"}),(0,b.jsx)("div",{className:"line line-2"}),(0,b.jsx)("div",{className:"line line-3"})]})]}))})]},n.value)))})]}),(0,b.jsx)(m.A,{className:(0,x.A)({disabled:a}),name:"layoutSide",label:n("layoutSide.label"),children:(0,b.jsx)(r.RadioButtonField,{className:"ep-form-row-radio-group",name:"layoutSide",buttons:o,disabled:a})}),(0,b.jsx)(D.A,{name:"overlayWidth",children:(e,t)=>(0,b.jsx)(C.D,{name:"overlayWidth",label:n("overlayWidthInputField.label"),min:30,max:90,disabled:a,value:e,setValue:t})})]})},imageTextColorSettings:C.A,altTextSettings:function(){const e=(0,p.WD)("interface","components.heroImageElementComponent.settingsModal.altTextSettings")
906return(0,b.jsx)(m.A,{info:e("altTextInputField.explanation"),name:"alt",tagName:"label",label:e("altTextInputField.label"),children:a||(a=(0,b.jsx)(v.A,{"data-testid":"image-alt-text-input",name:"alt",type:"text"}))})}},j=["text","headline","buttontext"],B=e=>j.reduce(((t,n)=>t.set(n,"buttontext"!==n?Boolean(e.get(n)):Boolean(e.get(n)&&e.get("buttonenabled")))),s().Map()),k=s().Map({text:"",buttontext:"",headline:"",link:"",buttonenabled:!1,opentab:!1}),S=s().Map({layout:"overlay",layoutSide:"left"})
907function N({config:e,data:t,onDataChange:n,onSave:a,onCancel:o,renderLayout:l}){const[d,m]=(0,i.useState)(null),[v,y]=(0,i.useState)("imageTextSettings"),x=(0,p.WD)("interface","components.heroImageElementComponent.settingsModal"),C=s().fromJS(t)
908return(0,b.jsx)(r.Form,{name:"pluginHeroImageSettings",value:(0,h.qp)(A(C)),prepare:e=>(0,h.qp)(e.mergeDeep(k,u.xK,S,e)),onChange:e=>n((0,h.O5)(A(e))),onSubmit:a,normalize:w,children:l({title:(0,c.L)({tab:v,tScoped:x,isEditActive:C.get("src")}),tabs:Object.keys(E).map((e=>({name:e,title:(0,c.L)({tab:e,tScoped:x,isEditActive:C.get("src")}),active:v===e,onClick:e=>{y(e)}}))),body:(()=>
908{const t={error:d,config:e,handleError:e=>{m(e)},imageInfo:{src:C.get("src")},textPersistanceInfo:B(C),componentName:"heroImageElementComponent"}
909return(0,i.createElement)(E[v],t)})(),footer:(0,b.jsxs)(f.A,{children:[(0,b.jsx)(g.A,{type:"button",variant:"outline",onClick:()=>{m(null),o()},children:x("cancelButton.label")}),(0,b.jsx)(g.A,{children:x("saveButton.label")})]})})})}},41630:(e,t,n)=>{"use strict"
910n.r(t),n.d(t,{default:()=>f})
911var a=n(12259),r=n(48431),i=(n(24430),n(557)),o=n(81909),s=n(81715),l=n(90141),c=n(23435),u=n(42295)
912const d={lineNumbers:!0,lineWrapping:!0,mode:"htmlmixed",theme:"base16-light",viewportMargin:1/0,lint:!0}
913const p=(0,r.forwardRef)((({value:e,onChange:t,onValidationChange:n},a)=>{const[o,s]=(0,r.useState)(e),[p,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)([]),m=(0,i.WD)("interface")
914return(0,u.jsx)(l.A,{value:o,resetValue:"",invalid:p,errorCategories:g,className:"ep-custom-html-field",warningDismissKey:"customHtmlWarningDismissed",tScoped:(e,...t)=>m(`components.freeHtmlElementComponent.${e}`,...t),onChange:e=>s(e),onLint:(e,a)=>{const r=function(e,t){const n=e.length>0,a=(0,c.A)(t),r=!a.isValid
915return{isValid:!n&&!r,hasSyntaxErrors:n,categories:a.errorCategories}}(e,a)
916h(!r.isValid),f(r.categories),r.isValid&&t(a),n&&n({isValid:r.isValid,hasSyntaxErrors:r.hasSyntaxErrors,errorCategories:r.categories})},codeMirrorOptions:d})}))
917p.displayName="CustomHtmlField"
918const h=(0,a.formField)()(p)
919function g(e){return e.update("html",(e=>e?e.trim():""))}function f({data:e,onSave:t,onCancel:n,onDataChange:l,renderLayout:c}){const d=(0,i.WD)("interface","components.freeHtmlElementComponent.settingsModal"),[p,f]=(0,r.useState)(!0)
920return(0,u.jsx)(a.Form,{name:"pluginFreeHtmlSettings",value:e,onChange:l,onSubmit:t,normalize:g,children:c({title:e.get("html")?d("title.onEdit"):d("title.onCreate"),body:(0,u.jsx)("scroll-shadow",{children:(0,u.jsx)("div",{className:"dali-settingslayer-main-content",children:(0,u.jsx)(a.FormValueScope,{name:"html",children:(0,u.jsx)(h,{onChange:l,onValidationChange:e=>{f(e.isValid)}})})})}),footer:(0,u.jsxs)(s.A,{children:[(0,u.jsx)(o.A,{type:"button",variant:"outline",onClick:n,children:d("cancelButton.label")}),(0,u.jsx)(o.A,{type:"submit",disabled:!p,title:p?"":d("saveButton.disabledTooltip"),children:d("saveButton.label")})]})})})}},93171:(e,t,n)=>{"use strict"
921n.r(t),n.d(t,{default:()=>E})
922var a=n(61720),r=n(14953),i=n(48431),o=n(84507),s=n(91121),l=n(83241),c=n(26035),u=n(30202),d=n(46785),p=n(44420),h=n(65736),g=n(557),f=n(81909),m=n(81715),v=n(16230),b=n(92016),y=n(42295)
923function x({name:e,disabled:t=!1,min:n=0,max:a=100,step:r=1,...i}){return(0,y.jsx)(b.A,{name:e,children:(o,s)=>{const l={"--min":n,"--max":a,"--val":o}
924return(0,y.jsxs)("div",{className:"dali-range-input-with-numeric",children:[(0,y.jsx)("input",{type:"range",style:l,className:"dali-range-input",min:n,name:e,max:a,step:r,disabled:t,value:o,onChange:e=>s(Number(e.target.value)),...i}),(0,y.jsx)("input",{type:"number",className:"dali-range-output",min:n,name:e,max:a,step:r,disabled:t,value:o,onChange:e=>s(Number(e.target.value)),...i})]})}})}var C,D=n(86148),w=n(34990),A=n(93020)
925function E({data:e,onCancel:t,onDataChange:n,onSave:s,renderLayout:l}){const u=(0,i.useId)(),[d,v]=(0,i.useState)("icon-main"),b=(0,g.WD)("interface"),x=e.type?b("components.iconElementComponent.settingsModal.firstTab.title.onEdit"):b("components.iconElementComponent.settingsModal.firstTab.title.onCreate"),C=b("components.iconElementComponent.settingsModal.secondTab.title"),D="icon-main"===d?x:C,w=(0,o.d4)((e=>e.getIn(["shop","theme","name"],"").replace(".","_"))),[A]=w.split(p.ko),E=(0,h.L0)((e=>b(`components.colorFieldComponent.popover.colorPresets.${e}.tooltip`)),(e=>b(`themes:${A}.settings.${e}`))),k="icon-main"===d?(0,y.jsx)(j,{colorOptions:E,id:u}):(0,y.jsx)(B,{colorOptions:E,id:u}),S=[{name:"icon-main",title:x,active:"icon-main"===d,onClick:()=>v("icon-main")},{name:"icon-advanced",title:C,active:"icon-advanced"===d,onClick:()=>v("icon-advanced")}],N=(0,y.jsxs)(m.A,{children:[(0,y.jsx)(f.A,{variant:"outline",type:"button",onClick:t,children:b("components.iconElementComponent.settingsModal.cancelButton.label")}),(0,y.jsx)(f.A,{type:"submit",children:b("components.iconElementComponent.settingsModal.saveButton.label")})]})
926return(0,y.jsx)(a.l1,{initialValues:e,onSubmit:e=>s((0,r.fromJS)(e)),children:(0,y.jsxs)(a.lV,{translate:"no",children:[(0,y.jsx)(c.FormikOnChange,{onChange:e=>n((0,r.fromJS)(e))}),l({title:D,body:k,tabs:S,footer:N})]})})}function j({colorOptions:e,id:t}){const{values:n,resetForm:r}=(0,a.j7)(),{alignment:o,spacing:c,sizing:p,color:h}=d.wl,[f,m]=(0,i.useState)(!1),E=(0,g.WD)("interface","components.iconElementComponent.settingsModal.firstTab"),j=!n.type,B=!n.link.trim()
927return(0,i.useEffect)((()=>
927{if(!n.type){const e=setTimeout((()=>{m(!0)}),50)
928return()=>clearTimeout(e)}}),[n.type]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(b.A,{name:"type",children:(e,t)=>(0,y.jsx)("div",{className:"ep-form-row ep-form-row-min-margin",children:(0,y.jsx)(u.A,{open:f,onOpenChange:m,className:"ep-icon-picker",side:"left",align:"center",sideOffset:35,avoidCollisions:!0,anchor:e?(0,y.jsx)("div",{className:"dali-plugin-icon-default body",children:(0,y.jsx)("span",{className:(0,s.A)([{[`ep-${e}-icon`]:e}]),style:{color:n.color}})}):(0,y.jsxs)("div",{className:"dali-plugin-icon-default",children:[C||(C=(0,y.jsx)("span",{className:"dali-plugin-icon-placeholder"})),(0,y.jsx)("p",{className:"dali-plugin-icon-info",children:E("emptyStateText")})]}),trigger:(0,y.jsx)("button",{type:"button",className:"dali-plugin-icon-button-change",children:E(n.type?"changeIconLink.label":"selectIconLink.label")}),children:(0,y.jsx)(D.A,{icon:e,setIcon:n=>{e||m(!0),t(n)}})})})}),(0,y.jsx)(b.A,{name:"link",children:(e,t)=>(0,y.jsx)(w.A,{t:E,link:e,setLink:t,label:"linkInputField.label",disabled:j})}),(0,y.jsx)(v.A,{tagName:"label",labelAfterComponent:!0,label:E("openLinkInNewTabCheckbox.label"),className:(0,s.A)(["ep-form-row ep-form-row-no-margin",{disabled:B}]),name:"opentab",children:(0,y.jsx)(a.D0,{name:"opentab",className:"ep-form-row-checkbox",type:"checkbox",disabled:B})}),(0,y.jsxs)("div",{className:(0,s.A)(["dali-plugin-icon-settings",{disabled:j}]),children:[(0,y.jsxs)("fieldset",{disabled:j,children:[(0,y.jsx)("legend",{children:E("styleSettingsSection.label")}),(0,y.jsx)(v.A,{className:"ep-form-row",name:"color",label:E("styleSettingsSection.color"),children:(0,y.jsx)(l.FormikColorField,{withHexInput:!0,name:"color",presetColors:e.toJS(),offsetDistance:22,resetValue:d.wl.color,side:"left",align:"end"})}),(0,y.jsx)(v.A,{className:"ep-form-row",name:"alignment",label:E("styleSettingsSection.alignmentSetting.label"),children:(0,y.jsx)("div",{className:"dali-plugin-icon-settings-alignment",children:(0,y.jsx)(A.A,{disabled:j,name:"alignment",options:[{value:"left",label:E("styleSettingsSection.alignmentSetting.leftRadioButton.label")},{value:"center",label:E("styleSettingsSection.alignmentSetting.centerRadioButton.label")},{value:"right",label:E("styleSettingsSection.alignmentSetting.rightRadioButton.label")}]})})}),(0,y.jsx)(v.A,{label:E("styleSettingsSection.spacing"),className:"ep-form-row",id:`${t}-spacing`,name:"spacing",children:(0,y.jsx)(x,{"aria-labelledby":`${t}-spacing`,name:"spacing",min:0,max:50})}),(0,y.jsx)(v.A,{className:"ep-form-row",id:`${t}-sizing`,name:"sizing",label:E("styleSettingsSection.sizing"),children:(0,y.jsx)(x,{"aria-labelledby":`${t}-sizing`,name:"sizing",min:15,max:100})})]}),(0,y.jsx)("button",{type:"button",className:"dali-plugin-icon-reset-button",disabled:j,onClick:()=>r({values:{...n,alignment:o,color:h,spacing:c,sizing:p}}),children:E("styleSettingsSection.resetLink.label")})]})]})}function B({colorOptions:e,id:t}){const{values:n,resetForm:r}=(0,a.j7)(),i=(0,g.WD)("interface","components.iconElementComponent.settingsModal.secondTab"),{backgroundSize:o,backgroundRadius:c,backgroundColor:u,borderSize:p,borderColor:h}=d.wl,f=!n.type
929return(0,y.jsxs)("div",{className:(0,s.A)(["dali-plugin-icon-settings advanced",{disabled:f}]),children:[(0,y.jsxs)("fieldset",{disabled:f,children:[(0,y.jsx)("legend",{children:i("backgroundSettingsSection.label")}),(0,y.jsx)(v.A,{className:"ep-form-row icon-color",name:"backgroundColor",label:i("backgroundSettingsSection.color"),children:(0,y.jsx)(l.FormikColorField,{withHexInput:!0,name:"backgroundColor",className:(0,s.A)(["icon-color",{transparent:"transparent"===n.backgroundColor}]),presetColors:e.toJS(),offsetDistance:22,resetValue:d.wl.backgroundColor,side:"left",align:"end"})}),(0,y.jsx)(v.A,{className:"ep-form-row",id:`${t}-background-size`,name:"backgroundSize",label:i("backgroundSettingsSection.size"),children:(0,y.jsx)(x,{"aria-labelledby":`${t}-background-size`,name:"backgroundSize",min:0,max:100})}),(0,y.jsx)(v.A,{className:"ep-form-row",label:i("backgroundSettingsSection.radius"),id:`${t}-background-radius`,name:"backgroundRadius",children:(0,y.jsx)(x,{"aria-labelledby":`${t}-background-radius`,name:"backgroundRadius",min:0,max:50})})]}),(0,y.jsx)("button",{type:"button",className:"dali-plugin-icon-reset-button",disabled:f,onClick:()=>r({values:{...n,backgroundSize:o,backgroundRadius:c,backgroundColor:u}}),children:i("backgroundSettingsSection.resetLink.label")}),(0,y.jsxs)("fieldset",{disabled:f,children:[(0,y.jsx)("legend",{children:i("borderSettingsSection.label")}),(0,y.jsx)(v.A,{className:"ep-form-row icon-color",name:"borderColor",label:i("borderSettingsSection.color"),children:(0,y.jsx)(l.FormikColorField,{withHexInput:!0,name:"borderColor",className:"icon-color",presetColors:e.toJS(),offsetDistance:22,resetValue:d.wl.borderColor,side:"left",align:"end"})}),(0,y.jsx)(v.A,{className:"ep-form-row",label:i("borderSettingsSection.size"),id:`${t}-border-size`,name:"borderSize",children:(0,y.jsx)(x,{"aria-labelledby":`${t}-border-size`,name:"borderSize",min:0,max:20})})]}),(0,y.jsx)("button",{type:"button",className:"dali-plugin-icon-reset-button",disabled:f,onClick:()=>r({values:{...n,borderSize:p,borderColor:h}}),children:i("borderSettingsSection.resetLink.label")})]})}},72392:(e,t,n)=>{"use strict"
930n.r(t),n.d(t,{default:()=>E,getTextPersistanceInfo:()=>w,normalizeButtonState:()=>x})
931n(76881)
932var a=n(12259),r=n(48431),i=n(14953),o=n.n(i),s=n(85263),l=n(63640),c=n(65736),u=n(37406),d=n(557),p=n(62929),h=n(81909),g=n(81715),f=n(34097),m=n(28321),v=n(94420),b=n(42295)
933function y(e){return(0,p.O5)((0,u.V)(e).update("link",s.$)).remove("imageData")}function x(e){return e.get("link")?e:e.set("buttonenabled",!1).set("opentab",!1)}
933const C={imageTextSettings:v.A,imageTextColorSettings:m.A,imageSettings:f.A},D=["text","headline","buttontext"],w=e=>D.reduce(((t,n)=>t.set(n,"buttontext"!==n?Boolean(e.get(n)):Boolean(e.get(n)&&e.get("buttonenabled")))),o().Map()),A=o().Map({text:"",buttontext:"",headline:"",link:"",buttonenabled:!1,opentab:!1})
934function E({config:e,data:t,onDataChange:n,onSave:i,onCancel:o,renderLayout:s}){const[u,f]=(0,r.useState)(null),[m,v]=(0,r.useState)("imageTextSettings"),D=(0,d.WD)("interface","components.imageElementComponent.settingsModal")
935return(0,b.jsx)(a.Form,{name:"pluginImageSettings",value:(0,p.qp)(x(t)),prepare:e=>(0,p.qp)(e.mergeDeep(A,c.xK,e)),onChange:e=>n((0,p.O5)(x(e))),onSubmit:i,normalize:y,children:s({title:(0,l.L)({tab:m,tScoped:D,isEditActive:t.get("src")}),tabs:Object.keys(C).map((e=>({name:e,title:(0,l.L)({tab:e,tScoped:D,isEditActive:t.get("src")}),active:m===e,onClick:e=>{v(e)}}))),body:(()=>{const n={error:u,config:e,handleError:e=>{f(e)},imageInfo:{src:t.get("src")},textPersistanceInfo:w(t),componentName:"imageElementComponent"}
936return(0,r.createElement)(C[m],n)})(),footer:(0,b.jsxs)(g.A,{children:[(0,b.jsx)(h.A,{type:"button",variant:"outline",onClick:()=>{f(null),o()},children:D("cancelButton.label")}),(0,b.jsx)(h.A,{children:D("saveButton.label")})]})})})}},52307:(e,t,n)=>{"use strict"
937n.r(t),n.d(t,{MAXIMUM_NUMBER_OF_IMAGES:()=>E,default:()=>j})
938n(39155),n(76672),n(76881)
939var a,r,i=n(12259),o=n(48431),s=n(14953),l=n.n(s),c=n(91121),u=n(85263),d=n(557),p=n(81909),h=n(81715),g=(n(98456),n(80142)),f=n(38169),m=n(17312),v=n(9926),b=n(51769),y=n(51546),x=n(81671),C=n(34990),D=n(42295)
940function w({data:e,selectedImagePosition:t,onApply:n,onCancel:s,imageUrl:l,previewUrl:u,storeFile:w,helpCenterUrl:A}){var E,j
941const B=(0,d.WD)("interface","components.imageGalleryComponent.imageEditModal"),[k,S]=(0,o.useState)(e.get("images").find((e=>e.get("position")===t))),[N,F]=(0,o.useState)(null),O=(0,o.useRef)(null),M=N?k.get("localPreview"):u(l(k.get("src"))),P=!k.get("link"),[T,I]=(0,o.useState)(null);(0,o.useEffect)((()=>()=>{N?.cancel()}),[N])
942const R=async e=>{const t=g.A.CancelToken.source(),n={cancelToken:t.token}
943S(k.update("localPreview",(()=>URL.createObjectURL(e)))),F(t)
944const a=await L(e,n)
945a&&S((e=>e.merge({src:a.absoluteDownloadUrl,width:a.width,height:a.height})))},L=async(e,t)=>{try{return I(null),await w(e,t)}catch(e){return e?.response?.data?.message?.startsWith("Animated image has too many frames.")?(I("gifHasTooManyFrames"),null):e?.response?.data?.message?.startsWith("Uploaded image resolution across all frames is too big.")?(I("imageResolutionTooBig"),null):(I(e?.response?.status||"unknown"),null)}finally{F(null)}},_={413:"requestEntityTooLarge",415:"unsupportedMediaType",gifHasTooManyFrames:"gifHasTooManyFrames",imageResolutionTooBig:"imageResolutionTooBig"}
946return(0,D.jsxs)(D.Fragment,{children:[N?E||(E=(0,D.jsxs)("div",{className:"image-busy-indicator ep-form-row",children:[a||(a=(0,D.jsx)("span",{className:"image-spinner"})),(0,D.jsx)("img",{src:M,draggable:"false",alt:""})]})):(0,D.jsxs)("div",{className:"image-preview ep-form-row",children:[j||(j=(0,D.jsx)("img",{src:M,alt:""})),(0,D.jsx)("div",{className:"image-button-wrapper",children:(0,D.jsx)(f.S,{onUnsplashSelect:e=>R(e),onUploadClick:()=>O.current?.click(),buttonTooltip:B("changeImageButton.tooltip"),buttonAriaLabel:B("changeImageButton.accessibilityLabel"),buttonClassName:"ep-button-circular ep-button-icon-change",side:"top"})})]}),T&&(0,D.jsx)("div",{className:"ep-form-row",children:(0,D.jsxs)("div",{className:"dali-notification-danger",children:[T?B(":components.imageGalleryComponent.imageFieldMultiple.errorMessages.imageEditModalMessage",{reason:B(`:components.imageGalleryComponent.imageFieldMultiple.errorMessages.reason.${_[T]||"unknown"}`)}):"","gifHasTooManyFrames"!==T&&"imageResolutionTooBig"!==T&&(0,D.jsx)("a",{href:A,target:"_blank",className:"ep-form-row-text-external-link",rel:"noreferrer noopener",children:B(":components.imageGalleryComponent.imageFieldMultiple.errorMessages.helpCenterLink")})]})}),(0,D.jsxs)(i.Form,{name:"imageEditPopover",value:k,onChange:e=>{S(e)},onKeyDown:e=>{"Enter"===e.key&&n(k)},children:[(0,D.jsx)(b.A,{info:B("alternativeTextInputField.explanation"),name:"alt",tagName:"label",label:B("alternativeTextInputField.label"),children:r||(r=(0,D.jsx)(x.A,{name:"alt",type:"text"}))}),(0,D.jsx)(y.A,{name:"link",children:(e,t)=>(0,D.jsx)(C.A,{t:B,link:e,setLink:t,label:"linkInputField.label"})}
946),(0,D.jsx)(b.A,{className:(0,c.A)(["ep-form-row-min-margin",{disabled:P}]),name:"opentab",tagName:"label",label:B("openLinkInNewTabCheckbox.label"),labelAfterComponent:!0,children:(0,D.jsx)(v.A,{name:"opentab",disabled:P})}),(0,D.jsxs)(h.A,{children:[(0,D.jsx)(p.A,{type:"button",variant:"outline",onClick:()=>s(),children:B("cancelButton.label")}),(0,D.jsx)(p.A,{type:"button",onClick:()=>n(k),children:B("applyButton.label")})]})]}),(0,D.jsx)("input",{ref:O,hidden:!0,type:"file",accept:m.m_.join(","),onChange:async e=>{if(!e.target.files)return!1
947await R(e.target.files[0])},value:"","data-testid":"uploadField"})]})}var A=n(58075)
948const E=24
949function j({config:e,data:t,onCancel:n,onSave:a,onDataChange:r,onBusyStateChange:s,renderLayout:l}){const[u,g]=(0,o.useState)("count"),[f,m]=(0,o.useState)(!1),v=(0,o.useRef)(0),b=(0,d.WD)("interface","components.imageGalleryComponent.settingsModal"),y=(0,d.WD)("interface","components.imageGalleryComponent.imageFieldMultiple"),x=t.get("images")?.size||0;(0,o.useEffect)((()=>(v.current&&window.clearTimeout(v.current),0===x&&"delete"!==u?g("empty"):x>E?g("full"):"count"!==u&&(v.current=window.setTimeout((()=>g("count")),2500)),()=>{v.current&&window.clearTimeout(v.current)}
949)),[u,x])
950const C=e=>{switch(e){case"success":return b("footerText.imageUploaded")
951case"delete":return b("footerText.imageDeleted")
952case"empty":return b("footerText.uploadImagesNotification",{maximumNumberOfUploadedImages:E})
953case"count":return b("footerText.uploadedImages",{maximumNumberOfUploadedImages:E,numberOfUploadedImages:x})
954case"full":return b("footerText.uploadImagesMaximum",{maximumNumberOfUploadedImages:E})
955default:return""}}
956return(0,D.jsx)(i.Form,{name:"pluginImageGallerySettings",value:t,onSubmit:a,onChange:e=>{r(e.update("images",(e=>function(e){return e.forEach((e=>delete e.localPreview)),e}(e))))},normalize:B,children:({value:t})=>l({title:b(x>0?"imageSettings.title.onEdit":"imageSettings.title.onCreate"),body:(0,D.jsx)("scroll-shadow",{children:(0,D.jsx)("div",{className:"dali-settingslayer-main-content",children:(0,D.jsx)(A.A,{data:t,setFooterInfo:g,setIsSaveDisabled:m,onBusyStateChange:s,imageUrl:e?.imageUrl,storeFile:e?.storeFile,previewUrl:e?.previewUrl,maximumNumberOfImages:E,EditPopoverComponent:w,popoverClassName:"dali-plugin-imagegallery-popover",t:y})})}),footer:(0,D.jsxs)(h.A,{children:[(0,D.jsx)("div",{className:(0,c.A)(["dali-settingslayer-status",`dali-settingslayer-status-${u}`]),children:C(u)},u),(0,D.jsx)(p.A,{variant:"outline",type:"button",onClick:n,children:b("cancelButton.label")}),(0,D.jsx)(p.A,{disabled:f,children:b("saveButton.label")})]})})})}function B(e){return e.update("images",(e=>e.map((e=>l().Map({src:e.get("src"),width:e.get("width"),height:e.get("height"),alt:e.get("alt"),link:e.get("link")?(0,u.$)(e.get("link")):"",opentab:e.get("opentab"),position:e.get("position")})))))}},50786:(e,t,n)=>{"use strict"
957n.r(t),n.d(t,{MAXIMUM_NUMBER_OF_IMAGES:()=>w,default:()=>A})
958n(39155),n(76672),n(76881)
959var a,r=n(12259),i=n(48431),o=n(14953),s=n.n(o),l=n(91121),c=n(85263),u=n(557),d=n(81909),p=n(81715),h=n(51546),g=n(58075),f=(n(7121),n(98456),n(83807)),m=n(9926),v=n(51769),b=n(81671),y=n(34990),x=n(42295)
960function C({data:e,selectedImagePosition:t,onApply:n,onCancel:o,imageUrl:s,previewUrl:c,storeFile:g}){var C
961const w=(0,u.WD)("interface","components.logoElementComponent.logoEditModal"),[A,E]=(0,i.useState)(e.get("images").find((e=>e.get("position")===t))),[j,B]=(0,i.useState)(!1),k=c(s(A.get("src"))),S=!A.get("link"),N=async(e,t)=>{if(!A.get("refSrc")){const n=await g(t)
962E((t=>t.merge({edit:e,src:n.absoluteDownloadUrl,width:n.width,height:n.height,refSrc:t.get("src")})))}},F=async(e,t,n)=>{const a=[g(t)]
963n&&n!==t&&a.push(g(n))
964const r=await Promise.all(a),i=r[0],o=t===n?r[0]:r[1]
965E((t=>t.merge({edit:e,src:i.absoluteDownloadUrl,width:i.width,height:i.height,refSrc:o?o.absoluteDownloadUrl:t.get("refSrc")}))),B(!1)},O=()=>{B(!1)}
966return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(x.Fragment,{children:[!j&&(0,x.jsxs)("div",{className:"image-preview ep-form-row",children:[C||(C=(0,x.jsx)("img",{src:k,alt:""})),(0,x.jsx)("div",{className:"image-button-wrapper",children:(0,x.jsx)(d.A,{type:"button",variant:"circular",icon:"crop",title:w("editLogoButton.tooltip"),onClick:()=>B(!0)})})]}),j&&(0,x.jsx)(f.ImageEditor,{src:s(A.get("refSrc")||A.get("src")),aspectRatioMap:D,initial:!A.get("refSrc"),edit:A.get("edit")?.toJS()||{aspectRatio:{label:"original",value:A.get("width")/A.get("height")},offset:[0,0],zoom:1},onInit:N,onCancel:O,onChange:F})]}),(0,x.jsxs)(r.Form,{name:"logoEditPopover",value:A,onChange:e=>{E(e)},onKeyDown:e=>{"Enter"===e.key&&n(A)},children:[(0,x.jsx)(v.A,{info:w("alternativeTextInputField.explanation"),name:"alt",tagName:"label",label:w("alternativeTextInputField.label"),children:a||(a=(0,x.jsx)(b.A,{name:"alt",type:"text"}))}),(0,x.jsx)(h.A,{name:"link",children:(e,t)=>(0,x.jsx)(y.A,{t:w,link:e,setLink:t,label:"linkInputField.label"})}),(0,x.jsx)(v.A,{className:(0,l.A)(["ep-form-row-min-margin",{disabled:S}]),name:"opentab",tagName:"label",label:w("openLinkInNewTabCheckbox.label"),labelAfterComponent:!0,children:(0,x.jsx)(m.A,{name:"opentab",disabled:S})}),(0,x.jsxs)(p.A,{children:[(0,x.jsx)(d.A,{type:"button",variant:"outline",onClick:()=>o(),children:w("cancelButton.label")}),(0,x.jsx)(d.A,{type:"button",onClick:()=>n(A),children:w("applyButton.label")})]})]})]})}const D={"2:3":2/3,"1:1":1,"3:2":1.5,"3:1":3,"4:1":4},w=24
967function A({config:e,data:t,onCancel:n,onSave:a,onDataChange:o,onBusyStateChange:s,renderLayout:c}){const[f,m]=(0,i.useState)("count"),[v,b]=(0,i.useState)(!1),y=(0,i.useRef)(0),D=(0,u.WD)("interface","components.logoElementComponent.settingsModal"),A=(0,u.WD)("interface","components.logoElementComponent.imageFieldMultiple"),j=t.get("images")?.size??0;(0,i.useEffect)((()=>(y.current&&window.clearTimeout(y.current),0===j&&"delete"!==f?m("empty"):j>w?m("full"):"count"!==f&&(y.current=window.setTimeout((()=>m("count")),2500)),()=>{y.current&&window.clearTimeout(y.current)})),[f,j])
968const B=e=>{switch(e){case"success":return D("footerText.logoUploaded")
969case"delete":return D("footerText.logoDeleted")
970case"empty":return D("footerText.uploadLogosNotification",{maximumNumberOfUploadedImages:w})
971case"count":return D("footerText.uploadedLogos",{maximumNumberOfUploadedImages:w,numberOfUploadedImages:j})
972case"full":return D("footerText.uploadLogosMaximum",{maximumNumberOfUploadedImages:w})
973default:return""}}
974return(0,x.jsx)(r.Form,{name:"pluginLogoSettings",value:t,onSubmit:a,onChange:e=>{o(e.update("images",(e=>function(e){return e.forEach((e=>delete e.localPreview)),e}(e))))},normalize:E,children:({value:t})=>c({title:D(j>0?"logoSettings.title.onEdit":"logoSettings.title.onCreate"),body:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("label",{className:"ep-form-row dali-settingslayer
974-label",children:[D("sizeSlider.label"),(0,x.jsx)(h.A,{name:"size",children:e=>(0,x.jsx)(r.RangeField,{className:"dali-range-input",name:"size",min:55,max:200,step:1,disabled:0===j,style:{"--min":55,"--max":200,"--val":e}})})]}),(0,x.jsxs)("label",{className:"ep-form-row dali-settingslayer-label",children:[D("gapSlider.label"),(0,x.jsx)(h.A,{name:"gap",children:e=>(0,x.jsx)(r.RangeField,{className:"dali-range-input",name:"gap",min:0,max:100,step:1,disabled:j<2,style:{"--min":0,"--max":100,"--val":e}})})]}),(0,x.jsx)("scroll-shadow",{children:(0,x.jsx)("div",{className:"dali-settingslayer-main-content",children:(0,x.jsx)(g.A,{data:t,setFooterInfo:m,setIsSaveDisabled:b,onBusyStateChange:s,imageUrl:e?.imageUrl,storeFile:e?.storeFile,previewUrl:e?.previewUrl,maximumNumberOfImages:w,EditPopoverComponent:C,popoverClassName:"logo-edit-popover",t:A})})})]}),footer:(0,x.jsxs)(p.A,{children:[(0,x.jsx)("div",{className:(0,l.A)(["dali-settingslayer-status",`dali-settingslayer-status-${f}`]),children:B(f)},f),(0,x.jsx)(d.A,{variant:"outline",type:"button",onClick:n,children:D("cancelButton.label")}),(0,x.jsx)(d.A,{disabled:v,children:D("saveButton.label")})]})})})}function E(e){return e.update("images",(e=>e.map((e=>s().Map({src:e.get("src"),width:e.get("width"),height:e.get("height"),alt:e.get("alt"),refSrc:e.get("refSrc"),edit:e.get("edit"),link:e.get("link")?(0,c.$)(e.get("link")):"",opentab:e.get("opentab"),position:e.get("position")})))))}},26035:(e,t,n)=>{"use strict"
975n.r(t),n.d(t,{FormikOnChange:()=>y,default:()=>x})
976var a=n(61720),r=n(14953),i=n(48431),o=n(93020),s=n(42295)
977function l({t:e}){const[{value:t}]=(0,a.Mt)("productId"),n=!t
978return(0,s.jsx)("div",{className:"dali-settingslayer-productshowcase-layout",children:(0,s.jsxs)("fieldset",{disabled:n,children:[(0,s.jsx)("legend",{children:e("layoutSetting.label")}),(0,s.jsx)(o.A,{name:"layout",disabled:n,options:[{value:"detailed",label:e("layoutSetting.detailedRadioButton.label")},{value:"simple",label:e("layoutSetting.simpleRadioButton.label")}]})]})})}n(76881)
979var c=n(84507),u=n(91121),d=n(85968),p=n(12086)
980var h=n(94539),g=n(16230)
981function f({config:e,productId:t,removeProduct:n,t:a}){const r=(0,c.wA)(),o=(0,c.d4)((e=>t?(0,d.r)(e.getIn(["productData","productPlugin",t])):void 0)),l=(0,c.d4)((e=>e.getIn(["shop","sellingCountryId"])||null));(0,i.useEffect)((()=>{t&&o?.productId!==t&&r((0,p.kU1)("productPlugin",[t],l)).then((e=>{0===e.totalNumberOfProducts&&n()}))}),[t,r,o?.productId])
982const h=`/themes/epages.base/assets/images/${(0,c.d4)((e=>e.getIn(["view","hashedThemeAssets"]))).getIn(["epages.base/assets/images","placeholder_180.jpg"])}`,g=e?.thumbnailUrl||(e=>e),f=o?.image?g(o?.image.url):h
983return(0,s.jsxs)("div",{className:"dali-plugin-productshowcase-products-list",children:[(0,s.jsx)("div",{className:"dali-plugin-productshowcase-productslist-headline",children:a("list.headline")}),!o&&(0,s.jsx)("div",{className:"dali-plugin-productshowcase-productslist-emptynote",children:a("list.emptyNote")}),o&&(0,s.jsx)("div",{className:"dali-plugin-productshowcase-productslist-list",children:(0,s.jsxs)("div",{className:(0,u.A)(["dali-plugin-productshowcase-wrapper",{invisible:!o?.isVisible}]),children:[(0,s.jsx)("div",{className:"dali-plugin-productshowcase-image",style:{backgroundImage:`url('${f}')`}}),(0,s.jsx)("div",{className:"dali-plugin-productshowcase-sku",title:o.sku,children:o.sku}),(0,s.jsxs)("div",{className:"dali-plugin-productshowcase-name",title:o.name,children:[o.name,!o.isVisible&&(0,s.jsx)("span",{children:(0,s.jsx)("i",{className:"dali-plugin-productshowcase-icon-invisible",title:a("invisibleIcon.label")})})]}),(0,s.jsx)("div",{className:"dali-plugin-productshowcase-price",children:o.price?.formatted}),(0,s.jsx)("div",{className:"dali-plugin-productshowcase-button-delete",title:a("deleteButton.label"),onClick:()=>n()})]})})]})}function m({config:e,t}){const n=(0,c.d4)((e=>e.getIn(["view","hashedThemeAssets"]))),[{value:r},,{setValue:o}]=(0,a.Mt)("productId"),[l,d]=(0,i.useState)(),p=(0,i.useCallback)((e=>{o(e),d(void 0)}),[o]),m=(0,h.u)(r?void 0:l),v=(0,i.useCallback)((e=>{m&&e>=0&&m[e]&&p(m[e].productId)}),[m,p]),[b,y,x]=function(e,t,n){const a=(0,i.useRef)(null);(0,i.useEffect)((()=>{const e=e=>{const n=e.target
984a?.current?.contains(n)||t(void 0)}
985return document.addEventListener("click",e),()=>document.removeEventListener("click",e)}),[t])
986const r=(0,i.useRef)(null),[o,s]=(0,i.useState)(-1),l=(0,i.useCallback)((a=>{switch(a.key){case"Enter":o&&e&&(a.preventDefault(),s(-1),n(o))
987break
988case"Escape":a.preventDefault(),s(-1),t()
989break
990case"ArrowUp":e&&o>-1&&(a.preventDefault(),s(o-1))
991break
992case"ArrowDown":e&&o<e.length-1&&(a.preventDefault(),s(o+1))}}),[t,n,e,o])
993return(0,i.useEffect)((()=>{const e=r.current
994if(e)return e.addEventListener("keydown",l),()=>e.removeEventListener("keydown",l)}),[l,r]),[o,a,r]}(r?[]:m,d,v)
995return(0,s.jsxs)(g.A,{name:"productId",label:t("productIdSetting.label"),children:[(0,s.jsxs)("div",{className:"ep-form-row",children:[(0,s.jsx)("div",{ref:y,className:"ep-form-smart ep-form-smart-with-suggestions",children:(0,s.jsx)("div",{className:"ep-form-smart-input",children:(0,s.jsx)("input",{ref:x,type:"text",className:"ep-form-smart-input-text",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off","aria-label":t("productIdSetting.label"),spellCheck:!1,disabled:Boolean(r),value:l||"",onClick:e=>d(e.currentTarget.value),onChange:e=>d(e.target.value)})})}),m?.length?(0,s.jsx)("div",{className:"ep-form-smart-suggestions",children:m.map((({name:t,image:a,slug:r,productId:i},o)=>(0,s.jsx)("div",{className:(0,u.A)(["ep-form-smart-suggestion",b===o&&"ep-form-smart-suggestion-active"]),onClick:()=>p(i),children:(0,s.jsxs)("div",{className:"dali-plugin-productslider-wrapper",children:[(0,s.jsx)("div",{className:"dali-plugin-productslider-image",style:{backgroundImage:a?.url?`url("${e?.thumbnailUrl?.(a.url)}")`:`url('/themes/epages.base/assets/images/${n.getIn(["epages.base/assets/images","placeholder_180.jpg"])}`}}),(0,s.jsx)("div",{className:"dali-plugin-productslider-name",children:t})]})},r)))}):null]}),(0,s.jsx)(f,{productId:r,t,removeProduct:()=>o(""),config:e})]})}var v=n(81909),b=n(81715)
996function y({onChange:e}){const{values:t}=(0,a.j7)()
997return(0,i.useEffect)((()=>{e(t)}),[t]),null}function x({config:e,data:t,onCancel:n,onDataChange:i,onSave:o,renderLayout:c,t:u}){const d=(e,t)=>u(`settingsModal.${e}`,t),p=t.toJS(),h=d("title"),g=(0,s.jsxs)("div",{className:"dali-settingslayer-main-content",children:[(0,s.jsx)(m,{t:d,config:e}),(0,s.jsx)(l,{t:d})]}),f=(0,s.jsxs)(b.A,{children:[(0,s.jsx)(v.A,{variant:"outline",type:"button",onClick:n,children:d("cancelButton.label")}),(0,s.jsx)(v.A,{type:"submit",children:d("saveButton.label")})]})
998return(0,s.jsx)(a.l1,{initialValues:p,onSubmit:e=>o((0,r.fromJS)(e)),children:(0,s.jsxs)(a.lV,{translate:"no",children:[(0,s.jsx)(y,{onChange:e=>i((0,r.fromJS)(e))}),c({title:h,body:g,footer:f})]})})}},83581:(e,t,n)=>{"use strict"
999n.r(t),n.d(t,{default:()=>D})
1000n(76881)
1001var a=n(12259),r=n(84507),i=n(48431),o=(n(39155),n(98357),n(98083)),s=n(91121),l=n(17336),c=n.n(l),u=n(12086),d=n(51769),p=n(51546),h=n(557),g=n(42295)
1002function f({config:e,product:t,onDelete:n}){const a=(0,r.d4)((e=>e.getIn(["view","hashedThemeAssets"]))),i=(0,h.WD)("interface"),o=e?.thumbnailUrl||(e=>e),l=t.isVisible?"":"invisible"
1003return(0,g.jsxs)("div",{className:(0,s.A)(["dali-plugin-productslider-wrapper",l]),children:[(0,g.jsx)("div",{className:"dali-plugin-productslider-image",style:{backgroundImage:t.image?.url?`url("${o(t.image.url)}")`:`url('/themes/epages.base/assets/images/${a.getIn(["epages.base/assets/images","placeholder_180.jpg"])}`}}),(0,g.jsx)("div",{className:"dali-plugin-productslider-sku",title:t.sku,children:t.sku}),(0,g.jsxs)("div",{className:"dali-plugin-productslider-name",title:t.name,children:[t.name,!t.isVisible&&(0,g.jsx)("span",{children:(0,g.jsx)("i",{className:"dali-plugin-productslider-icon-invisible",title:i("components.productListEntry.invisible")})})]}),(0,g.jsx)("div",{className:"dali-plugin-productslider-price",children:t.price?.formatted}),(0,g.jsx)("div",{className:"dali-plugin-productslider-button-delete",title:i("components.productListEntry.deleteButton"),onClick:()=>n(t.productId)})]})}var m=n(79681)
1004const v=12,b=e=>e.productId
1005var y=n(81909),x=n(81715)
1006const C={productSliderProductsSetting:function({t:e,config:t,data:n,selectedProducts:a,getProductData:l}){const h=(0,r.d4)((e=>e.getIn(["view","hashedThemeAssets"]))),y=(0,r.wA)(),x=(0,m.A)(),[C,D]=(0,i.useState)(!1)
1007let w
1008w=C?"success":0===a.size?"empty":a.size>=v?"full":"count"
1009const A=(0,i.useRef)(0);(0,i.useEffect)((()=>{const e=A.current
1010return()=>{e&&window.clearTimeout(e)}}),[])
1011const E=e=>t=>{l(n.get("id"),t.toJS()),e(t),D(!0),A.current&&window.clearTimeout(A.current),A.current=window.setTimeout((()=>D(!1)),3e3)},j=c()((e=>x((async()=>await y((0,u.yYc)(e))))),200),B=e=>(0,g.jsxs)("div",{className:"dali-plugin-productslider-wrapper",children:[(0,g.jsx)("div",{className:"dali-plugin-productslider-image",style:{backgroundImage:e.image&&e.image.url?`url("${t?.thumbnailUrl?.(e.image.url)}")`:`url('/themes/epages.base/assets/images/${h.getIn(["epages.base/assets/images","placeholder_180.jpg"])}`}}),(0,g.jsx)("div",{className:"dali-plugin-productslider-name",children:e.name})]}),k=async(e,t)=>{if(t.size>=v)return null
1012return(await j(e)).filter((e=>!t.includes(e.productId)))},S=(e,t)=>a=>{const r=e.filter((e=>e!==a)).toList()
1013t(r),l(n.get("id"),r.toJS())}
1014return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(p.A,{name:"productIds",children:(n,r)=>
1014{return(0,g.jsxs)("div",{className:"dali-settingslayer-main-content",children:[(0,g.jsx)(d.A,{name:"productSearch",tagName:"label",label:e("searchInputField.label"),className:(0,s.A)([{disabled:n.size>=v}]),children:(0,g.jsx)(o.SmartInputFieldRaw,{value:n,hideValues:!0,strict:!0,getSuggestions:k,onChange:E(r),suggestionDisabled:(i=n,e=>i.size>=v||i.includes(e.productId)),convertSuggestionToValue:b,className:"ep-form-smart",renderSuggestion:B,disabled:n.size>=v,resetText:!1,selectText:!0})}),(0,g.jsx)("scroll-shadow",{children:(0,g.jsxs)("div",{className:"dali-plugin-productslider-productslist",children:[(0,g.jsx)("div",{className:"dali-plugin-productslider-productslist-headline",children:e("productList.headline")}),(0,g.jsx)("div",{className:(0,s.A)(["dali-plugin-productslider-productslist-list"]),children:a.size>0?a.toJS().map((e=>e&&(0,g.jsx)(f,{product:e,config:{thumbnailUrl:t?.thumbnailUrl},onDelete:S(n,r)},e.productId))):(0,g.jsx)("div",{className:"dali-plugin-productslider-productslist-emptynote",children:e("productList.emptyNote")})})]})})]})
1015var i}}),(0,g.jsx)("div",{className:(0,s.A)(["dali-settingslayer-status",`dali-settingslayer-status-${w}`]),children:(t=>{switch(t){case"success":return e("footer.productAssigned")
1016case"empty":return e("footer.assignProductsNotification",{maximumNumberOfAssignedProducts:v})
1017case"count":return e("footer.assignedProducts",{maximumNumberOfAssignedProducts:v,numberOfAssignedProducts:a.size})
1018case"full":return e("footer.assignProductsMaximum",{maximumNumberOfAssignedProducts:v})
1019default:return""}})(w)},w)]})},productSliderProductSizeSetting:function({t:e}){const t=[{label:e("imageSize.options.S"),value:"S"},{label:e("imageSize.options.M"),value:"M"},{label:e("imageSize.options.L"),value:"L"}]
1020return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:"ep-form-row",children:(0,g.jsx)("span",{children:e("imageSize.explanation")})}),(0,g.jsx)(d.A,{name:"imageSize",label:e("imageSize.label"),children:(0,g.jsx)(a.RadioButtonField,{className:"dali-settingslayer-category-image-size",name:"imageSize",buttons:t})})]})}}
1021function D({config:e,data:t,onSave:n,onCancel:o,onDataChange:s,renderLayout:l,selectedProducts:c}){const d=(0,i.useRef)(t.get("productIds")),p=(0,h.WD)("interface"),f=(e,t)=>p(`components.productSliderComponent.settingsModal.${e}`,t),v=(0,m.A)(),b=(0,r.wA)(),D=(0,r.d4)((e=>e.getIn(["shop","userSettings","countrySelection","sellingCountryId"])||null)),w=(e,t)=>v((()=>Promise.resolve(b((0,u.kU1)(e,t,D))))),[A,E]=(0,i.useState)("productSliderProductsSetting"),j=C[A]
1022return(0,g.jsx)(a.Form,{name:"pluginProductSlider",value:t.set("imageSize",t.get("imageSize","S")),onChange:s,onSubmit:n,children:l({title:c.size>0?f(`${A}.title.onEdit`):f(`${A}.title.onCreate`),tabs:Object.keys(C).map((e=>({name:e,title:f(`${e}.title.onEdit`),active:A===e,onClick:e=>E(e)}))),body:(0,g.jsx)(j,{t:f,config:e,data:t,selectedProducts:c,getProductData:w}),footer:(0,g.jsxs)(x.A,{children:[(0,g.jsx)(y.A,{variant:"outline",type:"button",onClick:()=>{t.get("productIds")!==d.current&&w(t.get("id"),d.current.toJS()),o()},children:f("cancelButton.label")}),(0,g.jsx)(y.A,{children:f("saveButton.label")})]})})})}},79390:(e,t,n)=>{"use strict"
1023n.d(t,{A:()=>r})
1024var a=n(42295)
1025function r({attributes:e,children:t,element:n}){switch(e.style=e.style||{},n.align&&(e.style.textAlign=n.align),n.color&&(e.style.color=n.color),n.type){case"paragraph":return(0,a.jsx)("p",{...e,children:t})
1026case"headline1":return(0,a.jsx)("h1",{...e,children:t})
1027case"headline2":return(0,a.jsx)("h2",{...e,children:t})
1028case"headline3":return(0,a.jsx)("h3",{...e,children:t})
1029case"blockquote":return(0,a.jsx)("blockquote",{...e,children:t})
1030case"unordered-list":return(0,a.jsx)("ul",{...e,children:t})
1031case"ordered-list":return(0,a.jsx)("ol",{...e,children:t})
1032case"list-item":return(0,a.jsx)("li",{...e,children:t})
1033case"list-item-child":return(0,a.jsx)("div",{...e,children:t})
1034case"link":return(0,a.jsx)("a",{...e,href:n.url,target:n.isExternal?"_blank":"",rel:n.isExternal?"noopener noreferrer":"",children:t})
1035case"button":return(0,a.jsx)("div",{...e,children:(0,a.jsx)("a",{className:"rich-text-button",href:n.url,target:n.isExternal?"_blank":"",rel:n.isExternal?"noopener noreferrer":"",children:t})})
1036default:return t}}},19736:(e,t,n)=>{"use strict"
1037n.d(t,{A:()=>r})
1038var a=n(42295)
1039function r({attributes:e,children:t,leaf:n}){return n.bold&&(t=(0,a.jsx)("strong",{children:t})),n.italic&&(t=(0,a.jsx)("em",{children:t})),n.underline&&(t=(0,a.jsx)("u",{children:t})),n.color&&(t=(0,a.jsx)("span",{style:{color:n.color},children:t})),(0,a.jsx)("span",{...e,children:t})}}
1039,77702:(e,t,n)=>{"use strict"
1040n.r(t),n.d(t,{ToolbarContext:()=>G,default:()=>J,initialToolbarState:()=>q,toolbarReducer:()=>Y})
1041var a=n(53835),r=n(52763),i=n(48431),o=n(41871),s=n(91121),l=n(59086),c=n(30202),u=n(60435),d=n(94083),p=n(16277),h=n(557),g=n(93795),f=n(85519),m=n(1421),v=n(94322),b=n(64948),y=n(42295)
1042function x(e,t){return Array.from(r.KE.nodes(e,{match:e=>e.align===t&&p.CO.includes(e.type)})).length}function C({t:e,format:t}){const n=(0,a.RV)(),i=x(n,"left")+x(n,void 0),o=x(n,"center"),l=x(n,"right"),c={left:i&&!o&&!l,center:o&&!i&&!l,right:l&&!i&&!o}[t]
1043const u=e(`justify${(0,v.A)(t)}Button.tooltip`)
1044return(0,y.jsx)(b.m,{trigger:(0,y.jsx)("button",{"aria-label":u,className:(0,s.A)(["dali-plugin-text-toolbar-button",`dali-plugin-text-toolbar-button-justify-${t}`,{active:c}]),"data-command-name":`justify-${t}`,type:"button",onMouseDown:function(e){e.preventDefault(),c?r.gB.setNodes(n,{align:void 0},{match:e=>p.CO.includes(e.type)}):r.gB.setNodes(n,{align:t},{match:e=>p.CO.includes(e.type)})}}),content:u,compact:!0,side:"top",sideOffset:6,usePortal:!0,hideIcon:!0})}n(76881)
1045var D,w=n(66153)
1046function A({t:e,isHeadline:t}){const n=(0,a.RV)(),[{isBaseBlockElementsDropdownOpen:o},l]=(0,i.useContext)(G),c=n.useLastSelection(n),{isList:h}=(0,d.vS)(n),g=t?"headline2":"paragraph",f=(0,u.R)(n,n.selection||c.current)||g
1047return(0,y.jsxs)("div",{className:(0,s.A)(["dali-plugin-text-toolbar-dropdown",{open:o}]),children:[(0,y.jsxs)("button",{title:e("baseBlockElementsDropdown.explanation"),"data-command-name":"open-dropdown",onClick:()=>{n.selection||r.gB.select(n,c.current),l({type:"toggle_base_block_elements_dropdown"})},className:"dali-plugin-text-toolbar-dropdown-button",children:[(0,y.jsx)("span",{className:"dali-plugin-text-toolbar-dropdown-active",children:e(`baseBlockElementsDropdown.options.${(0,w.A)(f)}`)}),D||(D=(0,y.jsx)("span",{className:"dali-plugin-text-toolbar-dropdown-caret"}))]}),(0,y.jsx)("ul",{role:"menu",children:p.Py.map((i=>t&&"paragraph"===i?null:(0,y.jsx)("li",{children:(0,y.jsx)("button",{onClick:()=>function(e){r.gB.setNodes(n,{type:e}),a.rL.focus(n),l({type:"close_base_block_elements_dropdown"})}(i),"data-command-name":i,className:(0,s.A)(["dali-plugin-text-toolbar-dropdown-button",{active:i===f}]),disabled:h,children:e(`baseBlockElementsDropdown.options.${(0,w.A)(i)}`)})},i)))})]})}function E({title:e,format:t}){const n=(0,a.RV)(),[{isButtonLinkTooltipOpen:o,isColorPickerOpen:l,isLinkTooltipOpen:c},u]=(0,i.useContext)(G),p=(0,f.kC)(n)||c,h=(0,f.Cg)(n),m=(0,g.ok)(n)||o,v=(0,g.kD)(n),x=Array.from(r.KE.nodes(n,{match:e=>r.Hg.isElement(e)&&"paragraph"===e.type})).length>1,C=(0,d.cb)(n)
1048return(0,y.jsx)(b.m,{trigger:(0,y.jsx)("button",{"aria-label":e,className:(0,s.A)(["dali-plugin-text-toolbar-button",`dali-plugin-text-toolbar-button-${t}`,{active:m&&"button"===t}]),"data-command-name":t,type:"button",onMouseDown:function(e){e.preventDefault(),"button"===t?u({type:"open_button_tooltip"}):"unbutton"===t&&((0,g.i1)(n),u({type:"close_button_tooltip"}))},disabled:!n.selection&&!o&&!l||p||"unbutton"===t&&!v||"button"===t&&!m&&(v||h||x||C)}),content:e,compact:!0,side:"top",sideOffset:6,usePortal:!0,hideIcon:!0})}n(39155),n(16120)
1049var j=n(84507),B=n(44420),k=n(65736),S=n(42716)
1050const N=function({editableRef:e}){const t=(0,h.WD)("interface"),[{isColorPickerOpen:n,isButtonLinkTooltipOpen:o},l]=(0,i.useContext)(G),u=(0,j.d4)((e=>e.getIn(["shop","theme","name"],"").replace(".","_"))),[d]=u.split(B.ko),p=(0,k.L0)(((e,...n)=>t(`components.colorFieldComponent.popover.colorPresets.${e}.tooltip`,...n)),((e,...n)=>t(`themes:${d}.settings.${e}`,...n))),f=(0,a.RV)(),m=f.useLastSelection(f),v=(0,g.kD)(f)||o,x=i.useRef(null),C=r.KE.marks(f),D=C?C.color:Array.from(r.KE.nodes(f,{at:m.current,match:r.EY.isText}))[0]?.[0].color,w=e=>"list-item"===e.type,A=e=>"list-item-child"===e.type,E=(e,t)=>r.gB.setNodes(f,{color:e},{mode:"all",match:w,...t&&{at:m.current}}),N=(e,t)=>{const n=Array.from(r.KE.nodes(f,{match:A,...t&&{at:m.current}})),a=n[0]?.[0]
1051if(!a||!r.Hg.isElement(a))return
1052e||E(void 0,t)
1053const i=a.children[0],o=i&&"color"in i&&(i.color||null)
1054a.children.every((e=>e.color===o))&&E(e,t)}
1055return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(b.m,{trigger:(0,y.jsx)("button",{ref:x,"aria-label":t("components.richTextComponent.colorButton.tooltip"),className:(0,s.A)(["dali-plugin-text-toolbar-button","dali-plugin-text-toolbar-button-color",{active:Boolean(D)}]),"data-command-name":"color",type:"button",onClick:()=>{l({type:"toggle_color_picker"}),!f.selection&&m.current&&r.gB.select(f,m.current)},disabled:v}),content:t("components.richTextComponent.colorButton.tooltip"),compact:!0,side:"top",sideOffset:6,usePortal:!0,hideIcon:!0}),(0,y.jsx)(c.A,{open:n,virtualRef:x,onEscapeKeyDown:()=>{l({type:"toggle_color_picker"})},avoidCollisions:!0,children:(0,y.jsxs)("div",{children:[(0,y.jsx)(S.A,{className:"colorpicker",dimensions:{width:220,height:200,hueWidth:14,spacing:7},value:D||"#000000",onChange:e=>{f.selection?(r.KE.addMark(f,"color",e),N(e)):m.current&&r.Q6.isExpanded(m.current)?(r.gB.setNodes(f,{color:e},{match:r.EY.isText,split:!0,at:m.current}),N(e,!0)):(f.marks={...C||{},color:e},f.onChange())},onChangeComplete:()=>{f.onChange(),a.rL.focus(f),!f.selection&&m.current&&f.isValidRange(f,m.current)&&r.gB.select(f,m.current)},presetColors:p.toJS()}),(0,y.jsx)("button",{type:"button",className:"ep-color-settings-reset-button",onClick:()=>{r.KE.removeMark(f,"color"),N(),!f.selection&&m.current&&r.gB.select(f,m.current),a.rL.focus(f)}
1055,children:t("components.colorFieldComponent.popover.resetButton.label")})]})})]})}
1056var F=n(79390),O=n(19736),M=n(62420),P=n(56641),T=n(6443),I=n(82457),R=n(62148),L=n(50707)
1057function _({editableRef:e}){const t=(0,a.RV)(),{linkTooltipState:n,linkTooltipDispatch:r,errorDispatch:o}=(0,T.i8)(),[{isButtonLinkTooltipOpen:s},l]=(0,i.useContext)(G),u=t.useLastSelection(t),[d,p]=(0,L.A)();(0,P.J3)(t,s,n,r,l,g.ok,g.vq,"open_button_tooltip","close_button_tooltip")
1058const h={current:p}
1059return(0,y.jsx)(c.A,{open:s,virtualRef:h,side:"bottom",className:"dali-plugin-link-tooltip",usePortal:!0,avoidCollisions:!0,onMouseDown:e=>{e.stopPropagation()},onPointerDownOutside:()=>{l({type:"close_link_tooltip"})},onOpenAutoFocus:e=>{n.isViewMode&&e.preventDefault()},children:n.isViewMode?(0,y.jsx)(R.A,{lastSelection:u,editor:t,unlink:g.i1}):(0,y.jsx)(I.A,{inputRef:d,handleInsert:function(){(0,P.j)(t,u,n,r,o,!0)}})})}var $=n(1425)
1060function z({title:e,format:t}){const n=(0,a.RV)(),[{isLinkTooltipOpen:r,isColorPickerOpen:o,isButtonLinkTooltipOpen:c}]=(0,i.useContext)(G),{isList:u}=(0,d.vS)(n,t)
1061return(0,y.jsx)(b.m,{trigger:(0,y.jsx)("button",{"aria-label":e,className:(0,s.A)(["dali-plugin-text-toolbar-button",`dali-plugin-text-toolbar-button-${t}`,{active:u}]),"data-command-name":t,type:"button",disabled:!n.selection&&!r&&!o&&!c||(0,l.vG)(n)||(0,g.ok)(n)||c,onMouseDown:function(e){e.preventDefault(),(0,d.vv)(n,t)}}),content:e,compact:!0,side:"top",sideOffset:6,usePortal:!0,hideIcon:!0})}var W=n(63171),U=n(79655),V=n(99471)
1062const H=100,K=70
1063const q={isColorPickerOpen:!1,isBaseBlockElementsDropdownOpen:!1,isLinkTooltipOpen:!1,isButtonLinkTooltipOpen:!1},G=(0,i.createContext)([q,()=>{}])
1064function Y(e,t){switch(t.type){case"toggle_color_picker":return e.isColorPickerOpen?{...e,isColorPickerOpen:!1}:{...e,isLinkTooltipOpen:!1,isButtonLinkTooltipOpen:!1,isBaseBlockElementsDropdownOpen:!1,isColorPickerOpen:!0}
1065case"close_color_picker":return{...e,isColorPickerOpen:!1}
1066case"toggle_base_block_elements_dropdown":return e.isBaseBlockElementsDropdownOpen?{...e,isBaseBlockElementsDropdownOpen:!1}:{...e,isLinkTooltipOpen:!1,isButtonLinkTooltipOpen:!1,isBaseBlockElementsDropdownOpen:!0,isColorPickerOpen:!1}
1067case"close_base_block_elements_dropdown":return{...e,isBaseBlockElementsDropdownOpen:!1}
1068case"open_link_tooltip":return{...e,isColorPickerOpen:!1,isBaseBlockElementsDropdownOpen:!1,isLinkTooltipOpen:!0}
1069case"close_link_tooltip":return{...e,isLinkTooltipOpen:!1}
1070case"open_button_tooltip":return{...e,isColorPickerOpen:!1,isBaseBlockElementsDropdownOpen:!1,isButtonLinkTooltipOpen:!0}
1071case"close_button_tooltip":return{...e,isButtonLinkTooltipOpen:!1}
1072case"reset":return q
1073default:throw new Error}}function J({html:e,isHeadline:t,onChange:n,onFocus:s,setRef:l}){const[c,u]=(0,i.useState)((0,p.ZC)(e)),[v,b]=(0,i.useState)(null),[x,C]=(0,i.useReducer)(Y,q),D=(0,i.useRef)(null),w=(0,i.useRef)(null),A=(0,i.useMemo)((()=>{const e=(0,o.$k)((0,m.G)((0,f.q9)((0,g.Ey)((0,d.u7)((0,p.Fj)((0,a.o$)((0,r.ie)())))))))
1074return t&&(0,p.DA)((0,m.n)(e)),e}),[t]),E=(0,h.WD)("interface"),j=(0,i.useCallback)((e=>(0,y.jsx)(F.A,{...e})),[]),B=(0,i.useCallback)((e=>(0,y.jsx)(O.A,{...e})),[]),k=v&&(D.current?.contains(v)||w.current?.contains(v)),S=x.isColorPickerOpen||x.isBaseBlockElementsDropdownOpen||x.isLinkTooltipOpen||x.isButtonLinkTooltipOpen,N=k||S;(0,i.useEffect)((()=>{A.children=c,r.KE.normalize(A,{force:!0}),u(A.children)}),[]),(0,i.useEffect)((()=>
1074{l({focus:()=>{r.gB.select(A,[0]),A.selection&&r.gB.select(A,r.Q6.start(A.selection)),a.rL.focus(A)}})}),[]),(0,U.A)("mousedown",(e=>{b(e.target)})),(0,U.A)("click",(()=>{if(!k){const t=(0,p.lK)(c)
1075e!==t?n(t):C({type:"reset"})}}))
1076const M=(0,i.useMemo)((()=>[x,C]),[x])
1077return(0,y.jsx)(G.Provider,{value:M,children:(0,y.jsx)(a.A,{editor:A,initialValue:c,onChange:e=>u([...e]),children:(0,y.jsx)(X,{editor:A,editableRef:D,toolbarRef:w,renderLeaf:B,renderElement:j,updateOnFocus:()=>{s()},isHeadline:t,scopedT:e=>E(`components.richTextComponent.${e}`),shouldShowToolbar:N})})})}function X({editor:e,editableRef:t,toolbarRef:n,renderLeaf:r,renderElement:o,updateOnFocus:p,isHeadline:h,scopedT:g,shouldShowToolbar:f}){const[m,v]=function(e,t){const[n,a]=(0,i.useState)(!1),[r,o]=(0,i.useState)(null),s=(0,i.useRef)(null),l=(0,i.useRef)(null),c=(0,i.useCallback)((()=>{s.current&&(cancelAnimationFrame(s.current),s.current=null)}),[]),u=(0,i.useCallback)((()=>{if(!t||!e.current)return o(null),a(!1),void(l.current=null)
1078const n=e.current.getBoundingClientRect()
1079if(n.top>=window.innerHeight||n.bottom<=K)return o(null),void(l.current=null)
1080const r=n.top<=H
1081a(r)
1082const i=r?0:n.top,s=l.current
1083if(null===s||s.left!==n.left||s.top!==i||s.width!==n.width){const e=new DOMRect(n.left,i,n.width,0)
1084l.current=e,o(new V.t({clientRect:e}))}}),[e,t]),d=(0,i.useCallback)((()=>{c(),s.current=requestAnimationFrame(u)}),[u,c])
1085return(0,U.A)("scroll",d,document,{passive:!0,capture:!0,disabled:!t}),(0,U.A)("resize",d,window,{passive:!0,disabled:!t}),(0,i.useEffect)((()=>(t&&u(),()=>c())),[t,u,c]),[r,n]}(t,f)
1086return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{ref:t,children:[(0,y.jsx)(a.Fo,{className:"dali-plugin-text-content-editable",renderLeaf:r,renderElement:o,onFocus:p,placeholder:g(h?"textInputField.headlinePlaceholder":"textInputField.standardPlaceholder"),onKeyDown:h?void 0:t=>{(0,d.ZU)?.(e,t),(0,l.lT)?.(e,t),(0,u.q)?.(e,t)}}),(0,y.jsxs)(T.Ay,{children:[(0,y.jsx)($.A,{editableRef:t}),(0,y.jsx)(_,{editableRef:t})]})]}),(0,y.jsx)(c.A,{open:f&&!!m,className:"dali-plugin-text-toolbar-popover",virtualRef:{current:m},side:"top",sideOffset:v?10:30,avoidCollisions:!0,collisionPadding:{top:0,left:20,right:20,bottom:0},onOpenAutoFocus:e=>e.preventDefault(),hideArrow:!0,usePortal:!0,zIndex:0,children:(0,y.jsxs)("div",{ref:n,className:(0,s.A)(["dali-plugin-text-toolbar",{"dali-plugin-text-toolbar-active":f}]),children:[(0,y.jsx)(A,{t:g,isHeadline:h}),(0,y.jsx)(W.A,{title:g("boldButton.tooltip"),format:"bold"}),(0,y.jsx)(W.A,{title:g("italicButton.tooltip"),format:"italic"}),(0,y.jsx)(W.A,{title:g("underlineButton.tooltip"),format:"underline"}),!h&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(l.Ay,{title:g("blockquoteButton.tooltip")}),(0,y.jsx)(M.A,{title:g("linkButton.tooltip"),format:"link"}),(0,y.jsx)(M.A,{title:g("removeHyperlinkButton.tooltip"),format:"unlink"}),(0,y.jsx)(z,{title:g("insertNumberedListButton.tooltip"),format:"ordered-list"}),(0,y.jsx)(z,{title:g("insertBulletListButton.tooltip"),format:"unordered-list"})]}),(0,y.jsx)(C,{t:g,format:"left"}),(0,y.jsx)(C,{t:g,format:"center"}),(0,y.jsx)(C,{t:g,format:"right"}),!h&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(E,{title:g("buttonLinkElementButton.tooltip"),format:"button"}),(0,y.jsx)(E,{title:g("removeButtonLinkElementButton.tooltip"),format:"unbutton"})]}),(0,y.jsx)(N,{editableRef:t})]})})]})}},60435:(e,t,n)=>{"use strict"
1087n.d(t,{R:()=>s,q:()=>l})
1088n(39155),n(98456)
1089var a=n(52763),r=n(5473),i=n(16277),o=n(93795)
1090function s(e,t){return i.Py.find((n=>{const[r]=a.KE.nodes(e,{match:e=>e.type===n,at:t})
1091return Boolean(r)}))}function l(e,t){if(r.A.isSplitBlock(t)){a.Q6.isExpanded(e.selection)&&a.KE.deleteFragment(e)
1092const n=s(e,e.selection)
1093if(n&&n.includes("headline"))a.KE.insertBreak(e),a.gB.setNodes(e,{type:"paragraph"}),t.preventDefault()
1094else if((0,o.ok)(e)){const[n,r]=a.Q6.edges(e.selection),[[i,s]]=a.KE.nodes(e,{match:o.Bm}),l=a.KE.isStart(e,n,s),c=a.KE.isEnd(e,r,s)
1095l?(a.gB.insertNodes(e,{type:"paragraph",align:i.align,children:[{text:""}]}),a.gB.move(e),t.preventDefault()):c&&(a.gB.insertNodes(e,{type:"paragraph",align:i.align,children:[{text:""}]}),t.preventDefault())}}}},93795:(e,t,n)=>{"use strict"
1096n.d(t,{Bm:()=>c,Ey:()=>l,QN:()=>g,i1:()=>h,kD:()=>p,ok:()=>d,vq:()=>u})
1097n(39155),n(28383)
1098var a=n(52763),r=n(16277),i=n(85263),o=n(85519),s=n(59086)
1099function l(e){const{normalizeNode:t}=e
1100return e.normalizeNode=n=>{const[r,i]=n
1101if(c(r)&&r.children.some((e=>e.color))){const{selection:t}=e
1102return a.gB.select(e,i),a.KE.removeMark(e,"color"),void a.gB.setSelection(e,t)}t(n)},e}function c(e){return"button"===e.type}function u(e){const[t]=a.KE.nodes(e,{match:c})
1103return t}function d(e){if(!e.selection)return!1
1104const[,t]=a.KE.node(e,a.Q6.start(e.selection)),[n]=a.KE.parent(e,t)
1105return c(n)}function p(e){return Array.from(a.KE.nodes(e,{match:c})).length>0}function h(e){const[t,n]=u(e)
1106a.gB.setNodes(e,{...t,type:"paragraph"},{at:n}),a.gB.select(e,n)}function g(e,t,n,l){const c=(0,i.$)(t),u=e.selection&&a.Q6.isCollapsed(e.selection),[d]=Array.from(a.KE.nodes(e,{match:e=>r.CO.includes(e.type)})),p={type:"button",url:c,children:u?[{text:n||t}]:void 0,isExternal:void 0!==l?l:(0,o.Pq)(c)}
1107if(d&&(p.align=d[0].align),u){const t=e.isEmptyLine(e),{selection:n}=e;(0,s.vG)(e)?(a.KE.insertNode(e,p),t&&a.gB.removeNodes(e,{at:n})):t?(e.apply({type:"insert_node",node:p,path:n.focus.path}),a.gB.unwrapNodes(e,{mode:"highest"})):(a.KE.insertBreak(e),a.KE.insertNode(e,p))}else a.gB.setNodes(e,p,{split:!0})}},85519:(e,t,n)=>{"use strict"
1108n.d(t,{Cg:()=>u,Ck:()=>p,Pq:()=>f,TE:()=>l,kC:()=>c,q9:()=>o,wr:()=>h,y1:()=>d})
1109n(39155),n(16120)
1110var a=n(52763),r=n(27127),i=n(85263)
1111function o(e){const{isInline:t,normalizeNode:n,insertText:i}=e
1112return e.isInline=e=>s(e)||t(e),e.insertText=t=>{const{selection:n}=e
1113if(" "===t&&n&&a.Q6.isCollapsed(n)){const[r]=a.KE.nodes(e,{match:e=>s(e)})
1114if(r){const[,o]=r,s=a.KE.end(e,o)
1115if(a.bR.equals(n.anchor,s)){const n=a.KE.after(e,o)
1116if(n)return a.gB.select(e,n),void i(t)}}}i(t)},e.normalizeNode=t=>{const[i,o]=t
1117if(s(i)&&i.children.every((e=>""===e.text))){if(e.selection&&(0,r.A)(e.selection.focus.path,[...o,0])){const t={...e.selection.focus,path:e.selection.focus.path.slice(0,-1)}
1118a.gB.removeNodes(e,{at:o}),a.gB.select(e,{anchor:t,focus:t})}else a.gB.removeNodes(e,{at:o})}else n(t)},e}function s(e){return"link"===e.type}function l(e){const[t]=a.KE.nodes(e,{match:s})
1119return t}function c(e){if(!e.selection)return!1
1120const[,t]=a.KE.node(e,a.Q6.start(e.selection)),[n]=a.KE.parent(e,t)
1121return s(n)}function u(e){return Array.from(a.KE.nodes(e,{match:s})).length>0}function d(e){a.gB.unwrapNodes(e,{match:s})}function p(e,t,n,r){const o=(0,i.$)(t),s=e.selection&&a.Q6.isCollapsed(e.selection),l={type:"link",url:o,children:s?[{text:n||t}]:void 0,isExternal:void 0!==r?r:f(o)}
1122s?a.gB.insertNodes(e,l):a.gB.wrapNodes(e,l,{split:!0})}function h(e){let t=(0,i.$)(e);(t.startsWith("/")||t.startsWith("#"))&&(t="http://epages.de"+t)
1123const n=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i")
1124return"email"===g(t)?/^mailto:([^@]+)@([^@]+)$/.test(t):"tel"===g(t)?/^tel:(\+?\d{1,20})([\d\-\s().]{0,30})$/.test(t):"javascript"===g(t)||n.test(t)}function g(e){return e.startsWith("mailto:")?"email":e.startsWith("tel:")?"tel":e.startsWith("javascript:")?"javascript":"link"}function f(e){return"link"===g(e)&&location.host!==new URL(e,location.origin).host}},94083:(e,t,n)=>{"use strict"
1125n.d(t,{Ur:()=>h,ZU:()=>g,cb:()=>c,u7:()=>d,vS:()=>u,vv:()=>f,x_:()=>l})
1126n(7121),n(39155),n(16120),n(76672)
1127var a=n(52763),r=n(5473),i=n(16277),o=n(60435)
1128function s(e){const t=Array.from(e)
1129return t[t.length-1]}const l=e=>i.L6.includes(e.type)
1130function c(e){return Array.from(a.KE.nodes(e,{match:l})).length>0}function u(e,t){const n=s(a.KE.nodes(e,{match:e=>i.L6.includes(e.type)}))
1131if(!n||t&&n[0].type!==t)return{isList:!1}
1132const[r,o]=n,l=s(a.KE.nodes(e,{match:e=>"list-item"===e.type}))
1133if(!l)return{isList:!1}
1134const[c,u]=l,d=u[u.length-1],p=s(a.KE.nodes(e,{match:e=>"list-item-child"===e.type}))
1135if(!p)return{isList:!1}
1136const[h,g]=p
1137return{list:r,listPath:o,listItem:c,listItemPath:u,listItemChild:h,listItemChildPath:g,listItemIndex:d,isList:!0}}function d(e){const{normalizeNode:t}=e
1138return e.normalizeNode=n=>{const[r,o]=n
1139if(a.KE.isEditor(r))for(let t=0;t<r.children.length;t++){const n=r.children[t],o=r.children[t+1]
1140if(i.L6.includes(n.type)&&o&&n.type===o.type)return void a.gB.mergeNodes(e,{at:[t+1]})}"list-item"===r.type&&r.children.forEach(((t,n)=>{![...i.L6,"list-item-child"].includes(t.type)&&a.gB.setNodes(e,{type:"list-item-child"},{at:[...o,n]})})),t(n)},e}function p(e){const{listItemPath:t,list:n,listItemIndex:r,listPath:i,listItem:o}=u(e)
1141if("list-item"===a.bP.parent(e,i).type){a.gB.moveNodes(e,{at:t,to:a.wA.next(a.wA.parent(i))})
1142const o=n.children.slice(r+1)
1143o.length>0&&(a.gB.insertNodes(e,{type:n.type,children:o},{at:[...a.wA.next(a.wA.parent(i)),1]}),o.forEach((()=>a.gB.removeNodes(e,{at:t})))),0===r&&a.gB.removeNodes(e,{at:i})}else{const s=o.children.length>1
1144s&&a.gB.removeNodes(e,{at:[...t,1]}),a.gB.unwrapNodes(e,{at:t}),a.gB.setNodes(e,{type:"paragraph"},{at:t})
1145let l=a.wA.next(i)
1146a.gB.moveNodes(e,{at:t,to:l}),l=a.wA.next(l)
1147const c=n.children.slice(r+1)
1148s&&(a.gB.insertNodes(e,{type:o.children[1].type,children:o.children[1].children},{at:l}),l=a.wA.next(l)),c.length>0&&(a.gB.insertNodes(e,{type:n.type,children:c},{at:l}),l=a.wA.next(l),c.forEach((()=>a.gB.removeNodes(e,{at:t})))),0===r&&a.gB.removeNodes(e,{at:i})}}function h(e){const{listItemChildPath:t,listItemPath:n,listItem:r,listItemChild:i}=u(e),[[o]]=a.KE.nodes(e,{match:a.EY.isText}),s={type:"list-item",children:[{...i,type:"list-item-child",children:[{...o,text:""}]}]}
1149if(i.children.every((e=>""===e.text)))p(e)
1150else if(a.KE.isEnd(e,e.selection.focus,t)){const t=r.children[1]
1151t&&(s.children.push(t),a.gB.removeNodes(e,{at:[...n,1]})),a.gB.insertNodes(e,s,{at:a.wA.next(n)}),a.gB.select(e,{path:[...a.wA.next(n),0,0],offset:0})}else a.KE.isStart(e,e.selection.focus,t)?(a.gB.insertNodes(e,s,{at:a.wA.next(n)}),a.gB.select(e,{path:[...a.wA.next(n),0,0],offset:0})):(a.gB.splitNodes(e),a.gB.wrapNodes(e,{type:"list-item"}),a.gB.moveNodes(e,{at:[...n,1],to:a.wA.next(n)}))}function g(e,t){if(r.A.isDeleteBackward(t)){const{isList:n,listItemChildPath:r,listPath:i}=u(e)
1152if(n){const[n,o]=a.Q6.edges(e.selection),s=a.KE.isStart(e,n,r)&&a.Q6.isCollapsed(e.selection),l=0!==i[0]&&a.KE.isEnd(e,n,a.wA.previous(i))&&a.KE.isStart(e,o,r);(s||l)&&(t.preventDefault(),p(e))}}else if(r.A.isDeleteForward(t)){if(a.Q6.isExpanded(e.selection))return
1153const n=a.Q6.end(e.selection),r=n.path[0]
1154if(!(r!==e.children.length-1))return
1155const[o]=a.KE.node(e,[r+1]),s=i.L6.includes(o.type)
1156a.KE.isEnd(e,n,[r])&&s&&(t.preventDefault(),a.gB.move(e),p(e),a.gB.move(e,{reverse:!0}))}else if(r.A.isSplitBlock(t)&&a.Q6.isCollapsed(e.selection)){const{isList:n}=u(e)
1157if(!n)return
1158t.preventDefault(),h(e)}else if("Tab"===t.key){const{isList:n,listItemIndex:r,listItemPath:i,list:o}=u(e)
1159if(n)if(t.preventDefault(),t.nativeEvent.shiftKey)p(e)
1160else{if(0===r)return
1161const t=o.children[r-1],n=a.wA.previous(i)
11621===t.children.length?(a.gB.wrapNodes(e,{type:o.type},{at:i}),a.gB.moveNodes(e,{at:i,to:[...n,t.children.length]})):a.gB.moveNodes(e,{at:i,to:[...n,1,t.children[1].children.length]})}}}function f(e,t){const{isList:n}=u(e,t),{isList:r,listPath:s}=u(e),l=!n&&r
1163if(n)for(;u(e).isList;)p(e)
1164else if(l)a.gB.setNodes(e,{type:t},{at:s})
1165else{const n=()=>Boolean((0,o.R)(e,e.selection))
1166for(;n();){const[[,n]]=a.KE.nodes(e,{match:e=>i.Py.includes(e.type)})
1167a.gB.setNodes(e,{type:"list-item-child"},{at:n}),a.gB.wrapNodes(e,{type:"list-item"},{at:n}),a.gB.wrapNodes(e,{type:t},{at:n})}}}},16277:(e,t,n)=>{"use strict"
1168n.d(t,{CO:()=>O,Py:()=>N,L6:()=>F,ZC:()=>M,lK:()=>P,DA:()=>$,Fj:()=>_})
1169n(7121),n(39155),n(98357),n(98456),n(76672),n(76881),n(28383),n(9508),n(29068)
1170var a=n(52763),r=n(93497)
1171function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e){var t=function(e,t){if("object"!==i(e)||null===e)return e
1172var n=e[Symbol.toPrimitive]
1173if(void 0!==n){var a=n.call(e,t||"default")
1174if("object"!==i(a))return a
1175throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string")
1176return"symbol"===i(t)?t:String(t)}function s(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=new WeakMap,c=new WeakMap
1177class u{}class d extends u{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
1178super(),s(this,"offset",void 0),s(this,"path",void 0)
1179var{offset:t,path:n}=e
1180this.offset=t,this.path=n}}class p extends u{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
1181super(),s(this,"offset",void 0),s(this,"path",void 0)
1182var{offset:t,path:n}=e
1183this.offset=t,this.path=n}}var h=e=>c.get(e)
1184function g(e,t){var n=Object.keys(e)
1185if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
1186t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
1187t%2?g(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=new WeakSet,v=e=>{var t=[],n=e=>{if(null!=e){var r=t[t.length-1]
1188if("string"==typeof e){var i={text:e}
1189m.add(i),e=i}if(a.EY.isText(e)){var o=e
1190a.EY.isText(r)&&m.has(r)&&m.has(o)&&a.EY.equals(r,o,{loose:!0})?r.text+=o.text:t.push(o)}else if(a.Hg.isElement(e))t.push(e)
1191else{if(!(e instanceof u))throw new Error("Unexpected hyperscript child object: ".concat(e))
1192var s=t[t.length-1]
1193a.EY.isText(s)||(n(""),s=t[t.length-1]),e instanceof d?((e,t)=>{var n=e.text.length
1194l.set(e,[n,t])})(s,e):e instanceof p&&((e,t)=>{var n=e.text.length
1195c.set(e,[n,t])})(s,e)}}}
1196for(var r of e.flat(1/0))n(r)
1197return t}
1198function b(e,t,n){return f(f({},t),{},{children:v(n)})}function y(e,t){var n=Object.keys(e)
1199if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
1200t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
1201t%2?y(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var C,D={anchor:function(e,t,n){return new d(t)},cursor:function(e,t,n){return[new d(t),new p(t)]},editor:(C=a.ie,(e,t,n)=>{var r,i=[]
1202for(var o of n)a.Q6.isRange(o)?r=o:i.push(o)
1203var s,c=v(i),u={},d=C()
1204for(var[p,g]of(Object.assign(d,t),d.children=c,a.bP.texts(d))){var f=(s=p,l.get(s)),m=h(p)
1205if(null!=f){var[b]=f
1206u.anchor={path:g,offset:b}}if(null!=m){var[y]=m
1207u.focus={path:g,offset:y}}}
1207if(u.anchor&&!u.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.")
1208if(!u.anchor&&u.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.")
1209return null!=r?d.selection=r:a.Q6.isRange(u)&&(d.selection=u),d}),element:b,focus:function(e,t,n){return new p(t)},fragment:function(e,t,n){return v(n)},selection:function(e,t,n){var a=n.find((e=>e instanceof d)),r=n.find((e=>e instanceof p))
1210if(!a||null==a.offset||null==a.path)throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.")
1211if(!r||null==r.offset||null==r.path)throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.")
1212return f({anchor:{offset:a.offset,path:a.path},focus:{offset:r.offset,path:r.path}},t)},text:function(e,t,n){var r=v(n)
1213if(r.length>1)throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.")
1214var[i]=r
1215if(null==i&&(i={text:""}),!a.EY.isText(i))throw new Error("\n    The <text> hyperscript tag can only contain text content as children.")
1216return m.delete(i),Object.assign(i,t),i}},w=e=>function(t,n){for(var a=arguments.length,i=new Array(a>2?a-2:0),o=2;o<a;o++)i[o-2]=arguments[o]
1217var s=e[t]
1218if(!s)throw new Error("No hyperscript creator found for tag: <".concat(t,">"))
1219return null==n&&(n={}),(0,r.Q)(n)||(i=[n].concat(i),n={}),s(t,n,i=i.filter((e=>Boolean(e))).flat())},A=e=>{var t={},n=function(){var n=e[a]
1220if("object"!=typeof n)throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(a,">  tag you passed: ").concat(n))
1221t[a]=(e,t,a)=>b(0,x(x({},n),t),a)}
1222for(var a in e)n()
1223return t},E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{elements:t={}}=e,n=A(t),a=x(x(x({},D),n),e.creators)
1224return w(a)}(),j=n(66039),B=n.n(j),k=n(94083),S=n(85519)
1225const N=["paragraph","headline1","headline2","headline3"],F=["ordered-list","unordered-list"],O=["paragraph","headline1","headline2","headline3","list-item-child","button"]
1226function M(e){return L((new DOMParser).parseFromString(e,"text/html").body)}function P(e){return e.map((function e(t){if(a.EY.isText(t)){if(!t.text)return""
1227let e=B()(t.text)
1228return t.bold&&(e=`<strong>${e}</strong>`),t.underline&&(e=`<u>${e}</u>`),t.italic&&(e=`<em>${e}</em>`),t.color&&(e=`<span style="color:${t.color}">${e}</span>`),e}const n=t.children.map((t=>e(t))).join(""),r=[]
1229t.align&&r.push(`text-align:${t.align}`),t.color&&r.push(`color:${t.color}`)
1230const i=r.length>0?` style="${r.join(";")}"`:""
1231switch(t.type){case"paragraph":return`<p${i}>${n}</p>`
1232case"headline1":return`<h1${i}>${n}</h1>`
1233case"headline2":return`<h2${i}>${n}</h2>`
1234case"headline3":return`<h3${i}>${n}</h3>`
1235case"blockquote":return`<blockquote${i}>${n}</blockquote>`
1236case"list-item":return`<li${i}>${n}</li>`
1237case"list-item-child":return`<div${i}>${n}</div>`
1238case"ordered-list":return`<ol${i}>${n}</ol>`
1239case"unordered-list":return`<ul${i}>${n}</ul>`
1240case"link":{if(!(0,S.wr)(t.url))return n
1241let e=`href="${t.url}"`
1242return t.isExternal&&(e+=' target="_blank" rel="noopener noreferrer"'),e+=i,`<a ${e}>${n}</a>`}case"button":{let e=`href="${t.url}"`
1243return t.isExternal&&(e+=' target="_blank" rel="noopener noreferrer"'),e+=' class="rich-text-button"',`<div ${i}><a ${e}>${n}</a></div>`}default:return n}})).join("")}const T={P:()=>({type:"paragraph"}),H1:()=>({type:"headline1"}),H2:()=>({type:"headline2"}),H3:()=>({type:"headline3"}),BLOCKQUOTE:()=>({type:"blockquote"}),LI:()=>({type:"list-item"}),DIV:e=>1===e.childNodes.length&&!z(e.parentNode,"li")&&"A"===e.firstChild?.nodeName?{type:"button",url:e.firstChild.getAttribute("href"),isExternal:e.firstChild.getAttribute("target")}:{type:"list-item-child"},OL:()=>({type:"ordered-list"}),UL:()=>({type:"unordered-list"}),A:e=>({type:"link",url:e.getAttribute("href"),isExternal:e.target})},I={STRONG:()=>({bold:!0}),EM:()=>({italic:!0}),U:()=>({underline:!0}),SPAN:e=>({color:e.style.color})},R=[...Object.keys(T),...Object.keys(I),"BODY"]
1244function L(e){const t=e.parentNode&&"BODY"===e.parentNode.nodeName,n=1===e.parentNode.childNodes.length,a=R.includes(e.nodeName)
1245if(3===e.nodeType){const n=0===e.textContent.trim().length
1246return t&&n?null:t?E("element",{type:"paragraph"},e.textContent.replace(/\n/g," ")):e.textContent.replace(/\n/g," ")}if(!a)return t&&n?E("element",{type:"paragraph"}
1246,""):t?null:"B"===e.nodeName&&e.textContent?E("text",I.STRONG(e),e.textContent):""
1247const r="button"===T.DIV(e).type,i=["P","H1","H2","H3","BLOCKQUOTE","OL","UL"].includes(e.nodeName)||r,o=[...Object.keys(I),"A"]
1248if(t&&!i){if(o.includes(e.tagName)){const t=document.createElement("p")
1249return e.parentNode.insertBefore(t,e),t.appendChild(e),L(t)}const t=Array.from(e.childNodes).map((e=>z(e,"p")?Array.from(e.childNodes).map(L):L(e)))
1250return 0===t.length&&t.push({text:""}),E("element",{type:"paragraph"},t)}if(W(e)){if(W(e.parentNode))return Array.from(e.childNodes).map(L)
1251Array.from(e.childNodes).forEach((e=>{if(W(e)){const t=U(e)
1252if(t)t.appendChild(e)
1253else{const t=V(e)
1254t&&t.appendChild(e)}}}))}if(z(e,"li")){Array.from(e.childNodes).filter((e=>!z(e,"div","ul","ol"))).forEach((t=>{if(t.previousSibling&&z(t.previousSibling,"div"))t.previousSibling.appendChild(t)
1255else{const n=document.createElement("div")
1256e.insertBefore(n,t),n.appendChild(t)}}))}if(z(e,"li")){let t=null
1257Array.from(e.childNodes).filter(W).forEach((n=>{t?(Array.from(n.childNodes).forEach((e=>{t.appendChild(e)})),e.removeChild(n)):t=n}))}const s=Array.from(e.childNodes).map(L)
1258if("BODY"===e.nodeName)return 0===s.length?[{type:"paragraph",children:[{text:""}]}]:E("fragment",{},s)
1259if(T[e.nodeName]){let n=T[e.nodeName](e)
1260const a="button"===n.type,r={}
1261if(e.align&&(r.align=e.align),e.style&&e.style.textAlign&&(r.align=e.style.textAlign),e.color&&(r.color=e.color),e.style&&e.style.color&&(r.color=e.style.color),0===s.length&&s.push(E("text",{},"")),z(e,"div")&&!a&&(!e.parentNode||!z(e.parentNode,"li")))return t&&(n=T.P(e)),s
1262if(a){const t=Array.from(e.firstChild.childNodes).map(L)
1263return 0===t.length&&t.push(E("text",{},"")),E("element",{...n,...r},t)}return E("element",{...n,...r},s)}if(I[e.nodeName]){const t=I[e.nodeName](e)
1264return 0===s.length?E("text",t,""):s.flat().map((e=>"link"===e.type||"button"===e.type?(e.children=e.children.map((e=>({...t,...e}))),e):E("text",t,e)))}return s}function _(e){const{insertData:t}=e
1265return e.insertData=n=>{if(n.types.includes("application/x-slate-fragment")){const r=n.getData("application/x-slate-fragment"),i=decodeURIComponent(window.atob(r)),o=JSON.parse(i),{isList:s}=(0,k.vS)(e),l=Boolean(o.find(k.x_))
1266if(s){const t=(n,r)=>{0!==r&&(0,k.Ur)(e),"list-item"===n.type?(t(n.children[0],0),n.children[1]&&a.KE.insertNode(e,n.children[1])):(0,k.x_)(n)||"blockquote"===n.type?n.children.forEach(t):a.KE.insertNode(e,n.children)}
1267o.forEach(t)}else l?o.forEach(((t,n)=>{const[r]=a.KE.nodes(e,{match:e=>e.type===t.type}),i=Boolean(r),[o]=a.KE.nodes(e,{match:e=>N.includes(e.type)}),s=Boolean(o)
12680===n&&i?a.KE.insertNode(e,t.children):a.KE.insertNode(e,t),(0,k.x_)(t)&&s&&!a.bP.string(o[0])&&a.gB.removeNodes(e,{at:o[1]})})):(e.isEmptyLine(e)&&a.gB.setNodes(e,o[0]),t(n))}else{const r=n.getData("text/plain")
1269if(r&&(0,S.wr)(r))(0,S.Ck)(e,r)
1270else if(r){const{isList:t}=(0,k.vS)(e),n=/(\r\n|\r|\n)/gm
1271r.split(n).forEach((r=>{n.test(r)?t?(0,k.Ur)(e):a.KE.insertBreak(e):a.KE.insertNode(e,[{text:r}])}))}else t(n)}},e}function $(e){const{insertData:t}=e
1272return e.insertData=n=>{if(n.types.includes("application/x-slate-fragment")){const t=n.getData("application/x-slate-fragment"),r=decodeURIComponent(window.atob(t)),i=JSON.parse(r),o=(t,n)=>{t.children.forEach((r=>{if(r.children)o(r)
1273else{const{text:i,bold:o,italic:s,underline:l,color:c}=r,u={text:i,bold:o,italic:s,underline:l,color:c}
1274if(a.KE.insertNode(e,[u]),0===n){const n=t.align
1275n&&a.gB.setNodes(e,{align:n},{at:e.selection})}}}))}
1276i.forEach(o)}else t(n)},e}function z(e,...t){return Boolean(e&&e.tagName)&&t.some((t=>t.toLowerCase()===e.tagName.toLowerCase()))}function W(e){return z(e,"ul","ol")}function U(e){return e.previousSibling?1===e.previousSibling.nodeType?e.previousSibling:U(e.previousSibling):null}function V(e){return e.nextSibling?1===e.nextSibling.nodeType?e.nextSibling:V(e.nextSibling):null}},62420:(e,t,n)=>{"use strict"
1277n.d(t,{A:()=>p})
1278var a=n(52763),r=n(48431),i=n(53835),o=n(91121),s=n(77702),l=n(64948),c=n(85519),u=n(93795),d=n(42295)
1279function p({title:e,format:t}){const n=(0,i.RV)(),[{isLinkTooltipOpen:p,isColorPickerOpen:h,isButtonLinkTooltipOpen:g},f]=(0,r.useContext)(s.ToolbarContext),m=(0,u.ok)(n)||g,v=(0,c.kC)(n)||p,b=(0,c.Cg)(n),y=Array.from(a.KE.nodes(n,{match:e=>"paragraph"===e.type})).length>1,x=Array.from(a.KE.nodes(n,{match:e=>"list-item-child"===e.type})).length>1
1280return(0,d.jsx)(l.m,{trigger:(0,d.jsx)("button",{"aria-label":e,className:(0,o.A)(["dali-plugin-text-toolbar-button",`dali-plugin-text-toolbar-button-${t}`,{active:v&&"link"===t}]),"data-command-name":t,type:"button",onMouseDown:function(e){e.preventDefault(),"link"===t?f({type:"open_link_tooltip"}):"unlink"===t&&(0,c.y1)(n)},disabled:!n.selection&&!p&&!h||m||"unlink"===t&&!b||"link"===t&&!v&&(b||y||x)}),content:e,compact:!0,side:"top",sideOffset:6,usePortal:!0,hideIcon:!0})}},63171:(e,t,n)=>{"use strict"
1281n.d(t,{A:()=>u})
1282var a=n(52763),r=n(48431),i=n(53835),o=n(91121),s=n(77702),l=n(64948),c=n(42295)
1283function u({title:e,format:t}){const n=(0,i.RV)(),[{isLinkTooltipOpen:u,isColorPickerOpen:d,isButtonLinkTooltipOpen:p}]=(0,r.useContext)(s.ToolbarContext),h=a.KE.marks(n),g=h&&h[t]
1284return(0,c.jsx)(l.m,{trigger:(0,c.jsx)("button",{"aria-label":e,className:(0,o.A)(["dali-plugin-text-toolbar-button",`dali-plugin-text-toolbar-button-${t}`,{active:g}]),"data-command-name":t,type:"button",disabled:!(n.selection||u||d||p),onMouseDown:function(e){e.preventDefault(),g?a.KE.removeMark(n,t):a.KE.addMark(n,t,!0)}}),content:e,compact:!0,side:"top",sideOffset:6,usePortal:!0,hideIcon:!0})}},59086:(e,t,n)=>{"use strict"
1285n.d(t,{Ay:()=>p,lT:()=>d,vG:()=>u})
1286var a=n(52763),r=n(53835),i=n(91121),o=n(5473),s=n(64948),l=n(94083),c=n(42295)
1287function u(e){const[t]=a.KE.nodes(e,{match:e=>"blockquote"===e.type})
1288return Boolean(t)}function d(e,t){if(o.A.isSplitBlock(t)&&u(e)&&a.Q6.isCollapsed(e.selection)){const[[n,r]]=a.KE.nodes(e,{match:e=>"blockquote"===e.type}),i=n.children.length-1,o=""===a.bP.string(n.children[i]),s={path:[...r,i,0],offset:0}
1289o&&a.bR.equals(e.selection.focus,s)&&(a.gB.moveNodes(e,{at:[...r,i],to:a.wA.next(r)}),t.preventDefault())}}function p({title:e}){const t=(0,r.RV)(),{isList:n}=(0,l.vS)(t),o=u(t)
1290return(0,c.jsx)(s.m,{trigger:(0,c.jsx)("button",{"aria-label":e,className:(0,i.A)(["dali-plugin-text-toolbar-button","dali-plugin-text-toolbar-button-blockquote",{active:o}]),"data-command-name":"blockquote",type:"button",disabled:n,onMouseDown:function(e){e.preventDefault(),o?a.gB.unwrapNodes(t,{match:e=>"blockquote"===e.type}):a.gB.wrapNodes(t,{type:"blockquote"})}}),content:e,compact:!0,side:"top",sideOffset:6,usePortal:!0,hideIcon:!0})}},50707:(e,t,n)=>{"use strict"
1291n.d(t,{A:()=>s})
1292var a=n(53835),r=n(48431),i=n(99471),o=n(79655)
1293function s(){const e=(0,r.useRef)(null),t=(0,a.RV)(),[n,s]=(0,r.useState)(null),l=t.useLastSelection(t),c=(0,r.useCallback)((()=>
1293{if(!t.selection&&!l?.current)return
1294let e
1295try{const n=t.selection||l.current
1296n&&(e=a.rL.toDOMRange(t,n))}catch{const t=window.getSelection()
1297t?.rangeCount&&(e=t.getRangeAt(0))}if(!e)return
1298const n=e.getBoundingClientRect()
1299n&&(n.width>0||n.height>0)&&s(new i.t({clientRect:n}))}),[t,l])
1300return(0,o.A)("scroll",c,window,{capture:!0,passive:!0}),(0,r.useLayoutEffect)((()=>{t.selection&&a.rL.isFocused(t)&&c()}),[t,t.selection,c]),[e,n]}},1421:(e,t,n)=>{"use strict"
1301n.d(t,{G:()=>s,n:()=>l})
1302n(76881)
1303var a=n(52763),r=n(53835),i=n(48431),o=n(16277)
1304function s(e){return e.useLastSelection=function(e){const t=(0,i.useRef)(void 0)
1305return(0,i.useEffect)((()=>{e.selection&&(t.current=e.selection)}),[e,e.selection]),t},e.isValidRange=function(e,t){try{return r.rL.toDOMRange(e,t),!0}catch{return!1}},e.isEmptyLine=function(e){return""===Array.from(a.KE.nodes(e,{match:e=>a.Hg.isElement(e)&&o.Py.includes(e.type)})).map((([e])=>a.bP.string(e))).join("")},e}function l(e){const{normalizeNode:t}=e
1306return e.normalizeNode=([n,r])=>(0===r.length&&e.children.length>1&&a.gB.mergeNodes(e),t([n,r])),e}},17372:(e,t,n)=>{"use strict"
1307n.r(t),n.d(t,{default:()=>v})
1308var a,r=n(12259),i=n(48431),o=n(14953),s=n.n(o),l=n(33869),c=n(557),u=n(81909),d=n(81715),p=n(51769),h=n(81671),g=n(42295)
1309function f(e){return e.update("src",(e=>e?e.trim():""))}function m(e){return(0,l.g)(e)||(0,l.T)(e)}function v({data:e,onDataChange:t,onCancel:n,onSave:o,renderLayout:l}){const v=(0,c.WD)("interface","components.videoElementComponent.settingsModal"),b=(0,i.useRef)(m(e.get("src"))),y=e.get("src")?v("title.onEdit"):v("title.onCreate"),x=(0,g.jsx)(p.A,{name:"src",tagName:"label",label:v("urlInputField.label"),children:a||(a=(0,g.jsx)(h.A,{autoFocus:!0,name:"src",type:"text"}))}),C=(0,g.jsxs)(d.A,{children:[(0,g.jsx)(u.A,{variant:"outline",type:"button",onClick:n,children:v("cancelButton.label")}),(0,g.jsx)(u.A,{children:v("saveButton.label")})]})
1310return(0,g.jsx)(r.Form,{name:"pluginVideoSettings",value:e,onChange:e=>{const n=m(e.get("src"))
1311n&&n!==b.current&&(b.current=n,t(f(e)))},onSubmit:o,validate:(e,t=!0)=>t?s().fromJS({src:e.get("src")&&!m(e.get("src"))?v("urlInputField.validationMessages.invalidURL"):null}):null,normalize:f,children:l({title:y,explanation:v("explanation"),body:x,footer:C})})}},63640:(e,t,n)=>{"use strict"
1312n.d(t,{L:()=>a})
1313const a=({tab:e,tScoped:t,isEditActive:n})=>{if("imageSettings"!==e)return t(`${e}.title`)
1314return t(`${e}.title.${n?"onEdit":"onCreate"}`)}},85263:(e,t,n)=>{"use strict"
1315n.d(t,{$:()=>i})
1316const a=/^\w[\w\-_.]+\.(co|uk|com|org|net|gov|biz|info|online|shop|store|us|eu|de|ch|at|fr|it|es|cat|pt|pl|cz|au|nz|fi|se|dk|nl|no|ie|ru|br|mx|cloud)/i,r=["preview","previewTheme","previewThemeSettings","shop","language","token","themeTitle","isNowPreview"]
1317function i(e){if(!e)return""
1318let t=e.trim().replace(/^\s*(data|javascript)\s*:(?!(gaOptout|matomoOptout)\(\))/i,"").replace(/\s+/g,"")
1319const n=new URL(t,"https://example.com")
1320if(n.origin===location.origin){for(const e of r)n.searchParams.delete(e)
1321return t=n.href.substring(n.origin.length),t=t.replace(/^\/editor/,""),t}return t.match(a)?"http://"+t:t}},99471:(e,t,n)=>{"use strict"
1322n.d(t,{t:()=>a})
1323class a{constructor({clientRect:e}){this.clientRect=e}getBoundingClientRect(){return this.clientRect}get clientWidth(){return this.getBoundingClientRect().width}get clientHeight(){return this.getBoundingClientRect().height}}},37406:(e,t,n)=>{"use strict"
1324n.d(t,{V:()=>i})
1325n(39155),n(61529)
1326var a=n(14953),r=n.n(a)
1327function i(e){return e.reduce(((e,t,n)=>"string"==typeof t||void 0===t?e.set(n,t?t.trim():""):e.set(n,t)),r().Map())}},94539:(e,t,n)=>{"use strict"
1328n.d(t,{u:()=>c})
1329var a=n(48431),r=n(84507),i=n(17336),o=n.n(i),s=n(32659),l=n(79681)
1330function c(e,t=!0){const n=(0,s.gf)(),i=(0,r.d4)((e=>e.getIn(["shop","locale"]))),[c,u]=(0,a.useState)([]),d=(0,a.useRef)((0,l.A)()),p=(0,a.useMemo)((()=>o()((e=>d.current((()=>n.get("/api/v2/suggestedSearch",{params:{q:e,limit:50,sort:"createdAt-desc",locale:i}}).then((e=>e.data))))),200)),[n,i])
1331return(0,a.useEffect)((()=>{let n=!0
1332return t&&void 0!==e?p(e).then((e=>{n&&u(e)}
1332)).catch():u([]),()=>{n=!1}}),[e,p,t]),c}},71521:(e,t,n)=>{"use strict"
1333n.d(t,{A:()=>i})
1334let a={}
1335const r={getItem:e=>a[e],setItem:(e,t)=>{a[e]=t},removeItem:e=>delete a[e],get length(){return Object.keys(a).length},clear(){a={}},key:e=>Object.keys(a)[e]},i=function(){try{return window.localStorage.setItem("__test__","1"),window.localStorage.removeItem("__test__"),!0}catch{return!1}}()?{setItem:(e,t)=>{try{window.localStorage.setItem(e,t)}catch{}},getItem:e=>window.localStorage.getItem(e),removeItem:e=>window.localStorage.removeItem(e),clear:()=>window.localStorage.clear(),key:e=>window.localStorage.key(e),get length(){return window.localStorage.length}}:r},61678:(e,t,n)=>{"use strict"
1336function a(e){e.dataTransfer&&-1!==Array.from(e.dataTransfer.types).indexOf("Files")&&(e.dataTransfer.dropEffect="none",e.preventDefault())}n.d(t,{A:()=>a})},23435:(e,t,n)=>{"use strict"
1337n.d(t,{A:()=>f,U:()=>g})
1338n(7121)
1339const a=/<!DOCTYPE/i,r=/<(html|head|body)[\s>]/i,i=/<(meta|title|base)[\s/>]/i,o=/<link[^>]*>/gi,s=/itemprop\s*=\s*("[^"]+"|'[^']+'|[^\s"'/>]+)/i,l=/<[a-zA-Z][\w-]*[^>]*(?:<|$)/,c=/<([a-zA-Z][\w-]*)[^>]*\/[^>]*>/g,u=/="[^"]*>|='[^']*>|=[^"'\s>]+["']/,d=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/i,p=/<!--[\s\S]*?-->/g,h=/<svg\b[^>]*>[\s\S]*?<\/svg>/gi,g={DOCUMENT_STRUCTURE:"DOCUMENT_STRUCTURE",HEAD_METADATA:"HEAD_METADATA",UNCLOSED_COMMENT:"UNCLOSED_COMMENT",INCOMPLETE_TAG:"INCOMPLETE_TAG",MALFORMED_TAG:"MALFORMED_TAG",INVALID_SELF_CLOSING:"INVALID_SELF_CLOSING"}
1340function f(e){if(!e||"string"!=typeof e)return{isValid:!0,errorCategories:[]}
1341const t=[];(function(e){return a.test(e)||r.test(e)})(e)&&t.push(g.DOCUMENT_STRUCTURE),function(e){return i.test(e)||function(e){const t=e.match(o)||[]
1342for(const e of t)if(!s.test(e))return!0
1343return!1}(e)}(e)&&t.push(g.HEAD_METADATA),function(e){let t=0
1344for(;t<e.length;){const n=e.indexOf("\x3c!--",t)
1345if(-1===n)break
1346const a=e.indexOf("--\x3e",n+4)
1347if(-1===a)return!0
1348t=a+3}return!1}(e)&&t.push(g.UNCLOSED_COMMENT)
1349const n=e.replaceAll(p,""),f=function(e){return l.test(e.trim())}(n)
1350return f&&t.push(g.INCOMPLETE_TAG),function(e){return u.test(m(e))}(n)&&t.push(g.MALFORMED_TAG),!f&&function(e){const t=e.replaceAll(h,""),n=m(t).matchAll(c)
1351for(const e of n){const t=e[1]
1352if(!d.test(t))return!0}return!1}(n)&&t.push(g.INVALID_SELF_CLOSING),{isValid:0===t.length,errorCategories:t}}function m(e){return e.replaceAll(/"[^"]*"/g,'""').replaceAll(/'[^']*'/g,"''")}},34922:(e,t,n)=>{"use strict"
1353n.r(t),n.d(t,{default:()=>_r})
1354n(7121)
1355Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0])
1356return t?Array.prototype.reduce.call(this,(function(n,a){return Array.isArray(a)?n.push.apply(n,e.call(a,t-1)):n.push(a),n}),[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(e){return Array.prototype.map.apply(this,arguments).flat()},writable:!0})
1357var a=n(14953),r=n.n(a),i=n(95110),o=n(48431),s=n.t(o,2),l=n(84507),c=n(91121),u=n(63144),d=n.n(u),p=n(12086),h=n(85968),g=(n(39155),n(28383),n(44420))
1358function f(){const e=(0,l.d4)((e=>e.get("themeSettingsSchema"))),t=(0,l.d4)((e=>e.getIn(["shop","themeSettings"]))),n=(0,l.d4)((e=>e.get("defaultThemeSettings"))),a=(0,l.d4)((e=>e.getIn(["shop","theme","name"]))),i=(0,g.h6)(e.toJS(),t.toJS(),n.toJS(),a)
1359return r().fromJS(i)}var m,v,b,y,x,C,D,w,A,E=n(11469),j=n(62738),B=(n(98357),n(76881),n(48225)),k=n(64948),S=n(557),N=n(58219),F=n(71521),O=n(42295)
1360const M="content-editing-locale"
1361function P({active:e,onToggle:t}){const n=(0,l.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),r=(0,l.d4)((e=>e.getIn(["shop","locationBase","origin"]))),s=(0,l.d4)((e=>e.getIn(["shop","defaultLocale"]))),u=(0,l.d4)((e=>e.getIn(["shop","locale"]))),d=(0,l.d4)((e=>e.getIn(["shop","locales"],(0,a.List)()))).toJS(),h=(0,o.useRef)(null),[g,f]=(0,B.A)(d.filter((e=>e.identifier!==s)),"isAutoTranslationEnabled"),E=(0,l.wA)(),j=(0,S.WD)("interface","components.editorLanguageSwitchComponent"),P=(0,i.zy)(),T=e=>{F.A.setItem(M,e),u!==e?E((0,p.Rpl)(e,P)):t()};(0,o.useEffect)((()=>{F.A.getItem(M)||t()}),[])
1362const I=e?"ep-bottom-bar-button-language-switch-arrow-up":"ep-bottom-bar-button-language-switch-arrow-down",R=(0,c.A)(["ep-bottom-bar-button","ep-bottom-bar-button-language-switch",{active:e}])
1363return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("span",{className:R,title:j("switchLanguageModal.title"),onClick:()=>t(),children:[m||(m=(0,O.jsx)("span",{className:"ep-bottom-bar-language-switch-icon"})),(0,O.jsx)("span",{className:"ep-bottom-bar-language-switch-text",ref:h,children:j(`:enumerations.languages.${u.substring(0,2)}`)}
1363),(0,O.jsx)("span",{className:(0,c.A)(["ep-bottom-bar-language-switch-arrow",I])})]}),(0,O.jsx)(N.default,{open:!!e,side:"top",virtualRef:h,className:"ep-settingslayer-language-switch",onEscapeKeyDown:()=>t(),hideArrow:!1,draggable:!1,align:"center",sideOffset:30,children:({renderLayout:e})=>(0,O.jsx)(O.Fragment,{children:e({body:(0,O.jsxs)("div",{className:"ep-settingslayer-language",children:[(0,O.jsx)("strong",{children:j("switchLanguageModal.sourceLanguageTitle")}),(0,O.jsxs)("button",{onClick:()=>T(s),"data-testid":`language-switch-button-${s.substring(0,2)}`,className:(0,c.A)(["ep-settingslayer-default-language",{"ep-settingslayer-language-switch-item-selected":s===u}]),children:[b||(b=(0,O.jsxs)("svg",{fill:"#000000",width:"13",height:"13",viewBox:"0 0 32 32",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[(0,O.jsx)("g",{id:"SVGRepo_bgCarrier",strokeWidth:"0"}),(0,O.jsx)("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round"}),(0,O.jsxs)("g",{id:"SVGRepo_iconCarrier",children:[(0,O.jsx)("path",{d:"M32.032 16c0-8.501-6.677-15.472-15.072-15.969-0.173-0.019-0.346-0.032-0.523-0.032-0.052 0-0.104 0.005-0.156 0.007-0.093-0.002-0.186-0.007-0.281-0.007-8.84 0-16.032 7.178-16.032 16.001s7.192 16.001 16.032 16.001c0.094 0 0.188-0.006 0.281-0.008 0.052 0.002 0.104 0.008 0.156 0.008 0.176 0 0.349-0.012 0.523-0.032 8.395-0.497 15.072-7.468 15.072-15.969zM29.049 21.151c-0.551-0.16-1.935-0.507-4.377-0.794 0.202-1.381 0.313-2.84 0.313-4.357 0-1.196-0.069-2.354-0.197-3.469 3.094-0.37 4.45-0.835 4.54-0.867l-0.372-1.050c0.695 1.659 1.080 3.478 1.080 5.386 0 1.818-0.352 3.555-0.987 5.151zM8.921 16c0-1.119 0.074-2.212 0.21-3.263 1.621 0.127 3.561 0.222 5.839 0.243v6.939c-2.219 0.021-4.114 0.111-5.709 0.234-0.22-1.319-0.34-2.715-0.34-4.154zM16.967 2.132c2.452 0.711 4.552 4.115 5.492 8.628-1.512 0.12-3.332 0.209-5.492 0.229v-8.857zM14.971 2.156v8.832c-2.136-0.021-3.965-0.109-5.502-0.226 0.96-4.457 3.076-7.836 5.502-8.606zM14.971 21.913l0 7.929c-2.263-0.718-4.256-3.705-5.293-7.719 1.492-0.11 3.253-0.189 5.292-0.21zM16.967 29.868l-0-7.955c2.061 0.020 3.814 0.102 5.288 0.217-1.019 4.067-3 7.076-5.288 7.738zM16.967 19.92l0-6.939c2.291-0.021 4.218-0.118 5.818-0.25 0.131 1.053 0.203 2.147 0.203 3.268 0 1.442-0.116 2.84-0.329 4.16-1.575-0.128-3.462-0.219-5.692-0.24zM28.588 9.81c-0.302 0.094-1.564 0.453-4.094 0.751-0.564-2.998-1.584-5.561-2.91-7.412 3.048 1.325 5.535 3.697 7.005 6.661zM11.213 2.831c-1.632 1.873-2.963 4.568-3.691 7.754-2.265-0.245-3.623-0.534-4.166-0.665 1.585-3.27 4.407-5.836 7.856-7.088zM2.614 11.787c0.385 0.104 1.841 0.467 4.549 0.766-0.155 1.107-0.24 2.26-0.24 3.447 0 1.509 0.136 2.96 0.383 4.334-2.325 0.251-3.755 0.552-4.396 0.706-0.607-1.566-0.944-3.264-0.944-5.041 0-1.467 0.228-2.883 0.649-4.213zM3.784 22.886c0.727-0.154 2.029-0.39 3.956-0.591 0.759 2.803 1.993 5.175 3.473 6.874-3.16-1.148-5.79-3.398-7.429-6.282v0zM21.583 28.849c1.195-1.665 2.14-3.907 2.728-6.525 1.982 0.227 3.226 0.494 3.853 0.652-1.5 2.596-3.808 4.669-6.581 5.873z"})," "]})]})),j(`:enumerations.languages.${s.substring(0,2)}`)]}),f.length>0&&(0,O.jsxs)(O.Fragment,{children:[y||(y=(0,O.jsx)("hr",{})),(0,O.jsxs)("section",{children:[(0,O.jsx)("strong",{children:j("switchLanguageModal.manualLanguagesTitle")}),f.map((e=>(0,O.jsx)("button",{onClick:()=>T(e.identifier),className:(0,c.A)(["ep-settingslayer-language-non-auto-translate",{"ep-settingslayer-language-switch-item-selected":e.identifier===u}]),children:j(`:enumerations.languages.${e.identifier.substring(0,2)}`)},e.identifier)))]})]}),g.length>0&&(0,O.jsxs)(O.Fragment,{children:[x||(x=(0,O.jsx)("hr",{})),(0,O.jsxs)("section",{children:[(0,O.jsxs)("strong",{children:[j("switchLanguageModal.automaticLanguages.title"),(0,O.jsx)(k.m,{content:j("switchLanguageModal.automaticLanguages.tooltip")})]}),g.map((e=>(0,O.jsxs)("button",{onClick:()=>T(e.identifier),className:(0,c.A)(["ep-settingslayer-language-auto-translate",{"ep-settingslayer-language-switch-item-selected":e.identifier===u}]),disabled:!0,children:[C||(C=(0,O.jsx)("svg",{"data-token-category":"icons",xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 16 16",fill:"#343434",children:(0,O.jsx)("path",{d:"M5.333 3 3 5.333l10.667 10.667 2.333 -2.333 -10.667 -10.667zm1.6 5.133L4.2 5.333 5.333 4.2l2.8 2.8 -1.2 1.133zM10 4.667c0.133 -0.133 0.333 -0.867 0.533 -1.8 0.867 -0.2 1.667 -0.4 1.8 -0.533 -0.133 -0.133 -0.867 -0.333 -1.8 -0.533 -0.2 -0.933 -0.4 -1.667 -0.533 -1.8 -0.133 0.133 -0.333 0.867 -0.533 1.8 -0.867 0.2 -1.66
13637 0.4 -1.8 0.533 0.133 0.133 0.867 0.333 1.8 0.533 0.2 0.933 0.4 1.667 0.533 1.8zM2.667 8.667c-0.133 0.133 -0.333 0.867 -0.533 1.8 -0.867 0.2 -1.667 0.4 -1.8 0.533 0.133 0.133 0.867 0.333 1.8 0.533 0.2 0.933 0.4 1.667 0.533 1.8 0.133 -0.133 0.333 -0.867 0.533 -1.8 0.867 -0.2 1.667 -0.4 1.8 -0.533 -0.133 -0.133 -0.867 -0.333 -1.8 -0.533 -0.2 -0.867 -0.4 -1.667 -0.533 -1.8zm-0.333 -4.667c0.133 -0.133 0.333 -0.8 0.467 -1.533 0.733 -0.133 1.4 -0.333 1.533 -0.467 -0.133 -0.133 -0.8 -0.333 -1.533 -0.467C2.667 0.8 2.467 0.133 2.333 0c-0.133 0.133 -0.333 0.8 -0.467 1.533 -0.733 0.133 -1.4 0.333 -1.533 0.467 0.133 0.133 0.8 0.333 1.533 0.467 0.133 0.733 0.333 1.4 0.467 1.533zM1.333 7.333c0.067 -0.067 0.133 -0.4 0.267 -0.733 0.4 -0.067 0.733 -0.2 0.733 -0.267 -0.067 -0.067 -0.4 -0.133 -0.733 -0.267 -0.133 -0.333 -0.2 -0.667 -0.267 -0.733 -0.067 0.067 -0.133 0.4 -0.267 0.733 -0.333 0.133 -0.667 0.2 -0.733 0.267 0.067 0.067 0.4 0.133 0.733 0.267 0.133 0.333 0.2 0.667 0.267 0.733z"})})),j(`:enumerations.languages.${e.identifier.substring(0,2)}`),(0,O.jsx)("a",{href:`${r}/${e.identifier.substring(0,2)}`,target:"_blank",rel:"noopener noreferrer",className:"ep-form-row-text-link",children:D||(D=(0,O.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,O.jsx)("path",{d:"M15 3h6v6"}),(0,O.jsx)("path",{d:"M10 14 21 3"}),(0,O.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]}))})]},e.identifier)))]})]}),w||(w=(0,O.jsx)("hr",{})),(0,O.jsxs)("div",{className:"ep-form-row ep-settingslayer-language-switch-text",children:[(0,O.jsx)("div",{children:(0,S.fN)(j)("switchLanguageModal.explanation.paragraph1",{icon:A||(A=(0,O.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,O.jsx)("path",{d:"M15 3h6v6"}),(0,O.jsx)("path",{d:"M10 14 21 3"}),(0,O.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]}))})}),(0,O.jsx)("div",{children:(0,S.fN)(j)("switchLanguageModal.explanation.paragraph2",{link:(0,O.jsx)("a",{href:`${n}?ViewAction=UnityMBO-ViewLanguages`,target:"_parent",className:"ep-form-row-text-link",children:j("switchLanguageModal.explanation.link")})})})]})]}),footer:v||(v=(0,O.jsx)("footer",{}))})})})]})}var T,I=n(81909),R=n(81715)
1364const L="content-editing-locale"
1365function _({active:e,onToggle:t}){const n=(0,l.wA)(),a=(0,S.WD)("interface","components.editorLanguageSwitchComponent"),r=(0,l.d4)((e=>e.getIn(["view","busy"]))),s=(0,l.d4)((e=>e.getIn(["shop","locale"]))),u=(0,l.d4)((e=>e.getIn(["shop","locales"]))),d=(0,o.useRef)(null),[h,g]=(0,o.useState)(s),f=(0,i.zy)();(0,o.useEffect)((()=>{F.A.getItem(L)||t()}),[])
1366const m=e?"ep-bottom-bar-button-language-switch-arrow-up":"ep-bottom-bar-button-language-switch-arrow-down",v=(0,c.A)(["ep-bottom-bar-button","ep-bottom-bar-button-language-switch",{active:e}])
1367function b(){const e=u.toJS().map((e=>{const t=e.identifier
1368return(0,O.jsx)("option",{value:t,children:a(`:enumerations.languages.${t.substring(0,2)}`)},t)}))
1369return(0,O.jsxs)("div",{className:"ep-settings-layer-language",children:[(0,O.jsx)("div",{className:"ep-form-row",children:a("switchLanguageModal.explanation.old")}),(0,O.jsx)("div",{className:"ep-form-row",children:(0,O.jsxs)("label",{className:"ep-form-row-label",children:[(0,O.jsx)("label",{htmlFor:"switch-language-modal",className:"ep-form-row-label-text",children:a("switchLanguageModal.languageDropdown.label")}),(0,O.jsx)("select",{className:"ep-form-select",defaultValue:h,onChange:({target:e})=>g(e.value),id:"switch-language-modal",children:e})]})})]})}function y(){return(0,O.jsxs)(R.A,{children:[(0,O.jsx)(I.A,{type:"button",variant:"outline",disabled:r,onClick:()=>t(),children:a("switchLanguageModal.cancelButton.label")}),(0,O.jsx)(I.A,{disabled:r,type:"button",onClick:()=>(F.A.setItem(L,h),void(s!==h?n((0,p.Rpl)(h,f)):t())),children:a("switchLanguageModal.applyButton.label")})]})}return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("span",{ref:d,className:v,title:a("switchLanguageModal.title"),onClick:()=>t(),children:[T||(T=(0,O.jsx)("span",{className:"ep-bottom-bar-language-switch-icon"})),(0,O.jsx)("span",{className:"ep-bottom-bar-language-switch-text",ref:d,children:a(`:enumerations.languages.${h.substring(0,2)}`)}
1369),(0,O.jsx)("span",{className:(0,c.A)(["ep-bottom-bar-language-switch-arrow",m])})]}),e&&(0,O.jsx)(N.default,{open:!!e,side:"top",virtualRef:d,className:"ep-settingslayer-language-switch",onEscapeKeyDown:()=>t(),hideArrow:!1,draggable:!1,align:"center",sideOffset:30,children:({renderLayout:e})=>(0,O.jsx)(O.Fragment,{children:e({title:a("switchLanguageModal.title"),body:b(),footer:y()})})})]})}var $=n(12259),z=n(32174)
1370n(76439)
1371const W=/<script[\s\S]+gtm\.start[\s\S]+https:\/\/[\w.]+\/gtm\.js[\s\S]+(GTM-[A-Z0-9]+)[\s\S]+<\/script>/,U=/<iframe\s.+https:\/\/.+id=GTM-[A-Z0-9]+[\s\S]+<\/iframe>/
1372var V,H=n(19956),K=n(51769),q=n(51546),G=n(81671),Y=n(40212),J=n(75655)
1373const X=(0,$.formField)()(H.O)
1374function Q(){const e="components.bottomBar.storefrontSettings.cookieNotice",t=(0,J.A)("COOKIES"),n=(0,S.WD)("interface")
1375return(0,O.jsx)($.FormValueScope,{name:"cookieNotice",children:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("div",{className:"dali-settingslayer-element",children:n(`${e}.description`)}),(0,O.jsx)(q.A,{name:"active",children:t=>t?null:(0,O.jsx)("p",{className:"ep-notification-warning",children:n(`${e}.warningMessage`)})}),(0,O.jsx)(K.A,{label:n(`${e}.visibilitySection.title`),name:"active",children:(0,O.jsx)(Y.A,{buttons:[{label:n(`${e}.visibilitySection.yesRadioButtonLabel`),value:!0},{label:n(`${e}.visibilitySection.noRadioButtonLabel`),value:!1}]})}),(0,O.jsx)(K.A,{label:n(`${e}.headlineInputField.label`),name:"title",children:V||(V=(0,O.jsx)(G.A,{}))}),(0,O.jsx)(K.A,{label:n(`${e}.messageLabel`),name:"gdprMessageHtml",children:(0,O.jsx)(X,{toolbarButtons:["bold","link|unlink"]})}),(0,O.jsx)("a",{href:t,target:"_blank",className:"ep-form-row-text-external-link",rel:"noreferrer noopener",children:n(`${e}.helpCenterLink`)})]})})}Q.displayName="CookieSettings",Q.defaultValue=r().fromJS({active:!1,title:"",gdprMessageHtml:"<span></span>"})
1376var Z=n(43343)
1377var ee=n(62929),te=n(22732)
1378function ne({t:e,url:t,openFileUpload:n,onRemoveFavicon:a}){const r=t.split("/").pop().replace(/\?.+/,"")
1379return(0,O.jsxs)("div",{className:"ep-custom-settings-item-upload",children:[(0,O.jsx)("span",{title:e("uploadFavicon.faviconField.tooltip"),onClick:n,className:"ep-custom-settings-item-upload-image",children:(0,O.jsx)("img",{alt:"",src:t})}),(0,O.jsx)("span",{title:r,className:"ep-custom-settings-file-name",children:r}),(0,O.jsx)("button",{type:"button",className:"ep-custom-settings-item-upload-delete",onClick:a,title:e("uploadFavicon.deleteButton.label")})]})}function ae({t:e,faviconUrl:t,validate:n,onChange:a,onError:r=Z.A}){const i=(0,l.Pj)(),s=(0,o.useRef)(null),[c,u]=(0,o.useState)(!1),d=(0,te.u_)(i.api),p=(0,te.Ss)(32),h=async n=>{try{const e=await async function(e){return new Promise(((t,n)=>{const a=new FileReader
1380a.onload=()=>{const e=new Image
1381e.onload=()=>t(e),e.onerror=n,e.src=a.result},a.onerror=n,a.readAsDataURL(e)}))}(n)
1382if(e.width===e.height)return await d(n)
1383{const t=function(e){const t=Math.max(e.width,e.height),n=document.createElement("canvas")
1384return n.width=t,n.height=t,n.getContext("2d").drawImage(e,(t-e.width)/2,(t-e.height)/2),n}(e),a=await async function(e,t,n){return new Promise((a=>{e.toBlob((e=>{a(new File([e],t,{type:n}))}),n)}))}(t,n.name,n.type)
1385return await d(a)}}catch(n){const a=(0,ee.k_)(n,e,"uploadFavicon.faviconField.errorMessages.reason"),i=e("uploadFavicon.faviconField.errorMessages."+(t?"messageWithOldImage":"messageWithoutOldImage"),{reason:a}),o=new Error(i)
1386o.code=n.response?.status,r(o)}finally{u(!1)}},g=()=>s.current?.click()
1387return(0,O.jsxs)("fieldset",{disabled:c,children:[t?(0,O.jsx)(ne,{t:e,url:p(t),openFileUpload:g,onRemoveFavicon:()=>a()}):(0,O.jsx)("button",{type:"button",className:"ep-custom-settings-add",onClick:g,children:e("uploadFavicon.addButton.label")}),(0,O.jsx)("input",{ref:s,type:"file",accept:"image/png",onChange:async e=>{if(!e.target.files)return!1
1388const t=e.target.files[0]
1389u(!0)
1390const i=await h(t)
1391if(i)try{(e=>{const t=n(e)
1392if(t)throw t})(i),a(i)}catch(e){r(e)}finally{u(!1)}},value:""})]})}function re(){const e=(0,S.WD)("interface","components.bottomBar.storefrontSettings.faviconSettings"),[t,n]=(0,o.useState)(null),r=(0,l.d4)((e=>e.getIn(["shop","slug"]))),i=(0,J.A)("IMAGE_FORMATS"),s=415===t?.code,c=(0,te.b8)(r),u=t=>{const{width:n,height:a,mediaType:r}=t
1393if(n<180&&a<180)return new Error(e("uploadFavicon.faviconField.errorMessages.reason.size"))
1394if("image/png"!==r){const t=new Error(e("uploadFavicon.faviconField.errorMessages.reason.filetype"))
1395return t.code=415,t}}
1396return(0,O.jsxs)(O.Fragment,{children:[t&&(0,O.jsx)("div",{className:"ep-form-row",children:(0,O.jsxs)("div",{className:"dali-notification-danger",children:[t.message,s&&(0,O.jsx)("a",{href:i,target:"_blank",className:"ep-form-row-text-external-link",rel:"noreferrer noopener",children:e("components.imageUploadComponent.imageField.errorMessages.helpCenterLink")})]})}
1396),(0,O.jsx)("div",{className:"dali-settingslayer-element",children:e("description")}),(0,O.jsx)("div",{className:"ep-form-row",children:(0,O.jsx)("div",{className:"dali-settingslayer-element",children:(0,O.jsx)("div",{className:"dali-settingslayer-hint",children:e("imageInfo",{recommendedImageWidth:180,recommendedImageHeight:180})})})}),(0,O.jsx)(q.A,{name:"faviconSettings",children:(t,r)=>(0,O.jsx)(ae,{t:e,faviconUrl:t.get("faviconUrl"),onChange:e=>{if(n(null),e){const{absoluteDownloadUrl:t}=e
1397return r((0,a.fromJS)({faviconUrl:c(t)}))}return r((0,a.fromJS)({faviconUrl:""}))},onError:e=>n(e),validate:u})})]})}re.displayName="FaviconSettings",re.defaultValue=(0,a.fromJS)({faviconUrl:""})
1398const ie=(0,$.withClassName)("ep-form-text-area")($.TextareaField)
1399var oe,se,le
1400function ce(){const e=(0,S.WD)("interface"),t=t=>e(`components.bottomBar.storefrontSettings.googleTagManager.${t}`),n=(0,J.A)("GOOGLE_TAG_MANAGER")
1401return(0,O.jsx)($.FormValueScope,{name:"googleTagManager",children:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"dali-settingslayer-element",children:[t("description"),oe||(oe=(0,O.jsx)("br",{})),(0,O.jsx)("a",{className:"ep-form-row-text-external-link",href:n,target:"_blank",rel:"noopener noreferrer",children:t("descriptionLink")})]}),(0,O.jsx)(K.A,{label:t("headInputField.label"),name:"headHtml",children:se||(se=(0,O.jsx)(ie,{}))}),(0,O.jsx)(K.A,{label:t("bodyInputField.label"),name:"bodyHtml",children:le||(le=(0,O.jsx)(ie,{}))}),(0,O.jsx)(K.A,{label:t("statusSection.title"),name:"active",info:t("statusSection.tooltip"),children:(0,O.jsx)(Y.A,{buttons:[{label:t("statusSection.onRadioButton.label"),value:!0},{label:t("statusSection.offRadioButton.label"),value:!1}]})}),(0,O.jsx)(K.A,{label:t("manageSection.title"),name:"_not_used",children:(0,O.jsxs)("p",{className:"ep-form-row-text",children:[t("manageSection.description")," ",(0,O.jsx)("a",{className:"ep-form-row-text-external-link",href:"https://tagmanager.google.com/",target:"_blank",rel:"noopener noreferrer",children:t("manageSection.descriptionLink")})]})})]})})}ce.displayName="GoogleTagManagerSettings",ce.defaultValue=r().fromJS({headHtml:"",bodyHtml:"",active:!1})
1402const ue={cookieNotice:Q,googleTagManager:ce,faviconSettings:re}
1403function de({active:e,onToggle:t}){const n=(0,l.wA)(),r=(0,l.d4)((e=>e.getIn(["shop","userSettings"]).delete("googleAnalytics"))),i=(0,l.d4)((e=>(0,a.fromJS)({faviconUrl:e.getIn(["shop","faviconUrl"])||""}))),s=(0,l.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),u=(0,S.WD)("interface"),[d,h]=(0,o.useState)("cookieNotice"),g=(0,o.useRef)(i),f=(0,o.useRef)(r),m=(0,o.useCallback)((()=>{n((0,p.hcd)(g.current.toJS()))}),[n]);(0,o.useEffect)((()=>(h("string"==typeof e?e:"cookieNotice"),()=>{m()})),[e,m])
1404const v=async e=>{const a=e.delete("faviconSettings")
1405await n((0,p.Hz9)(a.toJS()))
1406const r=e.get("faviconSettings")
1407await n((0,p.bLz)(r.toJS())),f.current=a,g.current=r,window.parent?.postMessage({type:"STOREFRONT_SETTINGS",payload:{faviconUrl:e.getIn(["faviconSettings","faviconUrl"])}},s),t({submit:!0})},b=e=>(requestAnimationFrame((()=>{"faviconSettings"!==d&&n((0,p.HhZ)(e.delete("faviconSettings"))),"faviconSettings"===d&&n((0,p.hcd)(e.get("faviconSettings").toJS()))})),null),y=(e,...t)=>u("components.bottomBar.storefrontSettings."+e,...t)
1408return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("button",{type:"button",className:(0,c.A)(["ep-bottom-bar-button","ep-bottom-bar-button-shop-settings",{active:e}]),title:y("title"),onClick:()=>t()}),(0,O.jsx)(N.default,{className:(0,c.A)(["ep-settingslayer-shop-settings",`${(0,z.A)(d)}-active`]),onEscapeKeyDown:()=>t(),open:!!e,side:"top",align:"center",children:({renderLayout:e})=>(0,O.jsx)($.Form,{name:"userSettings",value:r.set("faviconSettings",i),prepare:e=>e.mergeDeep(...Object.entries(ue).map((([e,t])=>(0,E.B)({userSettings:r,shopLocale:"",footerPages:(0,a.fromJS)([]),shopResellerName:"",taxCountry:"",t:y},[e,t]))),e),onChange:b,validate:e=>{const t={},n=e.getIn(["googleTagManager","headHtml"],"")
1409var r
1410n.trim()&&(r=n,!W.test(r))&&(t.googleTagManager=t.googleTagManager||{},t.googleTagManager.headHtml=y("googleTagManager.headInputField.validationMessages.invalidGoogleTagManagerSnippet"))
1411const i=e.getIn(["googleTagManager","bodyHtml"],"")
1412return i.trim()&&!function(e){return U.test(e)}(i)&&(t.googleTagManager=t.googleTagManager||{},t.googleTagManager.bodyHtml=y("googleTagManager.bodyInputField.validationMessages.invalidGoogleTagManagerSnippet")),Object.keys(t).length>0?(0,a.fromJS)(t):void 0},onSubmit:v,children:e({title:y(`${d}.title`),tabs:Object.keys(ue).map((e=>({name:e,title:y(`${e}.title`),active:d===e,onClick:()=>h(e)}))),body:o.createElement(ue[d]),footer:(0,O.jsxs)(R.A,{children:[(0,O.jsx)(I.A,{type:"button",variant:"outline",onClick:()=>{m(),t()},children:y("cancelButton.label")}),(0,O.jsx)(I.A,{type:"submit",children:y("applyButton.label")})]})})})})]})}var pe=n(84475)
1413const he="customStyle",ge=["logoAdjustments","themeHeader","headerAnnouncement","headerUspBar"]
1414function fe({active:e,onToggle:t}){const n=(0,l.d4)((e=>e.getIn(["shop","theme"]).toJS())),a=(0,l.d4)((e=>e.get("themeSettingsSchema").filter((e=>!ge.includes(e.get("name")))))),r=(0,l.d4)((e=>e.get("defaultThemeSettings"))),i=(0,l.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),[s]=n.name.split(g.ko),u=`${s.replace(".","_")}.settings`,d=(0,S.WD)("interface"),h=(e,...t)=>d(`components.bottomBar.themeSettings.${e}`,t),m=(0,o.useCallback)((e=>d(`themes:${u}.${e}`)),[d,u]),v=(0,l.wA)(),b=f(),y=(0,o.useRef)(b),x=(0,o.useRef)(""),[C,D]=(0,o.useState)((()=>"string"==typeof e?e:a.getIn([0,"name"]))),w=(0,c.A)(["ep-bottom-bar-button","ep-bottom-bar-button-theme-settings",{active:e}]);(0,o.useEffect)((()=>{y.current=b}),[e]),(0,o.useEffect)((()=>{"string"==typeof e&&D(e)}),[e])
1415const A=()=>{t()},E=e=>(v((0,p.h8q)(e)),null),j=async e=>{await v((0,p.Tbf)(n.id,e)),e.get("colors").equals(y.current.get("colors"))||window.parent?.postMessage({type:"CHECKLIST",payload:{websiteOnly:"designSettings.colorSettings",regularShop:"designSettings.websiteCustomization"}},i),e.get("fonts").equals(y.current.get("fonts"))||window.parent?.postMessage({type:"CHECKLIST",payload:{websiteOnly:"designSettings.fontSettings",regularShop:"designSettings.fontSettings"}},i),t({submit:!0})},B=e=>{x.current=e},k=(0,o.useMemo)((()=>({...(0,pe.A)(m,b,r,{onCustomCssInfoText:B}),style:()=>null})),[m,b,r])
1416return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("button",{className:w,title:h("title"),onClick:()=>t()}
1416),(0,O.jsx)(N.default,{className:(0,c.A)(["ep-settingslayer-theme-settings",{"custom-style-tab-active":C===he}]),onEscapeKeyDown:A,open:!!e,side:"top",align:"center",children:({renderLayout:e})=>(0,O.jsx)($.Form,{className:"ep-theme-settings-form",name:"themeSettings",value:b,onChange:E,onSubmit:j,children:e({title:m(C),explanation:C===he?x.current:null,tabs:a.map((e=>{const t=e?.get("name")
1417return{name:t,title:m(t),active:C===t,onClick:e=>{var t;(t=e)!==C&&D(t)}}})).toJS(),body:a.map((e=>{const t=e?.get("name")
1418return(0,O.jsx)(o.Fragment,{children:(0,O.jsx)("div",{className:(0,c.A)(["dali-settingslayer-main-content-tab-content",{in:C===t,out:C!==t}]),"data-testid":`theme-settings-content-${t}`,children:k[e?.get("type")]({setting:e,isTopLevel:!0})})},t)})),footer:(0,O.jsxs)(R.A,{children:[(0,O.jsx)(I.A,{type:"button",variant:"outline",onClick:A,children:h("cancelButton.label")}),(0,O.jsx)(I.A,{type:"submit",children:h("applyButton.label")})]})})})})]})}function me({showLanguages:e}){const[t,n]=(0,o.useState)(""),[r,i=!0]=t.split("#"),s=(0,l.wA)(),c=(0,l.d4)((e=>e.getIn(["shop","userSettings"])?.delete("googleAnalytics"))),u=(0,l.d4)((e=>e.getIn(["shop","features"],(0,a.List)()).some((e=>"AUTO_TRANSLATION"===e.get("name"))))),d=f(),h=(0,o.useRef)(c),g=(0,o.useRef)(d)
1419const m=(0,o.useCallback)((()=>{s((0,p.HhZ)(h.current)),s((0,p.h8q)(g.current))}),[s])
1420function v(e){return({submit:t=!1}={})=>{t?(h.current=c,g.current=d):m(),n(e===r?"":e)}}return(0,o.useEffect)((()=>{function e(){"#logoUpload"===window.location.hash?n("HeaderSettings#shopLogo"):"#headerMenu"===window.location.hash?n("HeaderSettings#headerMenu"):"#themeColors"===window.location.hash?n("ThemeSettings#colors"):"#socialMedia"===window.location.hash?n("FooterSettings#socialNetworks"):"#googleTagManager"===window.location.hash&&n("StorefrontSettings#googleTagManager")}return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e),m()}}),[m]),(0,O.jsx)("div",{className:"ep-bottom-wrapper",children:(0,O.jsxs)("div",{className:"ep-bottom-bar",children:[e&&!u&&(0,O.jsx)(_,{active:"LanguageSwitch"===r,onToggle:v("LanguageSwitch")}),e&&u&&(0,O.jsx)(P,{active:"LanguageSwitch"===r,onToggle:v("LanguageSwitch")}),(0,O.jsx)(j.A,{active:"HeaderSettings"===r&&i,onToggle:v("HeaderSettings")}),(0,O.jsx)(E.A,{active:"FooterSettings"===r&&i,onToggle:v("FooterSettings")}),(0,O.jsx)(de,{active:"StorefrontSettings"===r&&i,onToggle:v("StorefrontSettings")}),(0,O.jsx)(fe,{active:"ThemeSettings"===r&&i,onToggle:v("ThemeSettings")})]})})}n(55959),n(49905),n(20476),n(47537),n(6010),n(64657),n(67437),n(76672)
1421var ve=n(37507),be=n(95921)
1422const ye=(0,o.createContext)(void 0),xe=(0,o.createContext)(void 0)
1423function Ce({children:e}){const[t,n]=(0,o.useState)(void 0)
1424return(0,O.jsx)(xe.Provider,{value:n,children:(0,O.jsx)(ye.Provider,{value:t,children:e})})}function De(){const e=(0,o.useContext)(xe)
1425if(!e)throw new Error("Context value undefined. The hook useVideoTutorialSetter must be used within a VideoTutorialProvider")
1426return e}function we({tutorial:e,children:t}){const n=De()
1427return(0,O.jsx)("button",{onClick:()=>{n(e)},className:"show-video-tutorial-button",children:t})}var Ae=n(46785),Ee=n(79655)
1428const je=500,Be=(0,ve.A)((e=>{function t(t){return Ae.Ay.filter((n=>n.categories.includes(t)&&!n.hideFor.includes(e?"beyond":"unity")))}return[{title:"product",blocks:t("product")},{title:"image",blocks:t("image")},{title:"text",blocks:t("text")},{title:"banner",blocks:t("banner")},{title:"icon",blocks:t("icon")},{title:"gallery",blocks:t("gallery")},{title:"video",blocks:t("video")},{title:"logo",blocks:t("logo")},{title:"divider",blocks:t("divider")},{title:"expander",blocks:t("expander")},{title:"contact",blocks:t("contact")},{title:"maps",blocks:t("maps")},{title:"html",blocks:t("html")}]}))
1429function ke({title:e,onClick:t,active:n=!1,t:a}){return(0,O.jsx)("div",{className:(0,c.A)(["ep-content-element-tab",`ep-content-element-tab-${e}`,{active:n}]),onClick:()=>t(!n),children:a(`contentElementsSection.categories.${e}`)})}function Se({resetCategory:e=!1,isBeyond:t,activePageBlocks:n,t:a}){const[r,i]=(0,o.useState)(""),s=(0,o.useRef)(null),u=(0,o.useRef)(null),d=(0,l.d4)((e=>["de"].includes(e.getIn(["view","interfaceLanguage"])))),p=e=>{i(e),setTimeout((()=>s.current?.scrollIntoView()),100)}
1430function h(){switch(window.location.hash){case"#imageContentElements":setTimeout((()=>p("image")),je)
1431break
1432case"#textContentElements":setTimeout((()=>p("text")),je)}}(0,o.useEffect)((()=>{e&&setTimeout((()=>i("")),500)}),[e]),(0,o.useEffect)((()=>
1432{if(r&&u.current){const e=u.current.scrollHeight
1433u.current.style.setProperty("--dropdown-height",`${e+36}px`)}}),[r]),(0,o.useEffect)(h,[]),(0,Ee.A)("hashchange",h)
1434const g=(e,...t)=>a(`contentElementsSection.${e}`,...t)
1435return(0,O.jsx)("div",{className:"ep-sidebar-module-content",children:(0,O.jsxs)("div",{ref:s,className:"ep-scrollable",children:[(0,O.jsx)("div",{className:"ep-content-element-wrapper",children:Be(t).filter((e=>Boolean(e.blocks.length))).map((e=>(0,O.jsxs)(o.Fragment,{children:[(0,O.jsx)(ke,{title:e.title,active:e.title===r,onClick:t=>p(t?e.title:""),t:a}),(0,O.jsx)("ul",{className:(0,c.A)(["ep-content-element-list",{active:e.title===r}]),ref:e.title===r?u:null,children:e.blocks.map((e=>{const t=!(e.canBeAdded?.(n)??1)
1436return(0,O.jsx)(k.m,{sideOffset:10,hideIcon:!0,variant:"light",trigger:(0,O.jsxs)("li",{className:(0,c.A)([{"ep-tool-disabled":t}]),children:[(0,O.jsx)(be.I,{component:Fr,icon:e.icon,disabled:t,type:"dali-add",onDrag:e.generate,previewNodeOffset:{x:68,y:56/1.1},createPreviewNode:()=>function(e){const t=document.createElement("div")
1437return t.className="ep-content-element-drag-preview",t.innerHTML=e.icon,t}(e)}),(0,O.jsx)("span",{className:"ep-tool-label",children:g(`elements.${e.label}`)})]},e.label),content:g(t?"blocked":"explanation")},e.label)}))})]},e.title)))}),d&&(0,O.jsx)("div",{className:"ep-content-video-tutorial-wrapper",children:(0,O.jsx)(we,{tutorial:"content",children:a("contentElementsSection.videoTutorial.videoTutorialButton.label")})})]})})}function Ne({switchToEditor:e,closeMenu:t,openMenu:n,mboBaseUrl:a,buildMenuItem:r,children:i,menualias:o,isOpen:s,iconClass:l,uri:u,title:d}){const p="menu-editor"===o?.toLowerCase(),h=!!i&&i.length>0,g=(0,c.A)([o?.toLowerCase()||"",{active:p,"ui-hover":s,hasChildren:h}]),f=(0,c.A)(["mainmenu-icon","fa","RightPadding",l&&l.replace("icon-","ep-icomoon-")])
1438return(0,O.jsxs)("li",{className:g,children:[(0,O.jsxs)("a",{href:h||p?"#":a+u,className:"item-title",target:"_parent",onClick:h||p?p?e:s?t:n?.(o):void 0,children:[(0,O.jsx)("span",{className:f}),d,h?(0,O.jsx)("span",{className:(0,c.A)(["fa FloatRight submenu-marker",{"fa-angle-up":s,"fa-angle-down":!s}])}):null]}),h?(0,O.jsx)("ul",{children:i?.map(r)}):null]})}function Fe(){const e=(0,l.wA)(),t=(0,l.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),n=(0,l.d4)((e=>e.getIn(["view","mboMenu"]))),[a,r]=(0,o.useState)([]),[i,s]=(0,o.useState)();(0,o.useEffect)((()=>{r(n)}),[n])
1439const c={mboBaseUrl:t,buildMenuItem:u,switchToEditor:t=>{t.preventDefault(),e((0,p.dOk)(!1))},openMenu:e=>t=>{t.preventDefault(),s(e)},closeMenu:e=>{e.preventDefault(),s(void 0)}}
1440function u(e){return null===e||"HIDDEN"===e.status?null:(0,O.jsx)(Ne,{...e,...c,isOpen:i===e.menualias},e.menuId||e.menualias)}return(0,O.jsx)("ul",{id:"mainMenu",className:"MainMenuBar",children:a.map((e=>u({...e,...c})))})}!window.document||window.document.createElement
1441function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),!1===n||!a.defaultPrevented)return t?.(a)}}function Me(e,t){if("function"==typeof e)return e(t)
1442null!=e&&(e.current=t)}function Pe(...e){return o.useCallback(function(...e){return t=>{let n=!1
1443const a=e.map((e=>{const a=Me(e,t)
1444return n||"function"!=typeof a||(n=!0),a}))
1445if(n)return()=>{for(let t=0;t<a.length;t++){const n=a[t]
1446"function"==typeof n?n():Me(e[t],null)}}}}(...e),e)}function Te(...e){const t=e[0]
1447if(1===e.length)return t
1448const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})))
1449return function(e){const a=n.reduce(((t,{useScope:n,scopeName:a})=>({...t,...n(e)[`__scope${a}`]})),{})
1450return o.useMemo((()=>({[`__scope${t.scopeName}`]:a})),[a])}}
1451return n.scopeName=t.scopeName,n}var Ie=globalThis?.document?o.useLayoutEffect:()=>{},Re=s[" useId ".trim().toString()]||(()=>{}),Le=0
1452function _e(e){const[t,n]=o.useState(Re())
1453return Ie((()=>{e||n((e=>e??String(Le++)))}),[e]),e||(t?`radix-${t}`:"")}var $e=s[" useInsertionEffect ".trim().toString()]||Ie
1454function ze({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[r,i,s]=function({defaultProp:e,onChange:t}){const[n,a]=o.useState(e),r=o.useRef(n),i=o.useRef(t)
1455return $e((()=>{i.current=t}),[t]),o.useEffect((()=>{r.current!==n&&(i.current?.(n),r.current=n)}),[n,r]),[n,a,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:r
1456{const t=o.useRef(void 0!==e)
1457o.useEffect((()=>{const e=t.current
1458if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled"
1459console.warn(`${a} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l}),[l,a])}const u=o.useCallback((t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t
1460n!==e&&s.current?.(n)}else i(t)}),[l,e,i,s])
1461return[c,u]}Symbol("RADIX:SYNC_STATE")
1462var We=n(71098)
1463function Ue(e,t){if("function"==typeof e)return e(t)
1464null!=e&&(e.current=t)}function Ve(...e){return t=>{let n=!1
1465const a=e.map((e=>{const a=Ue(e,t)
1466return n||"function"!=typeof a||(n=!0),a}))
1467if(n)return()=>{for(let t=0;t<a.length;t++){const n=a[t]
1468"function"==typeof n?n():Ue(e[t],null)}}}}function He(e){const t=Ke(e),n=o.forwardRef(((e,n)=>{const{children:a,...r}=e,i=o.Children.toArray(a),s=i.find(Ge)
1469if(s){const e=s.props.children,a=i.map((t=>t===s?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:t))
1470return(0,O.jsx)(t,{...r,ref:n,children:o.isValidElement(e)?o.cloneElement(e,void 0,a):null})}return(0,O.jsx)(t,{...r,ref:n,children:a})}))
1471return n.displayName=`${e}.Slot`,n}function Ke(e){const t=o.forwardRef(((e,t)=>{const{children:n,...a}=e
1472if(o.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning
1473if(n)return e.ref
1474if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref
1475return e.props.ref||e.ref}(n),r=function(e,t){const n={...t}
1476for(const a in t){const r=e[a],i=t[a];/^on[A-Z]/.test(a)?r&&i?n[a]=(...e)=>{const t=i(...e)
1477return r(...e),t}:r&&(n[a]=r):"style"===a?n[a]={...r,...i}
1477:"className"===a&&(n[a]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}(a,n.props)
1478return n.type!==o.Fragment&&(r.ref=t?Ve(t,e):e),o.cloneElement(n,r)}return o.Children.count(n)>1?o.Children.only(null):null}))
1479return t.displayName=`${e}.SlotClone`,t}var qe=Symbol("radix.slottable")
1480function Ge(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===qe}var Ye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,t)=>{const n=He(`Primitive.${t}`),a=o.forwardRef(((e,a)=>{const{asChild:r,...i}=e,o=r?n:t
1481return window[Symbol.for("radix-ui")]=!0,(0,O.jsx)(o,{...i,ref:a})}))
1482return a.displayName=`Primitive.${t}`,{...e,[t]:a}}),{})
1483function Je(e,t){if("function"==typeof e)return e(t)
1484null!=e&&(e.current=t)}function Xe(...e){return o.useCallback(function(...e){return t=>{let n=!1
1485const a=e.map((e=>{const a=Je(e,t)
1486return n||"function"!=typeof a||(n=!0),a}))
1487if(n)return()=>{for(let t=0;t<a.length;t++){const n=a[t]
1488"function"==typeof n?n():Je(e[t],null)}}}}(...e),e)}function Qe(e){const t=o.useRef(e)
1489return o.useEffect((()=>{t.current=e})),o.useMemo((()=>(...e)=>t.current?.(...e)),[])}var Ze,et="dismissableLayer.update",tt="dismissableLayer.pointerDownOutside",nt="dismissableLayer.focusOutside",at=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rt=o.forwardRef(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,u=o.useContext(at),[d,p]=o.useState(null),h=d?.ownerDocument??globalThis?.document,[,g]=o.useState({}),f=Xe(t,(e=>p(e))),m=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),y=d?m.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=b,D=function(e,t=globalThis?.document){const n=Qe(e),a=o.useRef(!1),r=o.useRef((()=>{}))
1490return o.useEffect((()=>{const e=e=>{if(e.target&&!a.current){let a=function(){st(tt,n,i,{discrete:!0})}
1491const i={originalEvent:e}
1492"touch"===e.pointerType?(t.removeEventListener("click",r.current),r.current=a,t.addEventListener("click",r.current,{once:!0})):a()}else t.removeEventListener("click",r.current)
1493a.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0)
1494return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",r.current)}}),[t,n]),{onPointerDownCapture:()=>a.current=!0}}((e=>{const t=e.target,n=[...u.branches].some((e=>e.contains(t)))
1495C&&!n&&(r?.(e),s?.(e),e.defaultPrevented||l?.())}),h),w=function(e,t=globalThis?.document){const n=Qe(e),a=o.useRef(!1)
1496return o.useEffect((()=>{const e=e=>{if(e.target&&!a.current){st(nt,n,{originalEvent:e},{discrete:!1})}}
1497return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}((e=>{const t=e.target;[...u.branches].some((e=>e.contains(t)))||(i?.(e),s?.(e),e.defaultPrevented||l?.())}),h)
1498return function(e,t=globalThis?.document){const n=Qe(e)
1499o.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)}
1500return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{y===u.layers.size-1&&(a?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))}),h),o.useEffect((()=>{if(d)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Ze=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ot(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Ze)}}),[d,h,n,u]),o.useEffect((()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ot())}),[d,u]),o.useEffect((()=>{const e=()=>g({})
1501return document.addEventListener(et,e),()=>document.removeEventListener(et,e)}),[]),(0,O.jsx)(Ye.div,{...c,ref:f,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,w.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,D.onPointerDownCapture)})}))
1502rt.displayName="DismissableLayer"
1503var it=o.forwardRef(((e,t)=>{const n=o.useContext(at),a=o.useRef(null),r=Xe(t,a)
1504return o.useEffect((()=>{const e=a.current
1505if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),(0,O.jsx)(Ye.div,{...e,ref:r})}))
1506function ot(){const e=new CustomEvent(et)
1507document.dispatchEvent(e)}function st(e,t,n,{discrete:a}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n})
1508t&&r.addEventListener(e,t,{once:!0}),a?function(e,t){e&&We.flushSync((()=>
1508e.dispatchEvent(t)))}(r,i):r.dispatchEvent(i)}it.displayName="DismissableLayerBranch"
1509function lt(e,t){if("function"==typeof e)return e(t)
1510null!=e&&(e.current=t)}function ct(...e){return o.useCallback(function(...e){return t=>{let n=!1
1511const a=e.map((e=>{const a=lt(e,t)
1512return n||"function"!=typeof a||(n=!0),a}))
1513if(n)return()=>{for(let t=0;t<a.length;t++){const n=a[t]
1514"function"==typeof n?n():lt(e[t],null)}}}}(...e),e)}var ut=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,t)=>{const n=He(`Primitive.${t}`),a=o.forwardRef(((e,a)=>{const{asChild:r,...i}=e,o=r?n:t
1515return window[Symbol.for("radix-ui")]=!0,(0,O.jsx)(o,{...i,ref:a})}))
1516return a.displayName=`Primitive.${t}`,{...e,[t]:a}}),{})
1517function dt(e){const t=o.useRef(e)
1518return o.useEffect((()=>{t.current=e})),o.useMemo((()=>(...e)=>t.current?.(...e)),[])}var pt="focusScope.autoFocusOnMount",ht="focusScope.autoFocusOnUnmount",gt={bubbles:!1,cancelable:!0},ft=o.forwardRef(((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...s}=e,[l,c]=o.useState(null),u=dt(r),d=dt(i),p=o.useRef(null),h=ct(t,(e=>c(e))),g=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current
1519o.useEffect((()=>{if(a){let e=function(e){if(g.paused||!l)return
1520const t=e.target
1521l.contains(t)?p.current=t:yt(p.current,{select:!0})},t=function(e){if(g.paused||!l)return
1522const t=e.relatedTarget
1523null!==t&&(l.contains(t)||yt(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&yt(l)}
1524document.addEventListener("focusin",e),document.addEventListener("focusout",t)
1525const a=new MutationObserver(n)
1526return l&&a.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),a.disconnect()}}}),[a,l,g.paused]),o.useEffect((()=>{if(l){xt.add(g)
1527const t=document.activeElement
1528if(!l.contains(t)){const n=new CustomEvent(pt,gt)
1529l.addEventListener(pt,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement
1530for(const a of e)if(yt(a,{select:t}),document.activeElement!==n)return}((e=mt(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&yt(l))}return()=>{l.removeEventListener(pt,u),setTimeout((()=>{const e=new CustomEvent(ht,gt)
1531l.addEventListener(ht,d),l.dispatchEvent(e),e.defaultPrevented||yt(t??document.body,{select:!0}),l.removeEventListener(ht,d),xt.remove(g)}),0)}}var e}),[l,u,d,g])
1532const f=o.useCallback((e=>{if(!n&&!a)return
1533if(g.paused)return
1534const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement
1535if(t&&r){const t=e.currentTarget,[a,i]=function(e){const t=mt(e),n=vt(t,e),a=vt(t.reverse(),e)
1536return[n,a]}(t)
1537a&&i?e.shiftKey||r!==i?e.shiftKey&&r===a&&(e.preventDefault(),n&&yt(i,{select:!0})):(e.preventDefault(),n&&yt(a,{select:!0})):r===t&&e.preventDefault()}}),[n,a,g.paused])
1538return(0,O.jsx)(ut.div,{tabIndex:-1,...s,ref:h,onKeyDown:f})}))
1539function mt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type
1540return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}})
1541for(;n.nextNode();)t.push(n.currentNode)
1542return t}function vt(e,t){for(const n of e)if(!bt(n,{upTo:t}))return n}function bt(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0
1543for(;e;){if(void 0!==t&&e===t)return!1
1544if("none"===getComputedStyle(e).display)return!0
1545e=e.parentElement}return!1}function yt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement
1546e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}ft.displayName="FocusScope"
1547var xt=function(){let e=[]
1548return{add(t){const n=e[0]
1549t!==n&&n?.pause(),e=Ct(e,t),e.unshift(t)},remove(t){e=Ct(e,t),e[0]?.resume()}}}()
1550function Ct(e,t){const n=[...e],a=n.indexOf(t)
1551return-1!==a&&n.splice(a,1),n}var Dt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,t)=>{const n=He(`Primitive.${t}`),a=o.forwardRef(((e,a)=>{const{asChild:r,...i}=e,o=r?n:t
1552return window[Symbol.for("radix-ui")]=!0,(0,O.jsx)(o,{...i,ref:a})}))
1553return a.displayName=`Primitive.${t}`,{...e,[t]:a}}),{})
1554var wt=globalThis?.document?o.useLayoutEffect:()=>{},At=o.forwardRef(((e,t)=>{const{container:n,...a}=e,[r,i]=o.useState(!1)
1555wt((()=>i(!0)),[])
1556const s=n||r&&globalThis?.document?.body
1557return s?We.createPortal((0,O.jsx)(Dt.div,{...a,ref:t}),s):null}))
1558At.displayName="Portal"
1559function Et(e,t){if("function"==typeof e)return e(t)
1560null!=e&&(e.current=t)}function jt(...e){return o.useCallback(function(...e){return t=>{let n=!1
1561const a=e.map((e=>{const a=Et(e,t)
1562return n||"function"!=typeof a||(n=!0),a}))
1563if(n)return()=>{for(let t=0;t<a.length;t++){const n=a[t]
1564"function"==typeof n?n():Et(e[t],null)}}}}(...e),e)}var Bt=globalThis?.document?o.useLayoutEffect:()=>{}
1565var kt=e=>{const{present:t,children:n}=e,a=function(e){const[t,n]=o.useState(),a=o.useRef(null),r=o.useRef(e),i=o.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return o.useReducer(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}})
1566return o.useEffect((()=>{const e=St(a.current)
1567i.current="mounted"===l?e:"none"}),[l]),Bt((()=>{const t=a.current,n=r.current
1568if(n!==e){const a=i.current,o=St(t)
1569if(e)c("MOUNT")
1570else if("none"===o||"none"===t?.display)c("UNMOUNT")
1571else{c(n&&a!==o?"ANIMATION_OUT":"UNMOUNT")}r.current=e}}),[e,c]),Bt((()=>
1571{if(t){let e
1572const n=t.ownerDocument.defaultView??window,o=i=>{const o=St(a.current).includes(CSS.escape(i.animationName))
1573if(i.target===t&&o&&(c("ANIMATION_END"),!r.current)){const a=t.style.animationFillMode
1574t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=a)}))}},s=e=>{e.target===t&&(i.current=St(a.current))}
1575return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",o),t.addEventListener("animationend",o),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",o),t.removeEventListener("animationend",o)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:o.useCallback((e=>{a.current=e?getComputedStyle(e):null,n(e)}),[])}}(t),r="function"==typeof n?n({present:a.isPresent}):o.Children.only(n),i=jt(a.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning
1576if(n)return e.ref
1577if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref
1578return e.props.ref||e.ref}(r))
1579return"function"==typeof n||a.isPresent?o.cloneElement(r,{ref:i}):null}
1580function St(e){return e?.animationName||"none"}kt.displayName="Presence"
1581var Nt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,t)=>{const n=He(`Primitive.${t}`),a=o.forwardRef(((e,a)=>{const{asChild:r,...i}=e,o=r?n:t
1582return window[Symbol.for("radix-ui")]=!0,(0,O.jsx)(o,{...i,ref:a})}))
1583return a.displayName=`Primitive.${t}`,{...e,[t]:a}}),{})
1584var Ft=0
1585function Ot(){o.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]")
1586return document.body.insertAdjacentElement("afterbegin",e[0]??Mt()),document.body.insertAdjacentElement("beforeend",e[1]??Mt()),Ft++,()=>{1===Ft&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Ft--}}),[])}function Mt(){const e=document.createElement("span")
1587return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Pt=n(78322),Tt=n(74335),It=n(87745),Rt=(0,n(33580).f)(),Lt=function(){},_t=o.forwardRef((function(e,t){var n=o.useRef(null),a=o.useState({onScrollCapture:Lt,onWheelCapture:Lt,onTouchMoveCapture:Lt}),r=a[0],i=a[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,g=e.noRelative,f=e.noIsolation,m=e.inert,v=e.allowPinchZoom,b=e.as,y=void 0===b?"div":b,x=e.gapMode,C=(0,Pt.Tt)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=h,w=(0,It.S)([n,t]),A=(0,Pt.Cl)((0,Pt.Cl)({},C),r)
1588return o.createElement(o.Fragment,null,d&&o.createElement(D,{sideCar:Rt,removeScrollBar:u,shards:p,noRelative:g,noIsolation:f,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:x}),s?o.cloneElement(o.Children.only(l),(0,Pt.Cl)((0,Pt.Cl)({},A),{ref:w})):o.createElement(y,(0,Pt.Cl)({},A,{className:c,ref:w}),l))}))
1589_t.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_t.classNames={fullWidth:Tt.pN,zeroRight:Tt.Mi}
1590var $t=n(28308),zt=n(95389),Wt=n(30228),Ut=!1
1591try{var Vt=Object.defineProperty({},"passive",{get:function(){return Ut=!0,!0}})
1592window.addEventListener("test",Vt,Vt),window.removeEventListener("test",Vt,Vt)}catch(e){Ut=!1}var Ht=!!Ut&&{passive:!1},Kt=function(e,t){if(!(e instanceof Element))return!1
1593var n=window.getComputedStyle(e)
1594return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},qt=function(e,t){var n=t.ownerDocument,a=t
1595do{if("undefined"!=typeof ShadowRoot&&a instanceof ShadowRoot&&(a=a.host),Gt(e,a)){var r=Yt(e,a)
1596if(r[1]>r[2])return!0}a=a.parentNode}while(a&&a!==n.body)
1597return!1},Gt=function(e,t){return"v"===e?function(e){return Kt(e,"overflowY")}(t):function(e){return Kt(e,"overflowX")}(t)},Yt=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)
1598var n},Jt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xt=function(e){return[e.deltaX,e.deltaY]},Qt=function(e){return e&&"current"in e?e.current:e},Zt=function(e){return"\n  .block-interactivity-".concat(e," {pointer-events: none;}\n  .allow-interactivity-").concat(e," {pointer-events: all;}\n")},en=0,tn=[]
1599function nn(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode
1600return t}const an=(0,$t.m)(Rt,(function(e){var t=o.useRef([]),n=o.useRef([0,0]),a=o.useRef(),r=o.useState(en++)[0],i=o.useState(Wt.T0)[0],s=o.useRef(e)
1601o.useEffect((function(){s.current=e}),[e]),o.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r))
1602var t=(0,Pt.fX)([e.lockRef.current],(e.shards||[]).map(Qt),!0).filter(
1602Boolean)
1603return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(r))})),function(){document.body.classList.remove("block-interactivity-".concat(r)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(r))}))}}}),[e.inert,e.lockRef.current,e.shards])
1604var l=o.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom
1605var r,i=Jt(e),o=n.current,l="deltaX"in e?e.deltaX:o[0]-i[0],c="deltaY"in e?e.deltaY:o[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v"
1606if("touches"in e&&"h"===d&&"range"===u.type)return!1
1607var p=qt(d,u)
1608if(!p)return!0
1609if(p?r=d:(r="v"===d?"h":"v",p=qt(d,u)),!p)return!1
1610if(!a.current&&"changedTouches"in e&&(l||c)&&(a.current=r),!r)return!0
1611var h=a.current||r
1612return function(e,t,n,a,r){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),o=i*a,s=n.target,l=t.contains(s),c=!1,u=o>0,d=0,p=0
1613do{if(!s)break
1614var h=Yt(e,s),g=h[0],f=h[1]-h[2]-i*g;(g||f)&&Gt(e,s)&&(d+=f,p+=g)
1615var m=s.parentNode
1616s=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&s!==document.body||l&&(t.contains(s)||t===s))
1617return(u&&(r&&Math.abs(d)<1||!r&&o>d)||!u&&(r&&Math.abs(p)<1||!r&&-o>p))&&(c=!0),c}(h,t,e,"h"===h?l:c,!0)}),[]),c=o.useCallback((function(e){var n=e
1618if(tn.length&&tn[tn.length-1]===i){var a="deltaY"in n?Xt(n):Jt(n),r=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&(t=e.delta,r=a,t[0]===r[0]&&t[1]===r[1])
1619var t,r}))[0]
1620if(r&&r.should)n.cancelable&&n.preventDefault()
1621else if(!r){var o=(s.current.shards||[]).map(Qt).filter(Boolean).filter((function(e){return e.contains(n.target)}));(o.length>0?l(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=o.useCallback((function(e,n,a,r){var i={name:e,delta:n,target:a,should:r,shadowParent:nn(a)}
1622t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=o.useCallback((function(e){n.current=Jt(e),a.current=void 0}),[]),p=o.useCallback((function(t){u(t.type,Xt(t),t.target,l(t,e.lockRef.current))}),[]),h=o.useCallback((function(t){u(t.type,Jt(t),t.target,l(t,e.lockRef.current))}),[])
1623o.useEffect((function(){return tn.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ht),document.addEventListener("touchmove",c,Ht),document.addEventListener("touchstart",d,Ht),function(){tn=tn.filter((function(e){return e!==i})),document.removeEventListener("wheel",c,Ht),document.removeEventListener("touchmove",c,Ht),document.removeEventListener("touchstart",d,Ht)}}),[])
1624var g=e.removeScrollBar,f=e.inert
1625return o.createElement(o.Fragment,null,f?o.createElement(i,{styles:Zt(r)}):null,g?o.createElement(zt.jp,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}))
1626var rn=o.forwardRef((function(e,t){return o.createElement(_t,(0,Pt.Cl)({},e,{ref:t,sideCar:an}))}))
1627rn.classNames=_t.classNames
1628const on=rn
1629var sn=n(94926),ln="Dialog",[cn,un]=function(e,t=[]){let n=[]
1630const a=()=>{const t=n.map((e=>o.createContext(e)))
1631return function(n){const a=n?.[e]||t
1632return o.useMemo((()=>({[`__scope${e}`]:{...n,[e]:a}})),[n,a])}}
1633return a.scopeName=e,[function(t,a){const r=o.createContext(a),i=n.length
1634n=[...n,a]
1635const s=t=>{const{scope:n,children:a,...s}=t,l=n?.[e]?.[i]||r,c=o.useMemo((()=>s),Object.values(s))
1636return(0,O.jsx)(l.Provider,{value:c,children:a})}
1637return s.displayName=t+"Provider",[s,function(n,s){const l=s?.[e]?.[i]||r,c=o.useContext(l)
1638if(c)return c
1639if(void 0!==a)return a
1640throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Te(a,...t)]}(ln),[dn,pn]=cn(ln),hn=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:r,onOpenChange:i,modal:s=!0}=e,l=o.useRef(null),c=o.useRef(null),[u,d]=ze({prop:a,defaultProp:r??!1,onChange:i,caller:ln})
1641return(0,O.jsx)(dn,{scope:t,triggerRef:l,contentRef:c,contentId:_e(),titleId:_e(),descriptionId:_e(),open:u,onOpenChange:d,onOpenToggle:o.useCallback((()=>d((e=>!e))),[d]),modal:s,children:n})}
1642hn.displayName=ln
1643var gn="DialogTrigger",fn=o.forwardRef(((e,t)=>{const{__scopeDialog:n,...a}=e,r=pn(gn,n),i=Pe(t,r.triggerRef)
1644return(0,O.jsx)(Nt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Tn(r.open),...a,ref:i,onClick:Oe(e.onClick,r.onOpenToggle)})}
1644))
1645fn.displayName=gn
1646var mn="DialogPortal",[vn,bn]=cn(mn,{forceMount:void 0}),yn=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:r}=e,i=pn(mn,t)
1647return(0,O.jsx)(vn,{scope:t,forceMount:n,children:o.Children.map(a,(e=>(0,O.jsx)(kt,{present:n||i.open,children:(0,O.jsx)(At,{asChild:!0,container:r,children:e})})))})}
1648yn.displayName=mn
1649var xn="DialogOverlay",Cn=o.forwardRef(((e,t)=>{const n=bn(xn,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,i=pn(xn,e.__scopeDialog)
1650return i.modal?(0,O.jsx)(kt,{present:a||i.open,children:(0,O.jsx)(wn,{...r,ref:t})}):null}))
1651Cn.displayName=xn
1652var Dn=He("DialogOverlay.RemoveScroll"),wn=o.forwardRef(((e,t)=>{const{__scopeDialog:n,...a}=e,r=pn(xn,n)
1653return(0,O.jsx)(on,{as:Dn,allowPinchZoom:!0,shards:[r.contentRef],children:(0,O.jsx)(Nt.div,{"data-state":Tn(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})})),An="DialogContent",En=o.forwardRef(((e,t)=>{const n=bn(An,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,i=pn(An,e.__scopeDialog)
1654return(0,O.jsx)(kt,{present:a||i.open,children:i.modal?(0,O.jsx)(jn,{...r,ref:t}):(0,O.jsx)(Bn,{...r,ref:t})})}))
1655En.displayName=An
1656var jn=o.forwardRef(((e,t)=>{const n=pn(An,e.__scopeDialog),a=o.useRef(null),r=Pe(t,n.contentRef,a)
1657return o.useEffect((()=>{const e=a.current
1658if(e)return(0,sn.Eq)(e)}),[]),(0,O.jsx)(kn,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,(e=>{e.preventDefault(),n.triggerRef.current?.focus()})),onPointerDownOutside:Oe(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:Oe(e.onFocusOutside,(e=>e.preventDefault()))})})),Bn=o.forwardRef(((e,t)=>{const n=pn(An,e.__scopeDialog),a=o.useRef(!1),r=o.useRef(!1)
1659return(0,O.jsx)(kn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||n.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(r.current=!0))
1660const i=t.target,o=n.triggerRef.current?.contains(i)
1661o&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&r.current&&t.preventDefault()}})})),kn=o.forwardRef(((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:i,...s}=e,l=pn(An,n),c=o.useRef(null),u=Pe(t,c)
1662return Ot(),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(ft,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:i,children:(0,O.jsx)(rt,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Tn(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(_n,{titleId:l.titleId}),(0,O.jsx)($n,{contentRef:c,descriptionId:l.descriptionId})]})]})})),Sn="DialogTitle",Nn=o.forwardRef(((e,t)=>{const{__scopeDialog:n,...a}=e,r=pn(Sn,n)
1663return(0,O.jsx)(Nt.h2,{id:r.titleId,...a,ref:t})}))
1664Nn.displayName=Sn
1665var Fn="DialogDescription",On=o.forwardRef(((e,t)=>{const{__scopeDialog:n,...a}=e,r=pn(Fn,n)
1666return(0,O.jsx)(Nt.p,{id:r.descriptionId,...a,ref:t})}))
1667On.displayName=Fn
1668var Mn="DialogClose",Pn=o.forwardRef(((e,t)=>{const{__scopeDialog:n,...a}=e,r=pn(Mn,n)
1669return(0,O.jsx)(Nt.button,{type:"button",...a,ref:t,onClick:Oe(e.onClick,(()=>r.onOpenChange(!1)))})}))
1670function Tn(e){return e?"open":"closed"}Pn.displayName=Mn
1671var In="DialogTitleWarning",[Rn,Ln]=function(e,t){const n=o.createContext(t),a=e=>{const{children:t,...a}=e,r=o.useMemo((()=>a),Object.values(a))
1672return(0,O.jsx)(n.Provider,{value:r,children:t})}
1673return a.displayName=e+"Provider",[a,function(a){const r=o.useContext(n)
1674if(r)return r
1675if(void 0!==t)return t
1676throw new Error(`\`${a}\` must be used within \`${e}\``)}]}(In,{contentName:An,titleName:Sn,docsSlug:"dialog"}),_n=({titleId:e})=>{const t=Ln(In),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`
1677return o.useEffect((()=>
1677{if(e){document.getElementById(e)||console.error(n)}}),[n,e]),null},$n=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ln("DialogDescriptionWarning").contentName}}.`
1678return o.useEffect((()=>{const a=e.current?.getAttribute("aria-describedby")
1679if(t&&a){document.getElementById(t)||console.warn(n)}}),[n,e,t]),null},zn=hn,Wn=yn,Un=Cn,Vn=En,Hn=Nn,Kn=On,qn=Pn,Gn=n(94322),Yn=n(96307),Jn=n.n(Yn),Xn=n(60938)
1680function Qn(e){return"/"===e.get("href")}function Zn(e,t){if(!e||0===e.size)return[]
1681return function e(n,a){for(let r=0;r<n.size;r++){const i=n.get(r)
1682if(!i)continue
1683const o=i.get("id")
1684if(o===t)return a
1685const s=i.get("children")
1686if(s&&s.size>0){const t=e(s,o?[...a,o]:a)
1687if(null!==t)return t}}return null}(e,[])??[]}n(79826)
1688function ea({categories:e,t}){const n=r().List([r().Map({id:"",name:t("assignCategorySection.defaultSelectValueName")})]),a=n.concat(e.sortBy((e=>e?.get("name").toLowerCase()))).map((e=>e?(0,O.jsx)("option",{value:e.get("id"),children:e.get("type")?`${e.get("name")} (${e.get("type")})`:`${e.get("name")}`},e.get("id")):null)),i=n.getIn(["0","id"])
1689return(0,O.jsx)(K.A,{name:"selectedCollectionInfo",tagName:"label",label:t("assignCategorySection.label"),children:(0,O.jsx)(q.A,{name:"selectedCollectionInfo",children:(n,o)=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(K.A,{className:(0,c.A)(["ep-form-row-small-margin",{disabled:!e||e.isEmpty()}]),name:"createWithCollection",tagName:"label",labelAfterComponent:!0,label:t("assignCategorySection.displayProductsCheckbox"),children:(0,O.jsx)("input",{className:"ep-form-row-checkbox",type:"checkbox",name:"createWithCollection",onChange:e=>o(r().Map({isActive:e.target.checked,collectionId:i})),disabled:!e||e.isEmpty()})}),n.get("isActive")&&(0,O.jsx)("div",{className:"ep-form-row",children:(0,O.jsx)("select",{className:"ep-form-select",defaultValue:i,onChange:e=>o(r().Map({isActive:n.get("isActive"),collectionId:e.target.value})),children:(""===n.get("collectionId")?a:a.slice(1)).toArray()})})]})})})}var ta,na=n(46312)
1690n(98456)
1691const aa="ep-page-tree-insertion",ra="level-down",ia="level-down-right",oa="level-right",sa=(e,t)=>(0,O.jsx)("div",{className:e},t)
1692function la({page:e}){return e.get("level")?(0,O.jsx)("div",{className:"ep-page-tree",children:e.get("branchDrawPattern")&&e.get("branchDrawPattern").map(sa)}):null}function ca({page:e}){return(0,O.jsx)("div",{className:(0,c.A)([{"ep-page-main":!e.get("slug")}]),children:`${e.get("title")}`})}function ua({page:e}){return(0,O.jsxs)(O.Fragment,{children:[ta||(ta=(0,O.jsx)("span",{className:"ep-page-insertion"})),(0,O.jsx)(la,{page:e}),(0,O.jsx)(ca,{page:e})]})}var da=n(77472)
1693const pa=(e,t,n,a=0,r=[])=>{const i=[]
1694if(t>0){const o=e.indexOf(n)+1===e.size
1695r.length>0&&(t>a?(i.push(...r.slice(0,-1)),r[r.length-1]===ia?i.push(ra):i.push(aa)):t-a?i.push(...r.slice(0,t-1)):i.push(...r.slice(0,-1))),i.push(o?oa:ia)}return i}
1695,ha=(e,t=0,n=r().List())=>(e.forEach((a=>{n=n.push(r().Map({id:a.get("id"),href:a.get("href"),isVisible:a.get("isVisible"),title:a.get("title"),slug:a.get("slug"),level:t,branchDrawPattern:pa(e,t,a,n.last()?.get("level"),n.last()?.get("branchDrawPattern")),parents:a.get("parents")})),a.get("children").size>0&&(n=ha(a.get("children"),t+1,n))})),n),ga=e=>r().Map({id:"main-menu",isVisible:!0,title:e("components.editorSidebarComponent.pageManagerSection.contentPagesSection.pageSettingsModal.pageLevelSection.mainLevel"),slug:"",level:0,children:r().List(),parents:r().List()}),fa=e=>e.get("level")+1<4
1696function ma(){const e=(0,S.WD)("interface"),t=(0,l.d4)((e=>e.getIn(["navigation","editor"]).filterNot((e=>e.get("type")&&"category"===e.get("type"))))),n=r().List([ga(e)]).concat(ha(t.filterNot(Qn)).filter(fa)).toList()
1697return(0,O.jsx)(K.A,{name:"pageParentSlug",tagName:"label",label:e("components.editorSidebarComponent.pageManagerSection.contentPagesSection.pageSettingsModal.pageLevelSection.label"),children:(0,O.jsx)(q.A,{name:"pageParentSlug",children:(e,t)=>{const a=(i=e,(r=n).indexOf(r.find((e=>e.get("slug")===i))))
1698var r,i
1699return(0,O.jsx)(da.A,{className:"ep-page-level-select",name:"selectParent",selectedIndex:a,options:n,onChange:e=>n.get(e)&&t(n.get(e).get("slug")),renderOption:e=>(0,O.jsx)(ua,{page:e,isSelected:n.get(a).get("id")===e.get("id")}),renderSelectedOption:e=>e&&(0,O.jsx)("label",{className:"ep-custom-select-label",children:e.get("title")}),showSelectedInList:!0})}},"pageParentSlug")})}var va,ba
1700function ya({categories:e,changedPage:t,isBeyondShop:n,mode:a,tModal:r,mainNavigation:i}){const o=(0,Xn.wd)(i,(e=>e.get("slug")===t.get("pageParentSlug"))),s=!1===o?.get("isVisible")
1701return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(K.A,{tagName:"label",name:"title",label:r("pageNameInputField.label")+"*",title:r("pageNameInputField.tooltip"),children:va||(va=(0,O.jsx)(G.A,{name:"title",type:"text",maxLength:100,autoFocus:!0}))},"pageName"),n&&(0,O.jsx)(ea,{t:r,categories:e}),(0,O.jsx)(K.A,{name:"isVisible",label:r("visibilitySection.title"),children:s?(0,O.jsx)("p",{className:"ep-form-row-text",children:r("visibilitySection.childOfHiddenPageNotShowableExplanation")}):(0,O.jsx)(na.A,{info:r("visibilitySection.hideRadioButton.explanation"),children:(0,O.jsx)(Y.A,{name:"isVisible",buttons:[{label:r("visibilitySection.showRadioButton.label"),value:!0},{label:r("visibilitySection.hideRadioButton.label"),value:!1}]})})},"visibility"),"create"!==a&&(0,O.jsx)("div",{className:"ep-form-row",children:(0,O.jsxs)("div",{className:"ep-form-row-label",children:[(0,O.jsx)("span",{className:"ep-form-row-label-text",children:r("navigationSection.title")}),(0,O.jsxs)("div",{children:[Qn(t)&&(0,O.jsx)("p",{className:"ep-form-row-text",children:r("navigationSection.startpageNotMovableExplanation")}),(0,O.jsx)(Y.A,{disabled:Qn(t),name:"navigation",buttons:[{label:r("navigationSection.mainMenuRadioButton.label"),value:"main"},{label:r("navigationSection.footerMenuRadioButton.label"),value:"footer"}]})]})]})}),"main"===t.get("navigation")&&(ba||(ba=(0,O.jsx)(ma,{})))]})}var xa,Ca,Da,wa=n(57381)
1702n(61529)
1703function Aa(e,t){let n=0
1704const a=function(e,t,i){return e.reduce(((e,r)=>{const o=t(r,n++),s=a(r.get("children"),t,i+1)
1705return e.push(o).concat(s)}),r().fromJS([]))}
1706return a(e,t,0)}const Ea="components.editorSidebarComponent.pageManagerSection"
1707function ja({footerPages:e,mainNavigation:t,page:n,mode:a,onRequestClose:s,expandPages:u}){var d
1708const h=(0,S.WD)("interface"),g=(0,l.d4)((e=>e.getIn(["shop","locale"],"").substring(0,2))),f=(0,l.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),m=(0,l.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),v=(0,l.d4)((e=>e.get("categoriesList").toList())),b=(0,l.wA)(),y=(0,i.zy)(),[x,C]=(0,o.useState)({isSubmitting:!1,submitError:null}),D=(0,i.Zp)(),w={lang:g,truncate:250},A=n?.get("type"),E=(e,t)=>{if(n){return h(`${Ea}.${{category:"categories",blank:"contentPages",legal:"legalPages"}[A]}Section.pageSettingsModal.${e}`,t)}return h(`${Ea}.contentPagesSection.createPageModal.${e}`,t)},j=n?.get("navigation")||"main",B="create"===a?h(`${Ea}.contentPagesSection.createPageModal.title.${"footer"===j?"footer":"mainMenu"}`):E("blank"===A?`title.on${(0,Gn.A)(a)}`:"title"),k=Aa(t.concat(e),(e=>
1708"blank"===e.get("type")&&e.get("slug"))).filter(Boolean),N=({status:e,message:t})=>{const n="Maximum page count reached."===t
1709return(0,O.jsx)("div",{className:(0,c.A)({"ep-form-row":!0,"ep-alert-info":e>=500,"ep-notification-warning":!(e&&e>=500)}),children:n?(0,O.jsx)("div",{children:(0,S.fN)(E)("errorMessages.maximumPageCountReached",{updateLink:(0,O.jsx)("a",{href:`${m}/help`,target:"_parent",children:E("errorMessages.updateLink")})})}):E("errorMessages.generic")})},F=e=>e.update("title",(e=>e.trim())),M=(e,t=1)=>k.includes(e)?k.includes(`${e}-${t}`)?M(e,t+1):`${e}-${t}`:e
1710return(0,o.useEffect)((()=>{f&&!v.size&&b((0,p.d4c)())}),[b,f,v.size]),(0,O.jsx)(zn,{open:!0,onOpenChange:s,modal:!0,children:(0,O.jsx)(Wn,{children:(0,O.jsxs)("div",{className:"ep-ui ep-modal-dialog",children:[xa||(xa=(0,O.jsx)(Un,{className:"ep-modal-overlay"})),(0,O.jsx)(Vn,{asChild:!0,children:(0,O.jsx)("div",{className:"ep-modal-content",children:(0,O.jsx)($.Form,{name:"createPage",value:n,onSubmit:async e=>{C((e=>({...e,isSubmitting:!0})))
1711const n=e.get("pageParentSlug",null),a=(0,Xn.wd)(t,(e=>e.get("slug")===n)),r=a?Zn(t,a.get("id")):[],i=Boolean(e.getIn(["selectedCollectionInfo","isActive"]))?e.getIn(["selectedCollectionInfo","collectionId"]):null,o={pageSlug:M(Jn()(e.get("title"),w)),title:e.get("title"),pageType:"blank",navigation:e.get("navigation"),isVisible:!1!==a?.get("isVisible")&&e.get("isVisible"),collectionId:i,pageParentSlug:n}
1712try{const e=await b((0,p.a3g)(o,{showErrorNotification:!1}))
1713if(D((0,wa.GE)((0,wa.mZ)(e.type,e.slug),y)),"main"===e.navigation?await b((0,p.dd9)()):"footer"===e.navigation&&await b((0,p.uRz)()),a&&u){const e=a.get("id")
1714e&&u([...r,e])}C((e=>({...e,isSubmitting:!1}))),window.parent?.postMessage({type:"CHECKLIST",payload:{websiteOnly:"contentSection.addContent",regularShop:"onlineShopSetup.addPages"}},m),s()}catch(e){C((t=>({...t,isSubmitting:!1,submitError:e})))}},validate:(e,t=!0)=>{const a=F(e),i=a.has("title")&&a.get("title"),o=i?Jn()(i,w):"",s=i?null:E("pageNameInputField.validationMessages.isRequired"),l=i&&o.length<1?E("pageNameInputField.validationMessages.onlySpecialCharacters"):null,c="footer"===a.get("navigation")&&n&&"main"===n.get("navigation")&&n.get("children")&&n.get("children").size>0&&E("pageNameInputField.validationMessages.cannotMakeFooterPageWithChildren")
1715return r().fromJS({title:t&&(s||l||c)||null})},normalize:F,children:({value:e})=>(0,O.jsxs)(O.Fragment,{children:[d||(d=(0,O.jsxs)("div",{className:"ep-modal-header",children:[Ca||(Ca=(0,O.jsx)(qn,{className:"ep-modal-close"})),(0,O.jsx)(Hn,{asChild:!0,children:(0,O.jsx)("div",{className:"ep-modal-title",children:B})}),Da||(Da=(0,O.jsx)(Kn,{className:"visually-hidden",children:"Description for Foo"}))]})),(0,O.jsxs)("div",{className:"ep-modal-body",children:[x.submitError&&N(x.submitError),(0,O.jsx)(ya,{changedPage:e,tModal:E,isBeyondShop:f,categories:v,mode:a,mainNavigation:t})]}),(0,O.jsx)("div",{className:"ep-modal-footer",children:(0,O.jsxs)(R.A,{children:[(0,O.jsx)(I.A,{type:"button",variant:"outline",disabled:x.isSubmitting,onClick:()=>s(),children:E("cancelButton.label")}),(0,O.jsx)(I.A,{type:"submit",disabled:x.isSubmitting,children:E("saveButton.label")})]})})]})})})})]})})})}var Ba,ka,Sa,Na
1716function Fa({tModal:e}){return(0,O.jsx)(K.A,{tagName:"label",name:"title",label:e("pageNameInputField.label")+"*",title:e("pageNameInputField.tooltip"),children:Ba||(Ba=(0,O.jsx)(G.A,{name:"title",type:"text",maxLength:100}))},"pageName")}const Oa="components.editorSidebarComponent.pageManagerSection"
1717function Ma({footerPages:e,mainNavigation:t,page:n,mode:a,onRequestClose:s}){var u
1718const d=(0,S.WD)("interface"),h=(0,l.d4)((e=>e.getIn(["shop","locale"],"").substring(0,2))),g=(0,l.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),f=(0,l.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),m=(0,l.d4)((e=>e.get("categoriesList").toList())),v=(0,l.wA)(),b=(0,i.zy)(),[y,x]=(0,o.useState)({isSubmitting:!1,submitError:null}),C=(0,i.Zp)(),D={lang:h,truncate:250},w=n?.get("type"),A=(e,t)=>
1718d(n?`${Oa}.contentPagesSection.pageSettingsModal.${e}`:`${Oa}.contentPagesSection.createPageModal.${e}`,t),E=A("blank"===w?`title.on${(0,Gn.A)(a)}`:"title"),j=d(`${Oa}.contentPagesSection.duplicatePageModal.copy`),B=Aa(t.concat(e),(e=>"blank"===e.get("type")&&e.get("slug"))).filter(Boolean),k=({status:e,message:t})=>{const n="Maximum page count reached."===t
1719return(0,O.jsx)("div",{className:(0,c.A)({"ep-form-row":!0,"ep-alert-info":e>=500,"ep-notification-warning":!(e&&e>=500)}),children:n?(0,O.jsx)("div",{children:(0,S.fN)(A)("errorMessages.maximumPageCountReached",{updateLink:(0,O.jsx)("a",{href:`${f}/help`,target:"_parent",children:A("errorMessages.updateLink")})})}):A("errorMessages.generic")})},N=e=>e.update("title",(e=>e.trim())),F=(e,t=1)=>B.includes(e)?B.includes(`${e}-${t}`)?F(e,t+1):`${e}-${t}`:e
1720return(0,o.useEffect)((()=>{g&&!m.size&&v((0,p.d4c)())}),[v,g,m.size]),(0,O.jsx)(zn,{open:!0,onOpenChange:s,modal:!0,children:(0,O.jsx)(Wn,{children:(0,O.jsxs)("div",{className:"ep-ui ep-modal-dialog",children:[ka||(ka=(0,O.jsx)(Un,{className:"ep-modal-overlay"})),(0,O.jsx)(Vn,{asChild:!0,children:(0,O.jsx)("div",{className:"ep-modal-content",children:(0,O.jsx)($.Form,{name:"duplicatePage",value:n?.set("title",`${n.get("title")}-${j}`),onSubmit:async e=>{x((e=>({...e,isSubmitting:!0})))
1721const t=n?.get("slug"),a={newSlug:F(Jn()(e.get("title"),D)),newTitle:e.get("title")}
1722try{const e=await v((0,p.hih)(t,a,{showErrorNotification:!1}))
1723C((0,wa.GE)((0,wa.mZ)(e.type,e.slug),b)),"main"===e.navigation?await v((0,p.dd9)()):"footer"===e.navigation&&await v((0,p.uRz)()),x((e=>({...e,isSubmitting:!1}))),window.parent?.postMessage({type:"CHECKLIST",payload:{websiteOnly:"contentSection.addContent",regularShop:"onlineShopSetup.addPages"}},f),s()}catch(e){x((t=>({...t,isSubmitting:!1,submitError:e})))}},validate:(e,t=!0)=>{const a=N(e),i=a.has("title")&&a.get("title"),o=i?Jn()(i,D):"",s=i?null:A("pageNameInputField.validationMessages.isRequired"),l=i&&o.length<1?A("pageNameInputField.validationMessages.onlySpecialCharacters"):null,c="footer"===a.get("navigation")&&n&&"main"===n.get("navigation")&&n.get("children")&&n.get("children").size>0&&A("pageNameInputField.validationMessages.cannotMakeFooterPageWithChildren")
1724return r().fromJS({title:t&&(s||l||c)||null})},normalize:N,children:()=>(0,O.jsxs)(O.Fragment,{children:[u||(u=(0,O.jsxs)("div",{className:"ep-modal-header",children:[Sa||(Sa=(0,O.jsx)(qn,{className:"ep-modal-close"})),(0,O.jsx)(Hn,{asChild:!0,children:(0,O.jsx)("div",{className:"ep-modal-title",children:E})}),Na||(Na=(0,O.jsx)(Kn,{className:"visually-hidden",children:"Description for Foo"}))]})),(0,O.jsxs)("div",{className:"ep-modal-body",children:[y.submitError&&k(y.submitError),(0,O.jsx)(Fa,{tModal:A})]}),(0,O.jsx)("div",{className:"ep-modal-footer",children:(0,O.jsxs)(R.A,{children:[(0,O.jsx)(I.A,{type:"button",variant:"outline",disabled:y.isSubmitting,onClick:()=>s(),children:A("cancelButton.label")}),(0,O.jsx)(I.A,{type:"submit",disabled:y.isSubmitting,children:A("saveButton.label")})]})})]})})})})]})})})}var Pa,Ta,Ia,Ra,La=n(4470)
1725function _a({previewPageTitle:e,t}){var n
1726return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(q.A,{name:"titleTag",children:a=>(0,O.jsx)(K.A,{name:"titleTag",tagName:"label",label:t("titleTagInputField.label"),info:t("titleTagInputField.explanation"),meta:t("characterCounter",{characters:a.length,maxCharacters:70}),children:n||(n=(0,O.jsx)(G.A,{name:"titleTag",type:"text",placeholder:e,maxLength:"70"}))})},"titleTag"),(0,O.jsx)(q.A,{name:"metaDescription",children:e=>(0,O.jsx)(K.A,{name:"metaDescription",tagName:"label",label:t("metaDescriptionInputField.label"),info:t("metaDescriptionInputField.explanation"),meta:t("characterCounter",{characters:e.length,maxCharacters:160}),children:Pa||(Pa=(0,O.jsx)(ie,{name:"metaDescription",maxLength:"160"}))})},"metaDescription")]})}function $a({page:e,changedPage:t,shopLocale:n,shopDefaultLocale:r,shopTitle:i,showSeoSettingsForm:o,maybeGenerateNewSlug:s,handleEditClick:l}){const u=(0,S.WD)("interface","components.searchEngineEntryCustomizationComponent"),d=n!==r?`/${n.substring(0,2)}`:"",p=t.get("type"),h=t.get("slug"),g=t.get("title"),f=t.get("titleTag"),m=t.get("metaDescription")
1727let v=t.get("href")
1728const b="/"===v,y=f||(b?i||g:[g,i].filter(Boolean).join(" - "))
1729if(g!==e.get("title")){const e="category"===p,r=e?Jn()(g,{lang:n.substring(0,2),truncate:250}):s(h,g),i=e&&t.getIn(["parents",-1,"slug"])||""
1730b||(v=(0,La.mZ)((0,a.fromJS)({type:p,slug:(i&&i+"/")+r})))}return(0,O.jsxs)("div",{children:[(0,O.jsx)("div",{className:"ep-form-row",children:(0,O.jsxs)("h3",{className:"ep-form-row-headline",children:[u("title"),!o&&(0,O.jsx)("a",{className:"ep-form-row-toggle-info",onClick:()=>l(),children:u("editButton.label")})]})}),(0,O.jsx)("div",{className:"ep-form-row",children:(0,O.jsxs)("div",{className:"ep-seo-preview-google-styles",children:[(0,O.jsx)("h3",{children:y}),(0,O.jsx)("cite",{children:`${window.location.origin}${d}${v}`}),(0,O.jsx)("span",{className:(0,c.A)({"ep-seo-preview-meta-description-placeholder":!m}),children:m||u("metaDescriptionPlaceholder")})]})}),o&&(0,O.jsx)(_a,{previewPageTitle:y,t:u})]},"seoPanel")}function za({adminUrl:e}){const t="components.editorSidebarComponent.pageManagerSection.categoriesSection.pageSettingsModal",n=(0,S.WD)("interface")
1731return e?(0,O.jsx)(K.A,{name:"products",label:n(`${t}.manageCategorySection.title`),children:(0,O.jsxs)("p",{className:"ep-form-row-text",children:[(0,O.jsx)("a",{className:"ep-form-row-text-link",href:`${e}&ViewAction=UnityMBO-ViewProducts`,target:"_parent",children:n(`${t}.manageCategorySection.assignProductsLink`)})," ",n(`${t}.manageCategorySection.or`)," ",(0,O.jsx)("a",{className:"ep-form-row-text-link",href:`${e}&ViewAction=UnityMBO-ViewChildObjects`,target:"_parent",children:n(`${t}.manageCategorySection.manageSubCategoriesLink`)})]})},"categoryMgmt"):null}function Wa({changedPage:e,isBeyondShop:t,mainNavigation:n,maybeGenerateNewSlug:a,page:r,tModal:i}){const[s,c]=(0,o.useState)(!1),u=(0,J.A)("LEGAL_PAGES"),d=(0,l.d4)((e=>e.getIn(["shop","title"]))),p=(0,l.d4)((e=>e.getIn(["shop","locale"]))),h=(0,l.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),g=(0,l.d4)((e=>e.getIn(["shop","defaultLocale"]))),f=(0,Xn.wd)(n,(t=>t.get("slug")===e.get("pageParentSlug"))),m=e.get("parents")&&e.get("parents").count()>0&&!1===e.get("parents").last().get("isVisible")&&e.get("parents").last().get("navigation")===e.get("navigation")||!1===f?.get("isVisible"),v=i(`visibilitySection.${m?"childOfHiddenPageNotShowableExplanation":"startpageNotHideableExplanation"}`),b="category"===e.get("type")?Qn(e)&&e.get("isVisible"):m
1732return(0,O.jsxs)(O.Fragment,{children:[!t&&"legal"===e.get("type")&&!e.get("isVisible")&&(0,O.jsx)("div",{className:"ep-notification-info ep-form-row",children:(0,O.jsxs)("p",{className:"ep-form-row-text",children:[i("checkoutInfoWhenHidden.message")+" ",(0,O.jsx)("a",{className:"ep-form-row-text-link",href:`${h}?ViewAction=UnityMBO-ViewBasketText`,target:"_parent",children:i("checkoutInfoWhenHidden.checkoutSettingsLink")})]})},"notification"),(0,O.jsx)(K.A,{tagName:"label",name:"title",label:i("pageNameInputField.label")+"*",title:i("pageNameInputField.tooltip"),children:(0,O.jsx)(G.A,{name:"title",type:"text",maxLength:100,disabled:"legal"===e.get("type")})},"pageName"),(0,O.jsx)(K.A,{name:"isVisible",label:i("visibilitySection.title"),children:b?(0,O.jsx)("p",{className:"ep-form-row-text",children:v}):(0,O.jsx)(na.A,{hoverableInfo:!0,info:(0,S.fN)(i)("visibilitySection.hideRadioButton.explanation",{link:(0,O.jsx)("a",{className:"ep-form-row-text-external-link",href:u,target:"_blank",rel:"noopener noreferrer",children:i("visibilitySection.hideRadioButton.linkText")})}),children:(0,O.jsx)(Y.A,{name:"isVisible",buttons:[{label:i("visibilitySection.showRadioButton.label"),value:!0},{label:i("visibilitySection.hideRadioButton.label"),value:!1}]})})},"visibility"),"blank"===e.get("type")&&(0,O.jsx)("div",{className:"ep-form-row",children:(0,O.jsxs)("div",{className:"ep-form-row-label",children:[(0,O.jsx)("span",{className:"ep-form-row-label-text",children:i("navigationSection.title")}),(0,O.jsxs)("div",{children:[Qn(e)&&(0,O.jsx)("p",{className:"ep-form-row-text",children:i("navigationSection.startpageNotMovableExplanation")}),(0,O.jsx)(Y.A,{disabled:Qn(e),name:"navigation",buttons:[{label:i("navigationSection.mainMenuRadioButton.label"),value:"main"},{label:i("navigationSection.footerMenuRadioButton.label"),value:"footer"}]})]})]})}),!t&&"category"===e.get("type")&&(0,O.jsx)(K.A,{name:"visibleInNavigation",label:i("visibilityInMenuSection.title"),children:(0,O.jsx)(na.A,{info:i("visibilityInMenuSection.explanation"),children:(0,O.jsx)(Y.A,{name:"visibleInNavigation",disabled:!e.get("isVisible"),buttons:[{label:i("visibilityInMenuSection.showRadioButton.label"),value:!0},{label:i("visibilityInMenuSection.hideRadioButton.label"),value:!1}]})})},"visibleInNavigation"),"category"===e.get("type")&&(0,O.jsx)(za,{adminUrl:`${h}?${e.get("adminUrl").split("?")[1]}`},"categoryManagement"),"legal"!==r.get("type")&&(0,O.jsx)($a,{showSeoSettingsForm:s,handleEditClick:()=>c(!0),shopLocale:p,shopDefaultLocale:g,shopTitle:d,changedPage:e,page:r,maybeGenerateNewSlug:a})]})}function Ua(e){return(0,Xn.hd)(e,((e,t)=>
1732t&&!1===t.get("isVisible")?e.set("isVisible",!1):e))}const Va="components.editorSidebarComponent.pageManagerSection"
1733function Ha({footerPages:e,mainNavigation:t,page:n,mode:a,onRequestClose:s,isActivePage:u,initialDeleteRequested:d=!1,subpageCount:h=0}){const g=(0,S.WD)("interface"),f=(0,l.d4)((e=>e.getIn(["shop","locale"],"").substring(0,2))),m=(0,l.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),v=(0,l.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),b=(0,l.d4)((e=>e.get("categoriesList").toList())),y=(0,l.wA)(),x=(0,i.zy)(),[C,D]=(0,o.useState)({isSubmitting:!1,submitError:null,deleteRequested:d}),w=(0,i.Zp)(),A={lang:f,truncate:250},E=n?.get("type"),j=(e,t)=>{if(n){return g(`${Va}.${{category:"categories",blank:"contentPages",legal:"legalPages"}[E]}Section.pageSettingsModal.${e}`,t)}return g(`${Va}.contentPagesSection.createPageModal.${e}`,t)},B=j("blank"===E?`title.on${(0,Gn.A)(a)}`:"title"),k=m&&n&&Qn(n),N=Aa(t.concat(e),(e=>"blank"===e.get("type")&&e.get("slug"))).filter(Boolean),F=({status:e,message:t})=>{const n="Maximum page count reached."===t
1734return(0,O.jsx)("div",{className:(0,c.A)({"ep-form-row":!0,"ep-alert-info":e>=500,"ep-notification-warning":!(e&&e>=500)}),children:n?(0,O.jsx)("div",{children:(0,S.fN)(j)("errorMessages.maximumPageCountReached",{updateLink:(0,O.jsx)("a",{href:`${v}/help`,target:"_parent",children:j("errorMessages.updateLink")})})}):j("errorMessages.generic")})},M=e=>e.update("title",(e=>e.trim())),P=(e,t)=>e===Jn()(t,A)||k?e:T(Jn()(t,A)),T=(e,t=1)=>N.includes(e)?N.includes(`${e}-${t}`)?T(e,t+1):`${e}-${t}`:e,L={onDeleteRequested:()=>D((e=>({...e,deleteRequested:!0}))),onDeleteConfirm:e=>()=>(async e=>(await y((0,p.Dbo)(e.get("slug"))),u&&w((0,wa.GE)((0,La.j_)(),x)),s(),null))(e),onCancel:()=>C.deleteRequested?d?s():D((e=>({...e,deleteRequested:!1}))):s(),onSubmit:async e=>{const n=e.get("type"),a=e.get("children").count()>0&&!e.get("isVisible")
1735D((e=>({...e,isSubmitting:!0})))
1736const r=(()=>{switch(n){case"blank":return a?(e=>{const n=(0,Xn.hd)(t,(t=>t.get("id")===e.get("id")?e:t))
1737return y((0,p.e96)(Ua(n),{showErrorNotification:!1}))})(e):(async e=>{const t=e.get("title"),n=e.get("slug"),a=P(n,t),r={pageId:e.get("id"),oldPageSlug:n,newPageSlug:a,title:t,titleTag:e.get("titleTag"),metaDescription:e.get("metaDescription"),isVisible:e.get("isVisible"),navigation:e.get("navigation")},i=await y((0,p.gi2)(r,{showErrorNotification:!1}))
1738u&&w((0,wa.GE)((0,wa.mZ)(i.type,i.slug),x),{replace:!0})})(e)
1739case"category":return(e=>{const t={categoryId:e.get("categoryId"),slug:e.get("slug"),title:e.get("title"),titleTag:e.get("titleTag"),metaDescription:e.get("metaDescription"),isVisible:e.get("isVisible"),objectId:e.get("objectId"),facetedSearchCategoryStartDepth:e.get("facetedSearchCategoryStartDepth"),facetedSearchShowFacetsOnCategory:e.get("facetedSearchShowFacetsOnCategory"),visibleInNavigation:e.get("visibleInNavigation")}
1740return y((0,p.bBe)(t,{showErrorNotification:!1}))})(e)
1741case"legal":return(e=>{const t={slug:e.get("slug"),isVisible:e.get("isVisible")}
1742return y((0,p.k5o)(t,{showErrorNotification:!1}))})(e)
1743default:return Promise.resolve()}})()
1744try{await r,D((e=>({...e,isSubmitting:!1}))),window.parent?.postMessage({type:"CHECKLIST",payload:{websiteOnly:"contentSection.addContent",regularShop:"onlineShopSetup.addPages"}},v),s()}catch(e){D((t=>({...t,isSubmitting:!1,submitError:e})))}return null}},_="edit"===a&&n&&"blank"===n.get("type")&&!k
1745return(0,o.useEffect)((()=>{m&&!b.size&&y((0,p.d4c)())}),[y,m,b.size]),(0,O.jsx)(zn,{open:!0,onOpenChange:s,modal:!0,children:(0,O.jsx)(Wn,{children:(0,O.jsxs)("div",{className:"ep-ui ep-modal-dialog",children:[Ta||(Ta=(0,O.jsx)(Un,{className:"ep-modal-overlay"})),(0,O.jsx)(Vn,{asChild:!0,children:(0,O.jsx)("div",{className:"ep-modal-content",children:(0,O.jsx)($.Form,{name:"editPage",value:n,onSubmit:L.onSubmit,validate:(e,t=!0)=>{const a=M(e),i=a.has("title")&&a.get("title"),o=i?Jn()(i,A):"",s=i?null:j("pageNameInputField.validationMessages.isRequired"),l=i&&o.length<1?j("pageNameInputField.validationMessages.onlySpecialCharacters"):null,c="footer"===a.get("navigation")&&n&&"main"===n.get("navigation")&&n.get("children")&&n.get("children").size>0&&j("pageNameInputField.validationMessages.cannotMakeFooterPageWithChildren")
1746return r().fromJS({title:t&&(s||l||c)||null})},normalize:M,children:({value:e})=>(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"ep-modal-header",children:[Ia||(Ia=(0,O.jsx)(qn,{className:"ep-modal-close"})),(0,O.jsx)(Hn,{asChild:!0,children:(0,O.jsx)("div",{className:"ep-modal-title",children:C.deleteRequested?j("deleteButton.warningMessage",{pageTitle:e.get("title")}):B})}),Ra||(Ra=(0,O.jsx)(Kn,{className:"visually-hidden",children:"Description for Foo"}))]}),(0,O.jsxs)("div",{className:"ep-modal-body",children:[C.submitError&&F(C.submitError),C.deleteRequested?(0,O.jsx)("div",{className:"ep-page-delete-confirmation",children:h>0?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("div",{className:"ep-page-delete-confirmation-message",children:j("deleteButton.warningMessageWithSubpages",{pageTitle:e.get("title"),count:h})}),(0,O.jsx)("div",{className:"ep-page-delete-confirmation-warning",children:j("deleteButton.warningMessageCannotUndo")})]}):(0,O.jsx)("div",{className:"ep-page-delete-confirmation-message",children:j("deleteButton.warningMessageCannotUndo")})}):(0,O.jsx)(Wa,{changedPage:e,page:n||r().Map(),tModal:j,maybeGenerateNewSlug:P,isBeyondShop:m,mainNavigation:t})]}),(0,O.jsx)("div",{className:"ep-modal-footer",children:(0,O.jsxs)(R.A,{children:[C.deleteRequested&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(I.A,{type:"button",variant:"outline",disabled:C.isSubmitting,onClick:()=>L.onCancel(),children:j("cancelButton.label")}),(0,O.jsx)(I.A,{type:"button",variant:"danger",disabled:C.isSubmitting,onClick:L.onDeleteConfirm(e),children:j("deleteConfirmButton.label")})]}),!C.deleteRequested&&_&&(0,O.jsx)(I.A,{type:"button",variant:"danger",disabled:C.isSubmitting,onClick:()=>L.onDeleteRequested(),children:j("deleteButton.label")}),!C.deleteRequested&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(I.A,{type:"button",variant:"outline",disabled:C.isSubmitting,onClick:()=>L.onCancel(),children:j("cancelButton.label")}),(0,O.jsx)(I.A,{type:"submit",disabled:C.isSubmitting,children:j("saveButton.label")})]})]})})]})})})})]})})})}var Ka,qa,Ga,Ya,Ja=n(11318),Xa=n(64580),Qa=n(30202),Za=n(89213)
1747function er({page:e,sfLocationPath:t,expandedPages:n,maxNestedPageLevel:a,isReadOnly:r,allowNesting:i=!0,onToggleExpansion:o,onOpenCreateSubpageModal:s,onOpenDuplicateModal:l,onOpenEditModal:u,onDeletePage:d,settingsLabelForType:p,t:h,isDragging:g=!1,dropIndicator:f=null,validationError:m=null}){const v=e.get("type"),b="blank"===v||"legal"===v,y="/"===e.get("href"),{attributes:x,listeners:C,setNodeRef:D,transition:w}=(0,Xa.gl)({id:e.get("id"),disabled:r||!b}),A={transition:w,opacity:g?.3:1},E=e.get("__level")??0,j=E>0?12*(E-1):0,B=(0,c.A)(["ep-page-manager-list-item",{"ep-page-manager-list-item-draggable":!r&&b,"ep-page-manager-list-item-active":e.get("href")===t,"ep-page-manager-list-item-disabled":!e.get("isVisible")||"category"===e.get("type")&&!e.get("visibleInNavigation"),"ep-page-manager-list-item-drop-inside":"inside"===f}])
1748return(0,O.jsxs)("li",{ref:D,style:{...A,height:36},className:B,"data-id":e.get("id"),"data-slug":e.get("slug"),"data-category-id":e.get("categoryId"),"data-level":e.get("__level"),"data-error-message":m??void 0,children:["before"===f&&(0,O.jsx)("div",{className:"ep-page-manager-list-drop-indicator ep-page-manager-list-drop-indicator-before",style:{left:j}}),"after"===f&&(0,O.jsx)("div",{className:"ep-page-manager-list-drop-indicator ep-page-manager-list-drop-indicator-after",style:{left:j}}),(0,O.jsxs)("div",{className:"ep-page-manager-list-item-wrapper",style:{position:"absolute",left:j,right:0},children:[!r&&b&&!y&&(0,O.jsx)("span",{className:"ep-page-manager-list-item-drag-handle icon-drag-handle",...x,...C}),e.get("children")&&e.get("children").size>
17480&&(0,O.jsx)("span",{className:(0,c.A)(["ep-page-manager-list-item-dropdown-icon",{expanded:n.has(e.get("id"))}]),onClick:()=>o(e.get("id")),role:"button",tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),o(e.get("id")))}}),y&&(0,O.jsx)("span",{title:e.get("title"),className:"ep-page-manager-content-type-start"}),"legal"===v&&(0,O.jsx)("span",{title:e.get("title"),className:"ep-page-manager-content-type-legal"}),(0,O.jsx)(Za.A,{className:(0,c.A)(["ep-page-manager-list-item-link",{"ep-page-manager-list-item-link-setting":"blank"!==e.get("type"),"ep-page-manager-list-item-link-duplicate":"blank"===e.get("type")}]),to:e.get("href"),title:e.get("title"),draggable:!1,children:e.get("title")}),!e.get("isVisible")&&(0,O.jsx)("span",{className:"ep-page-manager-list-item-visibility-icon",title:h("visibilityIndicator.tooltip")}),(0,O.jsx)(Qa.A,{trigger:(0,O.jsx)("button",{className:"ep-page-manager-list-item-menu-button",onClick:e=>e.stopPropagation(),children:"⋮"}),side:"right",align:"center",sideOffset:10,keepOpenOnClick:!1,hideArrow:!0,usePortal:!0,children:(0,O.jsxs)("div",{className:"ep-page-manager-menu",children:[i&&"blank"===e.get("type")&&!y&&e.get("__level")<a&&(0,O.jsxs)("div",{className:"ep-page-manager-menu-item",role:"button",tabIndex:0,onClick:()=>s(e.get("slug")),onKeyDown:t=>"Enter"===t.key&&s(e.get("slug")),children:[Ka||(Ka=(0,O.jsx)("span",{className:"ep-page-manager-menu-icon ep-page-manager-menu-icon-add-subpage"})),h("contentPagesSection.addSubpageButton.label")]}),"blank"===e.get("type")&&(0,O.jsxs)("div",{className:"ep-page-manager-menu-item",role:"button",tabIndex:0,onClick:()=>l(e),onKeyDown:t=>"Enter"===t.key&&l(e),children:[qa||(qa=(0,O.jsx)("span",{className:"ep-page-manager-menu-icon ep-page-manager-menu-icon-duplicate"})),h("contentPagesSection.duplicatePageButton.label")]}),(0,O.jsxs)("div",{className:"ep-page-manager-menu-item",role:"button",tabIndex:0,onClick:()=>u(e),onKeyDown:t=>"Enter"===t.key&&u(e),children:[Ga||(Ga=(0,O.jsx)("span",{className:"ep-page-manager-menu-icon ep-page-manager-menu-icon-settings"})),p(e.get("type"))]}),"blank"===e.get("type")&&!y&&(0,O.jsxs)("div",{className:"ep-page-manager-menu-item",role:"button",tabIndex:0,onClick:()=>d(e),onKeyDown:t=>"Enter"===t.key&&d(e),children:[Ya||(Ya=(0,O.jsx)("span",{className:"ep-page-manager-menu-icon ep-page-manager-menu-icon-delete"})),h("contentPagesSection.pageSettingsModal.deleteButton.label")]})]})})]})]})}function tr(e,t=0,n=!1){if(!e||0===e.size)return t>0?t-1:-1
1749let a=-1
1750return e.forEach((e=>{const r=e.get("type")
1751if(n&&0===t&&"blank"!==r){const r=e.get("children")
1752if(r&&r.size>0){const e=tr(r,t,n)
1753e>=0&&(a=Math.max(a,e))}return}a=Math.max(a,t)
1754const i=e.get("children")
1755if(i&&i.size>0){const e=tr(i,t+1,n)
1756e>=0&&(a=Math.max(a,e))}})),a}function nr(e){return(0,Xn.hd)([e],(e=>e.delete("__totalChildrenCount").delete("__treeLines").delete("__level").delete("__parentId").delete("__root").delete("__indexGlobal").delete("__indexLocal")))[0]}function ar(e,t){let n=null
1757return{tree:e.map((e=>{if(e.get("id")===t)return n=e,null
1758const a=e.get("children")
1759if(a&&a.size>0){const r=ar(a,t)
1760if(r.removed)return n=r.removed,e.set("children",r.tree)}return e})).filter((e=>null!==e)),removed:n}}function rr(e,t,n){let a=!1
1761return{tree:e.map((e=>{if(e.get("id")===t){a=!0
1762const t=e.get("children")||r().List()
1763return e.set("children",t.push(n))}const i=e.get("children")
1764if(i&&i.size>0){const r=rr(i,t,n)
1765if(r.added)return a=!0,e.set("children",r.tree)}return e})),added:a}}function ir(e,t,n,a){let i=!1
1766return{tree:r().List().withMutations((r=>{e.forEach((e=>{if(e.get("id")===t)i=!0,a||r.push(n),r.push(e),a&&r.push(n)
1767else{const o=e.get("children")
1768if(o&&o.size>0){const s=ir(o,t,n,a)
1769s.added?(i=!0,r.push(e.set("children",s.tree))):r.push(e)}else r.push(e)}}))})),added:i}}function or(e){if(!e)return 0
1770const t=e.get("children")
1771if(!t||0===t.size)return 0
1772let n=t.size
1773return t.forEach((e=>{n+=or(e)})),n}var sr,lr=n(38868)
1774const cr={activeId:null,dropIndicator:null,validationError:null}
1775function ur(e,t){switch(t.type){case"DRAG_START":return{...e,activeId:t.payload.activeId}
1776case"DRAG_MOVE":return{...e,dropIndicator:t.payload}
1777case"DRAG_END":case"DRAG_CANCEL":return cr
1778case"SET_VALIDATION_ERROR":return{...e,validationError:t.payload}
1779default:return e}}function dr({id:e,data:t,onDataChange:n,validate:a,isReadOnly:i=!1,allowNesting:s=!0,sfLocationPath:l,expandedPages:c,togglePageExpansion:u,openCreateSubpageModal:d,settingsLabelForType:p,handleDeletePage:h,onOpenDuplicateModal:g,onOpenEditModal:f,sensors:m,t:v}){const[b,y]=(0,o.useReducer)(ur,cr),{activeId:x,dropIndicator:C,validationError:D}=b,w=(0,o.useRef)(null),A=(0,o.useRef)(null),E=(0,S.WD)("interface","components.bottomBar.footerSettings.sections.popovers.pageSelection"),j=(0,o.useCallback)(((e,t)=>{let n=0
1780return function e(a,i){return a.reduce(((a,r)=>
1780{const o=t(r,n++,i),s=r.get("children"),l=c.has(r.get("id"))
1781let u=a.push(o)
1782if(s&&s.size>0&&l){const t=e(s,i+1)
1783u=u.concat(t)}return u}),r().List())}(e,1)}),[c])(t,((e,t,n)=>e.set("__level",n))),B=(0,o.useMemo)((()=>j.filter((e=>r().Map.isMap(e)))),[j]),k=(0,o.useMemo)((()=>{const e=new Map
1784return B.forEach((t=>{e.set(t.get("id"),t.get("title")??"")})),e}),[B]),N=(0,lr.Ww)(E,(e=>k.get(e)??"")),F=(0,o.useMemo)((()=>{if(!x)return null
1785const e=B.find((e=>e.get("id")===x)),t=e?.get("__level")??0,n=t>0?12*(t-1):0
1786return{title:e?.get("title")??"",indentWidth:n}}),[x,B])
1787return(0,O.jsxs)(Ja.Mp,{sensors:m,collisionDetection:Ja.Qo,onDragStart:({active:e})=>{y({type:"DRAG_START",payload:{activeId:e.id}})},onDragMove:({active:e,over:t})=>{if(!t||e.id===t.id)return void y({type:"DRAG_MOVE",payload:null})
1788const n=B.find((t=>t.get("id")===e.id)),a=B.find((e=>e.get("id")===t.id)),r=t.rect,i=e.rect.current.initial,o=e.rect.current.translated?{x:e.rect.current.translated.left-(i?.left||0),y:e.rect.current.translated.top-(i?.top||0)}:{x:0,y:0},l=i?{left:i.left+o.x,top:i.top+o.y,right:i.left+i.width+o.x,bottom:i.top+i.height+o.y,width:i.width,height:i.height}:null
1789let c=!1,u=!0
1790if(r&&l){const e=Math.max(l.left,r.left),t=Math.min(l.right,r.left+r.width),n=Math.max(l.top,r.top),a=Math.min(l.bottom,r.top+r.height)
1791if(e<t&&n<a){c=(t-e)*(a-n)/(l.width*l.height)*100>60
1792u=l.top+l.height/2<r.top+r.height/2}}const d=a?.get("type"),p=n?.get("type"),h="/"===a?.get("href")
1793let g=null
1794g=s&&"blank"===d&&"blank"===p&&!h&&c?"inside":u?"before":"after",w.current&&(clearTimeout(w.current),w.current=null),"inside"===g?w.current=setTimeout((()=>{y({type:"DRAG_MOVE",payload:{pageId:t.id,position:"inside"}}),w.current=null}),200):y(g?{type:"DRAG_MOVE",payload:{pageId:t.id,position:g}}:{type:"DRAG_MOVE",payload:null})},onDragEnd:({active:e,over:r})=>{if(w.current&&(clearTimeout(w.current),w.current=null),!r||e.id===r.id||!C)return void y({type:"DRAG_END"})
1795const i=B.find((t=>t.get("id")===e.id)),o=B.find((e=>e.get("id")===r.id))
1796if(!i||!o)return void y({type:"DRAG_END"})
1797const s=ar(t,e.id)
1798if(!s.removed)return void y({type:"DRAG_END"})
1799const l=s.removed
1800if(!l)return
1801let d
1802if("inside"===C.position?(d=rr(s.tree,r.id,l),d.added&&!c.has(r.id)&&u(r.id)):d="after"===C.position?ir(s.tree,r.id,l,!0):ir(s.tree,r.id,l,!1),!d.added)return
1803const p=d.tree
1804if(a){const e=a(p,t)
1805if(!0!==e)return y({type:"DRAG_END"}),y({type:"SET_VALIDATION_ERROR",payload:{pageId:r.id,message:"string"==typeof e?e:"Invalid operation"}}),A.current&&clearTimeout(A.current),void(A.current=setTimeout((()=>{y({type:"SET_VALIDATION_ERROR",payload:null}),A.current=null}),3e3))}y({type:"DRAG_END"}),n(p)},onDragCancel:()=>{w.current&&(clearTimeout(w.current),w.current=null),A.current&&(clearTimeout(A.current),A.current=null),y({type:"DRAG_CANCEL"})},accessibility:N,children:[(0,O.jsx)(Xa.gB,{items:B.map((e=>e.get("id"))).toArray(),strategy:Xa._G,children:(0,O.jsx)("ol",{className:`ep-simple-list ep-page-manager-list ep-page-manager-list-${e}`,children:B.map((e=>(0,O.jsx)(er,{page:e,sfLocationPath:l,expandedPages:c,maxNestedPageLevel:4,isReadOnly:i,allowNesting:s,onToggleExpansion:u,onOpenCreateSubpageModal:d,onOpenDuplicateModal:g,onOpenEditModal:f,onDeletePage:h,settingsLabelForType:p,t:v,isDragging:x===e.get("id"),dropIndicator:C&&C.pageId===e.get("id")?C.position:null,validationError:D&&D.pageId===e.get("id")?D.message:null},e.get("id")))).toArray()})}),(0,O.jsx)(Ja.Hd,{dropAnimation:null,children:F&&(0,O.jsxs)("div",{className:"ep-page-manager-list-drag-overlay",style:{marginLeft:`${F.indentWidth}px`},children:[sr||(sr=(0,O.jsx)("span",{className:"ep-page-manager-list-drag-overlay-handle icon-drag-handle"})),(0,O.jsx)("span",{className:"ep-page-manager-list-drag-overlay-title",children:F.title})]})})]})}var pr=n(89369)
1806const hr=(0,l.Ng)((e=>({isBeyondShop:Boolean(e.getIn(["shop","beyond"])),isTutorialVideoAvailable:["de"].includes(e.getIn(["view","interfaceLanguage"])),mboBaseUrl:e.getIn(["shop","mboBaseUrl"])})),(e=>({updateNavigation:t=>e((0,p.e96)(t)),updateFooterNavigation:t=>e((0,p.bR2)(t)),updateLegalNavigation:t=>e((0,p.V7p)(t))})))((function(e){var t
1807const{isBeyondShop:n,isTutorialVideoAvailable:a,mboBaseUrl:i,navigation:s,legalPages:l,footerPages:c=r
1807().List(),location:u,updateNavigation:d,updateFooterNavigation:p,updateLegalNavigation:h,disabled:g,expandedPages:f,onTogglePageExpansion:m,onExpandPages:v,...b}=e,y=(0,S.WD)("interface","components.editorSidebarComponent.pageManagerSection"),x=(0,o.useContext)(pr.h),[C,D]=(0,o.useState)((()=>new Set)),w=f??C,A=(0,o.useCallback)((e=>{D((t=>{const n=new Set(t)
1808return n.has(e)?n.delete(e):n.add(e),n}))}),[]),E=(0,o.useCallback)((e=>{D((t=>{const n=new Set(t)
1809return e.forEach((e=>n.add(e))),n}))}),[]),j=m??A,B=v??E,k=(0,o.useMemo)((()=>{const e=s.takeWhile((e=>"category"===e.get("type"))).first()
1810if(!e)return i
1811const t=e.get("adminUrl")
1812return t?`${i}?${t.split("?")[1]}&ViewAction=UnityMBO-ViewChildObjects`:i}),[s,i]),[N,F]=(0,o.useState)({type:"none"}),M=(0,lr.W3)(),P=(0,o.useMemo)((()=>x?.shopI18n?(0,S.Nx)(x.shopI18n,!0):()=>""),[x?.shopI18n]),T=(0,o.useMemo)((()=>u.pathname.replace(/^\/editor(\/\w{2})?/,"")||"/"),[u.pathname]),R=(0,o.useMemo)((()=>c.map(((e,t)=>{const a=n?P(e.get("title")):e.get("title"),i=e.get("id")??e.get("slug")??`footer-${t}`
1813return e.set("children",r().List()).set("title",a).set("id",i)}))),[c,n,P]),L=(0,o.useMemo)((()=>l?.map(((e,t)=>{const a=n?P(e.get("title")):e.get("title"),i=e.get("id")??e.get("slug")??`legal-${t}`
1814return e.set("children",r().List()).set("title",a).set("id",i)}))??r().List()),[l,n,P]);(0,o.useEffect)((()=>{"#addContentPage"===window.location.hash&&F({type:"create"})}),[]),(0,o.useEffect)((()=>{if(!s?.size||"/"===T)return
1815const e=(0,Xn.wd)(s,(e=>e.get("href")===T))
1816if(!e)return
1817const t=e.get("id")
1818if(!t)return
1819const n=Zn(s,t)
1820n.length>0&&B(n)}),[T,s,B])
1821const _=(0,o.useCallback)(((e,t)=>{if(e===t)return!0
1822if(n){const t=e.get(0)
1823if("home"!==t.get("slug"))return y("homepageFirstErrorMessage")
1824if(t.get("children").count()>0)return y("homepageChildrenErrorMessage")}return!(tr(e,0,!0)>3)||y("maxNestingErrorMessage",{maxLevels:4})}),[n,y]),$=(0,o.useCallback)((e=>{d(Ua(e))}),[d]),z=(0,o.useCallback)((e=>{const t=(0,Xn.wd)(s,(t=>t.get("slug")===e))
1825t&&!w.has(t.get("id"))&&B([t.get("id")]),F({type:"create",createSubpageParentSlug:e})}),[s,w,B]),W=(0,o.useCallback)((e=>y(`${{category:"categories",blank:"contentPages",legal:"legalPages"}[e]}Section.pageSettingsButton.label`)),[y]),U=(0,o.useCallback)((e=>{const t=or(e)
1826F({type:"delete",page:nr(e),subpageCount:t})}),[]),V=(0,o.useCallback)((e=>{F({type:"duplicate",page:nr(e)})}),[]),H=(0,o.useCallback)((e=>{F({type:"edit",page:nr(e)})}),[])
1827return(0,O.jsxs)("div",{...b,children:[(0,O.jsxs)("div",{className:"ep-scrollable",children:[!n&&!g&&(0,O.jsxs)("div",{className:"ep-page-manager-section",children:[(0,O.jsxs)("div",{className:"ep-page-manager-section-header",children:[(0,O.jsx)("h4",{className:"ep-page-manager-list-heading",children:y("categoriesSection.title")}),(0,O.jsx)("a",{href:k,target:"_parent",className:"ep-page-manager-manage-button",children:y("categoriesSection.manageButton.label")})]}),function(){const e=s.takeWhile((e=>"category"===e.get("type")))
1828return(0,O.jsx)(dr,{id:"categories",data:e,onDataChange:Z.A,isReadOnly:!0,sfLocationPath:T,expandedPages:w,togglePageExpansion:j,openCreateSubpageModal:z,settingsLabelForType:W,handleDeletePage:U,onOpenDuplicateModal:V,onOpenEditModal:H,sensors:M,t:y})}()]}),!g&&(0,O.jsxs)("div",{className:"ep-page-manager-section",children:[(0,O.jsxs)("div",{className:"ep-page-manager-section-header",children:[(0,O.jsx)("h4",{className:"ep-page-manager-list-heading",children:y("mainMenuPagesSection.title")}),s.skipWhile((e=>"category"===e.get("type"))).size>0&&(0,O.jsx)(I.A,{variant:"link",icon:"add",onClick:()=>F({type:"create",navigation:"main"}),className:"ep-page-manager-add-page-button-icon",title:y("mainMenuPagesSection.addPageButton.label")})]}),function(){const e=s.skipWhile((e=>"category"===e.get("type"))),t=s.takeWhile((e=>"category"===e.get("type")))
1829return(0,O.jsx)(dr,{id:"editorial",data:e,onDataChange:e=>$(t.concat(e)),validate:(e,n)=>{const a=t.concat(e),r=t.concat(n)
1830return _(a,r)},isReadOnly:!1,sfLocationPath:T,expandedPages:w,togglePageExpansion:j,openCreateSubpageModal:z,settingsLabelForType:W,handleDeletePage:U,onOpenDuplicateModal:V,onOpenEditModal:H,sensors:M,t:y})}(),(0,O.jsx)(I.A,{variant:"link",icon:"add",onClick:()=>F({type:"create",navigation:"main"}),className:"ep-page-manager-add-page-button-full",children:y("mainMenuPagesSection.addPageButton.label")})]}),!g&&(0,O.jsxs)("div",{className:"ep-page-manager-section",children:[(0,O.jsxs)("div",{className:"ep-page-manager-section-header",children:[(0,O.jsx)("h4",{className:"ep-page-manager-list-heading",children:y("footerPagesSection.title")}),R.size>0&&(0,O.jsx)(I.A,{variant:"link",icon:"add",onClick:()=>F({type:"create",navigation:"footer"}),className:"ep-page-manager-add-page-button-icon",title:y("footerPagesSection.addPageButton.label")})]}),(0,O.jsx)(dr,{id:"footer",data:R,onDataChange:e=>{p(Ua(e))},validate:(e,t)=>
1830!e.some((e=>e.get("children")&&e.get("children").size>0))||y("contentPagesSection.createPageModal.pageNameInputField.validationMessages.cannotMakeFooterPageWithChildren"),isReadOnly:!1,allowNesting:!1,sfLocationPath:T,expandedPages:w,togglePageExpansion:j,openCreateSubpageModal:z,settingsLabelForType:W,handleDeletePage:U,onOpenDuplicateModal:V,onOpenEditModal:H,sensors:M,t:y}),(0,O.jsx)(I.A,{variant:"link",icon:"add",onClick:()=>F({type:"create",navigation:"footer"}),className:"ep-page-manager-add-page-button-full",children:y("footerPagesSection.addPageButton.label")})]}),!g&&(0,O.jsxs)("div",{className:"ep-page-manager-section",children:[(0,O.jsx)("div",{className:"ep-page-manager-section-header",children:(0,O.jsxs)("h4",{className:"ep-page-manager-list-heading",children:[y("legalPagesSection.title"),!n&&a&&(0,O.jsx)("span",{className:"ep-legalpages-video-tutorial",children:(0,O.jsx)(we,{tutorial:"legalpages",children:(0,O.jsx)("span",{className:"sr-only",children:y("legalPagesSection.videoTutorial.videoTutorialButton.label")})})})]})}),t||(t=(0,O.jsx)(dr,{id:"legal",data:L,onDataChange:h,isReadOnly:!1,sfLocationPath:T,expandedPages:w,togglePageExpansion:j,openCreateSubpageModal:z,settingsLabelForType:W,handleDeletePage:U,onOpenDuplicateModal:V,onOpenEditModal:H,sensors:M,t:y}))]})]}),"edit"===N.type&&N.page&&(0,O.jsx)(Ha,{mode:"edit",page:N.page,isActivePage:T===N.page.get("href"),mainNavigation:s,footerPages:c,onRequestClose:()=>F({type:"none"})}),"delete"===N.type&&N.page&&(0,O.jsx)(Ha,{mode:"edit",page:N.page,isActivePage:T===N.page.get("href"),mainNavigation:s,footerPages:c,onRequestClose:()=>F({type:"none"}),initialDeleteRequested:!0,subpageCount:N.subpageCount}),"duplicate"===N.type&&N.page&&(0,O.jsx)(Ma,{mode:"duplicate",page:N.page,mainNavigation:s,footerPages:c,onRequestClose:()=>F({type:"none"})}),"create"===N.type&&(0,O.jsx)(ja,{mode:"create",page:r().fromJS({type:"blank",title:"",isVisible:!0,navigation:N.navigation??"main",selectedCollectionInfo:{isActive:!1,collectionId:""},pageParentSlug:N.createSubpageParentSlug??""}),mainNavigation:s,footerPages:c,onRequestClose:()=>F({type:"none"}),expandPages:B})]})}))
1831var gr
1832const fr="ep-editor-save-feedback-indicator"
1833function mr(){const e=(0,l.d4)((e=>e.getIn(["view","saveStatus"]))),t=(0,S.WD)("interface")
1834if(!e)return null
1835const n="saving"===e,a=(0,c.A)([fr,{"is-saving":n,"is-saved":!n}])
1836return(0,O.jsxs)("div",{className:a,children:[gr||(gr=(0,O.jsx)("i",{className:`${fr}-icon`})),(0,O.jsx)("span",{className:`${fr}-text`,children:t("components.editorSidebarComponent.saveStatusSection."+(n?"changesSaving":"changesSaved"))})]})}var vr
1837function br({t:e}){const t=(0,l.d4)((e=>e.get("themes")?.toJS())),n=(0,l.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),a=(0,l.d4)((e=>e.getIn(["shop","theme"]).toJS())),r=(0,l.d4)((e=>e.getIn(["view","hashedThemeAssets"]))),s=(0,l.d4)((e=>["de"].includes(e.getIn(["view","interfaceLanguage"])))),c=(0,i.zy)(),u=(0,i.cq)(),[d,p]=(0,o.useState)(a);(0,o.useEffect)((()=>{"idle"===u.state&&a.id!==d.id&&p(a)}),[u.state,a,d])
1838const h="/editor/themes",f=c.pathname===h
1839if(!t)return null
1840const m=t.find((e=>e.id===d.id)),v=(m?.demoUrls??{})[n?"beyond":"now"]
1841return(0,O.jsx)("div",{className:"ep-sidebar-module-content",children:(0,O.jsxs)("div",{className:"ep-scrollable",children:[(0,O.jsx)("h4",{className:"ep-theme-manager-heading",children:e("currentThemeLabel")}),(0,O.jsx)("div",{className:"ep-theme-manager-preview-image",children:(0,O.jsx)("img",{alt:m.displayName,src:(0,g.Y2)(m.name,r)})}),(0,O.jsx)("div",{className:"ep-theme-manager-change-theme-button-wrapper",children:(0,O.jsx)(i.N_,{to:f?"/editor":h,className:"ep-theme-manager-change-theme-button",children:e((f?"backToEditorButton":"changeThemeButton")+".label")})}),v&&(0,O.jsx)("div",{className:"ep-theme-manager-demo-shop-link-wrapper",children:(0,O.jsx)("a",{href:v,className:"ep-theme-manager-demo-shop-link",target:"_blank",rel:"noopener noreferrer",children:e("demoShopLink")})}),!n&&s&&(0,O.jsxs)("div",{className:"ep-theme-manager-video-tutorial-wrapper",children:[vr||(vr=(0,O.jsx)("hr",{className:"ep-theme-manager-video-tutorial-divider"})),(0,O.jsx)(we,{tutorial:"themes",children:e("videoTutorial.videoTutorialButton.label")})]})]})})}var yr=n(32659),xr=n(87495),Cr=n.n(xr)
1842const Dr={overlay:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:1,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},content:{position:void 0,top:void 0,left:void 0,right:void 0,bottom:void 0,border:void 0,background:void 0,overflow:void 0,WebkitOverflowScrolling:void 0,borderRadius:void 0,outline:void 0,padding:void 0}},wr=(0,o.createContext)({onRequestClose:Z.A})
1843function Ar({children:e,className:t,contentLabel:n,isOpen:a,onRequestClose:r=Z.A}){const i=document.querySelector("div.ep-is-editor-mode")
1844return(0,O.jsx)(wr.Provider,{value:{onRequestClose:r}
1844,children:(0,O.jsx)(Cr(),{isOpen:a,appElement:i,contentLabel:n,onRequestClose:r,style:Dr,className:(0,c.A)(["ep-ui ep-modal-dialog",t]),children:(0,O.jsx)("div",{className:"ep-modal-content",children:e})})})}Ar.Header=function({title:e}){const{onRequestClose:t}=(0,o.useContext)(wr)
1845return(0,O.jsxs)("div",{className:"ep-modal-header",children:[(0,O.jsx)("span",{className:"ep-modal-close",onClick:t}),(0,O.jsx)("div",{className:"ep-modal-title",children:e})]})},Ar.Body=function({children:e}){return(0,O.jsx)("div",{className:"ep-modal-body",children:e})},Ar.Footer=function({children:e}){return(0,O.jsx)("div",{className:"ep-modal-footer",children:e})}
1846const Er={de:{themes:"sv-epnow-design-vorlage-de",pages:"sv-epnow-seiten-de",content:"sv-epnow-inhaltselemente-de",legalpages:"sv-epnow-rechtliche-seiten-de"},en:{}}
1847function jr({t:e}){const t=(0,o.useContext)(ye),n=De(),a=()=>{n(void 0)}
1848return t?(0,O.jsxs)(Ar,{isOpen:!0,onRequestClose:a,className:"video-tutorial-modal",children:[(0,O.jsx)("div",{className:"ep-modal-header",children:(0,O.jsx)("span",{className:"ep-modal-close",onClick:a})}),(0,O.jsx)(Ar.Body,{children:(0,O.jsx)(Br,{tutorial:t,t:e})})]}):null}function Br({tutorial:e,t}){const[n,a]=(0,o.useState)(null),r=(0,yr.gf)()
1849return(0,o.useEffect)((()=>{!async function(){try{const{data:t}=await r.get("/api/v2/resolve-epages-short-url",{params:{id:Er.de[e]}})
1850a(t.resolvedUrl)}catch{}}()}),[e,r]),n?(0,O.jsx)("iframe",{src:n,width:"640",height:"360",title:t("themeManagerSection.videoTutorial.videoTutorialModal.accessibilityLabel"),style:{border:"none"},allow:"autoplay; fullscreen; picture-in-picture"}):null}var kr,Sr,Nr
1851function Fr({icon:e,isDragActive:t,tReady:n,...a}){return(0,O.jsx)("div",{...a,dangerouslySetInnerHTML:{__html:e}})}function Or({location:e,navigation:t,legalPages:n,footerPages:a,activeModule:r,contentCreationDisabled:i,editorDisabled:s,mboMenuMode:u}){const d=(0,l.wA)(),h=(0,l.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),[g,f]=(0,o.useState)((()=>new Set)),m=(0,l.d4)((e=>e.getIn(["pages",e.getIn(["view","activePageSlug"]),"content","blocks"]))),v=(0,S.WD)("interface","components.editorSidebarComponent")
1852function b(){switch(window.location.hash){case"#imageContentElements":case"#textContentElements":"content-creation"!==r&&y("content-creation")}}function y(e){e!==r&&d((0,p.zM8)(e))}(0,o.useEffect)(b,[]),(0,Ee.A)("hashchange",b)
1853const x=e=>{let t=0,n=0
1854const a=(e,r=!0)=>{e.forEach((e=>{const i=e.get("children")
1855if(i&&i.size>0){r&&(n++,g.has(e.get("id"))&&t++)
1856const o=r&&g.has(e.get("id"))
1857a(i,o)}}))}
1858return a(e),{expanded:t,total:n}},C=(0,o.useCallback)((e=>{f((t=>{const n=new Set(t)
1859return e.forEach((e=>n.add(e))),n}))}),[]),D=t.takeWhile((e=>"category"===e.get("type"))),w=t.skipWhile((e=>"category"===e.get("type"))),A=x(D),E=x(w),j=A.expanded+E.expanded,B=A.total+E.total,N=0===j,F=[{key:"theme-manager",label:v("themeManagerSection.title"),icon:"design"},{key:"page-manager",label:v("pageManagerSection.title"),icon:"pages"},{key:"content-creation",label:v("contentElementsSection.title"),icon:"elements"}],M={"theme-manager":v("sectionTitles.design"),"page-manager":v("sectionTitles.pages"),none:v("sectionTitles.pages"),"content-creation":v("sectionTitles.contentElements")}[r]
1860return(0,O.jsxs)(Ce,{children:[(0,O.jsx)("aside",{className:"ep-sidebar",children:(0,O.jsxs)("div",{className:(0,c.A)(["ep-sidebar-container",{"mbo-active":u}]),children:[kr||(kr=(0,O.jsx)("div",{className:"ep-mbo-content",children:(0,O.jsx)(Fe,{})})),(0,O.jsxs)("div",{className:"ep-sidebar-main",children:[!h&&(0,O.jsx)("div",{className:"ep-editor-sidebar-back",children:(0,O.jsxs)("button",{className:"ep-editor-sidebar-back-button",onClick:()=>d((0,p.dOk)(!0)),children:[Sr||(Sr=(0,O.jsx)("span",{className:"ep-editor-sidebar-back-button-arrow"})),v("mainMenuLink")]})}),(0,O.jsxs)("div",{className:"ep-sidebar-layout",children:[(0,O.jsx)("nav",{className:"ep-sidebar-nav",children:F.map((e=>{const t="content-creation"===e.key&&i,n=(0,O.jsxs)("button",{onClick:()=>{s||t||y(e.key)},className:(0,c.A)(["ep-sidebar-nav-button",{active:r===e.key||"page-manager"===e.key&&"none"===r,disabled:t}]),disabled:s||t,children:[(0,O.jsx)("span",{className:`ep-sidebar-nav-${e.icon}-icon`}),(0,O.jsx)("span",{className:"ep-sidebar-nav-label",children:e.label})]},e.key)
1861return t?(0,O.jsx)(k.m,{trigger:n,content:v("contentElementsSection.disabledState.explanation"),side:"right",variant:"light",usePortal:!0,hideIcon:!0},e.key):n}))}),(0,O.jsxs)("div",{className:"ep-sidebar-content-wrapper",children:[(0,O.jsx)("div",{className:(0,
1861c.A)(["ep-sidebar-header",{"ep-sidebar-header-with-action":"page-manager"===r||"none"===r}]),children:"page-manager"===r||"none"===r?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{children:M}),B>0&&(0,O.jsx)("button",{className:"ep-expand-collapse-toggle",onClick:()=>{const e=t.takeWhile((e=>"category"===e.get("type"))),n=t.skipWhile((e=>"category"===e.get("type"))),a=x(e),r=x(n)
1862if(a.expanded+r.expanded>0)f(new Set)
1863else{const t=new Set,a=e=>{e.forEach((e=>{const n=e.get("children")
1864n&&n.size>0&&(t.add(e.get("id")),a(n))}))}
1865a(e),a(n),f(t)}},children:v(N?"pageManagerSection.expandAll.label":"pageManagerSection.collapseAll.label")})]}):M}),(0,O.jsxs)("div",{className:"ep-sidebar-content",children:["theme-manager"===r&&(0,O.jsx)("div",{className:"ep-sidebar-content-module",children:(0,O.jsx)(br,{t:e=>v(`themeManagerSection.${e}`)})}),("page-manager"===r||"none"===r)&&(0,O.jsx)("div",{className:"ep-sidebar-content-module",children:(0,O.jsx)(hr,{location:e,navigation:t,disabled:s,legalPages:n,footerPages:a,className:"ep-sidebar-module-page-manager",expandedPages:g,onTogglePageExpansion:e=>{f((t=>{const n=new Set(t)
1866return n.has(e)?n.delete(e):n.add(e),n}))},onExpandPages:C})}),"content-creation"===r&&!i&&(0,O.jsx)("div",{className:"ep-sidebar-content-module",children:(0,O.jsx)(Se,{isBeyond:h,resetCategory:"content-creation"!==r,t:v,activePageBlocks:m})})]}),Nr||(Nr=(0,O.jsx)(mr,{}))]})]})]})]})}),(0,O.jsx)(jr,{t:v})]})}var Mr,Pr,Tr,Ir=n(76459),Rr=n(12871),Lr=n(61678)
1867function _r(){const e=(0,l.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),t=(0,l.d4)((e=>e.getIn(["view","hasThemeLoaded"],!1))),n=(0,l.d4)((e=>e.getIn(["view","mboMenuMode"]))),r=(0,l.d4)((e=>e.getIn(["shop","locales"]))),s=(0,l.d4)((e=>e.getIn(["view","editorSidebar","activeModule"]))),u=(0,l.d4)((e=>e.get("navigation"))),p=(0,l.d4)((e=>e.get("legalPages",(0,a.List)()))),g=(0,l.d4)((e=>e.get("footerPages"))),f=(0,i.zy)();(0,o.useEffect)((()=>{document.body.classList.add("ep-is-editor-mode")
1868const e=document.querySelector(".editor-body-wrapper")
1869e&&d()({node:e,namespace:"-workspace"})
1870const t=document.querySelector(".ep-sidebar-module-page-manager .ep-scrollable")
1871t&&d()({node:t,namespace:"-page-manager",listenGlobally:!1})}),[])
1872let m=(0,l.d4)((e=>(0,h.r)(e.getIn(["view","error"]))))
1873m=(0,h.r)(m)
1874const v=(0,i.r5)();(0,i.pX)(v)&&(m={...v,message:v.data?.message??""})
1875const b=(0,i.FE)(),y=b?.at(-1)?.handle?.Component,x=Boolean(m)||Boolean(y&&y.contentCreationDisabled&&y.contentCreationDisabled()),C=Boolean(429===m?.statusCode),D=C?(0,O.jsx)(Ir.A,{statusCode:m.get("statusCode"),requestId:m.get("requestId")}):(0,O.jsxs)(O.Fragment,{children:[t&&(0,O.jsx)(me,{showLanguages:!e&&r.count()>1}),Mr||(Mr=(0,O.jsx)("div",{className:"editor-body-wrapper",id:"body-wrapper",children:(0,O.jsx)(i.sv,{})}))]})
1876return(0,O.jsxs)("div",{className:"ep-is-editor-mode",onDragOverCapture:Lr.A,children:[Pr||(Pr=(0,O.jsx)("meta",{name:"robots",content:"noindex"})),(0,O.jsxs)("div",{className:(0,c.A)(["ep-editor-layout",{"mbo-mode":n}]),children:[(0,O.jsx)(Or,{location:f,legalPages:p,footerPages:g,navigation:u?u.get("editor"):(0,a.List)(),mboMenuMode:n,activeModule:s,contentCreationDisabled:x,editorDisabled:C}),(0,O.jsx)("main",{className:(0,c.A)(["ep-editor-main",t&&"ep-theme-dom"]),children:D})]}),!C&&(Tr||(Tr=(0,O.jsx)(Rr.A,{})))]})}_r.storeUpdate=({location:{pathname:e}},t)=>[t.get("themeSettingsSchema")?null:(0,p.Yq)(t.getIn(["shop","themeId"])),t.get("defaultThemeSettings")?null:(0,p.gJA)(t.getIn(["shop","themeId"])),t.get("themeMeta")?null:(0,p.PTH)(t.getIn(["shop","themeId"])),t.getIn(["shop","beyond"])&&!t.get("resellerName")?(0,p.M0W)():null,t.getIn(["shop","beyond"])&&!t.get("tax")?(0,p.g3$)():null,t.getIn(["shop","email"])?null:(0,p.JZZ)(),t.get("themes")?null:(0,p.$Dn)(),e?.endsWith("/themes")&&"theme-manager"!==t.getIn(["view","editorSidebar","activeModule"])?(0,p.zM8)("theme-manager"):null],_r.loadableSsrChunks=(e,t)=>{const n=["editor"]
1877return t.getIn(["shop","beyond"])&&n.push("account"),n}},52519:(e,t,n)=>{"use strict"
1878n.r(t),n.d(t,{default:()=>P})
1879n(55959),n(49905),n(20476),n(47537),n(6010),n(64657),n(67437),n(39155),n(98357),n(98456),n(76881),n(28383)
1880var a=n(61720),r=n(84507),i=n(95110),o=n(91121),s=n(557),l=n(42295)
1881function c(){const[,{value:e},{setValue:t}]=(0,a.Mt)("selectedTags"),n=(0,s.WD)("interface","views.editorThemesView")
1882return e.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"ep-theme-manager-filter-tags-clear",onClick:()=>t([]),children:n("filtersTagList.clearAllButton.label")}),(0,l.jsx)("ul",{className:"ep-theme-manager-filter-tags-list",children:e.map((a=>(0,l.jsxs)("li",{children:[(0,l.jsx)("span",{children:n(`filters.attributes.${a.split(":")[1]}`)},a),(0,l.jsx)("button",{type:"button",onClick:()=>{t(e.filter((e=>e!==a)))},children:(0,l.jsx)("span",{children:n("filtersTagList.removeButton.accessibilityLabel")})})]},a)))})]}):null}n(7121),n(16120),n(76672),n(61529),n(43303)
1883var u=n(28348)
1884function d(e,t){if(0===t.length)return e
1885const n=t.reduce(((e,t)=>{const[n,a]=t.split(":")
1886return e[n]?e[n].push(a):e[n]=[a],e}),{}),a=Object.entries(n).map((([t,n])=>n.flatMap((n=>e.filter((e=>[e.attributes?.[t]].flat().includes(n)))))))
1887return(0,u.A)(...a)}var p=n(90700)
1888function h(){const{values:e}=(0,a.j7)(),t=function(e){const t=(0,r.d4)((e=>e.get("themes").toJS())),n=(0,p.A)(e),a=t.reduce(((e,t)=>
1888(Object.entries(t.attributes||[]).forEach((([t,n])=>{const a="string"!=typeof n;(a?n:[n]).forEach((n=>{const r={id:`${t}:${n}`,attribute:n,isDisabled:!1},i=e.find((e=>e.groupName===t))
1889i?i.filters.some((e=>e.attribute===n))||i.filters.push(r):e.push({groupName:t,multi:a,filters:[r]})}))})),e)),[])
1890if(a.forEach((e=>{e.filters.sort(((e,t)=>e.attribute.localeCompare(t.attribute)))})),e.length){const n=e.filter((e=>a.some((t=>t.multi&&t.groupName===e.split(":")[0]))))
1891a.forEach((a=>{a.filters.forEach((r=>{const i=`${a.groupName}:${r.attribute}`,o=[...e,i],s=o.filter((e=>!n.includes(e)))
1892r.isDisabled=!e.some((e=>e===i))&&d(t,o).every((e=>!s.every((t=>{const[n,a]=t.split(":")
1893return[e.attributes?.[n]].flat().includes(a)}))))}))}))}else n?.length&&a.forEach((e=>{e.filters.forEach((e=>{e.isDisabled=!1}))}))
1894return a}(e.selectedTags),n=(0,s.WD)("interface","views.editorThemesView.filters")
1895return(0,l.jsx)("div",{className:"ep-theme-manager-theme-filters",children:t.map((e=>(0,l.jsxs)("fieldset",{className:"ep-theme-manager-theme-filters-category",children:[(0,l.jsx)("legend",{className:"ep-theme-manager-theme-filters-category-name",children:n(`categories.${e.groupName}`)}),e.filters.map((e=>(0,l.jsxs)("label",{className:(0,o.A)(["ep-theme-manager-theme-filters-attribute",{disabled:e.isDisabled}]),children:[(0,l.jsx)(a.D0,{type:"checkbox",name:"selectedTags",value:e.id,disabled:e.isDisabled}),(0,l.jsx)("span",{children:n(`attributes.${e.attribute}`)})]},e.id)))]},e.groupName)))})}var g=n(44420)
1896function f({theme:e}){const t=(0,r.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),n=(0,r.d4)((e=>e.getIn(["view","hashedThemeAssets"]))),{initialValues:i,values:c,setFieldValue:u}=(0,a.j7)(),d=(0,s.WD)("interface","views.editorThemesView.themesList.themeEntry"),p=function(e,t){const n=(0,r.d4)((e=>e.getIn(["shop","mboBaseUrl"],""))),a=t?`${n}/storefront?previewTheme=${e.name}`:`${n}?ViewAction=UnityMBO-ViewSFThemePreview&previewTheme=${e.name}`
1897return`${a}&themeTitle=${encodeURIComponent(e.displayName)}`}(e,t),h=(e.demoUrls||{})[t?"beyond":"now"],f=e.id===c.selectedThemeId,m=e.id===i.selectedThemeId
1898return(0,l.jsxs)("div",{role:"listitem",className:(0,o.A)(["ep-theme-manager-card",{selected:f,active:m}]),children:[(0,l.jsx)("div",{className:"ep-theme-manager-card-name",children:e.displayName}),(0,l.jsxs)("label",{className:"ep-theme-manager-card-image","data-select-hint-text":d("selectHintLabel"),onClick:e=>{f&&(e.preventDefault(),u("selectedThemeId",i.selectedThemeId))},children:[(0,l.jsx)(a.D0,{type:"radio",disabled:m||f,name:"selectedThemeId",value:e.id,className:"visually-hidden"}),m&&(0,l.jsx)("span",{className:"ep-theme-manager-card-badge","aria-hidden":"true",children:d("activeLabel")}),!m&&f&&(0,l.jsx)("span",{className:"ep-theme-manager-card-badge","aria-hidden":"true",children:d("selectedLabel")}),(0,l.jsx)("img",{alt:e.displayName,src:(0,g.Y2)(e.name,n)})]}),(0,l.jsxs)("div",{className:"ep-theme-manager-card-cta",children:[h&&(0,l.jsx)("a",{tabIndex:f?0:-1,href:h,target:"_blank",rel:"noopener noreferrer",children:d("demoShopLink")}),(0,l.jsx)("a",{tabIndex:f?0:-1,href:p,target:"_blank",rel:"noopener noreferrer",children:d("previewLink")})]})]})}function m({themes:e}){const t=(0,s.WD)("interface","views.editorThemesView.themesList")
1899return(0,l.jsxs)("fieldset",{className:"ep-theme-manager-themes-list-container",children:[(0,l.jsx)("legend",{className:"visually-hidden",children:t("accessibilityTitle")}),(0,l.jsx)("div",{className:"ep-theme-manager-themes-list",role:"list",children:e.map((e=>(0,l.jsx)(f,{theme:e},e.id)))})]})}var v=n(80142),b=n(52277),y=n(63552),x=n(99044),C=n.n(x),D=n(58279),w=n.n(D)
1900const A="SWITCH_THEME",E="SWITCH_THEME_SUCCESS",j="SWITCH_THEME_FAILURE"
1901function B(e){return async function(t,n){try{t({type:A}),t((0,y.pf)(!1)),await t((0,b.Yl)(e.id))
1902const a=n().getIn(["view","hashedThemeAssets"]),r=(0,g.n0)(e.name,a),{data:i}=await v.A.get(`${r}?raw`)
1903t((0,b.kV)(function(e){const t=new Map
1904let n=0
1905const a=C().parse(e)
1906a.walkDecls((e=>{if(!e.value.includes("contrast-color("))return
1907const a=w()(e.value),r=[]
1908a.walk((e=>{if("function"!==e.type||"contrast-color"!==e.value)return
1909const a=`contrast-color(${w().stringify(e.nodes)})`
1910let i=t.get(a)
1911return i||(i="--_cc-"+n++,t.set(a,i)),r.push({start:e.sourceIndex,end:e.sourceEndIndex,key:i}),!1}))
1912for(const{start:t,end:n,key:a}of r.toReversed())e.value=e.value.slice(0,t)+`var(${a})`+e.value.slice(n)}))
1913const r={}
1914for(const[e,n]of t)r[n]=e
1915return{css:a.toResult().css,contrastColorExpressionMap:r}}(i).contrastColorExpressionMap)),await Promise.all([k(r),...[b.gJ,b.RM,b.Yq,b.PT].map((n=>t(n(e.id))))]),t({type:E,themeId:e.id})}catch(e){t({type:j,errorMessage:e.message})}finally{t((0,y.pf)(!0))}}}async function k(e){return new Promise(((t,n)=>{const a=document.getElementById("themeStylesheet"),r=document.createElement("link")
1916a?(r.rel="stylesheet",r.id="themeStylesheet",r.href=e,r.addEventListener("load",(()=>t()),{once:!0}),a.replaceWith(r)):n(new Error('No <link id="themeStylesheet"> element on the page'))}))}var S,N,F=n(57381),O=n(81909),M=n(81715)
1917function P(){const e=(0,r.d4)((e=>e.get("themes").toJS())),t=(0,r.d4)((e=>e.getIn(["shop","theme"]).toJS())),n=(0,r.d4)((e=>Boolean(e.getIn(["shop","beyond"])))),u=(0,r.d4)((e=>e.getIn(["shop","mboBaseUrl"]))),p=(0,s.WD)("interface","views.editorThemesView"),g=(0,r.wA)(),f=(0,i.zy)(),v=(0,i.Zp)(),b=new URLSearchParams(f.search),y=Array.from(new Set(b.getAll("themeFilter").map((e=>e.trim())).filter(Boolean))),x={selectedThemeId:t.id,selectedTags:y}
1918return(0,l.jsx)(a.l1,{initialValues:x,onSubmit:function(n){if(n.selectedThemeId!==t.id){const t=e.find((e=>e.id===n.selectedThemeId))
1919t&&(g(B(t)),v((0,F.GE)("/",f)),window.parent?.postMessage({type:"CHECKLIST",payload:{websiteOnly:"designSettings.themeSelection",regularShop:"designSettings.themeSelection"}},u))}},children:({values:t,setFieldValue:r})=>{const i=d(e,t.selectedTags),s=()=>r("selectedThemeId",x.selectedThemeId)
1920return t.selectedThemeId===x.selectedThemeId||i.some((e=>e.id===t.selectedThemeId))||s(),(0,l.jsxs)(a.lV,{className:(0,o.A)(["ep-theme-manager-container",n&&"ep-theme-manager-intercom-padding"]),children:[(0,l.jsx)("h1",{className:"ep-theme-manager-headline",children:p("title")}),(0,l.jsx)("p",{className:"ep-theme-manager-description",children:p("description",{joinArrays:"\n"})}),(0,l.jsx)("h2",{className:"ep-theme-manager-filters-headline",children:p("filters.title",{activeFiltersCount:t.selectedTags.length})}),S||(S=(0,l.jsx)("div",{className:"ep-theme-manager-filters-tags",children:(0,l.jsx)(c,{})})),N||(N=(0,l.jsx)("div",{className:"ep-theme-manager-sidebar",children:(0,l.jsx)(h,{})})),(0,l.jsxs)("div",{className:"ep-theme-manager-main",children:[(0,l.jsx)("scroll-shadow",{class:"ep-theme-manager-main-content",children:(0,l.jsx)("div",{className:"ep-theme-manager-main-content-root",children:i.length?(0,l.jsx)(m,{themes:i}):(0,l.jsxs)("div",{className:"ep-theme-manager-empty-state",children:[(0,l.jsx)("h3",{children:p("emptyState.headline")}),(0,l.jsx)("p",{children:p("emptyState.infoText")})]})})}),t.selectedThemeId!==x.selectedThemeId&&(0,l.jsxs)(M.A,{children:[(0,l.jsx)(O.A,{type:"button",variant:"outline",onClick:()=>s(),children:p("cancelButton.label")}),(0,l.jsx)(O.A,{type:"submit",children:p("saveButton.label")})]})]})]})}})}P.contentCreationDisabled=()=>!0},13796:(e,t,n)=>{"use strict"
1921function a(e){var t,n,r=""
1922if("string"==typeof e||"number"==typeof e)r+=e
1923else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=a(e[t]))&&(r&&(r+=" "),r+=n)
1924else for(t in e)e[t]&&(r&&(r+=" "),r+=t)
1925return r}function r(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=a(e))&&(r&&(r+=" "),r+=t)
1926return r}n.r(t),n.d(t,{clsx:()=>r,default:()=>i})
1927const i=r},60594:function(e){
1928/*!
1929 * Cropper.js v1.6.2
1930 * https://fengyuanchen.github.io/cropperjs
1931 *
1932 * Copyright 2015-present Chen Fengyuan
1933 * Released under the MIT license
1934 *
1935 * Date: 2024-04-21T07:43:05.335Z
1936 */
1937e.exports=function(){"use strict"
1938function e(e,t){var n=Object.keys(e)
1939if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
1940t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(t){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{}
1941n%2?e(Object(a),!0).forEach((function(e){l(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function n(e,t){if("object"!=typeof e||!e)return e
1942var n=e[Symbol.toPrimitive]
1943if(void 0!==n){var a=n.call(e,t||"default")
1944if("object"!=typeof a)return a
1945throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function a(e){var t=n(e,"string")
1946return"symbol"==typeof t?t:t+""}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n]
1947r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return u(e)||d(e)||p(e)||g()}function u(e){if(Array.isArray(e))return h(e)}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(e,t){if(e){if("string"==typeof e)return h(e,t)
1948var n=Object.prototype.toString.call(e).slice(8,-1)
1949return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length)
1950for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n]
1951return a}function g(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f=void 0!==window.document,m=f?window:{},v=!(!f||!m.document.documentElement)&&"ontouchstart"in m.document.documentElement,b=!!f&&"PointerEvent"in m,y="cropper",x="all",C="crop",D="move",w="zoom",A="e",E="w",j="s",B="n",k="ne",S="nw",N="se",F="sw",O="".concat(y,"-crop"),M="".concat(y,"-disabled"),P="".concat(y,"-hidden"),T="".concat(y,"-hide"),I="".concat(y,"-invisible"),R="".concat(y,"-modal"),L="".concat(y,"-move"),_="".concat(y,"Action"),$="".concat(y,"Preview"),z="crop",W="move",U="none",V="crop",H="cropend",K="cropmove",q="cropstart",G="dblclick",Y=v?"touchstart":"mousedown",J=v?"touchmove":"mousemove",X=v?"touchend touchcancel":"mouseup",Q=b?"pointerdown":Y,Z=b?"pointermove":J,ee=b?"pointerup pointercancel":X,te="ready",ne="resize",ae="wheel",re="zoom",ie="image/jpeg",oe=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,se=/^data:/,le=/^data:image\/jpeg;base64,/,ce=/^img|canvas$/i,ue=200,de=100,pe={viewMode:0,dragMode:z,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:ue,minContainerHeight:de,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},he='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',ge=Number.isNaN||m.isNaN
1952function fe(e){return"number"==typeof e&&!ge(e)}var me=function(e){return e>0&&e<1/0}
1953function ve(e){return void 0===e}function be(e){return"object"===r(e)&&null!==e}var ye=Object.prototype.hasOwnProperty
1954function xe(e){if(!be(e))return!1
1955try{var t=e.constructor,n=t.prototype
1956return t&&n&&ye.call(n,"isPrototypeOf")}catch(e){return!1}}function Ce(e){return"function"==typeof e}var De=Array.prototype.slice
1957function we(e){return Array.from?Array.from(e):De.call(e)}function Ae(e,t){return e&&Ce(t)&&(Array.isArray(e)||fe(e.length)?we(e).forEach((function(n,a){t.call(e,n,a,e)})):be(e)&&Object.keys(e).forEach((function(n){t.call(e,e[n],n,e)}))),e}var Ee=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a]
1958return be(e)&&n.length>
19580&&n.forEach((function(t){be(t)&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e},je=/\.\d*(?:0|9){12}\d*$/
1959function Be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11
1960return je.test(e)?Math.round(e*t)/t:e}var ke=/^width|height|left|top|marginLeft|marginTop$/
1961function Se(e,t){var n=e.style
1962Ae(t,(function(e,t){ke.test(t)&&fe(e)&&(e="".concat(e,"px")),n[t]=e}))}function Ne(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function Fe(e,t){if(t)if(fe(e.length))Ae(e,(function(e){Fe(e,t)}))
1963else if(e.classList)e.classList.add(t)
1964else{var n=e.className.trim()
1965n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t}}function Oe(e,t){t&&(fe(e.length)?Ae(e,(function(e){Oe(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function Me(e,t,n){t&&(fe(e.length)?Ae(e,(function(e){Me(e,t,n)})):n?Fe(e,t):Oe(e,t))}var Pe=/([a-z\d])([A-Z])/g
1966function Te(e){return e.replace(Pe,"$1-$2").toLowerCase()}function Ie(e,t){return be(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Te(t)))}function Re(e,t,n){be(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(Te(t)),n)}function Le(e,t){if(be(e[t]))try{delete e[t]}catch(n){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(n){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Te(t)))}var _e=/\s\s*/,$e=function(){var e=!1
1967if(f){var t=!1,n=function(){},a=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}})
1968m.addEventListener("test",n,a),m.removeEventListener("test",n,a)}return e}()
1969function ze(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n
1970t.trim().split(_e).forEach((function(t){if(!$e){var i=e.listeners
1971i&&i[t]&&i[t][n]&&(r=i[t][n],delete i[t][n],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,r,a)}))}function We(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n
1972t.trim().split(_e).forEach((function(t){if(a.once&&!$e){var i=e.listeners,o=void 0===i?{}:i
1973r=function(){delete o[t][n],e.removeEventListener(t,r,a)
1974for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l]
1975n.apply(e,s)},o[t]||(o[t]={}),o[t][n]&&e.removeEventListener(t,o[t][n],a),o[t][n]=r,e.listeners=o}e.addEventListener(t,r,a)}))}function Ue(e,t,n){var a
1976return Ce(Event)&&Ce(CustomEvent)?a=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(a)}function Ve(e){var t=e.getBoundingClientRect()
1977return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var He=m.location,Ke=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i
1978function qe(e){var t=e.match(Ke)
1979return null!==t&&(t[1]!==He.protocol||t[2]!==He.hostname||t[3]!==He.port)}function Ge(e){var t="timestamp=".concat((new Date).getTime())
1980return e+(-1===e.indexOf("?")?"?":"&")+t}function Ye(e){var t=e.rotate,n=e.scaleX,a=e.scaleY,r=e.translateX,i=e.translateY,o=[]
1981fe(r)&&0!==r&&o.push("translateX(".concat(r,"px)")),fe(i)&&0!==i&&o.push("translateY(".concat(i,"px)")),fe(t)&&0!==t&&o.push("rotate(".concat(t,"deg)")),fe(n)&&1!==n&&o.push("scaleX(".concat(n,")")),fe(a)&&1!==a&&o.push("scaleY(".concat(a,")"))
1982var s=o.length?o.join(" "):"none"
1983return{WebkitTransform:s,msTransform:s,transform:s}}function Je(e){var n=t({},e),a=0
1984return Ae(e,(function(e,t){delete n[t],Ae(n,(function(t){var n=Math.abs(e.startX-t.startX),r=Math.abs(e.startY-t.startY),i=Math.abs(e.endX-t.endX),o=Math.abs(e.endY-t.endY),s=Math.sqrt(n*n+r*r),l=(Math.sqrt(i*i+o*o)-s)/s
1985Math.abs(l)>Math.abs(a)&&(a=l)}))})),a}function Xe(e,n){var a=e.pageX,r=e.pageY,i={endX:a,endY:r}
1986return n?i:t({startX:a,startY:r},i)}function Qe(e){var t=0,n=0,a=0
1987return Ae(e,(function(e){var r=e.startX,i=e.startY
1988t+=r,n+=i,a+=1})),{pageX:t/=a,pageY:n/=a}}function Ze(e){var t=e.aspectRatio,n=e.height,a=e.width,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",i=me(a),o=me(n)
1989if(i&&o){var s=n*t
1990"contain"===r&&s>a||"cover"===r&&s<a?n=a/t:a=n*t}else i?n=a/t:o&&(a=n*t)
1991return{width:a,height:n}}
1991function et(e){var t=e.width,n=e.height,a=e.degree
1992if(90==(a=Math.abs(a)%180))return{width:n,height:t}
1993var r=a%90*Math.PI/180,i=Math.sin(r),o=Math.cos(r),s=t*o+n*i,l=t*i+n*o
1994return a>90?{width:l,height:s}:{width:s,height:l}}function tt(e,t,n,a){var r=t.aspectRatio,i=t.naturalWidth,o=t.naturalHeight,s=t.rotate,l=void 0===s?0:s,u=t.scaleX,d=void 0===u?1:u,p=t.scaleY,h=void 0===p?1:p,g=n.aspectRatio,f=n.naturalWidth,m=n.naturalHeight,v=a.fillColor,b=void 0===v?"transparent":v,y=a.imageSmoothingEnabled,x=void 0===y||y,C=a.imageSmoothingQuality,D=void 0===C?"low":C,w=a.maxWidth,A=void 0===w?1/0:w,E=a.maxHeight,j=void 0===E?1/0:E,B=a.minWidth,k=void 0===B?0:B,S=a.minHeight,N=void 0===S?0:S,F=document.createElement("canvas"),O=F.getContext("2d"),M=Ze({aspectRatio:g,width:A,height:j}),P=Ze({aspectRatio:g,width:k,height:N},"cover"),T=Math.min(M.width,Math.max(P.width,f)),I=Math.min(M.height,Math.max(P.height,m)),R=Ze({aspectRatio:r,width:A,height:j}),L=Ze({aspectRatio:r,width:k,height:N},"cover"),_=Math.min(R.width,Math.max(L.width,i)),$=Math.min(R.height,Math.max(L.height,o)),z=[-_/2,-$/2,_,$]
1995return F.width=Be(T),F.height=Be(I),O.fillStyle=b,O.fillRect(0,0,T,I),O.save(),O.translate(T/2,I/2),O.rotate(l*Math.PI/180),O.scale(d,h),O.imageSmoothingEnabled=x,O.imageSmoothingQuality=D,O.drawImage.apply(O,[e].concat(c(z.map((function(e){return Math.floor(Be(e))}))))),O.restore(),F}var nt=String.fromCharCode
1996function at(e,t,n){var a=""
1997n+=t
1998for(var r=t;r<n;r+=1)a+=nt(e.getUint8(r))
1999return a}var rt=/^data:.*,/
2000function it(e){var t=e.replace(rt,""),n=atob(t),a=new ArrayBuffer(n.length),r=new 
2000Uint8Array(a)
2001return Ae(r,(function(e,t){r[t]=n.charCodeAt(t)})),a}function ot(e,t){for(var n=[],a=8192,r=new Uint8Array(e);r.length>0;)n.push(nt.apply(null,we(r.subarray(0,a)))),r=r.subarray(a)
2002return"data:".concat(t,";base64,").concat(btoa(n.join("")))}function st(e){var t,n=new DataView(e)
2003try{var a,r,i
2004if(255===n.getUint8(0)&&216===n.getUint8(1))for(var o=n.byteLength,s=2;s+1<o;){if(255===n.getUint8(s)&&225===n.getUint8(s+1)){r=s
2005break}s+=1}if(r){var l=r+10
2006if("Exif"===at(n,r+4,4)){var c=n.getUint16(l)
2007if(((a=18761===c)||19789===c)&&42===n.getUint16(l+2,a)){var u=n.getUint32(l+4,a)
2008u>=8&&(i=l+u)}}}if(i){var d,p,h=n.getUint16(i,a)
2009for(p=0;p<h;p+=1)if(d=i+12*p+2,274===n.getUint16(d,a)){d+=8,t=n.getUint16(d,a),n.setUint16(d,1,a)
2010break}}}catch(e){t=1}return t}function lt(e){var t=0,n=1,a=1
2011switch(e){case 2:n=-1
2012break
2013case 3:t=-180
2014break
2015case 4:a=-1
2016break
2017case 5:t=90,a=-1
2018break
2019case 6:t=90
2020break
2021case 7:t=90,n=-1
2022break
2023case 8:t=-90}return{rotate:t,scaleX:n,scaleY:a}}var ct={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,n=this.container,a=this.cropper,r=Number(t.minContainerWidth),i=Number(t.minContainerHeight)
2024Fe(a,P),Oe(e,P)
2025var o={width:Math.max(n.offsetWidth,r>=0?r:ue),height:Math.max(n.offsetHeight,i>=0?i:de)}
2026this.containerData=o,Se(a,{width:o.width,height:o.height}),Fe(e,P),Oe(a,P)},initCanvas:function(){var e=this.containerData,t=this.imageData,n=this.options.viewMode,a=Math.abs(t.rotate)%180==90,r=a?t.naturalHeight:t.naturalWidth,i=a?t.naturalWidth:t.naturalHeight,o=r/i,s=e.width,l=e.height
2027e.height*o>e.width?3===n?s=e.height*o:l=e.width/o:3===n?l=e.width/o:s=e.height*o
2028var c={aspectRatio:o,naturalWidth:r,naturalHeight:i,width:s,height:l}
2029this.canvasData=c,this.limited=1===n||2===n,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(e.width-c.width)/2,c.top=(e.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=Ee({},c)},limitCanvas:function(e,t){var n=this.options,a=this.containerData,r=this.canvasData,i=this.cropBoxData,o=n.viewMode,s=r.aspectRatio,l=this.cropped&&i
2030if(e){var c=Number(n.minCanvasWidth)||0,u=Number(n.minCanvasHeight)||0
2031o>1?(c=Math.max(c,a.width),u=Math.max(u,a.height),3===o&&(u*s>c?c=u*s:u=c/s)):o>0&&(c?c=Math.max(c,l?i.width:0):u?u=Math.max(u,l?i.height:0):l&&(c=i.width,(u=i.height)*s>c?c=u*s:u=c/s))
2032var d=Ze({aspectRatio:s,width:c,height:u})
2033c=d.width,u=d.height,r.minWidth=c,r.minHeight=u,r.maxWidth=1/0,r.maxHeight=1/0}if(t)if(o>(l?0:1)){var p=a.width-r.width,h=a.height-r.height
2034r.minLeft=Math.min(0,p),r.minTop=Math.min(0,h),r.maxLeft=Math.max(0,p),r.maxTop=Math.max(0,h),l&&this.limited&&(r.minLeft=Math.min(i.left,i.left+(i.width-r.width)),r.minTop=Math.min(i.top,i.top+(i.height-r.height)),r.maxLeft=i.left,r.maxTop=i.top,2===o&&(r.width>=a.width&&(r.minLeft=Math.min(0,p),r.maxLeft=Math.max(0,p)),r.height>=a.height&&(r.minTop=Math.min(0,h),r.maxTop=Math.max(0,h))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=a.width,r.maxTop=a.height},renderCanvas:function(e,t){var n=this.canvasData,a=this.imageData
2035if(t){var r=et({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),i=r.width,o=r.height,s=n.width*(i/n.naturalWidth),l=n.height*(o/n.naturalHeight)
2036n.left-=(s-n.width)/2,n.top-=(l-n.height)/2,n.width=s,n.height=l,n.aspectRatio=i/o,n.naturalWidth=i,n.naturalHeight=o,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,Se(this.canvas,Ee({width:n.width,height:n.height},Ye({translateX:n.left,translateY:n.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,n=this.imageData,a=n.naturalWi
2036dth*(t.width/t.naturalWidth),r=n.naturalHeight*(t.height/t.naturalHeight)
2037Ee(n,{width:a,height:r,left:(t.width-a)/2,top:(t.height-r)/2}),Se(this.image,Ee({width:n.width,height:n.height},Ye(Ee({translateX:n.left,translateY:n.top},n)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,n=e.aspectRatio||e.initialAspectRatio,a=Number(e.autoCropArea)||.8,r={width:t.width,height:t.height}
2038n&&(t.height*n>t.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*a),r.height=Math.max(r.minHeight,r.height*a),r.left=t.left+(t.width-r.width)/2,r.top=t.top+(t.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=Ee({},r)},limitCropBox:function(e,t){var n=this.options,a=this.containerData,r=this.canvasData,i=this.cropBoxData,o=this.limited,s=n.aspectRatio
2039if(e){var l=Number(n.minCropBoxWidth)||0,c=Number(n.minCropBoxHeight)||0,u=o?Math.min(a.width,r.width,r.width+r.left,a.width-r.left):a.width,d=o?Math.min(a.height,r.height,r.height+r.top,a.height-r.top):a.height
2040l=Math.min(l,a.width),c=Math.min(c,a.height),s&&(l&&c?c*s>l?c=l/s:l=c*s:l?c=l/s:c&&(l=c*s),d*s>u?d=u/s:u=d*s),i.minWidth=Math.min(l,u),i.minHeight=Math.min(c,d),i.maxWidth=u,i.maxHeight=d}t&&(o?(i.minLeft=Math.max(0,r.left),i.minTop=Math.max(0,r.top),i.maxLeft=Math.min(a.width,r.left+r.width)-i.width,i.maxTop=Math.min(a.height,r.top+r.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=a.width-i.width,i.maxTop=a.height-i.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,e.movable&&e.cropBoxMovable&&Re(this.face,_,n.width>=t.width&&n.height>=t.height?D:x),Se(this.cropBox,Ee({width:n.width,height:n.height},Ye({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Ue(this.element,V,this.getData())}},ut={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,a=t?this.crossOriginUrl:this.url,r=e.alt||"The image to preview",i=document.createElement("img")
2041if(t&&(i.crossOrigin=t),i.src=a,i.alt=r,this.viewBox.appendChild(i),this.viewBoxImage=i,n){var o=n
2042"string"==typeof n?o=e.ownerDocument.querySelectorAll(n):n.querySelector&&(o=[n]),this.previews=o,Ae(o,(function(e){var n=document.createElement("img")
2043Re(e,$,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=a,n.alt=r,n.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(n)}))}},resetPreview:function(){Ae(this.previews,(function(e){var t=Ie(e,$)
2044Se(e,{width:t.width,height:t.height}),e.innerHTML=t.html,Le(e,$)}))},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,a=n.width,r=n.height,i=e.width,o=e.height,s=n.left-t.left-e.left,l=n.top-t.top-e.top
2045this.cropped&&!this.disabled&&(Se(this.viewBoxImage,Ee({width:i,height:o},Ye(Ee({translateX:-s,translateY:-l},e)))),Ae(this.previews,(function(t){var n=Ie(t,$),c=n.width,u=n.height,d=c,p=u,h=1
2046a&&(p=r*(h=c/a)),r&&p>u&&(d=a*(h=u/r),p=u),Se(t,{width:d,height:p}),Se(t.getElementsByTagName("img")[0],Ee({width:i*h,height:o*h},Ye(Ee({translateX:-s*h,translateY:-l*h},e))))})))}},dt={bind:function(){var e=this.element,t=this.options,n=this.cropper
2047Ce(t.cropstart)&&We(e,q,t.cropstart),Ce(t.cropmove)&&We(e,K,t.cropmove),Ce(t.cropend)&&We(e,H,t.cropend),Ce(t.crop)&&We(e,V,t.crop),Ce(t.zoom)&&We(e,re,t.zoom),We(n,Q,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&We(n,ae,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&We(n,G,this.onDblclick=this.dblclick.bind(this)),We(e.ownerDocument,Z,this.onCropMove=this.cropMove.bind(this)),We(e.ownerDocument,ee,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&We(window,ne,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper
2048Ce(t.cropstart)&&ze(e,q,t.cropstart),Ce(t.cropmove)&&ze(e,K,t.cropmove),Ce(t.cropend)&&ze(e,H,t.cropend),Ce(t.crop)&&ze(e,V,t.crop),Ce(t.zoom)&&ze(e,re,t.zoom),ze(n,Q,this.onCropStart),t.zoomable&&t.zoomOnWheel&&ze(n,ae,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&ze(n,G,this.onDblclick),ze(e.ownerDocument,Z,this.onCropMove),ze(e.ownerDocument,ee,this.onCropEnd),t.responsive&&ze(window,ne,this.onResize)}},pt={resize:function(){if(!this.disabled){var e,t,n=this.options,a=this.container,r=this.containerData,i=a.offsetWidth/r.width,o=a.offsetHeight/r.height,s=Math.abs(i-1)>Math.abs(o-1)?i:o
20491!==s&&(n.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(Ae(e,(function(t,n){e[n]=t*s}))),this.setCropBoxData(Ae(t,(function(e,n){t[n]=e*s})))))}},dblclick:function(){this.disabled||this.options.dragMode===U||this.setDragMode(Ne(this.dragBox,O)?W:z)},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,a=1
2050this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?a=e.deltaY>0?1:-1:e.wheelDelta?a=-e.wheelDelta/120:e.detail&&(a=e.detail>
20500?1:-1),this.zoom(-a*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button
2051if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(fe(t)&&1!==t||fe(n)&&0!==n||e.ctrlKey))){var a,r=this.options,i=this.pointers
2052e.changedTouches?Ae(e.changedTouches,(function(e){i[e.identifier]=Xe(e)})):i[e.pointerId||0]=Xe(e),a=Object.keys(i).length>1&&r.zoomable&&r.zoomOnTouch?w:Ie(e.target,_),oe.test(a)&&!1!==Ue(this.element,q,{originalEvent:e,action:a})&&(e.preventDefault(),this.action=a,this.cropping=!1,a===C&&(this.cropping=!0,Fe(this.dragBox,R)))}},cropMove:function(e){var t=this.action
2053if(!this.disabled&&t){var n=this.pointers
2054e.preventDefault(),!1!==Ue(this.element,K,{originalEvent:e,action:t})&&(e.changedTouches?Ae(e.changedTouches,(function(e){Ee(n[e.identifier]||{},Xe(e,!0))})):Ee(n[e.pointerId||0]||{},Xe(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers
2055e.changedTouches?Ae(e.changedTouches,(function(e){delete n[e.identifier]})):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,Me(this.dragBox,R,this.cropped&&this.options.modal)),Ue(this.element,H,{originalEvent:e,action:t}))}}},ht={change:function(e){var t,n=this.options,a=this.canvasData,r=this.containerData,i=this.cropBoxData,o=this.pointers,s=this.action,l=n.aspectRatio,c=i.left,u=i.top,d=i.width,p=i.height,h=c+d,g=u+p,f=0,m=0,v=r.width,b=r.height,y=!0
2056!l&&e.shiftKey&&(l=d&&p?d/p:1),this.limited&&(f=i.minLeft,m=i.minTop,v=f+Math.min(r.width,a.width,a.left+a.width),b=m+Math.min(r.height,a.height,a.top+a.height))
2057var O=o[Object.keys(o)[0]],M={x:O.endX-O.startX,y:O.endY-O.startY},T=function(e){switch(e){case A:h+M.x>v&&(M.x=v-h)
2058break
2059case E:c+M.x<f&&(M.x=f-c)
2060break
2061case B:u+M.y<m&&(M.y=m-u)
2062break
2063case j:g+M.y>b&&(M.y=b-g)}}
2064switch(s){case x:c+=M.x,u+=M.y
2065break
2066case A:if(M.x>=0&&(h>=v||l&&(u<=m||g>=b))){y=!1
2067break}T(A),(d+=M.x)<0&&(s=E,c-=d=-d),l&&(p=d/l,u+=(i.height-p)/2)
2068break
2069case B:if(M.y<=0&&(u<=m||l&&(c<=f||h>=v))){y=!1
2070break}T(B),p-=M.y,u+=M.y,p<0&&(s=j,u-=p=-p),l&&(d=p*l,c+=(i.width-d)/2)
2071break
2072case E:if(M.x<=0&&(c<=f||l&&(u<=m||g>=b))){y=!1
2073break}T(E),d-=M.x,c+=M.x,d<0&&(s=A,c-=d=-d),l&&(p=d/l,u+=(i.height-p)/2)
2074break
2075case j:if(M.y>=0&&(g>=b||l&&(c<=f||h>=v))){y=!1
2076break}T(j),(p+=M.y)<0&&(s=B,u-=p=-p),l&&(d=p*l,c+=(i.width-d)/2)
2077break
2078case k:if(l){if(M.y<=0&&(u<=m||h>=v)){y=!1
2079break}T(B),p-=M.y,u+=M.y,d=p*l}else T(B),T(A),M.x>=0?h<v?d+=M.x:M.y<=0&&u<=m&&(y=!1):d+=M.x,M.y<=0?u>m&&(p-=M.y,u+=M.y):(p-=M.y,u+=M.y)
2080d<0&&p<0?(s=F,u-=p=-p,c-=d=-d):d<0?(s=S,c-=d=-d):p<0&&(s=N,u-=p=-p)
2081break
2082case S:if(l){if(M.y<=0&&(u<=m||c<=f)){y=!1
2083break}T(B),p-=M.y,u+=M.y,d=p*l,c+=i.width-d}else T(B),T(E),M.x<=0?c>f?(d-=M.x,c+=M.x):M.y<=0&&u<=m&&(y=!1):(d-=M.x,c+=M.x),M.y<=0?u>m&&(p-=M.y,u+=M.y):(p-=M.y,u+=M.y)
2084d<0&&p<0?(s=N,u-=p=-p,c-=d=-d):d<0?(s=k,c-=d=-d):p<0&&(s=F,u-=p=-p)
2085break
2086case F:if(l){if(M.x<=0&&(c<=f||g>=b)){y=!1
2087break}T(E),d-=M.x,c+=M.x,p=d/l}else T(j),T(E),M.x<=0?c>f?(d-=M.x,c+=M.x):M.y>=0&&g>=b&&(y=!1):(d-=M.x,c+=M.x),M.y>=0?g<b&&(p+=M.y):p+=M.y
2088d<0&&p<0?(s=k,u-=p=-p,c-=d=-d):d<0?(s=N,c-=d=-d):p<0&&(s=S,u-=p=-p)
2089break
2090case N:if(l){if(M.x>=0&&(h>=v||g>=b)){y=!1
2091break}T(A),p=(d+=M.x)/l}else T(j),T(A),M.x>=0?h<v?d+=M.x:M.y>=0&&g>=b&&(y=!1):d+=M.x,M.y>=0?g<b&&(p+=M.y):p+=M.y
2092d<0&&p<0?(s=S,u-=p=-p,c-=d=-d):d<0?(s=F,c-=d=-d):p<0&&(s=k,u-=p=-p)
2093break
2094case D:this.move(M.x,M.y),y=!1
2095break
2096case w:this.zoom(Je(o),e),y=!1
2097break
2098case C:if(!M.x||!M.y){y=!1
2099break}t=Ve(this.cropper),c=O.startX-t.left,u=O.startY-t.top,d=i.minWidth,p=i.minHeight,M.x>0?s=M.y>0?N:k:M.x<0&&(c-=d,s=M.y>0?F:S),M.y<0&&(u-=p),this.cropped||(Oe(this.cropBox,P),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}y&&(i.width=d,i.height=p,i.left=c,i.top=u,this.action=s,this.renderCropBox()),Ae(o,(function(e){e.startX=e.endX,e.startY=e.endY}))}},gt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Fe(this.dragBox,R),Oe(this.cropBox,P),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Ee({},this.initialImageData),this.canvasData=Ee({},this.initialCanvasData),this.cropBoxData=Ee({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Ee(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Oe(this.dragBox,R),Fe(this.cropBox,P)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]
2100return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Ae(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Oe(this.cropper,M)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Fe(this.cropper,M)),this},destroy:function(){var e=this.element
2101return e[y]?(e[y]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,a=n.left,r=n.top
2102return this.moveTo(ve(e)?e:a+Number(e),ve(t)?t:r+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,a=!1
2103return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(fe(e)&&(n.left
2103=e,a=!0),fe(t)&&(n.top=t,a=!0),a&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData
2104return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var a=this.options,r=this.canvasData,i=r.width,o=r.height,s=r.naturalWidth,l=r.naturalHeight
2105if((e=Number(e))>=0&&this.ready&&!this.disabled&&a.zoomable){var c=s*e,u=l*e
2106if(!1===Ue(this.element,re,{ratio:e,oldRatio:i/s,originalEvent:n}))return this
2107if(n){var d=this.pointers,p=Ve(this.cropper),h=d&&Object.keys(d).length?Qe(d):{pageX:n.pageX,pageY:n.pageY}
2108r.left-=(c-i)*((h.pageX-p.left-r.left)/i),r.top-=(u-o)*((h.pageY-p.top-r.top)/o)}else xe(t)&&fe(t.x)&&fe(t.y)?(r.left-=(c-i)*((t.x-r.left)/i),r.top-=(u-o)*((t.y-r.top)/o)):(r.left-=(c-i)/2,r.top-=(u-o)/2)
2109r.width=c,r.height=u,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return fe(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY
2110return this.scale(e,fe(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX
2111return this.scale(fe(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData,a=!1
2112return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(fe(e)&&(n.scaleX=e,a=!0),fe(t)&&(n.scaleY=t,a=!0),a&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,a=this.imageData,r=this.canvasData,i=this.cropBoxData
2113if(this.ready&&this.cropped){e={x:i.left-r.left,y:i.top-r.top,width:i.width,height:i.height}
2114var o=a.width/a.naturalWidth
2115if(Ae(e,(function(t,n){e[n]=t/o})),t){var s=Math.round(e.y+e.height),l=Math.round(e.x+e.width)
2116e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=l-e.x,e.height=s-e.y}}else e={x:0,y:0,width:0,height:0}
2117return n.rotatable&&(e.rotate=a.rotate||0),n.scalable&&(e.scaleX=a.scaleX||1,e.scaleY=a.scaleY||1),e},setData:function(e){var t=this.options,n=this.imageData,a=this.canvasData,r={}
2118if(this.ready&&!this.disabled&&xe(e)){var i=!1
2119t.rotatable&&fe(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,i=!0),t.scalable&&(fe(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,i=!0),fe(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0)
2120var o=n.width/n.naturalWidth
2121fe(e.x)&&(r.left=e.x*o+a.left),fe(e.y)&&(r.top=e.y*o+a.top),fe(e.width)&&(r.width=e.width*o),fe(e.height)&&(r.height=e.height*o),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?Ee({},this.containerData):{}},getImageData:function(){return this.sized?Ee({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={}
2122return this.ready&&Ae(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){t[n]=e[n]})),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio
2123return this.ready&&!this.disabled&&xe(e)&&(fe(e.left)&&(t.left=e.left),fe(e.top)&&(t.top=e.top),fe(e.width)?(t.width=e.width,t.height=e.width/n):fe(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData
2124return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,n,a=this.cropBoxData,r=this.options.aspectRatio
2125return this.ready&&this.cropped&&!this.disabled&&xe(e)&&(fe(e.left)&&(a.left=e.left),fe(e.top)&&(a.top=e.top),fe(e.width)&&e.width!==a.width&&(t=!0,a.width=e.width),fe(e.height)&&e.height!==a.height&&(n=!0,a.height=e.height),r&&(t?a.height=a.width/r:n&&(a.width=a.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
2126if(!this.ready||!window.HTMLCanvasElement)return null
2127var t=this.canvasData,n=tt(this.image,this.imageData,t,e)
2128if(!this.cropped)return n
2129var a=this.getData(e.rounded),r=a.x,i=a.y,o=a.width,s=a.height,l=n.width/Math.floor(t.naturalWidth)
21301!==l&&(r*=l,i*=l,o*=l,s*=l)
2131var u=o/s,d=Ze({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=Ze({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=Ze({aspectRatio:u,width:e.width||(1!==l?n.width:o),height:e.height||(1!==l?n.height:s)}),g=h.width,f=h.height
2132g=Math.min(d.width,Math.max(p.width,g)),f=Math.min(d.height,Math.max(p.height,f))
2133var m=document.createElement("canvas"),v=m.getContext("2d")
2134m.width=Be(g),m.height=Be(f),v.fillStyle=e.fillColor||"transparent",v.fillRect(0,0,g,f)
2135var b=e.imageSmoothingEnabled,y=void 0===b||b,x=e.imageSmoothingQuality
2136v.imageSmoothingEnabled=y,x&&(v.imageSmoothingQuality=x)
2137var C,D,w,A,E,j,B=n.width,k=n.height,S=r,N=i
2138S<=-o||S>B?(S=0,C=0,w=0,E=0):S<=0?(w=-S,S=0,E=C=Math.min(B,o+S)):S<=B&&(w=0,E=C=Math.min(o,B-S)),C<=0||N<=-s||N>k?(N=0,D=0,A=0,j=0):N<=0?(A=-N,N=0,j=D=Math.min(k,s+N)):N<=k&&(A=0,j=D=Math.min(s,k-N))
2139var F=[S,N,C,D]
2140if(E>0&&j>0){var O=g/o
2141F.push(w*O,A*O,E*O,j*O)}return v.drawImage.apply(v,[n].concat(c(F.map((function(e){return Math.floor(Be(e))}))))),m},setAspectRatio:function(e){var t=this.options
2142return this.disabled||ve(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,a=this.face
2143if(this.ready&&!this.disabled){var r=e===z,i=t.movable&&e===W
2144e=r||i?e:U,t.dragMode=e,Re(n,_,e),Me(n,O,r),Me(n,L,i),t.cropBoxMovable||(Re(a,_,e),Me(a,O,r),Me(a,L,i))}return this}}
2144,ft=m.Cropper,mt=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
2145if(i(this,e),!t||!ce.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.")
2146this.element=t,this.options=Ee({},pe,xe(n)&&n),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return s(e,[{key:"init",value:function(){var e,t=this.element,n=t.tagName.toLowerCase()
2147if(!t[y]){if(t[y]=this,"img"===n){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return
2148e=t.src}else"canvas"===n&&window.HTMLCanvasElement&&(e=t.toDataURL())
2149this.load(e)}}},{key:"load",value:function(e){var t=this
2150if(e){this.url=e,this.imageData={}
2151var n=this.element,a=this.options
2152if(a.rotatable||a.scalable||(a.checkOrientation=!1),a.checkOrientation&&window.ArrayBuffer)if(se.test(e))le.test(e)?this.read(it(e)):this.clone()
2153else{var r=new XMLHttpRequest,i=this.clone.bind(this)
2154this.reloading=!0,this.xhr=r,r.onabort=i,r.onerror=i,r.ontimeout=i,r.onprogress=function(){r.getResponseHeader("content-type")!==ie&&r.abort()},r.onload=function(){t.read(r.response)},r.onloadend=function(){t.reloading=!1,t.xhr=null},a.checkCrossOrigin&&qe(e)&&n.crossOrigin&&(e=Ge(e)),r.open("GET",e,!0),r.responseType="arraybuffer",r.withCredentials="use-credentials"===n.crossOrigin,r.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,n=this.imageData,a=st(e),r=0,i=1,o=1
2155if(a>1){this.url=ot(e,ie)
2156var s=lt(a)
2157r=s.rotate,i=s.scaleX,o=s.scaleY}t.rotatable&&(n.rotate=r),t.scalable&&(n.scaleX=i,n.scaleY=o),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,n=e.crossOrigin,a=t
2158this.options.checkCrossOrigin&&qe(t)&&(n||(n="anonymous"),a=Ge(t)),this.crossOrigin=n,this.crossOriginUrl=a
2159var r=document.createElement("img")
2160n&&(r.crossOrigin=n),r.src=a||t,r.alt=e.alt||"The image to crop",this.image=r,r.onload=this.start.bind(this),r.onerror=this.stop.bind(this),Fe(r,T),e.parentNode.insertBefore(r,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image
2161t.onload=null,t.onerror=null,this.sizing=!0
2162var n=m.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(m.navigator.userAgent),a=function(t,n){Ee(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.initialImageData=Ee({},e.imageData),e.sizing=!1,e.sized=!0,e.build()}
2163if(!t.naturalWidth||n){var r=document.createElement("img"),i=document.body||document.documentElement
2164this.sizingImage=r,r.onload=function(){a(r.width,r.height),n||i.removeChild(r)},r.src=t.src,n||(r.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(r))}else a(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image
2165e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,n=this.image,a=e.parentNode,r=document.createElement("div")
2166r.innerHTML=he
2167var i=r.querySelector(".".concat(y,"-container")),o=i.querySelector(".".concat(y,"-canvas")),s=i.querySelector(".".concat(y,"-drag-box")),l=i.querySelector(".".concat(y,"-crop-box")),c=l.querySelector(".".concat(y,"-face"))
2168this.container=a,this.cropper=i,this.canvas=o,this.dragBox=s,this.cropBox=l,this.viewBox=i.querySelector(".".concat(y,"-view-box")),this.face=c,o.appendChild(n),Fe(e,P),a.insertBefore(i,e.nextSibling),Oe(n,T),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,Fe(l,P),t.guides||Fe(l.getElementsByClassName("".concat(y,"-dashed")),P),t.center||Fe(l.getElementsByClassName("".concat(y,"-center")),P),t.background&&Fe(i,"".concat(y,"-bg")),t.highlight||Fe(c,I),t.cropBoxMovable&&(Fe(c,L),Re(c,_,x)),t.cropBoxResizable||(Fe(l.getElementsByClassName("".concat(y,"-line")),P),Fe(l.getElementsByClassName("".concat(y,"
2168-point")),P)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),Ce(t.ready)&&We(e,te,t.ready,{once:!0}),Ue(e,te)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview()
2169var e=this.cropper.parentNode
2170e&&e.removeChild(this.cropper),Oe(this.element,P)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=ft,e}},{key:"setDefaults",value:function(e){Ee(pe,xe(e)&&e)}}])}()
2171return Ee(mt.prototype,ct,ut,dt,pt,ht,gt),mt}()},7157:e=>{"use strict"
2172e.exports=function(e){if(e=String(e||""),a.test(e))return"rtl"
2173if(r.test(e))return"ltr"
2174return"neutral"}
2175var t="֑-߿יִ-﷽ﹰ-ﻼ",n="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",a=new RegExp("^[^"+n+"]*["+t+"]"),r=new RegExp("^[^"+t+"]*["+n+"]")},63144:function(e,t){var n,a,r
2176a=[t],n=function(e){"use strict"
2177Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o={node:document.body,topId:"dnd-page-scroll-top",bottomId:"dnd-page-scroll-bottom",namespace:"",delay:25,scrollBy:50,height:"50px",listenGlobally:!0},s=t({},o,e)
2178s.topId+=s.namespace,s.bottomId+=s.namespace
2179var l=s.listenGlobally?document:s.node,c=document.getElementById(s.topId)||n(s.topId),u=document.getElementById(s.bottomId)||n(s.bottomId)
2180a(c,u),i({position:"fixed",left:0,right:0,height:s.height,zIndex:999999},c,u),c.style.top=0,u.style.bottom=0
2181var d=s.node===document.body?function(e){return window.scrollBy(0,e)}:function(e){s.node.scrollTop+=e},p=null,h=function(){clearInterval(p),p=null};[c,u].forEach((function(e){return e.addEventListener("dragover",(function(e){null==p&&(p=setInterval((function(){return d(e.target===c?-s.scrollBy:s.scrollBy)}),s.delay)),e.dataTransfer.dropEffect="none",e.preventDefault()}))})),[c,u].forEach((function(e){return e.addEventListener("dragleave",(function(){return h()}))})),l.addEventListener("dragover",(function(e){return r(c,u)})),l.addEventListener("dragend",(function(){h(),a(c,u)})),[c,u].forEach((function(e){return e.addEventListener("mouseover",(function(){h(),a(c,u)}))}))}
2182var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
2183for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"div",n=document.createElement(t)
2184return n.setAttribute("id",e),document.body.appendChild(n),n},a=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n]
2185return t.forEach((function(e){e.style.display="none"}))},r=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n]
2186return t.forEach((function(e){e.style.display="block"}))},i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a]
2187var r=Object.keys(e)
2188n.forEach((function(t){r.forEach((function(n){t.style[n]=e[n]}))}))}},void 0===(r="function"==typeof n?n.apply(t,a):n)||(e.exports=r)},66039:e=>{"use strict"
2189
2190;/*!
2191 * escape-html
2192 * Copyright(c) 2012-2013 TJ Holowaychuk
2193 * Copyright(c) 2015 Andreas Lubbe
2194 * Copyright(c) 2015 Tiancheng "Timothy" Gu
2195 * MIT Licensed
2196 */var t=/["'&<>]/
2197e.exports=function(e){var n,a=""+e,r=t.exec(a)
2198if(!r)return a
2199var i="",o=0,s=0
2200for(o=r.index;o<a.length;o++){switch(a.charCodeAt(o)){case 34:n="&quot;"
2201break
2202case 38:n="&amp;"
2203break
2204case 39:n="&#39;"
2205break
2206case 60:n="&lt;"
2207break
2208case 62:n="&gt;"
2209break
2210default:continue}s!==o&&(i+=a.substring(s,o)),s=o+1,i+=n}return s!==o?i+a.substring(s,o):i}},80601:(e,t)=>{"use strict"
2211for(var n=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),a={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},r={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:n?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},i={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)i["f"+o]=111+o
2212function s(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e])
2213var a=e.map((function(e){return l(e,t)})),r=function(e){return a.some((function(t){return c(t,e)}))}
2214return null==n?r:r(n)}function l(e,t){var n=t&&t.byKey,r={},i=(e=e.replace("++","+add")).split("+"),o=i.length
2215for(var s in a)r[a[s]]=!1
2216var l=!0,c=!1,p=void 0
2217try{for(var h,g=i[Symbol.iterator]();!(l=(h=g.next()).done);l=!0){var f=h.value,m=f.endsWith("?")
2218m&&(f=f.slice(0,-1))
2219var v=d(f),b=a[v]
22201!==o&&b||(n?r.key=v:r.which=u(f)),b&&(r[b]=!m||null)}}catch(e){c=!0,p=e}finally{try{!l&&g.return&&g.return()}finally{if(c)throw p}}return r}function c(e,t){for(var n in e){var a=e[n],r=void 0
2221if(null!=a&&((null!=(r="key"===n?t.key.toLowerCase():"which"===n?91===a&&93===t.which?91:t.which:t[n])||!1!==a)&&r!==a))return!1}return!0}
2221function u(e){return e=d(e),i[e]||e.toUpperCase().charCodeAt(0)}function d(e){return e=e.toLowerCase(),e=r[e]||e}t.Sn=function(e,t){return s(e,{byKey:!0},t)}},77432:(e,t,n)=>{var a=n(15036).Symbol
2222e.exports=a},46077:(e,t,n)=>{var a=n(77432),r=n(64444),i=n(43371),o=a?a.toStringTag:void 0
2223e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?r(e):i(e)}},87625:(e,t,n)=>{var a=n(85531),r=/^\s+/
2224e.exports=function(e){return e?e.slice(0,a(e)+1).replace(r,""):e}},28565:(e,t,n)=>{var a=n(48703),r="object"==typeof a&&a&&a.Object===Object&&a
2225e.exports=r},64444:(e,t,n)=>{var a=n(77432),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,s=a?a.toStringTag:void 0
2226e.exports=function(e){var t=i.call(e,s),n=e[s]
2227try{e[s]=void 0
2228var a=!0}catch(e){}var r=o.call(e)
2229return a&&(t?e[s]=n:delete e[s]),r}},43371:e=>{var t=Object.prototype.toString
2230e.exports=function(e){return t.call(e)}},15036:(e,t,n)=>{var a=n(28565),r="object"==typeof self&&self&&self.Object===Object&&self,i=a||r||Function("return this")()
2231e.exports=i},85531:e=>{var t=/\s/
2232e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},9738:(e,t,n)=>{var a=n(56130),r=n(28593),i=n(22909),o=Math.max,s=Math.min
2233e.exports=function(e,t,n){var l,c,u,d,p,h,g=0,f=!1,m=!1,v=!0
2234if("function"!=typeof e)throw new TypeError("Expected a function")
2235function b(t){var n=l,a=c
2236return l=c=void 0,g=t,d=e.apply(a,n)}function y(e){var n=e-h
2237return void 0===h||n>=t||n<0||m&&e-g>=u}function x(){var e=r()
2238if(y(e))return C(e)
2239p=setTimeout(x,function(e){var n=t-(e-h)
2240return m?s(n,u-(e-g)):n}(e))}function C(e){return p=void 0,v&&l?b(e):(l=c=void 0,d)}function D(){var e=r(),n=y(e)
2241if(l=arguments,c=this,h=e,n){if(void 0===p)return function(e){return g=e,p=setTimeout(x,t),f?b(e):d}(h)
2242if(m)return clearTimeout(p),p=setTimeout(x,t),b(h)}return void 0===p&&(p=setTimeout(x,t)),d}return t=i(t)||0,a(n)&&(f=!!n.leading,u=(m="maxWait"in n)?o(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),D.cancel=function(){void 0!==p&&clearTimeout(p),g=0,l=h=c=p=void 0},D.flush=function(){return void 0===p?d:C(r())},D}},56130:e=>{e.exports=function(e){var t=typeof e
2243return null!=e&&("object"==t||"function"==t)}},24189:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},25733:(e,t,n)=>{var a=n(46077),r=n(24189)
2244e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==a(e)}},28593:(e,t,n)=>{var a=n(15036)
2245e.exports=function(){return a.Date.now()}},33005:(e,t,n)=>{var a=n(9738),r=n(56130)
2246e.exports=function(e,t,n){var i=!0,o=!0
2247if("function"!=typeof e)throw new TypeError("Expected a function")
2248return r(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),a(e,t,{leading:i,maxWait:t,trailing:o})}},22909:(e,t,n)=>{var a=n(87625),r=n(56130),i=n(25733),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt
2249e.exports=function(e){if("number"==typeof e)return e
2250if(i(e))return NaN
2251if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e
2252e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e
2253e=a(e)
2254var n=s.test(e)
2255return n||l.test(e)?c(e.slice(2),n?2:8):o.test(e)?NaN:+e}},17336:e=>{"use strict"
2256const t=(e,t,n={})=>{if(!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number")
2257let a,r,i=[]
2258return function(...o){return new Promise((s=>{const l=n.leading&&!r
2259clearTimeout(r),r=setTimeout((()=>{r=null
2260const t=n.leading?a:e.apply(this,o)
2261for(s of i)s(t)
2262i=[]}),t),l?(a=e.apply(this,o),s(a)):i.push(s)}))}}
2263e.exports=t,e.exports.default=t},19868:(e,t,n)=>{"use strict"
2264Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return u.default}}),t.default=void 0
2265var a=function(e,t){if(!t&&e&&e.__esModule)return e
2266if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e}
2267var n=h(t)
2268if(n&&n.has(e))return n.get(e)
2269var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor
2270for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null
2271o&&(o.get||o.set)?Object.defineProperty(a,i,o):a[i]=e[i]}a.default=e,n&&n.set(e,a)
2272return a}(n(48431)),r=p(n(97465)),i=p(n(71098)),o=p(n(13796)),s=n(94008),l=n(48861),c=n(75603),u=p(n(17547)),d=p(n(55055))
2273function p(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null
2274var t=new WeakMap,n=new WeakMap
2275return(h=function(e){return e?n:t})(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]
2276for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},g.apply(this,arguments)}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e
2277var n=e[Symbol.toPrimitive]
2278if(void 0!==n){var a=n.call(e,t||"default")
2279if("object"!=typeof a)return a
2280throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string")
2281return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class m extends a.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:a}=t
2282return!n||a&&n.x===a.x&&n.y===a.y?null:((0,d.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:a}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),f(this,"onDragStart",((e,t)=>{(0,d.default)("Draggable: onDragStart: %j",t)
2283if(!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1
2284this.setState({dragging:!0,dragged:!0})})),f(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",t)
2285const n=(0,l.createDraggableData)(this,t),a={x:n.x,y:n.y,slackX:0,slackY:0}
2286if(this.props.bounds){const{x:e,y:t}=a
2287a.x+=this.state.slackX,a.y+=this.state.slackY
2288const[r,i]=(0,l.getBoundPosition)(this,a.x,a.y)
2289a.x=r,a.y=i,a.slackX=this.state.slackX+(e-a.x),a.slackY=this.state.slackY+(t-a.y),n.x=a.x,n.y=a.y,n.deltaX=a.x-this.state.x,n.deltaY=a.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1
2290this.setState(a)})),f(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1
2291if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,d.default)("Draggable: onDragStop: %j",t)
2292const n={dragging:!1,slackX:0,slackY:0}
2293if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position
2294n.x=e,n.y=t}this.setState(n)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t
2295return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:i.default.findDOMNode(this)}render(){const{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:c,defaultClassNameDragged:d,position:p,positionOffset:h,scale:f,...m}=this.props
2296let v={},b=null
2297const y=!Boolean(p)||this.state.dragging,x=p||r,C={x:(0,l.canDragX)(this)&&y?this.state.x:x.x,y:(0,l.canDragY)(this)&&y?this.state.y:x.y}
2298this.state.isElementSVG?b=(0,s.createSVGTransform)(C,h):v=(0,s.createCSSTransform)(C,h)
2299const D=(0,o.default)(n.props.className||"",i,{[c]:this.state.dragging,[d]:this.state.dragged})
2300return a.createElement(u.default,g({},m,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),a.cloneElement(a.Children.only(n),{className:D,style:{...n.props.style,...v},transform:b}))}}t.default=m,f(m,"displayName","Draggable"),f(m,"propTypes",{...u.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}
2300),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),f(m,"defaultProps",{...u.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},17547:(e,t,n)=>{"use strict"
2301Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0
2302var a=function(e,t){if(!t&&e&&e.__esModule)return e
2303if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e}
2304var n=d(t)
2305if(n&&n.has(e))return n.get(e)
2306var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor
2307for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var o=r?Object.getOwnPropertyDescriptor(e,i):null
2308o&&(o.get||o.set)?Object.defineProperty(a,i,o):a[i]=e[i]}a.default=e,n&&n.set(e,a)
2309return a}(n(48431)),r=u(n(97465)),i=u(n(71098)),o=n(94008),s=n(48861),l=n(75603),c=u(n(55055))
2310function u(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null
2311var t=new WeakMap,n=new WeakMap
2312return(d=function(e){return e?n:t})(e)}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e
2313var n=e[Symbol.toPrimitive]
2314if(void 0!==n){var a=n.call(e,t||"default")
2315if("object"!=typeof a)return a
2316throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string")
2317return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h={start:"touchstart",move:"touchmove",stop:"touchend"},g={start:"mousedown",move:"mousemove",stop:"mouseup"}
2318let f=g
2319class m extends a.Component{constructor(){super(...arguments),p(this,"dragging",!1),p(this,"lastX",NaN),p(this,"lastY",NaN),p(this,"touchIdentifier",null),p(this,"mounted",!1),p(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1
2320const t=this.findDOMNode()
2321if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!")
2322const{ownerDocument:n}=t
2323if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return
2324"touchstart"===e.type&&e.preventDefault()
2325const a=(0,o.getTouchIdentifier)(e)
2326this.touchIdentifier=a
2327const r=(0,s.getControlPosition)(e,a,this)
2328if(null==r)return
2329const{x:i,y:l}=r,u=(0,s.createCoreData)(this,i,l);(0,c.default)("DraggableCore: handleDragStart: %j",u),(0,c.default)("calling",this.props.onStart)
2330!1!==this.props.onStart(e,u)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(n),this.dragging=!0,this.lastX=i,this.lastY=l,(0,o.addEvent)(n,f.move,this.handleDrag),(0,o.addEvent)(n,f.stop,this.handleDragStop))})),p(this,"handleDrag",(e=>{const t=(0,s.getControlPosition)(e,this.touchIdentifier,this)
2331if(null==t)return
2332let{x:n,y:a}=t
2333if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=a-this.lastY
2334if([e,t]=(0,s.snapToGrid)(this.props.grid,e,t),!e&&!t)return
2335n=this.lastX+e,a=this.lastY+t}const r=(0,s.createCoreData)(this,n,a);(0,c.default)("DraggableCore: handleDrag: %j",r)
2336if(!1!==this.props.onDrag(e,r)&&!1!==this.mounted)this.lastX=n,this.lastY=a
2337else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents")
2338t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),p(this,"handleDragStop",(e=>{if(!this.dragging)return
2339const t=(0,s.getControlPosition)(e,this.touchIdentifier,this)
2340if(null==t)return
2341let{x:n,y:a}=t
2342if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=a-this.lastY||0;
2342[e,t]=(0,s.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,a=this.lastY+t}const r=(0,s.createCoreData)(this,n,a)
2343if(!1===this.props.onStop(e,r)||!1===this.mounted)return!1
2344const i=this.findDOMNode()
2345i&&this.props.enableUserSelectHack&&(0,o.removeUserSelectStyles)(i.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",r),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,i&&((0,c.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(i.ownerDocument,f.move,this.handleDrag),(0,o.removeEvent)(i.ownerDocument,f.stop,this.handleDragStop))})),p(this,"onMouseDown",(e=>(f=g,this.handleDragStart(e)))),p(this,"onMouseUp",(e=>(f=g,this.handleDragStop(e)))),p(this,"onTouchStart",(e=>(f=h,this.handleDragStart(e)))),p(this,"onTouchEnd",(e=>(f=h,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0
2346const e=this.findDOMNode()
2347e&&(0,o.addEvent)(e,h.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1
2348const e=this.findDOMNode()
2349if(e){const{ownerDocument:t}=e;(0,o.removeEvent)(t,g.move,this.handleDrag),(0,o.removeEvent)(t,h.move,this.handleDrag),(0,o.removeEvent)(t,g.stop,this.handleDragStop),(0,o.removeEvent)(t,h.stop,this.handleDragStop),(0,o.removeEvent)(e,h.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.removeUserSelectStyles)(t)}}findDOMNode(){var e,t
2350return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:i.default.findDOMNode(this)}render(){return a.cloneElement(a.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=m,p(m,"displayName","DraggableCore"),p(m,"propTypes",{allowAnyClick:r.default.bool,children:r.default.node.isRequired,disabled:r.default.bool,enableUserSelectHack:r.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:r.default.arrayOf(r.default.number),handle:r.default.string,cancel:r.default.string,nodeRef:r.default.object,onStart:r.default.func,onDrag:r.default.func,onStop:r.default.func,onMouseDown:r.default.func,scale:r.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),p(m,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},75269:(e,t,n)=>{"use strict"
2351const{default:a,DraggableCore:r}=n(19868)
2352e.exports=a,e.exports.default=a,e.exports.DraggableCore=r},94008:(e,t,n)=>{"use strict"
2353Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=c,t.addEvent=function(e,t,n,a){if(!e)return
2354const r={capture:!0,...a}
2355e.addEventListener?e.addEventListener(t,n,r):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},t.addUserSelectStyles=function(e){if(!e)return
2356let t=e.getElementById("react-draggable-style-el")
2357t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t))
2358e.body&&c(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){const n=l(e,t,"px")
2359return{[(0,r.browserPrefixToKey)("transform",r.default)]:n}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,a.findInArray)(e.targetTouches,(e=>t===e.identifier))||e.changedTouches&&(0,a.findInArray)(e.changedTouches,(e=>t===e.identifier))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier
2360if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight
2361const n=e.ownerDocument.defaultView.getComputedStyle(e)
2362return t-=(0,a.int)(n.paddingTop),t-=(0,a.int)(n.paddingBottom),t},t.innerWidth=function(e){let t=e.clientWidth
2363const n=e.ownerDocument.defaultView.getComputedStyle(e)
2364return t-=(0,a.int)(n.paddingLeft),t-=(0,a.int)(n.paddingRight),t},t.matchesSelector=s,t.matchesSelectorAndParentsTo=function(e,t,n){let a=e
2365do{if(s(a,t))return!0
2366if(a===n)return!1
2367a=a.parentNode}while(a)
2368return!1},t.offsetXYFromParent=function(e,t,n){const a=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),r=(e.clientX+t.scrollLeft-a.left)/n,i=(e.clientY+t.scrollTop-a.top)/n
2369return{x:r,y:i}},t.outerHeight=function(e){let t=e.clientHeight
2370const n=e.ownerDocument.defaultView.getComputedStyle(e)
2371return t+=(0,a.int)(n.borderTopWidth),t+=(0,a.int)(n.borderBottomWidth),t},t.outerWidth=function(e){let t=e.clientWidth
2372const n=e.ownerDocument.defaultView.getComputedStyle(e)
2373return t+=(0,a.int)(n.borderLeftWidth),t+=(0,a.int)(n.borderRightWidth),t},t.removeClassName=u,t.removeEvent=function(e,t,n,a){if(!e)return
2374const r={capture:!0,...a}
2375e.removeEventListener?e.removeEventListener(t,n,r):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(!e)return
2376try{if(e.body&&u(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty()
2377else{const t=(e.defaultView||window).getSelection()
2378t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}}
2379var a=n(75603),r=function(e,t){if(!t&&e&&e.__esModule)return e
2380if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e}
2381var n=i(t)
2382if(n&&n.has(e))return n.get(e)
2383var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor
2384for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=r?Object.getOwnPropertyDescriptor(e,o):null
2385s&&(s.get||s.set)?Object.defineProperty(a,o,s):a[o]=e[o]}a.default=e,n&&n.set(e,a)
2386return a}(n(23757))
2387function i(e){if("function"!=typeof WeakMap)return null
2388var t=new WeakMap,n=new WeakMap
2389return(i=function(e){return e?n:t})(e)}let o=""
2390function s(e,t){return o||(o=(0,a.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return(0,a.isFunction)(e[t])}))),!!(0,a.isFunction)(e[o])&&e[o](t)}function l(e,t,n){let{x:a,y:r}=e,i="translate(".concat(a).concat(n,",").concat(r).concat(n,")")
2391if(t){const e="".concat("string"==typeof t.x?t.x:t.x+n),a="".concat("string"==typeof t.y?t.y:t.y+n)
2392i="translate(".concat(e,", ").concat(a,")")+i}return i}function c(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function u(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},23757:(e,t)=>{"use strict"
2393Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=r,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=a
2394const n=["Moz","Webkit","O","ms"]
2395function a(){var e
2396let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform"
2397const a=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style
2398if(!a)return""
2399if(t in a)return""
2400for(let e=0;e<n.length;e++)if(r(t,n[e])in a)return n[e]
2401return""}function r(e,t){return t?"".concat(t).concat(function(e){let t="",n=!0
2402for(let a=0;a<e.length;a++)n?(t+=e[a].toUpperCase(),n=!1):"-"===e[a]?n=!0:t+=e[a]
2403return t}(e)):e}t.default=a()},55055:(e,t)=>{"use strict"
2404Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){0}},48861:(e,t,n)=>{"use strict"
2405Object.defineProperty(t,"__esModule",{value:!0}),t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.createCoreData=function(e,t,n){const r=!(0,a.isNum)(e.lastX),o=i(e)
2406return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}},t.createDraggableData=function(e,t){const n=e.props.scale
2407return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},t.getBoundPosition=function(e,t,n){if(!e.props.bounds)return[t,n]
2408let{bounds:o}=e.props
2409o="string"==typeof o?o:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(o)
2410const s=i(e)
2411if("string"==typeof o){const{ownerDocument:e}=s,t=e.defaultView
2412let n
2413if(n="parent"===o?s.parentNode:e.querySelector(o),!(n instanceof t.HTMLElement))throw new Error('Bounds selector "'+o+'" could not find an element.')
2414const i=n,l=t.getComputedStyle(s),c=t.getComputedStyle(i)
2415o={left:-s.offsetLeft+(0,a.int)(c.paddingLeft)+(0,a.int)(l.marginLeft),top:-s.offsetTop+(0,a.int)(c.paddingTop)+(0,a.int)(l.marginTop),right:(0,r.innerWidth)(i)-(0,r.outerWidth)(s)-s.offsetLeft+(0,a.int)(c.paddingRight)-(0,a.int)(l.marginRight),bottom:(0,r.innerHeight)(i)-(0,r.outerHeight)(s)-s.offsetTop+(0,a.int)(c.paddingBottom)-(0,a.int)(l.marginBottom)}}(0,a.isNum)(o.right)&&(t=Math.min(t,o.right));(0,a.isNum)(o.bottom)&&(n=Math.min(n,o.bottom));(0,a.isNum)(o.left)&&(t=Math.max(t,o.left));(0,a.isNum)(o.top)&&(n=Math.max(n,o.top))
2416return[t,n]},t.getControlPosition=function(e,t,n){const a="number"==typeof t?(0,r.getTouch)(e,t):null
2417if("number"==typeof t&&!a)return null
2418const o=i(n),s=n.props.offsetParent||o.offsetParent||o.ownerDocument.body
2419return(0,r.offsetXYFromParent)(a||e,s,n.props.scale)}
2419,t.snapToGrid=function(e,t,n){const a=Math.round(t/e[0])*e[0],r=Math.round(n/e[1])*e[1]
2420return[a,r]}
2421var a=n(75603),r=n(94008)
2422function i(e){const t=e.findDOMNode()
2423if(!t)throw new Error("<DraggableCore>: Unmounted during event!")
2424return t}},75603:(e,t)=>{"use strict"
2425Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let n=0,a=e.length;n<a;n++)if(t.apply(t,[e[n],n,e]))return e[n]},t.int=function(e){return parseInt(e,10)},t.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},t.isNum=function(e){return"number"==typeof e&&!isNaN(e)}},41871:(e,t,n)=>{"use strict"
2426n.d(t,{$k:()=>c})
2427var a=n(93497),r=n(52763),i={isHistory:e=>(0,a.Q)(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||r.I.isOperationList(e.redos[0].operations))&&(0===e.undos.length||r.I.isOperationList(e.undos[0].operations))},o=(new WeakMap,new WeakMap),s=new WeakMap,l={isHistoryEditor:e=>i.isHistory(e.history)&&r.KE.isEditor(e),isMerging:e=>s.get(e),isSaving:e=>o.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=l.isMerging(e)
2428s.set(e,!1),t(),s.set(e,n)},withoutSaving(e,t){var n=l.isSaving(e)
2429o.set(e,!1),t(),o.set(e,n)}},c=e=>{var t=e,{apply:n}=t
2430return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e
2431if(n.length>0){var a=n[n.length-1]
2432a.selectionBefore&&r.gB.setSelection(t,a.selectionBefore),l.withoutSaving(t,(()=>{r.KE.withoutNormalizing(t,(()=>{for(var e of a.operations)t.apply(e)}))})),e.redos.pop(),t.writeHistory("undos",a)}},t.undo=()=>{var{history:e}=t,{undos:n}=e
2433if(n.length>0){var a=n[n.length-1]
2434l.withoutSaving(t,(()=>{r.KE.withoutNormalizing(t,(()=>{var e=a.operations.map(r.I.inverse).reverse()
2435for(var n of e)t.apply(n)
2436a.selectionBefore&&r.gB.setSelection(t,a.selectionBefore)}))})),t.writeHistory("redos",a),e.undos.pop()}},t.apply=e=>{var{operations:a,history:r}=t,{undos:i}=r,o=i[i.length-1],s=o&&o.operations[o.operations.length-1],c=l.isSaving(t),p=l.isMerging(t)
2437if(null==c&&(c=d(e)),c){if(null==p&&(p=null!=o&&(0!==a.length||u(e,s))),o&&p)o.operations.push(e)
2438else{var h={operations:[e],selectionBefore:t.selection}
2439t.writeHistory("undos",h)}for(;i.length>100;)i.shift()
2440r.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t},u=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!r.wA.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!r.wA.equals(e.path,t.path)),d=(e,t)=>"set_selection"!==e.type},5473:(e,t,n)=>{"use strict"
2441n.d(t,{A:()=>V})
2442var a=n(80601),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}
2443const i="object"===r(window)&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType
2444var o=function(e,t){if(Array.isArray(e))return e
2445if(Symbol.iterator in Object(e))return function(e,t){var n=[],a=!0,r=!1,i=void 0
2446try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);a=!0);}catch(e){r=!0,i=e}finally{try{!a&&s.return&&s.return()}finally{if(r)throw i}}return n}(e,t)
2447throw new TypeError("Invalid attempt to destructure non-iterable instance")}
2448if(i){var s=!0,l=!1,c=void 0
2449try{for(var u,d=[["edge",/Edge\/([0-9\._]+)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)$/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+)\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["android",/Android\s([0-9\.]+)/],["safari",/Version\/([0-9\._]+).*Safari/]][Symbol.iterator]();!(s=(u=d.next()).done);s=!0){var p=u.value,h=o(p,2),g=h[0]
2450if(h[1].test(window.navigator.userAgent)){0
2451break}}}catch(e){l=!0,c=e}finally{try{!s&&d.return&&d.return()}finally{if(l)throw c}}}var f=void 0
2452if(i){var m=!0,v=!1,b=void 0
2453try{for(var y,x=[["ios",/os ([\.\_\d]+) like mac os/i],["macos",/mac os x/i],["android",/android/i],["firefoxos",/mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/i],["windows",/windows\s*(?:nt)?\s*([\.\_\d]+)/i]][Symbol.iterator]();!(m=(y=x.next()).done);m=!0){var C=y.value,D=o(C,2),w=D[0]
2454if(D[1].test(window.navigator.userAgent)){f=w
2455break}}}catch(e){v=!0,b=e}finally{try{!m&&x.return&&x.return()}finally{if(v)throw b}}}var A=[]
2456if(i){var E=!0,j=!1,B=void 0
2457try{for(var k,S=[["inputeventslevel1",function(e){return"inputType"in(e.InputEvent?new e.InputEvent("input"):{})}],["inputeventslevel2",function(e){var t=e.document.createElement("div")
2458return t.contentEditable=!0,"onbeforeinput"in t}]][Symbol.iterator]();!(E=(k=S.next()).done);E=!0){var N=k.value,F=o(N,2),O=F[0];(0,F[1])(window)&&A.push(O)}}catch(e){j=!0,B=e}finally{try{!E&&S.return&&S.return()}finally{if(j)throw B}}}var M=[[/^9([.]0|)/,28],[/^8[.]1/,27],[/^8([.]0|)/,26],[/^7[.]1/,25],[/^7([.]0|)/,24],[/^6([.]0|)/,23],[/^5[.]1/,22],[/^5([.]0|)/,21],[/^4[.]4/,20]]
2459var P="android"===f,T="ios"===f,I="macos"===f,R=function(){if("android"!==f)return null
2460var e=window.navigator.userAgent.match(/Android\s([0-9\.]+)/)
2461if(null==e)return null
2462var t=e[1],n=!0,a=!1,r=void 0
2463try{for(var i,s=M[Symbol.iterator]();!(n=(i=s.next()).done);
2463n=!0){var l=i.value,c=o(l,2),u=c[0],d=c[1]
2464if(t.match(u))return d}}catch(e){a=!0,r=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw r}}return null}(),L=(A.includes("inputeventslevel1"),A.includes("inputeventslevel2"),{bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z"}),_={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},$={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:"ctrl+y"},z={},W=T||I,U=!W;[].concat(Object.keys(L)).concat(Object.keys(_)).concat(Object.keys($)).forEach((function(e){var t="is"+e[0].toUpperCase()+e.slice(1)
2465if(!z[t]){var n=L[e],r=_[e],i=$[e],o=n&&(0,a.Sn)(n),s=r&&(0,a.Sn)(r),l=i&&(0,a.Sn)(i)
2466z[t]=function(e){return!(!o||!o(e))||(!!(W&&s&&s(e))||!!(U&&l&&l(e)))}}}))
2467const V=z},53835:(e,t,n)=>{"use strict"
2468n.d(t,{Fo:()=>gn,rL:()=>ct,A:()=>An,RV:()=>de,o$:()=>Sn})
2469var a=n(7157),r=n.n(a),i=n(9738),o=n.n(i),s=n(33005),l=n.n(s),c=n(48431)
2470const u=e=>"object"==typeof e&&null!=e&&1===e.nodeType,d=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,p=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null)
2471return d(n.overflowY,t)||d(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null
2472try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e)
2473return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},h=(e,t,n,a,r,i,o,s)=>i<e&&o>t||i>e&&o<t?0:i<=e&&s<=n||o>=t&&s>=n?i-e-a:o>t&&s<n||i<e&&s>n?o-t+r:0,g=e=>{const t=e.parentElement
2474return t??(e.getRootNode().host||null)},f=(e,t)=>{var n,a,r,i
2475if("undefined"==typeof document)return[]
2476const{scrollMode:o,block:s,inline:l,boundary:c,skipOverflowHiddenElements:d}=t,f="function"==typeof c?c:e=>e!==c
2477if(!u(e))throw new TypeError("Invalid target")
2478const m=document.scrollingElement||document.documentElement,v=[]
2479let b=e
2480for(;u(b)&&f(b);){if(b=g(b),b===m){v.push(b)
2481break}null!=b&&b===document.body&&p(b)&&!p(document.documentElement)||null!=b&&p(b,d)&&v.push(b)}const y=null!=(a=null==(n=window.visualViewport)?void 0:n.width)?a:innerWidth,x=null!=(i=null==(r=window.visualViewport)?void 0:r.height)?i:innerHeight,{scrollX:C,scrollY:D}=window,{height:w,width:A,top:E,right:j,bottom:B,left:k}=e.getBoundingClientRect(),{top:S,right:N,bottom:F,left:O}=(e=>{const t=window.getComputedStyle(e)
2482return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e)
2483let M="start"===s||"nearest"===s?E-S:"end"===s?B+F:E+w/2-S+F,P="center"===l?k+A/2-O+N:"end"===l?j+N:k-O
2484const T=[]
2485for(let e=0;e<v.length;e++){const t=v[e],{height:n,width:a,top:r,right:i,bottom:c,left:u}=t.getBoundingClientRect()
2486if("if-needed"===o&&E>=0&&k>=0&&B<=x&&j<=y&&E>=r&&B<=c&&k>=u&&j<=i)return T
2487const d=getComputedStyle(t),p=parseInt(d.borderLeftWidth,10),g=parseInt(d.borderTopWidth,10),f=parseInt(d.borderRightWidth,10),b=parseInt(d.borderBottomWidth,10)
2488let S=0,N=0
2489const F="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-f:0,O="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-b:0,I="offsetWidth"in t?0===t.offsetWidth?0:a/t.offsetWidth:0,R="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0
2490if(m===t)S="start"===s?M:"end"===s?M-x:"nearest"===s?h(D,D+x,x,g,b,D+M,D+M+w,w):M-x/2,N="start"===l?P:"center"===l?P-y/2:"end"===l?P-y:h(C,C+y,y,p,f,C+P,C+P+A,A),S=Math.max(0,S+D),N=Math.max(0,N+C)
2491else{S="start"===s?M-r-g:"end"===s?M-c+b+O:"nearest"===s?h(r,c,n,g,b+O,M,M+w,w):M-(r+n/2)+O/2,N="start"===l?P-u-p:"center"===l?P-(u+a/2)+F/2:"end"===l?P-i+f+F:h(u,i,a,p,f+F,P,P+A,A)
2492const{scrollLeft:e,scrollTop:o}=t
2493S=0===R?0:Math.max(0,Math.min(o+S/R,t.scrollHeight-n/R+O)),N=0===I?0:Math.max(0,Math.min(e+N/I,t.scrollWidth-a/I+F)),M+=o-S,P+=e-N}
2493T.push({el:t,top:S,left:N})}return T}
2494function m(e,t){if(!e.isConnected||!(e=>{let t=e
2495for(;t&&t.parentNode;){if(t.parentNode===document)return!0
2496t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return
2497const n=(e=>{const t=window.getComputedStyle(e)
2498return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e)
2499if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(f(e,t))
2500const a="boolean"==typeof t||null==t?void 0:t.behavior
2501for(const{el:r,top:i,left:o}of f(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=i-n.top+n.bottom,t=o-n.left+n.right
2502r.scroll({top:e,left:t,behavior:a})}}var v,b=n(52763),y=[],x="ResizeObserver loop completed with undelivered notifications."
2503!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(v||(v={}))
2504var C,D=function(e){return Object.freeze(e)},w=function(e,t){this.inlineSize=e,this.blockSize=t,D(this)},A=function(){function e(e,t,n,a){return this.x=e,this.y=t,this.width=n,this.height=a,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,D(this)}return e.prototype.toJSON=function(){var e=this
2505return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),E=function(e){return e instanceof SVGElement&&"getBBox"in e},j=function(e){if(E(e)){var t=e.getBBox(),n=t.width,a=t.height
2506return!n&&!a}var r=e,i=r.offsetWidth,o=r.offsetHeight
2507return!(i||o||e.getClientRects().length)},B=function(e){var t
2508if(e instanceof Element)return!0
2509var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView
2510return!!(n&&e instanceof n.Element)},k=window,S=new WeakMap,N=/auto|scroll/,F=/^tb|vertical/,O=/msie|trident/i.test(k.navigator&&k.navigator.userAgent),M=function(e){return parseFloat(e||"0")},P=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new w((n?t:e)||0,(n?e:t)||0)},T=D({devicePixelContentBoxSize:P(),borderBoxSize:P(),contentBoxSize:P(),contentRect:new A(0,0,0,0)}),I=function(e,t){if(void 0===t&&(t=!1),S.has(e)&&!t)return S.get(e)
2511if(j(e))return S.set(e,T),T
2512var n=getComputedStyle(e),a=E(e)&&e.ownerSVGElement&&e.getBBox(),r=!O&&"border-box"===n.boxSizing,i=F.test(n.writingMode||""),o=!a&&N.test(n.overflowY||""),s=!a&&N.test(n.overflowX||""),l=a?0:M(n.paddingTop),c=a?0:M(n.paddingRight),u=a?0:M(n.paddingBottom),d=a?0:M(n.paddingLeft),p=a?0:M(n.borderTopWidth),h=a?0:M(n.borderRightWidth),g=a?0:M(n.borderBottomWidth),f=d+c,m=l+u,v=(a?0:M(n.borderLeftWidth))+h,b=p+g,y=s?e.offsetHeight-b-e.clientHeight:0,x=o?e.offsetWidth-v-e.clientWidth:0,C=r?f+v:0,w=r?m+b:0,B=a?a.width:M(n.width)-C-x,k=a?a.height:M(n.height)-w-y,I=B+f+x+v,R=k+m+y+b,L=D({devicePixelContentBoxSize:P(Math.round(B*devicePixelRatio),Math.round(k*devicePixelRatio),i),borderBoxSize:P(I,R,i),contentBoxSize:P(B,k,i),contentRect:new A(d,l,B,k)})
2513return S.set(e,L),L},R=function(e,t,n){var a=I(e,n),r=a.borderBoxSize,i=a.contentBoxSize,o=a.devicePixelContentBoxSize
2514switch(t){case v.DEVICE_PIXEL_CONTENT_BOX:return o
2515case v.BORDER_BOX:return r
2516default:return i}},L=function(e){var t=I(e)
2517this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=D([t.borderBoxSize]),this.contentBoxSize=D([t.contentBoxSize]),this.devicePixelContentBoxSize=D([t.devicePixelContentBoxSize])},_=function(e){if(j(e))return 1/0
2518for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode
2519return t},$=function(){var e=1/0,t=[]
2520y.forEach((function(n){if(0!==n.activeTargets.length){var a=[]
2521n.activeTargets.forEach((function(t){var n=new L(t.target),r=_(t.target)
2522a.push(n),t.lastReportedSize=R(t.target,t.observedBox),r<e&&(e=r)})),t.push((function(){n.callback.call(n.observer,a,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}))
2523for(var n=0,a=t;n<a.length;n++){(0,a[n])()}return e}
2523,z=function(e){y.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(_(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},W=function(){var e,t=0
2524for(z(t);y.some((function(e){return e.activeTargets.length>0}));)t=$(),z(t)
2525return y.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:x}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=x),window.dispatchEvent(e)),t>0},U=[],V=function(e){if(!C){var t=0,n=document.createTextNode("")
2526new MutationObserver((function(){return U.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),C=function(){n.textContent="".concat(t?t--:t++)}}U.push(e),C()},H=0,K={attributes:!0,characterData:!0,childList:!0,subtree:!0},q=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],G=function(e){return void 0===e&&(e=0),Date.now()+e},Y=!1,J=new(function(){function e(){var e=this
2527this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this
2528if(void 0===e&&(e=250),!Y){Y=!0
2529var n,a=G(e)
2530n=function(){var n=!1
2531try{n=W()}finally{if(Y=!1,e=a-G(),!H)return
2532n?t.run(1e3):e>0?t.run(e):t.start()}},V((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,K)}
2533document.body?t():k.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this
2534this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),q.forEach((function(t){return k.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this
2535this.stopped||(this.observer&&this.observer.disconnect(),q.forEach((function(t){return k.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),X=function(e){!H&&e>0&&J.start(),!(H+=e)&&J.stop()},Q=function(){function e(e,t){this.target=e,this.observedBox=t||v.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=R(this.target,this.observedBox,!0)
2536return e=this.target,E(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break
2537case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Z=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},ee=new WeakMap,te=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n
2538return-1},ne=function(){function e(){}return e.connect=function(e,t){var n=new Z(e,t)
2539ee.set(e,n)},e.observe=function(e,t,n){var a=ee.get(e),r=0===a.observationTargets.length
2540te(a.observationTargets,t)<0&&(r&&y.push(a),a.observationTargets.push(new Q(t,n&&n.box)),X(1),J.schedule())},e.unobserve=function(e,t){var n=ee.get(e),a=te(n.observationTargets,t),r=1===n.observationTargets.length
2541a>=0&&(r&&y.splice(y.indexOf(n),1),n.observationTargets.splice(a,1),X(-1))},e.disconnect=function(e){var t=this,n=ee.get(e)
2542n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),ae=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.")
2543if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.")
2544ne.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.")
2545if(!B(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element")
2546ne.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.")
2547if(!B(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element")
2548ne.unobserve(this,e)},e.prototype.disconnect=function(){ne.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),re=n(90072),ie=n(71098)
2549function oe(e,t){if(null==e)return{}
2550var n,a,r=function(e,t){if(null==e)return{}
2551var n,a,r={},i=Object.keys(e)
2552for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n])
2553return r}(e,t)
2554if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e)
2555for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function se(e){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},se(e)}function le(e){var t=function(e,t){if("object"!==se(e)||null===e)return e
2556var n=e[Symbol.toPrimitive]
2557if(void 0!==n){var a=n.call(e,t||"default")
2558if("object"!==se(a))return a
2559throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string")
2560return"symbol"===se(t)?t:String(t)}function ce(e,t,n){return(t=le(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ue=(0,c.createContext)(null),de=()=>{var e=(0,c.useContext)(ue)
2561if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.")
2562return e},pe=parseInt(c.version.split(".")[0],10),he="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ge="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),fe="undefined"!=typeof navigator&&/Android/.test(navigator.userAgent),me="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ve="undefined"!=typeof navigator&&/AppleWeb
2562Kit(?!.*Chrome)/i.test(navigator.userAgent),be="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),ye="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),xe="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),Ce=fe&&"undefined"!=typeof navigator&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),De="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),we="undefined"!=typeof navigator&&/.*UCBrowser/.test(navigator.userAgent),Ae="undefined"!=typeof navigator&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent),Ee=!(void 0===window.document||void 0===window.document.createElement),je=(!xe||!Ce)&&!be&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,Be=new WeakMap,ke=new WeakMap,Se=new WeakMap,Ne=new WeakMap,Fe=new WeakMap,Oe=new WeakMap,Me=new WeakMap,Pe=new WeakMap,Te=new WeakMap,Ie=new WeakMap,Re=new WeakMap,Le=new WeakMap,_e=new WeakMap,$e=new WeakMap,ze=new WeakMap,We=new WeakMap,Ue=new WeakMap,Ve=new WeakMap,He=new WeakMap,Ke=new WeakMap,qe=new WeakMap,Ge=Symbol("placeholder"),Ye=Symbol("mark-placeholder"),Je=globalThis.Text,Xe=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,Qe=e=>Ze(e)&&1===e.nodeType,Ze=e=>{var t=Xe(e)
2563return!!t&&e instanceof t.Node},et=e=>{var t=e&&e.anchorNode&&Xe(e.anchorNode)
2564return!!t&&e instanceof t.Selection},tt=e=>
2564Ze(e)&&3===e.nodeType,nt=(e,t,n)=>{for(var a,{childNodes:r}=e,i=r[t],o=t,s=!1,l=!1;(Ze(a=i)&&8===a.nodeType||Qe(i)&&0===i.childNodes.length||Qe(i)&&"false"===i.getAttribute("contenteditable"))&&(!s||!l);)o>=r.length?(s=!0,o=t-1,n="backward"):o<0?(l=!0,o=t+1,n="forward"):(i=r[o],t=o,o+="forward"===n?1:-1)
2565return[i,t]},at=(e,t,n)=>{var[a]=nt(e,t,n)
2566return a},rt=e=>{var t=""
2567if(tt(e)&&e.nodeValue)return e.nodeValue
2568if(Qe(e)){for(var n of Array.from(e.childNodes))t+=rt(n)
2569var a=getComputedStyle(e).getPropertyValue("display")
2570"block"!==a&&"list"!==a&&"BR"!==e.tagName||(t+="\n")}return t},it=/data-slate-fragment="(.+?)"/m,ot=(e,t,n)=>{var{target:a}=t
2571if(Qe(a)&&a.matches('[contentEditable="false"]'))return!1
2572var{document:r}=ct.getWindow(e)
2573if(r.contains(a))return ct.hasDOMNode(e,a,{editable:!0})
2574var i=n.find((e=>{var{addedNodes:t,removedNodes:n}=e
2575for(var r of t)if(r===a||r.contains(a))return!0
2576for(var i of n)if(i===a||i.contains(a))return!0}))
2577return!(!i||i===t)&&ot(e,i,n)},st=0
2578class lt{constructor(){ce(this,"id",void 0),this.id="".concat(st++)}}var ct={androidPendingDiffs:e=>Ve.get(e),androidScheduleFlush:e=>{var t
2579null===(t=ze.get(e))||void 0===t||t()},blur:e=>{var t=ct.toDOMNode(e,e),n=ct.findDocumentOrShadowRoot(e)
2580Re.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=ct.findDocumentOrShadowRoot(e).getSelection()
2581n&&n.rangeCount>0&&n.removeAllRanges(),t&&b.gB.deselect(e)},findDocumentOrShadowRoot:e=>{var t=ct.toDOMNode(e,e),n=t.getRootNode()
2582return(n instanceof Document||n instanceof ShadowRoot)&&null!=n.getSelection?n:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent)
2583var{clientX:n,clientY:a,target:r}=t
2584if(null==n||null==a)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t))
2585var i,o=ct.toSlateNode(e,t.target),s=ct.findPath(e,o)
2586if(b.Hg.isElement(o)&&b.KE.isVoid(e,o)){var l=r.getBoundingClientRect(),c=e.isInline(o)?n-l.left<l.left+l.width-n:a-l.top<l.top+l.height-a,u=b.KE.point(e,s,{edge:c?"start":"end"}),d=c?b.KE.before(e,u):b.KE.after(e,u)
2587if(d)return b.KE.range(e,d)}var{document:p}=ct.getWindow(e)
2588if(p.caretRangeFromPoint)i=p.caretRangeFromPoint(n,a)
2589else{var h=p.caretPositionFromPoint(n,a)
2590h&&((i=p.createRange()).setStart(h.offsetNode,h.offset),i.setEnd(h.offsetNode,h.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t))
2591return ct.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},findKey:(e,t)=>{var n=Pe.get(t)
2592return n||(n=new lt,Pe.set(t,n)),n},findPath:(e,t)=>{for(var n=[],a=t;;){var r=ke.get(a)
2593if(null==r){if(b.KE.isEditor(a))return n
2594break}var i=Be.get(a)
2595if(null==i)break
2596n.unshift(i),a=r}throw new Error("Unable to find the path for Slate node: ".concat(b.h6.stringify(t)))},focus:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{retries:5}
2597if(!Re.get(e)){if(t.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations")
2598if(e.operations.length>0)setTimeout((()=>{ct.focus(e,{retries:t.retries-1})}),10)
2599else{var n=ct.toDOMNode(e,e),a=ct.findDocumentOrShadowRoot(e)
2600if(a.activeElement!==n){if(e.selection&&a instanceof Document){var r=a.getSelection(),i=ct.toDOMRange(e,e.selection)
2601null==r||r.removeAllRanges(),null==r||r.addRange(i)}e.selection||(b.gB.select(e,b.KE.start(e,[])),e.onChange()),Re.set(e,!0),n.focus({preventScroll:!0})}}}},getWindow:e=>{var t=Se.get(e)
2602if(!t)throw new Error("Unable to find a host window element for this editor")
2603return t},hasDOMNode:function(e,t){var n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{editable:r=!1}=a,i=ct.toDOMNode(e,e)
2604try{n=Qe(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!n&&!(n.closest("[data-slate-editor]")!==i||r&&!n.isContentEditable&&("boolean"!=typeof n.isContentEditable||n.closest('[contenteditable="false"]')!==i)&&!n.getAttribute("data-slate-zero-width"))},hasEditableTarget:(e,t)=>Ze(t)&&ct.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>
2604{var{anchor:n,focus:a}=t
2605return b.KE.hasPath(e,n.path)&&b.KE.hasPath(e,a.path)},hasSelectableTarget:(e,t)=>ct.hasEditableTarget(e,t)||ct.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>Ze(t)&&ct.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!Le.get(e),isFocused:e=>!!Re.get(e),isReadOnly:e=>!!Ie.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(Ie.get(e))return!1
2606var n=ct.hasTarget(e,t)&&ct.toSlateNode(e,t)
2607return b.Hg.isElement(n)&&b.KE.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n=Te.get(e),a=b.KE.isEditor(t)?Ne.get(e):null==n?void 0:n.get(ct.findKey(e,t))
2608if(!a)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(b.h6.stringify(t)))
2609return a},toDOMPoint:(e,t)=>{var n,[a]=b.KE.node(e,t.path),r=ct.toDOMNode(e,a)
2610b.KE.void(e,{at:t})&&(t={path:t.path,offset:0})
2611for(var i=Array.from(r.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),o=0,s=0;s<i.length;s++){var l=i[s],c=l.childNodes[0]
2612if(null!=c&&null!=c.textContent){var{length:u}=c.textContent,d=l.getAttribute("data-slate-length"),p=o+(null==d?u:parseInt(d,10)),h=i[s+1]
2613if(t.offset===p&&null!=h&&h.hasAttribute("data-slate-mark-placeholder")){var g,f=h.childNodes[0]
2614n=[f instanceof Je?f:h,null!==(g=h.textContent)&&void 0!==g&&g.startsWith("\ufeff")?1:0]
2615break}if(t.offset<=p){n=[c,Math.min(u,Math.max(0,t.offset-o))]
2616break}o=p}}if(!n)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(b.h6.stringify(t)))
2617return n},toDOMRange:(e,t)=>
2617{var{anchor:n,focus:a}=t,r=b.Q6.isBackward(t),i=ct.toDOMPoint(e,n),o=b.Q6.isCollapsed(t)?i:ct.toDOMPoint(e,a),s=ct.getWindow(e).document.createRange(),[l,c]=r?o:i,[u,d]=r?i:o,p=!!(Qe(l)?l:l.parentElement).getAttribute("data-slate-zero-width"),h=!!(Qe(u)?u:u.parentElement).getAttribute("data-slate-zero-width")
2618return s.setStart(l,p?1:c),s.setEnd(u,h?1:d),s},toSlateNode:(e,t)=>{var n=Qe(t)?t:t.parentElement
2619n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"))
2620var a=n?Oe.get(n):null
2621if(!a)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n))
2622return a},toSlatePoint:(e,t,n)=>{var{exactMatch:a,suppressThrow:r}=n,[i,o]=a?t:(e=>{var[t,n]=e
2623if(Qe(t)&&t.childNodes.length){var a=n===t.childNodes.length,r=a?n-1:n
2624for([t,r]=nt(t,r,a?"backward":"forward"),a=r<n;Qe(t)&&t.childNodes.length;){var i=a?t.childNodes.length-1:0
2625t=at(t,i,a?"backward":"forward")}n=a&&null!=t.textContent?t.textContent.length:0}return[t,n]})(t),s=i.parentNode,l=null,c=0
2626if(s){var u,d,p=ct.toDOMNode(e,e),h=s.closest('[data-slate-void="true"]'),g=h&&p.contains(h)?h:null,f=s.closest("[data-slate-leaf]"),m=null
2627if(f){if(l=f.closest('[data-slate-node="text"]')){var v=ct.getWindow(e).document.createRange()
2628v.setStart(l,0),v.setEnd(i,o)
2629var y=v.cloneContents();[...Array.prototype.slice.call(y.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(y.querySelectorAll("[contenteditable=false]"))].forEac
2629h((e=>{fe&&!a&&e.hasAttribute("data-slate-zero-width")&&e.textContent.length>0&&"\ufeff"!==e.textContext?e.textContent.startsWith("\ufeff")&&(e.textContent=e.textContent.slice(1)):e.parentNode.removeChild(e)})),c=y.textContent.length,m=l}}else if(g){for(var x=g.querySelectorAll("[data-slate-leaf]"),C=0;C<x.length;C++){var D=x[C]
2630if(ct.hasDOMNode(e,D)){f=D
2631break}}f?(l=f.closest('[data-slate-node="text"]'),c=(m=f).textContent.length,m.querySelectorAll("[data-slate-zero-width]").forEach((e=>{c-=e.textContent.length}))):c=1}m&&c===m.textContent.length&&fe&&"z"===m.getAttribute("data-slate-zero-width")&&null!==(u=m.textContent)&&void 0!==u&&u.startsWith("\ufeff")&&(s.hasAttribute("data-slate-zero-width")||me&&null!==(d=m.textContent)&&void 0!==d&&d.endsWith("\n\n"))&&c--}if(fe&&!l&&!a){var w=s.hasAttribute("data-slate-node")?s:s.closest("[data-slate-node]")
2632if(w&&ct.hasDOMNode(e,w,{editable:!0})){var A=ct.toSlateNode(e,w),{path:E,offset:j}=b.KE.start(e,ct.findPath(e,A))
2633return w.querySelector("[data-slate-leaf]")||(j=o),{path:E,offset:j}}}if(!l){if(r)return null
2634throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var B=ct.toSlateNode(e,l)
2635return{path:ct.findPath(e,B),offset:c}},toSlateRange:(e,t,n)=>{var a,r,i,o,s,l,c,{exactMatch:u,suppressThrow:d}=n
2636if(et(t)?t.anchorNode:t.startContainer)if(et(t)){if(me&&t.rangeCount>1){o=t.focusNode
2637var p=t.getRangeAt(0),h=t.getRangeAt(t.rangeCount-1)
2638if(o instanceof HTMLTableRowElement&&p.startContainer instanceof HTMLTableRowElement&&h.startContainer instanceof HTMLTableRowElement){function D(e){return e.childElementCount>0?D(e.children[0]):e}var g=p.startContainer,f=h.startContainer,m=D(g.children[p.startOffset]),v=D(f.children[h.startOffset])
2639s=0,r=v.childNodes.length>0?v.childNodes[0]:v,o=m.childNodes.length>0?m.childNodes[0]:m,i=v instanceof HTMLElement?v.innerHTML.length:0}else p.startContainer===o?(r=h.endContainer,i=h.endOffset,s=p.startOffset):(r=p.startContainer,i=p.endOffset,s=h.startOffset)}else r=t.anchorNode,i=t.anchorOffset,o=t.focusNode,s=t.focusOffset
2640l=ye&&(e=>{for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0
2641t=t.parentNode}return!1})(r)||me?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed}else r=t.startContainer,i=t.startOffset,o=t.endContainer,s=t.endOffset,l=t.collapsed
2642if(null==r||null==o||null==i||null==s)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));(me&&null!==(a=o.textContent)&&void 0!==a&&a.endsWith("\n\n")&&s===o.textContent.length&&s--,"getAttribute"in o&&"false"===o.getAttribute("contenteditable")&&"true"!==o.getAttribute("data-slate-void"))&&(o=r,s=(null===(c=r.textContent)||void 0===c?void 0:c.length)||0)
2643var y=ct.toSlatePoint(e,[r,i],{exactMatch:u,suppressThrow:d})
2644if(!y)return null
2645var x=l?y:ct.toSlatePoint(e,[o,s],{exactMatch:u,suppressThrow:d})
2646if(!x)return null
2647var C={anchor:y,focus:x}
2648return b.Q6.isExpanded(C)&&b.Q6.isForward(C)&&Qe(o)&&b.KE.void(e,{at:C.focus,mode:"highest"})&&(C=b.KE.unhangRange(e,C,{voids:!0})),C}}
2649function ut(e,t){var{path:n,diff:a}=t
2650if(!b.KE.hasPath(e,n))return!1
2651var r=b.bP.get(e,n)
2652if(!b.EY.isText(r))return!1
2653if(a.start!==r.text.length||0===a.text.length)return r.text.slice(a.start,a.start+a.text.length)===a.text
2654var i=b.wA.next(n)
2655if(!b.KE.hasPath(e,i))return!1
2656var o=b.bP.get(e,i)
2657return b.EY.isText(o)&&o.text.startsWith(a.text)}function dt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a]
2658return n.reduce(((e,t)=>e.slice(0,t.start)+t.text+e.slice(t.end)),e)}function pt(e,t){var{start:n,end:a,text:r}=t,i=e.slice(n,a),o=function(e,t){for(var n=Math.min(e.length,t.length),a=0;a<n;a++)if(e.charAt(a)!==t.charAt(a))return a
2659return n}(i,r),s=function(e,t,n){for(var a=Math.min(e.length,t.length,n),r=0;r<a;r++)if(e.charAt(e.length-r-1)!==t.charAt(t.length-r-1))return r
2660return a}(i,r,Math.min(i.length-o,r.length-o)),l={start:n+o,end:a-s,text:r.slice(o,r.length-s)}
2661return l.start===l.end&&0===l.text.length?null:l}function ht(e){var{path:t,diff:n}=e
2662return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function gt(e,t){var{path:n,offset:a}=t
2663if(!b.KE.hasPath(e,n))return null
2664var r=b.bP.get(e,n)
2665if(!b.EY.isText(r))return null
2666var i=b.KE.above(e,{match:t=>b.Hg.isElement(t)&&b.KE.isBlock(e,t),at:n})
2667if(!i)return null
2668for(;a>r.text.length;){var o=b.KE.next(e,{at:n,match:b.EY.isText})
2669if(!o||!b.wA.isDescendant(o[1],i[1]))return null
2670a-=r.text.length,r=o[0],n=o[1]}return{path:n,offset:a}}function ft(e,t){var n=gt(e,t.anchor)
2671if(!n)return null
2672if(b.Q6.isCollapsed(t))return{anchor:n,focus:n}
2673var a=gt(e,t.focus)
2674return a?{anchor:n,focus:a}:null}function mt(e,t,n){var a=Ve.get(e),r=null==a?void 0:a.find((e=>{var{path:n}=e
2675return b.wA.equals(n,t.path)}))
2676if(!r||t.offset<=r.diff.start)return b.bR.transform(t,n,{affinity:"backward"})
2677var{diff:i}=r
2678if(t.offset<=i.start+i.text.length){var o={path:t.path,offset:i.start},s=b.bR.transform(o,n,{affinity:"backward"})
2679return s?{path:s.path,offset:s.offset+t.offset-i.start}:null}var l={path:t.path,offset:t.offset-i.text.length+i.end-i.start},c=b.bR.transform(l,n,{affinity:"backward"})
2680return c?"split_node"===n.type&&b.wA.equals(n.path,t.path)&&l.offset<n.position&&i.start<n.position?c:{path:c.path,offset:c.offset+i.text.length-i.end+i.start}:null}function vt(e,t,n){var a=mt(e,t.anchor,n)
2681if(!a)return null
2682if(b.Q6.isCollapsed(t))return{anchor:a,focus:a}
2683var r=mt(e,t.focus,n)
2684return r?{anchor:a,focus:r}:null}function bt(e,t){var n=Object.keys(e)
2685if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
2686t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
2687t%2?bt(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:a}=e,r=!1,i=null,o=null,s=null,l=0,c=!1,u=()=>{var e=Ke.get(t)
2688if(Ke.delete(t),e){var{selection:n}=t,a=ft(t,e)
2689!a||n&&b.Q6.equals(a,n)||b.gB.select(t,a)}},d=()=>{if(o&&(clearTimeout(o),o=null),s&&(clearTimeout(s),s=null),m()||f()){r||(r=!0,setTimeout((()=>r=!1))),f()&&(r="action")
2690var e=t.selection&&b.KE.rangeRef(t,t.selection,{affinity:"forward"})
2691Ue.set(t,t.marks),He.get(t),Ve.get(t)
2692for(var i,l=m();i=null===(d=Ve.get(t))||void 0===d?void 0:d[0];){var d,p,h=We.get(t)
2693void 0!==h&&(We.delete(t),t.marks=h),h&&!1===c&&(c=null)
2694var g=ht(i)
2695t.selection&&b.Q6.equals(t.selection,g)||b.gB.select(t,g),i.diff.text?b.KE.insertText(t,i.diff.text):b.KE.deleteFragment(t),Ve.set(t,null===(p=Ve.get(t))||void 0===p?void 0:p.filter((e=>{var{id:t}=e
2696return t!==i.id}))),ut(t,i)||(l=!1,He.delete(t),Ue.delete(t),r="action",Ke.delete(t),n.cancel(),a.cancel(),null==e||e.unref())}var v=null==e?void 0:e.unref()
2697if(!v||Ke.get(t)||t.selection&&b.Q6.equals(v,t.selection)||b.gB.select(t,v),f())(()=>{var e=He.get(t)
2698if(He.delete(t),e){if(e.at){var n=b.bR.isPoint(e.at)?gt(t,e.at):ft(t,e.at)
2699if(!n)return
2700var a=b.KE.range(t,n)
2701t.selection&&b.Q6.equals(t.selection,a)||b.gB.select(t,n)}e.run()}})()
2702else{l&&n(),n.flush(),a.flush(),u()
2703var y=Ue.get(t)
2704Ue.delete(t),void 0!==y&&(t.marks=y,t.onChange())}}else u()},p=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Fe.get(t)
2705n&&(m()||e?n.style.display="none":n.style.removeProperty("display"))},h=(e,n)=>{var a,r=null!==(a=Ve.get(t))&&void 0!==a?a:[]
2706Ve.set(t,r)
2707var i=b.bP.leaf(t,e),o=r.findIndex((t=>b.wA.equals(t.path,e)))
2708if(o<0)return pt(i.text,n)&&r.push({path:e,diff:n,id:l++}),void p()
2709var s,c,u,d,h,g,f,m,v=(s=i.text,c=r[o].diff,u=n,d=Math.min(c.start,u.start),h=Math.max(0,Math.min(c.start+c.text.length,u.end)-u.start),g=dt(s,c,u),f=Math.max(u.start+u.text.length,c.start+c.text.length+(c.start+c.text.length>u.start?u.text.length:0)-h),m=g.slice(d,f),pt(s,{start:d,end:Math.max(c.end,u.end-c.text.length+(c.end-c.start)),text:m}))
2710if(!v)return r.splice(o,1),void p()
2711r[o]=yt(yt({},r[o]),{},{diff:v})},g=function(e){var{at:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
2712c=!1,Ke.delete(t),n.cancel(),a.cancel(),f()&&d(),He.set(t,{at:r,run:e}),s=setTimeout(d)},f=()=>!!He.get(t),m=()=>{var e
2713return!(null===(e=Ve.get(t))||void 0===e||!e.length)},v=e=>{Ke.set(t,e),o&&(clearTimeout(o),o=null)
2714var{selection:n}=t
2715if(e){var a=!n||!b.wA.equals(n.anchor.path,e.anchor.path),r=!n||!b.wA.equals(n.anchor.path.slice(0,-1),e.anchor.path.slice(0,-1));(a&&c||r)&&(c=!1),(a||m())&&(o=setTimeout(d,200))}},y=()=>{f()||(s=setTimeout(d))}
2716return{flush:d,scheduleFlush:y,hasPendingDiffs:m,hasPendingAction:f,hasPendingChanges:()=>f()||m(),isFlushing:()=>r,handleUserSelect:v,handleCompositionEnd:e=>{i&&clearTimeout(i),i=setTimeout((()=>{Le.set(t,!1),d()}),25)},handleCompositionStart:e=>{Le.set(t,!0),i&&(clearTimeout(i),i=null)},handleDOMBeforeInput:e=>{var n
2717o&&(clearTimeout(o),o=null)
2718var{inputType:a}=e,r=null,i=e.dataTransfer||e.data||void 0
2719!1!==c&&"insertText"!==a&&"insertCompositionText"!==a&&(c=!1)
2720var[s]=e.getTargetRanges()
2721s&&(r=ct.toSlateRange(t,s,{exactMatch:!1,suppressThrow:!0}))
2722var l=ct.getWindow(t).getSelection()
2723if(!r&&l&&(s=l,r=ct.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0})),r=null!==(n=r)&&void 0!==n?n:t.selection){var u,d=!0
2724if(a.startsWith("delete")){if(b.Q6.isExpanded(r)){var[p,f]=b.Q6.edges(r)
2725if(b.bP.leaf(t,p.path).text.length===p.offset&&0===f.offset){var m=b.KE.next(t,{at:p.path,match:b.EY.isText})
2726m&&b.wA.equals(m[1],f.path)&&(r={anchor:f,focus:f})}}var x=a.endsWith("Backward")?"backward":"forward",[C,D]=b.Q6.edges(r),[w,A]=b.KE.leaf(t,C.path),E={text:"",start:C.offset,end:D.offset},j=Ve.get(t),B=null==j?void 0:j.find((e=>b.wA.equals(e.path,A))),k=B?[B.diff,E]:[E]
2727if(0===dt(w.text,...k).length&&(d=!1),b.Q6.isExpanded(r)){if(d&&b.wA.equals(r.anchor.path,r.focus.path)){var S={path:r.anchor.path,offset:C.offset},N=b.KE.range(t,S,S)
2728return v(N),h(r.anchor.path,{text:"",end:D.offset,start:C.offset})}return g((()=>b.KE.deleteFragment(t,{direction:x})),{at:r})}}switch(a){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return g((()=>b.KE.deleteFragment(t)),{at:r})
2729case"deleteContent":case"deleteContentForward":var{anchor:F}=r
2730if(d&&b.Q6.isCollapsed(r)){var O=b.bP.leaf(t,F.path)
2731if(F.offset<O.text.length)return h(F.path,{text:"",start:F.offset,end:F.offset+1})}return g((()=>b.KE.deleteForward(t)),{at:r})
2732case"deleteContentBackward":var M,{anchor:P}=r,T=et(s)?s.isCollapsed:!(null===(M=s)||void 0===M||!M.collapsed)
2733return d&&T&&b.Q6.isCollapsed(r)&&P.offset>0?h(P.path,{text:"",start:P.offset-1,end:P.offset}):g((()=>b.KE.deleteBackward(t)),{at:r})
2734case"deleteEntireSoftLine":return g((()=>{b.KE.deleteBackward(t,{unit:"line"}),b.KE.deleteForward(t,{unit:"line"})}),{at:r})
2735case"deleteHardLineBackward":return g((()=>b.KE.deleteBackward(t,{unit:"block"})),{at:r})
2736case"deleteSoftLineBackward":return g((()=>b.KE.deleteBackward(t,{unit:"line"})),{at:r})
2737case"deleteHardLineForward":return g((()=>b.KE.deleteForward(t,{unit:"block"})),{at:r})
2738case"deleteSoftLineForward":return g((()=>b.KE.deleteForward(t,{unit:"line"})),{at:r})
2739case"deleteWordBackward":return g((()=>b.KE.deleteBackward(t,{unit:"word"})),{at:r})
2740case"deleteWordForward":return g((()=>b.KE.deleteForward(t,{unit:"word"})),{at:r})
2741case"insertLineBreak":return g((()=>b.KE.insertSoftBreak(t)),{at:r})
2742case"insertParagraph":return g((()=>b.KE.insertBreak(t)),{at:r})
2743case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("DataTransfer"===(null==(u=i)?void 0:u.constructor.name))return g((()=>ct.insertData(t,i)),{at:r})
2744var I=null!=i?i:""
2745if(We.get(t)&&(I=I.replace("\ufeff","")),"insertText"===a&&/.*\n.*\n$/.test(I)&&(I=I.slice(0,-1)),I.includes("\n"))return g((()=>{var e=I.split("\n")
2746e.forEach(((n,a)=>{n&&b.KE.insertText(t,n),a!==e.length-1&&b.KE.insertSoftBreak(t)}))}),{at:r})
2747if(b.wA.equals(r.anchor.path,r.focus.path)){var[R,L]=b.Q6.edges(r),_={start:R.offset,end:L.offset,text:I}
2748if(I&&c&&"insertCompositionText"===a){var $=c.start+c.text.search(/\S|$/)
2749_.start+_.text.search(/\S|$/)===$+1&&_.end===c.start+c.text.length?(_.start-=1,c=null,y()):c=!1}else c="insertText"===a&&(null===c?_:!(!c||!b.Q6.isCollapsed(r)||c.end+c.text.length!==R.offset)&&yt(yt({},c),{},{text:c.text+I}))
2750if(d)return void h(R.path,_)}return g((()=>b.KE.insertText(t,I)),{at:r})}}},handleKeyDown:e=>{m()||(p(!0),setTimeout(p))},handleDomMutations:e=>{var n
2751m()||f()||e.some((n=>ot(t,n,e)))&&(null===(n=qe.get(t))||void 0===n||n())},handleInput:()=>{!f()&&m()||d()}}}var Ct=Ee?c.useLayoutEffect:c.useEffect
2752var Dt=["node"]
2753function wt(e,t){var n=Object.keys(e)
2754if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
2755t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var At={subtree:!0,childList:!0,characterData:!0},Et=fe?e=>{var{node:t}=e,n=oe(e,Dt)
2756if(!fe)return null
2757var a,r=de(),i=(a=(0,c.useRef)(!1),(0,c.useEffect)((()=>(a.current=!0,()=>{a.current=!1})),[]),a.current),[o]=(0,c.useState)((()=>xt(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
2758t%2?wt(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({editor:r},n))))
2759return function(e,t,n){var[a]=(0,c.useState)((()=>new MutationObserver(t)))
2760Ct((()=>{a.takeRecords()})),(0,c.useEffect)((()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined")
2761return a.observe(e.current,n),()=>a.disconnect()}),[a,e,n])}(t,o.handleDomMutations,At),ze.set(r,o.scheduleFlush),i&&o.flush(),o}:()=>null,jt=["anchor","focus"],Bt=["anchor","focus"],kt=(e,t)=>{var n,a,r=oe(e,jt),i=oe(t,Bt)
2762return e[Ge]===t[Ge]&&(n=r,a=i,Object.keys(n).length===Object.keys(a).length&&Object.keys(n).every((e=>a.hasOwnProperty(e)&&n[e]===a[e])))}
2763function St(e,t){var n=Object.keys(e)
2764if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
2765t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var Nt=e=>{var{isLast:t,leaf:n,parent:a,text:r}=e,i=de(),o=ct.findPath(i,r),s=b.wA.parent(o),l=Boolean(n[Ye])
2766return i.isVoid(a)?c.createElement(Mt,{length:b.bP.string(a).length}):""!==n.text||a.children[a.children.length-1]!==r||i.isInline(a)||""!==b.KE.string(i,s)?""===n.text?c.createElement(Mt,{isMarkPlaceholder:l}):t&&"\n"===n.text.slice(-1)?c.createElement(Ft,{isTrailing:!0,text:n.text}):c.createElement(Ft,{text:n.text}):c.createElement(Mt,{isLineBreak:!0,isMarkPlaceholder:l})},Ft=e=>{var{text:t,isTrailing:n=!1}=e,a=(0,c.useRef)(null),r=()=>"".concat(null!=t?t:"").concat(n?"\n":""),[i]=(0,c.useState)(r)
2767return Ct((()=>{var e=r()
2768a.current&&a.current.textContent!==e&&(a.current.textContent=e)})),c.createElement(Ot,{ref:a},i)},Ot=(0,c.memo)((0,c.forwardRef)(((e,t)=>c.createElement("span",{"data-slate-string":!0,ref:t},e.children)))),Mt=e=>{var{length:t=0,isLineBreak:n=!1,isMarkPlaceholder:a=!1}=e,r={"data-slate-zero-width":n?"n":"z","data-slate-length":t}
2769return a&&(r["data-slate-mark-placeholder"]=!0),c.createElement("span",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
2770t%2?St(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r),fe&&n?null:"\ufeff",n?c.createElement("br",null):null)}
2771function Pt(e,t){var n=Object.keys(e)
2772if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
2773t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
2774t%2?Pt(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var It=fe?300:0
2775function Rt(e){e.current&&(clearTimeout(e.current),e.current=null)}var Lt=e=>{var{leaf:t,isLast:n,text:a,parent:r,renderPlaceholder:i,renderLeaf:o=e=>c.createElement($t,Tt({},e))}=e,s=de(),l=(0,c.useRef)(null),u=(0,c.useRef)(null),[d,p]=(0,c.useState)(!1),h=(0,c.useRef)(null),g=(0,c.useCallback)((e=>{if(function(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}(l,null==e),null==e){var n
2776Fe.delete(s),null===(n=t.onPlaceholderResize)||void 0===n||n.call(t,null)}else{if(Fe.set(s,e),!l.current){var a=window.ResizeObserver||ae
2777l.current=new a((()=>{var n
2778null===(n=t.onPlaceholderResize)||void 0===n||n.call(t,e)}))}l.current.observe(e),u.current=e}}),[u,t,s]),f=c.createElement(Nt,{isLast:n,leaf:t,parent:r,text:a}),m=Boolean(t[Ge])
2779if((0,c.useEffect)((()=>(m?h.current||(h.current=setTimeout((()=>{p(!0),h.current=null}),It)):(Rt(h),p(!1)),()=>Rt(h))),[m,p]),m&&d){var v={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:ve?"inherit":void 0},contentEditable:!1,ref:g}}
2780f=c.createElement(c.Fragment,null,i(v),f)}return o({attributes:{"data-slate-leaf":!0},children:f,leaf:t,text:a})},_t=c.memo(Lt,((e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&b.EY.equals(t.leaf,e.leaf)&&t.leaf[Ge]===e.leaf[Ge])),$t=e=>{var{attributes:t,children:n}=e
2781return c.createElement("span",Tt({},t),n)},zt=e=>{for(var{decorations:t,isLast:n,parent:a,renderPlaceholder:r,renderLeaf:i,text:o}=e,s=de(),l=(0,c.useRef)(null),u=b.EY.decorations(o,t),d=ct.findKey(s,o),p=[],h=0;h<u.length;h++){var g=u[h]
2782p.push(c.createElement(_t,{isLast:n&&h===u.length-1,key:"".concat(d.id,"-").concat(h),renderPlaceholder:r,leaf:g,text:o,parent:a,renderLeaf:i}))}var f=(0,c.useCallback)((e=>{var t=Te.get(s)
2783e?(null==t||t.set(d,e),Me.set(o,e),Oe.set(e,o)):(null==t||t.delete(d),Me.delete(o),l.current&&Oe.delete(l.current)),l.current=e}),[l,s,d,o])
2784return c.createElement("span",{"data-slate-node":"text",ref:f},p)},Wt=c.memo(zt,((e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&((e,t)=>{if(e.length!==t.length)return!1
2785for(var n=0;n<e.length;n++){var a=e[n],r=t[n]
2786if(a.anchor.offset!==r.anchor.offset||a.focus.offset!==r.focus.offset||!kt(a,r))return!1}return!0})(t.decorations,e.decorations)))
2787function Ut(e,t){var n=Object.keys(e)
2788if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
2789t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Vt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
2790t%2?Ut(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ht=e=>{var{decorations:t,element:n,renderElement:a=e=>c.createElement(qt,Vt({},e)),renderPlaceholder:i,renderLeaf:o,selection:s}=e,l=de(),u=Qt(),d=l.isInline(n),p=ct.findKey(l,n),h=(0,c.useCallback)((e=>{var t=Te.get(l)
2791e?(null==t||t.set(p,e),Me.set(n,e),Oe.set(e,n)):(null==t||t.delete(p),Me.delete(n))}),[l,p,n]),g=Jt({decorations:t,node:n,renderElement:a,renderPlaceholder:i,renderLeaf:o,selection:s}),f={"data-slate-node":"element",ref:h}
2792if(d&&(f["data-slate-inline"]=!0),!d&&b.KE.hasInlines(l,n)){var m=b.bP.string(n),v=r()(m)
2793"rtl"===v&&(f.dir=v)}if(b.KE.isVoid(l,n)){f["data-slate-void"]=!0,!u&&d&&(f.contentEditable=!1)
2794var y=d?"span":"div",[[x]]=b.bP.texts(n)
2795g=c.createElement(y,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},c.createElement(Wt,{renderPlaceholder:i,decorations:[],isLast:!1,parent:n,text:x})),Be.set(x,0),ke.set(x,n)}return a({attributes:f,children:g,element:n})},Kt=c.memo(Ht,((e,t)=>
2795e.element===t.element&&e.renderElement===t.renderElement&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&((e,t)=>{if(e.length!==t.length)return!1
2796for(var n=0;n<e.length;n++){var a=e[n],r=t[n]
2797if(!b.Q6.equals(a,r)||!kt(a,r))return!1}return!0})(e.decorations,t.decorations)&&(e.selection===t.selection||!!e.selection&&!!t.selection&&b.Q6.equals(e.selection,t.selection)))),qt=e=>{var{attributes:t,children:n,element:a}=e,r=de().isInline(a)?"span":"div"
2798return c.createElement(r,Vt(Vt({},t),{},{style:{position:"relative"}}),n)},Gt=(0,c.createContext)((()=>[])),Yt=(0,c.createContext)(!1),Jt=e=>{for(var{decorations:t,node:n,renderElement:a,renderPlaceholder:r,renderLeaf:i,selection:o}=e,s=(0,c.useContext)(Gt),l=de(),u=ct.findPath(l,n),d=[],p=b.Hg.isElement(n)&&!l.isInline(n)&&b.KE.hasInlines(l,n),h=0;h<n.children.length;h++){var g=u.concat(h),f=n.children[h],m=ct.findKey(l,f),v=b.KE.range(l,g),y=o&&b.Q6.intersection(v,o),x=s([f,g])
2799for(var C of t){var D=b.Q6.intersection(C,v)
2800D&&x.push(D)}b.Hg.isElement(f)?d.push(c.createElement(Yt.Provider,{key:"provider-".concat(m.id),value:!!y},c.createElement(Kt,{decorations:x,element:f,key:m.id,renderElement:a,renderPlaceholder:r,renderLeaf:i,selection:y}))):d.push(c.createElement(Wt,{decorations:x,key:m.id,isLast:p&&h===n.children.length-1,parent:n,renderPlaceholder:r,renderLeaf:i,text:f})),Be.set(f,h),ke.set(f,n)}return d},Xt=(0,c.createContext)(!1),Qt=()=>(0,c.useContext)(Xt),Zt=(0,c.createContext)(null)
2801var en={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},tn={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},nn={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},an=e=>{var t=en[e],n=tn[e],a=nn[e],r=t&&(0,re.v_)(t),i=n&&(0,re.v_)(n),o=a&&(0,re.v_)(a)
2802return e=>!(!r||!r(e))||(!!(ge&&i&&i(e))||!(ge||!o||!o(e)))},rn={isBold:an("bold"),isCompose:an("compose"),isMoveBackward:an("moveBackward"),isMoveForward:an("moveForward"),isDeleteBackward:an("deleteBackward"),isDeleteForward:an("deleteForward"),isDeleteLineBackward:an("deleteLineBackward"),isDeleteLineForward:an("deleteLineForward"),isDeleteWordBackward:an("deleteWordBackward"),isDeleteWordForward:an("deleteWordForward"),isExtendBackward:an("extendBackward"),isExtendForward:an("extendForward"),isExtendLineBackward:an("extendLineBackward"),isExtendLineForward:an("extendLineForward"),isItalic:an("italic"),isMoveLineBackward:an("moveLineBackward"),isMoveLineForward:an("moveLineForward"),isMoveWordBackward:an("moveWordBackward"),isMoveWordForward:an("moveWordForward"),isRedo:an("redo"),isSoftBreak:an("insertSoftBreak"),isSplitBlock:an("splitBlock"),isTransposeCharacter:an("transposeCharacter"),isUndo:an("undo")},on={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0}
2803class sn extends c.Component{constructor(){super(...arguments),ce(this,"context",null),ce(this,"manager",null),ce(this,"mutationObserver",null)}observe(){var e,{node:t}=this.props
2804if(!t.current)throw new Error("Failed to attach MutationObserver, `node` is undefined")
2805null===(e=this.mutationObserver)||void 0===e||e.observe(t.current,on)}componentDidMount(){var{receivedUserInput:e}=this.props,t=this.context
2806this.manager=((e,t)=>{var n=[],a=()=>{n=[]}
2807return{registerMutations:a=>{if(t.current){var r=a.filter((t=>ot(e,t,a)))
2808n.push(...r)}},restoreDOM:function(){n.length>
28080&&(n.reverse().forEach((e=>{"characterData"!==e.type&&(e.removedNodes.forEach((t=>{e.target.insertBefore(t,e.nextSibling)})),e.addedNodes.forEach((t=>{e.target.removeChild(t)})))})),a())},clear:a}})(t,e),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var e,t,n,a,r=null===(e=this.mutationObserver)||void 0===e?void 0:e.takeRecords()
2809null!=r&&r.length&&(null===(a=this.manager)||void 0===a||a.registerMutations(r))
2810return null===(t=this.mutationObserver)||void 0===t||t.disconnect(),null===(n=this.manager)||void 0===n||n.restoreDOM(),null}componentDidUpdate(){var e
2811null===(e=this.manager)||void 0===e||e.clear(),this.observe()}componentWillUnmount(){var e
2812null===(e=this.mutationObserver)||void 0===e||e.disconnect()}render(){return this.props.children}}ce(sn,"contextType",ue)
2813var ln=fe?sn:e=>{var{children:t}=e
2814return c.createElement(c.Fragment,null,t)},cn=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderLeaf","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],un=["text"]
2815function dn(e,t){var n=Object.keys(e)
2816if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
2817t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
2818t%2?dn(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hn=e=>c.createElement(c.Fragment,null,Jt(e)),gn=e=>{var t=(0,c.useCallback)((e=>c.createElement(fn,pn({},e))),[]),{autoFocus:n,decorate:a=mn,onDOMBeforeInput:i,placeholder:s,readOnly:u=!1,renderElement:d,renderLeaf:p,renderPlaceholder:h=t,scrollSelectionIntoView:g=vn,style:f={},as:m="div",disableDefaultStyles:v=!1}=e,y=oe(e,cn),x=(()=>{var e=(0,c.useContext)(Zt)
2819if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.")
2820var{editor:t}=e
2821return t})(),[C,D]=(0,c.useState)(!1),w=(0,c.useRef)(null),A=(0,c.useRef)([]),[E,j]=(0,c.useState)(),{onUserInput:B,receivedUserInput:k}=function(){var e=de(),t=(0,c.useRef)(!1),n=(0,c.useRef)(0),a=(0,c.useCallback)((()=>{if(!t.current){t.current=!0
2822var a=ct.getWindow(e)
2823a.cancelAnimationFrame(n.current),n.current=a.requestAnimationFrame((()=>{t.current=!1}))}}),[e])
2824return(0,c.useEffect)((()=>()=>cancelAnimationFrame(n.current)),[]),{receivedUserInput:t,onUserInput:a}}(),[,S]=(0,c.useReducer)((e=>e+1),0)
2825qe.set(x,S),Ie.set(x,u)
2826var N=(0,c.useMemo)((()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1})),[]);(0,c.useEffect)((()=>{w.current&&n&&w.current.focus()}),[n])
2827var F=(0,c.useRef)(),O=(0,c.useMemo)((()=>l()((()=>{var e=F.current
2828if((fe||!ct.isComposing(x))&&(!N.isUpdatingSelection||null!=e&&e.isFlushing())&&!N.isDraggingInternally){var t=ct.findDocumentOrShadowRoot(x),{activeElement:n}=t,a=ct.toDOMNode(x,x),r=t.getSelection()
2829if(n===a?(N.latestElement=n,Re.set(x,!0)):Re.delete(x),!r)return b.gB.deselect(x)
2830var{anchorNode:i,focusNode:o}=r,s=ct.hasEditableTarget(x,i)||ct.isTargetInsideNonReadonlyVoid(x,i),l=ct.hasEditableTarget(x,o)||ct.isTargetInsideNonReadonlyVoid(x,o)
2831if(s&&l){var c=ct.toSlateRange(x,r,{exactMatch:!1,suppressThrow:!0})
2832c&&(ct.isComposing(x)||null!=e&&e.hasPendingChanges()||null!=e&&e.isFlushing()?null==e||e.handleUserSelect(c):b.gB.select(x,c))}!u||s&&l||b.gB.deselect(x)}}),100)),[x,u,N]),M=(0,c.useMemo)((()=>o()(O,0)),[O])
2833F.current=Et({node:w,onDOMSelectionChange:O,scheduleOnDOMSelectionChange:M}),Ct((()=>{var e,t,n
2834w.current&&(n=Xe(w.current))?(Se.set(x,n),Ne.set(x,w.current),Me.set(x,w.current),Oe.set(w.current,x)):Me.delete(x)
2835var{selection:a}=x,r=ct.findDocumentOrShadowRoot(x).getSelection()
2836if(r&&ct.isFocused(x)&&(null===(e=F.current)||void 0===e||!e.hasPendingAction())){var i=e=>{var t="None"!==r.type
2837if(a||t){var n,i=r.focusNode
2838if(me&&r.rangeCount>1){var o=r.getRangeAt(0),s=r.getRangeAt(r.rangeCount-1)
2839n=o.startContainer===i?s.endContainer:o.startContainer}else n=r.anchorNode
2840var l=Ne.get(x),c=!1
2841if(l.contains(n)&&l.contains(i)&&(c=!0),t&&c&&a&&!e){var u=ct.toSlateRange(x,r,{exactMatch:!0,suppressThrow:!0})
2842if(u&&b.Q6.equals(u,a)){var d
2843if(!N.hasMarkPlaceholder)return
2844if(null!==(d=n)&&void 0!==d&&null!==(d=d.parentElement)&&void 0!==d&&d.hasAttribute("data-slate-mark-placeholder"))return}}if(!a||ct.hasRange(x,a)){N.isUpdatingSelection=!0
2845var p=a&&ct.toDOMRange(x,a)
2846return p?(ct.isComposing(x)&&!fe?r.collapseToEnd():b.Q6.isBackward(a)?r.setBaseAndExtent(p.endContainer,p.endOffset,p.startContainer,p.startOffset):r.setBaseAndExtent(p.startContainer,p.startOffset,p.endContainer,p.endOffset),g(x,p)):r.removeAllRanges(),p}x.selection=ct.toSlateRange(x,r,{exactMatch:!1,suppressThrow:!0})}}
2847r.rangeCount<=1&&i()
2848var o="action"===(null===(t=F.current)||void 0===t?void 0:t.isFlushing())
2849if(fe&&o){var s=null,l=requestAnimationFrame((()=>{if(o){var e=e=>{try{ct.toDOMNode(x,x).focus(),i(e)}catch(e){}}
2850e(),s=setTimeout((()=>{e(!0),N.isUpdatingSelection=!1}))}}))
2851return()=>{cancelAnimationFrame(l),s&&clearTimeout(s)}}setTimeout((()=>{N.isUpdatingSelection=!1}))}}))
2852var P=(0,c.useCallback)((e=>{if(B(),!u&&ct.hasEditableTarget(x,e.target)&&!xn(e,i)){var t
2853if(F.current)return F.current.handleDOMBeforeInput(e)
2854M.flush(),O.flush()
2855var{selection:n}=x,{inputType:a}=e,r=e.dataTransfer||e.data||void 0,o="insertCompositionText"===a||"deleteCompositionText"===a
2856if(o&&ct.isComposing(x))return
2857var s=!1
2858if("insertText"===a&&n&&b.Q6.isCollapsed(n)&&e.data&&1===e.data.length&&/[a-z ]/i.test(e.data)&&0!==n.anchor.offset){var l,c
2859s=!0,x.marks&&(s=!1)
2860var{anchor:d}=n,[p,h]=ct.toDOMPoint(x,d),g=null===(l=p.parentElement)||void 0===l?void 0:l.closest("a"),f=ct.getWindow(x)
2861if(s&&g&&ct.hasDOMNode(x,g)){var m,v=null==f?void 0:f.document.createTreeWalker(g,NodeFilter.SHOW_TEXT).lastChild()
2862v===p&&(null===(m=v.textContent)||void 0===m?void 0:m.length)===h&&(s=!1)}if(s&&p.parentElement&&"pre"===(null==f||null===(c=f.getComputedStyle(p.parentElement))||void 0===c?void 0:c.whiteSpace)){var y=b.KE.above(x,{at:d.path,match:e=>b.Hg.isElement(e)&&b.KE.isBlock(x,e)})
2863y&&b.bP.string(y[0]).includes("\t")&&(s=!1)}}if(!a.startsWith("delete")||a.startsWith("deleteBy")){var[C]=e.getTargetRanges()
2864if(C){var w=ct.toSlateRange(x,C,{exactMatch:!1,suppressThrow:!1})
2865if(!n||!b.Q6.equals(n,w)){s=!1
2866var E=!o&&x.selection&&b.KE.rangeRef(x,x.selection)
2867b.gB.select(x,w),E&&_e.set(x,E)}}}if(o)return
2868if(s||e.preventDefault(),n&&b.Q6.isExpanded(n)&&a.startsWith("delete")){var j=a.endsWith("Backward")?"backward":"forward"
2869return void b.KE.deleteFragment(x,{direction:j})}switch(a){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":b.KE.deleteFragment(x)
2870break
2871case"deleteContent":case"deleteContentForward":b.KE.deleteForward(x)
2872break
2873case"deleteContentBackward":b.KE.deleteBackward(x)
2874break
2875case"deleteEntireSoftLine":b.KE.deleteBackward(x,{unit:"line"}),b.KE.deleteForward(x,{unit:"line"})
2876break
2877case"deleteHardLineBackward":b.KE.deleteBackward(x,{unit:"block"})
2878break
2879case"deleteSoftLineBackward":b.KE.deleteBackward(x,{unit:"line"})
2880break
2881case"deleteHardLineForward":b.KE.deleteForward(x,{unit:"block"})
2882break
2883case"deleteSoftLineForward":b.KE.deleteForward(x,{unit:"line"})
2884break
2885case"deleteWordBackward":b.KE.deleteBackward(x,{unit:"word"})
2886break
2887case"deleteWordForward":b.KE.deleteForward(x,{unit:"word"})
2888break
2889case"insertLineBreak":b.KE.insertSoftBreak(x)
2890break
2891case"insertParagraph":b.KE.insertBreak(x)
2892break
2893case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":"insertFromComposition"===a&&ct.isComposing(x)&&(D(!1),Le.set(x,!1)),"DataTransfer"===(null==r?void 0:r.constructor.name)?ct.insertData(x,r):"string"==typeof r&&(s?A.current.push((()=>b.KE.insertText(x,r))):b.KE.insertText(x,r))}var k=null===(t=_e.get(x))||void 0===t?void 0:t.unref()
2894_e.delete(x),!k||x.selection&&b.Q6.equals(x.selection,k)||b.gB.select(x,k)}}),[x,O,B,i,u,M]),T=(0,c.useCallback)((e=>{null==e?(O.cancel(),M.cancel(),Ne.delete(x),Me.delete(x),w.current&&je&&w.current.removeEventListener("beforeinput",P)):je&&e.addEventListener("beforeinput",P),w.current=e}),[O,M,x,P])
2895Ct((()=>{var e=ct.getWindow(x)
2896return e.document.addEventListener("selectionchange",M),()=>{e.document.removeEventListener("selectionchange",M)}}),[M])
2897var I=a([x,[]]),R=s&&1===x.children.length&&1===Array.from(b.bP.texts(x)).length&&""===b.bP.string(x)&&!C,L=(0,c.useCallback)((e=>{var t
2898e&&R?j(null===(t=e.getBoundingClientRect())||void 0===t?void 0:t.height):j(void 0)}),[R])
2899if(R){var _=b.KE.start(x,[])
2900I.push({[Ge]:!0,placeholder:s,onPlaceholderResize:L,anchor:_,focus:_})}var{marks:$}=x
2901if(N.hasMarkPlaceholder=!1,x.selection&&b.Q6.isCollapsed(x.selection)&&$){var{anchor:z}=x.selection,W=b.bP.leaf(x,z.path),U=oe(W,un)
2902if(!b.EY.equals(W,$,{loose:!0})){N.hasMarkPlaceholder=!0
2903var V=Object.fromEntries(Object.keys(U).map((e=>[e,null])))
2904I.push(pn(pn(pn({[Ye]:!0},V),$),{},{anchor:z,focus:z}))}}return(0,c.useEffect)((()=>{setTimeout((()=>{var{selection:e}=x
2905if(e){var{anchor:t}=e,n=b.bP.leaf(x,t.path)
2906if($&&!b.EY.equals(n,$,{loose:!0}))return void We.set(x,$)}We.delete(x)}))})),c.createElement(Xt.Provider,{value:u},c.createElement(Gt.Provider,{value:a},c.createElement(ln,{node:w,receivedUserInput:k},c.createElement(m,pn(pn({role:u?void 0:"textbox","aria-multiline":!u||void 0},y),{},{spellCheck:!(!je&&Ee)&&y.spellCheck,autoCorrect:je||!Ee?y.autoCorrect:"false",autoCapitalize:je||!Ee?y.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!u,zindex:-1,suppressContentEditableWarning:!0,ref:T,style:pn(pn({},v?{}:pn({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},E?{minHeight:E}:{})),f),onBeforeInput:(0,c.useCallback)((e=>{if(!je&&!u&&!bn(e,y.onBeforeInput)&&ct.hasSelectableTarget(x,e.target)&&(e.preventDefault(),!ct.isComposing(x))){var t=e.data
2907b.KE.insertText(x,t)}}),[y.onBeforeInput,x,u]),onInput:(0,c.useCallback)((e=>{if(!bn(e,y.onInput))if(F.current)F.current.handleInput()
2908else{for(var t of A.current)t()
2909A.current=[]}}),[y.onInput]),onBlur:(0,c.useCallback)((e=>{if(!u&&!N.isUpdatingSelection&&ct.hasSelectableTarget(x,e.target)&&!bn(e,y.onBlur)){var t=ct.findDocumentOrShadowRoot(x)
2910if(N.latestElement!==t.activeElement){var{relatedTarget:n}=e
2911if(!(n===ct.toDOMNode(x,x)||Qe(n)&&n.hasAttribute("data-slate-spacer"))){if(null!=n&&Ze(n)&&ct.hasDOMNode(x,n)){var a=ct.toSlateNode(x,n)
2912if(b.Hg.isElement(a)&&!x.isVoid(a))return}if(ve){var r=t.getSelection()
2913null==r||r.removeAllRanges()}Re.delete(x)}}}}),[u,N.isUpdatingSelection,N.latestElement,x,y.onBlur]),onClick:(0,c.useCallback)((e=>{if(ct.hasTarget(x,e.target)&&!bn(e,y.onClick)&&Ze(e.target)){var t=ct.toSlateNode(x,e.target),n=ct.findPath(x,t)
2914if(!b.KE.hasPath(x,n)||b.bP.get(x,n)!==t)return
2915if(3===e.detail&&n.length>=1){var a=n
2916if(!b.Hg.isElement(t)||!b.KE.isBlock(x,t)){var r,i=b.KE.above(x,{match:e=>b.Hg.isElement(e)&&b.KE.isBlock(x,e),at:n})
2917a=null!==(r=null==i?void 0:i[1])&&void 0!==r?r:n.slice(0,1)}var o=b.KE.range(x,a)
2918return void b.gB.select(x,o)}if(u)return
2919var s=b.KE.start(x,n),l=b.KE.end(x,n),c=b.KE.void(x,{at:s}),d=b.KE.void(x,{at:l})
2920if(c&&d&&b.wA.equals(c[1],d[1])){var p=b.KE.range(x,s)
2921b.gB.select(x,p)}}}),[x,y.onClick,u]),onCompositionEnd:(0,c.useCallback)((e=>{if(ct.hasSelectableTarget(x,e.target)){var t
2922if(ct.isComposing(x)&&Promise.resolve().then((()=>{D(!1),Le.set(x,!1)})),null===(t=F.current)||void 0===t||t.handleCompositionEnd(e),bn(e,y.onCompositionEnd)||fe)return
2923if(!ve&&!De&&!he&&!Ae&&!we&&e.data){var n=We.get(x)
2924We.delete(x),void 0!==n&&(Ue.set(x,x.marks),x.marks=n),b.KE.insertText(x,e.data)
2925var a=Ue.get(x)
2926Ue.delete(x),void 0!==a&&(x.marks=a)}}}),[y.onCompositionEnd,x]),onCompositionUpdate:(0,c.useCallback)((e=>{ct.hasSelectableTarget(x,e.target)&&!bn(e,y.onCompositionUpdate)&&(ct.isComposing(x)||(D(!0),Le.set(x,!0)))}),[y.onCompositionUpdate,x]),onCompositionStart:(0,c.useCallback)((e=>{if(ct.hasSelectableTarget(x,e.target)){var t
2927if(null===(t=F.current)||void 0===t||t.handleCompositionStart(e),bn(e,y.onCompositionStart)||fe)return
2928D(!0)
2929var{selection:n}=x
2930if(n&&b.Q6.isExpanded(n))return void b.KE.deleteFragment(x)}}),[y.onCompositionStart,x]),onCopy:(0,c.useCallback)((e=>{!ct.hasSelectableTarget(x,e.target)||bn(e,y.onCopy)||yn(e)||(e.preventDefault(),ct.setFragmentData(x,e.clipboardData,"copy"))}),[y.onCopy,x]),onCut:(0,c.useCallback)((e=>{if(!u&&ct.hasSelectableTarget(x,e.target)&&!bn(e,y.onCut)&&!yn(e)){e.preventDefault(),ct.setFragmentData(x,e.clipboardData,"cut")
2931var{selection:t}=x
2932if(t)if(b.Q6.isExpanded(t))b.KE.deleteFragment(x)
2933else{var n=b.bP.parent(x,t.anchor.path)
2934b.KE.isVoid(x,n)&&b.gB.delete(x)}}}),[u,x,y.onCut]),onDragOver:(0,c.useCallback)((e=>{if(ct.hasTarget(x,e.target)&&!bn(e,y.onDragOver)){var t=ct.toSlateNode(x,e.target)
2935b.Hg.isElement(t)&&b.KE.isVoid(x,t)&&e.preventDefault()}}),[y.onDragOver,x]),onDragStart:(0,c.useCallback)((e=>{if(!u&&ct.hasTarget(x,e.target)&&!bn(e,y.onDragStart)){var t=ct.toSlateNode(x,e.target),n=ct.findPath(x,t)
2936if(b.Hg.isElement(t)&&b.KE.isVoid(x,t)||b.KE.void(x,{at:n,voids:!0})){var a=b.KE.range(x,n)
2937b.gB.select(x,a)}N.isDraggingInternally=!0,ct.setFragmentData(x,e.dataTransfer,"drag")}}),[u,x,y.onDragStart,N]),onDrop:(0,c.useCallback)((e=>{if(!u&&ct.hasTarget(x,e.target)&&!bn(e,y.onDrop)){e.preventDefault()
2938var t=x.selection,n=ct.findEventRange(x,e),a=e.dataTransfer
2939b.gB.select(x,n),N.isDraggingInternally&&(!t||b.Q6.equals(t,n)||b.KE.void(x,{at:n,voids:!0})||b.gB.delete(x,{at:t})),ct.insertData(x,a),ct.isFocused(x)||ct.focus(x)}N.isDraggingInternally=!1}),[u,x,y.onDrop,N]),onDragEnd:(0,c.useCallback)((e=>{!u&&N.isDraggingInternally&&y.onDragEnd&&ct.hasTarget(x,e.target)&&y.onDragEnd(e),N.isDraggingInternally=!1}),[u,N,y,x]),onFocus:(0,c.useCallback)((e=>{if(!u&&!N.isUpdatingSelection&&ct.hasEditableTarget(x,e.target)&&!bn(e,y.onFocus)){var t=ct.toDOMNode(x,x),n=ct.findDocumentOrShadowRoot(x)
2940if(N.latestElement=n.activeElement,me&&e.target!==t)return void t.focus()
2941Re.set(x,!0)}}),[u,N,x,y.onFocus]),onKeyDown:(0,c.useCallback)((e=>{if(!u&&ct.hasEditableTarget(x,e.target)){var t
2942null===(t=F.current)||void 0===t||t.handleKeyDown(e)
2943var{nativeEvent:n}=e
2944if(ct.isComposing(x)&&!1===n.isComposing&&(Le.set(x,!1),D(!1)),bn(e,y.onKeyDown)||ct.isComposing(x))return
2945var{selection:a}=x,i=x.children[null!==a?a.focus.path[0]:0],o="rtl"===r()(b.bP.string(i))
2946if(rn.isRedo(n)){e.preventDefault()
2947var s=x
2948return void("function"==typeof s.redo&&s.redo())}if(rn.isUndo(n)){e.preventDefault()
2949var l=x
2950return void("function"==typeof l.undo&&l.undo())}if(rn.isMoveLineBackward(n))return e.preventDefault(),void b.gB.move(x,{unit:"line",reverse:!0})
2951if(rn.isMoveLineForward(n))return e.preventDefault(),void b.gB.move(x,{unit:"line"})
2952if(rn.isExtendLineBackward(n))return e.preventDefault(),void b.gB.move(x,{unit:"line",edge:"focus",reverse:!0})
2953if(rn.isExtendLineForward(n))return e.preventDefault(),void b.gB.move(x,{unit:"line",edge:"focus"})
2954if(rn.isMoveBackward(n))return e.preventDefault(),void(a&&b.Q6.isCollapsed(a)?b.gB.move(x,{reverse:!o}):b.gB.collapse(x,{edge:o?"end":"start"}))
2955if(rn.isMoveForward(n))return e.preventDefault(),void(a&&b.Q6.isCollapsed(a)?b.gB.move(x,{reverse:o}):b.gB.collapse(x,{edge:o?"start":"end"}))
2956if(rn.isMoveWordBackward(n))return e.preventDefault(),a&&b.Q6.isExpanded(a)&&b.gB.collapse(x,{edge:"focus"}),void b.gB.move(x,{unit:"word",reverse:!o})
2957if(rn.isMoveWordForward(n))return e.preventDefault(),a&&b.Q6.isExpanded(a)&&b.gB.collapse(x,{edge:"focus"}),void b.gB.move(x,{unit:"word",reverse:o})
2958if(je){if((ye||ve)&&a&&(rn.isDeleteBackward(n)||rn.isDeleteForward(n))&&b.Q6.isCollapsed(a)){var c=b.bP.parent(x,a.anchor.path)
2959if(b.Hg.isElement(c)&&b.KE.isVoid(x,c)&&(b.KE.isInline(x,c)||b.KE.isBlock(x,c)))return e.preventDefault(),void b.KE.deleteBackward(x,{unit:"block"})}}else{if(rn.isBold(n)||rn.isItalic(n)||rn.isTransposeCharacter(n))return void e.preventDefault()
2960if(rn.isSoftBreak(n))return e.preventDefault(),void b.KE.insertSoftBreak(x)
2961if(rn.isSplitBlock(n))return e.preventDefault(),void b.KE.insertBreak(x)
2962if(rn.isDeleteBackward(n))return e.preventDefault(),void(a&&b.Q6.isExpanded(a)?b.KE.deleteFragment(x,{direction:"backward"}):b.KE.deleteBackward(x))
2963if(rn.isDeleteForward(n))return e.preventDefault(),void(a&&b.Q6.isExpanded(a)?b.KE.deleteFragment(x,{direction:"forward"}):b.KE.deleteForward(x))
2964if(rn.isDeleteLineBackward(n))return e.preventDefault(),void(a&&b.Q6.isExpanded(a)?b.KE.deleteFragment(x,{direction:"backward"}):b.KE.deleteBackward(x,{unit:"line"}))
2965if(rn.isDeleteLineForward(n))return e.preventDefault(),void(a&&b.Q6.isExpanded(a)?b.KE.deleteFragment(x,{direction:"forward"}):b.KE.deleteForward(x,{unit:"line"}))
2966if(rn.isDeleteWordBackward(n))return e.preventDefault(),void(a&&b.Q6.isExpanded(a)?b.KE.deleteFragment(x,{direction:"backward"}):b.KE.deleteBackward(x,{unit:"word"}))
2967if(rn.isDeleteWordForward(n))return e.preventDefault(),void(a&&b.Q6.isExpanded(a)?b.KE.deleteFragment(x,{direction:"forward"}):b.KE.deleteForward(x,{unit:"word"}))}}}),[u,x,y.onKeyDown]),onPaste:(0,c.useCallback)((e=>{u||!ct.hasEditableTarget(x,e.target)||bn(e,y.onPaste)||(!je||(e=>e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length)(e.nativeEvent)||ve)&&(e.preventDefault(),ct.insertData(x,e.clipboardData))}),[u,x,y.onPaste])}),c.createElement(hn,{decorations:I,node:x,renderElement:d,renderPlaceholder:h,renderLeaf:p,selection:x.selection})))))},fn=e=>{var{attributes:t,children:n}=e
2968return c.createElement("span",pn({},t),n,fe&&c.createElement("br",null))},mn=()=>[],vn=(e,t)=>{if(t.getBoundingClientRect&&(!e.selection||e.selection&&b.Q6.isCollapsed(e.selection))){var n=t.startContainer.parentElement
2969n.getBoundingClientRect=t.getBoundingClientRect.bind(t),m(n,{scrollMode:"if-needed"}),delete n.getBoundingClientRect}},bn=(e,t)=>{if(!t)return!1
2970var n=t(e)
2971return null!=n?n:e.isDefaultPrevented()||e.isPropagationStopped()},yn=e=>Ze(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),xn=(e,t)=>{if(!t)return!1
2972var n=t(e)
2973return null!=n?n:e.defaultPrevented},Cn=(0,c.createContext)(!1)
2974var Dn=(0,c.createContext)({})
2975var wn=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],An=e=>{var{editor:t,children:n,onChange:a,onSelectionChange:r,onValueChange:i,initialValue:o}=e,s=oe(e,wn),[l,u]=c.useState((()=>{if(!b.bP.isNodeList(o))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(b.h6.stringify(o)))
2976if(!b.KE.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(b.h6.stringify(t)))
2977return t.children=o,Object.assign(t,s),{v:0,editor:t}})),{selectorContext:d,onChange:p}=function(e){var t=(0,c.useRef)([]).current,n=(0,c.useRef)({editor:e}).current,a=(0,c.useCallback)((e=>{n.editor=e,t.forEach((t=>t(e)))}),[t,n])
2978return{selectorContext:(0,c.useMemo)((()=>({getSlate:()=>n.editor,addEventListener:e=>(t.push(e),()=>{t.splice(t.indexOf(e),1)})})),[t,n]),onChange:a}}(t),h=(0,c.useCallback)((e=>{var n
2979if(a&&a(t.children),"set_selection"===(null==e||null===(n=e.operation)||void 0===n?void 0:n.type))null==r||r(t.selection)
2980else null==i||i(t.children)
2981u((e=>({v:e.v+1,editor:t}))),p(t)}),[t,p,a,r,i]);(0,c.useEffect)((()=>($e.set(t,h),()=>{$e.set(t,(()=>{}))})),[t,h])
2982var[g,f]=(0,c.useState)(ct.isFocused(t))
2983return(0,c.useEffect)((()=>{f(ct.isFocused(t))}),[t]),Ct((()=>{var e=()=>f(ct.isFocused(t))
2984return pe>=17?(document.addEventListener("focusin",e),document.addEventListener("focusout",e),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",e)}):(document.addEventListener("focus",e,!0),document.addEventListener("blur",e,!0),()=>{document.removeEventListener("focus",e,!0),document.removeEventListener("blur",e,!0)})}),[]),c.createElement(Dn.Provider,{value:d},c.createElement(Zt.Provider,{value:l},c.createElement(ue.Provider,{value:l.editor},c.createElement(Cn.Provider,{value:g},n))))},En=(e,t)=>{var n=(t.top+t.bottom)/2
2985return e.top<=n&&e.bottom>=n},jn=(e,t,n)=>{var a=ct.toDOMRange(e,t).getBoundingClientRect(),r=ct.toDOMRange(e,n).getBoundingClientRect()
2986return En(a,r)&&En(r,a)}
2987function Bn(e,t){var n=Object.keys(e)
2988if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
2989t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function kn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
2990t%2?Bn(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x-slate-fragment",n=e,{apply:a,onChange:r,deleteBackward:i,addMark:o,removeMark:s}=n
2991return Te.set(n,new WeakMap),n.addMark=(e,t)=>{var a,r
2992null===(a=ze.get(n))||void 0===a||a(),!We.get(n)&&null!==(r=Ve.get(n))&&void 0!==r&&r.length&&We.set(n,null),Ue.delete(n),o(e,t)},n.removeMark=e=>{var t
2993!We.get(n)&&null!==(t=Ve.get(n))&&void 0!==t&&t.length&&We.set(n,null),Ue.delete(n),s(e)},n.deleteBackward=e=>{if("line"!==e)return i(e)
2994if(n.selection&&b.Q6.isCollapsed(n.selection)){var t=b.KE.above(n,{match:e=>b.Hg.isElement(e)&&b.KE.isBlock(n,e),at:n.selection})
2995if(t){var[,a]=t,r=b.KE.range(n,a,n.selection.anchor),o=((e,t)=>{var n=b.KE.range(e,b.Q6.end(t)),a=Array.from(b.KE.positions(e,{at:t})),r=0,i=a.length,o=Math.floor(i/2)
2996if(jn(e,b.KE.range(e,a[r]),n))return b.KE.range(e,a[r],n)
2997if(a.length<2)return b.KE.range(e,a[a.length-1],n)
2998for(;o!==a.length&&o!==r;)jn(e,b.KE.range(e,a[o]),n)?i=o:r=o,o=Math.floor((r+i)/2)
2999return b.KE.range(e,a[i],n)})(n,r)
3000b.Q6.isCollapsed(o)||b.gB.delete(n,{at:o})}}},n.apply=t=>{var r=[],i=[],o=Ve.get(n)
3001if(null!=o&&o.length){var s=o.map((e=>function(e,t){var{path:n,diff:a,id:r}=e
3002switch(t.type){case"insert_text":return!b.wA.equals(t.path,n)||t.offset>=a.end?e:t.offset<=a.start?{diff:{start:t.text.length+a.start,end:t.text.length+a.end,text:a.text},id:r,path:n}:{diff:{start:a.start,end:a.end+t.text.length,text:a.text},id:r,path:n}
3003case"remove_text":return!b.wA.equals(t.path,n)||t.offset>=a.end?e:t.offset+t.text.length<=a.start?{diff:{start:a.start-t.text.length,end:a.end-t.text.length,text:a.text},id:r,path:n}:{diff:{start:a.start,end:a.end-t.text.length,text:a.text},id:r,path:n}
3004case"split_node":return!b.wA.equals(t.path,n)||t.position>=a.end?{diff:a,id:r,path:b.wA.transform(n,t,{affinity:"backward"})}:t.position>a.start?{diff:{start:a.start,end:Math.min(t.position,a.end),text:a.text},id:r,path:n}:{diff:{start:a.start-t.position,end:a.end-t.position,text:a.text},id:r,path:b.wA.transform(n,t,{affinity:"forward"})}
3005case"merge_node":return b.wA.equals(t.path,n)?{diff:{start:a.start+t.position,end:a.end+t.position,text:a.text},id:r,path:b.wA.transform(n,t)}:{diff:a,id:r,path:b.wA.transform(n,t)}}var i=b.wA.transform(n,t)
3006return i?{diff:a,path:i,id:r}:null}(e,t))).filter(Boolean)
3007Ve.set(n,s)}var l=Ke.get(n)
3008l&&Ke.set(n,vt(n,l,t))
3009var c=He.get(n)
3010if(null!=c&&c.at){var u=b.bR.isPoint(null==c?void 0:c.at)?mt(n,c.at,t):vt(n,c.at,t)
3011He.set(n,u?kn(kn({},c),{},{at:u}):null)}switch(t.type){case"insert_text":case"remove_text":case"set_node":case"split_node":r.push(...Nn(n,t.path))
3012break
3013case"set_selection":var d
3014null===(d=_e.get(n))||void 0===d||d.unref(),_e.delete(n)
3015break
3016case"insert_node":case"remove_node":r.push(...Nn(n,b.wA.parent(t.path)))
3017break
3018case"merge_node":var p=b.wA.previous(t.path)
3019r.push(...Nn(n,p))
3020break
3021case"move_node":var h,g=b.wA.common(b.wA.parent(t.path),b.wA.parent(t.newPath))
3022r.push(...Nn(n,g)),b.wA.isBefore(t.path,t.newPath)?(r.push(...Nn(n,b.wA.parent(t.path))),h=t.newPath):(r.push(...Nn(n,b.wA.parent(t.newPath))),h=t.path)
3023var f=b.bP.get(e,b.wA.parent(h)),m=ct.findKey(n,f),v=b.KE.pathRef(n,b.wA.parent(h))
3024i.push([v,m])}for(var[y,x]of(a(t),r)){var[C]=b.KE.node(n,y)
3025Pe.set(C,x)}for(var[D,w]of i)if(D.current){var[A]=b.KE.node(n,D.current)
3026Pe.set(A,w)}},n.setFragmentData=e=>{var{selection:a}=n
3027if(a){var[r,i]=b.Q6.edges(a),o=b.KE.void(n,{at:r.path}),s=b.KE.void(n,{at:i.path})
3028if(!b.Q6.isCollapsed(a)||o){var l=ct.toDOMRange(n,a),c=l.cloneContents(),u=c.childNodes[0]
3029if(c.childNodes.forEach((e=>{e.textContent&&""!==e.textContent.trim()&&(u=e)})),s){var[d]=s,p=l.cloneRange(),h=ct.toDOMNode(n,d)
3030p.setEndAfter(h),c=p.cloneContents()}if(o&&(u=c.querySelector("[data-slate-spacer]")),Array.from(c.querySelectorAll("[data-slate-zero-width]")).forEach((e=>{var t="n"===e.getAttribute("data-slate-zero-width")
3031e.textContent=t?"\n":""})),tt(u)){var g=u.ownerDocument.createElement("span")
3032g.style.whiteSpace="pre",g.appendChild(u),c.appendChild(g),u=g}var f=n.getFragment(),m=JSON.stringify(f),v=window.btoa(encodeURIComponent(m))
3033u.setAttribute("data-slate-fragment",v),e.setData("application/".concat(t),v)
3034var y=c.ownerDocument.createElement("div")
3035return y.appendChild(c),y.setAttribute("hidden","true"),c.ownerDocument.body.appendChild(y),e.setData("text/html",y.innerHTML),e.setData("text/plain",rt(y)),c.ownerDocument.body.removeChild(y),e}}},n.insertData=e=>{n.insertFragmentData(e)||n.insertTextData(e)},n.insertFragmentData=e=>{var a=e.getData("application/".concat(t))||(e=>{var t=e.getData("text/html"),[,n]=t.match(it)||[]
3036return n})(e)
3037if(a){var r=decodeURIComponent(window.atob(a)),i=JSON.parse(r)
3038return n.insertFragment(i),!0}return!1},n.insertTextData=e=>{var t=e.getData("text/plain")
3039if(t){var a=t.split(/\r\n|\r|\n/),r=!1
3040for(var i of a)r&&b.gB.splitNodes(n,{always:!0}),n.insertText(i),r=!0
3041return!0}return!1},n.onChange=e=>{(pe<18?ie.unstable_batchedUpdates:e=>e())((()=>{var t=$e.get(n)
3042t&&t(e),r(e)}))},n},Nn=(e,t)=>{var n=[]
3043for(var[a,r]of b.KE.levels(e,{at:t})){var i=ct.findKey(e,a)
3044n.push([r,i])}return n}},90072:(e,t)=>
3044{"use strict"
3045for(var n=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),a={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},r={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:n?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},i={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)i["f"+o]=111+o
3046function s(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e])
3047var a=e.map((function(e){return l(e,t)})),r=function(e){return a.some((function(t){return c(t,e)}))}
3048return null==n?r:r(n)}function l(e,t){var n=t&&t.byKey,o={},s=(e=e.replace("++","+add")).split("+"),l=s.length
3049for(var c in a)o[a[c]]=!1
3050var p=!0,h=!1,g=void 0
3051try{for(var f,m=s[Symbol.iterator]();!(p=(f=m.next()).done);p=!0){var v=f.value,b=v.endsWith("?")&&v.length>1
3052b&&(v=v.slice(0,-1))
3053var y=d(v),x=a[y]
3054if(v.length>1&&!x&&!r[v]&&!i[y])throw new TypeError('Unknown modifier: "'+v+'"')
30551!==l&&x||(n?o.key=y:o.which=u(v)),x&&(o[x]=!b||null)}}catch(e){h=!0,g=e}finally{try{!p&&m.return&&m.return()}finally{if(h)throw g}}return o}function c(e,t){for(var n in e){var a=e[n],r=void 0
3056if(null!=a&&((null!=(r="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===a&&93===t.which?91:t.which:t[n])||!1!==a)&&r!==a))return!1}return!0}function u(e){return e=d(e),i[e]||e.toUpperCase().charCodeAt(0)}function d(e){return e=e.toLowerCase(),e=r[e]||e}t.v_=s},52763:(e,t,n)=>{"use strict"
3057n.d(t,{KE:()=>Se,Hg:()=>xe,bP:()=>Ae,I:()=>Be,wA:()=>ie,bR:()=>Me,Q6:()=>be,h6:()=>Te,EY:()=>ze,gB:()=>yt,ie:()=>Jt})
3058var a=n(93497),r=Symbol.for("immer-nothing"),i=Symbol.for("immer-draftable"),o=Symbol.for("immer-state")
3059function s(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var l=Object.getPrototypeOf
3060function c(e){return!!e&&!!e[o]}function u(e){return!!e&&(p(e)||Array.isArray(e)||!!e[i]||!!e.constructor?.[i]||v(e)||b(e))}var d=Object.prototype.constructor.toString()
3061function p(e){if(!e||"object"!=typeof e)return!1
3062const t=l(e)
3063if(null===t)return!0
3064const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor
3065return n===Object||"function"==typeof n&&Function.toString.call(n)===d}function h(e,t){0===g(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,a)=>t(a,n,e)))}function g(e){const t=e[o]
3066return t?t.type_:Array.isArray(e)?1:v(e)?2:b(e)?3:0}function f(e,t){return 2===g(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function m(e,t,n){const a=g(e)
30672===a?e.set(t,n):3===a?e.add(n):e[t]=n}function v(e){return e instanceof Map}function b(e){return e instanceof Set}function y(e){return e.copy_||e.base_}function x(e,t){if(v(e))return new Map(e)
3068if(b(e))return new Set(e)
3069if(Array.isArray(e))return Array.prototype.slice.call(e)
3070const n=p(e)
3071if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e)
3072delete t[o]
3073let n=Reflect.ownKeys(t)
3074for(let a=0;a<n.length;a++){const r=n[a],i=t[r]
3075!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(l(e),t)}{const t=l(e)
3076if(null!==t&&n)return{...e}
3077const a=Object.create(t)
3078return Object.assign(a,e)}}function C(e,t=!1){return w(e)||c(e)||!u(e)||(g(e)>1&&(e.set=e.add=e.clear=e.delete=D),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>C(t,!0)))),e}function D(){s(2)}function w(e){return Object.isFrozen(e)}var A,E={}
3079function j(e){const t=E[e]
3080return t||s(0),t}function B(){return A}function k(e,t){t&&(j("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function S(e){N(e),e.drafts_.forEach(O),e.drafts_=null}function N(e){e===A&&(A=e.parent_)}function F(e){return A={drafts_:[],parent_:A,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function O(e){const t=e[o]
30810===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function M(e,t){t.unfinalizedDrafts_=t.drafts_.length
3082const n=t.drafts_[0]
3083return void 0!==e&&e!==n?(n[o].modified_&&(S(t),s(4)),u(e)&&(e=P(t,e),t.parent_||I(t,e)),t.patches_&&j("Patches").generateReplacementPatches_(n[o].base_,e,t.patches_,t.inversePatches_)):e=P(t,n,[]),S(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==r?e:void 0}function P(e,t,n){if(w(t))return t
3084const a=t[o]
3085if(!a)return h(t,((r,i)=>T(e,a,t,r,i,n))),t
3086if(a.scope_!==e)return t
3087if(!a.modified_)return I(e,a.base_,!0),a.base_
3088if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--
3089const t=a.copy_
3090let r=t,i=!1
30913===a.type_&&(r=new Set(t),t.clear(),i=!0),h(r,((r,o)=>T(e,a,t,r,o,n,i))),I(e,t,!1),n&&e.patches_&&j("Patches").generatePatches_(a,n,e.patches_,e.inversePatches_)}return a.copy_}function T(e,t,n,a,r,i,o){if(c(r)){const o=P(e,r,i&&t&&3!==t.type_&&!f(t.assigned_,a)?i.concat(a):void 0)
3092if(m(n,a,o),!c(o))return
3093e.canAutoFreeze_=!1}else o&&n.add(r)
3094if(u(r)&&!w(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return
3095P(e,r),t&&t.scope_.parent_||"symbol"==typeof a||!Object.prototype.propertyIsEnumerable.call(n,a)||I(e,r)}}function I(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&C(t,n)}var R={get(e,t){if(t===o)return e
3096const n=y(e)
3097if(!f(n,t))return function(e,t,n){const a=$(t,n)
3098return a?"value"in a?a.value:a.get?.call(e.draft_):void 0}(e,n,t)
3099const a=n[t]
3100return e.finalized_||!u(a)?a:a===_(e.base_,t)?(W(e),e.copy_[t]=U(a,e)):a},has:(e,t)=>t in y(e),ownKeys:e=>Reflect.ownKeys(y(e)),set(e,t,n){const a=$(y(e),t)
3101if(a?.set)return a.set.call(e.draft_,n),!0
3102if(!e.modified_){const a=_(y(e),t),s=a?.[o]
3103if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0
3104if(((r=n)===(i=a)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==n||f(e.base_,t)))return!0
3105W(e),z(e)}var r,i
3106return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==_(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,W(e),z(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=y(e),a=Reflect.getOwnPropertyDescriptor(n,t)
3107return a?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:a.enumerable,value:n[t]}:a},defineProperty(){s(11)},getPrototypeOf:e=>l(e.base_),setPrototypeOf(){s(12)}},L={}
3108function _(e,t){const n=e[o]
3109return(n?y(n):e)[t]}function $(e,t){if(!(t in e))return
3110let n=l(e)
3111for(;n;){const e=Object.getOwnPropertyDescriptor(n,t)
3112if(e)return e
3113n=l(n)}}function z(e){e.modified_||(e.modified_=!0,e.parent_&&z(e.parent_))}function W(e){e.copy_||(e.copy_=x(e.base_,e.scope_.immer_.useStrictShallowCopy_))}h(R,((e,t)=>{L[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),L.deleteProperty=function(e,t){return L.set.call(this,e,t,void 0)},L.set=function(e,t,n){return R.set.call(this,e[0],t,n,e[0])}
3114function U(e,t){const n=v(e)?j("MapSet").proxyMap_(e,t):b(e)?j("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),a={type_:n?1:0,scope_:t?t.scope_:B(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1}
3115let r=a,i=R
3116n&&(r=[a],i=L)
3117const{revoke:o,proxy:s}=Proxy.revocable(r,i)
3118return a.draft_=s,a.revoke_=o,s}(e,t)
3119return(t?t.scope_:B()).drafts_.push(n),n}function V(e){if(!u(e)||w(e))return e
3120const t=e[o]
3121let n
3122if(t){if(!t.modified_)return t.base_
3123t.finalized_=!0,n=x(e,t.scope_.immer_.useStrictShallowCopy_)}else n=x(e,!0)
3124return h(n,((e,t)=>{m(n,e,V(t))})),t&&(t.finalized_=!1),n}var H=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t
3125t=e
3126const a=this
3127return function(e=n,...r){return a.produce(e,(e=>t.call(this,e,...r)))}}let a
3128if("function"!=typeof t&&s(6),void 0!==n&&"function"!=typeof n&&s(7),u(e)){const r=F(this),i=U(e,void 0)
3129let o=!0
3130try{a=t(i),o=!1}finally{o?S(r):N(r)}return k(r,n),M(a,r)}if(!e||"object"!=typeof e){if(a=t(e),void 0===a&&(a=e),a===r&&(a=void 0),this.autoFreeze_&&C(a,!0),n){const t=[],r=[]
3131j("Patches").generateReplacementPatches_(e,a,t,r),n(t,r)}return a}s(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)))
3132let n,a
3133return[this.produce(e,t,((e,t)=>{n=e,a=t})),n,a]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){u(e)||s(8),c(e)&&(e=function(e){c(e)||s(10)
3134return V(e)}(e))
3135const t=F(this),n=U(e,void 0)
3136return n[o].isManual_=!0,N(t),n}finishDraft(e,t){const n=e&&e[o]
3137n&&n.isManual_||s(9)
3138const{scope_:a}=n
3139return k(a,t),M(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n
3140for(n=t.length-1;n>=0;n--){const a=t[n]
3141if(0===a.path.length&&"replace"===a.op){e=a.value
3142break}}n>
3142-1&&(t=t.slice(n+1))
3143const a=j("Patches").applyPatches_
3144return c(e)?a(e,t):this.produce(e,(e=>a(e,t)))}},K=H.produce,q=(H.produceWithPatches.bind(H),H.setAutoFreeze.bind(H),H.setUseStrictShallowCopy.bind(H),H.applyPatches.bind(H),H.createDraft.bind(H)),G=H.finishDraft.bind(H)
3145var Y={transform(e,t){var{current:n,affinity:a}=e
3146if(null!=n){var r=ie.transform(n,t,{affinity:a})
3147e.current=r,null==r&&e.unref()}}},J={transform(e,t){var{current:n,affinity:a}=e
3148if(null!=n){var r=Me.transform(n,t,{affinity:a})
3149e.current=r,null==r&&e.unref()}}},X={transform(e,t){var{current:n,affinity:a}=e
3150if(null!=n){var r=be.transform(n,t,{affinity:a})
3151e.current=r,null==r&&e.unref()}}},Q=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,ae=new WeakMap,re=new WeakMap,ie={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,a=ie.levels(e,t)
3152return a=n?a.slice(1):a.slice(0,-1)},common(e,t){for(var n=[],a=0;a<e.length&&a<t.length;a++){var r=e[a]
3153if(r!==t[a])break
3154n.push(r)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),a=0;a<n;a++){if(e[a]<t[a])return-1
3155if(e[a]>t[a])return 1}return 0},endsAfter(e,t){var n=e.length-1,a=e.slice(0,n),r=t.slice(0,n),i=e[n],o=t[n]
3156return ie.equals(a,r)&&i>o},endsAt(e,t){var n=e.length,a=e.slice(0,n),r=t.slice(0,n)
3157return ie.equals(a,r)},endsBefore(e,t){var n=e.length-1,a=e.slice(0,n),r=t.slice(0,n),i=e[n],o=t[n]
3158return ie.equals(a,r)&&i<o},equals:(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===ie.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===ie.compare(e,t),isBefore:(e,t)=>-1===ie.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===ie.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===ie.compare(e,t),isDescendant:(e,t)=>
3158e.length>t.length&&0===ie.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===ie.compare(e,t),isPath:e=>Array.isArray(e)&&(0===e.length||"number"==typeof e[0]),isSibling(e,t){if(e.length!==t.length)return!1
3159var n=e.slice(0,-1),a=t.slice(0,-1)
3160return e[e.length-1]!==t[t.length-1]&&ie.equals(n,a)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,a=[],r=0;r<=e.length;r++)a.push(e.slice(0,r))
3161return n&&a.reverse(),a},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."))
3162var t=e[e.length-1]
3163return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0
3164default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."))
3165return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."))
3166var t=e[e.length-1]
3167if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."))
3168return e.slice(0,-1).concat(t-1)},relative(e,t){if(!ie.isAncestor(t,e)&&!ie.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."))
3169return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3170if(!e)return null
3171var a=[...e],{affinity:r="forward"}=n
3172if(0===e.length)return a
3173switch(t.type){case"insert_node":var{path:i}=t;(ie.equals(i,a)||ie.endsBefore(i,a)||ie.isAncestor(i,a))&&(a[i.length-1]+=1)
3174break
3175case"remove_node":var{path:o}=t
3176if(ie.equals(o,a)||ie.isAncestor(o,a))return null
3177ie.endsBefore(o,a)&&(a[o.length-1]-=1)
3178break
3179case"merge_node":var{path:s,position:l}=t
3180ie.equals(s,a)||ie.endsBefore(s,a)?a[s.length-1]-=1:ie.isAncestor(s,a)&&(a[s.length-1]-=1,a[s.length]+=l)
3181break
3182case"split_node":var{path:c,position:u}=t
3183if(ie.equals(c,a)){if("forward"===r)a[a.length-1]+=1
3184else if("backward"!==r)return null}else ie.endsBefore(c,a)?a[c.length-1]+=1:ie.isAncestor(c,a)&&e[c.length]>=u&&(a[c.length-1]+=1,a[c.length]-=u)
3185break
3186case"move_node":var{path:d,newPath:p}=t
3187if(ie.equals(d,p))return a
3188if(ie.isAncestor(d,a)||ie.equals(d,a)){var h=p.slice()
3189return ie.endsBefore(d,p)&&d.length<p.length&&(h[d.length-1]-=1),h.concat(a.slice(d.length))}ie.isSibling(d,p)&&(ie.isAncestor(p,a)||ie.equals(p,a))?ie.endsBefore(d,a)?a[d.length-1]-=1:a[d.length-1]+=1:ie.endsBefore(p,a)||ie.equals(p,a)||ie.isAncestor(p,a)?(ie.endsBefore(d,a)&&(a[d.length-1]-=1),a[p.length-1]+=1):ie.endsBefore(d,a)&&(ie.equals(p,a)&&(a[p.length-1]+=1),a[d.length-1]-=1)}return a}}
3190function oe(e){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oe(e)}function se(e){var t=function(e,t){if("object"!==oe(e)||null===e)return e
3191var n=e[Symbol.toPrimitive]
3192if(void 0!==n){var a=n.call(e,t||"default")
3193if("object"!==oe(a))return a
3194throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string")
3195return"symbol"===oe(t)?t:String(t)}function le(e,t,n){return(t=se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ce(e,t){var n=Object.keys(e)
3196if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3197t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3198t%2?ce(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var de={transform(e,t){e.children=q(e.children)
3199var n=e.selection&&q(e.selection)
3200try{n=((e,t,n)=>{switch(n.type){case"insert_node":var{path:a,node:r}=n,i=Ae.parent(e,a),o=a[a.length-1]
3201if(o>i.children.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(a,"] because the destination is past the end of the node."))
3202if(i.children.splice(o,0,r),t)for(var[s,l]of be.points(t))t[l]=Me.transform(s,n)
3203break
3204case"insert_text":var{path:c,offset:u,text:d}=n
3205if(0===d.length)break
3206var p=Ae.leaf(e,c),h=p.text.slice(0,u),g=p.text.slice(u)
3207if(p.text=h+d+g,t)for(var[f,m]of be.points(t))t[m]=Me.transform(f,n)
3208break
3209case"merge_node":var{path:v}=n,b=Ae.get(e,v),y=ie.previous(v),x=Ae.get(e,y),C=Ae.parent(e,v),D=v[v.length-1]
3210if(ze.isText(b)&&ze.isText(x))x.text+=b.text
3211else{if(ze.isText(b)||ze.isText(x))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(v,"] to nodes of different interfaces: ").concat(Te.stringify(b)," ").concat(Te.stringify(x)))
3212x.children.push(...b.children)}if(C.children.splice(D,1),t)for(var[w,A]of be.points(t))t[A]=Me.transform(w,n)
3213break
3214case"move_node":var{path:E,newPath:j}=n
3215if(ie.isAncestor(E,j))throw new Error("Cannot move a path [".concat(E,"] to new path [").concat(j,"] because the destination is inside itself."))
3216var B=Ae.get(e,E),k=Ae.parent(e,E),S=E[E.length-1]
3217k.children.splice(S,1)
3218var N=ie.transform(E,n),F=Ae.get(e,ie.parent(N)),O=N[N.length-1]
3219if(F.children.splice(O,0,B),t)for(var[M,P]of be.points(t))t[P]=Me.transform(M,n)
3220break
3221case"remove_node":var{path:T}=n,I=T[T.length-1]
3222if(Ae.parent(e,T).children.splice(I,1),t)for(var[R,L]of be.points(t)){var _=Me.transform(R,n)
3223if(null!=t&&null!=_)t[L]=_
3224else{var $=void 0,z=void 0
3225for(var[W,U]of Ae.texts(e)){if(-1!==ie.compare(U,T)){z=[W,U]
3226break}$=[W,U]}var V=!1
3227$&&z&&(V=ie.equals(z[1],T)?!ie.hasPrevious(z[1]):ie.common($[1],T).length<ie.common(z[1],T).length),$&&!V?(R.path=$[1],R.offset=$[0].text.length):z?(R.path=z[1],R.offset=0):t=null}}break
3228case"remove_text":var{path:H,offset:K,text:q}=n
3229if(0===q.length)break
3230var G=Ae.leaf(e,H),Y=G.text.slice(0,K),J=G.text.slice(K+q.length)
3231if(G.text=Y+J,t)for(var[X,Q]of be.points(t))t[Q]=Me.transform(X,n)
3232break
3233case"set_node":var{path:Z,properties:ee,newProperties:te}=n
3234if(0===Z.length)throw new Error("Cannot set properties on the root node!")
3235var ne=Ae.get(e,Z)
3236for(var ae in te){if("children"===ae||"text"===ae)throw new Error('Cannot set the "'.concat(ae,'" property of nodes!'))
3237var re=te[ae]
3238null==re?delete ne[ae]:ne[ae]=re}for(var oe in ee)te.hasOwnProperty(oe)||delete ne[oe]
3239break
3240case"set_selection":var{newProperties:se}=n
3241if(null==se)t=se
3242else{if(null==t){if(!be.isRange(se))throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Te.stringify(se)," when there is no current selection."))
3243t=ue({},se)}for(var le in se){var ce=se[le]
3244if(null==ce){if("anchor"===le||"focus"===le)throw new Error('Cannot remove the "'.concat(le,'" selection property'))
3245delete t[le]}else t[le]=ce}}break
3246case"split_node":var{path:de,position:pe,properties:he}=n
3247if(0===de.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(de,"] because the root node cannot be split."))
3248var ge,fe=Ae.get(e,de),me=Ae.parent(e,de),ve=de[de.length-1]
3249if(ze.isText(fe)){var ye=fe.text.slice(0,pe),xe=fe.text.slice(pe)
3250fe.text=ye,ge=ue(ue({},he),{}
3250,{text:xe})}else{var Ce=fe.children.slice(0,pe),De=fe.children.slice(pe)
3251fe.children=Ce,ge=ue(ue({},he),{},{children:De})}if(me.children.splice(ve+1,0,ge),t)for(var[we,Ee]of be.points(t))t[Ee]=Me.transform(we,n)}return t})(e,n,t)}finally{e.children=G(e.children),e.selection=n?c(n)?G(n):n:null}}},pe={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},he={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},ge=(e,t)=>{for(var n in e){var r=e[n],i=t[n]
3252if((0,a.Q)(r)&&(0,a.Q)(i)){if(!ge(r,i))return!1}else if(Array.isArray(r)&&Array.isArray(i)){if(r.length!==i.length)return!1
3253for(var o=0;o<r.length;o++)if(r[o]!==i[o])return!1}else if(r!==i)return!1}for(var s in t)if(void 0===e[s]&&void 0!==t[s])return!1
3254return!0}
3255function fe(e,t){if(null==e)return{}
3256var n,a,r=function(e,t){if(null==e)return{}
3257var n,a,r={},i=Object.keys(e)
3258for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n])
3259return r}(e,t)
3260if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e)
3261for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var me=["anchor","focus"]
3262function ve(e,t){var n=Object.keys(e)
3263if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3264t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var be={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:a,focus:r}=e
3265return be.isBackward(e)===n?[a,r]:[r,a]},end(e){var[,t]=be.edges(e)
3266return t},equals:(e,t)=>Me.equals(e.anchor,t.anchor)&&Me.equals(e.focus,t.focus),includes(e,t){if(be.isRange(t)){if(be.includes(e,t.anchor)||be.includes(e,t.focus))return!0
3267var[n,a]=be.edges(e),[r,i]=be.edges(t)
3268return Me.isBefore(n,r)&&Me.isAfter(a,i)}var[o,s]=be.edges(e),l=!1,c=!1
3269return Me.isPoint(t)?(l=Me.compare(t,o)>=0,c=Me.compare(t,s)<=0):(l=ie.compare(t,o.path)>=0,c=ie.compare(t,s.path)<=0),l&&c},intersection(e,t){var n=fe(e,me),[a,r]=be.edges(e),[i,o]=be.edges(t),s=Me.isBefore(a,i)?i:a,l=Me.isBefore(r,o)?r:o
3270return Me.isBefore(l,s)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3271t%2?ve(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({anchor:s,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e
3272return Me.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e
3273return Me.equals(t,n)},isExpanded:e=>!be.isCollapsed(e),isForward:e=>!be.isBackward(e),isRange:e=>(0,a.Q)(e)&&Me.isPoint(e.anchor)&&Me.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=be.edges(e)
3274return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3275return K(e,(e=>{if(null===e)return null
3276var a,r,{affinity:i="inward"}=n
3277if("inward"===i){var o=be.isCollapsed(e)
3278be.isForward(e)?(a="forward",r=o?a:"backward"):(a="backward",r=o?a:"forward")}else"outward"===i?be.isForward(e)?(a="backward",r="forward"):(a="forward",r="backward"):(a=i,r=i)
3279var s=Me.transform(e.anchor,t,{affinity:a}),l=Me.transform(e.focus,t,{affinity:r})
3280if(!s||!l)return null
3281e.anchor=s,e.focus=l}))}},ye=e=>(0,a.Q)(e)&&Ae.isNodeList(e.children)&&!Se.isEditor(e),xe={isAncestor:e=>(0,a.Q)(e)&&Ae.isNodeList(e.children),isElement:ye,isElementList:e=>Array.isArray(e)&&e.every((e=>xe.isElement(e))),isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type"
3282return ye(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1
3283return!0}},Ce=["children"],De=["text"],we=new WeakMap,Ae={ancestor(e,t){var n=Ae.get(e,t)
3284if(ze.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Te.stringify(n)))
3285return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3286return function*(){for(var a of ie.ancestors(t,n)){var r=[Ae.ancestor(e,a),a]
3287yield r}}()},child(e,t){if(ze.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Te.stringify(e)))
3288var n=e.children[t]
3289if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Te.stringify(e)))
3290return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3291return function*(){for(var{reverse:a=!1}=n,r=Ae.ancestor(e,t),{children:i}=r,o=a?i.length-1:0;a?o>=0:o<i.length;){var s=Ae.child(r,o),l=t.concat(o)
3292yield[s,l],o=a?o-1:o+1}}()},common(e,t,n){var a=ie.common(t,n)
3293return[Ae.get(e,a),a]},descendant(e,t){var n=Ae.get(e,t)
3294if(Se.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Te.stringify(n)))
3295return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3296return function*(){for(var[n,a]of Ae.nodes(e,t))0!==a.length&&(yield[n,a])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3297return function*(){for(var[n,a]of Ae.nodes(e,t))xe.isElement(n)&&(yield[n,a])}()},extractProps:e=>xe.isAncestor(e)?fe(e,Ce):fe(e,De),first(e,t){for(var n=t.slice(),a=Ae.get(e,n);a&&!ze.isText(a)&&0!==a.children.length;)a=a.children[0],n.push(0)
3298return[a,n]},fragment(e,t){if(ze.isText(e))throw new Error("Cannot get a fragment starting from a root text node: ".concat(Te.stringify(e)))
3299var n=K({children:e.children},(e=>{var[n,a]=be.edges(t),r=Ae.nodes(e,{reverse:!0,pass:e=>{var[,n]=e
3300return!be.includes(t,n)}})
3301for(var[,i]of r){if(!be.includes(t,i)){var o=Ae.parent(e,i),s=i[i.length-1]
3302o.children.splice(s,1)}if(ie.equals(i,a.path)){var l=Ae.leaf(e,i)
3303l.text=l.text.slice(0,a.offset)}if(ie.equals(i,n.path)){var c=Ae.leaf(e,i)
3304c.text=c.text.slice(n.offset)}}Se.isEditor(e)&&(e.selection=null)}))
3305return n.children},get(e,t){for(var n=e,a=0;a<t.length;a++){var r=t[a]
3306if(ze.isText(n)||!n.children[r])throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Te.stringify(e)))
3307n=n.children[r]}return n},has(e,t){for(var n=e,a=0;a<t.length;a++){var r=t[a]
3308if(ze.isText(n)||!n.children[r])return!1
3309n=n.children[r]}return!0},isNode:e=>ze.isText(e)||xe.isElement(e)||Se.isEditor(e),isNodeList(e){if(!Array.isArray(e))return!1
3310var t=we.get(e)
3311if(void 0!==t)return t
3312var n=e.every((e=>Ae.isNode(e)))
3313return we.set(e,n),n},last(e,t){for(var n=t.slice(),a=Ae.get(e,n);a&&!ze.isText(a)&&0!==a.children.length;){var r=a.children.length-1
3314a=a.children[r],n.push(r)}return[a,n]},leaf(e,t){var n=Ae.get(e,t)
3315if(!ze.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Te.stringify(n)))
3316return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3317return function*(){for(var a of ie.levels(t,n)){var r=Ae.get(e,a)
3318yield[r,a]}}()},matches:(e,t)=>xe.isElement(e)&&xe.isElementProps(t)&&xe.matches(e,t)||ze.isText(e)&&ze.isTextProps(t)&&ze.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3319return function*(){for(var{pass:n,reverse:a=!1}=t,{from:r=[],to:i}=t,o=new Set,s=[],l=e;!i||!(a?ie.isBefore(s,i):ie.isAfter(s,i));
3319)if(o.has(l)||(yield[l,s]),o.has(l)||ze.isText(l)||0===l.children.length||null!=n&&!1!==n([l,s])){if(0===s.length)break
3320if(!a){var c=ie.next(s)
3321if(Ae.has(e,c)){s=c,l=Ae.get(e,s)
3322continue}}if(a&&0!==s[s.length-1])s=ie.previous(s),l=Ae.get(e,s)
3323else s=ie.parent(s),l=Ae.get(e,s),o.add(l)}else{o.add(l)
3324var u=a?l.children.length-1:0
3325ie.isAncestor(s,r)&&(u=r[s.length]),s=s.concat(u),l=Ae.get(e,s)}}()},parent(e,t){var n=ie.parent(t),a=Ae.get(e,n)
3326if(ze.isText(a))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."))
3327return a},string:e=>ze.isText(e)?e.text:e.children.map(Ae.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3328return function*(){for(var[n,a]of Ae.nodes(e,t))ze.isText(n)&&(yield[n,a])}()}}
3329function Ee(e,t){var n=Object.keys(e)
3330if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3331t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3332t%2?Ee(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Be={isNodeOperation:e=>Be.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!(0,a.Q)(e))return!1
3333switch(e.type){case"insert_node":case"remove_node":return ie.isPath(e.path)&&Ae.isNode(e.node)
3334case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&ie.isPath(e.path)
3335case"merge_node":return"number"==typeof e.position&&ie.isPath(e.path)&&(0,a.Q)(e.properties)
3336case"move_node":return ie.isPath(e.path)&&ie.isPath(e.newPath)
3337case"set_node":return ie.isPath(e.path)&&(0,a.Q)(e.properties)&&(0,a.Q)(e.newProperties)
3338case"set_selection":return null===e.properties&&be.isRange(e.newProperties)||null===e.newProperties&&be.isRange(e.properties)||(0,a.Q)(e.properties)&&(0,a.Q)(e.newProperties)
3339case"split_node":return ie.isPath(e.path)&&"number"==typeof e.position&&(0,a.Q)(e.properties)
3340default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every((e=>Be.isOperation(e))),isSelectionOperation:e=>Be.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>Be.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return je(je({},e),{},{type:"remove_node"})
3341case"insert_text":return je(je({},e),{},{type:"remove_text"})
3342case"merge_node":return je(je({},e),{},{type:"split_node",path:ie.previous(e.path)})
3343case"move_node":var{newPath:t,path:n}=e
3344if(ie.equals(t,n))return e
3345if(ie.isSibling(n,t))return je(je({},e),{},{path:t,newPath:n})
3346var a=ie.transform(n,e),r=ie.transform(ie.next(n),e)
3347return je(je({},e),{},{path:a,newPath:r})
3348case"remove_node":return je(je({},e),{},{type:"insert_node"})
3349case"remove_text":return je(je({},e),{},{type:"insert_text"})
3350case"set_node":var{properties:i,newProperties:o}=e
3351return je(je({},e),{},{properties:o,newProperties:i})
3352case"set_selection":var{properties:s,newProperties:l}=e
3353return je(je({},e),{},null==s?{properties:l,newProperties:null}:null==l?{properties:null,newProperties:s}:{properties:l,newProperties:s})
3354case"split_node":return je(je({},e),{},{type:"merge_node",path:ie.next(e.path)})}}},ke=new WeakMap,Se={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t
3355e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t
3356e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3357return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)}
3357,insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:e=>(e=>{var t=ke.get(e)
3358if(void 0!==t)return t
3359if(!(0,a.Q)(e))return!1
3360var n="function"==typeof e.addMark&&"function"==typeof e.apply&&"function"==typeof e.deleteFragment&&"function"==typeof e.insertBreak&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertText&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isInline&&"function"==typeof e.isSelectable&&"function"==typeof e.isVoid&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.removeMark&&"function"==typeof e.getDirtyPaths&&(null===e.marks||(0,a.Q)(e.marks))&&(null===e.selection||be.isRange(e.selection))&&Ae.isNodeList(e.children)&&Be.isOperationList(e.operations)
3361return ke.set(e,n),n})(e),isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},Ne={isSpan:e=>Array.isArray(e)&&2===e.length&&e.every(ie.isPath)}
3362function Fe(e,t){var n=Object.keys(e)
3363if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3364t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3365t%2?Fe(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Me={compare(e,t){var n=ie.compare(e.path,t.path)
3366return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===Me.compare(e,t),isBefore:(e,t)=>-1===Me.compare(e,t),equals:(e,t)=>e.offset===t.offset&&ie.equals(e.path,t.path),isPoint:e=>(0,a.Q)(e)&&"number"==typeof e.offset&&ie.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3367return K(e,(e=>{if(null===e)return null
3368var{affinity:a="forward"}=n,{path:r,offset:i}=e
3369switch(t.type){case"insert_node":case"move_node":e.path=ie.transform(r,t,n)
3370break
3371case"insert_text":ie.equals(t.path,r)&&(t.offset<i||t.offset===i&&"forward"===a)&&(e.offset+=t.text.length)
3372break
3373case"merge_node":ie.equals(t.path,r)&&(e.offset+=t.position),e.path=ie.transform(r,t,n)
3374break
3375case"remove_text":ie.equals(t.path,r)&&t.offset<=i&&(e.offset-=Math.min(i-t.offset,t.text.length))
3376break
3377case"remove_node":if(ie.equals(t.path,r)||ie.isAncestor(t.path,r))return null
3378e.path=ie.transform(r,t,n)
3379break
3380case"split_node":if(ie.equals(t.path,r)){if(t.position===i&&null==a)return null;(t.position<i||t.position===i&&"forward"===a)&&(e.offset-=t.position,e.path=ie.transform(r,t,Oe(Oe({},n),{},{affinity:"forward"})))}else e.path=ie.transform(r,t,n)}}))}},Pe=void 0,Te={setScrubber(e){Pe=e},stringify:e=>JSON.stringify(e,Pe)},Ie=["text"],Re=["anchor","focus"]
3381function Le(e,t){var n=Object.keys(e)
3382if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3383t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3384t%2?Le(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $e,ze={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:a=!1}=n
3385function r(e){return fe(e,Ie)}return ge(a?r(e):e,a?r(t):t)},isText:e=>(0,a.Q)(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every((e=>ze.isText(e))),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1
3386return!0},decorations(e,t){var n=[_e({},e)]
3387for(var a of t){var r=fe(a,Re),[i,o]=be.edges(a),s=[],l=0,c=i.offset,u=o.offset
3388for(var d of n){var{length:p}=d.text,h=l
3389if(l+=p,c<=h&&l<=u)Object.assign(d,r),s.push(d)
3390else if(c!==u&&(c===l||u===h)||c>l||u<h||u===h&&0!==h)s.push(d)
3391else{var g=d,f=void 0,m=void 0
3392if(u<l){var v=u-h
3393m=_e(_e({},g),{},{text:g.text.slice(v)}),g=_e(_e({},g),{},{text:g.text.slice(0,v)})}if(c>h){var b=c-h
3394f=_e(_e({},g),{},{text:g.text.slice(0,b)}),g=_e(_e({},g),{},{text:g.text.slice(b)})}Object.assign(g,r),f&&s.push(f),s.push(g),m&&s.push(m)}}n=s}return n}},We=e=>e.selection?e.selection:e.children.length>0?Se.end(e,[]):[0],Ue=(e,t)=>{var[n]=Se.node(e,t)
3395return e=>e===n},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,a=t?Je(e):e,r=$e.None,i=$e.None,o=0,s=null
3396for(var l of a){var c=l.codePointAt(0)
3397if(!c)break
3398var u=lt(l,c)
3399if([r,i]=n?[i,u]:[u,r],ct(r,$e.ZWJ)&&ct(i,$e.ExtPict)&&!ht(n?e.substring(0,o):e.substring(0,e.length-o)))break
3400if(ct(r,$e.RI)&&ct(i,$e.RI)&&!(s=null!==s?!s:!!n||ft(e.substring(0,e.length-o))))break
3401if(r!==$e.None&&i!==$e.None&&dt(r,i))break
3402o+=l.length}return o||1},He=/\s/,Ke=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,qe=/['\u2018\u2019]/,Ge=(e,t,n)=>{if(n){var a=e.length-t
3403return[e.slice(a,e.length),e.slice(0,a)]}return[e.slice(0,t),e.slice(t)]},Ye=function e(t,n){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2]
3404if(He.test(t))return!1
3405if(qe.test(t)){var r=Ve(n,a),[i,o]=Ge(n,r,a)
3406if(e(i,o,a))return!0}return!Ke.test(t)},Je=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var a=e.charAt(t-n)
3407if(Qe(a.charCodeAt(0))){var r=e.charAt(t-n-1)
3408if(Xe(r.charCodeAt(0))){yield r+a,n++
3409continue}}yield a}},Xe=e=>e>=55296&&e<=56319,Qe=e=>e>=56320&&e<=57343
3410!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}($e||($e={}))
3411var Ze=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u
3411094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,et=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,tt=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u
34111A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,nt=/^[\u1100-\u115F\uA960-\uA97C]$/,at=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,rt=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,it=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,ot=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\u
3411C2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,st=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,lt=(e,t)=>{var n=$e.Any
3412return-1!==e.search(Ze)&&(n|=$e.Extend),8205===t&&(n|=$e.ZWJ),t>=127462&&t<=127487&&(n|=$e.RI),-1!==e.search(et)&&(n|=$e.Prepend),-1!==e.search(tt)&&(n|=$e.SpacingMark),-1!==e.search(nt)&&(n|=$e.L),-1!==e.search(at)&&(n|=$e.V),-1!==e.search(rt)&&(n|=$e.T),-1!==e.search(it)&&(n|=$e.LV),-1!==e.search(ot)&&(n|=$e.LVT),-1!==e.search(st)&&(n|=$e.ExtPict),n}
3413function ct(e,t){return!!(e&t)}var ut=[[$e.L,$e.L|$e.V|$e.LV|$e.LVT],[$e.LV|$e.V,$e.V|$e.T],[$e.LVT|$e.T,$e.T],[$e.Any,$e.Extend|$e.ZWJ],[$e.Any,$e.SpacingMark],[$e.Prepend,$e.Any],[$e.ZWJ,$e.ExtPict],[$e.RI,$e.RI]]
3414function dt(e,t){return-1===ut.findIndex((n=>ct(e,n[0])&&ct(t,n[1])))}var pt=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u
34140591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,ht=e=>-1!==e.search(pt),gt=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,ft=e=>{var t=e.match(gt)
3415return null!==t&&t[0].length/2%2==1},mt={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3416Se.withoutNormalizing(e,(()=>{var{voids:a=!1}=n,{at:r=We(e)}=n
3417if(ie.isPath(r)&&(r=Se.range(e,r)),be.isRange(r))if(be.isCollapsed(r))r=r.anchor
3418else{var i=be.end(r)
3419if(!a&&Se.void(e,{at:i}))return
3420var o=be.start(r),s=Se.pointRef(e,o),l=Se.pointRef(e,i)
3421yt.delete(e,{at:r,voids:a})
3422var c=s.unref(),u=l.unref()
3423r=c||u,yt.setSelection(e,{anchor:r,focus:r})}if(!(!a&&Se.void(e,{at:r})||Se.elementReadOnly(e,{at:r}))){var{path:d,offset:p}=r
3424t.length>
34240&&e.apply({type:"insert_text",path:d,offset:p,text:t})}}))}}
3425function vt(e,t){var n=Object.keys(e)
3426if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3427t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3428t%2?vt(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yt=bt(bt(bt(bt({},de),pe),he),mt),xt=new WeakMap
3429function Ct(e,t,n){var a,r,i=Q.get(e)||[],o=Z.get(e)||new Set,s=e=>{if(e){var t=e.join(",")
3430r.has(t)||(r.add(t),a.push(e))}}
3431if(n)for(var l of(a=[],r=new Set,i)){s(n(l))}else a=i,r=o
3432for(var c of t)s(c)
3433Q.set(e,a),Z.set(e,r)}var Dt=(e,t)=>{for(var n of Se.pathRefs(e))Y.transform(n,t)
3434for(var a of Se.pointRefs(e))J.transform(a,t)
3435for(var r of Se.rangeRefs(e))X.transform(r,t)
3436if(!(e=>xt.get(e)||!1)(e)){var i=ie.operationCanTransformPath(t)?e=>ie.transform(e,t):void 0
3437Ct(e,e.getDirtyPaths(t),i)}yt.transform(e,t),e.operations.push(t),Se.normalize(e,{operation:t}),"set_selection"===t.type&&(e.marks=null),ee.get(e)||(ee.set(e,!0),Promise.resolve().then((()=>{ee.set(e,!1),e.onChange({operation:t}),e.operations=[]})))}
3438function wt(e,t){var n=Object.keys(e)
3439if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3440t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3441t%2?wt(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Et(e,t){var n=Object.keys(e)
3442if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3443t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function jt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3444t%2?Et(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bt(e,t){var n=Object.keys(e)
3445if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3446t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3447t%2?Bt(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function St(e,t){var n=Object.keys(e)
3448if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3449t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Nt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3450t%2?St(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ft(e,t){var n=Object.keys(e)
3451if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3452t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3453t%2?Ft(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ft(Object(n)).forEac
3453h((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mt(e,t){var n=Object.keys(e)
3454if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3455t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var Pt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:a,marks:r}=e
3456if(a){if(r){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3457t%2?Mt(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({text:t},r)
3458yt.insertNodes(e,i,{at:n.at,voids:n.voids})}else yt.insertText(e,t,n)
3459e.marks=null}}
3460var Tt=["text"],It=["text"]
3461var Rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1,operation:a}=t,r=e=>Q.get(e)||[],i=e=>{var t=r(e).pop(),n=t.join(",")
3462return(e=>Z.get(e)||new Set)(e).delete(n),t}
3463if(Se.isNormalizing(e)){if(n){var o=Array.from(Ae.nodes(e),(e=>{var[,t]=e
3464return t})),s=new Set(o.map((e=>e.join(","))))
3465Q.set(e,o),Z.set(e,s)}0!==r(e).length&&Se.withoutNormalizing(e,(()=>{for(var t of r(e))if(Ae.has(e,t)){var n=Se.node(e,t),[o,s]=n
3466xe.isElement(o)&&0===o.children.length&&e.normalizeNode(n,{operation:a})}for(var l=r(e),c=l.length,u=0;0!==l.length;){if(!e.shouldNormalize({dirtyPaths:l,iteration:u,initialDirtyPathsLength:c,operation:a}))return
3467var d=i(e)
3468if(Ae.has(e,d)){var p=Se.node(e,d)
3469e.normalizeNode(p,{operation:a})}u++,l=r(e)}}))}}
3470function Lt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3471return function*(){var{at:n=e.selection,unit:a="offset",reverse:r=!1,voids:i=!1,ignoreNonSelectable:o=!1}=t
3472if(n){var s=Se.range(e,n),[l,c]=be.edges(s),u=r?c:l,d=!1,p="",h=0,g=0,f=0
3473for(var[m,v]of Se.nodes(e,{at:n,reverse:r,voids:i,ignoreNonSelectable:o})){if(xe.isElement(m)){if(!i&&(e.isVoid(m)||e.isElementReadOnly(m))){yield Se.start(e,v)
3474continue}if(e.isInline(m))continue
3475if(Se.hasInlines(e,m)){var b=ie.isAncestor(v,c.path)?c:Se.end(e,v),y=ie.isAncestor(v,l.path)?l:Se.start(e,v)
3476p=Se.string(e,{anchor:y,focus:b},{voids:i}),d=!0}}if(ze.isText(m)){var x=ie.equals(v,u.path)
3477for(x?(g=r?u.offset:m.text.length-u.offset,f=u.offset):(g=m.text.length,f=r?g:0),(x||d||"offset"===a)&&(yield{path:v,offset:f},d=!1);;){if(0===h){if(""===p)break
3478h=C(p,a,r),p=Ge(p,h,r)[1]}if(f=r?f-h:f+h,(g-=h)<0){h=-g
3479break}h=0,yield{path:v,offset:f}}}}}function C(e,t,n){return"character"===t?Ve(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,a=!1;e.length>0;){var r=Ve(e,t),[i,o]=Ge(e,r,t)
3480if(Ye(i,o,t))a=!0,n+=r
3481else{if(a)break
3482n+=r}e=o}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}function _t(e,t){var n=Object.keys(e)
3483if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3484t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var $t=(e,t)=>{var{selection:n}=e
3485if(n){var a=(t,n)=>{if(!ze.isText(t))return!1
3486var[a,r]=Se.parent(e,n)
3487return!e.isVoid(a)||e.markableVoid(a)},r=be.isExpanded(n),i=!1
3488if(!r){var[o,s]=Se.node(e,n)
3489if(o&&a(o,s)){var[l]=Se.parent(e,s)
3490i=l&&e.markableVoid(l)}}if(r||i)yt.unsetNodes(e,t,{match:a,split:!0,voids:!0})
3491else{var c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3492t%2?_t(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Se.marks(e)||{})
3493delete c[t],e.marks=c,ee.get(e)||e.onChange()}}}
3494function zt(e,t){var n=Object.keys(e)
3495if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3496t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3497t%2?zt(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ut=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3498Se.withoutNormalizing(e,(()=>{var{hanging:a=!1,voids:r=!1,mode:i="lowest",batchDirty:o=!0}=n,{at:s,match:l,select:c}=n
3499if(Ae.isNode(t)&&(t=[t]),0!==t.length){var[u]=t
3500if(s||(s=We(e),!1!==c&&(c=!0)),null==c&&(c=!1),be.isRange(s))if(a||(s=Se.unhangRange(e,s,{voids:r})),be.isCollapsed(s))s=s.anchor
3501else{var[,d]=be.edges(s),p=Se.pointRef(e,d)
3502yt.delete(e,{at:s}),s=p.unref()}if(Me.isPoint(s)){null==l&&(l=ze.isText(u)?e=>ze.isText(e):e.isInline(u)?t=>ze.isText(t)||Se.isInline(e,t):t=>xe.isElement(t)&&Se.isBlock(e,t))
3503var[h]=Se.nodes(e,{at:s.path,match:l,mode:i,voids:r})
3504if(!h)return
3505var[,g]=h,f=Se.pathRef(e,g),m=Se.isEnd(e,s,g)
3506yt.splitNodes(e,{at:s,match:l,mode:i,voids:r})
3507var v=f.unref()
3508s=m?ie.next(v):v}var b=ie.parent(s),y=s[s.length-1]
3509if(r||!Se.void(e,{at:b})){if(o){var x=[],C=ie.levels(b);((e,t,n)=>{var a=xt.get(e)||!1
3510xt.set(e,!0)
3511try{t(),n()}finally{xt.set(e,a)}})(e,(()=>{var n=function(){var t=b.concat(y)
3512y++
3513var n={type:"insert_node",path:t,node:a}
3514e.apply(n),s=ie.next(s),x.push(n),ze.isText?C.push(...Array.from(Ae.nodes(a),(e=>{var[,n]=e
3515return t.concat(n)}))):C.push(t)}
3516for(var a of t)n()}),(()=>{Ct(e,C,(e=>{var t=e
3517for(var n of x)if(ie.operationCanTransformPath(n)&&!(t=ie.transform(t,n)))return null
3518return t}))}))}else for(var D of t){var w=b.concat(y)
3519y++,e.apply({type:"insert_node",path:w,node:D}),s=ie.next(s)}if(s=ie.previous(s),c){var A=Se.end(e,s)
3520A&&yt.select(e,A)}}}}))},Vt=["text"],Ht=["children"],Kt=(e,t)=>{if(xe.isElement(t)){var n=t
3521return!!Se.isVoid(e,t)||1===n.children.length&&Kt(e,n.children[0])}return!Se.isEditor(t)},qt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3522Se.withoutNormalizing(e,(()=>{var{mode:n="lowest",voids:a=!1}=t,{match:r,at:i=e.selection,height:o=0,always:s=!1}=t
3523if(null==r&&(r=t=>xe.isElement(t)&&Se.isBlock(e,t)),be.isRange(i)&&(i=((e,t)=>{if(be.isCollapsed(t))return t.anchor
3524var[,n]=be.edges(t),a=Se.pointRef(e,n)
3525return yt.delete(e,{at:t}),a.unref()})(e,i)),ie.isPath(i)){var l=i,c=Se.point(e,l),[u]=Se.parent(e,l)
3526r=e=>e===u,o=c.path.length-l.length+1,i=c,s=!0}if(i){var d,p=Se.pointRef(e,i,{affinity:"backward"})
3527try{var[h]=Se.nodes(e,{at:i,match:r,mode:n,voids:a})
3528if(!h)return
3529var g=Se.void(e,{at:i,mode:"highest"})
3530if(!a&&g){var[f,m]=g
3531if(xe.isElement(f)&&e.isInline(f)){var v=Se.after(e,m)
3532if(!v){var b=ie.next(m)
3533yt.insertNodes(e,{text:""},{at:b,voids:a}),v=Se.point(e,b)}i=v,s=!0}o=i.path.length-m.length+1,s=!0}d=Se.pointRef(e,i)
3534var y=i.path.length-o,[,x]=h,C=i.path.slice(0,y),D=0===o?i.offset:i.path[y]+0
3535for(var[w,A]of Se.levels(e,{at:C,reverse:!0,voids:a})){var E=!1
3536if(A.length<x.length||0===A.length||!a&&xe.isElement(w)&&Se.isVoid(e,w))break
3537var j=p.current,B=Se.isEnd(e,j,A)
3538if(s||!p||!Se.isEdge(e,j,A)){E=!0
3539var k=Ae.extractProps(w)
3540e.apply({type:"split_node",path:A,position:D,properties:k})}D=A[A.length-1]+(E||B?1:0)}if(null==t.at){var S=d.current||Se.end(e,[])
3541yt.select(e,S)}}finally{var N
3542p.unref(),null===(N=d)||void 0===N||N.unref()}}}))}
3543function Gt(e,t){var n=Object.keys(e)
3544if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e)
3545t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{}
3546t%2?Gt(Object(n),!0).forEach((function(t){le(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jt=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3547return Dt(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3548return((e,t,n)=>{var{selection:a}=e
3549if(a){var r=(t,n)=>{if(!ze.isText(t))return!1
3550var[a,r]=Se.parent(e,n)
3551return!e.isVoid(a)||e.markableVoid(a)},i=be.isExpanded(a),o=!1
3552if(!i){var[s,l]=Se.node(e,a)
3553if(s&&r(s,l)){var[c]=Se.parent(e,l)
3554o=c&&e.markableVoid(c)}}if(i||o)yt.setNodes(e,{[t]:n},{match:r,split:!0,voids:!0})
3555else{var u=At(At({},Se.marks(e)||{}),{},{[t]:n})
3556e.marks=u,ee.get(e)||e.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3557return((e,t)=>{var{selection:n}=e
3558n&&be.isCollapsed(n)&&yt.delete(e,{unit:t,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3559return((e,t)=>{var{selection:n}=e
3560n&&be.isCollapsed(n)&&yt.delete(e,{unit:t})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3561return function(e){var{direction:t="forward"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e
3562n&&be.isExpanded(n)&&yt.delete(e,{reverse:"backward"===t})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3563return(e=>{var{selection:t}=e
3564return t?Ae.fragment(e,t):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3565return(e=>{yt.splitNodes(e,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3566return(e=>{yt.splitNodes(e,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3567return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3568Se.withoutNormalizing(e,(()=>{var{hanging:a=!1,voids:r=!1}=n,{at:i=We(e),batchDirty:o=!0}=n
3569if(t.length){if(be.isRange(i))if(a||(i=Se.unhangRange(e,i,{voids:r})),be.isCollapsed(i))i=i.anchor
3570else{var[,s]=be.edges(i)
3571if(!r&&Se.void(e,{at:s}))return
3572var l=Se.pointRef(e,s)
3573yt.delete(e,{at:i}),i=l.unref()}else ie.isPath(i)&&(i=Se.start(e,i))
3574if(r||!Se.void(e,{at:i})){var c=Se.above(e,{at:i,match:t=>xe.isElement(t)&&Se.isInline(e,t),mode:"highest",voids:r})
3575if(c){var[,u]=c
3576Se.isEnd(e,i,u)?i=Se.after(e,u):Se.isStart(e,i,u)&&(i=Se.before(e,u))}var d=Se.above(e,{match:t=>xe.isElement(t)&&Se.isBlock(e,t),at:i,voids:r}),[,p]=d,h=Se.isStart(e,i,p),g=Se.isEnd(e,i,p),f=h&&g,m=!h||h&&g,v=!g,[,b]=Ae.first({children:t},[]),[,y]=Ae.last({children:t},[]),x=[],C=t=>{var[n,a]=t
3577return!(0===a.length||!f&&(m&&ie.isAncestor(a,b)&&xe.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||v&&ie.isAncestor(a,y)&&xe.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))}
3578for(var D of Ae.nodes({children:t},{pass:C}))C(D)&&x.push(D)
3579var w=[],A=[],E=[],j=!0,B=!1
3580for(var[k]of x)xe.isElement(k)&&!e.isInline(k)?(j=!1,B=!0,A.push(k)):j?w.push(k):E.push(k)
3581var[S]=Se.nodes(e,{at:i,match:t=>ze.isText(t)||Se.isInline(e,t),mode:"highest",voids:r}),[,N]=S,F=Se.isStart(e,i,N),O=Se.isEnd(e,i,N),M=Se.pathRef(e,g&&!E.length?ie.next(p):p),P=Se.pathRef(e,O?ie.next(N):N)
3582yt.splitNodes(e,{at:i,match:t=>B?xe.isElement(t)&&Se.isBlock(e,t):ze.isText(t)||Se.isInline(e,t),mode:B?"lowest":"highest",always:B&&(!h||w.length>0)&&(!g||E.length>0),voids:r})
3583var T,I=Se.pathRef(e,!F||F&&O?ie.next(N):N)
3584if(yt.insertNodes(e,w,{at:I.current,match:t=>ze.isText(t)||Se.isInline(e,t),mode:"highest",voids:r,batchDirty:o}),f&&!w.length&&A.length&&!E.length&&yt.delete(e,{at:p,voids:r}),yt.insertNodes(e,A,{at:M.current,match:t=>xe.isElement(t)&&Se.isBlock(e,t),mode:"lowest",voids:r,batchDirty:o}),yt.insertNodes(e,E,{at:P.current,match:t=>ze.isText(t)||Se.isInline(e,t),mode:"highest",voids:r,batchDirty:o}),!n.at&&(E.length>0&&P.current?T=ie.previous(P.current):A.length>0&&M.current?T=ie.previous(M.current):I.current&&(T=ie.previous(I.current)),T)){var R=Se.end(e,T)
3585yt.select(e,R)}I.unref(),M.unref(),P.unref()}}}))}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3586return((e,t,n)=>{yt.insertNodes(e,t,n)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3587return Pt(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3588return((e,t)=>{var[n,a]=t
3589if(!ze.isText(n))if(xe.isElement(n)&&0===n.children.length)yt.insertNodes(e,{text:""},{at:a.concat(0),voids:!0})
3590else for(var r=!Se.isEditor(n)&&xe.isElement(n)&&(e.isInline(n)||0===n.children.length||ze.isText(n.children[0])||e.isInline(n.children[0])),i=0,o=0;o<n.children.length;o++,i++){var s=Ae.get(e,a)
3591if(!ze.isText(s)){var l=s.children[i],c=s.children[i-1],u=o===n.children.length-1;(ze.isText(l)||xe.isElement(l)&&e.isInline(l))!==r?(yt.removeNodes(e,{at:a.concat(i),voids:!0}),i--):xe.isElement(l)?e.isInline(l)&&(null!=c&&ze.isText(c)?u&&(yt.insertNodes(e,{text:""},{at:a.concat(i+1),voids:!0}),i++):(yt.insertNodes(e,{text:""},{at:a.concat(i),voids:!0}),i++)):(ze.isText(l)||"children"in l||(l.children=[]),null!=c&&ze.isText(c)&&(ze.equals(l,c,{loose:!0})?(yt.mergeNodes(e,{at:a.concat(i),voids:!0}),i--):""===c.text?(yt.removeNodes(e,{at:a.concat(i-1),voids:!0}),i--):""===l.text&&(yt.removeNodes(e,{at:a.concat(i),voids:!0}),i--)))}}})(e,...n)},removeMark:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3592return $t(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3593return((e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t
3594return ie.levels(n)
3595case"insert_node":var{node:a,path:r}=t,i=ie.levels(r),o=ze.isText(a)?[]:Array.from(Ae.nodes(a),(e=>{var[,t]=e
3596return r.concat(t)}))
3597return[...i,...o]
3598case"merge_node":var{path:s}=t
3599return[...ie.ancestors(s),ie.previous(s)]
3600case"move_node":var{path:l,newPath:c}=t
3601if(ie.equals(l,c))return[]
3602var u=[],d=[]
3603for(var p of ie.ancestors(l)){var h=ie.transform(p,t)
3604u.push(h)}for(var g of ie.ancestors(c)){var f=ie.transform(g,t)
3605d.push(f)}var m=d[d.length-1],v=c[c.length-1],b=m.concat(v)
3606return[...u,...d,b]
3607case"remove_node":var{path:y}=t
3608return[...ie.ancestors(y)]
3609case"split_node":var{path:x}=t
3610return[...ie.levels(x),ie.next(x)]
3611default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3612return((e,t)=>{var{iteration:n,initialDirtyPathsLength:a}=t,r=42*a
3613if(n>r)throw new Error("Could not completely normalize the editor after ".concat(r," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."))
3614return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3615return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:a="lowest",at:r=e.selection,match:i}=t
3616if(r){var o=Se.path(e,r),s="lowest"===a
3617for(var[l,c]of Se.levels(e,{at:o,voids:n,match:i,reverse:s}))if(!ze.isText(l))if(be.isRange(r)){if(ie.isAncestor(c,r.anchor.path)&&ie.isAncestor(c,r.focus.path))return[l,c]}else if(!ie.equals(o,c))return[l,c]}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3618return function(e,t){var n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={anchor:Se.point(e,t,{edge:"end"}),focus:Se.end(e,[])},{distance:i=1}=a,o=0
3619for(var s of Se.positions(e,jt(jt({},a),{},{at:r}))){if(o>i)break
36200!==o&&(n=s),o++}return n}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3621return function(e,t){var n,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={anchor:Se.start(e,[]),focus:Se.point(e,t,{edge:"start"})},{distance:i=1}=a,o=0
3622for(var s of Se.positions(e,kt(kt({},a),{},{at:r,reverse:!0}))){if(o>i)break
36230!==o&&(n=s),o++}return n}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3624return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:a}=e
3625if(a)if("anchor"===n)yt.select(e,a.anchor)
3626else if("focus"===n)yt.select(e,a.focus)
3627else if("start"===n){var[r]=be.edges(a)
3628yt.select(e,r)}else if("end"===n){var[,i]=be.edges(a)
3629yt.select(e,i)}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3630return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3631Se.withoutNormalizing(e,(()=>{var n,a,{reverse:r=!1,unit:i="character",distance:o=1,voids:s=!1}=t,{at:l=e.selection,hanging:c=!1}=t
3632if(l){var u=!1
3633if(be.isRange(l)&&be.isCollapsed(l)&&(u=!0,l=l.anchor),Me.isPoint(l)){var d=Se.void(e,{at:l,mode:"highest"})
3634if(!s&&d){var[,p]=d
3635l=p}else{var h={unit:i,distance:o}
3636l={anchor:l,focus:r?Se.before(e,l,h)||Se.start(e,[]):Se.after(e,l,h)||Se.end(e,[])},c=!0}}if(ie.isPath(l))yt.removeNodes(e,{at:l,voids:s})
3637else if(!be.isCollapsed(l)){if(!c){var[,g]=be.edges(l),f=Se.end(e,[])
3638Me.equals(g,f)||(l=Se.unhangRange(e,l,{voids:s}))}var[m,v]=be.edges(l),b=Se.above(e,{match:t=>xe.isElement(t)&&Se.isBlock(e,t),at:m,voids:s}),y=Se.above(e,{match:t=>xe.isElement(t)&&Se.isBlock(e,t),at:v,voids:s}),x=b&&y&&!ie.equals(b[1],y[1]),C=ie.equals(m.path,v.path),D=s?null:null!==(n=Se.void(e,{at:m,mode:"highest"}))&&void 0!==n?n:Se.elementReadOnly(e,{at:m,mode:"highest"}),w=s?null:null!==(a=Se.void(e,{at:v,mode:"highest"}))&&void 0!==a?a:Se.elementReadOnly(e,{at:v,mode:"highest"})
3639if(D){var A=Se.before(e,m)
3640A&&b&&ie.isAncestor(b[1],A.path)&&(m=A)}if(w){var E=Se.after(e,v)
3641E&&y&&ie.isAncestor(y[1],E.path)&&(v=E)}var j,B=[]
3642for(var k of Se.nodes(e,{at:l,voids:s})){var[S,N]=k
3643j&&0===ie.compare(N,j)||(!s&&xe.isElement(S)&&(Se.isVoid(e,S)||Se.isElementReadOnly(e,S))||!ie.isCommon(N,m.path)&&!ie.isCommon(N,v.path))&&(B.push(k),j=N)}var F=Array.from(B,(t=>{var[,n]=t
3644return Se.pathRef(e,n)})),O=Se.pointRef(e,m),M=Se.pointRef(e,v),P=""
3645if(!C&&!D){var T=O.current,[I]=Se.leaf(e,T),{path:R}=T,{offset:L}=m,_=I.text.slice(L)
3646_.length>0&&(e.apply({type:"remove_text",path:R,offset:L,text:_}),P=_)}if(F.reverse().map((e=>e.unref())).filter((e=>null!==e)).forEach((t=>yt.removeNodes(e,{at:t,voids:s}))),!w){var $=M.current,[z]=Se.leaf(e,$),{path:W}=$,U=C?m.offset:0,V=z.text.slice(U,v.offset)
3647V.length>0&&(e.apply({type:"remove_text",path:W,offset:U,text:V}),P=V)}!C&&x&&M.current&&O.current&&yt.mergeNodes(e,{at:M.current,hanging:!0,voids:s}),u&&r&&"character"===i&&P.length>1&&P.match(/[\u0E00-\u0E7F]+/)&&yt.insertText(e,P.slice(0,P.length-o))
3648var H=O.unref(),K=M.unref(),q=r?H||K:K||H
3649null==t.at&&q&&yt.select(e,q)}}}))}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3650return(e=>{var{selection:t}=e
3651t&&e.apply({type:"set_selection",properties:t,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3652return((e,t)=>[Se.start(e,t),Se.end(e,t)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3653return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3654return Se.above(e,Nt(Nt({},t),{},{match:t=>xe.isElement(t)&&Se.isElementReadOnly(e,t)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3655return((e,t)=>Se.point(e,t,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3656return((e,t)=>{var n=Se.path(e,t,{edge:"start"})
3657return Se.node(e,n)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3658return((e,t)=>{var n=Se.range(e,t)
3659return Ae.fragment(e,n)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3660return function(e){var{marks:t,selection:n}=e
3661if(!n)return null
3662var{anchor:a,focus:r}=n
3663if(t)return t
3664if(be.isExpanded(n)){if(Se.isEnd(e,a,a.path)){var i=Se.after(e,a)
3665i&&(a=i)}var[o]=Se.nodes(e,{match:ze.isText,at:{anchor:a,focus:r}})
3666if(o){var[s]=o
3667return fe(s,Tt)}return{}}var{path:l}=a,[c]=Se.leaf(e,l)
3668if(0===a.offset){var u=Se.previous(e,{at:l,match:ze.isText})
3669if(!Se.above(e,{match:t=>xe.isElement(t)&&Se.isVoid(e,t)&&e.markableVoid(t)})){var d=Se.above(e,{match:t=>xe.isElement(t)&&Se.isBlock(e,t)})
3670if(u&&d){var[p,h]=u,[,g]=d
3671ie.isAncestor(g,h)&&(c=p)}}}return fe(c,It)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3672return((e,t)=>t.children.some((t=>xe.isElement(t)&&Se.isBlock(e,t))))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3673return((e,t)=>t.children.some((t=>ze.isText(t)||Se.isInline(e,t))))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3674return((e,t)=>Ae.has(e,t))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3675return((e,t)=>t.children.every((e=>ze.isText(e))))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3676return Ut(e,...n)},isBlock:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3677return((e,t)=>!e.isInline(t))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3678return((e,t,n)=>
3678Se.isStart(e,t,n)||Se.isEnd(e,t,n))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3679return((e,t)=>{var{children:n}=t,[a]=n
3680return 0===n.length||1===n.length&&ze.isText(a)&&""===a.text&&!e.isVoid(t)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3681return((e,t,n)=>{var a=Se.end(e,n)
3682return Me.equals(t,a)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3683return(e=>{var t=te.get(e)
3684return void 0===t||t})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3685return((e,t,n)=>{if(0!==t.offset)return!1
3686var a=Se.start(e,n)
3687return Me.equals(t,a)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3688return((e,t)=>{var n=Se.path(e,t,{edge:"end"})
3689return Se.node(e,n)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3690return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Se.path(e,t,n)
3691return[Ae.leaf(e,a),a]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3692return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3693return function*(){var{at:n=e.selection,reverse:a=!1,voids:r=!1}=t,{match:i}=t
3694if(null==i&&(i=()=>!0),n){var o=[],s=Se.path(e,n)
3695for(var[l,c]of Ae.levels(e,s))if(i(l,c)&&(o.push([l,c]),!r&&xe.isElement(l)&&Se.isVoid(e,l)))break
3696a&&o.reverse(),yield*o}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3697return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3698Se.withoutNormalizing(e,(()=>{var{at:n=e.selection,mode:a="lowest",voids:r=!1}=t,{match:i}=t
3699if(null==i&&(i=ie.isPath(n)?Ue(e,n):t=>xe.isElement(t)&&Se.isBlock(e,t)),n){var o=Se.nodes(e,{at:n,match:i,mode:a,voids:r}),s=Array.from(o,(t=>{var[,n]=t
3700return Se.pathRef(e,n)}))
3701for(var l of s){var c=l.unref()
3702if(c.length<2)throw new Error("Cannot lift node at a path [".concat(c,"] because it has a depth of less than `2`."))
3703var u=Se.node(e,ie.parent(c)),[d,p]=u,h=c[c.length-1],{length:g}=d.children
3704if(1===g){var f=ie.next(p)
3705yt.moveNodes(e,{at:c,to:f,voids:r}),yt.removeNodes(e,{at:p,voids:r})}else if(0===h)yt.moveNodes(e,{at:c,to:p,voids:r})
3706else if(h===g-1){var m=ie.next(p)
3707yt.moveNodes(e,{at:c,to:m,voids:r})}else{var v=ie.next(c),b=ie.next(p)
3708yt.splitNodes(e,{at:v,voids:r}),yt.moveNodes(e,{at:c,to:b,voids:r})}}}}))}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3709return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3710Se.withoutNormalizing(e,(()=>{var{match:n,at:a=e.selection}=t,{hanging:r=!1,voids:i=!1,mode:o="lowest"}=t
3711if(a){if(null==n)if(ie.isPath(a)){var[s]=Se.parent(e,a)
3712n=e=>s.children.includes(e)}else n=t=>xe.isElement(t)&&Se.isBlock(e,t)
3713if(!r&&be.isRange(a)&&(a=Se.unhangRange(e,a,{voids:i})),be.isRange(a))if(be.isCollapsed(a))a=a.anchor
3714else{var[,l]=be.edges(a),c=Se.pointRef(e,l)
3715yt.delete(e,{at:a}),a=c.unref(),null==t.at&&yt.select(e,a)}var[u]=Se.nodes(e,{at:a,match:n,voids:i,mode:o}),d=Se.previous(e,{at:a,match:n,voids:i,mode:o})
3716if(u&&d){var[p,h]=u,[g,f]=d
3717if(0!==h.length&&0!==f.length){var m,v,b=ie.next(f),y=ie.common(h,f),x=ie.isSibling(h,f),C=Array.from(Se.levels(e,{at:h}),(e=>{var[t]=e
3718return t})).slice(y.length).slice(0,-1),D=Se.above(e,{at:h,mode:"highest",match:t=>C.includes(t)&&Kt(e,t)}),w=D&&Se.pathRef(e,D[1])
3719if(ze.isText(p)&&ze.isText(g)){var A=fe(p,Vt)
3720v=g.text.length,m=A}else{if(!xe.isElement(p)||!xe.isElement(g))throw new Error("Cannot merge the node at path [".concat(h,"] with the previous sibling because it is not the same kind: ").concat(Te.stringify(p)," ").concat(Te.stringify(g)))
3721A=fe(p,Ht),v=g.children.length,m=A}x||yt.moveNodes(e,{at:h,to:b,voids:i}),w&&yt.removeNodes(e,{at:w.current,voids:i}),Se.shouldMergeNodesRemovePrevNode(e,d,u)?yt.removeNodes(e,{at:f,voids:i}):e.apply({type:"merge_node",path:b,position:v,properties:m}),w&&w.unref()}}}}))}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3722return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:a=1,unit:r="character",reverse:i=!1}=t,{edge:o=null}=t
3723if(n){"start"===o&&(o=be.isBackward(n)?"focus":"anchor"),"end"===o&&(o=be.isBackward(n)?"anchor":"focus")
3724var{anchor:s,focus:l}=n,c={distance:a,unit:r,ignoreNonSelectable:!0},u={}
3725if(null==o||"anchor"===o){var d=i?Se.before(e,s,c):Se.after(e,s,c)
3726d&&(u.anchor=d)}if(null==o||"focus"===o){var p=i?Se.before(e,l,c):Se.after(e,l,c)
3727p&&(u.focus=p)}yt.setSelection(e,u)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3728return((e,t)=>{Se.withoutNormalizing(e,(()=>{var{to:n,at:a=e.selection,mode:r="lowest",voids:i=!1}=t,{match:o}=t
3729if(a){null==o&&(o=ie.isPath(a)?Ue(e,a):t=>xe.isElement(t)&&Se.isBlock(e,t))
3730var s=Se.pathRef(e,n),l=Se.nodes(e,{at:a,match:o,mode:r,voids:i}),c=Array.from(l,(t=>{var[,n]=t
3731return Se.pathRef(e,n)}))
3732for(var u of c){var d=u.unref(),p=s.current
37330!==d.length&&e.apply({type:"move_node",path:d,newPath:p}),s.current&&ie.isSibling(p,d)&&ie.isAfter(p,d)&&(s.current=ie.next(s.current))}s.unref()}}))})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3734return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:a=!1}=t,{match:r,at:i=e.selection}=t
3735if(i){var o=Se.after(e,i,{voids:a})
3736if(o){var[,s]=Se.last(e,[]),l=[o.path,s]
3737if(ie.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!")
3738if(null==r)if(ie.isPath(i)){var[c]=Se.parent(e,i)
3739r=e=>c.children.includes(e)}else r=()=>!0
3740var[u]=Se.nodes(e,{at:l,match:r,mode:n,voids:a})
3741return u}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3742return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Se.path(e,t,n),r=Ae.get(e,a)
3743return[r,a]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3744return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3745return function*(){var{at:n=e.selection,mode:a="all",universal:r=!1,reverse:i=!1,voids:o=!1,ignoreNonSelectable:s=!1}=t,{match:l}=t
3746if(l||(l=()=>!0),n){var c,u
3747if(Ne.isSpan(n))c=n[0],u=n[1]
3748else{var d=Se.path(e,n,{edge:"start"}),p=Se.path(e,n,{edge:"end"})
3749c=i?p:d,u=i?d:p}var h,g=Ae.nodes(e,{reverse:i,from:c,to:u,pass:t=>{var[n]=t
3750return!(!xe.isElement(n)||(o||!Se.isVoid(e,n)&&!Se.isElementReadOnly(e,n))&&(!s||Se.isSelectable(e,n)))}}),f=[]
3751for(var[m,v]of g)if(!s||!xe.isElement(m)||Se.isSelectable(e,m)){var b=h&&0===ie.compare(v,h[1])
3752if("highest"!==a||!b)if(l(m,v))if("lowest"===a&&b)h=[m,v]
3753else{var y="lowest"===a?h:[m,v]
3754y&&(r?f.push(y):yield y),h=[m,v]}else if(r&&!b&&ze.isText(m))return}"lowest"===a&&h&&(r?f.push(h):yield h),r&&(yield*f)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3755return Rt(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3756return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Se.path(e,t,n),r=ie.parent(a)
3757return Se.node(e,r)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3758return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{depth:a,edge:r}=n
3759if(ie.isPath(t))if("start"===r){var[,i]=Ae.first(e,t)
3760t=i}else if("end"===r){var[,o]=Ae.last(e,t)
3761t=o}return be.isRange(t)&&(t="start"===r?be.start(t):"end"===r?be.end(t):ie.common(t.anchor.path,t.focus.path)),Me.isPoint(t)&&(t=t.path),null!=a&&(t=t.slice(0,a)),t}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3762return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:a="forward"}=n,r={current:t,affinity:a,unref(){var{current:t}=r
3763return Se.pathRefs(e).delete(r),r.current=null,t}}
3764return Se.pathRefs(e).add(r),r}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3765return(e=>{var t=ne.get(e)
3766return t||(t=new Set,ne.set(e,t)),t})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3767return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{edge:a="start"}=n
3768if(ie.isPath(t)){var r
3769if("end"===a){var[,i]=Ae.last(e,t)
3770r=i}else{var[,o]=Ae.first(e,t)
3771r=o}var s=Ae.get(e,r)
3772if(!ze.isText(s))throw new Error("Cannot get the ".concat(a," point in the node at path [").concat(t,"] because it has no ").concat(a," text node."))
3773return{path:r,offset:"end"===a?s.text.length:0}}if(be.isRange(t)){var[l,c]=be.edges(t)
3774return"start"===a?l:c}return t}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3775return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:a="forward"}=n,r={current:t,affinity:a,unref(){var{current:t}=r
3776return Se.pointRefs(e).delete(r),r.current=null,t}}
3777return Se.pointRefs(e).add(r),r}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3778return(e=>{var t=ae.get(e)
3779return t||(t=new Set,ae.set(e,t)),t})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3780return Lt(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3781return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:a=!1}=t,{match:r,at:i=e.selection}=t
3782if(i){var o=Se.before(e,i,{voids:a})
3783if(o){var[,s]=Se.first(e,[]),l=[o.path,s]
3784if(ie.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!")
3785if(null==r)if(ie.isPath(i)){var[c]=Se.parent(e,i)
3786r=e=>c.children.includes(e)}else r=()=>!0
3787var[u]=Se.nodes(e,{reverse:!0,at:l,match:r,mode:n,voids:a})
3788return u}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3789return((e,t,n)=>be.isRange(t)&&!n?t:{anchor:Se.start(e,t),focus:Se.end(e,n||t)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3790return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:a="forward"}=n,r={current:t,affinity:a,unref(){var{current:t}=r
3791return Se.rangeRefs(e).delete(r),r.current=null,t}}
3792return Se.rangeRefs(e).add(r),r}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3793return(e=>{var t=re.get(e)
3794return t||(t=new Set,re.set(e,t)),t})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3795return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3796Se.withoutNormalizing(e,(()=>{var{hanging:n=!1,voids:a=!1,mode:r="lowest"}=t,{at:i=e.selection,match:o}=t
3797if(i){null==o&&(o=ie.isPath(i)?Ue(e,i):t=>xe.isElement(t)&&Se.isBlock(e,t)),!n&&be.isRange(i)&&(i=Se.unhangRange(e,i,{voids:a}))
3798var s=Se.nodes(e,{at:i,match:o,mode:r,voids:a}),l=Array.from(s,(t=>{var[,n]=t
3799return Se.pathRef(e,n)}))
3800for(var c of l){var u=c.unref()
3801if(u){var[d]=Se.node(e,u)
3802e.apply({type:"remove_node",path:u,node:d})}}}}))}(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3803return((e,t)=>{var{selection:n}=e
3804if(t=Se.range(e,t),n)yt.setSelection(e,t)
3805else{if(!be.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Te.stringify(t)))
3806e.apply({type:"set_selection",properties:n,newProperties:t})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3807return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3808Se.withoutNormalizing(e,(()=>{var{match:a,at:r=e.selection,compare:i,merge:o}=n,{hanging:s=!1,mode:l="lowest",split:c=!1,voids:u=!1}=n
3809if(r){if(null==a&&(a=ie.isPath(r)?Ue(e,r):t=>xe.isElement(t)&&Se.isBlock(e,t)),!s&&be.isRange(r)&&(r=Se.unhangRange(e,r,{voids:u})),c&&be.isRange(r)){if(be.isCollapsed(r)&&Se.leaf(e,r.anchor)[0].text.length>0)return
3810var d=Se.rangeRef(e,r,{affinity:"inward"}),[p,h]=be.edges(r),g="lowest"===l?"lowest":"highest",f=Se.isEnd(e,h,h.path)
3811yt.splitNodes(e,{at:h,match:a,mode:g,voids:u,always:!f})
3812var m=Se.isStart(e,p,p.path)
3813yt.splitNodes(e,{at:p,match:a,mode:g,voids:u,always:!m}),r=d.unref(),null==n.at&&yt.select(e,r)}for(var[v,b]of(i||(i=(e,t)=>e!==t),Se.nodes(e,{at:r,match:a,mode:l,voids:u}))){var y={},x={}
3814if(0!==b.length){var C=!1
3815for(var D in t)"children"!==D&&"text"!==D&&i(t[D],v[D])&&(C=!0,v.hasOwnProperty(D)&&(y[D]=v[D]),o?null!=t[D]&&(x[D]=o(v[D],t[D])):null!=t[D]&&(x[D]=t[D]))
3816C&&e.apply({type:"set_node",path:b,properties:y,newProperties:x})}}}}))}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3817return((e,t)=>{te.set(e,t)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3818return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:a}=e,{edge:r="both"}=n
3819if(a){"start"===r&&(r=be.isBackward(a)?"focus":"anchor"),"end"===r&&(r=be.isBackward(a)?"anchor":"focus")
3820var{anchor:i,focus:o}=a,s="anchor"===r?i:o
3821yt.setSelection(e,{["anchor"===r?"anchor":"focus"]:Wt(Wt({},s),t)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3822return((e,t)=>{var{selection:n}=e,a={},r={}
3823if(n){for(var i in t)("anchor"===i&&null!=t.anchor&&!Me.equals(t.anchor,n.anchor)||"focus"===i&&null!=t.focus&&!Me.equals(t.focus,n.focus)||"anchor"!==i&&"focus"!==i&&t[i]!==n[i])&&(a[i]=n[i],r[i]=t[i])
3824Object.keys(a).length>0&&e.apply({type:"set_selection",properties:a,newProperties:r})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3825return qt(e,...n)},start:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3826return((e,t)=>Se.point(e,t,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3827return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:a=!1}=n,r=Se.range(e,t),[i,o]=be.edges(r),s=""
3828for(var[l,c]of Se.nodes(e,{at:r,match:ze.isText,voids:a})){var u=l.text
3829ie.equals(c,o.path)&&(u=u.slice(0,o.offset)),ie.equals(c,i.path)&&(u=u.slice(i.offset)),s+=u}return s}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3830return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:a=!1}=n,[r,i]=be.edges(t)
3831if(0!==r.offset||0!==i.offset||be.isCollapsed(t)||ie.hasPrevious(i.path))return t
3832var o=Se.above(e,{at:i,match:t=>xe.isElement(t)&&Se.isBlock(e,t),voids:a}),s=o?o[1]:[],l={anchor:Se.start(e,r),focus:i},c=!0
3833for(var[u,d]of Se.nodes(e,{at:l,match:ze.isText,reverse:!0,voids:a}))if(c)c=!1
3834else if(""!==u.text||ie.isBefore(d,s)){i={path:d,offset:u.text.length}
3835break}return{anchor:r,focus:i}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3836return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3837Array.isArray(t)||(t=[t])
3838var a={}
3839for(var r of t)a[r]=null
3840yt.setNodes(e,a,n)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3841return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3842Se.withoutNormalizing(e,(()=>{var{mode:n="lowest",split:a=!1,voids:r=!1}=t,{at:i=e.selection,match:o}=t
3843if(i){null==o&&(o=ie.isPath(i)?Ue(e,i):t=>xe.isElement(t)&&Se.isBlock(e,t)),ie.isPath(i)&&(i=Se.range(e,i))
3844var s=be.isRange(i)?Se.rangeRef(e,i):null,l=Se.nodes(e,{at:i,match:o,mode:n,voids:r}),c=Array.from(l,(t=>{var[,n]=t
3845return Se.pathRef(e,n)})).reverse(),u=function(){var t=d.unref(),[n]=Se.node(e,t),i=Se.range(e,t)
3846a&&s&&(i=be.intersection(s.current,i)),yt.liftNodes(e,{at:i,match:e=>xe.isAncestor(n)&&n.children.includes(e),voids:r})}
3847for(var d of c)u()
3848s&&s.unref()}}))}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3849return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
3850return Se.above(e,Ot(Ot({},t),{},{match:t=>xe.isElement(t)&&Se.isVoid(e,t)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3851return((e,t)=>{var n=Se.isNormalizing(e)
3852Se.setNormalizing(e,!1)
3853try{t()}finally{Se.setNormalizing(e,n)}Se.normalize(e)})(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3854return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}
3855Se.withoutNormalizing(e,(()=>{var{mode:a="lowest",split:r=!1,voids:i=!1}=n,{match:o,at:s=e.selection}=n
3856if(s){if(null==o&&(o=ie.isPath(s)?Ue(e,s):e.isInline(t)?t=>xe.isElement(t)&&Se.isInline(e,t)||ze.isText(t):t=>xe.isElement(t)&&Se.isBlock(e,t)),r&&be.isRange(s)){var[l,c]=be.edges(s),u=Se.rangeRef(e,s,{affinity:"inward"})
3857yt.splitNodes(e,{at:c,match:o,voids:i}),yt.splitNodes(e,{at:l,match:o,voids:i}),s=u.unref(),null==n.at&&yt.select(e,s)}var d=Array.from(Se.nodes(e,{at:s,match:e.isInline(t)?t=>xe.isElement(t)&&Se.isBlock(e,t):e=>Se.isEditor(e),mode:"lowest",voids:i})),p=function(){var n=be.isRange(s)?be.intersection(s,Se.range(e,h)):s
3858if(!n)return 0
3859var r=Array.from(Se.nodes(e,{at:n,match:o,mode:a,voids:i}))
3860if(r.length>0){var[l]=r,c=r[r.length-1],[,u]=l,[,d]=c
3861if(0===u.length&&0===d.length)return 0
3862var p=ie.equals(u,d)?ie.parent(u):ie.common(u,d),g=Se.range(e,u,d),f=Se.node(e,p),[m]=f,v=p.length+1,b=ie.next(d.slice(0,v)),y=Yt(Yt({},t),{},{children:[]})
3863yt.insertNodes(e,y,{at:b,voids:i}),yt.moveNodes(e,{at:g,match:e=>xe.isAncestor(m)&&m.children.includes(e),to:b.concat(0),voids:i})}}
3864for(var[,h]of d)p()}}))}(e,...n)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a]
3865return((e,t)=>{var[n,a]=t
3866return xe.isElement(n)&&Se.isEmpty(e,n)||ze.isText(n)&&""===n.text&&0!==a[a.length-1]})(e,...n)}}
3867return e}},96307:(e,t,n)=>{e.exports=n(60544)},60544:function(e,t){var n
3868!function(){"use strict"
3869var a={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"Ae",Å:"A",Æ:"AE",Ç:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"Oe",Ő:"O",Ø:"O",Ù:"U",Ú:"U",Û:"U",Ü:"Ue",Ű:"U",Ý:"Y",Þ:"TH",ß:"ss",à:"a",á:"a",â:"a",ã:"a",ä:"ae",Ã¥:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",í:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"oe",ő:"o",ø:"o",ù:"u",ú:"u",û:"u",ü:"ue",ű:"u",ý:"y",þ:"th",ÿ:"y",ẞ:"SS",ا:"a",Ø£:"a",Ø¥:"i",Ø¢:"aa",ؤ:"u",ئ:"e",Ø¡:"a",ب:"b",ت:"t",Ø«:"th",ج:"j",Ø­:"h",Ø®:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",Ø´:"sh",ص:"s",ض:"dh",Ø·:"t",ظ:"z",ع:"a",غ:"gh",ف:"f",ق:"q",ك:"k",ل:"l",م:"m",ن:"n",ه:"h",و:"w",ي:"y",ى:"a",Ø©:"h",ï»»:"la",ï»·:"laa",ﻹ:"lai",ﻵ:"laa",Ú¯:"g",چ:"ch",Ù¾:"p",ژ:"zh",Ú©:"k",ی:"y","َ":"a","ً":"an","ِ":"e","ٍ":"en","ُ":"u","ٌ":"on","ْ":"","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9",က:"k",ခ:"kh",ဂ:"g",ဃ:"ga",င:"ng",စ:"s",ဆ:"sa",ဇ:"z",စျ:"za",ည:"ny",ဋ:"t",ဌ:"ta",ဍ:"d",ဎ:"da",ဏ:"na",တ:"t",ထ:"ta",ဒ:"d",ဓ:"da",န:"n",ပ:"p",ဖ:"pa",ဗ:"b",ဘ:"ba",မ:"m",ယ:"y",ရ:"ya",လ:"l",ဝ:"w",သ:"th",ဟ:"h",ဠ:"la",အ:"a","ြ":"y","ျ":"ya","ွ":"w","ြွ":"yw","ျွ":"ywa","ှ":"h",ဧ:"e","၏":"-e",ဣ:"i",ဤ:"-i",ဉ:"u",ဦ:"-u",ဩ:"aw",သြော:"aw",ဪ:"aw","၀":"0","၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","္":"","့":"","း":"",č:"c",ď:"d",ě:"e",ň:"n",ř:"r",Å¡:"s",Å¥:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Å :"S",Ť:"T",Å®:"U",Ž:"Z",ހ:"h",ށ:"sh",ނ:"n",ރ:"r",ބ:"b",ޅ:"lh",ކ:"k",އ:"a",ވ:"v",މ:"m",ފ:"f",ދ:"dh",ތ:"th",ލ:"l",ގ:"g",ޏ:"gn",ސ:"s",ޑ:"d",ޒ:"z",ޓ:"t",ޔ:"y",ޕ:"p",ޖ:"j",ޗ:"ch",ޘ:"tt",ޙ:"hh",ޚ:"kh",ޛ:"th",ޜ:"z",ޝ:"sh",ޞ:"s",ޟ:"d",Þ :"t",Þ¡:"z",Þ¢:"a",Þ£:"gh",Þ¤:"q",Þ¥:"w","Þ¦":"a","Þ§":"aa","Þ¨":"i","Þ©":"ee","Þª":"u","Þ«":"oo","Þ¬":"e","Þ­":"ey","Þ®":"o","Þ¯":"oa","Þ°":"",ა:"a",ბ:"b",გ:"g",დ:"d",ე:"e",ვ:"v",ზ:"z",თ:"t",ი:"i",კ:"k",ლ:"l",მ:"m",ნ:"n",ო:"o",პ:"p",ჟ:"zh",რ:"r",ს:"s",ტ:"t",უ:"u",ფ:"p",ქ:"k",ღ:"gh",ყ:"q",შ:"sh",ჩ:"ch",ც:"ts",ძ:"dz",წ:"ts",ჭ:"ch",ხ:"kh",ჯ:"j",ჰ:"h",α:"a",β:"v",γ:"g",δ:"d",ε:"e",ζ:"z",η:"i",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"ks",ο:"o",π:"p",ρ:"r",σ:"s",τ:"t",υ:"y",φ:"f",χ:"x",ψ:"ps",ω:"o",ά:"a",έ:"e",ί:"i",ό:"o",ύ:"y",ή:"i",ώ:"o",ς:"s",ϊ:"i",ΰ:"y",ϋ:"y",ΐ:"i",Α:"A",Β:"B",Γ:"G",Δ:"D",Ε:"E",Ζ:"Z",Η:"I",Θ:"TH",Ι:"I",Κ:"K",Λ:"L",Μ:"M",Ν:"N",Ξ:"KS",Ο:"O",Π:"P",Ρ:"R",Σ:"S",Τ:"T",Î¥:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"O",Ά:"A",Έ:"E",Ί:"I",Ό:"O",Ύ:"Y",Ή:"I",Ώ:"O",Ϊ:"I",Ϋ:"Y",ā:"a",ē:"e",Ä£:"g",Ä«:"i",Ä·:"k",ļ:"l",ņ:"n",Å«:"u",Ā:"A",Ē:"E",Ä¢:"G",Ī:"I",Ķ:"k",Ä»:"L",Ņ:"N",Ū:"U",Ќ:"Kj",ќ:"kj",Љ:"Lj",љ:"lj",Њ:"Nj",њ:"nj",Тс:"Ts",тс:"ts",ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"E",Ł:"L",Ń:"N",Ś:"S",Ź:"Z",Å»:"Z",Є:"Ye",І:"I",Ї:"Yi",Ґ:"G",є:"ye",і:"i",ї:"yi",ґ:"g",ă:"a",Ă:"A",ș:"s",Ș:"S",ț:"t",Ț:"T",Å£:"t",Å¢:"T",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"kh",ц:"c",ч:"ch",ш:"sh",щ:"sh",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya",А:"A",Б:"B",В:"V",Г:"G",Д:"D",Е:"E",Ё:"Yo",Ж:"Zh",З:"Z",И:"I",Й:"I",К:"K",Л:"L",М:"M",Н:"N",О:"O",П:"P",Р:"R",С:"S",Т:"T",У:"U",Ф:"F",Ð¥:"Kh",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"",Ы:"Y",Ь:"",Э:"E",Ю:"Yu",Я:"Ya",ђ:"dj",ј:"j",ћ:"c",џ:"dz",Ђ:"Dj",Ј:"j",Ћ:"C",Џ:"Dz",ľ:"l",ĺ:"l",ŕ:"r",Ľ:"L",Ĺ:"L",Ŕ:"R",ş:"s",Ş:"S",ı:"i",İ:"I",ğ:"g",Ğ:"G",ả:"a",Ả:"A",á
3869º³:"a",Ẳ:"A",ẩ:"a",Ẩ:"A",đ:"d",Đ:"D",ẹ:"e",Ẹ:"E",ẽ:"e",Ẽ:"E",ẻ:"e",Ẻ:"E",ế:"e",Ế:"E",ề:"e",Ề:"E",ệ:"e",Ệ:"E",ễ:"e",Ễ:"E",ể:"e",Ể:"E",ỏ:"o",ọ:"o",Ọ:"o",ố:"o",Ố:"O",ồ:"o",Ồ:"O",ổ:"o",Ổ:"O",ộ:"o",Ộ:"O",ỗ:"o",Ỗ:"O",Æ¡:"o",Æ :"O",ớ:"o",Ớ:"O",ờ:"o",Ờ:"O",ợ:"o",Ợ:"O",ỡ:"o",á» :"O",Ở:"o",ở:"o",ị:"i",Ị:"I",Ä©:"i",Ĩ:"I",ỉ:"i",Ỉ:"i",á»§:"u",Ủ:"U",ụ:"u",Ụ:"U",Å©:"u",Ũ:"U",ư:"u",Ư:"U",ứ:"u",Ứ:"U",ừ:"u",Ừ:"U",á»±:"u",á»°:"U",ữ:"u",á»®:"U",á»­:"u",Ử:"ư",á»·:"y",á»¶:"y",ỳ:"y",Ỳ:"Y",ỵ:"y",á»´:"Y",ỹ:"y",Ỹ:"Y",ạ:"a",Ạ:"A",ấ:"a",Ấ:"A",ầ:"a",Ầ:"A",ậ:"a",Ậ:"A",ẫ:"a",Ẫ:"A",ắ:"a",Ắ:"A",ằ:"a",Ằ:"A",ặ:"a",Ặ:"A",ẵ:"a",Ẵ:"A","⓪":"0","①":"1","②":"2","③":"3","④":"4","⑤":"5","⑥":"6","⑦":"7","⑧":"8","⑨":"9","⑩":"10","⑪":"11","⑫":"12","⑬":"13","⑭":"14","⑮":"15","⑯":"16","⑰":"17","⑱":"18","⑲":"18","⑳":"18","⓵":"1","⓶":"2","⓷":"3","⓸":"4","⓹":"5","⓺":"6","⓻":"7","⓼":"8","⓽":"9","⓾":"10","⓿":"0","⓫":"11","⓬":"12","⓭":"13","⓮":"14","⓯":"15","⓰":"16","⓱":"17","⓲":"18","⓳":"19","⓴":"20","Ⓐ":"A","Ⓑ":"B","Ⓒ":"C","Ⓓ":"D","Ⓔ":"E","Ⓕ":"F","Ⓖ":"G","Ⓗ":"H","Ⓘ":"I","Ⓙ":"J","Ⓚ":"K","Ⓛ":"L","Ⓜ":"M","Ⓝ":"N","Ⓞ":"O","Ⓟ":"P","Ⓠ":"Q","Ⓡ":"R","Ⓢ":"S","Ⓣ":"T","Ⓤ":"U","Ⓥ":"V","Ⓦ":"W","Ⓧ":"X","Ⓨ":"Y","Ⓩ":"Z","ⓐ":"a","ⓑ":"b","ⓒ":"c","ⓓ":"d","ⓔ":"e","ⓕ":"f","ⓖ":"g","ⓗ":"h","ⓘ":"i","ⓙ":"j","ⓚ":"k","ⓛ":"l","ⓜ":"m","ⓝ":"n","ⓞ":"o","ⓟ":"p","ⓠ":"q","ⓡ":"r","ⓢ":"s","ⓣ":"t","ⓤ":"u","ⓦ":"v","ⓥ":"w","ⓧ":"x","ⓨ":"y","ⓩ":"z","“":'"',"”":'"',"‘":"'","’":"'","∂":"d",ƒ:"f","™":"(TM)","©":"(C)",œ:"oe",Œ:"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o",º:"o",ª:"a","•":"*","၊":",","။":".",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","Â¥":"CNY",元:"CNY",円:"YEN","ï·¼":"IRR","₠":"EWE","฿":"THB","₨":"INR","₹":"INR","₰":"PF","₺":"TRY","؋":"AFN","₼":"AZN",лв:"BGN","៛":"KHR","₡":"CRC","₸":"KZT",ден:"MKD",zł:"PLN","₽":"RUB","₾":"GEL"},r=["်","Þ°"],i={"ာ":"a","ါ":"a","ေ":"e","ဲ":"e","ိ":"i","ီ":"i","ို":"o","ု":"u","ူ":"u","ေါင်":"aung","ော":"aw","ော်":"aw","ေါ":"aw","ေါ်":"aw","်":"်",က်:"et","ိုက်":"aik","ောက်":"auk",င်:"in","ိုင်":"aing","ောင်":"aung",စ်:"it",ည်:"i",တ်:"at","ိတ်":"eik","ုတ်":"ok","ွတ်":"ut","ေတ်":"it",ဒ်:"d","ိုဒ်":"ok","ုဒ်":"ait",န်:"an","ာန်":"an","ိန်":"ein","ုန်":"on","ွန်":"un",ပ်:"at","ိပ်":"eik","ုပ်":"ok","ွပ်":"ut",န်ုပ်:"nub",မ်:"an","ိမ်":"ein","ုမ်":"on","ွမ်":"un",ယ်:"e","ိုလ်":"ol",ဉ်:"in","ံ":"an","ိံ":"ein","ုံ":"on","ައް":"ah","ަށް":"ah"},o={en:{},az:{ç:"c",ə:"e",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"C",Ə:"E",Ğ:"G",İ:"I",Ö:"O",Ş:"S",Ü:"U"},cs:{č:"c",ď:"d",ě:"e",ň:"n",ř:"r",Å¡:"s",Å¥:"t",ů:"u",ž:"z",Č:"C",Ď:"D",Ě:"E",Ň:"N",Ř:"R",Å :"S",Ť:"T",Å®:"U",Ž:"Z"},fi:{ä:"a",Ä:"A",ö:"o",Ö:"O"},hu:{ä:"a",Ä:"A",ö:"o",Ö:"O",ü:"u",Ü:"U",ű:"u",Ű:"U"},lt:{ą:"a",č:"c",ę:"e",ė:"e",į:"i",Å¡:"s",ų:"u",Å«:"u",ž:"z",Ą:"A",Č:"C",Ę:"E",Ė:"E",Ä®:"I",Å :"S",Ų:"U",Ū:"U"},lv:{ā:"a",č:"c",ē:"e",Ä£:"g",Ä«:"i",Ä·:"k",ļ:"l",ņ:"n",Å¡:"s",Å«:"u",ž:"z",Ā:"A",Č:"C",Ē:"E",Ä¢:"G",Ī:"i",Ķ:"k",Ä»:"L",Ņ:"N",Å :"S",Ū:"u",Ž:"Z"},pl:{ą:"a",ć:"c",ę:"e",ł:"l",ń:"n",ó:"o",ś:"s",ź:"z",ż:"z",Ą:"A",Ć:"C",Ę:"e",Ł:"L",Ń:"N",Ó:"O",Ś:"S",Ź:"Z",Å»:"Z"},sv:{ä:"a",Ä:"A",ö:"o",Ö:"O"},sk:{ä:"a",Ä:"A"},sr:{љ:"lj",њ:"nj",Љ:"Lj",Њ:"Nj",đ:"dj",Đ:"Dj"},tr:{Ü:"U",Ö:"O",ü:"u",ö:"o"}},s={ar:{"∆":"delta","∞":"la-nihaya","♥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","∑":"majmou","¤":"omla"},az:{},ca:{"∆":"delta","∞":"infinit","♥":"amor","&":"i","|":"o","<":"menys que",">":"mes que","∑":"suma dels","¤":"moneda"},cs:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mensi nez",">":"vetsi nez","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},dv:{"∆":"delta","∞":"kolunulaa","♥":"loabi","&":"aai","|":"noonee","<":"ah vure kuda",">":"ah vure bodu","∑":"jumula","¤":"faisaa"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fa:{"∆":"delta","∞":"bi-nahayat","♥":"eshgh","&":"va","|":"ya","<":"kamtar-az",">":"bishtar-az","∑":"majmooe","¤":"vahed"},fi:{"∆":"delta","∞":"aarettomyys","♥":"rakkaus","&":"ja","|":"tai","<":"pienempi kuin",">":"suurempi kuin","∑":"summa","¤":"valuutta"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},ge:{"∆":"delta","∞":"usasruloba","♥":"siqvaruli","&":"da","|":"an","<":"naklebi",">":"meti","∑":"jami","¤":"valuta"},gr:{},hu:{"∆":"delta","∞":"vegtelen","♥":"szerelem","&":"es","|":"vagy","<":"kisebb mint",">":"nagyobb mint","∑":"szumma","¤":"penznem"},it:{"∆":"delta","∞":"infinito","♥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","∑":"somma","¤":"moneta"},lt:{"∆":"delta","∞":"begalybe","♥":"meile","&":"ir","|":"ar","<":"maziau nei",">":"daugiau nei","∑":"suma","¤":"valiuta"},lv:{"∆":"delta","∞":"bezgaliba","♥":"milestiba","&":"un","|":"vai","<":"mazak neka",">":"lielaks neka","∑":"summa","¤":"valuta"},my:{"∆":"kwahkhyaet","∞":"asaonasme","♥":"akhyait","&":"nhin","|":"tho","<":"ngethaw",">":"kyithaw","∑":"paungld","¤":"ngwekye"},mk:{},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},pl:{"∆":"delta","∞":"nieskonczonosc","♥":"milosc","&":"i","|":"lub","<":"mniejsze niz",">":"wieksze niz","∑":"suma","¤":"waluta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ro:{"∆":"delta","∞":"infinit","♥":"dragoste","&":"si","|":"sau","<":"mai mic ca",">":"mai mare ca","∑":"suma","¤":"valuta"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},sr:{},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},uk:{"∆":"delta","∞":"bezkinechnist","♥":"lubov","&":"i","|":"abo","<":"menshe",">":"bilshe","∑":"suma","¤":"valjuta"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}},l=[";","?",":","@","&","=","+","$",",","/"].join(""),c=[";","?",":","@","&","=","+","$",","].join(""),u=[".","!","~","*","'","(",")"].join(""),d=function(e,t){var n,d,g,f,m,v,b,y,x,C,D,w,A,E,j="-",B="",k="",S=!0,N={},F=""
3870if("string"!=typeof e)return""
3871if("string"==typeof t&&(j=t),b=s.en,y=o.en,"object"==typeof t)for(D in n=t.maintainCase||!1,N=t.custom&&"object"==typeof t.custom?t.custom:N,g=+t.truncate>1&&t.truncate||!1,f=t.uric||!1,m=t.uricNoSlash||!1,v=t.mark||!1,S=!1!==t.symbols&&!1!==t.lang,j=t.separator||j,f&&(F+=l),m&&(F+=c),v&&(F+=u),b=t.lang&&s[t.lang]&&S?s[t.lang]:S?s.en:{},y=t.lang&&o[t.lang]?o[t.lang]:!1===t.lang||!0===t.lang?{}:o.en,t.titleCase&&"number"==typeof t.titleCase.length&&Array.prototype.toString.call(t.titleCase)?(t.titleCase.forEach((function(e){N[e+""]=e+""})),d=!0):d=!!t.titleCase,t.custom&&"number"==typeof t.custom.length&&Array.prototype.toString.call(t.custom)&&t.custom.forEach((function(e){N[e+""]=e+""}
3871)),Object.keys(N).forEach((function(t){var n
3872n=t.length>1?new RegExp("\\b"+p(t)+"\\b","gi"):new RegExp(p(t),"gi"),e=e.replace(n,N[t])})),N)F+=D
3873for(F=p(F+=j),A=!1,E=!1,C=0,w=(e=e.replace(/(^\s+|\s+$)/g,"")).length;C<w;C++)D=e[C],h(D,N)?A=!1:y[D]?(D=A&&y[D].match(/[A-Za-z0-9]/)?" "+y[D]:y[D],A=!1):D in a?(C+1<w&&r.indexOf(e[C+1])>=0?(k+=D,D=""):!0===E?(D=i[k]+a[D],k=""):D=A&&a[D].match(/[A-Za-z0-9]/)?" "+a[D]:a[D],A=!1,E=!1):D in i?(k+=D,D="",C===w-1&&(D=i[k]),E=!0):!b[D]||f&&-1!==l.indexOf(D)||m&&-1!==c.indexOf(D)?(!0===E?(D=i[k]+D,k="",E=!1):A&&(/[A-Za-z0-9]/.test(D)||B.substr(-1).match(/A-Za-z0-9]/))&&(D=" "+D),A=!1):(D=A||B.substr(-1).match(/[A-Za-z0-9]/)?j+b[D]:b[D],D+=void 0!==e[C+1]&&e[C+1].match(/[A-Za-z0-9]/)?j:"",A=!0),B+=D.replace(new RegExp("[^\\w\\s"+F+"_-]","g"),j)
3874return d&&(B=B.replace(/(\w)(\S*)/g,(function(e,t,n){var a=t.toUpperCase()+(null!==n?n:"")
3875return Object.keys(N).indexOf(a.toLowerCase())<0?a:a.toLowerCase()}))),B=B.replace(/\s+/g,j).replace(new RegExp("\\"+j+"+","g"),j).replace(new RegExp("(^\\"+j+"+|\\"+j+"+$)","g"),""),g&&B.length>g&&(x=B.charAt(g)===j,B=B.slice(0,g),x||(B=B.slice(0,B.lastIndexOf(j)))),n||d||(B=B.toLowerCase()),B},p=function(e){return e.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},h=function(e,t){for(var n in t)if(t[n]===e)return!0}
3876e.exports?(e.exports=d,e.exports.createSlug=function(e){return function(t){return d(t,e)}}):void 0===(n=function(){return d}.apply(t,[]))||(e.exports=n)}()},93497:(e,t,n)=>{"use strict"
3877
3878;/*!
3879 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
3880 *
3881 * Copyright (c) 2014-2017, Jon Schlinkert.
3882 * Released under the MIT License.
3883 */
3884function a(e){return"[object Object]"===Object.prototype.toString.call(e)}function r(e){var t,n
3885return!1!==a(e)&&(void 0===(t=e.constructor)||!1!==a(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}n.d(t,{Q:()=>r})},48225:(e,t,n)=>{"use strict"
3886n.d(t,{A:()=>a})
3887const a=(0,n(40979).A)((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}))},61085:(e,t,n)=>{"use strict"
3888n.d(t,{A:()=>i})
3889var a=n(87771),r=0
3890const i=function(e){var t=++r
3891return(0,a.A)(e)+t}}}])
3892
3893//# sourceMappingURL=editor-e450545a26a7c9e3125d.js.map

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.